diff --git a/=4.0.0, b/=4.0.0, new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/sdk/ml/azure-ai-ml/CHANGELOG.md b/sdk/ml/azure-ai-ml/CHANGELOG.md index 1710961b9f2e..b3859e5c52c2 100644 --- a/sdk/ml/azure-ai-ml/CHANGELOG.md +++ b/sdk/ml/azure-ai-ml/CHANGELOG.md @@ -5,6 +5,9 @@ ### Bugs Fixed +### Other Changes +- Upgraded `marshmallow` dependency from version 3.x to 4.x (`>=4.0.0,<5.0.0`) for improved performance and compatibility with latest serialization standards. + ## 1.27.1 (2025-05-13) ### Bugs Fixed diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_arm_deployments/arm_deployment_executor.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_arm_deployments/arm_deployment_executor.py index fdcaa155d1cb..92f45eebf454 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_arm_deployments/arm_deployment_executor.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_arm_deployments/arm_deployment_executor.py @@ -15,18 +15,30 @@ _get_cloud_details, _resource_to_scopes, ) -from azure.ai.ml._utils._arm_id_utils import AzureResourceId, get_arm_id_object_from_id +from azure.ai.ml._utils._arm_id_utils import ( + AzureResourceId, + get_arm_id_object_from_id, +) from azure.ai.ml._utils._logger_utils import initialize_logger_info from azure.ai.ml._utils.utils import from_iso_duration_format_min_sec -from azure.ai.ml._vendor.azure_resources._resource_management_client import ResourceManagementClient -from azure.ai.ml._vendor.azure_resources.models import Deployment, DeploymentProperties +from azure.ai.ml._vendor.azure_resources._resource_management_client import ( + ResourceManagementClient, +) +from azure.ai.ml._vendor.azure_resources.models import ( + Deployment, + DeploymentProperties, +) from azure.ai.ml.constants._common import ( ENDPOINT_DEPLOYMENT_START_MSG, ArmConstants, LROConfigurations, OperationStatus, ) -from azure.ai.ml.exceptions import ErrorCategory, ErrorTarget, ValidationException +from azure.ai.ml.exceptions import ( + ErrorCategory, + ErrorTarget, + ValidationException, +) from azure.core.credentials import TokenCredential from azure.core.polling import LROPoller @@ -65,7 +77,9 @@ def __init__( self._deployments_client = self._client.deployments self._deployment_tracking = [] self._lock = None # To allow only one deployment to print - self._printed_set = set() # To prevent already printed deployment from re using the console + self._printed_set = ( + set() + ) # To prevent already printed deployment from re using the console self._resources_being_deployed = {} def deploy_resource( @@ -88,14 +102,17 @@ def deploy_resource( try: poller = self._get_poller(template=template, parameters=parameters) module_logger.info( - "The deployment request %s was accepted. ARM deployment URI for reference: \n", self._deployment_name - ) - endpoint_deployment_start_message = ENDPOINT_DEPLOYMENT_START_MSG.format( - _get_azure_portal_id_from_metadata(), - self._subscription_id, - self._resource_group_name, + "The deployment request %s was accepted. ARM deployment URI for reference: \n", self._deployment_name, ) + endpoint_deployment_start_message = ( + ENDPOINT_DEPLOYMENT_START_MSG.format( + _get_azure_portal_id_from_metadata(), + self._subscription_id, + self._resource_group_name, + self._deployment_name, + ) + ) module_logger.info(endpoint_deployment_start_message) if wait: try: @@ -120,7 +137,9 @@ def deploy_resource( else: return poller except Exception as ex: - module_logger.debug("Polling hit the exception: %s", type(ex).__name__) + module_logger.debug( + "Polling hit the exception: %s", type(ex).__name__ + ) raise ex if error is not None: @@ -128,12 +147,22 @@ def deploy_resource( module_logger.error(error_msg) raise error if len(resources_being_deployed) > 1 and total_duration: - module_logger.info("Total time : %s\n", from_iso_duration_format_min_sec(total_duration)) + module_logger.info( + "Total time : %s\n", + from_iso_duration_format_min_sec(total_duration), + ) return None - def _get_poller(self, template: str, parameters: Optional[Dict] = None, wait: bool = True) -> None: + def _get_poller( + self, + template: str, + parameters: Optional[Dict] = None, + wait: bool = True, + ) -> None: # deploy the template - properties = DeploymentProperties(template=template, parameters=parameters, mode="incremental") + properties = DeploymentProperties( + template=template, parameters=parameters, mode="incremental" + ) return self._deployments_client.begin_create_or_update( resource_group_name=self._resource_group_name, deployment_name=self._deployment_name, @@ -165,36 +194,52 @@ def _check_deployment_status(self) -> None: arm_id_obj = get_arm_id_object_from_id(target_resource.id) - resource_name = ( - f"{arm_id_obj.asset_name} {arm_id_obj.asset_version if hasattr(arm_id_obj,'asset_version') else ''}" - ) + resource_name = f"{arm_id_obj.asset_name} {arm_id_obj.asset_version if hasattr(arm_id_obj,'asset_version') else ''}" # do swap on asset_type to avoid collision with workspaces asset_type in arm id if isinstance(arm_id_obj, AzureResourceId): arm_id_obj.asset_type = ( arm_id_obj.asset_type - if not arm_id_obj.provider_namespace_with_type == "OperationalInsightsworkspaces" + if not arm_id_obj.provider_namespace_with_type + == "OperationalInsightsworkspaces" else "LogAnalytics" ) - deployment_message = deployment_message_mapping[arm_id_obj.asset_type].format(f"{resource_name} ") - if target_resource.resource_name not in self._resources_being_deployed: - self._resources_being_deployed[target_resource.resource_name] = ( + deployment_message = deployment_message_mapping[ + arm_id_obj.asset_type + ].format(f"{resource_name} ") + if ( + target_resource.resource_name + not in self._resources_being_deployed + ): + self._resources_being_deployed[ + target_resource.resource_name + ] = ( deployment_message, None, ) if ( properties.provisioning_state - and (not self._lock or self._lock == target_resource.resource_name) + and ( + not self._lock + or self._lock == target_resource.resource_name + ) and target_resource.resource_name not in self._printed_set ): - status_in_resource_dict = self._resources_being_deployed[target_resource.resource_name][1] + status_in_resource_dict = self._resources_being_deployed[ + target_resource.resource_name + ][1] module_logger.debug( - ("\n LOCK STATUS : %s, Status in the resources dict : %s , Already in printed set: %s\n"), + ( + "\n LOCK STATUS : %s, Status in the resources dict : %s , Already in printed set: %s\n" + ), self._lock, status_in_resource_dict, self._printed_set, ) - module_logger.debug("Locking with the deployment : %s\n\n", target_resource.resource_name) + module_logger.debug( + "Locking with the deployment : %s\n\n", + target_resource.resource_name, + ) self._lock = target_resource.resource_name provisioning_state = properties.provisioning_state request_id = properties.service_request_id @@ -206,12 +251,16 @@ def _check_deployment_status(self) -> None: if resource_name not in self._resources_being_deployed: resource_type, previous_state = resource_name, None else: - resource_type, previous_state = self._resources_being_deployed[resource_name] + resource_type, previous_state = ( + self._resources_being_deployed[resource_name] + ) duration = properties.duration # duration comes in format: "PT1M56.3454108S" try: - duration_in_min_sec = from_iso_duration_format_min_sec(duration) + duration_in_min_sec = from_iso_duration_format_min_sec( + duration + ) except Exception: # pylint: disable=W0718 duration_in_min_sec = "" @@ -220,7 +269,10 @@ def _check_deployment_status(self) -> None: provisioning_state, ) - if provisioning_state == OperationStatus.FAILED and previous_state != OperationStatus.FAILED: + if ( + provisioning_state == OperationStatus.FAILED + and previous_state != OperationStatus.FAILED + ): status_code = properties.status_code status_message = properties.status_message module_logger.debug( @@ -237,11 +289,18 @@ def _check_deployment_status(self) -> None: ) module_logger.debug( "More details: %s\n", - status_message.error.details[0].message if status_message.error.details else None, + ( + status_message.error.details[0].message + if status_message.error.details + else None + ), ) # self._lock = None # First time we're seeing this so let the user know it's being deployed - elif properties.provisioning_state == OperationStatus.RUNNING and previous_state is None: + elif ( + properties.provisioning_state == OperationStatus.RUNNING + and previous_state is None + ): module_logger.info("%s ", resource_type) elif ( properties.provisioning_state == OperationStatus.RUNNING @@ -251,11 +310,19 @@ def _check_deployment_status(self) -> None: # If the provisioning has already succeeded but we hadn't seen it Running before # (really quick deployment - so probably never happening) let user know resource # is being deployed and then let user know it has been deployed - elif properties.provisioning_state == OperationStatus.SUCCEEDED and previous_state is None: - module_logger.info("%s Done (%s)\n", resource_type, duration_in_min_sec) + elif ( + properties.provisioning_state == OperationStatus.SUCCEEDED + and previous_state is None + ): + module_logger.info( + "%s Done (%s)\n", resource_type, duration_in_min_sec + ) self._lock = None self._printed_set.add(resource_name) - module_logger.debug("Releasing lock for deployment: %s\n\n", target_resource.resource_name) + module_logger.debug( + "Releasing lock for deployment: %s\n\n", + target_resource.resource_name, + ) # Finally, deployment has succeeded and was previously running, so mark it as finished elif ( properties.provisioning_state == OperationStatus.SUCCEEDED @@ -264,4 +331,7 @@ def _check_deployment_status(self) -> None: module_logger.info(" Done (%s)\n", duration_in_min_sec) self._lock = None self._printed_set.add(resource_name) - module_logger.debug("Releasing lock for deployment: %s\n\n", target_resource.resource_name) + module_logger.debug( + "Releasing lock for deployment: %s\n\n", + target_resource.resource_name, + ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_arm_deployments/arm_helper.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_arm_deployments/arm_helper.py index 14070db725ca..272eb3d2b929 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_arm_deployments/arm_helper.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_arm_deployments/arm_helper.py @@ -55,7 +55,17 @@ def get_template(resource_type: str) -> Dict[str, Any]: if resource_type not in template_mapping: - msg = "can't find the template for the resource {}".format(resource_type) - raise ValidationException(message=msg, no_personal_data_message=msg, target=ErrorTarget.ARM_RESOURCE) - template_path = path.join(path.dirname(__file__), "arm_templates", template_mapping[resource_type]) + msg = "can't find the template for the resource {}".format( + resource_type + ) + raise ValidationException( + message=msg, + no_personal_data_message=msg, + target=ErrorTarget.ARM_RESOURCE, + ) + template_path = path.join( + path.dirname(__file__), + "arm_templates", + template_mapping[resource_type], + ) return load_json(file_path=template_path) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_artifacts/_artifact_utilities.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_artifacts/_artifact_utilities.py index c225a73e0d86..9c0afb34e74b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_artifacts/_artifact_utilities.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_artifacts/_artifact_utilities.py @@ -39,11 +39,21 @@ get_storage_client, ) from azure.ai.ml._utils.utils import is_mlflow_uri, is_url -from azure.ai.ml.constants._common import SHORT_URI_FORMAT, STORAGE_ACCOUNT_URLS +from azure.ai.ml.constants._common import ( + SHORT_URI_FORMAT, + STORAGE_ACCOUNT_URLS, +) from azure.ai.ml.entities import Environment -from azure.ai.ml.entities._assets._artifacts.artifact import Artifact, ArtifactStorageInfo +from azure.ai.ml.entities._assets._artifacts.artifact import ( + Artifact, + ArtifactStorageInfo, +) from azure.ai.ml.entities._datastore._constants import WORKSPACE_BLOB_STORE -from azure.ai.ml.exceptions import ErrorTarget, MlException, ValidationException +from azure.ai.ml.exceptions import ( + ErrorTarget, + MlException, + ValidationException, +) from azure.ai.ml.operations._datastore_operations import DatastoreOperations from azure.core.exceptions import HttpResponseError from azure.storage.blob import BlobSasPermissions, generate_blob_sas @@ -63,12 +73,19 @@ module_logger = logging.getLogger(__name__) -def _get_datastore_name(*, datastore_name: Optional[str] = WORKSPACE_BLOB_STORE) -> str: - datastore_name = WORKSPACE_BLOB_STORE if not datastore_name else datastore_name +def _get_datastore_name( + *, datastore_name: Optional[str] = WORKSPACE_BLOB_STORE +) -> str: + datastore_name = ( + WORKSPACE_BLOB_STORE if not datastore_name else datastore_name + ) try: datastore_name = get_resource_name_from_arm_id(datastore_name) except (ValueError, AttributeError, ValidationException): - module_logger.debug("datastore_name %s is not a full arm id. Proceed with a shortened name.\n", datastore_name) + module_logger.debug( + "datastore_name %s is not a full arm id. Proceed with a shortened name.\n", + datastore_name, + ) datastore_name = remove_aml_prefix(datastore_name) if is_ARM_id_for_resource(datastore_name): datastore_name = get_resource_name_from_arm_id(datastore_name) @@ -81,7 +98,16 @@ def get_datastore_info( *, credential=None, **kwargs, -) -> Dict[Literal["storage_type", "storage_account", "account_url", "container_name", "credential"], str]: +) -> Dict[ + Literal[ + "storage_type", + "storage_account", + "account_url", + "container_name", + "credential", + ], + str, +]: """Get datastore account, type, and auth information. :param operations: DatastoreOperations object @@ -101,9 +127,9 @@ def get_datastore_info( storage_endpoint = _get_storage_endpoint_from_metadata() datastore_info["storage_type"] = datastore.type datastore_info["storage_account"] = datastore.account_name - datastore_info["account_url"] = STORAGE_ACCOUNT_URLS[datastore.type].format( - datastore.account_name, storage_endpoint - ) + datastore_info["account_url"] = STORAGE_ACCOUNT_URLS[ + datastore.type + ].format(datastore.account_name, storage_endpoint) try: credential = operations._list_secrets(name=name, expirable_secret=True) @@ -130,7 +156,16 @@ def get_datastore_info( def list_logs_in_datastore( - ds_info: Dict[Literal["storage_type", "storage_account", "account_url", "container_name", "credential"], str], + ds_info: Dict[ + Literal[ + "storage_type", + "storage_account", + "account_url", + "container_name", + "credential", + ], + str, + ], prefix: str, legacy_log_folder_name: str, ) -> Dict[str, str]: @@ -164,7 +199,9 @@ def list_logs_in_datastore( items = storage_client.list(starts_with=prefix + "/user_logs/") # Append legacy log files if present - items.extend(storage_client.list(starts_with=prefix + legacy_log_folder_name)) + items.extend( + storage_client.list(starts_with=prefix + legacy_log_folder_name) + ) log_dict = {} for item_name in items: @@ -179,13 +216,15 @@ def list_logs_in_datastore( expiry=datetime.utcnow() + timedelta(minutes=30), ) elif isinstance(storage_client, Gen2StorageClient): - token = generate_file_sas( # pylint: disable=no-value-for-parameter - account_name=ds_info["storage_account"], - file_system_name=ds_info["container_name"], - file_name=item_name, - credential=ds_info["credential"], - permission=FileSasPermissions(read=True), - expiry=datetime.utcnow() + timedelta(minutes=30), + token = ( + generate_file_sas( # pylint: disable=no-value-for-parameter + account_name=ds_info["storage_account"], + file_system_name=ds_info["container_name"], + file_name=item_name, + credential=ds_info["credential"], + permission=FileSasPermissions(read=True), + expiry=datetime.utcnow() + timedelta(minutes=30), + ) ) log_dict[sub_name] = "{}/{}/{}?{}".format( @@ -239,10 +278,14 @@ def upload_artifact( :rtype: ArtifactStorageInfo """ if sas_uri: - storage_client = get_storage_client(credential=None, storage_account=None, account_url=sas_uri) + storage_client = get_storage_client( + credential=None, storage_account=None, account_url=sas_uri + ) else: datastore_name = _get_datastore_name(datastore_name=datastore_name) - datastore_info = get_datastore_info(datastore_operation, datastore_name) + datastore_info = get_datastore_info( + datastore_operation, datastore_name + ) storage_client = get_storage_client(**datastore_info) artifact_info = storage_client.upload( @@ -258,11 +301,19 @@ def upload_artifact( name=artifact_info["name"], version=artifact_info["version"], relative_path=artifact_info["remote path"], - datastore_arm_id=get_datastore_arm_id(datastore_name, operation_scope) if not sas_uri else None, + datastore_arm_id=( + get_datastore_arm_id(datastore_name, operation_scope) + if not sas_uri + else None + ), container_name=( - storage_client.container if isinstance(storage_client, BlobStorageClient) else storage_client.file_system + storage_client.container + if isinstance(storage_client, BlobStorageClient) + else storage_client.file_system + ), + storage_account_url=( + datastore_info.get("account_url") if not sas_uri else sas_uri ), - storage_account_url=datastore_info.get("account_url") if not sas_uri else sas_uri, indicator_file=artifact_info["indicator file"], is_file=Path(local_path).is_file(), ) @@ -291,10 +342,16 @@ def download_artifact( :return: Path that files were written to :rtype: str """ - starts_with = starts_with.as_posix() if isinstance(starts_with, Path) else starts_with + starts_with = ( + starts_with.as_posix() + if isinstance(starts_with, Path) + else starts_with + ) datastore_name = _get_datastore_name(datastore_name=datastore_name) if datastore_info is None: - datastore_info = get_datastore_info(datastore_operation, datastore_name) + datastore_info = get_datastore_info( + datastore_operation, datastore_name + ) storage_client = get_storage_client(**datastore_info) storage_client.download(starts_with=starts_with, destination=destination) return destination @@ -322,7 +379,8 @@ def download_artifact_from_storage_url( datastore_name = _get_datastore_name(datastore_name=datastore_name) datastore_info = get_datastore_info(datastore_operation, datastore_name) starts_with = get_artifact_path_from_storage_url( - blob_url=str(blob_url), container_name=datastore_info.get("container_name") + blob_url=str(blob_url), + container_name=datastore_info.get("container_name"), ) return download_artifact( starts_with=starts_with, @@ -333,7 +391,9 @@ def download_artifact_from_storage_url( ) -def download_artifact_from_aml_uri(uri: str, destination: str, datastore_operation: DatastoreOperations) -> str: +def download_artifact_from_aml_uri( + uri: str, destination: str, datastore_operation: DatastoreOperations +) -> str: """Downloads artifact pointed to by URI of the form `azureml://...` to destination. :param str uri: AzureML uri of artifact to download @@ -352,7 +412,9 @@ def download_artifact_from_aml_uri(uri: str, destination: str, datastore_operati def aml_datastore_path_exists( - uri: str, datastore_operation: DatastoreOperations, datastore_info: Optional[dict] = None + uri: str, + datastore_operation: DatastoreOperations, + datastore_info: Optional[dict] = None, ) -> bool: """Checks whether `uri` of the form "azureml://" points to either a directory or a file. @@ -363,7 +425,9 @@ def aml_datastore_path_exists( :rtype: bool """ parsed_uri = AzureMLDatastorePathUri(uri) - datastore_info = datastore_info or get_datastore_info(datastore_operation, parsed_uri.datastore) + datastore_info = datastore_info or get_datastore_info( + datastore_operation, parsed_uri.datastore + ) return get_storage_client(**datastore_info).exists(parsed_uri.path) @@ -438,7 +502,9 @@ def _update_metadata(name, version, indicator_file, datastore_info) -> None: _update_gen2_metadata(name, version, indicator_file, storage_client) -def _update_blob_metadata(name, version, indicator_file, storage_client) -> None: +def _update_blob_metadata( + name, version, indicator_file, storage_client +) -> None: container_client = storage_client.container_client if indicator_file.startswith(storage_client.container): indicator_file = indicator_file.split(storage_client.container)[1] @@ -446,9 +512,15 @@ def _update_blob_metadata(name, version, indicator_file, storage_client) -> None blob.set_blob_metadata(_build_metadata_dict(name=name, version=version)) -def _update_gen2_metadata(name, version, indicator_file, storage_client) -> None: - artifact_directory_client = storage_client.file_system_client.get_directory_client(indicator_file) - artifact_directory_client.set_metadata(_build_metadata_dict(name=name, version=version)) +def _update_gen2_metadata( + name, version, indicator_file, storage_client +) -> None: + artifact_directory_client = ( + storage_client.file_system_client.get_directory_client(indicator_file) + ) + artifact_directory_client.set_metadata( + _build_metadata_dict(name=name, version=version) + ) T = TypeVar("T", bound=Artifact) @@ -522,7 +594,9 @@ def _check_and_upload_path( ignore_file=getattr(artifact, "_ignore_file", None), blob_uri=blob_uri, ) - indicator_file = uploaded_artifact.indicator_file # reference to storage contents + indicator_file = ( + uploaded_artifact.indicator_file + ) # reference to storage contents if artifact._is_anonymous: artifact.name, artifact.version = ( uploaded_artifact.name, @@ -554,11 +628,15 @@ def _check_and_upload_env_build_context( ) if environment.build is not None: # TODO: Depending on decision trailing "/" needs to stay or not. EMS requires it to be present - environment.build.path = str(uploaded_artifact.full_storage_path) + "/" + environment.build.path = ( + str(uploaded_artifact.full_storage_path) + "/" + ) return environment -def _get_snapshot_path_info(artifact) -> Optional[Tuple[Path, IgnoreFile, str]]: +def _get_snapshot_path_info( + artifact, +) -> Optional[Tuple[Path, IgnoreFile, str]]: """ Validate an Artifact's local path and get its resolved path, ignore file, and hash. If no local path, return None. :param artifact: Artifact object diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_artifacts/_blob_storage_helper.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_artifacts/_blob_storage_helper.py index 4cd8ced1e9a7..2777c99e734d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_artifacts/_blob_storage_helper.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_artifacts/_blob_storage_helper.py @@ -36,7 +36,12 @@ upload_file, ) from azure.ai.ml.constants._common import STORAGE_AUTH_MISMATCH_ERROR -from azure.ai.ml.exceptions import ErrorCategory, ErrorTarget, MlException, ValidationException +from azure.ai.ml.exceptions import ( + ErrorCategory, + ErrorTarget, + MlException, + ValidationException, +) from azure.core.exceptions import HttpResponseError, ResourceNotFoundError from azure.storage.blob import BlobServiceClient, ContainerClient @@ -47,16 +52,31 @@ class BlobStorageClient: - def __init__(self, credential: str, account_url: str, container_name: Optional[str] = None): + def __init__( + self, + credential: str, + account_url: str, + container_name: Optional[str] = None, + ): self.account_name = account_url.split(".")[0].split("//")[1] - self.service_client = BlobServiceClient(account_url=account_url, credential=credential) + self.service_client = BlobServiceClient( + account_url=account_url, credential=credential + ) self.upload_to_root_container = None if container_name: - self.container_client = self.service_client.get_container_client(container=container_name) + self.container_client = self.service_client.get_container_client( + container=container_name + ) else: - self.container_client = ContainerClient.from_container_url(account_url) + self.container_client = ContainerClient.from_container_url( + account_url + ) self.upload_to_root_container = True - self.container = container_name if container_name else self.container_client.container_name + self.container = ( + container_name + if container_name + else self.container_client.container_name + ) self.total_file_count = 1 self.uploaded_file_count = 0 self.overwrite = False @@ -73,7 +93,9 @@ def upload( ignore_file: IgnoreFile = IgnoreFile(None), asset_hash: Optional[str] = None, show_progress: bool = True, - ) -> Dict[Literal["remote path", "name", "version", "indicator file"], str]: + ) -> Dict[ + Literal["remote path", "name", "version", "indicator file"], str + ]: """Upload a file or directory to a path inside the container. :param source: The path to either a file or directory to upload @@ -92,9 +114,15 @@ def upload( :rtype: Dict[Literal["remote path", "name", "version", "indicator file"], str] """ if name and version is None: - version = str(uuid.uuid4()) # placeholder for auto-increment artifacts - - asset_id = generate_asset_id(asset_hash, include_directory=True) if not self.upload_to_root_container else "" + version = str( + uuid.uuid4() + ) # placeholder for auto-increment artifacts + + asset_id = ( + generate_asset_id(asset_hash, include_directory=True) + if not self.upload_to_root_container + else "" + ) source_name = Path(source).name dest = str(PurePosixPath(asset_id, source_name)) @@ -112,10 +140,16 @@ def upload( file_size, _ = get_directory_size(source, ignore_file=ignore_file) file_size_in_mb = file_size / 10**6 cloud = _get_cloud_details() - cloud_endpoint = cloud["storage_endpoint"] # make sure proper cloud endpoint is used + cloud_endpoint = cloud[ + "storage_endpoint" + ] # make sure proper cloud endpoint is used full_storage_url = f"https://{self.account_name}.blob.{cloud_endpoint}/{self.container}/{dest}" if file_size_in_mb > 100: - module_logger.warning(FILE_SIZE_WARNING.format(source=source, destination=full_storage_url)) + module_logger.warning( + FILE_SIZE_WARNING.format( + source=source, destination=full_storage_url + ) + ) # start upload if os.path.isdir(source): @@ -167,17 +201,29 @@ def check_blob_exists(self) -> None: """ try: - legacy_indicator_file = self.indicator_file.replace(ARTIFACT_ORIGIN, LEGACY_ARTIFACT_DIRECTORY) - blob_client = self.container_client.get_blob_client(blob=self.indicator_file) - legacy_blob_client = self.container_client.get_blob_client(blob=legacy_indicator_file) + legacy_indicator_file = self.indicator_file.replace( + ARTIFACT_ORIGIN, LEGACY_ARTIFACT_DIRECTORY + ) + blob_client = self.container_client.get_blob_client( + blob=self.indicator_file + ) + legacy_blob_client = self.container_client.get_blob_client( + blob=legacy_indicator_file + ) try: properties = blob_client.get_blob_properties() except HttpResponseError as e: - if e.error_code == KEY_AUTHENTICATION_ERROR_CODE: # pylint: disable=no-member - formatted_msg = SAS_KEY_AUTHENTICATION_ERROR_MSG.format(e.error_code, e.exc_value) + if ( + e.error_code == KEY_AUTHENTICATION_ERROR_CODE + ): # pylint: disable=no-member + formatted_msg = SAS_KEY_AUTHENTICATION_ERROR_MSG.format( + e.error_code, e.exc_value + ) exception_with_documentation = Exception(formatted_msg) - exception_with_documentation.__traceback__ = e.exc_traceback + exception_with_documentation.__traceback__ = ( + e.exc_traceback + ) raise exception_with_documentation from e raise e @@ -189,7 +235,8 @@ def check_blob_exists(self) -> None: legacy_metadata = legacy_properties.get("metadata") if ( - legacy_metadata and UPLOAD_CONFIRMATION.items() <= legacy_metadata.items() + legacy_metadata + and UPLOAD_CONFIRMATION.items() <= legacy_metadata.items() ): # checks if metadata dictionary includes confirmation key and value self.name = legacy_metadata.get("name") self.version = legacy_metadata.get("version") @@ -209,7 +256,10 @@ def check_blob_exists(self) -> None: pass except Exception as e: # pylint: disable=no-member - if hasattr(e, "error_code") and e.error_code == STORAGE_AUTH_MISMATCH_ERROR: + if ( + hasattr(e, "error_code") + and e.error_code == STORAGE_AUTH_MISMATCH_ERROR + ): msg = ( "You don't have permission to alter this storage account. " "Ensure that you have been assigned both Storage Blob Data Reader " @@ -224,7 +274,9 @@ def check_blob_exists(self) -> None: raise e def _set_confirmation_metadata(self, name: str, version: str) -> None: - blob_client = self.container_client.get_blob_client(blob=self.indicator_file) + blob_client = self.container_client.get_blob_client( + blob=self.indicator_file + ) metadata_dict = _build_metadata_dict(name, version) blob_client.set_blob_metadata(metadata_dict) @@ -244,10 +296,17 @@ def download( :type max_concurrency: int """ try: - my_list = list(self.container_client.list_blobs(name_starts_with=starts_with, include="metadata")) + my_list = list( + self.container_client.list_blobs( + name_starts_with=starts_with, include="metadata" + ) + ) download_size_in_mb = 0 for item in my_list: - blob_name = item.name[len(starts_with) :].lstrip("/") or Path(starts_with).name + blob_name = ( + item.name[len(starts_with) :].lstrip("/") + or Path(starts_with).name + ) target_path = Path(destination, blob_name).resolve() if _blob_is_hdi_folder(item): @@ -263,7 +322,11 @@ def download( full_storage_url = f"https://{self.account_name}.blob.{cloud_endpoint}/{self.container}/{starts_with}" download_size_in_mb += blob_content.size / 10**6 if download_size_in_mb > 100: - module_logger.warning(FILE_SIZE_WARNING.format(source=full_storage_url, destination=destination)) + module_logger.warning( + FILE_SIZE_WARNING.format( + source=full_storage_url, destination=destination + ) + ) blob_content = blob_content.content_as_bytes(max_concurrency) target_path.parent.mkdir(parents=True, exist_ok=True) @@ -275,7 +338,9 @@ def download( msg = "Saving blob with prefix {} was unsuccessful. exception={}" raise MlException( message=msg.format(starts_with, e), - no_personal_data_message=msg.format("[starts_with]", "[exception]"), + no_personal_data_message=msg.format( + "[starts_with]", "[exception]" + ), target=ErrorTarget.ARTIFACT, error_category=ErrorCategory.USER_ERROR, error=e, @@ -315,11 +380,16 @@ def exists(self, blobpath: str, delimiter: str = "/") -> bool: if self.container_client.get_blob_client(blobpath).exists(): return True - ensure_delimeter = delimiter if not blobpath.endswith(delimiter) else "" + ensure_delimeter = ( + delimiter if not blobpath.endswith(delimiter) else "" + ) # Virtual directory only exists if there is atleast one blob with it result = next( - self.container_client.walk_blobs(name_starts_with=blobpath + ensure_delimeter, delimiter=delimiter), + self.container_client.walk_blobs( + name_starts_with=blobpath + ensure_delimeter, + delimiter=delimiter, + ), None, ) return result is not None @@ -341,4 +411,7 @@ def _blob_is_hdi_folder(blob: "BlobProperties") -> bool: # requested from whatever function generates the blobproperties object # # e.g self.container_client.list_blobs(..., include='metadata') - return bool(blob.metadata and blob.metadata.get(BLOB_DATASTORE_IS_HDI_FOLDER_KEY, None)) + return bool( + blob.metadata + and blob.metadata.get(BLOB_DATASTORE_IS_HDI_FOLDER_KEY, None) + ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_artifacts/_constants.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_artifacts/_constants.py index 8c9e97ea84c5..41fcabe0fc31 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_artifacts/_constants.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_artifacts/_constants.py @@ -25,30 +25,30 @@ "and cannot be overwritten. Please provide a unique name or version " "to successfully create a new code asset." ) -CHANGED_ASSET_PATH_MSG_NO_PERSONAL_DATA = "The code asset is already linked to an asset." -EMPTY_DIRECTORY_ERROR = "Directory {0} is empty. path or local_path must be a non-empty directory." +CHANGED_ASSET_PATH_MSG_NO_PERSONAL_DATA = ( + "The code asset is already linked to an asset." +) +EMPTY_DIRECTORY_ERROR = ( + "Directory {0} is empty. path or local_path must be a non-empty directory." +) FILE_SIZE_WARNING = ( "Your file exceeds 100 MB. If you experience low speeds, latency, or broken connections, we recommend using " "the AzCopyv10 tool for this file transfer.\n\nExample: azcopy copy '{source}' '{destination}' " # cspell:disable-line "\n\nSee https://learn.microsoft.com/azure/storage/common/storage-use-azcopy-v10 for more information." ) INVALID_MLTABLE_METADATA_SCHEMA_MSG = "Invalid MLTable metadata schema" -INVALID_MLTABLE_METADATA_SCHEMA_ERROR = ( - "{jsonSchemaErrorPath}{jsonSchemaMessage}\n{invalidMLTableMsg}:\n{invalidSchemaSnippet}" -) +INVALID_MLTABLE_METADATA_SCHEMA_ERROR = "{jsonSchemaErrorPath}{jsonSchemaMessage}\n{invalidMLTableMsg}:\n{invalidSchemaSnippet}" BLOB_DATASTORE_IS_HDI_FOLDER_KEY = "hdi_isfolder" BLOB_STORAGE_CLIENT_NAME = "BlobStorageClient" GEN2_STORAGE_CLIENT_NAME = "Gen2StorageClient" DEFAULT_CONNECTION_TIMEOUT = 14400 -STORAGE_URI_REGEX = ( - r"(https:\/\/([a-zA-Z0-9@:%_\\\-+~#?&=]+)[a-zA-Z0-9@:%._\\\-+~#?&=]+\.?)\/([a-zA-Z0-9@:%._\\\-+~#?&=]+)\/?(.*)" -) +STORAGE_URI_REGEX = r"(https:\/\/([a-zA-Z0-9@:%_\\\-+~#?&=]+)[a-zA-Z0-9@:%._\\\-+~#?&=]+\.?)\/([a-zA-Z0-9@:%._\\\-+~#?&=]+)\/?(.*)" -WORKSPACE_MANAGED_DATASTORE_WITH_SLASH = "azureml://datastores/workspacemanageddatastore/" -WORKSPACE_MANAGED_DATASTORE = "azureml://datastores/workspacemanageddatastore" -AUTO_DELETE_SETTING_NOT_ALLOWED_ERROR_NO_PERSONAL_DATA = ( - "Auto delete setting cannot be specified in JobOutput now. Please remove it and try again." +WORKSPACE_MANAGED_DATASTORE_WITH_SLASH = ( + "azureml://datastores/workspacemanageddatastore/" ) +WORKSPACE_MANAGED_DATASTORE = "azureml://datastores/workspacemanageddatastore" +AUTO_DELETE_SETTING_NOT_ALLOWED_ERROR_NO_PERSONAL_DATA = "Auto delete setting cannot be specified in JobOutput now. Please remove it and try again." INVALID_MANAGED_DATASTORE_PATH_ERROR_NO_PERSONAL_DATA = f'Cannot specify a sub-path for workspace managed datastore. Please set "{WORKSPACE_MANAGED_DATASTORE}" as the path.' SAS_KEY_AUTHENTICATION_ERROR_MSG = ( "{0}\n{1}\n" diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_artifacts/_fileshare_storage_helper.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_artifacts/_fileshare_storage_helper.py index 01da568cb59a..1b73e19c9dcf 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_artifacts/_fileshare_storage_helper.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_artifacts/_fileshare_storage_helper.py @@ -36,7 +36,9 @@ class FileStorageClient: - def __init__(self, credential: str, file_share_name: str, account_url: str): + def __init__( + self, credential: str, file_share_name: str, account_url: str + ): self.directory_client = ShareDirectoryClient( account_url=account_url, credential=credential, @@ -117,7 +119,9 @@ def upload( ignore_file=ignore_file, ) else: - self.upload_file(source, asset_id, msg=msg, show_progress=show_progress) + self.upload_file( + source, asset_id, msg=msg, show_progress=show_progress + ) # upload must be completed before we try to generate confirmation file while self.uploaded_file_count < self.total_file_count: @@ -128,7 +132,11 @@ def upload( version = str(self.version) if self.legacy: dest = dest.replace(ARTIFACT_ORIGIN, LEGACY_ARTIFACT_DIRECTORY) - artifact_info: Dict = {"remote path": dest, "name": name, "version": version} + artifact_info: Dict = { + "remote path": dest, + "name": name, + "version": version, + } return artifact_info @@ -161,7 +169,9 @@ def upload_file( Only used if `in_directory` and `show_progress` are True. :type callback: Optional[Callable[[Dict], None]] """ - validate_content = os.stat(source).st_size > 0 # don't do checksum for empty files + validate_content = ( + os.stat(source).st_size > 0 + ) # don't do checksum for empty files with open(source, "rb") as data: if in_directory: @@ -190,7 +200,11 @@ def upload_file( raw_response_hook=pbar.update_to, ) else: - self.directory_client.upload_file(file_name=dest, data=data, validate_content=validate_content) + self.directory_client.upload_file( + file_name=dest, + data=data, + validate_content=validate_content, + ) self.uploaded_file_count = self.uploaded_file_count + 1 def upload_dir( @@ -219,7 +233,11 @@ def upload_dir( prefix = "" if dest == "" else dest + "/" prefix += os.path.basename(source) + "/" - upload_paths = sorted(get_upload_files_from_folder(source_path, prefix=prefix, ignore_file=ignore_file)) + upload_paths = sorted( + get_upload_files_from_folder( + source_path, prefix=prefix, ignore_file=ignore_file + ) + ) self.total_file_count = len(upload_paths) for root, *_ in os.walk(source): # type: ignore[type-var] @@ -231,7 +249,9 @@ def upload_dir( subdir = subdir.create_subdirectory(trunc_root) if show_progress: - with DirectoryUploadProgressBar(dir_size=get_directory_size(source_path), msg=msg) as pbar: + with DirectoryUploadProgressBar( + dir_size=get_directory_size(source_path), msg=msg + ) as pbar: for src, destination in upload_paths: self.upload_file( src, @@ -261,11 +281,13 @@ def exists(self, asset_id: str) -> bool: """ # get dictionary of asset ids and if each asset is a file or directory (e.g. {"ijd930j23d8": True}) default_directory_items = { - item["name"]: item["is_directory"] for item in self.directory_client.list_directories_and_files() + item["name"]: item["is_directory"] + for item in self.directory_client.list_directories_and_files() } try: legacy_directory_items = { - item["name"]: item["is_directory"] for item in self.legacy_directory_client.list_directories_and_files() + item["name"]: item["is_directory"] + for item in self.legacy_directory_client.list_directories_and_files() } except ResourceNotFoundError: # if the legacy directory does not exist, a ResourceNotFoundError is thrown. For a new file share @@ -277,14 +299,18 @@ def exists(self, asset_id: str) -> bool: existing_items = {**default_directory_items, **legacy_directory_items} if asset_id in existing_items: - client, properties = self._get_asset_metadata(asset_id, default_directory_items, legacy_directory_items) + client, properties = self._get_asset_metadata( + asset_id, default_directory_items, legacy_directory_items + ) metadata = properties.get("metadata") if metadata and UPLOAD_CONFIRMATION.items() <= metadata.items(): self.name = metadata.get("name") self.version = metadata.get("version") return True if not self.legacy: - delete(client) # If past upload never reached upload confirmation, delete and proceed to upload + delete( + client + ) # If past upload never reached upload confirmation, delete and proceed to upload return False def download( @@ -309,7 +335,9 @@ def download( max_concurrency=max_concurrency, ) - def _set_confirmation_metadata(self, source: str, dest: str, name: str, version: str) -> None: + def _set_confirmation_metadata( + self, source: str, dest: str, name: str, version: str + ) -> None: metadata_dict = _build_metadata_dict(name, version) if os.path.isdir(source): properties = self.directory_client.get_subdirectory_client(dest) @@ -331,7 +359,9 @@ def _get_asset_metadata( if legacy_items.get(asset_id) is True: self.legacy = True - client = self.legacy_directory_client.get_subdirectory_client(asset_id) + client = self.legacy_directory_client.get_subdirectory_client( + asset_id + ) properties = client.get_directory_properties() elif legacy_items.get(asset_id) is False: self.legacy = True @@ -399,7 +429,9 @@ def recursive_download( :type starts_with: str """ try: - items = list(client.list_directories_and_files(name_starts_with=starts_with)) + items = list( + client.list_directories_and_files(name_starts_with=starts_with) + ) files = [item for item in items if not item["is_directory"]] folders = [item for item in items if item["is_directory"]] @@ -407,7 +439,9 @@ def recursive_download( Path(destination).mkdir(parents=True, exist_ok=True) file_name = f["name"] file_client = client.get_file_client(file_name) - file_content = file_client.download_file(max_concurrency=max_concurrency) + file_content = file_client.download_file( + max_concurrency=max_concurrency + ) local_path = Path(destination, file_name) with open(local_path, "wb") as file_data: file_data.write(file_content.readall()) @@ -415,7 +449,11 @@ def recursive_download( for f in folders: sub_client = client.get_subdirectory_client(f["name"]) destination = "/".join((destination, f["name"])) - recursive_download(sub_client, destination=destination, max_concurrency=max_concurrency) + recursive_download( + sub_client, + destination=destination, + max_concurrency=max_concurrency, + ) except Exception as e: msg = f"Saving fileshare directory with prefix {starts_with} was unsuccessful." raise MlException( diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_artifacts/_gen2_storage_helper.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_artifacts/_gen2_storage_helper.py index 7cd3b6c6dab0..df0bb41c193f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_artifacts/_gen2_storage_helper.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_artifacts/_gen2_storage_helper.py @@ -15,7 +15,10 @@ from colorama import Fore from typing_extensions import Literal -from azure.ai.ml._artifacts._constants import FILE_SIZE_WARNING, UPLOAD_CONFIRMATION +from azure.ai.ml._artifacts._constants import ( + FILE_SIZE_WARNING, + UPLOAD_CONFIRMATION, +) from azure.ai.ml._azure_environments import _get_cloud_details from azure.ai.ml._utils._asset_utils import ( AssetNotChangedError, @@ -27,7 +30,12 @@ upload_file, ) from azure.ai.ml.constants._common import STORAGE_AUTH_MISMATCH_ERROR -from azure.ai.ml.exceptions import ErrorCategory, ErrorTarget, MlException, ValidationException +from azure.ai.ml.exceptions import ( + ErrorCategory, + ErrorTarget, + MlException, + ValidationException, +) from azure.core.exceptions import ResourceExistsError from azure.storage.filedatalake import DataLakeServiceClient @@ -40,14 +48,22 @@ def __init__(self, credential: str, file_system: str, account_url: str): self.file_system = file_system try: - service_client = DataLakeServiceClient(account_url=account_url, credential=credential) - self.file_system_client = service_client.get_file_system_client(file_system=file_system) + service_client = DataLakeServiceClient( + account_url=account_url, credential=credential + ) + self.file_system_client = service_client.get_file_system_client( + file_system=file_system + ) except ValueError as e: api_version = e.args[0].split("\n")[-1] service_client = DataLakeServiceClient( - account_url=account_url, credential=credential, api_version=api_version + account_url=account_url, + credential=credential, + api_version=api_version, + ) + self.file_system_client = service_client.get_file_system_client( + file_system=file_system ) - self.file_system_client = service_client.get_file_system_client(file_system=file_system) try: self.file_system_client.create_file_system() @@ -71,7 +87,9 @@ def upload( ignore_file: IgnoreFile = IgnoreFile(None), asset_hash: Optional[str] = None, show_progress: bool = True, - ) -> Dict[Literal["remote path", "name", "version", "indicator file"], str]: + ) -> Dict[ + Literal["remote path", "name", "version", "indicator file"], str + ]: """Upload a file or directory to a path inside the filesystem. :param source: The path to either a file or directory to upload @@ -90,7 +108,9 @@ def upload( :rtype: Dict[Literal["remote path", "name", "version", "indicator file"], str] """ if name and version is None: - version = str(uuid.uuid4()) # placeholder for auto-increment artifacts + version = str( + uuid.uuid4() + ) # placeholder for auto-increment artifacts asset_id = generate_asset_id(asset_hash, include_directory=True) source_name = Path(source).name @@ -111,13 +131,21 @@ def upload( file_size_in_mb = file_size / 10**6 cloud = _get_cloud_details() - cloud_endpoint = cloud["storage_endpoint"] # make sure proper cloud endpoint is used + cloud_endpoint = cloud[ + "storage_endpoint" + ] # make sure proper cloud endpoint is used full_storage_url = f"https://{self.account_name}.dfs.{cloud_endpoint}/{self.file_system}/{dest}" if file_size_in_mb > 100: - module_logger.warning(FILE_SIZE_WARNING.format(source=source, destination=full_storage_url)) + module_logger.warning( + FILE_SIZE_WARNING.format( + source=source, destination=full_storage_url + ) + ) # start upload - self.directory_client = self.file_system_client.get_directory_client(asset_id) + self.directory_client = ( + self.file_system_client.get_directory_client(asset_id) + ) self.check_blob_exists() if os.path.isdir(source): @@ -165,18 +193,27 @@ def check_blob_exists(self) -> None: overwritten with a complete upload. """ try: - if self.directory_client is not None and self.directory_client.exists(): - metadata = self.directory_client.get_directory_properties().metadata + if ( + self.directory_client is not None + and self.directory_client.exists() + ): + metadata = ( + self.directory_client.get_directory_properties().metadata + ) if ( - metadata and UPLOAD_CONFIRMATION.items() <= metadata.items() + metadata + and UPLOAD_CONFIRMATION.items() <= metadata.items() ): # checks if metadata dictionary includes confirmation key and value self.name = metadata.get("name") self.version = metadata.get("version") raise AssetNotChangedError except Exception as e: # pylint: disable=no-member - if hasattr(e, "error_code") and e.error_code == STORAGE_AUTH_MISMATCH_ERROR: + if ( + hasattr(e, "error_code") + and e.error_code == STORAGE_AUTH_MISMATCH_ERROR + ): msg = ( "You don't have permission to alter this storage account. " "Ensure that you have been assigned both " @@ -192,9 +229,15 @@ def check_blob_exists(self) -> None: def _set_confirmation_metadata(self, name: str, version: str) -> None: if self.directory_client is not None: - self.directory_client.set_metadata(_build_metadata_dict(name, version)) + self.directory_client.set_metadata( + _build_metadata_dict(name, version) + ) - def download(self, starts_with: str, destination: Union[str, os.PathLike] = Path.home()) -> None: + def download( + self, + starts_with: str, + destination: Union[str, os.PathLike] = Path.home(), + ) -> None: """Downloads all items inside a specified filesystem directory with the prefix `starts_with` to the destination folder. @@ -207,22 +250,35 @@ def download(self, starts_with: str, destination: Union[str, os.PathLike] = Path mylist = self.file_system_client.get_paths(path=starts_with) download_size_in_mb = 0 for item in mylist: - file_name = item.name[len(starts_with) :].lstrip("/") or Path(starts_with).name + file_name = ( + item.name[len(starts_with) :].lstrip("/") + or Path(starts_with).name + ) target_path = Path(destination, file_name) if item.is_directory: target_path.mkdir(parents=True, exist_ok=True) continue - file_client = self.file_system_client.get_file_client(item.name) + file_client = self.file_system_client.get_file_client( + item.name + ) # check if total size of download has exceeded 100 MB cloud = _get_cloud_details() - cloud_endpoint = cloud["storage_endpoint"] # make sure proper cloud endpoint is used + cloud_endpoint = cloud[ + "storage_endpoint" + ] # make sure proper cloud endpoint is used full_storage_url = f"https://{self.account_name}.dfs.{cloud_endpoint}/{self.file_system}/{starts_with}" - download_size_in_mb += file_client.get_file_properties().size / 10**6 + download_size_in_mb += ( + file_client.get_file_properties().size / 10**6 + ) if download_size_in_mb > 100: - module_logger.warning(FILE_SIZE_WARNING.format(source=full_storage_url, destination=destination)) + module_logger.warning( + FILE_SIZE_WARNING.format( + source=full_storage_url, destination=destination + ) + ) file_content = file_client.download_file().readall() try: @@ -237,7 +293,9 @@ def download(self, starts_with: str, destination: Union[str, os.PathLike] = Path msg = "Saving output with prefix {} was unsuccessful. exception={}" raise MlException( message=msg.format(starts_with, e), - no_personal_data_message=msg.format("[starts_with]", "[exception]"), + no_personal_data_message=msg.format( + "[starts_with]", "[exception]" + ), target=ErrorTarget.ARTIFACT, error_category=ErrorCategory.USER_ERROR, error=e, @@ -252,7 +310,10 @@ def list(self, starts_with: str) -> List[str]: :return: The list of filenames that start with the prefix :rtype: List[str] """ - return [f.get("name") for f in self.file_system_client.get_paths(path=starts_with)] + return [ + f.get("name") + for f in self.file_system_client.get_paths(path=starts_with) + ] def exists(self, path: str) -> bool: """Returns whether there exists a file named `path` diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_azure_environments.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_azure_environments.py index ceafda555d58..7d843b25cad0 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_azure_environments.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_azure_environments.py @@ -67,7 +67,9 @@ class CloudArgumentKeys: def _get_cloud(cloud: str) -> Dict[str, str]: if cloud in _environments: return _environments[cloud] - arm_url = os.environ.get(ArmConstants.METADATA_URL_ENV_NAME, ArmConstants.DEFAULT_URL) + arm_url = os.environ.get( + ArmConstants.METADATA_URL_ENV_NAME, ArmConstants.DEFAULT_URL + ) arm_clouds = _get_clouds_by_metadata_url(arm_url) try: new_cloud = arm_clouds[cloud] @@ -90,9 +92,14 @@ def _get_default_cloud_name() -> str: return current_cloud_env arm_metadata_url = os.getenv(ArmConstants.METADATA_URL_ENV_NAME) if arm_metadata_url is not None: - clouds = _get_clouds_by_metadata_url(arm_metadata_url) # prefer ARM metadata url when set + clouds = _get_clouds_by_metadata_url( + arm_metadata_url + ) # prefer ARM metadata url when set for cloud_name in clouds: # pylint: disable=consider-using-dict-items - if clouds[cloud_name][EndpointURLS.RESOURCE_MANAGER_ENDPOINT] in arm_metadata_url: + if ( + clouds[cloud_name][EndpointURLS.RESOURCE_MANAGER_ENDPOINT] + in arm_metadata_url + ): _set_cloud(cloud_name) return cloud_name return AzureEnvironments.ENV_DEFAULT @@ -125,14 +132,18 @@ def _set_cloud(cloud_name: Optional[str] = None): try: _get_cloud(cloud_name) except Exception as e: - msg = 'Unknown cloud environment supplied: "{0}".'.format(cloud_name) + msg = 'Unknown cloud environment supplied: "{0}".'.format( + cloud_name + ) raise MlException(message=msg, no_personal_data_message=msg) from e else: cloud_name = _get_default_cloud_name() os.environ[AZUREML_CLOUD_ENV_NAME] = cloud_name -def _get_base_url_from_metadata(cloud_name: Optional[str] = None, is_local_mfe: bool = False) -> str: +def _get_base_url_from_metadata( + cloud_name: Optional[str] = None, is_local_mfe: bool = False +) -> str: """Retrieve the base url for a cloud from the metadata in SDK. :param cloud_name: cloud name @@ -147,11 +158,15 @@ def _get_base_url_from_metadata(cloud_name: Optional[str] = None, is_local_mfe: base_url = _get_mfe_url_override() if base_url is None: cloud_details = _get_cloud_details(cloud_name) - base_url = str(cloud_details.get(EndpointURLS.RESOURCE_MANAGER_ENDPOINT)).strip("/") + base_url = str( + cloud_details.get(EndpointURLS.RESOURCE_MANAGER_ENDPOINT) + ).strip("/") return base_url -def _get_aml_resource_id_from_metadata(cloud_name: Optional[str] = None) -> str: +def _get_aml_resource_id_from_metadata( + cloud_name: Optional[str] = None, +) -> str: """Retrieve the aml_resource_id for a cloud from the metadata in SDK. :param cloud_name: cloud name @@ -160,11 +175,15 @@ def _get_aml_resource_id_from_metadata(cloud_name: Optional[str] = None) -> str: :rtype: str """ cloud_details = _get_cloud_details(cloud_name) - aml_resource_id = str(cloud_details.get(EndpointURLS.AML_RESOURCE_ID)).strip("/") + aml_resource_id = str( + cloud_details.get(EndpointURLS.AML_RESOURCE_ID) + ).strip("/") return aml_resource_id -def _get_active_directory_url_from_metadata(cloud_name: Optional[str] = None) -> str: +def _get_active_directory_url_from_metadata( + cloud_name: Optional[str] = None, +) -> str: """Retrieve the active_directory_url for a cloud from the metadata in SDK. :param cloud_name: cloud name @@ -173,11 +192,15 @@ def _get_active_directory_url_from_metadata(cloud_name: Optional[str] = None) -> :rtype: str """ cloud_details = _get_cloud_details(cloud_name) - active_directory_url = str(cloud_details.get(EndpointURLS.ACTIVE_DIRECTORY_ENDPOINT)).strip("/") + active_directory_url = str( + cloud_details.get(EndpointURLS.ACTIVE_DIRECTORY_ENDPOINT) + ).strip("/") return active_directory_url -def _get_storage_endpoint_from_metadata(cloud_name: Optional[str] = None) -> str: +def _get_storage_endpoint_from_metadata( + cloud_name: Optional[str] = None, +) -> str: """Retrieve the storage_endpoint for a cloud from the metadata in SDK. :param cloud_name: cloud name @@ -190,7 +213,9 @@ def _get_storage_endpoint_from_metadata(cloud_name: Optional[str] = None) -> str return str(storage_endpoint) -def _get_azure_portal_id_from_metadata(cloud_name: Optional[str] = None) -> str: +def _get_azure_portal_id_from_metadata( + cloud_name: Optional[str] = None, +) -> str: """Retrieve the azure_portal_id for a cloud from the metadata in SDK. :param cloud_name: cloud name @@ -203,7 +228,9 @@ def _get_azure_portal_id_from_metadata(cloud_name: Optional[str] = None) -> str: return str(azure_portal_id) -def _get_cloud_information_from_metadata(cloud_name: Optional[str] = None, **kwargs) -> Dict: +def _get_cloud_information_from_metadata( + cloud_name: Optional[str] = None, **kwargs +) -> Dict: """Retrieve the cloud information from the metadata in SDK. :param cloud_name: cloud name @@ -224,7 +251,9 @@ def _get_cloud_information_from_metadata(cloud_name: Optional[str] = None, **kwa return kwargs -def _get_registry_discovery_endpoint_from_metadata(cloud_name: Optional[str] = None) -> str: +def _get_registry_discovery_endpoint_from_metadata( + cloud_name: Optional[str] = None, +) -> str: """Retrieve the registry_discovery_endpoint for a cloud from the metadata in SDK. :param cloud_name: cloud name @@ -233,7 +262,9 @@ def _get_registry_discovery_endpoint_from_metadata(cloud_name: Optional[str] = N :rtype: str """ cloud_details = _get_cloud_details(cloud_name) - registry_discovery_endpoint = cloud_details.get(EndpointURLS.REGISTRY_DISCOVERY_ENDPOINT) + registry_discovery_endpoint = cloud_details.get( + EndpointURLS.REGISTRY_DISCOVERY_ENDPOINT + ) return str(registry_discovery_endpoint) @@ -265,7 +296,9 @@ def _get_registry_discovery_url(cloud: dict, cloud_suffix: str = "") -> str: """ cloud_name = cloud["name"] if cloud_name in _environments: - return _environments[cloud_name][EndpointURLS.REGISTRY_DISCOVERY_ENDPOINT] + return _environments[cloud_name][ + EndpointURLS.REGISTRY_DISCOVERY_ENDPOINT + ] registry_discovery_from_env = os.getenv(ArmConstants.REGISTRY_ENV_URL) if registry_discovery_from_env is not None: return registry_discovery_from_env @@ -276,7 +309,9 @@ def _get_registry_discovery_url(cloud: dict, cloud_suffix: str = "") -> str: return f"https://{cloud_name.lower()}{registry_discovery_region}.api.ml.azure.{cloud_suffix}/" -def _get_clouds_by_metadata_url(metadata_url: str) -> Dict[str, Dict[str, str]]: +def _get_clouds_by_metadata_url( + metadata_url: str, +) -> Dict[str, Dict[str, str]]: """Get all the clouds by the specified metadata url. :param metadata_url: The metadata url @@ -285,10 +320,15 @@ def _get_clouds_by_metadata_url(metadata_url: str) -> Dict[str, Dict[str, str]]: :rtype: Dict[str, Dict[str, str]] """ try: - module_logger.debug("Start : Loading cloud metadata from the url specified by %s", metadata_url) + module_logger.debug( + "Start : Loading cloud metadata from the url specified by %s", + metadata_url, + ) client = ARMPipelineClient(base_url=metadata_url, policies=[]) HttpRequest("GET", metadata_url) - with client.send_request(HttpRequest("GET", metadata_url)) as meta_response: + with client.send_request( + HttpRequest("GET", metadata_url) + ) as meta_response: arm_cloud_dict = meta_response.json() cli_cloud_dict = _convert_arm_to_cli(arm_cloud_dict) module_logger.debug( @@ -322,18 +362,30 @@ def _convert_arm_to_cli(arm_cloud_metadata) -> Dict[str, Dict[str, str]]: try: cloud_name = cloud["name"] portal_endpoint = cloud["portal"] - cloud_suffix = ".".join(portal_endpoint.split(".")[2:]).replace("/", "") - registry_discovery_url = _get_registry_discovery_url(cloud, cloud_suffix) + cloud_suffix = ".".join(portal_endpoint.split(".")[2:]).replace( + "/", "" + ) + registry_discovery_url = _get_registry_discovery_url( + cloud, cloud_suffix + ) cli_cloud_metadata_dict[cloud_name] = { EndpointURLS.AZURE_PORTAL_ENDPOINT: cloud["portal"], - EndpointURLS.RESOURCE_MANAGER_ENDPOINT: cloud["resourceManager"], - EndpointURLS.ACTIVE_DIRECTORY_ENDPOINT: cloud["authentication"]["loginEndpoint"], - EndpointURLS.AML_RESOURCE_ID: "https://ml.azure.{}".format(cloud_suffix), + EndpointURLS.RESOURCE_MANAGER_ENDPOINT: cloud[ + "resourceManager" + ], + EndpointURLS.ACTIVE_DIRECTORY_ENDPOINT: cloud[ + "authentication" + ]["loginEndpoint"], + EndpointURLS.AML_RESOURCE_ID: "https://ml.azure.{}".format( + cloud_suffix + ), EndpointURLS.STORAGE_ENDPOINT: cloud["suffixes"]["storage"], EndpointURLS.REGISTRY_DISCOVERY_ENDPOINT: registry_discovery_url, } except KeyError as ex: - module_logger.warning("Property on cloud not found in arm cloud metadata") + module_logger.warning( + "Property on cloud not found in arm cloud metadata" + ) module_logger.debug("%s", ex) continue return cli_cloud_metadata_dict @@ -345,12 +397,26 @@ def _add_cloud_to_environments(kwargs): raise AttributeError(f"Cannot overwrite existing cloud: {cloud_name}") cloud_metadata = kwargs[CloudArgumentKeys.CLOUD_METADATA] if cloud_metadata is None: - raise LookupError(f"{CloudArgumentKeys.CLOUD_METADATA} not present in kwargs, no environment to add!") + raise LookupError( + f"{CloudArgumentKeys.CLOUD_METADATA} not present in kwargs, no environment to add!" + ) _environments[kwargs["cloud"]] = { - EndpointURLS.AZURE_PORTAL_ENDPOINT: cloud_metadata[EndpointURLS.AZURE_PORTAL_ENDPOINT], - EndpointURLS.RESOURCE_MANAGER_ENDPOINT: cloud_metadata[EndpointURLS.RESOURCE_MANAGER_ENDPOINT], - EndpointURLS.ACTIVE_DIRECTORY_ENDPOINT: cloud_metadata[EndpointURLS.ACTIVE_DIRECTORY_ENDPOINT], - EndpointURLS.AML_RESOURCE_ID: cloud_metadata[EndpointURLS.AML_RESOURCE_ID], - EndpointURLS.STORAGE_ENDPOINT: cloud_metadata[EndpointURLS.STORAGE_ENDPOINT], - EndpointURLS.REGISTRY_DISCOVERY_ENDPOINT: cloud_metadata[EndpointURLS.REGISTRY_DISCOVERY_ENDPOINT], + EndpointURLS.AZURE_PORTAL_ENDPOINT: cloud_metadata[ + EndpointURLS.AZURE_PORTAL_ENDPOINT + ], + EndpointURLS.RESOURCE_MANAGER_ENDPOINT: cloud_metadata[ + EndpointURLS.RESOURCE_MANAGER_ENDPOINT + ], + EndpointURLS.ACTIVE_DIRECTORY_ENDPOINT: cloud_metadata[ + EndpointURLS.ACTIVE_DIRECTORY_ENDPOINT + ], + EndpointURLS.AML_RESOURCE_ID: cloud_metadata[ + EndpointURLS.AML_RESOURCE_ID + ], + EndpointURLS.STORAGE_ENDPOINT: cloud_metadata[ + EndpointURLS.STORAGE_ENDPOINT + ], + EndpointURLS.REGISTRY_DISCOVERY_ENDPOINT: cloud_metadata[ + EndpointURLS.REGISTRY_DISCOVERY_ENDPOINT + ], } diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_exception_helper.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_exception_helper.py index 343ea7141d4e..c6436dfee432 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_exception_helper.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_exception_helper.py @@ -15,7 +15,12 @@ SCHEMA_VALIDATION_ERROR_TEMPLATE, YAML_CREATION_ERROR_DESCRIPTION, ) -from azure.ai.ml.exceptions import ErrorTarget, MlException, ValidationErrorType, ValidationException +from azure.ai.ml.exceptions import ( + ErrorTarget, + MlException, + ValidationErrorType, + ValidationException, +) module_logger = logging.getLogger(__name__) @@ -38,7 +43,9 @@ def _find_deepest_dictionary(data: dict) -> dict: return data -def get_entity_type(error: Union[str, SchemaValidationError, ValidationException]) -> Tuple[str, str]: +def get_entity_type( + error: Union[str, SchemaValidationError, ValidationException], +) -> Tuple[str, str]: """Get entity name from schema type referenced in the error. :param error: The validation error @@ -48,7 +55,9 @@ def get_entity_type(error: Union[str, SchemaValidationError, ValidationException """ details = "" - error_name = error.exc_msg if hasattr(error, "exc_msg") else error.split(":")[0] + error_name = ( + error.exc_msg if hasattr(error, "exc_msg") else error.split(":")[0] + ) if isinstance(error, ValidationException): entity_type = error.target else: @@ -82,7 +91,9 @@ def get_entity_type(error: Union[str, SchemaValidationError, ValidationException def format_details_section( - error: Union[str, SchemaValidationError, ValidationException], details: str, entity_type: str + error: Union[str, SchemaValidationError, ValidationException], + details: str, + entity_type: str, ) -> Tuple[Dict[str, bool], str]: """Builds strings for details of the error message template's Details section. @@ -116,8 +127,12 @@ def format_details_section( # This separate treatment will be unnecessary once # task https://msdata.visualstudio.com/Vienna/_workitems/edit/1925982/ is resolved. parsed_error_msg = error[error.find("{") : (error.rfind("}") + 1)] - error_msg = json.loads(parsed_error_msg).get("errors")[0].get("message") - error_msg = error_msg[error_msg.find("{") : (error_msg.rfind("}") + 1)] + error_msg = ( + json.loads(parsed_error_msg).get("errors")[0].get("message") + ) + error_msg = error_msg[ + error_msg.find("{") : (error_msg.rfind("}") + 1) + ] error_msg = error_msg[: (error_msg.rfind("}") + 1)] error_msg = json.loads(error_msg) else: @@ -129,16 +144,23 @@ def format_details_section( field_error = field_error[0] except KeyError: error_msg = _find_deepest_dictionary(field_error) - if entity_type not in [ErrorTarget.PIPELINE, ErrorTarget.COMMAND_JOB]: + if entity_type not in [ + ErrorTarget.PIPELINE, + ErrorTarget.COMMAND_JOB, + ]: field = list(error_msg.keys())[0] field_error = list(error_msg.values())[0][0] field_error_string = str(field_error) if not error_types[ValidationErrorType.INVALID_VALUE] and any( - s in field_error_string for s in ["Not a valid", "is not in set"] + s in field_error_string + for s in ["Not a valid", "is not in set"] ): error_types[ValidationErrorType.INVALID_VALUE] = True - if not error_types[ValidationErrorType.UNKNOWN_FIELD] and "Unknown field" in field_error_string: + if ( + not error_types[ValidationErrorType.UNKNOWN_FIELD] + and "Unknown field" in field_error_string + ): error_types[ValidationErrorType.UNKNOWN_FIELD] = True if ( not error_types[ValidationErrorType.MISSING_FIELD] @@ -149,8 +171,13 @@ def format_details_section( not error_types[ValidationErrorType.FILE_OR_FOLDER_NOT_FOUND] and "No such file or directory" in field_error_string ): - error_types[ValidationErrorType.FILE_OR_FOLDER_NOT_FOUND] = True - if not error_types[ValidationErrorType.CANNOT_SERIALIZE] and "Cannot dump" in field_error_string: + error_types[ValidationErrorType.FILE_OR_FOLDER_NOT_FOUND] = ( + True + ) + if ( + not error_types[ValidationErrorType.CANNOT_SERIALIZE] + and "Cannot dump" in field_error_string + ): error_types[ValidationErrorType.CANNOT_SERIALIZE] = True if ( not error_types[ValidationErrorType.CANNOT_PARSE] @@ -161,7 +188,9 @@ def format_details_section( if isinstance(field_error, dict): field_error = f"{list(field_error.keys())[0]}:\n - {list(field_error.values())[0][0]}" - details += f"{Fore.RED}\n(x) {field}:\n- {field_error}{Fore.RESET}\n" + details += ( + f"{Fore.RED}\n(x) {field}:\n- {field_error}{Fore.RESET}\n" + ) return error_types, details @@ -215,7 +244,8 @@ def format_errors_and_resolutions_sections( if error_types[ValidationErrorType.RESOURCE_NOT_FOUND]: errors += f"\n{count}) Resource was not found.\n" resolutions += ( - f"\n{count}) Double-check that the resource has been specified correctly and " "that you have access to it." + f"\n{count}) Double-check that the resource has been specified correctly and " + "that you have access to it." ) count += 1 @@ -263,10 +293,14 @@ def format_create_validation_error( error = raw_error entity_type, details = get_entity_type(error) error_types, details = format_details_section(error, details, entity_type) - errors, resolutions = format_errors_and_resolutions_sections(entity_type, error_types, cli) + errors, resolutions = format_errors_and_resolutions_sections( + entity_type, error_types, cli + ) if yaml_operation: - description = YAML_CREATION_ERROR_DESCRIPTION.format(entity_type=entity_type) + description = YAML_CREATION_ERROR_DESCRIPTION.format( + entity_type=entity_type + ) description = Style.BRIGHT + description + Style.RESET_ALL if entity_type == ErrorTarget.MODEL: @@ -277,7 +311,10 @@ def format_create_validation_error( schema_type = CommandJobSchema elif entity_type == ErrorTarget.SWEEP_JOB: schema_type = SweepJobSchema - elif entity_type in [ErrorTarget.BLOB_DATASTORE, ErrorTarget.DATASTORE]: + elif entity_type in [ + ErrorTarget.BLOB_DATASTORE, + ErrorTarget.DATASTORE, + ]: schema_type = AzureBlobSchema elif entity_type == ErrorTarget.GEN1_DATASTORE: schema_type = AzureDataLakeGen1Schema @@ -308,7 +345,9 @@ def format_create_validation_error( return formatted_error -def log_and_raise_error(error: Exception, debug: bool = False, yaml_operation: bool = False) -> NoReturn: +def log_and_raise_error( + error: Exception, debug: bool = False, yaml_operation: bool = False +) -> NoReturn: init() # use an f-string to automatically call str() on error @@ -318,7 +357,9 @@ def log_and_raise_error(error: Exception, debug: bool = False, yaml_operation: b if isinstance(error, SchemaValidationError): module_logger.debug(traceback.format_exc()) try: - formatted_error = format_create_validation_error(error.messages[0], yaml_operation=yaml_operation) + formatted_error = format_create_validation_error( + error.messages[0], yaml_operation=yaml_operation + ) except NotImplementedError: formatted_error = error elif isinstance(error, ValidationException): @@ -328,10 +369,14 @@ def log_and_raise_error(error: Exception, debug: bool = False, yaml_operation: b if error_type == ValidationErrorType.GENERIC: formatted_error = error else: - formatted_error = format_create_validation_error(error, yaml_operation=yaml_operation) + formatted_error = format_create_validation_error( + error, yaml_operation=yaml_operation + ) except NotImplementedError: formatted_error = error else: raise error - raise MlException(message=formatted_error, no_personal_data_message=formatted_error) + raise MlException( + message=formatted_error, no_personal_data_message=formatted_error + ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_file_utils/file_utils.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_file_utils/file_utils.py index f4165fd9ca86..2a7954c6e95b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_file_utils/file_utils.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_file_utils/file_utils.py @@ -17,7 +17,9 @@ def get_root_path() -> str: return os.path.realpath(os.sep) -def traverse_up_path_and_find_file(path, file_name, directory_name=None, num_levels=None) -> str: +def traverse_up_path_and_find_file( + path, file_name, directory_name=None, num_levels=None +) -> str: """ Traverses up the provided path until we find the file, reach a directory that the user does not have permissions to, or if we reach num_levels (if set by the user). @@ -44,9 +46,13 @@ def traverse_up_path_and_find_file(path, file_name, directory_name=None, num_lev if os.path.isfile(path_to_check): return path_to_check - if str(current_path) == root_path or (num_levels is not None and num_levels == current_level): + if str(current_path) == root_path or ( + num_levels is not None and num_levels == current_level + ): break - current_path = os.path.realpath(os.path.join(current_path, os.path.pardir)) + current_path = os.path.realpath( + os.path.join(current_path, os.path.pardir) + ) current_level = current_level + 1 return "" diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/_schema/command.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/_schema/command.py index 2dddf02b1305..fecb7048037d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/_schema/command.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/_schema/command.py @@ -5,14 +5,20 @@ from ..._schema import NestedField from ..._schema.core.fields import DumpableEnumField, EnvironmentField -from ..._schema.job import ParameterizedCommandSchema, ParameterizedParallelSchema +from ..._schema.job import ( + ParameterizedCommandSchema, + ParameterizedParallelSchema, +) from ..._schema.job.job_limits import CommandJobLimitsSchema from .._schema.node import InternalBaseNodeSchema, NodeType class CommandSchema(InternalBaseNodeSchema, ParameterizedCommandSchema): class Meta: - exclude = ["code", "distribution"] # internal command doesn't have code & distribution + exclude = [ + "code", + "distribution", + ] # internal command doesn't have code & distribution environment = EnvironmentField() type = DumpableEnumField(allowed_values=[NodeType.COMMAND]) @@ -21,7 +27,9 @@ class Meta: class DistributedSchema(CommandSchema): class Meta: - exclude = ["code"] # need to enable distribution comparing to CommandSchema + exclude = [ + "code" + ] # need to enable distribution comparing to CommandSchema type = DumpableEnumField(allowed_values=[NodeType.DISTRIBUTED]) @@ -29,7 +37,12 @@ class Meta: class ParallelSchema(InternalBaseNodeSchema, ParameterizedParallelSchema): class Meta: # partition_keys can still be used with unknown warning, but need to do dump before setting - exclude = ["task", "input_data", "mini_batch_error_threshold", "partition_keys"] + exclude = [ + "task", + "input_data", + "mini_batch_error_threshold", + "partition_keys", + ] type = DumpableEnumField(allowed_values=[NodeType.PARALLEL]) compute = fields.Str() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/_schema/component.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/_schema/component.py index 11d4bb56ad70..b841d93e6dce 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/_schema/component.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/_schema/component.py @@ -8,8 +8,16 @@ from ..._schema import NestedField, StringTransformedEnum, UnionField from ..._schema.component.component import ComponentSchema -from ..._schema.core.fields import ArmVersionedStr, CodeField, EnvironmentField, RegistryStr -from ..._schema.job.parameterized_spark import SparkEntryClassSchema, SparkEntryFileSchema +from ..._schema.core.fields import ( + ArmVersionedStr, + CodeField, + EnvironmentField, + RegistryStr, +) +from ..._schema.job.parameterized_spark import ( + SparkEntryClassSchema, + SparkEntryFileSchema, +) from ..._utils._arm_id_utils import parse_name_label from ..._utils.utils import get_valid_dot_keys_with_wildcard from ...constants._common import ( @@ -91,8 +99,8 @@ class Meta: keys=fields.Str(), values=UnionField( [ - NestedField(InternalPrimitiveOutputSchema, unknown=EXCLUDE), - NestedField(InternalOutputPortSchema, unknown=EXCLUDE), + NestedField(InternalPrimitiveOutputSchema), + NestedField(InternalOutputPortSchema), ] ), ) @@ -120,7 +128,9 @@ def get_skip_fields(self): def _serialize(self, obj, *, many: bool = False): if many and obj is not None: - return super(InternalComponentSchema, self)._serialize(obj, many=many) + return super(InternalComponentSchema, self)._serialize( + obj, many=many + ) ret = super(InternalComponentSchema, self)._serialize(obj) for attr_name in obj.__dict__.keys(): if ( @@ -135,17 +145,25 @@ def _serialize(self, obj, *, many: bool = False): @pre_load def add_param_overrides(self, data, **kwargs): source_path = self.context.pop(SOURCE_PATH_CONTEXT_KEY, None) - if isinstance(data, dict) and source_path and os.path.isfile(source_path): + if ( + isinstance(data, dict) + and source_path + and os.path.isfile(source_path) + ): def should_node_overwritten(_root, _parts): parts = _parts.copy() parts.pop() parts.append("type") _input_type = pydash.get(_root, parts, None) - return isinstance(_input_type, str) and _input_type.lower() not in ["boolean"] + return isinstance( + _input_type, str + ) and _input_type.lower() not in ["boolean"] # do override here - with open(source_path, "r", encoding=DefaultOpenEncoding.READ) as f: + with open( + source_path, "r", encoding=DefaultOpenEncoding.READ + ) as f: origin_data = yaml_safe_load_with_base_resolver(f) for dot_key_wildcard, condition_func in [ ("version", None), @@ -153,17 +171,28 @@ def should_node_overwritten(_root, _parts): ("inputs.*.enum", should_node_overwritten), ]: for dot_key in get_valid_dot_keys_with_wildcard( - origin_data, dot_key_wildcard, validate_func=condition_func + origin_data, + dot_key_wildcard, + validate_func=condition_func, ): - pydash.set_(data, dot_key, pydash.get(origin_data, dot_key)) + pydash.set_( + data, dot_key, pydash.get(origin_data, dot_key) + ) return super().add_param_overrides(data, **kwargs) @post_dump(pass_original=True) - def simplify_input_output_port(self, data, original, **kwargs): # pylint:disable=unused-argument + def simplify_input_output_port( + self, data, original, **kwargs + ): # pylint:disable=unused-argument # remove None in input & output for io_ports in [data["inputs"], data["outputs"]]: for port_name, port_definition in io_ports.items(): - io_ports[port_name] = dict(filter(lambda item: item[1] is not None, port_definition.items())) + io_ports[port_name] = dict( + filter( + lambda item: item[1] is not None, + port_definition.items(), + ) + ) # hack, to match current serialization match expectation for port_name, port_definition in data["inputs"].items(): @@ -173,10 +202,14 @@ def simplify_input_output_port(self, data, original, **kwargs): # pylint:disabl return data @post_dump(pass_original=True) - def add_back_type_label(self, data, original, **kwargs): # pylint:disable=unused-argument + def add_back_type_label( + self, data, original, **kwargs + ): # pylint:disable=unused-argument type_label = original._type_label # pylint:disable=protected-access if type_label: - data["type"] = LABELLED_RESOURCE_NAME.format(data["type"], type_label) + data["type"] = LABELLED_RESOURCE_NAME.format( + data["type"], type_label + ) return data @@ -201,15 +234,14 @@ class InternalSparkComponentSchema(InternalComponentSchema): ) environment = EnvironmentField( - extra_fields=[NestedField(InternalEnvironmentSchema)], - allow_none=True, + extra_fields=[NestedField(InternalEnvironmentSchema)], allow_none=True ) jars = UnionField( [ fields.List(fields.Str()), fields.Str(), - ], + ] ) py_files = UnionField( [ @@ -221,7 +253,10 @@ class InternalSparkComponentSchema(InternalComponentSchema): ) entry = UnionField( - [NestedField(SparkEntryFileSchema), NestedField(SparkEntryClassSchema)], + [ + NestedField(SparkEntryFileSchema), + NestedField(SparkEntryClassSchema), + ], required=True, metadata={"description": "Entry."}, ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/_schema/input_output.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/_schema/input_output.py index b1fe2188d55a..90ac255966e2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/_schema/input_output.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/_schema/input_output.py @@ -50,7 +50,9 @@ class InternalInputPortSchema(InputPortSchema): datastore_mode = fields.Str() @post_dump(pass_original=True) - def resolve_list_type(self, data, original_data, **kwargs): # pylint: disable=unused-argument + def resolve_list_type( + self, data, original_data, **kwargs + ): # pylint: disable=unused-argument if isinstance(original_data.type, list): data["type"] = original_data.type return data @@ -105,7 +107,9 @@ class InternalEnumParameterSchema(ParameterSchema): @post_dump @post_load - def enum_value_to_string(self, data, **kwargs): # pylint: disable=unused-argument + def enum_value_to_string( + self, data, **kwargs + ): # pylint: disable=unused-argument if "enum" in data: data["enum"] = list(map(str, data["enum"])) if "default" in data and data["default"] is not None: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/_schema/node.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/_schema/node.py index 6dbadcd3694f..ad46ffcf0235 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/_schema/node.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/_schema/node.py @@ -6,7 +6,10 @@ from ..._schema import ArmVersionedStr, NestedField, RegistryStr, UnionField from ..._schema.core.fields import DumpableEnumField -from ..._schema.pipeline.component_job import BaseNodeSchema, _resolve_inputs_outputs +from ..._schema.pipeline.component_job import ( + BaseNodeSchema, + _resolve_inputs_outputs, +) from ...constants._common import AzureMLResourceType from .component import InternalComponentSchema, NodeType @@ -20,15 +23,16 @@ class Meta: # for registry type assets RegistryStr(azureml_type=AzureMLResourceType.ENVIRONMENT), # existing component - ArmVersionedStr(azureml_type=AzureMLResourceType.COMPONENT, allow_default_version=True), + ArmVersionedStr( + azureml_type=AzureMLResourceType.COMPONENT, + allow_default_version=True, + ), # inline component or component file reference starting with FILE prefix - NestedField(InternalComponentSchema, unknown=INCLUDE), + NestedField(InternalComponentSchema), ], required=True, ) - type = DumpableEnumField( - allowed_values=NodeType.all_values(), - ) + type = DumpableEnumField(allowed_values=NodeType.all_values()) @post_load def make(self, data, **kwargs): # pylint: disable=unused-argument @@ -38,12 +42,16 @@ def make(self, data, **kwargs): # pylint: disable=unused-argument data = parse_inputs_outputs(data) # dict to node object - from ...entities._job.pipeline._load_component import pipeline_node_factory + from ...entities._job.pipeline._load_component import ( + pipeline_node_factory, + ) return pipeline_node_factory.load_from_dict(data=data) @pre_dump - def resolve_inputs_outputs(self, job, **kwargs): # pylint: disable=unused-argument + def resolve_inputs_outputs( + self, job, **kwargs + ): # pylint: disable=unused-argument return _resolve_inputs_outputs(job) @@ -70,6 +78,6 @@ class HDInsightSchema(InternalBaseNodeSchema): number_executors = fields.Int() conf = UnionField( # dictionary or json string - union_fields=[fields.Dict(keys=fields.Str()), fields.Str()], + union_fields=[fields.Dict(keys=fields.Str()), fields.Str()] ) hdinsight_spark_job_name = fields.Str() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/_setup.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/_setup.py index 2baf323700e6..36978ff178d7 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/_setup.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/_setup.py @@ -41,12 +41,16 @@ def _enable_internal_components(): for _type in NodeType.all_values(): component_factory.register_type( _type=_type, - create_instance_func=lambda: InternalComponent.__new__(InternalComponent), + create_instance_func=lambda: InternalComponent.__new__( + InternalComponent + ), create_schema_func=create_schema_func, ) component_factory.register_type( _type=NodeType.SPARK, - create_instance_func=lambda: InternalSparkComponent.__new__(InternalSparkComponent), + create_instance_func=lambda: InternalSparkComponent.__new__( + InternalSparkComponent + ), create_schema_func=InternalSparkComponent._create_schema_for_validation, ) @@ -56,7 +60,7 @@ def _register_node(_type, node_cls, schema_cls): _type=_type, create_instance_func=lambda: node_cls.__new__(node_cls), load_from_rest_object_func=node_cls._from_rest_object, - nested_schema=NestedField(schema_cls, unknown=INCLUDE), + nested_schema=NestedField(schema_cls), ) @@ -78,7 +82,9 @@ def enable_internal_components_in_pipeline(*, force=False) -> NoReturn: _register_node(_type, InternalBaseNode, InternalBaseNodeSchema) # redo the registration for those with specific runsettings - _register_node(NodeType.DATA_TRANSFER, DataTransfer, InternalBaseNodeSchema) + _register_node( + NodeType.DATA_TRANSFER, DataTransfer, InternalBaseNodeSchema + ) _register_node(NodeType.COMMAND, Command, CommandSchema) _register_node(NodeType.DISTRIBUTED, Distributed, DistributedSchema) _register_node(NodeType.PARALLEL, Parallel, ParallelSchema) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/__init__.py index 47296a809ce3..fdb1f54b0c36 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/__init__.py @@ -4,7 +4,16 @@ from ._input_outputs import InternalInput from .command import Command, Distributed from .component import InternalComponent -from .node import Ae365exepool, AetherBridge, DataTransfer, HDInsight, Hemera, InternalBaseNode, Pipeline, Starlite +from .node import ( + Ae365exepool, + AetherBridge, + DataTransfer, + HDInsight, + Hemera, + InternalBaseNode, + Pipeline, + Starlite, +) from .parallel import Parallel from .runsettings import ( AISuperComputerConfiguration, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/_additional_includes.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/_additional_includes.py index 71a8c0a41cf4..81479e1e5046 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/_additional_includes.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/_additional_includes.py @@ -25,7 +25,8 @@ def code_path(self) -> Optional[Path]: def _is_artifact_includes(self): return any( map( - lambda x: isinstance(x, dict) and x.get("type", None) == AzureDevopsArtifactsType.ARTIFACT, + lambda x: isinstance(x, dict) + and x.get("type", None) == AzureDevopsArtifactsType.ARTIFACT, self.origin_configs, ) ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/_input_outputs.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/_input_outputs.py index f9d0a970392c..a0967411183c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/_input_outputs.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/_input_outputs.py @@ -105,7 +105,9 @@ def _from_base(cls, _input: None) -> None: # type: ignore[misc] def _from_base(cls, _input: Union[Input, Dict]) -> "InternalInput": ... @classmethod - def _from_base(cls, _input: Optional[Union[Input, Dict]]) -> Optional["InternalInput"]: + def _from_base( + cls, _input: Optional[Union[Input, Dict]] + ) -> Optional["InternalInput"]: """Cast from Input or Dict to InternalInput. Do not guarantee to create a new object. @@ -171,7 +173,9 @@ def __init__(self, *, datastore_mode=None, is_link_mode=None, **kwargs): super().__init__(**kwargs) @classmethod - def _from_base(cls, _output: Union[Output, Dict]) -> Optional["InternalOutput"]: + def _from_base( + cls, _output: Union[Output, Dict] + ) -> Optional["InternalOutput"]: if _output is None: return None if isinstance(_output, InternalOutput): diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/_merkle_tree.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/_merkle_tree.py index 3a27b5623f24..f07042719420 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/_merkle_tree.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/_merkle_tree.py @@ -21,14 +21,26 @@ def create_merkletree(file_or_folder_path, exclude_function): - root = DirTreeNode("", "Directory", datetime.fromtimestamp(os.path.getmtime(file_or_folder_path)).isoformat()) + root = DirTreeNode( + "", + "Directory", + datetime.fromtimestamp( + os.path.getmtime(file_or_folder_path) + ).isoformat(), + ) if os.path.isdir(file_or_folder_path): folder_path = file_or_folder_path _create_merkletree_helper(folder_path, root, exclude_function) else: file_path = file_or_folder_path - file_node = DirTreeNode(file_path, "File", datetime.fromtimestamp(os.path.getmtime(file_path)).isoformat()) - hexdigest_hash, bytehash = _get_hash(os.path.normpath(file_path), file_path, "File") + file_node = DirTreeNode( + file_path, + "File", + datetime.fromtimestamp(os.path.getmtime(file_path)).isoformat(), + ) + hexdigest_hash, bytehash = _get_hash( + os.path.normpath(file_path), file_path, "File" + ) if hexdigest_hash and bytehash: file_node.add_hash(hexdigest_hash, bytehash) root.add_child(file_node) @@ -66,13 +78,21 @@ def _create_merkletree_helper(projectDir, rootNode, exclude_function): path = os.path.normpath(join(projectDir, f)) if not exclude_function(path): if isfile(join(projectDir, f)): - newNode = DirTreeNode(f, "File", datetime.fromtimestamp(os.path.getmtime(path)).isoformat()) + newNode = DirTreeNode( + f, + "File", + datetime.fromtimestamp(os.path.getmtime(path)).isoformat(), + ) hexdigest_hash, bytehash = _get_hash(path, f, "File") if hexdigest_hash and bytehash: newNode.add_hash(hexdigest_hash, bytehash) rootNode.add_child(newNode) else: - newNode = DirTreeNode(f, "Directory", datetime.fromtimestamp(os.path.getmtime(path)).isoformat()) + newNode = DirTreeNode( + f, + "Directory", + datetime.fromtimestamp(os.path.getmtime(path)).isoformat(), + ) rootNode.add_child(newNode) _create_merkletree_helper(path, newNode, exclude_function) @@ -81,7 +101,11 @@ def _get_hash(filePath, name, file_type): h = hashlib.new(HASH_ALGORITHM) if not os.access(filePath, os.R_OK): print(filePath, os.R_OK) - print("Cannot access file, so excluded from snapshot: {}".format(filePath)) + print( + "Cannot access file, so excluded from snapshot: {}".format( + filePath + ) + ) return (None, None) with open(filePath, "rb") as f: while True: @@ -100,7 +124,14 @@ def _get_hash(filePath, name, file_type): class DirTreeNode(object): - def __init__(self, name=None, file_type=None, timestamp=None, hexdigest_hash=None, bytehash=None): + def __init__( + self, + name=None, + file_type=None, + timestamp=None, + hexdigest_hash=None, + bytehash=None, + ): self.file_type = file_type self.name = name self.timestamp = timestamp diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/code.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/code.py index d44376633fef..cbaf4ecff6e9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/code.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/code.py @@ -27,9 +27,16 @@ def _upload_hash(self) -> Optional[str]: return getattr(super(InternalCode, self), "_upload_hash") def __setattr__(self, key, value): - if key == "name" and hasattr(self, key) and self._is_anonymous is True and value != self.name: + if ( + key == "name" + and hasattr(self, key) + and self._is_anonymous is True + and value != self.name + ): raise AttributeError( "InternalCode name are calculated based on its content and cannot " - "be changed: current name is {} and new value is {}".format(self.name, value) + "be changed: current name is {} and new value is {}".format( + self.name, value + ) ) super().__setattr__(key, value) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/command.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/command.py index 9ed732ecb486..39dc204dbc7a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/command.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/command.py @@ -6,7 +6,12 @@ from marshmallow import INCLUDE, Schema -from ... import MpiDistribution, PyTorchDistribution, RayDistribution, TensorFlowDistribution +from ... import ( + MpiDistribution, + PyTorchDistribution, + RayDistribution, + TensorFlowDistribution, +) from ..._schema import PathAwareSchema from ..._schema.core.fields import DistributionField from ...entities import CommandJobLimits, JobResourceConfiguration @@ -113,7 +118,9 @@ def _picked_fields_from_dict_to_rest_object(cls) -> List[str]: return ["environment", "limits", "resources", "environment_variables"] @classmethod - def _create_schema_for_validation(cls, context) -> Union[PathAwareSchema, Schema]: + def _create_schema_for_validation( + cls, context + ) -> Union[PathAwareSchema, Schema]: from .._schema.command import CommandSchema return CommandSchema(context=context) @@ -122,8 +129,12 @@ def _to_rest_object(self, **kwargs) -> dict: rest_obj = super()._to_rest_object(**kwargs) rest_obj.update( { - "limits": get_rest_dict_for_node_attrs(self.limits, clear_empty_value=True), - "resources": get_rest_dict_for_node_attrs(self.resources, clear_empty_value=True), + "limits": get_rest_dict_for_node_attrs( + self.limits, clear_empty_value=True + ), + "resources": get_rest_dict_for_node_attrs( + self.resources, clear_empty_value=True + ), } ) return rest_obj @@ -133,7 +144,9 @@ def _from_rest_object_to_init_params(cls, obj): obj = InternalBaseNode._from_rest_object_to_init_params(obj) if "resources" in obj and obj["resources"]: - obj["resources"] = JobResourceConfiguration._from_rest_object(obj["resources"]) + obj["resources"] = JobResourceConfiguration._from_rest_object( + obj["resources"] + ) # handle limits if "limits" in obj and obj["limits"]: @@ -164,7 +177,12 @@ def __init__(self, **kwargs): @property def distribution( self, - ) -> Union[PyTorchDistribution, MpiDistribution, TensorFlowDistribution, RayDistribution]: + ) -> Union[ + PyTorchDistribution, + MpiDistribution, + TensorFlowDistribution, + RayDistribution, + ]: """The distribution config of component, e.g. distribution={'type': 'mpi'}. :return: The distribution config @@ -175,26 +193,38 @@ def distribution( @distribution.setter def distribution( self, - value: Union[Dict, PyTorchDistribution, TensorFlowDistribution, MpiDistribution, RayDistribution], + value: Union[ + Dict, + PyTorchDistribution, + TensorFlowDistribution, + MpiDistribution, + RayDistribution, + ], ): if isinstance(value, dict): - dist_schema = DistributionField(unknown=INCLUDE) + dist_schema = DistributionField() value = dist_schema._deserialize(value=value, attr=None, data=None) self._distribution = value @classmethod - def _create_schema_for_validation(cls, context) -> Union[PathAwareSchema, Schema]: + def _create_schema_for_validation( + cls, context + ) -> Union[PathAwareSchema, Schema]: from .._schema.command import DistributedSchema return DistributedSchema(context=context) @classmethod def _picked_fields_from_dict_to_rest_object(cls) -> List[str]: - return Command._picked_fields_from_dict_to_rest_object() + ["distribution"] + return Command._picked_fields_from_dict_to_rest_object() + [ + "distribution" + ] def _to_rest_object(self, **kwargs) -> dict: rest_obj = super()._to_rest_object(**kwargs) - distribution = self.distribution._to_rest_object() if self.distribution else None # pylint: disable=no-member + distribution = ( + self.distribution._to_rest_object() if self.distribution else None + ) # pylint: disable=no-member rest_obj.update( { "distribution": get_rest_dict_for_node_attrs(distribution), diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/component.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/component.py index e54c19066d5f..d2d274ab8aab 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/component.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/component.py @@ -14,14 +14,20 @@ from marshmallow import Schema from ... import Input, Output -from ..._restclient.v2022_10_01.models import ComponentVersion, ComponentVersionProperties +from ..._restclient.v2022_10_01.models import ( + ComponentVersion, + ComponentVersionProperties, +) from ..._schema import PathAwareSchema from ..._utils._arm_id_utils import parse_name_label from ..._utils._asset_utils import IgnoreFile from ...constants._common import DefaultOpenEncoding from ...entities import Component from ...entities._assets import Code -from ...entities._component._additional_includes import AdditionalIncludes, AdditionalIncludesMixin +from ...entities._component._additional_includes import ( + AdditionalIncludes, + AdditionalIncludesMixin, +) from ...entities._component.code import ComponentIgnoreFile from ...entities._job.distribution import DistributionConfiguration from ...entities._system_data import SystemData @@ -130,7 +136,11 @@ def __init__( self.successful_return_code = successful_return_code self.code = code - self.environment = InternalEnvironment(**environment) if isinstance(environment, dict) else environment + self.environment = ( + InternalEnvironment(**environment) + if isinstance(environment, dict) + else environment + ) self.environment_variables = environment_variables # TODO: remove these to keep it a general component class self.command = command @@ -181,9 +191,14 @@ def _read_additional_include_configs(cls, yaml_path: Path) -> List[str]: :return: The list of additional includes :rtype: List[str] """ - additional_includes_config_path = yaml_path.with_suffix(_ADDITIONAL_INCLUDES_SUFFIX) + additional_includes_config_path = yaml_path.with_suffix( + _ADDITIONAL_INCLUDES_SUFFIX + ) if additional_includes_config_path.is_file(): - with open(additional_includes_config_path, encoding=DefaultOpenEncoding.READ) as f: + with open( + additional_includes_config_path, + encoding=DefaultOpenEncoding.READ, + ) as f: file_content = f.read() try: configs = yaml.safe_load(file_content) @@ -192,7 +207,11 @@ def _read_additional_include_configs(cls, yaml_path: Path) -> List[str]: except Exception: # pylint: disable=W0718 # TODO: check if we should catch yaml.YamlError instead here pass - return [line.strip() for line in file_content.splitlines(keepends=False) if len(line.strip()) > 0] + return [ + line.strip() + for line in file_content.splitlines(keepends=False) + if len(line.strip()) > 0 + ] return [] @classmethod @@ -240,18 +259,24 @@ def _additional_includes(self) -> AdditionalIncludes: :rtype: AdditionalIncludes """ obj = self._generate_additional_includes_obj() - from azure.ai.ml._internal.entities._additional_includes import InternalAdditionalIncludes + from azure.ai.ml._internal.entities._additional_includes import ( + InternalAdditionalIncludes, + ) obj.__class__ = InternalAdditionalIncludes return obj # region SchemaValidatableMixin @classmethod - def _create_schema_for_validation(cls, context) -> Union[PathAwareSchema, Schema]: + def _create_schema_for_validation( + cls, context + ) -> Union[PathAwareSchema, Schema]: return InternalComponentSchema(context=context) def _customized_validate(self) -> MutableValidationResult: - validation_result = super(InternalComponent, self)._customized_validate() + validation_result = super( + InternalComponent, self + )._customized_validate() skip_path_validation = not self._append_diagnostics_and_check_if_origin_code_reliable_for_local_path_validation( validation_result ) @@ -277,11 +302,15 @@ def _from_rest_object_to_init_params(cls, obj: ComponentVersion) -> Dict: distribution = obj.properties.component_spec.pop("distribution", None) init_kwargs = super()._from_rest_object_to_init_params(obj) if distribution: - init_kwargs["distribution"] = DistributionConfiguration._from_rest_object(distribution) + init_kwargs["distribution"] = ( + DistributionConfiguration._from_rest_object(distribution) + ) return init_kwargs def _to_rest_object(self) -> ComponentVersion: - component: Union[Dict[Any, Any], List[Any]] = convert_ordered_dict_to_dict(self._to_dict()) + component: Union[Dict[Any, Any], List[Any]] = ( + convert_ordered_dict_to_dict(self._to_dict()) + ) component["_source"] = self._source # type: ignore[call-overload] # TODO: 2883063 diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/environment.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/environment.py index 673afeac4f6b..3d0593569758 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/environment.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/environment.py @@ -8,7 +8,10 @@ from ..._utils.utils import load_yaml from ...constants._common import FILE_PREFIX, DefaultOpenEncoding -from ...entities._validation import MutableValidationResult, ValidationResultBuilder +from ...entities._validation import ( + MutableValidationResult, + ValidationResultBuilder, +) class InternalEnvironment: @@ -40,7 +43,11 @@ def __init__( @staticmethod def _parse_file_path(value: str) -> str: - return value[len(FILE_PREFIX) :] if value.startswith(FILE_PREFIX) else value + return ( + value[len(FILE_PREFIX) :] + if value.startswith(FILE_PREFIX) + else value + ) def _validate_conda_section( self, base_path: Union[str, PathLike], skip_path_validation: bool @@ -48,7 +55,11 @@ def _validate_conda_section( validation_result = ValidationResultBuilder.success() if not self.conda: return validation_result - dependencies_field_names = {self.CONDA_DEPENDENCIES, self.CONDA_DEPENDENCIES_FILE, self.PIP_REQUIREMENTS_FILE} + dependencies_field_names = { + self.CONDA_DEPENDENCIES, + self.CONDA_DEPENDENCIES_FILE, + self.PIP_REQUIREMENTS_FILE, + } if len(set(self.conda) & dependencies_field_names) > 1: validation_result.append_warning( yaml_path="conda", @@ -57,14 +68,20 @@ def _validate_conda_section( ) if self.conda.get(self.CONDA_DEPENDENCIES_FILE): conda_dependencies_file = self.conda[self.CONDA_DEPENDENCIES_FILE] - if not skip_path_validation and not (Path(base_path) / conda_dependencies_file).is_file(): + if ( + not skip_path_validation + and not (Path(base_path) / conda_dependencies_file).is_file() + ): validation_result.append_error( yaml_path=f"conda.{self.CONDA_DEPENDENCIES_FILE}", message=f"Cannot find conda dependencies file: {conda_dependencies_file!r}", ) if self.conda.get(self.PIP_REQUIREMENTS_FILE): pip_requirements_file = self.conda[self.PIP_REQUIREMENTS_FILE] - if not skip_path_validation and not (Path(base_path) / pip_requirements_file).is_file(): + if ( + not skip_path_validation + and not (Path(base_path) / pip_requirements_file).is_file() + ): validation_result.append_error( yaml_path=f"conda.{self.PIP_REQUIREMENTS_FILE}", message=f"Cannot find pip requirements file: {pip_requirements_file!r}", @@ -77,7 +94,9 @@ def _validate_docker_section( validation_result = ValidationResultBuilder.success() if not self.docker: return validation_result - if not self.docker.get(self.BUILD) or not self.docker[self.BUILD].get(self.DOCKERFILE): + if not self.docker.get(self.BUILD) or not self.docker[self.BUILD].get( + self.DOCKERFILE + ): return validation_result dockerfile_file = self.docker[self.BUILD][self.DOCKERFILE] dockerfile_file = self._parse_file_path(dockerfile_file) @@ -92,7 +111,11 @@ def _validate_docker_section( ) return validation_result - def validate(self, base_path: Union[str, PathLike], skip_path_validation: bool = False) -> MutableValidationResult: + def validate( + self, + base_path: Union[str, PathLike], + skip_path_validation: bool = False, + ) -> MutableValidationResult: """Validate the environment section. This is a public method but won't be exposed to user given InternalEnvironment is an internal class. @@ -105,25 +128,41 @@ def validate(self, base_path: Union[str, PathLike], skip_path_validation: bool = :rtype: MutableValidationResult """ validation_result = ValidationResultBuilder.success() - if self.os is not None and self.os not in {"Linux", "Windows", "linux", "windows"}: + if self.os is not None and self.os not in { + "Linux", + "Windows", + "linux", + "windows", + }: validation_result.append_error( yaml_path="os", message=f"Only support 'Linux' and 'Windows', but got {self.os!r}", ) - validation_result.merge_with(self._validate_conda_section(base_path, skip_path_validation)) - validation_result.merge_with(self._validate_docker_section(base_path, skip_path_validation)) + validation_result.merge_with( + self._validate_conda_section(base_path, skip_path_validation) + ) + validation_result.merge_with( + self._validate_docker_section(base_path, skip_path_validation) + ) return validation_result def _resolve_conda_section(self, base_path: Union[str, PathLike]) -> None: if not self.conda: return if self.conda.get(self.CONDA_DEPENDENCIES_FILE): - conda_dependencies_file = self.conda.pop(self.CONDA_DEPENDENCIES_FILE) - self.conda[self.CONDA_DEPENDENCIES] = load_yaml(Path(base_path) / conda_dependencies_file) + conda_dependencies_file = self.conda.pop( + self.CONDA_DEPENDENCIES_FILE + ) + self.conda[self.CONDA_DEPENDENCIES] = load_yaml( + Path(base_path) / conda_dependencies_file + ) return if self.conda.get(self.PIP_REQUIREMENTS_FILE): pip_requirements_file = self.conda.pop(self.PIP_REQUIREMENTS_FILE) - with open(Path(base_path) / pip_requirements_file, encoding=DefaultOpenEncoding.READ) as f: + with open( + Path(base_path) / pip_requirements_file, + encoding=DefaultOpenEncoding.READ, + ) as f: pip_requirements = f.read().splitlines() self.conda = { self.CONDA_DEPENDENCIES: { @@ -141,13 +180,19 @@ def _resolve_conda_section(self, base_path: Union[str, PathLike]) -> None: def _resolve_docker_section(self, base_path: Union[str, PathLike]) -> None: if not self.docker: return - if not self.docker.get(self.BUILD) or not self.docker[self.BUILD].get(self.DOCKERFILE): + if not self.docker.get(self.BUILD) or not self.docker[self.BUILD].get( + self.DOCKERFILE + ): return dockerfile_file = self.docker[self.BUILD][self.DOCKERFILE] if not dockerfile_file.startswith(FILE_PREFIX): return dockerfile_file = self._parse_file_path(dockerfile_file) - with open(Path(base_path) / dockerfile_file, "r", encoding=DefaultOpenEncoding.READ) as f: + with open( + Path(base_path) / dockerfile_file, + "r", + encoding=DefaultOpenEncoding.READ, + ) as f: self.docker[self.BUILD][self.DOCKERFILE] = f.read() self._docker_file_resolved = True return diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/node.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/node.py index 89fc032c4c18..93f70d4fc0f0 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/node.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/node.py @@ -81,18 +81,26 @@ def _skip_required_compute_missing_validation(self) -> bool: def _to_node(self, context: Optional[Dict] = None, **kwargs) -> BaseNode: return self - def _to_component(self, context: Optional[Dict] = None, **kwargs) -> Component: + def _to_component( + self, context: Optional[Dict] = None, **kwargs + ) -> Component: return self.component def _to_job(self) -> Job: raise RuntimeError("Internal components doesn't support to job") @classmethod - def _load_from_dict(cls, data: Dict, context: Dict, additional_message: str, **kwargs) -> "Job": - raise RuntimeError("Internal components doesn't support load from dict") + def _load_from_dict( + cls, data: Dict, context: Dict, additional_message: str, **kwargs + ) -> "Job": + raise RuntimeError( + "Internal components doesn't support load from dict" + ) @classmethod - def _create_schema_for_validation(cls, context) -> Union[PathAwareSchema, Schema]: + def _create_schema_for_validation( + cls, context + ) -> Union[PathAwareSchema, Schema]: from .._schema.node import InternalBaseNodeSchema return InternalBaseNodeSchema(context=context) @@ -102,7 +110,9 @@ def component(self) -> Component: return self._component def _to_rest_inputs(self) -> Dict[str, Dict]: - rest_dataset_literal_inputs = super(InternalBaseNode, self)._to_rest_inputs() + rest_dataset_literal_inputs = super( + InternalBaseNode, self + )._to_rest_inputs() for input_name, input_value in self.inputs.items(): # hack: remove unfilled input from rest object instead a default input of {"job_input_type": "literal"} # note that this hack is not always effective as _data will be set to Input() when visiting input_value.type @@ -137,7 +147,9 @@ def _to_rest_object(self, **kwargs) -> dict: class DataTransfer(InternalBaseNode): def __init__(self, **kwargs): kwargs.pop("type", None) - super(DataTransfer, self).__init__(type=NodeType.DATA_TRANSFER, **kwargs) + super(DataTransfer, self).__init__( + type=NodeType.DATA_TRANSFER, **kwargs + ) class HDInsight(InternalBaseNode): @@ -153,7 +165,9 @@ def __init__(self, **kwargs): self._executor_cores: int = kwargs.pop("executor_cores", None) self._number_executors: int = kwargs.pop("number_executors", None) self._conf: Union[dict, str] = kwargs.pop("conf", None) - self._hdinsight_spark_job_name: str = kwargs.pop("hdinsight_spark_job_name", None) + self._hdinsight_spark_job_name: str = kwargs.pop( + "hdinsight_spark_job_name", None + ) self._init = False @property @@ -294,7 +308,9 @@ def _picked_fields_from_dict_to_rest_object(cls) -> List[str]: ] @classmethod - def _create_schema_for_validation(cls, context) -> Union[PathAwareSchema, Schema]: + def _create_schema_for_validation( + cls, context + ) -> Union[PathAwareSchema, Schema]: from .._schema.node import HDInsightSchema return HDInsightSchema(context=context) @@ -322,7 +338,9 @@ def __init__(self, **kwargs): class Ae365exepool(InternalBaseNode): def __init__(self, **kwargs): kwargs.pop("type", None) - super(Ae365exepool, self).__init__(type=NodeType.AE365EXEPOOL, **kwargs) + super(Ae365exepool, self).__init__( + type=NodeType.AE365EXEPOOL, **kwargs + ) class Sweep(InternalBaseNode): @@ -335,4 +353,6 @@ def __init__(self, **kwargs): class AetherBridge(InternalBaseNode): def __init__(self, **kwargs): kwargs.pop("type", None) - super(AetherBridge, self).__init__(type=NodeType.AETHER_BRIDGE, **kwargs) + super(AetherBridge, self).__init__( + type=NodeType.AETHER_BRIDGE, **kwargs + ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/parallel.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/parallel.py index 86fa89395430..44d2039a9b14 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/parallel.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/parallel.py @@ -19,12 +19,16 @@ def __init__(self, **kwargs): kwargs.pop("type", None) super(Parallel, self).__init__(type=NodeType.PARALLEL, **kwargs) self._init = True - self._max_concurrency_per_instance = kwargs.pop("max_concurrency_per_instance", None) + self._max_concurrency_per_instance = kwargs.pop( + "max_concurrency_per_instance", None + ) self._error_threshold = kwargs.pop("error_threshold", None) self._mini_batch_size = kwargs.pop("mini_batch_size", None) self._partition_keys = kwargs.pop("partition_keys", None) self._logging_level = kwargs.pop("logging_level", None) - self._retry_settings = kwargs.pop("retry_settings", BatchRetrySettings()) + self._retry_settings = kwargs.pop( + "retry_settings", BatchRetrySettings() + ) self._init = False @property @@ -108,7 +112,9 @@ def _picked_fields_from_dict_to_rest_object(cls) -> List[str]: ] @classmethod - def _create_schema_for_validation(cls, context) -> Union[PathAwareSchema, Schema]: + def _create_schema_for_validation( + cls, context + ) -> Union[PathAwareSchema, Schema]: from .._schema.command import ParallelSchema return ParallelSchema(context=context) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/runsettings/ai_super_computer_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/runsettings/ai_super_computer_configuration.py index 89f338ca71f4..a2c9eb39dc43 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/runsettings/ai_super_computer_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/runsettings/ai_super_computer_configuration.py @@ -19,7 +19,9 @@ def items(self): return result -class AISuperComputerStorageReferenceConfiguration(PascalCaseProperty): # pylint: disable=name-too-long +class AISuperComputerStorageReferenceConfiguration( + PascalCaseProperty +): # pylint: disable=name-too-long _KEY_MAPPING = { "container_name": "ContainerName", "relative_path": "RelativePath", @@ -75,13 +77,17 @@ def __init__( :type min_instance_type_count: int """ super().__init__(**kwargs) - self.auto_scale_instance_type_count_set = auto_scale_instance_type_count_set + self.auto_scale_instance_type_count_set = ( + auto_scale_instance_type_count_set + ) self.auto_scale_interval_in_sec = auto_scale_interval_in_sec self.max_instance_type_count = max_instance_type_count self.min_instance_type_count = min_instance_type_count -class AISuperComputerConfiguration(PascalCaseProperty): # pylint: disable=too-many-instance-attributes +class AISuperComputerConfiguration( + PascalCaseProperty +): # pylint: disable=too-many-instance-attributes """A class to manage AI Super Computer Configuration.""" _KEY_MAPPING = { @@ -111,7 +117,9 @@ def __init__( image_version: Optional[str] = None, location: Optional[str] = None, locations: Optional[List[str]] = None, - ai_super_computer_storage_data: Optional[Dict[str, AISuperComputerStorageReferenceConfiguration]] = None, + ai_super_computer_storage_data: Optional[ + Dict[str, AISuperComputerStorageReferenceConfiguration] + ] = None, interactive: Optional[bool] = None, scale_policy: Optional[AISuperComputerScalePolicy] = None, virtual_cluster_arm_id: Optional[str] = None, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/runsettings/itp_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/runsettings/itp_configuration.py index 8868b33b57fd..0d39d9e914c5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/runsettings/itp_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/runsettings/itp_configuration.py @@ -115,7 +115,9 @@ def __init__( self, resource_configuration: Optional[ITPResourceConfiguration] = None, priority_configuration: Optional[ITPPriorityConfiguration] = None, - interactive_configuration: Optional[ITPInteractiveConfiguration] = None, + interactive_configuration: Optional[ + ITPInteractiveConfiguration + ] = None, retry: Optional[ITPRetrySettings] = None, **kwargs ): @@ -130,8 +132,14 @@ def __init__( compute. :type interactive_configuration: ITPInteractiveConfiguration """ - self.resource_configuration = resource_configuration or ITPResourceConfiguration() - self.priority_configuration = priority_configuration or ITPPriorityConfiguration() - self.interactive_configuration = interactive_configuration or ITPInteractiveConfiguration() + self.resource_configuration = ( + resource_configuration or ITPResourceConfiguration() + ) + self.priority_configuration = ( + priority_configuration or ITPPriorityConfiguration() + ) + self.interactive_configuration = ( + interactive_configuration or ITPInteractiveConfiguration() + ) self.retry = retry or ITPRetrySettings() super().__init__(**kwargs) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/scope.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/scope.py index 9965d69f2ac4..0d0d598cc9fd 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/scope.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/scope.py @@ -20,7 +20,9 @@ def __init__(self, **kwargs): self._init = True self._adla_account_name = kwargs.pop("adla_account_name", None) self._scope_param = kwargs.pop("scope_param", None) - self._custom_job_name_suffix = kwargs.pop("custom_job_name_suffix", None) + self._custom_job_name_suffix = kwargs.pop( + "custom_job_name_suffix", None + ) self._priority = kwargs.pop("priority", None) self._auto_token = kwargs.pop("auto_token", None) self._tokens = kwargs.pop("tokens", None) @@ -122,10 +124,20 @@ def vcp(self, value: float): @classmethod def _picked_fields_from_dict_to_rest_object(cls) -> List[str]: - return ["custom_job_name_suffix", "scope_param", "adla_account_name", "priority", "auto_token", "tokens", "vcp"] + return [ + "custom_job_name_suffix", + "scope_param", + "adla_account_name", + "priority", + "auto_token", + "tokens", + "vcp", + ] @classmethod - def _create_schema_for_validation(cls, context) -> Union[PathAwareSchema, Schema]: + def _create_schema_for_validation( + cls, context + ) -> Union[PathAwareSchema, Schema]: from .._schema.node import ScopeSchema return ScopeSchema(context=context) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/spark.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/spark.py index 345fa5f24cdd..6ff20eca8bd8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/spark.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/spark.py @@ -8,7 +8,10 @@ from ..._schema import PathAwareSchema from ...constants._job.job import RestSparkConfKey from ...entities import Environment, SparkJobEntry -from ...entities._job.parameterized_spark import DUMMY_IMAGE, ParameterizedSpark +from ...entities._job.parameterized_spark import ( + DUMMY_IMAGE, + ParameterizedSpark, +) from ...entities._job.spark_job_entry_mixin import SparkJobEntryMixin from .._schema.component import InternalSparkComponentSchema from ..entities import InternalComponent @@ -68,26 +71,45 @@ def __init__( # verification. This usually happens when we use to_component(SparkJob) or builder function spark() as a node # in pipeline sdk conf = conf or {} - self.driver_cores = driver_cores or conf.get(RestSparkConfKey.DRIVER_CORES, None) - self.driver_memory = driver_memory or conf.get(RestSparkConfKey.DRIVER_MEMORY, None) - self.executor_cores = executor_cores or conf.get(RestSparkConfKey.EXECUTOR_CORES, None) - self.executor_memory = executor_memory or conf.get(RestSparkConfKey.EXECUTOR_MEMORY, None) - self.executor_instances = executor_instances or conf.get(RestSparkConfKey.EXECUTOR_INSTANCES, None) - self.dynamic_allocation_enabled = dynamic_allocation_enabled or conf.get( - RestSparkConfKey.DYNAMIC_ALLOCATION_ENABLED, None + self.driver_cores = driver_cores or conf.get( + RestSparkConfKey.DRIVER_CORES, None ) - self.dynamic_allocation_min_executors = dynamic_allocation_min_executors or conf.get( - RestSparkConfKey.DYNAMIC_ALLOCATION_MIN_EXECUTORS, None + self.driver_memory = driver_memory or conf.get( + RestSparkConfKey.DRIVER_MEMORY, None ) - self.dynamic_allocation_max_executors = dynamic_allocation_max_executors or conf.get( - RestSparkConfKey.DYNAMIC_ALLOCATION_MAX_EXECUTORS, None + self.executor_cores = executor_cores or conf.get( + RestSparkConfKey.EXECUTOR_CORES, None + ) + self.executor_memory = executor_memory or conf.get( + RestSparkConfKey.EXECUTOR_MEMORY, None + ) + self.executor_instances = executor_instances or conf.get( + RestSparkConfKey.EXECUTOR_INSTANCES, None + ) + self.dynamic_allocation_enabled = ( + dynamic_allocation_enabled + or conf.get(RestSparkConfKey.DYNAMIC_ALLOCATION_ENABLED, None) + ) + self.dynamic_allocation_min_executors = ( + dynamic_allocation_min_executors + or conf.get( + RestSparkConfKey.DYNAMIC_ALLOCATION_MIN_EXECUTORS, None + ) + ) + self.dynamic_allocation_max_executors = ( + dynamic_allocation_max_executors + or conf.get( + RestSparkConfKey.DYNAMIC_ALLOCATION_MAX_EXECUTORS, None + ) ) self.conf = conf self.args = args @classmethod - def _create_schema_for_validation(cls, context) -> Union[PathAwareSchema, Schema]: + def _create_schema_for_validation( + cls, context + ) -> Union[PathAwareSchema, Schema]: return InternalSparkComponentSchema(context=context) @property # type: ignore[override] @@ -97,8 +119,13 @@ def environment(self) -> Optional[Union[Environment, str]]: :return: The environment of the component. :rtype: Optional[Union[Environment, str]]] """ - if isinstance(self._environment, Environment) and self._environment.image is None: - return Environment(conda_file=self._environment.conda_file, image=DUMMY_IMAGE) + if ( + isinstance(self._environment, Environment) + and self._environment.image is None + ): + return Environment( + conda_file=self._environment.conda_file, image=DUMMY_IMAGE + ) return self._environment @environment.setter @@ -121,7 +148,9 @@ def environment(self, value): ) if internal_environment.conda: self._environment.conda_file = { - "dependencies": internal_environment.conda[InternalEnvironment.CONDA_DEPENDENCIES] + "dependencies": internal_environment.conda[ + InternalEnvironment.CONDA_DEPENDENCIES + ] } if internal_environment.docker: self._environment.image = internal_environment.docker["image"] @@ -181,12 +210,16 @@ def _to_dict(self) -> Dict: def _to_rest_object(self): result = super()._to_rest_object() if "pyFiles" in result.properties.component_spec: - result.properties.component_spec["py_files"] = result.properties.component_spec.pop("pyFiles") + result.properties.component_spec["py_files"] = ( + result.properties.component_spec.pop("pyFiles") + ) return result @classmethod def _from_rest_object_to_init_params(cls, obj) -> Dict: if "py_files" in obj.properties.component_spec: - obj.properties.component_spec["pyFiles"] = obj.properties.component_spec.pop("py_files") + obj.properties.component_spec["pyFiles"] = ( + obj.properties.component_spec.pop("py_files") + ) result = super()._from_rest_object_to_init_params(obj) return result diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/azureml_image_context.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/azureml_image_context.py index 1740cdf0fd05..0a599b6dedea 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/azureml_image_context.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/azureml_image_context.py @@ -59,7 +59,9 @@ def __init__( self._docker_azureml_app_path = LocalEndpointConstants.AZUREML_APP_PATH local_model_mount_path = str(model_directory_path) - docker_azureml_model_dir = f"{self.docker_azureml_app_path}azureml-models/{model_mount_path}" + docker_azureml_model_dir = ( + f"{self.docker_azureml_app_path}azureml-models/{model_mount_path}" + ) self._volumes = { f"{local_model_mount_path}:{docker_azureml_model_dir}:z": { local_model_mount_path: {"bind": docker_azureml_model_dir} @@ -74,7 +76,9 @@ def __init__( if yaml_code_directory_path: local_code_mount_path = str(yaml_code_directory_path) docker_code_folder_name = Path(yaml_code_directory_path).name - docker_code_mount_path = f"{self.docker_azureml_app_path}{docker_code_folder_name}/" + docker_code_mount_path = ( + f"{self.docker_azureml_app_path}{docker_code_folder_name}/" + ) self._volumes.update( { f"{local_code_mount_path}:{docker_code_mount_path}": { @@ -84,10 +88,15 @@ def __init__( ) # Set the directory containing scoring script as AML_APP_ROOT/working directory # ie. /var/azureml-app/onlinescoring - self._environment[LocalEndpointConstants.ENVVAR_KEY_AML_APP_ROOT] = os.path.join( - docker_code_mount_path, os.path.dirname(yaml_code_scoring_script_file_name) + self._environment[ + LocalEndpointConstants.ENVVAR_KEY_AML_APP_ROOT + ] = os.path.join( + docker_code_mount_path, + os.path.dirname(yaml_code_scoring_script_file_name), ) - self._environment[LocalEndpointConstants.ENVVAR_KEY_AZUREML_ENTRY_SCRIPT] = Path( + self._environment[ + LocalEndpointConstants.ENVVAR_KEY_AZUREML_ENTRY_SCRIPT + ] = Path( yaml_code_scoring_script_file_name ).name # ie. score.py diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/docker_client.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/docker_client.py index beb9db714667..b1895714ab60 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/docker_client.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/docker_client.py @@ -10,7 +10,9 @@ from typing import Dict, List, Optional from azure.ai.ml._local_endpoints.local_endpoint_mode import LocalEndpointMode -from azure.ai.ml._local_endpoints.vscode_debug.vscode_client import VSCodeClient +from azure.ai.ml._local_endpoints.vscode_debug.vscode_client import ( + VSCodeClient, +) from azure.ai.ml._utils._logger_utils import initialize_logger_info from azure.ai.ml._utils.utils import DockerProxy from azure.ai.ml.constants._endpoint import LocalEndpointConstants @@ -49,7 +51,9 @@ def __init__( vscode_client: Optional[VSCodeClient] = None, ): self._lazy_client = client - self._vscode_client = vscode_client if vscode_client else VSCodeClient() + self._vscode_client = ( + vscode_client if vscode_client else VSCodeClient() + ) @property def _client(self) -> "docker.DockerClient": # type: ignore[name-defined] @@ -76,14 +80,20 @@ def create_endpoint( dockerfile_path: str, ) -> None: try: - self._client.images.build(path=build_directory, tag=image_name, dockerfile=dockerfile_path) + self._client.images.build( + path=build_directory, + tag=image_name, + dockerfile=dockerfile_path, + ) except docker.errors.BuildError: pass self.delete(endpoint_name=endpoint_name, verify_exists=False) labels = DEFAULT_LABELS.copy() labels[LocalEndpointConstants.LABEL_KEY_ENDPOINT_NAME] = endpoint_name - labels[LocalEndpointConstants.LABEL_KEY_ENDPOINT_JSON] = endpoint_metadata + labels[LocalEndpointConstants.LABEL_KEY_ENDPOINT_JSON] = ( + endpoint_metadata + ) container_name = _get_container_name(endpoint_name) self._client.containers.run( image_name, @@ -163,7 +173,10 @@ def create_deployment( try: self._client.images.get(image_name) except docker.errors.ImageNotFound: - module_logger.info("\nDid not find image '%s' locally. Pulling from registry.\n", image_name) + module_logger.info( + "\nDid not find image '%s' locally. Pulling from registry.\n", + image_name, + ) try: self._client.images.pull(image_name) except docker.errors.NotFound as e: @@ -190,9 +203,15 @@ def create_deployment( ) module_logger.debug("Setting labels: '%s'\n", labels) module_logger.debug("Mounting volumes: '%s'\n", volumes) - module_logger.debug("Setting environment variables: '%s'\n", environment) + module_logger.debug( + "Setting environment variables: '%s'\n", environment + ) container_name = _get_container_name(endpoint_name, deployment_name) - device_requests = [docker.types.DeviceRequest(count=-1, capabilities=[["gpu"]])] if local_enable_gpu else None + device_requests = ( + [docker.types.DeviceRequest(count=-1, capabilities=[["gpu"]])] + if local_enable_gpu + else None + ) container = self._client.containers.create( image_name, name=container_name, @@ -206,34 +225,50 @@ def create_deployment( ) if local_endpoint_mode == LocalEndpointMode.VSCodeDevContainer: try: - devcontainer_path = self._vscode_client.create_dev_container_json( - azureml_container=container, - endpoint_name=endpoint_name, - deployment_name=deployment_name, - build_directory=build_directory, - image_name=image_name, - environment=environment, - volumes=volumes, # type: ignore[arg-type] - labels=labels, + devcontainer_path = ( + self._vscode_client.create_dev_container_json( + azureml_container=container, + endpoint_name=endpoint_name, + deployment_name=deployment_name, + build_directory=build_directory, + image_name=image_name, + environment=environment, + volumes=volumes, # type: ignore[arg-type] + labels=labels, + ) ) finally: # This pre-created container is only used for retrieving the entry script # to add debugpy statements container.remove() - app_path = environment[LocalEndpointConstants.ENVVAR_KEY_AML_APP_ROOT] - self._vscode_client.invoke_dev_container(devcontainer_path=devcontainer_path, app_path=app_path) - time.sleep(LocalEndpointConstants.DEFAULT_STARTUP_WAIT_TIME_SECONDS) + app_path = environment[ + LocalEndpointConstants.ENVVAR_KEY_AML_APP_ROOT + ] + self._vscode_client.invoke_dev_container( + devcontainer_path=devcontainer_path, app_path=app_path + ) + time.sleep( + LocalEndpointConstants.DEFAULT_STARTUP_WAIT_TIME_SECONDS + ) else: container.start() - time.sleep(LocalEndpointConstants.DEFAULT_STARTUP_WAIT_TIME_SECONDS) + time.sleep( + LocalEndpointConstants.DEFAULT_STARTUP_WAIT_TIME_SECONDS + ) container.reload() _validate_container_state( endpoint_name=endpoint_name, deployment_name=deployment_name, container=container, ) - scoring_uri = self.get_scoring_uri(endpoint_name=endpoint_name, deployment_name=deployment_name) - module_logger.debug("Container '%s' is up and running at '%s'\n", container_name, scoring_uri) + scoring_uri = self.get_scoring_uri( + endpoint_name=endpoint_name, deployment_name=deployment_name + ) + module_logger.debug( + "Container '%s' is up and running at '%s'\n", + container_name, + scoring_uri, + ) def delete( self, @@ -251,14 +286,20 @@ def delete( :type verify_exists: (bool, optional) :raises: azure.ai.ml._local_endpoints.errors.LocalEndpointNotFoundError """ - containers = self.list_containers(endpoint_name=endpoint_name, deployment_name=deployment_name) + containers = self.list_containers( + endpoint_name=endpoint_name, deployment_name=deployment_name + ) if verify_exists and len(containers) == 0: - raise LocalEndpointNotFoundError(endpoint_name=endpoint_name, deployment_name=deployment_name) + raise LocalEndpointNotFoundError( + endpoint_name=endpoint_name, deployment_name=deployment_name + ) for container in containers: container.stop() container.remove() - module_logger.debug("Endpoint container '%s' is removed.", container.name) + module_logger.debug( + "Endpoint container '%s' is removed.", container.name + ) def get_endpoint(self, endpoint_name: str) -> Optional[dict]: """Returns metadata for local endpoint or deployment. @@ -273,7 +314,9 @@ def get_endpoint(self, endpoint_name: str) -> Optional[dict]: raise LocalEndpointNotFoundError(endpoint_name=endpoint_name) return get_endpoint_json_from_container(container=container) - def get_deployment(self, endpoint_name: str, deployment_name: Optional[str] = None) -> Optional[dict]: + def get_deployment( + self, endpoint_name: str, deployment_name: Optional[str] = None + ) -> Optional[dict]: """Returns metadata for local deployment. :param endpoint_name: name of local endpoint @@ -283,12 +326,18 @@ def get_deployment(self, endpoint_name: str, deployment_name: Optional[str] = No :return: JSON dict representing user provided endpoint input :rtype: dict """ - container = self.get_endpoint_container(endpoint_name=endpoint_name, deployment_name=deployment_name) + container = self.get_endpoint_container( + endpoint_name=endpoint_name, deployment_name=deployment_name + ) if container is None: - raise LocalEndpointNotFoundError(endpoint_name=endpoint_name, deployment_name=deployment_name) + raise LocalEndpointNotFoundError( + endpoint_name=endpoint_name, deployment_name=deployment_name + ) return get_deployment_json_from_container(container=container) - def get_scoring_uri(self, endpoint_name: str, deployment_name: Optional[str] = None) -> Optional[str]: + def get_scoring_uri( + self, endpoint_name: str, deployment_name: Optional[str] = None + ) -> Optional[str]: """Returns scoring uri for local endpoint or deployment. :param endpoint_name: name of local endpoint @@ -312,7 +361,9 @@ def get_scoring_uri(self, endpoint_name: str, deployment_name: Optional[str] = N ) return get_scoring_uri_from_container(container=container) - def logs(self, endpoint_name: str, deployment_name: str, lines: int) -> str: + def logs( + self, endpoint_name: str, deployment_name: str, lines: int + ) -> str: """Returns logs from local deployment. :param endpoint_name: name of local endpoint @@ -325,9 +376,13 @@ def logs(self, endpoint_name: str, deployment_name: str, lines: int) -> str: :rtype: str :raises: azure.ai.ml._local_endpoints.errors.LocalEndpointNotFoundError """ - container = self.get_endpoint_container(endpoint_name, deployment_name=deployment_name) + container = self.get_endpoint_container( + endpoint_name, deployment_name=deployment_name + ) if container is None: - raise LocalEndpointNotFoundError(endpoint_name=endpoint_name, deployment_name=deployment_name) + raise LocalEndpointNotFoundError( + endpoint_name=endpoint_name, deployment_name=deployment_name + ) return container.logs(tail=int(lines)).decode() def list_containers( @@ -347,13 +402,23 @@ def list_containers( :return: array of Container objects from docker-py library :rtype: List[docker.models.containers.Container] """ - filters = {"label": [f"{LocalEndpointConstants.LABEL_KEY_AZUREML_LOCAL_ENDPOINT}"]} + filters = { + "label": [ + f"{LocalEndpointConstants.LABEL_KEY_AZUREML_LOCAL_ENDPOINT}" + ] + } if endpoint_name: - filters["label"].append(f"{LocalEndpointConstants.LABEL_KEY_ENDPOINT_NAME}={endpoint_name}") + filters["label"].append( + f"{LocalEndpointConstants.LABEL_KEY_ENDPOINT_NAME}={endpoint_name}" + ) if deployment_name: - filters["label"].append(f"{LocalEndpointConstants.LABEL_KEY_DEPLOYMENT_NAME}={deployment_name}") + filters["label"].append( + f"{LocalEndpointConstants.LABEL_KEY_DEPLOYMENT_NAME}={deployment_name}" + ) - return self._client.containers.list(filters=filters, all=include_stopped) + return self._client.containers.list( + filters=filters, all=include_stopped + ) def get_endpoint_container( self, @@ -383,7 +448,9 @@ def get_endpoint_container( if len(containers) == 0: return None if len(containers) > 1 and verify_single_deployment: - raise MultipleLocalDeploymentsFoundError(endpoint_name=endpoint_name) + raise MultipleLocalDeploymentsFoundError( + endpoint_name=endpoint_name + ) return containers[0] def _build_image( @@ -409,7 +476,10 @@ def _build_image( module_logger.info("\n") first_line = False if "stream" in status: - if "An unexpected error has occurred. Conda has prepared the above report." in status["stream"]: + if ( + "An unexpected error has occurred. Conda has prepared the above report." + in status["stream"] + ): raise LocalEndpointImageBuildError(status["stream"]) module_logger.info(status["stream"]) @@ -423,7 +493,9 @@ def _build_image( raise raise LocalEndpointImageBuildError(e) from e - def _reformat_volumes(self, volumes_dict: Dict[str, Dict[str, Dict[str, str]]]) -> List[str]: + def _reformat_volumes( + self, volumes_dict: Dict[str, Dict[str, Dict[str, str]]] + ) -> List[str]: """Returns a list of volumes to pass to docker. :param volumes_dict: custom formatted dict of volumes to mount. We expect the keys to be unique. Example: @@ -463,7 +535,9 @@ def get_container_labels( labels[LocalEndpointConstants.LABEL_KEY_ENDPOINT_NAME] = endpoint_name labels[LocalEndpointConstants.LABEL_KEY_DEPLOYMENT_NAME] = deployment_name labels[LocalEndpointConstants.LABEL_KEY_ENDPOINT_JSON] = endpoint_metadata - labels[LocalEndpointConstants.LABEL_KEY_DEPLOYMENT_JSON] = deployment_metadata + labels[LocalEndpointConstants.LABEL_KEY_DEPLOYMENT_JSON] = ( + deployment_metadata + ) labels[LocalEndpointConstants.LABEL_KEY_AZUREML_PORT] = str(azureml_port) return labels @@ -481,7 +555,9 @@ def get_deployment_json_from_container( container: "docker.models.containers.Container", # type: ignore[name-defined] ) -> Optional[dict]: if container: - data = container.labels[LocalEndpointConstants.LABEL_KEY_DEPLOYMENT_JSON] + data = container.labels[ + LocalEndpointConstants.LABEL_KEY_DEPLOYMENT_JSON + ] return json.loads(data) return None @@ -535,7 +611,9 @@ def _get_image_name(endpoint_name: str, deployment_name: str) -> str: return f"{endpoint_name}:{deployment_name}" -def _get_container_name(endpoint_name: str, deployment_name: Optional[str] = None) -> str: +def _get_container_name( + endpoint_name: str, deployment_name: Optional[str] = None +) -> str: """Returns a container name. :param endpoint_name: name of local endpoint @@ -545,7 +623,11 @@ def _get_container_name(endpoint_name: str, deployment_name: Optional[str] = Non :return: container name :rtype: str """ - return f"{endpoint_name}.{deployment_name}" if deployment_name else endpoint_name + return ( + f"{endpoint_name}.{deployment_name}" + if deployment_name + else endpoint_name + ) def _validate_container_state( @@ -565,4 +647,6 @@ def _validate_container_state( """ status = get_status_from_container(container=container) if LocalEndpointConstants.CONTAINER_EXITED == status: - raise LocalEndpointInFailedStateError(endpoint_name=endpoint_name, deployment_name=deployment_name) + raise LocalEndpointInFailedStateError( + endpoint_name=endpoint_name, deployment_name=deployment_name + ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/dockerfile_resolver.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/dockerfile_resolver.py index 3f126e2d0ccd..8e7e48f0a0e6 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/dockerfile_resolver.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/dockerfile_resolver.py @@ -74,7 +74,11 @@ def __str__(self) -> str: :return: Dockerfile Contents :rtype: str """ - return "" if len(self._instructions) == 0 else "\n".join([str(instr) for instr in self._instructions]) + return ( + "" + if len(self._instructions) == 0 + else "\n".join([str(instr) for instr in self._instructions]) + ) def _construct(self, install_debugpy: bool = False) -> None: """Internal use only. @@ -116,7 +120,11 @@ def _construct(self, install_debugpy: bool = False) -> None: ) if install_debugpy: self._instructions.extend( - [Run(f"conda run -n {LocalEndpointConstants.CONDA_ENV_NAME} pip install debugpy")] + [ + Run( + f"conda run -n {LocalEndpointConstants.CONDA_ENV_NAME} pip install debugpy" + ) + ] ) self._instructions.extend( [ @@ -142,7 +150,9 @@ def _construct(self, install_debugpy: bool = False) -> None: ] ) - def write_file(self, directory_path: str, file_prefix: Optional[str] = None) -> None: + def write_file( + self, directory_path: str, file_prefix: Optional[str] = None + ) -> None: """Writes this Dockerfile to a file in provided directory and file name prefix. :param directory_path: absolute path of local directory to write Dockerfile. @@ -150,7 +160,15 @@ def write_file(self, directory_path: str, file_prefix: Optional[str] = None) -> :param file_prefix: name of Dockerfile prefix :type file_prefix: str """ - file_name = f"{file_prefix}.Dockerfile" if file_prefix else "Dockerfile" - self._local_dockerfile_path = str(Path(directory_path, file_name).resolve()) - with open(self._local_dockerfile_path, "w", encoding=DefaultOpenEncoding.WRITE) as f: + file_name = ( + f"{file_prefix}.Dockerfile" if file_prefix else "Dockerfile" + ) + self._local_dockerfile_path = str( + Path(directory_path, file_name).resolve() + ) + with open( + self._local_dockerfile_path, + "w", + encoding=DefaultOpenEncoding.WRITE, + ) as f: f.write(f"{str(self)}\n") diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/endpoint_stub.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/endpoint_stub.py index 8c50713495fe..c548f5a19e29 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/endpoint_stub.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/endpoint_stub.py @@ -37,7 +37,9 @@ def get(self, endpoint_name: str) -> Optional[OnlineEndpoint]: :return: The specified Online Endpoint :rtype: Optional[Endpoint] """ - endpoint_path = self._get_endpoint_cache_file(endpoint_name=endpoint_name) + endpoint_path = self._get_endpoint_cache_file( + endpoint_name=endpoint_name + ) if endpoint_path.exists(): return load_online_endpoint(source=endpoint_path) return None @@ -59,7 +61,9 @@ def delete(self, endpoint_name: str): :param str endpoint_name: Name of local endpoint to delete. """ - build_directory = self._get_build_directory(endpoint_name=endpoint_name) + build_directory = self._get_build_directory( + endpoint_name=endpoint_name + ) shutil.rmtree(build_directory) def invoke(self): @@ -82,9 +86,13 @@ def _create_endpoint_cache(self, endpoint: OnlineEndpoint) -> Path: :return: The endpoint cache path :rtype: Path """ - endpoint_cache_path = self._get_endpoint_cache_file(endpoint_name=str(endpoint.name)) + endpoint_cache_path = self._get_endpoint_cache_file( + endpoint_name=str(endpoint.name) + ) endpoint_metadata = json.dumps(endpoint.dump()) - endpoint_cache_path.write_text(endpoint_metadata, encoding=DefaultOpenEncoding.WRITE) + endpoint_cache_path.write_text( + endpoint_metadata, encoding=DefaultOpenEncoding.WRITE + ) return endpoint_cache_path def _get_endpoint_cache_file(self, endpoint_name: str) -> Path: @@ -94,7 +102,9 @@ def _get_endpoint_cache_file(self, endpoint_name: str) -> Path: :return: path to cached endpoint file. :rtype: Path """ - build_directory = self._create_build_directory(endpoint_name=endpoint_name) + build_directory = self._create_build_directory( + endpoint_name=endpoint_name + ) return Path(build_directory, f"{endpoint_name}.json") def _create_build_directory(self, endpoint_name: str) -> Path: @@ -104,7 +114,9 @@ def _create_build_directory(self, endpoint_name: str) -> Path: :return: path to endpoint build directory. :rtype: Path """ - build_directory = self._get_build_directory(endpoint_name=endpoint_name) + build_directory = self._get_build_directory( + endpoint_name=endpoint_name + ) build_directory.mkdir(parents=True, exist_ok=True) return build_directory diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/mdc_config_resolver.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/mdc_config_resolver.py index 1cf17b749744..278c13e62fe4 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/mdc_config_resolver.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/mdc_config_resolver.py @@ -44,7 +44,11 @@ def _construct(self, data_collector: DataCollector) -> None: if len(data_collector.collections) <= 0: return - sampling_percentage = int(data_collector.sampling_rate * 100) if data_collector.sampling_rate else 100 + sampling_percentage = ( + int(data_collector.sampling_rate * 100) + if data_collector.sampling_rate + else 100 + ) self.mdc_config = {"collections": {}, "runMode": "local"} custom_logging_enabled = False @@ -57,15 +61,24 @@ def _construct(self, data_collector: DataCollector) -> None: self.mdc_config["collections"][lower_k] = { "enabled": True, - "sampling_percentage": int(v.sampling_rate * 100) if v.sampling_rate else sampling_percentage, + "sampling_percentage": ( + int(v.sampling_rate * 100) + if v.sampling_rate + else sampling_percentage + ), } if not custom_logging_enabled: self.mdc_config = None return - if data_collector.request_logging and data_collector.request_logging.capture_headers: - self.mdc_config["captureHeaders"] = data_collector.request_logging.capture_headers + if ( + data_collector.request_logging + and data_collector.request_logging.capture_headers + ): + self.mdc_config["captureHeaders"] = ( + data_collector.request_logging.capture_headers + ) def write_file(self, directory_path: str) -> None: """Writes this mdc configuration to a file in provided directory. @@ -76,12 +89,22 @@ def write_file(self, directory_path: str) -> None: if not self.mdc_config: return - mdc_setting_path = str(Path(directory_path, self.local_config_name).resolve()) - with open(mdc_setting_path, "w", encoding=DefaultOpenEncoding.WRITE) as f: + mdc_setting_path = str( + Path(directory_path, self.local_config_name).resolve() + ) + with open( + mdc_setting_path, "w", encoding=DefaultOpenEncoding.WRITE + ) as f: d = json.dumps(self.mdc_config) f.write(f"{d}") - self.environment_variables = {"AZUREML_MDC_CONFIG_PATH": self.config_path} + self.environment_variables = { + "AZUREML_MDC_CONFIG_PATH": self.config_path + } local_path = os.path.join(directory_path, self.local_config_name) - self.volumes = {f"{local_path}:{self.config_path}:z": {local_path: {"bind": self.config_path}}} + self.volumes = { + f"{local_path}:{self.config_path}:z": { + local_path: {"bind": self.config_path} + } + } diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/utilities/commandline_utility.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/utilities/commandline_utility.py index 3f41e5f0ffab..2ec8093e35a0 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/utilities/commandline_utility.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/utilities/commandline_utility.py @@ -12,7 +12,11 @@ def _print_command_results(test_passed, time_taken, output): - print("Command {} in {} seconds.".format("successful" if test_passed else "failed", time_taken)) + print( + "Command {} in {} seconds.".format( + "successful" if test_passed else "failed", time_taken + ) + ) print("Output: \n{}\n".format(output)) @@ -31,8 +35,12 @@ def run_cli_command( # argv form on a mac OS. command_to_execute = " ".join(cmd_arguments) - if not do_not_print: # Avoid printing the az login service principal password, for example - print("Preparing to run CLI command: \n{}\n".format(command_to_execute)) + if ( + not do_not_print + ): # Avoid printing the az login service principal password, for example + print( + "Preparing to run CLI command: \n{}\n".format(command_to_execute) + ) print("Current directory: {}".format(os.getcwd())) start_time = time.time() @@ -56,7 +64,9 @@ def run_cli_command( if sys.version_info[0] != 2: subprocess_args["timeout"] = timeout - output = subprocess.check_output(command_to_execute, **subprocess_args).decode(encoding="UTF-8") + output = subprocess.check_output( + command_to_execute, **subprocess_args + ).decode(encoding="UTF-8") time_taken = time.time() - start_time if not do_not_print: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/utilities/wsl_utility.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/utilities/wsl_utility.py index 33bb6036c2e3..8ff28351f2ea 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/utilities/wsl_utility.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/utilities/wsl_utility.py @@ -5,7 +5,9 @@ from platform import uname -from azure.ai.ml._local_endpoints.utilities.commandline_utility import run_cli_command +from azure.ai.ml._local_endpoints.utilities.commandline_utility import ( + run_cli_command, +) def in_wsl() -> bool: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/validators/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/validators/__init__.py index dc6af8197899..a1dd555545ef 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/validators/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/validators/__init__.py @@ -8,4 +8,8 @@ from .environment_validator import get_environment_artifacts from .model_validator import get_model_artifacts -__all__ = ["get_code_configuration_artifacts", "get_environment_artifacts", "get_model_artifacts"] +__all__ = [ + "get_code_configuration_artifacts", + "get_environment_artifacts", + "get_model_artifacts", +] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/validators/code_validator.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/validators/code_validator.py index bbe7c9717665..ef4e0856829a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/validators/code_validator.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/validators/code_validator.py @@ -7,12 +7,16 @@ from pathlib import Path from typing import Optional, Union -from azure.ai.ml._artifacts._artifact_utilities import download_artifact_from_storage_url +from azure.ai.ml._artifacts._artifact_utilities import ( + download_artifact_from_storage_url, +) from azure.ai.ml._utils._arm_id_utils import parse_prefixed_name_version from azure.ai.ml._utils.utils import is_url from azure.ai.ml.constants._common import ARM_ID_PREFIX from azure.ai.ml.entities import OnlineDeployment -from azure.ai.ml.entities._deployment.code_configuration import CodeConfiguration +from azure.ai.ml.entities._deployment.code_configuration import ( + CodeConfiguration, +) from azure.ai.ml.exceptions import RequiredLocalArtifactsNotFoundError from azure.ai.ml.operations._code_operations import CodeOperations @@ -52,7 +56,9 @@ def get_code_configuration_artifacts( if _code_configuration_contains_cloud_artifacts(deployment=deployment): return _get_cloud_code_configuration_artifacts( - str(deployment.code_configuration.code), code_operations, download_path + str(deployment.code_configuration.code), + code_operations, + download_path, ) if not _local_code_path_is_valid(deployment=deployment): @@ -82,7 +88,10 @@ def _local_code_path_is_valid(deployment: OnlineDeployment): def _local_scoring_script_is_valid(deployment: OnlineDeployment): - return deployment.code_configuration and deployment.code_configuration.scoring_script + return ( + deployment.code_configuration + and deployment.code_configuration.scoring_script + ) def _code_configuration_contains_cloud_artifacts(deployment: OnlineDeployment): @@ -102,7 +111,9 @@ def _get_local_code_configuration_artifacts( ).resolve() -def _get_cloud_code_configuration_artifacts(code: str, code_operations: CodeOperations, download_path: str) -> str: +def _get_cloud_code_configuration_artifacts( + code: str, code_operations: CodeOperations, download_path: str +) -> str: name, version = parse_prefixed_name_version(code) code_asset = code_operations.get(name=name, version=version) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/validators/environment_validator.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/validators/environment_validator.py index cc73914969d8..f69b9025059e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/validators/environment_validator.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/validators/environment_validator.py @@ -8,14 +8,26 @@ from pathlib import Path from typing import Optional, Tuple, Union -from azure.ai.ml._artifacts._artifact_utilities import download_artifact_from_storage_url -from azure.ai.ml._utils._arm_id_utils import parse_name_label, parse_name_version +from azure.ai.ml._artifacts._artifact_utilities import ( + download_artifact_from_storage_url, +) +from azure.ai.ml._utils._arm_id_utils import ( + parse_name_label, + parse_name_version, +) from azure.ai.ml._utils.utils import dump_yaml, is_url from azure.ai.ml.constants._common import DefaultOpenEncoding from azure.ai.ml.entities import OnlineDeployment from azure.ai.ml.entities._assets.environment import BuildContext, Environment -from azure.ai.ml.exceptions import ErrorCategory, ErrorTarget, RequiredLocalArtifactsNotFoundError, ValidationException -from azure.ai.ml.operations._environment_operations import EnvironmentOperations +from azure.ai.ml.exceptions import ( + ErrorCategory, + ErrorTarget, + RequiredLocalArtifactsNotFoundError, + ValidationException, +) +from azure.ai.ml.operations._environment_operations import ( + EnvironmentOperations, +) def get_environment_artifacts( @@ -54,7 +66,9 @@ def get_environment_artifacts( label = None if not version: name, label = parse_name_label(deployment.environment) - environment_asset = environment_operations.get(name=name, version=version, label=label) + environment_asset = environment_operations.get( + name=name, version=version, label=label + ) if not _cloud_environment_is_valid(environment=environment_asset): msg = ( @@ -105,15 +119,24 @@ def _get_cloud_environment_artifacts( Tuple[None, None, None, Path, str, Optional[Dict]] ] """ - if environment_asset.build and environment_asset.build.path and is_url(environment_asset.build.path): + if ( + environment_asset.build + and environment_asset.build.path + and is_url(environment_asset.build.path) + ): environment_build_directory = download_artifact_from_storage_url( blob_url=str(environment_asset.build.path), destination=download_path, datastore_operation=environment_operations._datastore_operation, datastore_name="workspaceartifactstore", ) - dockerfile_path = Path(environment_build_directory, str(environment_asset.build.dockerfile_path)) - dockerfile_contents = dockerfile_path.read_text(encoding=DefaultOpenEncoding.READ) + dockerfile_path = Path( + environment_build_directory, + str(environment_asset.build.dockerfile_path), + ) + dockerfile_contents = dockerfile_path.read_text( + encoding=DefaultOpenEncoding.READ + ) return ( None, None, @@ -122,7 +145,11 @@ def _get_cloud_environment_artifacts( dockerfile_contents, environment_asset.inference_config, ) - conda_file_contents = dump_yaml(environment_asset.conda_file) if environment_asset.conda_file else None + conda_file_contents = ( + dump_yaml(environment_asset.conda_file) + if environment_asset.conda_file + else None + ) return ( environment_asset.image, environment_asset.id, @@ -133,7 +160,9 @@ def _get_cloud_environment_artifacts( ) -def _get_local_environment_artifacts(base_path: Union[str, os.PathLike], environment: Environment) -> Optional[Tuple]: +def _get_local_environment_artifacts( + base_path: Union[str, os.PathLike], environment: Environment +) -> Optional[Tuple]: """Retrieves the local environment's artifacts :param base_path: The base path @@ -160,9 +189,15 @@ def _get_local_environment_artifacts(base_path: Union[str, os.PathLike], environ environment.inference_config, ) if environment.build and environment.build.dockerfile_path: - absolute_build_directory = Path(base_path, str(environment.build.path)).resolve() - absolute_dockerfile_path = Path(absolute_build_directory, environment.build.dockerfile_path).resolve() - dockerfile_contents = absolute_dockerfile_path.read_text(encoding=DefaultOpenEncoding.READ) + absolute_build_directory = Path( + base_path, str(environment.build.path) + ).resolve() + absolute_dockerfile_path = Path( + absolute_build_directory, environment.build.dockerfile_path + ).resolve() + dockerfile_contents = absolute_dockerfile_path.read_text( + encoding=DefaultOpenEncoding.READ + ) return ( None, None, @@ -198,5 +233,6 @@ def _cloud_environment_is_valid(environment: Environment): def _environment_contains_cloud_artifacts(deployment: OnlineDeployment): return isinstance(deployment.environment, str) or ( - deployment.environment is not None and deployment.environment.id is not None + deployment.environment is not None + and deployment.environment.id is not None ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/validators/model_validator.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/validators/model_validator.py index 40ed2df79d6c..d41b332cd543 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/validators/model_validator.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/validators/model_validator.py @@ -62,15 +62,23 @@ def get_model_artifacts( def _local_model_is_valid(deployment: OnlineDeployment): - return deployment.model and isinstance(deployment.model, Model) and deployment.model.path + return ( + deployment.model + and isinstance(deployment.model, Model) + and deployment.model.path + ) def _model_contains_cloud_artifacts(deployment: OnlineDeployment): # If the deployment.model is a string, then it is the cloud model name or full arm ID - return isinstance(deployment.model, str) or (deployment.model is not None and deployment.model.id is not None) + return isinstance(deployment.model, str) or ( + deployment.model is not None and deployment.model.id is not None + ) -def _get_cloud_model_artifacts(model_operations: ModelOperations, model: str, download_path: str) -> Tuple: +def _get_cloud_model_artifacts( + model_operations: ModelOperations, model: str, download_path: str +) -> Tuple: if isinstance(model, Model): name = model.name version = model._version diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/vscode_debug/devcontainer_properties.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/vscode_debug/devcontainer_properties.py index fa60d379f5e6..6d04c8cd2cc0 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/vscode_debug/devcontainer_properties.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/vscode_debug/devcontainer_properties.py @@ -104,7 +104,9 @@ def to_dict(self) -> dict: class RunArgs(object): """Python object representation of devcontainer runArgs property.""" - def __init__(self, name: Optional[str] = None, labels: Optional[list] = None): + def __init__( + self, name: Optional[str] = None, labels: Optional[list] = None + ): labels = labels or [] self._run_args = labels if name: @@ -127,7 +129,12 @@ def __init__(self): pass def to_dict(self) -> dict: - return {"extensions": ["ms-python.python", "ms-toolsai.vscode-ai-inference"]} + return { + "extensions": [ + "ms-python.python", + "ms-toolsai.vscode-ai-inference", + ] + } class Settings(object): diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/vscode_debug/devcontainer_resolver.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/vscode_debug/devcontainer_resolver.py index 0c6a77dce529..36833c6772bb 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/vscode_debug/devcontainer_resolver.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/vscode_debug/devcontainer_resolver.py @@ -7,7 +7,10 @@ from pathlib import Path from typing import Dict, List, Optional -from azure.ai.ml._local_endpoints.utilities.wsl_utility import get_wsl_path, in_wsl +from azure.ai.ml._local_endpoints.utilities.wsl_utility import ( + get_wsl_path, + in_wsl, +) from azure.ai.ml._local_endpoints.vscode_debug.devcontainer_properties import ( AppPort, Build, @@ -21,7 +24,11 @@ Settings, ) from azure.ai.ml.constants._common import DefaultOpenEncoding -from azure.ai.ml.exceptions import ErrorCategory, ErrorTarget, ValidationException +from azure.ai.ml.exceptions import ( + ErrorCategory, + ErrorTarget, + ValidationException, +) class DevContainerResolver: @@ -106,14 +113,20 @@ def _construct(self) -> None: self._properties.update(Settings().to_dict()) if self._environment: - self._properties.update(ContainerEnv(environment_variables=self._environment).to_dict()) + self._properties.update( + ContainerEnv( + environment_variables=self._environment + ).to_dict() + ) if self._mounts: self._properties.update(Mounts(mounts=self._mounts).to_dict()) if self._labels: self._properties.update(RunArgs(labels=self._labels).to_dict()) if self._port: self._properties.update(AppPort(port=self._port).to_dict()) - self._properties.update(ForwardPorts(port=self._port).to_dict()) + self._properties.update( + ForwardPorts(port=self._port).to_dict() + ) def write_file(self, directory_path: str) -> None: """Writes this devcontainer.json to provided directory. @@ -121,14 +134,18 @@ def write_file(self, directory_path: str) -> None: :param directory_path: absolute path of local directory to write devcontainer.json. :type directory_path: str """ - self._local_path = get_wsl_path(directory_path) if in_wsl() else directory_path + self._local_path = ( + get_wsl_path(directory_path) if in_wsl() else directory_path + ) file_path = _get_devcontainer_file_path(directory_path=directory_path) with open(file_path, "w", encoding=DefaultOpenEncoding.WRITE) as f: f.write(f"{json.dumps(self._properties, indent=4)}\n") -def _reformat_mounts(mounts: Dict[str, Dict[str, Dict[str, str]]]) -> List[str]: +def _reformat_mounts( + mounts: Dict[str, Dict[str, Dict[str, str]]], +) -> List[str]: """Reformat mounts from Docker format to DevContainer format. :param mounts: Dictionary with mount information for Docker container. For example: @@ -151,7 +168,9 @@ def _reformat_mounts(mounts: Dict[str, Dict[str, Dict[str, str]]]) -> List[str]: for mount_dict in mounts.values(): for source, dest in mount_dict.items(): for mount_type, container_dest in dest.items(): - devcontainer_mounts.append(f"source={source},target={container_dest},type={mount_type}") + devcontainer_mounts.append( + f"source={source},target={container_dest},type={mount_type}" + ) return devcontainer_mounts diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/vscode_debug/vscode_client.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/vscode_debug/vscode_client.py index b2381bbf76a4..0af299eabe0e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/vscode_debug/vscode_client.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/vscode_debug/vscode_client.py @@ -4,8 +4,12 @@ import binascii import re -from azure.ai.ml._local_endpoints.utilities.commandline_utility import run_cli_command -from azure.ai.ml._local_endpoints.vscode_debug.devcontainer_resolver import DevContainerResolver +from azure.ai.ml._local_endpoints.utilities.commandline_utility import ( + run_cli_command, +) +from azure.ai.ml._local_endpoints.vscode_debug.devcontainer_resolver import ( + DevContainerResolver, +) from azure.ai.ml.exceptions import VSCodeCommandNotFound @@ -31,7 +35,9 @@ def create_dev_container_json( devcontainer.write_file(build_directory) return str(devcontainer.local_path) - def invoke_dev_container(self, devcontainer_path: str, app_path: str) -> None: + def invoke_dev_container( + self, devcontainer_path: str, app_path: str + ) -> None: hex_encoded_devcontainer_path = _encode_hex(devcontainer_path) command = [ "code", diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_logging/chained_identity.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_logging/chained_identity.py index 5c683edc5383..a22763885501 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_logging/chained_identity.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_logging/chained_identity.py @@ -18,7 +18,12 @@ class ChainedIdentity(object): DELIM = "#" - def __init__(self, _ident: Optional[str] = None, _parent_logger: Optional[logging.Logger] = None, **kwargs): + def __init__( + self, + _ident: Optional[str] = None, + _parent_logger: Optional[logging.Logger] = None, + **kwargs + ): """Internal class used to improve logging information. :param _ident: Identity of the object @@ -30,13 +35,19 @@ def __init__(self, _ident: Optional[str] = None, _parent_logger: Optional[loggin # TODO: Ideally move constructor params to None defaulted # and pick up the stack trace as a reasonable approximation self._identity = self.__class__.__name__ if _ident is None else _ident - parent = logging.getLogger("azureml") if _parent_logger is None else _parent_logger + parent = ( + logging.getLogger("azureml") + if _parent_logger is None + else _parent_logger + ) self._logger = parent.getChild(self._identity) try: super(ChainedIdentity, self).__init__(**kwargs) except TypeError as type_error: raise TypeError( - "{}. Found key word arguments: {}.".format(",".join(type_error.args), kwargs.keys()) + "{}. Found key word arguments: {}.".format( + ",".join(type_error.args), kwargs.keys() + ) ) from type_error @property @@ -64,5 +75,7 @@ def __enter__(self) -> logging.Logger: def __exit__(self, etype, value, traceback) -> None: if value is not None: - self._logger.debug("Error {0}: {1}\n{2}".format(etype, value, traceback)) + self._logger.debug( + "Error {0}: {1}\n{2}".format(etype, value, traceback) + ) self._logger.debug(STOP_MSG) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_logging/compliant_logger.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_logging/compliant_logger.py index bd7977907c6b..dbefa71eb07a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_logging/compliant_logger.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_logging/compliant_logger.py @@ -2,15 +2,15 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- -""" This is logger utility which will work with allowed logged filter AML policy - https://github.com/Azure/azure-policy/blob/master/built-in-policies/policyDefinitions/Machine%20Learning/AllowedLogFilter_EnforceSetting.json - You have to define the same "logFilters" while initializing the logger using "enable_compliant_logging" method - e.g. - log filters: ["^SystemLog:.*$"] - initialize : enable_compliant_logging(format_key="prefix", - format_key_value="SystemLog", - format=f"%(prefix)s{logging.BASIC_FORMAT}") - By default log message will not compliant e.g. not modified +"""This is logger utility which will work with allowed logged filter AML policy +https://github.com/Azure/azure-policy/blob/master/built-in-policies/policyDefinitions/Machine%20Learning/AllowedLogFilter_EnforceSetting.json +You have to define the same "logFilters" while initializing the logger using "enable_compliant_logging" method +e.g. + log filters: ["^SystemLog:.*$"] + initialize : enable_compliant_logging(format_key="prefix", + format_key_value="SystemLog", + format=f"%(prefix)s{logging.BASIC_FORMAT}") +By default log message will not compliant e.g. not modified """ import logging diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_logging/debug_mode.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_logging/debug_mode.py index 0107da6dde0f..0b7385fccbcc 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_logging/debug_mode.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_logging/debug_mode.py @@ -41,8 +41,15 @@ def stack_info() -> list: def connection_info(gc_objects: list) -> List[ConnectionInfo]: - connections = [obj for obj in gc_objects if isinstance(obj, http.client.HTTPConnection)] - return [ConnectionInfo(host=c.host, port=c.port, hasSocket=c.sock is not None) for c in connections] # disable + connections = [ + obj + for obj in gc_objects + if isinstance(obj, http.client.HTTPConnection) + ] + return [ + ConnectionInfo(host=c.host, port=c.port, hasSocket=c.sock is not None) + for c in connections + ] # disable # pylint: disable=client-incorrect-naming-convention @@ -61,22 +68,31 @@ class diagnostic_log(object): """ def __init__( - self, log_path: Optional[str] = None, namespaces: Optional[list] = None, context_name: Optional[str] = None + self, + log_path: Optional[str] = None, + namespaces: Optional[list] = None, + context_name: Optional[str] = None, ): - self._namespaces = INTERESTING_NAMESPACES if namespaces is None else namespaces + self._namespaces = ( + INTERESTING_NAMESPACES if namespaces is None else namespaces + ) self._filename = LOG_FILE if log_path is None else log_path self._filename = os.path.abspath(self._filename) self._capturing = False if context_name is None: import inspect - context_name = inspect.getouterframes(inspect.currentframe(), 2)[1].function + context_name = inspect.getouterframes(inspect.currentframe(), 2)[ + 1 + ].function self._context_name = context_name formatter = logging.Formatter(LOG_FORMAT) formatter.converter = time.gmtime - file_handler = logging.FileHandler(filename=self._filename, encoding="utf-8") + file_handler = logging.FileHandler( + filename=self._filename, encoding="utf-8" + ) file_handler.setLevel(logging.DEBUG) file_handler.setFormatter(formatter) self._handler = file_handler @@ -84,12 +100,16 @@ def __init__( def start_capture(self) -> None: """Start the capture of debug logs.""" if self._capturing: - module_logger.warning("Debug logs are already enabled at %s", self._filename) + module_logger.warning( + "Debug logs are already enabled at %s", self._filename + ) return print("Debug logs are being sent to {}".format(self._filename)) for namespace in self._namespaces: - module_logger.debug("Adding [%s] debug logs to this file", namespace) + module_logger.debug( + "Adding [%s] debug logs to this file", namespace + ) n_logger = logging.getLogger(namespace) n_logger.setLevel(logging.DEBUG) n_logger.addHandler(self._handler) @@ -114,10 +134,16 @@ def stop_capture(self) -> None: "\n\n********** STOPPING CAPTURE FOR [%s] **********\n\n", self._context_name, ) - print("Disabling log capture. Resulting file is at {}".format(self._filename)) + print( + "Disabling log capture. Resulting file is at {}".format( + self._filename + ) + ) for namespace in self._namespaces: - module_logger.debug("Removing [%s] debug logs to this file", namespace) + module_logger.debug( + "Removing [%s] debug logs to this file", namespace + ) n_logger = logging.getLogger(namespace) n_logger.removeHandler(self._handler) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py index 6b6dbdcbd617..db5e4694a6c6 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py @@ -24,35 +24,74 @@ from azure.ai.ml._restclient.v2020_09_01_dataplanepreview import ( AzureMachineLearningWorkspaces as ServiceClient092020DataplanePreview, ) -from azure.ai.ml._restclient.v2022_02_01_preview import AzureMachineLearningWorkspaces as ServiceClient022022Preview -from azure.ai.ml._restclient.v2022_05_01 import AzureMachineLearningWorkspaces as ServiceClient052022 -from azure.ai.ml._restclient.v2022_10_01 import AzureMachineLearningWorkspaces as ServiceClient102022 -from azure.ai.ml._restclient.v2022_10_01_preview import AzureMachineLearningWorkspaces as ServiceClient102022Preview -from azure.ai.ml._restclient.v2023_02_01_preview import AzureMachineLearningWorkspaces as ServiceClient022023Preview -from azure.ai.ml._restclient.v2023_04_01 import AzureMachineLearningWorkspaces as ServiceClient042023 -from azure.ai.ml._restclient.v2023_04_01_preview import AzureMachineLearningWorkspaces as ServiceClient042023Preview -from azure.ai.ml._restclient.v2023_06_01_preview import AzureMachineLearningWorkspaces as ServiceClient062023Preview -from azure.ai.ml._restclient.v2023_08_01_preview import AzureMachineLearningWorkspaces as ServiceClient082023Preview +from azure.ai.ml._restclient.v2022_02_01_preview import ( + AzureMachineLearningWorkspaces as ServiceClient022022Preview, +) +from azure.ai.ml._restclient.v2022_05_01 import ( + AzureMachineLearningWorkspaces as ServiceClient052022, +) +from azure.ai.ml._restclient.v2022_10_01 import ( + AzureMachineLearningWorkspaces as ServiceClient102022, +) +from azure.ai.ml._restclient.v2022_10_01_preview import ( + AzureMachineLearningWorkspaces as ServiceClient102022Preview, +) +from azure.ai.ml._restclient.v2023_02_01_preview import ( + AzureMachineLearningWorkspaces as ServiceClient022023Preview, +) +from azure.ai.ml._restclient.v2023_04_01 import ( + AzureMachineLearningWorkspaces as ServiceClient042023, +) +from azure.ai.ml._restclient.v2023_04_01_preview import ( + AzureMachineLearningWorkspaces as ServiceClient042023Preview, +) +from azure.ai.ml._restclient.v2023_06_01_preview import ( + AzureMachineLearningWorkspaces as ServiceClient062023Preview, +) +from azure.ai.ml._restclient.v2023_08_01_preview import ( + AzureMachineLearningWorkspaces as ServiceClient082023Preview, +) # Same object, but was renamed starting in v2023_08_01_preview -from azure.ai.ml._restclient.v2023_10_01 import AzureMachineLearningServices as ServiceClient102023 -from azure.ai.ml._restclient.v2024_01_01_preview import AzureMachineLearningWorkspaces as ServiceClient012024Preview -from azure.ai.ml._restclient.v2024_04_01_preview import AzureMachineLearningWorkspaces as ServiceClient042024Preview -from azure.ai.ml._restclient.v2024_07_01_preview import AzureMachineLearningWorkspaces as ServiceClient072024Preview -from azure.ai.ml._restclient.v2024_10_01_preview import AzureMachineLearningWorkspaces as ServiceClient102024Preview -from azure.ai.ml._restclient.v2025_01_01_preview import AzureMachineLearningWorkspaces as ServiceClient012025Preview +from azure.ai.ml._restclient.v2023_10_01 import ( + AzureMachineLearningServices as ServiceClient102023, +) +from azure.ai.ml._restclient.v2024_01_01_preview import ( + AzureMachineLearningWorkspaces as ServiceClient012024Preview, +) +from azure.ai.ml._restclient.v2024_04_01_preview import ( + AzureMachineLearningWorkspaces as ServiceClient042024Preview, +) +from azure.ai.ml._restclient.v2024_07_01_preview import ( + AzureMachineLearningWorkspaces as ServiceClient072024Preview, +) +from azure.ai.ml._restclient.v2024_10_01_preview import ( + AzureMachineLearningWorkspaces as ServiceClient102024Preview, +) +from azure.ai.ml._restclient.v2025_01_01_preview import ( + AzureMachineLearningWorkspaces as ServiceClient012025Preview, +) from azure.ai.ml._restclient.workspace_dataplane import ( AzureMachineLearningWorkspaces as ServiceClientWorkspaceDataplane, ) -from azure.ai.ml._scope_dependent_operations import OperationConfig, OperationsContainer, OperationScope -from azure.ai.ml._telemetry.logging_handler import configure_appinsights_logging +from azure.ai.ml._scope_dependent_operations import ( + OperationConfig, + OperationsContainer, + OperationScope, +) +from azure.ai.ml._telemetry.logging_handler import ( + configure_appinsights_logging, +) from azure.ai.ml._user_agent import USER_AGENT from azure.ai.ml._utils._experimental import experimental from azure.ai.ml._utils._http_utils import HttpPipeline from azure.ai.ml._utils._preflight_utils import get_deployments_operation from azure.ai.ml._utils._registry_utils import get_registry_client from azure.ai.ml._utils.utils import _is_https_url -from azure.ai.ml.constants._common import AzureMLResourceType, DefaultOpenEncoding +from azure.ai.ml.constants._common import ( + AzureMLResourceType, + DefaultOpenEncoding, +) from azure.ai.ml.entities import ( BatchDeployment, BatchEndpoint, @@ -74,8 +113,14 @@ Workspace, ) from azure.ai.ml.entities._assets import WorkspaceAssetReference -from azure.ai.ml.entities._workspace._ai_workspaces.capability_host import CapabilityHost -from azure.ai.ml.exceptions import ErrorCategory, ErrorTarget, ValidationException +from azure.ai.ml.entities._workspace._ai_workspaces.capability_host import ( + CapabilityHost, +) +from azure.ai.ml.exceptions import ( + ErrorCategory, + ErrorTarget, + ValidationException, +) from azure.ai.ml.operations import ( AzureOpenAIDeploymentOperations, BatchDeploymentOperations, @@ -97,15 +142,25 @@ WorkspaceConnectionsOperations, WorkspaceOperations, ) -from azure.ai.ml.operations._capability_hosts_operations import CapabilityHostsOperations +from azure.ai.ml.operations._capability_hosts_operations import ( + CapabilityHostsOperations, +) from azure.ai.ml.operations._code_operations import CodeOperations from azure.ai.ml.operations._feature_set_operations import FeatureSetOperations -from azure.ai.ml.operations._feature_store_entity_operations import FeatureStoreEntityOperations -from azure.ai.ml.operations._feature_store_operations import FeatureStoreOperations -from azure.ai.ml.operations._local_deployment_helper import _LocalDeploymentHelper +from azure.ai.ml.operations._feature_store_entity_operations import ( + FeatureStoreEntityOperations, +) +from azure.ai.ml.operations._feature_store_operations import ( + FeatureStoreOperations, +) +from azure.ai.ml.operations._local_deployment_helper import ( + _LocalDeploymentHelper, +) from azure.ai.ml.operations._local_endpoint_helper import _LocalEndpointHelper from azure.ai.ml.operations._schedule_operations import ScheduleOperations -from azure.ai.ml.operations._workspace_outbound_rule_operations import WorkspaceOutboundRuleOperations +from azure.ai.ml.operations._workspace_outbound_rule_operations import ( + WorkspaceOutboundRuleOperations, +) from azure.core.credentials import TokenCredential from azure.core.polling import LROPoller @@ -186,7 +241,9 @@ def __init__( self._ws_sub: Any = None show_progress = kwargs.pop("show_progress", True) enable_telemetry = kwargs.pop("enable_telemetry", True) - self._operation_config = OperationConfig(show_progress=show_progress, enable_telemetry=enable_telemetry) + self._operation_config = OperationConfig( + show_progress=show_progress, enable_telemetry=enable_telemetry + ) if "cloud" in kwargs: cloud_name = kwargs["cloud"] @@ -198,7 +255,10 @@ def __init__( except LookupError as e: module_logger.debug("Missing keyword: %s", e) else: - module_logger.debug("%s key not found in kwargs", CloudArgumentKeys.CLOUD_METADATA) + module_logger.debug( + "%s key not found in kwargs", + CloudArgumentKeys.CLOUD_METADATA, + ) else: module_logger.debug("cloud key not found in kwargs") cloud_name = _get_default_cloud_name() @@ -231,7 +291,11 @@ def __init__( workspace_reference = kwargs.pop("workspace_reference", None) if workspace_reference or registry_reference: ws_ops = WorkspaceOperations( - OperationScope(str(subscription_id), str(resource_group_name), workspace_reference), + OperationScope( + str(subscription_id), + str(resource_group_name), + workspace_reference, + ), ServiceClient042023Preview( credential=self._credential, subscription_id=subscription_id, @@ -241,7 +305,11 @@ def __init__( ) self._ws_rg = resource_group_name self._ws_sub = subscription_id - workspace_details = ws_ops.get(workspace_reference if workspace_reference else workspace_name) + workspace_details = ws_ops.get( + workspace_reference + if workspace_reference + else workspace_name + ) workspace_location, workspace_id = ( workspace_details.location, workspace_details._workspace_id, @@ -292,7 +360,9 @@ def __init__( enable_telemetry=self._operation_config.enable_telemetry, ) - base_url = _get_base_url_from_metadata(cloud_name=cloud_name, is_local_mfe=True) + base_url = _get_base_url_from_metadata( + cloud_name=cloud_name, is_local_mfe=True + ) self._base_url = base_url self._kwargs = kwargs @@ -303,18 +373,22 @@ def __init__( if base_url: ops_kwargs["enforce_https"] = _is_https_url(base_url) - self._service_client_09_2020_dataplanepreview = ServiceClient092020DataplanePreview( - subscription_id=self._operation_scope._subscription_id, - credential=self._credential, - base_url=base_url, - **kwargs, + self._service_client_09_2020_dataplanepreview = ( + ServiceClient092020DataplanePreview( + subscription_id=self._operation_scope._subscription_id, + credential=self._credential, + base_url=base_url, + **kwargs, + ) ) - self._service_client_workspace_dataplane = ServiceClientWorkspaceDataplane( - subscription_id=self._operation_scope._subscription_id, - credential=self._credential, - base_url=base_url, - **kwargs, + self._service_client_workspace_dataplane = ( + ServiceClientWorkspaceDataplane( + subscription_id=self._operation_scope._subscription_id, + credential=self._credential, + base_url=base_url, + **kwargs, + ) ) self._service_client_02_2022_preview = ServiceClient022022Preview( @@ -506,7 +580,11 @@ def __init__( ) self._workspaces = WorkspaceOperations( - self._ws_operation_scope if registry_reference else self._operation_scope, + ( + self._ws_operation_scope + if registry_reference + else self._operation_scope + ), self._service_client_10_2024_preview, self._operation_container, self._credential, @@ -548,7 +626,9 @@ def __init__( self._credential, **kwargs, ) - self._operation_container.add(AzureMLResourceType.CAPABILITY_HOST, self._capability_hosts) + self._operation_container.add( + AzureMLResourceType.CAPABILITY_HOST, self._capability_hosts + ) self._preflight = get_deployments_operation( credentials=self._credential, @@ -561,7 +641,9 @@ def __init__( self._service_client_08_2023_preview, self._service_client_04_2024_preview, ) - self._operation_container.add(AzureMLResourceType.COMPUTE, self._compute) + self._operation_container.add( + AzureMLResourceType.COMPUTE, self._compute + ) self._datastores = DatastoreOperations( operation_scope=self._operation_scope, operation_config=self._operation_config, @@ -569,7 +651,9 @@ def __init__( serviceclient_2024_01_01_preview=self._service_client_01_2024_preview, **ops_kwargs, # type: ignore[arg-type] ) - self._operation_container.add(AzureMLResourceType.DATASTORE, self._datastores) + self._operation_container.add( + AzureMLResourceType.DATASTORE, self._datastores + ) self._models = ModelOperations( self._operation_scope, self._operation_config, @@ -579,7 +663,11 @@ def __init__( else self._service_client_08_2023_preview ), self._datastores, - (self._service_client_model_dataplane if registry_name or registry_reference else None), + ( + self._service_client_model_dataplane + if registry_name or registry_reference + else None + ), self._operation_container, requests_pipeline=self._requests_pipeline, control_plane_client=self._service_client_08_2023_preview, @@ -607,23 +695,45 @@ def __init__( self._operation_container.add(AzureMLResourceType.MODEL, self._models) self._code = CodeOperations( - self._ws_operation_scope if registry_reference else self._operation_scope, + ( + self._ws_operation_scope + if registry_reference + else self._operation_scope + ), self._operation_config, - (self._service_client_10_2021_dataplanepreview if registry_name else self._service_client_04_2023), + ( + self._service_client_10_2021_dataplanepreview + if registry_name + else self._service_client_04_2023 + ), self._datastores, **ops_kwargs, # type: ignore[arg-type] ) self._operation_container.add(AzureMLResourceType.CODE, self._code) self._environments = EnvironmentOperations( - self._ws_operation_scope if registry_reference else self._operation_scope, + ( + self._ws_operation_scope + if registry_reference + else self._operation_scope + ), self._operation_config, - (self._service_client_10_2021_dataplanepreview if registry_name else self._service_client_04_2023_preview), + ( + self._service_client_10_2021_dataplanepreview + if registry_name + else self._service_client_04_2023_preview + ), self._operation_container, **ops_kwargs, # type: ignore[arg-type] ) - self._operation_container.add(AzureMLResourceType.ENVIRONMENT, self._environments) - self._local_endpoint_helper = _LocalEndpointHelper(requests_pipeline=self._requests_pipeline) - self._local_deployment_helper = _LocalDeploymentHelper(self._operation_container) + self._operation_container.add( + AzureMLResourceType.ENVIRONMENT, self._environments + ) + self._local_endpoint_helper = _LocalEndpointHelper( + requests_pipeline=self._requests_pipeline + ) + self._local_deployment_helper = _LocalDeploymentHelper( + self._operation_container + ) self._online_endpoints = OnlineEndpointOperations( self._operation_scope, self._operation_config, @@ -644,10 +754,18 @@ def __init__( service_client_09_2020_dataplanepreview=self._service_client_09_2020_dataplanepreview, **ops_kwargs, # type: ignore[arg-type] ) - self._operation_container.add(AzureMLResourceType.BATCH_ENDPOINT, self._batch_endpoints) - self._operation_container.add(AzureMLResourceType.ONLINE_ENDPOINT, self._online_endpoints) + self._operation_container.add( + AzureMLResourceType.BATCH_ENDPOINT, self._batch_endpoints + ) + self._operation_container.add( + AzureMLResourceType.ONLINE_ENDPOINT, self._online_endpoints + ) self._online_deployments = OnlineDeploymentOperations( - self._ws_operation_scope if registry_reference else self._operation_scope, + ( + self._ws_operation_scope + if registry_reference + else self._operation_scope + ), self._operation_config, self._service_client_04_2023_preview, self._operation_container, @@ -666,12 +784,24 @@ def __init__( service_client_02_2023_preview=self._service_client_02_2023_preview, **ops_kwargs, ) - self._operation_container.add(AzureMLResourceType.ONLINE_DEPLOYMENT, self._online_deployments) - self._operation_container.add(AzureMLResourceType.BATCH_DEPLOYMENT, self._batch_deployments) + self._operation_container.add( + AzureMLResourceType.ONLINE_DEPLOYMENT, self._online_deployments + ) + self._operation_container.add( + AzureMLResourceType.BATCH_DEPLOYMENT, self._batch_deployments + ) self._data = DataOperations( - self._ws_operation_scope if registry_reference else self._operation_scope, + ( + self._ws_operation_scope + if registry_reference + else self._operation_scope + ), self._operation_config, - (self._service_client_10_2021_dataplanepreview if registry_name else self._service_client_04_2023_preview), + ( + self._service_client_10_2021_dataplanepreview + if registry_name + else self._service_client_04_2023_preview + ), self._service_client_01_2024_preview, self._datastores, requests_pipeline=self._requests_pipeline, @@ -682,12 +812,18 @@ def __init__( self._components = ComponentOperations( self._operation_scope, self._operation_config, - (self._service_client_10_2021_dataplanepreview if registry_name else self._service_client_01_2024_preview), + ( + self._service_client_10_2021_dataplanepreview + if registry_name + else self._service_client_01_2024_preview + ), self._operation_container, self._preflight, **ops_kwargs, # type: ignore[arg-type] ) - self._operation_container.add(AzureMLResourceType.COMPONENT, self._components) + self._operation_container.add( + AzureMLResourceType.COMPONENT, self._components + ) self._jobs = JobOperations( self._operation_scope, self._operation_config, @@ -712,7 +848,9 @@ def __init__( _service_client_kwargs=kwargs, **ops_kwargs, ) - self._operation_container.add(AzureMLResourceType.SCHEDULE, self._schedules) + self._operation_container.add( + AzureMLResourceType.SCHEDULE, self._schedules + ) self._indexes = IndexOperations( operation_scope=self._operation_scope, @@ -727,7 +865,9 @@ def __init__( self._operation_container.add(AzureMLResourceType.INDEX, self._indexes) try: - from azure.ai.ml.operations._virtual_cluster_operations import VirtualClusterOperations + from azure.ai.ml.operations._virtual_cluster_operations import ( + VirtualClusterOperations, + ) self._virtual_clusters = VirtualClusterOperations( self._operation_scope, @@ -740,7 +880,10 @@ def __init__( self._virtual_clusters, # type: ignore[arg-type] ) except Exception as ex: # pylint: disable=broad-except - module_logger.debug("Virtual Cluster operations could not be initialized due to %s ", ex) + module_logger.debug( + "Virtual Cluster operations could not be initialized due to %s ", + ex, + ) self._featurestores = FeatureStoreOperations( self._operation_scope, @@ -783,10 +926,20 @@ def __init__( self._service_client_01_2024_preview, ) self._operation_container.add(AzureMLResourceType.FEATURE_STORE, self._featurestores) # type: ignore[arg-type] - self._operation_container.add(AzureMLResourceType.FEATURE_SET, self._featuresets) - self._operation_container.add(AzureMLResourceType.FEATURE_STORE_ENTITY, self._featurestoreentities) - self._operation_container.add(AzureMLResourceType.SERVERLESS_ENDPOINT, self._serverless_endpoints) - self._operation_container.add(AzureMLResourceType.MARKETPLACE_SUBSCRIPTION, self._marketplace_subscriptions) + self._operation_container.add( + AzureMLResourceType.FEATURE_SET, self._featuresets + ) + self._operation_container.add( + AzureMLResourceType.FEATURE_STORE_ENTITY, + self._featurestoreentities, + ) + self._operation_container.add( + AzureMLResourceType.SERVERLESS_ENDPOINT, self._serverless_endpoints + ) + self._operation_container.add( + AzureMLResourceType.MARKETPLACE_SUBSCRIPTION, + self._marketplace_subscriptions, + ) @classmethod def from_config( # pylint: disable=C4758 @@ -864,7 +1017,9 @@ def from_config( # pylint: disable=C4758 files_to_look = ["config.json", "project.json"] found_path = None - for curr_dir, curr_file in product(directories_to_look, files_to_look): + for curr_dir, curr_file in product( + directories_to_look, files_to_look + ): module_logger.debug( ( "No config file directly found, starting search from %s " @@ -898,7 +1053,9 @@ def from_config( # pylint: disable=C4758 error_category=ErrorCategory.USER_ERROR, ) - subscription_id, resource_group, workspace_name = MLClient._get_workspace_info(str(found_path)) + subscription_id, resource_group, workspace_name = ( + MLClient._get_workspace_info(str(found_path)) + ) module_logger.info("Found the config file in: %s", found_path) return MLClient( @@ -910,7 +1067,12 @@ def from_config( # pylint: disable=C4758 ) @classmethod - def _ml_client_cli(cls, credentials: TokenCredential, subscription_id: Optional[str], **kwargs) -> "MLClient": + def _ml_client_cli( + cls, + credentials: TokenCredential, + subscription_id: Optional[str], + **kwargs, + ) -> "MLClient": """This method provides a way to create MLClient object for cli to leverage cli context for authentication. With this we do not have to use AzureCliCredentials from azure-identity package (not meant for heavy usage). The @@ -924,7 +1086,9 @@ def _ml_client_cli(cls, credentials: TokenCredential, subscription_id: Optional[ :rtype: ~azure.ai.ml.MLClient """ - ml_client = cls(credential=credentials, subscription_id=subscription_id, **kwargs) + ml_client = cls( + credential=credentials, subscription_id=subscription_id, **kwargs + ) return ml_client @property @@ -1204,14 +1368,25 @@ def _get_new_client(self, workspace_name: str, **kwargs) -> "MLClient": ) @classmethod - def _get_workspace_info(cls, found_path: Optional[str]) -> Tuple[str, str, str]: - with open(str(found_path), encoding=DefaultOpenEncoding.READ) as config_file: + def _get_workspace_info( + cls, found_path: Optional[str] + ) -> Tuple[str, str, str]: + with open( + str(found_path), encoding=DefaultOpenEncoding.READ + ) as config_file: config = json.load(config_file) # Checking the keys in the config.json file to check for required parameters. scope = config.get("Scope") if not scope: - if not all(k in config.keys() for k in ("subscription_id", "resource_group", "workspace_name")): + if not all( + k in config.keys() + for k in ( + "subscription_id", + "resource_group", + "workspace_name", + ) + ): msg = ( "The config file found in: {} does not seem to contain the required " "parameters. Please make sure it contains your subscription_id, " @@ -1269,7 +1444,9 @@ def create_or_update( , ~azure.ai.ml.entities.Environment, ~azure.ai.ml.entities.Component, ~azure.ai.ml.entities.Datastore] """ - return _create_or_update(entity, self._operation_container.all_operations, **kwargs) + return _create_or_update( + entity, self._operation_container.all_operations, **kwargs + ) # R = valid inputs/outputs for begin_create_or_update # Each entry here requires a registered _begin_create_or_update function below @@ -1305,7 +1482,9 @@ def begin_create_or_update( , ~azure.ai.ml.entities.BatchEndpoint, ~azure.ai.ml.entities.Schedule]] """ - return _begin_create_or_update(entity, self._operation_container.all_operations, **kwargs) + return _begin_create_or_update( + entity, self._operation_container.all_operations, **kwargs + ) def __repr__(self) -> str: return f"""MLClient(credential={self._credential}, @@ -1322,13 +1501,17 @@ def _add_user_agent(kwargs) -> None: @singledispatch def _create_or_update(entity, operations, **kwargs): - raise TypeError("Please refer to create_or_update docstring for valid input types.") + raise TypeError( + "Please refer to create_or_update docstring for valid input types." + ) @_create_or_update.register(Job) def _(entity: Job, operations, **kwargs): module_logger.debug("Creating or updating job") - return operations[AzureMLResourceType.JOB].create_or_update(entity, **kwargs) + return operations[AzureMLResourceType.JOB].create_or_update( + entity, **kwargs + ) @_create_or_update.register(Model) @@ -1358,7 +1541,9 @@ def _(entity: WorkspaceAssetReference, operations): @_create_or_update.register(Component) def _(entity: Component, operations, **kwargs): module_logger.debug("Creating or updating components") - return operations[AzureMLResourceType.COMPONENT].create_or_update(entity, **kwargs) + return operations[AzureMLResourceType.COMPONENT].create_or_update( + entity, **kwargs + ) @_create_or_update.register(Datastore) @@ -1370,87 +1555,117 @@ def _(entity: Datastore, operations): @_create_or_update.register(Index) def _(entity: Index, operations, *args, **kwargs): module_logger.debug("Creating or updating indexes") - return operations[AzureMLResourceType.INDEX].create_or_update(entity, **kwargs) + return operations[AzureMLResourceType.INDEX].create_or_update( + entity, **kwargs + ) @singledispatch def _begin_create_or_update(entity, operations, **kwargs): - raise TypeError("Please refer to begin_create_or_update docstring for valid input types.") + raise TypeError( + "Please refer to begin_create_or_update docstring for valid input types." + ) @_begin_create_or_update.register(Workspace) def _(entity: Workspace, operations, *args, **kwargs): module_logger.debug("Creating or updating workspaces") - return operations[AzureMLResourceType.WORKSPACE].begin_create(entity, **kwargs) + return operations[AzureMLResourceType.WORKSPACE].begin_create( + entity, **kwargs + ) @_begin_create_or_update.register(CapabilityHost) def _(entity: CapabilityHost, operations, *args, **kwargs): module_logger.debug("Creating or updating capability hosts") - return operations[AzureMLResourceType.CAPABILITY_HOST].begin_create_or_update(entity, **kwargs) + return operations[ + AzureMLResourceType.CAPABILITY_HOST + ].begin_create_or_update(entity, **kwargs) @_begin_create_or_update.register(Registry) def _(entity: Registry, operations, *args, **kwargs): module_logger.debug("Creating or updating registries") - return operations[AzureMLResourceType.REGISTRY].begin_create_or_update(entity, **kwargs) + return operations[AzureMLResourceType.REGISTRY].begin_create_or_update( + entity, **kwargs + ) @_begin_create_or_update.register(Compute) def _(entity: Compute, operations, *args, **kwargs): module_logger.debug("Creating or updating compute") - return operations[AzureMLResourceType.COMPUTE].begin_create_or_update(entity, **kwargs) + return operations[AzureMLResourceType.COMPUTE].begin_create_or_update( + entity, **kwargs + ) @_begin_create_or_update.register(OnlineEndpoint) def _(entity: OnlineEndpoint, operations, *args, **kwargs): module_logger.debug("Creating or updating online_endpoints") - return operations[AzureMLResourceType.ONLINE_ENDPOINT].begin_create_or_update(entity, **kwargs) + return operations[ + AzureMLResourceType.ONLINE_ENDPOINT + ].begin_create_or_update(entity, **kwargs) @_begin_create_or_update.register(BatchEndpoint) def _(entity: BatchEndpoint, operations, *args, **kwargs): module_logger.debug("Creating or updating batch_endpoints") - return operations[AzureMLResourceType.BATCH_ENDPOINT].begin_create_or_update(entity, **kwargs) + return operations[ + AzureMLResourceType.BATCH_ENDPOINT + ].begin_create_or_update(entity, **kwargs) @_begin_create_or_update.register(OnlineDeployment) def _(entity: OnlineDeployment, operations, *args, **kwargs): module_logger.debug("Creating or updating online_deployments") - return operations[AzureMLResourceType.ONLINE_DEPLOYMENT].begin_create_or_update(entity, **kwargs) + return operations[ + AzureMLResourceType.ONLINE_DEPLOYMENT + ].begin_create_or_update(entity, **kwargs) @_begin_create_or_update.register(BatchDeployment) def _(entity: BatchDeployment, operations, *args, **kwargs): module_logger.debug("Creating or updating batch_deployments") - return operations[AzureMLResourceType.BATCH_DEPLOYMENT].begin_create_or_update(entity, **kwargs) + return operations[ + AzureMLResourceType.BATCH_DEPLOYMENT + ].begin_create_or_update(entity, **kwargs) @_begin_create_or_update.register(ModelBatchDeployment) def _(entity: ModelBatchDeployment, operations, *args, **kwargs): module_logger.debug("Creating or updating batch_deployments") - return operations[AzureMLResourceType.BATCH_DEPLOYMENT].begin_create_or_update(entity, **kwargs) + return operations[ + AzureMLResourceType.BATCH_DEPLOYMENT + ].begin_create_or_update(entity, **kwargs) @_begin_create_or_update.register(PipelineComponentBatchDeployment) def _(entity: PipelineComponentBatchDeployment, operations, *args, **kwargs): module_logger.debug("Creating or updating batch_deployments") - return operations[AzureMLResourceType.BATCH_DEPLOYMENT].begin_create_or_update(entity, **kwargs) + return operations[ + AzureMLResourceType.BATCH_DEPLOYMENT + ].begin_create_or_update(entity, **kwargs) @_begin_create_or_update.register(Schedule) def _(entity: Schedule, operations, *args, **kwargs): module_logger.debug("Creating or updating schedules") - return operations[AzureMLResourceType.SCHEDULE].begin_create_or_update(entity, **kwargs) + return operations[AzureMLResourceType.SCHEDULE].begin_create_or_update( + entity, **kwargs + ) @_begin_create_or_update.register(ServerlessEndpoint) def _(entity: ServerlessEndpoint, operations, *args, **kwargs): module_logger.debug("Creating or updating serverless endpoints") - return operations[AzureMLResourceType.SERVERLESS_ENDPOINT].begin_create_or_update(entity, **kwargs) + return operations[ + AzureMLResourceType.SERVERLESS_ENDPOINT + ].begin_create_or_update(entity, **kwargs) @_begin_create_or_update.register(MarketplaceSubscription) def _(entity: MarketplaceSubscription, operations, *args, **kwargs): module_logger.debug("Creating or updating marketplace subscriptions") - return operations[AzureMLResourceType.MARKETPLACE_SUBSCRIPTION].begin_create_or_update(entity, **kwargs) + return operations[ + AzureMLResourceType.MARKETPLACE_SUBSCRIPTION + ].begin_create_or_update(entity, **kwargs) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/__init__.py index dad2c6eeb01b..297e580c6cc8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/__init__.py @@ -7,10 +7,12 @@ # -------------------------------------------------------------------------- from ._azure_machine_learning_workspaces import AzureMachineLearningWorkspaces -__all__ = ['AzureMachineLearningWorkspaces'] + +__all__ = ["AzureMachineLearningWorkspaces"] try: from ._patch import patch_sdk # type: ignore + patch_sdk() except ImportError: pass diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/_azure_machine_learning_workspaces.py index c55fb6c432e9..fb71b5c1af71 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/_azure_machine_learning_workspaces.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/_azure_machine_learning_workspaces.py @@ -25,6 +25,7 @@ from azure.core.credentials import TokenCredential + class _SDKClient(object): def __init__(self, *args, **kwargs): """This is a fake class to support current implemetation of MultiApiClientMixin." @@ -32,6 +33,7 @@ def __init__(self, *args, **kwargs): """ pass + class AzureMachineLearningWorkspaces(MultiApiClientMixin, _SDKClient): """These APIs allow end users to operate on Azure Machine Learning Workspace resources. @@ -56,119 +58,143 @@ class AzureMachineLearningWorkspaces(MultiApiClientMixin, _SDKClient): :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ - DEFAULT_API_VERSION = '2022-10-01' - _PROFILE_TAG = "azure.mgmt.machinelearningservices.AzureMachineLearningWorkspaces" - LATEST_PROFILE = ProfileDefinition({ - _PROFILE_TAG: { - None: DEFAULT_API_VERSION, - 'assets': '1.0.0', - 'async_operations': 'v1.0', - 'batch_job_deployment': '2020-09-01-dataplanepreview', - 'batch_job_endpoint': '2020-09-01-dataplanepreview', - 'data_call': '1.5.0', - 'data_container': '1.5.0', - 'data_references': '2021-10-01-dataplanepreview', - 'data_version': '1.5.0', - 'dataset_containers': '2021-10-01', - 'dataset_controller_v2': '1.5.0', - 'dataset_v2': '1.5.0', - 'dataset_versions': '2021-10-01', - 'datasets_v1': '1.5.0', - 'delete': 'v1.0', - 'events': 'v1.0', - 'experiments': 'v1.0', - 'extensive_model': '1.0.0', - 'get_operation_status': '1.5.0', - 'metric': 'v1.0', - 'migration': '1.0.0', - 'models': '1.0.0', - 'registry_management_non_workspace': 'v1.0', - 'resource_management_asset_reference': '2021-10-01-dataplanepreview', - 'run': 'v1.0', - 'run_artifacts': 'v1.0', - 'runs': 'v1.0', - 'spans': 'v1.0', - 'temporary_data_references': '2021-10-01-dataplanepreview', - }}, - _PROFILE_TAG + " latest" + DEFAULT_API_VERSION = "2022-10-01" + _PROFILE_TAG = ( + "azure.mgmt.machinelearningservices.AzureMachineLearningWorkspaces" + ) + LATEST_PROFILE = ProfileDefinition( + { + _PROFILE_TAG: { + None: DEFAULT_API_VERSION, + "assets": "1.0.0", + "async_operations": "v1.0", + "batch_job_deployment": "2020-09-01-dataplanepreview", + "batch_job_endpoint": "2020-09-01-dataplanepreview", + "data_call": "1.5.0", + "data_container": "1.5.0", + "data_references": "2021-10-01-dataplanepreview", + "data_version": "1.5.0", + "dataset_containers": "2021-10-01", + "dataset_controller_v2": "1.5.0", + "dataset_v2": "1.5.0", + "dataset_versions": "2021-10-01", + "datasets_v1": "1.5.0", + "delete": "v1.0", + "events": "v1.0", + "experiments": "v1.0", + "extensive_model": "1.0.0", + "get_operation_status": "1.5.0", + "metric": "v1.0", + "migration": "1.0.0", + "models": "1.0.0", + "registry_management_non_workspace": "v1.0", + "resource_management_asset_reference": "2021-10-01-dataplanepreview", + "run": "v1.0", + "run_artifacts": "v1.0", + "runs": "v1.0", + "spans": "v1.0", + "temporary_data_references": "2021-10-01-dataplanepreview", + } + }, + _PROFILE_TAG + " latest", ) def __init__( self, credential, # type: "TokenCredential" subscription_id, # type: str - api_version=None, # type: Optional[str] + api_version=None, # type: Optional[str] base_url="https://management.azure.com", # type: str - profile=KnownProfiles.default, # type: KnownProfiles + profile=KnownProfiles.default, # type: KnownProfiles **kwargs # type: Any ): - self._config = AzureMachineLearningWorkspacesConfiguration(credential, subscription_id, **kwargs) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._config = AzureMachineLearningWorkspacesConfiguration( + credential, subscription_id, **kwargs + ) + self._client = ARMPipelineClient( + base_url=base_url, config=self._config, **kwargs + ) super(AzureMachineLearningWorkspaces, self).__init__( - api_version=api_version, - profile=profile + api_version=api_version, profile=profile ) @classmethod def _models_dict(cls, api_version): - return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)} + return { + k: v + for k, v in cls.models(api_version).__dict__.items() + if isinstance(v, type) + } @classmethod def models(cls, api_version=DEFAULT_API_VERSION): """Module depends on the API version: - * 1.5.0: :mod:`dataset_dataplane.models` - * 1.0.0: :mod:`model_dataplane.models` - * v1.0: :mod:`registry_discovery.models` - * v1.0: :mod:`runhistory.models` - * 2020-09-01-dataplanepreview: :mod:`v2020_09_01_dataplanepreview.models` - * 2021-10-01: :mod:`v2021_10_01.models` - * 2021-10-01-dataplanepreview: :mod:`v2021_10_01_dataplanepreview.models` - * 2022-01-01-preview: :mod:`v2022_01_01_preview.models` - * 2022-02-01-preview: :mod:`v2022_02_01_preview.models` - * 2022-05-01: :mod:`v2022_05_01.models` - * 2022-06-01-preview: :mod:`v2022_06_01_preview.models` - * 2022-10-01: :mod:`v2022_10_01.models` - * 2022-10-01-preview: :mod:`v2022_10_01_preview.models` - """ - if api_version == '1.5.0': + * 1.5.0: :mod:`dataset_dataplane.models` + * 1.0.0: :mod:`model_dataplane.models` + * v1.0: :mod:`registry_discovery.models` + * v1.0: :mod:`runhistory.models` + * 2020-09-01-dataplanepreview: :mod:`v2020_09_01_dataplanepreview.models` + * 2021-10-01: :mod:`v2021_10_01.models` + * 2021-10-01-dataplanepreview: :mod:`v2021_10_01_dataplanepreview.models` + * 2022-01-01-preview: :mod:`v2022_01_01_preview.models` + * 2022-02-01-preview: :mod:`v2022_02_01_preview.models` + * 2022-05-01: :mod:`v2022_05_01.models` + * 2022-06-01-preview: :mod:`v2022_06_01_preview.models` + * 2022-10-01: :mod:`v2022_10_01.models` + * 2022-10-01-preview: :mod:`v2022_10_01_preview.models` + """ + if api_version == "1.5.0": from .dataset_dataplane import models + return models - elif api_version == '1.0.0': + elif api_version == "1.0.0": from .model_dataplane import models + return models - elif api_version == 'v1.0': + elif api_version == "v1.0": from .registry_discovery import models + return models - elif api_version == 'v1.0': + elif api_version == "v1.0": from .runhistory import models + return models - elif api_version == '2020-09-01-dataplanepreview': + elif api_version == "2020-09-01-dataplanepreview": from .v2020_09_01_dataplanepreview import models + return models - elif api_version == '2021-10-01': + elif api_version == "2021-10-01": from .v2021_10_01 import models + return models - elif api_version == '2021-10-01-dataplanepreview': + elif api_version == "2021-10-01-dataplanepreview": from .v2021_10_01_dataplanepreview import models + return models - elif api_version == '2022-01-01-preview': + elif api_version == "2022-01-01-preview": from .v2022_01_01_preview import models + return models - elif api_version == '2022-02-01-preview': + elif api_version == "2022-02-01-preview": from .v2022_02_01_preview import models + return models - elif api_version == '2022-05-01': + elif api_version == "2022-05-01": from .v2022_05_01 import models + return models - elif api_version == '2022-06-01-preview': + elif api_version == "2022-06-01-preview": from .v2022_06_01_preview import models + return models - elif api_version == '2022-10-01': + elif api_version == "2022-10-01": from .v2022_10_01 import models + return models - elif api_version == '2022-10-01-preview': + elif api_version == "2022-10-01-preview": from .v2022_10_01_preview import models + return models raise ValueError("API version {} is not available".format(api_version)) @@ -176,1247 +202,2222 @@ def models(cls, api_version=DEFAULT_API_VERSION): def assets(self): """Instance depends on the API version: - * 1.0.0: :class:`AssetsOperations` - """ - api_version = self._get_api_version('assets') - if api_version == '1.0.0': - from .model_dataplane.operations import AssetsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'assets'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 1.0.0: :class:`AssetsOperations` + """ + api_version = self._get_api_version("assets") + if api_version == "1.0.0": + from .model_dataplane.operations import ( + AssetsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'assets'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def async_operations(self): """Instance depends on the API version: - * v1.0: :class:`AsyncOperationsOperations` - """ - api_version = self._get_api_version('async_operations') - if api_version == 'v1.0': - from .registry_discovery.operations import AsyncOperationsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'async_operations'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * v1.0: :class:`AsyncOperationsOperations` + """ + api_version = self._get_api_version("async_operations") + if api_version == "v1.0": + from .registry_discovery.operations import ( + AsyncOperationsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'async_operations'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def batch_deployments(self): """Instance depends on the API version: - * 2021-10-01: :class:`BatchDeploymentsOperations` - * 2022-02-01-preview: :class:`BatchDeploymentsOperations` - * 2022-05-01: :class:`BatchDeploymentsOperations` - * 2022-06-01-preview: :class:`BatchDeploymentsOperations` - * 2022-10-01: :class:`BatchDeploymentsOperations` - * 2022-10-01-preview: :class:`BatchDeploymentsOperations` - """ - api_version = self._get_api_version('batch_deployments') - if api_version == '2021-10-01': - from .v2021_10_01.operations import BatchDeploymentsOperations as OperationClass - elif api_version == '2022-02-01-preview': - from .v2022_02_01_preview.operations import BatchDeploymentsOperations as OperationClass - elif api_version == '2022-05-01': - from .v2022_05_01.operations import BatchDeploymentsOperations as OperationClass - elif api_version == '2022-06-01-preview': - from .v2022_06_01_preview.operations import BatchDeploymentsOperations as OperationClass - elif api_version == '2022-10-01': - from .v2022_10_01.operations import BatchDeploymentsOperations as OperationClass - elif api_version == '2022-10-01-preview': - from .v2022_10_01_preview.operations import BatchDeploymentsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'batch_deployments'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`BatchDeploymentsOperations` + * 2022-02-01-preview: :class:`BatchDeploymentsOperations` + * 2022-05-01: :class:`BatchDeploymentsOperations` + * 2022-06-01-preview: :class:`BatchDeploymentsOperations` + * 2022-10-01: :class:`BatchDeploymentsOperations` + * 2022-10-01-preview: :class:`BatchDeploymentsOperations` + """ + api_version = self._get_api_version("batch_deployments") + if api_version == "2021-10-01": + from .v2021_10_01.operations import ( + BatchDeploymentsOperations as OperationClass, + ) + elif api_version == "2022-02-01-preview": + from .v2022_02_01_preview.operations import ( + BatchDeploymentsOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from .v2022_05_01.operations import ( + BatchDeploymentsOperations as OperationClass, + ) + elif api_version == "2022-06-01-preview": + from .v2022_06_01_preview.operations import ( + BatchDeploymentsOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from .v2022_10_01.operations import ( + BatchDeploymentsOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from .v2022_10_01_preview.operations import ( + BatchDeploymentsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'batch_deployments'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def batch_endpoints(self): """Instance depends on the API version: - * 2021-10-01: :class:`BatchEndpointsOperations` - * 2022-02-01-preview: :class:`BatchEndpointsOperations` - * 2022-05-01: :class:`BatchEndpointsOperations` - * 2022-06-01-preview: :class:`BatchEndpointsOperations` - * 2022-10-01: :class:`BatchEndpointsOperations` - * 2022-10-01-preview: :class:`BatchEndpointsOperations` - """ - api_version = self._get_api_version('batch_endpoints') - if api_version == '2021-10-01': - from .v2021_10_01.operations import BatchEndpointsOperations as OperationClass - elif api_version == '2022-02-01-preview': - from .v2022_02_01_preview.operations import BatchEndpointsOperations as OperationClass - elif api_version == '2022-05-01': - from .v2022_05_01.operations import BatchEndpointsOperations as OperationClass - elif api_version == '2022-06-01-preview': - from .v2022_06_01_preview.operations import BatchEndpointsOperations as OperationClass - elif api_version == '2022-10-01': - from .v2022_10_01.operations import BatchEndpointsOperations as OperationClass - elif api_version == '2022-10-01-preview': - from .v2022_10_01_preview.operations import BatchEndpointsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'batch_endpoints'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`BatchEndpointsOperations` + * 2022-02-01-preview: :class:`BatchEndpointsOperations` + * 2022-05-01: :class:`BatchEndpointsOperations` + * 2022-06-01-preview: :class:`BatchEndpointsOperations` + * 2022-10-01: :class:`BatchEndpointsOperations` + * 2022-10-01-preview: :class:`BatchEndpointsOperations` + """ + api_version = self._get_api_version("batch_endpoints") + if api_version == "2021-10-01": + from .v2021_10_01.operations import ( + BatchEndpointsOperations as OperationClass, + ) + elif api_version == "2022-02-01-preview": + from .v2022_02_01_preview.operations import ( + BatchEndpointsOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from .v2022_05_01.operations import ( + BatchEndpointsOperations as OperationClass, + ) + elif api_version == "2022-06-01-preview": + from .v2022_06_01_preview.operations import ( + BatchEndpointsOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from .v2022_10_01.operations import ( + BatchEndpointsOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from .v2022_10_01_preview.operations import ( + BatchEndpointsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'batch_endpoints'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def batch_job_deployment(self): """Instance depends on the API version: - * 2020-09-01-dataplanepreview: :class:`BatchJobDeploymentOperations` - """ - api_version = self._get_api_version('batch_job_deployment') - if api_version == '2020-09-01-dataplanepreview': - from .v2020_09_01_dataplanepreview.operations import BatchJobDeploymentOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'batch_job_deployment'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2020-09-01-dataplanepreview: :class:`BatchJobDeploymentOperations` + """ + api_version = self._get_api_version("batch_job_deployment") + if api_version == "2020-09-01-dataplanepreview": + from .v2020_09_01_dataplanepreview.operations import ( + BatchJobDeploymentOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'batch_job_deployment'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def batch_job_endpoint(self): """Instance depends on the API version: - * 2020-09-01-dataplanepreview: :class:`BatchJobEndpointOperations` - """ - api_version = self._get_api_version('batch_job_endpoint') - if api_version == '2020-09-01-dataplanepreview': - from .v2020_09_01_dataplanepreview.operations import BatchJobEndpointOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'batch_job_endpoint'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2020-09-01-dataplanepreview: :class:`BatchJobEndpointOperations` + """ + api_version = self._get_api_version("batch_job_endpoint") + if api_version == "2020-09-01-dataplanepreview": + from .v2020_09_01_dataplanepreview.operations import ( + BatchJobEndpointOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'batch_job_endpoint'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def code_containers(self): """Instance depends on the API version: - * 2021-10-01: :class:`CodeContainersOperations` - * 2021-10-01-dataplanepreview: :class:`CodeContainersOperations` - * 2022-02-01-preview: :class:`CodeContainersOperations` - * 2022-05-01: :class:`CodeContainersOperations` - * 2022-06-01-preview: :class:`CodeContainersOperations` - * 2022-10-01: :class:`CodeContainersOperations` - * 2022-10-01-preview: :class:`CodeContainersOperations` - """ - api_version = self._get_api_version('code_containers') - if api_version == '2021-10-01': - from .v2021_10_01.operations import CodeContainersOperations as OperationClass - elif api_version == '2021-10-01-dataplanepreview': - from .v2021_10_01_dataplanepreview.operations import CodeContainersOperations as OperationClass - elif api_version == '2022-02-01-preview': - from .v2022_02_01_preview.operations import CodeContainersOperations as OperationClass - elif api_version == '2022-05-01': - from .v2022_05_01.operations import CodeContainersOperations as OperationClass - elif api_version == '2022-06-01-preview': - from .v2022_06_01_preview.operations import CodeContainersOperations as OperationClass - elif api_version == '2022-10-01': - from .v2022_10_01.operations import CodeContainersOperations as OperationClass - elif api_version == '2022-10-01-preview': - from .v2022_10_01_preview.operations import CodeContainersOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'code_containers'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`CodeContainersOperations` + * 2021-10-01-dataplanepreview: :class:`CodeContainersOperations` + * 2022-02-01-preview: :class:`CodeContainersOperations` + * 2022-05-01: :class:`CodeContainersOperations` + * 2022-06-01-preview: :class:`CodeContainersOperations` + * 2022-10-01: :class:`CodeContainersOperations` + * 2022-10-01-preview: :class:`CodeContainersOperations` + """ + api_version = self._get_api_version("code_containers") + if api_version == "2021-10-01": + from .v2021_10_01.operations import ( + CodeContainersOperations as OperationClass, + ) + elif api_version == "2021-10-01-dataplanepreview": + from .v2021_10_01_dataplanepreview.operations import ( + CodeContainersOperations as OperationClass, + ) + elif api_version == "2022-02-01-preview": + from .v2022_02_01_preview.operations import ( + CodeContainersOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from .v2022_05_01.operations import ( + CodeContainersOperations as OperationClass, + ) + elif api_version == "2022-06-01-preview": + from .v2022_06_01_preview.operations import ( + CodeContainersOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from .v2022_10_01.operations import ( + CodeContainersOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from .v2022_10_01_preview.operations import ( + CodeContainersOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'code_containers'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def code_versions(self): """Instance depends on the API version: - * 2021-10-01: :class:`CodeVersionsOperations` - * 2021-10-01-dataplanepreview: :class:`CodeVersionsOperations` - * 2022-02-01-preview: :class:`CodeVersionsOperations` - * 2022-05-01: :class:`CodeVersionsOperations` - * 2022-06-01-preview: :class:`CodeVersionsOperations` - * 2022-10-01: :class:`CodeVersionsOperations` - * 2022-10-01-preview: :class:`CodeVersionsOperations` - """ - api_version = self._get_api_version('code_versions') - if api_version == '2021-10-01': - from .v2021_10_01.operations import CodeVersionsOperations as OperationClass - elif api_version == '2021-10-01-dataplanepreview': - from .v2021_10_01_dataplanepreview.operations import CodeVersionsOperations as OperationClass - elif api_version == '2022-02-01-preview': - from .v2022_02_01_preview.operations import CodeVersionsOperations as OperationClass - elif api_version == '2022-05-01': - from .v2022_05_01.operations import CodeVersionsOperations as OperationClass - elif api_version == '2022-06-01-preview': - from .v2022_06_01_preview.operations import CodeVersionsOperations as OperationClass - elif api_version == '2022-10-01': - from .v2022_10_01.operations import CodeVersionsOperations as OperationClass - elif api_version == '2022-10-01-preview': - from .v2022_10_01_preview.operations import CodeVersionsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'code_versions'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`CodeVersionsOperations` + * 2021-10-01-dataplanepreview: :class:`CodeVersionsOperations` + * 2022-02-01-preview: :class:`CodeVersionsOperations` + * 2022-05-01: :class:`CodeVersionsOperations` + * 2022-06-01-preview: :class:`CodeVersionsOperations` + * 2022-10-01: :class:`CodeVersionsOperations` + * 2022-10-01-preview: :class:`CodeVersionsOperations` + """ + api_version = self._get_api_version("code_versions") + if api_version == "2021-10-01": + from .v2021_10_01.operations import ( + CodeVersionsOperations as OperationClass, + ) + elif api_version == "2021-10-01-dataplanepreview": + from .v2021_10_01_dataplanepreview.operations import ( + CodeVersionsOperations as OperationClass, + ) + elif api_version == "2022-02-01-preview": + from .v2022_02_01_preview.operations import ( + CodeVersionsOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from .v2022_05_01.operations import ( + CodeVersionsOperations as OperationClass, + ) + elif api_version == "2022-06-01-preview": + from .v2022_06_01_preview.operations import ( + CodeVersionsOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from .v2022_10_01.operations import ( + CodeVersionsOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from .v2022_10_01_preview.operations import ( + CodeVersionsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'code_versions'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def component_containers(self): """Instance depends on the API version: - * 2021-10-01: :class:`ComponentContainersOperations` - * 2021-10-01-dataplanepreview: :class:`ComponentContainersOperations` - * 2022-02-01-preview: :class:`ComponentContainersOperations` - * 2022-05-01: :class:`ComponentContainersOperations` - * 2022-06-01-preview: :class:`ComponentContainersOperations` - * 2022-10-01: :class:`ComponentContainersOperations` - * 2022-10-01-preview: :class:`ComponentContainersOperations` - """ - api_version = self._get_api_version('component_containers') - if api_version == '2021-10-01': - from .v2021_10_01.operations import ComponentContainersOperations as OperationClass - elif api_version == '2021-10-01-dataplanepreview': - from .v2021_10_01_dataplanepreview.operations import ComponentContainersOperations as OperationClass - elif api_version == '2022-02-01-preview': - from .v2022_02_01_preview.operations import ComponentContainersOperations as OperationClass - elif api_version == '2022-05-01': - from .v2022_05_01.operations import ComponentContainersOperations as OperationClass - elif api_version == '2022-06-01-preview': - from .v2022_06_01_preview.operations import ComponentContainersOperations as OperationClass - elif api_version == '2022-10-01': - from .v2022_10_01.operations import ComponentContainersOperations as OperationClass - elif api_version == '2022-10-01-preview': - from .v2022_10_01_preview.operations import ComponentContainersOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'component_containers'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`ComponentContainersOperations` + * 2021-10-01-dataplanepreview: :class:`ComponentContainersOperations` + * 2022-02-01-preview: :class:`ComponentContainersOperations` + * 2022-05-01: :class:`ComponentContainersOperations` + * 2022-06-01-preview: :class:`ComponentContainersOperations` + * 2022-10-01: :class:`ComponentContainersOperations` + * 2022-10-01-preview: :class:`ComponentContainersOperations` + """ + api_version = self._get_api_version("component_containers") + if api_version == "2021-10-01": + from .v2021_10_01.operations import ( + ComponentContainersOperations as OperationClass, + ) + elif api_version == "2021-10-01-dataplanepreview": + from .v2021_10_01_dataplanepreview.operations import ( + ComponentContainersOperations as OperationClass, + ) + elif api_version == "2022-02-01-preview": + from .v2022_02_01_preview.operations import ( + ComponentContainersOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from .v2022_05_01.operations import ( + ComponentContainersOperations as OperationClass, + ) + elif api_version == "2022-06-01-preview": + from .v2022_06_01_preview.operations import ( + ComponentContainersOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from .v2022_10_01.operations import ( + ComponentContainersOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from .v2022_10_01_preview.operations import ( + ComponentContainersOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'component_containers'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def component_versions(self): """Instance depends on the API version: - * 2021-10-01: :class:`ComponentVersionsOperations` - * 2021-10-01-dataplanepreview: :class:`ComponentVersionsOperations` - * 2022-02-01-preview: :class:`ComponentVersionsOperations` - * 2022-05-01: :class:`ComponentVersionsOperations` - * 2022-06-01-preview: :class:`ComponentVersionsOperations` - * 2022-10-01: :class:`ComponentVersionsOperations` - * 2022-10-01-preview: :class:`ComponentVersionsOperations` - """ - api_version = self._get_api_version('component_versions') - if api_version == '2021-10-01': - from .v2021_10_01.operations import ComponentVersionsOperations as OperationClass - elif api_version == '2021-10-01-dataplanepreview': - from .v2021_10_01_dataplanepreview.operations import ComponentVersionsOperations as OperationClass - elif api_version == '2022-02-01-preview': - from .v2022_02_01_preview.operations import ComponentVersionsOperations as OperationClass - elif api_version == '2022-05-01': - from .v2022_05_01.operations import ComponentVersionsOperations as OperationClass - elif api_version == '2022-06-01-preview': - from .v2022_06_01_preview.operations import ComponentVersionsOperations as OperationClass - elif api_version == '2022-10-01': - from .v2022_10_01.operations import ComponentVersionsOperations as OperationClass - elif api_version == '2022-10-01-preview': - from .v2022_10_01_preview.operations import ComponentVersionsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'component_versions'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`ComponentVersionsOperations` + * 2021-10-01-dataplanepreview: :class:`ComponentVersionsOperations` + * 2022-02-01-preview: :class:`ComponentVersionsOperations` + * 2022-05-01: :class:`ComponentVersionsOperations` + * 2022-06-01-preview: :class:`ComponentVersionsOperations` + * 2022-10-01: :class:`ComponentVersionsOperations` + * 2022-10-01-preview: :class:`ComponentVersionsOperations` + """ + api_version = self._get_api_version("component_versions") + if api_version == "2021-10-01": + from .v2021_10_01.operations import ( + ComponentVersionsOperations as OperationClass, + ) + elif api_version == "2021-10-01-dataplanepreview": + from .v2021_10_01_dataplanepreview.operations import ( + ComponentVersionsOperations as OperationClass, + ) + elif api_version == "2022-02-01-preview": + from .v2022_02_01_preview.operations import ( + ComponentVersionsOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from .v2022_05_01.operations import ( + ComponentVersionsOperations as OperationClass, + ) + elif api_version == "2022-06-01-preview": + from .v2022_06_01_preview.operations import ( + ComponentVersionsOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from .v2022_10_01.operations import ( + ComponentVersionsOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from .v2022_10_01_preview.operations import ( + ComponentVersionsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'component_versions'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def compute(self): """Instance depends on the API version: - * 2021-10-01: :class:`ComputeOperations` - * 2022-01-01-preview: :class:`ComputeOperations` - * 2022-05-01: :class:`ComputeOperations` - * 2022-10-01: :class:`ComputeOperations` - * 2022-10-01-preview: :class:`ComputeOperations` - """ - api_version = self._get_api_version('compute') - if api_version == '2021-10-01': - from .v2021_10_01.operations import ComputeOperations as OperationClass - elif api_version == '2022-01-01-preview': - from .v2022_01_01_preview.operations import ComputeOperations as OperationClass - elif api_version == '2022-05-01': - from .v2022_05_01.operations import ComputeOperations as OperationClass - elif api_version == '2022-10-01': - from .v2022_10_01.operations import ComputeOperations as OperationClass - elif api_version == '2022-10-01-preview': - from .v2022_10_01_preview.operations import ComputeOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'compute'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`ComputeOperations` + * 2022-01-01-preview: :class:`ComputeOperations` + * 2022-05-01: :class:`ComputeOperations` + * 2022-10-01: :class:`ComputeOperations` + * 2022-10-01-preview: :class:`ComputeOperations` + """ + api_version = self._get_api_version("compute") + if api_version == "2021-10-01": + from .v2021_10_01.operations import ( + ComputeOperations as OperationClass, + ) + elif api_version == "2022-01-01-preview": + from .v2022_01_01_preview.operations import ( + ComputeOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from .v2022_05_01.operations import ( + ComputeOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from .v2022_10_01.operations import ( + ComputeOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from .v2022_10_01_preview.operations import ( + ComputeOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'compute'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def data_call(self): """Instance depends on the API version: - * 1.5.0: :class:`DataCallOperations` - """ - api_version = self._get_api_version('data_call') - if api_version == '1.5.0': - from .dataset_dataplane.operations import DataCallOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'data_call'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 1.5.0: :class:`DataCallOperations` + """ + api_version = self._get_api_version("data_call") + if api_version == "1.5.0": + from .dataset_dataplane.operations import ( + DataCallOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'data_call'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def data_container(self): """Instance depends on the API version: - * 1.5.0: :class:`DataContainerOperations` - """ - api_version = self._get_api_version('data_container') - if api_version == '1.5.0': - from .dataset_dataplane.operations import DataContainerOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'data_container'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 1.5.0: :class:`DataContainerOperations` + """ + api_version = self._get_api_version("data_container") + if api_version == "1.5.0": + from .dataset_dataplane.operations import ( + DataContainerOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'data_container'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def data_containers(self): """Instance depends on the API version: - * 2021-10-01-dataplanepreview: :class:`DataContainersOperations` - * 2022-02-01-preview: :class:`DataContainersOperations` - * 2022-05-01: :class:`DataContainersOperations` - * 2022-06-01-preview: :class:`DataContainersOperations` - * 2022-10-01: :class:`DataContainersOperations` - * 2022-10-01-preview: :class:`DataContainersOperations` - """ - api_version = self._get_api_version('data_containers') - if api_version == '2021-10-01-dataplanepreview': - from .v2021_10_01_dataplanepreview.operations import DataContainersOperations as OperationClass - elif api_version == '2022-02-01-preview': - from .v2022_02_01_preview.operations import DataContainersOperations as OperationClass - elif api_version == '2022-05-01': - from .v2022_05_01.operations import DataContainersOperations as OperationClass - elif api_version == '2022-06-01-preview': - from .v2022_06_01_preview.operations import DataContainersOperations as OperationClass - elif api_version == '2022-10-01': - from .v2022_10_01.operations import DataContainersOperations as OperationClass - elif api_version == '2022-10-01-preview': - from .v2022_10_01_preview.operations import DataContainersOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'data_containers'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01-dataplanepreview: :class:`DataContainersOperations` + * 2022-02-01-preview: :class:`DataContainersOperations` + * 2022-05-01: :class:`DataContainersOperations` + * 2022-06-01-preview: :class:`DataContainersOperations` + * 2022-10-01: :class:`DataContainersOperations` + * 2022-10-01-preview: :class:`DataContainersOperations` + """ + api_version = self._get_api_version("data_containers") + if api_version == "2021-10-01-dataplanepreview": + from .v2021_10_01_dataplanepreview.operations import ( + DataContainersOperations as OperationClass, + ) + elif api_version == "2022-02-01-preview": + from .v2022_02_01_preview.operations import ( + DataContainersOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from .v2022_05_01.operations import ( + DataContainersOperations as OperationClass, + ) + elif api_version == "2022-06-01-preview": + from .v2022_06_01_preview.operations import ( + DataContainersOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from .v2022_10_01.operations import ( + DataContainersOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from .v2022_10_01_preview.operations import ( + DataContainersOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'data_containers'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def data_references(self): """Instance depends on the API version: - * 2021-10-01-dataplanepreview: :class:`DataReferencesOperations` - """ - api_version = self._get_api_version('data_references') - if api_version == '2021-10-01-dataplanepreview': - from .v2021_10_01_dataplanepreview.operations import DataReferencesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'data_references'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01-dataplanepreview: :class:`DataReferencesOperations` + """ + api_version = self._get_api_version("data_references") + if api_version == "2021-10-01-dataplanepreview": + from .v2021_10_01_dataplanepreview.operations import ( + DataReferencesOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'data_references'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def data_version(self): """Instance depends on the API version: - * 1.5.0: :class:`DataVersionOperations` - """ - api_version = self._get_api_version('data_version') - if api_version == '1.5.0': - from .dataset_dataplane.operations import DataVersionOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'data_version'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 1.5.0: :class:`DataVersionOperations` + """ + api_version = self._get_api_version("data_version") + if api_version == "1.5.0": + from .dataset_dataplane.operations import ( + DataVersionOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'data_version'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def data_versions(self): """Instance depends on the API version: - * 2021-10-01-dataplanepreview: :class:`DataVersionsOperations` - * 2022-02-01-preview: :class:`DataVersionsOperations` - * 2022-05-01: :class:`DataVersionsOperations` - * 2022-06-01-preview: :class:`DataVersionsOperations` - * 2022-10-01: :class:`DataVersionsOperations` - * 2022-10-01-preview: :class:`DataVersionsOperations` - """ - api_version = self._get_api_version('data_versions') - if api_version == '2021-10-01-dataplanepreview': - from .v2021_10_01_dataplanepreview.operations import DataVersionsOperations as OperationClass - elif api_version == '2022-02-01-preview': - from .v2022_02_01_preview.operations import DataVersionsOperations as OperationClass - elif api_version == '2022-05-01': - from .v2022_05_01.operations import DataVersionsOperations as OperationClass - elif api_version == '2022-06-01-preview': - from .v2022_06_01_preview.operations import DataVersionsOperations as OperationClass - elif api_version == '2022-10-01': - from .v2022_10_01.operations import DataVersionsOperations as OperationClass - elif api_version == '2022-10-01-preview': - from .v2022_10_01_preview.operations import DataVersionsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'data_versions'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01-dataplanepreview: :class:`DataVersionsOperations` + * 2022-02-01-preview: :class:`DataVersionsOperations` + * 2022-05-01: :class:`DataVersionsOperations` + * 2022-06-01-preview: :class:`DataVersionsOperations` + * 2022-10-01: :class:`DataVersionsOperations` + * 2022-10-01-preview: :class:`DataVersionsOperations` + """ + api_version = self._get_api_version("data_versions") + if api_version == "2021-10-01-dataplanepreview": + from .v2021_10_01_dataplanepreview.operations import ( + DataVersionsOperations as OperationClass, + ) + elif api_version == "2022-02-01-preview": + from .v2022_02_01_preview.operations import ( + DataVersionsOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from .v2022_05_01.operations import ( + DataVersionsOperations as OperationClass, + ) + elif api_version == "2022-06-01-preview": + from .v2022_06_01_preview.operations import ( + DataVersionsOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from .v2022_10_01.operations import ( + DataVersionsOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from .v2022_10_01_preview.operations import ( + DataVersionsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'data_versions'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def dataset_containers(self): """Instance depends on the API version: - * 2021-10-01: :class:`DatasetContainersOperations` - """ - api_version = self._get_api_version('dataset_containers') - if api_version == '2021-10-01': - from .v2021_10_01.operations import DatasetContainersOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'dataset_containers'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`DatasetContainersOperations` + """ + api_version = self._get_api_version("dataset_containers") + if api_version == "2021-10-01": + from .v2021_10_01.operations import ( + DatasetContainersOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'dataset_containers'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def dataset_controller_v2(self): """Instance depends on the API version: - * 1.5.0: :class:`DatasetControllerV2Operations` - """ - api_version = self._get_api_version('dataset_controller_v2') - if api_version == '1.5.0': - from .dataset_dataplane.operations import DatasetControllerV2Operations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'dataset_controller_v2'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 1.5.0: :class:`DatasetControllerV2Operations` + """ + api_version = self._get_api_version("dataset_controller_v2") + if api_version == "1.5.0": + from .dataset_dataplane.operations import ( + DatasetControllerV2Operations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'dataset_controller_v2'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def dataset_v2(self): """Instance depends on the API version: - * 1.5.0: :class:`DatasetV2Operations` - """ - api_version = self._get_api_version('dataset_v2') - if api_version == '1.5.0': - from .dataset_dataplane.operations import DatasetV2Operations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'dataset_v2'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 1.5.0: :class:`DatasetV2Operations` + """ + api_version = self._get_api_version("dataset_v2") + if api_version == "1.5.0": + from .dataset_dataplane.operations import ( + DatasetV2Operations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'dataset_v2'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def dataset_versions(self): """Instance depends on the API version: - * 2021-10-01: :class:`DatasetVersionsOperations` - """ - api_version = self._get_api_version('dataset_versions') - if api_version == '2021-10-01': - from .v2021_10_01.operations import DatasetVersionsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'dataset_versions'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`DatasetVersionsOperations` + """ + api_version = self._get_api_version("dataset_versions") + if api_version == "2021-10-01": + from .v2021_10_01.operations import ( + DatasetVersionsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'dataset_versions'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def datasets_v1(self): """Instance depends on the API version: - * 1.5.0: :class:`DatasetsV1Operations` - """ - api_version = self._get_api_version('datasets_v1') - if api_version == '1.5.0': - from .dataset_dataplane.operations import DatasetsV1Operations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'datasets_v1'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 1.5.0: :class:`DatasetsV1Operations` + """ + api_version = self._get_api_version("datasets_v1") + if api_version == "1.5.0": + from .dataset_dataplane.operations import ( + DatasetsV1Operations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'datasets_v1'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def datastores(self): """Instance depends on the API version: - * 2021-10-01: :class:`DatastoresOperations` - * 2022-02-01-preview: :class:`DatastoresOperations` - * 2022-05-01: :class:`DatastoresOperations` - * 2022-06-01-preview: :class:`DatastoresOperations` - * 2022-10-01: :class:`DatastoresOperations` - * 2022-10-01-preview: :class:`DatastoresOperations` - """ - api_version = self._get_api_version('datastores') - if api_version == '2021-10-01': - from .v2021_10_01.operations import DatastoresOperations as OperationClass - elif api_version == '2022-02-01-preview': - from .v2022_02_01_preview.operations import DatastoresOperations as OperationClass - elif api_version == '2022-05-01': - from .v2022_05_01.operations import DatastoresOperations as OperationClass - elif api_version == '2022-06-01-preview': - from .v2022_06_01_preview.operations import DatastoresOperations as OperationClass - elif api_version == '2022-10-01': - from .v2022_10_01.operations import DatastoresOperations as OperationClass - elif api_version == '2022-10-01-preview': - from .v2022_10_01_preview.operations import DatastoresOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'datastores'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`DatastoresOperations` + * 2022-02-01-preview: :class:`DatastoresOperations` + * 2022-05-01: :class:`DatastoresOperations` + * 2022-06-01-preview: :class:`DatastoresOperations` + * 2022-10-01: :class:`DatastoresOperations` + * 2022-10-01-preview: :class:`DatastoresOperations` + """ + api_version = self._get_api_version("datastores") + if api_version == "2021-10-01": + from .v2021_10_01.operations import ( + DatastoresOperations as OperationClass, + ) + elif api_version == "2022-02-01-preview": + from .v2022_02_01_preview.operations import ( + DatastoresOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from .v2022_05_01.operations import ( + DatastoresOperations as OperationClass, + ) + elif api_version == "2022-06-01-preview": + from .v2022_06_01_preview.operations import ( + DatastoresOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from .v2022_10_01.operations import ( + DatastoresOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from .v2022_10_01_preview.operations import ( + DatastoresOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'datastores'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def delete(self): """Instance depends on the API version: - * 1.5.0: :class:`DeleteOperations` - * v1.0: :class:`DeleteOperations` - """ - api_version = self._get_api_version('delete') - if api_version == '1.5.0': - from .dataset_dataplane.operations import DeleteOperations as OperationClass - elif api_version == 'v1.0': - from .runhistory.operations import DeleteOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'delete'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 1.5.0: :class:`DeleteOperations` + * v1.0: :class:`DeleteOperations` + """ + api_version = self._get_api_version("delete") + if api_version == "1.5.0": + from .dataset_dataplane.operations import ( + DeleteOperations as OperationClass, + ) + elif api_version == "v1.0": + from .runhistory.operations import ( + DeleteOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'delete'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def environment_containers(self): """Instance depends on the API version: - * 2021-10-01: :class:`EnvironmentContainersOperations` - * 2021-10-01-dataplanepreview: :class:`EnvironmentContainersOperations` - * 2022-02-01-preview: :class:`EnvironmentContainersOperations` - * 2022-05-01: :class:`EnvironmentContainersOperations` - * 2022-06-01-preview: :class:`EnvironmentContainersOperations` - * 2022-10-01: :class:`EnvironmentContainersOperations` - * 2022-10-01-preview: :class:`EnvironmentContainersOperations` - """ - api_version = self._get_api_version('environment_containers') - if api_version == '2021-10-01': - from .v2021_10_01.operations import EnvironmentContainersOperations as OperationClass - elif api_version == '2021-10-01-dataplanepreview': - from .v2021_10_01_dataplanepreview.operations import EnvironmentContainersOperations as OperationClass - elif api_version == '2022-02-01-preview': - from .v2022_02_01_preview.operations import EnvironmentContainersOperations as OperationClass - elif api_version == '2022-05-01': - from .v2022_05_01.operations import EnvironmentContainersOperations as OperationClass - elif api_version == '2022-06-01-preview': - from .v2022_06_01_preview.operations import EnvironmentContainersOperations as OperationClass - elif api_version == '2022-10-01': - from .v2022_10_01.operations import EnvironmentContainersOperations as OperationClass - elif api_version == '2022-10-01-preview': - from .v2022_10_01_preview.operations import EnvironmentContainersOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'environment_containers'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`EnvironmentContainersOperations` + * 2021-10-01-dataplanepreview: :class:`EnvironmentContainersOperations` + * 2022-02-01-preview: :class:`EnvironmentContainersOperations` + * 2022-05-01: :class:`EnvironmentContainersOperations` + * 2022-06-01-preview: :class:`EnvironmentContainersOperations` + * 2022-10-01: :class:`EnvironmentContainersOperations` + * 2022-10-01-preview: :class:`EnvironmentContainersOperations` + """ + api_version = self._get_api_version("environment_containers") + if api_version == "2021-10-01": + from .v2021_10_01.operations import ( + EnvironmentContainersOperations as OperationClass, + ) + elif api_version == "2021-10-01-dataplanepreview": + from .v2021_10_01_dataplanepreview.operations import ( + EnvironmentContainersOperations as OperationClass, + ) + elif api_version == "2022-02-01-preview": + from .v2022_02_01_preview.operations import ( + EnvironmentContainersOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from .v2022_05_01.operations import ( + EnvironmentContainersOperations as OperationClass, + ) + elif api_version == "2022-06-01-preview": + from .v2022_06_01_preview.operations import ( + EnvironmentContainersOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from .v2022_10_01.operations import ( + EnvironmentContainersOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from .v2022_10_01_preview.operations import ( + EnvironmentContainersOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'environment_containers'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def environment_versions(self): """Instance depends on the API version: - * 2021-10-01: :class:`EnvironmentVersionsOperations` - * 2021-10-01-dataplanepreview: :class:`EnvironmentVersionsOperations` - * 2022-02-01-preview: :class:`EnvironmentVersionsOperations` - * 2022-05-01: :class:`EnvironmentVersionsOperations` - * 2022-06-01-preview: :class:`EnvironmentVersionsOperations` - * 2022-10-01: :class:`EnvironmentVersionsOperations` - * 2022-10-01-preview: :class:`EnvironmentVersionsOperations` - """ - api_version = self._get_api_version('environment_versions') - if api_version == '2021-10-01': - from .v2021_10_01.operations import EnvironmentVersionsOperations as OperationClass - elif api_version == '2021-10-01-dataplanepreview': - from .v2021_10_01_dataplanepreview.operations import EnvironmentVersionsOperations as OperationClass - elif api_version == '2022-02-01-preview': - from .v2022_02_01_preview.operations import EnvironmentVersionsOperations as OperationClass - elif api_version == '2022-05-01': - from .v2022_05_01.operations import EnvironmentVersionsOperations as OperationClass - elif api_version == '2022-06-01-preview': - from .v2022_06_01_preview.operations import EnvironmentVersionsOperations as OperationClass - elif api_version == '2022-10-01': - from .v2022_10_01.operations import EnvironmentVersionsOperations as OperationClass - elif api_version == '2022-10-01-preview': - from .v2022_10_01_preview.operations import EnvironmentVersionsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'environment_versions'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`EnvironmentVersionsOperations` + * 2021-10-01-dataplanepreview: :class:`EnvironmentVersionsOperations` + * 2022-02-01-preview: :class:`EnvironmentVersionsOperations` + * 2022-05-01: :class:`EnvironmentVersionsOperations` + * 2022-06-01-preview: :class:`EnvironmentVersionsOperations` + * 2022-10-01: :class:`EnvironmentVersionsOperations` + * 2022-10-01-preview: :class:`EnvironmentVersionsOperations` + """ + api_version = self._get_api_version("environment_versions") + if api_version == "2021-10-01": + from .v2021_10_01.operations import ( + EnvironmentVersionsOperations as OperationClass, + ) + elif api_version == "2021-10-01-dataplanepreview": + from .v2021_10_01_dataplanepreview.operations import ( + EnvironmentVersionsOperations as OperationClass, + ) + elif api_version == "2022-02-01-preview": + from .v2022_02_01_preview.operations import ( + EnvironmentVersionsOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from .v2022_05_01.operations import ( + EnvironmentVersionsOperations as OperationClass, + ) + elif api_version == "2022-06-01-preview": + from .v2022_06_01_preview.operations import ( + EnvironmentVersionsOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from .v2022_10_01.operations import ( + EnvironmentVersionsOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from .v2022_10_01_preview.operations import ( + EnvironmentVersionsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'environment_versions'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def events(self): """Instance depends on the API version: - * v1.0: :class:`EventsOperations` - """ - api_version = self._get_api_version('events') - if api_version == 'v1.0': - from .runhistory.operations import EventsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'events'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * v1.0: :class:`EventsOperations` + """ + api_version = self._get_api_version("events") + if api_version == "v1.0": + from .runhistory.operations import ( + EventsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'events'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def experiments(self): """Instance depends on the API version: - * v1.0: :class:`ExperimentsOperations` - """ - api_version = self._get_api_version('experiments') - if api_version == 'v1.0': - from .runhistory.operations import ExperimentsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'experiments'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * v1.0: :class:`ExperimentsOperations` + """ + api_version = self._get_api_version("experiments") + if api_version == "v1.0": + from .runhistory.operations import ( + ExperimentsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'experiments'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def extensive_model(self): """Instance depends on the API version: - * 1.0.0: :class:`ExtensiveModelOperations` - """ - api_version = self._get_api_version('extensive_model') - if api_version == '1.0.0': - from .model_dataplane.operations import ExtensiveModelOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'extensive_model'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 1.0.0: :class:`ExtensiveModelOperations` + """ + api_version = self._get_api_version("extensive_model") + if api_version == "1.0.0": + from .model_dataplane.operations import ( + ExtensiveModelOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'extensive_model'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def get_operation_status(self): """Instance depends on the API version: - * 1.5.0: :class:`GetOperationStatusOperations` - """ - api_version = self._get_api_version('get_operation_status') - if api_version == '1.5.0': - from .dataset_dataplane.operations import GetOperationStatusOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'get_operation_status'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 1.5.0: :class:`GetOperationStatusOperations` + """ + api_version = self._get_api_version("get_operation_status") + if api_version == "1.5.0": + from .dataset_dataplane.operations import ( + GetOperationStatusOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'get_operation_status'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def jobs(self): """Instance depends on the API version: - * 2021-10-01: :class:`JobsOperations` - * 2022-02-01-preview: :class:`JobsOperations` - * 2022-05-01: :class:`JobsOperations` - * 2022-06-01-preview: :class:`JobsOperations` - * 2022-10-01: :class:`JobsOperations` - * 2022-10-01-preview: :class:`JobsOperations` - """ - api_version = self._get_api_version('jobs') - if api_version == '2021-10-01': - from .v2021_10_01.operations import JobsOperations as OperationClass - elif api_version == '2022-02-01-preview': - from .v2022_02_01_preview.operations import JobsOperations as OperationClass - elif api_version == '2022-05-01': - from .v2022_05_01.operations import JobsOperations as OperationClass - elif api_version == '2022-06-01-preview': - from .v2022_06_01_preview.operations import JobsOperations as OperationClass - elif api_version == '2022-10-01': - from .v2022_10_01.operations import JobsOperations as OperationClass - elif api_version == '2022-10-01-preview': - from .v2022_10_01_preview.operations import JobsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'jobs'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`JobsOperations` + * 2022-02-01-preview: :class:`JobsOperations` + * 2022-05-01: :class:`JobsOperations` + * 2022-06-01-preview: :class:`JobsOperations` + * 2022-10-01: :class:`JobsOperations` + * 2022-10-01-preview: :class:`JobsOperations` + """ + api_version = self._get_api_version("jobs") + if api_version == "2021-10-01": + from .v2021_10_01.operations import ( + JobsOperations as OperationClass, + ) + elif api_version == "2022-02-01-preview": + from .v2022_02_01_preview.operations import ( + JobsOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from .v2022_05_01.operations import ( + JobsOperations as OperationClass, + ) + elif api_version == "2022-06-01-preview": + from .v2022_06_01_preview.operations import ( + JobsOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from .v2022_10_01.operations import ( + JobsOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from .v2022_10_01_preview.operations import ( + JobsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'jobs'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def labeling_jobs(self): """Instance depends on the API version: - * 2022-06-01-preview: :class:`LabelingJobsOperations` - * 2022-10-01-preview: :class:`LabelingJobsOperations` - """ - api_version = self._get_api_version('labeling_jobs') - if api_version == '2022-06-01-preview': - from .v2022_06_01_preview.operations import LabelingJobsOperations as OperationClass - elif api_version == '2022-10-01-preview': - from .v2022_10_01_preview.operations import LabelingJobsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'labeling_jobs'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2022-06-01-preview: :class:`LabelingJobsOperations` + * 2022-10-01-preview: :class:`LabelingJobsOperations` + """ + api_version = self._get_api_version("labeling_jobs") + if api_version == "2022-06-01-preview": + from .v2022_06_01_preview.operations import ( + LabelingJobsOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from .v2022_10_01_preview.operations import ( + LabelingJobsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'labeling_jobs'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def metric(self): """Instance depends on the API version: - * v1.0: :class:`MetricOperations` - """ - api_version = self._get_api_version('metric') - if api_version == 'v1.0': - from .runhistory.operations import MetricOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'metric'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * v1.0: :class:`MetricOperations` + """ + api_version = self._get_api_version("metric") + if api_version == "v1.0": + from .runhistory.operations import ( + MetricOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'metric'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def migration(self): """Instance depends on the API version: - * 1.0.0: :class:`MigrationOperations` - """ - api_version = self._get_api_version('migration') - if api_version == '1.0.0': - from .model_dataplane.operations import MigrationOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'migration'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 1.0.0: :class:`MigrationOperations` + """ + api_version = self._get_api_version("migration") + if api_version == "1.0.0": + from .model_dataplane.operations import ( + MigrationOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'migration'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def model_containers(self): """Instance depends on the API version: - * 2021-10-01: :class:`ModelContainersOperations` - * 2021-10-01-dataplanepreview: :class:`ModelContainersOperations` - * 2022-02-01-preview: :class:`ModelContainersOperations` - * 2022-05-01: :class:`ModelContainersOperations` - * 2022-06-01-preview: :class:`ModelContainersOperations` - * 2022-10-01: :class:`ModelContainersOperations` - * 2022-10-01-preview: :class:`ModelContainersOperations` - """ - api_version = self._get_api_version('model_containers') - if api_version == '2021-10-01': - from .v2021_10_01.operations import ModelContainersOperations as OperationClass - elif api_version == '2021-10-01-dataplanepreview': - from .v2021_10_01_dataplanepreview.operations import ModelContainersOperations as OperationClass - elif api_version == '2022-02-01-preview': - from .v2022_02_01_preview.operations import ModelContainersOperations as OperationClass - elif api_version == '2022-05-01': - from .v2022_05_01.operations import ModelContainersOperations as OperationClass - elif api_version == '2022-06-01-preview': - from .v2022_06_01_preview.operations import ModelContainersOperations as OperationClass - elif api_version == '2022-10-01': - from .v2022_10_01.operations import ModelContainersOperations as OperationClass - elif api_version == '2022-10-01-preview': - from .v2022_10_01_preview.operations import ModelContainersOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'model_containers'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`ModelContainersOperations` + * 2021-10-01-dataplanepreview: :class:`ModelContainersOperations` + * 2022-02-01-preview: :class:`ModelContainersOperations` + * 2022-05-01: :class:`ModelContainersOperations` + * 2022-06-01-preview: :class:`ModelContainersOperations` + * 2022-10-01: :class:`ModelContainersOperations` + * 2022-10-01-preview: :class:`ModelContainersOperations` + """ + api_version = self._get_api_version("model_containers") + if api_version == "2021-10-01": + from .v2021_10_01.operations import ( + ModelContainersOperations as OperationClass, + ) + elif api_version == "2021-10-01-dataplanepreview": + from .v2021_10_01_dataplanepreview.operations import ( + ModelContainersOperations as OperationClass, + ) + elif api_version == "2022-02-01-preview": + from .v2022_02_01_preview.operations import ( + ModelContainersOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from .v2022_05_01.operations import ( + ModelContainersOperations as OperationClass, + ) + elif api_version == "2022-06-01-preview": + from .v2022_06_01_preview.operations import ( + ModelContainersOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from .v2022_10_01.operations import ( + ModelContainersOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from .v2022_10_01_preview.operations import ( + ModelContainersOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'model_containers'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def model_versions(self): """Instance depends on the API version: - * 2021-10-01: :class:`ModelVersionsOperations` - * 2021-10-01-dataplanepreview: :class:`ModelVersionsOperations` - * 2022-02-01-preview: :class:`ModelVersionsOperations` - * 2022-05-01: :class:`ModelVersionsOperations` - * 2022-06-01-preview: :class:`ModelVersionsOperations` - * 2022-10-01: :class:`ModelVersionsOperations` - * 2022-10-01-preview: :class:`ModelVersionsOperations` - """ - api_version = self._get_api_version('model_versions') - if api_version == '2021-10-01': - from .v2021_10_01.operations import ModelVersionsOperations as OperationClass - elif api_version == '2021-10-01-dataplanepreview': - from .v2021_10_01_dataplanepreview.operations import ModelVersionsOperations as OperationClass - elif api_version == '2022-02-01-preview': - from .v2022_02_01_preview.operations import ModelVersionsOperations as OperationClass - elif api_version == '2022-05-01': - from .v2022_05_01.operations import ModelVersionsOperations as OperationClass - elif api_version == '2022-06-01-preview': - from .v2022_06_01_preview.operations import ModelVersionsOperations as OperationClass - elif api_version == '2022-10-01': - from .v2022_10_01.operations import ModelVersionsOperations as OperationClass - elif api_version == '2022-10-01-preview': - from .v2022_10_01_preview.operations import ModelVersionsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'model_versions'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`ModelVersionsOperations` + * 2021-10-01-dataplanepreview: :class:`ModelVersionsOperations` + * 2022-02-01-preview: :class:`ModelVersionsOperations` + * 2022-05-01: :class:`ModelVersionsOperations` + * 2022-06-01-preview: :class:`ModelVersionsOperations` + * 2022-10-01: :class:`ModelVersionsOperations` + * 2022-10-01-preview: :class:`ModelVersionsOperations` + """ + api_version = self._get_api_version("model_versions") + if api_version == "2021-10-01": + from .v2021_10_01.operations import ( + ModelVersionsOperations as OperationClass, + ) + elif api_version == "2021-10-01-dataplanepreview": + from .v2021_10_01_dataplanepreview.operations import ( + ModelVersionsOperations as OperationClass, + ) + elif api_version == "2022-02-01-preview": + from .v2022_02_01_preview.operations import ( + ModelVersionsOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from .v2022_05_01.operations import ( + ModelVersionsOperations as OperationClass, + ) + elif api_version == "2022-06-01-preview": + from .v2022_06_01_preview.operations import ( + ModelVersionsOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from .v2022_10_01.operations import ( + ModelVersionsOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from .v2022_10_01_preview.operations import ( + ModelVersionsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'model_versions'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def models(self): """Instance depends on the API version: - * 1.0.0: :class:`ModelsOperations` - """ - api_version = self._get_api_version('models') - if api_version == '1.0.0': - from .model_dataplane.operations import ModelsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'models'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 1.0.0: :class:`ModelsOperations` + """ + api_version = self._get_api_version("models") + if api_version == "1.0.0": + from .model_dataplane.operations import ( + ModelsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'models'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def online_deployments(self): """Instance depends on the API version: - * 2021-10-01: :class:`OnlineDeploymentsOperations` - * 2022-02-01-preview: :class:`OnlineDeploymentsOperations` - * 2022-05-01: :class:`OnlineDeploymentsOperations` - * 2022-06-01-preview: :class:`OnlineDeploymentsOperations` - * 2022-10-01: :class:`OnlineDeploymentsOperations` - * 2022-10-01-preview: :class:`OnlineDeploymentsOperations` - """ - api_version = self._get_api_version('online_deployments') - if api_version == '2021-10-01': - from .v2021_10_01.operations import OnlineDeploymentsOperations as OperationClass - elif api_version == '2022-02-01-preview': - from .v2022_02_01_preview.operations import OnlineDeploymentsOperations as OperationClass - elif api_version == '2022-05-01': - from .v2022_05_01.operations import OnlineDeploymentsOperations as OperationClass - elif api_version == '2022-06-01-preview': - from .v2022_06_01_preview.operations import OnlineDeploymentsOperations as OperationClass - elif api_version == '2022-10-01': - from .v2022_10_01.operations import OnlineDeploymentsOperations as OperationClass - elif api_version == '2022-10-01-preview': - from .v2022_10_01_preview.operations import OnlineDeploymentsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'online_deployments'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`OnlineDeploymentsOperations` + * 2022-02-01-preview: :class:`OnlineDeploymentsOperations` + * 2022-05-01: :class:`OnlineDeploymentsOperations` + * 2022-06-01-preview: :class:`OnlineDeploymentsOperations` + * 2022-10-01: :class:`OnlineDeploymentsOperations` + * 2022-10-01-preview: :class:`OnlineDeploymentsOperations` + """ + api_version = self._get_api_version("online_deployments") + if api_version == "2021-10-01": + from .v2021_10_01.operations import ( + OnlineDeploymentsOperations as OperationClass, + ) + elif api_version == "2022-02-01-preview": + from .v2022_02_01_preview.operations import ( + OnlineDeploymentsOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from .v2022_05_01.operations import ( + OnlineDeploymentsOperations as OperationClass, + ) + elif api_version == "2022-06-01-preview": + from .v2022_06_01_preview.operations import ( + OnlineDeploymentsOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from .v2022_10_01.operations import ( + OnlineDeploymentsOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from .v2022_10_01_preview.operations import ( + OnlineDeploymentsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'online_deployments'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def online_endpoints(self): """Instance depends on the API version: - * 2021-10-01: :class:`OnlineEndpointsOperations` - * 2022-02-01-preview: :class:`OnlineEndpointsOperations` - * 2022-05-01: :class:`OnlineEndpointsOperations` - * 2022-06-01-preview: :class:`OnlineEndpointsOperations` - * 2022-10-01: :class:`OnlineEndpointsOperations` - * 2022-10-01-preview: :class:`OnlineEndpointsOperations` - """ - api_version = self._get_api_version('online_endpoints') - if api_version == '2021-10-01': - from .v2021_10_01.operations import OnlineEndpointsOperations as OperationClass - elif api_version == '2022-02-01-preview': - from .v2022_02_01_preview.operations import OnlineEndpointsOperations as OperationClass - elif api_version == '2022-05-01': - from .v2022_05_01.operations import OnlineEndpointsOperations as OperationClass - elif api_version == '2022-06-01-preview': - from .v2022_06_01_preview.operations import OnlineEndpointsOperations as OperationClass - elif api_version == '2022-10-01': - from .v2022_10_01.operations import OnlineEndpointsOperations as OperationClass - elif api_version == '2022-10-01-preview': - from .v2022_10_01_preview.operations import OnlineEndpointsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'online_endpoints'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`OnlineEndpointsOperations` + * 2022-02-01-preview: :class:`OnlineEndpointsOperations` + * 2022-05-01: :class:`OnlineEndpointsOperations` + * 2022-06-01-preview: :class:`OnlineEndpointsOperations` + * 2022-10-01: :class:`OnlineEndpointsOperations` + * 2022-10-01-preview: :class:`OnlineEndpointsOperations` + """ + api_version = self._get_api_version("online_endpoints") + if api_version == "2021-10-01": + from .v2021_10_01.operations import ( + OnlineEndpointsOperations as OperationClass, + ) + elif api_version == "2022-02-01-preview": + from .v2022_02_01_preview.operations import ( + OnlineEndpointsOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from .v2022_05_01.operations import ( + OnlineEndpointsOperations as OperationClass, + ) + elif api_version == "2022-06-01-preview": + from .v2022_06_01_preview.operations import ( + OnlineEndpointsOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from .v2022_10_01.operations import ( + OnlineEndpointsOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from .v2022_10_01_preview.operations import ( + OnlineEndpointsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'online_endpoints'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def operations(self): """Instance depends on the API version: - * 2021-10-01: :class:`Operations` - * 2022-01-01-preview: :class:`Operations` - * 2022-05-01: :class:`Operations` - * 2022-10-01: :class:`Operations` - * 2022-10-01-preview: :class:`Operations` + * 2021-10-01: :class:`Operations` + * 2022-01-01-preview: :class:`Operations` + * 2022-05-01: :class:`Operations` + * 2022-10-01: :class:`Operations` + * 2022-10-01-preview: :class:`Operations` """ - api_version = self._get_api_version('operations') - if api_version == '2021-10-01': + api_version = self._get_api_version("operations") + if api_version == "2021-10-01": from .v2021_10_01.operations import Operations as OperationClass - elif api_version == '2022-01-01-preview': - from .v2022_01_01_preview.operations import Operations as OperationClass - elif api_version == '2022-05-01': + elif api_version == "2022-01-01-preview": + from .v2022_01_01_preview.operations import ( + Operations as OperationClass, + ) + elif api_version == "2022-05-01": from .v2022_05_01.operations import Operations as OperationClass - elif api_version == '2022-10-01': + elif api_version == "2022-10-01": from .v2022_10_01.operations import Operations as OperationClass - elif api_version == '2022-10-01-preview': - from .v2022_10_01_preview.operations import Operations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'operations'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + elif api_version == "2022-10-01-preview": + from .v2022_10_01_preview.operations import ( + Operations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'operations'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def private_endpoint_connections(self): """Instance depends on the API version: - * 2021-10-01: :class:`PrivateEndpointConnectionsOperations` - * 2022-01-01-preview: :class:`PrivateEndpointConnectionsOperations` - * 2022-05-01: :class:`PrivateEndpointConnectionsOperations` - * 2022-10-01: :class:`PrivateEndpointConnectionsOperations` - * 2022-10-01-preview: :class:`PrivateEndpointConnectionsOperations` - """ - api_version = self._get_api_version('private_endpoint_connections') - if api_version == '2021-10-01': - from .v2021_10_01.operations import PrivateEndpointConnectionsOperations as OperationClass - elif api_version == '2022-01-01-preview': - from .v2022_01_01_preview.operations import PrivateEndpointConnectionsOperations as OperationClass - elif api_version == '2022-05-01': - from .v2022_05_01.operations import PrivateEndpointConnectionsOperations as OperationClass - elif api_version == '2022-10-01': - from .v2022_10_01.operations import PrivateEndpointConnectionsOperations as OperationClass - elif api_version == '2022-10-01-preview': - from .v2022_10_01_preview.operations import PrivateEndpointConnectionsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'private_endpoint_connections'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`PrivateEndpointConnectionsOperations` + * 2022-01-01-preview: :class:`PrivateEndpointConnectionsOperations` + * 2022-05-01: :class:`PrivateEndpointConnectionsOperations` + * 2022-10-01: :class:`PrivateEndpointConnectionsOperations` + * 2022-10-01-preview: :class:`PrivateEndpointConnectionsOperations` + """ + api_version = self._get_api_version("private_endpoint_connections") + if api_version == "2021-10-01": + from .v2021_10_01.operations import ( + PrivateEndpointConnectionsOperations as OperationClass, + ) + elif api_version == "2022-01-01-preview": + from .v2022_01_01_preview.operations import ( + PrivateEndpointConnectionsOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from .v2022_05_01.operations import ( + PrivateEndpointConnectionsOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from .v2022_10_01.operations import ( + PrivateEndpointConnectionsOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from .v2022_10_01_preview.operations import ( + PrivateEndpointConnectionsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'private_endpoint_connections'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def private_link_resources(self): """Instance depends on the API version: - * 2021-10-01: :class:`PrivateLinkResourcesOperations` - * 2022-01-01-preview: :class:`PrivateLinkResourcesOperations` - * 2022-05-01: :class:`PrivateLinkResourcesOperations` - * 2022-10-01: :class:`PrivateLinkResourcesOperations` - * 2022-10-01-preview: :class:`PrivateLinkResourcesOperations` - """ - api_version = self._get_api_version('private_link_resources') - if api_version == '2021-10-01': - from .v2021_10_01.operations import PrivateLinkResourcesOperations as OperationClass - elif api_version == '2022-01-01-preview': - from .v2022_01_01_preview.operations import PrivateLinkResourcesOperations as OperationClass - elif api_version == '2022-05-01': - from .v2022_05_01.operations import PrivateLinkResourcesOperations as OperationClass - elif api_version == '2022-10-01': - from .v2022_10_01.operations import PrivateLinkResourcesOperations as OperationClass - elif api_version == '2022-10-01-preview': - from .v2022_10_01_preview.operations import PrivateLinkResourcesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'private_link_resources'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`PrivateLinkResourcesOperations` + * 2022-01-01-preview: :class:`PrivateLinkResourcesOperations` + * 2022-05-01: :class:`PrivateLinkResourcesOperations` + * 2022-10-01: :class:`PrivateLinkResourcesOperations` + * 2022-10-01-preview: :class:`PrivateLinkResourcesOperations` + """ + api_version = self._get_api_version("private_link_resources") + if api_version == "2021-10-01": + from .v2021_10_01.operations import ( + PrivateLinkResourcesOperations as OperationClass, + ) + elif api_version == "2022-01-01-preview": + from .v2022_01_01_preview.operations import ( + PrivateLinkResourcesOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from .v2022_05_01.operations import ( + PrivateLinkResourcesOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from .v2022_10_01.operations import ( + PrivateLinkResourcesOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from .v2022_10_01_preview.operations import ( + PrivateLinkResourcesOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'private_link_resources'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def quotas(self): """Instance depends on the API version: - * 2021-10-01: :class:`QuotasOperations` - * 2022-01-01-preview: :class:`QuotasOperations` - * 2022-05-01: :class:`QuotasOperations` - * 2022-10-01: :class:`QuotasOperations` - * 2022-10-01-preview: :class:`QuotasOperations` - """ - api_version = self._get_api_version('quotas') - if api_version == '2021-10-01': - from .v2021_10_01.operations import QuotasOperations as OperationClass - elif api_version == '2022-01-01-preview': - from .v2022_01_01_preview.operations import QuotasOperations as OperationClass - elif api_version == '2022-05-01': - from .v2022_05_01.operations import QuotasOperations as OperationClass - elif api_version == '2022-10-01': - from .v2022_10_01.operations import QuotasOperations as OperationClass - elif api_version == '2022-10-01-preview': - from .v2022_10_01_preview.operations import QuotasOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'quotas'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`QuotasOperations` + * 2022-01-01-preview: :class:`QuotasOperations` + * 2022-05-01: :class:`QuotasOperations` + * 2022-10-01: :class:`QuotasOperations` + * 2022-10-01-preview: :class:`QuotasOperations` + """ + api_version = self._get_api_version("quotas") + if api_version == "2021-10-01": + from .v2021_10_01.operations import ( + QuotasOperations as OperationClass, + ) + elif api_version == "2022-01-01-preview": + from .v2022_01_01_preview.operations import ( + QuotasOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from .v2022_05_01.operations import ( + QuotasOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from .v2022_10_01.operations import ( + QuotasOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from .v2022_10_01_preview.operations import ( + QuotasOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'quotas'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def registries(self): """Instance depends on the API version: - * 2022-10-01-preview: :class:`RegistriesOperations` - """ - api_version = self._get_api_version('registries') - if api_version == '2022-10-01-preview': - from .v2022_10_01_preview.operations import RegistriesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'registries'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2022-10-01-preview: :class:`RegistriesOperations` + """ + api_version = self._get_api_version("registries") + if api_version == "2022-10-01-preview": + from .v2022_10_01_preview.operations import ( + RegistriesOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'registries'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def registry_code_containers(self): """Instance depends on the API version: - * 2022-10-01-preview: :class:`RegistryCodeContainersOperations` - """ - api_version = self._get_api_version('registry_code_containers') - if api_version == '2022-10-01-preview': - from .v2022_10_01_preview.operations import RegistryCodeContainersOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'registry_code_containers'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2022-10-01-preview: :class:`RegistryCodeContainersOperations` + """ + api_version = self._get_api_version("registry_code_containers") + if api_version == "2022-10-01-preview": + from .v2022_10_01_preview.operations import ( + RegistryCodeContainersOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'registry_code_containers'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def registry_code_versions(self): """Instance depends on the API version: - * 2022-10-01-preview: :class:`RegistryCodeVersionsOperations` - """ - api_version = self._get_api_version('registry_code_versions') - if api_version == '2022-10-01-preview': - from .v2022_10_01_preview.operations import RegistryCodeVersionsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'registry_code_versions'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2022-10-01-preview: :class:`RegistryCodeVersionsOperations` + """ + api_version = self._get_api_version("registry_code_versions") + if api_version == "2022-10-01-preview": + from .v2022_10_01_preview.operations import ( + RegistryCodeVersionsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'registry_code_versions'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def registry_component_containers(self): """Instance depends on the API version: - * 2022-10-01-preview: :class:`RegistryComponentContainersOperations` - """ - api_version = self._get_api_version('registry_component_containers') - if api_version == '2022-10-01-preview': - from .v2022_10_01_preview.operations import RegistryComponentContainersOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'registry_component_containers'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2022-10-01-preview: :class:`RegistryComponentContainersOperations` + """ + api_version = self._get_api_version("registry_component_containers") + if api_version == "2022-10-01-preview": + from .v2022_10_01_preview.operations import ( + RegistryComponentContainersOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'registry_component_containers'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def registry_component_versions(self): """Instance depends on the API version: - * 2022-10-01-preview: :class:`RegistryComponentVersionsOperations` - """ - api_version = self._get_api_version('registry_component_versions') - if api_version == '2022-10-01-preview': - from .v2022_10_01_preview.operations import RegistryComponentVersionsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'registry_component_versions'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2022-10-01-preview: :class:`RegistryComponentVersionsOperations` + """ + api_version = self._get_api_version("registry_component_versions") + if api_version == "2022-10-01-preview": + from .v2022_10_01_preview.operations import ( + RegistryComponentVersionsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'registry_component_versions'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def registry_environment_containers(self): """Instance depends on the API version: - * 2022-10-01-preview: :class:`RegistryEnvironmentContainersOperations` - """ - api_version = self._get_api_version('registry_environment_containers') - if api_version == '2022-10-01-preview': - from .v2022_10_01_preview.operations import RegistryEnvironmentContainersOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'registry_environment_containers'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2022-10-01-preview: :class:`RegistryEnvironmentContainersOperations` + """ + api_version = self._get_api_version("registry_environment_containers") + if api_version == "2022-10-01-preview": + from .v2022_10_01_preview.operations import ( + RegistryEnvironmentContainersOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'registry_environment_containers'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def registry_environment_versions(self): """Instance depends on the API version: - * 2022-10-01-preview: :class:`RegistryEnvironmentVersionsOperations` - """ - api_version = self._get_api_version('registry_environment_versions') - if api_version == '2022-10-01-preview': - from .v2022_10_01_preview.operations import RegistryEnvironmentVersionsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'registry_environment_versions'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2022-10-01-preview: :class:`RegistryEnvironmentVersionsOperations` + """ + api_version = self._get_api_version("registry_environment_versions") + if api_version == "2022-10-01-preview": + from .v2022_10_01_preview.operations import ( + RegistryEnvironmentVersionsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'registry_environment_versions'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def registry_management_non_workspace(self): """Instance depends on the API version: - * v1.0: :class:`RegistryManagementNonWorkspaceOperations` + * v1.0: :class:`RegistryManagementNonWorkspaceOperations` """ - api_version = self._get_api_version('registry_management_non_workspace') - if api_version == 'v1.0': - from .registry_discovery.operations import RegistryManagementNonWorkspaceOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'registry_management_non_workspace'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + api_version = self._get_api_version( + "registry_management_non_workspace" + ) + if api_version == "v1.0": + from .registry_discovery.operations import ( + RegistryManagementNonWorkspaceOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'registry_management_non_workspace'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def registry_model_containers(self): """Instance depends on the API version: - * 2022-10-01-preview: :class:`RegistryModelContainersOperations` - """ - api_version = self._get_api_version('registry_model_containers') - if api_version == '2022-10-01-preview': - from .v2022_10_01_preview.operations import RegistryModelContainersOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'registry_model_containers'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2022-10-01-preview: :class:`RegistryModelContainersOperations` + """ + api_version = self._get_api_version("registry_model_containers") + if api_version == "2022-10-01-preview": + from .v2022_10_01_preview.operations import ( + RegistryModelContainersOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'registry_model_containers'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def registry_model_versions(self): """Instance depends on the API version: - * 2022-10-01-preview: :class:`RegistryModelVersionsOperations` - """ - api_version = self._get_api_version('registry_model_versions') - if api_version == '2022-10-01-preview': - from .v2022_10_01_preview.operations import RegistryModelVersionsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'registry_model_versions'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2022-10-01-preview: :class:`RegistryModelVersionsOperations` + """ + api_version = self._get_api_version("registry_model_versions") + if api_version == "2022-10-01-preview": + from .v2022_10_01_preview.operations import ( + RegistryModelVersionsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'registry_model_versions'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def resource_management_asset_reference(self): """Instance depends on the API version: - * 2021-10-01-dataplanepreview: :class:`ResourceManagementAssetReferenceOperations` + * 2021-10-01-dataplanepreview: :class:`ResourceManagementAssetReferenceOperations` """ - api_version = self._get_api_version('resource_management_asset_reference') - if api_version == '2021-10-01-dataplanepreview': - from .v2021_10_01_dataplanepreview.operations import ResourceManagementAssetReferenceOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'resource_management_asset_reference'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + api_version = self._get_api_version( + "resource_management_asset_reference" + ) + if api_version == "2021-10-01-dataplanepreview": + from .v2021_10_01_dataplanepreview.operations import ( + ResourceManagementAssetReferenceOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'resource_management_asset_reference'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def run(self): """Instance depends on the API version: - * v1.0: :class:`RunOperations` + * v1.0: :class:`RunOperations` """ - api_version = self._get_api_version('run') - if api_version == 'v1.0': + api_version = self._get_api_version("run") + if api_version == "v1.0": from .runhistory.operations import RunOperations as OperationClass else: - raise ValueError("API version {} does not have operation group 'run'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + raise ValueError( + "API version {} does not have operation group 'run'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def run_artifacts(self): """Instance depends on the API version: - * v1.0: :class:`RunArtifactsOperations` - """ - api_version = self._get_api_version('run_artifacts') - if api_version == 'v1.0': - from .runhistory.operations import RunArtifactsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'run_artifacts'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * v1.0: :class:`RunArtifactsOperations` + """ + api_version = self._get_api_version("run_artifacts") + if api_version == "v1.0": + from .runhistory.operations import ( + RunArtifactsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'run_artifacts'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def runs(self): """Instance depends on the API version: - * v1.0: :class:`RunsOperations` + * v1.0: :class:`RunsOperations` """ - api_version = self._get_api_version('runs') - if api_version == 'v1.0': + api_version = self._get_api_version("runs") + if api_version == "v1.0": from .runhistory.operations import RunsOperations as OperationClass else: - raise ValueError("API version {} does not have operation group 'runs'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + raise ValueError( + "API version {} does not have operation group 'runs'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def schedules(self): """Instance depends on the API version: - * 2022-06-01-preview: :class:`SchedulesOperations` - * 2022-10-01: :class:`SchedulesOperations` - * 2022-10-01-preview: :class:`SchedulesOperations` - """ - api_version = self._get_api_version('schedules') - if api_version == '2022-06-01-preview': - from .v2022_06_01_preview.operations import SchedulesOperations as OperationClass - elif api_version == '2022-10-01': - from .v2022_10_01.operations import SchedulesOperations as OperationClass - elif api_version == '2022-10-01-preview': - from .v2022_10_01_preview.operations import SchedulesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'schedules'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2022-06-01-preview: :class:`SchedulesOperations` + * 2022-10-01: :class:`SchedulesOperations` + * 2022-10-01-preview: :class:`SchedulesOperations` + """ + api_version = self._get_api_version("schedules") + if api_version == "2022-06-01-preview": + from .v2022_06_01_preview.operations import ( + SchedulesOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from .v2022_10_01.operations import ( + SchedulesOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from .v2022_10_01_preview.operations import ( + SchedulesOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'schedules'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def spans(self): """Instance depends on the API version: - * v1.0: :class:`SpansOperations` - """ - api_version = self._get_api_version('spans') - if api_version == 'v1.0': - from .runhistory.operations import SpansOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'spans'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * v1.0: :class:`SpansOperations` + """ + api_version = self._get_api_version("spans") + if api_version == "v1.0": + from .runhistory.operations import ( + SpansOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'spans'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def temporary_data_references(self): """Instance depends on the API version: - * 2021-10-01-dataplanepreview: :class:`TemporaryDataReferencesOperations` - """ - api_version = self._get_api_version('temporary_data_references') - if api_version == '2021-10-01-dataplanepreview': - from .v2021_10_01_dataplanepreview.operations import TemporaryDataReferencesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'temporary_data_references'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01-dataplanepreview: :class:`TemporaryDataReferencesOperations` + """ + api_version = self._get_api_version("temporary_data_references") + if api_version == "2021-10-01-dataplanepreview": + from .v2021_10_01_dataplanepreview.operations import ( + TemporaryDataReferencesOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'temporary_data_references'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def usages(self): """Instance depends on the API version: - * 2021-10-01: :class:`UsagesOperations` - * 2022-01-01-preview: :class:`UsagesOperations` - * 2022-05-01: :class:`UsagesOperations` - * 2022-10-01: :class:`UsagesOperations` - * 2022-10-01-preview: :class:`UsagesOperations` - """ - api_version = self._get_api_version('usages') - if api_version == '2021-10-01': - from .v2021_10_01.operations import UsagesOperations as OperationClass - elif api_version == '2022-01-01-preview': - from .v2022_01_01_preview.operations import UsagesOperations as OperationClass - elif api_version == '2022-05-01': - from .v2022_05_01.operations import UsagesOperations as OperationClass - elif api_version == '2022-10-01': - from .v2022_10_01.operations import UsagesOperations as OperationClass - elif api_version == '2022-10-01-preview': - from .v2022_10_01_preview.operations import UsagesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'usages'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`UsagesOperations` + * 2022-01-01-preview: :class:`UsagesOperations` + * 2022-05-01: :class:`UsagesOperations` + * 2022-10-01: :class:`UsagesOperations` + * 2022-10-01-preview: :class:`UsagesOperations` + """ + api_version = self._get_api_version("usages") + if api_version == "2021-10-01": + from .v2021_10_01.operations import ( + UsagesOperations as OperationClass, + ) + elif api_version == "2022-01-01-preview": + from .v2022_01_01_preview.operations import ( + UsagesOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from .v2022_05_01.operations import ( + UsagesOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from .v2022_10_01.operations import ( + UsagesOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from .v2022_10_01_preview.operations import ( + UsagesOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'usages'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def virtual_machine_sizes(self): """Instance depends on the API version: - * 2021-10-01: :class:`VirtualMachineSizesOperations` - * 2022-01-01-preview: :class:`VirtualMachineSizesOperations` - * 2022-05-01: :class:`VirtualMachineSizesOperations` - * 2022-10-01: :class:`VirtualMachineSizesOperations` - * 2022-10-01-preview: :class:`VirtualMachineSizesOperations` - """ - api_version = self._get_api_version('virtual_machine_sizes') - if api_version == '2021-10-01': - from .v2021_10_01.operations import VirtualMachineSizesOperations as OperationClass - elif api_version == '2022-01-01-preview': - from .v2022_01_01_preview.operations import VirtualMachineSizesOperations as OperationClass - elif api_version == '2022-05-01': - from .v2022_05_01.operations import VirtualMachineSizesOperations as OperationClass - elif api_version == '2022-10-01': - from .v2022_10_01.operations import VirtualMachineSizesOperations as OperationClass - elif api_version == '2022-10-01-preview': - from .v2022_10_01_preview.operations import VirtualMachineSizesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'virtual_machine_sizes'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`VirtualMachineSizesOperations` + * 2022-01-01-preview: :class:`VirtualMachineSizesOperations` + * 2022-05-01: :class:`VirtualMachineSizesOperations` + * 2022-10-01: :class:`VirtualMachineSizesOperations` + * 2022-10-01-preview: :class:`VirtualMachineSizesOperations` + """ + api_version = self._get_api_version("virtual_machine_sizes") + if api_version == "2021-10-01": + from .v2021_10_01.operations import ( + VirtualMachineSizesOperations as OperationClass, + ) + elif api_version == "2022-01-01-preview": + from .v2022_01_01_preview.operations import ( + VirtualMachineSizesOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from .v2022_05_01.operations import ( + VirtualMachineSizesOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from .v2022_10_01.operations import ( + VirtualMachineSizesOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from .v2022_10_01_preview.operations import ( + VirtualMachineSizesOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'virtual_machine_sizes'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def workspace_connections(self): """Instance depends on the API version: - * 2021-10-01: :class:`WorkspaceConnectionsOperations` - * 2022-01-01-preview: :class:`WorkspaceConnectionsOperations` - * 2022-05-01: :class:`WorkspaceConnectionsOperations` - * 2022-10-01: :class:`WorkspaceConnectionsOperations` - * 2022-10-01-preview: :class:`WorkspaceConnectionsOperations` - """ - api_version = self._get_api_version('workspace_connections') - if api_version == '2021-10-01': - from .v2021_10_01.operations import WorkspaceConnectionsOperations as OperationClass - elif api_version == '2022-01-01-preview': - from .v2022_01_01_preview.operations import WorkspaceConnectionsOperations as OperationClass - elif api_version == '2022-05-01': - from .v2022_05_01.operations import WorkspaceConnectionsOperations as OperationClass - elif api_version == '2022-10-01': - from .v2022_10_01.operations import WorkspaceConnectionsOperations as OperationClass - elif api_version == '2022-10-01-preview': - from .v2022_10_01_preview.operations import WorkspaceConnectionsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'workspace_connections'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`WorkspaceConnectionsOperations` + * 2022-01-01-preview: :class:`WorkspaceConnectionsOperations` + * 2022-05-01: :class:`WorkspaceConnectionsOperations` + * 2022-10-01: :class:`WorkspaceConnectionsOperations` + * 2022-10-01-preview: :class:`WorkspaceConnectionsOperations` + """ + api_version = self._get_api_version("workspace_connections") + if api_version == "2021-10-01": + from .v2021_10_01.operations import ( + WorkspaceConnectionsOperations as OperationClass, + ) + elif api_version == "2022-01-01-preview": + from .v2022_01_01_preview.operations import ( + WorkspaceConnectionsOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from .v2022_05_01.operations import ( + WorkspaceConnectionsOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from .v2022_10_01.operations import ( + WorkspaceConnectionsOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from .v2022_10_01_preview.operations import ( + WorkspaceConnectionsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'workspace_connections'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def workspace_features(self): """Instance depends on the API version: - * 2021-10-01: :class:`WorkspaceFeaturesOperations` - * 2022-01-01-preview: :class:`WorkspaceFeaturesOperations` - * 2022-05-01: :class:`WorkspaceFeaturesOperations` - * 2022-10-01: :class:`WorkspaceFeaturesOperations` - * 2022-10-01-preview: :class:`WorkspaceFeaturesOperations` - """ - api_version = self._get_api_version('workspace_features') - if api_version == '2021-10-01': - from .v2021_10_01.operations import WorkspaceFeaturesOperations as OperationClass - elif api_version == '2022-01-01-preview': - from .v2022_01_01_preview.operations import WorkspaceFeaturesOperations as OperationClass - elif api_version == '2022-05-01': - from .v2022_05_01.operations import WorkspaceFeaturesOperations as OperationClass - elif api_version == '2022-10-01': - from .v2022_10_01.operations import WorkspaceFeaturesOperations as OperationClass - elif api_version == '2022-10-01-preview': - from .v2022_10_01_preview.operations import WorkspaceFeaturesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'workspace_features'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`WorkspaceFeaturesOperations` + * 2022-01-01-preview: :class:`WorkspaceFeaturesOperations` + * 2022-05-01: :class:`WorkspaceFeaturesOperations` + * 2022-10-01: :class:`WorkspaceFeaturesOperations` + * 2022-10-01-preview: :class:`WorkspaceFeaturesOperations` + """ + api_version = self._get_api_version("workspace_features") + if api_version == "2021-10-01": + from .v2021_10_01.operations import ( + WorkspaceFeaturesOperations as OperationClass, + ) + elif api_version == "2022-01-01-preview": + from .v2022_01_01_preview.operations import ( + WorkspaceFeaturesOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from .v2022_05_01.operations import ( + WorkspaceFeaturesOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from .v2022_10_01.operations import ( + WorkspaceFeaturesOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from .v2022_10_01_preview.operations import ( + WorkspaceFeaturesOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'workspace_features'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def workspaces(self): """Instance depends on the API version: - * 2021-10-01: :class:`WorkspacesOperations` - * 2022-01-01-preview: :class:`WorkspacesOperations` - * 2022-05-01: :class:`WorkspacesOperations` - * 2022-10-01: :class:`WorkspacesOperations` - * 2022-10-01-preview: :class:`WorkspacesOperations` - """ - api_version = self._get_api_version('workspaces') - if api_version == '2021-10-01': - from .v2021_10_01.operations import WorkspacesOperations as OperationClass - elif api_version == '2022-01-01-preview': - from .v2022_01_01_preview.operations import WorkspacesOperations as OperationClass - elif api_version == '2022-05-01': - from .v2022_05_01.operations import WorkspacesOperations as OperationClass - elif api_version == '2022-10-01': - from .v2022_10_01.operations import WorkspacesOperations as OperationClass - elif api_version == '2022-10-01-preview': - from .v2022_10_01_preview.operations import WorkspacesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'workspaces'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`WorkspacesOperations` + * 2022-01-01-preview: :class:`WorkspacesOperations` + * 2022-05-01: :class:`WorkspacesOperations` + * 2022-10-01: :class:`WorkspacesOperations` + * 2022-10-01-preview: :class:`WorkspacesOperations` + """ + api_version = self._get_api_version("workspaces") + if api_version == "2021-10-01": + from .v2021_10_01.operations import ( + WorkspacesOperations as OperationClass, + ) + elif api_version == "2022-01-01-preview": + from .v2022_01_01_preview.operations import ( + WorkspacesOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from .v2022_05_01.operations import ( + WorkspacesOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from .v2022_10_01.operations import ( + WorkspacesOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from .v2022_10_01_preview.operations import ( + WorkspacesOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'workspaces'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) def close(self): self._client.close() + def __enter__(self): self._client.__enter__() return self + def __exit__(self, *exc_details): self._client.__exit__(*exc_details) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/_configuration.py index 1aa9c858b5b8..40d80b7abcc1 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/_configuration.py @@ -12,7 +12,10 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ( + ARMChallengeAuthenticationPolicy, + ARMHttpLoggingPolicy, +) from ._version import VERSION @@ -22,6 +25,7 @@ from azure.core.credentials import TokenCredential + class AzureMachineLearningWorkspacesConfiguration(Configuration): """Configuration for AzureMachineLearningWorkspaces. @@ -45,27 +49,51 @@ def __init__( raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) + super(AzureMachineLearningWorkspacesConfiguration, self).__init__( + **kwargs + ) self.credential = credential self.subscription_id = subscription_id - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'azure-mgmt-machinelearningservices/{}'.format(VERSION)) + self.credential_scopes = kwargs.pop( + "credential_scopes", ["https://management.azure.com/.default"] + ) + kwargs.setdefault( + "sdk_moniker", + "azure-mgmt-machinelearningservices/{}".format(VERSION), + ) self._configure(**kwargs) def _configure( - self, - **kwargs # type: Any + self, **kwargs # type: Any ): # type: (...) -> None - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') + self.user_agent_policy = kwargs.get( + "user_agent_policy" + ) or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get( + "headers_policy" + ) or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy( + **kwargs + ) + self.logging_policy = kwargs.get( + "logging_policy" + ) or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get( + "http_logging_policy" + ) or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy( + **kwargs + ) + self.custom_hook_policy = kwargs.get( + "custom_hook_policy" + ) or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get( + "redirect_policy" + ) or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = ARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/_version.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/_version.py index a30a458f8b5b..780a1be7a6ea 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/_version.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/_version.py @@ -5,4 +5,4 @@ # license information. # -------------------------------------------------------------------------- -VERSION = "0.1.0" \ No newline at end of file +VERSION = "0.1.0" diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/aio/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/aio/__init__.py index 872474577c4f..46b045f5838a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/aio/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/aio/__init__.py @@ -7,4 +7,5 @@ # -------------------------------------------------------------------------- from ._azure_machine_learning_workspaces import AzureMachineLearningWorkspaces -__all__ = ['AzureMachineLearningWorkspaces'] + +__all__ = ["AzureMachineLearningWorkspaces"] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/aio/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/aio/_azure_machine_learning_workspaces.py index e8ec4203da4b..7cd238b27e35 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/aio/_azure_machine_learning_workspaces.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/aio/_azure_machine_learning_workspaces.py @@ -24,6 +24,7 @@ from azure.core.credentials import TokenCredential from azure.core.credentials_async import AsyncTokenCredential + class _SDKClient(object): def __init__(self, *args, **kwargs): """This is a fake class to support current implemetation of MultiApiClientMixin." @@ -31,6 +32,7 @@ def __init__(self, *args, **kwargs): """ pass + class AzureMachineLearningWorkspaces(MultiApiClientMixin, _SDKClient): """These APIs allow end users to operate on Azure Machine Learning Workspace resources. @@ -55,41 +57,45 @@ class AzureMachineLearningWorkspaces(MultiApiClientMixin, _SDKClient): :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ - DEFAULT_API_VERSION = '2022-10-01' - _PROFILE_TAG = "azure.mgmt.machinelearningservices.AzureMachineLearningWorkspaces" - LATEST_PROFILE = ProfileDefinition({ - _PROFILE_TAG: { - None: DEFAULT_API_VERSION, - 'assets': '1.0.0', - 'async_operations': 'v1.0', - 'batch_job_deployment': '2020-09-01-dataplanepreview', - 'batch_job_endpoint': '2020-09-01-dataplanepreview', - 'data_call': '1.5.0', - 'data_container': '1.5.0', - 'data_references': '2021-10-01-dataplanepreview', - 'data_version': '1.5.0', - 'dataset_containers': '2021-10-01', - 'dataset_controller_v2': '1.5.0', - 'dataset_v2': '1.5.0', - 'dataset_versions': '2021-10-01', - 'datasets_v1': '1.5.0', - 'delete': 'v1.0', - 'events': 'v1.0', - 'experiments': 'v1.0', - 'extensive_model': '1.0.0', - 'get_operation_status': '1.5.0', - 'metric': 'v1.0', - 'migration': '1.0.0', - 'models': '1.0.0', - 'registry_management_non_workspace': 'v1.0', - 'resource_management_asset_reference': '2021-10-01-dataplanepreview', - 'run': 'v1.0', - 'run_artifacts': 'v1.0', - 'runs': 'v1.0', - 'spans': 'v1.0', - 'temporary_data_references': '2021-10-01-dataplanepreview', - }}, - _PROFILE_TAG + " latest" + DEFAULT_API_VERSION = "2022-10-01" + _PROFILE_TAG = ( + "azure.mgmt.machinelearningservices.AzureMachineLearningWorkspaces" + ) + LATEST_PROFILE = ProfileDefinition( + { + _PROFILE_TAG: { + None: DEFAULT_API_VERSION, + "assets": "1.0.0", + "async_operations": "v1.0", + "batch_job_deployment": "2020-09-01-dataplanepreview", + "batch_job_endpoint": "2020-09-01-dataplanepreview", + "data_call": "1.5.0", + "data_container": "1.5.0", + "data_references": "2021-10-01-dataplanepreview", + "data_version": "1.5.0", + "dataset_containers": "2021-10-01", + "dataset_controller_v2": "1.5.0", + "dataset_v2": "1.5.0", + "dataset_versions": "2021-10-01", + "datasets_v1": "1.5.0", + "delete": "v1.0", + "events": "v1.0", + "experiments": "v1.0", + "extensive_model": "1.0.0", + "get_operation_status": "1.5.0", + "metric": "v1.0", + "migration": "1.0.0", + "models": "1.0.0", + "registry_management_non_workspace": "v1.0", + "resource_management_asset_reference": "2021-10-01-dataplanepreview", + "run": "v1.0", + "run_artifacts": "v1.0", + "runs": "v1.0", + "spans": "v1.0", + "temporary_data_references": "2021-10-01-dataplanepreview", + } + }, + _PROFILE_TAG + " latest", ) def __init__( @@ -101,73 +107,93 @@ def __init__( profile: KnownProfiles = KnownProfiles.default, **kwargs # type: Any ) -> None: - self._config = AzureMachineLearningWorkspacesConfiguration(credential, subscription_id, **kwargs) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._config = AzureMachineLearningWorkspacesConfiguration( + credential, subscription_id, **kwargs + ) + self._client = AsyncARMPipelineClient( + base_url=base_url, config=self._config, **kwargs + ) super(AzureMachineLearningWorkspaces, self).__init__( - api_version=api_version, - profile=profile + api_version=api_version, profile=profile ) @classmethod def _models_dict(cls, api_version): - return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)} + return { + k: v + for k, v in cls.models(api_version).__dict__.items() + if isinstance(v, type) + } @classmethod def models(cls, api_version=DEFAULT_API_VERSION): """Module depends on the API version: - * 1.5.0: :mod:`dataset_dataplane.models` - * 1.0.0: :mod:`model_dataplane.models` - * v1.0: :mod:`registry_discovery.models` - * v1.0: :mod:`runhistory.models` - * 2020-09-01-dataplanepreview: :mod:`v2020_09_01_dataplanepreview.models` - * 2021-10-01: :mod:`v2021_10_01.models` - * 2021-10-01-dataplanepreview: :mod:`v2021_10_01_dataplanepreview.models` - * 2022-01-01-preview: :mod:`v2022_01_01_preview.models` - * 2022-02-01-preview: :mod:`v2022_02_01_preview.models` - * 2022-05-01: :mod:`v2022_05_01.models` - * 2022-06-01-preview: :mod:`v2022_06_01_preview.models` - * 2022-10-01: :mod:`v2022_10_01.models` - * 2022-10-01-preview: :mod:`v2022_10_01_preview.models` - """ - if api_version == '1.5.0': + * 1.5.0: :mod:`dataset_dataplane.models` + * 1.0.0: :mod:`model_dataplane.models` + * v1.0: :mod:`registry_discovery.models` + * v1.0: :mod:`runhistory.models` + * 2020-09-01-dataplanepreview: :mod:`v2020_09_01_dataplanepreview.models` + * 2021-10-01: :mod:`v2021_10_01.models` + * 2021-10-01-dataplanepreview: :mod:`v2021_10_01_dataplanepreview.models` + * 2022-01-01-preview: :mod:`v2022_01_01_preview.models` + * 2022-02-01-preview: :mod:`v2022_02_01_preview.models` + * 2022-05-01: :mod:`v2022_05_01.models` + * 2022-06-01-preview: :mod:`v2022_06_01_preview.models` + * 2022-10-01: :mod:`v2022_10_01.models` + * 2022-10-01-preview: :mod:`v2022_10_01_preview.models` + """ + if api_version == "1.5.0": from ..dataset_dataplane import models + return models - elif api_version == '1.0.0': + elif api_version == "1.0.0": from ..model_dataplane import models + return models - elif api_version == 'v1.0': + elif api_version == "v1.0": from ..registry_discovery import models + return models - elif api_version == 'v1.0': + elif api_version == "v1.0": from ..runhistory import models + return models - elif api_version == '2020-09-01-dataplanepreview': + elif api_version == "2020-09-01-dataplanepreview": from ..v2020_09_01_dataplanepreview import models + return models - elif api_version == '2021-10-01': + elif api_version == "2021-10-01": from ..v2021_10_01 import models + return models - elif api_version == '2021-10-01-dataplanepreview': + elif api_version == "2021-10-01-dataplanepreview": from ..v2021_10_01_dataplanepreview import models + return models - elif api_version == '2022-01-01-preview': + elif api_version == "2022-01-01-preview": from ..v2022_01_01_preview import models + return models - elif api_version == '2022-02-01-preview': + elif api_version == "2022-02-01-preview": from ..v2022_02_01_preview import models + return models - elif api_version == '2022-05-01': + elif api_version == "2022-05-01": from ..v2022_05_01 import models + return models - elif api_version == '2022-06-01-preview': + elif api_version == "2022-06-01-preview": from ..v2022_06_01_preview import models + return models - elif api_version == '2022-10-01': + elif api_version == "2022-10-01": from ..v2022_10_01 import models + return models - elif api_version == '2022-10-01-preview': + elif api_version == "2022-10-01-preview": from ..v2022_10_01_preview import models + return models raise ValueError("API version {} is not available".format(api_version)) @@ -175,1247 +201,2232 @@ def models(cls, api_version=DEFAULT_API_VERSION): def assets(self): """Instance depends on the API version: - * 1.0.0: :class:`AssetsOperations` - """ - api_version = self._get_api_version('assets') - if api_version == '1.0.0': - from ..model_dataplane.aio.operations import AssetsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'assets'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 1.0.0: :class:`AssetsOperations` + """ + api_version = self._get_api_version("assets") + if api_version == "1.0.0": + from ..model_dataplane.aio.operations import ( + AssetsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'assets'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def async_operations(self): """Instance depends on the API version: - * v1.0: :class:`AsyncOperationsOperations` - """ - api_version = self._get_api_version('async_operations') - if api_version == 'v1.0': - from ..registry_discovery.aio.operations import AsyncOperationsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'async_operations'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * v1.0: :class:`AsyncOperationsOperations` + """ + api_version = self._get_api_version("async_operations") + if api_version == "v1.0": + from ..registry_discovery.aio.operations import ( + AsyncOperationsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'async_operations'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def batch_deployments(self): """Instance depends on the API version: - * 2021-10-01: :class:`BatchDeploymentsOperations` - * 2022-02-01-preview: :class:`BatchDeploymentsOperations` - * 2022-05-01: :class:`BatchDeploymentsOperations` - * 2022-06-01-preview: :class:`BatchDeploymentsOperations` - * 2022-10-01: :class:`BatchDeploymentsOperations` - * 2022-10-01-preview: :class:`BatchDeploymentsOperations` - """ - api_version = self._get_api_version('batch_deployments') - if api_version == '2021-10-01': - from ..v2021_10_01.aio.operations import BatchDeploymentsOperations as OperationClass - elif api_version == '2022-02-01-preview': - from ..v2022_02_01_preview.aio.operations import BatchDeploymentsOperations as OperationClass - elif api_version == '2022-05-01': - from ..v2022_05_01.aio.operations import BatchDeploymentsOperations as OperationClass - elif api_version == '2022-06-01-preview': - from ..v2022_06_01_preview.aio.operations import BatchDeploymentsOperations as OperationClass - elif api_version == '2022-10-01': - from ..v2022_10_01.aio.operations import BatchDeploymentsOperations as OperationClass - elif api_version == '2022-10-01-preview': - from ..v2022_10_01_preview.aio.operations import BatchDeploymentsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'batch_deployments'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`BatchDeploymentsOperations` + * 2022-02-01-preview: :class:`BatchDeploymentsOperations` + * 2022-05-01: :class:`BatchDeploymentsOperations` + * 2022-06-01-preview: :class:`BatchDeploymentsOperations` + * 2022-10-01: :class:`BatchDeploymentsOperations` + * 2022-10-01-preview: :class:`BatchDeploymentsOperations` + """ + api_version = self._get_api_version("batch_deployments") + if api_version == "2021-10-01": + from ..v2021_10_01.aio.operations import ( + BatchDeploymentsOperations as OperationClass, + ) + elif api_version == "2022-02-01-preview": + from ..v2022_02_01_preview.aio.operations import ( + BatchDeploymentsOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from ..v2022_05_01.aio.operations import ( + BatchDeploymentsOperations as OperationClass, + ) + elif api_version == "2022-06-01-preview": + from ..v2022_06_01_preview.aio.operations import ( + BatchDeploymentsOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from ..v2022_10_01.aio.operations import ( + BatchDeploymentsOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from ..v2022_10_01_preview.aio.operations import ( + BatchDeploymentsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'batch_deployments'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def batch_endpoints(self): """Instance depends on the API version: - * 2021-10-01: :class:`BatchEndpointsOperations` - * 2022-02-01-preview: :class:`BatchEndpointsOperations` - * 2022-05-01: :class:`BatchEndpointsOperations` - * 2022-06-01-preview: :class:`BatchEndpointsOperations` - * 2022-10-01: :class:`BatchEndpointsOperations` - * 2022-10-01-preview: :class:`BatchEndpointsOperations` - """ - api_version = self._get_api_version('batch_endpoints') - if api_version == '2021-10-01': - from ..v2021_10_01.aio.operations import BatchEndpointsOperations as OperationClass - elif api_version == '2022-02-01-preview': - from ..v2022_02_01_preview.aio.operations import BatchEndpointsOperations as OperationClass - elif api_version == '2022-05-01': - from ..v2022_05_01.aio.operations import BatchEndpointsOperations as OperationClass - elif api_version == '2022-06-01-preview': - from ..v2022_06_01_preview.aio.operations import BatchEndpointsOperations as OperationClass - elif api_version == '2022-10-01': - from ..v2022_10_01.aio.operations import BatchEndpointsOperations as OperationClass - elif api_version == '2022-10-01-preview': - from ..v2022_10_01_preview.aio.operations import BatchEndpointsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'batch_endpoints'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`BatchEndpointsOperations` + * 2022-02-01-preview: :class:`BatchEndpointsOperations` + * 2022-05-01: :class:`BatchEndpointsOperations` + * 2022-06-01-preview: :class:`BatchEndpointsOperations` + * 2022-10-01: :class:`BatchEndpointsOperations` + * 2022-10-01-preview: :class:`BatchEndpointsOperations` + """ + api_version = self._get_api_version("batch_endpoints") + if api_version == "2021-10-01": + from ..v2021_10_01.aio.operations import ( + BatchEndpointsOperations as OperationClass, + ) + elif api_version == "2022-02-01-preview": + from ..v2022_02_01_preview.aio.operations import ( + BatchEndpointsOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from ..v2022_05_01.aio.operations import ( + BatchEndpointsOperations as OperationClass, + ) + elif api_version == "2022-06-01-preview": + from ..v2022_06_01_preview.aio.operations import ( + BatchEndpointsOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from ..v2022_10_01.aio.operations import ( + BatchEndpointsOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from ..v2022_10_01_preview.aio.operations import ( + BatchEndpointsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'batch_endpoints'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def batch_job_deployment(self): """Instance depends on the API version: - * 2020-09-01-dataplanepreview: :class:`BatchJobDeploymentOperations` - """ - api_version = self._get_api_version('batch_job_deployment') - if api_version == '2020-09-01-dataplanepreview': - from ..v2020_09_01_dataplanepreview.aio.operations import BatchJobDeploymentOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'batch_job_deployment'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2020-09-01-dataplanepreview: :class:`BatchJobDeploymentOperations` + """ + api_version = self._get_api_version("batch_job_deployment") + if api_version == "2020-09-01-dataplanepreview": + from ..v2020_09_01_dataplanepreview.aio.operations import ( + BatchJobDeploymentOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'batch_job_deployment'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def batch_job_endpoint(self): """Instance depends on the API version: - * 2020-09-01-dataplanepreview: :class:`BatchJobEndpointOperations` - """ - api_version = self._get_api_version('batch_job_endpoint') - if api_version == '2020-09-01-dataplanepreview': - from ..v2020_09_01_dataplanepreview.aio.operations import BatchJobEndpointOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'batch_job_endpoint'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2020-09-01-dataplanepreview: :class:`BatchJobEndpointOperations` + """ + api_version = self._get_api_version("batch_job_endpoint") + if api_version == "2020-09-01-dataplanepreview": + from ..v2020_09_01_dataplanepreview.aio.operations import ( + BatchJobEndpointOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'batch_job_endpoint'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def code_containers(self): """Instance depends on the API version: - * 2021-10-01: :class:`CodeContainersOperations` - * 2021-10-01-dataplanepreview: :class:`CodeContainersOperations` - * 2022-02-01-preview: :class:`CodeContainersOperations` - * 2022-05-01: :class:`CodeContainersOperations` - * 2022-06-01-preview: :class:`CodeContainersOperations` - * 2022-10-01: :class:`CodeContainersOperations` - * 2022-10-01-preview: :class:`CodeContainersOperations` - """ - api_version = self._get_api_version('code_containers') - if api_version == '2021-10-01': - from ..v2021_10_01.aio.operations import CodeContainersOperations as OperationClass - elif api_version == '2021-10-01-dataplanepreview': - from ..v2021_10_01_dataplanepreview.aio.operations import CodeContainersOperations as OperationClass - elif api_version == '2022-02-01-preview': - from ..v2022_02_01_preview.aio.operations import CodeContainersOperations as OperationClass - elif api_version == '2022-05-01': - from ..v2022_05_01.aio.operations import CodeContainersOperations as OperationClass - elif api_version == '2022-06-01-preview': - from ..v2022_06_01_preview.aio.operations import CodeContainersOperations as OperationClass - elif api_version == '2022-10-01': - from ..v2022_10_01.aio.operations import CodeContainersOperations as OperationClass - elif api_version == '2022-10-01-preview': - from ..v2022_10_01_preview.aio.operations import CodeContainersOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'code_containers'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`CodeContainersOperations` + * 2021-10-01-dataplanepreview: :class:`CodeContainersOperations` + * 2022-02-01-preview: :class:`CodeContainersOperations` + * 2022-05-01: :class:`CodeContainersOperations` + * 2022-06-01-preview: :class:`CodeContainersOperations` + * 2022-10-01: :class:`CodeContainersOperations` + * 2022-10-01-preview: :class:`CodeContainersOperations` + """ + api_version = self._get_api_version("code_containers") + if api_version == "2021-10-01": + from ..v2021_10_01.aio.operations import ( + CodeContainersOperations as OperationClass, + ) + elif api_version == "2021-10-01-dataplanepreview": + from ..v2021_10_01_dataplanepreview.aio.operations import ( + CodeContainersOperations as OperationClass, + ) + elif api_version == "2022-02-01-preview": + from ..v2022_02_01_preview.aio.operations import ( + CodeContainersOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from ..v2022_05_01.aio.operations import ( + CodeContainersOperations as OperationClass, + ) + elif api_version == "2022-06-01-preview": + from ..v2022_06_01_preview.aio.operations import ( + CodeContainersOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from ..v2022_10_01.aio.operations import ( + CodeContainersOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from ..v2022_10_01_preview.aio.operations import ( + CodeContainersOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'code_containers'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def code_versions(self): """Instance depends on the API version: - * 2021-10-01: :class:`CodeVersionsOperations` - * 2021-10-01-dataplanepreview: :class:`CodeVersionsOperations` - * 2022-02-01-preview: :class:`CodeVersionsOperations` - * 2022-05-01: :class:`CodeVersionsOperations` - * 2022-06-01-preview: :class:`CodeVersionsOperations` - * 2022-10-01: :class:`CodeVersionsOperations` - * 2022-10-01-preview: :class:`CodeVersionsOperations` - """ - api_version = self._get_api_version('code_versions') - if api_version == '2021-10-01': - from ..v2021_10_01.aio.operations import CodeVersionsOperations as OperationClass - elif api_version == '2021-10-01-dataplanepreview': - from ..v2021_10_01_dataplanepreview.aio.operations import CodeVersionsOperations as OperationClass - elif api_version == '2022-02-01-preview': - from ..v2022_02_01_preview.aio.operations import CodeVersionsOperations as OperationClass - elif api_version == '2022-05-01': - from ..v2022_05_01.aio.operations import CodeVersionsOperations as OperationClass - elif api_version == '2022-06-01-preview': - from ..v2022_06_01_preview.aio.operations import CodeVersionsOperations as OperationClass - elif api_version == '2022-10-01': - from ..v2022_10_01.aio.operations import CodeVersionsOperations as OperationClass - elif api_version == '2022-10-01-preview': - from ..v2022_10_01_preview.aio.operations import CodeVersionsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'code_versions'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`CodeVersionsOperations` + * 2021-10-01-dataplanepreview: :class:`CodeVersionsOperations` + * 2022-02-01-preview: :class:`CodeVersionsOperations` + * 2022-05-01: :class:`CodeVersionsOperations` + * 2022-06-01-preview: :class:`CodeVersionsOperations` + * 2022-10-01: :class:`CodeVersionsOperations` + * 2022-10-01-preview: :class:`CodeVersionsOperations` + """ + api_version = self._get_api_version("code_versions") + if api_version == "2021-10-01": + from ..v2021_10_01.aio.operations import ( + CodeVersionsOperations as OperationClass, + ) + elif api_version == "2021-10-01-dataplanepreview": + from ..v2021_10_01_dataplanepreview.aio.operations import ( + CodeVersionsOperations as OperationClass, + ) + elif api_version == "2022-02-01-preview": + from ..v2022_02_01_preview.aio.operations import ( + CodeVersionsOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from ..v2022_05_01.aio.operations import ( + CodeVersionsOperations as OperationClass, + ) + elif api_version == "2022-06-01-preview": + from ..v2022_06_01_preview.aio.operations import ( + CodeVersionsOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from ..v2022_10_01.aio.operations import ( + CodeVersionsOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from ..v2022_10_01_preview.aio.operations import ( + CodeVersionsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'code_versions'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def component_containers(self): """Instance depends on the API version: - * 2021-10-01: :class:`ComponentContainersOperations` - * 2021-10-01-dataplanepreview: :class:`ComponentContainersOperations` - * 2022-02-01-preview: :class:`ComponentContainersOperations` - * 2022-05-01: :class:`ComponentContainersOperations` - * 2022-06-01-preview: :class:`ComponentContainersOperations` - * 2022-10-01: :class:`ComponentContainersOperations` - * 2022-10-01-preview: :class:`ComponentContainersOperations` - """ - api_version = self._get_api_version('component_containers') - if api_version == '2021-10-01': - from ..v2021_10_01.aio.operations import ComponentContainersOperations as OperationClass - elif api_version == '2021-10-01-dataplanepreview': - from ..v2021_10_01_dataplanepreview.aio.operations import ComponentContainersOperations as OperationClass - elif api_version == '2022-02-01-preview': - from ..v2022_02_01_preview.aio.operations import ComponentContainersOperations as OperationClass - elif api_version == '2022-05-01': - from ..v2022_05_01.aio.operations import ComponentContainersOperations as OperationClass - elif api_version == '2022-06-01-preview': - from ..v2022_06_01_preview.aio.operations import ComponentContainersOperations as OperationClass - elif api_version == '2022-10-01': - from ..v2022_10_01.aio.operations import ComponentContainersOperations as OperationClass - elif api_version == '2022-10-01-preview': - from ..v2022_10_01_preview.aio.operations import ComponentContainersOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'component_containers'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`ComponentContainersOperations` + * 2021-10-01-dataplanepreview: :class:`ComponentContainersOperations` + * 2022-02-01-preview: :class:`ComponentContainersOperations` + * 2022-05-01: :class:`ComponentContainersOperations` + * 2022-06-01-preview: :class:`ComponentContainersOperations` + * 2022-10-01: :class:`ComponentContainersOperations` + * 2022-10-01-preview: :class:`ComponentContainersOperations` + """ + api_version = self._get_api_version("component_containers") + if api_version == "2021-10-01": + from ..v2021_10_01.aio.operations import ( + ComponentContainersOperations as OperationClass, + ) + elif api_version == "2021-10-01-dataplanepreview": + from ..v2021_10_01_dataplanepreview.aio.operations import ( + ComponentContainersOperations as OperationClass, + ) + elif api_version == "2022-02-01-preview": + from ..v2022_02_01_preview.aio.operations import ( + ComponentContainersOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from ..v2022_05_01.aio.operations import ( + ComponentContainersOperations as OperationClass, + ) + elif api_version == "2022-06-01-preview": + from ..v2022_06_01_preview.aio.operations import ( + ComponentContainersOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from ..v2022_10_01.aio.operations import ( + ComponentContainersOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from ..v2022_10_01_preview.aio.operations import ( + ComponentContainersOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'component_containers'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def component_versions(self): """Instance depends on the API version: - * 2021-10-01: :class:`ComponentVersionsOperations` - * 2021-10-01-dataplanepreview: :class:`ComponentVersionsOperations` - * 2022-02-01-preview: :class:`ComponentVersionsOperations` - * 2022-05-01: :class:`ComponentVersionsOperations` - * 2022-06-01-preview: :class:`ComponentVersionsOperations` - * 2022-10-01: :class:`ComponentVersionsOperations` - * 2022-10-01-preview: :class:`ComponentVersionsOperations` - """ - api_version = self._get_api_version('component_versions') - if api_version == '2021-10-01': - from ..v2021_10_01.aio.operations import ComponentVersionsOperations as OperationClass - elif api_version == '2021-10-01-dataplanepreview': - from ..v2021_10_01_dataplanepreview.aio.operations import ComponentVersionsOperations as OperationClass - elif api_version == '2022-02-01-preview': - from ..v2022_02_01_preview.aio.operations import ComponentVersionsOperations as OperationClass - elif api_version == '2022-05-01': - from ..v2022_05_01.aio.operations import ComponentVersionsOperations as OperationClass - elif api_version == '2022-06-01-preview': - from ..v2022_06_01_preview.aio.operations import ComponentVersionsOperations as OperationClass - elif api_version == '2022-10-01': - from ..v2022_10_01.aio.operations import ComponentVersionsOperations as OperationClass - elif api_version == '2022-10-01-preview': - from ..v2022_10_01_preview.aio.operations import ComponentVersionsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'component_versions'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`ComponentVersionsOperations` + * 2021-10-01-dataplanepreview: :class:`ComponentVersionsOperations` + * 2022-02-01-preview: :class:`ComponentVersionsOperations` + * 2022-05-01: :class:`ComponentVersionsOperations` + * 2022-06-01-preview: :class:`ComponentVersionsOperations` + * 2022-10-01: :class:`ComponentVersionsOperations` + * 2022-10-01-preview: :class:`ComponentVersionsOperations` + """ + api_version = self._get_api_version("component_versions") + if api_version == "2021-10-01": + from ..v2021_10_01.aio.operations import ( + ComponentVersionsOperations as OperationClass, + ) + elif api_version == "2021-10-01-dataplanepreview": + from ..v2021_10_01_dataplanepreview.aio.operations import ( + ComponentVersionsOperations as OperationClass, + ) + elif api_version == "2022-02-01-preview": + from ..v2022_02_01_preview.aio.operations import ( + ComponentVersionsOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from ..v2022_05_01.aio.operations import ( + ComponentVersionsOperations as OperationClass, + ) + elif api_version == "2022-06-01-preview": + from ..v2022_06_01_preview.aio.operations import ( + ComponentVersionsOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from ..v2022_10_01.aio.operations import ( + ComponentVersionsOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from ..v2022_10_01_preview.aio.operations import ( + ComponentVersionsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'component_versions'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def compute(self): """Instance depends on the API version: - * 2021-10-01: :class:`ComputeOperations` - * 2022-01-01-preview: :class:`ComputeOperations` - * 2022-05-01: :class:`ComputeOperations` - * 2022-10-01: :class:`ComputeOperations` - * 2022-10-01-preview: :class:`ComputeOperations` - """ - api_version = self._get_api_version('compute') - if api_version == '2021-10-01': - from ..v2021_10_01.aio.operations import ComputeOperations as OperationClass - elif api_version == '2022-01-01-preview': - from ..v2022_01_01_preview.aio.operations import ComputeOperations as OperationClass - elif api_version == '2022-05-01': - from ..v2022_05_01.aio.operations import ComputeOperations as OperationClass - elif api_version == '2022-10-01': - from ..v2022_10_01.aio.operations import ComputeOperations as OperationClass - elif api_version == '2022-10-01-preview': - from ..v2022_10_01_preview.aio.operations import ComputeOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'compute'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`ComputeOperations` + * 2022-01-01-preview: :class:`ComputeOperations` + * 2022-05-01: :class:`ComputeOperations` + * 2022-10-01: :class:`ComputeOperations` + * 2022-10-01-preview: :class:`ComputeOperations` + """ + api_version = self._get_api_version("compute") + if api_version == "2021-10-01": + from ..v2021_10_01.aio.operations import ( + ComputeOperations as OperationClass, + ) + elif api_version == "2022-01-01-preview": + from ..v2022_01_01_preview.aio.operations import ( + ComputeOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from ..v2022_05_01.aio.operations import ( + ComputeOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from ..v2022_10_01.aio.operations import ( + ComputeOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from ..v2022_10_01_preview.aio.operations import ( + ComputeOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'compute'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def data_call(self): """Instance depends on the API version: - * 1.5.0: :class:`DataCallOperations` - """ - api_version = self._get_api_version('data_call') - if api_version == '1.5.0': - from ..dataset_dataplane.aio.operations import DataCallOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'data_call'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 1.5.0: :class:`DataCallOperations` + """ + api_version = self._get_api_version("data_call") + if api_version == "1.5.0": + from ..dataset_dataplane.aio.operations import ( + DataCallOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'data_call'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def data_container(self): """Instance depends on the API version: - * 1.5.0: :class:`DataContainerOperations` - """ - api_version = self._get_api_version('data_container') - if api_version == '1.5.0': - from ..dataset_dataplane.aio.operations import DataContainerOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'data_container'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 1.5.0: :class:`DataContainerOperations` + """ + api_version = self._get_api_version("data_container") + if api_version == "1.5.0": + from ..dataset_dataplane.aio.operations import ( + DataContainerOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'data_container'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def data_containers(self): """Instance depends on the API version: - * 2021-10-01-dataplanepreview: :class:`DataContainersOperations` - * 2022-02-01-preview: :class:`DataContainersOperations` - * 2022-05-01: :class:`DataContainersOperations` - * 2022-06-01-preview: :class:`DataContainersOperations` - * 2022-10-01: :class:`DataContainersOperations` - * 2022-10-01-preview: :class:`DataContainersOperations` - """ - api_version = self._get_api_version('data_containers') - if api_version == '2021-10-01-dataplanepreview': - from ..v2021_10_01_dataplanepreview.aio.operations import DataContainersOperations as OperationClass - elif api_version == '2022-02-01-preview': - from ..v2022_02_01_preview.aio.operations import DataContainersOperations as OperationClass - elif api_version == '2022-05-01': - from ..v2022_05_01.aio.operations import DataContainersOperations as OperationClass - elif api_version == '2022-06-01-preview': - from ..v2022_06_01_preview.aio.operations import DataContainersOperations as OperationClass - elif api_version == '2022-10-01': - from ..v2022_10_01.aio.operations import DataContainersOperations as OperationClass - elif api_version == '2022-10-01-preview': - from ..v2022_10_01_preview.aio.operations import DataContainersOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'data_containers'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01-dataplanepreview: :class:`DataContainersOperations` + * 2022-02-01-preview: :class:`DataContainersOperations` + * 2022-05-01: :class:`DataContainersOperations` + * 2022-06-01-preview: :class:`DataContainersOperations` + * 2022-10-01: :class:`DataContainersOperations` + * 2022-10-01-preview: :class:`DataContainersOperations` + """ + api_version = self._get_api_version("data_containers") + if api_version == "2021-10-01-dataplanepreview": + from ..v2021_10_01_dataplanepreview.aio.operations import ( + DataContainersOperations as OperationClass, + ) + elif api_version == "2022-02-01-preview": + from ..v2022_02_01_preview.aio.operations import ( + DataContainersOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from ..v2022_05_01.aio.operations import ( + DataContainersOperations as OperationClass, + ) + elif api_version == "2022-06-01-preview": + from ..v2022_06_01_preview.aio.operations import ( + DataContainersOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from ..v2022_10_01.aio.operations import ( + DataContainersOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from ..v2022_10_01_preview.aio.operations import ( + DataContainersOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'data_containers'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def data_references(self): """Instance depends on the API version: - * 2021-10-01-dataplanepreview: :class:`DataReferencesOperations` - """ - api_version = self._get_api_version('data_references') - if api_version == '2021-10-01-dataplanepreview': - from ..v2021_10_01_dataplanepreview.aio.operations import DataReferencesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'data_references'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01-dataplanepreview: :class:`DataReferencesOperations` + """ + api_version = self._get_api_version("data_references") + if api_version == "2021-10-01-dataplanepreview": + from ..v2021_10_01_dataplanepreview.aio.operations import ( + DataReferencesOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'data_references'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def data_version(self): """Instance depends on the API version: - * 1.5.0: :class:`DataVersionOperations` - """ - api_version = self._get_api_version('data_version') - if api_version == '1.5.0': - from ..dataset_dataplane.aio.operations import DataVersionOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'data_version'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 1.5.0: :class:`DataVersionOperations` + """ + api_version = self._get_api_version("data_version") + if api_version == "1.5.0": + from ..dataset_dataplane.aio.operations import ( + DataVersionOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'data_version'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def data_versions(self): """Instance depends on the API version: - * 2021-10-01-dataplanepreview: :class:`DataVersionsOperations` - * 2022-02-01-preview: :class:`DataVersionsOperations` - * 2022-05-01: :class:`DataVersionsOperations` - * 2022-06-01-preview: :class:`DataVersionsOperations` - * 2022-10-01: :class:`DataVersionsOperations` - * 2022-10-01-preview: :class:`DataVersionsOperations` - """ - api_version = self._get_api_version('data_versions') - if api_version == '2021-10-01-dataplanepreview': - from ..v2021_10_01_dataplanepreview.aio.operations import DataVersionsOperations as OperationClass - elif api_version == '2022-02-01-preview': - from ..v2022_02_01_preview.aio.operations import DataVersionsOperations as OperationClass - elif api_version == '2022-05-01': - from ..v2022_05_01.aio.operations import DataVersionsOperations as OperationClass - elif api_version == '2022-06-01-preview': - from ..v2022_06_01_preview.aio.operations import DataVersionsOperations as OperationClass - elif api_version == '2022-10-01': - from ..v2022_10_01.aio.operations import DataVersionsOperations as OperationClass - elif api_version == '2022-10-01-preview': - from ..v2022_10_01_preview.aio.operations import DataVersionsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'data_versions'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01-dataplanepreview: :class:`DataVersionsOperations` + * 2022-02-01-preview: :class:`DataVersionsOperations` + * 2022-05-01: :class:`DataVersionsOperations` + * 2022-06-01-preview: :class:`DataVersionsOperations` + * 2022-10-01: :class:`DataVersionsOperations` + * 2022-10-01-preview: :class:`DataVersionsOperations` + """ + api_version = self._get_api_version("data_versions") + if api_version == "2021-10-01-dataplanepreview": + from ..v2021_10_01_dataplanepreview.aio.operations import ( + DataVersionsOperations as OperationClass, + ) + elif api_version == "2022-02-01-preview": + from ..v2022_02_01_preview.aio.operations import ( + DataVersionsOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from ..v2022_05_01.aio.operations import ( + DataVersionsOperations as OperationClass, + ) + elif api_version == "2022-06-01-preview": + from ..v2022_06_01_preview.aio.operations import ( + DataVersionsOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from ..v2022_10_01.aio.operations import ( + DataVersionsOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from ..v2022_10_01_preview.aio.operations import ( + DataVersionsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'data_versions'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def dataset_containers(self): """Instance depends on the API version: - * 2021-10-01: :class:`DatasetContainersOperations` - """ - api_version = self._get_api_version('dataset_containers') - if api_version == '2021-10-01': - from ..v2021_10_01.aio.operations import DatasetContainersOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'dataset_containers'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`DatasetContainersOperations` + """ + api_version = self._get_api_version("dataset_containers") + if api_version == "2021-10-01": + from ..v2021_10_01.aio.operations import ( + DatasetContainersOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'dataset_containers'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def dataset_controller_v2(self): """Instance depends on the API version: - * 1.5.0: :class:`DatasetControllerV2Operations` - """ - api_version = self._get_api_version('dataset_controller_v2') - if api_version == '1.5.0': - from ..dataset_dataplane.aio.operations import DatasetControllerV2Operations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'dataset_controller_v2'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 1.5.0: :class:`DatasetControllerV2Operations` + """ + api_version = self._get_api_version("dataset_controller_v2") + if api_version == "1.5.0": + from ..dataset_dataplane.aio.operations import ( + DatasetControllerV2Operations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'dataset_controller_v2'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def dataset_v2(self): """Instance depends on the API version: - * 1.5.0: :class:`DatasetV2Operations` - """ - api_version = self._get_api_version('dataset_v2') - if api_version == '1.5.0': - from ..dataset_dataplane.aio.operations import DatasetV2Operations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'dataset_v2'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 1.5.0: :class:`DatasetV2Operations` + """ + api_version = self._get_api_version("dataset_v2") + if api_version == "1.5.0": + from ..dataset_dataplane.aio.operations import ( + DatasetV2Operations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'dataset_v2'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def dataset_versions(self): """Instance depends on the API version: - * 2021-10-01: :class:`DatasetVersionsOperations` - """ - api_version = self._get_api_version('dataset_versions') - if api_version == '2021-10-01': - from ..v2021_10_01.aio.operations import DatasetVersionsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'dataset_versions'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`DatasetVersionsOperations` + """ + api_version = self._get_api_version("dataset_versions") + if api_version == "2021-10-01": + from ..v2021_10_01.aio.operations import ( + DatasetVersionsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'dataset_versions'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def datasets_v1(self): """Instance depends on the API version: - * 1.5.0: :class:`DatasetsV1Operations` - """ - api_version = self._get_api_version('datasets_v1') - if api_version == '1.5.0': - from ..dataset_dataplane.aio.operations import DatasetsV1Operations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'datasets_v1'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 1.5.0: :class:`DatasetsV1Operations` + """ + api_version = self._get_api_version("datasets_v1") + if api_version == "1.5.0": + from ..dataset_dataplane.aio.operations import ( + DatasetsV1Operations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'datasets_v1'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def datastores(self): """Instance depends on the API version: - * 2021-10-01: :class:`DatastoresOperations` - * 2022-02-01-preview: :class:`DatastoresOperations` - * 2022-05-01: :class:`DatastoresOperations` - * 2022-06-01-preview: :class:`DatastoresOperations` - * 2022-10-01: :class:`DatastoresOperations` - * 2022-10-01-preview: :class:`DatastoresOperations` - """ - api_version = self._get_api_version('datastores') - if api_version == '2021-10-01': - from ..v2021_10_01.aio.operations import DatastoresOperations as OperationClass - elif api_version == '2022-02-01-preview': - from ..v2022_02_01_preview.aio.operations import DatastoresOperations as OperationClass - elif api_version == '2022-05-01': - from ..v2022_05_01.aio.operations import DatastoresOperations as OperationClass - elif api_version == '2022-06-01-preview': - from ..v2022_06_01_preview.aio.operations import DatastoresOperations as OperationClass - elif api_version == '2022-10-01': - from ..v2022_10_01.aio.operations import DatastoresOperations as OperationClass - elif api_version == '2022-10-01-preview': - from ..v2022_10_01_preview.aio.operations import DatastoresOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'datastores'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`DatastoresOperations` + * 2022-02-01-preview: :class:`DatastoresOperations` + * 2022-05-01: :class:`DatastoresOperations` + * 2022-06-01-preview: :class:`DatastoresOperations` + * 2022-10-01: :class:`DatastoresOperations` + * 2022-10-01-preview: :class:`DatastoresOperations` + """ + api_version = self._get_api_version("datastores") + if api_version == "2021-10-01": + from ..v2021_10_01.aio.operations import ( + DatastoresOperations as OperationClass, + ) + elif api_version == "2022-02-01-preview": + from ..v2022_02_01_preview.aio.operations import ( + DatastoresOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from ..v2022_05_01.aio.operations import ( + DatastoresOperations as OperationClass, + ) + elif api_version == "2022-06-01-preview": + from ..v2022_06_01_preview.aio.operations import ( + DatastoresOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from ..v2022_10_01.aio.operations import ( + DatastoresOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from ..v2022_10_01_preview.aio.operations import ( + DatastoresOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'datastores'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def delete(self): """Instance depends on the API version: - * 1.5.0: :class:`DeleteOperations` - * v1.0: :class:`DeleteOperations` - """ - api_version = self._get_api_version('delete') - if api_version == '1.5.0': - from ..dataset_dataplane.aio.operations import DeleteOperations as OperationClass - elif api_version == 'v1.0': - from ..runhistory.aio.operations import DeleteOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'delete'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 1.5.0: :class:`DeleteOperations` + * v1.0: :class:`DeleteOperations` + """ + api_version = self._get_api_version("delete") + if api_version == "1.5.0": + from ..dataset_dataplane.aio.operations import ( + DeleteOperations as OperationClass, + ) + elif api_version == "v1.0": + from ..runhistory.aio.operations import ( + DeleteOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'delete'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def environment_containers(self): """Instance depends on the API version: - * 2021-10-01: :class:`EnvironmentContainersOperations` - * 2021-10-01-dataplanepreview: :class:`EnvironmentContainersOperations` - * 2022-02-01-preview: :class:`EnvironmentContainersOperations` - * 2022-05-01: :class:`EnvironmentContainersOperations` - * 2022-06-01-preview: :class:`EnvironmentContainersOperations` - * 2022-10-01: :class:`EnvironmentContainersOperations` - * 2022-10-01-preview: :class:`EnvironmentContainersOperations` - """ - api_version = self._get_api_version('environment_containers') - if api_version == '2021-10-01': - from ..v2021_10_01.aio.operations import EnvironmentContainersOperations as OperationClass - elif api_version == '2021-10-01-dataplanepreview': - from ..v2021_10_01_dataplanepreview.aio.operations import EnvironmentContainersOperations as OperationClass - elif api_version == '2022-02-01-preview': - from ..v2022_02_01_preview.aio.operations import EnvironmentContainersOperations as OperationClass - elif api_version == '2022-05-01': - from ..v2022_05_01.aio.operations import EnvironmentContainersOperations as OperationClass - elif api_version == '2022-06-01-preview': - from ..v2022_06_01_preview.aio.operations import EnvironmentContainersOperations as OperationClass - elif api_version == '2022-10-01': - from ..v2022_10_01.aio.operations import EnvironmentContainersOperations as OperationClass - elif api_version == '2022-10-01-preview': - from ..v2022_10_01_preview.aio.operations import EnvironmentContainersOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'environment_containers'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`EnvironmentContainersOperations` + * 2021-10-01-dataplanepreview: :class:`EnvironmentContainersOperations` + * 2022-02-01-preview: :class:`EnvironmentContainersOperations` + * 2022-05-01: :class:`EnvironmentContainersOperations` + * 2022-06-01-preview: :class:`EnvironmentContainersOperations` + * 2022-10-01: :class:`EnvironmentContainersOperations` + * 2022-10-01-preview: :class:`EnvironmentContainersOperations` + """ + api_version = self._get_api_version("environment_containers") + if api_version == "2021-10-01": + from ..v2021_10_01.aio.operations import ( + EnvironmentContainersOperations as OperationClass, + ) + elif api_version == "2021-10-01-dataplanepreview": + from ..v2021_10_01_dataplanepreview.aio.operations import ( + EnvironmentContainersOperations as OperationClass, + ) + elif api_version == "2022-02-01-preview": + from ..v2022_02_01_preview.aio.operations import ( + EnvironmentContainersOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from ..v2022_05_01.aio.operations import ( + EnvironmentContainersOperations as OperationClass, + ) + elif api_version == "2022-06-01-preview": + from ..v2022_06_01_preview.aio.operations import ( + EnvironmentContainersOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from ..v2022_10_01.aio.operations import ( + EnvironmentContainersOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from ..v2022_10_01_preview.aio.operations import ( + EnvironmentContainersOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'environment_containers'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def environment_versions(self): """Instance depends on the API version: - * 2021-10-01: :class:`EnvironmentVersionsOperations` - * 2021-10-01-dataplanepreview: :class:`EnvironmentVersionsOperations` - * 2022-02-01-preview: :class:`EnvironmentVersionsOperations` - * 2022-05-01: :class:`EnvironmentVersionsOperations` - * 2022-06-01-preview: :class:`EnvironmentVersionsOperations` - * 2022-10-01: :class:`EnvironmentVersionsOperations` - * 2022-10-01-preview: :class:`EnvironmentVersionsOperations` - """ - api_version = self._get_api_version('environment_versions') - if api_version == '2021-10-01': - from ..v2021_10_01.aio.operations import EnvironmentVersionsOperations as OperationClass - elif api_version == '2021-10-01-dataplanepreview': - from ..v2021_10_01_dataplanepreview.aio.operations import EnvironmentVersionsOperations as OperationClass - elif api_version == '2022-02-01-preview': - from ..v2022_02_01_preview.aio.operations import EnvironmentVersionsOperations as OperationClass - elif api_version == '2022-05-01': - from ..v2022_05_01.aio.operations import EnvironmentVersionsOperations as OperationClass - elif api_version == '2022-06-01-preview': - from ..v2022_06_01_preview.aio.operations import EnvironmentVersionsOperations as OperationClass - elif api_version == '2022-10-01': - from ..v2022_10_01.aio.operations import EnvironmentVersionsOperations as OperationClass - elif api_version == '2022-10-01-preview': - from ..v2022_10_01_preview.aio.operations import EnvironmentVersionsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'environment_versions'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`EnvironmentVersionsOperations` + * 2021-10-01-dataplanepreview: :class:`EnvironmentVersionsOperations` + * 2022-02-01-preview: :class:`EnvironmentVersionsOperations` + * 2022-05-01: :class:`EnvironmentVersionsOperations` + * 2022-06-01-preview: :class:`EnvironmentVersionsOperations` + * 2022-10-01: :class:`EnvironmentVersionsOperations` + * 2022-10-01-preview: :class:`EnvironmentVersionsOperations` + """ + api_version = self._get_api_version("environment_versions") + if api_version == "2021-10-01": + from ..v2021_10_01.aio.operations import ( + EnvironmentVersionsOperations as OperationClass, + ) + elif api_version == "2021-10-01-dataplanepreview": + from ..v2021_10_01_dataplanepreview.aio.operations import ( + EnvironmentVersionsOperations as OperationClass, + ) + elif api_version == "2022-02-01-preview": + from ..v2022_02_01_preview.aio.operations import ( + EnvironmentVersionsOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from ..v2022_05_01.aio.operations import ( + EnvironmentVersionsOperations as OperationClass, + ) + elif api_version == "2022-06-01-preview": + from ..v2022_06_01_preview.aio.operations import ( + EnvironmentVersionsOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from ..v2022_10_01.aio.operations import ( + EnvironmentVersionsOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from ..v2022_10_01_preview.aio.operations import ( + EnvironmentVersionsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'environment_versions'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def events(self): """Instance depends on the API version: - * v1.0: :class:`EventsOperations` - """ - api_version = self._get_api_version('events') - if api_version == 'v1.0': - from ..runhistory.aio.operations import EventsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'events'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * v1.0: :class:`EventsOperations` + """ + api_version = self._get_api_version("events") + if api_version == "v1.0": + from ..runhistory.aio.operations import ( + EventsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'events'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def experiments(self): """Instance depends on the API version: - * v1.0: :class:`ExperimentsOperations` - """ - api_version = self._get_api_version('experiments') - if api_version == 'v1.0': - from ..runhistory.aio.operations import ExperimentsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'experiments'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * v1.0: :class:`ExperimentsOperations` + """ + api_version = self._get_api_version("experiments") + if api_version == "v1.0": + from ..runhistory.aio.operations import ( + ExperimentsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'experiments'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def extensive_model(self): """Instance depends on the API version: - * 1.0.0: :class:`ExtensiveModelOperations` - """ - api_version = self._get_api_version('extensive_model') - if api_version == '1.0.0': - from ..model_dataplane.aio.operations import ExtensiveModelOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'extensive_model'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 1.0.0: :class:`ExtensiveModelOperations` + """ + api_version = self._get_api_version("extensive_model") + if api_version == "1.0.0": + from ..model_dataplane.aio.operations import ( + ExtensiveModelOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'extensive_model'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def get_operation_status(self): """Instance depends on the API version: - * 1.5.0: :class:`GetOperationStatusOperations` - """ - api_version = self._get_api_version('get_operation_status') - if api_version == '1.5.0': - from ..dataset_dataplane.aio.operations import GetOperationStatusOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'get_operation_status'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 1.5.0: :class:`GetOperationStatusOperations` + """ + api_version = self._get_api_version("get_operation_status") + if api_version == "1.5.0": + from ..dataset_dataplane.aio.operations import ( + GetOperationStatusOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'get_operation_status'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def jobs(self): """Instance depends on the API version: - * 2021-10-01: :class:`JobsOperations` - * 2022-02-01-preview: :class:`JobsOperations` - * 2022-05-01: :class:`JobsOperations` - * 2022-06-01-preview: :class:`JobsOperations` - * 2022-10-01: :class:`JobsOperations` - * 2022-10-01-preview: :class:`JobsOperations` - """ - api_version = self._get_api_version('jobs') - if api_version == '2021-10-01': - from ..v2021_10_01.aio.operations import JobsOperations as OperationClass - elif api_version == '2022-02-01-preview': - from ..v2022_02_01_preview.aio.operations import JobsOperations as OperationClass - elif api_version == '2022-05-01': - from ..v2022_05_01.aio.operations import JobsOperations as OperationClass - elif api_version == '2022-06-01-preview': - from ..v2022_06_01_preview.aio.operations import JobsOperations as OperationClass - elif api_version == '2022-10-01': - from ..v2022_10_01.aio.operations import JobsOperations as OperationClass - elif api_version == '2022-10-01-preview': - from ..v2022_10_01_preview.aio.operations import JobsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'jobs'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`JobsOperations` + * 2022-02-01-preview: :class:`JobsOperations` + * 2022-05-01: :class:`JobsOperations` + * 2022-06-01-preview: :class:`JobsOperations` + * 2022-10-01: :class:`JobsOperations` + * 2022-10-01-preview: :class:`JobsOperations` + """ + api_version = self._get_api_version("jobs") + if api_version == "2021-10-01": + from ..v2021_10_01.aio.operations import ( + JobsOperations as OperationClass, + ) + elif api_version == "2022-02-01-preview": + from ..v2022_02_01_preview.aio.operations import ( + JobsOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from ..v2022_05_01.aio.operations import ( + JobsOperations as OperationClass, + ) + elif api_version == "2022-06-01-preview": + from ..v2022_06_01_preview.aio.operations import ( + JobsOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from ..v2022_10_01.aio.operations import ( + JobsOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from ..v2022_10_01_preview.aio.operations import ( + JobsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'jobs'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def labeling_jobs(self): """Instance depends on the API version: - * 2022-06-01-preview: :class:`LabelingJobsOperations` - * 2022-10-01-preview: :class:`LabelingJobsOperations` - """ - api_version = self._get_api_version('labeling_jobs') - if api_version == '2022-06-01-preview': - from ..v2022_06_01_preview.aio.operations import LabelingJobsOperations as OperationClass - elif api_version == '2022-10-01-preview': - from ..v2022_10_01_preview.aio.operations import LabelingJobsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'labeling_jobs'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2022-06-01-preview: :class:`LabelingJobsOperations` + * 2022-10-01-preview: :class:`LabelingJobsOperations` + """ + api_version = self._get_api_version("labeling_jobs") + if api_version == "2022-06-01-preview": + from ..v2022_06_01_preview.aio.operations import ( + LabelingJobsOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from ..v2022_10_01_preview.aio.operations import ( + LabelingJobsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'labeling_jobs'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def metric(self): """Instance depends on the API version: - * v1.0: :class:`MetricOperations` - """ - api_version = self._get_api_version('metric') - if api_version == 'v1.0': - from ..runhistory.aio.operations import MetricOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'metric'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * v1.0: :class:`MetricOperations` + """ + api_version = self._get_api_version("metric") + if api_version == "v1.0": + from ..runhistory.aio.operations import ( + MetricOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'metric'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def migration(self): """Instance depends on the API version: - * 1.0.0: :class:`MigrationOperations` - """ - api_version = self._get_api_version('migration') - if api_version == '1.0.0': - from ..model_dataplane.aio.operations import MigrationOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'migration'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 1.0.0: :class:`MigrationOperations` + """ + api_version = self._get_api_version("migration") + if api_version == "1.0.0": + from ..model_dataplane.aio.operations import ( + MigrationOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'migration'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def model_containers(self): """Instance depends on the API version: - * 2021-10-01: :class:`ModelContainersOperations` - * 2021-10-01-dataplanepreview: :class:`ModelContainersOperations` - * 2022-02-01-preview: :class:`ModelContainersOperations` - * 2022-05-01: :class:`ModelContainersOperations` - * 2022-06-01-preview: :class:`ModelContainersOperations` - * 2022-10-01: :class:`ModelContainersOperations` - * 2022-10-01-preview: :class:`ModelContainersOperations` - """ - api_version = self._get_api_version('model_containers') - if api_version == '2021-10-01': - from ..v2021_10_01.aio.operations import ModelContainersOperations as OperationClass - elif api_version == '2021-10-01-dataplanepreview': - from ..v2021_10_01_dataplanepreview.aio.operations import ModelContainersOperations as OperationClass - elif api_version == '2022-02-01-preview': - from ..v2022_02_01_preview.aio.operations import ModelContainersOperations as OperationClass - elif api_version == '2022-05-01': - from ..v2022_05_01.aio.operations import ModelContainersOperations as OperationClass - elif api_version == '2022-06-01-preview': - from ..v2022_06_01_preview.aio.operations import ModelContainersOperations as OperationClass - elif api_version == '2022-10-01': - from ..v2022_10_01.aio.operations import ModelContainersOperations as OperationClass - elif api_version == '2022-10-01-preview': - from ..v2022_10_01_preview.aio.operations import ModelContainersOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'model_containers'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`ModelContainersOperations` + * 2021-10-01-dataplanepreview: :class:`ModelContainersOperations` + * 2022-02-01-preview: :class:`ModelContainersOperations` + * 2022-05-01: :class:`ModelContainersOperations` + * 2022-06-01-preview: :class:`ModelContainersOperations` + * 2022-10-01: :class:`ModelContainersOperations` + * 2022-10-01-preview: :class:`ModelContainersOperations` + """ + api_version = self._get_api_version("model_containers") + if api_version == "2021-10-01": + from ..v2021_10_01.aio.operations import ( + ModelContainersOperations as OperationClass, + ) + elif api_version == "2021-10-01-dataplanepreview": + from ..v2021_10_01_dataplanepreview.aio.operations import ( + ModelContainersOperations as OperationClass, + ) + elif api_version == "2022-02-01-preview": + from ..v2022_02_01_preview.aio.operations import ( + ModelContainersOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from ..v2022_05_01.aio.operations import ( + ModelContainersOperations as OperationClass, + ) + elif api_version == "2022-06-01-preview": + from ..v2022_06_01_preview.aio.operations import ( + ModelContainersOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from ..v2022_10_01.aio.operations import ( + ModelContainersOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from ..v2022_10_01_preview.aio.operations import ( + ModelContainersOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'model_containers'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def model_versions(self): """Instance depends on the API version: - * 2021-10-01: :class:`ModelVersionsOperations` - * 2021-10-01-dataplanepreview: :class:`ModelVersionsOperations` - * 2022-02-01-preview: :class:`ModelVersionsOperations` - * 2022-05-01: :class:`ModelVersionsOperations` - * 2022-06-01-preview: :class:`ModelVersionsOperations` - * 2022-10-01: :class:`ModelVersionsOperations` - * 2022-10-01-preview: :class:`ModelVersionsOperations` - """ - api_version = self._get_api_version('model_versions') - if api_version == '2021-10-01': - from ..v2021_10_01.aio.operations import ModelVersionsOperations as OperationClass - elif api_version == '2021-10-01-dataplanepreview': - from ..v2021_10_01_dataplanepreview.aio.operations import ModelVersionsOperations as OperationClass - elif api_version == '2022-02-01-preview': - from ..v2022_02_01_preview.aio.operations import ModelVersionsOperations as OperationClass - elif api_version == '2022-05-01': - from ..v2022_05_01.aio.operations import ModelVersionsOperations as OperationClass - elif api_version == '2022-06-01-preview': - from ..v2022_06_01_preview.aio.operations import ModelVersionsOperations as OperationClass - elif api_version == '2022-10-01': - from ..v2022_10_01.aio.operations import ModelVersionsOperations as OperationClass - elif api_version == '2022-10-01-preview': - from ..v2022_10_01_preview.aio.operations import ModelVersionsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'model_versions'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`ModelVersionsOperations` + * 2021-10-01-dataplanepreview: :class:`ModelVersionsOperations` + * 2022-02-01-preview: :class:`ModelVersionsOperations` + * 2022-05-01: :class:`ModelVersionsOperations` + * 2022-06-01-preview: :class:`ModelVersionsOperations` + * 2022-10-01: :class:`ModelVersionsOperations` + * 2022-10-01-preview: :class:`ModelVersionsOperations` + """ + api_version = self._get_api_version("model_versions") + if api_version == "2021-10-01": + from ..v2021_10_01.aio.operations import ( + ModelVersionsOperations as OperationClass, + ) + elif api_version == "2021-10-01-dataplanepreview": + from ..v2021_10_01_dataplanepreview.aio.operations import ( + ModelVersionsOperations as OperationClass, + ) + elif api_version == "2022-02-01-preview": + from ..v2022_02_01_preview.aio.operations import ( + ModelVersionsOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from ..v2022_05_01.aio.operations import ( + ModelVersionsOperations as OperationClass, + ) + elif api_version == "2022-06-01-preview": + from ..v2022_06_01_preview.aio.operations import ( + ModelVersionsOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from ..v2022_10_01.aio.operations import ( + ModelVersionsOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from ..v2022_10_01_preview.aio.operations import ( + ModelVersionsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'model_versions'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def models(self): """Instance depends on the API version: - * 1.0.0: :class:`ModelsOperations` - """ - api_version = self._get_api_version('models') - if api_version == '1.0.0': - from ..model_dataplane.aio.operations import ModelsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'models'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 1.0.0: :class:`ModelsOperations` + """ + api_version = self._get_api_version("models") + if api_version == "1.0.0": + from ..model_dataplane.aio.operations import ( + ModelsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'models'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def online_deployments(self): """Instance depends on the API version: - * 2021-10-01: :class:`OnlineDeploymentsOperations` - * 2022-02-01-preview: :class:`OnlineDeploymentsOperations` - * 2022-05-01: :class:`OnlineDeploymentsOperations` - * 2022-06-01-preview: :class:`OnlineDeploymentsOperations` - * 2022-10-01: :class:`OnlineDeploymentsOperations` - * 2022-10-01-preview: :class:`OnlineDeploymentsOperations` - """ - api_version = self._get_api_version('online_deployments') - if api_version == '2021-10-01': - from ..v2021_10_01.aio.operations import OnlineDeploymentsOperations as OperationClass - elif api_version == '2022-02-01-preview': - from ..v2022_02_01_preview.aio.operations import OnlineDeploymentsOperations as OperationClass - elif api_version == '2022-05-01': - from ..v2022_05_01.aio.operations import OnlineDeploymentsOperations as OperationClass - elif api_version == '2022-06-01-preview': - from ..v2022_06_01_preview.aio.operations import OnlineDeploymentsOperations as OperationClass - elif api_version == '2022-10-01': - from ..v2022_10_01.aio.operations import OnlineDeploymentsOperations as OperationClass - elif api_version == '2022-10-01-preview': - from ..v2022_10_01_preview.aio.operations import OnlineDeploymentsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'online_deployments'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`OnlineDeploymentsOperations` + * 2022-02-01-preview: :class:`OnlineDeploymentsOperations` + * 2022-05-01: :class:`OnlineDeploymentsOperations` + * 2022-06-01-preview: :class:`OnlineDeploymentsOperations` + * 2022-10-01: :class:`OnlineDeploymentsOperations` + * 2022-10-01-preview: :class:`OnlineDeploymentsOperations` + """ + api_version = self._get_api_version("online_deployments") + if api_version == "2021-10-01": + from ..v2021_10_01.aio.operations import ( + OnlineDeploymentsOperations as OperationClass, + ) + elif api_version == "2022-02-01-preview": + from ..v2022_02_01_preview.aio.operations import ( + OnlineDeploymentsOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from ..v2022_05_01.aio.operations import ( + OnlineDeploymentsOperations as OperationClass, + ) + elif api_version == "2022-06-01-preview": + from ..v2022_06_01_preview.aio.operations import ( + OnlineDeploymentsOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from ..v2022_10_01.aio.operations import ( + OnlineDeploymentsOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from ..v2022_10_01_preview.aio.operations import ( + OnlineDeploymentsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'online_deployments'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def online_endpoints(self): """Instance depends on the API version: - * 2021-10-01: :class:`OnlineEndpointsOperations` - * 2022-02-01-preview: :class:`OnlineEndpointsOperations` - * 2022-05-01: :class:`OnlineEndpointsOperations` - * 2022-06-01-preview: :class:`OnlineEndpointsOperations` - * 2022-10-01: :class:`OnlineEndpointsOperations` - * 2022-10-01-preview: :class:`OnlineEndpointsOperations` - """ - api_version = self._get_api_version('online_endpoints') - if api_version == '2021-10-01': - from ..v2021_10_01.aio.operations import OnlineEndpointsOperations as OperationClass - elif api_version == '2022-02-01-preview': - from ..v2022_02_01_preview.aio.operations import OnlineEndpointsOperations as OperationClass - elif api_version == '2022-05-01': - from ..v2022_05_01.aio.operations import OnlineEndpointsOperations as OperationClass - elif api_version == '2022-06-01-preview': - from ..v2022_06_01_preview.aio.operations import OnlineEndpointsOperations as OperationClass - elif api_version == '2022-10-01': - from ..v2022_10_01.aio.operations import OnlineEndpointsOperations as OperationClass - elif api_version == '2022-10-01-preview': - from ..v2022_10_01_preview.aio.operations import OnlineEndpointsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'online_endpoints'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`OnlineEndpointsOperations` + * 2022-02-01-preview: :class:`OnlineEndpointsOperations` + * 2022-05-01: :class:`OnlineEndpointsOperations` + * 2022-06-01-preview: :class:`OnlineEndpointsOperations` + * 2022-10-01: :class:`OnlineEndpointsOperations` + * 2022-10-01-preview: :class:`OnlineEndpointsOperations` + """ + api_version = self._get_api_version("online_endpoints") + if api_version == "2021-10-01": + from ..v2021_10_01.aio.operations import ( + OnlineEndpointsOperations as OperationClass, + ) + elif api_version == "2022-02-01-preview": + from ..v2022_02_01_preview.aio.operations import ( + OnlineEndpointsOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from ..v2022_05_01.aio.operations import ( + OnlineEndpointsOperations as OperationClass, + ) + elif api_version == "2022-06-01-preview": + from ..v2022_06_01_preview.aio.operations import ( + OnlineEndpointsOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from ..v2022_10_01.aio.operations import ( + OnlineEndpointsOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from ..v2022_10_01_preview.aio.operations import ( + OnlineEndpointsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'online_endpoints'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def operations(self): """Instance depends on the API version: - * 2021-10-01: :class:`Operations` - * 2022-01-01-preview: :class:`Operations` - * 2022-05-01: :class:`Operations` - * 2022-10-01: :class:`Operations` - * 2022-10-01-preview: :class:`Operations` - """ - api_version = self._get_api_version('operations') - if api_version == '2021-10-01': - from ..v2021_10_01.aio.operations import Operations as OperationClass - elif api_version == '2022-01-01-preview': - from ..v2022_01_01_preview.aio.operations import Operations as OperationClass - elif api_version == '2022-05-01': - from ..v2022_05_01.aio.operations import Operations as OperationClass - elif api_version == '2022-10-01': - from ..v2022_10_01.aio.operations import Operations as OperationClass - elif api_version == '2022-10-01-preview': - from ..v2022_10_01_preview.aio.operations import Operations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'operations'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`Operations` + * 2022-01-01-preview: :class:`Operations` + * 2022-05-01: :class:`Operations` + * 2022-10-01: :class:`Operations` + * 2022-10-01-preview: :class:`Operations` + """ + api_version = self._get_api_version("operations") + if api_version == "2021-10-01": + from ..v2021_10_01.aio.operations import ( + Operations as OperationClass, + ) + elif api_version == "2022-01-01-preview": + from ..v2022_01_01_preview.aio.operations import ( + Operations as OperationClass, + ) + elif api_version == "2022-05-01": + from ..v2022_05_01.aio.operations import ( + Operations as OperationClass, + ) + elif api_version == "2022-10-01": + from ..v2022_10_01.aio.operations import ( + Operations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from ..v2022_10_01_preview.aio.operations import ( + Operations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'operations'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def private_endpoint_connections(self): """Instance depends on the API version: - * 2021-10-01: :class:`PrivateEndpointConnectionsOperations` - * 2022-01-01-preview: :class:`PrivateEndpointConnectionsOperations` - * 2022-05-01: :class:`PrivateEndpointConnectionsOperations` - * 2022-10-01: :class:`PrivateEndpointConnectionsOperations` - * 2022-10-01-preview: :class:`PrivateEndpointConnectionsOperations` - """ - api_version = self._get_api_version('private_endpoint_connections') - if api_version == '2021-10-01': - from ..v2021_10_01.aio.operations import PrivateEndpointConnectionsOperations as OperationClass - elif api_version == '2022-01-01-preview': - from ..v2022_01_01_preview.aio.operations import PrivateEndpointConnectionsOperations as OperationClass - elif api_version == '2022-05-01': - from ..v2022_05_01.aio.operations import PrivateEndpointConnectionsOperations as OperationClass - elif api_version == '2022-10-01': - from ..v2022_10_01.aio.operations import PrivateEndpointConnectionsOperations as OperationClass - elif api_version == '2022-10-01-preview': - from ..v2022_10_01_preview.aio.operations import PrivateEndpointConnectionsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'private_endpoint_connections'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`PrivateEndpointConnectionsOperations` + * 2022-01-01-preview: :class:`PrivateEndpointConnectionsOperations` + * 2022-05-01: :class:`PrivateEndpointConnectionsOperations` + * 2022-10-01: :class:`PrivateEndpointConnectionsOperations` + * 2022-10-01-preview: :class:`PrivateEndpointConnectionsOperations` + """ + api_version = self._get_api_version("private_endpoint_connections") + if api_version == "2021-10-01": + from ..v2021_10_01.aio.operations import ( + PrivateEndpointConnectionsOperations as OperationClass, + ) + elif api_version == "2022-01-01-preview": + from ..v2022_01_01_preview.aio.operations import ( + PrivateEndpointConnectionsOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from ..v2022_05_01.aio.operations import ( + PrivateEndpointConnectionsOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from ..v2022_10_01.aio.operations import ( + PrivateEndpointConnectionsOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from ..v2022_10_01_preview.aio.operations import ( + PrivateEndpointConnectionsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'private_endpoint_connections'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def private_link_resources(self): """Instance depends on the API version: - * 2021-10-01: :class:`PrivateLinkResourcesOperations` - * 2022-01-01-preview: :class:`PrivateLinkResourcesOperations` - * 2022-05-01: :class:`PrivateLinkResourcesOperations` - * 2022-10-01: :class:`PrivateLinkResourcesOperations` - * 2022-10-01-preview: :class:`PrivateLinkResourcesOperations` - """ - api_version = self._get_api_version('private_link_resources') - if api_version == '2021-10-01': - from ..v2021_10_01.aio.operations import PrivateLinkResourcesOperations as OperationClass - elif api_version == '2022-01-01-preview': - from ..v2022_01_01_preview.aio.operations import PrivateLinkResourcesOperations as OperationClass - elif api_version == '2022-05-01': - from ..v2022_05_01.aio.operations import PrivateLinkResourcesOperations as OperationClass - elif api_version == '2022-10-01': - from ..v2022_10_01.aio.operations import PrivateLinkResourcesOperations as OperationClass - elif api_version == '2022-10-01-preview': - from ..v2022_10_01_preview.aio.operations import PrivateLinkResourcesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'private_link_resources'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`PrivateLinkResourcesOperations` + * 2022-01-01-preview: :class:`PrivateLinkResourcesOperations` + * 2022-05-01: :class:`PrivateLinkResourcesOperations` + * 2022-10-01: :class:`PrivateLinkResourcesOperations` + * 2022-10-01-preview: :class:`PrivateLinkResourcesOperations` + """ + api_version = self._get_api_version("private_link_resources") + if api_version == "2021-10-01": + from ..v2021_10_01.aio.operations import ( + PrivateLinkResourcesOperations as OperationClass, + ) + elif api_version == "2022-01-01-preview": + from ..v2022_01_01_preview.aio.operations import ( + PrivateLinkResourcesOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from ..v2022_05_01.aio.operations import ( + PrivateLinkResourcesOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from ..v2022_10_01.aio.operations import ( + PrivateLinkResourcesOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from ..v2022_10_01_preview.aio.operations import ( + PrivateLinkResourcesOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'private_link_resources'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def quotas(self): """Instance depends on the API version: - * 2021-10-01: :class:`QuotasOperations` - * 2022-01-01-preview: :class:`QuotasOperations` - * 2022-05-01: :class:`QuotasOperations` - * 2022-10-01: :class:`QuotasOperations` - * 2022-10-01-preview: :class:`QuotasOperations` - """ - api_version = self._get_api_version('quotas') - if api_version == '2021-10-01': - from ..v2021_10_01.aio.operations import QuotasOperations as OperationClass - elif api_version == '2022-01-01-preview': - from ..v2022_01_01_preview.aio.operations import QuotasOperations as OperationClass - elif api_version == '2022-05-01': - from ..v2022_05_01.aio.operations import QuotasOperations as OperationClass - elif api_version == '2022-10-01': - from ..v2022_10_01.aio.operations import QuotasOperations as OperationClass - elif api_version == '2022-10-01-preview': - from ..v2022_10_01_preview.aio.operations import QuotasOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'quotas'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`QuotasOperations` + * 2022-01-01-preview: :class:`QuotasOperations` + * 2022-05-01: :class:`QuotasOperations` + * 2022-10-01: :class:`QuotasOperations` + * 2022-10-01-preview: :class:`QuotasOperations` + """ + api_version = self._get_api_version("quotas") + if api_version == "2021-10-01": + from ..v2021_10_01.aio.operations import ( + QuotasOperations as OperationClass, + ) + elif api_version == "2022-01-01-preview": + from ..v2022_01_01_preview.aio.operations import ( + QuotasOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from ..v2022_05_01.aio.operations import ( + QuotasOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from ..v2022_10_01.aio.operations import ( + QuotasOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from ..v2022_10_01_preview.aio.operations import ( + QuotasOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'quotas'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def registries(self): """Instance depends on the API version: - * 2022-10-01-preview: :class:`RegistriesOperations` - """ - api_version = self._get_api_version('registries') - if api_version == '2022-10-01-preview': - from ..v2022_10_01_preview.aio.operations import RegistriesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'registries'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2022-10-01-preview: :class:`RegistriesOperations` + """ + api_version = self._get_api_version("registries") + if api_version == "2022-10-01-preview": + from ..v2022_10_01_preview.aio.operations import ( + RegistriesOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'registries'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def registry_code_containers(self): """Instance depends on the API version: - * 2022-10-01-preview: :class:`RegistryCodeContainersOperations` - """ - api_version = self._get_api_version('registry_code_containers') - if api_version == '2022-10-01-preview': - from ..v2022_10_01_preview.aio.operations import RegistryCodeContainersOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'registry_code_containers'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2022-10-01-preview: :class:`RegistryCodeContainersOperations` + """ + api_version = self._get_api_version("registry_code_containers") + if api_version == "2022-10-01-preview": + from ..v2022_10_01_preview.aio.operations import ( + RegistryCodeContainersOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'registry_code_containers'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def registry_code_versions(self): """Instance depends on the API version: - * 2022-10-01-preview: :class:`RegistryCodeVersionsOperations` - """ - api_version = self._get_api_version('registry_code_versions') - if api_version == '2022-10-01-preview': - from ..v2022_10_01_preview.aio.operations import RegistryCodeVersionsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'registry_code_versions'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2022-10-01-preview: :class:`RegistryCodeVersionsOperations` + """ + api_version = self._get_api_version("registry_code_versions") + if api_version == "2022-10-01-preview": + from ..v2022_10_01_preview.aio.operations import ( + RegistryCodeVersionsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'registry_code_versions'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def registry_component_containers(self): """Instance depends on the API version: - * 2022-10-01-preview: :class:`RegistryComponentContainersOperations` - """ - api_version = self._get_api_version('registry_component_containers') - if api_version == '2022-10-01-preview': - from ..v2022_10_01_preview.aio.operations import RegistryComponentContainersOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'registry_component_containers'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2022-10-01-preview: :class:`RegistryComponentContainersOperations` + """ + api_version = self._get_api_version("registry_component_containers") + if api_version == "2022-10-01-preview": + from ..v2022_10_01_preview.aio.operations import ( + RegistryComponentContainersOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'registry_component_containers'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def registry_component_versions(self): """Instance depends on the API version: - * 2022-10-01-preview: :class:`RegistryComponentVersionsOperations` - """ - api_version = self._get_api_version('registry_component_versions') - if api_version == '2022-10-01-preview': - from ..v2022_10_01_preview.aio.operations import RegistryComponentVersionsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'registry_component_versions'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2022-10-01-preview: :class:`RegistryComponentVersionsOperations` + """ + api_version = self._get_api_version("registry_component_versions") + if api_version == "2022-10-01-preview": + from ..v2022_10_01_preview.aio.operations import ( + RegistryComponentVersionsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'registry_component_versions'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def registry_environment_containers(self): """Instance depends on the API version: - * 2022-10-01-preview: :class:`RegistryEnvironmentContainersOperations` - """ - api_version = self._get_api_version('registry_environment_containers') - if api_version == '2022-10-01-preview': - from ..v2022_10_01_preview.aio.operations import RegistryEnvironmentContainersOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'registry_environment_containers'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2022-10-01-preview: :class:`RegistryEnvironmentContainersOperations` + """ + api_version = self._get_api_version("registry_environment_containers") + if api_version == "2022-10-01-preview": + from ..v2022_10_01_preview.aio.operations import ( + RegistryEnvironmentContainersOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'registry_environment_containers'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def registry_environment_versions(self): """Instance depends on the API version: - * 2022-10-01-preview: :class:`RegistryEnvironmentVersionsOperations` - """ - api_version = self._get_api_version('registry_environment_versions') - if api_version == '2022-10-01-preview': - from ..v2022_10_01_preview.aio.operations import RegistryEnvironmentVersionsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'registry_environment_versions'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2022-10-01-preview: :class:`RegistryEnvironmentVersionsOperations` + """ + api_version = self._get_api_version("registry_environment_versions") + if api_version == "2022-10-01-preview": + from ..v2022_10_01_preview.aio.operations import ( + RegistryEnvironmentVersionsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'registry_environment_versions'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def registry_management_non_workspace(self): """Instance depends on the API version: - * v1.0: :class:`RegistryManagementNonWorkspaceOperations` + * v1.0: :class:`RegistryManagementNonWorkspaceOperations` """ - api_version = self._get_api_version('registry_management_non_workspace') - if api_version == 'v1.0': - from ..registry_discovery.aio.operations import RegistryManagementNonWorkspaceOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'registry_management_non_workspace'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + api_version = self._get_api_version( + "registry_management_non_workspace" + ) + if api_version == "v1.0": + from ..registry_discovery.aio.operations import ( + RegistryManagementNonWorkspaceOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'registry_management_non_workspace'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def registry_model_containers(self): """Instance depends on the API version: - * 2022-10-01-preview: :class:`RegistryModelContainersOperations` - """ - api_version = self._get_api_version('registry_model_containers') - if api_version == '2022-10-01-preview': - from ..v2022_10_01_preview.aio.operations import RegistryModelContainersOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'registry_model_containers'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2022-10-01-preview: :class:`RegistryModelContainersOperations` + """ + api_version = self._get_api_version("registry_model_containers") + if api_version == "2022-10-01-preview": + from ..v2022_10_01_preview.aio.operations import ( + RegistryModelContainersOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'registry_model_containers'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def registry_model_versions(self): """Instance depends on the API version: - * 2022-10-01-preview: :class:`RegistryModelVersionsOperations` - """ - api_version = self._get_api_version('registry_model_versions') - if api_version == '2022-10-01-preview': - from ..v2022_10_01_preview.aio.operations import RegistryModelVersionsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'registry_model_versions'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2022-10-01-preview: :class:`RegistryModelVersionsOperations` + """ + api_version = self._get_api_version("registry_model_versions") + if api_version == "2022-10-01-preview": + from ..v2022_10_01_preview.aio.operations import ( + RegistryModelVersionsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'registry_model_versions'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def resource_management_asset_reference(self): """Instance depends on the API version: - * 2021-10-01-dataplanepreview: :class:`ResourceManagementAssetReferenceOperations` + * 2021-10-01-dataplanepreview: :class:`ResourceManagementAssetReferenceOperations` """ - api_version = self._get_api_version('resource_management_asset_reference') - if api_version == '2021-10-01-dataplanepreview': - from ..v2021_10_01_dataplanepreview.aio.operations import ResourceManagementAssetReferenceOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'resource_management_asset_reference'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + api_version = self._get_api_version( + "resource_management_asset_reference" + ) + if api_version == "2021-10-01-dataplanepreview": + from ..v2021_10_01_dataplanepreview.aio.operations import ( + ResourceManagementAssetReferenceOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'resource_management_asset_reference'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def run(self): """Instance depends on the API version: - * v1.0: :class:`RunOperations` - """ - api_version = self._get_api_version('run') - if api_version == 'v1.0': - from ..runhistory.aio.operations import RunOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'run'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * v1.0: :class:`RunOperations` + """ + api_version = self._get_api_version("run") + if api_version == "v1.0": + from ..runhistory.aio.operations import ( + RunOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'run'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def run_artifacts(self): """Instance depends on the API version: - * v1.0: :class:`RunArtifactsOperations` - """ - api_version = self._get_api_version('run_artifacts') - if api_version == 'v1.0': - from ..runhistory.aio.operations import RunArtifactsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'run_artifacts'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * v1.0: :class:`RunArtifactsOperations` + """ + api_version = self._get_api_version("run_artifacts") + if api_version == "v1.0": + from ..runhistory.aio.operations import ( + RunArtifactsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'run_artifacts'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def runs(self): """Instance depends on the API version: - * v1.0: :class:`RunsOperations` - """ - api_version = self._get_api_version('runs') - if api_version == 'v1.0': - from ..runhistory.aio.operations import RunsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'runs'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * v1.0: :class:`RunsOperations` + """ + api_version = self._get_api_version("runs") + if api_version == "v1.0": + from ..runhistory.aio.operations import ( + RunsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'runs'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def schedules(self): """Instance depends on the API version: - * 2022-06-01-preview: :class:`SchedulesOperations` - * 2022-10-01: :class:`SchedulesOperations` - * 2022-10-01-preview: :class:`SchedulesOperations` - """ - api_version = self._get_api_version('schedules') - if api_version == '2022-06-01-preview': - from ..v2022_06_01_preview.aio.operations import SchedulesOperations as OperationClass - elif api_version == '2022-10-01': - from ..v2022_10_01.aio.operations import SchedulesOperations as OperationClass - elif api_version == '2022-10-01-preview': - from ..v2022_10_01_preview.aio.operations import SchedulesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'schedules'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2022-06-01-preview: :class:`SchedulesOperations` + * 2022-10-01: :class:`SchedulesOperations` + * 2022-10-01-preview: :class:`SchedulesOperations` + """ + api_version = self._get_api_version("schedules") + if api_version == "2022-06-01-preview": + from ..v2022_06_01_preview.aio.operations import ( + SchedulesOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from ..v2022_10_01.aio.operations import ( + SchedulesOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from ..v2022_10_01_preview.aio.operations import ( + SchedulesOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'schedules'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def spans(self): """Instance depends on the API version: - * v1.0: :class:`SpansOperations` - """ - api_version = self._get_api_version('spans') - if api_version == 'v1.0': - from ..runhistory.aio.operations import SpansOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'spans'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * v1.0: :class:`SpansOperations` + """ + api_version = self._get_api_version("spans") + if api_version == "v1.0": + from ..runhistory.aio.operations import ( + SpansOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'spans'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def temporary_data_references(self): """Instance depends on the API version: - * 2021-10-01-dataplanepreview: :class:`TemporaryDataReferencesOperations` - """ - api_version = self._get_api_version('temporary_data_references') - if api_version == '2021-10-01-dataplanepreview': - from ..v2021_10_01_dataplanepreview.aio.operations import TemporaryDataReferencesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'temporary_data_references'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01-dataplanepreview: :class:`TemporaryDataReferencesOperations` + """ + api_version = self._get_api_version("temporary_data_references") + if api_version == "2021-10-01-dataplanepreview": + from ..v2021_10_01_dataplanepreview.aio.operations import ( + TemporaryDataReferencesOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'temporary_data_references'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def usages(self): """Instance depends on the API version: - * 2021-10-01: :class:`UsagesOperations` - * 2022-01-01-preview: :class:`UsagesOperations` - * 2022-05-01: :class:`UsagesOperations` - * 2022-10-01: :class:`UsagesOperations` - * 2022-10-01-preview: :class:`UsagesOperations` - """ - api_version = self._get_api_version('usages') - if api_version == '2021-10-01': - from ..v2021_10_01.aio.operations import UsagesOperations as OperationClass - elif api_version == '2022-01-01-preview': - from ..v2022_01_01_preview.aio.operations import UsagesOperations as OperationClass - elif api_version == '2022-05-01': - from ..v2022_05_01.aio.operations import UsagesOperations as OperationClass - elif api_version == '2022-10-01': - from ..v2022_10_01.aio.operations import UsagesOperations as OperationClass - elif api_version == '2022-10-01-preview': - from ..v2022_10_01_preview.aio.operations import UsagesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'usages'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`UsagesOperations` + * 2022-01-01-preview: :class:`UsagesOperations` + * 2022-05-01: :class:`UsagesOperations` + * 2022-10-01: :class:`UsagesOperations` + * 2022-10-01-preview: :class:`UsagesOperations` + """ + api_version = self._get_api_version("usages") + if api_version == "2021-10-01": + from ..v2021_10_01.aio.operations import ( + UsagesOperations as OperationClass, + ) + elif api_version == "2022-01-01-preview": + from ..v2022_01_01_preview.aio.operations import ( + UsagesOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from ..v2022_05_01.aio.operations import ( + UsagesOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from ..v2022_10_01.aio.operations import ( + UsagesOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from ..v2022_10_01_preview.aio.operations import ( + UsagesOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'usages'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def virtual_machine_sizes(self): """Instance depends on the API version: - * 2021-10-01: :class:`VirtualMachineSizesOperations` - * 2022-01-01-preview: :class:`VirtualMachineSizesOperations` - * 2022-05-01: :class:`VirtualMachineSizesOperations` - * 2022-10-01: :class:`VirtualMachineSizesOperations` - * 2022-10-01-preview: :class:`VirtualMachineSizesOperations` - """ - api_version = self._get_api_version('virtual_machine_sizes') - if api_version == '2021-10-01': - from ..v2021_10_01.aio.operations import VirtualMachineSizesOperations as OperationClass - elif api_version == '2022-01-01-preview': - from ..v2022_01_01_preview.aio.operations import VirtualMachineSizesOperations as OperationClass - elif api_version == '2022-05-01': - from ..v2022_05_01.aio.operations import VirtualMachineSizesOperations as OperationClass - elif api_version == '2022-10-01': - from ..v2022_10_01.aio.operations import VirtualMachineSizesOperations as OperationClass - elif api_version == '2022-10-01-preview': - from ..v2022_10_01_preview.aio.operations import VirtualMachineSizesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'virtual_machine_sizes'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`VirtualMachineSizesOperations` + * 2022-01-01-preview: :class:`VirtualMachineSizesOperations` + * 2022-05-01: :class:`VirtualMachineSizesOperations` + * 2022-10-01: :class:`VirtualMachineSizesOperations` + * 2022-10-01-preview: :class:`VirtualMachineSizesOperations` + """ + api_version = self._get_api_version("virtual_machine_sizes") + if api_version == "2021-10-01": + from ..v2021_10_01.aio.operations import ( + VirtualMachineSizesOperations as OperationClass, + ) + elif api_version == "2022-01-01-preview": + from ..v2022_01_01_preview.aio.operations import ( + VirtualMachineSizesOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from ..v2022_05_01.aio.operations import ( + VirtualMachineSizesOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from ..v2022_10_01.aio.operations import ( + VirtualMachineSizesOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from ..v2022_10_01_preview.aio.operations import ( + VirtualMachineSizesOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'virtual_machine_sizes'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def workspace_connections(self): """Instance depends on the API version: - * 2021-10-01: :class:`WorkspaceConnectionsOperations` - * 2022-01-01-preview: :class:`WorkspaceConnectionsOperations` - * 2022-05-01: :class:`WorkspaceConnectionsOperations` - * 2022-10-01: :class:`WorkspaceConnectionsOperations` - * 2022-10-01-preview: :class:`WorkspaceConnectionsOperations` - """ - api_version = self._get_api_version('workspace_connections') - if api_version == '2021-10-01': - from ..v2021_10_01.aio.operations import WorkspaceConnectionsOperations as OperationClass - elif api_version == '2022-01-01-preview': - from ..v2022_01_01_preview.aio.operations import WorkspaceConnectionsOperations as OperationClass - elif api_version == '2022-05-01': - from ..v2022_05_01.aio.operations import WorkspaceConnectionsOperations as OperationClass - elif api_version == '2022-10-01': - from ..v2022_10_01.aio.operations import WorkspaceConnectionsOperations as OperationClass - elif api_version == '2022-10-01-preview': - from ..v2022_10_01_preview.aio.operations import WorkspaceConnectionsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'workspace_connections'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`WorkspaceConnectionsOperations` + * 2022-01-01-preview: :class:`WorkspaceConnectionsOperations` + * 2022-05-01: :class:`WorkspaceConnectionsOperations` + * 2022-10-01: :class:`WorkspaceConnectionsOperations` + * 2022-10-01-preview: :class:`WorkspaceConnectionsOperations` + """ + api_version = self._get_api_version("workspace_connections") + if api_version == "2021-10-01": + from ..v2021_10_01.aio.operations import ( + WorkspaceConnectionsOperations as OperationClass, + ) + elif api_version == "2022-01-01-preview": + from ..v2022_01_01_preview.aio.operations import ( + WorkspaceConnectionsOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from ..v2022_05_01.aio.operations import ( + WorkspaceConnectionsOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from ..v2022_10_01.aio.operations import ( + WorkspaceConnectionsOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from ..v2022_10_01_preview.aio.operations import ( + WorkspaceConnectionsOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'workspace_connections'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def workspace_features(self): """Instance depends on the API version: - * 2021-10-01: :class:`WorkspaceFeaturesOperations` - * 2022-01-01-preview: :class:`WorkspaceFeaturesOperations` - * 2022-05-01: :class:`WorkspaceFeaturesOperations` - * 2022-10-01: :class:`WorkspaceFeaturesOperations` - * 2022-10-01-preview: :class:`WorkspaceFeaturesOperations` - """ - api_version = self._get_api_version('workspace_features') - if api_version == '2021-10-01': - from ..v2021_10_01.aio.operations import WorkspaceFeaturesOperations as OperationClass - elif api_version == '2022-01-01-preview': - from ..v2022_01_01_preview.aio.operations import WorkspaceFeaturesOperations as OperationClass - elif api_version == '2022-05-01': - from ..v2022_05_01.aio.operations import WorkspaceFeaturesOperations as OperationClass - elif api_version == '2022-10-01': - from ..v2022_10_01.aio.operations import WorkspaceFeaturesOperations as OperationClass - elif api_version == '2022-10-01-preview': - from ..v2022_10_01_preview.aio.operations import WorkspaceFeaturesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'workspace_features'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`WorkspaceFeaturesOperations` + * 2022-01-01-preview: :class:`WorkspaceFeaturesOperations` + * 2022-05-01: :class:`WorkspaceFeaturesOperations` + * 2022-10-01: :class:`WorkspaceFeaturesOperations` + * 2022-10-01-preview: :class:`WorkspaceFeaturesOperations` + """ + api_version = self._get_api_version("workspace_features") + if api_version == "2021-10-01": + from ..v2021_10_01.aio.operations import ( + WorkspaceFeaturesOperations as OperationClass, + ) + elif api_version == "2022-01-01-preview": + from ..v2022_01_01_preview.aio.operations import ( + WorkspaceFeaturesOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from ..v2022_05_01.aio.operations import ( + WorkspaceFeaturesOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from ..v2022_10_01.aio.operations import ( + WorkspaceFeaturesOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from ..v2022_10_01_preview.aio.operations import ( + WorkspaceFeaturesOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'workspace_features'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) @property def workspaces(self): """Instance depends on the API version: - * 2021-10-01: :class:`WorkspacesOperations` - * 2022-01-01-preview: :class:`WorkspacesOperations` - * 2022-05-01: :class:`WorkspacesOperations` - * 2022-10-01: :class:`WorkspacesOperations` - * 2022-10-01-preview: :class:`WorkspacesOperations` - """ - api_version = self._get_api_version('workspaces') - if api_version == '2021-10-01': - from ..v2021_10_01.aio.operations import WorkspacesOperations as OperationClass - elif api_version == '2022-01-01-preview': - from ..v2022_01_01_preview.aio.operations import WorkspacesOperations as OperationClass - elif api_version == '2022-05-01': - from ..v2022_05_01.aio.operations import WorkspacesOperations as OperationClass - elif api_version == '2022-10-01': - from ..v2022_10_01.aio.operations import WorkspacesOperations as OperationClass - elif api_version == '2022-10-01-preview': - from ..v2022_10_01_preview.aio.operations import WorkspacesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'workspaces'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + * 2021-10-01: :class:`WorkspacesOperations` + * 2022-01-01-preview: :class:`WorkspacesOperations` + * 2022-05-01: :class:`WorkspacesOperations` + * 2022-10-01: :class:`WorkspacesOperations` + * 2022-10-01-preview: :class:`WorkspacesOperations` + """ + api_version = self._get_api_version("workspaces") + if api_version == "2021-10-01": + from ..v2021_10_01.aio.operations import ( + WorkspacesOperations as OperationClass, + ) + elif api_version == "2022-01-01-preview": + from ..v2022_01_01_preview.aio.operations import ( + WorkspacesOperations as OperationClass, + ) + elif api_version == "2022-05-01": + from ..v2022_05_01.aio.operations import ( + WorkspacesOperations as OperationClass, + ) + elif api_version == "2022-10-01": + from ..v2022_10_01.aio.operations import ( + WorkspacesOperations as OperationClass, + ) + elif api_version == "2022-10-01-preview": + from ..v2022_10_01_preview.aio.operations import ( + WorkspacesOperations as OperationClass, + ) + else: + raise ValueError( + "API version {} does not have operation group 'workspaces'".format( + api_version + ) + ) + return OperationClass( + self._client, + self._config, + Serializer(self._models_dict(api_version)), + Deserializer(self._models_dict(api_version)), + ) async def close(self): await self._client.close() + async def __aenter__(self): await self._client.__aenter__() return self + async def __aexit__(self, *exc_details): await self._client.__aexit__(*exc_details) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/aio/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/aio/_configuration.py index bc1487b047df..f55312c47cde 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/aio/_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/aio/_configuration.py @@ -12,7 +12,10 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy +from azure.mgmt.core.policies import ( + ARMHttpLoggingPolicy, + AsyncARMChallengeAuthenticationPolicy, +) from .._version import VERSION @@ -20,6 +23,7 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential + class AzureMachineLearningWorkspacesConfiguration(Configuration): """Configuration for AzureMachineLearningWorkspaces. @@ -42,26 +46,48 @@ def __init__( raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) + super(AzureMachineLearningWorkspacesConfiguration, self).__init__( + **kwargs + ) self.credential = credential self.subscription_id = subscription_id - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'azure-mgmt-machinelearningservices/{}'.format(VERSION)) + self.credential_scopes = kwargs.pop( + "credential_scopes", ["https://management.azure.com/.default"] + ) + kwargs.setdefault( + "sdk_moniker", + "azure-mgmt-machinelearningservices/{}".format(VERSION), + ) self._configure(**kwargs) - def _configure( - self, - **kwargs: Any - ) -> None: - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get( + "user_agent_policy" + ) or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get( + "headers_policy" + ) or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy( + **kwargs + ) + self.logging_policy = kwargs.get( + "logging_policy" + ) or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get( + "http_logging_policy" + ) or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get( + "retry_policy" + ) or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get( + "custom_hook_policy" + ) or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get( + "redirect_policy" + ) or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/_client.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/_client.py index 709d2c4276d1..b211229129d2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/_client.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/_client.py @@ -75,17 +75,27 @@ def __init__( self._config.custom_hook_policy, self._config.logging_policy, policies.DistributedTracingPolicy(**kwargs), - policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + ( + policies.SensitiveHeaderCleanupPolicy(**kwargs) + if self._config.redirect_policy + else None + ), self._config.http_logging_policy, ] - self._client: PipelineClient = PipelineClient(base_url=_endpoint, policies=_policies, **kwargs) + self._client: PipelineClient = PipelineClient( + base_url=_endpoint, policies=_policies, **kwargs + ) self._serialize = Serializer() self._deserialize = Deserializer() self._serialize.client_side_validation = False - self.indexes = IndexesOperations(self._client, self._config, self._serialize, self._deserialize) + self.indexes = IndexesOperations( + self._client, self._config, self._serialize, self._deserialize + ) - def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: + def send_request( + self, request: HttpRequest, *, stream: bool = False, **kwargs: Any + ) -> HttpResponse: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest @@ -106,14 +116,26 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { "endpoint": self._config.endpoint, - "subscriptionId": self._serialize.url("self._config.subscription_id", self._config.subscription_id, "str"), + "subscriptionId": self._serialize.url( + "self._config.subscription_id", + self._config.subscription_id, + "str", + ), "resourceGroupName": self._serialize.url( - "self._config.resource_group_name", self._config.resource_group_name, "str" + "self._config.resource_group_name", + self._config.resource_group_name, + "str", + ), + "workspaceName": self._serialize.url( + "self._config.workspace_name", + self._config.workspace_name, + "str", ), - "workspaceName": self._serialize.url("self._config.workspace_name", self._config.workspace_name, "str"), } - request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) + request_copy.url = self._client.format_url( + request_copy.url, **path_format_arguments + ) return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore def close(self) -> None: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/_configuration.py index 1d8254be0789..81cf973ea38c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/_configuration.py @@ -55,7 +55,9 @@ def __init__( if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") if resource_group_name is None: - raise ValueError("Parameter 'resource_group_name' must not be None.") + raise ValueError( + "Parameter 'resource_group_name' must not be None." + ) if workspace_name is None: raise ValueError("Parameter 'workspace_name' must not be None.") if credential is None: @@ -67,20 +69,40 @@ def __init__( self.workspace_name = workspace_name self.credential = credential self.api_version = api_version - self.credential_scopes = kwargs.pop("credential_scopes", ["https://ml.azure.com/.default"]) - kwargs.setdefault("sdk_moniker", "azure_ai_assets_v2024_04_01/{}".format(VERSION)) + self.credential_scopes = kwargs.pop( + "credential_scopes", ["https://ml.azure.com/.default"] + ) + kwargs.setdefault( + "sdk_moniker", "azure_ai_assets_v2024_04_01/{}".format(VERSION) + ) self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: - self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or policies.HttpLoggingPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) + self.user_agent_policy = kwargs.get( + "user_agent_policy" + ) or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get( + "headers_policy" + ) or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy( + **kwargs + ) + self.logging_policy = kwargs.get( + "logging_policy" + ) or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get( + "http_logging_policy" + ) or policies.HttpLoggingPolicy(**kwargs) + self.custom_hook_policy = kwargs.get( + "custom_hook_policy" + ) or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get( + "redirect_policy" + ) or policies.RedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy( + **kwargs + ) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = policies.BearerTokenCredentialPolicy( diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/_model_base.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/_model_base.py index 1ddc071517d6..eb7837d73e1d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/_model_base.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/_model_base.py @@ -131,7 +131,13 @@ def _is_readonly(p): class SdkJSONEncoder(JSONEncoder): """A JSON encoder that's capable of serializing datetime objects and bytes.""" - def __init__(self, *args, exclude_readonly: bool = False, format: typing.Optional[str] = None, **kwargs): + def __init__( + self, + *args, + exclude_readonly: bool = False, + format: typing.Optional[str] = None, + **kwargs, + ): super().__init__(*args, **kwargs) self.exclude_readonly = exclude_readonly self.format = format @@ -139,7 +145,11 @@ def __init__(self, *args, exclude_readonly: bool = False, format: typing.Optiona def default(self, o): # pylint: disable=too-many-return-statements if _is_model(o): if self.exclude_readonly: - readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] + readonly_props = [ + p._rest_name + for p in o._attr_to_rest_field.values() + if _is_readonly(p) + ] return {k: v for k, v in o.items() if k not in readonly_props} return dict(o.items()) try: @@ -165,7 +175,10 @@ def default(self, o): # pylint: disable=too-many-return-statements return super(SdkJSONEncoder, self).default(o) -_VALID_DATE = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" + r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") +_VALID_DATE = re.compile( + r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" + + r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?" +) _VALID_RFC7231 = re.compile( r"(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s\d{2}\s" r"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{4}\s\d{2}:\d{2}:\d{2}\sGMT" @@ -205,7 +218,9 @@ def _deserialize_datetime(attr: typing.Union[str, datetime]) -> datetime: return date_obj -def _deserialize_datetime_rfc7231(attr: typing.Union[str, datetime]) -> datetime: +def _deserialize_datetime_rfc7231( + attr: typing.Union[str, datetime], +) -> datetime: """Deserialize RFC7231 formatted string into Datetime object. :param str attr: response string to be deserialized. @@ -222,7 +237,9 @@ def _deserialize_datetime_rfc7231(attr: typing.Union[str, datetime]) -> datetime return email.utils.parsedate_to_datetime(attr) -def _deserialize_datetime_unix_timestamp(attr: typing.Union[float, datetime]) -> datetime: +def _deserialize_datetime_unix_timestamp( + attr: typing.Union[float, datetime], +) -> datetime: """Deserialize unix timestamp into Datetime object. :param str attr: response string to be deserialized. @@ -306,7 +323,9 @@ def _deserialize_decimal(attr): } -def get_deserializer(annotation: typing.Any, rf: typing.Optional["_RestField"] = None): +def get_deserializer( + annotation: typing.Any, rf: typing.Optional["_RestField"] = None +): if rf and rf._format: return _DESERIALIZE_MAPPING_WITHFORMAT.get(rf._format) return _DESERIALIZE_MAPPING.get(annotation) @@ -324,9 +343,19 @@ def _get_type_alias_type(module_name: str, alias_name: str): def _get_model(module_name: str, model_name: str): - models = {k: v for k, v in sys.modules[module_name].__dict__.items() if isinstance(v, type)} + models = { + k: v + for k, v in sys.modules[module_name].__dict__.items() + if isinstance(v, type) + } module_end = module_name.rsplit(".", 1)[0] - models.update({k: v for k, v in sys.modules[module_end].__dict__.items() if isinstance(v, type)}) + models.update( + { + k: v + for k, v in sys.modules[module_end].__dict__.items() + if isinstance(v, type) + } + ) if isinstance(model_name, str): model_name = model_name.split(".")[-1] if model_name not in models: @@ -337,7 +366,9 @@ def _get_model(module_name: str, model_name: str): _UNSET = object() -class _MyMutableMapping(MutableMapping[str, typing.Any]): # pylint: disable=unsubscriptable-object +class _MyMutableMapping( + MutableMapping[str, typing.Any] +): # pylint: disable=unsubscriptable-object def __init__(self, data: typing.Dict[str, typing.Any]) -> None: self._data = copy.deepcopy(data) @@ -378,16 +409,13 @@ def get(self, key: str, default: typing.Any = None) -> typing.Any: return default @typing.overload - def pop(self, key: str) -> typing.Any: - ... + def pop(self, key: str) -> typing.Any: ... @typing.overload - def pop(self, key: str, default: _T) -> _T: - ... + def pop(self, key: str, default: _T) -> _T: ... @typing.overload - def pop(self, key: str, default: typing.Any) -> typing.Any: - ... + def pop(self, key: str, default: typing.Any) -> typing.Any: ... def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any: if default is _UNSET: @@ -404,12 +432,10 @@ def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: self._data.update(*args, **kwargs) @typing.overload - def setdefault(self, key: str, default: None = None) -> None: - ... + def setdefault(self, key: str, default: None = None) -> None: ... @typing.overload - def setdefault(self, key: str, default: typing.Any) -> typing.Any: - ... + def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: if default is _UNSET: @@ -431,7 +457,9 @@ def _is_model(obj: typing.Any) -> bool: return getattr(obj, "_is_model", False) -def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-many-return-statements +def _serialize( + o, format: typing.Optional[str] = None +): # pylint: disable=too-many-return-statements if isinstance(o, list): return [_serialize(x, format) for x in o] if isinstance(o, dict): @@ -464,12 +492,18 @@ def _get_rest_field( attr_to_rest_field: typing.Dict[str, "_RestField"], rest_name: str ) -> typing.Optional["_RestField"]: try: - return next(rf for rf in attr_to_rest_field.values() if rf._rest_name == rest_name) + return next( + rf + for rf in attr_to_rest_field.values() + if rf._rest_name == rest_name + ) except StopIteration: return None -def _create_value(rf: typing.Optional["_RestField"], value: typing.Any) -> typing.Any: +def _create_value( + rf: typing.Optional["_RestField"], value: typing.Any +) -> typing.Any: if not rf: return _serialize(value, None) if rf._is_multipart_file_input: @@ -485,7 +519,9 @@ class Model(_MyMutableMapping): def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: class_name = self.__class__.__name__ if len(args) > 1: - raise TypeError(f"{class_name}.__init__() takes 2 positional arguments but {len(args) + 1} were given") + raise TypeError( + f"{class_name}.__init__() takes 2 positional arguments but {len(args) + 1} were given" + ) dict_to_pass = { rest_field._rest_name: rest_field._default for rest_field in self._attr_to_rest_field.values() @@ -493,16 +529,27 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: } if args: dict_to_pass.update( - {k: _create_value(_get_rest_field(self._attr_to_rest_field, k), v) for k, v in args[0].items()} + { + k: _create_value( + _get_rest_field(self._attr_to_rest_field, k), v + ) + for k, v in args[0].items() + } ) else: - non_attr_kwargs = [k for k in kwargs if k not in self._attr_to_rest_field] + non_attr_kwargs = [ + k for k in kwargs if k not in self._attr_to_rest_field + ] if non_attr_kwargs: # actual type errors only throw the first wrong keyword arg they see, so following that. - raise TypeError(f"{class_name}.__init__() got an unexpected keyword argument '{non_attr_kwargs[0]}'") + raise TypeError( + f"{class_name}.__init__() got an unexpected keyword argument '{non_attr_kwargs[0]}'" + ) dict_to_pass.update( { - self._attr_to_rest_field[k]._rest_name: _create_value(self._attr_to_rest_field[k], v) + self._attr_to_rest_field[k]._rest_name: _create_value( + self._attr_to_rest_field[k], v + ) for k, v in kwargs.items() if v is not None } @@ -512,29 +559,46 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: def copy(self) -> "Model": return Model(self.__dict__) - def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # pylint: disable=unused-argument + def __new__( + cls, *args: typing.Any, **kwargs: typing.Any + ) -> Self: # pylint: disable=unused-argument # we know the last three classes in mro are going to be 'Model', 'dict', and 'object' - mros = cls.__mro__[:-3][::-1] # ignore model, dict, and object parents, and reverse the mro order - attr_to_rest_field: typing.Dict[str, _RestField] = { # map attribute name to rest_field property - k: v for mro_class in mros for k, v in mro_class.__dict__.items() if k[0] != "_" and hasattr(v, "_type") - } + mros = cls.__mro__[:-3][ + ::-1 + ] # ignore model, dict, and object parents, and reverse the mro order + attr_to_rest_field: typing.Dict[str, _RestField] = ( + { # map attribute name to rest_field property + k: v + for mro_class in mros + for k, v in mro_class.__dict__.items() + if k[0] != "_" and hasattr(v, "_type") + } + ) annotations = { k: v for mro_class in mros - if hasattr(mro_class, "__annotations__") # pylint: disable=no-member + if hasattr( + mro_class, "__annotations__" + ) # pylint: disable=no-member for k, v in mro_class.__annotations__.items() # pylint: disable=no-member } for attr, rf in attr_to_rest_field.items(): rf._module = cls.__module__ if not rf._type: - rf._type = rf._get_deserialize_callable_from_annotation(annotations.get(attr, None)) + rf._type = rf._get_deserialize_callable_from_annotation( + annotations.get(attr, None) + ) if not rf._rest_name_input: rf._rest_name_input = attr - cls._attr_to_rest_field: typing.Dict[str, _RestField] = dict(attr_to_rest_field.items()) + cls._attr_to_rest_field: typing.Dict[str, _RestField] = dict( + attr_to_rest_field.items() + ) return super().__new__(cls) # pylint: disable=no-value-for-parameter - def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None: + def __init_subclass__( + cls, discriminator: typing.Optional[str] = None + ) -> None: for base in cls.__bases__: if hasattr(base, "__mapping__"): # pylint: disable=no-member base.__mapping__[discriminator or cls.__name__] = cls # type: ignore # pylint: disable=no-member @@ -543,7 +607,9 @@ def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None: def _get_discriminator(cls, exist_discriminators) -> typing.Optional[str]: for v in cls.__dict__.values(): if ( - isinstance(v, _RestField) and v._is_discriminator and v._rest_name not in exist_discriminators + isinstance(v, _RestField) + and v._is_discriminator + and v._rest_name not in exist_discriminators ): # pylint: disable=protected-access return v._rest_name # pylint: disable=protected-access return None @@ -554,12 +620,18 @@ def _deserialize(cls, data, exist_discriminators): return cls(data) discriminator = cls._get_discriminator(exist_discriminators) exist_discriminators.append(discriminator) - mapped_cls = cls.__mapping__.get(data.get(discriminator), cls) # pyright: ignore # pylint: disable=no-member + mapped_cls = cls.__mapping__.get( + data.get(discriminator), cls + ) # pyright: ignore # pylint: disable=no-member if mapped_cls == cls: return cls(data) - return mapped_cls._deserialize(data, exist_discriminators) # pylint: disable=protected-access + return mapped_cls._deserialize( + data, exist_discriminators + ) # pylint: disable=protected-access - def as_dict(self, *, exclude_readonly: bool = False) -> typing.Dict[str, typing.Any]: + def as_dict( + self, *, exclude_readonly: bool = False + ) -> typing.Dict[str, typing.Any]: """Return a dict that can be JSONify using json.dump. :keyword bool exclude_readonly: Whether to remove the readonly properties. @@ -569,29 +641,51 @@ def as_dict(self, *, exclude_readonly: bool = False) -> typing.Dict[str, typing. result = {} if exclude_readonly: - readonly_props = [p._rest_name for p in self._attr_to_rest_field.values() if _is_readonly(p)] + readonly_props = [ + p._rest_name + for p in self._attr_to_rest_field.values() + if _is_readonly(p) + ] for k, v in self.items(): if exclude_readonly and k in readonly_props: # pyright: ignore continue is_multipart_file_input = False try: is_multipart_file_input = next( - rf for rf in self._attr_to_rest_field.values() if rf._rest_name == k + rf + for rf in self._attr_to_rest_field.values() + if rf._rest_name == k )._is_multipart_file_input except StopIteration: pass - result[k] = v if is_multipart_file_input else Model._as_dict_value(v, exclude_readonly=exclude_readonly) + result[k] = ( + v + if is_multipart_file_input + else Model._as_dict_value(v, exclude_readonly=exclude_readonly) + ) return result @staticmethod - def _as_dict_value(v: typing.Any, exclude_readonly: bool = False) -> typing.Any: + def _as_dict_value( + v: typing.Any, exclude_readonly: bool = False + ) -> typing.Any: if v is None or isinstance(v, _Null): return None if isinstance(v, (list, tuple, set)): - return type(v)(Model._as_dict_value(x, exclude_readonly=exclude_readonly) for x in v) + return type(v)( + Model._as_dict_value(x, exclude_readonly=exclude_readonly) + for x in v + ) if isinstance(v, dict): - return {dk: Model._as_dict_value(dv, exclude_readonly=exclude_readonly) for dk, dv in v.items()} - return v.as_dict(exclude_readonly=exclude_readonly) if hasattr(v, "as_dict") else v + return { + dk: Model._as_dict_value(dv, exclude_readonly=exclude_readonly) + for dk, dv in v.items() + } + return ( + v.as_dict(exclude_readonly=exclude_readonly) + if hasattr(v, "as_dict") + else v + ) def _get_deserialize_callable_from_annotation( # pylint: disable=R0911, R0915, R0912 @@ -621,12 +715,16 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=R0911, R0915, if rf: rf._is_model = True - def _deserialize_model(model_deserializer: typing.Optional[typing.Callable], obj): + def _deserialize_model( + model_deserializer: typing.Optional[typing.Callable], obj + ): if _is_model(obj): return obj return _deserialize(model_deserializer, obj) - return functools.partial(_deserialize_model, annotation) # pyright: ignore + return functools.partial( + _deserialize_model, annotation + ) # pyright: ignore except Exception: pass @@ -639,17 +737,25 @@ def _deserialize_model(model_deserializer: typing.Optional[typing.Callable], obj # is it optional? try: - if any(a for a in annotation.__args__ if a == type(None)): # pyright: ignore + if any( + a for a in annotation.__args__ if a == type(None) + ): # pyright: ignore if_obj_deserializer = _get_deserialize_callable_from_annotation( - next(a for a in annotation.__args__ if a != type(None)), module, rf # pyright: ignore + next(a for a in annotation.__args__ if a != type(None)), + module, + rf, # pyright: ignore ) - def _deserialize_with_optional(if_obj_deserializer: typing.Optional[typing.Callable], obj): + def _deserialize_with_optional( + if_obj_deserializer: typing.Optional[typing.Callable], obj + ): if obj is None: return obj return _deserialize_with_callable(if_obj_deserializer, obj) - return functools.partial(_deserialize_with_optional, if_obj_deserializer) + return functools.partial( + _deserialize_with_optional, if_obj_deserializer + ) except AttributeError: pass @@ -658,7 +764,9 @@ def _deserialize_with_optional(if_obj_deserializer: typing.Optional[typing.Calla deserializers = [ _get_deserialize_callable_from_annotation(arg, module, rf) for arg in sorted( - annotation.__args__, key=lambda x: hasattr(x, "__name__") and x.__name__ == "str" # pyright: ignore + annotation.__args__, + key=lambda x: hasattr(x, "__name__") + and x.__name__ == "str", # pyright: ignore ) ] @@ -684,7 +792,10 @@ def _deserialize_dict( ): if obj is None: return obj - return {k: _deserialize(value_deserializer, v, module) for k, v in obj.items()} + return { + k: _deserialize(value_deserializer, v, module) + for k, v in obj.items() + } return functools.partial( _deserialize_dict, @@ -693,25 +804,36 @@ def _deserialize_dict( except (AttributeError, IndexError): pass try: - if annotation._name in ["List", "Set", "Tuple", "Sequence"]: # pyright: ignore + if annotation._name in [ + "List", + "Set", + "Tuple", + "Sequence", + ]: # pyright: ignore if len(annotation.__args__) > 1: # pyright: ignore def _deserialize_multiple_sequence( - entry_deserializers: typing.List[typing.Optional[typing.Callable]], + entry_deserializers: typing.List[ + typing.Optional[typing.Callable] + ], obj, ): if obj is None: return obj return type(obj)( _deserialize(deserializer, entry, module) - for entry, deserializer in zip(obj, entry_deserializers) + for entry, deserializer in zip( + obj, entry_deserializers + ) ) entry_deserializers = [ _get_deserialize_callable_from_annotation(dt, module, rf) for dt in annotation.__args__ # pyright: ignore ] - return functools.partial(_deserialize_multiple_sequence, entry_deserializers) + return functools.partial( + _deserialize_multiple_sequence, entry_deserializers + ) deserializer = _get_deserialize_callable_from_annotation( annotation.__args__[0], module, rf # pyright: ignore ) @@ -722,7 +844,9 @@ def _deserialize_sequence( ): if obj is None: return obj - return type(obj)(_deserialize(deserializer, entry, module) for entry in obj) + return type(obj)( + _deserialize(deserializer, entry, module) for entry in obj + ) return functools.partial(_deserialize_sequence, deserializer) except (TypeError, IndexError, AttributeError, SyntaxError): @@ -741,7 +865,9 @@ def _deserialize_default( return obj if get_deserializer(annotation, rf): - return functools.partial(_deserialize_default, get_deserializer(annotation, rf)) + return functools.partial( + _deserialize_default, get_deserializer(annotation, rf) + ) return functools.partial(_deserialize_default, annotation) @@ -763,7 +889,9 @@ def _deserialize_with_callable( return value if isinstance(deserializer, type) and issubclass(deserializer, Model): return deserializer._deserialize(value, []) - return typing.cast(typing.Callable[[typing.Any], typing.Any], deserializer)(value) + return typing.cast( + typing.Callable[[typing.Any], typing.Any], deserializer + )(value) except Exception as e: raise DeserializationError() from e @@ -780,7 +908,9 @@ def _deserialize( if rf is None and format: rf = _RestField(format=format) if not isinstance(deserializer, functools.partial): - deserializer = _get_deserialize_callable_from_annotation(deserializer, module, rf) + deserializer = _get_deserialize_callable_from_annotation( + deserializer, module, rf + ) return _deserialize_with_callable(deserializer, value) @@ -789,7 +919,9 @@ def __init__( self, *, name: typing.Optional[str] = None, - type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + type: typing.Optional[ + typing.Callable + ] = None, # pylint: disable=redefined-builtin is_discriminator: bool = False, visibility: typing.Optional[typing.List[str]] = None, default: typing.Any = _UNSET, @@ -816,7 +948,9 @@ def _rest_name(self) -> str: raise ValueError("Rest name was never set") return self._rest_name_input - def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin + def __get__( + self, obj: Model, type=None + ): # pylint: disable=redefined-builtin # by this point, type and rest_name will have a value bc we default # them in __new__ of the Model class item = obj.get(self._rest_name) @@ -824,7 +958,9 @@ def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin return item if self._is_model: return item - return _deserialize(self._type, _serialize(item, self._format), rf=self) + return _deserialize( + self._type, _serialize(item, self._format), rf=self + ) def __set__(self, obj: Model, value) -> None: if value is None: @@ -844,13 +980,17 @@ def __set__(self, obj: Model, value) -> None: def _get_deserialize_callable_from_annotation( self, annotation: typing.Any ) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: - return _get_deserialize_callable_from_annotation(annotation, self._module, self) + return _get_deserialize_callable_from_annotation( + annotation, self._module, self + ) def rest_field( *, name: typing.Optional[str] = None, - type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + type: typing.Optional[ + typing.Callable + ] = None, # pylint: disable=redefined-builtin visibility: typing.Optional[typing.List[str]] = None, default: typing.Any = _UNSET, format: typing.Optional[str] = None, @@ -869,6 +1009,8 @@ def rest_field( def rest_discriminator( *, name: typing.Optional[str] = None, - type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + type: typing.Optional[ + typing.Callable + ] = None, # pylint: disable=redefined-builtin ) -> typing.Any: return _RestField(name=name, type=type, is_discriminator=True) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/_patch.py index f7dd32510333..abf561200a3f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/_patch.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/_patch.py @@ -8,7 +8,9 @@ """ from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level +__all__: List[str] = ( + [] +) # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/_serialization.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/_serialization.py index 2f781d740827..a726c4e3f51c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/_serialization.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/_serialization.py @@ -81,7 +81,11 @@ class RawDeserializer: CONTEXT_NAME = "deserialized_data" @classmethod - def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: Optional[str] = None) -> Any: + def deserialize_from_text( + cls, + data: Optional[Union[AnyStr, IO]], + content_type: Optional[str] = None, + ) -> Any: """Decode data according to content-type. Accept a stream of data as well, but will be load at once in memory for now. @@ -112,7 +116,9 @@ def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: try: return json.loads(data_as_str) except ValueError as err: - raise DeserializationError("JSON is invalid: {}".format(err), err) + raise DeserializationError( + "JSON is invalid: {}".format(err), err + ) elif "xml" in (content_type or []): try: @@ -144,10 +150,14 @@ def _json_attemp(data): # context otherwise. _LOGGER.critical("Wasn't XML not JSON, failing") raise DeserializationError("XML is invalid") from err - raise DeserializationError("Cannot deserialize content-type: {}".format(content_type)) + raise DeserializationError( + "Cannot deserialize content-type: {}".format(content_type) + ) @classmethod - def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], headers: Mapping) -> Any: + def deserialize_from_http_generics( + cls, body_bytes: Optional[Union[AnyStr, IO]], headers: Mapping + ) -> Any: """Deserialize from HTTP response. Use bytes and headers to NOT use any requests/aiohttp or whatever @@ -157,7 +167,9 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], # Try to use content-type from headers if available content_type = None if "content-type" in headers: - content_type = headers["content-type"].split(";")[0].strip().lower() + content_type = ( + headers["content-type"].split(";")[0].strip().lower() + ) # Ouch, this server did not declare what it sent... # Let's guess it's JSON... # Also, since Autorest was considering that an empty body was a valid JSON, @@ -291,9 +303,19 @@ def __init__(self, **kwargs: Any) -> None: self.additional_properties: Optional[Dict[str, Any]] = {} for k in kwargs: if k not in self._attribute_map: - _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) - elif k in self._validation and self._validation[k].get("readonly", False): - _LOGGER.warning("Readonly attribute %s will be ignored in class %s", k, self.__class__) + _LOGGER.warning( + "%s is not a known attribute of class %s and will be ignored", + k, + self.__class__, + ) + elif k in self._validation and self._validation[k].get( + "readonly", False + ): + _LOGGER.warning( + "Readonly attribute %s will be ignored in class %s", + k, + self.__class__, + ) else: setattr(self, k, kwargs[k]) @@ -312,7 +334,10 @@ def __str__(self) -> str: @classmethod def enable_additional_properties_sending(cls) -> None: - cls._attribute_map["additional_properties"] = {"key": "", "type": "{object}"} + cls._attribute_map["additional_properties"] = { + "key": "", + "type": "{object}", + } @classmethod def is_xml_model(cls) -> bool: @@ -330,7 +355,11 @@ def _create_xml_node(cls): except AttributeError: xml_map = {} - return _create_xml_node(xml_map.get("name", cls.__name__), xml_map.get("prefix", None), xml_map.get("ns", None)) + return _create_xml_node( + xml_map.get("name", cls.__name__), + xml_map.get("prefix", None), + xml_map.get("ns", None), + ) def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: """Return the JSON that would be sent to server from this model. @@ -349,7 +378,9 @@ def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: def as_dict( self, keep_readonly: bool = True, - key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer, + key_transformer: Callable[ + [str, Dict[str, Any], Any], Any + ] = attribute_transformer, **kwargs: Any ) -> JSON: """Return a dict that can be serialized using json.dump. @@ -390,7 +421,9 @@ def _infer_class_models(cls): try: str_models = cls.__module__.rsplit(".", 1)[0] models = sys.modules[str_models] - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = { + k: v for k, v in models.__dict__.items() if isinstance(v, type) + } if cls.__name__ not in client_models: raise ValueError("Not Autorest generated code") except Exception: @@ -399,7 +432,9 @@ def _infer_class_models(cls): return client_models @classmethod - def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType: + def deserialize( + cls: Type[ModelType], data: Any, content_type: Optional[str] = None + ) -> ModelType: """Parse a str using the RestAPI syntax and return a model. :param str data: A str using RestAPI structure. JSON by default. @@ -414,7 +449,9 @@ def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = N def from_dict( cls: Type[ModelType], data: Any, - key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + key_extractors: Optional[ + Callable[[str, Dict[str, Any], Any], Any] + ] = None, content_type: Optional[str] = None, ) -> ModelType: """Parse a dict using given key extractor return a model. @@ -459,16 +496,24 @@ def _classify(cls, response, objects): subtype_value = None if not isinstance(response, ET.Element): - rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1] - subtype_value = response.pop(rest_api_response_key, None) or response.pop(subtype_key, None) + rest_api_response_key = cls._get_rest_key_parts(subtype_key)[ + -1 + ] + subtype_value = response.pop( + rest_api_response_key, None + ) or response.pop(subtype_key, None) else: - subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response) + subtype_value = xml_key_extractor( + subtype_key, cls._attribute_map[subtype_key], response + ) if subtype_value: # Try to match base class. Can be class name only # (bug to fix in Autorest to support x-ms-discriminator-name) if cls.__name__ == subtype_value: return cls - flatten_mapping_type = cls._flatten_subtype(subtype_key, objects) + flatten_mapping_type = cls._flatten_subtype( + subtype_key, objects + ) try: return objects[flatten_mapping_type[subtype_value]] # type: ignore except KeyError: @@ -479,7 +524,11 @@ def _classify(cls, response, objects): ) break else: - _LOGGER.warning("Discriminator %s is absent or null, use base class %s.", subtype_key, cls.__name__) + _LOGGER.warning( + "Discriminator %s is absent or null, use base class %s.", + subtype_key, + cls.__name__, + ) break return cls @@ -491,7 +540,9 @@ def _get_rest_key_parts(cls, attr_key): :rtype: list """ rest_split_key = _FLATTEN.split(cls._attribute_map[attr_key]["key"]) - return [_decode_attribute_map_key(key_part) for key_part in rest_split_key] + return [ + _decode_attribute_map_key(key_part) for key_part in rest_split_key + ] def _decode_attribute_map_key(key): @@ -509,7 +560,15 @@ class Serializer(object): basic_types = {str: "str", int: "int", bool: "bool", float: "float"} _xml_basic_types_serializers = {"bool": lambda x: str(x).lower()} - days = {0: "Mon", 1: "Tue", 2: "Wed", 3: "Thu", 4: "Fri", 5: "Sat", 6: "Sun"} + days = { + 0: "Mon", + 1: "Tue", + 2: "Wed", + 3: "Thu", + 4: "Fri", + 5: "Sat", + 6: "Sun", + } months = { 1: "Jan", 2: "Feb", @@ -586,7 +645,9 @@ def _serialize(self, target_obj, data_type=None, **kwargs): try: is_xml_model_serialization = kwargs["is_xml"] except KeyError: - is_xml_model_serialization = kwargs.setdefault("is_xml", target_obj.is_xml_model()) + is_xml_model_serialization = kwargs.setdefault( + "is_xml", target_obj.is_xml_model() + ) serialized = {} if is_xml_model_serialization: @@ -595,10 +656,15 @@ def _serialize(self, target_obj, data_type=None, **kwargs): attributes = target_obj._attribute_map for attr, attr_desc in attributes.items(): attr_name = attr - if not keep_readonly and target_obj._validation.get(attr_name, {}).get("readonly", False): + if not keep_readonly and target_obj._validation.get( + attr_name, {} + ).get("readonly", False): continue - if attr_name == "additional_properties" and attr_desc["key"] == "": + if ( + attr_name == "additional_properties" + and attr_desc["key"] == "" + ): if target_obj.additional_properties is not None: serialized.update(target_obj.additional_properties) continue @@ -608,11 +674,15 @@ def _serialize(self, target_obj, data_type=None, **kwargs): if is_xml_model_serialization: pass # Don't provide "transformer" for XML for now. Keep "orig_attr" else: # JSON - keys, orig_attr = key_transformer(attr, attr_desc.copy(), orig_attr) + keys, orig_attr = key_transformer( + attr, attr_desc.copy(), orig_attr + ) keys = keys if isinstance(keys, list) else [keys] kwargs["serialization_ctxt"] = attr_desc - new_attr = self.serialize_data(orig_attr, attr_desc["type"], **kwargs) + new_attr = self.serialize_data( + orig_attr, attr_desc["type"], **kwargs + ) if is_xml_model_serialization: xml_desc = attr_desc.get("xml", {}) @@ -632,16 +702,22 @@ def _serialize(self, target_obj, data_type=None, **kwargs): serialized.extend(new_attr) # type: ignore elif isinstance(new_attr, ET.Element): # If the down XML has no XML/Name, we MUST replace the tag with the local tag. But keeping the namespaces. - if "name" not in getattr(orig_attr, "_xml_map", {}): + if "name" not in getattr( + orig_attr, "_xml_map", {} + ): splitted_tag = new_attr.tag.split("}") if len(splitted_tag) == 2: # Namespace - new_attr.tag = "}".join([splitted_tag[0], xml_name]) + new_attr.tag = "}".join( + [splitted_tag[0], xml_name] + ) else: new_attr.tag = xml_name serialized.append(new_attr) # type: ignore else: # That's a basic type # Integrate namespace if necessary - local_node = _create_xml_node(xml_name, xml_prefix, xml_ns) + local_node = _create_xml_node( + xml_name, xml_prefix, xml_ns + ) local_node.text = str(new_attr) serialized.append(local_node) # type: ignore else: # JSON @@ -660,7 +736,9 @@ def _serialize(self, target_obj, data_type=None, **kwargs): raise except (AttributeError, KeyError, TypeError) as err: - msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) + msg = "Attribute {} in object {} cannot be serialized.\n{}".format( + attr_name, class_name, str(target_obj) + ) raise SerializationError(msg) from err else: return serialized @@ -677,12 +755,16 @@ def body(self, data, data_type, **kwargs): # Just in case this is a dict internal_data_type_str = data_type.strip("[]{}") - internal_data_type = self.dependencies.get(internal_data_type_str, None) + internal_data_type = self.dependencies.get( + internal_data_type_str, None + ) try: is_xml_model_serialization = kwargs["is_xml"] except KeyError: if internal_data_type and issubclass(internal_data_type, Model): - is_xml_model_serialization = kwargs.setdefault("is_xml", internal_data_type.is_xml_model()) + is_xml_model_serialization = kwargs.setdefault( + "is_xml", internal_data_type.is_xml_model() + ) else: is_xml_model_serialization = False if internal_data_type and not isinstance(internal_data_type, Enum): @@ -703,7 +785,9 @@ def body(self, data, data_type, **kwargs): ] data = deserializer._deserialize(data_type, data) except DeserializationError as err: - raise SerializationError("Unable to build a model: " + str(err)) from err + raise SerializationError( + "Unable to build a model: " + str(err) + ) from err return self._serialize(data, data_type, **kwargs) @@ -723,7 +807,9 @@ def url(self, name, data, data_type, **kwargs): if kwargs.get("skip_quote") is True: output = str(output) - output = output.replace("{", quote("{")).replace("}", quote("}")) + output = output.replace("{", quote("{")).replace( + "}", quote("}") + ) else: output = quote(str(output), safe="") except SerializationError: @@ -747,7 +833,9 @@ def query(self, name, data, data_type, **kwargs): if data_type.startswith("["): internal_data_type = data_type[1:-1] do_quote = not kwargs.get("skip_quote", False) - return self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs) + return self.serialize_iter( + data, internal_data_type, do_quote=do_quote, **kwargs + ) # Not a list, regular serialization output = self.serialize_data(data, data_type, **kwargs) @@ -814,7 +902,9 @@ def serialize_data(self, data, data_type, **kwargs): iter_type = data_type[0] + data_type[-1] if iter_type in self.serialize_type: - return self.serialize_type[iter_type](data, data_type[1:-1], **kwargs) + return self.serialize_type[iter_type]( + data, data_type[1:-1], **kwargs + ) except (ValueError, TypeError) as err: msg = "Unable to serialize value: {!r} as type: {!r}." @@ -824,7 +914,9 @@ def serialize_data(self, data, data_type, **kwargs): @classmethod def _get_custom_serializers(cls, data_type, **kwargs): - custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type) + custom_serializer = kwargs.get("basic_types_serializers", {}).get( + data_type + ) if custom_serializer: return custom_serializer if kwargs.get("is_xml", False): @@ -906,7 +998,9 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): serialized.append(None) if kwargs.get("do_quote", False): - serialized = ["" if s is None else quote(str(s), safe="") for s in serialized] + serialized = [ + "" if s is None else quote(str(s), safe="") for s in serialized + ] if div: serialized = ["" if s is None else str(s) for s in serialized] @@ -923,7 +1017,11 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): is_wrapped = xml_desc.get("wrapped", False) node_name = xml_desc.get("itemsName", xml_name) if is_wrapped: - final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + final_result = _create_xml_node( + xml_name, + xml_desc.get("prefix", None), + xml_desc.get("ns", None), + ) else: final_result = [] # All list elements to "local_node" @@ -931,7 +1029,11 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): if isinstance(el, ET.Element): el_node = el else: - el_node = _create_xml_node(node_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + el_node = _create_xml_node( + node_name, + xml_desc.get("prefix", None), + xml_desc.get("ns", None), + ) if el is not None: # Otherwise it writes "None" :-p el_node.text = str(el) final_result.append(el_node) @@ -951,7 +1053,9 @@ def serialize_dict(self, attr, dict_type, **kwargs): serialized = {} for key, value in attr.items(): try: - serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) + serialized[self.serialize_unicode(key)] = self.serialize_data( + value, dict_type, **kwargs + ) except ValueError as err: if isinstance(err, SerializationError): raise @@ -962,7 +1066,11 @@ def serialize_dict(self, attr, dict_type, **kwargs): xml_desc = serialization_ctxt["xml"] xml_name = xml_desc["name"] - final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + final_result = _create_xml_node( + xml_name, + xml_desc.get("prefix", None), + xml_desc.get("ns", None), + ) for key, value in serialized.items(): ET.SubElement(final_result, key).text = value return final_result @@ -984,7 +1092,9 @@ def serialize_object(self, attr, **kwargs): return attr obj_type = type(attr) if obj_type in self.basic_types: - return self.serialize_basic(attr, self.basic_types[obj_type], **kwargs) + return self.serialize_basic( + attr, self.basic_types[obj_type], **kwargs + ) if obj_type is _long_type: return self.serialize_long(attr) if obj_type is str: @@ -1008,7 +1118,9 @@ def serialize_object(self, attr, **kwargs): serialized = {} for key, value in attr.items(): try: - serialized[self.serialize_unicode(key)] = self.serialize_object(value, **kwargs) + serialized[self.serialize_unicode(key)] = ( + self.serialize_object(value, **kwargs) + ) except ValueError: serialized[self.serialize_unicode(key)] = None return serialized @@ -1123,7 +1235,9 @@ def serialize_rfc(attr, **kwargs): """ try: if not attr.tzinfo: - _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + _LOGGER.warning( + "Datetime with no tzinfo will be considered UTC." + ) utc = attr.utctimetuple() except AttributeError: raise TypeError("RFC1123 object must be valid Datetime object.") @@ -1150,16 +1264,25 @@ def serialize_iso(attr, **kwargs): attr = isodate.parse_datetime(attr) try: if not attr.tzinfo: - _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + _LOGGER.warning( + "Datetime with no tzinfo will be considered UTC." + ) utc = attr.utctimetuple() if utc.tm_year > 9999 or utc.tm_year < 1: raise OverflowError("Hit max or min date") - microseconds = str(attr.microsecond).rjust(6, "0").rstrip("0").ljust(3, "0") + microseconds = ( + str(attr.microsecond).rjust(6, "0").rstrip("0").ljust(3, "0") + ) if microseconds: microseconds = "." + microseconds date = "{:04}-{:02}-{:02}T{:02}:{:02}:{:02}".format( - utc.tm_year, utc.tm_mon, utc.tm_mday, utc.tm_hour, utc.tm_min, utc.tm_sec + utc.tm_year, + utc.tm_mon, + utc.tm_mday, + utc.tm_hour, + utc.tm_min, + utc.tm_sec, ) return date + microseconds + "Z" except (ValueError, OverflowError) as err: @@ -1182,7 +1305,9 @@ def serialize_unix(attr, **kwargs): return attr try: if not attr.tzinfo: - _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + _LOGGER.warning( + "Datetime with no tzinfo will be considered UTC." + ) return int(calendar.timegm(attr.utctimetuple())) except AttributeError: raise TypeError("Unix time object must be valid Datetime object.") @@ -1219,7 +1344,9 @@ def rest_key_case_insensitive_extractor(attr, attr_desc, data): key = _decode_attribute_map_key(dict_keys[0]) break working_key = _decode_attribute_map_key(dict_keys[0]) - working_data = attribute_key_case_insensitive_extractor(working_key, None, working_data) + working_data = attribute_key_case_insensitive_extractor( + working_key, None, working_data + ) if working_data is None: # If at any point while following flatten JSON path see None, it means # that all properties under are None as well @@ -1227,7 +1354,9 @@ def rest_key_case_insensitive_extractor(attr, attr_desc, data): key = ".".join(dict_keys[1:]) if working_data: - return attribute_key_case_insensitive_extractor(key, None, working_data) + return attribute_key_case_insensitive_extractor( + key, None, working_data + ) def last_rest_key_extractor(attr, attr_desc, data): @@ -1311,15 +1440,25 @@ def xml_key_extractor(attr, attr_desc, data): # - Wrapped node # - Internal type is an enum (considered basic types) # - Internal type has no XML/Name node - if is_wrapped or (internal_type and (issubclass(internal_type, Enum) or "name" not in internal_type_xml_map)): + if is_wrapped or ( + internal_type + and ( + issubclass(internal_type, Enum) + or "name" not in internal_type_xml_map + ) + ): children = data.findall(xml_name) # If internal type has a local name and it's not a list, I use that name - elif not is_iter_type and internal_type and "name" in internal_type_xml_map: + elif ( + not is_iter_type and internal_type and "name" in internal_type_xml_map + ): xml_name = _extract_name_from_internal_type(internal_type) children = data.findall(xml_name) # That's an array else: - if internal_type: # Complex type, ignore itemsName and use the complex type name + if ( + internal_type + ): # Complex type, ignore itemsName and use the complex type name items_name = _extract_name_from_internal_type(internal_type) else: items_name = xml_desc.get("itemsName", xml_name) @@ -1348,7 +1487,9 @@ def xml_key_extractor(attr, attr_desc, data): # Here it's not a itertype, we should have found one element only or empty if len(children) > 1: - raise DeserializationError("Find several XML '{}' where it was not expected".format(xml_name)) + raise DeserializationError( + "Find several XML '{}' where it was not expected".format(xml_name) + ) return children[0] @@ -1361,7 +1502,10 @@ class Deserializer(object): basic_types = {str: "str", int: "int", bool: "bool", float: "float"} - valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") + valid_date = re.compile( + r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" + r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?" + ) def __init__(self, classes: Optional[Mapping[str, type]] = None): self.deserialize_type = { @@ -1417,7 +1561,11 @@ def _deserialize(self, target_obj, data): """ # This is already a model, go recursive just in case if hasattr(data, "_attribute_map"): - constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")] + constants = [ + name + for name, config in getattr(data, "_validation", {}).items() + if config.get("constant") + ] try: for attr, mapconfig in data._attribute_map.items(): if attr in constants: @@ -1427,7 +1575,10 @@ def _deserialize(self, target_obj, data): continue local_type = mapconfig["type"] internal_data_type = local_type.strip("[]{}") - if internal_data_type not in self.dependencies or isinstance(internal_data_type, Enum): + if ( + internal_data_type not in self.dependencies + or isinstance(internal_data_type, Enum) + ): continue setattr(data, attr, self._deserialize(local_type, value)) return data @@ -1452,10 +1603,14 @@ def _deserialize(self, target_obj, data): continue raw_value = None # Enhance attr_desc with some dynamic data - attr_desc = attr_desc.copy() # Do a copy, do not change the real one + attr_desc = ( + attr_desc.copy() + ) # Do a copy, do not change the real one internal_data_type = attr_desc["type"].strip("[]{}") if internal_data_type in self.dependencies: - attr_desc["internalType"] = self.dependencies[internal_data_type] + attr_desc["internalType"] = self.dependencies[ + internal_data_type + ] for key_extractor in self.key_extractors: found_value = key_extractor(attr, attr_desc, data) @@ -1465,7 +1620,9 @@ def _deserialize(self, target_obj, data): "Ignoring extracted value '%s' from %s for key '%s'" " (duplicate extraction, follow extractors order)" ) - _LOGGER.warning(msg, found_value, key_extractor, attr) + _LOGGER.warning( + msg, found_value, key_extractor, attr + ) continue raw_value = found_value @@ -1475,13 +1632,20 @@ def _deserialize(self, target_obj, data): msg = "Unable to deserialize to object: " + class_name # type: ignore raise DeserializationError(msg) from err else: - additional_properties = self._build_additional_properties(attributes, data) - return self._instantiate_model(response, d_attrs, additional_properties) + additional_properties = self._build_additional_properties( + attributes, data + ) + return self._instantiate_model( + response, d_attrs, additional_properties + ) def _build_additional_properties(self, attribute_map, data): if not self.additional_properties_detection: return None - if "additional_properties" in attribute_map and attribute_map.get("additional_properties", {}).get("key") != "": + if ( + "additional_properties" in attribute_map + and attribute_map.get("additional_properties", {}).get("key") != "" + ): # Check empty string. If it's not empty, someone has a real "additionalProperties" return None if isinstance(data, ET.Element): @@ -1534,7 +1698,8 @@ def failsafe_deserialize(self, target_obj, data, content_type=None): return self(target_obj, data, content_type=content_type) except: _LOGGER.debug( - "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", + exc_info=True, ) return None @@ -1560,15 +1725,21 @@ def _unpack_content(raw_data, content_type=None): if context: if RawDeserializer.CONTEXT_NAME in context: return context[RawDeserializer.CONTEXT_NAME] - raise ValueError("This pipeline didn't have the RawDeserializer policy; can't deserialize") + raise ValueError( + "This pipeline didn't have the RawDeserializer policy; can't deserialize" + ) # Assume this is enough to recognize universal_http.ClientResponse without importing it if hasattr(raw_data, "body"): - return RawDeserializer.deserialize_from_http_generics(raw_data.text(), raw_data.headers) + return RawDeserializer.deserialize_from_http_generics( + raw_data.text(), raw_data.headers + ) # Assume this enough to recognize requests.Response without importing it. if hasattr(raw_data, "_content_consumed"): - return RawDeserializer.deserialize_from_http_generics(raw_data.text, raw_data.headers) + return RawDeserializer.deserialize_from_http_generics( + raw_data.text, raw_data.headers + ) if isinstance(raw_data, (str, bytes)) or hasattr(raw_data, "read"): return RawDeserializer.deserialize_from_text(raw_data, content_type) # type: ignore @@ -1583,9 +1754,21 @@ def _instantiate_model(self, response, attrs, additional_properties=None): if callable(response): subtype = getattr(response, "_subtype_map", {}) try: - readonly = [k for k, v in response._validation.items() if v.get("readonly")] - const = [k for k, v in response._validation.items() if v.get("constant")] - kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const} + readonly = [ + k + for k, v in response._validation.items() + if v.get("readonly") + ] + const = [ + k + for k, v in response._validation.items() + if v.get("constant") + ] + kwargs = { + k: v + for k, v in attrs.items() + if k not in subtype and k not in readonly + const + } response_obj = response(**kwargs) for attr in readonly: setattr(response_obj, attr, attrs.get(attr)) @@ -1622,11 +1805,22 @@ def deserialize_data(self, data, data_type): if data_type in self.basic_types.values(): return self.deserialize_basic(data, data_type) if data_type in self.deserialize_type: - if isinstance(data, self.deserialize_expected_types.get(data_type, tuple())): + if isinstance( + data, + self.deserialize_expected_types.get(data_type, tuple()), + ): return data - is_a_text_parsing_type = lambda x: x not in ["object", "[]", r"{}"] - if isinstance(data, ET.Element) and is_a_text_parsing_type(data_type) and not data.text: + is_a_text_parsing_type = lambda x: x not in [ + "object", + "[]", + r"{}", + ] + if ( + isinstance(data, ET.Element) + and is_a_text_parsing_type(data_type) + and not data.text + ): return None data_val = self.deserialize_type[data_type](data) return data_val @@ -1657,10 +1851,16 @@ def deserialize_iter(self, attr, iter_type): """ if attr is None: return None - if isinstance(attr, ET.Element): # If I receive an element here, get the children + if isinstance( + attr, ET.Element + ): # If I receive an element here, get the children attr = list(attr) if not isinstance(attr, (list, set)): - raise DeserializationError("Cannot deserialize as [{}] an object of type {}".format(iter_type, type(attr))) + raise DeserializationError( + "Cannot deserialize as [{}] an object of type {}".format( + iter_type, type(attr) + ) + ) return [self.deserialize_data(a, iter_type) for a in attr] def deserialize_dict(self, attr, dict_type): @@ -1672,12 +1872,17 @@ def deserialize_dict(self, attr, dict_type): :rtype: dict """ if isinstance(attr, list): - return {x["key"]: self.deserialize_data(x["value"], dict_type) for x in attr} + return { + x["key"]: self.deserialize_data(x["value"], dict_type) + for x in attr + } if isinstance(attr, ET.Element): # Transform value into {"Key": "value"} attr = {el.tag: el.text for el in attr} - return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()} + return { + k: self.deserialize_data(v, dict_type) for k, v in attr.items() + } def deserialize_object(self, attr, **kwargs): """Deserialize a generic object. @@ -1704,7 +1909,9 @@ def deserialize_object(self, attr, **kwargs): deserialized = {} for key, value in attr.items(): try: - deserialized[key] = self.deserialize_object(value, **kwargs) + deserialized[key] = self.deserialize_object( + value, **kwargs + ) except ValueError: deserialized[key] = None return deserialized @@ -1812,7 +2019,11 @@ def deserialize_enum(data, enum_obj): if enum_value.value.lower() == str(data).lower(): return enum_value # We don't fail anymore for unknown value, we deserialize as a string - _LOGGER.warning("Deserializer is not able to find %s as valid enum in %s", data, enum_obj) + _LOGGER.warning( + "Deserializer is not able to find %s as valid enum in %s", + data, + enum_obj, + ) return Deserializer.deserialize_unicode(data) @staticmethod @@ -1899,7 +2110,9 @@ def deserialize_date(attr): if isinstance(attr, ET.Element): attr = attr.text if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore - raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + raise DeserializationError( + "Date must have only digits and -. Received: %s" % attr + ) # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. return isodate.parse_date(attr, defaultmonth=0, defaultday=0) @@ -1914,7 +2127,9 @@ def deserialize_time(attr): if isinstance(attr, ET.Element): attr = attr.text if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore - raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + raise DeserializationError( + "Date must have only digits and -. Received: %s" % attr + ) return isodate.parse_time(attr) @staticmethod @@ -1930,7 +2145,10 @@ def deserialize_rfc(attr): try: parsed_date = email.utils.parsedate_tz(attr) # type: ignore date_obj = datetime.datetime( - *parsed_date[:6], tzinfo=_FixedOffset(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) + *parsed_date[:6], + tzinfo=_FixedOffset( + datetime.timedelta(minutes=(parsed_date[9] or 0) / 60) + ) ) if not date_obj.tzinfo: date_obj = date_obj.astimezone(tz=TZ_UTC) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/aio/_client.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/aio/_client.py index 15b33f0ed349..4f8f396a9e27 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/aio/_client.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/aio/_client.py @@ -75,15 +75,23 @@ def __init__( self._config.custom_hook_policy, self._config.logging_policy, policies.DistributedTracingPolicy(**kwargs), - policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + ( + policies.SensitiveHeaderCleanupPolicy(**kwargs) + if self._config.redirect_policy + else None + ), self._config.http_logging_policy, ] - self._client: AsyncPipelineClient = AsyncPipelineClient(base_url=_endpoint, policies=_policies, **kwargs) + self._client: AsyncPipelineClient = AsyncPipelineClient( + base_url=_endpoint, policies=_policies, **kwargs + ) self._serialize = Serializer() self._deserialize = Deserializer() self._serialize.client_side_validation = False - self.indexes = IndexesOperations(self._client, self._config, self._serialize, self._deserialize) + self.indexes = IndexesOperations( + self._client, self._config, self._serialize, self._deserialize + ) def send_request( self, request: HttpRequest, *, stream: bool = False, **kwargs: Any @@ -107,15 +115,29 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "subscriptionId": self._serialize.url("self._config.subscription_id", self._config.subscription_id, "str"), + "endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str" + ), + "subscriptionId": self._serialize.url( + "self._config.subscription_id", + self._config.subscription_id, + "str", + ), "resourceGroupName": self._serialize.url( - "self._config.resource_group_name", self._config.resource_group_name, "str" + "self._config.resource_group_name", + self._config.resource_group_name, + "str", + ), + "workspaceName": self._serialize.url( + "self._config.workspace_name", + self._config.workspace_name, + "str", ), - "workspaceName": self._serialize.url("self._config.workspace_name", self._config.workspace_name, "str"), } - request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) + request_copy.url = self._client.format_url( + request_copy.url, **path_format_arguments + ) return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore async def close(self) -> None: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/aio/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/aio/_configuration.py index b84973cbe86c..951b40b45fce 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/aio/_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/aio/_configuration.py @@ -55,7 +55,9 @@ def __init__( if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") if resource_group_name is None: - raise ValueError("Parameter 'resource_group_name' must not be None.") + raise ValueError( + "Parameter 'resource_group_name' must not be None." + ) if workspace_name is None: raise ValueError("Parameter 'workspace_name' must not be None.") if credential is None: @@ -67,22 +69,44 @@ def __init__( self.workspace_name = workspace_name self.credential = credential self.api_version = api_version - self.credential_scopes = kwargs.pop("credential_scopes", ["https://ml.azure.com/.default"]) - kwargs.setdefault("sdk_moniker", "azure_ai_assets_v2024_04_01/{}".format(VERSION)) + self.credential_scopes = kwargs.pop( + "credential_scopes", ["https://ml.azure.com/.default"] + ) + kwargs.setdefault( + "sdk_moniker", "azure_ai_assets_v2024_04_01/{}".format(VERSION) + ) self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: - self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or policies.HttpLoggingPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) + self.user_agent_policy = kwargs.get( + "user_agent_policy" + ) or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get( + "headers_policy" + ) or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy( + **kwargs + ) + self.logging_policy = kwargs.get( + "logging_policy" + ) or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get( + "http_logging_policy" + ) or policies.HttpLoggingPolicy(**kwargs) + self.custom_hook_policy = kwargs.get( + "custom_hook_policy" + ) or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get( + "redirect_policy" + ) or policies.AsyncRedirectPolicy(**kwargs) + self.retry_policy = kwargs.get( + "retry_policy" + ) or policies.AsyncRetryPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy( - self.credential, *self.credential_scopes, **kwargs + self.authentication_policy = ( + policies.AsyncBearerTokenCredentialPolicy( + self.credential, *self.credential_scopes, **kwargs + ) ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/aio/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/aio/_patch.py index f7dd32510333..abf561200a3f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/aio/_patch.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/aio/_patch.py @@ -8,7 +8,9 @@ """ from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level +__all__: List[str] = ( + [] +) # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/aio/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/aio/operations/_operations.py index ffda5f64a2db..be1310764e0e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/aio/operations/_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/aio/operations/_operations.py @@ -9,7 +9,19 @@ from io import IOBase import json import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, List, Optional, Type, TypeVar, Union, overload +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + IO, + List, + Optional, + Type, + TypeVar, + Union, + overload, +) import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -44,7 +56,12 @@ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class IndexesOperations: @@ -59,13 +76,23 @@ class IndexesOperations: def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client = ( + input_args.pop(0) if input_args else kwargs.pop("client") + ) + self._config = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize = ( + input_args.pop(0) if input_args else kwargs.pop("serializer") + ) + self._deserialize = ( + input_args.pop(0) if input_args else kwargs.pop("deserializer") + ) @distributed_trace_async - async def get(self, name: str, version: str, **kwargs: Any) -> _models.Index: + async def get( + self, name: str, version: str, **kwargs: Any + ) -> _models.Index: # pylint: disable=line-too-long """Fetch a IndexVersion by name. @@ -129,18 +156,34 @@ async def get(self, name: str, version: str, **kwargs: Any) -> _models.Index: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "subscriptionId": self._serialize.url("self._config.subscription_id", self._config.subscription_id, "str"), + "endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str" + ), + "subscriptionId": self._serialize.url( + "self._config.subscription_id", + self._config.subscription_id, + "str", + ), "resourceGroupName": self._serialize.url( - "self._config.resource_group_name", self._config.resource_group_name, "str" + "self._config.resource_group_name", + self._config.resource_group_name, + "str", + ), + "workspaceName": self._serialize.url( + "self._config.workspace_name", + self._config.workspace_name, + "str", ), - "workspaceName": self._serialize.url("self._config.workspace_name", self._config.workspace_name, "str"), } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + _request.url = self._client.format_url( + _request.url, **path_format_arguments + ) _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response @@ -148,7 +191,11 @@ async def get(self, name: str, version: str, **kwargs: Any) -> _models.Index: if response.status_code not in [200]: if _stream: await response.read() # Load the body in memory and close the socket - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) raise HttpResponseError(response=response) if _stream: @@ -163,7 +210,13 @@ async def get(self, name: str, version: str, **kwargs: Any) -> _models.Index: @overload async def create_or_update( - self, name: str, version: str, body: _models.Index, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + version: str, + body: _models.Index, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.Index: # pylint: disable=line-too-long """Creates or updates a IndexVersion. @@ -243,7 +296,13 @@ async def create_or_update( @overload async def create_or_update( - self, name: str, version: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + version: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.Index: # pylint: disable=line-too-long """Creates or updates a IndexVersion. @@ -295,7 +354,13 @@ async def create_or_update( @overload async def create_or_update( - self, name: str, version: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + version: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.Index: # pylint: disable=line-too-long """Creates or updates a IndexVersion. @@ -347,7 +412,11 @@ async def create_or_update( @distributed_trace_async async def create_or_update( - self, name: str, version: str, body: Union[_models.Index, JSON, IO[bytes]], **kwargs: Any + self, + name: str, + version: str, + body: Union[_models.Index, JSON, IO[bytes]], + **kwargs: Any ) -> _models.Index: # pylint: disable=line-too-long """Creates or updates a IndexVersion. @@ -433,7 +502,9 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type: Optional[str] = kwargs.pop( + "content_type", _headers.pop("Content-Type", None) + ) cls: ClsType[_models.Index] = kwargs.pop("cls", None) content_type = content_type or "application/json" @@ -453,18 +524,34 @@ async def create_or_update( params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "subscriptionId": self._serialize.url("self._config.subscription_id", self._config.subscription_id, "str"), + "endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str" + ), + "subscriptionId": self._serialize.url( + "self._config.subscription_id", + self._config.subscription_id, + "str", + ), "resourceGroupName": self._serialize.url( - "self._config.resource_group_name", self._config.resource_group_name, "str" + "self._config.resource_group_name", + self._config.resource_group_name, + "str", + ), + "workspaceName": self._serialize.url( + "self._config.workspace_name", + self._config.workspace_name, + "str", ), - "workspaceName": self._serialize.url("self._config.workspace_name", self._config.workspace_name, "str"), } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + _request.url = self._client.format_url( + _request.url, **path_format_arguments + ) _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response @@ -472,7 +559,11 @@ async def create_or_update( if response.status_code not in [200, 201]: if _stream: await response.read() # Load the body in memory and close the socket - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) raise HttpResponseError(response=response) if response.status_code == 200: @@ -587,18 +678,28 @@ def prepare_request(next_link=None): params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str" + ), "subscriptionId": self._serialize.url( - "self._config.subscription_id", self._config.subscription_id, "str" + "self._config.subscription_id", + self._config.subscription_id, + "str", ), "resourceGroupName": self._serialize.url( - "self._config.resource_group_name", self._config.resource_group_name, "str" + "self._config.resource_group_name", + self._config.resource_group_name, + "str", ), "workspaceName": self._serialize.url( - "self._config.workspace_name", self._config.workspace_name, "str" + "self._config.workspace_name", + self._config.workspace_name, + "str", ), } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + _request.url = self._client.format_url( + _request.url, **path_format_arguments + ) else: # make call to next link with the client's api-version @@ -606,49 +707,73 @@ def prepare_request(next_link=None): _next_request_params = case_insensitive_dict( { key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + for key, value in urllib.parse.parse_qs( + _parsed_next_link.query + ).items() } ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + params=_next_request_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str" + ), "subscriptionId": self._serialize.url( - "self._config.subscription_id", self._config.subscription_id, "str" + "self._config.subscription_id", + self._config.subscription_id, + "str", ), "resourceGroupName": self._serialize.url( - "self._config.resource_group_name", self._config.resource_group_name, "str" + "self._config.resource_group_name", + self._config.resource_group_name, + "str", ), "workspaceName": self._serialize.url( - "self._config.workspace_name", self._config.workspace_name, "str" + "self._config.workspace_name", + self._config.workspace_name, + "str", ), } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + _request.url = self._client.format_url( + _request.url, **path_format_arguments + ) return _request async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Index], deserialized["value"]) + list_of_elem = _deserialize( + List[_models.Index], deserialized["value"] + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + return deserialized.get("nextLink") or None, AsyncList( + list_of_elem + ) async def get_next(next_link=None): _request = prepare_request(next_link) _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: if _stream: await response.read() # Load the body in memory and close the socket - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) raise HttpResponseError(response=response) return pipeline_response @@ -717,18 +842,34 @@ async def get_latest(self, name: str, **kwargs: Any) -> _models.Index: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "subscriptionId": self._serialize.url("self._config.subscription_id", self._config.subscription_id, "str"), + "endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str" + ), + "subscriptionId": self._serialize.url( + "self._config.subscription_id", + self._config.subscription_id, + "str", + ), "resourceGroupName": self._serialize.url( - "self._config.resource_group_name", self._config.resource_group_name, "str" + "self._config.resource_group_name", + self._config.resource_group_name, + "str", + ), + "workspaceName": self._serialize.url( + "self._config.workspace_name", + self._config.workspace_name, + "str", ), - "workspaceName": self._serialize.url("self._config.workspace_name", self._config.workspace_name, "str"), } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + _request.url = self._client.format_url( + _request.url, **path_format_arguments + ) _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response @@ -736,7 +877,11 @@ async def get_latest(self, name: str, **kwargs: Any) -> _models.Index: if response.status_code not in [200]: if _stream: await response.read() # Load the body in memory and close the socket - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) raise HttpResponseError(response=response) if _stream: @@ -750,7 +895,9 @@ async def get_latest(self, name: str, **kwargs: Any) -> _models.Index: return deserialized # type: ignore @distributed_trace_async - async def get_next_version(self, name: str, **kwargs: Any) -> _models.VersionInfo: + async def get_next_version( + self, name: str, **kwargs: Any + ) -> _models.VersionInfo: """Get next Index version. :param name: Name of the index. Required. @@ -788,18 +935,34 @@ async def get_next_version(self, name: str, **kwargs: Any) -> _models.VersionInf params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "subscriptionId": self._serialize.url("self._config.subscription_id", self._config.subscription_id, "str"), + "endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str" + ), + "subscriptionId": self._serialize.url( + "self._config.subscription_id", + self._config.subscription_id, + "str", + ), "resourceGroupName": self._serialize.url( - "self._config.resource_group_name", self._config.resource_group_name, "str" + "self._config.resource_group_name", + self._config.resource_group_name, + "str", + ), + "workspaceName": self._serialize.url( + "self._config.workspace_name", + self._config.workspace_name, + "str", ), - "workspaceName": self._serialize.url("self._config.workspace_name", self._config.workspace_name, "str"), } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + _request.url = self._client.format_url( + _request.url, **path_format_arguments + ) _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response @@ -807,7 +970,11 @@ async def get_next_version(self, name: str, **kwargs: Any) -> _models.VersionInf if response.status_code not in [200]: if _stream: await response.read() # Load the body in memory and close the socket - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) raise HttpResponseError(response=response) if _stream: @@ -822,7 +989,11 @@ async def get_next_version(self, name: str, **kwargs: Any) -> _models.VersionInf @distributed_trace def list_latest( - self, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any + self, + *, + top: Optional[int] = None, + skip: Optional[int] = None, + **kwargs: Any ) -> AsyncIterable["_models.Index"]: # pylint: disable=line-too-long """List the latest version of each index. @@ -892,18 +1063,28 @@ def prepare_request(next_link=None): params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str" + ), "subscriptionId": self._serialize.url( - "self._config.subscription_id", self._config.subscription_id, "str" + "self._config.subscription_id", + self._config.subscription_id, + "str", ), "resourceGroupName": self._serialize.url( - "self._config.resource_group_name", self._config.resource_group_name, "str" + "self._config.resource_group_name", + self._config.resource_group_name, + "str", ), "workspaceName": self._serialize.url( - "self._config.workspace_name", self._config.workspace_name, "str" + "self._config.workspace_name", + self._config.workspace_name, + "str", ), } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + _request.url = self._client.format_url( + _request.url, **path_format_arguments + ) else: # make call to next link with the client's api-version @@ -911,49 +1092,73 @@ def prepare_request(next_link=None): _next_request_params = case_insensitive_dict( { key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + for key, value in urllib.parse.parse_qs( + _parsed_next_link.query + ).items() } ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + params=_next_request_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str" + ), "subscriptionId": self._serialize.url( - "self._config.subscription_id", self._config.subscription_id, "str" + "self._config.subscription_id", + self._config.subscription_id, + "str", ), "resourceGroupName": self._serialize.url( - "self._config.resource_group_name", self._config.resource_group_name, "str" + "self._config.resource_group_name", + self._config.resource_group_name, + "str", ), "workspaceName": self._serialize.url( - "self._config.workspace_name", self._config.workspace_name, "str" + "self._config.workspace_name", + self._config.workspace_name, + "str", ), } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + _request.url = self._client.format_url( + _request.url, **path_format_arguments + ) return _request async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Index], deserialized["value"]) + list_of_elem = _deserialize( + List[_models.Index], deserialized["value"] + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + return deserialized.get("nextLink") or None, AsyncList( + list_of_elem + ) async def get_next(next_link=None): _request = prepare_request(next_link) _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: if _stream: await response.read() # Load the body in memory and close the socket - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) raise HttpResponseError(response=response) return pipeline_response diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/aio/operations/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/aio/operations/_patch.py index f7dd32510333..abf561200a3f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/aio/operations/_patch.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/aio/operations/_patch.py @@ -8,7 +8,9 @@ """ from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level +__all__: List[str] = ( + [] +) # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/models/_models.py index 5d49173b3b10..671d45d5152a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/models/_models.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/models/_models.py @@ -52,7 +52,9 @@ class Index(_model_base.Model): under development. Required.""" description: Optional[str] = rest_field() """Description information of the asset.""" - system_data: Optional["_models.SystemData"] = rest_field(name="systemData", visibility=["read"]) + system_data: Optional["_models.SystemData"] = rest_field( + name="systemData", visibility=["read"] + ) """Metadata containing createdBy and modifiedBy information.""" tags: Optional[Dict[str, str]] = rest_field() """Asset's tags.""" @@ -71,8 +73,7 @@ def __init__( description: Optional[str] = None, tags: Optional[Dict[str, str]] = None, properties: Optional[Dict[str, str]] = None, - ): - ... + ): ... @overload def __init__(self, mapping: Mapping[str, Any]): @@ -81,7 +82,9 @@ def __init__(self, mapping: Mapping[str, Any]): :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__( + self, *args: Any, **kwargs: Any + ) -> None: # pylint: disable=useless-super-delegation super().__init__(*args, **kwargs) @@ -107,8 +110,7 @@ def __init__( *, value: List["_models.Index"], next_link: Optional[str] = None, - ): - ... + ): ... @overload def __init__(self, mapping: Mapping[str, Any]): @@ -117,7 +119,9 @@ def __init__(self, mapping: Mapping[str, Any]): :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__( + self, *args: Any, **kwargs: Any + ) -> None: # pylint: disable=useless-super-delegation super().__init__(*args, **kwargs) @@ -136,11 +140,17 @@ class SystemData(_model_base.Model): :vartype last_modified_at: ~datetime.datetime """ - created_at: Optional[datetime.datetime] = rest_field(name="createdAt", visibility=["read"], format="rfc3339") + created_at: Optional[datetime.datetime] = rest_field( + name="createdAt", visibility=["read"], format="rfc3339" + ) """The timestamp the resource was created at.""" - created_by: Optional[str] = rest_field(name="createdBy", visibility=["read"]) + created_by: Optional[str] = rest_field( + name="createdBy", visibility=["read"] + ) """The identity that created the resource.""" - created_by_type: Optional[str] = rest_field(name="createdByType", visibility=["read"]) + created_by_type: Optional[str] = rest_field( + name="createdByType", visibility=["read"] + ) """The identity type that created the resource.""" last_modified_at: Optional[datetime.datetime] = rest_field( name="lastModifiedAt", visibility=["read"], format="rfc3339" @@ -170,8 +180,7 @@ def __init__( *, latest_version: str, next_version: Optional[int] = None, - ): - ... + ): ... @overload def __init__(self, mapping: Mapping[str, Any]): @@ -180,5 +189,7 @@ def __init__(self, mapping: Mapping[str, Any]): :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__( + self, *args: Any, **kwargs: Any + ) -> None: # pylint: disable=useless-super-delegation super().__init__(*args, **kwargs) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/models/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/models/_patch.py index f7dd32510333..abf561200a3f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/models/_patch.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/models/_patch.py @@ -8,7 +8,9 @@ """ from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level +__all__: List[str] = ( + [] +) # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/operations/_operations.py index 3fc98c9b00f9..ed1bb9b33584 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/operations/_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/operations/_operations.py @@ -9,7 +9,19 @@ from io import IOBase import json import sys -from typing import Any, Callable, Dict, IO, Iterable, List, Optional, Type, TypeVar, Union, overload +from typing import ( + Any, + Callable, + Dict, + IO, + Iterable, + List, + Optional, + Type, + TypeVar, + Union, + overload, +) import urllib.parse from azure.core.exceptions import ( @@ -36,17 +48,25 @@ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any + ] +] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False -def build_indexes_get_request(name: str, version: str, **kwargs: Any) -> HttpRequest: +def build_indexes_get_request( + name: str, version: str, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", "2024-04-01-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -59,20 +79,30 @@ def build_indexes_get_request(name: str, version: str, **kwargs: Any) -> HttpReq _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + _params["api-version"] = _SERIALIZER.query( + "api_version", api_version, "str" + ) # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest( + method="GET", url=_url, params=_params, headers=_headers, **kwargs + ) -def build_indexes_create_or_update_request(name: str, version: str, **kwargs: Any) -> HttpRequest: +def build_indexes_create_or_update_request( + name: str, version: str, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01-preview")) + content_type: Optional[str] = kwargs.pop( + "content_type", _headers.pop("Content-Type", None) + ) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", "2024-04-01-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -85,14 +115,20 @@ def build_indexes_create_or_update_request(name: str, version: str, **kwargs: An _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + _params["api-version"] = _SERIALIZER.query( + "api_version", api_version, "str" + ) # Construct headers if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Content-Type"] = _SERIALIZER.header( + "content_type", content_type, "str" + ) _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest( + method="PUT", url=_url, params=_params, headers=_headers, **kwargs + ) def build_indexes_list_request( @@ -109,7 +145,9 @@ def build_indexes_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", "2024-04-01-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -121,8 +159,12 @@ def build_indexes_list_request( _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - _params["listViewType"] = _SERIALIZER.query("list_view_type", list_view_type, "str") + _params["api-version"] = _SERIALIZER.query( + "api_version", api_version, "str" + ) + _params["listViewType"] = _SERIALIZER.query( + "list_view_type", list_view_type, "str" + ) if order_by is not None: _params["orderBy"] = _SERIALIZER.query("order_by", order_by, "str") if tags is not None: @@ -132,19 +174,25 @@ def build_indexes_list_request( if skip is not None: _params["skip"] = _SERIALIZER.query("skip", skip, "int") if maxpagesize is not None: - _params["maxpagesize"] = _SERIALIZER.query("maxpagesize", maxpagesize, "int") + _params["maxpagesize"] = _SERIALIZER.query( + "maxpagesize", maxpagesize, "int" + ) # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest( + method="GET", url=_url, params=_params, headers=_headers, **kwargs + ) def build_indexes_get_latest_request(name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", "2024-04-01-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -156,19 +204,27 @@ def build_indexes_get_latest_request(name: str, **kwargs: Any) -> HttpRequest: _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + _params["api-version"] = _SERIALIZER.query( + "api_version", api_version, "str" + ) # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest( + method="GET", url=_url, params=_params, headers=_headers, **kwargs + ) -def build_indexes_get_next_version_request(name: str, **kwargs: Any) -> HttpRequest: +def build_indexes_get_next_version_request( + name: str, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", "2024-04-01-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -180,39 +236,55 @@ def build_indexes_get_next_version_request(name: str, **kwargs: Any) -> HttpRequ _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + _params["api-version"] = _SERIALIZER.query( + "api_version", api_version, "str" + ) # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest( + method="POST", url=_url, params=_params, headers=_headers, **kwargs + ) def build_indexes_list_latest_request( - *, top: Optional[int] = None, skip: Optional[int] = None, maxpagesize: Optional[int] = None, **kwargs: Any + *, + top: Optional[int] = None, + skip: Optional[int] = None, + maxpagesize: Optional[int] = None, + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", "2024-04-01-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL _url = "/indexes" # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + _params["api-version"] = _SERIALIZER.query( + "api_version", api_version, "str" + ) if top is not None: _params["top"] = _SERIALIZER.query("top", top, "int") if skip is not None: _params["skip"] = _SERIALIZER.query("skip", skip, "int") if maxpagesize is not None: - _params["maxpagesize"] = _SERIALIZER.query("maxpagesize", maxpagesize, "int") + _params["maxpagesize"] = _SERIALIZER.query( + "maxpagesize", maxpagesize, "int" + ) # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest( + method="GET", url=_url, params=_params, headers=_headers, **kwargs + ) class IndexesOperations: @@ -227,10 +299,18 @@ class IndexesOperations: def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client = ( + input_args.pop(0) if input_args else kwargs.pop("client") + ) + self._config = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize = ( + input_args.pop(0) if input_args else kwargs.pop("serializer") + ) + self._deserialize = ( + input_args.pop(0) if input_args else kwargs.pop("deserializer") + ) @distributed_trace def get(self, name: str, version: str, **kwargs: Any) -> _models.Index: @@ -298,17 +378,31 @@ def get(self, name: str, version: str, **kwargs: Any) -> _models.Index: ) path_format_arguments = { "endpoint": self._config.endpoint, - "subscriptionId": self._serialize.url("self._config.subscription_id", self._config.subscription_id, "str"), + "subscriptionId": self._serialize.url( + "self._config.subscription_id", + self._config.subscription_id, + "str", + ), "resourceGroupName": self._serialize.url( - "self._config.resource_group_name", self._config.resource_group_name, "str" + "self._config.resource_group_name", + self._config.resource_group_name, + "str", + ), + "workspaceName": self._serialize.url( + "self._config.workspace_name", + self._config.workspace_name, + "str", ), - "workspaceName": self._serialize.url("self._config.workspace_name", self._config.workspace_name, "str"), } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + _request.url = self._client.format_url( + _request.url, **path_format_arguments + ) _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response @@ -316,7 +410,11 @@ def get(self, name: str, version: str, **kwargs: Any) -> _models.Index: if response.status_code not in [200]: if _stream: response.read() # Load the body in memory and close the socket - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) raise HttpResponseError(response=response) if _stream: @@ -331,7 +429,13 @@ def get(self, name: str, version: str, **kwargs: Any) -> _models.Index: @overload def create_or_update( - self, name: str, version: str, body: _models.Index, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + version: str, + body: _models.Index, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.Index: # pylint: disable=line-too-long """Creates or updates a IndexVersion. @@ -411,7 +515,13 @@ def create_or_update( @overload def create_or_update( - self, name: str, version: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + version: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.Index: # pylint: disable=line-too-long """Creates or updates a IndexVersion. @@ -463,7 +573,13 @@ def create_or_update( @overload def create_or_update( - self, name: str, version: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + version: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.Index: # pylint: disable=line-too-long """Creates or updates a IndexVersion. @@ -515,7 +631,11 @@ def create_or_update( @distributed_trace def create_or_update( - self, name: str, version: str, body: Union[_models.Index, JSON, IO[bytes]], **kwargs: Any + self, + name: str, + version: str, + body: Union[_models.Index, JSON, IO[bytes]], + **kwargs: Any ) -> _models.Index: # pylint: disable=line-too-long """Creates or updates a IndexVersion. @@ -601,7 +721,9 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type: Optional[str] = kwargs.pop( + "content_type", _headers.pop("Content-Type", None) + ) cls: ClsType[_models.Index] = kwargs.pop("cls", None) content_type = content_type or "application/json" @@ -622,17 +744,31 @@ def create_or_update( ) path_format_arguments = { "endpoint": self._config.endpoint, - "subscriptionId": self._serialize.url("self._config.subscription_id", self._config.subscription_id, "str"), + "subscriptionId": self._serialize.url( + "self._config.subscription_id", + self._config.subscription_id, + "str", + ), "resourceGroupName": self._serialize.url( - "self._config.resource_group_name", self._config.resource_group_name, "str" + "self._config.resource_group_name", + self._config.resource_group_name, + "str", + ), + "workspaceName": self._serialize.url( + "self._config.workspace_name", + self._config.workspace_name, + "str", ), - "workspaceName": self._serialize.url("self._config.workspace_name", self._config.workspace_name, "str"), } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + _request.url = self._client.format_url( + _request.url, **path_format_arguments + ) _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response @@ -640,7 +776,11 @@ def create_or_update( if response.status_code not in [200, 201]: if _stream: response.read() # Load the body in memory and close the socket - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) raise HttpResponseError(response=response) if response.status_code == 200: @@ -757,16 +897,24 @@ def prepare_request(next_link=None): path_format_arguments = { "endpoint": self._config.endpoint, "subscriptionId": self._serialize.url( - "self._config.subscription_id", self._config.subscription_id, "str" + "self._config.subscription_id", + self._config.subscription_id, + "str", ), "resourceGroupName": self._serialize.url( - "self._config.resource_group_name", self._config.resource_group_name, "str" + "self._config.resource_group_name", + self._config.resource_group_name, + "str", ), "workspaceName": self._serialize.url( - "self._config.workspace_name", self._config.workspace_name, "str" + "self._config.workspace_name", + self._config.workspace_name, + "str", ), } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + _request.url = self._client.format_url( + _request.url, **path_format_arguments + ) else: # make call to next link with the client's api-version @@ -774,32 +922,46 @@ def prepare_request(next_link=None): _next_request_params = case_insensitive_dict( { key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + for key, value in urllib.parse.parse_qs( + _parsed_next_link.query + ).items() } ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + params=_next_request_params, ) path_format_arguments = { "endpoint": self._config.endpoint, "subscriptionId": self._serialize.url( - "self._config.subscription_id", self._config.subscription_id, "str" + "self._config.subscription_id", + self._config.subscription_id, + "str", ), "resourceGroupName": self._serialize.url( - "self._config.resource_group_name", self._config.resource_group_name, "str" + "self._config.resource_group_name", + self._config.resource_group_name, + "str", ), "workspaceName": self._serialize.url( - "self._config.workspace_name", self._config.workspace_name, "str" + "self._config.workspace_name", + self._config.workspace_name, + "str", ), } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + _request.url = self._client.format_url( + _request.url, **path_format_arguments + ) return _request def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Index], deserialized["value"]) + list_of_elem = _deserialize( + List[_models.Index], deserialized["value"] + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -808,15 +970,21 @@ def get_next(next_link=None): _request = prepare_request(next_link) _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: if _stream: response.read() # Load the body in memory and close the socket - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) raise HttpResponseError(response=response) return pipeline_response @@ -886,17 +1054,31 @@ def get_latest(self, name: str, **kwargs: Any) -> _models.Index: ) path_format_arguments = { "endpoint": self._config.endpoint, - "subscriptionId": self._serialize.url("self._config.subscription_id", self._config.subscription_id, "str"), + "subscriptionId": self._serialize.url( + "self._config.subscription_id", + self._config.subscription_id, + "str", + ), "resourceGroupName": self._serialize.url( - "self._config.resource_group_name", self._config.resource_group_name, "str" + "self._config.resource_group_name", + self._config.resource_group_name, + "str", + ), + "workspaceName": self._serialize.url( + "self._config.workspace_name", + self._config.workspace_name, + "str", ), - "workspaceName": self._serialize.url("self._config.workspace_name", self._config.workspace_name, "str"), } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + _request.url = self._client.format_url( + _request.url, **path_format_arguments + ) _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response @@ -904,7 +1086,11 @@ def get_latest(self, name: str, **kwargs: Any) -> _models.Index: if response.status_code not in [200]: if _stream: response.read() # Load the body in memory and close the socket - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) raise HttpResponseError(response=response) if _stream: @@ -918,7 +1104,9 @@ def get_latest(self, name: str, **kwargs: Any) -> _models.Index: return deserialized # type: ignore @distributed_trace - def get_next_version(self, name: str, **kwargs: Any) -> _models.VersionInfo: + def get_next_version( + self, name: str, **kwargs: Any + ) -> _models.VersionInfo: """Get next Index version. :param name: Name of the index. Required. @@ -957,17 +1145,31 @@ def get_next_version(self, name: str, **kwargs: Any) -> _models.VersionInfo: ) path_format_arguments = { "endpoint": self._config.endpoint, - "subscriptionId": self._serialize.url("self._config.subscription_id", self._config.subscription_id, "str"), + "subscriptionId": self._serialize.url( + "self._config.subscription_id", + self._config.subscription_id, + "str", + ), "resourceGroupName": self._serialize.url( - "self._config.resource_group_name", self._config.resource_group_name, "str" + "self._config.resource_group_name", + self._config.resource_group_name, + "str", + ), + "workspaceName": self._serialize.url( + "self._config.workspace_name", + self._config.workspace_name, + "str", ), - "workspaceName": self._serialize.url("self._config.workspace_name", self._config.workspace_name, "str"), } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + _request.url = self._client.format_url( + _request.url, **path_format_arguments + ) _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response @@ -975,7 +1177,11 @@ def get_next_version(self, name: str, **kwargs: Any) -> _models.VersionInfo: if response.status_code not in [200]: if _stream: response.read() # Load the body in memory and close the socket - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) raise HttpResponseError(response=response) if _stream: @@ -990,7 +1196,11 @@ def get_next_version(self, name: str, **kwargs: Any) -> _models.VersionInfo: @distributed_trace def list_latest( - self, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any + self, + *, + top: Optional[int] = None, + skip: Optional[int] = None, + **kwargs: Any ) -> Iterable["_models.Index"]: # pylint: disable=line-too-long """List the latest version of each index. @@ -1062,16 +1272,24 @@ def prepare_request(next_link=None): path_format_arguments = { "endpoint": self._config.endpoint, "subscriptionId": self._serialize.url( - "self._config.subscription_id", self._config.subscription_id, "str" + "self._config.subscription_id", + self._config.subscription_id, + "str", ), "resourceGroupName": self._serialize.url( - "self._config.resource_group_name", self._config.resource_group_name, "str" + "self._config.resource_group_name", + self._config.resource_group_name, + "str", ), "workspaceName": self._serialize.url( - "self._config.workspace_name", self._config.workspace_name, "str" + "self._config.workspace_name", + self._config.workspace_name, + "str", ), } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + _request.url = self._client.format_url( + _request.url, **path_format_arguments + ) else: # make call to next link with the client's api-version @@ -1079,32 +1297,46 @@ def prepare_request(next_link=None): _next_request_params = case_insensitive_dict( { key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + for key, value in urllib.parse.parse_qs( + _parsed_next_link.query + ).items() } ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + params=_next_request_params, ) path_format_arguments = { "endpoint": self._config.endpoint, "subscriptionId": self._serialize.url( - "self._config.subscription_id", self._config.subscription_id, "str" + "self._config.subscription_id", + self._config.subscription_id, + "str", ), "resourceGroupName": self._serialize.url( - "self._config.resource_group_name", self._config.resource_group_name, "str" + "self._config.resource_group_name", + self._config.resource_group_name, + "str", ), "workspaceName": self._serialize.url( - "self._config.workspace_name", self._config.workspace_name, "str" + "self._config.workspace_name", + self._config.workspace_name, + "str", ), } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + _request.url = self._client.format_url( + _request.url, **path_format_arguments + ) return _request def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Index], deserialized["value"]) + list_of_elem = _deserialize( + List[_models.Index], deserialized["value"] + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -1113,15 +1345,21 @@ def get_next(next_link=None): _request = prepare_request(next_link) _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: if _stream: response.read() # Load the body in memory and close the socket - map_error(status_code=response.status_code, response=response, error_map=error_map) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) raise HttpResponseError(response=response) return pipeline_response diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/operations/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/operations/_patch.py index f7dd32510333..abf561200a3f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/operations/_patch.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/azure_ai_assets_v2024_04_01/azureaiassetsv20240401/operations/_patch.py @@ -8,7 +8,9 @@ """ from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level +__all__: List[str] = ( + [] +) # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/__init__.py index da46614477a9..71cf8fdc020d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/__init__.py @@ -10,9 +10,10 @@ from ._version import VERSION __version__ = VERSION -__all__ = ['AzureMachineLearningWorkspaces'] +__all__ = ["AzureMachineLearningWorkspaces"] # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk + patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/_azure_machine_learning_workspaces.py index faa760c5838e..62a3ad3c146a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/_azure_machine_learning_workspaces.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/_azure_machine_learning_workspaces.py @@ -14,7 +14,16 @@ from . import models from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import DataCallOperations, DataContainerOperations, DataVersionOperations, DatasetControllerV2Operations, DatasetV2Operations, DatasetsV1Operations, DeleteOperations, GetOperationStatusOperations +from .operations import ( + DataCallOperations, + DataContainerOperations, + DataVersionOperations, + DatasetControllerV2Operations, + DatasetV2Operations, + DatasetsV1Operations, + DeleteOperations, + GetOperationStatusOperations, +) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -23,6 +32,7 @@ from azure.core.credentials import TokenCredential from azure.core.rest import HttpRequest, HttpResponse + class AzureMachineLearningWorkspaces(object): """AzureMachineLearningWorkspaces. @@ -59,22 +69,43 @@ def __init__( **kwargs # type: Any ): # type: (...) -> None - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, **kwargs) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._config = AzureMachineLearningWorkspacesConfiguration( + credential=credential, **kwargs + ) + self._client = ARMPipelineClient( + base_url=base_url, config=self._config, **kwargs + ) + + client_models = { + k: v for k, v in models.__dict__.items() if isinstance(v, type) + } self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.data_call = DataCallOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_container = DataContainerOperations(self._client, self._config, self._serialize, self._deserialize) - self.delete = DeleteOperations(self._client, self._config, self._serialize, self._deserialize) - self.datasets_v1 = DatasetsV1Operations(self._client, self._config, self._serialize, self._deserialize) - self.dataset_controller_v2 = DatasetControllerV2Operations(self._client, self._config, self._serialize, self._deserialize) - self.dataset_v2 = DatasetV2Operations(self._client, self._config, self._serialize, self._deserialize) - self.data_version = DataVersionOperations(self._client, self._config, self._serialize, self._deserialize) - self.get_operation_status = GetOperationStatusOperations(self._client, self._config, self._serialize, self._deserialize) - + self.data_call = DataCallOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_container = DataContainerOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.delete = DeleteOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.datasets_v1 = DatasetsV1Operations( + self._client, self._config, self._serialize, self._deserialize + ) + self.dataset_controller_v2 = DatasetControllerV2Operations( + self._client, self._config, self._serialize, self._deserialize + ) + self.dataset_v2 = DatasetV2Operations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_version = DataVersionOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.get_operation_status = GetOperationStatusOperations( + self._client, self._config, self._serialize, self._deserialize + ) def _send_request( self, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/_configuration.py index 2ec7eb9ec4cc..b428b8d93394 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/_configuration.py @@ -10,7 +10,10 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ( + ARMChallengeAuthenticationPolicy, + ARMHttpLoggingPolicy, +) from ._version import VERSION @@ -37,28 +40,51 @@ def __init__( **kwargs # type: Any ): # type: (...) -> None - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) + super(AzureMachineLearningWorkspacesConfiguration, self).__init__( + **kwargs + ) if credential is None: raise ValueError("Parameter 'credential' must not be None.") self.credential = credential - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) + self.credential_scopes = kwargs.pop( + "credential_scopes", ["https://management.azure.com/.default"] + ) + kwargs.setdefault( + "sdk_moniker", "mgmt-machinelearningservices/{}".format(VERSION) + ) self._configure(**kwargs) def _configure( - self, - **kwargs # type: Any + self, **kwargs # type: Any ): # type: (...) -> None - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') + self.user_agent_policy = kwargs.get( + "user_agent_policy" + ) or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get( + "headers_policy" + ) or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy( + **kwargs + ) + self.logging_policy = kwargs.get( + "logging_policy" + ) or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get( + "http_logging_policy" + ) or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy( + **kwargs + ) + self.custom_hook_policy = kwargs.get( + "custom_hook_policy" + ) or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get( + "redirect_policy" + ) or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = ARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/_patch.py index 74e48ecd07cf..17dbc073e01b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/_patch.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/_patch.py @@ -25,7 +25,8 @@ # # -------------------------------------------------------------------------- + # This file is used for handwritten extensions to the generated code. Example: # https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md def patch_sdk(): - pass \ No newline at end of file + pass diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/_vendor.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/_vendor.py index 138f663c53a4..ed3373e9699d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/_vendor.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/_vendor.py @@ -7,13 +7,20 @@ from azure.core.pipeline.transport import HttpRequest + def _convert_request(request, files=None): data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + request = HttpRequest( + method=request.method, + url=request.url, + headers=request.headers, + data=data, + ) if files: request.set_formdata_body(files) return request + def _format_url_section(template, **kwargs): components = template.split("/") while components: @@ -22,6 +29,8 @@ def _format_url_section(template, **kwargs): except KeyError as key: formatted_components = template.split("/") components = [ - c for c in formatted_components if "{}".format(key.args[0]) not in c + c + for c in formatted_components + if "{}".format(key.args[0]) not in c ] template = "/".join(components) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/__init__.py index f67ccda966f1..b90ec7485f14 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/__init__.py @@ -7,9 +7,11 @@ # -------------------------------------------------------------------------- from ._azure_machine_learning_workspaces import AzureMachineLearningWorkspaces -__all__ = ['AzureMachineLearningWorkspaces'] + +__all__ = ["AzureMachineLearningWorkspaces"] # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk + patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/_azure_machine_learning_workspaces.py index 597cca3df815..aefb5a0227b7 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/_azure_machine_learning_workspaces.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/_azure_machine_learning_workspaces.py @@ -15,12 +15,22 @@ from .. import models from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import DataCallOperations, DataContainerOperations, DataVersionOperations, DatasetControllerV2Operations, DatasetV2Operations, DatasetsV1Operations, DeleteOperations, GetOperationStatusOperations +from .operations import ( + DataCallOperations, + DataContainerOperations, + DataVersionOperations, + DatasetControllerV2Operations, + DatasetV2Operations, + DatasetsV1Operations, + DeleteOperations, + GetOperationStatusOperations, +) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential + class AzureMachineLearningWorkspaces: """AzureMachineLearningWorkspaces. @@ -57,27 +67,46 @@ def __init__( base_url: str = "", **kwargs: Any ) -> None: - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, **kwargs) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._config = AzureMachineLearningWorkspacesConfiguration( + credential=credential, **kwargs + ) + self._client = AsyncARMPipelineClient( + base_url=base_url, config=self._config, **kwargs + ) + + client_models = { + k: v for k, v in models.__dict__.items() if isinstance(v, type) + } self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.data_call = DataCallOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_container = DataContainerOperations(self._client, self._config, self._serialize, self._deserialize) - self.delete = DeleteOperations(self._client, self._config, self._serialize, self._deserialize) - self.datasets_v1 = DatasetsV1Operations(self._client, self._config, self._serialize, self._deserialize) - self.dataset_controller_v2 = DatasetControllerV2Operations(self._client, self._config, self._serialize, self._deserialize) - self.dataset_v2 = DatasetV2Operations(self._client, self._config, self._serialize, self._deserialize) - self.data_version = DataVersionOperations(self._client, self._config, self._serialize, self._deserialize) - self.get_operation_status = GetOperationStatusOperations(self._client, self._config, self._serialize, self._deserialize) - + self.data_call = DataCallOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_container = DataContainerOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.delete = DeleteOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.datasets_v1 = DatasetsV1Operations( + self._client, self._config, self._serialize, self._deserialize + ) + self.dataset_controller_v2 = DatasetControllerV2Operations( + self._client, self._config, self._serialize, self._deserialize + ) + self.dataset_v2 = DatasetV2Operations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_version = DataVersionOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.get_operation_status = GetOperationStatusOperations( + self._client, self._config, self._serialize, self._deserialize + ) def _send_request( - self, - request: HttpRequest, - **kwargs: Any + self, request: HttpRequest, **kwargs: Any ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/_configuration.py index 26def54e12db..b9b9296a1a2e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/_configuration.py @@ -10,7 +10,10 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy +from azure.mgmt.core.policies import ( + ARMHttpLoggingPolicy, + AsyncARMChallengeAuthenticationPolicy, +) from .._version import VERSION @@ -30,31 +33,50 @@ class AzureMachineLearningWorkspacesConfiguration(Configuration): """ def __init__( - self, - credential: "AsyncTokenCredential", - **kwargs: Any + self, credential: "AsyncTokenCredential", **kwargs: Any ) -> None: - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) + super(AzureMachineLearningWorkspacesConfiguration, self).__init__( + **kwargs + ) if credential is None: raise ValueError("Parameter 'credential' must not be None.") self.credential = credential - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) + self.credential_scopes = kwargs.pop( + "credential_scopes", ["https://management.azure.com/.default"] + ) + kwargs.setdefault( + "sdk_moniker", "mgmt-machinelearningservices/{}".format(VERSION) + ) self._configure(**kwargs) - def _configure( - self, - **kwargs: Any - ) -> None: - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get( + "user_agent_policy" + ) or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get( + "headers_policy" + ) or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy( + **kwargs + ) + self.logging_policy = kwargs.get( + "logging_policy" + ) or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get( + "http_logging_policy" + ) or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get( + "retry_policy" + ) or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get( + "custom_hook_policy" + ) or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get( + "redirect_policy" + ) or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/_patch.py index 74e48ecd07cf..17dbc073e01b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/_patch.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/_patch.py @@ -25,7 +25,8 @@ # # -------------------------------------------------------------------------- + # This file is used for handwritten extensions to the generated code. Example: # https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md def patch_sdk(): - pass \ No newline at end of file + pass diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/operations/__init__.py index f0340813f282..b01a60bf4bdf 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/operations/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/operations/__init__.py @@ -16,12 +16,12 @@ from ._get_operation_status_operations import GetOperationStatusOperations __all__ = [ - 'DataCallOperations', - 'DataContainerOperations', - 'DeleteOperations', - 'DatasetsV1Operations', - 'DatasetControllerV2Operations', - 'DatasetV2Operations', - 'DataVersionOperations', - 'GetOperationStatusOperations', + "DataCallOperations", + "DataContainerOperations", + "DeleteOperations", + "DatasetsV1Operations", + "DatasetControllerV2Operations", + "DatasetV2Operations", + "DataVersionOperations", + "GetOperationStatusOperations", ] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/operations/_data_call_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/operations/_data_call_operations.py index cf00280c553d..b0a3373f9da4 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/operations/_data_call_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/operations/_data_call_operations.py @@ -9,7 +9,13 @@ from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -18,9 +24,20 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._data_call_operations import build_get_preview_for_ml_table_request, build_get_quick_profile_for_ml_table_request, build_get_schema_for_ml_table_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._data_call_operations import ( + build_get_preview_for_ml_table_request, + build_get_quick_profile_for_ml_table_request, + build_get_schema_for_ml_table_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class DataCallOperations: """DataCallOperations async operations. @@ -68,16 +85,22 @@ async def get_schema_for_ml_table( :rtype: list[~azure.mgmt.machinelearningservices.models.ColumnDefinition] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["_models.ColumnDefinition"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[List["_models.ColumnDefinition"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'DataCallRequest') + _json = self._serialize.body(body, "DataCallRequest") else: _json = None @@ -87,28 +110,39 @@ async def get_schema_for_ml_table( workspace_name=workspace_name, content_type=content_type, json=_json, - template_url=self.get_schema_for_ml_table.metadata['url'], + template_url=self.get_schema_for_ml_table.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('[ColumnDefinition]', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "[ColumnDefinition]", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_schema_for_ml_table.metadata = {'url': '/data/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datacall/schema'} # type: ignore - + get_schema_for_ml_table.metadata = {"url": "/data/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datacall/schema"} # type: ignore @distributed_trace_async async def get_preview_for_ml_table( @@ -134,16 +168,22 @@ async def get_preview_for_ml_table( :rtype: ~azure.mgmt.machinelearningservices.models.DataViewSetResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataViewSetResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataViewSetResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'DataCallRequest') + _json = self._serialize.body(body, "DataCallRequest") else: _json = None @@ -153,28 +193,39 @@ async def get_preview_for_ml_table( workspace_name=workspace_name, content_type=content_type, json=_json, - template_url=self.get_preview_for_ml_table.metadata['url'], + template_url=self.get_preview_for_ml_table.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataViewSetResult', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "DataViewSetResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_preview_for_ml_table.metadata = {'url': '/data/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datacall/preview'} # type: ignore - + get_preview_for_ml_table.metadata = {"url": "/data/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datacall/preview"} # type: ignore @distributed_trace_async async def get_quick_profile_for_ml_table( @@ -200,16 +251,22 @@ async def get_quick_profile_for_ml_table( :rtype: list[~azure.mgmt.machinelearningservices.models.ProfileResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["_models.ProfileResult"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[List["_models.ProfileResult"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'DataCallRequest') + _json = self._serialize.body(body, "DataCallRequest") else: _json = None @@ -219,25 +276,34 @@ async def get_quick_profile_for_ml_table( workspace_name=workspace_name, content_type=content_type, json=_json, - template_url=self.get_quick_profile_for_ml_table.metadata['url'], + template_url=self.get_quick_profile_for_ml_table.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('[ProfileResult]', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize("[ProfileResult]", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_quick_profile_for_ml_table.metadata = {'url': '/data/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datacall/quickprofile'} # type: ignore - + get_quick_profile_for_ml_table.metadata = {"url": "/data/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datacall/quickprofile"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/operations/_data_container_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/operations/_data_container_operations.py index c4c78abb6b7c..692cf99d6260 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/operations/_data_container_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/operations/_data_container_operations.py @@ -6,11 +6,25 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -20,9 +34,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._data_container_operations import build_create_data_container_request, build_get_data_container_request, build_list_data_container_request, build_modify_data_container_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._data_container_operations import ( + build_create_data_container_request, + build_get_data_container_request, + build_list_data_container_request, + build_modify_data_container_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class DataContainerOperations: """DataContainerOperations async operations. @@ -70,16 +96,22 @@ async def create_data_container( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainerEntity :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerEntity"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerEntity"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'DataContainer') + _json = self._serialize.body(body, "DataContainer") else: _json = None @@ -89,28 +121,39 @@ async def create_data_container( workspace_name=workspace_name, content_type=content_type, json=_json, - template_url=self.create_data_container.metadata['url'], + template_url=self.create_data_container.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataContainerEntity', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "DataContainerEntity", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_data_container.metadata = {'url': '/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datacontainer'} # type: ignore - + create_data_container.metadata = {"url": "/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datacontainer"} # type: ignore @distributed_trace def list_data_container( @@ -135,25 +178,30 @@ def list_data_container( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedDataContainerEntityList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedDataContainerEntityList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedDataContainerEntityList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_data_container_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.list_data_container.metadata['url'], + template_url=self.list_data_container.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_data_container_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -166,7 +214,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedDataContainerEntityList", pipeline_response) + deserialized = self._deserialize( + "PaginatedDataContainerEntityList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -175,21 +225,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_data_container.metadata = {'url': '/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datacontainer'} # type: ignore + list_data_container.metadata = {"url": "/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datacontainer"} # type: ignore @distributed_trace_async async def get_data_container( @@ -215,40 +273,54 @@ async def get_data_container( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainerEntity :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerEntity"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerEntity"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_data_container_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.get_data_container.metadata['url'], + template_url=self.get_data_container.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataContainerEntity', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "DataContainerEntity", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_data_container.metadata = {'url': '/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datacontainer/{name}'} # type: ignore - + get_data_container.metadata = {"url": "/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datacontainer/{name}"} # type: ignore @distributed_trace_async async def modify_data_container( @@ -277,16 +349,22 @@ async def modify_data_container( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainerEntity :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerEntity"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerEntity"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'DataContainerMutable') + _json = self._serialize.body(body, "DataContainerMutable") else: _json = None @@ -297,25 +375,36 @@ async def modify_data_container( name=name, content_type=content_type, json=_json, - template_url=self.modify_data_container.metadata['url'], + template_url=self.modify_data_container.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataContainerEntity', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "DataContainerEntity", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - modify_data_container.metadata = {'url': '/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datacontainer/{name}'} # type: ignore - + modify_data_container.metadata = {"url": "/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datacontainer/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/operations/_data_version_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/operations/_data_version_operations.py index 9f375aeb947d..74ee3ff06d12 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/operations/_data_version_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/operations/_data_version_operations.py @@ -6,11 +6,25 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -20,9 +34,28 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._data_version_operations import build_batch_get_resolved_uris_request, build_create_request, build_create_unregistered_input_data_request, build_create_unregistered_output_data_request, build_delete_request, build_exists_request, build_get_by_asset_id_request, build_get_request, build_list_request, build_modify_request, build_registered_existing_data_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._data_version_operations import ( + build_batch_get_resolved_uris_request, + build_create_request, + build_create_unregistered_input_data_request, + build_create_unregistered_output_data_request, + build_delete_request, + build_exists_request, + build_get_by_asset_id_request, + build_get_request, + build_list_request, + build_modify_request, + build_registered_existing_data_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class DataVersionOperations: """DataVersionOperations async operations. @@ -73,16 +106,22 @@ async def create( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionEntity :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionEntity"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionEntity"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'DataVersion') + _json = self._serialize.body(body, "DataVersion") else: _json = None @@ -93,28 +132,39 @@ async def create( name=name, content_type=content_type, json=_json, - template_url=self.create.metadata['url'], + template_url=self.create.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataVersionEntity', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "DataVersionEntity", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create.metadata = {'url': '/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/dataversion/{name}/versions'} # type: ignore - + create.metadata = {"url": "/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/dataversion/{name}/versions"} # type: ignore @distributed_trace def list( @@ -148,14 +198,19 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedDataVersionEntityList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedDataVersionEntityList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedDataVersionEntityList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -163,13 +218,13 @@ def prepare_request(next_link=None): name=name, order_by=order_by, top=top, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -185,7 +240,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedDataVersionEntityList", pipeline_response) + deserialized = self._deserialize( + "PaginatedDataVersionEntityList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -194,21 +251,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/dataversion/{name}/versions'} # type: ignore + list.metadata = {"url": "/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/dataversion/{name}/versions"} # type: ignore @distributed_trace_async async def get( @@ -237,41 +302,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionEntity :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionEntity"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionEntity"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version=version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataVersionEntity', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "DataVersionEntity", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/dataversion/{name}/versions/{version}'} # type: ignore - + get.metadata = {"url": "/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/dataversion/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def modify( @@ -303,16 +382,22 @@ async def modify( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionEntity :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionEntity"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionEntity"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'DataVersionMutable') + _json = self._serialize.body(body, "DataVersionMutable") else: _json = None @@ -324,28 +409,39 @@ async def modify( version=version, content_type=content_type, json=_json, - template_url=self.modify.metadata['url'], + template_url=self.modify.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataVersionEntity', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "DataVersionEntity", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - modify.metadata = {'url': '/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/dataversion/{name}/versions/{version}'} # type: ignore - + modify.metadata = {"url": "/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/dataversion/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def delete( @@ -374,41 +470,55 @@ async def delete( :rtype: ~azure.mgmt.machinelearningservices.models.HttpResponseMessage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.HttpResponseMessage"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.HttpResponseMessage"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version=version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('HttpResponseMessage', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "HttpResponseMessage", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - delete.metadata = {'url': '/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/dataversion/{name}/versions/{version}'} # type: ignore - + delete.metadata = {"url": "/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/dataversion/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def exists( @@ -437,41 +547,51 @@ async def exists( :rtype: bool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[bool] + cls = kwargs.pop("cls", None) # type: ClsType[bool] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_exists_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version=version, - template_url=self.exists.metadata['url'], + template_url=self.exists.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('bool', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize("bool", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - exists.metadata = {'url': '/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/dataversion/{name}/versions/{version}/exists'} # type: ignore - + exists.metadata = {"url": "/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/dataversion/{name}/versions/{version}/exists"} # type: ignore @distributed_trace_async async def get_by_asset_id( @@ -497,16 +617,22 @@ async def get_by_asset_id( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionEntity :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionEntity"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionEntity"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'AssetId') + _json = self._serialize.body(body, "AssetId") else: _json = None @@ -516,28 +642,39 @@ async def get_by_asset_id( workspace_name=workspace_name, content_type=content_type, json=_json, - template_url=self.get_by_asset_id.metadata['url'], + template_url=self.get_by_asset_id.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataVersionEntity', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "DataVersionEntity", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_by_asset_id.metadata = {'url': '/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/dataversion/getByAssetId'} # type: ignore - + get_by_asset_id.metadata = {"url": "/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/dataversion/getByAssetId"} # type: ignore @distributed_trace_async async def create_unregistered_input_data( @@ -563,16 +700,22 @@ async def create_unregistered_input_data( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainerEntity :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerEntity"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerEntity"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'CreateUnregisteredInputData') + _json = self._serialize.body(body, "CreateUnregisteredInputData") else: _json = None @@ -582,28 +725,39 @@ async def create_unregistered_input_data( workspace_name=workspace_name, content_type=content_type, json=_json, - template_url=self.create_unregistered_input_data.metadata['url'], + template_url=self.create_unregistered_input_data.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataContainerEntity', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "DataContainerEntity", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_unregistered_input_data.metadata = {'url': '/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/dataversion/createUnregisteredInput'} # type: ignore - + create_unregistered_input_data.metadata = {"url": "/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/dataversion/createUnregisteredInput"} # type: ignore @distributed_trace_async async def create_unregistered_output_data( @@ -629,16 +783,22 @@ async def create_unregistered_output_data( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainerEntity :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerEntity"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerEntity"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'CreateUnregisteredOutputData') + _json = self._serialize.body(body, "CreateUnregisteredOutputData") else: _json = None @@ -648,28 +808,39 @@ async def create_unregistered_output_data( workspace_name=workspace_name, content_type=content_type, json=_json, - template_url=self.create_unregistered_output_data.metadata['url'], + template_url=self.create_unregistered_output_data.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataContainerEntity', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "DataContainerEntity", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_unregistered_output_data.metadata = {'url': '/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/dataversion/createUnregisteredOutput'} # type: ignore - + create_unregistered_output_data.metadata = {"url": "/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/dataversion/createUnregisteredOutput"} # type: ignore @distributed_trace_async async def registered_existing_data( @@ -695,16 +866,22 @@ async def registered_existing_data( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainerEntity :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerEntity"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerEntity"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'RegisterExistingData') + _json = self._serialize.body(body, "RegisterExistingData") else: _json = None @@ -714,28 +891,39 @@ async def registered_existing_data( workspace_name=workspace_name, content_type=content_type, json=_json, - template_url=self.registered_existing_data.metadata['url'], + template_url=self.registered_existing_data.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataContainerEntity', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "DataContainerEntity", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - registered_existing_data.metadata = {'url': '/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/dataversion/registerExisting'} # type: ignore - + registered_existing_data.metadata = {"url": "/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/dataversion/registerExisting"} # type: ignore @distributed_trace_async async def batch_get_resolved_uris( @@ -761,16 +949,22 @@ async def batch_get_resolved_uris( :rtype: ~azure.mgmt.machinelearningservices.models.BatchDataUriResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDataUriResponse"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDataUriResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'BatchGetResolvedURIs') + _json = self._serialize.body(body, "BatchGetResolvedURIs") else: _json = None @@ -780,25 +974,36 @@ async def batch_get_resolved_uris( workspace_name=workspace_name, content_type=content_type, json=_json, - template_url=self.batch_get_resolved_uris.metadata['url'], + template_url=self.batch_get_resolved_uris.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('BatchDataUriResponse', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "BatchDataUriResponse", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - batch_get_resolved_uris.metadata = {'url': '/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/dataversion/batchGetResolvedUris'} # type: ignore - + batch_get_resolved_uris.metadata = {"url": "/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/dataversion/batchGetResolvedUris"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/operations/_dataset_controller_v2_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/operations/_dataset_controller_v2_operations.py index a3574be38d76..0ae112445f4e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/operations/_dataset_controller_v2_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/operations/_dataset_controller_v2_operations.py @@ -6,11 +6,26 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, List, Optional, TypeVar +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + List, + Optional, + TypeVar, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -20,9 +35,27 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._dataset_controller_v2_operations import build_delete_all_datasets_request, build_get_all_dataset_definitions_request, build_get_all_dataset_versions_request, build_get_dataset_by_name_request, build_get_dataset_definition_request, build_list_request, build_register_request, build_unregister_dataset_request, build_update_dataset_request, build_update_definition_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._dataset_controller_v2_operations import ( + build_delete_all_datasets_request, + build_get_all_dataset_definitions_request, + build_get_all_dataset_versions_request, + build_get_dataset_by_name_request, + build_get_dataset_definition_request, + build_list_request, + build_register_request, + build_unregister_dataset_request, + build_update_dataset_request, + build_update_definition_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class DatasetControllerV2Operations: """DatasetControllerV2Operations async operations. @@ -73,41 +106,55 @@ async def get_dataset_definition( :rtype: ~azure.mgmt.machinelearningservices.models.DatasetDefinition :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatasetDefinition"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DatasetDefinition"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_dataset_definition_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, dataset_id=dataset_id, version=version, - template_url=self.get_dataset_definition.metadata['url'], + template_url=self.get_dataset_definition.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DatasetDefinition', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "DatasetDefinition", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_dataset_definition.metadata = {'url': '/dataset/v1.2/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}/definitions/{version}'} # type: ignore - + get_dataset_definition.metadata = {"url": "/dataset/v1.2/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}/definitions/{version}"} # type: ignore @distributed_trace def get_all_dataset_definitions( @@ -141,14 +188,19 @@ def get_all_dataset_definitions( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedDatasetDefinitionList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedDatasetDefinitionList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedDatasetDefinitionList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_get_all_dataset_definitions_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -156,13 +208,15 @@ def prepare_request(next_link=None): dataset_id=dataset_id, continuation_token_parameter=continuation_token_parameter, page_size=page_size, - template_url=self.get_all_dataset_definitions.metadata['url'], + template_url=self.get_all_dataset_definitions.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_get_all_dataset_definitions_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -178,7 +232,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedDatasetDefinitionList", pipeline_response) + deserialized = self._deserialize( + "PaginatedDatasetDefinitionList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -187,21 +243,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - get_all_dataset_definitions.metadata = {'url': '/dataset/v1.2/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}/definitions'} # type: ignore + get_all_dataset_definitions.metadata = {"url": "/dataset/v1.2/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}/definitions"} # type: ignore @distributed_trace_async async def update_definition( @@ -242,16 +306,20 @@ async def update_definition( :rtype: ~azure.mgmt.machinelearningservices.models.Dataset :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Dataset"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Dataset"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'DatasetDefinition') + _json = self._serialize.body(body, "DatasetDefinition") else: _json = None @@ -266,28 +334,37 @@ async def update_definition( force_update=force_update, dataset_type=dataset_type, user_version_id=user_version_id, - template_url=self.update_definition.metadata['url'], + template_url=self.update_definition.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Dataset', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize("Dataset", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update_definition.metadata = {'url': '/dataset/v1.2/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}/definitions'} # type: ignore - + update_definition.metadata = {"url": "/dataset/v1.2/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}/definitions"} # type: ignore @distributed_trace def get_all_dataset_versions( @@ -320,14 +397,19 @@ def get_all_dataset_versions( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedStringList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedStringList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedStringList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_get_all_dataset_versions_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -335,13 +417,13 @@ def prepare_request(next_link=None): dataset_id=dataset_id, continuation_token_parameter=continuation_token_parameter, page_size=page_size, - template_url=self.get_all_dataset_versions.metadata['url'], + template_url=self.get_all_dataset_versions.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_get_all_dataset_versions_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -357,7 +439,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedStringList", pipeline_response) + deserialized = self._deserialize( + "PaginatedStringList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -366,21 +450,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - get_all_dataset_versions.metadata = {'url': '/dataset/v1.2/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}/versions'} # type: ignore + get_all_dataset_versions.metadata = {"url": "/dataset/v1.2/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}/versions"} # type: ignore @distributed_trace_async async def get_dataset_by_name( @@ -412,13 +504,14 @@ async def get_dataset_by_name( :rtype: ~azure.mgmt.machinelearningservices.models.Dataset :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Dataset"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Dataset"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_dataset_by_name_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -426,28 +519,37 @@ async def get_dataset_by_name( dataset_name=dataset_name, version_id=version_id, include_latest_definition=include_latest_definition, - template_url=self.get_dataset_by_name.metadata['url'], + template_url=self.get_dataset_by_name.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Dataset', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize("Dataset", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_dataset_by_name.metadata = {'url': '/dataset/v1.2/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/query/name={datasetName}'} # type: ignore - + get_dataset_by_name.metadata = {"url": "/dataset/v1.2/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/query/name={datasetName}"} # type: ignore @distributed_trace def list( @@ -502,14 +604,19 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedDatasetList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedDatasetList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedDatasetList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -524,13 +631,13 @@ def prepare_request(next_link=None): order_by=order_by, order_by_asc=order_by_asc, dataset_types=dataset_types, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -553,7 +660,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedDatasetList", pipeline_response) + deserialized = self._deserialize( + "PaginatedDatasetList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -562,21 +671,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/dataset/v1.2/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets'} # type: ignore + list.metadata = {"url": "/dataset/v1.2/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets"} # type: ignore @distributed_trace_async async def register( @@ -617,16 +734,20 @@ async def register( :rtype: ~azure.mgmt.machinelearningservices.models.Dataset :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Dataset"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Dataset"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'Dataset') + _json = self._serialize.body(body, "Dataset") else: _json = None @@ -641,28 +762,37 @@ async def register( update_definition_if_exists=update_definition_if_exists, with_data_hash=with_data_hash, user_version_id=user_version_id, - template_url=self.register.metadata['url'], + template_url=self.register.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Dataset', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize("Dataset", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - register.metadata = {'url': '/dataset/v1.2/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets'} # type: ignore - + register.metadata = {"url": "/dataset/v1.2/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets"} # type: ignore @distributed_trace_async async def delete_all_datasets( @@ -685,35 +815,45 @@ async def delete_all_datasets( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_all_datasets_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.delete_all_datasets.metadata['url'], + template_url=self.delete_all_datasets.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in []: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete_all_datasets.metadata = {'url': '/dataset/v1.2/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets'} # type: ignore - + delete_all_datasets.metadata = {"url": "/dataset/v1.2/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets"} # type: ignore @distributed_trace_async async def update_dataset( @@ -745,16 +885,20 @@ async def update_dataset( :rtype: ~azure.mgmt.machinelearningservices.models.Dataset :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Dataset"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Dataset"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'Dataset') + _json = self._serialize.body(body, "Dataset") else: _json = None @@ -766,28 +910,37 @@ async def update_dataset( content_type=content_type, json=_json, force_update=force_update, - template_url=self.update_dataset.metadata['url'], + template_url=self.update_dataset.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Dataset', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize("Dataset", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update_dataset.metadata = {'url': '/dataset/v1.2/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}'} # type: ignore - + update_dataset.metadata = {"url": "/dataset/v1.2/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}"} # type: ignore @distributed_trace_async async def unregister_dataset( @@ -813,33 +966,43 @@ async def unregister_dataset( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_unregister_dataset_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.unregister_dataset.metadata['url'], + template_url=self.unregister_dataset.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in []: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - unregister_dataset.metadata = {'url': '/dataset/v1.2/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{name}'} # type: ignore - + unregister_dataset.metadata = {"url": "/dataset/v1.2/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/operations/_dataset_v2_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/operations/_dataset_v2_operations.py index 584122c16f0e..3bd202490ec5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/operations/_dataset_v2_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/operations/_dataset_v2_operations.py @@ -6,11 +6,26 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, List, Optional, TypeVar +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + List, + Optional, + TypeVar, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -20,9 +35,25 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._dataset_v2_operations import build_create_request, build_delete_all_datasets_request, build_delete_dataset_by_name_request, build_get_dataset_by_id_request, build_get_dataset_by_name_request, build_list_request, build_update_dataset_by_name_and_version_request, build_update_dataset_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._dataset_v2_operations import ( + build_create_request, + build_delete_all_datasets_request, + build_delete_dataset_by_name_request, + build_get_dataset_by_id_request, + build_get_dataset_by_name_request, + build_list_request, + build_update_dataset_by_name_and_version_request, + build_update_dataset_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class DatasetV2Operations: """DatasetV2Operations async operations. @@ -73,16 +104,20 @@ async def create( :rtype: ~azure.mgmt.machinelearningservices.models.DatasetV2 :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatasetV2"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DatasetV2"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'DatasetV2') + _json = self._serialize.body(body, "DatasetV2") else: _json = None @@ -93,28 +128,37 @@ async def create( content_type=content_type, json=_json, if_exists_update=if_exists_update, - template_url=self.create.metadata['url'], + template_url=self.create.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DatasetV2', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize("DatasetV2", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create.metadata = {'url': '/dataset/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets'} # type: ignore - + create.metadata = {"url": "/dataset/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets"} # type: ignore @distributed_trace_async async def delete_all_datasets( @@ -137,35 +181,45 @@ async def delete_all_datasets( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_all_datasets_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.delete_all_datasets.metadata['url'], + template_url=self.delete_all_datasets.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in []: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete_all_datasets.metadata = {'url': '/dataset/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets'} # type: ignore - + delete_all_datasets.metadata = {"url": "/dataset/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets"} # type: ignore @distributed_trace def list( @@ -202,14 +256,19 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedDatasetV2List] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedDatasetV2List"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedDatasetV2List"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -218,13 +277,13 @@ def prepare_request(next_link=None): search_text=search_text, continuation_token_parameter=continuation_token_parameter, page_size=page_size, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -241,7 +300,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedDatasetV2List", pipeline_response) + deserialized = self._deserialize( + "PaginatedDatasetV2List", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -250,21 +311,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/dataset/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets'} # type: ignore + list.metadata = {"url": "/dataset/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets"} # type: ignore @distributed_trace_async async def delete_dataset_by_name( @@ -293,37 +362,47 @@ async def delete_dataset_by_name( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_dataset_by_name_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version_id=version_id, - template_url=self.delete_dataset_by_name.metadata['url'], + template_url=self.delete_dataset_by_name.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in []: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete_dataset_by_name.metadata = {'url': '/dataset/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{name}/versions/{versionId}'} # type: ignore - + delete_dataset_by_name.metadata = {"url": "/dataset/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{name}/versions/{versionId}"} # type: ignore @distributed_trace_async async def update_dataset_by_name_and_version( @@ -355,16 +434,20 @@ async def update_dataset_by_name_and_version( :rtype: ~azure.mgmt.machinelearningservices.models.DatasetV2 :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatasetV2"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DatasetV2"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'DatasetV2') + _json = self._serialize.body(body, "DatasetV2") else: _json = None @@ -376,28 +459,39 @@ async def update_dataset_by_name_and_version( version_id=version_id, content_type=content_type, json=_json, - template_url=self.update_dataset_by_name_and_version.metadata['url'], + template_url=self.update_dataset_by_name_and_version.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DatasetV2', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize("DatasetV2", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update_dataset_by_name_and_version.metadata = {'url': '/dataset/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{name}/versions/{versionId}'} # type: ignore - + update_dataset_by_name_and_version.metadata = {"url": "/dataset/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{name}/versions/{versionId}"} # type: ignore @distributed_trace_async async def get_dataset_by_id( @@ -423,40 +517,50 @@ async def get_dataset_by_id( :rtype: ~azure.mgmt.machinelearningservices.models.DatasetV2 :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatasetV2"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DatasetV2"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_dataset_by_id_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, dataset_id=dataset_id, - template_url=self.get_dataset_by_id.metadata['url'], + template_url=self.get_dataset_by_id.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DatasetV2', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize("DatasetV2", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_dataset_by_id.metadata = {'url': '/dataset/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}'} # type: ignore - + get_dataset_by_id.metadata = {"url": "/dataset/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}"} # type: ignore @distributed_trace_async async def update_dataset( @@ -485,16 +589,20 @@ async def update_dataset( :rtype: ~azure.mgmt.machinelearningservices.models.DatasetV2 :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatasetV2"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DatasetV2"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'DatasetV2') + _json = self._serialize.body(body, "DatasetV2") else: _json = None @@ -505,28 +613,37 @@ async def update_dataset( dataset_id=dataset_id, content_type=content_type, json=_json, - template_url=self.update_dataset.metadata['url'], + template_url=self.update_dataset.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DatasetV2', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize("DatasetV2", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update_dataset.metadata = {'url': '/dataset/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}'} # type: ignore - + update_dataset.metadata = {"url": "/dataset/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}"} # type: ignore @distributed_trace_async async def get_dataset_by_name( @@ -555,38 +672,48 @@ async def get_dataset_by_name( :rtype: ~azure.mgmt.machinelearningservices.models.DatasetV2 :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatasetV2"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DatasetV2"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_dataset_by_name_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, dataset_name=dataset_name, version_id=version_id, - template_url=self.get_dataset_by_name.metadata['url'], + template_url=self.get_dataset_by_name.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DatasetV2', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize("DatasetV2", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_dataset_by_name.metadata = {'url': '/dataset/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/query/name={datasetName}'} # type: ignore - + get_dataset_by_name.metadata = {"url": "/dataset/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/query/name={datasetName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/operations/_datasets_v1_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/operations/_datasets_v1_operations.py index 97e74d538d63..cb85981abf19 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/operations/_datasets_v1_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/operations/_datasets_v1_operations.py @@ -6,11 +6,26 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, List, Optional, TypeVar +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + List, + Optional, + TypeVar, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -20,9 +35,27 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._datasets_v1_operations import build_delete_all_datasets_request, build_get_all_dataset_definitions_request, build_get_all_dataset_versions_request, build_get_dataset_by_name_request, build_get_dataset_definition_request, build_list_request, build_register_request, build_unregister_dataset_request, build_update_dataset_request, build_update_definition_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._datasets_v1_operations import ( + build_delete_all_datasets_request, + build_get_all_dataset_definitions_request, + build_get_all_dataset_versions_request, + build_get_dataset_by_name_request, + build_get_dataset_definition_request, + build_list_request, + build_register_request, + build_unregister_dataset_request, + build_update_dataset_request, + build_update_definition_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class DatasetsV1Operations: """DatasetsV1Operations async operations. @@ -73,41 +106,55 @@ async def get_dataset_definition( :rtype: ~azure.mgmt.machinelearningservices.models.DatasetDefinition :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatasetDefinition"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DatasetDefinition"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_dataset_definition_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, dataset_id=dataset_id, version=version, - template_url=self.get_dataset_definition.metadata['url'], + template_url=self.get_dataset_definition.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DatasetDefinition', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "DatasetDefinition", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_dataset_definition.metadata = {'url': '/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}/definitions/{version}'} # type: ignore - + get_dataset_definition.metadata = {"url": "/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}/definitions/{version}"} # type: ignore @distributed_trace def get_all_dataset_definitions( @@ -141,14 +188,19 @@ def get_all_dataset_definitions( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedDatasetDefinitionList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedDatasetDefinitionList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedDatasetDefinitionList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_get_all_dataset_definitions_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -156,13 +208,15 @@ def prepare_request(next_link=None): dataset_id=dataset_id, continuation_token_parameter=continuation_token_parameter, page_size=page_size, - template_url=self.get_all_dataset_definitions.metadata['url'], + template_url=self.get_all_dataset_definitions.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_get_all_dataset_definitions_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -178,7 +232,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedDatasetDefinitionList", pipeline_response) + deserialized = self._deserialize( + "PaginatedDatasetDefinitionList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -187,21 +243,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - get_all_dataset_definitions.metadata = {'url': '/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}/definitions'} # type: ignore + get_all_dataset_definitions.metadata = {"url": "/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}/definitions"} # type: ignore @distributed_trace_async async def update_definition( @@ -242,16 +306,20 @@ async def update_definition( :rtype: ~azure.mgmt.machinelearningservices.models.Dataset :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Dataset"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Dataset"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'DatasetDefinition') + _json = self._serialize.body(body, "DatasetDefinition") else: _json = None @@ -266,28 +334,37 @@ async def update_definition( force_update=force_update, dataset_type=dataset_type, user_version_id=user_version_id, - template_url=self.update_definition.metadata['url'], + template_url=self.update_definition.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Dataset', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize("Dataset", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update_definition.metadata = {'url': '/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}/definitions'} # type: ignore - + update_definition.metadata = {"url": "/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}/definitions"} # type: ignore @distributed_trace def get_all_dataset_versions( @@ -320,14 +397,19 @@ def get_all_dataset_versions( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedStringList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedStringList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedStringList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_get_all_dataset_versions_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -335,13 +417,13 @@ def prepare_request(next_link=None): dataset_id=dataset_id, continuation_token_parameter=continuation_token_parameter, page_size=page_size, - template_url=self.get_all_dataset_versions.metadata['url'], + template_url=self.get_all_dataset_versions.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_get_all_dataset_versions_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -357,7 +439,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedStringList", pipeline_response) + deserialized = self._deserialize( + "PaginatedStringList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -366,21 +450,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - get_all_dataset_versions.metadata = {'url': '/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}/versions'} # type: ignore + get_all_dataset_versions.metadata = {"url": "/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}/versions"} # type: ignore @distributed_trace_async async def get_dataset_by_name( @@ -412,13 +504,14 @@ async def get_dataset_by_name( :rtype: ~azure.mgmt.machinelearningservices.models.Dataset :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Dataset"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Dataset"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_dataset_by_name_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -426,28 +519,37 @@ async def get_dataset_by_name( dataset_name=dataset_name, version_id=version_id, include_latest_definition=include_latest_definition, - template_url=self.get_dataset_by_name.metadata['url'], + template_url=self.get_dataset_by_name.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Dataset', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize("Dataset", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_dataset_by_name.metadata = {'url': '/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/query/name={datasetName}'} # type: ignore - + get_dataset_by_name.metadata = {"url": "/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/query/name={datasetName}"} # type: ignore @distributed_trace def list( @@ -502,14 +604,19 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedDatasetList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedDatasetList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedDatasetList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -524,13 +631,13 @@ def prepare_request(next_link=None): order_by=order_by, order_by_asc=order_by_asc, dataset_types=dataset_types, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -553,7 +660,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedDatasetList", pipeline_response) + deserialized = self._deserialize( + "PaginatedDatasetList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -562,21 +671,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets'} # type: ignore + list.metadata = {"url": "/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets"} # type: ignore @distributed_trace_async async def register( @@ -617,16 +734,20 @@ async def register( :rtype: ~azure.mgmt.machinelearningservices.models.Dataset :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Dataset"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Dataset"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'Dataset') + _json = self._serialize.body(body, "Dataset") else: _json = None @@ -641,28 +762,37 @@ async def register( update_definition_if_exists=update_definition_if_exists, with_data_hash=with_data_hash, user_version_id=user_version_id, - template_url=self.register.metadata['url'], + template_url=self.register.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Dataset', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize("Dataset", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - register.metadata = {'url': '/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets'} # type: ignore - + register.metadata = {"url": "/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets"} # type: ignore @distributed_trace_async async def delete_all_datasets( @@ -685,35 +815,45 @@ async def delete_all_datasets( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_all_datasets_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.delete_all_datasets.metadata['url'], + template_url=self.delete_all_datasets.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in []: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete_all_datasets.metadata = {'url': '/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets'} # type: ignore - + delete_all_datasets.metadata = {"url": "/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets"} # type: ignore @distributed_trace_async async def update_dataset( @@ -745,16 +885,20 @@ async def update_dataset( :rtype: ~azure.mgmt.machinelearningservices.models.Dataset :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Dataset"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Dataset"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'Dataset') + _json = self._serialize.body(body, "Dataset") else: _json = None @@ -766,28 +910,37 @@ async def update_dataset( content_type=content_type, json=_json, force_update=force_update, - template_url=self.update_dataset.metadata['url'], + template_url=self.update_dataset.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Dataset', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize("Dataset", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update_dataset.metadata = {'url': '/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}'} # type: ignore - + update_dataset.metadata = {"url": "/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}"} # type: ignore @distributed_trace_async async def unregister_dataset( @@ -813,33 +966,43 @@ async def unregister_dataset( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_unregister_dataset_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.unregister_dataset.metadata['url'], + template_url=self.unregister_dataset.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in []: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - unregister_dataset.metadata = {'url': '/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{name}'} # type: ignore - + unregister_dataset.metadata = {"url": "/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/operations/_delete_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/operations/_delete_operations.py index 9bb293a54cab..dda7cf7117cd 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/operations/_delete_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/operations/_delete_operations.py @@ -9,7 +9,13 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,8 +25,15 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._delete_operations import build_data_container_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class DeleteOperations: """DeleteOperations async operations. @@ -68,37 +81,51 @@ async def data_container( :rtype: ~azure.mgmt.machinelearningservices.models.HttpResponseMessage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.HttpResponseMessage"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.HttpResponseMessage"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_data_container_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.data_container.metadata['url'], + template_url=self.data_container.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('HttpResponseMessage', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "HttpResponseMessage", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - data_container.metadata = {'url': '/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datacontainer/{name}'} # type: ignore - + data_container.metadata = {"url": "/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datacontainer/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/operations/_get_operation_status_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/operations/_get_operation_status_operations.py index 273b307f7831..716f6037f498 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/operations/_get_operation_status_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/aio/operations/_get_operation_status_operations.py @@ -9,10 +9,20 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat @@ -20,9 +30,18 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._get_operation_status_operations import build_get_dataset_operation_status_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._get_operation_status_operations import ( + build_get_dataset_operation_status_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class GetOperationStatusOperations: """GetOperationStatusOperations async operations. @@ -53,47 +72,65 @@ async def _get_dataset_operation_status_initial( workspace_name: str, operation_id: str, **kwargs: Any - ) -> Optional["_models.LongRunningOperationResponse1LongRunningOperationResponseObject"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LongRunningOperationResponse1LongRunningOperationResponseObject"]] + ) -> Optional[ + "_models.LongRunningOperationResponse1LongRunningOperationResponseObject" + ]: + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.LongRunningOperationResponse1LongRunningOperationResponseObject"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_dataset_operation_status_request_initial( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, operation_id=operation_id, - template_url=self._get_dataset_operation_status_initial.metadata['url'], + template_url=self._get_dataset_operation_status_initial.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('LongRunningOperationResponse1LongRunningOperationResponseObject', pipeline_response) + deserialized = self._deserialize( + "LongRunningOperationResponse1LongRunningOperationResponseObject", + pipeline_response, + ) if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _get_dataset_operation_status_initial.metadata = {'url': '/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/operations/{operationId}'} # type: ignore - + _get_dataset_operation_status_initial.metadata = {"url": "/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/operations/{operationId}"} # type: ignore @distributed_trace_async async def begin_get_dataset_operation_status( @@ -103,7 +140,9 @@ async def begin_get_dataset_operation_status( workspace_name: str, operation_id: str, **kwargs: Any - ) -> AsyncLROPoller["_models.LongRunningOperationResponse1LongRunningOperationResponseObject"]: + ) -> AsyncLROPoller[ + "_models.LongRunningOperationResponse1LongRunningOperationResponseObject" + ]: """get_dataset_operation_status. :param subscription_id: The Azure Subscription ID. @@ -128,43 +167,62 @@ async def begin_get_dataset_operation_status( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.LongRunningOperationResponse1LongRunningOperationResponseObject] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.LongRunningOperationResponse1LongRunningOperationResponseObject"] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.LongRunningOperationResponse1LongRunningOperationResponseObject"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._get_dataset_operation_status_initial( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, operation_id=operation_id, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('LongRunningOperationResponse1LongRunningOperationResponseObject', pipeline_response) + deserialized = self._deserialize( + "LongRunningOperationResponse1LongRunningOperationResponseObject", + pipeline_response, + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_get_dataset_operation_status.metadata = {'url': '/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/operations/{operationId}'} # type: ignore + begin_get_dataset_operation_status.metadata = {"url": "/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/operations/{operationId}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/models/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/models/__init__.py index 42488e7c02b8..89b783648ce5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/models/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/models/__init__.py @@ -40,7 +40,9 @@ from ._models_py3 import HttpResponseMessage from ._models_py3 import InnerErrorResponse from ._models_py3 import KeyValuePairStringIEnumerable1 - from ._models_py3 import LongRunningOperationResponse1LongRunningOperationResponseObject + from ._models_py3 import ( + LongRunningOperationResponse1LongRunningOperationResponseObject, + ) from ._models_py3 import Moments from ._models_py3 import PaginatedDataContainerEntityList from ._models_py3 import PaginatedDataVersionEntityList @@ -125,63 +127,63 @@ ) __all__ = [ - 'ActionResult', - 'AssetId', - 'BatchDataUriResponse', - 'BatchGetResolvedURIs', - 'ColumnDefinition', - 'CreateUnregisteredInputData', - 'CreateUnregisteredOutputData', - 'DataCallRequest', - 'DataContainer', - 'DataContainerEntity', - 'DataContainerMutable', - 'DataField', - 'DataUriV2Response', - 'DataVersion', - 'DataVersionEntity', - 'DataVersionMutable', - 'DataViewSetResult', - 'Dataset', - 'DatasetDefinition', - 'DatasetDefinitionReference', - 'DatasetPath', - 'DatasetState', - 'DatasetV2', - 'EntityMetadata', - 'ErrorAdditionalInfo', - 'ErrorResponse', - 'HistogramBin', - 'HttpContent', - 'HttpMethod', - 'HttpRequestMessage', - 'HttpResponseMessage', - 'InnerErrorResponse', - 'KeyValuePairStringIEnumerable1', - 'LongRunningOperationResponse1LongRunningOperationResponseObject', - 'Moments', - 'PaginatedDataContainerEntityList', - 'PaginatedDataVersionEntityList', - 'PaginatedDatasetDefinitionList', - 'PaginatedDatasetList', - 'PaginatedDatasetV2List', - 'PaginatedStringList', - 'ProfileActionResult', - 'ProfileResult', - 'Quantiles', - 'RegisterExistingData', - 'RootError', - 'STypeCount', - 'SqlDataPath', - 'StoredProcedureParameter', - 'StringLengthCount', - 'TypeCount', - 'User', - 'ValueCount', - 'DataflowType', - 'FieldType', - 'HttpStatusCode', - 'HttpVersionPolicy', - 'SType', - 'StoredProcedureParameterType', + "ActionResult", + "AssetId", + "BatchDataUriResponse", + "BatchGetResolvedURIs", + "ColumnDefinition", + "CreateUnregisteredInputData", + "CreateUnregisteredOutputData", + "DataCallRequest", + "DataContainer", + "DataContainerEntity", + "DataContainerMutable", + "DataField", + "DataUriV2Response", + "DataVersion", + "DataVersionEntity", + "DataVersionMutable", + "DataViewSetResult", + "Dataset", + "DatasetDefinition", + "DatasetDefinitionReference", + "DatasetPath", + "DatasetState", + "DatasetV2", + "EntityMetadata", + "ErrorAdditionalInfo", + "ErrorResponse", + "HistogramBin", + "HttpContent", + "HttpMethod", + "HttpRequestMessage", + "HttpResponseMessage", + "InnerErrorResponse", + "KeyValuePairStringIEnumerable1", + "LongRunningOperationResponse1LongRunningOperationResponseObject", + "Moments", + "PaginatedDataContainerEntityList", + "PaginatedDataVersionEntityList", + "PaginatedDatasetDefinitionList", + "PaginatedDatasetList", + "PaginatedDatasetV2List", + "PaginatedStringList", + "ProfileActionResult", + "ProfileResult", + "Quantiles", + "RegisterExistingData", + "RootError", + "STypeCount", + "SqlDataPath", + "StoredProcedureParameter", + "StringLengthCount", + "TypeCount", + "User", + "ValueCount", + "DataflowType", + "FieldType", + "HttpStatusCode", + "HttpVersionPolicy", + "SType", + "StoredProcedureParameterType", ] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/models/_azure_machine_learning_workspaces_enums.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/models/_azure_machine_learning_workspaces_enums.py index b06eab555762..9d069a21fa21 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/models/_azure_machine_learning_workspaces_enums.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/models/_azure_machine_learning_workspaces_enums.py @@ -15,6 +15,7 @@ class DataflowType(str, Enum, metaclass=CaseInsensitiveEnumMeta): JSON = "Json" YAML = "Yaml" + class FieldType(str, Enum, metaclass=CaseInsensitiveEnumMeta): STRING = "String" @@ -29,6 +30,7 @@ class FieldType(str, Enum, metaclass=CaseInsensitiveEnumMeta): LIST = "List" STREAM = "Stream" + class HttpStatusCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): CONTINUE_ENUM = "Continue" @@ -93,13 +95,17 @@ class HttpStatusCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): NOT_EXTENDED = "NotExtended" NETWORK_AUTHENTICATION_REQUIRED = "NetworkAuthenticationRequired" + class HttpVersionPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): REQUEST_VERSION_OR_LOWER = "RequestVersionOrLower" REQUEST_VERSION_OR_HIGHER = "RequestVersionOrHigher" REQUEST_VERSION_EXACT = "RequestVersionExact" -class StoredProcedureParameterType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + +class StoredProcedureParameterType( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): STRING = "String" INT = "Int" @@ -108,6 +114,7 @@ class StoredProcedureParameterType(str, Enum, metaclass=CaseInsensitiveEnumMeta) BOOLEAN = "Boolean" DATE = "Date" + class SType(str, Enum, metaclass=CaseInsensitiveEnumMeta): EMAIL_ADDRESS = "EmailAddress" diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/models/_models.py index 9bc1f68380eb..d6a620b1a069 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/models/_models.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/models/_models.py @@ -30,19 +30,16 @@ class ActionResult(msrest.serialization.Model): """ _attribute_map = { - 'is_up_to_date': {'key': 'isUpToDate', 'type': 'bool'}, - 'is_up_to_date_error': {'key': 'isUpToDateError', 'type': 'str'}, - 'result_artifact_ids': {'key': 'resultArtifactIds', 'type': '[str]'}, - 'in_progress_action_id': {'key': 'inProgressActionId', 'type': 'str'}, - 'run_id': {'key': 'runId', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'datastore_name': {'key': 'datastoreName', 'type': 'str'}, + "is_up_to_date": {"key": "isUpToDate", "type": "bool"}, + "is_up_to_date_error": {"key": "isUpToDateError", "type": "str"}, + "result_artifact_ids": {"key": "resultArtifactIds", "type": "[str]"}, + "in_progress_action_id": {"key": "inProgressActionId", "type": "str"}, + "run_id": {"key": "runId", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "datastore_name": {"key": "datastoreName", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword is_up_to_date: :paramtype is_up_to_date: bool @@ -60,13 +57,13 @@ def __init__( :paramtype datastore_name: str """ super(ActionResult, self).__init__(**kwargs) - self.is_up_to_date = kwargs.get('is_up_to_date', None) - self.is_up_to_date_error = kwargs.get('is_up_to_date_error', None) - self.result_artifact_ids = kwargs.get('result_artifact_ids', None) - self.in_progress_action_id = kwargs.get('in_progress_action_id', None) - self.run_id = kwargs.get('run_id', None) - self.experiment_name = kwargs.get('experiment_name', None) - self.datastore_name = kwargs.get('datastore_name', None) + self.is_up_to_date = kwargs.get("is_up_to_date", None) + self.is_up_to_date_error = kwargs.get("is_up_to_date_error", None) + self.result_artifact_ids = kwargs.get("result_artifact_ids", None) + self.in_progress_action_id = kwargs.get("in_progress_action_id", None) + self.run_id = kwargs.get("run_id", None) + self.experiment_name = kwargs.get("experiment_name", None) + self.datastore_name = kwargs.get("datastore_name", None) class AssetId(msrest.serialization.Model): @@ -79,23 +76,20 @@ class AssetId(msrest.serialization.Model): """ _validation = { - 'value': {'required': True}, + "value": {"required": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, + "value": {"key": "value", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Required. :paramtype value: str """ super(AssetId, self).__init__(**kwargs) - self.value = kwargs['value'] + self.value = kwargs["value"] class BatchDataUriResponse(msrest.serialization.Model): @@ -106,19 +100,16 @@ class BatchDataUriResponse(msrest.serialization.Model): """ _attribute_map = { - 'values': {'key': 'values', 'type': '{DataUriV2Response}'}, + "values": {"key": "values", "type": "{DataUriV2Response}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword values: Dictionary of :code:``. :paramtype values: dict[str, ~azure.mgmt.machinelearningservices.models.DataUriV2Response] """ super(BatchDataUriResponse, self).__init__(**kwargs) - self.values = kwargs.get('values', None) + self.values = kwargs.get("values", None) class BatchGetResolvedURIs(msrest.serialization.Model): @@ -131,23 +122,20 @@ class BatchGetResolvedURIs(msrest.serialization.Model): """ _validation = { - 'values': {'required': True}, + "values": {"required": True}, } _attribute_map = { - 'values': {'key': 'values', 'type': '[str]'}, + "values": {"key": "values", "type": "[str]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword values: Required. :paramtype values: list[str] """ super(BatchGetResolvedURIs, self).__init__(**kwargs) - self.values = kwargs['values'] + self.values = kwargs["values"] class ColumnDefinition(msrest.serialization.Model): @@ -161,14 +149,11 @@ class ColumnDefinition(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "type": {"key": "type", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword id: :paramtype id: str @@ -177,8 +162,8 @@ def __init__( :paramtype type: str or ~azure.mgmt.machinelearningservices.models.FieldType """ super(ColumnDefinition, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.type = kwargs.get('type', None) + self.id = kwargs.get("id", None) + self.type = kwargs.get("type", None) class CreateUnregisteredInputData(msrest.serialization.Model): @@ -197,23 +182,20 @@ class CreateUnregisteredInputData(msrest.serialization.Model): """ _validation = { - 'run_id': {'required': True}, - 'input_name': {'required': True}, - 'uri': {'required': True}, - 'type': {'required': True}, + "run_id": {"required": True}, + "input_name": {"required": True}, + "uri": {"required": True}, + "type": {"required": True}, } _attribute_map = { - 'run_id': {'key': 'runId', 'type': 'str'}, - 'input_name': {'key': 'inputName', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + "run_id": {"key": "runId", "type": "str"}, + "input_name": {"key": "inputName", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "type": {"key": "type", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword run_id: Required. :paramtype run_id: str @@ -225,10 +207,10 @@ def __init__( :paramtype type: str """ super(CreateUnregisteredInputData, self).__init__(**kwargs) - self.run_id = kwargs['run_id'] - self.input_name = kwargs['input_name'] - self.uri = kwargs['uri'] - self.type = kwargs['type'] + self.run_id = kwargs["run_id"] + self.input_name = kwargs["input_name"] + self.uri = kwargs["uri"] + self.type = kwargs["type"] class CreateUnregisteredOutputData(msrest.serialization.Model): @@ -247,23 +229,20 @@ class CreateUnregisteredOutputData(msrest.serialization.Model): """ _validation = { - 'run_id': {'required': True}, - 'output_name': {'required': True}, - 'uri': {'required': True}, - 'type': {'required': True}, + "run_id": {"required": True}, + "output_name": {"required": True}, + "uri": {"required": True}, + "type": {"required": True}, } _attribute_map = { - 'run_id': {'key': 'runId', 'type': 'str'}, - 'output_name': {'key': 'outputName', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + "run_id": {"key": "runId", "type": "str"}, + "output_name": {"key": "outputName", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "type": {"key": "type", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword run_id: Required. :paramtype run_id: str @@ -275,10 +254,10 @@ def __init__( :paramtype type: str """ super(CreateUnregisteredOutputData, self).__init__(**kwargs) - self.run_id = kwargs['run_id'] - self.output_name = kwargs['output_name'] - self.uri = kwargs['uri'] - self.type = kwargs['type'] + self.run_id = kwargs["run_id"] + self.output_name = kwargs["output_name"] + self.uri = kwargs["uri"] + self.type = kwargs["type"] class DataCallRequest(msrest.serialization.Model): @@ -297,17 +276,14 @@ class DataCallRequest(msrest.serialization.Model): """ _attribute_map = { - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'asset_id': {'key': 'assetId', 'type': 'str'}, - 'data_container_name': {'key': 'dataContainerName', 'type': 'str'}, - 'version_id': {'key': 'versionId', 'type': 'str'}, + "data_uri": {"key": "dataUri", "type": "str"}, + "data_type": {"key": "dataType", "type": "str"}, + "asset_id": {"key": "assetId", "type": "str"}, + "data_container_name": {"key": "dataContainerName", "type": "str"}, + "version_id": {"key": "versionId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data_uri: :paramtype data_uri: str @@ -321,11 +297,11 @@ def __init__( :paramtype version_id: str """ super(DataCallRequest, self).__init__(**kwargs) - self.data_uri = kwargs.get('data_uri', None) - self.data_type = kwargs.get('data_type', None) - self.asset_id = kwargs.get('asset_id', None) - self.data_container_name = kwargs.get('data_container_name', None) - self.version_id = kwargs.get('version_id', None) + self.data_uri = kwargs.get("data_uri", None) + self.data_type = kwargs.get("data_type", None) + self.asset_id = kwargs.get("asset_id", None) + self.data_container_name = kwargs.get("data_container_name", None) + self.version_id = kwargs.get("version_id", None) class DataContainer(msrest.serialization.Model): @@ -344,21 +320,21 @@ class DataContainer(msrest.serialization.Model): """ _validation = { - 'name': {'required': True}, - 'data_type': {'required': True}, + "name": {"required": True}, + "data_type": {"required": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'mutable_props': {'key': 'mutableProps', 'type': 'DataContainerMutable'}, - 'is_registered': {'key': 'isRegistered', 'type': 'bool'}, + "name": {"key": "name", "type": "str"}, + "data_type": {"key": "dataType", "type": "str"}, + "mutable_props": { + "key": "mutableProps", + "type": "DataContainerMutable", + }, + "is_registered": {"key": "isRegistered", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: Required. :paramtype name: str @@ -370,10 +346,10 @@ def __init__( :paramtype is_registered: bool """ super(DataContainer, self).__init__(**kwargs) - self.name = kwargs['name'] - self.data_type = kwargs['data_type'] - self.mutable_props = kwargs.get('mutable_props', None) - self.is_registered = kwargs.get('is_registered', None) + self.name = kwargs["name"] + self.data_type = kwargs["data_type"] + self.mutable_props = kwargs.get("mutable_props", None) + self.is_registered = kwargs.get("is_registered", None) class DataContainerEntity(msrest.serialization.Model): @@ -392,17 +368,17 @@ class DataContainerEntity(msrest.serialization.Model): """ _attribute_map = { - 'data_container': {'key': 'dataContainer', 'type': 'DataContainer'}, - 'entity_metadata': {'key': 'entityMetadata', 'type': 'EntityMetadata'}, - 'latest_version': {'key': 'latestVersion', 'type': 'DataVersionEntity'}, - 'next_version_id': {'key': 'nextVersionId', 'type': 'str'}, - 'legacy_dataset_type': {'key': 'legacyDatasetType', 'type': 'str'}, + "data_container": {"key": "dataContainer", "type": "DataContainer"}, + "entity_metadata": {"key": "entityMetadata", "type": "EntityMetadata"}, + "latest_version": { + "key": "latestVersion", + "type": "DataVersionEntity", + }, + "next_version_id": {"key": "nextVersionId", "type": "str"}, + "legacy_dataset_type": {"key": "legacyDatasetType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data_container: :paramtype data_container: ~azure.mgmt.machinelearningservices.models.DataContainer @@ -416,11 +392,11 @@ def __init__( :paramtype legacy_dataset_type: str """ super(DataContainerEntity, self).__init__(**kwargs) - self.data_container = kwargs.get('data_container', None) - self.entity_metadata = kwargs.get('entity_metadata', None) - self.latest_version = kwargs.get('latest_version', None) - self.next_version_id = kwargs.get('next_version_id', None) - self.legacy_dataset_type = kwargs.get('legacy_dataset_type', None) + self.data_container = kwargs.get("data_container", None) + self.entity_metadata = kwargs.get("entity_metadata", None) + self.latest_version = kwargs.get("latest_version", None) + self.next_version_id = kwargs.get("next_version_id", None) + self.legacy_dataset_type = kwargs.get("legacy_dataset_type", None) class DataContainerMutable(msrest.serialization.Model): @@ -435,15 +411,12 @@ class DataContainerMutable(msrest.serialization.Model): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, + "description": {"key": "description", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: :paramtype description: str @@ -453,9 +426,9 @@ def __init__( :paramtype is_archived: bool """ super(DataContainerMutable, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.tags = kwargs.get('tags', None) - self.is_archived = kwargs.get('is_archived', None) + self.description = kwargs.get("description", None) + self.tags = kwargs.get("tags", None) + self.is_archived = kwargs.get("is_archived", None) class DataField(msrest.serialization.Model): @@ -469,14 +442,11 @@ class DataField(msrest.serialization.Model): """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'object'}, + "type": {"key": "type", "type": "str"}, + "value": {"key": "value", "type": "object"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword type: Possible values include: "String", "Boolean", "Integer", "Decimal", "Date", "Unknown", "Error", "Null", "DataRow", "List", "Stream". @@ -485,8 +455,8 @@ def __init__( :paramtype value: any """ super(DataField, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.value = kwargs.get('value', None) + self.type = kwargs.get("type", None) + self.value = kwargs.get("value", None) class Dataset(msrest.serialization.Model): @@ -521,25 +491,22 @@ class Dataset(msrest.serialization.Model): """ _attribute_map = { - 'dataset_id': {'key': 'datasetId', 'type': 'str'}, - 'dataset_state': {'key': 'datasetState', 'type': 'DatasetState'}, - 'latest': {'key': 'latest', 'type': 'DatasetDefinition'}, - 'next_version_id': {'key': 'nextVersionId', 'type': 'str'}, - 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, - 'modified_time': {'key': 'modifiedTime', 'type': 'iso-8601'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_visible': {'key': 'isVisible', 'type': 'bool'}, - 'default_compute': {'key': 'defaultCompute', 'type': 'str'}, - 'dataset_type': {'key': 'datasetType', 'type': 'str'}, + "dataset_id": {"key": "datasetId", "type": "str"}, + "dataset_state": {"key": "datasetState", "type": "DatasetState"}, + "latest": {"key": "latest", "type": "DatasetDefinition"}, + "next_version_id": {"key": "nextVersionId", "type": "str"}, + "created_time": {"key": "createdTime", "type": "iso-8601"}, + "modified_time": {"key": "modifiedTime", "type": "iso-8601"}, + "etag": {"key": "etag", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_visible": {"key": "isVisible", "type": "bool"}, + "default_compute": {"key": "defaultCompute", "type": "str"}, + "dataset_type": {"key": "datasetType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword dataset_id: :paramtype dataset_id: str @@ -569,19 +536,19 @@ def __init__( :paramtype dataset_type: str """ super(Dataset, self).__init__(**kwargs) - self.dataset_id = kwargs.get('dataset_id', None) - self.dataset_state = kwargs.get('dataset_state', None) - self.latest = kwargs.get('latest', None) - self.next_version_id = kwargs.get('next_version_id', None) - self.created_time = kwargs.get('created_time', None) - self.modified_time = kwargs.get('modified_time', None) - self.etag = kwargs.get('etag', None) - self.name = kwargs.get('name', None) - self.description = kwargs.get('description', None) - self.tags = kwargs.get('tags', None) - self.is_visible = kwargs.get('is_visible', None) - self.default_compute = kwargs.get('default_compute', None) - self.dataset_type = kwargs.get('dataset_type', None) + self.dataset_id = kwargs.get("dataset_id", None) + self.dataset_state = kwargs.get("dataset_state", None) + self.latest = kwargs.get("latest", None) + self.next_version_id = kwargs.get("next_version_id", None) + self.created_time = kwargs.get("created_time", None) + self.modified_time = kwargs.get("modified_time", None) + self.etag = kwargs.get("etag", None) + self.name = kwargs.get("name", None) + self.description = kwargs.get("description", None) + self.tags = kwargs.get("tags", None) + self.is_visible = kwargs.get("is_visible", None) + self.default_compute = kwargs.get("default_compute", None) + self.dataset_type = kwargs.get("dataset_type", None) class DatasetDefinition(msrest.serialization.Model): @@ -634,34 +601,43 @@ class DatasetDefinition(msrest.serialization.Model): """ _attribute_map = { - 'dataset_id': {'key': 'datasetId', 'type': 'str'}, - 'version_id': {'key': 'versionId', 'type': 'str'}, - 'dataset_definition_state': {'key': 'datasetDefinitionState', 'type': 'DatasetState'}, - 'dataflow': {'key': 'dataflow', 'type': 'str'}, - 'dataflow_type': {'key': 'dataflowType', 'type': 'str'}, - 'data_path': {'key': 'dataPath', 'type': 'DatasetPath'}, - 'partition_format_in_path': {'key': 'partitionFormatInPath', 'type': 'str'}, - 'profile_action_result': {'key': 'profileActionResult', 'type': 'ProfileActionResult'}, - 'notes': {'key': 'notes', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, - 'modified_time': {'key': 'modifiedTime', 'type': 'iso-8601'}, - 'data_expiry_time': {'key': 'dataExpiryTime', 'type': 'iso-8601'}, - 'created_by': {'key': 'createdBy', 'type': 'User'}, - 'modified_by': {'key': 'modifiedBy', 'type': 'User'}, - 'file_type': {'key': 'fileType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - 'saved_dataset_id': {'key': 'savedDatasetId', 'type': 'str'}, - 'telemetry_info': {'key': 'telemetryInfo', 'type': '{str}'}, - 'use_description_tags_from_definition': {'key': 'useDescriptionTagsFromDefinition', 'type': 'bool'}, - 'description': {'key': 'description', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "dataset_id": {"key": "datasetId", "type": "str"}, + "version_id": {"key": "versionId", "type": "str"}, + "dataset_definition_state": { + "key": "datasetDefinitionState", + "type": "DatasetState", + }, + "dataflow": {"key": "dataflow", "type": "str"}, + "dataflow_type": {"key": "dataflowType", "type": "str"}, + "data_path": {"key": "dataPath", "type": "DatasetPath"}, + "partition_format_in_path": { + "key": "partitionFormatInPath", + "type": "str", + }, + "profile_action_result": { + "key": "profileActionResult", + "type": "ProfileActionResult", + }, + "notes": {"key": "notes", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "created_time": {"key": "createdTime", "type": "iso-8601"}, + "modified_time": {"key": "modifiedTime", "type": "iso-8601"}, + "data_expiry_time": {"key": "dataExpiryTime", "type": "iso-8601"}, + "created_by": {"key": "createdBy", "type": "User"}, + "modified_by": {"key": "modifiedBy", "type": "User"}, + "file_type": {"key": "fileType", "type": "str"}, + "properties": {"key": "properties", "type": "{object}"}, + "saved_dataset_id": {"key": "savedDatasetId", "type": "str"}, + "telemetry_info": {"key": "telemetryInfo", "type": "{str}"}, + "use_description_tags_from_definition": { + "key": "useDescriptionTagsFromDefinition", + "type": "bool", + }, + "description": {"key": "description", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword dataset_id: :paramtype dataset_id: str @@ -710,28 +686,34 @@ def __init__( :paramtype tags: dict[str, str] """ super(DatasetDefinition, self).__init__(**kwargs) - self.dataset_id = kwargs.get('dataset_id', None) - self.version_id = kwargs.get('version_id', None) - self.dataset_definition_state = kwargs.get('dataset_definition_state', None) - self.dataflow = kwargs.get('dataflow', None) - self.dataflow_type = kwargs.get('dataflow_type', None) - self.data_path = kwargs.get('data_path', None) - self.partition_format_in_path = kwargs.get('partition_format_in_path', None) - self.profile_action_result = kwargs.get('profile_action_result', None) - self.notes = kwargs.get('notes', None) - self.etag = kwargs.get('etag', None) - self.created_time = kwargs.get('created_time', None) - self.modified_time = kwargs.get('modified_time', None) - self.data_expiry_time = kwargs.get('data_expiry_time', None) - self.created_by = kwargs.get('created_by', None) - self.modified_by = kwargs.get('modified_by', None) - self.file_type = kwargs.get('file_type', None) - self.properties = kwargs.get('properties', None) - self.saved_dataset_id = kwargs.get('saved_dataset_id', None) - self.telemetry_info = kwargs.get('telemetry_info', None) - self.use_description_tags_from_definition = kwargs.get('use_description_tags_from_definition', None) - self.description = kwargs.get('description', None) - self.tags = kwargs.get('tags', None) + self.dataset_id = kwargs.get("dataset_id", None) + self.version_id = kwargs.get("version_id", None) + self.dataset_definition_state = kwargs.get( + "dataset_definition_state", None + ) + self.dataflow = kwargs.get("dataflow", None) + self.dataflow_type = kwargs.get("dataflow_type", None) + self.data_path = kwargs.get("data_path", None) + self.partition_format_in_path = kwargs.get( + "partition_format_in_path", None + ) + self.profile_action_result = kwargs.get("profile_action_result", None) + self.notes = kwargs.get("notes", None) + self.etag = kwargs.get("etag", None) + self.created_time = kwargs.get("created_time", None) + self.modified_time = kwargs.get("modified_time", None) + self.data_expiry_time = kwargs.get("data_expiry_time", None) + self.created_by = kwargs.get("created_by", None) + self.modified_by = kwargs.get("modified_by", None) + self.file_type = kwargs.get("file_type", None) + self.properties = kwargs.get("properties", None) + self.saved_dataset_id = kwargs.get("saved_dataset_id", None) + self.telemetry_info = kwargs.get("telemetry_info", None) + self.use_description_tags_from_definition = kwargs.get( + "use_description_tags_from_definition", None + ) + self.description = kwargs.get("description", None) + self.tags = kwargs.get("tags", None) class DatasetDefinitionReference(msrest.serialization.Model): @@ -744,14 +726,11 @@ class DatasetDefinitionReference(msrest.serialization.Model): """ _attribute_map = { - 'dataset_id': {'key': 'datasetId', 'type': 'str'}, - 'definition_version': {'key': 'definitionVersion', 'type': 'str'}, + "dataset_id": {"key": "datasetId", "type": "str"}, + "definition_version": {"key": "definitionVersion", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword dataset_id: :paramtype dataset_id: str @@ -759,8 +738,8 @@ def __init__( :paramtype definition_version: str """ super(DatasetDefinitionReference, self).__init__(**kwargs) - self.dataset_id = kwargs.get('dataset_id', None) - self.definition_version = kwargs.get('definition_version', None) + self.dataset_id = kwargs.get("dataset_id", None) + self.definition_version = kwargs.get("definition_version", None) class DatasetPath(msrest.serialization.Model): @@ -787,21 +766,24 @@ class DatasetPath(msrest.serialization.Model): """ _attribute_map = { - 'datastore_name': {'key': 'datastoreName', 'type': 'str'}, - 'relative_path': {'key': 'relativePath', 'type': 'str'}, - 'azure_file_path': {'key': 'azureFilePath', 'type': 'str'}, - 'paths': {'key': 'paths', 'type': '[str]'}, - 'sql_data_path': {'key': 'sqlDataPath', 'type': 'SqlDataPath'}, - 'http_url': {'key': 'httpUrl', 'type': 'str'}, - 'additional_properties': {'key': 'additionalProperties', 'type': '{object}'}, - 'partition_format': {'key': 'partitionFormat', 'type': 'str'}, - 'partition_format_ignore_error': {'key': 'partitionFormatIgnoreError', 'type': 'bool'}, + "datastore_name": {"key": "datastoreName", "type": "str"}, + "relative_path": {"key": "relativePath", "type": "str"}, + "azure_file_path": {"key": "azureFilePath", "type": "str"}, + "paths": {"key": "paths", "type": "[str]"}, + "sql_data_path": {"key": "sqlDataPath", "type": "SqlDataPath"}, + "http_url": {"key": "httpUrl", "type": "str"}, + "additional_properties": { + "key": "additionalProperties", + "type": "{object}", + }, + "partition_format": {"key": "partitionFormat", "type": "str"}, + "partition_format_ignore_error": { + "key": "partitionFormatIgnoreError", + "type": "bool", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword datastore_name: :paramtype datastore_name: str @@ -823,15 +805,17 @@ def __init__( :paramtype partition_format_ignore_error: bool """ super(DatasetPath, self).__init__(**kwargs) - self.datastore_name = kwargs.get('datastore_name', None) - self.relative_path = kwargs.get('relative_path', None) - self.azure_file_path = kwargs.get('azure_file_path', None) - self.paths = kwargs.get('paths', None) - self.sql_data_path = kwargs.get('sql_data_path', None) - self.http_url = kwargs.get('http_url', None) - self.additional_properties = kwargs.get('additional_properties', None) - self.partition_format = kwargs.get('partition_format', None) - self.partition_format_ignore_error = kwargs.get('partition_format_ignore_error', None) + self.datastore_name = kwargs.get("datastore_name", None) + self.relative_path = kwargs.get("relative_path", None) + self.azure_file_path = kwargs.get("azure_file_path", None) + self.paths = kwargs.get("paths", None) + self.sql_data_path = kwargs.get("sql_data_path", None) + self.http_url = kwargs.get("http_url", None) + self.additional_properties = kwargs.get("additional_properties", None) + self.partition_format = kwargs.get("partition_format", None) + self.partition_format_ignore_error = kwargs.get( + "partition_format_ignore_error", None + ) class DatasetState(msrest.serialization.Model): @@ -846,15 +830,15 @@ class DatasetState(msrest.serialization.Model): """ _attribute_map = { - 'state': {'key': 'state', 'type': 'str'}, - 'deprecated_by': {'key': 'deprecatedBy', 'type': 'DatasetDefinitionReference'}, - 'etag': {'key': 'etag', 'type': 'str'}, + "state": {"key": "state", "type": "str"}, + "deprecated_by": { + "key": "deprecatedBy", + "type": "DatasetDefinitionReference", + }, + "etag": {"key": "etag", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword state: :paramtype state: str @@ -864,9 +848,9 @@ def __init__( :paramtype etag: str """ super(DatasetState, self).__init__(**kwargs) - self.state = kwargs.get('state', None) - self.deprecated_by = kwargs.get('deprecated_by', None) - self.etag = kwargs.get('etag', None) + self.state = kwargs.get("state", None) + self.deprecated_by = kwargs.get("deprecated_by", None) + self.etag = kwargs.get("etag", None) class DatasetV2(msrest.serialization.Model): @@ -907,28 +891,25 @@ class DatasetV2(msrest.serialization.Model): """ _attribute_map = { - 'dataset_id': {'key': 'datasetId', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'version_id': {'key': 'versionId', 'type': 'str'}, - 'dataflow': {'key': 'dataflow', 'type': 'str'}, - 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, - 'modified_time': {'key': 'modifiedTime', 'type': 'iso-8601'}, - 'created_by': {'key': 'createdBy', 'type': 'User'}, - 'modified_by': {'key': 'modifiedBy', 'type': 'User'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'telemetry_info': {'key': 'telemetryInfo', 'type': '{str}'}, - 'description': {'key': 'description', 'type': 'str'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'legacy_properties': {'key': 'legacyProperties', 'type': '{object}'}, - 'data_expiry_time': {'key': 'dataExpiryTime', 'type': 'iso-8601'}, - 'legacy': {'key': 'legacy', 'type': '{object}'}, + "dataset_id": {"key": "datasetId", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "version_id": {"key": "versionId", "type": "str"}, + "dataflow": {"key": "dataflow", "type": "str"}, + "created_time": {"key": "createdTime", "type": "iso-8601"}, + "modified_time": {"key": "modifiedTime", "type": "iso-8601"}, + "created_by": {"key": "createdBy", "type": "User"}, + "modified_by": {"key": "modifiedBy", "type": "User"}, + "properties": {"key": "properties", "type": "{str}"}, + "telemetry_info": {"key": "telemetryInfo", "type": "{str}"}, + "description": {"key": "description", "type": "str"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "tags": {"key": "tags", "type": "{str}"}, + "legacy_properties": {"key": "legacyProperties", "type": "{object}"}, + "data_expiry_time": {"key": "dataExpiryTime", "type": "iso-8601"}, + "legacy": {"key": "legacy", "type": "{object}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword dataset_id: :paramtype dataset_id: str @@ -964,22 +945,22 @@ def __init__( :paramtype legacy: dict[str, any] """ super(DatasetV2, self).__init__(**kwargs) - self.dataset_id = kwargs.get('dataset_id', None) - self.name = kwargs.get('name', None) - self.version_id = kwargs.get('version_id', None) - self.dataflow = kwargs.get('dataflow', None) - self.created_time = kwargs.get('created_time', None) - self.modified_time = kwargs.get('modified_time', None) - self.created_by = kwargs.get('created_by', None) - self.modified_by = kwargs.get('modified_by', None) - self.properties = kwargs.get('properties', None) - self.telemetry_info = kwargs.get('telemetry_info', None) - self.description = kwargs.get('description', None) - self.is_anonymous = kwargs.get('is_anonymous', None) - self.tags = kwargs.get('tags', None) - self.legacy_properties = kwargs.get('legacy_properties', None) - self.data_expiry_time = kwargs.get('data_expiry_time', None) - self.legacy = kwargs.get('legacy', None) + self.dataset_id = kwargs.get("dataset_id", None) + self.name = kwargs.get("name", None) + self.version_id = kwargs.get("version_id", None) + self.dataflow = kwargs.get("dataflow", None) + self.created_time = kwargs.get("created_time", None) + self.modified_time = kwargs.get("modified_time", None) + self.created_by = kwargs.get("created_by", None) + self.modified_by = kwargs.get("modified_by", None) + self.properties = kwargs.get("properties", None) + self.telemetry_info = kwargs.get("telemetry_info", None) + self.description = kwargs.get("description", None) + self.is_anonymous = kwargs.get("is_anonymous", None) + self.tags = kwargs.get("tags", None) + self.legacy_properties = kwargs.get("legacy_properties", None) + self.data_expiry_time = kwargs.get("data_expiry_time", None) + self.legacy = kwargs.get("legacy", None) class DataUriV2Response(msrest.serialization.Model): @@ -992,14 +973,11 @@ class DataUriV2Response(msrest.serialization.Model): """ _attribute_map = { - 'uri': {'key': 'uri', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + "uri": {"key": "uri", "type": "str"}, + "type": {"key": "type", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword uri: :paramtype uri: str @@ -1007,8 +985,8 @@ def __init__( :paramtype type: str """ super(DataUriV2Response, self).__init__(**kwargs) - self.uri = kwargs.get('uri', None) - self.type = kwargs.get('type', None) + self.uri = kwargs.get("uri", None) + self.type = kwargs.get("type", None) class DataVersion(msrest.serialization.Model): @@ -1035,27 +1013,24 @@ class DataVersion(msrest.serialization.Model): """ _validation = { - 'data_container_name': {'required': True}, - 'data_type': {'required': True}, - 'data_uri': {'required': True}, - 'version_id': {'required': True}, + "data_container_name": {"required": True}, + "data_type": {"required": True}, + "data_uri": {"required": True}, + "version_id": {"required": True}, } _attribute_map = { - 'asset_id': {'key': 'assetId', 'type': 'str'}, - 'data_container_name': {'key': 'dataContainerName', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'version_id': {'key': 'versionId', 'type': 'str'}, - 'mutable_props': {'key': 'mutableProps', 'type': 'DataVersionMutable'}, - 'referenced_data_uris': {'key': 'referencedDataUris', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, + "asset_id": {"key": "assetId", "type": "str"}, + "data_container_name": {"key": "dataContainerName", "type": "str"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, + "version_id": {"key": "versionId", "type": "str"}, + "mutable_props": {"key": "mutableProps", "type": "DataVersionMutable"}, + "referenced_data_uris": {"key": "referencedDataUris", "type": "[str]"}, + "properties": {"key": "properties", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword asset_id: :paramtype asset_id: str @@ -1075,14 +1050,14 @@ def __init__( :paramtype properties: dict[str, str] """ super(DataVersion, self).__init__(**kwargs) - self.asset_id = kwargs.get('asset_id', None) - self.data_container_name = kwargs['data_container_name'] - self.data_type = kwargs['data_type'] - self.data_uri = kwargs['data_uri'] - self.version_id = kwargs['version_id'] - self.mutable_props = kwargs.get('mutable_props', None) - self.referenced_data_uris = kwargs.get('referenced_data_uris', None) - self.properties = kwargs.get('properties', None) + self.asset_id = kwargs.get("asset_id", None) + self.data_container_name = kwargs["data_container_name"] + self.data_type = kwargs["data_type"] + self.data_uri = kwargs["data_uri"] + self.version_id = kwargs["version_id"] + self.mutable_props = kwargs.get("mutable_props", None) + self.referenced_data_uris = kwargs.get("referenced_data_uris", None) + self.properties = kwargs.get("properties", None) class DataVersionEntity(msrest.serialization.Model): @@ -1095,14 +1070,11 @@ class DataVersionEntity(msrest.serialization.Model): """ _attribute_map = { - 'data_version': {'key': 'dataVersion', 'type': 'DataVersion'}, - 'entity_metadata': {'key': 'entityMetadata', 'type': 'EntityMetadata'}, + "data_version": {"key": "dataVersion", "type": "DataVersion"}, + "entity_metadata": {"key": "entityMetadata", "type": "EntityMetadata"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data_version: :paramtype data_version: ~azure.mgmt.machinelearningservices.models.DataVersion @@ -1110,8 +1082,8 @@ def __init__( :paramtype entity_metadata: ~azure.mgmt.machinelearningservices.models.EntityMetadata """ super(DataVersionEntity, self).__init__(**kwargs) - self.data_version = kwargs.get('data_version', None) - self.entity_metadata = kwargs.get('entity_metadata', None) + self.data_version = kwargs.get("data_version", None) + self.entity_metadata = kwargs.get("entity_metadata", None) class DataVersionMutable(msrest.serialization.Model): @@ -1128,16 +1100,13 @@ class DataVersionMutable(msrest.serialization.Model): """ _attribute_map = { - 'data_expiry_time': {'key': 'dataExpiryTime', 'type': 'iso-8601'}, - 'description': {'key': 'description', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, + "data_expiry_time": {"key": "dataExpiryTime", "type": "iso-8601"}, + "description": {"key": "description", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data_expiry_time: :paramtype data_expiry_time: ~datetime.datetime @@ -1149,10 +1118,10 @@ def __init__( :paramtype is_archived: bool """ super(DataVersionMutable, self).__init__(**kwargs) - self.data_expiry_time = kwargs.get('data_expiry_time', None) - self.description = kwargs.get('description', None) - self.tags = kwargs.get('tags', None) - self.is_archived = kwargs.get('is_archived', None) + self.data_expiry_time = kwargs.get("data_expiry_time", None) + self.description = kwargs.get("description", None) + self.tags = kwargs.get("tags", None) + self.is_archived = kwargs.get("is_archived", None) class DataViewSetResult(msrest.serialization.Model): @@ -1165,14 +1134,11 @@ class DataViewSetResult(msrest.serialization.Model): """ _attribute_map = { - 'schema': {'key': 'schema', 'type': '[ColumnDefinition]'}, - 'rows': {'key': 'rows', 'type': '[[DataField]]'}, + "schema": {"key": "schema", "type": "[ColumnDefinition]"}, + "rows": {"key": "rows", "type": "[[DataField]]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword schema: :paramtype schema: list[~azure.mgmt.machinelearningservices.models.ColumnDefinition] @@ -1180,8 +1146,8 @@ def __init__( :paramtype rows: list[list[~azure.mgmt.machinelearningservices.models.DataField]] """ super(DataViewSetResult, self).__init__(**kwargs) - self.schema = kwargs.get('schema', None) - self.rows = kwargs.get('rows', None) + self.schema = kwargs.get("schema", None) + self.rows = kwargs.get("rows", None) class EntityMetadata(msrest.serialization.Model): @@ -1200,17 +1166,14 @@ class EntityMetadata(msrest.serialization.Model): """ _attribute_map = { - 'etag': {'key': 'etag', 'type': 'str'}, - 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, - 'modified_time': {'key': 'modifiedTime', 'type': 'iso-8601'}, - 'created_by': {'key': 'createdBy', 'type': 'User'}, - 'modified_by': {'key': 'modifiedBy', 'type': 'User'}, + "etag": {"key": "etag", "type": "str"}, + "created_time": {"key": "createdTime", "type": "iso-8601"}, + "modified_time": {"key": "modifiedTime", "type": "iso-8601"}, + "created_by": {"key": "createdBy", "type": "User"}, + "modified_by": {"key": "modifiedBy", "type": "User"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword etag: :paramtype etag: str @@ -1224,11 +1187,11 @@ def __init__( :paramtype modified_by: ~azure.mgmt.machinelearningservices.models.User """ super(EntityMetadata, self).__init__(**kwargs) - self.etag = kwargs.get('etag', None) - self.created_time = kwargs.get('created_time', None) - self.modified_time = kwargs.get('modified_time', None) - self.created_by = kwargs.get('created_by', None) - self.modified_by = kwargs.get('modified_by', None) + self.etag = kwargs.get("etag", None) + self.created_time = kwargs.get("created_time", None) + self.modified_time = kwargs.get("modified_time", None) + self.created_by = kwargs.get("created_by", None) + self.modified_by = kwargs.get("modified_by", None) class ErrorAdditionalInfo(msrest.serialization.Model): @@ -1241,14 +1204,11 @@ class ErrorAdditionalInfo(msrest.serialization.Model): """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, + "type": {"key": "type", "type": "str"}, + "info": {"key": "info", "type": "object"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword type: The additional info type. :paramtype type: str @@ -1256,8 +1216,8 @@ def __init__( :paramtype info: any """ super(ErrorAdditionalInfo, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.info = kwargs.get('info', None) + self.type = kwargs.get("type", None) + self.info = kwargs.get("info", None) class ErrorResponse(msrest.serialization.Model): @@ -1278,18 +1238,15 @@ class ErrorResponse(msrest.serialization.Model): """ _attribute_map = { - 'error': {'key': 'error', 'type': 'RootError'}, - 'correlation': {'key': 'correlation', 'type': '{str}'}, - 'environment': {'key': 'environment', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'time': {'key': 'time', 'type': 'iso-8601'}, - 'component_name': {'key': 'componentName', 'type': 'str'}, + "error": {"key": "error", "type": "RootError"}, + "correlation": {"key": "correlation", "type": "{str}"}, + "environment": {"key": "environment", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "time": {"key": "time", "type": "iso-8601"}, + "component_name": {"key": "componentName", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword error: The root error. :paramtype error: ~azure.mgmt.machinelearningservices.models.RootError @@ -1305,12 +1262,12 @@ def __init__( :paramtype component_name: str """ super(ErrorResponse, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - self.correlation = kwargs.get('correlation', None) - self.environment = kwargs.get('environment', None) - self.location = kwargs.get('location', None) - self.time = kwargs.get('time', None) - self.component_name = kwargs.get('component_name', None) + self.error = kwargs.get("error", None) + self.correlation = kwargs.get("correlation", None) + self.environment = kwargs.get("environment", None) + self.location = kwargs.get("location", None) + self.time = kwargs.get("time", None) + self.component_name = kwargs.get("component_name", None) class HistogramBin(msrest.serialization.Model): @@ -1325,15 +1282,12 @@ class HistogramBin(msrest.serialization.Model): """ _attribute_map = { - 'lower_bound': {'key': 'lowerBound', 'type': 'float'}, - 'upper_bound': {'key': 'upperBound', 'type': 'float'}, - 'count': {'key': 'count', 'type': 'float'}, + "lower_bound": {"key": "lowerBound", "type": "float"}, + "upper_bound": {"key": "upperBound", "type": "float"}, + "count": {"key": "count", "type": "float"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword lower_bound: :paramtype lower_bound: float @@ -1343,9 +1297,9 @@ def __init__( :paramtype count: float """ super(HistogramBin, self).__init__(**kwargs) - self.lower_bound = kwargs.get('lower_bound', None) - self.upper_bound = kwargs.get('upper_bound', None) - self.count = kwargs.get('count', None) + self.lower_bound = kwargs.get("lower_bound", None) + self.upper_bound = kwargs.get("upper_bound", None) + self.count = kwargs.get("count", None) class HttpContent(msrest.serialization.Model): @@ -1359,19 +1313,18 @@ class HttpContent(msrest.serialization.Model): """ _validation = { - 'headers': {'readonly': True}, + "headers": {"readonly": True}, } _attribute_map = { - 'headers': {'key': 'headers', 'type': '[KeyValuePairStringIEnumerable1]'}, + "headers": { + "key": "headers", + "type": "[KeyValuePairStringIEnumerable1]", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(HttpContent, self).__init__(**kwargs) self.headers = None @@ -1384,19 +1337,16 @@ class HttpMethod(msrest.serialization.Model): """ _attribute_map = { - 'method': {'key': 'method', 'type': 'str'}, + "method": {"key": "method", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword method: :paramtype method: str """ super(HttpMethod, self).__init__(**kwargs) - self.method = kwargs.get('method', None) + self.method = kwargs.get("method", None) class HttpRequestMessage(msrest.serialization.Model): @@ -1423,24 +1373,24 @@ class HttpRequestMessage(msrest.serialization.Model): """ _validation = { - 'headers': {'readonly': True}, - 'options': {'readonly': True}, + "headers": {"readonly": True}, + "options": {"readonly": True}, } _attribute_map = { - 'version': {'key': 'version', 'type': 'str'}, - 'version_policy': {'key': 'versionPolicy', 'type': 'str'}, - 'content': {'key': 'content', 'type': 'HttpContent'}, - 'method': {'key': 'method', 'type': 'HttpMethod'}, - 'request_uri': {'key': 'requestUri', 'type': 'str'}, - 'headers': {'key': 'headers', 'type': '[KeyValuePairStringIEnumerable1]'}, - 'options': {'key': 'options', 'type': '{object}'}, + "version": {"key": "version", "type": "str"}, + "version_policy": {"key": "versionPolicy", "type": "str"}, + "content": {"key": "content", "type": "HttpContent"}, + "method": {"key": "method", "type": "HttpMethod"}, + "request_uri": {"key": "requestUri", "type": "str"}, + "headers": { + "key": "headers", + "type": "[KeyValuePairStringIEnumerable1]", + }, + "options": {"key": "options", "type": "{object}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword version: :paramtype version: str @@ -1455,11 +1405,11 @@ def __init__( :paramtype request_uri: str """ super(HttpRequestMessage, self).__init__(**kwargs) - self.version = kwargs.get('version', None) - self.version_policy = kwargs.get('version_policy', None) - self.content = kwargs.get('content', None) - self.method = kwargs.get('method', None) - self.request_uri = kwargs.get('request_uri', None) + self.version = kwargs.get("version", None) + self.version_policy = kwargs.get("version_policy", None) + self.content = kwargs.get("content", None) + self.method = kwargs.get("method", None) + self.request_uri = kwargs.get("request_uri", None) self.headers = None self.options = None @@ -1503,26 +1453,35 @@ class HttpResponseMessage(msrest.serialization.Model): """ _validation = { - 'headers': {'readonly': True}, - 'trailing_headers': {'readonly': True}, - 'is_success_status_code': {'readonly': True}, + "headers": {"readonly": True}, + "trailing_headers": {"readonly": True}, + "is_success_status_code": {"readonly": True}, } _attribute_map = { - 'version': {'key': 'version', 'type': 'str'}, - 'content': {'key': 'content', 'type': 'HttpContent'}, - 'status_code': {'key': 'statusCode', 'type': 'str'}, - 'reason_phrase': {'key': 'reasonPhrase', 'type': 'str'}, - 'headers': {'key': 'headers', 'type': '[KeyValuePairStringIEnumerable1]'}, - 'trailing_headers': {'key': 'trailingHeaders', 'type': '[KeyValuePairStringIEnumerable1]'}, - 'request_message': {'key': 'requestMessage', 'type': 'HttpRequestMessage'}, - 'is_success_status_code': {'key': 'isSuccessStatusCode', 'type': 'bool'}, + "version": {"key": "version", "type": "str"}, + "content": {"key": "content", "type": "HttpContent"}, + "status_code": {"key": "statusCode", "type": "str"}, + "reason_phrase": {"key": "reasonPhrase", "type": "str"}, + "headers": { + "key": "headers", + "type": "[KeyValuePairStringIEnumerable1]", + }, + "trailing_headers": { + "key": "trailingHeaders", + "type": "[KeyValuePairStringIEnumerable1]", + }, + "request_message": { + "key": "requestMessage", + "type": "HttpRequestMessage", + }, + "is_success_status_code": { + "key": "isSuccessStatusCode", + "type": "bool", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword version: :paramtype version: str @@ -1549,13 +1508,13 @@ def __init__( :paramtype request_message: ~azure.mgmt.machinelearningservices.models.HttpRequestMessage """ super(HttpResponseMessage, self).__init__(**kwargs) - self.version = kwargs.get('version', None) - self.content = kwargs.get('content', None) - self.status_code = kwargs.get('status_code', None) - self.reason_phrase = kwargs.get('reason_phrase', None) + self.version = kwargs.get("version", None) + self.content = kwargs.get("content", None) + self.status_code = kwargs.get("status_code", None) + self.reason_phrase = kwargs.get("reason_phrase", None) self.headers = None self.trailing_headers = None - self.request_message = kwargs.get('request_message', None) + self.request_message = kwargs.get("request_message", None) self.is_success_status_code = None @@ -1569,14 +1528,11 @@ class InnerErrorResponse(msrest.serialization.Model): """ _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'inner_error': {'key': 'innerError', 'type': 'InnerErrorResponse'}, + "code": {"key": "code", "type": "str"}, + "inner_error": {"key": "innerError", "type": "InnerErrorResponse"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword code: The error code. :paramtype code: str @@ -1584,8 +1540,8 @@ def __init__( :paramtype inner_error: ~azure.mgmt.machinelearningservices.models.InnerErrorResponse """ super(InnerErrorResponse, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.inner_error = kwargs.get('inner_error', None) + self.code = kwargs.get("code", None) + self.inner_error = kwargs.get("inner_error", None) class KeyValuePairStringIEnumerable1(msrest.serialization.Model): @@ -1598,14 +1554,11 @@ class KeyValuePairStringIEnumerable1(msrest.serialization.Model): """ _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[str]'}, + "key": {"key": "key", "type": "str"}, + "value": {"key": "value", "type": "[str]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword key: :paramtype key: str @@ -1613,11 +1566,13 @@ def __init__( :paramtype value: list[str] """ super(KeyValuePairStringIEnumerable1, self).__init__(**kwargs) - self.key = kwargs.get('key', None) - self.value = kwargs.get('value', None) + self.key = kwargs.get("key", None) + self.value = kwargs.get("value", None) -class LongRunningOperationResponse1LongRunningOperationResponseObject(msrest.serialization.Model): +class LongRunningOperationResponse1LongRunningOperationResponseObject( + msrest.serialization.Model +): """LongRunningOperationResponse1LongRunningOperationResponseObject. :ivar completion_result: Anything. @@ -1629,15 +1584,12 @@ class LongRunningOperationResponse1LongRunningOperationResponseObject(msrest.ser """ _attribute_map = { - 'completion_result': {'key': 'completionResult', 'type': 'object'}, - 'location': {'key': 'location', 'type': 'str'}, - 'operation_result': {'key': 'operationResult', 'type': 'str'}, + "completion_result": {"key": "completionResult", "type": "object"}, + "location": {"key": "location", "type": "str"}, + "operation_result": {"key": "operationResult", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword completion_result: Anything. :paramtype completion_result: any @@ -1646,10 +1598,13 @@ def __init__( :keyword operation_result: :paramtype operation_result: str """ - super(LongRunningOperationResponse1LongRunningOperationResponseObject, self).__init__(**kwargs) - self.completion_result = kwargs.get('completion_result', None) - self.location = kwargs.get('location', None) - self.operation_result = kwargs.get('operation_result', None) + super( + LongRunningOperationResponse1LongRunningOperationResponseObject, + self, + ).__init__(**kwargs) + self.completion_result = kwargs.get("completion_result", None) + self.location = kwargs.get("location", None) + self.operation_result = kwargs.get("operation_result", None) class Moments(msrest.serialization.Model): @@ -1668,17 +1623,14 @@ class Moments(msrest.serialization.Model): """ _attribute_map = { - 'mean': {'key': 'mean', 'type': 'float'}, - 'standard_deviation': {'key': 'standardDeviation', 'type': 'float'}, - 'variance': {'key': 'variance', 'type': 'float'}, - 'skewness': {'key': 'skewness', 'type': 'float'}, - 'kurtosis': {'key': 'kurtosis', 'type': 'float'}, + "mean": {"key": "mean", "type": "float"}, + "standard_deviation": {"key": "standardDeviation", "type": "float"}, + "variance": {"key": "variance", "type": "float"}, + "skewness": {"key": "skewness", "type": "float"}, + "kurtosis": {"key": "kurtosis", "type": "float"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mean: :paramtype mean: float @@ -1692,11 +1644,11 @@ def __init__( :paramtype kurtosis: float """ super(Moments, self).__init__(**kwargs) - self.mean = kwargs.get('mean', None) - self.standard_deviation = kwargs.get('standard_deviation', None) - self.variance = kwargs.get('variance', None) - self.skewness = kwargs.get('skewness', None) - self.kurtosis = kwargs.get('kurtosis', None) + self.mean = kwargs.get("mean", None) + self.standard_deviation = kwargs.get("standard_deviation", None) + self.variance = kwargs.get("variance", None) + self.skewness = kwargs.get("skewness", None) + self.kurtosis = kwargs.get("kurtosis", None) class PaginatedDataContainerEntityList(msrest.serialization.Model): @@ -1713,15 +1665,12 @@ class PaginatedDataContainerEntityList(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[DataContainerEntity]'}, - 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[DataContainerEntity]"}, + "continuation_token": {"key": "continuationToken", "type": "str"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: An array of objects of type DataContainerEntity. :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataContainerEntity] @@ -1733,9 +1682,9 @@ def __init__( :paramtype next_link: str """ super(PaginatedDataContainerEntityList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.continuation_token = kwargs.get('continuation_token', None) - self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get("value", None) + self.continuation_token = kwargs.get("continuation_token", None) + self.next_link = kwargs.get("next_link", None) class PaginatedDatasetDefinitionList(msrest.serialization.Model): @@ -1752,15 +1701,12 @@ class PaginatedDatasetDefinitionList(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[DatasetDefinition]'}, - 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[DatasetDefinition]"}, + "continuation_token": {"key": "continuationToken", "type": "str"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: An array of objects of type DatasetDefinition. :paramtype value: list[~azure.mgmt.machinelearningservices.models.DatasetDefinition] @@ -1772,9 +1718,9 @@ def __init__( :paramtype next_link: str """ super(PaginatedDatasetDefinitionList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.continuation_token = kwargs.get('continuation_token', None) - self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get("value", None) + self.continuation_token = kwargs.get("continuation_token", None) + self.next_link = kwargs.get("next_link", None) class PaginatedDatasetList(msrest.serialization.Model): @@ -1791,15 +1737,12 @@ class PaginatedDatasetList(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[Dataset]'}, - 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Dataset]"}, + "continuation_token": {"key": "continuationToken", "type": "str"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: An array of objects of type Dataset. :paramtype value: list[~azure.mgmt.machinelearningservices.models.Dataset] @@ -1811,9 +1754,9 @@ def __init__( :paramtype next_link: str """ super(PaginatedDatasetList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.continuation_token = kwargs.get('continuation_token', None) - self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get("value", None) + self.continuation_token = kwargs.get("continuation_token", None) + self.next_link = kwargs.get("next_link", None) class PaginatedDatasetV2List(msrest.serialization.Model): @@ -1830,15 +1773,12 @@ class PaginatedDatasetV2List(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[DatasetV2]'}, - 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[DatasetV2]"}, + "continuation_token": {"key": "continuationToken", "type": "str"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: An array of objects of type DatasetV2. :paramtype value: list[~azure.mgmt.machinelearningservices.models.DatasetV2] @@ -1850,9 +1790,9 @@ def __init__( :paramtype next_link: str """ super(PaginatedDatasetV2List, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.continuation_token = kwargs.get('continuation_token', None) - self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get("value", None) + self.continuation_token = kwargs.get("continuation_token", None) + self.next_link = kwargs.get("next_link", None) class PaginatedDataVersionEntityList(msrest.serialization.Model): @@ -1869,15 +1809,12 @@ class PaginatedDataVersionEntityList(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[DataVersionEntity]'}, - 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[DataVersionEntity]"}, + "continuation_token": {"key": "continuationToken", "type": "str"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: An array of objects of type DataVersionEntity. :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataVersionEntity] @@ -1889,9 +1826,9 @@ def __init__( :paramtype next_link: str """ super(PaginatedDataVersionEntityList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.continuation_token = kwargs.get('continuation_token', None) - self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get("value", None) + self.continuation_token = kwargs.get("continuation_token", None) + self.next_link = kwargs.get("next_link", None) class PaginatedStringList(msrest.serialization.Model): @@ -1908,15 +1845,12 @@ class PaginatedStringList(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[str]'}, - 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[str]"}, + "continuation_token": {"key": "continuationToken", "type": "str"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: An array of objects of type String. :paramtype value: list[str] @@ -1928,9 +1862,9 @@ def __init__( :paramtype next_link: str """ super(PaginatedStringList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.continuation_token = kwargs.get('continuation_token', None) - self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get("value", None) + self.continuation_token = kwargs.get("continuation_token", None) + self.next_link = kwargs.get("next_link", None) class ProfileActionResult(msrest.serialization.Model): @@ -1947,16 +1881,13 @@ class ProfileActionResult(msrest.serialization.Model): """ _attribute_map = { - 'profile_action_id': {'key': 'profileActionId', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'completed_on_utc': {'key': 'completedOnUtc', 'type': 'iso-8601'}, - 'action_result': {'key': 'actionResult', 'type': 'ActionResult'}, + "profile_action_id": {"key": "profileActionId", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "completed_on_utc": {"key": "completedOnUtc", "type": "iso-8601"}, + "action_result": {"key": "actionResult", "type": "ActionResult"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword profile_action_id: :paramtype profile_action_id: str @@ -1968,10 +1899,10 @@ def __init__( :paramtype action_result: ~azure.mgmt.machinelearningservices.models.ActionResult """ super(ProfileActionResult, self).__init__(**kwargs) - self.profile_action_id = kwargs.get('profile_action_id', None) - self.status = kwargs.get('status', None) - self.completed_on_utc = kwargs.get('completed_on_utc', None) - self.action_result = kwargs.get('action_result', None) + self.profile_action_id = kwargs.get("profile_action_id", None) + self.status = kwargs.get("status", None) + self.completed_on_utc = kwargs.get("completed_on_utc", None) + self.action_result = kwargs.get("action_result", None) class ProfileResult(msrest.serialization.Model): @@ -2023,33 +1954,33 @@ class ProfileResult(msrest.serialization.Model): """ _attribute_map = { - 'column_name': {'key': 'columnName', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'min': {'key': 'min', 'type': 'DataField'}, - 'max': {'key': 'max', 'type': 'DataField'}, - 'count': {'key': 'count', 'type': 'long'}, - 'missing_count': {'key': 'missingCount', 'type': 'long'}, - 'not_missing_count': {'key': 'notMissingCount', 'type': 'long'}, - 'percent_missing': {'key': 'percentMissing', 'type': 'float'}, - 'error_count': {'key': 'errorCount', 'type': 'long'}, - 'empty_count': {'key': 'emptyCount', 'type': 'long'}, - 'quantiles': {'key': 'quantiles', 'type': 'Quantiles'}, - 'whisker_top': {'key': 'whiskerTop', 'type': 'float'}, - 'whisker_bottom': {'key': 'whiskerBottom', 'type': 'float'}, - 'moments': {'key': 'moments', 'type': 'Moments'}, - 'type_counts': {'key': 'typeCounts', 'type': '[TypeCount]'}, - 'value_counts': {'key': 'valueCounts', 'type': '[ValueCount]'}, - 'unique_values': {'key': 'uniqueValues', 'type': 'long'}, - 'histogram': {'key': 'histogram', 'type': '[HistogramBin]'}, - 's_type_counts': {'key': 'sTypeCounts', 'type': '[STypeCount]'}, - 'average_spaces_count': {'key': 'averageSpacesCount', 'type': 'float'}, - 'string_lengths': {'key': 'stringLengths', 'type': '[StringLengthCount]'}, + "column_name": {"key": "columnName", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "min": {"key": "min", "type": "DataField"}, + "max": {"key": "max", "type": "DataField"}, + "count": {"key": "count", "type": "long"}, + "missing_count": {"key": "missingCount", "type": "long"}, + "not_missing_count": {"key": "notMissingCount", "type": "long"}, + "percent_missing": {"key": "percentMissing", "type": "float"}, + "error_count": {"key": "errorCount", "type": "long"}, + "empty_count": {"key": "emptyCount", "type": "long"}, + "quantiles": {"key": "quantiles", "type": "Quantiles"}, + "whisker_top": {"key": "whiskerTop", "type": "float"}, + "whisker_bottom": {"key": "whiskerBottom", "type": "float"}, + "moments": {"key": "moments", "type": "Moments"}, + "type_counts": {"key": "typeCounts", "type": "[TypeCount]"}, + "value_counts": {"key": "valueCounts", "type": "[ValueCount]"}, + "unique_values": {"key": "uniqueValues", "type": "long"}, + "histogram": {"key": "histogram", "type": "[HistogramBin]"}, + "s_type_counts": {"key": "sTypeCounts", "type": "[STypeCount]"}, + "average_spaces_count": {"key": "averageSpacesCount", "type": "float"}, + "string_lengths": { + "key": "stringLengths", + "type": "[StringLengthCount]", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword column_name: :paramtype column_name: str @@ -2096,27 +2027,27 @@ def __init__( :paramtype string_lengths: list[~azure.mgmt.machinelearningservices.models.StringLengthCount] """ super(ProfileResult, self).__init__(**kwargs) - self.column_name = kwargs.get('column_name', None) - self.type = kwargs.get('type', None) - self.min = kwargs.get('min', None) - self.max = kwargs.get('max', None) - self.count = kwargs.get('count', None) - self.missing_count = kwargs.get('missing_count', None) - self.not_missing_count = kwargs.get('not_missing_count', None) - self.percent_missing = kwargs.get('percent_missing', None) - self.error_count = kwargs.get('error_count', None) - self.empty_count = kwargs.get('empty_count', None) - self.quantiles = kwargs.get('quantiles', None) - self.whisker_top = kwargs.get('whisker_top', None) - self.whisker_bottom = kwargs.get('whisker_bottom', None) - self.moments = kwargs.get('moments', None) - self.type_counts = kwargs.get('type_counts', None) - self.value_counts = kwargs.get('value_counts', None) - self.unique_values = kwargs.get('unique_values', None) - self.histogram = kwargs.get('histogram', None) - self.s_type_counts = kwargs.get('s_type_counts', None) - self.average_spaces_count = kwargs.get('average_spaces_count', None) - self.string_lengths = kwargs.get('string_lengths', None) + self.column_name = kwargs.get("column_name", None) + self.type = kwargs.get("type", None) + self.min = kwargs.get("min", None) + self.max = kwargs.get("max", None) + self.count = kwargs.get("count", None) + self.missing_count = kwargs.get("missing_count", None) + self.not_missing_count = kwargs.get("not_missing_count", None) + self.percent_missing = kwargs.get("percent_missing", None) + self.error_count = kwargs.get("error_count", None) + self.empty_count = kwargs.get("empty_count", None) + self.quantiles = kwargs.get("quantiles", None) + self.whisker_top = kwargs.get("whisker_top", None) + self.whisker_bottom = kwargs.get("whisker_bottom", None) + self.moments = kwargs.get("moments", None) + self.type_counts = kwargs.get("type_counts", None) + self.value_counts = kwargs.get("value_counts", None) + self.unique_values = kwargs.get("unique_values", None) + self.histogram = kwargs.get("histogram", None) + self.s_type_counts = kwargs.get("s_type_counts", None) + self.average_spaces_count = kwargs.get("average_spaces_count", None) + self.string_lengths = kwargs.get("string_lengths", None) class Quantiles(msrest.serialization.Model): @@ -2143,21 +2074,18 @@ class Quantiles(msrest.serialization.Model): """ _attribute_map = { - 'p0_d1': {'key': 'p0D1', 'type': 'float'}, - 'p1': {'key': 'p1', 'type': 'float'}, - 'p5': {'key': 'p5', 'type': 'float'}, - 'p25': {'key': 'p25', 'type': 'float'}, - 'p50': {'key': 'p50', 'type': 'float'}, - 'p75': {'key': 'p75', 'type': 'float'}, - 'p95': {'key': 'p95', 'type': 'float'}, - 'p99': {'key': 'p99', 'type': 'float'}, - 'p99_d9': {'key': 'p99D9', 'type': 'float'}, + "p0_d1": {"key": "p0D1", "type": "float"}, + "p1": {"key": "p1", "type": "float"}, + "p5": {"key": "p5", "type": "float"}, + "p25": {"key": "p25", "type": "float"}, + "p50": {"key": "p50", "type": "float"}, + "p75": {"key": "p75", "type": "float"}, + "p95": {"key": "p95", "type": "float"}, + "p99": {"key": "p99", "type": "float"}, + "p99_d9": {"key": "p99D9", "type": "float"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword p0_d1: :paramtype p0_d1: float @@ -2179,15 +2107,15 @@ def __init__( :paramtype p99_d9: float """ super(Quantiles, self).__init__(**kwargs) - self.p0_d1 = kwargs.get('p0_d1', None) - self.p1 = kwargs.get('p1', None) - self.p5 = kwargs.get('p5', None) - self.p25 = kwargs.get('p25', None) - self.p50 = kwargs.get('p50', None) - self.p75 = kwargs.get('p75', None) - self.p95 = kwargs.get('p95', None) - self.p99 = kwargs.get('p99', None) - self.p99_d9 = kwargs.get('p99_d9', None) + self.p0_d1 = kwargs.get("p0_d1", None) + self.p1 = kwargs.get("p1", None) + self.p5 = kwargs.get("p5", None) + self.p25 = kwargs.get("p25", None) + self.p50 = kwargs.get("p50", None) + self.p75 = kwargs.get("p75", None) + self.p95 = kwargs.get("p95", None) + self.p99 = kwargs.get("p99", None) + self.p99_d9 = kwargs.get("p99_d9", None) class RegisterExistingData(msrest.serialization.Model): @@ -2204,20 +2132,20 @@ class RegisterExistingData(msrest.serialization.Model): """ _validation = { - 'existing_unregistered_asset_id': {'required': True}, - 'name': {'required': True}, + "existing_unregistered_asset_id": {"required": True}, + "name": {"required": True}, } _attribute_map = { - 'existing_unregistered_asset_id': {'key': 'existingUnregisteredAssetId', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, + "existing_unregistered_asset_id": { + "key": "existingUnregisteredAssetId", + "type": "str", + }, + "name": {"key": "name", "type": "str"}, + "version": {"key": "version", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword existing_unregistered_asset_id: Required. :paramtype existing_unregistered_asset_id: str @@ -2227,9 +2155,11 @@ def __init__( :paramtype version: str """ super(RegisterExistingData, self).__init__(**kwargs) - self.existing_unregistered_asset_id = kwargs['existing_unregistered_asset_id'] - self.name = kwargs['name'] - self.version = kwargs.get('version', None) + self.existing_unregistered_asset_id = kwargs[ + "existing_unregistered_asset_id" + ] + self.name = kwargs["name"] + self.version = kwargs.get("version", None) class RootError(msrest.serialization.Model): @@ -2263,23 +2193,23 @@ class RootError(msrest.serialization.Model): """ _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'severity': {'key': 'severity', 'type': 'int'}, - 'message': {'key': 'message', 'type': 'str'}, - 'message_format': {'key': 'messageFormat', 'type': 'str'}, - 'message_parameters': {'key': 'messageParameters', 'type': '{str}'}, - 'reference_code': {'key': 'referenceCode', 'type': 'str'}, - 'details_uri': {'key': 'detailsUri', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[RootError]'}, - 'inner_error': {'key': 'innerError', 'type': 'InnerErrorResponse'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + "code": {"key": "code", "type": "str"}, + "severity": {"key": "severity", "type": "int"}, + "message": {"key": "message", "type": "str"}, + "message_format": {"key": "messageFormat", "type": "str"}, + "message_parameters": {"key": "messageParameters", "type": "{str}"}, + "reference_code": {"key": "referenceCode", "type": "str"}, + "details_uri": {"key": "detailsUri", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[RootError]"}, + "inner_error": {"key": "innerError", "type": "InnerErrorResponse"}, + "additional_info": { + "key": "additionalInfo", + "type": "[ErrorAdditionalInfo]", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword code: The service-defined error code. Supported error codes: ServiceError, UserError, ValidationError, AzureStorageError, TransientError, RequestThrottled. @@ -2310,17 +2240,17 @@ def __init__( list[~azure.mgmt.machinelearningservices.models.ErrorAdditionalInfo] """ super(RootError, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.severity = kwargs.get('severity', None) - self.message = kwargs.get('message', None) - self.message_format = kwargs.get('message_format', None) - self.message_parameters = kwargs.get('message_parameters', None) - self.reference_code = kwargs.get('reference_code', None) - self.details_uri = kwargs.get('details_uri', None) - self.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - self.inner_error = kwargs.get('inner_error', None) - self.additional_info = kwargs.get('additional_info', None) + self.code = kwargs.get("code", None) + self.severity = kwargs.get("severity", None) + self.message = kwargs.get("message", None) + self.message_format = kwargs.get("message_format", None) + self.message_parameters = kwargs.get("message_parameters", None) + self.reference_code = kwargs.get("reference_code", None) + self.details_uri = kwargs.get("details_uri", None) + self.target = kwargs.get("target", None) + self.details = kwargs.get("details", None) + self.inner_error = kwargs.get("inner_error", None) + self.additional_info = kwargs.get("additional_info", None) class SqlDataPath(msrest.serialization.Model): @@ -2340,17 +2270,20 @@ class SqlDataPath(msrest.serialization.Model): """ _attribute_map = { - 'sql_table_name': {'key': 'sqlTableName', 'type': 'str'}, - 'sql_query': {'key': 'sqlQuery', 'type': 'str'}, - 'sql_stored_procedure_name': {'key': 'sqlStoredProcedureName', 'type': 'str'}, - 'sql_stored_procedure_params': {'key': 'sqlStoredProcedureParams', 'type': '[StoredProcedureParameter]'}, - 'query_timeout': {'key': 'queryTimeout', 'type': 'long'}, + "sql_table_name": {"key": "sqlTableName", "type": "str"}, + "sql_query": {"key": "sqlQuery", "type": "str"}, + "sql_stored_procedure_name": { + "key": "sqlStoredProcedureName", + "type": "str", + }, + "sql_stored_procedure_params": { + "key": "sqlStoredProcedureParams", + "type": "[StoredProcedureParameter]", + }, + "query_timeout": {"key": "queryTimeout", "type": "long"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword sql_table_name: :paramtype sql_table_name: str @@ -2365,11 +2298,15 @@ def __init__( :paramtype query_timeout: long """ super(SqlDataPath, self).__init__(**kwargs) - self.sql_table_name = kwargs.get('sql_table_name', None) - self.sql_query = kwargs.get('sql_query', None) - self.sql_stored_procedure_name = kwargs.get('sql_stored_procedure_name', None) - self.sql_stored_procedure_params = kwargs.get('sql_stored_procedure_params', None) - self.query_timeout = kwargs.get('query_timeout', None) + self.sql_table_name = kwargs.get("sql_table_name", None) + self.sql_query = kwargs.get("sql_query", None) + self.sql_stored_procedure_name = kwargs.get( + "sql_stored_procedure_name", None + ) + self.sql_stored_procedure_params = kwargs.get( + "sql_stored_procedure_params", None + ) + self.query_timeout = kwargs.get("query_timeout", None) class StoredProcedureParameter(msrest.serialization.Model): @@ -2384,15 +2321,12 @@ class StoredProcedureParameter(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "type": {"key": "type", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: :paramtype name: str @@ -2402,9 +2336,9 @@ def __init__( :paramtype type: str or ~azure.mgmt.machinelearningservices.models.StoredProcedureParameterType """ super(StoredProcedureParameter, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.value = kwargs.get('value', None) - self.type = kwargs.get('type', None) + self.name = kwargs.get("name", None) + self.value = kwargs.get("value", None) + self.type = kwargs.get("type", None) class StringLengthCount(msrest.serialization.Model): @@ -2417,14 +2351,11 @@ class StringLengthCount(msrest.serialization.Model): """ _attribute_map = { - 'length': {'key': 'length', 'type': 'long'}, - 'count': {'key': 'count', 'type': 'long'}, + "length": {"key": "length", "type": "long"}, + "count": {"key": "count", "type": "long"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword length: :paramtype length: long @@ -2432,8 +2363,8 @@ def __init__( :paramtype count: long """ super(StringLengthCount, self).__init__(**kwargs) - self.length = kwargs.get('length', None) - self.count = kwargs.get('count', None) + self.length = kwargs.get("length", None) + self.count = kwargs.get("count", None) class STypeCount(msrest.serialization.Model): @@ -2447,14 +2378,11 @@ class STypeCount(msrest.serialization.Model): """ _attribute_map = { - 's_type': {'key': 'sType', 'type': 'str'}, - 'count': {'key': 'count', 'type': 'long'}, + "s_type": {"key": "sType", "type": "str"}, + "count": {"key": "count", "type": "long"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword s_type: Possible values include: "EmailAddress", "GeographicCoordinate", "Ipv4Address", "Ipv6Address", "UsPhoneNumber", "ZipCode". @@ -2463,8 +2391,8 @@ def __init__( :paramtype count: long """ super(STypeCount, self).__init__(**kwargs) - self.s_type = kwargs.get('s_type', None) - self.count = kwargs.get('count', None) + self.s_type = kwargs.get("s_type", None) + self.count = kwargs.get("count", None) class TypeCount(msrest.serialization.Model): @@ -2478,14 +2406,11 @@ class TypeCount(msrest.serialization.Model): """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'count': {'key': 'count', 'type': 'long'}, + "type": {"key": "type", "type": "str"}, + "count": {"key": "count", "type": "long"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword type: Possible values include: "String", "Boolean", "Integer", "Decimal", "Date", "Unknown", "Error", "Null", "DataRow", "List", "Stream". @@ -2494,8 +2419,8 @@ def __init__( :paramtype count: long """ super(TypeCount, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.count = kwargs.get('count', None) + self.type = kwargs.get("type", None) + self.count = kwargs.get("count", None) class User(msrest.serialization.Model): @@ -2528,20 +2453,17 @@ class User(msrest.serialization.Model): """ _attribute_map = { - 'user_object_id': {'key': 'userObjectId', 'type': 'str'}, - 'user_pu_id': {'key': 'userPuId', 'type': 'str'}, - 'user_idp': {'key': 'userIdp', 'type': 'str'}, - 'user_alt_sec_id': {'key': 'userAltSecId', 'type': 'str'}, - 'user_iss': {'key': 'userIss', 'type': 'str'}, - 'user_tenant_id': {'key': 'userTenantId', 'type': 'str'}, - 'user_name': {'key': 'userName', 'type': 'str'}, - 'upn': {'key': 'upn', 'type': 'str'}, + "user_object_id": {"key": "userObjectId", "type": "str"}, + "user_pu_id": {"key": "userPuId", "type": "str"}, + "user_idp": {"key": "userIdp", "type": "str"}, + "user_alt_sec_id": {"key": "userAltSecId", "type": "str"}, + "user_iss": {"key": "userIss", "type": "str"}, + "user_tenant_id": {"key": "userTenantId", "type": "str"}, + "user_name": {"key": "userName", "type": "str"}, + "upn": {"key": "upn", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword user_object_id: A user or service principal's object ID. This is EUPI and may only be logged to warm path telemetry. @@ -2569,14 +2491,14 @@ def __init__( :paramtype upn: str """ super(User, self).__init__(**kwargs) - self.user_object_id = kwargs.get('user_object_id', None) - self.user_pu_id = kwargs.get('user_pu_id', None) - self.user_idp = kwargs.get('user_idp', None) - self.user_alt_sec_id = kwargs.get('user_alt_sec_id', None) - self.user_iss = kwargs.get('user_iss', None) - self.user_tenant_id = kwargs.get('user_tenant_id', None) - self.user_name = kwargs.get('user_name', None) - self.upn = kwargs.get('upn', None) + self.user_object_id = kwargs.get("user_object_id", None) + self.user_pu_id = kwargs.get("user_pu_id", None) + self.user_idp = kwargs.get("user_idp", None) + self.user_alt_sec_id = kwargs.get("user_alt_sec_id", None) + self.user_iss = kwargs.get("user_iss", None) + self.user_tenant_id = kwargs.get("user_tenant_id", None) + self.user_name = kwargs.get("user_name", None) + self.upn = kwargs.get("upn", None) class ValueCount(msrest.serialization.Model): @@ -2589,14 +2511,11 @@ class ValueCount(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': 'DataField'}, - 'count': {'key': 'count', 'type': 'long'}, + "value": {"key": "value", "type": "DataField"}, + "count": {"key": "count", "type": "long"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: :paramtype value: ~azure.mgmt.machinelearningservices.models.DataField @@ -2604,5 +2523,5 @@ def __init__( :paramtype count: long """ super(ValueCount, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.count = kwargs.get('count', None) + self.value = kwargs.get("value", None) + self.count = kwargs.get("count", None) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/models/_models_py3.py index 159fd205ef99..88e40086e7a9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/models/_models_py3.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/models/_models_py3.py @@ -35,13 +35,13 @@ class ActionResult(msrest.serialization.Model): """ _attribute_map = { - 'is_up_to_date': {'key': 'isUpToDate', 'type': 'bool'}, - 'is_up_to_date_error': {'key': 'isUpToDateError', 'type': 'str'}, - 'result_artifact_ids': {'key': 'resultArtifactIds', 'type': '[str]'}, - 'in_progress_action_id': {'key': 'inProgressActionId', 'type': 'str'}, - 'run_id': {'key': 'runId', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'datastore_name': {'key': 'datastoreName', 'type': 'str'}, + "is_up_to_date": {"key": "isUpToDate", "type": "bool"}, + "is_up_to_date_error": {"key": "isUpToDateError", "type": "str"}, + "result_artifact_ids": {"key": "resultArtifactIds", "type": "[str]"}, + "in_progress_action_id": {"key": "inProgressActionId", "type": "str"}, + "run_id": {"key": "runId", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "datastore_name": {"key": "datastoreName", "type": "str"}, } def __init__( @@ -92,19 +92,14 @@ class AssetId(msrest.serialization.Model): """ _validation = { - 'value': {'required': True}, + "value": {"required": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, + "value": {"key": "value", "type": "str"}, } - def __init__( - self, - *, - value: str, - **kwargs - ): + def __init__(self, *, value: str, **kwargs): """ :keyword value: Required. :paramtype value: str @@ -121,7 +116,7 @@ class BatchDataUriResponse(msrest.serialization.Model): """ _attribute_map = { - 'values': {'key': 'values', 'type': '{DataUriV2Response}'}, + "values": {"key": "values", "type": "{DataUriV2Response}"}, } def __init__( @@ -148,19 +143,14 @@ class BatchGetResolvedURIs(msrest.serialization.Model): """ _validation = { - 'values': {'required': True}, + "values": {"required": True}, } _attribute_map = { - 'values': {'key': 'values', 'type': '[str]'}, + "values": {"key": "values", "type": "[str]"}, } - def __init__( - self, - *, - values: List[str], - **kwargs - ): + def __init__(self, *, values: List[str], **kwargs): """ :keyword values: Required. :paramtype values: list[str] @@ -180,8 +170,8 @@ class ColumnDefinition(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "type": {"key": "type", "type": "str"}, } def __init__( @@ -219,27 +209,21 @@ class CreateUnregisteredInputData(msrest.serialization.Model): """ _validation = { - 'run_id': {'required': True}, - 'input_name': {'required': True}, - 'uri': {'required': True}, - 'type': {'required': True}, + "run_id": {"required": True}, + "input_name": {"required": True}, + "uri": {"required": True}, + "type": {"required": True}, } _attribute_map = { - 'run_id': {'key': 'runId', 'type': 'str'}, - 'input_name': {'key': 'inputName', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + "run_id": {"key": "runId", "type": "str"}, + "input_name": {"key": "inputName", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "type": {"key": "type", "type": "str"}, } def __init__( - self, - *, - run_id: str, - input_name: str, - uri: str, - type: str, - **kwargs + self, *, run_id: str, input_name: str, uri: str, type: str, **kwargs ): """ :keyword run_id: Required. @@ -274,27 +258,21 @@ class CreateUnregisteredOutputData(msrest.serialization.Model): """ _validation = { - 'run_id': {'required': True}, - 'output_name': {'required': True}, - 'uri': {'required': True}, - 'type': {'required': True}, + "run_id": {"required": True}, + "output_name": {"required": True}, + "uri": {"required": True}, + "type": {"required": True}, } _attribute_map = { - 'run_id': {'key': 'runId', 'type': 'str'}, - 'output_name': {'key': 'outputName', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + "run_id": {"key": "runId", "type": "str"}, + "output_name": {"key": "outputName", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "type": {"key": "type", "type": "str"}, } def __init__( - self, - *, - run_id: str, - output_name: str, - uri: str, - type: str, - **kwargs + self, *, run_id: str, output_name: str, uri: str, type: str, **kwargs ): """ :keyword run_id: Required. @@ -329,11 +307,11 @@ class DataCallRequest(msrest.serialization.Model): """ _attribute_map = { - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'asset_id': {'key': 'assetId', 'type': 'str'}, - 'data_container_name': {'key': 'dataContainerName', 'type': 'str'}, - 'version_id': {'key': 'versionId', 'type': 'str'}, + "data_uri": {"key": "dataUri", "type": "str"}, + "data_type": {"key": "dataType", "type": "str"}, + "asset_id": {"key": "assetId", "type": "str"}, + "data_container_name": {"key": "dataContainerName", "type": "str"}, + "version_id": {"key": "versionId", "type": "str"}, } def __init__( @@ -382,15 +360,18 @@ class DataContainer(msrest.serialization.Model): """ _validation = { - 'name': {'required': True}, - 'data_type': {'required': True}, + "name": {"required": True}, + "data_type": {"required": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'mutable_props': {'key': 'mutableProps', 'type': 'DataContainerMutable'}, - 'is_registered': {'key': 'isRegistered', 'type': 'bool'}, + "name": {"key": "name", "type": "str"}, + "data_type": {"key": "dataType", "type": "str"}, + "mutable_props": { + "key": "mutableProps", + "type": "DataContainerMutable", + }, + "is_registered": {"key": "isRegistered", "type": "bool"}, } def __init__( @@ -435,11 +416,14 @@ class DataContainerEntity(msrest.serialization.Model): """ _attribute_map = { - 'data_container': {'key': 'dataContainer', 'type': 'DataContainer'}, - 'entity_metadata': {'key': 'entityMetadata', 'type': 'EntityMetadata'}, - 'latest_version': {'key': 'latestVersion', 'type': 'DataVersionEntity'}, - 'next_version_id': {'key': 'nextVersionId', 'type': 'str'}, - 'legacy_dataset_type': {'key': 'legacyDatasetType', 'type': 'str'}, + "data_container": {"key": "dataContainer", "type": "DataContainer"}, + "entity_metadata": {"key": "entityMetadata", "type": "EntityMetadata"}, + "latest_version": { + "key": "latestVersion", + "type": "DataVersionEntity", + }, + "next_version_id": {"key": "nextVersionId", "type": "str"}, + "legacy_dataset_type": {"key": "legacyDatasetType", "type": "str"}, } def __init__( @@ -484,9 +468,9 @@ class DataContainerMutable(msrest.serialization.Model): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, + "description": {"key": "description", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, } def __init__( @@ -522,8 +506,8 @@ class DataField(msrest.serialization.Model): """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'object'}, + "type": {"key": "type", "type": "str"}, + "value": {"key": "value", "type": "object"}, } def __init__( @@ -577,19 +561,19 @@ class Dataset(msrest.serialization.Model): """ _attribute_map = { - 'dataset_id': {'key': 'datasetId', 'type': 'str'}, - 'dataset_state': {'key': 'datasetState', 'type': 'DatasetState'}, - 'latest': {'key': 'latest', 'type': 'DatasetDefinition'}, - 'next_version_id': {'key': 'nextVersionId', 'type': 'str'}, - 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, - 'modified_time': {'key': 'modifiedTime', 'type': 'iso-8601'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_visible': {'key': 'isVisible', 'type': 'bool'}, - 'default_compute': {'key': 'defaultCompute', 'type': 'str'}, - 'dataset_type': {'key': 'datasetType', 'type': 'str'}, + "dataset_id": {"key": "datasetId", "type": "str"}, + "dataset_state": {"key": "datasetState", "type": "DatasetState"}, + "latest": {"key": "latest", "type": "DatasetDefinition"}, + "next_version_id": {"key": "nextVersionId", "type": "str"}, + "created_time": {"key": "createdTime", "type": "iso-8601"}, + "modified_time": {"key": "modifiedTime", "type": "iso-8601"}, + "etag": {"key": "etag", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_visible": {"key": "isVisible", "type": "bool"}, + "default_compute": {"key": "defaultCompute", "type": "str"}, + "dataset_type": {"key": "datasetType", "type": "str"}, } def __init__( @@ -704,28 +688,40 @@ class DatasetDefinition(msrest.serialization.Model): """ _attribute_map = { - 'dataset_id': {'key': 'datasetId', 'type': 'str'}, - 'version_id': {'key': 'versionId', 'type': 'str'}, - 'dataset_definition_state': {'key': 'datasetDefinitionState', 'type': 'DatasetState'}, - 'dataflow': {'key': 'dataflow', 'type': 'str'}, - 'dataflow_type': {'key': 'dataflowType', 'type': 'str'}, - 'data_path': {'key': 'dataPath', 'type': 'DatasetPath'}, - 'partition_format_in_path': {'key': 'partitionFormatInPath', 'type': 'str'}, - 'profile_action_result': {'key': 'profileActionResult', 'type': 'ProfileActionResult'}, - 'notes': {'key': 'notes', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, - 'modified_time': {'key': 'modifiedTime', 'type': 'iso-8601'}, - 'data_expiry_time': {'key': 'dataExpiryTime', 'type': 'iso-8601'}, - 'created_by': {'key': 'createdBy', 'type': 'User'}, - 'modified_by': {'key': 'modifiedBy', 'type': 'User'}, - 'file_type': {'key': 'fileType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - 'saved_dataset_id': {'key': 'savedDatasetId', 'type': 'str'}, - 'telemetry_info': {'key': 'telemetryInfo', 'type': '{str}'}, - 'use_description_tags_from_definition': {'key': 'useDescriptionTagsFromDefinition', 'type': 'bool'}, - 'description': {'key': 'description', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "dataset_id": {"key": "datasetId", "type": "str"}, + "version_id": {"key": "versionId", "type": "str"}, + "dataset_definition_state": { + "key": "datasetDefinitionState", + "type": "DatasetState", + }, + "dataflow": {"key": "dataflow", "type": "str"}, + "dataflow_type": {"key": "dataflowType", "type": "str"}, + "data_path": {"key": "dataPath", "type": "DatasetPath"}, + "partition_format_in_path": { + "key": "partitionFormatInPath", + "type": "str", + }, + "profile_action_result": { + "key": "profileActionResult", + "type": "ProfileActionResult", + }, + "notes": {"key": "notes", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "created_time": {"key": "createdTime", "type": "iso-8601"}, + "modified_time": {"key": "modifiedTime", "type": "iso-8601"}, + "data_expiry_time": {"key": "dataExpiryTime", "type": "iso-8601"}, + "created_by": {"key": "createdBy", "type": "User"}, + "modified_by": {"key": "modifiedBy", "type": "User"}, + "file_type": {"key": "fileType", "type": "str"}, + "properties": {"key": "properties", "type": "{object}"}, + "saved_dataset_id": {"key": "savedDatasetId", "type": "str"}, + "telemetry_info": {"key": "telemetryInfo", "type": "{str}"}, + "use_description_tags_from_definition": { + "key": "useDescriptionTagsFromDefinition", + "type": "bool", + }, + "description": {"key": "description", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, } def __init__( @@ -822,7 +818,9 @@ def __init__( self.properties = properties self.saved_dataset_id = saved_dataset_id self.telemetry_info = telemetry_info - self.use_description_tags_from_definition = use_description_tags_from_definition + self.use_description_tags_from_definition = ( + use_description_tags_from_definition + ) self.description = description self.tags = tags @@ -837,8 +835,8 @@ class DatasetDefinitionReference(msrest.serialization.Model): """ _attribute_map = { - 'dataset_id': {'key': 'datasetId', 'type': 'str'}, - 'definition_version': {'key': 'definitionVersion', 'type': 'str'}, + "dataset_id": {"key": "datasetId", "type": "str"}, + "definition_version": {"key": "definitionVersion", "type": "str"}, } def __init__( @@ -883,15 +881,21 @@ class DatasetPath(msrest.serialization.Model): """ _attribute_map = { - 'datastore_name': {'key': 'datastoreName', 'type': 'str'}, - 'relative_path': {'key': 'relativePath', 'type': 'str'}, - 'azure_file_path': {'key': 'azureFilePath', 'type': 'str'}, - 'paths': {'key': 'paths', 'type': '[str]'}, - 'sql_data_path': {'key': 'sqlDataPath', 'type': 'SqlDataPath'}, - 'http_url': {'key': 'httpUrl', 'type': 'str'}, - 'additional_properties': {'key': 'additionalProperties', 'type': '{object}'}, - 'partition_format': {'key': 'partitionFormat', 'type': 'str'}, - 'partition_format_ignore_error': {'key': 'partitionFormatIgnoreError', 'type': 'bool'}, + "datastore_name": {"key": "datastoreName", "type": "str"}, + "relative_path": {"key": "relativePath", "type": "str"}, + "azure_file_path": {"key": "azureFilePath", "type": "str"}, + "paths": {"key": "paths", "type": "[str]"}, + "sql_data_path": {"key": "sqlDataPath", "type": "SqlDataPath"}, + "http_url": {"key": "httpUrl", "type": "str"}, + "additional_properties": { + "key": "additionalProperties", + "type": "{object}", + }, + "partition_format": {"key": "partitionFormat", "type": "str"}, + "partition_format_ignore_error": { + "key": "partitionFormatIgnoreError", + "type": "bool", + }, } def __init__( @@ -952,9 +956,12 @@ class DatasetState(msrest.serialization.Model): """ _attribute_map = { - 'state': {'key': 'state', 'type': 'str'}, - 'deprecated_by': {'key': 'deprecatedBy', 'type': 'DatasetDefinitionReference'}, - 'etag': {'key': 'etag', 'type': 'str'}, + "state": {"key": "state", "type": "str"}, + "deprecated_by": { + "key": "deprecatedBy", + "type": "DatasetDefinitionReference", + }, + "etag": {"key": "etag", "type": "str"}, } def __init__( @@ -1017,22 +1024,22 @@ class DatasetV2(msrest.serialization.Model): """ _attribute_map = { - 'dataset_id': {'key': 'datasetId', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'version_id': {'key': 'versionId', 'type': 'str'}, - 'dataflow': {'key': 'dataflow', 'type': 'str'}, - 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, - 'modified_time': {'key': 'modifiedTime', 'type': 'iso-8601'}, - 'created_by': {'key': 'createdBy', 'type': 'User'}, - 'modified_by': {'key': 'modifiedBy', 'type': 'User'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'telemetry_info': {'key': 'telemetryInfo', 'type': '{str}'}, - 'description': {'key': 'description', 'type': 'str'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'legacy_properties': {'key': 'legacyProperties', 'type': '{object}'}, - 'data_expiry_time': {'key': 'dataExpiryTime', 'type': 'iso-8601'}, - 'legacy': {'key': 'legacy', 'type': '{object}'}, + "dataset_id": {"key": "datasetId", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "version_id": {"key": "versionId", "type": "str"}, + "dataflow": {"key": "dataflow", "type": "str"}, + "created_time": {"key": "createdTime", "type": "iso-8601"}, + "modified_time": {"key": "modifiedTime", "type": "iso-8601"}, + "created_by": {"key": "createdBy", "type": "User"}, + "modified_by": {"key": "modifiedBy", "type": "User"}, + "properties": {"key": "properties", "type": "{str}"}, + "telemetry_info": {"key": "telemetryInfo", "type": "{str}"}, + "description": {"key": "description", "type": "str"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "tags": {"key": "tags", "type": "{str}"}, + "legacy_properties": {"key": "legacyProperties", "type": "{object}"}, + "data_expiry_time": {"key": "dataExpiryTime", "type": "iso-8601"}, + "legacy": {"key": "legacy", "type": "{object}"}, } def __init__( @@ -1119,8 +1126,8 @@ class DataUriV2Response(msrest.serialization.Model): """ _attribute_map = { - 'uri': {'key': 'uri', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + "uri": {"key": "uri", "type": "str"}, + "type": {"key": "type", "type": "str"}, } def __init__( @@ -1165,21 +1172,21 @@ class DataVersion(msrest.serialization.Model): """ _validation = { - 'data_container_name': {'required': True}, - 'data_type': {'required': True}, - 'data_uri': {'required': True}, - 'version_id': {'required': True}, + "data_container_name": {"required": True}, + "data_type": {"required": True}, + "data_uri": {"required": True}, + "version_id": {"required": True}, } _attribute_map = { - 'asset_id': {'key': 'assetId', 'type': 'str'}, - 'data_container_name': {'key': 'dataContainerName', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'version_id': {'key': 'versionId', 'type': 'str'}, - 'mutable_props': {'key': 'mutableProps', 'type': 'DataVersionMutable'}, - 'referenced_data_uris': {'key': 'referencedDataUris', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, + "asset_id": {"key": "assetId", "type": "str"}, + "data_container_name": {"key": "dataContainerName", "type": "str"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, + "version_id": {"key": "versionId", "type": "str"}, + "mutable_props": {"key": "mutableProps", "type": "DataVersionMutable"}, + "referenced_data_uris": {"key": "referencedDataUris", "type": "[str]"}, + "properties": {"key": "properties", "type": "{str}"}, } def __init__( @@ -1234,8 +1241,8 @@ class DataVersionEntity(msrest.serialization.Model): """ _attribute_map = { - 'data_version': {'key': 'dataVersion', 'type': 'DataVersion'}, - 'entity_metadata': {'key': 'entityMetadata', 'type': 'EntityMetadata'}, + "data_version": {"key": "dataVersion", "type": "DataVersion"}, + "entity_metadata": {"key": "entityMetadata", "type": "EntityMetadata"}, } def __init__( @@ -1270,10 +1277,10 @@ class DataVersionMutable(msrest.serialization.Model): """ _attribute_map = { - 'data_expiry_time': {'key': 'dataExpiryTime', 'type': 'iso-8601'}, - 'description': {'key': 'description', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, + "data_expiry_time": {"key": "dataExpiryTime", "type": "iso-8601"}, + "description": {"key": "description", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, } def __init__( @@ -1312,8 +1319,8 @@ class DataViewSetResult(msrest.serialization.Model): """ _attribute_map = { - 'schema': {'key': 'schema', 'type': '[ColumnDefinition]'}, - 'rows': {'key': 'rows', 'type': '[[DataField]]'}, + "schema": {"key": "schema", "type": "[ColumnDefinition]"}, + "rows": {"key": "rows", "type": "[[DataField]]"}, } def __init__( @@ -1350,11 +1357,11 @@ class EntityMetadata(msrest.serialization.Model): """ _attribute_map = { - 'etag': {'key': 'etag', 'type': 'str'}, - 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, - 'modified_time': {'key': 'modifiedTime', 'type': 'iso-8601'}, - 'created_by': {'key': 'createdBy', 'type': 'User'}, - 'modified_by': {'key': 'modifiedBy', 'type': 'User'}, + "etag": {"key": "etag", "type": "str"}, + "created_time": {"key": "createdTime", "type": "iso-8601"}, + "modified_time": {"key": "modifiedTime", "type": "iso-8601"}, + "created_by": {"key": "createdBy", "type": "User"}, + "modified_by": {"key": "modifiedBy", "type": "User"}, } def __init__( @@ -1397,8 +1404,8 @@ class ErrorAdditionalInfo(msrest.serialization.Model): """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, + "type": {"key": "type", "type": "str"}, + "info": {"key": "info", "type": "object"}, } def __init__( @@ -1437,12 +1444,12 @@ class ErrorResponse(msrest.serialization.Model): """ _attribute_map = { - 'error': {'key': 'error', 'type': 'RootError'}, - 'correlation': {'key': 'correlation', 'type': '{str}'}, - 'environment': {'key': 'environment', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'time': {'key': 'time', 'type': 'iso-8601'}, - 'component_name': {'key': 'componentName', 'type': 'str'}, + "error": {"key": "error", "type": "RootError"}, + "correlation": {"key": "correlation", "type": "{str}"}, + "environment": {"key": "environment", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "time": {"key": "time", "type": "iso-8601"}, + "component_name": {"key": "componentName", "type": "str"}, } def __init__( @@ -1491,9 +1498,9 @@ class HistogramBin(msrest.serialization.Model): """ _attribute_map = { - 'lower_bound': {'key': 'lowerBound', 'type': 'float'}, - 'upper_bound': {'key': 'upperBound', 'type': 'float'}, - 'count': {'key': 'count', 'type': 'float'}, + "lower_bound": {"key": "lowerBound", "type": "float"}, + "upper_bound": {"key": "upperBound", "type": "float"}, + "count": {"key": "count", "type": "float"}, } def __init__( @@ -1529,19 +1536,18 @@ class HttpContent(msrest.serialization.Model): """ _validation = { - 'headers': {'readonly': True}, + "headers": {"readonly": True}, } _attribute_map = { - 'headers': {'key': 'headers', 'type': '[KeyValuePairStringIEnumerable1]'}, + "headers": { + "key": "headers", + "type": "[KeyValuePairStringIEnumerable1]", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(HttpContent, self).__init__(**kwargs) self.headers = None @@ -1554,15 +1560,10 @@ class HttpMethod(msrest.serialization.Model): """ _attribute_map = { - 'method': {'key': 'method', 'type': 'str'}, + "method": {"key": "method", "type": "str"}, } - def __init__( - self, - *, - method: Optional[str] = None, - **kwargs - ): + def __init__(self, *, method: Optional[str] = None, **kwargs): """ :keyword method: :paramtype method: str @@ -1595,18 +1596,21 @@ class HttpRequestMessage(msrest.serialization.Model): """ _validation = { - 'headers': {'readonly': True}, - 'options': {'readonly': True}, + "headers": {"readonly": True}, + "options": {"readonly": True}, } _attribute_map = { - 'version': {'key': 'version', 'type': 'str'}, - 'version_policy': {'key': 'versionPolicy', 'type': 'str'}, - 'content': {'key': 'content', 'type': 'HttpContent'}, - 'method': {'key': 'method', 'type': 'HttpMethod'}, - 'request_uri': {'key': 'requestUri', 'type': 'str'}, - 'headers': {'key': 'headers', 'type': '[KeyValuePairStringIEnumerable1]'}, - 'options': {'key': 'options', 'type': '{object}'}, + "version": {"key": "version", "type": "str"}, + "version_policy": {"key": "versionPolicy", "type": "str"}, + "content": {"key": "content", "type": "HttpContent"}, + "method": {"key": "method", "type": "HttpMethod"}, + "request_uri": {"key": "requestUri", "type": "str"}, + "headers": { + "key": "headers", + "type": "[KeyValuePairStringIEnumerable1]", + }, + "options": {"key": "options", "type": "{object}"}, } def __init__( @@ -1681,20 +1685,32 @@ class HttpResponseMessage(msrest.serialization.Model): """ _validation = { - 'headers': {'readonly': True}, - 'trailing_headers': {'readonly': True}, - 'is_success_status_code': {'readonly': True}, + "headers": {"readonly": True}, + "trailing_headers": {"readonly": True}, + "is_success_status_code": {"readonly": True}, } _attribute_map = { - 'version': {'key': 'version', 'type': 'str'}, - 'content': {'key': 'content', 'type': 'HttpContent'}, - 'status_code': {'key': 'statusCode', 'type': 'str'}, - 'reason_phrase': {'key': 'reasonPhrase', 'type': 'str'}, - 'headers': {'key': 'headers', 'type': '[KeyValuePairStringIEnumerable1]'}, - 'trailing_headers': {'key': 'trailingHeaders', 'type': '[KeyValuePairStringIEnumerable1]'}, - 'request_message': {'key': 'requestMessage', 'type': 'HttpRequestMessage'}, - 'is_success_status_code': {'key': 'isSuccessStatusCode', 'type': 'bool'}, + "version": {"key": "version", "type": "str"}, + "content": {"key": "content", "type": "HttpContent"}, + "status_code": {"key": "statusCode", "type": "str"}, + "reason_phrase": {"key": "reasonPhrase", "type": "str"}, + "headers": { + "key": "headers", + "type": "[KeyValuePairStringIEnumerable1]", + }, + "trailing_headers": { + "key": "trailingHeaders", + "type": "[KeyValuePairStringIEnumerable1]", + }, + "request_message": { + "key": "requestMessage", + "type": "HttpRequestMessage", + }, + "is_success_status_code": { + "key": "isSuccessStatusCode", + "type": "bool", + }, } def __init__( @@ -1753,8 +1769,8 @@ class InnerErrorResponse(msrest.serialization.Model): """ _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'inner_error': {'key': 'innerError', 'type': 'InnerErrorResponse'}, + "code": {"key": "code", "type": "str"}, + "inner_error": {"key": "innerError", "type": "InnerErrorResponse"}, } def __init__( @@ -1785,8 +1801,8 @@ class KeyValuePairStringIEnumerable1(msrest.serialization.Model): """ _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[str]'}, + "key": {"key": "key", "type": "str"}, + "value": {"key": "value", "type": "[str]"}, } def __init__( @@ -1807,7 +1823,9 @@ def __init__( self.value = value -class LongRunningOperationResponse1LongRunningOperationResponseObject(msrest.serialization.Model): +class LongRunningOperationResponse1LongRunningOperationResponseObject( + msrest.serialization.Model +): """LongRunningOperationResponse1LongRunningOperationResponseObject. :ivar completion_result: Anything. @@ -1819,9 +1837,9 @@ class LongRunningOperationResponse1LongRunningOperationResponseObject(msrest.ser """ _attribute_map = { - 'completion_result': {'key': 'completionResult', 'type': 'object'}, - 'location': {'key': 'location', 'type': 'str'}, - 'operation_result': {'key': 'operationResult', 'type': 'str'}, + "completion_result": {"key": "completionResult", "type": "object"}, + "location": {"key": "location", "type": "str"}, + "operation_result": {"key": "operationResult", "type": "str"}, } def __init__( @@ -1840,7 +1858,10 @@ def __init__( :keyword operation_result: :paramtype operation_result: str """ - super(LongRunningOperationResponse1LongRunningOperationResponseObject, self).__init__(**kwargs) + super( + LongRunningOperationResponse1LongRunningOperationResponseObject, + self, + ).__init__(**kwargs) self.completion_result = completion_result self.location = location self.operation_result = operation_result @@ -1862,11 +1883,11 @@ class Moments(msrest.serialization.Model): """ _attribute_map = { - 'mean': {'key': 'mean', 'type': 'float'}, - 'standard_deviation': {'key': 'standardDeviation', 'type': 'float'}, - 'variance': {'key': 'variance', 'type': 'float'}, - 'skewness': {'key': 'skewness', 'type': 'float'}, - 'kurtosis': {'key': 'kurtosis', 'type': 'float'}, + "mean": {"key": "mean", "type": "float"}, + "standard_deviation": {"key": "standardDeviation", "type": "float"}, + "variance": {"key": "variance", "type": "float"}, + "skewness": {"key": "skewness", "type": "float"}, + "kurtosis": {"key": "kurtosis", "type": "float"}, } def __init__( @@ -1913,9 +1934,9 @@ class PaginatedDataContainerEntityList(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[DataContainerEntity]'}, - 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[DataContainerEntity]"}, + "continuation_token": {"key": "continuationToken", "type": "str"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( @@ -1956,9 +1977,9 @@ class PaginatedDatasetDefinitionList(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[DatasetDefinition]'}, - 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[DatasetDefinition]"}, + "continuation_token": {"key": "continuationToken", "type": "str"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( @@ -1999,9 +2020,9 @@ class PaginatedDatasetList(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[Dataset]'}, - 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Dataset]"}, + "continuation_token": {"key": "continuationToken", "type": "str"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( @@ -2042,9 +2063,9 @@ class PaginatedDatasetV2List(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[DatasetV2]'}, - 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[DatasetV2]"}, + "continuation_token": {"key": "continuationToken", "type": "str"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( @@ -2085,9 +2106,9 @@ class PaginatedDataVersionEntityList(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[DataVersionEntity]'}, - 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[DataVersionEntity]"}, + "continuation_token": {"key": "continuationToken", "type": "str"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( @@ -2128,9 +2149,9 @@ class PaginatedStringList(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[str]'}, - 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[str]"}, + "continuation_token": {"key": "continuationToken", "type": "str"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( @@ -2171,10 +2192,10 @@ class ProfileActionResult(msrest.serialization.Model): """ _attribute_map = { - 'profile_action_id': {'key': 'profileActionId', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'completed_on_utc': {'key': 'completedOnUtc', 'type': 'iso-8601'}, - 'action_result': {'key': 'actionResult', 'type': 'ActionResult'}, + "profile_action_id": {"key": "profileActionId", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "completed_on_utc": {"key": "completedOnUtc", "type": "iso-8601"}, + "action_result": {"key": "actionResult", "type": "ActionResult"}, } def __init__( @@ -2252,27 +2273,30 @@ class ProfileResult(msrest.serialization.Model): """ _attribute_map = { - 'column_name': {'key': 'columnName', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'min': {'key': 'min', 'type': 'DataField'}, - 'max': {'key': 'max', 'type': 'DataField'}, - 'count': {'key': 'count', 'type': 'long'}, - 'missing_count': {'key': 'missingCount', 'type': 'long'}, - 'not_missing_count': {'key': 'notMissingCount', 'type': 'long'}, - 'percent_missing': {'key': 'percentMissing', 'type': 'float'}, - 'error_count': {'key': 'errorCount', 'type': 'long'}, - 'empty_count': {'key': 'emptyCount', 'type': 'long'}, - 'quantiles': {'key': 'quantiles', 'type': 'Quantiles'}, - 'whisker_top': {'key': 'whiskerTop', 'type': 'float'}, - 'whisker_bottom': {'key': 'whiskerBottom', 'type': 'float'}, - 'moments': {'key': 'moments', 'type': 'Moments'}, - 'type_counts': {'key': 'typeCounts', 'type': '[TypeCount]'}, - 'value_counts': {'key': 'valueCounts', 'type': '[ValueCount]'}, - 'unique_values': {'key': 'uniqueValues', 'type': 'long'}, - 'histogram': {'key': 'histogram', 'type': '[HistogramBin]'}, - 's_type_counts': {'key': 'sTypeCounts', 'type': '[STypeCount]'}, - 'average_spaces_count': {'key': 'averageSpacesCount', 'type': 'float'}, - 'string_lengths': {'key': 'stringLengths', 'type': '[StringLengthCount]'}, + "column_name": {"key": "columnName", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "min": {"key": "min", "type": "DataField"}, + "max": {"key": "max", "type": "DataField"}, + "count": {"key": "count", "type": "long"}, + "missing_count": {"key": "missingCount", "type": "long"}, + "not_missing_count": {"key": "notMissingCount", "type": "long"}, + "percent_missing": {"key": "percentMissing", "type": "float"}, + "error_count": {"key": "errorCount", "type": "long"}, + "empty_count": {"key": "emptyCount", "type": "long"}, + "quantiles": {"key": "quantiles", "type": "Quantiles"}, + "whisker_top": {"key": "whiskerTop", "type": "float"}, + "whisker_bottom": {"key": "whiskerBottom", "type": "float"}, + "moments": {"key": "moments", "type": "Moments"}, + "type_counts": {"key": "typeCounts", "type": "[TypeCount]"}, + "value_counts": {"key": "valueCounts", "type": "[ValueCount]"}, + "unique_values": {"key": "uniqueValues", "type": "long"}, + "histogram": {"key": "histogram", "type": "[HistogramBin]"}, + "s_type_counts": {"key": "sTypeCounts", "type": "[STypeCount]"}, + "average_spaces_count": {"key": "averageSpacesCount", "type": "float"}, + "string_lengths": { + "key": "stringLengths", + "type": "[StringLengthCount]", + }, } def __init__( @@ -2394,15 +2418,15 @@ class Quantiles(msrest.serialization.Model): """ _attribute_map = { - 'p0_d1': {'key': 'p0D1', 'type': 'float'}, - 'p1': {'key': 'p1', 'type': 'float'}, - 'p5': {'key': 'p5', 'type': 'float'}, - 'p25': {'key': 'p25', 'type': 'float'}, - 'p50': {'key': 'p50', 'type': 'float'}, - 'p75': {'key': 'p75', 'type': 'float'}, - 'p95': {'key': 'p95', 'type': 'float'}, - 'p99': {'key': 'p99', 'type': 'float'}, - 'p99_d9': {'key': 'p99D9', 'type': 'float'}, + "p0_d1": {"key": "p0D1", "type": "float"}, + "p1": {"key": "p1", "type": "float"}, + "p5": {"key": "p5", "type": "float"}, + "p25": {"key": "p25", "type": "float"}, + "p50": {"key": "p50", "type": "float"}, + "p75": {"key": "p75", "type": "float"}, + "p95": {"key": "p95", "type": "float"}, + "p99": {"key": "p99", "type": "float"}, + "p99_d9": {"key": "p99D9", "type": "float"}, } def __init__( @@ -2465,14 +2489,17 @@ class RegisterExistingData(msrest.serialization.Model): """ _validation = { - 'existing_unregistered_asset_id': {'required': True}, - 'name': {'required': True}, + "existing_unregistered_asset_id": {"required": True}, + "name": {"required": True}, } _attribute_map = { - 'existing_unregistered_asset_id': {'key': 'existingUnregisteredAssetId', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, + "existing_unregistered_asset_id": { + "key": "existingUnregisteredAssetId", + "type": "str", + }, + "name": {"key": "name", "type": "str"}, + "version": {"key": "version", "type": "str"}, } def __init__( @@ -2528,17 +2555,20 @@ class RootError(msrest.serialization.Model): """ _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'severity': {'key': 'severity', 'type': 'int'}, - 'message': {'key': 'message', 'type': 'str'}, - 'message_format': {'key': 'messageFormat', 'type': 'str'}, - 'message_parameters': {'key': 'messageParameters', 'type': '{str}'}, - 'reference_code': {'key': 'referenceCode', 'type': 'str'}, - 'details_uri': {'key': 'detailsUri', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[RootError]'}, - 'inner_error': {'key': 'innerError', 'type': 'InnerErrorResponse'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + "code": {"key": "code", "type": "str"}, + "severity": {"key": "severity", "type": "int"}, + "message": {"key": "message", "type": "str"}, + "message_format": {"key": "messageFormat", "type": "str"}, + "message_parameters": {"key": "messageParameters", "type": "{str}"}, + "reference_code": {"key": "referenceCode", "type": "str"}, + "details_uri": {"key": "detailsUri", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[RootError]"}, + "inner_error": {"key": "innerError", "type": "InnerErrorResponse"}, + "additional_info": { + "key": "additionalInfo", + "type": "[ErrorAdditionalInfo]", + }, } def __init__( @@ -2617,11 +2647,17 @@ class SqlDataPath(msrest.serialization.Model): """ _attribute_map = { - 'sql_table_name': {'key': 'sqlTableName', 'type': 'str'}, - 'sql_query': {'key': 'sqlQuery', 'type': 'str'}, - 'sql_stored_procedure_name': {'key': 'sqlStoredProcedureName', 'type': 'str'}, - 'sql_stored_procedure_params': {'key': 'sqlStoredProcedureParams', 'type': '[StoredProcedureParameter]'}, - 'query_timeout': {'key': 'queryTimeout', 'type': 'long'}, + "sql_table_name": {"key": "sqlTableName", "type": "str"}, + "sql_query": {"key": "sqlQuery", "type": "str"}, + "sql_stored_procedure_name": { + "key": "sqlStoredProcedureName", + "type": "str", + }, + "sql_stored_procedure_params": { + "key": "sqlStoredProcedureParams", + "type": "[StoredProcedureParameter]", + }, + "query_timeout": {"key": "queryTimeout", "type": "long"}, } def __init__( @@ -2630,7 +2666,9 @@ def __init__( sql_table_name: Optional[str] = None, sql_query: Optional[str] = None, sql_stored_procedure_name: Optional[str] = None, - sql_stored_procedure_params: Optional[List["StoredProcedureParameter"]] = None, + sql_stored_procedure_params: Optional[ + List["StoredProcedureParameter"] + ] = None, query_timeout: Optional[int] = None, **kwargs ): @@ -2667,9 +2705,9 @@ class StoredProcedureParameter(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "type": {"key": "type", "type": "str"}, } def __init__( @@ -2704,8 +2742,8 @@ class StringLengthCount(msrest.serialization.Model): """ _attribute_map = { - 'length': {'key': 'length', 'type': 'long'}, - 'count': {'key': 'count', 'type': 'long'}, + "length": {"key": "length", "type": "long"}, + "count": {"key": "count", "type": "long"}, } def __init__( @@ -2737,8 +2775,8 @@ class STypeCount(msrest.serialization.Model): """ _attribute_map = { - 's_type': {'key': 'sType', 'type': 'str'}, - 'count': {'key': 'count', 'type': 'long'}, + "s_type": {"key": "sType", "type": "str"}, + "count": {"key": "count", "type": "long"}, } def __init__( @@ -2771,8 +2809,8 @@ class TypeCount(msrest.serialization.Model): """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'count': {'key': 'count', 'type': 'long'}, + "type": {"key": "type", "type": "str"}, + "count": {"key": "count", "type": "long"}, } def __init__( @@ -2824,14 +2862,14 @@ class User(msrest.serialization.Model): """ _attribute_map = { - 'user_object_id': {'key': 'userObjectId', 'type': 'str'}, - 'user_pu_id': {'key': 'userPuId', 'type': 'str'}, - 'user_idp': {'key': 'userIdp', 'type': 'str'}, - 'user_alt_sec_id': {'key': 'userAltSecId', 'type': 'str'}, - 'user_iss': {'key': 'userIss', 'type': 'str'}, - 'user_tenant_id': {'key': 'userTenantId', 'type': 'str'}, - 'user_name': {'key': 'userName', 'type': 'str'}, - 'upn': {'key': 'upn', 'type': 'str'}, + "user_object_id": {"key": "userObjectId", "type": "str"}, + "user_pu_id": {"key": "userPuId", "type": "str"}, + "user_idp": {"key": "userIdp", "type": "str"}, + "user_alt_sec_id": {"key": "userAltSecId", "type": "str"}, + "user_iss": {"key": "userIss", "type": "str"}, + "user_tenant_id": {"key": "userTenantId", "type": "str"}, + "user_name": {"key": "userName", "type": "str"}, + "upn": {"key": "upn", "type": "str"}, } def __init__( @@ -2894,8 +2932,8 @@ class ValueCount(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': 'DataField'}, - 'count': {'key': 'count', 'type': 'long'}, + "value": {"key": "value", "type": "DataField"}, + "count": {"key": "count", "type": "long"}, } def __init__( diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/operations/__init__.py index f0340813f282..b01a60bf4bdf 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/operations/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/operations/__init__.py @@ -16,12 +16,12 @@ from ._get_operation_status_operations import GetOperationStatusOperations __all__ = [ - 'DataCallOperations', - 'DataContainerOperations', - 'DeleteOperations', - 'DatasetsV1Operations', - 'DatasetControllerV2Operations', - 'DatasetV2Operations', - 'DataVersionOperations', - 'GetOperationStatusOperations', + "DataCallOperations", + "DataContainerOperations", + "DeleteOperations", + "DatasetsV1Operations", + "DatasetControllerV2Operations", + "DatasetV2Operations", + "DataVersionOperations", + "GetOperationStatusOperations", ] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/operations/_data_call_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/operations/_data_call_operations.py index 4e7865d16b8c..a2ceef0f4756 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/operations/_data_call_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/operations/_data_call_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest @@ -23,8 +29,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -131,6 +143,7 @@ def build_get_quick_profile_for_ml_table_request( **kwargs ) + # fmt: on class DataCallOperations(object): """DataCallOperations operations. @@ -179,16 +192,22 @@ def get_schema_for_ml_table( :rtype: list[~azure.mgmt.machinelearningservices.models.ColumnDefinition] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["_models.ColumnDefinition"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[List["_models.ColumnDefinition"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'DataCallRequest') + _json = self._serialize.body(body, "DataCallRequest") else: _json = None @@ -198,28 +217,39 @@ def get_schema_for_ml_table( workspace_name=workspace_name, content_type=content_type, json=_json, - template_url=self.get_schema_for_ml_table.metadata['url'], + template_url=self.get_schema_for_ml_table.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('[ColumnDefinition]', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "[ColumnDefinition]", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_schema_for_ml_table.metadata = {'url': '/data/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datacall/schema'} # type: ignore - + get_schema_for_ml_table.metadata = {"url": "/data/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datacall/schema"} # type: ignore @distributed_trace def get_preview_for_ml_table( @@ -246,16 +276,22 @@ def get_preview_for_ml_table( :rtype: ~azure.mgmt.machinelearningservices.models.DataViewSetResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataViewSetResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataViewSetResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'DataCallRequest') + _json = self._serialize.body(body, "DataCallRequest") else: _json = None @@ -265,28 +301,39 @@ def get_preview_for_ml_table( workspace_name=workspace_name, content_type=content_type, json=_json, - template_url=self.get_preview_for_ml_table.metadata['url'], + template_url=self.get_preview_for_ml_table.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataViewSetResult', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "DataViewSetResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_preview_for_ml_table.metadata = {'url': '/data/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datacall/preview'} # type: ignore - + get_preview_for_ml_table.metadata = {"url": "/data/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datacall/preview"} # type: ignore @distributed_trace def get_quick_profile_for_ml_table( @@ -313,16 +360,22 @@ def get_quick_profile_for_ml_table( :rtype: list[~azure.mgmt.machinelearningservices.models.ProfileResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["_models.ProfileResult"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[List["_models.ProfileResult"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'DataCallRequest') + _json = self._serialize.body(body, "DataCallRequest") else: _json = None @@ -332,25 +385,34 @@ def get_quick_profile_for_ml_table( workspace_name=workspace_name, content_type=content_type, json=_json, - template_url=self.get_quick_profile_for_ml_table.metadata['url'], + template_url=self.get_quick_profile_for_ml_table.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('[ProfileResult]', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize("[ProfileResult]", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_quick_profile_for_ml_table.metadata = {'url': '/data/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datacall/quickprofile'} # type: ignore - + get_quick_profile_for_ml_table.metadata = {"url": "/data/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datacall/quickprofile"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/operations/_data_container_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/operations/_data_container_operations.py index ac3af23d2bff..4d894d5632b6 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/operations/_data_container_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/operations/_data_container_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -23,9 +29,23 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -162,6 +182,7 @@ def build_modify_data_container_request( **kwargs ) + # fmt: on class DataContainerOperations(object): """DataContainerOperations operations. @@ -210,16 +231,22 @@ def create_data_container( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainerEntity :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerEntity"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerEntity"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'DataContainer') + _json = self._serialize.body(body, "DataContainer") else: _json = None @@ -229,28 +256,39 @@ def create_data_container( workspace_name=workspace_name, content_type=content_type, json=_json, - template_url=self.create_data_container.metadata['url'], + template_url=self.create_data_container.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataContainerEntity', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "DataContainerEntity", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_data_container.metadata = {'url': '/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datacontainer'} # type: ignore - + create_data_container.metadata = {"url": "/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datacontainer"} # type: ignore @distributed_trace def list_data_container( @@ -276,25 +314,30 @@ def list_data_container( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedDataContainerEntityList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedDataContainerEntityList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedDataContainerEntityList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_data_container_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.list_data_container.metadata['url'], + template_url=self.list_data_container.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_data_container_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -307,7 +350,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedDataContainerEntityList", pipeline_response) + deserialized = self._deserialize( + "PaginatedDataContainerEntityList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -316,21 +361,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_data_container.metadata = {'url': '/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datacontainer'} # type: ignore + list_data_container.metadata = {"url": "/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datacontainer"} # type: ignore @distributed_trace def get_data_container( @@ -357,40 +410,54 @@ def get_data_container( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainerEntity :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerEntity"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerEntity"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_data_container_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.get_data_container.metadata['url'], + template_url=self.get_data_container.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataContainerEntity', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "DataContainerEntity", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_data_container.metadata = {'url': '/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datacontainer/{name}'} # type: ignore - + get_data_container.metadata = {"url": "/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datacontainer/{name}"} # type: ignore @distributed_trace def modify_data_container( @@ -420,16 +487,22 @@ def modify_data_container( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainerEntity :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerEntity"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerEntity"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'DataContainerMutable') + _json = self._serialize.body(body, "DataContainerMutable") else: _json = None @@ -440,25 +513,36 @@ def modify_data_container( name=name, content_type=content_type, json=_json, - template_url=self.modify_data_container.metadata['url'], + template_url=self.modify_data_container.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataContainerEntity', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "DataContainerEntity", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - modify_data_container.metadata = {'url': '/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datacontainer/{name}'} # type: ignore - + modify_data_container.metadata = {"url": "/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datacontainer/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/operations/_data_version_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/operations/_data_version_operations.py index ae87ad4b9366..cf4e6ec81782 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/operations/_data_version_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/operations/_data_version_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -23,9 +29,23 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -419,6 +439,7 @@ def build_batch_get_resolved_uris_request( **kwargs ) + # fmt: on class DataVersionOperations(object): """DataVersionOperations operations. @@ -470,16 +491,22 @@ def create( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionEntity :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionEntity"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionEntity"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'DataVersion') + _json = self._serialize.body(body, "DataVersion") else: _json = None @@ -490,28 +517,39 @@ def create( name=name, content_type=content_type, json=_json, - template_url=self.create.metadata['url'], + template_url=self.create.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataVersionEntity', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "DataVersionEntity", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create.metadata = {'url': '/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/dataversion/{name}/versions'} # type: ignore - + create.metadata = {"url": "/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/dataversion/{name}/versions"} # type: ignore @distributed_trace def list( @@ -546,14 +584,19 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedDataVersionEntityList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedDataVersionEntityList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedDataVersionEntityList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -561,13 +604,13 @@ def prepare_request(next_link=None): name=name, order_by=order_by, top=top, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -583,7 +626,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedDataVersionEntityList", pipeline_response) + deserialized = self._deserialize( + "PaginatedDataVersionEntityList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -592,21 +637,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/dataversion/{name}/versions'} # type: ignore + list.metadata = {"url": "/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/dataversion/{name}/versions"} # type: ignore @distributed_trace def get( @@ -636,41 +689,55 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionEntity :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionEntity"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionEntity"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version=version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataVersionEntity', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "DataVersionEntity", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/dataversion/{name}/versions/{version}'} # type: ignore - + get.metadata = {"url": "/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/dataversion/{name}/versions/{version}"} # type: ignore @distributed_trace def modify( @@ -703,16 +770,22 @@ def modify( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionEntity :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionEntity"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionEntity"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'DataVersionMutable') + _json = self._serialize.body(body, "DataVersionMutable") else: _json = None @@ -724,28 +797,39 @@ def modify( version=version, content_type=content_type, json=_json, - template_url=self.modify.metadata['url'], + template_url=self.modify.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataVersionEntity', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "DataVersionEntity", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - modify.metadata = {'url': '/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/dataversion/{name}/versions/{version}'} # type: ignore - + modify.metadata = {"url": "/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/dataversion/{name}/versions/{version}"} # type: ignore @distributed_trace def delete( @@ -775,41 +859,55 @@ def delete( :rtype: ~azure.mgmt.machinelearningservices.models.HttpResponseMessage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.HttpResponseMessage"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.HttpResponseMessage"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version=version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('HttpResponseMessage', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "HttpResponseMessage", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - delete.metadata = {'url': '/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/dataversion/{name}/versions/{version}'} # type: ignore - + delete.metadata = {"url": "/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/dataversion/{name}/versions/{version}"} # type: ignore @distributed_trace def exists( @@ -839,41 +937,51 @@ def exists( :rtype: bool :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[bool] + cls = kwargs.pop("cls", None) # type: ClsType[bool] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_exists_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version=version, - template_url=self.exists.metadata['url'], + template_url=self.exists.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('bool', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize("bool", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - exists.metadata = {'url': '/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/dataversion/{name}/versions/{version}/exists'} # type: ignore - + exists.metadata = {"url": "/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/dataversion/{name}/versions/{version}/exists"} # type: ignore @distributed_trace def get_by_asset_id( @@ -900,16 +1008,22 @@ def get_by_asset_id( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionEntity :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionEntity"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionEntity"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'AssetId') + _json = self._serialize.body(body, "AssetId") else: _json = None @@ -919,28 +1033,39 @@ def get_by_asset_id( workspace_name=workspace_name, content_type=content_type, json=_json, - template_url=self.get_by_asset_id.metadata['url'], + template_url=self.get_by_asset_id.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataVersionEntity', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "DataVersionEntity", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_by_asset_id.metadata = {'url': '/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/dataversion/getByAssetId'} # type: ignore - + get_by_asset_id.metadata = {"url": "/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/dataversion/getByAssetId"} # type: ignore @distributed_trace def create_unregistered_input_data( @@ -967,16 +1092,22 @@ def create_unregistered_input_data( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainerEntity :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerEntity"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerEntity"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'CreateUnregisteredInputData') + _json = self._serialize.body(body, "CreateUnregisteredInputData") else: _json = None @@ -986,28 +1117,39 @@ def create_unregistered_input_data( workspace_name=workspace_name, content_type=content_type, json=_json, - template_url=self.create_unregistered_input_data.metadata['url'], + template_url=self.create_unregistered_input_data.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataContainerEntity', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "DataContainerEntity", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_unregistered_input_data.metadata = {'url': '/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/dataversion/createUnregisteredInput'} # type: ignore - + create_unregistered_input_data.metadata = {"url": "/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/dataversion/createUnregisteredInput"} # type: ignore @distributed_trace def create_unregistered_output_data( @@ -1034,16 +1176,22 @@ def create_unregistered_output_data( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainerEntity :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerEntity"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerEntity"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'CreateUnregisteredOutputData') + _json = self._serialize.body(body, "CreateUnregisteredOutputData") else: _json = None @@ -1053,28 +1201,39 @@ def create_unregistered_output_data( workspace_name=workspace_name, content_type=content_type, json=_json, - template_url=self.create_unregistered_output_data.metadata['url'], + template_url=self.create_unregistered_output_data.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataContainerEntity', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "DataContainerEntity", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_unregistered_output_data.metadata = {'url': '/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/dataversion/createUnregisteredOutput'} # type: ignore - + create_unregistered_output_data.metadata = {"url": "/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/dataversion/createUnregisteredOutput"} # type: ignore @distributed_trace def registered_existing_data( @@ -1101,16 +1260,22 @@ def registered_existing_data( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainerEntity :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerEntity"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerEntity"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'RegisterExistingData') + _json = self._serialize.body(body, "RegisterExistingData") else: _json = None @@ -1120,28 +1285,39 @@ def registered_existing_data( workspace_name=workspace_name, content_type=content_type, json=_json, - template_url=self.registered_existing_data.metadata['url'], + template_url=self.registered_existing_data.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataContainerEntity', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "DataContainerEntity", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - registered_existing_data.metadata = {'url': '/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/dataversion/registerExisting'} # type: ignore - + registered_existing_data.metadata = {"url": "/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/dataversion/registerExisting"} # type: ignore @distributed_trace def batch_get_resolved_uris( @@ -1168,16 +1344,22 @@ def batch_get_resolved_uris( :rtype: ~azure.mgmt.machinelearningservices.models.BatchDataUriResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDataUriResponse"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDataUriResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'BatchGetResolvedURIs') + _json = self._serialize.body(body, "BatchGetResolvedURIs") else: _json = None @@ -1187,25 +1369,36 @@ def batch_get_resolved_uris( workspace_name=workspace_name, content_type=content_type, json=_json, - template_url=self.batch_get_resolved_uris.metadata['url'], + template_url=self.batch_get_resolved_uris.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('BatchDataUriResponse', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "BatchDataUriResponse", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - batch_get_resolved_uris.metadata = {'url': '/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/dataversion/batchGetResolvedUris'} # type: ignore - + batch_get_resolved_uris.metadata = {"url": "/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/dataversion/batchGetResolvedUris"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/operations/_dataset_controller_v2_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/operations/_dataset_controller_v2_operations.py index 05d64736d21e..029d85f954c2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/operations/_dataset_controller_v2_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/operations/_dataset_controller_v2_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -23,9 +29,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, List, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + List, + Optional, + TypeVar, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -468,6 +489,7 @@ def build_unregister_dataset_request( **kwargs ) + # fmt: on class DatasetControllerV2Operations(object): """DatasetControllerV2Operations operations. @@ -519,41 +541,55 @@ def get_dataset_definition( :rtype: ~azure.mgmt.machinelearningservices.models.DatasetDefinition :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatasetDefinition"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DatasetDefinition"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_dataset_definition_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, dataset_id=dataset_id, version=version, - template_url=self.get_dataset_definition.metadata['url'], + template_url=self.get_dataset_definition.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DatasetDefinition', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "DatasetDefinition", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_dataset_definition.metadata = {'url': '/dataset/v1.2/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}/definitions/{version}'} # type: ignore - + get_dataset_definition.metadata = {"url": "/dataset/v1.2/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}/definitions/{version}"} # type: ignore @distributed_trace def get_all_dataset_definitions( @@ -588,14 +624,19 @@ def get_all_dataset_definitions( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedDatasetDefinitionList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedDatasetDefinitionList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedDatasetDefinitionList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_get_all_dataset_definitions_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -603,13 +644,15 @@ def prepare_request(next_link=None): dataset_id=dataset_id, continuation_token_parameter=continuation_token_parameter, page_size=page_size, - template_url=self.get_all_dataset_definitions.metadata['url'], + template_url=self.get_all_dataset_definitions.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_get_all_dataset_definitions_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -625,7 +668,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedDatasetDefinitionList", pipeline_response) + deserialized = self._deserialize( + "PaginatedDatasetDefinitionList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -634,21 +679,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - get_all_dataset_definitions.metadata = {'url': '/dataset/v1.2/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}/definitions'} # type: ignore + get_all_dataset_definitions.metadata = {"url": "/dataset/v1.2/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}/definitions"} # type: ignore @distributed_trace def update_definition( @@ -690,16 +743,20 @@ def update_definition( :rtype: ~azure.mgmt.machinelearningservices.models.Dataset :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Dataset"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Dataset"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'DatasetDefinition') + _json = self._serialize.body(body, "DatasetDefinition") else: _json = None @@ -714,28 +771,37 @@ def update_definition( force_update=force_update, dataset_type=dataset_type, user_version_id=user_version_id, - template_url=self.update_definition.metadata['url'], + template_url=self.update_definition.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Dataset', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize("Dataset", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update_definition.metadata = {'url': '/dataset/v1.2/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}/definitions'} # type: ignore - + update_definition.metadata = {"url": "/dataset/v1.2/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}/definitions"} # type: ignore @distributed_trace def get_all_dataset_versions( @@ -769,14 +835,19 @@ def get_all_dataset_versions( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedStringList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedStringList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedStringList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_get_all_dataset_versions_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -784,13 +855,13 @@ def prepare_request(next_link=None): dataset_id=dataset_id, continuation_token_parameter=continuation_token_parameter, page_size=page_size, - template_url=self.get_all_dataset_versions.metadata['url'], + template_url=self.get_all_dataset_versions.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_get_all_dataset_versions_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -806,7 +877,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedStringList", pipeline_response) + deserialized = self._deserialize( + "PaginatedStringList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -815,21 +888,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - get_all_dataset_versions.metadata = {'url': '/dataset/v1.2/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}/versions'} # type: ignore + get_all_dataset_versions.metadata = {"url": "/dataset/v1.2/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}/versions"} # type: ignore @distributed_trace def get_dataset_by_name( @@ -862,13 +943,14 @@ def get_dataset_by_name( :rtype: ~azure.mgmt.machinelearningservices.models.Dataset :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Dataset"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Dataset"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_dataset_by_name_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -876,28 +958,37 @@ def get_dataset_by_name( dataset_name=dataset_name, version_id=version_id, include_latest_definition=include_latest_definition, - template_url=self.get_dataset_by_name.metadata['url'], + template_url=self.get_dataset_by_name.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Dataset', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize("Dataset", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_dataset_by_name.metadata = {'url': '/dataset/v1.2/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/query/name={datasetName}'} # type: ignore - + get_dataset_by_name.metadata = {"url": "/dataset/v1.2/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/query/name={datasetName}"} # type: ignore @distributed_trace def list( @@ -953,14 +1044,19 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedDatasetList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedDatasetList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedDatasetList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -975,13 +1071,13 @@ def prepare_request(next_link=None): order_by=order_by, order_by_asc=order_by_asc, dataset_types=dataset_types, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -1004,7 +1100,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedDatasetList", pipeline_response) + deserialized = self._deserialize( + "PaginatedDatasetList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1013,21 +1111,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/dataset/v1.2/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets'} # type: ignore + list.metadata = {"url": "/dataset/v1.2/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets"} # type: ignore @distributed_trace def register( @@ -1069,16 +1175,20 @@ def register( :rtype: ~azure.mgmt.machinelearningservices.models.Dataset :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Dataset"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Dataset"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'Dataset') + _json = self._serialize.body(body, "Dataset") else: _json = None @@ -1093,28 +1203,37 @@ def register( update_definition_if_exists=update_definition_if_exists, with_data_hash=with_data_hash, user_version_id=user_version_id, - template_url=self.register.metadata['url'], + template_url=self.register.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Dataset', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize("Dataset", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - register.metadata = {'url': '/dataset/v1.2/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets'} # type: ignore - + register.metadata = {"url": "/dataset/v1.2/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets"} # type: ignore @distributed_trace def delete_all_datasets( @@ -1138,35 +1257,45 @@ def delete_all_datasets( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_all_datasets_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.delete_all_datasets.metadata['url'], + template_url=self.delete_all_datasets.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in []: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete_all_datasets.metadata = {'url': '/dataset/v1.2/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets'} # type: ignore - + delete_all_datasets.metadata = {"url": "/dataset/v1.2/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets"} # type: ignore @distributed_trace def update_dataset( @@ -1199,16 +1328,20 @@ def update_dataset( :rtype: ~azure.mgmt.machinelearningservices.models.Dataset :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Dataset"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Dataset"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'Dataset') + _json = self._serialize.body(body, "Dataset") else: _json = None @@ -1220,28 +1353,37 @@ def update_dataset( content_type=content_type, json=_json, force_update=force_update, - template_url=self.update_dataset.metadata['url'], + template_url=self.update_dataset.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Dataset', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize("Dataset", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update_dataset.metadata = {'url': '/dataset/v1.2/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}'} # type: ignore - + update_dataset.metadata = {"url": "/dataset/v1.2/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}"} # type: ignore @distributed_trace def unregister_dataset( @@ -1268,33 +1410,43 @@ def unregister_dataset( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_unregister_dataset_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.unregister_dataset.metadata['url'], + template_url=self.unregister_dataset.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in []: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - unregister_dataset.metadata = {'url': '/dataset/v1.2/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{name}'} # type: ignore - + unregister_dataset.metadata = {"url": "/dataset/v1.2/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/operations/_dataset_v2_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/operations/_dataset_v2_operations.py index 7f686ab6b10b..6c591e93e859 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/operations/_dataset_v2_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/operations/_dataset_v2_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -23,9 +29,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, List, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + List, + Optional, + TypeVar, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -328,6 +349,7 @@ def build_get_dataset_by_name_request( **kwargs ) + # fmt: on class DatasetV2Operations(object): """DatasetV2Operations operations. @@ -379,16 +401,20 @@ def create( :rtype: ~azure.mgmt.machinelearningservices.models.DatasetV2 :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatasetV2"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DatasetV2"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'DatasetV2') + _json = self._serialize.body(body, "DatasetV2") else: _json = None @@ -399,28 +425,37 @@ def create( content_type=content_type, json=_json, if_exists_update=if_exists_update, - template_url=self.create.metadata['url'], + template_url=self.create.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DatasetV2', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize("DatasetV2", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create.metadata = {'url': '/dataset/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets'} # type: ignore - + create.metadata = {"url": "/dataset/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets"} # type: ignore @distributed_trace def delete_all_datasets( @@ -444,35 +479,45 @@ def delete_all_datasets( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_all_datasets_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.delete_all_datasets.metadata['url'], + template_url=self.delete_all_datasets.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in []: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete_all_datasets.metadata = {'url': '/dataset/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets'} # type: ignore - + delete_all_datasets.metadata = {"url": "/dataset/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets"} # type: ignore @distributed_trace def list( @@ -510,14 +555,19 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedDatasetV2List] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedDatasetV2List"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedDatasetV2List"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -526,13 +576,13 @@ def prepare_request(next_link=None): search_text=search_text, continuation_token_parameter=continuation_token_parameter, page_size=page_size, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -549,7 +599,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedDatasetV2List", pipeline_response) + deserialized = self._deserialize( + "PaginatedDatasetV2List", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -558,21 +610,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/dataset/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets'} # type: ignore + list.metadata = {"url": "/dataset/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets"} # type: ignore @distributed_trace def delete_dataset_by_name( @@ -602,37 +662,47 @@ def delete_dataset_by_name( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_dataset_by_name_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version_id=version_id, - template_url=self.delete_dataset_by_name.metadata['url'], + template_url=self.delete_dataset_by_name.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in []: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete_dataset_by_name.metadata = {'url': '/dataset/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{name}/versions/{versionId}'} # type: ignore - + delete_dataset_by_name.metadata = {"url": "/dataset/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{name}/versions/{versionId}"} # type: ignore @distributed_trace def update_dataset_by_name_and_version( @@ -665,16 +735,20 @@ def update_dataset_by_name_and_version( :rtype: ~azure.mgmt.machinelearningservices.models.DatasetV2 :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatasetV2"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DatasetV2"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'DatasetV2') + _json = self._serialize.body(body, "DatasetV2") else: _json = None @@ -686,28 +760,39 @@ def update_dataset_by_name_and_version( version_id=version_id, content_type=content_type, json=_json, - template_url=self.update_dataset_by_name_and_version.metadata['url'], + template_url=self.update_dataset_by_name_and_version.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DatasetV2', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize("DatasetV2", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update_dataset_by_name_and_version.metadata = {'url': '/dataset/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{name}/versions/{versionId}'} # type: ignore - + update_dataset_by_name_and_version.metadata = {"url": "/dataset/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{name}/versions/{versionId}"} # type: ignore @distributed_trace def get_dataset_by_id( @@ -734,40 +819,50 @@ def get_dataset_by_id( :rtype: ~azure.mgmt.machinelearningservices.models.DatasetV2 :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatasetV2"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DatasetV2"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_dataset_by_id_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, dataset_id=dataset_id, - template_url=self.get_dataset_by_id.metadata['url'], + template_url=self.get_dataset_by_id.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DatasetV2', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize("DatasetV2", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_dataset_by_id.metadata = {'url': '/dataset/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}'} # type: ignore - + get_dataset_by_id.metadata = {"url": "/dataset/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}"} # type: ignore @distributed_trace def update_dataset( @@ -797,16 +892,20 @@ def update_dataset( :rtype: ~azure.mgmt.machinelearningservices.models.DatasetV2 :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatasetV2"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DatasetV2"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'DatasetV2') + _json = self._serialize.body(body, "DatasetV2") else: _json = None @@ -817,28 +916,37 @@ def update_dataset( dataset_id=dataset_id, content_type=content_type, json=_json, - template_url=self.update_dataset.metadata['url'], + template_url=self.update_dataset.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DatasetV2', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize("DatasetV2", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update_dataset.metadata = {'url': '/dataset/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}'} # type: ignore - + update_dataset.metadata = {"url": "/dataset/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}"} # type: ignore @distributed_trace def get_dataset_by_name( @@ -868,38 +976,48 @@ def get_dataset_by_name( :rtype: ~azure.mgmt.machinelearningservices.models.DatasetV2 :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatasetV2"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DatasetV2"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_dataset_by_name_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, dataset_name=dataset_name, version_id=version_id, - template_url=self.get_dataset_by_name.metadata['url'], + template_url=self.get_dataset_by_name.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DatasetV2', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize("DatasetV2", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_dataset_by_name.metadata = {'url': '/dataset/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/query/name={datasetName}'} # type: ignore - + get_dataset_by_name.metadata = {"url": "/dataset/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/query/name={datasetName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/operations/_datasets_v1_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/operations/_datasets_v1_operations.py index df1b17100a29..cc37ce3a9520 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/operations/_datasets_v1_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/operations/_datasets_v1_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -23,9 +29,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, List, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + List, + Optional, + TypeVar, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -468,6 +489,7 @@ def build_unregister_dataset_request( **kwargs ) + # fmt: on class DatasetsV1Operations(object): """DatasetsV1Operations operations. @@ -519,41 +541,55 @@ def get_dataset_definition( :rtype: ~azure.mgmt.machinelearningservices.models.DatasetDefinition :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatasetDefinition"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DatasetDefinition"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_dataset_definition_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, dataset_id=dataset_id, version=version, - template_url=self.get_dataset_definition.metadata['url'], + template_url=self.get_dataset_definition.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DatasetDefinition', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "DatasetDefinition", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_dataset_definition.metadata = {'url': '/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}/definitions/{version}'} # type: ignore - + get_dataset_definition.metadata = {"url": "/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}/definitions/{version}"} # type: ignore @distributed_trace def get_all_dataset_definitions( @@ -588,14 +624,19 @@ def get_all_dataset_definitions( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedDatasetDefinitionList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedDatasetDefinitionList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedDatasetDefinitionList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_get_all_dataset_definitions_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -603,13 +644,15 @@ def prepare_request(next_link=None): dataset_id=dataset_id, continuation_token_parameter=continuation_token_parameter, page_size=page_size, - template_url=self.get_all_dataset_definitions.metadata['url'], + template_url=self.get_all_dataset_definitions.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_get_all_dataset_definitions_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -625,7 +668,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedDatasetDefinitionList", pipeline_response) + deserialized = self._deserialize( + "PaginatedDatasetDefinitionList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -634,21 +679,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - get_all_dataset_definitions.metadata = {'url': '/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}/definitions'} # type: ignore + get_all_dataset_definitions.metadata = {"url": "/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}/definitions"} # type: ignore @distributed_trace def update_definition( @@ -690,16 +743,20 @@ def update_definition( :rtype: ~azure.mgmt.machinelearningservices.models.Dataset :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Dataset"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Dataset"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'DatasetDefinition') + _json = self._serialize.body(body, "DatasetDefinition") else: _json = None @@ -714,28 +771,37 @@ def update_definition( force_update=force_update, dataset_type=dataset_type, user_version_id=user_version_id, - template_url=self.update_definition.metadata['url'], + template_url=self.update_definition.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Dataset', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize("Dataset", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update_definition.metadata = {'url': '/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}/definitions'} # type: ignore - + update_definition.metadata = {"url": "/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}/definitions"} # type: ignore @distributed_trace def get_all_dataset_versions( @@ -769,14 +835,19 @@ def get_all_dataset_versions( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedStringList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedStringList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedStringList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_get_all_dataset_versions_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -784,13 +855,13 @@ def prepare_request(next_link=None): dataset_id=dataset_id, continuation_token_parameter=continuation_token_parameter, page_size=page_size, - template_url=self.get_all_dataset_versions.metadata['url'], + template_url=self.get_all_dataset_versions.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_get_all_dataset_versions_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -806,7 +877,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedStringList", pipeline_response) + deserialized = self._deserialize( + "PaginatedStringList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -815,21 +888,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - get_all_dataset_versions.metadata = {'url': '/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}/versions'} # type: ignore + get_all_dataset_versions.metadata = {"url": "/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}/versions"} # type: ignore @distributed_trace def get_dataset_by_name( @@ -862,13 +943,14 @@ def get_dataset_by_name( :rtype: ~azure.mgmt.machinelearningservices.models.Dataset :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Dataset"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Dataset"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_dataset_by_name_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -876,28 +958,37 @@ def get_dataset_by_name( dataset_name=dataset_name, version_id=version_id, include_latest_definition=include_latest_definition, - template_url=self.get_dataset_by_name.metadata['url'], + template_url=self.get_dataset_by_name.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Dataset', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize("Dataset", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_dataset_by_name.metadata = {'url': '/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/query/name={datasetName}'} # type: ignore - + get_dataset_by_name.metadata = {"url": "/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/query/name={datasetName}"} # type: ignore @distributed_trace def list( @@ -953,14 +1044,19 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedDatasetList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedDatasetList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedDatasetList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -975,13 +1071,13 @@ def prepare_request(next_link=None): order_by=order_by, order_by_asc=order_by_asc, dataset_types=dataset_types, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -1004,7 +1100,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedDatasetList", pipeline_response) + deserialized = self._deserialize( + "PaginatedDatasetList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1013,21 +1111,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets'} # type: ignore + list.metadata = {"url": "/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets"} # type: ignore @distributed_trace def register( @@ -1069,16 +1175,20 @@ def register( :rtype: ~azure.mgmt.machinelearningservices.models.Dataset :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Dataset"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Dataset"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'Dataset') + _json = self._serialize.body(body, "Dataset") else: _json = None @@ -1093,28 +1203,37 @@ def register( update_definition_if_exists=update_definition_if_exists, with_data_hash=with_data_hash, user_version_id=user_version_id, - template_url=self.register.metadata['url'], + template_url=self.register.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Dataset', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize("Dataset", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - register.metadata = {'url': '/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets'} # type: ignore - + register.metadata = {"url": "/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets"} # type: ignore @distributed_trace def delete_all_datasets( @@ -1138,35 +1257,45 @@ def delete_all_datasets( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_all_datasets_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.delete_all_datasets.metadata['url'], + template_url=self.delete_all_datasets.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in []: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete_all_datasets.metadata = {'url': '/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets'} # type: ignore - + delete_all_datasets.metadata = {"url": "/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets"} # type: ignore @distributed_trace def update_dataset( @@ -1199,16 +1328,20 @@ def update_dataset( :rtype: ~azure.mgmt.machinelearningservices.models.Dataset :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Dataset"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Dataset"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'Dataset') + _json = self._serialize.body(body, "Dataset") else: _json = None @@ -1220,28 +1353,37 @@ def update_dataset( content_type=content_type, json=_json, force_update=force_update, - template_url=self.update_dataset.metadata['url'], + template_url=self.update_dataset.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Dataset', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize("Dataset", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update_dataset.metadata = {'url': '/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}'} # type: ignore - + update_dataset.metadata = {"url": "/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{datasetId}"} # type: ignore @distributed_trace def unregister_dataset( @@ -1268,33 +1410,43 @@ def unregister_dataset( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_unregister_dataset_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.unregister_dataset.metadata['url'], + template_url=self.unregister_dataset.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in []: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - unregister_dataset.metadata = {'url': '/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{name}'} # type: ignore - + unregister_dataset.metadata = {"url": "/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datasets/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/operations/_delete_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/operations/_delete_operations.py index e1cd955c483f..b8b74abb58c1 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/operations/_delete_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/operations/_delete_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest @@ -23,8 +29,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Generic, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -61,6 +73,7 @@ def build_data_container_request( **kwargs ) + # fmt: on class DeleteOperations(object): """DeleteOperations operations. @@ -109,37 +122,51 @@ def data_container( :rtype: ~azure.mgmt.machinelearningservices.models.HttpResponseMessage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.HttpResponseMessage"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.HttpResponseMessage"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_data_container_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.data_container.metadata['url'], + template_url=self.data_container.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('HttpResponseMessage', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "HttpResponseMessage", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - data_container.metadata = {'url': '/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datacontainer/{name}'} # type: ignore - + data_container.metadata = {"url": "/data/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datacontainer/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/operations/_get_operation_status_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/operations/_get_operation_status_operations.py index 085f9749de4e..7c1c8b7aaebf 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/operations/_get_operation_status_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/dataset_dataplane/operations/_get_operation_status_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod @@ -25,8 +31,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -63,6 +75,7 @@ def build_get_dataset_operation_status_request_initial( **kwargs ) + # fmt: on class GetOperationStatusOperations(object): """GetOperationStatusOperations operations. @@ -95,46 +108,62 @@ def _get_dataset_operation_status_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.LongRunningOperationResponse1LongRunningOperationResponseObject"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LongRunningOperationResponse1LongRunningOperationResponseObject"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.LongRunningOperationResponse1LongRunningOperationResponseObject"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_dataset_operation_status_request_initial( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, operation_id=operation_id, - template_url=self._get_dataset_operation_status_initial.metadata['url'], + template_url=self._get_dataset_operation_status_initial.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('LongRunningOperationResponse1LongRunningOperationResponseObject', pipeline_response) + deserialized = self._deserialize( + "LongRunningOperationResponse1LongRunningOperationResponseObject", + pipeline_response, + ) if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _get_dataset_operation_status_initial.metadata = {'url': '/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/operations/{operationId}'} # type: ignore - + _get_dataset_operation_status_initial.metadata = {"url": "/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/operations/{operationId}"} # type: ignore @distributed_trace def begin_get_dataset_operation_status( @@ -170,43 +199,62 @@ def begin_get_dataset_operation_status( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.LongRunningOperationResponse1LongRunningOperationResponseObject] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.LongRunningOperationResponse1LongRunningOperationResponseObject"] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.LongRunningOperationResponse1LongRunningOperationResponseObject"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._get_dataset_operation_status_initial( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, operation_id=operation_id, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('LongRunningOperationResponse1LongRunningOperationResponseObject', pipeline_response) + deserialized = self._deserialize( + "LongRunningOperationResponse1LongRunningOperationResponseObject", + pipeline_response, + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_get_dataset_operation_status.metadata = {'url': '/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/operations/{operationId}'} # type: ignore + begin_get_dataset_operation_status.metadata = {"url": "/dataset/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/operations/{operationId}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/__init__.py index da46614477a9..71cf8fdc020d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/__init__.py @@ -10,9 +10,10 @@ from ._version import VERSION __version__ = VERSION -__all__ = ['AzureMachineLearningWorkspaces'] +__all__ = ["AzureMachineLearningWorkspaces"] # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk + patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/_azure_machine_learning_workspaces.py index 2c55118d26e4..ee19d64891ba 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/_azure_machine_learning_workspaces.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/_azure_machine_learning_workspaces.py @@ -14,7 +14,12 @@ from . import models from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import AssetsOperations, ExtensiveModelOperations, MigrationOperations, ModelsOperations +from .operations import ( + AssetsOperations, + ExtensiveModelOperations, + MigrationOperations, + ModelsOperations, +) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -23,6 +28,7 @@ from azure.core.credentials import TokenCredential from azure.core.rest import HttpRequest, HttpResponse + class AzureMachineLearningWorkspaces(object): """AzureMachineLearningWorkspaces. @@ -48,18 +54,31 @@ def __init__( **kwargs # type: Any ): # type: (...) -> None - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, **kwargs) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._config = AzureMachineLearningWorkspacesConfiguration( + credential=credential, **kwargs + ) + self._client = ARMPipelineClient( + base_url=base_url, config=self._config, **kwargs + ) + + client_models = { + k: v for k, v in models.__dict__.items() if isinstance(v, type) + } self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.assets = AssetsOperations(self._client, self._config, self._serialize, self._deserialize) - self.extensive_model = ExtensiveModelOperations(self._client, self._config, self._serialize, self._deserialize) - self.migration = MigrationOperations(self._client, self._config, self._serialize, self._deserialize) - self.models = ModelsOperations(self._client, self._config, self._serialize, self._deserialize) - + self.assets = AssetsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.extensive_model = ExtensiveModelOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.migration = MigrationOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.models = ModelsOperations( + self._client, self._config, self._serialize, self._deserialize + ) def _send_request( self, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/_configuration.py index 2ec7eb9ec4cc..b428b8d93394 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/_configuration.py @@ -10,7 +10,10 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ( + ARMChallengeAuthenticationPolicy, + ARMHttpLoggingPolicy, +) from ._version import VERSION @@ -37,28 +40,51 @@ def __init__( **kwargs # type: Any ): # type: (...) -> None - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) + super(AzureMachineLearningWorkspacesConfiguration, self).__init__( + **kwargs + ) if credential is None: raise ValueError("Parameter 'credential' must not be None.") self.credential = credential - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) + self.credential_scopes = kwargs.pop( + "credential_scopes", ["https://management.azure.com/.default"] + ) + kwargs.setdefault( + "sdk_moniker", "mgmt-machinelearningservices/{}".format(VERSION) + ) self._configure(**kwargs) def _configure( - self, - **kwargs # type: Any + self, **kwargs # type: Any ): # type: (...) -> None - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') + self.user_agent_policy = kwargs.get( + "user_agent_policy" + ) or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get( + "headers_policy" + ) or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy( + **kwargs + ) + self.logging_policy = kwargs.get( + "logging_policy" + ) or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get( + "http_logging_policy" + ) or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy( + **kwargs + ) + self.custom_hook_policy = kwargs.get( + "custom_hook_policy" + ) or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get( + "redirect_policy" + ) or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = ARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/_patch.py index 74e48ecd07cf..17dbc073e01b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/_patch.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/_patch.py @@ -25,7 +25,8 @@ # # -------------------------------------------------------------------------- + # This file is used for handwritten extensions to the generated code. Example: # https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md def patch_sdk(): - pass \ No newline at end of file + pass diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/_vendor.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/_vendor.py index 138f663c53a4..ed3373e9699d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/_vendor.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/_vendor.py @@ -7,13 +7,20 @@ from azure.core.pipeline.transport import HttpRequest + def _convert_request(request, files=None): data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + request = HttpRequest( + method=request.method, + url=request.url, + headers=request.headers, + data=data, + ) if files: request.set_formdata_body(files) return request + def _format_url_section(template, **kwargs): components = template.split("/") while components: @@ -22,6 +29,8 @@ def _format_url_section(template, **kwargs): except KeyError as key: formatted_components = template.split("/") components = [ - c for c in formatted_components if "{}".format(key.args[0]) not in c + c + for c in formatted_components + if "{}".format(key.args[0]) not in c ] template = "/".join(components) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/aio/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/aio/__init__.py index f67ccda966f1..b90ec7485f14 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/aio/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/aio/__init__.py @@ -7,9 +7,11 @@ # -------------------------------------------------------------------------- from ._azure_machine_learning_workspaces import AzureMachineLearningWorkspaces -__all__ = ['AzureMachineLearningWorkspaces'] + +__all__ = ["AzureMachineLearningWorkspaces"] # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk + patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/aio/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/aio/_azure_machine_learning_workspaces.py index 96732b90aee1..c062f91c50f1 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/aio/_azure_machine_learning_workspaces.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/aio/_azure_machine_learning_workspaces.py @@ -15,12 +15,18 @@ from .. import models from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import AssetsOperations, ExtensiveModelOperations, MigrationOperations, ModelsOperations +from .operations import ( + AssetsOperations, + ExtensiveModelOperations, + MigrationOperations, + ModelsOperations, +) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential + class AzureMachineLearningWorkspaces: """AzureMachineLearningWorkspaces. @@ -45,23 +51,34 @@ def __init__( base_url: str = "", **kwargs: Any ) -> None: - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, **kwargs) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._config = AzureMachineLearningWorkspacesConfiguration( + credential=credential, **kwargs + ) + self._client = AsyncARMPipelineClient( + base_url=base_url, config=self._config, **kwargs + ) + + client_models = { + k: v for k, v in models.__dict__.items() if isinstance(v, type) + } self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.assets = AssetsOperations(self._client, self._config, self._serialize, self._deserialize) - self.extensive_model = ExtensiveModelOperations(self._client, self._config, self._serialize, self._deserialize) - self.migration = MigrationOperations(self._client, self._config, self._serialize, self._deserialize) - self.models = ModelsOperations(self._client, self._config, self._serialize, self._deserialize) - + self.assets = AssetsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.extensive_model = ExtensiveModelOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.migration = MigrationOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.models = ModelsOperations( + self._client, self._config, self._serialize, self._deserialize + ) def _send_request( - self, - request: HttpRequest, - **kwargs: Any + self, request: HttpRequest, **kwargs: Any ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/aio/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/aio/_configuration.py index 26def54e12db..b9b9296a1a2e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/aio/_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/aio/_configuration.py @@ -10,7 +10,10 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy +from azure.mgmt.core.policies import ( + ARMHttpLoggingPolicy, + AsyncARMChallengeAuthenticationPolicy, +) from .._version import VERSION @@ -30,31 +33,50 @@ class AzureMachineLearningWorkspacesConfiguration(Configuration): """ def __init__( - self, - credential: "AsyncTokenCredential", - **kwargs: Any + self, credential: "AsyncTokenCredential", **kwargs: Any ) -> None: - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) + super(AzureMachineLearningWorkspacesConfiguration, self).__init__( + **kwargs + ) if credential is None: raise ValueError("Parameter 'credential' must not be None.") self.credential = credential - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) + self.credential_scopes = kwargs.pop( + "credential_scopes", ["https://management.azure.com/.default"] + ) + kwargs.setdefault( + "sdk_moniker", "mgmt-machinelearningservices/{}".format(VERSION) + ) self._configure(**kwargs) - def _configure( - self, - **kwargs: Any - ) -> None: - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get( + "user_agent_policy" + ) or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get( + "headers_policy" + ) or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy( + **kwargs + ) + self.logging_policy = kwargs.get( + "logging_policy" + ) or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get( + "http_logging_policy" + ) or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get( + "retry_policy" + ) or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get( + "custom_hook_policy" + ) or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get( + "redirect_policy" + ) or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/aio/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/aio/_patch.py index 74e48ecd07cf..17dbc073e01b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/aio/_patch.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/aio/_patch.py @@ -25,7 +25,8 @@ # # -------------------------------------------------------------------------- + # This file is used for handwritten extensions to the generated code. Example: # https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md def patch_sdk(): - pass \ No newline at end of file + pass diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/aio/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/aio/operations/__init__.py index 261577d5a114..a8607943464c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/aio/operations/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/aio/operations/__init__.py @@ -12,8 +12,8 @@ from ._models_operations import ModelsOperations __all__ = [ - 'AssetsOperations', - 'ExtensiveModelOperations', - 'MigrationOperations', - 'ModelsOperations', + "AssetsOperations", + "ExtensiveModelOperations", + "MigrationOperations", + "ModelsOperations", ] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/aio/operations/_assets_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/aio/operations/_assets_operations.py index 20f7a4cb84a7..8e00daa7fb0e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/aio/operations/_assets_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/aio/operations/_assets_operations.py @@ -9,7 +9,13 @@ from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -18,9 +24,22 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._assets_operations import build_create_request, build_delete_request, build_list_request, build_patch_request, build_query_by_id_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._assets_operations import ( + build_create_request, + build_delete_request, + build_list_request, + build_patch_request, + build_query_by_id_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class AssetsOperations: """AssetsOperations async operations. @@ -68,26 +87,35 @@ async def create( :rtype: ~azure.mgmt.machinelearningservices.models.Asset :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Asset"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Asset"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json-patch+json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json-patch+json" + ) # type: Optional[str] _json = None _content = None - if content_type.split(";")[0] in ['application/json', 'text/json']: + if content_type.split(";")[0] in ["application/json", "text/json"]: if body is not None: - _json = self._serialize.body(body, 'Asset') - elif content_type.split(";")[0] in ['application/json-patch+json', 'application/*+json']: + _json = self._serialize.body(body, "Asset") + elif content_type.split(";")[0] in [ + "application/json-patch+json", + "application/*+json", + ]: if body is not None: - _json = self._serialize.body(body, 'Asset') + _json = self._serialize.body(body, "Asset") else: raise ValueError( "The content_type '{}' is not one of the allowed values: " - "['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']".format(content_type) + "['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']".format( + content_type + ) ) request = build_create_request( @@ -97,27 +125,34 @@ async def create( content_type=content_type, json=_json, content=_content, - template_url=self.create.metadata['url'], + template_url=self.create.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Asset', pipeline_response) + deserialized = self._deserialize("Asset", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create.metadata = {'url': '/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/assets'} # type: ignore - + create.metadata = {"url": "/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/assets"} # type: ignore @distributed_trace_async async def list( @@ -170,13 +205,16 @@ async def list( :rtype: ~azure.mgmt.machinelearningservices.models.AssetPaginatedResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AssetPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.AssetPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -191,27 +229,36 @@ async def list( properties=properties, type=type, orderby=orderby, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('AssetPaginatedResult', pipeline_response) + deserialized = self._deserialize( + "AssetPaginatedResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': '/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/assets'} # type: ignore - + list.metadata = {"url": "/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/assets"} # type: ignore @distributed_trace_async async def patch( @@ -240,24 +287,33 @@ async def patch( :rtype: ~azure.mgmt.machinelearningservices.models.Asset :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Asset"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Asset"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json-patch+json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json-patch+json" + ) # type: Optional[str] _json = None _content = None - if content_type.split(";")[0] in ['application/json', 'text/json']: - _json = self._serialize.body(body, '[Operation]') - elif content_type.split(";")[0] in ['application/json-patch+json', 'application/*+json']: - _json = self._serialize.body(body, '[Operation]') + if content_type.split(";")[0] in ["application/json", "text/json"]: + _json = self._serialize.body(body, "[Operation]") + elif content_type.split(";")[0] in [ + "application/json-patch+json", + "application/*+json", + ]: + _json = self._serialize.body(body, "[Operation]") else: raise ValueError( "The content_type '{}' is not one of the allowed values: " - "['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']".format(content_type) + "['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']".format( + content_type + ) ) request = build_patch_request( @@ -268,27 +324,34 @@ async def patch( content_type=content_type, json=_json, content=_content, - template_url=self.patch.metadata['url'], + template_url=self.patch.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Asset', pipeline_response) + deserialized = self._deserialize("Asset", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - patch.metadata = {'url': '/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/assets/{id}'} # type: ignore - + patch.metadata = {"url": "/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/assets/{id}"} # type: ignore @distributed_trace_async async def delete( @@ -314,35 +377,43 @@ async def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( id=id, subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/assets/{id}'} # type: ignore - + delete.metadata = {"url": "/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/assets/{id}"} # type: ignore @distributed_trace_async async def query_by_id( @@ -368,36 +439,44 @@ async def query_by_id( :rtype: ~azure.mgmt.machinelearningservices.models.Asset :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Asset"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Asset"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_query_by_id_request( id=id, subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.query_by_id.metadata['url'], + template_url=self.query_by_id.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Asset', pipeline_response) + deserialized = self._deserialize("Asset", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - query_by_id.metadata = {'url': '/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/assets/{id}'} # type: ignore - + query_by_id.metadata = {"url": "/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/assets/{id}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/aio/operations/_extensive_model_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/aio/operations/_extensive_model_operations.py index 6f821f49399b..ba8cd257101a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/aio/operations/_extensive_model_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/aio/operations/_extensive_model_operations.py @@ -9,7 +9,13 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,8 +25,15 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._extensive_model_operations import build_query_by_id_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ExtensiveModelOperations: """ExtensiveModelOperations async operations. @@ -68,36 +81,46 @@ async def query_by_id( :rtype: ~azure.mgmt.machinelearningservices.models.ExtensiveModel :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensiveModel"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ExtensiveModel"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_query_by_id_request( id=id, subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.query_by_id.metadata['url'], + template_url=self.query_by_id.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ExtensiveModel', pipeline_response) + deserialized = self._deserialize("ExtensiveModel", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - query_by_id.metadata = {'url': '/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/extensiveModels/{id}'} # type: ignore - + query_by_id.metadata = {"url": "/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/extensiveModels/{id}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/aio/operations/_migration_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/aio/operations/_migration_operations.py index b6c4b7e47f3c..531e68f8aa59 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/aio/operations/_migration_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/aio/operations/_migration_operations.py @@ -9,7 +9,13 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,8 +25,15 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._migration_operations import build_start_migration_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class MigrationOperations: """MigrationOperations async operations. @@ -68,32 +81,40 @@ async def start_migration( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_start_migration_request( migration=migration, timeout=timeout, collection_id=collection_id, workspace_id=workspace_id, - template_url=self.start_migration.metadata['url'], + template_url=self.start_migration.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - start_migration.metadata = {'url': '/modelregistry/v1.0/meta/migration'} # type: ignore - + start_migration.metadata = {"url": "/modelregistry/v1.0/meta/migration"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/aio/operations/_models_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/aio/operations/_models_operations.py index f666dcec5012..84fe758f9d03 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/aio/operations/_models_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/aio/operations/_models_operations.py @@ -9,7 +9,13 @@ from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -18,9 +24,28 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._models_operations import build_batch_get_resolved_uris_request, build_batch_query_request, build_create_unregistered_input_model_request, build_create_unregistered_output_model_request, build_delete_request, build_deployment_settings_request, build_list_query_post_request, build_list_request, build_patch_request, build_query_by_id_request, build_register_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._models_operations import ( + build_batch_get_resolved_uris_request, + build_batch_query_request, + build_create_unregistered_input_model_request, + build_create_unregistered_output_model_request, + build_delete_request, + build_deployment_settings_request, + build_list_query_post_request, + build_list_request, + build_patch_request, + build_query_by_id_request, + build_register_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ModelsOperations: """ModelsOperations async operations. @@ -71,24 +96,33 @@ async def register( :rtype: ~azure.mgmt.machinelearningservices.models.Model :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Model"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Model"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json-patch+json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json-patch+json" + ) # type: Optional[str] _json = None _content = None - if content_type.split(";")[0] in ['application/json', 'text/json']: - _json = self._serialize.body(body, 'Model') - elif content_type.split(";")[0] in ['application/json-patch+json', 'application/*+json']: - _json = self._serialize.body(body, 'Model') + if content_type.split(";")[0] in ["application/json", "text/json"]: + _json = self._serialize.body(body, "Model") + elif content_type.split(";")[0] in [ + "application/json-patch+json", + "application/*+json", + ]: + _json = self._serialize.body(body, "Model") else: raise ValueError( "The content_type '{}' is not one of the allowed values: " - "['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']".format(content_type) + "['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']".format( + content_type + ) ) request = build_register_request( @@ -99,27 +133,34 @@ async def register( json=_json, content=_content, auto_version=auto_version, - template_url=self.register.metadata['url'], + template_url=self.register.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Model', pipeline_response) + deserialized = self._deserialize("Model", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - register.metadata = {'url': '/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models'} # type: ignore - + register.metadata = {"url": "/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models"} # type: ignore @distributed_trace_async async def list( @@ -190,13 +231,16 @@ async def list( :rtype: ~azure.mgmt.machinelearningservices.models.ModelPagedResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelPagedResponse"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelPagedResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -217,27 +261,36 @@ async def list( latest_version_only=latest_version_only, feed=feed, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ModelPagedResponse', pipeline_response) + deserialized = self._deserialize( + "ModelPagedResponse", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': '/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models'} # type: ignore - + list.metadata = {"url": "/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models"} # type: ignore @distributed_trace_async async def create_unregistered_input_model( @@ -263,24 +316,37 @@ async def create_unregistered_input_model( :rtype: ~azure.mgmt.machinelearningservices.models.Model :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Model"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Model"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json-patch+json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json-patch+json" + ) # type: Optional[str] _json = None _content = None - if content_type.split(";")[0] in ['application/json', 'text/json']: - _json = self._serialize.body(body, 'CreateUnregisteredInputModelDto') - elif content_type.split(";")[0] in ['application/json-patch+json', 'application/*+json']: - _json = self._serialize.body(body, 'CreateUnregisteredInputModelDto') + if content_type.split(";")[0] in ["application/json", "text/json"]: + _json = self._serialize.body( + body, "CreateUnregisteredInputModelDto" + ) + elif content_type.split(";")[0] in [ + "application/json-patch+json", + "application/*+json", + ]: + _json = self._serialize.body( + body, "CreateUnregisteredInputModelDto" + ) else: raise ValueError( "The content_type '{}' is not one of the allowed values: " - "['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']".format(content_type) + "['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']".format( + content_type + ) ) request = build_create_unregistered_input_model_request( @@ -290,27 +356,34 @@ async def create_unregistered_input_model( content_type=content_type, json=_json, content=_content, - template_url=self.create_unregistered_input_model.metadata['url'], + template_url=self.create_unregistered_input_model.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Model', pipeline_response) + deserialized = self._deserialize("Model", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_unregistered_input_model.metadata = {'url': '/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/createUnregisteredInput'} # type: ignore - + create_unregistered_input_model.metadata = {"url": "/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/createUnregisteredInput"} # type: ignore @distributed_trace_async async def create_unregistered_output_model( @@ -336,24 +409,37 @@ async def create_unregistered_output_model( :rtype: ~azure.mgmt.machinelearningservices.models.Model :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Model"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Model"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json-patch+json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json-patch+json" + ) # type: Optional[str] _json = None _content = None - if content_type.split(";")[0] in ['application/json', 'text/json']: - _json = self._serialize.body(body, 'CreateUnregisteredOutputModelDto') - elif content_type.split(";")[0] in ['application/json-patch+json', 'application/*+json']: - _json = self._serialize.body(body, 'CreateUnregisteredOutputModelDto') + if content_type.split(";")[0] in ["application/json", "text/json"]: + _json = self._serialize.body( + body, "CreateUnregisteredOutputModelDto" + ) + elif content_type.split(";")[0] in [ + "application/json-patch+json", + "application/*+json", + ]: + _json = self._serialize.body( + body, "CreateUnregisteredOutputModelDto" + ) else: raise ValueError( "The content_type '{}' is not one of the allowed values: " - "['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']".format(content_type) + "['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']".format( + content_type + ) ) request = build_create_unregistered_output_model_request( @@ -363,27 +449,34 @@ async def create_unregistered_output_model( content_type=content_type, json=_json, content=_content, - template_url=self.create_unregistered_output_model.metadata['url'], + template_url=self.create_unregistered_output_model.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Model', pipeline_response) + deserialized = self._deserialize("Model", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_unregistered_output_model.metadata = {'url': '/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/createUnregisteredOutput'} # type: ignore - + create_unregistered_output_model.metadata = {"url": "/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/createUnregisteredOutput"} # type: ignore @distributed_trace_async async def batch_get_resolved_uris( @@ -409,26 +502,37 @@ async def batch_get_resolved_uris( :rtype: ~azure.mgmt.machinelearningservices.models.BatchModelPathResponseDto :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchModelPathResponseDto"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchModelPathResponseDto"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json-patch+json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json-patch+json" + ) # type: Optional[str] _json = None _content = None - if content_type.split(";")[0] in ['application/json', 'text/json']: + if content_type.split(";")[0] in ["application/json", "text/json"]: if body is not None: - _json = self._serialize.body(body, 'BatchGetResolvedUrisDto') - elif content_type.split(";")[0] in ['application/json-patch+json', 'application/*+json']: + _json = self._serialize.body(body, "BatchGetResolvedUrisDto") + elif content_type.split(";")[0] in [ + "application/json-patch+json", + "application/*+json", + ]: if body is not None: - _json = self._serialize.body(body, 'BatchGetResolvedUrisDto') + _json = self._serialize.body(body, "BatchGetResolvedUrisDto") else: raise ValueError( "The content_type '{}' is not one of the allowed values: " - "['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']".format(content_type) + "['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']".format( + content_type + ) ) request = build_batch_get_resolved_uris_request( @@ -438,27 +542,36 @@ async def batch_get_resolved_uris( content_type=content_type, json=_json, content=_content, - template_url=self.batch_get_resolved_uris.metadata['url'], + template_url=self.batch_get_resolved_uris.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchModelPathResponseDto', pipeline_response) + deserialized = self._deserialize( + "BatchModelPathResponseDto", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - batch_get_resolved_uris.metadata = {'url': '/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/batchGetResolvedUris'} # type: ignore - + batch_get_resolved_uris.metadata = {"url": "/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/batchGetResolvedUris"} # type: ignore @distributed_trace_async async def query_by_id( @@ -487,40 +600,48 @@ async def query_by_id( :rtype: ~azure.mgmt.machinelearningservices.models.Model :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Model"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Model"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_query_by_id_request( id=id, subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, include_deployment_settings=include_deployment_settings, - template_url=self.query_by_id.metadata['url'], + template_url=self.query_by_id.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Model', pipeline_response) + deserialized = self._deserialize("Model", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - query_by_id.metadata = {'url': '/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{id}'} # type: ignore - + query_by_id.metadata = {"url": "/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{id}"} # type: ignore @distributed_trace_async async def delete( @@ -546,35 +667,43 @@ async def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( id=id, subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{id}'} # type: ignore - + delete.metadata = {"url": "/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{id}"} # type: ignore @distributed_trace_async async def patch( @@ -603,24 +732,33 @@ async def patch( :rtype: ~azure.mgmt.machinelearningservices.models.Model :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Model"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Model"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json-patch+json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json-patch+json" + ) # type: Optional[str] _json = None _content = None - if content_type.split(";")[0] in ['application/json', 'text/json']: - _json = self._serialize.body(body, '[Operation]') - elif content_type.split(";")[0] in ['application/json-patch+json', 'application/*+json']: - _json = self._serialize.body(body, '[Operation]') + if content_type.split(";")[0] in ["application/json", "text/json"]: + _json = self._serialize.body(body, "[Operation]") + elif content_type.split(";")[0] in [ + "application/json-patch+json", + "application/*+json", + ]: + _json = self._serialize.body(body, "[Operation]") else: raise ValueError( "The content_type '{}' is not one of the allowed values: " - "['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']".format(content_type) + "['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']".format( + content_type + ) ) request = build_patch_request( @@ -631,27 +769,34 @@ async def patch( content_type=content_type, json=_json, content=_content, - template_url=self.patch.metadata['url'], + template_url=self.patch.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Model', pipeline_response) + deserialized = self._deserialize("Model", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - patch.metadata = {'url': '/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{id}'} # type: ignore - + patch.metadata = {"url": "/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{id}"} # type: ignore @distributed_trace_async async def list_query_post( @@ -677,26 +822,37 @@ async def list_query_post( :rtype: ~azure.mgmt.machinelearningservices.models.ModelListModelsRequestPagedResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelListModelsRequestPagedResponse"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelListModelsRequestPagedResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json-patch+json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json-patch+json" + ) # type: Optional[str] _json = None _content = None - if content_type.split(";")[0] in ['application/json', 'text/json']: + if content_type.split(";")[0] in ["application/json", "text/json"]: if body is not None: - _json = self._serialize.body(body, 'ListModelsRequest') - elif content_type.split(";")[0] in ['application/json-patch+json', 'application/*+json']: + _json = self._serialize.body(body, "ListModelsRequest") + elif content_type.split(";")[0] in [ + "application/json-patch+json", + "application/*+json", + ]: if body is not None: - _json = self._serialize.body(body, 'ListModelsRequest') + _json = self._serialize.body(body, "ListModelsRequest") else: raise ValueError( "The content_type '{}' is not one of the allowed values: " - "['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']".format(content_type) + "['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']".format( + content_type + ) ) request = build_list_query_post_request( @@ -706,27 +862,36 @@ async def list_query_post( content_type=content_type, json=_json, content=_content, - template_url=self.list_query_post.metadata['url'], + template_url=self.list_query_post.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ModelListModelsRequestPagedResponse', pipeline_response) + deserialized = self._deserialize( + "ModelListModelsRequestPagedResponse", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_query_post.metadata = {'url': '/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/list'} # type: ignore - + list_query_post.metadata = {"url": "/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/list"} # type: ignore @distributed_trace_async async def batch_query( @@ -752,26 +917,37 @@ async def batch_query( :rtype: ~azure.mgmt.machinelearningservices.models.ModelBatchResponseDto :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelBatchResponseDto"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelBatchResponseDto"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json-patch+json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json-patch+json" + ) # type: Optional[str] _json = None _content = None - if content_type.split(";")[0] in ['application/json', 'text/json']: + if content_type.split(";")[0] in ["application/json", "text/json"]: if body is not None: - _json = self._serialize.body(body, 'ModelBatchDto') - elif content_type.split(";")[0] in ['application/json-patch+json', 'application/*+json']: + _json = self._serialize.body(body, "ModelBatchDto") + elif content_type.split(";")[0] in [ + "application/json-patch+json", + "application/*+json", + ]: if body is not None: - _json = self._serialize.body(body, 'ModelBatchDto') + _json = self._serialize.body(body, "ModelBatchDto") else: raise ValueError( "The content_type '{}' is not one of the allowed values: " - "['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']".format(content_type) + "['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']".format( + content_type + ) ) request = build_batch_query_request( @@ -781,27 +957,36 @@ async def batch_query( content_type=content_type, json=_json, content=_content, - template_url=self.batch_query.metadata['url'], + template_url=self.batch_query.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ModelBatchResponseDto', pipeline_response) + deserialized = self._deserialize( + "ModelBatchResponseDto", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - batch_query.metadata = {'url': '/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/querybatch'} # type: ignore - + batch_query.metadata = {"url": "/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/querybatch"} # type: ignore @distributed_trace_async async def deployment_settings( @@ -827,26 +1012,35 @@ async def deployment_settings( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json-patch+json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json-patch+json" + ) # type: Optional[str] _json = None _content = None - if content_type.split(";")[0] in ['application/json', 'text/json']: + if content_type.split(";")[0] in ["application/json", "text/json"]: if body is not None: - _json = self._serialize.body(body, 'ModelSettingsIdentifiers') - elif content_type.split(";")[0] in ['application/json-patch+json', 'application/*+json']: + _json = self._serialize.body(body, "ModelSettingsIdentifiers") + elif content_type.split(";")[0] in [ + "application/json-patch+json", + "application/*+json", + ]: if body is not None: - _json = self._serialize.body(body, 'ModelSettingsIdentifiers') + _json = self._serialize.body(body, "ModelSettingsIdentifiers") else: raise ValueError( "The content_type '{}' is not one of the allowed values: " - "['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']".format(content_type) + "['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']".format( + content_type + ) ) request = build_deployment_settings_request( @@ -856,20 +1050,27 @@ async def deployment_settings( content_type=content_type, json=_json, content=_content, - template_url=self.deployment_settings.metadata['url'], + template_url=self.deployment_settings.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - deployment_settings.metadata = {'url': '/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/deploymentSettings'} # type: ignore - + deployment_settings.metadata = {"url": "/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/deploymentSettings"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/models/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/models/__init__.py index c54172dbe6cc..90fe2e498724 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/models/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/models/__init__.py @@ -119,61 +119,61 @@ ) __all__ = [ - 'Artifact', - 'Asset', - 'AssetDto', - 'AssetPaginatedResult', - 'BatchGetResolvedUrisDto', - 'BatchModelPathResponseDto', - 'BlobReference', - 'BlobReferenceForConsumptionDto', - 'ContainerResourceRequirements', - 'CreateUnregisteredInputModelDto', - 'CreateUnregisteredOutputModelDto', - 'CreatedBy', - 'CreationContext', - 'DataItem', - 'DataReferenceCredentialDto', - 'DataReferences', - 'DataReferencesForConsumptionDto', - 'DatasetReference', - 'DependencyMapDto', - 'DependencyMapItemDto', - 'DependentAsset', - 'DependentEntitiesDto', - 'ErrorResponse', - 'ExtensiveModel', - 'FeedIndexEntityDto', - 'FeedIndexEntityRequestDto', - 'ImageReference', - 'ImageReferenceForConsumptionDto', - 'IndexAnnotations', - 'IndexEntity', - 'IndexProperties', - 'InnerErrorDetails', - 'IntellectualPropertyPublisherInformation', - 'ListModelsRequest', - 'Model', - 'ModelBatchDto', - 'ModelBatchResponseDto', - 'ModelContainerRequest', - 'ModelDeploymentSettings', - 'ModelListModelsRequestPagedResponse', - 'ModelPagedResponse', - 'ModelPathResponseDto', - 'ModelSchema', - 'ModelSettingsIdentifiers', - 'Operation', - 'ProviderFeedEntityRequestDto', - 'Relationship', - 'ServiceResponseBase', - 'User', - 'ComputeEnvironmentType', - 'DeploymentType', - 'EntityKind', - 'ListViewType', - 'ModelFormatEnum', - 'ModelSchemaDataType', - 'OrderString', - 'WebServiceState', + "Artifact", + "Asset", + "AssetDto", + "AssetPaginatedResult", + "BatchGetResolvedUrisDto", + "BatchModelPathResponseDto", + "BlobReference", + "BlobReferenceForConsumptionDto", + "ContainerResourceRequirements", + "CreateUnregisteredInputModelDto", + "CreateUnregisteredOutputModelDto", + "CreatedBy", + "CreationContext", + "DataItem", + "DataReferenceCredentialDto", + "DataReferences", + "DataReferencesForConsumptionDto", + "DatasetReference", + "DependencyMapDto", + "DependencyMapItemDto", + "DependentAsset", + "DependentEntitiesDto", + "ErrorResponse", + "ExtensiveModel", + "FeedIndexEntityDto", + "FeedIndexEntityRequestDto", + "ImageReference", + "ImageReferenceForConsumptionDto", + "IndexAnnotations", + "IndexEntity", + "IndexProperties", + "InnerErrorDetails", + "IntellectualPropertyPublisherInformation", + "ListModelsRequest", + "Model", + "ModelBatchDto", + "ModelBatchResponseDto", + "ModelContainerRequest", + "ModelDeploymentSettings", + "ModelListModelsRequestPagedResponse", + "ModelPagedResponse", + "ModelPathResponseDto", + "ModelSchema", + "ModelSettingsIdentifiers", + "Operation", + "ProviderFeedEntityRequestDto", + "Relationship", + "ServiceResponseBase", + "User", + "ComputeEnvironmentType", + "DeploymentType", + "EntityKind", + "ListViewType", + "ModelFormatEnum", + "ModelSchemaDataType", + "OrderString", + "WebServiceState", ] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/models/_azure_machine_learning_workspaces_enums.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/models/_azure_machine_learning_workspaces_enums.py index f8290bfb4d76..a8025073aa10 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/models/_azure_machine_learning_workspaces_enums.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/models/_azure_machine_learning_workspaces_enums.py @@ -27,12 +27,14 @@ class ComputeEnvironmentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): BATCHAMLCOMPUTE = "BATCHAMLCOMPUTE" UNKNOWN = "UNKNOWN" + class DeploymentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): GRPC_REALTIME_ENDPOINT = "GRPCRealtimeEndpoint" HTTP_REALTIME_ENDPOINT = "HttpRealtimeEndpoint" BATCH = "Batch" + class EntityKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): INVALID = "Invalid" @@ -40,12 +42,14 @@ class EntityKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): VERSIONED = "Versioned" UNVERSIONED = "Unversioned" + class ListViewType(str, Enum, metaclass=CaseInsensitiveEnumMeta): ACTIVE_ONLY = "ActiveOnly" ARCHIVED_ONLY = "ArchivedOnly" ALL = "All" + class ModelFormatEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): CUSTOM = "CUSTOM" @@ -53,6 +57,7 @@ class ModelFormatEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): TRITON = "TRITON" PRESETS = "PRESETS" + class ModelSchemaDataType(str, Enum, metaclass=CaseInsensitiveEnumMeta): UNDEFINED = "undefined" @@ -73,6 +78,7 @@ class ModelSchemaDataType(str, Enum, metaclass=CaseInsensitiveEnumMeta): COMPLEX128 = "complex128" STRING = "string" + class OrderString(str, Enum, metaclass=CaseInsensitiveEnumMeta): CREATED_AT_DESC = "CreatedAtDesc" @@ -80,6 +86,7 @@ class OrderString(str, Enum, metaclass=CaseInsensitiveEnumMeta): UPDATED_AT_DESC = "UpdatedAtDesc" UPDATED_AT_ASC = "UpdatedAtAsc" + class WebServiceState(str, Enum, metaclass=CaseInsensitiveEnumMeta): TRANSITIONING = "Transitioning" diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/models/_models.py index fc90156b93a5..b0175745778c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/models/_models.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/models/_models.py @@ -19,14 +19,11 @@ class Artifact(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'prefix': {'key': 'prefix', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "prefix": {"key": "prefix", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword id: :paramtype id: str @@ -34,8 +31,8 @@ def __init__( :paramtype prefix: str """ super(Artifact, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.prefix = kwargs.get('prefix', None) + self.id = kwargs.get("id", None) + self.prefix = kwargs.get("prefix", None) class Asset(msrest.serialization.Model): @@ -68,27 +65,24 @@ class Asset(msrest.serialization.Model): """ _validation = { - 'name': {'required': True}, + "name": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'artifacts': {'key': 'artifacts', 'type': '[Artifact]'}, - 'kv_tags': {'key': 'kvTags', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'runid': {'key': 'runid', 'type': 'str'}, - 'projectid': {'key': 'projectid', 'type': 'str'}, - 'meta': {'key': 'meta', 'type': '{str}'}, - 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "artifacts": {"key": "artifacts", "type": "[Artifact]"}, + "kv_tags": {"key": "kvTags", "type": "{str}"}, + "properties": {"key": "properties", "type": "{str}"}, + "runid": {"key": "runid", "type": "str"}, + "projectid": {"key": "projectid", "type": "str"}, + "meta": {"key": "meta", "type": "{str}"}, + "created_time": {"key": "createdTime", "type": "iso-8601"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword id: :paramtype id: str @@ -114,17 +108,17 @@ def __init__( :paramtype created_time: ~datetime.datetime """ super(Asset, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.name = kwargs['name'] - self.type = kwargs.get('type', None) - self.description = kwargs.get('description', None) - self.artifacts = kwargs.get('artifacts', None) - self.kv_tags = kwargs.get('kv_tags', None) - self.properties = kwargs.get('properties', None) - self.runid = kwargs.get('runid', None) - self.projectid = kwargs.get('projectid', None) - self.meta = kwargs.get('meta', None) - self.created_time = kwargs.get('created_time', None) + self.id = kwargs.get("id", None) + self.name = kwargs["name"] + self.type = kwargs.get("type", None) + self.description = kwargs.get("description", None) + self.artifacts = kwargs.get("artifacts", None) + self.kv_tags = kwargs.get("kv_tags", None) + self.properties = kwargs.get("properties", None) + self.runid = kwargs.get("runid", None) + self.projectid = kwargs.get("projectid", None) + self.meta = kwargs.get("meta", None) + self.created_time = kwargs.get("created_time", None) class AssetDto(msrest.serialization.Model): @@ -148,19 +142,19 @@ class AssetDto(msrest.serialization.Model): """ _attribute_map = { - 'asset_id': {'key': 'assetId', 'type': 'str'}, - 'entity_id': {'key': 'entityId', 'type': 'str'}, - 'data_items': {'key': 'dataItems', 'type': '{DataItem}'}, - 'data_references': {'key': 'dataReferences', 'type': 'DataReferences'}, - 'should_index': {'key': 'shouldIndex', 'type': 'bool'}, - 'dependencies': {'key': 'dependencies', 'type': '[DependentAsset]'}, - 'intellectual_property_publisher_information': {'key': 'intellectualPropertyPublisherInformation', 'type': 'IntellectualPropertyPublisherInformation'}, + "asset_id": {"key": "assetId", "type": "str"}, + "entity_id": {"key": "entityId", "type": "str"}, + "data_items": {"key": "dataItems", "type": "{DataItem}"}, + "data_references": {"key": "dataReferences", "type": "DataReferences"}, + "should_index": {"key": "shouldIndex", "type": "bool"}, + "dependencies": {"key": "dependencies", "type": "[DependentAsset]"}, + "intellectual_property_publisher_information": { + "key": "intellectualPropertyPublisherInformation", + "type": "IntellectualPropertyPublisherInformation", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword asset_id: :paramtype asset_id: str @@ -179,13 +173,15 @@ def __init__( ~azure.mgmt.machinelearningservices.models.IntellectualPropertyPublisherInformation """ super(AssetDto, self).__init__(**kwargs) - self.asset_id = kwargs.get('asset_id', None) - self.entity_id = kwargs.get('entity_id', None) - self.data_items = kwargs.get('data_items', None) - self.data_references = kwargs.get('data_references', None) - self.should_index = kwargs.get('should_index', None) - self.dependencies = kwargs.get('dependencies', None) - self.intellectual_property_publisher_information = kwargs.get('intellectual_property_publisher_information', None) + self.asset_id = kwargs.get("asset_id", None) + self.entity_id = kwargs.get("entity_id", None) + self.data_items = kwargs.get("data_items", None) + self.data_references = kwargs.get("data_references", None) + self.should_index = kwargs.get("should_index", None) + self.dependencies = kwargs.get("dependencies", None) + self.intellectual_property_publisher_information = kwargs.get( + "intellectual_property_publisher_information", None + ) class AssetPaginatedResult(msrest.serialization.Model): @@ -200,15 +196,12 @@ class AssetPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[Asset]'}, - 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Asset]"}, + "continuation_token": {"key": "continuationToken", "type": "str"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: :paramtype value: list[~azure.mgmt.machinelearningservices.models.Asset] @@ -218,9 +211,9 @@ def __init__( :paramtype next_link: str """ super(AssetPaginatedResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.continuation_token = kwargs.get('continuation_token', None) - self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get("value", None) + self.continuation_token = kwargs.get("continuation_token", None) + self.next_link = kwargs.get("next_link", None) class BatchGetResolvedUrisDto(msrest.serialization.Model): @@ -231,19 +224,16 @@ class BatchGetResolvedUrisDto(msrest.serialization.Model): """ _attribute_map = { - 'values': {'key': 'values', 'type': '[str]'}, + "values": {"key": "values", "type": "[str]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword values: :paramtype values: list[str] """ super(BatchGetResolvedUrisDto, self).__init__(**kwargs) - self.values = kwargs.get('values', None) + self.values = kwargs.get("values", None) class BatchModelPathResponseDto(msrest.serialization.Model): @@ -254,19 +244,16 @@ class BatchModelPathResponseDto(msrest.serialization.Model): """ _attribute_map = { - 'values': {'key': 'values', 'type': '{ModelPathResponseDto}'}, + "values": {"key": "values", "type": "{ModelPathResponseDto}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword values: Dictionary of :code:``. :paramtype values: dict[str, ~azure.mgmt.machinelearningservices.models.ModelPathResponseDto] """ super(BatchModelPathResponseDto, self).__init__(**kwargs) - self.values = kwargs.get('values', None) + self.values = kwargs.get("values", None) class BlobReference(msrest.serialization.Model): @@ -279,14 +266,14 @@ class BlobReference(msrest.serialization.Model): """ _attribute_map = { - 'blob_uri': {'key': 'blobUri', 'type': 'str'}, - 'storage_account_arm_id': {'key': 'storageAccountArmId', 'type': 'str'}, + "blob_uri": {"key": "blobUri", "type": "str"}, + "storage_account_arm_id": { + "key": "storageAccountArmId", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword blob_uri: :paramtype blob_uri: str @@ -294,8 +281,10 @@ def __init__( :paramtype storage_account_arm_id: str """ super(BlobReference, self).__init__(**kwargs) - self.blob_uri = kwargs.get('blob_uri', None) - self.storage_account_arm_id = kwargs.get('storage_account_arm_id', None) + self.blob_uri = kwargs.get("blob_uri", None) + self.storage_account_arm_id = kwargs.get( + "storage_account_arm_id", None + ) class BlobReferenceForConsumptionDto(msrest.serialization.Model): @@ -310,15 +299,18 @@ class BlobReferenceForConsumptionDto(msrest.serialization.Model): """ _attribute_map = { - 'blob_uri': {'key': 'blobUri', 'type': 'str'}, - 'storage_account_arm_id': {'key': 'storageAccountArmId', 'type': 'str'}, - 'credential': {'key': 'credential', 'type': 'DataReferenceCredentialDto'}, + "blob_uri": {"key": "blobUri", "type": "str"}, + "storage_account_arm_id": { + "key": "storageAccountArmId", + "type": "str", + }, + "credential": { + "key": "credential", + "type": "DataReferenceCredentialDto", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword blob_uri: :paramtype blob_uri: str @@ -328,9 +320,11 @@ def __init__( :paramtype credential: ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialDto """ super(BlobReferenceForConsumptionDto, self).__init__(**kwargs) - self.blob_uri = kwargs.get('blob_uri', None) - self.storage_account_arm_id = kwargs.get('storage_account_arm_id', None) - self.credential = kwargs.get('credential', None) + self.blob_uri = kwargs.get("blob_uri", None) + self.storage_account_arm_id = kwargs.get( + "storage_account_arm_id", None + ) + self.credential = kwargs.get("credential", None) class ContainerResourceRequirements(msrest.serialization.Model): @@ -353,19 +347,16 @@ class ContainerResourceRequirements(msrest.serialization.Model): """ _attribute_map = { - 'cpu': {'key': 'cpu', 'type': 'float'}, - 'cpu_limit': {'key': 'cpuLimit', 'type': 'float'}, - 'memory_in_gb': {'key': 'memoryInGB', 'type': 'float'}, - 'memory_in_gb_limit': {'key': 'memoryInGBLimit', 'type': 'float'}, - 'gpu_enabled': {'key': 'gpuEnabled', 'type': 'bool'}, - 'gpu': {'key': 'gpu', 'type': 'int'}, - 'fpga': {'key': 'fpga', 'type': 'int'}, + "cpu": {"key": "cpu", "type": "float"}, + "cpu_limit": {"key": "cpuLimit", "type": "float"}, + "memory_in_gb": {"key": "memoryInGB", "type": "float"}, + "memory_in_gb_limit": {"key": "memoryInGBLimit", "type": "float"}, + "gpu_enabled": {"key": "gpuEnabled", "type": "bool"}, + "gpu": {"key": "gpu", "type": "int"}, + "fpga": {"key": "fpga", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword cpu: :paramtype cpu: float @@ -383,13 +374,13 @@ def __init__( :paramtype fpga: int """ super(ContainerResourceRequirements, self).__init__(**kwargs) - self.cpu = kwargs.get('cpu', None) - self.cpu_limit = kwargs.get('cpu_limit', None) - self.memory_in_gb = kwargs.get('memory_in_gb', None) - self.memory_in_gb_limit = kwargs.get('memory_in_gb_limit', None) - self.gpu_enabled = kwargs.get('gpu_enabled', None) - self.gpu = kwargs.get('gpu', None) - self.fpga = kwargs.get('fpga', None) + self.cpu = kwargs.get("cpu", None) + self.cpu_limit = kwargs.get("cpu_limit", None) + self.memory_in_gb = kwargs.get("memory_in_gb", None) + self.memory_in_gb_limit = kwargs.get("memory_in_gb_limit", None) + self.gpu_enabled = kwargs.get("gpu_enabled", None) + self.gpu = kwargs.get("gpu", None) + self.fpga = kwargs.get("fpga", None) class CreatedBy(msrest.serialization.Model): @@ -404,15 +395,12 @@ class CreatedBy(msrest.serialization.Model): """ _attribute_map = { - 'user_object_id': {'key': 'userObjectId', 'type': 'str'}, - 'user_tenant_id': {'key': 'userTenantId', 'type': 'str'}, - 'user_name': {'key': 'userName', 'type': 'str'}, + "user_object_id": {"key": "userObjectId", "type": "str"}, + "user_tenant_id": {"key": "userTenantId", "type": "str"}, + "user_name": {"key": "userName", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword user_object_id: :paramtype user_object_id: str @@ -422,9 +410,9 @@ def __init__( :paramtype user_name: str """ super(CreatedBy, self).__init__(**kwargs) - self.user_object_id = kwargs.get('user_object_id', None) - self.user_tenant_id = kwargs.get('user_tenant_id', None) - self.user_name = kwargs.get('user_name', None) + self.user_object_id = kwargs.get("user_object_id", None) + self.user_tenant_id = kwargs.get("user_tenant_id", None) + self.user_name = kwargs.get("user_name", None) class CreateUnregisteredInputModelDto(msrest.serialization.Model): @@ -441,16 +429,13 @@ class CreateUnregisteredInputModelDto(msrest.serialization.Model): """ _attribute_map = { - 'run_id': {'key': 'runId', 'type': 'str'}, - 'input_name': {'key': 'inputName', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + "run_id": {"key": "runId", "type": "str"}, + "input_name": {"key": "inputName", "type": "str"}, + "path": {"key": "path", "type": "str"}, + "type": {"key": "type", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword run_id: :paramtype run_id: str @@ -462,10 +447,10 @@ def __init__( :paramtype type: str """ super(CreateUnregisteredInputModelDto, self).__init__(**kwargs) - self.run_id = kwargs.get('run_id', None) - self.input_name = kwargs.get('input_name', None) - self.path = kwargs.get('path', None) - self.type = kwargs.get('type', None) + self.run_id = kwargs.get("run_id", None) + self.input_name = kwargs.get("input_name", None) + self.path = kwargs.get("path", None) + self.type = kwargs.get("type", None) class CreateUnregisteredOutputModelDto(msrest.serialization.Model): @@ -482,16 +467,13 @@ class CreateUnregisteredOutputModelDto(msrest.serialization.Model): """ _attribute_map = { - 'run_id': {'key': 'runId', 'type': 'str'}, - 'output_name': {'key': 'outputName', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + "run_id": {"key": "runId", "type": "str"}, + "output_name": {"key": "outputName", "type": "str"}, + "path": {"key": "path", "type": "str"}, + "type": {"key": "type", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword run_id: :paramtype run_id: str @@ -503,10 +485,10 @@ def __init__( :paramtype type: str """ super(CreateUnregisteredOutputModelDto, self).__init__(**kwargs) - self.run_id = kwargs.get('run_id', None) - self.output_name = kwargs.get('output_name', None) - self.path = kwargs.get('path', None) - self.type = kwargs.get('type', None) + self.run_id = kwargs.get("run_id", None) + self.output_name = kwargs.get("output_name", None) + self.path = kwargs.get("path", None) + self.type = kwargs.get("type", None) class CreationContext(msrest.serialization.Model): @@ -524,16 +506,13 @@ class CreationContext(msrest.serialization.Model): """ _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, - 'created_by': {'key': 'createdBy', 'type': 'CreatedBy'}, - 'creation_source': {'key': 'creationSource', 'type': 'str'}, + "additional_properties": {"key": "", "type": "{object}"}, + "created_time": {"key": "createdTime", "type": "iso-8601"}, + "created_by": {"key": "createdBy", "type": "CreatedBy"}, + "creation_source": {"key": "creationSource", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword additional_properties: Unmatched properties from the message are deserialized to this collection. @@ -546,10 +525,10 @@ def __init__( :paramtype creation_source: str """ super(CreationContext, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.created_time = kwargs.get('created_time', None) - self.created_by = kwargs.get('created_by', None) - self.creation_source = kwargs.get('creation_source', None) + self.additional_properties = kwargs.get("additional_properties", None) + self.created_time = kwargs.get("created_time", None) + self.created_by = kwargs.get("created_by", None) + self.creation_source = kwargs.get("creation_source", None) class DataItem(msrest.serialization.Model): @@ -560,19 +539,16 @@ class DataItem(msrest.serialization.Model): """ _attribute_map = { - 'data': {'key': 'data', 'type': 'object'}, + "data": {"key": "data", "type": "object"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data: Anything. :paramtype data: any """ super(DataItem, self).__init__(**kwargs) - self.data = kwargs.get('data', None) + self.data = kwargs.get("data", None) class DataReferenceCredentialDto(msrest.serialization.Model): @@ -586,14 +562,11 @@ class DataReferenceCredentialDto(msrest.serialization.Model): """ _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'credential_type': {'key': 'credentialType', 'type': 'str'}, + "additional_properties": {"key": "", "type": "{object}"}, + "credential_type": {"key": "credentialType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword additional_properties: Unmatched properties from the message are deserialized to this collection. @@ -602,8 +575,8 @@ def __init__( :paramtype credential_type: str """ super(DataReferenceCredentialDto, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.credential_type = kwargs.get('credential_type', None) + self.additional_properties = kwargs.get("additional_properties", None) + self.credential_type = kwargs.get("credential_type", None) class DataReferences(msrest.serialization.Model): @@ -617,14 +590,17 @@ class DataReferences(msrest.serialization.Model): """ _attribute_map = { - 'blob_references': {'key': 'blobReferences', 'type': '{BlobReference}'}, - 'image_registry_references': {'key': 'imageRegistryReferences', 'type': '{ImageReference}'}, + "blob_references": { + "key": "blobReferences", + "type": "{BlobReference}", + }, + "image_registry_references": { + "key": "imageRegistryReferences", + "type": "{ImageReference}", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword blob_references: Dictionary of :code:``. :paramtype blob_references: dict[str, ~azure.mgmt.machinelearningservices.models.BlobReference] @@ -633,8 +609,10 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ImageReference] """ super(DataReferences, self).__init__(**kwargs) - self.blob_references = kwargs.get('blob_references', None) - self.image_registry_references = kwargs.get('image_registry_references', None) + self.blob_references = kwargs.get("blob_references", None) + self.image_registry_references = kwargs.get( + "image_registry_references", None + ) class DataReferencesForConsumptionDto(msrest.serialization.Model): @@ -649,14 +627,17 @@ class DataReferencesForConsumptionDto(msrest.serialization.Model): """ _attribute_map = { - 'blob_references': {'key': 'blobReferences', 'type': '{BlobReferenceForConsumptionDto}'}, - 'image_registry_references': {'key': 'imageRegistryReferences', 'type': '{ImageReferenceForConsumptionDto}'}, + "blob_references": { + "key": "blobReferences", + "type": "{BlobReferenceForConsumptionDto}", + }, + "image_registry_references": { + "key": "imageRegistryReferences", + "type": "{ImageReferenceForConsumptionDto}", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword blob_references: Dictionary of :code:``. :paramtype blob_references: dict[str, @@ -666,8 +647,10 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ImageReferenceForConsumptionDto] """ super(DataReferencesForConsumptionDto, self).__init__(**kwargs) - self.blob_references = kwargs.get('blob_references', None) - self.image_registry_references = kwargs.get('image_registry_references', None) + self.blob_references = kwargs.get("blob_references", None) + self.image_registry_references = kwargs.get( + "image_registry_references", None + ) class DatasetReference(msrest.serialization.Model): @@ -680,14 +663,11 @@ class DatasetReference(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "id": {"key": "id", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: :paramtype name: str @@ -695,8 +675,8 @@ def __init__( :paramtype id: str """ super(DatasetReference, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.id = kwargs.get('id', None) + self.name = kwargs.get("name", None) + self.id = kwargs.get("id", None) class DependencyMapDto(msrest.serialization.Model): @@ -707,19 +687,19 @@ class DependencyMapDto(msrest.serialization.Model): """ _attribute_map = { - 'dependencies': {'key': 'dependencies', 'type': '[DependencyMapItemDto]'}, + "dependencies": { + "key": "dependencies", + "type": "[DependencyMapItemDto]", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword dependencies: :paramtype dependencies: list[~azure.mgmt.machinelearningservices.models.DependencyMapItemDto] """ super(DependencyMapDto, self).__init__(**kwargs) - self.dependencies = kwargs.get('dependencies', None) + self.dependencies = kwargs.get("dependencies", None) class DependencyMapItemDto(msrest.serialization.Model): @@ -732,14 +712,11 @@ class DependencyMapItemDto(msrest.serialization.Model): """ _attribute_map = { - 'source_id': {'key': 'sourceId', 'type': 'str'}, - 'destination_id': {'key': 'destinationId', 'type': 'str'}, + "source_id": {"key": "sourceId", "type": "str"}, + "destination_id": {"key": "destinationId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword source_id: :paramtype source_id: str @@ -747,8 +724,8 @@ def __init__( :paramtype destination_id: str """ super(DependencyMapItemDto, self).__init__(**kwargs) - self.source_id = kwargs.get('source_id', None) - self.destination_id = kwargs.get('destination_id', None) + self.source_id = kwargs.get("source_id", None) + self.destination_id = kwargs.get("destination_id", None) class DependentAsset(msrest.serialization.Model): @@ -759,19 +736,16 @@ class DependentAsset(msrest.serialization.Model): """ _attribute_map = { - 'asset_id': {'key': 'assetId', 'type': 'str'}, + "asset_id": {"key": "assetId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword asset_id: :paramtype asset_id: str """ super(DependentAsset, self).__init__(**kwargs) - self.asset_id = kwargs.get('asset_id', None) + self.asset_id = kwargs.get("asset_id", None) class DependentEntitiesDto(msrest.serialization.Model): @@ -784,14 +758,11 @@ class DependentEntitiesDto(msrest.serialization.Model): """ _attribute_map = { - 'asset_id': {'key': 'assetId', 'type': 'str'}, - 'dependencies': {'key': 'dependencies', 'type': '[DependentAsset]'}, + "asset_id": {"key": "assetId", "type": "str"}, + "dependencies": {"key": "dependencies", "type": "[DependentAsset]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword asset_id: :paramtype asset_id: str @@ -799,8 +770,8 @@ def __init__( :paramtype dependencies: list[~azure.mgmt.machinelearningservices.models.DependentAsset] """ super(DependentEntitiesDto, self).__init__(**kwargs) - self.asset_id = kwargs.get('asset_id', None) - self.dependencies = kwargs.get('dependencies', None) + self.asset_id = kwargs.get("asset_id", None) + self.dependencies = kwargs.get("dependencies", None) class ErrorResponse(msrest.serialization.Model): @@ -821,18 +792,15 @@ class ErrorResponse(msrest.serialization.Model): """ _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'status_code': {'key': 'statusCode', 'type': 'int'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[InnerErrorDetails]'}, - 'correlation': {'key': 'correlation', 'type': '{str}'}, + "code": {"key": "code", "type": "str"}, + "status_code": {"key": "statusCode", "type": "int"}, + "message": {"key": "message", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[InnerErrorDetails]"}, + "correlation": {"key": "correlation", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword code: :paramtype code: str @@ -848,12 +816,12 @@ def __init__( :paramtype correlation: dict[str, str] """ super(ErrorResponse, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.status_code = kwargs.get('status_code', None) - self.message = kwargs.get('message', None) - self.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - self.correlation = kwargs.get('correlation', None) + self.code = kwargs.get("code", None) + self.status_code = kwargs.get("status_code", None) + self.message = kwargs.get("message", None) + self.target = kwargs.get("target", None) + self.details = kwargs.get("details", None) + self.correlation = kwargs.get("correlation", None) class ExtensiveModel(msrest.serialization.Model): @@ -868,15 +836,15 @@ class ExtensiveModel(msrest.serialization.Model): """ _attribute_map = { - 'model': {'key': 'Model', 'type': 'Model'}, - 'service_list': {'key': 'ServiceList', 'type': '[ServiceResponseBase]'}, - 'asset_list': {'key': 'AssetList', 'type': '[Asset]'}, + "model": {"key": "Model", "type": "Model"}, + "service_list": { + "key": "ServiceList", + "type": "[ServiceResponseBase]", + }, + "asset_list": {"key": "AssetList", "type": "[Asset]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword model: :paramtype model: ~azure.mgmt.machinelearningservices.models.Model @@ -886,9 +854,9 @@ def __init__( :paramtype asset_list: list[~azure.mgmt.machinelearningservices.models.Asset] """ super(ExtensiveModel, self).__init__(**kwargs) - self.model = kwargs.get('model', None) - self.service_list = kwargs.get('service_list', None) - self.asset_list = kwargs.get('asset_list', None) + self.model = kwargs.get("model", None) + self.service_list = kwargs.get("service_list", None) + self.asset_list = kwargs.get("asset_list", None) class FeedIndexEntityDto(msrest.serialization.Model): @@ -903,15 +871,12 @@ class FeedIndexEntityDto(msrest.serialization.Model): """ _attribute_map = { - 'index_entity': {'key': 'indexEntity', 'type': 'IndexEntity'}, - 'schema_id': {'key': 'schemaId', 'type': 'str'}, - 'entity_schema': {'key': 'entitySchema', 'type': 'object'}, + "index_entity": {"key": "indexEntity", "type": "IndexEntity"}, + "schema_id": {"key": "schemaId", "type": "str"}, + "entity_schema": {"key": "entitySchema", "type": "object"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword index_entity: :paramtype index_entity: ~azure.mgmt.machinelearningservices.models.IndexEntity @@ -921,9 +886,9 @@ def __init__( :paramtype entity_schema: any """ super(FeedIndexEntityDto, self).__init__(**kwargs) - self.index_entity = kwargs.get('index_entity', None) - self.schema_id = kwargs.get('schema_id', None) - self.entity_schema = kwargs.get('entity_schema', None) + self.index_entity = kwargs.get("index_entity", None) + self.schema_id = kwargs.get("schema_id", None) + self.entity_schema = kwargs.get("entity_schema", None) class FeedIndexEntityRequestDto(msrest.serialization.Model): @@ -936,14 +901,14 @@ class FeedIndexEntityRequestDto(msrest.serialization.Model): """ _attribute_map = { - 'feed_entity': {'key': 'feedEntity', 'type': 'AssetDto'}, - 'label_to_version_mapping': {'key': 'labelToVersionMapping', 'type': '{str}'}, + "feed_entity": {"key": "feedEntity", "type": "AssetDto"}, + "label_to_version_mapping": { + "key": "labelToVersionMapping", + "type": "{str}", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword feed_entity: :paramtype feed_entity: ~azure.mgmt.machinelearningservices.models.AssetDto @@ -951,8 +916,10 @@ def __init__( :paramtype label_to_version_mapping: dict[str, str] """ super(FeedIndexEntityRequestDto, self).__init__(**kwargs) - self.feed_entity = kwargs.get('feed_entity', None) - self.label_to_version_mapping = kwargs.get('label_to_version_mapping', None) + self.feed_entity = kwargs.get("feed_entity", None) + self.label_to_version_mapping = kwargs.get( + "label_to_version_mapping", None + ) class ImageReference(msrest.serialization.Model): @@ -963,19 +930,21 @@ class ImageReference(msrest.serialization.Model): """ _attribute_map = { - 'image_registry_reference': {'key': 'imageRegistryReference', 'type': 'str'}, + "image_registry_reference": { + "key": "imageRegistryReference", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword image_registry_reference: :paramtype image_registry_reference: str """ super(ImageReference, self).__init__(**kwargs) - self.image_registry_reference = kwargs.get('image_registry_reference', None) + self.image_registry_reference = kwargs.get( + "image_registry_reference", None + ) class ImageReferenceForConsumptionDto(msrest.serialization.Model): @@ -988,14 +957,17 @@ class ImageReferenceForConsumptionDto(msrest.serialization.Model): """ _attribute_map = { - 'image_registry_reference': {'key': 'imageRegistryReference', 'type': 'str'}, - 'credential': {'key': 'credential', 'type': 'DataReferenceCredentialDto'}, + "image_registry_reference": { + "key": "imageRegistryReference", + "type": "str", + }, + "credential": { + "key": "credential", + "type": "DataReferenceCredentialDto", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword image_registry_reference: :paramtype image_registry_reference: str @@ -1003,8 +975,10 @@ def __init__( :paramtype credential: ~azure.mgmt.machinelearningservices.models.DataReferenceCredentialDto """ super(ImageReferenceForConsumptionDto, self).__init__(**kwargs) - self.image_registry_reference = kwargs.get('image_registry_reference', None) - self.credential = kwargs.get('credential', None) + self.image_registry_reference = kwargs.get( + "image_registry_reference", None + ) + self.credential = kwargs.get("credential", None) class IndexAnnotations(msrest.serialization.Model): @@ -1020,15 +994,12 @@ class IndexAnnotations(msrest.serialization.Model): """ _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'archived': {'key': 'archived', 'type': 'bool'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "additional_properties": {"key": "", "type": "{object}"}, + "archived": {"key": "archived", "type": "bool"}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword additional_properties: Unmatched properties from the message are deserialized to this collection. @@ -1039,9 +1010,9 @@ def __init__( :paramtype tags: dict[str, str] """ super(IndexAnnotations, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.archived = kwargs.get('archived', None) - self.tags = kwargs.get('tags', None) + self.additional_properties = kwargs.get("additional_properties", None) + self.archived = kwargs.get("archived", None) + self.tags = kwargs.get("tags", None) class IndexEntity(msrest.serialization.Model): @@ -1080,33 +1051,30 @@ class IndexEntity(msrest.serialization.Model): """ _validation = { - 'version': {'readonly': True}, - 'entity_container_id': {'readonly': True}, - 'entity_object_id': {'readonly': True}, - 'resource_type': {'readonly': True}, + "version": {"readonly": True}, + "entity_container_id": {"readonly": True}, + "entity_object_id": {"readonly": True}, + "resource_type": {"readonly": True}, } _attribute_map = { - 'schema_id': {'key': 'schemaId', 'type': 'str'}, - 'entity_id': {'key': 'entityId', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'annotations': {'key': 'annotations', 'type': 'IndexAnnotations'}, - 'properties': {'key': 'properties', 'type': 'IndexProperties'}, - 'internal': {'key': 'internal', 'type': '{object}'}, - 'update_sequence': {'key': 'updateSequence', 'type': 'long'}, - 'type': {'key': 'type', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - 'entity_container_id': {'key': 'entityContainerId', 'type': 'str'}, - 'entity_object_id': {'key': 'entityObjectId', 'type': 'str'}, - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'relationships': {'key': 'relationships', 'type': '[Relationship]'}, - 'asset_id': {'key': 'assetId', 'type': 'str'}, + "schema_id": {"key": "schemaId", "type": "str"}, + "entity_id": {"key": "entityId", "type": "str"}, + "kind": {"key": "kind", "type": "str"}, + "annotations": {"key": "annotations", "type": "IndexAnnotations"}, + "properties": {"key": "properties", "type": "IndexProperties"}, + "internal": {"key": "internal", "type": "{object}"}, + "update_sequence": {"key": "updateSequence", "type": "long"}, + "type": {"key": "type", "type": "str"}, + "version": {"key": "version", "type": "str"}, + "entity_container_id": {"key": "entityContainerId", "type": "str"}, + "entity_object_id": {"key": "entityObjectId", "type": "str"}, + "resource_type": {"key": "resourceType", "type": "str"}, + "relationships": {"key": "relationships", "type": "[Relationship]"}, + "asset_id": {"key": "assetId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword schema_id: :paramtype schema_id: str @@ -1130,20 +1098,20 @@ def __init__( :paramtype asset_id: str """ super(IndexEntity, self).__init__(**kwargs) - self.schema_id = kwargs.get('schema_id', None) - self.entity_id = kwargs.get('entity_id', None) - self.kind = kwargs.get('kind', None) - self.annotations = kwargs.get('annotations', None) - self.properties = kwargs.get('properties', None) - self.internal = kwargs.get('internal', None) - self.update_sequence = kwargs.get('update_sequence', None) - self.type = kwargs.get('type', None) + self.schema_id = kwargs.get("schema_id", None) + self.entity_id = kwargs.get("entity_id", None) + self.kind = kwargs.get("kind", None) + self.annotations = kwargs.get("annotations", None) + self.properties = kwargs.get("properties", None) + self.internal = kwargs.get("internal", None) + self.update_sequence = kwargs.get("update_sequence", None) + self.type = kwargs.get("type", None) self.version = None self.entity_container_id = None self.entity_object_id = None self.resource_type = None - self.relationships = kwargs.get('relationships', None) - self.asset_id = kwargs.get('asset_id', None) + self.relationships = kwargs.get("relationships", None) + self.asset_id = kwargs.get("asset_id", None) class IndexProperties(msrest.serialization.Model): @@ -1157,14 +1125,14 @@ class IndexProperties(msrest.serialization.Model): """ _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'creation_context': {'key': 'creationContext', 'type': 'CreationContext'}, + "additional_properties": {"key": "", "type": "{object}"}, + "creation_context": { + "key": "creationContext", + "type": "CreationContext", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword additional_properties: Unmatched properties from the message are deserialized to this collection. @@ -1173,8 +1141,8 @@ def __init__( :paramtype creation_context: ~azure.mgmt.machinelearningservices.models.CreationContext """ super(IndexProperties, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.creation_context = kwargs.get('creation_context', None) + self.additional_properties = kwargs.get("additional_properties", None) + self.creation_context = kwargs.get("creation_context", None) class InnerErrorDetails(msrest.serialization.Model): @@ -1189,15 +1157,12 @@ class InnerErrorDetails(msrest.serialization.Model): """ _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "target": {"key": "target", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword code: :paramtype code: str @@ -1207,9 +1172,9 @@ def __init__( :paramtype target: str """ super(InnerErrorDetails, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - self.target = kwargs.get('target', None) + self.code = kwargs.get("code", None) + self.message = kwargs.get("message", None) + self.target = kwargs.get("target", None) class IntellectualPropertyPublisherInformation(msrest.serialization.Model): @@ -1220,19 +1185,23 @@ class IntellectualPropertyPublisherInformation(msrest.serialization.Model): """ _attribute_map = { - 'intellectual_property_publisher': {'key': 'intellectualPropertyPublisher', 'type': 'str'}, + "intellectual_property_publisher": { + "key": "intellectualPropertyPublisher", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword intellectual_property_publisher: :paramtype intellectual_property_publisher: str """ - super(IntellectualPropertyPublisherInformation, self).__init__(**kwargs) - self.intellectual_property_publisher = kwargs.get('intellectual_property_publisher', None) + super(IntellectualPropertyPublisherInformation, self).__init__( + **kwargs + ) + self.intellectual_property_publisher = kwargs.get( + "intellectual_property_publisher", None + ) class ListModelsRequest(msrest.serialization.Model): @@ -1276,29 +1245,26 @@ class ListModelsRequest(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tag': {'key': 'tag', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - 'framework': {'key': 'framework', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'count': {'key': 'count', 'type': 'int'}, - 'offset': {'key': 'offset', 'type': 'int'}, - 'skip_token': {'key': 'skipToken', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'str'}, - 'run_id': {'key': 'runId', 'type': 'str'}, - 'dataset_id': {'key': 'datasetId', 'type': 'str'}, - 'order_by': {'key': 'orderBy', 'type': 'str'}, - 'latest_version_only': {'key': 'latestVersionOnly', 'type': 'bool'}, - 'modified_after': {'key': 'modifiedAfter', 'type': 'iso-8601'}, - 'modified_before': {'key': 'modifiedBefore', 'type': 'iso-8601'}, - 'list_view_type': {'key': 'listViewType', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "tag": {"key": "tag", "type": "str"}, + "version": {"key": "version", "type": "str"}, + "framework": {"key": "framework", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "count": {"key": "count", "type": "int"}, + "offset": {"key": "offset", "type": "int"}, + "skip_token": {"key": "skipToken", "type": "str"}, + "tags": {"key": "tags", "type": "str"}, + "properties": {"key": "properties", "type": "str"}, + "run_id": {"key": "runId", "type": "str"}, + "dataset_id": {"key": "datasetId", "type": "str"}, + "order_by": {"key": "orderBy", "type": "str"}, + "latest_version_only": {"key": "latestVersionOnly", "type": "bool"}, + "modified_after": {"key": "modifiedAfter", "type": "iso-8601"}, + "modified_before": {"key": "modifiedBefore", "type": "iso-8601"}, + "list_view_type": {"key": "listViewType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: :paramtype name: str @@ -1337,23 +1303,23 @@ def __init__( :paramtype list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType """ super(ListModelsRequest, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.tag = kwargs.get('tag', None) - self.version = kwargs.get('version', None) - self.framework = kwargs.get('framework', None) - self.description = kwargs.get('description', None) - self.count = kwargs.get('count', None) - self.offset = kwargs.get('offset', None) - self.skip_token = kwargs.get('skip_token', None) - self.tags = kwargs.get('tags', None) - self.properties = kwargs.get('properties', None) - self.run_id = kwargs.get('run_id', None) - self.dataset_id = kwargs.get('dataset_id', None) - self.order_by = kwargs.get('order_by', None) - self.latest_version_only = kwargs.get('latest_version_only', None) - self.modified_after = kwargs.get('modified_after', None) - self.modified_before = kwargs.get('modified_before', None) - self.list_view_type = kwargs.get('list_view_type', None) + self.name = kwargs.get("name", None) + self.tag = kwargs.get("tag", None) + self.version = kwargs.get("version", None) + self.framework = kwargs.get("framework", None) + self.description = kwargs.get("description", None) + self.count = kwargs.get("count", None) + self.offset = kwargs.get("offset", None) + self.skip_token = kwargs.get("skip_token", None) + self.tags = kwargs.get("tags", None) + self.properties = kwargs.get("properties", None) + self.run_id = kwargs.get("run_id", None) + self.dataset_id = kwargs.get("dataset_id", None) + self.order_by = kwargs.get("order_by", None) + self.latest_version_only = kwargs.get("latest_version_only", None) + self.modified_after = kwargs.get("modified_after", None) + self.modified_before = kwargs.get("modified_before", None) + self.list_view_type = kwargs.get("list_view_type", None) class Model(msrest.serialization.Model): @@ -1443,55 +1409,58 @@ class Model(msrest.serialization.Model): """ _validation = { - 'name': {'required': True}, - 'mime_type': {'required': True}, + "name": {"required": True}, + "mime_type": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'framework': {'key': 'framework', 'type': 'str'}, - 'framework_version': {'key': 'frameworkVersion', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'long'}, - 'tags': {'key': 'tags', 'type': '[str]'}, - 'datasets': {'key': 'datasets', 'type': '[DatasetReference]'}, - 'url': {'key': 'url', 'type': 'str'}, - 'mime_type': {'key': 'mimeType', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, - 'modified_time': {'key': 'modifiedTime', 'type': 'iso-8601'}, - 'unpack': {'key': 'unpack', 'type': 'bool'}, - 'parent_model_id': {'key': 'parentModelId', 'type': 'str'}, - 'run_id': {'key': 'runId', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'kv_tags': {'key': 'kvTags', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'derived_model_ids': {'key': 'derivedModelIds', 'type': '[str]'}, - 'inputs_schema': {'key': 'inputsSchema', 'type': '[ModelSchema]'}, - 'outputs_schema': {'key': 'outputsSchema', 'type': '[ModelSchema]'}, - 'sample_input_data': {'key': 'sampleInputData', 'type': 'str'}, - 'sample_output_data': {'key': 'sampleOutputData', 'type': 'str'}, - 'resource_requirements': {'key': 'resourceRequirements', 'type': 'ContainerResourceRequirements'}, - 'created_by': {'key': 'createdBy', 'type': 'User'}, - 'modified_by': {'key': 'modifiedBy', 'type': 'User'}, - 'flavors': {'key': 'flavors', 'type': '{{str}}'}, - 'model_format': {'key': 'modelFormat', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - 'model_container_id': {'key': 'modelContainerId', 'type': 'str'}, - 'mms_id': {'key': 'mmsId', 'type': 'str'}, - 'default_deployment_settings': {'key': 'defaultDeploymentSettings', 'type': 'ModelDeploymentSettings'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'is_registered': {'key': 'isRegistered', 'type': 'bool'}, - 'data_path': {'key': 'dataPath', 'type': 'str'}, - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'asset_id': {'key': 'assetId', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "framework": {"key": "framework", "type": "str"}, + "framework_version": {"key": "frameworkVersion", "type": "str"}, + "version": {"key": "version", "type": "long"}, + "tags": {"key": "tags", "type": "[str]"}, + "datasets": {"key": "datasets", "type": "[DatasetReference]"}, + "url": {"key": "url", "type": "str"}, + "mime_type": {"key": "mimeType", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_time": {"key": "createdTime", "type": "iso-8601"}, + "modified_time": {"key": "modifiedTime", "type": "iso-8601"}, + "unpack": {"key": "unpack", "type": "bool"}, + "parent_model_id": {"key": "parentModelId", "type": "str"}, + "run_id": {"key": "runId", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "kv_tags": {"key": "kvTags", "type": "{str}"}, + "properties": {"key": "properties", "type": "{str}"}, + "derived_model_ids": {"key": "derivedModelIds", "type": "[str]"}, + "inputs_schema": {"key": "inputsSchema", "type": "[ModelSchema]"}, + "outputs_schema": {"key": "outputsSchema", "type": "[ModelSchema]"}, + "sample_input_data": {"key": "sampleInputData", "type": "str"}, + "sample_output_data": {"key": "sampleOutputData", "type": "str"}, + "resource_requirements": { + "key": "resourceRequirements", + "type": "ContainerResourceRequirements", + }, + "created_by": {"key": "createdBy", "type": "User"}, + "modified_by": {"key": "modifiedBy", "type": "User"}, + "flavors": {"key": "flavors", "type": "{{str}}"}, + "model_format": {"key": "modelFormat", "type": "str"}, + "stage": {"key": "stage", "type": "str"}, + "model_container_id": {"key": "modelContainerId", "type": "str"}, + "mms_id": {"key": "mmsId", "type": "str"}, + "default_deployment_settings": { + "key": "defaultDeploymentSettings", + "type": "ModelDeploymentSettings", + }, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "is_registered": {"key": "isRegistered", "type": "bool"}, + "data_path": {"key": "dataPath", "type": "str"}, + "model_type": {"key": "modelType", "type": "str"}, + "asset_id": {"key": "assetId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword id: :paramtype id: str @@ -1574,44 +1543,46 @@ def __init__( :paramtype asset_id: str """ super(Model, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.name = kwargs['name'] - self.framework = kwargs.get('framework', None) - self.framework_version = kwargs.get('framework_version', None) - self.version = kwargs.get('version', None) - self.tags = kwargs.get('tags', None) - self.datasets = kwargs.get('datasets', None) - self.url = kwargs.get('url', None) - self.mime_type = kwargs['mime_type'] - self.description = kwargs.get('description', None) - self.created_time = kwargs.get('created_time', None) - self.modified_time = kwargs.get('modified_time', None) - self.unpack = kwargs.get('unpack', None) - self.parent_model_id = kwargs.get('parent_model_id', None) - self.run_id = kwargs.get('run_id', None) - self.experiment_name = kwargs.get('experiment_name', None) - self.kv_tags = kwargs.get('kv_tags', None) - self.properties = kwargs.get('properties', None) - self.derived_model_ids = kwargs.get('derived_model_ids', None) - self.inputs_schema = kwargs.get('inputs_schema', None) - self.outputs_schema = kwargs.get('outputs_schema', None) - self.sample_input_data = kwargs.get('sample_input_data', None) - self.sample_output_data = kwargs.get('sample_output_data', None) - self.resource_requirements = kwargs.get('resource_requirements', None) - self.created_by = kwargs.get('created_by', None) - self.modified_by = kwargs.get('modified_by', None) - self.flavors = kwargs.get('flavors', None) - self.model_format = kwargs.get('model_format', None) - self.stage = kwargs.get('stage', None) - self.model_container_id = kwargs.get('model_container_id', None) - self.mms_id = kwargs.get('mms_id', None) - self.default_deployment_settings = kwargs.get('default_deployment_settings', None) - self.is_anonymous = kwargs.get('is_anonymous', None) - self.is_archived = kwargs.get('is_archived', None) - self.is_registered = kwargs.get('is_registered', None) - self.data_path = kwargs.get('data_path', None) - self.model_type = kwargs.get('model_type', None) - self.asset_id = kwargs.get('asset_id', None) + self.id = kwargs.get("id", None) + self.name = kwargs["name"] + self.framework = kwargs.get("framework", None) + self.framework_version = kwargs.get("framework_version", None) + self.version = kwargs.get("version", None) + self.tags = kwargs.get("tags", None) + self.datasets = kwargs.get("datasets", None) + self.url = kwargs.get("url", None) + self.mime_type = kwargs["mime_type"] + self.description = kwargs.get("description", None) + self.created_time = kwargs.get("created_time", None) + self.modified_time = kwargs.get("modified_time", None) + self.unpack = kwargs.get("unpack", None) + self.parent_model_id = kwargs.get("parent_model_id", None) + self.run_id = kwargs.get("run_id", None) + self.experiment_name = kwargs.get("experiment_name", None) + self.kv_tags = kwargs.get("kv_tags", None) + self.properties = kwargs.get("properties", None) + self.derived_model_ids = kwargs.get("derived_model_ids", None) + self.inputs_schema = kwargs.get("inputs_schema", None) + self.outputs_schema = kwargs.get("outputs_schema", None) + self.sample_input_data = kwargs.get("sample_input_data", None) + self.sample_output_data = kwargs.get("sample_output_data", None) + self.resource_requirements = kwargs.get("resource_requirements", None) + self.created_by = kwargs.get("created_by", None) + self.modified_by = kwargs.get("modified_by", None) + self.flavors = kwargs.get("flavors", None) + self.model_format = kwargs.get("model_format", None) + self.stage = kwargs.get("stage", None) + self.model_container_id = kwargs.get("model_container_id", None) + self.mms_id = kwargs.get("mms_id", None) + self.default_deployment_settings = kwargs.get( + "default_deployment_settings", None + ) + self.is_anonymous = kwargs.get("is_anonymous", None) + self.is_archived = kwargs.get("is_archived", None) + self.is_registered = kwargs.get("is_registered", None) + self.data_path = kwargs.get("data_path", None) + self.model_type = kwargs.get("model_type", None) + self.asset_id = kwargs.get("asset_id", None) class ModelBatchDto(msrest.serialization.Model): @@ -1622,19 +1593,16 @@ class ModelBatchDto(msrest.serialization.Model): """ _attribute_map = { - 'model_ids': {'key': 'modelIds', 'type': '[str]'}, + "model_ids": {"key": "modelIds", "type": "[str]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword model_ids: :paramtype model_ids: list[str] """ super(ModelBatchDto, self).__init__(**kwargs) - self.model_ids = kwargs.get('model_ids', None) + self.model_ids = kwargs.get("model_ids", None) class ModelBatchResponseDto(msrest.serialization.Model): @@ -1645,19 +1613,16 @@ class ModelBatchResponseDto(msrest.serialization.Model): """ _attribute_map = { - 'models': {'key': 'models', 'type': '{Model}'}, + "models": {"key": "models", "type": "{Model}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword models: Dictionary of :code:``. :paramtype models: dict[str, ~azure.mgmt.machinelearningservices.models.Model] """ super(ModelBatchResponseDto, self).__init__(**kwargs) - self.models = kwargs.get('models', None) + self.models = kwargs.get("models", None) class ModelContainerRequest(msrest.serialization.Model): @@ -1678,21 +1643,18 @@ class ModelContainerRequest(msrest.serialization.Model): """ _validation = { - 'name': {'required': True}, + "name": {"required": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'kv_tags': {'key': 'kvTags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'is_registered': {'key': 'isRegistered', 'type': 'bool'}, + "name": {"key": "name", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "kv_tags": {"key": "kvTags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "is_registered": {"key": "isRegistered", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: Required. :paramtype name: str @@ -1706,11 +1668,11 @@ def __init__( :paramtype is_registered: bool """ super(ModelContainerRequest, self).__init__(**kwargs) - self.name = kwargs['name'] - self.description = kwargs.get('description', None) - self.kv_tags = kwargs.get('kv_tags', None) - self.is_archived = kwargs.get('is_archived', None) - self.is_registered = kwargs.get('is_registered', None) + self.name = kwargs["name"] + self.description = kwargs.get("description", None) + self.kv_tags = kwargs.get("kv_tags", None) + self.is_archived = kwargs.get("is_archived", None) + self.is_registered = kwargs.get("is_registered", None) class ModelDeploymentSettings(msrest.serialization.Model): @@ -1729,20 +1691,17 @@ class ModelDeploymentSettings(msrest.serialization.Model): """ _validation = { - 'model_format': {'required': True}, + "model_format": {"required": True}, } _attribute_map = { - 'model_format': {'key': 'modelFormat', 'type': 'str'}, - 'model_name': {'key': 'ModelName', 'type': 'str'}, - 'model_version': {'key': 'ModelVersion', 'type': 'str'}, - 'model_type': {'key': 'ModelType', 'type': 'str'}, + "model_format": {"key": "modelFormat", "type": "str"}, + "model_name": {"key": "ModelName", "type": "str"}, + "model_version": {"key": "ModelVersion", "type": "str"}, + "model_type": {"key": "ModelType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword model_format: Required. Possible values include: "CUSTOM", "MLFLOW", "TRITON", "PRESETS". @@ -1755,10 +1714,10 @@ def __init__( :paramtype model_type: str """ super(ModelDeploymentSettings, self).__init__(**kwargs) - self.model_format = kwargs['model_format'] - self.model_name = kwargs.get('model_name', None) - self.model_version = kwargs.get('model_version', None) - self.model_type = kwargs.get('model_type', None) + self.model_format = kwargs["model_format"] + self.model_name = kwargs.get("model_name", None) + self.model_version = kwargs.get("model_version", None) + self.model_type = kwargs.get("model_type", None) class ModelListModelsRequestPagedResponse(msrest.serialization.Model): @@ -1775,16 +1734,13 @@ class ModelListModelsRequestPagedResponse(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[Model]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, - 'next_request': {'key': 'nextRequest', 'type': 'ListModelsRequest'}, + "value": {"key": "value", "type": "[Model]"}, + "next_link": {"key": "nextLink", "type": "str"}, + "continuation_token": {"key": "continuationToken", "type": "str"}, + "next_request": {"key": "nextRequest", "type": "ListModelsRequest"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: :paramtype value: list[~azure.mgmt.machinelearningservices.models.Model] @@ -1796,10 +1752,10 @@ def __init__( :paramtype next_request: ~azure.mgmt.machinelearningservices.models.ListModelsRequest """ super(ModelListModelsRequestPagedResponse, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - self.continuation_token = kwargs.get('continuation_token', None) - self.next_request = kwargs.get('next_request', None) + self.value = kwargs.get("value", None) + self.next_link = kwargs.get("next_link", None) + self.continuation_token = kwargs.get("continuation_token", None) + self.next_request = kwargs.get("next_request", None) class ModelPagedResponse(msrest.serialization.Model): @@ -1814,15 +1770,12 @@ class ModelPagedResponse(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[Model]'}, - 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Model]"}, + "continuation_token": {"key": "continuationToken", "type": "str"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: :paramtype value: list[~azure.mgmt.machinelearningservices.models.Model] @@ -1832,9 +1785,9 @@ def __init__( :paramtype next_link: str """ super(ModelPagedResponse, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.continuation_token = kwargs.get('continuation_token', None) - self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get("value", None) + self.continuation_token = kwargs.get("continuation_token", None) + self.next_link = kwargs.get("next_link", None) class ModelPathResponseDto(msrest.serialization.Model): @@ -1847,14 +1800,11 @@ class ModelPathResponseDto(msrest.serialization.Model): """ _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + "path": {"key": "path", "type": "str"}, + "type": {"key": "type", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword path: :paramtype path: str @@ -1862,8 +1812,8 @@ def __init__( :paramtype type: str """ super(ModelPathResponseDto, self).__init__(**kwargs) - self.path = kwargs.get('path', None) - self.type = kwargs.get('type', None) + self.path = kwargs.get("path", None) + self.type = kwargs.get("type", None) class ModelSchema(msrest.serialization.Model): @@ -1882,19 +1832,16 @@ class ModelSchema(msrest.serialization.Model): """ _validation = { - 'name': {'required': True}, + "name": {"required": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'shape': {'key': 'shape', 'type': '[int]'}, + "name": {"key": "name", "type": "str"}, + "data_type": {"key": "dataType", "type": "str"}, + "shape": {"key": "shape", "type": "[int]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: Required. :paramtype name: str @@ -1906,9 +1853,9 @@ def __init__( :paramtype shape: list[int] """ super(ModelSchema, self).__init__(**kwargs) - self.name = kwargs['name'] - self.data_type = kwargs.get('data_type', None) - self.shape = kwargs.get('shape', None) + self.name = kwargs["name"] + self.data_type = kwargs.get("data_type", None) + self.shape = kwargs.get("shape", None) class ModelSettingsIdentifiers(msrest.serialization.Model): @@ -1921,14 +1868,11 @@ class ModelSettingsIdentifiers(msrest.serialization.Model): """ _attribute_map = { - 'model_id': {'key': 'modelId', 'type': 'str'}, - 'engine_id': {'key': 'engineId', 'type': 'str'}, + "model_id": {"key": "modelId", "type": "str"}, + "engine_id": {"key": "engineId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword model_id: :paramtype model_id: str @@ -1936,8 +1880,8 @@ def __init__( :paramtype engine_id: str """ super(ModelSettingsIdentifiers, self).__init__(**kwargs) - self.model_id = kwargs.get('model_id', None) - self.engine_id = kwargs.get('engine_id', None) + self.model_id = kwargs.get("model_id", None) + self.engine_id = kwargs.get("engine_id", None) class Operation(msrest.serialization.Model): @@ -1954,16 +1898,13 @@ class Operation(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': 'object'}, - 'path': {'key': 'path', 'type': 'str'}, - 'op': {'key': 'op', 'type': 'str'}, - 'from_property': {'key': 'from', 'type': 'str'}, + "value": {"key": "value", "type": "object"}, + "path": {"key": "path", "type": "str"}, + "op": {"key": "op", "type": "str"}, + "from_property": {"key": "from", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Anything. :paramtype value: any @@ -1975,10 +1916,10 @@ def __init__( :paramtype from_property: str """ super(Operation, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.path = kwargs.get('path', None) - self.op = kwargs.get('op', None) - self.from_property = kwargs.get('from_property', None) + self.value = kwargs.get("value", None) + self.path = kwargs.get("path", None) + self.op = kwargs.get("op", None) + self.from_property = kwargs.get("from_property", None) class ProviderFeedEntityRequestDto(msrest.serialization.Model): @@ -1994,15 +1935,21 @@ class ProviderFeedEntityRequestDto(msrest.serialization.Model): """ _attribute_map = { - 'source_and_target_asset_ids': {'key': 'sourceAndTargetAssetIds', 'type': 'DependencyMapItemDto'}, - 'dependency_map_dto': {'key': 'dependencyMapDto', 'type': 'DependencyMapDto'}, - 'label_to_version_mapping': {'key': 'labelToVersionMapping', 'type': '{str}'}, + "source_and_target_asset_ids": { + "key": "sourceAndTargetAssetIds", + "type": "DependencyMapItemDto", + }, + "dependency_map_dto": { + "key": "dependencyMapDto", + "type": "DependencyMapDto", + }, + "label_to_version_mapping": { + "key": "labelToVersionMapping", + "type": "{str}", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword source_and_target_asset_ids: :paramtype source_and_target_asset_ids: @@ -2013,9 +1960,13 @@ def __init__( :paramtype label_to_version_mapping: dict[str, str] """ super(ProviderFeedEntityRequestDto, self).__init__(**kwargs) - self.source_and_target_asset_ids = kwargs.get('source_and_target_asset_ids', None) - self.dependency_map_dto = kwargs.get('dependency_map_dto', None) - self.label_to_version_mapping = kwargs.get('label_to_version_mapping', None) + self.source_and_target_asset_ids = kwargs.get( + "source_and_target_asset_ids", None + ) + self.dependency_map_dto = kwargs.get("dependency_map_dto", None) + self.label_to_version_mapping = kwargs.get( + "label_to_version_mapping", None + ) class Relationship(msrest.serialization.Model): @@ -2041,24 +1992,21 @@ class Relationship(msrest.serialization.Model): """ _validation = { - 'entity_type': {'readonly': True}, - 'entity_container_id': {'readonly': True}, + "entity_type": {"readonly": True}, + "entity_container_id": {"readonly": True}, } _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'relation_type': {'key': 'relationType', 'type': 'str'}, - 'target_entity_id': {'key': 'targetEntityId', 'type': 'str'}, - 'asset_id': {'key': 'assetId', 'type': 'str'}, - 'entity_type': {'key': 'entityType', 'type': 'str'}, - 'direction': {'key': 'direction', 'type': 'str'}, - 'entity_container_id': {'key': 'entityContainerId', 'type': 'str'}, + "additional_properties": {"key": "", "type": "{object}"}, + "relation_type": {"key": "relationType", "type": "str"}, + "target_entity_id": {"key": "targetEntityId", "type": "str"}, + "asset_id": {"key": "assetId", "type": "str"}, + "entity_type": {"key": "entityType", "type": "str"}, + "direction": {"key": "direction", "type": "str"}, + "entity_container_id": {"key": "entityContainerId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword additional_properties: Unmatched properties from the message are deserialized to this collection. @@ -2073,12 +2021,12 @@ def __init__( :paramtype direction: str """ super(Relationship, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.relation_type = kwargs.get('relation_type', None) - self.target_entity_id = kwargs.get('target_entity_id', None) - self.asset_id = kwargs.get('asset_id', None) + self.additional_properties = kwargs.get("additional_properties", None) + self.relation_type = kwargs.get("relation_type", None) + self.target_entity_id = kwargs.get("target_entity_id", None) + self.asset_id = kwargs.get("asset_id", None) self.entity_type = None - self.direction = kwargs.get('direction', None) + self.direction = kwargs.get("direction", None) self.entity_container_id = None @@ -2122,27 +2070,24 @@ class ServiceResponseBase(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '[str]'}, - 'kv_tags': {'key': 'kvTags', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'operation_id': {'key': 'operationId', 'type': 'str'}, - 'state': {'key': 'state', 'type': 'str'}, - 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, - 'updated_time': {'key': 'updatedTime', 'type': 'iso-8601'}, - 'error': {'key': 'error', 'type': 'ErrorResponse'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'deployment_type': {'key': 'deploymentType', 'type': 'str'}, - 'created_by': {'key': 'createdBy', 'type': 'User'}, - 'endpoint_name': {'key': 'endpointName', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "tags": {"key": "tags", "type": "[str]"}, + "kv_tags": {"key": "kvTags", "type": "{str}"}, + "properties": {"key": "properties", "type": "{str}"}, + "operation_id": {"key": "operationId", "type": "str"}, + "state": {"key": "state", "type": "str"}, + "created_time": {"key": "createdTime", "type": "iso-8601"}, + "updated_time": {"key": "updatedTime", "type": "iso-8601"}, + "error": {"key": "error", "type": "ErrorResponse"}, + "compute_type": {"key": "computeType", "type": "str"}, + "deployment_type": {"key": "deploymentType", "type": "str"}, + "created_by": {"key": "createdBy", "type": "User"}, + "endpoint_name": {"key": "endpointName", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword id: :paramtype id: str @@ -2181,21 +2126,21 @@ def __init__( :paramtype endpoint_name: str """ super(ServiceResponseBase, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.name = kwargs.get('name', None) - self.description = kwargs.get('description', None) - self.tags = kwargs.get('tags', None) - self.kv_tags = kwargs.get('kv_tags', None) - self.properties = kwargs.get('properties', None) - self.operation_id = kwargs.get('operation_id', None) - self.state = kwargs.get('state', None) - self.created_time = kwargs.get('created_time', None) - self.updated_time = kwargs.get('updated_time', None) - self.error = kwargs.get('error', None) - self.compute_type = kwargs.get('compute_type', None) - self.deployment_type = kwargs.get('deployment_type', None) - self.created_by = kwargs.get('created_by', None) - self.endpoint_name = kwargs.get('endpoint_name', None) + self.id = kwargs.get("id", None) + self.name = kwargs.get("name", None) + self.description = kwargs.get("description", None) + self.tags = kwargs.get("tags", None) + self.kv_tags = kwargs.get("kv_tags", None) + self.properties = kwargs.get("properties", None) + self.operation_id = kwargs.get("operation_id", None) + self.state = kwargs.get("state", None) + self.created_time = kwargs.get("created_time", None) + self.updated_time = kwargs.get("updated_time", None) + self.error = kwargs.get("error", None) + self.compute_type = kwargs.get("compute_type", None) + self.deployment_type = kwargs.get("deployment_type", None) + self.created_by = kwargs.get("created_by", None) + self.endpoint_name = kwargs.get("endpoint_name", None) class User(msrest.serialization.Model): @@ -2220,20 +2165,17 @@ class User(msrest.serialization.Model): """ _attribute_map = { - 'user_object_id': {'key': 'userObjectId', 'type': 'str'}, - 'user_pu_id': {'key': 'userPuId', 'type': 'str'}, - 'user_idp': {'key': 'userIdp', 'type': 'str'}, - 'user_alt_sec_id': {'key': 'userAltSecId', 'type': 'str'}, - 'user_iss': {'key': 'userIss', 'type': 'str'}, - 'user_tenant_id': {'key': 'userTenantId', 'type': 'str'}, - 'user_name': {'key': 'userName', 'type': 'str'}, - 'upn': {'key': 'upn', 'type': 'str'}, + "user_object_id": {"key": "userObjectId", "type": "str"}, + "user_pu_id": {"key": "userPuId", "type": "str"}, + "user_idp": {"key": "userIdp", "type": "str"}, + "user_alt_sec_id": {"key": "userAltSecId", "type": "str"}, + "user_iss": {"key": "userIss", "type": "str"}, + "user_tenant_id": {"key": "userTenantId", "type": "str"}, + "user_name": {"key": "userName", "type": "str"}, + "upn": {"key": "upn", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword user_object_id: :paramtype user_object_id: str @@ -2253,11 +2195,11 @@ def __init__( :paramtype upn: str """ super(User, self).__init__(**kwargs) - self.user_object_id = kwargs.get('user_object_id', None) - self.user_pu_id = kwargs.get('user_pu_id', None) - self.user_idp = kwargs.get('user_idp', None) - self.user_alt_sec_id = kwargs.get('user_alt_sec_id', None) - self.user_iss = kwargs.get('user_iss', None) - self.user_tenant_id = kwargs.get('user_tenant_id', None) - self.user_name = kwargs.get('user_name', None) - self.upn = kwargs.get('upn', None) + self.user_object_id = kwargs.get("user_object_id", None) + self.user_pu_id = kwargs.get("user_pu_id", None) + self.user_idp = kwargs.get("user_idp", None) + self.user_alt_sec_id = kwargs.get("user_alt_sec_id", None) + self.user_iss = kwargs.get("user_iss", None) + self.user_tenant_id = kwargs.get("user_tenant_id", None) + self.user_name = kwargs.get("user_name", None) + self.upn = kwargs.get("upn", None) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/models/_models_py3.py index d44c7accbc39..c1fe987e6f69 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/models/_models_py3.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/models/_models_py3.py @@ -24,8 +24,8 @@ class Artifact(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'prefix': {'key': 'prefix', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "prefix": {"key": "prefix", "type": "str"}, } def __init__( @@ -76,21 +76,21 @@ class Asset(msrest.serialization.Model): """ _validation = { - 'name': {'required': True}, + "name": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'artifacts': {'key': 'artifacts', 'type': '[Artifact]'}, - 'kv_tags': {'key': 'kvTags', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'runid': {'key': 'runid', 'type': 'str'}, - 'projectid': {'key': 'projectid', 'type': 'str'}, - 'meta': {'key': 'meta', 'type': '{str}'}, - 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "artifacts": {"key": "artifacts", "type": "[Artifact]"}, + "kv_tags": {"key": "kvTags", "type": "{str}"}, + "properties": {"key": "properties", "type": "{str}"}, + "runid": {"key": "runid", "type": "str"}, + "projectid": {"key": "projectid", "type": "str"}, + "meta": {"key": "meta", "type": "{str}"}, + "created_time": {"key": "createdTime", "type": "iso-8601"}, } def __init__( @@ -168,13 +168,16 @@ class AssetDto(msrest.serialization.Model): """ _attribute_map = { - 'asset_id': {'key': 'assetId', 'type': 'str'}, - 'entity_id': {'key': 'entityId', 'type': 'str'}, - 'data_items': {'key': 'dataItems', 'type': '{DataItem}'}, - 'data_references': {'key': 'dataReferences', 'type': 'DataReferences'}, - 'should_index': {'key': 'shouldIndex', 'type': 'bool'}, - 'dependencies': {'key': 'dependencies', 'type': '[DependentAsset]'}, - 'intellectual_property_publisher_information': {'key': 'intellectualPropertyPublisherInformation', 'type': 'IntellectualPropertyPublisherInformation'}, + "asset_id": {"key": "assetId", "type": "str"}, + "entity_id": {"key": "entityId", "type": "str"}, + "data_items": {"key": "dataItems", "type": "{DataItem}"}, + "data_references": {"key": "dataReferences", "type": "DataReferences"}, + "should_index": {"key": "shouldIndex", "type": "bool"}, + "dependencies": {"key": "dependencies", "type": "[DependentAsset]"}, + "intellectual_property_publisher_information": { + "key": "intellectualPropertyPublisherInformation", + "type": "IntellectualPropertyPublisherInformation", + }, } def __init__( @@ -186,7 +189,9 @@ def __init__( data_references: Optional["DataReferences"] = None, should_index: Optional[bool] = None, dependencies: Optional[List["DependentAsset"]] = None, - intellectual_property_publisher_information: Optional["IntellectualPropertyPublisherInformation"] = None, + intellectual_property_publisher_information: Optional[ + "IntellectualPropertyPublisherInformation" + ] = None, **kwargs ): """ @@ -213,7 +218,9 @@ def __init__( self.data_references = data_references self.should_index = should_index self.dependencies = dependencies - self.intellectual_property_publisher_information = intellectual_property_publisher_information + self.intellectual_property_publisher_information = ( + intellectual_property_publisher_information + ) class AssetPaginatedResult(msrest.serialization.Model): @@ -228,9 +235,9 @@ class AssetPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[Asset]'}, - 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Asset]"}, + "continuation_token": {"key": "continuationToken", "type": "str"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( @@ -263,15 +270,10 @@ class BatchGetResolvedUrisDto(msrest.serialization.Model): """ _attribute_map = { - 'values': {'key': 'values', 'type': '[str]'}, + "values": {"key": "values", "type": "[str]"}, } - def __init__( - self, - *, - values: Optional[List[str]] = None, - **kwargs - ): + def __init__(self, *, values: Optional[List[str]] = None, **kwargs): """ :keyword values: :paramtype values: list[str] @@ -288,7 +290,7 @@ class BatchModelPathResponseDto(msrest.serialization.Model): """ _attribute_map = { - 'values': {'key': 'values', 'type': '{ModelPathResponseDto}'}, + "values": {"key": "values", "type": "{ModelPathResponseDto}"}, } def __init__( @@ -315,8 +317,11 @@ class BlobReference(msrest.serialization.Model): """ _attribute_map = { - 'blob_uri': {'key': 'blobUri', 'type': 'str'}, - 'storage_account_arm_id': {'key': 'storageAccountArmId', 'type': 'str'}, + "blob_uri": {"key": "blobUri", "type": "str"}, + "storage_account_arm_id": { + "key": "storageAccountArmId", + "type": "str", + }, } def __init__( @@ -349,9 +354,15 @@ class BlobReferenceForConsumptionDto(msrest.serialization.Model): """ _attribute_map = { - 'blob_uri': {'key': 'blobUri', 'type': 'str'}, - 'storage_account_arm_id': {'key': 'storageAccountArmId', 'type': 'str'}, - 'credential': {'key': 'credential', 'type': 'DataReferenceCredentialDto'}, + "blob_uri": {"key": "blobUri", "type": "str"}, + "storage_account_arm_id": { + "key": "storageAccountArmId", + "type": "str", + }, + "credential": { + "key": "credential", + "type": "DataReferenceCredentialDto", + }, } def __init__( @@ -396,13 +407,13 @@ class ContainerResourceRequirements(msrest.serialization.Model): """ _attribute_map = { - 'cpu': {'key': 'cpu', 'type': 'float'}, - 'cpu_limit': {'key': 'cpuLimit', 'type': 'float'}, - 'memory_in_gb': {'key': 'memoryInGB', 'type': 'float'}, - 'memory_in_gb_limit': {'key': 'memoryInGBLimit', 'type': 'float'}, - 'gpu_enabled': {'key': 'gpuEnabled', 'type': 'bool'}, - 'gpu': {'key': 'gpu', 'type': 'int'}, - 'fpga': {'key': 'fpga', 'type': 'int'}, + "cpu": {"key": "cpu", "type": "float"}, + "cpu_limit": {"key": "cpuLimit", "type": "float"}, + "memory_in_gb": {"key": "memoryInGB", "type": "float"}, + "memory_in_gb_limit": {"key": "memoryInGBLimit", "type": "float"}, + "gpu_enabled": {"key": "gpuEnabled", "type": "bool"}, + "gpu": {"key": "gpu", "type": "int"}, + "fpga": {"key": "fpga", "type": "int"}, } def __init__( @@ -455,9 +466,9 @@ class CreatedBy(msrest.serialization.Model): """ _attribute_map = { - 'user_object_id': {'key': 'userObjectId', 'type': 'str'}, - 'user_tenant_id': {'key': 'userTenantId', 'type': 'str'}, - 'user_name': {'key': 'userName', 'type': 'str'}, + "user_object_id": {"key": "userObjectId", "type": "str"}, + "user_tenant_id": {"key": "userTenantId", "type": "str"}, + "user_name": {"key": "userName", "type": "str"}, } def __init__( @@ -496,10 +507,10 @@ class CreateUnregisteredInputModelDto(msrest.serialization.Model): """ _attribute_map = { - 'run_id': {'key': 'runId', 'type': 'str'}, - 'input_name': {'key': 'inputName', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + "run_id": {"key": "runId", "type": "str"}, + "input_name": {"key": "inputName", "type": "str"}, + "path": {"key": "path", "type": "str"}, + "type": {"key": "type", "type": "str"}, } def __init__( @@ -542,10 +553,10 @@ class CreateUnregisteredOutputModelDto(msrest.serialization.Model): """ _attribute_map = { - 'run_id': {'key': 'runId', 'type': 'str'}, - 'output_name': {'key': 'outputName', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + "run_id": {"key": "runId", "type": "str"}, + "output_name": {"key": "outputName", "type": "str"}, + "path": {"key": "path", "type": "str"}, + "type": {"key": "type", "type": "str"}, } def __init__( @@ -589,10 +600,10 @@ class CreationContext(msrest.serialization.Model): """ _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, - 'created_by': {'key': 'createdBy', 'type': 'CreatedBy'}, - 'creation_source': {'key': 'creationSource', 'type': 'str'}, + "additional_properties": {"key": "", "type": "{object}"}, + "created_time": {"key": "createdTime", "type": "iso-8601"}, + "created_by": {"key": "createdBy", "type": "CreatedBy"}, + "creation_source": {"key": "creationSource", "type": "str"}, } def __init__( @@ -630,15 +641,10 @@ class DataItem(msrest.serialization.Model): """ _attribute_map = { - 'data': {'key': 'data', 'type': 'object'}, + "data": {"key": "data", "type": "object"}, } - def __init__( - self, - *, - data: Optional[Any] = None, - **kwargs - ): + def __init__(self, *, data: Optional[Any] = None, **kwargs): """ :keyword data: Anything. :paramtype data: any @@ -658,8 +664,8 @@ class DataReferenceCredentialDto(msrest.serialization.Model): """ _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'credential_type': {'key': 'credentialType', 'type': 'str'}, + "additional_properties": {"key": "", "type": "{object}"}, + "credential_type": {"key": "credentialType", "type": "str"}, } def __init__( @@ -692,15 +698,23 @@ class DataReferences(msrest.serialization.Model): """ _attribute_map = { - 'blob_references': {'key': 'blobReferences', 'type': '{BlobReference}'}, - 'image_registry_references': {'key': 'imageRegistryReferences', 'type': '{ImageReference}'}, + "blob_references": { + "key": "blobReferences", + "type": "{BlobReference}", + }, + "image_registry_references": { + "key": "imageRegistryReferences", + "type": "{ImageReference}", + }, } def __init__( self, *, blob_references: Optional[Dict[str, "BlobReference"]] = None, - image_registry_references: Optional[Dict[str, "ImageReference"]] = None, + image_registry_references: Optional[ + Dict[str, "ImageReference"] + ] = None, **kwargs ): """ @@ -727,15 +741,25 @@ class DataReferencesForConsumptionDto(msrest.serialization.Model): """ _attribute_map = { - 'blob_references': {'key': 'blobReferences', 'type': '{BlobReferenceForConsumptionDto}'}, - 'image_registry_references': {'key': 'imageRegistryReferences', 'type': '{ImageReferenceForConsumptionDto}'}, + "blob_references": { + "key": "blobReferences", + "type": "{BlobReferenceForConsumptionDto}", + }, + "image_registry_references": { + "key": "imageRegistryReferences", + "type": "{ImageReferenceForConsumptionDto}", + }, } def __init__( self, *, - blob_references: Optional[Dict[str, "BlobReferenceForConsumptionDto"]] = None, - image_registry_references: Optional[Dict[str, "ImageReferenceForConsumptionDto"]] = None, + blob_references: Optional[ + Dict[str, "BlobReferenceForConsumptionDto"] + ] = None, + image_registry_references: Optional[ + Dict[str, "ImageReferenceForConsumptionDto"] + ] = None, **kwargs ): """ @@ -761,16 +785,12 @@ class DatasetReference(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "id": {"key": "id", "type": "str"}, } def __init__( - self, - *, - name: Optional[str] = None, - id: Optional[str] = None, - **kwargs + self, *, name: Optional[str] = None, id: Optional[str] = None, **kwargs ): """ :keyword name: @@ -791,7 +811,10 @@ class DependencyMapDto(msrest.serialization.Model): """ _attribute_map = { - 'dependencies': {'key': 'dependencies', 'type': '[DependencyMapItemDto]'}, + "dependencies": { + "key": "dependencies", + "type": "[DependencyMapItemDto]", + }, } def __init__( @@ -818,8 +841,8 @@ class DependencyMapItemDto(msrest.serialization.Model): """ _attribute_map = { - 'source_id': {'key': 'sourceId', 'type': 'str'}, - 'destination_id': {'key': 'destinationId', 'type': 'str'}, + "source_id": {"key": "sourceId", "type": "str"}, + "destination_id": {"key": "destinationId", "type": "str"}, } def __init__( @@ -848,15 +871,10 @@ class DependentAsset(msrest.serialization.Model): """ _attribute_map = { - 'asset_id': {'key': 'assetId', 'type': 'str'}, + "asset_id": {"key": "assetId", "type": "str"}, } - def __init__( - self, - *, - asset_id: Optional[str] = None, - **kwargs - ): + def __init__(self, *, asset_id: Optional[str] = None, **kwargs): """ :keyword asset_id: :paramtype asset_id: str @@ -875,8 +893,8 @@ class DependentEntitiesDto(msrest.serialization.Model): """ _attribute_map = { - 'asset_id': {'key': 'assetId', 'type': 'str'}, - 'dependencies': {'key': 'dependencies', 'type': '[DependentAsset]'}, + "asset_id": {"key": "assetId", "type": "str"}, + "dependencies": {"key": "dependencies", "type": "[DependentAsset]"}, } def __init__( @@ -915,12 +933,12 @@ class ErrorResponse(msrest.serialization.Model): """ _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'status_code': {'key': 'statusCode', 'type': 'int'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[InnerErrorDetails]'}, - 'correlation': {'key': 'correlation', 'type': '{str}'}, + "code": {"key": "code", "type": "str"}, + "status_code": {"key": "statusCode", "type": "int"}, + "message": {"key": "message", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[InnerErrorDetails]"}, + "correlation": {"key": "correlation", "type": "{str}"}, } def __init__( @@ -969,9 +987,12 @@ class ExtensiveModel(msrest.serialization.Model): """ _attribute_map = { - 'model': {'key': 'Model', 'type': 'Model'}, - 'service_list': {'key': 'ServiceList', 'type': '[ServiceResponseBase]'}, - 'asset_list': {'key': 'AssetList', 'type': '[Asset]'}, + "model": {"key": "Model", "type": "Model"}, + "service_list": { + "key": "ServiceList", + "type": "[ServiceResponseBase]", + }, + "asset_list": {"key": "AssetList", "type": "[Asset]"}, } def __init__( @@ -1008,9 +1029,9 @@ class FeedIndexEntityDto(msrest.serialization.Model): """ _attribute_map = { - 'index_entity': {'key': 'indexEntity', 'type': 'IndexEntity'}, - 'schema_id': {'key': 'schemaId', 'type': 'str'}, - 'entity_schema': {'key': 'entitySchema', 'type': 'object'}, + "index_entity": {"key": "indexEntity", "type": "IndexEntity"}, + "schema_id": {"key": "schemaId", "type": "str"}, + "entity_schema": {"key": "entitySchema", "type": "object"}, } def __init__( @@ -1045,8 +1066,11 @@ class FeedIndexEntityRequestDto(msrest.serialization.Model): """ _attribute_map = { - 'feed_entity': {'key': 'feedEntity', 'type': 'AssetDto'}, - 'label_to_version_mapping': {'key': 'labelToVersionMapping', 'type': '{str}'}, + "feed_entity": {"key": "feedEntity", "type": "AssetDto"}, + "label_to_version_mapping": { + "key": "labelToVersionMapping", + "type": "{str}", + }, } def __init__( @@ -1075,14 +1099,14 @@ class ImageReference(msrest.serialization.Model): """ _attribute_map = { - 'image_registry_reference': {'key': 'imageRegistryReference', 'type': 'str'}, + "image_registry_reference": { + "key": "imageRegistryReference", + "type": "str", + }, } def __init__( - self, - *, - image_registry_reference: Optional[str] = None, - **kwargs + self, *, image_registry_reference: Optional[str] = None, **kwargs ): """ :keyword image_registry_reference: @@ -1102,8 +1126,14 @@ class ImageReferenceForConsumptionDto(msrest.serialization.Model): """ _attribute_map = { - 'image_registry_reference': {'key': 'imageRegistryReference', 'type': 'str'}, - 'credential': {'key': 'credential', 'type': 'DataReferenceCredentialDto'}, + "image_registry_reference": { + "key": "imageRegistryReference", + "type": "str", + }, + "credential": { + "key": "credential", + "type": "DataReferenceCredentialDto", + }, } def __init__( @@ -1137,9 +1167,9 @@ class IndexAnnotations(msrest.serialization.Model): """ _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'archived': {'key': 'archived', 'type': 'bool'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "additional_properties": {"key": "", "type": "{object}"}, + "archived": {"key": "archived", "type": "bool"}, + "tags": {"key": "tags", "type": "{str}"}, } def __init__( @@ -1201,27 +1231,27 @@ class IndexEntity(msrest.serialization.Model): """ _validation = { - 'version': {'readonly': True}, - 'entity_container_id': {'readonly': True}, - 'entity_object_id': {'readonly': True}, - 'resource_type': {'readonly': True}, + "version": {"readonly": True}, + "entity_container_id": {"readonly": True}, + "entity_object_id": {"readonly": True}, + "resource_type": {"readonly": True}, } _attribute_map = { - 'schema_id': {'key': 'schemaId', 'type': 'str'}, - 'entity_id': {'key': 'entityId', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'annotations': {'key': 'annotations', 'type': 'IndexAnnotations'}, - 'properties': {'key': 'properties', 'type': 'IndexProperties'}, - 'internal': {'key': 'internal', 'type': '{object}'}, - 'update_sequence': {'key': 'updateSequence', 'type': 'long'}, - 'type': {'key': 'type', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - 'entity_container_id': {'key': 'entityContainerId', 'type': 'str'}, - 'entity_object_id': {'key': 'entityObjectId', 'type': 'str'}, - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'relationships': {'key': 'relationships', 'type': '[Relationship]'}, - 'asset_id': {'key': 'assetId', 'type': 'str'}, + "schema_id": {"key": "schemaId", "type": "str"}, + "entity_id": {"key": "entityId", "type": "str"}, + "kind": {"key": "kind", "type": "str"}, + "annotations": {"key": "annotations", "type": "IndexAnnotations"}, + "properties": {"key": "properties", "type": "IndexProperties"}, + "internal": {"key": "internal", "type": "{object}"}, + "update_sequence": {"key": "updateSequence", "type": "long"}, + "type": {"key": "type", "type": "str"}, + "version": {"key": "version", "type": "str"}, + "entity_container_id": {"key": "entityContainerId", "type": "str"}, + "entity_object_id": {"key": "entityObjectId", "type": "str"}, + "resource_type": {"key": "resourceType", "type": "str"}, + "relationships": {"key": "relationships", "type": "[Relationship]"}, + "asset_id": {"key": "assetId", "type": "str"}, } def __init__( @@ -1289,8 +1319,11 @@ class IndexProperties(msrest.serialization.Model): """ _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'creation_context': {'key': 'creationContext', 'type': 'CreationContext'}, + "additional_properties": {"key": "", "type": "{object}"}, + "creation_context": { + "key": "creationContext", + "type": "CreationContext", + }, } def __init__( @@ -1324,9 +1357,9 @@ class InnerErrorDetails(msrest.serialization.Model): """ _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "target": {"key": "target", "type": "str"}, } def __init__( @@ -1359,7 +1392,10 @@ class IntellectualPropertyPublisherInformation(msrest.serialization.Model): """ _attribute_map = { - 'intellectual_property_publisher': {'key': 'intellectualPropertyPublisher', 'type': 'str'}, + "intellectual_property_publisher": { + "key": "intellectualPropertyPublisher", + "type": "str", + }, } def __init__( @@ -1372,7 +1408,9 @@ def __init__( :keyword intellectual_property_publisher: :paramtype intellectual_property_publisher: str """ - super(IntellectualPropertyPublisherInformation, self).__init__(**kwargs) + super(IntellectualPropertyPublisherInformation, self).__init__( + **kwargs + ) self.intellectual_property_publisher = intellectual_property_publisher @@ -1417,23 +1455,23 @@ class ListModelsRequest(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tag': {'key': 'tag', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - 'framework': {'key': 'framework', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'count': {'key': 'count', 'type': 'int'}, - 'offset': {'key': 'offset', 'type': 'int'}, - 'skip_token': {'key': 'skipToken', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'str'}, - 'run_id': {'key': 'runId', 'type': 'str'}, - 'dataset_id': {'key': 'datasetId', 'type': 'str'}, - 'order_by': {'key': 'orderBy', 'type': 'str'}, - 'latest_version_only': {'key': 'latestVersionOnly', 'type': 'bool'}, - 'modified_after': {'key': 'modifiedAfter', 'type': 'iso-8601'}, - 'modified_before': {'key': 'modifiedBefore', 'type': 'iso-8601'}, - 'list_view_type': {'key': 'listViewType', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "tag": {"key": "tag", "type": "str"}, + "version": {"key": "version", "type": "str"}, + "framework": {"key": "framework", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "count": {"key": "count", "type": "int"}, + "offset": {"key": "offset", "type": "int"}, + "skip_token": {"key": "skipToken", "type": "str"}, + "tags": {"key": "tags", "type": "str"}, + "properties": {"key": "properties", "type": "str"}, + "run_id": {"key": "runId", "type": "str"}, + "dataset_id": {"key": "datasetId", "type": "str"}, + "order_by": {"key": "orderBy", "type": "str"}, + "latest_version_only": {"key": "latestVersionOnly", "type": "bool"}, + "modified_after": {"key": "modifiedAfter", "type": "iso-8601"}, + "modified_before": {"key": "modifiedBefore", "type": "iso-8601"}, + "list_view_type": {"key": "listViewType", "type": "str"}, } def __init__( @@ -1602,49 +1640,55 @@ class Model(msrest.serialization.Model): """ _validation = { - 'name': {'required': True}, - 'mime_type': {'required': True}, + "name": {"required": True}, + "mime_type": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'framework': {'key': 'framework', 'type': 'str'}, - 'framework_version': {'key': 'frameworkVersion', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'long'}, - 'tags': {'key': 'tags', 'type': '[str]'}, - 'datasets': {'key': 'datasets', 'type': '[DatasetReference]'}, - 'url': {'key': 'url', 'type': 'str'}, - 'mime_type': {'key': 'mimeType', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, - 'modified_time': {'key': 'modifiedTime', 'type': 'iso-8601'}, - 'unpack': {'key': 'unpack', 'type': 'bool'}, - 'parent_model_id': {'key': 'parentModelId', 'type': 'str'}, - 'run_id': {'key': 'runId', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'kv_tags': {'key': 'kvTags', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'derived_model_ids': {'key': 'derivedModelIds', 'type': '[str]'}, - 'inputs_schema': {'key': 'inputsSchema', 'type': '[ModelSchema]'}, - 'outputs_schema': {'key': 'outputsSchema', 'type': '[ModelSchema]'}, - 'sample_input_data': {'key': 'sampleInputData', 'type': 'str'}, - 'sample_output_data': {'key': 'sampleOutputData', 'type': 'str'}, - 'resource_requirements': {'key': 'resourceRequirements', 'type': 'ContainerResourceRequirements'}, - 'created_by': {'key': 'createdBy', 'type': 'User'}, - 'modified_by': {'key': 'modifiedBy', 'type': 'User'}, - 'flavors': {'key': 'flavors', 'type': '{{str}}'}, - 'model_format': {'key': 'modelFormat', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, - 'model_container_id': {'key': 'modelContainerId', 'type': 'str'}, - 'mms_id': {'key': 'mmsId', 'type': 'str'}, - 'default_deployment_settings': {'key': 'defaultDeploymentSettings', 'type': 'ModelDeploymentSettings'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'is_registered': {'key': 'isRegistered', 'type': 'bool'}, - 'data_path': {'key': 'dataPath', 'type': 'str'}, - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'asset_id': {'key': 'assetId', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "framework": {"key": "framework", "type": "str"}, + "framework_version": {"key": "frameworkVersion", "type": "str"}, + "version": {"key": "version", "type": "long"}, + "tags": {"key": "tags", "type": "[str]"}, + "datasets": {"key": "datasets", "type": "[DatasetReference]"}, + "url": {"key": "url", "type": "str"}, + "mime_type": {"key": "mimeType", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_time": {"key": "createdTime", "type": "iso-8601"}, + "modified_time": {"key": "modifiedTime", "type": "iso-8601"}, + "unpack": {"key": "unpack", "type": "bool"}, + "parent_model_id": {"key": "parentModelId", "type": "str"}, + "run_id": {"key": "runId", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "kv_tags": {"key": "kvTags", "type": "{str}"}, + "properties": {"key": "properties", "type": "{str}"}, + "derived_model_ids": {"key": "derivedModelIds", "type": "[str]"}, + "inputs_schema": {"key": "inputsSchema", "type": "[ModelSchema]"}, + "outputs_schema": {"key": "outputsSchema", "type": "[ModelSchema]"}, + "sample_input_data": {"key": "sampleInputData", "type": "str"}, + "sample_output_data": {"key": "sampleOutputData", "type": "str"}, + "resource_requirements": { + "key": "resourceRequirements", + "type": "ContainerResourceRequirements", + }, + "created_by": {"key": "createdBy", "type": "User"}, + "modified_by": {"key": "modifiedBy", "type": "User"}, + "flavors": {"key": "flavors", "type": "{{str}}"}, + "model_format": {"key": "modelFormat", "type": "str"}, + "stage": {"key": "stage", "type": "str"}, + "model_container_id": {"key": "modelContainerId", "type": "str"}, + "mms_id": {"key": "mmsId", "type": "str"}, + "default_deployment_settings": { + "key": "defaultDeploymentSettings", + "type": "ModelDeploymentSettings", + }, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "is_registered": {"key": "isRegistered", "type": "bool"}, + "data_path": {"key": "dataPath", "type": "str"}, + "model_type": {"key": "modelType", "type": "str"}, + "asset_id": {"key": "assetId", "type": "str"}, } def __init__( @@ -1673,7 +1717,9 @@ def __init__( outputs_schema: Optional[List["ModelSchema"]] = None, sample_input_data: Optional[str] = None, sample_output_data: Optional[str] = None, - resource_requirements: Optional["ContainerResourceRequirements"] = None, + resource_requirements: Optional[ + "ContainerResourceRequirements" + ] = None, created_by: Optional["User"] = None, modified_by: Optional["User"] = None, flavors: Optional[Dict[str, Dict[str, str]]] = None, @@ -1681,7 +1727,9 @@ def __init__( stage: Optional[str] = None, model_container_id: Optional[str] = None, mms_id: Optional[str] = None, - default_deployment_settings: Optional["ModelDeploymentSettings"] = None, + default_deployment_settings: Optional[ + "ModelDeploymentSettings" + ] = None, is_anonymous: Optional[bool] = None, is_archived: Optional[bool] = None, is_registered: Optional[bool] = None, @@ -1820,15 +1868,10 @@ class ModelBatchDto(msrest.serialization.Model): """ _attribute_map = { - 'model_ids': {'key': 'modelIds', 'type': '[str]'}, + "model_ids": {"key": "modelIds", "type": "[str]"}, } - def __init__( - self, - *, - model_ids: Optional[List[str]] = None, - **kwargs - ): + def __init__(self, *, model_ids: Optional[List[str]] = None, **kwargs): """ :keyword model_ids: :paramtype model_ids: list[str] @@ -1845,14 +1888,11 @@ class ModelBatchResponseDto(msrest.serialization.Model): """ _attribute_map = { - 'models': {'key': 'models', 'type': '{Model}'}, + "models": {"key": "models", "type": "{Model}"}, } def __init__( - self, - *, - models: Optional[Dict[str, "Model"]] = None, - **kwargs + self, *, models: Optional[Dict[str, "Model"]] = None, **kwargs ): """ :keyword models: Dictionary of :code:``. @@ -1880,15 +1920,15 @@ class ModelContainerRequest(msrest.serialization.Model): """ _validation = { - 'name': {'required': True}, + "name": {"required": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'kv_tags': {'key': 'kvTags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'is_registered': {'key': 'isRegistered', 'type': 'bool'}, + "name": {"key": "name", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "kv_tags": {"key": "kvTags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "is_registered": {"key": "isRegistered", "type": "bool"}, } def __init__( @@ -1937,14 +1977,14 @@ class ModelDeploymentSettings(msrest.serialization.Model): """ _validation = { - 'model_format': {'required': True}, + "model_format": {"required": True}, } _attribute_map = { - 'model_format': {'key': 'modelFormat', 'type': 'str'}, - 'model_name': {'key': 'ModelName', 'type': 'str'}, - 'model_version': {'key': 'ModelVersion', 'type': 'str'}, - 'model_type': {'key': 'ModelType', 'type': 'str'}, + "model_format": {"key": "modelFormat", "type": "str"}, + "model_name": {"key": "ModelName", "type": "str"}, + "model_version": {"key": "ModelVersion", "type": "str"}, + "model_type": {"key": "ModelType", "type": "str"}, } def __init__( @@ -1988,10 +2028,10 @@ class ModelListModelsRequestPagedResponse(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[Model]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, - 'next_request': {'key': 'nextRequest', 'type': 'ListModelsRequest'}, + "value": {"key": "value", "type": "[Model]"}, + "next_link": {"key": "nextLink", "type": "str"}, + "continuation_token": {"key": "continuationToken", "type": "str"}, + "next_request": {"key": "nextRequest", "type": "ListModelsRequest"}, } def __init__( @@ -2032,9 +2072,9 @@ class ModelPagedResponse(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[Model]'}, - 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Model]"}, + "continuation_token": {"key": "continuationToken", "type": "str"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( @@ -2069,8 +2109,8 @@ class ModelPathResponseDto(msrest.serialization.Model): """ _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + "path": {"key": "path", "type": "str"}, + "type": {"key": "type", "type": "str"}, } def __init__( @@ -2107,13 +2147,13 @@ class ModelSchema(msrest.serialization.Model): """ _validation = { - 'name': {'required': True}, + "name": {"required": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'shape': {'key': 'shape', 'type': '[int]'}, + "name": {"key": "name", "type": "str"}, + "data_type": {"key": "dataType", "type": "str"}, + "shape": {"key": "shape", "type": "[int]"}, } def __init__( @@ -2150,8 +2190,8 @@ class ModelSettingsIdentifiers(msrest.serialization.Model): """ _attribute_map = { - 'model_id': {'key': 'modelId', 'type': 'str'}, - 'engine_id': {'key': 'engineId', 'type': 'str'}, + "model_id": {"key": "modelId", "type": "str"}, + "engine_id": {"key": "engineId", "type": "str"}, } def __init__( @@ -2186,10 +2226,10 @@ class Operation(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': 'object'}, - 'path': {'key': 'path', 'type': 'str'}, - 'op': {'key': 'op', 'type': 'str'}, - 'from_property': {'key': 'from', 'type': 'str'}, + "value": {"key": "value", "type": "object"}, + "path": {"key": "path", "type": "str"}, + "op": {"key": "op", "type": "str"}, + "from_property": {"key": "from", "type": "str"}, } def __init__( @@ -2231,9 +2271,18 @@ class ProviderFeedEntityRequestDto(msrest.serialization.Model): """ _attribute_map = { - 'source_and_target_asset_ids': {'key': 'sourceAndTargetAssetIds', 'type': 'DependencyMapItemDto'}, - 'dependency_map_dto': {'key': 'dependencyMapDto', 'type': 'DependencyMapDto'}, - 'label_to_version_mapping': {'key': 'labelToVersionMapping', 'type': '{str}'}, + "source_and_target_asset_ids": { + "key": "sourceAndTargetAssetIds", + "type": "DependencyMapItemDto", + }, + "dependency_map_dto": { + "key": "dependencyMapDto", + "type": "DependencyMapDto", + }, + "label_to_version_mapping": { + "key": "labelToVersionMapping", + "type": "{str}", + }, } def __init__( @@ -2282,18 +2331,18 @@ class Relationship(msrest.serialization.Model): """ _validation = { - 'entity_type': {'readonly': True}, - 'entity_container_id': {'readonly': True}, + "entity_type": {"readonly": True}, + "entity_container_id": {"readonly": True}, } _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'relation_type': {'key': 'relationType', 'type': 'str'}, - 'target_entity_id': {'key': 'targetEntityId', 'type': 'str'}, - 'asset_id': {'key': 'assetId', 'type': 'str'}, - 'entity_type': {'key': 'entityType', 'type': 'str'}, - 'direction': {'key': 'direction', 'type': 'str'}, - 'entity_container_id': {'key': 'entityContainerId', 'type': 'str'}, + "additional_properties": {"key": "", "type": "{object}"}, + "relation_type": {"key": "relationType", "type": "str"}, + "target_entity_id": {"key": "targetEntityId", "type": "str"}, + "asset_id": {"key": "assetId", "type": "str"}, + "entity_type": {"key": "entityType", "type": "str"}, + "direction": {"key": "direction", "type": "str"}, + "entity_container_id": {"key": "entityContainerId", "type": "str"}, } def __init__( @@ -2369,21 +2418,21 @@ class ServiceResponseBase(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '[str]'}, - 'kv_tags': {'key': 'kvTags', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'operation_id': {'key': 'operationId', 'type': 'str'}, - 'state': {'key': 'state', 'type': 'str'}, - 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, - 'updated_time': {'key': 'updatedTime', 'type': 'iso-8601'}, - 'error': {'key': 'error', 'type': 'ErrorResponse'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'deployment_type': {'key': 'deploymentType', 'type': 'str'}, - 'created_by': {'key': 'createdBy', 'type': 'User'}, - 'endpoint_name': {'key': 'endpointName', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "tags": {"key": "tags", "type": "[str]"}, + "kv_tags": {"key": "kvTags", "type": "{str}"}, + "properties": {"key": "properties", "type": "{str}"}, + "operation_id": {"key": "operationId", "type": "str"}, + "state": {"key": "state", "type": "str"}, + "created_time": {"key": "createdTime", "type": "iso-8601"}, + "updated_time": {"key": "updatedTime", "type": "iso-8601"}, + "error": {"key": "error", "type": "ErrorResponse"}, + "compute_type": {"key": "computeType", "type": "str"}, + "deployment_type": {"key": "deploymentType", "type": "str"}, + "created_by": {"key": "createdBy", "type": "User"}, + "endpoint_name": {"key": "endpointName", "type": "str"}, } def __init__( @@ -2483,14 +2532,14 @@ class User(msrest.serialization.Model): """ _attribute_map = { - 'user_object_id': {'key': 'userObjectId', 'type': 'str'}, - 'user_pu_id': {'key': 'userPuId', 'type': 'str'}, - 'user_idp': {'key': 'userIdp', 'type': 'str'}, - 'user_alt_sec_id': {'key': 'userAltSecId', 'type': 'str'}, - 'user_iss': {'key': 'userIss', 'type': 'str'}, - 'user_tenant_id': {'key': 'userTenantId', 'type': 'str'}, - 'user_name': {'key': 'userName', 'type': 'str'}, - 'upn': {'key': 'upn', 'type': 'str'}, + "user_object_id": {"key": "userObjectId", "type": "str"}, + "user_pu_id": {"key": "userPuId", "type": "str"}, + "user_idp": {"key": "userIdp", "type": "str"}, + "user_alt_sec_id": {"key": "userAltSecId", "type": "str"}, + "user_iss": {"key": "userIss", "type": "str"}, + "user_tenant_id": {"key": "userTenantId", "type": "str"}, + "user_name": {"key": "userName", "type": "str"}, + "upn": {"key": "upn", "type": "str"}, } def __init__( diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/operations/__init__.py index 261577d5a114..a8607943464c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/operations/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/operations/__init__.py @@ -12,8 +12,8 @@ from ._models_operations import ModelsOperations __all__ = [ - 'AssetsOperations', - 'ExtensiveModelOperations', - 'MigrationOperations', - 'ModelsOperations', + "AssetsOperations", + "ExtensiveModelOperations", + "MigrationOperations", + "ModelsOperations", ] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/operations/_assets_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/operations/_assets_operations.py index 65afa16f7816..fe569f45f796 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/operations/_assets_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/operations/_assets_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest @@ -22,9 +28,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + List, + Optional, + TypeVar, + Union, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -222,6 +243,7 @@ def build_query_by_id_request( **kwargs ) + # fmt: on class AssetsOperations(object): """AssetsOperations operations. @@ -270,26 +292,35 @@ def create( :rtype: ~azure.mgmt.machinelearningservices.models.Asset :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Asset"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Asset"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json-patch+json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json-patch+json" + ) # type: Optional[str] _json = None _content = None - if content_type.split(";")[0] in ['application/json', 'text/json']: + if content_type.split(";")[0] in ["application/json", "text/json"]: if body is not None: - _json = self._serialize.body(body, 'Asset') - elif content_type.split(";")[0] in ['application/json-patch+json', 'application/*+json']: + _json = self._serialize.body(body, "Asset") + elif content_type.split(";")[0] in [ + "application/json-patch+json", + "application/*+json", + ]: if body is not None: - _json = self._serialize.body(body, 'Asset') + _json = self._serialize.body(body, "Asset") else: raise ValueError( "The content_type '{}' is not one of the allowed values: " - "['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']".format(content_type) + "['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']".format( + content_type + ) ) request = build_create_request( @@ -299,27 +330,34 @@ def create( content_type=content_type, json=_json, content=_content, - template_url=self.create.metadata['url'], + template_url=self.create.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Asset', pipeline_response) + deserialized = self._deserialize("Asset", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create.metadata = {'url': '/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/assets'} # type: ignore - + create.metadata = {"url": "/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/assets"} # type: ignore @distributed_trace def list( @@ -373,13 +411,16 @@ def list( :rtype: ~azure.mgmt.machinelearningservices.models.AssetPaginatedResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AssetPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.AssetPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -394,27 +435,36 @@ def list( properties=properties, type=type, orderby=orderby, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('AssetPaginatedResult', pipeline_response) + deserialized = self._deserialize( + "AssetPaginatedResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': '/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/assets'} # type: ignore - + list.metadata = {"url": "/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/assets"} # type: ignore @distributed_trace def patch( @@ -444,24 +494,33 @@ def patch( :rtype: ~azure.mgmt.machinelearningservices.models.Asset :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Asset"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Asset"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json-patch+json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json-patch+json" + ) # type: Optional[str] _json = None _content = None - if content_type.split(";")[0] in ['application/json', 'text/json']: - _json = self._serialize.body(body, '[Operation]') - elif content_type.split(";")[0] in ['application/json-patch+json', 'application/*+json']: - _json = self._serialize.body(body, '[Operation]') + if content_type.split(";")[0] in ["application/json", "text/json"]: + _json = self._serialize.body(body, "[Operation]") + elif content_type.split(";")[0] in [ + "application/json-patch+json", + "application/*+json", + ]: + _json = self._serialize.body(body, "[Operation]") else: raise ValueError( "The content_type '{}' is not one of the allowed values: " - "['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']".format(content_type) + "['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']".format( + content_type + ) ) request = build_patch_request( @@ -472,27 +531,34 @@ def patch( content_type=content_type, json=_json, content=_content, - template_url=self.patch.metadata['url'], + template_url=self.patch.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Asset', pipeline_response) + deserialized = self._deserialize("Asset", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - patch.metadata = {'url': '/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/assets/{id}'} # type: ignore - + patch.metadata = {"url": "/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/assets/{id}"} # type: ignore @distributed_trace def delete( @@ -519,35 +585,43 @@ def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( id=id, subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/assets/{id}'} # type: ignore - + delete.metadata = {"url": "/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/assets/{id}"} # type: ignore @distributed_trace def query_by_id( @@ -574,36 +648,44 @@ def query_by_id( :rtype: ~azure.mgmt.machinelearningservices.models.Asset :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Asset"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Asset"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_query_by_id_request( id=id, subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.query_by_id.metadata['url'], + template_url=self.query_by_id.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Asset', pipeline_response) + deserialized = self._deserialize("Asset", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - query_by_id.metadata = {'url': '/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/assets/{id}'} # type: ignore - + query_by_id.metadata = {"url": "/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/assets/{id}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/operations/_extensive_model_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/operations/_extensive_model_operations.py index cd7703c6311d..63dc4c7a4c5e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/operations/_extensive_model_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/operations/_extensive_model_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest @@ -23,8 +29,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Generic, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -61,6 +73,7 @@ def build_query_by_id_request( **kwargs ) + # fmt: on class ExtensiveModelOperations(object): """ExtensiveModelOperations operations. @@ -109,36 +122,46 @@ def query_by_id( :rtype: ~azure.mgmt.machinelearningservices.models.ExtensiveModel :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensiveModel"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ExtensiveModel"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_query_by_id_request( id=id, subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.query_by_id.metadata['url'], + template_url=self.query_by_id.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ExtensiveModel', pipeline_response) + deserialized = self._deserialize("ExtensiveModel", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - query_by_id.metadata = {'url': '/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/extensiveModels/{id}'} # type: ignore - + query_by_id.metadata = {"url": "/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/extensiveModels/{id}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/operations/_migration_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/operations/_migration_operations.py index e8a399332f6f..4b3a7d014cdb 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/operations/_migration_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/operations/_migration_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest @@ -23,8 +29,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Generic, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -60,6 +72,7 @@ def build_start_migration_request( **kwargs ) + # fmt: on class MigrationOperations(object): """MigrationOperations operations. @@ -108,32 +121,40 @@ def start_migration( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_start_migration_request( migration=migration, timeout=timeout, collection_id=collection_id, workspace_id=workspace_id, - template_url=self.start_migration.metadata['url'], + template_url=self.start_migration.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - start_migration.metadata = {'url': '/modelregistry/v1.0/meta/migration'} # type: ignore - + start_migration.metadata = {"url": "/modelregistry/v1.0/meta/migration"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/operations/_models_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/operations/_models_operations.py index 6339a69f3180..ef3d2128816f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/operations/_models_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/model_dataplane/operations/_models_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling @@ -24,9 +30,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + List, + Optional, + TypeVar, + Union, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -503,6 +524,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class ModelsOperations(object): """ModelsOperations operations. @@ -534,7 +556,7 @@ def register( workspace_name, # type: str body, # type: "_models.Model" auto_version=True, # type: Optional[bool] - **kwargs # type: Any + **kwargs, # type: Any ): # type: (...) -> "_models.Model" """register. @@ -554,24 +576,33 @@ def register( :rtype: ~azure.mgmt.machinelearningservices.models.Model :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Model"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Model"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json-patch+json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json-patch+json" + ) # type: Optional[str] _json = None _content = None - if content_type.split(";")[0] in ['application/json', 'text/json']: - _json = self._serialize.body(body, 'Model') - elif content_type.split(";")[0] in ['application/json-patch+json', 'application/*+json']: - _json = self._serialize.body(body, 'Model') + if content_type.split(";")[0] in ["application/json", "text/json"]: + _json = self._serialize.body(body, "Model") + elif content_type.split(";")[0] in [ + "application/json-patch+json", + "application/*+json", + ]: + _json = self._serialize.body(body, "Model") else: raise ValueError( "The content_type '{}' is not one of the allowed values: " - "['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']".format(content_type) + "['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']".format( + content_type + ) ) request = build_register_request( @@ -582,27 +613,34 @@ def register( json=_json, content=_content, auto_version=auto_version, - template_url=self.register.metadata['url'], + template_url=self.register.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Model', pipeline_response) + deserialized = self._deserialize("Model", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - register.metadata = {'url': '/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models'} # type: ignore - + register.metadata = {"url": "/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models"} # type: ignore @distributed_trace def list( @@ -626,7 +664,7 @@ def list( latest_version_only=False, # type: Optional[bool] feed=None, # type: Optional[str] list_view_type=None, # type: Optional[Union[str, "_models.ListViewType"]] - **kwargs # type: Any + **kwargs, # type: Any ): # type: (...) -> "_models.ModelPagedResponse" """list. @@ -674,13 +712,16 @@ def list( :rtype: ~azure.mgmt.machinelearningservices.models.ModelPagedResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelPagedResponse"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelPagedResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -701,27 +742,36 @@ def list( latest_version_only=latest_version_only, feed=feed, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ModelPagedResponse', pipeline_response) + deserialized = self._deserialize( + "ModelPagedResponse", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': '/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models'} # type: ignore - + list.metadata = {"url": "/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models"} # type: ignore @distributed_trace def create_unregistered_input_model( @@ -730,7 +780,7 @@ def create_unregistered_input_model( resource_group_name, # type: str workspace_name, # type: str body, # type: "_models.CreateUnregisteredInputModelDto" - **kwargs # type: Any + **kwargs, # type: Any ): # type: (...) -> "_models.Model" """create_unregistered_input_model. @@ -748,24 +798,37 @@ def create_unregistered_input_model( :rtype: ~azure.mgmt.machinelearningservices.models.Model :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Model"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Model"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json-patch+json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json-patch+json" + ) # type: Optional[str] _json = None _content = None - if content_type.split(";")[0] in ['application/json', 'text/json']: - _json = self._serialize.body(body, 'CreateUnregisteredInputModelDto') - elif content_type.split(";")[0] in ['application/json-patch+json', 'application/*+json']: - _json = self._serialize.body(body, 'CreateUnregisteredInputModelDto') + if content_type.split(";")[0] in ["application/json", "text/json"]: + _json = self._serialize.body( + body, "CreateUnregisteredInputModelDto" + ) + elif content_type.split(";")[0] in [ + "application/json-patch+json", + "application/*+json", + ]: + _json = self._serialize.body( + body, "CreateUnregisteredInputModelDto" + ) else: raise ValueError( "The content_type '{}' is not one of the allowed values: " - "['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']".format(content_type) + "['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']".format( + content_type + ) ) request = build_create_unregistered_input_model_request( @@ -775,27 +838,34 @@ def create_unregistered_input_model( content_type=content_type, json=_json, content=_content, - template_url=self.create_unregistered_input_model.metadata['url'], + template_url=self.create_unregistered_input_model.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Model', pipeline_response) + deserialized = self._deserialize("Model", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_unregistered_input_model.metadata = {'url': '/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/createUnregisteredInput'} # type: ignore - + create_unregistered_input_model.metadata = {"url": "/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/createUnregisteredInput"} # type: ignore @distributed_trace def create_unregistered_output_model( @@ -804,7 +874,7 @@ def create_unregistered_output_model( resource_group_name, # type: str workspace_name, # type: str body, # type: "_models.CreateUnregisteredOutputModelDto" - **kwargs # type: Any + **kwargs, # type: Any ): # type: (...) -> "_models.Model" """create_unregistered_output_model. @@ -822,24 +892,37 @@ def create_unregistered_output_model( :rtype: ~azure.mgmt.machinelearningservices.models.Model :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Model"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Model"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json-patch+json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json-patch+json" + ) # type: Optional[str] _json = None _content = None - if content_type.split(";")[0] in ['application/json', 'text/json']: - _json = self._serialize.body(body, 'CreateUnregisteredOutputModelDto') - elif content_type.split(";")[0] in ['application/json-patch+json', 'application/*+json']: - _json = self._serialize.body(body, 'CreateUnregisteredOutputModelDto') + if content_type.split(";")[0] in ["application/json", "text/json"]: + _json = self._serialize.body( + body, "CreateUnregisteredOutputModelDto" + ) + elif content_type.split(";")[0] in [ + "application/json-patch+json", + "application/*+json", + ]: + _json = self._serialize.body( + body, "CreateUnregisteredOutputModelDto" + ) else: raise ValueError( "The content_type '{}' is not one of the allowed values: " - "['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']".format(content_type) + "['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']".format( + content_type + ) ) request = build_create_unregistered_output_model_request( @@ -849,33 +932,40 @@ def create_unregistered_output_model( content_type=content_type, json=_json, content=_content, - template_url=self.create_unregistered_output_model.metadata['url'], + template_url=self.create_unregistered_output_model.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Model', pipeline_response) + deserialized = self._deserialize("Model", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_unregistered_output_model.metadata = {'url': '/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/createUnregisteredOutput'} # type: ignore - + create_unregistered_output_model.metadata = {"url": "/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/createUnregisteredOutput"} # type: ignore # this method is only used for model create/update with system metadata @distributed_trace def begin_create_or_update_model_with_system_metadata( self, - subscription_id, # type: str + subscription_id, # type: str name, # type: str version, # type: str resource_group_name, # type: str @@ -914,11 +1004,17 @@ def begin_create_or_update_model_with_system_metadata( :raises: ~azure.core.exceptions.HttpResponseError """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) _json = self._serialize.body(body, "ModelVersionData") - _json["properties"]["system_metadata"] = body.properties.system_metadata + _json["properties"][ + "system_metadata" + ] = body.properties.system_metadata request = build_create_or_update_request_initial( name=name, @@ -927,17 +1023,27 @@ def begin_create_or_update_model_with_system_metadata( resource_group_name=resource_group_name, registry_name=registry_name, json=_json, - template_url=self.begin_create_or_update_model_with_system_metadata.metadata["url"], + template_url=self.begin_create_or_update_model_with_system_metadata.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} response_headers["x-ms-async-operation-timeout"] = self._deserialize( @@ -959,7 +1065,9 @@ def get_long_running_output(pipeline_response): polling = kwargs.pop("polling", True) if polling is True: - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() @@ -967,7 +1075,10 @@ def get_long_running_output(pipeline_response): polling_method = polling return LROPoller( - self._client, pipeline_response, get_long_running_output, polling_method + self._client, + pipeline_response, + get_long_running_output, + polling_method, ) begin_create_or_update_model_with_system_metadata.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}"} # type: ignore @@ -979,7 +1090,7 @@ def batch_get_resolved_uris( resource_group_name, # type: str workspace_name, # type: str body=None, # type: Optional["_models.BatchGetResolvedUrisDto"] - **kwargs # type: Any + **kwargs, # type: Any ): # type: (...) -> "_models.BatchModelPathResponseDto" """batch_get_resolved_uris. @@ -997,26 +1108,37 @@ def batch_get_resolved_uris( :rtype: ~azure.mgmt.machinelearningservices.models.BatchModelPathResponseDto :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchModelPathResponseDto"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchModelPathResponseDto"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json-patch+json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json-patch+json" + ) # type: Optional[str] _json = None _content = None - if content_type.split(";")[0] in ['application/json', 'text/json']: + if content_type.split(";")[0] in ["application/json", "text/json"]: if body is not None: - _json = self._serialize.body(body, 'BatchGetResolvedUrisDto') - elif content_type.split(";")[0] in ['application/json-patch+json', 'application/*+json']: + _json = self._serialize.body(body, "BatchGetResolvedUrisDto") + elif content_type.split(";")[0] in [ + "application/json-patch+json", + "application/*+json", + ]: if body is not None: - _json = self._serialize.body(body, 'BatchGetResolvedUrisDto') + _json = self._serialize.body(body, "BatchGetResolvedUrisDto") else: raise ValueError( "The content_type '{}' is not one of the allowed values: " - "['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']".format(content_type) + "['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']".format( + content_type + ) ) request = build_batch_get_resolved_uris_request( @@ -1026,27 +1148,36 @@ def batch_get_resolved_uris( content_type=content_type, json=_json, content=_content, - template_url=self.batch_get_resolved_uris.metadata['url'], + template_url=self.batch_get_resolved_uris.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchModelPathResponseDto', pipeline_response) + deserialized = self._deserialize( + "BatchModelPathResponseDto", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - batch_get_resolved_uris.metadata = {'url': '/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/batchGetResolvedUris'} # type: ignore - + batch_get_resolved_uris.metadata = {"url": "/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/batchGetResolvedUris"} # type: ignore @distributed_trace def query_by_id( @@ -1056,7 +1187,7 @@ def query_by_id( resource_group_name, # type: str workspace_name, # type: str include_deployment_settings=False, # type: Optional[bool] - **kwargs # type: Any + **kwargs, # type: Any ): # type: (...) -> "_models.Model" """query_by_id. @@ -1076,40 +1207,48 @@ def query_by_id( :rtype: ~azure.mgmt.machinelearningservices.models.Model :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Model"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Model"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_query_by_id_request( id=id, subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, include_deployment_settings=include_deployment_settings, - template_url=self.query_by_id.metadata['url'], + template_url=self.query_by_id.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Model', pipeline_response) + deserialized = self._deserialize("Model", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - query_by_id.metadata = {'url': '/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{id}'} # type: ignore - + query_by_id.metadata = {"url": "/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{id}"} # type: ignore @distributed_trace def delete( @@ -1118,7 +1257,7 @@ def delete( subscription_id, # type: str resource_group_name, # type: str workspace_name, # type: str - **kwargs # type: Any + **kwargs, # type: Any ): # type: (...) -> None """delete. @@ -1136,35 +1275,43 @@ def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( id=id, subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{id}'} # type: ignore - + delete.metadata = {"url": "/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{id}"} # type: ignore @distributed_trace def patch( @@ -1174,7 +1321,7 @@ def patch( resource_group_name, # type: str workspace_name, # type: str body, # type: List["_models.Operation"] - **kwargs # type: Any + **kwargs, # type: Any ): # type: (...) -> "_models.Model" """patch. @@ -1194,24 +1341,33 @@ def patch( :rtype: ~azure.mgmt.machinelearningservices.models.Model :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Model"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Model"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json-patch+json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json-patch+json" + ) # type: Optional[str] _json = None _content = None - if content_type.split(";")[0] in ['application/json', 'text/json']: - _json = self._serialize.body(body, '[Operation]') - elif content_type.split(";")[0] in ['application/json-patch+json', 'application/*+json']: - _json = self._serialize.body(body, '[Operation]') + if content_type.split(";")[0] in ["application/json", "text/json"]: + _json = self._serialize.body(body, "[Operation]") + elif content_type.split(";")[0] in [ + "application/json-patch+json", + "application/*+json", + ]: + _json = self._serialize.body(body, "[Operation]") else: raise ValueError( "The content_type '{}' is not one of the allowed values: " - "['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']".format(content_type) + "['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']".format( + content_type + ) ) request = build_patch_request( @@ -1222,27 +1378,34 @@ def patch( content_type=content_type, json=_json, content=_content, - template_url=self.patch.metadata['url'], + template_url=self.patch.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Model', pipeline_response) + deserialized = self._deserialize("Model", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - patch.metadata = {'url': '/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{id}'} # type: ignore - + patch.metadata = {"url": "/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{id}"} # type: ignore @distributed_trace def list_query_post( @@ -1251,7 +1414,7 @@ def list_query_post( resource_group_name, # type: str workspace_name, # type: str body=None, # type: Optional["_models.ListModelsRequest"] - **kwargs # type: Any + **kwargs, # type: Any ): # type: (...) -> "_models.ModelListModelsRequestPagedResponse" """list_query_post. @@ -1269,26 +1432,37 @@ def list_query_post( :rtype: ~azure.mgmt.machinelearningservices.models.ModelListModelsRequestPagedResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelListModelsRequestPagedResponse"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelListModelsRequestPagedResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json-patch+json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json-patch+json" + ) # type: Optional[str] _json = None _content = None - if content_type.split(";")[0] in ['application/json', 'text/json']: + if content_type.split(";")[0] in ["application/json", "text/json"]: if body is not None: - _json = self._serialize.body(body, 'ListModelsRequest') - elif content_type.split(";")[0] in ['application/json-patch+json', 'application/*+json']: + _json = self._serialize.body(body, "ListModelsRequest") + elif content_type.split(";")[0] in [ + "application/json-patch+json", + "application/*+json", + ]: if body is not None: - _json = self._serialize.body(body, 'ListModelsRequest') + _json = self._serialize.body(body, "ListModelsRequest") else: raise ValueError( "The content_type '{}' is not one of the allowed values: " - "['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']".format(content_type) + "['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']".format( + content_type + ) ) request = build_list_query_post_request( @@ -1298,27 +1472,36 @@ def list_query_post( content_type=content_type, json=_json, content=_content, - template_url=self.list_query_post.metadata['url'], + template_url=self.list_query_post.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ModelListModelsRequestPagedResponse', pipeline_response) + deserialized = self._deserialize( + "ModelListModelsRequestPagedResponse", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_query_post.metadata = {'url': '/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/list'} # type: ignore - + list_query_post.metadata = {"url": "/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/list"} # type: ignore @distributed_trace def batch_query( @@ -1327,7 +1510,7 @@ def batch_query( resource_group_name, # type: str workspace_name, # type: str body=None, # type: Optional["_models.ModelBatchDto"] - **kwargs # type: Any + **kwargs, # type: Any ): # type: (...) -> "_models.ModelBatchResponseDto" """batch_query. @@ -1345,26 +1528,37 @@ def batch_query( :rtype: ~azure.mgmt.machinelearningservices.models.ModelBatchResponseDto :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelBatchResponseDto"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelBatchResponseDto"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json-patch+json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json-patch+json" + ) # type: Optional[str] _json = None _content = None - if content_type.split(";")[0] in ['application/json', 'text/json']: + if content_type.split(";")[0] in ["application/json", "text/json"]: if body is not None: - _json = self._serialize.body(body, 'ModelBatchDto') - elif content_type.split(";")[0] in ['application/json-patch+json', 'application/*+json']: + _json = self._serialize.body(body, "ModelBatchDto") + elif content_type.split(";")[0] in [ + "application/json-patch+json", + "application/*+json", + ]: if body is not None: - _json = self._serialize.body(body, 'ModelBatchDto') + _json = self._serialize.body(body, "ModelBatchDto") else: raise ValueError( "The content_type '{}' is not one of the allowed values: " - "['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']".format(content_type) + "['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']".format( + content_type + ) ) request = build_batch_query_request( @@ -1374,27 +1568,36 @@ def batch_query( content_type=content_type, json=_json, content=_content, - template_url=self.batch_query.metadata['url'], + template_url=self.batch_query.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ModelBatchResponseDto', pipeline_response) + deserialized = self._deserialize( + "ModelBatchResponseDto", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - batch_query.metadata = {'url': '/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/querybatch'} # type: ignore - + batch_query.metadata = {"url": "/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/querybatch"} # type: ignore @distributed_trace def deployment_settings( @@ -1403,7 +1606,7 @@ def deployment_settings( resource_group_name, # type: str workspace_name, # type: str body=None, # type: Optional["_models.ModelSettingsIdentifiers"] - **kwargs # type: Any + **kwargs, # type: Any ): # type: (...) -> None """deployment_settings. @@ -1421,26 +1624,35 @@ def deployment_settings( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json-patch+json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json-patch+json" + ) # type: Optional[str] _json = None _content = None - if content_type.split(";")[0] in ['application/json', 'text/json']: + if content_type.split(";")[0] in ["application/json", "text/json"]: if body is not None: - _json = self._serialize.body(body, 'ModelSettingsIdentifiers') - elif content_type.split(";")[0] in ['application/json-patch+json', 'application/*+json']: + _json = self._serialize.body(body, "ModelSettingsIdentifiers") + elif content_type.split(";")[0] in [ + "application/json-patch+json", + "application/*+json", + ]: if body is not None: - _json = self._serialize.body(body, 'ModelSettingsIdentifiers') + _json = self._serialize.body(body, "ModelSettingsIdentifiers") else: raise ValueError( "The content_type '{}' is not one of the allowed values: " - "['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']".format(content_type) + "['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']".format( + content_type + ) ) request = build_deployment_settings_request( @@ -1450,20 +1662,27 @@ def deployment_settings( content_type=content_type, json=_json, content=_content, - template_url=self.deployment_settings.metadata['url'], + template_url=self.deployment_settings.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - deployment_settings.metadata = {'url': '/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/deploymentSettings'} # type: ignore - + deployment_settings.metadata = {"url": "/modelregistry/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/deploymentSettings"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/__init__.py index da46614477a9..71cf8fdc020d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/__init__.py @@ -10,9 +10,10 @@ from ._version import VERSION __version__ = VERSION -__all__ = ['AzureMachineLearningWorkspaces'] +__all__ = ["AzureMachineLearningWorkspaces"] # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk + patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/_azure_machine_learning_workspaces.py index fa5866277892..8e62959532b5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/_azure_machine_learning_workspaces.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/_azure_machine_learning_workspaces.py @@ -14,7 +14,10 @@ from . import models from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import AsyncOperationsOperations, RegistryManagementNonWorkspaceOperations +from .operations import ( + AsyncOperationsOperations, + RegistryManagementNonWorkspaceOperations, +) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -23,6 +26,7 @@ from azure.core.credentials import TokenCredential from azure.core.rest import HttpRequest, HttpResponse + class AzureMachineLearningWorkspaces(object): """AzureMachineLearningWorkspaces. @@ -45,16 +49,27 @@ def __init__( **kwargs # type: Any ): # type: (...) -> None - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, **kwargs) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._config = AzureMachineLearningWorkspacesConfiguration( + credential=credential, **kwargs + ) + self._client = ARMPipelineClient( + base_url=base_url, config=self._config, **kwargs + ) + + client_models = { + k: v for k, v in models.__dict__.items() if isinstance(v, type) + } self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.async_operations = AsyncOperationsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_management_non_workspace = RegistryManagementNonWorkspaceOperations(self._client, self._config, self._serialize, self._deserialize) - + self.async_operations = AsyncOperationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_management_non_workspace = ( + RegistryManagementNonWorkspaceOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) def _send_request( self, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/_configuration.py index 2ec7eb9ec4cc..b428b8d93394 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/_configuration.py @@ -10,7 +10,10 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ( + ARMChallengeAuthenticationPolicy, + ARMHttpLoggingPolicy, +) from ._version import VERSION @@ -37,28 +40,51 @@ def __init__( **kwargs # type: Any ): # type: (...) -> None - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) + super(AzureMachineLearningWorkspacesConfiguration, self).__init__( + **kwargs + ) if credential is None: raise ValueError("Parameter 'credential' must not be None.") self.credential = credential - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) + self.credential_scopes = kwargs.pop( + "credential_scopes", ["https://management.azure.com/.default"] + ) + kwargs.setdefault( + "sdk_moniker", "mgmt-machinelearningservices/{}".format(VERSION) + ) self._configure(**kwargs) def _configure( - self, - **kwargs # type: Any + self, **kwargs # type: Any ): # type: (...) -> None - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') + self.user_agent_policy = kwargs.get( + "user_agent_policy" + ) or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get( + "headers_policy" + ) or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy( + **kwargs + ) + self.logging_policy = kwargs.get( + "logging_policy" + ) or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get( + "http_logging_policy" + ) or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy( + **kwargs + ) + self.custom_hook_policy = kwargs.get( + "custom_hook_policy" + ) or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get( + "redirect_policy" + ) or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = ARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/_patch.py index 74e48ecd07cf..17dbc073e01b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/_patch.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/_patch.py @@ -25,7 +25,8 @@ # # -------------------------------------------------------------------------- + # This file is used for handwritten extensions to the generated code. Example: # https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md def patch_sdk(): - pass \ No newline at end of file + pass diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/_vendor.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/_vendor.py index 138f663c53a4..ed3373e9699d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/_vendor.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/_vendor.py @@ -7,13 +7,20 @@ from azure.core.pipeline.transport import HttpRequest + def _convert_request(request, files=None): data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + request = HttpRequest( + method=request.method, + url=request.url, + headers=request.headers, + data=data, + ) if files: request.set_formdata_body(files) return request + def _format_url_section(template, **kwargs): components = template.split("/") while components: @@ -22,6 +29,8 @@ def _format_url_section(template, **kwargs): except KeyError as key: formatted_components = template.split("/") components = [ - c for c in formatted_components if "{}".format(key.args[0]) not in c + c + for c in formatted_components + if "{}".format(key.args[0]) not in c ] template = "/".join(components) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/aio/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/aio/__init__.py index f67ccda966f1..b90ec7485f14 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/aio/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/aio/__init__.py @@ -7,9 +7,11 @@ # -------------------------------------------------------------------------- from ._azure_machine_learning_workspaces import AzureMachineLearningWorkspaces -__all__ = ['AzureMachineLearningWorkspaces'] + +__all__ = ["AzureMachineLearningWorkspaces"] # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk + patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/aio/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/aio/_azure_machine_learning_workspaces.py index b793c60b4eff..661fcef8f69d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/aio/_azure_machine_learning_workspaces.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/aio/_azure_machine_learning_workspaces.py @@ -15,12 +15,16 @@ from .. import models from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import AsyncOperationsOperations, RegistryManagementNonWorkspaceOperations +from .operations import ( + AsyncOperationsOperations, + RegistryManagementNonWorkspaceOperations, +) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential + class AzureMachineLearningWorkspaces: """AzureMachineLearningWorkspaces. @@ -42,21 +46,30 @@ def __init__( base_url: str = "", **kwargs: Any ) -> None: - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, **kwargs) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._config = AzureMachineLearningWorkspacesConfiguration( + credential=credential, **kwargs + ) + self._client = AsyncARMPipelineClient( + base_url=base_url, config=self._config, **kwargs + ) + + client_models = { + k: v for k, v in models.__dict__.items() if isinstance(v, type) + } self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.async_operations = AsyncOperationsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_management_non_workspace = RegistryManagementNonWorkspaceOperations(self._client, self._config, self._serialize, self._deserialize) - + self.async_operations = AsyncOperationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_management_non_workspace = ( + RegistryManagementNonWorkspaceOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) def _send_request( - self, - request: HttpRequest, - **kwargs: Any + self, request: HttpRequest, **kwargs: Any ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/aio/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/aio/_configuration.py index 26def54e12db..b9b9296a1a2e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/aio/_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/aio/_configuration.py @@ -10,7 +10,10 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy +from azure.mgmt.core.policies import ( + ARMHttpLoggingPolicy, + AsyncARMChallengeAuthenticationPolicy, +) from .._version import VERSION @@ -30,31 +33,50 @@ class AzureMachineLearningWorkspacesConfiguration(Configuration): """ def __init__( - self, - credential: "AsyncTokenCredential", - **kwargs: Any + self, credential: "AsyncTokenCredential", **kwargs: Any ) -> None: - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) + super(AzureMachineLearningWorkspacesConfiguration, self).__init__( + **kwargs + ) if credential is None: raise ValueError("Parameter 'credential' must not be None.") self.credential = credential - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) + self.credential_scopes = kwargs.pop( + "credential_scopes", ["https://management.azure.com/.default"] + ) + kwargs.setdefault( + "sdk_moniker", "mgmt-machinelearningservices/{}".format(VERSION) + ) self._configure(**kwargs) - def _configure( - self, - **kwargs: Any - ) -> None: - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get( + "user_agent_policy" + ) or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get( + "headers_policy" + ) or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy( + **kwargs + ) + self.logging_policy = kwargs.get( + "logging_policy" + ) or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get( + "http_logging_policy" + ) or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get( + "retry_policy" + ) or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get( + "custom_hook_policy" + ) or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get( + "redirect_policy" + ) or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/aio/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/aio/_patch.py index 74e48ecd07cf..17dbc073e01b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/aio/_patch.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/aio/_patch.py @@ -25,7 +25,8 @@ # # -------------------------------------------------------------------------- + # This file is used for handwritten extensions to the generated code. Example: # https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md def patch_sdk(): - pass \ No newline at end of file + pass diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/aio/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/aio/operations/__init__.py index f9352a593089..64ad6ae3c2e0 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/aio/operations/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/aio/operations/__init__.py @@ -7,9 +7,11 @@ # -------------------------------------------------------------------------- from ._async_operations_operations import AsyncOperationsOperations -from ._registry_management_non_workspace_operations import RegistryManagementNonWorkspaceOperations +from ._registry_management_non_workspace_operations import ( + RegistryManagementNonWorkspaceOperations, +) __all__ = [ - 'AsyncOperationsOperations', - 'RegistryManagementNonWorkspaceOperations', + "AsyncOperationsOperations", + "RegistryManagementNonWorkspaceOperations", ] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/aio/operations/_async_operations_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/aio/operations/_async_operations_operations.py index 03f7e53457e3..9232d2f3b26d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/aio/operations/_async_operations_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/aio/operations/_async_operations_operations.py @@ -9,7 +9,13 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -18,9 +24,18 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._async_operations_operations import build_asyc_operations_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._async_operations_operations import ( + build_asyc_operations_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class AsyncOperationsOperations: """AsyncOperationsOperations async operations. @@ -45,11 +60,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._config = config @distributed_trace_async - async def asyc_operations( - self, - operation_id: str, - **kwargs: Any - ) -> None: + async def asyc_operations(self, operation_id: str, **kwargs: Any) -> None: """asyc_operations. :param operation_id: @@ -59,29 +70,37 @@ async def asyc_operations( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_asyc_operations_request( operation_id=operation_id, - template_url=self.asyc_operations.metadata['url'], + template_url=self.asyc_operations.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - asyc_operations.metadata = {'url': '/registrymanagement/v1.0/operations/{operationId}'} # type: ignore - + asyc_operations.metadata = {"url": "/registrymanagement/v1.0/operations/{operationId}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/aio/operations/_registry_management_non_workspace_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/aio/operations/_registry_management_non_workspace_operations.py index 70eaef3646ca..3e0a927ae971 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/aio/operations/_registry_management_non_workspace_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/aio/operations/_registry_management_non_workspace_operations.py @@ -9,7 +9,13 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -18,9 +24,18 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_management_non_workspace_operations import build_registry_management_non_workspace_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_management_non_workspace_operations import ( + build_registry_management_non_workspace_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryManagementNonWorkspaceOperations: """RegistryManagementNonWorkspaceOperations async operations. @@ -46,9 +61,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace_async async def registry_management_non_workspace( - self, - registry_name: str, - **kwargs: Any + self, registry_name: str, **kwargs: Any ) -> "_models.RegistryDiscoveryDto": """registry_management_non_workspace. @@ -59,33 +72,47 @@ async def registry_management_non_workspace( :rtype: ~azure.mgmt.machinelearningservices.models.RegistryDiscoveryDto :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegistryDiscoveryDto"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.RegistryDiscoveryDto"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_registry_management_non_workspace_request( registry_name=registry_name, - template_url=self.registry_management_non_workspace.metadata['url'], + template_url=self.registry_management_non_workspace.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('RegistryDiscoveryDto', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "RegistryDiscoveryDto", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - registry_management_non_workspace.metadata = {'url': '/registrymanagement/v1.0/registries/{registryName}/discovery'} # type: ignore - + registry_management_non_workspace.metadata = {"url": "/registrymanagement/v1.0/registries/{registryName}/discovery"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/models/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/models/__init__.py index 1809507c4524..f8ec1cd6ea4b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/models/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/models/__init__.py @@ -22,10 +22,10 @@ from ._models import RootError # type: ignore __all__ = [ - 'DebugInfoResponse', - 'ErrorAdditionalInfo', - 'ErrorResponse', - 'InnerErrorResponse', - 'RegistryDiscoveryDto', - 'RootError', + "DebugInfoResponse", + "ErrorAdditionalInfo", + "ErrorResponse", + "InnerErrorResponse", + "RegistryDiscoveryDto", + "RootError", ] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/models/_models.py index 461080398fe3..61909aab9768 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/models/_models.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/models/_models.py @@ -27,18 +27,18 @@ class DebugInfoResponse(msrest.serialization.Model): """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'stack_trace': {'key': 'stackTrace', 'type': 'str'}, - 'inner_exception': {'key': 'innerException', 'type': 'DebugInfoResponse'}, - 'data': {'key': 'data', 'type': '{object}'}, - 'error_response': {'key': 'errorResponse', 'type': 'ErrorResponse'}, + "type": {"key": "type", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "stack_trace": {"key": "stackTrace", "type": "str"}, + "inner_exception": { + "key": "innerException", + "type": "DebugInfoResponse", + }, + "data": {"key": "data", "type": "{object}"}, + "error_response": {"key": "errorResponse", "type": "ErrorResponse"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword type: :paramtype type: str @@ -54,12 +54,12 @@ def __init__( :paramtype error_response: ~azure.mgmt.machinelearningservices.models.ErrorResponse """ super(DebugInfoResponse, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.message = kwargs.get('message', None) - self.stack_trace = kwargs.get('stack_trace', None) - self.inner_exception = kwargs.get('inner_exception', None) - self.data = kwargs.get('data', None) - self.error_response = kwargs.get('error_response', None) + self.type = kwargs.get("type", None) + self.message = kwargs.get("message", None) + self.stack_trace = kwargs.get("stack_trace", None) + self.inner_exception = kwargs.get("inner_exception", None) + self.data = kwargs.get("data", None) + self.error_response = kwargs.get("error_response", None) class ErrorAdditionalInfo(msrest.serialization.Model): @@ -72,14 +72,11 @@ class ErrorAdditionalInfo(msrest.serialization.Model): """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, + "type": {"key": "type", "type": "str"}, + "info": {"key": "info", "type": "object"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword type: :paramtype type: str @@ -87,8 +84,8 @@ def __init__( :paramtype info: any """ super(ErrorAdditionalInfo, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.info = kwargs.get('info', None) + self.type = kwargs.get("type", None) + self.info = kwargs.get("info", None) class ErrorResponse(msrest.serialization.Model): @@ -112,19 +109,16 @@ class ErrorResponse(msrest.serialization.Model): """ _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'error': {'key': 'error', 'type': 'RootError'}, - 'correlation': {'key': 'correlation', 'type': '{str}'}, - 'environment': {'key': 'environment', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'time': {'key': 'time', 'type': 'iso-8601'}, - 'component_name': {'key': 'componentName', 'type': 'str'}, + "additional_properties": {"key": "", "type": "{object}"}, + "error": {"key": "error", "type": "RootError"}, + "correlation": {"key": "correlation", "type": "{str}"}, + "environment": {"key": "environment", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "time": {"key": "time", "type": "iso-8601"}, + "component_name": {"key": "componentName", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword additional_properties: Unmatched properties from the message are deserialized to this collection. @@ -143,13 +137,13 @@ def __init__( :paramtype component_name: str """ super(ErrorResponse, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.error = kwargs.get('error', None) - self.correlation = kwargs.get('correlation', None) - self.environment = kwargs.get('environment', None) - self.location = kwargs.get('location', None) - self.time = kwargs.get('time', None) - self.component_name = kwargs.get('component_name', None) + self.additional_properties = kwargs.get("additional_properties", None) + self.error = kwargs.get("error", None) + self.correlation = kwargs.get("correlation", None) + self.environment = kwargs.get("environment", None) + self.location = kwargs.get("location", None) + self.time = kwargs.get("time", None) + self.component_name = kwargs.get("component_name", None) class InnerErrorResponse(msrest.serialization.Model): @@ -162,14 +156,11 @@ class InnerErrorResponse(msrest.serialization.Model): """ _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'inner_error': {'key': 'innerError', 'type': 'InnerErrorResponse'}, + "code": {"key": "code", "type": "str"}, + "inner_error": {"key": "innerError", "type": "InnerErrorResponse"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword code: :paramtype code: str @@ -177,8 +168,8 @@ def __init__( :paramtype inner_error: ~azure.mgmt.machinelearningservices.models.InnerErrorResponse """ super(InnerErrorResponse, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.inner_error = kwargs.get('inner_error', None) + self.code = kwargs.get("code", None) + self.inner_error = kwargs.get("inner_error", None) class RegistryDiscoveryDto(msrest.serialization.Model): @@ -203,20 +194,20 @@ class RegistryDiscoveryDto(msrest.serialization.Model): """ _attribute_map = { - 'registry_name': {'key': 'registryName', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'primary_region': {'key': 'primaryRegion', 'type': 'str'}, - 'regions': {'key': 'regions', 'type': '[str]'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'workspace_name': {'key': 'workspaceName', 'type': 'str'}, - 'primary_region_resource_provider_uri': {'key': 'primaryRegionResourceProviderUri', 'type': 'str'}, + "registry_name": {"key": "registryName", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "primary_region": {"key": "primaryRegion", "type": "str"}, + "regions": {"key": "regions", "type": "[str]"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, + "resource_group": {"key": "resourceGroup", "type": "str"}, + "workspace_name": {"key": "workspaceName", "type": "str"}, + "primary_region_resource_provider_uri": { + "key": "primaryRegionResourceProviderUri", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword registry_name: :paramtype registry_name: str @@ -236,14 +227,16 @@ def __init__( :paramtype primary_region_resource_provider_uri: str """ super(RegistryDiscoveryDto, self).__init__(**kwargs) - self.registry_name = kwargs.get('registry_name', None) - self.tenant_id = kwargs.get('tenant_id', None) - self.primary_region = kwargs.get('primary_region', None) - self.regions = kwargs.get('regions', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.resource_group = kwargs.get('resource_group', None) - self.workspace_name = kwargs.get('workspace_name', None) - self.primary_region_resource_provider_uri = kwargs.get('primary_region_resource_provider_uri', None) + self.registry_name = kwargs.get("registry_name", None) + self.tenant_id = kwargs.get("tenant_id", None) + self.primary_region = kwargs.get("primary_region", None) + self.regions = kwargs.get("regions", None) + self.subscription_id = kwargs.get("subscription_id", None) + self.resource_group = kwargs.get("resource_group", None) + self.workspace_name = kwargs.get("workspace_name", None) + self.primary_region_resource_provider_uri = kwargs.get( + "primary_region_resource_provider_uri", None + ) class RootError(msrest.serialization.Model): @@ -276,24 +269,24 @@ class RootError(msrest.serialization.Model): """ _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'severity': {'key': 'severity', 'type': 'int'}, - 'message': {'key': 'message', 'type': 'str'}, - 'message_format': {'key': 'messageFormat', 'type': 'str'}, - 'message_parameters': {'key': 'messageParameters', 'type': '{str}'}, - 'reference_code': {'key': 'referenceCode', 'type': 'str'}, - 'details_uri': {'key': 'detailsUri', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[RootError]'}, - 'inner_error': {'key': 'innerError', 'type': 'InnerErrorResponse'}, - 'debug_info': {'key': 'debugInfo', 'type': 'DebugInfoResponse'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + "code": {"key": "code", "type": "str"}, + "severity": {"key": "severity", "type": "int"}, + "message": {"key": "message", "type": "str"}, + "message_format": {"key": "messageFormat", "type": "str"}, + "message_parameters": {"key": "messageParameters", "type": "{str}"}, + "reference_code": {"key": "referenceCode", "type": "str"}, + "details_uri": {"key": "detailsUri", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[RootError]"}, + "inner_error": {"key": "innerError", "type": "InnerErrorResponse"}, + "debug_info": {"key": "debugInfo", "type": "DebugInfoResponse"}, + "additional_info": { + "key": "additionalInfo", + "type": "[ErrorAdditionalInfo]", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword code: :paramtype code: str @@ -322,15 +315,15 @@ def __init__( list[~azure.mgmt.machinelearningservices.models.ErrorAdditionalInfo] """ super(RootError, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.severity = kwargs.get('severity', None) - self.message = kwargs.get('message', None) - self.message_format = kwargs.get('message_format', None) - self.message_parameters = kwargs.get('message_parameters', None) - self.reference_code = kwargs.get('reference_code', None) - self.details_uri = kwargs.get('details_uri', None) - self.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - self.inner_error = kwargs.get('inner_error', None) - self.debug_info = kwargs.get('debug_info', None) - self.additional_info = kwargs.get('additional_info', None) + self.code = kwargs.get("code", None) + self.severity = kwargs.get("severity", None) + self.message = kwargs.get("message", None) + self.message_format = kwargs.get("message_format", None) + self.message_parameters = kwargs.get("message_parameters", None) + self.reference_code = kwargs.get("reference_code", None) + self.details_uri = kwargs.get("details_uri", None) + self.target = kwargs.get("target", None) + self.details = kwargs.get("details", None) + self.inner_error = kwargs.get("inner_error", None) + self.debug_info = kwargs.get("debug_info", None) + self.additional_info = kwargs.get("additional_info", None) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/models/_models_py3.py index fa169932bac4..9e28e197ae6b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/models/_models_py3.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/models/_models_py3.py @@ -30,12 +30,15 @@ class DebugInfoResponse(msrest.serialization.Model): """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'stack_trace': {'key': 'stackTrace', 'type': 'str'}, - 'inner_exception': {'key': 'innerException', 'type': 'DebugInfoResponse'}, - 'data': {'key': 'data', 'type': '{object}'}, - 'error_response': {'key': 'errorResponse', 'type': 'ErrorResponse'}, + "type": {"key": "type", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "stack_trace": {"key": "stackTrace", "type": "str"}, + "inner_exception": { + "key": "innerException", + "type": "DebugInfoResponse", + }, + "data": {"key": "data", "type": "{object}"}, + "error_response": {"key": "errorResponse", "type": "ErrorResponse"}, } def __init__( @@ -82,8 +85,8 @@ class ErrorAdditionalInfo(msrest.serialization.Model): """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, + "type": {"key": "type", "type": "str"}, + "info": {"key": "info", "type": "object"}, } def __init__( @@ -125,13 +128,13 @@ class ErrorResponse(msrest.serialization.Model): """ _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'error': {'key': 'error', 'type': 'RootError'}, - 'correlation': {'key': 'correlation', 'type': '{str}'}, - 'environment': {'key': 'environment', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'time': {'key': 'time', 'type': 'iso-8601'}, - 'component_name': {'key': 'componentName', 'type': 'str'}, + "additional_properties": {"key": "", "type": "{object}"}, + "error": {"key": "error", "type": "RootError"}, + "correlation": {"key": "correlation", "type": "{str}"}, + "environment": {"key": "environment", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "time": {"key": "time", "type": "iso-8601"}, + "component_name": {"key": "componentName", "type": "str"}, } def __init__( @@ -183,8 +186,8 @@ class InnerErrorResponse(msrest.serialization.Model): """ _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'inner_error': {'key': 'innerError', 'type': 'InnerErrorResponse'}, + "code": {"key": "code", "type": "str"}, + "inner_error": {"key": "innerError", "type": "InnerErrorResponse"}, } def __init__( @@ -227,14 +230,17 @@ class RegistryDiscoveryDto(msrest.serialization.Model): """ _attribute_map = { - 'registry_name': {'key': 'registryName', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'primary_region': {'key': 'primaryRegion', 'type': 'str'}, - 'regions': {'key': 'regions', 'type': '[str]'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'workspace_name': {'key': 'workspaceName', 'type': 'str'}, - 'primary_region_resource_provider_uri': {'key': 'primaryRegionResourceProviderUri', 'type': 'str'}, + "registry_name": {"key": "registryName", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "primary_region": {"key": "primaryRegion", "type": "str"}, + "regions": {"key": "regions", "type": "[str]"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, + "resource_group": {"key": "resourceGroup", "type": "str"}, + "workspace_name": {"key": "workspaceName", "type": "str"}, + "primary_region_resource_provider_uri": { + "key": "primaryRegionResourceProviderUri", + "type": "str", + }, } def __init__( @@ -276,7 +282,9 @@ def __init__( self.subscription_id = subscription_id self.resource_group = resource_group self.workspace_name = workspace_name - self.primary_region_resource_provider_uri = primary_region_resource_provider_uri + self.primary_region_resource_provider_uri = ( + primary_region_resource_provider_uri + ) class RootError(msrest.serialization.Model): @@ -309,18 +317,21 @@ class RootError(msrest.serialization.Model): """ _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'severity': {'key': 'severity', 'type': 'int'}, - 'message': {'key': 'message', 'type': 'str'}, - 'message_format': {'key': 'messageFormat', 'type': 'str'}, - 'message_parameters': {'key': 'messageParameters', 'type': '{str}'}, - 'reference_code': {'key': 'referenceCode', 'type': 'str'}, - 'details_uri': {'key': 'detailsUri', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[RootError]'}, - 'inner_error': {'key': 'innerError', 'type': 'InnerErrorResponse'}, - 'debug_info': {'key': 'debugInfo', 'type': 'DebugInfoResponse'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + "code": {"key": "code", "type": "str"}, + "severity": {"key": "severity", "type": "int"}, + "message": {"key": "message", "type": "str"}, + "message_format": {"key": "messageFormat", "type": "str"}, + "message_parameters": {"key": "messageParameters", "type": "{str}"}, + "reference_code": {"key": "referenceCode", "type": "str"}, + "details_uri": {"key": "detailsUri", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[RootError]"}, + "inner_error": {"key": "innerError", "type": "InnerErrorResponse"}, + "debug_info": {"key": "debugInfo", "type": "DebugInfoResponse"}, + "additional_info": { + "key": "additionalInfo", + "type": "[ErrorAdditionalInfo]", + }, } def __init__( diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/operations/__init__.py index f9352a593089..64ad6ae3c2e0 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/operations/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/operations/__init__.py @@ -7,9 +7,11 @@ # -------------------------------------------------------------------------- from ._async_operations_operations import AsyncOperationsOperations -from ._registry_management_non_workspace_operations import RegistryManagementNonWorkspaceOperations +from ._registry_management_non_workspace_operations import ( + RegistryManagementNonWorkspaceOperations, +) __all__ = [ - 'AsyncOperationsOperations', - 'RegistryManagementNonWorkspaceOperations', + "AsyncOperationsOperations", + "RegistryManagementNonWorkspaceOperations", ] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/operations/_async_operations_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/operations/_async_operations_operations.py index 06dbaffa4916..392c1e8efe25 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/operations/_async_operations_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/operations/_async_operations_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest @@ -23,8 +29,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Generic, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -49,6 +61,7 @@ def build_asyc_operations_request( **kwargs ) + # fmt: on class AsyncOperationsOperations(object): """AsyncOperationsOperations operations. @@ -88,29 +101,37 @@ def asyc_operations( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_asyc_operations_request( operation_id=operation_id, - template_url=self.asyc_operations.metadata['url'], + template_url=self.asyc_operations.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - asyc_operations.metadata = {'url': '/registrymanagement/v1.0/operations/{operationId}'} # type: ignore - + asyc_operations.metadata = {"url": "/registrymanagement/v1.0/operations/{operationId}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/operations/_registry_management_non_workspace_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/operations/_registry_management_non_workspace_operations.py index cca6659346f0..3944fd934bf5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/operations/_registry_management_non_workspace_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/registry_discovery/operations/_registry_management_non_workspace_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest @@ -23,8 +29,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Generic, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -55,6 +67,7 @@ def build_registry_management_non_workspace_request( **kwargs ) + # fmt: on class RegistryManagementNonWorkspaceOperations(object): """RegistryManagementNonWorkspaceOperations operations. @@ -94,33 +107,47 @@ def registry_management_non_workspace( :rtype: ~azure.mgmt.machinelearningservices.models.RegistryDiscoveryDto :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegistryDiscoveryDto"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.RegistryDiscoveryDto"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_registry_management_non_workspace_request( registry_name=registry_name, - template_url=self.registry_management_non_workspace.metadata['url'], + template_url=self.registry_management_non_workspace.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('RegistryDiscoveryDto', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "RegistryDiscoveryDto", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - registry_management_non_workspace.metadata = {'url': '/registrymanagement/v1.0/registries/{registryName}/discovery'} # type: ignore - + registry_management_non_workspace.metadata = {"url": "/registrymanagement/v1.0/registries/{registryName}/discovery"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/__init__.py index da46614477a9..71cf8fdc020d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/__init__.py @@ -10,9 +10,10 @@ from ._version import VERSION __version__ = VERSION -__all__ = ['AzureMachineLearningWorkspaces'] +__all__ = ["AzureMachineLearningWorkspaces"] # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk + patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/_azure_machine_learning_workspaces.py index 7e5916c9862a..56d514cf47dc 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/_azure_machine_learning_workspaces.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/_azure_machine_learning_workspaces.py @@ -15,7 +15,16 @@ from . import models from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import DeleteOperations, EventsOperations, ExperimentsOperations, MetricOperations, RunArtifactsOperations, RunOperations, RunsOperations, SpansOperations +from .operations import ( + DeleteOperations, + EventsOperations, + ExperimentsOperations, + MetricOperations, + RunArtifactsOperations, + RunOperations, + RunsOperations, + SpansOperations, +) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -24,7 +33,10 @@ from azure.core.credentials import TokenCredential from azure.core.rest import HttpRequest, HttpResponse -class AzureMachineLearningWorkspaces(object): # pylint: disable=too-many-instance-attributes + +class AzureMachineLearningWorkspaces( + object +): # pylint: disable=too-many-instance-attributes """AzureMachineLearningWorkspaces. :ivar delete: DeleteOperations operations @@ -58,22 +70,43 @@ def __init__( **kwargs # type: Any ): # type: (...) -> None - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, **kwargs) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._config = AzureMachineLearningWorkspacesConfiguration( + credential=credential, **kwargs + ) + self._client = ARMPipelineClient( + base_url=base_url, config=self._config, **kwargs + ) + + client_models = { + k: v for k, v in models.__dict__.items() if isinstance(v, type) + } self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.delete = DeleteOperations(self._client, self._config, self._serialize, self._deserialize) - self.events = EventsOperations(self._client, self._config, self._serialize, self._deserialize) - self.experiments = ExperimentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.metric = MetricOperations(self._client, self._config, self._serialize, self._deserialize) - self.runs = RunsOperations(self._client, self._config, self._serialize, self._deserialize) - self.run_artifacts = RunArtifactsOperations(self._client, self._config, self._serialize, self._deserialize) - self.run = RunOperations(self._client, self._config, self._serialize, self._deserialize) - self.spans = SpansOperations(self._client, self._config, self._serialize, self._deserialize) - + self.delete = DeleteOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.events = EventsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.experiments = ExperimentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.metric = MetricOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.runs = RunsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.run_artifacts = RunArtifactsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.run = RunOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.spans = SpansOperations( + self._client, self._config, self._serialize, self._deserialize + ) def _send_request( self, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/_configuration.py index b418413f0de7..95057da28752 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/_configuration.py @@ -10,7 +10,10 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ( + ARMChallengeAuthenticationPolicy, + ARMHttpLoggingPolicy, +) from ._version import VERSION @@ -21,7 +24,9 @@ from azure.core.credentials import TokenCredential -class AzureMachineLearningWorkspacesConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AzureMachineLearningWorkspacesConfiguration( + Configuration +): # pylint: disable=too-many-instance-attributes """Configuration for AzureMachineLearningWorkspaces. Note that all parameters used to create this instance are saved as instance @@ -37,28 +42,51 @@ def __init__( **kwargs # type: Any ): # type: (...) -> None - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) + super(AzureMachineLearningWorkspacesConfiguration, self).__init__( + **kwargs + ) if credential is None: raise ValueError("Parameter 'credential' must not be None.") self.credential = credential - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) + self.credential_scopes = kwargs.pop( + "credential_scopes", ["https://management.azure.com/.default"] + ) + kwargs.setdefault( + "sdk_moniker", "mgmt-machinelearningservices/{}".format(VERSION) + ) self._configure(**kwargs) def _configure( - self, - **kwargs # type: Any + self, **kwargs # type: Any ): # type: (...) -> None - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') + self.user_agent_policy = kwargs.get( + "user_agent_policy" + ) or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get( + "headers_policy" + ) or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy( + **kwargs + ) + self.logging_policy = kwargs.get( + "logging_policy" + ) or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get( + "http_logging_policy" + ) or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy( + **kwargs + ) + self.custom_hook_policy = kwargs.get( + "custom_hook_policy" + ) or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get( + "redirect_policy" + ) or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = ARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/_patch.py index 74e48ecd07cf..17dbc073e01b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/_patch.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/_patch.py @@ -25,7 +25,8 @@ # # -------------------------------------------------------------------------- + # This file is used for handwritten extensions to the generated code. Example: # https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md def patch_sdk(): - pass \ No newline at end of file + pass diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/_vendor.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/_vendor.py index 138f663c53a4..ed3373e9699d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/_vendor.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/_vendor.py @@ -7,13 +7,20 @@ from azure.core.pipeline.transport import HttpRequest + def _convert_request(request, files=None): data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + request = HttpRequest( + method=request.method, + url=request.url, + headers=request.headers, + data=data, + ) if files: request.set_formdata_body(files) return request + def _format_url_section(template, **kwargs): components = template.split("/") while components: @@ -22,6 +29,8 @@ def _format_url_section(template, **kwargs): except KeyError as key: formatted_components = template.split("/") components = [ - c for c in formatted_components if "{}".format(key.args[0]) not in c + c + for c in formatted_components + if "{}".format(key.args[0]) not in c ] template = "/".join(components) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/__init__.py index f67ccda966f1..b90ec7485f14 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/__init__.py @@ -7,9 +7,11 @@ # -------------------------------------------------------------------------- from ._azure_machine_learning_workspaces import AzureMachineLearningWorkspaces -__all__ = ['AzureMachineLearningWorkspaces'] + +__all__ = ["AzureMachineLearningWorkspaces"] # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk + patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/_azure_machine_learning_workspaces.py index 92b775fb9a32..9aab9324380f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/_azure_machine_learning_workspaces.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/_azure_machine_learning_workspaces.py @@ -16,13 +16,23 @@ from .. import models from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import DeleteOperations, EventsOperations, ExperimentsOperations, MetricOperations, RunArtifactsOperations, RunOperations, RunsOperations, SpansOperations +from .operations import ( + DeleteOperations, + EventsOperations, + ExperimentsOperations, + MetricOperations, + RunArtifactsOperations, + RunOperations, + RunsOperations, + SpansOperations, +) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class AzureMachineLearningWorkspaces: # pylint: disable=too-many-instance-attributes + +class AzureMachineLearningWorkspaces: # pylint: disable=too-many-instance-attributes """AzureMachineLearningWorkspaces. :ivar delete: DeleteOperations operations @@ -56,27 +66,46 @@ def __init__( base_url: str = "", **kwargs: Any ) -> None: - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, **kwargs) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._config = AzureMachineLearningWorkspacesConfiguration( + credential=credential, **kwargs + ) + self._client = AsyncARMPipelineClient( + base_url=base_url, config=self._config, **kwargs + ) + + client_models = { + k: v for k, v in models.__dict__.items() if isinstance(v, type) + } self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.delete = DeleteOperations(self._client, self._config, self._serialize, self._deserialize) - self.events = EventsOperations(self._client, self._config, self._serialize, self._deserialize) - self.experiments = ExperimentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.metric = MetricOperations(self._client, self._config, self._serialize, self._deserialize) - self.runs = RunsOperations(self._client, self._config, self._serialize, self._deserialize) - self.run_artifacts = RunArtifactsOperations(self._client, self._config, self._serialize, self._deserialize) - self.run = RunOperations(self._client, self._config, self._serialize, self._deserialize) - self.spans = SpansOperations(self._client, self._config, self._serialize, self._deserialize) - + self.delete = DeleteOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.events = EventsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.experiments = ExperimentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.metric = MetricOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.runs = RunsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.run_artifacts = RunArtifactsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.run = RunOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.spans = SpansOperations( + self._client, self._config, self._serialize, self._deserialize + ) def _send_request( - self, - request: HttpRequest, - **kwargs: Any + self, request: HttpRequest, **kwargs: Any ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/_configuration.py index 6d0b0e4d5488..9ed98211cb4a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/_configuration.py @@ -10,7 +10,10 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy +from azure.mgmt.core.policies import ( + ARMHttpLoggingPolicy, + AsyncARMChallengeAuthenticationPolicy, +) from .._version import VERSION @@ -19,7 +22,9 @@ from azure.core.credentials_async import AsyncTokenCredential -class AzureMachineLearningWorkspacesConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AzureMachineLearningWorkspacesConfiguration( + Configuration +): # pylint: disable=too-many-instance-attributes """Configuration for AzureMachineLearningWorkspaces. Note that all parameters used to create this instance are saved as instance @@ -30,31 +35,50 @@ class AzureMachineLearningWorkspacesConfiguration(Configuration): # pylint: dis """ def __init__( - self, - credential: "AsyncTokenCredential", - **kwargs: Any + self, credential: "AsyncTokenCredential", **kwargs: Any ) -> None: - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) + super(AzureMachineLearningWorkspacesConfiguration, self).__init__( + **kwargs + ) if credential is None: raise ValueError("Parameter 'credential' must not be None.") self.credential = credential - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) + self.credential_scopes = kwargs.pop( + "credential_scopes", ["https://management.azure.com/.default"] + ) + kwargs.setdefault( + "sdk_moniker", "mgmt-machinelearningservices/{}".format(VERSION) + ) self._configure(**kwargs) - def _configure( - self, - **kwargs: Any - ) -> None: - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get( + "user_agent_policy" + ) or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get( + "headers_policy" + ) or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy( + **kwargs + ) + self.logging_policy = kwargs.get( + "logging_policy" + ) or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get( + "http_logging_policy" + ) or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get( + "retry_policy" + ) or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get( + "custom_hook_policy" + ) or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get( + "redirect_policy" + ) or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/_patch.py index 74e48ecd07cf..17dbc073e01b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/_patch.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/_patch.py @@ -25,7 +25,8 @@ # # -------------------------------------------------------------------------- + # This file is used for handwritten extensions to the generated code. Example: # https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md def patch_sdk(): - pass \ No newline at end of file + pass diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/operations/__init__.py index 3e84a44acc59..aab5d99d55d1 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/operations/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/operations/__init__.py @@ -16,12 +16,12 @@ from ._spans_operations import SpansOperations __all__ = [ - 'DeleteOperations', - 'EventsOperations', - 'ExperimentsOperations', - 'MetricOperations', - 'RunsOperations', - 'RunArtifactsOperations', - 'RunOperations', - 'SpansOperations', + "DeleteOperations", + "EventsOperations", + "ExperimentsOperations", + "MetricOperations", + "RunsOperations", + "RunArtifactsOperations", + "RunOperations", + "SpansOperations", ] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/operations/_delete_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/operations/_delete_operations.py index 6841ffdc4ab8..ffa802a6610c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/operations/_delete_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/operations/_delete_operations.py @@ -8,7 +8,13 @@ # -------------------------------------------------------------------------- from typing import Any, Callable, Dict, Optional, TypeVar -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -17,9 +23,19 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._delete_operations import build_get_configuration_request, build_patch_configuration_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._delete_operations import ( + build_get_configuration_request, + build_patch_configuration_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class DeleteOperations: """DeleteOperations async operations. @@ -67,16 +83,22 @@ async def patch_configuration( :rtype: ~azure.mgmt.machinelearningservices.models.DeleteConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DeleteConfiguration"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DeleteConfiguration"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'DeleteConfiguration') + _json = self._serialize.body(body, "DeleteConfiguration") else: _json = None @@ -86,32 +108,39 @@ async def patch_configuration( workspace_name=workspace_name, content_type=content_type, json=_json, - template_url=self.patch_configuration.metadata['url'], + template_url=self.patch_configuration.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DeleteConfiguration', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "DeleteConfiguration", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - patch_configuration.metadata = {'url': "/history/v1.0/private/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/deleteConfiguration"} # type: ignore - + patch_configuration.metadata = {"url": "/history/v1.0/private/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/deleteConfiguration"} # type: ignore @distributed_trace_async async def get_configuration( @@ -134,40 +163,50 @@ async def get_configuration( :rtype: ~azure.mgmt.machinelearningservices.models.DeleteConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DeleteConfiguration"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DeleteConfiguration"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_configuration_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.get_configuration.metadata['url'], + template_url=self.get_configuration.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DeleteConfiguration', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "DeleteConfiguration", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_configuration.metadata = {'url': "/history/v1.0/private/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/deleteConfiguration"} # type: ignore - + get_configuration.metadata = {"url": "/history/v1.0/private/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/deleteConfiguration"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/operations/_events_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/operations/_events_operations.py index 03dc9d4206ff..1d632154ee32 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/operations/_events_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/operations/_events_operations.py @@ -8,7 +8,13 @@ # -------------------------------------------------------------------------- from typing import Any, Callable, Dict, Optional, TypeVar -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -17,9 +23,23 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._events_operations import build_batch_post_by_experiment_id_request, build_batch_post_by_experiment_name_request, build_batch_post_request, build_post_by_experiment_id_request, build_post_by_experiment_name_request, build_post_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._events_operations import ( + build_batch_post_by_experiment_id_request, + build_batch_post_by_experiment_name_request, + build_batch_post_request, + build_post_by_experiment_id_request, + build_post_by_experiment_name_request, + build_post_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class EventsOperations: """EventsOperations async operations. @@ -70,16 +90,22 @@ async def batch_post_by_experiment_name( :rtype: ~azure.mgmt.machinelearningservices.models.BatchEventCommandResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEventCommandResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchEventCommandResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'BatchEventCommand') + _json = self._serialize.body(body, "BatchEventCommand") else: _json = None @@ -90,32 +116,39 @@ async def batch_post_by_experiment_name( experiment_name=experiment_name, content_type=content_type, json=_json, - template_url=self.batch_post_by_experiment_name.metadata['url'], + template_url=self.batch_post_by_experiment_name.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('BatchEventCommandResult', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "BatchEventCommandResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - batch_post_by_experiment_name.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/batch/events"} # type: ignore - + batch_post_by_experiment_name.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/batch/events"} # type: ignore @distributed_trace_async async def batch_post_by_experiment_id( @@ -144,16 +177,22 @@ async def batch_post_by_experiment_id( :rtype: ~azure.mgmt.machinelearningservices.models.BatchEventCommandResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEventCommandResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchEventCommandResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'BatchEventCommand') + _json = self._serialize.body(body, "BatchEventCommand") else: _json = None @@ -164,32 +203,39 @@ async def batch_post_by_experiment_id( experiment_id=experiment_id, content_type=content_type, json=_json, - template_url=self.batch_post_by_experiment_id.metadata['url'], + template_url=self.batch_post_by_experiment_id.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('BatchEventCommandResult', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "BatchEventCommandResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - batch_post_by_experiment_id.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/batch/events"} # type: ignore - + batch_post_by_experiment_id.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/batch/events"} # type: ignore @distributed_trace_async async def batch_post( @@ -215,16 +261,22 @@ async def batch_post( :rtype: ~azure.mgmt.machinelearningservices.models.BatchEventCommandResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEventCommandResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchEventCommandResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'BatchEventCommand') + _json = self._serialize.body(body, "BatchEventCommand") else: _json = None @@ -234,32 +286,39 @@ async def batch_post( workspace_name=workspace_name, content_type=content_type, json=_json, - template_url=self.batch_post.metadata['url'], + template_url=self.batch_post.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('BatchEventCommandResult', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "BatchEventCommandResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - batch_post.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batch/events"} # type: ignore - + batch_post.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batch/events"} # type: ignore @distributed_trace_async async def post_by_experiment_name( # pylint: disable=inconsistent-return-statements @@ -291,16 +350,20 @@ async def post_by_experiment_name( # pylint: disable=inconsistent-return-statem :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'BaseEvent') + _json = self._serialize.body(body, "BaseEvent") else: _json = None @@ -312,28 +375,33 @@ async def post_by_experiment_name( # pylint: disable=inconsistent-return-statem experiment_name=experiment_name, content_type=content_type, json=_json, - template_url=self.post_by_experiment_name.metadata['url'], + template_url=self.post_by_experiment_name.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in []: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - post_by_experiment_name.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/events"} # type: ignore - + post_by_experiment_name.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/events"} # type: ignore @distributed_trace_async async def post_by_experiment_id( # pylint: disable=inconsistent-return-statements @@ -365,16 +433,20 @@ async def post_by_experiment_id( # pylint: disable=inconsistent-return-statemen :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'BaseEvent') + _json = self._serialize.body(body, "BaseEvent") else: _json = None @@ -386,28 +458,33 @@ async def post_by_experiment_id( # pylint: disable=inconsistent-return-statemen experiment_id=experiment_id, content_type=content_type, json=_json, - template_url=self.post_by_experiment_id.metadata['url'], + template_url=self.post_by_experiment_id.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in []: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - post_by_experiment_id.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/events"} # type: ignore - + post_by_experiment_id.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/events"} # type: ignore @distributed_trace_async async def post( # pylint: disable=inconsistent-return-statements @@ -436,16 +513,20 @@ async def post( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'BaseEvent') + _json = self._serialize.body(body, "BaseEvent") else: _json = None @@ -456,25 +537,30 @@ async def post( # pylint: disable=inconsistent-return-statements run_id=run_id, content_type=content_type, json=_json, - template_url=self.post.metadata['url'], + template_url=self.post.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in []: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - post.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/events"} # type: ignore - + post.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/events"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/operations/_experiments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/operations/_experiments_operations.py index e1831c4c1c78..950b446931ba 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/operations/_experiments_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/operations/_experiments_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,24 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._experiments_operations import build_create_request, build_delete_request_initial, build_delete_tags_request, build_get_by_id_request, build_get_by_query_request, build_get_request, build_update_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._experiments_operations import ( + build_create_request, + build_delete_request_initial, + build_delete_tags_request, + build_get_by_id_request, + build_get_by_query_request, + build_get_request, + build_update_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ExperimentsOperations: """ExperimentsOperations async operations. @@ -73,44 +98,50 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.Experiment :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Experiment"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Experiment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, experiment_name=experiment_name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Experiment', pipeline_response) + deserialized = self._deserialize("Experiment", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}"} # type: ignore - + get.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}"} # type: ignore @distributed_trace_async async def create( @@ -138,44 +169,50 @@ async def create( :rtype: ~azure.mgmt.machinelearningservices.models.Experiment :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Experiment"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Experiment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_create_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, experiment_name=experiment_name, - template_url=self.create.metadata['url'], + template_url=self.create.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Experiment', pipeline_response) + deserialized = self._deserialize("Experiment", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}"} # type: ignore - + create.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}"} # type: ignore @distributed_trace_async async def get_by_id( @@ -203,44 +240,50 @@ async def get_by_id( :rtype: ~azure.mgmt.machinelearningservices.models.Experiment :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Experiment"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Experiment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_by_id_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, experiment_id=experiment_id, - template_url=self.get_by_id.metadata['url'], + template_url=self.get_by_id.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Experiment', pipeline_response) + deserialized = self._deserialize("Experiment", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_by_id.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}"} # type: ignore - + get_by_id.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}"} # type: ignore @distributed_trace_async async def update( @@ -271,16 +314,20 @@ async def update( :rtype: ~azure.mgmt.machinelearningservices.models.Experiment :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Experiment"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Experiment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'ModifyExperiment') + _json = self._serialize.body(body, "ModifyExperiment") else: _json = None @@ -291,32 +338,37 @@ async def update( experiment_id=experiment_id, content_type=content_type, json=_json, - template_url=self.update.metadata['url'], + template_url=self.update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Experiment', pipeline_response) + deserialized = self._deserialize("Experiment", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}"} # type: ignore - + update.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}"} # type: ignore async def _delete_initial( self, @@ -326,43 +378,47 @@ async def _delete_initial( experiment_id: str, **kwargs: Any ) -> Any: - cls = kwargs.pop('cls', None) # type: ClsType[Any] + cls = kwargs.pop("cls", None) # type: ClsType[Any] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request_initial( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, experiment_id=experiment_id, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('object', pipeline_response) + deserialized = self._deserialize("object", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _delete_initial.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}"} # type: ignore - + _delete_initial.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}"} # type: ignore @distributed_trace_async async def begin_delete( @@ -397,45 +453,56 @@ async def begin_delete( :rtype: ~azure.core.polling.AsyncLROPoller[any] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[Any] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[Any] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, experiment_id=experiment_id, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('object', pipeline_response) + deserialized = self._deserialize("object", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}"} # type: ignore + begin_delete.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}"} # type: ignore @distributed_trace def get_by_query( @@ -468,20 +535,27 @@ def get_by_query( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedExperimentList] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedExperimentList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedExperimentList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: if body is not None: - _json = self._serialize.body(body, 'ExperimentQueryParams') + _json = self._serialize.body(body, "ExperimentQueryParams") else: _json = None - + request = build_get_by_query_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -489,17 +563,17 @@ def prepare_request(next_link=None): content_type=content_type, json=_json, url_safe_experiment_names_only=url_safe_experiment_names_only, - template_url=self.get_by_query.metadata['url'], + template_url=self.get_by_query.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: if body is not None: - _json = self._serialize.body(body, 'ExperimentQueryParams') + _json = self._serialize.body(body, "ExperimentQueryParams") else: _json = None - + request = build_get_by_query_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -515,7 +589,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedExperimentList", pipeline_response) + deserialized = self._deserialize( + "PaginatedExperimentList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -525,24 +601,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - get_by_query.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments:query"} # type: ignore + get_by_query.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments:query"} # type: ignore @distributed_trace_async async def delete_tags( @@ -573,16 +653,22 @@ async def delete_tags( :rtype: ~azure.mgmt.machinelearningservices.models.DeleteExperimentTagsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DeleteExperimentTagsResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DeleteExperimentTagsResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'DeleteTagsCommand') + _json = self._serialize.body(body, "DeleteTagsCommand") else: _json = None @@ -593,29 +679,36 @@ async def delete_tags( experiment_id=experiment_id, content_type=content_type, json=_json, - template_url=self.delete_tags.metadata['url'], + template_url=self.delete_tags.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DeleteExperimentTagsResult', pipeline_response) + deserialized = self._deserialize( + "DeleteExperimentTagsResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - delete_tags.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/tags:delete"} # type: ignore - + delete_tags.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/tags:delete"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/operations/_metric_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/operations/_metric_operations.py index 0fed06c34928..ba73804ed8fe 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/operations/_metric_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/operations/_metric_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,26 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._metric_operations import build_delete_metrics_by_data_container_id_request_initial, build_delete_metrics_by_run_id_request_initial, build_get_full_fidelity_metric_request, build_get_metric_details_by_experiment_id_request, build_get_metric_details_by_experiment_name_request, build_get_sampled_metric_request, build_list_generic_resource_metrics_request, build_list_metric_request, build_post_run_metrics_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._metric_operations import ( + build_delete_metrics_by_data_container_id_request_initial, + build_delete_metrics_by_run_id_request_initial, + build_get_full_fidelity_metric_request, + build_get_metric_details_by_experiment_id_request, + build_get_metric_details_by_experiment_name_request, + build_get_sampled_metric_request, + build_list_generic_resource_metrics_request, + build_list_metric_request, + build_post_run_metrics_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class MetricOperations: """MetricOperations async operations. @@ -76,16 +103,22 @@ async def get_full_fidelity_metric( :rtype: ~azure.mgmt.machinelearningservices.models.MetricV2 :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.MetricV2"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.MetricV2"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'RetrieveFullFidelityMetricRequest') + _json = self._serialize.body( + body, "RetrieveFullFidelityMetricRequest" + ) else: _json = None @@ -96,32 +129,37 @@ async def get_full_fidelity_metric( run_id=run_id, content_type=content_type, json=_json, - template_url=self.get_full_fidelity_metric.metadata['url'], + template_url=self.get_full_fidelity_metric.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('MetricV2', pipeline_response) + deserialized = self._deserialize("MetricV2", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_full_fidelity_metric.metadata = {'url': "/metric/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/full"} # type: ignore - + get_full_fidelity_metric.metadata = {"url": "/metric/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/full"} # type: ignore @distributed_trace def list_metric( @@ -154,20 +192,27 @@ def list_metric( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedMetricDefinitionList] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedMetricDefinitionList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedMetricDefinitionList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: if body is not None: - _json = self._serialize.body(body, 'ListMetrics') + _json = self._serialize.body(body, "ListMetrics") else: _json = None - + request = build_list_metric_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -175,17 +220,17 @@ def prepare_request(next_link=None): run_id=run_id, content_type=content_type, json=_json, - template_url=self.list_metric.metadata['url'], + template_url=self.list_metric.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: if body is not None: - _json = self._serialize.body(body, 'ListMetrics') + _json = self._serialize.body(body, "ListMetrics") else: _json = None - + request = build_list_metric_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -201,7 +246,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedMetricDefinitionList", pipeline_response) + deserialized = self._deserialize( + "PaginatedMetricDefinitionList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -211,24 +258,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_metric.metadata = {'url': "/metric/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/list"} # type: ignore + list_metric.metadata = {"url": "/metric/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/list"} # type: ignore @distributed_trace def list_generic_resource_metrics( @@ -258,37 +309,50 @@ def list_generic_resource_metrics( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedMetricDefinitionList] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedMetricDefinitionList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedMetricDefinitionList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: if body is not None: - _json = self._serialize.body(body, 'ListGenericResourceMetrics') + _json = self._serialize.body( + body, "ListGenericResourceMetrics" + ) else: _json = None - + request = build_list_generic_resource_metrics_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, content_type=content_type, json=_json, - template_url=self.list_generic_resource_metrics.metadata['url'], + template_url=self.list_generic_resource_metrics.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: if body is not None: - _json = self._serialize.body(body, 'ListGenericResourceMetrics') + _json = self._serialize.body( + body, "ListGenericResourceMetrics" + ) else: _json = None - + request = build_list_generic_resource_metrics_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -303,7 +367,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedMetricDefinitionList", pipeline_response) + deserialized = self._deserialize( + "PaginatedMetricDefinitionList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -313,24 +379,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_generic_resource_metrics.metadata = {'url': "/metric/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/azuremonitor/list"} # type: ignore + list_generic_resource_metrics.metadata = {"url": "/metric/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/azuremonitor/list"} # type: ignore @distributed_trace_async async def get_sampled_metric( @@ -365,16 +435,20 @@ async def get_sampled_metric( :rtype: ~azure.mgmt.machinelearningservices.models.MetricSample :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.MetricSample"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.MetricSample"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'GetSampledMetricRequest') + _json = self._serialize.body(body, "GetSampledMetricRequest") else: _json = None @@ -385,32 +459,37 @@ async def get_sampled_metric( run_id=run_id, content_type=content_type, json=_json, - template_url=self.get_sampled_metric.metadata['url'], + template_url=self.get_sampled_metric.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('MetricSample', pipeline_response) + deserialized = self._deserialize("MetricSample", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_sampled_metric.metadata = {'url': "/metric/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/sample"} # type: ignore - + get_sampled_metric.metadata = {"url": "/metric/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/sample"} # type: ignore @distributed_trace_async async def post_run_metrics( @@ -441,16 +520,22 @@ async def post_run_metrics( :rtype: ~azure.mgmt.machinelearningservices.models.PostRunMetricsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PostRunMetricsResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PostRunMetricsResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'BatchIMetricV2') + _json = self._serialize.body(body, "BatchIMetricV2") else: _json = None @@ -461,36 +546,45 @@ async def post_run_metrics( run_id=run_id, content_type=content_type, json=_json, - template_url=self.post_run_metrics.metadata['url'], + template_url=self.post_run_metrics.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 207]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('PostRunMetricsResult', pipeline_response) + deserialized = self._deserialize( + "PostRunMetricsResult", pipeline_response + ) if response.status_code == 207: - deserialized = self._deserialize('PostRunMetricsResult', pipeline_response) + deserialized = self._deserialize( + "PostRunMetricsResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - post_run_metrics.metadata = {'url': "/metric/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/batch"} # type: ignore - + post_run_metrics.metadata = {"url": "/metric/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/batch"} # type: ignore async def _delete_metrics_by_data_container_id_initial( self, @@ -501,44 +595,50 @@ async def _delete_metrics_by_data_container_id_initial( data_container_id: str, **kwargs: Any ) -> Any: - cls = kwargs.pop('cls', None) # type: ClsType[Any] + cls = kwargs.pop("cls", None) # type: ClsType[Any] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_metrics_by_data_container_id_request_initial( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, experiment_id=experiment_id, data_container_id=data_container_id, - template_url=self._delete_metrics_by_data_container_id_initial.metadata['url'], + template_url=self._delete_metrics_by_data_container_id_initial.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('object', pipeline_response) + deserialized = self._deserialize("object", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _delete_metrics_by_data_container_id_initial.metadata = {'url': "/metric/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentId}/containers/{dataContainerId}/deleteMetrics"} # type: ignore - + _delete_metrics_by_data_container_id_initial.metadata = {"url": "/metric/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentId}/containers/{dataContainerId}/deleteMetrics"} # type: ignore @distributed_trace_async async def begin_delete_metrics_by_data_container_id( @@ -576,46 +676,59 @@ async def begin_delete_metrics_by_data_container_id( :rtype: ~azure.core.polling.AsyncLROPoller[any] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[Any] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[Any] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: - raw_result = await self._delete_metrics_by_data_container_id_initial( - subscription_id=subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - experiment_id=experiment_id, - data_container_id=data_container_id, - cls=lambda x,y,z: x, - **kwargs + raw_result = ( + await self._delete_metrics_by_data_container_id_initial( + subscription_id=subscription_id, + resource_group_name=resource_group_name, + workspace_name=workspace_name, + experiment_id=experiment_id, + data_container_id=data_container_id, + cls=lambda x, y, z: x, + **kwargs + ) ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('object', pipeline_response) + deserialized = self._deserialize("object", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete_metrics_by_data_container_id.metadata = {'url': "/metric/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentId}/containers/{dataContainerId}/deleteMetrics"} # type: ignore + begin_delete_metrics_by_data_container_id.metadata = {"url": "/metric/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentId}/containers/{dataContainerId}/deleteMetrics"} # type: ignore async def _delete_metrics_by_run_id_initial( self, @@ -625,43 +738,49 @@ async def _delete_metrics_by_run_id_initial( run_id: str, **kwargs: Any ) -> Any: - cls = kwargs.pop('cls', None) # type: ClsType[Any] + cls = kwargs.pop("cls", None) # type: ClsType[Any] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_metrics_by_run_id_request_initial( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, run_id=run_id, - template_url=self._delete_metrics_by_run_id_initial.metadata['url'], + template_url=self._delete_metrics_by_run_id_initial.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('object', pipeline_response) + deserialized = self._deserialize("object", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _delete_metrics_by_run_id_initial.metadata = {'url': "/metric/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/deleteMetrics"} # type: ignore - + _delete_metrics_by_run_id_initial.metadata = {"url": "/metric/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/deleteMetrics"} # type: ignore @distributed_trace_async async def begin_delete_metrics_by_run_id( @@ -696,45 +815,56 @@ async def begin_delete_metrics_by_run_id( :rtype: ~azure.core.polling.AsyncLROPoller[any] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[Any] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[Any] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_metrics_by_run_id_initial( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, run_id=run_id, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('object', pipeline_response) + deserialized = self._deserialize("object", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete_metrics_by_run_id.metadata = {'url': "/metric/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/deleteMetrics"} # type: ignore + begin_delete_metrics_by_run_id.metadata = {"url": "/metric/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/deleteMetrics"} # type: ignore @distributed_trace_async async def get_metric_details_by_experiment_name( @@ -765,45 +895,53 @@ async def get_metric_details_by_experiment_name( :rtype: ~azure.mgmt.machinelearningservices.models.RunMetric :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RunMetric"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.RunMetric"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_metric_details_by_experiment_name_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, metric_id=metric_id, experiment_name=experiment_name, - template_url=self.get_metric_details_by_experiment_name.metadata['url'], + template_url=self.get_metric_details_by_experiment_name.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('RunMetric', pipeline_response) + deserialized = self._deserialize("RunMetric", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_metric_details_by_experiment_name.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/metrics/{metricId}"} # type: ignore - + get_metric_details_by_experiment_name.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/metrics/{metricId}"} # type: ignore @distributed_trace_async async def get_metric_details_by_experiment_id( @@ -834,42 +972,50 @@ async def get_metric_details_by_experiment_id( :rtype: ~azure.mgmt.machinelearningservices.models.RunMetric :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RunMetric"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.RunMetric"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_metric_details_by_experiment_id_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, metric_id=metric_id, experiment_id=experiment_id, - template_url=self.get_metric_details_by_experiment_id.metadata['url'], + template_url=self.get_metric_details_by_experiment_id.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('RunMetric', pipeline_response) + deserialized = self._deserialize("RunMetric", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_metric_details_by_experiment_id.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/metrics/{metricId}"} # type: ignore - + get_metric_details_by_experiment_id.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/metrics/{metricId}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/operations/_run_artifacts_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/operations/_run_artifacts_operations.py index 3710e3819ec9..459fbac7b4a4 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/operations/_run_artifacts_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/operations/_run_artifacts_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,31 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._run_artifacts_operations import build_batch_create_empty_artifacts_by_experiment_id_request, build_batch_create_empty_artifacts_by_experiment_name_request, build_get_by_id_by_experiment_id_request, build_get_by_id_by_experiment_name_request, build_get_content_information_by_experiment_id_request, build_get_content_information_by_experiment_name_request, build_get_sas_uri_by_experiment_id_request, build_get_sas_uri_by_experiment_name_request, build_list_in_container_by_experiment_id_request, build_list_in_container_by_experiment_name_request, build_list_in_path_by_experiment_id_request, build_list_in_path_by_experiment_name_request, build_list_sas_by_prefix_by_experiment_id_request, build_list_sas_by_prefix_by_experiment_name_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._run_artifacts_operations import ( + build_batch_create_empty_artifacts_by_experiment_id_request, + build_batch_create_empty_artifacts_by_experiment_name_request, + build_get_by_id_by_experiment_id_request, + build_get_by_id_by_experiment_name_request, + build_get_content_information_by_experiment_id_request, + build_get_content_information_by_experiment_name_request, + build_get_sas_uri_by_experiment_id_request, + build_get_sas_uri_by_experiment_name_request, + build_list_in_container_by_experiment_id_request, + build_list_in_container_by_experiment_name_request, + build_list_in_path_by_experiment_id_request, + build_list_in_path_by_experiment_name_request, + build_list_sas_by_prefix_by_experiment_id_request, + build_list_sas_by_prefix_by_experiment_name_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RunArtifactsOperations: """RunArtifactsOperations async operations. @@ -77,14 +105,19 @@ def list_in_container_by_experiment_name( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedArtifactList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedArtifactList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedArtifactList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_in_container_by_experiment_name_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -92,13 +125,15 @@ def prepare_request(next_link=None): run_id=run_id, experiment_name=experiment_name, continuation_token_parameter=continuation_token_parameter, - template_url=self.list_in_container_by_experiment_name.metadata['url'], + template_url=self.list_in_container_by_experiment_name.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_in_container_by_experiment_name_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -114,7 +149,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedArtifactList", pipeline_response) + deserialized = self._deserialize( + "PaginatedArtifactList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -124,24 +161,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_in_container_by_experiment_name.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/artifacts"} # type: ignore + list_in_container_by_experiment_name.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/artifacts"} # type: ignore @distributed_trace def list_in_container_by_experiment_id( @@ -175,14 +216,19 @@ def list_in_container_by_experiment_id( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedArtifactList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedArtifactList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedArtifactList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_in_container_by_experiment_id_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -190,13 +236,15 @@ def prepare_request(next_link=None): run_id=run_id, experiment_id=experiment_id, continuation_token_parameter=continuation_token_parameter, - template_url=self.list_in_container_by_experiment_id.metadata['url'], + template_url=self.list_in_container_by_experiment_id.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_in_container_by_experiment_id_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -212,7 +260,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedArtifactList", pipeline_response) + deserialized = self._deserialize( + "PaginatedArtifactList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -222,24 +272,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_in_container_by_experiment_id.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/artifacts"} # type: ignore + list_in_container_by_experiment_id.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/artifacts"} # type: ignore @distributed_trace def list_in_path_by_experiment_name( @@ -276,14 +330,19 @@ def list_in_path_by_experiment_name( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedArtifactList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedArtifactList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedArtifactList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_in_path_by_experiment_name_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -292,13 +351,15 @@ def prepare_request(next_link=None): experiment_name=experiment_name, path=path, continuation_token_parameter=continuation_token_parameter, - template_url=self.list_in_path_by_experiment_name.metadata['url'], + template_url=self.list_in_path_by_experiment_name.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_in_path_by_experiment_name_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -315,7 +376,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedArtifactList", pipeline_response) + deserialized = self._deserialize( + "PaginatedArtifactList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -325,24 +388,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_in_path_by_experiment_name.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/artifacts/path"} # type: ignore + list_in_path_by_experiment_name.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/artifacts/path"} # type: ignore @distributed_trace def list_in_path_by_experiment_id( @@ -379,14 +446,19 @@ def list_in_path_by_experiment_id( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedArtifactList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedArtifactList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedArtifactList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_in_path_by_experiment_id_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -395,13 +467,15 @@ def prepare_request(next_link=None): experiment_id=experiment_id, path=path, continuation_token_parameter=continuation_token_parameter, - template_url=self.list_in_path_by_experiment_id.metadata['url'], + template_url=self.list_in_path_by_experiment_id.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_in_path_by_experiment_id_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -418,7 +492,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedArtifactList", pipeline_response) + deserialized = self._deserialize( + "PaginatedArtifactList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -428,24 +504,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_in_path_by_experiment_id.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/artifacts/path"} # type: ignore + list_in_path_by_experiment_id.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/artifacts/path"} # type: ignore @distributed_trace_async async def get_by_id_by_experiment_name( @@ -477,13 +557,14 @@ async def get_by_id_by_experiment_name( :rtype: ~azure.mgmt.machinelearningservices.models.Artifact :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Artifact"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Artifact"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_by_id_by_experiment_name_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -491,32 +572,37 @@ async def get_by_id_by_experiment_name( run_id=run_id, experiment_name=experiment_name, path=path, - template_url=self.get_by_id_by_experiment_name.metadata['url'], + template_url=self.get_by_id_by_experiment_name.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Artifact', pipeline_response) + deserialized = self._deserialize("Artifact", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_by_id_by_experiment_name.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/artifacts/metadata"} # type: ignore - + get_by_id_by_experiment_name.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/artifacts/metadata"} # type: ignore @distributed_trace_async async def get_by_id_by_experiment_id( @@ -548,13 +634,14 @@ async def get_by_id_by_experiment_id( :rtype: ~azure.mgmt.machinelearningservices.models.Artifact :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Artifact"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Artifact"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_by_id_by_experiment_id_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -562,32 +649,37 @@ async def get_by_id_by_experiment_id( run_id=run_id, experiment_id=experiment_id, path=path, - template_url=self.get_by_id_by_experiment_id.metadata['url'], + template_url=self.get_by_id_by_experiment_id.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Artifact', pipeline_response) + deserialized = self._deserialize("Artifact", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_by_id_by_experiment_id.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/artifacts/metadata"} # type: ignore - + get_by_id_by_experiment_id.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/artifacts/metadata"} # type: ignore @distributed_trace_async async def get_content_information_by_experiment_name( @@ -619,13 +711,16 @@ async def get_content_information_by_experiment_name( :rtype: ~azure.mgmt.machinelearningservices.models.ArtifactContentInformation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactContentInformation"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ArtifactContentInformation"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_content_information_by_experiment_name_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -633,32 +728,41 @@ async def get_content_information_by_experiment_name( run_id=run_id, experiment_name=experiment_name, path=path, - template_url=self.get_content_information_by_experiment_name.metadata['url'], + template_url=self.get_content_information_by_experiment_name.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ArtifactContentInformation', pipeline_response) + deserialized = self._deserialize( + "ArtifactContentInformation", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_content_information_by_experiment_name.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/artifacts/contentinfo"} # type: ignore - + get_content_information_by_experiment_name.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/artifacts/contentinfo"} # type: ignore @distributed_trace_async async def get_content_information_by_experiment_id( @@ -690,13 +794,16 @@ async def get_content_information_by_experiment_id( :rtype: ~azure.mgmt.machinelearningservices.models.ArtifactContentInformation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactContentInformation"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ArtifactContentInformation"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_content_information_by_experiment_id_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -704,32 +811,41 @@ async def get_content_information_by_experiment_id( run_id=run_id, experiment_id=experiment_id, path=path, - template_url=self.get_content_information_by_experiment_id.metadata['url'], + template_url=self.get_content_information_by_experiment_id.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ArtifactContentInformation', pipeline_response) + deserialized = self._deserialize( + "ArtifactContentInformation", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_content_information_by_experiment_id.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/artifacts/contentinfo"} # type: ignore - + get_content_information_by_experiment_id.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/artifacts/contentinfo"} # type: ignore @distributed_trace_async async def get_sas_uri_by_experiment_name( @@ -761,13 +877,14 @@ async def get_sas_uri_by_experiment_name( :rtype: str :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[str] + cls = kwargs.pop("cls", None) # type: ClsType[str] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_sas_uri_by_experiment_name_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -775,32 +892,37 @@ async def get_sas_uri_by_experiment_name( run_id=run_id, experiment_name=experiment_name, path=path, - template_url=self.get_sas_uri_by_experiment_name.metadata['url'], + template_url=self.get_sas_uri_by_experiment_name.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('str', pipeline_response) + deserialized = self._deserialize("str", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_sas_uri_by_experiment_name.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/artifacts/artifacturi"} # type: ignore - + get_sas_uri_by_experiment_name.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/artifacts/artifacturi"} # type: ignore @distributed_trace_async async def get_sas_uri_by_experiment_id( @@ -832,13 +954,14 @@ async def get_sas_uri_by_experiment_id( :rtype: str :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[str] + cls = kwargs.pop("cls", None) # type: ClsType[str] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_sas_uri_by_experiment_id_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -846,32 +969,37 @@ async def get_sas_uri_by_experiment_id( run_id=run_id, experiment_id=experiment_id, path=path, - template_url=self.get_sas_uri_by_experiment_id.metadata['url'], + template_url=self.get_sas_uri_by_experiment_id.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('str', pipeline_response) + deserialized = self._deserialize("str", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_sas_uri_by_experiment_id.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/artifacts/artifacturi"} # type: ignore - + get_sas_uri_by_experiment_id.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/artifacts/artifacturi"} # type: ignore @distributed_trace def list_sas_by_prefix_by_experiment_name( @@ -908,14 +1036,19 @@ def list_sas_by_prefix_by_experiment_name( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedArtifactContentInformationList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedArtifactContentInformationList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedArtifactContentInformationList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_sas_by_prefix_by_experiment_name_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -924,13 +1057,15 @@ def prepare_request(next_link=None): experiment_name=experiment_name, path=path, continuation_token_parameter=continuation_token_parameter, - template_url=self.list_sas_by_prefix_by_experiment_name.metadata['url'], + template_url=self.list_sas_by_prefix_by_experiment_name.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_sas_by_prefix_by_experiment_name_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -947,7 +1082,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedArtifactContentInformationList", pipeline_response) + deserialized = self._deserialize( + "PaginatedArtifactContentInformationList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -957,24 +1094,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_sas_by_prefix_by_experiment_name.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/artifacts/prefix/contentinfo"} # type: ignore + list_sas_by_prefix_by_experiment_name.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/artifacts/prefix/contentinfo"} # type: ignore @distributed_trace def list_sas_by_prefix_by_experiment_id( @@ -1011,14 +1152,19 @@ def list_sas_by_prefix_by_experiment_id( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedArtifactContentInformationList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedArtifactContentInformationList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedArtifactContentInformationList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_sas_by_prefix_by_experiment_id_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -1027,13 +1173,15 @@ def prepare_request(next_link=None): experiment_id=experiment_id, path=path, continuation_token_parameter=continuation_token_parameter, - template_url=self.list_sas_by_prefix_by_experiment_id.metadata['url'], + template_url=self.list_sas_by_prefix_by_experiment_id.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_sas_by_prefix_by_experiment_id_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -1050,7 +1198,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedArtifactContentInformationList", pipeline_response) + deserialized = self._deserialize( + "PaginatedArtifactContentInformationList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1060,24 +1210,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_sas_by_prefix_by_experiment_id.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/artifacts/prefix/contentinfo"} # type: ignore + list_sas_by_prefix_by_experiment_id.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/artifacts/prefix/contentinfo"} # type: ignore @distributed_trace_async async def batch_create_empty_artifacts_by_experiment_name( @@ -1109,16 +1263,22 @@ async def batch_create_empty_artifacts_by_experiment_name( :rtype: ~azure.mgmt.machinelearningservices.models.BatchArtifactContentInformationResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchArtifactContentInformationResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchArtifactContentInformationResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'ArtifactPathList') + _json = self._serialize.body(body, "ArtifactPathList") else: _json = None @@ -1130,32 +1290,41 @@ async def batch_create_empty_artifacts_by_experiment_name( experiment_name=experiment_name, content_type=content_type, json=_json, - template_url=self.batch_create_empty_artifacts_by_experiment_name.metadata['url'], + template_url=self.batch_create_empty_artifacts_by_experiment_name.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchArtifactContentInformationResult', pipeline_response) + deserialized = self._deserialize( + "BatchArtifactContentInformationResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - batch_create_empty_artifacts_by_experiment_name.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/artifacts/batch/metadata"} # type: ignore - + batch_create_empty_artifacts_by_experiment_name.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/artifacts/batch/metadata"} # type: ignore @distributed_trace_async async def batch_create_empty_artifacts_by_experiment_id( @@ -1187,16 +1356,22 @@ async def batch_create_empty_artifacts_by_experiment_id( :rtype: ~azure.mgmt.machinelearningservices.models.BatchArtifactContentInformationResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchArtifactContentInformationResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchArtifactContentInformationResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'ArtifactPathList') + _json = self._serialize.body(body, "ArtifactPathList") else: _json = None @@ -1208,29 +1383,38 @@ async def batch_create_empty_artifacts_by_experiment_id( experiment_id=experiment_id, content_type=content_type, json=_json, - template_url=self.batch_create_empty_artifacts_by_experiment_id.metadata['url'], + template_url=self.batch_create_empty_artifacts_by_experiment_id.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchArtifactContentInformationResult', pipeline_response) + deserialized = self._deserialize( + "BatchArtifactContentInformationResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - batch_create_empty_artifacts_by_experiment_id.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/artifacts/batch/metadata"} # type: ignore - + batch_create_empty_artifacts_by_experiment_id.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/artifacts/batch/metadata"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/operations/_run_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/operations/_run_operations.py index 64cbc7dd2440..07756712a9ea 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/operations/_run_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/operations/_run_operations.py @@ -6,10 +6,25 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, List, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + List, + Optional, + TypeVar, + Union, +) from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,8 +34,15 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._run_operations import build_list_by_compute_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RunOperations: """RunOperations async operations. @@ -93,14 +115,19 @@ def list_by_compute( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedRunList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedRunList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedRunList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_by_compute_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -112,13 +139,13 @@ def prepare_request(next_link=None): sortorder=sortorder, top=top, count=count, - template_url=self.list_by_compute.metadata['url'], + template_url=self.list_by_compute.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_by_compute_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -138,7 +165,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedRunList", pipeline_response) + deserialized = self._deserialize( + "PaginatedRunList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -148,21 +177,25 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_by_compute.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/runs"} # type: ignore + list_by_compute.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/runs"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/operations/_runs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/operations/_runs_operations.py index b42721dc47b8..07b2019d2756 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/operations/_runs_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/operations/_runs_operations.py @@ -6,10 +6,25 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, List, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + List, + Optional, + TypeVar, + Union, +) from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +34,50 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._runs_operations import build_add_or_modify_by_experiment_id_request, build_add_or_modify_by_experiment_name_request, build_add_or_modify_experiment_request, build_add_or_modify_run_service_instances_request, build_add_request, build_batch_add_or_modify_by_experiment_id_request, build_batch_add_or_modify_by_experiment_name_request, build_batch_get_run_data_request, build_cancel_run_with_uri_by_experiment_id_request, build_cancel_run_with_uri_by_experiment_name_request, build_delete_run_services_by_experiment_id_request, build_delete_run_services_by_experiment_name_request, build_delete_run_services_request, build_delete_tags_by_experiment_id_request, build_delete_tags_by_experiment_name_request, build_delete_tags_request, build_get_by_experiment_id_request, build_get_by_experiment_name_request, build_get_by_ids_by_experiment_id_request, build_get_by_ids_by_experiment_name_request, build_get_by_query_by_experiment_id_request, build_get_by_query_by_experiment_name_request, build_get_child_by_experiment_id_request, build_get_child_by_experiment_name_request, build_get_child_request, build_get_details_by_experiment_id_request, build_get_details_by_experiment_name_request, build_get_details_request, build_get_request, build_get_run_data_request, build_get_run_service_instances_request, build_modify_or_delete_tags_by_experiment_id_request, build_modify_or_delete_tags_by_experiment_name_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._runs_operations import ( + build_add_or_modify_by_experiment_id_request, + build_add_or_modify_by_experiment_name_request, + build_add_or_modify_experiment_request, + build_add_or_modify_run_service_instances_request, + build_add_request, + build_batch_add_or_modify_by_experiment_id_request, + build_batch_add_or_modify_by_experiment_name_request, + build_batch_get_run_data_request, + build_cancel_run_with_uri_by_experiment_id_request, + build_cancel_run_with_uri_by_experiment_name_request, + build_delete_run_services_by_experiment_id_request, + build_delete_run_services_by_experiment_name_request, + build_delete_run_services_request, + build_delete_tags_by_experiment_id_request, + build_delete_tags_by_experiment_name_request, + build_delete_tags_request, + build_get_by_experiment_id_request, + build_get_by_experiment_name_request, + build_get_by_ids_by_experiment_id_request, + build_get_by_ids_by_experiment_name_request, + build_get_by_query_by_experiment_id_request, + build_get_by_query_by_experiment_name_request, + build_get_child_by_experiment_id_request, + build_get_child_by_experiment_name_request, + build_get_child_request, + build_get_details_by_experiment_id_request, + build_get_details_by_experiment_name_request, + build_get_details_request, + build_get_request, + build_get_run_data_request, + build_get_run_service_instances_request, + build_modify_or_delete_tags_by_experiment_id_request, + build_modify_or_delete_tags_by_experiment_name_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RunsOperations: # pylint: disable=too-many-public-methods """RunsOperations async operations. @@ -97,14 +153,19 @@ def get_child_by_experiment_name( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedRunList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedRunList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedRunList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_get_child_by_experiment_name_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -117,13 +178,15 @@ def prepare_request(next_link=None): sortorder=sortorder, top=top, count=count, - template_url=self.get_child_by_experiment_name.metadata['url'], + template_url=self.get_child_by_experiment_name.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_get_child_by_experiment_name_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -144,7 +207,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedRunList", pipeline_response) + deserialized = self._deserialize( + "PaginatedRunList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -154,24 +219,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - get_child_by_experiment_name.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/children"} # type: ignore + get_child_by_experiment_name.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/children"} # type: ignore @distributed_trace def get_child_by_experiment_id( @@ -225,14 +294,19 @@ def get_child_by_experiment_id( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedRunList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedRunList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedRunList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_get_child_by_experiment_id_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -245,13 +319,15 @@ def prepare_request(next_link=None): sortorder=sortorder, top=top, count=count, - template_url=self.get_child_by_experiment_id.metadata['url'], + template_url=self.get_child_by_experiment_id.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_get_child_by_experiment_id_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -272,7 +348,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedRunList", pipeline_response) + deserialized = self._deserialize( + "PaginatedRunList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -282,24 +360,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - get_child_by_experiment_id.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/children"} # type: ignore + get_child_by_experiment_id.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/children"} # type: ignore @distributed_trace def get_child( @@ -350,14 +432,19 @@ def get_child( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedRunList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedRunList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedRunList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_get_child_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -369,13 +456,13 @@ def prepare_request(next_link=None): sortorder=sortorder, top=top, count=count, - template_url=self.get_child.metadata['url'], + template_url=self.get_child.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_get_child_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -395,7 +482,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedRunList", pipeline_response) + deserialized = self._deserialize( + "PaginatedRunList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -405,24 +494,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - get_child.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/children"} # type: ignore + get_child.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/children"} # type: ignore @distributed_trace_async async def get_details_by_experiment_id( @@ -451,45 +544,51 @@ async def get_details_by_experiment_id( :rtype: ~azure.mgmt.machinelearningservices.models.RunDetails :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RunDetails"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.RunDetails"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_details_by_experiment_id_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, run_id=run_id, experiment_id=experiment_id, - template_url=self.get_details_by_experiment_id.metadata['url'], + template_url=self.get_details_by_experiment_id.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('RunDetails', pipeline_response) + deserialized = self._deserialize("RunDetails", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_details_by_experiment_id.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/details"} # type: ignore - + get_details_by_experiment_id.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/details"} # type: ignore @distributed_trace_async async def get_details_by_experiment_name( @@ -518,45 +617,51 @@ async def get_details_by_experiment_name( :rtype: ~azure.mgmt.machinelearningservices.models.RunDetails :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RunDetails"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.RunDetails"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_details_by_experiment_name_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, run_id=run_id, experiment_name=experiment_name, - template_url=self.get_details_by_experiment_name.metadata['url'], + template_url=self.get_details_by_experiment_name.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('RunDetails', pipeline_response) + deserialized = self._deserialize("RunDetails", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_details_by_experiment_name.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/details"} # type: ignore - + get_details_by_experiment_name.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/details"} # type: ignore @distributed_trace_async async def get_details( @@ -582,44 +687,50 @@ async def get_details( :rtype: ~azure.mgmt.machinelearningservices.models.RunDetails :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RunDetails"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.RunDetails"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_details_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, run_id=run_id, - template_url=self.get_details.metadata['url'], + template_url=self.get_details.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('RunDetails', pipeline_response) + deserialized = self._deserialize("RunDetails", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_details.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/details"} # type: ignore - + get_details.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/details"} # type: ignore @distributed_trace_async async def get_run_data( @@ -645,16 +756,22 @@ async def get_run_data( :rtype: ~azure.mgmt.machinelearningservices.models.GetRunDataResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.GetRunDataResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.GetRunDataResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'GetRunDataRequest') + _json = self._serialize.body(body, "GetRunDataRequest") else: _json = None @@ -664,32 +781,37 @@ async def get_run_data( workspace_name=workspace_name, content_type=content_type, json=_json, - template_url=self.get_run_data.metadata['url'], + template_url=self.get_run_data.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('GetRunDataResult', pipeline_response) + deserialized = self._deserialize("GetRunDataResult", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_run_data.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/rundata"} # type: ignore - + get_run_data.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/rundata"} # type: ignore @distributed_trace_async async def batch_get_run_data( @@ -715,16 +837,20 @@ async def batch_get_run_data( :rtype: ~azure.mgmt.machinelearningservices.models.BatchResult1 :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchResult1"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchResult1"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'BatchRequest1') + _json = self._serialize.body(body, "BatchRequest1") else: _json = None @@ -734,36 +860,41 @@ async def batch_get_run_data( workspace_name=workspace_name, content_type=content_type, json=_json, - template_url=self.batch_get_run_data.metadata['url'], + template_url=self.batch_get_run_data.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 207]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('BatchResult1', pipeline_response) + deserialized = self._deserialize("BatchResult1", pipeline_response) if response.status_code == 207: - deserialized = self._deserialize('BatchResult1', pipeline_response) + deserialized = self._deserialize("BatchResult1", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - batch_get_run_data.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchrundata"} # type: ignore - + batch_get_run_data.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchrundata"} # type: ignore @distributed_trace_async async def batch_add_or_modify_by_experiment_id( @@ -792,16 +923,22 @@ async def batch_add_or_modify_by_experiment_id( :rtype: ~azure.mgmt.machinelearningservices.models.BatchRunResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchRunResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchRunResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'BatchAddOrModifyRunRequest') + _json = self._serialize.body(body, "BatchAddOrModifyRunRequest") else: _json = None @@ -812,32 +949,39 @@ async def batch_add_or_modify_by_experiment_id( experiment_id=experiment_id, content_type=content_type, json=_json, - template_url=self.batch_add_or_modify_by_experiment_id.metadata['url'], + template_url=self.batch_add_or_modify_by_experiment_id.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchRunResult', pipeline_response) + deserialized = self._deserialize("BatchRunResult", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - batch_add_or_modify_by_experiment_id.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/batch/runs"} # type: ignore - + batch_add_or_modify_by_experiment_id.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/batch/runs"} # type: ignore @distributed_trace_async async def batch_add_or_modify_by_experiment_name( @@ -866,16 +1010,22 @@ async def batch_add_or_modify_by_experiment_name( :rtype: ~azure.mgmt.machinelearningservices.models.BatchRunResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchRunResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchRunResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'BatchAddOrModifyRunRequest') + _json = self._serialize.body(body, "BatchAddOrModifyRunRequest") else: _json = None @@ -886,32 +1036,39 @@ async def batch_add_or_modify_by_experiment_name( experiment_name=experiment_name, content_type=content_type, json=_json, - template_url=self.batch_add_or_modify_by_experiment_name.metadata['url'], + template_url=self.batch_add_or_modify_by_experiment_name.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchRunResult', pipeline_response) + deserialized = self._deserialize("BatchRunResult", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - batch_add_or_modify_by_experiment_name.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/batch/runs"} # type: ignore - + batch_add_or_modify_by_experiment_name.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/batch/runs"} # type: ignore @distributed_trace_async async def add_or_modify_by_experiment_name( @@ -943,16 +1100,20 @@ async def add_or_modify_by_experiment_name( :rtype: ~azure.mgmt.machinelearningservices.models.Run :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Run"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'CreateRun') + _json = self._serialize.body(body, "CreateRun") else: _json = None @@ -964,32 +1125,37 @@ async def add_or_modify_by_experiment_name( experiment_name=experiment_name, content_type=content_type, json=_json, - template_url=self.add_or_modify_by_experiment_name.metadata['url'], + template_url=self.add_or_modify_by_experiment_name.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Run', pipeline_response) + deserialized = self._deserialize("Run", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - add_or_modify_by_experiment_name.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}"} # type: ignore - + add_or_modify_by_experiment_name.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}"} # type: ignore @distributed_trace_async async def get_by_experiment_name( @@ -1018,45 +1184,51 @@ async def get_by_experiment_name( :rtype: ~azure.mgmt.machinelearningservices.models.Run :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Run"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_by_experiment_name_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, run_id=run_id, experiment_name=experiment_name, - template_url=self.get_by_experiment_name.metadata['url'], + template_url=self.get_by_experiment_name.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Run', pipeline_response) + deserialized = self._deserialize("Run", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_by_experiment_name.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}"} # type: ignore - + get_by_experiment_name.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}"} # type: ignore @distributed_trace_async async def add_or_modify_by_experiment_id( @@ -1088,16 +1260,20 @@ async def add_or_modify_by_experiment_id( :rtype: ~azure.mgmt.machinelearningservices.models.Run :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Run"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'CreateRun') + _json = self._serialize.body(body, "CreateRun") else: _json = None @@ -1109,32 +1285,37 @@ async def add_or_modify_by_experiment_id( experiment_id=experiment_id, content_type=content_type, json=_json, - template_url=self.add_or_modify_by_experiment_id.metadata['url'], + template_url=self.add_or_modify_by_experiment_id.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Run', pipeline_response) + deserialized = self._deserialize("Run", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - add_or_modify_by_experiment_id.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}"} # type: ignore - + add_or_modify_by_experiment_id.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}"} # type: ignore @distributed_trace_async async def get_by_experiment_id( @@ -1163,45 +1344,51 @@ async def get_by_experiment_id( :rtype: ~azure.mgmt.machinelearningservices.models.Run :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Run"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_by_experiment_id_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, run_id=run_id, experiment_id=experiment_id, - template_url=self.get_by_experiment_id.metadata['url'], + template_url=self.get_by_experiment_id.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Run', pipeline_response) + deserialized = self._deserialize("Run", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_by_experiment_id.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}"} # type: ignore - + get_by_experiment_id.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}"} # type: ignore @distributed_trace_async async def add_or_modify_experiment( @@ -1230,16 +1417,20 @@ async def add_or_modify_experiment( :rtype: ~azure.mgmt.machinelearningservices.models.Run :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Run"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'CreateRun') + _json = self._serialize.body(body, "CreateRun") else: _json = None @@ -1250,32 +1441,37 @@ async def add_or_modify_experiment( run_id=run_id, content_type=content_type, json=_json, - template_url=self.add_or_modify_experiment.metadata['url'], + template_url=self.add_or_modify_experiment.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Run', pipeline_response) + deserialized = self._deserialize("Run", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - add_or_modify_experiment.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}"} # type: ignore - + add_or_modify_experiment.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}"} # type: ignore @distributed_trace_async async def add( @@ -1304,16 +1500,20 @@ async def add( :rtype: ~azure.mgmt.machinelearningservices.models.Run :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Run"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'CreateRun') + _json = self._serialize.body(body, "CreateRun") else: _json = None @@ -1324,32 +1524,37 @@ async def add( run_id=run_id, content_type=content_type, json=_json, - template_url=self.add.metadata['url'], + template_url=self.add.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Run', pipeline_response) + deserialized = self._deserialize("Run", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - add.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}"} # type: ignore - + add.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}"} # type: ignore @distributed_trace_async async def get( @@ -1375,44 +1580,50 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.Run :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Run"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, run_id=run_id, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Run', pipeline_response) + deserialized = self._deserialize("Run", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}"} # type: ignore - + get.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}"} # type: ignore @distributed_trace_async async def delete_tags_by_experiment_id( @@ -1444,16 +1655,20 @@ async def delete_tags_by_experiment_id( :rtype: ~azure.mgmt.machinelearningservices.models.Run :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Run"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, '[str]') + _json = self._serialize.body(body, "[str]") else: _json = None @@ -1465,32 +1680,37 @@ async def delete_tags_by_experiment_id( experiment_id=experiment_id, content_type=content_type, json=_json, - template_url=self.delete_tags_by_experiment_id.metadata['url'], + template_url=self.delete_tags_by_experiment_id.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Run', pipeline_response) + deserialized = self._deserialize("Run", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - delete_tags_by_experiment_id.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/tags"} # type: ignore - + delete_tags_by_experiment_id.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/tags"} # type: ignore @distributed_trace_async async def modify_or_delete_tags_by_experiment_id( @@ -1522,16 +1742,20 @@ async def modify_or_delete_tags_by_experiment_id( :rtype: ~azure.mgmt.machinelearningservices.models.Run :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Run"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'DeleteOrModifyTags') + _json = self._serialize.body(body, "DeleteOrModifyTags") else: _json = None @@ -1543,32 +1767,39 @@ async def modify_or_delete_tags_by_experiment_id( experiment_id=experiment_id, content_type=content_type, json=_json, - template_url=self.modify_or_delete_tags_by_experiment_id.metadata['url'], + template_url=self.modify_or_delete_tags_by_experiment_id.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Run', pipeline_response) + deserialized = self._deserialize("Run", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - modify_or_delete_tags_by_experiment_id.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/tags"} # type: ignore - + modify_or_delete_tags_by_experiment_id.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/tags"} # type: ignore @distributed_trace_async async def delete_tags_by_experiment_name( @@ -1600,16 +1831,20 @@ async def delete_tags_by_experiment_name( :rtype: ~azure.mgmt.machinelearningservices.models.Run :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Run"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, '[str]') + _json = self._serialize.body(body, "[str]") else: _json = None @@ -1621,32 +1856,37 @@ async def delete_tags_by_experiment_name( experiment_name=experiment_name, content_type=content_type, json=_json, - template_url=self.delete_tags_by_experiment_name.metadata['url'], + template_url=self.delete_tags_by_experiment_name.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Run', pipeline_response) + deserialized = self._deserialize("Run", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - delete_tags_by_experiment_name.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/tags"} # type: ignore - + delete_tags_by_experiment_name.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/tags"} # type: ignore @distributed_trace_async async def modify_or_delete_tags_by_experiment_name( @@ -1678,16 +1918,20 @@ async def modify_or_delete_tags_by_experiment_name( :rtype: ~azure.mgmt.machinelearningservices.models.Run :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Run"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'DeleteOrModifyTags') + _json = self._serialize.body(body, "DeleteOrModifyTags") else: _json = None @@ -1699,32 +1943,39 @@ async def modify_or_delete_tags_by_experiment_name( experiment_name=experiment_name, content_type=content_type, json=_json, - template_url=self.modify_or_delete_tags_by_experiment_name.metadata['url'], + template_url=self.modify_or_delete_tags_by_experiment_name.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Run', pipeline_response) + deserialized = self._deserialize("Run", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - modify_or_delete_tags_by_experiment_name.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/tags"} # type: ignore - + modify_or_delete_tags_by_experiment_name.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/tags"} # type: ignore @distributed_trace_async async def delete_tags( @@ -1753,16 +2004,20 @@ async def delete_tags( :rtype: ~azure.mgmt.machinelearningservices.models.Run :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Run"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, '[str]') + _json = self._serialize.body(body, "[str]") else: _json = None @@ -1773,32 +2028,37 @@ async def delete_tags( run_id=run_id, content_type=content_type, json=_json, - template_url=self.delete_tags.metadata['url'], + template_url=self.delete_tags.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Run', pipeline_response) + deserialized = self._deserialize("Run", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - delete_tags.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/tags"} # type: ignore - + delete_tags.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/tags"} # type: ignore @distributed_trace_async async def delete_run_services_by_experiment_id( @@ -1830,16 +2090,20 @@ async def delete_run_services_by_experiment_id( :rtype: ~azure.mgmt.machinelearningservices.models.Run :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Run"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'DeleteRunServices') + _json = self._serialize.body(body, "DeleteRunServices") else: _json = None @@ -1851,32 +2115,39 @@ async def delete_run_services_by_experiment_id( experiment_id=experiment_id, content_type=content_type, json=_json, - template_url=self.delete_run_services_by_experiment_id.metadata['url'], + template_url=self.delete_run_services_by_experiment_id.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Run', pipeline_response) + deserialized = self._deserialize("Run", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - delete_run_services_by_experiment_id.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/services"} # type: ignore - + delete_run_services_by_experiment_id.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/services"} # type: ignore @distributed_trace_async async def delete_run_services_by_experiment_name( @@ -1908,16 +2179,20 @@ async def delete_run_services_by_experiment_name( :rtype: ~azure.mgmt.machinelearningservices.models.Run :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Run"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'DeleteRunServices') + _json = self._serialize.body(body, "DeleteRunServices") else: _json = None @@ -1929,32 +2204,39 @@ async def delete_run_services_by_experiment_name( experiment_name=experiment_name, content_type=content_type, json=_json, - template_url=self.delete_run_services_by_experiment_name.metadata['url'], + template_url=self.delete_run_services_by_experiment_name.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Run', pipeline_response) + deserialized = self._deserialize("Run", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - delete_run_services_by_experiment_name.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/services"} # type: ignore - + delete_run_services_by_experiment_name.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/services"} # type: ignore @distributed_trace_async async def delete_run_services( @@ -1983,16 +2265,20 @@ async def delete_run_services( :rtype: ~azure.mgmt.machinelearningservices.models.Run :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Run"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'DeleteRunServices') + _json = self._serialize.body(body, "DeleteRunServices") else: _json = None @@ -2003,32 +2289,37 @@ async def delete_run_services( run_id=run_id, content_type=content_type, json=_json, - template_url=self.delete_run_services.metadata['url'], + template_url=self.delete_run_services.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Run', pipeline_response) + deserialized = self._deserialize("Run", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - delete_run_services.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/services"} # type: ignore - + delete_run_services.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/services"} # type: ignore @distributed_trace_async async def add_or_modify_run_service_instances( @@ -2060,16 +2351,24 @@ async def add_or_modify_run_service_instances( :rtype: ~azure.mgmt.machinelearningservices.models.RunServiceInstances :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RunServiceInstances"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.RunServiceInstances"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'AddOrModifyRunServiceInstancesRequest') + _json = self._serialize.body( + body, "AddOrModifyRunServiceInstancesRequest" + ) else: _json = None @@ -2081,32 +2380,41 @@ async def add_or_modify_run_service_instances( node_id=node_id, content_type=content_type, json=_json, - template_url=self.add_or_modify_run_service_instances.metadata['url'], + template_url=self.add_or_modify_run_service_instances.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('RunServiceInstances', pipeline_response) + deserialized = self._deserialize( + "RunServiceInstances", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - add_or_modify_run_service_instances.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/serviceinstances/{nodeId}"} # type: ignore - + add_or_modify_run_service_instances.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/serviceinstances/{nodeId}"} # type: ignore @distributed_trace_async async def get_run_service_instances( @@ -2135,45 +2443,55 @@ async def get_run_service_instances( :rtype: ~azure.mgmt.machinelearningservices.models.RunServiceInstances :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RunServiceInstances"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.RunServiceInstances"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_run_service_instances_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, run_id=run_id, node_id=node_id, - template_url=self.get_run_service_instances.metadata['url'], + template_url=self.get_run_service_instances.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('RunServiceInstances', pipeline_response) + deserialized = self._deserialize( + "RunServiceInstances", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_run_service_instances.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/serviceinstances/{nodeId}"} # type: ignore - + get_run_service_instances.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/serviceinstances/{nodeId}"} # type: ignore @distributed_trace def get_by_query_by_experiment_name( @@ -2203,20 +2521,27 @@ def get_by_query_by_experiment_name( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedRunList] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedRunList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedRunList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: if body is not None: - _json = self._serialize.body(body, 'QueryParams') + _json = self._serialize.body(body, "QueryParams") else: _json = None - + request = build_get_by_query_by_experiment_name_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -2224,17 +2549,19 @@ def prepare_request(next_link=None): experiment_name=experiment_name, content_type=content_type, json=_json, - template_url=self.get_by_query_by_experiment_name.metadata['url'], + template_url=self.get_by_query_by_experiment_name.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: if body is not None: - _json = self._serialize.body(body, 'QueryParams') + _json = self._serialize.body(body, "QueryParams") else: _json = None - + request = build_get_by_query_by_experiment_name_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -2250,7 +2577,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedRunList", pipeline_response) + deserialized = self._deserialize( + "PaginatedRunList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -2260,24 +2589,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - get_by_query_by_experiment_name.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs:query"} # type: ignore + get_by_query_by_experiment_name.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs:query"} # type: ignore @distributed_trace def get_by_query_by_experiment_id( @@ -2307,20 +2640,27 @@ def get_by_query_by_experiment_id( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedRunList] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedRunList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedRunList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: if body is not None: - _json = self._serialize.body(body, 'QueryParams') + _json = self._serialize.body(body, "QueryParams") else: _json = None - + request = build_get_by_query_by_experiment_id_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -2328,17 +2668,19 @@ def prepare_request(next_link=None): experiment_id=experiment_id, content_type=content_type, json=_json, - template_url=self.get_by_query_by_experiment_id.metadata['url'], + template_url=self.get_by_query_by_experiment_id.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: if body is not None: - _json = self._serialize.body(body, 'QueryParams') + _json = self._serialize.body(body, "QueryParams") else: _json = None - + request = build_get_by_query_by_experiment_id_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -2354,7 +2696,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedRunList", pipeline_response) + deserialized = self._deserialize( + "PaginatedRunList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -2364,24 +2708,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - get_by_query_by_experiment_id.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs:query"} # type: ignore + get_by_query_by_experiment_id.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs:query"} # type: ignore @distributed_trace_async async def get_by_ids_by_experiment_id( @@ -2410,16 +2758,22 @@ async def get_by_ids_by_experiment_id( :rtype: ~azure.mgmt.machinelearningservices.models.BatchRunResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchRunResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchRunResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'GetRunsByIds') + _json = self._serialize.body(body, "GetRunsByIds") else: _json = None @@ -2430,32 +2784,37 @@ async def get_by_ids_by_experiment_id( experiment_id=experiment_id, content_type=content_type, json=_json, - template_url=self.get_by_ids_by_experiment_id.metadata['url'], + template_url=self.get_by_ids_by_experiment_id.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchRunResult', pipeline_response) + deserialized = self._deserialize("BatchRunResult", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_by_ids_by_experiment_id.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/runIds"} # type: ignore - + get_by_ids_by_experiment_id.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/runIds"} # type: ignore @distributed_trace_async async def get_by_ids_by_experiment_name( @@ -2484,16 +2843,22 @@ async def get_by_ids_by_experiment_name( :rtype: ~azure.mgmt.machinelearningservices.models.BatchRunResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchRunResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchRunResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'GetRunsByIds') + _json = self._serialize.body(body, "GetRunsByIds") else: _json = None @@ -2504,32 +2869,37 @@ async def get_by_ids_by_experiment_name( experiment_name=experiment_name, content_type=content_type, json=_json, - template_url=self.get_by_ids_by_experiment_name.metadata['url'], + template_url=self.get_by_ids_by_experiment_name.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchRunResult', pipeline_response) + deserialized = self._deserialize("BatchRunResult", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_by_ids_by_experiment_name.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/runIds"} # type: ignore - + get_by_ids_by_experiment_name.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/runIds"} # type: ignore @distributed_trace_async async def cancel_run_with_uri_by_experiment_id( @@ -2561,13 +2931,14 @@ async def cancel_run_with_uri_by_experiment_id( :rtype: ~azure.mgmt.machinelearningservices.models.Run :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Run"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_cancel_run_with_uri_by_experiment_id_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -2575,32 +2946,39 @@ async def cancel_run_with_uri_by_experiment_id( run_id=run_id, experiment_id=experiment_id, cancelation_reason=cancelation_reason, - template_url=self.cancel_run_with_uri_by_experiment_id.metadata['url'], + template_url=self.cancel_run_with_uri_by_experiment_id.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Run', pipeline_response) + deserialized = self._deserialize("Run", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - cancel_run_with_uri_by_experiment_id.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/cancel"} # type: ignore - + cancel_run_with_uri_by_experiment_id.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/cancel"} # type: ignore @distributed_trace_async async def cancel_run_with_uri_by_experiment_name( @@ -2632,13 +3010,14 @@ async def cancel_run_with_uri_by_experiment_name( :rtype: ~azure.mgmt.machinelearningservices.models.Run :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Run"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_cancel_run_with_uri_by_experiment_name_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -2646,29 +3025,36 @@ async def cancel_run_with_uri_by_experiment_name( run_id=run_id, experiment_name=experiment_name, cancelation_reason=cancelation_reason, - template_url=self.cancel_run_with_uri_by_experiment_name.metadata['url'], + template_url=self.cancel_run_with_uri_by_experiment_name.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Run', pipeline_response) + deserialized = self._deserialize("Run", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - cancel_run_with_uri_by_experiment_name.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/cancel"} # type: ignore - + cancel_run_with_uri_by_experiment_name.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/cancel"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/operations/_spans_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/operations/_spans_operations.py index 92894166873f..5648d51bc039 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/operations/_spans_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/aio/operations/_spans_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,20 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._spans_operations import build_get_active_request, build_list_request, build_post_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._spans_operations import ( + build_get_active_request, + build_list_request, + build_post_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class SpansOperations: """SpansOperations async operations. @@ -72,16 +89,20 @@ async def post( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'RunStatusSpans') + _json = self._serialize.body(body, "RunStatusSpans") else: _json = None @@ -92,28 +113,33 @@ async def post( # pylint: disable=inconsistent-return-statements run_id=run_id, content_type=content_type, json=_json, - template_url=self.post.metadata['url'], + template_url=self.post.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in []: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - post.metadata = {'url': "/history/v1.0/private/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/spans"} # type: ignore - + post.metadata = {"url": "/history/v1.0/private/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/spans"} # type: ignore @distributed_trace def list( @@ -144,27 +170,32 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedSpanDefinition1List] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedSpanDefinition1List"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedSpanDefinition1List"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, run_id=run_id, continuation_token_parameter=continuation_token_parameter, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -179,7 +210,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedSpanDefinition1List", pipeline_response) + deserialized = self._deserialize( + "PaginatedSpanDefinition1List", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -189,24 +222,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/history/v1.0/private/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/spans"} # type: ignore + list.metadata = {"url": "/history/v1.0/private/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/spans"} # type: ignore @distributed_trace def get_active( @@ -237,27 +274,32 @@ def get_active( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedSpanDefinition1List] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedSpanDefinition1List"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedSpanDefinition1List"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_get_active_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, run_id=run_id, continuation_token_parameter=continuation_token_parameter, - template_url=self.get_active.metadata['url'], + template_url=self.get_active.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_get_active_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -272,7 +314,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedSpanDefinition1List", pipeline_response) + deserialized = self._deserialize( + "PaginatedSpanDefinition1List", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -282,21 +326,25 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - get_active.metadata = {'url': "/history/v1.0/private/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/spans/active"} # type: ignore + get_active.metadata = {"url": "/history/v1.0/private/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/spans/active"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/models/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/models/__init__.py index 422eea5c5713..471010a04fcf 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/models/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/models/__init__.py @@ -191,97 +191,97 @@ ) __all__ = [ - 'AddOrModifyRunServiceInstancesRequest', - 'Artifact', - 'ArtifactContentInformation', - 'ArtifactDataPath', - 'ArtifactPath', - 'ArtifactPathList', - 'BaseEvent', - 'BatchAddOrModifyRunRequest', - 'BatchArtifactContentInformationResult', - 'BatchEventCommand', - 'BatchEventCommandResult', - 'BatchIMetricV2', - 'BatchRequest1', - 'BatchResult1', - 'BatchRunResult', - 'Compute', - 'ComputeRequest', - 'CreateRun', - 'CreatedFrom', - 'DatasetIdentifier', - 'DatasetInputDetails', - 'DatasetLineage', - 'DatasetOutputDetails', - 'DeleteConfiguration', - 'DeleteExperimentTagsResult', - 'DeleteOrModifyTags', - 'DeleteRunServices', - 'DeleteTagsCommand', - 'DerivedMetricKey', - 'EndpointSetting', - 'ErrorAdditionalInfo', - 'ErrorResponse', - 'Event', - 'Experiment', - 'ExperimentQueryParams', - 'GetRunDataRequest', - 'GetRunDataResult', - 'GetRunsByIds', - 'GetSampledMetricRequest', - 'IMetricV2', - 'InnerErrorResponse', - 'JobCost', - 'KeyValuePairBaseEventErrorResponse', - 'KeyValuePairString', - 'KeyValuePairStringJToken', - 'Link', - 'ListGenericResourceMetrics', - 'ListMetrics', - 'MetricDefinition', - 'MetricProperties', - 'MetricSample', - 'MetricSchema', - 'MetricSchemaProperty', - 'MetricV2', - 'MetricV2Value', - 'ModifyExperiment', - 'OutputDatasetLineage', - 'PaginatedArtifactContentInformationList', - 'PaginatedArtifactList', - 'PaginatedExperimentList', - 'PaginatedMetricDefinitionList', - 'PaginatedRunList', - 'PaginatedSpanDefinition1List', - 'PostRunMetricsError', - 'PostRunMetricsResult', - 'QueryParams', - 'QueueingInfo', - 'RetrieveFullFidelityMetricRequest', - 'RootError', - 'Run', - 'RunDetails', - 'RunDetailsWarning', - 'RunMetric', - 'RunOptions', - 'RunServiceInstances', - 'RunStatusSpans', - 'RunTypeV2', - 'ServiceInstance', - 'ServiceInstanceResult', - 'SpanContext', - 'SpanDefinition1', - 'SqlDataPath', - 'StoredProcedureParameter', - 'TypedAssetReference', - 'User', - 'DatasetConsumptionType', - 'DatasetDeliveryMechanism', - 'DatasetOutputType', - 'ExperimentViewType', - 'MetricValueType', - 'RunStatus', - 'SortOrderDirection', - 'StoredProcedureParameterType', + "AddOrModifyRunServiceInstancesRequest", + "Artifact", + "ArtifactContentInformation", + "ArtifactDataPath", + "ArtifactPath", + "ArtifactPathList", + "BaseEvent", + "BatchAddOrModifyRunRequest", + "BatchArtifactContentInformationResult", + "BatchEventCommand", + "BatchEventCommandResult", + "BatchIMetricV2", + "BatchRequest1", + "BatchResult1", + "BatchRunResult", + "Compute", + "ComputeRequest", + "CreateRun", + "CreatedFrom", + "DatasetIdentifier", + "DatasetInputDetails", + "DatasetLineage", + "DatasetOutputDetails", + "DeleteConfiguration", + "DeleteExperimentTagsResult", + "DeleteOrModifyTags", + "DeleteRunServices", + "DeleteTagsCommand", + "DerivedMetricKey", + "EndpointSetting", + "ErrorAdditionalInfo", + "ErrorResponse", + "Event", + "Experiment", + "ExperimentQueryParams", + "GetRunDataRequest", + "GetRunDataResult", + "GetRunsByIds", + "GetSampledMetricRequest", + "IMetricV2", + "InnerErrorResponse", + "JobCost", + "KeyValuePairBaseEventErrorResponse", + "KeyValuePairString", + "KeyValuePairStringJToken", + "Link", + "ListGenericResourceMetrics", + "ListMetrics", + "MetricDefinition", + "MetricProperties", + "MetricSample", + "MetricSchema", + "MetricSchemaProperty", + "MetricV2", + "MetricV2Value", + "ModifyExperiment", + "OutputDatasetLineage", + "PaginatedArtifactContentInformationList", + "PaginatedArtifactList", + "PaginatedExperimentList", + "PaginatedMetricDefinitionList", + "PaginatedRunList", + "PaginatedSpanDefinition1List", + "PostRunMetricsError", + "PostRunMetricsResult", + "QueryParams", + "QueueingInfo", + "RetrieveFullFidelityMetricRequest", + "RootError", + "Run", + "RunDetails", + "RunDetailsWarning", + "RunMetric", + "RunOptions", + "RunServiceInstances", + "RunStatusSpans", + "RunTypeV2", + "ServiceInstance", + "ServiceInstanceResult", + "SpanContext", + "SpanDefinition1", + "SqlDataPath", + "StoredProcedureParameter", + "TypedAssetReference", + "User", + "DatasetConsumptionType", + "DatasetDeliveryMechanism", + "DatasetOutputType", + "ExperimentViewType", + "MetricValueType", + "RunStatus", + "SortOrderDirection", + "StoredProcedureParameterType", ] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/models/_azure_machine_learning_workspaces_enums.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/models/_azure_machine_learning_workspaces_enums.py index cb89b2e30b05..f8c1e52198dd 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/models/_azure_machine_learning_workspaces_enums.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/models/_azure_machine_learning_workspaces_enums.py @@ -15,6 +15,7 @@ class DatasetConsumptionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): RUN_INPUT = "RunInput" REFERENCE = "Reference" + class DatasetDeliveryMechanism(str, Enum, metaclass=CaseInsensitiveEnumMeta): DIRECT = "Direct" @@ -22,20 +23,22 @@ class DatasetDeliveryMechanism(str, Enum, metaclass=CaseInsensitiveEnumMeta): DOWNLOAD = "Download" HDFS = "Hdfs" + class DatasetOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): RUN_OUTPUT = "RunOutput" REFERENCE = "Reference" + class ExperimentViewType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """ViewType filters experiments by their archived state. Default is ActiveOnly - """ + """ViewType filters experiments by their archived state. Default is ActiveOnly""" DEFAULT = "Default" ALL = "All" ACTIVE_ONLY = "ActiveOnly" ARCHIVED_ONLY = "ArchivedOnly" + class MetricValueType(str, Enum, metaclass=CaseInsensitiveEnumMeta): INT = "Int" @@ -44,6 +47,7 @@ class MetricValueType(str, Enum, metaclass=CaseInsensitiveEnumMeta): BOOL = "Bool" ARTIFACT = "Artifact" + class RunStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Gets span status. OpenTelemetry sets it to @@ -65,12 +69,16 @@ class RunStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): FAILED = "Failed" CANCELED = "Canceled" + class SortOrderDirection(str, Enum, metaclass=CaseInsensitiveEnumMeta): ASC = "Asc" DESC = "Desc" -class StoredProcedureParameterType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + +class StoredProcedureParameterType( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): STRING = "String" INT = "Int" diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/models/_models.py index 398700eefc69..1b1580e44ff3 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/models/_models.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/models/_models.py @@ -18,19 +18,16 @@ class AddOrModifyRunServiceInstancesRequest(msrest.serialization.Model): """ _attribute_map = { - 'instances': {'key': 'instances', 'type': '{ServiceInstance}'}, + "instances": {"key": "instances", "type": "{ServiceInstance}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword instances: Dictionary of :code:``. :paramtype instances: dict[str, ~azure.mgmt.machinelearningservices.models.ServiceInstance] """ super(AddOrModifyRunServiceInstancesRequest, self).__init__(**kwargs) - self.instances = kwargs.get('instances', None) + self.instances = kwargs.get("instances", None) class Artifact(msrest.serialization.Model): @@ -59,26 +56,23 @@ class Artifact(msrest.serialization.Model): """ _validation = { - 'origin': {'required': True}, - 'container': {'required': True}, - 'path': {'required': True}, + "origin": {"required": True}, + "container": {"required": True}, + "path": {"required": True}, } _attribute_map = { - 'artifact_id': {'key': 'artifactId', 'type': 'str'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'container': {'key': 'container', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, - 'data_path': {'key': 'dataPath', 'type': 'ArtifactDataPath'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "artifact_id": {"key": "artifactId", "type": "str"}, + "origin": {"key": "origin", "type": "str"}, + "container": {"key": "container", "type": "str"}, + "path": {"key": "path", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "created_time": {"key": "createdTime", "type": "iso-8601"}, + "data_path": {"key": "dataPath", "type": "ArtifactDataPath"}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword artifact_id: The identifier of an Artifact. Format of ArtifactId - {Origin}/{Container}/{Path}. @@ -101,14 +95,14 @@ def __init__( :paramtype tags: dict[str, str] """ super(Artifact, self).__init__(**kwargs) - self.artifact_id = kwargs.get('artifact_id', None) - self.origin = kwargs['origin'] - self.container = kwargs['container'] - self.path = kwargs['path'] - self.etag = kwargs.get('etag', None) - self.created_time = kwargs.get('created_time', None) - self.data_path = kwargs.get('data_path', None) - self.tags = kwargs.get('tags', None) + self.artifact_id = kwargs.get("artifact_id", None) + self.origin = kwargs["origin"] + self.container = kwargs["container"] + self.path = kwargs["path"] + self.etag = kwargs.get("etag", None) + self.created_time = kwargs.get("created_time", None) + self.data_path = kwargs.get("data_path", None) + self.tags = kwargs.get("tags", None) class ArtifactContentInformation(msrest.serialization.Model): @@ -129,17 +123,14 @@ class ArtifactContentInformation(msrest.serialization.Model): """ _attribute_map = { - 'content_uri': {'key': 'contentUri', 'type': 'str'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'container': {'key': 'container', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "content_uri": {"key": "contentUri", "type": "str"}, + "origin": {"key": "origin", "type": "str"}, + "container": {"key": "container", "type": "str"}, + "path": {"key": "path", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword content_uri: The URI of the content. :paramtype content_uri: str @@ -155,11 +146,11 @@ def __init__( :paramtype tags: dict[str, str] """ super(ArtifactContentInformation, self).__init__(**kwargs) - self.content_uri = kwargs.get('content_uri', None) - self.origin = kwargs.get('origin', None) - self.container = kwargs.get('container', None) - self.path = kwargs.get('path', None) - self.tags = kwargs.get('tags', None) + self.content_uri = kwargs.get("content_uri", None) + self.origin = kwargs.get("origin", None) + self.container = kwargs.get("container", None) + self.path = kwargs.get("path", None) + self.tags = kwargs.get("tags", None) class ArtifactDataPath(msrest.serialization.Model): @@ -174,15 +165,12 @@ class ArtifactDataPath(msrest.serialization.Model): """ _attribute_map = { - 'data_store_name': {'key': 'dataStoreName', 'type': 'str'}, - 'relative_path': {'key': 'relativePath', 'type': 'str'}, - 'sql_data_path': {'key': 'sqlDataPath', 'type': 'SqlDataPath'}, + "data_store_name": {"key": "dataStoreName", "type": "str"}, + "relative_path": {"key": "relativePath", "type": "str"}, + "sql_data_path": {"key": "sqlDataPath", "type": "SqlDataPath"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data_store_name: :paramtype data_store_name: str @@ -192,9 +180,9 @@ def __init__( :paramtype sql_data_path: ~azure.mgmt.machinelearningservices.models.SqlDataPath """ super(ArtifactDataPath, self).__init__(**kwargs) - self.data_store_name = kwargs.get('data_store_name', None) - self.relative_path = kwargs.get('relative_path', None) - self.sql_data_path = kwargs.get('sql_data_path', None) + self.data_store_name = kwargs.get("data_store_name", None) + self.relative_path = kwargs.get("relative_path", None) + self.sql_data_path = kwargs.get("sql_data_path", None) class ArtifactPath(msrest.serialization.Model): @@ -209,18 +197,15 @@ class ArtifactPath(msrest.serialization.Model): """ _validation = { - 'path': {'required': True}, + "path": {"required": True}, } _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "path": {"key": "path", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword path: Required. The path to the Artifact in a container. :paramtype path: str @@ -228,8 +213,8 @@ def __init__( :paramtype tags: dict[str, str] """ super(ArtifactPath, self).__init__(**kwargs) - self.path = kwargs['path'] - self.tags = kwargs.get('tags', None) + self.path = kwargs["path"] + self.tags = kwargs.get("tags", None) class ArtifactPathList(msrest.serialization.Model): @@ -242,23 +227,20 @@ class ArtifactPathList(msrest.serialization.Model): """ _validation = { - 'paths': {'required': True}, + "paths": {"required": True}, } _attribute_map = { - 'paths': {'key': 'paths', 'type': '[ArtifactPath]'}, + "paths": {"key": "paths", "type": "[ArtifactPath]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword paths: Required. List of Artifact Paths. :paramtype paths: list[~azure.mgmt.machinelearningservices.models.ArtifactPath] """ super(ArtifactPathList, self).__init__(**kwargs) - self.paths = kwargs['paths'] + self.paths = kwargs["paths"] class BaseEvent(msrest.serialization.Model): @@ -273,15 +255,12 @@ class BaseEvent(msrest.serialization.Model): """ _attribute_map = { - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'name': {'key': 'name', 'type': 'str'}, - 'data': {'key': 'data', 'type': 'object'}, + "timestamp": {"key": "timestamp", "type": "iso-8601"}, + "name": {"key": "name", "type": "str"}, + "data": {"key": "data", "type": "object"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword timestamp: :paramtype timestamp: ~datetime.datetime @@ -291,9 +270,9 @@ def __init__( :paramtype data: any """ super(BaseEvent, self).__init__(**kwargs) - self.timestamp = kwargs.get('timestamp', None) - self.name = kwargs.get('name', None) - self.data = kwargs.get('data', None) + self.timestamp = kwargs.get("timestamp", None) + self.name = kwargs.get("name", None) + self.data = kwargs.get("data", None) class BatchAddOrModifyRunRequest(msrest.serialization.Model): @@ -304,19 +283,16 @@ class BatchAddOrModifyRunRequest(msrest.serialization.Model): """ _attribute_map = { - 'runs': {'key': 'runs', 'type': '[CreateRun]'}, + "runs": {"key": "runs", "type": "[CreateRun]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword runs: :paramtype runs: list[~azure.mgmt.machinelearningservices.models.CreateRun] """ super(BatchAddOrModifyRunRequest, self).__init__(**kwargs) - self.runs = kwargs.get('runs', None) + self.runs = kwargs.get("runs", None) class BatchArtifactContentInformationResult(msrest.serialization.Model): @@ -333,15 +309,15 @@ class BatchArtifactContentInformationResult(msrest.serialization.Model): """ _attribute_map = { - 'artifacts': {'key': 'artifacts', 'type': '{Artifact}'}, - 'artifact_content_information': {'key': 'artifactContentInformation', 'type': '{ArtifactContentInformation}'}, - 'errors': {'key': 'errors', 'type': '{ErrorResponse}'}, + "artifacts": {"key": "artifacts", "type": "{Artifact}"}, + "artifact_content_information": { + "key": "artifactContentInformation", + "type": "{ArtifactContentInformation}", + }, + "errors": {"key": "errors", "type": "{ErrorResponse}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword artifacts: Artifact details of the Artifact Ids requested. :paramtype artifacts: dict[str, ~azure.mgmt.machinelearningservices.models.Artifact] @@ -353,9 +329,11 @@ def __init__( :paramtype errors: dict[str, ~azure.mgmt.machinelearningservices.models.ErrorResponse] """ super(BatchArtifactContentInformationResult, self).__init__(**kwargs) - self.artifacts = kwargs.get('artifacts', None) - self.artifact_content_information = kwargs.get('artifact_content_information', None) - self.errors = kwargs.get('errors', None) + self.artifacts = kwargs.get("artifacts", None) + self.artifact_content_information = kwargs.get( + "artifact_content_information", None + ) + self.errors = kwargs.get("errors", None) class BatchEventCommand(msrest.serialization.Model): @@ -366,19 +344,16 @@ class BatchEventCommand(msrest.serialization.Model): """ _attribute_map = { - 'events': {'key': 'events', 'type': '[BaseEvent]'}, + "events": {"key": "events", "type": "[BaseEvent]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword events: :paramtype events: list[~azure.mgmt.machinelearningservices.models.BaseEvent] """ super(BatchEventCommand, self).__init__(**kwargs) - self.events = kwargs.get('events', None) + self.events = kwargs.get("events", None) class BatchEventCommandResult(msrest.serialization.Model): @@ -392,14 +367,14 @@ class BatchEventCommandResult(msrest.serialization.Model): """ _attribute_map = { - 'errors': {'key': 'errors', 'type': '[KeyValuePairBaseEventErrorResponse]'}, - 'successes': {'key': 'successes', 'type': '[str]'}, + "errors": { + "key": "errors", + "type": "[KeyValuePairBaseEventErrorResponse]", + }, + "successes": {"key": "successes", "type": "[str]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword errors: :paramtype errors: @@ -408,8 +383,8 @@ def __init__( :paramtype successes: list[str] """ super(BatchEventCommandResult, self).__init__(**kwargs) - self.errors = kwargs.get('errors', None) - self.successes = kwargs.get('successes', None) + self.errors = kwargs.get("errors", None) + self.successes = kwargs.get("successes", None) class BatchIMetricV2(msrest.serialization.Model): @@ -422,14 +397,11 @@ class BatchIMetricV2(msrest.serialization.Model): """ _attribute_map = { - 'values': {'key': 'values', 'type': '[IMetricV2]'}, - 'report_errors': {'key': 'reportErrors', 'type': 'bool'}, + "values": {"key": "values", "type": "[IMetricV2]"}, + "report_errors": {"key": "reportErrors", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword values: :paramtype values: list[~azure.mgmt.machinelearningservices.models.IMetricV2] @@ -437,8 +409,8 @@ def __init__( :paramtype report_errors: bool """ super(BatchIMetricV2, self).__init__(**kwargs) - self.values = kwargs.get('values', None) - self.report_errors = kwargs.get('report_errors', None) + self.values = kwargs.get("values", None) + self.report_errors = kwargs.get("report_errors", None) class BatchRequest1(msrest.serialization.Model): @@ -449,19 +421,16 @@ class BatchRequest1(msrest.serialization.Model): """ _attribute_map = { - 'requests': {'key': 'requests', 'type': '{GetRunDataRequest}'}, + "requests": {"key": "requests", "type": "{GetRunDataRequest}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword requests: Dictionary of :code:``. :paramtype requests: dict[str, ~azure.mgmt.machinelearningservices.models.GetRunDataRequest] """ super(BatchRequest1, self).__init__(**kwargs) - self.requests = kwargs.get('requests', None) + self.requests = kwargs.get("requests", None) class BatchResult1(msrest.serialization.Model): @@ -475,14 +444,14 @@ class BatchResult1(msrest.serialization.Model): """ _attribute_map = { - 'successful_results': {'key': 'successfulResults', 'type': '{GetRunDataResult}'}, - 'failed_results': {'key': 'failedResults', 'type': '{ErrorResponse}'}, + "successful_results": { + "key": "successfulResults", + "type": "{GetRunDataResult}", + }, + "failed_results": {"key": "failedResults", "type": "{ErrorResponse}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword successful_results: Dictionary of :code:``. :paramtype successful_results: dict[str, @@ -491,8 +460,8 @@ def __init__( :paramtype failed_results: dict[str, ~azure.mgmt.machinelearningservices.models.ErrorResponse] """ super(BatchResult1, self).__init__(**kwargs) - self.successful_results = kwargs.get('successful_results', None) - self.failed_results = kwargs.get('failed_results', None) + self.successful_results = kwargs.get("successful_results", None) + self.failed_results = kwargs.get("failed_results", None) class BatchRunResult(msrest.serialization.Model): @@ -505,14 +474,11 @@ class BatchRunResult(msrest.serialization.Model): """ _attribute_map = { - 'runs': {'key': 'runs', 'type': '{Run}'}, - 'errors': {'key': 'errors', 'type': '{ErrorResponse}'}, + "runs": {"key": "runs", "type": "{Run}"}, + "errors": {"key": "errors", "type": "{ErrorResponse}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword runs: Dictionary of :code:``. :paramtype runs: dict[str, ~azure.mgmt.machinelearningservices.models.Run] @@ -520,8 +486,8 @@ def __init__( :paramtype errors: dict[str, ~azure.mgmt.machinelearningservices.models.ErrorResponse] """ super(BatchRunResult, self).__init__(**kwargs) - self.runs = kwargs.get('runs', None) - self.errors = kwargs.get('errors', None) + self.runs = kwargs.get("runs", None) + self.errors = kwargs.get("errors", None) class Compute(msrest.serialization.Model): @@ -544,19 +510,16 @@ class Compute(msrest.serialization.Model): """ _attribute_map = { - 'target': {'key': 'target', 'type': 'str'}, - 'target_type': {'key': 'targetType', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'gpu_count': {'key': 'gpuCount', 'type': 'int'}, - 'priority': {'key': 'priority', 'type': 'str'}, - 'region': {'key': 'region', 'type': 'str'}, + "target": {"key": "target", "type": "str"}, + "target_type": {"key": "targetType", "type": "str"}, + "vm_size": {"key": "vmSize", "type": "str"}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "gpu_count": {"key": "gpuCount", "type": "int"}, + "priority": {"key": "priority", "type": "str"}, + "region": {"key": "region", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword target: :paramtype target: str @@ -574,13 +537,13 @@ def __init__( :paramtype region: str """ super(Compute, self).__init__(**kwargs) - self.target = kwargs.get('target', None) - self.target_type = kwargs.get('target_type', None) - self.vm_size = kwargs.get('vm_size', None) - self.instance_count = kwargs.get('instance_count', None) - self.gpu_count = kwargs.get('gpu_count', None) - self.priority = kwargs.get('priority', None) - self.region = kwargs.get('region', None) + self.target = kwargs.get("target", None) + self.target_type = kwargs.get("target_type", None) + self.vm_size = kwargs.get("vm_size", None) + self.instance_count = kwargs.get("instance_count", None) + self.gpu_count = kwargs.get("gpu_count", None) + self.priority = kwargs.get("priority", None) + self.region = kwargs.get("region", None) class ComputeRequest(msrest.serialization.Model): @@ -593,14 +556,11 @@ class ComputeRequest(msrest.serialization.Model): """ _attribute_map = { - 'node_count': {'key': 'nodeCount', 'type': 'int'}, - 'gpu_count': {'key': 'gpuCount', 'type': 'int'}, + "node_count": {"key": "nodeCount", "type": "int"}, + "gpu_count": {"key": "gpuCount", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword node_count: :paramtype node_count: int @@ -608,8 +568,8 @@ def __init__( :paramtype gpu_count: int """ super(ComputeRequest, self).__init__(**kwargs) - self.node_count = kwargs.get('node_count', None) - self.gpu_count = kwargs.get('gpu_count', None) + self.node_count = kwargs.get("node_count", None) + self.gpu_count = kwargs.get("gpu_count", None) class CreatedFrom(msrest.serialization.Model): @@ -626,15 +586,12 @@ class CreatedFrom(msrest.serialization.Model): """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'location_type': {'key': 'locationType', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, + "type": {"key": "type", "type": "str"}, + "location_type": {"key": "locationType", "type": "str"}, + "location": {"key": "location", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword type: The only acceptable values to pass in are None and "Notebook". The default value is None. @@ -646,9 +603,9 @@ def __init__( :paramtype location: str """ super(CreatedFrom, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.location_type = kwargs.get('location_type', None) - self.location = kwargs.get('location', None) + self.type = kwargs.get("type", None) + self.location_type = kwargs.get("location_type", None) + self.location = kwargs.get("location", None) class CreateRun(msrest.serialization.Model): @@ -739,58 +696,64 @@ class CreateRun(msrest.serialization.Model): """ _validation = { - 'unique_child_run_compute_targets': {'unique': True}, - 'input_datasets': {'unique': True}, - 'output_datasets': {'unique': True}, + "unique_child_run_compute_targets": {"unique": True}, + "input_datasets": {"unique": True}, + "output_datasets": {"unique": True}, } _attribute_map = { - 'run_id': {'key': 'runId', 'type': 'str'}, - 'parent_run_id': {'key': 'parentRunId', 'type': 'str'}, - 'experiment_id': {'key': 'experimentId', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'start_time_utc': {'key': 'startTimeUtc', 'type': 'iso-8601'}, - 'end_time_utc': {'key': 'endTimeUtc', 'type': 'iso-8601'}, - 'options': {'key': 'options', 'type': 'RunOptions'}, - 'is_virtual': {'key': 'isVirtual', 'type': 'bool'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'data_container_id': {'key': 'dataContainerId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'hidden': {'key': 'hidden', 'type': 'bool'}, - 'run_type': {'key': 'runType', 'type': 'str'}, - 'run_type_v2': {'key': 'runTypeV2', 'type': 'RunTypeV2'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'parameters': {'key': 'parameters', 'type': '{object}'}, - 'action_uris': {'key': 'actionUris', 'type': '{str}'}, - 'script_name': {'key': 'scriptName', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'unique_child_run_compute_targets': {'key': 'uniqueChildRunComputeTargets', 'type': '[str]'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'settings': {'key': 'settings', 'type': '{str}'}, - 'services': {'key': 'services', 'type': '{EndpointSetting}'}, - 'input_datasets': {'key': 'inputDatasets', 'type': '[DatasetLineage]'}, - 'output_datasets': {'key': 'outputDatasets', 'type': '[OutputDatasetLineage]'}, - 'run_definition': {'key': 'runDefinition', 'type': 'object'}, - 'job_specification': {'key': 'jobSpecification', 'type': 'object'}, - 'primary_metric_name': {'key': 'primaryMetricName', 'type': 'str'}, - 'created_from': {'key': 'createdFrom', 'type': 'CreatedFrom'}, - 'cancel_uri': {'key': 'cancelUri', 'type': 'str'}, - 'complete_uri': {'key': 'completeUri', 'type': 'str'}, - 'diagnostics_uri': {'key': 'diagnosticsUri', 'type': 'str'}, - 'compute_request': {'key': 'computeRequest', 'type': 'ComputeRequest'}, - 'compute': {'key': 'compute', 'type': 'Compute'}, - 'retain_for_lifetime_of_workspace': {'key': 'retainForLifetimeOfWorkspace', 'type': 'bool'}, - 'queueing_info': {'key': 'queueingInfo', 'type': 'QueueingInfo'}, - 'active_child_run_id': {'key': 'activeChildRunId', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '{TypedAssetReference}'}, - 'outputs': {'key': 'outputs', 'type': '{TypedAssetReference}'}, + "run_id": {"key": "runId", "type": "str"}, + "parent_run_id": {"key": "parentRunId", "type": "str"}, + "experiment_id": {"key": "experimentId", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "start_time_utc": {"key": "startTimeUtc", "type": "iso-8601"}, + "end_time_utc": {"key": "endTimeUtc", "type": "iso-8601"}, + "options": {"key": "options", "type": "RunOptions"}, + "is_virtual": {"key": "isVirtual", "type": "bool"}, + "display_name": {"key": "displayName", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "data_container_id": {"key": "dataContainerId", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "hidden": {"key": "hidden", "type": "bool"}, + "run_type": {"key": "runType", "type": "str"}, + "run_type_v2": {"key": "runTypeV2", "type": "RunTypeV2"}, + "properties": {"key": "properties", "type": "{str}"}, + "parameters": {"key": "parameters", "type": "{object}"}, + "action_uris": {"key": "actionUris", "type": "{str}"}, + "script_name": {"key": "scriptName", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "unique_child_run_compute_targets": { + "key": "uniqueChildRunComputeTargets", + "type": "[str]", + }, + "tags": {"key": "tags", "type": "{str}"}, + "settings": {"key": "settings", "type": "{str}"}, + "services": {"key": "services", "type": "{EndpointSetting}"}, + "input_datasets": {"key": "inputDatasets", "type": "[DatasetLineage]"}, + "output_datasets": { + "key": "outputDatasets", + "type": "[OutputDatasetLineage]", + }, + "run_definition": {"key": "runDefinition", "type": "object"}, + "job_specification": {"key": "jobSpecification", "type": "object"}, + "primary_metric_name": {"key": "primaryMetricName", "type": "str"}, + "created_from": {"key": "createdFrom", "type": "CreatedFrom"}, + "cancel_uri": {"key": "cancelUri", "type": "str"}, + "complete_uri": {"key": "completeUri", "type": "str"}, + "diagnostics_uri": {"key": "diagnosticsUri", "type": "str"}, + "compute_request": {"key": "computeRequest", "type": "ComputeRequest"}, + "compute": {"key": "compute", "type": "Compute"}, + "retain_for_lifetime_of_workspace": { + "key": "retainForLifetimeOfWorkspace", + "type": "bool", + }, + "queueing_info": {"key": "queueingInfo", "type": "QueueingInfo"}, + "active_child_run_id": {"key": "activeChildRunId", "type": "str"}, + "inputs": {"key": "inputs", "type": "{TypedAssetReference}"}, + "outputs": {"key": "outputs", "type": "{TypedAssetReference}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword run_id: The identifier for the run. Run IDs must be less than 256 characters and contain only alphanumeric characters with dashes and underscores. @@ -877,46 +840,50 @@ def __init__( :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.TypedAssetReference] """ super(CreateRun, self).__init__(**kwargs) - self.run_id = kwargs.get('run_id', None) - self.parent_run_id = kwargs.get('parent_run_id', None) - self.experiment_id = kwargs.get('experiment_id', None) - self.status = kwargs.get('status', None) - self.start_time_utc = kwargs.get('start_time_utc', None) - self.end_time_utc = kwargs.get('end_time_utc', None) - self.options = kwargs.get('options', None) - self.is_virtual = kwargs.get('is_virtual', None) - self.display_name = kwargs.get('display_name', None) - self.name = kwargs.get('name', None) - self.data_container_id = kwargs.get('data_container_id', None) - self.description = kwargs.get('description', None) - self.hidden = kwargs.get('hidden', None) - self.run_type = kwargs.get('run_type', None) - self.run_type_v2 = kwargs.get('run_type_v2', None) - self.properties = kwargs.get('properties', None) - self.parameters = kwargs.get('parameters', None) - self.action_uris = kwargs.get('action_uris', None) - self.script_name = kwargs.get('script_name', None) - self.target = kwargs.get('target', None) - self.unique_child_run_compute_targets = kwargs.get('unique_child_run_compute_targets', None) - self.tags = kwargs.get('tags', None) - self.settings = kwargs.get('settings', None) - self.services = kwargs.get('services', None) - self.input_datasets = kwargs.get('input_datasets', None) - self.output_datasets = kwargs.get('output_datasets', None) - self.run_definition = kwargs.get('run_definition', None) - self.job_specification = kwargs.get('job_specification', None) - self.primary_metric_name = kwargs.get('primary_metric_name', None) - self.created_from = kwargs.get('created_from', None) - self.cancel_uri = kwargs.get('cancel_uri', None) - self.complete_uri = kwargs.get('complete_uri', None) - self.diagnostics_uri = kwargs.get('diagnostics_uri', None) - self.compute_request = kwargs.get('compute_request', None) - self.compute = kwargs.get('compute', None) - self.retain_for_lifetime_of_workspace = kwargs.get('retain_for_lifetime_of_workspace', None) - self.queueing_info = kwargs.get('queueing_info', None) - self.active_child_run_id = kwargs.get('active_child_run_id', None) - self.inputs = kwargs.get('inputs', None) - self.outputs = kwargs.get('outputs', None) + self.run_id = kwargs.get("run_id", None) + self.parent_run_id = kwargs.get("parent_run_id", None) + self.experiment_id = kwargs.get("experiment_id", None) + self.status = kwargs.get("status", None) + self.start_time_utc = kwargs.get("start_time_utc", None) + self.end_time_utc = kwargs.get("end_time_utc", None) + self.options = kwargs.get("options", None) + self.is_virtual = kwargs.get("is_virtual", None) + self.display_name = kwargs.get("display_name", None) + self.name = kwargs.get("name", None) + self.data_container_id = kwargs.get("data_container_id", None) + self.description = kwargs.get("description", None) + self.hidden = kwargs.get("hidden", None) + self.run_type = kwargs.get("run_type", None) + self.run_type_v2 = kwargs.get("run_type_v2", None) + self.properties = kwargs.get("properties", None) + self.parameters = kwargs.get("parameters", None) + self.action_uris = kwargs.get("action_uris", None) + self.script_name = kwargs.get("script_name", None) + self.target = kwargs.get("target", None) + self.unique_child_run_compute_targets = kwargs.get( + "unique_child_run_compute_targets", None + ) + self.tags = kwargs.get("tags", None) + self.settings = kwargs.get("settings", None) + self.services = kwargs.get("services", None) + self.input_datasets = kwargs.get("input_datasets", None) + self.output_datasets = kwargs.get("output_datasets", None) + self.run_definition = kwargs.get("run_definition", None) + self.job_specification = kwargs.get("job_specification", None) + self.primary_metric_name = kwargs.get("primary_metric_name", None) + self.created_from = kwargs.get("created_from", None) + self.cancel_uri = kwargs.get("cancel_uri", None) + self.complete_uri = kwargs.get("complete_uri", None) + self.diagnostics_uri = kwargs.get("diagnostics_uri", None) + self.compute_request = kwargs.get("compute_request", None) + self.compute = kwargs.get("compute", None) + self.retain_for_lifetime_of_workspace = kwargs.get( + "retain_for_lifetime_of_workspace", None + ) + self.queueing_info = kwargs.get("queueing_info", None) + self.active_child_run_id = kwargs.get("active_child_run_id", None) + self.inputs = kwargs.get("inputs", None) + self.outputs = kwargs.get("outputs", None) class DatasetIdentifier(msrest.serialization.Model): @@ -931,15 +898,12 @@ class DatasetIdentifier(msrest.serialization.Model): """ _attribute_map = { - 'saved_id': {'key': 'savedId', 'type': 'str'}, - 'registered_id': {'key': 'registeredId', 'type': 'str'}, - 'registered_version': {'key': 'registeredVersion', 'type': 'str'}, + "saved_id": {"key": "savedId", "type": "str"}, + "registered_id": {"key": "registeredId", "type": "str"}, + "registered_version": {"key": "registeredVersion", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword saved_id: :paramtype saved_id: str @@ -949,9 +913,9 @@ def __init__( :paramtype registered_version: str """ super(DatasetIdentifier, self).__init__(**kwargs) - self.saved_id = kwargs.get('saved_id', None) - self.registered_id = kwargs.get('registered_id', None) - self.registered_version = kwargs.get('registered_version', None) + self.saved_id = kwargs.get("saved_id", None) + self.registered_id = kwargs.get("registered_id", None) + self.registered_version = kwargs.get("registered_version", None) class DatasetInputDetails(msrest.serialization.Model): @@ -966,15 +930,12 @@ class DatasetInputDetails(msrest.serialization.Model): """ _attribute_map = { - 'input_name': {'key': 'inputName', 'type': 'str'}, - 'mechanism': {'key': 'mechanism', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, + "input_name": {"key": "inputName", "type": "str"}, + "mechanism": {"key": "mechanism", "type": "str"}, + "path_on_compute": {"key": "pathOnCompute", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword input_name: :paramtype input_name: str @@ -985,9 +946,9 @@ def __init__( :paramtype path_on_compute: str """ super(DatasetInputDetails, self).__init__(**kwargs) - self.input_name = kwargs.get('input_name', None) - self.mechanism = kwargs.get('mechanism', None) - self.path_on_compute = kwargs.get('path_on_compute', None) + self.input_name = kwargs.get("input_name", None) + self.mechanism = kwargs.get("mechanism", None) + self.path_on_compute = kwargs.get("path_on_compute", None) class DatasetLineage(msrest.serialization.Model): @@ -1003,15 +964,15 @@ class DatasetLineage(msrest.serialization.Model): """ _attribute_map = { - 'identifier': {'key': 'identifier', 'type': 'DatasetIdentifier'}, - 'consumption_type': {'key': 'consumptionType', 'type': 'str'}, - 'input_details': {'key': 'inputDetails', 'type': 'DatasetInputDetails'}, + "identifier": {"key": "identifier", "type": "DatasetIdentifier"}, + "consumption_type": {"key": "consumptionType", "type": "str"}, + "input_details": { + "key": "inputDetails", + "type": "DatasetInputDetails", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword identifier: :paramtype identifier: ~azure.mgmt.machinelearningservices.models.DatasetIdentifier @@ -1022,9 +983,9 @@ def __init__( :paramtype input_details: ~azure.mgmt.machinelearningservices.models.DatasetInputDetails """ super(DatasetLineage, self).__init__(**kwargs) - self.identifier = kwargs.get('identifier', None) - self.consumption_type = kwargs.get('consumption_type', None) - self.input_details = kwargs.get('input_details', None) + self.identifier = kwargs.get("identifier", None) + self.consumption_type = kwargs.get("consumption_type", None) + self.input_details = kwargs.get("input_details", None) class DatasetOutputDetails(msrest.serialization.Model): @@ -1035,19 +996,16 @@ class DatasetOutputDetails(msrest.serialization.Model): """ _attribute_map = { - 'output_name': {'key': 'outputName', 'type': 'str'}, + "output_name": {"key": "outputName", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword output_name: :paramtype output_name: str """ super(DatasetOutputDetails, self).__init__(**kwargs) - self.output_name = kwargs.get('output_name', None) + self.output_name = kwargs.get("output_name", None) class DeleteConfiguration(msrest.serialization.Model): @@ -1062,15 +1020,12 @@ class DeleteConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'workspace_id': {'key': 'workspaceId', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - 'cutoff_days': {'key': 'cutoffDays', 'type': 'int'}, + "workspace_id": {"key": "workspaceId", "type": "str"}, + "is_enabled": {"key": "isEnabled", "type": "bool"}, + "cutoff_days": {"key": "cutoffDays", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword workspace_id: :paramtype workspace_id: str @@ -1080,9 +1035,9 @@ def __init__( :paramtype cutoff_days: int """ super(DeleteConfiguration, self).__init__(**kwargs) - self.workspace_id = kwargs.get('workspace_id', None) - self.is_enabled = kwargs.get('is_enabled', None) - self.cutoff_days = kwargs.get('cutoff_days', None) + self.workspace_id = kwargs.get("workspace_id", None) + self.is_enabled = kwargs.get("is_enabled", None) + self.cutoff_days = kwargs.get("cutoff_days", None) class DeleteExperimentTagsResult(msrest.serialization.Model): @@ -1093,19 +1048,16 @@ class DeleteExperimentTagsResult(msrest.serialization.Model): """ _attribute_map = { - 'errors': {'key': 'errors', 'type': '{ErrorResponse}'}, + "errors": {"key": "errors", "type": "{ErrorResponse}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword errors: Dictionary of :code:``. :paramtype errors: dict[str, ~azure.mgmt.machinelearningservices.models.ErrorResponse] """ super(DeleteExperimentTagsResult, self).__init__(**kwargs) - self.errors = kwargs.get('errors', None) + self.errors = kwargs.get("errors", None) class DeleteOrModifyTags(msrest.serialization.Model): @@ -1118,14 +1070,11 @@ class DeleteOrModifyTags(msrest.serialization.Model): """ _attribute_map = { - 'tags_to_modify': {'key': 'tagsToModify', 'type': '{str}'}, - 'tags_to_delete': {'key': 'tagsToDelete', 'type': '[str]'}, + "tags_to_modify": {"key": "tagsToModify", "type": "{str}"}, + "tags_to_delete": {"key": "tagsToDelete", "type": "[str]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags_to_modify: The KV pairs of tags to modify. :paramtype tags_to_modify: dict[str, str] @@ -1133,8 +1082,8 @@ def __init__( :paramtype tags_to_delete: list[str] """ super(DeleteOrModifyTags, self).__init__(**kwargs) - self.tags_to_modify = kwargs.get('tags_to_modify', None) - self.tags_to_delete = kwargs.get('tags_to_delete', None) + self.tags_to_modify = kwargs.get("tags_to_modify", None) + self.tags_to_delete = kwargs.get("tags_to_delete", None) class DeleteRunServices(msrest.serialization.Model): @@ -1145,19 +1094,16 @@ class DeleteRunServices(msrest.serialization.Model): """ _attribute_map = { - 'services_to_delete': {'key': 'servicesToDelete', 'type': '[str]'}, + "services_to_delete": {"key": "servicesToDelete", "type": "[str]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword services_to_delete: The list of Services to delete. :paramtype services_to_delete: list[str] """ super(DeleteRunServices, self).__init__(**kwargs) - self.services_to_delete = kwargs.get('services_to_delete', None) + self.services_to_delete = kwargs.get("services_to_delete", None) class DeleteTagsCommand(msrest.serialization.Model): @@ -1168,19 +1114,16 @@ class DeleteTagsCommand(msrest.serialization.Model): """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '[str]'}, + "tags": {"key": "tags", "type": "[str]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. :paramtype tags: list[str] """ super(DeleteTagsCommand, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) + self.tags = kwargs.get("tags", None) class DerivedMetricKey(msrest.serialization.Model): @@ -1197,21 +1140,18 @@ class DerivedMetricKey(msrest.serialization.Model): """ _validation = { - 'labels': {'unique': True}, - 'column_names': {'unique': True}, + "labels": {"unique": True}, + "column_names": {"unique": True}, } _attribute_map = { - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'labels': {'key': 'labels', 'type': '[str]'}, - 'column_names': {'key': 'columnNames', 'type': '[str]'}, + "namespace": {"key": "namespace", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "labels": {"key": "labels", "type": "[str]"}, + "column_names": {"key": "columnNames", "type": "[str]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword namespace: :paramtype namespace: str @@ -1223,10 +1163,10 @@ def __init__( :paramtype column_names: list[str] """ super(DerivedMetricKey, self).__init__(**kwargs) - self.namespace = kwargs.get('namespace', None) - self.name = kwargs.get('name', None) - self.labels = kwargs.get('labels', None) - self.column_names = kwargs.get('column_names', None) + self.namespace = kwargs.get("namespace", None) + self.name = kwargs.get("name", None) + self.labels = kwargs.get("labels", None) + self.column_names = kwargs.get("column_names", None) class EndpointSetting(msrest.serialization.Model): @@ -1253,21 +1193,18 @@ class EndpointSetting(msrest.serialization.Model): """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'ssl_thumbprint': {'key': 'sslThumbprint', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'proxy_endpoint': {'key': 'proxyEndpoint', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': '{str}'}, + "type": {"key": "type", "type": "str"}, + "port": {"key": "port", "type": "int"}, + "ssl_thumbprint": {"key": "sslThumbprint", "type": "str"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "proxy_endpoint": {"key": "proxyEndpoint", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "error_message": {"key": "errorMessage", "type": "str"}, + "enabled": {"key": "enabled", "type": "bool"}, + "properties": {"key": "properties", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword type: :paramtype type: str @@ -1289,15 +1226,15 @@ def __init__( :paramtype properties: dict[str, str] """ super(EndpointSetting, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.port = kwargs.get('port', None) - self.ssl_thumbprint = kwargs.get('ssl_thumbprint', None) - self.endpoint = kwargs.get('endpoint', None) - self.proxy_endpoint = kwargs.get('proxy_endpoint', None) - self.status = kwargs.get('status', None) - self.error_message = kwargs.get('error_message', None) - self.enabled = kwargs.get('enabled', None) - self.properties = kwargs.get('properties', None) + self.type = kwargs.get("type", None) + self.port = kwargs.get("port", None) + self.ssl_thumbprint = kwargs.get("ssl_thumbprint", None) + self.endpoint = kwargs.get("endpoint", None) + self.proxy_endpoint = kwargs.get("proxy_endpoint", None) + self.status = kwargs.get("status", None) + self.error_message = kwargs.get("error_message", None) + self.enabled = kwargs.get("enabled", None) + self.properties = kwargs.get("properties", None) class ErrorAdditionalInfo(msrest.serialization.Model): @@ -1310,14 +1247,11 @@ class ErrorAdditionalInfo(msrest.serialization.Model): """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, + "type": {"key": "type", "type": "str"}, + "info": {"key": "info", "type": "object"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword type: The additional info type. :paramtype type: str @@ -1325,8 +1259,8 @@ def __init__( :paramtype info: any """ super(ErrorAdditionalInfo, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.info = kwargs.get('info', None) + self.type = kwargs.get("type", None) + self.info = kwargs.get("info", None) class ErrorResponse(msrest.serialization.Model): @@ -1347,18 +1281,15 @@ class ErrorResponse(msrest.serialization.Model): """ _attribute_map = { - 'error': {'key': 'error', 'type': 'RootError'}, - 'correlation': {'key': 'correlation', 'type': '{str}'}, - 'environment': {'key': 'environment', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'time': {'key': 'time', 'type': 'iso-8601'}, - 'component_name': {'key': 'componentName', 'type': 'str'}, + "error": {"key": "error", "type": "RootError"}, + "correlation": {"key": "correlation", "type": "{str}"}, + "environment": {"key": "environment", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "time": {"key": "time", "type": "iso-8601"}, + "component_name": {"key": "componentName", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword error: The root error. :paramtype error: ~azure.mgmt.machinelearningservices.models.RootError @@ -1374,12 +1305,12 @@ def __init__( :paramtype component_name: str """ super(ErrorResponse, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - self.correlation = kwargs.get('correlation', None) - self.environment = kwargs.get('environment', None) - self.location = kwargs.get('location', None) - self.time = kwargs.get('time', None) - self.component_name = kwargs.get('component_name', None) + self.error = kwargs.get("error", None) + self.correlation = kwargs.get("correlation", None) + self.environment = kwargs.get("environment", None) + self.location = kwargs.get("location", None) + self.time = kwargs.get("time", None) + self.component_name = kwargs.get("component_name", None) class Event(msrest.serialization.Model): @@ -1395,15 +1326,12 @@ class Event(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'attributes': {'key': 'attributes', 'type': '{object}'}, + "name": {"key": "name", "type": "str"}, + "timestamp": {"key": "timestamp", "type": "iso-8601"}, + "attributes": {"key": "attributes", "type": "{object}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: Gets the Microsoft.MachineLearning.RunHistory.Contracts.Event name. :paramtype name: str @@ -1414,9 +1342,9 @@ def __init__( :paramtype attributes: dict[str, any] """ super(Event, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.timestamp = kwargs.get('timestamp', None) - self.attributes = kwargs.get('attributes', None) + self.name = kwargs.get("name", None) + self.timestamp = kwargs.get("timestamp", None) + self.attributes = kwargs.get("attributes", None) class Experiment(msrest.serialization.Model): @@ -1441,20 +1369,20 @@ class Experiment(msrest.serialization.Model): """ _attribute_map = { - 'experiment_id': {'key': 'experimentId', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_utc': {'key': 'createdUtc', 'type': 'iso-8601'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'archived_time': {'key': 'archivedTime', 'type': 'iso-8601'}, - 'retain_for_lifetime_of_workspace': {'key': 'retainForLifetimeOfWorkspace', 'type': 'bool'}, - 'artifact_location': {'key': 'artifactLocation', 'type': 'str'}, + "experiment_id": {"key": "experimentId", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_utc": {"key": "createdUtc", "type": "iso-8601"}, + "tags": {"key": "tags", "type": "{str}"}, + "archived_time": {"key": "archivedTime", "type": "iso-8601"}, + "retain_for_lifetime_of_workspace": { + "key": "retainForLifetimeOfWorkspace", + "type": "bool", + }, + "artifact_location": {"key": "artifactLocation", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword experiment_id: :paramtype experiment_id: str @@ -1474,14 +1402,16 @@ def __init__( :paramtype artifact_location: str """ super(Experiment, self).__init__(**kwargs) - self.experiment_id = kwargs.get('experiment_id', None) - self.name = kwargs.get('name', None) - self.description = kwargs.get('description', None) - self.created_utc = kwargs.get('created_utc', None) - self.tags = kwargs.get('tags', None) - self.archived_time = kwargs.get('archived_time', None) - self.retain_for_lifetime_of_workspace = kwargs.get('retain_for_lifetime_of_workspace', None) - self.artifact_location = kwargs.get('artifact_location', None) + self.experiment_id = kwargs.get("experiment_id", None) + self.name = kwargs.get("name", None) + self.description = kwargs.get("description", None) + self.created_utc = kwargs.get("created_utc", None) + self.tags = kwargs.get("tags", None) + self.archived_time = kwargs.get("archived_time", None) + self.retain_for_lifetime_of_workspace = kwargs.get( + "retain_for_lifetime_of_workspace", None + ) + self.artifact_location = kwargs.get("artifact_location", None) class ExperimentQueryParams(msrest.serialization.Model): @@ -1508,17 +1438,14 @@ class ExperimentQueryParams(msrest.serialization.Model): """ _attribute_map = { - 'view_type': {'key': 'viewType', 'type': 'str'}, - 'filter': {'key': 'filter', 'type': 'str'}, - 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, - 'order_by': {'key': 'orderBy', 'type': 'str'}, - 'top': {'key': 'top', 'type': 'int'}, + "view_type": {"key": "viewType", "type": "str"}, + "filter": {"key": "filter", "type": "str"}, + "continuation_token": {"key": "continuationToken", "type": "str"}, + "order_by": {"key": "orderBy", "type": "str"}, + "top": {"key": "top", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword view_type: ViewType filters experiments by their archived state. Default is ActiveOnly. Possible values include: "Default", "All", "ActiveOnly", "ArchivedOnly". @@ -1542,11 +1469,11 @@ def __init__( :paramtype top: int """ super(ExperimentQueryParams, self).__init__(**kwargs) - self.view_type = kwargs.get('view_type', None) - self.filter = kwargs.get('filter', None) - self.continuation_token = kwargs.get('continuation_token', None) - self.order_by = kwargs.get('order_by', None) - self.top = kwargs.get('top', None) + self.view_type = kwargs.get("view_type", None) + self.filter = kwargs.get("filter", None) + self.continuation_token = kwargs.get("continuation_token", None) + self.order_by = kwargs.get("order_by", None) + self.top = kwargs.get("top", None) class GetRunDataRequest(msrest.serialization.Model): @@ -1563,16 +1490,19 @@ class GetRunDataRequest(msrest.serialization.Model): """ _attribute_map = { - 'run_id': {'key': 'runId', 'type': 'str'}, - 'select_run_metadata': {'key': 'selectRunMetadata', 'type': 'bool'}, - 'select_run_definition': {'key': 'selectRunDefinition', 'type': 'bool'}, - 'select_job_specification': {'key': 'selectJobSpecification', 'type': 'bool'}, + "run_id": {"key": "runId", "type": "str"}, + "select_run_metadata": {"key": "selectRunMetadata", "type": "bool"}, + "select_run_definition": { + "key": "selectRunDefinition", + "type": "bool", + }, + "select_job_specification": { + "key": "selectJobSpecification", + "type": "bool", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword run_id: :paramtype run_id: str @@ -1584,10 +1514,12 @@ def __init__( :paramtype select_job_specification: bool """ super(GetRunDataRequest, self).__init__(**kwargs) - self.run_id = kwargs.get('run_id', None) - self.select_run_metadata = kwargs.get('select_run_metadata', None) - self.select_run_definition = kwargs.get('select_run_definition', None) - self.select_job_specification = kwargs.get('select_job_specification', None) + self.run_id = kwargs.get("run_id", None) + self.select_run_metadata = kwargs.get("select_run_metadata", None) + self.select_run_definition = kwargs.get("select_run_definition", None) + self.select_job_specification = kwargs.get( + "select_job_specification", None + ) class GetRunDataResult(msrest.serialization.Model): @@ -1602,15 +1534,12 @@ class GetRunDataResult(msrest.serialization.Model): """ _attribute_map = { - 'run_metadata': {'key': 'runMetadata', 'type': 'Run'}, - 'run_definition': {'key': 'runDefinition', 'type': 'object'}, - 'job_specification': {'key': 'jobSpecification', 'type': 'object'}, + "run_metadata": {"key": "runMetadata", "type": "Run"}, + "run_definition": {"key": "runDefinition", "type": "object"}, + "job_specification": {"key": "jobSpecification", "type": "object"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword run_metadata: The definition of a Run. :paramtype run_metadata: ~azure.mgmt.machinelearningservices.models.Run @@ -1620,9 +1549,9 @@ def __init__( :paramtype job_specification: any """ super(GetRunDataResult, self).__init__(**kwargs) - self.run_metadata = kwargs.get('run_metadata', None) - self.run_definition = kwargs.get('run_definition', None) - self.job_specification = kwargs.get('job_specification', None) + self.run_metadata = kwargs.get("run_metadata", None) + self.run_definition = kwargs.get("run_definition", None) + self.job_specification = kwargs.get("job_specification", None) class GetRunsByIds(msrest.serialization.Model): @@ -1633,19 +1562,16 @@ class GetRunsByIds(msrest.serialization.Model): """ _attribute_map = { - 'run_ids': {'key': 'runIds', 'type': '[str]'}, + "run_ids": {"key": "runIds", "type": "[str]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword run_ids: :paramtype run_ids: list[str] """ super(GetRunsByIds, self).__init__(**kwargs) - self.run_ids = kwargs.get('run_ids', None) + self.run_ids = kwargs.get("run_ids", None) class GetSampledMetricRequest(msrest.serialization.Model): @@ -1658,14 +1584,11 @@ class GetSampledMetricRequest(msrest.serialization.Model): """ _attribute_map = { - 'metric_name': {'key': 'metricName', 'type': 'str'}, - 'metric_namespace': {'key': 'metricNamespace', 'type': 'str'}, + "metric_name": {"key": "metricName", "type": "str"}, + "metric_namespace": {"key": "metricNamespace", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword metric_name: :paramtype metric_name: str @@ -1673,8 +1596,8 @@ def __init__( :paramtype metric_namespace: str """ super(GetSampledMetricRequest, self).__init__(**kwargs) - self.metric_name = kwargs.get('metric_name', None) - self.metric_namespace = kwargs.get('metric_namespace', None) + self.metric_name = kwargs.get("metric_name", None) + self.metric_namespace = kwargs.get("metric_namespace", None) class IMetricV2(msrest.serialization.Model): @@ -1697,18 +1620,15 @@ class IMetricV2(msrest.serialization.Model): """ _attribute_map = { - 'data_container_id': {'key': 'dataContainerId', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'columns': {'key': 'columns', 'type': '{str}'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'standard_schema_id': {'key': 'standardSchemaId', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[MetricV2Value]'}, + "data_container_id": {"key": "dataContainerId", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "columns": {"key": "columns", "type": "{str}"}, + "namespace": {"key": "namespace", "type": "str"}, + "standard_schema_id": {"key": "standardSchemaId", "type": "str"}, + "value": {"key": "value", "type": "[MetricV2Value]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data_container_id: Data container to which this Metric belongs. :paramtype data_container_id: str @@ -1727,12 +1647,12 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.MetricV2Value] """ super(IMetricV2, self).__init__(**kwargs) - self.data_container_id = kwargs.get('data_container_id', None) - self.name = kwargs.get('name', None) - self.columns = kwargs.get('columns', None) - self.namespace = kwargs.get('namespace', None) - self.standard_schema_id = kwargs.get('standard_schema_id', None) - self.value = kwargs.get('value', None) + self.data_container_id = kwargs.get("data_container_id", None) + self.name = kwargs.get("name", None) + self.columns = kwargs.get("columns", None) + self.namespace = kwargs.get("namespace", None) + self.standard_schema_id = kwargs.get("standard_schema_id", None) + self.value = kwargs.get("value", None) class InnerErrorResponse(msrest.serialization.Model): @@ -1745,14 +1665,11 @@ class InnerErrorResponse(msrest.serialization.Model): """ _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'inner_error': {'key': 'innerError', 'type': 'InnerErrorResponse'}, + "code": {"key": "code", "type": "str"}, + "inner_error": {"key": "innerError", "type": "InnerErrorResponse"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword code: The error code. :paramtype code: str @@ -1760,8 +1677,8 @@ def __init__( :paramtype inner_error: ~azure.mgmt.machinelearningservices.models.InnerErrorResponse """ super(InnerErrorResponse, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.inner_error = kwargs.get('inner_error', None) + self.code = kwargs.get("code", None) + self.inner_error = kwargs.get("inner_error", None) class JobCost(msrest.serialization.Model): @@ -1778,16 +1695,22 @@ class JobCost(msrest.serialization.Model): """ _attribute_map = { - 'charged_cpu_core_seconds': {'key': 'chargedCpuCoreSeconds', 'type': 'float'}, - 'charged_cpu_memory_megabyte_seconds': {'key': 'chargedCpuMemoryMegabyteSeconds', 'type': 'float'}, - 'charged_gpu_seconds': {'key': 'chargedGpuSeconds', 'type': 'float'}, - 'charged_node_utilization_seconds': {'key': 'chargedNodeUtilizationSeconds', 'type': 'float'}, + "charged_cpu_core_seconds": { + "key": "chargedCpuCoreSeconds", + "type": "float", + }, + "charged_cpu_memory_megabyte_seconds": { + "key": "chargedCpuMemoryMegabyteSeconds", + "type": "float", + }, + "charged_gpu_seconds": {"key": "chargedGpuSeconds", "type": "float"}, + "charged_node_utilization_seconds": { + "key": "chargedNodeUtilizationSeconds", + "type": "float", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword charged_cpu_core_seconds: :paramtype charged_cpu_core_seconds: float @@ -1799,10 +1722,16 @@ def __init__( :paramtype charged_node_utilization_seconds: float """ super(JobCost, self).__init__(**kwargs) - self.charged_cpu_core_seconds = kwargs.get('charged_cpu_core_seconds', None) - self.charged_cpu_memory_megabyte_seconds = kwargs.get('charged_cpu_memory_megabyte_seconds', None) - self.charged_gpu_seconds = kwargs.get('charged_gpu_seconds', None) - self.charged_node_utilization_seconds = kwargs.get('charged_node_utilization_seconds', None) + self.charged_cpu_core_seconds = kwargs.get( + "charged_cpu_core_seconds", None + ) + self.charged_cpu_memory_megabyte_seconds = kwargs.get( + "charged_cpu_memory_megabyte_seconds", None + ) + self.charged_gpu_seconds = kwargs.get("charged_gpu_seconds", None) + self.charged_node_utilization_seconds = kwargs.get( + "charged_node_utilization_seconds", None + ) class KeyValuePairBaseEventErrorResponse(msrest.serialization.Model): @@ -1815,14 +1744,11 @@ class KeyValuePairBaseEventErrorResponse(msrest.serialization.Model): """ _attribute_map = { - 'key': {'key': 'key', 'type': 'BaseEvent'}, - 'value': {'key': 'value', 'type': 'ErrorResponse'}, + "key": {"key": "key", "type": "BaseEvent"}, + "value": {"key": "value", "type": "ErrorResponse"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword key: Base event is the envelope used to post event data to the Event controller. :paramtype key: ~azure.mgmt.machinelearningservices.models.BaseEvent @@ -1830,8 +1756,8 @@ def __init__( :paramtype value: ~azure.mgmt.machinelearningservices.models.ErrorResponse """ super(KeyValuePairBaseEventErrorResponse, self).__init__(**kwargs) - self.key = kwargs.get('key', None) - self.value = kwargs.get('value', None) + self.key = kwargs.get("key", None) + self.value = kwargs.get("value", None) class KeyValuePairString(msrest.serialization.Model): @@ -1844,14 +1770,11 @@ class KeyValuePairString(msrest.serialization.Model): """ _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "key": {"key": "key", "type": "str"}, + "value": {"key": "value", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword key: :paramtype key: str @@ -1859,8 +1782,8 @@ def __init__( :paramtype value: str """ super(KeyValuePairString, self).__init__(**kwargs) - self.key = kwargs.get('key', None) - self.value = kwargs.get('value', None) + self.key = kwargs.get("key", None) + self.value = kwargs.get("value", None) class KeyValuePairStringJToken(msrest.serialization.Model): @@ -1873,14 +1796,11 @@ class KeyValuePairStringJToken(msrest.serialization.Model): """ _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'object'}, + "key": {"key": "key", "type": "str"}, + "value": {"key": "value", "type": "object"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword key: :paramtype key: str @@ -1888,8 +1808,8 @@ def __init__( :paramtype value: any """ super(KeyValuePairStringJToken, self).__init__(**kwargs) - self.key = kwargs.get('key', None) - self.value = kwargs.get('value', None) + self.key = kwargs.get("key", None) + self.value = kwargs.get("value", None) class Link(msrest.serialization.Model): @@ -1902,14 +1822,11 @@ class Link(msrest.serialization.Model): """ _attribute_map = { - 'context': {'key': 'context', 'type': 'SpanContext'}, - 'attributes': {'key': 'attributes', 'type': '{object}'}, + "context": {"key": "context", "type": "SpanContext"}, + "attributes": {"key": "attributes", "type": "{object}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword context: :paramtype context: ~azure.mgmt.machinelearningservices.models.SpanContext @@ -1917,8 +1834,8 @@ def __init__( :paramtype attributes: dict[str, any] """ super(Link, self).__init__(**kwargs) - self.context = kwargs.get('context', None) - self.attributes = kwargs.get('attributes', None) + self.context = kwargs.get("context", None) + self.attributes = kwargs.get("attributes", None) class ListGenericResourceMetrics(msrest.serialization.Model): @@ -1937,17 +1854,14 @@ class ListGenericResourceMetrics(msrest.serialization.Model): """ _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'metric_names': {'key': 'metricNames', 'type': '[str]'}, - 'label_filters': {'key': 'labelFilters', 'type': '{str}'}, - 'metric_namespace': {'key': 'metricNamespace', 'type': 'str'}, - 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, + "resource_id": {"key": "resourceId", "type": "str"}, + "metric_names": {"key": "metricNames", "type": "[str]"}, + "label_filters": {"key": "labelFilters", "type": "{str}"}, + "metric_namespace": {"key": "metricNamespace", "type": "str"}, + "continuation_token": {"key": "continuationToken", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword resource_id: :paramtype resource_id: str @@ -1961,11 +1875,11 @@ def __init__( :paramtype continuation_token: str """ super(ListGenericResourceMetrics, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.metric_names = kwargs.get('metric_names', None) - self.label_filters = kwargs.get('label_filters', None) - self.metric_namespace = kwargs.get('metric_namespace', None) - self.continuation_token = kwargs.get('continuation_token', None) + self.resource_id = kwargs.get("resource_id", None) + self.metric_names = kwargs.get("metric_names", None) + self.label_filters = kwargs.get("label_filters", None) + self.metric_namespace = kwargs.get("metric_namespace", None) + self.continuation_token = kwargs.get("continuation_token", None) class ListMetrics(msrest.serialization.Model): @@ -1978,14 +1892,11 @@ class ListMetrics(msrest.serialization.Model): """ _attribute_map = { - 'metric_namespace': {'key': 'metricNamespace', 'type': 'str'}, - 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, + "metric_namespace": {"key": "metricNamespace", "type": "str"}, + "continuation_token": {"key": "continuationToken", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword metric_namespace: :paramtype metric_namespace: str @@ -1993,8 +1904,8 @@ def __init__( :paramtype continuation_token: str """ super(ListMetrics, self).__init__(**kwargs) - self.metric_namespace = kwargs.get('metric_namespace', None) - self.continuation_token = kwargs.get('continuation_token', None) + self.metric_namespace = kwargs.get("metric_namespace", None) + self.continuation_token = kwargs.get("continuation_token", None) class MetricDefinition(msrest.serialization.Model): @@ -2009,15 +1920,12 @@ class MetricDefinition(msrest.serialization.Model): """ _attribute_map = { - 'metric_key': {'key': 'metricKey', 'type': 'DerivedMetricKey'}, - 'columns': {'key': 'columns', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': 'MetricProperties'}, + "metric_key": {"key": "metricKey", "type": "DerivedMetricKey"}, + "columns": {"key": "columns", "type": "{str}"}, + "properties": {"key": "properties", "type": "MetricProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword metric_key: :paramtype metric_key: ~azure.mgmt.machinelearningservices.models.DerivedMetricKey @@ -2028,9 +1936,9 @@ def __init__( :paramtype properties: ~azure.mgmt.machinelearningservices.models.MetricProperties """ super(MetricDefinition, self).__init__(**kwargs) - self.metric_key = kwargs.get('metric_key', None) - self.columns = kwargs.get('columns', None) - self.properties = kwargs.get('properties', None) + self.metric_key = kwargs.get("metric_key", None) + self.columns = kwargs.get("columns", None) + self.properties = kwargs.get("properties", None) class MetricProperties(msrest.serialization.Model): @@ -2042,20 +1950,17 @@ class MetricProperties(msrest.serialization.Model): """ _attribute_map = { - 'ux_metric_type': {'key': 'uxMetricType', 'type': 'str'}, + "ux_metric_type": {"key": "uxMetricType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword ux_metric_type: String value UX uses to decide how to render your metrics Ex: azureml.v1.scalar or azureml.v1.table. :paramtype ux_metric_type: str """ super(MetricProperties, self).__init__(**kwargs) - self.ux_metric_type = kwargs.get('ux_metric_type', None) + self.ux_metric_type = kwargs.get("ux_metric_type", None) class MetricSample(msrest.serialization.Model): @@ -2092,24 +1997,21 @@ class MetricSample(msrest.serialization.Model): """ _attribute_map = { - 'derived_label_values': {'key': 'derivedLabelValues', 'type': '{str}'}, - 'is_partial_result': {'key': 'isPartialResult', 'type': 'bool'}, - 'num_values_logged': {'key': 'numValuesLogged', 'type': 'long'}, - 'data_container_id': {'key': 'dataContainerId', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'columns': {'key': 'columns', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': 'MetricProperties'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'standard_schema_id': {'key': 'standardSchemaId', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[MetricV2Value]'}, - 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "derived_label_values": {"key": "derivedLabelValues", "type": "{str}"}, + "is_partial_result": {"key": "isPartialResult", "type": "bool"}, + "num_values_logged": {"key": "numValuesLogged", "type": "long"}, + "data_container_id": {"key": "dataContainerId", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "columns": {"key": "columns", "type": "{str}"}, + "properties": {"key": "properties", "type": "MetricProperties"}, + "namespace": {"key": "namespace", "type": "str"}, + "standard_schema_id": {"key": "standardSchemaId", "type": "str"}, + "value": {"key": "value", "type": "[MetricV2Value]"}, + "continuation_token": {"key": "continuationToken", "type": "str"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword derived_label_values: Dictionary of :code:``. :paramtype derived_label_values: dict[str, str] @@ -2142,18 +2044,18 @@ def __init__( :paramtype next_link: str """ super(MetricSample, self).__init__(**kwargs) - self.derived_label_values = kwargs.get('derived_label_values', None) - self.is_partial_result = kwargs.get('is_partial_result', None) - self.num_values_logged = kwargs.get('num_values_logged', None) - self.data_container_id = kwargs.get('data_container_id', None) - self.name = kwargs.get('name', None) - self.columns = kwargs.get('columns', None) - self.properties = kwargs.get('properties', None) - self.namespace = kwargs.get('namespace', None) - self.standard_schema_id = kwargs.get('standard_schema_id', None) - self.value = kwargs.get('value', None) - self.continuation_token = kwargs.get('continuation_token', None) - self.next_link = kwargs.get('next_link', None) + self.derived_label_values = kwargs.get("derived_label_values", None) + self.is_partial_result = kwargs.get("is_partial_result", None) + self.num_values_logged = kwargs.get("num_values_logged", None) + self.data_container_id = kwargs.get("data_container_id", None) + self.name = kwargs.get("name", None) + self.columns = kwargs.get("columns", None) + self.properties = kwargs.get("properties", None) + self.namespace = kwargs.get("namespace", None) + self.standard_schema_id = kwargs.get("standard_schema_id", None) + self.value = kwargs.get("value", None) + self.continuation_token = kwargs.get("continuation_token", None) + self.next_link = kwargs.get("next_link", None) class MetricSchema(msrest.serialization.Model): @@ -2166,14 +2068,11 @@ class MetricSchema(msrest.serialization.Model): """ _attribute_map = { - 'num_properties': {'key': 'numProperties', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '[MetricSchemaProperty]'}, + "num_properties": {"key": "numProperties", "type": "int"}, + "properties": {"key": "properties", "type": "[MetricSchemaProperty]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword num_properties: :paramtype num_properties: int @@ -2181,8 +2080,8 @@ def __init__( :paramtype properties: list[~azure.mgmt.machinelearningservices.models.MetricSchemaProperty] """ super(MetricSchema, self).__init__(**kwargs) - self.num_properties = kwargs.get('num_properties', None) - self.properties = kwargs.get('properties', None) + self.num_properties = kwargs.get("num_properties", None) + self.properties = kwargs.get("properties", None) class MetricSchemaProperty(msrest.serialization.Model): @@ -2197,15 +2096,12 @@ class MetricSchemaProperty(msrest.serialization.Model): """ _attribute_map = { - 'property_id': {'key': 'propertyId', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + "property_id": {"key": "propertyId", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword property_id: :paramtype property_id: str @@ -2215,9 +2111,9 @@ def __init__( :paramtype type: str """ super(MetricSchemaProperty, self).__init__(**kwargs) - self.property_id = kwargs.get('property_id', None) - self.name = kwargs.get('name', None) - self.type = kwargs.get('type', None) + self.property_id = kwargs.get("property_id", None) + self.name = kwargs.get("name", None) + self.type = kwargs.get("type", None) class MetricV2(msrest.serialization.Model): @@ -2248,21 +2144,18 @@ class MetricV2(msrest.serialization.Model): """ _attribute_map = { - 'data_container_id': {'key': 'dataContainerId', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'columns': {'key': 'columns', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': 'MetricProperties'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'standard_schema_id': {'key': 'standardSchemaId', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[MetricV2Value]'}, - 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "data_container_id": {"key": "dataContainerId", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "columns": {"key": "columns", "type": "{str}"}, + "properties": {"key": "properties", "type": "MetricProperties"}, + "namespace": {"key": "namespace", "type": "str"}, + "standard_schema_id": {"key": "standardSchemaId", "type": "str"}, + "value": {"key": "value", "type": "[MetricV2Value]"}, + "continuation_token": {"key": "continuationToken", "type": "str"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data_container_id: Data container to which this Metric belongs. :paramtype data_container_id: str @@ -2289,15 +2182,15 @@ def __init__( :paramtype next_link: str """ super(MetricV2, self).__init__(**kwargs) - self.data_container_id = kwargs.get('data_container_id', None) - self.name = kwargs.get('name', None) - self.columns = kwargs.get('columns', None) - self.properties = kwargs.get('properties', None) - self.namespace = kwargs.get('namespace', None) - self.standard_schema_id = kwargs.get('standard_schema_id', None) - self.value = kwargs.get('value', None) - self.continuation_token = kwargs.get('continuation_token', None) - self.next_link = kwargs.get('next_link', None) + self.data_container_id = kwargs.get("data_container_id", None) + self.name = kwargs.get("name", None) + self.columns = kwargs.get("columns", None) + self.properties = kwargs.get("properties", None) + self.namespace = kwargs.get("namespace", None) + self.standard_schema_id = kwargs.get("standard_schema_id", None) + self.value = kwargs.get("value", None) + self.continuation_token = kwargs.get("continuation_token", None) + self.next_link = kwargs.get("next_link", None) class MetricV2Value(msrest.serialization.Model): @@ -2319,16 +2212,13 @@ class MetricV2Value(msrest.serialization.Model): """ _attribute_map = { - 'metric_id': {'key': 'metricId', 'type': 'str'}, - 'created_utc': {'key': 'createdUtc', 'type': 'iso-8601'}, - 'step': {'key': 'step', 'type': 'long'}, - 'data': {'key': 'data', 'type': '{object}'}, + "metric_id": {"key": "metricId", "type": "str"}, + "created_utc": {"key": "createdUtc", "type": "iso-8601"}, + "step": {"key": "step", "type": "long"}, + "data": {"key": "data", "type": "{object}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword metric_id: Unique Id for this metric value Format is either a Guid or a Guid augmented with an additional int index for cases where @@ -2345,10 +2235,10 @@ def __init__( :paramtype data: dict[str, any] """ super(MetricV2Value, self).__init__(**kwargs) - self.metric_id = kwargs.get('metric_id', None) - self.created_utc = kwargs.get('created_utc', None) - self.step = kwargs.get('step', None) - self.data = kwargs.get('data', None) + self.metric_id = kwargs.get("metric_id", None) + self.created_utc = kwargs.get("created_utc", None) + self.step = kwargs.get("step", None) + self.data = kwargs.get("data", None) class ModifyExperiment(msrest.serialization.Model): @@ -2367,17 +2257,17 @@ class ModifyExperiment(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'archive': {'key': 'archive', 'type': 'bool'}, - 'retain_for_lifetime_of_workspace': {'key': 'retainForLifetimeOfWorkspace', 'type': 'bool'}, + "name": {"key": "name", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "archive": {"key": "archive", "type": "bool"}, + "retain_for_lifetime_of_workspace": { + "key": "retainForLifetimeOfWorkspace", + "type": "bool", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: :paramtype name: str @@ -2391,11 +2281,13 @@ def __init__( :paramtype retain_for_lifetime_of_workspace: bool """ super(ModifyExperiment, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.description = kwargs.get('description', None) - self.tags = kwargs.get('tags', None) - self.archive = kwargs.get('archive', None) - self.retain_for_lifetime_of_workspace = kwargs.get('retain_for_lifetime_of_workspace', None) + self.name = kwargs.get("name", None) + self.description = kwargs.get("description", None) + self.tags = kwargs.get("tags", None) + self.archive = kwargs.get("archive", None) + self.retain_for_lifetime_of_workspace = kwargs.get( + "retain_for_lifetime_of_workspace", None + ) class OutputDatasetLineage(msrest.serialization.Model): @@ -2410,15 +2302,15 @@ class OutputDatasetLineage(msrest.serialization.Model): """ _attribute_map = { - 'identifier': {'key': 'identifier', 'type': 'DatasetIdentifier'}, - 'output_type': {'key': 'outputType', 'type': 'str'}, - 'output_details': {'key': 'outputDetails', 'type': 'DatasetOutputDetails'}, + "identifier": {"key": "identifier", "type": "DatasetIdentifier"}, + "output_type": {"key": "outputType", "type": "str"}, + "output_details": { + "key": "outputDetails", + "type": "DatasetOutputDetails", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword identifier: :paramtype identifier: ~azure.mgmt.machinelearningservices.models.DatasetIdentifier @@ -2428,9 +2320,9 @@ def __init__( :paramtype output_details: ~azure.mgmt.machinelearningservices.models.DatasetOutputDetails """ super(OutputDatasetLineage, self).__init__(**kwargs) - self.identifier = kwargs.get('identifier', None) - self.output_type = kwargs.get('output_type', None) - self.output_details = kwargs.get('output_details', None) + self.identifier = kwargs.get("identifier", None) + self.output_type = kwargs.get("output_type", None) + self.output_details = kwargs.get("output_details", None) class PaginatedArtifactContentInformationList(msrest.serialization.Model): @@ -2447,15 +2339,12 @@ class PaginatedArtifactContentInformationList(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[ArtifactContentInformation]'}, - 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[ArtifactContentInformation]"}, + "continuation_token": {"key": "continuationToken", "type": "str"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: An array of objects of type ArtifactContentInformation. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ArtifactContentInformation] @@ -2467,9 +2356,9 @@ def __init__( :paramtype next_link: str """ super(PaginatedArtifactContentInformationList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.continuation_token = kwargs.get('continuation_token', None) - self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get("value", None) + self.continuation_token = kwargs.get("continuation_token", None) + self.next_link = kwargs.get("next_link", None) class PaginatedArtifactList(msrest.serialization.Model): @@ -2486,15 +2375,12 @@ class PaginatedArtifactList(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[Artifact]'}, - 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Artifact]"}, + "continuation_token": {"key": "continuationToken", "type": "str"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: An array of objects of type Artifact. :paramtype value: list[~azure.mgmt.machinelearningservices.models.Artifact] @@ -2506,9 +2392,9 @@ def __init__( :paramtype next_link: str """ super(PaginatedArtifactList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.continuation_token = kwargs.get('continuation_token', None) - self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get("value", None) + self.continuation_token = kwargs.get("continuation_token", None) + self.next_link = kwargs.get("next_link", None) class PaginatedExperimentList(msrest.serialization.Model): @@ -2525,15 +2411,12 @@ class PaginatedExperimentList(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[Experiment]'}, - 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Experiment]"}, + "continuation_token": {"key": "continuationToken", "type": "str"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: An array of objects of type Experiment. :paramtype value: list[~azure.mgmt.machinelearningservices.models.Experiment] @@ -2545,9 +2428,9 @@ def __init__( :paramtype next_link: str """ super(PaginatedExperimentList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.continuation_token = kwargs.get('continuation_token', None) - self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get("value", None) + self.continuation_token = kwargs.get("continuation_token", None) + self.next_link = kwargs.get("next_link", None) class PaginatedMetricDefinitionList(msrest.serialization.Model): @@ -2564,15 +2447,12 @@ class PaginatedMetricDefinitionList(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[MetricDefinition]'}, - 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[MetricDefinition]"}, + "continuation_token": {"key": "continuationToken", "type": "str"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: An array of objects of type MetricDefinition. :paramtype value: list[~azure.mgmt.machinelearningservices.models.MetricDefinition] @@ -2584,9 +2464,9 @@ def __init__( :paramtype next_link: str """ super(PaginatedMetricDefinitionList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.continuation_token = kwargs.get('continuation_token', None) - self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get("value", None) + self.continuation_token = kwargs.get("continuation_token", None) + self.next_link = kwargs.get("next_link", None) class PaginatedRunList(msrest.serialization.Model): @@ -2603,15 +2483,12 @@ class PaginatedRunList(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[Run]'}, - 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Run]"}, + "continuation_token": {"key": "continuationToken", "type": "str"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: An array of objects of type Run. :paramtype value: list[~azure.mgmt.machinelearningservices.models.Run] @@ -2623,9 +2500,9 @@ def __init__( :paramtype next_link: str """ super(PaginatedRunList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.continuation_token = kwargs.get('continuation_token', None) - self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get("value", None) + self.continuation_token = kwargs.get("continuation_token", None) + self.next_link = kwargs.get("next_link", None) class PaginatedSpanDefinition1List(msrest.serialization.Model): @@ -2642,15 +2519,12 @@ class PaginatedSpanDefinition1List(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[SpanDefinition1]'}, - 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[SpanDefinition1]"}, + "continuation_token": {"key": "continuationToken", "type": "str"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: An array of objects of type SpanDefinition`1. :paramtype value: list[~azure.mgmt.machinelearningservices.models.SpanDefinition1] @@ -2662,9 +2536,9 @@ def __init__( :paramtype next_link: str """ super(PaginatedSpanDefinition1List, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.continuation_token = kwargs.get('continuation_token', None) - self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get("value", None) + self.continuation_token = kwargs.get("continuation_token", None) + self.next_link = kwargs.get("next_link", None) class PostRunMetricsError(msrest.serialization.Model): @@ -2678,14 +2552,11 @@ class PostRunMetricsError(msrest.serialization.Model): """ _attribute_map = { - 'metric': {'key': 'metric', 'type': 'IMetricV2'}, - 'error_response': {'key': 'errorResponse', 'type': 'ErrorResponse'}, + "metric": {"key": "metric", "type": "IMetricV2"}, + "error_response": {"key": "errorResponse", "type": "ErrorResponse"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword metric: Sequence of one or many values sharing a common DataContainerId, Name, and Schema. Used only for Post Metrics. @@ -2694,8 +2565,8 @@ def __init__( :paramtype error_response: ~azure.mgmt.machinelearningservices.models.ErrorResponse """ super(PostRunMetricsError, self).__init__(**kwargs) - self.metric = kwargs.get('metric', None) - self.error_response = kwargs.get('error_response', None) + self.metric = kwargs.get("metric", None) + self.error_response = kwargs.get("error_response", None) class PostRunMetricsResult(msrest.serialization.Model): @@ -2706,19 +2577,16 @@ class PostRunMetricsResult(msrest.serialization.Model): """ _attribute_map = { - 'errors': {'key': 'errors', 'type': '[PostRunMetricsError]'}, + "errors": {"key": "errors", "type": "[PostRunMetricsError]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword errors: :paramtype errors: list[~azure.mgmt.machinelearningservices.models.PostRunMetricsError] """ super(PostRunMetricsResult, self).__init__(**kwargs) - self.errors = kwargs.get('errors', None) + self.errors = kwargs.get("errors", None) class QueryParams(msrest.serialization.Model): @@ -2742,16 +2610,13 @@ class QueryParams(msrest.serialization.Model): """ _attribute_map = { - 'filter': {'key': 'filter', 'type': 'str'}, - 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, - 'order_by': {'key': 'orderBy', 'type': 'str'}, - 'top': {'key': 'top', 'type': 'int'}, + "filter": {"key": "filter", "type": "str"}, + "continuation_token": {"key": "continuationToken", "type": "str"}, + "order_by": {"key": "orderBy", "type": "str"}, + "top": {"key": "top", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword filter: Allows for filtering the collection of resources. The expression specified is evaluated for each resource in the collection, and only items @@ -2772,10 +2637,10 @@ def __init__( :paramtype top: int """ super(QueryParams, self).__init__(**kwargs) - self.filter = kwargs.get('filter', None) - self.continuation_token = kwargs.get('continuation_token', None) - self.order_by = kwargs.get('order_by', None) - self.top = kwargs.get('top', None) + self.filter = kwargs.get("filter", None) + self.continuation_token = kwargs.get("continuation_token", None) + self.order_by = kwargs.get("order_by", None) + self.top = kwargs.get("top", None) class QueueingInfo(msrest.serialization.Model): @@ -2790,15 +2655,15 @@ class QueueingInfo(msrest.serialization.Model): """ _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'last_refresh_timestamp': {'key': 'lastRefreshTimestamp', 'type': 'iso-8601'}, + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "last_refresh_timestamp": { + "key": "lastRefreshTimestamp", + "type": "iso-8601", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword code: :paramtype code: str @@ -2808,9 +2673,11 @@ def __init__( :paramtype last_refresh_timestamp: ~datetime.datetime """ super(QueueingInfo, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - self.last_refresh_timestamp = kwargs.get('last_refresh_timestamp', None) + self.code = kwargs.get("code", None) + self.message = kwargs.get("message", None) + self.last_refresh_timestamp = kwargs.get( + "last_refresh_timestamp", None + ) class RetrieveFullFidelityMetricRequest(msrest.serialization.Model): @@ -2829,17 +2696,14 @@ class RetrieveFullFidelityMetricRequest(msrest.serialization.Model): """ _attribute_map = { - 'metric_name': {'key': 'metricName', 'type': 'str'}, - 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'metric_namespace': {'key': 'metricNamespace', 'type': 'str'}, + "metric_name": {"key": "metricName", "type": "str"}, + "continuation_token": {"key": "continuationToken", "type": "str"}, + "start_time": {"key": "startTime", "type": "iso-8601"}, + "end_time": {"key": "endTime", "type": "iso-8601"}, + "metric_namespace": {"key": "metricNamespace", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword metric_name: :paramtype metric_name: str @@ -2853,11 +2717,11 @@ def __init__( :paramtype metric_namespace: str """ super(RetrieveFullFidelityMetricRequest, self).__init__(**kwargs) - self.metric_name = kwargs.get('metric_name', None) - self.continuation_token = kwargs.get('continuation_token', None) - self.start_time = kwargs.get('start_time', None) - self.end_time = kwargs.get('end_time', None) - self.metric_namespace = kwargs.get('metric_namespace', None) + self.metric_name = kwargs.get("metric_name", None) + self.continuation_token = kwargs.get("continuation_token", None) + self.start_time = kwargs.get("start_time", None) + self.end_time = kwargs.get("end_time", None) + self.metric_namespace = kwargs.get("metric_namespace", None) class RootError(msrest.serialization.Model): @@ -2891,23 +2755,23 @@ class RootError(msrest.serialization.Model): """ _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'severity': {'key': 'severity', 'type': 'int'}, - 'message': {'key': 'message', 'type': 'str'}, - 'message_format': {'key': 'messageFormat', 'type': 'str'}, - 'message_parameters': {'key': 'messageParameters', 'type': '{str}'}, - 'reference_code': {'key': 'referenceCode', 'type': 'str'}, - 'details_uri': {'key': 'detailsUri', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[RootError]'}, - 'inner_error': {'key': 'innerError', 'type': 'InnerErrorResponse'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + "code": {"key": "code", "type": "str"}, + "severity": {"key": "severity", "type": "int"}, + "message": {"key": "message", "type": "str"}, + "message_format": {"key": "messageFormat", "type": "str"}, + "message_parameters": {"key": "messageParameters", "type": "{str}"}, + "reference_code": {"key": "referenceCode", "type": "str"}, + "details_uri": {"key": "detailsUri", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[RootError]"}, + "inner_error": {"key": "innerError", "type": "InnerErrorResponse"}, + "additional_info": { + "key": "additionalInfo", + "type": "[ErrorAdditionalInfo]", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword code: The service-defined error code. Supported error codes: ServiceError, UserError, ValidationError, AzureStorageError, TransientError, RequestThrottled. @@ -2938,17 +2802,17 @@ def __init__( list[~azure.mgmt.machinelearningservices.models.ErrorAdditionalInfo] """ super(RootError, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.severity = kwargs.get('severity', None) - self.message = kwargs.get('message', None) - self.message_format = kwargs.get('message_format', None) - self.message_parameters = kwargs.get('message_parameters', None) - self.reference_code = kwargs.get('reference_code', None) - self.details_uri = kwargs.get('details_uri', None) - self.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - self.inner_error = kwargs.get('inner_error', None) - self.additional_info = kwargs.get('additional_info', None) + self.code = kwargs.get("code", None) + self.severity = kwargs.get("severity", None) + self.message = kwargs.get("message", None) + self.message_format = kwargs.get("message_format", None) + self.message_parameters = kwargs.get("message_parameters", None) + self.reference_code = kwargs.get("reference_code", None) + self.details_uri = kwargs.get("details_uri", None) + self.target = kwargs.get("target", None) + self.details = kwargs.get("details", None) + self.inner_error = kwargs.get("inner_error", None) + self.additional_info = kwargs.get("additional_info", None) class Run(msrest.serialization.Model): @@ -3088,81 +2952,93 @@ class Run(msrest.serialization.Model): """ _validation = { - 'unique_child_run_compute_targets': {'unique': True}, - 'input_datasets': {'unique': True}, - 'output_datasets': {'unique': True}, + "unique_child_run_compute_targets": {"unique": True}, + "input_datasets": {"unique": True}, + "output_datasets": {"unique": True}, } _attribute_map = { - 'run_number': {'key': 'runNumber', 'type': 'int'}, - 'root_run_id': {'key': 'rootRunId', 'type': 'str'}, - 'created_utc': {'key': 'createdUtc', 'type': 'iso-8601'}, - 'created_by': {'key': 'createdBy', 'type': 'User'}, - 'user_id': {'key': 'userId', 'type': 'str'}, - 'token': {'key': 'token', 'type': 'str'}, - 'token_expiry_time_utc': {'key': 'tokenExpiryTimeUtc', 'type': 'iso-8601'}, - 'error': {'key': 'error', 'type': 'ErrorResponse'}, - 'warnings': {'key': 'warnings', 'type': '[RunDetailsWarning]'}, - 'revision': {'key': 'revision', 'type': 'long'}, - 'status_revision': {'key': 'statusRevision', 'type': 'long'}, - 'run_uuid': {'key': 'runUuid', 'type': 'str'}, - 'parent_run_uuid': {'key': 'parentRunUuid', 'type': 'str'}, - 'root_run_uuid': {'key': 'rootRunUuid', 'type': 'str'}, - 'has_virtual_parent': {'key': 'hasVirtualParent', 'type': 'bool'}, - 'last_start_time_utc': {'key': 'lastStartTimeUtc', 'type': 'iso-8601'}, - 'current_compute_time': {'key': 'currentComputeTime', 'type': 'str'}, - 'compute_duration': {'key': 'computeDuration', 'type': 'str'}, - 'effective_start_time_utc': {'key': 'effectiveStartTimeUtc', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'User'}, - 'last_modified_utc': {'key': 'lastModifiedUtc', 'type': 'iso-8601'}, - 'duration': {'key': 'duration', 'type': 'str'}, - 'cancelation_reason': {'key': 'cancelationReason', 'type': 'str'}, - 'run_id': {'key': 'runId', 'type': 'str'}, - 'parent_run_id': {'key': 'parentRunId', 'type': 'str'}, - 'experiment_id': {'key': 'experimentId', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'start_time_utc': {'key': 'startTimeUtc', 'type': 'iso-8601'}, - 'end_time_utc': {'key': 'endTimeUtc', 'type': 'iso-8601'}, - 'options': {'key': 'options', 'type': 'RunOptions'}, - 'is_virtual': {'key': 'isVirtual', 'type': 'bool'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'data_container_id': {'key': 'dataContainerId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'hidden': {'key': 'hidden', 'type': 'bool'}, - 'run_type': {'key': 'runType', 'type': 'str'}, - 'run_type_v2': {'key': 'runTypeV2', 'type': 'RunTypeV2'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'parameters': {'key': 'parameters', 'type': '{object}'}, - 'action_uris': {'key': 'actionUris', 'type': '{str}'}, - 'script_name': {'key': 'scriptName', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'unique_child_run_compute_targets': {'key': 'uniqueChildRunComputeTargets', 'type': '[str]'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'settings': {'key': 'settings', 'type': '{str}'}, - 'services': {'key': 'services', 'type': '{EndpointSetting}'}, - 'input_datasets': {'key': 'inputDatasets', 'type': '[DatasetLineage]'}, - 'output_datasets': {'key': 'outputDatasets', 'type': '[OutputDatasetLineage]'}, - 'run_definition': {'key': 'runDefinition', 'type': 'object'}, - 'job_specification': {'key': 'jobSpecification', 'type': 'object'}, - 'primary_metric_name': {'key': 'primaryMetricName', 'type': 'str'}, - 'created_from': {'key': 'createdFrom', 'type': 'CreatedFrom'}, - 'cancel_uri': {'key': 'cancelUri', 'type': 'str'}, - 'complete_uri': {'key': 'completeUri', 'type': 'str'}, - 'diagnostics_uri': {'key': 'diagnosticsUri', 'type': 'str'}, - 'compute_request': {'key': 'computeRequest', 'type': 'ComputeRequest'}, - 'compute': {'key': 'compute', 'type': 'Compute'}, - 'retain_for_lifetime_of_workspace': {'key': 'retainForLifetimeOfWorkspace', 'type': 'bool'}, - 'queueing_info': {'key': 'queueingInfo', 'type': 'QueueingInfo'}, - 'active_child_run_id': {'key': 'activeChildRunId', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '{TypedAssetReference}'}, - 'outputs': {'key': 'outputs', 'type': '{TypedAssetReference}'}, + "run_number": {"key": "runNumber", "type": "int"}, + "root_run_id": {"key": "rootRunId", "type": "str"}, + "created_utc": {"key": "createdUtc", "type": "iso-8601"}, + "created_by": {"key": "createdBy", "type": "User"}, + "user_id": {"key": "userId", "type": "str"}, + "token": {"key": "token", "type": "str"}, + "token_expiry_time_utc": { + "key": "tokenExpiryTimeUtc", + "type": "iso-8601", + }, + "error": {"key": "error", "type": "ErrorResponse"}, + "warnings": {"key": "warnings", "type": "[RunDetailsWarning]"}, + "revision": {"key": "revision", "type": "long"}, + "status_revision": {"key": "statusRevision", "type": "long"}, + "run_uuid": {"key": "runUuid", "type": "str"}, + "parent_run_uuid": {"key": "parentRunUuid", "type": "str"}, + "root_run_uuid": {"key": "rootRunUuid", "type": "str"}, + "has_virtual_parent": {"key": "hasVirtualParent", "type": "bool"}, + "last_start_time_utc": {"key": "lastStartTimeUtc", "type": "iso-8601"}, + "current_compute_time": {"key": "currentComputeTime", "type": "str"}, + "compute_duration": {"key": "computeDuration", "type": "str"}, + "effective_start_time_utc": { + "key": "effectiveStartTimeUtc", + "type": "iso-8601", + }, + "last_modified_by": {"key": "lastModifiedBy", "type": "User"}, + "last_modified_utc": {"key": "lastModifiedUtc", "type": "iso-8601"}, + "duration": {"key": "duration", "type": "str"}, + "cancelation_reason": {"key": "cancelationReason", "type": "str"}, + "run_id": {"key": "runId", "type": "str"}, + "parent_run_id": {"key": "parentRunId", "type": "str"}, + "experiment_id": {"key": "experimentId", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "start_time_utc": {"key": "startTimeUtc", "type": "iso-8601"}, + "end_time_utc": {"key": "endTimeUtc", "type": "iso-8601"}, + "options": {"key": "options", "type": "RunOptions"}, + "is_virtual": {"key": "isVirtual", "type": "bool"}, + "display_name": {"key": "displayName", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "data_container_id": {"key": "dataContainerId", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "hidden": {"key": "hidden", "type": "bool"}, + "run_type": {"key": "runType", "type": "str"}, + "run_type_v2": {"key": "runTypeV2", "type": "RunTypeV2"}, + "properties": {"key": "properties", "type": "{str}"}, + "parameters": {"key": "parameters", "type": "{object}"}, + "action_uris": {"key": "actionUris", "type": "{str}"}, + "script_name": {"key": "scriptName", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "unique_child_run_compute_targets": { + "key": "uniqueChildRunComputeTargets", + "type": "[str]", + }, + "tags": {"key": "tags", "type": "{str}"}, + "settings": {"key": "settings", "type": "{str}"}, + "services": {"key": "services", "type": "{EndpointSetting}"}, + "input_datasets": {"key": "inputDatasets", "type": "[DatasetLineage]"}, + "output_datasets": { + "key": "outputDatasets", + "type": "[OutputDatasetLineage]", + }, + "run_definition": {"key": "runDefinition", "type": "object"}, + "job_specification": {"key": "jobSpecification", "type": "object"}, + "primary_metric_name": {"key": "primaryMetricName", "type": "str"}, + "created_from": {"key": "createdFrom", "type": "CreatedFrom"}, + "cancel_uri": {"key": "cancelUri", "type": "str"}, + "complete_uri": {"key": "completeUri", "type": "str"}, + "diagnostics_uri": {"key": "diagnosticsUri", "type": "str"}, + "compute_request": {"key": "computeRequest", "type": "ComputeRequest"}, + "compute": {"key": "compute", "type": "Compute"}, + "retain_for_lifetime_of_workspace": { + "key": "retainForLifetimeOfWorkspace", + "type": "bool", + }, + "queueing_info": {"key": "queueingInfo", "type": "QueueingInfo"}, + "active_child_run_id": {"key": "activeChildRunId", "type": "str"}, + "inputs": {"key": "inputs", "type": "{TypedAssetReference}"}, + "outputs": {"key": "outputs", "type": "{TypedAssetReference}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword run_number: :paramtype run_number: int @@ -3298,69 +3174,75 @@ def __init__( :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.TypedAssetReference] """ super(Run, self).__init__(**kwargs) - self.run_number = kwargs.get('run_number', None) - self.root_run_id = kwargs.get('root_run_id', None) - self.created_utc = kwargs.get('created_utc', None) - self.created_by = kwargs.get('created_by', None) - self.user_id = kwargs.get('user_id', None) - self.token = kwargs.get('token', None) - self.token_expiry_time_utc = kwargs.get('token_expiry_time_utc', None) - self.error = kwargs.get('error', None) - self.warnings = kwargs.get('warnings', None) - self.revision = kwargs.get('revision', None) - self.status_revision = kwargs.get('status_revision', None) - self.run_uuid = kwargs.get('run_uuid', None) - self.parent_run_uuid = kwargs.get('parent_run_uuid', None) - self.root_run_uuid = kwargs.get('root_run_uuid', None) - self.has_virtual_parent = kwargs.get('has_virtual_parent', None) - self.last_start_time_utc = kwargs.get('last_start_time_utc', None) - self.current_compute_time = kwargs.get('current_compute_time', None) - self.compute_duration = kwargs.get('compute_duration', None) - self.effective_start_time_utc = kwargs.get('effective_start_time_utc', None) - self.last_modified_by = kwargs.get('last_modified_by', None) - self.last_modified_utc = kwargs.get('last_modified_utc', None) - self.duration = kwargs.get('duration', None) - self.cancelation_reason = kwargs.get('cancelation_reason', None) - self.run_id = kwargs.get('run_id', None) - self.parent_run_id = kwargs.get('parent_run_id', None) - self.experiment_id = kwargs.get('experiment_id', None) - self.status = kwargs.get('status', None) - self.start_time_utc = kwargs.get('start_time_utc', None) - self.end_time_utc = kwargs.get('end_time_utc', None) - self.options = kwargs.get('options', None) - self.is_virtual = kwargs.get('is_virtual', None) - self.display_name = kwargs.get('display_name', None) - self.name = kwargs.get('name', None) - self.data_container_id = kwargs.get('data_container_id', None) - self.description = kwargs.get('description', None) - self.hidden = kwargs.get('hidden', None) - self.run_type = kwargs.get('run_type', None) - self.run_type_v2 = kwargs.get('run_type_v2', None) - self.properties = kwargs.get('properties', None) - self.parameters = kwargs.get('parameters', None) - self.action_uris = kwargs.get('action_uris', None) - self.script_name = kwargs.get('script_name', None) - self.target = kwargs.get('target', None) - self.unique_child_run_compute_targets = kwargs.get('unique_child_run_compute_targets', None) - self.tags = kwargs.get('tags', None) - self.settings = kwargs.get('settings', None) - self.services = kwargs.get('services', None) - self.input_datasets = kwargs.get('input_datasets', None) - self.output_datasets = kwargs.get('output_datasets', None) - self.run_definition = kwargs.get('run_definition', None) - self.job_specification = kwargs.get('job_specification', None) - self.primary_metric_name = kwargs.get('primary_metric_name', None) - self.created_from = kwargs.get('created_from', None) - self.cancel_uri = kwargs.get('cancel_uri', None) - self.complete_uri = kwargs.get('complete_uri', None) - self.diagnostics_uri = kwargs.get('diagnostics_uri', None) - self.compute_request = kwargs.get('compute_request', None) - self.compute = kwargs.get('compute', None) - self.retain_for_lifetime_of_workspace = kwargs.get('retain_for_lifetime_of_workspace', None) - self.queueing_info = kwargs.get('queueing_info', None) - self.active_child_run_id = kwargs.get('active_child_run_id', None) - self.inputs = kwargs.get('inputs', None) - self.outputs = kwargs.get('outputs', None) + self.run_number = kwargs.get("run_number", None) + self.root_run_id = kwargs.get("root_run_id", None) + self.created_utc = kwargs.get("created_utc", None) + self.created_by = kwargs.get("created_by", None) + self.user_id = kwargs.get("user_id", None) + self.token = kwargs.get("token", None) + self.token_expiry_time_utc = kwargs.get("token_expiry_time_utc", None) + self.error = kwargs.get("error", None) + self.warnings = kwargs.get("warnings", None) + self.revision = kwargs.get("revision", None) + self.status_revision = kwargs.get("status_revision", None) + self.run_uuid = kwargs.get("run_uuid", None) + self.parent_run_uuid = kwargs.get("parent_run_uuid", None) + self.root_run_uuid = kwargs.get("root_run_uuid", None) + self.has_virtual_parent = kwargs.get("has_virtual_parent", None) + self.last_start_time_utc = kwargs.get("last_start_time_utc", None) + self.current_compute_time = kwargs.get("current_compute_time", None) + self.compute_duration = kwargs.get("compute_duration", None) + self.effective_start_time_utc = kwargs.get( + "effective_start_time_utc", None + ) + self.last_modified_by = kwargs.get("last_modified_by", None) + self.last_modified_utc = kwargs.get("last_modified_utc", None) + self.duration = kwargs.get("duration", None) + self.cancelation_reason = kwargs.get("cancelation_reason", None) + self.run_id = kwargs.get("run_id", None) + self.parent_run_id = kwargs.get("parent_run_id", None) + self.experiment_id = kwargs.get("experiment_id", None) + self.status = kwargs.get("status", None) + self.start_time_utc = kwargs.get("start_time_utc", None) + self.end_time_utc = kwargs.get("end_time_utc", None) + self.options = kwargs.get("options", None) + self.is_virtual = kwargs.get("is_virtual", None) + self.display_name = kwargs.get("display_name", None) + self.name = kwargs.get("name", None) + self.data_container_id = kwargs.get("data_container_id", None) + self.description = kwargs.get("description", None) + self.hidden = kwargs.get("hidden", None) + self.run_type = kwargs.get("run_type", None) + self.run_type_v2 = kwargs.get("run_type_v2", None) + self.properties = kwargs.get("properties", None) + self.parameters = kwargs.get("parameters", None) + self.action_uris = kwargs.get("action_uris", None) + self.script_name = kwargs.get("script_name", None) + self.target = kwargs.get("target", None) + self.unique_child_run_compute_targets = kwargs.get( + "unique_child_run_compute_targets", None + ) + self.tags = kwargs.get("tags", None) + self.settings = kwargs.get("settings", None) + self.services = kwargs.get("services", None) + self.input_datasets = kwargs.get("input_datasets", None) + self.output_datasets = kwargs.get("output_datasets", None) + self.run_definition = kwargs.get("run_definition", None) + self.job_specification = kwargs.get("job_specification", None) + self.primary_metric_name = kwargs.get("primary_metric_name", None) + self.created_from = kwargs.get("created_from", None) + self.cancel_uri = kwargs.get("cancel_uri", None) + self.complete_uri = kwargs.get("complete_uri", None) + self.diagnostics_uri = kwargs.get("diagnostics_uri", None) + self.compute_request = kwargs.get("compute_request", None) + self.compute = kwargs.get("compute", None) + self.retain_for_lifetime_of_workspace = kwargs.get( + "retain_for_lifetime_of_workspace", None + ) + self.queueing_info = kwargs.get("queueing_info", None) + self.active_child_run_id = kwargs.get("active_child_run_id", None) + self.inputs = kwargs.get("inputs", None) + self.outputs = kwargs.get("outputs", None) class RunDetails(msrest.serialization.Model): @@ -3456,58 +3338,61 @@ class RunDetails(msrest.serialization.Model): """ _validation = { - 'input_datasets': {'unique': True}, - 'output_datasets': {'unique': True}, + "input_datasets": {"unique": True}, + "output_datasets": {"unique": True}, } _attribute_map = { - 'run_id': {'key': 'runId', 'type': 'str'}, - 'run_uuid': {'key': 'runUuid', 'type': 'str'}, - 'parent_run_uuid': {'key': 'parentRunUuid', 'type': 'str'}, - 'root_run_uuid': {'key': 'rootRunUuid', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'parent_run_id': {'key': 'parentRunId', 'type': 'str'}, - 'created_time_utc': {'key': 'createdTimeUtc', 'type': 'iso-8601'}, - 'start_time_utc': {'key': 'startTimeUtc', 'type': 'iso-8601'}, - 'end_time_utc': {'key': 'endTimeUtc', 'type': 'iso-8601'}, - 'error': {'key': 'error', 'type': 'ErrorResponse'}, - 'warnings': {'key': 'warnings', 'type': '[RunDetailsWarning]'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'parameters': {'key': 'parameters', 'type': '{object}'}, - 'services': {'key': 'services', 'type': '{EndpointSetting}'}, - 'input_datasets': {'key': 'inputDatasets', 'type': '[DatasetLineage]'}, - 'output_datasets': {'key': 'outputDatasets', 'type': '[OutputDatasetLineage]'}, - 'run_definition': {'key': 'runDefinition', 'type': 'object'}, - 'log_files': {'key': 'logFiles', 'type': '{str}'}, - 'job_cost': {'key': 'jobCost', 'type': 'JobCost'}, - 'revision': {'key': 'revision', 'type': 'long'}, - 'run_type_v2': {'key': 'runTypeV2', 'type': 'RunTypeV2'}, - 'settings': {'key': 'settings', 'type': '{str}'}, - 'compute_request': {'key': 'computeRequest', 'type': 'ComputeRequest'}, - 'compute': {'key': 'compute', 'type': 'Compute'}, - 'created_by': {'key': 'createdBy', 'type': 'User'}, - 'compute_duration': {'key': 'computeDuration', 'type': 'str'}, - 'effective_start_time_utc': {'key': 'effectiveStartTimeUtc', 'type': 'iso-8601'}, - 'run_number': {'key': 'runNumber', 'type': 'int'}, - 'root_run_id': {'key': 'rootRunId', 'type': 'str'}, - 'user_id': {'key': 'userId', 'type': 'str'}, - 'status_revision': {'key': 'statusRevision', 'type': 'long'}, - 'has_virtual_parent': {'key': 'hasVirtualParent', 'type': 'bool'}, - 'current_compute_time': {'key': 'currentComputeTime', 'type': 'str'}, - 'last_start_time_utc': {'key': 'lastStartTimeUtc', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'User'}, - 'last_modified_utc': {'key': 'lastModifiedUtc', 'type': 'iso-8601'}, - 'duration': {'key': 'duration', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '{TypedAssetReference}'}, - 'outputs': {'key': 'outputs', 'type': '{TypedAssetReference}'}, + "run_id": {"key": "runId", "type": "str"}, + "run_uuid": {"key": "runUuid", "type": "str"}, + "parent_run_uuid": {"key": "parentRunUuid", "type": "str"}, + "root_run_uuid": {"key": "rootRunUuid", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "parent_run_id": {"key": "parentRunId", "type": "str"}, + "created_time_utc": {"key": "createdTimeUtc", "type": "iso-8601"}, + "start_time_utc": {"key": "startTimeUtc", "type": "iso-8601"}, + "end_time_utc": {"key": "endTimeUtc", "type": "iso-8601"}, + "error": {"key": "error", "type": "ErrorResponse"}, + "warnings": {"key": "warnings", "type": "[RunDetailsWarning]"}, + "tags": {"key": "tags", "type": "{str}"}, + "properties": {"key": "properties", "type": "{str}"}, + "parameters": {"key": "parameters", "type": "{object}"}, + "services": {"key": "services", "type": "{EndpointSetting}"}, + "input_datasets": {"key": "inputDatasets", "type": "[DatasetLineage]"}, + "output_datasets": { + "key": "outputDatasets", + "type": "[OutputDatasetLineage]", + }, + "run_definition": {"key": "runDefinition", "type": "object"}, + "log_files": {"key": "logFiles", "type": "{str}"}, + "job_cost": {"key": "jobCost", "type": "JobCost"}, + "revision": {"key": "revision", "type": "long"}, + "run_type_v2": {"key": "runTypeV2", "type": "RunTypeV2"}, + "settings": {"key": "settings", "type": "{str}"}, + "compute_request": {"key": "computeRequest", "type": "ComputeRequest"}, + "compute": {"key": "compute", "type": "Compute"}, + "created_by": {"key": "createdBy", "type": "User"}, + "compute_duration": {"key": "computeDuration", "type": "str"}, + "effective_start_time_utc": { + "key": "effectiveStartTimeUtc", + "type": "iso-8601", + }, + "run_number": {"key": "runNumber", "type": "int"}, + "root_run_id": {"key": "rootRunId", "type": "str"}, + "user_id": {"key": "userId", "type": "str"}, + "status_revision": {"key": "statusRevision", "type": "long"}, + "has_virtual_parent": {"key": "hasVirtualParent", "type": "bool"}, + "current_compute_time": {"key": "currentComputeTime", "type": "str"}, + "last_start_time_utc": {"key": "lastStartTimeUtc", "type": "iso-8601"}, + "last_modified_by": {"key": "lastModifiedBy", "type": "User"}, + "last_modified_utc": {"key": "lastModifiedUtc", "type": "iso-8601"}, + "duration": {"key": "duration", "type": "str"}, + "inputs": {"key": "inputs", "type": "{TypedAssetReference}"}, + "outputs": {"key": "outputs", "type": "{TypedAssetReference}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword run_id: The identifier for the run. :paramtype run_id: str @@ -3599,47 +3484,49 @@ def __init__( :paramtype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.TypedAssetReference] """ super(RunDetails, self).__init__(**kwargs) - self.run_id = kwargs.get('run_id', None) - self.run_uuid = kwargs.get('run_uuid', None) - self.parent_run_uuid = kwargs.get('parent_run_uuid', None) - self.root_run_uuid = kwargs.get('root_run_uuid', None) - self.target = kwargs.get('target', None) - self.status = kwargs.get('status', None) - self.parent_run_id = kwargs.get('parent_run_id', None) - self.created_time_utc = kwargs.get('created_time_utc', None) - self.start_time_utc = kwargs.get('start_time_utc', None) - self.end_time_utc = kwargs.get('end_time_utc', None) - self.error = kwargs.get('error', None) - self.warnings = kwargs.get('warnings', None) - self.tags = kwargs.get('tags', None) - self.properties = kwargs.get('properties', None) - self.parameters = kwargs.get('parameters', None) - self.services = kwargs.get('services', None) - self.input_datasets = kwargs.get('input_datasets', None) - self.output_datasets = kwargs.get('output_datasets', None) - self.run_definition = kwargs.get('run_definition', None) - self.log_files = kwargs.get('log_files', None) - self.job_cost = kwargs.get('job_cost', None) - self.revision = kwargs.get('revision', None) - self.run_type_v2 = kwargs.get('run_type_v2', None) - self.settings = kwargs.get('settings', None) - self.compute_request = kwargs.get('compute_request', None) - self.compute = kwargs.get('compute', None) - self.created_by = kwargs.get('created_by', None) - self.compute_duration = kwargs.get('compute_duration', None) - self.effective_start_time_utc = kwargs.get('effective_start_time_utc', None) - self.run_number = kwargs.get('run_number', None) - self.root_run_id = kwargs.get('root_run_id', None) - self.user_id = kwargs.get('user_id', None) - self.status_revision = kwargs.get('status_revision', None) - self.has_virtual_parent = kwargs.get('has_virtual_parent', None) - self.current_compute_time = kwargs.get('current_compute_time', None) - self.last_start_time_utc = kwargs.get('last_start_time_utc', None) - self.last_modified_by = kwargs.get('last_modified_by', None) - self.last_modified_utc = kwargs.get('last_modified_utc', None) - self.duration = kwargs.get('duration', None) - self.inputs = kwargs.get('inputs', None) - self.outputs = kwargs.get('outputs', None) + self.run_id = kwargs.get("run_id", None) + self.run_uuid = kwargs.get("run_uuid", None) + self.parent_run_uuid = kwargs.get("parent_run_uuid", None) + self.root_run_uuid = kwargs.get("root_run_uuid", None) + self.target = kwargs.get("target", None) + self.status = kwargs.get("status", None) + self.parent_run_id = kwargs.get("parent_run_id", None) + self.created_time_utc = kwargs.get("created_time_utc", None) + self.start_time_utc = kwargs.get("start_time_utc", None) + self.end_time_utc = kwargs.get("end_time_utc", None) + self.error = kwargs.get("error", None) + self.warnings = kwargs.get("warnings", None) + self.tags = kwargs.get("tags", None) + self.properties = kwargs.get("properties", None) + self.parameters = kwargs.get("parameters", None) + self.services = kwargs.get("services", None) + self.input_datasets = kwargs.get("input_datasets", None) + self.output_datasets = kwargs.get("output_datasets", None) + self.run_definition = kwargs.get("run_definition", None) + self.log_files = kwargs.get("log_files", None) + self.job_cost = kwargs.get("job_cost", None) + self.revision = kwargs.get("revision", None) + self.run_type_v2 = kwargs.get("run_type_v2", None) + self.settings = kwargs.get("settings", None) + self.compute_request = kwargs.get("compute_request", None) + self.compute = kwargs.get("compute", None) + self.created_by = kwargs.get("created_by", None) + self.compute_duration = kwargs.get("compute_duration", None) + self.effective_start_time_utc = kwargs.get( + "effective_start_time_utc", None + ) + self.run_number = kwargs.get("run_number", None) + self.root_run_id = kwargs.get("root_run_id", None) + self.user_id = kwargs.get("user_id", None) + self.status_revision = kwargs.get("status_revision", None) + self.has_virtual_parent = kwargs.get("has_virtual_parent", None) + self.current_compute_time = kwargs.get("current_compute_time", None) + self.last_start_time_utc = kwargs.get("last_start_time_utc", None) + self.last_modified_by = kwargs.get("last_modified_by", None) + self.last_modified_utc = kwargs.get("last_modified_utc", None) + self.duration = kwargs.get("duration", None) + self.inputs = kwargs.get("inputs", None) + self.outputs = kwargs.get("outputs", None) class RunDetailsWarning(msrest.serialization.Model): @@ -3652,14 +3539,11 @@ class RunDetailsWarning(msrest.serialization.Model): """ _attribute_map = { - 'source': {'key': 'source', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, + "source": {"key": "source", "type": "str"}, + "message": {"key": "message", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword source: :paramtype source: str @@ -3667,8 +3551,8 @@ def __init__( :paramtype message: str """ super(RunDetailsWarning, self).__init__(**kwargs) - self.source = kwargs.get('source', None) - self.message = kwargs.get('message', None) + self.source = kwargs.get("source", None) + self.message = kwargs.get("message", None) class RunMetric(msrest.serialization.Model): @@ -3701,24 +3585,21 @@ class RunMetric(msrest.serialization.Model): """ _attribute_map = { - 'run_id': {'key': 'runId', 'type': 'str'}, - 'metric_id': {'key': 'metricId', 'type': 'str'}, - 'data_container_id': {'key': 'dataContainerId', 'type': 'str'}, - 'metric_type': {'key': 'metricType', 'type': 'str'}, - 'created_utc': {'key': 'createdUtc', 'type': 'iso-8601'}, - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, - 'num_cells': {'key': 'numCells', 'type': 'int'}, - 'data_location': {'key': 'dataLocation', 'type': 'str'}, - 'cells': {'key': 'cells', 'type': '[{object}]'}, - 'schema': {'key': 'schema', 'type': 'MetricSchema'}, + "run_id": {"key": "runId", "type": "str"}, + "metric_id": {"key": "metricId", "type": "str"}, + "data_container_id": {"key": "dataContainerId", "type": "str"}, + "metric_type": {"key": "metricType", "type": "str"}, + "created_utc": {"key": "createdUtc", "type": "iso-8601"}, + "name": {"key": "name", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "label": {"key": "label", "type": "str"}, + "num_cells": {"key": "numCells", "type": "int"}, + "data_location": {"key": "dataLocation", "type": "str"}, + "cells": {"key": "cells", "type": "[{object}]"}, + "schema": {"key": "schema", "type": "MetricSchema"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword run_id: :paramtype run_id: str @@ -3746,18 +3627,18 @@ def __init__( :paramtype schema: ~azure.mgmt.machinelearningservices.models.MetricSchema """ super(RunMetric, self).__init__(**kwargs) - self.run_id = kwargs.get('run_id', None) - self.metric_id = kwargs.get('metric_id', None) - self.data_container_id = kwargs.get('data_container_id', None) - self.metric_type = kwargs.get('metric_type', None) - self.created_utc = kwargs.get('created_utc', None) - self.name = kwargs.get('name', None) - self.description = kwargs.get('description', None) - self.label = kwargs.get('label', None) - self.num_cells = kwargs.get('num_cells', None) - self.data_location = kwargs.get('data_location', None) - self.cells = kwargs.get('cells', None) - self.schema = kwargs.get('schema', None) + self.run_id = kwargs.get("run_id", None) + self.metric_id = kwargs.get("metric_id", None) + self.data_container_id = kwargs.get("data_container_id", None) + self.metric_type = kwargs.get("metric_type", None) + self.created_utc = kwargs.get("created_utc", None) + self.name = kwargs.get("name", None) + self.description = kwargs.get("description", None) + self.label = kwargs.get("label", None) + self.num_cells = kwargs.get("num_cells", None) + self.data_location = kwargs.get("data_location", None) + self.cells = kwargs.get("cells", None) + self.schema = kwargs.get("schema", None) class RunOptions(msrest.serialization.Model): @@ -3768,19 +3649,21 @@ class RunOptions(msrest.serialization.Model): """ _attribute_map = { - 'generate_data_container_id_if_not_specified': {'key': 'generateDataContainerIdIfNotSpecified', 'type': 'bool'}, + "generate_data_container_id_if_not_specified": { + "key": "generateDataContainerIdIfNotSpecified", + "type": "bool", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword generate_data_container_id_if_not_specified: :paramtype generate_data_container_id_if_not_specified: bool """ super(RunOptions, self).__init__(**kwargs) - self.generate_data_container_id_if_not_specified = kwargs.get('generate_data_container_id_if_not_specified', None) + self.generate_data_container_id_if_not_specified = kwargs.get( + "generate_data_container_id_if_not_specified", None + ) class RunServiceInstances(msrest.serialization.Model): @@ -3791,20 +3674,17 @@ class RunServiceInstances(msrest.serialization.Model): """ _attribute_map = { - 'instances': {'key': 'instances', 'type': '{ServiceInstanceResult}'}, + "instances": {"key": "instances", "type": "{ServiceInstanceResult}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword instances: Dictionary of :code:``. :paramtype instances: dict[str, ~azure.mgmt.machinelearningservices.models.ServiceInstanceResult] """ super(RunServiceInstances, self).__init__(**kwargs) - self.instances = kwargs.get('instances', None) + self.instances = kwargs.get("instances", None) class RunStatusSpans(msrest.serialization.Model): @@ -3815,19 +3695,16 @@ class RunStatusSpans(msrest.serialization.Model): """ _attribute_map = { - 'spans': {'key': 'spans', 'type': '[SpanDefinition1]'}, + "spans": {"key": "spans", "type": "[SpanDefinition1]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword spans: :paramtype spans: list[~azure.mgmt.machinelearningservices.models.SpanDefinition1] """ super(RunStatusSpans, self).__init__(**kwargs) - self.spans = kwargs.get('spans', None) + self.spans = kwargs.get("spans", None) class RunTypeV2(msrest.serialization.Model): @@ -3844,20 +3721,17 @@ class RunTypeV2(msrest.serialization.Model): """ _validation = { - 'traits': {'unique': True}, + "traits": {"unique": True}, } _attribute_map = { - 'orchestrator': {'key': 'orchestrator', 'type': 'str'}, - 'traits': {'key': 'traits', 'type': '[str]'}, - 'attribution': {'key': 'attribution', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "orchestrator": {"key": "orchestrator", "type": "str"}, + "traits": {"key": "traits", "type": "[str]"}, + "attribution": {"key": "attribution", "type": "str"}, + "compute_type": {"key": "computeType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword orchestrator: :paramtype orchestrator: str @@ -3869,10 +3743,10 @@ def __init__( :paramtype compute_type: str """ super(RunTypeV2, self).__init__(**kwargs) - self.orchestrator = kwargs.get('orchestrator', None) - self.traits = kwargs.get('traits', None) - self.attribution = kwargs.get('attribution', None) - self.compute_type = kwargs.get('compute_type', None) + self.orchestrator = kwargs.get("orchestrator", None) + self.traits = kwargs.get("traits", None) + self.attribution = kwargs.get("attribution", None) + self.compute_type = kwargs.get("compute_type", None) class ServiceInstance(msrest.serialization.Model): @@ -3893,18 +3767,15 @@ class ServiceInstance(msrest.serialization.Model): """ _attribute_map = { - 'is_single_node': {'key': 'isSingleNode', 'type': 'bool'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'status': {'key': 'status', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'ErrorResponse'}, - 'properties': {'key': 'properties', 'type': '{str}'}, + "is_single_node": {"key": "isSingleNode", "type": "bool"}, + "error_message": {"key": "errorMessage", "type": "str"}, + "port": {"key": "port", "type": "int"}, + "status": {"key": "status", "type": "str"}, + "error": {"key": "error", "type": "ErrorResponse"}, + "properties": {"key": "properties", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword is_single_node: :paramtype is_single_node: bool @@ -3920,12 +3791,12 @@ def __init__( :paramtype properties: dict[str, str] """ super(ServiceInstance, self).__init__(**kwargs) - self.is_single_node = kwargs.get('is_single_node', None) - self.error_message = kwargs.get('error_message', None) - self.port = kwargs.get('port', None) - self.status = kwargs.get('status', None) - self.error = kwargs.get('error', None) - self.properties = kwargs.get('properties', None) + self.is_single_node = kwargs.get("is_single_node", None) + self.error_message = kwargs.get("error_message", None) + self.port = kwargs.get("port", None) + self.status = kwargs.get("status", None) + self.error = kwargs.get("error", None) + self.properties = kwargs.get("properties", None) class ServiceInstanceResult(msrest.serialization.Model): @@ -3946,18 +3817,15 @@ class ServiceInstanceResult(msrest.serialization.Model): """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'status': {'key': 'status', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'ErrorResponse'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, + "type": {"key": "type", "type": "str"}, + "port": {"key": "port", "type": "int"}, + "status": {"key": "status", "type": "str"}, + "error": {"key": "error", "type": "ErrorResponse"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword type: :paramtype type: str @@ -3973,12 +3841,12 @@ def __init__( :paramtype properties: dict[str, str] """ super(ServiceInstanceResult, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.port = kwargs.get('port', None) - self.status = kwargs.get('status', None) - self.error = kwargs.get('error', None) - self.endpoint = kwargs.get('endpoint', None) - self.properties = kwargs.get('properties', None) + self.type = kwargs.get("type", None) + self.port = kwargs.get("port", None) + self.status = kwargs.get("status", None) + self.error = kwargs.get("error", None) + self.endpoint = kwargs.get("endpoint", None) + self.properties = kwargs.get("properties", None) class SpanContext(msrest.serialization.Model): @@ -4008,17 +3876,14 @@ class SpanContext(msrest.serialization.Model): """ _attribute_map = { - 'trace_id': {'key': 'traceId', 'type': 'str'}, - 'span_id': {'key': 'spanId', 'type': 'str'}, - 'is_remote': {'key': 'isRemote', 'type': 'bool'}, - 'is_valid': {'key': 'isValid', 'type': 'bool'}, - 'tracestate': {'key': 'tracestate', 'type': '[KeyValuePairString]'}, + "trace_id": {"key": "traceId", "type": "str"}, + "span_id": {"key": "spanId", "type": "str"}, + "is_remote": {"key": "isRemote", "type": "bool"}, + "is_valid": {"key": "isValid", "type": "bool"}, + "tracestate": {"key": "tracestate", "type": "[KeyValuePairString]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword trace_id: Gets the TraceId associated with this Microsoft.MachineLearning.RunHistory.Contracts.SpanContext. @@ -4043,64 +3908,64 @@ def __init__( :paramtype tracestate: list[~azure.mgmt.machinelearningservices.models.KeyValuePairString] """ super(SpanContext, self).__init__(**kwargs) - self.trace_id = kwargs.get('trace_id', None) - self.span_id = kwargs.get('span_id', None) - self.is_remote = kwargs.get('is_remote', None) - self.is_valid = kwargs.get('is_valid', None) - self.tracestate = kwargs.get('tracestate', None) + self.trace_id = kwargs.get("trace_id", None) + self.span_id = kwargs.get("span_id", None) + self.is_remote = kwargs.get("is_remote", None) + self.is_valid = kwargs.get("is_valid", None) + self.tracestate = kwargs.get("tracestate", None) class SpanDefinition1(msrest.serialization.Model): """Most of the code in this class is vendored from here. -https://github.com/open-telemetry/opentelemetry-dotnet/blob/master/src/OpenTelemetry/Trace/Export/SpanData.cs -SpanData on that github link is readonly, we can't set properties on it after creation. So, just vendoring the Span -contract. -TStatus is the status enum. For runs, it is RunStatus -This is the link for span spec https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/overview.md#span. - - :ivar context: - :vartype context: ~azure.mgmt.machinelearningservices.models.SpanContext - :ivar name: Gets span name. - :vartype name: str - :ivar status: Gets span status. - OpenTelemetry sets it to - https://github.com/open-telemetry/opentelemetry-dotnet/blob/master/src/OpenTelemetry.Api/Trace/Status.cs - That status enums are not very meaningful to us, so we customize this. Possible values - include: "NotStarted", "Unapproved", "Pausing", "Paused", "Starting", "Preparing", "Queued", - "Running", "Finalizing", "CancelRequested", "Completed", "Failed", "Canceled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RunStatus - :ivar parent_span_id: Gets parent span id. - TODO: In actual spec, it is ActivitySpanId type. But that causes problems in - serialization/deserialization. - :vartype parent_span_id: str - :ivar attributes: Gets attributes. - :vartype attributes: list[~azure.mgmt.machinelearningservices.models.KeyValuePairStringJToken] - :ivar events: Gets events. - :vartype events: list[~azure.mgmt.machinelearningservices.models.Event] - :ivar links: Gets links. - :vartype links: list[~azure.mgmt.machinelearningservices.models.Link] - :ivar start_timestamp: Gets span start timestamp. - :vartype start_timestamp: ~datetime.datetime - :ivar end_timestamp: Gets span end timestamp. - :vartype end_timestamp: ~datetime.datetime + https://github.com/open-telemetry/opentelemetry-dotnet/blob/master/src/OpenTelemetry/Trace/Export/SpanData.cs + SpanData on that github link is readonly, we can't set properties on it after creation. So, just vendoring the Span + contract. + TStatus is the status enum. For runs, it is RunStatus + This is the link for span spec https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/overview.md#span. + + :ivar context: + :vartype context: ~azure.mgmt.machinelearningservices.models.SpanContext + :ivar name: Gets span name. + :vartype name: str + :ivar status: Gets span status. + OpenTelemetry sets it to + https://github.com/open-telemetry/opentelemetry-dotnet/blob/master/src/OpenTelemetry.Api/Trace/Status.cs + That status enums are not very meaningful to us, so we customize this. Possible values + include: "NotStarted", "Unapproved", "Pausing", "Paused", "Starting", "Preparing", "Queued", + "Running", "Finalizing", "CancelRequested", "Completed", "Failed", "Canceled". + :vartype status: str or ~azure.mgmt.machinelearningservices.models.RunStatus + :ivar parent_span_id: Gets parent span id. + TODO: In actual spec, it is ActivitySpanId type. But that causes problems in + serialization/deserialization. + :vartype parent_span_id: str + :ivar attributes: Gets attributes. + :vartype attributes: list[~azure.mgmt.machinelearningservices.models.KeyValuePairStringJToken] + :ivar events: Gets events. + :vartype events: list[~azure.mgmt.machinelearningservices.models.Event] + :ivar links: Gets links. + :vartype links: list[~azure.mgmt.machinelearningservices.models.Link] + :ivar start_timestamp: Gets span start timestamp. + :vartype start_timestamp: ~datetime.datetime + :ivar end_timestamp: Gets span end timestamp. + :vartype end_timestamp: ~datetime.datetime """ _attribute_map = { - 'context': {'key': 'context', 'type': 'SpanContext'}, - 'name': {'key': 'name', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'parent_span_id': {'key': 'parentSpanId', 'type': 'str'}, - 'attributes': {'key': 'attributes', 'type': '[KeyValuePairStringJToken]'}, - 'events': {'key': 'events', 'type': '[Event]'}, - 'links': {'key': 'links', 'type': '[Link]'}, - 'start_timestamp': {'key': 'startTimestamp', 'type': 'iso-8601'}, - 'end_timestamp': {'key': 'endTimestamp', 'type': 'iso-8601'}, + "context": {"key": "context", "type": "SpanContext"}, + "name": {"key": "name", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "parent_span_id": {"key": "parentSpanId", "type": "str"}, + "attributes": { + "key": "attributes", + "type": "[KeyValuePairStringJToken]", + }, + "events": {"key": "events", "type": "[Event]"}, + "links": {"key": "links", "type": "[Link]"}, + "start_timestamp": {"key": "startTimestamp", "type": "iso-8601"}, + "end_timestamp": {"key": "endTimestamp", "type": "iso-8601"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword context: :paramtype context: ~azure.mgmt.machinelearningservices.models.SpanContext @@ -4130,15 +3995,15 @@ def __init__( :paramtype end_timestamp: ~datetime.datetime """ super(SpanDefinition1, self).__init__(**kwargs) - self.context = kwargs.get('context', None) - self.name = kwargs.get('name', None) - self.status = kwargs.get('status', None) - self.parent_span_id = kwargs.get('parent_span_id', None) - self.attributes = kwargs.get('attributes', None) - self.events = kwargs.get('events', None) - self.links = kwargs.get('links', None) - self.start_timestamp = kwargs.get('start_timestamp', None) - self.end_timestamp = kwargs.get('end_timestamp', None) + self.context = kwargs.get("context", None) + self.name = kwargs.get("name", None) + self.status = kwargs.get("status", None) + self.parent_span_id = kwargs.get("parent_span_id", None) + self.attributes = kwargs.get("attributes", None) + self.events = kwargs.get("events", None) + self.links = kwargs.get("links", None) + self.start_timestamp = kwargs.get("start_timestamp", None) + self.end_timestamp = kwargs.get("end_timestamp", None) class SqlDataPath(msrest.serialization.Model): @@ -4156,16 +4021,19 @@ class SqlDataPath(msrest.serialization.Model): """ _attribute_map = { - 'sql_table_name': {'key': 'sqlTableName', 'type': 'str'}, - 'sql_query': {'key': 'sqlQuery', 'type': 'str'}, - 'sql_stored_procedure_name': {'key': 'sqlStoredProcedureName', 'type': 'str'}, - 'sql_stored_procedure_params': {'key': 'sqlStoredProcedureParams', 'type': '[StoredProcedureParameter]'}, + "sql_table_name": {"key": "sqlTableName", "type": "str"}, + "sql_query": {"key": "sqlQuery", "type": "str"}, + "sql_stored_procedure_name": { + "key": "sqlStoredProcedureName", + "type": "str", + }, + "sql_stored_procedure_params": { + "key": "sqlStoredProcedureParams", + "type": "[StoredProcedureParameter]", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword sql_table_name: :paramtype sql_table_name: str @@ -4178,10 +4046,14 @@ def __init__( list[~azure.mgmt.machinelearningservices.models.StoredProcedureParameter] """ super(SqlDataPath, self).__init__(**kwargs) - self.sql_table_name = kwargs.get('sql_table_name', None) - self.sql_query = kwargs.get('sql_query', None) - self.sql_stored_procedure_name = kwargs.get('sql_stored_procedure_name', None) - self.sql_stored_procedure_params = kwargs.get('sql_stored_procedure_params', None) + self.sql_table_name = kwargs.get("sql_table_name", None) + self.sql_query = kwargs.get("sql_query", None) + self.sql_stored_procedure_name = kwargs.get( + "sql_stored_procedure_name", None + ) + self.sql_stored_procedure_params = kwargs.get( + "sql_stored_procedure_params", None + ) class StoredProcedureParameter(msrest.serialization.Model): @@ -4196,15 +4068,12 @@ class StoredProcedureParameter(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "type": {"key": "type", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: :paramtype name: str @@ -4214,9 +4083,9 @@ def __init__( :paramtype type: str or ~azure.mgmt.machinelearningservices.models.StoredProcedureParameterType """ super(StoredProcedureParameter, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.value = kwargs.get('value', None) - self.type = kwargs.get('type', None) + self.name = kwargs.get("name", None) + self.value = kwargs.get("value", None) + self.type = kwargs.get("type", None) class TypedAssetReference(msrest.serialization.Model): @@ -4229,14 +4098,11 @@ class TypedAssetReference(msrest.serialization.Model): """ _attribute_map = { - 'asset_id': {'key': 'assetId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + "asset_id": {"key": "assetId", "type": "str"}, + "type": {"key": "type", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword asset_id: :paramtype asset_id: str @@ -4244,8 +4110,8 @@ def __init__( :paramtype type: str """ super(TypedAssetReference, self).__init__(**kwargs) - self.asset_id = kwargs.get('asset_id', None) - self.type = kwargs.get('type', None) + self.asset_id = kwargs.get("asset_id", None) + self.type = kwargs.get("type", None) class User(msrest.serialization.Model): @@ -4278,20 +4144,17 @@ class User(msrest.serialization.Model): """ _attribute_map = { - 'user_object_id': {'key': 'userObjectId', 'type': 'str'}, - 'user_pu_id': {'key': 'userPuId', 'type': 'str'}, - 'user_idp': {'key': 'userIdp', 'type': 'str'}, - 'user_alt_sec_id': {'key': 'userAltSecId', 'type': 'str'}, - 'user_iss': {'key': 'userIss', 'type': 'str'}, - 'user_tenant_id': {'key': 'userTenantId', 'type': 'str'}, - 'user_name': {'key': 'userName', 'type': 'str'}, - 'upn': {'key': 'upn', 'type': 'str'}, + "user_object_id": {"key": "userObjectId", "type": "str"}, + "user_pu_id": {"key": "userPuId", "type": "str"}, + "user_idp": {"key": "userIdp", "type": "str"}, + "user_alt_sec_id": {"key": "userAltSecId", "type": "str"}, + "user_iss": {"key": "userIss", "type": "str"}, + "user_tenant_id": {"key": "userTenantId", "type": "str"}, + "user_name": {"key": "userName", "type": "str"}, + "upn": {"key": "upn", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword user_object_id: A user or service principal's object ID. This is EUPI and may only be logged to warm path telemetry. @@ -4319,11 +4182,11 @@ def __init__( :paramtype upn: str """ super(User, self).__init__(**kwargs) - self.user_object_id = kwargs.get('user_object_id', None) - self.user_pu_id = kwargs.get('user_pu_id', None) - self.user_idp = kwargs.get('user_idp', None) - self.user_alt_sec_id = kwargs.get('user_alt_sec_id', None) - self.user_iss = kwargs.get('user_iss', None) - self.user_tenant_id = kwargs.get('user_tenant_id', None) - self.user_name = kwargs.get('user_name', None) - self.upn = kwargs.get('upn', None) + self.user_object_id = kwargs.get("user_object_id", None) + self.user_pu_id = kwargs.get("user_pu_id", None) + self.user_idp = kwargs.get("user_idp", None) + self.user_alt_sec_id = kwargs.get("user_alt_sec_id", None) + self.user_iss = kwargs.get("user_iss", None) + self.user_tenant_id = kwargs.get("user_tenant_id", None) + self.user_name = kwargs.get("user_name", None) + self.upn = kwargs.get("upn", None) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/models/_models_py3.py index 4b482905d5ae..4464e4e919a7 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/models/_models_py3.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/models/_models_py3.py @@ -23,7 +23,7 @@ class AddOrModifyRunServiceInstancesRequest(msrest.serialization.Model): """ _attribute_map = { - 'instances': {'key': 'instances', 'type': '{ServiceInstance}'}, + "instances": {"key": "instances", "type": "{ServiceInstance}"}, } def __init__( @@ -66,20 +66,20 @@ class Artifact(msrest.serialization.Model): """ _validation = { - 'origin': {'required': True}, - 'container': {'required': True}, - 'path': {'required': True}, + "origin": {"required": True}, + "container": {"required": True}, + "path": {"required": True}, } _attribute_map = { - 'artifact_id': {'key': 'artifactId', 'type': 'str'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'container': {'key': 'container', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, - 'data_path': {'key': 'dataPath', 'type': 'ArtifactDataPath'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "artifact_id": {"key": "artifactId", "type": "str"}, + "origin": {"key": "origin", "type": "str"}, + "container": {"key": "container", "type": "str"}, + "path": {"key": "path", "type": "str"}, + "etag": {"key": "etag", "type": "str"}, + "created_time": {"key": "createdTime", "type": "iso-8601"}, + "data_path": {"key": "dataPath", "type": "ArtifactDataPath"}, + "tags": {"key": "tags", "type": "{str}"}, } def __init__( @@ -145,11 +145,11 @@ class ArtifactContentInformation(msrest.serialization.Model): """ _attribute_map = { - 'content_uri': {'key': 'contentUri', 'type': 'str'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'container': {'key': 'container', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "content_uri": {"key": "contentUri", "type": "str"}, + "origin": {"key": "origin", "type": "str"}, + "container": {"key": "container", "type": "str"}, + "path": {"key": "path", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, } def __init__( @@ -196,9 +196,9 @@ class ArtifactDataPath(msrest.serialization.Model): """ _attribute_map = { - 'data_store_name': {'key': 'dataStoreName', 'type': 'str'}, - 'relative_path': {'key': 'relativePath', 'type': 'str'}, - 'sql_data_path': {'key': 'sqlDataPath', 'type': 'SqlDataPath'}, + "data_store_name": {"key": "dataStoreName", "type": "str"}, + "relative_path": {"key": "relativePath", "type": "str"}, + "sql_data_path": {"key": "sqlDataPath", "type": "SqlDataPath"}, } def __init__( @@ -235,20 +235,16 @@ class ArtifactPath(msrest.serialization.Model): """ _validation = { - 'path': {'required': True}, + "path": {"required": True}, } _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "path": {"key": "path", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, } def __init__( - self, - *, - path: str, - tags: Optional[Dict[str, str]] = None, - **kwargs + self, *, path: str, tags: Optional[Dict[str, str]] = None, **kwargs ): """ :keyword path: Required. The path to the Artifact in a container. @@ -271,19 +267,14 @@ class ArtifactPathList(msrest.serialization.Model): """ _validation = { - 'paths': {'required': True}, + "paths": {"required": True}, } _attribute_map = { - 'paths': {'key': 'paths', 'type': '[ArtifactPath]'}, + "paths": {"key": "paths", "type": "[ArtifactPath]"}, } - def __init__( - self, - *, - paths: List["ArtifactPath"], - **kwargs - ): + def __init__(self, *, paths: List["ArtifactPath"], **kwargs): """ :keyword paths: Required. List of Artifact Paths. :paramtype paths: list[~azure.mgmt.machinelearningservices.models.ArtifactPath] @@ -304,9 +295,9 @@ class BaseEvent(msrest.serialization.Model): """ _attribute_map = { - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'name': {'key': 'name', 'type': 'str'}, - 'data': {'key': 'data', 'type': 'object'}, + "timestamp": {"key": "timestamp", "type": "iso-8601"}, + "name": {"key": "name", "type": "str"}, + "data": {"key": "data", "type": "object"}, } def __init__( @@ -339,15 +330,10 @@ class BatchAddOrModifyRunRequest(msrest.serialization.Model): """ _attribute_map = { - 'runs': {'key': 'runs', 'type': '[CreateRun]'}, + "runs": {"key": "runs", "type": "[CreateRun]"}, } - def __init__( - self, - *, - runs: Optional[List["CreateRun"]] = None, - **kwargs - ): + def __init__(self, *, runs: Optional[List["CreateRun"]] = None, **kwargs): """ :keyword runs: :paramtype runs: list[~azure.mgmt.machinelearningservices.models.CreateRun] @@ -370,16 +356,21 @@ class BatchArtifactContentInformationResult(msrest.serialization.Model): """ _attribute_map = { - 'artifacts': {'key': 'artifacts', 'type': '{Artifact}'}, - 'artifact_content_information': {'key': 'artifactContentInformation', 'type': '{ArtifactContentInformation}'}, - 'errors': {'key': 'errors', 'type': '{ErrorResponse}'}, + "artifacts": {"key": "artifacts", "type": "{Artifact}"}, + "artifact_content_information": { + "key": "artifactContentInformation", + "type": "{ArtifactContentInformation}", + }, + "errors": {"key": "errors", "type": "{ErrorResponse}"}, } def __init__( self, *, artifacts: Optional[Dict[str, "Artifact"]] = None, - artifact_content_information: Optional[Dict[str, "ArtifactContentInformation"]] = None, + artifact_content_information: Optional[ + Dict[str, "ArtifactContentInformation"] + ] = None, errors: Optional[Dict[str, "ErrorResponse"]] = None, **kwargs ): @@ -407,14 +398,11 @@ class BatchEventCommand(msrest.serialization.Model): """ _attribute_map = { - 'events': {'key': 'events', 'type': '[BaseEvent]'}, + "events": {"key": "events", "type": "[BaseEvent]"}, } def __init__( - self, - *, - events: Optional[List["BaseEvent"]] = None, - **kwargs + self, *, events: Optional[List["BaseEvent"]] = None, **kwargs ): """ :keyword events: @@ -435,8 +423,11 @@ class BatchEventCommandResult(msrest.serialization.Model): """ _attribute_map = { - 'errors': {'key': 'errors', 'type': '[KeyValuePairBaseEventErrorResponse]'}, - 'successes': {'key': 'successes', 'type': '[str]'}, + "errors": { + "key": "errors", + "type": "[KeyValuePairBaseEventErrorResponse]", + }, + "successes": {"key": "successes", "type": "[str]"}, } def __init__( @@ -468,8 +459,8 @@ class BatchIMetricV2(msrest.serialization.Model): """ _attribute_map = { - 'values': {'key': 'values', 'type': '[IMetricV2]'}, - 'report_errors': {'key': 'reportErrors', 'type': 'bool'}, + "values": {"key": "values", "type": "[IMetricV2]"}, + "report_errors": {"key": "reportErrors", "type": "bool"}, } def __init__( @@ -498,7 +489,7 @@ class BatchRequest1(msrest.serialization.Model): """ _attribute_map = { - 'requests': {'key': 'requests', 'type': '{GetRunDataRequest}'}, + "requests": {"key": "requests", "type": "{GetRunDataRequest}"}, } def __init__( @@ -526,8 +517,11 @@ class BatchResult1(msrest.serialization.Model): """ _attribute_map = { - 'successful_results': {'key': 'successfulResults', 'type': '{GetRunDataResult}'}, - 'failed_results': {'key': 'failedResults', 'type': '{ErrorResponse}'}, + "successful_results": { + "key": "successfulResults", + "type": "{GetRunDataResult}", + }, + "failed_results": {"key": "failedResults", "type": "{ErrorResponse}"}, } def __init__( @@ -559,8 +553,8 @@ class BatchRunResult(msrest.serialization.Model): """ _attribute_map = { - 'runs': {'key': 'runs', 'type': '{Run}'}, - 'errors': {'key': 'errors', 'type': '{ErrorResponse}'}, + "runs": {"key": "runs", "type": "{Run}"}, + "errors": {"key": "errors", "type": "{ErrorResponse}"}, } def __init__( @@ -601,13 +595,13 @@ class Compute(msrest.serialization.Model): """ _attribute_map = { - 'target': {'key': 'target', 'type': 'str'}, - 'target_type': {'key': 'targetType', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'gpu_count': {'key': 'gpuCount', 'type': 'int'}, - 'priority': {'key': 'priority', 'type': 'str'}, - 'region': {'key': 'region', 'type': 'str'}, + "target": {"key": "target", "type": "str"}, + "target_type": {"key": "targetType", "type": "str"}, + "vm_size": {"key": "vmSize", "type": "str"}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "gpu_count": {"key": "gpuCount", "type": "int"}, + "priority": {"key": "priority", "type": "str"}, + "region": {"key": "region", "type": "str"}, } def __init__( @@ -658,8 +652,8 @@ class ComputeRequest(msrest.serialization.Model): """ _attribute_map = { - 'node_count': {'key': 'nodeCount', 'type': 'int'}, - 'gpu_count': {'key': 'gpuCount', 'type': 'int'}, + "node_count": {"key": "nodeCount", "type": "int"}, + "gpu_count": {"key": "gpuCount", "type": "int"}, } def __init__( @@ -694,9 +688,9 @@ class CreatedFrom(msrest.serialization.Model): """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'location_type': {'key': 'locationType', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, + "type": {"key": "type", "type": "str"}, + "location_type": {"key": "locationType", "type": "str"}, + "location": {"key": "location", "type": "str"}, } def __init__( @@ -811,52 +805,61 @@ class CreateRun(msrest.serialization.Model): """ _validation = { - 'unique_child_run_compute_targets': {'unique': True}, - 'input_datasets': {'unique': True}, - 'output_datasets': {'unique': True}, + "unique_child_run_compute_targets": {"unique": True}, + "input_datasets": {"unique": True}, + "output_datasets": {"unique": True}, } _attribute_map = { - 'run_id': {'key': 'runId', 'type': 'str'}, - 'parent_run_id': {'key': 'parentRunId', 'type': 'str'}, - 'experiment_id': {'key': 'experimentId', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'start_time_utc': {'key': 'startTimeUtc', 'type': 'iso-8601'}, - 'end_time_utc': {'key': 'endTimeUtc', 'type': 'iso-8601'}, - 'options': {'key': 'options', 'type': 'RunOptions'}, - 'is_virtual': {'key': 'isVirtual', 'type': 'bool'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'data_container_id': {'key': 'dataContainerId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'hidden': {'key': 'hidden', 'type': 'bool'}, - 'run_type': {'key': 'runType', 'type': 'str'}, - 'run_type_v2': {'key': 'runTypeV2', 'type': 'RunTypeV2'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'parameters': {'key': 'parameters', 'type': '{object}'}, - 'action_uris': {'key': 'actionUris', 'type': '{str}'}, - 'script_name': {'key': 'scriptName', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'unique_child_run_compute_targets': {'key': 'uniqueChildRunComputeTargets', 'type': '[str]'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'settings': {'key': 'settings', 'type': '{str}'}, - 'services': {'key': 'services', 'type': '{EndpointSetting}'}, - 'input_datasets': {'key': 'inputDatasets', 'type': '[DatasetLineage]'}, - 'output_datasets': {'key': 'outputDatasets', 'type': '[OutputDatasetLineage]'}, - 'run_definition': {'key': 'runDefinition', 'type': 'object'}, - 'job_specification': {'key': 'jobSpecification', 'type': 'object'}, - 'primary_metric_name': {'key': 'primaryMetricName', 'type': 'str'}, - 'created_from': {'key': 'createdFrom', 'type': 'CreatedFrom'}, - 'cancel_uri': {'key': 'cancelUri', 'type': 'str'}, - 'complete_uri': {'key': 'completeUri', 'type': 'str'}, - 'diagnostics_uri': {'key': 'diagnosticsUri', 'type': 'str'}, - 'compute_request': {'key': 'computeRequest', 'type': 'ComputeRequest'}, - 'compute': {'key': 'compute', 'type': 'Compute'}, - 'retain_for_lifetime_of_workspace': {'key': 'retainForLifetimeOfWorkspace', 'type': 'bool'}, - 'queueing_info': {'key': 'queueingInfo', 'type': 'QueueingInfo'}, - 'active_child_run_id': {'key': 'activeChildRunId', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '{TypedAssetReference}'}, - 'outputs': {'key': 'outputs', 'type': '{TypedAssetReference}'}, + "run_id": {"key": "runId", "type": "str"}, + "parent_run_id": {"key": "parentRunId", "type": "str"}, + "experiment_id": {"key": "experimentId", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "start_time_utc": {"key": "startTimeUtc", "type": "iso-8601"}, + "end_time_utc": {"key": "endTimeUtc", "type": "iso-8601"}, + "options": {"key": "options", "type": "RunOptions"}, + "is_virtual": {"key": "isVirtual", "type": "bool"}, + "display_name": {"key": "displayName", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "data_container_id": {"key": "dataContainerId", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "hidden": {"key": "hidden", "type": "bool"}, + "run_type": {"key": "runType", "type": "str"}, + "run_type_v2": {"key": "runTypeV2", "type": "RunTypeV2"}, + "properties": {"key": "properties", "type": "{str}"}, + "parameters": {"key": "parameters", "type": "{object}"}, + "action_uris": {"key": "actionUris", "type": "{str}"}, + "script_name": {"key": "scriptName", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "unique_child_run_compute_targets": { + "key": "uniqueChildRunComputeTargets", + "type": "[str]", + }, + "tags": {"key": "tags", "type": "{str}"}, + "settings": {"key": "settings", "type": "{str}"}, + "services": {"key": "services", "type": "{EndpointSetting}"}, + "input_datasets": {"key": "inputDatasets", "type": "[DatasetLineage]"}, + "output_datasets": { + "key": "outputDatasets", + "type": "[OutputDatasetLineage]", + }, + "run_definition": {"key": "runDefinition", "type": "object"}, + "job_specification": {"key": "jobSpecification", "type": "object"}, + "primary_metric_name": {"key": "primaryMetricName", "type": "str"}, + "created_from": {"key": "createdFrom", "type": "CreatedFrom"}, + "cancel_uri": {"key": "cancelUri", "type": "str"}, + "complete_uri": {"key": "completeUri", "type": "str"}, + "diagnostics_uri": {"key": "diagnosticsUri", "type": "str"}, + "compute_request": {"key": "computeRequest", "type": "ComputeRequest"}, + "compute": {"key": "compute", "type": "Compute"}, + "retain_for_lifetime_of_workspace": { + "key": "retainForLifetimeOfWorkspace", + "type": "bool", + }, + "queueing_info": {"key": "queueingInfo", "type": "QueueingInfo"}, + "active_child_run_id": {"key": "activeChildRunId", "type": "str"}, + "inputs": {"key": "inputs", "type": "{TypedAssetReference}"}, + "outputs": {"key": "outputs", "type": "{TypedAssetReference}"}, } def __init__( @@ -1010,7 +1013,9 @@ def __init__( self.action_uris = action_uris self.script_name = script_name self.target = target - self.unique_child_run_compute_targets = unique_child_run_compute_targets + self.unique_child_run_compute_targets = ( + unique_child_run_compute_targets + ) self.tags = tags self.settings = settings self.services = services @@ -1025,7 +1030,9 @@ def __init__( self.diagnostics_uri = diagnostics_uri self.compute_request = compute_request self.compute = compute - self.retain_for_lifetime_of_workspace = retain_for_lifetime_of_workspace + self.retain_for_lifetime_of_workspace = ( + retain_for_lifetime_of_workspace + ) self.queueing_info = queueing_info self.active_child_run_id = active_child_run_id self.inputs = inputs @@ -1044,9 +1051,9 @@ class DatasetIdentifier(msrest.serialization.Model): """ _attribute_map = { - 'saved_id': {'key': 'savedId', 'type': 'str'}, - 'registered_id': {'key': 'registeredId', 'type': 'str'}, - 'registered_version': {'key': 'registeredVersion', 'type': 'str'}, + "saved_id": {"key": "savedId", "type": "str"}, + "registered_id": {"key": "registeredId", "type": "str"}, + "registered_version": {"key": "registeredVersion", "type": "str"}, } def __init__( @@ -1083,9 +1090,9 @@ class DatasetInputDetails(msrest.serialization.Model): """ _attribute_map = { - 'input_name': {'key': 'inputName', 'type': 'str'}, - 'mechanism': {'key': 'mechanism', 'type': 'str'}, - 'path_on_compute': {'key': 'pathOnCompute', 'type': 'str'}, + "input_name": {"key": "inputName", "type": "str"}, + "mechanism": {"key": "mechanism", "type": "str"}, + "path_on_compute": {"key": "pathOnCompute", "type": "str"}, } def __init__( @@ -1124,16 +1131,21 @@ class DatasetLineage(msrest.serialization.Model): """ _attribute_map = { - 'identifier': {'key': 'identifier', 'type': 'DatasetIdentifier'}, - 'consumption_type': {'key': 'consumptionType', 'type': 'str'}, - 'input_details': {'key': 'inputDetails', 'type': 'DatasetInputDetails'}, + "identifier": {"key": "identifier", "type": "DatasetIdentifier"}, + "consumption_type": {"key": "consumptionType", "type": "str"}, + "input_details": { + "key": "inputDetails", + "type": "DatasetInputDetails", + }, } def __init__( self, *, identifier: Optional["DatasetIdentifier"] = None, - consumption_type: Optional[Union[str, "DatasetConsumptionType"]] = None, + consumption_type: Optional[ + Union[str, "DatasetConsumptionType"] + ] = None, input_details: Optional["DatasetInputDetails"] = None, **kwargs ): @@ -1160,15 +1172,10 @@ class DatasetOutputDetails(msrest.serialization.Model): """ _attribute_map = { - 'output_name': {'key': 'outputName', 'type': 'str'}, + "output_name": {"key": "outputName", "type": "str"}, } - def __init__( - self, - *, - output_name: Optional[str] = None, - **kwargs - ): + def __init__(self, *, output_name: Optional[str] = None, **kwargs): """ :keyword output_name: :paramtype output_name: str @@ -1189,9 +1196,9 @@ class DeleteConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'workspace_id': {'key': 'workspaceId', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - 'cutoff_days': {'key': 'cutoffDays', 'type': 'int'}, + "workspace_id": {"key": "workspaceId", "type": "str"}, + "is_enabled": {"key": "isEnabled", "type": "bool"}, + "cutoff_days": {"key": "cutoffDays", "type": "int"}, } def __init__( @@ -1224,14 +1231,11 @@ class DeleteExperimentTagsResult(msrest.serialization.Model): """ _attribute_map = { - 'errors': {'key': 'errors', 'type': '{ErrorResponse}'}, + "errors": {"key": "errors", "type": "{ErrorResponse}"}, } def __init__( - self, - *, - errors: Optional[Dict[str, "ErrorResponse"]] = None, - **kwargs + self, *, errors: Optional[Dict[str, "ErrorResponse"]] = None, **kwargs ): """ :keyword errors: Dictionary of :code:``. @@ -1251,8 +1255,8 @@ class DeleteOrModifyTags(msrest.serialization.Model): """ _attribute_map = { - 'tags_to_modify': {'key': 'tagsToModify', 'type': '{str}'}, - 'tags_to_delete': {'key': 'tagsToDelete', 'type': '[str]'}, + "tags_to_modify": {"key": "tagsToModify", "type": "{str}"}, + "tags_to_delete": {"key": "tagsToDelete", "type": "[str]"}, } def __init__( @@ -1281,14 +1285,11 @@ class DeleteRunServices(msrest.serialization.Model): """ _attribute_map = { - 'services_to_delete': {'key': 'servicesToDelete', 'type': '[str]'}, + "services_to_delete": {"key": "servicesToDelete", "type": "[str]"}, } def __init__( - self, - *, - services_to_delete: Optional[List[str]] = None, - **kwargs + self, *, services_to_delete: Optional[List[str]] = None, **kwargs ): """ :keyword services_to_delete: The list of Services to delete. @@ -1306,15 +1307,10 @@ class DeleteTagsCommand(msrest.serialization.Model): """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '[str]'}, + "tags": {"key": "tags", "type": "[str]"}, } - def __init__( - self, - *, - tags: Optional[List[str]] = None, - **kwargs - ): + def __init__(self, *, tags: Optional[List[str]] = None, **kwargs): """ :keyword tags: A set of tags. :paramtype tags: list[str] @@ -1337,15 +1333,15 @@ class DerivedMetricKey(msrest.serialization.Model): """ _validation = { - 'labels': {'unique': True}, - 'column_names': {'unique': True}, + "labels": {"unique": True}, + "column_names": {"unique": True}, } _attribute_map = { - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'labels': {'key': 'labels', 'type': '[str]'}, - 'column_names': {'key': 'columnNames', 'type': '[str]'}, + "namespace": {"key": "namespace", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "labels": {"key": "labels", "type": "[str]"}, + "column_names": {"key": "columnNames", "type": "[str]"}, } def __init__( @@ -1398,15 +1394,15 @@ class EndpointSetting(msrest.serialization.Model): """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'ssl_thumbprint': {'key': 'sslThumbprint', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'proxy_endpoint': {'key': 'proxyEndpoint', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': '{str}'}, + "type": {"key": "type", "type": "str"}, + "port": {"key": "port", "type": "int"}, + "ssl_thumbprint": {"key": "sslThumbprint", "type": "str"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "proxy_endpoint": {"key": "proxyEndpoint", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "error_message": {"key": "errorMessage", "type": "str"}, + "enabled": {"key": "enabled", "type": "bool"}, + "properties": {"key": "properties", "type": "{str}"}, } def __init__( @@ -1465,8 +1461,8 @@ class ErrorAdditionalInfo(msrest.serialization.Model): """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, + "type": {"key": "type", "type": "str"}, + "info": {"key": "info", "type": "object"}, } def __init__( @@ -1505,12 +1501,12 @@ class ErrorResponse(msrest.serialization.Model): """ _attribute_map = { - 'error': {'key': 'error', 'type': 'RootError'}, - 'correlation': {'key': 'correlation', 'type': '{str}'}, - 'environment': {'key': 'environment', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'time': {'key': 'time', 'type': 'iso-8601'}, - 'component_name': {'key': 'componentName', 'type': 'str'}, + "error": {"key": "error", "type": "RootError"}, + "correlation": {"key": "correlation", "type": "{str}"}, + "environment": {"key": "environment", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "time": {"key": "time", "type": "iso-8601"}, + "component_name": {"key": "componentName", "type": "str"}, } def __init__( @@ -1560,9 +1556,9 @@ class Event(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'attributes': {'key': 'attributes', 'type': '{object}'}, + "name": {"key": "name", "type": "str"}, + "timestamp": {"key": "timestamp", "type": "iso-8601"}, + "attributes": {"key": "attributes", "type": "{object}"}, } def __init__( @@ -1610,14 +1606,17 @@ class Experiment(msrest.serialization.Model): """ _attribute_map = { - 'experiment_id': {'key': 'experimentId', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_utc': {'key': 'createdUtc', 'type': 'iso-8601'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'archived_time': {'key': 'archivedTime', 'type': 'iso-8601'}, - 'retain_for_lifetime_of_workspace': {'key': 'retainForLifetimeOfWorkspace', 'type': 'bool'}, - 'artifact_location': {'key': 'artifactLocation', 'type': 'str'}, + "experiment_id": {"key": "experimentId", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_utc": {"key": "createdUtc", "type": "iso-8601"}, + "tags": {"key": "tags", "type": "{str}"}, + "archived_time": {"key": "archivedTime", "type": "iso-8601"}, + "retain_for_lifetime_of_workspace": { + "key": "retainForLifetimeOfWorkspace", + "type": "bool", + }, + "artifact_location": {"key": "artifactLocation", "type": "str"}, } def __init__( @@ -1658,7 +1657,9 @@ def __init__( self.created_utc = created_utc self.tags = tags self.archived_time = archived_time - self.retain_for_lifetime_of_workspace = retain_for_lifetime_of_workspace + self.retain_for_lifetime_of_workspace = ( + retain_for_lifetime_of_workspace + ) self.artifact_location = artifact_location @@ -1686,11 +1687,11 @@ class ExperimentQueryParams(msrest.serialization.Model): """ _attribute_map = { - 'view_type': {'key': 'viewType', 'type': 'str'}, - 'filter': {'key': 'filter', 'type': 'str'}, - 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, - 'order_by': {'key': 'orderBy', 'type': 'str'}, - 'top': {'key': 'top', 'type': 'int'}, + "view_type": {"key": "viewType", "type": "str"}, + "filter": {"key": "filter", "type": "str"}, + "continuation_token": {"key": "continuationToken", "type": "str"}, + "order_by": {"key": "orderBy", "type": "str"}, + "top": {"key": "top", "type": "int"}, } def __init__( @@ -1747,10 +1748,16 @@ class GetRunDataRequest(msrest.serialization.Model): """ _attribute_map = { - 'run_id': {'key': 'runId', 'type': 'str'}, - 'select_run_metadata': {'key': 'selectRunMetadata', 'type': 'bool'}, - 'select_run_definition': {'key': 'selectRunDefinition', 'type': 'bool'}, - 'select_job_specification': {'key': 'selectJobSpecification', 'type': 'bool'}, + "run_id": {"key": "runId", "type": "str"}, + "select_run_metadata": {"key": "selectRunMetadata", "type": "bool"}, + "select_run_definition": { + "key": "selectRunDefinition", + "type": "bool", + }, + "select_job_specification": { + "key": "selectJobSpecification", + "type": "bool", + }, } def __init__( @@ -1791,9 +1798,9 @@ class GetRunDataResult(msrest.serialization.Model): """ _attribute_map = { - 'run_metadata': {'key': 'runMetadata', 'type': 'Run'}, - 'run_definition': {'key': 'runDefinition', 'type': 'object'}, - 'job_specification': {'key': 'jobSpecification', 'type': 'object'}, + "run_metadata": {"key": "runMetadata", "type": "Run"}, + "run_definition": {"key": "runDefinition", "type": "object"}, + "job_specification": {"key": "jobSpecification", "type": "object"}, } def __init__( @@ -1826,15 +1833,10 @@ class GetRunsByIds(msrest.serialization.Model): """ _attribute_map = { - 'run_ids': {'key': 'runIds', 'type': '[str]'}, + "run_ids": {"key": "runIds", "type": "[str]"}, } - def __init__( - self, - *, - run_ids: Optional[List[str]] = None, - **kwargs - ): + def __init__(self, *, run_ids: Optional[List[str]] = None, **kwargs): """ :keyword run_ids: :paramtype run_ids: list[str] @@ -1853,8 +1855,8 @@ class GetSampledMetricRequest(msrest.serialization.Model): """ _attribute_map = { - 'metric_name': {'key': 'metricName', 'type': 'str'}, - 'metric_namespace': {'key': 'metricNamespace', 'type': 'str'}, + "metric_name": {"key": "metricName", "type": "str"}, + "metric_namespace": {"key": "metricNamespace", "type": "str"}, } def __init__( @@ -1895,12 +1897,12 @@ class IMetricV2(msrest.serialization.Model): """ _attribute_map = { - 'data_container_id': {'key': 'dataContainerId', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'columns': {'key': 'columns', 'type': '{str}'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'standard_schema_id': {'key': 'standardSchemaId', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[MetricV2Value]'}, + "data_container_id": {"key": "dataContainerId", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "columns": {"key": "columns", "type": "{str}"}, + "namespace": {"key": "namespace", "type": "str"}, + "standard_schema_id": {"key": "standardSchemaId", "type": "str"}, + "value": {"key": "value", "type": "[MetricV2Value]"}, } def __init__( @@ -1950,8 +1952,8 @@ class InnerErrorResponse(msrest.serialization.Model): """ _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'inner_error': {'key': 'innerError', 'type': 'InnerErrorResponse'}, + "code": {"key": "code", "type": "str"}, + "inner_error": {"key": "innerError", "type": "InnerErrorResponse"}, } def __init__( @@ -1986,10 +1988,19 @@ class JobCost(msrest.serialization.Model): """ _attribute_map = { - 'charged_cpu_core_seconds': {'key': 'chargedCpuCoreSeconds', 'type': 'float'}, - 'charged_cpu_memory_megabyte_seconds': {'key': 'chargedCpuMemoryMegabyteSeconds', 'type': 'float'}, - 'charged_gpu_seconds': {'key': 'chargedGpuSeconds', 'type': 'float'}, - 'charged_node_utilization_seconds': {'key': 'chargedNodeUtilizationSeconds', 'type': 'float'}, + "charged_cpu_core_seconds": { + "key": "chargedCpuCoreSeconds", + "type": "float", + }, + "charged_cpu_memory_megabyte_seconds": { + "key": "chargedCpuMemoryMegabyteSeconds", + "type": "float", + }, + "charged_gpu_seconds": {"key": "chargedGpuSeconds", "type": "float"}, + "charged_node_utilization_seconds": { + "key": "chargedNodeUtilizationSeconds", + "type": "float", + }, } def __init__( @@ -2013,9 +2024,13 @@ def __init__( """ super(JobCost, self).__init__(**kwargs) self.charged_cpu_core_seconds = charged_cpu_core_seconds - self.charged_cpu_memory_megabyte_seconds = charged_cpu_memory_megabyte_seconds + self.charged_cpu_memory_megabyte_seconds = ( + charged_cpu_memory_megabyte_seconds + ) self.charged_gpu_seconds = charged_gpu_seconds - self.charged_node_utilization_seconds = charged_node_utilization_seconds + self.charged_node_utilization_seconds = ( + charged_node_utilization_seconds + ) class KeyValuePairBaseEventErrorResponse(msrest.serialization.Model): @@ -2028,8 +2043,8 @@ class KeyValuePairBaseEventErrorResponse(msrest.serialization.Model): """ _attribute_map = { - 'key': {'key': 'key', 'type': 'BaseEvent'}, - 'value': {'key': 'value', 'type': 'ErrorResponse'}, + "key": {"key": "key", "type": "BaseEvent"}, + "value": {"key": "value", "type": "ErrorResponse"}, } def __init__( @@ -2060,8 +2075,8 @@ class KeyValuePairString(msrest.serialization.Model): """ _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "key": {"key": "key", "type": "str"}, + "value": {"key": "value", "type": "str"}, } def __init__( @@ -2092,8 +2107,8 @@ class KeyValuePairStringJToken(msrest.serialization.Model): """ _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'object'}, + "key": {"key": "key", "type": "str"}, + "value": {"key": "value", "type": "object"}, } def __init__( @@ -2124,8 +2139,8 @@ class Link(msrest.serialization.Model): """ _attribute_map = { - 'context': {'key': 'context', 'type': 'SpanContext'}, - 'attributes': {'key': 'attributes', 'type': '{object}'}, + "context": {"key": "context", "type": "SpanContext"}, + "attributes": {"key": "attributes", "type": "{object}"}, } def __init__( @@ -2162,11 +2177,11 @@ class ListGenericResourceMetrics(msrest.serialization.Model): """ _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'metric_names': {'key': 'metricNames', 'type': '[str]'}, - 'label_filters': {'key': 'labelFilters', 'type': '{str}'}, - 'metric_namespace': {'key': 'metricNamespace', 'type': 'str'}, - 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, + "resource_id": {"key": "resourceId", "type": "str"}, + "metric_names": {"key": "metricNames", "type": "[str]"}, + "label_filters": {"key": "labelFilters", "type": "{str}"}, + "metric_namespace": {"key": "metricNamespace", "type": "str"}, + "continuation_token": {"key": "continuationToken", "type": "str"}, } def __init__( @@ -2209,8 +2224,8 @@ class ListMetrics(msrest.serialization.Model): """ _attribute_map = { - 'metric_namespace': {'key': 'metricNamespace', 'type': 'str'}, - 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, + "metric_namespace": {"key": "metricNamespace", "type": "str"}, + "continuation_token": {"key": "continuationToken", "type": "str"}, } def __init__( @@ -2243,9 +2258,9 @@ class MetricDefinition(msrest.serialization.Model): """ _attribute_map = { - 'metric_key': {'key': 'metricKey', 'type': 'DerivedMetricKey'}, - 'columns': {'key': 'columns', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': 'MetricProperties'}, + "metric_key": {"key": "metricKey", "type": "DerivedMetricKey"}, + "columns": {"key": "columns", "type": "{str}"}, + "properties": {"key": "properties", "type": "MetricProperties"}, } def __init__( @@ -2280,15 +2295,10 @@ class MetricProperties(msrest.serialization.Model): """ _attribute_map = { - 'ux_metric_type': {'key': 'uxMetricType', 'type': 'str'}, + "ux_metric_type": {"key": "uxMetricType", "type": "str"}, } - def __init__( - self, - *, - ux_metric_type: Optional[str] = None, - **kwargs - ): + def __init__(self, *, ux_metric_type: Optional[str] = None, **kwargs): """ :keyword ux_metric_type: String value UX uses to decide how to render your metrics Ex: azureml.v1.scalar or azureml.v1.table. @@ -2332,18 +2342,18 @@ class MetricSample(msrest.serialization.Model): """ _attribute_map = { - 'derived_label_values': {'key': 'derivedLabelValues', 'type': '{str}'}, - 'is_partial_result': {'key': 'isPartialResult', 'type': 'bool'}, - 'num_values_logged': {'key': 'numValuesLogged', 'type': 'long'}, - 'data_container_id': {'key': 'dataContainerId', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'columns': {'key': 'columns', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': 'MetricProperties'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'standard_schema_id': {'key': 'standardSchemaId', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[MetricV2Value]'}, - 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "derived_label_values": {"key": "derivedLabelValues", "type": "{str}"}, + "is_partial_result": {"key": "isPartialResult", "type": "bool"}, + "num_values_logged": {"key": "numValuesLogged", "type": "long"}, + "data_container_id": {"key": "dataContainerId", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "columns": {"key": "columns", "type": "{str}"}, + "properties": {"key": "properties", "type": "MetricProperties"}, + "namespace": {"key": "namespace", "type": "str"}, + "standard_schema_id": {"key": "standardSchemaId", "type": "str"}, + "value": {"key": "value", "type": "[MetricV2Value]"}, + "continuation_token": {"key": "continuationToken", "type": "str"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( @@ -2419,8 +2429,8 @@ class MetricSchema(msrest.serialization.Model): """ _attribute_map = { - 'num_properties': {'key': 'numProperties', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '[MetricSchemaProperty]'}, + "num_properties": {"key": "numProperties", "type": "int"}, + "properties": {"key": "properties", "type": "[MetricSchemaProperty]"}, } def __init__( @@ -2453,9 +2463,9 @@ class MetricSchemaProperty(msrest.serialization.Model): """ _attribute_map = { - 'property_id': {'key': 'propertyId', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + "property_id": {"key": "propertyId", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, } def __init__( @@ -2508,15 +2518,15 @@ class MetricV2(msrest.serialization.Model): """ _attribute_map = { - 'data_container_id': {'key': 'dataContainerId', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'columns': {'key': 'columns', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': 'MetricProperties'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'standard_schema_id': {'key': 'standardSchemaId', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[MetricV2Value]'}, - 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "data_container_id": {"key": "dataContainerId", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "columns": {"key": "columns", "type": "{str}"}, + "properties": {"key": "properties", "type": "MetricProperties"}, + "namespace": {"key": "namespace", "type": "str"}, + "standard_schema_id": {"key": "standardSchemaId", "type": "str"}, + "value": {"key": "value", "type": "[MetricV2Value]"}, + "continuation_token": {"key": "continuationToken", "type": "str"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( @@ -2589,10 +2599,10 @@ class MetricV2Value(msrest.serialization.Model): """ _attribute_map = { - 'metric_id': {'key': 'metricId', 'type': 'str'}, - 'created_utc': {'key': 'createdUtc', 'type': 'iso-8601'}, - 'step': {'key': 'step', 'type': 'long'}, - 'data': {'key': 'data', 'type': '{object}'}, + "metric_id": {"key": "metricId", "type": "str"}, + "created_utc": {"key": "createdUtc", "type": "iso-8601"}, + "step": {"key": "step", "type": "long"}, + "data": {"key": "data", "type": "{object}"}, } def __init__( @@ -2642,11 +2652,14 @@ class ModifyExperiment(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'archive': {'key': 'archive', 'type': 'bool'}, - 'retain_for_lifetime_of_workspace': {'key': 'retainForLifetimeOfWorkspace', 'type': 'bool'}, + "name": {"key": "name", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "archive": {"key": "archive", "type": "bool"}, + "retain_for_lifetime_of_workspace": { + "key": "retainForLifetimeOfWorkspace", + "type": "bool", + }, } def __init__( @@ -2676,7 +2689,9 @@ def __init__( self.description = description self.tags = tags self.archive = archive - self.retain_for_lifetime_of_workspace = retain_for_lifetime_of_workspace + self.retain_for_lifetime_of_workspace = ( + retain_for_lifetime_of_workspace + ) class OutputDatasetLineage(msrest.serialization.Model): @@ -2691,9 +2706,12 @@ class OutputDatasetLineage(msrest.serialization.Model): """ _attribute_map = { - 'identifier': {'key': 'identifier', 'type': 'DatasetIdentifier'}, - 'output_type': {'key': 'outputType', 'type': 'str'}, - 'output_details': {'key': 'outputDetails', 'type': 'DatasetOutputDetails'}, + "identifier": {"key": "identifier", "type": "DatasetIdentifier"}, + "output_type": {"key": "outputType", "type": "str"}, + "output_details": { + "key": "outputDetails", + "type": "DatasetOutputDetails", + }, } def __init__( @@ -2732,9 +2750,9 @@ class PaginatedArtifactContentInformationList(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[ArtifactContentInformation]'}, - 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[ArtifactContentInformation]"}, + "continuation_token": {"key": "continuationToken", "type": "str"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( @@ -2775,9 +2793,9 @@ class PaginatedArtifactList(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[Artifact]'}, - 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Artifact]"}, + "continuation_token": {"key": "continuationToken", "type": "str"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( @@ -2818,9 +2836,9 @@ class PaginatedExperimentList(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[Experiment]'}, - 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Experiment]"}, + "continuation_token": {"key": "continuationToken", "type": "str"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( @@ -2861,9 +2879,9 @@ class PaginatedMetricDefinitionList(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[MetricDefinition]'}, - 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[MetricDefinition]"}, + "continuation_token": {"key": "continuationToken", "type": "str"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( @@ -2904,9 +2922,9 @@ class PaginatedRunList(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[Run]'}, - 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Run]"}, + "continuation_token": {"key": "continuationToken", "type": "str"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( @@ -2947,9 +2965,9 @@ class PaginatedSpanDefinition1List(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[SpanDefinition1]'}, - 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[SpanDefinition1]"}, + "continuation_token": {"key": "continuationToken", "type": "str"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( @@ -2987,8 +3005,8 @@ class PostRunMetricsError(msrest.serialization.Model): """ _attribute_map = { - 'metric': {'key': 'metric', 'type': 'IMetricV2'}, - 'error_response': {'key': 'errorResponse', 'type': 'ErrorResponse'}, + "metric": {"key": "metric", "type": "IMetricV2"}, + "error_response": {"key": "errorResponse", "type": "ErrorResponse"}, } def __init__( @@ -3018,14 +3036,11 @@ class PostRunMetricsResult(msrest.serialization.Model): """ _attribute_map = { - 'errors': {'key': 'errors', 'type': '[PostRunMetricsError]'}, + "errors": {"key": "errors", "type": "[PostRunMetricsError]"}, } def __init__( - self, - *, - errors: Optional[List["PostRunMetricsError"]] = None, - **kwargs + self, *, errors: Optional[List["PostRunMetricsError"]] = None, **kwargs ): """ :keyword errors: @@ -3056,10 +3071,10 @@ class QueryParams(msrest.serialization.Model): """ _attribute_map = { - 'filter': {'key': 'filter', 'type': 'str'}, - 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, - 'order_by': {'key': 'orderBy', 'type': 'str'}, - 'top': {'key': 'top', 'type': 'int'}, + "filter": {"key": "filter", "type": "str"}, + "continuation_token": {"key": "continuationToken", "type": "str"}, + "order_by": {"key": "orderBy", "type": "str"}, + "top": {"key": "top", "type": "int"}, } def __init__( @@ -3109,9 +3124,12 @@ class QueueingInfo(msrest.serialization.Model): """ _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'last_refresh_timestamp': {'key': 'lastRefreshTimestamp', 'type': 'iso-8601'}, + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "last_refresh_timestamp": { + "key": "lastRefreshTimestamp", + "type": "iso-8601", + }, } def __init__( @@ -3152,11 +3170,11 @@ class RetrieveFullFidelityMetricRequest(msrest.serialization.Model): """ _attribute_map = { - 'metric_name': {'key': 'metricName', 'type': 'str'}, - 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'metric_namespace': {'key': 'metricNamespace', 'type': 'str'}, + "metric_name": {"key": "metricName", "type": "str"}, + "continuation_token": {"key": "continuationToken", "type": "str"}, + "start_time": {"key": "startTime", "type": "iso-8601"}, + "end_time": {"key": "endTime", "type": "iso-8601"}, + "metric_namespace": {"key": "metricNamespace", "type": "str"}, } def __init__( @@ -3220,17 +3238,20 @@ class RootError(msrest.serialization.Model): """ _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'severity': {'key': 'severity', 'type': 'int'}, - 'message': {'key': 'message', 'type': 'str'}, - 'message_format': {'key': 'messageFormat', 'type': 'str'}, - 'message_parameters': {'key': 'messageParameters', 'type': '{str}'}, - 'reference_code': {'key': 'referenceCode', 'type': 'str'}, - 'details_uri': {'key': 'detailsUri', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[RootError]'}, - 'inner_error': {'key': 'innerError', 'type': 'InnerErrorResponse'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + "code": {"key": "code", "type": "str"}, + "severity": {"key": "severity", "type": "int"}, + "message": {"key": "message", "type": "str"}, + "message_format": {"key": "messageFormat", "type": "str"}, + "message_parameters": {"key": "messageParameters", "type": "{str}"}, + "reference_code": {"key": "referenceCode", "type": "str"}, + "details_uri": {"key": "detailsUri", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[RootError]"}, + "inner_error": {"key": "innerError", "type": "InnerErrorResponse"}, + "additional_info": { + "key": "additionalInfo", + "type": "[ErrorAdditionalInfo]", + }, } def __init__( @@ -3429,75 +3450,90 @@ class Run(msrest.serialization.Model): """ _validation = { - 'unique_child_run_compute_targets': {'unique': True}, - 'input_datasets': {'unique': True}, - 'output_datasets': {'unique': True}, + "unique_child_run_compute_targets": {"unique": True}, + "input_datasets": {"unique": True}, + "output_datasets": {"unique": True}, } _attribute_map = { - 'run_number': {'key': 'runNumber', 'type': 'int'}, - 'root_run_id': {'key': 'rootRunId', 'type': 'str'}, - 'created_utc': {'key': 'createdUtc', 'type': 'iso-8601'}, - 'created_by': {'key': 'createdBy', 'type': 'User'}, - 'user_id': {'key': 'userId', 'type': 'str'}, - 'token': {'key': 'token', 'type': 'str'}, - 'token_expiry_time_utc': {'key': 'tokenExpiryTimeUtc', 'type': 'iso-8601'}, - 'error': {'key': 'error', 'type': 'ErrorResponse'}, - 'warnings': {'key': 'warnings', 'type': '[RunDetailsWarning]'}, - 'revision': {'key': 'revision', 'type': 'long'}, - 'status_revision': {'key': 'statusRevision', 'type': 'long'}, - 'run_uuid': {'key': 'runUuid', 'type': 'str'}, - 'parent_run_uuid': {'key': 'parentRunUuid', 'type': 'str'}, - 'root_run_uuid': {'key': 'rootRunUuid', 'type': 'str'}, - 'has_virtual_parent': {'key': 'hasVirtualParent', 'type': 'bool'}, - 'last_start_time_utc': {'key': 'lastStartTimeUtc', 'type': 'iso-8601'}, - 'current_compute_time': {'key': 'currentComputeTime', 'type': 'str'}, - 'compute_duration': {'key': 'computeDuration', 'type': 'str'}, - 'effective_start_time_utc': {'key': 'effectiveStartTimeUtc', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'User'}, - 'last_modified_utc': {'key': 'lastModifiedUtc', 'type': 'iso-8601'}, - 'duration': {'key': 'duration', 'type': 'str'}, - 'cancelation_reason': {'key': 'cancelationReason', 'type': 'str'}, - 'run_id': {'key': 'runId', 'type': 'str'}, - 'parent_run_id': {'key': 'parentRunId', 'type': 'str'}, - 'experiment_id': {'key': 'experimentId', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'start_time_utc': {'key': 'startTimeUtc', 'type': 'iso-8601'}, - 'end_time_utc': {'key': 'endTimeUtc', 'type': 'iso-8601'}, - 'options': {'key': 'options', 'type': 'RunOptions'}, - 'is_virtual': {'key': 'isVirtual', 'type': 'bool'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'data_container_id': {'key': 'dataContainerId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'hidden': {'key': 'hidden', 'type': 'bool'}, - 'run_type': {'key': 'runType', 'type': 'str'}, - 'run_type_v2': {'key': 'runTypeV2', 'type': 'RunTypeV2'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'parameters': {'key': 'parameters', 'type': '{object}'}, - 'action_uris': {'key': 'actionUris', 'type': '{str}'}, - 'script_name': {'key': 'scriptName', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'unique_child_run_compute_targets': {'key': 'uniqueChildRunComputeTargets', 'type': '[str]'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'settings': {'key': 'settings', 'type': '{str}'}, - 'services': {'key': 'services', 'type': '{EndpointSetting}'}, - 'input_datasets': {'key': 'inputDatasets', 'type': '[DatasetLineage]'}, - 'output_datasets': {'key': 'outputDatasets', 'type': '[OutputDatasetLineage]'}, - 'run_definition': {'key': 'runDefinition', 'type': 'object'}, - 'job_specification': {'key': 'jobSpecification', 'type': 'object'}, - 'primary_metric_name': {'key': 'primaryMetricName', 'type': 'str'}, - 'created_from': {'key': 'createdFrom', 'type': 'CreatedFrom'}, - 'cancel_uri': {'key': 'cancelUri', 'type': 'str'}, - 'complete_uri': {'key': 'completeUri', 'type': 'str'}, - 'diagnostics_uri': {'key': 'diagnosticsUri', 'type': 'str'}, - 'compute_request': {'key': 'computeRequest', 'type': 'ComputeRequest'}, - 'compute': {'key': 'compute', 'type': 'Compute'}, - 'retain_for_lifetime_of_workspace': {'key': 'retainForLifetimeOfWorkspace', 'type': 'bool'}, - 'queueing_info': {'key': 'queueingInfo', 'type': 'QueueingInfo'}, - 'active_child_run_id': {'key': 'activeChildRunId', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '{TypedAssetReference}'}, - 'outputs': {'key': 'outputs', 'type': '{TypedAssetReference}'}, + "run_number": {"key": "runNumber", "type": "int"}, + "root_run_id": {"key": "rootRunId", "type": "str"}, + "created_utc": {"key": "createdUtc", "type": "iso-8601"}, + "created_by": {"key": "createdBy", "type": "User"}, + "user_id": {"key": "userId", "type": "str"}, + "token": {"key": "token", "type": "str"}, + "token_expiry_time_utc": { + "key": "tokenExpiryTimeUtc", + "type": "iso-8601", + }, + "error": {"key": "error", "type": "ErrorResponse"}, + "warnings": {"key": "warnings", "type": "[RunDetailsWarning]"}, + "revision": {"key": "revision", "type": "long"}, + "status_revision": {"key": "statusRevision", "type": "long"}, + "run_uuid": {"key": "runUuid", "type": "str"}, + "parent_run_uuid": {"key": "parentRunUuid", "type": "str"}, + "root_run_uuid": {"key": "rootRunUuid", "type": "str"}, + "has_virtual_parent": {"key": "hasVirtualParent", "type": "bool"}, + "last_start_time_utc": {"key": "lastStartTimeUtc", "type": "iso-8601"}, + "current_compute_time": {"key": "currentComputeTime", "type": "str"}, + "compute_duration": {"key": "computeDuration", "type": "str"}, + "effective_start_time_utc": { + "key": "effectiveStartTimeUtc", + "type": "iso-8601", + }, + "last_modified_by": {"key": "lastModifiedBy", "type": "User"}, + "last_modified_utc": {"key": "lastModifiedUtc", "type": "iso-8601"}, + "duration": {"key": "duration", "type": "str"}, + "cancelation_reason": {"key": "cancelationReason", "type": "str"}, + "run_id": {"key": "runId", "type": "str"}, + "parent_run_id": {"key": "parentRunId", "type": "str"}, + "experiment_id": {"key": "experimentId", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "start_time_utc": {"key": "startTimeUtc", "type": "iso-8601"}, + "end_time_utc": {"key": "endTimeUtc", "type": "iso-8601"}, + "options": {"key": "options", "type": "RunOptions"}, + "is_virtual": {"key": "isVirtual", "type": "bool"}, + "display_name": {"key": "displayName", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "data_container_id": {"key": "dataContainerId", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "hidden": {"key": "hidden", "type": "bool"}, + "run_type": {"key": "runType", "type": "str"}, + "run_type_v2": {"key": "runTypeV2", "type": "RunTypeV2"}, + "properties": {"key": "properties", "type": "{str}"}, + "parameters": {"key": "parameters", "type": "{object}"}, + "action_uris": {"key": "actionUris", "type": "{str}"}, + "script_name": {"key": "scriptName", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "unique_child_run_compute_targets": { + "key": "uniqueChildRunComputeTargets", + "type": "[str]", + }, + "tags": {"key": "tags", "type": "{str}"}, + "settings": {"key": "settings", "type": "{str}"}, + "services": {"key": "services", "type": "{EndpointSetting}"}, + "input_datasets": {"key": "inputDatasets", "type": "[DatasetLineage]"}, + "output_datasets": { + "key": "outputDatasets", + "type": "[OutputDatasetLineage]", + }, + "run_definition": {"key": "runDefinition", "type": "object"}, + "job_specification": {"key": "jobSpecification", "type": "object"}, + "primary_metric_name": {"key": "primaryMetricName", "type": "str"}, + "created_from": {"key": "createdFrom", "type": "CreatedFrom"}, + "cancel_uri": {"key": "cancelUri", "type": "str"}, + "complete_uri": {"key": "completeUri", "type": "str"}, + "diagnostics_uri": {"key": "diagnosticsUri", "type": "str"}, + "compute_request": {"key": "computeRequest", "type": "ComputeRequest"}, + "compute": {"key": "compute", "type": "Compute"}, + "retain_for_lifetime_of_workspace": { + "key": "retainForLifetimeOfWorkspace", + "type": "bool", + }, + "queueing_info": {"key": "queueingInfo", "type": "QueueingInfo"}, + "active_child_run_id": {"key": "activeChildRunId", "type": "str"}, + "inputs": {"key": "inputs", "type": "{TypedAssetReference}"}, + "outputs": {"key": "outputs", "type": "{TypedAssetReference}"}, } def __init__( @@ -3746,7 +3782,9 @@ def __init__( self.action_uris = action_uris self.script_name = script_name self.target = target - self.unique_child_run_compute_targets = unique_child_run_compute_targets + self.unique_child_run_compute_targets = ( + unique_child_run_compute_targets + ) self.tags = tags self.settings = settings self.services = services @@ -3761,7 +3799,9 @@ def __init__( self.diagnostics_uri = diagnostics_uri self.compute_request = compute_request self.compute = compute - self.retain_for_lifetime_of_workspace = retain_for_lifetime_of_workspace + self.retain_for_lifetime_of_workspace = ( + retain_for_lifetime_of_workspace + ) self.queueing_info = queueing_info self.active_child_run_id = active_child_run_id self.inputs = inputs @@ -3861,52 +3901,58 @@ class RunDetails(msrest.serialization.Model): """ _validation = { - 'input_datasets': {'unique': True}, - 'output_datasets': {'unique': True}, + "input_datasets": {"unique": True}, + "output_datasets": {"unique": True}, } _attribute_map = { - 'run_id': {'key': 'runId', 'type': 'str'}, - 'run_uuid': {'key': 'runUuid', 'type': 'str'}, - 'parent_run_uuid': {'key': 'parentRunUuid', 'type': 'str'}, - 'root_run_uuid': {'key': 'rootRunUuid', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'parent_run_id': {'key': 'parentRunId', 'type': 'str'}, - 'created_time_utc': {'key': 'createdTimeUtc', 'type': 'iso-8601'}, - 'start_time_utc': {'key': 'startTimeUtc', 'type': 'iso-8601'}, - 'end_time_utc': {'key': 'endTimeUtc', 'type': 'iso-8601'}, - 'error': {'key': 'error', 'type': 'ErrorResponse'}, - 'warnings': {'key': 'warnings', 'type': '[RunDetailsWarning]'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'parameters': {'key': 'parameters', 'type': '{object}'}, - 'services': {'key': 'services', 'type': '{EndpointSetting}'}, - 'input_datasets': {'key': 'inputDatasets', 'type': '[DatasetLineage]'}, - 'output_datasets': {'key': 'outputDatasets', 'type': '[OutputDatasetLineage]'}, - 'run_definition': {'key': 'runDefinition', 'type': 'object'}, - 'log_files': {'key': 'logFiles', 'type': '{str}'}, - 'job_cost': {'key': 'jobCost', 'type': 'JobCost'}, - 'revision': {'key': 'revision', 'type': 'long'}, - 'run_type_v2': {'key': 'runTypeV2', 'type': 'RunTypeV2'}, - 'settings': {'key': 'settings', 'type': '{str}'}, - 'compute_request': {'key': 'computeRequest', 'type': 'ComputeRequest'}, - 'compute': {'key': 'compute', 'type': 'Compute'}, - 'created_by': {'key': 'createdBy', 'type': 'User'}, - 'compute_duration': {'key': 'computeDuration', 'type': 'str'}, - 'effective_start_time_utc': {'key': 'effectiveStartTimeUtc', 'type': 'iso-8601'}, - 'run_number': {'key': 'runNumber', 'type': 'int'}, - 'root_run_id': {'key': 'rootRunId', 'type': 'str'}, - 'user_id': {'key': 'userId', 'type': 'str'}, - 'status_revision': {'key': 'statusRevision', 'type': 'long'}, - 'has_virtual_parent': {'key': 'hasVirtualParent', 'type': 'bool'}, - 'current_compute_time': {'key': 'currentComputeTime', 'type': 'str'}, - 'last_start_time_utc': {'key': 'lastStartTimeUtc', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'User'}, - 'last_modified_utc': {'key': 'lastModifiedUtc', 'type': 'iso-8601'}, - 'duration': {'key': 'duration', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '{TypedAssetReference}'}, - 'outputs': {'key': 'outputs', 'type': '{TypedAssetReference}'}, + "run_id": {"key": "runId", "type": "str"}, + "run_uuid": {"key": "runUuid", "type": "str"}, + "parent_run_uuid": {"key": "parentRunUuid", "type": "str"}, + "root_run_uuid": {"key": "rootRunUuid", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "parent_run_id": {"key": "parentRunId", "type": "str"}, + "created_time_utc": {"key": "createdTimeUtc", "type": "iso-8601"}, + "start_time_utc": {"key": "startTimeUtc", "type": "iso-8601"}, + "end_time_utc": {"key": "endTimeUtc", "type": "iso-8601"}, + "error": {"key": "error", "type": "ErrorResponse"}, + "warnings": {"key": "warnings", "type": "[RunDetailsWarning]"}, + "tags": {"key": "tags", "type": "{str}"}, + "properties": {"key": "properties", "type": "{str}"}, + "parameters": {"key": "parameters", "type": "{object}"}, + "services": {"key": "services", "type": "{EndpointSetting}"}, + "input_datasets": {"key": "inputDatasets", "type": "[DatasetLineage]"}, + "output_datasets": { + "key": "outputDatasets", + "type": "[OutputDatasetLineage]", + }, + "run_definition": {"key": "runDefinition", "type": "object"}, + "log_files": {"key": "logFiles", "type": "{str}"}, + "job_cost": {"key": "jobCost", "type": "JobCost"}, + "revision": {"key": "revision", "type": "long"}, + "run_type_v2": {"key": "runTypeV2", "type": "RunTypeV2"}, + "settings": {"key": "settings", "type": "{str}"}, + "compute_request": {"key": "computeRequest", "type": "ComputeRequest"}, + "compute": {"key": "compute", "type": "Compute"}, + "created_by": {"key": "createdBy", "type": "User"}, + "compute_duration": {"key": "computeDuration", "type": "str"}, + "effective_start_time_utc": { + "key": "effectiveStartTimeUtc", + "type": "iso-8601", + }, + "run_number": {"key": "runNumber", "type": "int"}, + "root_run_id": {"key": "rootRunId", "type": "str"}, + "user_id": {"key": "userId", "type": "str"}, + "status_revision": {"key": "statusRevision", "type": "long"}, + "has_virtual_parent": {"key": "hasVirtualParent", "type": "bool"}, + "current_compute_time": {"key": "currentComputeTime", "type": "str"}, + "last_start_time_utc": {"key": "lastStartTimeUtc", "type": "iso-8601"}, + "last_modified_by": {"key": "lastModifiedBy", "type": "User"}, + "last_modified_utc": {"key": "lastModifiedUtc", "type": "iso-8601"}, + "duration": {"key": "duration", "type": "str"}, + "inputs": {"key": "inputs", "type": "{TypedAssetReference}"}, + "outputs": {"key": "outputs", "type": "{TypedAssetReference}"}, } def __init__( @@ -4099,8 +4145,8 @@ class RunDetailsWarning(msrest.serialization.Model): """ _attribute_map = { - 'source': {'key': 'source', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, + "source": {"key": "source", "type": "str"}, + "message": {"key": "message", "type": "str"}, } def __init__( @@ -4151,18 +4197,18 @@ class RunMetric(msrest.serialization.Model): """ _attribute_map = { - 'run_id': {'key': 'runId', 'type': 'str'}, - 'metric_id': {'key': 'metricId', 'type': 'str'}, - 'data_container_id': {'key': 'dataContainerId', 'type': 'str'}, - 'metric_type': {'key': 'metricType', 'type': 'str'}, - 'created_utc': {'key': 'createdUtc', 'type': 'iso-8601'}, - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, - 'num_cells': {'key': 'numCells', 'type': 'int'}, - 'data_location': {'key': 'dataLocation', 'type': 'str'}, - 'cells': {'key': 'cells', 'type': '[{object}]'}, - 'schema': {'key': 'schema', 'type': 'MetricSchema'}, + "run_id": {"key": "runId", "type": "str"}, + "metric_id": {"key": "metricId", "type": "str"}, + "data_container_id": {"key": "dataContainerId", "type": "str"}, + "metric_type": {"key": "metricType", "type": "str"}, + "created_utc": {"key": "createdUtc", "type": "iso-8601"}, + "name": {"key": "name", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "label": {"key": "label", "type": "str"}, + "num_cells": {"key": "numCells", "type": "int"}, + "data_location": {"key": "dataLocation", "type": "str"}, + "cells": {"key": "cells", "type": "[{object}]"}, + "schema": {"key": "schema", "type": "MetricSchema"}, } def __init__( @@ -4231,7 +4277,10 @@ class RunOptions(msrest.serialization.Model): """ _attribute_map = { - 'generate_data_container_id_if_not_specified': {'key': 'generateDataContainerIdIfNotSpecified', 'type': 'bool'}, + "generate_data_container_id_if_not_specified": { + "key": "generateDataContainerIdIfNotSpecified", + "type": "bool", + }, } def __init__( @@ -4245,7 +4294,9 @@ def __init__( :paramtype generate_data_container_id_if_not_specified: bool """ super(RunOptions, self).__init__(**kwargs) - self.generate_data_container_id_if_not_specified = generate_data_container_id_if_not_specified + self.generate_data_container_id_if_not_specified = ( + generate_data_container_id_if_not_specified + ) class RunServiceInstances(msrest.serialization.Model): @@ -4256,7 +4307,7 @@ class RunServiceInstances(msrest.serialization.Model): """ _attribute_map = { - 'instances': {'key': 'instances', 'type': '{ServiceInstanceResult}'}, + "instances": {"key": "instances", "type": "{ServiceInstanceResult}"}, } def __init__( @@ -4282,14 +4333,11 @@ class RunStatusSpans(msrest.serialization.Model): """ _attribute_map = { - 'spans': {'key': 'spans', 'type': '[SpanDefinition1]'}, + "spans": {"key": "spans", "type": "[SpanDefinition1]"}, } def __init__( - self, - *, - spans: Optional[List["SpanDefinition1"]] = None, - **kwargs + self, *, spans: Optional[List["SpanDefinition1"]] = None, **kwargs ): """ :keyword spans: @@ -4313,14 +4361,14 @@ class RunTypeV2(msrest.serialization.Model): """ _validation = { - 'traits': {'unique': True}, + "traits": {"unique": True}, } _attribute_map = { - 'orchestrator': {'key': 'orchestrator', 'type': 'str'}, - 'traits': {'key': 'traits', 'type': '[str]'}, - 'attribution': {'key': 'attribution', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "orchestrator": {"key": "orchestrator", "type": "str"}, + "traits": {"key": "traits", "type": "[str]"}, + "attribution": {"key": "attribution", "type": "str"}, + "compute_type": {"key": "computeType", "type": "str"}, } def __init__( @@ -4367,12 +4415,12 @@ class ServiceInstance(msrest.serialization.Model): """ _attribute_map = { - 'is_single_node': {'key': 'isSingleNode', 'type': 'bool'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'status': {'key': 'status', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'ErrorResponse'}, - 'properties': {'key': 'properties', 'type': '{str}'}, + "is_single_node": {"key": "isSingleNode", "type": "bool"}, + "error_message": {"key": "errorMessage", "type": "str"}, + "port": {"key": "port", "type": "int"}, + "status": {"key": "status", "type": "str"}, + "error": {"key": "error", "type": "ErrorResponse"}, + "properties": {"key": "properties", "type": "{str}"}, } def __init__( @@ -4427,12 +4475,12 @@ class ServiceInstanceResult(msrest.serialization.Model): """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'status': {'key': 'status', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'ErrorResponse'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, + "type": {"key": "type", "type": "str"}, + "port": {"key": "port", "type": "int"}, + "status": {"key": "status", "type": "str"}, + "error": {"key": "error", "type": "ErrorResponse"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, } def __init__( @@ -4496,11 +4544,11 @@ class SpanContext(msrest.serialization.Model): """ _attribute_map = { - 'trace_id': {'key': 'traceId', 'type': 'str'}, - 'span_id': {'key': 'spanId', 'type': 'str'}, - 'is_remote': {'key': 'isRemote', 'type': 'bool'}, - 'is_valid': {'key': 'isValid', 'type': 'bool'}, - 'tracestate': {'key': 'tracestate', 'type': '[KeyValuePairString]'}, + "trace_id": {"key": "traceId", "type": "str"}, + "span_id": {"key": "spanId", "type": "str"}, + "is_remote": {"key": "isRemote", "type": "bool"}, + "is_valid": {"key": "isValid", "type": "bool"}, + "tracestate": {"key": "tracestate", "type": "[KeyValuePairString]"}, } def __init__( @@ -4546,49 +4594,52 @@ def __init__( class SpanDefinition1(msrest.serialization.Model): """Most of the code in this class is vendored from here. -https://github.com/open-telemetry/opentelemetry-dotnet/blob/master/src/OpenTelemetry/Trace/Export/SpanData.cs -SpanData on that github link is readonly, we can't set properties on it after creation. So, just vendoring the Span -contract. -TStatus is the status enum. For runs, it is RunStatus -This is the link for span spec https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/overview.md#span. - - :ivar context: - :vartype context: ~azure.mgmt.machinelearningservices.models.SpanContext - :ivar name: Gets span name. - :vartype name: str - :ivar status: Gets span status. - OpenTelemetry sets it to - https://github.com/open-telemetry/opentelemetry-dotnet/blob/master/src/OpenTelemetry.Api/Trace/Status.cs - That status enums are not very meaningful to us, so we customize this. Possible values - include: "NotStarted", "Unapproved", "Pausing", "Paused", "Starting", "Preparing", "Queued", - "Running", "Finalizing", "CancelRequested", "Completed", "Failed", "Canceled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.RunStatus - :ivar parent_span_id: Gets parent span id. - TODO: In actual spec, it is ActivitySpanId type. But that causes problems in - serialization/deserialization. - :vartype parent_span_id: str - :ivar attributes: Gets attributes. - :vartype attributes: list[~azure.mgmt.machinelearningservices.models.KeyValuePairStringJToken] - :ivar events: Gets events. - :vartype events: list[~azure.mgmt.machinelearningservices.models.Event] - :ivar links: Gets links. - :vartype links: list[~azure.mgmt.machinelearningservices.models.Link] - :ivar start_timestamp: Gets span start timestamp. - :vartype start_timestamp: ~datetime.datetime - :ivar end_timestamp: Gets span end timestamp. - :vartype end_timestamp: ~datetime.datetime + https://github.com/open-telemetry/opentelemetry-dotnet/blob/master/src/OpenTelemetry/Trace/Export/SpanData.cs + SpanData on that github link is readonly, we can't set properties on it after creation. So, just vendoring the Span + contract. + TStatus is the status enum. For runs, it is RunStatus + This is the link for span spec https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/overview.md#span. + + :ivar context: + :vartype context: ~azure.mgmt.machinelearningservices.models.SpanContext + :ivar name: Gets span name. + :vartype name: str + :ivar status: Gets span status. + OpenTelemetry sets it to + https://github.com/open-telemetry/opentelemetry-dotnet/blob/master/src/OpenTelemetry.Api/Trace/Status.cs + That status enums are not very meaningful to us, so we customize this. Possible values + include: "NotStarted", "Unapproved", "Pausing", "Paused", "Starting", "Preparing", "Queued", + "Running", "Finalizing", "CancelRequested", "Completed", "Failed", "Canceled". + :vartype status: str or ~azure.mgmt.machinelearningservices.models.RunStatus + :ivar parent_span_id: Gets parent span id. + TODO: In actual spec, it is ActivitySpanId type. But that causes problems in + serialization/deserialization. + :vartype parent_span_id: str + :ivar attributes: Gets attributes. + :vartype attributes: list[~azure.mgmt.machinelearningservices.models.KeyValuePairStringJToken] + :ivar events: Gets events. + :vartype events: list[~azure.mgmt.machinelearningservices.models.Event] + :ivar links: Gets links. + :vartype links: list[~azure.mgmt.machinelearningservices.models.Link] + :ivar start_timestamp: Gets span start timestamp. + :vartype start_timestamp: ~datetime.datetime + :ivar end_timestamp: Gets span end timestamp. + :vartype end_timestamp: ~datetime.datetime """ _attribute_map = { - 'context': {'key': 'context', 'type': 'SpanContext'}, - 'name': {'key': 'name', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'parent_span_id': {'key': 'parentSpanId', 'type': 'str'}, - 'attributes': {'key': 'attributes', 'type': '[KeyValuePairStringJToken]'}, - 'events': {'key': 'events', 'type': '[Event]'}, - 'links': {'key': 'links', 'type': '[Link]'}, - 'start_timestamp': {'key': 'startTimestamp', 'type': 'iso-8601'}, - 'end_timestamp': {'key': 'endTimestamp', 'type': 'iso-8601'}, + "context": {"key": "context", "type": "SpanContext"}, + "name": {"key": "name", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "parent_span_id": {"key": "parentSpanId", "type": "str"}, + "attributes": { + "key": "attributes", + "type": "[KeyValuePairStringJToken]", + }, + "events": {"key": "events", "type": "[Event]"}, + "links": {"key": "links", "type": "[Link]"}, + "start_timestamp": {"key": "startTimestamp", "type": "iso-8601"}, + "end_timestamp": {"key": "endTimestamp", "type": "iso-8601"}, } def __init__( @@ -4660,10 +4711,16 @@ class SqlDataPath(msrest.serialization.Model): """ _attribute_map = { - 'sql_table_name': {'key': 'sqlTableName', 'type': 'str'}, - 'sql_query': {'key': 'sqlQuery', 'type': 'str'}, - 'sql_stored_procedure_name': {'key': 'sqlStoredProcedureName', 'type': 'str'}, - 'sql_stored_procedure_params': {'key': 'sqlStoredProcedureParams', 'type': '[StoredProcedureParameter]'}, + "sql_table_name": {"key": "sqlTableName", "type": "str"}, + "sql_query": {"key": "sqlQuery", "type": "str"}, + "sql_stored_procedure_name": { + "key": "sqlStoredProcedureName", + "type": "str", + }, + "sql_stored_procedure_params": { + "key": "sqlStoredProcedureParams", + "type": "[StoredProcedureParameter]", + }, } def __init__( @@ -4672,7 +4729,9 @@ def __init__( sql_table_name: Optional[str] = None, sql_query: Optional[str] = None, sql_stored_procedure_name: Optional[str] = None, - sql_stored_procedure_params: Optional[List["StoredProcedureParameter"]] = None, + sql_stored_procedure_params: Optional[ + List["StoredProcedureParameter"] + ] = None, **kwargs ): """ @@ -4705,9 +4764,9 @@ class StoredProcedureParameter(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "type": {"key": "type", "type": "str"}, } def __init__( @@ -4742,8 +4801,8 @@ class TypedAssetReference(msrest.serialization.Model): """ _attribute_map = { - 'asset_id': {'key': 'assetId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + "asset_id": {"key": "assetId", "type": "str"}, + "type": {"key": "type", "type": "str"}, } def __init__( @@ -4794,14 +4853,14 @@ class User(msrest.serialization.Model): """ _attribute_map = { - 'user_object_id': {'key': 'userObjectId', 'type': 'str'}, - 'user_pu_id': {'key': 'userPuId', 'type': 'str'}, - 'user_idp': {'key': 'userIdp', 'type': 'str'}, - 'user_alt_sec_id': {'key': 'userAltSecId', 'type': 'str'}, - 'user_iss': {'key': 'userIss', 'type': 'str'}, - 'user_tenant_id': {'key': 'userTenantId', 'type': 'str'}, - 'user_name': {'key': 'userName', 'type': 'str'}, - 'upn': {'key': 'upn', 'type': 'str'}, + "user_object_id": {"key": "userObjectId", "type": "str"}, + "user_pu_id": {"key": "userPuId", "type": "str"}, + "user_idp": {"key": "userIdp", "type": "str"}, + "user_alt_sec_id": {"key": "userAltSecId", "type": "str"}, + "user_iss": {"key": "userIss", "type": "str"}, + "user_tenant_id": {"key": "userTenantId", "type": "str"}, + "user_name": {"key": "userName", "type": "str"}, + "upn": {"key": "upn", "type": "str"}, } def __init__( diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/operations/__init__.py index 3e84a44acc59..aab5d99d55d1 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/operations/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/operations/__init__.py @@ -16,12 +16,12 @@ from ._spans_operations import SpansOperations __all__ = [ - 'DeleteOperations', - 'EventsOperations', - 'ExperimentsOperations', - 'MetricOperations', - 'RunsOperations', - 'RunArtifactsOperations', - 'RunOperations', - 'SpansOperations', + "DeleteOperations", + "EventsOperations", + "ExperimentsOperations", + "MetricOperations", + "RunsOperations", + "RunArtifactsOperations", + "RunOperations", + "SpansOperations", ] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/operations/_delete_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/operations/_delete_operations.py index 9080611e35f1..a5968a9fee1c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/operations/_delete_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/operations/_delete_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest @@ -23,8 +29,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -93,6 +105,7 @@ def build_get_configuration_request( **kwargs ) + # fmt: on class DeleteOperations(object): """DeleteOperations operations. @@ -141,16 +154,22 @@ def patch_configuration( :rtype: ~azure.mgmt.machinelearningservices.models.DeleteConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DeleteConfiguration"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DeleteConfiguration"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'DeleteConfiguration') + _json = self._serialize.body(body, "DeleteConfiguration") else: _json = None @@ -160,32 +179,41 @@ def patch_configuration( workspace_name=workspace_name, content_type=content_type, json=_json, - template_url=self.patch_configuration.metadata['url'], + template_url=self.patch_configuration.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DeleteConfiguration', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "DeleteConfiguration", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - patch_configuration.metadata = {'url': "/history/v1.0/private/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/deleteConfiguration"} # type: ignore - + patch_configuration.metadata = {"url": "/history/v1.0/private/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/deleteConfiguration"} # type: ignore @distributed_trace def get_configuration( @@ -209,40 +237,52 @@ def get_configuration( :rtype: ~azure.mgmt.machinelearningservices.models.DeleteConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DeleteConfiguration"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DeleteConfiguration"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_configuration_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.get_configuration.metadata['url'], + template_url=self.get_configuration.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DeleteConfiguration', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "DeleteConfiguration", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_configuration.metadata = {'url': "/history/v1.0/private/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/deleteConfiguration"} # type: ignore - + get_configuration.metadata = {"url": "/history/v1.0/private/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/deleteConfiguration"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/operations/_events_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/operations/_events_operations.py index f87546d92eff..ad19224331d8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/operations/_events_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/operations/_events_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest @@ -23,8 +29,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -247,6 +259,7 @@ def build_post_request( **kwargs ) + # fmt: on class EventsOperations(object): """EventsOperations operations. @@ -298,16 +311,22 @@ def batch_post_by_experiment_name( :rtype: ~azure.mgmt.machinelearningservices.models.BatchEventCommandResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEventCommandResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchEventCommandResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'BatchEventCommand') + _json = self._serialize.body(body, "BatchEventCommand") else: _json = None @@ -318,32 +337,41 @@ def batch_post_by_experiment_name( experiment_name=experiment_name, content_type=content_type, json=_json, - template_url=self.batch_post_by_experiment_name.metadata['url'], + template_url=self.batch_post_by_experiment_name.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('BatchEventCommandResult', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "BatchEventCommandResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - batch_post_by_experiment_name.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/batch/events"} # type: ignore - + batch_post_by_experiment_name.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/batch/events"} # type: ignore @distributed_trace def batch_post_by_experiment_id( @@ -373,16 +401,22 @@ def batch_post_by_experiment_id( :rtype: ~azure.mgmt.machinelearningservices.models.BatchEventCommandResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEventCommandResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchEventCommandResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'BatchEventCommand') + _json = self._serialize.body(body, "BatchEventCommand") else: _json = None @@ -393,32 +427,41 @@ def batch_post_by_experiment_id( experiment_id=experiment_id, content_type=content_type, json=_json, - template_url=self.batch_post_by_experiment_id.metadata['url'], + template_url=self.batch_post_by_experiment_id.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('BatchEventCommandResult', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "BatchEventCommandResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - batch_post_by_experiment_id.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/batch/events"} # type: ignore - + batch_post_by_experiment_id.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/batch/events"} # type: ignore @distributed_trace def batch_post( @@ -445,16 +488,22 @@ def batch_post( :rtype: ~azure.mgmt.machinelearningservices.models.BatchEventCommandResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEventCommandResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchEventCommandResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'BatchEventCommand') + _json = self._serialize.body(body, "BatchEventCommand") else: _json = None @@ -464,32 +513,41 @@ def batch_post( workspace_name=workspace_name, content_type=content_type, json=_json, - template_url=self.batch_post.metadata['url'], + template_url=self.batch_post.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('BatchEventCommandResult', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "BatchEventCommandResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - batch_post.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batch/events"} # type: ignore - + batch_post.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batch/events"} # type: ignore @distributed_trace def post_by_experiment_name( # pylint: disable=inconsistent-return-statements @@ -522,16 +580,20 @@ def post_by_experiment_name( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'BaseEvent') + _json = self._serialize.body(body, "BaseEvent") else: _json = None @@ -543,28 +605,35 @@ def post_by_experiment_name( # pylint: disable=inconsistent-return-statements experiment_name=experiment_name, content_type=content_type, json=_json, - template_url=self.post_by_experiment_name.metadata['url'], + template_url=self.post_by_experiment_name.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in []: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - post_by_experiment_name.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/events"} # type: ignore - + post_by_experiment_name.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/events"} # type: ignore @distributed_trace def post_by_experiment_id( # pylint: disable=inconsistent-return-statements @@ -597,16 +666,20 @@ def post_by_experiment_id( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'BaseEvent') + _json = self._serialize.body(body, "BaseEvent") else: _json = None @@ -618,28 +691,35 @@ def post_by_experiment_id( # pylint: disable=inconsistent-return-statements experiment_id=experiment_id, content_type=content_type, json=_json, - template_url=self.post_by_experiment_id.metadata['url'], + template_url=self.post_by_experiment_id.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in []: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - post_by_experiment_id.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/events"} # type: ignore - + post_by_experiment_id.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/events"} # type: ignore @distributed_trace def post( # pylint: disable=inconsistent-return-statements @@ -669,16 +749,20 @@ def post( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'BaseEvent') + _json = self._serialize.body(body, "BaseEvent") else: _json = None @@ -689,25 +773,32 @@ def post( # pylint: disable=inconsistent-return-statements run_id=run_id, content_type=content_type, json=_json, - template_url=self.post.metadata['url'], + template_url=self.post.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in []: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - post.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/events"} # type: ignore - + post.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/events"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/operations/_experiments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/operations/_experiments_operations.py index 3b12b9c15bce..745b2bf9159a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/operations/_experiments_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/operations/_experiments_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -273,6 +285,7 @@ def build_delete_tags_request( **kwargs ) + # fmt: on class ExperimentsOperations(object): """ExperimentsOperations operations. @@ -323,44 +336,52 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.Experiment :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Experiment"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Experiment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, experiment_name=experiment_name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Experiment', pipeline_response) + deserialized = self._deserialize("Experiment", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}"} # type: ignore - + get.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}"} # type: ignore @distributed_trace def create( @@ -389,44 +410,52 @@ def create( :rtype: ~azure.mgmt.machinelearningservices.models.Experiment :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Experiment"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Experiment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_create_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, experiment_name=experiment_name, - template_url=self.create.metadata['url'], + template_url=self.create.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Experiment', pipeline_response) + deserialized = self._deserialize("Experiment", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}"} # type: ignore - + create.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}"} # type: ignore @distributed_trace def get_by_id( @@ -455,44 +484,52 @@ def get_by_id( :rtype: ~azure.mgmt.machinelearningservices.models.Experiment :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Experiment"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Experiment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_by_id_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, experiment_id=experiment_id, - template_url=self.get_by_id.metadata['url'], + template_url=self.get_by_id.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Experiment', pipeline_response) + deserialized = self._deserialize("Experiment", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_by_id.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}"} # type: ignore - + get_by_id.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}"} # type: ignore @distributed_trace def update( @@ -524,16 +561,20 @@ def update( :rtype: ~azure.mgmt.machinelearningservices.models.Experiment :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Experiment"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Experiment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'ModifyExperiment') + _json = self._serialize.body(body, "ModifyExperiment") else: _json = None @@ -544,32 +585,39 @@ def update( experiment_id=experiment_id, content_type=content_type, json=_json, - template_url=self.update.metadata['url'], + template_url=self.update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Experiment', pipeline_response) + deserialized = self._deserialize("Experiment", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}"} # type: ignore - + update.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}"} # type: ignore def _delete_initial( self, @@ -580,43 +628,49 @@ def _delete_initial( **kwargs # type: Any ): # type: (...) -> Any - cls = kwargs.pop('cls', None) # type: ClsType[Any] + cls = kwargs.pop("cls", None) # type: ClsType[Any] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request_initial( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, experiment_id=experiment_id, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('object', pipeline_response) + deserialized = self._deserialize("object", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _delete_initial.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}"} # type: ignore - + _delete_initial.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}"} # type: ignore @distributed_trace def begin_delete( @@ -652,45 +706,56 @@ def begin_delete( :rtype: ~azure.core.polling.LROPoller[any] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[Any] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[Any] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, experiment_id=experiment_id, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('object', pipeline_response) + deserialized = self._deserialize("object", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}"} # type: ignore + begin_delete.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}"} # type: ignore @distributed_trace def get_by_query( @@ -724,20 +789,27 @@ def get_by_query( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedExperimentList] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedExperimentList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedExperimentList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: if body is not None: - _json = self._serialize.body(body, 'ExperimentQueryParams') + _json = self._serialize.body(body, "ExperimentQueryParams") else: _json = None - + request = build_get_by_query_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -745,17 +817,17 @@ def prepare_request(next_link=None): content_type=content_type, json=_json, url_safe_experiment_names_only=url_safe_experiment_names_only, - template_url=self.get_by_query.metadata['url'], + template_url=self.get_by_query.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: if body is not None: - _json = self._serialize.body(body, 'ExperimentQueryParams') + _json = self._serialize.body(body, "ExperimentQueryParams") else: _json = None - + request = build_get_by_query_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -771,7 +843,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedExperimentList", pipeline_response) + deserialized = self._deserialize( + "PaginatedExperimentList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -780,25 +854,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - get_by_query.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments:query"} # type: ignore + get_by_query.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments:query"} # type: ignore @distributed_trace def delete_tags( @@ -830,16 +910,22 @@ def delete_tags( :rtype: ~azure.mgmt.machinelearningservices.models.DeleteExperimentTagsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DeleteExperimentTagsResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DeleteExperimentTagsResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'DeleteTagsCommand') + _json = self._serialize.body(body, "DeleteTagsCommand") else: _json = None @@ -850,29 +936,38 @@ def delete_tags( experiment_id=experiment_id, content_type=content_type, json=_json, - template_url=self.delete_tags.metadata['url'], + template_url=self.delete_tags.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DeleteExperimentTagsResult', pipeline_response) + deserialized = self._deserialize( + "DeleteExperimentTagsResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - delete_tags.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/tags:delete"} # type: ignore - + delete_tags.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/tags:delete"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/operations/_metric_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/operations/_metric_operations.py index f91845544203..5d46f1ca3f9a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/operations/_metric_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/operations/_metric_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -344,6 +356,7 @@ def build_get_metric_details_by_experiment_id_request( **kwargs ) + # fmt: on class MetricOperations(object): """MetricOperations operations. @@ -397,16 +410,22 @@ def get_full_fidelity_metric( :rtype: ~azure.mgmt.machinelearningservices.models.MetricV2 :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.MetricV2"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.MetricV2"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'RetrieveFullFidelityMetricRequest') + _json = self._serialize.body( + body, "RetrieveFullFidelityMetricRequest" + ) else: _json = None @@ -417,32 +436,39 @@ def get_full_fidelity_metric( run_id=run_id, content_type=content_type, json=_json, - template_url=self.get_full_fidelity_metric.metadata['url'], + template_url=self.get_full_fidelity_metric.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('MetricV2', pipeline_response) + deserialized = self._deserialize("MetricV2", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_full_fidelity_metric.metadata = {'url': "/metric/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/full"} # type: ignore - + get_full_fidelity_metric.metadata = {"url": "/metric/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/full"} # type: ignore @distributed_trace def list_metric( @@ -476,20 +502,27 @@ def list_metric( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedMetricDefinitionList] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedMetricDefinitionList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedMetricDefinitionList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: if body is not None: - _json = self._serialize.body(body, 'ListMetrics') + _json = self._serialize.body(body, "ListMetrics") else: _json = None - + request = build_list_metric_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -497,17 +530,17 @@ def prepare_request(next_link=None): run_id=run_id, content_type=content_type, json=_json, - template_url=self.list_metric.metadata['url'], + template_url=self.list_metric.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: if body is not None: - _json = self._serialize.body(body, 'ListMetrics') + _json = self._serialize.body(body, "ListMetrics") else: _json = None - + request = build_list_metric_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -523,7 +556,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedMetricDefinitionList", pipeline_response) + deserialized = self._deserialize( + "PaginatedMetricDefinitionList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -532,25 +567,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_metric.metadata = {'url': "/metric/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/list"} # type: ignore + list_metric.metadata = {"url": "/metric/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/list"} # type: ignore @distributed_trace def list_generic_resource_metrics( @@ -581,37 +622,50 @@ def list_generic_resource_metrics( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedMetricDefinitionList] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedMetricDefinitionList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedMetricDefinitionList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: if body is not None: - _json = self._serialize.body(body, 'ListGenericResourceMetrics') + _json = self._serialize.body( + body, "ListGenericResourceMetrics" + ) else: _json = None - + request = build_list_generic_resource_metrics_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, content_type=content_type, json=_json, - template_url=self.list_generic_resource_metrics.metadata['url'], + template_url=self.list_generic_resource_metrics.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: if body is not None: - _json = self._serialize.body(body, 'ListGenericResourceMetrics') + _json = self._serialize.body( + body, "ListGenericResourceMetrics" + ) else: _json = None - + request = build_list_generic_resource_metrics_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -626,7 +680,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedMetricDefinitionList", pipeline_response) + deserialized = self._deserialize( + "PaginatedMetricDefinitionList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -635,25 +691,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_generic_resource_metrics.metadata = {'url': "/metric/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/azuremonitor/list"} # type: ignore + list_generic_resource_metrics.metadata = {"url": "/metric/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/azuremonitor/list"} # type: ignore @distributed_trace def get_sampled_metric( @@ -689,16 +751,20 @@ def get_sampled_metric( :rtype: ~azure.mgmt.machinelearningservices.models.MetricSample :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.MetricSample"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.MetricSample"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'GetSampledMetricRequest') + _json = self._serialize.body(body, "GetSampledMetricRequest") else: _json = None @@ -709,32 +775,39 @@ def get_sampled_metric( run_id=run_id, content_type=content_type, json=_json, - template_url=self.get_sampled_metric.metadata['url'], + template_url=self.get_sampled_metric.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('MetricSample', pipeline_response) + deserialized = self._deserialize("MetricSample", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_sampled_metric.metadata = {'url': "/metric/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/sample"} # type: ignore - + get_sampled_metric.metadata = {"url": "/metric/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/sample"} # type: ignore @distributed_trace def post_run_metrics( @@ -766,16 +839,22 @@ def post_run_metrics( :rtype: ~azure.mgmt.machinelearningservices.models.PostRunMetricsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PostRunMetricsResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PostRunMetricsResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'BatchIMetricV2') + _json = self._serialize.body(body, "BatchIMetricV2") else: _json = None @@ -786,36 +865,47 @@ def post_run_metrics( run_id=run_id, content_type=content_type, json=_json, - template_url=self.post_run_metrics.metadata['url'], + template_url=self.post_run_metrics.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 207]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('PostRunMetricsResult', pipeline_response) + deserialized = self._deserialize( + "PostRunMetricsResult", pipeline_response + ) if response.status_code == 207: - deserialized = self._deserialize('PostRunMetricsResult', pipeline_response) + deserialized = self._deserialize( + "PostRunMetricsResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - post_run_metrics.metadata = {'url': "/metric/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/batch"} # type: ignore - + post_run_metrics.metadata = {"url": "/metric/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/batch"} # type: ignore def _delete_metrics_by_data_container_id_initial( self, @@ -827,44 +917,52 @@ def _delete_metrics_by_data_container_id_initial( **kwargs # type: Any ): # type: (...) -> Any - cls = kwargs.pop('cls', None) # type: ClsType[Any] + cls = kwargs.pop("cls", None) # type: ClsType[Any] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_metrics_by_data_container_id_request_initial( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, experiment_id=experiment_id, data_container_id=data_container_id, - template_url=self._delete_metrics_by_data_container_id_initial.metadata['url'], + template_url=self._delete_metrics_by_data_container_id_initial.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('object', pipeline_response) + deserialized = self._deserialize("object", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _delete_metrics_by_data_container_id_initial.metadata = {'url': "/metric/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentId}/containers/{dataContainerId}/deleteMetrics"} # type: ignore - + _delete_metrics_by_data_container_id_initial.metadata = {"url": "/metric/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentId}/containers/{dataContainerId}/deleteMetrics"} # type: ignore @distributed_trace def begin_delete_metrics_by_data_container_id( @@ -903,13 +1001,16 @@ def begin_delete_metrics_by_data_container_id( :rtype: ~azure.core.polling.LROPoller[any] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[Any] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[Any] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_metrics_by_data_container_id_initial( subscription_id=subscription_id, @@ -917,32 +1018,40 @@ def begin_delete_metrics_by_data_container_id( workspace_name=workspace_name, experiment_id=experiment_id, data_container_id=data_container_id, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('object', pipeline_response) + deserialized = self._deserialize("object", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete_metrics_by_data_container_id.metadata = {'url': "/metric/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentId}/containers/{dataContainerId}/deleteMetrics"} # type: ignore + begin_delete_metrics_by_data_container_id.metadata = {"url": "/metric/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentId}/containers/{dataContainerId}/deleteMetrics"} # type: ignore def _delete_metrics_by_run_id_initial( self, @@ -953,43 +1062,51 @@ def _delete_metrics_by_run_id_initial( **kwargs # type: Any ): # type: (...) -> Any - cls = kwargs.pop('cls', None) # type: ClsType[Any] + cls = kwargs.pop("cls", None) # type: ClsType[Any] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_metrics_by_run_id_request_initial( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, run_id=run_id, - template_url=self._delete_metrics_by_run_id_initial.metadata['url'], + template_url=self._delete_metrics_by_run_id_initial.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('object', pipeline_response) + deserialized = self._deserialize("object", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _delete_metrics_by_run_id_initial.metadata = {'url': "/metric/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/deleteMetrics"} # type: ignore - + _delete_metrics_by_run_id_initial.metadata = {"url": "/metric/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/deleteMetrics"} # type: ignore @distributed_trace def begin_delete_metrics_by_run_id( @@ -1025,45 +1142,56 @@ def begin_delete_metrics_by_run_id( :rtype: ~azure.core.polling.LROPoller[any] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[Any] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[Any] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_metrics_by_run_id_initial( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, run_id=run_id, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('object', pipeline_response) + deserialized = self._deserialize("object", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete_metrics_by_run_id.metadata = {'url': "/metric/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/deleteMetrics"} # type: ignore + begin_delete_metrics_by_run_id.metadata = {"url": "/metric/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/deleteMetrics"} # type: ignore @distributed_trace def get_metric_details_by_experiment_name( @@ -1095,45 +1223,55 @@ def get_metric_details_by_experiment_name( :rtype: ~azure.mgmt.machinelearningservices.models.RunMetric :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RunMetric"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.RunMetric"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_metric_details_by_experiment_name_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, metric_id=metric_id, experiment_name=experiment_name, - template_url=self.get_metric_details_by_experiment_name.metadata['url'], + template_url=self.get_metric_details_by_experiment_name.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('RunMetric', pipeline_response) + deserialized = self._deserialize("RunMetric", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_metric_details_by_experiment_name.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/metrics/{metricId}"} # type: ignore - + get_metric_details_by_experiment_name.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/metrics/{metricId}"} # type: ignore @distributed_trace def get_metric_details_by_experiment_id( @@ -1165,42 +1303,52 @@ def get_metric_details_by_experiment_id( :rtype: ~azure.mgmt.machinelearningservices.models.RunMetric :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RunMetric"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.RunMetric"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_metric_details_by_experiment_id_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, metric_id=metric_id, experiment_id=experiment_id, - template_url=self.get_metric_details_by_experiment_id.metadata['url'], + template_url=self.get_metric_details_by_experiment_id.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('RunMetric', pipeline_response) + deserialized = self._deserialize("RunMetric", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_metric_details_by_experiment_id.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/metrics/{metricId}"} # type: ignore - + get_metric_details_by_experiment_id.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/metrics/{metricId}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/operations/_run_artifacts_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/operations/_run_artifacts_operations.py index c7dd5930a99f..8d5b70b2de7d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/operations/_run_artifacts_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/operations/_run_artifacts_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -622,6 +634,7 @@ def build_batch_create_empty_artifacts_by_experiment_id_request( **kwargs ) + # fmt: on class RunArtifactsOperations(object): """RunArtifactsOperations operations. @@ -678,14 +691,19 @@ def list_in_container_by_experiment_name( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedArtifactList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedArtifactList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedArtifactList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_in_container_by_experiment_name_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -693,13 +711,15 @@ def prepare_request(next_link=None): run_id=run_id, experiment_name=experiment_name, continuation_token_parameter=continuation_token_parameter, - template_url=self.list_in_container_by_experiment_name.metadata['url'], + template_url=self.list_in_container_by_experiment_name.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_in_container_by_experiment_name_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -715,7 +735,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedArtifactList", pipeline_response) + deserialized = self._deserialize( + "PaginatedArtifactList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -724,25 +746,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_in_container_by_experiment_name.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/artifacts"} # type: ignore + list_in_container_by_experiment_name.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/artifacts"} # type: ignore @distributed_trace def list_in_container_by_experiment_id( @@ -777,14 +805,19 @@ def list_in_container_by_experiment_id( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedArtifactList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedArtifactList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedArtifactList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_in_container_by_experiment_id_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -792,13 +825,15 @@ def prepare_request(next_link=None): run_id=run_id, experiment_id=experiment_id, continuation_token_parameter=continuation_token_parameter, - template_url=self.list_in_container_by_experiment_id.metadata['url'], + template_url=self.list_in_container_by_experiment_id.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_in_container_by_experiment_id_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -814,7 +849,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedArtifactList", pipeline_response) + deserialized = self._deserialize( + "PaginatedArtifactList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -823,25 +860,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_in_container_by_experiment_id.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/artifacts"} # type: ignore + list_in_container_by_experiment_id.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/artifacts"} # type: ignore @distributed_trace def list_in_path_by_experiment_name( @@ -879,14 +922,19 @@ def list_in_path_by_experiment_name( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedArtifactList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedArtifactList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedArtifactList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_in_path_by_experiment_name_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -895,13 +943,15 @@ def prepare_request(next_link=None): experiment_name=experiment_name, path=path, continuation_token_parameter=continuation_token_parameter, - template_url=self.list_in_path_by_experiment_name.metadata['url'], + template_url=self.list_in_path_by_experiment_name.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_in_path_by_experiment_name_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -918,7 +968,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedArtifactList", pipeline_response) + deserialized = self._deserialize( + "PaginatedArtifactList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -927,25 +979,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_in_path_by_experiment_name.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/artifacts/path"} # type: ignore + list_in_path_by_experiment_name.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/artifacts/path"} # type: ignore @distributed_trace def list_in_path_by_experiment_id( @@ -983,14 +1041,19 @@ def list_in_path_by_experiment_id( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedArtifactList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedArtifactList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedArtifactList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_in_path_by_experiment_id_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -999,13 +1062,15 @@ def prepare_request(next_link=None): experiment_id=experiment_id, path=path, continuation_token_parameter=continuation_token_parameter, - template_url=self.list_in_path_by_experiment_id.metadata['url'], + template_url=self.list_in_path_by_experiment_id.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_in_path_by_experiment_id_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -1022,7 +1087,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedArtifactList", pipeline_response) + deserialized = self._deserialize( + "PaginatedArtifactList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1031,25 +1098,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_in_path_by_experiment_id.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/artifacts/path"} # type: ignore + list_in_path_by_experiment_id.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/artifacts/path"} # type: ignore @distributed_trace def get_by_id_by_experiment_name( @@ -1082,13 +1155,14 @@ def get_by_id_by_experiment_name( :rtype: ~azure.mgmt.machinelearningservices.models.Artifact :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Artifact"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Artifact"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_by_id_by_experiment_name_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -1096,32 +1170,39 @@ def get_by_id_by_experiment_name( run_id=run_id, experiment_name=experiment_name, path=path, - template_url=self.get_by_id_by_experiment_name.metadata['url'], + template_url=self.get_by_id_by_experiment_name.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Artifact', pipeline_response) + deserialized = self._deserialize("Artifact", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_by_id_by_experiment_name.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/artifacts/metadata"} # type: ignore - + get_by_id_by_experiment_name.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/artifacts/metadata"} # type: ignore @distributed_trace def get_by_id_by_experiment_id( @@ -1154,13 +1235,14 @@ def get_by_id_by_experiment_id( :rtype: ~azure.mgmt.machinelearningservices.models.Artifact :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Artifact"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Artifact"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_by_id_by_experiment_id_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -1168,32 +1250,39 @@ def get_by_id_by_experiment_id( run_id=run_id, experiment_id=experiment_id, path=path, - template_url=self.get_by_id_by_experiment_id.metadata['url'], + template_url=self.get_by_id_by_experiment_id.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Artifact', pipeline_response) + deserialized = self._deserialize("Artifact", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_by_id_by_experiment_id.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/artifacts/metadata"} # type: ignore - + get_by_id_by_experiment_id.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/artifacts/metadata"} # type: ignore @distributed_trace def get_content_information_by_experiment_name( @@ -1226,13 +1315,16 @@ def get_content_information_by_experiment_name( :rtype: ~azure.mgmt.machinelearningservices.models.ArtifactContentInformation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactContentInformation"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ArtifactContentInformation"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_content_information_by_experiment_name_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -1240,32 +1332,43 @@ def get_content_information_by_experiment_name( run_id=run_id, experiment_name=experiment_name, path=path, - template_url=self.get_content_information_by_experiment_name.metadata['url'], + template_url=self.get_content_information_by_experiment_name.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ArtifactContentInformation', pipeline_response) + deserialized = self._deserialize( + "ArtifactContentInformation", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_content_information_by_experiment_name.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/artifacts/contentinfo"} # type: ignore - + get_content_information_by_experiment_name.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/artifacts/contentinfo"} # type: ignore @distributed_trace def get_content_information_by_experiment_id( @@ -1298,13 +1401,16 @@ def get_content_information_by_experiment_id( :rtype: ~azure.mgmt.machinelearningservices.models.ArtifactContentInformation :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactContentInformation"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ArtifactContentInformation"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_content_information_by_experiment_id_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -1312,32 +1418,43 @@ def get_content_information_by_experiment_id( run_id=run_id, experiment_id=experiment_id, path=path, - template_url=self.get_content_information_by_experiment_id.metadata['url'], + template_url=self.get_content_information_by_experiment_id.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ArtifactContentInformation', pipeline_response) + deserialized = self._deserialize( + "ArtifactContentInformation", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_content_information_by_experiment_id.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/artifacts/contentinfo"} # type: ignore - + get_content_information_by_experiment_id.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/artifacts/contentinfo"} # type: ignore @distributed_trace def get_sas_uri_by_experiment_name( @@ -1370,13 +1487,14 @@ def get_sas_uri_by_experiment_name( :rtype: str :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[str] + cls = kwargs.pop("cls", None) # type: ClsType[str] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_sas_uri_by_experiment_name_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -1384,32 +1502,39 @@ def get_sas_uri_by_experiment_name( run_id=run_id, experiment_name=experiment_name, path=path, - template_url=self.get_sas_uri_by_experiment_name.metadata['url'], + template_url=self.get_sas_uri_by_experiment_name.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('str', pipeline_response) + deserialized = self._deserialize("str", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_sas_uri_by_experiment_name.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/artifacts/artifacturi"} # type: ignore - + get_sas_uri_by_experiment_name.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/artifacts/artifacturi"} # type: ignore @distributed_trace def get_sas_uri_by_experiment_id( @@ -1442,13 +1567,14 @@ def get_sas_uri_by_experiment_id( :rtype: str :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[str] + cls = kwargs.pop("cls", None) # type: ClsType[str] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_sas_uri_by_experiment_id_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -1456,32 +1582,39 @@ def get_sas_uri_by_experiment_id( run_id=run_id, experiment_id=experiment_id, path=path, - template_url=self.get_sas_uri_by_experiment_id.metadata['url'], + template_url=self.get_sas_uri_by_experiment_id.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('str', pipeline_response) + deserialized = self._deserialize("str", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_sas_uri_by_experiment_id.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/artifacts/artifacturi"} # type: ignore - + get_sas_uri_by_experiment_id.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/artifacts/artifacturi"} # type: ignore @distributed_trace def list_sas_by_prefix_by_experiment_name( @@ -1519,14 +1652,19 @@ def list_sas_by_prefix_by_experiment_name( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedArtifactContentInformationList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedArtifactContentInformationList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedArtifactContentInformationList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_sas_by_prefix_by_experiment_name_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -1535,13 +1673,15 @@ def prepare_request(next_link=None): experiment_name=experiment_name, path=path, continuation_token_parameter=continuation_token_parameter, - template_url=self.list_sas_by_prefix_by_experiment_name.metadata['url'], + template_url=self.list_sas_by_prefix_by_experiment_name.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_sas_by_prefix_by_experiment_name_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -1558,7 +1698,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedArtifactContentInformationList", pipeline_response) + deserialized = self._deserialize( + "PaginatedArtifactContentInformationList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1567,25 +1709,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_sas_by_prefix_by_experiment_name.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/artifacts/prefix/contentinfo"} # type: ignore + list_sas_by_prefix_by_experiment_name.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/artifacts/prefix/contentinfo"} # type: ignore @distributed_trace def list_sas_by_prefix_by_experiment_id( @@ -1623,14 +1771,19 @@ def list_sas_by_prefix_by_experiment_id( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedArtifactContentInformationList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedArtifactContentInformationList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedArtifactContentInformationList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_sas_by_prefix_by_experiment_id_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -1639,13 +1792,15 @@ def prepare_request(next_link=None): experiment_id=experiment_id, path=path, continuation_token_parameter=continuation_token_parameter, - template_url=self.list_sas_by_prefix_by_experiment_id.metadata['url'], + template_url=self.list_sas_by_prefix_by_experiment_id.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_sas_by_prefix_by_experiment_id_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -1662,7 +1817,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedArtifactContentInformationList", pipeline_response) + deserialized = self._deserialize( + "PaginatedArtifactContentInformationList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1671,25 +1828,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_sas_by_prefix_by_experiment_id.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/artifacts/prefix/contentinfo"} # type: ignore + list_sas_by_prefix_by_experiment_id.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/artifacts/prefix/contentinfo"} # type: ignore @distributed_trace def batch_create_empty_artifacts_by_experiment_name( @@ -1722,16 +1885,22 @@ def batch_create_empty_artifacts_by_experiment_name( :rtype: ~azure.mgmt.machinelearningservices.models.BatchArtifactContentInformationResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchArtifactContentInformationResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchArtifactContentInformationResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'ArtifactPathList') + _json = self._serialize.body(body, "ArtifactPathList") else: _json = None @@ -1743,32 +1912,43 @@ def batch_create_empty_artifacts_by_experiment_name( experiment_name=experiment_name, content_type=content_type, json=_json, - template_url=self.batch_create_empty_artifacts_by_experiment_name.metadata['url'], + template_url=self.batch_create_empty_artifacts_by_experiment_name.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchArtifactContentInformationResult', pipeline_response) + deserialized = self._deserialize( + "BatchArtifactContentInformationResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - batch_create_empty_artifacts_by_experiment_name.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/artifacts/batch/metadata"} # type: ignore - + batch_create_empty_artifacts_by_experiment_name.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/artifacts/batch/metadata"} # type: ignore @distributed_trace def batch_create_empty_artifacts_by_experiment_id( @@ -1801,16 +1981,22 @@ def batch_create_empty_artifacts_by_experiment_id( :rtype: ~azure.mgmt.machinelearningservices.models.BatchArtifactContentInformationResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchArtifactContentInformationResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchArtifactContentInformationResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'ArtifactPathList') + _json = self._serialize.body(body, "ArtifactPathList") else: _json = None @@ -1822,29 +2008,40 @@ def batch_create_empty_artifacts_by_experiment_id( experiment_id=experiment_id, content_type=content_type, json=_json, - template_url=self.batch_create_empty_artifacts_by_experiment_id.metadata['url'], + template_url=self.batch_create_empty_artifacts_by_experiment_id.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchArtifactContentInformationResult', pipeline_response) + deserialized = self._deserialize( + "BatchArtifactContentInformationResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - batch_create_empty_artifacts_by_experiment_id.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/artifacts/batch/metadata"} # type: ignore - + batch_create_empty_artifacts_by_experiment_id.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/artifacts/batch/metadata"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/operations/_run_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/operations/_run_operations.py index c8591bffd667..5b1a9235e3b5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/operations/_run_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/operations/_run_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -23,9 +29,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, List, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Iterable, + List, + Optional, + TypeVar, + Union, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -85,6 +106,7 @@ def build_list_by_compute_request( **kwargs ) + # fmt: on class RunOperations(object): """RunOperations operations. @@ -158,14 +180,19 @@ def list_by_compute( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedRunList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedRunList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedRunList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_by_compute_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -177,13 +204,13 @@ def prepare_request(next_link=None): sortorder=sortorder, top=top, count=count, - template_url=self.list_by_compute.metadata['url'], + template_url=self.list_by_compute.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_by_compute_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -203,7 +230,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedRunList", pipeline_response) + deserialized = self._deserialize( + "PaginatedRunList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -212,22 +241,28 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_by_compute.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/runs"} # type: ignore + list_by_compute.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/runs"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/operations/_runs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/operations/_runs_operations.py index a95f5652e08c..56cc4faa6e86 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/operations/_runs_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/operations/_runs_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -23,9 +29,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, List, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Iterable, + List, + Optional, + TypeVar, + Union, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -1287,6 +1308,7 @@ def build_cancel_run_with_uri_by_experiment_name_request( **kwargs ) + # fmt: on class RunsOperations(object): # pylint: disable=too-many-public-methods """RunsOperations operations. @@ -1363,14 +1385,19 @@ def get_child_by_experiment_name( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedRunList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedRunList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedRunList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_get_child_by_experiment_name_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -1383,13 +1410,15 @@ def prepare_request(next_link=None): sortorder=sortorder, top=top, count=count, - template_url=self.get_child_by_experiment_name.metadata['url'], + template_url=self.get_child_by_experiment_name.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_get_child_by_experiment_name_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -1410,7 +1439,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedRunList", pipeline_response) + deserialized = self._deserialize( + "PaginatedRunList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1419,25 +1450,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - get_child_by_experiment_name.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/children"} # type: ignore + get_child_by_experiment_name.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/children"} # type: ignore @distributed_trace def get_child_by_experiment_id( @@ -1492,14 +1529,19 @@ def get_child_by_experiment_id( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedRunList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedRunList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedRunList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_get_child_by_experiment_id_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -1512,13 +1554,15 @@ def prepare_request(next_link=None): sortorder=sortorder, top=top, count=count, - template_url=self.get_child_by_experiment_id.metadata['url'], + template_url=self.get_child_by_experiment_id.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_get_child_by_experiment_id_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -1539,7 +1583,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedRunList", pipeline_response) + deserialized = self._deserialize( + "PaginatedRunList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1548,25 +1594,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - get_child_by_experiment_id.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/children"} # type: ignore + get_child_by_experiment_id.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/children"} # type: ignore @distributed_trace def get_child( @@ -1618,14 +1670,19 @@ def get_child( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedRunList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedRunList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedRunList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_get_child_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -1637,13 +1694,13 @@ def prepare_request(next_link=None): sortorder=sortorder, top=top, count=count, - template_url=self.get_child.metadata['url'], + template_url=self.get_child.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_get_child_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -1663,7 +1720,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedRunList", pipeline_response) + deserialized = self._deserialize( + "PaginatedRunList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1672,25 +1731,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - get_child.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/children"} # type: ignore + get_child.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/children"} # type: ignore @distributed_trace def get_details_by_experiment_id( @@ -1720,45 +1785,53 @@ def get_details_by_experiment_id( :rtype: ~azure.mgmt.machinelearningservices.models.RunDetails :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RunDetails"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.RunDetails"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_details_by_experiment_id_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, run_id=run_id, experiment_id=experiment_id, - template_url=self.get_details_by_experiment_id.metadata['url'], + template_url=self.get_details_by_experiment_id.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('RunDetails', pipeline_response) + deserialized = self._deserialize("RunDetails", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_details_by_experiment_id.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/details"} # type: ignore - + get_details_by_experiment_id.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/details"} # type: ignore @distributed_trace def get_details_by_experiment_name( @@ -1788,45 +1861,53 @@ def get_details_by_experiment_name( :rtype: ~azure.mgmt.machinelearningservices.models.RunDetails :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RunDetails"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.RunDetails"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_details_by_experiment_name_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, run_id=run_id, experiment_name=experiment_name, - template_url=self.get_details_by_experiment_name.metadata['url'], + template_url=self.get_details_by_experiment_name.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('RunDetails', pipeline_response) + deserialized = self._deserialize("RunDetails", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_details_by_experiment_name.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/details"} # type: ignore - + get_details_by_experiment_name.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/details"} # type: ignore @distributed_trace def get_details( @@ -1853,44 +1934,52 @@ def get_details( :rtype: ~azure.mgmt.machinelearningservices.models.RunDetails :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RunDetails"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.RunDetails"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_details_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, run_id=run_id, - template_url=self.get_details.metadata['url'], + template_url=self.get_details.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('RunDetails', pipeline_response) + deserialized = self._deserialize("RunDetails", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_details.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/details"} # type: ignore - + get_details.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/details"} # type: ignore @distributed_trace def get_run_data( @@ -1917,16 +2006,22 @@ def get_run_data( :rtype: ~azure.mgmt.machinelearningservices.models.GetRunDataResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.GetRunDataResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.GetRunDataResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'GetRunDataRequest') + _json = self._serialize.body(body, "GetRunDataRequest") else: _json = None @@ -1936,32 +2031,39 @@ def get_run_data( workspace_name=workspace_name, content_type=content_type, json=_json, - template_url=self.get_run_data.metadata['url'], + template_url=self.get_run_data.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('GetRunDataResult', pipeline_response) + deserialized = self._deserialize("GetRunDataResult", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_run_data.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/rundata"} # type: ignore - + get_run_data.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/rundata"} # type: ignore @distributed_trace def batch_get_run_data( @@ -1988,16 +2090,20 @@ def batch_get_run_data( :rtype: ~azure.mgmt.machinelearningservices.models.BatchResult1 :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchResult1"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchResult1"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'BatchRequest1') + _json = self._serialize.body(body, "BatchRequest1") else: _json = None @@ -2007,36 +2113,43 @@ def batch_get_run_data( workspace_name=workspace_name, content_type=content_type, json=_json, - template_url=self.batch_get_run_data.metadata['url'], + template_url=self.batch_get_run_data.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 207]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('BatchResult1', pipeline_response) + deserialized = self._deserialize("BatchResult1", pipeline_response) if response.status_code == 207: - deserialized = self._deserialize('BatchResult1', pipeline_response) + deserialized = self._deserialize("BatchResult1", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - batch_get_run_data.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchrundata"} # type: ignore - + batch_get_run_data.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchrundata"} # type: ignore @distributed_trace def batch_add_or_modify_by_experiment_id( @@ -2066,16 +2179,22 @@ def batch_add_or_modify_by_experiment_id( :rtype: ~azure.mgmt.machinelearningservices.models.BatchRunResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchRunResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchRunResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'BatchAddOrModifyRunRequest') + _json = self._serialize.body(body, "BatchAddOrModifyRunRequest") else: _json = None @@ -2086,32 +2205,41 @@ def batch_add_or_modify_by_experiment_id( experiment_id=experiment_id, content_type=content_type, json=_json, - template_url=self.batch_add_or_modify_by_experiment_id.metadata['url'], + template_url=self.batch_add_or_modify_by_experiment_id.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchRunResult', pipeline_response) + deserialized = self._deserialize("BatchRunResult", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - batch_add_or_modify_by_experiment_id.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/batch/runs"} # type: ignore - + batch_add_or_modify_by_experiment_id.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/batch/runs"} # type: ignore @distributed_trace def batch_add_or_modify_by_experiment_name( @@ -2141,16 +2269,22 @@ def batch_add_or_modify_by_experiment_name( :rtype: ~azure.mgmt.machinelearningservices.models.BatchRunResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchRunResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchRunResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'BatchAddOrModifyRunRequest') + _json = self._serialize.body(body, "BatchAddOrModifyRunRequest") else: _json = None @@ -2161,32 +2295,41 @@ def batch_add_or_modify_by_experiment_name( experiment_name=experiment_name, content_type=content_type, json=_json, - template_url=self.batch_add_or_modify_by_experiment_name.metadata['url'], + template_url=self.batch_add_or_modify_by_experiment_name.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchRunResult', pipeline_response) + deserialized = self._deserialize("BatchRunResult", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - batch_add_or_modify_by_experiment_name.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/batch/runs"} # type: ignore - + batch_add_or_modify_by_experiment_name.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/batch/runs"} # type: ignore @distributed_trace def add_or_modify_by_experiment_name( @@ -2219,16 +2362,20 @@ def add_or_modify_by_experiment_name( :rtype: ~azure.mgmt.machinelearningservices.models.Run :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Run"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'CreateRun') + _json = self._serialize.body(body, "CreateRun") else: _json = None @@ -2240,32 +2387,39 @@ def add_or_modify_by_experiment_name( experiment_name=experiment_name, content_type=content_type, json=_json, - template_url=self.add_or_modify_by_experiment_name.metadata['url'], + template_url=self.add_or_modify_by_experiment_name.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Run', pipeline_response) + deserialized = self._deserialize("Run", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - add_or_modify_by_experiment_name.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}"} # type: ignore - + add_or_modify_by_experiment_name.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}"} # type: ignore @distributed_trace def get_by_experiment_name( @@ -2295,45 +2449,53 @@ def get_by_experiment_name( :rtype: ~azure.mgmt.machinelearningservices.models.Run :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Run"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_by_experiment_name_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, run_id=run_id, experiment_name=experiment_name, - template_url=self.get_by_experiment_name.metadata['url'], + template_url=self.get_by_experiment_name.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Run', pipeline_response) + deserialized = self._deserialize("Run", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_by_experiment_name.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}"} # type: ignore - + get_by_experiment_name.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}"} # type: ignore @distributed_trace def add_or_modify_by_experiment_id( @@ -2366,16 +2528,20 @@ def add_or_modify_by_experiment_id( :rtype: ~azure.mgmt.machinelearningservices.models.Run :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Run"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'CreateRun') + _json = self._serialize.body(body, "CreateRun") else: _json = None @@ -2387,32 +2553,39 @@ def add_or_modify_by_experiment_id( experiment_id=experiment_id, content_type=content_type, json=_json, - template_url=self.add_or_modify_by_experiment_id.metadata['url'], + template_url=self.add_or_modify_by_experiment_id.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Run', pipeline_response) + deserialized = self._deserialize("Run", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - add_or_modify_by_experiment_id.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}"} # type: ignore - + add_or_modify_by_experiment_id.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}"} # type: ignore @distributed_trace def get_by_experiment_id( @@ -2442,45 +2615,53 @@ def get_by_experiment_id( :rtype: ~azure.mgmt.machinelearningservices.models.Run :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Run"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_by_experiment_id_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, run_id=run_id, experiment_id=experiment_id, - template_url=self.get_by_experiment_id.metadata['url'], + template_url=self.get_by_experiment_id.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Run', pipeline_response) + deserialized = self._deserialize("Run", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_by_experiment_id.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}"} # type: ignore - + get_by_experiment_id.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}"} # type: ignore @distributed_trace def add_or_modify_experiment( @@ -2510,16 +2691,20 @@ def add_or_modify_experiment( :rtype: ~azure.mgmt.machinelearningservices.models.Run :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Run"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'CreateRun') + _json = self._serialize.body(body, "CreateRun") else: _json = None @@ -2530,32 +2715,39 @@ def add_or_modify_experiment( run_id=run_id, content_type=content_type, json=_json, - template_url=self.add_or_modify_experiment.metadata['url'], + template_url=self.add_or_modify_experiment.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Run', pipeline_response) + deserialized = self._deserialize("Run", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - add_or_modify_experiment.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}"} # type: ignore - + add_or_modify_experiment.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}"} # type: ignore @distributed_trace def add( @@ -2585,16 +2777,20 @@ def add( :rtype: ~azure.mgmt.machinelearningservices.models.Run :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Run"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'CreateRun') + _json = self._serialize.body(body, "CreateRun") else: _json = None @@ -2605,32 +2801,39 @@ def add( run_id=run_id, content_type=content_type, json=_json, - template_url=self.add.metadata['url'], + template_url=self.add.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Run', pipeline_response) + deserialized = self._deserialize("Run", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - add.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}"} # type: ignore - + add.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}"} # type: ignore @distributed_trace def get( @@ -2657,44 +2860,52 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.Run :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Run"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, run_id=run_id, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Run', pipeline_response) + deserialized = self._deserialize("Run", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}"} # type: ignore - + get.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}"} # type: ignore @distributed_trace def delete_tags_by_experiment_id( @@ -2727,16 +2938,20 @@ def delete_tags_by_experiment_id( :rtype: ~azure.mgmt.machinelearningservices.models.Run :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Run"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, '[str]') + _json = self._serialize.body(body, "[str]") else: _json = None @@ -2748,32 +2963,39 @@ def delete_tags_by_experiment_id( experiment_id=experiment_id, content_type=content_type, json=_json, - template_url=self.delete_tags_by_experiment_id.metadata['url'], + template_url=self.delete_tags_by_experiment_id.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Run', pipeline_response) + deserialized = self._deserialize("Run", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - delete_tags_by_experiment_id.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/tags"} # type: ignore - + delete_tags_by_experiment_id.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/tags"} # type: ignore @distributed_trace def modify_or_delete_tags_by_experiment_id( @@ -2806,16 +3028,20 @@ def modify_or_delete_tags_by_experiment_id( :rtype: ~azure.mgmt.machinelearningservices.models.Run :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Run"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'DeleteOrModifyTags') + _json = self._serialize.body(body, "DeleteOrModifyTags") else: _json = None @@ -2827,32 +3053,41 @@ def modify_or_delete_tags_by_experiment_id( experiment_id=experiment_id, content_type=content_type, json=_json, - template_url=self.modify_or_delete_tags_by_experiment_id.metadata['url'], + template_url=self.modify_or_delete_tags_by_experiment_id.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Run', pipeline_response) + deserialized = self._deserialize("Run", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - modify_or_delete_tags_by_experiment_id.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/tags"} # type: ignore - + modify_or_delete_tags_by_experiment_id.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/tags"} # type: ignore @distributed_trace def delete_tags_by_experiment_name( @@ -2885,16 +3120,20 @@ def delete_tags_by_experiment_name( :rtype: ~azure.mgmt.machinelearningservices.models.Run :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Run"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, '[str]') + _json = self._serialize.body(body, "[str]") else: _json = None @@ -2906,32 +3145,39 @@ def delete_tags_by_experiment_name( experiment_name=experiment_name, content_type=content_type, json=_json, - template_url=self.delete_tags_by_experiment_name.metadata['url'], + template_url=self.delete_tags_by_experiment_name.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Run', pipeline_response) + deserialized = self._deserialize("Run", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - delete_tags_by_experiment_name.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/tags"} # type: ignore - + delete_tags_by_experiment_name.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/tags"} # type: ignore @distributed_trace def modify_or_delete_tags_by_experiment_name( @@ -2964,16 +3210,20 @@ def modify_or_delete_tags_by_experiment_name( :rtype: ~azure.mgmt.machinelearningservices.models.Run :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Run"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'DeleteOrModifyTags') + _json = self._serialize.body(body, "DeleteOrModifyTags") else: _json = None @@ -2985,32 +3235,41 @@ def modify_or_delete_tags_by_experiment_name( experiment_name=experiment_name, content_type=content_type, json=_json, - template_url=self.modify_or_delete_tags_by_experiment_name.metadata['url'], + template_url=self.modify_or_delete_tags_by_experiment_name.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Run', pipeline_response) + deserialized = self._deserialize("Run", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - modify_or_delete_tags_by_experiment_name.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/tags"} # type: ignore - + modify_or_delete_tags_by_experiment_name.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/tags"} # type: ignore @distributed_trace def delete_tags( @@ -3040,16 +3299,20 @@ def delete_tags( :rtype: ~azure.mgmt.machinelearningservices.models.Run :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Run"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, '[str]') + _json = self._serialize.body(body, "[str]") else: _json = None @@ -3060,32 +3323,39 @@ def delete_tags( run_id=run_id, content_type=content_type, json=_json, - template_url=self.delete_tags.metadata['url'], + template_url=self.delete_tags.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Run', pipeline_response) + deserialized = self._deserialize("Run", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - delete_tags.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/tags"} # type: ignore - + delete_tags.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/tags"} # type: ignore @distributed_trace def delete_run_services_by_experiment_id( @@ -3118,16 +3388,20 @@ def delete_run_services_by_experiment_id( :rtype: ~azure.mgmt.machinelearningservices.models.Run :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Run"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'DeleteRunServices') + _json = self._serialize.body(body, "DeleteRunServices") else: _json = None @@ -3139,32 +3413,41 @@ def delete_run_services_by_experiment_id( experiment_id=experiment_id, content_type=content_type, json=_json, - template_url=self.delete_run_services_by_experiment_id.metadata['url'], + template_url=self.delete_run_services_by_experiment_id.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Run', pipeline_response) + deserialized = self._deserialize("Run", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - delete_run_services_by_experiment_id.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/services"} # type: ignore - + delete_run_services_by_experiment_id.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/services"} # type: ignore @distributed_trace def delete_run_services_by_experiment_name( @@ -3197,16 +3480,20 @@ def delete_run_services_by_experiment_name( :rtype: ~azure.mgmt.machinelearningservices.models.Run :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Run"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'DeleteRunServices') + _json = self._serialize.body(body, "DeleteRunServices") else: _json = None @@ -3218,32 +3505,41 @@ def delete_run_services_by_experiment_name( experiment_name=experiment_name, content_type=content_type, json=_json, - template_url=self.delete_run_services_by_experiment_name.metadata['url'], + template_url=self.delete_run_services_by_experiment_name.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Run', pipeline_response) + deserialized = self._deserialize("Run", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - delete_run_services_by_experiment_name.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/services"} # type: ignore - + delete_run_services_by_experiment_name.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/services"} # type: ignore @distributed_trace def delete_run_services( @@ -3273,16 +3569,20 @@ def delete_run_services( :rtype: ~azure.mgmt.machinelearningservices.models.Run :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Run"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'DeleteRunServices') + _json = self._serialize.body(body, "DeleteRunServices") else: _json = None @@ -3293,32 +3593,39 @@ def delete_run_services( run_id=run_id, content_type=content_type, json=_json, - template_url=self.delete_run_services.metadata['url'], + template_url=self.delete_run_services.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Run', pipeline_response) + deserialized = self._deserialize("Run", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - delete_run_services.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/services"} # type: ignore - + delete_run_services.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/services"} # type: ignore @distributed_trace def add_or_modify_run_service_instances( @@ -3351,16 +3658,24 @@ def add_or_modify_run_service_instances( :rtype: ~azure.mgmt.machinelearningservices.models.RunServiceInstances :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RunServiceInstances"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.RunServiceInstances"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'AddOrModifyRunServiceInstancesRequest') + _json = self._serialize.body( + body, "AddOrModifyRunServiceInstancesRequest" + ) else: _json = None @@ -3372,32 +3687,43 @@ def add_or_modify_run_service_instances( node_id=node_id, content_type=content_type, json=_json, - template_url=self.add_or_modify_run_service_instances.metadata['url'], + template_url=self.add_or_modify_run_service_instances.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('RunServiceInstances', pipeline_response) + deserialized = self._deserialize( + "RunServiceInstances", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - add_or_modify_run_service_instances.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/serviceinstances/{nodeId}"} # type: ignore - + add_or_modify_run_service_instances.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/serviceinstances/{nodeId}"} # type: ignore @distributed_trace def get_run_service_instances( @@ -3427,45 +3753,57 @@ def get_run_service_instances( :rtype: ~azure.mgmt.machinelearningservices.models.RunServiceInstances :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RunServiceInstances"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.RunServiceInstances"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_run_service_instances_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, run_id=run_id, node_id=node_id, - template_url=self.get_run_service_instances.metadata['url'], + template_url=self.get_run_service_instances.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('RunServiceInstances', pipeline_response) + deserialized = self._deserialize( + "RunServiceInstances", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_run_service_instances.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/serviceinstances/{nodeId}"} # type: ignore - + get_run_service_instances.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/serviceinstances/{nodeId}"} # type: ignore @distributed_trace def get_by_query_by_experiment_name( @@ -3496,20 +3834,27 @@ def get_by_query_by_experiment_name( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedRunList] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedRunList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedRunList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: if body is not None: - _json = self._serialize.body(body, 'QueryParams') + _json = self._serialize.body(body, "QueryParams") else: _json = None - + request = build_get_by_query_by_experiment_name_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -3517,17 +3862,19 @@ def prepare_request(next_link=None): experiment_name=experiment_name, content_type=content_type, json=_json, - template_url=self.get_by_query_by_experiment_name.metadata['url'], + template_url=self.get_by_query_by_experiment_name.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: if body is not None: - _json = self._serialize.body(body, 'QueryParams') + _json = self._serialize.body(body, "QueryParams") else: _json = None - + request = build_get_by_query_by_experiment_name_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -3543,7 +3890,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedRunList", pipeline_response) + deserialized = self._deserialize( + "PaginatedRunList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -3552,25 +3901,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - get_by_query_by_experiment_name.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs:query"} # type: ignore + get_by_query_by_experiment_name.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs:query"} # type: ignore @distributed_trace def get_by_query_by_experiment_id( @@ -3601,20 +3956,27 @@ def get_by_query_by_experiment_id( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedRunList] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedRunList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedRunList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: if body is not None: - _json = self._serialize.body(body, 'QueryParams') + _json = self._serialize.body(body, "QueryParams") else: _json = None - + request = build_get_by_query_by_experiment_id_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -3622,17 +3984,19 @@ def prepare_request(next_link=None): experiment_id=experiment_id, content_type=content_type, json=_json, - template_url=self.get_by_query_by_experiment_id.metadata['url'], + template_url=self.get_by_query_by_experiment_id.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: if body is not None: - _json = self._serialize.body(body, 'QueryParams') + _json = self._serialize.body(body, "QueryParams") else: _json = None - + request = build_get_by_query_by_experiment_id_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -3648,7 +4012,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedRunList", pipeline_response) + deserialized = self._deserialize( + "PaginatedRunList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -3657,25 +4023,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - get_by_query_by_experiment_id.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs:query"} # type: ignore + get_by_query_by_experiment_id.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs:query"} # type: ignore @distributed_trace def get_by_ids_by_experiment_id( @@ -3705,16 +4077,22 @@ def get_by_ids_by_experiment_id( :rtype: ~azure.mgmt.machinelearningservices.models.BatchRunResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchRunResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchRunResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'GetRunsByIds') + _json = self._serialize.body(body, "GetRunsByIds") else: _json = None @@ -3725,32 +4103,39 @@ def get_by_ids_by_experiment_id( experiment_id=experiment_id, content_type=content_type, json=_json, - template_url=self.get_by_ids_by_experiment_id.metadata['url'], + template_url=self.get_by_ids_by_experiment_id.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchRunResult', pipeline_response) + deserialized = self._deserialize("BatchRunResult", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_by_ids_by_experiment_id.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/runIds"} # type: ignore - + get_by_ids_by_experiment_id.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/runIds"} # type: ignore @distributed_trace def get_by_ids_by_experiment_name( @@ -3780,16 +4165,22 @@ def get_by_ids_by_experiment_name( :rtype: ~azure.mgmt.machinelearningservices.models.BatchRunResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchRunResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchRunResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'GetRunsByIds') + _json = self._serialize.body(body, "GetRunsByIds") else: _json = None @@ -3800,32 +4191,39 @@ def get_by_ids_by_experiment_name( experiment_name=experiment_name, content_type=content_type, json=_json, - template_url=self.get_by_ids_by_experiment_name.metadata['url'], + template_url=self.get_by_ids_by_experiment_name.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchRunResult', pipeline_response) + deserialized = self._deserialize("BatchRunResult", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_by_ids_by_experiment_name.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/runIds"} # type: ignore - + get_by_ids_by_experiment_name.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/runIds"} # type: ignore @distributed_trace def cancel_run_with_uri_by_experiment_id( @@ -3858,13 +4256,14 @@ def cancel_run_with_uri_by_experiment_id( :rtype: ~azure.mgmt.machinelearningservices.models.Run :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Run"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_cancel_run_with_uri_by_experiment_id_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -3872,32 +4271,41 @@ def cancel_run_with_uri_by_experiment_id( run_id=run_id, experiment_id=experiment_id, cancelation_reason=cancelation_reason, - template_url=self.cancel_run_with_uri_by_experiment_id.metadata['url'], + template_url=self.cancel_run_with_uri_by_experiment_id.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Run', pipeline_response) + deserialized = self._deserialize("Run", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - cancel_run_with_uri_by_experiment_id.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/cancel"} # type: ignore - + cancel_run_with_uri_by_experiment_id.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/cancel"} # type: ignore @distributed_trace def cancel_run_with_uri_by_experiment_name( @@ -3930,13 +4338,14 @@ def cancel_run_with_uri_by_experiment_name( :rtype: ~azure.mgmt.machinelearningservices.models.Run :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Run"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_cancel_run_with_uri_by_experiment_name_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -3944,29 +4353,38 @@ def cancel_run_with_uri_by_experiment_name( run_id=run_id, experiment_name=experiment_name, cancelation_reason=cancelation_reason, - template_url=self.cancel_run_with_uri_by_experiment_name.metadata['url'], + template_url=self.cancel_run_with_uri_by_experiment_name.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Run', pipeline_response) + deserialized = self._deserialize("Run", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - cancel_run_with_uri_by_experiment_name.metadata = {'url': "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/cancel"} # type: ignore - + cancel_run_with_uri_by_experiment_name.metadata = {"url": "/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/cancel"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/operations/_spans_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/operations/_spans_operations.py index 7245f5ed1e9e..669780cbef76 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/operations/_spans_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/operations/_spans_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -146,6 +158,7 @@ def build_get_active_request( **kwargs ) + # fmt: on class SpansOperations(object): """SpansOperations operations. @@ -197,16 +210,20 @@ def post( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'RunStatusSpans') + _json = self._serialize.body(body, "RunStatusSpans") else: _json = None @@ -217,28 +234,35 @@ def post( # pylint: disable=inconsistent-return-statements run_id=run_id, content_type=content_type, json=_json, - template_url=self.post.metadata['url'], + template_url=self.post.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in []: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - post.metadata = {'url': "/history/v1.0/private/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/spans"} # type: ignore - + post.metadata = {"url": "/history/v1.0/private/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/spans"} # type: ignore @distributed_trace def list( @@ -270,27 +294,32 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedSpanDefinition1List] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedSpanDefinition1List"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedSpanDefinition1List"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, run_id=run_id, continuation_token_parameter=continuation_token_parameter, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -305,7 +334,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedSpanDefinition1List", pipeline_response) + deserialized = self._deserialize( + "PaginatedSpanDefinition1List", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -314,25 +345,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/history/v1.0/private/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/spans"} # type: ignore + list.metadata = {"url": "/history/v1.0/private/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/spans"} # type: ignore @distributed_trace def get_active( @@ -364,27 +401,32 @@ def get_active( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedSpanDefinition1List] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedSpanDefinition1List"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedSpanDefinition1List"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_get_active_request( subscription_id=subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, run_id=run_id, continuation_token_parameter=continuation_token_parameter, - template_url=self.get_active.metadata['url'], + template_url=self.get_active.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_get_active_request( subscription_id=subscription_id, resource_group_name=resource_group_name, @@ -399,7 +441,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedSpanDefinition1List", pipeline_response) + deserialized = self._deserialize( + "PaginatedSpanDefinition1List", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -408,22 +452,28 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - get_active.metadata = {'url': "/history/v1.0/private/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/spans/active"} # type: ignore + get_active.metadata = {"url": "/history/v1.0/private/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/spans/active"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/__init__.py index da46614477a9..71cf8fdc020d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/__init__.py @@ -10,9 +10,10 @@ from ._version import VERSION __version__ = VERSION -__all__ = ['AzureMachineLearningWorkspaces'] +__all__ = ["AzureMachineLearningWorkspaces"] # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk + patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/_azure_machine_learning_workspaces.py index f71ff2ece8b0..f6445247c53c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/_azure_machine_learning_workspaces.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/_azure_machine_learning_workspaces.py @@ -15,7 +15,10 @@ from . import models from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import BatchJobDeploymentOperations, BatchJobEndpointOperations +from .operations import ( + BatchJobDeploymentOperations, + BatchJobEndpointOperations, +) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -24,6 +27,7 @@ from azure.core.credentials import TokenCredential from azure.core.rest import HttpRequest, HttpResponse + class AzureMachineLearningWorkspaces(object): """AzureMachineLearningWorkspaces. @@ -52,16 +56,25 @@ def __init__( **kwargs # type: Any ): # type: (...) -> None - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._config = AzureMachineLearningWorkspacesConfiguration( + credential=credential, subscription_id=subscription_id, **kwargs + ) + self._client = ARMPipelineClient( + base_url=base_url, config=self._config, **kwargs + ) + + client_models = { + k: v for k, v in models.__dict__.items() if isinstance(v, type) + } self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.batch_job_deployment = BatchJobDeploymentOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_job_endpoint = BatchJobEndpointOperations(self._client, self._config, self._serialize, self._deserialize) - + self.batch_job_deployment = BatchJobDeploymentOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.batch_job_endpoint = BatchJobEndpointOperations( + self._client, self._config, self._serialize, self._deserialize + ) def _send_request( self, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/_configuration.py index ac658990982c..e2ca4a5a18db 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/_configuration.py @@ -10,7 +10,10 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ( + ARMChallengeAuthenticationPolicy, + ARMHttpLoggingPolicy, +) from ._version import VERSION @@ -21,7 +24,9 @@ from azure.core.credentials import TokenCredential -class AzureMachineLearningWorkspacesConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AzureMachineLearningWorkspacesConfiguration( + Configuration +): # pylint: disable=too-many-instance-attributes """Configuration for AzureMachineLearningWorkspaces. Note that all parameters used to create this instance are saved as instance @@ -43,8 +48,12 @@ def __init__( **kwargs # type: Any ): # type: (...) -> None - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop('api_version', "2020-09-01-dataplanepreview") # type: str + super(AzureMachineLearningWorkspacesConfiguration, self).__init__( + **kwargs + ) + api_version = kwargs.pop( + "api_version", "2020-09-01-dataplanepreview" + ) # type: str if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -54,23 +63,44 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = api_version - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) + self.credential_scopes = kwargs.pop( + "credential_scopes", ["https://management.azure.com/.default"] + ) + kwargs.setdefault( + "sdk_moniker", "mgmt-machinelearningservices/{}".format(VERSION) + ) self._configure(**kwargs) def _configure( - self, - **kwargs # type: Any + self, **kwargs # type: Any ): # type: (...) -> None - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') + self.user_agent_policy = kwargs.get( + "user_agent_policy" + ) or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get( + "headers_policy" + ) or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy( + **kwargs + ) + self.logging_policy = kwargs.get( + "logging_policy" + ) or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get( + "http_logging_policy" + ) or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy( + **kwargs + ) + self.custom_hook_policy = kwargs.get( + "custom_hook_policy" + ) or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get( + "redirect_policy" + ) or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = ARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/_patch.py index 74e48ecd07cf..17dbc073e01b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/_patch.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/_patch.py @@ -25,7 +25,8 @@ # # -------------------------------------------------------------------------- + # This file is used for handwritten extensions to the generated code. Example: # https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md def patch_sdk(): - pass \ No newline at end of file + pass diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/_vendor.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/_vendor.py index 138f663c53a4..ed3373e9699d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/_vendor.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/_vendor.py @@ -7,13 +7,20 @@ from azure.core.pipeline.transport import HttpRequest + def _convert_request(request, files=None): data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + request = HttpRequest( + method=request.method, + url=request.url, + headers=request.headers, + data=data, + ) if files: request.set_formdata_body(files) return request + def _format_url_section(template, **kwargs): components = template.split("/") while components: @@ -22,6 +29,8 @@ def _format_url_section(template, **kwargs): except KeyError as key: formatted_components = template.split("/") components = [ - c for c in formatted_components if "{}".format(key.args[0]) not in c + c + for c in formatted_components + if "{}".format(key.args[0]) not in c ] template = "/".join(components) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/__init__.py index f67ccda966f1..b90ec7485f14 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/__init__.py @@ -7,9 +7,11 @@ # -------------------------------------------------------------------------- from ._azure_machine_learning_workspaces import AzureMachineLearningWorkspaces -__all__ = ['AzureMachineLearningWorkspaces'] + +__all__ = ["AzureMachineLearningWorkspaces"] # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk + patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/_azure_machine_learning_workspaces.py index 13e246bcc919..7b3f073f7153 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/_azure_machine_learning_workspaces.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/_azure_machine_learning_workspaces.py @@ -16,12 +16,16 @@ from .. import models from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import BatchJobDeploymentOperations, BatchJobEndpointOperations +from .operations import ( + BatchJobDeploymentOperations, + BatchJobEndpointOperations, +) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential + class AzureMachineLearningWorkspaces: """AzureMachineLearningWorkspaces. @@ -49,21 +53,28 @@ def __init__( base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._config = AzureMachineLearningWorkspacesConfiguration( + credential=credential, subscription_id=subscription_id, **kwargs + ) + self._client = AsyncARMPipelineClient( + base_url=base_url, config=self._config, **kwargs + ) + + client_models = { + k: v for k, v in models.__dict__.items() if isinstance(v, type) + } self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.batch_job_deployment = BatchJobDeploymentOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_job_endpoint = BatchJobEndpointOperations(self._client, self._config, self._serialize, self._deserialize) - + self.batch_job_deployment = BatchJobDeploymentOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.batch_job_endpoint = BatchJobEndpointOperations( + self._client, self._config, self._serialize, self._deserialize + ) def _send_request( - self, - request: HttpRequest, - **kwargs: Any + self, request: HttpRequest, **kwargs: Any ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/_configuration.py index 228f020b9f07..6b8951d76eea 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/_configuration.py @@ -10,7 +10,10 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy +from azure.mgmt.core.policies import ( + ARMHttpLoggingPolicy, + AsyncARMChallengeAuthenticationPolicy, +) from .._version import VERSION @@ -19,7 +22,9 @@ from azure.core.credentials_async import AsyncTokenCredential -class AzureMachineLearningWorkspacesConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AzureMachineLearningWorkspacesConfiguration( + Configuration +): # pylint: disable=too-many-instance-attributes """Configuration for AzureMachineLearningWorkspaces. Note that all parameters used to create this instance are saved as instance @@ -40,8 +45,12 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop('api_version', "2020-09-01-dataplanepreview") # type: str + super(AzureMachineLearningWorkspacesConfiguration, self).__init__( + **kwargs + ) + api_version = kwargs.pop( + "api_version", "2020-09-01-dataplanepreview" + ) # type: str if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -51,22 +60,41 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = api_version - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) + self.credential_scopes = kwargs.pop( + "credential_scopes", ["https://management.azure.com/.default"] + ) + kwargs.setdefault( + "sdk_moniker", "mgmt-machinelearningservices/{}".format(VERSION) + ) self._configure(**kwargs) - def _configure( - self, - **kwargs: Any - ) -> None: - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get( + "user_agent_policy" + ) or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get( + "headers_policy" + ) or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy( + **kwargs + ) + self.logging_policy = kwargs.get( + "logging_policy" + ) or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get( + "http_logging_policy" + ) or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get( + "retry_policy" + ) or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get( + "custom_hook_policy" + ) or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get( + "redirect_policy" + ) or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/_patch.py index 74e48ecd07cf..17dbc073e01b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/_patch.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/_patch.py @@ -25,7 +25,8 @@ # # -------------------------------------------------------------------------- + # This file is used for handwritten extensions to the generated code. Example: # https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md def patch_sdk(): - pass \ No newline at end of file + pass diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/operations/__init__.py index 7d1a5550ce1d..e3785b14761f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/operations/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/operations/__init__.py @@ -10,6 +10,6 @@ from ._batch_job_endpoint_operations import BatchJobEndpointOperations __all__ = [ - 'BatchJobDeploymentOperations', - 'BatchJobEndpointOperations', + "BatchJobDeploymentOperations", + "BatchJobEndpointOperations", ] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/operations/_batch_job_deployment_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/operations/_batch_job_deployment_operations.py index 47908fff911b..bc9eaab08ea5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/operations/_batch_job_deployment_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/operations/_batch_job_deployment_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,20 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._batch_job_deployment_operations import build_create_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._batch_job_deployment_operations import ( + build_create_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class BatchJobDeploymentOperations: """BatchJobDeploymentOperations async operations. @@ -76,16 +93,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.BatchJobResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2020-09-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2020-09-01-dataplanepreview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchJobResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchJobResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( endpoint_name=endpoint_name, deployment_name=deployment_name, @@ -94,13 +118,13 @@ def prepare_request(next_link=None): workspace_name=workspace_name, api_version=api_version, skiptoken=skiptoken, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( endpoint_name=endpoint_name, deployment_name=deployment_name, @@ -117,7 +141,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("BatchJobResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "BatchJobResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -127,24 +153,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}/jobs"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}/jobs"} # type: ignore @distributed_trace_async async def create( @@ -175,16 +205,24 @@ async def create( :rtype: ~azure.mgmt.machinelearningservices.models.BatchJobResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchJobResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchJobResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2020-09-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2020-09-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'BatchJobResource') + _json = self._serialize.body(body, "BatchJobResource") request = build_create_request( endpoint_name=endpoint_name, @@ -195,36 +233,45 @@ async def create( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create.metadata['url'], + template_url=self.create.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('BatchJobResource', pipeline_response) + deserialized = self._deserialize( + "BatchJobResource", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('BatchJobResource', pipeline_response) + deserialized = self._deserialize( + "BatchJobResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}/jobs"} # type: ignore - + create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}/jobs"} # type: ignore @distributed_trace_async async def get( @@ -255,15 +302,20 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.BatchJobResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchJobResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchJobResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2020-09-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2020-09-01-dataplanepreview" + ) # type: str - request = build_get_request( endpoint_name=endpoint_name, deployment_name=deployment_name, @@ -272,29 +324,34 @@ async def get( resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchJobResource', pipeline_response) + deserialized = self._deserialize("BatchJobResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}/jobs/{id}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}/jobs/{id}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/operations/_batch_job_endpoint_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/operations/_batch_job_endpoint_operations.py index 9146b57a5214..5463d8c9cd8b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/operations/_batch_job_endpoint_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/aio/operations/_batch_job_endpoint_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,20 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._batch_job_endpoint_operations import build_create_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._batch_job_endpoint_operations import ( + build_create_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class BatchJobEndpointOperations: """BatchJobEndpointOperations async operations. @@ -76,16 +93,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.BatchJobResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2020-09-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2020-09-01-dataplanepreview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchJobResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchJobResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( endpoint_name=endpoint_name, subscription_id=self._config.subscription_id, @@ -94,13 +118,13 @@ def prepare_request(next_link=None): api_version=api_version, deployment=deployment, skiptoken=skiptoken, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( endpoint_name=endpoint_name, subscription_id=self._config.subscription_id, @@ -117,7 +141,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("BatchJobResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "BatchJobResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -127,24 +153,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/jobs"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/jobs"} # type: ignore @distributed_trace_async async def create( @@ -172,16 +202,24 @@ async def create( :rtype: ~azure.mgmt.machinelearningservices.models.BatchJobResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchJobResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchJobResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2020-09-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2020-09-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'BatchJobResource') + _json = self._serialize.body(body, "BatchJobResource") request = build_create_request( endpoint_name=endpoint_name, @@ -191,36 +229,45 @@ async def create( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create.metadata['url'], + template_url=self.create.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('BatchJobResource', pipeline_response) + deserialized = self._deserialize( + "BatchJobResource", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('BatchJobResource', pipeline_response) + deserialized = self._deserialize( + "BatchJobResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/jobs"} # type: ignore - + create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/jobs"} # type: ignore @distributed_trace_async async def get( @@ -248,15 +295,20 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.BatchJobResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchJobResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchJobResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2020-09-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2020-09-01-dataplanepreview" + ) # type: str - request = build_get_request( endpoint_name=endpoint_name, id=id, @@ -264,29 +316,34 @@ async def get( resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchJobResource', pipeline_response) + deserialized = self._deserialize("BatchJobResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/jobs/{id}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/jobs/{id}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/models/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/models/__init__.py index 40a4c52c7977..0d42ab628ab4 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/models/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/models/__init__.py @@ -91,48 +91,48 @@ ) __all__ = [ - 'AssetJobInput', - 'AssetJobOutput', - 'BatchJob', - 'BatchJobResource', - 'BatchJobResourceArmPaginatedResult', - 'BatchRetrySettings', - 'ComputeConfiguration', - 'CustomModelJobInput', - 'CustomModelJobOutput', - 'DataVersion', - 'ErrorDetail', - 'ErrorResponse', - 'InferenceDataInputBase', - 'InferenceDataUrlInput', - 'InferenceDatasetIdInput', - 'InferenceDatasetInput', - 'JobEndpoint', - 'JobInput', - 'JobOutputArtifacts', - 'JobOutputV2', - 'LabelClass', - 'LiteralJobInput', - 'MLFlowModelJobInput', - 'MLFlowModelJobOutput', - 'MLTableJobInput', - 'MLTableJobOutput', - 'Resource', - 'SystemData', - 'TritonModelJobInput', - 'TritonModelJobOutput', - 'UriFileJobInput', - 'UriFileJobOutput', - 'UriFolderJobInput', - 'UriFolderJobOutput', - 'BatchLoggingLevel', - 'CreatedByType', - 'DatasetType', - 'InferenceDataInputType', - 'InputDeliveryMode', - 'JobInputType', - 'JobOutputType', - 'JobProvisioningState', - 'JobStatus', - 'OutputDeliveryMode', + "AssetJobInput", + "AssetJobOutput", + "BatchJob", + "BatchJobResource", + "BatchJobResourceArmPaginatedResult", + "BatchRetrySettings", + "ComputeConfiguration", + "CustomModelJobInput", + "CustomModelJobOutput", + "DataVersion", + "ErrorDetail", + "ErrorResponse", + "InferenceDataInputBase", + "InferenceDataUrlInput", + "InferenceDatasetIdInput", + "InferenceDatasetInput", + "JobEndpoint", + "JobInput", + "JobOutputArtifacts", + "JobOutputV2", + "LabelClass", + "LiteralJobInput", + "MLFlowModelJobInput", + "MLFlowModelJobOutput", + "MLTableJobInput", + "MLTableJobOutput", + "Resource", + "SystemData", + "TritonModelJobInput", + "TritonModelJobOutput", + "UriFileJobInput", + "UriFileJobOutput", + "UriFolderJobInput", + "UriFolderJobOutput", + "BatchLoggingLevel", + "CreatedByType", + "DatasetType", + "InferenceDataInputType", + "InputDeliveryMode", + "JobInputType", + "JobOutputType", + "JobProvisioningState", + "JobStatus", + "OutputDeliveryMode", ] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/models/_azure_machine_learning_workspaces_enums.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/models/_azure_machine_learning_workspaces_enums.py index 9a91d01e6f33..5be720f6788b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/models/_azure_machine_learning_workspaces_enums.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/models/_azure_machine_learning_workspaces_enums.py @@ -20,29 +20,31 @@ class BatchLoggingLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): WARNING = "Warning" DEBUG = "Debug" + class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of identity that created the resource. - """ + """The type of identity that created the resource.""" USER = "User" APPLICATION = "Application" MANAGED_IDENTITY = "ManagedIdentity" KEY = "Key" + class DatasetType(str, Enum, metaclass=CaseInsensitiveEnumMeta): SIMPLE = "Simple" DATAFLOW = "Dataflow" + class InferenceDataInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): DATASET_VERSION = "DatasetVersion" DATASET_ID = "DatasetId" DATA_URL = "DataUrl" + class InputDeliveryMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the input data delivery mode. - """ + """Enum to determine the input data delivery mode.""" READ_ONLY_MOUNT = "ReadOnlyMount" READ_WRITE_MOUNT = "ReadWriteMount" @@ -51,9 +53,9 @@ class InputDeliveryMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): EVAL_MOUNT = "EvalMount" EVAL_DOWNLOAD = "EvalDownload" + class JobInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the Job Input Type. - """ + """Enum to determine the Job Input Type.""" URI_FILE = "UriFile" URI_FOLDER = "UriFolder" @@ -63,9 +65,9 @@ class JobInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): ML_FLOW_MODEL = "MLFlowModel" TRITON_MODEL = "TritonModel" + class JobOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the Job Output Type. - """ + """Enum to determine the Job Output Type.""" URI_FILE = "UriFile" URI_FOLDER = "UriFolder" @@ -74,6 +76,7 @@ class JobOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): ML_FLOW_MODEL = "MLFlowModel" TRITON_MODEL = "TritonModel" + class JobProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): SUCCEEDED = "Succeeded" @@ -81,9 +84,9 @@ class JobProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): CANCELED = "Canceled" IN_PROGRESS = "InProgress" + class JobStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The status of a job. - """ + """The status of a job.""" NOT_STARTED = "NotStarted" STARTING = "Starting" @@ -100,9 +103,9 @@ class JobStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): PAUSED = "Paused" UNKNOWN = "Unknown" + class OutputDeliveryMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Output data delivery mode enums. - """ + """Output data delivery mode enums.""" READ_WRITE_MOUNT = "ReadWriteMount" UPLOAD = "Upload" diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/models/_models.py index 5f5a86aedae7..d24275c2c578 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/models/_models.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/models/_models.py @@ -23,18 +23,15 @@ class AssetJobInput(msrest.serialization.Model): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -43,8 +40,8 @@ def __init__( :paramtype uri: str """ super(AssetJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] class AssetJobOutput(msrest.serialization.Model): @@ -58,14 +55,11 @@ class AssetJobOutput(msrest.serialization.Model): """ _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -74,8 +68,8 @@ def __init__( :paramtype uri: str """ super(AssetJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) class BatchJob(msrest.serialization.Model): @@ -143,39 +137,45 @@ class BatchJob(msrest.serialization.Model): """ _validation = { - 'interaction_endpoints': {'readonly': True}, - 'output': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'status': {'readonly': True}, + "interaction_endpoints": {"readonly": True}, + "output": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "status": {"readonly": True}, } _attribute_map = { - 'compute': {'key': 'compute', 'type': 'ComputeConfiguration'}, - 'dataset': {'key': 'dataset', 'type': 'InferenceDataInputBase'}, - 'description': {'key': 'description', 'type': 'str'}, - 'error_threshold': {'key': 'errorThreshold', 'type': 'int'}, - 'input_data': {'key': 'inputData', 'type': '{JobInput}'}, - 'interaction_endpoints': {'key': 'interactionEndpoints', 'type': '{JobEndpoint}'}, - 'logging_level': {'key': 'loggingLevel', 'type': 'str'}, - 'max_concurrency_per_instance': {'key': 'maxConcurrencyPerInstance', 'type': 'int'}, - 'mini_batch_size': {'key': 'miniBatchSize', 'type': 'long'}, - 'name': {'key': 'name', 'type': 'str'}, - 'output': {'key': 'output', 'type': 'JobOutputArtifacts'}, - 'output_data': {'key': 'outputData', 'type': '{JobOutputV2}'}, - 'output_dataset': {'key': 'outputDataset', 'type': 'DataVersion'}, - 'output_file_name': {'key': 'outputFileName', 'type': 'str'}, - 'partition_keys': {'key': 'partitionKeys', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'retry_settings': {'key': 'retrySettings', 'type': 'BatchRetrySettings'}, - 'status': {'key': 'status', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): + "compute": {"key": "compute", "type": "ComputeConfiguration"}, + "dataset": {"key": "dataset", "type": "InferenceDataInputBase"}, + "description": {"key": "description", "type": "str"}, + "error_threshold": {"key": "errorThreshold", "type": "int"}, + "input_data": {"key": "inputData", "type": "{JobInput}"}, + "interaction_endpoints": { + "key": "interactionEndpoints", + "type": "{JobEndpoint}", + }, + "logging_level": {"key": "loggingLevel", "type": "str"}, + "max_concurrency_per_instance": { + "key": "maxConcurrencyPerInstance", + "type": "int", + }, + "mini_batch_size": {"key": "miniBatchSize", "type": "long"}, + "name": {"key": "name", "type": "str"}, + "output": {"key": "output", "type": "JobOutputArtifacts"}, + "output_data": {"key": "outputData", "type": "{JobOutputV2}"}, + "output_dataset": {"key": "outputDataset", "type": "DataVersion"}, + "output_file_name": {"key": "outputFileName", "type": "str"}, + "partition_keys": {"key": "partitionKeys", "type": "[str]"}, + "properties": {"key": "properties", "type": "{str}"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "retry_settings": { + "key": "retrySettings", + "type": "BatchRetrySettings", + }, + "status": {"key": "status", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + } + + def __init__(self, **kwargs): """ :keyword compute: Compute configuration used to set instance count. :paramtype compute: ~azure.mgmt.machinelearningservices.models.ComputeConfiguration @@ -223,26 +223,28 @@ def __init__( :paramtype tags: dict[str, str] """ super(BatchJob, self).__init__(**kwargs) - self.compute = kwargs.get('compute', None) - self.dataset = kwargs.get('dataset', None) - self.description = kwargs.get('description', None) - self.error_threshold = kwargs.get('error_threshold', None) - self.input_data = kwargs.get('input_data', None) + self.compute = kwargs.get("compute", None) + self.dataset = kwargs.get("dataset", None) + self.description = kwargs.get("description", None) + self.error_threshold = kwargs.get("error_threshold", None) + self.input_data = kwargs.get("input_data", None) self.interaction_endpoints = None - self.logging_level = kwargs.get('logging_level', None) - self.max_concurrency_per_instance = kwargs.get('max_concurrency_per_instance', None) - self.mini_batch_size = kwargs.get('mini_batch_size', None) - self.name = kwargs.get('name', None) + self.logging_level = kwargs.get("logging_level", None) + self.max_concurrency_per_instance = kwargs.get( + "max_concurrency_per_instance", None + ) + self.mini_batch_size = kwargs.get("mini_batch_size", None) + self.name = kwargs.get("name", None) self.output = None - self.output_data = kwargs.get('output_data', None) - self.output_dataset = kwargs.get('output_dataset', None) - self.output_file_name = kwargs.get('output_file_name', None) - self.partition_keys = kwargs.get('partition_keys', None) - self.properties = kwargs.get('properties', None) + self.output_data = kwargs.get("output_data", None) + self.output_dataset = kwargs.get("output_dataset", None) + self.output_file_name = kwargs.get("output_file_name", None) + self.partition_keys = kwargs.get("partition_keys", None) + self.properties = kwargs.get("properties", None) self.provisioning_state = None - self.retry_settings = kwargs.get('retry_settings', None) + self.retry_settings = kwargs.get("retry_settings", None) self.status = None - self.tags = kwargs.get('tags', None) + self.tags = kwargs.get("tags", None) class Resource(msrest.serialization.Model): @@ -261,23 +263,19 @@ class Resource(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -306,31 +304,28 @@ class BatchJobResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'properties': {'required': True}, - 'system_data': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "properties": {"required": True}, + "system_data": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchJob'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "properties": {"key": "properties", "type": "BatchJob"}, + "system_data": {"key": "systemData", "type": "SystemData"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.BatchJob """ super(BatchJobResource, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] self.system_data = None @@ -345,14 +340,11 @@ class BatchJobResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchJobResource]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[BatchJobResource]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of BatchJob objects. If null, there are no additional pages. @@ -361,8 +353,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchJobResource] """ super(BatchJobResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class BatchRetrySettings(msrest.serialization.Model): @@ -375,14 +367,11 @@ class BatchRetrySettings(msrest.serialization.Model): """ _attribute_map = { - 'max_retries': {'key': 'maxRetries', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "max_retries": {"key": "maxRetries", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword max_retries: Maximum retry count for a mini-batch. :paramtype max_retries: int @@ -390,8 +379,8 @@ def __init__( :paramtype timeout: ~datetime.timedelta """ super(BatchRetrySettings, self).__init__(**kwargs) - self.max_retries = kwargs.get('max_retries', None) - self.timeout = kwargs.get('timeout', None) + self.max_retries = kwargs.get("max_retries", None) + self.timeout = kwargs.get("timeout", None) class ComputeConfiguration(msrest.serialization.Model): @@ -413,18 +402,15 @@ class ComputeConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'is_local': {'key': 'isLocal', 'type': 'bool'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'target': {'key': 'target', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + "instance_count": {"key": "instanceCount", "type": "int"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "is_local": {"key": "isLocal", "type": "bool"}, + "location": {"key": "location", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "target": {"key": "target", "type": "str"}, + } + + def __init__(self, **kwargs): """ :keyword instance_count: Number of instances or nodes. :paramtype instance_count: int @@ -441,12 +427,12 @@ def __init__( :paramtype target: str """ super(ComputeConfiguration, self).__init__(**kwargs) - self.instance_count = kwargs.get('instance_count', None) - self.instance_type = kwargs.get('instance_type', None) - self.is_local = kwargs.get('is_local', None) - self.location = kwargs.get('location', None) - self.properties = kwargs.get('properties', None) - self.target = kwargs.get('target', None) + self.instance_count = kwargs.get("instance_count", None) + self.instance_type = kwargs.get("instance_type", None) + self.is_local = kwargs.get("is_local", None) + self.location = kwargs.get("location", None) + self.properties = kwargs.get("properties", None) + self.target = kwargs.get("target", None) class JobInput(msrest.serialization.Model): @@ -466,28 +452,33 @@ class JobInput(msrest.serialization.Model): """ _validation = { - 'job_input_type': {'required': True}, + "job_input_type": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } _subtype_map = { - 'job_input_type': {'CustomModel': 'CustomModelJobInput', 'Literal': 'LiteralJobInput', 'MLFlowModel': 'MLFlowModelJobInput', 'MLTable': 'MLTableJobInput', 'TritonModel': 'TritonModelJobInput', 'UriFile': 'UriFileJobInput', 'UriFolder': 'UriFolderJobInput'} + "job_input_type": { + "CustomModel": "CustomModelJobInput", + "Literal": "LiteralJobInput", + "MLFlowModel": "MLFlowModelJobInput", + "MLTable": "MLTableJobInput", + "TritonModel": "TritonModelJobInput", + "UriFile": "UriFileJobInput", + "UriFolder": "UriFolderJobInput", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: Description for the input. :paramtype description: str """ super(JobInput, self).__init__(**kwargs) - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.job_input_type = None # type: Optional[str] @@ -510,21 +501,18 @@ class CustomModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -535,10 +523,10 @@ def __init__( :paramtype description: str """ super(CustomModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'CustomModel' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "CustomModel" # type: str + self.description = kwargs.get("description", None) class JobOutputV2(msrest.serialization.Model): @@ -557,28 +545,32 @@ class JobOutputV2(msrest.serialization.Model): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } _subtype_map = { - 'job_output_type': {'CustomModel': 'CustomModelJobOutput', 'MLFlowModel': 'MLFlowModelJobOutput', 'MLTable': 'MLTableJobOutput', 'TritonModel': 'TritonModelJobOutput', 'UriFile': 'UriFileJobOutput', 'UriFolder': 'UriFolderJobOutput'} + "job_output_type": { + "CustomModel": "CustomModelJobOutput", + "MLFlowModel": "MLFlowModelJobOutput", + "MLTable": "MLTableJobOutput", + "TritonModel": "TritonModelJobOutput", + "UriFile": "UriFileJobOutput", + "UriFolder": "UriFolderJobOutput", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: Description for the output. :paramtype description: str """ super(JobOutputV2, self).__init__(**kwargs) - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.job_output_type = None # type: Optional[str] @@ -600,20 +592,17 @@ class CustomModelJobOutput(JobOutputV2, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -624,10 +613,10 @@ def __init__( :paramtype description: str """ super(CustomModelJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'CustomModel' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "CustomModel" # type: str + self.description = kwargs.get("description", None) class DataVersion(msrest.serialization.Model): @@ -652,23 +641,20 @@ class DataVersion(msrest.serialization.Model): """ _validation = { - 'path': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "path": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'dataset_type': {'key': 'datasetType', 'type': 'str'}, - 'datastore_id': {'key': 'datastoreId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'path': {'key': 'path', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): + "dataset_type": {"key": "datasetType", "type": "str"}, + "datastore_id": {"key": "datastoreId", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "path": {"key": "path", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + } + + def __init__(self, **kwargs): """ :keyword dataset_type: The Format of dataset. Possible values include: "Simple", "Dataflow". :paramtype dataset_type: str or ~azure.mgmt.machinelearningservices.models.DatasetType @@ -686,13 +672,13 @@ def __init__( :paramtype tags: dict[str, str] """ super(DataVersion, self).__init__(**kwargs) - self.dataset_type = kwargs.get('dataset_type', None) - self.datastore_id = kwargs.get('datastore_id', None) - self.description = kwargs.get('description', None) - self.is_anonymous = kwargs.get('is_anonymous', None) - self.path = kwargs['path'] - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) + self.dataset_type = kwargs.get("dataset_type", None) + self.datastore_id = kwargs.get("datastore_id", None) + self.description = kwargs.get("description", None) + self.is_anonymous = kwargs.get("is_anonymous", None) + self.path = kwargs["path"] + self.properties = kwargs.get("properties", None) + self.tags = kwargs.get("tags", None) class ErrorDetail(msrest.serialization.Model): @@ -707,19 +693,16 @@ class ErrorDetail(msrest.serialization.Model): """ _validation = { - 'code': {'required': True}, - 'message': {'required': True}, + "code": {"required": True}, + "message": {"required": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword code: Required. Error code. :paramtype code: str @@ -727,8 +710,8 @@ def __init__( :paramtype message: str """ super(ErrorDetail, self).__init__(**kwargs) - self.code = kwargs['code'] - self.message = kwargs['message'] + self.code = kwargs["code"] + self.message = kwargs["message"] class ErrorResponse(msrest.serialization.Model): @@ -745,23 +728,19 @@ class ErrorResponse(msrest.serialization.Model): """ _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'details': {'readonly': True}, + "code": {"readonly": True}, + "message": {"readonly": True}, + "details": {"readonly": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "details": {"key": "details", "type": "[ErrorDetail]"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ErrorResponse, self).__init__(**kwargs) self.code = None self.message = None @@ -783,23 +762,23 @@ class InferenceDataInputBase(msrest.serialization.Model): """ _validation = { - 'data_input_type': {'required': True}, + "data_input_type": {"required": True}, } _attribute_map = { - 'data_input_type': {'key': 'dataInputType', 'type': 'str'}, + "data_input_type": {"key": "dataInputType", "type": "str"}, } _subtype_map = { - 'data_input_type': {'DataUrl': 'InferenceDataUrlInput', 'DatasetId': 'InferenceDatasetIdInput', 'DatasetVersion': 'InferenceDatasetInput'} + "data_input_type": { + "DataUrl": "InferenceDataUrlInput", + "DatasetId": "InferenceDatasetIdInput", + "DatasetVersion": "InferenceDatasetInput", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(InferenceDataInputBase, self).__init__(**kwargs) self.data_input_type = None # type: Optional[str] @@ -818,25 +797,22 @@ class InferenceDatasetIdInput(InferenceDataInputBase): """ _validation = { - 'data_input_type': {'required': True}, + "data_input_type": {"required": True}, } _attribute_map = { - 'data_input_type': {'key': 'dataInputType', 'type': 'str'}, - 'dataset_id': {'key': 'datasetId', 'type': 'str'}, + "data_input_type": {"key": "dataInputType", "type": "str"}, + "dataset_id": {"key": "datasetId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword dataset_id: ARM ID of the input dataset. :paramtype dataset_id: str """ super(InferenceDatasetIdInput, self).__init__(**kwargs) - self.data_input_type = 'DatasetId' # type: str - self.dataset_id = kwargs.get('dataset_id', None) + self.data_input_type = "DatasetId" # type: str + self.dataset_id = kwargs.get("dataset_id", None) class InferenceDatasetInput(InferenceDataInputBase): @@ -855,19 +831,16 @@ class InferenceDatasetInput(InferenceDataInputBase): """ _validation = { - 'data_input_type': {'required': True}, + "data_input_type": {"required": True}, } _attribute_map = { - 'data_input_type': {'key': 'dataInputType', 'type': 'str'}, - 'dataset_name': {'key': 'datasetName', 'type': 'str'}, - 'dataset_version': {'key': 'datasetVersion', 'type': 'str'}, + "data_input_type": {"key": "dataInputType", "type": "str"}, + "dataset_name": {"key": "datasetName", "type": "str"}, + "dataset_version": {"key": "datasetVersion", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword dataset_name: Name of the input dataset. :paramtype dataset_name: str @@ -875,9 +848,9 @@ def __init__( :paramtype dataset_version: str """ super(InferenceDatasetInput, self).__init__(**kwargs) - self.data_input_type = 'DatasetVersion' # type: str - self.dataset_name = kwargs.get('dataset_name', None) - self.dataset_version = kwargs.get('dataset_version', None) + self.data_input_type = "DatasetVersion" # type: str + self.dataset_name = kwargs.get("dataset_name", None) + self.dataset_version = kwargs.get("dataset_version", None) class InferenceDataUrlInput(InferenceDataInputBase): @@ -894,26 +867,23 @@ class InferenceDataUrlInput(InferenceDataInputBase): """ _validation = { - 'data_input_type': {'required': True}, - 'path': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "data_input_type": {"required": True}, + "path": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'data_input_type': {'key': 'dataInputType', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, + "data_input_type": {"key": "dataInputType", "type": "str"}, + "path": {"key": "path", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword path: Required. Asset path to the input data, say a blob URL. :paramtype path: str """ super(InferenceDataUrlInput, self).__init__(**kwargs) - self.data_input_type = 'DataUrl' # type: str - self.path = kwargs['path'] + self.data_input_type = "DataUrl" # type: str + self.path = kwargs["path"] class JobEndpoint(msrest.serialization.Model): @@ -930,16 +900,13 @@ class JobEndpoint(msrest.serialization.Model): """ _attribute_map = { - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'job_endpoint_type': {'key': 'jobEndpointType', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{str}'}, + "endpoint": {"key": "endpoint", "type": "str"}, + "job_endpoint_type": {"key": "jobEndpointType", "type": "str"}, + "port": {"key": "port", "type": "int"}, + "properties": {"key": "properties", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword endpoint: Url for endpoint. :paramtype endpoint: str @@ -951,10 +918,10 @@ def __init__( :paramtype properties: dict[str, str] """ super(JobEndpoint, self).__init__(**kwargs) - self.endpoint = kwargs.get('endpoint', None) - self.job_endpoint_type = kwargs.get('job_endpoint_type', None) - self.port = kwargs.get('port', None) - self.properties = kwargs.get('properties', None) + self.endpoint = kwargs.get("endpoint", None) + self.job_endpoint_type = kwargs.get("job_endpoint_type", None) + self.port = kwargs.get("port", None) + self.properties = kwargs.get("properties", None) class JobOutputArtifacts(msrest.serialization.Model): @@ -969,21 +936,17 @@ class JobOutputArtifacts(msrest.serialization.Model): """ _validation = { - 'datastore_id': {'readonly': True}, - 'path': {'readonly': True}, + "datastore_id": {"readonly": True}, + "path": {"readonly": True}, } _attribute_map = { - 'datastore_id': {'key': 'datastoreId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, + "datastore_id": {"key": "datastoreId", "type": "str"}, + "path": {"key": "path", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(JobOutputArtifacts, self).__init__(**kwargs) self.datastore_id = None self.path = None @@ -999,14 +962,11 @@ class LabelClass(msrest.serialization.Model): """ _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'subclasses': {'key': 'subclasses', 'type': '{LabelClass}'}, + "display_name": {"key": "displayName", "type": "str"}, + "subclasses": {"key": "subclasses", "type": "{LabelClass}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword display_name: Display name of the label class. :paramtype display_name: str @@ -1014,8 +974,8 @@ def __init__( :paramtype subclasses: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] """ super(LabelClass, self).__init__(**kwargs) - self.display_name = kwargs.get('display_name', None) - self.subclasses = kwargs.get('subclasses', None) + self.display_name = kwargs.get("display_name", None) + self.subclasses = kwargs.get("subclasses", None) class LiteralJobInput(JobInput): @@ -1034,20 +994,17 @@ class LiteralJobInput(JobInput): """ _validation = { - 'job_input_type': {'required': True}, - 'value': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "job_input_type": {"required": True}, + "value": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, + "value": {"key": "value", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: Description for the input. :paramtype description: str @@ -1055,8 +1012,8 @@ def __init__( :paramtype value: str """ super(LiteralJobInput, self).__init__(**kwargs) - self.job_input_type = 'Literal' # type: str - self.value = kwargs['value'] + self.job_input_type = "Literal" # type: str + self.value = kwargs["value"] class MLFlowModelJobInput(JobInput, AssetJobInput): @@ -1078,21 +1035,18 @@ class MLFlowModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -1103,10 +1057,10 @@ def __init__( :paramtype description: str """ super(MLFlowModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'MLFlowModel' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "MLFlowModel" # type: str + self.description = kwargs.get("description", None) class MLFlowModelJobOutput(JobOutputV2, AssetJobOutput): @@ -1127,20 +1081,17 @@ class MLFlowModelJobOutput(JobOutputV2, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -1151,10 +1102,10 @@ def __init__( :paramtype description: str """ super(MLFlowModelJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'MLFlowModel' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "MLFlowModel" # type: str + self.description = kwargs.get("description", None) class MLTableJobInput(JobInput, AssetJobInput): @@ -1176,21 +1127,18 @@ class MLTableJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -1201,10 +1149,10 @@ def __init__( :paramtype description: str """ super(MLTableJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'MLTable' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "MLTable" # type: str + self.description = kwargs.get("description", None) class MLTableJobOutput(JobOutputV2, AssetJobOutput): @@ -1225,20 +1173,17 @@ class MLTableJobOutput(JobOutputV2, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -1249,10 +1194,10 @@ def __init__( :paramtype description: str """ super(MLTableJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'MLTable' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "MLTable" # type: str + self.description = kwargs.get("description", None) class SystemData(msrest.serialization.Model): @@ -1275,18 +1220,15 @@ class SystemData(msrest.serialization.Model): """ _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): + "created_by": {"key": "createdBy", "type": "str"}, + "created_by_type": {"key": "createdByType", "type": "str"}, + "created_at": {"key": "createdAt", "type": "iso-8601"}, + "last_modified_by": {"key": "lastModifiedBy", "type": "str"}, + "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"}, + "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, + } + + def __init__(self, **kwargs): """ :keyword created_by: The identity that created the resource. :paramtype created_by: str @@ -1305,12 +1247,12 @@ def __init__( :paramtype last_modified_at: ~datetime.datetime """ super(SystemData, self).__init__(**kwargs) - self.created_by = kwargs.get('created_by', None) - self.created_by_type = kwargs.get('created_by_type', None) - self.created_at = kwargs.get('created_at', None) - self.last_modified_by = kwargs.get('last_modified_by', None) - self.last_modified_by_type = kwargs.get('last_modified_by_type', None) - self.last_modified_at = kwargs.get('last_modified_at', None) + self.created_by = kwargs.get("created_by", None) + self.created_by_type = kwargs.get("created_by_type", None) + self.created_at = kwargs.get("created_at", None) + self.last_modified_by = kwargs.get("last_modified_by", None) + self.last_modified_by_type = kwargs.get("last_modified_by_type", None) + self.last_modified_at = kwargs.get("last_modified_at", None) class TritonModelJobInput(JobInput, AssetJobInput): @@ -1332,21 +1274,18 @@ class TritonModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -1357,10 +1296,10 @@ def __init__( :paramtype description: str """ super(TritonModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'TritonModel' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "TritonModel" # type: str + self.description = kwargs.get("description", None) class TritonModelJobOutput(JobOutputV2, AssetJobOutput): @@ -1381,20 +1320,17 @@ class TritonModelJobOutput(JobOutputV2, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -1405,10 +1341,10 @@ def __init__( :paramtype description: str """ super(TritonModelJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'TritonModel' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "TritonModel" # type: str + self.description = kwargs.get("description", None) class UriFileJobInput(JobInput, AssetJobInput): @@ -1430,21 +1366,18 @@ class UriFileJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -1455,10 +1388,10 @@ def __init__( :paramtype description: str """ super(UriFileJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'UriFile' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "UriFile" # type: str + self.description = kwargs.get("description", None) class UriFileJobOutput(JobOutputV2, AssetJobOutput): @@ -1479,20 +1412,17 @@ class UriFileJobOutput(JobOutputV2, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -1503,10 +1433,10 @@ def __init__( :paramtype description: str """ super(UriFileJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'UriFile' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "UriFile" # type: str + self.description = kwargs.get("description", None) class UriFolderJobInput(JobInput, AssetJobInput): @@ -1528,21 +1458,18 @@ class UriFolderJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -1553,10 +1480,10 @@ def __init__( :paramtype description: str """ super(UriFolderJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'UriFolder' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "UriFolder" # type: str + self.description = kwargs.get("description", None) class UriFolderJobOutput(JobOutputV2, AssetJobOutput): @@ -1577,20 +1504,17 @@ class UriFolderJobOutput(JobOutputV2, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -1601,7 +1525,7 @@ def __init__( :paramtype description: str """ super(UriFolderJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'UriFolder' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "UriFolder" # type: str + self.description = kwargs.get("description", None) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/models/_models_py3.py index c7ac018a1a08..120ffa908f59 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/models/_models_py3.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/models/_models_py3.py @@ -28,12 +28,12 @@ class AssetJobInput(msrest.serialization.Model): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, } def __init__( @@ -66,8 +66,8 @@ class AssetJobOutput(msrest.serialization.Model): """ _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, } def __init__( @@ -154,33 +154,42 @@ class BatchJob(msrest.serialization.Model): """ _validation = { - 'interaction_endpoints': {'readonly': True}, - 'output': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'status': {'readonly': True}, + "interaction_endpoints": {"readonly": True}, + "output": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "status": {"readonly": True}, } _attribute_map = { - 'compute': {'key': 'compute', 'type': 'ComputeConfiguration'}, - 'dataset': {'key': 'dataset', 'type': 'InferenceDataInputBase'}, - 'description': {'key': 'description', 'type': 'str'}, - 'error_threshold': {'key': 'errorThreshold', 'type': 'int'}, - 'input_data': {'key': 'inputData', 'type': '{JobInput}'}, - 'interaction_endpoints': {'key': 'interactionEndpoints', 'type': '{JobEndpoint}'}, - 'logging_level': {'key': 'loggingLevel', 'type': 'str'}, - 'max_concurrency_per_instance': {'key': 'maxConcurrencyPerInstance', 'type': 'int'}, - 'mini_batch_size': {'key': 'miniBatchSize', 'type': 'long'}, - 'name': {'key': 'name', 'type': 'str'}, - 'output': {'key': 'output', 'type': 'JobOutputArtifacts'}, - 'output_data': {'key': 'outputData', 'type': '{JobOutputV2}'}, - 'output_dataset': {'key': 'outputDataset', 'type': 'DataVersion'}, - 'output_file_name': {'key': 'outputFileName', 'type': 'str'}, - 'partition_keys': {'key': 'partitionKeys', 'type': '[str]'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'retry_settings': {'key': 'retrySettings', 'type': 'BatchRetrySettings'}, - 'status': {'key': 'status', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "compute": {"key": "compute", "type": "ComputeConfiguration"}, + "dataset": {"key": "dataset", "type": "InferenceDataInputBase"}, + "description": {"key": "description", "type": "str"}, + "error_threshold": {"key": "errorThreshold", "type": "int"}, + "input_data": {"key": "inputData", "type": "{JobInput}"}, + "interaction_endpoints": { + "key": "interactionEndpoints", + "type": "{JobEndpoint}", + }, + "logging_level": {"key": "loggingLevel", "type": "str"}, + "max_concurrency_per_instance": { + "key": "maxConcurrencyPerInstance", + "type": "int", + }, + "mini_batch_size": {"key": "miniBatchSize", "type": "long"}, + "name": {"key": "name", "type": "str"}, + "output": {"key": "output", "type": "JobOutputArtifacts"}, + "output_data": {"key": "outputData", "type": "{JobOutputV2}"}, + "output_dataset": {"key": "outputDataset", "type": "DataVersion"}, + "output_file_name": {"key": "outputFileName", "type": "str"}, + "partition_keys": {"key": "partitionKeys", "type": "[str]"}, + "properties": {"key": "properties", "type": "{str}"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "retry_settings": { + "key": "retrySettings", + "type": "BatchRetrySettings", + }, + "status": {"key": "status", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, } def __init__( @@ -289,23 +298,19 @@ class Resource(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -334,27 +339,22 @@ class BatchJobResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'properties': {'required': True}, - 'system_data': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "properties": {"required": True}, + "system_data": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchJob'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "properties": {"key": "properties", "type": "BatchJob"}, + "system_data": {"key": "systemData", "type": "SystemData"}, } - def __init__( - self, - *, - properties: "BatchJob", - **kwargs - ): + def __init__(self, *, properties: "BatchJob", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.BatchJob @@ -375,8 +375,8 @@ class BatchJobResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchJobResource]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[BatchJobResource]"}, } def __init__( @@ -408,8 +408,8 @@ class BatchRetrySettings(msrest.serialization.Model): """ _attribute_map = { - 'max_retries': {'key': 'maxRetries', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "max_retries": {"key": "maxRetries", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } def __init__( @@ -449,12 +449,12 @@ class ComputeConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'is_local': {'key': 'isLocal', 'type': 'bool'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'target': {'key': 'target', 'type': 'str'}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "is_local": {"key": "isLocal", "type": "bool"}, + "location": {"key": "location", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "target": {"key": "target", "type": "str"}, } def __init__( @@ -509,24 +509,27 @@ class JobInput(msrest.serialization.Model): """ _validation = { - 'job_input_type': {'required': True}, + "job_input_type": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } _subtype_map = { - 'job_input_type': {'CustomModel': 'CustomModelJobInput', 'Literal': 'LiteralJobInput', 'MLFlowModel': 'MLFlowModelJobInput', 'MLTable': 'MLTableJobInput', 'TritonModel': 'TritonModelJobInput', 'UriFile': 'UriFileJobInput', 'UriFolder': 'UriFolderJobInput'} + "job_input_type": { + "CustomModel": "CustomModelJobInput", + "Literal": "LiteralJobInput", + "MLFlowModel": "MLFlowModelJobInput", + "MLTable": "MLTableJobInput", + "TritonModel": "TritonModelJobInput", + "UriFile": "UriFileJobInput", + "UriFolder": "UriFolderJobInput", + } } - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): + def __init__(self, *, description: Optional[str] = None, **kwargs): """ :keyword description: Description for the input. :paramtype description: str @@ -555,15 +558,15 @@ class CustomModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -583,10 +586,12 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(CustomModelJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(CustomModelJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'CustomModel' # type: str + self.job_input_type = "CustomModel" # type: str self.description = description @@ -606,24 +611,26 @@ class JobOutputV2(msrest.serialization.Model): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } _subtype_map = { - 'job_output_type': {'CustomModel': 'CustomModelJobOutput', 'MLFlowModel': 'MLFlowModelJobOutput', 'MLTable': 'MLTableJobOutput', 'TritonModel': 'TritonModelJobOutput', 'UriFile': 'UriFileJobOutput', 'UriFolder': 'UriFolderJobOutput'} + "job_output_type": { + "CustomModel": "CustomModelJobOutput", + "MLFlowModel": "MLFlowModelJobOutput", + "MLTable": "MLTableJobOutput", + "TritonModel": "TritonModelJobOutput", + "UriFile": "UriFileJobOutput", + "UriFolder": "UriFolderJobOutput", + } } - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): + def __init__(self, *, description: Optional[str] = None, **kwargs): """ :keyword description: Description for the output. :paramtype description: str @@ -651,14 +658,14 @@ class CustomModelJobOutput(JobOutputV2, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -678,10 +685,12 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(CustomModelJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(CustomModelJobOutput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_output_type = 'CustomModel' # type: str + self.job_output_type = "CustomModel" # type: str self.description = description @@ -707,17 +716,17 @@ class DataVersion(msrest.serialization.Model): """ _validation = { - 'path': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "path": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'dataset_type': {'key': 'datasetType', 'type': 'str'}, - 'datastore_id': {'key': 'datastoreId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'path': {'key': 'path', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "dataset_type": {"key": "datasetType", "type": "str"}, + "datastore_id": {"key": "datastoreId", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "path": {"key": "path", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, } def __init__( @@ -770,22 +779,16 @@ class ErrorDetail(msrest.serialization.Model): """ _validation = { - 'code': {'required': True}, - 'message': {'required': True}, + "code": {"required": True}, + "message": {"required": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, } - def __init__( - self, - *, - code: str, - message: str, - **kwargs - ): + def __init__(self, *, code: str, message: str, **kwargs): """ :keyword code: Required. Error code. :paramtype code: str @@ -811,23 +814,19 @@ class ErrorResponse(msrest.serialization.Model): """ _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'details': {'readonly': True}, + "code": {"readonly": True}, + "message": {"readonly": True}, + "details": {"readonly": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "details": {"key": "details", "type": "[ErrorDetail]"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ErrorResponse, self).__init__(**kwargs) self.code = None self.message = None @@ -849,23 +848,23 @@ class InferenceDataInputBase(msrest.serialization.Model): """ _validation = { - 'data_input_type': {'required': True}, + "data_input_type": {"required": True}, } _attribute_map = { - 'data_input_type': {'key': 'dataInputType', 'type': 'str'}, + "data_input_type": {"key": "dataInputType", "type": "str"}, } _subtype_map = { - 'data_input_type': {'DataUrl': 'InferenceDataUrlInput', 'DatasetId': 'InferenceDatasetIdInput', 'DatasetVersion': 'InferenceDatasetInput'} + "data_input_type": { + "DataUrl": "InferenceDataUrlInput", + "DatasetId": "InferenceDatasetIdInput", + "DatasetVersion": "InferenceDatasetInput", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(InferenceDataInputBase, self).__init__(**kwargs) self.data_input_type = None # type: Optional[str] @@ -884,26 +883,21 @@ class InferenceDatasetIdInput(InferenceDataInputBase): """ _validation = { - 'data_input_type': {'required': True}, + "data_input_type": {"required": True}, } _attribute_map = { - 'data_input_type': {'key': 'dataInputType', 'type': 'str'}, - 'dataset_id': {'key': 'datasetId', 'type': 'str'}, + "data_input_type": {"key": "dataInputType", "type": "str"}, + "dataset_id": {"key": "datasetId", "type": "str"}, } - def __init__( - self, - *, - dataset_id: Optional[str] = None, - **kwargs - ): + def __init__(self, *, dataset_id: Optional[str] = None, **kwargs): """ :keyword dataset_id: ARM ID of the input dataset. :paramtype dataset_id: str """ super(InferenceDatasetIdInput, self).__init__(**kwargs) - self.data_input_type = 'DatasetId' # type: str + self.data_input_type = "DatasetId" # type: str self.dataset_id = dataset_id @@ -923,13 +917,13 @@ class InferenceDatasetInput(InferenceDataInputBase): """ _validation = { - 'data_input_type': {'required': True}, + "data_input_type": {"required": True}, } _attribute_map = { - 'data_input_type': {'key': 'dataInputType', 'type': 'str'}, - 'dataset_name': {'key': 'datasetName', 'type': 'str'}, - 'dataset_version': {'key': 'datasetVersion', 'type': 'str'}, + "data_input_type": {"key": "dataInputType", "type": "str"}, + "dataset_name": {"key": "datasetName", "type": "str"}, + "dataset_version": {"key": "datasetVersion", "type": "str"}, } def __init__( @@ -946,7 +940,7 @@ def __init__( :paramtype dataset_version: str """ super(InferenceDatasetInput, self).__init__(**kwargs) - self.data_input_type = 'DatasetVersion' # type: str + self.data_input_type = "DatasetVersion" # type: str self.dataset_name = dataset_name self.dataset_version = dataset_version @@ -965,27 +959,22 @@ class InferenceDataUrlInput(InferenceDataInputBase): """ _validation = { - 'data_input_type': {'required': True}, - 'path': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "data_input_type": {"required": True}, + "path": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'data_input_type': {'key': 'dataInputType', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, + "data_input_type": {"key": "dataInputType", "type": "str"}, + "path": {"key": "path", "type": "str"}, } - def __init__( - self, - *, - path: str, - **kwargs - ): + def __init__(self, *, path: str, **kwargs): """ :keyword path: Required. Asset path to the input data, say a blob URL. :paramtype path: str """ super(InferenceDataUrlInput, self).__init__(**kwargs) - self.data_input_type = 'DataUrl' # type: str + self.data_input_type = "DataUrl" # type: str self.path = path @@ -1003,10 +992,10 @@ class JobEndpoint(msrest.serialization.Model): """ _attribute_map = { - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'job_endpoint_type': {'key': 'jobEndpointType', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{str}'}, + "endpoint": {"key": "endpoint", "type": "str"}, + "job_endpoint_type": {"key": "jobEndpointType", "type": "str"}, + "port": {"key": "port", "type": "int"}, + "properties": {"key": "properties", "type": "{str}"}, } def __init__( @@ -1047,21 +1036,17 @@ class JobOutputArtifacts(msrest.serialization.Model): """ _validation = { - 'datastore_id': {'readonly': True}, - 'path': {'readonly': True}, + "datastore_id": {"readonly": True}, + "path": {"readonly": True}, } _attribute_map = { - 'datastore_id': {'key': 'datastoreId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, + "datastore_id": {"key": "datastoreId", "type": "str"}, + "path": {"key": "path", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(JobOutputArtifacts, self).__init__(**kwargs) self.datastore_id = None self.path = None @@ -1077,8 +1062,8 @@ class LabelClass(msrest.serialization.Model): """ _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'subclasses': {'key': 'subclasses', 'type': '{LabelClass}'}, + "display_name": {"key": "displayName", "type": "str"}, + "subclasses": {"key": "subclasses", "type": "{LabelClass}"}, } def __init__( @@ -1115,22 +1100,18 @@ class LiteralJobInput(JobInput): """ _validation = { - 'job_input_type': {'required': True}, - 'value': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "job_input_type": {"required": True}, + "value": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, + "value": {"key": "value", "type": "str"}, } def __init__( - self, - *, - value: str, - description: Optional[str] = None, - **kwargs + self, *, value: str, description: Optional[str] = None, **kwargs ): """ :keyword description: Description for the input. @@ -1138,8 +1119,10 @@ def __init__( :keyword value: Required. Literal input value. :paramtype value: str """ - super(LiteralJobInput, self).__init__(description=description, **kwargs) - self.job_input_type = 'Literal' # type: str + super(LiteralJobInput, self).__init__( + description=description, **kwargs + ) + self.job_input_type = "Literal" # type: str self.value = value @@ -1162,15 +1145,15 @@ class MLFlowModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -1190,10 +1173,12 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(MLFlowModelJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(MLFlowModelJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'MLFlowModel' # type: str + self.job_input_type = "MLFlowModel" # type: str self.description = description @@ -1215,14 +1200,14 @@ class MLFlowModelJobOutput(JobOutputV2, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -1242,10 +1227,12 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(MLFlowModelJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(MLFlowModelJobOutput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_output_type = 'MLFlowModel' # type: str + self.job_output_type = "MLFlowModel" # type: str self.description = description @@ -1268,15 +1255,15 @@ class MLTableJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -1296,10 +1283,12 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(MLTableJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(MLTableJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'MLTable' # type: str + self.job_input_type = "MLTable" # type: str self.description = description @@ -1321,14 +1310,14 @@ class MLTableJobOutput(JobOutputV2, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -1348,10 +1337,12 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(MLTableJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(MLTableJobOutput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_output_type = 'MLTable' # type: str + self.job_output_type = "MLTable" # type: str self.description = description @@ -1375,12 +1366,12 @@ class SystemData(msrest.serialization.Model): """ _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + "created_by": {"key": "createdBy", "type": "str"}, + "created_by_type": {"key": "createdByType", "type": "str"}, + "created_at": {"key": "createdAt", "type": "iso-8601"}, + "last_modified_by": {"key": "lastModifiedBy", "type": "str"}, + "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"}, + "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, } def __init__( @@ -1439,15 +1430,15 @@ class TritonModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -1467,10 +1458,12 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(TritonModelJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(TritonModelJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'TritonModel' # type: str + self.job_input_type = "TritonModel" # type: str self.description = description @@ -1492,14 +1485,14 @@ class TritonModelJobOutput(JobOutputV2, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -1519,10 +1512,12 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(TritonModelJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(TritonModelJobOutput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_output_type = 'TritonModel' # type: str + self.job_output_type = "TritonModel" # type: str self.description = description @@ -1545,15 +1540,15 @@ class UriFileJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -1573,10 +1568,12 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(UriFileJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(UriFileJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'UriFile' # type: str + self.job_input_type = "UriFile" # type: str self.description = description @@ -1598,14 +1595,14 @@ class UriFileJobOutput(JobOutputV2, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -1625,10 +1622,12 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(UriFileJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(UriFileJobOutput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_output_type = 'UriFile' # type: str + self.job_output_type = "UriFile" # type: str self.description = description @@ -1651,15 +1650,15 @@ class UriFolderJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -1679,10 +1678,12 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(UriFolderJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(UriFolderJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'UriFolder' # type: str + self.job_input_type = "UriFolder" # type: str self.description = description @@ -1704,14 +1705,14 @@ class UriFolderJobOutput(JobOutputV2, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -1731,8 +1732,10 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(UriFolderJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(UriFolderJobOutput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_output_type = 'UriFolder' # type: str + self.job_output_type = "UriFolder" # type: str self.description = description diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/operations/__init__.py index 7d1a5550ce1d..e3785b14761f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/operations/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/operations/__init__.py @@ -10,6 +10,6 @@ from ._batch_job_endpoint_operations import BatchJobEndpointOperations __all__ = [ - 'BatchJobDeploymentOperations', - 'BatchJobEndpointOperations', + "BatchJobDeploymentOperations", + "BatchJobEndpointOperations", ] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/operations/_batch_job_deployment_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/operations/_batch_job_deployment_operations.py index a2bf1568b18a..36a79f34e6ac 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/operations/_batch_job_deployment_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/operations/_batch_job_deployment_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -161,6 +173,7 @@ def build_get_request( **kwargs ) + # fmt: on class BatchJobDeploymentOperations(object): """BatchJobDeploymentOperations operations. @@ -216,16 +229,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.BatchJobResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2020-09-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2020-09-01-dataplanepreview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchJobResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchJobResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( endpoint_name=endpoint_name, deployment_name=deployment_name, @@ -234,13 +254,13 @@ def prepare_request(next_link=None): workspace_name=workspace_name, api_version=api_version, skiptoken=skiptoken, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( endpoint_name=endpoint_name, deployment_name=deployment_name, @@ -257,7 +277,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("BatchJobResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "BatchJobResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -266,25 +288,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}/jobs"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}/jobs"} # type: ignore @distributed_trace def create( @@ -316,16 +344,24 @@ def create( :rtype: ~azure.mgmt.machinelearningservices.models.BatchJobResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchJobResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchJobResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2020-09-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2020-09-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'BatchJobResource') + _json = self._serialize.body(body, "BatchJobResource") request = build_create_request( endpoint_name=endpoint_name, @@ -336,36 +372,47 @@ def create( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create.metadata['url'], + template_url=self.create.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('BatchJobResource', pipeline_response) + deserialized = self._deserialize( + "BatchJobResource", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('BatchJobResource', pipeline_response) + deserialized = self._deserialize( + "BatchJobResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}/jobs"} # type: ignore - + create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}/jobs"} # type: ignore @distributed_trace def get( @@ -397,15 +444,20 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.BatchJobResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchJobResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchJobResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2020-09-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2020-09-01-dataplanepreview" + ) # type: str - request = build_get_request( endpoint_name=endpoint_name, deployment_name=deployment_name, @@ -414,29 +466,36 @@ def get( resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchJobResource', pipeline_response) + deserialized = self._deserialize("BatchJobResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}/jobs/{id}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}/jobs/{id}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/operations/_batch_job_endpoint_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/operations/_batch_job_endpoint_operations.py index 34dc281370f6..0fcf68bcbf46 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/operations/_batch_job_endpoint_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2020_09_01_dataplanepreview/operations/_batch_job_endpoint_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -158,6 +170,7 @@ def build_get_request( **kwargs ) + # fmt: on class BatchJobEndpointOperations(object): """BatchJobEndpointOperations operations. @@ -213,16 +226,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.BatchJobResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2020-09-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2020-09-01-dataplanepreview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchJobResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchJobResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( endpoint_name=endpoint_name, subscription_id=self._config.subscription_id, @@ -231,13 +251,13 @@ def prepare_request(next_link=None): api_version=api_version, deployment=deployment, skiptoken=skiptoken, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( endpoint_name=endpoint_name, subscription_id=self._config.subscription_id, @@ -254,7 +274,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("BatchJobResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "BatchJobResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -263,25 +285,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/jobs"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/jobs"} # type: ignore @distributed_trace def create( @@ -310,16 +338,24 @@ def create( :rtype: ~azure.mgmt.machinelearningservices.models.BatchJobResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchJobResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchJobResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2020-09-01-dataplanepreview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2020-09-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'BatchJobResource') + _json = self._serialize.body(body, "BatchJobResource") request = build_create_request( endpoint_name=endpoint_name, @@ -329,36 +365,47 @@ def create( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create.metadata['url'], + template_url=self.create.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('BatchJobResource', pipeline_response) + deserialized = self._deserialize( + "BatchJobResource", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('BatchJobResource', pipeline_response) + deserialized = self._deserialize( + "BatchJobResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/jobs"} # type: ignore - + create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/jobs"} # type: ignore @distributed_trace def get( @@ -387,15 +434,20 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.BatchJobResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchJobResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchJobResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2020-09-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2020-09-01-dataplanepreview" + ) # type: str - request = build_get_request( endpoint_name=endpoint_name, id=id, @@ -403,29 +455,36 @@ def get( resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchJobResource', pipeline_response) + deserialized = self._deserialize("BatchJobResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/jobs/{id}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/jobs/{id}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/__init__.py index da46614477a9..71cf8fdc020d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/__init__.py @@ -10,9 +10,10 @@ from ._version import VERSION __version__ = VERSION -__all__ = ['AzureMachineLearningWorkspaces'] +__all__ = ["AzureMachineLearningWorkspaces"] # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk + patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/_azure_machine_learning_workspaces.py index b2e9003e40dd..9cd8299ec7a5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/_azure_machine_learning_workspaces.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/_azure_machine_learning_workspaces.py @@ -102,36 +102,54 @@ def __init__( self._config = AzureMachineLearningWorkspacesConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._client = ARMPipelineClient( + base_url=base_url, config=self._config, **kwargs + ) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = { + k: v for k, v in models.__dict__.items() if isinstance(v, type) + } self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.code_containers = CodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_versions = CodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.code_containers = CodeContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.code_versions = CodeVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.component_containers = ComponentContainersOperations( self._client, self._config, self._serialize, self._deserialize ) self.component_versions = ComponentVersionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.data_containers = DataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_versions = DataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_references = DataReferencesOperations(self._client, self._config, self._serialize, self._deserialize) + self.data_containers = DataContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_versions = DataVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_references = DataReferencesOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.environment_containers = EnvironmentContainersOperations( self._client, self._config, self._serialize, self._deserialize ) self.environment_versions = EnvironmentVersionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.resource_management_asset_reference = ResourceManagementAssetReferenceOperations( - self._client, self._config, self._serialize, self._deserialize + self.resource_management_asset_reference = ( + ResourceManagementAssetReferenceOperations( + self._client, self._config, self._serialize, self._deserialize + ) ) self.model_containers = ModelContainersOperations( self._client, self._config, self._serialize, self._deserialize ) - self.model_versions = ModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.model_versions = ModelVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.temporary_data_references = TemporaryDataReferencesOperations( self._client, self._config, self._serialize, self._deserialize ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/_configuration.py index b221460611bd..4272eec2089b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/_configuration.py @@ -10,7 +10,10 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ( + ARMChallengeAuthenticationPolicy, + ARMHttpLoggingPolicy, +) from ._version import VERSION @@ -42,8 +45,12 @@ def __init__( **kwargs # type: Any ): # type: (...) -> None - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str + super(AzureMachineLearningWorkspacesConfiguration, self).__init__( + **kwargs + ) + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -53,22 +60,42 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = api_version - self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) - kwargs.setdefault("sdk_moniker", "mgmt-machinelearningservices/{}".format(VERSION)) + self.credential_scopes = kwargs.pop( + "credential_scopes", ["https://management.azure.com/.default"] + ) + kwargs.setdefault( + "sdk_moniker", "mgmt-machinelearningservices/{}".format(VERSION) + ) self._configure(**kwargs) def _configure( self, **kwargs # type: Any ): # type: (...) -> None - self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.user_agent_policy = kwargs.get( + "user_agent_policy" + ) or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get( + "headers_policy" + ) or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy( + **kwargs + ) + self.logging_policy = kwargs.get( + "logging_policy" + ) or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get( + "http_logging_policy" + ) or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy( + **kwargs + ) + self.custom_hook_policy = kwargs.get( + "custom_hook_policy" + ) or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get( + "redirect_policy" + ) or policies.RedirectPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = ARMChallengeAuthenticationPolicy( diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/_patch.py index 74e48ecd07cf..17dbc073e01b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/_patch.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/_patch.py @@ -25,7 +25,8 @@ # # -------------------------------------------------------------------------- + # This file is used for handwritten extensions to the generated code. Example: # https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md def patch_sdk(): - pass \ No newline at end of file + pass diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/_vendor.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/_vendor.py index 138f663c53a4..ed3373e9699d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/_vendor.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/_vendor.py @@ -7,13 +7,20 @@ from azure.core.pipeline.transport import HttpRequest + def _convert_request(request, files=None): data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + request = HttpRequest( + method=request.method, + url=request.url, + headers=request.headers, + data=data, + ) if files: request.set_formdata_body(files) return request + def _format_url_section(template, **kwargs): components = template.split("/") while components: @@ -22,6 +29,8 @@ def _format_url_section(template, **kwargs): except KeyError as key: formatted_components = template.split("/") components = [ - c for c in formatted_components if "{}".format(key.args[0]) not in c + c + for c in formatted_components + if "{}".format(key.args[0]) not in c ] template = "/".join(components) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/__init__.py index f67ccda966f1..b90ec7485f14 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/__init__.py @@ -7,9 +7,11 @@ # -------------------------------------------------------------------------- from ._azure_machine_learning_workspaces import AzureMachineLearningWorkspaces -__all__ = ['AzureMachineLearningWorkspaces'] + +__all__ = ["AzureMachineLearningWorkspaces"] # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk + patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/_azure_machine_learning_workspaces.py index 98ad2fa8c311..a156144e1ee0 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/_azure_machine_learning_workspaces.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/_azure_machine_learning_workspaces.py @@ -102,41 +102,61 @@ def __init__( self._config = AzureMachineLearningWorkspacesConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._client = AsyncARMPipelineClient( + base_url=base_url, config=self._config, **kwargs + ) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = { + k: v for k, v in models.__dict__.items() if isinstance(v, type) + } self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.code_containers = CodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_versions = CodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.code_containers = CodeContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.code_versions = CodeVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.component_containers = ComponentContainersOperations( self._client, self._config, self._serialize, self._deserialize ) self.component_versions = ComponentVersionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.data_containers = DataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_versions = DataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_references = DataReferencesOperations(self._client, self._config, self._serialize, self._deserialize) + self.data_containers = DataContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_versions = DataVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_references = DataReferencesOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.environment_containers = EnvironmentContainersOperations( self._client, self._config, self._serialize, self._deserialize ) self.environment_versions = EnvironmentVersionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.resource_management_asset_reference = ResourceManagementAssetReferenceOperations( - self._client, self._config, self._serialize, self._deserialize + self.resource_management_asset_reference = ( + ResourceManagementAssetReferenceOperations( + self._client, self._config, self._serialize, self._deserialize + ) ) self.model_containers = ModelContainersOperations( self._client, self._config, self._serialize, self._deserialize ) - self.model_versions = ModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.model_versions = ModelVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.temporary_data_references = TemporaryDataReferencesOperations( self._client, self._config, self._serialize, self._deserialize ) - def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: + def _send_request( + self, request: HttpRequest, **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/_configuration.py index ba917c3e4e5f..1e3ce19708f1 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/_configuration.py @@ -10,7 +10,10 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy +from azure.mgmt.core.policies import ( + ARMHttpLoggingPolicy, + AsyncARMChallengeAuthenticationPolicy, +) from .._version import VERSION @@ -33,9 +36,18 @@ class AzureMachineLearningWorkspacesConfiguration(Configuration): :paramtype api_version: str """ - def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(AzureMachineLearningWorkspacesConfiguration, self).__init__( + **kwargs + ) + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -45,19 +57,39 @@ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **k self.credential = credential self.subscription_id = subscription_id self.api_version = api_version - self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) - kwargs.setdefault("sdk_moniker", "mgmt-machinelearningservices/{}".format(VERSION)) + self.credential_scopes = kwargs.pop( + "credential_scopes", ["https://management.azure.com/.default"] + ) + kwargs.setdefault( + "sdk_moniker", "mgmt-machinelearningservices/{}".format(VERSION) + ) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: - self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.user_agent_policy = kwargs.get( + "user_agent_policy" + ) or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get( + "headers_policy" + ) or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy( + **kwargs + ) + self.logging_policy = kwargs.get( + "logging_policy" + ) or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get( + "http_logging_policy" + ) or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get( + "retry_policy" + ) or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get( + "custom_hook_policy" + ) or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get( + "redirect_policy" + ) or policies.AsyncRedirectPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/_patch.py index 74e48ecd07cf..17dbc073e01b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/_patch.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/_patch.py @@ -25,7 +25,8 @@ # # -------------------------------------------------------------------------- + # This file is used for handwritten extensions to the generated code. Example: # https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md def patch_sdk(): - pass \ No newline at end of file + pass diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/__init__.py index b7a43c68f0ab..bfbde2453dc2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/__init__.py @@ -15,23 +15,27 @@ from ._data_references_operations import DataReferencesOperations from ._environment_containers_operations import EnvironmentContainersOperations from ._environment_versions_operations import EnvironmentVersionsOperations -from ._resource_management_asset_reference_operations import ResourceManagementAssetReferenceOperations +from ._resource_management_asset_reference_operations import ( + ResourceManagementAssetReferenceOperations, +) from ._model_containers_operations import ModelContainersOperations from ._model_versions_operations import ModelVersionsOperations -from ._temporary_data_references_operations import TemporaryDataReferencesOperations +from ._temporary_data_references_operations import ( + TemporaryDataReferencesOperations, +) __all__ = [ - 'CodeContainersOperations', - 'CodeVersionsOperations', - 'ComponentContainersOperations', - 'ComponentVersionsOperations', - 'DataContainersOperations', - 'DataVersionsOperations', - 'DataReferencesOperations', - 'EnvironmentContainersOperations', - 'EnvironmentVersionsOperations', - 'ResourceManagementAssetReferenceOperations', - 'ModelContainersOperations', - 'ModelVersionsOperations', - 'TemporaryDataReferencesOperations', + "CodeContainersOperations", + "CodeVersionsOperations", + "ComponentContainersOperations", + "ComponentVersionsOperations", + "DataContainersOperations", + "DataVersionsOperations", + "DataReferencesOperations", + "EnvironmentContainersOperations", + "EnvironmentVersionsOperations", + "ResourceManagementAssetReferenceOperations", + "ModelContainersOperations", + "ModelVersionsOperations", + "TemporaryDataReferencesOperations", ] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_code_containers_operations.py index 60d6c9d91a53..11f9a88a2f68 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_code_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_code_containers_operations.py @@ -6,7 +6,15 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -34,7 +42,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class CodeContainersOperations: @@ -61,7 +74,11 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list( - self, resource_group_name: str, registry_name: str, skiptoken: Optional[str] = None, **kwargs: Any + self, + resource_group_name: str, + registry_name: str, + skiptoken: Optional[str] = None, + **kwargs: Any ) -> AsyncIterable["_models.CodeContainerResourceArmPaginatedResult"]: """List containers. @@ -83,10 +100,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -119,7 +144,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -128,13 +155,23 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -143,7 +180,13 @@ async def get_next(next_link=None): list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes"} # type: ignore @distributed_trace_async - async def delete(self, name: str, resource_group_name: str, registry_name: str, **kwargs: Any) -> None: + async def delete( + self, + name: str, + resource_group_name: str, + registry_name: str, + **kwargs: Any + ) -> None: """Delete container. Delete container. @@ -163,10 +206,16 @@ async def delete(self, name: str, resource_group_name: str, registry_name: str, :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str request = build_delete_request( name=name, @@ -179,13 +228,23 @@ async def delete(self, name: str, resource_group_name: str, registry_name: str, request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -194,7 +253,11 @@ async def delete(self, name: str, resource_group_name: str, registry_name: str, @distributed_trace_async async def get( - self, name: str, resource_group_name: str, registry_name: str, **kwargs: Any + self, + name: str, + resource_group_name: str, + registry_name: str, + **kwargs: Any ) -> "_models.CodeContainerData": """Get container. @@ -214,11 +277,19 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainerData"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeContainerData"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str request = build_get_request( name=name, @@ -231,15 +302,27 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("CodeContainerData", pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "CodeContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -250,7 +333,12 @@ async def get( @distributed_trace_async async def create_or_update( - self, name: str, resource_group_name: str, registry_name: str, body: "_models.CodeContainerData", **kwargs: Any + self, + name: str, + resource_group_name: str, + registry_name: str, + body: "_models.CodeContainerData", + **kwargs: Any ) -> "_models.CodeContainerData": """Create or update container. @@ -272,12 +360,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainerData"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeContainerData"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "CodeContainerData") @@ -294,15 +392,27 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("CodeContainerData", pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "CodeContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_code_versions_operations.py index f1b142689e6a..83e14c4fb941 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_code_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_code_versions_operations.py @@ -6,7 +6,16 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, + Union, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -19,7 +28,11 @@ ) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -36,7 +49,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class CodeVersionsOperations: @@ -98,10 +116,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -140,7 +166,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -149,13 +177,23 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -165,7 +203,12 @@ async def get_next(next_link=None): @distributed_trace_async async def delete( - self, name: str, version: str, resource_group_name: str, registry_name: str, **kwargs: Any + self, + name: str, + version: str, + resource_group_name: str, + registry_name: str, + **kwargs: Any ) -> None: """Delete version. @@ -188,10 +231,16 @@ async def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str request = build_delete_request( name=name, @@ -205,13 +254,23 @@ async def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -220,7 +279,12 @@ async def delete( @distributed_trace_async async def get( - self, name: str, version: str, resource_group_name: str, registry_name: str, **kwargs: Any + self, + name: str, + version: str, + resource_group_name: str, + registry_name: str, + **kwargs: Any ) -> "_models.CodeVersionData": """Get version. @@ -242,11 +306,19 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersionData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersionData"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeVersionData"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str request = build_get_request( name=name, @@ -260,13 +332,23 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("CodeVersionData", pipeline_response) @@ -287,11 +369,19 @@ async def _create_or_update_initial( **kwargs: Any ) -> None: cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "CodeVersionData") @@ -309,19 +399,31 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} response_headers["x-ms-async-operation-timeout"] = self._deserialize( "duration", response.headers.get("x-ms-async-operation-timeout") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) @@ -367,12 +469,22 @@ async def begin_create_or_update( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( name=name, @@ -405,6 +517,11 @@ def get_long_running_output(pipeline_response): deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_component_containers_operations.py index 78155073cb5c..b441d6839458 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_component_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_component_containers_operations.py @@ -6,7 +6,15 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -34,7 +42,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class ComponentContainersOperations: @@ -61,7 +74,11 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list( - self, resource_group_name: str, registry_name: str, skiptoken: Optional[str] = None, **kwargs: Any + self, + resource_group_name: str, + registry_name: str, + skiptoken: Optional[str] = None, + **kwargs: Any ) -> AsyncIterable["_models.ComponentContainerResourceArmPaginatedResult"]: """List containers. @@ -83,10 +100,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -119,7 +144,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -128,13 +156,23 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -143,7 +181,13 @@ async def get_next(next_link=None): list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components"} # type: ignore @distributed_trace_async - async def delete(self, name: str, resource_group_name: str, registry_name: str, **kwargs: Any) -> None: + async def delete( + self, + name: str, + resource_group_name: str, + registry_name: str, + **kwargs: Any + ) -> None: """Delete container. Delete container. @@ -163,10 +207,16 @@ async def delete(self, name: str, resource_group_name: str, registry_name: str, :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str request = build_delete_request( name=name, @@ -179,13 +229,23 @@ async def delete(self, name: str, resource_group_name: str, registry_name: str, request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -194,7 +254,11 @@ async def delete(self, name: str, resource_group_name: str, registry_name: str, @distributed_trace_async async def get( - self, name: str, resource_group_name: str, registry_name: str, **kwargs: Any + self, + name: str, + resource_group_name: str, + registry_name: str, + **kwargs: Any ) -> "_models.ComponentContainerData": """Get container. @@ -214,11 +278,19 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComponentContainerData"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainerData"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str request = build_get_request( name=name, @@ -231,15 +303,27 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ComponentContainerData", pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "ComponentContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -277,12 +361,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComponentContainerData"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainerData"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "ComponentContainerData") @@ -299,15 +393,27 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ComponentContainerData", pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "ComponentContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_component_versions_operations.py index 9ffc9360add5..968f7bf7dd92 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_component_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_component_versions_operations.py @@ -6,7 +6,16 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, + Union, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -19,7 +28,11 @@ ) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -36,7 +49,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class ComponentVersionsOperations: @@ -98,10 +116,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -140,7 +166,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -149,13 +177,23 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -165,7 +203,12 @@ async def get_next(next_link=None): @distributed_trace_async async def delete( - self, name: str, version: str, resource_group_name: str, registry_name: str, **kwargs: Any + self, + name: str, + version: str, + resource_group_name: str, + registry_name: str, + **kwargs: Any ) -> None: """Delete version. @@ -188,10 +231,16 @@ async def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str request = build_delete_request( name=name, @@ -205,13 +254,23 @@ async def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -220,7 +279,12 @@ async def delete( @distributed_trace_async async def get( - self, name: str, version: str, resource_group_name: str, registry_name: str, **kwargs: Any + self, + name: str, + version: str, + resource_group_name: str, + registry_name: str, + **kwargs: Any ) -> "_models.ComponentVersionData": """Get version. @@ -242,11 +306,19 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersionData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComponentVersionData"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersionData"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str request = build_get_request( name=name, @@ -260,15 +332,27 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("ComponentVersionData", pipeline_response) + deserialized = self._deserialize( + "ComponentVersionData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -287,11 +371,19 @@ async def _create_or_update_initial( **kwargs: Any ) -> None: cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "ComponentVersionData") @@ -309,19 +401,31 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} response_headers["x-ms-async-operation-timeout"] = self._deserialize( "duration", response.headers.get("x-ms-async-operation-timeout") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) @@ -367,12 +471,22 @@ async def begin_create_or_update( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( name=name, @@ -405,6 +519,11 @@ def get_long_running_output(pipeline_response): deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_data_containers_operations.py index 807e673c11ac..bc721693db7e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_data_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_data_containers_operations.py @@ -6,7 +6,16 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, + Union, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -34,7 +43,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class DataContainersOperations: @@ -90,10 +104,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -128,7 +150,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -137,13 +161,23 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -152,7 +186,13 @@ async def get_next(next_link=None): list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data"} # type: ignore @distributed_trace_async - async def delete(self, name: str, resource_group_name: str, registry_name: str, **kwargs: Any) -> None: + async def delete( + self, + name: str, + resource_group_name: str, + registry_name: str, + **kwargs: Any + ) -> None: """Delete container. Delete container. @@ -172,10 +212,16 @@ async def delete(self, name: str, resource_group_name: str, registry_name: str, :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str request = build_delete_request( name=name, @@ -188,13 +234,23 @@ async def delete(self, name: str, resource_group_name: str, registry_name: str, request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -203,7 +259,11 @@ async def delete(self, name: str, resource_group_name: str, registry_name: str, @distributed_trace_async async def get( - self, name: str, resource_group_name: str, registry_name: str, **kwargs: Any + self, + name: str, + resource_group_name: str, + registry_name: str, + **kwargs: Any ) -> "_models.DataContainerData": """Get container. @@ -223,11 +283,19 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainerData"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerData"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str request = build_get_request( name=name, @@ -240,15 +308,27 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DataContainerData", pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "DataContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -259,7 +339,12 @@ async def get( @distributed_trace_async async def create_or_update( - self, name: str, resource_group_name: str, registry_name: str, body: "_models.DataContainerData", **kwargs: Any + self, + name: str, + resource_group_name: str, + registry_name: str, + body: "_models.DataContainerData", + **kwargs: Any ) -> "_models.DataContainerData": """Create or update container. @@ -281,12 +366,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainerData"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerData"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "DataContainerData") @@ -303,15 +398,27 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DataContainerData", pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "DataContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_data_references_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_data_references_operations.py index 40778e686c78..e2979625fb87 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_data_references_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_data_references_operations.py @@ -24,10 +24,17 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._data_references_operations import build_get_blob_reference_sas_request +from ...operations._data_references_operations import ( + build_get_blob_reference_sas_request, +) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class DataReferencesOperations: @@ -82,12 +89,22 @@ async def get_blob_reference_sas( :rtype: ~azure.mgmt.machinelearningservices.models.BlobReferenceSASResponseDto :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.BlobReferenceSASResponseDto"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BlobReferenceSASResponseDto"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "BlobReferenceSASRequestDto") @@ -105,15 +122,27 @@ async def get_blob_reference_sas( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("BlobReferenceSASResponseDto", pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "BlobReferenceSASResponseDto", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_data_versions_operations.py index a8c9ce07e1f2..bc77d25faf48 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_data_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_data_versions_operations.py @@ -6,7 +6,16 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, + Union, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -19,7 +28,11 @@ ) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -36,7 +49,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class DataVersionsOperations: @@ -108,10 +126,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -154,7 +180,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataVersionBaseResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -163,13 +191,23 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -179,7 +217,12 @@ async def get_next(next_link=None): @distributed_trace_async async def delete( - self, name: str, version: str, resource_group_name: str, registry_name: str, **kwargs: Any + self, + name: str, + version: str, + resource_group_name: str, + registry_name: str, + **kwargs: Any ) -> None: """Delete version. @@ -202,10 +245,16 @@ async def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str request = build_delete_request( name=name, @@ -219,13 +268,23 @@ async def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -234,7 +293,12 @@ async def delete( @distributed_trace_async async def get( - self, name: str, version: str, resource_group_name: str, registry_name: str, **kwargs: Any + self, + name: str, + version: str, + resource_group_name: str, + registry_name: str, + **kwargs: Any ) -> "_models.DataVersionBaseData": """Get version. @@ -256,11 +320,19 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBaseData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.DataVersionBaseData"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBaseData"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str request = build_get_request( name=name, @@ -274,15 +346,27 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("DataVersionBaseData", pipeline_response) + deserialized = self._deserialize( + "DataVersionBaseData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -301,11 +385,19 @@ async def _create_or_update_initial( **kwargs: Any ) -> None: cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "DataVersionBaseData") @@ -323,19 +415,31 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} response_headers["x-ms-async-operation-timeout"] = self._deserialize( "duration", response.headers.get("x-ms-async-operation-timeout") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) @@ -381,12 +485,22 @@ async def begin_create_or_update( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( name=name, @@ -419,6 +533,11 @@ def get_long_running_output(pipeline_response): deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_environment_containers_operations.py index 28c51e549547..b124e8e5992a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_environment_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_environment_containers_operations.py @@ -6,7 +6,16 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, + Union, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -34,7 +43,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class EnvironmentContainersOperations: @@ -67,7 +81,9 @@ def list( skiptoken: Optional[str] = None, list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, **kwargs: Any - ) -> AsyncIterable["_models.EnvironmentContainerResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.EnvironmentContainerResourceArmPaginatedResult" + ]: """List environment containers. List environment containers. @@ -90,10 +106,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -128,7 +152,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -137,13 +164,23 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -152,7 +189,13 @@ async def get_next(next_link=None): list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments"} # type: ignore @distributed_trace_async - async def delete(self, name: str, resource_group_name: str, registry_name: str, **kwargs: Any) -> None: + async def delete( + self, + name: str, + resource_group_name: str, + registry_name: str, + **kwargs: Any + ) -> None: """Delete container. Delete container. @@ -172,10 +215,16 @@ async def delete(self, name: str, resource_group_name: str, registry_name: str, :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str request = build_delete_request( name=name, @@ -188,13 +237,23 @@ async def delete(self, name: str, resource_group_name: str, registry_name: str, request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -203,7 +262,11 @@ async def delete(self, name: str, resource_group_name: str, registry_name: str, @distributed_trace_async async def get( - self, name: str, resource_group_name: str, registry_name: str, **kwargs: Any + self, + name: str, + resource_group_name: str, + registry_name: str, + **kwargs: Any ) -> "_models.EnvironmentContainerData": """Get container. @@ -223,11 +286,19 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.EnvironmentContainerData"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainerData"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str request = build_get_request( name=name, @@ -240,15 +311,27 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("EnvironmentContainerData", pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "EnvironmentContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -286,12 +369,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.EnvironmentContainerData"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainerData"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "EnvironmentContainerData") @@ -308,15 +401,27 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("EnvironmentContainerData", pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "EnvironmentContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_environment_versions_operations.py index ce17fee2de0a..0cbfbd22386d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_environment_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_environment_versions_operations.py @@ -6,7 +6,16 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, + Union, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -19,7 +28,11 @@ ) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -36,7 +49,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class EnvironmentVersionsOperations: @@ -104,10 +122,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -150,7 +176,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersionResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -159,13 +188,23 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -175,7 +214,12 @@ async def get_next(next_link=None): @distributed_trace_async async def delete( - self, name: str, version: str, resource_group_name: str, registry_name: str, **kwargs: Any + self, + name: str, + version: str, + resource_group_name: str, + registry_name: str, + **kwargs: Any ) -> None: """Delete version. @@ -198,10 +242,16 @@ async def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str request = build_delete_request( name=name, @@ -215,13 +265,23 @@ async def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -230,7 +290,12 @@ async def delete( @distributed_trace_async async def get( - self, name: str, version: str, resource_group_name: str, registry_name: str, **kwargs: Any + self, + name: str, + version: str, + resource_group_name: str, + registry_name: str, + **kwargs: Any ) -> "_models.EnvironmentVersionData": """Get version. @@ -252,11 +317,19 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.EnvironmentVersionData"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersionData"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str request = build_get_request( name=name, @@ -270,15 +343,27 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("EnvironmentVersionData", pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersionData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -297,11 +382,19 @@ async def _create_or_update_initial( **kwargs: Any ) -> None: cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "EnvironmentVersionData") @@ -319,19 +412,31 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} response_headers["x-ms-async-operation-timeout"] = self._deserialize( "duration", response.headers.get("x-ms-async-operation-timeout") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) @@ -377,12 +482,22 @@ async def begin_create_or_update( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( name=name, @@ -415,6 +530,11 @@ def get_long_running_output(pipeline_response): deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_model_containers_operations.py index a8456d1aee53..84c6d4afbdd8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_model_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_model_containers_operations.py @@ -6,7 +6,16 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, + Union, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -19,7 +28,11 @@ ) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -36,7 +49,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class ModelContainersOperations: @@ -92,10 +110,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -130,7 +156,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -139,13 +167,23 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -154,7 +192,13 @@ async def get_next(next_link=None): list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models"} # type: ignore @distributed_trace_async - async def delete(self, name: str, resource_group_name: str, registry_name: str, **kwargs: Any) -> None: + async def delete( + self, + name: str, + resource_group_name: str, + registry_name: str, + **kwargs: Any + ) -> None: """Delete container. Delete container. @@ -174,10 +218,16 @@ async def delete(self, name: str, resource_group_name: str, registry_name: str, :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str request = build_delete_request( name=name, @@ -190,13 +240,23 @@ async def delete(self, name: str, resource_group_name: str, registry_name: str, request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -205,7 +265,11 @@ async def delete(self, name: str, resource_group_name: str, registry_name: str, @distributed_trace_async async def get( - self, name: str, resource_group_name: str, registry_name: str, **kwargs: Any + self, + name: str, + resource_group_name: str, + registry_name: str, + **kwargs: Any ) -> "_models.ModelContainerData": """Get container. @@ -225,11 +289,19 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelContainerData"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainerData"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str request = build_get_request( name=name, @@ -242,15 +314,27 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("ModelContainerData", pipeline_response) + deserialized = self._deserialize( + "ModelContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -260,14 +344,29 @@ async def get( get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}"} # type: ignore async def _create_or_update_initial( - self, name: str, resource_group_name: str, registry_name: str, body: "_models.ModelContainerData", **kwargs: Any + self, + name: str, + resource_group_name: str, + registry_name: str, + body: "_models.ModelContainerData", + **kwargs: Any ) -> "_models.ModelContainerData": - cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelContainerData"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainerData"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "ModelContainerData") @@ -284,12 +383,20 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} response_headers["x-ms-async-operation-timeout"] = self._deserialize( @@ -299,7 +406,9 @@ async def _create_or_update_initial( "str", response.headers.get("Azure-AsyncOperation") ) - deserialized = self._deserialize("ModelContainerData", pipeline_response) + deserialized = self._deserialize( + "ModelContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -310,7 +419,12 @@ async def _create_or_update_initial( @distributed_trace_async async def begin_create_or_update( - self, name: str, resource_group_name: str, registry_name: str, body: "_models.ModelContainerData", **kwargs: Any + self, + name: str, + resource_group_name: str, + registry_name: str, + body: "_models.ModelContainerData", + **kwargs: Any ) -> AsyncLROPoller["_models.ModelContainerData"]: """Create or update model container. @@ -341,12 +455,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ModelContainerData] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelContainerData"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainerData"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( name=name, @@ -363,14 +489,19 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): response_headers = {} response = pipeline_response.http_response - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) ) response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) - deserialized = self._deserialize("ModelContainerData", pipeline_response) + deserialized = self._deserialize( + "ModelContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized @@ -389,6 +520,11 @@ def get_long_running_output(pipeline_response): deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_model_versions_operations.py index 42833fbff77d..2b9c102c44a6 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_model_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_model_versions_operations.py @@ -6,7 +6,16 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, + Union, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -19,7 +28,11 @@ ) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -37,7 +50,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class ModelVersionsOperations: @@ -116,10 +134,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -168,7 +194,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -177,13 +205,23 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -193,7 +231,12 @@ async def get_next(next_link=None): @distributed_trace_async async def delete( - self, name: str, version: str, resource_group_name: str, registry_name: str, **kwargs: Any + self, + name: str, + version: str, + resource_group_name: str, + registry_name: str, + **kwargs: Any ) -> None: """Delete version. @@ -216,10 +259,16 @@ async def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str request = build_delete_request( name=name, @@ -233,13 +282,23 @@ async def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -248,7 +307,12 @@ async def delete( @distributed_trace_async async def get( - self, name: str, version: str, resource_group_name: str, registry_name: str, **kwargs: Any + self, + name: str, + version: str, + resource_group_name: str, + registry_name: str, + **kwargs: Any ) -> "_models.ModelVersionData": """Get version. @@ -270,11 +334,19 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersionData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersionData"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelVersionData"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str request = build_get_request( name=name, @@ -288,13 +360,23 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("ModelVersionData", pipeline_response) @@ -315,11 +397,19 @@ async def _create_or_update_initial( **kwargs: Any ) -> None: cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "ModelVersionData") @@ -337,19 +427,31 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} response_headers["x-ms-async-operation-timeout"] = self._deserialize( "duration", response.headers.get("x-ms-async-operation-timeout") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) @@ -395,12 +497,22 @@ async def begin_create_or_update( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( name=name, @@ -433,7 +545,12 @@ def get_long_running_output(pipeline_response): deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}"} # type: ignore @@ -446,12 +563,22 @@ async def _package_initial( body: "_models.PackageRequest", **kwargs: Any ) -> Optional["_models.PackageResponse"]: - cls = kwargs.pop("cls", None) # type: ClsType[Optional["_models.PackageResponse"]] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.PackageResponse"]] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "PackageRequest") @@ -469,21 +596,35 @@ async def _package_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("PackageResponse", pipeline_response) + deserialized = self._deserialize( + "PackageResponse", pipeline_response + ) if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -533,12 +674,24 @@ async def begin_package( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.PackageResponse] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.PackageResponse"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PackageResponse"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._package_initial( name=name, @@ -555,13 +708,19 @@ async def begin_package( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("PackageResponse", pipeline_response) + deserialized = self._deserialize( + "PackageResponse", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -574,6 +733,11 @@ def get_long_running_output(pipeline_response): deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) begin_package.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}/package"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_resource_management_asset_reference_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_resource_management_asset_reference_operations.py index 4f83607d8e68..edfc248cde8b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_resource_management_asset_reference_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_resource_management_asset_reference_operations.py @@ -18,7 +18,11 @@ ) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat @@ -26,10 +30,17 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._resource_management_asset_reference_operations import build_import_method_request_initial +from ...operations._resource_management_asset_reference_operations import ( + build_import_method_request_initial, +) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class ResourceManagementAssetReferenceOperations: @@ -62,13 +73,23 @@ async def _import_method_initial( **kwargs: Any ) -> Optional[Any]: cls = kwargs.pop("cls", None) # type: ClsType[Optional[Any]] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, "ResourceManagementAssetReferenceData") + _json = self._serialize.body( + body, "ResourceManagementAssetReferenceData" + ) request = build_import_method_request_initial( subscription_id=self._config.subscription_id, @@ -82,12 +103,20 @@ async def _import_method_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} @@ -95,8 +124,12 @@ async def _import_method_initial( deserialized = self._deserialize("object", pipeline_response) if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -147,12 +180,22 @@ async def begin_import_method( :rtype: ~azure.core.polling.AsyncLROPoller[any] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[Any] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._import_method_initial( resource_group_name=resource_group_name, @@ -173,7 +216,11 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -186,6 +233,11 @@ def get_long_running_output(pipeline_response): deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) begin_import_method.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/import"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_temporary_data_references_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_temporary_data_references_operations.py index 0561bdccdecd..b6811ff3bee3 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_temporary_data_references_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/aio/operations/_temporary_data_references_operations.py @@ -24,10 +24,17 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._temporary_data_references_operations import build_create_or_get_temporary_data_reference_request +from ...operations._temporary_data_references_operations import ( + build_create_or_get_temporary_data_reference_request, +) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class TemporaryDataReferencesOperations: @@ -82,12 +89,22 @@ async def create_or_get_temporary_data_reference( :rtype: ~azure.mgmt.machinelearningservices.models.TemporaryDataReferenceResponseDto :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.TemporaryDataReferenceResponseDto"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.TemporaryDataReferenceResponseDto"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "TemporaryDataReferenceRequestDto") @@ -100,20 +117,34 @@ async def create_or_get_temporary_data_reference( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_get_temporary_data_reference.metadata["url"], + template_url=self.create_or_get_temporary_data_reference.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("TemporaryDataReferenceResponseDto", pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "TemporaryDataReferenceResponseDto", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/models/_azure_machine_learning_workspaces_enums.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/models/_azure_machine_learning_workspaces_enums.py index c3ee9efa5a9e..002b976aec7f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/models/_azure_machine_learning_workspaces_enums.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/models/_azure_machine_learning_workspaces_enums.py @@ -41,7 +41,9 @@ class CredentialsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): SERVICE_PRINCIPAL = "ServicePrincipal" -class DataReferenceCredentialType(str, Enum, metaclass=CaseInsensitiveEnumMeta): +class DataReferenceCredentialType( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): SAS = "SAS" DOCKER_CREDENTIALS = "DockerCredentials" @@ -251,7 +253,9 @@ class SecretsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): SERVICE_PRINCIPAL = "ServicePrincipal" -class ServiceDataAccessAuthIdentity(str, Enum, metaclass=CaseInsensitiveEnumMeta): +class ServiceDataAccessAuthIdentity( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): NONE = "None" WORKSPACE_SYSTEM_ASSIGNED_IDENTITY = "WorkspaceSystemAssignedIdentity" diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/models/_models.py index 267544ef65cd..4943fb25b991 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/models/_models.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/models/_models.py @@ -226,7 +226,9 @@ class IdentityConfiguration(msrest.serialization.Model): "identity_type": {"key": "identityType", "type": "str"}, } - _subtype_map = {"identity_type": {"AMLToken": "AmlToken", "Managed": "ManagedIdentity"}} + _subtype_map = { + "identity_type": {"AMLToken": "AmlToken", "Managed": "ManagedIdentity"} + } def __init__(self, **kwargs): """ """ @@ -537,7 +539,10 @@ class AzureBlobDatastore(Datastore): "container_name": {"key": "containerName", "type": "str"}, "endpoint": {"key": "endpoint", "type": "str"}, "protocol": {"key": "protocol", "type": "str"}, - "service_data_access_auth_identity": {"key": "serviceDataAccessAuthIdentity", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } def __init__(self, **kwargs): @@ -570,7 +575,9 @@ def __init__(self, **kwargs): self.container_name = kwargs.get("container_name", None) self.endpoint = kwargs.get("endpoint", None) self.protocol = kwargs.get("protocol", None) - self.service_data_access_auth_identity = kwargs.get("service_data_access_auth_identity", None) + self.service_data_access_auth_identity = kwargs.get( + "service_data_access_auth_identity", None + ) class AzureDataLakeGen1Datastore(Datastore): @@ -617,7 +624,10 @@ class AzureDataLakeGen1Datastore(Datastore): "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, "datastore_type": {"key": "datastoreType", "type": "str"}, "is_default": {"key": "isDefault", "type": "bool"}, - "service_data_access_auth_identity": {"key": "serviceDataAccessAuthIdentity", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, "store_name": {"key": "storeName", "type": "str"}, } @@ -641,7 +651,9 @@ def __init__(self, **kwargs): """ super(AzureDataLakeGen1Datastore, self).__init__(**kwargs) self.datastore_type = "AzureDataLakeGen1" # type: str - self.service_data_access_auth_identity = kwargs.get("service_data_access_auth_identity", None) + self.service_data_access_auth_identity = kwargs.get( + "service_data_access_auth_identity", None + ) self.store_name = kwargs["store_name"] @@ -700,7 +712,10 @@ class AzureDataLakeGen2Datastore(Datastore): "endpoint": {"key": "endpoint", "type": "str"}, "filesystem": {"key": "filesystem", "type": "str"}, "protocol": {"key": "protocol", "type": "str"}, - "service_data_access_auth_identity": {"key": "serviceDataAccessAuthIdentity", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } def __init__(self, **kwargs): @@ -733,7 +748,9 @@ def __init__(self, **kwargs): self.endpoint = kwargs.get("endpoint", None) self.filesystem = kwargs["filesystem"] self.protocol = kwargs.get("protocol", None) - self.service_data_access_auth_identity = kwargs.get("service_data_access_auth_identity", None) + self.service_data_access_auth_identity = kwargs.get( + "service_data_access_auth_identity", None + ) class AzureFileDatastore(Datastore): @@ -791,7 +808,10 @@ class AzureFileDatastore(Datastore): "endpoint": {"key": "endpoint", "type": "str"}, "file_share_name": {"key": "fileShareName", "type": "str"}, "protocol": {"key": "protocol", "type": "str"}, - "service_data_access_auth_identity": {"key": "serviceDataAccessAuthIdentity", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } def __init__(self, **kwargs): @@ -824,7 +844,9 @@ def __init__(self, **kwargs): self.endpoint = kwargs.get("endpoint", None) self.file_share_name = kwargs["file_share_name"] self.protocol = kwargs.get("protocol", None) - self.service_data_access_auth_identity = kwargs.get("service_data_access_auth_identity", None) + self.service_data_access_auth_identity = kwargs.get( + "service_data_access_auth_identity", None + ) class InferencingServer(msrest.serialization.Model): @@ -881,7 +903,10 @@ class AzureMLBatchInferencingServer(InferencingServer): _attribute_map = { "server_type": {"key": "serverType", "type": "str"}, - "code_configuration": {"key": "codeConfiguration", "type": "CodeConfiguration"}, + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, } def __init__(self, **kwargs): @@ -912,7 +937,10 @@ class AzureMLOnlineInferencingServer(InferencingServer): _attribute_map = { "server_type": {"key": "serverType", "type": "str"}, - "code_configuration": {"key": "codeConfiguration", "type": "CodeConfiguration"}, + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, } def __init__(self, **kwargs): @@ -1041,10 +1069,17 @@ class BaseEnvironmentSource(msrest.serialization.Model): } _attribute_map = { - "base_environment_source_type": {"key": "baseEnvironmentSourceType", "type": "str"}, + "base_environment_source_type": { + "key": "baseEnvironmentSourceType", + "type": "str", + }, } - _subtype_map = {"base_environment_source_type": {"EnvironmentAsset": "BaseEnvironmentId"}} + _subtype_map = { + "base_environment_source_type": { + "EnvironmentAsset": "BaseEnvironmentId" + } + } def __init__(self, **kwargs): """ """ @@ -1071,7 +1106,10 @@ class BaseEnvironmentId(BaseEnvironmentSource): } _attribute_map = { - "base_environment_source_type": {"key": "baseEnvironmentSourceType", "type": "str"}, + "base_environment_source_type": { + "key": "baseEnvironmentSourceType", + "type": "str", + }, "resource_id": {"key": "resourceId", "type": "str"}, } @@ -1164,8 +1202,14 @@ class BlobReferenceForConsumptionDto(msrest.serialization.Model): _attribute_map = { "blob_uri": {"key": "blobUri", "type": "str"}, - "credential": {"key": "credential", "type": "DataReferenceCredentialDto"}, - "storage_account_arm_id": {"key": "storageAccountArmId", "type": "str"}, + "credential": { + "key": "credential", + "type": "DataReferenceCredentialDto", + }, + "storage_account_arm_id": { + "key": "storageAccountArmId", + "type": "str", + }, } def __init__(self, **kwargs): @@ -1180,7 +1224,9 @@ def __init__(self, **kwargs): super(BlobReferenceForConsumptionDto, self).__init__(**kwargs) self.blob_uri = kwargs.get("blob_uri", None) self.credential = kwargs.get("credential", None) - self.storage_account_arm_id = kwargs.get("storage_account_arm_id", None) + self.storage_account_arm_id = kwargs.get( + "storage_account_arm_id", None + ) class BlobReferenceSASRequestDto(msrest.serialization.Model): @@ -1231,7 +1277,9 @@ def __init__(self, **kwargs): ~azure.mgmt.machinelearningservices.models.BlobReferenceForConsumptionDto """ super(BlobReferenceSASResponseDto, self).__init__(**kwargs) - self.blob_reference_for_consumption = kwargs.get("blob_reference_for_consumption", None) + self.blob_reference_for_consumption = kwargs.get( + "blob_reference_for_consumption", None + ) class BuildContext(msrest.serialization.Model): @@ -1400,7 +1448,11 @@ class CodeConfiguration(msrest.serialization.Model): """ _validation = { - "scoring_script": {"required": True, "min_length": 1, "pattern": r"[a-zA-Z0-9_]"}, + "scoring_script": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { @@ -1763,7 +1815,12 @@ class JobBase(ResourceBase): } _subtype_map = { - "job_type": {"Base": "Job", "Command": "CommandJob", "Pipeline": "PipelineJob", "Sweep": "SweepJob"} + "job_type": { + "Base": "Job", + "Command": "CommandJob", + "Pipeline": "PipelineJob", + "Sweep": "SweepJob", + } } def __init__(self, **kwargs): @@ -1864,7 +1921,11 @@ class CommandJob(JobBase): "job_type": {"required": True}, "parent_job_name": {"readonly": True}, "status": {"readonly": True}, - "command": {"required": True, "min_length": 1, "pattern": r"[a-zA-Z0-9_]"}, + "command": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, "environment_id": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, "parameters": {"readonly": True}, } @@ -1883,9 +1944,15 @@ class CommandJob(JobBase): "status": {"key": "status", "type": "str"}, "code_id": {"key": "codeId", "type": "str"}, "command": {"key": "command", "type": "str"}, - "distribution": {"key": "distribution", "type": "DistributionConfiguration"}, + "distribution": { + "key": "distribution", + "type": "DistributionConfiguration", + }, "environment_id": {"key": "environmentId", "type": "str"}, - "environment_variables": {"key": "environmentVariables", "type": "{str}"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, "identity": {"key": "identity", "type": "IdentityConfiguration"}, "inputs": {"key": "inputs", "type": "{JobInput}"}, "limits": {"key": "limits", "type": "CommandJobLimits"}, @@ -1980,7 +2047,12 @@ class JobLimits(msrest.serialization.Model): "timeout": {"key": "timeout", "type": "duration"}, } - _subtype_map = {"job_limits_type": {"Command": "CommandJobLimits", "Sweep": "SweepJobLimits"}} + _subtype_map = { + "job_limits_type": { + "Command": "CommandJobLimits", + "Sweep": "SweepJobLimits", + } + } def __init__(self, **kwargs): """ @@ -2060,7 +2132,10 @@ class ComponentContainerData(Resource): "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "ComponentContainerDetails"}, + "properties": { + "key": "properties", + "type": "ComponentContainerDetails", + }, } def __init__(self, **kwargs): @@ -2147,7 +2222,9 @@ def __init__(self, **kwargs): :keyword value: An array of objects of type ComponentContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainerData] """ - super(ComponentContainerResourceArmPaginatedResult, self).__init__(**kwargs) + super(ComponentContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = kwargs.get("next_link", None) self.value = kwargs.get("value", None) @@ -2325,7 +2402,9 @@ def __init__(self, **kwargs): :keyword value: An array of objects of type ComponentVersion. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersionData] """ - super(ComponentVersionResourceArmPaginatedResult, self).__init__(**kwargs) + super(ComponentVersionResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = kwargs.get("next_link", None) self.value = kwargs.get("value", None) @@ -2349,7 +2428,10 @@ class CustomInferencingServer(InferencingServer): _attribute_map = { "server_type": {"key": "serverType", "type": "str"}, - "inference_configuration": {"key": "inferenceConfiguration", "type": "OnlineInferenceConfiguration"}, + "inference_configuration": { + "key": "inferenceConfiguration", + "type": "OnlineInferenceConfiguration", + }, } def __init__(self, **kwargs): @@ -2360,7 +2442,9 @@ def __init__(self, **kwargs): """ super(CustomInferencingServer, self).__init__(**kwargs) self.server_type = "Custom" # type: str - self.inference_configuration = kwargs.get("inference_configuration", None) + self.inference_configuration = kwargs.get( + "inference_configuration", None + ) class DataContainerData(Resource): @@ -2652,11 +2736,18 @@ class DataVersionBaseDetails(AssetBase): "is_archived": {"key": "isArchived", "type": "bool"}, "data_type": {"key": "dataType", "type": "str"}, "data_uri": {"key": "dataUri", "type": "str"}, - "intellectual_property": {"key": "intellectualProperty", "type": "IntellectualProperty"}, + "intellectual_property": { + "key": "intellectualProperty", + "type": "IntellectualProperty", + }, } _subtype_map = { - "data_type": {"mltable": "MLTableData", "uri_file": "UriFileDataVersion", "uri_folder": "UriFolderDataVersion"} + "data_type": { + "mltable": "MLTableData", + "uri_file": "UriFileDataVersion", + "uri_folder": "UriFolderDataVersion", + } } def __init__(self, **kwargs): @@ -2708,7 +2799,9 @@ def __init__(self, **kwargs): :keyword value: An array of objects of type DataVersionBase. :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBaseData] """ - super(DataVersionBaseResourceArmPaginatedResult, self).__init__(**kwargs) + super(DataVersionBaseResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = kwargs.get("next_link", None) self.value = kwargs.get("value", None) @@ -2734,7 +2827,13 @@ class DistributionConfiguration(msrest.serialization.Model): "distribution_type": {"key": "distributionType", "type": "str"}, } - _subtype_map = {"distribution_type": {"Mpi": "Mpi", "PyTorch": "PyTorch", "TensorFlow": "TensorFlow"}} + _subtype_map = { + "distribution_type": { + "Mpi": "Mpi", + "PyTorch": "PyTorch", + "TensorFlow": "TensorFlow", + } + } def __init__(self, **kwargs): """ """ @@ -2803,7 +2902,10 @@ class EnvironmentContainerData(Resource): "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "EnvironmentContainerDetails"}, + "properties": { + "key": "properties", + "type": "EnvironmentContainerDetails", + }, } def __init__(self, **kwargs): @@ -2862,7 +2964,9 @@ def __init__(self, **kwargs): super(EnvironmentContainerDetails, self).__init__(**kwargs) -class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model): +class EnvironmentContainerResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of EnvironmentContainer entities. :ivar next_link: The link to the next page of EnvironmentContainer objects. If null, there are @@ -2885,7 +2989,9 @@ def __init__(self, **kwargs): :keyword value: An array of objects of type EnvironmentContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainerData] """ - super(EnvironmentContainerResourceArmPaginatedResult, self).__init__(**kwargs) + super(EnvironmentContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = kwargs.get("next_link", None) self.value = kwargs.get("value", None) @@ -2925,7 +3031,10 @@ class EnvironmentVersionData(Resource): "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "EnvironmentVersionDetails"}, + "properties": { + "key": "properties", + "type": "EnvironmentVersionDetails", + }, } def __init__(self, **kwargs): @@ -3009,8 +3118,14 @@ class EnvironmentVersionDetails(AssetBase): "conda_file": {"key": "condaFile", "type": "str"}, "environment_type": {"key": "environmentType", "type": "str"}, "image": {"key": "image", "type": "str"}, - "inference_config": {"key": "inferenceConfig", "type": "InferenceContainerProperties"}, - "intellectual_property": {"key": "intellectualProperty", "type": "IntellectualProperty"}, + "inference_config": { + "key": "inferenceConfig", + "type": "InferenceContainerProperties", + }, + "intellectual_property": { + "key": "intellectualProperty", + "type": "IntellectualProperty", + }, "os_type": {"key": "osType", "type": "str"}, "stage": {"key": "stage", "type": "str"}, } @@ -3094,7 +3209,9 @@ def __init__(self, **kwargs): :keyword value: An array of objects of type EnvironmentVersion. :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersionData] """ - super(EnvironmentVersionResourceArmPaginatedResult, self).__init__(**kwargs) + super(EnvironmentVersionResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = kwargs.get("next_link", None) self.value = kwargs.get("value", None) @@ -3157,7 +3274,10 @@ class ErrorDetail(msrest.serialization.Model): "message": {"key": "message", "type": "str"}, "target": {"key": "target", "type": "str"}, "details": {"key": "details", "type": "[ErrorDetail]"}, - "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"}, + "additional_info": { + "key": "additionalInfo", + "type": "[ErrorAdditionalInfo]", + }, } def __init__(self, **kwargs): @@ -3257,9 +3377,15 @@ class ImageReferenceForConsumptionDto(msrest.serialization.Model): _attribute_map = { "acr_details": {"key": "acrDetails", "type": "AcrDetail"}, - "credential": {"key": "credential", "type": "DataReferenceCredentialDto"}, + "credential": { + "key": "credential", + "type": "DataReferenceCredentialDto", + }, "image_name": {"key": "imageName", "type": "str"}, - "image_registry_reference": {"key": "imageRegistryReference", "type": "str"}, + "image_registry_reference": { + "key": "imageRegistryReference", + "type": "str", + }, } def __init__(self, **kwargs): @@ -3277,7 +3403,9 @@ def __init__(self, **kwargs): self.acr_details = kwargs.get("acr_details", None) self.credential = kwargs.get("credential", None) self.image_name = kwargs.get("image_name", None) - self.image_registry_reference = kwargs.get("image_registry_reference", None) + self.image_registry_reference = kwargs.get( + "image_registry_reference", None + ) class InferenceContainerProperties(msrest.serialization.Model): @@ -3456,7 +3584,11 @@ class JobInput(msrest.serialization.Model): } _subtype_map = { - "job_input_type": {"Dataset": "JobInputDataset", "Literal": "JobInputLiteral", "Uri": "JobInputUri"} + "job_input_type": { + "Dataset": "JobInputDataset", + "Literal": "JobInputLiteral", + "Uri": "JobInputUri", + } } def __init__(self, **kwargs): @@ -3619,7 +3751,12 @@ class JobOutput(msrest.serialization.Model): "job_output_type": {"key": "jobOutputType", "type": "str"}, } - _subtype_map = {"job_output_type": {"Dataset": "JobOutputDataset", "Uri": "JobOutputUri"}} + _subtype_map = { + "job_output_type": { + "Dataset": "JobOutputDataset", + "Uri": "JobOutputUri", + } + } def __init__(self, **kwargs): """ @@ -3833,10 +3970,22 @@ class ManagedIdentityCredentialDto(msrest.serialization.Model): _attribute_map = { "managed_identity_type": {"key": "managedIdentityType", "type": "str"}, - "user_managed_identity_client_id": {"key": "userManagedIdentityClientId", "type": "str"}, - "user_managed_identity_principal_id": {"key": "userManagedIdentityPrincipalId", "type": "str"}, - "user_managed_identity_resource_id": {"key": "userManagedIdentityResourceId", "type": "str"}, - "user_managed_identity_tenant_id": {"key": "userManagedIdentityTenantId", "type": "str"}, + "user_managed_identity_client_id": { + "key": "userManagedIdentityClientId", + "type": "str", + }, + "user_managed_identity_principal_id": { + "key": "userManagedIdentityPrincipalId", + "type": "str", + }, + "user_managed_identity_resource_id": { + "key": "userManagedIdentityResourceId", + "type": "str", + }, + "user_managed_identity_tenant_id": { + "key": "userManagedIdentityTenantId", + "type": "str", + }, } def __init__(self, **kwargs): @@ -3858,10 +4007,18 @@ def __init__(self, **kwargs): """ super(ManagedIdentityCredentialDto, self).__init__(**kwargs) self.managed_identity_type = kwargs.get("managed_identity_type", None) - self.user_managed_identity_client_id = kwargs.get("user_managed_identity_client_id", None) - self.user_managed_identity_principal_id = kwargs.get("user_managed_identity_principal_id", None) - self.user_managed_identity_resource_id = kwargs.get("user_managed_identity_resource_id", None) - self.user_managed_identity_tenant_id = kwargs.get("user_managed_identity_tenant_id", None) + self.user_managed_identity_client_id = kwargs.get( + "user_managed_identity_client_id", None + ) + self.user_managed_identity_principal_id = kwargs.get( + "user_managed_identity_principal_id", None + ) + self.user_managed_identity_resource_id = kwargs.get( + "user_managed_identity_resource_id", None + ) + self.user_managed_identity_tenant_id = kwargs.get( + "user_managed_identity_tenant_id", None + ) class MedianStoppingPolicy(EarlyTerminationPolicy): @@ -3941,7 +4098,10 @@ class MLTableData(DataVersionBaseDetails): "is_archived": {"key": "isArchived", "type": "bool"}, "data_type": {"key": "dataType", "type": "str"}, "data_uri": {"key": "dataUri", "type": "str"}, - "intellectual_property": {"key": "intellectualProperty", "type": "IntellectualProperty"}, + "intellectual_property": { + "key": "intellectualProperty", + "type": "IntellectualProperty", + }, "referenced_uris": {"key": "referencedUris", "type": "[str]"}, } @@ -4115,7 +4275,9 @@ def __init__(self, **kwargs): :keyword value: An array of objects of type ModelContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelContainerData] """ - super(ModelContainerResourceArmPaginatedResult, self).__init__(**kwargs) + super(ModelContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = kwargs.get("next_link", None) self.value = kwargs.get("value", None) @@ -4249,7 +4411,10 @@ class ModelVersionDetails(AssetBase): "is_anonymous": {"key": "isAnonymous", "type": "bool"}, "is_archived": {"key": "isArchived", "type": "bool"}, "flavors": {"key": "flavors", "type": "{FlavorData}"}, - "intellectual_property": {"key": "intellectualProperty", "type": "IntellectualProperty"}, + "intellectual_property": { + "key": "intellectualProperty", + "type": "IntellectualProperty", + }, "job_name": {"key": "jobName", "type": "str"}, "model_type": {"key": "modelType", "type": "str"}, "model_uri": {"key": "modelUri", "type": "str"}, @@ -4338,7 +4503,10 @@ class Mpi(DistributionConfiguration): _attribute_map = { "distribution_type": {"key": "distributionType", "type": "str"}, - "process_count_per_instance": {"key": "processCountPerInstance", "type": "int"}, + "process_count_per_instance": { + "key": "processCountPerInstance", + "type": "int", + }, } def __init__(self, **kwargs): @@ -4348,7 +4516,9 @@ def __init__(self, **kwargs): """ super(Mpi, self).__init__(**kwargs) self.distribution_type = "Mpi" # type: str - self.process_count_per_instance = kwargs.get("process_count_per_instance", None) + self.process_count_per_instance = kwargs.get( + "process_count_per_instance", None + ) class NoneDatastoreCredentials(DatastoreCredentials): @@ -4657,15 +4827,30 @@ class PackageRequest(msrest.serialization.Model): _validation = { "inferencing_server": {"required": True}, - "target_environment_id": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "target_environment_id": { + "required": True, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - "base_environment_source": {"key": "baseEnvironmentSource", "type": "BaseEnvironmentSource"}, - "environment_variables": {"key": "environmentVariables", "type": "{str}"}, - "inferencing_server": {"key": "inferencingServer", "type": "InferencingServer"}, + "base_environment_source": { + "key": "baseEnvironmentSource", + "type": "BaseEnvironmentSource", + }, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "inferencing_server": { + "key": "inferencingServer", + "type": "InferencingServer", + }, "inputs": {"key": "inputs", "type": "[ModelPackageInput]"}, - "model_configuration": {"key": "modelConfiguration", "type": "ModelConfiguration"}, + "model_configuration": { + "key": "modelConfiguration", + "type": "ModelConfiguration", + }, "properties": {"key": "properties", "type": "{str}"}, "sku_architecture_type": {"key": "skuArchitectureType", "type": "str"}, "tags": {"key": "tags", "type": "{str}"}, @@ -4696,7 +4881,9 @@ def __init__(self, **kwargs): :paramtype target_environment_id: str """ super(PackageRequest, self).__init__(**kwargs) - self.base_environment_source = kwargs.get("base_environment_source", None) + self.base_environment_source = kwargs.get( + "base_environment_source", None + ) self.environment_variables = kwargs.get("environment_variables", None) self.inferencing_server = kwargs["inferencing_server"] self.inputs = kwargs.get("inputs", None) @@ -4754,14 +4941,26 @@ class PackageResponse(msrest.serialization.Model): } _attribute_map = { - "base_environment_source": {"key": "baseEnvironmentSource", "type": "BaseEnvironmentSource"}, + "base_environment_source": { + "key": "baseEnvironmentSource", + "type": "BaseEnvironmentSource", + }, "build_id": {"key": "buildId", "type": "str"}, "build_state": {"key": "buildState", "type": "str"}, - "environment_variables": {"key": "environmentVariables", "type": "{str}"}, - "inferencing_server": {"key": "inferencingServer", "type": "InferencingServer"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "inferencing_server": { + "key": "inferencingServer", + "type": "InferencingServer", + }, "inputs": {"key": "inputs", "type": "[ModelPackageInput]"}, "log_url": {"key": "logUrl", "type": "str"}, - "model_configuration": {"key": "modelConfiguration", "type": "ModelConfiguration"}, + "model_configuration": { + "key": "modelConfiguration", + "type": "ModelConfiguration", + }, "properties": {"key": "properties", "type": "{str}"}, "sku_architecture_type": {"key": "skuArchitectureType", "type": "str"}, "tags": {"key": "tags", "type": "{str}"}, @@ -4919,7 +5118,10 @@ class PyTorch(DistributionConfiguration): _attribute_map = { "distribution_type": {"key": "distributionType", "type": "str"}, - "process_count_per_instance": {"key": "processCountPerInstance", "type": "int"}, + "process_count_per_instance": { + "key": "processCountPerInstance", + "type": "int", + }, } def __init__(self, **kwargs): @@ -4929,7 +5131,9 @@ def __init__(self, **kwargs): """ super(PyTorch, self).__init__(**kwargs) self.distribution_type = "PyTorch" # type: str - self.process_count_per_instance = kwargs.get("process_count_per_instance", None) + self.process_count_per_instance = kwargs.get( + "process_count_per_instance", None + ) class ResourceConfiguration(msrest.serialization.Model): @@ -5000,7 +5204,10 @@ class ResourceManagementAssetReferenceData(Resource): "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "ResourceManagementAssetReferenceDetails"}, + "properties": { + "key": "properties", + "type": "ResourceManagementAssetReferenceDetails", + }, } def __init__(self, **kwargs): @@ -5208,7 +5415,10 @@ class ServicePrincipalDatastoreCredentials(DatastoreCredentials): "authority_url": {"key": "authorityUrl", "type": "str"}, "client_id": {"key": "clientId", "type": "str"}, "resource_url": {"key": "resourceUrl", "type": "str"}, - "secrets": {"key": "secrets", "type": "ServicePrincipalDatastoreSecrets"}, + "secrets": { + "key": "secrets", + "type": "ServicePrincipalDatastoreSecrets", + }, "tenant_id": {"key": "tenantId", "type": "str"}, } @@ -5348,7 +5558,10 @@ class SweepJob(JobBase): "parent_job_name": {"key": "parentJobName", "type": "str"}, "services": {"key": "services", "type": "{JobService}"}, "status": {"key": "status", "type": "str"}, - "early_termination": {"key": "earlyTermination", "type": "EarlyTerminationPolicy"}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, "identity": {"key": "identity", "type": "IdentityConfiguration"}, "inputs": {"key": "inputs", "type": "{JobInput}"}, "limits": {"key": "limits", "type": "SweepJobLimits"}, @@ -5536,8 +5749,14 @@ class TemporaryDataReferenceRequestDto(msrest.serialization.Model): _attribute_map = { "asset_id": {"key": "assetId", "type": "str"}, - "temporary_data_reference_id": {"key": "temporaryDataReferenceId", "type": "str"}, - "temporary_data_reference_type": {"key": "temporaryDataReferenceType", "type": "str"}, + "temporary_data_reference_id": { + "key": "temporaryDataReferenceId", + "type": "str", + }, + "temporary_data_reference_type": { + "key": "temporaryDataReferenceType", + "type": "str", + }, } def __init__(self, **kwargs): @@ -5553,8 +5772,12 @@ def __init__(self, **kwargs): """ super(TemporaryDataReferenceRequestDto, self).__init__(**kwargs) self.asset_id = kwargs.get("asset_id", None) - self.temporary_data_reference_id = kwargs.get("temporary_data_reference_id", None) - self.temporary_data_reference_type = kwargs.get("temporary_data_reference_type", None) + self.temporary_data_reference_id = kwargs.get( + "temporary_data_reference_id", None + ) + self.temporary_data_reference_type = kwargs.get( + "temporary_data_reference_type", None + ) class TemporaryDataReferenceResponseDto(msrest.serialization.Model): @@ -5581,8 +5804,14 @@ class TemporaryDataReferenceResponseDto(msrest.serialization.Model): "key": "imageReferenceForConsumption", "type": "ImageReferenceForConsumptionDto", }, - "temporary_data_reference_id": {"key": "temporaryDataReferenceId", "type": "str"}, - "temporary_data_reference_type": {"key": "temporaryDataReferenceType", "type": "str"}, + "temporary_data_reference_id": { + "key": "temporaryDataReferenceId", + "type": "str", + }, + "temporary_data_reference_type": { + "key": "temporaryDataReferenceType", + "type": "str", + }, } def __init__(self, **kwargs): @@ -5599,10 +5828,18 @@ def __init__(self, **kwargs): :paramtype temporary_data_reference_type: str """ super(TemporaryDataReferenceResponseDto, self).__init__(**kwargs) - self.blob_reference_for_consumption = kwargs.get("blob_reference_for_consumption", None) - self.image_reference_for_consumption = kwargs.get("image_reference_for_consumption", None) - self.temporary_data_reference_id = kwargs.get("temporary_data_reference_id", None) - self.temporary_data_reference_type = kwargs.get("temporary_data_reference_type", None) + self.blob_reference_for_consumption = kwargs.get( + "blob_reference_for_consumption", None + ) + self.image_reference_for_consumption = kwargs.get( + "image_reference_for_consumption", None + ) + self.temporary_data_reference_id = kwargs.get( + "temporary_data_reference_id", None + ) + self.temporary_data_reference_type = kwargs.get( + "temporary_data_reference_type", None + ) class TensorFlow(DistributionConfiguration): @@ -5625,7 +5862,10 @@ class TensorFlow(DistributionConfiguration): _attribute_map = { "distribution_type": {"key": "distributionType", "type": "str"}, - "parameter_server_count": {"key": "parameterServerCount", "type": "int"}, + "parameter_server_count": { + "key": "parameterServerCount", + "type": "int", + }, "worker_count": {"key": "workerCount", "type": "int"}, } @@ -5664,16 +5904,26 @@ class TrialComponent(msrest.serialization.Model): """ _validation = { - "command": {"required": True, "min_length": 1, "pattern": r"[a-zA-Z0-9_]"}, + "command": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, "environment_id": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { "code_id": {"key": "codeId", "type": "str"}, "command": {"key": "command", "type": "str"}, - "distribution": {"key": "distribution", "type": "DistributionConfiguration"}, + "distribution": { + "key": "distribution", + "type": "DistributionConfiguration", + }, "environment_id": {"key": "environmentId", "type": "str"}, - "environment_variables": {"key": "environmentVariables", "type": "{str}"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, "resources": {"key": "resources", "type": "ResourceConfiguration"}, } @@ -5723,7 +5973,10 @@ class TritonInferencingServer(InferencingServer): _attribute_map = { "server_type": {"key": "serverType", "type": "str"}, - "inference_configuration": {"key": "inferenceConfiguration", "type": "OnlineInferenceConfiguration"}, + "inference_configuration": { + "key": "inferenceConfiguration", + "type": "OnlineInferenceConfiguration", + }, } def __init__(self, **kwargs): @@ -5734,7 +5987,9 @@ def __init__(self, **kwargs): """ super(TritonInferencingServer, self).__init__(**kwargs) self.server_type = "Triton" # type: str - self.inference_configuration = kwargs.get("inference_configuration", None) + self.inference_configuration = kwargs.get( + "inference_configuration", None + ) class TruncationSelectionPolicy(EarlyTerminationPolicy): @@ -5762,7 +6017,10 @@ class TruncationSelectionPolicy(EarlyTerminationPolicy): "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, "policy_type": {"key": "policyType", "type": "str"}, - "truncation_percentage": {"key": "truncationPercentage", "type": "int"}, + "truncation_percentage": { + "key": "truncationPercentage", + "type": "int", + }, } def __init__(self, **kwargs): @@ -5818,7 +6076,10 @@ class UriFileDataVersion(DataVersionBaseDetails): "is_archived": {"key": "isArchived", "type": "bool"}, "data_type": {"key": "dataType", "type": "str"}, "data_uri": {"key": "dataUri", "type": "str"}, - "intellectual_property": {"key": "intellectualProperty", "type": "IntellectualProperty"}, + "intellectual_property": { + "key": "intellectualProperty", + "type": "IntellectualProperty", + }, } def __init__(self, **kwargs): @@ -5884,7 +6145,10 @@ class UriFolderDataVersion(DataVersionBaseDetails): "is_archived": {"key": "isArchived", "type": "bool"}, "data_type": {"key": "dataType", "type": "str"}, "data_uri": {"key": "dataUri", "type": "str"}, - "intellectual_property": {"key": "intellectualProperty", "type": "IntellectualProperty"}, + "intellectual_property": { + "key": "intellectualProperty", + "type": "IntellectualProperty", + }, } def __init__(self, **kwargs): diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/models/_models_py3.py index 7bdbecc36dad..c3377de1d46a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/models/_models_py3.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/models/_models_py3.py @@ -240,7 +240,9 @@ class IdentityConfiguration(msrest.serialization.Model): "identity_type": {"key": "identityType", "type": "str"}, } - _subtype_map = {"identity_type": {"AMLToken": "AmlToken", "Managed": "ManagedIdentity"}} + _subtype_map = { + "identity_type": {"AMLToken": "AmlToken", "Managed": "ManagedIdentity"} + } def __init__(self, **kwargs): """ """ @@ -357,7 +359,9 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(AssetBase, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + super(AssetBase, self).__init__( + description=description, properties=properties, tags=tags, **kwargs + ) self.is_anonymous = is_anonymous self.is_archived = is_archived @@ -414,7 +418,9 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(AssetContainer, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + super(AssetContainer, self).__init__( + description=description, properties=properties, tags=tags, **kwargs + ) self.is_archived = is_archived self.latest_version = None self.next_version = None @@ -524,7 +530,9 @@ def __init__( :keyword credentials: Required. Account credentials. :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials """ - super(Datastore, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + super(Datastore, self).__init__( + description=description, properties=properties, tags=tags, **kwargs + ) self.credentials = credentials self.datastore_type = "Datastore" # type: str self.is_default = None @@ -583,7 +591,10 @@ class AzureBlobDatastore(Datastore): "container_name": {"key": "containerName", "type": "str"}, "endpoint": {"key": "endpoint", "type": "str"}, "protocol": {"key": "protocol", "type": "str"}, - "service_data_access_auth_identity": {"key": "serviceDataAccessAuthIdentity", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } def __init__( @@ -597,7 +608,9 @@ def __init__( container_name: Optional[str] = None, endpoint: Optional[str] = None, protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, + service_data_access_auth_identity: Optional[ + Union[str, "ServiceDataAccessAuthIdentity"] + ] = None, **kwargs ): """ @@ -624,14 +637,20 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ super(AzureBlobDatastore, self).__init__( - description=description, properties=properties, tags=tags, credentials=credentials, **kwargs + description=description, + properties=properties, + tags=tags, + credentials=credentials, + **kwargs ) self.datastore_type = "AzureBlob" # type: str self.account_name = account_name self.container_name = container_name self.endpoint = endpoint self.protocol = protocol - self.service_data_access_auth_identity = service_data_access_auth_identity + self.service_data_access_auth_identity = ( + service_data_access_auth_identity + ) class AzureDataLakeGen1Datastore(Datastore): @@ -678,7 +697,10 @@ class AzureDataLakeGen1Datastore(Datastore): "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, "datastore_type": {"key": "datastoreType", "type": "str"}, "is_default": {"key": "isDefault", "type": "bool"}, - "service_data_access_auth_identity": {"key": "serviceDataAccessAuthIdentity", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, "store_name": {"key": "storeName", "type": "str"}, } @@ -690,7 +712,9 @@ def __init__( description: Optional[str] = None, properties: Optional[Dict[str, str]] = None, tags: Optional[Dict[str, str]] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, + service_data_access_auth_identity: Optional[ + Union[str, "ServiceDataAccessAuthIdentity"] + ] = None, **kwargs ): """ @@ -711,10 +735,16 @@ def __init__( :paramtype store_name: str """ super(AzureDataLakeGen1Datastore, self).__init__( - description=description, properties=properties, tags=tags, credentials=credentials, **kwargs + description=description, + properties=properties, + tags=tags, + credentials=credentials, + **kwargs ) self.datastore_type = "AzureDataLakeGen1" # type: str - self.service_data_access_auth_identity = service_data_access_auth_identity + self.service_data_access_auth_identity = ( + service_data_access_auth_identity + ) self.store_name = store_name @@ -773,7 +803,10 @@ class AzureDataLakeGen2Datastore(Datastore): "endpoint": {"key": "endpoint", "type": "str"}, "filesystem": {"key": "filesystem", "type": "str"}, "protocol": {"key": "protocol", "type": "str"}, - "service_data_access_auth_identity": {"key": "serviceDataAccessAuthIdentity", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } def __init__( @@ -787,7 +820,9 @@ def __init__( tags: Optional[Dict[str, str]] = None, endpoint: Optional[str] = None, protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, + service_data_access_auth_identity: Optional[ + Union[str, "ServiceDataAccessAuthIdentity"] + ] = None, **kwargs ): """ @@ -814,14 +849,20 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ super(AzureDataLakeGen2Datastore, self).__init__( - description=description, properties=properties, tags=tags, credentials=credentials, **kwargs + description=description, + properties=properties, + tags=tags, + credentials=credentials, + **kwargs ) self.datastore_type = "AzureDataLakeGen2" # type: str self.account_name = account_name self.endpoint = endpoint self.filesystem = filesystem self.protocol = protocol - self.service_data_access_auth_identity = service_data_access_auth_identity + self.service_data_access_auth_identity = ( + service_data_access_auth_identity + ) class AzureFileDatastore(Datastore): @@ -879,7 +920,10 @@ class AzureFileDatastore(Datastore): "endpoint": {"key": "endpoint", "type": "str"}, "file_share_name": {"key": "fileShareName", "type": "str"}, "protocol": {"key": "protocol", "type": "str"}, - "service_data_access_auth_identity": {"key": "serviceDataAccessAuthIdentity", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } def __init__( @@ -893,7 +937,9 @@ def __init__( tags: Optional[Dict[str, str]] = None, endpoint: Optional[str] = None, protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, + service_data_access_auth_identity: Optional[ + Union[str, "ServiceDataAccessAuthIdentity"] + ] = None, **kwargs ): """ @@ -920,14 +966,20 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ super(AzureFileDatastore, self).__init__( - description=description, properties=properties, tags=tags, credentials=credentials, **kwargs + description=description, + properties=properties, + tags=tags, + credentials=credentials, + **kwargs ) self.datastore_type = "AzureFile" # type: str self.account_name = account_name self.endpoint = endpoint self.file_share_name = file_share_name self.protocol = protocol - self.service_data_access_auth_identity = service_data_access_auth_identity + self.service_data_access_auth_identity = ( + service_data_access_auth_identity + ) class InferencingServer(msrest.serialization.Model): @@ -984,10 +1036,18 @@ class AzureMLBatchInferencingServer(InferencingServer): _attribute_map = { "server_type": {"key": "serverType", "type": "str"}, - "code_configuration": {"key": "codeConfiguration", "type": "CodeConfiguration"}, + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, } - def __init__(self, *, code_configuration: Optional["CodeConfiguration"] = None, **kwargs): + def __init__( + self, + *, + code_configuration: Optional["CodeConfiguration"] = None, + **kwargs + ): """ :keyword code_configuration: Code configuration for AML batch inferencing server. :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration @@ -1015,10 +1075,18 @@ class AzureMLOnlineInferencingServer(InferencingServer): _attribute_map = { "server_type": {"key": "serverType", "type": "str"}, - "code_configuration": {"key": "codeConfiguration", "type": "CodeConfiguration"}, + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, } - def __init__(self, *, code_configuration: Optional["CodeConfiguration"] = None, **kwargs): + def __init__( + self, + *, + code_configuration: Optional["CodeConfiguration"] = None, + **kwargs + ): """ :keyword code_configuration: Code configuration for AML inferencing server. :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration @@ -1064,7 +1132,13 @@ class EarlyTerminationPolicy(msrest.serialization.Model): } } - def __init__(self, *, delay_evaluation: Optional[int] = 0, evaluation_interval: Optional[int] = 0, **kwargs): + def __init__( + self, + *, + delay_evaluation: Optional[int] = 0, + evaluation_interval: Optional[int] = 0, + **kwargs + ): """ :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. :paramtype delay_evaluation: int @@ -1128,7 +1202,9 @@ def __init__( :paramtype slack_factor: float """ super(BanditPolicy, self).__init__( - delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs + delay_evaluation=delay_evaluation, + evaluation_interval=evaluation_interval, + **kwargs ) self.policy_type = "Bandit" # type: str self.slack_amount = slack_amount @@ -1154,10 +1230,17 @@ class BaseEnvironmentSource(msrest.serialization.Model): } _attribute_map = { - "base_environment_source_type": {"key": "baseEnvironmentSourceType", "type": "str"}, + "base_environment_source_type": { + "key": "baseEnvironmentSourceType", + "type": "str", + }, } - _subtype_map = {"base_environment_source_type": {"EnvironmentAsset": "BaseEnvironmentId"}} + _subtype_map = { + "base_environment_source_type": { + "EnvironmentAsset": "BaseEnvironmentId" + } + } def __init__(self, **kwargs): """ """ @@ -1184,7 +1267,10 @@ class BaseEnvironmentId(BaseEnvironmentSource): } _attribute_map = { - "base_environment_source_type": {"key": "baseEnvironmentSourceType", "type": "str"}, + "base_environment_source_type": { + "key": "baseEnvironmentSourceType", + "type": "str", + }, "resource_id": {"key": "resourceId", "type": "str"}, } @@ -1251,7 +1337,13 @@ class BasicBinding(Binding): "source": {"key": "source", "type": "str"}, } - def __init__(self, *, destination: Optional[str] = None, source: Optional[str] = None, **kwargs): + def __init__( + self, + *, + destination: Optional[str] = None, + source: Optional[str] = None, + **kwargs + ): """ :keyword destination: Destination reference. :paramtype destination: str @@ -1277,8 +1369,14 @@ class BlobReferenceForConsumptionDto(msrest.serialization.Model): _attribute_map = { "blob_uri": {"key": "blobUri", "type": "str"}, - "credential": {"key": "credential", "type": "DataReferenceCredentialDto"}, - "storage_account_arm_id": {"key": "storageAccountArmId", "type": "str"}, + "credential": { + "key": "credential", + "type": "DataReferenceCredentialDto", + }, + "storage_account_arm_id": { + "key": "storageAccountArmId", + "type": "str", + }, } def __init__( @@ -1317,7 +1415,13 @@ class BlobReferenceSASRequestDto(msrest.serialization.Model): "blob_uri": {"key": "blobUri", "type": "str"}, } - def __init__(self, *, asset_id: Optional[str] = None, blob_uri: Optional[str] = None, **kwargs): + def __init__( + self, + *, + asset_id: Optional[str] = None, + blob_uri: Optional[str] = None, + **kwargs + ): """ :keyword asset_id: :paramtype asset_id: str @@ -1344,7 +1448,14 @@ class BlobReferenceSASResponseDto(msrest.serialization.Model): }, } - def __init__(self, *, blob_reference_for_consumption: Optional["BlobReferenceForConsumptionDto"] = None, **kwargs): + def __init__( + self, + *, + blob_reference_for_consumption: Optional[ + "BlobReferenceForConsumptionDto" + ] = None, + **kwargs + ): """ :keyword blob_reference_for_consumption: :paramtype blob_reference_for_consumption: @@ -1386,7 +1497,13 @@ class BuildContext(msrest.serialization.Model): "dockerfile_path": {"key": "dockerfilePath", "type": "str"}, } - def __init__(self, *, context_uri: str, dockerfile_path: Optional[str] = "Dockerfile", **kwargs): + def __init__( + self, + *, + context_uri: str, + dockerfile_path: Optional[str] = "Dockerfile", + **kwargs + ): """ :keyword context_uri: Required. URI of the Docker build context used to build the image. Supports blob URIs on environment creation and may return blob or Git URIs. @@ -1530,7 +1647,11 @@ class CodeConfiguration(msrest.serialization.Model): """ _validation = { - "scoring_script": {"required": True, "min_length": 1, "pattern": r"[a-zA-Z0-9_]"}, + "scoring_script": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { @@ -1538,7 +1659,9 @@ class CodeConfiguration(msrest.serialization.Model): "scoring_script": {"key": "scoringScript", "type": "str"}, } - def __init__(self, *, scoring_script: str, code_id: Optional[str] = None, **kwargs): + def __init__( + self, *, scoring_script: str, code_id: Optional[str] = None, **kwargs + ): """ :keyword code_id: ARM resource ID of the code asset. :paramtype code_id: str @@ -1691,7 +1814,11 @@ def __init__( :paramtype is_archived: bool """ super(CodeContainerDetails, self).__init__( - description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs ) @@ -1710,7 +1837,13 @@ class CodeContainerResourceArmPaginatedResult(msrest.serialization.Model): "value": {"key": "value", "type": "[CodeContainerData]"}, } - def __init__(self, *, next_link: Optional[str] = None, value: Optional[List["CodeContainerData"]] = None, **kwargs): + def __init__( + self, + *, + next_link: Optional[str] = None, + value: Optional[List["CodeContainerData"]] = None, + **kwargs + ): """ :keyword next_link: The link to the next page of CodeContainer objects. If null, there are no additional pages. @@ -1847,7 +1980,13 @@ class CodeVersionResourceArmPaginatedResult(msrest.serialization.Model): "value": {"key": "value", "type": "[CodeVersionData]"}, } - def __init__(self, *, next_link: Optional[str] = None, value: Optional[List["CodeVersionData"]] = None, **kwargs): + def __init__( + self, + *, + next_link: Optional[str] = None, + value: Optional[List["CodeVersionData"]] = None, + **kwargs + ): """ :keyword next_link: The link to the next page of CodeVersion objects. If null, there are no additional pages. @@ -1920,7 +2059,12 @@ class JobBase(ResourceBase): } _subtype_map = { - "job_type": {"Base": "Job", "Command": "CommandJob", "Pipeline": "PipelineJob", "Sweep": "SweepJob"} + "job_type": { + "Base": "Job", + "Command": "CommandJob", + "Pipeline": "PipelineJob", + "Sweep": "SweepJob", + } } def __init__( @@ -1956,7 +2100,9 @@ def __init__( For local jobs, a job endpoint will have an endpoint value of FileStreamObject. :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] """ - super(JobBase, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + super(JobBase, self).__init__( + description=description, properties=properties, tags=tags, **kwargs + ) self.compute_id = compute_id self.display_name = display_name self.experiment_name = experiment_name @@ -2033,7 +2179,11 @@ class CommandJob(JobBase): "job_type": {"required": True}, "parent_job_name": {"readonly": True}, "status": {"readonly": True}, - "command": {"required": True, "min_length": 1, "pattern": r"[a-zA-Z0-9_]"}, + "command": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, "environment_id": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, "parameters": {"readonly": True}, } @@ -2052,9 +2202,15 @@ class CommandJob(JobBase): "status": {"key": "status", "type": "str"}, "code_id": {"key": "codeId", "type": "str"}, "command": {"key": "command", "type": "str"}, - "distribution": {"key": "distribution", "type": "DistributionConfiguration"}, + "distribution": { + "key": "distribution", + "type": "DistributionConfiguration", + }, "environment_id": {"key": "environmentId", "type": "str"}, - "environment_variables": {"key": "environmentVariables", "type": "{str}"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, "identity": {"key": "identity", "type": "IdentityConfiguration"}, "inputs": {"key": "inputs", "type": "{JobInput}"}, "limits": {"key": "limits", "type": "CommandJobLimits"}, @@ -2181,9 +2337,16 @@ class JobLimits(msrest.serialization.Model): "timeout": {"key": "timeout", "type": "duration"}, } - _subtype_map = {"job_limits_type": {"Command": "CommandJobLimits", "Sweep": "SweepJobLimits"}} + _subtype_map = { + "job_limits_type": { + "Command": "CommandJobLimits", + "Sweep": "SweepJobLimits", + } + } - def __init__(self, *, timeout: Optional[datetime.timedelta] = None, **kwargs): + def __init__( + self, *, timeout: Optional[datetime.timedelta] = None, **kwargs + ): """ :keyword timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. Only supports duration with precision as low as Seconds. @@ -2216,7 +2379,9 @@ class CommandJobLimits(JobLimits): "timeout": {"key": "timeout", "type": "duration"}, } - def __init__(self, *, timeout: Optional[datetime.timedelta] = None, **kwargs): + def __init__( + self, *, timeout: Optional[datetime.timedelta] = None, **kwargs + ): """ :keyword timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. Only supports duration with precision as low as Seconds. @@ -2261,7 +2426,10 @@ class ComponentContainerData(Resource): "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "ComponentContainerDetails"}, + "properties": { + "key": "properties", + "type": "ComponentContainerDetails", + }, } def __init__(self, *, properties: "ComponentContainerDetails", **kwargs): @@ -2331,7 +2499,11 @@ def __init__( :paramtype is_archived: bool """ super(ComponentContainerDetails, self).__init__( - description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs ) @@ -2351,7 +2523,11 @@ class ComponentContainerResourceArmPaginatedResult(msrest.serialization.Model): } def __init__( - self, *, next_link: Optional[str] = None, value: Optional[List["ComponentContainerData"]] = None, **kwargs + self, + *, + next_link: Optional[str] = None, + value: Optional[List["ComponentContainerData"]] = None, + **kwargs ): """ :keyword next_link: The link to the next page of ComponentContainer objects. If null, there are @@ -2360,7 +2536,9 @@ def __init__( :keyword value: An array of objects of type ComponentContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainerData] """ - super(ComponentContainerResourceArmPaginatedResult, self).__init__(**kwargs) + super(ComponentContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -2557,7 +2735,11 @@ class ComponentVersionResourceArmPaginatedResult(msrest.serialization.Model): } def __init__( - self, *, next_link: Optional[str] = None, value: Optional[List["ComponentVersionData"]] = None, **kwargs + self, + *, + next_link: Optional[str] = None, + value: Optional[List["ComponentVersionData"]] = None, + **kwargs ): """ :keyword next_link: The link to the next page of ComponentVersion objects. If null, there are @@ -2566,7 +2748,9 @@ def __init__( :keyword value: An array of objects of type ComponentVersion. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersionData] """ - super(ComponentVersionResourceArmPaginatedResult, self).__init__(**kwargs) + super(ComponentVersionResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -2590,10 +2774,20 @@ class CustomInferencingServer(InferencingServer): _attribute_map = { "server_type": {"key": "serverType", "type": "str"}, - "inference_configuration": {"key": "inferenceConfiguration", "type": "OnlineInferenceConfiguration"}, + "inference_configuration": { + "key": "inferenceConfiguration", + "type": "OnlineInferenceConfiguration", + }, } - def __init__(self, *, inference_configuration: Optional["OnlineInferenceConfiguration"] = None, **kwargs): + def __init__( + self, + *, + inference_configuration: Optional[ + "OnlineInferenceConfiguration" + ] = None, + **kwargs + ): """ :keyword inference_configuration: Inference configuration for custom inferencing. :paramtype inference_configuration: @@ -2715,7 +2909,11 @@ def __init__( :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType """ super(DataContainerDetails, self).__init__( - description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs ) self.data_type = data_type @@ -2735,7 +2933,13 @@ class DataContainerResourceArmPaginatedResult(msrest.serialization.Model): "value": {"key": "value", "type": "[DataContainerData]"}, } - def __init__(self, *, next_link: Optional[str] = None, value: Optional[List["DataContainerData"]] = None, **kwargs): + def __init__( + self, + *, + next_link: Optional[str] = None, + value: Optional[List["DataContainerData"]] = None, + **kwargs + ): """ :keyword next_link: The link to the next page of DataContainer objects. If null, there are no additional pages. @@ -2772,7 +2976,13 @@ class DataPathAssetReference(AssetReferenceBase): "path": {"key": "path", "type": "str"}, } - def __init__(self, *, datastore_id: Optional[str] = None, path: Optional[str] = None, **kwargs): + def __init__( + self, + *, + datastore_id: Optional[str] = None, + path: Optional[str] = None, + **kwargs + ): """ :keyword datastore_id: ARM resource ID of the datastore where the asset is located. :paramtype datastore_id: str @@ -2904,11 +3114,18 @@ class DataVersionBaseDetails(AssetBase): "is_archived": {"key": "isArchived", "type": "bool"}, "data_type": {"key": "dataType", "type": "str"}, "data_uri": {"key": "dataUri", "type": "str"}, - "intellectual_property": {"key": "intellectualProperty", "type": "IntellectualProperty"}, + "intellectual_property": { + "key": "intellectualProperty", + "type": "IntellectualProperty", + }, } _subtype_map = { - "data_type": {"mltable": "MLTableData", "uri_file": "UriFileDataVersion", "uri_folder": "UriFolderDataVersion"} + "data_type": { + "mltable": "MLTableData", + "uri_file": "UriFileDataVersion", + "uri_folder": "UriFolderDataVersion", + } } def __init__( @@ -2971,7 +3188,11 @@ class DataVersionBaseResourceArmPaginatedResult(msrest.serialization.Model): } def __init__( - self, *, next_link: Optional[str] = None, value: Optional[List["DataVersionBaseData"]] = None, **kwargs + self, + *, + next_link: Optional[str] = None, + value: Optional[List["DataVersionBaseData"]] = None, + **kwargs ): """ :keyword next_link: The link to the next page of DataVersionBase objects. If null, there are no @@ -2980,7 +3201,9 @@ def __init__( :keyword value: An array of objects of type DataVersionBase. :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBaseData] """ - super(DataVersionBaseResourceArmPaginatedResult, self).__init__(**kwargs) + super(DataVersionBaseResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -3006,7 +3229,13 @@ class DistributionConfiguration(msrest.serialization.Model): "distribution_type": {"key": "distributionType", "type": "str"}, } - _subtype_map = {"distribution_type": {"Mpi": "Mpi", "PyTorch": "PyTorch", "TensorFlow": "TensorFlow"}} + _subtype_map = { + "distribution_type": { + "Mpi": "Mpi", + "PyTorch": "PyTorch", + "TensorFlow": "TensorFlow", + } + } def __init__(self, **kwargs): """ """ @@ -3028,7 +3257,13 @@ class DockerCredentialDto(msrest.serialization.Model): "user_name": {"key": "userName", "type": "str"}, } - def __init__(self, *, password: Optional[str] = None, user_name: Optional[str] = None, **kwargs): + def __init__( + self, + *, + password: Optional[str] = None, + user_name: Optional[str] = None, + **kwargs + ): """ :keyword password: :paramtype password: str @@ -3075,7 +3310,10 @@ class EnvironmentContainerData(Resource): "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "EnvironmentContainerDetails"}, + "properties": { + "key": "properties", + "type": "EnvironmentContainerDetails", + }, } def __init__(self, *, properties: "EnvironmentContainerDetails", **kwargs): @@ -3140,11 +3378,17 @@ def __init__( :paramtype is_archived: bool """ super(EnvironmentContainerDetails, self).__init__( - description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs ) -class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model): +class EnvironmentContainerResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of EnvironmentContainer entities. :ivar next_link: The link to the next page of EnvironmentContainer objects. If null, there are @@ -3160,7 +3404,11 @@ class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model) } def __init__( - self, *, next_link: Optional[str] = None, value: Optional[List["EnvironmentContainerData"]] = None, **kwargs + self, + *, + next_link: Optional[str] = None, + value: Optional[List["EnvironmentContainerData"]] = None, + **kwargs ): """ :keyword next_link: The link to the next page of EnvironmentContainer objects. If null, there @@ -3169,7 +3417,9 @@ def __init__( :keyword value: An array of objects of type EnvironmentContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainerData] """ - super(EnvironmentContainerResourceArmPaginatedResult, self).__init__(**kwargs) + super(EnvironmentContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -3209,7 +3459,10 @@ class EnvironmentVersionData(Resource): "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "EnvironmentVersionDetails"}, + "properties": { + "key": "properties", + "type": "EnvironmentVersionDetails", + }, } def __init__(self, *, properties: "EnvironmentVersionDetails", **kwargs): @@ -3293,8 +3546,14 @@ class EnvironmentVersionDetails(AssetBase): "conda_file": {"key": "condaFile", "type": "str"}, "environment_type": {"key": "environmentType", "type": "str"}, "image": {"key": "image", "type": "str"}, - "inference_config": {"key": "inferenceConfig", "type": "InferenceContainerProperties"}, - "intellectual_property": {"key": "intellectualProperty", "type": "IntellectualProperty"}, + "inference_config": { + "key": "inferenceConfig", + "type": "InferenceContainerProperties", + }, + "intellectual_property": { + "key": "intellectualProperty", + "type": "IntellectualProperty", + }, "os_type": {"key": "osType", "type": "str"}, "stage": {"key": "stage", "type": "str"}, } @@ -3394,7 +3653,11 @@ class EnvironmentVersionResourceArmPaginatedResult(msrest.serialization.Model): } def __init__( - self, *, next_link: Optional[str] = None, value: Optional[List["EnvironmentVersionData"]] = None, **kwargs + self, + *, + next_link: Optional[str] = None, + value: Optional[List["EnvironmentVersionData"]] = None, + **kwargs ): """ :keyword next_link: The link to the next page of EnvironmentVersion objects. If null, there are @@ -3403,7 +3666,9 @@ def __init__( :keyword value: An array of objects of type EnvironmentVersion. :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersionData] """ - super(EnvironmentVersionResourceArmPaginatedResult, self).__init__(**kwargs) + super(EnvironmentVersionResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -3466,7 +3731,10 @@ class ErrorDetail(msrest.serialization.Model): "message": {"key": "message", "type": "str"}, "target": {"key": "target", "type": "str"}, "details": {"key": "details", "type": "[ErrorDetail]"}, - "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"}, + "additional_info": { + "key": "additionalInfo", + "type": "[ErrorAdditionalInfo]", + }, } def __init__(self, **kwargs): @@ -3566,9 +3834,15 @@ class ImageReferenceForConsumptionDto(msrest.serialization.Model): _attribute_map = { "acr_details": {"key": "acrDetails", "type": "AcrDetail"}, - "credential": {"key": "credential", "type": "DataReferenceCredentialDto"}, + "credential": { + "key": "credential", + "type": "DataReferenceCredentialDto", + }, "image_name": {"key": "imageName", "type": "str"}, - "image_registry_reference": {"key": "imageRegistryReference", "type": "str"}, + "image_registry_reference": { + "key": "imageRegistryReference", + "type": "str", + }, } def __init__( @@ -3660,7 +3934,13 @@ class IntellectualProperty(msrest.serialization.Model): "publisher": {"key": "publisher", "type": "str"}, } - def __init__(self, *, publisher: str, protection_level: Optional[Union[str, "ProtectionLevel"]] = None, **kwargs): + def __init__( + self, + *, + publisher: str, + protection_level: Optional[Union[str, "ProtectionLevel"]] = None, + **kwargs + ): """ :keyword protection_level: Protection level of the Intellectual Property. Possible values include: "All", "None". @@ -3802,7 +4082,11 @@ class JobInput(msrest.serialization.Model): } _subtype_map = { - "job_input_type": {"Dataset": "JobInputDataset", "Literal": "JobInputLiteral", "Uri": "JobInputUri"} + "job_input_type": { + "Dataset": "JobInputDataset", + "Literal": "JobInputLiteral", + "Uri": "JobInputUri", + } } def __init__(self, *, description: Optional[str] = None, **kwargs): @@ -3861,7 +4145,9 @@ def __init__( "ReadWriteMount", "Download". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.InputDataDeliveryMode """ - super(JobInputDataset, self).__init__(description=description, **kwargs) + super(JobInputDataset, self).__init__( + description=description, **kwargs + ) self.job_input_type = "Dataset" # type: str self.dataset_id = dataset_id self.mode = mode @@ -3891,14 +4177,22 @@ class JobInputLiteral(JobInput): "value": {"key": "value", "type": "str"}, } - def __init__(self, *, description: Optional[str] = None, value: Optional[str] = None, **kwargs): + def __init__( + self, + *, + description: Optional[str] = None, + value: Optional[str] = None, + **kwargs + ): """ :keyword description: Description for the input. :paramtype description: str :keyword value: Literal value for the input. :paramtype value: str """ - super(JobInputLiteral, self).__init__(description=description, **kwargs) + super(JobInputLiteral, self).__init__( + description=description, **kwargs + ) self.job_input_type = "Literal" # type: str self.value = value @@ -3979,7 +4273,12 @@ class JobOutput(msrest.serialization.Model): "job_output_type": {"key": "jobOutputType", "type": "str"}, } - _subtype_map = {"job_output_type": {"Dataset": "JobOutputDataset", "Uri": "JobOutputUri"}} + _subtype_map = { + "job_output_type": { + "Dataset": "JobOutputDataset", + "Uri": "JobOutputUri", + } + } def __init__(self, *, description: Optional[str] = None, **kwargs): """ @@ -4028,7 +4327,9 @@ def __init__( :keyword mode: Output Delivery Mode. Possible values include: "ReadWriteMount", "Upload". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDataDeliveryMode """ - super(JobOutputDataset, self).__init__(description=description, **kwargs) + super(JobOutputDataset, self).__init__( + description=description, **kwargs + ) self.job_output_type = "Dataset" # type: str self.mode = mode @@ -4214,10 +4515,22 @@ class ManagedIdentityCredentialDto(msrest.serialization.Model): _attribute_map = { "managed_identity_type": {"key": "managedIdentityType", "type": "str"}, - "user_managed_identity_client_id": {"key": "userManagedIdentityClientId", "type": "str"}, - "user_managed_identity_principal_id": {"key": "userManagedIdentityPrincipalId", "type": "str"}, - "user_managed_identity_resource_id": {"key": "userManagedIdentityResourceId", "type": "str"}, - "user_managed_identity_tenant_id": {"key": "userManagedIdentityTenantId", "type": "str"}, + "user_managed_identity_client_id": { + "key": "userManagedIdentityClientId", + "type": "str", + }, + "user_managed_identity_principal_id": { + "key": "userManagedIdentityPrincipalId", + "type": "str", + }, + "user_managed_identity_resource_id": { + "key": "userManagedIdentityResourceId", + "type": "str", + }, + "user_managed_identity_tenant_id": { + "key": "userManagedIdentityTenantId", + "type": "str", + }, } def __init__( @@ -4249,8 +4562,12 @@ def __init__( super(ManagedIdentityCredentialDto, self).__init__(**kwargs) self.managed_identity_type = managed_identity_type self.user_managed_identity_client_id = user_managed_identity_client_id - self.user_managed_identity_principal_id = user_managed_identity_principal_id - self.user_managed_identity_resource_id = user_managed_identity_resource_id + self.user_managed_identity_principal_id = ( + user_managed_identity_principal_id + ) + self.user_managed_identity_resource_id = ( + user_managed_identity_resource_id + ) self.user_managed_identity_tenant_id = user_managed_identity_tenant_id @@ -4279,7 +4596,13 @@ class MedianStoppingPolicy(EarlyTerminationPolicy): "policy_type": {"key": "policyType", "type": "str"}, } - def __init__(self, *, delay_evaluation: Optional[int] = 0, evaluation_interval: Optional[int] = 0, **kwargs): + def __init__( + self, + *, + delay_evaluation: Optional[int] = 0, + evaluation_interval: Optional[int] = 0, + **kwargs + ): """ :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. :paramtype delay_evaluation: int @@ -4287,7 +4610,9 @@ def __init__(self, *, delay_evaluation: Optional[int] = 0, evaluation_interval: :paramtype evaluation_interval: int """ super(MedianStoppingPolicy, self).__init__( - delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs + delay_evaluation=delay_evaluation, + evaluation_interval=evaluation_interval, + **kwargs ) self.policy_type = "MedianStopping" # type: str @@ -4333,7 +4658,10 @@ class MLTableData(DataVersionBaseDetails): "is_archived": {"key": "isArchived", "type": "bool"}, "data_type": {"key": "dataType", "type": "str"}, "data_uri": {"key": "dataUri", "type": "str"}, - "intellectual_property": {"key": "intellectualProperty", "type": "IntellectualProperty"}, + "intellectual_property": { + "key": "intellectualProperty", + "type": "IntellectualProperty", + }, "referenced_uris": {"key": "referencedUris", "type": "[str]"}, } @@ -4517,7 +4845,11 @@ def __init__( :paramtype is_archived: bool """ super(ModelContainerDetails, self).__init__( - description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs ) @@ -4537,7 +4869,11 @@ class ModelContainerResourceArmPaginatedResult(msrest.serialization.Model): } def __init__( - self, *, next_link: Optional[str] = None, value: Optional[List["ModelContainerData"]] = None, **kwargs + self, + *, + next_link: Optional[str] = None, + value: Optional[List["ModelContainerData"]] = None, + **kwargs ): """ :keyword next_link: The link to the next page of ModelContainer objects. If null, there are no @@ -4546,7 +4882,9 @@ def __init__( :keyword value: An array of objects of type ModelContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelContainerData] """ - super(ModelContainerResourceArmPaginatedResult, self).__init__(**kwargs) + super(ModelContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -4688,7 +5026,10 @@ class ModelVersionDetails(AssetBase): "is_anonymous": {"key": "isAnonymous", "type": "bool"}, "is_archived": {"key": "isArchived", "type": "bool"}, "flavors": {"key": "flavors", "type": "{FlavorData}"}, - "intellectual_property": {"key": "intellectualProperty", "type": "IntellectualProperty"}, + "intellectual_property": { + "key": "intellectualProperty", + "type": "IntellectualProperty", + }, "job_name": {"key": "jobName", "type": "str"}, "model_type": {"key": "modelType", "type": "str"}, "model_uri": {"key": "modelUri", "type": "str"}, @@ -4768,7 +5109,13 @@ class ModelVersionResourceArmPaginatedResult(msrest.serialization.Model): "value": {"key": "value", "type": "[ModelVersionData]"}, } - def __init__(self, *, next_link: Optional[str] = None, value: Optional[List["ModelVersionData"]] = None, **kwargs): + def __init__( + self, + *, + next_link: Optional[str] = None, + value: Optional[List["ModelVersionData"]] = None, + **kwargs + ): """ :keyword next_link: The link to the next page of ModelVersion objects. If null, there are no additional pages. @@ -4799,10 +5146,15 @@ class Mpi(DistributionConfiguration): _attribute_map = { "distribution_type": {"key": "distributionType", "type": "str"}, - "process_count_per_instance": {"key": "processCountPerInstance", "type": "int"}, + "process_count_per_instance": { + "key": "processCountPerInstance", + "type": "int", + }, } - def __init__(self, *, process_count_per_instance: Optional[int] = None, **kwargs): + def __init__( + self, *, process_count_per_instance: Optional[int] = None, **kwargs + ): """ :keyword process_count_per_instance: Number of processes per MPI node. :paramtype process_count_per_instance: int @@ -4859,7 +5211,9 @@ class Objective(msrest.serialization.Model): "primary_metric": {"key": "primaryMetric", "type": "str"}, } - def __init__(self, *, goal: Union[str, "Goal"], primary_metric: str, **kwargs): + def __init__( + self, *, goal: Union[str, "Goal"], primary_metric: str, **kwargs + ): """ :keyword goal: Required. Defines supported metric goals for hyperparameter tuning. Possible values include: "Minimize", "Maximize". @@ -4951,7 +5305,13 @@ class OutputPathAssetReference(AssetReferenceBase): "path": {"key": "path", "type": "str"}, } - def __init__(self, *, job_id: Optional[str] = None, path: Optional[str] = None, **kwargs): + def __init__( + self, + *, + job_id: Optional[str] = None, + path: Optional[str] = None, + **kwargs + ): """ :keyword job_id: ARM resource ID of the job. :paramtype job_id: str @@ -5085,7 +5445,13 @@ class PackageInputPathVersion(PackageInputPathBase): "resource_version": {"key": "resourceVersion", "type": "str"}, } - def __init__(self, *, resource_name: Optional[str] = None, resource_version: Optional[str] = None, **kwargs): + def __init__( + self, + *, + resource_name: Optional[str] = None, + resource_version: Optional[str] = None, + **kwargs + ): """ :keyword resource_name: Input resource name. :paramtype resource_name: str @@ -5127,15 +5493,30 @@ class PackageRequest(msrest.serialization.Model): _validation = { "inferencing_server": {"required": True}, - "target_environment_id": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "target_environment_id": { + "required": True, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - "base_environment_source": {"key": "baseEnvironmentSource", "type": "BaseEnvironmentSource"}, - "environment_variables": {"key": "environmentVariables", "type": "{str}"}, - "inferencing_server": {"key": "inferencingServer", "type": "InferencingServer"}, + "base_environment_source": { + "key": "baseEnvironmentSource", + "type": "BaseEnvironmentSource", + }, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "inferencing_server": { + "key": "inferencingServer", + "type": "InferencingServer", + }, "inputs": {"key": "inputs", "type": "[ModelPackageInput]"}, - "model_configuration": {"key": "modelConfiguration", "type": "ModelConfiguration"}, + "model_configuration": { + "key": "modelConfiguration", + "type": "ModelConfiguration", + }, "properties": {"key": "properties", "type": "{str}"}, "sku_architecture_type": {"key": "skuArchitectureType", "type": "str"}, "tags": {"key": "tags", "type": "{str}"}, @@ -5237,14 +5618,26 @@ class PackageResponse(msrest.serialization.Model): } _attribute_map = { - "base_environment_source": {"key": "baseEnvironmentSource", "type": "BaseEnvironmentSource"}, + "base_environment_source": { + "key": "baseEnvironmentSource", + "type": "BaseEnvironmentSource", + }, "build_id": {"key": "buildId", "type": "str"}, "build_state": {"key": "buildState", "type": "str"}, - "environment_variables": {"key": "environmentVariables", "type": "{str}"}, - "inferencing_server": {"key": "inferencingServer", "type": "InferencingServer"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "inferencing_server": { + "key": "inferencingServer", + "type": "InferencingServer", + }, "inputs": {"key": "inputs", "type": "[ModelPackageInput]"}, "log_url": {"key": "logUrl", "type": "str"}, - "model_configuration": {"key": "modelConfiguration", "type": "ModelConfiguration"}, + "model_configuration": { + "key": "modelConfiguration", + "type": "ModelConfiguration", + }, "properties": {"key": "properties", "type": "{str}"}, "sku_architecture_type": {"key": "skuArchitectureType", "type": "str"}, "tags": {"key": "tags", "type": "{str}"}, @@ -5252,7 +5645,11 @@ class PackageResponse(msrest.serialization.Model): } def __init__( - self, *, properties: Optional[Dict[str, str]] = None, sku_architecture_type: Optional[str] = None, **kwargs + self, + *, + properties: Optional[Dict[str, str]] = None, + sku_architecture_type: Optional[str] = None, + **kwargs ): """ :keyword properties: Properties dictionary. @@ -5431,10 +5828,15 @@ class PyTorch(DistributionConfiguration): _attribute_map = { "distribution_type": {"key": "distributionType", "type": "str"}, - "process_count_per_instance": {"key": "processCountPerInstance", "type": "int"}, + "process_count_per_instance": { + "key": "processCountPerInstance", + "type": "int", + }, } - def __init__(self, *, process_count_per_instance: Optional[int] = None, **kwargs): + def __init__( + self, *, process_count_per_instance: Optional[int] = None, **kwargs + ): """ :keyword process_count_per_instance: Number of processes per node. :paramtype process_count_per_instance: int @@ -5519,10 +5921,18 @@ class ResourceManagementAssetReferenceData(Resource): "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "ResourceManagementAssetReferenceDetails"}, + "properties": { + "key": "properties", + "type": "ResourceManagementAssetReferenceDetails", + }, } - def __init__(self, *, properties: "ResourceManagementAssetReferenceDetails", **kwargs): + def __init__( + self, + *, + properties: "ResourceManagementAssetReferenceDetails", + **kwargs + ): """ :keyword properties: Required. Additional attributes of the entity. :paramtype properties: @@ -5734,7 +6144,10 @@ class ServicePrincipalDatastoreCredentials(DatastoreCredentials): "authority_url": {"key": "authorityUrl", "type": "str"}, "client_id": {"key": "clientId", "type": "str"}, "resource_url": {"key": "resourceUrl", "type": "str"}, - "secrets": {"key": "secrets", "type": "ServicePrincipalDatastoreSecrets"}, + "secrets": { + "key": "secrets", + "type": "ServicePrincipalDatastoreSecrets", + }, "tenant_id": {"key": "tenantId", "type": "str"}, } @@ -5883,7 +6296,10 @@ class SweepJob(JobBase): "parent_job_name": {"key": "parentJobName", "type": "str"}, "services": {"key": "services", "type": "{JobService}"}, "status": {"key": "status", "type": "str"}, - "early_termination": {"key": "earlyTermination", "type": "EarlyTerminationPolicy"}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, "identity": {"key": "identity", "type": "IdentityConfiguration"}, "inputs": {"key": "inputs", "type": "{JobInput}"}, "limits": {"key": "limits", "type": "SweepJobLimits"}, @@ -6120,8 +6536,14 @@ class TemporaryDataReferenceRequestDto(msrest.serialization.Model): _attribute_map = { "asset_id": {"key": "assetId", "type": "str"}, - "temporary_data_reference_id": {"key": "temporaryDataReferenceId", "type": "str"}, - "temporary_data_reference_type": {"key": "temporaryDataReferenceType", "type": "str"}, + "temporary_data_reference_id": { + "key": "temporaryDataReferenceId", + "type": "str", + }, + "temporary_data_reference_type": { + "key": "temporaryDataReferenceType", + "type": "str", + }, } def __init__( @@ -6172,15 +6594,25 @@ class TemporaryDataReferenceResponseDto(msrest.serialization.Model): "key": "imageReferenceForConsumption", "type": "ImageReferenceForConsumptionDto", }, - "temporary_data_reference_id": {"key": "temporaryDataReferenceId", "type": "str"}, - "temporary_data_reference_type": {"key": "temporaryDataReferenceType", "type": "str"}, + "temporary_data_reference_id": { + "key": "temporaryDataReferenceId", + "type": "str", + }, + "temporary_data_reference_type": { + "key": "temporaryDataReferenceType", + "type": "str", + }, } def __init__( self, *, - blob_reference_for_consumption: Optional["BlobReferenceForConsumptionDto"] = None, - image_reference_for_consumption: Optional["ImageReferenceForConsumptionDto"] = None, + blob_reference_for_consumption: Optional[ + "BlobReferenceForConsumptionDto" + ] = None, + image_reference_for_consumption: Optional[ + "ImageReferenceForConsumptionDto" + ] = None, temporary_data_reference_id: Optional[str] = None, temporary_data_reference_type: Optional[str] = None, **kwargs @@ -6224,11 +6656,20 @@ class TensorFlow(DistributionConfiguration): _attribute_map = { "distribution_type": {"key": "distributionType", "type": "str"}, - "parameter_server_count": {"key": "parameterServerCount", "type": "int"}, + "parameter_server_count": { + "key": "parameterServerCount", + "type": "int", + }, "worker_count": {"key": "workerCount", "type": "int"}, } - def __init__(self, *, parameter_server_count: Optional[int] = 0, worker_count: Optional[int] = None, **kwargs): + def __init__( + self, + *, + parameter_server_count: Optional[int] = 0, + worker_count: Optional[int] = None, + **kwargs + ): """ :keyword parameter_server_count: Number of parameter server tasks. :paramtype parameter_server_count: int @@ -6263,16 +6704,26 @@ class TrialComponent(msrest.serialization.Model): """ _validation = { - "command": {"required": True, "min_length": 1, "pattern": r"[a-zA-Z0-9_]"}, + "command": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, "environment_id": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { "code_id": {"key": "codeId", "type": "str"}, "command": {"key": "command", "type": "str"}, - "distribution": {"key": "distribution", "type": "DistributionConfiguration"}, + "distribution": { + "key": "distribution", + "type": "DistributionConfiguration", + }, "environment_id": {"key": "environmentId", "type": "str"}, - "environment_variables": {"key": "environmentVariables", "type": "{str}"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, "resources": {"key": "resources", "type": "ResourceConfiguration"}, } @@ -6332,10 +6783,20 @@ class TritonInferencingServer(InferencingServer): _attribute_map = { "server_type": {"key": "serverType", "type": "str"}, - "inference_configuration": {"key": "inferenceConfiguration", "type": "OnlineInferenceConfiguration"}, + "inference_configuration": { + "key": "inferenceConfiguration", + "type": "OnlineInferenceConfiguration", + }, } - def __init__(self, *, inference_configuration: Optional["OnlineInferenceConfiguration"] = None, **kwargs): + def __init__( + self, + *, + inference_configuration: Optional[ + "OnlineInferenceConfiguration" + ] = None, + **kwargs + ): """ :keyword inference_configuration: Inference configuration for Triton. :paramtype inference_configuration: @@ -6371,7 +6832,10 @@ class TruncationSelectionPolicy(EarlyTerminationPolicy): "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, "policy_type": {"key": "policyType", "type": "str"}, - "truncation_percentage": {"key": "truncationPercentage", "type": "int"}, + "truncation_percentage": { + "key": "truncationPercentage", + "type": "int", + }, } def __init__( @@ -6391,7 +6855,9 @@ def __init__( :paramtype truncation_percentage: int """ super(TruncationSelectionPolicy, self).__init__( - delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs + delay_evaluation=delay_evaluation, + evaluation_interval=evaluation_interval, + **kwargs ) self.policy_type = "TruncationSelection" # type: str self.truncation_percentage = truncation_percentage @@ -6436,7 +6902,10 @@ class UriFileDataVersion(DataVersionBaseDetails): "is_archived": {"key": "isArchived", "type": "bool"}, "data_type": {"key": "dataType", "type": "str"}, "data_uri": {"key": "dataUri", "type": "str"}, - "intellectual_property": {"key": "intellectualProperty", "type": "IntellectualProperty"}, + "intellectual_property": { + "key": "intellectualProperty", + "type": "IntellectualProperty", + }, } def __init__( @@ -6522,7 +6991,10 @@ class UriFolderDataVersion(DataVersionBaseDetails): "is_archived": {"key": "isArchived", "type": "bool"}, "data_type": {"key": "dataType", "type": "str"}, "data_uri": {"key": "dataUri", "type": "str"}, - "intellectual_property": {"key": "intellectualProperty", "type": "IntellectualProperty"}, + "intellectual_property": { + "key": "intellectualProperty", + "type": "IntellectualProperty", + }, } def __init__( @@ -6583,7 +7055,13 @@ class UriReference(msrest.serialization.Model): "folder": {"key": "folder", "type": "str"}, } - def __init__(self, *, file: Optional[str] = None, folder: Optional[str] = None, **kwargs): + def __init__( + self, + *, + file: Optional[str] = None, + folder: Optional[str] = None, + **kwargs + ): """ :keyword file: Single file uri path. :paramtype file: str diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/__init__.py index b7a43c68f0ab..bfbde2453dc2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/__init__.py @@ -15,23 +15,27 @@ from ._data_references_operations import DataReferencesOperations from ._environment_containers_operations import EnvironmentContainersOperations from ._environment_versions_operations import EnvironmentVersionsOperations -from ._resource_management_asset_reference_operations import ResourceManagementAssetReferenceOperations +from ._resource_management_asset_reference_operations import ( + ResourceManagementAssetReferenceOperations, +) from ._model_containers_operations import ModelContainersOperations from ._model_versions_operations import ModelVersionsOperations -from ._temporary_data_references_operations import TemporaryDataReferencesOperations +from ._temporary_data_references_operations import ( + TemporaryDataReferencesOperations, +) __all__ = [ - 'CodeContainersOperations', - 'CodeVersionsOperations', - 'ComponentContainersOperations', - 'ComponentVersionsOperations', - 'DataContainersOperations', - 'DataVersionsOperations', - 'DataReferencesOperations', - 'EnvironmentContainersOperations', - 'EnvironmentVersionsOperations', - 'ResourceManagementAssetReferenceOperations', - 'ModelContainersOperations', - 'ModelVersionsOperations', - 'TemporaryDataReferencesOperations', + "CodeContainersOperations", + "CodeVersionsOperations", + "ComponentContainersOperations", + "ComponentVersionsOperations", + "DataContainersOperations", + "DataVersionsOperations", + "DataReferencesOperations", + "EnvironmentContainersOperations", + "EnvironmentVersionsOperations", + "ResourceManagementAssetReferenceOperations", + "ModelContainersOperations", + "ModelVersionsOperations", + "TemporaryDataReferencesOperations", ] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_code_containers_operations.py index 690dec91d8da..dab77daf4167 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_code_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_code_containers_operations.py @@ -29,10 +29,23 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + ) T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -197,6 +210,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class CodeContainersOperations(object): """CodeContainersOperations operations. @@ -249,10 +263,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -285,7 +307,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -294,13 +318,23 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -336,10 +370,16 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str request = build_delete_request( name=name, @@ -352,13 +392,23 @@ def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -392,11 +442,19 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainerData"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeContainerData"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str request = build_get_request( name=name, @@ -409,15 +467,27 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("CodeContainerData", pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "CodeContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -456,12 +526,22 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainerData"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeContainerData"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "CodeContainerData") @@ -478,15 +558,27 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("CodeContainerData", pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "CodeContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_code_versions_operations.py index e565a29da0f8..89071707490b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_code_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_code_versions_operations.py @@ -31,10 +31,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + Union, + ) T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -213,6 +227,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class CodeVersionsOperations(object): """CodeVersionsOperations operations. @@ -274,10 +289,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -316,7 +339,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -325,13 +350,23 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -370,10 +405,16 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str request = build_delete_request( name=name, @@ -387,13 +428,23 @@ def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -430,11 +481,19 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersionData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersionData"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeVersionData"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str request = build_get_request( name=name, @@ -448,13 +507,23 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("CodeVersionData", pipeline_response) @@ -476,11 +545,19 @@ def _create_or_update_initial( ): # type: (...) -> None cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "CodeVersionData") @@ -498,19 +575,31 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} response_headers["x-ms-async-operation-timeout"] = self._deserialize( "duration", response.headers.get("x-ms-async-operation-timeout") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) @@ -557,12 +646,22 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, azure.core.polling.PollingMethod] + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( name=name, @@ -595,6 +694,11 @@ def get_long_running_output(pipeline_response): deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_component_containers_operations.py index 774338951b6f..5bc0e4cb59ec 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_component_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_component_containers_operations.py @@ -29,10 +29,23 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + ) T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -197,6 +210,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class ComponentContainersOperations(object): """ComponentContainersOperations operations. @@ -249,10 +263,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -285,7 +307,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -294,13 +319,23 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -336,10 +371,16 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str request = build_delete_request( name=name, @@ -352,13 +393,23 @@ def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -392,11 +443,19 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComponentContainerData"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainerData"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str request = build_get_request( name=name, @@ -409,15 +468,27 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ComponentContainerData", pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "ComponentContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -456,12 +527,22 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComponentContainerData"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainerData"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "ComponentContainerData") @@ -478,15 +559,27 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ComponentContainerData", pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "ComponentContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_component_versions_operations.py index 45c7c03144fd..40b8b8d22b38 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_component_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_component_versions_operations.py @@ -31,10 +31,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + Union, + ) T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -213,6 +227,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class ComponentVersionsOperations(object): """ComponentVersionsOperations operations. @@ -274,10 +289,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -316,7 +339,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -325,13 +350,23 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -370,10 +405,16 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str request = build_delete_request( name=name, @@ -387,13 +428,23 @@ def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -430,11 +481,19 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersionData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComponentVersionData"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersionData"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str request = build_get_request( name=name, @@ -448,15 +507,27 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("ComponentVersionData", pipeline_response) + deserialized = self._deserialize( + "ComponentVersionData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -476,11 +547,19 @@ def _create_or_update_initial( ): # type: (...) -> None cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "ComponentVersionData") @@ -498,19 +577,31 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} response_headers["x-ms-async-operation-timeout"] = self._deserialize( "duration", response.headers.get("x-ms-async-operation-timeout") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) @@ -557,12 +648,22 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, azure.core.polling.PollingMethod] + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( name=name, @@ -595,6 +696,11 @@ def get_long_running_output(pipeline_response): deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_data_containers_operations.py index 7e4d4b8db3cb..c367fb87f62a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_data_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_data_containers_operations.py @@ -29,10 +29,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + Union, + ) T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -200,6 +214,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class DataContainersOperations(object): """DataContainersOperations operations. @@ -255,10 +270,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -293,7 +316,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -302,13 +327,23 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -344,10 +379,16 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str request = build_delete_request( name=name, @@ -360,13 +401,23 @@ def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -400,11 +451,19 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainerData"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerData"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str request = build_get_request( name=name, @@ -417,15 +476,27 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DataContainerData", pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "DataContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -464,12 +535,22 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainerData"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerData"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "DataContainerData") @@ -486,15 +567,27 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DataContainerData", pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "DataContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_data_references_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_data_references_operations.py index d421aeac8e52..83fa87f3af6a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_data_references_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_data_references_operations.py @@ -31,7 +31,12 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -80,6 +85,7 @@ def build_get_blob_reference_sas_request( **kwargs ) + # fmt: on class DataReferencesOperations(object): """DataReferencesOperations operations. @@ -134,12 +140,22 @@ def get_blob_reference_sas( :rtype: ~azure.mgmt.machinelearningservices.models.BlobReferenceSASResponseDto :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.BlobReferenceSASResponseDto"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BlobReferenceSASResponseDto"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "BlobReferenceSASRequestDto") @@ -157,15 +173,27 @@ def get_blob_reference_sas( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("BlobReferenceSASResponseDto", pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "BlobReferenceSASResponseDto", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_data_versions_operations.py index 8b86175619df..e2c32bbd3fd7 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_data_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_data_versions_operations.py @@ -31,10 +31,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + Union, + ) T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -219,6 +233,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class DataVersionsOperations(object): """DataVersionsOperations operations. @@ -290,10 +305,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -336,7 +359,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataVersionBaseResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -345,13 +370,23 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -390,10 +425,16 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str request = build_delete_request( name=name, @@ -407,13 +448,23 @@ def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -450,11 +501,19 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBaseData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.DataVersionBaseData"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBaseData"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str request = build_get_request( name=name, @@ -468,15 +527,27 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("DataVersionBaseData", pipeline_response) + deserialized = self._deserialize( + "DataVersionBaseData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -496,11 +567,19 @@ def _create_or_update_initial( ): # type: (...) -> None cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "DataVersionBaseData") @@ -518,19 +597,31 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} response_headers["x-ms-async-operation-timeout"] = self._deserialize( "duration", response.headers.get("x-ms-async-operation-timeout") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) @@ -577,12 +668,22 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, azure.core.polling.PollingMethod] + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( name=name, @@ -615,6 +716,11 @@ def get_long_running_output(pipeline_response): deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_environment_containers_operations.py index 80db850b35c7..e9cf4e5e0728 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_environment_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_environment_containers_operations.py @@ -29,10 +29,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + Union, + ) T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -200,6 +214,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class EnvironmentContainersOperations(object): """EnvironmentContainersOperations operations. @@ -255,10 +270,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -293,7 +316,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -302,13 +328,23 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -344,10 +380,16 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str request = build_delete_request( name=name, @@ -360,13 +402,23 @@ def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -400,11 +452,19 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.EnvironmentContainerData"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainerData"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str request = build_get_request( name=name, @@ -417,15 +477,27 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("EnvironmentContainerData", pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "EnvironmentContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -464,12 +536,22 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.EnvironmentContainerData"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainerData"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "EnvironmentContainerData") @@ -486,15 +568,27 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("EnvironmentContainerData", pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "EnvironmentContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_environment_versions_operations.py index 6a736791d4b2..aa8285c739a6 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_environment_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_environment_versions_operations.py @@ -31,10 +31,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + Union, + ) T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -219,6 +233,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class EnvironmentVersionsOperations(object): """EnvironmentVersionsOperations operations. @@ -286,10 +301,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -332,7 +355,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersionResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -341,13 +367,23 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -386,10 +422,16 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str request = build_delete_request( name=name, @@ -403,13 +445,23 @@ def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -446,11 +498,19 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.EnvironmentVersionData"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersionData"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str request = build_get_request( name=name, @@ -464,15 +524,27 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("EnvironmentVersionData", pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersionData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -492,11 +564,19 @@ def _create_or_update_initial( ): # type: (...) -> None cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "EnvironmentVersionData") @@ -514,19 +594,31 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} response_headers["x-ms-async-operation-timeout"] = self._deserialize( "duration", response.headers.get("x-ms-async-operation-timeout") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) @@ -573,12 +665,22 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, azure.core.polling.PollingMethod] + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( name=name, @@ -611,6 +713,11 @@ def get_long_running_output(pipeline_response): deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_model_containers_operations.py index 2082bf6a1099..df1caeff4761 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_model_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_model_containers_operations.py @@ -31,10 +31,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + Union, + ) T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -202,6 +216,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class ModelContainersOperations(object): """ModelContainersOperations operations. @@ -257,10 +272,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -295,7 +318,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -304,13 +329,23 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -346,10 +381,16 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str request = build_delete_request( name=name, @@ -362,13 +403,23 @@ def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -402,11 +453,19 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelContainerData"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainerData"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str request = build_get_request( name=name, @@ -419,15 +478,27 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("ModelContainerData", pipeline_response) + deserialized = self._deserialize( + "ModelContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -445,12 +516,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.ModelContainerData" - cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelContainerData"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainerData"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "ModelContainerData") @@ -467,12 +548,20 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} response_headers["x-ms-async-operation-timeout"] = self._deserialize( @@ -482,7 +571,9 @@ def _create_or_update_initial( "str", response.headers.get("Azure-AsyncOperation") ) - deserialized = self._deserialize("ModelContainerData", pipeline_response) + deserialized = self._deserialize( + "ModelContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -530,12 +621,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ModelContainerData] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelContainerData"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainerData"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( name=name, @@ -552,14 +655,19 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): response_headers = {} response = pipeline_response.http_response - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) ) response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) - deserialized = self._deserialize("ModelContainerData", pipeline_response) + deserialized = self._deserialize( + "ModelContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized @@ -578,6 +686,11 @@ def get_long_running_output(pipeline_response): deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_model_versions_operations.py index 96a47546ef9a..eabdc069f61c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_model_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_model_versions_operations.py @@ -31,10 +31,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + Union, + ) T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -272,6 +286,7 @@ def build_package_request_initial( **kwargs ) + # fmt: on class ModelVersionsOperations(object): """ModelVersionsOperations operations. @@ -350,10 +365,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -402,7 +425,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -411,13 +436,23 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -456,10 +491,16 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str request = build_delete_request( name=name, @@ -473,13 +514,23 @@ def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -516,11 +567,19 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersionData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersionData"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelVersionData"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str request = build_get_request( name=name, @@ -534,13 +593,23 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("ModelVersionData", pipeline_response) @@ -562,11 +631,19 @@ def _create_or_update_initial( ): # type: (...) -> None cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "ModelVersionData") @@ -584,19 +661,31 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} response_headers["x-ms-async-operation-timeout"] = self._deserialize( "duration", response.headers.get("x-ms-async-operation-timeout") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) @@ -643,12 +732,22 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, azure.core.polling.PollingMethod] + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( name=name, @@ -681,7 +780,12 @@ def get_long_running_output(pipeline_response): deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}"} # type: ignore @@ -695,12 +799,22 @@ def _package_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.PackageResponse"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional["_models.PackageResponse"]] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.PackageResponse"]] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "PackageRequest") @@ -718,21 +832,35 @@ def _package_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("PackageResponse", pipeline_response) + deserialized = self._deserialize( + "PackageResponse", pipeline_response + ) if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -783,12 +911,24 @@ def begin_package( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.PackageResponse] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.PackageResponse"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PackageResponse"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._package_initial( name=name, @@ -805,13 +945,19 @@ def begin_package( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("PackageResponse", pipeline_response) + deserialized = self._deserialize( + "PackageResponse", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -824,6 +970,11 @@ def get_long_running_output(pipeline_response): deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) begin_package.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}/package"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_resource_management_asset_reference_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_resource_management_asset_reference_operations.py index 088d0d616979..5e048120e3a6 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_resource_management_asset_reference_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_resource_management_asset_reference_operations.py @@ -33,7 +33,12 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -78,6 +83,7 @@ def build_import_method_request_initial( **kwargs ) + # fmt: on class ResourceManagementAssetReferenceOperations(object): """ResourceManagementAssetReferenceOperations operations. @@ -110,13 +116,23 @@ def _import_method_initial( ): # type: (...) -> Optional[Any] cls = kwargs.pop("cls", None) # type: ClsType[Optional[Any]] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, "ResourceManagementAssetReferenceData") + _json = self._serialize.body( + body, "ResourceManagementAssetReferenceData" + ) request = build_import_method_request_initial( subscription_id=self._config.subscription_id, @@ -130,12 +146,20 @@ def _import_method_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} @@ -143,8 +167,12 @@ def _import_method_initial( deserialized = self._deserialize("object", pipeline_response) if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -196,12 +224,22 @@ def begin_import_method( :rtype: ~azure.core.polling.LROPoller[any] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, azure.core.polling.PollingMethod] + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[Any] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._import_method_initial( resource_group_name=resource_group_name, @@ -222,7 +260,11 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -235,6 +277,11 @@ def get_long_running_output(pipeline_response): deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) begin_import_method.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/import"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_temporary_data_references_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_temporary_data_references_operations.py index d2f5eb72f57e..ec6af94e8dca 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_temporary_data_references_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2021_10_01_dataplanepreview/operations/_temporary_data_references_operations.py @@ -31,7 +31,12 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -80,6 +85,7 @@ def build_create_or_get_temporary_data_reference_request( **kwargs ) + # fmt: on class TemporaryDataReferencesOperations(object): """TemporaryDataReferencesOperations operations. @@ -134,12 +140,22 @@ def create_or_get_temporary_data_reference( :rtype: ~azure.mgmt.machinelearningservices.models.TemporaryDataReferenceResponseDto :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.TemporaryDataReferenceResponseDto"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.TemporaryDataReferenceResponseDto"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2021-10-01-dataplanepreview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2021-10-01-dataplanepreview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "TemporaryDataReferenceRequestDto") @@ -152,20 +168,34 @@ def create_or_get_temporary_data_reference( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_get_temporary_data_reference.metadata["url"], + template_url=self.create_or_get_temporary_data_reference.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("TemporaryDataReferenceResponseDto", pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "TemporaryDataReferenceResponseDto", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/__init__.py index da46614477a9..71cf8fdc020d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/__init__.py @@ -10,9 +10,10 @@ from ._version import VERSION __version__ = VERSION -__all__ = ['AzureMachineLearningWorkspaces'] +__all__ = ["AzureMachineLearningWorkspaces"] # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk + patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/_azure_machine_learning_workspaces.py index 6eac3691ee8c..92581dcd25c6 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/_azure_machine_learning_workspaces.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/_azure_machine_learning_workspaces.py @@ -14,7 +14,18 @@ from . import models from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import ComputeOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, QuotasOperations, UsagesOperations, VirtualMachineSizesOperations, WorkspaceConnectionsOperations, WorkspaceFeaturesOperations, WorkspacesOperations +from .operations import ( + ComputeOperations, + Operations, + PrivateEndpointConnectionsOperations, + PrivateLinkResourcesOperations, + QuotasOperations, + UsagesOperations, + VirtualMachineSizesOperations, + WorkspaceConnectionsOperations, + WorkspaceFeaturesOperations, + WorkspacesOperations, +) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -23,6 +34,7 @@ from azure.core.credentials import TokenCredential from azure.core.rest import HttpRequest, HttpResponse + class AzureMachineLearningWorkspaces(object): """These APIs allow end users to operate on Azure Machine Learning Workspace resources. @@ -69,24 +81,51 @@ def __init__( **kwargs # type: Any ): # type: (...) -> None - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._config = AzureMachineLearningWorkspacesConfiguration( + credential=credential, subscription_id=subscription_id, **kwargs + ) + self._client = ARMPipelineClient( + base_url=base_url, config=self._config, **kwargs + ) + + client_models = { + k: v for k, v in models.__dict__.items() if isinstance(v, type) + } self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.workspaces = WorkspacesOperations(self._client, self._config, self._serialize, self._deserialize) - self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) - self.virtual_machine_sizes = VirtualMachineSizesOperations(self._client, self._config, self._serialize, self._deserialize) - self.quotas = QuotasOperations(self._client, self._config, self._serialize, self._deserialize) - self.compute = ComputeOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_connections = WorkspaceConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_features = WorkspaceFeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspaces = WorkspacesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.usages = UsagesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.virtual_machine_sizes = VirtualMachineSizesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.quotas = QuotasOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.compute = ComputeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.private_endpoint_connections = ( + PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspace_connections = WorkspaceConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspace_features = WorkspaceFeaturesOperations( + self._client, self._config, self._serialize, self._deserialize + ) def _send_request( self, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/_configuration.py index 1cb684ea5d9d..5193d63da967 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/_configuration.py @@ -10,7 +10,10 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ( + ARMChallengeAuthenticationPolicy, + ARMHttpLoggingPolicy, +) from ._version import VERSION @@ -40,7 +43,9 @@ def __init__( **kwargs # type: Any ): # type: (...) -> None - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) + super(AzureMachineLearningWorkspacesConfiguration, self).__init__( + **kwargs + ) if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: @@ -49,23 +54,44 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2022-01-01-preview" - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) + self.credential_scopes = kwargs.pop( + "credential_scopes", ["https://management.azure.com/.default"] + ) + kwargs.setdefault( + "sdk_moniker", "mgmt-machinelearningservices/{}".format(VERSION) + ) self._configure(**kwargs) def _configure( - self, - **kwargs # type: Any + self, **kwargs # type: Any ): # type: (...) -> None - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') + self.user_agent_policy = kwargs.get( + "user_agent_policy" + ) or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get( + "headers_policy" + ) or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy( + **kwargs + ) + self.logging_policy = kwargs.get( + "logging_policy" + ) or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get( + "http_logging_policy" + ) or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy( + **kwargs + ) + self.custom_hook_policy = kwargs.get( + "custom_hook_policy" + ) or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get( + "redirect_policy" + ) or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = ARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/_patch.py index 74e48ecd07cf..17dbc073e01b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/_patch.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/_patch.py @@ -25,7 +25,8 @@ # # -------------------------------------------------------------------------- + # This file is used for handwritten extensions to the generated code. Example: # https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md def patch_sdk(): - pass \ No newline at end of file + pass diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/_vendor.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/_vendor.py index 138f663c53a4..ed3373e9699d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/_vendor.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/_vendor.py @@ -7,13 +7,20 @@ from azure.core.pipeline.transport import HttpRequest + def _convert_request(request, files=None): data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + request = HttpRequest( + method=request.method, + url=request.url, + headers=request.headers, + data=data, + ) if files: request.set_formdata_body(files) return request + def _format_url_section(template, **kwargs): components = template.split("/") while components: @@ -22,6 +29,8 @@ def _format_url_section(template, **kwargs): except KeyError as key: formatted_components = template.split("/") components = [ - c for c in formatted_components if "{}".format(key.args[0]) not in c + c + for c in formatted_components + if "{}".format(key.args[0]) not in c ] template = "/".join(components) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/__init__.py index f67ccda966f1..b90ec7485f14 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/__init__.py @@ -7,9 +7,11 @@ # -------------------------------------------------------------------------- from ._azure_machine_learning_workspaces import AzureMachineLearningWorkspaces -__all__ = ['AzureMachineLearningWorkspaces'] + +__all__ = ["AzureMachineLearningWorkspaces"] # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk + patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/_azure_machine_learning_workspaces.py index 2bc72468b2e6..831d9a931044 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/_azure_machine_learning_workspaces.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/_azure_machine_learning_workspaces.py @@ -15,12 +15,24 @@ from .. import models from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import ComputeOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, QuotasOperations, UsagesOperations, VirtualMachineSizesOperations, WorkspaceConnectionsOperations, WorkspaceFeaturesOperations, WorkspacesOperations +from .operations import ( + ComputeOperations, + Operations, + PrivateEndpointConnectionsOperations, + PrivateLinkResourcesOperations, + QuotasOperations, + UsagesOperations, + VirtualMachineSizesOperations, + WorkspaceConnectionsOperations, + WorkspaceFeaturesOperations, + WorkspacesOperations, +) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential + class AzureMachineLearningWorkspaces: """These APIs allow end users to operate on Azure Machine Learning Workspace resources. @@ -66,29 +78,54 @@ def __init__( base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._config = AzureMachineLearningWorkspacesConfiguration( + credential=credential, subscription_id=subscription_id, **kwargs + ) + self._client = AsyncARMPipelineClient( + base_url=base_url, config=self._config, **kwargs + ) + + client_models = { + k: v for k, v in models.__dict__.items() if isinstance(v, type) + } self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.workspaces = WorkspacesOperations(self._client, self._config, self._serialize, self._deserialize) - self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) - self.virtual_machine_sizes = VirtualMachineSizesOperations(self._client, self._config, self._serialize, self._deserialize) - self.quotas = QuotasOperations(self._client, self._config, self._serialize, self._deserialize) - self.compute = ComputeOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_connections = WorkspaceConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_features = WorkspaceFeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspaces = WorkspacesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.usages = UsagesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.virtual_machine_sizes = VirtualMachineSizesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.quotas = QuotasOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.compute = ComputeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.private_endpoint_connections = ( + PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspace_connections = WorkspaceConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspace_features = WorkspaceFeaturesOperations( + self._client, self._config, self._serialize, self._deserialize + ) def _send_request( - self, - request: HttpRequest, - **kwargs: Any + self, request: HttpRequest, **kwargs: Any ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/_configuration.py index 3f27a007d283..7bb7df7a8f5a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/_configuration.py @@ -10,7 +10,10 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy +from azure.mgmt.core.policies import ( + ARMHttpLoggingPolicy, + AsyncARMChallengeAuthenticationPolicy, +) from .._version import VERSION @@ -37,7 +40,9 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) + super(AzureMachineLearningWorkspacesConfiguration, self).__init__( + **kwargs + ) if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: @@ -46,22 +51,41 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2022-01-01-preview" - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) + self.credential_scopes = kwargs.pop( + "credential_scopes", ["https://management.azure.com/.default"] + ) + kwargs.setdefault( + "sdk_moniker", "mgmt-machinelearningservices/{}".format(VERSION) + ) self._configure(**kwargs) - def _configure( - self, - **kwargs: Any - ) -> None: - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get( + "user_agent_policy" + ) or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get( + "headers_policy" + ) or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy( + **kwargs + ) + self.logging_policy = kwargs.get( + "logging_policy" + ) or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get( + "http_logging_policy" + ) or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get( + "retry_policy" + ) or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get( + "custom_hook_policy" + ) or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get( + "redirect_policy" + ) or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/_patch.py index 74e48ecd07cf..17dbc073e01b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/_patch.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/_patch.py @@ -25,7 +25,8 @@ # # -------------------------------------------------------------------------- + # This file is used for handwritten extensions to the generated code. Example: # https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md def patch_sdk(): - pass \ No newline at end of file + pass diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/__init__.py index 45a1d6fd6e25..bbcbcbf270d6 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/__init__.py @@ -12,20 +12,22 @@ from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations from ._quotas_operations import QuotasOperations from ._compute_operations import ComputeOperations -from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_endpoint_connections_operations import ( + PrivateEndpointConnectionsOperations, +) from ._private_link_resources_operations import PrivateLinkResourcesOperations from ._workspace_connections_operations import WorkspaceConnectionsOperations from ._workspace_features_operations import WorkspaceFeaturesOperations __all__ = [ - 'Operations', - 'WorkspacesOperations', - 'UsagesOperations', - 'VirtualMachineSizesOperations', - 'QuotasOperations', - 'ComputeOperations', - 'PrivateEndpointConnectionsOperations', - 'PrivateLinkResourcesOperations', - 'WorkspaceConnectionsOperations', - 'WorkspaceFeaturesOperations', + "Operations", + "WorkspacesOperations", + "UsagesOperations", + "VirtualMachineSizesOperations", + "QuotasOperations", + "ComputeOperations", + "PrivateEndpointConnectionsOperations", + "PrivateLinkResourcesOperations", + "WorkspaceConnectionsOperations", + "WorkspaceFeaturesOperations", ] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_compute_operations.py index b8cf0a739f62..f981cb647ef7 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_compute_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_compute_operations.py @@ -6,14 +6,33 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, + Union, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -22,9 +41,27 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._compute_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_keys_request, build_list_nodes_request, build_list_request, build_restart_request_initial, build_start_request_initial, build_stop_request_initial, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._compute_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_keys_request, + build_list_nodes_request, + build_list_request, + build_restart_request_initial, + build_start_request_initial, + build_stop_request_initial, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ComputeOperations: """ComputeOperations async operations. @@ -71,26 +108,31 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedComputeResourcesList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedComputeResourcesList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedComputeResourcesList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -104,7 +146,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedComputeResourcesList", pipeline_response) + deserialized = self._deserialize( + "PaginatedComputeResourcesList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -113,21 +157,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes"} # type: ignore @distributed_trace_async async def get( @@ -151,40 +203,52 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComputeResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize("ComputeResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore async def _create_or_update_initial( self, @@ -194,15 +258,21 @@ async def _create_or_update_initial( parameters: "_models.ComputeResource", **kwargs: Any ) -> "_models.ComputeResource": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'ComputeResource') + _json = self._serialize.body(parameters, "ComputeResource") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -211,34 +281,47 @@ async def _create_or_update_initial( compute_name=compute_name, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if response.status_code == 201: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComputeResource', pipeline_response) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -275,14 +358,21 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -290,33 +380,42 @@ async def begin_create_or_update( compute_name=compute_name, parameters=parameters, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore async def _update_initial( self, @@ -326,15 +425,21 @@ async def _update_initial( parameters: "_models.ClusterUpdateParameters", **kwargs: Any ) -> "_models.ComputeResource": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'ClusterUpdateParameters') + _json = self._serialize.body(parameters, "ClusterUpdateParameters") request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -343,27 +448,34 @@ async def _update_initial( compute_name=compute_name, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize("ComputeResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -399,14 +511,21 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -414,78 +533,100 @@ async def begin_update( compute_name=compute_name, parameters=parameters, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore async def _delete_initial( self, resource_group_name: str, workspace_name: str, compute_name: str, - underlying_resource_action: Union[str, "_models.UnderlyingResourceAction"], + underlying_resource_action: Union[ + str, "_models.UnderlyingResourceAction" + ], **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, underlying_resource_action=underlying_resource_action, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace_async async def begin_delete( @@ -493,7 +634,9 @@ async def begin_delete( resource_group_name: str, workspace_name: str, compute_name: str, - underlying_resource_action: Union[str, "_models.UnderlyingResourceAction"], + underlying_resource_action: Union[ + str, "_models.UnderlyingResourceAction" + ], **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes specified Machine Learning compute. @@ -520,43 +663,53 @@ async def begin_delete( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, underlying_resource_action=underlying_resource_action, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace def list_nodes( @@ -581,26 +734,31 @@ def list_nodes( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.AmlComputeNodesInformation] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlComputeNodesInformation"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.AmlComputeNodesInformation"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_nodes_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, - template_url=self.list_nodes.metadata['url'], + template_url=self.list_nodes.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_nodes_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -614,7 +772,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("AmlComputeNodesInformation", pipeline_response) + deserialized = self._deserialize( + "AmlComputeNodesInformation", pipeline_response + ) list_of_elem = deserialized.nodes if cls: list_of_elem = cls(list_of_elem) @@ -623,21 +783,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_nodes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes'} # type: ignore + list_nodes.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes"} # type: ignore @distributed_trace_async async def list_keys( @@ -660,40 +828,52 @@ async def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ComputeSecrets :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeSecrets"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeSecrets"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComputeSecrets', pipeline_response) + deserialized = self._deserialize("ComputeSecrets", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys'} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys"} # type: ignore async def _start_initial( self, @@ -702,35 +882,43 @@ async def _start_initial( compute_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_start_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, - template_url=self._start_initial.metadata['url'], + template_url=self._start_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start'} # type: ignore - + _start_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore @distributed_trace_async async def begin_start( @@ -760,42 +948,52 @@ async def begin_start( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._start_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start'} # type: ignore + begin_start.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore async def _stop_initial( self, @@ -804,35 +1002,43 @@ async def _stop_initial( compute_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_stop_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, - template_url=self._stop_initial.metadata['url'], + template_url=self._stop_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop'} # type: ignore - + _stop_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore @distributed_trace_async async def begin_stop( @@ -862,42 +1068,52 @@ async def begin_stop( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._stop_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop'} # type: ignore + begin_stop.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore async def _restart_initial( self, @@ -906,35 +1122,43 @@ async def _restart_initial( compute_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_restart_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, - template_url=self._restart_initial.metadata['url'], + template_url=self._restart_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _restart_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart'} # type: ignore - + _restart_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore @distributed_trace_async async def begin_restart( @@ -964,39 +1188,49 @@ async def begin_restart( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._restart_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart'} # type: ignore + begin_restart.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_operations.py index f387f91b3780..afea8c5b9bbf 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_operations.py @@ -6,11 +6,25 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -21,8 +35,15 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class Operations: """Operations async operations. @@ -48,8 +69,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list( - self, - **kwargs: Any + self, **kwargs: Any ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Azure Machine Learning Workspaces REST API operations. @@ -59,22 +79,27 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OperationListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( template_url=next_link, ) @@ -84,7 +109,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("OperationListResult", pipeline_response) + deserialized = self._deserialize( + "OperationListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -93,18 +120,26 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/providers/Microsoft.MachineLearningServices/operations'} # type: ignore + list.metadata = {"url": "/providers/Microsoft.MachineLearningServices/operations"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_private_endpoint_connections_operations.py index d1228f865cba..fd4d382a0c7e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_private_endpoint_connections_operations.py @@ -6,11 +6,25 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -20,9 +34,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._private_endpoint_connections_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._private_endpoint_connections_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class PrivateEndpointConnectionsOperations: """PrivateEndpointConnectionsOperations async operations. @@ -48,10 +74,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> AsyncIterable["_models.PrivateEndpointConnectionListResult"]: """List all the private endpoint connections associated with the workspace. @@ -66,25 +89,30 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnectionListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( resource_group_name=resource_group_name, workspace_name=workspace_name, subscription_id=self._config.subscription_id, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( resource_group_name=resource_group_name, workspace_name=workspace_name, @@ -97,7 +125,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) + deserialized = self._deserialize( + "PrivateEndpointConnectionListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -106,21 +136,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections"} # type: ignore @distributed_trace_async async def get( @@ -144,40 +182,54 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, private_endpoint_connection_name=private_endpoint_connection_name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "PrivateEndpointConnection", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -204,15 +256,21 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(properties, 'PrivateEndpointConnection') + _json = self._serialize.body(properties, "PrivateEndpointConnection") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -221,28 +279,39 @@ async def create_or_update( private_endpoint_connection_name=private_endpoint_connection_name, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "PrivateEndpointConnection", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace_async async def delete( @@ -266,33 +335,43 @@ async def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, private_endpoint_connection_name=private_endpoint_connection_name, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_private_link_resources_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_private_link_resources_operations.py index 8a9ffadf2be7..2a33bb21b70b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_private_link_resources_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_private_link_resources_operations.py @@ -9,7 +9,13 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,8 +25,15 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class PrivateLinkResourcesOperations: """PrivateLinkResourcesOperations async operations. @@ -46,10 +59,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace_async async def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.PrivateLinkResourceListResult": """Gets the private link resources that need to be created for a workspace. @@ -62,35 +72,47 @@ async def list( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateLinkResourceListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateLinkResourceListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateLinkResourceListResult', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "PrivateLinkResourceListResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources'} # type: ignore - + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_quotas_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_quotas_operations.py index ce339e75d8b4..fc68a31e874b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_quotas_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_quotas_operations.py @@ -6,11 +6,25 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -20,9 +34,19 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._quotas_operations import build_list_request, build_update_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._quotas_operations import ( + build_list_request, + build_update_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class QuotasOperations: """QuotasOperations async operations. @@ -64,49 +88,64 @@ async def update( :rtype: ~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotasResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'QuotaUpdateParameters') + _json = self._serialize.body(parameters, "QuotaUpdateParameters") request = build_update_request( location=location, subscription_id=self._config.subscription_id, content_type=content_type, json=_json, - template_url=self.update.metadata['url'], + template_url=self.update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('UpdateWorkspaceQuotasResult', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "UpdateWorkspaceQuotasResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas'} # type: ignore - + update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas"} # type: ignore @distributed_trace def list( - self, - location: str, - **kwargs: Any + self, location: str, **kwargs: Any ) -> AsyncIterable["_models.ListWorkspaceQuotas"]: """Gets the currently assigned Workspace Quotas based on VMFamily. @@ -118,24 +157,29 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListWorkspaceQuotas] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceQuotas"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListWorkspaceQuotas"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, @@ -147,7 +191,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ListWorkspaceQuotas", pipeline_response) + deserialized = self._deserialize( + "ListWorkspaceQuotas", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -156,18 +202,26 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_usages_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_usages_operations.py index 88fa452faeb1..83224d65f0a0 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_usages_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_usages_operations.py @@ -6,11 +6,25 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -21,8 +35,15 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._usages_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class UsagesOperations: """UsagesOperations async operations. @@ -48,9 +69,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list( - self, - location: str, - **kwargs: Any + self, location: str, **kwargs: Any ) -> AsyncIterable["_models.ListUsagesResult"]: """Gets the current usage information as well as limits for AML resources for given subscription and location. @@ -63,24 +82,29 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListUsagesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListUsagesResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, @@ -92,7 +116,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ListUsagesResult", pipeline_response) + deserialized = self._deserialize( + "ListUsagesResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -101,17 +127,23 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_virtual_machine_sizes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_virtual_machine_sizes_operations.py index 7fbe221db73a..f2595de0bd63 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_virtual_machine_sizes_operations.py @@ -9,7 +9,13 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,8 +25,15 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._virtual_machine_sizes_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class VirtualMachineSizesOperations: """VirtualMachineSizesOperations async operations. @@ -46,9 +59,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace_async async def list( - self, - location: str, - **kwargs: Any + self, location: str, **kwargs: Any ) -> "_models.VirtualMachineSizeListResult": """Returns supported VM Sizes in a location. @@ -59,34 +70,46 @@ async def list( :rtype: ~azure.mgmt.machinelearningservices.models.VirtualMachineSizeListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_request( location=location, subscription_id=self._config.subscription_id, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualMachineSizeListResult', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "VirtualMachineSizeListResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes'} # type: ignore - + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_workspace_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_workspace_connections_operations.py index eec0ff706432..d3e2e804c141 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_workspace_connections_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_workspace_connections_operations.py @@ -6,11 +6,25 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -20,9 +34,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._workspace_connections_operations import build_create_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._workspace_connections_operations import ( + build_create_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class WorkspaceConnectionsOperations: """WorkspaceConnectionsOperations async operations. @@ -71,15 +97,23 @@ async def create( :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'WorkspaceConnectionPropertiesV2BasicResource') + _json = self._serialize.body( + parameters, "WorkspaceConnectionPropertiesV2BasicResource" + ) request = build_create_request( subscription_id=self._config.subscription_id, @@ -88,28 +122,39 @@ async def create( connection_name=connection_name, content_type=content_type, json=_json, - template_url=self.create.metadata['url'], + template_url=self.create.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}'} # type: ignore - + create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace_async async def get( @@ -132,40 +177,54 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, connection_name=connection_name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace_async async def delete( @@ -188,36 +247,46 @@ async def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, connection_name=connection_name, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace def list( @@ -227,7 +296,9 @@ def list( target: Optional[str] = None, category: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult" + ]: """list. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -245,27 +316,32 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, target=target, category=category, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -280,7 +356,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -289,18 +368,26 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_workspace_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_workspace_features_operations.py index 2e4752bd6642..d356a6defb62 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_workspace_features_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_workspace_features_operations.py @@ -6,11 +6,25 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -21,8 +35,15 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._workspace_features_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class WorkspaceFeaturesOperations: """WorkspaceFeaturesOperations async operations. @@ -48,10 +69,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> AsyncIterable["_models.ListAmlUserFeatureResult"]: """Lists all enabled features for a workspace. @@ -66,25 +84,30 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListAmlUserFeatureResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAmlUserFeatureResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListAmlUserFeatureResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -97,7 +120,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ListAmlUserFeatureResult", pipeline_response) + deserialized = self._deserialize( + "ListAmlUserFeatureResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -106,18 +131,26 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_workspaces_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_workspaces_operations.py index f7ef8bea2374..4030c5a2130c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_workspaces_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/aio/operations/_workspaces_operations.py @@ -6,14 +6,33 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, + Union, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -22,9 +41,31 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._workspaces_operations import build_create_or_update_request_initial, build_delete_request_initial, build_diagnose_request_initial, build_get_request, build_list_by_resource_group_request, build_list_by_subscription_request, build_list_keys_request, build_list_notebook_access_token_request, build_list_notebook_keys_request, build_list_outbound_network_dependencies_endpoints_request, build_list_storage_account_keys_request, build_prepare_notebook_request_initial, build_resync_keys_request_initial, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._workspaces_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_diagnose_request_initial, + build_get_request, + build_list_by_resource_group_request, + build_list_by_subscription_request, + build_list_keys_request, + build_list_notebook_access_token_request, + build_list_notebook_keys_request, + build_list_outbound_network_dependencies_endpoints_request, + build_list_storage_account_keys_request, + build_prepare_notebook_request_initial, + build_resync_keys_request_initial, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class WorkspacesOperations: """WorkspacesOperations async operations. @@ -50,10 +91,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace_async async def get( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.Workspace": """Gets the properties of the specified machine learning workspace. @@ -66,39 +104,49 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.Workspace :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore async def _create_or_update_initial( self, @@ -107,15 +155,21 @@ async def _create_or_update_initial( parameters: "_models.Workspace", **kwargs: Any ) -> Optional["_models.Workspace"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.Workspace"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'Workspace') + _json = self._serialize.body(parameters, "Workspace") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -123,29 +177,36 @@ async def _create_or_update_initial( workspace_name=workspace_name, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -177,89 +238,103 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Workspace] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, parameters=parameters, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore async def _delete_initial( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace_async async def begin_delete( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes a machine learning workspace. @@ -279,41 +354,51 @@ async def begin_delete( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore async def _update_initial( self, @@ -322,15 +407,21 @@ async def _update_initial( parameters: "_models.WorkspaceUpdateParameters", **kwargs: Any ) -> Optional["_models.Workspace"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.Workspace"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'WorkspaceUpdateParameters') + _json = self._serialize.body(parameters, "WorkspaceUpdateParameters") request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -338,29 +429,36 @@ async def _update_initial( workspace_name=workspace_name, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -392,47 +490,59 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Workspace] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, parameters=parameters, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace def list_by_resource_group( @@ -453,25 +563,30 @@ def list_by_resource_group( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_by_resource_group_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, skip=skip, - template_url=self.list_by_resource_group.metadata['url'], + template_url=self.list_by_resource_group.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_by_resource_group_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -484,7 +599,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -493,21 +610,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces'} # type: ignore + list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore async def _diagnose_initial( self, @@ -516,16 +641,24 @@ async def _diagnose_initial( parameters: Optional["_models.DiagnoseWorkspaceParameters"] = None, **kwargs: Any ) -> Optional["_models.DiagnoseResponseResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if parameters is not None: - _json = self._serialize.body(parameters, 'DiagnoseWorkspaceParameters') + _json = self._serialize.body( + parameters, "DiagnoseWorkspaceParameters" + ) else: _json = None @@ -535,35 +668,47 @@ async def _diagnose_initial( workspace_name=workspace_name, content_type=content_type, json=_json, - template_url=self._diagnose_initial.metadata['url'], + template_url=self._diagnose_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) + deserialized = self._deserialize( + "DiagnoseResponseResult", pipeline_response + ) if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _diagnose_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose'} # type: ignore - + _diagnose_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore @distributed_trace_async async def begin_diagnose( @@ -597,54 +742,71 @@ async def begin_diagnose( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.DiagnoseResponseResult] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnoseResponseResult"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DiagnoseResponseResult"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._diagnose_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, parameters=parameters, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) + deserialized = self._deserialize( + "DiagnoseResponseResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_diagnose.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose'} # type: ignore + begin_diagnose.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore @distributed_trace_async async def list_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.ListWorkspaceKeysResult": """Lists all the keys associated with this workspace. This includes keys for the storage account, app insights and password for container registry. @@ -658,81 +820,97 @@ async def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListWorkspaceKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceKeysResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListWorkspaceKeysResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ListWorkspaceKeysResult', pipeline_response) + deserialized = self._deserialize( + "ListWorkspaceKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys'} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys"} # type: ignore async def _resync_keys_initial( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_resync_keys_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self._resync_keys_initial.metadata['url'], + template_url=self._resync_keys_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _resync_keys_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys'} # type: ignore - + _resync_keys_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore @distributed_trace_async async def begin_resync_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: """Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and password for container registry. @@ -753,47 +931,55 @@ async def begin_resync_keys( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._resync_keys_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_resync_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys'} # type: ignore + begin_resync_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore @distributed_trace def list_by_subscription( - self, - skip: Optional[str] = None, - **kwargs: Any + self, skip: Optional[str] = None, **kwargs: Any ) -> AsyncIterable["_models.WorkspaceListResult"]: """Lists all the available machine learning workspaces under the specified subscription. @@ -805,24 +991,29 @@ def list_by_subscription( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, skip=skip, - template_url=self.list_by_subscription.metadata['url'], + template_url=self.list_by_subscription.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, skip=skip, @@ -834,7 +1025,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -843,28 +1036,33 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces'} # type: ignore + list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore @distributed_trace_async async def list_notebook_access_token( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.NotebookAccessTokenResult": """return notebook access token and refresh token. @@ -877,87 +1075,107 @@ async def list_notebook_access_token( :rtype: ~azure.mgmt.machinelearningservices.models.NotebookAccessTokenResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookAccessTokenResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.NotebookAccessTokenResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_notebook_access_token_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.list_notebook_access_token.metadata['url'], + template_url=self.list_notebook_access_token.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('NotebookAccessTokenResult', pipeline_response) + deserialized = self._deserialize( + "NotebookAccessTokenResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_notebook_access_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken'} # type: ignore - + list_notebook_access_token.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken"} # type: ignore async def _prepare_notebook_initial( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> Optional["_models.NotebookResourceInfo"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NotebookResourceInfo"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.NotebookResourceInfo"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_prepare_notebook_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self._prepare_notebook_initial.metadata['url'], + template_url=self._prepare_notebook_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) + deserialized = self._deserialize( + "NotebookResourceInfo", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _prepare_notebook_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook'} # type: ignore - + _prepare_notebook_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore @distributed_trace_async async def begin_prepare_notebook( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> AsyncLROPoller["_models.NotebookResourceInfo"]: """Prepare a notebook. @@ -979,51 +1197,66 @@ async def begin_prepare_notebook( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.NotebookResourceInfo] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookResourceInfo"] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.NotebookResourceInfo"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._prepare_notebook_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) + deserialized = self._deserialize( + "NotebookResourceInfo", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_prepare_notebook.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook'} # type: ignore + begin_prepare_notebook.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore @distributed_trace_async async def list_storage_account_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.ListStorageAccountKeysResult": """List storage account keys of a workspace. @@ -1036,46 +1269,57 @@ async def list_storage_account_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListStorageAccountKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListStorageAccountKeysResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListStorageAccountKeysResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_storage_account_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.list_storage_account_keys.metadata['url'], + template_url=self.list_storage_account_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ListStorageAccountKeysResult', pipeline_response) + deserialized = self._deserialize( + "ListStorageAccountKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_storage_account_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys'} # type: ignore - + list_storage_account_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys"} # type: ignore @distributed_trace_async async def list_notebook_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.ListNotebookKeysResult": """List keys of a notebook. @@ -1088,46 +1332,57 @@ async def list_notebook_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListNotebookKeysResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListNotebookKeysResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_notebook_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.list_notebook_keys.metadata['url'], + template_url=self.list_notebook_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ListNotebookKeysResult', pipeline_response) + deserialized = self._deserialize( + "ListNotebookKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_notebook_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys'} # type: ignore - + list_notebook_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys"} # type: ignore @distributed_trace_async async def list_outbound_network_dependencies_endpoints( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.ExternalFQDNResponse": """Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) programmatically. @@ -1144,36 +1399,52 @@ async def list_outbound_network_dependencies_endpoints( :rtype: ~azure.mgmt.machinelearningservices.models.ExternalFQDNResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExternalFQDNResponse"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ExternalFQDNResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_outbound_network_dependencies_endpoints_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], + template_url=self.list_outbound_network_dependencies_endpoints.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ExternalFQDNResponse', pipeline_response) + deserialized = self._deserialize( + "ExternalFQDNResponse", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_outbound_network_dependencies_endpoints.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints'} # type: ignore - + list_outbound_network_dependencies_endpoints.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/models/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/models/__init__.py index 2af3a2f5b95a..edf4abf0c96e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/models/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/models/__init__.py @@ -77,7 +77,9 @@ from ._models_py3 import ListWorkspaceKeysResult from ._models_py3 import ListWorkspaceQuotas from ._models_py3 import ManagedIdentity - from ._models_py3 import ManagedIdentityAuthTypeWorkspaceConnectionProperties + from ._models_py3 import ( + ManagedIdentityAuthTypeWorkspaceConnectionProperties, + ) from ._models_py3 import NodeStateCounts from ._models_py3 import NoneAuthTypeWorkspaceConnectionProperties from ._models_py3 import NotebookAccessTokenResult @@ -114,7 +116,9 @@ from ._models_py3 import ScriptsToExecute from ._models_py3 import ServiceManagedResourcesSettings from ._models_py3 import ServicePrincipal - from ._models_py3 import ServicePrincipalAuthTypeWorkspaceConnectionProperties + from ._models_py3 import ( + ServicePrincipalAuthTypeWorkspaceConnectionProperties, + ) from ._models_py3 import ServicePrincipalCredentials from ._models_py3 import SetupScripts from ._models_py3 import SharedAccessSignature @@ -132,7 +136,9 @@ from ._models_py3 import UserAccountCredentials from ._models_py3 import UserAssignedIdentity from ._models_py3 import UsernamePassword - from ._models_py3 import UsernamePasswordAuthTypeWorkspaceConnectionProperties + from ._models_py3 import ( + UsernamePasswordAuthTypeWorkspaceConnectionProperties, + ) from ._models_py3 import VirtualMachine from ._models_py3 import VirtualMachineImage from ._models_py3 import VirtualMachineProperties @@ -143,7 +149,9 @@ from ._models_py3 import Workspace from ._models_py3 import WorkspaceConnectionPropertiesV2 from ._models_py3 import WorkspaceConnectionPropertiesV2BasicResource - from ._models_py3 import WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult + from ._models_py3 import ( + WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, + ) from ._models_py3 import WorkspaceListResult from ._models_py3 import WorkspaceUpdateParameters except (SyntaxError, ImportError): @@ -334,186 +342,186 @@ ) __all__ = [ - 'AKS', - 'AKSProperties', - 'AksComputeSecrets', - 'AksComputeSecretsProperties', - 'AksNetworkingConfiguration', - 'AmlCompute', - 'AmlComputeNodeInformation', - 'AmlComputeNodesInformation', - 'AmlComputeProperties', - 'AmlUserFeature', - 'AssignedUser', - 'AutoPauseProperties', - 'AutoScaleProperties', - 'ClusterUpdateParameters', - 'Components1D3SwueSchemasComputeresourceAllof1', - 'Compute', - 'ComputeInstance', - 'ComputeInstanceApplication', - 'ComputeInstanceConnectivityEndpoints', - 'ComputeInstanceCreatedBy', - 'ComputeInstanceLastOperation', - 'ComputeInstanceProperties', - 'ComputeInstanceSshSettings', - 'ComputeResource', - 'ComputeSchedules', - 'ComputeSecrets', - 'ComputeStartStopSchedule', - 'ContainerResourceRequirements', - 'CosmosDbSettings', - 'Cron', - 'DataFactory', - 'DataLakeAnalytics', - 'DataLakeAnalyticsProperties', - 'Databricks', - 'DatabricksComputeSecrets', - 'DatabricksComputeSecretsProperties', - 'DatabricksProperties', - 'DiagnoseRequestProperties', - 'DiagnoseResponseResult', - 'DiagnoseResponseResultValue', - 'DiagnoseResult', - 'DiagnoseWorkspaceParameters', - 'EncryptionProperty', - 'ErrorAdditionalInfo', - 'ErrorDetail', - 'ErrorResponse', - 'EstimatedVMPrice', - 'EstimatedVMPrices', - 'ExternalFQDNResponse', - 'FQDNEndpoint', - 'FQDNEndpointDetail', - 'FQDNEndpoints', - 'FQDNEndpointsProperties', - 'HDInsight', - 'HDInsightProperties', - 'Identity', - 'IdentityForCmk', - 'InstanceTypeSchema', - 'InstanceTypeSchemaResources', - 'KeyVaultProperties', - 'Kubernetes', - 'KubernetesProperties', - 'KubernetesSchema', - 'ListAmlUserFeatureResult', - 'ListNotebookKeysResult', - 'ListStorageAccountKeysResult', - 'ListUsagesResult', - 'ListWorkspaceKeysResult', - 'ListWorkspaceQuotas', - 'ManagedIdentity', - 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', - 'NodeStateCounts', - 'NoneAuthTypeWorkspaceConnectionProperties', - 'NotebookAccessTokenResult', - 'NotebookPreparationError', - 'NotebookResourceInfo', - 'Operation', - 'OperationDisplay', - 'OperationListResult', - 'PATAuthTypeWorkspaceConnectionProperties', - 'PaginatedComputeResourcesList', - 'Password', - 'PersonalAccessToken', - 'PersonalComputeInstanceSettings', - 'PrivateEndpoint', - 'PrivateEndpointConnection', - 'PrivateEndpointConnectionListResult', - 'PrivateLinkResource', - 'PrivateLinkResourceListResult', - 'PrivateLinkServiceConnectionState', - 'QuotaBaseProperties', - 'QuotaUpdateParameters', - 'Recurrence', - 'RecurrenceSchedule', - 'RegistryListCredentialsResult', - 'Resource', - 'ResourceAutoGenerated', - 'ResourceId', - 'ResourceName', - 'ResourceQuota', - 'SASAuthTypeWorkspaceConnectionProperties', - 'ScaleSettings', - 'ScaleSettingsInformation', - 'ScriptReference', - 'ScriptsToExecute', - 'ServiceManagedResourcesSettings', - 'ServicePrincipal', - 'ServicePrincipalAuthTypeWorkspaceConnectionProperties', - 'ServicePrincipalCredentials', - 'SetupScripts', - 'SharedAccessSignature', - 'SharedPrivateLinkResource', - 'Sku', - 'SslConfiguration', - 'SynapseSpark', - 'SynapseSparkProperties', - 'SystemData', - 'SystemService', - 'UpdateWorkspaceQuotas', - 'UpdateWorkspaceQuotasResult', - 'Usage', - 'UsageName', - 'UserAccountCredentials', - 'UserAssignedIdentity', - 'UsernamePassword', - 'UsernamePasswordAuthTypeWorkspaceConnectionProperties', - 'VirtualMachine', - 'VirtualMachineImage', - 'VirtualMachineProperties', - 'VirtualMachineSecrets', - 'VirtualMachineSize', - 'VirtualMachineSizeListResult', - 'VirtualMachineSshCredentials', - 'Workspace', - 'WorkspaceConnectionPropertiesV2', - 'WorkspaceConnectionPropertiesV2BasicResource', - 'WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult', - 'WorkspaceListResult', - 'WorkspaceUpdateParameters', - 'AllocationState', - 'AllowRecoverSoftDeletedWorkspace', - 'ApplicationSharingPolicy', - 'BillingCurrency', - 'ClusterPurpose', - 'ComputeInstanceAuthorizationType', - 'ComputeInstanceState', - 'ComputePowerAction', - 'ComputeType', - 'ConnectionAuthType', - 'ConnectionCategory', - 'CreatedByType', - 'DaysOfWeek', - 'DiagnoseResultLevel', - 'EncryptionStatus', - 'LoadBalancerType', - 'NodeState', - 'OperationName', - 'OperationStatus', - 'OsType', - 'PrivateEndpointConnectionProvisioningState', - 'PrivateEndpointServiceConnectionStatus', - 'ProvisioningState', - 'ProvisioningStatus', - 'PublicNetworkAccess', - 'QuotaUnit', - 'RecurrenceFrequency', - 'RemoteLoginPortPublicAccess', - 'ResourceIdentityType', - 'ScheduleStatus', - 'ScheduleType', - 'SoftDeleteEnabled', - 'SshPublicAccess', - 'SslConfigurationStatus', - 'Status', - 'TriggerType', - 'UnderlyingResourceAction', - 'UnitOfMeasure', - 'UsageUnit', - 'VMPriceOSType', - 'VMTier', - 'ValueFormat', - 'VmPriority', + "AKS", + "AKSProperties", + "AksComputeSecrets", + "AksComputeSecretsProperties", + "AksNetworkingConfiguration", + "AmlCompute", + "AmlComputeNodeInformation", + "AmlComputeNodesInformation", + "AmlComputeProperties", + "AmlUserFeature", + "AssignedUser", + "AutoPauseProperties", + "AutoScaleProperties", + "ClusterUpdateParameters", + "Components1D3SwueSchemasComputeresourceAllof1", + "Compute", + "ComputeInstance", + "ComputeInstanceApplication", + "ComputeInstanceConnectivityEndpoints", + "ComputeInstanceCreatedBy", + "ComputeInstanceLastOperation", + "ComputeInstanceProperties", + "ComputeInstanceSshSettings", + "ComputeResource", + "ComputeSchedules", + "ComputeSecrets", + "ComputeStartStopSchedule", + "ContainerResourceRequirements", + "CosmosDbSettings", + "Cron", + "DataFactory", + "DataLakeAnalytics", + "DataLakeAnalyticsProperties", + "Databricks", + "DatabricksComputeSecrets", + "DatabricksComputeSecretsProperties", + "DatabricksProperties", + "DiagnoseRequestProperties", + "DiagnoseResponseResult", + "DiagnoseResponseResultValue", + "DiagnoseResult", + "DiagnoseWorkspaceParameters", + "EncryptionProperty", + "ErrorAdditionalInfo", + "ErrorDetail", + "ErrorResponse", + "EstimatedVMPrice", + "EstimatedVMPrices", + "ExternalFQDNResponse", + "FQDNEndpoint", + "FQDNEndpointDetail", + "FQDNEndpoints", + "FQDNEndpointsProperties", + "HDInsight", + "HDInsightProperties", + "Identity", + "IdentityForCmk", + "InstanceTypeSchema", + "InstanceTypeSchemaResources", + "KeyVaultProperties", + "Kubernetes", + "KubernetesProperties", + "KubernetesSchema", + "ListAmlUserFeatureResult", + "ListNotebookKeysResult", + "ListStorageAccountKeysResult", + "ListUsagesResult", + "ListWorkspaceKeysResult", + "ListWorkspaceQuotas", + "ManagedIdentity", + "ManagedIdentityAuthTypeWorkspaceConnectionProperties", + "NodeStateCounts", + "NoneAuthTypeWorkspaceConnectionProperties", + "NotebookAccessTokenResult", + "NotebookPreparationError", + "NotebookResourceInfo", + "Operation", + "OperationDisplay", + "OperationListResult", + "PATAuthTypeWorkspaceConnectionProperties", + "PaginatedComputeResourcesList", + "Password", + "PersonalAccessToken", + "PersonalComputeInstanceSettings", + "PrivateEndpoint", + "PrivateEndpointConnection", + "PrivateEndpointConnectionListResult", + "PrivateLinkResource", + "PrivateLinkResourceListResult", + "PrivateLinkServiceConnectionState", + "QuotaBaseProperties", + "QuotaUpdateParameters", + "Recurrence", + "RecurrenceSchedule", + "RegistryListCredentialsResult", + "Resource", + "ResourceAutoGenerated", + "ResourceId", + "ResourceName", + "ResourceQuota", + "SASAuthTypeWorkspaceConnectionProperties", + "ScaleSettings", + "ScaleSettingsInformation", + "ScriptReference", + "ScriptsToExecute", + "ServiceManagedResourcesSettings", + "ServicePrincipal", + "ServicePrincipalAuthTypeWorkspaceConnectionProperties", + "ServicePrincipalCredentials", + "SetupScripts", + "SharedAccessSignature", + "SharedPrivateLinkResource", + "Sku", + "SslConfiguration", + "SynapseSpark", + "SynapseSparkProperties", + "SystemData", + "SystemService", + "UpdateWorkspaceQuotas", + "UpdateWorkspaceQuotasResult", + "Usage", + "UsageName", + "UserAccountCredentials", + "UserAssignedIdentity", + "UsernamePassword", + "UsernamePasswordAuthTypeWorkspaceConnectionProperties", + "VirtualMachine", + "VirtualMachineImage", + "VirtualMachineProperties", + "VirtualMachineSecrets", + "VirtualMachineSize", + "VirtualMachineSizeListResult", + "VirtualMachineSshCredentials", + "Workspace", + "WorkspaceConnectionPropertiesV2", + "WorkspaceConnectionPropertiesV2BasicResource", + "WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", + "WorkspaceListResult", + "WorkspaceUpdateParameters", + "AllocationState", + "AllowRecoverSoftDeletedWorkspace", + "ApplicationSharingPolicy", + "BillingCurrency", + "ClusterPurpose", + "ComputeInstanceAuthorizationType", + "ComputeInstanceState", + "ComputePowerAction", + "ComputeType", + "ConnectionAuthType", + "ConnectionCategory", + "CreatedByType", + "DaysOfWeek", + "DiagnoseResultLevel", + "EncryptionStatus", + "LoadBalancerType", + "NodeState", + "OperationName", + "OperationStatus", + "OsType", + "PrivateEndpointConnectionProvisioningState", + "PrivateEndpointServiceConnectionStatus", + "ProvisioningState", + "ProvisioningStatus", + "PublicNetworkAccess", + "QuotaUnit", + "RecurrenceFrequency", + "RemoteLoginPortPublicAccess", + "ResourceIdentityType", + "ScheduleStatus", + "ScheduleType", + "SoftDeleteEnabled", + "SshPublicAccess", + "SslConfigurationStatus", + "Status", + "TriggerType", + "UnderlyingResourceAction", + "UnitOfMeasure", + "UsageUnit", + "VMPriceOSType", + "VMTier", + "ValueFormat", + "VmPriority", ] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/models/_azure_machine_learning_workspaces_enums.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/models/_azure_machine_learning_workspaces_enums.py index 705bf39fb5b7..78327f77ecd5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/models/_azure_machine_learning_workspaces_enums.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/models/_azure_machine_learning_workspaces_enums.py @@ -21,13 +21,16 @@ class AllocationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): STEADY = "Steady" RESIZING = "Resizing" -class AllowRecoverSoftDeletedWorkspace(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Allow a soft deleted workspace to be recovered - """ + +class AllowRecoverSoftDeletedWorkspace( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """Allow a soft deleted workspace to be recovered""" TRUE = "True" FALSE = "False" + class ApplicationSharingPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Policy for sharing applications on this compute instance among users of parent workspace. If Personal, only the creator can access applications on this compute instance. When Shared, any @@ -37,29 +40,31 @@ class ApplicationSharingPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): PERSONAL = "Personal" SHARED = "Shared" + class BillingCurrency(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Three lettered code specifying the currency of the VM price. Example: USD - """ + """Three lettered code specifying the currency of the VM price. Example: USD""" USD = "USD" + class ClusterPurpose(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Intended usage of the cluster - """ + """Intended usage of the cluster""" FAST_PROD = "FastProd" DENSE_PROD = "DenseProd" DEV_TEST = "DevTest" -class ComputeInstanceAuthorizationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The Compute Instance Authorization type. Available values are personal (default). - """ + +class ComputeInstanceAuthorizationType( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """The Compute Instance Authorization type. Available values are personal (default).""" PERSONAL = "personal" + class ComputeInstanceState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Current state of an ComputeInstance. - """ + """Current state of an ComputeInstance.""" CREATING = "Creating" CREATE_FAILED = "CreateFailed" @@ -77,16 +82,16 @@ class ComputeInstanceState(str, Enum, metaclass=CaseInsensitiveEnumMeta): UNKNOWN = "Unknown" UNUSABLE = "Unusable" + class ComputePowerAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The compute power action. - """ + """The compute power action.""" START = "Start" STOP = "Stop" + class ComputeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of compute - """ + """The type of compute""" AKS = "AKS" KUBERNETES = "Kubernetes" @@ -99,9 +104,9 @@ class ComputeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): DATA_LAKE_ANALYTICS = "DataLakeAnalytics" SYNAPSE_SPARK = "SynapseSpark" + class ConnectionAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Authentication type of the connection target - """ + """Authentication type of the connection target""" PAT = "PAT" MANAGED_IDENTITY = "ManagedIdentity" @@ -110,24 +115,25 @@ class ConnectionAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): SAS = "SAS" SERVICE_PRINCIPAL = "ServicePrincipal" + class ConnectionCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Category of the connection - """ + """Category of the connection""" PYTHON_FEED = "PythonFeed" CONTAINER_REGISTRY = "ContainerRegistry" GIT = "Git" FEATURE_STORE = "FeatureStore" + class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of identity that created the resource. - """ + """The type of identity that created the resource.""" USER = "User" APPLICATION = "Application" MANAGED_IDENTITY = "ManagedIdentity" KEY = "Key" + class DaysOfWeek(str, Enum, metaclass=CaseInsensitiveEnumMeta): SUNDAY = "Sunday" @@ -138,28 +144,29 @@ class DaysOfWeek(str, Enum, metaclass=CaseInsensitiveEnumMeta): FRIDAY = "Friday" SATURDAY = "Saturday" + class DiagnoseResultLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Level of workspace setup error - """ + """Level of workspace setup error""" WARNING = "Warning" ERROR = "Error" INFORMATION = "Information" + class EncryptionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates whether or not the encryption is enabled for the workspace. - """ + """Indicates whether or not the encryption is enabled for the workspace.""" ENABLED = "Enabled" DISABLED = "Disabled" + class LoadBalancerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Load Balancer Type - """ + """Load Balancer Type""" PUBLIC_IP = "PublicIp" INTERNAL_LOAD_BALANCER = "InternalLoadBalancer" + class NodeState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """State of the compute node. Values are idle, running, preparing, unusable, leaving and preempted. @@ -172,9 +179,9 @@ class NodeState(str, Enum, metaclass=CaseInsensitiveEnumMeta): LEAVING = "leaving" PREEMPTED = "preempted" + class OperationName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Name of the last operation. - """ + """Name of the last operation.""" CREATE = "Create" START = "Start" @@ -183,9 +190,9 @@ class OperationName(str, Enum, metaclass=CaseInsensitiveEnumMeta): REIMAGE = "Reimage" DELETE = "Delete" + class OperationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Operation status. - """ + """Operation status.""" IN_PROGRESS = "InProgress" SUCCEEDED = "Succeeded" @@ -196,25 +203,29 @@ class OperationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): REIMAGE_FAILED = "ReimageFailed" DELETE_FAILED = "DeleteFailed" + class OsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Compute OS Type - """ + """Compute OS Type""" LINUX = "Linux" WINDOWS = "Windows" -class PrivateEndpointConnectionProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The current provisioning state. - """ + +class PrivateEndpointConnectionProvisioningState( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """The current provisioning state.""" SUCCEEDED = "Succeeded" CREATING = "Creating" DELETING = "Deleting" FAILED = "Failed" -class PrivateEndpointServiceConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The private endpoint connection status. - """ + +class PrivateEndpointServiceConnectionStatus( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """The private endpoint connection status.""" PENDING = "Pending" APPROVED = "Approved" @@ -222,6 +233,7 @@ class PrivateEndpointServiceConnectionStatus(str, Enum, metaclass=CaseInsensitiv DISCONNECTED = "Disconnected" TIMEOUT = "Timeout" + class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The current deployment state of workspace resource. The provisioningState is to indicate states for resource provisioning. @@ -235,30 +247,30 @@ class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): FAILED = "Failed" CANCELED = "Canceled" + class ProvisioningStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The current deployment state of schedule. - """ + """The current deployment state of schedule.""" COMPLETED = "Completed" PROVISIONING = "Provisioning" FAILED = "Failed" + class PublicNetworkAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Whether requests from Public Network are allowed. - """ + """Whether requests from Public Network are allowed.""" ENABLED = "Enabled" DISABLED = "Disabled" + class QuotaUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """An enum describing the unit of quota measurement. - """ + """An enum describing the unit of quota measurement.""" COUNT = "Count" + class RecurrenceFrequency(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The recurrence frequency. - """ + """The recurrence frequency.""" NOT_SPECIFIED = "NotSpecified" SECOND = "Second" @@ -269,7 +281,10 @@ class RecurrenceFrequency(str, Enum, metaclass=CaseInsensitiveEnumMeta): MONTH = "Month" YEAR = "Year" -class RemoteLoginPortPublicAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): + +class RemoteLoginPortPublicAccess( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): """State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - Indicates that the public ssh port is closed @@ -282,35 +297,36 @@ class RemoteLoginPortPublicAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): DISABLED = "Disabled" NOT_SPECIFIED = "NotSpecified" + class ResourceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The identity type. - """ + """The identity type.""" SYSTEM_ASSIGNED = "SystemAssigned" SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" USER_ASSIGNED = "UserAssigned" NONE = "None" + class ScheduleStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The schedule status. - """ + """The schedule status.""" ENABLED = "Enabled" DISABLED = "Disabled" + class ScheduleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The schedule type. - """ + """The schedule type.""" COMPUTE_START_STOP = "ComputeStartStop" + class SoftDeleteEnabled(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """create a workspace with soft delete capability - """ + """create a workspace with soft delete capability""" TRUE = "True" FALSE = "False" + class SshPublicAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): """State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the public ssh port is open and @@ -320,74 +336,77 @@ class SshPublicAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): ENABLED = "Enabled" DISABLED = "Disabled" + class SslConfigurationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enable or disable ssl for scoring - """ + """Enable or disable ssl for scoring""" DISABLED = "Disabled" ENABLED = "Enabled" AUTO = "Auto" + class Status(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Status of update workspace quota. - """ + """Status of update workspace quota.""" UNDEFINED = "Undefined" SUCCESS = "Success" FAILURE = "Failure" INVALID_QUOTA_BELOW_CLUSTER_MINIMUM = "InvalidQuotaBelowClusterMinimum" - INVALID_QUOTA_EXCEEDS_SUBSCRIPTION_LIMIT = "InvalidQuotaExceedsSubscriptionLimit" + INVALID_QUOTA_EXCEEDS_SUBSCRIPTION_LIMIT = ( + "InvalidQuotaExceedsSubscriptionLimit" + ) INVALID_VM_FAMILY_NAME = "InvalidVMFamilyName" OPERATION_NOT_SUPPORTED_FOR_SKU = "OperationNotSupportedForSku" OPERATION_NOT_ENABLED_FOR_REGION = "OperationNotEnabledForRegion" + class TriggerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The schedule trigger type. - """ + """The schedule trigger type.""" RECURRENCE = "Recurrence" CRON = "Cron" + class UnderlyingResourceAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): DELETE = "Delete" DETACH = "Detach" + class UnitOfMeasure(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The unit of time measurement for the specified VM price. Example: OneHour - """ + """The unit of time measurement for the specified VM price. Example: OneHour""" ONE_HOUR = "OneHour" + class UsageUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """An enum describing the unit of usage measurement. - """ + """An enum describing the unit of usage measurement.""" COUNT = "Count" + class ValueFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """format for the workspace connection value - """ + """format for the workspace connection value""" JSON = "JSON" + class VMPriceOSType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Operating system type used by the VM. - """ + """Operating system type used by the VM.""" LINUX = "Linux" WINDOWS = "Windows" + class VmPriority(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Virtual Machine priority - """ + """Virtual Machine priority""" DEDICATED = "Dedicated" LOW_PRIORITY = "LowPriority" + class VMTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of the VM. - """ + """The type of the VM.""" STANDARD = "Standard" LOW_PRIORITY = "LowPriority" diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/models/_models.py index 0f108d8eacd8..bf2703224338 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/models/_models.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/models/_models.py @@ -50,35 +50,46 @@ class Compute(msrest.serialization.Model): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + } + + _attribute_map = { + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } _subtype_map = { - 'compute_type': {'AKS': 'AKS', 'AmlCompute': 'AmlCompute', 'ComputeInstance': 'ComputeInstance', 'DataFactory': 'DataFactory', 'DataLakeAnalytics': 'DataLakeAnalytics', 'Databricks': 'Databricks', 'HDInsight': 'HDInsight', 'Kubernetes': 'Kubernetes', 'SynapseSpark': 'SynapseSpark', 'VirtualMachine': 'VirtualMachine'} - } - - def __init__( - self, - **kwargs - ): + "compute_type": { + "AKS": "AKS", + "AmlCompute": "AmlCompute", + "ComputeInstance": "ComputeInstance", + "DataFactory": "DataFactory", + "DataLakeAnalytics": "DataLakeAnalytics", + "Databricks": "Databricks", + "HDInsight": "HDInsight", + "Kubernetes": "Kubernetes", + "SynapseSpark": "SynapseSpark", + "VirtualMachine": "VirtualMachine", + } + } + + def __init__(self, **kwargs): """ :keyword compute_location: Location for the underlying compute. :paramtype compute_location: str @@ -92,15 +103,15 @@ def __init__( """ super(Compute, self).__init__(**kwargs) self.compute_type = None # type: Optional[str] - self.compute_location = kwargs.get('compute_location', None) + self.compute_location = kwargs.get("compute_location", None) self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) + self.disable_local_auth = kwargs.get("disable_local_auth", None) class AKS(Compute): @@ -142,32 +153,32 @@ class AKS(Compute): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'AKSProperties'}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, + "properties": {"key": "properties", "type": "AKSProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword compute_location: Location for the underlying compute. :paramtype compute_location: str @@ -182,8 +193,8 @@ def __init__( :paramtype properties: ~azure.mgmt.machinelearningservices.models.AKSProperties """ super(AKS, self).__init__(**kwargs) - self.compute_type = 'AKS' # type: str - self.properties = kwargs.get('properties', None) + self.compute_type = "AKS" # type: str + self.properties = kwargs.get("properties", None) class AksComputeSecretsProperties(msrest.serialization.Model): @@ -200,15 +211,15 @@ class AksComputeSecretsProperties(msrest.serialization.Model): """ _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, + "user_kube_config": {"key": "userKubeConfig", "type": "str"}, + "admin_kube_config": {"key": "adminKubeConfig", "type": "str"}, + "image_pull_secret_name": { + "key": "imagePullSecretName", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword user_kube_config: Content of kubeconfig file that can be used to connect to the Kubernetes cluster. @@ -220,9 +231,11 @@ def __init__( :paramtype image_pull_secret_name: str """ super(AksComputeSecretsProperties, self).__init__(**kwargs) - self.user_kube_config = kwargs.get('user_kube_config', None) - self.admin_kube_config = kwargs.get('admin_kube_config', None) - self.image_pull_secret_name = kwargs.get('image_pull_secret_name', None) + self.user_kube_config = kwargs.get("user_kube_config", None) + self.admin_kube_config = kwargs.get("admin_kube_config", None) + self.image_pull_secret_name = kwargs.get( + "image_pull_secret_name", None + ) class ComputeSecrets(msrest.serialization.Model): @@ -240,23 +253,23 @@ class ComputeSecrets(msrest.serialization.Model): """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "compute_type": {"key": "computeType", "type": "str"}, } _subtype_map = { - 'compute_type': {'AKS': 'AksComputeSecrets', 'Databricks': 'DatabricksComputeSecrets', 'VirtualMachine': 'VirtualMachineSecrets'} + "compute_type": { + "AKS": "AksComputeSecrets", + "Databricks": "DatabricksComputeSecrets", + "VirtualMachine": "VirtualMachineSecrets", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ComputeSecrets, self).__init__(**kwargs) self.compute_type = None # type: Optional[str] @@ -281,20 +294,20 @@ class AksComputeSecrets(ComputeSecrets, AksComputeSecretsProperties): """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "user_kube_config": {"key": "userKubeConfig", "type": "str"}, + "admin_kube_config": {"key": "adminKubeConfig", "type": "str"}, + "image_pull_secret_name": { + "key": "imagePullSecretName", + "type": "str", + }, + "compute_type": {"key": "computeType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword user_kube_config: Content of kubeconfig file that can be used to connect to the Kubernetes cluster. @@ -306,11 +319,13 @@ def __init__( :paramtype image_pull_secret_name: str """ super(AksComputeSecrets, self).__init__(**kwargs) - self.user_kube_config = kwargs.get('user_kube_config', None) - self.admin_kube_config = kwargs.get('admin_kube_config', None) - self.image_pull_secret_name = kwargs.get('image_pull_secret_name', None) - self.compute_type = 'AKS' # type: str - self.compute_type = 'AKS' # type: str + self.user_kube_config = kwargs.get("user_kube_config", None) + self.admin_kube_config = kwargs.get("admin_kube_config", None) + self.image_pull_secret_name = kwargs.get( + "image_pull_secret_name", None + ) + self.compute_type = "AKS" # type: str + self.compute_type = "AKS" # type: str class AksNetworkingConfiguration(msrest.serialization.Model): @@ -330,22 +345,25 @@ class AksNetworkingConfiguration(msrest.serialization.Model): """ _validation = { - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, + "service_cidr": { + "pattern": r"^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$" + }, + "dns_service_ip": { + "pattern": r"^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" + }, + "docker_bridge_cidr": { + "pattern": r"^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$" + }, } _attribute_map = { - 'subnet_id': {'key': 'subnetId', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, + "subnet_id": {"key": "subnetId", "type": "str"}, + "service_cidr": {"key": "serviceCidr", "type": "str"}, + "dns_service_ip": {"key": "dnsServiceIP", "type": "str"}, + "docker_bridge_cidr": {"key": "dockerBridgeCidr", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword subnet_id: Virtual network subnet resource ID the compute nodes belong to. :paramtype subnet_id: str @@ -360,10 +378,10 @@ def __init__( :paramtype docker_bridge_cidr: str """ super(AksNetworkingConfiguration, self).__init__(**kwargs) - self.subnet_id = kwargs.get('subnet_id', None) - self.service_cidr = kwargs.get('service_cidr', None) - self.dns_service_ip = kwargs.get('dns_service_ip', None) - self.docker_bridge_cidr = kwargs.get('docker_bridge_cidr', None) + self.subnet_id = kwargs.get("subnet_id", None) + self.service_cidr = kwargs.get("service_cidr", None) + self.dns_service_ip = kwargs.get("dns_service_ip", None) + self.docker_bridge_cidr = kwargs.get("docker_bridge_cidr", None) class AKSProperties(msrest.serialization.Model): @@ -395,26 +413,32 @@ class AKSProperties(msrest.serialization.Model): """ _validation = { - 'system_services': {'readonly': True}, - 'agent_count': {'minimum': 0}, + "system_services": {"readonly": True}, + "agent_count": {"minimum": 0}, } _attribute_map = { - 'cluster_fqdn': {'key': 'clusterFqdn', 'type': 'str'}, - 'system_services': {'key': 'systemServices', 'type': '[SystemService]'}, - 'agent_count': {'key': 'agentCount', 'type': 'int'}, - 'agent_vm_size': {'key': 'agentVmSize', 'type': 'str'}, - 'cluster_purpose': {'key': 'clusterPurpose', 'type': 'str'}, - 'ssl_configuration': {'key': 'sslConfiguration', 'type': 'SslConfiguration'}, - 'aks_networking_configuration': {'key': 'aksNetworkingConfiguration', 'type': 'AksNetworkingConfiguration'}, - 'load_balancer_type': {'key': 'loadBalancerType', 'type': 'str'}, - 'load_balancer_subnet': {'key': 'loadBalancerSubnet', 'type': 'str'}, + "cluster_fqdn": {"key": "clusterFqdn", "type": "str"}, + "system_services": { + "key": "systemServices", + "type": "[SystemService]", + }, + "agent_count": {"key": "agentCount", "type": "int"}, + "agent_vm_size": {"key": "agentVmSize", "type": "str"}, + "cluster_purpose": {"key": "clusterPurpose", "type": "str"}, + "ssl_configuration": { + "key": "sslConfiguration", + "type": "SslConfiguration", + }, + "aks_networking_configuration": { + "key": "aksNetworkingConfiguration", + "type": "AksNetworkingConfiguration", + }, + "load_balancer_type": {"key": "loadBalancerType", "type": "str"}, + "load_balancer_subnet": {"key": "loadBalancerSubnet", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword cluster_fqdn: Cluster full qualified domain name. :paramtype cluster_fqdn: str @@ -438,15 +462,17 @@ def __init__( :paramtype load_balancer_subnet: str """ super(AKSProperties, self).__init__(**kwargs) - self.cluster_fqdn = kwargs.get('cluster_fqdn', None) + self.cluster_fqdn = kwargs.get("cluster_fqdn", None) self.system_services = None - self.agent_count = kwargs.get('agent_count', None) - self.agent_vm_size = kwargs.get('agent_vm_size', None) - self.cluster_purpose = kwargs.get('cluster_purpose', "FastProd") - self.ssl_configuration = kwargs.get('ssl_configuration', None) - self.aks_networking_configuration = kwargs.get('aks_networking_configuration', None) - self.load_balancer_type = kwargs.get('load_balancer_type', "PublicIp") - self.load_balancer_subnet = kwargs.get('load_balancer_subnet', None) + self.agent_count = kwargs.get("agent_count", None) + self.agent_vm_size = kwargs.get("agent_vm_size", None) + self.cluster_purpose = kwargs.get("cluster_purpose", "FastProd") + self.ssl_configuration = kwargs.get("ssl_configuration", None) + self.aks_networking_configuration = kwargs.get( + "aks_networking_configuration", None + ) + self.load_balancer_type = kwargs.get("load_balancer_type", "PublicIp") + self.load_balancer_subnet = kwargs.get("load_balancer_subnet", None) class AmlCompute(Compute): @@ -488,32 +514,32 @@ class AmlCompute(Compute): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, + "properties": {"key": "properties", "type": "AmlComputeProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword compute_location: Location for the underlying compute. :paramtype compute_location: str @@ -528,8 +554,8 @@ def __init__( :paramtype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties """ super(AmlCompute, self).__init__(**kwargs) - self.compute_type = 'AmlCompute' # type: str - self.properties = kwargs.get('properties', None) + self.compute_type = "AmlCompute" # type: str + self.properties = kwargs.get("properties", None) class AmlComputeNodeInformation(msrest.serialization.Model): @@ -554,29 +580,25 @@ class AmlComputeNodeInformation(msrest.serialization.Model): """ _validation = { - 'node_id': {'readonly': True}, - 'private_ip_address': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'port': {'readonly': True}, - 'node_state': {'readonly': True}, - 'run_id': {'readonly': True}, + "node_id": {"readonly": True}, + "private_ip_address": {"readonly": True}, + "public_ip_address": {"readonly": True}, + "port": {"readonly": True}, + "node_state": {"readonly": True}, + "run_id": {"readonly": True}, } _attribute_map = { - 'node_id': {'key': 'nodeId', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'node_state': {'key': 'nodeState', 'type': 'str'}, - 'run_id': {'key': 'runId', 'type': 'str'}, + "node_id": {"key": "nodeId", "type": "str"}, + "private_ip_address": {"key": "privateIpAddress", "type": "str"}, + "public_ip_address": {"key": "publicIpAddress", "type": "str"}, + "port": {"key": "port", "type": "int"}, + "node_state": {"key": "nodeState", "type": "str"}, + "run_id": {"key": "runId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AmlComputeNodeInformation, self).__init__(**kwargs) self.node_id = None self.private_ip_address = None @@ -598,21 +620,17 @@ class AmlComputeNodesInformation(msrest.serialization.Model): """ _validation = { - 'nodes': {'readonly': True}, - 'next_link': {'readonly': True}, + "nodes": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'nodes': {'key': 'nodes', 'type': '[AmlComputeNodeInformation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "nodes": {"key": "nodes", "type": "[AmlComputeNodeInformation]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AmlComputeNodesInformation, self).__init__(**kwargs) self.nodes = None self.next_link = None @@ -681,37 +699,49 @@ class AmlComputeProperties(msrest.serialization.Model): """ _validation = { - 'allocation_state': {'readonly': True}, - 'allocation_state_transition_time': {'readonly': True}, - 'errors': {'readonly': True}, - 'current_node_count': {'readonly': True}, - 'target_node_count': {'readonly': True}, - 'node_state_counts': {'readonly': True}, - } - - _attribute_map = { - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'vm_priority': {'key': 'vmPriority', 'type': 'str'}, - 'virtual_machine_image': {'key': 'virtualMachineImage', 'type': 'VirtualMachineImage'}, - 'isolated_network': {'key': 'isolatedNetwork', 'type': 'bool'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, - 'user_account_credentials': {'key': 'userAccountCredentials', 'type': 'UserAccountCredentials'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'remote_login_port_public_access': {'key': 'remoteLoginPortPublicAccess', 'type': 'str'}, - 'allocation_state': {'key': 'allocationState', 'type': 'str'}, - 'allocation_state_transition_time': {'key': 'allocationStateTransitionTime', 'type': 'iso-8601'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'current_node_count': {'key': 'currentNodeCount', 'type': 'int'}, - 'target_node_count': {'key': 'targetNodeCount', 'type': 'int'}, - 'node_state_counts': {'key': 'nodeStateCounts', 'type': 'NodeStateCounts'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): + "allocation_state": {"readonly": True}, + "allocation_state_transition_time": {"readonly": True}, + "errors": {"readonly": True}, + "current_node_count": {"readonly": True}, + "target_node_count": {"readonly": True}, + "node_state_counts": {"readonly": True}, + } + + _attribute_map = { + "os_type": {"key": "osType", "type": "str"}, + "vm_size": {"key": "vmSize", "type": "str"}, + "vm_priority": {"key": "vmPriority", "type": "str"}, + "virtual_machine_image": { + "key": "virtualMachineImage", + "type": "VirtualMachineImage", + }, + "isolated_network": {"key": "isolatedNetwork", "type": "bool"}, + "scale_settings": {"key": "scaleSettings", "type": "ScaleSettings"}, + "user_account_credentials": { + "key": "userAccountCredentials", + "type": "UserAccountCredentials", + }, + "subnet": {"key": "subnet", "type": "ResourceId"}, + "remote_login_port_public_access": { + "key": "remoteLoginPortPublicAccess", + "type": "str", + }, + "allocation_state": {"key": "allocationState", "type": "str"}, + "allocation_state_transition_time": { + "key": "allocationStateTransitionTime", + "type": "iso-8601", + }, + "errors": {"key": "errors", "type": "[ErrorResponse]"}, + "current_node_count": {"key": "currentNodeCount", "type": "int"}, + "target_node_count": {"key": "targetNodeCount", "type": "int"}, + "node_state_counts": { + "key": "nodeStateCounts", + "type": "NodeStateCounts", + }, + "enable_node_public_ip": {"key": "enableNodePublicIp", "type": "bool"}, + } + + def __init__(self, **kwargs): """ :keyword os_type: Compute OS Type. Possible values include: "Linux", "Windows". Default value: "Linux". @@ -750,22 +780,26 @@ def __init__( :paramtype enable_node_public_ip: bool """ super(AmlComputeProperties, self).__init__(**kwargs) - self.os_type = kwargs.get('os_type', "Linux") - self.vm_size = kwargs.get('vm_size', None) - self.vm_priority = kwargs.get('vm_priority', None) - self.virtual_machine_image = kwargs.get('virtual_machine_image', None) - self.isolated_network = kwargs.get('isolated_network', None) - self.scale_settings = kwargs.get('scale_settings', None) - self.user_account_credentials = kwargs.get('user_account_credentials', None) - self.subnet = kwargs.get('subnet', None) - self.remote_login_port_public_access = kwargs.get('remote_login_port_public_access', "NotSpecified") + self.os_type = kwargs.get("os_type", "Linux") + self.vm_size = kwargs.get("vm_size", None) + self.vm_priority = kwargs.get("vm_priority", None) + self.virtual_machine_image = kwargs.get("virtual_machine_image", None) + self.isolated_network = kwargs.get("isolated_network", None) + self.scale_settings = kwargs.get("scale_settings", None) + self.user_account_credentials = kwargs.get( + "user_account_credentials", None + ) + self.subnet = kwargs.get("subnet", None) + self.remote_login_port_public_access = kwargs.get( + "remote_login_port_public_access", "NotSpecified" + ) self.allocation_state = None self.allocation_state_transition_time = None self.errors = None self.current_node_count = None self.target_node_count = None self.node_state_counts = None - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', True) + self.enable_node_public_ip = kwargs.get("enable_node_public_ip", True) class AmlUserFeature(msrest.serialization.Model): @@ -780,15 +814,12 @@ class AmlUserFeature(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "description": {"key": "description", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword id: Specifies the feature ID. :paramtype id: str @@ -798,9 +829,9 @@ def __init__( :paramtype description: str """ super(AmlUserFeature, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.display_name = kwargs.get('display_name', None) - self.description = kwargs.get('description', None) + self.id = kwargs.get("id", None) + self.display_name = kwargs.get("display_name", None) + self.description = kwargs.get("description", None) class AssignedUser(msrest.serialization.Model): @@ -815,19 +846,16 @@ class AssignedUser(msrest.serialization.Model): """ _validation = { - 'object_id': {'required': True}, - 'tenant_id': {'required': True}, + "object_id": {"required": True}, + "tenant_id": {"required": True}, } _attribute_map = { - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + "object_id": {"key": "objectId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword object_id: Required. User’s AAD Object Id. :paramtype object_id: str @@ -835,8 +863,8 @@ def __init__( :paramtype tenant_id: str """ super(AssignedUser, self).__init__(**kwargs) - self.object_id = kwargs['object_id'] - self.tenant_id = kwargs['tenant_id'] + self.object_id = kwargs["object_id"] + self.tenant_id = kwargs["tenant_id"] class AutoPauseProperties(msrest.serialization.Model): @@ -849,14 +877,11 @@ class AutoPauseProperties(msrest.serialization.Model): """ _attribute_map = { - 'delay_in_minutes': {'key': 'delayInMinutes', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, + "delay_in_minutes": {"key": "delayInMinutes", "type": "int"}, + "enabled": {"key": "enabled", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword delay_in_minutes: :paramtype delay_in_minutes: int @@ -864,8 +889,8 @@ def __init__( :paramtype enabled: bool """ super(AutoPauseProperties, self).__init__(**kwargs) - self.delay_in_minutes = kwargs.get('delay_in_minutes', None) - self.enabled = kwargs.get('enabled', None) + self.delay_in_minutes = kwargs.get("delay_in_minutes", None) + self.enabled = kwargs.get("enabled", None) class AutoScaleProperties(msrest.serialization.Model): @@ -880,15 +905,12 @@ class AutoScaleProperties(msrest.serialization.Model): """ _attribute_map = { - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, + "min_node_count": {"key": "minNodeCount", "type": "int"}, + "enabled": {"key": "enabled", "type": "bool"}, + "max_node_count": {"key": "maxNodeCount", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword min_node_count: :paramtype min_node_count: int @@ -898,9 +920,9 @@ def __init__( :paramtype max_node_count: int """ super(AutoScaleProperties, self).__init__(**kwargs) - self.min_node_count = kwargs.get('min_node_count', None) - self.enabled = kwargs.get('enabled', None) - self.max_node_count = kwargs.get('max_node_count', None) + self.min_node_count = kwargs.get("min_node_count", None) + self.enabled = kwargs.get("enabled", None) + self.max_node_count = kwargs.get("max_node_count", None) class ClusterUpdateParameters(msrest.serialization.Model): @@ -911,22 +933,24 @@ class ClusterUpdateParameters(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties.properties', 'type': 'ScaleSettingsInformation'}, + "properties": { + "key": "properties.properties", + "type": "ScaleSettingsInformation", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of ClusterUpdate. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ScaleSettingsInformation """ super(ClusterUpdateParameters, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) -class Components1D3SwueSchemasComputeresourceAllof1(msrest.serialization.Model): +class Components1D3SwueSchemasComputeresourceAllof1( + msrest.serialization.Model +): """Components1D3SwueSchemasComputeresourceAllof1. :ivar properties: Compute properties. @@ -934,19 +958,18 @@ class Components1D3SwueSchemasComputeresourceAllof1(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, + "properties": {"key": "properties", "type": "Compute"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Compute properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute """ - super(Components1D3SwueSchemasComputeresourceAllof1, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + super(Components1D3SwueSchemasComputeresourceAllof1, self).__init__( + **kwargs + ) + self.properties = kwargs.get("properties", None) class ComputeInstance(Compute): @@ -988,32 +1011,35 @@ class ComputeInstance(Compute): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, - } - - def __init__( - self, - **kwargs - ): + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + } + + _attribute_map = { + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, + "properties": { + "key": "properties", + "type": "ComputeInstanceProperties", + }, + } + + def __init__(self, **kwargs): """ :keyword compute_location: Location for the underlying compute. :paramtype compute_location: str @@ -1028,8 +1054,8 @@ def __init__( :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties """ super(ComputeInstance, self).__init__(**kwargs) - self.compute_type = 'ComputeInstance' # type: str - self.properties = kwargs.get('properties', None) + self.compute_type = "ComputeInstance" # type: str + self.properties = kwargs.get("properties", None) class ComputeInstanceApplication(msrest.serialization.Model): @@ -1042,14 +1068,11 @@ class ComputeInstanceApplication(msrest.serialization.Model): """ _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, + "display_name": {"key": "displayName", "type": "str"}, + "endpoint_uri": {"key": "endpointUri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword display_name: Name of the ComputeInstance application. :paramtype display_name: str @@ -1057,8 +1080,8 @@ def __init__( :paramtype endpoint_uri: str """ super(ComputeInstanceApplication, self).__init__(**kwargs) - self.display_name = kwargs.get('display_name', None) - self.endpoint_uri = kwargs.get('endpoint_uri', None) + self.display_name = kwargs.get("display_name", None) + self.endpoint_uri = kwargs.get("endpoint_uri", None) class ComputeInstanceConnectivityEndpoints(msrest.serialization.Model): @@ -1074,21 +1097,17 @@ class ComputeInstanceConnectivityEndpoints(msrest.serialization.Model): """ _validation = { - 'public_ip_address': {'readonly': True}, - 'private_ip_address': {'readonly': True}, + "public_ip_address": {"readonly": True}, + "private_ip_address": {"readonly": True}, } _attribute_map = { - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + "public_ip_address": {"key": "publicIpAddress", "type": "str"}, + "private_ip_address": {"key": "privateIpAddress", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ComputeInstanceConnectivityEndpoints, self).__init__(**kwargs) self.public_ip_address = None self.private_ip_address = None @@ -1108,23 +1127,19 @@ class ComputeInstanceCreatedBy(msrest.serialization.Model): """ _validation = { - 'user_name': {'readonly': True}, - 'user_org_id': {'readonly': True}, - 'user_id': {'readonly': True}, + "user_name": {"readonly": True}, + "user_org_id": {"readonly": True}, + "user_id": {"readonly": True}, } _attribute_map = { - 'user_name': {'key': 'userName', 'type': 'str'}, - 'user_org_id': {'key': 'userOrgId', 'type': 'str'}, - 'user_id': {'key': 'userId', 'type': 'str'}, + "user_name": {"key": "userName", "type": "str"}, + "user_org_id": {"key": "userOrgId", "type": "str"}, + "user_id": {"key": "userId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ComputeInstanceCreatedBy, self).__init__(**kwargs) self.user_name = None self.user_org_id = None @@ -1145,15 +1160,12 @@ class ComputeInstanceLastOperation(msrest.serialization.Model): """ _attribute_map = { - 'operation_name': {'key': 'operationName', 'type': 'str'}, - 'operation_time': {'key': 'operationTime', 'type': 'iso-8601'}, - 'operation_status': {'key': 'operationStatus', 'type': 'str'}, + "operation_name": {"key": "operationName", "type": "str"}, + "operation_time": {"key": "operationTime", "type": "iso-8601"}, + "operation_status": {"key": "operationStatus", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword operation_name: Name of the last operation. Possible values include: "Create", "Start", "Stop", "Restart", "Reimage", "Delete". @@ -1166,9 +1178,9 @@ def __init__( :paramtype operation_status: str or ~azure.mgmt.machinelearningservices.models.OperationStatus """ super(ComputeInstanceLastOperation, self).__init__(**kwargs) - self.operation_name = kwargs.get('operation_name', None) - self.operation_time = kwargs.get('operation_time', None) - self.operation_status = kwargs.get('operation_status', None) + self.operation_name = kwargs.get("operation_name", None) + self.operation_time = kwargs.get("operation_time", None) + self.operation_status = kwargs.get("operation_status", None) class ComputeInstanceProperties(msrest.serialization.Model): @@ -1222,35 +1234,53 @@ class ComputeInstanceProperties(msrest.serialization.Model): """ _validation = { - 'connectivity_endpoints': {'readonly': True}, - 'applications': {'readonly': True}, - 'created_by': {'readonly': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'last_operation': {'readonly': True}, - } - - _attribute_map = { - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'application_sharing_policy': {'key': 'applicationSharingPolicy', 'type': 'str'}, - 'ssh_settings': {'key': 'sshSettings', 'type': 'ComputeInstanceSshSettings'}, - 'connectivity_endpoints': {'key': 'connectivityEndpoints', 'type': 'ComputeInstanceConnectivityEndpoints'}, - 'applications': {'key': 'applications', 'type': '[ComputeInstanceApplication]'}, - 'created_by': {'key': 'createdBy', 'type': 'ComputeInstanceCreatedBy'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'compute_instance_authorization_type': {'key': 'computeInstanceAuthorizationType', 'type': 'str'}, - 'personal_compute_instance_settings': {'key': 'personalComputeInstanceSettings', 'type': 'PersonalComputeInstanceSettings'}, - 'setup_scripts': {'key': 'setupScripts', 'type': 'SetupScripts'}, - 'last_operation': {'key': 'lastOperation', 'type': 'ComputeInstanceLastOperation'}, - 'schedules': {'key': 'schedules', 'type': 'ComputeSchedules'}, - } - - def __init__( - self, - **kwargs - ): + "connectivity_endpoints": {"readonly": True}, + "applications": {"readonly": True}, + "created_by": {"readonly": True}, + "errors": {"readonly": True}, + "state": {"readonly": True}, + "last_operation": {"readonly": True}, + } + + _attribute_map = { + "vm_size": {"key": "vmSize", "type": "str"}, + "subnet": {"key": "subnet", "type": "ResourceId"}, + "application_sharing_policy": { + "key": "applicationSharingPolicy", + "type": "str", + }, + "ssh_settings": { + "key": "sshSettings", + "type": "ComputeInstanceSshSettings", + }, + "connectivity_endpoints": { + "key": "connectivityEndpoints", + "type": "ComputeInstanceConnectivityEndpoints", + }, + "applications": { + "key": "applications", + "type": "[ComputeInstanceApplication]", + }, + "created_by": {"key": "createdBy", "type": "ComputeInstanceCreatedBy"}, + "errors": {"key": "errors", "type": "[ErrorResponse]"}, + "state": {"key": "state", "type": "str"}, + "compute_instance_authorization_type": { + "key": "computeInstanceAuthorizationType", + "type": "str", + }, + "personal_compute_instance_settings": { + "key": "personalComputeInstanceSettings", + "type": "PersonalComputeInstanceSettings", + }, + "setup_scripts": {"key": "setupScripts", "type": "SetupScripts"}, + "last_operation": { + "key": "lastOperation", + "type": "ComputeInstanceLastOperation", + }, + "schedules": {"key": "schedules", "type": "ComputeSchedules"}, + } + + def __init__(self, **kwargs): """ :keyword vm_size: Virtual Machine Size. :paramtype vm_size: str @@ -1279,20 +1309,26 @@ def __init__( :paramtype schedules: ~azure.mgmt.machinelearningservices.models.ComputeSchedules """ super(ComputeInstanceProperties, self).__init__(**kwargs) - self.vm_size = kwargs.get('vm_size', None) - self.subnet = kwargs.get('subnet', None) - self.application_sharing_policy = kwargs.get('application_sharing_policy', "Shared") - self.ssh_settings = kwargs.get('ssh_settings', None) + self.vm_size = kwargs.get("vm_size", None) + self.subnet = kwargs.get("subnet", None) + self.application_sharing_policy = kwargs.get( + "application_sharing_policy", "Shared" + ) + self.ssh_settings = kwargs.get("ssh_settings", None) self.connectivity_endpoints = None self.applications = None self.created_by = None self.errors = None self.state = None - self.compute_instance_authorization_type = kwargs.get('compute_instance_authorization_type', "personal") - self.personal_compute_instance_settings = kwargs.get('personal_compute_instance_settings', None) - self.setup_scripts = kwargs.get('setup_scripts', None) + self.compute_instance_authorization_type = kwargs.get( + "compute_instance_authorization_type", "personal" + ) + self.personal_compute_instance_settings = kwargs.get( + "personal_compute_instance_settings", None + ) + self.setup_scripts = kwargs.get("setup_scripts", None) self.last_operation = None - self.schedules = kwargs.get('schedules', None) + self.schedules = kwargs.get("schedules", None) class ComputeInstanceSshSettings(msrest.serialization.Model): @@ -1315,21 +1351,18 @@ class ComputeInstanceSshSettings(msrest.serialization.Model): """ _validation = { - 'admin_user_name': {'readonly': True}, - 'ssh_port': {'readonly': True}, + "admin_user_name": {"readonly": True}, + "ssh_port": {"readonly": True}, } _attribute_map = { - 'ssh_public_access': {'key': 'sshPublicAccess', 'type': 'str'}, - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'admin_public_key': {'key': 'adminPublicKey', 'type': 'str'}, + "ssh_public_access": {"key": "sshPublicAccess", "type": "str"}, + "admin_user_name": {"key": "adminUserName", "type": "str"}, + "ssh_port": {"key": "sshPort", "type": "int"}, + "admin_public_key": {"key": "adminPublicKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword ssh_public_access: State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the @@ -1341,10 +1374,10 @@ def __init__( :paramtype admin_public_key: str """ super(ComputeInstanceSshSettings, self).__init__(**kwargs) - self.ssh_public_access = kwargs.get('ssh_public_access', "Disabled") + self.ssh_public_access = kwargs.get("ssh_public_access", "Disabled") self.admin_user_name = None self.ssh_port = None - self.admin_public_key = kwargs.get('admin_public_key', None) + self.admin_public_key = kwargs.get("admin_public_key", None) class Resource(msrest.serialization.Model): @@ -1363,23 +1396,19 @@ class Resource(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -1414,28 +1443,25 @@ class ComputeResource(Resource, Components1D3SwueSchemasComputeresourceAllof1): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + "properties": {"key": "properties", "type": "Compute"}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "identity": {"key": "identity", "type": "Identity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "system_data": {"key": "systemData", "type": "SystemData"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Compute properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute @@ -1449,19 +1475,19 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ super(ComputeResource, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) + self.properties = kwargs.get("properties", None) + self.identity = kwargs.get("identity", None) + self.location = kwargs.get("location", None) + self.tags = kwargs.get("tags", None) + self.sku = kwargs.get("sku", None) self.system_data = None self.id = None self.name = None self.type = None - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) + self.identity = kwargs.get("identity", None) + self.location = kwargs.get("location", None) + self.tags = kwargs.get("tags", None) + self.sku = kwargs.get("sku", None) self.system_data = None @@ -1474,20 +1500,20 @@ class ComputeSchedules(msrest.serialization.Model): """ _attribute_map = { - 'compute_start_stop': {'key': 'computeStartStop', 'type': '[ComputeStartStopSchedule]'}, + "compute_start_stop": { + "key": "computeStartStop", + "type": "[ComputeStartStopSchedule]", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword compute_start_stop: The list of compute start stop schedules to be applied. :paramtype compute_start_stop: list[~azure.mgmt.machinelearningservices.models.ComputeStartStopSchedule] """ super(ComputeSchedules, self).__init__(**kwargs) - self.compute_start_stop = kwargs.get('compute_start_stop', None) + self.compute_start_stop = kwargs.get("compute_start_stop", None) class ComputeStartStopSchedule(msrest.serialization.Model): @@ -1514,24 +1540,21 @@ class ComputeStartStopSchedule(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'provisioning_status': {'readonly': True}, + "id": {"readonly": True}, + "provisioning_status": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'str'}, - 'recurrence': {'key': 'recurrence', 'type': 'Recurrence'}, - 'cron': {'key': 'cron', 'type': 'Cron'}, + "id": {"key": "id", "type": "str"}, + "provisioning_status": {"key": "provisioningStatus", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "trigger_type": {"key": "triggerType", "type": "str"}, + "action": {"key": "action", "type": "str"}, + "recurrence": {"key": "recurrence", "type": "Recurrence"}, + "cron": {"key": "cron", "type": "Cron"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword status: The schedule status. Possible values include: "Enabled", "Disabled". :paramtype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus @@ -1548,11 +1571,11 @@ def __init__( super(ComputeStartStopSchedule, self).__init__(**kwargs) self.id = None self.provisioning_status = None - self.status = kwargs.get('status', None) - self.trigger_type = kwargs.get('trigger_type', None) - self.action = kwargs.get('action', None) - self.recurrence = kwargs.get('recurrence', None) - self.cron = kwargs.get('cron', None) + self.status = kwargs.get("status", None) + self.trigger_type = kwargs.get("trigger_type", None) + self.action = kwargs.get("action", None) + self.recurrence = kwargs.get("recurrence", None) + self.cron = kwargs.get("cron", None) class ContainerResourceRequirements(msrest.serialization.Model): @@ -1580,18 +1603,15 @@ class ContainerResourceRequirements(msrest.serialization.Model): """ _attribute_map = { - 'cpu': {'key': 'cpu', 'type': 'float'}, - 'cpu_limit': {'key': 'cpuLimit', 'type': 'float'}, - 'memory_in_gb': {'key': 'memoryInGB', 'type': 'float'}, - 'memory_in_gb_limit': {'key': 'memoryInGBLimit', 'type': 'float'}, - 'gpu': {'key': 'gpu', 'type': 'int'}, - 'fpga': {'key': 'fpga', 'type': 'int'}, + "cpu": {"key": "cpu", "type": "float"}, + "cpu_limit": {"key": "cpuLimit", "type": "float"}, + "memory_in_gb": {"key": "memoryInGB", "type": "float"}, + "memory_in_gb_limit": {"key": "memoryInGBLimit", "type": "float"}, + "gpu": {"key": "gpu", "type": "int"}, + "fpga": {"key": "fpga", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword cpu: The minimum amount of CPU cores to be used by the container. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. @@ -1614,12 +1634,12 @@ def __init__( :paramtype fpga: int """ super(ContainerResourceRequirements, self).__init__(**kwargs) - self.cpu = kwargs.get('cpu', None) - self.cpu_limit = kwargs.get('cpu_limit', None) - self.memory_in_gb = kwargs.get('memory_in_gb', None) - self.memory_in_gb_limit = kwargs.get('memory_in_gb_limit', None) - self.gpu = kwargs.get('gpu', None) - self.fpga = kwargs.get('fpga', None) + self.cpu = kwargs.get("cpu", None) + self.cpu_limit = kwargs.get("cpu_limit", None) + self.memory_in_gb = kwargs.get("memory_in_gb", None) + self.memory_in_gb_limit = kwargs.get("memory_in_gb_limit", None) + self.gpu = kwargs.get("gpu", None) + self.fpga = kwargs.get("fpga", None) class CosmosDbSettings(msrest.serialization.Model): @@ -1630,19 +1650,21 @@ class CosmosDbSettings(msrest.serialization.Model): """ _attribute_map = { - 'collections_throughput': {'key': 'collectionsThroughput', 'type': 'int'}, + "collections_throughput": { + "key": "collectionsThroughput", + "type": "int", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword collections_throughput: The throughput of the collections in cosmosdb database. :paramtype collections_throughput: int """ super(CosmosDbSettings, self).__init__(**kwargs) - self.collections_throughput = kwargs.get('collections_throughput', None) + self.collections_throughput = kwargs.get( + "collections_throughput", None + ) class Cron(msrest.serialization.Model): @@ -1657,15 +1679,12 @@ class Cron(msrest.serialization.Model): """ _attribute_map = { - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, + "start_time": {"key": "startTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "expression": {"key": "expression", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword start_time: The start time. :paramtype start_time: str @@ -1675,9 +1694,9 @@ def __init__( :paramtype expression: str """ super(Cron, self).__init__(**kwargs) - self.start_time = kwargs.get('start_time', None) - self.time_zone = kwargs.get('time_zone', None) - self.expression = kwargs.get('expression', None) + self.start_time = kwargs.get("start_time", None) + self.time_zone = kwargs.get("time_zone", None) + self.expression = kwargs.get("expression", None) class Databricks(Compute): @@ -1719,32 +1738,32 @@ class Databricks(Compute): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, + "properties": {"key": "properties", "type": "DatabricksProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword compute_location: Location for the underlying compute. :paramtype compute_location: str @@ -1759,8 +1778,8 @@ def __init__( :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties """ super(Databricks, self).__init__(**kwargs) - self.compute_type = 'Databricks' # type: str - self.properties = kwargs.get('properties', None) + self.compute_type = "Databricks" # type: str + self.properties = kwargs.get("properties", None) class DatabricksComputeSecretsProperties(msrest.serialization.Model): @@ -1771,22 +1790,26 @@ class DatabricksComputeSecretsProperties(msrest.serialization.Model): """ _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword databricks_access_token: access token for databricks account. :paramtype databricks_access_token: str """ super(DatabricksComputeSecretsProperties, self).__init__(**kwargs) - self.databricks_access_token = kwargs.get('databricks_access_token', None) + self.databricks_access_token = kwargs.get( + "databricks_access_token", None + ) -class DatabricksComputeSecrets(ComputeSecrets, DatabricksComputeSecretsProperties): +class DatabricksComputeSecrets( + ComputeSecrets, DatabricksComputeSecretsProperties +): """Secrets related to a Machine Learning compute based on Databricks. All required parameters must be populated in order to send to Azure. @@ -1800,26 +1823,28 @@ class DatabricksComputeSecrets(ComputeSecrets, DatabricksComputeSecretsPropertie """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, + "compute_type": {"key": "computeType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword databricks_access_token: access token for databricks account. :paramtype databricks_access_token: str """ super(DatabricksComputeSecrets, self).__init__(**kwargs) - self.databricks_access_token = kwargs.get('databricks_access_token', None) - self.compute_type = 'Databricks' # type: str - self.compute_type = 'Databricks' # type: str + self.databricks_access_token = kwargs.get( + "databricks_access_token", None + ) + self.compute_type = "Databricks" # type: str + self.compute_type = "Databricks" # type: str class DatabricksProperties(msrest.serialization.Model): @@ -1832,14 +1857,14 @@ class DatabricksProperties(msrest.serialization.Model): """ _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'workspace_url': {'key': 'workspaceUrl', 'type': 'str'}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, + "workspace_url": {"key": "workspaceUrl", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword databricks_access_token: Databricks access token. :paramtype databricks_access_token: str @@ -1847,8 +1872,10 @@ def __init__( :paramtype workspace_url: str """ super(DatabricksProperties, self).__init__(**kwargs) - self.databricks_access_token = kwargs.get('databricks_access_token', None) - self.workspace_url = kwargs.get('workspace_url', None) + self.databricks_access_token = kwargs.get( + "databricks_access_token", None + ) + self.workspace_url = kwargs.get("workspace_url", None) class DataFactory(Compute): @@ -1888,31 +1915,31 @@ class DataFactory(Compute): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword compute_location: Location for the underlying compute. :paramtype compute_location: str @@ -1925,7 +1952,7 @@ def __init__( :paramtype disable_local_auth: bool """ super(DataFactory, self).__init__(**kwargs) - self.compute_type = 'DataFactory' # type: str + self.compute_type = "DataFactory" # type: str class DataLakeAnalytics(Compute): @@ -1967,32 +1994,35 @@ class DataLakeAnalytics(Compute): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsProperties'}, - } - - def __init__( - self, - **kwargs - ): + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + } + + _attribute_map = { + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, + "properties": { + "key": "properties", + "type": "DataLakeAnalyticsProperties", + }, + } + + def __init__(self, **kwargs): """ :keyword compute_location: Location for the underlying compute. :paramtype compute_location: str @@ -2007,8 +2037,8 @@ def __init__( :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsProperties """ super(DataLakeAnalytics, self).__init__(**kwargs) - self.compute_type = 'DataLakeAnalytics' # type: str - self.properties = kwargs.get('properties', None) + self.compute_type = "DataLakeAnalytics" # type: str + self.properties = kwargs.get("properties", None) class DataLakeAnalyticsProperties(msrest.serialization.Model): @@ -2019,19 +2049,21 @@ class DataLakeAnalyticsProperties(msrest.serialization.Model): """ _attribute_map = { - 'data_lake_store_account_name': {'key': 'dataLakeStoreAccountName', 'type': 'str'}, + "data_lake_store_account_name": { + "key": "dataLakeStoreAccountName", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data_lake_store_account_name: DataLake Store Account Name. :paramtype data_lake_store_account_name: str """ super(DataLakeAnalyticsProperties, self).__init__(**kwargs) - self.data_lake_store_account_name = kwargs.get('data_lake_store_account_name', None) + self.data_lake_store_account_name = kwargs.get( + "data_lake_store_account_name", None + ) class DiagnoseRequestProperties(msrest.serialization.Model): @@ -2058,21 +2090,21 @@ class DiagnoseRequestProperties(msrest.serialization.Model): """ _attribute_map = { - 'udr': {'key': 'udr', 'type': '{object}'}, - 'nsg': {'key': 'nsg', 'type': '{object}'}, - 'resource_lock': {'key': 'resourceLock', 'type': '{object}'}, - 'dns_resolution': {'key': 'dnsResolution', 'type': '{object}'}, - 'storage_account': {'key': 'storageAccount', 'type': '{object}'}, - 'key_vault': {'key': 'keyVault', 'type': '{object}'}, - 'container_registry': {'key': 'containerRegistry', 'type': '{object}'}, - 'application_insights': {'key': 'applicationInsights', 'type': '{object}'}, - 'others': {'key': 'others', 'type': '{object}'}, + "udr": {"key": "udr", "type": "{object}"}, + "nsg": {"key": "nsg", "type": "{object}"}, + "resource_lock": {"key": "resourceLock", "type": "{object}"}, + "dns_resolution": {"key": "dnsResolution", "type": "{object}"}, + "storage_account": {"key": "storageAccount", "type": "{object}"}, + "key_vault": {"key": "keyVault", "type": "{object}"}, + "container_registry": {"key": "containerRegistry", "type": "{object}"}, + "application_insights": { + "key": "applicationInsights", + "type": "{object}", + }, + "others": {"key": "others", "type": "{object}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword udr: Setting for diagnosing user defined routing. :paramtype udr: dict[str, any] @@ -2094,15 +2126,15 @@ def __init__( :paramtype others: dict[str, any] """ super(DiagnoseRequestProperties, self).__init__(**kwargs) - self.udr = kwargs.get('udr', None) - self.nsg = kwargs.get('nsg', None) - self.resource_lock = kwargs.get('resource_lock', None) - self.dns_resolution = kwargs.get('dns_resolution', None) - self.storage_account = kwargs.get('storage_account', None) - self.key_vault = kwargs.get('key_vault', None) - self.container_registry = kwargs.get('container_registry', None) - self.application_insights = kwargs.get('application_insights', None) - self.others = kwargs.get('others', None) + self.udr = kwargs.get("udr", None) + self.nsg = kwargs.get("nsg", None) + self.resource_lock = kwargs.get("resource_lock", None) + self.dns_resolution = kwargs.get("dns_resolution", None) + self.storage_account = kwargs.get("storage_account", None) + self.key_vault = kwargs.get("key_vault", None) + self.container_registry = kwargs.get("container_registry", None) + self.application_insights = kwargs.get("application_insights", None) + self.others = kwargs.get("others", None) class DiagnoseResponseResult(msrest.serialization.Model): @@ -2113,19 +2145,16 @@ class DiagnoseResponseResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseResponseResultValue'}, + "value": {"key": "value", "type": "DiagnoseResponseResultValue"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: :paramtype value: ~azure.mgmt.machinelearningservices.models.DiagnoseResponseResultValue """ super(DiagnoseResponseResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class DiagnoseResponseResultValue(msrest.serialization.Model): @@ -2158,21 +2187,42 @@ class DiagnoseResponseResultValue(msrest.serialization.Model): """ _attribute_map = { - 'user_defined_route_results': {'key': 'userDefinedRouteResults', 'type': '[DiagnoseResult]'}, - 'network_security_rule_results': {'key': 'networkSecurityRuleResults', 'type': '[DiagnoseResult]'}, - 'resource_lock_results': {'key': 'resourceLockResults', 'type': '[DiagnoseResult]'}, - 'dns_resolution_results': {'key': 'dnsResolutionResults', 'type': '[DiagnoseResult]'}, - 'storage_account_results': {'key': 'storageAccountResults', 'type': '[DiagnoseResult]'}, - 'key_vault_results': {'key': 'keyVaultResults', 'type': '[DiagnoseResult]'}, - 'container_registry_results': {'key': 'containerRegistryResults', 'type': '[DiagnoseResult]'}, - 'application_insights_results': {'key': 'applicationInsightsResults', 'type': '[DiagnoseResult]'}, - 'other_results': {'key': 'otherResults', 'type': '[DiagnoseResult]'}, - } - - def __init__( - self, - **kwargs - ): + "user_defined_route_results": { + "key": "userDefinedRouteResults", + "type": "[DiagnoseResult]", + }, + "network_security_rule_results": { + "key": "networkSecurityRuleResults", + "type": "[DiagnoseResult]", + }, + "resource_lock_results": { + "key": "resourceLockResults", + "type": "[DiagnoseResult]", + }, + "dns_resolution_results": { + "key": "dnsResolutionResults", + "type": "[DiagnoseResult]", + }, + "storage_account_results": { + "key": "storageAccountResults", + "type": "[DiagnoseResult]", + }, + "key_vault_results": { + "key": "keyVaultResults", + "type": "[DiagnoseResult]", + }, + "container_registry_results": { + "key": "containerRegistryResults", + "type": "[DiagnoseResult]", + }, + "application_insights_results": { + "key": "applicationInsightsResults", + "type": "[DiagnoseResult]", + }, + "other_results": {"key": "otherResults", "type": "[DiagnoseResult]"}, + } + + def __init__(self, **kwargs): """ :keyword user_defined_route_results: :paramtype user_defined_route_results: @@ -2201,15 +2251,27 @@ def __init__( :paramtype other_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] """ super(DiagnoseResponseResultValue, self).__init__(**kwargs) - self.user_defined_route_results = kwargs.get('user_defined_route_results', None) - self.network_security_rule_results = kwargs.get('network_security_rule_results', None) - self.resource_lock_results = kwargs.get('resource_lock_results', None) - self.dns_resolution_results = kwargs.get('dns_resolution_results', None) - self.storage_account_results = kwargs.get('storage_account_results', None) - self.key_vault_results = kwargs.get('key_vault_results', None) - self.container_registry_results = kwargs.get('container_registry_results', None) - self.application_insights_results = kwargs.get('application_insights_results', None) - self.other_results = kwargs.get('other_results', None) + self.user_defined_route_results = kwargs.get( + "user_defined_route_results", None + ) + self.network_security_rule_results = kwargs.get( + "network_security_rule_results", None + ) + self.resource_lock_results = kwargs.get("resource_lock_results", None) + self.dns_resolution_results = kwargs.get( + "dns_resolution_results", None + ) + self.storage_account_results = kwargs.get( + "storage_account_results", None + ) + self.key_vault_results = kwargs.get("key_vault_results", None) + self.container_registry_results = kwargs.get( + "container_registry_results", None + ) + self.application_insights_results = kwargs.get( + "application_insights_results", None + ) + self.other_results = kwargs.get("other_results", None) class DiagnoseResult(msrest.serialization.Model): @@ -2227,23 +2289,19 @@ class DiagnoseResult(msrest.serialization.Model): """ _validation = { - 'code': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, + "code": {"readonly": True}, + "level": {"readonly": True}, + "message": {"readonly": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, + "code": {"key": "code", "type": "str"}, + "level": {"key": "level", "type": "str"}, + "message": {"key": "message", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DiagnoseResult, self).__init__(**kwargs) self.code = None self.level = None @@ -2258,19 +2316,16 @@ class DiagnoseWorkspaceParameters(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseRequestProperties'}, + "value": {"key": "value", "type": "DiagnoseRequestProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Value of Parameters. :paramtype value: ~azure.mgmt.machinelearningservices.models.DiagnoseRequestProperties """ super(DiagnoseWorkspaceParameters, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class EncryptionProperty(msrest.serialization.Model): @@ -2297,23 +2352,29 @@ class EncryptionProperty(msrest.serialization.Model): """ _validation = { - 'status': {'required': True}, - 'key_vault_properties': {'required': True}, + "status": {"required": True}, + "key_vault_properties": {"required": True}, } _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityForCmk'}, - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'KeyVaultProperties'}, - 'cosmos_db_resource_id': {'key': 'cosmosDbResourceId', 'type': 'str'}, - 'storage_account_resource_id': {'key': 'storageAccountResourceId', 'type': 'str'}, - 'search_account_resource_id': {'key': 'searchAccountResourceId', 'type': 'str'}, + "status": {"key": "status", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityForCmk"}, + "key_vault_properties": { + "key": "keyVaultProperties", + "type": "KeyVaultProperties", + }, + "cosmos_db_resource_id": {"key": "cosmosDbResourceId", "type": "str"}, + "storage_account_resource_id": { + "key": "storageAccountResourceId", + "type": "str", + }, + "search_account_resource_id": { + "key": "searchAccountResourceId", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword status: Required. Indicates whether or not the encryption is enabled for the workspace. Possible values include: "Enabled", "Disabled". @@ -2334,12 +2395,16 @@ def __init__( :paramtype search_account_resource_id: str """ super(EncryptionProperty, self).__init__(**kwargs) - self.status = kwargs['status'] - self.identity = kwargs.get('identity', None) - self.key_vault_properties = kwargs['key_vault_properties'] - self.cosmos_db_resource_id = kwargs.get('cosmos_db_resource_id', None) - self.storage_account_resource_id = kwargs.get('storage_account_resource_id', None) - self.search_account_resource_id = kwargs.get('search_account_resource_id', None) + self.status = kwargs["status"] + self.identity = kwargs.get("identity", None) + self.key_vault_properties = kwargs["key_vault_properties"] + self.cosmos_db_resource_id = kwargs.get("cosmos_db_resource_id", None) + self.storage_account_resource_id = kwargs.get( + "storage_account_resource_id", None + ) + self.search_account_resource_id = kwargs.get( + "search_account_resource_id", None + ) class ErrorAdditionalInfo(msrest.serialization.Model): @@ -2354,21 +2419,17 @@ class ErrorAdditionalInfo(msrest.serialization.Model): """ _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, + "type": {"readonly": True}, + "info": {"readonly": True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, + "type": {"key": "type", "type": "str"}, + "info": {"key": "info", "type": "object"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ErrorAdditionalInfo, self).__init__(**kwargs) self.type = None self.info = None @@ -2392,27 +2453,26 @@ class ErrorDetail(msrest.serialization.Model): """ _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, + "code": {"readonly": True}, + "message": {"readonly": True}, + "target": {"readonly": True}, + "details": {"readonly": True}, + "additional_info": {"readonly": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[ErrorDetail]"}, + "additional_info": { + "key": "additionalInfo", + "type": "[ErrorAdditionalInfo]", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ErrorDetail, self).__init__(**kwargs) self.code = None self.message = None @@ -2429,19 +2489,16 @@ class ErrorResponse(msrest.serialization.Model): """ _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, + "error": {"key": "error", "type": "ErrorDetail"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword error: The error object. :paramtype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail """ super(ErrorResponse, self).__init__(**kwargs) - self.error = kwargs.get('error', None) + self.error = kwargs.get("error", None) class EstimatedVMPrice(msrest.serialization.Model): @@ -2460,21 +2517,18 @@ class EstimatedVMPrice(msrest.serialization.Model): """ _validation = { - 'retail_price': {'required': True}, - 'os_type': {'required': True}, - 'vm_tier': {'required': True}, + "retail_price": {"required": True}, + "os_type": {"required": True}, + "vm_tier": {"required": True}, } _attribute_map = { - 'retail_price': {'key': 'retailPrice', 'type': 'float'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_tier': {'key': 'vmTier', 'type': 'str'}, + "retail_price": {"key": "retailPrice", "type": "float"}, + "os_type": {"key": "osType", "type": "str"}, + "vm_tier": {"key": "vmTier", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword retail_price: Required. The price charged for using the VM. :paramtype retail_price: float @@ -2486,9 +2540,9 @@ def __init__( :paramtype vm_tier: str or ~azure.mgmt.machinelearningservices.models.VMTier """ super(EstimatedVMPrice, self).__init__(**kwargs) - self.retail_price = kwargs['retail_price'] - self.os_type = kwargs['os_type'] - self.vm_tier = kwargs['vm_tier'] + self.retail_price = kwargs["retail_price"] + self.os_type = kwargs["os_type"] + self.vm_tier = kwargs["vm_tier"] class EstimatedVMPrices(msrest.serialization.Model): @@ -2508,21 +2562,18 @@ class EstimatedVMPrices(msrest.serialization.Model): """ _validation = { - 'billing_currency': {'required': True}, - 'unit_of_measure': {'required': True}, - 'values': {'required': True}, + "billing_currency": {"required": True}, + "unit_of_measure": {"required": True}, + "values": {"required": True}, } _attribute_map = { - 'billing_currency': {'key': 'billingCurrency', 'type': 'str'}, - 'unit_of_measure': {'key': 'unitOfMeasure', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[EstimatedVMPrice]'}, + "billing_currency": {"key": "billingCurrency", "type": "str"}, + "unit_of_measure": {"key": "unitOfMeasure", "type": "str"}, + "values": {"key": "values", "type": "[EstimatedVMPrice]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword billing_currency: Required. Three lettered code specifying the currency of the VM price. Example: USD. Possible values include: "USD". @@ -2535,9 +2586,9 @@ def __init__( :paramtype values: list[~azure.mgmt.machinelearningservices.models.EstimatedVMPrice] """ super(EstimatedVMPrices, self).__init__(**kwargs) - self.billing_currency = kwargs['billing_currency'] - self.unit_of_measure = kwargs['unit_of_measure'] - self.values = kwargs['values'] + self.billing_currency = kwargs["billing_currency"] + self.unit_of_measure = kwargs["unit_of_measure"] + self.values = kwargs["values"] class ExternalFQDNResponse(msrest.serialization.Model): @@ -2548,19 +2599,16 @@ class ExternalFQDNResponse(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[FQDNEndpoints]'}, + "value": {"key": "value", "type": "[FQDNEndpoints]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: :paramtype value: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoints] """ super(ExternalFQDNResponse, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class FQDNEndpoint(msrest.serialization.Model): @@ -2573,14 +2621,14 @@ class FQDNEndpoint(msrest.serialization.Model): """ _attribute_map = { - 'domain_name': {'key': 'domainName', 'type': 'str'}, - 'endpoint_details': {'key': 'endpointDetails', 'type': '[FQDNEndpointDetail]'}, + "domain_name": {"key": "domainName", "type": "str"}, + "endpoint_details": { + "key": "endpointDetails", + "type": "[FQDNEndpointDetail]", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword domain_name: :paramtype domain_name: str @@ -2589,8 +2637,8 @@ def __init__( list[~azure.mgmt.machinelearningservices.models.FQDNEndpointDetail] """ super(FQDNEndpoint, self).__init__(**kwargs) - self.domain_name = kwargs.get('domain_name', None) - self.endpoint_details = kwargs.get('endpoint_details', None) + self.domain_name = kwargs.get("domain_name", None) + self.endpoint_details = kwargs.get("endpoint_details", None) class FQDNEndpointDetail(msrest.serialization.Model): @@ -2601,19 +2649,16 @@ class FQDNEndpointDetail(msrest.serialization.Model): """ _attribute_map = { - 'port': {'key': 'port', 'type': 'int'}, + "port": {"key": "port", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword port: :paramtype port: int """ super(FQDNEndpointDetail, self).__init__(**kwargs) - self.port = kwargs.get('port', None) + self.port = kwargs.get("port", None) class FQDNEndpoints(msrest.serialization.Model): @@ -2624,19 +2669,16 @@ class FQDNEndpoints(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'FQDNEndpointsProperties'}, + "properties": {"key": "properties", "type": "FQDNEndpointsProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: :paramtype properties: ~azure.mgmt.machinelearningservices.models.FQDNEndpointsProperties """ super(FQDNEndpoints, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class FQDNEndpointsProperties(msrest.serialization.Model): @@ -2649,14 +2691,11 @@ class FQDNEndpointsProperties(msrest.serialization.Model): """ _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'endpoints': {'key': 'endpoints', 'type': '[FQDNEndpoint]'}, + "category": {"key": "category", "type": "str"}, + "endpoints": {"key": "endpoints", "type": "[FQDNEndpoint]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: :paramtype category: str @@ -2664,8 +2703,8 @@ def __init__( :paramtype endpoints: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoint] """ super(FQDNEndpointsProperties, self).__init__(**kwargs) - self.category = kwargs.get('category', None) - self.endpoints = kwargs.get('endpoints', None) + self.category = kwargs.get("category", None) + self.endpoints = kwargs.get("endpoints", None) class HDInsight(Compute): @@ -2707,32 +2746,32 @@ class HDInsight(Compute): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, + "properties": {"key": "properties", "type": "HDInsightProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword compute_location: Location for the underlying compute. :paramtype compute_location: str @@ -2747,8 +2786,8 @@ def __init__( :paramtype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties """ super(HDInsight, self).__init__(**kwargs) - self.compute_type = 'HDInsight' # type: str - self.properties = kwargs.get('properties', None) + self.compute_type = "HDInsight" # type: str + self.properties = kwargs.get("properties", None) class HDInsightProperties(msrest.serialization.Model): @@ -2764,15 +2803,15 @@ class HDInsightProperties(msrest.serialization.Model): """ _attribute_map = { - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, + "ssh_port": {"key": "sshPort", "type": "int"}, + "address": {"key": "address", "type": "str"}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword ssh_port: Port open for ssh connections on the master node of the cluster. :paramtype ssh_port: int @@ -2783,9 +2822,9 @@ def __init__( ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials """ super(HDInsightProperties, self).__init__(**kwargs) - self.ssh_port = kwargs.get('ssh_port', None) - self.address = kwargs.get('address', None) - self.administrator_account = kwargs.get('administrator_account', None) + self.ssh_port = kwargs.get("ssh_port", None) + self.address = kwargs.get("address", None) + self.administrator_account = kwargs.get("administrator_account", None) class Identity(msrest.serialization.Model): @@ -2806,21 +2845,21 @@ class Identity(msrest.serialization.Model): """ _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, + "principal_id": {"readonly": True}, + "tenant_id": {"readonly": True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{UserAssignedIdentity}", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword type: The identity type. Possible values include: "SystemAssigned", "SystemAssigned,UserAssigned", "UserAssigned", "None". @@ -2832,8 +2871,10 @@ def __init__( super(Identity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None - self.type = kwargs.get('type', None) - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + self.type = kwargs.get("type", None) + self.user_assigned_identities = kwargs.get( + "user_assigned_identities", None + ) class IdentityForCmk(msrest.serialization.Model): @@ -2845,20 +2886,22 @@ class IdentityForCmk(msrest.serialization.Model): """ _attribute_map = { - 'user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, + "user_assigned_identity": { + "key": "userAssignedIdentity", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword user_assigned_identity: The ArmId of the user assigned identity that will be used to access the customer managed key vault. :paramtype user_assigned_identity: str """ super(IdentityForCmk, self).__init__(**kwargs) - self.user_assigned_identity = kwargs.get('user_assigned_identity', None) + self.user_assigned_identity = kwargs.get( + "user_assigned_identity", None + ) class InstanceTypeSchema(msrest.serialization.Model): @@ -2871,14 +2914,14 @@ class InstanceTypeSchema(msrest.serialization.Model): """ _attribute_map = { - 'node_selector': {'key': 'nodeSelector', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'InstanceTypeSchemaResources'}, + "node_selector": {"key": "nodeSelector", "type": "{str}"}, + "resources": { + "key": "resources", + "type": "InstanceTypeSchemaResources", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword node_selector: Node Selector. :paramtype node_selector: dict[str, str] @@ -2886,8 +2929,8 @@ def __init__( :paramtype resources: ~azure.mgmt.machinelearningservices.models.InstanceTypeSchemaResources """ super(InstanceTypeSchema, self).__init__(**kwargs) - self.node_selector = kwargs.get('node_selector', None) - self.resources = kwargs.get('resources', None) + self.node_selector = kwargs.get("node_selector", None) + self.resources = kwargs.get("resources", None) class InstanceTypeSchemaResources(msrest.serialization.Model): @@ -2900,14 +2943,11 @@ class InstanceTypeSchemaResources(msrest.serialization.Model): """ _attribute_map = { - 'requests': {'key': 'requests', 'type': '{str}'}, - 'limits': {'key': 'limits', 'type': '{str}'}, + "requests": {"key": "requests", "type": "{str}"}, + "limits": {"key": "limits", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword requests: Resource requests for this instance type. :paramtype requests: dict[str, str] @@ -2915,8 +2955,8 @@ def __init__( :paramtype limits: dict[str, str] """ super(InstanceTypeSchemaResources, self).__init__(**kwargs) - self.requests = kwargs.get('requests', None) - self.limits = kwargs.get('limits', None) + self.requests = kwargs.get("requests", None) + self.limits = kwargs.get("limits", None) class KeyVaultProperties(msrest.serialization.Model): @@ -2935,20 +2975,17 @@ class KeyVaultProperties(msrest.serialization.Model): """ _validation = { - 'key_vault_arm_id': {'required': True}, - 'key_identifier': {'required': True}, + "key_vault_arm_id": {"required": True}, + "key_identifier": {"required": True}, } _attribute_map = { - 'key_vault_arm_id': {'key': 'keyVaultArmId', 'type': 'str'}, - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - 'identity_client_id': {'key': 'identityClientId', 'type': 'str'}, + "key_vault_arm_id": {"key": "keyVaultArmId", "type": "str"}, + "key_identifier": {"key": "keyIdentifier", "type": "str"}, + "identity_client_id": {"key": "identityClientId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword key_vault_arm_id: Required. The ArmId of the keyVault where the customer owned encryption key is present. @@ -2960,9 +2997,9 @@ def __init__( :paramtype identity_client_id: str """ super(KeyVaultProperties, self).__init__(**kwargs) - self.key_vault_arm_id = kwargs['key_vault_arm_id'] - self.key_identifier = kwargs['key_identifier'] - self.identity_client_id = kwargs.get('identity_client_id', None) + self.key_vault_arm_id = kwargs["key_vault_arm_id"] + self.key_identifier = kwargs["key_identifier"] + self.identity_client_id = kwargs.get("identity_client_id", None) class KubernetesSchema(msrest.serialization.Model): @@ -2973,19 +3010,16 @@ class KubernetesSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, + "properties": {"key": "properties", "type": "KubernetesProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of Kubernetes. :paramtype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties """ super(KubernetesSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class Kubernetes(Compute, KubernetesSchema): @@ -3027,32 +3061,32 @@ class Kubernetes(Compute, KubernetesSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "KubernetesProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of Kubernetes. :paramtype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties @@ -3067,18 +3101,18 @@ def __init__( :paramtype disable_local_auth: bool """ super(Kubernetes, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'Kubernetes' # type: str - self.compute_type = 'Kubernetes' # type: str - self.compute_location = kwargs.get('compute_location', None) + self.properties = kwargs.get("properties", None) + self.compute_type = "Kubernetes" # type: str + self.compute_type = "Kubernetes" # type: str + self.compute_location = kwargs.get("compute_location", None) self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) + self.disable_local_auth = kwargs.get("disable_local_auth", None) class KubernetesProperties(msrest.serialization.Model): @@ -3104,20 +3138,32 @@ class KubernetesProperties(msrest.serialization.Model): """ _attribute_map = { - 'relay_connection_string': {'key': 'relayConnectionString', 'type': 'str'}, - 'service_bus_connection_string': {'key': 'serviceBusConnectionString', 'type': 'str'}, - 'extension_principal_id': {'key': 'extensionPrincipalId', 'type': 'str'}, - 'extension_instance_release_train': {'key': 'extensionInstanceReleaseTrain', 'type': 'str'}, - 'vc_name': {'key': 'vcName', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'default_instance_type': {'key': 'defaultInstanceType', 'type': 'str'}, - 'instance_types': {'key': 'instanceTypes', 'type': '{InstanceTypeSchema}'}, - } - - def __init__( - self, - **kwargs - ): + "relay_connection_string": { + "key": "relayConnectionString", + "type": "str", + }, + "service_bus_connection_string": { + "key": "serviceBusConnectionString", + "type": "str", + }, + "extension_principal_id": { + "key": "extensionPrincipalId", + "type": "str", + }, + "extension_instance_release_train": { + "key": "extensionInstanceReleaseTrain", + "type": "str", + }, + "vc_name": {"key": "vcName", "type": "str"}, + "namespace": {"key": "namespace", "type": "str"}, + "default_instance_type": {"key": "defaultInstanceType", "type": "str"}, + "instance_types": { + "key": "instanceTypes", + "type": "{InstanceTypeSchema}", + }, + } + + def __init__(self, **kwargs): """ :keyword relay_connection_string: Relay connection string. :paramtype relay_connection_string: str @@ -3138,14 +3184,22 @@ def __init__( ~azure.mgmt.machinelearningservices.models.InstanceTypeSchema] """ super(KubernetesProperties, self).__init__(**kwargs) - self.relay_connection_string = kwargs.get('relay_connection_string', None) - self.service_bus_connection_string = kwargs.get('service_bus_connection_string', None) - self.extension_principal_id = kwargs.get('extension_principal_id', None) - self.extension_instance_release_train = kwargs.get('extension_instance_release_train', None) - self.vc_name = kwargs.get('vc_name', None) - self.namespace = kwargs.get('namespace', "default") - self.default_instance_type = kwargs.get('default_instance_type', None) - self.instance_types = kwargs.get('instance_types', None) + self.relay_connection_string = kwargs.get( + "relay_connection_string", None + ) + self.service_bus_connection_string = kwargs.get( + "service_bus_connection_string", None + ) + self.extension_principal_id = kwargs.get( + "extension_principal_id", None + ) + self.extension_instance_release_train = kwargs.get( + "extension_instance_release_train", None + ) + self.vc_name = kwargs.get("vc_name", None) + self.namespace = kwargs.get("namespace", "default") + self.default_instance_type = kwargs.get("default_instance_type", None) + self.instance_types = kwargs.get("instance_types", None) class ListAmlUserFeatureResult(msrest.serialization.Model): @@ -3161,21 +3215,17 @@ class ListAmlUserFeatureResult(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlUserFeature]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[AmlUserFeature]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListAmlUserFeatureResult, self).__init__(**kwargs) self.value = None self.next_link = None @@ -3193,21 +3243,17 @@ class ListNotebookKeysResult(msrest.serialization.Model): """ _validation = { - 'primary_access_key': {'readonly': True}, - 'secondary_access_key': {'readonly': True}, + "primary_access_key": {"readonly": True}, + "secondary_access_key": {"readonly": True}, } _attribute_map = { - 'primary_access_key': {'key': 'primaryAccessKey', 'type': 'str'}, - 'secondary_access_key': {'key': 'secondaryAccessKey', 'type': 'str'}, + "primary_access_key": {"key": "primaryAccessKey", "type": "str"}, + "secondary_access_key": {"key": "secondaryAccessKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListNotebookKeysResult, self).__init__(**kwargs) self.primary_access_key = None self.secondary_access_key = None @@ -3223,19 +3269,15 @@ class ListStorageAccountKeysResult(msrest.serialization.Model): """ _validation = { - 'user_storage_key': {'readonly': True}, + "user_storage_key": {"readonly": True}, } _attribute_map = { - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, + "user_storage_key": {"key": "userStorageKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListStorageAccountKeysResult, self).__init__(**kwargs) self.user_storage_key = None @@ -3253,21 +3295,17 @@ class ListUsagesResult(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[Usage]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Usage]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListUsagesResult, self).__init__(**kwargs) self.value = None self.next_link = None @@ -3293,27 +3331,35 @@ class ListWorkspaceKeysResult(msrest.serialization.Model): """ _validation = { - 'user_storage_key': {'readonly': True}, - 'user_storage_resource_id': {'readonly': True}, - 'app_insights_instrumentation_key': {'readonly': True}, - 'container_registry_credentials': {'readonly': True}, - 'notebook_access_keys': {'readonly': True}, - } - - _attribute_map = { - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, - 'user_storage_resource_id': {'key': 'userStorageResourceId', 'type': 'str'}, - 'app_insights_instrumentation_key': {'key': 'appInsightsInstrumentationKey', 'type': 'str'}, - 'container_registry_credentials': {'key': 'containerRegistryCredentials', 'type': 'RegistryListCredentialsResult'}, - 'notebook_access_keys': {'key': 'notebookAccessKeys', 'type': 'ListNotebookKeysResult'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ + "user_storage_key": {"readonly": True}, + "user_storage_resource_id": {"readonly": True}, + "app_insights_instrumentation_key": {"readonly": True}, + "container_registry_credentials": {"readonly": True}, + "notebook_access_keys": {"readonly": True}, + } + + _attribute_map = { + "user_storage_key": {"key": "userStorageKey", "type": "str"}, + "user_storage_resource_id": { + "key": "userStorageResourceId", + "type": "str", + }, + "app_insights_instrumentation_key": { + "key": "appInsightsInstrumentationKey", + "type": "str", + }, + "container_registry_credentials": { + "key": "containerRegistryCredentials", + "type": "RegistryListCredentialsResult", + }, + "notebook_access_keys": { + "key": "notebookAccessKeys", + "type": "ListNotebookKeysResult", + }, + } + + def __init__(self, **kwargs): + """ """ super(ListWorkspaceKeysResult, self).__init__(**kwargs) self.user_storage_key = None self.user_storage_resource_id = None @@ -3335,21 +3381,17 @@ class ListWorkspaceQuotas(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[ResourceQuota]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[ResourceQuota]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListWorkspaceQuotas, self).__init__(**kwargs) self.value = None self.next_link = None @@ -3365,14 +3407,11 @@ class ManagedIdentity(msrest.serialization.Model): """ _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, + "resource_id": {"key": "resourceId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword resource_id: :paramtype resource_id: str @@ -3380,8 +3419,8 @@ def __init__( :paramtype client_id: str """ super(ManagedIdentity, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.client_id = kwargs.get('client_id', None) + self.resource_id = kwargs.get("resource_id", None) + self.client_id = kwargs.get("client_id", None) class WorkspaceConnectionPropertiesV2(msrest.serialization.Model): @@ -3410,26 +3449,30 @@ class WorkspaceConnectionPropertiesV2(msrest.serialization.Model): """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'metadata': {'key': 'metadata', 'type': '{object}'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "metadata": {"key": "metadata", "type": "{object}"}, } _subtype_map = { - 'auth_type': {'ManagedIdentity': 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', 'None': 'NoneAuthTypeWorkspaceConnectionProperties', 'PAT': 'PATAuthTypeWorkspaceConnectionProperties', 'SAS': 'SASAuthTypeWorkspaceConnectionProperties', 'ServicePrincipal': 'ServicePrincipalAuthTypeWorkspaceConnectionProperties', 'UsernamePassword': 'UsernamePasswordAuthTypeWorkspaceConnectionProperties'} + "auth_type": { + "ManagedIdentity": "ManagedIdentityAuthTypeWorkspaceConnectionProperties", + "None": "NoneAuthTypeWorkspaceConnectionProperties", + "PAT": "PATAuthTypeWorkspaceConnectionProperties", + "SAS": "SASAuthTypeWorkspaceConnectionProperties", + "ServicePrincipal": "ServicePrincipalAuthTypeWorkspaceConnectionProperties", + "UsernamePassword": "UsernamePasswordAuthTypeWorkspaceConnectionProperties", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: Category of the connection. Possible values include: "PythonFeed", "ContainerRegistry", "Git", "FeatureStore". @@ -3446,14 +3489,16 @@ def __init__( """ super(WorkspaceConnectionPropertiesV2, self).__init__(**kwargs) self.auth_type = None # type: Optional[str] - self.category = kwargs.get('category', None) - self.target = kwargs.get('target', None) - self.value = kwargs.get('value', None) - self.value_format = kwargs.get('value_format', None) - self.metadata = kwargs.get('metadata', None) + self.category = kwargs.get("category", None) + self.target = kwargs.get("target", None) + self.value = kwargs.get("value", None) + self.value_format = kwargs.get("value_format", None) + self.metadata = kwargs.get("metadata", None) -class ManagedIdentityAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class ManagedIdentityAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """ManagedIdentityAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -3478,23 +3523,20 @@ class ManagedIdentityAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPr """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'metadata': {'key': 'metadata', 'type': '{object}'}, - 'credentials': {'key': 'credentials', 'type': 'ManagedIdentity'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "metadata": {"key": "metadata", "type": "{object}"}, + "credentials": {"key": "credentials", "type": "ManagedIdentity"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: Category of the connection. Possible values include: "PythonFeed", "ContainerRegistry", "Git", "FeatureStore". @@ -3511,9 +3553,11 @@ def __init__( :keyword credentials: :paramtype credentials: ~azure.mgmt.machinelearningservices.models.ManagedIdentity """ - super(ManagedIdentityAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'ManagedIdentity' # type: str - self.credentials = kwargs.get('credentials', None) + super( + ManagedIdentityAuthTypeWorkspaceConnectionProperties, self + ).__init__(**kwargs) + self.auth_type = "ManagedIdentity" # type: str + self.credentials = kwargs.get("credentials", None) class NodeStateCounts(msrest.serialization.Model): @@ -3536,29 +3580,25 @@ class NodeStateCounts(msrest.serialization.Model): """ _validation = { - 'idle_node_count': {'readonly': True}, - 'running_node_count': {'readonly': True}, - 'preparing_node_count': {'readonly': True}, - 'unusable_node_count': {'readonly': True}, - 'leaving_node_count': {'readonly': True}, - 'preempted_node_count': {'readonly': True}, + "idle_node_count": {"readonly": True}, + "running_node_count": {"readonly": True}, + "preparing_node_count": {"readonly": True}, + "unusable_node_count": {"readonly": True}, + "leaving_node_count": {"readonly": True}, + "preempted_node_count": {"readonly": True}, } _attribute_map = { - 'idle_node_count': {'key': 'idleNodeCount', 'type': 'int'}, - 'running_node_count': {'key': 'runningNodeCount', 'type': 'int'}, - 'preparing_node_count': {'key': 'preparingNodeCount', 'type': 'int'}, - 'unusable_node_count': {'key': 'unusableNodeCount', 'type': 'int'}, - 'leaving_node_count': {'key': 'leavingNodeCount', 'type': 'int'}, - 'preempted_node_count': {'key': 'preemptedNodeCount', 'type': 'int'}, + "idle_node_count": {"key": "idleNodeCount", "type": "int"}, + "running_node_count": {"key": "runningNodeCount", "type": "int"}, + "preparing_node_count": {"key": "preparingNodeCount", "type": "int"}, + "unusable_node_count": {"key": "unusableNodeCount", "type": "int"}, + "leaving_node_count": {"key": "leavingNodeCount", "type": "int"}, + "preempted_node_count": {"key": "preemptedNodeCount", "type": "int"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NodeStateCounts, self).__init__(**kwargs) self.idle_node_count = None self.running_node_count = None @@ -3568,7 +3608,9 @@ def __init__( self.preempted_node_count = None -class NoneAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class NoneAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """NoneAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -3591,22 +3633,19 @@ class NoneAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2) """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'metadata': {'key': 'metadata', 'type': '{object}'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "metadata": {"key": "metadata", "type": "{object}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: Category of the connection. Possible values include: "PythonFeed", "ContainerRegistry", "Git", "FeatureStore". @@ -3621,8 +3660,10 @@ def __init__( :keyword metadata: Other Metadata that we would like to store with workspace connection. :paramtype metadata: dict[str, any] """ - super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'None' # type: str + super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__( + **kwargs + ) + self.auth_type = "None" # type: str class NotebookAccessTokenResult(msrest.serialization.Model): @@ -3649,33 +3690,29 @@ class NotebookAccessTokenResult(msrest.serialization.Model): """ _validation = { - 'notebook_resource_id': {'readonly': True}, - 'host_name': {'readonly': True}, - 'public_dns': {'readonly': True}, - 'access_token': {'readonly': True}, - 'token_type': {'readonly': True}, - 'expires_in': {'readonly': True}, - 'refresh_token': {'readonly': True}, - 'scope': {'readonly': True}, + "notebook_resource_id": {"readonly": True}, + "host_name": {"readonly": True}, + "public_dns": {"readonly": True}, + "access_token": {"readonly": True}, + "token_type": {"readonly": True}, + "expires_in": {"readonly": True}, + "refresh_token": {"readonly": True}, + "scope": {"readonly": True}, } _attribute_map = { - 'notebook_resource_id': {'key': 'notebookResourceId', 'type': 'str'}, - 'host_name': {'key': 'hostName', 'type': 'str'}, - 'public_dns': {'key': 'publicDns', 'type': 'str'}, - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, - 'expires_in': {'key': 'expiresIn', 'type': 'int'}, - 'refresh_token': {'key': 'refreshToken', 'type': 'str'}, - 'scope': {'key': 'scope', 'type': 'str'}, + "notebook_resource_id": {"key": "notebookResourceId", "type": "str"}, + "host_name": {"key": "hostName", "type": "str"}, + "public_dns": {"key": "publicDns", "type": "str"}, + "access_token": {"key": "accessToken", "type": "str"}, + "token_type": {"key": "tokenType", "type": "str"}, + "expires_in": {"key": "expiresIn", "type": "int"}, + "refresh_token": {"key": "refreshToken", "type": "str"}, + "scope": {"key": "scope", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NotebookAccessTokenResult, self).__init__(**kwargs) self.notebook_resource_id = None self.host_name = None @@ -3697,14 +3734,11 @@ class NotebookPreparationError(msrest.serialization.Model): """ _attribute_map = { - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'status_code': {'key': 'statusCode', 'type': 'int'}, + "error_message": {"key": "errorMessage", "type": "str"}, + "status_code": {"key": "statusCode", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword error_message: :paramtype error_message: str @@ -3712,8 +3746,8 @@ def __init__( :paramtype status_code: int """ super(NotebookPreparationError, self).__init__(**kwargs) - self.error_message = kwargs.get('error_message', None) - self.status_code = kwargs.get('status_code', None) + self.error_message = kwargs.get("error_message", None) + self.status_code = kwargs.get("status_code", None) class NotebookResourceInfo(msrest.serialization.Model): @@ -3729,15 +3763,15 @@ class NotebookResourceInfo(msrest.serialization.Model): """ _attribute_map = { - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'notebook_preparation_error': {'key': 'notebookPreparationError', 'type': 'NotebookPreparationError'}, + "fqdn": {"key": "fqdn", "type": "str"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "notebook_preparation_error": { + "key": "notebookPreparationError", + "type": "NotebookPreparationError", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword fqdn: :paramtype fqdn: str @@ -3748,9 +3782,11 @@ def __init__( ~azure.mgmt.machinelearningservices.models.NotebookPreparationError """ super(NotebookResourceInfo, self).__init__(**kwargs) - self.fqdn = kwargs.get('fqdn', None) - self.resource_id = kwargs.get('resource_id', None) - self.notebook_preparation_error = kwargs.get('notebook_preparation_error', None) + self.fqdn = kwargs.get("fqdn", None) + self.resource_id = kwargs.get("resource_id", None) + self.notebook_preparation_error = kwargs.get( + "notebook_preparation_error", None + ) class Operation(msrest.serialization.Model): @@ -3763,14 +3799,11 @@ class Operation(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, + "name": {"key": "name", "type": "str"}, + "display": {"key": "display", "type": "OperationDisplay"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: Operation name: {provider}/{resource}/{operation}. :paramtype name: str @@ -3778,8 +3811,8 @@ def __init__( :paramtype display: ~azure.mgmt.machinelearningservices.models.OperationDisplay """ super(Operation, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display = kwargs.get('display', None) + self.name = kwargs.get("name", None) + self.display = kwargs.get("display", None) class OperationDisplay(msrest.serialization.Model): @@ -3796,16 +3829,13 @@ class OperationDisplay(msrest.serialization.Model): """ _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, + "provider": {"key": "provider", "type": "str"}, + "resource": {"key": "resource", "type": "str"}, + "operation": {"key": "operation", "type": "str"}, + "description": {"key": "description", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword provider: The resource provider name: Microsoft.MachineLearningExperimentation. :paramtype provider: str @@ -3817,10 +3847,10 @@ def __init__( :paramtype description: str """ super(OperationDisplay, self).__init__(**kwargs) - self.provider = kwargs.get('provider', None) - self.resource = kwargs.get('resource', None) - self.operation = kwargs.get('operation', None) - self.description = kwargs.get('description', None) + self.provider = kwargs.get("provider", None) + self.resource = kwargs.get("resource", None) + self.operation = kwargs.get("operation", None) + self.description = kwargs.get("description", None) class OperationListResult(msrest.serialization.Model): @@ -3831,20 +3861,17 @@ class OperationListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, + "value": {"key": "value", "type": "[Operation]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: List of AML workspace operations supported by the AML workspace resource provider. :paramtype value: list[~azure.mgmt.machinelearningservices.models.Operation] """ super(OperationListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class PaginatedComputeResourcesList(msrest.serialization.Model): @@ -3857,14 +3884,11 @@ class PaginatedComputeResourcesList(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[ComputeResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[ComputeResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: An array of Machine Learning compute objects wrapped in ARM resource envelope. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComputeResource] @@ -3872,8 +3896,8 @@ def __init__( :paramtype next_link: str """ super(PaginatedComputeResourcesList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get("value", None) + self.next_link = kwargs.get("next_link", None) class Password(msrest.serialization.Model): @@ -3888,27 +3912,25 @@ class Password(msrest.serialization.Model): """ _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, + "name": {"readonly": True}, + "value": {"readonly": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "value": {"key": "value", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Password, self).__init__(**kwargs) self.name = None self.value = None -class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class PATAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """PATAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -3933,23 +3955,20 @@ class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'metadata': {'key': 'metadata', 'type': '{object}'}, - 'credentials': {'key': 'credentials', 'type': 'PersonalAccessToken'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "metadata": {"key": "metadata", "type": "{object}"}, + "credentials": {"key": "credentials", "type": "PersonalAccessToken"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: Category of the connection. Possible values include: "PythonFeed", "ContainerRegistry", "Git", "FeatureStore". @@ -3966,9 +3985,11 @@ def __init__( :keyword credentials: :paramtype credentials: ~azure.mgmt.machinelearningservices.models.PersonalAccessToken """ - super(PATAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'PAT' # type: str - self.credentials = kwargs.get('credentials', None) + super(PATAuthTypeWorkspaceConnectionProperties, self).__init__( + **kwargs + ) + self.auth_type = "PAT" # type: str + self.credentials = kwargs.get("credentials", None) class PersonalAccessToken(msrest.serialization.Model): @@ -3979,19 +4000,16 @@ class PersonalAccessToken(msrest.serialization.Model): """ _attribute_map = { - 'pat': {'key': 'pat', 'type': 'str'}, + "pat": {"key": "pat", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword pat: :paramtype pat: str """ super(PersonalAccessToken, self).__init__(**kwargs) - self.pat = kwargs.get('pat', None) + self.pat = kwargs.get("pat", None) class PersonalComputeInstanceSettings(msrest.serialization.Model): @@ -4002,19 +4020,16 @@ class PersonalComputeInstanceSettings(msrest.serialization.Model): """ _attribute_map = { - 'assigned_user': {'key': 'assignedUser', 'type': 'AssignedUser'}, + "assigned_user": {"key": "assignedUser", "type": "AssignedUser"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword assigned_user: A user explicitly assigned to a personal compute instance. :paramtype assigned_user: ~azure.mgmt.machinelearningservices.models.AssignedUser """ super(PersonalComputeInstanceSettings, self).__init__(**kwargs) - self.assigned_user = kwargs.get('assigned_user', None) + self.assigned_user = kwargs.get("assigned_user", None) class PrivateEndpoint(msrest.serialization.Model): @@ -4029,21 +4044,17 @@ class PrivateEndpoint(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'subnet_arm_id': {'readonly': True}, + "id": {"readonly": True}, + "subnet_arm_id": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'subnet_arm_id': {'key': 'subnetArmId', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "subnet_arm_id": {"key": "subnetArmId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(PrivateEndpoint, self).__init__(**kwargs) self.id = None self.subnet_arm_id = None @@ -4085,31 +4096,37 @@ class PrivateEndpointConnection(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "identity": {"key": "identity", "type": "Identity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "private_endpoint": { + "key": "properties.privateEndpoint", + "type": "PrivateEndpoint", + }, + "private_link_service_connection_state": { + "key": "properties.privateLinkServiceConnectionState", + "type": "PrivateLinkServiceConnectionState", + }, + "provisioning_state": { + "key": "properties.provisioningState", + "type": "str", + }, + } + + def __init__(self, **kwargs): """ :keyword identity: The identity of the resource. :paramtype identity: ~azure.mgmt.machinelearningservices.models.Identity @@ -4127,13 +4144,15 @@ def __init__( ~azure.mgmt.machinelearningservices.models.PrivateLinkServiceConnectionState """ super(PrivateEndpointConnection, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) + self.identity = kwargs.get("identity", None) + self.location = kwargs.get("location", None) + self.tags = kwargs.get("tags", None) + self.sku = kwargs.get("sku", None) self.system_data = None - self.private_endpoint = kwargs.get('private_endpoint', None) - self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + self.private_endpoint = kwargs.get("private_endpoint", None) + self.private_link_service_connection_state = kwargs.get( + "private_link_service_connection_state", None + ) self.provisioning_state = None @@ -4145,19 +4164,16 @@ class PrivateEndpointConnectionListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + "value": {"key": "value", "type": "[PrivateEndpointConnection]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Array of private endpoint connections. :paramtype value: list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] """ super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class PrivateLinkResource(Resource): @@ -4192,32 +4208,35 @@ class PrivateLinkResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'group_id': {'readonly': True}, - 'required_members': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, - 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "group_id": {"readonly": True}, + "required_members": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "identity": {"key": "identity", "type": "Identity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "group_id": {"key": "properties.groupId", "type": "str"}, + "required_members": { + "key": "properties.requiredMembers", + "type": "[str]", + }, + "required_zone_names": { + "key": "properties.requiredZoneNames", + "type": "[str]", + }, + } + + def __init__(self, **kwargs): """ :keyword identity: The identity of the resource. :paramtype identity: ~azure.mgmt.machinelearningservices.models.Identity @@ -4231,14 +4250,14 @@ def __init__( :paramtype required_zone_names: list[str] """ super(PrivateLinkResource, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) + self.identity = kwargs.get("identity", None) + self.location = kwargs.get("location", None) + self.tags = kwargs.get("tags", None) + self.sku = kwargs.get("sku", None) self.system_data = None self.group_id = None self.required_members = None - self.required_zone_names = kwargs.get('required_zone_names', None) + self.required_zone_names = kwargs.get("required_zone_names", None) class PrivateLinkResourceListResult(msrest.serialization.Model): @@ -4249,19 +4268,16 @@ class PrivateLinkResourceListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + "value": {"key": "value", "type": "[PrivateLinkResource]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Array of private link resources. :paramtype value: list[~azure.mgmt.machinelearningservices.models.PrivateLinkResource] """ super(PrivateLinkResourceListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class PrivateLinkServiceConnectionState(msrest.serialization.Model): @@ -4280,15 +4296,12 @@ class PrivateLinkServiceConnectionState(msrest.serialization.Model): """ _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + "status": {"key": "status", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "actions_required": {"key": "actionsRequired", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword status: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Possible values include: "Pending", "Approved", "Rejected", @@ -4302,9 +4315,9 @@ def __init__( :paramtype actions_required: str """ super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.description = kwargs.get('description', None) - self.actions_required = kwargs.get('actions_required', None) + self.status = kwargs.get("status", None) + self.description = kwargs.get("description", None) + self.actions_required = kwargs.get("actions_required", None) class QuotaBaseProperties(msrest.serialization.Model): @@ -4321,16 +4334,13 @@ class QuotaBaseProperties(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "limit": {"key": "limit", "type": "long"}, + "unit": {"key": "unit", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword id: Specifies the resource ID. :paramtype id: str @@ -4343,10 +4353,10 @@ def __init__( :paramtype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit """ super(QuotaBaseProperties, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.type = kwargs.get('type', None) - self.limit = kwargs.get('limit', None) - self.unit = kwargs.get('unit', None) + self.id = kwargs.get("id", None) + self.type = kwargs.get("type", None) + self.limit = kwargs.get("limit", None) + self.unit = kwargs.get("unit", None) class QuotaUpdateParameters(msrest.serialization.Model): @@ -4359,14 +4369,11 @@ class QuotaUpdateParameters(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[QuotaBaseProperties]'}, - 'location': {'key': 'location', 'type': 'str'}, + "value": {"key": "value", "type": "[QuotaBaseProperties]"}, + "location": {"key": "location", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: The list for update quota. :paramtype value: list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] @@ -4374,8 +4381,8 @@ def __init__( :paramtype location: str """ super(QuotaUpdateParameters, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.location = kwargs.get('location', None) + self.value = kwargs.get("value", None) + self.location = kwargs.get("location", None) class Recurrence(msrest.serialization.Model): @@ -4395,17 +4402,14 @@ class Recurrence(msrest.serialization.Model): """ _attribute_map = { - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceSchedule'}, + "frequency": {"key": "frequency", "type": "str"}, + "interval": {"key": "interval", "type": "int"}, + "start_time": {"key": "startTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "schedule": {"key": "schedule", "type": "RecurrenceSchedule"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword frequency: The recurrence frequency. Possible values include: "NotSpecified", "Second", "Minute", "Hour", "Day", "Week", "Month", "Year". @@ -4420,11 +4424,11 @@ def __init__( :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule """ super(Recurrence, self).__init__(**kwargs) - self.frequency = kwargs.get('frequency', None) - self.interval = kwargs.get('interval', None) - self.start_time = kwargs.get('start_time', None) - self.time_zone = kwargs.get('time_zone', None) - self.schedule = kwargs.get('schedule', None) + self.frequency = kwargs.get("frequency", None) + self.interval = kwargs.get("interval", None) + self.start_time = kwargs.get("start_time", None) + self.time_zone = kwargs.get("time_zone", None) + self.schedule = kwargs.get("schedule", None) class RecurrenceSchedule(msrest.serialization.Model): @@ -4439,15 +4443,12 @@ class RecurrenceSchedule(msrest.serialization.Model): """ _attribute_map = { - 'minutes': {'key': 'minutes', 'type': '[int]'}, - 'hours': {'key': 'hours', 'type': '[int]'}, - 'week_days': {'key': 'weekDays', 'type': '[str]'}, + "minutes": {"key": "minutes", "type": "[int]"}, + "hours": {"key": "hours", "type": "[int]"}, + "week_days": {"key": "weekDays", "type": "[str]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword minutes: The minutes. :paramtype minutes: list[int] @@ -4457,9 +4458,9 @@ def __init__( :paramtype week_days: list[str or ~azure.mgmt.machinelearningservices.models.DaysOfWeek] """ super(RecurrenceSchedule, self).__init__(**kwargs) - self.minutes = kwargs.get('minutes', None) - self.hours = kwargs.get('hours', None) - self.week_days = kwargs.get('week_days', None) + self.minutes = kwargs.get("minutes", None) + self.hours = kwargs.get("hours", None) + self.week_days = kwargs.get("week_days", None) class RegistryListCredentialsResult(msrest.serialization.Model): @@ -4476,20 +4477,17 @@ class RegistryListCredentialsResult(msrest.serialization.Model): """ _validation = { - 'location': {'readonly': True}, - 'username': {'readonly': True}, + "location": {"readonly": True}, + "username": {"readonly": True}, } _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'username': {'key': 'username', 'type': 'str'}, - 'passwords': {'key': 'passwords', 'type': '[Password]'}, + "location": {"key": "location", "type": "str"}, + "username": {"key": "username", "type": "str"}, + "passwords": {"key": "passwords", "type": "[Password]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword passwords: :paramtype passwords: list[~azure.mgmt.machinelearningservices.models.Password] @@ -4497,7 +4495,7 @@ def __init__( super(RegistryListCredentialsResult, self).__init__(**kwargs) self.location = None self.username = None - self.passwords = kwargs.get('passwords', None) + self.passwords = kwargs.get("passwords", None) class ResourceAutoGenerated(msrest.serialization.Model): @@ -4519,25 +4517,21 @@ class ResourceAutoGenerated(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ResourceAutoGenerated, self).__init__(**kwargs) self.id = None self.name = None @@ -4555,23 +4549,20 @@ class ResourceId(msrest.serialization.Model): """ _validation = { - 'id': {'required': True}, + "id": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword id: Required. The ID of the resource. :paramtype id: str """ super(ResourceId, self).__init__(**kwargs) - self.id = kwargs['id'] + self.id = kwargs["id"] class ResourceName(msrest.serialization.Model): @@ -4586,21 +4577,17 @@ class ResourceName(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, + "value": {"readonly": True}, + "localized_value": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + "value": {"key": "value", "type": "str"}, + "localized_value": {"key": "localizedValue", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ResourceName, self).__init__(**kwargs) self.value = None self.localized_value = None @@ -4626,29 +4613,28 @@ class ResourceQuota(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'name': {'readonly': True}, - 'limit': {'readonly': True}, - 'unit': {'readonly': True}, + "id": {"readonly": True}, + "aml_workspace_location": {"readonly": True}, + "type": {"readonly": True}, + "name": {"readonly": True}, + "limit": {"readonly": True}, + "unit": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'ResourceName'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "aml_workspace_location": { + "key": "amlWorkspaceLocation", + "type": "str", + }, + "type": {"key": "type", "type": "str"}, + "name": {"key": "name", "type": "ResourceName"}, + "limit": {"key": "limit", "type": "long"}, + "unit": {"key": "unit", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ResourceQuota, self).__init__(**kwargs) self.id = None self.aml_workspace_location = None @@ -4658,7 +4644,9 @@ def __init__( self.unit = None -class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class SASAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """SASAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -4683,23 +4671,20 @@ class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'metadata': {'key': 'metadata', 'type': '{object}'}, - 'credentials': {'key': 'credentials', 'type': 'SharedAccessSignature'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "metadata": {"key": "metadata", "type": "{object}"}, + "credentials": {"key": "credentials", "type": "SharedAccessSignature"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: Category of the connection. Possible values include: "PythonFeed", "ContainerRegistry", "Git", "FeatureStore". @@ -4716,9 +4701,11 @@ def __init__( :keyword credentials: :paramtype credentials: ~azure.mgmt.machinelearningservices.models.SharedAccessSignature """ - super(SASAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'SAS' # type: str - self.credentials = kwargs.get('credentials', None) + super(SASAuthTypeWorkspaceConnectionProperties, self).__init__( + **kwargs + ) + self.auth_type = "SAS" # type: str + self.credentials = kwargs.get("credentials", None) class ScaleSettings(msrest.serialization.Model): @@ -4736,19 +4723,19 @@ class ScaleSettings(msrest.serialization.Model): """ _validation = { - 'max_node_count': {'required': True}, + "max_node_count": {"required": True}, } _attribute_map = { - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'node_idle_time_before_scale_down': {'key': 'nodeIdleTimeBeforeScaleDown', 'type': 'duration'}, + "max_node_count": {"key": "maxNodeCount", "type": "int"}, + "min_node_count": {"key": "minNodeCount", "type": "int"}, + "node_idle_time_before_scale_down": { + "key": "nodeIdleTimeBeforeScaleDown", + "type": "duration", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword max_node_count: Required. Max number of nodes to use. :paramtype max_node_count: int @@ -4759,9 +4746,11 @@ def __init__( :paramtype node_idle_time_before_scale_down: ~datetime.timedelta """ super(ScaleSettings, self).__init__(**kwargs) - self.max_node_count = kwargs['max_node_count'] - self.min_node_count = kwargs.get('min_node_count', 0) - self.node_idle_time_before_scale_down = kwargs.get('node_idle_time_before_scale_down', None) + self.max_node_count = kwargs["max_node_count"] + self.min_node_count = kwargs.get("min_node_count", 0) + self.node_idle_time_before_scale_down = kwargs.get( + "node_idle_time_before_scale_down", None + ) class ScaleSettingsInformation(msrest.serialization.Model): @@ -4772,19 +4761,16 @@ class ScaleSettingsInformation(msrest.serialization.Model): """ _attribute_map = { - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, + "scale_settings": {"key": "scaleSettings", "type": "ScaleSettings"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword scale_settings: scale settings for AML Compute. :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings """ super(ScaleSettingsInformation, self).__init__(**kwargs) - self.scale_settings = kwargs.get('scale_settings', None) + self.scale_settings = kwargs.get("scale_settings", None) class ScriptReference(msrest.serialization.Model): @@ -4801,16 +4787,13 @@ class ScriptReference(msrest.serialization.Model): """ _attribute_map = { - 'script_source': {'key': 'scriptSource', 'type': 'str'}, - 'script_data': {'key': 'scriptData', 'type': 'str'}, - 'script_arguments': {'key': 'scriptArguments', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'str'}, + "script_source": {"key": "scriptSource", "type": "str"}, + "script_data": {"key": "scriptData", "type": "str"}, + "script_arguments": {"key": "scriptArguments", "type": "str"}, + "timeout": {"key": "timeout", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword script_source: The storage source of the script: inline, workspace. :paramtype script_source: str @@ -4822,10 +4805,10 @@ def __init__( :paramtype timeout: str """ super(ScriptReference, self).__init__(**kwargs) - self.script_source = kwargs.get('script_source', None) - self.script_data = kwargs.get('script_data', None) - self.script_arguments = kwargs.get('script_arguments', None) - self.timeout = kwargs.get('timeout', None) + self.script_source = kwargs.get("script_source", None) + self.script_data = kwargs.get("script_data", None) + self.script_arguments = kwargs.get("script_arguments", None) + self.timeout = kwargs.get("timeout", None) class ScriptsToExecute(msrest.serialization.Model): @@ -4838,14 +4821,14 @@ class ScriptsToExecute(msrest.serialization.Model): """ _attribute_map = { - 'startup_script': {'key': 'startupScript', 'type': 'ScriptReference'}, - 'creation_script': {'key': 'creationScript', 'type': 'ScriptReference'}, + "startup_script": {"key": "startupScript", "type": "ScriptReference"}, + "creation_script": { + "key": "creationScript", + "type": "ScriptReference", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword startup_script: Script that's run every time the machine starts. :paramtype startup_script: ~azure.mgmt.machinelearningservices.models.ScriptReference @@ -4853,8 +4836,8 @@ def __init__( :paramtype creation_script: ~azure.mgmt.machinelearningservices.models.ScriptReference """ super(ScriptsToExecute, self).__init__(**kwargs) - self.startup_script = kwargs.get('startup_script', None) - self.creation_script = kwargs.get('creation_script', None) + self.startup_script = kwargs.get("startup_script", None) + self.creation_script = kwargs.get("creation_script", None) class ServiceManagedResourcesSettings(msrest.serialization.Model): @@ -4865,19 +4848,16 @@ class ServiceManagedResourcesSettings(msrest.serialization.Model): """ _attribute_map = { - 'cosmos_db': {'key': 'cosmosDb', 'type': 'CosmosDbSettings'}, + "cosmos_db": {"key": "cosmosDb", "type": "CosmosDbSettings"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword cosmos_db: The settings for the service managed cosmosdb account. :paramtype cosmos_db: ~azure.mgmt.machinelearningservices.models.CosmosDbSettings """ super(ServiceManagedResourcesSettings, self).__init__(**kwargs) - self.cosmos_db = kwargs.get('cosmos_db', None) + self.cosmos_db = kwargs.get("cosmos_db", None) class ServicePrincipal(msrest.serialization.Model): @@ -4892,15 +4872,12 @@ class ServicePrincipal(msrest.serialization.Model): """ _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + "client_id": {"key": "clientId", "type": "str"}, + "client_secret": {"key": "clientSecret", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword client_id: :paramtype client_id: str @@ -4910,12 +4887,14 @@ def __init__( :paramtype tenant_id: str """ super(ServicePrincipal, self).__init__(**kwargs) - self.client_id = kwargs.get('client_id', None) - self.client_secret = kwargs.get('client_secret', None) - self.tenant_id = kwargs.get('tenant_id', None) + self.client_id = kwargs.get("client_id", None) + self.client_secret = kwargs.get("client_secret", None) + self.tenant_id = kwargs.get("tenant_id", None) -class ServicePrincipalAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class ServicePrincipalAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """ServicePrincipalAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -4940,23 +4919,20 @@ class ServicePrincipalAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionP """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'metadata': {'key': 'metadata', 'type': '{object}'}, - 'credentials': {'key': 'credentials', 'type': 'ServicePrincipal'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "metadata": {"key": "metadata", "type": "{object}"}, + "credentials": {"key": "credentials", "type": "ServicePrincipal"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: Category of the connection. Possible values include: "PythonFeed", "ContainerRegistry", "Git", "FeatureStore". @@ -4973,9 +4949,11 @@ def __init__( :keyword credentials: :paramtype credentials: ~azure.mgmt.machinelearningservices.models.ServicePrincipal """ - super(ServicePrincipalAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'ServicePrincipal' # type: str - self.credentials = kwargs.get('credentials', None) + super( + ServicePrincipalAuthTypeWorkspaceConnectionProperties, self + ).__init__(**kwargs) + self.auth_type = "ServicePrincipal" # type: str + self.credentials = kwargs.get("credentials", None) class ServicePrincipalCredentials(msrest.serialization.Model): @@ -4990,19 +4968,16 @@ class ServicePrincipalCredentials(msrest.serialization.Model): """ _validation = { - 'client_id': {'required': True}, - 'client_secret': {'required': True}, + "client_id": {"required": True}, + "client_secret": {"required": True}, } _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, + "client_id": {"key": "clientId", "type": "str"}, + "client_secret": {"key": "clientSecret", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword client_id: Required. Client Id. :paramtype client_id: str @@ -5010,8 +4985,8 @@ def __init__( :paramtype client_secret: str """ super(ServicePrincipalCredentials, self).__init__(**kwargs) - self.client_id = kwargs['client_id'] - self.client_secret = kwargs['client_secret'] + self.client_id = kwargs["client_id"] + self.client_secret = kwargs["client_secret"] class SetupScripts(msrest.serialization.Model): @@ -5022,19 +4997,16 @@ class SetupScripts(msrest.serialization.Model): """ _attribute_map = { - 'scripts': {'key': 'scripts', 'type': 'ScriptsToExecute'}, + "scripts": {"key": "scripts", "type": "ScriptsToExecute"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword scripts: Customized setup scripts. :paramtype scripts: ~azure.mgmt.machinelearningservices.models.ScriptsToExecute """ super(SetupScripts, self).__init__(**kwargs) - self.scripts = kwargs.get('scripts', None) + self.scripts = kwargs.get("scripts", None) class SharedAccessSignature(msrest.serialization.Model): @@ -5045,19 +5017,16 @@ class SharedAccessSignature(msrest.serialization.Model): """ _attribute_map = { - 'sas': {'key': 'sas', 'type': 'str'}, + "sas": {"key": "sas", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword sas: :paramtype sas: str """ super(SharedAccessSignature, self).__init__(**kwargs) - self.sas = kwargs.get('sas', None) + self.sas = kwargs.get("sas", None) class SharedPrivateLinkResource(msrest.serialization.Model): @@ -5079,17 +5048,17 @@ class SharedPrivateLinkResource(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'private_link_resource_id': {'key': 'properties.privateLinkResourceId', 'type': 'str'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'request_message': {'key': 'properties.requestMessage', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "private_link_resource_id": { + "key": "properties.privateLinkResourceId", + "type": "str", + }, + "group_id": {"key": "properties.groupId", "type": "str"}, + "request_message": {"key": "properties.requestMessage", "type": "str"}, + "status": {"key": "properties.status", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: Unique name of the private link. :paramtype name: str @@ -5106,11 +5075,13 @@ def __init__( ~azure.mgmt.machinelearningservices.models.PrivateEndpointServiceConnectionStatus """ super(SharedPrivateLinkResource, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.private_link_resource_id = kwargs.get('private_link_resource_id', None) - self.group_id = kwargs.get('group_id', None) - self.request_message = kwargs.get('request_message', None) - self.status = kwargs.get('status', None) + self.name = kwargs.get("name", None) + self.private_link_resource_id = kwargs.get( + "private_link_resource_id", None + ) + self.group_id = kwargs.get("group_id", None) + self.request_message = kwargs.get("request_message", None) + self.status = kwargs.get("status", None) class Sku(msrest.serialization.Model): @@ -5123,14 +5094,11 @@ class Sku(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: Name of the sku. :paramtype name: str @@ -5138,8 +5106,8 @@ def __init__( :paramtype tier: str """ super(Sku, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.tier = kwargs.get('tier', None) + self.name = kwargs.get("name", None) + self.tier = kwargs.get("tier", None) class SslConfiguration(msrest.serialization.Model): @@ -5161,18 +5129,18 @@ class SslConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'cert': {'key': 'cert', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - 'cname': {'key': 'cname', 'type': 'str'}, - 'leaf_domain_label': {'key': 'leafDomainLabel', 'type': 'str'}, - 'overwrite_existing_domain': {'key': 'overwriteExistingDomain', 'type': 'bool'}, + "status": {"key": "status", "type": "str"}, + "cert": {"key": "cert", "type": "str"}, + "key": {"key": "key", "type": "str"}, + "cname": {"key": "cname", "type": "str"}, + "leaf_domain_label": {"key": "leafDomainLabel", "type": "str"}, + "overwrite_existing_domain": { + "key": "overwriteExistingDomain", + "type": "bool", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword status: Enable or disable ssl for scoring. Possible values include: "Disabled", "Enabled", "Auto". @@ -5189,12 +5157,14 @@ def __init__( :paramtype overwrite_existing_domain: bool """ super(SslConfiguration, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.cert = kwargs.get('cert', None) - self.key = kwargs.get('key', None) - self.cname = kwargs.get('cname', None) - self.leaf_domain_label = kwargs.get('leaf_domain_label', None) - self.overwrite_existing_domain = kwargs.get('overwrite_existing_domain', None) + self.status = kwargs.get("status", None) + self.cert = kwargs.get("cert", None) + self.key = kwargs.get("key", None) + self.cname = kwargs.get("cname", None) + self.leaf_domain_label = kwargs.get("leaf_domain_label", None) + self.overwrite_existing_domain = kwargs.get( + "overwrite_existing_domain", None + ) class SynapseSpark(Compute): @@ -5236,32 +5206,32 @@ class SynapseSpark(Compute): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'SynapseSparkProperties'}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, + "properties": {"key": "properties", "type": "SynapseSparkProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword compute_location: Location for the underlying compute. :paramtype compute_location: str @@ -5276,8 +5246,8 @@ def __init__( :paramtype properties: ~azure.mgmt.machinelearningservices.models.SynapseSparkProperties """ super(SynapseSpark, self).__init__(**kwargs) - self.compute_type = 'SynapseSpark' # type: str - self.properties = kwargs.get('properties', None) + self.compute_type = "SynapseSpark" # type: str + self.properties = kwargs.get("properties", None) class SynapseSparkProperties(msrest.serialization.Model): @@ -5306,22 +5276,25 @@ class SynapseSparkProperties(msrest.serialization.Model): """ _attribute_map = { - 'auto_scale_properties': {'key': 'autoScaleProperties', 'type': 'AutoScaleProperties'}, - 'auto_pause_properties': {'key': 'autoPauseProperties', 'type': 'AutoPauseProperties'}, - 'spark_version': {'key': 'sparkVersion', 'type': 'str'}, - 'node_count': {'key': 'nodeCount', 'type': 'int'}, - 'node_size': {'key': 'nodeSize', 'type': 'str'}, - 'node_size_family': {'key': 'nodeSizeFamily', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'workspace_name': {'key': 'workspaceName', 'type': 'str'}, - 'pool_name': {'key': 'poolName', 'type': 'str'}, + "auto_scale_properties": { + "key": "autoScaleProperties", + "type": "AutoScaleProperties", + }, + "auto_pause_properties": { + "key": "autoPauseProperties", + "type": "AutoPauseProperties", + }, + "spark_version": {"key": "sparkVersion", "type": "str"}, + "node_count": {"key": "nodeCount", "type": "int"}, + "node_size": {"key": "nodeSize", "type": "str"}, + "node_size_family": {"key": "nodeSizeFamily", "type": "str"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, + "resource_group": {"key": "resourceGroup", "type": "str"}, + "workspace_name": {"key": "workspaceName", "type": "str"}, + "pool_name": {"key": "poolName", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword auto_scale_properties: Auto scale properties. :paramtype auto_scale_properties: @@ -5347,16 +5320,16 @@ def __init__( :paramtype pool_name: str """ super(SynapseSparkProperties, self).__init__(**kwargs) - self.auto_scale_properties = kwargs.get('auto_scale_properties', None) - self.auto_pause_properties = kwargs.get('auto_pause_properties', None) - self.spark_version = kwargs.get('spark_version', None) - self.node_count = kwargs.get('node_count', None) - self.node_size = kwargs.get('node_size', None) - self.node_size_family = kwargs.get('node_size_family', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.resource_group = kwargs.get('resource_group', None) - self.workspace_name = kwargs.get('workspace_name', None) - self.pool_name = kwargs.get('pool_name', None) + self.auto_scale_properties = kwargs.get("auto_scale_properties", None) + self.auto_pause_properties = kwargs.get("auto_pause_properties", None) + self.spark_version = kwargs.get("spark_version", None) + self.node_count = kwargs.get("node_count", None) + self.node_size = kwargs.get("node_size", None) + self.node_size_family = kwargs.get("node_size_family", None) + self.subscription_id = kwargs.get("subscription_id", None) + self.resource_group = kwargs.get("resource_group", None) + self.workspace_name = kwargs.get("workspace_name", None) + self.pool_name = kwargs.get("pool_name", None) class SystemData(msrest.serialization.Model): @@ -5379,18 +5352,15 @@ class SystemData(msrest.serialization.Model): """ _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + "created_by": {"key": "createdBy", "type": "str"}, + "created_by_type": {"key": "createdByType", "type": "str"}, + "created_at": {"key": "createdAt", "type": "iso-8601"}, + "last_modified_by": {"key": "lastModifiedBy", "type": "str"}, + "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"}, + "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword created_by: The identity that created the resource. :paramtype created_by: str @@ -5409,12 +5379,12 @@ def __init__( :paramtype last_modified_at: ~datetime.datetime """ super(SystemData, self).__init__(**kwargs) - self.created_by = kwargs.get('created_by', None) - self.created_by_type = kwargs.get('created_by_type', None) - self.created_at = kwargs.get('created_at', None) - self.last_modified_by = kwargs.get('last_modified_by', None) - self.last_modified_by_type = kwargs.get('last_modified_by_type', None) - self.last_modified_at = kwargs.get('last_modified_at', None) + self.created_by = kwargs.get("created_by", None) + self.created_by_type = kwargs.get("created_by_type", None) + self.created_at = kwargs.get("created_at", None) + self.last_modified_by = kwargs.get("last_modified_by", None) + self.last_modified_by_type = kwargs.get("last_modified_by_type", None) + self.last_modified_at = kwargs.get("last_modified_at", None) class SystemService(msrest.serialization.Model): @@ -5431,23 +5401,19 @@ class SystemService(msrest.serialization.Model): """ _validation = { - 'system_service_type': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'version': {'readonly': True}, + "system_service_type": {"readonly": True}, + "public_ip_address": {"readonly": True}, + "version": {"readonly": True}, } _attribute_map = { - 'system_service_type': {'key': 'systemServiceType', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, + "system_service_type": {"key": "systemServiceType", "type": "str"}, + "public_ip_address": {"key": "publicIpAddress", "type": "str"}, + "version": {"key": "version", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(SystemService, self).__init__(**kwargs) self.system_service_type = None self.public_ip_address = None @@ -5475,23 +5441,20 @@ class UpdateWorkspaceQuotas(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, + "id": {"readonly": True}, + "type": {"readonly": True}, + "unit": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "limit": {"key": "limit", "type": "long"}, + "unit": {"key": "unit", "type": "str"}, + "status": {"key": "status", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword limit: The maximum permitted quota of the resource. :paramtype limit: long @@ -5504,9 +5467,9 @@ def __init__( super(UpdateWorkspaceQuotas, self).__init__(**kwargs) self.id = None self.type = None - self.limit = kwargs.get('limit', None) + self.limit = kwargs.get("limit", None) self.unit = None - self.status = kwargs.get('status', None) + self.status = kwargs.get("status", None) class UpdateWorkspaceQuotasResult(msrest.serialization.Model): @@ -5522,21 +5485,17 @@ class UpdateWorkspaceQuotasResult(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[UpdateWorkspaceQuotas]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[UpdateWorkspaceQuotas]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UpdateWorkspaceQuotasResult, self).__init__(**kwargs) self.value = None self.next_link = None @@ -5564,31 +5523,30 @@ class Usage(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'current_value': {'key': 'currentValue', 'type': 'long'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'name': {'key': 'name', 'type': 'UsageName'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ + "id": {"readonly": True}, + "aml_workspace_location": {"readonly": True}, + "type": {"readonly": True}, + "unit": {"readonly": True}, + "current_value": {"readonly": True}, + "limit": {"readonly": True}, + "name": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "aml_workspace_location": { + "key": "amlWorkspaceLocation", + "type": "str", + }, + "type": {"key": "type", "type": "str"}, + "unit": {"key": "unit", "type": "str"}, + "current_value": {"key": "currentValue", "type": "long"}, + "limit": {"key": "limit", "type": "long"}, + "name": {"key": "name", "type": "UsageName"}, + } + + def __init__(self, **kwargs): + """ """ super(Usage, self).__init__(**kwargs) self.id = None self.aml_workspace_location = None @@ -5611,21 +5569,17 @@ class UsageName(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, + "value": {"readonly": True}, + "localized_value": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + "value": {"key": "value", "type": "str"}, + "localized_value": {"key": "localizedValue", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UsageName, self).__init__(**kwargs) self.value = None self.localized_value = None @@ -5646,19 +5600,19 @@ class UserAccountCredentials(msrest.serialization.Model): """ _validation = { - 'admin_user_name': {'required': True}, + "admin_user_name": {"required": True}, } _attribute_map = { - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'admin_user_ssh_public_key': {'key': 'adminUserSshPublicKey', 'type': 'str'}, - 'admin_user_password': {'key': 'adminUserPassword', 'type': 'str'}, + "admin_user_name": {"key": "adminUserName", "type": "str"}, + "admin_user_ssh_public_key": { + "key": "adminUserSshPublicKey", + "type": "str", + }, + "admin_user_password": {"key": "adminUserPassword", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword admin_user_name: Required. Name of the administrator user account which can be used to SSH to nodes. @@ -5669,9 +5623,11 @@ def __init__( :paramtype admin_user_password: str """ super(UserAccountCredentials, self).__init__(**kwargs) - self.admin_user_name = kwargs['admin_user_name'] - self.admin_user_ssh_public_key = kwargs.get('admin_user_ssh_public_key', None) - self.admin_user_password = kwargs.get('admin_user_password', None) + self.admin_user_name = kwargs["admin_user_name"] + self.admin_user_ssh_public_key = kwargs.get( + "admin_user_ssh_public_key", None + ) + self.admin_user_password = kwargs.get("admin_user_password", None) class UserAssignedIdentity(msrest.serialization.Model): @@ -5688,23 +5644,19 @@ class UserAssignedIdentity(msrest.serialization.Model): """ _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'client_id': {'readonly': True}, + "principal_id": {"readonly": True}, + "tenant_id": {"readonly": True}, + "client_id": {"readonly": True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UserAssignedIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None @@ -5721,14 +5673,11 @@ class UsernamePassword(msrest.serialization.Model): """ _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, + "username": {"key": "username", "type": "str"}, + "password": {"key": "password", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword username: :paramtype username: str @@ -5736,11 +5685,13 @@ def __init__( :paramtype password: str """ super(UsernamePassword, self).__init__(**kwargs) - self.username = kwargs.get('username', None) - self.password = kwargs.get('password', None) + self.username = kwargs.get("username", None) + self.password = kwargs.get("password", None) -class UsernamePasswordAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class UsernamePasswordAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """UsernamePasswordAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -5765,23 +5716,20 @@ class UsernamePasswordAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionP """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'metadata': {'key': 'metadata', 'type': '{object}'}, - 'credentials': {'key': 'credentials', 'type': 'UsernamePassword'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "metadata": {"key": "metadata", "type": "{object}"}, + "credentials": {"key": "credentials", "type": "UsernamePassword"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: Category of the connection. Possible values include: "PythonFeed", "ContainerRegistry", "Git", "FeatureStore". @@ -5798,9 +5746,11 @@ def __init__( :keyword credentials: :paramtype credentials: ~azure.mgmt.machinelearningservices.models.UsernamePassword """ - super(UsernamePasswordAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'UsernamePassword' # type: str - self.credentials = kwargs.get('credentials', None) + super( + UsernamePasswordAuthTypeWorkspaceConnectionProperties, self + ).__init__(**kwargs) + self.auth_type = "UsernamePassword" # type: str + self.credentials = kwargs.get("credentials", None) class VirtualMachine(Compute): @@ -5842,32 +5792,35 @@ class VirtualMachine(Compute): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'VirtualMachineProperties'}, - } - - def __init__( - self, - **kwargs - ): + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + } + + _attribute_map = { + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, + "properties": { + "key": "properties", + "type": "VirtualMachineProperties", + }, + } + + def __init__(self, **kwargs): """ :keyword compute_location: Location for the underlying compute. :paramtype compute_location: str @@ -5882,8 +5835,8 @@ def __init__( :paramtype properties: ~azure.mgmt.machinelearningservices.models.VirtualMachineProperties """ super(VirtualMachine, self).__init__(**kwargs) - self.compute_type = 'VirtualMachine' # type: str - self.properties = kwargs.get('properties', None) + self.compute_type = "VirtualMachine" # type: str + self.properties = kwargs.get("properties", None) class VirtualMachineImage(msrest.serialization.Model): @@ -5896,23 +5849,20 @@ class VirtualMachineImage(msrest.serialization.Model): """ _validation = { - 'id': {'required': True}, + "id": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword id: Required. Virtual Machine image path. :paramtype id: str """ super(VirtualMachineImage, self).__init__(**kwargs) - self.id = kwargs['id'] + self.id = kwargs["id"] class VirtualMachineProperties(msrest.serialization.Model): @@ -5933,17 +5883,20 @@ class VirtualMachineProperties(msrest.serialization.Model): """ _attribute_map = { - 'virtual_machine_size': {'key': 'virtualMachineSize', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'is_notebook_instance_compute': {'key': 'isNotebookInstanceCompute', 'type': 'bool'}, + "virtual_machine_size": {"key": "virtualMachineSize", "type": "str"}, + "ssh_port": {"key": "sshPort", "type": "int"}, + "address": {"key": "address", "type": "str"}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, + "is_notebook_instance_compute": { + "key": "isNotebookInstanceCompute", + "type": "bool", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword virtual_machine_size: Virtual Machine size. :paramtype virtual_machine_size: str @@ -5959,11 +5912,13 @@ def __init__( :paramtype is_notebook_instance_compute: bool """ super(VirtualMachineProperties, self).__init__(**kwargs) - self.virtual_machine_size = kwargs.get('virtual_machine_size', None) - self.ssh_port = kwargs.get('ssh_port', None) - self.address = kwargs.get('address', None) - self.administrator_account = kwargs.get('administrator_account', None) - self.is_notebook_instance_compute = kwargs.get('is_notebook_instance_compute', None) + self.virtual_machine_size = kwargs.get("virtual_machine_size", None) + self.ssh_port = kwargs.get("ssh_port", None) + self.address = kwargs.get("address", None) + self.administrator_account = kwargs.get("administrator_account", None) + self.is_notebook_instance_compute = kwargs.get( + "is_notebook_instance_compute", None + ) class VirtualMachineSecrets(ComputeSecrets): @@ -5981,26 +5936,26 @@ class VirtualMachineSecrets(ComputeSecrets): """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, + "compute_type": {"key": "computeType", "type": "str"}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword administrator_account: Admin credentials for virtual machine. :paramtype administrator_account: ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials """ super(VirtualMachineSecrets, self).__init__(**kwargs) - self.compute_type = 'VirtualMachine' # type: str - self.administrator_account = kwargs.get('administrator_account', None) + self.compute_type = "VirtualMachine" # type: str + self.administrator_account = kwargs.get("administrator_account", None) class VirtualMachineSize(msrest.serialization.Model): @@ -6035,35 +5990,41 @@ class VirtualMachineSize(msrest.serialization.Model): """ _validation = { - 'name': {'readonly': True}, - 'family': {'readonly': True}, - 'v_cp_us': {'readonly': True}, - 'gpus': {'readonly': True}, - 'os_vhd_size_mb': {'readonly': True}, - 'max_resource_volume_mb': {'readonly': True}, - 'memory_gb': {'readonly': True}, - 'low_priority_capable': {'readonly': True}, - 'premium_io': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'v_cp_us': {'key': 'vCPUs', 'type': 'int'}, - 'gpus': {'key': 'gpus', 'type': 'int'}, - 'os_vhd_size_mb': {'key': 'osVhdSizeMB', 'type': 'int'}, - 'max_resource_volume_mb': {'key': 'maxResourceVolumeMB', 'type': 'int'}, - 'memory_gb': {'key': 'memoryGB', 'type': 'float'}, - 'low_priority_capable': {'key': 'lowPriorityCapable', 'type': 'bool'}, - 'premium_io': {'key': 'premiumIO', 'type': 'bool'}, - 'estimated_vm_prices': {'key': 'estimatedVMPrices', 'type': 'EstimatedVMPrices'}, - 'supported_compute_types': {'key': 'supportedComputeTypes', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): + "name": {"readonly": True}, + "family": {"readonly": True}, + "v_cp_us": {"readonly": True}, + "gpus": {"readonly": True}, + "os_vhd_size_mb": {"readonly": True}, + "max_resource_volume_mb": {"readonly": True}, + "memory_gb": {"readonly": True}, + "low_priority_capable": {"readonly": True}, + "premium_io": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "family": {"key": "family", "type": "str"}, + "v_cp_us": {"key": "vCPUs", "type": "int"}, + "gpus": {"key": "gpus", "type": "int"}, + "os_vhd_size_mb": {"key": "osVhdSizeMB", "type": "int"}, + "max_resource_volume_mb": { + "key": "maxResourceVolumeMB", + "type": "int", + }, + "memory_gb": {"key": "memoryGB", "type": "float"}, + "low_priority_capable": {"key": "lowPriorityCapable", "type": "bool"}, + "premium_io": {"key": "premiumIO", "type": "bool"}, + "estimated_vm_prices": { + "key": "estimatedVMPrices", + "type": "EstimatedVMPrices", + }, + "supported_compute_types": { + "key": "supportedComputeTypes", + "type": "[str]", + }, + } + + def __init__(self, **kwargs): """ :keyword estimated_vm_prices: The estimated price information for using a VM. :paramtype estimated_vm_prices: ~azure.mgmt.machinelearningservices.models.EstimatedVMPrices @@ -6081,8 +6042,10 @@ def __init__( self.memory_gb = None self.low_priority_capable = None self.premium_io = None - self.estimated_vm_prices = kwargs.get('estimated_vm_prices', None) - self.supported_compute_types = kwargs.get('supported_compute_types', None) + self.estimated_vm_prices = kwargs.get("estimated_vm_prices", None) + self.supported_compute_types = kwargs.get( + "supported_compute_types", None + ) class VirtualMachineSizeListResult(msrest.serialization.Model): @@ -6093,19 +6056,16 @@ class VirtualMachineSizeListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[VirtualMachineSize]'}, + "value": {"key": "value", "type": "[VirtualMachineSize]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: The list of virtual machine sizes supported by AmlCompute. :paramtype value: list[~azure.mgmt.machinelearningservices.models.VirtualMachineSize] """ super(VirtualMachineSizeListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class VirtualMachineSshCredentials(msrest.serialization.Model): @@ -6122,16 +6082,13 @@ class VirtualMachineSshCredentials(msrest.serialization.Model): """ _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'public_key_data': {'key': 'publicKeyData', 'type': 'str'}, - 'private_key_data': {'key': 'privateKeyData', 'type': 'str'}, + "username": {"key": "username", "type": "str"}, + "password": {"key": "password", "type": "str"}, + "public_key_data": {"key": "publicKeyData", "type": "str"}, + "private_key_data": {"key": "privateKeyData", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword username: Username of admin account. :paramtype username: str @@ -6143,10 +6100,10 @@ def __init__( :paramtype private_key_data: str """ super(VirtualMachineSshCredentials, self).__init__(**kwargs) - self.username = kwargs.get('username', None) - self.password = kwargs.get('password', None) - self.public_key_data = kwargs.get('public_key_data', None) - self.private_key_data = kwargs.get('private_key_data', None) + self.username = kwargs.get("username", None) + self.password = kwargs.get("password", None) + self.public_key_data = kwargs.get("public_key_data", None) + self.private_key_data = kwargs.get("private_key_data", None) class Workspace(Resource): @@ -6251,62 +6208,113 @@ class Workspace(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'workspace_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'service_provisioned_resource_group': {'readonly': True}, - 'private_link_count': {'readonly': True}, - 'private_endpoint_connections': {'readonly': True}, - 'notebook_info': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'storage_hns_enabled': {'readonly': True}, - 'ml_flow_tracking_uri': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'key_vault': {'key': 'properties.keyVault', 'type': 'str'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'storage_account': {'key': 'properties.storageAccount', 'type': 'str'}, - 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionProperty'}, - 'hbi_workspace': {'key': 'properties.hbiWorkspace', 'type': 'bool'}, - 'soft_delete_enabled': {'key': 'properties.softDeleteEnabled', 'type': 'str'}, - 'allow_recover_soft_deleted_workspace': {'key': 'properties.allowRecoverSoftDeletedWorkspace', 'type': 'str'}, - 'service_provisioned_resource_group': {'key': 'properties.serviceProvisionedResourceGroup', 'type': 'str'}, - 'private_link_count': {'key': 'properties.privateLinkCount', 'type': 'int'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'allow_public_access_when_behind_vnet': {'key': 'properties.allowPublicAccessWhenBehindVnet', 'type': 'bool'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, - 'shared_private_link_resources': {'key': 'properties.sharedPrivateLinkResources', 'type': '[SharedPrivateLinkResource]'}, - 'notebook_info': {'key': 'properties.notebookInfo', 'type': 'NotebookResourceInfo'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, - 'storage_hns_enabled': {'key': 'properties.storageHnsEnabled', 'type': 'bool'}, - 'ml_flow_tracking_uri': {'key': 'properties.mlFlowTrackingUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "workspace_id": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "service_provisioned_resource_group": {"readonly": True}, + "private_link_count": {"readonly": True}, + "private_endpoint_connections": {"readonly": True}, + "notebook_info": {"readonly": True}, + "tenant_id": {"readonly": True}, + "storage_hns_enabled": {"readonly": True}, + "ml_flow_tracking_uri": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "identity": {"key": "identity", "type": "Identity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "workspace_id": {"key": "properties.workspaceId", "type": "str"}, + "description": {"key": "properties.description", "type": "str"}, + "friendly_name": {"key": "properties.friendlyName", "type": "str"}, + "key_vault": {"key": "properties.keyVault", "type": "str"}, + "application_insights": { + "key": "properties.applicationInsights", + "type": "str", + }, + "container_registry": { + "key": "properties.containerRegistry", + "type": "str", + }, + "storage_account": {"key": "properties.storageAccount", "type": "str"}, + "discovery_url": {"key": "properties.discoveryUrl", "type": "str"}, + "provisioning_state": { + "key": "properties.provisioningState", + "type": "str", + }, + "encryption": { + "key": "properties.encryption", + "type": "EncryptionProperty", + }, + "hbi_workspace": {"key": "properties.hbiWorkspace", "type": "bool"}, + "soft_delete_enabled": { + "key": "properties.softDeleteEnabled", + "type": "str", + }, + "allow_recover_soft_deleted_workspace": { + "key": "properties.allowRecoverSoftDeletedWorkspace", + "type": "str", + }, + "service_provisioned_resource_group": { + "key": "properties.serviceProvisionedResourceGroup", + "type": "str", + }, + "private_link_count": { + "key": "properties.privateLinkCount", + "type": "int", + }, + "image_build_compute": { + "key": "properties.imageBuildCompute", + "type": "str", + }, + "allow_public_access_when_behind_vnet": { + "key": "properties.allowPublicAccessWhenBehindVnet", + "type": "bool", + }, + "public_network_access": { + "key": "properties.publicNetworkAccess", + "type": "str", + }, + "private_endpoint_connections": { + "key": "properties.privateEndpointConnections", + "type": "[PrivateEndpointConnection]", + }, + "shared_private_link_resources": { + "key": "properties.sharedPrivateLinkResources", + "type": "[SharedPrivateLinkResource]", + }, + "notebook_info": { + "key": "properties.notebookInfo", + "type": "NotebookResourceInfo", + }, + "service_managed_resources_settings": { + "key": "properties.serviceManagedResourcesSettings", + "type": "ServiceManagedResourcesSettings", + }, + "primary_user_assigned_identity": { + "key": "properties.primaryUserAssignedIdentity", + "type": "str", + }, + "tenant_id": {"key": "properties.tenantId", "type": "str"}, + "storage_hns_enabled": { + "key": "properties.storageHnsEnabled", + "type": "bool", + }, + "ml_flow_tracking_uri": { + "key": "properties.mlFlowTrackingUri", + "type": "str", + }, + } + + def __init__(self, **kwargs): """ :keyword identity: The identity of the resource. :paramtype identity: ~azure.mgmt.machinelearningservices.models.Identity @@ -6369,34 +6377,44 @@ def __init__( :paramtype primary_user_assigned_identity: str """ super(Workspace, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) + self.identity = kwargs.get("identity", None) + self.location = kwargs.get("location", None) + self.tags = kwargs.get("tags", None) + self.sku = kwargs.get("sku", None) self.system_data = None self.workspace_id = None - self.description = kwargs.get('description', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.key_vault = kwargs.get('key_vault', None) - self.application_insights = kwargs.get('application_insights', None) - self.container_registry = kwargs.get('container_registry', None) - self.storage_account = kwargs.get('storage_account', None) - self.discovery_url = kwargs.get('discovery_url', None) + self.description = kwargs.get("description", None) + self.friendly_name = kwargs.get("friendly_name", None) + self.key_vault = kwargs.get("key_vault", None) + self.application_insights = kwargs.get("application_insights", None) + self.container_registry = kwargs.get("container_registry", None) + self.storage_account = kwargs.get("storage_account", None) + self.discovery_url = kwargs.get("discovery_url", None) self.provisioning_state = None - self.encryption = kwargs.get('encryption', None) - self.hbi_workspace = kwargs.get('hbi_workspace', False) - self.soft_delete_enabled = kwargs.get('soft_delete_enabled', None) - self.allow_recover_soft_deleted_workspace = kwargs.get('allow_recover_soft_deleted_workspace', None) + self.encryption = kwargs.get("encryption", None) + self.hbi_workspace = kwargs.get("hbi_workspace", False) + self.soft_delete_enabled = kwargs.get("soft_delete_enabled", None) + self.allow_recover_soft_deleted_workspace = kwargs.get( + "allow_recover_soft_deleted_workspace", None + ) self.service_provisioned_resource_group = None self.private_link_count = None - self.image_build_compute = kwargs.get('image_build_compute', None) - self.allow_public_access_when_behind_vnet = kwargs.get('allow_public_access_when_behind_vnet', False) - self.public_network_access = kwargs.get('public_network_access', None) + self.image_build_compute = kwargs.get("image_build_compute", None) + self.allow_public_access_when_behind_vnet = kwargs.get( + "allow_public_access_when_behind_vnet", False + ) + self.public_network_access = kwargs.get("public_network_access", None) self.private_endpoint_connections = None - self.shared_private_link_resources = kwargs.get('shared_private_link_resources', None) + self.shared_private_link_resources = kwargs.get( + "shared_private_link_resources", None + ) self.notebook_info = None - self.service_managed_resources_settings = kwargs.get('service_managed_resources_settings', None) - self.primary_user_assigned_identity = kwargs.get('primary_user_assigned_identity', None) + self.service_managed_resources_settings = kwargs.get( + "service_managed_resources_settings", None + ) + self.primary_user_assigned_identity = kwargs.get( + "primary_user_assigned_identity", None + ) self.tenant_id = None self.storage_hns_enabled = None self.ml_flow_tracking_uri = None @@ -6425,35 +6443,39 @@ class WorkspaceConnectionPropertiesV2BasicResource(ResourceAutoGenerated): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'WorkspaceConnectionPropertiesV2'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "WorkspaceConnectionPropertiesV2", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. :paramtype properties: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 """ - super(WorkspaceConnectionPropertiesV2BasicResource, self).__init__(**kwargs) - self.properties = kwargs['properties'] + super(WorkspaceConnectionPropertiesV2BasicResource, self).__init__( + **kwargs + ) + self.properties = kwargs["properties"] -class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(msrest.serialization.Model): +class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult( + msrest.serialization.Model +): """WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult. Variables are only populated by the server, and will be ignored when sending a request. @@ -6466,25 +6488,28 @@ class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(msrest.seri """ _validation = { - 'next_link': {'readonly': True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[WorkspaceConnectionPropertiesV2BasicResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": { + "key": "value", + "type": "[WorkspaceConnectionPropertiesV2BasicResource]", + }, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: :paramtype value: list[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource] """ - super(WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + super( + WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, + self, + ).__init__(**kwargs) + self.value = kwargs.get("value", None) self.next_link = None @@ -6500,14 +6525,11 @@ class WorkspaceListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[Workspace]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Workspace]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: The list of machine learning workspaces. Since this list may be incomplete, the nextLink field should be used to request the next list of machine learning workspaces. @@ -6517,8 +6539,8 @@ def __init__( :paramtype next_link: str """ super(WorkspaceListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get("value", None) + self.next_link = kwargs.get("next_link", None) class WorkspaceUpdateParameters(msrest.serialization.Model): @@ -6549,21 +6571,30 @@ class WorkspaceUpdateParameters(msrest.serialization.Model): """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "identity": {"key": "identity", "type": "Identity"}, + "description": {"key": "properties.description", "type": "str"}, + "friendly_name": {"key": "properties.friendlyName", "type": "str"}, + "image_build_compute": { + "key": "properties.imageBuildCompute", + "type": "str", + }, + "service_managed_resources_settings": { + "key": "properties.serviceManagedResourcesSettings", + "type": "ServiceManagedResourcesSettings", + }, + "primary_user_assigned_identity": { + "key": "properties.primaryUserAssignedIdentity", + "type": "str", + }, + "public_network_access": { + "key": "properties.publicNetworkAccess", + "type": "str", + }, + } + + def __init__(self, **kwargs): """ :keyword tags: A set of tags. The resource tags for the machine learning workspace. :paramtype tags: dict[str, str] @@ -6589,12 +6620,16 @@ def __init__( ~azure.mgmt.machinelearningservices.models.PublicNetworkAccess """ super(WorkspaceUpdateParameters, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) - self.identity = kwargs.get('identity', None) - self.description = kwargs.get('description', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.image_build_compute = kwargs.get('image_build_compute', None) - self.service_managed_resources_settings = kwargs.get('service_managed_resources_settings', None) - self.primary_user_assigned_identity = kwargs.get('primary_user_assigned_identity', None) - self.public_network_access = kwargs.get('public_network_access', None) + self.tags = kwargs.get("tags", None) + self.sku = kwargs.get("sku", None) + self.identity = kwargs.get("identity", None) + self.description = kwargs.get("description", None) + self.friendly_name = kwargs.get("friendly_name", None) + self.image_build_compute = kwargs.get("image_build_compute", None) + self.service_managed_resources_settings = kwargs.get( + "service_managed_resources_settings", None + ) + self.primary_user_assigned_identity = kwargs.get( + "primary_user_assigned_identity", None + ) + self.public_network_access = kwargs.get("public_network_access", None) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/models/_models_py3.py index ccb9c8d912c3..83b3f52947cf 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/models/_models_py3.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/models/_models_py3.py @@ -55,29 +55,43 @@ class Compute(msrest.serialization.Model): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + } + + _attribute_map = { + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } _subtype_map = { - 'compute_type': {'AKS': 'AKS', 'AmlCompute': 'AmlCompute', 'ComputeInstance': 'ComputeInstance', 'DataFactory': 'DataFactory', 'DataLakeAnalytics': 'DataLakeAnalytics', 'Databricks': 'Databricks', 'HDInsight': 'HDInsight', 'Kubernetes': 'Kubernetes', 'SynapseSpark': 'SynapseSpark', 'VirtualMachine': 'VirtualMachine'} + "compute_type": { + "AKS": "AKS", + "AmlCompute": "AmlCompute", + "ComputeInstance": "ComputeInstance", + "DataFactory": "DataFactory", + "DataLakeAnalytics": "DataLakeAnalytics", + "Databricks": "Databricks", + "HDInsight": "HDInsight", + "Kubernetes": "Kubernetes", + "SynapseSpark": "SynapseSpark", + "VirtualMachine": "VirtualMachine", + } } def __init__( @@ -152,26 +166,29 @@ class AKS(Compute): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'AKSProperties'}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, + "properties": {"key": "properties", "type": "AKSProperties"}, } def __init__( @@ -197,8 +214,14 @@ def __init__( :keyword properties: AKS properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.AKSProperties """ - super(AKS, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, **kwargs) - self.compute_type = 'AKS' # type: str + super(AKS, self).__init__( + compute_location=compute_location, + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + **kwargs + ) + self.compute_type = "AKS" # type: str self.properties = properties @@ -216,9 +239,12 @@ class AksComputeSecretsProperties(msrest.serialization.Model): """ _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, + "user_kube_config": {"key": "userKubeConfig", "type": "str"}, + "admin_kube_config": {"key": "adminKubeConfig", "type": "str"}, + "image_pull_secret_name": { + "key": "imagePullSecretName", + "type": "str", + }, } def __init__( @@ -260,23 +286,23 @@ class ComputeSecrets(msrest.serialization.Model): """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "compute_type": {"key": "computeType", "type": "str"}, } _subtype_map = { - 'compute_type': {'AKS': 'AksComputeSecrets', 'Databricks': 'DatabricksComputeSecrets', 'VirtualMachine': 'VirtualMachineSecrets'} + "compute_type": { + "AKS": "AksComputeSecrets", + "Databricks": "DatabricksComputeSecrets", + "VirtualMachine": "VirtualMachineSecrets", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ComputeSecrets, self).__init__(**kwargs) self.compute_type = None # type: Optional[str] @@ -301,14 +327,17 @@ class AksComputeSecrets(ComputeSecrets, AksComputeSecretsProperties): """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "user_kube_config": {"key": "userKubeConfig", "type": "str"}, + "admin_kube_config": {"key": "adminKubeConfig", "type": "str"}, + "image_pull_secret_name": { + "key": "imagePullSecretName", + "type": "str", + }, + "compute_type": {"key": "computeType", "type": "str"}, } def __init__( @@ -329,12 +358,17 @@ def __init__( :keyword image_pull_secret_name: Image registry pull secret. :paramtype image_pull_secret_name: str """ - super(AksComputeSecrets, self).__init__(user_kube_config=user_kube_config, admin_kube_config=admin_kube_config, image_pull_secret_name=image_pull_secret_name, **kwargs) + super(AksComputeSecrets, self).__init__( + user_kube_config=user_kube_config, + admin_kube_config=admin_kube_config, + image_pull_secret_name=image_pull_secret_name, + **kwargs + ) self.user_kube_config = user_kube_config self.admin_kube_config = admin_kube_config self.image_pull_secret_name = image_pull_secret_name - self.compute_type = 'AKS' # type: str - self.compute_type = 'AKS' # type: str + self.compute_type = "AKS" # type: str + self.compute_type = "AKS" # type: str class AksNetworkingConfiguration(msrest.serialization.Model): @@ -354,16 +388,22 @@ class AksNetworkingConfiguration(msrest.serialization.Model): """ _validation = { - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, + "service_cidr": { + "pattern": r"^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$" + }, + "dns_service_ip": { + "pattern": r"^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" + }, + "docker_bridge_cidr": { + "pattern": r"^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$" + }, } _attribute_map = { - 'subnet_id': {'key': 'subnetId', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, + "subnet_id": {"key": "subnetId", "type": "str"}, + "service_cidr": {"key": "serviceCidr", "type": "str"}, + "dns_service_ip": {"key": "dnsServiceIP", "type": "str"}, + "docker_bridge_cidr": {"key": "dockerBridgeCidr", "type": "str"}, } def __init__( @@ -424,20 +464,29 @@ class AKSProperties(msrest.serialization.Model): """ _validation = { - 'system_services': {'readonly': True}, - 'agent_count': {'minimum': 0}, + "system_services": {"readonly": True}, + "agent_count": {"minimum": 0}, } _attribute_map = { - 'cluster_fqdn': {'key': 'clusterFqdn', 'type': 'str'}, - 'system_services': {'key': 'systemServices', 'type': '[SystemService]'}, - 'agent_count': {'key': 'agentCount', 'type': 'int'}, - 'agent_vm_size': {'key': 'agentVmSize', 'type': 'str'}, - 'cluster_purpose': {'key': 'clusterPurpose', 'type': 'str'}, - 'ssl_configuration': {'key': 'sslConfiguration', 'type': 'SslConfiguration'}, - 'aks_networking_configuration': {'key': 'aksNetworkingConfiguration', 'type': 'AksNetworkingConfiguration'}, - 'load_balancer_type': {'key': 'loadBalancerType', 'type': 'str'}, - 'load_balancer_subnet': {'key': 'loadBalancerSubnet', 'type': 'str'}, + "cluster_fqdn": {"key": "clusterFqdn", "type": "str"}, + "system_services": { + "key": "systemServices", + "type": "[SystemService]", + }, + "agent_count": {"key": "agentCount", "type": "int"}, + "agent_vm_size": {"key": "agentVmSize", "type": "str"}, + "cluster_purpose": {"key": "clusterPurpose", "type": "str"}, + "ssl_configuration": { + "key": "sslConfiguration", + "type": "SslConfiguration", + }, + "aks_networking_configuration": { + "key": "aksNetworkingConfiguration", + "type": "AksNetworkingConfiguration", + }, + "load_balancer_type": {"key": "loadBalancerType", "type": "str"}, + "load_balancer_subnet": {"key": "loadBalancerSubnet", "type": "str"}, } def __init__( @@ -448,8 +497,12 @@ def __init__( agent_vm_size: Optional[str] = None, cluster_purpose: Optional[Union[str, "ClusterPurpose"]] = "FastProd", ssl_configuration: Optional["SslConfiguration"] = None, - aks_networking_configuration: Optional["AksNetworkingConfiguration"] = None, - load_balancer_type: Optional[Union[str, "LoadBalancerType"]] = "PublicIp", + aks_networking_configuration: Optional[ + "AksNetworkingConfiguration" + ] = None, + load_balancer_type: Optional[ + Union[str, "LoadBalancerType"] + ] = "PublicIp", load_balancer_subnet: Optional[str] = None, **kwargs ): @@ -526,26 +579,29 @@ class AmlCompute(Compute): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, + "properties": {"key": "properties", "type": "AmlComputeProperties"}, } def __init__( @@ -571,8 +627,14 @@ def __init__( :keyword properties: Properties of AmlCompute. :paramtype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties """ - super(AmlCompute, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, **kwargs) - self.compute_type = 'AmlCompute' # type: str + super(AmlCompute, self).__init__( + compute_location=compute_location, + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + **kwargs + ) + self.compute_type = "AmlCompute" # type: str self.properties = properties @@ -598,29 +660,25 @@ class AmlComputeNodeInformation(msrest.serialization.Model): """ _validation = { - 'node_id': {'readonly': True}, - 'private_ip_address': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'port': {'readonly': True}, - 'node_state': {'readonly': True}, - 'run_id': {'readonly': True}, + "node_id": {"readonly": True}, + "private_ip_address": {"readonly": True}, + "public_ip_address": {"readonly": True}, + "port": {"readonly": True}, + "node_state": {"readonly": True}, + "run_id": {"readonly": True}, } _attribute_map = { - 'node_id': {'key': 'nodeId', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'node_state': {'key': 'nodeState', 'type': 'str'}, - 'run_id': {'key': 'runId', 'type': 'str'}, + "node_id": {"key": "nodeId", "type": "str"}, + "private_ip_address": {"key": "privateIpAddress", "type": "str"}, + "public_ip_address": {"key": "publicIpAddress", "type": "str"}, + "port": {"key": "port", "type": "int"}, + "node_state": {"key": "nodeState", "type": "str"}, + "run_id": {"key": "runId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AmlComputeNodeInformation, self).__init__(**kwargs) self.node_id = None self.private_ip_address = None @@ -642,21 +700,17 @@ class AmlComputeNodesInformation(msrest.serialization.Model): """ _validation = { - 'nodes': {'readonly': True}, - 'next_link': {'readonly': True}, + "nodes": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'nodes': {'key': 'nodes', 'type': '[AmlComputeNodeInformation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "nodes": {"key": "nodes", "type": "[AmlComputeNodeInformation]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AmlComputeNodesInformation, self).__init__(**kwargs) self.nodes = None self.next_link = None @@ -725,31 +779,46 @@ class AmlComputeProperties(msrest.serialization.Model): """ _validation = { - 'allocation_state': {'readonly': True}, - 'allocation_state_transition_time': {'readonly': True}, - 'errors': {'readonly': True}, - 'current_node_count': {'readonly': True}, - 'target_node_count': {'readonly': True}, - 'node_state_counts': {'readonly': True}, - } - - _attribute_map = { - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'vm_priority': {'key': 'vmPriority', 'type': 'str'}, - 'virtual_machine_image': {'key': 'virtualMachineImage', 'type': 'VirtualMachineImage'}, - 'isolated_network': {'key': 'isolatedNetwork', 'type': 'bool'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, - 'user_account_credentials': {'key': 'userAccountCredentials', 'type': 'UserAccountCredentials'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'remote_login_port_public_access': {'key': 'remoteLoginPortPublicAccess', 'type': 'str'}, - 'allocation_state': {'key': 'allocationState', 'type': 'str'}, - 'allocation_state_transition_time': {'key': 'allocationStateTransitionTime', 'type': 'iso-8601'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'current_node_count': {'key': 'currentNodeCount', 'type': 'int'}, - 'target_node_count': {'key': 'targetNodeCount', 'type': 'int'}, - 'node_state_counts': {'key': 'nodeStateCounts', 'type': 'NodeStateCounts'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, + "allocation_state": {"readonly": True}, + "allocation_state_transition_time": {"readonly": True}, + "errors": {"readonly": True}, + "current_node_count": {"readonly": True}, + "target_node_count": {"readonly": True}, + "node_state_counts": {"readonly": True}, + } + + _attribute_map = { + "os_type": {"key": "osType", "type": "str"}, + "vm_size": {"key": "vmSize", "type": "str"}, + "vm_priority": {"key": "vmPriority", "type": "str"}, + "virtual_machine_image": { + "key": "virtualMachineImage", + "type": "VirtualMachineImage", + }, + "isolated_network": {"key": "isolatedNetwork", "type": "bool"}, + "scale_settings": {"key": "scaleSettings", "type": "ScaleSettings"}, + "user_account_credentials": { + "key": "userAccountCredentials", + "type": "UserAccountCredentials", + }, + "subnet": {"key": "subnet", "type": "ResourceId"}, + "remote_login_port_public_access": { + "key": "remoteLoginPortPublicAccess", + "type": "str", + }, + "allocation_state": {"key": "allocationState", "type": "str"}, + "allocation_state_transition_time": { + "key": "allocationStateTransitionTime", + "type": "iso-8601", + }, + "errors": {"key": "errors", "type": "[ErrorResponse]"}, + "current_node_count": {"key": "currentNodeCount", "type": "int"}, + "target_node_count": {"key": "targetNodeCount", "type": "int"}, + "node_state_counts": { + "key": "nodeStateCounts", + "type": "NodeStateCounts", + }, + "enable_node_public_ip": {"key": "enableNodePublicIp", "type": "bool"}, } def __init__( @@ -763,7 +832,9 @@ def __init__( scale_settings: Optional["ScaleSettings"] = None, user_account_credentials: Optional["UserAccountCredentials"] = None, subnet: Optional["ResourceId"] = None, - remote_login_port_public_access: Optional[Union[str, "RemoteLoginPortPublicAccess"]] = "NotSpecified", + remote_login_port_public_access: Optional[ + Union[str, "RemoteLoginPortPublicAccess"] + ] = "NotSpecified", enable_node_public_ip: Optional[bool] = True, **kwargs ): @@ -835,9 +906,9 @@ class AmlUserFeature(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "description": {"key": "description", "type": "str"}, } def __init__( @@ -874,22 +945,16 @@ class AssignedUser(msrest.serialization.Model): """ _validation = { - 'object_id': {'required': True}, - 'tenant_id': {'required': True}, + "object_id": {"required": True}, + "tenant_id": {"required": True}, } _attribute_map = { - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + "object_id": {"key": "objectId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, } - def __init__( - self, - *, - object_id: str, - tenant_id: str, - **kwargs - ): + def __init__(self, *, object_id: str, tenant_id: str, **kwargs): """ :keyword object_id: Required. User’s AAD Object Id. :paramtype object_id: str @@ -911,8 +976,8 @@ class AutoPauseProperties(msrest.serialization.Model): """ _attribute_map = { - 'delay_in_minutes': {'key': 'delayInMinutes', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, + "delay_in_minutes": {"key": "delayInMinutes", "type": "int"}, + "enabled": {"key": "enabled", "type": "bool"}, } def __init__( @@ -945,9 +1010,9 @@ class AutoScaleProperties(msrest.serialization.Model): """ _attribute_map = { - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, + "min_node_count": {"key": "minNodeCount", "type": "int"}, + "enabled": {"key": "enabled", "type": "bool"}, + "max_node_count": {"key": "maxNodeCount", "type": "int"}, } def __init__( @@ -980,7 +1045,10 @@ class ClusterUpdateParameters(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties.properties', 'type': 'ScaleSettingsInformation'}, + "properties": { + "key": "properties.properties", + "type": "ScaleSettingsInformation", + }, } def __init__( @@ -997,7 +1065,9 @@ def __init__( self.properties = properties -class Components1D3SwueSchemasComputeresourceAllof1(msrest.serialization.Model): +class Components1D3SwueSchemasComputeresourceAllof1( + msrest.serialization.Model +): """Components1D3SwueSchemasComputeresourceAllof1. :ivar properties: Compute properties. @@ -1005,20 +1075,17 @@ class Components1D3SwueSchemasComputeresourceAllof1(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, + "properties": {"key": "properties", "type": "Compute"}, } - def __init__( - self, - *, - properties: Optional["Compute"] = None, - **kwargs - ): + def __init__(self, *, properties: Optional["Compute"] = None, **kwargs): """ :keyword properties: Compute properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute """ - super(Components1D3SwueSchemasComputeresourceAllof1, self).__init__(**kwargs) + super(Components1D3SwueSchemasComputeresourceAllof1, self).__init__( + **kwargs + ) self.properties = properties @@ -1061,26 +1128,32 @@ class ComputeInstance(Compute): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, + "properties": { + "key": "properties", + "type": "ComputeInstanceProperties", + }, } def __init__( @@ -1106,8 +1179,14 @@ def __init__( :keyword properties: Properties of ComputeInstance. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties """ - super(ComputeInstance, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, **kwargs) - self.compute_type = 'ComputeInstance' # type: str + super(ComputeInstance, self).__init__( + compute_location=compute_location, + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + **kwargs + ) + self.compute_type = "ComputeInstance" # type: str self.properties = properties @@ -1121,8 +1200,8 @@ class ComputeInstanceApplication(msrest.serialization.Model): """ _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, + "display_name": {"key": "displayName", "type": "str"}, + "endpoint_uri": {"key": "endpointUri", "type": "str"}, } def __init__( @@ -1156,21 +1235,17 @@ class ComputeInstanceConnectivityEndpoints(msrest.serialization.Model): """ _validation = { - 'public_ip_address': {'readonly': True}, - 'private_ip_address': {'readonly': True}, + "public_ip_address": {"readonly": True}, + "private_ip_address": {"readonly": True}, } _attribute_map = { - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + "public_ip_address": {"key": "publicIpAddress", "type": "str"}, + "private_ip_address": {"key": "privateIpAddress", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ComputeInstanceConnectivityEndpoints, self).__init__(**kwargs) self.public_ip_address = None self.private_ip_address = None @@ -1190,23 +1265,19 @@ class ComputeInstanceCreatedBy(msrest.serialization.Model): """ _validation = { - 'user_name': {'readonly': True}, - 'user_org_id': {'readonly': True}, - 'user_id': {'readonly': True}, + "user_name": {"readonly": True}, + "user_org_id": {"readonly": True}, + "user_id": {"readonly": True}, } _attribute_map = { - 'user_name': {'key': 'userName', 'type': 'str'}, - 'user_org_id': {'key': 'userOrgId', 'type': 'str'}, - 'user_id': {'key': 'userId', 'type': 'str'}, + "user_name": {"key": "userName", "type": "str"}, + "user_org_id": {"key": "userOrgId", "type": "str"}, + "user_id": {"key": "userId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ComputeInstanceCreatedBy, self).__init__(**kwargs) self.user_name = None self.user_org_id = None @@ -1227,9 +1298,9 @@ class ComputeInstanceLastOperation(msrest.serialization.Model): """ _attribute_map = { - 'operation_name': {'key': 'operationName', 'type': 'str'}, - 'operation_time': {'key': 'operationTime', 'type': 'iso-8601'}, - 'operation_status': {'key': 'operationStatus', 'type': 'str'}, + "operation_name": {"key": "operationName", "type": "str"}, + "operation_time": {"key": "operationTime", "type": "iso-8601"}, + "operation_status": {"key": "operationStatus", "type": "str"}, } def __init__( @@ -1308,29 +1379,50 @@ class ComputeInstanceProperties(msrest.serialization.Model): """ _validation = { - 'connectivity_endpoints': {'readonly': True}, - 'applications': {'readonly': True}, - 'created_by': {'readonly': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'last_operation': {'readonly': True}, - } - - _attribute_map = { - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'application_sharing_policy': {'key': 'applicationSharingPolicy', 'type': 'str'}, - 'ssh_settings': {'key': 'sshSettings', 'type': 'ComputeInstanceSshSettings'}, - 'connectivity_endpoints': {'key': 'connectivityEndpoints', 'type': 'ComputeInstanceConnectivityEndpoints'}, - 'applications': {'key': 'applications', 'type': '[ComputeInstanceApplication]'}, - 'created_by': {'key': 'createdBy', 'type': 'ComputeInstanceCreatedBy'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'compute_instance_authorization_type': {'key': 'computeInstanceAuthorizationType', 'type': 'str'}, - 'personal_compute_instance_settings': {'key': 'personalComputeInstanceSettings', 'type': 'PersonalComputeInstanceSettings'}, - 'setup_scripts': {'key': 'setupScripts', 'type': 'SetupScripts'}, - 'last_operation': {'key': 'lastOperation', 'type': 'ComputeInstanceLastOperation'}, - 'schedules': {'key': 'schedules', 'type': 'ComputeSchedules'}, + "connectivity_endpoints": {"readonly": True}, + "applications": {"readonly": True}, + "created_by": {"readonly": True}, + "errors": {"readonly": True}, + "state": {"readonly": True}, + "last_operation": {"readonly": True}, + } + + _attribute_map = { + "vm_size": {"key": "vmSize", "type": "str"}, + "subnet": {"key": "subnet", "type": "ResourceId"}, + "application_sharing_policy": { + "key": "applicationSharingPolicy", + "type": "str", + }, + "ssh_settings": { + "key": "sshSettings", + "type": "ComputeInstanceSshSettings", + }, + "connectivity_endpoints": { + "key": "connectivityEndpoints", + "type": "ComputeInstanceConnectivityEndpoints", + }, + "applications": { + "key": "applications", + "type": "[ComputeInstanceApplication]", + }, + "created_by": {"key": "createdBy", "type": "ComputeInstanceCreatedBy"}, + "errors": {"key": "errors", "type": "[ErrorResponse]"}, + "state": {"key": "state", "type": "str"}, + "compute_instance_authorization_type": { + "key": "computeInstanceAuthorizationType", + "type": "str", + }, + "personal_compute_instance_settings": { + "key": "personalComputeInstanceSettings", + "type": "PersonalComputeInstanceSettings", + }, + "setup_scripts": {"key": "setupScripts", "type": "SetupScripts"}, + "last_operation": { + "key": "lastOperation", + "type": "ComputeInstanceLastOperation", + }, + "schedules": {"key": "schedules", "type": "ComputeSchedules"}, } def __init__( @@ -1338,10 +1430,16 @@ def __init__( *, vm_size: Optional[str] = None, subnet: Optional["ResourceId"] = None, - application_sharing_policy: Optional[Union[str, "ApplicationSharingPolicy"]] = "Shared", + application_sharing_policy: Optional[ + Union[str, "ApplicationSharingPolicy"] + ] = "Shared", ssh_settings: Optional["ComputeInstanceSshSettings"] = None, - compute_instance_authorization_type: Optional[Union[str, "ComputeInstanceAuthorizationType"]] = "personal", - personal_compute_instance_settings: Optional["PersonalComputeInstanceSettings"] = None, + compute_instance_authorization_type: Optional[ + Union[str, "ComputeInstanceAuthorizationType"] + ] = "personal", + personal_compute_instance_settings: Optional[ + "PersonalComputeInstanceSettings" + ] = None, setup_scripts: Optional["SetupScripts"] = None, schedules: Optional["ComputeSchedules"] = None, **kwargs @@ -1383,8 +1481,12 @@ def __init__( self.created_by = None self.errors = None self.state = None - self.compute_instance_authorization_type = compute_instance_authorization_type - self.personal_compute_instance_settings = personal_compute_instance_settings + self.compute_instance_authorization_type = ( + compute_instance_authorization_type + ) + self.personal_compute_instance_settings = ( + personal_compute_instance_settings + ) self.setup_scripts = setup_scripts self.last_operation = None self.schedules = schedules @@ -1410,21 +1512,23 @@ class ComputeInstanceSshSettings(msrest.serialization.Model): """ _validation = { - 'admin_user_name': {'readonly': True}, - 'ssh_port': {'readonly': True}, + "admin_user_name": {"readonly": True}, + "ssh_port": {"readonly": True}, } _attribute_map = { - 'ssh_public_access': {'key': 'sshPublicAccess', 'type': 'str'}, - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'admin_public_key': {'key': 'adminPublicKey', 'type': 'str'}, + "ssh_public_access": {"key": "sshPublicAccess", "type": "str"}, + "admin_user_name": {"key": "adminUserName", "type": "str"}, + "ssh_port": {"key": "sshPort", "type": "int"}, + "admin_public_key": {"key": "adminPublicKey", "type": "str"}, } def __init__( self, *, - ssh_public_access: Optional[Union[str, "SshPublicAccess"]] = "Disabled", + ssh_public_access: Optional[ + Union[str, "SshPublicAccess"] + ] = "Disabled", admin_public_key: Optional[str] = None, **kwargs ): @@ -1461,23 +1565,19 @@ class Resource(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -1512,22 +1612,22 @@ class ComputeResource(Resource, Components1D3SwueSchemasComputeresourceAllof1): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + "properties": {"key": "properties", "type": "Compute"}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "identity": {"key": "identity", "type": "Identity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "system_data": {"key": "systemData", "type": "SystemData"}, } def __init__( @@ -1578,7 +1678,10 @@ class ComputeSchedules(msrest.serialization.Model): """ _attribute_map = { - 'compute_start_stop': {'key': 'computeStartStop', 'type': '[ComputeStartStopSchedule]'}, + "compute_start_stop": { + "key": "computeStartStop", + "type": "[ComputeStartStopSchedule]", + }, } def __init__( @@ -1620,18 +1723,18 @@ class ComputeStartStopSchedule(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'provisioning_status': {'readonly': True}, + "id": {"readonly": True}, + "provisioning_status": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'str'}, - 'recurrence': {'key': 'recurrence', 'type': 'Recurrence'}, - 'cron': {'key': 'cron', 'type': 'Cron'}, + "id": {"key": "id", "type": "str"}, + "provisioning_status": {"key": "provisioningStatus", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "trigger_type": {"key": "triggerType", "type": "str"}, + "action": {"key": "action", "type": "str"}, + "recurrence": {"key": "recurrence", "type": "Recurrence"}, + "cron": {"key": "cron", "type": "Cron"}, } def __init__( @@ -1692,12 +1795,12 @@ class ContainerResourceRequirements(msrest.serialization.Model): """ _attribute_map = { - 'cpu': {'key': 'cpu', 'type': 'float'}, - 'cpu_limit': {'key': 'cpuLimit', 'type': 'float'}, - 'memory_in_gb': {'key': 'memoryInGB', 'type': 'float'}, - 'memory_in_gb_limit': {'key': 'memoryInGBLimit', 'type': 'float'}, - 'gpu': {'key': 'gpu', 'type': 'int'}, - 'fpga': {'key': 'fpga', 'type': 'int'}, + "cpu": {"key": "cpu", "type": "float"}, + "cpu_limit": {"key": "cpuLimit", "type": "float"}, + "memory_in_gb": {"key": "memoryInGB", "type": "float"}, + "memory_in_gb_limit": {"key": "memoryInGBLimit", "type": "float"}, + "gpu": {"key": "gpu", "type": "int"}, + "fpga": {"key": "fpga", "type": "int"}, } def __init__( @@ -1749,14 +1852,14 @@ class CosmosDbSettings(msrest.serialization.Model): """ _attribute_map = { - 'collections_throughput': {'key': 'collectionsThroughput', 'type': 'int'}, + "collections_throughput": { + "key": "collectionsThroughput", + "type": "int", + }, } def __init__( - self, - *, - collections_throughput: Optional[int] = None, - **kwargs + self, *, collections_throughput: Optional[int] = None, **kwargs ): """ :keyword collections_throughput: The throughput of the collections in cosmosdb database. @@ -1778,9 +1881,9 @@ class Cron(msrest.serialization.Model): """ _attribute_map = { - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, + "start_time": {"key": "startTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "expression": {"key": "expression", "type": "str"}, } def __init__( @@ -1844,26 +1947,29 @@ class Databricks(Compute): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, + "properties": {"key": "properties", "type": "DatabricksProperties"}, } def __init__( @@ -1889,8 +1995,14 @@ def __init__( :keyword properties: Properties of Databricks. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties """ - super(Databricks, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, **kwargs) - self.compute_type = 'Databricks' # type: str + super(Databricks, self).__init__( + compute_location=compute_location, + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + **kwargs + ) + self.compute_type = "Databricks" # type: str self.properties = properties @@ -1902,14 +2014,14 @@ class DatabricksComputeSecretsProperties(msrest.serialization.Model): """ _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, } def __init__( - self, - *, - databricks_access_token: Optional[str] = None, - **kwargs + self, *, databricks_access_token: Optional[str] = None, **kwargs ): """ :keyword databricks_access_token: access token for databricks account. @@ -1919,7 +2031,9 @@ def __init__( self.databricks_access_token = databricks_access_token -class DatabricksComputeSecrets(ComputeSecrets, DatabricksComputeSecretsProperties): +class DatabricksComputeSecrets( + ComputeSecrets, DatabricksComputeSecretsProperties +): """Secrets related to a Machine Learning compute based on Databricks. All required parameters must be populated in order to send to Azure. @@ -1933,28 +2047,30 @@ class DatabricksComputeSecrets(ComputeSecrets, DatabricksComputeSecretsPropertie """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, + "compute_type": {"key": "computeType", "type": "str"}, } def __init__( - self, - *, - databricks_access_token: Optional[str] = None, - **kwargs + self, *, databricks_access_token: Optional[str] = None, **kwargs ): """ :keyword databricks_access_token: access token for databricks account. :paramtype databricks_access_token: str """ - super(DatabricksComputeSecrets, self).__init__(databricks_access_token=databricks_access_token, **kwargs) + super(DatabricksComputeSecrets, self).__init__( + databricks_access_token=databricks_access_token, **kwargs + ) self.databricks_access_token = databricks_access_token - self.compute_type = 'Databricks' # type: str - self.compute_type = 'Databricks' # type: str + self.compute_type = "Databricks" # type: str + self.compute_type = "Databricks" # type: str class DatabricksProperties(msrest.serialization.Model): @@ -1967,8 +2083,11 @@ class DatabricksProperties(msrest.serialization.Model): """ _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'workspace_url': {'key': 'workspaceUrl', 'type': 'str'}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, + "workspace_url": {"key": "workspaceUrl", "type": "str"}, } def __init__( @@ -2026,25 +2145,28 @@ class DataFactory(Compute): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -2067,8 +2189,14 @@ def __init__( MSI and AAD exclusively for authentication. :paramtype disable_local_auth: bool """ - super(DataFactory, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, **kwargs) - self.compute_type = 'DataFactory' # type: str + super(DataFactory, self).__init__( + compute_location=compute_location, + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + **kwargs + ) + self.compute_type = "DataFactory" # type: str class DataLakeAnalytics(Compute): @@ -2110,26 +2238,32 @@ class DataLakeAnalytics(Compute): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsProperties'}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, + "properties": { + "key": "properties", + "type": "DataLakeAnalyticsProperties", + }, } def __init__( @@ -2155,8 +2289,14 @@ def __init__( :keyword properties: :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsProperties """ - super(DataLakeAnalytics, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, **kwargs) - self.compute_type = 'DataLakeAnalytics' # type: str + super(DataLakeAnalytics, self).__init__( + compute_location=compute_location, + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + **kwargs + ) + self.compute_type = "DataLakeAnalytics" # type: str self.properties = properties @@ -2168,14 +2308,14 @@ class DataLakeAnalyticsProperties(msrest.serialization.Model): """ _attribute_map = { - 'data_lake_store_account_name': {'key': 'dataLakeStoreAccountName', 'type': 'str'}, + "data_lake_store_account_name": { + "key": "dataLakeStoreAccountName", + "type": "str", + }, } def __init__( - self, - *, - data_lake_store_account_name: Optional[str] = None, - **kwargs + self, *, data_lake_store_account_name: Optional[str] = None, **kwargs ): """ :keyword data_lake_store_account_name: DataLake Store Account Name. @@ -2209,15 +2349,18 @@ class DiagnoseRequestProperties(msrest.serialization.Model): """ _attribute_map = { - 'udr': {'key': 'udr', 'type': '{object}'}, - 'nsg': {'key': 'nsg', 'type': '{object}'}, - 'resource_lock': {'key': 'resourceLock', 'type': '{object}'}, - 'dns_resolution': {'key': 'dnsResolution', 'type': '{object}'}, - 'storage_account': {'key': 'storageAccount', 'type': '{object}'}, - 'key_vault': {'key': 'keyVault', 'type': '{object}'}, - 'container_registry': {'key': 'containerRegistry', 'type': '{object}'}, - 'application_insights': {'key': 'applicationInsights', 'type': '{object}'}, - 'others': {'key': 'others', 'type': '{object}'}, + "udr": {"key": "udr", "type": "{object}"}, + "nsg": {"key": "nsg", "type": "{object}"}, + "resource_lock": {"key": "resourceLock", "type": "{object}"}, + "dns_resolution": {"key": "dnsResolution", "type": "{object}"}, + "storage_account": {"key": "storageAccount", "type": "{object}"}, + "key_vault": {"key": "keyVault", "type": "{object}"}, + "container_registry": {"key": "containerRegistry", "type": "{object}"}, + "application_insights": { + "key": "applicationInsights", + "type": "{object}", + }, + "others": {"key": "others", "type": "{object}"}, } def __init__( @@ -2274,7 +2417,7 @@ class DiagnoseResponseResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseResponseResultValue'}, + "value": {"key": "value", "type": "DiagnoseResponseResultValue"}, } def __init__( @@ -2321,15 +2464,39 @@ class DiagnoseResponseResultValue(msrest.serialization.Model): """ _attribute_map = { - 'user_defined_route_results': {'key': 'userDefinedRouteResults', 'type': '[DiagnoseResult]'}, - 'network_security_rule_results': {'key': 'networkSecurityRuleResults', 'type': '[DiagnoseResult]'}, - 'resource_lock_results': {'key': 'resourceLockResults', 'type': '[DiagnoseResult]'}, - 'dns_resolution_results': {'key': 'dnsResolutionResults', 'type': '[DiagnoseResult]'}, - 'storage_account_results': {'key': 'storageAccountResults', 'type': '[DiagnoseResult]'}, - 'key_vault_results': {'key': 'keyVaultResults', 'type': '[DiagnoseResult]'}, - 'container_registry_results': {'key': 'containerRegistryResults', 'type': '[DiagnoseResult]'}, - 'application_insights_results': {'key': 'applicationInsightsResults', 'type': '[DiagnoseResult]'}, - 'other_results': {'key': 'otherResults', 'type': '[DiagnoseResult]'}, + "user_defined_route_results": { + "key": "userDefinedRouteResults", + "type": "[DiagnoseResult]", + }, + "network_security_rule_results": { + "key": "networkSecurityRuleResults", + "type": "[DiagnoseResult]", + }, + "resource_lock_results": { + "key": "resourceLockResults", + "type": "[DiagnoseResult]", + }, + "dns_resolution_results": { + "key": "dnsResolutionResults", + "type": "[DiagnoseResult]", + }, + "storage_account_results": { + "key": "storageAccountResults", + "type": "[DiagnoseResult]", + }, + "key_vault_results": { + "key": "keyVaultResults", + "type": "[DiagnoseResult]", + }, + "container_registry_results": { + "key": "containerRegistryResults", + "type": "[DiagnoseResult]", + }, + "application_insights_results": { + "key": "applicationInsightsResults", + "type": "[DiagnoseResult]", + }, + "other_results": {"key": "otherResults", "type": "[DiagnoseResult]"}, } def __init__( @@ -2400,23 +2567,19 @@ class DiagnoseResult(msrest.serialization.Model): """ _validation = { - 'code': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, + "code": {"readonly": True}, + "level": {"readonly": True}, + "message": {"readonly": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, + "code": {"key": "code", "type": "str"}, + "level": {"key": "level", "type": "str"}, + "message": {"key": "message", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DiagnoseResult, self).__init__(**kwargs) self.code = None self.level = None @@ -2431,14 +2594,11 @@ class DiagnoseWorkspaceParameters(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseRequestProperties'}, + "value": {"key": "value", "type": "DiagnoseRequestProperties"}, } def __init__( - self, - *, - value: Optional["DiagnoseRequestProperties"] = None, - **kwargs + self, *, value: Optional["DiagnoseRequestProperties"] = None, **kwargs ): """ :keyword value: Value of Parameters. @@ -2472,17 +2632,26 @@ class EncryptionProperty(msrest.serialization.Model): """ _validation = { - 'status': {'required': True}, - 'key_vault_properties': {'required': True}, + "status": {"required": True}, + "key_vault_properties": {"required": True}, } _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityForCmk'}, - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'KeyVaultProperties'}, - 'cosmos_db_resource_id': {'key': 'cosmosDbResourceId', 'type': 'str'}, - 'storage_account_resource_id': {'key': 'storageAccountResourceId', 'type': 'str'}, - 'search_account_resource_id': {'key': 'searchAccountResourceId', 'type': 'str'}, + "status": {"key": "status", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityForCmk"}, + "key_vault_properties": { + "key": "keyVaultProperties", + "type": "KeyVaultProperties", + }, + "cosmos_db_resource_id": {"key": "cosmosDbResourceId", "type": "str"}, + "storage_account_resource_id": { + "key": "storageAccountResourceId", + "type": "str", + }, + "search_account_resource_id": { + "key": "searchAccountResourceId", + "type": "str", + }, } def __init__( @@ -2536,21 +2705,17 @@ class ErrorAdditionalInfo(msrest.serialization.Model): """ _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, + "type": {"readonly": True}, + "info": {"readonly": True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, + "type": {"key": "type", "type": "str"}, + "info": {"key": "info", "type": "object"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ErrorAdditionalInfo, self).__init__(**kwargs) self.type = None self.info = None @@ -2574,27 +2739,26 @@ class ErrorDetail(msrest.serialization.Model): """ _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, + "code": {"readonly": True}, + "message": {"readonly": True}, + "target": {"readonly": True}, + "details": {"readonly": True}, + "additional_info": {"readonly": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[ErrorDetail]"}, + "additional_info": { + "key": "additionalInfo", + "type": "[ErrorAdditionalInfo]", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ErrorDetail, self).__init__(**kwargs) self.code = None self.message = None @@ -2611,15 +2775,10 @@ class ErrorResponse(msrest.serialization.Model): """ _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, + "error": {"key": "error", "type": "ErrorDetail"}, } - def __init__( - self, - *, - error: Optional["ErrorDetail"] = None, - **kwargs - ): + def __init__(self, *, error: Optional["ErrorDetail"] = None, **kwargs): """ :keyword error: The error object. :paramtype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail @@ -2644,15 +2803,15 @@ class EstimatedVMPrice(msrest.serialization.Model): """ _validation = { - 'retail_price': {'required': True}, - 'os_type': {'required': True}, - 'vm_tier': {'required': True}, + "retail_price": {"required": True}, + "os_type": {"required": True}, + "vm_tier": {"required": True}, } _attribute_map = { - 'retail_price': {'key': 'retailPrice', 'type': 'float'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_tier': {'key': 'vmTier', 'type': 'str'}, + "retail_price": {"key": "retailPrice", "type": "float"}, + "os_type": {"key": "osType", "type": "str"}, + "vm_tier": {"key": "vmTier", "type": "str"}, } def __init__( @@ -2696,15 +2855,15 @@ class EstimatedVMPrices(msrest.serialization.Model): """ _validation = { - 'billing_currency': {'required': True}, - 'unit_of_measure': {'required': True}, - 'values': {'required': True}, + "billing_currency": {"required": True}, + "unit_of_measure": {"required": True}, + "values": {"required": True}, } _attribute_map = { - 'billing_currency': {'key': 'billingCurrency', 'type': 'str'}, - 'unit_of_measure': {'key': 'unitOfMeasure', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[EstimatedVMPrice]'}, + "billing_currency": {"key": "billingCurrency", "type": "str"}, + "unit_of_measure": {"key": "unitOfMeasure", "type": "str"}, + "values": {"key": "values", "type": "[EstimatedVMPrice]"}, } def __init__( @@ -2740,14 +2899,11 @@ class ExternalFQDNResponse(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[FQDNEndpoints]'}, + "value": {"key": "value", "type": "[FQDNEndpoints]"}, } def __init__( - self, - *, - value: Optional[List["FQDNEndpoints"]] = None, - **kwargs + self, *, value: Optional[List["FQDNEndpoints"]] = None, **kwargs ): """ :keyword value: @@ -2767,8 +2923,11 @@ class FQDNEndpoint(msrest.serialization.Model): """ _attribute_map = { - 'domain_name': {'key': 'domainName', 'type': 'str'}, - 'endpoint_details': {'key': 'endpointDetails', 'type': '[FQDNEndpointDetail]'}, + "domain_name": {"key": "domainName", "type": "str"}, + "endpoint_details": { + "key": "endpointDetails", + "type": "[FQDNEndpointDetail]", + }, } def __init__( @@ -2798,15 +2957,10 @@ class FQDNEndpointDetail(msrest.serialization.Model): """ _attribute_map = { - 'port': {'key': 'port', 'type': 'int'}, + "port": {"key": "port", "type": "int"}, } - def __init__( - self, - *, - port: Optional[int] = None, - **kwargs - ): + def __init__(self, *, port: Optional[int] = None, **kwargs): """ :keyword port: :paramtype port: int @@ -2823,7 +2977,7 @@ class FQDNEndpoints(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'FQDNEndpointsProperties'}, + "properties": {"key": "properties", "type": "FQDNEndpointsProperties"}, } def __init__( @@ -2850,8 +3004,8 @@ class FQDNEndpointsProperties(msrest.serialization.Model): """ _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'endpoints': {'key': 'endpoints', 'type': '[FQDNEndpoint]'}, + "category": {"key": "category", "type": "str"}, + "endpoints": {"key": "endpoints", "type": "[FQDNEndpoint]"}, } def __init__( @@ -2911,26 +3065,29 @@ class HDInsight(Compute): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, + "properties": {"key": "properties", "type": "HDInsightProperties"}, } def __init__( @@ -2956,8 +3113,14 @@ def __init__( :keyword properties: HDInsight compute properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties """ - super(HDInsight, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, **kwargs) - self.compute_type = 'HDInsight' # type: str + super(HDInsight, self).__init__( + compute_location=compute_location, + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + **kwargs + ) + self.compute_type = "HDInsight" # type: str self.properties = properties @@ -2974,9 +3137,12 @@ class HDInsightProperties(msrest.serialization.Model): """ _attribute_map = { - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, + "ssh_port": {"key": "sshPort", "type": "int"}, + "address": {"key": "address", "type": "str"}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, } def __init__( @@ -3020,22 +3186,27 @@ class Identity(msrest.serialization.Model): """ _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, + "principal_id": {"readonly": True}, + "tenant_id": {"readonly": True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{UserAssignedIdentity}", + }, } def __init__( self, *, type: Optional[Union[str, "ResourceIdentityType"]] = None, - user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, + user_assigned_identities: Optional[ + Dict[str, "UserAssignedIdentity"] + ] = None, **kwargs ): """ @@ -3062,14 +3233,14 @@ class IdentityForCmk(msrest.serialization.Model): """ _attribute_map = { - 'user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, + "user_assigned_identity": { + "key": "userAssignedIdentity", + "type": "str", + }, } def __init__( - self, - *, - user_assigned_identity: Optional[str] = None, - **kwargs + self, *, user_assigned_identity: Optional[str] = None, **kwargs ): """ :keyword user_assigned_identity: The ArmId of the user assigned identity that will be used to @@ -3090,8 +3261,11 @@ class InstanceTypeSchema(msrest.serialization.Model): """ _attribute_map = { - 'node_selector': {'key': 'nodeSelector', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'InstanceTypeSchemaResources'}, + "node_selector": {"key": "nodeSelector", "type": "{str}"}, + "resources": { + "key": "resources", + "type": "InstanceTypeSchemaResources", + }, } def __init__( @@ -3122,8 +3296,8 @@ class InstanceTypeSchemaResources(msrest.serialization.Model): """ _attribute_map = { - 'requests': {'key': 'requests', 'type': '{str}'}, - 'limits': {'key': 'limits', 'type': '{str}'}, + "requests": {"key": "requests", "type": "{str}"}, + "limits": {"key": "limits", "type": "{str}"}, } def __init__( @@ -3160,14 +3334,14 @@ class KeyVaultProperties(msrest.serialization.Model): """ _validation = { - 'key_vault_arm_id': {'required': True}, - 'key_identifier': {'required': True}, + "key_vault_arm_id": {"required": True}, + "key_identifier": {"required": True}, } _attribute_map = { - 'key_vault_arm_id': {'key': 'keyVaultArmId', 'type': 'str'}, - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - 'identity_client_id': {'key': 'identityClientId', 'type': 'str'}, + "key_vault_arm_id": {"key": "keyVaultArmId", "type": "str"}, + "key_identifier": {"key": "keyIdentifier", "type": "str"}, + "identity_client_id": {"key": "identityClientId", "type": "str"}, } def __init__( @@ -3202,14 +3376,11 @@ class KubernetesSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, + "properties": {"key": "properties", "type": "KubernetesProperties"}, } def __init__( - self, - *, - properties: Optional["KubernetesProperties"] = None, - **kwargs + self, *, properties: Optional["KubernetesProperties"] = None, **kwargs ): """ :keyword properties: Properties of Kubernetes. @@ -3258,26 +3429,29 @@ class Kubernetes(Compute, KubernetesSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "KubernetesProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -3303,10 +3477,17 @@ def __init__( MSI and AAD exclusively for authentication. :paramtype disable_local_auth: bool """ - super(Kubernetes, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) + super(Kubernetes, self).__init__( + compute_location=compute_location, + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'Kubernetes' # type: str - self.compute_type = 'Kubernetes' # type: str + self.compute_type = "Kubernetes" # type: str + self.compute_type = "Kubernetes" # type: str self.compute_location = compute_location self.provisioning_state = None self.description = description @@ -3341,14 +3522,29 @@ class KubernetesProperties(msrest.serialization.Model): """ _attribute_map = { - 'relay_connection_string': {'key': 'relayConnectionString', 'type': 'str'}, - 'service_bus_connection_string': {'key': 'serviceBusConnectionString', 'type': 'str'}, - 'extension_principal_id': {'key': 'extensionPrincipalId', 'type': 'str'}, - 'extension_instance_release_train': {'key': 'extensionInstanceReleaseTrain', 'type': 'str'}, - 'vc_name': {'key': 'vcName', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'default_instance_type': {'key': 'defaultInstanceType', 'type': 'str'}, - 'instance_types': {'key': 'instanceTypes', 'type': '{InstanceTypeSchema}'}, + "relay_connection_string": { + "key": "relayConnectionString", + "type": "str", + }, + "service_bus_connection_string": { + "key": "serviceBusConnectionString", + "type": "str", + }, + "extension_principal_id": { + "key": "extensionPrincipalId", + "type": "str", + }, + "extension_instance_release_train": { + "key": "extensionInstanceReleaseTrain", + "type": "str", + }, + "vc_name": {"key": "vcName", "type": "str"}, + "namespace": {"key": "namespace", "type": "str"}, + "default_instance_type": {"key": "defaultInstanceType", "type": "str"}, + "instance_types": { + "key": "instanceTypes", + "type": "{InstanceTypeSchema}", + }, } def __init__( @@ -3387,7 +3583,9 @@ def __init__( self.relay_connection_string = relay_connection_string self.service_bus_connection_string = service_bus_connection_string self.extension_principal_id = extension_principal_id - self.extension_instance_release_train = extension_instance_release_train + self.extension_instance_release_train = ( + extension_instance_release_train + ) self.vc_name = vc_name self.namespace = namespace self.default_instance_type = default_instance_type @@ -3407,21 +3605,17 @@ class ListAmlUserFeatureResult(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlUserFeature]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[AmlUserFeature]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListAmlUserFeatureResult, self).__init__(**kwargs) self.value = None self.next_link = None @@ -3439,21 +3633,17 @@ class ListNotebookKeysResult(msrest.serialization.Model): """ _validation = { - 'primary_access_key': {'readonly': True}, - 'secondary_access_key': {'readonly': True}, + "primary_access_key": {"readonly": True}, + "secondary_access_key": {"readonly": True}, } _attribute_map = { - 'primary_access_key': {'key': 'primaryAccessKey', 'type': 'str'}, - 'secondary_access_key': {'key': 'secondaryAccessKey', 'type': 'str'}, + "primary_access_key": {"key": "primaryAccessKey", "type": "str"}, + "secondary_access_key": {"key": "secondaryAccessKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListNotebookKeysResult, self).__init__(**kwargs) self.primary_access_key = None self.secondary_access_key = None @@ -3469,19 +3659,15 @@ class ListStorageAccountKeysResult(msrest.serialization.Model): """ _validation = { - 'user_storage_key': {'readonly': True}, + "user_storage_key": {"readonly": True}, } _attribute_map = { - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, + "user_storage_key": {"key": "userStorageKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListStorageAccountKeysResult, self).__init__(**kwargs) self.user_storage_key = None @@ -3499,21 +3685,17 @@ class ListUsagesResult(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[Usage]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Usage]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListUsagesResult, self).__init__(**kwargs) self.value = None self.next_link = None @@ -3539,27 +3721,35 @@ class ListWorkspaceKeysResult(msrest.serialization.Model): """ _validation = { - 'user_storage_key': {'readonly': True}, - 'user_storage_resource_id': {'readonly': True}, - 'app_insights_instrumentation_key': {'readonly': True}, - 'container_registry_credentials': {'readonly': True}, - 'notebook_access_keys': {'readonly': True}, - } - - _attribute_map = { - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, - 'user_storage_resource_id': {'key': 'userStorageResourceId', 'type': 'str'}, - 'app_insights_instrumentation_key': {'key': 'appInsightsInstrumentationKey', 'type': 'str'}, - 'container_registry_credentials': {'key': 'containerRegistryCredentials', 'type': 'RegistryListCredentialsResult'}, - 'notebook_access_keys': {'key': 'notebookAccessKeys', 'type': 'ListNotebookKeysResult'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ + "user_storage_key": {"readonly": True}, + "user_storage_resource_id": {"readonly": True}, + "app_insights_instrumentation_key": {"readonly": True}, + "container_registry_credentials": {"readonly": True}, + "notebook_access_keys": {"readonly": True}, + } + + _attribute_map = { + "user_storage_key": {"key": "userStorageKey", "type": "str"}, + "user_storage_resource_id": { + "key": "userStorageResourceId", + "type": "str", + }, + "app_insights_instrumentation_key": { + "key": "appInsightsInstrumentationKey", + "type": "str", + }, + "container_registry_credentials": { + "key": "containerRegistryCredentials", + "type": "RegistryListCredentialsResult", + }, + "notebook_access_keys": { + "key": "notebookAccessKeys", + "type": "ListNotebookKeysResult", + }, + } + + def __init__(self, **kwargs): + """ """ super(ListWorkspaceKeysResult, self).__init__(**kwargs) self.user_storage_key = None self.user_storage_resource_id = None @@ -3581,21 +3771,17 @@ class ListWorkspaceQuotas(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[ResourceQuota]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[ResourceQuota]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListWorkspaceQuotas, self).__init__(**kwargs) self.value = None self.next_link = None @@ -3611,8 +3797,8 @@ class ManagedIdentity(msrest.serialization.Model): """ _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, + "resource_id": {"key": "resourceId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, } def __init__( @@ -3659,20 +3845,27 @@ class WorkspaceConnectionPropertiesV2(msrest.serialization.Model): """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'metadata': {'key': 'metadata', 'type': '{object}'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "metadata": {"key": "metadata", "type": "{object}"}, } _subtype_map = { - 'auth_type': {'ManagedIdentity': 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', 'None': 'NoneAuthTypeWorkspaceConnectionProperties', 'PAT': 'PATAuthTypeWorkspaceConnectionProperties', 'SAS': 'SASAuthTypeWorkspaceConnectionProperties', 'ServicePrincipal': 'ServicePrincipalAuthTypeWorkspaceConnectionProperties', 'UsernamePassword': 'UsernamePasswordAuthTypeWorkspaceConnectionProperties'} + "auth_type": { + "ManagedIdentity": "ManagedIdentityAuthTypeWorkspaceConnectionProperties", + "None": "NoneAuthTypeWorkspaceConnectionProperties", + "PAT": "PATAuthTypeWorkspaceConnectionProperties", + "SAS": "SASAuthTypeWorkspaceConnectionProperties", + "ServicePrincipal": "ServicePrincipalAuthTypeWorkspaceConnectionProperties", + "UsernamePassword": "UsernamePasswordAuthTypeWorkspaceConnectionProperties", + } } def __init__( @@ -3708,7 +3901,9 @@ def __init__( self.metadata = metadata -class ManagedIdentityAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class ManagedIdentityAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """ManagedIdentityAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -3733,17 +3928,17 @@ class ManagedIdentityAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPr """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'metadata': {'key': 'metadata', 'type': '{object}'}, - 'credentials': {'key': 'credentials', 'type': 'ManagedIdentity'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "metadata": {"key": "metadata", "type": "{object}"}, + "credentials": {"key": "credentials", "type": "ManagedIdentity"}, } def __init__( @@ -3773,8 +3968,17 @@ def __init__( :keyword credentials: :paramtype credentials: ~azure.mgmt.machinelearningservices.models.ManagedIdentity """ - super(ManagedIdentityAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, metadata=metadata, **kwargs) - self.auth_type = 'ManagedIdentity' # type: str + super( + ManagedIdentityAuthTypeWorkspaceConnectionProperties, self + ).__init__( + category=category, + target=target, + value=value, + value_format=value_format, + metadata=metadata, + **kwargs + ) + self.auth_type = "ManagedIdentity" # type: str self.credentials = credentials @@ -3798,29 +4002,25 @@ class NodeStateCounts(msrest.serialization.Model): """ _validation = { - 'idle_node_count': {'readonly': True}, - 'running_node_count': {'readonly': True}, - 'preparing_node_count': {'readonly': True}, - 'unusable_node_count': {'readonly': True}, - 'leaving_node_count': {'readonly': True}, - 'preempted_node_count': {'readonly': True}, + "idle_node_count": {"readonly": True}, + "running_node_count": {"readonly": True}, + "preparing_node_count": {"readonly": True}, + "unusable_node_count": {"readonly": True}, + "leaving_node_count": {"readonly": True}, + "preempted_node_count": {"readonly": True}, } _attribute_map = { - 'idle_node_count': {'key': 'idleNodeCount', 'type': 'int'}, - 'running_node_count': {'key': 'runningNodeCount', 'type': 'int'}, - 'preparing_node_count': {'key': 'preparingNodeCount', 'type': 'int'}, - 'unusable_node_count': {'key': 'unusableNodeCount', 'type': 'int'}, - 'leaving_node_count': {'key': 'leavingNodeCount', 'type': 'int'}, - 'preempted_node_count': {'key': 'preemptedNodeCount', 'type': 'int'}, + "idle_node_count": {"key": "idleNodeCount", "type": "int"}, + "running_node_count": {"key": "runningNodeCount", "type": "int"}, + "preparing_node_count": {"key": "preparingNodeCount", "type": "int"}, + "unusable_node_count": {"key": "unusableNodeCount", "type": "int"}, + "leaving_node_count": {"key": "leavingNodeCount", "type": "int"}, + "preempted_node_count": {"key": "preemptedNodeCount", "type": "int"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NodeStateCounts, self).__init__(**kwargs) self.idle_node_count = None self.running_node_count = None @@ -3830,7 +4030,9 @@ def __init__( self.preempted_node_count = None -class NoneAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class NoneAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """NoneAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -3853,16 +4055,16 @@ class NoneAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2) """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'metadata': {'key': 'metadata', 'type': '{object}'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "metadata": {"key": "metadata", "type": "{object}"}, } def __init__( @@ -3889,8 +4091,15 @@ def __init__( :keyword metadata: Other Metadata that we would like to store with workspace connection. :paramtype metadata: dict[str, any] """ - super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, metadata=metadata, **kwargs) - self.auth_type = 'None' # type: str + super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__( + category=category, + target=target, + value=value, + value_format=value_format, + metadata=metadata, + **kwargs + ) + self.auth_type = "None" # type: str class NotebookAccessTokenResult(msrest.serialization.Model): @@ -3917,33 +4126,29 @@ class NotebookAccessTokenResult(msrest.serialization.Model): """ _validation = { - 'notebook_resource_id': {'readonly': True}, - 'host_name': {'readonly': True}, - 'public_dns': {'readonly': True}, - 'access_token': {'readonly': True}, - 'token_type': {'readonly': True}, - 'expires_in': {'readonly': True}, - 'refresh_token': {'readonly': True}, - 'scope': {'readonly': True}, + "notebook_resource_id": {"readonly": True}, + "host_name": {"readonly": True}, + "public_dns": {"readonly": True}, + "access_token": {"readonly": True}, + "token_type": {"readonly": True}, + "expires_in": {"readonly": True}, + "refresh_token": {"readonly": True}, + "scope": {"readonly": True}, } _attribute_map = { - 'notebook_resource_id': {'key': 'notebookResourceId', 'type': 'str'}, - 'host_name': {'key': 'hostName', 'type': 'str'}, - 'public_dns': {'key': 'publicDns', 'type': 'str'}, - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, - 'expires_in': {'key': 'expiresIn', 'type': 'int'}, - 'refresh_token': {'key': 'refreshToken', 'type': 'str'}, - 'scope': {'key': 'scope', 'type': 'str'}, + "notebook_resource_id": {"key": "notebookResourceId", "type": "str"}, + "host_name": {"key": "hostName", "type": "str"}, + "public_dns": {"key": "publicDns", "type": "str"}, + "access_token": {"key": "accessToken", "type": "str"}, + "token_type": {"key": "tokenType", "type": "str"}, + "expires_in": {"key": "expiresIn", "type": "int"}, + "refresh_token": {"key": "refreshToken", "type": "str"}, + "scope": {"key": "scope", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NotebookAccessTokenResult, self).__init__(**kwargs) self.notebook_resource_id = None self.host_name = None @@ -3965,8 +4170,8 @@ class NotebookPreparationError(msrest.serialization.Model): """ _attribute_map = { - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'status_code': {'key': 'statusCode', 'type': 'int'}, + "error_message": {"key": "errorMessage", "type": "str"}, + "status_code": {"key": "statusCode", "type": "int"}, } def __init__( @@ -4000,9 +4205,12 @@ class NotebookResourceInfo(msrest.serialization.Model): """ _attribute_map = { - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'notebook_preparation_error': {'key': 'notebookPreparationError', 'type': 'NotebookPreparationError'}, + "fqdn": {"key": "fqdn", "type": "str"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "notebook_preparation_error": { + "key": "notebookPreparationError", + "type": "NotebookPreparationError", + }, } def __init__( @@ -4010,7 +4218,9 @@ def __init__( *, fqdn: Optional[str] = None, resource_id: Optional[str] = None, - notebook_preparation_error: Optional["NotebookPreparationError"] = None, + notebook_preparation_error: Optional[ + "NotebookPreparationError" + ] = None, **kwargs ): """ @@ -4038,8 +4248,8 @@ class Operation(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, + "name": {"key": "name", "type": "str"}, + "display": {"key": "display", "type": "OperationDisplay"}, } def __init__( @@ -4074,10 +4284,10 @@ class OperationDisplay(msrest.serialization.Model): """ _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, + "provider": {"key": "provider", "type": "str"}, + "resource": {"key": "resource", "type": "str"}, + "operation": {"key": "operation", "type": "str"}, + "description": {"key": "description", "type": "str"}, } def __init__( @@ -4114,15 +4324,10 @@ class OperationListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, + "value": {"key": "value", "type": "[Operation]"}, } - def __init__( - self, - *, - value: Optional[List["Operation"]] = None, - **kwargs - ): + def __init__(self, *, value: Optional[List["Operation"]] = None, **kwargs): """ :keyword value: List of AML workspace operations supported by the AML workspace resource provider. @@ -4142,8 +4347,8 @@ class PaginatedComputeResourcesList(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[ComputeResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[ComputeResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( @@ -4176,27 +4381,25 @@ class Password(msrest.serialization.Model): """ _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, + "name": {"readonly": True}, + "value": {"readonly": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "value": {"key": "value", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Password, self).__init__(**kwargs) self.name = None self.value = None -class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class PATAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """PATAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -4221,17 +4424,17 @@ class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'metadata': {'key': 'metadata', 'type': '{object}'}, - 'credentials': {'key': 'credentials', 'type': 'PersonalAccessToken'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "metadata": {"key": "metadata", "type": "{object}"}, + "credentials": {"key": "credentials", "type": "PersonalAccessToken"}, } def __init__( @@ -4261,8 +4464,15 @@ def __init__( :keyword credentials: :paramtype credentials: ~azure.mgmt.machinelearningservices.models.PersonalAccessToken """ - super(PATAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, metadata=metadata, **kwargs) - self.auth_type = 'PAT' # type: str + super(PATAuthTypeWorkspaceConnectionProperties, self).__init__( + category=category, + target=target, + value=value, + value_format=value_format, + metadata=metadata, + **kwargs + ) + self.auth_type = "PAT" # type: str self.credentials = credentials @@ -4274,15 +4484,10 @@ class PersonalAccessToken(msrest.serialization.Model): """ _attribute_map = { - 'pat': {'key': 'pat', 'type': 'str'}, + "pat": {"key": "pat", "type": "str"}, } - def __init__( - self, - *, - pat: Optional[str] = None, - **kwargs - ): + def __init__(self, *, pat: Optional[str] = None, **kwargs): """ :keyword pat: :paramtype pat: str @@ -4299,14 +4504,11 @@ class PersonalComputeInstanceSettings(msrest.serialization.Model): """ _attribute_map = { - 'assigned_user': {'key': 'assignedUser', 'type': 'AssignedUser'}, + "assigned_user": {"key": "assignedUser", "type": "AssignedUser"}, } def __init__( - self, - *, - assigned_user: Optional["AssignedUser"] = None, - **kwargs + self, *, assigned_user: Optional["AssignedUser"] = None, **kwargs ): """ :keyword assigned_user: A user explicitly assigned to a personal compute instance. @@ -4328,21 +4530,17 @@ class PrivateEndpoint(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'subnet_arm_id': {'readonly': True}, + "id": {"readonly": True}, + "subnet_arm_id": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'subnet_arm_id': {'key': 'subnetArmId', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "subnet_arm_id": {"key": "subnetArmId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(PrivateEndpoint, self).__init__(**kwargs) self.id = None self.subnet_arm_id = None @@ -4384,25 +4582,34 @@ class PrivateEndpointConnection(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "identity": {"key": "identity", "type": "Identity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "private_endpoint": { + "key": "properties.privateEndpoint", + "type": "PrivateEndpoint", + }, + "private_link_service_connection_state": { + "key": "properties.privateLinkServiceConnectionState", + "type": "PrivateLinkServiceConnectionState", + }, + "provisioning_state": { + "key": "properties.provisioningState", + "type": "str", + }, } def __init__( @@ -4413,7 +4620,9 @@ def __init__( tags: Optional[Dict[str, str]] = None, sku: Optional["Sku"] = None, private_endpoint: Optional["PrivateEndpoint"] = None, - private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, + private_link_service_connection_state: Optional[ + "PrivateLinkServiceConnectionState" + ] = None, **kwargs ): """ @@ -4439,7 +4648,9 @@ def __init__( self.sku = sku self.system_data = None self.private_endpoint = private_endpoint - self.private_link_service_connection_state = private_link_service_connection_state + self.private_link_service_connection_state = ( + private_link_service_connection_state + ) self.provisioning_state = None @@ -4451,7 +4662,7 @@ class PrivateEndpointConnectionListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + "value": {"key": "value", "type": "[PrivateEndpointConnection]"}, } def __init__( @@ -4500,26 +4711,32 @@ class PrivateLinkResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'group_id': {'readonly': True}, - 'required_members': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "group_id": {"readonly": True}, + "required_members": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, - 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "identity": {"key": "identity", "type": "Identity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "group_id": {"key": "properties.groupId", "type": "str"}, + "required_members": { + "key": "properties.requiredMembers", + "type": "[str]", + }, + "required_zone_names": { + "key": "properties.requiredZoneNames", + "type": "[str]", + }, } def __init__( @@ -4563,14 +4780,11 @@ class PrivateLinkResourceListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + "value": {"key": "value", "type": "[PrivateLinkResource]"}, } def __init__( - self, - *, - value: Optional[List["PrivateLinkResource"]] = None, - **kwargs + self, *, value: Optional[List["PrivateLinkResource"]] = None, **kwargs ): """ :keyword value: Array of private link resources. @@ -4596,15 +4810,17 @@ class PrivateLinkServiceConnectionState(msrest.serialization.Model): """ _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + "status": {"key": "status", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "actions_required": {"key": "actionsRequired", "type": "str"}, } def __init__( self, *, - status: Optional[Union[str, "PrivateEndpointServiceConnectionStatus"]] = None, + status: Optional[ + Union[str, "PrivateEndpointServiceConnectionStatus"] + ] = None, description: Optional[str] = None, actions_required: Optional[str] = None, **kwargs @@ -4641,10 +4857,10 @@ class QuotaBaseProperties(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "limit": {"key": "limit", "type": "long"}, + "unit": {"key": "unit", "type": "str"}, } def __init__( @@ -4684,8 +4900,8 @@ class QuotaUpdateParameters(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[QuotaBaseProperties]'}, - 'location': {'key': 'location', 'type': 'str'}, + "value": {"key": "value", "type": "[QuotaBaseProperties]"}, + "location": {"key": "location", "type": "str"}, } def __init__( @@ -4723,11 +4939,11 @@ class Recurrence(msrest.serialization.Model): """ _attribute_map = { - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceSchedule'}, + "frequency": {"key": "frequency", "type": "str"}, + "interval": {"key": "interval", "type": "int"}, + "start_time": {"key": "startTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "schedule": {"key": "schedule", "type": "RecurrenceSchedule"}, } def __init__( @@ -4773,9 +4989,9 @@ class RecurrenceSchedule(msrest.serialization.Model): """ _attribute_map = { - 'minutes': {'key': 'minutes', 'type': '[int]'}, - 'hours': {'key': 'hours', 'type': '[int]'}, - 'week_days': {'key': 'weekDays', 'type': '[str]'}, + "minutes": {"key": "minutes", "type": "[int]"}, + "hours": {"key": "hours", "type": "[int]"}, + "week_days": {"key": "weekDays", "type": "[str]"}, } def __init__( @@ -4814,21 +5030,18 @@ class RegistryListCredentialsResult(msrest.serialization.Model): """ _validation = { - 'location': {'readonly': True}, - 'username': {'readonly': True}, + "location": {"readonly": True}, + "username": {"readonly": True}, } _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'username': {'key': 'username', 'type': 'str'}, - 'passwords': {'key': 'passwords', 'type': '[Password]'}, + "location": {"key": "location", "type": "str"}, + "username": {"key": "username", "type": "str"}, + "passwords": {"key": "passwords", "type": "[Password]"}, } def __init__( - self, - *, - passwords: Optional[List["Password"]] = None, - **kwargs + self, *, passwords: Optional[List["Password"]] = None, **kwargs ): """ :keyword passwords: @@ -4859,25 +5072,21 @@ class ResourceAutoGenerated(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ResourceAutoGenerated, self).__init__(**kwargs) self.id = None self.name = None @@ -4895,19 +5104,14 @@ class ResourceId(msrest.serialization.Model): """ _validation = { - 'id': {'required': True}, + "id": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, } - def __init__( - self, - *, - id: str, - **kwargs - ): + def __init__(self, *, id: str, **kwargs): """ :keyword id: Required. The ID of the resource. :paramtype id: str @@ -4928,21 +5132,17 @@ class ResourceName(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, + "value": {"readonly": True}, + "localized_value": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + "value": {"key": "value", "type": "str"}, + "localized_value": {"key": "localizedValue", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ResourceName, self).__init__(**kwargs) self.value = None self.localized_value = None @@ -4968,29 +5168,28 @@ class ResourceQuota(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'name': {'readonly': True}, - 'limit': {'readonly': True}, - 'unit': {'readonly': True}, + "id": {"readonly": True}, + "aml_workspace_location": {"readonly": True}, + "type": {"readonly": True}, + "name": {"readonly": True}, + "limit": {"readonly": True}, + "unit": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'ResourceName'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "aml_workspace_location": { + "key": "amlWorkspaceLocation", + "type": "str", + }, + "type": {"key": "type", "type": "str"}, + "name": {"key": "name", "type": "ResourceName"}, + "limit": {"key": "limit", "type": "long"}, + "unit": {"key": "unit", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ResourceQuota, self).__init__(**kwargs) self.id = None self.aml_workspace_location = None @@ -5000,7 +5199,9 @@ def __init__( self.unit = None -class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class SASAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """SASAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -5025,17 +5226,17 @@ class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'metadata': {'key': 'metadata', 'type': '{object}'}, - 'credentials': {'key': 'credentials', 'type': 'SharedAccessSignature'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "metadata": {"key": "metadata", "type": "{object}"}, + "credentials": {"key": "credentials", "type": "SharedAccessSignature"}, } def __init__( @@ -5065,8 +5266,15 @@ def __init__( :keyword credentials: :paramtype credentials: ~azure.mgmt.machinelearningservices.models.SharedAccessSignature """ - super(SASAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, metadata=metadata, **kwargs) - self.auth_type = 'SAS' # type: str + super(SASAuthTypeWorkspaceConnectionProperties, self).__init__( + category=category, + target=target, + value=value, + value_format=value_format, + metadata=metadata, + **kwargs + ) + self.auth_type = "SAS" # type: str self.credentials = credentials @@ -5085,13 +5293,16 @@ class ScaleSettings(msrest.serialization.Model): """ _validation = { - 'max_node_count': {'required': True}, + "max_node_count": {"required": True}, } _attribute_map = { - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'node_idle_time_before_scale_down': {'key': 'nodeIdleTimeBeforeScaleDown', 'type': 'duration'}, + "max_node_count": {"key": "maxNodeCount", "type": "int"}, + "min_node_count": {"key": "minNodeCount", "type": "int"}, + "node_idle_time_before_scale_down": { + "key": "nodeIdleTimeBeforeScaleDown", + "type": "duration", + }, } def __init__( @@ -5114,7 +5325,9 @@ def __init__( super(ScaleSettings, self).__init__(**kwargs) self.max_node_count = max_node_count self.min_node_count = min_node_count - self.node_idle_time_before_scale_down = node_idle_time_before_scale_down + self.node_idle_time_before_scale_down = ( + node_idle_time_before_scale_down + ) class ScaleSettingsInformation(msrest.serialization.Model): @@ -5125,14 +5338,11 @@ class ScaleSettingsInformation(msrest.serialization.Model): """ _attribute_map = { - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, + "scale_settings": {"key": "scaleSettings", "type": "ScaleSettings"}, } def __init__( - self, - *, - scale_settings: Optional["ScaleSettings"] = None, - **kwargs + self, *, scale_settings: Optional["ScaleSettings"] = None, **kwargs ): """ :keyword scale_settings: scale settings for AML Compute. @@ -5156,10 +5366,10 @@ class ScriptReference(msrest.serialization.Model): """ _attribute_map = { - 'script_source': {'key': 'scriptSource', 'type': 'str'}, - 'script_data': {'key': 'scriptData', 'type': 'str'}, - 'script_arguments': {'key': 'scriptArguments', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'str'}, + "script_source": {"key": "scriptSource", "type": "str"}, + "script_data": {"key": "scriptData", "type": "str"}, + "script_arguments": {"key": "scriptArguments", "type": "str"}, + "timeout": {"key": "timeout", "type": "str"}, } def __init__( @@ -5198,8 +5408,11 @@ class ScriptsToExecute(msrest.serialization.Model): """ _attribute_map = { - 'startup_script': {'key': 'startupScript', 'type': 'ScriptReference'}, - 'creation_script': {'key': 'creationScript', 'type': 'ScriptReference'}, + "startup_script": {"key": "startupScript", "type": "ScriptReference"}, + "creation_script": { + "key": "creationScript", + "type": "ScriptReference", + }, } def __init__( @@ -5228,14 +5441,11 @@ class ServiceManagedResourcesSettings(msrest.serialization.Model): """ _attribute_map = { - 'cosmos_db': {'key': 'cosmosDb', 'type': 'CosmosDbSettings'}, + "cosmos_db": {"key": "cosmosDb", "type": "CosmosDbSettings"}, } def __init__( - self, - *, - cosmos_db: Optional["CosmosDbSettings"] = None, - **kwargs + self, *, cosmos_db: Optional["CosmosDbSettings"] = None, **kwargs ): """ :keyword cosmos_db: The settings for the service managed cosmosdb account. @@ -5257,9 +5467,9 @@ class ServicePrincipal(msrest.serialization.Model): """ _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + "client_id": {"key": "clientId", "type": "str"}, + "client_secret": {"key": "clientSecret", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, } def __init__( @@ -5284,7 +5494,9 @@ def __init__( self.tenant_id = tenant_id -class ServicePrincipalAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class ServicePrincipalAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """ServicePrincipalAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -5309,17 +5521,17 @@ class ServicePrincipalAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionP """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'metadata': {'key': 'metadata', 'type': '{object}'}, - 'credentials': {'key': 'credentials', 'type': 'ServicePrincipal'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "metadata": {"key": "metadata", "type": "{object}"}, + "credentials": {"key": "credentials", "type": "ServicePrincipal"}, } def __init__( @@ -5349,8 +5561,17 @@ def __init__( :keyword credentials: :paramtype credentials: ~azure.mgmt.machinelearningservices.models.ServicePrincipal """ - super(ServicePrincipalAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, metadata=metadata, **kwargs) - self.auth_type = 'ServicePrincipal' # type: str + super( + ServicePrincipalAuthTypeWorkspaceConnectionProperties, self + ).__init__( + category=category, + target=target, + value=value, + value_format=value_format, + metadata=metadata, + **kwargs + ) + self.auth_type = "ServicePrincipal" # type: str self.credentials = credentials @@ -5366,22 +5587,16 @@ class ServicePrincipalCredentials(msrest.serialization.Model): """ _validation = { - 'client_id': {'required': True}, - 'client_secret': {'required': True}, + "client_id": {"required": True}, + "client_secret": {"required": True}, } _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, + "client_id": {"key": "clientId", "type": "str"}, + "client_secret": {"key": "clientSecret", "type": "str"}, } - def __init__( - self, - *, - client_id: str, - client_secret: str, - **kwargs - ): + def __init__(self, *, client_id: str, client_secret: str, **kwargs): """ :keyword client_id: Required. Client Id. :paramtype client_id: str @@ -5401,14 +5616,11 @@ class SetupScripts(msrest.serialization.Model): """ _attribute_map = { - 'scripts': {'key': 'scripts', 'type': 'ScriptsToExecute'}, + "scripts": {"key": "scripts", "type": "ScriptsToExecute"}, } def __init__( - self, - *, - scripts: Optional["ScriptsToExecute"] = None, - **kwargs + self, *, scripts: Optional["ScriptsToExecute"] = None, **kwargs ): """ :keyword scripts: Customized setup scripts. @@ -5426,15 +5638,10 @@ class SharedAccessSignature(msrest.serialization.Model): """ _attribute_map = { - 'sas': {'key': 'sas', 'type': 'str'}, + "sas": {"key": "sas", "type": "str"}, } - def __init__( - self, - *, - sas: Optional[str] = None, - **kwargs - ): + def __init__(self, *, sas: Optional[str] = None, **kwargs): """ :keyword sas: :paramtype sas: str @@ -5462,11 +5669,14 @@ class SharedPrivateLinkResource(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'private_link_resource_id': {'key': 'properties.privateLinkResourceId', 'type': 'str'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'request_message': {'key': 'properties.requestMessage', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "private_link_resource_id": { + "key": "properties.privateLinkResourceId", + "type": "str", + }, + "group_id": {"key": "properties.groupId", "type": "str"}, + "request_message": {"key": "properties.requestMessage", "type": "str"}, + "status": {"key": "properties.status", "type": "str"}, } def __init__( @@ -5476,7 +5686,9 @@ def __init__( private_link_resource_id: Optional[str] = None, group_id: Optional[str] = None, request_message: Optional[str] = None, - status: Optional[Union[str, "PrivateEndpointServiceConnectionStatus"]] = None, + status: Optional[ + Union[str, "PrivateEndpointServiceConnectionStatus"] + ] = None, **kwargs ): """ @@ -5512,8 +5724,8 @@ class Sku(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, } def __init__( @@ -5553,12 +5765,15 @@ class SslConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'cert': {'key': 'cert', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - 'cname': {'key': 'cname', 'type': 'str'}, - 'leaf_domain_label': {'key': 'leafDomainLabel', 'type': 'str'}, - 'overwrite_existing_domain': {'key': 'overwriteExistingDomain', 'type': 'bool'}, + "status": {"key": "status", "type": "str"}, + "cert": {"key": "cert", "type": "str"}, + "key": {"key": "key", "type": "str"}, + "cname": {"key": "cname", "type": "str"}, + "leaf_domain_label": {"key": "leafDomainLabel", "type": "str"}, + "overwrite_existing_domain": { + "key": "overwriteExistingDomain", + "type": "bool", + }, } def __init__( @@ -5635,26 +5850,29 @@ class SynapseSpark(Compute): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'SynapseSparkProperties'}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, + "properties": {"key": "properties", "type": "SynapseSparkProperties"}, } def __init__( @@ -5680,8 +5898,14 @@ def __init__( :keyword properties: :paramtype properties: ~azure.mgmt.machinelearningservices.models.SynapseSparkProperties """ - super(SynapseSpark, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, **kwargs) - self.compute_type = 'SynapseSpark' # type: str + super(SynapseSpark, self).__init__( + compute_location=compute_location, + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + **kwargs + ) + self.compute_type = "SynapseSpark" # type: str self.properties = properties @@ -5711,16 +5935,22 @@ class SynapseSparkProperties(msrest.serialization.Model): """ _attribute_map = { - 'auto_scale_properties': {'key': 'autoScaleProperties', 'type': 'AutoScaleProperties'}, - 'auto_pause_properties': {'key': 'autoPauseProperties', 'type': 'AutoPauseProperties'}, - 'spark_version': {'key': 'sparkVersion', 'type': 'str'}, - 'node_count': {'key': 'nodeCount', 'type': 'int'}, - 'node_size': {'key': 'nodeSize', 'type': 'str'}, - 'node_size_family': {'key': 'nodeSizeFamily', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'workspace_name': {'key': 'workspaceName', 'type': 'str'}, - 'pool_name': {'key': 'poolName', 'type': 'str'}, + "auto_scale_properties": { + "key": "autoScaleProperties", + "type": "AutoScaleProperties", + }, + "auto_pause_properties": { + "key": "autoPauseProperties", + "type": "AutoPauseProperties", + }, + "spark_version": {"key": "sparkVersion", "type": "str"}, + "node_count": {"key": "nodeCount", "type": "int"}, + "node_size": {"key": "nodeSize", "type": "str"}, + "node_size_family": {"key": "nodeSizeFamily", "type": "str"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, + "resource_group": {"key": "resourceGroup", "type": "str"}, + "workspace_name": {"key": "workspaceName", "type": "str"}, + "pool_name": {"key": "poolName", "type": "str"}, } def __init__( @@ -5795,12 +6025,12 @@ class SystemData(msrest.serialization.Model): """ _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + "created_by": {"key": "createdBy", "type": "str"}, + "created_by_type": {"key": "createdByType", "type": "str"}, + "created_at": {"key": "createdAt", "type": "iso-8601"}, + "last_modified_by": {"key": "lastModifiedBy", "type": "str"}, + "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"}, + "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, } def __init__( @@ -5854,23 +6084,19 @@ class SystemService(msrest.serialization.Model): """ _validation = { - 'system_service_type': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'version': {'readonly': True}, + "system_service_type": {"readonly": True}, + "public_ip_address": {"readonly": True}, + "version": {"readonly": True}, } _attribute_map = { - 'system_service_type': {'key': 'systemServiceType', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, + "system_service_type": {"key": "systemServiceType", "type": "str"}, + "public_ip_address": {"key": "publicIpAddress", "type": "str"}, + "version": {"key": "version", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(SystemService, self).__init__(**kwargs) self.system_service_type = None self.public_ip_address = None @@ -5898,17 +6124,17 @@ class UpdateWorkspaceQuotas(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, + "id": {"readonly": True}, + "type": {"readonly": True}, + "unit": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "limit": {"key": "limit", "type": "long"}, + "unit": {"key": "unit", "type": "str"}, + "status": {"key": "status", "type": "str"}, } def __init__( @@ -5948,21 +6174,17 @@ class UpdateWorkspaceQuotasResult(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[UpdateWorkspaceQuotas]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[UpdateWorkspaceQuotas]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UpdateWorkspaceQuotasResult, self).__init__(**kwargs) self.value = None self.next_link = None @@ -5990,31 +6212,30 @@ class Usage(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'current_value': {'key': 'currentValue', 'type': 'long'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'name': {'key': 'name', 'type': 'UsageName'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ + "id": {"readonly": True}, + "aml_workspace_location": {"readonly": True}, + "type": {"readonly": True}, + "unit": {"readonly": True}, + "current_value": {"readonly": True}, + "limit": {"readonly": True}, + "name": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "aml_workspace_location": { + "key": "amlWorkspaceLocation", + "type": "str", + }, + "type": {"key": "type", "type": "str"}, + "unit": {"key": "unit", "type": "str"}, + "current_value": {"key": "currentValue", "type": "long"}, + "limit": {"key": "limit", "type": "long"}, + "name": {"key": "name", "type": "UsageName"}, + } + + def __init__(self, **kwargs): + """ """ super(Usage, self).__init__(**kwargs) self.id = None self.aml_workspace_location = None @@ -6037,21 +6258,17 @@ class UsageName(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, + "value": {"readonly": True}, + "localized_value": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + "value": {"key": "value", "type": "str"}, + "localized_value": {"key": "localizedValue", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UsageName, self).__init__(**kwargs) self.value = None self.localized_value = None @@ -6072,13 +6289,16 @@ class UserAccountCredentials(msrest.serialization.Model): """ _validation = { - 'admin_user_name': {'required': True}, + "admin_user_name": {"required": True}, } _attribute_map = { - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'admin_user_ssh_public_key': {'key': 'adminUserSshPublicKey', 'type': 'str'}, - 'admin_user_password': {'key': 'adminUserPassword', 'type': 'str'}, + "admin_user_name": {"key": "adminUserName", "type": "str"}, + "admin_user_ssh_public_key": { + "key": "adminUserSshPublicKey", + "type": "str", + }, + "admin_user_password": {"key": "adminUserPassword", "type": "str"}, } def __init__( @@ -6118,23 +6338,19 @@ class UserAssignedIdentity(msrest.serialization.Model): """ _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'client_id': {'readonly': True}, + "principal_id": {"readonly": True}, + "tenant_id": {"readonly": True}, + "client_id": {"readonly": True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UserAssignedIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None @@ -6151,8 +6367,8 @@ class UsernamePassword(msrest.serialization.Model): """ _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, + "username": {"key": "username", "type": "str"}, + "password": {"key": "password", "type": "str"}, } def __init__( @@ -6173,7 +6389,9 @@ def __init__( self.password = password -class UsernamePasswordAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class UsernamePasswordAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """UsernamePasswordAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -6198,17 +6416,17 @@ class UsernamePasswordAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionP """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'metadata': {'key': 'metadata', 'type': '{object}'}, - 'credentials': {'key': 'credentials', 'type': 'UsernamePassword'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "metadata": {"key": "metadata", "type": "{object}"}, + "credentials": {"key": "credentials", "type": "UsernamePassword"}, } def __init__( @@ -6238,8 +6456,17 @@ def __init__( :keyword credentials: :paramtype credentials: ~azure.mgmt.machinelearningservices.models.UsernamePassword """ - super(UsernamePasswordAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, metadata=metadata, **kwargs) - self.auth_type = 'UsernamePassword' # type: str + super( + UsernamePasswordAuthTypeWorkspaceConnectionProperties, self + ).__init__( + category=category, + target=target, + value=value, + value_format=value_format, + metadata=metadata, + **kwargs + ) + self.auth_type = "UsernamePassword" # type: str self.credentials = credentials @@ -6282,26 +6509,32 @@ class VirtualMachine(Compute): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'VirtualMachineProperties'}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, + "properties": { + "key": "properties", + "type": "VirtualMachineProperties", + }, } def __init__( @@ -6327,8 +6560,14 @@ def __init__( :keyword properties: :paramtype properties: ~azure.mgmt.machinelearningservices.models.VirtualMachineProperties """ - super(VirtualMachine, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, **kwargs) - self.compute_type = 'VirtualMachine' # type: str + super(VirtualMachine, self).__init__( + compute_location=compute_location, + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + **kwargs + ) + self.compute_type = "VirtualMachine" # type: str self.properties = properties @@ -6342,19 +6581,14 @@ class VirtualMachineImage(msrest.serialization.Model): """ _validation = { - 'id': {'required': True}, + "id": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, } - def __init__( - self, - *, - id: str, - **kwargs - ): + def __init__(self, *, id: str, **kwargs): """ :keyword id: Required. Virtual Machine image path. :paramtype id: str @@ -6381,11 +6615,17 @@ class VirtualMachineProperties(msrest.serialization.Model): """ _attribute_map = { - 'virtual_machine_size': {'key': 'virtualMachineSize', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'is_notebook_instance_compute': {'key': 'isNotebookInstanceCompute', 'type': 'bool'}, + "virtual_machine_size": {"key": "virtualMachineSize", "type": "str"}, + "ssh_port": {"key": "sshPort", "type": "int"}, + "address": {"key": "address", "type": "str"}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, + "is_notebook_instance_compute": { + "key": "isNotebookInstanceCompute", + "type": "bool", + }, } def __init__( @@ -6435,12 +6675,15 @@ class VirtualMachineSecrets(ComputeSecrets): """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, + "compute_type": {"key": "computeType", "type": "str"}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, } def __init__( @@ -6455,7 +6698,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials """ super(VirtualMachineSecrets, self).__init__(**kwargs) - self.compute_type = 'VirtualMachine' # type: str + self.compute_type = "VirtualMachine" # type: str self.administrator_account = administrator_account @@ -6491,29 +6734,38 @@ class VirtualMachineSize(msrest.serialization.Model): """ _validation = { - 'name': {'readonly': True}, - 'family': {'readonly': True}, - 'v_cp_us': {'readonly': True}, - 'gpus': {'readonly': True}, - 'os_vhd_size_mb': {'readonly': True}, - 'max_resource_volume_mb': {'readonly': True}, - 'memory_gb': {'readonly': True}, - 'low_priority_capable': {'readonly': True}, - 'premium_io': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'v_cp_us': {'key': 'vCPUs', 'type': 'int'}, - 'gpus': {'key': 'gpus', 'type': 'int'}, - 'os_vhd_size_mb': {'key': 'osVhdSizeMB', 'type': 'int'}, - 'max_resource_volume_mb': {'key': 'maxResourceVolumeMB', 'type': 'int'}, - 'memory_gb': {'key': 'memoryGB', 'type': 'float'}, - 'low_priority_capable': {'key': 'lowPriorityCapable', 'type': 'bool'}, - 'premium_io': {'key': 'premiumIO', 'type': 'bool'}, - 'estimated_vm_prices': {'key': 'estimatedVMPrices', 'type': 'EstimatedVMPrices'}, - 'supported_compute_types': {'key': 'supportedComputeTypes', 'type': '[str]'}, + "name": {"readonly": True}, + "family": {"readonly": True}, + "v_cp_us": {"readonly": True}, + "gpus": {"readonly": True}, + "os_vhd_size_mb": {"readonly": True}, + "max_resource_volume_mb": {"readonly": True}, + "memory_gb": {"readonly": True}, + "low_priority_capable": {"readonly": True}, + "premium_io": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "family": {"key": "family", "type": "str"}, + "v_cp_us": {"key": "vCPUs", "type": "int"}, + "gpus": {"key": "gpus", "type": "int"}, + "os_vhd_size_mb": {"key": "osVhdSizeMB", "type": "int"}, + "max_resource_volume_mb": { + "key": "maxResourceVolumeMB", + "type": "int", + }, + "memory_gb": {"key": "memoryGB", "type": "float"}, + "low_priority_capable": {"key": "lowPriorityCapable", "type": "bool"}, + "premium_io": {"key": "premiumIO", "type": "bool"}, + "estimated_vm_prices": { + "key": "estimatedVMPrices", + "type": "EstimatedVMPrices", + }, + "supported_compute_types": { + "key": "supportedComputeTypes", + "type": "[str]", + }, } def __init__( @@ -6552,14 +6804,11 @@ class VirtualMachineSizeListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[VirtualMachineSize]'}, + "value": {"key": "value", "type": "[VirtualMachineSize]"}, } def __init__( - self, - *, - value: Optional[List["VirtualMachineSize"]] = None, - **kwargs + self, *, value: Optional[List["VirtualMachineSize"]] = None, **kwargs ): """ :keyword value: The list of virtual machine sizes supported by AmlCompute. @@ -6583,10 +6832,10 @@ class VirtualMachineSshCredentials(msrest.serialization.Model): """ _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'public_key_data': {'key': 'publicKeyData', 'type': 'str'}, - 'private_key_data': {'key': 'privateKeyData', 'type': 'str'}, + "username": {"key": "username", "type": "str"}, + "password": {"key": "password", "type": "str"}, + "public_key_data": {"key": "publicKeyData", "type": "str"}, + "private_key_data": {"key": "privateKeyData", "type": "str"}, } def __init__( @@ -6717,56 +6966,110 @@ class Workspace(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'workspace_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'service_provisioned_resource_group': {'readonly': True}, - 'private_link_count': {'readonly': True}, - 'private_endpoint_connections': {'readonly': True}, - 'notebook_info': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'storage_hns_enabled': {'readonly': True}, - 'ml_flow_tracking_uri': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'key_vault': {'key': 'properties.keyVault', 'type': 'str'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'storage_account': {'key': 'properties.storageAccount', 'type': 'str'}, - 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionProperty'}, - 'hbi_workspace': {'key': 'properties.hbiWorkspace', 'type': 'bool'}, - 'soft_delete_enabled': {'key': 'properties.softDeleteEnabled', 'type': 'str'}, - 'allow_recover_soft_deleted_workspace': {'key': 'properties.allowRecoverSoftDeletedWorkspace', 'type': 'str'}, - 'service_provisioned_resource_group': {'key': 'properties.serviceProvisionedResourceGroup', 'type': 'str'}, - 'private_link_count': {'key': 'properties.privateLinkCount', 'type': 'int'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'allow_public_access_when_behind_vnet': {'key': 'properties.allowPublicAccessWhenBehindVnet', 'type': 'bool'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, - 'shared_private_link_resources': {'key': 'properties.sharedPrivateLinkResources', 'type': '[SharedPrivateLinkResource]'}, - 'notebook_info': {'key': 'properties.notebookInfo', 'type': 'NotebookResourceInfo'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, - 'storage_hns_enabled': {'key': 'properties.storageHnsEnabled', 'type': 'bool'}, - 'ml_flow_tracking_uri': {'key': 'properties.mlFlowTrackingUri', 'type': 'str'}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "workspace_id": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "service_provisioned_resource_group": {"readonly": True}, + "private_link_count": {"readonly": True}, + "private_endpoint_connections": {"readonly": True}, + "notebook_info": {"readonly": True}, + "tenant_id": {"readonly": True}, + "storage_hns_enabled": {"readonly": True}, + "ml_flow_tracking_uri": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "identity": {"key": "identity", "type": "Identity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "workspace_id": {"key": "properties.workspaceId", "type": "str"}, + "description": {"key": "properties.description", "type": "str"}, + "friendly_name": {"key": "properties.friendlyName", "type": "str"}, + "key_vault": {"key": "properties.keyVault", "type": "str"}, + "application_insights": { + "key": "properties.applicationInsights", + "type": "str", + }, + "container_registry": { + "key": "properties.containerRegistry", + "type": "str", + }, + "storage_account": {"key": "properties.storageAccount", "type": "str"}, + "discovery_url": {"key": "properties.discoveryUrl", "type": "str"}, + "provisioning_state": { + "key": "properties.provisioningState", + "type": "str", + }, + "encryption": { + "key": "properties.encryption", + "type": "EncryptionProperty", + }, + "hbi_workspace": {"key": "properties.hbiWorkspace", "type": "bool"}, + "soft_delete_enabled": { + "key": "properties.softDeleteEnabled", + "type": "str", + }, + "allow_recover_soft_deleted_workspace": { + "key": "properties.allowRecoverSoftDeletedWorkspace", + "type": "str", + }, + "service_provisioned_resource_group": { + "key": "properties.serviceProvisionedResourceGroup", + "type": "str", + }, + "private_link_count": { + "key": "properties.privateLinkCount", + "type": "int", + }, + "image_build_compute": { + "key": "properties.imageBuildCompute", + "type": "str", + }, + "allow_public_access_when_behind_vnet": { + "key": "properties.allowPublicAccessWhenBehindVnet", + "type": "bool", + }, + "public_network_access": { + "key": "properties.publicNetworkAccess", + "type": "str", + }, + "private_endpoint_connections": { + "key": "properties.privateEndpointConnections", + "type": "[PrivateEndpointConnection]", + }, + "shared_private_link_resources": { + "key": "properties.sharedPrivateLinkResources", + "type": "[SharedPrivateLinkResource]", + }, + "notebook_info": { + "key": "properties.notebookInfo", + "type": "NotebookResourceInfo", + }, + "service_managed_resources_settings": { + "key": "properties.serviceManagedResourcesSettings", + "type": "ServiceManagedResourcesSettings", + }, + "primary_user_assigned_identity": { + "key": "properties.primaryUserAssignedIdentity", + "type": "str", + }, + "tenant_id": {"key": "properties.tenantId", "type": "str"}, + "storage_hns_enabled": { + "key": "properties.storageHnsEnabled", + "type": "bool", + }, + "ml_flow_tracking_uri": { + "key": "properties.mlFlowTrackingUri", + "type": "str", + }, } def __init__( @@ -6786,12 +7089,20 @@ def __init__( encryption: Optional["EncryptionProperty"] = None, hbi_workspace: Optional[bool] = False, soft_delete_enabled: Optional[Union[str, "SoftDeleteEnabled"]] = None, - allow_recover_soft_deleted_workspace: Optional[Union[str, "AllowRecoverSoftDeletedWorkspace"]] = None, + allow_recover_soft_deleted_workspace: Optional[ + Union[str, "AllowRecoverSoftDeletedWorkspace"] + ] = None, image_build_compute: Optional[str] = None, allow_public_access_when_behind_vnet: Optional[bool] = False, - public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, - shared_private_link_resources: Optional[List["SharedPrivateLinkResource"]] = None, - service_managed_resources_settings: Optional["ServiceManagedResourcesSettings"] = None, + public_network_access: Optional[ + Union[str, "PublicNetworkAccess"] + ] = None, + shared_private_link_resources: Optional[ + List["SharedPrivateLinkResource"] + ] = None, + service_managed_resources_settings: Optional[ + "ServiceManagedResourcesSettings" + ] = None, primary_user_assigned_identity: Optional[str] = None, **kwargs ): @@ -6874,16 +7185,22 @@ def __init__( self.encryption = encryption self.hbi_workspace = hbi_workspace self.soft_delete_enabled = soft_delete_enabled - self.allow_recover_soft_deleted_workspace = allow_recover_soft_deleted_workspace + self.allow_recover_soft_deleted_workspace = ( + allow_recover_soft_deleted_workspace + ) self.service_provisioned_resource_group = None self.private_link_count = None self.image_build_compute = image_build_compute - self.allow_public_access_when_behind_vnet = allow_public_access_when_behind_vnet + self.allow_public_access_when_behind_vnet = ( + allow_public_access_when_behind_vnet + ) self.public_network_access = public_network_access self.private_endpoint_connections = None self.shared_private_link_resources = shared_private_link_resources self.notebook_info = None - self.service_managed_resources_settings = service_managed_resources_settings + self.service_managed_resources_settings = ( + service_managed_resources_settings + ) self.primary_user_assigned_identity = primary_user_assigned_identity self.tenant_id = None self.storage_hns_enabled = None @@ -6913,37 +7230,41 @@ class WorkspaceConnectionPropertiesV2BasicResource(ResourceAutoGenerated): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'WorkspaceConnectionPropertiesV2'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "WorkspaceConnectionPropertiesV2", + }, } def __init__( - self, - *, - properties: "WorkspaceConnectionPropertiesV2", - **kwargs + self, *, properties: "WorkspaceConnectionPropertiesV2", **kwargs ): """ :keyword properties: Required. :paramtype properties: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 """ - super(WorkspaceConnectionPropertiesV2BasicResource, self).__init__(**kwargs) + super(WorkspaceConnectionPropertiesV2BasicResource, self).__init__( + **kwargs + ) self.properties = properties -class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(msrest.serialization.Model): +class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult( + msrest.serialization.Model +): """WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult. Variables are only populated by the server, and will be ignored when sending a request. @@ -6956,18 +7277,23 @@ class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(msrest.seri """ _validation = { - 'next_link': {'readonly': True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[WorkspaceConnectionPropertiesV2BasicResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": { + "key": "value", + "type": "[WorkspaceConnectionPropertiesV2BasicResource]", + }, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( self, *, - value: Optional[List["WorkspaceConnectionPropertiesV2BasicResource"]] = None, + value: Optional[ + List["WorkspaceConnectionPropertiesV2BasicResource"] + ] = None, **kwargs ): """ @@ -6975,7 +7301,10 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource] """ - super(WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, self).__init__(**kwargs) + super( + WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, + self, + ).__init__(**kwargs) self.value = value self.next_link = None @@ -6992,8 +7321,8 @@ class WorkspaceListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[Workspace]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Workspace]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( @@ -7044,15 +7373,27 @@ class WorkspaceUpdateParameters(msrest.serialization.Model): """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "identity": {"key": "identity", "type": "Identity"}, + "description": {"key": "properties.description", "type": "str"}, + "friendly_name": {"key": "properties.friendlyName", "type": "str"}, + "image_build_compute": { + "key": "properties.imageBuildCompute", + "type": "str", + }, + "service_managed_resources_settings": { + "key": "properties.serviceManagedResourcesSettings", + "type": "ServiceManagedResourcesSettings", + }, + "primary_user_assigned_identity": { + "key": "properties.primaryUserAssignedIdentity", + "type": "str", + }, + "public_network_access": { + "key": "properties.publicNetworkAccess", + "type": "str", + }, } def __init__( @@ -7064,9 +7405,13 @@ def __init__( description: Optional[str] = None, friendly_name: Optional[str] = None, image_build_compute: Optional[str] = None, - service_managed_resources_settings: Optional["ServiceManagedResourcesSettings"] = None, + service_managed_resources_settings: Optional[ + "ServiceManagedResourcesSettings" + ] = None, primary_user_assigned_identity: Optional[str] = None, - public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, + public_network_access: Optional[ + Union[str, "PublicNetworkAccess"] + ] = None, **kwargs ): """ @@ -7100,6 +7445,8 @@ def __init__( self.description = description self.friendly_name = friendly_name self.image_build_compute = image_build_compute - self.service_managed_resources_settings = service_managed_resources_settings + self.service_managed_resources_settings = ( + service_managed_resources_settings + ) self.primary_user_assigned_identity = primary_user_assigned_identity self.public_network_access = public_network_access diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/__init__.py index 45a1d6fd6e25..bbcbcbf270d6 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/__init__.py @@ -12,20 +12,22 @@ from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations from ._quotas_operations import QuotasOperations from ._compute_operations import ComputeOperations -from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_endpoint_connections_operations import ( + PrivateEndpointConnectionsOperations, +) from ._private_link_resources_operations import PrivateLinkResourcesOperations from ._workspace_connections_operations import WorkspaceConnectionsOperations from ._workspace_features_operations import WorkspaceFeaturesOperations __all__ = [ - 'Operations', - 'WorkspacesOperations', - 'UsagesOperations', - 'VirtualMachineSizesOperations', - 'QuotasOperations', - 'ComputeOperations', - 'PrivateEndpointConnectionsOperations', - 'PrivateLinkResourcesOperations', - 'WorkspaceConnectionsOperations', - 'WorkspaceFeaturesOperations', + "Operations", + "WorkspacesOperations", + "UsagesOperations", + "VirtualMachineSizesOperations", + "QuotasOperations", + "ComputeOperations", + "PrivateEndpointConnectionsOperations", + "PrivateLinkResourcesOperations", + "WorkspaceConnectionsOperations", + "WorkspaceFeaturesOperations", ] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_compute_operations.py index 30ab6efbffcc..e42a5542e191 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_compute_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_compute_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -25,9 +31,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + Union, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -425,6 +446,7 @@ def build_restart_request_initial( **kwargs ) + # fmt: on class ComputeOperations(object): """ComputeOperations operations. @@ -472,26 +494,31 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedComputeResourcesList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedComputeResourcesList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedComputeResourcesList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -505,7 +532,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedComputeResourcesList", pipeline_response) + deserialized = self._deserialize( + "PaginatedComputeResourcesList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -514,21 +543,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes"} # type: ignore @distributed_trace def get( @@ -553,40 +590,52 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComputeResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize("ComputeResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore def _create_or_update_initial( self, @@ -597,15 +646,21 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.ComputeResource" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'ComputeResource') + _json = self._serialize.body(parameters, "ComputeResource") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -614,34 +669,47 @@ def _create_or_update_initial( compute_name=compute_name, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if response.status_code == 201: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComputeResource', pipeline_response) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -679,14 +747,21 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -694,33 +769,42 @@ def begin_create_or_update( compute_name=compute_name, parameters=parameters, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore def _update_initial( self, @@ -731,15 +815,21 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> "_models.ComputeResource" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'ClusterUpdateParameters') + _json = self._serialize.body(parameters, "ClusterUpdateParameters") request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -748,27 +838,34 @@ def _update_initial( compute_name=compute_name, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize("ComputeResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace def begin_update( @@ -805,14 +902,21 @@ def begin_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -820,33 +924,42 @@ def begin_update( compute_name=compute_name, parameters=parameters, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore def _delete_initial( self, @@ -857,42 +970,53 @@ def _delete_initial( **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, underlying_resource_action=underlying_resource_action, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace def begin_delete( @@ -928,43 +1052,53 @@ def begin_delete( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, underlying_resource_action=underlying_resource_action, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace def list_nodes( @@ -990,26 +1124,31 @@ def list_nodes( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.AmlComputeNodesInformation] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlComputeNodesInformation"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.AmlComputeNodesInformation"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_nodes_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, - template_url=self.list_nodes.metadata['url'], + template_url=self.list_nodes.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_nodes_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -1023,7 +1162,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("AmlComputeNodesInformation", pipeline_response) + deserialized = self._deserialize( + "AmlComputeNodesInformation", pipeline_response + ) list_of_elem = deserialized.nodes if cls: list_of_elem = cls(list_of_elem) @@ -1032,21 +1173,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_nodes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes'} # type: ignore + list_nodes.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes"} # type: ignore @distributed_trace def list_keys( @@ -1070,40 +1219,52 @@ def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ComputeSecrets :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeSecrets"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeSecrets"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComputeSecrets', pipeline_response) + deserialized = self._deserialize("ComputeSecrets", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys'} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys"} # type: ignore def _start_initial( self, @@ -1113,35 +1274,43 @@ def _start_initial( **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_start_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, - template_url=self._start_initial.metadata['url'], + template_url=self._start_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start'} # type: ignore - + _start_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore @distributed_trace def begin_start( @@ -1172,42 +1341,52 @@ def begin_start( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._start_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start'} # type: ignore + begin_start.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore def _stop_initial( self, @@ -1217,35 +1396,43 @@ def _stop_initial( **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_stop_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, - template_url=self._stop_initial.metadata['url'], + template_url=self._stop_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop'} # type: ignore - + _stop_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore @distributed_trace def begin_stop( @@ -1276,42 +1463,52 @@ def begin_stop( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._stop_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop'} # type: ignore + begin_stop.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore def _restart_initial( self, @@ -1321,35 +1518,43 @@ def _restart_initial( **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_restart_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, - template_url=self._restart_initial.metadata['url'], + template_url=self._restart_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _restart_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart'} # type: ignore - + _restart_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore @distributed_trace def begin_restart( @@ -1380,39 +1585,49 @@ def begin_restart( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._restart_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart'} # type: ignore + begin_restart.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_operations.py index 34c6c0e2ceba..9f07976d8d04 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -23,9 +29,23 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -56,6 +76,7 @@ def build_list_request( **kwargs ) + # fmt: on class Operations(object): """Operations operations. @@ -81,8 +102,7 @@ def __init__(self, client, config, serializer, deserializer): @distributed_trace def list( - self, - **kwargs # type: Any + self, **kwargs # type: Any ): # type: (...) -> Iterable["_models.OperationListResult"] """Lists all of the available Azure Machine Learning Workspaces REST API operations. @@ -93,22 +113,27 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OperationListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( template_url=next_link, ) @@ -118,7 +143,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("OperationListResult", pipeline_response) + deserialized = self._deserialize( + "OperationListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -127,18 +154,26 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/providers/Microsoft.MachineLearningServices/operations'} # type: ignore + list.metadata = {"url": "/providers/Microsoft.MachineLearningServices/operations"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_private_endpoint_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_private_endpoint_connections_operations.py index ca6c75b762ca..8026b9a1df14 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_private_endpoint_connections_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_private_endpoint_connections_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -23,9 +29,23 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -184,6 +204,7 @@ def build_delete_request( **kwargs ) + # fmt: on class PrivateEndpointConnectionsOperations(object): """PrivateEndpointConnectionsOperations operations. @@ -228,25 +249,30 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnectionListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( resource_group_name=resource_group_name, workspace_name=workspace_name, subscription_id=self._config.subscription_id, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( resource_group_name=resource_group_name, workspace_name=workspace_name, @@ -259,7 +285,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) + deserialized = self._deserialize( + "PrivateEndpointConnectionListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -268,21 +296,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections"} # type: ignore @distributed_trace def get( @@ -307,40 +343,54 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, private_endpoint_connection_name=private_endpoint_connection_name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "PrivateEndpointConnection", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace def create_or_update( @@ -368,15 +418,21 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(properties, 'PrivateEndpointConnection') + _json = self._serialize.body(properties, "PrivateEndpointConnection") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -385,28 +441,39 @@ def create_or_update( private_endpoint_connection_name=private_endpoint_connection_name, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "PrivateEndpointConnection", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace def delete( @@ -431,33 +498,43 @@ def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, private_endpoint_connection_name=private_endpoint_connection_name, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_private_link_resources_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_private_link_resources_operations.py index 65e829d9c144..6d4fd223c088 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_private_link_resources_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_private_link_resources_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest @@ -23,8 +29,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Generic, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -65,6 +77,7 @@ def build_list_request( **kwargs ) + # fmt: on class PrivateLinkResourcesOperations(object): """PrivateLinkResourcesOperations operations. @@ -107,35 +120,47 @@ def list( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateLinkResourceListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateLinkResourceListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateLinkResourceListResult', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "PrivateLinkResourceListResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources'} # type: ignore - + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_quotas_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_quotas_operations.py index fdd7cd4d18a5..ba5948a838f1 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_quotas_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_quotas_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -23,9 +29,23 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -102,6 +122,7 @@ def build_list_request( **kwargs ) + # fmt: on class QuotasOperations(object): """QuotasOperations operations. @@ -144,43 +165,60 @@ def update( :rtype: ~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotasResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'QuotaUpdateParameters') + _json = self._serialize.body(parameters, "QuotaUpdateParameters") request = build_update_request( location=location, subscription_id=self._config.subscription_id, content_type=content_type, json=_json, - template_url=self.update.metadata['url'], + template_url=self.update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('UpdateWorkspaceQuotasResult', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "UpdateWorkspaceQuotasResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas'} # type: ignore - + update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas"} # type: ignore @distributed_trace def list( @@ -199,24 +237,29 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListWorkspaceQuotas] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceQuotas"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListWorkspaceQuotas"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, @@ -228,7 +271,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ListWorkspaceQuotas", pipeline_response) + deserialized = self._deserialize( + "ListWorkspaceQuotas", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -237,18 +282,26 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_usages_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_usages_operations.py index 853aaf224112..69b8250de42a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_usages_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_usages_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -23,9 +29,23 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -64,6 +84,7 @@ def build_list_request( **kwargs ) + # fmt: on class UsagesOperations(object): """UsagesOperations operations. @@ -105,24 +126,29 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListUsagesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListUsagesResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, @@ -134,7 +160,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ListUsagesResult", pipeline_response) + deserialized = self._deserialize( + "ListUsagesResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -143,17 +171,23 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_virtual_machine_sizes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_virtual_machine_sizes_operations.py index 5a52be426175..abe3b9f1fcaf 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_virtual_machine_sizes_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_virtual_machine_sizes_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest @@ -23,8 +29,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Generic, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -63,6 +75,7 @@ def build_list_request( **kwargs ) + # fmt: on class VirtualMachineSizesOperations(object): """VirtualMachineSizesOperations operations. @@ -102,34 +115,46 @@ def list( :rtype: ~azure.mgmt.machinelearningservices.models.VirtualMachineSizeListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_request( location=location, subscription_id=self._config.subscription_id, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualMachineSizeListResult', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "VirtualMachineSizeListResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes'} # type: ignore - + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_workspace_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_workspace_connections_operations.py index 8f19b3acf95d..da63dd96309a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_workspace_connections_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_workspace_connections_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -23,9 +29,23 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -191,6 +211,7 @@ def build_list_request( **kwargs ) + # fmt: on class WorkspaceConnectionsOperations(object): """WorkspaceConnectionsOperations operations. @@ -240,15 +261,23 @@ def create( :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'WorkspaceConnectionPropertiesV2BasicResource') + _json = self._serialize.body( + parameters, "WorkspaceConnectionPropertiesV2BasicResource" + ) request = build_create_request( subscription_id=self._config.subscription_id, @@ -257,28 +286,39 @@ def create( connection_name=connection_name, content_type=content_type, json=_json, - template_url=self.create.metadata['url'], + template_url=self.create.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}'} # type: ignore - + create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace def get( @@ -302,40 +342,54 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, connection_name=connection_name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace def delete( @@ -359,36 +413,46 @@ def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, connection_name=connection_name, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace def list( @@ -417,27 +481,32 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, target=target, category=category, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -452,7 +521,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -461,18 +533,26 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_workspace_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_workspace_features_operations.py index 1c141bf3faf4..8391f86faa00 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_workspace_features_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_workspace_features_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -23,9 +29,23 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -66,6 +86,7 @@ def build_list_request( **kwargs ) + # fmt: on class WorkspaceFeaturesOperations(object): """WorkspaceFeaturesOperations operations. @@ -110,25 +131,30 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListAmlUserFeatureResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAmlUserFeatureResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListAmlUserFeatureResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -141,7 +167,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ListAmlUserFeatureResult", pipeline_response) + deserialized = self._deserialize( + "ListAmlUserFeatureResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -150,18 +178,26 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_workspaces_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_workspaces_operations.py index 964287fe6c64..5d33ce4aeb8f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_workspaces_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_01_01_preview/operations/_workspaces_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -25,9 +31,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + Union, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -550,6 +571,7 @@ def build_list_outbound_network_dependencies_endpoints_request( **kwargs ) + # fmt: on class WorkspacesOperations(object): """WorkspacesOperations operations. @@ -592,39 +614,49 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.Workspace :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore def _create_or_update_initial( self, @@ -634,15 +666,21 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.Workspace"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.Workspace"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'Workspace') + _json = self._serialize.body(parameters, "Workspace") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -650,29 +688,36 @@ def _create_or_update_initial( workspace_name=workspace_name, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -703,47 +748,59 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Workspace] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, parameters=parameters, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore def _delete_initial( self, @@ -752,34 +809,42 @@ def _delete_initial( **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace def begin_delete( @@ -807,41 +872,51 @@ def begin_delete( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore def _update_initial( self, @@ -851,15 +926,21 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.Workspace"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.Workspace"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'WorkspaceUpdateParameters') + _json = self._serialize.body(parameters, "WorkspaceUpdateParameters") request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -867,29 +948,36 @@ def _update_initial( workspace_name=workspace_name, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace def begin_update( @@ -920,47 +1008,59 @@ def begin_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Workspace] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, parameters=parameters, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace def list_by_resource_group( @@ -982,25 +1082,30 @@ def list_by_resource_group( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_by_resource_group_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, skip=skip, - template_url=self.list_by_resource_group.metadata['url'], + template_url=self.list_by_resource_group.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_by_resource_group_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -1013,7 +1118,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1022,21 +1129,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces'} # type: ignore + list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore def _diagnose_initial( self, @@ -1046,16 +1161,24 @@ def _diagnose_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.DiagnoseResponseResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if parameters is not None: - _json = self._serialize.body(parameters, 'DiagnoseWorkspaceParameters') + _json = self._serialize.body( + parameters, "DiagnoseWorkspaceParameters" + ) else: _json = None @@ -1065,35 +1188,47 @@ def _diagnose_initial( workspace_name=workspace_name, content_type=content_type, json=_json, - template_url=self._diagnose_initial.metadata['url'], + template_url=self._diagnose_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) + deserialized = self._deserialize( + "DiagnoseResponseResult", pipeline_response + ) if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _diagnose_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose'} # type: ignore - + _diagnose_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore @distributed_trace def begin_diagnose( @@ -1128,47 +1263,67 @@ def begin_diagnose( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.DiagnoseResponseResult] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnoseResponseResult"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DiagnoseResponseResult"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._diagnose_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, parameters=parameters, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) + deserialized = self._deserialize( + "DiagnoseResponseResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_diagnose.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose'} # type: ignore + begin_diagnose.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore @distributed_trace def list_keys( @@ -1190,39 +1345,53 @@ def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListWorkspaceKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceKeysResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListWorkspaceKeysResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ListWorkspaceKeysResult', pipeline_response) + deserialized = self._deserialize( + "ListWorkspaceKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys'} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys"} # type: ignore def _resync_keys_initial( self, @@ -1231,34 +1400,42 @@ def _resync_keys_initial( **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_resync_keys_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self._resync_keys_initial.metadata['url'], + template_url=self._resync_keys_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _resync_keys_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys'} # type: ignore - + _resync_keys_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore @distributed_trace def begin_resync_keys( @@ -1287,41 +1464,51 @@ def begin_resync_keys( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._resync_keys_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_resync_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys'} # type: ignore + begin_resync_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore @distributed_trace def list_by_subscription( @@ -1340,24 +1527,29 @@ def list_by_subscription( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, skip=skip, - template_url=self.list_by_subscription.metadata['url'], + template_url=self.list_by_subscription.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, skip=skip, @@ -1369,7 +1561,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1378,21 +1572,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces'} # type: ignore + list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore @distributed_trace def list_notebook_access_token( @@ -1413,39 +1615,53 @@ def list_notebook_access_token( :rtype: ~azure.mgmt.machinelearningservices.models.NotebookAccessTokenResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookAccessTokenResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.NotebookAccessTokenResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_notebook_access_token_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.list_notebook_access_token.metadata['url'], + template_url=self.list_notebook_access_token.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('NotebookAccessTokenResult', pipeline_response) + deserialized = self._deserialize( + "NotebookAccessTokenResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_notebook_access_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken'} # type: ignore - + list_notebook_access_token.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken"} # type: ignore def _prepare_notebook_initial( self, @@ -1454,40 +1670,52 @@ def _prepare_notebook_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.NotebookResourceInfo"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NotebookResourceInfo"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.NotebookResourceInfo"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_prepare_notebook_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self._prepare_notebook_initial.metadata['url'], + template_url=self._prepare_notebook_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) + deserialized = self._deserialize( + "NotebookResourceInfo", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _prepare_notebook_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook'} # type: ignore - + _prepare_notebook_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore @distributed_trace def begin_prepare_notebook( @@ -1517,44 +1745,62 @@ def begin_prepare_notebook( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.NotebookResourceInfo] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookResourceInfo"] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.NotebookResourceInfo"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._prepare_notebook_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) + deserialized = self._deserialize( + "NotebookResourceInfo", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_prepare_notebook.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook'} # type: ignore + begin_prepare_notebook.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore @distributed_trace def list_storage_account_keys( @@ -1575,39 +1821,53 @@ def list_storage_account_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListStorageAccountKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListStorageAccountKeysResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListStorageAccountKeysResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_storage_account_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.list_storage_account_keys.metadata['url'], + template_url=self.list_storage_account_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ListStorageAccountKeysResult', pipeline_response) + deserialized = self._deserialize( + "ListStorageAccountKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_storage_account_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys'} # type: ignore - + list_storage_account_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys"} # type: ignore @distributed_trace def list_notebook_keys( @@ -1628,39 +1888,53 @@ def list_notebook_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListNotebookKeysResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListNotebookKeysResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_notebook_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.list_notebook_keys.metadata['url'], + template_url=self.list_notebook_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ListNotebookKeysResult', pipeline_response) + deserialized = self._deserialize( + "ListNotebookKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_notebook_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys'} # type: ignore - + list_notebook_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys"} # type: ignore @distributed_trace def list_outbound_network_dependencies_endpoints( @@ -1685,36 +1959,52 @@ def list_outbound_network_dependencies_endpoints( :rtype: ~azure.mgmt.machinelearningservices.models.ExternalFQDNResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExternalFQDNResponse"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ExternalFQDNResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_outbound_network_dependencies_endpoints_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], + template_url=self.list_outbound_network_dependencies_endpoints.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ExternalFQDNResponse', pipeline_response) + deserialized = self._deserialize( + "ExternalFQDNResponse", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_outbound_network_dependencies_endpoints.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints'} # type: ignore - + list_outbound_network_dependencies_endpoints.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/__init__.py index da46614477a9..71cf8fdc020d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/__init__.py @@ -10,9 +10,10 @@ from ._version import VERSION __version__ = VERSION -__all__ = ['AzureMachineLearningWorkspaces'] +__all__ = ["AzureMachineLearningWorkspaces"] # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk + patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/_azure_machine_learning_workspaces.py index 0825110f9ef9..1b6ed0cfd57f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/_azure_machine_learning_workspaces.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/_azure_machine_learning_workspaces.py @@ -14,7 +14,24 @@ from . import models from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import BatchDeploymentsOperations, BatchEndpointsOperations, CodeContainersOperations, CodeVersionsOperations, ComponentContainersOperations, ComponentVersionsOperations, DataContainersOperations, DataVersionsOperations, DatastoresOperations, EnvironmentContainersOperations, EnvironmentVersionsOperations, JobsOperations, ModelContainersOperations, ModelVersionsOperations, OnlineDeploymentsOperations, OnlineEndpointsOperations +from .operations import ( + BatchDeploymentsOperations, + BatchEndpointsOperations, + CodeContainersOperations, + CodeVersionsOperations, + ComponentContainersOperations, + ComponentVersionsOperations, + DataContainersOperations, + DataVersionsOperations, + DatastoresOperations, + EnvironmentContainersOperations, + EnvironmentVersionsOperations, + JobsOperations, + ModelContainersOperations, + ModelVersionsOperations, + OnlineDeploymentsOperations, + OnlineEndpointsOperations, +) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -23,6 +40,7 @@ from azure.core.credentials import TokenCredential from azure.core.rest import HttpRequest, HttpResponse + class AzureMachineLearningWorkspaces(object): """AzureMachineLearningWorkspaces. @@ -87,30 +105,67 @@ def __init__( **kwargs # type: Any ): # type: (...) -> None - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._config = AzureMachineLearningWorkspacesConfiguration( + credential=credential, subscription_id=subscription_id, **kwargs + ) + self._client = ARMPipelineClient( + base_url=base_url, config=self._config, **kwargs + ) + + client_models = { + k: v for k, v in models.__dict__.items() if isinstance(v, type) + } self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.batch_endpoints = BatchEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_deployments = BatchDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_containers = CodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_versions = CodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_containers = ComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_versions = ComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_containers = DataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_versions = DataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.datastores = DatastoresOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_containers = EnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_versions = EnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_containers = ModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_versions = ModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_endpoints = OnlineEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_deployments = OnlineDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - + self.batch_endpoints = BatchEndpointsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.batch_deployments = BatchDeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.code_containers = CodeContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.code_versions = CodeVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.component_containers = ComponentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.component_versions = ComponentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_containers = DataContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_versions = DataVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.datastores = DatastoresOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.environment_containers = EnvironmentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.environment_versions = EnvironmentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.jobs = JobsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.model_containers = ModelContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.model_versions = ModelVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.online_endpoints = OnlineEndpointsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.online_deployments = OnlineDeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) def _send_request( self, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/_configuration.py index 673fbb94e319..fcb320114dcd 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/_configuration.py @@ -10,7 +10,10 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ( + ARMChallengeAuthenticationPolicy, + ARMHttpLoggingPolicy, +) from ._version import VERSION @@ -40,7 +43,9 @@ def __init__( **kwargs # type: Any ): # type: (...) -> None - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) + super(AzureMachineLearningWorkspacesConfiguration, self).__init__( + **kwargs + ) if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: @@ -49,23 +54,44 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2022-02-01-preview" - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) + self.credential_scopes = kwargs.pop( + "credential_scopes", ["https://management.azure.com/.default"] + ) + kwargs.setdefault( + "sdk_moniker", "mgmt-machinelearningservices/{}".format(VERSION) + ) self._configure(**kwargs) def _configure( - self, - **kwargs # type: Any + self, **kwargs # type: Any ): # type: (...) -> None - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') + self.user_agent_policy = kwargs.get( + "user_agent_policy" + ) or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get( + "headers_policy" + ) or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy( + **kwargs + ) + self.logging_policy = kwargs.get( + "logging_policy" + ) or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get( + "http_logging_policy" + ) or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy( + **kwargs + ) + self.custom_hook_policy = kwargs.get( + "custom_hook_policy" + ) or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get( + "redirect_policy" + ) or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = ARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/_patch.py index 74e48ecd07cf..17dbc073e01b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/_patch.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/_patch.py @@ -25,7 +25,8 @@ # # -------------------------------------------------------------------------- + # This file is used for handwritten extensions to the generated code. Example: # https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md def patch_sdk(): - pass \ No newline at end of file + pass diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/_vendor.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/_vendor.py index 138f663c53a4..ed3373e9699d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/_vendor.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/_vendor.py @@ -7,13 +7,20 @@ from azure.core.pipeline.transport import HttpRequest + def _convert_request(request, files=None): data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + request = HttpRequest( + method=request.method, + url=request.url, + headers=request.headers, + data=data, + ) if files: request.set_formdata_body(files) return request + def _format_url_section(template, **kwargs): components = template.split("/") while components: @@ -22,6 +29,8 @@ def _format_url_section(template, **kwargs): except KeyError as key: formatted_components = template.split("/") components = [ - c for c in formatted_components if "{}".format(key.args[0]) not in c + c + for c in formatted_components + if "{}".format(key.args[0]) not in c ] template = "/".join(components) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/__init__.py index f67ccda966f1..b90ec7485f14 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/__init__.py @@ -7,9 +7,11 @@ # -------------------------------------------------------------------------- from ._azure_machine_learning_workspaces import AzureMachineLearningWorkspaces -__all__ = ['AzureMachineLearningWorkspaces'] + +__all__ = ["AzureMachineLearningWorkspaces"] # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk + patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/_azure_machine_learning_workspaces.py index 489f67bd1e79..7f6f1c1fe238 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/_azure_machine_learning_workspaces.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/_azure_machine_learning_workspaces.py @@ -15,12 +15,30 @@ from .. import models from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import BatchDeploymentsOperations, BatchEndpointsOperations, CodeContainersOperations, CodeVersionsOperations, ComponentContainersOperations, ComponentVersionsOperations, DataContainersOperations, DataVersionsOperations, DatastoresOperations, EnvironmentContainersOperations, EnvironmentVersionsOperations, JobsOperations, ModelContainersOperations, ModelVersionsOperations, OnlineDeploymentsOperations, OnlineEndpointsOperations +from .operations import ( + BatchDeploymentsOperations, + BatchEndpointsOperations, + CodeContainersOperations, + CodeVersionsOperations, + ComponentContainersOperations, + ComponentVersionsOperations, + DataContainersOperations, + DataVersionsOperations, + DatastoresOperations, + EnvironmentContainersOperations, + EnvironmentVersionsOperations, + JobsOperations, + ModelContainersOperations, + ModelVersionsOperations, + OnlineDeploymentsOperations, + OnlineEndpointsOperations, +) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential + class AzureMachineLearningWorkspaces: """AzureMachineLearningWorkspaces. @@ -87,35 +105,70 @@ def __init__( base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._config = AzureMachineLearningWorkspacesConfiguration( + credential=credential, subscription_id=subscription_id, **kwargs + ) + self._client = AsyncARMPipelineClient( + base_url=base_url, config=self._config, **kwargs + ) + + client_models = { + k: v for k, v in models.__dict__.items() if isinstance(v, type) + } self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.batch_endpoints = BatchEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_deployments = BatchDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_containers = CodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_versions = CodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_containers = ComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_versions = ComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_containers = DataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_versions = DataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.datastores = DatastoresOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_containers = EnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_versions = EnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_containers = ModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_versions = ModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_endpoints = OnlineEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_deployments = OnlineDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - + self.batch_endpoints = BatchEndpointsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.batch_deployments = BatchDeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.code_containers = CodeContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.code_versions = CodeVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.component_containers = ComponentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.component_versions = ComponentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_containers = DataContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_versions = DataVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.datastores = DatastoresOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.environment_containers = EnvironmentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.environment_versions = EnvironmentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.jobs = JobsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.model_containers = ModelContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.model_versions = ModelVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.online_endpoints = OnlineEndpointsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.online_deployments = OnlineDeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) def _send_request( - self, - request: HttpRequest, - **kwargs: Any + self, request: HttpRequest, **kwargs: Any ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/_configuration.py index 810db0bb39b5..d45ded315970 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/_configuration.py @@ -10,7 +10,10 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy +from azure.mgmt.core.policies import ( + ARMHttpLoggingPolicy, + AsyncARMChallengeAuthenticationPolicy, +) from .._version import VERSION @@ -37,7 +40,9 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) + super(AzureMachineLearningWorkspacesConfiguration, self).__init__( + **kwargs + ) if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: @@ -46,22 +51,41 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2022-02-01-preview" - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) + self.credential_scopes = kwargs.pop( + "credential_scopes", ["https://management.azure.com/.default"] + ) + kwargs.setdefault( + "sdk_moniker", "mgmt-machinelearningservices/{}".format(VERSION) + ) self._configure(**kwargs) - def _configure( - self, - **kwargs: Any - ) -> None: - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get( + "user_agent_policy" + ) or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get( + "headers_policy" + ) or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy( + **kwargs + ) + self.logging_policy = kwargs.get( + "logging_policy" + ) or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get( + "http_logging_policy" + ) or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get( + "retry_policy" + ) or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get( + "custom_hook_policy" + ) or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get( + "redirect_policy" + ) or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/_patch.py index 74e48ecd07cf..17dbc073e01b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/_patch.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/_patch.py @@ -25,7 +25,8 @@ # # -------------------------------------------------------------------------- + # This file is used for handwritten extensions to the generated code. Example: # https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md def patch_sdk(): - pass \ No newline at end of file + pass diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/__init__.py index a3a3e2ff32ec..b383f4ba1be9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/__init__.py @@ -24,20 +24,20 @@ from ._online_deployments_operations import OnlineDeploymentsOperations __all__ = [ - 'BatchEndpointsOperations', - 'BatchDeploymentsOperations', - 'CodeContainersOperations', - 'CodeVersionsOperations', - 'ComponentContainersOperations', - 'ComponentVersionsOperations', - 'DataContainersOperations', - 'DataVersionsOperations', - 'DatastoresOperations', - 'EnvironmentContainersOperations', - 'EnvironmentVersionsOperations', - 'JobsOperations', - 'ModelContainersOperations', - 'ModelVersionsOperations', - 'OnlineEndpointsOperations', - 'OnlineDeploymentsOperations', + "BatchEndpointsOperations", + "BatchDeploymentsOperations", + "CodeContainersOperations", + "CodeVersionsOperations", + "ComponentContainersOperations", + "ComponentVersionsOperations", + "DataContainersOperations", + "DataVersionsOperations", + "DatastoresOperations", + "EnvironmentContainersOperations", + "EnvironmentVersionsOperations", + "JobsOperations", + "ModelContainersOperations", + "ModelVersionsOperations", + "OnlineEndpointsOperations", + "OnlineDeploymentsOperations", ] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_batch_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_batch_deployments_operations.py index 779b06cebbc0..10d2dd57744e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_batch_deployments_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_batch_deployments_operations.py @@ -6,14 +6,33 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, + Union, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -22,9 +41,22 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._batch_deployments_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._batch_deployments_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class BatchDeploymentsOperations: """BatchDeploymentsOperations async operations. @@ -58,7 +90,9 @@ def list( top: Optional[int] = None, skip: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.BatchDeploymentTrackedResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.BatchDeploymentTrackedResourceArmPaginatedResult" + ]: """Lists Batch inference deployments in the workspace. Lists Batch inference deployments in the workspace. @@ -82,14 +116,19 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.BatchDeploymentTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -98,13 +137,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -121,7 +160,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("BatchDeploymentTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "BatchDeploymentTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -130,21 +172,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments"} # type: ignore async def _delete_initial( self, @@ -154,43 +204,59 @@ async def _delete_initial( deployment_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, deployment_name=deployment_name, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_delete( @@ -225,43 +291,53 @@ async def begin_delete( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, deployment_name=deployment_name, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def get( @@ -289,41 +365,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.BatchDeploymentData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeploymentData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, deployment_name=deployment_name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchDeploymentData', pipeline_response) + deserialized = self._deserialize( + "BatchDeploymentData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore async def _update_initial( self, @@ -334,15 +424,23 @@ async def _update_initial( body: "_models.PartialBatchDeploymentPartialTrackedResource", **kwargs: Any ) -> Optional["_models.BatchDeploymentData"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchDeploymentData"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.BatchDeploymentData"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialBatchDeploymentPartialTrackedResource') + _json = self._serialize.body( + body, "PartialBatchDeploymentPartialTrackedResource" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -352,36 +450,53 @@ async def _update_initial( deployment_name=deployment_name, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchDeploymentData', pipeline_response) + deserialized = self._deserialize( + "BatchDeploymentData", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -422,14 +537,21 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchDeploymentData] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentData"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeploymentData"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -438,33 +560,42 @@ async def begin_update( deployment_name=deployment_name, body=body, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeploymentData', pipeline_response) + deserialized = self._deserialize( + "BatchDeploymentData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore async def _create_or_update_initial( self, @@ -475,15 +606,21 @@ async def _create_or_update_initial( body: "_models.BatchDeploymentData", **kwargs: Any ) -> "_models.BatchDeploymentData": - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeploymentData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'BatchDeploymentData') + _json = self._serialize.body(body, "BatchDeploymentData") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -493,35 +630,53 @@ async def _create_or_update_initial( deployment_name=deployment_name, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchDeploymentData', pipeline_response) + deserialized = self._deserialize( + "BatchDeploymentData", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchDeploymentData', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "BatchDeploymentData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -561,14 +716,21 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchDeploymentData] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentData"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeploymentData"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -577,30 +739,39 @@ async def begin_create_or_update( deployment_name=deployment_name, body=body, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeploymentData', pipeline_response) + deserialized = self._deserialize( + "BatchDeploymentData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_batch_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_batch_endpoints_operations.py index daa3a681bd08..15976bf75da2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_batch_endpoints_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_batch_endpoints_operations.py @@ -6,14 +6,33 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, + Union, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -22,9 +41,23 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._batch_endpoints_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_keys_request, build_list_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._batch_endpoints_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_keys_request, + build_list_request, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class BatchEndpointsOperations: """BatchEndpointsOperations async operations. @@ -56,7 +89,9 @@ def list( count: Optional[int] = None, skip: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.BatchEndpointTrackedResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.BatchEndpointTrackedResourceArmPaginatedResult" + ]: """Lists Batch inference endpoint in the workspace. Lists Batch inference endpoint in the workspace. @@ -76,27 +111,32 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.BatchEndpointTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, count=count, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -111,7 +151,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("BatchEndpointTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "BatchEndpointTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -120,21 +163,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints"} # type: ignore async def _delete_initial( self, @@ -143,42 +194,58 @@ async def _delete_initial( endpoint_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_delete( @@ -210,42 +277,52 @@ async def begin_delete( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def get( @@ -270,40 +347,54 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.BatchEndpointData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchEndpointData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchEndpointData', pipeline_response) + deserialized = self._deserialize( + "BatchEndpointData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore async def _update_initial( self, @@ -313,15 +404,23 @@ async def _update_initial( body: "_models.PartialBatchEndpointPartialTrackedResource", **kwargs: Any ) -> Optional["_models.BatchEndpointData"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchEndpointData"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.BatchEndpointData"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialBatchEndpointPartialTrackedResource') + _json = self._serialize.body( + body, "PartialBatchEndpointPartialTrackedResource" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -330,36 +429,53 @@ async def _update_initial( endpoint_name=endpoint_name, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchEndpointData', pipeline_response) + deserialized = self._deserialize( + "BatchEndpointData", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -397,14 +513,21 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpointData] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointData"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchEndpointData"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -412,33 +535,42 @@ async def begin_update( endpoint_name=endpoint_name, body=body, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpointData', pipeline_response) + deserialized = self._deserialize( + "BatchEndpointData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore async def _create_or_update_initial( self, @@ -448,15 +580,21 @@ async def _create_or_update_initial( body: "_models.BatchEndpointData", **kwargs: Any ) -> "_models.BatchEndpointData": - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchEndpointData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'BatchEndpointData') + _json = self._serialize.body(body, "BatchEndpointData") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -465,35 +603,53 @@ async def _create_or_update_initial( endpoint_name=endpoint_name, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchEndpointData', pipeline_response) + deserialized = self._deserialize( + "BatchEndpointData", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchEndpointData', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "BatchEndpointData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -530,14 +686,21 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpointData] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointData"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchEndpointData"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -545,33 +708,42 @@ async def begin_create_or_update( endpoint_name=endpoint_name, body=body, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpointData', pipeline_response) + deserialized = self._deserialize( + "BatchEndpointData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def list_keys( @@ -596,37 +768,49 @@ async def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthKeys"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) + deserialized = self._deserialize("EndpointAuthKeys", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys'} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_code_containers_operations.py index db15fbee09f1..71fae78c0c7c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_code_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_code_containers_operations.py @@ -6,11 +6,26 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, + Union, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -20,9 +35,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._code_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._code_containers_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class CodeContainersOperations: """CodeContainersOperations async operations. @@ -71,26 +98,31 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -104,7 +136,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -113,21 +147,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes"} # type: ignore @distributed_trace_async async def delete( @@ -152,36 +194,46 @@ async def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore @distributed_trace_async async def get( @@ -206,40 +258,54 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeContainerData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeContainerData', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "CodeContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -267,15 +333,21 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeContainerData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeContainerData') + _json = self._serialize.body(body, "CodeContainerData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -284,29 +356,42 @@ async def create_or_update( name=name, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('CodeContainerData', pipeline_response) + deserialized = self._deserialize( + "CodeContainerData", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('CodeContainerData', pipeline_response) + deserialized = self._deserialize( + "CodeContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_code_versions_operations.py index dd78dbeec9e1..d48fc472fd39 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_code_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_code_versions_operations.py @@ -6,11 +6,26 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, + Union, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -20,9 +35,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._code_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._code_versions_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class CodeVersionsOperations: """CodeVersionsOperations async operations. @@ -80,14 +107,19 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -96,13 +128,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -119,7 +151,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -128,21 +162,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions"} # type: ignore @distributed_trace_async async def delete( @@ -170,37 +212,47 @@ async def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version=version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -228,41 +280,53 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersionData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeVersionData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version=version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeVersionData', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize("CodeVersionData", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -293,15 +357,21 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersionData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeVersionData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeVersionData') + _json = self._serialize.body(body, "CodeVersionData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -311,29 +381,42 @@ async def create_or_update( version=version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('CodeVersionData', pipeline_response) + deserialized = self._deserialize( + "CodeVersionData", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('CodeVersionData', pipeline_response) + deserialized = self._deserialize( + "CodeVersionData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_component_containers_operations.py index 99514f21c10d..a83ae2507f1f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_component_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_component_containers_operations.py @@ -6,11 +6,26 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, + Union, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -20,9 +35,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._component_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._component_containers_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ComponentContainersOperations: """ComponentContainersOperations async operations. @@ -74,27 +101,32 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -109,7 +141,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -118,21 +153,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components"} # type: ignore @distributed_trace_async async def delete( @@ -157,36 +200,46 @@ async def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore @distributed_trace_async async def get( @@ -211,40 +264,54 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainerData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentContainerData', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "ComponentContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -272,15 +339,21 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainerData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentContainerData') + _json = self._serialize.body(body, "ComponentContainerData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -289,29 +362,42 @@ async def create_or_update( name=name, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ComponentContainerData', pipeline_response) + deserialized = self._deserialize( + "ComponentContainerData", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ComponentContainerData', pipeline_response) + deserialized = self._deserialize( + "ComponentContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_component_versions_operations.py index 9908e7198437..0f4747d401d0 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_component_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_component_versions_operations.py @@ -6,11 +6,26 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, + Union, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -20,9 +35,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._component_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._component_versions_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ComponentVersionsOperations: """ComponentVersionsOperations async operations. @@ -83,14 +110,19 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -100,13 +132,13 @@ def prepare_request(next_link=None): top=top, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -124,7 +156,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -133,21 +167,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions"} # type: ignore @distributed_trace_async async def delete( @@ -175,37 +217,47 @@ async def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version=version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -233,41 +285,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersionData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersionData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version=version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentVersionData', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "ComponentVersionData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -298,15 +364,21 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersionData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersionData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentVersionData') + _json = self._serialize.body(body, "ComponentVersionData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -316,29 +388,42 @@ async def create_or_update( version=version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ComponentVersionData', pipeline_response) + deserialized = self._deserialize( + "ComponentVersionData", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ComponentVersionData', pipeline_response) + deserialized = self._deserialize( + "ComponentVersionData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_data_containers_operations.py index 749296ff4fbe..1fc1e4365a0a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_data_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_data_containers_operations.py @@ -6,11 +6,26 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, + Union, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -20,9 +35,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._data_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._data_containers_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class DataContainersOperations: """DataContainersOperations async operations. @@ -74,27 +101,32 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -109,7 +141,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -118,21 +152,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data"} # type: ignore @distributed_trace_async async def delete( @@ -157,36 +199,46 @@ async def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore @distributed_trace_async async def get( @@ -211,40 +263,54 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataContainerData', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "DataContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -272,15 +338,21 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DataContainerData') + _json = self._serialize.body(body, "DataContainerData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -289,29 +361,42 @@ async def create_or_update( name=name, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('DataContainerData', pipeline_response) + deserialized = self._deserialize( + "DataContainerData", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('DataContainerData', pipeline_response) + deserialized = self._deserialize( + "DataContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_data_versions_operations.py index cde23f60d1ee..490404b8464b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_data_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_data_versions_operations.py @@ -6,11 +6,26 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, + Union, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -20,9 +35,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._data_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._data_versions_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class DataVersionsOperations: """DataVersionsOperations async operations. @@ -90,14 +117,19 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -108,13 +140,13 @@ def prepare_request(next_link=None): skip=skip, tags=tags, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -133,7 +165,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataVersionBaseResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -142,21 +176,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions"} # type: ignore @distributed_trace_async async def delete( @@ -184,37 +226,47 @@ async def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version=version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -242,41 +294,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBaseData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBaseData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version=version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataVersionBaseData', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "DataVersionBaseData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -307,15 +373,21 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBaseData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBaseData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DataVersionBaseData') + _json = self._serialize.body(body, "DataVersionBaseData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -325,29 +397,42 @@ async def create_or_update( version=version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('DataVersionBaseData', pipeline_response) + deserialized = self._deserialize( + "DataVersionBaseData", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('DataVersionBaseData', pipeline_response) + deserialized = self._deserialize( + "DataVersionBaseData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_datastores_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_datastores_operations.py index 75233892dea4..12ac703dcaa0 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_datastores_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_datastores_operations.py @@ -6,11 +6,27 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, List, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + List, + Optional, + TypeVar, + Union, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -20,9 +36,22 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._datastores_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request, build_list_secrets_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._datastores_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, + build_list_secrets_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class DatastoresOperations: """DatastoresOperations async operations. @@ -89,14 +118,19 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DatastoreResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -108,13 +142,13 @@ def prepare_request(next_link=None): search_text=search_text, order_by=order_by, order_by_asc=order_by_asc, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -134,7 +168,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("DatastoreResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DatastoreResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -143,21 +179,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores"} # type: ignore @distributed_trace_async async def delete( @@ -182,36 +226,46 @@ async def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace_async async def get( @@ -236,40 +290,50 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.DatastoreData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreData"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DatastoreData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DatastoreData', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize("DatastoreData", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -300,15 +364,19 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.DatastoreData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreData"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DatastoreData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DatastoreData') + _json = self._serialize.body(body, "DatastoreData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -318,32 +386,45 @@ async def create_or_update( content_type=content_type, json=_json, skip_validation=skip_validation, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('DatastoreData', pipeline_response) + deserialized = self._deserialize( + "DatastoreData", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('DatastoreData', pipeline_response) + deserialized = self._deserialize( + "DatastoreData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace_async async def list_secrets( @@ -368,37 +449,49 @@ async def list_secrets( :rtype: ~azure.mgmt.machinelearningservices.models.DatastoreSecrets :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreSecrets"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DatastoreSecrets"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_secrets_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.list_secrets.metadata['url'], + template_url=self.list_secrets.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DatastoreSecrets', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize("DatastoreSecrets", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets'} # type: ignore - + list_secrets.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_environment_containers_operations.py index 828587256d53..e8641c3bd1da 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_environment_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_environment_containers_operations.py @@ -6,11 +6,26 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, + Union, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -20,9 +35,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._environment_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._environment_containers_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class EnvironmentContainersOperations: """EnvironmentContainersOperations async operations. @@ -54,7 +81,9 @@ def list( skip: Optional[str] = None, list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, **kwargs: Any - ) -> AsyncIterable["_models.EnvironmentContainerResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.EnvironmentContainerResourceArmPaginatedResult" + ]: """List environment containers. List environment containers. @@ -74,27 +103,32 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -109,7 +143,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -118,21 +155,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments"} # type: ignore @distributed_trace_async async def delete( @@ -157,36 +202,46 @@ async def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore @distributed_trace_async async def get( @@ -211,40 +266,54 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainerData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentContainerData', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "EnvironmentContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -272,15 +341,21 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainerData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentContainerData') + _json = self._serialize.body(body, "EnvironmentContainerData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -289,29 +364,42 @@ async def create_or_update( name=name, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainerData', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainerData", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('EnvironmentContainerData', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_environment_versions_operations.py index 232982ef7b8f..63384b4596e3 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_environment_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_environment_versions_operations.py @@ -6,11 +6,26 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, + Union, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -20,9 +35,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._environment_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._environment_versions_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class EnvironmentVersionsOperations: """EnvironmentVersionsOperations async operations. @@ -83,14 +110,19 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -100,13 +132,13 @@ def prepare_request(next_link=None): top=top, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -124,7 +156,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersionResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -133,21 +168,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions"} # type: ignore @distributed_trace_async async def delete( @@ -175,37 +218,47 @@ async def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version=version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -233,41 +286,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersionData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version=version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentVersionData', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "EnvironmentVersionData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -298,15 +365,21 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersionData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentVersionData') + _json = self._serialize.body(body, "EnvironmentVersionData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -316,29 +389,42 @@ async def create_or_update( version=version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersionData', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersionData", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('EnvironmentVersionData', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersionData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_jobs_operations.py index 91e641c31434..e3d4bce191ba 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_jobs_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_jobs_operations.py @@ -6,14 +6,33 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, + Union, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -22,9 +41,22 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._jobs_operations import build_cancel_request, build_create_or_update_request, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._jobs_operations import ( + build_cancel_request, + build_create_or_update_request, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class JobsOperations: """JobsOperations async operations. @@ -88,14 +120,19 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.JobBaseResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -106,13 +143,13 @@ def prepare_request(next_link=None): list_view_type=list_view_type, scheduled=scheduled, schedule_id=schedule_id, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -131,7 +168,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("JobBaseResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "JobBaseResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -140,21 +179,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs"} # type: ignore async def _delete_initial( self, @@ -163,42 +210,58 @@ async def _delete_initial( id: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}'} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace_async async def begin_delete( @@ -230,42 +293,52 @@ async def begin_delete( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}'} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace_async async def get( @@ -290,40 +363,50 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.JobBaseData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBaseData"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.JobBaseData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('JobBaseData', pipeline_response) + deserialized = self._deserialize("JobBaseData", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -351,15 +434,19 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.JobBaseData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBaseData"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.JobBaseData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'JobBaseData') + _json = self._serialize.body(body, "JobBaseData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -368,32 +455,41 @@ async def create_or_update( id=id, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('JobBaseData', pipeline_response) + deserialized = self._deserialize("JobBaseData", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('JobBaseData', pipeline_response) + deserialized = self._deserialize("JobBaseData", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace_async async def cancel( @@ -418,33 +514,43 @@ async def cancel( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_cancel_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, - template_url=self.cancel.metadata['url'], + template_url=self.cancel.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel'} # type: ignore - + cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_model_containers_operations.py index cc6f0064424e..a02d983c8859 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_model_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_model_containers_operations.py @@ -6,11 +6,26 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, + Union, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -20,9 +35,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._model_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._model_containers_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ModelContainersOperations: """ModelContainersOperations async operations. @@ -77,14 +104,19 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -92,13 +124,13 @@ def prepare_request(next_link=None): skip=skip, count=count, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -114,7 +146,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -123,21 +157,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models"} # type: ignore @distributed_trace_async async def delete( @@ -162,36 +204,46 @@ async def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore @distributed_trace_async async def get( @@ -216,40 +268,54 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainerData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelContainerData', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "ModelContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -277,15 +343,21 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainerData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelContainerData') + _json = self._serialize.body(body, "ModelContainerData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -294,29 +366,42 @@ async def create_or_update( name=name, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ModelContainerData', pipeline_response) + deserialized = self._deserialize( + "ModelContainerData", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ModelContainerData', pipeline_response) + deserialized = self._deserialize( + "ModelContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_model_versions_operations.py index 8af2fa2c3297..3aec5564101c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_model_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_model_versions_operations.py @@ -6,11 +6,26 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, + Union, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -20,9 +35,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._model_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._model_versions_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ModelVersionsOperations: """ModelVersionsOperations async operations. @@ -103,14 +130,19 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -126,13 +158,13 @@ def prepare_request(next_link=None): properties=properties, feed=feed, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -156,7 +188,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -165,21 +199,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions"} # type: ignore @distributed_trace_async async def delete( @@ -207,37 +249,47 @@ async def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version=version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -265,41 +317,53 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersionData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelVersionData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version=version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelVersionData', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize("ModelVersionData", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -330,15 +394,21 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersionData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelVersionData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelVersionData') + _json = self._serialize.body(body, "ModelVersionData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -348,29 +418,42 @@ async def create_or_update( version=version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ModelVersionData', pipeline_response) + deserialized = self._deserialize( + "ModelVersionData", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ModelVersionData', pipeline_response) + deserialized = self._deserialize( + "ModelVersionData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_online_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_online_deployments_operations.py index 58b8185691ea..baef0be96dbc 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_online_deployments_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_online_deployments_operations.py @@ -6,14 +6,33 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, + Union, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -22,9 +41,24 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._online_deployments_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_logs_request, build_get_request, build_list_request, build_list_skus_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._online_deployments_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_logs_request, + build_get_request, + build_list_request, + build_list_skus_request, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class OnlineDeploymentsOperations: """OnlineDeploymentsOperations async operations. @@ -58,7 +92,9 @@ def list( top: Optional[int] = None, skip: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.OnlineDeploymentTrackedResourceArmPaginatedResult" + ]: """List Inference Endpoint Deployments. List Inference Endpoint Deployments. @@ -82,14 +118,19 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OnlineDeploymentTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -98,13 +139,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -121,7 +162,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineDeploymentTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "OnlineDeploymentTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -130,21 +174,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments"} # type: ignore async def _delete_initial( self, @@ -154,43 +206,59 @@ async def _delete_initial( deployment_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, deployment_name=deployment_name, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_delete( @@ -225,43 +293,53 @@ async def begin_delete( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, deployment_name=deployment_name, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def get( @@ -289,41 +367,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.OnlineDeploymentData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeploymentData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, deployment_name=deployment_name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('OnlineDeploymentData', pipeline_response) + deserialized = self._deserialize( + "OnlineDeploymentData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore async def _update_initial( self, @@ -334,15 +426,23 @@ async def _update_initial( body: "_models.PartialOnlineDeploymentPartialTrackedResource", **kwargs: Any ) -> Optional["_models.OnlineDeploymentData"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineDeploymentData"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.OnlineDeploymentData"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialOnlineDeploymentPartialTrackedResource') + _json = self._serialize.body( + body, "PartialOnlineDeploymentPartialTrackedResource" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -352,36 +452,53 @@ async def _update_initial( deployment_name=deployment_name, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineDeploymentData', pipeline_response) + deserialized = self._deserialize( + "OnlineDeploymentData", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -422,14 +539,21 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeploymentData] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentData"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeploymentData"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -438,33 +562,42 @@ async def begin_update( deployment_name=deployment_name, body=body, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeploymentData', pipeline_response) + deserialized = self._deserialize( + "OnlineDeploymentData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore async def _create_or_update_initial( self, @@ -475,15 +608,21 @@ async def _create_or_update_initial( body: "_models.OnlineDeploymentData", **kwargs: Any ) -> "_models.OnlineDeploymentData": - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeploymentData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'OnlineDeploymentData') + _json = self._serialize.body(body, "OnlineDeploymentData") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -493,35 +632,53 @@ async def _create_or_update_initial( deployment_name=deployment_name, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineDeploymentData', pipeline_response) + deserialized = self._deserialize( + "OnlineDeploymentData", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineDeploymentData', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "OnlineDeploymentData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -561,14 +718,21 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeploymentData] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentData"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeploymentData"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -577,33 +741,42 @@ async def begin_create_or_update( deployment_name=deployment_name, body=body, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeploymentData', pipeline_response) + deserialized = self._deserialize( + "OnlineDeploymentData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def get_logs( @@ -634,15 +807,21 @@ async def get_logs( :rtype: ~azure.mgmt.machinelearningservices.models.DeploymentLogs :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentLogs"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DeploymentLogs"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DeploymentLogsRequest') + _json = self._serialize.body(body, "DeploymentLogsRequest") request = build_get_logs_request( subscription_id=self._config.subscription_id, @@ -652,28 +831,37 @@ async def get_logs( deployment_name=deployment_name, content_type=content_type, json=_json, - template_url=self.get_logs.metadata['url'], + template_url=self.get_logs.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DeploymentLogs', pipeline_response) + deserialized = self._deserialize("DeploymentLogs", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_logs.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs'} # type: ignore - + get_logs.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs"} # type: ignore @distributed_trace def list_skus( @@ -709,14 +897,19 @@ def list_skus( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.SkuResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.SkuResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_skus_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -725,13 +918,13 @@ def prepare_request(next_link=None): deployment_name=deployment_name, count=count, skip=skip, - template_url=self.list_skus.metadata['url'], + template_url=self.list_skus.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_skus_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -748,7 +941,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("SkuResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "SkuResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -757,18 +952,26 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_skus.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus'} # type: ignore + list_skus.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_online_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_online_endpoints_operations.py index b660396ea34f..f2a140916d84 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_online_endpoints_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/aio/operations/_online_endpoints_operations.py @@ -6,14 +6,33 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, + Union, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -22,9 +41,25 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._online_endpoints_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_get_token_request, build_list_keys_request, build_list_request, build_regenerate_keys_request_initial, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._online_endpoints_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_get_token_request, + build_list_keys_request, + build_list_request, + build_regenerate_keys_request_initial, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class OnlineEndpointsOperations: """OnlineEndpointsOperations async operations. @@ -55,13 +90,17 @@ def list( workspace_name: str, name: Optional[str] = None, count: Optional[int] = None, - compute_type: Optional[Union[str, "_models.EndpointComputeType"]] = None, + compute_type: Optional[ + Union[str, "_models.EndpointComputeType"] + ] = None, skip: Optional[str] = None, tags: Optional[str] = None, properties: Optional[str] = None, order_by: Optional[Union[str, "_models.OrderString"]] = None, **kwargs: Any - ) -> AsyncIterable["_models.OnlineEndpointTrackedResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.OnlineEndpointTrackedResourceArmPaginatedResult" + ]: """List Online Endpoints. List Online Endpoints. @@ -94,14 +133,19 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OnlineEndpointTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -113,13 +157,13 @@ def prepare_request(next_link=None): tags=tags, properties=properties, order_by=order_by, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -139,7 +183,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineEndpointTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "OnlineEndpointTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -148,21 +195,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints"} # type: ignore async def _delete_initial( self, @@ -171,42 +226,58 @@ async def _delete_initial( endpoint_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_delete( @@ -238,42 +309,52 @@ async def begin_delete( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def get( @@ -298,40 +379,54 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.OnlineEndpointData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpointData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('OnlineEndpointData', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpointData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore async def _update_initial( self, @@ -341,15 +436,23 @@ async def _update_initial( body: "_models.PartialOnlineEndpointPartialTrackedResource", **kwargs: Any ) -> Optional["_models.OnlineEndpointData"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineEndpointData"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.OnlineEndpointData"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialOnlineEndpointPartialTrackedResource') + _json = self._serialize.body( + body, "PartialOnlineEndpointPartialTrackedResource" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -358,36 +461,53 @@ async def _update_initial( endpoint_name=endpoint_name, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpointData', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpointData", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -425,14 +545,21 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpointData] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointData"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpointData"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -440,33 +567,42 @@ async def begin_update( endpoint_name=endpoint_name, body=body, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpointData', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpointData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore async def _create_or_update_initial( self, @@ -476,15 +612,21 @@ async def _create_or_update_initial( body: "_models.OnlineEndpointData", **kwargs: Any ) -> "_models.OnlineEndpointData": - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpointData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'OnlineEndpointData') + _json = self._serialize.body(body, "OnlineEndpointData") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -493,35 +635,53 @@ async def _create_or_update_initial( endpoint_name=endpoint_name, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpointData', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpointData", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineEndpointData', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "OnlineEndpointData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -558,14 +718,21 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpointData] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointData"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpointData"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -573,33 +740,42 @@ async def begin_create_or_update( endpoint_name=endpoint_name, body=body, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpointData', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpointData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def list_keys( @@ -624,40 +800,52 @@ async def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthKeys"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) + deserialized = self._deserialize("EndpointAuthKeys", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys'} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys"} # type: ignore async def _regenerate_keys_initial( self, @@ -667,15 +855,19 @@ async def _regenerate_keys_initial( body: "_models.RegenerateEndpointKeysRequest", **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'RegenerateEndpointKeysRequest') + _json = self._serialize.body(body, "RegenerateEndpointKeysRequest") request = build_regenerate_keys_request_initial( subscription_id=self._config.subscription_id, @@ -684,29 +876,39 @@ async def _regenerate_keys_initial( endpoint_name=endpoint_name, content_type=content_type, json=_json, - template_url=self._regenerate_keys_initial.metadata['url'], + template_url=self._regenerate_keys_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _regenerate_keys_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys'} # type: ignore - + _regenerate_keys_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore @distributed_trace_async async def begin_regenerate_keys( @@ -741,14 +943,19 @@ async def begin_regenerate_keys( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._regenerate_keys_initial( resource_group_name=resource_group_name, @@ -756,30 +963,41 @@ async def begin_regenerate_keys( endpoint_name=endpoint_name, body=body, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_regenerate_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys'} # type: ignore + begin_regenerate_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore @distributed_trace_async async def get_token( @@ -804,37 +1022,51 @@ async def get_token( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthToken :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthToken"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthToken"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_token_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, - template_url=self.get_token.metadata['url'], + template_url=self.get_token.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EndpointAuthToken', pipeline_response) + deserialized = self._deserialize( + "EndpointAuthToken", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token'} # type: ignore - + get_token.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/models/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/models/__init__.py index c05abc0e06b5..edfb0dee1170 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/models/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/models/__init__.py @@ -562,313 +562,313 @@ ) __all__ = [ - 'AccountKeyDatastoreCredentials', - 'AccountKeyDatastoreSecrets', - 'AmlToken', - 'AssetBase', - 'AssetContainer', - 'AssetJobInput', - 'AssetJobOutput', - 'AssetReferenceBase', - 'AutoForecastHorizon', - 'AutoMLJob', - 'AutoMLVertical', - 'AutoNCrossValidations', - 'AutoSeasonality', - 'AutoTargetLags', - 'AutoTargetRollingWindowSize', - 'AzureBlobDatastore', - 'AzureDataLakeGen1Datastore', - 'AzureDataLakeGen2Datastore', - 'AzureFileDatastore', - 'BanditPolicy', - 'BatchDeploymentData', - 'BatchDeploymentDetails', - 'BatchDeploymentTrackedResourceArmPaginatedResult', - 'BatchEndpointData', - 'BatchEndpointDefaults', - 'BatchEndpointDetails', - 'BatchEndpointTrackedResourceArmPaginatedResult', - 'BatchRetrySettings', - 'BayesianSamplingAlgorithm', - 'BuildContext', - 'CertificateDatastoreCredentials', - 'CertificateDatastoreSecrets', - 'Classification', - 'CodeConfiguration', - 'CodeContainerData', - 'CodeContainerDetails', - 'CodeContainerResourceArmPaginatedResult', - 'CodeVersionData', - 'CodeVersionDetails', - 'CodeVersionResourceArmPaginatedResult', - 'ColumnTransformer', - 'CommandJob', - 'CommandJobLimits', - 'ComponentContainerData', - 'ComponentContainerDetails', - 'ComponentContainerResourceArmPaginatedResult', - 'ComponentVersionData', - 'ComponentVersionDetails', - 'ComponentVersionResourceArmPaginatedResult', - 'ContainerResourceRequirements', - 'ContainerResourceSettings', - 'CronSchedule', - 'CustomForecastHorizon', - 'CustomModelJobInput', - 'CustomModelJobOutput', - 'CustomNCrossValidations', - 'CustomSeasonality', - 'CustomTargetLags', - 'CustomTargetRollingWindowSize', - 'DataContainerData', - 'DataContainerDetails', - 'DataContainerResourceArmPaginatedResult', - 'DataPathAssetReference', - 'DataSettings', - 'DataVersionBaseData', - 'DataVersionBaseDetails', - 'DataVersionBaseResourceArmPaginatedResult', - 'DatastoreCredentials', - 'DatastoreData', - 'DatastoreDetails', - 'DatastoreResourceArmPaginatedResult', - 'DatastoreSecrets', - 'DefaultScaleSettings', - 'DeploymentLogs', - 'DeploymentLogsRequest', - 'DistributionConfiguration', - 'EarlyTerminationPolicy', - 'EndpointAuthKeys', - 'EndpointAuthToken', - 'EndpointDeploymentPropertiesBase', - 'EndpointPropertiesBase', - 'EnvironmentContainerData', - 'EnvironmentContainerDetails', - 'EnvironmentContainerResourceArmPaginatedResult', - 'EnvironmentVersionData', - 'EnvironmentVersionDetails', - 'EnvironmentVersionResourceArmPaginatedResult', - 'ErrorAdditionalInfo', - 'ErrorDetail', - 'ErrorResponse', - 'FeaturizationSettings', - 'FlavorData', - 'ForecastHorizon', - 'Forecasting', - 'ForecastingSettings', - 'GridSamplingAlgorithm', - 'HdfsDatastore', - 'IdAssetReference', - 'IdentityConfiguration', - 'ImageClassification', - 'ImageClassificationBase', - 'ImageClassificationMultilabel', - 'ImageInstanceSegmentation', - 'ImageLimitSettings', - 'ImageModelDistributionSettings', - 'ImageModelDistributionSettingsClassification', - 'ImageModelDistributionSettingsObjectDetection', - 'ImageModelSettings', - 'ImageModelSettingsClassification', - 'ImageModelSettingsObjectDetection', - 'ImageObjectDetection', - 'ImageObjectDetectionBase', - 'ImageSweepLimitSettings', - 'ImageSweepSettings', - 'ImageVertical', - 'ImageVerticalDataSettings', - 'ImageVerticalValidationDataSettings', - 'InferenceContainerProperties', - 'JobBaseData', - 'JobBaseDetails', - 'JobBaseResourceArmPaginatedResult', - 'JobInput', - 'JobLimits', - 'JobOutput', - 'JobService', - 'KerberosCredentials', - 'KerberosKeytabCredentials', - 'KerberosKeytabSecrets', - 'KerberosPasswordCredentials', - 'KerberosPasswordSecrets', - 'KubernetesOnlineDeployment', - 'LiteralJobInput', - 'MLFlowModelJobInput', - 'MLFlowModelJobOutput', - 'MLTableData', - 'MLTableJobInput', - 'MLTableJobOutput', - 'ManagedIdentity', - 'ManagedOnlineDeployment', - 'ManagedServiceIdentity', - 'MedianStoppingPolicy', - 'ModelContainerData', - 'ModelContainerDetails', - 'ModelContainerResourceArmPaginatedResult', - 'ModelVersionData', - 'ModelVersionDetails', - 'ModelVersionResourceArmPaginatedResult', - 'Mpi', - 'NCrossValidations', - 'NlpVertical', - 'NlpVerticalDataSettings', - 'NlpVerticalFeaturizationSettings', - 'NlpVerticalLimitSettings', - 'NlpVerticalValidationDataSettings', - 'NoneDatastoreCredentials', - 'Objective', - 'OnlineDeploymentData', - 'OnlineDeploymentDetails', - 'OnlineDeploymentTrackedResourceArmPaginatedResult', - 'OnlineEndpointData', - 'OnlineEndpointDetails', - 'OnlineEndpointTrackedResourceArmPaginatedResult', - 'OnlineRequestSettings', - 'OnlineScaleSettings', - 'OutputPathAssetReference', - 'PartialAssetReferenceBase', - 'PartialBatchDeployment', - 'PartialBatchDeploymentPartialTrackedResource', - 'PartialBatchEndpoint', - 'PartialBatchEndpointPartialTrackedResource', - 'PartialBatchRetrySettings', - 'PartialCodeConfiguration', - 'PartialDataPathAssetReference', - 'PartialIdAssetReference', - 'PartialKubernetesOnlineDeployment', - 'PartialManagedOnlineDeployment', - 'PartialManagedServiceIdentity', - 'PartialOnlineDeployment', - 'PartialOnlineDeploymentPartialTrackedResource', - 'PartialOnlineEndpoint', - 'PartialOnlineEndpointPartialTrackedResource', - 'PartialOutputPathAssetReference', - 'PartialSku', - 'PipelineJob', - 'ProbeSettings', - 'PyTorch', - 'RandomSamplingAlgorithm', - 'RecurrencePattern', - 'RecurrenceSchedule', - 'RegenerateEndpointKeysRequest', - 'Regression', - 'Resource', - 'ResourceBase', - 'ResourceConfiguration', - 'Route', - 'SamplingAlgorithm', - 'SasDatastoreCredentials', - 'SasDatastoreSecrets', - 'ScheduleBase', - 'Seasonality', - 'ServicePrincipalDatastoreCredentials', - 'ServicePrincipalDatastoreSecrets', - 'Sku', - 'SkuCapacity', - 'SkuResource', - 'SkuResourceArmPaginatedResult', - 'SkuSetting', - 'StackEnsembleSettings', - 'SweepJob', - 'SweepJobLimits', - 'SystemData', - 'TableVertical', - 'TableVerticalDataSettings', - 'TableVerticalFeaturizationSettings', - 'TableVerticalLimitSettings', - 'TableVerticalValidationDataSettings', - 'TargetLags', - 'TargetRollingWindowSize', - 'TargetUtilizationScaleSettings', - 'TensorFlow', - 'TestDataSettings', - 'TextClassification', - 'TextClassificationMultilabel', - 'TextNer', - 'TrackedResource', - 'TrainingDataSettings', - 'TrainingSettings', - 'TrialComponent', - 'TritonModelJobInput', - 'TritonModelJobOutput', - 'TruncationSelectionPolicy', - 'UriFileDataVersion', - 'UriFileJobInput', - 'UriFileJobOutput', - 'UriFolderDataVersion', - 'UriFolderJobInput', - 'UriFolderJobOutput', - 'UserAssignedIdentity', - 'UserIdentity', - 'ValidationDataSettings', - 'BatchLoggingLevel', - 'BatchOutputAction', - 'ClassificationModels', - 'ClassificationMultilabelPrimaryMetrics', - 'ClassificationPrimaryMetrics', - 'ContainerType', - 'CreatedByType', - 'CredentialsType', - 'DataType', - 'DatastoreType', - 'DeploymentProvisioningState', - 'DistributionType', - 'EarlyTerminationPolicyType', - 'EgressPublicNetworkAccessType', - 'EndpointAuthMode', - 'EndpointComputeType', - 'EndpointProvisioningState', - 'EnvironmentType', - 'FeatureLags', - 'FeaturizationMode', - 'ForecastHorizonMode', - 'ForecastingModels', - 'ForecastingPrimaryMetrics', - 'Goal', - 'IdentityConfigurationType', - 'InputDeliveryMode', - 'InstanceSegmentationPrimaryMetrics', - 'JobInputType', - 'JobLimitsType', - 'JobOutputType', - 'JobStatus', - 'JobType', - 'KeyType', - 'LearningRateScheduler', - 'ListViewType', - 'LogVerbosity', - 'ManagedServiceIdentityType', - 'ModelSize', - 'ModelType', - 'NCrossValidationsMode', - 'ObjectDetectionPrimaryMetrics', - 'OperatingSystemType', - 'OrderString', - 'OutputDeliveryMode', - 'PublicNetworkAccessType', - 'RandomSamplingAlgorithmRule', - 'RecurrenceFrequency', - 'ReferenceType', - 'RegressionModels', - 'RegressionPrimaryMetrics', - 'SamplingAlgorithmType', - 'ScaleType', - 'ScheduleStatus', - 'ScheduleType', - 'SeasonalityMode', - 'SecretsType', - 'ServiceDataAccessAuthIdentity', - 'ShortSeriesHandlingConfiguration', - 'SkuScaleType', - 'SkuTier', - 'StackMetaLearnerType', - 'StochasticOptimizer', - 'TargetAggregationFunction', - 'TargetLagsMode', - 'TargetRollingWindowSizeMode', - 'TaskType', - 'UseStl', - 'ValidationMetricType', - 'Weekday', + "AccountKeyDatastoreCredentials", + "AccountKeyDatastoreSecrets", + "AmlToken", + "AssetBase", + "AssetContainer", + "AssetJobInput", + "AssetJobOutput", + "AssetReferenceBase", + "AutoForecastHorizon", + "AutoMLJob", + "AutoMLVertical", + "AutoNCrossValidations", + "AutoSeasonality", + "AutoTargetLags", + "AutoTargetRollingWindowSize", + "AzureBlobDatastore", + "AzureDataLakeGen1Datastore", + "AzureDataLakeGen2Datastore", + "AzureFileDatastore", + "BanditPolicy", + "BatchDeploymentData", + "BatchDeploymentDetails", + "BatchDeploymentTrackedResourceArmPaginatedResult", + "BatchEndpointData", + "BatchEndpointDefaults", + "BatchEndpointDetails", + "BatchEndpointTrackedResourceArmPaginatedResult", + "BatchRetrySettings", + "BayesianSamplingAlgorithm", + "BuildContext", + "CertificateDatastoreCredentials", + "CertificateDatastoreSecrets", + "Classification", + "CodeConfiguration", + "CodeContainerData", + "CodeContainerDetails", + "CodeContainerResourceArmPaginatedResult", + "CodeVersionData", + "CodeVersionDetails", + "CodeVersionResourceArmPaginatedResult", + "ColumnTransformer", + "CommandJob", + "CommandJobLimits", + "ComponentContainerData", + "ComponentContainerDetails", + "ComponentContainerResourceArmPaginatedResult", + "ComponentVersionData", + "ComponentVersionDetails", + "ComponentVersionResourceArmPaginatedResult", + "ContainerResourceRequirements", + "ContainerResourceSettings", + "CronSchedule", + "CustomForecastHorizon", + "CustomModelJobInput", + "CustomModelJobOutput", + "CustomNCrossValidations", + "CustomSeasonality", + "CustomTargetLags", + "CustomTargetRollingWindowSize", + "DataContainerData", + "DataContainerDetails", + "DataContainerResourceArmPaginatedResult", + "DataPathAssetReference", + "DataSettings", + "DataVersionBaseData", + "DataVersionBaseDetails", + "DataVersionBaseResourceArmPaginatedResult", + "DatastoreCredentials", + "DatastoreData", + "DatastoreDetails", + "DatastoreResourceArmPaginatedResult", + "DatastoreSecrets", + "DefaultScaleSettings", + "DeploymentLogs", + "DeploymentLogsRequest", + "DistributionConfiguration", + "EarlyTerminationPolicy", + "EndpointAuthKeys", + "EndpointAuthToken", + "EndpointDeploymentPropertiesBase", + "EndpointPropertiesBase", + "EnvironmentContainerData", + "EnvironmentContainerDetails", + "EnvironmentContainerResourceArmPaginatedResult", + "EnvironmentVersionData", + "EnvironmentVersionDetails", + "EnvironmentVersionResourceArmPaginatedResult", + "ErrorAdditionalInfo", + "ErrorDetail", + "ErrorResponse", + "FeaturizationSettings", + "FlavorData", + "ForecastHorizon", + "Forecasting", + "ForecastingSettings", + "GridSamplingAlgorithm", + "HdfsDatastore", + "IdAssetReference", + "IdentityConfiguration", + "ImageClassification", + "ImageClassificationBase", + "ImageClassificationMultilabel", + "ImageInstanceSegmentation", + "ImageLimitSettings", + "ImageModelDistributionSettings", + "ImageModelDistributionSettingsClassification", + "ImageModelDistributionSettingsObjectDetection", + "ImageModelSettings", + "ImageModelSettingsClassification", + "ImageModelSettingsObjectDetection", + "ImageObjectDetection", + "ImageObjectDetectionBase", + "ImageSweepLimitSettings", + "ImageSweepSettings", + "ImageVertical", + "ImageVerticalDataSettings", + "ImageVerticalValidationDataSettings", + "InferenceContainerProperties", + "JobBaseData", + "JobBaseDetails", + "JobBaseResourceArmPaginatedResult", + "JobInput", + "JobLimits", + "JobOutput", + "JobService", + "KerberosCredentials", + "KerberosKeytabCredentials", + "KerberosKeytabSecrets", + "KerberosPasswordCredentials", + "KerberosPasswordSecrets", + "KubernetesOnlineDeployment", + "LiteralJobInput", + "MLFlowModelJobInput", + "MLFlowModelJobOutput", + "MLTableData", + "MLTableJobInput", + "MLTableJobOutput", + "ManagedIdentity", + "ManagedOnlineDeployment", + "ManagedServiceIdentity", + "MedianStoppingPolicy", + "ModelContainerData", + "ModelContainerDetails", + "ModelContainerResourceArmPaginatedResult", + "ModelVersionData", + "ModelVersionDetails", + "ModelVersionResourceArmPaginatedResult", + "Mpi", + "NCrossValidations", + "NlpVertical", + "NlpVerticalDataSettings", + "NlpVerticalFeaturizationSettings", + "NlpVerticalLimitSettings", + "NlpVerticalValidationDataSettings", + "NoneDatastoreCredentials", + "Objective", + "OnlineDeploymentData", + "OnlineDeploymentDetails", + "OnlineDeploymentTrackedResourceArmPaginatedResult", + "OnlineEndpointData", + "OnlineEndpointDetails", + "OnlineEndpointTrackedResourceArmPaginatedResult", + "OnlineRequestSettings", + "OnlineScaleSettings", + "OutputPathAssetReference", + "PartialAssetReferenceBase", + "PartialBatchDeployment", + "PartialBatchDeploymentPartialTrackedResource", + "PartialBatchEndpoint", + "PartialBatchEndpointPartialTrackedResource", + "PartialBatchRetrySettings", + "PartialCodeConfiguration", + "PartialDataPathAssetReference", + "PartialIdAssetReference", + "PartialKubernetesOnlineDeployment", + "PartialManagedOnlineDeployment", + "PartialManagedServiceIdentity", + "PartialOnlineDeployment", + "PartialOnlineDeploymentPartialTrackedResource", + "PartialOnlineEndpoint", + "PartialOnlineEndpointPartialTrackedResource", + "PartialOutputPathAssetReference", + "PartialSku", + "PipelineJob", + "ProbeSettings", + "PyTorch", + "RandomSamplingAlgorithm", + "RecurrencePattern", + "RecurrenceSchedule", + "RegenerateEndpointKeysRequest", + "Regression", + "Resource", + "ResourceBase", + "ResourceConfiguration", + "Route", + "SamplingAlgorithm", + "SasDatastoreCredentials", + "SasDatastoreSecrets", + "ScheduleBase", + "Seasonality", + "ServicePrincipalDatastoreCredentials", + "ServicePrincipalDatastoreSecrets", + "Sku", + "SkuCapacity", + "SkuResource", + "SkuResourceArmPaginatedResult", + "SkuSetting", + "StackEnsembleSettings", + "SweepJob", + "SweepJobLimits", + "SystemData", + "TableVertical", + "TableVerticalDataSettings", + "TableVerticalFeaturizationSettings", + "TableVerticalLimitSettings", + "TableVerticalValidationDataSettings", + "TargetLags", + "TargetRollingWindowSize", + "TargetUtilizationScaleSettings", + "TensorFlow", + "TestDataSettings", + "TextClassification", + "TextClassificationMultilabel", + "TextNer", + "TrackedResource", + "TrainingDataSettings", + "TrainingSettings", + "TrialComponent", + "TritonModelJobInput", + "TritonModelJobOutput", + "TruncationSelectionPolicy", + "UriFileDataVersion", + "UriFileJobInput", + "UriFileJobOutput", + "UriFolderDataVersion", + "UriFolderJobInput", + "UriFolderJobOutput", + "UserAssignedIdentity", + "UserIdentity", + "ValidationDataSettings", + "BatchLoggingLevel", + "BatchOutputAction", + "ClassificationModels", + "ClassificationMultilabelPrimaryMetrics", + "ClassificationPrimaryMetrics", + "ContainerType", + "CreatedByType", + "CredentialsType", + "DataType", + "DatastoreType", + "DeploymentProvisioningState", + "DistributionType", + "EarlyTerminationPolicyType", + "EgressPublicNetworkAccessType", + "EndpointAuthMode", + "EndpointComputeType", + "EndpointProvisioningState", + "EnvironmentType", + "FeatureLags", + "FeaturizationMode", + "ForecastHorizonMode", + "ForecastingModels", + "ForecastingPrimaryMetrics", + "Goal", + "IdentityConfigurationType", + "InputDeliveryMode", + "InstanceSegmentationPrimaryMetrics", + "JobInputType", + "JobLimitsType", + "JobOutputType", + "JobStatus", + "JobType", + "KeyType", + "LearningRateScheduler", + "ListViewType", + "LogVerbosity", + "ManagedServiceIdentityType", + "ModelSize", + "ModelType", + "NCrossValidationsMode", + "ObjectDetectionPrimaryMetrics", + "OperatingSystemType", + "OrderString", + "OutputDeliveryMode", + "PublicNetworkAccessType", + "RandomSamplingAlgorithmRule", + "RecurrenceFrequency", + "ReferenceType", + "RegressionModels", + "RegressionPrimaryMetrics", + "SamplingAlgorithmType", + "ScaleType", + "ScheduleStatus", + "ScheduleType", + "SeasonalityMode", + "SecretsType", + "ServiceDataAccessAuthIdentity", + "ShortSeriesHandlingConfiguration", + "SkuScaleType", + "SkuTier", + "StackMetaLearnerType", + "StochasticOptimizer", + "TargetAggregationFunction", + "TargetLagsMode", + "TargetRollingWindowSizeMode", + "TaskType", + "UseStl", + "ValidationMetricType", + "Weekday", ] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/models/_azure_machine_learning_workspaces_enums.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/models/_azure_machine_learning_workspaces_enums.py index 6aa656829a83..37ab7d4ce3c3 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/models/_azure_machine_learning_workspaces_enums.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/models/_azure_machine_learning_workspaces_enums.py @@ -20,16 +20,16 @@ class BatchLoggingLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): WARNING = "Warning" DEBUG = "Debug" + class BatchOutputAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine how batch inferencing will handle output - """ + """Enum to determine how batch inferencing will handle output""" SUMMARY_ONLY = "SummaryOnly" APPEND_ROW = "AppendRow" + class ClassificationModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum for all classification models supported by AutoML. - """ + """Enum for all classification models supported by AutoML.""" #: Logistic regression is a fundamental classification technique. #: It belongs to the group of linear classifiers and is somewhat similar to polynomial and linear @@ -91,9 +91,11 @@ class ClassificationModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: target column values can be divided into distinct class values. XG_BOOST_CLASSIFIER = "XGBoostClassifier" -class ClassificationMultilabelPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for classification multilabel tasks. - """ + +class ClassificationMultilabelPrimaryMetrics( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """Primary metrics for classification multilabel tasks.""" #: AUC is the Area under the curve. #: This metric represents arithmetic mean of the score for each class, @@ -113,9 +115,11 @@ class ClassificationMultilabelPrimaryMetrics(str, Enum, metaclass=CaseInsensitiv #: Intersection Over Union. Intersection of predictions divided by union of predictions. IOU = "IOU" -class ClassificationPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for classification tasks. - """ + +class ClassificationPrimaryMetrics( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """Primary metrics for classification tasks.""" #: AUC is the Area under the curve. #: This metric represents arithmetic mean of the score for each class, @@ -133,23 +137,24 @@ class ClassificationPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta) #: class. PRECISION_SCORE_WEIGHTED = "PrecisionScoreWeighted" + class ContainerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): STORAGE_INITIALIZER = "StorageInitializer" INFERENCE_SERVER = "InferenceServer" + class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of identity that created the resource. - """ + """The type of identity that created the resource.""" USER = "User" APPLICATION = "Application" MANAGED_IDENTITY = "ManagedIdentity" KEY = "Key" + class CredentialsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the datastore credentials type. - """ + """Enum to determine the datastore credentials type.""" ACCOUNT_KEY = "AccountKey" CERTIFICATE = "Certificate" @@ -159,9 +164,9 @@ class CredentialsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): KERBEROS_KEYTAB = "KerberosKeytab" KERBEROS_PASSWORD = "KerberosPassword" + class DatastoreType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the datastore contents type. - """ + """Enum to determine the datastore contents type.""" AZURE_BLOB = "AzureBlob" AZURE_DATA_LAKE_GEN1 = "AzureDataLakeGen1" @@ -169,17 +174,19 @@ class DatastoreType(str, Enum, metaclass=CaseInsensitiveEnumMeta): AZURE_FILE = "AzureFile" HDFS = "Hdfs" + class DataType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the type of data. - """ + """Enum to determine the type of data.""" URI_FILE = "UriFile" URI_FOLDER = "UriFolder" ML_TABLE = "MLTable" -class DeploymentProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Possible values for DeploymentProvisioningState. - """ + +class DeploymentProvisioningState( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """Possible values for DeploymentProvisioningState.""" CREATING = "Creating" DELETING = "Deleting" @@ -189,21 +196,25 @@ class DeploymentProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): FAILED = "Failed" CANCELED = "Canceled" + class DistributionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the job distribution type. - """ + """Enum to determine the job distribution type.""" PY_TORCH = "PyTorch" TENSOR_FLOW = "TensorFlow" MPI = "Mpi" + class EarlyTerminationPolicyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): BANDIT = "Bandit" MEDIAN_STOPPING = "MedianStopping" TRUNCATION_SELECTION = "TruncationSelection" -class EgressPublicNetworkAccessType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + +class EgressPublicNetworkAccessType( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): """Enum to determine whether PublicNetworkAccess is Enabled or Disabled for egress of a deployment. """ @@ -211,25 +222,25 @@ class EgressPublicNetworkAccessType(str, Enum, metaclass=CaseInsensitiveEnumMeta ENABLED = "Enabled" DISABLED = "Disabled" + class EndpointAuthMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine endpoint authentication mode. - """ + """Enum to determine endpoint authentication mode.""" AML_TOKEN = "AMLToken" KEY = "Key" AAD_TOKEN = "AADToken" + class EndpointComputeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine endpoint compute type. - """ + """Enum to determine endpoint compute type.""" MANAGED = "Managed" KUBERNETES = "Kubernetes" AZURE_ML_COMPUTE = "AzureMLCompute" + class EndpointProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """State of endpoint provisioning. - """ + """State of endpoint provisioning.""" CREATING = "Creating" DELETING = "Deleting" @@ -238,25 +249,25 @@ class EndpointProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): UPDATING = "Updating" CANCELED = "Canceled" + class EnvironmentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Environment type is either user created or curated by Azure ML service - """ + """Environment type is either user created or curated by Azure ML service""" CURATED = "Curated" USER_CREATED = "UserCreated" + class FeatureLags(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Flag for generating lags for the numeric features. - """ + """Flag for generating lags for the numeric features.""" #: No feature lags generated. NONE = "None" #: System auto-generates feature lags. AUTO = "Auto" + class FeaturizationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Featurization mode - determines data featurization mode. - """ + """Featurization mode - determines data featurization mode.""" #: Auto mode, system performs featurization without any custom featurization inputs. AUTO = "Auto" @@ -265,18 +276,18 @@ class FeaturizationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Featurization off. 'Forecasting' task cannot use this value. OFF = "Off" + class ForecastHorizonMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine forecast horizon selection mode. - """ + """Enum to determine forecast horizon selection mode.""" #: Forecast horizon to be determined automatically. AUTO = "Auto" #: Use the custom forecast horizon. CUSTOM = "Custom" + class ForecastingModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum for all forecasting models supported by AutoML. - """ + """Enum for all forecasting models supported by AutoML.""" #: Auto-Autoregressive Integrated Moving Average (ARIMA) model uses time-series data and #: statistical analysis to interpret the data and make future predictions. @@ -353,9 +364,9 @@ class ForecastingModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: using ensemble of base learners. XG_BOOST_REGRESSOR = "XGBoostRegressor" + class ForecastingPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for Forecasting task. - """ + """Primary metrics for Forecasting task.""" #: The Spearman's rank coefficient of correlation is a non-parametric measure of rank correlation. SPEARMAN_CORRELATION = "SpearmanCorrelation" @@ -369,24 +380,24 @@ class ForecastingPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Error (MAE) of (time) series with different scales. NORMALIZED_MEAN_ABSOLUTE_ERROR = "NormalizedMeanAbsoluteError" + class Goal(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Defines supported metric goals for hyperparameter tuning - """ + """Defines supported metric goals for hyperparameter tuning""" MINIMIZE = "Minimize" MAXIMIZE = "Maximize" + class IdentityConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine identity framework. - """ + """Enum to determine identity framework.""" MANAGED = "Managed" AML_TOKEN = "AMLToken" USER_IDENTITY = "UserIdentity" + class InputDeliveryMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the input data delivery mode. - """ + """Enum to determine the input data delivery mode.""" READ_ONLY_MOUNT = "ReadOnlyMount" READ_WRITE_MOUNT = "ReadWriteMount" @@ -395,17 +406,19 @@ class InputDeliveryMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): EVAL_MOUNT = "EvalMount" EVAL_DOWNLOAD = "EvalDownload" -class InstanceSegmentationPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for InstanceSegmentation tasks. - """ + +class InstanceSegmentationPrimaryMetrics( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """Primary metrics for InstanceSegmentation tasks.""" #: Mean Average Precision (MAP) is the average of AP (Average Precision). #: AP is calculated for each class and averaged to get the MAP. MEAN_AVERAGE_PRECISION = "MeanAveragePrecision" + class JobInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the Job Input Type. - """ + """Enum to determine the Job Input Type.""" LITERAL = "Literal" URI_FILE = "UriFile" @@ -415,14 +428,15 @@ class JobInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): ML_FLOW_MODEL = "MLFlowModel" TRITON_MODEL = "TritonModel" + class JobLimitsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): COMMAND = "Command" SWEEP = "Sweep" + class JobOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the Job Output Type. - """ + """Enum to determine the Job Output Type.""" URI_FILE = "UriFile" URI_FOLDER = "UriFolder" @@ -431,9 +445,9 @@ class JobOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): ML_FLOW_MODEL = "MLFlowModel" TRITON_MODEL = "TritonModel" + class JobStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The status of a job. - """ + """The status of a job.""" #: Run hasn't started yet. NOT_STARTED = "NotStarted" @@ -471,23 +485,24 @@ class JobStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: The job is in a scheduled state. Job is not in any active state. SCHEDULED = "Scheduled" + class JobType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the type of job. - """ + """Enum to determine the type of job.""" AUTO_ML = "AutoML" COMMAND = "Command" SWEEP = "Sweep" PIPELINE = "Pipeline" + class KeyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): PRIMARY = "Primary" SECONDARY = "Secondary" + class LearningRateScheduler(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Learning rate scheduler enum. - """ + """Learning rate scheduler enum.""" #: No learning rate scheduler selected. NONE = "None" @@ -496,15 +511,16 @@ class LearningRateScheduler(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Step learning rate scheduler. STEP = "Step" + class ListViewType(str, Enum, metaclass=CaseInsensitiveEnumMeta): ACTIVE_ONLY = "ActiveOnly" ARCHIVED_ONLY = "ArchivedOnly" ALL = "All" + class LogVerbosity(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum for setting log verbosity. - """ + """Enum for setting log verbosity.""" #: No logs emitted. NOT_SET = "NotSet" @@ -519,6 +535,7 @@ class LogVerbosity(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Only critical statements logged. CRITICAL = "Critical" + class ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). @@ -529,9 +546,9 @@ class ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): USER_ASSIGNED = "UserAssigned" SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" + class ModelSize(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Image model size. - """ + """Image model size.""" #: No value selected. NONE = "None" @@ -544,17 +561,17 @@ class ModelSize(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Extra large size. EXTRA_LARGE = "ExtraLarge" + class ModelType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The async operation state. - """ + """The async operation state.""" CUSTOM_MODEL = "CustomModel" ML_FLOW_MODEL = "MLFlowModel" TRITON_MODEL = "TritonModel" + class NCrossValidationsMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Determines how N-Cross validations value is determined. - """ + """Determines how N-Cross validations value is determined.""" #: Determine N-Cross validations value automatically. Supported only for 'Forecasting' AutoML #: task. @@ -562,21 +579,24 @@ class NCrossValidationsMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Use custom N-Cross validations value. CUSTOM = "Custom" -class ObjectDetectionPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for Image ObjectDetection task. - """ + +class ObjectDetectionPrimaryMetrics( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """Primary metrics for Image ObjectDetection task.""" #: Mean Average Precision (MAP) is the average of AP (Average Precision). #: AP is calculated for each class and averaged to get the MAP. MEAN_AVERAGE_PRECISION = "MeanAveragePrecision" + class OperatingSystemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of operating system. - """ + """The type of operating system.""" LINUX = "Linux" WINDOWS = "Windows" + class OrderString(str, Enum, metaclass=CaseInsensitiveEnumMeta): CREATED_AT_DESC = "CreatedAtDesc" @@ -584,30 +604,32 @@ class OrderString(str, Enum, metaclass=CaseInsensitiveEnumMeta): UPDATED_AT_DESC = "UpdatedAtDesc" UPDATED_AT_ASC = "UpdatedAtAsc" + class OutputDeliveryMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Output data delivery mode enums. - """ + """Output data delivery mode enums.""" READ_WRITE_MOUNT = "ReadWriteMount" UPLOAD = "Upload" + class PublicNetworkAccessType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine whether PublicNetworkAccess is Enabled or Disabled. - """ + """Enum to determine whether PublicNetworkAccess is Enabled or Disabled.""" ENABLED = "Enabled" DISABLED = "Disabled" -class RandomSamplingAlgorithmRule(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The specific type of random algorithm - """ + +class RandomSamplingAlgorithmRule( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """The specific type of random algorithm""" RANDOM = "Random" SOBOL = "Sobol" + class RecurrenceFrequency(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to describe the frequency of a recurrence schedule - """ + """Enum to describe the frequency of a recurrence schedule""" #: Minute frequency. MINUTE = "Minute" @@ -620,17 +642,17 @@ class RecurrenceFrequency(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Month frequency. MONTH = "Month" + class ReferenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine which reference method to use for an asset. - """ + """Enum to determine which reference method to use for an asset.""" ID = "Id" DATA_PATH = "DataPath" OUTPUT_PATH = "OutputPath" + class RegressionModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum for all Regression models supported by AutoML. - """ + """Enum for all Regression models supported by AutoML.""" #: Elastic net is a popular type of regularized linear regression that combines two popular #: penalties, specifically the L1 and L2 penalty functions. @@ -672,9 +694,9 @@ class RegressionModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: using ensemble of base learners. XG_BOOST_REGRESSOR = "XGBoostRegressor" + class RegressionPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for Regression task. - """ + """Primary metrics for Regression task.""" #: The Spearman's rank coefficient of correlation is a nonparametric measure of rank correlation. SPEARMAN_CORRELATION = "SpearmanCorrelation" @@ -688,47 +710,49 @@ class RegressionPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Error (MAE) of (time) series with different scales. NORMALIZED_MEAN_ABSOLUTE_ERROR = "NormalizedMeanAbsoluteError" + class SamplingAlgorithmType(str, Enum, metaclass=CaseInsensitiveEnumMeta): GRID = "Grid" RANDOM = "Random" BAYESIAN = "Bayesian" + class ScaleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): DEFAULT = "Default" TARGET_UTILIZATION = "TargetUtilization" + class ScheduleStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to describe status of schedule - """ + """Enum to describe status of schedule""" #: Schedule is enabled. ENABLED = "Enabled" #: Schedule is disabled. DISABLED = "Disabled" + class ScheduleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to describe type of schedule - """ + """Enum to describe type of schedule""" #: Cron schedule type. CRON = "Cron" #: Recurrence schedule type. RECURRENCE = "Recurrence" + class SeasonalityMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Forecasting seasonality mode. - """ + """Forecasting seasonality mode.""" #: Seasonality to be determined automatically. AUTO = "Auto" #: Use the custom seasonality value. CUSTOM = "Custom" + class SecretsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the datastore secrets type. - """ + """Enum to determine the datastore secrets type.""" ACCOUNT_KEY = "AccountKey" CERTIFICATE = "Certificate" @@ -737,7 +761,10 @@ class SecretsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): KERBEROS_PASSWORD = "KerberosPassword" KERBEROS_KEYTAB = "KerberosKeytab" -class ServiceDataAccessAuthIdentity(str, Enum, metaclass=CaseInsensitiveEnumMeta): + +class ServiceDataAccessAuthIdentity( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): #: Do not use any identity for service data access. NONE = "None" @@ -746,9 +773,11 @@ class ServiceDataAccessAuthIdentity(str, Enum, metaclass=CaseInsensitiveEnumMeta #: Use the user assigned managed identity of the Workspace to authenticate service data access. WORKSPACE_USER_ASSIGNED_IDENTITY = "WorkspaceUserAssignedIdentity" -class ShortSeriesHandlingConfiguration(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The parameter defining how if AutoML should handle short time series. - """ + +class ShortSeriesHandlingConfiguration( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """The parameter defining how if AutoML should handle short time series.""" #: Represents no/null value. NONE = "None" @@ -760,9 +789,9 @@ class ShortSeriesHandlingConfiguration(str, Enum, metaclass=CaseInsensitiveEnumM #: All the short series will be dropped. DROP = "Drop" + class SkuScaleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Node scaling setting for the compute sku. - """ + """Node scaling setting for the compute sku.""" #: Automatically scales node count. AUTOMATIC = "Automatic" @@ -771,6 +800,7 @@ class SkuScaleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Fixed set of nodes. NONE = "None" + class SkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): """This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT. @@ -781,6 +811,7 @@ class SkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): STANDARD = "Standard" PREMIUM = "Premium" + class StackMetaLearnerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The meta-learner is a model trained on the output of the individual heterogeneous models. Default meta-learners are LogisticRegression for classification tasks (or LogisticRegressionCV @@ -803,9 +834,9 @@ class StackMetaLearnerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): LIGHT_GBM_REGRESSOR = "LightGBMRegressor" LINEAR_REGRESSION = "LinearRegression" + class StochasticOptimizer(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Stochastic optimizer for image models. - """ + """Stochastic optimizer for image models.""" #: No optimizer selected. NONE = "None" @@ -817,9 +848,9 @@ class StochasticOptimizer(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: AdamW is a variant of the optimizer Adam that has an improved implementation of weight decay. ADAMW = "Adamw" + class TargetAggregationFunction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Target aggregate function. - """ + """Target aggregate function.""" #: Represent no value set. NONE = "None" @@ -828,27 +859,29 @@ class TargetAggregationFunction(str, Enum, metaclass=CaseInsensitiveEnumMeta): MIN = "Min" MEAN = "Mean" + class TargetLagsMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Target lags selection modes. - """ + """Target lags selection modes.""" #: Target lags to be determined automatically. AUTO = "Auto" #: Use the custom target lags. CUSTOM = "Custom" -class TargetRollingWindowSizeMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Target rolling windows size mode. - """ + +class TargetRollingWindowSizeMode( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """Target rolling windows size mode.""" #: Determine rolling windows size automatically. AUTO = "Auto" #: Use the specified rolling window size. CUSTOM = "Custom" + class TaskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """AutoMLJob Task type. - """ + """AutoMLJob Task type.""" #: Classification in machine learning and statistics is a supervised learning approach in which #: the computer program learns from the data given to it and make new observations or @@ -889,18 +922,18 @@ class TaskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: occurrences of entities such as people, locations, organizations, and more. TEXT_NER = "TextNER" + class UseStl(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Configure STL Decomposition of the time-series target column. - """ + """Configure STL Decomposition of the time-series target column.""" #: No stl decomposition. NONE = "None" SEASON = "Season" SEASON_TREND = "SeasonTrend" + class ValidationMetricType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Metric computation method to use for validation metrics in image tasks. - """ + """Metric computation method to use for validation metrics in image tasks.""" #: No metric. NONE = "None" @@ -911,9 +944,9 @@ class ValidationMetricType(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: CocoVoc metric. COCO_VOC = "CocoVoc" + class Weekday(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum of weekdays - """ + """Enum of weekdays""" #: Monday weekday. MONDAY = "Monday" diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/models/_models.py index 4ec94735e1b9..4c7b949c760e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/models/_models.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/models/_models.py @@ -25,23 +25,27 @@ class DatastoreCredentials(msrest.serialization.Model): """ _validation = { - 'credentials_type': {'required': True}, + "credentials_type": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, } _subtype_map = { - 'credentials_type': {'AccountKey': 'AccountKeyDatastoreCredentials', 'Certificate': 'CertificateDatastoreCredentials', 'KerberosKeytab': 'KerberosKeytabCredentials', 'KerberosPassword': 'KerberosPasswordCredentials', 'None': 'NoneDatastoreCredentials', 'Sas': 'SasDatastoreCredentials', 'ServicePrincipal': 'ServicePrincipalDatastoreCredentials'} - } - - def __init__( - self, - **kwargs - ): - """ - """ + "credentials_type": { + "AccountKey": "AccountKeyDatastoreCredentials", + "Certificate": "CertificateDatastoreCredentials", + "KerberosKeytab": "KerberosKeytabCredentials", + "KerberosPassword": "KerberosPasswordCredentials", + "None": "NoneDatastoreCredentials", + "Sas": "SasDatastoreCredentials", + "ServicePrincipal": "ServicePrincipalDatastoreCredentials", + } + } + + def __init__(self, **kwargs): + """ """ super(DatastoreCredentials, self).__init__(**kwargs) self.credentials_type = None # type: Optional[str] @@ -60,26 +64,23 @@ class AccountKeyDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, + "credentials_type": {"required": True}, + "secrets": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'AccountKeyDatastoreSecrets'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "secrets": {"key": "secrets", "type": "AccountKeyDatastoreSecrets"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword secrets: Required. [Required] Storage account secrets. :paramtype secrets: ~azure.mgmt.machinelearningservices.models.AccountKeyDatastoreSecrets """ super(AccountKeyDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'AccountKey' # type: str - self.secrets = kwargs['secrets'] + self.credentials_type = "AccountKey" # type: str + self.secrets = kwargs["secrets"] class DatastoreSecrets(msrest.serialization.Model): @@ -97,23 +98,26 @@ class DatastoreSecrets(msrest.serialization.Model): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, } _subtype_map = { - 'secrets_type': {'AccountKey': 'AccountKeyDatastoreSecrets', 'Certificate': 'CertificateDatastoreSecrets', 'KerberosKeytab': 'KerberosKeytabSecrets', 'KerberosPassword': 'KerberosPasswordSecrets', 'Sas': 'SasDatastoreSecrets', 'ServicePrincipal': 'ServicePrincipalDatastoreSecrets'} - } - - def __init__( - self, - **kwargs - ): - """ - """ + "secrets_type": { + "AccountKey": "AccountKeyDatastoreSecrets", + "Certificate": "CertificateDatastoreSecrets", + "KerberosKeytab": "KerberosKeytabSecrets", + "KerberosPassword": "KerberosPasswordSecrets", + "Sas": "SasDatastoreSecrets", + "ServicePrincipal": "ServicePrincipalDatastoreSecrets", + } + } + + def __init__(self, **kwargs): + """ """ super(DatastoreSecrets, self).__init__(**kwargs) self.secrets_type = None # type: Optional[str] @@ -132,25 +136,22 @@ class AccountKeyDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "key": {"key": "key", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword key: Storage account key. :paramtype key: str """ super(AccountKeyDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'AccountKey' # type: str - self.key = kwargs.get('key', None) + self.secrets_type = "AccountKey" # type: str + self.key = kwargs.get("key", None) class IdentityConfiguration(msrest.serialization.Model): @@ -168,23 +169,23 @@ class IdentityConfiguration(msrest.serialization.Model): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, } _subtype_map = { - 'identity_type': {'AMLToken': 'AmlToken', 'Managed': 'ManagedIdentity', 'UserIdentity': 'UserIdentity'} + "identity_type": { + "AMLToken": "AmlToken", + "Managed": "ManagedIdentity", + "UserIdentity": "UserIdentity", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(IdentityConfiguration, self).__init__(**kwargs) self.identity_type = None # type: Optional[str] @@ -201,21 +202,17 @@ class AmlToken(IdentityConfiguration): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AmlToken, self).__init__(**kwargs) - self.identity_type = 'AMLToken' # type: str + self.identity_type = "AMLToken" # type: str class ResourceBase(msrest.serialization.Model): @@ -230,15 +227,12 @@ class ResourceBase(msrest.serialization.Model): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -248,9 +242,9 @@ def __init__( :paramtype tags: dict[str, str] """ super(ResourceBase, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) + self.description = kwargs.get("description", None) + self.properties = kwargs.get("properties", None) + self.tags = kwargs.get("tags", None) class AssetBase(ResourceBase): @@ -269,17 +263,14 @@ class AssetBase(ResourceBase): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -293,8 +284,8 @@ def __init__( :paramtype is_archived: bool """ super(AssetBase, self).__init__(**kwargs) - self.is_anonymous = kwargs.get('is_anonymous', False) - self.is_archived = kwargs.get('is_archived', False) + self.is_anonymous = kwargs.get("is_anonymous", False) + self.is_archived = kwargs.get("is_archived", False) class AssetContainer(ResourceBase): @@ -317,23 +308,20 @@ class AssetContainer(ResourceBase): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -345,7 +333,7 @@ def __init__( :paramtype is_archived: bool """ super(AssetContainer, self).__init__(**kwargs) - self.is_archived = kwargs.get('is_archived', False) + self.is_archived = kwargs.get("is_archived", False) self.latest_version = None self.next_version = None @@ -363,18 +351,15 @@ class AssetJobInput(msrest.serialization.Model): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -383,8 +368,8 @@ def __init__( :paramtype uri: str """ super(AssetJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] class AssetJobOutput(msrest.serialization.Model): @@ -397,14 +382,11 @@ class AssetJobOutput(msrest.serialization.Model): """ _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -412,8 +394,8 @@ def __init__( :paramtype uri: str """ super(AssetJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) class AssetReferenceBase(msrest.serialization.Model): @@ -430,23 +412,23 @@ class AssetReferenceBase(msrest.serialization.Model): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, } _subtype_map = { - 'reference_type': {'DataPath': 'DataPathAssetReference', 'Id': 'IdAssetReference', 'OutputPath': 'OutputPathAssetReference'} + "reference_type": { + "DataPath": "DataPathAssetReference", + "Id": "IdAssetReference", + "OutputPath": "OutputPathAssetReference", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AssetReferenceBase, self).__init__(**kwargs) self.reference_type = None # type: Optional[str] @@ -465,23 +447,22 @@ class ForecastHorizon(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoForecastHorizon', 'Custom': 'CustomForecastHorizon'} + "mode": { + "Auto": "AutoForecastHorizon", + "Custom": "CustomForecastHorizon", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ForecastHorizon, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -497,21 +478,17 @@ class AutoForecastHorizon(ForecastHorizon): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoForecastHorizon, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class JobBaseDetails(ResourceBase): @@ -559,33 +536,35 @@ class JobBaseDetails(ResourceBase): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, + "job_type": {"required": True}, + "status": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'ScheduleBase'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "schedule": {"key": "schedule", "type": "ScheduleBase"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, } _subtype_map = { - 'job_type': {'AutoML': 'AutoMLJob', 'Command': 'CommandJob', 'Pipeline': 'PipelineJob', 'Sweep': 'SweepJob'} + "job_type": { + "AutoML": "AutoMLJob", + "Command": "CommandJob", + "Pipeline": "PipelineJob", + "Sweep": "SweepJob", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -614,103 +593,103 @@ def __init__( :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] """ super(JobBaseDetails, self).__init__(**kwargs) - self.compute_id = kwargs.get('compute_id', None) - self.display_name = kwargs.get('display_name', None) - self.experiment_name = kwargs.get('experiment_name', "Default") - self.identity = kwargs.get('identity', None) - self.is_archived = kwargs.get('is_archived', False) - self.job_type = 'JobBaseDetails' # type: str - self.schedule = kwargs.get('schedule', None) - self.services = kwargs.get('services', None) + self.compute_id = kwargs.get("compute_id", None) + self.display_name = kwargs.get("display_name", None) + self.experiment_name = kwargs.get("experiment_name", "Default") + self.identity = kwargs.get("identity", None) + self.is_archived = kwargs.get("is_archived", False) + self.job_type = "JobBaseDetails" # type: str + self.schedule = kwargs.get("schedule", None) + self.services = kwargs.get("services", None) self.status = None class AutoMLJob(JobBaseDetails): """AutoMLJob class. -Use this class for executing AutoML tasks like Classification/Regression etc. -See TaskType enum for all the tasks supported. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Sweep", "Pipeline". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar schedule: Schedule definition of job. - If no schedule is provided, the job is run once and immediately after submission. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar environment_id: The ARM resource ID of the Environment specification for the job. - This is optional value to provide, if not provided, AutoML will default this to Production - AutoML curated environment version when running the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.ResourceConfiguration - :ivar task_details: Required. [Required] This represents scenario which can be one of - Tables/NLP/Image. - :vartype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical + Use this class for executing AutoML tasks like Classification/Regression etc. + See TaskType enum for all the tasks supported. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar description: The asset description text. + :vartype description: str + :ivar properties: The asset property dictionary. + :vartype properties: dict[str, str] + :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + :ivar compute_id: ARM resource ID of the compute resource. + :vartype compute_id: str + :ivar display_name: Display name of job. + :vartype display_name: str + :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is + placed in the "Default" experiment. + :vartype experiment_name: str + :ivar identity: Identity configuration. If set, this should be one of AmlToken, + ManagedIdentity, UserIdentity or null. + Defaults to AmlToken if null. + :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration + :ivar is_archived: Is the asset archived?. + :vartype is_archived: bool + :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. + Possible values include: "AutoML", "Command", "Sweep", "Pipeline". + :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType + :ivar schedule: Schedule definition of job. + If no schedule is provided, the job is run once and immediately after submission. + :vartype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase + :ivar services: List of JobEndpoints. + For local jobs, a job endpoint will have an endpoint value of FileStreamObject. + :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] + :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", + "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", + "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". + :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus + :ivar environment_id: The ARM resource ID of the Environment specification for the job. + This is optional value to provide, if not provided, AutoML will default this to Production + AutoML curated environment version when running the job. + :vartype environment_id: str + :ivar environment_variables: Environment variables included in the job. + :vartype environment_variables: dict[str, str] + :ivar outputs: Mapping of output data bindings used in the job. + :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] + :ivar resources: Compute Resource configuration for the job. + :vartype resources: ~azure.mgmt.machinelearningservices.models.ResourceConfiguration + :ivar task_details: Required. [Required] This represents scenario which can be one of + Tables/NLP/Image. + :vartype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'task_details': {'required': True}, + "job_type": {"required": True}, + "status": {"readonly": True}, + "task_details": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'ScheduleBase'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'resources': {'key': 'resources', 'type': 'ResourceConfiguration'}, - 'task_details': {'key': 'taskDetails', 'type': 'AutoMLVertical'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "schedule": {"key": "schedule", "type": "ScheduleBase"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "resources": {"key": "resources", "type": "ResourceConfiguration"}, + "task_details": {"key": "taskDetails", "type": "AutoMLVertical"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -752,57 +731,65 @@ def __init__( :paramtype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical """ super(AutoMLJob, self).__init__(**kwargs) - self.job_type = 'AutoML' # type: str - self.environment_id = kwargs.get('environment_id', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.outputs = kwargs.get('outputs', None) - self.resources = kwargs.get('resources', None) - self.task_details = kwargs['task_details'] + self.job_type = "AutoML" # type: str + self.environment_id = kwargs.get("environment_id", None) + self.environment_variables = kwargs.get("environment_variables", None) + self.outputs = kwargs.get("outputs", None) + self.resources = kwargs.get("resources", None) + self.task_details = kwargs["task_details"] class AutoMLVertical(msrest.serialization.Model): """AutoML vertical class. -Base class for AutoML verticals - TableVertical/ImageVertical/NLPVertical. + Base class for AutoML verticals - TableVertical/ImageVertical/NLPVertical. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Classification, Forecasting, ImageClassification, ImageClassificationMultilabel, ImageInstanceSegmentation, ImageObjectDetection, Regression, TextClassification, TextClassificationMultilabel, TextNer. + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Classification, Forecasting, ImageClassification, ImageClassificationMultilabel, ImageInstanceSegmentation, ImageObjectDetection, Regression, TextClassification, TextClassificationMultilabel, TextNer. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType """ _validation = { - 'task_type': {'required': True}, + "task_type": {"required": True}, } _attribute_map = { - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, } _subtype_map = { - 'task_type': {'Classification': 'Classification', 'Forecasting': 'Forecasting', 'ImageClassification': 'ImageClassification', 'ImageClassificationMultilabel': 'ImageClassificationMultilabel', 'ImageInstanceSegmentation': 'ImageInstanceSegmentation', 'ImageObjectDetection': 'ImageObjectDetection', 'Regression': 'Regression', 'TextClassification': 'TextClassification', 'TextClassificationMultilabel': 'TextClassificationMultilabel', 'TextNER': 'TextNer'} - } - - def __init__( - self, - **kwargs - ): + "task_type": { + "Classification": "Classification", + "Forecasting": "Forecasting", + "ImageClassification": "ImageClassification", + "ImageClassificationMultilabel": "ImageClassificationMultilabel", + "ImageInstanceSegmentation": "ImageInstanceSegmentation", + "ImageObjectDetection": "ImageObjectDetection", + "Regression": "Regression", + "TextClassification": "TextClassification", + "TextClassificationMultilabel": "TextClassificationMultilabel", + "TextNER": "TextNer", + } + } + + def __init__(self, **kwargs): """ :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", "Info", "Warning", "Error", "Critical". :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity """ super(AutoMLVertical, self).__init__(**kwargs) - self.log_verbosity = kwargs.get('log_verbosity', None) + self.log_verbosity = kwargs.get("log_verbosity", None) self.task_type = None # type: Optional[str] @@ -820,23 +807,22 @@ class NCrossValidations(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoNCrossValidations', 'Custom': 'CustomNCrossValidations'} + "mode": { + "Auto": "AutoNCrossValidations", + "Custom": "CustomNCrossValidations", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NCrossValidations, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -852,21 +838,17 @@ class AutoNCrossValidations(NCrossValidations): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoNCrossValidations, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class Seasonality(msrest.serialization.Model): @@ -883,23 +865,19 @@ class Seasonality(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoSeasonality', 'Custom': 'CustomSeasonality'} + "mode": {"Auto": "AutoSeasonality", "Custom": "CustomSeasonality"} } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Seasonality, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -915,21 +893,17 @@ class AutoSeasonality(Seasonality): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoSeasonality, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class TargetLags(msrest.serialization.Model): @@ -946,23 +920,19 @@ class TargetLags(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoTargetLags', 'Custom': 'CustomTargetLags'} + "mode": {"Auto": "AutoTargetLags", "Custom": "CustomTargetLags"} } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(TargetLags, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -978,21 +948,17 @@ class AutoTargetLags(TargetLags): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoTargetLags, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class TargetRollingWindowSize(msrest.serialization.Model): @@ -1009,23 +975,22 @@ class TargetRollingWindowSize(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoTargetRollingWindowSize', 'Custom': 'CustomTargetRollingWindowSize'} + "mode": { + "Auto": "AutoTargetRollingWindowSize", + "Custom": "CustomTargetRollingWindowSize", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(TargetRollingWindowSize, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -1041,21 +1006,17 @@ class AutoTargetRollingWindowSize(TargetRollingWindowSize): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class DatastoreDetails(ResourceBase): @@ -1086,28 +1047,31 @@ class DatastoreDetails(ResourceBase): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, } _subtype_map = { - 'datastore_type': {'AzureBlob': 'AzureBlobDatastore', 'AzureDataLakeGen1': 'AzureDataLakeGen1Datastore', 'AzureDataLakeGen2': 'AzureDataLakeGen2Datastore', 'AzureFile': 'AzureFileDatastore', 'Hdfs': 'HdfsDatastore'} + "datastore_type": { + "AzureBlob": "AzureBlobDatastore", + "AzureDataLakeGen1": "AzureDataLakeGen1Datastore", + "AzureDataLakeGen2": "AzureDataLakeGen2Datastore", + "AzureFile": "AzureFileDatastore", + "Hdfs": "HdfsDatastore", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -1119,8 +1083,8 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials """ super(DatastoreDetails, self).__init__(**kwargs) - self.credentials = kwargs['credentials'] - self.datastore_type = 'DatastoreDetails' # type: str + self.credentials = kwargs["credentials"] + self.datastore_type = "DatastoreDetails" # type: str self.is_default = None @@ -1162,29 +1126,29 @@ class AzureBlobDatastore(DatastoreDetails): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "account_name": {"key": "accountName", "type": "str"}, + "container_name": {"key": "containerName", "type": "str"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -1209,12 +1173,14 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ super(AzureBlobDatastore, self).__init__(**kwargs) - self.datastore_type = 'AzureBlob' # type: str - self.account_name = kwargs.get('account_name', None) - self.container_name = kwargs.get('container_name', None) - self.endpoint = kwargs.get('endpoint', None) - self.protocol = kwargs.get('protocol', None) - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) + self.datastore_type = "AzureBlob" # type: str + self.account_name = kwargs.get("account_name", None) + self.container_name = kwargs.get("container_name", None) + self.endpoint = kwargs.get("endpoint", None) + self.protocol = kwargs.get("protocol", None) + self.service_data_access_auth_identity = kwargs.get( + "service_data_access_auth_identity", None + ) class AzureDataLakeGen1Datastore(DatastoreDetails): @@ -1249,27 +1215,27 @@ class AzureDataLakeGen1Datastore(DatastoreDetails): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'store_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "store_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - 'store_name': {'key': 'storeName', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, + "store_name": {"key": "storeName", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -1288,9 +1254,11 @@ def __init__( :paramtype store_name: str """ super(AzureDataLakeGen1Datastore, self).__init__(**kwargs) - self.datastore_type = 'AzureDataLakeGen1' # type: str - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) - self.store_name = kwargs['store_name'] + self.datastore_type = "AzureDataLakeGen1" # type: str + self.service_data_access_auth_identity = kwargs.get( + "service_data_access_auth_identity", None + ) + self.store_name = kwargs["store_name"] class AzureDataLakeGen2Datastore(DatastoreDetails): @@ -1331,31 +1299,31 @@ class AzureDataLakeGen2Datastore(DatastoreDetails): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'filesystem': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "account_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "filesystem": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'filesystem': {'key': 'filesystem', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "account_name": {"key": "accountName", "type": "str"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "filesystem": {"key": "filesystem", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -1380,12 +1348,14 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ super(AzureDataLakeGen2Datastore, self).__init__(**kwargs) - self.datastore_type = 'AzureDataLakeGen2' # type: str - self.account_name = kwargs['account_name'] - self.endpoint = kwargs.get('endpoint', None) - self.filesystem = kwargs['filesystem'] - self.protocol = kwargs.get('protocol', None) - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) + self.datastore_type = "AzureDataLakeGen2" # type: str + self.account_name = kwargs["account_name"] + self.endpoint = kwargs.get("endpoint", None) + self.filesystem = kwargs["filesystem"] + self.protocol = kwargs.get("protocol", None) + self.service_data_access_auth_identity = kwargs.get( + "service_data_access_auth_identity", None + ) class AzureFileDatastore(DatastoreDetails): @@ -1427,31 +1397,31 @@ class AzureFileDatastore(DatastoreDetails): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'file_share_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "account_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "file_share_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'file_share_name': {'key': 'fileShareName', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "account_name": {"key": "accountName", "type": "str"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "file_share_name": {"key": "fileShareName", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -1477,12 +1447,14 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ super(AzureFileDatastore, self).__init__(**kwargs) - self.datastore_type = 'AzureFile' # type: str - self.account_name = kwargs['account_name'] - self.endpoint = kwargs.get('endpoint', None) - self.file_share_name = kwargs['file_share_name'] - self.protocol = kwargs.get('protocol', None) - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) + self.datastore_type = "AzureFile" # type: str + self.account_name = kwargs["account_name"] + self.endpoint = kwargs.get("endpoint", None) + self.file_share_name = kwargs["file_share_name"] + self.protocol = kwargs.get("protocol", None) + self.service_data_access_auth_identity = kwargs.get( + "service_data_access_auth_identity", None + ) class EarlyTerminationPolicy(msrest.serialization.Model): @@ -1504,23 +1476,24 @@ class EarlyTerminationPolicy(msrest.serialization.Model): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, } _subtype_map = { - 'policy_type': {'Bandit': 'BanditPolicy', 'MedianStopping': 'MedianStoppingPolicy', 'TruncationSelection': 'TruncationSelectionPolicy'} + "policy_type": { + "Bandit": "BanditPolicy", + "MedianStopping": "MedianStoppingPolicy", + "TruncationSelection": "TruncationSelectionPolicy", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. :paramtype delay_evaluation: int @@ -1528,8 +1501,8 @@ def __init__( :paramtype evaluation_interval: int """ super(EarlyTerminationPolicy, self).__init__(**kwargs) - self.delay_evaluation = kwargs.get('delay_evaluation', 0) - self.evaluation_interval = kwargs.get('evaluation_interval', 0) + self.delay_evaluation = kwargs.get("delay_evaluation", 0) + self.evaluation_interval = kwargs.get("evaluation_interval", 0) self.policy_type = None # type: Optional[str] @@ -1553,21 +1526,18 @@ class BanditPolicy(EarlyTerminationPolicy): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'slack_amount': {'key': 'slackAmount', 'type': 'float'}, - 'slack_factor': {'key': 'slackFactor', 'type': 'float'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, + "slack_amount": {"key": "slackAmount", "type": "float"}, + "slack_factor": {"key": "slackFactor", "type": "float"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. :paramtype delay_evaluation: int @@ -1579,9 +1549,9 @@ def __init__( :paramtype slack_factor: float """ super(BanditPolicy, self).__init__(**kwargs) - self.policy_type = 'Bandit' # type: str - self.slack_amount = kwargs.get('slack_amount', 0) - self.slack_factor = kwargs.get('slack_factor', 0) + self.policy_type = "Bandit" # type: str + self.slack_amount = kwargs.get("slack_amount", 0) + self.slack_factor = kwargs.get("slack_factor", 0) class Resource(msrest.serialization.Model): @@ -1603,25 +1573,21 @@ class Resource(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -1654,26 +1620,23 @@ class TrackedResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -1681,8 +1644,8 @@ def __init__( :paramtype location: str """ super(TrackedResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.location = kwargs['location'] + self.tags = kwargs.get("tags", None) + self.location = kwargs["location"] class BatchDeploymentData(TrackedResource): @@ -1719,31 +1682,28 @@ class BatchDeploymentData(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchDeploymentDetails'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": {"key": "properties", "type": "BatchDeploymentDetails"}, + "sku": {"key": "sku", "type": "Sku"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -1760,10 +1720,10 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ super(BatchDeploymentData, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) + self.identity = kwargs.get("identity", None) + self.kind = kwargs.get("kind", None) + self.properties = kwargs["properties"] + self.sku = kwargs.get("sku", None) class EndpointDeploymentPropertiesBase(msrest.serialization.Model): @@ -1783,17 +1743,20 @@ class EndpointDeploymentPropertiesBase(msrest.serialization.Model): """ _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword code_configuration: Code configuration for the endpoint deployment. :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration @@ -1808,11 +1771,11 @@ def __init__( :paramtype properties: dict[str, str] """ super(EndpointDeploymentPropertiesBase, self).__init__(**kwargs) - self.code_configuration = kwargs.get('code_configuration', None) - self.description = kwargs.get('description', None) - self.environment_id = kwargs.get('environment_id', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.properties = kwargs.get('properties', None) + self.code_configuration = kwargs.get("code_configuration", None) + self.description = kwargs.get("description", None) + self.environment_id = kwargs.get("environment_id", None) + self.environment_variables = kwargs.get("environment_variables", None) + self.properties = kwargs.get("properties", None) class BatchDeploymentDetails(EndpointDeploymentPropertiesBase): @@ -1869,32 +1832,41 @@ class BatchDeploymentDetails(EndpointDeploymentPropertiesBase): """ _validation = { - 'provisioning_state': {'readonly': True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'error_threshold': {'key': 'errorThreshold', 'type': 'int'}, - 'logging_level': {'key': 'loggingLevel', 'type': 'str'}, - 'max_concurrency_per_instance': {'key': 'maxConcurrencyPerInstance', 'type': 'int'}, - 'mini_batch_size': {'key': 'miniBatchSize', 'type': 'long'}, - 'model': {'key': 'model', 'type': 'AssetReferenceBase'}, - 'output_action': {'key': 'outputAction', 'type': 'str'}, - 'output_file_name': {'key': 'outputFileName', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'resources': {'key': 'resources', 'type': 'ResourceConfiguration'}, - 'retry_settings': {'key': 'retrySettings', 'type': 'BatchRetrySettings'}, + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "compute": {"key": "compute", "type": "str"}, + "error_threshold": {"key": "errorThreshold", "type": "int"}, + "logging_level": {"key": "loggingLevel", "type": "str"}, + "max_concurrency_per_instance": { + "key": "maxConcurrencyPerInstance", + "type": "int", + }, + "mini_batch_size": {"key": "miniBatchSize", "type": "long"}, + "model": {"key": "model", "type": "AssetReferenceBase"}, + "output_action": {"key": "outputAction", "type": "str"}, + "output_file_name": {"key": "outputFileName", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "resources": {"key": "resources", "type": "ResourceConfiguration"}, + "retry_settings": { + "key": "retrySettings", + "type": "BatchRetrySettings", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword code_configuration: Code configuration for the endpoint deployment. :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration @@ -1940,20 +1912,26 @@ def __init__( :paramtype retry_settings: ~azure.mgmt.machinelearningservices.models.BatchRetrySettings """ super(BatchDeploymentDetails, self).__init__(**kwargs) - self.compute = kwargs.get('compute', None) - self.error_threshold = kwargs.get('error_threshold', -1) - self.logging_level = kwargs.get('logging_level', None) - self.max_concurrency_per_instance = kwargs.get('max_concurrency_per_instance', 1) - self.mini_batch_size = kwargs.get('mini_batch_size', 10) - self.model = kwargs.get('model', None) - self.output_action = kwargs.get('output_action', None) - self.output_file_name = kwargs.get('output_file_name', "predictions.csv") + self.compute = kwargs.get("compute", None) + self.error_threshold = kwargs.get("error_threshold", -1) + self.logging_level = kwargs.get("logging_level", None) + self.max_concurrency_per_instance = kwargs.get( + "max_concurrency_per_instance", 1 + ) + self.mini_batch_size = kwargs.get("mini_batch_size", 10) + self.model = kwargs.get("model", None) + self.output_action = kwargs.get("output_action", None) + self.output_file_name = kwargs.get( + "output_file_name", "predictions.csv" + ) self.provisioning_state = None - self.resources = kwargs.get('resources', None) - self.retry_settings = kwargs.get('retry_settings', None) + self.resources = kwargs.get("resources", None) + self.retry_settings = kwargs.get("retry_settings", None) -class BatchDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class BatchDeploymentTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of BatchDeployment entities. :ivar next_link: The link to the next page of BatchDeployment objects. If null, there are no @@ -1964,14 +1942,11 @@ class BatchDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Mode """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchDeploymentData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[BatchDeploymentData]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of BatchDeployment objects. If null, there are no additional pages. @@ -1979,9 +1954,11 @@ def __init__( :keyword value: An array of objects of type BatchDeployment. :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchDeploymentData] """ - super(BatchDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(BatchDeploymentTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class BatchEndpointData(TrackedResource): @@ -2018,31 +1995,28 @@ class BatchEndpointData(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchEndpointDetails'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": {"key": "properties", "type": "BatchEndpointDetails"}, + "sku": {"key": "sku", "type": "Sku"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -2059,10 +2033,10 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ super(BatchEndpointData, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) + self.identity = kwargs.get("identity", None) + self.kind = kwargs.get("kind", None) + self.properties = kwargs["properties"] + self.sku = kwargs.get("sku", None) class BatchEndpointDefaults(msrest.serialization.Model): @@ -2074,20 +2048,17 @@ class BatchEndpointDefaults(msrest.serialization.Model): """ _attribute_map = { - 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, + "deployment_name": {"key": "deploymentName", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword deployment_name: Name of the deployment that will be default for the endpoint. This deployment will end up getting 100% traffic when the endpoint scoring URL is invoked. :paramtype deployment_name: str """ super(BatchEndpointDefaults, self).__init__(**kwargs) - self.deployment_name = kwargs.get('deployment_name', None) + self.deployment_name = kwargs.get("deployment_name", None) class EndpointPropertiesBase(msrest.serialization.Model): @@ -2116,24 +2087,21 @@ class EndpointPropertiesBase(msrest.serialization.Model): """ _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, + "auth_mode": {"required": True}, + "scoring_uri": {"readonly": True}, + "swagger_uri": {"readonly": True}, } _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, + "auth_mode": {"key": "authMode", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "keys": {"key": "keys", "type": "EndpointAuthKeys"}, + "properties": {"key": "properties", "type": "{str}"}, + "scoring_uri": {"key": "scoringUri", "type": "str"}, + "swagger_uri": {"key": "swaggerUri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' @@ -2149,10 +2117,10 @@ def __init__( :paramtype properties: dict[str, str] """ super(EndpointPropertiesBase, self).__init__(**kwargs) - self.auth_mode = kwargs['auth_mode'] - self.description = kwargs.get('description', None) - self.keys = kwargs.get('keys', None) - self.properties = kwargs.get('properties', None) + self.auth_mode = kwargs["auth_mode"] + self.description = kwargs.get("description", None) + self.keys = kwargs.get("keys", None) + self.properties = kwargs.get("properties", None) self.scoring_uri = None self.swagger_uri = None @@ -2189,27 +2157,24 @@ class BatchEndpointDetails(EndpointPropertiesBase): """ _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "auth_mode": {"required": True}, + "scoring_uri": {"readonly": True}, + "swagger_uri": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'defaults': {'key': 'defaults', 'type': 'BatchEndpointDefaults'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "auth_mode": {"key": "authMode", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "keys": {"key": "keys", "type": "EndpointAuthKeys"}, + "properties": {"key": "properties", "type": "{str}"}, + "scoring_uri": {"key": "scoringUri", "type": "str"}, + "swagger_uri": {"key": "swaggerUri", "type": "str"}, + "defaults": {"key": "defaults", "type": "BatchEndpointDefaults"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' @@ -2227,11 +2192,13 @@ def __init__( :paramtype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults """ super(BatchEndpointDetails, self).__init__(**kwargs) - self.defaults = kwargs.get('defaults', None) + self.defaults = kwargs.get("defaults", None) self.provisioning_state = None -class BatchEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class BatchEndpointTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of BatchEndpoint entities. :ivar next_link: The link to the next page of BatchEndpoint objects. If null, there are no @@ -2242,14 +2209,11 @@ class BatchEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model) """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchEndpointData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[BatchEndpointData]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of BatchEndpoint objects. If null, there are no additional pages. @@ -2257,9 +2221,11 @@ def __init__( :keyword value: An array of objects of type BatchEndpoint. :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchEndpointData] """ - super(BatchEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(BatchEndpointTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class BatchRetrySettings(msrest.serialization.Model): @@ -2272,14 +2238,11 @@ class BatchRetrySettings(msrest.serialization.Model): """ _attribute_map = { - 'max_retries': {'key': 'maxRetries', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "max_retries": {"key": "maxRetries", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword max_retries: Maximum retry count for a mini-batch. :paramtype max_retries: int @@ -2287,44 +2250,47 @@ def __init__( :paramtype timeout: ~datetime.timedelta """ super(BatchRetrySettings, self).__init__(**kwargs) - self.max_retries = kwargs.get('max_retries', 3) - self.timeout = kwargs.get('timeout', "PT30S") + self.max_retries = kwargs.get("max_retries", 3) + self.timeout = kwargs.get("timeout", "PT30S") class SamplingAlgorithm(msrest.serialization.Model): """The Sampling Algorithm used to generate hyperparameter values, along with properties to -configure the algorithm. + configure the algorithm. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BayesianSamplingAlgorithm, GridSamplingAlgorithm, RandomSamplingAlgorithm. + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: BayesianSamplingAlgorithm, GridSamplingAlgorithm, RandomSamplingAlgorithm. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType + :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating + hyperparameter values, along with configuration properties.Constant filled by server. Possible + values include: "Grid", "Random", "Bayesian". + :vartype sampling_algorithm_type: str or + ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } _subtype_map = { - 'sampling_algorithm_type': {'Bayesian': 'BayesianSamplingAlgorithm', 'Grid': 'GridSamplingAlgorithm', 'Random': 'RandomSamplingAlgorithm'} + "sampling_algorithm_type": { + "Bayesian": "BayesianSamplingAlgorithm", + "Grid": "GridSamplingAlgorithm", + "Random": "RandomSamplingAlgorithm", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(SamplingAlgorithm, self).__init__(**kwargs) self.sampling_algorithm_type = None # type: Optional[str] @@ -2342,21 +2308,20 @@ class BayesianSamplingAlgorithm(SamplingAlgorithm): """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(BayesianSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Bayesian' # type: str + self.sampling_algorithm_type = "Bayesian" # type: str class BuildContext(msrest.serialization.Model): @@ -2366,56 +2331,53 @@ class BuildContext(msrest.serialization.Model): :ivar context_uri: Required. [Required] URI of the Docker build context used to build the image. Supports blob URIs on environment creation and may return blob or Git URIs. - - + + .. raw:: html - + . :vartype context_uri: str :ivar dockerfile_path: Path to the Dockerfile in the build context. - - + + .. raw:: html - + . :vartype dockerfile_path: str """ _validation = { - 'context_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "context_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'context_uri': {'key': 'contextUri', 'type': 'str'}, - 'dockerfile_path': {'key': 'dockerfilePath', 'type': 'str'}, + "context_uri": {"key": "contextUri", "type": "str"}, + "dockerfile_path": {"key": "dockerfilePath", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword context_uri: Required. [Required] URI of the Docker build context used to build the image. Supports blob URIs on environment creation and may return blob or Git URIs. - - + + .. raw:: html - + . :paramtype context_uri: str :keyword dockerfile_path: Path to the Dockerfile in the build context. - - + + .. raw:: html - + . :paramtype dockerfile_path: str """ super(BuildContext, self).__init__(**kwargs) - self.context_uri = kwargs['context_uri'] - self.dockerfile_path = kwargs.get('dockerfile_path', "Dockerfile") + self.context_uri = kwargs["context_uri"] + self.dockerfile_path = kwargs.get("dockerfile_path", "Dockerfile") class CertificateDatastoreCredentials(DatastoreCredentials): @@ -2442,27 +2404,24 @@ class CertificateDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, - 'thumbprint': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials_type": {"required": True}, + "client_id": {"required": True}, + "secrets": {"required": True}, + "tenant_id": {"required": True}, + "thumbprint": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'CertificateDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "authority_url": {"key": "authorityUrl", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + "resource_url": {"key": "resourceUrl", "type": "str"}, + "secrets": {"key": "secrets", "type": "CertificateDatastoreSecrets"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "thumbprint": {"key": "thumbprint", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword authority_url: Authority URL used for authentication. :paramtype authority_url: str @@ -2480,13 +2439,13 @@ def __init__( :paramtype thumbprint: str """ super(CertificateDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Certificate' # type: str - self.authority_url = kwargs.get('authority_url', None) - self.client_id = kwargs['client_id'] - self.resource_url = kwargs.get('resource_url', None) - self.secrets = kwargs['secrets'] - self.tenant_id = kwargs['tenant_id'] - self.thumbprint = kwargs['thumbprint'] + self.credentials_type = "Certificate" # type: str + self.authority_url = kwargs.get("authority_url", None) + self.client_id = kwargs["client_id"] + self.resource_url = kwargs.get("resource_url", None) + self.secrets = kwargs["secrets"] + self.tenant_id = kwargs["tenant_id"] + self.thumbprint = kwargs["thumbprint"] class CertificateDatastoreSecrets(DatastoreSecrets): @@ -2503,25 +2462,22 @@ class CertificateDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'certificate': {'key': 'certificate', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "certificate": {"key": "certificate", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword certificate: Service principal certificate. :paramtype certificate: str """ super(CertificateDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Certificate' # type: str - self.certificate = kwargs.get('certificate', None) + self.secrets_type = "Certificate" # type: str + self.certificate = kwargs.get("certificate", None) class TableVertical(msrest.serialization.Model): @@ -2539,16 +2495,25 @@ class TableVertical(msrest.serialization.Model): """ _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'TableVerticalDataSettings'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'TrainingSettings'}, + "data_settings": { + "key": "dataSettings", + "type": "TableVerticalDataSettings", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "training_settings": { + "key": "trainingSettings", + "type": "TrainingSettings", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data_settings: Data inputs for AutoMLJob. :paramtype data_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalDataSettings @@ -2562,10 +2527,12 @@ def __init__( :paramtype training_settings: ~azure.mgmt.machinelearningservices.models.TrainingSettings """ super(TableVertical, self).__init__(**kwargs) - self.data_settings = kwargs.get('data_settings', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.training_settings = kwargs.get('training_settings', None) + self.data_settings = kwargs.get("data_settings", None) + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.limit_settings = kwargs.get("limit_settings", None) + self.training_settings = kwargs.get("training_settings", None) class Classification(AutoMLVertical, TableVertical): @@ -2603,25 +2570,34 @@ class Classification(AutoMLVertical, TableVertical): """ _validation = { - 'task_type': {'required': True}, + "task_type": {"required": True}, } _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'TableVerticalDataSettings'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'TrainingSettings'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'allowed_models': {'key': 'allowedModels', 'type': '[str]'}, - 'blocked_models': {'key': 'blockedModels', 'type': '[str]'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "data_settings": { + "key": "dataSettings", + "type": "TableVerticalDataSettings", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "training_settings": { + "key": "trainingSettings", + "type": "TrainingSettings", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "allowed_models": {"key": "allowedModels", "type": "[str]"}, + "blocked_models": {"key": "blockedModels", "type": "[str]"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data_settings: Data inputs for AutoMLJob. :paramtype data_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalDataSettings @@ -2648,19 +2624,21 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ super(Classification, self).__init__(**kwargs) - self.data_settings = kwargs.get('data_settings', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.training_settings = kwargs.get('training_settings', None) - self.task_type = 'Classification' # type: str - self.allowed_models = kwargs.get('allowed_models', None) - self.blocked_models = kwargs.get('blocked_models', None) - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.task_type = 'Classification' # type: str - self.allowed_models = kwargs.get('allowed_models', None) - self.blocked_models = kwargs.get('blocked_models', None) - self.primary_metric = kwargs.get('primary_metric', None) + self.data_settings = kwargs.get("data_settings", None) + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.limit_settings = kwargs.get("limit_settings", None) + self.training_settings = kwargs.get("training_settings", None) + self.task_type = "Classification" # type: str + self.allowed_models = kwargs.get("allowed_models", None) + self.blocked_models = kwargs.get("blocked_models", None) + self.primary_metric = kwargs.get("primary_metric", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.task_type = "Classification" # type: str + self.allowed_models = kwargs.get("allowed_models", None) + self.blocked_models = kwargs.get("blocked_models", None) + self.primary_metric = kwargs.get("primary_metric", None) class CodeConfiguration(msrest.serialization.Model): @@ -2675,18 +2653,19 @@ class CodeConfiguration(msrest.serialization.Model): """ _validation = { - 'scoring_script': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "scoring_script": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'scoring_script': {'key': 'scoringScript', 'type': 'str'}, + "code_id": {"key": "codeId", "type": "str"}, + "scoring_script": {"key": "scoringScript", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword code_id: ARM resource ID of the code asset. :paramtype code_id: str @@ -2694,8 +2673,8 @@ def __init__( :paramtype scoring_script: str """ super(CodeConfiguration, self).__init__(**kwargs) - self.code_id = kwargs.get('code_id', None) - self.scoring_script = kwargs['scoring_script'] + self.code_id = kwargs.get("code_id", None) + self.scoring_script = kwargs["scoring_script"] class CodeContainerData(Resource): @@ -2721,31 +2700,28 @@ class CodeContainerData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeContainerDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "CodeContainerDetails"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeContainerDetails """ super(CodeContainerData, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class CodeContainerDetails(AssetContainer): @@ -2768,23 +2744,20 @@ class CodeContainerDetails(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -2809,14 +2782,11 @@ class CodeContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeContainerData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[CodeContainerData]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of CodeContainer objects. If null, there are no additional pages. @@ -2825,8 +2795,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.CodeContainerData] """ super(CodeContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class CodeVersionData(Resource): @@ -2852,31 +2822,28 @@ class CodeVersionData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeVersionDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "CodeVersionDetails"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeVersionDetails """ super(CodeVersionData, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class CodeVersionDetails(AssetBase): @@ -2897,18 +2864,15 @@ class CodeVersionDetails(AssetBase): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'code_uri': {'key': 'codeUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "code_uri": {"key": "codeUri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -2924,7 +2888,7 @@ def __init__( :paramtype code_uri: str """ super(CodeVersionDetails, self).__init__(**kwargs) - self.code_uri = kwargs.get('code_uri', None) + self.code_uri = kwargs.get("code_uri", None) class CodeVersionResourceArmPaginatedResult(msrest.serialization.Model): @@ -2938,14 +2902,11 @@ class CodeVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeVersionData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[CodeVersionData]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of CodeVersion objects. If null, there are no additional pages. @@ -2954,8 +2915,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.CodeVersionData] """ super(CodeVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class ColumnTransformer(msrest.serialization.Model): @@ -2969,14 +2930,11 @@ class ColumnTransformer(msrest.serialization.Model): """ _attribute_map = { - 'fields': {'key': 'fields', 'type': '[str]'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, + "fields": {"key": "fields", "type": "[str]"}, + "parameters": {"key": "parameters", "type": "object"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword fields: Fields to apply transformer logic on. :paramtype fields: list[str] @@ -2985,8 +2943,8 @@ def __init__( :paramtype parameters: any """ super(ColumnTransformer, self).__init__(**kwargs) - self.fields = kwargs.get('fields', None) - self.parameters = kwargs.get('parameters', None) + self.fields = kwargs.get("fields", None) + self.parameters = kwargs.get("parameters", None) class CommandJob(JobBaseDetails): @@ -3054,42 +3012,49 @@ class CommandJob(JobBaseDetails): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'parameters': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'ScheduleBase'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'CommandJobLimits'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, - 'resources': {'key': 'resources', 'type': 'ResourceConfiguration'}, - } - - def __init__( - self, - **kwargs - ): + "job_type": {"required": True}, + "status": {"readonly": True}, + "command": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "environment_id": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "parameters": {"readonly": True}, + } + + _attribute_map = { + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "schedule": {"key": "schedule", "type": "ScheduleBase"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "code_id": {"key": "codeId", "type": "str"}, + "command": {"key": "command", "type": "str"}, + "distribution": { + "key": "distribution", + "type": "DistributionConfiguration", + }, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "limits": {"key": "limits", "type": "CommandJobLimits"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "parameters": {"key": "parameters", "type": "object"}, + "resources": {"key": "resources", "type": "ResourceConfiguration"}, + } + + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -3139,17 +3104,17 @@ def __init__( :paramtype resources: ~azure.mgmt.machinelearningservices.models.ResourceConfiguration """ super(CommandJob, self).__init__(**kwargs) - self.job_type = 'Command' # type: str - self.code_id = kwargs.get('code_id', None) - self.command = kwargs['command'] - self.distribution = kwargs.get('distribution', None) - self.environment_id = kwargs['environment_id'] - self.environment_variables = kwargs.get('environment_variables', None) - self.inputs = kwargs.get('inputs', None) - self.limits = kwargs.get('limits', None) - self.outputs = kwargs.get('outputs', None) + self.job_type = "Command" # type: str + self.code_id = kwargs.get("code_id", None) + self.command = kwargs["command"] + self.distribution = kwargs.get("distribution", None) + self.environment_id = kwargs["environment_id"] + self.environment_variables = kwargs.get("environment_variables", None) + self.inputs = kwargs.get("inputs", None) + self.limits = kwargs.get("limits", None) + self.outputs = kwargs.get("outputs", None) self.parameters = None - self.resources = kwargs.get('resources', None) + self.resources = kwargs.get("resources", None) class JobLimits(msrest.serialization.Model): @@ -3169,22 +3134,22 @@ class JobLimits(msrest.serialization.Model): """ _validation = { - 'job_limits_type': {'required': True}, + "job_limits_type": {"required": True}, } _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "job_limits_type": {"key": "jobLimitsType", "type": "str"}, + "timeout": {"key": "timeout", "type": "duration"}, } _subtype_map = { - 'job_limits_type': {'Command': 'CommandJobLimits', 'Sweep': 'SweepJobLimits'} + "job_limits_type": { + "Command": "CommandJobLimits", + "Sweep": "SweepJobLimits", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. Only supports duration with precision as low as Seconds. @@ -3192,7 +3157,7 @@ def __init__( """ super(JobLimits, self).__init__(**kwargs) self.job_limits_type = None # type: Optional[str] - self.timeout = kwargs.get('timeout', None) + self.timeout = kwargs.get("timeout", None) class CommandJobLimits(JobLimits): @@ -3209,25 +3174,22 @@ class CommandJobLimits(JobLimits): """ _validation = { - 'job_limits_type': {'required': True}, + "job_limits_type": {"required": True}, } _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "job_limits_type": {"key": "jobLimitsType", "type": "str"}, + "timeout": {"key": "timeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. Only supports duration with precision as low as Seconds. :paramtype timeout: ~datetime.timedelta """ super(CommandJobLimits, self).__init__(**kwargs) - self.job_limits_type = 'Command' # type: str + self.job_limits_type = "Command" # type: str class ComponentContainerData(Resource): @@ -3253,75 +3215,72 @@ class ComponentContainerData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentContainerDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "ComponentContainerDetails", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentContainerDetails """ super(ComponentContainerData, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class ComponentContainerDetails(AssetContainer): """Component container definition. -.. raw:: html + .. raw:: html - . + . - Variables are only populated by the server, and will be ignored when sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str + :ivar description: The asset description text. + :vartype description: str + :ivar properties: The asset property dictionary. + :vartype properties: dict[str, str] + :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + :ivar is_archived: Is the asset archived?. + :vartype is_archived: bool + :ivar latest_version: The latest version inside this container. + :vartype latest_version: str + :ivar next_version: The next auto incremental version. + :vartype next_version: str """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -3346,14 +3305,11 @@ class ComponentContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentContainerData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ComponentContainerData]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of ComponentContainer objects. If null, there are no additional pages. @@ -3361,9 +3317,11 @@ def __init__( :keyword value: An array of objects of type ComponentContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainerData] """ - super(ComponentContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(ComponentContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class ComponentVersionData(Resource): @@ -3389,31 +3347,28 @@ class ComponentVersionData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentVersionDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "ComponentVersionDetails"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentVersionDetails """ super(ComponentVersionData, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class ComponentVersionDetails(AssetBase): @@ -3430,10 +3385,10 @@ class ComponentVersionDetails(AssetBase): :ivar is_archived: Is the asset archived?. :vartype is_archived: bool :ivar component_spec: Defines Component definition details. - - + + .. raw:: html - + . @@ -3441,18 +3396,15 @@ class ComponentVersionDetails(AssetBase): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'component_spec': {'key': 'componentSpec', 'type': 'object'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "component_spec": {"key": "componentSpec", "type": "object"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -3465,17 +3417,17 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool :keyword component_spec: Defines Component definition details. - - + + .. raw:: html - + . :paramtype component_spec: any """ super(ComponentVersionDetails, self).__init__(**kwargs) - self.component_spec = kwargs.get('component_spec', None) + self.component_spec = kwargs.get("component_spec", None) class ComponentVersionResourceArmPaginatedResult(msrest.serialization.Model): @@ -3489,14 +3441,11 @@ class ComponentVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentVersionData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ComponentVersionData]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of ComponentVersion objects. If null, there are no additional pages. @@ -3504,9 +3453,11 @@ def __init__( :keyword value: An array of objects of type ComponentVersion. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersionData] """ - super(ComponentVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(ComponentVersionResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class ContainerResourceRequirements(msrest.serialization.Model): @@ -3521,14 +3472,17 @@ class ContainerResourceRequirements(msrest.serialization.Model): """ _attribute_map = { - 'container_resource_limits': {'key': 'containerResourceLimits', 'type': 'ContainerResourceSettings'}, - 'container_resource_requests': {'key': 'containerResourceRequests', 'type': 'ContainerResourceSettings'}, + "container_resource_limits": { + "key": "containerResourceLimits", + "type": "ContainerResourceSettings", + }, + "container_resource_requests": { + "key": "containerResourceRequests", + "type": "ContainerResourceSettings", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword container_resource_limits: Container resource limit info:. :paramtype container_resource_limits: @@ -3538,8 +3492,12 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings """ super(ContainerResourceRequirements, self).__init__(**kwargs) - self.container_resource_limits = kwargs.get('container_resource_limits', None) - self.container_resource_requests = kwargs.get('container_resource_requests', None) + self.container_resource_limits = kwargs.get( + "container_resource_limits", None + ) + self.container_resource_requests = kwargs.get( + "container_resource_requests", None + ) class ContainerResourceSettings(msrest.serialization.Model): @@ -3557,15 +3515,12 @@ class ContainerResourceSettings(msrest.serialization.Model): """ _attribute_map = { - 'cpu': {'key': 'cpu', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'memory': {'key': 'memory', 'type': 'str'}, + "cpu": {"key": "cpu", "type": "str"}, + "gpu": {"key": "gpu", "type": "str"}, + "memory": {"key": "memory", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword cpu: Number of vCPUs request/limit for container. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. @@ -3578,9 +3533,9 @@ def __init__( :paramtype memory: str """ super(ContainerResourceSettings, self).__init__(**kwargs) - self.cpu = kwargs.get('cpu', None) - self.gpu = kwargs.get('gpu', None) - self.memory = kwargs.get('memory', None) + self.cpu = kwargs.get("cpu", None) + self.gpu = kwargs.get("gpu", None) + self.memory = kwargs.get("memory", None) class ScheduleBase(msrest.serialization.Model): @@ -3608,25 +3563,25 @@ class ScheduleBase(msrest.serialization.Model): """ _validation = { - 'schedule_type': {'required': True}, + "schedule_type": {"required": True}, } _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'schedule_status': {'key': 'scheduleStatus', 'type': 'str'}, - 'schedule_type': {'key': 'scheduleType', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, + "end_time": {"key": "endTime", "type": "iso-8601"}, + "schedule_status": {"key": "scheduleStatus", "type": "str"}, + "schedule_type": {"key": "scheduleType", "type": "str"}, + "start_time": {"key": "startTime", "type": "iso-8601"}, + "time_zone": {"key": "timeZone", "type": "str"}, } _subtype_map = { - 'schedule_type': {'Cron': 'CronSchedule', 'Recurrence': 'RecurrenceSchedule'} + "schedule_type": { + "Cron": "CronSchedule", + "Recurrence": "RecurrenceSchedule", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword end_time: Specifies end time of schedule in ISO 8601 format. If not present, the schedule will run indefinitely. @@ -3641,11 +3596,11 @@ def __init__( :paramtype time_zone: str """ super(ScheduleBase, self).__init__(**kwargs) - self.end_time = kwargs.get('end_time', None) - self.schedule_status = kwargs.get('schedule_status', None) + self.end_time = kwargs.get("end_time", None) + self.schedule_status = kwargs.get("schedule_status", None) self.schedule_type = None # type: Optional[str] - self.start_time = kwargs.get('start_time', None) - self.time_zone = kwargs.get('time_zone', "UTC") + self.start_time = kwargs.get("start_time", None) + self.time_zone = kwargs.get("time_zone", "UTC") class CronSchedule(ScheduleBase): @@ -3673,23 +3628,20 @@ class CronSchedule(ScheduleBase): """ _validation = { - 'schedule_type': {'required': True}, - 'expression': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "schedule_type": {"required": True}, + "expression": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'schedule_status': {'key': 'scheduleStatus', 'type': 'str'}, - 'schedule_type': {'key': 'scheduleType', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, + "end_time": {"key": "endTime", "type": "iso-8601"}, + "schedule_status": {"key": "scheduleStatus", "type": "str"}, + "schedule_type": {"key": "scheduleType", "type": "str"}, + "start_time": {"key": "startTime", "type": "iso-8601"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "expression": {"key": "expression", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword end_time: Specifies end time of schedule in ISO 8601 format. If not present, the schedule will run indefinitely. @@ -3707,8 +3659,8 @@ def __init__( :paramtype expression: str """ super(CronSchedule, self).__init__(**kwargs) - self.schedule_type = 'Cron' # type: str - self.expression = kwargs['expression'] + self.schedule_type = "Cron" # type: str + self.expression = kwargs["expression"] class CustomForecastHorizon(ForecastHorizon): @@ -3724,26 +3676,23 @@ class CustomForecastHorizon(ForecastHorizon): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Required. [Required] Forecast horizon value. :paramtype value: int """ super(CustomForecastHorizon, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] + self.mode = "Custom" # type: str + self.value = kwargs["value"] class JobInput(msrest.serialization.Model): @@ -3763,28 +3712,33 @@ class JobInput(msrest.serialization.Model): """ _validation = { - 'job_input_type': {'required': True}, + "job_input_type": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } _subtype_map = { - 'job_input_type': {'CustomModel': 'CustomModelJobInput', 'Literal': 'LiteralJobInput', 'MLFlowModel': 'MLFlowModelJobInput', 'MLTable': 'MLTableJobInput', 'TritonModel': 'TritonModelJobInput', 'UriFile': 'UriFileJobInput', 'UriFolder': 'UriFolderJobInput'} + "job_input_type": { + "CustomModel": "CustomModelJobInput", + "Literal": "LiteralJobInput", + "MLFlowModel": "MLFlowModelJobInput", + "MLTable": "MLTableJobInput", + "TritonModel": "TritonModelJobInput", + "UriFile": "UriFileJobInput", + "UriFolder": "UriFolderJobInput", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: Description for the input. :paramtype description: str """ super(JobInput, self).__init__(**kwargs) - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.job_input_type = None # type: Optional[str] @@ -3807,21 +3761,18 @@ class CustomModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -3832,11 +3783,11 @@ def __init__( :paramtype description: str """ super(CustomModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'CustomModel' # type: str - self.description = kwargs.get('description', None) - self.job_input_type = 'CustomModel' # type: str + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "CustomModel" # type: str + self.description = kwargs.get("description", None) + self.job_input_type = "CustomModel" # type: str class JobOutput(msrest.serialization.Model): @@ -3856,28 +3807,32 @@ class JobOutput(msrest.serialization.Model): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } _subtype_map = { - 'job_output_type': {'CustomModel': 'CustomModelJobOutput', 'MLFlowModel': 'MLFlowModelJobOutput', 'MLTable': 'MLTableJobOutput', 'TritonModel': 'TritonModelJobOutput', 'UriFile': 'UriFileJobOutput', 'UriFolder': 'UriFolderJobOutput'} + "job_output_type": { + "CustomModel": "CustomModelJobOutput", + "MLFlowModel": "MLFlowModelJobOutput", + "MLTable": "MLTableJobOutput", + "TritonModel": "TritonModelJobOutput", + "UriFile": "UriFileJobOutput", + "UriFolder": "UriFolderJobOutput", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: Description for the output. :paramtype description: str """ super(JobOutput, self).__init__(**kwargs) - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.job_output_type = None # type: Optional[str] @@ -3899,20 +3854,17 @@ class CustomModelJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -3922,11 +3874,11 @@ def __init__( :paramtype description: str """ super(CustomModelJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'CustomModel' # type: str - self.description = kwargs.get('description', None) - self.job_output_type = 'CustomModel' # type: str + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "CustomModel" # type: str + self.description = kwargs.get("description", None) + self.job_output_type = "CustomModel" # type: str class CustomNCrossValidations(NCrossValidations): @@ -3942,26 +3894,23 @@ class CustomNCrossValidations(NCrossValidations): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Required. [Required] N-Cross validations value. :paramtype value: int """ super(CustomNCrossValidations, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] + self.mode = "Custom" # type: str + self.value = kwargs["value"] class CustomSeasonality(Seasonality): @@ -3977,26 +3926,23 @@ class CustomSeasonality(Seasonality): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Required. [Required] Seasonality value. :paramtype value: int """ super(CustomSeasonality, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] + self.mode = "Custom" # type: str + self.value = kwargs["value"] class CustomTargetLags(TargetLags): @@ -4012,26 +3958,23 @@ class CustomTargetLags(TargetLags): """ _validation = { - 'mode': {'required': True}, - 'values': {'required': True}, + "mode": {"required": True}, + "values": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[int]'}, + "mode": {"key": "mode", "type": "str"}, + "values": {"key": "values", "type": "[int]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword values: Required. [Required] Set target lags values. :paramtype values: list[int] """ super(CustomTargetLags, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.values = kwargs['values'] + self.mode = "Custom" # type: str + self.values = kwargs["values"] class CustomTargetRollingWindowSize(TargetRollingWindowSize): @@ -4047,26 +3990,23 @@ class CustomTargetRollingWindowSize(TargetRollingWindowSize): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Required. [Required] TargetRollingWindowSize value. :paramtype value: int """ super(CustomTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] + self.mode = "Custom" # type: str + self.value = kwargs["value"] class DataContainerData(Resource): @@ -4092,31 +4032,28 @@ class DataContainerData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataContainerDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "DataContainerDetails"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataContainerDetails """ super(DataContainerData, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class DataContainerDetails(AssetContainer): @@ -4144,25 +4081,22 @@ class DataContainerDetails(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'data_type': {'required': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "data_type": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "data_type": {"key": "dataType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -4177,7 +4111,7 @@ def __init__( :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType """ super(DataContainerDetails, self).__init__(**kwargs) - self.data_type = kwargs['data_type'] + self.data_type = kwargs["data_type"] class DataContainerResourceArmPaginatedResult(msrest.serialization.Model): @@ -4191,14 +4125,11 @@ class DataContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataContainerData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[DataContainerData]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of DataContainer objects. If null, there are no additional pages. @@ -4207,8 +4138,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataContainerData] """ super(DataContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class DataPathAssetReference(AssetReferenceBase): @@ -4226,19 +4157,16 @@ class DataPathAssetReference(AssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'datastore_id': {'key': 'datastoreId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "datastore_id": {"key": "datastoreId", "type": "str"}, + "path": {"key": "path", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword datastore_id: ARM resource ID of the datastore where the asset is located. :paramtype datastore_id: str @@ -4246,9 +4174,9 @@ def __init__( :paramtype path: str """ super(DataPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'DataPath' # type: str - self.datastore_id = kwargs.get('datastore_id', None) - self.path = kwargs.get('path', None) + self.reference_type = "DataPath" # type: str + self.datastore_id = kwargs.get("datastore_id", None) + self.path = kwargs.get("path", None) class DataSettings(msrest.serialization.Model): @@ -4267,20 +4195,20 @@ class DataSettings(msrest.serialization.Model): """ _validation = { - 'target_column_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'training_data': {'required': True}, + "target_column_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "training_data": {"required": True}, } _attribute_map = { - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'test_data': {'key': 'testData', 'type': 'TestDataSettings'}, - 'training_data': {'key': 'trainingData', 'type': 'TrainingDataSettings'}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "test_data": {"key": "testData", "type": "TestDataSettings"}, + "training_data": { + "key": "trainingData", + "type": "TrainingDataSettings", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword target_column_name: Required. [Required] Target column name: This is prediction values column. @@ -4292,9 +4220,9 @@ def __init__( :paramtype training_data: ~azure.mgmt.machinelearningservices.models.TrainingDataSettings """ super(DataSettings, self).__init__(**kwargs) - self.target_column_name = kwargs['target_column_name'] - self.test_data = kwargs.get('test_data', None) - self.training_data = kwargs['training_data'] + self.target_column_name = kwargs["target_column_name"] + self.test_data = kwargs.get("test_data", None) + self.training_data = kwargs["training_data"] class DatastoreData(Resource): @@ -4320,31 +4248,28 @@ class DatastoreData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DatastoreDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "DatastoreDetails"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatastoreDetails """ super(DatastoreData, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class DatastoreResourceArmPaginatedResult(msrest.serialization.Model): @@ -4358,14 +4283,11 @@ class DatastoreResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DatastoreData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[DatastoreData]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of Datastore objects. If null, there are no additional pages. @@ -4374,8 +4296,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.DatastoreData] """ super(DatastoreResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class DataVersionBaseData(Resource): @@ -4401,31 +4323,28 @@ class DataVersionBaseData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataVersionBaseDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "DataVersionBaseDetails"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataVersionBaseDetails """ super(DataVersionBaseData, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class DataVersionBaseDetails(AssetBase): @@ -4455,28 +4374,29 @@ class DataVersionBaseDetails(AssetBase): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, } _subtype_map = { - 'data_type': {'MLTable': 'MLTableData', 'UriFile': 'UriFileDataVersion', 'UriFolder': 'UriFolderDataVersion'} + "data_type": { + "MLTable": "MLTableData", + "UriFile": "UriFileDataVersion", + "UriFolder": "UriFolderDataVersion", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -4493,8 +4413,8 @@ def __init__( :paramtype data_uri: str """ super(DataVersionBaseDetails, self).__init__(**kwargs) - self.data_type = 'DataVersionBaseDetails' # type: str - self.data_uri = kwargs['data_uri'] + self.data_type = "DataVersionBaseDetails" # type: str + self.data_uri = kwargs["data_uri"] class DataVersionBaseResourceArmPaginatedResult(msrest.serialization.Model): @@ -4508,14 +4428,11 @@ class DataVersionBaseResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataVersionBaseData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[DataVersionBaseData]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of DataVersionBase objects. If null, there are no additional pages. @@ -4523,9 +4440,11 @@ def __init__( :keyword value: An array of objects of type DataVersionBase. :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBaseData] """ - super(DataVersionBaseResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(DataVersionBaseResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class OnlineScaleSettings(msrest.serialization.Model): @@ -4542,23 +4461,22 @@ class OnlineScaleSettings(msrest.serialization.Model): """ _validation = { - 'scale_type': {'required': True}, + "scale_type": {"required": True}, } _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, + "scale_type": {"key": "scaleType", "type": "str"}, } _subtype_map = { - 'scale_type': {'Default': 'DefaultScaleSettings', 'TargetUtilization': 'TargetUtilizationScaleSettings'} + "scale_type": { + "Default": "DefaultScaleSettings", + "TargetUtilization": "TargetUtilizationScaleSettings", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(OnlineScaleSettings, self).__init__(**kwargs) self.scale_type = None # type: Optional[str] @@ -4574,21 +4492,17 @@ class DefaultScaleSettings(OnlineScaleSettings): """ _validation = { - 'scale_type': {'required': True}, + "scale_type": {"required": True}, } _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, + "scale_type": {"key": "scaleType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DefaultScaleSettings, self).__init__(**kwargs) - self.scale_type = 'Default' # type: str + self.scale_type = "Default" # type: str class DeploymentLogs(msrest.serialization.Model): @@ -4599,19 +4513,16 @@ class DeploymentLogs(msrest.serialization.Model): """ _attribute_map = { - 'content': {'key': 'content', 'type': 'str'}, + "content": {"key": "content", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword content: The retrieved online deployment logs. :paramtype content: str """ super(DeploymentLogs, self).__init__(**kwargs) - self.content = kwargs.get('content', None) + self.content = kwargs.get("content", None) class DeploymentLogsRequest(msrest.serialization.Model): @@ -4625,14 +4536,11 @@ class DeploymentLogsRequest(msrest.serialization.Model): """ _attribute_map = { - 'container_type': {'key': 'containerType', 'type': 'str'}, - 'tail': {'key': 'tail', 'type': 'int'}, + "container_type": {"key": "containerType", "type": "str"}, + "tail": {"key": "tail", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword container_type: The type of container to retrieve logs from. Possible values include: "StorageInitializer", "InferenceServer". @@ -4641,8 +4549,8 @@ def __init__( :paramtype tail: int """ super(DeploymentLogsRequest, self).__init__(**kwargs) - self.container_type = kwargs.get('container_type', None) - self.tail = kwargs.get('tail', None) + self.container_type = kwargs.get("container_type", None) + self.tail = kwargs.get("tail", None) class DistributionConfiguration(msrest.serialization.Model): @@ -4659,23 +4567,23 @@ class DistributionConfiguration(msrest.serialization.Model): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, + "distribution_type": {"key": "distributionType", "type": "str"}, } _subtype_map = { - 'distribution_type': {'Mpi': 'Mpi', 'PyTorch': 'PyTorch', 'TensorFlow': 'TensorFlow'} + "distribution_type": { + "Mpi": "Mpi", + "PyTorch": "PyTorch", + "TensorFlow": "TensorFlow", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DistributionConfiguration, self).__init__(**kwargs) self.distribution_type = None # type: Optional[str] @@ -4690,14 +4598,11 @@ class EndpointAuthKeys(msrest.serialization.Model): """ _attribute_map = { - 'primary_key': {'key': 'primaryKey', 'type': 'str'}, - 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, + "primary_key": {"key": "primaryKey", "type": "str"}, + "secondary_key": {"key": "secondaryKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword primary_key: The primary key. :paramtype primary_key: str @@ -4705,8 +4610,8 @@ def __init__( :paramtype secondary_key: str """ super(EndpointAuthKeys, self).__init__(**kwargs) - self.primary_key = kwargs.get('primary_key', None) - self.secondary_key = kwargs.get('secondary_key', None) + self.primary_key = kwargs.get("primary_key", None) + self.secondary_key = kwargs.get("secondary_key", None) class EndpointAuthToken(msrest.serialization.Model): @@ -4723,16 +4628,16 @@ class EndpointAuthToken(msrest.serialization.Model): """ _attribute_map = { - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'expiry_time_utc': {'key': 'expiryTimeUtc', 'type': 'long'}, - 'refresh_after_time_utc': {'key': 'refreshAfterTimeUtc', 'type': 'long'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, + "access_token": {"key": "accessToken", "type": "str"}, + "expiry_time_utc": {"key": "expiryTimeUtc", "type": "long"}, + "refresh_after_time_utc": { + "key": "refreshAfterTimeUtc", + "type": "long", + }, + "token_type": {"key": "tokenType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword access_token: Access token for endpoint authentication. :paramtype access_token: str @@ -4744,10 +4649,10 @@ def __init__( :paramtype token_type: str """ super(EndpointAuthToken, self).__init__(**kwargs) - self.access_token = kwargs.get('access_token', None) - self.expiry_time_utc = kwargs.get('expiry_time_utc', 0) - self.refresh_after_time_utc = kwargs.get('refresh_after_time_utc', 0) - self.token_type = kwargs.get('token_type', None) + self.access_token = kwargs.get("access_token", None) + self.expiry_time_utc = kwargs.get("expiry_time_utc", 0) + self.refresh_after_time_utc = kwargs.get("refresh_after_time_utc", 0) + self.token_type = kwargs.get("token_type", None) class EnvironmentContainerData(Resource): @@ -4773,31 +4678,31 @@ class EnvironmentContainerData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentContainerDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "EnvironmentContainerDetails", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerDetails """ super(EnvironmentContainerData, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class EnvironmentContainerDetails(AssetContainer): @@ -4820,23 +4725,20 @@ class EnvironmentContainerDetails(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -4850,7 +4752,9 @@ def __init__( super(EnvironmentContainerDetails, self).__init__(**kwargs) -class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model): +class EnvironmentContainerResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of EnvironmentContainer entities. :ivar next_link: The link to the next page of EnvironmentContainer objects. If null, there are @@ -4861,14 +4765,11 @@ class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model) """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentContainerData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[EnvironmentContainerData]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of EnvironmentContainer objects. If null, there are no additional pages. @@ -4876,9 +4777,11 @@ def __init__( :keyword value: An array of objects of type EnvironmentContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainerData] """ - super(EnvironmentContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(EnvironmentContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class EnvironmentVersionData(Resource): @@ -4904,31 +4807,31 @@ class EnvironmentVersionData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentVersionDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "EnvironmentVersionDetails", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionDetails """ super(EnvironmentVersionData, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class EnvironmentVersionDetails(AssetBase): @@ -4950,29 +4853,29 @@ class EnvironmentVersionDetails(AssetBase): :vartype build: ~azure.mgmt.machinelearningservices.models.BuildContext :ivar conda_file: Standard configuration file used by Conda that lets you install any kind of package, including Python, R, and C/C++ packages. - - + + .. raw:: html - + . :vartype conda_file: str :ivar environment_type: Environment type is either user managed or curated by the Azure ML service - - + + .. raw:: html - + . Possible values include: "Curated", "UserCreated". :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType :ivar image: Name of the image that will be used for the environment. - - + + .. raw:: html - + . @@ -4985,27 +4888,27 @@ class EnvironmentVersionDetails(AssetBase): """ _validation = { - 'environment_type': {'readonly': True}, + "environment_type": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'build': {'key': 'build', 'type': 'BuildContext'}, - 'conda_file': {'key': 'condaFile', 'type': 'str'}, - 'environment_type': {'key': 'environmentType', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'str'}, - 'inference_config': {'key': 'inferenceConfig', 'type': 'InferenceContainerProperties'}, - 'os_type': {'key': 'osType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "build": {"key": "build", "type": "BuildContext"}, + "conda_file": {"key": "condaFile", "type": "str"}, + "environment_type": {"key": "environmentType", "type": "str"}, + "image": {"key": "image", "type": "str"}, + "inference_config": { + "key": "inferenceConfig", + "type": "InferenceContainerProperties", + }, + "os_type": {"key": "osType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -5021,19 +4924,19 @@ def __init__( :paramtype build: ~azure.mgmt.machinelearningservices.models.BuildContext :keyword conda_file: Standard configuration file used by Conda that lets you install any kind of package, including Python, R, and C/C++ packages. - - + + .. raw:: html - + . :paramtype conda_file: str :keyword image: Name of the image that will be used for the environment. - - + + .. raw:: html - + . @@ -5045,12 +4948,12 @@ def __init__( :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.OperatingSystemType """ super(EnvironmentVersionDetails, self).__init__(**kwargs) - self.build = kwargs.get('build', None) - self.conda_file = kwargs.get('conda_file', None) + self.build = kwargs.get("build", None) + self.conda_file = kwargs.get("conda_file", None) self.environment_type = None - self.image = kwargs.get('image', None) - self.inference_config = kwargs.get('inference_config', None) - self.os_type = kwargs.get('os_type', None) + self.image = kwargs.get("image", None) + self.inference_config = kwargs.get("inference_config", None) + self.os_type = kwargs.get("os_type", None) class EnvironmentVersionResourceArmPaginatedResult(msrest.serialization.Model): @@ -5064,14 +4967,11 @@ class EnvironmentVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentVersionData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[EnvironmentVersionData]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of EnvironmentVersion objects. If null, there are no additional pages. @@ -5079,9 +4979,11 @@ def __init__( :keyword value: An array of objects of type EnvironmentVersion. :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersionData] """ - super(EnvironmentVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(EnvironmentVersionResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class ErrorAdditionalInfo(msrest.serialization.Model): @@ -5096,21 +4998,17 @@ class ErrorAdditionalInfo(msrest.serialization.Model): """ _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, + "type": {"readonly": True}, + "info": {"readonly": True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, + "type": {"key": "type", "type": "str"}, + "info": {"key": "info", "type": "object"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ErrorAdditionalInfo, self).__init__(**kwargs) self.type = None self.info = None @@ -5134,27 +5032,26 @@ class ErrorDetail(msrest.serialization.Model): """ _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, + "code": {"readonly": True}, + "message": {"readonly": True}, + "target": {"readonly": True}, + "details": {"readonly": True}, + "additional_info": {"readonly": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[ErrorDetail]"}, + "additional_info": { + "key": "additionalInfo", + "type": "[ErrorAdditionalInfo]", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ErrorDetail, self).__init__(**kwargs) self.code = None self.message = None @@ -5171,19 +5068,16 @@ class ErrorResponse(msrest.serialization.Model): """ _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, + "error": {"key": "error", "type": "ErrorDetail"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword error: The error object. :paramtype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail """ super(ErrorResponse, self).__init__(**kwargs) - self.error = kwargs.get('error', None) + self.error = kwargs.get("error", None) class FeaturizationSettings(msrest.serialization.Model): @@ -5194,19 +5088,16 @@ class FeaturizationSettings(msrest.serialization.Model): """ _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, + "dataset_language": {"key": "datasetLanguage", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword dataset_language: Dataset language, useful for the text data. :paramtype dataset_language: str """ super(FeaturizationSettings, self).__init__(**kwargs) - self.dataset_language = kwargs.get('dataset_language', None) + self.dataset_language = kwargs.get("dataset_language", None) class FlavorData(msrest.serialization.Model): @@ -5217,19 +5108,16 @@ class FlavorData(msrest.serialization.Model): """ _attribute_map = { - 'data': {'key': 'data', 'type': '{str}'}, + "data": {"key": "data", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data: Model flavor-specific data. :paramtype data: dict[str, str] """ super(FlavorData, self).__init__(**kwargs) - self.data = kwargs.get('data', None) + self.data = kwargs.get("data", None) class Forecasting(AutoMLVertical, TableVertical): @@ -5270,26 +5158,38 @@ class Forecasting(AutoMLVertical, TableVertical): """ _validation = { - 'task_type': {'required': True}, + "task_type": {"required": True}, } _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'TableVerticalDataSettings'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'TrainingSettings'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'allowed_models': {'key': 'allowedModels', 'type': '[str]'}, - 'blocked_models': {'key': 'blockedModels', 'type': '[str]'}, - 'forecasting_settings': {'key': 'forecastingSettings', 'type': 'ForecastingSettings'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "data_settings": { + "key": "dataSettings", + "type": "TableVerticalDataSettings", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "training_settings": { + "key": "trainingSettings", + "type": "TrainingSettings", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "allowed_models": {"key": "allowedModels", "type": "[str]"}, + "blocked_models": {"key": "blockedModels", "type": "[str]"}, + "forecasting_settings": { + "key": "forecastingSettings", + "type": "ForecastingSettings", + }, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data_settings: Data inputs for AutoMLJob. :paramtype data_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalDataSettings @@ -5319,21 +5219,23 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ForecastingPrimaryMetrics """ super(Forecasting, self).__init__(**kwargs) - self.data_settings = kwargs.get('data_settings', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.training_settings = kwargs.get('training_settings', None) - self.task_type = 'Forecasting' # type: str - self.allowed_models = kwargs.get('allowed_models', None) - self.blocked_models = kwargs.get('blocked_models', None) - self.forecasting_settings = kwargs.get('forecasting_settings', None) - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.task_type = 'Forecasting' # type: str - self.allowed_models = kwargs.get('allowed_models', None) - self.blocked_models = kwargs.get('blocked_models', None) - self.forecasting_settings = kwargs.get('forecasting_settings', None) - self.primary_metric = kwargs.get('primary_metric', None) + self.data_settings = kwargs.get("data_settings", None) + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.limit_settings = kwargs.get("limit_settings", None) + self.training_settings = kwargs.get("training_settings", None) + self.task_type = "Forecasting" # type: str + self.allowed_models = kwargs.get("allowed_models", None) + self.blocked_models = kwargs.get("blocked_models", None) + self.forecasting_settings = kwargs.get("forecasting_settings", None) + self.primary_metric = kwargs.get("primary_metric", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.task_type = "Forecasting" # type: str + self.allowed_models = kwargs.get("allowed_models", None) + self.blocked_models = kwargs.get("blocked_models", None) + self.forecasting_settings = kwargs.get("forecasting_settings", None) + self.primary_metric = kwargs.get("primary_metric", None) class ForecastingSettings(msrest.serialization.Model): @@ -5391,25 +5293,40 @@ class ForecastingSettings(msrest.serialization.Model): """ _attribute_map = { - 'country_or_region_for_holidays': {'key': 'countryOrRegionForHolidays', 'type': 'str'}, - 'cv_step_size': {'key': 'cvStepSize', 'type': 'int'}, - 'feature_lags': {'key': 'featureLags', 'type': 'str'}, - 'forecast_horizon': {'key': 'forecastHorizon', 'type': 'ForecastHorizon'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'seasonality': {'key': 'seasonality', 'type': 'Seasonality'}, - 'short_series_handling_config': {'key': 'shortSeriesHandlingConfig', 'type': 'str'}, - 'target_aggregate_function': {'key': 'targetAggregateFunction', 'type': 'str'}, - 'target_lags': {'key': 'targetLags', 'type': 'TargetLags'}, - 'target_rolling_window_size': {'key': 'targetRollingWindowSize', 'type': 'TargetRollingWindowSize'}, - 'time_column_name': {'key': 'timeColumnName', 'type': 'str'}, - 'time_series_id_column_names': {'key': 'timeSeriesIdColumnNames', 'type': '[str]'}, - 'use_stl': {'key': 'useStl', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + "country_or_region_for_holidays": { + "key": "countryOrRegionForHolidays", + "type": "str", + }, + "cv_step_size": {"key": "cvStepSize", "type": "int"}, + "feature_lags": {"key": "featureLags", "type": "str"}, + "forecast_horizon": { + "key": "forecastHorizon", + "type": "ForecastHorizon", + }, + "frequency": {"key": "frequency", "type": "str"}, + "seasonality": {"key": "seasonality", "type": "Seasonality"}, + "short_series_handling_config": { + "key": "shortSeriesHandlingConfig", + "type": "str", + }, + "target_aggregate_function": { + "key": "targetAggregateFunction", + "type": "str", + }, + "target_lags": {"key": "targetLags", "type": "TargetLags"}, + "target_rolling_window_size": { + "key": "targetRollingWindowSize", + "type": "TargetRollingWindowSize", + }, + "time_column_name": {"key": "timeColumnName", "type": "str"}, + "time_series_id_column_names": { + "key": "timeSeriesIdColumnNames", + "type": "[str]", + }, + "use_stl": {"key": "useStl", "type": "str"}, + } + + def __init__(self, **kwargs): """ :keyword country_or_region_for_holidays: Country or region for holidays for forecasting tasks. These should be ISO 3166 two-letter country/region codes, for example 'US' or 'GB'. @@ -5464,19 +5381,29 @@ def __init__( :paramtype use_stl: str or ~azure.mgmt.machinelearningservices.models.UseStl """ super(ForecastingSettings, self).__init__(**kwargs) - self.country_or_region_for_holidays = kwargs.get('country_or_region_for_holidays', None) - self.cv_step_size = kwargs.get('cv_step_size', None) - self.feature_lags = kwargs.get('feature_lags', None) - self.forecast_horizon = kwargs.get('forecast_horizon', None) - self.frequency = kwargs.get('frequency', None) - self.seasonality = kwargs.get('seasonality', None) - self.short_series_handling_config = kwargs.get('short_series_handling_config', None) - self.target_aggregate_function = kwargs.get('target_aggregate_function', None) - self.target_lags = kwargs.get('target_lags', None) - self.target_rolling_window_size = kwargs.get('target_rolling_window_size', None) - self.time_column_name = kwargs.get('time_column_name', None) - self.time_series_id_column_names = kwargs.get('time_series_id_column_names', None) - self.use_stl = kwargs.get('use_stl', None) + self.country_or_region_for_holidays = kwargs.get( + "country_or_region_for_holidays", None + ) + self.cv_step_size = kwargs.get("cv_step_size", None) + self.feature_lags = kwargs.get("feature_lags", None) + self.forecast_horizon = kwargs.get("forecast_horizon", None) + self.frequency = kwargs.get("frequency", None) + self.seasonality = kwargs.get("seasonality", None) + self.short_series_handling_config = kwargs.get( + "short_series_handling_config", None + ) + self.target_aggregate_function = kwargs.get( + "target_aggregate_function", None + ) + self.target_lags = kwargs.get("target_lags", None) + self.target_rolling_window_size = kwargs.get( + "target_rolling_window_size", None + ) + self.time_column_name = kwargs.get("time_column_name", None) + self.time_series_id_column_names = kwargs.get( + "time_series_id_column_names", None + ) + self.use_stl = kwargs.get("use_stl", None) class GridSamplingAlgorithm(SamplingAlgorithm): @@ -5492,21 +5419,20 @@ class GridSamplingAlgorithm(SamplingAlgorithm): """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(GridSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Grid' # type: str + self.sampling_algorithm_type = "Grid" # type: str class HdfsDatastore(DatastoreDetails): @@ -5541,28 +5467,28 @@ class HdfsDatastore(DatastoreDetails): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'name_node_address': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "name_node_address": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'hdfs_server_certificate': {'key': 'hdfsServerCertificate', 'type': 'str'}, - 'name_node_address': {'key': 'nameNodeAddress', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "hdfs_server_certificate": { + "key": "hdfsServerCertificate", + "type": "str", + }, + "name_node_address": {"key": "nameNodeAddress", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -5581,10 +5507,12 @@ def __init__( :paramtype protocol: str """ super(HdfsDatastore, self).__init__(**kwargs) - self.datastore_type = 'Hdfs' # type: str - self.hdfs_server_certificate = kwargs.get('hdfs_server_certificate', None) - self.name_node_address = kwargs['name_node_address'] - self.protocol = kwargs.get('protocol', "http") + self.datastore_type = "Hdfs" # type: str + self.hdfs_server_certificate = kwargs.get( + "hdfs_server_certificate", None + ) + self.name_node_address = kwargs["name_node_address"] + self.protocol = kwargs.get("protocol", "http") class IdAssetReference(AssetReferenceBase): @@ -5600,58 +5528,61 @@ class IdAssetReference(AssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, - 'asset_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "reference_type": {"required": True}, + "asset_id": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'asset_id': {'key': 'assetId', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "asset_id": {"key": "assetId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword asset_id: Required. [Required] ARM resource ID of the asset. :paramtype asset_id: str """ super(IdAssetReference, self).__init__(**kwargs) - self.reference_type = 'Id' # type: str - self.asset_id = kwargs['asset_id'] + self.reference_type = "Id" # type: str + self.asset_id = kwargs["asset_id"] class ImageVertical(msrest.serialization.Model): """Abstract class for AutoML tasks that train image (computer vision) models - -such as Image Classification / Image Classification Multilabel / Image Object Detection / Image Instance Segmentation. + such as Image Classification / Image Classification Multilabel / Image Object Detection / Image Instance Segmentation. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and - other data settings required for training and validating models. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and + other data settings required for training and validating models. + :vartype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings """ _validation = { - 'data_settings': {'required': True}, - 'limit_settings': {'required': True}, + "data_settings": {"required": True}, + "limit_settings": {"required": True}, } _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'ImageVerticalDataSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, + "data_settings": { + "key": "dataSettings", + "type": "ImageVerticalDataSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and other data settings required for training and validating models. @@ -5662,9 +5593,9 @@ def __init__( :paramtype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings """ super(ImageVertical, self).__init__(**kwargs) - self.data_settings = kwargs['data_settings'] - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) + self.data_settings = kwargs["data_settings"] + self.limit_settings = kwargs["limit_settings"] + self.sweep_settings = kwargs.get("sweep_settings", None) class ImageClassificationBase(ImageVertical): @@ -5689,22 +5620,34 @@ class ImageClassificationBase(ImageVertical): """ _validation = { - 'data_settings': {'required': True}, - 'limit_settings': {'required': True}, + "data_settings": {"required": True}, + "limit_settings": {"required": True}, } _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'ImageVerticalDataSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, + "data_settings": { + "key": "dataSettings", + "type": "ImageVerticalDataSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsClassification", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsClassification]", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and other data settings required for training and validating models. @@ -5722,66 +5665,78 @@ def __init__( list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] """ super(ImageClassificationBase, self).__init__(**kwargs) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) + self.model_settings = kwargs.get("model_settings", None) + self.search_space = kwargs.get("search_space", None) class ImageClassification(AutoMLVertical, ImageClassificationBase): """Image Classification. Multi-class image classification is used when an image is classified with only a single label -from a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' or a 'duck'. + from a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' or a 'duck'. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and - other data settings required for training and validating models. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics + :ivar data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and + other data settings required for training and validating models. + :vartype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ _validation = { - 'data_settings': {'required': True}, - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, + "data_settings": {"required": True}, + "limit_settings": {"required": True}, + "task_type": {"required": True}, } _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'ImageVerticalDataSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "data_settings": { + "key": "dataSettings", + "type": "ImageVerticalDataSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsClassification", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsClassification]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and other data settings required for training and validating models. @@ -5807,74 +5762,86 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ super(ImageClassification, self).__init__(**kwargs) - self.data_settings = kwargs['data_settings'] - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageClassification' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.task_type = 'ImageClassification' # type: str - self.primary_metric = kwargs.get('primary_metric', None) + self.data_settings = kwargs["data_settings"] + self.limit_settings = kwargs["limit_settings"] + self.sweep_settings = kwargs.get("sweep_settings", None) + self.model_settings = kwargs.get("model_settings", None) + self.search_space = kwargs.get("search_space", None) + self.task_type = "ImageClassification" # type: str + self.primary_metric = kwargs.get("primary_metric", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.task_type = "ImageClassification" # type: str + self.primary_metric = kwargs.get("primary_metric", None) class ImageClassificationMultilabel(AutoMLVertical, ImageClassificationBase): """Image Classification Multilabel. Multi-label image classification is used when an image could have one or more labels -from a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'. + from a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and - other data settings required for training and validating models. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics + :ivar data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and + other data settings required for training and validating models. + :vartype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted", "IOU". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics """ _validation = { - 'data_settings': {'required': True}, - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, + "data_settings": {"required": True}, + "limit_settings": {"required": True}, + "task_type": {"required": True}, } _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'ImageVerticalDataSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "data_settings": { + "key": "dataSettings", + "type": "ImageVerticalDataSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsClassification", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsClassification]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and other data settings required for training and validating models. @@ -5900,16 +5867,16 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics """ super(ImageClassificationMultilabel, self).__init__(**kwargs) - self.data_settings = kwargs['data_settings'] - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageClassificationMultilabel' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.task_type = 'ImageClassificationMultilabel' # type: str - self.primary_metric = kwargs.get('primary_metric', None) + self.data_settings = kwargs["data_settings"] + self.limit_settings = kwargs["limit_settings"] + self.sweep_settings = kwargs.get("sweep_settings", None) + self.model_settings = kwargs.get("model_settings", None) + self.search_space = kwargs.get("search_space", None) + self.task_type = "ImageClassificationMultilabel" # type: str + self.primary_metric = kwargs.get("primary_metric", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.task_type = "ImageClassificationMultilabel" # type: str + self.primary_metric = kwargs.get("primary_metric", None) class ImageObjectDetectionBase(ImageVertical): @@ -5934,22 +5901,34 @@ class ImageObjectDetectionBase(ImageVertical): """ _validation = { - 'data_settings': {'required': True}, - 'limit_settings': {'required': True}, + "data_settings": {"required": True}, + "limit_settings": {"required": True}, } _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'ImageVerticalDataSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, + "data_settings": { + "key": "dataSettings", + "type": "ImageVerticalDataSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsObjectDetection", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsObjectDetection]", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and other data settings required for training and validating models. @@ -5967,65 +5946,77 @@ def __init__( list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] """ super(ImageObjectDetectionBase, self).__init__(**kwargs) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) + self.model_settings = kwargs.get("model_settings", None) + self.search_space = kwargs.get("search_space", None) class ImageInstanceSegmentation(AutoMLVertical, ImageObjectDetectionBase): """Image Instance Segmentation. Instance segmentation is used to identify objects in an image at the pixel level, -drawing a polygon around each object in the image. + drawing a polygon around each object in the image. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and - other data settings required for training and validating models. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics + :ivar data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and + other data settings required for training and validating models. + :vartype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "MeanAveragePrecision". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics """ _validation = { - 'data_settings': {'required': True}, - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, + "data_settings": {"required": True}, + "limit_settings": {"required": True}, + "task_type": {"required": True}, } _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'ImageVerticalDataSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "data_settings": { + "key": "dataSettings", + "type": "ImageVerticalDataSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsObjectDetection", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsObjectDetection]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and other data settings required for training and validating models. @@ -6050,16 +6041,16 @@ def __init__( ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics """ super(ImageInstanceSegmentation, self).__init__(**kwargs) - self.data_settings = kwargs['data_settings'] - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageInstanceSegmentation' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.task_type = 'ImageInstanceSegmentation' # type: str - self.primary_metric = kwargs.get('primary_metric', None) + self.data_settings = kwargs["data_settings"] + self.limit_settings = kwargs["limit_settings"] + self.sweep_settings = kwargs.get("sweep_settings", None) + self.model_settings = kwargs.get("model_settings", None) + self.search_space = kwargs.get("search_space", None) + self.task_type = "ImageInstanceSegmentation" # type: str + self.primary_metric = kwargs.get("primary_metric", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.task_type = "ImageInstanceSegmentation" # type: str + self.primary_metric = kwargs.get("primary_metric", None) class ImageLimitSettings(msrest.serialization.Model): @@ -6074,15 +6065,12 @@ class ImageLimitSettings(msrest.serialization.Model): """ _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_trials": {"key": "maxTrials", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword max_concurrent_trials: Maximum number of concurrent AutoML iterations. :paramtype max_concurrent_trials: int @@ -6092,148 +6080,163 @@ def __init__( :paramtype timeout: ~datetime.timedelta """ super(ImageLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', 1) - self.max_trials = kwargs.get('max_trials', 1) - self.timeout = kwargs.get('timeout', None) + self.max_concurrent_trials = kwargs.get("max_concurrent_trials", 1) + self.max_trials = kwargs.get("max_trials", 1) + self.timeout = kwargs.get("timeout", None) class ImageModelDistributionSettings(msrest.serialization.Model): """Distribution expressions to sweep over values of model settings. -:code:` -Some examples are: - -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -` -All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) -where distribution name can be: uniform, quniform, loguniform, etc -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar split_ratio: If validation data is not defined, this specifies the split ratio for - splitting - train data into random train and validation subsets. Must be a float in the range [0, 1]. - :vartype split_ratio: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'split_ratio': {'key': 'splitRatio', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + :code:` + Some examples are: + + ModelName = "choice('seresnext', 'resnest50')"; + LearningRate = "uniform(0.001, 0.01)"; + LayersToFreeze = "choice(0, 2)"; + ` + All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) + where distribution name can be: uniform, quniform, loguniform, etc + For more details on how to compose distribution expressions please check the documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: str + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: str + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: str + :ivar distributed: Whether to use distributer training. + :vartype distributed: str + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: str + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: str + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: str + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: str + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: str + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: str + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: str + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: str + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. + :vartype learning_rate_scheduler: str + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: str + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: str + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: str + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: str + :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. + :vartype optimizer: str + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: str + :ivar split_ratio: If validation data is not defined, this specifies the split ratio for + splitting + train data into random train and validation subsets. Must be a float in the range [0, 1]. + :vartype split_ratio: str + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: str + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: str + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: str + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: str + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: str + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: str + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: str + """ + + _attribute_map = { + "ams_gradient": {"key": "amsGradient", "type": "str"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "str"}, + "beta2": {"key": "beta2", "type": "str"}, + "distributed": {"key": "distributed", "type": "str"}, + "early_stopping": {"key": "earlyStopping", "type": "str"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "str"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "str", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "str", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "str"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "str", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "str"}, + "nesterov": {"key": "nesterov", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "str"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "str"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "str"}, + "split_ratio": {"key": "splitRatio", "type": "str"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "str"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "str"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "str", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "str", + }, + "weight_decay": {"key": "weightDecay", "type": "str"}, + } + + def __init__(self, **kwargs): """ :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :paramtype ams_gradient: str @@ -6321,189 +6324,221 @@ def __init__( :paramtype weight_decay: str """ super(ImageModelDistributionSettings, self).__init__(**kwargs) - self.ams_gradient = kwargs.get('ams_gradient', None) - self.augmentations = kwargs.get('augmentations', None) - self.beta1 = kwargs.get('beta1', None) - self.beta2 = kwargs.get('beta2', None) - self.distributed = kwargs.get('distributed', None) - self.early_stopping = kwargs.get('early_stopping', None) - self.early_stopping_delay = kwargs.get('early_stopping_delay', None) - self.early_stopping_patience = kwargs.get('early_stopping_patience', None) - self.enable_onnx_normalization = kwargs.get('enable_onnx_normalization', None) - self.evaluation_frequency = kwargs.get('evaluation_frequency', None) - self.gradient_accumulation_step = kwargs.get('gradient_accumulation_step', None) - self.layers_to_freeze = kwargs.get('layers_to_freeze', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.learning_rate_scheduler = kwargs.get('learning_rate_scheduler', None) - self.model_name = kwargs.get('model_name', None) - self.momentum = kwargs.get('momentum', None) - self.nesterov = kwargs.get('nesterov', None) - self.number_of_epochs = kwargs.get('number_of_epochs', None) - self.number_of_workers = kwargs.get('number_of_workers', None) - self.optimizer = kwargs.get('optimizer', None) - self.random_seed = kwargs.get('random_seed', None) - self.split_ratio = kwargs.get('split_ratio', None) - self.step_lr_gamma = kwargs.get('step_lr_gamma', None) - self.step_lr_step_size = kwargs.get('step_lr_step_size', None) - self.training_batch_size = kwargs.get('training_batch_size', None) - self.validation_batch_size = kwargs.get('validation_batch_size', None) - self.warmup_cosine_lr_cycles = kwargs.get('warmup_cosine_lr_cycles', None) - self.warmup_cosine_lr_warmup_epochs = kwargs.get('warmup_cosine_lr_warmup_epochs', None) - self.weight_decay = kwargs.get('weight_decay', None) - - -class ImageModelDistributionSettingsClassification(ImageModelDistributionSettings): + self.ams_gradient = kwargs.get("ams_gradient", None) + self.augmentations = kwargs.get("augmentations", None) + self.beta1 = kwargs.get("beta1", None) + self.beta2 = kwargs.get("beta2", None) + self.distributed = kwargs.get("distributed", None) + self.early_stopping = kwargs.get("early_stopping", None) + self.early_stopping_delay = kwargs.get("early_stopping_delay", None) + self.early_stopping_patience = kwargs.get( + "early_stopping_patience", None + ) + self.enable_onnx_normalization = kwargs.get( + "enable_onnx_normalization", None + ) + self.evaluation_frequency = kwargs.get("evaluation_frequency", None) + self.gradient_accumulation_step = kwargs.get( + "gradient_accumulation_step", None + ) + self.layers_to_freeze = kwargs.get("layers_to_freeze", None) + self.learning_rate = kwargs.get("learning_rate", None) + self.learning_rate_scheduler = kwargs.get( + "learning_rate_scheduler", None + ) + self.model_name = kwargs.get("model_name", None) + self.momentum = kwargs.get("momentum", None) + self.nesterov = kwargs.get("nesterov", None) + self.number_of_epochs = kwargs.get("number_of_epochs", None) + self.number_of_workers = kwargs.get("number_of_workers", None) + self.optimizer = kwargs.get("optimizer", None) + self.random_seed = kwargs.get("random_seed", None) + self.split_ratio = kwargs.get("split_ratio", None) + self.step_lr_gamma = kwargs.get("step_lr_gamma", None) + self.step_lr_step_size = kwargs.get("step_lr_step_size", None) + self.training_batch_size = kwargs.get("training_batch_size", None) + self.validation_batch_size = kwargs.get("validation_batch_size", None) + self.warmup_cosine_lr_cycles = kwargs.get( + "warmup_cosine_lr_cycles", None + ) + self.warmup_cosine_lr_warmup_epochs = kwargs.get( + "warmup_cosine_lr_warmup_epochs", None + ) + self.weight_decay = kwargs.get("weight_decay", None) + + +class ImageModelDistributionSettingsClassification( + ImageModelDistributionSettings +): """Distribution expressions to sweep over values of model settings. -:code:` -Some examples are: - -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar split_ratio: If validation data is not defined, this specifies the split ratio for - splitting - train data into random train and validation subsets. Must be a float in the range [0, 1]. - :vartype split_ratio: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: str - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: str - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: str - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'split_ratio': {'key': 'splitRatio', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'str'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'str'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'str'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + :code:` + Some examples are: + + ModelName = "choice('seresnext', 'resnest50')"; + LearningRate = "uniform(0.001, 0.01)"; + LayersToFreeze = "choice(0, 2)"; + ` + For more details on how to compose distribution expressions please check the documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: str + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: str + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: str + :ivar distributed: Whether to use distributer training. + :vartype distributed: str + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: str + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: str + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: str + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: str + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: str + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: str + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: str + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: str + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. + :vartype learning_rate_scheduler: str + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: str + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: str + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: str + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: str + :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. + :vartype optimizer: str + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: str + :ivar split_ratio: If validation data is not defined, this specifies the split ratio for + splitting + train data into random train and validation subsets. Must be a float in the range [0, 1]. + :vartype split_ratio: str + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: str + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: str + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: str + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: str + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: str + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: str + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: str + :ivar training_crop_size: Image crop size that is input to the neural network for the training + dataset. Must be a positive integer. + :vartype training_crop_size: str + :ivar validation_crop_size: Image crop size that is input to the neural network for the + validation dataset. Must be a positive integer. + :vartype validation_crop_size: str + :ivar validation_resize_size: Image size to which to resize before cropping for validation + dataset. Must be a positive integer. + :vartype validation_resize_size: str + :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. + 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be + 0 or 1 or 2. + :vartype weighted_loss: str + """ + + _attribute_map = { + "ams_gradient": {"key": "amsGradient", "type": "str"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "str"}, + "beta2": {"key": "beta2", "type": "str"}, + "distributed": {"key": "distributed", "type": "str"}, + "early_stopping": {"key": "earlyStopping", "type": "str"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "str"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "str", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "str", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "str"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "str", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "str"}, + "nesterov": {"key": "nesterov", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "str"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "str"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "str"}, + "split_ratio": {"key": "splitRatio", "type": "str"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "str"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "str"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "str", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "str", + }, + "weight_decay": {"key": "weightDecay", "type": "str"}, + "training_crop_size": {"key": "trainingCropSize", "type": "str"}, + "validation_crop_size": {"key": "validationCropSize", "type": "str"}, + "validation_resize_size": { + "key": "validationResizeSize", + "type": "str", + }, + "weighted_loss": {"key": "weightedLoss", "type": "str"}, + } + + def __init__(self, **kwargs): """ :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :paramtype ams_gradient: str @@ -6603,213 +6638,246 @@ def __init__( 0 or 1 or 2. :paramtype weighted_loss: str """ - super(ImageModelDistributionSettingsClassification, self).__init__(**kwargs) - self.training_crop_size = kwargs.get('training_crop_size', None) - self.validation_crop_size = kwargs.get('validation_crop_size', None) - self.validation_resize_size = kwargs.get('validation_resize_size', None) - self.weighted_loss = kwargs.get('weighted_loss', None) + super(ImageModelDistributionSettingsClassification, self).__init__( + **kwargs + ) + self.training_crop_size = kwargs.get("training_crop_size", None) + self.validation_crop_size = kwargs.get("validation_crop_size", None) + self.validation_resize_size = kwargs.get( + "validation_resize_size", None + ) + self.weighted_loss = kwargs.get("weighted_loss", None) -class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettings): +class ImageModelDistributionSettingsObjectDetection( + ImageModelDistributionSettings +): """Distribution expressions to sweep over values of model settings. -:code:` -Some examples are: - -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar split_ratio: If validation data is not defined, this specifies the split ratio for - splitting - train data into random train and validation subsets. Must be a float in the range [0, 1]. - :vartype split_ratio: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: str - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: str - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: str - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: str - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: str - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype model_size: str - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: str - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - float in the range [0, 1]. - :vartype nms_iou_threshold: str - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: str - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - NMS: Non-maximum suppression. - :vartype tile_predictions_nms_threshold: str - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: str - :ivar validation_metric_type: Metric computation method to use for validation metrics. Must be - 'none', 'coco', 'voc', or 'coco_voc'. - :vartype validation_metric_type: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'split_ratio': {'key': 'splitRatio', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'str'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'str'}, - 'image_size': {'key': 'imageSize', 'type': 'str'}, - 'max_size': {'key': 'maxSize', 'type': 'str'}, - 'min_size': {'key': 'minSize', 'type': 'str'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'str'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'str'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'str'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'str'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'str'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + :code:` + Some examples are: + + ModelName = "choice('seresnext', 'resnest50')"; + LearningRate = "uniform(0.001, 0.01)"; + LayersToFreeze = "choice(0, 2)"; + ` + For more details on how to compose distribution expressions please check the documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: str + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: str + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: str + :ivar distributed: Whether to use distributer training. + :vartype distributed: str + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: str + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: str + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: str + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: str + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: str + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: str + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: str + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: str + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. + :vartype learning_rate_scheduler: str + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: str + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: str + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: str + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: str + :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. + :vartype optimizer: str + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: str + :ivar split_ratio: If validation data is not defined, this specifies the split ratio for + splitting + train data into random train and validation subsets. Must be a float in the range [0, 1]. + :vartype split_ratio: str + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: str + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: str + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: str + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: str + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: str + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: str + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: str + :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must + be a positive integer. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype box_detections_per_image: str + :ivar box_score_threshold: During inference, only return proposals with a classification score + greater than + BoxScoreThreshold. Must be a float in the range[0, 1]. + :vartype box_score_threshold: str + :ivar image_size: Image size for train and validation. Must be a positive integer. + Note: The training run may get into CUDA OOM if the size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype image_size: str + :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype max_size: str + :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype min_size: str + :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. + Note: training run may get into CUDA OOM if the model size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype model_size: str + :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. + Note: training run may get into CUDA OOM if no sufficient GPU memory. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype multi_scale: str + :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be + float in the range [0, 1]. + :vartype nms_iou_threshold: str + :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not + be + None to enable small object detection logic. A string containing two integers in mxn format. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_grid_size: str + :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float + in the range [0, 1). + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_overlap_ratio: str + :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging + predictions from tiles and image. + Used in validation/ inference. Must be float in the range [0, 1]. + Note: This settings is not supported for the 'yolov5' algorithm. + NMS: Non-maximum suppression. + :vartype tile_predictions_nms_threshold: str + :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be + float in the range [0, 1]. + :vartype validation_iou_threshold: str + :ivar validation_metric_type: Metric computation method to use for validation metrics. Must be + 'none', 'coco', 'voc', or 'coco_voc'. + :vartype validation_metric_type: str + """ + + _attribute_map = { + "ams_gradient": {"key": "amsGradient", "type": "str"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "str"}, + "beta2": {"key": "beta2", "type": "str"}, + "distributed": {"key": "distributed", "type": "str"}, + "early_stopping": {"key": "earlyStopping", "type": "str"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "str"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "str", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "str", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "str"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "str", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "str"}, + "nesterov": {"key": "nesterov", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "str"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "str"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "str"}, + "split_ratio": {"key": "splitRatio", "type": "str"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "str"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "str"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "str", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "str", + }, + "weight_decay": {"key": "weightDecay", "type": "str"}, + "box_detections_per_image": { + "key": "boxDetectionsPerImage", + "type": "str", + }, + "box_score_threshold": {"key": "boxScoreThreshold", "type": "str"}, + "image_size": {"key": "imageSize", "type": "str"}, + "max_size": {"key": "maxSize", "type": "str"}, + "min_size": {"key": "minSize", "type": "str"}, + "model_size": {"key": "modelSize", "type": "str"}, + "multi_scale": {"key": "multiScale", "type": "str"}, + "nms_iou_threshold": {"key": "nmsIouThreshold", "type": "str"}, + "tile_grid_size": {"key": "tileGridSize", "type": "str"}, + "tile_overlap_ratio": {"key": "tileOverlapRatio", "type": "str"}, + "tile_predictions_nms_threshold": { + "key": "tilePredictionsNmsThreshold", + "type": "str", + }, + "validation_iou_threshold": { + "key": "validationIouThreshold", + "type": "str", + }, + "validation_metric_type": { + "key": "validationMetricType", + "type": "str", + }, + } + + def __init__(self, **kwargs): """ :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :paramtype ams_gradient: str @@ -6948,168 +7016,193 @@ def __init__( be 'none', 'coco', 'voc', or 'coco_voc'. :paramtype validation_metric_type: str """ - super(ImageModelDistributionSettingsObjectDetection, self).__init__(**kwargs) - self.box_detections_per_image = kwargs.get('box_detections_per_image', None) - self.box_score_threshold = kwargs.get('box_score_threshold', None) - self.image_size = kwargs.get('image_size', None) - self.max_size = kwargs.get('max_size', None) - self.min_size = kwargs.get('min_size', None) - self.model_size = kwargs.get('model_size', None) - self.multi_scale = kwargs.get('multi_scale', None) - self.nms_iou_threshold = kwargs.get('nms_iou_threshold', None) - self.tile_grid_size = kwargs.get('tile_grid_size', None) - self.tile_overlap_ratio = kwargs.get('tile_overlap_ratio', None) - self.tile_predictions_nms_threshold = kwargs.get('tile_predictions_nms_threshold', None) - self.validation_iou_threshold = kwargs.get('validation_iou_threshold', None) - self.validation_metric_type = kwargs.get('validation_metric_type', None) + super(ImageModelDistributionSettingsObjectDetection, self).__init__( + **kwargs + ) + self.box_detections_per_image = kwargs.get( + "box_detections_per_image", None + ) + self.box_score_threshold = kwargs.get("box_score_threshold", None) + self.image_size = kwargs.get("image_size", None) + self.max_size = kwargs.get("max_size", None) + self.min_size = kwargs.get("min_size", None) + self.model_size = kwargs.get("model_size", None) + self.multi_scale = kwargs.get("multi_scale", None) + self.nms_iou_threshold = kwargs.get("nms_iou_threshold", None) + self.tile_grid_size = kwargs.get("tile_grid_size", None) + self.tile_overlap_ratio = kwargs.get("tile_overlap_ratio", None) + self.tile_predictions_nms_threshold = kwargs.get( + "tile_predictions_nms_threshold", None + ) + self.validation_iou_threshold = kwargs.get( + "validation_iou_threshold", None + ) + self.validation_metric_type = kwargs.get( + "validation_metric_type", None + ) class ImageModelSettings(msrest.serialization.Model): """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_dataset_id: FileDataset id for pretrained checkpoint(s) for incremental - training. - Make sure to pass CheckpointFilename along with CheckpointDatasetId. - :vartype checkpoint_dataset_id: str - :ivar checkpoint_filename: The pretrained checkpoint filename in FileDataset for incremental - training. - Make sure to pass CheckpointDatasetId along with CheckpointFilename. - :vartype checkpoint_filename: str - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar split_ratio: If validation data is not defined, this specifies the split ratio for - splitting - train data into random train and validation subsets. Must be a float in the range [0, 1]. - :vartype split_ratio: float - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_dataset_id': {'key': 'checkpointDatasetId', 'type': 'str'}, - 'checkpoint_filename': {'key': 'checkpointFilename', 'type': 'str'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'split_ratio': {'key': 'splitRatio', 'type': 'float'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar advanced_settings: Settings for advanced scenarios. + :vartype advanced_settings: str + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: bool + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: float + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: float + :ivar checkpoint_dataset_id: FileDataset id for pretrained checkpoint(s) for incremental + training. + Make sure to pass CheckpointFilename along with CheckpointDatasetId. + :vartype checkpoint_dataset_id: str + :ivar checkpoint_filename: The pretrained checkpoint filename in FileDataset for incremental + training. + Make sure to pass CheckpointDatasetId along with CheckpointFilename. + :vartype checkpoint_filename: str + :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. + :vartype checkpoint_frequency: int + :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for + incremental training. + :vartype checkpoint_run_id: str + :ivar distributed: Whether to use distributed training. + :vartype distributed: bool + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: bool + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: int + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: int + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: bool + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: int + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: int + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: int + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: float + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. Possible values include: "None", "WarmupCosine", "Step". + :vartype learning_rate_scheduler: str or + ~azure.mgmt.machinelearningservices.models.LearningRateScheduler + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: float + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: bool + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: int + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: int + :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". + :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: int + :ivar split_ratio: If validation data is not defined, this specifies the split ratio for + splitting + train data into random train and validation subsets. Must be a float in the range [0, 1]. + :vartype split_ratio: float + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: float + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: int + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: int + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: int + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: float + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: int + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: float + """ + + _attribute_map = { + "advanced_settings": {"key": "advancedSettings", "type": "str"}, + "ams_gradient": {"key": "amsGradient", "type": "bool"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "float"}, + "beta2": {"key": "beta2", "type": "float"}, + "checkpoint_dataset_id": {"key": "checkpointDatasetId", "type": "str"}, + "checkpoint_filename": {"key": "checkpointFilename", "type": "str"}, + "checkpoint_frequency": {"key": "checkpointFrequency", "type": "int"}, + "checkpoint_run_id": {"key": "checkpointRunId", "type": "str"}, + "distributed": {"key": "distributed", "type": "bool"}, + "early_stopping": {"key": "earlyStopping", "type": "bool"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "int"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "int", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "bool", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "int"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "int", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "int"}, + "learning_rate": {"key": "learningRate", "type": "float"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "float"}, + "nesterov": {"key": "nesterov", "type": "bool"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "int"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "int"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "int"}, + "split_ratio": {"key": "splitRatio", "type": "float"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "float"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "int"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "float", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "int", + }, + "weight_decay": {"key": "weightDecay", "type": "float"}, + } + + def __init__(self, **kwargs): """ :keyword advanced_settings: Settings for advanced scenarios. :paramtype advanced_settings: str @@ -7214,205 +7307,235 @@ def __init__( :paramtype weight_decay: float """ super(ImageModelSettings, self).__init__(**kwargs) - self.advanced_settings = kwargs.get('advanced_settings', None) - self.ams_gradient = kwargs.get('ams_gradient', None) - self.augmentations = kwargs.get('augmentations', None) - self.beta1 = kwargs.get('beta1', None) - self.beta2 = kwargs.get('beta2', None) - self.checkpoint_dataset_id = kwargs.get('checkpoint_dataset_id', None) - self.checkpoint_filename = kwargs.get('checkpoint_filename', None) - self.checkpoint_frequency = kwargs.get('checkpoint_frequency', None) - self.checkpoint_run_id = kwargs.get('checkpoint_run_id', None) - self.distributed = kwargs.get('distributed', None) - self.early_stopping = kwargs.get('early_stopping', None) - self.early_stopping_delay = kwargs.get('early_stopping_delay', None) - self.early_stopping_patience = kwargs.get('early_stopping_patience', None) - self.enable_onnx_normalization = kwargs.get('enable_onnx_normalization', None) - self.evaluation_frequency = kwargs.get('evaluation_frequency', None) - self.gradient_accumulation_step = kwargs.get('gradient_accumulation_step', None) - self.layers_to_freeze = kwargs.get('layers_to_freeze', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.learning_rate_scheduler = kwargs.get('learning_rate_scheduler', None) - self.model_name = kwargs.get('model_name', None) - self.momentum = kwargs.get('momentum', None) - self.nesterov = kwargs.get('nesterov', None) - self.number_of_epochs = kwargs.get('number_of_epochs', None) - self.number_of_workers = kwargs.get('number_of_workers', None) - self.optimizer = kwargs.get('optimizer', None) - self.random_seed = kwargs.get('random_seed', None) - self.split_ratio = kwargs.get('split_ratio', None) - self.step_lr_gamma = kwargs.get('step_lr_gamma', None) - self.step_lr_step_size = kwargs.get('step_lr_step_size', None) - self.training_batch_size = kwargs.get('training_batch_size', None) - self.validation_batch_size = kwargs.get('validation_batch_size', None) - self.warmup_cosine_lr_cycles = kwargs.get('warmup_cosine_lr_cycles', None) - self.warmup_cosine_lr_warmup_epochs = kwargs.get('warmup_cosine_lr_warmup_epochs', None) - self.weight_decay = kwargs.get('weight_decay', None) + self.advanced_settings = kwargs.get("advanced_settings", None) + self.ams_gradient = kwargs.get("ams_gradient", None) + self.augmentations = kwargs.get("augmentations", None) + self.beta1 = kwargs.get("beta1", None) + self.beta2 = kwargs.get("beta2", None) + self.checkpoint_dataset_id = kwargs.get("checkpoint_dataset_id", None) + self.checkpoint_filename = kwargs.get("checkpoint_filename", None) + self.checkpoint_frequency = kwargs.get("checkpoint_frequency", None) + self.checkpoint_run_id = kwargs.get("checkpoint_run_id", None) + self.distributed = kwargs.get("distributed", None) + self.early_stopping = kwargs.get("early_stopping", None) + self.early_stopping_delay = kwargs.get("early_stopping_delay", None) + self.early_stopping_patience = kwargs.get( + "early_stopping_patience", None + ) + self.enable_onnx_normalization = kwargs.get( + "enable_onnx_normalization", None + ) + self.evaluation_frequency = kwargs.get("evaluation_frequency", None) + self.gradient_accumulation_step = kwargs.get( + "gradient_accumulation_step", None + ) + self.layers_to_freeze = kwargs.get("layers_to_freeze", None) + self.learning_rate = kwargs.get("learning_rate", None) + self.learning_rate_scheduler = kwargs.get( + "learning_rate_scheduler", None + ) + self.model_name = kwargs.get("model_name", None) + self.momentum = kwargs.get("momentum", None) + self.nesterov = kwargs.get("nesterov", None) + self.number_of_epochs = kwargs.get("number_of_epochs", None) + self.number_of_workers = kwargs.get("number_of_workers", None) + self.optimizer = kwargs.get("optimizer", None) + self.random_seed = kwargs.get("random_seed", None) + self.split_ratio = kwargs.get("split_ratio", None) + self.step_lr_gamma = kwargs.get("step_lr_gamma", None) + self.step_lr_step_size = kwargs.get("step_lr_step_size", None) + self.training_batch_size = kwargs.get("training_batch_size", None) + self.validation_batch_size = kwargs.get("validation_batch_size", None) + self.warmup_cosine_lr_cycles = kwargs.get( + "warmup_cosine_lr_cycles", None + ) + self.warmup_cosine_lr_warmup_epochs = kwargs.get( + "warmup_cosine_lr_warmup_epochs", None + ) + self.weight_decay = kwargs.get("weight_decay", None) class ImageModelSettingsClassification(ImageModelSettings): """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_dataset_id: FileDataset id for pretrained checkpoint(s) for incremental - training. - Make sure to pass CheckpointFilename along with CheckpointDatasetId. - :vartype checkpoint_dataset_id: str - :ivar checkpoint_filename: The pretrained checkpoint filename in FileDataset for incremental - training. - Make sure to pass CheckpointDatasetId along with CheckpointFilename. - :vartype checkpoint_filename: str - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar split_ratio: If validation data is not defined, this specifies the split ratio for - splitting - train data into random train and validation subsets. Must be a float in the range [0, 1]. - :vartype split_ratio: float - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: int - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: int - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: int - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: int - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_dataset_id': {'key': 'checkpointDatasetId', 'type': 'str'}, - 'checkpoint_filename': {'key': 'checkpointFilename', 'type': 'str'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'split_ratio': {'key': 'splitRatio', 'type': 'float'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'int'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'int'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'int'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar advanced_settings: Settings for advanced scenarios. + :vartype advanced_settings: str + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: bool + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: float + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: float + :ivar checkpoint_dataset_id: FileDataset id for pretrained checkpoint(s) for incremental + training. + Make sure to pass CheckpointFilename along with CheckpointDatasetId. + :vartype checkpoint_dataset_id: str + :ivar checkpoint_filename: The pretrained checkpoint filename in FileDataset for incremental + training. + Make sure to pass CheckpointDatasetId along with CheckpointFilename. + :vartype checkpoint_filename: str + :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. + :vartype checkpoint_frequency: int + :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for + incremental training. + :vartype checkpoint_run_id: str + :ivar distributed: Whether to use distributed training. + :vartype distributed: bool + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: bool + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: int + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: int + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: bool + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: int + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: int + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: int + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: float + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. Possible values include: "None", "WarmupCosine", "Step". + :vartype learning_rate_scheduler: str or + ~azure.mgmt.machinelearningservices.models.LearningRateScheduler + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: float + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: bool + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: int + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: int + :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". + :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: int + :ivar split_ratio: If validation data is not defined, this specifies the split ratio for + splitting + train data into random train and validation subsets. Must be a float in the range [0, 1]. + :vartype split_ratio: float + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: float + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: int + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: int + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: int + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: float + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: int + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: float + :ivar training_crop_size: Image crop size that is input to the neural network for the training + dataset. Must be a positive integer. + :vartype training_crop_size: int + :ivar validation_crop_size: Image crop size that is input to the neural network for the + validation dataset. Must be a positive integer. + :vartype validation_crop_size: int + :ivar validation_resize_size: Image size to which to resize before cropping for validation + dataset. Must be a positive integer. + :vartype validation_resize_size: int + :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. + 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be + 0 or 1 or 2. + :vartype weighted_loss: int + """ + + _attribute_map = { + "advanced_settings": {"key": "advancedSettings", "type": "str"}, + "ams_gradient": {"key": "amsGradient", "type": "bool"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "float"}, + "beta2": {"key": "beta2", "type": "float"}, + "checkpoint_dataset_id": {"key": "checkpointDatasetId", "type": "str"}, + "checkpoint_filename": {"key": "checkpointFilename", "type": "str"}, + "checkpoint_frequency": {"key": "checkpointFrequency", "type": "int"}, + "checkpoint_run_id": {"key": "checkpointRunId", "type": "str"}, + "distributed": {"key": "distributed", "type": "bool"}, + "early_stopping": {"key": "earlyStopping", "type": "bool"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "int"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "int", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "bool", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "int"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "int", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "int"}, + "learning_rate": {"key": "learningRate", "type": "float"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "float"}, + "nesterov": {"key": "nesterov", "type": "bool"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "int"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "int"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "int"}, + "split_ratio": {"key": "splitRatio", "type": "float"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "float"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "int"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "float", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "int", + }, + "weight_decay": {"key": "weightDecay", "type": "float"}, + "training_crop_size": {"key": "trainingCropSize", "type": "int"}, + "validation_crop_size": {"key": "validationCropSize", "type": "int"}, + "validation_resize_size": { + "key": "validationResizeSize", + "type": "int", + }, + "weighted_loss": {"key": "weightedLoss", "type": "int"}, + } + + def __init__(self, **kwargs): """ :keyword advanced_settings: Settings for advanced scenarios. :paramtype advanced_settings: str @@ -7530,224 +7653,253 @@ def __init__( :paramtype weighted_loss: int """ super(ImageModelSettingsClassification, self).__init__(**kwargs) - self.training_crop_size = kwargs.get('training_crop_size', None) - self.validation_crop_size = kwargs.get('validation_crop_size', None) - self.validation_resize_size = kwargs.get('validation_resize_size', None) - self.weighted_loss = kwargs.get('weighted_loss', None) + self.training_crop_size = kwargs.get("training_crop_size", None) + self.validation_crop_size = kwargs.get("validation_crop_size", None) + self.validation_resize_size = kwargs.get( + "validation_resize_size", None + ) + self.weighted_loss = kwargs.get("weighted_loss", None) class ImageModelSettingsObjectDetection(ImageModelSettings): """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_dataset_id: FileDataset id for pretrained checkpoint(s) for incremental - training. - Make sure to pass CheckpointFilename along with CheckpointDatasetId. - :vartype checkpoint_dataset_id: str - :ivar checkpoint_filename: The pretrained checkpoint filename in FileDataset for incremental - training. - Make sure to pass CheckpointDatasetId along with CheckpointFilename. - :vartype checkpoint_filename: str - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar split_ratio: If validation data is not defined, this specifies the split ratio for - splitting - train data into random train and validation subsets. Must be a float in the range [0, 1]. - :vartype split_ratio: float - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: int - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: float - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: int - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: int - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: int - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: - "None", "Small", "Medium", "Large", "ExtraLarge". - :vartype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: bool - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be a - float in the range [0, 1]. - :vartype nms_iou_threshold: float - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: float - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_predictions_nms_threshold: float - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: float - :ivar validation_metric_type: Metric computation method to use for validation metrics. Possible - values include: "None", "Coco", "Voc", "CocoVoc". - :vartype validation_metric_type: str or - ~azure.mgmt.machinelearningservices.models.ValidationMetricType - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_dataset_id': {'key': 'checkpointDatasetId', 'type': 'str'}, - 'checkpoint_filename': {'key': 'checkpointFilename', 'type': 'str'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'split_ratio': {'key': 'splitRatio', 'type': 'float'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'int'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'float'}, - 'image_size': {'key': 'imageSize', 'type': 'int'}, - 'max_size': {'key': 'maxSize', 'type': 'int'}, - 'min_size': {'key': 'minSize', 'type': 'int'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'bool'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'float'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'float'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'float'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'float'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar advanced_settings: Settings for advanced scenarios. + :vartype advanced_settings: str + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: bool + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: float + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: float + :ivar checkpoint_dataset_id: FileDataset id for pretrained checkpoint(s) for incremental + training. + Make sure to pass CheckpointFilename along with CheckpointDatasetId. + :vartype checkpoint_dataset_id: str + :ivar checkpoint_filename: The pretrained checkpoint filename in FileDataset for incremental + training. + Make sure to pass CheckpointDatasetId along with CheckpointFilename. + :vartype checkpoint_filename: str + :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. + :vartype checkpoint_frequency: int + :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for + incremental training. + :vartype checkpoint_run_id: str + :ivar distributed: Whether to use distributed training. + :vartype distributed: bool + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: bool + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: int + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: int + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: bool + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: int + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: int + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: int + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: float + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. Possible values include: "None", "WarmupCosine", "Step". + :vartype learning_rate_scheduler: str or + ~azure.mgmt.machinelearningservices.models.LearningRateScheduler + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: float + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: bool + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: int + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: int + :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". + :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: int + :ivar split_ratio: If validation data is not defined, this specifies the split ratio for + splitting + train data into random train and validation subsets. Must be a float in the range [0, 1]. + :vartype split_ratio: float + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: float + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: int + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: int + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: int + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: float + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: int + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: float + :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must + be a positive integer. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype box_detections_per_image: int + :ivar box_score_threshold: During inference, only return proposals with a classification score + greater than + BoxScoreThreshold. Must be a float in the range[0, 1]. + :vartype box_score_threshold: float + :ivar image_size: Image size for train and validation. Must be a positive integer. + Note: The training run may get into CUDA OOM if the size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype image_size: int + :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype max_size: int + :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype min_size: int + :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. + Note: training run may get into CUDA OOM if the model size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: + "None", "Small", "Medium", "Large", "ExtraLarge". + :vartype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize + :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. + Note: training run may get into CUDA OOM if no sufficient GPU memory. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype multi_scale: bool + :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be a + float in the range [0, 1]. + :vartype nms_iou_threshold: float + :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not + be + None to enable small object detection logic. A string containing two integers in mxn format. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_grid_size: str + :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float + in the range [0, 1). + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_overlap_ratio: float + :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging + predictions from tiles and image. + Used in validation/ inference. Must be float in the range [0, 1]. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_predictions_nms_threshold: float + :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be + float in the range [0, 1]. + :vartype validation_iou_threshold: float + :ivar validation_metric_type: Metric computation method to use for validation metrics. Possible + values include: "None", "Coco", "Voc", "CocoVoc". + :vartype validation_metric_type: str or + ~azure.mgmt.machinelearningservices.models.ValidationMetricType + """ + + _attribute_map = { + "advanced_settings": {"key": "advancedSettings", "type": "str"}, + "ams_gradient": {"key": "amsGradient", "type": "bool"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "float"}, + "beta2": {"key": "beta2", "type": "float"}, + "checkpoint_dataset_id": {"key": "checkpointDatasetId", "type": "str"}, + "checkpoint_filename": {"key": "checkpointFilename", "type": "str"}, + "checkpoint_frequency": {"key": "checkpointFrequency", "type": "int"}, + "checkpoint_run_id": {"key": "checkpointRunId", "type": "str"}, + "distributed": {"key": "distributed", "type": "bool"}, + "early_stopping": {"key": "earlyStopping", "type": "bool"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "int"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "int", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "bool", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "int"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "int", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "int"}, + "learning_rate": {"key": "learningRate", "type": "float"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "float"}, + "nesterov": {"key": "nesterov", "type": "bool"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "int"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "int"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "int"}, + "split_ratio": {"key": "splitRatio", "type": "float"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "float"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "int"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "float", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "int", + }, + "weight_decay": {"key": "weightDecay", "type": "float"}, + "box_detections_per_image": { + "key": "boxDetectionsPerImage", + "type": "int", + }, + "box_score_threshold": {"key": "boxScoreThreshold", "type": "float"}, + "image_size": {"key": "imageSize", "type": "int"}, + "max_size": {"key": "maxSize", "type": "int"}, + "min_size": {"key": "minSize", "type": "int"}, + "model_size": {"key": "modelSize", "type": "str"}, + "multi_scale": {"key": "multiScale", "type": "bool"}, + "nms_iou_threshold": {"key": "nmsIouThreshold", "type": "float"}, + "tile_grid_size": {"key": "tileGridSize", "type": "str"}, + "tile_overlap_ratio": {"key": "tileOverlapRatio", "type": "float"}, + "tile_predictions_nms_threshold": { + "key": "tilePredictionsNmsThreshold", + "type": "float", + }, + "validation_iou_threshold": { + "key": "validationIouThreshold", + "type": "float", + }, + "validation_metric_type": { + "key": "validationMetricType", + "type": "str", + }, + } + + def __init__(self, **kwargs): """ :keyword advanced_settings: Settings for advanced scenarios. :paramtype advanced_settings: str @@ -7905,76 +8057,96 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ValidationMetricType """ super(ImageModelSettingsObjectDetection, self).__init__(**kwargs) - self.box_detections_per_image = kwargs.get('box_detections_per_image', None) - self.box_score_threshold = kwargs.get('box_score_threshold', None) - self.image_size = kwargs.get('image_size', None) - self.max_size = kwargs.get('max_size', None) - self.min_size = kwargs.get('min_size', None) - self.model_size = kwargs.get('model_size', None) - self.multi_scale = kwargs.get('multi_scale', None) - self.nms_iou_threshold = kwargs.get('nms_iou_threshold', None) - self.tile_grid_size = kwargs.get('tile_grid_size', None) - self.tile_overlap_ratio = kwargs.get('tile_overlap_ratio', None) - self.tile_predictions_nms_threshold = kwargs.get('tile_predictions_nms_threshold', None) - self.validation_iou_threshold = kwargs.get('validation_iou_threshold', None) - self.validation_metric_type = kwargs.get('validation_metric_type', None) + self.box_detections_per_image = kwargs.get( + "box_detections_per_image", None + ) + self.box_score_threshold = kwargs.get("box_score_threshold", None) + self.image_size = kwargs.get("image_size", None) + self.max_size = kwargs.get("max_size", None) + self.min_size = kwargs.get("min_size", None) + self.model_size = kwargs.get("model_size", None) + self.multi_scale = kwargs.get("multi_scale", None) + self.nms_iou_threshold = kwargs.get("nms_iou_threshold", None) + self.tile_grid_size = kwargs.get("tile_grid_size", None) + self.tile_overlap_ratio = kwargs.get("tile_overlap_ratio", None) + self.tile_predictions_nms_threshold = kwargs.get( + "tile_predictions_nms_threshold", None + ) + self.validation_iou_threshold = kwargs.get( + "validation_iou_threshold", None + ) + self.validation_metric_type = kwargs.get( + "validation_metric_type", None + ) class ImageObjectDetection(AutoMLVertical, ImageObjectDetectionBase): """Image Object Detection. Object detection is used to identify objects in an image and locate each object with a -bounding box e.g. locate all dogs and cats in an image and draw a bounding box around each. + bounding box e.g. locate all dogs and cats in an image and draw a bounding box around each. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and - other data settings required for training and validating models. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics + :ivar data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and + other data settings required for training and validating models. + :vartype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "MeanAveragePrecision". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics """ _validation = { - 'data_settings': {'required': True}, - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, + "data_settings": {"required": True}, + "limit_settings": {"required": True}, + "task_type": {"required": True}, } _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'ImageVerticalDataSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "data_settings": { + "key": "dataSettings", + "type": "ImageVerticalDataSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsObjectDetection", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsObjectDetection]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and other data settings required for training and validating models. @@ -7999,16 +8171,16 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics """ super(ImageObjectDetection, self).__init__(**kwargs) - self.data_settings = kwargs['data_settings'] - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageObjectDetection' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.task_type = 'ImageObjectDetection' # type: str - self.primary_metric = kwargs.get('primary_metric', None) + self.data_settings = kwargs["data_settings"] + self.limit_settings = kwargs["limit_settings"] + self.sweep_settings = kwargs.get("sweep_settings", None) + self.model_settings = kwargs.get("model_settings", None) + self.search_space = kwargs.get("search_space", None) + self.task_type = "ImageObjectDetection" # type: str + self.primary_metric = kwargs.get("primary_metric", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.task_type = "ImageObjectDetection" # type: str + self.primary_metric = kwargs.get("primary_metric", None) class ImageSweepLimitSettings(msrest.serialization.Model): @@ -8022,14 +8194,11 @@ class ImageSweepLimitSettings(msrest.serialization.Model): """ _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_trials": {"key": "maxTrials", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword max_concurrent_trials: Maximum number of concurrent iterations for the underlying Sweep job. @@ -8038,8 +8207,8 @@ def __init__( :paramtype max_trials: int """ super(ImageSweepLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', None) - self.max_trials = kwargs.get('max_trials', None) + self.max_concurrent_trials = kwargs.get("max_concurrent_trials", None) + self.max_trials = kwargs.get("max_trials", None) class ImageSweepSettings(msrest.serialization.Model): @@ -8059,20 +8228,20 @@ class ImageSweepSettings(msrest.serialization.Model): """ _validation = { - 'limits': {'required': True}, - 'sampling_algorithm': {'required': True}, + "limits": {"required": True}, + "sampling_algorithm": {"required": True}, } _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'limits': {'key': 'limits', 'type': 'ImageSweepLimitSettings'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, + "limits": {"key": "limits", "type": "ImageSweepLimitSettings"}, + "sampling_algorithm": {"key": "samplingAlgorithm", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword early_termination: Type of early termination policy. :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy @@ -8085,9 +8254,9 @@ def __init__( ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType """ super(ImageSweepSettings, self).__init__(**kwargs) - self.early_termination = kwargs.get('early_termination', None) - self.limits = kwargs['limits'] - self.sampling_algorithm = kwargs['sampling_algorithm'] + self.early_termination = kwargs.get("early_termination", None) + self.limits = kwargs["limits"] + self.sampling_algorithm = kwargs["sampling_algorithm"] class ImageVerticalDataSettings(DataSettings): @@ -8109,21 +8278,24 @@ class ImageVerticalDataSettings(DataSettings): """ _validation = { - 'target_column_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'training_data': {'required': True}, + "target_column_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "training_data": {"required": True}, } _attribute_map = { - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'test_data': {'key': 'testData', 'type': 'TestDataSettings'}, - 'training_data': {'key': 'trainingData', 'type': 'TrainingDataSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'ImageVerticalValidationDataSettings'}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "test_data": {"key": "testData", "type": "TestDataSettings"}, + "training_data": { + "key": "trainingData", + "type": "TrainingDataSettings", + }, + "validation_data": { + "key": "validationData", + "type": "ImageVerticalValidationDataSettings", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword target_column_name: Required. [Required] Target column name: This is prediction values column. @@ -8138,7 +8310,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ImageVerticalValidationDataSettings """ super(ImageVerticalDataSettings, self).__init__(**kwargs) - self.validation_data = kwargs.get('validation_data', None) + self.validation_data = kwargs.get("validation_data", None) class ValidationDataSettings(msrest.serialization.Model): @@ -8154,14 +8326,11 @@ class ValidationDataSettings(msrest.serialization.Model): """ _attribute_map = { - 'data': {'key': 'data', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, + "data": {"key": "data", "type": "MLTableJobInput"}, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data: Validation data MLTable. :paramtype data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput @@ -8172,8 +8341,8 @@ def __init__( :paramtype validation_data_size: float """ super(ValidationDataSettings, self).__init__(**kwargs) - self.data = kwargs.get('data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) + self.data = kwargs.get("data", None) + self.validation_data_size = kwargs.get("validation_data_size", None) class ImageVerticalValidationDataSettings(ValidationDataSettings): @@ -8189,14 +8358,11 @@ class ImageVerticalValidationDataSettings(ValidationDataSettings): """ _attribute_map = { - 'data': {'key': 'data', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, + "data": {"key": "data", "type": "MLTableJobInput"}, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data: Validation data MLTable. :paramtype data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput @@ -8222,15 +8388,12 @@ class InferenceContainerProperties(msrest.serialization.Model): """ _attribute_map = { - 'liveness_route': {'key': 'livenessRoute', 'type': 'Route'}, - 'readiness_route': {'key': 'readinessRoute', 'type': 'Route'}, - 'scoring_route': {'key': 'scoringRoute', 'type': 'Route'}, + "liveness_route": {"key": "livenessRoute", "type": "Route"}, + "readiness_route": {"key": "readinessRoute", "type": "Route"}, + "scoring_route": {"key": "scoringRoute", "type": "Route"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword liveness_route: The route to check the liveness of the inference server container. :paramtype liveness_route: ~azure.mgmt.machinelearningservices.models.Route @@ -8241,9 +8404,9 @@ def __init__( :paramtype scoring_route: ~azure.mgmt.machinelearningservices.models.Route """ super(InferenceContainerProperties, self).__init__(**kwargs) - self.liveness_route = kwargs.get('liveness_route', None) - self.readiness_route = kwargs.get('readiness_route', None) - self.scoring_route = kwargs.get('scoring_route', None) + self.liveness_route = kwargs.get("liveness_route", None) + self.readiness_route = kwargs.get("readiness_route", None) + self.scoring_route = kwargs.get("scoring_route", None) class JobBaseData(Resource): @@ -8269,31 +8432,28 @@ class JobBaseData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'JobBaseDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "JobBaseDetails"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.JobBaseDetails """ super(JobBaseData, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class JobBaseResourceArmPaginatedResult(msrest.serialization.Model): @@ -8307,14 +8467,11 @@ class JobBaseResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[JobBaseData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[JobBaseData]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of JobBase objects. If null, there are no additional pages. @@ -8323,8 +8480,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.JobBaseData] """ super(JobBaseResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class JobService(msrest.serialization.Model): @@ -8347,23 +8504,20 @@ class JobService(msrest.serialization.Model): """ _validation = { - 'error_message': {'readonly': True}, - 'status': {'readonly': True}, + "error_message": {"readonly": True}, + "status": {"readonly": True}, } _attribute_map = { - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'job_service_type': {'key': 'jobServiceType', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'status': {'key': 'status', 'type': 'str'}, + "endpoint": {"key": "endpoint", "type": "str"}, + "error_message": {"key": "errorMessage", "type": "str"}, + "job_service_type": {"key": "jobServiceType", "type": "str"}, + "port": {"key": "port", "type": "int"}, + "properties": {"key": "properties", "type": "{str}"}, + "status": {"key": "status", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword endpoint: Url for endpoint. :paramtype endpoint: str @@ -8375,11 +8529,11 @@ def __init__( :paramtype properties: dict[str, str] """ super(JobService, self).__init__(**kwargs) - self.endpoint = kwargs.get('endpoint', None) + self.endpoint = kwargs.get("endpoint", None) self.error_message = None - self.job_service_type = kwargs.get('job_service_type', None) - self.port = kwargs.get('port', None) - self.properties = kwargs.get('properties', None) + self.job_service_type = kwargs.get("job_service_type", None) + self.port = kwargs.get("port", None) + self.properties = kwargs.get("properties", None) self.status = None @@ -8398,21 +8552,18 @@ class KerberosCredentials(msrest.serialization.Model): """ _validation = { - 'kerberos_kdc_address': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "kerberos_kdc_address": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "kerberos_principal": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "kerberos_realm": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, + "kerberos_kdc_address": {"key": "kerberosKdcAddress", "type": "str"}, + "kerberos_principal": {"key": "kerberosPrincipal", "type": "str"}, + "kerberos_realm": {"key": "kerberosRealm", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. :paramtype kerberos_kdc_address: str @@ -8423,9 +8574,9 @@ def __init__( :paramtype kerberos_realm: str """ super(KerberosCredentials, self).__init__(**kwargs) - self.kerberos_kdc_address = kwargs['kerberos_kdc_address'] - self.kerberos_principal = kwargs['kerberos_principal'] - self.kerberos_realm = kwargs['kerberos_realm'] + self.kerberos_kdc_address = kwargs["kerberos_kdc_address"] + self.kerberos_principal = kwargs["kerberos_principal"] + self.kerberos_realm = kwargs["kerberos_realm"] class KerberosKeytabCredentials(DatastoreCredentials, KerberosCredentials): @@ -8449,25 +8600,22 @@ class KerberosKeytabCredentials(DatastoreCredentials, KerberosCredentials): """ _validation = { - 'kerberos_kdc_address': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, + "kerberos_kdc_address": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "kerberos_principal": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "kerberos_realm": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "credentials_type": {"required": True}, + "secrets": {"required": True}, } _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'KerberosKeytabSecrets'}, + "kerberos_kdc_address": {"key": "kerberosKdcAddress", "type": "str"}, + "kerberos_principal": {"key": "kerberosPrincipal", "type": "str"}, + "kerberos_realm": {"key": "kerberosRealm", "type": "str"}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "secrets": {"key": "secrets", "type": "KerberosKeytabSecrets"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. :paramtype kerberos_kdc_address: str @@ -8480,13 +8628,13 @@ def __init__( :paramtype secrets: ~azure.mgmt.machinelearningservices.models.KerberosKeytabSecrets """ super(KerberosKeytabCredentials, self).__init__(**kwargs) - self.kerberos_kdc_address = kwargs['kerberos_kdc_address'] - self.kerberos_principal = kwargs['kerberos_principal'] - self.kerberos_realm = kwargs['kerberos_realm'] - self.credentials_type = 'KerberosKeytab' # type: str - self.secrets = kwargs['secrets'] - self.credentials_type = 'KerberosKeytab' # type: str - self.secrets = kwargs['secrets'] + self.kerberos_kdc_address = kwargs["kerberos_kdc_address"] + self.kerberos_principal = kwargs["kerberos_principal"] + self.kerberos_realm = kwargs["kerberos_realm"] + self.credentials_type = "KerberosKeytab" # type: str + self.secrets = kwargs["secrets"] + self.credentials_type = "KerberosKeytab" # type: str + self.secrets = kwargs["secrets"] class KerberosKeytabSecrets(DatastoreSecrets): @@ -8503,25 +8651,22 @@ class KerberosKeytabSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'kerberos_keytab': {'key': 'kerberosKeytab', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "kerberos_keytab": {"key": "kerberosKeytab", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword kerberos_keytab: Kerberos keytab secret. :paramtype kerberos_keytab: str """ super(KerberosKeytabSecrets, self).__init__(**kwargs) - self.secrets_type = 'KerberosKeytab' # type: str - self.kerberos_keytab = kwargs.get('kerberos_keytab', None) + self.secrets_type = "KerberosKeytab" # type: str + self.kerberos_keytab = kwargs.get("kerberos_keytab", None) class KerberosPasswordCredentials(DatastoreCredentials, KerberosCredentials): @@ -8545,25 +8690,22 @@ class KerberosPasswordCredentials(DatastoreCredentials, KerberosCredentials): """ _validation = { - 'kerberos_kdc_address': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, + "kerberos_kdc_address": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "kerberos_principal": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "kerberos_realm": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "credentials_type": {"required": True}, + "secrets": {"required": True}, } _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'KerberosPasswordSecrets'}, + "kerberos_kdc_address": {"key": "kerberosKdcAddress", "type": "str"}, + "kerberos_principal": {"key": "kerberosPrincipal", "type": "str"}, + "kerberos_realm": {"key": "kerberosRealm", "type": "str"}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "secrets": {"key": "secrets", "type": "KerberosPasswordSecrets"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. :paramtype kerberos_kdc_address: str @@ -8576,13 +8718,13 @@ def __init__( :paramtype secrets: ~azure.mgmt.machinelearningservices.models.KerberosPasswordSecrets """ super(KerberosPasswordCredentials, self).__init__(**kwargs) - self.kerberos_kdc_address = kwargs['kerberos_kdc_address'] - self.kerberos_principal = kwargs['kerberos_principal'] - self.kerberos_realm = kwargs['kerberos_realm'] - self.credentials_type = 'KerberosPassword' # type: str - self.secrets = kwargs['secrets'] - self.credentials_type = 'KerberosPassword' # type: str - self.secrets = kwargs['secrets'] + self.kerberos_kdc_address = kwargs["kerberos_kdc_address"] + self.kerberos_principal = kwargs["kerberos_principal"] + self.kerberos_realm = kwargs["kerberos_realm"] + self.credentials_type = "KerberosPassword" # type: str + self.secrets = kwargs["secrets"] + self.credentials_type = "KerberosPassword" # type: str + self.secrets = kwargs["secrets"] class KerberosPasswordSecrets(DatastoreSecrets): @@ -8599,25 +8741,22 @@ class KerberosPasswordSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'kerberos_password': {'key': 'kerberosPassword', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "kerberos_password": {"key": "kerberosPassword", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword kerberos_password: Kerberos password secret. :paramtype kerberos_password: str """ super(KerberosPasswordSecrets, self).__init__(**kwargs) - self.secrets_type = 'KerberosPassword' # type: str - self.kerberos_password = kwargs.get('kerberos_password', None) + self.secrets_type = "KerberosPassword" # type: str + self.kerberos_password = kwargs.get("kerberos_password", None) class OnlineDeploymentDetails(EndpointDeploymentPropertiesBase): @@ -8680,38 +8819,56 @@ class OnlineDeploymentDetails(EndpointDeploymentPropertiesBase): """ _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'private_network_connection': {'key': 'privateNetworkConnection', 'type': 'bool'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, + "endpoint_compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, + "egress_public_network_access": { + "key": "egressPublicNetworkAccess", + "type": "str", + }, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, + "model": {"key": "model", "type": "str"}, + "model_mount_path": {"key": "modelMountPath", "type": "str"}, + "private_network_connection": { + "key": "privateNetworkConnection", + "type": "bool", + }, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, } _subtype_map = { - 'endpoint_compute_type': {'Kubernetes': 'KubernetesOnlineDeployment', 'Managed': 'ManagedOnlineDeployment'} + "endpoint_compute_type": { + "Kubernetes": "KubernetesOnlineDeployment", + "Managed": "ManagedOnlineDeployment", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword code_configuration: Code configuration for the endpoint deployment. :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration @@ -8754,18 +8911,22 @@ def __init__( :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings """ super(OnlineDeploymentDetails, self).__init__(**kwargs) - self.app_insights_enabled = kwargs.get('app_insights_enabled', False) - self.egress_public_network_access = kwargs.get('egress_public_network_access', None) - self.endpoint_compute_type = 'OnlineDeploymentDetails' # type: str - self.instance_type = kwargs.get('instance_type', None) - self.liveness_probe = kwargs.get('liveness_probe', None) - self.model = kwargs.get('model', None) - self.model_mount_path = kwargs.get('model_mount_path', None) - self.private_network_connection = kwargs.get('private_network_connection', False) + self.app_insights_enabled = kwargs.get("app_insights_enabled", False) + self.egress_public_network_access = kwargs.get( + "egress_public_network_access", None + ) + self.endpoint_compute_type = "OnlineDeploymentDetails" # type: str + self.instance_type = kwargs.get("instance_type", None) + self.liveness_probe = kwargs.get("liveness_probe", None) + self.model = kwargs.get("model", None) + self.model_mount_path = kwargs.get("model_mount_path", None) + self.private_network_connection = kwargs.get( + "private_network_connection", False + ) self.provisioning_state = None - self.readiness_probe = kwargs.get('readiness_probe', None) - self.request_settings = kwargs.get('request_settings', None) - self.scale_settings = kwargs.get('scale_settings', None) + self.readiness_probe = kwargs.get("readiness_probe", None) + self.request_settings = kwargs.get("request_settings", None) + self.scale_settings = kwargs.get("scale_settings", None) class KubernetesOnlineDeployment(OnlineDeploymentDetails): @@ -8829,35 +8990,53 @@ class KubernetesOnlineDeployment(OnlineDeploymentDetails): """ _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'private_network_connection': {'key': 'privateNetworkConnection', 'type': 'bool'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - 'container_resource_requirements': {'key': 'containerResourceRequirements', 'type': 'ContainerResourceRequirements'}, - } - - def __init__( - self, - **kwargs - ): + "endpoint_compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, + "egress_public_network_access": { + "key": "egressPublicNetworkAccess", + "type": "str", + }, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, + "model": {"key": "model", "type": "str"}, + "model_mount_path": {"key": "modelMountPath", "type": "str"}, + "private_network_connection": { + "key": "privateNetworkConnection", + "type": "bool", + }, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, + "container_resource_requirements": { + "key": "containerResourceRequirements", + "type": "ContainerResourceRequirements", + }, + } + + def __init__(self, **kwargs): """ :keyword code_configuration: Code configuration for the endpoint deployment. :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration @@ -8904,8 +9083,10 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ContainerResourceRequirements """ super(KubernetesOnlineDeployment, self).__init__(**kwargs) - self.endpoint_compute_type = 'Kubernetes' # type: str - self.container_resource_requirements = kwargs.get('container_resource_requirements', None) + self.endpoint_compute_type = "Kubernetes" # type: str + self.container_resource_requirements = kwargs.get( + "container_resource_requirements", None + ) class LiteralJobInput(JobInput): @@ -8924,20 +9105,17 @@ class LiteralJobInput(JobInput): """ _validation = { - 'job_input_type': {'required': True}, - 'value': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "job_input_type": {"required": True}, + "value": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, + "value": {"key": "value", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: Description for the input. :paramtype description: str @@ -8945,8 +9123,8 @@ def __init__( :paramtype value: str """ super(LiteralJobInput, self).__init__(**kwargs) - self.job_input_type = 'Literal' # type: str - self.value = kwargs['value'] + self.job_input_type = "Literal" # type: str + self.value = kwargs["value"] class ManagedIdentity(IdentityConfiguration): @@ -8970,20 +9148,17 @@ class ManagedIdentity(IdentityConfiguration): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + "object_id": {"key": "objectId", "type": "str"}, + "resource_id": {"key": "resourceId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword client_id: Specifies a user-assigned identity by client ID. For system-assigned, do not set this field. @@ -8996,10 +9171,10 @@ def __init__( :paramtype resource_id: str """ super(ManagedIdentity, self).__init__(**kwargs) - self.identity_type = 'Managed' # type: str - self.client_id = kwargs.get('client_id', None) - self.object_id = kwargs.get('object_id', None) - self.resource_id = kwargs.get('resource_id', None) + self.identity_type = "Managed" # type: str + self.client_id = kwargs.get("client_id", None) + self.object_id = kwargs.get("object_id", None) + self.resource_id = kwargs.get("resource_id", None) class ManagedOnlineDeployment(OnlineDeploymentDetails): @@ -9059,34 +9234,49 @@ class ManagedOnlineDeployment(OnlineDeploymentDetails): """ _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'private_network_connection': {'key': 'privateNetworkConnection', 'type': 'bool'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - } - - def __init__( - self, - **kwargs - ): + "endpoint_compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, + "egress_public_network_access": { + "key": "egressPublicNetworkAccess", + "type": "str", + }, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, + "model": {"key": "model", "type": "str"}, + "model_mount_path": {"key": "modelMountPath", "type": "str"}, + "private_network_connection": { + "key": "privateNetworkConnection", + "type": "bool", + }, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, + } + + def __init__(self, **kwargs): """ :keyword code_configuration: Code configuration for the endpoint deployment. :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration @@ -9129,7 +9319,7 @@ def __init__( :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings """ super(ManagedOnlineDeployment, self).__init__(**kwargs) - self.endpoint_compute_type = 'Managed' # type: str + self.endpoint_compute_type = "Managed" # type: str class ManagedServiceIdentity(msrest.serialization.Model): @@ -9158,22 +9348,22 @@ class ManagedServiceIdentity(msrest.serialization.Model): """ _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, + "principal_id": {"readonly": True}, + "tenant_id": {"readonly": True}, + "type": {"required": True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{UserAssignedIdentity}", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword type: Required. Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", @@ -9189,8 +9379,10 @@ def __init__( super(ManagedServiceIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None - self.type = kwargs['type'] - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + self.type = kwargs["type"] + self.user_assigned_identities = kwargs.get( + "user_assigned_identities", None + ) class MedianStoppingPolicy(EarlyTerminationPolicy): @@ -9209,19 +9401,16 @@ class MedianStoppingPolicy(EarlyTerminationPolicy): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. :paramtype delay_evaluation: int @@ -9229,7 +9418,7 @@ def __init__( :paramtype evaluation_interval: int """ super(MedianStoppingPolicy, self).__init__(**kwargs) - self.policy_type = 'MedianStopping' # type: str + self.policy_type = "MedianStopping" # type: str class MLFlowModelJobInput(JobInput, AssetJobInput): @@ -9251,21 +9440,18 @@ class MLFlowModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -9276,11 +9462,11 @@ def __init__( :paramtype description: str """ super(MLFlowModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'MLFlowModel' # type: str - self.description = kwargs.get('description', None) - self.job_input_type = 'MLFlowModel' # type: str + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "MLFlowModel" # type: str + self.description = kwargs.get("description", None) + self.job_input_type = "MLFlowModel" # type: str class MLFlowModelJobOutput(JobOutput, AssetJobOutput): @@ -9301,20 +9487,17 @@ class MLFlowModelJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -9324,11 +9507,11 @@ def __init__( :paramtype description: str """ super(MLFlowModelJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'MLFlowModel' # type: str - self.description = kwargs.get('description', None) - self.job_output_type = 'MLFlowModel' # type: str + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "MLFlowModel" # type: str + self.description = kwargs.get("description", None) + self.job_output_type = "MLFlowModel" # type: str class MLTableData(DataVersionBaseDetails): @@ -9357,25 +9540,22 @@ class MLTableData(DataVersionBaseDetails): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'referenced_uris': {'key': 'referencedUris', 'type': '[str]'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, + "referenced_uris": {"key": "referencedUris", "type": "[str]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -9394,8 +9574,8 @@ def __init__( :paramtype referenced_uris: list[str] """ super(MLTableData, self).__init__(**kwargs) - self.data_type = 'MLTable' # type: str - self.referenced_uris = kwargs.get('referenced_uris', None) + self.data_type = "MLTable" # type: str + self.referenced_uris = kwargs.get("referenced_uris", None) class MLTableJobInput(JobInput, AssetJobInput): @@ -9417,21 +9597,18 @@ class MLTableJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -9442,11 +9619,11 @@ def __init__( :paramtype description: str """ super(MLTableJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'MLTable' # type: str - self.description = kwargs.get('description', None) - self.job_input_type = 'MLTable' # type: str + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "MLTable" # type: str + self.description = kwargs.get("description", None) + self.job_input_type = "MLTable" # type: str class MLTableJobOutput(JobOutput, AssetJobOutput): @@ -9467,20 +9644,17 @@ class MLTableJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -9490,11 +9664,11 @@ def __init__( :paramtype description: str """ super(MLTableJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'MLTable' # type: str - self.description = kwargs.get('description', None) - self.job_output_type = 'MLTable' # type: str + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "MLTable" # type: str + self.description = kwargs.get("description", None) + self.job_output_type = "MLTable" # type: str class ModelContainerData(Resource): @@ -9520,31 +9694,28 @@ class ModelContainerData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelContainerDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "ModelContainerDetails"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelContainerDetails """ super(ModelContainerData, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class ModelContainerDetails(AssetContainer): @@ -9567,23 +9738,20 @@ class ModelContainerDetails(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -9608,14 +9776,11 @@ class ModelContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelContainerData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ModelContainerData]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of ModelContainer objects. If null, there are no additional pages. @@ -9623,9 +9788,11 @@ def __init__( :keyword value: An array of objects of type ModelContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelContainerData] """ - super(ModelContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(ModelContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class ModelVersionData(Resource): @@ -9651,31 +9818,28 @@ class ModelVersionData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelVersionDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "ModelVersionDetails"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelVersionDetails """ super(ModelVersionData, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class ModelVersionDetails(AssetBase): @@ -9703,21 +9867,18 @@ class ModelVersionDetails(AssetBase): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'flavors': {'key': 'flavors', 'type': '{FlavorData}'}, - 'job_name': {'key': 'jobName', 'type': 'str'}, - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'model_uri': {'key': 'modelUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "flavors": {"key": "flavors", "type": "{FlavorData}"}, + "job_name": {"key": "jobName", "type": "str"}, + "model_type": {"key": "modelType", "type": "str"}, + "model_uri": {"key": "modelUri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -9740,10 +9901,10 @@ def __init__( :paramtype model_uri: str """ super(ModelVersionDetails, self).__init__(**kwargs) - self.flavors = kwargs.get('flavors', None) - self.job_name = kwargs.get('job_name', None) - self.model_type = kwargs.get('model_type', None) - self.model_uri = kwargs.get('model_uri', None) + self.flavors = kwargs.get("flavors", None) + self.job_name = kwargs.get("job_name", None) + self.model_type = kwargs.get("model_type", None) + self.model_uri = kwargs.get("model_uri", None) class ModelVersionResourceArmPaginatedResult(msrest.serialization.Model): @@ -9757,14 +9918,11 @@ class ModelVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelVersionData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ModelVersionData]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of ModelVersion objects. If null, there are no additional pages. @@ -9773,8 +9931,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelVersionData] """ super(ModelVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class Mpi(DistributionConfiguration): @@ -9790,50 +9948,58 @@ class Mpi(DistributionConfiguration): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, + "distribution_type": {"key": "distributionType", "type": "str"}, + "process_count_per_instance": { + "key": "processCountPerInstance", + "type": "int", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword process_count_per_instance: Number of processes per MPI node. :paramtype process_count_per_instance: int """ super(Mpi, self).__init__(**kwargs) - self.distribution_type = 'Mpi' # type: str - self.process_count_per_instance = kwargs.get('process_count_per_instance', None) + self.distribution_type = "Mpi" # type: str + self.process_count_per_instance = kwargs.get( + "process_count_per_instance", None + ) class NlpVertical(msrest.serialization.Model): """Abstract class for NLP related AutoML tasks. -NLP - Natural Language Processing. + NLP - Natural Language Processing. - :ivar data_settings: Data inputs for AutoMLJob. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalDataSettings - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar data_settings: Data inputs for AutoMLJob. + :vartype data_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalDataSettings + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings """ _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'NlpVerticalDataSettings'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, + "data_settings": { + "key": "dataSettings", + "type": "NlpVerticalDataSettings", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data_settings: Data inputs for AutoMLJob. :paramtype data_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalDataSettings @@ -9844,46 +10010,51 @@ def __init__( :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings """ super(NlpVertical, self).__init__(**kwargs) - self.data_settings = kwargs.get('data_settings', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) + self.data_settings = kwargs.get("data_settings", None) + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.limit_settings = kwargs.get("limit_settings", None) class NlpVerticalDataSettings(DataSettings): """Class for data inputs. -NLP - Natural Language Processing. + NLP - Natural Language Processing. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar target_column_name: Required. [Required] Target column name: This is prediction values - column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.TestDataSettings - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.TrainingDataSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: - ~azure.mgmt.machinelearningservices.models.NlpVerticalValidationDataSettings + :ivar target_column_name: Required. [Required] Target column name: This is prediction values + column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar test_data: Test data input. + :vartype test_data: ~azure.mgmt.machinelearningservices.models.TestDataSettings + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.TrainingDataSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: + ~azure.mgmt.machinelearningservices.models.NlpVerticalValidationDataSettings """ _validation = { - 'target_column_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'training_data': {'required': True}, + "target_column_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "training_data": {"required": True}, } _attribute_map = { - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'test_data': {'key': 'testData', 'type': 'TestDataSettings'}, - 'training_data': {'key': 'trainingData', 'type': 'TrainingDataSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'NlpVerticalValidationDataSettings'}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "test_data": {"key": "testData", "type": "TestDataSettings"}, + "training_data": { + "key": "trainingData", + "type": "TrainingDataSettings", + }, + "validation_data": { + "key": "validationData", + "type": "NlpVerticalValidationDataSettings", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword target_column_name: Required. [Required] Target column name: This is prediction values column. @@ -9898,7 +10069,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.NlpVerticalValidationDataSettings """ super(NlpVerticalDataSettings, self).__init__(**kwargs) - self.validation_data = kwargs.get('validation_data', None) + self.validation_data = kwargs.get("validation_data", None) class NlpVerticalFeaturizationSettings(FeaturizationSettings): @@ -9909,13 +10080,10 @@ class NlpVerticalFeaturizationSettings(FeaturizationSettings): """ _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, + "dataset_language": {"key": "datasetLanguage", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword dataset_language: Dataset language, useful for the text data. :paramtype dataset_language: str @@ -9935,15 +10103,12 @@ class NlpVerticalLimitSettings(msrest.serialization.Model): """ _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_trials": {"key": "maxTrials", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword max_concurrent_trials: Maximum Concurrent AutoML iterations. :paramtype max_concurrent_trials: int @@ -9953,9 +10118,9 @@ def __init__( :paramtype timeout: ~datetime.timedelta """ super(NlpVerticalLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', 1) - self.max_trials = kwargs.get('max_trials', 1) - self.timeout = kwargs.get('timeout', None) + self.max_concurrent_trials = kwargs.get("max_concurrent_trials", 1) + self.max_trials = kwargs.get("max_trials", 1) + self.timeout = kwargs.get("timeout", None) class NlpVerticalValidationDataSettings(ValidationDataSettings): @@ -9971,14 +10136,11 @@ class NlpVerticalValidationDataSettings(ValidationDataSettings): """ _attribute_map = { - 'data': {'key': 'data', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, + "data": {"key": "data", "type": "MLTableJobInput"}, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data: Validation data MLTable. :paramtype data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput @@ -10003,21 +10165,17 @@ class NoneDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, + "credentials_type": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NoneDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'None' # type: str + self.credentials_type = "None" # type: str class Objective(msrest.serialization.Model): @@ -10033,19 +10191,16 @@ class Objective(msrest.serialization.Model): """ _validation = { - 'goal': {'required': True}, - 'primary_metric': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "goal": {"required": True}, + "primary_metric": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'goal': {'key': 'goal', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "goal": {"key": "goal", "type": "str"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword goal: Required. [Required] Defines supported metric goals for hyperparameter tuning. Possible values include: "Minimize", "Maximize". @@ -10054,8 +10209,8 @@ def __init__( :paramtype primary_metric: str """ super(Objective, self).__init__(**kwargs) - self.goal = kwargs['goal'] - self.primary_metric = kwargs['primary_metric'] + self.goal = kwargs["goal"] + self.primary_metric = kwargs["primary_metric"] class OnlineDeploymentData(TrackedResource): @@ -10092,31 +10247,28 @@ class OnlineDeploymentData(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineDeploymentDetails'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": {"key": "properties", "type": "OnlineDeploymentDetails"}, + "sku": {"key": "sku", "type": "Sku"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -10133,13 +10285,15 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ super(OnlineDeploymentData, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) + self.identity = kwargs.get("identity", None) + self.kind = kwargs.get("kind", None) + self.properties = kwargs["properties"] + self.sku = kwargs.get("sku", None) -class OnlineDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class OnlineDeploymentTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of OnlineDeployment entities. :ivar next_link: The link to the next page of OnlineDeployment objects. If null, there are no @@ -10150,14 +10304,11 @@ class OnlineDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Mod """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineDeploymentData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[OnlineDeploymentData]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of OnlineDeployment objects. If null, there are no additional pages. @@ -10165,9 +10316,11 @@ def __init__( :keyword value: An array of objects of type OnlineDeployment. :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineDeploymentData] """ - super(OnlineDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super( + OnlineDeploymentTrackedResourceArmPaginatedResult, self + ).__init__(**kwargs) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class OnlineEndpointData(TrackedResource): @@ -10204,31 +10357,28 @@ class OnlineEndpointData(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineEndpointDetails'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": {"key": "properties", "type": "OnlineEndpointDetails"}, + "sku": {"key": "sku", "type": "Sku"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -10245,10 +10395,10 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ super(OnlineEndpointData, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) + self.identity = kwargs.get("identity", None) + self.kind = kwargs.get("kind", None) + self.properties = kwargs["properties"] + self.sku = kwargs.get("sku", None) class OnlineEndpointDetails(EndpointPropertiesBase): @@ -10294,30 +10444,27 @@ class OnlineEndpointDetails(EndpointPropertiesBase): """ _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "auth_mode": {"required": True}, + "scoring_uri": {"readonly": True}, + "swagger_uri": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'mirror_traffic': {'key': 'mirrorTraffic', 'type': '{int}'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, - 'traffic': {'key': 'traffic', 'type': '{int}'}, + "auth_mode": {"key": "authMode", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "keys": {"key": "keys", "type": "EndpointAuthKeys"}, + "properties": {"key": "properties", "type": "{str}"}, + "scoring_uri": {"key": "scoringUri", "type": "str"}, + "swagger_uri": {"key": "swaggerUri", "type": "str"}, + "compute": {"key": "compute", "type": "str"}, + "mirror_traffic": {"key": "mirrorTraffic", "type": "{int}"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "public_network_access": {"key": "publicNetworkAccess", "type": "str"}, + "traffic": {"key": "traffic", "type": "{int}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' @@ -10346,14 +10493,16 @@ def __init__( :paramtype traffic: dict[str, int] """ super(OnlineEndpointDetails, self).__init__(**kwargs) - self.compute = kwargs.get('compute', None) - self.mirror_traffic = kwargs.get('mirror_traffic', None) + self.compute = kwargs.get("compute", None) + self.mirror_traffic = kwargs.get("mirror_traffic", None) self.provisioning_state = None - self.public_network_access = kwargs.get('public_network_access', None) - self.traffic = kwargs.get('traffic', None) + self.public_network_access = kwargs.get("public_network_access", None) + self.traffic = kwargs.get("traffic", None) -class OnlineEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class OnlineEndpointTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of OnlineEndpoint entities. :ivar next_link: The link to the next page of OnlineEndpoint objects. If null, there are no @@ -10364,14 +10513,11 @@ class OnlineEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineEndpointData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[OnlineEndpointData]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of OnlineEndpoint objects. If null, there are no additional pages. @@ -10379,9 +10525,11 @@ def __init__( :keyword value: An array of objects of type OnlineEndpoint. :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineEndpointData] """ - super(OnlineEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(OnlineEndpointTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class OnlineRequestSettings(msrest.serialization.Model): @@ -10400,15 +10548,15 @@ class OnlineRequestSettings(msrest.serialization.Model): """ _attribute_map = { - 'max_concurrent_requests_per_instance': {'key': 'maxConcurrentRequestsPerInstance', 'type': 'int'}, - 'max_queue_wait': {'key': 'maxQueueWait', 'type': 'duration'}, - 'request_timeout': {'key': 'requestTimeout', 'type': 'duration'}, + "max_concurrent_requests_per_instance": { + "key": "maxConcurrentRequestsPerInstance", + "type": "int", + }, + "max_queue_wait": {"key": "maxQueueWait", "type": "duration"}, + "request_timeout": {"key": "requestTimeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword max_concurrent_requests_per_instance: The number of maximum concurrent requests per node allowed per deployment. Defaults to 1. @@ -10422,9 +10570,11 @@ def __init__( :paramtype request_timeout: ~datetime.timedelta """ super(OnlineRequestSettings, self).__init__(**kwargs) - self.max_concurrent_requests_per_instance = kwargs.get('max_concurrent_requests_per_instance', 1) - self.max_queue_wait = kwargs.get('max_queue_wait', "PT0.5S") - self.request_timeout = kwargs.get('request_timeout', "PT5S") + self.max_concurrent_requests_per_instance = kwargs.get( + "max_concurrent_requests_per_instance", 1 + ) + self.max_queue_wait = kwargs.get("max_queue_wait", "PT0.5S") + self.request_timeout = kwargs.get("request_timeout", "PT5S") class OutputPathAssetReference(AssetReferenceBase): @@ -10442,19 +10592,16 @@ class OutputPathAssetReference(AssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "job_id": {"key": "jobId", "type": "str"}, + "path": {"key": "path", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword job_id: ARM resource ID of the job. :paramtype job_id: str @@ -10462,9 +10609,9 @@ def __init__( :paramtype path: str """ super(OutputPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'OutputPath' # type: str - self.job_id = kwargs.get('job_id', None) - self.path = kwargs.get('path', None) + self.reference_type = "OutputPath" # type: str + self.job_id = kwargs.get("job_id", None) + self.path = kwargs.get("path", None) class PartialAssetReferenceBase(msrest.serialization.Model): @@ -10481,23 +10628,23 @@ class PartialAssetReferenceBase(msrest.serialization.Model): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, } _subtype_map = { - 'reference_type': {'DataPath': 'PartialDataPathAssetReference', 'Id': 'PartialIdAssetReference', 'OutputPath': 'PartialOutputPathAssetReference'} + "reference_type": { + "DataPath": "PartialDataPathAssetReference", + "Id": "PartialIdAssetReference", + "OutputPath": "PartialOutputPathAssetReference", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(PartialAssetReferenceBase, self).__init__(**kwargs) self.reference_type = None # type: Optional[str] @@ -10547,26 +10694,35 @@ class PartialBatchDeployment(msrest.serialization.Model): """ _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'PartialCodeConfiguration'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'error_threshold': {'key': 'errorThreshold', 'type': 'int'}, - 'logging_level': {'key': 'loggingLevel', 'type': 'str'}, - 'max_concurrency_per_instance': {'key': 'maxConcurrencyPerInstance', 'type': 'int'}, - 'mini_batch_size': {'key': 'miniBatchSize', 'type': 'long'}, - 'model': {'key': 'model', 'type': 'PartialAssetReferenceBase'}, - 'output_action': {'key': 'outputAction', 'type': 'str'}, - 'output_file_name': {'key': 'outputFileName', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'retry_settings': {'key': 'retrySettings', 'type': 'PartialBatchRetrySettings'}, - } - - def __init__( - self, - **kwargs - ): + "code_configuration": { + "key": "codeConfiguration", + "type": "PartialCodeConfiguration", + }, + "compute": {"key": "compute", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "error_threshold": {"key": "errorThreshold", "type": "int"}, + "logging_level": {"key": "loggingLevel", "type": "str"}, + "max_concurrency_per_instance": { + "key": "maxConcurrencyPerInstance", + "type": "int", + }, + "mini_batch_size": {"key": "miniBatchSize", "type": "long"}, + "model": {"key": "model", "type": "PartialAssetReferenceBase"}, + "output_action": {"key": "outputAction", "type": "str"}, + "output_file_name": {"key": "outputFileName", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "retry_settings": { + "key": "retrySettings", + "type": "PartialBatchRetrySettings", + }, + } + + def __init__(self, **kwargs): """ :keyword code_configuration: Code configuration for the endpoint deployment. :paramtype code_configuration: @@ -10609,20 +10765,22 @@ def __init__( :paramtype retry_settings: ~azure.mgmt.machinelearningservices.models.PartialBatchRetrySettings """ super(PartialBatchDeployment, self).__init__(**kwargs) - self.code_configuration = kwargs.get('code_configuration', None) - self.compute = kwargs.get('compute', None) - self.description = kwargs.get('description', None) - self.environment_id = kwargs.get('environment_id', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.error_threshold = kwargs.get('error_threshold', None) - self.logging_level = kwargs.get('logging_level', None) - self.max_concurrency_per_instance = kwargs.get('max_concurrency_per_instance', None) - self.mini_batch_size = kwargs.get('mini_batch_size', None) - self.model = kwargs.get('model', None) - self.output_action = kwargs.get('output_action', None) - self.output_file_name = kwargs.get('output_file_name', None) - self.properties = kwargs.get('properties', None) - self.retry_settings = kwargs.get('retry_settings', None) + self.code_configuration = kwargs.get("code_configuration", None) + self.compute = kwargs.get("compute", None) + self.description = kwargs.get("description", None) + self.environment_id = kwargs.get("environment_id", None) + self.environment_variables = kwargs.get("environment_variables", None) + self.error_threshold = kwargs.get("error_threshold", None) + self.logging_level = kwargs.get("logging_level", None) + self.max_concurrency_per_instance = kwargs.get( + "max_concurrency_per_instance", None + ) + self.mini_batch_size = kwargs.get("mini_batch_size", None) + self.model = kwargs.get("model", None) + self.output_action = kwargs.get("output_action", None) + self.output_file_name = kwargs.get("output_file_name", None) + self.properties = kwargs.get("properties", None) + self.retry_settings = kwargs.get("retry_settings", None) class PartialBatchDeploymentPartialTrackedResource(msrest.serialization.Model): @@ -10644,18 +10802,18 @@ class PartialBatchDeploymentPartialTrackedResource(msrest.serialization.Model): """ _attribute_map = { - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'PartialBatchDeployment'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "identity": { + "key": "identity", + "type": "PartialManagedServiceIdentity", + }, + "kind": {"key": "kind", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "properties": {"key": "properties", "type": "PartialBatchDeployment"}, + "sku": {"key": "sku", "type": "PartialSku"}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword identity: Managed service identity (system assigned and/or user assigned identities). :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity @@ -10671,13 +10829,15 @@ def __init__( :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] """ - super(PartialBatchDeploymentPartialTrackedResource, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.location = kwargs.get('location', None) - self.properties = kwargs.get('properties', None) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) + super(PartialBatchDeploymentPartialTrackedResource, self).__init__( + **kwargs + ) + self.identity = kwargs.get("identity", None) + self.kind = kwargs.get("kind", None) + self.location = kwargs.get("location", None) + self.properties = kwargs.get("properties", None) + self.sku = kwargs.get("sku", None) + self.tags = kwargs.get("tags", None) class PartialBatchEndpoint(msrest.serialization.Model): @@ -10688,19 +10848,16 @@ class PartialBatchEndpoint(msrest.serialization.Model): """ _attribute_map = { - 'defaults': {'key': 'defaults', 'type': 'BatchEndpointDefaults'}, + "defaults": {"key": "defaults", "type": "BatchEndpointDefaults"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword defaults: Default values for Batch Endpoint. :paramtype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults """ super(PartialBatchEndpoint, self).__init__(**kwargs) - self.defaults = kwargs.get('defaults', None) + self.defaults = kwargs.get("defaults", None) class PartialBatchEndpointPartialTrackedResource(msrest.serialization.Model): @@ -10722,18 +10879,18 @@ class PartialBatchEndpointPartialTrackedResource(msrest.serialization.Model): """ _attribute_map = { - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'PartialBatchEndpoint'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "identity": { + "key": "identity", + "type": "PartialManagedServiceIdentity", + }, + "kind": {"key": "kind", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "properties": {"key": "properties", "type": "PartialBatchEndpoint"}, + "sku": {"key": "sku", "type": "PartialSku"}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword identity: Managed service identity (system assigned and/or user assigned identities). :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity @@ -10749,13 +10906,15 @@ def __init__( :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] """ - super(PartialBatchEndpointPartialTrackedResource, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.location = kwargs.get('location', None) - self.properties = kwargs.get('properties', None) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) + super(PartialBatchEndpointPartialTrackedResource, self).__init__( + **kwargs + ) + self.identity = kwargs.get("identity", None) + self.kind = kwargs.get("kind", None) + self.location = kwargs.get("location", None) + self.properties = kwargs.get("properties", None) + self.sku = kwargs.get("sku", None) + self.tags = kwargs.get("tags", None) class PartialBatchRetrySettings(msrest.serialization.Model): @@ -10768,14 +10927,11 @@ class PartialBatchRetrySettings(msrest.serialization.Model): """ _attribute_map = { - 'max_retries': {'key': 'maxRetries', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "max_retries": {"key": "maxRetries", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword max_retries: Maximum retry count for a mini-batch. :paramtype max_retries: int @@ -10783,8 +10939,8 @@ def __init__( :paramtype timeout: ~datetime.timedelta """ super(PartialBatchRetrySettings, self).__init__(**kwargs) - self.max_retries = kwargs.get('max_retries', None) - self.timeout = kwargs.get('timeout', None) + self.max_retries = kwargs.get("max_retries", None) + self.timeout = kwargs.get("timeout", None) class PartialCodeConfiguration(msrest.serialization.Model): @@ -10797,18 +10953,15 @@ class PartialCodeConfiguration(msrest.serialization.Model): """ _validation = { - 'scoring_script': {'min_length': 1}, + "scoring_script": {"min_length": 1}, } _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'scoring_script': {'key': 'scoringScript', 'type': 'str'}, + "code_id": {"key": "codeId", "type": "str"}, + "scoring_script": {"key": "scoringScript", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword code_id: ARM resource ID of the code asset. :paramtype code_id: str @@ -10816,8 +10969,8 @@ def __init__( :paramtype scoring_script: str """ super(PartialCodeConfiguration, self).__init__(**kwargs) - self.code_id = kwargs.get('code_id', None) - self.scoring_script = kwargs.get('scoring_script', None) + self.code_id = kwargs.get("code_id", None) + self.scoring_script = kwargs.get("scoring_script", None) class PartialDataPathAssetReference(PartialAssetReferenceBase): @@ -10835,19 +10988,16 @@ class PartialDataPathAssetReference(PartialAssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'datastore_id': {'key': 'datastoreId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "datastore_id": {"key": "datastoreId", "type": "str"}, + "path": {"key": "path", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword datastore_id: ARM resource ID of the datastore where the asset is located. :paramtype datastore_id: str @@ -10855,9 +11005,9 @@ def __init__( :paramtype path: str """ super(PartialDataPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'DataPath' # type: str - self.datastore_id = kwargs.get('datastore_id', None) - self.path = kwargs.get('path', None) + self.reference_type = "DataPath" # type: str + self.datastore_id = kwargs.get("datastore_id", None) + self.path = kwargs.get("path", None) class PartialIdAssetReference(PartialAssetReferenceBase): @@ -10873,25 +11023,22 @@ class PartialIdAssetReference(PartialAssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'asset_id': {'key': 'assetId', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "asset_id": {"key": "assetId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword asset_id: ARM resource ID of the asset. :paramtype asset_id: str """ super(PartialIdAssetReference, self).__init__(**kwargs) - self.reference_type = 'Id' # type: str - self.asset_id = kwargs.get('asset_id', None) + self.reference_type = "Id" # type: str + self.asset_id = kwargs.get("asset_id", None) class PartialOnlineDeployment(msrest.serialization.Model): @@ -10909,23 +11056,22 @@ class PartialOnlineDeployment(msrest.serialization.Model): """ _validation = { - 'endpoint_compute_type': {'required': True}, + "endpoint_compute_type": {"required": True}, } _attribute_map = { - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, } _subtype_map = { - 'endpoint_compute_type': {'Kubernetes': 'PartialKubernetesOnlineDeployment', 'Managed': 'PartialManagedOnlineDeployment'} + "endpoint_compute_type": { + "Kubernetes": "PartialKubernetesOnlineDeployment", + "Managed": "PartialManagedOnlineDeployment", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(PartialOnlineDeployment, self).__init__(**kwargs) self.endpoint_compute_type = None # type: Optional[str] @@ -10942,21 +11088,17 @@ class PartialKubernetesOnlineDeployment(PartialOnlineDeployment): """ _validation = { - 'endpoint_compute_type': {'required': True}, + "endpoint_compute_type": {"required": True}, } _attribute_map = { - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(PartialKubernetesOnlineDeployment, self).__init__(**kwargs) - self.endpoint_compute_type = 'Kubernetes' # type: str + self.endpoint_compute_type = "Kubernetes" # type: str class PartialManagedOnlineDeployment(PartialOnlineDeployment): @@ -10971,21 +11113,17 @@ class PartialManagedOnlineDeployment(PartialOnlineDeployment): """ _validation = { - 'endpoint_compute_type': {'required': True}, + "endpoint_compute_type": {"required": True}, } _attribute_map = { - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(PartialManagedOnlineDeployment, self).__init__(**kwargs) - self.endpoint_compute_type = 'Managed' # type: str + self.endpoint_compute_type = "Managed" # type: str class PartialManagedServiceIdentity(msrest.serialization.Model): @@ -11003,14 +11141,14 @@ class PartialManagedServiceIdentity(msrest.serialization.Model): """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{object}'}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{object}", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword type: Managed service identity (system assigned and/or user assigned identities). Possible values include: "None", "SystemAssigned", "UserAssigned", @@ -11023,11 +11161,15 @@ def __init__( :paramtype user_assigned_identities: dict[str, any] """ super(PartialManagedServiceIdentity, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + self.type = kwargs.get("type", None) + self.user_assigned_identities = kwargs.get( + "user_assigned_identities", None + ) -class PartialOnlineDeploymentPartialTrackedResource(msrest.serialization.Model): +class PartialOnlineDeploymentPartialTrackedResource( + msrest.serialization.Model +): """Strictly used in update requests. :ivar identity: Managed service identity (system assigned and/or user assigned identities). @@ -11046,18 +11188,18 @@ class PartialOnlineDeploymentPartialTrackedResource(msrest.serialization.Model): """ _attribute_map = { - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'PartialOnlineDeployment'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "identity": { + "key": "identity", + "type": "PartialManagedServiceIdentity", + }, + "kind": {"key": "kind", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "properties": {"key": "properties", "type": "PartialOnlineDeployment"}, + "sku": {"key": "sku", "type": "PartialSku"}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword identity: Managed service identity (system assigned and/or user assigned identities). :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity @@ -11073,13 +11215,15 @@ def __init__( :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] """ - super(PartialOnlineDeploymentPartialTrackedResource, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.location = kwargs.get('location', None) - self.properties = kwargs.get('properties', None) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) + super(PartialOnlineDeploymentPartialTrackedResource, self).__init__( + **kwargs + ) + self.identity = kwargs.get("identity", None) + self.kind = kwargs.get("kind", None) + self.location = kwargs.get("location", None) + self.properties = kwargs.get("properties", None) + self.sku = kwargs.get("sku", None) + self.tags = kwargs.get("tags", None) class PartialOnlineEndpoint(msrest.serialization.Model): @@ -11098,15 +11242,12 @@ class PartialOnlineEndpoint(msrest.serialization.Model): """ _attribute_map = { - 'mirror_traffic': {'key': 'mirrorTraffic', 'type': '{int}'}, - 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, - 'traffic': {'key': 'traffic', 'type': '{int}'}, + "mirror_traffic": {"key": "mirrorTraffic", "type": "{int}"}, + "public_network_access": {"key": "publicNetworkAccess", "type": "str"}, + "traffic": {"key": "traffic", "type": "{int}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mirror_traffic: Percentage of traffic to be mirrored to each deployment without using returned scoring. Traffic values need to sum to utmost 50. @@ -11120,9 +11261,9 @@ def __init__( :paramtype traffic: dict[str, int] """ super(PartialOnlineEndpoint, self).__init__(**kwargs) - self.mirror_traffic = kwargs.get('mirror_traffic', None) - self.public_network_access = kwargs.get('public_network_access', None) - self.traffic = kwargs.get('traffic', None) + self.mirror_traffic = kwargs.get("mirror_traffic", None) + self.public_network_access = kwargs.get("public_network_access", None) + self.traffic = kwargs.get("traffic", None) class PartialOnlineEndpointPartialTrackedResource(msrest.serialization.Model): @@ -11144,18 +11285,18 @@ class PartialOnlineEndpointPartialTrackedResource(msrest.serialization.Model): """ _attribute_map = { - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'PartialOnlineEndpoint'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "identity": { + "key": "identity", + "type": "PartialManagedServiceIdentity", + }, + "kind": {"key": "kind", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "properties": {"key": "properties", "type": "PartialOnlineEndpoint"}, + "sku": {"key": "sku", "type": "PartialSku"}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword identity: Managed service identity (system assigned and/or user assigned identities). :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity @@ -11171,13 +11312,15 @@ def __init__( :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] """ - super(PartialOnlineEndpointPartialTrackedResource, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.location = kwargs.get('location', None) - self.properties = kwargs.get('properties', None) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) + super(PartialOnlineEndpointPartialTrackedResource, self).__init__( + **kwargs + ) + self.identity = kwargs.get("identity", None) + self.kind = kwargs.get("kind", None) + self.location = kwargs.get("location", None) + self.properties = kwargs.get("properties", None) + self.sku = kwargs.get("sku", None) + self.tags = kwargs.get("tags", None) class PartialOutputPathAssetReference(PartialAssetReferenceBase): @@ -11195,19 +11338,16 @@ class PartialOutputPathAssetReference(PartialAssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "job_id": {"key": "jobId", "type": "str"}, + "path": {"key": "path", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword job_id: ARM resource ID of the job. :paramtype job_id: str @@ -11215,9 +11355,9 @@ def __init__( :paramtype path: str """ super(PartialOutputPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'OutputPath' # type: str - self.job_id = kwargs.get('job_id', None) - self.path = kwargs.get('path', None) + self.reference_type = "OutputPath" # type: str + self.job_id = kwargs.get("job_id", None) + self.path = kwargs.get("path", None) class PartialSku(msrest.serialization.Model): @@ -11241,17 +11381,14 @@ class PartialSku(msrest.serialization.Model): """ _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'int'}, - 'family': {'key': 'family', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, + "capacity": {"key": "capacity", "type": "int"}, + "family": {"key": "family", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "size": {"key": "size", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword capacity: If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted. @@ -11270,11 +11407,11 @@ def __init__( :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier """ super(PartialSku, self).__init__(**kwargs) - self.capacity = kwargs.get('capacity', None) - self.family = kwargs.get('family', None) - self.name = kwargs.get('name', None) - self.size = kwargs.get('size', None) - self.tier = kwargs.get('tier', None) + self.capacity = kwargs.get("capacity", None) + self.family = kwargs.get("family", None) + self.name = kwargs.get("name", None) + self.size = kwargs.get("size", None) + self.tier = kwargs.get("tier", None) class PipelineJob(JobBaseDetails): @@ -11327,33 +11464,30 @@ class PipelineJob(JobBaseDetails): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, + "job_type": {"required": True}, + "status": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'ScheduleBase'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'jobs': {'key': 'jobs', 'type': '{object}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'settings': {'key': 'settings', 'type': 'object'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "schedule": {"key": "schedule", "type": "ScheduleBase"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "jobs": {"key": "jobs", "type": "{object}"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "settings": {"key": "settings", "type": "object"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -11390,11 +11524,11 @@ def __init__( :paramtype settings: any """ super(PipelineJob, self).__init__(**kwargs) - self.job_type = 'Pipeline' # type: str - self.inputs = kwargs.get('inputs', None) - self.jobs = kwargs.get('jobs', None) - self.outputs = kwargs.get('outputs', None) - self.settings = kwargs.get('settings', None) + self.job_type = "Pipeline" # type: str + self.inputs = kwargs.get("inputs", None) + self.jobs = kwargs.get("jobs", None) + self.outputs = kwargs.get("outputs", None) + self.settings = kwargs.get("settings", None) class ProbeSettings(msrest.serialization.Model): @@ -11413,17 +11547,14 @@ class ProbeSettings(msrest.serialization.Model): """ _attribute_map = { - 'failure_threshold': {'key': 'failureThreshold', 'type': 'int'}, - 'initial_delay': {'key': 'initialDelay', 'type': 'duration'}, - 'period': {'key': 'period', 'type': 'duration'}, - 'success_threshold': {'key': 'successThreshold', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "failure_threshold": {"key": "failureThreshold", "type": "int"}, + "initial_delay": {"key": "initialDelay", "type": "duration"}, + "period": {"key": "period", "type": "duration"}, + "success_threshold": {"key": "successThreshold", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword failure_threshold: The number of failures to allow before returning an unhealthy status. @@ -11438,11 +11569,11 @@ def __init__( :paramtype timeout: ~datetime.timedelta """ super(ProbeSettings, self).__init__(**kwargs) - self.failure_threshold = kwargs.get('failure_threshold', 30) - self.initial_delay = kwargs.get('initial_delay', None) - self.period = kwargs.get('period', "PT10S") - self.success_threshold = kwargs.get('success_threshold', 1) - self.timeout = kwargs.get('timeout', "PT2S") + self.failure_threshold = kwargs.get("failure_threshold", 30) + self.initial_delay = kwargs.get("initial_delay", None) + self.period = kwargs.get("period", "PT10S") + self.success_threshold = kwargs.get("success_threshold", 1) + self.timeout = kwargs.get("timeout", "PT2S") class PyTorch(DistributionConfiguration): @@ -11458,25 +11589,27 @@ class PyTorch(DistributionConfiguration): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, + "distribution_type": {"key": "distributionType", "type": "str"}, + "process_count_per_instance": { + "key": "processCountPerInstance", + "type": "int", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword process_count_per_instance: Number of processes per node. :paramtype process_count_per_instance: int """ super(PyTorch, self).__init__(**kwargs) - self.distribution_type = 'PyTorch' # type: str - self.process_count_per_instance = kwargs.get('process_count_per_instance', None) + self.distribution_type = "PyTorch" # type: str + self.process_count_per_instance = kwargs.get( + "process_count_per_instance", None + ) class RandomSamplingAlgorithm(SamplingAlgorithm): @@ -11496,19 +11629,19 @@ class RandomSamplingAlgorithm(SamplingAlgorithm): """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - 'rule': {'key': 'rule', 'type': 'str'}, - 'seed': {'key': 'seed', 'type': 'int'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, + "rule": {"key": "rule", "type": "str"}, + "seed": {"key": "seed", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword rule: The specific type of random algorithm. Possible values include: "Random", "Sobol". @@ -11517,9 +11650,9 @@ def __init__( :paramtype seed: int """ super(RandomSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Random' # type: str - self.rule = kwargs.get('rule', None) - self.seed = kwargs.get('seed', None) + self.sampling_algorithm_type = "Random" # type: str + self.rule = kwargs.get("rule", None) + self.seed = kwargs.get("seed", None) class RecurrencePattern(msrest.serialization.Model): @@ -11536,20 +11669,17 @@ class RecurrencePattern(msrest.serialization.Model): """ _validation = { - 'hours': {'required': True}, - 'minutes': {'required': True}, + "hours": {"required": True}, + "minutes": {"required": True}, } _attribute_map = { - 'hours': {'key': 'hours', 'type': '[int]'}, - 'minutes': {'key': 'minutes', 'type': '[int]'}, - 'weekdays': {'key': 'weekdays', 'type': '[str]'}, + "hours": {"key": "hours", "type": "[int]"}, + "minutes": {"key": "minutes", "type": "[int]"}, + "weekdays": {"key": "weekdays", "type": "[str]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword hours: Required. [Required] List of hours for recurrence schedule pattern. :paramtype hours: list[int] @@ -11559,9 +11689,9 @@ def __init__( :paramtype weekdays: list[str or ~azure.mgmt.machinelearningservices.models.Weekday] """ super(RecurrencePattern, self).__init__(**kwargs) - self.hours = kwargs['hours'] - self.minutes = kwargs['minutes'] - self.weekdays = kwargs.get('weekdays', None) + self.hours = kwargs["hours"] + self.minutes = kwargs["minutes"] + self.weekdays = kwargs.get("weekdays", None) class RecurrenceSchedule(ScheduleBase): @@ -11593,26 +11723,23 @@ class RecurrenceSchedule(ScheduleBase): """ _validation = { - 'schedule_type': {'required': True}, - 'frequency': {'required': True}, - 'interval': {'required': True}, + "schedule_type": {"required": True}, + "frequency": {"required": True}, + "interval": {"required": True}, } _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'schedule_status': {'key': 'scheduleStatus', 'type': 'str'}, - 'schedule_type': {'key': 'scheduleType', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'pattern': {'key': 'pattern', 'type': 'RecurrencePattern'}, + "end_time": {"key": "endTime", "type": "iso-8601"}, + "schedule_status": {"key": "scheduleStatus", "type": "str"}, + "schedule_type": {"key": "scheduleType", "type": "str"}, + "start_time": {"key": "startTime", "type": "iso-8601"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "frequency": {"key": "frequency", "type": "str"}, + "interval": {"key": "interval", "type": "int"}, + "pattern": {"key": "pattern", "type": "RecurrencePattern"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword end_time: Specifies end time of schedule in ISO 8601 format. If not present, the schedule will run indefinitely. @@ -11635,10 +11762,10 @@ def __init__( :paramtype pattern: ~azure.mgmt.machinelearningservices.models.RecurrencePattern """ super(RecurrenceSchedule, self).__init__(**kwargs) - self.schedule_type = 'Recurrence' # type: str - self.frequency = kwargs['frequency'] - self.interval = kwargs['interval'] - self.pattern = kwargs.get('pattern', None) + self.schedule_type = "Recurrence" # type: str + self.frequency = kwargs["frequency"] + self.interval = kwargs["interval"] + self.pattern = kwargs.get("pattern", None) class RegenerateEndpointKeysRequest(msrest.serialization.Model): @@ -11654,18 +11781,15 @@ class RegenerateEndpointKeysRequest(msrest.serialization.Model): """ _validation = { - 'key_type': {'required': True}, + "key_type": {"required": True}, } _attribute_map = { - 'key_type': {'key': 'keyType', 'type': 'str'}, - 'key_value': {'key': 'keyValue', 'type': 'str'}, + "key_type": {"key": "keyType", "type": "str"}, + "key_value": {"key": "keyValue", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword key_type: Required. [Required] Specification for which type of key to generate. Primary or Secondary. Possible values include: "Primary", "Secondary". @@ -11674,8 +11798,8 @@ def __init__( :paramtype key_value: str """ super(RegenerateEndpointKeysRequest, self).__init__(**kwargs) - self.key_type = kwargs['key_type'] - self.key_value = kwargs.get('key_value', None) + self.key_type = kwargs["key_type"] + self.key_value = kwargs.get("key_value", None) class Regression(AutoMLVertical, TableVertical): @@ -11714,25 +11838,34 @@ class Regression(AutoMLVertical, TableVertical): """ _validation = { - 'task_type': {'required': True}, + "task_type": {"required": True}, } _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'TableVerticalDataSettings'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'TrainingSettings'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'allowed_models': {'key': 'allowedModels', 'type': '[str]'}, - 'blocked_models': {'key': 'blockedModels', 'type': '[str]'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "data_settings": { + "key": "dataSettings", + "type": "TableVerticalDataSettings", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "training_settings": { + "key": "trainingSettings", + "type": "TrainingSettings", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "allowed_models": {"key": "allowedModels", "type": "[str]"}, + "blocked_models": {"key": "blockedModels", "type": "[str]"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data_settings: Data inputs for AutoMLJob. :paramtype data_settings: ~azure.mgmt.machinelearningservices.models.TableVerticalDataSettings @@ -11760,19 +11893,21 @@ def __init__( ~azure.mgmt.machinelearningservices.models.RegressionPrimaryMetrics """ super(Regression, self).__init__(**kwargs) - self.data_settings = kwargs.get('data_settings', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.training_settings = kwargs.get('training_settings', None) - self.task_type = 'Regression' # type: str - self.allowed_models = kwargs.get('allowed_models', None) - self.blocked_models = kwargs.get('blocked_models', None) - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.task_type = 'Regression' # type: str - self.allowed_models = kwargs.get('allowed_models', None) - self.blocked_models = kwargs.get('blocked_models', None) - self.primary_metric = kwargs.get('primary_metric', None) + self.data_settings = kwargs.get("data_settings", None) + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.limit_settings = kwargs.get("limit_settings", None) + self.training_settings = kwargs.get("training_settings", None) + self.task_type = "Regression" # type: str + self.allowed_models = kwargs.get("allowed_models", None) + self.blocked_models = kwargs.get("blocked_models", None) + self.primary_metric = kwargs.get("primary_metric", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.task_type = "Regression" # type: str + self.allowed_models = kwargs.get("allowed_models", None) + self.blocked_models = kwargs.get("blocked_models", None) + self.primary_metric = kwargs.get("primary_metric", None) class ResourceConfiguration(msrest.serialization.Model): @@ -11787,15 +11922,12 @@ class ResourceConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "properties": {"key": "properties", "type": "{object}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword instance_count: Optional number of instances or nodes used by the compute target. :paramtype instance_count: int @@ -11805,9 +11937,9 @@ def __init__( :paramtype properties: dict[str, any] """ super(ResourceConfiguration, self).__init__(**kwargs) - self.instance_count = kwargs.get('instance_count', 1) - self.instance_type = kwargs.get('instance_type', None) - self.properties = kwargs.get('properties', None) + self.instance_count = kwargs.get("instance_count", 1) + self.instance_type = kwargs.get("instance_type", None) + self.properties = kwargs.get("properties", None) class Route(msrest.serialization.Model): @@ -11822,19 +11954,16 @@ class Route(msrest.serialization.Model): """ _validation = { - 'path': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'port': {'required': True}, + "path": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "port": {"required": True}, } _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, + "path": {"key": "path", "type": "str"}, + "port": {"key": "port", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword path: Required. [Required] The path for the route. :paramtype path: str @@ -11842,8 +11971,8 @@ def __init__( :paramtype port: int """ super(Route, self).__init__(**kwargs) - self.path = kwargs['path'] - self.port = kwargs['port'] + self.path = kwargs["path"] + self.port = kwargs["port"] class SasDatastoreCredentials(DatastoreCredentials): @@ -11860,26 +11989,23 @@ class SasDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, + "credentials_type": {"required": True}, + "secrets": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'SasDatastoreSecrets'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "secrets": {"key": "secrets", "type": "SasDatastoreSecrets"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword secrets: Required. [Required] Storage container secrets. :paramtype secrets: ~azure.mgmt.machinelearningservices.models.SasDatastoreSecrets """ super(SasDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Sas' # type: str - self.secrets = kwargs['secrets'] + self.credentials_type = "Sas" # type: str + self.secrets = kwargs["secrets"] class SasDatastoreSecrets(DatastoreSecrets): @@ -11896,25 +12022,22 @@ class SasDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'sas_token': {'key': 'sasToken', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "sas_token": {"key": "sasToken", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword sas_token: Storage container SAS token. :paramtype sas_token: str """ super(SasDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Sas' # type: str - self.sas_token = kwargs.get('sas_token', None) + self.secrets_type = "Sas" # type: str + self.sas_token = kwargs.get("sas_token", None) class ServicePrincipalDatastoreCredentials(DatastoreCredentials): @@ -11939,25 +12062,25 @@ class ServicePrincipalDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, + "credentials_type": {"required": True}, + "client_id": {"required": True}, + "secrets": {"required": True}, + "tenant_id": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'ServicePrincipalDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "authority_url": {"key": "authorityUrl", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + "resource_url": {"key": "resourceUrl", "type": "str"}, + "secrets": { + "key": "secrets", + "type": "ServicePrincipalDatastoreSecrets", + }, + "tenant_id": {"key": "tenantId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword authority_url: Authority URL used for authentication. :paramtype authority_url: str @@ -11972,12 +12095,12 @@ def __init__( :paramtype tenant_id: str """ super(ServicePrincipalDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'ServicePrincipal' # type: str - self.authority_url = kwargs.get('authority_url', None) - self.client_id = kwargs['client_id'] - self.resource_url = kwargs.get('resource_url', None) - self.secrets = kwargs['secrets'] - self.tenant_id = kwargs['tenant_id'] + self.credentials_type = "ServicePrincipal" # type: str + self.authority_url = kwargs.get("authority_url", None) + self.client_id = kwargs["client_id"] + self.resource_url = kwargs.get("resource_url", None) + self.secrets = kwargs["secrets"] + self.tenant_id = kwargs["tenant_id"] class ServicePrincipalDatastoreSecrets(DatastoreSecrets): @@ -11994,25 +12117,22 @@ class ServicePrincipalDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "client_secret": {"key": "clientSecret", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword client_secret: Service principal secret. :paramtype client_secret: str """ super(ServicePrincipalDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'ServicePrincipal' # type: str - self.client_secret = kwargs.get('client_secret', None) + self.secrets_type = "ServicePrincipal" # type: str + self.client_secret = kwargs.get("client_secret", None) class Sku(msrest.serialization.Model): @@ -12038,21 +12158,18 @@ class Sku(msrest.serialization.Model): """ _validation = { - 'name': {'required': True}, + "name": {"required": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'int'}, + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, + "size": {"key": "size", "type": "str"}, + "family": {"key": "family", "type": "str"}, + "capacity": {"key": "capacity", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code. :paramtype name: str @@ -12071,11 +12188,11 @@ def __init__( :paramtype capacity: int """ super(Sku, self).__init__(**kwargs) - self.name = kwargs['name'] - self.tier = kwargs.get('tier', None) - self.size = kwargs.get('size', None) - self.family = kwargs.get('family', None) - self.capacity = kwargs.get('capacity', None) + self.name = kwargs["name"] + self.tier = kwargs.get("tier", None) + self.size = kwargs.get("size", None) + self.family = kwargs.get("family", None) + self.capacity = kwargs.get("capacity", None) class SkuCapacity(msrest.serialization.Model): @@ -12093,16 +12210,13 @@ class SkuCapacity(msrest.serialization.Model): """ _attribute_map = { - 'default': {'key': 'default', 'type': 'int'}, - 'maximum': {'key': 'maximum', 'type': 'int'}, - 'minimum': {'key': 'minimum', 'type': 'int'}, - 'scale_type': {'key': 'scaleType', 'type': 'str'}, + "default": {"key": "default", "type": "int"}, + "maximum": {"key": "maximum", "type": "int"}, + "minimum": {"key": "minimum", "type": "int"}, + "scale_type": {"key": "scaleType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword default: Gets or sets the default capacity. :paramtype default: int @@ -12115,10 +12229,10 @@ def __init__( :paramtype scale_type: str or ~azure.mgmt.machinelearningservices.models.SkuScaleType """ super(SkuCapacity, self).__init__(**kwargs) - self.default = kwargs.get('default', 0) - self.maximum = kwargs.get('maximum', 0) - self.minimum = kwargs.get('minimum', 0) - self.scale_type = kwargs.get('scale_type', None) + self.default = kwargs.get("default", 0) + self.maximum = kwargs.get("maximum", 0) + self.minimum = kwargs.get("minimum", 0) + self.scale_type = kwargs.get("scale_type", None) class SkuResource(msrest.serialization.Model): @@ -12135,19 +12249,16 @@ class SkuResource(msrest.serialization.Model): """ _validation = { - 'resource_type': {'readonly': True}, + "resource_type": {"readonly": True}, } _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'SkuSetting'}, + "capacity": {"key": "capacity", "type": "SkuCapacity"}, + "resource_type": {"key": "resourceType", "type": "str"}, + "sku": {"key": "sku", "type": "SkuSetting"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword capacity: Gets or sets the Sku Capacity. :paramtype capacity: ~azure.mgmt.machinelearningservices.models.SkuCapacity @@ -12155,9 +12266,9 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.SkuSetting """ super(SkuResource, self).__init__(**kwargs) - self.capacity = kwargs.get('capacity', None) + self.capacity = kwargs.get("capacity", None) self.resource_type = None - self.sku = kwargs.get('sku', None) + self.sku = kwargs.get("sku", None) class SkuResourceArmPaginatedResult(msrest.serialization.Model): @@ -12171,14 +12282,11 @@ class SkuResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[SkuResource]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[SkuResource]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of SkuResource objects. If null, there are no additional pages. @@ -12187,8 +12295,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.SkuResource] """ super(SkuResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class SkuSetting(msrest.serialization.Model): @@ -12206,18 +12314,15 @@ class SkuSetting(msrest.serialization.Model): """ _validation = { - 'name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: Required. [Required] The name of the SKU. Ex - P3. It is typically a letter+number code. @@ -12228,8 +12333,8 @@ def __init__( :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier """ super(SkuSetting, self).__init__(**kwargs) - self.name = kwargs['name'] - self.tier = kwargs.get('tier', None) + self.name = kwargs["name"] + self.tier = kwargs.get("tier", None) class StackEnsembleSettings(msrest.serialization.Model): @@ -12251,15 +12356,21 @@ class StackEnsembleSettings(msrest.serialization.Model): """ _attribute_map = { - 'stack_meta_learner_k_wargs': {'key': 'stackMetaLearnerKWargs', 'type': 'object'}, - 'stack_meta_learner_train_percentage': {'key': 'stackMetaLearnerTrainPercentage', 'type': 'float'}, - 'stack_meta_learner_type': {'key': 'stackMetaLearnerType', 'type': 'str'}, + "stack_meta_learner_k_wargs": { + "key": "stackMetaLearnerKWargs", + "type": "object", + }, + "stack_meta_learner_train_percentage": { + "key": "stackMetaLearnerTrainPercentage", + "type": "float", + }, + "stack_meta_learner_type": { + "key": "stackMetaLearnerType", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword stack_meta_learner_k_wargs: Optional parameters to pass to the initializer of the meta-learner. @@ -12276,9 +12387,15 @@ def __init__( ~azure.mgmt.machinelearningservices.models.StackMetaLearnerType """ super(StackEnsembleSettings, self).__init__(**kwargs) - self.stack_meta_learner_k_wargs = kwargs.get('stack_meta_learner_k_wargs', None) - self.stack_meta_learner_train_percentage = kwargs.get('stack_meta_learner_train_percentage', 0.2) - self.stack_meta_learner_type = kwargs.get('stack_meta_learner_type', None) + self.stack_meta_learner_k_wargs = kwargs.get( + "stack_meta_learner_k_wargs", None + ) + self.stack_meta_learner_train_percentage = kwargs.get( + "stack_meta_learner_train_percentage", 0.2 + ) + self.stack_meta_learner_type = kwargs.get( + "stack_meta_learner_type", None + ) class SweepJob(JobBaseDetails): @@ -12341,41 +12458,44 @@ class SweepJob(JobBaseDetails): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'objective': {'required': True}, - 'sampling_algorithm': {'required': True}, - 'search_space': {'required': True}, - 'trial': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'ScheduleBase'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'SweepJobLimits'}, - 'objective': {'key': 'objective', 'type': 'Objective'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'SamplingAlgorithm'}, - 'search_space': {'key': 'searchSpace', 'type': 'object'}, - 'trial': {'key': 'trial', 'type': 'TrialComponent'}, - } - - def __init__( - self, - **kwargs - ): + "job_type": {"required": True}, + "status": {"readonly": True}, + "objective": {"required": True}, + "sampling_algorithm": {"required": True}, + "search_space": {"required": True}, + "trial": {"required": True}, + } + + _attribute_map = { + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "schedule": {"key": "schedule", "type": "ScheduleBase"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "limits": {"key": "limits", "type": "SweepJobLimits"}, + "objective": {"key": "objective", "type": "Objective"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "sampling_algorithm": { + "key": "samplingAlgorithm", + "type": "SamplingAlgorithm", + }, + "search_space": {"key": "searchSpace", "type": "object"}, + "trial": {"key": "trial", "type": "TrialComponent"}, + } + + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -12422,15 +12542,15 @@ def __init__( :paramtype trial: ~azure.mgmt.machinelearningservices.models.TrialComponent """ super(SweepJob, self).__init__(**kwargs) - self.job_type = 'Sweep' # type: str - self.early_termination = kwargs.get('early_termination', None) - self.inputs = kwargs.get('inputs', None) - self.limits = kwargs.get('limits', None) - self.objective = kwargs['objective'] - self.outputs = kwargs.get('outputs', None) - self.sampling_algorithm = kwargs['sampling_algorithm'] - self.search_space = kwargs['search_space'] - self.trial = kwargs['trial'] + self.job_type = "Sweep" # type: str + self.early_termination = kwargs.get("early_termination", None) + self.inputs = kwargs.get("inputs", None) + self.limits = kwargs.get("limits", None) + self.objective = kwargs["objective"] + self.outputs = kwargs.get("outputs", None) + self.sampling_algorithm = kwargs["sampling_algorithm"] + self.search_space = kwargs["search_space"] + self.trial = kwargs["trial"] class SweepJobLimits(JobLimits): @@ -12453,21 +12573,18 @@ class SweepJobLimits(JobLimits): """ _validation = { - 'job_limits_type': {'required': True}, + "job_limits_type": {"required": True}, } _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_total_trials': {'key': 'maxTotalTrials', 'type': 'int'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, + "job_limits_type": {"key": "jobLimitsType", "type": "str"}, + "timeout": {"key": "timeout", "type": "duration"}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_total_trials": {"key": "maxTotalTrials", "type": "int"}, + "trial_timeout": {"key": "trialTimeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. Only supports duration with precision as low as Seconds. @@ -12480,10 +12597,10 @@ def __init__( :paramtype trial_timeout: ~datetime.timedelta """ super(SweepJobLimits, self).__init__(**kwargs) - self.job_limits_type = 'Sweep' # type: str - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', None) - self.max_total_trials = kwargs.get('max_total_trials', None) - self.trial_timeout = kwargs.get('trial_timeout', None) + self.job_limits_type = "Sweep" # type: str + self.max_concurrent_trials = kwargs.get("max_concurrent_trials", None) + self.max_total_trials = kwargs.get("max_total_trials", None) + self.trial_timeout = kwargs.get("trial_timeout", None) class SystemData(msrest.serialization.Model): @@ -12506,18 +12623,15 @@ class SystemData(msrest.serialization.Model): """ _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + "created_by": {"key": "createdBy", "type": "str"}, + "created_by_type": {"key": "createdByType", "type": "str"}, + "created_at": {"key": "createdAt", "type": "iso-8601"}, + "last_modified_by": {"key": "lastModifiedBy", "type": "str"}, + "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"}, + "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword created_by: The identity that created the resource. :paramtype created_by: str @@ -12536,12 +12650,12 @@ def __init__( :paramtype last_modified_at: ~datetime.datetime """ super(SystemData, self).__init__(**kwargs) - self.created_by = kwargs.get('created_by', None) - self.created_by_type = kwargs.get('created_by_type', None) - self.created_at = kwargs.get('created_at', None) - self.last_modified_by = kwargs.get('last_modified_by', None) - self.last_modified_by_type = kwargs.get('last_modified_by_type', None) - self.last_modified_at = kwargs.get('last_modified_at', None) + self.created_by = kwargs.get("created_by", None) + self.created_by_type = kwargs.get("created_by_type", None) + self.created_at = kwargs.get("created_at", None) + self.last_modified_by = kwargs.get("last_modified_by", None) + self.last_modified_by_type = kwargs.get("last_modified_by_type", None) + self.last_modified_at = kwargs.get("last_modified_at", None) class TableVerticalDataSettings(DataSettings): @@ -12566,22 +12680,25 @@ class TableVerticalDataSettings(DataSettings): """ _validation = { - 'target_column_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'training_data': {'required': True}, + "target_column_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "training_data": {"required": True}, } _attribute_map = { - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'test_data': {'key': 'testData', 'type': 'TestDataSettings'}, - 'training_data': {'key': 'trainingData', 'type': 'TrainingDataSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'TableVerticalValidationDataSettings'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "test_data": {"key": "testData", "type": "TestDataSettings"}, + "training_data": { + "key": "trainingData", + "type": "TrainingDataSettings", + }, + "validation_data": { + "key": "validationData", + "type": "TableVerticalValidationDataSettings", + }, + "weight_column_name": {"key": "weightColumnName", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword target_column_name: Required. [Required] Target column name: This is prediction values column. @@ -12599,8 +12716,8 @@ def __init__( :paramtype weight_column_name: str """ super(TableVerticalDataSettings, self).__init__(**kwargs) - self.validation_data = kwargs.get('validation_data', None) - self.weight_column_name = kwargs.get('weight_column_name', None) + self.validation_data = kwargs.get("validation_data", None) + self.weight_column_name = kwargs.get("weight_column_name", None) class TableVerticalFeaturizationSettings(FeaturizationSettings): @@ -12631,19 +12748,28 @@ class TableVerticalFeaturizationSettings(FeaturizationSettings): """ _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - 'blocked_transformers': {'key': 'blockedTransformers', 'type': '[str]'}, - 'column_name_and_types': {'key': 'columnNameAndTypes', 'type': '{str}'}, - 'drop_columns': {'key': 'dropColumns', 'type': '[str]'}, - 'enable_dnn_featurization': {'key': 'enableDnnFeaturization', 'type': 'bool'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'transformer_params': {'key': 'transformerParams', 'type': '{[ColumnTransformer]}'}, + "dataset_language": {"key": "datasetLanguage", "type": "str"}, + "blocked_transformers": { + "key": "blockedTransformers", + "type": "[str]", + }, + "column_name_and_types": { + "key": "columnNameAndTypes", + "type": "{str}", + }, + "drop_columns": {"key": "dropColumns", "type": "[str]"}, + "enable_dnn_featurization": { + "key": "enableDnnFeaturization", + "type": "bool", + }, + "mode": {"key": "mode", "type": "str"}, + "transformer_params": { + "key": "transformerParams", + "type": "{[ColumnTransformer]}", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword dataset_language: Dataset language, useful for the text data. :paramtype dataset_language: str @@ -12669,12 +12795,14 @@ def __init__( list[~azure.mgmt.machinelearningservices.models.ColumnTransformer]] """ super(TableVerticalFeaturizationSettings, self).__init__(**kwargs) - self.blocked_transformers = kwargs.get('blocked_transformers', None) - self.column_name_and_types = kwargs.get('column_name_and_types', None) - self.drop_columns = kwargs.get('drop_columns', None) - self.enable_dnn_featurization = kwargs.get('enable_dnn_featurization', False) - self.mode = kwargs.get('mode', None) - self.transformer_params = kwargs.get('transformer_params', None) + self.blocked_transformers = kwargs.get("blocked_transformers", None) + self.column_name_and_types = kwargs.get("column_name_and_types", None) + self.drop_columns = kwargs.get("drop_columns", None) + self.enable_dnn_featurization = kwargs.get( + "enable_dnn_featurization", False + ) + self.mode = kwargs.get("mode", None) + self.transformer_params = kwargs.get("transformer_params", None) class TableVerticalLimitSettings(msrest.serialization.Model): @@ -12698,19 +12826,19 @@ class TableVerticalLimitSettings(msrest.serialization.Model): """ _attribute_map = { - 'enable_early_termination': {'key': 'enableEarlyTermination', 'type': 'bool'}, - 'exit_score': {'key': 'exitScore', 'type': 'float'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_cores_per_trial': {'key': 'maxCoresPerTrial', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, + "enable_early_termination": { + "key": "enableEarlyTermination", + "type": "bool", + }, + "exit_score": {"key": "exitScore", "type": "float"}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_cores_per_trial": {"key": "maxCoresPerTrial", "type": "int"}, + "max_trials": {"key": "maxTrials", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, + "trial_timeout": {"key": "trialTimeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword enable_early_termination: Enable early termination, determines whether or not if AutoMLJob will terminate early if there is no score improvement in last 20 iterations. @@ -12729,13 +12857,15 @@ def __init__( :paramtype trial_timeout: ~datetime.timedelta """ super(TableVerticalLimitSettings, self).__init__(**kwargs) - self.enable_early_termination = kwargs.get('enable_early_termination', True) - self.exit_score = kwargs.get('exit_score', None) - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', 1) - self.max_cores_per_trial = kwargs.get('max_cores_per_trial', -1) - self.max_trials = kwargs.get('max_trials', 1000) - self.timeout = kwargs.get('timeout', "PT6H") - self.trial_timeout = kwargs.get('trial_timeout', "PT30M") + self.enable_early_termination = kwargs.get( + "enable_early_termination", True + ) + self.exit_score = kwargs.get("exit_score", None) + self.max_concurrent_trials = kwargs.get("max_concurrent_trials", 1) + self.max_cores_per_trial = kwargs.get("max_cores_per_trial", -1) + self.max_trials = kwargs.get("max_trials", 1000) + self.timeout = kwargs.get("timeout", "PT6H") + self.trial_timeout = kwargs.get("trial_timeout", "PT30M") class TableVerticalValidationDataSettings(ValidationDataSettings): @@ -12756,16 +12886,19 @@ class TableVerticalValidationDataSettings(ValidationDataSettings): """ _attribute_map = { - 'data': {'key': 'data', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, + "data": {"key": "data", "type": "MLTableJobInput"}, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data: Validation data MLTable. :paramtype data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput @@ -12782,8 +12915,8 @@ def __init__( :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations """ super(TableVerticalValidationDataSettings, self).__init__(**kwargs) - self.cv_split_column_names = kwargs.get('cv_split_column_names', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) + self.cv_split_column_names = kwargs.get("cv_split_column_names", None) + self.n_cross_validations = kwargs.get("n_cross_validations", None) class TargetUtilizationScaleSettings(OnlineScaleSettings): @@ -12807,21 +12940,21 @@ class TargetUtilizationScaleSettings(OnlineScaleSettings): """ _validation = { - 'scale_type': {'required': True}, + "scale_type": {"required": True}, } _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - 'max_instances': {'key': 'maxInstances', 'type': 'int'}, - 'min_instances': {'key': 'minInstances', 'type': 'int'}, - 'polling_interval': {'key': 'pollingInterval', 'type': 'duration'}, - 'target_utilization_percentage': {'key': 'targetUtilizationPercentage', 'type': 'int'}, + "scale_type": {"key": "scaleType", "type": "str"}, + "max_instances": {"key": "maxInstances", "type": "int"}, + "min_instances": {"key": "minInstances", "type": "int"}, + "polling_interval": {"key": "pollingInterval", "type": "duration"}, + "target_utilization_percentage": { + "key": "targetUtilizationPercentage", + "type": "int", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword max_instances: The maximum number of instances that the deployment can scale to. The quota will be reserved for max_instances. @@ -12835,11 +12968,13 @@ def __init__( :paramtype target_utilization_percentage: int """ super(TargetUtilizationScaleSettings, self).__init__(**kwargs) - self.scale_type = 'TargetUtilization' # type: str - self.max_instances = kwargs.get('max_instances', 1) - self.min_instances = kwargs.get('min_instances', 1) - self.polling_interval = kwargs.get('polling_interval', "PT1S") - self.target_utilization_percentage = kwargs.get('target_utilization_percentage', 70) + self.scale_type = "TargetUtilization" # type: str + self.max_instances = kwargs.get("max_instances", 1) + self.min_instances = kwargs.get("min_instances", 1) + self.polling_interval = kwargs.get("polling_interval", "PT1S") + self.target_utilization_percentage = kwargs.get( + "target_utilization_percentage", 70 + ) class TensorFlow(DistributionConfiguration): @@ -12857,19 +12992,19 @@ class TensorFlow(DistributionConfiguration): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'parameter_server_count': {'key': 'parameterServerCount', 'type': 'int'}, - 'worker_count': {'key': 'workerCount', 'type': 'int'}, + "distribution_type": {"key": "distributionType", "type": "str"}, + "parameter_server_count": { + "key": "parameterServerCount", + "type": "int", + }, + "worker_count": {"key": "workerCount", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword parameter_server_count: Number of parameter server tasks. :paramtype parameter_server_count: int @@ -12877,9 +13012,9 @@ def __init__( :paramtype worker_count: int """ super(TensorFlow, self).__init__(**kwargs) - self.distribution_type = 'TensorFlow' # type: str - self.parameter_server_count = kwargs.get('parameter_server_count', 0) - self.worker_count = kwargs.get('worker_count', None) + self.distribution_type = "TensorFlow" # type: str + self.parameter_server_count = kwargs.get("parameter_server_count", 0) + self.worker_count = kwargs.get("worker_count", None) class TestDataSettings(msrest.serialization.Model): @@ -12895,14 +13030,11 @@ class TestDataSettings(msrest.serialization.Model): """ _attribute_map = { - 'data': {'key': 'data', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, + "data": {"key": "data", "type": "MLTableJobInput"}, + "test_data_size": {"key": "testDataSize", "type": "float"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data: Test data MLTable. :paramtype data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput @@ -12913,55 +13045,61 @@ def __init__( :paramtype test_data_size: float """ super(TestDataSettings, self).__init__(**kwargs) - self.data = kwargs.get('data', None) - self.test_data_size = kwargs.get('test_data_size', None) + self.data = kwargs.get("data", None) + self.test_data_size = kwargs.get("test_data_size", None) class TextClassification(AutoMLVertical, NlpVertical): """Text Classification task in AutoML NLP vertical. -NLP - Natural Language Processing. + NLP - Natural Language Processing. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar data_settings: Data inputs for AutoMLJob. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalDataSettings - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar primary_metric: Primary metric for Text-Classification task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics + :ivar data_settings: Data inputs for AutoMLJob. + :vartype data_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalDataSettings + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar primary_metric: Primary metric for Text-Classification task. Possible values include: + "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ _validation = { - 'task_type': {'required': True}, + "task_type": {"required": True}, } _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'NlpVerticalDataSettings'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "data_settings": { + "key": "dataSettings", + "type": "NlpVerticalDataSettings", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data_settings: Data inputs for AutoMLJob. :paramtype data_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalDataSettings @@ -12980,65 +13118,73 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ super(TextClassification, self).__init__(**kwargs) - self.data_settings = kwargs.get('data_settings', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.task_type = 'TextClassification' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.task_type = 'TextClassification' # type: str - self.primary_metric = kwargs.get('primary_metric', None) + self.data_settings = kwargs.get("data_settings", None) + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.limit_settings = kwargs.get("limit_settings", None) + self.task_type = "TextClassification" # type: str + self.primary_metric = kwargs.get("primary_metric", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.task_type = "TextClassification" # type: str + self.primary_metric = kwargs.get("primary_metric", None) class TextClassificationMultilabel(AutoMLVertical, NlpVertical): """Text Classification Multilabel task in AutoML NLP vertical. -NLP - Natural Language Processing. + NLP - Natural Language Processing. - Variables are only populated by the server, and will be ignored when sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar data_settings: Data inputs for AutoMLJob. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalDataSettings - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar primary_metric: Primary metric for Text-Classification-Multilabel task. - Currently only Accuracy is supported as primary metric, hence user need not set it explicitly. - Possible values include: "AUCWeighted", "Accuracy", "NormMacroRecall", - "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics + :ivar data_settings: Data inputs for AutoMLJob. + :vartype data_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalDataSettings + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar primary_metric: Primary metric for Text-Classification-Multilabel task. + Currently only Accuracy is supported as primary metric, hence user need not set it explicitly. + Possible values include: "AUCWeighted", "Accuracy", "NormMacroRecall", + "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted", "IOU". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics """ _validation = { - 'task_type': {'required': True}, - 'primary_metric': {'readonly': True}, + "task_type": {"required": True}, + "primary_metric": {"readonly": True}, } _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'NlpVerticalDataSettings'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "data_settings": { + "key": "dataSettings", + "type": "NlpVerticalDataSettings", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data_settings: Data inputs for AutoMLJob. :paramtype data_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalDataSettings @@ -13052,66 +13198,74 @@ def __init__( :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity """ super(TextClassificationMultilabel, self).__init__(**kwargs) - self.data_settings = kwargs.get('data_settings', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.task_type = 'TextClassificationMultilabel' # type: str + self.data_settings = kwargs.get("data_settings", None) + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.limit_settings = kwargs.get("limit_settings", None) + self.task_type = "TextClassificationMultilabel" # type: str self.primary_metric = None - self.log_verbosity = kwargs.get('log_verbosity', None) - self.task_type = 'TextClassificationMultilabel' # type: str + self.log_verbosity = kwargs.get("log_verbosity", None) + self.task_type = "TextClassificationMultilabel" # type: str self.primary_metric = None class TextNer(AutoMLVertical, NlpVertical): """Text-NER task in AutoML NLP vertical. -NER - Named Entity Recognition. -NLP - Natural Language Processing. + NER - Named Entity Recognition. + NLP - Natural Language Processing. - Variables are only populated by the server, and will be ignored when sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar data_settings: Data inputs for AutoMLJob. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalDataSettings - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar primary_metric: Primary metric for Text-NER task. - Only 'Accuracy' is supported for Text-NER, so user need not set this explicitly. Possible - values include: "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics + :ivar data_settings: Data inputs for AutoMLJob. + :vartype data_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalDataSettings + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar primary_metric: Primary metric for Text-NER task. + Only 'Accuracy' is supported for Text-NER, so user need not set this explicitly. Possible + values include: "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ _validation = { - 'task_type': {'required': True}, - 'primary_metric': {'readonly': True}, + "task_type": {"required": True}, + "primary_metric": {"readonly": True}, } _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'NlpVerticalDataSettings'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "data_settings": { + "key": "dataSettings", + "type": "NlpVerticalDataSettings", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data_settings: Data inputs for AutoMLJob. :paramtype data_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalDataSettings @@ -13125,13 +13279,15 @@ def __init__( :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity """ super(TextNer, self).__init__(**kwargs) - self.data_settings = kwargs.get('data_settings', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.task_type = 'TextNER' # type: str + self.data_settings = kwargs.get("data_settings", None) + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.limit_settings = kwargs.get("limit_settings", None) + self.task_type = "TextNER" # type: str self.primary_metric = None - self.log_verbosity = kwargs.get('log_verbosity', None) - self.task_type = 'TextNER' # type: str + self.log_verbosity = kwargs.get("log_verbosity", None) + self.task_type = "TextNER" # type: str self.primary_metric = None @@ -13145,23 +13301,20 @@ class TrainingDataSettings(msrest.serialization.Model): """ _validation = { - 'data': {'required': True}, + "data": {"required": True}, } _attribute_map = { - 'data': {'key': 'data', 'type': 'MLTableJobInput'}, + "data": {"key": "data", "type": "MLTableJobInput"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data: Required. [Required] Training data MLTable. :paramtype data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ super(TrainingDataSettings, self).__init__(**kwargs) - self.data = kwargs['data'] + self.data = kwargs["data"] class TrainingSettings(msrest.serialization.Model): @@ -13187,19 +13340,31 @@ class TrainingSettings(msrest.serialization.Model): """ _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - } - - def __init__( - self, - **kwargs - ): + "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, + "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, + } + + def __init__(self, **kwargs): """ :keyword enable_dnn_training: Enable recommendation of DNN models. :paramtype enable_dnn_training: bool @@ -13220,13 +13385,21 @@ def __init__( ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings """ super(TrainingSettings, self).__init__(**kwargs) - self.enable_dnn_training = kwargs.get('enable_dnn_training', False) - self.enable_model_explainability = kwargs.get('enable_model_explainability', False) - self.enable_onnx_compatible_models = kwargs.get('enable_onnx_compatible_models', False) - self.enable_stack_ensemble = kwargs.get('enable_stack_ensemble', True) - self.enable_vote_ensemble = kwargs.get('enable_vote_ensemble', True) - self.ensemble_model_download_timeout = kwargs.get('ensemble_model_download_timeout', "PT5M") - self.stack_ensemble_settings = kwargs.get('stack_ensemble_settings', None) + self.enable_dnn_training = kwargs.get("enable_dnn_training", False) + self.enable_model_explainability = kwargs.get( + "enable_model_explainability", False + ) + self.enable_onnx_compatible_models = kwargs.get( + "enable_onnx_compatible_models", False + ) + self.enable_stack_ensemble = kwargs.get("enable_stack_ensemble", True) + self.enable_vote_ensemble = kwargs.get("enable_vote_ensemble", True) + self.ensemble_model_download_timeout = kwargs.get( + "ensemble_model_download_timeout", "PT5M" + ) + self.stack_ensemble_settings = kwargs.get( + "stack_ensemble_settings", None + ) class TrialComponent(msrest.serialization.Model): @@ -13252,23 +13425,30 @@ class TrialComponent(msrest.serialization.Model): """ _validation = { - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "command": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "environment_id": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'ResourceConfiguration'}, + "code_id": {"key": "codeId", "type": "str"}, + "command": {"key": "command", "type": "str"}, + "distribution": { + "key": "distribution", + "type": "DistributionConfiguration", + }, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "resources": {"key": "resources", "type": "ResourceConfiguration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword code_id: ARM resource ID of the code asset. :paramtype code_id: str @@ -13287,12 +13467,12 @@ def __init__( :paramtype resources: ~azure.mgmt.machinelearningservices.models.ResourceConfiguration """ super(TrialComponent, self).__init__(**kwargs) - self.code_id = kwargs.get('code_id', None) - self.command = kwargs['command'] - self.distribution = kwargs.get('distribution', None) - self.environment_id = kwargs['environment_id'] - self.environment_variables = kwargs.get('environment_variables', None) - self.resources = kwargs.get('resources', None) + self.code_id = kwargs.get("code_id", None) + self.command = kwargs["command"] + self.distribution = kwargs.get("distribution", None) + self.environment_id = kwargs["environment_id"] + self.environment_variables = kwargs.get("environment_variables", None) + self.resources = kwargs.get("resources", None) class TritonModelJobInput(JobInput, AssetJobInput): @@ -13314,21 +13494,18 @@ class TritonModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -13339,11 +13516,11 @@ def __init__( :paramtype description: str """ super(TritonModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'TritonModel' # type: str - self.description = kwargs.get('description', None) - self.job_input_type = 'TritonModel' # type: str + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "TritonModel" # type: str + self.description = kwargs.get("description", None) + self.job_input_type = "TritonModel" # type: str class TritonModelJobOutput(JobOutput, AssetJobOutput): @@ -13364,20 +13541,17 @@ class TritonModelJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -13387,11 +13561,11 @@ def __init__( :paramtype description: str """ super(TritonModelJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'TritonModel' # type: str - self.description = kwargs.get('description', None) - self.job_output_type = 'TritonModel' # type: str + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "TritonModel" # type: str + self.description = kwargs.get("description", None) + self.job_output_type = "TritonModel" # type: str class TruncationSelectionPolicy(EarlyTerminationPolicy): @@ -13412,20 +13586,20 @@ class TruncationSelectionPolicy(EarlyTerminationPolicy): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'truncation_percentage': {'key': 'truncationPercentage', 'type': 'int'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, + "truncation_percentage": { + "key": "truncationPercentage", + "type": "int", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. :paramtype delay_evaluation: int @@ -13435,8 +13609,8 @@ def __init__( :paramtype truncation_percentage: int """ super(TruncationSelectionPolicy, self).__init__(**kwargs) - self.policy_type = 'TruncationSelection' # type: str - self.truncation_percentage = kwargs.get('truncation_percentage', 0) + self.policy_type = "TruncationSelection" # type: str + self.truncation_percentage = kwargs.get("truncation_percentage", 0) class UriFileDataVersion(DataVersionBaseDetails): @@ -13463,24 +13637,21 @@ class UriFileDataVersion(DataVersionBaseDetails): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -13497,7 +13668,7 @@ def __init__( :paramtype data_uri: str """ super(UriFileDataVersion, self).__init__(**kwargs) - self.data_type = 'UriFile' # type: str + self.data_type = "UriFile" # type: str class UriFileJobInput(JobInput, AssetJobInput): @@ -13519,21 +13690,18 @@ class UriFileJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -13544,11 +13712,11 @@ def __init__( :paramtype description: str """ super(UriFileJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'UriFile' # type: str - self.description = kwargs.get('description', None) - self.job_input_type = 'UriFile' # type: str + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "UriFile" # type: str + self.description = kwargs.get("description", None) + self.job_input_type = "UriFile" # type: str class UriFileJobOutput(JobOutput, AssetJobOutput): @@ -13569,20 +13737,17 @@ class UriFileJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -13592,11 +13757,11 @@ def __init__( :paramtype description: str """ super(UriFileJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'UriFile' # type: str - self.description = kwargs.get('description', None) - self.job_output_type = 'UriFile' # type: str + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "UriFile" # type: str + self.description = kwargs.get("description", None) + self.job_output_type = "UriFile" # type: str class UriFolderDataVersion(DataVersionBaseDetails): @@ -13623,24 +13788,21 @@ class UriFolderDataVersion(DataVersionBaseDetails): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -13657,7 +13819,7 @@ def __init__( :paramtype data_uri: str """ super(UriFolderDataVersion, self).__init__(**kwargs) - self.data_type = 'UriFolder' # type: str + self.data_type = "UriFolder" # type: str class UriFolderJobInput(JobInput, AssetJobInput): @@ -13679,21 +13841,18 @@ class UriFolderJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -13704,11 +13863,11 @@ def __init__( :paramtype description: str """ super(UriFolderJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'UriFolder' # type: str - self.description = kwargs.get('description', None) - self.job_input_type = 'UriFolder' # type: str + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "UriFolder" # type: str + self.description = kwargs.get("description", None) + self.job_input_type = "UriFolder" # type: str class UriFolderJobOutput(JobOutput, AssetJobOutput): @@ -13729,20 +13888,17 @@ class UriFolderJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -13752,11 +13908,11 @@ def __init__( :paramtype description: str """ super(UriFolderJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'UriFolder' # type: str - self.description = kwargs.get('description', None) - self.job_output_type = 'UriFolder' # type: str + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "UriFolder" # type: str + self.description = kwargs.get("description", None) + self.job_output_type = "UriFolder" # type: str class UserAssignedIdentity(msrest.serialization.Model): @@ -13771,21 +13927,17 @@ class UserAssignedIdentity(msrest.serialization.Model): """ _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, + "principal_id": {"readonly": True}, + "client_id": {"readonly": True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, + "principal_id": {"key": "principalId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UserAssignedIdentity, self).__init__(**kwargs) self.principal_id = None self.client_id = None @@ -13803,18 +13955,14 @@ class UserIdentity(IdentityConfiguration): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UserIdentity, self).__init__(**kwargs) - self.identity_type = 'UserIdentity' # type: str + self.identity_type = "UserIdentity" # type: str diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/models/_models_py3.py index ea53ffbdb36e..c4ce93ab18c1 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/models/_models_py3.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/models/_models_py3.py @@ -30,23 +30,27 @@ class DatastoreCredentials(msrest.serialization.Model): """ _validation = { - 'credentials_type': {'required': True}, + "credentials_type": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, } _subtype_map = { - 'credentials_type': {'AccountKey': 'AccountKeyDatastoreCredentials', 'Certificate': 'CertificateDatastoreCredentials', 'KerberosKeytab': 'KerberosKeytabCredentials', 'KerberosPassword': 'KerberosPasswordCredentials', 'None': 'NoneDatastoreCredentials', 'Sas': 'SasDatastoreCredentials', 'ServicePrincipal': 'ServicePrincipalDatastoreCredentials'} - } - - def __init__( - self, - **kwargs - ): - """ - """ + "credentials_type": { + "AccountKey": "AccountKeyDatastoreCredentials", + "Certificate": "CertificateDatastoreCredentials", + "KerberosKeytab": "KerberosKeytabCredentials", + "KerberosPassword": "KerberosPasswordCredentials", + "None": "NoneDatastoreCredentials", + "Sas": "SasDatastoreCredentials", + "ServicePrincipal": "ServicePrincipalDatastoreCredentials", + } + } + + def __init__(self, **kwargs): + """ """ super(DatastoreCredentials, self).__init__(**kwargs) self.credentials_type = None # type: Optional[str] @@ -65,27 +69,22 @@ class AccountKeyDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, + "credentials_type": {"required": True}, + "secrets": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'AccountKeyDatastoreSecrets'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "secrets": {"key": "secrets", "type": "AccountKeyDatastoreSecrets"}, } - def __init__( - self, - *, - secrets: "AccountKeyDatastoreSecrets", - **kwargs - ): + def __init__(self, *, secrets: "AccountKeyDatastoreSecrets", **kwargs): """ :keyword secrets: Required. [Required] Storage account secrets. :paramtype secrets: ~azure.mgmt.machinelearningservices.models.AccountKeyDatastoreSecrets """ super(AccountKeyDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'AccountKey' # type: str + self.credentials_type = "AccountKey" # type: str self.secrets = secrets @@ -104,23 +103,26 @@ class DatastoreSecrets(msrest.serialization.Model): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, } _subtype_map = { - 'secrets_type': {'AccountKey': 'AccountKeyDatastoreSecrets', 'Certificate': 'CertificateDatastoreSecrets', 'KerberosKeytab': 'KerberosKeytabSecrets', 'KerberosPassword': 'KerberosPasswordSecrets', 'Sas': 'SasDatastoreSecrets', 'ServicePrincipal': 'ServicePrincipalDatastoreSecrets'} - } - - def __init__( - self, - **kwargs - ): - """ - """ + "secrets_type": { + "AccountKey": "AccountKeyDatastoreSecrets", + "Certificate": "CertificateDatastoreSecrets", + "KerberosKeytab": "KerberosKeytabSecrets", + "KerberosPassword": "KerberosPasswordSecrets", + "Sas": "SasDatastoreSecrets", + "ServicePrincipal": "ServicePrincipalDatastoreSecrets", + } + } + + def __init__(self, **kwargs): + """ """ super(DatastoreSecrets, self).__init__(**kwargs) self.secrets_type = None # type: Optional[str] @@ -139,26 +141,21 @@ class AccountKeyDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "key": {"key": "key", "type": "str"}, } - def __init__( - self, - *, - key: Optional[str] = None, - **kwargs - ): + def __init__(self, *, key: Optional[str] = None, **kwargs): """ :keyword key: Storage account key. :paramtype key: str """ super(AccountKeyDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'AccountKey' # type: str + self.secrets_type = "AccountKey" # type: str self.key = key @@ -177,23 +174,23 @@ class IdentityConfiguration(msrest.serialization.Model): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, } _subtype_map = { - 'identity_type': {'AMLToken': 'AmlToken', 'Managed': 'ManagedIdentity', 'UserIdentity': 'UserIdentity'} + "identity_type": { + "AMLToken": "AmlToken", + "Managed": "ManagedIdentity", + "UserIdentity": "UserIdentity", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(IdentityConfiguration, self).__init__(**kwargs) self.identity_type = None # type: Optional[str] @@ -210,21 +207,17 @@ class AmlToken(IdentityConfiguration): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AmlToken, self).__init__(**kwargs) - self.identity_type = 'AMLToken' # type: str + self.identity_type = "AMLToken" # type: str class ResourceBase(msrest.serialization.Model): @@ -239,9 +232,9 @@ class ResourceBase(msrest.serialization.Model): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, } def __init__( @@ -282,11 +275,11 @@ class AssetBase(ResourceBase): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, } def __init__( @@ -311,7 +304,9 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(AssetBase, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + super(AssetBase, self).__init__( + description=description, properties=properties, tags=tags, **kwargs + ) self.is_anonymous = is_anonymous self.is_archived = is_archived @@ -336,17 +331,17 @@ class AssetContainer(ResourceBase): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, } def __init__( @@ -368,7 +363,9 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(AssetContainer, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + super(AssetContainer, self).__init__( + description=description, properties=properties, tags=tags, **kwargs + ) self.is_archived = is_archived self.latest_version = None self.next_version = None @@ -387,12 +384,12 @@ class AssetJobInput(msrest.serialization.Model): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, } def __init__( @@ -424,8 +421,8 @@ class AssetJobOutput(msrest.serialization.Model): """ _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, } def __init__( @@ -460,23 +457,23 @@ class AssetReferenceBase(msrest.serialization.Model): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, } _subtype_map = { - 'reference_type': {'DataPath': 'DataPathAssetReference', 'Id': 'IdAssetReference', 'OutputPath': 'OutputPathAssetReference'} + "reference_type": { + "DataPath": "DataPathAssetReference", + "Id": "IdAssetReference", + "OutputPath": "OutputPathAssetReference", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AssetReferenceBase, self).__init__(**kwargs) self.reference_type = None # type: Optional[str] @@ -495,23 +492,22 @@ class ForecastHorizon(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoForecastHorizon', 'Custom': 'CustomForecastHorizon'} + "mode": { + "Auto": "AutoForecastHorizon", + "Custom": "CustomForecastHorizon", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ForecastHorizon, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -527,21 +523,17 @@ class AutoForecastHorizon(ForecastHorizon): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoForecastHorizon, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class JobBaseDetails(ResourceBase): @@ -589,27 +581,32 @@ class JobBaseDetails(ResourceBase): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, + "job_type": {"required": True}, + "status": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'ScheduleBase'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "schedule": {"key": "schedule", "type": "ScheduleBase"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, } _subtype_map = { - 'job_type': {'AutoML': 'AutoMLJob', 'Command': 'CommandJob', 'Pipeline': 'PipelineJob', 'Sweep': 'SweepJob'} + "job_type": { + "AutoML": "AutoMLJob", + "Command": "CommandJob", + "Pipeline": "PipelineJob", + "Sweep": "SweepJob", + } } def __init__( @@ -654,13 +651,15 @@ def __init__( For local jobs, a job endpoint will have an endpoint value of FileStreamObject. :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] """ - super(JobBaseDetails, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + super(JobBaseDetails, self).__init__( + description=description, properties=properties, tags=tags, **kwargs + ) self.compute_id = compute_id self.display_name = display_name self.experiment_name = experiment_name self.identity = identity self.is_archived = is_archived - self.job_type = 'JobBaseDetails' # type: str + self.job_type = "JobBaseDetails" # type: str self.schedule = schedule self.services = services self.status = None @@ -668,84 +667,87 @@ def __init__( class AutoMLJob(JobBaseDetails): """AutoMLJob class. -Use this class for executing AutoML tasks like Classification/Regression etc. -See TaskType enum for all the tasks supported. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Sweep", "Pipeline". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar schedule: Schedule definition of job. - If no schedule is provided, the job is run once and immediately after submission. - :vartype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar environment_id: The ARM resource ID of the Environment specification for the job. - This is optional value to provide, if not provided, AutoML will default this to Production - AutoML curated environment version when running the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.ResourceConfiguration - :ivar task_details: Required. [Required] This represents scenario which can be one of - Tables/NLP/Image. - :vartype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical + Use this class for executing AutoML tasks like Classification/Regression etc. + See TaskType enum for all the tasks supported. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar description: The asset description text. + :vartype description: str + :ivar properties: The asset property dictionary. + :vartype properties: dict[str, str] + :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + :ivar compute_id: ARM resource ID of the compute resource. + :vartype compute_id: str + :ivar display_name: Display name of job. + :vartype display_name: str + :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is + placed in the "Default" experiment. + :vartype experiment_name: str + :ivar identity: Identity configuration. If set, this should be one of AmlToken, + ManagedIdentity, UserIdentity or null. + Defaults to AmlToken if null. + :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration + :ivar is_archived: Is the asset archived?. + :vartype is_archived: bool + :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. + Possible values include: "AutoML", "Command", "Sweep", "Pipeline". + :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType + :ivar schedule: Schedule definition of job. + If no schedule is provided, the job is run once and immediately after submission. + :vartype schedule: ~azure.mgmt.machinelearningservices.models.ScheduleBase + :ivar services: List of JobEndpoints. + For local jobs, a job endpoint will have an endpoint value of FileStreamObject. + :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] + :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", + "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", + "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". + :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus + :ivar environment_id: The ARM resource ID of the Environment specification for the job. + This is optional value to provide, if not provided, AutoML will default this to Production + AutoML curated environment version when running the job. + :vartype environment_id: str + :ivar environment_variables: Environment variables included in the job. + :vartype environment_variables: dict[str, str] + :ivar outputs: Mapping of output data bindings used in the job. + :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] + :ivar resources: Compute Resource configuration for the job. + :vartype resources: ~azure.mgmt.machinelearningservices.models.ResourceConfiguration + :ivar task_details: Required. [Required] This represents scenario which can be one of + Tables/NLP/Image. + :vartype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'task_details': {'required': True}, + "job_type": {"required": True}, + "status": {"readonly": True}, + "task_details": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'ScheduleBase'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'resources': {'key': 'resources', 'type': 'ResourceConfiguration'}, - 'task_details': {'key': 'taskDetails', 'type': 'AutoMLVertical'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "schedule": {"key": "schedule", "type": "ScheduleBase"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "resources": {"key": "resources", "type": "ResourceConfiguration"}, + "task_details": {"key": "taskDetails", "type": "AutoMLVertical"}, } def __init__( @@ -808,8 +810,20 @@ def __init__( Tables/NLP/Image. :paramtype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical """ - super(AutoMLJob, self).__init__(description=description, properties=properties, tags=tags, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, schedule=schedule, services=services, **kwargs) - self.job_type = 'AutoML' # type: str + super(AutoMLJob, self).__init__( + description=description, + properties=properties, + tags=tags, + compute_id=compute_id, + display_name=display_name, + experiment_name=experiment_name, + identity=identity, + is_archived=is_archived, + schedule=schedule, + services=services, + **kwargs + ) + self.job_type = "AutoML" # type: str self.environment_id = environment_id self.environment_variables = environment_variables self.outputs = outputs @@ -819,34 +833,45 @@ def __init__( class AutoMLVertical(msrest.serialization.Model): """AutoML vertical class. -Base class for AutoML verticals - TableVertical/ImageVertical/NLPVertical. + Base class for AutoML verticals - TableVertical/ImageVertical/NLPVertical. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Classification, Forecasting, ImageClassification, ImageClassificationMultilabel, ImageInstanceSegmentation, ImageObjectDetection, Regression, TextClassification, TextClassificationMultilabel, TextNer. + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Classification, Forecasting, ImageClassification, ImageClassificationMultilabel, ImageInstanceSegmentation, ImageObjectDetection, Regression, TextClassification, TextClassificationMultilabel, TextNer. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType """ _validation = { - 'task_type': {'required': True}, + "task_type": {"required": True}, } _attribute_map = { - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, } _subtype_map = { - 'task_type': {'Classification': 'Classification', 'Forecasting': 'Forecasting', 'ImageClassification': 'ImageClassification', 'ImageClassificationMultilabel': 'ImageClassificationMultilabel', 'ImageInstanceSegmentation': 'ImageInstanceSegmentation', 'ImageObjectDetection': 'ImageObjectDetection', 'Regression': 'Regression', 'TextClassification': 'TextClassification', 'TextClassificationMultilabel': 'TextClassificationMultilabel', 'TextNER': 'TextNer'} + "task_type": { + "Classification": "Classification", + "Forecasting": "Forecasting", + "ImageClassification": "ImageClassification", + "ImageClassificationMultilabel": "ImageClassificationMultilabel", + "ImageInstanceSegmentation": "ImageInstanceSegmentation", + "ImageObjectDetection": "ImageObjectDetection", + "Regression": "Regression", + "TextClassification": "TextClassification", + "TextClassificationMultilabel": "TextClassificationMultilabel", + "TextNER": "TextNer", + } } def __init__( @@ -879,23 +904,22 @@ class NCrossValidations(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoNCrossValidations', 'Custom': 'CustomNCrossValidations'} + "mode": { + "Auto": "AutoNCrossValidations", + "Custom": "CustomNCrossValidations", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NCrossValidations, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -911,21 +935,17 @@ class AutoNCrossValidations(NCrossValidations): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoNCrossValidations, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class Seasonality(msrest.serialization.Model): @@ -942,23 +962,19 @@ class Seasonality(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoSeasonality', 'Custom': 'CustomSeasonality'} + "mode": {"Auto": "AutoSeasonality", "Custom": "CustomSeasonality"} } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Seasonality, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -974,21 +990,17 @@ class AutoSeasonality(Seasonality): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoSeasonality, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class TargetLags(msrest.serialization.Model): @@ -1005,23 +1017,19 @@ class TargetLags(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoTargetLags', 'Custom': 'CustomTargetLags'} + "mode": {"Auto": "AutoTargetLags", "Custom": "CustomTargetLags"} } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(TargetLags, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -1037,21 +1045,17 @@ class AutoTargetLags(TargetLags): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoTargetLags, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class TargetRollingWindowSize(msrest.serialization.Model): @@ -1068,23 +1072,22 @@ class TargetRollingWindowSize(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoTargetRollingWindowSize', 'Custom': 'CustomTargetRollingWindowSize'} + "mode": { + "Auto": "AutoTargetRollingWindowSize", + "Custom": "CustomTargetRollingWindowSize", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(TargetRollingWindowSize, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -1100,21 +1103,17 @@ class AutoTargetRollingWindowSize(TargetRollingWindowSize): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class DatastoreDetails(ResourceBase): @@ -1145,22 +1144,28 @@ class DatastoreDetails(ResourceBase): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, } _subtype_map = { - 'datastore_type': {'AzureBlob': 'AzureBlobDatastore', 'AzureDataLakeGen1': 'AzureDataLakeGen1Datastore', 'AzureDataLakeGen2': 'AzureDataLakeGen2Datastore', 'AzureFile': 'AzureFileDatastore', 'Hdfs': 'HdfsDatastore'} + "datastore_type": { + "AzureBlob": "AzureBlobDatastore", + "AzureDataLakeGen1": "AzureDataLakeGen1Datastore", + "AzureDataLakeGen2": "AzureDataLakeGen2Datastore", + "AzureFile": "AzureFileDatastore", + "Hdfs": "HdfsDatastore", + } } def __init__( @@ -1182,9 +1187,11 @@ def __init__( :keyword credentials: Required. [Required] Account credentials. :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials """ - super(DatastoreDetails, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + super(DatastoreDetails, self).__init__( + description=description, properties=properties, tags=tags, **kwargs + ) self.credentials = credentials - self.datastore_type = 'DatastoreDetails' # type: str + self.datastore_type = "DatastoreDetails" # type: str self.is_default = None @@ -1226,23 +1233,26 @@ class AzureBlobDatastore(DatastoreDetails): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "account_name": {"key": "accountName", "type": "str"}, + "container_name": {"key": "containerName", "type": "str"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } def __init__( @@ -1256,7 +1266,9 @@ def __init__( container_name: Optional[str] = None, endpoint: Optional[str] = None, protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, + service_data_access_auth_identity: Optional[ + Union[str, "ServiceDataAccessAuthIdentity"] + ] = None, **kwargs ): """ @@ -1282,13 +1294,21 @@ def __init__( :paramtype service_data_access_auth_identity: str or ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ - super(AzureBlobDatastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, **kwargs) - self.datastore_type = 'AzureBlob' # type: str + super(AzureBlobDatastore, self).__init__( + description=description, + properties=properties, + tags=tags, + credentials=credentials, + **kwargs + ) + self.datastore_type = "AzureBlob" # type: str self.account_name = account_name self.container_name = container_name self.endpoint = endpoint self.protocol = protocol - self.service_data_access_auth_identity = service_data_access_auth_identity + self.service_data_access_auth_identity = ( + service_data_access_auth_identity + ) class AzureDataLakeGen1Datastore(DatastoreDetails): @@ -1323,21 +1343,24 @@ class AzureDataLakeGen1Datastore(DatastoreDetails): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'store_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "store_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - 'store_name': {'key': 'storeName', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, + "store_name": {"key": "storeName", "type": "str"}, } def __init__( @@ -1348,7 +1371,9 @@ def __init__( description: Optional[str] = None, properties: Optional[Dict[str, str]] = None, tags: Optional[Dict[str, str]] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, + service_data_access_auth_identity: Optional[ + Union[str, "ServiceDataAccessAuthIdentity"] + ] = None, **kwargs ): """ @@ -1368,9 +1393,17 @@ def __init__( :keyword store_name: Required. [Required] Azure Data Lake store name. :paramtype store_name: str """ - super(AzureDataLakeGen1Datastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, **kwargs) - self.datastore_type = 'AzureDataLakeGen1' # type: str - self.service_data_access_auth_identity = service_data_access_auth_identity + super(AzureDataLakeGen1Datastore, self).__init__( + description=description, + properties=properties, + tags=tags, + credentials=credentials, + **kwargs + ) + self.datastore_type = "AzureDataLakeGen1" # type: str + self.service_data_access_auth_identity = ( + service_data_access_auth_identity + ) self.store_name = store_name @@ -1412,25 +1445,28 @@ class AzureDataLakeGen2Datastore(DatastoreDetails): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'filesystem': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "account_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "filesystem": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'filesystem': {'key': 'filesystem', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "account_name": {"key": "accountName", "type": "str"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "filesystem": {"key": "filesystem", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } def __init__( @@ -1444,7 +1480,9 @@ def __init__( tags: Optional[Dict[str, str]] = None, endpoint: Optional[str] = None, protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, + service_data_access_auth_identity: Optional[ + Union[str, "ServiceDataAccessAuthIdentity"] + ] = None, **kwargs ): """ @@ -1470,13 +1508,21 @@ def __init__( :paramtype service_data_access_auth_identity: str or ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ - super(AzureDataLakeGen2Datastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, **kwargs) - self.datastore_type = 'AzureDataLakeGen2' # type: str + super(AzureDataLakeGen2Datastore, self).__init__( + description=description, + properties=properties, + tags=tags, + credentials=credentials, + **kwargs + ) + self.datastore_type = "AzureDataLakeGen2" # type: str self.account_name = account_name self.endpoint = endpoint self.filesystem = filesystem self.protocol = protocol - self.service_data_access_auth_identity = service_data_access_auth_identity + self.service_data_access_auth_identity = ( + service_data_access_auth_identity + ) class AzureFileDatastore(DatastoreDetails): @@ -1518,25 +1564,28 @@ class AzureFileDatastore(DatastoreDetails): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'file_share_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "account_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "file_share_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'file_share_name': {'key': 'fileShareName', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "account_name": {"key": "accountName", "type": "str"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "file_share_name": {"key": "fileShareName", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } def __init__( @@ -1550,7 +1599,9 @@ def __init__( tags: Optional[Dict[str, str]] = None, endpoint: Optional[str] = None, protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, + service_data_access_auth_identity: Optional[ + Union[str, "ServiceDataAccessAuthIdentity"] + ] = None, **kwargs ): """ @@ -1577,13 +1628,21 @@ def __init__( :paramtype service_data_access_auth_identity: str or ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ - super(AzureFileDatastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, **kwargs) - self.datastore_type = 'AzureFile' # type: str + super(AzureFileDatastore, self).__init__( + description=description, + properties=properties, + tags=tags, + credentials=credentials, + **kwargs + ) + self.datastore_type = "AzureFile" # type: str self.account_name = account_name self.endpoint = endpoint self.file_share_name = file_share_name self.protocol = protocol - self.service_data_access_auth_identity = service_data_access_auth_identity + self.service_data_access_auth_identity = ( + service_data_access_auth_identity + ) class EarlyTerminationPolicy(msrest.serialization.Model): @@ -1605,17 +1664,21 @@ class EarlyTerminationPolicy(msrest.serialization.Model): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, } _subtype_map = { - 'policy_type': {'Bandit': 'BanditPolicy', 'MedianStopping': 'MedianStoppingPolicy', 'TruncationSelection': 'TruncationSelectionPolicy'} + "policy_type": { + "Bandit": "BanditPolicy", + "MedianStopping": "MedianStoppingPolicy", + "TruncationSelection": "TruncationSelectionPolicy", + } } def __init__( @@ -1657,15 +1720,15 @@ class BanditPolicy(EarlyTerminationPolicy): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'slack_amount': {'key': 'slackAmount', 'type': 'float'}, - 'slack_factor': {'key': 'slackFactor', 'type': 'float'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, + "slack_amount": {"key": "slackAmount", "type": "float"}, + "slack_factor": {"key": "slackFactor", "type": "float"}, } def __init__( @@ -1687,8 +1750,12 @@ def __init__( :keyword slack_factor: Ratio of the allowed distance from the best performing run. :paramtype slack_factor: float """ - super(BanditPolicy, self).__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs) - self.policy_type = 'Bandit' # type: str + super(BanditPolicy, self).__init__( + delay_evaluation=delay_evaluation, + evaluation_interval=evaluation_interval, + **kwargs + ) + self.policy_type = "Bandit" # type: str self.slack_amount = slack_amount self.slack_factor = slack_factor @@ -1712,25 +1779,21 @@ class Resource(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -1763,28 +1826,24 @@ class TrackedResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, } def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - **kwargs + self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs ): """ :keyword tags: A set of tags. Resource tags. @@ -1831,25 +1890,25 @@ class BatchDeploymentData(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchDeploymentDetails'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": {"key": "properties", "type": "BatchDeploymentDetails"}, + "sku": {"key": "sku", "type": "Sku"}, } def __init__( @@ -1878,7 +1937,9 @@ def __init__( :keyword sku: Sku details required for ARM contract for Autoscaling. :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ - super(BatchDeploymentData, self).__init__(tags=tags, location=location, **kwargs) + super(BatchDeploymentData, self).__init__( + tags=tags, location=location, **kwargs + ) self.identity = identity self.kind = kind self.properties = properties @@ -1902,11 +1963,17 @@ class EndpointDeploymentPropertiesBase(msrest.serialization.Model): """ _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, } def __init__( @@ -1994,26 +2061,38 @@ class BatchDeploymentDetails(EndpointDeploymentPropertiesBase): """ _validation = { - 'provisioning_state': {'readonly': True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'error_threshold': {'key': 'errorThreshold', 'type': 'int'}, - 'logging_level': {'key': 'loggingLevel', 'type': 'str'}, - 'max_concurrency_per_instance': {'key': 'maxConcurrencyPerInstance', 'type': 'int'}, - 'mini_batch_size': {'key': 'miniBatchSize', 'type': 'long'}, - 'model': {'key': 'model', 'type': 'AssetReferenceBase'}, - 'output_action': {'key': 'outputAction', 'type': 'str'}, - 'output_file_name': {'key': 'outputFileName', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'resources': {'key': 'resources', 'type': 'ResourceConfiguration'}, - 'retry_settings': {'key': 'retrySettings', 'type': 'BatchRetrySettings'}, + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "compute": {"key": "compute", "type": "str"}, + "error_threshold": {"key": "errorThreshold", "type": "int"}, + "logging_level": {"key": "loggingLevel", "type": "str"}, + "max_concurrency_per_instance": { + "key": "maxConcurrencyPerInstance", + "type": "int", + }, + "mini_batch_size": {"key": "miniBatchSize", "type": "long"}, + "model": {"key": "model", "type": "AssetReferenceBase"}, + "output_action": {"key": "outputAction", "type": "str"}, + "output_file_name": {"key": "outputFileName", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "resources": {"key": "resources", "type": "ResourceConfiguration"}, + "retry_settings": { + "key": "retrySettings", + "type": "BatchRetrySettings", + }, } def __init__( @@ -2080,7 +2159,14 @@ def __init__( If not provided, will default to the defaults defined in BatchRetrySettings. :paramtype retry_settings: ~azure.mgmt.machinelearningservices.models.BatchRetrySettings """ - super(BatchDeploymentDetails, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, **kwargs) + super(BatchDeploymentDetails, self).__init__( + code_configuration=code_configuration, + description=description, + environment_id=environment_id, + environment_variables=environment_variables, + properties=properties, + **kwargs + ) self.compute = compute self.error_threshold = error_threshold self.logging_level = logging_level @@ -2094,7 +2180,9 @@ def __init__( self.retry_settings = retry_settings -class BatchDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class BatchDeploymentTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of BatchDeployment entities. :ivar next_link: The link to the next page of BatchDeployment objects. If null, there are no @@ -2105,8 +2193,8 @@ class BatchDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Mode """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchDeploymentData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[BatchDeploymentData]"}, } def __init__( @@ -2123,7 +2211,9 @@ def __init__( :keyword value: An array of objects of type BatchDeployment. :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchDeploymentData] """ - super(BatchDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) + super(BatchDeploymentTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -2162,25 +2252,25 @@ class BatchEndpointData(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchEndpointDetails'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": {"key": "properties", "type": "BatchEndpointDetails"}, + "sku": {"key": "sku", "type": "Sku"}, } def __init__( @@ -2209,7 +2299,9 @@ def __init__( :keyword sku: Sku details required for ARM contract for Autoscaling. :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ - super(BatchEndpointData, self).__init__(tags=tags, location=location, **kwargs) + super(BatchEndpointData, self).__init__( + tags=tags, location=location, **kwargs + ) self.identity = identity self.kind = kind self.properties = properties @@ -2225,15 +2317,10 @@ class BatchEndpointDefaults(msrest.serialization.Model): """ _attribute_map = { - 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, + "deployment_name": {"key": "deploymentName", "type": "str"}, } - def __init__( - self, - *, - deployment_name: Optional[str] = None, - **kwargs - ): + def __init__(self, *, deployment_name: Optional[str] = None, **kwargs): """ :keyword deployment_name: Name of the deployment that will be default for the endpoint. This deployment will end up getting 100% traffic when the endpoint scoring URL is invoked. @@ -2269,18 +2356,18 @@ class EndpointPropertiesBase(msrest.serialization.Model): """ _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, + "auth_mode": {"required": True}, + "scoring_uri": {"readonly": True}, + "swagger_uri": {"readonly": True}, } _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, + "auth_mode": {"key": "authMode", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "keys": {"key": "keys", "type": "EndpointAuthKeys"}, + "properties": {"key": "properties", "type": "{str}"}, + "scoring_uri": {"key": "scoringUri", "type": "str"}, + "swagger_uri": {"key": "swaggerUri", "type": "str"}, } def __init__( @@ -2347,21 +2434,21 @@ class BatchEndpointDetails(EndpointPropertiesBase): """ _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "auth_mode": {"required": True}, + "scoring_uri": {"readonly": True}, + "swagger_uri": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'defaults': {'key': 'defaults', 'type': 'BatchEndpointDefaults'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "auth_mode": {"key": "authMode", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "keys": {"key": "keys", "type": "EndpointAuthKeys"}, + "properties": {"key": "properties", "type": "{str}"}, + "scoring_uri": {"key": "scoringUri", "type": "str"}, + "swagger_uri": {"key": "swaggerUri", "type": "str"}, + "defaults": {"key": "defaults", "type": "BatchEndpointDefaults"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } def __init__( @@ -2390,12 +2477,20 @@ def __init__( :keyword defaults: Default values for Batch Endpoint. :paramtype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults """ - super(BatchEndpointDetails, self).__init__(auth_mode=auth_mode, description=description, keys=keys, properties=properties, **kwargs) + super(BatchEndpointDetails, self).__init__( + auth_mode=auth_mode, + description=description, + keys=keys, + properties=properties, + **kwargs + ) self.defaults = defaults self.provisioning_state = None -class BatchEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class BatchEndpointTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of BatchEndpoint entities. :ivar next_link: The link to the next page of BatchEndpoint objects. If null, there are no @@ -2406,8 +2501,8 @@ class BatchEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model) """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchEndpointData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[BatchEndpointData]"}, } def __init__( @@ -2424,7 +2519,9 @@ def __init__( :keyword value: An array of objects of type BatchEndpoint. :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchEndpointData] """ - super(BatchEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) + super(BatchEndpointTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -2439,8 +2536,8 @@ class BatchRetrySettings(msrest.serialization.Model): """ _attribute_map = { - 'max_retries': {'key': 'maxRetries', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "max_retries": {"key": "maxRetries", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } def __init__( @@ -2463,38 +2560,41 @@ def __init__( class SamplingAlgorithm(msrest.serialization.Model): """The Sampling Algorithm used to generate hyperparameter values, along with properties to -configure the algorithm. + configure the algorithm. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BayesianSamplingAlgorithm, GridSamplingAlgorithm, RandomSamplingAlgorithm. + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: BayesianSamplingAlgorithm, GridSamplingAlgorithm, RandomSamplingAlgorithm. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType + :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating + hyperparameter values, along with configuration properties.Constant filled by server. Possible + values include: "Grid", "Random", "Bayesian". + :vartype sampling_algorithm_type: str or + ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } _subtype_map = { - 'sampling_algorithm_type': {'Bayesian': 'BayesianSamplingAlgorithm', 'Grid': 'GridSamplingAlgorithm', 'Random': 'RandomSamplingAlgorithm'} + "sampling_algorithm_type": { + "Bayesian": "BayesianSamplingAlgorithm", + "Grid": "GridSamplingAlgorithm", + "Random": "RandomSamplingAlgorithm", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(SamplingAlgorithm, self).__init__(**kwargs) self.sampling_algorithm_type = None # type: Optional[str] @@ -2512,21 +2612,20 @@ class BayesianSamplingAlgorithm(SamplingAlgorithm): """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(BayesianSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Bayesian' # type: str + self.sampling_algorithm_type = "Bayesian" # type: str class BuildContext(msrest.serialization.Model): @@ -2536,29 +2635,29 @@ class BuildContext(msrest.serialization.Model): :ivar context_uri: Required. [Required] URI of the Docker build context used to build the image. Supports blob URIs on environment creation and may return blob or Git URIs. - - + + .. raw:: html - + . :vartype context_uri: str :ivar dockerfile_path: Path to the Dockerfile in the build context. - - + + .. raw:: html - + . :vartype dockerfile_path: str """ _validation = { - 'context_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "context_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'context_uri': {'key': 'contextUri', 'type': 'str'}, - 'dockerfile_path': {'key': 'dockerfilePath', 'type': 'str'}, + "context_uri": {"key": "contextUri", "type": "str"}, + "dockerfile_path": {"key": "dockerfilePath", "type": "str"}, } def __init__( @@ -2571,18 +2670,18 @@ def __init__( """ :keyword context_uri: Required. [Required] URI of the Docker build context used to build the image. Supports blob URIs on environment creation and may return blob or Git URIs. - - + + .. raw:: html - + . :paramtype context_uri: str :keyword dockerfile_path: Path to the Dockerfile in the build context. - - + + .. raw:: html - + . :paramtype dockerfile_path: str """ @@ -2615,21 +2714,21 @@ class CertificateDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, - 'thumbprint': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials_type": {"required": True}, + "client_id": {"required": True}, + "secrets": {"required": True}, + "tenant_id": {"required": True}, + "thumbprint": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'CertificateDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "authority_url": {"key": "authorityUrl", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + "resource_url": {"key": "resourceUrl", "type": "str"}, + "secrets": {"key": "secrets", "type": "CertificateDatastoreSecrets"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "thumbprint": {"key": "thumbprint", "type": "str"}, } def __init__( @@ -2660,7 +2759,7 @@ def __init__( :paramtype thumbprint: str """ super(CertificateDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Certificate' # type: str + self.credentials_type = "Certificate" # type: str self.authority_url = authority_url self.client_id = client_id self.resource_url = resource_url @@ -2683,26 +2782,21 @@ class CertificateDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'certificate': {'key': 'certificate', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "certificate": {"key": "certificate", "type": "str"}, } - def __init__( - self, - *, - certificate: Optional[str] = None, - **kwargs - ): + def __init__(self, *, certificate: Optional[str] = None, **kwargs): """ :keyword certificate: Service principal certificate. :paramtype certificate: str """ super(CertificateDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Certificate' # type: str + self.secrets_type = "Certificate" # type: str self.certificate = certificate @@ -2721,17 +2815,31 @@ class TableVertical(msrest.serialization.Model): """ _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'TableVerticalDataSettings'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'TrainingSettings'}, + "data_settings": { + "key": "dataSettings", + "type": "TableVerticalDataSettings", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "training_settings": { + "key": "trainingSettings", + "type": "TrainingSettings", + }, } def __init__( self, *, data_settings: Optional["TableVerticalDataSettings"] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "TableVerticalFeaturizationSettings" + ] = None, limit_settings: Optional["TableVerticalLimitSettings"] = None, training_settings: Optional["TrainingSettings"] = None, **kwargs @@ -2790,32 +2898,52 @@ class Classification(AutoMLVertical, TableVertical): """ _validation = { - 'task_type': {'required': True}, + "task_type": {"required": True}, } _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'TableVerticalDataSettings'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'TrainingSettings'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'allowed_models': {'key': 'allowedModels', 'type': '[str]'}, - 'blocked_models': {'key': 'blockedModels', 'type': '[str]'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "data_settings": { + "key": "dataSettings", + "type": "TableVerticalDataSettings", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "training_settings": { + "key": "trainingSettings", + "type": "TrainingSettings", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "allowed_models": {"key": "allowedModels", "type": "[str]"}, + "blocked_models": {"key": "blockedModels", "type": "[str]"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( self, *, data_settings: Optional["TableVerticalDataSettings"] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "TableVerticalFeaturizationSettings" + ] = None, limit_settings: Optional["TableVerticalLimitSettings"] = None, training_settings: Optional["TrainingSettings"] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - allowed_models: Optional[List[Union[str, "ClassificationModels"]]] = None, - blocked_models: Optional[List[Union[str, "ClassificationModels"]]] = None, - primary_metric: Optional[Union[str, "ClassificationPrimaryMetrics"]] = None, + allowed_models: Optional[ + List[Union[str, "ClassificationModels"]] + ] = None, + blocked_models: Optional[ + List[Union[str, "ClassificationModels"]] + ] = None, + primary_metric: Optional[ + Union[str, "ClassificationPrimaryMetrics"] + ] = None, **kwargs ): """ @@ -2843,17 +2971,24 @@ def __init__( :paramtype primary_metric: str or ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ - super(Classification, self).__init__(log_verbosity=log_verbosity, data_settings=data_settings, featurization_settings=featurization_settings, limit_settings=limit_settings, training_settings=training_settings, **kwargs) + super(Classification, self).__init__( + log_verbosity=log_verbosity, + data_settings=data_settings, + featurization_settings=featurization_settings, + limit_settings=limit_settings, + training_settings=training_settings, + **kwargs + ) self.data_settings = data_settings self.featurization_settings = featurization_settings self.limit_settings = limit_settings self.training_settings = training_settings - self.task_type = 'Classification' # type: str + self.task_type = "Classification" # type: str self.allowed_models = allowed_models self.blocked_models = blocked_models self.primary_metric = primary_metric self.log_verbosity = log_verbosity - self.task_type = 'Classification' # type: str + self.task_type = "Classification" # type: str self.allowed_models = allowed_models self.blocked_models = blocked_models self.primary_metric = primary_metric @@ -2871,20 +3006,20 @@ class CodeConfiguration(msrest.serialization.Model): """ _validation = { - 'scoring_script': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "scoring_script": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'scoring_script': {'key': 'scoringScript', 'type': 'str'}, + "code_id": {"key": "codeId", "type": "str"}, + "scoring_script": {"key": "scoringScript", "type": "str"}, } def __init__( - self, - *, - scoring_script: str, - code_id: Optional[str] = None, - **kwargs + self, *, scoring_script: str, code_id: Optional[str] = None, **kwargs ): """ :keyword code_id: ARM resource ID of the code asset. @@ -2920,27 +3055,22 @@ class CodeContainerData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeContainerDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "CodeContainerDetails"}, } - def __init__( - self, - *, - properties: "CodeContainerDetails", - **kwargs - ): + def __init__(self, *, properties: "CodeContainerDetails", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeContainerDetails @@ -2969,17 +3099,17 @@ class CodeContainerDetails(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, } def __init__( @@ -3001,7 +3131,13 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(CodeContainerDetails, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) + super(CodeContainerDetails, self).__init__( + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs + ) class CodeContainerResourceArmPaginatedResult(msrest.serialization.Model): @@ -3015,8 +3151,8 @@ class CodeContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeContainerData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[CodeContainerData]"}, } def __init__( @@ -3061,27 +3197,22 @@ class CodeVersionData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeVersionDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "CodeVersionDetails"}, } - def __init__( - self, - *, - properties: "CodeVersionDetails", - **kwargs - ): + def __init__(self, *, properties: "CodeVersionDetails", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeVersionDetails @@ -3108,12 +3239,12 @@ class CodeVersionDetails(AssetBase): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'code_uri': {'key': 'codeUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "code_uri": {"key": "codeUri", "type": "str"}, } def __init__( @@ -3141,7 +3272,14 @@ def __init__( :keyword code_uri: Uri where code is located. :paramtype code_uri: str """ - super(CodeVersionDetails, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) + super(CodeVersionDetails, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + **kwargs + ) self.code_uri = code_uri @@ -3156,8 +3294,8 @@ class CodeVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeVersionData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[CodeVersionData]"}, } def __init__( @@ -3190,8 +3328,8 @@ class ColumnTransformer(msrest.serialization.Model): """ _attribute_map = { - 'fields': {'key': 'fields', 'type': '[str]'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, + "fields": {"key": "fields", "type": "[str]"}, + "parameters": {"key": "parameters", "type": "object"}, } def __init__( @@ -3278,36 +3416,46 @@ class CommandJob(JobBaseDetails): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'parameters': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'ScheduleBase'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'CommandJobLimits'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, - 'resources': {'key': 'resources', 'type': 'ResourceConfiguration'}, + "job_type": {"required": True}, + "status": {"readonly": True}, + "command": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "environment_id": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "parameters": {"readonly": True}, + } + + _attribute_map = { + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "schedule": {"key": "schedule", "type": "ScheduleBase"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "code_id": {"key": "codeId", "type": "str"}, + "command": {"key": "command", "type": "str"}, + "distribution": { + "key": "distribution", + "type": "DistributionConfiguration", + }, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "limits": {"key": "limits", "type": "CommandJobLimits"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "parameters": {"key": "parameters", "type": "object"}, + "resources": {"key": "resources", "type": "ResourceConfiguration"}, } def __init__( @@ -3382,8 +3530,20 @@ def __init__( :keyword resources: Compute Resource configuration for the job. :paramtype resources: ~azure.mgmt.machinelearningservices.models.ResourceConfiguration """ - super(CommandJob, self).__init__(description=description, properties=properties, tags=tags, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, schedule=schedule, services=services, **kwargs) - self.job_type = 'Command' # type: str + super(CommandJob, self).__init__( + description=description, + properties=properties, + tags=tags, + compute_id=compute_id, + display_name=display_name, + experiment_name=experiment_name, + identity=identity, + is_archived=is_archived, + schedule=schedule, + services=services, + **kwargs + ) + self.job_type = "Command" # type: str self.code_id = code_id self.command = command self.distribution = distribution @@ -3413,23 +3573,23 @@ class JobLimits(msrest.serialization.Model): """ _validation = { - 'job_limits_type': {'required': True}, + "job_limits_type": {"required": True}, } _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "job_limits_type": {"key": "jobLimitsType", "type": "str"}, + "timeout": {"key": "timeout", "type": "duration"}, } _subtype_map = { - 'job_limits_type': {'Command': 'CommandJobLimits', 'Sweep': 'SweepJobLimits'} + "job_limits_type": { + "Command": "CommandJobLimits", + "Sweep": "SweepJobLimits", + } } def __init__( - self, - *, - timeout: Optional[datetime.timedelta] = None, - **kwargs + self, *, timeout: Optional[datetime.timedelta] = None, **kwargs ): """ :keyword timeout: The max run duration in ISO 8601 format, after which the job will be @@ -3455,19 +3615,16 @@ class CommandJobLimits(JobLimits): """ _validation = { - 'job_limits_type': {'required': True}, + "job_limits_type": {"required": True}, } _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "job_limits_type": {"key": "jobLimitsType", "type": "str"}, + "timeout": {"key": "timeout", "type": "duration"}, } def __init__( - self, - *, - timeout: Optional[datetime.timedelta] = None, - **kwargs + self, *, timeout: Optional[datetime.timedelta] = None, **kwargs ): """ :keyword timeout: The max run duration in ISO 8601 format, after which the job will be @@ -3475,7 +3632,7 @@ def __init__( :paramtype timeout: ~datetime.timedelta """ super(CommandJobLimits, self).__init__(timeout=timeout, **kwargs) - self.job_limits_type = 'Command' # type: str + self.job_limits_type = "Command" # type: str class ComponentContainerData(Resource): @@ -3501,27 +3658,25 @@ class ComponentContainerData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentContainerDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "ComponentContainerDetails", + }, } - def __init__( - self, - *, - properties: "ComponentContainerDetails", - **kwargs - ): + def __init__(self, *, properties: "ComponentContainerDetails", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentContainerDetails @@ -3534,38 +3689,38 @@ class ComponentContainerDetails(AssetContainer): """Component container definition. -.. raw:: html + .. raw:: html - . + . - Variables are only populated by the server, and will be ignored when sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str + :ivar description: The asset description text. + :vartype description: str + :ivar properties: The asset property dictionary. + :vartype properties: dict[str, str] + :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + :ivar is_archived: Is the asset archived?. + :vartype is_archived: bool + :ivar latest_version: The latest version inside this container. + :vartype latest_version: str + :ivar next_version: The next auto incremental version. + :vartype next_version: str """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, } def __init__( @@ -3587,7 +3742,13 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(ComponentContainerDetails, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) + super(ComponentContainerDetails, self).__init__( + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs + ) class ComponentContainerResourceArmPaginatedResult(msrest.serialization.Model): @@ -3601,8 +3762,8 @@ class ComponentContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentContainerData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ComponentContainerData]"}, } def __init__( @@ -3619,7 +3780,9 @@ def __init__( :keyword value: An array of objects of type ComponentContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainerData] """ - super(ComponentContainerResourceArmPaginatedResult, self).__init__(**kwargs) + super(ComponentContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -3647,27 +3810,22 @@ class ComponentVersionData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentVersionDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "ComponentVersionDetails"}, } - def __init__( - self, - *, - properties: "ComponentVersionDetails", - **kwargs - ): + def __init__(self, *, properties: "ComponentVersionDetails", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentVersionDetails @@ -3690,10 +3848,10 @@ class ComponentVersionDetails(AssetBase): :ivar is_archived: Is the asset archived?. :vartype is_archived: bool :ivar component_spec: Defines Component definition details. - - + + .. raw:: html - + . @@ -3701,12 +3859,12 @@ class ComponentVersionDetails(AssetBase): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'component_spec': {'key': 'componentSpec', 'type': 'object'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "component_spec": {"key": "componentSpec", "type": "object"}, } def __init__( @@ -3732,16 +3890,23 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool :keyword component_spec: Defines Component definition details. - - + + .. raw:: html - + . :paramtype component_spec: any """ - super(ComponentVersionDetails, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) + super(ComponentVersionDetails, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + **kwargs + ) self.component_spec = component_spec @@ -3756,8 +3921,8 @@ class ComponentVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentVersionData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ComponentVersionData]"}, } def __init__( @@ -3774,7 +3939,9 @@ def __init__( :keyword value: An array of objects of type ComponentVersion. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersionData] """ - super(ComponentVersionResourceArmPaginatedResult, self).__init__(**kwargs) + super(ComponentVersionResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -3791,15 +3958,25 @@ class ContainerResourceRequirements(msrest.serialization.Model): """ _attribute_map = { - 'container_resource_limits': {'key': 'containerResourceLimits', 'type': 'ContainerResourceSettings'}, - 'container_resource_requests': {'key': 'containerResourceRequests', 'type': 'ContainerResourceSettings'}, + "container_resource_limits": { + "key": "containerResourceLimits", + "type": "ContainerResourceSettings", + }, + "container_resource_requests": { + "key": "containerResourceRequests", + "type": "ContainerResourceSettings", + }, } def __init__( self, *, - container_resource_limits: Optional["ContainerResourceSettings"] = None, - container_resource_requests: Optional["ContainerResourceSettings"] = None, + container_resource_limits: Optional[ + "ContainerResourceSettings" + ] = None, + container_resource_requests: Optional[ + "ContainerResourceSettings" + ] = None, **kwargs ): """ @@ -3830,9 +4007,9 @@ class ContainerResourceSettings(msrest.serialization.Model): """ _attribute_map = { - 'cpu': {'key': 'cpu', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'memory': {'key': 'memory', 'type': 'str'}, + "cpu": {"key": "cpu", "type": "str"}, + "gpu": {"key": "gpu", "type": "str"}, + "memory": {"key": "memory", "type": "str"}, } def __init__( @@ -3885,19 +4062,22 @@ class ScheduleBase(msrest.serialization.Model): """ _validation = { - 'schedule_type': {'required': True}, + "schedule_type": {"required": True}, } _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'schedule_status': {'key': 'scheduleStatus', 'type': 'str'}, - 'schedule_type': {'key': 'scheduleType', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, + "end_time": {"key": "endTime", "type": "iso-8601"}, + "schedule_status": {"key": "scheduleStatus", "type": "str"}, + "schedule_type": {"key": "scheduleType", "type": "str"}, + "start_time": {"key": "startTime", "type": "iso-8601"}, + "time_zone": {"key": "timeZone", "type": "str"}, } _subtype_map = { - 'schedule_type': {'Cron': 'CronSchedule', 'Recurrence': 'RecurrenceSchedule'} + "schedule_type": { + "Cron": "CronSchedule", + "Recurrence": "RecurrenceSchedule", + } } def __init__( @@ -3955,17 +4135,17 @@ class CronSchedule(ScheduleBase): """ _validation = { - 'schedule_type': {'required': True}, - 'expression': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "schedule_type": {"required": True}, + "expression": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'schedule_status': {'key': 'scheduleStatus', 'type': 'str'}, - 'schedule_type': {'key': 'scheduleType', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, + "end_time": {"key": "endTime", "type": "iso-8601"}, + "schedule_status": {"key": "scheduleStatus", "type": "str"}, + "schedule_type": {"key": "scheduleType", "type": "str"}, + "start_time": {"key": "startTime", "type": "iso-8601"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "expression": {"key": "expression", "type": "str"}, } def __init__( @@ -3994,8 +4174,14 @@ def __init__( The expression should follow NCronTab format. :paramtype expression: str """ - super(CronSchedule, self).__init__(end_time=end_time, schedule_status=schedule_status, start_time=start_time, time_zone=time_zone, **kwargs) - self.schedule_type = 'Cron' # type: str + super(CronSchedule, self).__init__( + end_time=end_time, + schedule_status=schedule_status, + start_time=start_time, + time_zone=time_zone, + **kwargs + ) + self.schedule_type = "Cron" # type: str self.expression = expression @@ -4012,27 +4198,22 @@ class CustomForecastHorizon(ForecastHorizon): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - *, - value: int, - **kwargs - ): + def __init__(self, *, value: int, **kwargs): """ :keyword value: Required. [Required] Forecast horizon value. :paramtype value: int """ super(CustomForecastHorizon, self).__init__(**kwargs) - self.mode = 'Custom' # type: str + self.mode = "Custom" # type: str self.value = value @@ -4053,24 +4234,27 @@ class JobInput(msrest.serialization.Model): """ _validation = { - 'job_input_type': {'required': True}, + "job_input_type": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } _subtype_map = { - 'job_input_type': {'CustomModel': 'CustomModelJobInput', 'Literal': 'LiteralJobInput', 'MLFlowModel': 'MLFlowModelJobInput', 'MLTable': 'MLTableJobInput', 'TritonModel': 'TritonModelJobInput', 'UriFile': 'UriFileJobInput', 'UriFolder': 'UriFolderJobInput'} + "job_input_type": { + "CustomModel": "CustomModelJobInput", + "Literal": "LiteralJobInput", + "MLFlowModel": "MLFlowModelJobInput", + "MLTable": "MLTableJobInput", + "TritonModel": "TritonModelJobInput", + "UriFile": "UriFileJobInput", + "UriFolder": "UriFolderJobInput", + } } - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): + def __init__(self, *, description: Optional[str] = None, **kwargs): """ :keyword description: Description for the input. :paramtype description: str @@ -4099,15 +4283,15 @@ class CustomModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -4127,12 +4311,14 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(CustomModelJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(CustomModelJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'CustomModel' # type: str + self.job_input_type = "CustomModel" # type: str self.description = description - self.job_input_type = 'CustomModel' # type: str + self.job_input_type = "CustomModel" # type: str class JobOutput(msrest.serialization.Model): @@ -4152,24 +4338,26 @@ class JobOutput(msrest.serialization.Model): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } _subtype_map = { - 'job_output_type': {'CustomModel': 'CustomModelJobOutput', 'MLFlowModel': 'MLFlowModelJobOutput', 'MLTable': 'MLTableJobOutput', 'TritonModel': 'TritonModelJobOutput', 'UriFile': 'UriFileJobOutput', 'UriFolder': 'UriFolderJobOutput'} + "job_output_type": { + "CustomModel": "CustomModelJobOutput", + "MLFlowModel": "MLFlowModelJobOutput", + "MLTable": "MLTableJobOutput", + "TritonModel": "TritonModelJobOutput", + "UriFile": "UriFileJobOutput", + "UriFolder": "UriFolderJobOutput", + } } - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): + def __init__(self, *, description: Optional[str] = None, **kwargs): """ :keyword description: Description for the output. :paramtype description: str @@ -4197,14 +4385,14 @@ class CustomModelJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -4223,12 +4411,14 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(CustomModelJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(CustomModelJobOutput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_output_type = 'CustomModel' # type: str + self.job_output_type = "CustomModel" # type: str self.description = description - self.job_output_type = 'CustomModel' # type: str + self.job_output_type = "CustomModel" # type: str class CustomNCrossValidations(NCrossValidations): @@ -4244,27 +4434,22 @@ class CustomNCrossValidations(NCrossValidations): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - *, - value: int, - **kwargs - ): + def __init__(self, *, value: int, **kwargs): """ :keyword value: Required. [Required] N-Cross validations value. :paramtype value: int """ super(CustomNCrossValidations, self).__init__(**kwargs) - self.mode = 'Custom' # type: str + self.mode = "Custom" # type: str self.value = value @@ -4281,27 +4466,22 @@ class CustomSeasonality(Seasonality): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - *, - value: int, - **kwargs - ): + def __init__(self, *, value: int, **kwargs): """ :keyword value: Required. [Required] Seasonality value. :paramtype value: int """ super(CustomSeasonality, self).__init__(**kwargs) - self.mode = 'Custom' # type: str + self.mode = "Custom" # type: str self.value = value @@ -4318,27 +4498,22 @@ class CustomTargetLags(TargetLags): """ _validation = { - 'mode': {'required': True}, - 'values': {'required': True}, + "mode": {"required": True}, + "values": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[int]'}, + "mode": {"key": "mode", "type": "str"}, + "values": {"key": "values", "type": "[int]"}, } - def __init__( - self, - *, - values: List[int], - **kwargs - ): + def __init__(self, *, values: List[int], **kwargs): """ :keyword values: Required. [Required] Set target lags values. :paramtype values: list[int] """ super(CustomTargetLags, self).__init__(**kwargs) - self.mode = 'Custom' # type: str + self.mode = "Custom" # type: str self.values = values @@ -4355,27 +4530,22 @@ class CustomTargetRollingWindowSize(TargetRollingWindowSize): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - *, - value: int, - **kwargs - ): + def __init__(self, *, value: int, **kwargs): """ :keyword value: Required. [Required] TargetRollingWindowSize value. :paramtype value: int """ super(CustomTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Custom' # type: str + self.mode = "Custom" # type: str self.value = value @@ -4402,27 +4572,22 @@ class DataContainerData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataContainerDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "DataContainerDetails"}, } - def __init__( - self, - *, - properties: "DataContainerDetails", - **kwargs - ): + def __init__(self, *, properties: "DataContainerDetails", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataContainerDetails @@ -4456,19 +4621,19 @@ class DataContainerDetails(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'data_type': {'required': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "data_type": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "data_type": {"key": "dataType", "type": "str"}, } def __init__( @@ -4494,7 +4659,13 @@ def __init__( "UriFile", "UriFolder", "MLTable". :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType """ - super(DataContainerDetails, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) + super(DataContainerDetails, self).__init__( + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs + ) self.data_type = data_type @@ -4509,8 +4680,8 @@ class DataContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataContainerData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[DataContainerData]"}, } def __init__( @@ -4547,13 +4718,13 @@ class DataPathAssetReference(AssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'datastore_id': {'key': 'datastoreId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "datastore_id": {"key": "datastoreId", "type": "str"}, + "path": {"key": "path", "type": "str"}, } def __init__( @@ -4570,7 +4741,7 @@ def __init__( :paramtype path: str """ super(DataPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'DataPath' # type: str + self.reference_type = "DataPath" # type: str self.datastore_id = datastore_id self.path = path @@ -4591,14 +4762,17 @@ class DataSettings(msrest.serialization.Model): """ _validation = { - 'target_column_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'training_data': {'required': True}, + "target_column_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "training_data": {"required": True}, } _attribute_map = { - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'test_data': {'key': 'testData', 'type': 'TestDataSettings'}, - 'training_data': {'key': 'trainingData', 'type': 'TrainingDataSettings'}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "test_data": {"key": "testData", "type": "TestDataSettings"}, + "training_data": { + "key": "trainingData", + "type": "TrainingDataSettings", + }, } def __init__( @@ -4648,27 +4822,22 @@ class DatastoreData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DatastoreDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "DatastoreDetails"}, } - def __init__( - self, - *, - properties: "DatastoreDetails", - **kwargs - ): + def __init__(self, *, properties: "DatastoreDetails", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatastoreDetails @@ -4688,8 +4857,8 @@ class DatastoreResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DatastoreData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[DatastoreData]"}, } def __init__( @@ -4734,27 +4903,22 @@ class DataVersionBaseData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataVersionBaseDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "DataVersionBaseDetails"}, } - def __init__( - self, - *, - properties: "DataVersionBaseDetails", - **kwargs - ): + def __init__(self, *, properties: "DataVersionBaseDetails", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataVersionBaseDetails @@ -4790,22 +4954,26 @@ class DataVersionBaseDetails(AssetBase): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, } _subtype_map = { - 'data_type': {'MLTable': 'MLTableData', 'UriFile': 'UriFileDataVersion', 'UriFolder': 'UriFolderDataVersion'} + "data_type": { + "MLTable": "MLTableData", + "UriFile": "UriFileDataVersion", + "UriFolder": "UriFolderDataVersion", + } } def __init__( @@ -4834,8 +5002,15 @@ def __init__( Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20220201Preview.Assets.DataVersionBase.DataType. :paramtype data_uri: str """ - super(DataVersionBaseDetails, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.data_type = 'DataVersionBaseDetails' # type: str + super(DataVersionBaseDetails, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + **kwargs + ) + self.data_type = "DataVersionBaseDetails" # type: str self.data_uri = data_uri @@ -4850,8 +5025,8 @@ class DataVersionBaseResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataVersionBaseData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[DataVersionBaseData]"}, } def __init__( @@ -4868,7 +5043,9 @@ def __init__( :keyword value: An array of objects of type DataVersionBase. :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBaseData] """ - super(DataVersionBaseResourceArmPaginatedResult, self).__init__(**kwargs) + super(DataVersionBaseResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -4887,23 +5064,22 @@ class OnlineScaleSettings(msrest.serialization.Model): """ _validation = { - 'scale_type': {'required': True}, + "scale_type": {"required": True}, } _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, + "scale_type": {"key": "scaleType", "type": "str"}, } _subtype_map = { - 'scale_type': {'Default': 'DefaultScaleSettings', 'TargetUtilization': 'TargetUtilizationScaleSettings'} + "scale_type": { + "Default": "DefaultScaleSettings", + "TargetUtilization": "TargetUtilizationScaleSettings", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(OnlineScaleSettings, self).__init__(**kwargs) self.scale_type = None # type: Optional[str] @@ -4919,21 +5095,17 @@ class DefaultScaleSettings(OnlineScaleSettings): """ _validation = { - 'scale_type': {'required': True}, + "scale_type": {"required": True}, } _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, + "scale_type": {"key": "scaleType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DefaultScaleSettings, self).__init__(**kwargs) - self.scale_type = 'Default' # type: str + self.scale_type = "Default" # type: str class DeploymentLogs(msrest.serialization.Model): @@ -4944,15 +5116,10 @@ class DeploymentLogs(msrest.serialization.Model): """ _attribute_map = { - 'content': {'key': 'content', 'type': 'str'}, + "content": {"key": "content", "type": "str"}, } - def __init__( - self, - *, - content: Optional[str] = None, - **kwargs - ): + def __init__(self, *, content: Optional[str] = None, **kwargs): """ :keyword content: The retrieved online deployment logs. :paramtype content: str @@ -4972,8 +5139,8 @@ class DeploymentLogsRequest(msrest.serialization.Model): """ _attribute_map = { - 'container_type': {'key': 'containerType', 'type': 'str'}, - 'tail': {'key': 'tail', 'type': 'int'}, + "container_type": {"key": "containerType", "type": "str"}, + "tail": {"key": "tail", "type": "int"}, } def __init__( @@ -5009,23 +5176,23 @@ class DistributionConfiguration(msrest.serialization.Model): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, + "distribution_type": {"key": "distributionType", "type": "str"}, } _subtype_map = { - 'distribution_type': {'Mpi': 'Mpi', 'PyTorch': 'PyTorch', 'TensorFlow': 'TensorFlow'} + "distribution_type": { + "Mpi": "Mpi", + "PyTorch": "PyTorch", + "TensorFlow": "TensorFlow", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DistributionConfiguration, self).__init__(**kwargs) self.distribution_type = None # type: Optional[str] @@ -5040,8 +5207,8 @@ class EndpointAuthKeys(msrest.serialization.Model): """ _attribute_map = { - 'primary_key': {'key': 'primaryKey', 'type': 'str'}, - 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, + "primary_key": {"key": "primaryKey", "type": "str"}, + "secondary_key": {"key": "secondaryKey", "type": "str"}, } def __init__( @@ -5076,10 +5243,13 @@ class EndpointAuthToken(msrest.serialization.Model): """ _attribute_map = { - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'expiry_time_utc': {'key': 'expiryTimeUtc', 'type': 'long'}, - 'refresh_after_time_utc': {'key': 'refreshAfterTimeUtc', 'type': 'long'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, + "access_token": {"key": "accessToken", "type": "str"}, + "expiry_time_utc": {"key": "expiryTimeUtc", "type": "long"}, + "refresh_after_time_utc": { + "key": "refreshAfterTimeUtc", + "type": "long", + }, + "token_type": {"key": "tokenType", "type": "str"}, } def __init__( @@ -5131,27 +5301,25 @@ class EnvironmentContainerData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentContainerDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "EnvironmentContainerDetails", + }, } - def __init__( - self, - *, - properties: "EnvironmentContainerDetails", - **kwargs - ): + def __init__(self, *, properties: "EnvironmentContainerDetails", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerDetails @@ -5180,17 +5348,17 @@ class EnvironmentContainerDetails(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, } def __init__( @@ -5212,10 +5380,18 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(EnvironmentContainerDetails, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) + super(EnvironmentContainerDetails, self).__init__( + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs + ) -class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model): +class EnvironmentContainerResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of EnvironmentContainer entities. :ivar next_link: The link to the next page of EnvironmentContainer objects. If null, there are @@ -5226,8 +5402,8 @@ class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model) """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentContainerData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[EnvironmentContainerData]"}, } def __init__( @@ -5244,7 +5420,9 @@ def __init__( :keyword value: An array of objects of type EnvironmentContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainerData] """ - super(EnvironmentContainerResourceArmPaginatedResult, self).__init__(**kwargs) + super(EnvironmentContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -5272,27 +5450,25 @@ class EnvironmentVersionData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentVersionDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "EnvironmentVersionDetails", + }, } - def __init__( - self, - *, - properties: "EnvironmentVersionDetails", - **kwargs - ): + def __init__(self, *, properties: "EnvironmentVersionDetails", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionDetails @@ -5320,29 +5496,29 @@ class EnvironmentVersionDetails(AssetBase): :vartype build: ~azure.mgmt.machinelearningservices.models.BuildContext :ivar conda_file: Standard configuration file used by Conda that lets you install any kind of package, including Python, R, and C/C++ packages. - - + + .. raw:: html - + . :vartype conda_file: str :ivar environment_type: Environment type is either user managed or curated by the Azure ML service - - + + .. raw:: html - + . Possible values include: "Curated", "UserCreated". :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType :ivar image: Name of the image that will be used for the environment. - - + + .. raw:: html - + . @@ -5355,21 +5531,24 @@ class EnvironmentVersionDetails(AssetBase): """ _validation = { - 'environment_type': {'readonly': True}, + "environment_type": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'build': {'key': 'build', 'type': 'BuildContext'}, - 'conda_file': {'key': 'condaFile', 'type': 'str'}, - 'environment_type': {'key': 'environmentType', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'str'}, - 'inference_config': {'key': 'inferenceConfig', 'type': 'InferenceContainerProperties'}, - 'os_type': {'key': 'osType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "build": {"key": "build", "type": "BuildContext"}, + "conda_file": {"key": "condaFile", "type": "str"}, + "environment_type": {"key": "environmentType", "type": "str"}, + "image": {"key": "image", "type": "str"}, + "inference_config": { + "key": "inferenceConfig", + "type": "InferenceContainerProperties", + }, + "os_type": {"key": "osType", "type": "str"}, } def __init__( @@ -5402,19 +5581,19 @@ def __init__( :paramtype build: ~azure.mgmt.machinelearningservices.models.BuildContext :keyword conda_file: Standard configuration file used by Conda that lets you install any kind of package, including Python, R, and C/C++ packages. - - + + .. raw:: html - + . :paramtype conda_file: str :keyword image: Name of the image that will be used for the environment. - - + + .. raw:: html - + . @@ -5425,7 +5604,14 @@ def __init__( :keyword os_type: The OS type of the environment. Possible values include: "Linux", "Windows". :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.OperatingSystemType """ - super(EnvironmentVersionDetails, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) + super(EnvironmentVersionDetails, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + **kwargs + ) self.build = build self.conda_file = conda_file self.environment_type = None @@ -5445,8 +5631,8 @@ class EnvironmentVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentVersionData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[EnvironmentVersionData]"}, } def __init__( @@ -5463,7 +5649,9 @@ def __init__( :keyword value: An array of objects of type EnvironmentVersion. :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersionData] """ - super(EnvironmentVersionResourceArmPaginatedResult, self).__init__(**kwargs) + super(EnvironmentVersionResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -5480,21 +5668,17 @@ class ErrorAdditionalInfo(msrest.serialization.Model): """ _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, + "type": {"readonly": True}, + "info": {"readonly": True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, + "type": {"key": "type", "type": "str"}, + "info": {"key": "info", "type": "object"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ErrorAdditionalInfo, self).__init__(**kwargs) self.type = None self.info = None @@ -5518,27 +5702,26 @@ class ErrorDetail(msrest.serialization.Model): """ _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, + "code": {"readonly": True}, + "message": {"readonly": True}, + "target": {"readonly": True}, + "details": {"readonly": True}, + "additional_info": {"readonly": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[ErrorDetail]"}, + "additional_info": { + "key": "additionalInfo", + "type": "[ErrorAdditionalInfo]", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ErrorDetail, self).__init__(**kwargs) self.code = None self.message = None @@ -5555,15 +5738,10 @@ class ErrorResponse(msrest.serialization.Model): """ _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, + "error": {"key": "error", "type": "ErrorDetail"}, } - def __init__( - self, - *, - error: Optional["ErrorDetail"] = None, - **kwargs - ): + def __init__(self, *, error: Optional["ErrorDetail"] = None, **kwargs): """ :keyword error: The error object. :paramtype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail @@ -5580,15 +5758,10 @@ class FeaturizationSettings(msrest.serialization.Model): """ _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, + "dataset_language": {"key": "datasetLanguage", "type": "str"}, } - def __init__( - self, - *, - dataset_language: Optional[str] = None, - **kwargs - ): + def __init__(self, *, dataset_language: Optional[str] = None, **kwargs): """ :keyword dataset_language: Dataset language, useful for the text data. :paramtype dataset_language: str @@ -5605,15 +5778,10 @@ class FlavorData(msrest.serialization.Model): """ _attribute_map = { - 'data': {'key': 'data', 'type': '{str}'}, + "data": {"key": "data", "type": "{str}"}, } - def __init__( - self, - *, - data: Optional[Dict[str, str]] = None, - **kwargs - ): + def __init__(self, *, data: Optional[Dict[str, str]] = None, **kwargs): """ :keyword data: Model flavor-specific data. :paramtype data: dict[str, str] @@ -5660,34 +5828,53 @@ class Forecasting(AutoMLVertical, TableVertical): """ _validation = { - 'task_type': {'required': True}, + "task_type": {"required": True}, } _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'TableVerticalDataSettings'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'TrainingSettings'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'allowed_models': {'key': 'allowedModels', 'type': '[str]'}, - 'blocked_models': {'key': 'blockedModels', 'type': '[str]'}, - 'forecasting_settings': {'key': 'forecastingSettings', 'type': 'ForecastingSettings'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "data_settings": { + "key": "dataSettings", + "type": "TableVerticalDataSettings", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "training_settings": { + "key": "trainingSettings", + "type": "TrainingSettings", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "allowed_models": {"key": "allowedModels", "type": "[str]"}, + "blocked_models": {"key": "blockedModels", "type": "[str]"}, + "forecasting_settings": { + "key": "forecastingSettings", + "type": "ForecastingSettings", + }, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( self, *, data_settings: Optional["TableVerticalDataSettings"] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "TableVerticalFeaturizationSettings" + ] = None, limit_settings: Optional["TableVerticalLimitSettings"] = None, training_settings: Optional["TrainingSettings"] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, allowed_models: Optional[List[Union[str, "ForecastingModels"]]] = None, blocked_models: Optional[List[Union[str, "ForecastingModels"]]] = None, forecasting_settings: Optional["ForecastingSettings"] = None, - primary_metric: Optional[Union[str, "ForecastingPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "ForecastingPrimaryMetrics"] + ] = None, **kwargs ): """ @@ -5718,18 +5905,25 @@ def __init__( :paramtype primary_metric: str or ~azure.mgmt.machinelearningservices.models.ForecastingPrimaryMetrics """ - super(Forecasting, self).__init__(log_verbosity=log_verbosity, data_settings=data_settings, featurization_settings=featurization_settings, limit_settings=limit_settings, training_settings=training_settings, **kwargs) + super(Forecasting, self).__init__( + log_verbosity=log_verbosity, + data_settings=data_settings, + featurization_settings=featurization_settings, + limit_settings=limit_settings, + training_settings=training_settings, + **kwargs + ) self.data_settings = data_settings self.featurization_settings = featurization_settings self.limit_settings = limit_settings self.training_settings = training_settings - self.task_type = 'Forecasting' # type: str + self.task_type = "Forecasting" # type: str self.allowed_models = allowed_models self.blocked_models = blocked_models self.forecasting_settings = forecasting_settings self.primary_metric = primary_metric self.log_verbosity = log_verbosity - self.task_type = 'Forecasting' # type: str + self.task_type = "Forecasting" # type: str self.allowed_models = allowed_models self.blocked_models = blocked_models self.forecasting_settings = forecasting_settings @@ -5791,19 +5985,37 @@ class ForecastingSettings(msrest.serialization.Model): """ _attribute_map = { - 'country_or_region_for_holidays': {'key': 'countryOrRegionForHolidays', 'type': 'str'}, - 'cv_step_size': {'key': 'cvStepSize', 'type': 'int'}, - 'feature_lags': {'key': 'featureLags', 'type': 'str'}, - 'forecast_horizon': {'key': 'forecastHorizon', 'type': 'ForecastHorizon'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'seasonality': {'key': 'seasonality', 'type': 'Seasonality'}, - 'short_series_handling_config': {'key': 'shortSeriesHandlingConfig', 'type': 'str'}, - 'target_aggregate_function': {'key': 'targetAggregateFunction', 'type': 'str'}, - 'target_lags': {'key': 'targetLags', 'type': 'TargetLags'}, - 'target_rolling_window_size': {'key': 'targetRollingWindowSize', 'type': 'TargetRollingWindowSize'}, - 'time_column_name': {'key': 'timeColumnName', 'type': 'str'}, - 'time_series_id_column_names': {'key': 'timeSeriesIdColumnNames', 'type': '[str]'}, - 'use_stl': {'key': 'useStl', 'type': 'str'}, + "country_or_region_for_holidays": { + "key": "countryOrRegionForHolidays", + "type": "str", + }, + "cv_step_size": {"key": "cvStepSize", "type": "int"}, + "feature_lags": {"key": "featureLags", "type": "str"}, + "forecast_horizon": { + "key": "forecastHorizon", + "type": "ForecastHorizon", + }, + "frequency": {"key": "frequency", "type": "str"}, + "seasonality": {"key": "seasonality", "type": "Seasonality"}, + "short_series_handling_config": { + "key": "shortSeriesHandlingConfig", + "type": "str", + }, + "target_aggregate_function": { + "key": "targetAggregateFunction", + "type": "str", + }, + "target_lags": {"key": "targetLags", "type": "TargetLags"}, + "target_rolling_window_size": { + "key": "targetRollingWindowSize", + "type": "TargetRollingWindowSize", + }, + "time_column_name": {"key": "timeColumnName", "type": "str"}, + "time_series_id_column_names": { + "key": "timeSeriesIdColumnNames", + "type": "[str]", + }, + "use_stl": {"key": "useStl", "type": "str"}, } def __init__( @@ -5815,8 +6027,12 @@ def __init__( forecast_horizon: Optional["ForecastHorizon"] = None, frequency: Optional[str] = None, seasonality: Optional["Seasonality"] = None, - short_series_handling_config: Optional[Union[str, "ShortSeriesHandlingConfiguration"]] = None, - target_aggregate_function: Optional[Union[str, "TargetAggregationFunction"]] = None, + short_series_handling_config: Optional[ + Union[str, "ShortSeriesHandlingConfiguration"] + ] = None, + target_aggregate_function: Optional[ + Union[str, "TargetAggregationFunction"] + ] = None, target_lags: Optional["TargetLags"] = None, target_rolling_window_size: Optional["TargetRollingWindowSize"] = None, time_column_name: Optional[str] = None, @@ -5906,21 +6122,20 @@ class GridSamplingAlgorithm(SamplingAlgorithm): """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(GridSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Grid' # type: str + self.sampling_algorithm_type = "Grid" # type: str class HdfsDatastore(DatastoreDetails): @@ -5955,22 +6170,25 @@ class HdfsDatastore(DatastoreDetails): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'name_node_address': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "name_node_address": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'hdfs_server_certificate': {'key': 'hdfsServerCertificate', 'type': 'str'}, - 'name_node_address': {'key': 'nameNodeAddress', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "hdfs_server_certificate": { + "key": "hdfsServerCertificate", + "type": "str", + }, + "name_node_address": {"key": "nameNodeAddress", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, } def __init__( @@ -6002,8 +6220,14 @@ def __init__( :keyword protocol: Protocol used to communicate with the storage account (Https/Http). :paramtype protocol: str """ - super(HdfsDatastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, **kwargs) - self.datastore_type = 'Hdfs' # type: str + super(HdfsDatastore, self).__init__( + description=description, + properties=properties, + tags=tags, + credentials=credentials, + **kwargs + ) + self.datastore_type = "Hdfs" # type: str self.hdfs_server_certificate = hdfs_server_certificate self.name_node_address = name_node_address self.protocol = protocol @@ -6022,54 +6246,58 @@ class IdAssetReference(AssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, - 'asset_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "reference_type": {"required": True}, + "asset_id": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'asset_id': {'key': 'assetId', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "asset_id": {"key": "assetId", "type": "str"}, } - def __init__( - self, - *, - asset_id: str, - **kwargs - ): + def __init__(self, *, asset_id: str, **kwargs): """ :keyword asset_id: Required. [Required] ARM resource ID of the asset. :paramtype asset_id: str """ super(IdAssetReference, self).__init__(**kwargs) - self.reference_type = 'Id' # type: str + self.reference_type = "Id" # type: str self.asset_id = asset_id class ImageVertical(msrest.serialization.Model): """Abstract class for AutoML tasks that train image (computer vision) models - -such as Image Classification / Image Classification Multilabel / Image Object Detection / Image Instance Segmentation. + such as Image Classification / Image Classification Multilabel / Image Object Detection / Image Instance Segmentation. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and - other data settings required for training and validating models. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and + other data settings required for training and validating models. + :vartype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings """ _validation = { - 'data_settings': {'required': True}, - 'limit_settings': {'required': True}, + "data_settings": {"required": True}, + "limit_settings": {"required": True}, } _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'ImageVerticalDataSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, + "data_settings": { + "key": "dataSettings", + "type": "ImageVerticalDataSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, } def __init__( @@ -6117,16 +6345,31 @@ class ImageClassificationBase(ImageVertical): """ _validation = { - 'data_settings': {'required': True}, - 'limit_settings': {'required': True}, + "data_settings": {"required": True}, + "limit_settings": {"required": True}, } _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'ImageVerticalDataSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, + "data_settings": { + "key": "dataSettings", + "type": "ImageVerticalDataSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsClassification", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsClassification]", + }, } def __init__( @@ -6136,7 +6379,9 @@ def __init__( limit_settings: "ImageLimitSettings", sweep_settings: Optional["ImageSweepSettings"] = None, model_settings: Optional["ImageModelSettingsClassification"] = None, - search_space: Optional[List["ImageModelDistributionSettingsClassification"]] = None, + search_space: Optional[ + List["ImageModelDistributionSettingsClassification"] + ] = None, **kwargs ): """ @@ -6155,61 +6400,81 @@ def __init__( :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] """ - super(ImageClassificationBase, self).__init__(data_settings=data_settings, limit_settings=limit_settings, sweep_settings=sweep_settings, **kwargs) + super(ImageClassificationBase, self).__init__( + data_settings=data_settings, + limit_settings=limit_settings, + sweep_settings=sweep_settings, + **kwargs + ) self.model_settings = model_settings self.search_space = search_space class ImageClassification(AutoMLVertical, ImageClassificationBase): """Image Classification. Multi-class image classification is used when an image is classified with only a single label -from a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' or a 'duck'. + from a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' or a 'duck'. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and - other data settings required for training and validating models. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics + :ivar data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and + other data settings required for training and validating models. + :vartype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ _validation = { - 'data_settings': {'required': True}, - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, + "data_settings": {"required": True}, + "limit_settings": {"required": True}, + "task_type": {"required": True}, } _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'ImageVerticalDataSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "data_settings": { + "key": "dataSettings", + "type": "ImageVerticalDataSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsClassification", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsClassification]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( @@ -6219,9 +6484,13 @@ def __init__( limit_settings: "ImageLimitSettings", sweep_settings: Optional["ImageSweepSettings"] = None, model_settings: Optional["ImageModelSettingsClassification"] = None, - search_space: Optional[List["ImageModelDistributionSettingsClassification"]] = None, + search_space: Optional[ + List["ImageModelDistributionSettingsClassification"] + ] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - primary_metric: Optional[Union[str, "ClassificationPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "ClassificationPrimaryMetrics"] + ] = None, **kwargs ): """ @@ -6248,69 +6517,92 @@ def __init__( :paramtype primary_metric: str or ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ - super(ImageClassification, self).__init__(log_verbosity=log_verbosity, data_settings=data_settings, limit_settings=limit_settings, sweep_settings=sweep_settings, model_settings=model_settings, search_space=search_space, **kwargs) + super(ImageClassification, self).__init__( + log_verbosity=log_verbosity, + data_settings=data_settings, + limit_settings=limit_settings, + sweep_settings=sweep_settings, + model_settings=model_settings, + search_space=search_space, + **kwargs + ) self.data_settings = data_settings self.limit_settings = limit_settings self.sweep_settings = sweep_settings self.model_settings = model_settings self.search_space = search_space - self.task_type = 'ImageClassification' # type: str + self.task_type = "ImageClassification" # type: str self.primary_metric = primary_metric self.log_verbosity = log_verbosity - self.task_type = 'ImageClassification' # type: str + self.task_type = "ImageClassification" # type: str self.primary_metric = primary_metric class ImageClassificationMultilabel(AutoMLVertical, ImageClassificationBase): """Image Classification Multilabel. Multi-label image classification is used when an image could have one or more labels -from a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'. + from a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and - other data settings required for training and validating models. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics + :ivar data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and + other data settings required for training and validating models. + :vartype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted", "IOU". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics """ _validation = { - 'data_settings': {'required': True}, - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, + "data_settings": {"required": True}, + "limit_settings": {"required": True}, + "task_type": {"required": True}, } _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'ImageVerticalDataSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "data_settings": { + "key": "dataSettings", + "type": "ImageVerticalDataSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsClassification", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsClassification]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( @@ -6320,9 +6612,13 @@ def __init__( limit_settings: "ImageLimitSettings", sweep_settings: Optional["ImageSweepSettings"] = None, model_settings: Optional["ImageModelSettingsClassification"] = None, - search_space: Optional[List["ImageModelDistributionSettingsClassification"]] = None, + search_space: Optional[ + List["ImageModelDistributionSettingsClassification"] + ] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - primary_metric: Optional[Union[str, "ClassificationMultilabelPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "ClassificationMultilabelPrimaryMetrics"] + ] = None, **kwargs ): """ @@ -6349,16 +6645,24 @@ def __init__( :paramtype primary_metric: str or ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics """ - super(ImageClassificationMultilabel, self).__init__(log_verbosity=log_verbosity, data_settings=data_settings, limit_settings=limit_settings, sweep_settings=sweep_settings, model_settings=model_settings, search_space=search_space, **kwargs) + super(ImageClassificationMultilabel, self).__init__( + log_verbosity=log_verbosity, + data_settings=data_settings, + limit_settings=limit_settings, + sweep_settings=sweep_settings, + model_settings=model_settings, + search_space=search_space, + **kwargs + ) self.data_settings = data_settings self.limit_settings = limit_settings self.sweep_settings = sweep_settings self.model_settings = model_settings self.search_space = search_space - self.task_type = 'ImageClassificationMultilabel' # type: str + self.task_type = "ImageClassificationMultilabel" # type: str self.primary_metric = primary_metric self.log_verbosity = log_verbosity - self.task_type = 'ImageClassificationMultilabel' # type: str + self.task_type = "ImageClassificationMultilabel" # type: str self.primary_metric = primary_metric @@ -6384,16 +6688,31 @@ class ImageObjectDetectionBase(ImageVertical): """ _validation = { - 'data_settings': {'required': True}, - 'limit_settings': {'required': True}, + "data_settings": {"required": True}, + "limit_settings": {"required": True}, } _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'ImageVerticalDataSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, + "data_settings": { + "key": "dataSettings", + "type": "ImageVerticalDataSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsObjectDetection", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsObjectDetection]", + }, } def __init__( @@ -6403,7 +6722,9 @@ def __init__( limit_settings: "ImageLimitSettings", sweep_settings: Optional["ImageSweepSettings"] = None, model_settings: Optional["ImageModelSettingsObjectDetection"] = None, - search_space: Optional[List["ImageModelDistributionSettingsObjectDetection"]] = None, + search_space: Optional[ + List["ImageModelDistributionSettingsObjectDetection"] + ] = None, **kwargs ): """ @@ -6422,60 +6743,80 @@ def __init__( :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] """ - super(ImageObjectDetectionBase, self).__init__(data_settings=data_settings, limit_settings=limit_settings, sweep_settings=sweep_settings, **kwargs) + super(ImageObjectDetectionBase, self).__init__( + data_settings=data_settings, + limit_settings=limit_settings, + sweep_settings=sweep_settings, + **kwargs + ) self.model_settings = model_settings self.search_space = search_space class ImageInstanceSegmentation(AutoMLVertical, ImageObjectDetectionBase): """Image Instance Segmentation. Instance segmentation is used to identify objects in an image at the pixel level, -drawing a polygon around each object in the image. + drawing a polygon around each object in the image. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and - other data settings required for training and validating models. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics + :ivar data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and + other data settings required for training and validating models. + :vartype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "MeanAveragePrecision". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics """ _validation = { - 'data_settings': {'required': True}, - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, + "data_settings": {"required": True}, + "limit_settings": {"required": True}, + "task_type": {"required": True}, } _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'ImageVerticalDataSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "data_settings": { + "key": "dataSettings", + "type": "ImageVerticalDataSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsObjectDetection", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsObjectDetection]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( @@ -6485,9 +6826,13 @@ def __init__( limit_settings: "ImageLimitSettings", sweep_settings: Optional["ImageSweepSettings"] = None, model_settings: Optional["ImageModelSettingsObjectDetection"] = None, - search_space: Optional[List["ImageModelDistributionSettingsObjectDetection"]] = None, + search_space: Optional[ + List["ImageModelDistributionSettingsObjectDetection"] + ] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - primary_metric: Optional[Union[str, "InstanceSegmentationPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "InstanceSegmentationPrimaryMetrics"] + ] = None, **kwargs ): """ @@ -6513,16 +6858,24 @@ def __init__( :paramtype primary_metric: str or ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics """ - super(ImageInstanceSegmentation, self).__init__(log_verbosity=log_verbosity, data_settings=data_settings, limit_settings=limit_settings, sweep_settings=sweep_settings, model_settings=model_settings, search_space=search_space, **kwargs) + super(ImageInstanceSegmentation, self).__init__( + log_verbosity=log_verbosity, + data_settings=data_settings, + limit_settings=limit_settings, + sweep_settings=sweep_settings, + model_settings=model_settings, + search_space=search_space, + **kwargs + ) self.data_settings = data_settings self.limit_settings = limit_settings self.sweep_settings = sweep_settings self.model_settings = model_settings self.search_space = search_space - self.task_type = 'ImageInstanceSegmentation' # type: str + self.task_type = "ImageInstanceSegmentation" # type: str self.primary_metric = primary_metric self.log_verbosity = log_verbosity - self.task_type = 'ImageInstanceSegmentation' # type: str + self.task_type = "ImageInstanceSegmentation" # type: str self.primary_metric = primary_metric @@ -6538,9 +6891,9 @@ class ImageLimitSettings(msrest.serialization.Model): """ _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_trials": {"key": "maxTrials", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } def __init__( @@ -6568,134 +6921,152 @@ def __init__( class ImageModelDistributionSettings(msrest.serialization.Model): """Distribution expressions to sweep over values of model settings. -:code:` -Some examples are: - -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -` -All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) -where distribution name can be: uniform, quniform, loguniform, etc -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar split_ratio: If validation data is not defined, this specifies the split ratio for - splitting - train data into random train and validation subsets. Must be a float in the range [0, 1]. - :vartype split_ratio: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'split_ratio': {'key': 'splitRatio', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, + :code:` + Some examples are: + + ModelName = "choice('seresnext', 'resnest50')"; + LearningRate = "uniform(0.001, 0.01)"; + LayersToFreeze = "choice(0, 2)"; + ` + All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) + where distribution name can be: uniform, quniform, loguniform, etc + For more details on how to compose distribution expressions please check the documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: str + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: str + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: str + :ivar distributed: Whether to use distributer training. + :vartype distributed: str + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: str + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: str + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: str + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: str + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: str + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: str + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: str + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: str + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. + :vartype learning_rate_scheduler: str + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: str + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: str + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: str + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: str + :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. + :vartype optimizer: str + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: str + :ivar split_ratio: If validation data is not defined, this specifies the split ratio for + splitting + train data into random train and validation subsets. Must be a float in the range [0, 1]. + :vartype split_ratio: str + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: str + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: str + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: str + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: str + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: str + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: str + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: str + """ + + _attribute_map = { + "ams_gradient": {"key": "amsGradient", "type": "str"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "str"}, + "beta2": {"key": "beta2", "type": "str"}, + "distributed": {"key": "distributed", "type": "str"}, + "early_stopping": {"key": "earlyStopping", "type": "str"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "str"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "str", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "str", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "str"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "str", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "str"}, + "nesterov": {"key": "nesterov", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "str"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "str"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "str"}, + "split_ratio": {"key": "splitRatio", "type": "str"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "str"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "str"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "str", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "str", + }, + "weight_decay": {"key": "weightDecay", "type": "str"}, } def __init__( @@ -6850,152 +7221,175 @@ def __init__( self.weight_decay = weight_decay -class ImageModelDistributionSettingsClassification(ImageModelDistributionSettings): +class ImageModelDistributionSettingsClassification( + ImageModelDistributionSettings +): """Distribution expressions to sweep over values of model settings. -:code:` -Some examples are: - -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar split_ratio: If validation data is not defined, this specifies the split ratio for - splitting - train data into random train and validation subsets. Must be a float in the range [0, 1]. - :vartype split_ratio: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: str - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: str - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: str - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'split_ratio': {'key': 'splitRatio', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'str'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'str'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'str'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'str'}, + :code:` + Some examples are: + + ModelName = "choice('seresnext', 'resnest50')"; + LearningRate = "uniform(0.001, 0.01)"; + LayersToFreeze = "choice(0, 2)"; + ` + For more details on how to compose distribution expressions please check the documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: str + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: str + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: str + :ivar distributed: Whether to use distributer training. + :vartype distributed: str + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: str + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: str + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: str + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: str + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: str + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: str + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: str + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: str + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. + :vartype learning_rate_scheduler: str + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: str + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: str + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: str + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: str + :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. + :vartype optimizer: str + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: str + :ivar split_ratio: If validation data is not defined, this specifies the split ratio for + splitting + train data into random train and validation subsets. Must be a float in the range [0, 1]. + :vartype split_ratio: str + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: str + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: str + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: str + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: str + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: str + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: str + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: str + :ivar training_crop_size: Image crop size that is input to the neural network for the training + dataset. Must be a positive integer. + :vartype training_crop_size: str + :ivar validation_crop_size: Image crop size that is input to the neural network for the + validation dataset. Must be a positive integer. + :vartype validation_crop_size: str + :ivar validation_resize_size: Image size to which to resize before cropping for validation + dataset. Must be a positive integer. + :vartype validation_resize_size: str + :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. + 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be + 0 or 1 or 2. + :vartype weighted_loss: str + """ + + _attribute_map = { + "ams_gradient": {"key": "amsGradient", "type": "str"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "str"}, + "beta2": {"key": "beta2", "type": "str"}, + "distributed": {"key": "distributed", "type": "str"}, + "early_stopping": {"key": "earlyStopping", "type": "str"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "str"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "str", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "str", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "str"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "str", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "str"}, + "nesterov": {"key": "nesterov", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "str"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "str"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "str"}, + "split_ratio": {"key": "splitRatio", "type": "str"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "str"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "str"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "str", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "str", + }, + "weight_decay": {"key": "weightDecay", "type": "str"}, + "training_crop_size": {"key": "trainingCropSize", "type": "str"}, + "validation_crop_size": {"key": "validationCropSize", "type": "str"}, + "validation_resize_size": { + "key": "validationResizeSize", + "type": "str", + }, + "weighted_loss": {"key": "weightedLoss", "type": "str"}, } def __init__( @@ -7135,207 +7529,270 @@ def __init__( 0 or 1 or 2. :paramtype weighted_loss: str """ - super(ImageModelDistributionSettingsClassification, self).__init__(ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, split_ratio=split_ratio, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) + super(ImageModelDistributionSettingsClassification, self).__init__( + ams_gradient=ams_gradient, + augmentations=augmentations, + beta1=beta1, + beta2=beta2, + distributed=distributed, + early_stopping=early_stopping, + early_stopping_delay=early_stopping_delay, + early_stopping_patience=early_stopping_patience, + enable_onnx_normalization=enable_onnx_normalization, + evaluation_frequency=evaluation_frequency, + gradient_accumulation_step=gradient_accumulation_step, + layers_to_freeze=layers_to_freeze, + learning_rate=learning_rate, + learning_rate_scheduler=learning_rate_scheduler, + model_name=model_name, + momentum=momentum, + nesterov=nesterov, + number_of_epochs=number_of_epochs, + number_of_workers=number_of_workers, + optimizer=optimizer, + random_seed=random_seed, + split_ratio=split_ratio, + step_lr_gamma=step_lr_gamma, + step_lr_step_size=step_lr_step_size, + training_batch_size=training_batch_size, + validation_batch_size=validation_batch_size, + warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, + warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, + weight_decay=weight_decay, + **kwargs + ) self.training_crop_size = training_crop_size self.validation_crop_size = validation_crop_size self.validation_resize_size = validation_resize_size self.weighted_loss = weighted_loss -class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettings): +class ImageModelDistributionSettingsObjectDetection( + ImageModelDistributionSettings +): """Distribution expressions to sweep over values of model settings. -:code:` -Some examples are: - -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar split_ratio: If validation data is not defined, this specifies the split ratio for - splitting - train data into random train and validation subsets. Must be a float in the range [0, 1]. - :vartype split_ratio: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: str - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: str - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: str - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: str - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: str - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype model_size: str - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: str - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - float in the range [0, 1]. - :vartype nms_iou_threshold: str - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: str - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - NMS: Non-maximum suppression. - :vartype tile_predictions_nms_threshold: str - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: str - :ivar validation_metric_type: Metric computation method to use for validation metrics. Must be - 'none', 'coco', 'voc', or 'coco_voc'. - :vartype validation_metric_type: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'split_ratio': {'key': 'splitRatio', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'str'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'str'}, - 'image_size': {'key': 'imageSize', 'type': 'str'}, - 'max_size': {'key': 'maxSize', 'type': 'str'}, - 'min_size': {'key': 'minSize', 'type': 'str'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'str'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'str'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'str'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'str'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'str'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, + :code:` + Some examples are: + + ModelName = "choice('seresnext', 'resnest50')"; + LearningRate = "uniform(0.001, 0.01)"; + LayersToFreeze = "choice(0, 2)"; + ` + For more details on how to compose distribution expressions please check the documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: str + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: str + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: str + :ivar distributed: Whether to use distributer training. + :vartype distributed: str + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: str + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: str + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: str + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: str + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: str + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: str + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: str + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: str + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. + :vartype learning_rate_scheduler: str + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: str + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: str + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: str + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: str + :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. + :vartype optimizer: str + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: str + :ivar split_ratio: If validation data is not defined, this specifies the split ratio for + splitting + train data into random train and validation subsets. Must be a float in the range [0, 1]. + :vartype split_ratio: str + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: str + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: str + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: str + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: str + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: str + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: str + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: str + :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must + be a positive integer. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype box_detections_per_image: str + :ivar box_score_threshold: During inference, only return proposals with a classification score + greater than + BoxScoreThreshold. Must be a float in the range[0, 1]. + :vartype box_score_threshold: str + :ivar image_size: Image size for train and validation. Must be a positive integer. + Note: The training run may get into CUDA OOM if the size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype image_size: str + :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype max_size: str + :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype min_size: str + :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. + Note: training run may get into CUDA OOM if the model size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype model_size: str + :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. + Note: training run may get into CUDA OOM if no sufficient GPU memory. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype multi_scale: str + :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be + float in the range [0, 1]. + :vartype nms_iou_threshold: str + :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not + be + None to enable small object detection logic. A string containing two integers in mxn format. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_grid_size: str + :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float + in the range [0, 1). + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_overlap_ratio: str + :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging + predictions from tiles and image. + Used in validation/ inference. Must be float in the range [0, 1]. + Note: This settings is not supported for the 'yolov5' algorithm. + NMS: Non-maximum suppression. + :vartype tile_predictions_nms_threshold: str + :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be + float in the range [0, 1]. + :vartype validation_iou_threshold: str + :ivar validation_metric_type: Metric computation method to use for validation metrics. Must be + 'none', 'coco', 'voc', or 'coco_voc'. + :vartype validation_metric_type: str + """ + + _attribute_map = { + "ams_gradient": {"key": "amsGradient", "type": "str"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "str"}, + "beta2": {"key": "beta2", "type": "str"}, + "distributed": {"key": "distributed", "type": "str"}, + "early_stopping": {"key": "earlyStopping", "type": "str"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "str"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "str", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "str", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "str"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "str", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "str"}, + "nesterov": {"key": "nesterov", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "str"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "str"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "str"}, + "split_ratio": {"key": "splitRatio", "type": "str"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "str"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "str"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "str", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "str", + }, + "weight_decay": {"key": "weightDecay", "type": "str"}, + "box_detections_per_image": { + "key": "boxDetectionsPerImage", + "type": "str", + }, + "box_score_threshold": {"key": "boxScoreThreshold", "type": "str"}, + "image_size": {"key": "imageSize", "type": "str"}, + "max_size": {"key": "maxSize", "type": "str"}, + "min_size": {"key": "minSize", "type": "str"}, + "model_size": {"key": "modelSize", "type": "str"}, + "multi_scale": {"key": "multiScale", "type": "str"}, + "nms_iou_threshold": {"key": "nmsIouThreshold", "type": "str"}, + "tile_grid_size": {"key": "tileGridSize", "type": "str"}, + "tile_overlap_ratio": {"key": "tileOverlapRatio", "type": "str"}, + "tile_predictions_nms_threshold": { + "key": "tilePredictionsNmsThreshold", + "type": "str", + }, + "validation_iou_threshold": { + "key": "validationIouThreshold", + "type": "str", + }, + "validation_metric_type": { + "key": "validationMetricType", + "type": "str", + }, } def __init__( @@ -7523,7 +7980,38 @@ def __init__( be 'none', 'coco', 'voc', or 'coco_voc'. :paramtype validation_metric_type: str """ - super(ImageModelDistributionSettingsObjectDetection, self).__init__(ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, split_ratio=split_ratio, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) + super(ImageModelDistributionSettingsObjectDetection, self).__init__( + ams_gradient=ams_gradient, + augmentations=augmentations, + beta1=beta1, + beta2=beta2, + distributed=distributed, + early_stopping=early_stopping, + early_stopping_delay=early_stopping_delay, + early_stopping_patience=early_stopping_patience, + enable_onnx_normalization=enable_onnx_normalization, + evaluation_frequency=evaluation_frequency, + gradient_accumulation_step=gradient_accumulation_step, + layers_to_freeze=layers_to_freeze, + learning_rate=learning_rate, + learning_rate_scheduler=learning_rate_scheduler, + model_name=model_name, + momentum=momentum, + nesterov=nesterov, + number_of_epochs=number_of_epochs, + number_of_workers=number_of_workers, + optimizer=optimizer, + random_seed=random_seed, + split_ratio=split_ratio, + step_lr_gamma=step_lr_gamma, + step_lr_step_size=step_lr_step_size, + training_batch_size=training_batch_size, + validation_batch_size=validation_batch_size, + warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, + warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, + weight_decay=weight_decay, + **kwargs + ) self.box_detections_per_image = box_detections_per_image self.box_score_threshold = box_score_threshold self.image_size = image_size @@ -7541,144 +8029,162 @@ def __init__( class ImageModelSettings(msrest.serialization.Model): """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_dataset_id: FileDataset id for pretrained checkpoint(s) for incremental - training. - Make sure to pass CheckpointFilename along with CheckpointDatasetId. - :vartype checkpoint_dataset_id: str - :ivar checkpoint_filename: The pretrained checkpoint filename in FileDataset for incremental - training. - Make sure to pass CheckpointDatasetId along with CheckpointFilename. - :vartype checkpoint_filename: str - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar split_ratio: If validation data is not defined, this specifies the split ratio for - splitting - train data into random train and validation subsets. Must be a float in the range [0, 1]. - :vartype split_ratio: float - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_dataset_id': {'key': 'checkpointDatasetId', 'type': 'str'}, - 'checkpoint_filename': {'key': 'checkpointFilename', 'type': 'str'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'split_ratio': {'key': 'splitRatio', 'type': 'float'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar advanced_settings: Settings for advanced scenarios. + :vartype advanced_settings: str + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: bool + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: float + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: float + :ivar checkpoint_dataset_id: FileDataset id for pretrained checkpoint(s) for incremental + training. + Make sure to pass CheckpointFilename along with CheckpointDatasetId. + :vartype checkpoint_dataset_id: str + :ivar checkpoint_filename: The pretrained checkpoint filename in FileDataset for incremental + training. + Make sure to pass CheckpointDatasetId along with CheckpointFilename. + :vartype checkpoint_filename: str + :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. + :vartype checkpoint_frequency: int + :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for + incremental training. + :vartype checkpoint_run_id: str + :ivar distributed: Whether to use distributed training. + :vartype distributed: bool + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: bool + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: int + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: int + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: bool + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: int + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: int + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: int + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: float + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. Possible values include: "None", "WarmupCosine", "Step". + :vartype learning_rate_scheduler: str or + ~azure.mgmt.machinelearningservices.models.LearningRateScheduler + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: float + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: bool + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: int + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: int + :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". + :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: int + :ivar split_ratio: If validation data is not defined, this specifies the split ratio for + splitting + train data into random train and validation subsets. Must be a float in the range [0, 1]. + :vartype split_ratio: float + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: float + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: int + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: int + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: int + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: float + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: int + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: float + """ + + _attribute_map = { + "advanced_settings": {"key": "advancedSettings", "type": "str"}, + "ams_gradient": {"key": "amsGradient", "type": "bool"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "float"}, + "beta2": {"key": "beta2", "type": "float"}, + "checkpoint_dataset_id": {"key": "checkpointDatasetId", "type": "str"}, + "checkpoint_filename": {"key": "checkpointFilename", "type": "str"}, + "checkpoint_frequency": {"key": "checkpointFrequency", "type": "int"}, + "checkpoint_run_id": {"key": "checkpointRunId", "type": "str"}, + "distributed": {"key": "distributed", "type": "bool"}, + "early_stopping": {"key": "earlyStopping", "type": "bool"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "int"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "int", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "bool", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "int"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "int", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "int"}, + "learning_rate": {"key": "learningRate", "type": "float"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "float"}, + "nesterov": {"key": "nesterov", "type": "bool"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "int"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "int"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "int"}, + "split_ratio": {"key": "splitRatio", "type": "float"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "float"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "int"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "float", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "int", + }, + "weight_decay": {"key": "weightDecay", "type": "float"}, } def __init__( @@ -7702,7 +8208,9 @@ def __init__( gradient_accumulation_step: Optional[int] = None, layers_to_freeze: Optional[int] = None, learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "LearningRateScheduler"]] = None, + learning_rate_scheduler: Optional[ + Union[str, "LearningRateScheduler"] + ] = None, model_name: Optional[str] = None, momentum: Optional[float] = None, nesterov: Optional[bool] = None, @@ -7862,161 +8370,182 @@ def __init__( class ImageModelSettingsClassification(ImageModelSettings): """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_dataset_id: FileDataset id for pretrained checkpoint(s) for incremental - training. - Make sure to pass CheckpointFilename along with CheckpointDatasetId. - :vartype checkpoint_dataset_id: str - :ivar checkpoint_filename: The pretrained checkpoint filename in FileDataset for incremental - training. - Make sure to pass CheckpointDatasetId along with CheckpointFilename. - :vartype checkpoint_filename: str - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar split_ratio: If validation data is not defined, this specifies the split ratio for - splitting - train data into random train and validation subsets. Must be a float in the range [0, 1]. - :vartype split_ratio: float - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: int - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: int - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: int - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: int - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_dataset_id': {'key': 'checkpointDatasetId', 'type': 'str'}, - 'checkpoint_filename': {'key': 'checkpointFilename', 'type': 'str'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'split_ratio': {'key': 'splitRatio', 'type': 'float'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'int'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'int'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'int'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'int'}, + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar advanced_settings: Settings for advanced scenarios. + :vartype advanced_settings: str + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: bool + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: float + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: float + :ivar checkpoint_dataset_id: FileDataset id for pretrained checkpoint(s) for incremental + training. + Make sure to pass CheckpointFilename along with CheckpointDatasetId. + :vartype checkpoint_dataset_id: str + :ivar checkpoint_filename: The pretrained checkpoint filename in FileDataset for incremental + training. + Make sure to pass CheckpointDatasetId along with CheckpointFilename. + :vartype checkpoint_filename: str + :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. + :vartype checkpoint_frequency: int + :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for + incremental training. + :vartype checkpoint_run_id: str + :ivar distributed: Whether to use distributed training. + :vartype distributed: bool + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: bool + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: int + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: int + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: bool + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: int + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: int + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: int + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: float + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. Possible values include: "None", "WarmupCosine", "Step". + :vartype learning_rate_scheduler: str or + ~azure.mgmt.machinelearningservices.models.LearningRateScheduler + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: float + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: bool + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: int + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: int + :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". + :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: int + :ivar split_ratio: If validation data is not defined, this specifies the split ratio for + splitting + train data into random train and validation subsets. Must be a float in the range [0, 1]. + :vartype split_ratio: float + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: float + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: int + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: int + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: int + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: float + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: int + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: float + :ivar training_crop_size: Image crop size that is input to the neural network for the training + dataset. Must be a positive integer. + :vartype training_crop_size: int + :ivar validation_crop_size: Image crop size that is input to the neural network for the + validation dataset. Must be a positive integer. + :vartype validation_crop_size: int + :ivar validation_resize_size: Image size to which to resize before cropping for validation + dataset. Must be a positive integer. + :vartype validation_resize_size: int + :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. + 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be + 0 or 1 or 2. + :vartype weighted_loss: int + """ + + _attribute_map = { + "advanced_settings": {"key": "advancedSettings", "type": "str"}, + "ams_gradient": {"key": "amsGradient", "type": "bool"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "float"}, + "beta2": {"key": "beta2", "type": "float"}, + "checkpoint_dataset_id": {"key": "checkpointDatasetId", "type": "str"}, + "checkpoint_filename": {"key": "checkpointFilename", "type": "str"}, + "checkpoint_frequency": {"key": "checkpointFrequency", "type": "int"}, + "checkpoint_run_id": {"key": "checkpointRunId", "type": "str"}, + "distributed": {"key": "distributed", "type": "bool"}, + "early_stopping": {"key": "earlyStopping", "type": "bool"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "int"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "int", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "bool", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "int"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "int", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "int"}, + "learning_rate": {"key": "learningRate", "type": "float"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "float"}, + "nesterov": {"key": "nesterov", "type": "bool"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "int"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "int"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "int"}, + "split_ratio": {"key": "splitRatio", "type": "float"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "float"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "int"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "float", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "int", + }, + "weight_decay": {"key": "weightDecay", "type": "float"}, + "training_crop_size": {"key": "trainingCropSize", "type": "int"}, + "validation_crop_size": {"key": "validationCropSize", "type": "int"}, + "validation_resize_size": { + "key": "validationResizeSize", + "type": "int", + }, + "weighted_loss": {"key": "weightedLoss", "type": "int"}, } def __init__( @@ -8040,7 +8569,9 @@ def __init__( gradient_accumulation_step: Optional[int] = None, layers_to_freeze: Optional[int] = None, learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "LearningRateScheduler"]] = None, + learning_rate_scheduler: Optional[ + Union[str, "LearningRateScheduler"] + ] = None, model_name: Optional[str] = None, momentum: Optional[float] = None, nesterov: Optional[bool] = None, @@ -8178,219 +8709,285 @@ def __init__( 0 or 1 or 2. :paramtype weighted_loss: int """ - super(ImageModelSettingsClassification, self).__init__(advanced_settings=advanced_settings, ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, checkpoint_dataset_id=checkpoint_dataset_id, checkpoint_filename=checkpoint_filename, checkpoint_frequency=checkpoint_frequency, checkpoint_run_id=checkpoint_run_id, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, split_ratio=split_ratio, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) + super(ImageModelSettingsClassification, self).__init__( + advanced_settings=advanced_settings, + ams_gradient=ams_gradient, + augmentations=augmentations, + beta1=beta1, + beta2=beta2, + checkpoint_dataset_id=checkpoint_dataset_id, + checkpoint_filename=checkpoint_filename, + checkpoint_frequency=checkpoint_frequency, + checkpoint_run_id=checkpoint_run_id, + distributed=distributed, + early_stopping=early_stopping, + early_stopping_delay=early_stopping_delay, + early_stopping_patience=early_stopping_patience, + enable_onnx_normalization=enable_onnx_normalization, + evaluation_frequency=evaluation_frequency, + gradient_accumulation_step=gradient_accumulation_step, + layers_to_freeze=layers_to_freeze, + learning_rate=learning_rate, + learning_rate_scheduler=learning_rate_scheduler, + model_name=model_name, + momentum=momentum, + nesterov=nesterov, + number_of_epochs=number_of_epochs, + number_of_workers=number_of_workers, + optimizer=optimizer, + random_seed=random_seed, + split_ratio=split_ratio, + step_lr_gamma=step_lr_gamma, + step_lr_step_size=step_lr_step_size, + training_batch_size=training_batch_size, + validation_batch_size=validation_batch_size, + warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, + warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, + weight_decay=weight_decay, + **kwargs + ) self.training_crop_size = training_crop_size self.validation_crop_size = validation_crop_size self.validation_resize_size = validation_resize_size self.weighted_loss = weighted_loss -class ImageModelSettingsObjectDetection(ImageModelSettings): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_dataset_id: FileDataset id for pretrained checkpoint(s) for incremental - training. - Make sure to pass CheckpointFilename along with CheckpointDatasetId. - :vartype checkpoint_dataset_id: str - :ivar checkpoint_filename: The pretrained checkpoint filename in FileDataset for incremental - training. - Make sure to pass CheckpointDatasetId along with CheckpointFilename. - :vartype checkpoint_filename: str - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar split_ratio: If validation data is not defined, this specifies the split ratio for - splitting - train data into random train and validation subsets. Must be a float in the range [0, 1]. - :vartype split_ratio: float - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: int - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: float - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: int - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: int - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: int - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: - "None", "Small", "Medium", "Large", "ExtraLarge". - :vartype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: bool - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be a - float in the range [0, 1]. - :vartype nms_iou_threshold: float - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: float - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_predictions_nms_threshold: float - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: float - :ivar validation_metric_type: Metric computation method to use for validation metrics. Possible - values include: "None", "Coco", "Voc", "CocoVoc". - :vartype validation_metric_type: str or - ~azure.mgmt.machinelearningservices.models.ValidationMetricType - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_dataset_id': {'key': 'checkpointDatasetId', 'type': 'str'}, - 'checkpoint_filename': {'key': 'checkpointFilename', 'type': 'str'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'split_ratio': {'key': 'splitRatio', 'type': 'float'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'int'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'float'}, - 'image_size': {'key': 'imageSize', 'type': 'int'}, - 'max_size': {'key': 'maxSize', 'type': 'int'}, - 'min_size': {'key': 'minSize', 'type': 'int'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'bool'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'float'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'float'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'float'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'float'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, +class ImageModelSettingsObjectDetection(ImageModelSettings): + """Settings used for training the model. + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar advanced_settings: Settings for advanced scenarios. + :vartype advanced_settings: str + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: bool + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: float + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: float + :ivar checkpoint_dataset_id: FileDataset id for pretrained checkpoint(s) for incremental + training. + Make sure to pass CheckpointFilename along with CheckpointDatasetId. + :vartype checkpoint_dataset_id: str + :ivar checkpoint_filename: The pretrained checkpoint filename in FileDataset for incremental + training. + Make sure to pass CheckpointDatasetId along with CheckpointFilename. + :vartype checkpoint_filename: str + :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. + :vartype checkpoint_frequency: int + :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for + incremental training. + :vartype checkpoint_run_id: str + :ivar distributed: Whether to use distributed training. + :vartype distributed: bool + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: bool + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: int + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: int + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: bool + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: int + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: int + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: int + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: float + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. Possible values include: "None", "WarmupCosine", "Step". + :vartype learning_rate_scheduler: str or + ~azure.mgmt.machinelearningservices.models.LearningRateScheduler + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: float + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: bool + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: int + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: int + :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". + :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: int + :ivar split_ratio: If validation data is not defined, this specifies the split ratio for + splitting + train data into random train and validation subsets. Must be a float in the range [0, 1]. + :vartype split_ratio: float + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: float + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: int + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: int + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: int + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: float + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: int + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: float + :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must + be a positive integer. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype box_detections_per_image: int + :ivar box_score_threshold: During inference, only return proposals with a classification score + greater than + BoxScoreThreshold. Must be a float in the range[0, 1]. + :vartype box_score_threshold: float + :ivar image_size: Image size for train and validation. Must be a positive integer. + Note: The training run may get into CUDA OOM if the size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype image_size: int + :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype max_size: int + :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype min_size: int + :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. + Note: training run may get into CUDA OOM if the model size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: + "None", "Small", "Medium", "Large", "ExtraLarge". + :vartype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize + :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. + Note: training run may get into CUDA OOM if no sufficient GPU memory. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype multi_scale: bool + :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be a + float in the range [0, 1]. + :vartype nms_iou_threshold: float + :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not + be + None to enable small object detection logic. A string containing two integers in mxn format. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_grid_size: str + :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float + in the range [0, 1). + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_overlap_ratio: float + :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging + predictions from tiles and image. + Used in validation/ inference. Must be float in the range [0, 1]. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_predictions_nms_threshold: float + :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be + float in the range [0, 1]. + :vartype validation_iou_threshold: float + :ivar validation_metric_type: Metric computation method to use for validation metrics. Possible + values include: "None", "Coco", "Voc", "CocoVoc". + :vartype validation_metric_type: str or + ~azure.mgmt.machinelearningservices.models.ValidationMetricType + """ + + _attribute_map = { + "advanced_settings": {"key": "advancedSettings", "type": "str"}, + "ams_gradient": {"key": "amsGradient", "type": "bool"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "float"}, + "beta2": {"key": "beta2", "type": "float"}, + "checkpoint_dataset_id": {"key": "checkpointDatasetId", "type": "str"}, + "checkpoint_filename": {"key": "checkpointFilename", "type": "str"}, + "checkpoint_frequency": {"key": "checkpointFrequency", "type": "int"}, + "checkpoint_run_id": {"key": "checkpointRunId", "type": "str"}, + "distributed": {"key": "distributed", "type": "bool"}, + "early_stopping": {"key": "earlyStopping", "type": "bool"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "int"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "int", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "bool", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "int"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "int", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "int"}, + "learning_rate": {"key": "learningRate", "type": "float"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "float"}, + "nesterov": {"key": "nesterov", "type": "bool"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "int"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "int"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "int"}, + "split_ratio": {"key": "splitRatio", "type": "float"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "float"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "int"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "float", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "int", + }, + "weight_decay": {"key": "weightDecay", "type": "float"}, + "box_detections_per_image": { + "key": "boxDetectionsPerImage", + "type": "int", + }, + "box_score_threshold": {"key": "boxScoreThreshold", "type": "float"}, + "image_size": {"key": "imageSize", "type": "int"}, + "max_size": {"key": "maxSize", "type": "int"}, + "min_size": {"key": "minSize", "type": "int"}, + "model_size": {"key": "modelSize", "type": "str"}, + "multi_scale": {"key": "multiScale", "type": "bool"}, + "nms_iou_threshold": {"key": "nmsIouThreshold", "type": "float"}, + "tile_grid_size": {"key": "tileGridSize", "type": "str"}, + "tile_overlap_ratio": {"key": "tileOverlapRatio", "type": "float"}, + "tile_predictions_nms_threshold": { + "key": "tilePredictionsNmsThreshold", + "type": "float", + }, + "validation_iou_threshold": { + "key": "validationIouThreshold", + "type": "float", + }, + "validation_metric_type": { + "key": "validationMetricType", + "type": "str", + }, } def __init__( @@ -8414,7 +9011,9 @@ def __init__( gradient_accumulation_step: Optional[int] = None, layers_to_freeze: Optional[int] = None, learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "LearningRateScheduler"]] = None, + learning_rate_scheduler: Optional[ + Union[str, "LearningRateScheduler"] + ] = None, model_name: Optional[str] = None, momentum: Optional[float] = None, nesterov: Optional[bool] = None, @@ -8442,7 +9041,9 @@ def __init__( tile_overlap_ratio: Optional[float] = None, tile_predictions_nms_threshold: Optional[float] = None, validation_iou_threshold: Optional[float] = None, - validation_metric_type: Optional[Union[str, "ValidationMetricType"]] = None, + validation_metric_type: Optional[ + Union[str, "ValidationMetricType"] + ] = None, **kwargs ): """ @@ -8601,7 +9202,43 @@ def __init__( :paramtype validation_metric_type: str or ~azure.mgmt.machinelearningservices.models.ValidationMetricType """ - super(ImageModelSettingsObjectDetection, self).__init__(advanced_settings=advanced_settings, ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, checkpoint_dataset_id=checkpoint_dataset_id, checkpoint_filename=checkpoint_filename, checkpoint_frequency=checkpoint_frequency, checkpoint_run_id=checkpoint_run_id, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, split_ratio=split_ratio, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) + super(ImageModelSettingsObjectDetection, self).__init__( + advanced_settings=advanced_settings, + ams_gradient=ams_gradient, + augmentations=augmentations, + beta1=beta1, + beta2=beta2, + checkpoint_dataset_id=checkpoint_dataset_id, + checkpoint_filename=checkpoint_filename, + checkpoint_frequency=checkpoint_frequency, + checkpoint_run_id=checkpoint_run_id, + distributed=distributed, + early_stopping=early_stopping, + early_stopping_delay=early_stopping_delay, + early_stopping_patience=early_stopping_patience, + enable_onnx_normalization=enable_onnx_normalization, + evaluation_frequency=evaluation_frequency, + gradient_accumulation_step=gradient_accumulation_step, + layers_to_freeze=layers_to_freeze, + learning_rate=learning_rate, + learning_rate_scheduler=learning_rate_scheduler, + model_name=model_name, + momentum=momentum, + nesterov=nesterov, + number_of_epochs=number_of_epochs, + number_of_workers=number_of_workers, + optimizer=optimizer, + random_seed=random_seed, + split_ratio=split_ratio, + step_lr_gamma=step_lr_gamma, + step_lr_step_size=step_lr_step_size, + training_batch_size=training_batch_size, + validation_batch_size=validation_batch_size, + warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, + warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, + weight_decay=weight_decay, + **kwargs + ) self.box_detections_per_image = box_detections_per_image self.box_score_threshold = box_score_threshold self.image_size = image_size @@ -8619,53 +9256,68 @@ def __init__( class ImageObjectDetection(AutoMLVertical, ImageObjectDetectionBase): """Image Object Detection. Object detection is used to identify objects in an image and locate each object with a -bounding box e.g. locate all dogs and cats in an image and draw a bounding box around each. + bounding box e.g. locate all dogs and cats in an image and draw a bounding box around each. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and - other data settings required for training and validating models. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics + :ivar data_settings: Required. [Required] Collection of registered Tabular Dataset Ids and + other data settings required for training and validating models. + :vartype data_settings: ~azure.mgmt.machinelearningservices.models.ImageVerticalDataSettings + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "MeanAveragePrecision". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics """ _validation = { - 'data_settings': {'required': True}, - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, + "data_settings": {"required": True}, + "limit_settings": {"required": True}, + "task_type": {"required": True}, } _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'ImageVerticalDataSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "data_settings": { + "key": "dataSettings", + "type": "ImageVerticalDataSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsObjectDetection", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsObjectDetection]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( @@ -8675,9 +9327,13 @@ def __init__( limit_settings: "ImageLimitSettings", sweep_settings: Optional["ImageSweepSettings"] = None, model_settings: Optional["ImageModelSettingsObjectDetection"] = None, - search_space: Optional[List["ImageModelDistributionSettingsObjectDetection"]] = None, + search_space: Optional[ + List["ImageModelDistributionSettingsObjectDetection"] + ] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - primary_metric: Optional[Union[str, "ObjectDetectionPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "ObjectDetectionPrimaryMetrics"] + ] = None, **kwargs ): """ @@ -8703,16 +9359,24 @@ def __init__( :paramtype primary_metric: str or ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics """ - super(ImageObjectDetection, self).__init__(log_verbosity=log_verbosity, data_settings=data_settings, limit_settings=limit_settings, sweep_settings=sweep_settings, model_settings=model_settings, search_space=search_space, **kwargs) + super(ImageObjectDetection, self).__init__( + log_verbosity=log_verbosity, + data_settings=data_settings, + limit_settings=limit_settings, + sweep_settings=sweep_settings, + model_settings=model_settings, + search_space=search_space, + **kwargs + ) self.data_settings = data_settings self.limit_settings = limit_settings self.sweep_settings = sweep_settings self.model_settings = model_settings self.search_space = search_space - self.task_type = 'ImageObjectDetection' # type: str + self.task_type = "ImageObjectDetection" # type: str self.primary_metric = primary_metric self.log_verbosity = log_verbosity - self.task_type = 'ImageObjectDetection' # type: str + self.task_type = "ImageObjectDetection" # type: str self.primary_metric = primary_metric @@ -8727,8 +9391,8 @@ class ImageSweepLimitSettings(msrest.serialization.Model): """ _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_trials": {"key": "maxTrials", "type": "int"}, } def __init__( @@ -8767,14 +9431,17 @@ class ImageSweepSettings(msrest.serialization.Model): """ _validation = { - 'limits': {'required': True}, - 'sampling_algorithm': {'required': True}, + "limits": {"required": True}, + "sampling_algorithm": {"required": True}, } _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'limits': {'key': 'limits', 'type': 'ImageSweepLimitSettings'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, + "limits": {"key": "limits", "type": "ImageSweepLimitSettings"}, + "sampling_algorithm": {"key": "samplingAlgorithm", "type": "str"}, } def __init__( @@ -8821,15 +9488,21 @@ class ImageVerticalDataSettings(DataSettings): """ _validation = { - 'target_column_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'training_data': {'required': True}, + "target_column_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "training_data": {"required": True}, } _attribute_map = { - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'test_data': {'key': 'testData', 'type': 'TestDataSettings'}, - 'training_data': {'key': 'trainingData', 'type': 'TrainingDataSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'ImageVerticalValidationDataSettings'}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "test_data": {"key": "testData", "type": "TestDataSettings"}, + "training_data": { + "key": "trainingData", + "type": "TrainingDataSettings", + }, + "validation_data": { + "key": "validationData", + "type": "ImageVerticalValidationDataSettings", + }, } def __init__( @@ -8838,7 +9511,9 @@ def __init__( target_column_name: str, training_data: "TrainingDataSettings", test_data: Optional["TestDataSettings"] = None, - validation_data: Optional["ImageVerticalValidationDataSettings"] = None, + validation_data: Optional[ + "ImageVerticalValidationDataSettings" + ] = None, **kwargs ): """ @@ -8854,7 +9529,12 @@ def __init__( :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.ImageVerticalValidationDataSettings """ - super(ImageVerticalDataSettings, self).__init__(target_column_name=target_column_name, test_data=test_data, training_data=training_data, **kwargs) + super(ImageVerticalDataSettings, self).__init__( + target_column_name=target_column_name, + test_data=test_data, + training_data=training_data, + **kwargs + ) self.validation_data = validation_data @@ -8871,8 +9551,8 @@ class ValidationDataSettings(msrest.serialization.Model): """ _attribute_map = { - 'data': {'key': 'data', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, + "data": {"key": "data", "type": "MLTableJobInput"}, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, } def __init__( @@ -8909,8 +9589,8 @@ class ImageVerticalValidationDataSettings(ValidationDataSettings): """ _attribute_map = { - 'data': {'key': 'data', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, + "data": {"key": "data", "type": "MLTableJobInput"}, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, } def __init__( @@ -8929,7 +9609,9 @@ def __init__( Applied when validation dataset is not provided. :paramtype validation_data_size: float """ - super(ImageVerticalValidationDataSettings, self).__init__(data=data, validation_data_size=validation_data_size, **kwargs) + super(ImageVerticalValidationDataSettings, self).__init__( + data=data, validation_data_size=validation_data_size, **kwargs + ) class InferenceContainerProperties(msrest.serialization.Model): @@ -8945,9 +9627,9 @@ class InferenceContainerProperties(msrest.serialization.Model): """ _attribute_map = { - 'liveness_route': {'key': 'livenessRoute', 'type': 'Route'}, - 'readiness_route': {'key': 'readinessRoute', 'type': 'Route'}, - 'scoring_route': {'key': 'scoringRoute', 'type': 'Route'}, + "liveness_route": {"key": "livenessRoute", "type": "Route"}, + "readiness_route": {"key": "readinessRoute", "type": "Route"}, + "scoring_route": {"key": "scoringRoute", "type": "Route"}, } def __init__( @@ -8996,27 +9678,22 @@ class JobBaseData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'JobBaseDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "JobBaseDetails"}, } - def __init__( - self, - *, - properties: "JobBaseDetails", - **kwargs - ): + def __init__(self, *, properties: "JobBaseDetails", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.JobBaseDetails @@ -9036,8 +9713,8 @@ class JobBaseResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[JobBaseData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[JobBaseData]"}, } def __init__( @@ -9079,17 +9756,17 @@ class JobService(msrest.serialization.Model): """ _validation = { - 'error_message': {'readonly': True}, - 'status': {'readonly': True}, + "error_message": {"readonly": True}, + "status": {"readonly": True}, } _attribute_map = { - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'job_service_type': {'key': 'jobServiceType', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'status': {'key': 'status', 'type': 'str'}, + "endpoint": {"key": "endpoint", "type": "str"}, + "error_message": {"key": "errorMessage", "type": "str"}, + "job_service_type": {"key": "jobServiceType", "type": "str"}, + "port": {"key": "port", "type": "int"}, + "properties": {"key": "properties", "type": "{str}"}, + "status": {"key": "status", "type": "str"}, } def __init__( @@ -9135,15 +9812,15 @@ class KerberosCredentials(msrest.serialization.Model): """ _validation = { - 'kerberos_kdc_address': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "kerberos_kdc_address": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "kerberos_principal": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "kerberos_realm": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, + "kerberos_kdc_address": {"key": "kerberosKdcAddress", "type": "str"}, + "kerberos_principal": {"key": "kerberosPrincipal", "type": "str"}, + "kerberos_realm": {"key": "kerberosRealm", "type": "str"}, } def __init__( @@ -9190,19 +9867,19 @@ class KerberosKeytabCredentials(DatastoreCredentials, KerberosCredentials): """ _validation = { - 'kerberos_kdc_address': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, + "kerberos_kdc_address": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "kerberos_principal": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "kerberos_realm": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "credentials_type": {"required": True}, + "secrets": {"required": True}, } _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'KerberosKeytabSecrets'}, + "kerberos_kdc_address": {"key": "kerberosKdcAddress", "type": "str"}, + "kerberos_principal": {"key": "kerberosPrincipal", "type": "str"}, + "kerberos_realm": {"key": "kerberosRealm", "type": "str"}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "secrets": {"key": "secrets", "type": "KerberosKeytabSecrets"}, } def __init__( @@ -9225,13 +9902,18 @@ def __init__( :keyword secrets: Required. [Required] Keytab secrets. :paramtype secrets: ~azure.mgmt.machinelearningservices.models.KerberosKeytabSecrets """ - super(KerberosKeytabCredentials, self).__init__(kerberos_kdc_address=kerberos_kdc_address, kerberos_principal=kerberos_principal, kerberos_realm=kerberos_realm, **kwargs) + super(KerberosKeytabCredentials, self).__init__( + kerberos_kdc_address=kerberos_kdc_address, + kerberos_principal=kerberos_principal, + kerberos_realm=kerberos_realm, + **kwargs + ) self.kerberos_kdc_address = kerberos_kdc_address self.kerberos_principal = kerberos_principal self.kerberos_realm = kerberos_realm - self.credentials_type = 'KerberosKeytab' # type: str + self.credentials_type = "KerberosKeytab" # type: str self.secrets = secrets - self.credentials_type = 'KerberosKeytab' # type: str + self.credentials_type = "KerberosKeytab" # type: str self.secrets = secrets @@ -9249,26 +9931,21 @@ class KerberosKeytabSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'kerberos_keytab': {'key': 'kerberosKeytab', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "kerberos_keytab": {"key": "kerberosKeytab", "type": "str"}, } - def __init__( - self, - *, - kerberos_keytab: Optional[str] = None, - **kwargs - ): + def __init__(self, *, kerberos_keytab: Optional[str] = None, **kwargs): """ :keyword kerberos_keytab: Kerberos keytab secret. :paramtype kerberos_keytab: str """ super(KerberosKeytabSecrets, self).__init__(**kwargs) - self.secrets_type = 'KerberosKeytab' # type: str + self.secrets_type = "KerberosKeytab" # type: str self.kerberos_keytab = kerberos_keytab @@ -9293,19 +9970,19 @@ class KerberosPasswordCredentials(DatastoreCredentials, KerberosCredentials): """ _validation = { - 'kerberos_kdc_address': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, + "kerberos_kdc_address": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "kerberos_principal": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "kerberos_realm": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "credentials_type": {"required": True}, + "secrets": {"required": True}, } _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'KerberosPasswordSecrets'}, + "kerberos_kdc_address": {"key": "kerberosKdcAddress", "type": "str"}, + "kerberos_principal": {"key": "kerberosPrincipal", "type": "str"}, + "kerberos_realm": {"key": "kerberosRealm", "type": "str"}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "secrets": {"key": "secrets", "type": "KerberosPasswordSecrets"}, } def __init__( @@ -9328,13 +10005,18 @@ def __init__( :keyword secrets: Required. [Required] Kerberos password secrets. :paramtype secrets: ~azure.mgmt.machinelearningservices.models.KerberosPasswordSecrets """ - super(KerberosPasswordCredentials, self).__init__(kerberos_kdc_address=kerberos_kdc_address, kerberos_principal=kerberos_principal, kerberos_realm=kerberos_realm, **kwargs) + super(KerberosPasswordCredentials, self).__init__( + kerberos_kdc_address=kerberos_kdc_address, + kerberos_principal=kerberos_principal, + kerberos_realm=kerberos_realm, + **kwargs + ) self.kerberos_kdc_address = kerberos_kdc_address self.kerberos_principal = kerberos_principal self.kerberos_realm = kerberos_realm - self.credentials_type = 'KerberosPassword' # type: str + self.credentials_type = "KerberosPassword" # type: str self.secrets = secrets - self.credentials_type = 'KerberosPassword' # type: str + self.credentials_type = "KerberosPassword" # type: str self.secrets = secrets @@ -9352,26 +10034,21 @@ class KerberosPasswordSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'kerberos_password': {'key': 'kerberosPassword', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "kerberos_password": {"key": "kerberosPassword", "type": "str"}, } - def __init__( - self, - *, - kerberos_password: Optional[str] = None, - **kwargs - ): + def __init__(self, *, kerberos_password: Optional[str] = None, **kwargs): """ :keyword kerberos_password: Kerberos password secret. :paramtype kerberos_password: str """ super(KerberosPasswordSecrets, self).__init__(**kwargs) - self.secrets_type = 'KerberosPassword' # type: str + self.secrets_type = "KerberosPassword" # type: str self.kerberos_password = kerberos_password @@ -9435,32 +10112,53 @@ class OnlineDeploymentDetails(EndpointDeploymentPropertiesBase): """ _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'private_network_connection': {'key': 'privateNetworkConnection', 'type': 'bool'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, + "endpoint_compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, + "egress_public_network_access": { + "key": "egressPublicNetworkAccess", + "type": "str", + }, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, + "model": {"key": "model", "type": "str"}, + "model_mount_path": {"key": "modelMountPath", "type": "str"}, + "private_network_connection": { + "key": "privateNetworkConnection", + "type": "bool", + }, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, } _subtype_map = { - 'endpoint_compute_type': {'Kubernetes': 'KubernetesOnlineDeployment', 'Managed': 'ManagedOnlineDeployment'} + "endpoint_compute_type": { + "Kubernetes": "KubernetesOnlineDeployment", + "Managed": "ManagedOnlineDeployment", + } } def __init__( @@ -9472,7 +10170,9 @@ def __init__( environment_variables: Optional[Dict[str, str]] = None, properties: Optional[Dict[str, str]] = None, app_insights_enabled: Optional[bool] = False, - egress_public_network_access: Optional[Union[str, "EgressPublicNetworkAccessType"]] = None, + egress_public_network_access: Optional[ + Union[str, "EgressPublicNetworkAccessType"] + ] = None, instance_type: Optional[str] = None, liveness_probe: Optional["ProbeSettings"] = None, model: Optional[str] = None, @@ -9524,10 +10224,17 @@ def __init__( and to DefaultScaleSettings for ManagedOnlineDeployment. :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings """ - super(OnlineDeploymentDetails, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, **kwargs) + super(OnlineDeploymentDetails, self).__init__( + code_configuration=code_configuration, + description=description, + environment_id=environment_id, + environment_variables=environment_variables, + properties=properties, + **kwargs + ) self.app_insights_enabled = app_insights_enabled self.egress_public_network_access = egress_public_network_access - self.endpoint_compute_type = 'OnlineDeploymentDetails' # type: str + self.endpoint_compute_type = "OnlineDeploymentDetails" # type: str self.instance_type = instance_type self.liveness_probe = liveness_probe self.model = model @@ -9600,29 +10307,50 @@ class KubernetesOnlineDeployment(OnlineDeploymentDetails): """ _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'private_network_connection': {'key': 'privateNetworkConnection', 'type': 'bool'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - 'container_resource_requirements': {'key': 'containerResourceRequirements', 'type': 'ContainerResourceRequirements'}, + "endpoint_compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, + "egress_public_network_access": { + "key": "egressPublicNetworkAccess", + "type": "str", + }, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, + "model": {"key": "model", "type": "str"}, + "model_mount_path": {"key": "modelMountPath", "type": "str"}, + "private_network_connection": { + "key": "privateNetworkConnection", + "type": "bool", + }, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, + "container_resource_requirements": { + "key": "containerResourceRequirements", + "type": "ContainerResourceRequirements", + }, } def __init__( @@ -9634,7 +10362,9 @@ def __init__( environment_variables: Optional[Dict[str, str]] = None, properties: Optional[Dict[str, str]] = None, app_insights_enabled: Optional[bool] = False, - egress_public_network_access: Optional[Union[str, "EgressPublicNetworkAccessType"]] = None, + egress_public_network_access: Optional[ + Union[str, "EgressPublicNetworkAccessType"] + ] = None, instance_type: Optional[str] = None, liveness_probe: Optional["ProbeSettings"] = None, model: Optional[str] = None, @@ -9643,7 +10373,9 @@ def __init__( readiness_probe: Optional["ProbeSettings"] = None, request_settings: Optional["OnlineRequestSettings"] = None, scale_settings: Optional["OnlineScaleSettings"] = None, - container_resource_requirements: Optional["ContainerResourceRequirements"] = None, + container_resource_requirements: Optional[ + "ContainerResourceRequirements" + ] = None, **kwargs ): """ @@ -9691,8 +10423,25 @@ def __init__( :paramtype container_resource_requirements: ~azure.mgmt.machinelearningservices.models.ContainerResourceRequirements """ - super(KubernetesOnlineDeployment, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, app_insights_enabled=app_insights_enabled, egress_public_network_access=egress_public_network_access, instance_type=instance_type, liveness_probe=liveness_probe, model=model, model_mount_path=model_mount_path, private_network_connection=private_network_connection, readiness_probe=readiness_probe, request_settings=request_settings, scale_settings=scale_settings, **kwargs) - self.endpoint_compute_type = 'Kubernetes' # type: str + super(KubernetesOnlineDeployment, self).__init__( + code_configuration=code_configuration, + description=description, + environment_id=environment_id, + environment_variables=environment_variables, + properties=properties, + app_insights_enabled=app_insights_enabled, + egress_public_network_access=egress_public_network_access, + instance_type=instance_type, + liveness_probe=liveness_probe, + model=model, + model_mount_path=model_mount_path, + private_network_connection=private_network_connection, + readiness_probe=readiness_probe, + request_settings=request_settings, + scale_settings=scale_settings, + **kwargs + ) + self.endpoint_compute_type = "Kubernetes" # type: str self.container_resource_requirements = container_resource_requirements @@ -9712,22 +10461,18 @@ class LiteralJobInput(JobInput): """ _validation = { - 'job_input_type': {'required': True}, - 'value': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "job_input_type": {"required": True}, + "value": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, + "value": {"key": "value", "type": "str"}, } def __init__( - self, - *, - value: str, - description: Optional[str] = None, - **kwargs + self, *, value: str, description: Optional[str] = None, **kwargs ): """ :keyword description: Description for the input. @@ -9735,8 +10480,10 @@ def __init__( :keyword value: Required. [Required] Literal value for the input. :paramtype value: str """ - super(LiteralJobInput, self).__init__(description=description, **kwargs) - self.job_input_type = 'Literal' # type: str + super(LiteralJobInput, self).__init__( + description=description, **kwargs + ) + self.job_input_type = "Literal" # type: str self.value = value @@ -9761,14 +10508,14 @@ class ManagedIdentity(IdentityConfiguration): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + "object_id": {"key": "objectId", "type": "str"}, + "resource_id": {"key": "resourceId", "type": "str"}, } def __init__( @@ -9791,7 +10538,7 @@ def __init__( :paramtype resource_id: str """ super(ManagedIdentity, self).__init__(**kwargs) - self.identity_type = 'Managed' # type: str + self.identity_type = "Managed" # type: str self.client_id = client_id self.object_id = object_id self.resource_id = resource_id @@ -9854,28 +10601,46 @@ class ManagedOnlineDeployment(OnlineDeploymentDetails): """ _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'private_network_connection': {'key': 'privateNetworkConnection', 'type': 'bool'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, + "endpoint_compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, + "egress_public_network_access": { + "key": "egressPublicNetworkAccess", + "type": "str", + }, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, + "model": {"key": "model", "type": "str"}, + "model_mount_path": {"key": "modelMountPath", "type": "str"}, + "private_network_connection": { + "key": "privateNetworkConnection", + "type": "bool", + }, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, } def __init__( @@ -9887,7 +10652,9 @@ def __init__( environment_variables: Optional[Dict[str, str]] = None, properties: Optional[Dict[str, str]] = None, app_insights_enabled: Optional[bool] = False, - egress_public_network_access: Optional[Union[str, "EgressPublicNetworkAccessType"]] = None, + egress_public_network_access: Optional[ + Union[str, "EgressPublicNetworkAccessType"] + ] = None, instance_type: Optional[str] = None, liveness_probe: Optional["ProbeSettings"] = None, model: Optional[str] = None, @@ -9939,8 +10706,25 @@ def __init__( and to DefaultScaleSettings for ManagedOnlineDeployment. :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings """ - super(ManagedOnlineDeployment, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, app_insights_enabled=app_insights_enabled, egress_public_network_access=egress_public_network_access, instance_type=instance_type, liveness_probe=liveness_probe, model=model, model_mount_path=model_mount_path, private_network_connection=private_network_connection, readiness_probe=readiness_probe, request_settings=request_settings, scale_settings=scale_settings, **kwargs) - self.endpoint_compute_type = 'Managed' # type: str + super(ManagedOnlineDeployment, self).__init__( + code_configuration=code_configuration, + description=description, + environment_id=environment_id, + environment_variables=environment_variables, + properties=properties, + app_insights_enabled=app_insights_enabled, + egress_public_network_access=egress_public_network_access, + instance_type=instance_type, + liveness_probe=liveness_probe, + model=model, + model_mount_path=model_mount_path, + private_network_connection=private_network_connection, + readiness_probe=readiness_probe, + request_settings=request_settings, + scale_settings=scale_settings, + **kwargs + ) + self.endpoint_compute_type = "Managed" # type: str class ManagedServiceIdentity(msrest.serialization.Model): @@ -9969,23 +10753,28 @@ class ManagedServiceIdentity(msrest.serialization.Model): """ _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, + "principal_id": {"readonly": True}, + "tenant_id": {"readonly": True}, + "type": {"required": True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{UserAssignedIdentity}", + }, } def __init__( self, *, type: Union[str, "ManagedServiceIdentityType"], - user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, + user_assigned_identities: Optional[ + Dict[str, "UserAssignedIdentity"] + ] = None, **kwargs ): """ @@ -10023,13 +10812,13 @@ class MedianStoppingPolicy(EarlyTerminationPolicy): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, } def __init__( @@ -10045,8 +10834,12 @@ def __init__( :keyword evaluation_interval: Interval (number of runs) between policy evaluations. :paramtype evaluation_interval: int """ - super(MedianStoppingPolicy, self).__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs) - self.policy_type = 'MedianStopping' # type: str + super(MedianStoppingPolicy, self).__init__( + delay_evaluation=delay_evaluation, + evaluation_interval=evaluation_interval, + **kwargs + ) + self.policy_type = "MedianStopping" # type: str class MLFlowModelJobInput(JobInput, AssetJobInput): @@ -10068,15 +10861,15 @@ class MLFlowModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -10096,12 +10889,14 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(MLFlowModelJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(MLFlowModelJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'MLFlowModel' # type: str + self.job_input_type = "MLFlowModel" # type: str self.description = description - self.job_input_type = 'MLFlowModel' # type: str + self.job_input_type = "MLFlowModel" # type: str class MLFlowModelJobOutput(JobOutput, AssetJobOutput): @@ -10122,14 +10917,14 @@ class MLFlowModelJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -10148,12 +10943,14 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(MLFlowModelJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(MLFlowModelJobOutput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_output_type = 'MLFlowModel' # type: str + self.job_output_type = "MLFlowModel" # type: str self.description = description - self.job_output_type = 'MLFlowModel' # type: str + self.job_output_type = "MLFlowModel" # type: str class MLTableData(DataVersionBaseDetails): @@ -10182,19 +10979,19 @@ class MLTableData(DataVersionBaseDetails): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'referenced_uris': {'key': 'referencedUris', 'type': '[str]'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, + "referenced_uris": {"key": "referencedUris", "type": "[str]"}, } def __init__( @@ -10226,8 +11023,16 @@ def __init__( :keyword referenced_uris: Uris referenced in the MLTable definition (required for lineage). :paramtype referenced_uris: list[str] """ - super(MLTableData, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, **kwargs) - self.data_type = 'MLTable' # type: str + super(MLTableData, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + data_uri=data_uri, + **kwargs + ) + self.data_type = "MLTable" # type: str self.referenced_uris = referenced_uris @@ -10250,15 +11055,15 @@ class MLTableJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -10278,12 +11083,14 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(MLTableJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(MLTableJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'MLTable' # type: str + self.job_input_type = "MLTable" # type: str self.description = description - self.job_input_type = 'MLTable' # type: str + self.job_input_type = "MLTable" # type: str class MLTableJobOutput(JobOutput, AssetJobOutput): @@ -10304,14 +11111,14 @@ class MLTableJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -10330,12 +11137,14 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(MLTableJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(MLTableJobOutput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_output_type = 'MLTable' # type: str + self.job_output_type = "MLTable" # type: str self.description = description - self.job_output_type = 'MLTable' # type: str + self.job_output_type = "MLTable" # type: str class ModelContainerData(Resource): @@ -10361,27 +11170,22 @@ class ModelContainerData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelContainerDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "ModelContainerDetails"}, } - def __init__( - self, - *, - properties: "ModelContainerDetails", - **kwargs - ): + def __init__(self, *, properties: "ModelContainerDetails", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelContainerDetails @@ -10410,17 +11214,17 @@ class ModelContainerDetails(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, } def __init__( @@ -10442,7 +11246,13 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(ModelContainerDetails, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) + super(ModelContainerDetails, self).__init__( + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs + ) class ModelContainerResourceArmPaginatedResult(msrest.serialization.Model): @@ -10456,8 +11266,8 @@ class ModelContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelContainerData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ModelContainerData]"}, } def __init__( @@ -10474,7 +11284,9 @@ def __init__( :keyword value: An array of objects of type ModelContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelContainerData] """ - super(ModelContainerResourceArmPaginatedResult, self).__init__(**kwargs) + super(ModelContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -10502,27 +11314,22 @@ class ModelVersionData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelVersionDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "ModelVersionDetails"}, } - def __init__( - self, - *, - properties: "ModelVersionDetails", - **kwargs - ): + def __init__(self, *, properties: "ModelVersionDetails", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelVersionDetails @@ -10556,15 +11363,15 @@ class ModelVersionDetails(AssetBase): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'flavors': {'key': 'flavors', 'type': '{FlavorData}'}, - 'job_name': {'key': 'jobName', 'type': 'str'}, - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'model_uri': {'key': 'modelUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "flavors": {"key": "flavors", "type": "{FlavorData}"}, + "job_name": {"key": "jobName", "type": "str"}, + "model_type": {"key": "modelType", "type": "str"}, + "model_uri": {"key": "modelUri", "type": "str"}, } def __init__( @@ -10602,7 +11409,14 @@ def __init__( :keyword model_uri: The URI path to the model contents. :paramtype model_uri: str """ - super(ModelVersionDetails, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) + super(ModelVersionDetails, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + **kwargs + ) self.flavors = flavors self.job_name = job_name self.model_type = model_type @@ -10620,8 +11434,8 @@ class ModelVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelVersionData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ModelVersionData]"}, } def __init__( @@ -10656,53 +11470,64 @@ class Mpi(DistributionConfiguration): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, + "distribution_type": {"key": "distributionType", "type": "str"}, + "process_count_per_instance": { + "key": "processCountPerInstance", + "type": "int", + }, } def __init__( - self, - *, - process_count_per_instance: Optional[int] = None, - **kwargs + self, *, process_count_per_instance: Optional[int] = None, **kwargs ): """ :keyword process_count_per_instance: Number of processes per MPI node. :paramtype process_count_per_instance: int """ super(Mpi, self).__init__(**kwargs) - self.distribution_type = 'Mpi' # type: str + self.distribution_type = "Mpi" # type: str self.process_count_per_instance = process_count_per_instance class NlpVertical(msrest.serialization.Model): """Abstract class for NLP related AutoML tasks. -NLP - Natural Language Processing. + NLP - Natural Language Processing. - :ivar data_settings: Data inputs for AutoMLJob. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalDataSettings - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar data_settings: Data inputs for AutoMLJob. + :vartype data_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalDataSettings + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings """ _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'NlpVerticalDataSettings'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, + "data_settings": { + "key": "dataSettings", + "type": "NlpVerticalDataSettings", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, } def __init__( self, *, data_settings: Optional["NlpVerticalDataSettings"] = None, - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "NlpVerticalFeaturizationSettings" + ] = None, limit_settings: Optional["NlpVerticalLimitSettings"] = None, **kwargs ): @@ -10723,33 +11548,39 @@ def __init__( class NlpVerticalDataSettings(DataSettings): """Class for data inputs. -NLP - Natural Language Processing. + NLP - Natural Language Processing. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar target_column_name: Required. [Required] Target column name: This is prediction values - column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar test_data: Test data input. - :vartype test_data: ~azure.mgmt.machinelearningservices.models.TestDataSettings - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.TrainingDataSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: - ~azure.mgmt.machinelearningservices.models.NlpVerticalValidationDataSettings + :ivar target_column_name: Required. [Required] Target column name: This is prediction values + column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar test_data: Test data input. + :vartype test_data: ~azure.mgmt.machinelearningservices.models.TestDataSettings + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.TrainingDataSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: + ~azure.mgmt.machinelearningservices.models.NlpVerticalValidationDataSettings """ _validation = { - 'target_column_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'training_data': {'required': True}, + "target_column_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "training_data": {"required": True}, } _attribute_map = { - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'test_data': {'key': 'testData', 'type': 'TestDataSettings'}, - 'training_data': {'key': 'trainingData', 'type': 'TrainingDataSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'NlpVerticalValidationDataSettings'}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "test_data": {"key": "testData", "type": "TestDataSettings"}, + "training_data": { + "key": "trainingData", + "type": "TrainingDataSettings", + }, + "validation_data": { + "key": "validationData", + "type": "NlpVerticalValidationDataSettings", + }, } def __init__( @@ -10774,7 +11605,12 @@ def __init__( :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.NlpVerticalValidationDataSettings """ - super(NlpVerticalDataSettings, self).__init__(target_column_name=target_column_name, test_data=test_data, training_data=training_data, **kwargs) + super(NlpVerticalDataSettings, self).__init__( + target_column_name=target_column_name, + test_data=test_data, + training_data=training_data, + **kwargs + ) self.validation_data = validation_data @@ -10786,20 +11622,17 @@ class NlpVerticalFeaturizationSettings(FeaturizationSettings): """ _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, + "dataset_language": {"key": "datasetLanguage", "type": "str"}, } - def __init__( - self, - *, - dataset_language: Optional[str] = None, - **kwargs - ): + def __init__(self, *, dataset_language: Optional[str] = None, **kwargs): """ :keyword dataset_language: Dataset language, useful for the text data. :paramtype dataset_language: str """ - super(NlpVerticalFeaturizationSettings, self).__init__(dataset_language=dataset_language, **kwargs) + super(NlpVerticalFeaturizationSettings, self).__init__( + dataset_language=dataset_language, **kwargs + ) class NlpVerticalLimitSettings(msrest.serialization.Model): @@ -10814,9 +11647,9 @@ class NlpVerticalLimitSettings(msrest.serialization.Model): """ _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_trials": {"key": "maxTrials", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } def __init__( @@ -10854,8 +11687,8 @@ class NlpVerticalValidationDataSettings(ValidationDataSettings): """ _attribute_map = { - 'data': {'key': 'data', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, + "data": {"key": "data", "type": "MLTableJobInput"}, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, } def __init__( @@ -10874,7 +11707,9 @@ def __init__( Applied when validation dataset is not provided. :paramtype validation_data_size: float """ - super(NlpVerticalValidationDataSettings, self).__init__(data=data, validation_data_size=validation_data_size, **kwargs) + super(NlpVerticalValidationDataSettings, self).__init__( + data=data, validation_data_size=validation_data_size, **kwargs + ) class NoneDatastoreCredentials(DatastoreCredentials): @@ -10889,21 +11724,17 @@ class NoneDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, + "credentials_type": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NoneDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'None' # type: str + self.credentials_type = "None" # type: str class Objective(msrest.serialization.Model): @@ -10919,21 +11750,17 @@ class Objective(msrest.serialization.Model): """ _validation = { - 'goal': {'required': True}, - 'primary_metric': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "goal": {"required": True}, + "primary_metric": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'goal': {'key': 'goal', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "goal": {"key": "goal", "type": "str"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( - self, - *, - goal: Union[str, "Goal"], - primary_metric: str, - **kwargs + self, *, goal: Union[str, "Goal"], primary_metric: str, **kwargs ): """ :keyword goal: Required. [Required] Defines supported metric goals for hyperparameter tuning. @@ -10981,25 +11808,25 @@ class OnlineDeploymentData(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineDeploymentDetails'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": {"key": "properties", "type": "OnlineDeploymentDetails"}, + "sku": {"key": "sku", "type": "Sku"}, } def __init__( @@ -11028,14 +11855,18 @@ def __init__( :keyword sku: Sku details required for ARM contract for Autoscaling. :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ - super(OnlineDeploymentData, self).__init__(tags=tags, location=location, **kwargs) + super(OnlineDeploymentData, self).__init__( + tags=tags, location=location, **kwargs + ) self.identity = identity self.kind = kind self.properties = properties self.sku = sku -class OnlineDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class OnlineDeploymentTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of OnlineDeployment entities. :ivar next_link: The link to the next page of OnlineDeployment objects. If null, there are no @@ -11046,8 +11877,8 @@ class OnlineDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Mod """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineDeploymentData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[OnlineDeploymentData]"}, } def __init__( @@ -11064,7 +11895,9 @@ def __init__( :keyword value: An array of objects of type OnlineDeployment. :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineDeploymentData] """ - super(OnlineDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) + super( + OnlineDeploymentTrackedResourceArmPaginatedResult, self + ).__init__(**kwargs) self.next_link = next_link self.value = value @@ -11103,25 +11936,25 @@ class OnlineEndpointData(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineEndpointDetails'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": {"key": "properties", "type": "OnlineEndpointDetails"}, + "sku": {"key": "sku", "type": "Sku"}, } def __init__( @@ -11150,7 +11983,9 @@ def __init__( :keyword sku: Sku details required for ARM contract for Autoscaling. :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ - super(OnlineEndpointData, self).__init__(tags=tags, location=location, **kwargs) + super(OnlineEndpointData, self).__init__( + tags=tags, location=location, **kwargs + ) self.identity = identity self.kind = kind self.properties = properties @@ -11200,24 +12035,24 @@ class OnlineEndpointDetails(EndpointPropertiesBase): """ _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "auth_mode": {"required": True}, + "scoring_uri": {"readonly": True}, + "swagger_uri": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'mirror_traffic': {'key': 'mirrorTraffic', 'type': '{int}'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, - 'traffic': {'key': 'traffic', 'type': '{int}'}, + "auth_mode": {"key": "authMode", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "keys": {"key": "keys", "type": "EndpointAuthKeys"}, + "properties": {"key": "properties", "type": "{str}"}, + "scoring_uri": {"key": "scoringUri", "type": "str"}, + "swagger_uri": {"key": "swaggerUri", "type": "str"}, + "compute": {"key": "compute", "type": "str"}, + "mirror_traffic": {"key": "mirrorTraffic", "type": "{int}"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "public_network_access": {"key": "publicNetworkAccess", "type": "str"}, + "traffic": {"key": "traffic", "type": "{int}"}, } def __init__( @@ -11229,7 +12064,9 @@ def __init__( properties: Optional[Dict[str, str]] = None, compute: Optional[str] = None, mirror_traffic: Optional[Dict[str, int]] = None, - public_network_access: Optional[Union[str, "PublicNetworkAccessType"]] = None, + public_network_access: Optional[ + Union[str, "PublicNetworkAccessType"] + ] = None, traffic: Optional[Dict[str, int]] = None, **kwargs ): @@ -11260,7 +12097,13 @@ def __init__( values need to sum to 100. :paramtype traffic: dict[str, int] """ - super(OnlineEndpointDetails, self).__init__(auth_mode=auth_mode, description=description, keys=keys, properties=properties, **kwargs) + super(OnlineEndpointDetails, self).__init__( + auth_mode=auth_mode, + description=description, + keys=keys, + properties=properties, + **kwargs + ) self.compute = compute self.mirror_traffic = mirror_traffic self.provisioning_state = None @@ -11268,7 +12111,9 @@ def __init__( self.traffic = traffic -class OnlineEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class OnlineEndpointTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of OnlineEndpoint entities. :ivar next_link: The link to the next page of OnlineEndpoint objects. If null, there are no @@ -11279,8 +12124,8 @@ class OnlineEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineEndpointData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[OnlineEndpointData]"}, } def __init__( @@ -11297,7 +12142,9 @@ def __init__( :keyword value: An array of objects of type OnlineEndpoint. :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineEndpointData] """ - super(OnlineEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) + super(OnlineEndpointTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -11318,9 +12165,12 @@ class OnlineRequestSettings(msrest.serialization.Model): """ _attribute_map = { - 'max_concurrent_requests_per_instance': {'key': 'maxConcurrentRequestsPerInstance', 'type': 'int'}, - 'max_queue_wait': {'key': 'maxQueueWait', 'type': 'duration'}, - 'request_timeout': {'key': 'requestTimeout', 'type': 'duration'}, + "max_concurrent_requests_per_instance": { + "key": "maxConcurrentRequestsPerInstance", + "type": "int", + }, + "max_queue_wait": {"key": "maxQueueWait", "type": "duration"}, + "request_timeout": {"key": "requestTimeout", "type": "duration"}, } def __init__( @@ -11344,7 +12194,9 @@ def __init__( :paramtype request_timeout: ~datetime.timedelta """ super(OnlineRequestSettings, self).__init__(**kwargs) - self.max_concurrent_requests_per_instance = max_concurrent_requests_per_instance + self.max_concurrent_requests_per_instance = ( + max_concurrent_requests_per_instance + ) self.max_queue_wait = max_queue_wait self.request_timeout = request_timeout @@ -11364,13 +12216,13 @@ class OutputPathAssetReference(AssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "job_id": {"key": "jobId", "type": "str"}, + "path": {"key": "path", "type": "str"}, } def __init__( @@ -11387,7 +12239,7 @@ def __init__( :paramtype path: str """ super(OutputPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'OutputPath' # type: str + self.reference_type = "OutputPath" # type: str self.job_id = job_id self.path = path @@ -11406,23 +12258,23 @@ class PartialAssetReferenceBase(msrest.serialization.Model): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, } _subtype_map = { - 'reference_type': {'DataPath': 'PartialDataPathAssetReference', 'Id': 'PartialIdAssetReference', 'OutputPath': 'PartialOutputPathAssetReference'} + "reference_type": { + "DataPath": "PartialDataPathAssetReference", + "Id": "PartialIdAssetReference", + "OutputPath": "PartialOutputPathAssetReference", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(PartialAssetReferenceBase, self).__init__(**kwargs) self.reference_type = None # type: Optional[str] @@ -11472,20 +12324,32 @@ class PartialBatchDeployment(msrest.serialization.Model): """ _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'PartialCodeConfiguration'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'error_threshold': {'key': 'errorThreshold', 'type': 'int'}, - 'logging_level': {'key': 'loggingLevel', 'type': 'str'}, - 'max_concurrency_per_instance': {'key': 'maxConcurrencyPerInstance', 'type': 'int'}, - 'mini_batch_size': {'key': 'miniBatchSize', 'type': 'long'}, - 'model': {'key': 'model', 'type': 'PartialAssetReferenceBase'}, - 'output_action': {'key': 'outputAction', 'type': 'str'}, - 'output_file_name': {'key': 'outputFileName', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'retry_settings': {'key': 'retrySettings', 'type': 'PartialBatchRetrySettings'}, + "code_configuration": { + "key": "codeConfiguration", + "type": "PartialCodeConfiguration", + }, + "compute": {"key": "compute", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "error_threshold": {"key": "errorThreshold", "type": "int"}, + "logging_level": {"key": "loggingLevel", "type": "str"}, + "max_concurrency_per_instance": { + "key": "maxConcurrencyPerInstance", + "type": "int", + }, + "mini_batch_size": {"key": "miniBatchSize", "type": "long"}, + "model": {"key": "model", "type": "PartialAssetReferenceBase"}, + "output_action": {"key": "outputAction", "type": "str"}, + "output_file_name": {"key": "outputFileName", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "retry_settings": { + "key": "retrySettings", + "type": "PartialBatchRetrySettings", + }, } def __init__( @@ -11584,12 +12448,15 @@ class PartialBatchDeploymentPartialTrackedResource(msrest.serialization.Model): """ _attribute_map = { - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'PartialBatchDeployment'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "identity": { + "key": "identity", + "type": "PartialManagedServiceIdentity", + }, + "kind": {"key": "kind", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "properties": {"key": "properties", "type": "PartialBatchDeployment"}, + "sku": {"key": "sku", "type": "PartialSku"}, + "tags": {"key": "tags", "type": "{str}"}, } def __init__( @@ -11618,7 +12485,9 @@ def __init__( :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] """ - super(PartialBatchDeploymentPartialTrackedResource, self).__init__(**kwargs) + super(PartialBatchDeploymentPartialTrackedResource, self).__init__( + **kwargs + ) self.identity = identity self.kind = kind self.location = location @@ -11635,14 +12504,11 @@ class PartialBatchEndpoint(msrest.serialization.Model): """ _attribute_map = { - 'defaults': {'key': 'defaults', 'type': 'BatchEndpointDefaults'}, + "defaults": {"key": "defaults", "type": "BatchEndpointDefaults"}, } def __init__( - self, - *, - defaults: Optional["BatchEndpointDefaults"] = None, - **kwargs + self, *, defaults: Optional["BatchEndpointDefaults"] = None, **kwargs ): """ :keyword defaults: Default values for Batch Endpoint. @@ -11671,12 +12537,15 @@ class PartialBatchEndpointPartialTrackedResource(msrest.serialization.Model): """ _attribute_map = { - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'PartialBatchEndpoint'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "identity": { + "key": "identity", + "type": "PartialManagedServiceIdentity", + }, + "kind": {"key": "kind", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "properties": {"key": "properties", "type": "PartialBatchEndpoint"}, + "sku": {"key": "sku", "type": "PartialSku"}, + "tags": {"key": "tags", "type": "{str}"}, } def __init__( @@ -11705,7 +12574,9 @@ def __init__( :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] """ - super(PartialBatchEndpointPartialTrackedResource, self).__init__(**kwargs) + super(PartialBatchEndpointPartialTrackedResource, self).__init__( + **kwargs + ) self.identity = identity self.kind = kind self.location = location @@ -11724,8 +12595,8 @@ class PartialBatchRetrySettings(msrest.serialization.Model): """ _attribute_map = { - 'max_retries': {'key': 'maxRetries', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "max_retries": {"key": "maxRetries", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } def __init__( @@ -11756,12 +12627,12 @@ class PartialCodeConfiguration(msrest.serialization.Model): """ _validation = { - 'scoring_script': {'min_length': 1}, + "scoring_script": {"min_length": 1}, } _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'scoring_script': {'key': 'scoringScript', 'type': 'str'}, + "code_id": {"key": "codeId", "type": "str"}, + "scoring_script": {"key": "scoringScript", "type": "str"}, } def __init__( @@ -11797,13 +12668,13 @@ class PartialDataPathAssetReference(PartialAssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'datastore_id': {'key': 'datastoreId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "datastore_id": {"key": "datastoreId", "type": "str"}, + "path": {"key": "path", "type": "str"}, } def __init__( @@ -11820,7 +12691,7 @@ def __init__( :paramtype path: str """ super(PartialDataPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'DataPath' # type: str + self.reference_type = "DataPath" # type: str self.datastore_id = datastore_id self.path = path @@ -11838,26 +12709,21 @@ class PartialIdAssetReference(PartialAssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'asset_id': {'key': 'assetId', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "asset_id": {"key": "assetId", "type": "str"}, } - def __init__( - self, - *, - asset_id: Optional[str] = None, - **kwargs - ): + def __init__(self, *, asset_id: Optional[str] = None, **kwargs): """ :keyword asset_id: ARM resource ID of the asset. :paramtype asset_id: str """ super(PartialIdAssetReference, self).__init__(**kwargs) - self.reference_type = 'Id' # type: str + self.reference_type = "Id" # type: str self.asset_id = asset_id @@ -11876,23 +12742,22 @@ class PartialOnlineDeployment(msrest.serialization.Model): """ _validation = { - 'endpoint_compute_type': {'required': True}, + "endpoint_compute_type": {"required": True}, } _attribute_map = { - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, } _subtype_map = { - 'endpoint_compute_type': {'Kubernetes': 'PartialKubernetesOnlineDeployment', 'Managed': 'PartialManagedOnlineDeployment'} + "endpoint_compute_type": { + "Kubernetes": "PartialKubernetesOnlineDeployment", + "Managed": "PartialManagedOnlineDeployment", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(PartialOnlineDeployment, self).__init__(**kwargs) self.endpoint_compute_type = None # type: Optional[str] @@ -11909,21 +12774,17 @@ class PartialKubernetesOnlineDeployment(PartialOnlineDeployment): """ _validation = { - 'endpoint_compute_type': {'required': True}, + "endpoint_compute_type": {"required": True}, } _attribute_map = { - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(PartialKubernetesOnlineDeployment, self).__init__(**kwargs) - self.endpoint_compute_type = 'Kubernetes' # type: str + self.endpoint_compute_type = "Kubernetes" # type: str class PartialManagedOnlineDeployment(PartialOnlineDeployment): @@ -11938,21 +12799,17 @@ class PartialManagedOnlineDeployment(PartialOnlineDeployment): """ _validation = { - 'endpoint_compute_type': {'required': True}, + "endpoint_compute_type": {"required": True}, } _attribute_map = { - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(PartialManagedOnlineDeployment, self).__init__(**kwargs) - self.endpoint_compute_type = 'Managed' # type: str + self.endpoint_compute_type = "Managed" # type: str class PartialManagedServiceIdentity(msrest.serialization.Model): @@ -11970,8 +12827,11 @@ class PartialManagedServiceIdentity(msrest.serialization.Model): """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{object}'}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{object}", + }, } def __init__( @@ -11997,7 +12857,9 @@ def __init__( self.user_assigned_identities = user_assigned_identities -class PartialOnlineDeploymentPartialTrackedResource(msrest.serialization.Model): +class PartialOnlineDeploymentPartialTrackedResource( + msrest.serialization.Model +): """Strictly used in update requests. :ivar identity: Managed service identity (system assigned and/or user assigned identities). @@ -12016,12 +12878,15 @@ class PartialOnlineDeploymentPartialTrackedResource(msrest.serialization.Model): """ _attribute_map = { - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'PartialOnlineDeployment'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "identity": { + "key": "identity", + "type": "PartialManagedServiceIdentity", + }, + "kind": {"key": "kind", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "properties": {"key": "properties", "type": "PartialOnlineDeployment"}, + "sku": {"key": "sku", "type": "PartialSku"}, + "tags": {"key": "tags", "type": "{str}"}, } def __init__( @@ -12050,7 +12915,9 @@ def __init__( :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] """ - super(PartialOnlineDeploymentPartialTrackedResource, self).__init__(**kwargs) + super(PartialOnlineDeploymentPartialTrackedResource, self).__init__( + **kwargs + ) self.identity = identity self.kind = kind self.location = location @@ -12075,16 +12942,18 @@ class PartialOnlineEndpoint(msrest.serialization.Model): """ _attribute_map = { - 'mirror_traffic': {'key': 'mirrorTraffic', 'type': '{int}'}, - 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, - 'traffic': {'key': 'traffic', 'type': '{int}'}, + "mirror_traffic": {"key": "mirrorTraffic", "type": "{int}"}, + "public_network_access": {"key": "publicNetworkAccess", "type": "str"}, + "traffic": {"key": "traffic", "type": "{int}"}, } def __init__( self, *, mirror_traffic: Optional[Dict[str, int]] = None, - public_network_access: Optional[Union[str, "PublicNetworkAccessType"]] = None, + public_network_access: Optional[ + Union[str, "PublicNetworkAccessType"] + ] = None, traffic: Optional[Dict[str, int]] = None, **kwargs ): @@ -12125,12 +12994,15 @@ class PartialOnlineEndpointPartialTrackedResource(msrest.serialization.Model): """ _attribute_map = { - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'PartialOnlineEndpoint'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "identity": { + "key": "identity", + "type": "PartialManagedServiceIdentity", + }, + "kind": {"key": "kind", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "properties": {"key": "properties", "type": "PartialOnlineEndpoint"}, + "sku": {"key": "sku", "type": "PartialSku"}, + "tags": {"key": "tags", "type": "{str}"}, } def __init__( @@ -12159,7 +13031,9 @@ def __init__( :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] """ - super(PartialOnlineEndpointPartialTrackedResource, self).__init__(**kwargs) + super(PartialOnlineEndpointPartialTrackedResource, self).__init__( + **kwargs + ) self.identity = identity self.kind = kind self.location = location @@ -12183,13 +13057,13 @@ class PartialOutputPathAssetReference(PartialAssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "job_id": {"key": "jobId", "type": "str"}, + "path": {"key": "path", "type": "str"}, } def __init__( @@ -12206,7 +13080,7 @@ def __init__( :paramtype path: str """ super(PartialOutputPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'OutputPath' # type: str + self.reference_type = "OutputPath" # type: str self.job_id = job_id self.path = path @@ -12232,11 +13106,11 @@ class PartialSku(msrest.serialization.Model): """ _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'int'}, - 'family': {'key': 'family', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, + "capacity": {"key": "capacity", "type": "int"}, + "family": {"key": "family", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "size": {"key": "size", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, } def __init__( @@ -12324,27 +13198,27 @@ class PipelineJob(JobBaseDetails): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, + "job_type": {"required": True}, + "status": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'ScheduleBase'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'jobs': {'key': 'jobs', 'type': '{object}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'settings': {'key': 'settings', 'type': 'object'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "schedule": {"key": "schedule", "type": "ScheduleBase"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "jobs": {"key": "jobs", "type": "{object}"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "settings": {"key": "settings", "type": "object"}, } def __init__( @@ -12401,8 +13275,20 @@ def __init__( :keyword settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. :paramtype settings: any """ - super(PipelineJob, self).__init__(description=description, properties=properties, tags=tags, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, schedule=schedule, services=services, **kwargs) - self.job_type = 'Pipeline' # type: str + super(PipelineJob, self).__init__( + description=description, + properties=properties, + tags=tags, + compute_id=compute_id, + display_name=display_name, + experiment_name=experiment_name, + identity=identity, + is_archived=is_archived, + schedule=schedule, + services=services, + **kwargs + ) + self.job_type = "Pipeline" # type: str self.inputs = inputs self.jobs = jobs self.outputs = outputs @@ -12425,11 +13311,11 @@ class ProbeSettings(msrest.serialization.Model): """ _attribute_map = { - 'failure_threshold': {'key': 'failureThreshold', 'type': 'int'}, - 'initial_delay': {'key': 'initialDelay', 'type': 'duration'}, - 'period': {'key': 'period', 'type': 'duration'}, - 'success_threshold': {'key': 'successThreshold', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "failure_threshold": {"key": "failureThreshold", "type": "int"}, + "initial_delay": {"key": "initialDelay", "type": "duration"}, + "period": {"key": "period", "type": "duration"}, + "success_threshold": {"key": "successThreshold", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } def __init__( @@ -12476,26 +13362,26 @@ class PyTorch(DistributionConfiguration): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, + "distribution_type": {"key": "distributionType", "type": "str"}, + "process_count_per_instance": { + "key": "processCountPerInstance", + "type": "int", + }, } def __init__( - self, - *, - process_count_per_instance: Optional[int] = None, - **kwargs + self, *, process_count_per_instance: Optional[int] = None, **kwargs ): """ :keyword process_count_per_instance: Number of processes per node. :paramtype process_count_per_instance: int """ super(PyTorch, self).__init__(**kwargs) - self.distribution_type = 'PyTorch' # type: str + self.distribution_type = "PyTorch" # type: str self.process_count_per_instance = process_count_per_instance @@ -12516,13 +13402,16 @@ class RandomSamplingAlgorithm(SamplingAlgorithm): """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - 'rule': {'key': 'rule', 'type': 'str'}, - 'seed': {'key': 'seed', 'type': 'int'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, + "rule": {"key": "rule", "type": "str"}, + "seed": {"key": "seed", "type": "int"}, } def __init__( @@ -12540,7 +13429,7 @@ def __init__( :paramtype seed: int """ super(RandomSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Random' # type: str + self.sampling_algorithm_type = "Random" # type: str self.rule = rule self.seed = seed @@ -12559,14 +13448,14 @@ class RecurrencePattern(msrest.serialization.Model): """ _validation = { - 'hours': {'required': True}, - 'minutes': {'required': True}, + "hours": {"required": True}, + "minutes": {"required": True}, } _attribute_map = { - 'hours': {'key': 'hours', 'type': '[int]'}, - 'minutes': {'key': 'minutes', 'type': '[int]'}, - 'weekdays': {'key': 'weekdays', 'type': '[str]'}, + "hours": {"key": "hours", "type": "[int]"}, + "minutes": {"key": "minutes", "type": "[int]"}, + "weekdays": {"key": "weekdays", "type": "[str]"}, } def __init__( @@ -12620,20 +13509,20 @@ class RecurrenceSchedule(ScheduleBase): """ _validation = { - 'schedule_type': {'required': True}, - 'frequency': {'required': True}, - 'interval': {'required': True}, + "schedule_type": {"required": True}, + "frequency": {"required": True}, + "interval": {"required": True}, } _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'schedule_status': {'key': 'scheduleStatus', 'type': 'str'}, - 'schedule_type': {'key': 'scheduleType', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'pattern': {'key': 'pattern', 'type': 'RecurrencePattern'}, + "end_time": {"key": "endTime", "type": "iso-8601"}, + "schedule_status": {"key": "scheduleStatus", "type": "str"}, + "schedule_type": {"key": "scheduleType", "type": "str"}, + "start_time": {"key": "startTime", "type": "iso-8601"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "frequency": {"key": "frequency", "type": "str"}, + "interval": {"key": "interval", "type": "int"}, + "pattern": {"key": "pattern", "type": "RecurrencePattern"}, } def __init__( @@ -12669,8 +13558,14 @@ def __init__( :keyword pattern: Specifies the recurrence schedule pattern. :paramtype pattern: ~azure.mgmt.machinelearningservices.models.RecurrencePattern """ - super(RecurrenceSchedule, self).__init__(end_time=end_time, schedule_status=schedule_status, start_time=start_time, time_zone=time_zone, **kwargs) - self.schedule_type = 'Recurrence' # type: str + super(RecurrenceSchedule, self).__init__( + end_time=end_time, + schedule_status=schedule_status, + start_time=start_time, + time_zone=time_zone, + **kwargs + ) + self.schedule_type = "Recurrence" # type: str self.frequency = frequency self.interval = interval self.pattern = pattern @@ -12689,12 +13584,12 @@ class RegenerateEndpointKeysRequest(msrest.serialization.Model): """ _validation = { - 'key_type': {'required': True}, + "key_type": {"required": True}, } _attribute_map = { - 'key_type': {'key': 'keyType', 'type': 'str'}, - 'key_value': {'key': 'keyValue', 'type': 'str'}, + "key_type": {"key": "keyType", "type": "str"}, + "key_value": {"key": "keyValue", "type": "str"}, } def __init__( @@ -12752,32 +13647,48 @@ class Regression(AutoMLVertical, TableVertical): """ _validation = { - 'task_type': {'required': True}, + "task_type": {"required": True}, } _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'TableVerticalDataSettings'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'TrainingSettings'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'allowed_models': {'key': 'allowedModels', 'type': '[str]'}, - 'blocked_models': {'key': 'blockedModels', 'type': '[str]'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "data_settings": { + "key": "dataSettings", + "type": "TableVerticalDataSettings", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "training_settings": { + "key": "trainingSettings", + "type": "TrainingSettings", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "allowed_models": {"key": "allowedModels", "type": "[str]"}, + "blocked_models": {"key": "blockedModels", "type": "[str]"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( self, *, data_settings: Optional["TableVerticalDataSettings"] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "TableVerticalFeaturizationSettings" + ] = None, limit_settings: Optional["TableVerticalLimitSettings"] = None, training_settings: Optional["TrainingSettings"] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, allowed_models: Optional[List[Union[str, "RegressionModels"]]] = None, blocked_models: Optional[List[Union[str, "RegressionModels"]]] = None, - primary_metric: Optional[Union[str, "RegressionPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "RegressionPrimaryMetrics"] + ] = None, **kwargs ): """ @@ -12806,17 +13717,24 @@ def __init__( :paramtype primary_metric: str or ~azure.mgmt.machinelearningservices.models.RegressionPrimaryMetrics """ - super(Regression, self).__init__(log_verbosity=log_verbosity, data_settings=data_settings, featurization_settings=featurization_settings, limit_settings=limit_settings, training_settings=training_settings, **kwargs) + super(Regression, self).__init__( + log_verbosity=log_verbosity, + data_settings=data_settings, + featurization_settings=featurization_settings, + limit_settings=limit_settings, + training_settings=training_settings, + **kwargs + ) self.data_settings = data_settings self.featurization_settings = featurization_settings self.limit_settings = limit_settings self.training_settings = training_settings - self.task_type = 'Regression' # type: str + self.task_type = "Regression" # type: str self.allowed_models = allowed_models self.blocked_models = blocked_models self.primary_metric = primary_metric self.log_verbosity = log_verbosity - self.task_type = 'Regression' # type: str + self.task_type = "Regression" # type: str self.allowed_models = allowed_models self.blocked_models = blocked_models self.primary_metric = primary_metric @@ -12834,9 +13752,9 @@ class ResourceConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "properties": {"key": "properties", "type": "{object}"}, } def __init__( @@ -12873,22 +13791,16 @@ class Route(msrest.serialization.Model): """ _validation = { - 'path': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'port': {'required': True}, + "path": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "port": {"required": True}, } _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, + "path": {"key": "path", "type": "str"}, + "port": {"key": "port", "type": "int"}, } - def __init__( - self, - *, - path: str, - port: int, - **kwargs - ): + def __init__(self, *, path: str, port: int, **kwargs): """ :keyword path: Required. [Required] The path for the route. :paramtype path: str @@ -12914,27 +13826,22 @@ class SasDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, + "credentials_type": {"required": True}, + "secrets": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'SasDatastoreSecrets'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "secrets": {"key": "secrets", "type": "SasDatastoreSecrets"}, } - def __init__( - self, - *, - secrets: "SasDatastoreSecrets", - **kwargs - ): + def __init__(self, *, secrets: "SasDatastoreSecrets", **kwargs): """ :keyword secrets: Required. [Required] Storage container secrets. :paramtype secrets: ~azure.mgmt.machinelearningservices.models.SasDatastoreSecrets """ super(SasDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Sas' # type: str + self.credentials_type = "Sas" # type: str self.secrets = secrets @@ -12952,26 +13859,21 @@ class SasDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'sas_token': {'key': 'sasToken', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "sas_token": {"key": "sasToken", "type": "str"}, } - def __init__( - self, - *, - sas_token: Optional[str] = None, - **kwargs - ): + def __init__(self, *, sas_token: Optional[str] = None, **kwargs): """ :keyword sas_token: Storage container SAS token. :paramtype sas_token: str """ super(SasDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Sas' # type: str + self.secrets_type = "Sas" # type: str self.sas_token = sas_token @@ -12997,19 +13899,22 @@ class ServicePrincipalDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, + "credentials_type": {"required": True}, + "client_id": {"required": True}, + "secrets": {"required": True}, + "tenant_id": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'ServicePrincipalDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "authority_url": {"key": "authorityUrl", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + "resource_url": {"key": "resourceUrl", "type": "str"}, + "secrets": { + "key": "secrets", + "type": "ServicePrincipalDatastoreSecrets", + }, + "tenant_id": {"key": "tenantId", "type": "str"}, } def __init__( @@ -13036,7 +13941,7 @@ def __init__( :paramtype tenant_id: str """ super(ServicePrincipalDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'ServicePrincipal' # type: str + self.credentials_type = "ServicePrincipal" # type: str self.authority_url = authority_url self.client_id = client_id self.resource_url = resource_url @@ -13058,26 +13963,21 @@ class ServicePrincipalDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "client_secret": {"key": "clientSecret", "type": "str"}, } - def __init__( - self, - *, - client_secret: Optional[str] = None, - **kwargs - ): + def __init__(self, *, client_secret: Optional[str] = None, **kwargs): """ :keyword client_secret: Service principal secret. :paramtype client_secret: str """ super(ServicePrincipalDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'ServicePrincipal' # type: str + self.secrets_type = "ServicePrincipal" # type: str self.client_secret = client_secret @@ -13104,15 +14004,15 @@ class Sku(msrest.serialization.Model): """ _validation = { - 'name': {'required': True}, + "name": {"required": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'int'}, + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, + "size": {"key": "size", "type": "str"}, + "family": {"key": "family", "type": "str"}, + "capacity": {"key": "capacity", "type": "int"}, } def __init__( @@ -13165,10 +14065,10 @@ class SkuCapacity(msrest.serialization.Model): """ _attribute_map = { - 'default': {'key': 'default', 'type': 'int'}, - 'maximum': {'key': 'maximum', 'type': 'int'}, - 'minimum': {'key': 'minimum', 'type': 'int'}, - 'scale_type': {'key': 'scaleType', 'type': 'str'}, + "default": {"key": "default", "type": "int"}, + "maximum": {"key": "maximum", "type": "int"}, + "minimum": {"key": "minimum", "type": "int"}, + "scale_type": {"key": "scaleType", "type": "str"}, } def __init__( @@ -13212,13 +14112,13 @@ class SkuResource(msrest.serialization.Model): """ _validation = { - 'resource_type': {'readonly': True}, + "resource_type": {"readonly": True}, } _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'SkuSetting'}, + "capacity": {"key": "capacity", "type": "SkuCapacity"}, + "resource_type": {"key": "resourceType", "type": "str"}, + "sku": {"key": "sku", "type": "SkuSetting"}, } def __init__( @@ -13251,8 +14151,8 @@ class SkuResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[SkuResource]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[SkuResource]"}, } def __init__( @@ -13289,12 +14189,12 @@ class SkuSetting(msrest.serialization.Model): """ _validation = { - 'name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, } def __init__( @@ -13337,9 +14237,18 @@ class StackEnsembleSettings(msrest.serialization.Model): """ _attribute_map = { - 'stack_meta_learner_k_wargs': {'key': 'stackMetaLearnerKWargs', 'type': 'object'}, - 'stack_meta_learner_train_percentage': {'key': 'stackMetaLearnerTrainPercentage', 'type': 'float'}, - 'stack_meta_learner_type': {'key': 'stackMetaLearnerType', 'type': 'str'}, + "stack_meta_learner_k_wargs": { + "key": "stackMetaLearnerKWargs", + "type": "object", + }, + "stack_meta_learner_train_percentage": { + "key": "stackMetaLearnerTrainPercentage", + "type": "float", + }, + "stack_meta_learner_type": { + "key": "stackMetaLearnerType", + "type": "str", + }, } def __init__( @@ -13347,7 +14256,9 @@ def __init__( *, stack_meta_learner_k_wargs: Optional[Any] = None, stack_meta_learner_train_percentage: Optional[float] = 0.2, - stack_meta_learner_type: Optional[Union[str, "StackMetaLearnerType"]] = None, + stack_meta_learner_type: Optional[ + Union[str, "StackMetaLearnerType"] + ] = None, **kwargs ): """ @@ -13367,7 +14278,9 @@ def __init__( """ super(StackEnsembleSettings, self).__init__(**kwargs) self.stack_meta_learner_k_wargs = stack_meta_learner_k_wargs - self.stack_meta_learner_train_percentage = stack_meta_learner_train_percentage + self.stack_meta_learner_train_percentage = ( + stack_meta_learner_train_percentage + ) self.stack_meta_learner_type = stack_meta_learner_type @@ -13431,35 +14344,41 @@ class SweepJob(JobBaseDetails): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'objective': {'required': True}, - 'sampling_algorithm': {'required': True}, - 'search_space': {'required': True}, - 'trial': {'required': True}, + "job_type": {"required": True}, + "status": {"readonly": True}, + "objective": {"required": True}, + "sampling_algorithm": {"required": True}, + "search_space": {"required": True}, + "trial": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'ScheduleBase'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'SweepJobLimits'}, - 'objective': {'key': 'objective', 'type': 'Objective'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'SamplingAlgorithm'}, - 'search_space': {'key': 'searchSpace', 'type': 'object'}, - 'trial': {'key': 'trial', 'type': 'TrialComponent'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "schedule": {"key": "schedule", "type": "ScheduleBase"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "limits": {"key": "limits", "type": "SweepJobLimits"}, + "objective": {"key": "objective", "type": "Objective"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "sampling_algorithm": { + "key": "samplingAlgorithm", + "type": "SamplingAlgorithm", + }, + "search_space": {"key": "searchSpace", "type": "object"}, + "trial": {"key": "trial", "type": "TrialComponent"}, } def __init__( @@ -13530,8 +14449,20 @@ def __init__( :keyword trial: Required. [Required] Trial component definition. :paramtype trial: ~azure.mgmt.machinelearningservices.models.TrialComponent """ - super(SweepJob, self).__init__(description=description, properties=properties, tags=tags, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, schedule=schedule, services=services, **kwargs) - self.job_type = 'Sweep' # type: str + super(SweepJob, self).__init__( + description=description, + properties=properties, + tags=tags, + compute_id=compute_id, + display_name=display_name, + experiment_name=experiment_name, + identity=identity, + is_archived=is_archived, + schedule=schedule, + services=services, + **kwargs + ) + self.job_type = "Sweep" # type: str self.early_termination = early_termination self.inputs = inputs self.limits = limits @@ -13562,15 +14493,15 @@ class SweepJobLimits(JobLimits): """ _validation = { - 'job_limits_type': {'required': True}, + "job_limits_type": {"required": True}, } _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_total_trials': {'key': 'maxTotalTrials', 'type': 'int'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, + "job_limits_type": {"key": "jobLimitsType", "type": "str"}, + "timeout": {"key": "timeout", "type": "duration"}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_total_trials": {"key": "maxTotalTrials", "type": "int"}, + "trial_timeout": {"key": "trialTimeout", "type": "duration"}, } def __init__( @@ -13594,7 +14525,7 @@ def __init__( :paramtype trial_timeout: ~datetime.timedelta """ super(SweepJobLimits, self).__init__(timeout=timeout, **kwargs) - self.job_limits_type = 'Sweep' # type: str + self.job_limits_type = "Sweep" # type: str self.max_concurrent_trials = max_concurrent_trials self.max_total_trials = max_total_trials self.trial_timeout = trial_timeout @@ -13620,12 +14551,12 @@ class SystemData(msrest.serialization.Model): """ _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + "created_by": {"key": "createdBy", "type": "str"}, + "created_by_type": {"key": "createdByType", "type": "str"}, + "created_at": {"key": "createdAt", "type": "iso-8601"}, + "last_modified_by": {"key": "lastModifiedBy", "type": "str"}, + "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"}, + "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, } def __init__( @@ -13687,16 +14618,22 @@ class TableVerticalDataSettings(DataSettings): """ _validation = { - 'target_column_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'training_data': {'required': True}, + "target_column_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "training_data": {"required": True}, } _attribute_map = { - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'test_data': {'key': 'testData', 'type': 'TestDataSettings'}, - 'training_data': {'key': 'trainingData', 'type': 'TrainingDataSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'TableVerticalValidationDataSettings'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "test_data": {"key": "testData", "type": "TestDataSettings"}, + "training_data": { + "key": "trainingData", + "type": "TrainingDataSettings", + }, + "validation_data": { + "key": "validationData", + "type": "TableVerticalValidationDataSettings", + }, + "weight_column_name": {"key": "weightColumnName", "type": "str"}, } def __init__( @@ -13705,7 +14642,9 @@ def __init__( target_column_name: str, training_data: "TrainingDataSettings", test_data: Optional["TestDataSettings"] = None, - validation_data: Optional["TableVerticalValidationDataSettings"] = None, + validation_data: Optional[ + "TableVerticalValidationDataSettings" + ] = None, weight_column_name: Optional[str] = None, **kwargs ): @@ -13725,7 +14664,12 @@ def __init__( weighted column as an input, causing rows in the data to be weighted up or down. :paramtype weight_column_name: str """ - super(TableVerticalDataSettings, self).__init__(target_column_name=target_column_name, test_data=test_data, training_data=training_data, **kwargs) + super(TableVerticalDataSettings, self).__init__( + target_column_name=target_column_name, + test_data=test_data, + training_data=training_data, + **kwargs + ) self.validation_data = validation_data self.weight_column_name = weight_column_name @@ -13758,13 +14702,25 @@ class TableVerticalFeaturizationSettings(FeaturizationSettings): """ _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - 'blocked_transformers': {'key': 'blockedTransformers', 'type': '[str]'}, - 'column_name_and_types': {'key': 'columnNameAndTypes', 'type': '{str}'}, - 'drop_columns': {'key': 'dropColumns', 'type': '[str]'}, - 'enable_dnn_featurization': {'key': 'enableDnnFeaturization', 'type': 'bool'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'transformer_params': {'key': 'transformerParams', 'type': '{[ColumnTransformer]}'}, + "dataset_language": {"key": "datasetLanguage", "type": "str"}, + "blocked_transformers": { + "key": "blockedTransformers", + "type": "[str]", + }, + "column_name_and_types": { + "key": "columnNameAndTypes", + "type": "{str}", + }, + "drop_columns": {"key": "dropColumns", "type": "[str]"}, + "enable_dnn_featurization": { + "key": "enableDnnFeaturization", + "type": "bool", + }, + "mode": {"key": "mode", "type": "str"}, + "transformer_params": { + "key": "transformerParams", + "type": "{[ColumnTransformer]}", + }, } def __init__( @@ -13776,7 +14732,9 @@ def __init__( drop_columns: Optional[List[str]] = None, enable_dnn_featurization: Optional[bool] = False, mode: Optional[Union[str, "FeaturizationMode"]] = None, - transformer_params: Optional[Dict[str, List["ColumnTransformer"]]] = None, + transformer_params: Optional[ + Dict[str, List["ColumnTransformer"]] + ] = None, **kwargs ): """ @@ -13803,7 +14761,9 @@ def __init__( :paramtype transformer_params: dict[str, list[~azure.mgmt.machinelearningservices.models.ColumnTransformer]] """ - super(TableVerticalFeaturizationSettings, self).__init__(dataset_language=dataset_language, **kwargs) + super(TableVerticalFeaturizationSettings, self).__init__( + dataset_language=dataset_language, **kwargs + ) self.blocked_transformers = blocked_transformers self.column_name_and_types = column_name_and_types self.drop_columns = drop_columns @@ -13833,13 +14793,16 @@ class TableVerticalLimitSettings(msrest.serialization.Model): """ _attribute_map = { - 'enable_early_termination': {'key': 'enableEarlyTermination', 'type': 'bool'}, - 'exit_score': {'key': 'exitScore', 'type': 'float'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_cores_per_trial': {'key': 'maxCoresPerTrial', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, + "enable_early_termination": { + "key": "enableEarlyTermination", + "type": "bool", + }, + "exit_score": {"key": "exitScore", "type": "float"}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_cores_per_trial": {"key": "maxCoresPerTrial", "type": "int"}, + "max_trials": {"key": "maxTrials", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, + "trial_timeout": {"key": "trialTimeout", "type": "duration"}, } def __init__( @@ -13899,10 +14862,16 @@ class TableVerticalValidationDataSettings(ValidationDataSettings): """ _attribute_map = { - 'data': {'key': 'data', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, + "data": {"key": "data", "type": "MLTableJobInput"}, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, } def __init__( @@ -13929,7 +14898,9 @@ def __init__( when validation dataset is not provided. :paramtype n_cross_validations: ~azure.mgmt.machinelearningservices.models.NCrossValidations """ - super(TableVerticalValidationDataSettings, self).__init__(data=data, validation_data_size=validation_data_size, **kwargs) + super(TableVerticalValidationDataSettings, self).__init__( + data=data, validation_data_size=validation_data_size, **kwargs + ) self.cv_split_column_names = cv_split_column_names self.n_cross_validations = n_cross_validations @@ -13955,15 +14926,18 @@ class TargetUtilizationScaleSettings(OnlineScaleSettings): """ _validation = { - 'scale_type': {'required': True}, + "scale_type": {"required": True}, } _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - 'max_instances': {'key': 'maxInstances', 'type': 'int'}, - 'min_instances': {'key': 'minInstances', 'type': 'int'}, - 'polling_interval': {'key': 'pollingInterval', 'type': 'duration'}, - 'target_utilization_percentage': {'key': 'targetUtilizationPercentage', 'type': 'int'}, + "scale_type": {"key": "scaleType", "type": "str"}, + "max_instances": {"key": "maxInstances", "type": "int"}, + "min_instances": {"key": "minInstances", "type": "int"}, + "polling_interval": {"key": "pollingInterval", "type": "duration"}, + "target_utilization_percentage": { + "key": "targetUtilizationPercentage", + "type": "int", + }, } def __init__( @@ -13988,7 +14962,7 @@ def __init__( :paramtype target_utilization_percentage: int """ super(TargetUtilizationScaleSettings, self).__init__(**kwargs) - self.scale_type = 'TargetUtilization' # type: str + self.scale_type = "TargetUtilization" # type: str self.max_instances = max_instances self.min_instances = min_instances self.polling_interval = polling_interval @@ -14010,13 +14984,16 @@ class TensorFlow(DistributionConfiguration): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'parameter_server_count': {'key': 'parameterServerCount', 'type': 'int'}, - 'worker_count': {'key': 'workerCount', 'type': 'int'}, + "distribution_type": {"key": "distributionType", "type": "str"}, + "parameter_server_count": { + "key": "parameterServerCount", + "type": "int", + }, + "worker_count": {"key": "workerCount", "type": "int"}, } def __init__( @@ -14033,7 +15010,7 @@ def __init__( :paramtype worker_count: int """ super(TensorFlow, self).__init__(**kwargs) - self.distribution_type = 'TensorFlow' # type: str + self.distribution_type = "TensorFlow" # type: str self.parameter_server_count = parameter_server_count self.worker_count = worker_count @@ -14051,8 +15028,8 @@ class TestDataSettings(msrest.serialization.Model): """ _attribute_map = { - 'data': {'key': 'data', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, + "data": {"key": "data", "type": "MLTableJobInput"}, + "test_data_size": {"key": "testDataSize", "type": "float"}, } def __init__( @@ -14078,53 +15055,66 @@ def __init__( class TextClassification(AutoMLVertical, NlpVertical): """Text Classification task in AutoML NLP vertical. -NLP - Natural Language Processing. + NLP - Natural Language Processing. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar data_settings: Data inputs for AutoMLJob. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalDataSettings - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar primary_metric: Primary metric for Text-Classification task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics + :ivar data_settings: Data inputs for AutoMLJob. + :vartype data_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalDataSettings + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar primary_metric: Primary metric for Text-Classification task. Possible values include: + "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ _validation = { - 'task_type': {'required': True}, + "task_type": {"required": True}, } _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'NlpVerticalDataSettings'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "data_settings": { + "key": "dataSettings", + "type": "NlpVerticalDataSettings", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( self, *, data_settings: Optional["NlpVerticalDataSettings"] = None, - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "NlpVerticalFeaturizationSettings" + ] = None, limit_settings: Optional["NlpVerticalLimitSettings"] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, - primary_metric: Optional[Union[str, "ClassificationPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "ClassificationPrimaryMetrics"] + ] = None, **kwargs ): """ @@ -14144,67 +15134,84 @@ def __init__( :paramtype primary_metric: str or ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ - super(TextClassification, self).__init__(log_verbosity=log_verbosity, data_settings=data_settings, featurization_settings=featurization_settings, limit_settings=limit_settings, **kwargs) + super(TextClassification, self).__init__( + log_verbosity=log_verbosity, + data_settings=data_settings, + featurization_settings=featurization_settings, + limit_settings=limit_settings, + **kwargs + ) self.data_settings = data_settings self.featurization_settings = featurization_settings self.limit_settings = limit_settings - self.task_type = 'TextClassification' # type: str + self.task_type = "TextClassification" # type: str self.primary_metric = primary_metric self.log_verbosity = log_verbosity - self.task_type = 'TextClassification' # type: str + self.task_type = "TextClassification" # type: str self.primary_metric = primary_metric class TextClassificationMultilabel(AutoMLVertical, NlpVertical): """Text Classification Multilabel task in AutoML NLP vertical. -NLP - Natural Language Processing. + NLP - Natural Language Processing. - Variables are only populated by the server, and will be ignored when sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar data_settings: Data inputs for AutoMLJob. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalDataSettings - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar primary_metric: Primary metric for Text-Classification-Multilabel task. - Currently only Accuracy is supported as primary metric, hence user need not set it explicitly. - Possible values include: "AUCWeighted", "Accuracy", "NormMacroRecall", - "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics + :ivar data_settings: Data inputs for AutoMLJob. + :vartype data_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalDataSettings + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar primary_metric: Primary metric for Text-Classification-Multilabel task. + Currently only Accuracy is supported as primary metric, hence user need not set it explicitly. + Possible values include: "AUCWeighted", "Accuracy", "NormMacroRecall", + "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted", "IOU". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics """ _validation = { - 'task_type': {'required': True}, - 'primary_metric': {'readonly': True}, + "task_type": {"required": True}, + "primary_metric": {"readonly": True}, } _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'NlpVerticalDataSettings'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "data_settings": { + "key": "dataSettings", + "type": "NlpVerticalDataSettings", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( self, *, data_settings: Optional["NlpVerticalDataSettings"] = None, - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "NlpVerticalFeaturizationSettings" + ] = None, limit_settings: Optional["NlpVerticalLimitSettings"] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, **kwargs @@ -14221,68 +15228,85 @@ def __init__( "Info", "Warning", "Error", "Critical". :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity """ - super(TextClassificationMultilabel, self).__init__(log_verbosity=log_verbosity, data_settings=data_settings, featurization_settings=featurization_settings, limit_settings=limit_settings, **kwargs) + super(TextClassificationMultilabel, self).__init__( + log_verbosity=log_verbosity, + data_settings=data_settings, + featurization_settings=featurization_settings, + limit_settings=limit_settings, + **kwargs + ) self.data_settings = data_settings self.featurization_settings = featurization_settings self.limit_settings = limit_settings - self.task_type = 'TextClassificationMultilabel' # type: str + self.task_type = "TextClassificationMultilabel" # type: str self.primary_metric = None self.log_verbosity = log_verbosity - self.task_type = 'TextClassificationMultilabel' # type: str + self.task_type = "TextClassificationMultilabel" # type: str self.primary_metric = None class TextNer(AutoMLVertical, NlpVertical): """Text-NER task in AutoML NLP vertical. -NER - Named Entity Recognition. -NLP - Natural Language Processing. + NER - Named Entity Recognition. + NLP - Natural Language Processing. - Variables are only populated by the server, and will be ignored when sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar data_settings: Data inputs for AutoMLJob. - :vartype data_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalDataSettings - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar primary_metric: Primary metric for Text-NER task. - Only 'Accuracy' is supported for Text-NER, so user need not set this explicitly. Possible - values include: "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics + :ivar data_settings: Data inputs for AutoMLJob. + :vartype data_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalDataSettings + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar primary_metric: Primary metric for Text-NER task. + Only 'Accuracy' is supported for Text-NER, so user need not set this explicitly. Possible + values include: "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ _validation = { - 'task_type': {'required': True}, - 'primary_metric': {'readonly': True}, + "task_type": {"required": True}, + "primary_metric": {"readonly": True}, } _attribute_map = { - 'data_settings': {'key': 'dataSettings', 'type': 'NlpVerticalDataSettings'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "data_settings": { + "key": "dataSettings", + "type": "NlpVerticalDataSettings", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( self, *, data_settings: Optional["NlpVerticalDataSettings"] = None, - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "NlpVerticalFeaturizationSettings" + ] = None, limit_settings: Optional["NlpVerticalLimitSettings"] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, **kwargs @@ -14299,14 +15323,20 @@ def __init__( "Info", "Warning", "Error", "Critical". :paramtype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity """ - super(TextNer, self).__init__(log_verbosity=log_verbosity, data_settings=data_settings, featurization_settings=featurization_settings, limit_settings=limit_settings, **kwargs) + super(TextNer, self).__init__( + log_verbosity=log_verbosity, + data_settings=data_settings, + featurization_settings=featurization_settings, + limit_settings=limit_settings, + **kwargs + ) self.data_settings = data_settings self.featurization_settings = featurization_settings self.limit_settings = limit_settings - self.task_type = 'TextNER' # type: str + self.task_type = "TextNER" # type: str self.primary_metric = None self.log_verbosity = log_verbosity - self.task_type = 'TextNER' # type: str + self.task_type = "TextNER" # type: str self.primary_metric = None @@ -14320,19 +15350,14 @@ class TrainingDataSettings(msrest.serialization.Model): """ _validation = { - 'data': {'required': True}, + "data": {"required": True}, } _attribute_map = { - 'data': {'key': 'data', 'type': 'MLTableJobInput'}, + "data": {"key": "data", "type": "MLTableJobInput"}, } - def __init__( - self, - *, - data: "MLTableJobInput", - **kwargs - ): + def __init__(self, *, data: "MLTableJobInput", **kwargs): """ :keyword data: Required. [Required] Training data MLTable. :paramtype data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput @@ -14364,13 +15389,28 @@ class TrainingSettings(msrest.serialization.Model): """ _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, + "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, + "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, } def __init__( @@ -14437,17 +15477,27 @@ class TrialComponent(msrest.serialization.Model): """ _validation = { - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "command": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "environment_id": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'ResourceConfiguration'}, + "code_id": {"key": "codeId", "type": "str"}, + "command": {"key": "command", "type": "str"}, + "distribution": { + "key": "distribution", + "type": "DistributionConfiguration", + }, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "resources": {"key": "resources", "type": "ResourceConfiguration"}, } def __init__( @@ -14506,15 +15556,15 @@ class TritonModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -14534,12 +15584,14 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(TritonModelJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(TritonModelJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'TritonModel' # type: str + self.job_input_type = "TritonModel" # type: str self.description = description - self.job_input_type = 'TritonModel' # type: str + self.job_input_type = "TritonModel" # type: str class TritonModelJobOutput(JobOutput, AssetJobOutput): @@ -14560,14 +15612,14 @@ class TritonModelJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -14586,12 +15638,14 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(TritonModelJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(TritonModelJobOutput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_output_type = 'TritonModel' # type: str + self.job_output_type = "TritonModel" # type: str self.description = description - self.job_output_type = 'TritonModel' # type: str + self.job_output_type = "TritonModel" # type: str class TruncationSelectionPolicy(EarlyTerminationPolicy): @@ -14612,14 +15666,17 @@ class TruncationSelectionPolicy(EarlyTerminationPolicy): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'truncation_percentage': {'key': 'truncationPercentage', 'type': 'int'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, + "truncation_percentage": { + "key": "truncationPercentage", + "type": "int", + }, } def __init__( @@ -14638,8 +15695,12 @@ def __init__( :keyword truncation_percentage: The percentage of runs to cancel at each evaluation interval. :paramtype truncation_percentage: int """ - super(TruncationSelectionPolicy, self).__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs) - self.policy_type = 'TruncationSelection' # type: str + super(TruncationSelectionPolicy, self).__init__( + delay_evaluation=delay_evaluation, + evaluation_interval=evaluation_interval, + **kwargs + ) + self.policy_type = "TruncationSelection" # type: str self.truncation_percentage = truncation_percentage @@ -14667,18 +15728,18 @@ class UriFileDataVersion(DataVersionBaseDetails): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, } def __init__( @@ -14707,8 +15768,16 @@ def __init__( Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20220201Preview.Assets.DataVersionBase.DataType. :paramtype data_uri: str """ - super(UriFileDataVersion, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, **kwargs) - self.data_type = 'UriFile' # type: str + super(UriFileDataVersion, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + data_uri=data_uri, + **kwargs + ) + self.data_type = "UriFile" # type: str class UriFileJobInput(JobInput, AssetJobInput): @@ -14730,15 +15799,15 @@ class UriFileJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -14758,12 +15827,14 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(UriFileJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(UriFileJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'UriFile' # type: str + self.job_input_type = "UriFile" # type: str self.description = description - self.job_input_type = 'UriFile' # type: str + self.job_input_type = "UriFile" # type: str class UriFileJobOutput(JobOutput, AssetJobOutput): @@ -14784,14 +15855,14 @@ class UriFileJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -14810,12 +15881,14 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(UriFileJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(UriFileJobOutput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_output_type = 'UriFile' # type: str + self.job_output_type = "UriFile" # type: str self.description = description - self.job_output_type = 'UriFile' # type: str + self.job_output_type = "UriFile" # type: str class UriFolderDataVersion(DataVersionBaseDetails): @@ -14842,18 +15915,18 @@ class UriFolderDataVersion(DataVersionBaseDetails): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, } def __init__( @@ -14882,8 +15955,16 @@ def __init__( Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20220201Preview.Assets.DataVersionBase.DataType. :paramtype data_uri: str """ - super(UriFolderDataVersion, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, **kwargs) - self.data_type = 'UriFolder' # type: str + super(UriFolderDataVersion, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + data_uri=data_uri, + **kwargs + ) + self.data_type = "UriFolder" # type: str class UriFolderJobInput(JobInput, AssetJobInput): @@ -14905,15 +15986,15 @@ class UriFolderJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -14933,12 +16014,14 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(UriFolderJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(UriFolderJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'UriFolder' # type: str + self.job_input_type = "UriFolder" # type: str self.description = description - self.job_input_type = 'UriFolder' # type: str + self.job_input_type = "UriFolder" # type: str class UriFolderJobOutput(JobOutput, AssetJobOutput): @@ -14959,14 +16042,14 @@ class UriFolderJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -14985,12 +16068,14 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(UriFolderJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(UriFolderJobOutput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_output_type = 'UriFolder' # type: str + self.job_output_type = "UriFolder" # type: str self.description = description - self.job_output_type = 'UriFolder' # type: str + self.job_output_type = "UriFolder" # type: str class UserAssignedIdentity(msrest.serialization.Model): @@ -15005,21 +16090,17 @@ class UserAssignedIdentity(msrest.serialization.Model): """ _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, + "principal_id": {"readonly": True}, + "client_id": {"readonly": True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, + "principal_id": {"key": "principalId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UserAssignedIdentity, self).__init__(**kwargs) self.principal_id = None self.client_id = None @@ -15037,18 +16118,14 @@ class UserIdentity(IdentityConfiguration): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UserIdentity, self).__init__(**kwargs) - self.identity_type = 'UserIdentity' # type: str + self.identity_type = "UserIdentity" # type: str diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/__init__.py index a3a3e2ff32ec..b383f4ba1be9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/__init__.py @@ -24,20 +24,20 @@ from ._online_deployments_operations import OnlineDeploymentsOperations __all__ = [ - 'BatchEndpointsOperations', - 'BatchDeploymentsOperations', - 'CodeContainersOperations', - 'CodeVersionsOperations', - 'ComponentContainersOperations', - 'ComponentVersionsOperations', - 'DataContainersOperations', - 'DataVersionsOperations', - 'DatastoresOperations', - 'EnvironmentContainersOperations', - 'EnvironmentVersionsOperations', - 'JobsOperations', - 'ModelContainersOperations', - 'ModelVersionsOperations', - 'OnlineEndpointsOperations', - 'OnlineDeploymentsOperations', + "BatchEndpointsOperations", + "BatchDeploymentsOperations", + "CodeContainersOperations", + "CodeVersionsOperations", + "ComponentContainersOperations", + "ComponentVersionsOperations", + "DataContainersOperations", + "DataVersionsOperations", + "DatastoresOperations", + "EnvironmentContainersOperations", + "EnvironmentVersionsOperations", + "JobsOperations", + "ModelContainersOperations", + "ModelVersionsOperations", + "OnlineEndpointsOperations", + "OnlineDeploymentsOperations", ] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_batch_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_batch_deployments_operations.py index 1bdd5852bc01..030eeec67b63 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_batch_deployments_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_batch_deployments_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -25,9 +31,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + Union, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -248,6 +269,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class BatchDeploymentsOperations(object): """BatchDeploymentsOperations operations. @@ -306,14 +328,19 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.BatchDeploymentTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -322,13 +349,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -345,7 +372,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("BatchDeploymentTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "BatchDeploymentTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -354,21 +384,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments"} # type: ignore def _delete_initial( self, @@ -379,43 +417,59 @@ def _delete_initial( **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, deployment_name=deployment_name, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def begin_delete( @@ -451,43 +505,53 @@ def begin_delete( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, deployment_name=deployment_name, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def get( @@ -516,41 +580,55 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.BatchDeploymentData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeploymentData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, deployment_name=deployment_name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchDeploymentData', pipeline_response) + deserialized = self._deserialize( + "BatchDeploymentData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore def _update_initial( self, @@ -562,15 +640,23 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.BatchDeploymentData"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchDeploymentData"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.BatchDeploymentData"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialBatchDeploymentPartialTrackedResource') + _json = self._serialize.body( + body, "PartialBatchDeploymentPartialTrackedResource" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -580,36 +666,53 @@ def _update_initial( deployment_name=deployment_name, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchDeploymentData', pipeline_response) + deserialized = self._deserialize( + "BatchDeploymentData", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def begin_update( @@ -651,14 +754,21 @@ def begin_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchDeploymentData] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentData"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeploymentData"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -667,33 +777,42 @@ def begin_update( deployment_name=deployment_name, body=body, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeploymentData', pipeline_response) + deserialized = self._deserialize( + "BatchDeploymentData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore def _create_or_update_initial( self, @@ -705,15 +824,21 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.BatchDeploymentData" - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeploymentData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'BatchDeploymentData') + _json = self._serialize.body(body, "BatchDeploymentData") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -723,35 +848,53 @@ def _create_or_update_initial( deployment_name=deployment_name, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchDeploymentData', pipeline_response) + deserialized = self._deserialize( + "BatchDeploymentData", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchDeploymentData', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "BatchDeploymentData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -792,14 +935,21 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchDeploymentData] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentData"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeploymentData"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -808,30 +958,39 @@ def begin_create_or_update( deployment_name=deployment_name, body=body, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeploymentData', pipeline_response) + deserialized = self._deserialize( + "BatchDeploymentData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_batch_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_batch_endpoints_operations.py index 8bf5580c7ca8..9ba3e72b4a2d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_batch_endpoints_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_batch_endpoints_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -25,9 +31,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + Union, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -273,6 +294,7 @@ def build_list_keys_request( **kwargs ) + # fmt: on class BatchEndpointsOperations(object): """BatchEndpointsOperations operations. @@ -325,27 +347,32 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.BatchEndpointTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, count=count, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -360,7 +387,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("BatchEndpointTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "BatchEndpointTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -369,21 +399,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints"} # type: ignore def _delete_initial( self, @@ -393,42 +431,58 @@ def _delete_initial( **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace def begin_delete( @@ -461,42 +515,52 @@ def begin_delete( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace def get( @@ -522,40 +586,54 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.BatchEndpointData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchEndpointData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchEndpointData', pipeline_response) + deserialized = self._deserialize( + "BatchEndpointData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore def _update_initial( self, @@ -566,15 +644,23 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.BatchEndpointData"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchEndpointData"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.BatchEndpointData"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialBatchEndpointPartialTrackedResource') + _json = self._serialize.body( + body, "PartialBatchEndpointPartialTrackedResource" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -583,36 +669,53 @@ def _update_initial( endpoint_name=endpoint_name, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchEndpointData', pipeline_response) + deserialized = self._deserialize( + "BatchEndpointData", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace def begin_update( @@ -651,14 +754,21 @@ def begin_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpointData] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointData"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchEndpointData"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -666,33 +776,42 @@ def begin_update( endpoint_name=endpoint_name, body=body, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpointData', pipeline_response) + deserialized = self._deserialize( + "BatchEndpointData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore def _create_or_update_initial( self, @@ -703,15 +822,21 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.BatchEndpointData" - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchEndpointData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'BatchEndpointData') + _json = self._serialize.body(body, "BatchEndpointData") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -720,35 +845,53 @@ def _create_or_update_initial( endpoint_name=endpoint_name, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchEndpointData', pipeline_response) + deserialized = self._deserialize( + "BatchEndpointData", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchEndpointData', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "BatchEndpointData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -786,14 +929,21 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpointData] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointData"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchEndpointData"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -801,33 +951,42 @@ def begin_create_or_update( endpoint_name=endpoint_name, body=body, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpointData', pipeline_response) + deserialized = self._deserialize( + "BatchEndpointData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace def list_keys( @@ -853,37 +1012,49 @@ def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthKeys"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) + deserialized = self._deserialize("EndpointAuthKeys", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys'} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_code_containers_operations.py index ad4463539388..7e4aae93e025 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_code_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_code_containers_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -23,9 +29,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + Union, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -188,6 +209,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class CodeContainersOperations(object): """CodeContainersOperations operations. @@ -237,26 +259,31 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -270,7 +297,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -279,21 +308,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes"} # type: ignore @distributed_trace def delete( @@ -319,36 +356,46 @@ def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore @distributed_trace def get( @@ -374,40 +421,54 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeContainerData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeContainerData', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "CodeContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore @distributed_trace def create_or_update( @@ -436,15 +497,21 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeContainerData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeContainerData') + _json = self._serialize.body(body, "CodeContainerData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -453,29 +520,42 @@ def create_or_update( name=name, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('CodeContainerData', pipeline_response) + deserialized = self._deserialize( + "CodeContainerData", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('CodeContainerData', pipeline_response) + deserialized = self._deserialize( + "CodeContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_code_versions_operations.py index d909e2941c98..ae14f857cffd 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_code_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_code_versions_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -23,9 +29,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + Union, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -202,6 +223,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class CodeVersionsOperations(object): """CodeVersionsOperations operations. @@ -260,14 +282,19 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -276,13 +303,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -299,7 +326,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -308,21 +337,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions"} # type: ignore @distributed_trace def delete( @@ -351,37 +388,47 @@ def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version=version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -410,41 +457,53 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersionData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeVersionData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version=version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeVersionData', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize("CodeVersionData", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace def create_or_update( @@ -476,15 +535,21 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersionData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeVersionData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeVersionData') + _json = self._serialize.body(body, "CodeVersionData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -494,29 +559,42 @@ def create_or_update( version=version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('CodeVersionData', pipeline_response) + deserialized = self._deserialize( + "CodeVersionData", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('CodeVersionData', pipeline_response) + deserialized = self._deserialize( + "CodeVersionData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_component_containers_operations.py index 1e9cbf7b959d..86cf5d4685af 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_component_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_component_containers_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -23,9 +29,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + Union, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -191,6 +212,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class ComponentContainersOperations(object): """ComponentContainersOperations operations. @@ -243,27 +265,32 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -278,7 +305,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -287,21 +317,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components"} # type: ignore @distributed_trace def delete( @@ -327,36 +365,46 @@ def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore @distributed_trace def get( @@ -382,40 +430,54 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainerData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentContainerData', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "ComponentContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore @distributed_trace def create_or_update( @@ -444,15 +506,21 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainerData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentContainerData') + _json = self._serialize.body(body, "ComponentContainerData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -461,29 +529,42 @@ def create_or_update( name=name, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ComponentContainerData', pipeline_response) + deserialized = self._deserialize( + "ComponentContainerData", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ComponentContainerData', pipeline_response) + deserialized = self._deserialize( + "ComponentContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_component_versions_operations.py index e6a71b2bb151..9b81887025cb 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_component_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_component_versions_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -23,9 +29,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + Union, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -205,6 +226,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class ComponentVersionsOperations(object): """ComponentVersionsOperations operations. @@ -266,14 +288,19 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -283,13 +310,13 @@ def prepare_request(next_link=None): top=top, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -307,7 +334,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -316,21 +345,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions"} # type: ignore @distributed_trace def delete( @@ -359,37 +396,47 @@ def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version=version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -418,41 +465,55 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersionData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersionData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version=version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentVersionData', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "ComponentVersionData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace def create_or_update( @@ -484,15 +545,21 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersionData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersionData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentVersionData') + _json = self._serialize.body(body, "ComponentVersionData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -502,29 +569,42 @@ def create_or_update( version=version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ComponentVersionData', pipeline_response) + deserialized = self._deserialize( + "ComponentVersionData", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ComponentVersionData', pipeline_response) + deserialized = self._deserialize( + "ComponentVersionData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_data_containers_operations.py index f5719d84b86f..4a4fedca558a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_data_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_data_containers_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -23,9 +29,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + Union, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -191,6 +212,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class DataContainersOperations(object): """DataContainersOperations operations. @@ -243,27 +265,32 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -278,7 +305,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -287,21 +316,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data"} # type: ignore @distributed_trace def delete( @@ -327,36 +364,46 @@ def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore @distributed_trace def get( @@ -382,40 +429,54 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataContainerData', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "DataContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore @distributed_trace def create_or_update( @@ -444,15 +505,21 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DataContainerData') + _json = self._serialize.body(body, "DataContainerData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -461,29 +528,42 @@ def create_or_update( name=name, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('DataContainerData', pipeline_response) + deserialized = self._deserialize( + "DataContainerData", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('DataContainerData', pipeline_response) + deserialized = self._deserialize( + "DataContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_data_versions_operations.py index d862606330f6..7edb48ed363a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_data_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_data_versions_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -23,9 +29,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + Union, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -208,6 +229,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class DataVersionsOperations(object): """DataVersionsOperations operations. @@ -276,14 +298,19 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -294,13 +321,13 @@ def prepare_request(next_link=None): skip=skip, tags=tags, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -319,7 +346,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataVersionBaseResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -328,21 +357,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions"} # type: ignore @distributed_trace def delete( @@ -371,37 +408,47 @@ def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version=version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -430,41 +477,55 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBaseData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBaseData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version=version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataVersionBaseData', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "DataVersionBaseData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace def create_or_update( @@ -496,15 +557,21 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBaseData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBaseData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DataVersionBaseData') + _json = self._serialize.body(body, "DataVersionBaseData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -514,29 +581,42 @@ def create_or_update( version=version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('DataVersionBaseData', pipeline_response) + deserialized = self._deserialize( + "DataVersionBaseData", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('DataVersionBaseData', pipeline_response) + deserialized = self._deserialize( + "DataVersionBaseData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_datastores_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_datastores_operations.py index 2e27c87ccd46..c6b0cc6ff714 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_datastores_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_datastores_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -23,9 +29,25 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, List, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + List, + Optional, + TypeVar, + Union, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -247,6 +269,7 @@ def build_list_secrets_request( **kwargs ) + # fmt: on class DatastoresOperations(object): """DatastoresOperations operations. @@ -314,14 +337,19 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DatastoreResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -333,13 +361,13 @@ def prepare_request(next_link=None): search_text=search_text, order_by=order_by, order_by_asc=order_by_asc, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -359,7 +387,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("DatastoreResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DatastoreResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -368,21 +398,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores"} # type: ignore @distributed_trace def delete( @@ -408,36 +446,46 @@ def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace def get( @@ -463,40 +511,50 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.DatastoreData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreData"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DatastoreData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DatastoreData', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize("DatastoreData", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace def create_or_update( @@ -528,15 +586,19 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.DatastoreData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreData"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DatastoreData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DatastoreData') + _json = self._serialize.body(body, "DatastoreData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -546,32 +608,45 @@ def create_or_update( content_type=content_type, json=_json, skip_validation=skip_validation, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('DatastoreData', pipeline_response) + deserialized = self._deserialize( + "DatastoreData", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('DatastoreData', pipeline_response) + deserialized = self._deserialize( + "DatastoreData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace def list_secrets( @@ -597,37 +672,49 @@ def list_secrets( :rtype: ~azure.mgmt.machinelearningservices.models.DatastoreSecrets :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreSecrets"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DatastoreSecrets"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_secrets_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.list_secrets.metadata['url'], + template_url=self.list_secrets.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DatastoreSecrets', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize("DatastoreSecrets", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets'} # type: ignore - + list_secrets.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_environment_containers_operations.py index accdfff6fdff..29cf66d77260 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_environment_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_environment_containers_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -23,9 +29,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + Union, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -191,6 +212,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class EnvironmentContainersOperations(object): """EnvironmentContainersOperations operations. @@ -243,27 +265,32 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -278,7 +305,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -287,21 +317,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments"} # type: ignore @distributed_trace def delete( @@ -327,36 +365,46 @@ def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore @distributed_trace def get( @@ -382,40 +430,54 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainerData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentContainerData', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "EnvironmentContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore @distributed_trace def create_or_update( @@ -444,15 +506,21 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainerData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentContainerData') + _json = self._serialize.body(body, "EnvironmentContainerData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -461,29 +529,42 @@ def create_or_update( name=name, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainerData', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainerData", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('EnvironmentContainerData', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_environment_versions_operations.py index a530e2ee5fa3..973caa880691 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_environment_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_environment_versions_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -23,9 +29,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + Union, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -205,6 +226,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class EnvironmentVersionsOperations(object): """EnvironmentVersionsOperations operations. @@ -266,14 +288,19 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -283,13 +310,13 @@ def prepare_request(next_link=None): top=top, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -307,7 +334,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersionResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -316,21 +346,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions"} # type: ignore @distributed_trace def delete( @@ -359,37 +397,47 @@ def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version=version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -418,41 +466,55 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersionData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version=version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentVersionData', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "EnvironmentVersionData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace def create_or_update( @@ -484,15 +546,21 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersionData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentVersionData') + _json = self._serialize.body(body, "EnvironmentVersionData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -502,29 +570,42 @@ def create_or_update( version=version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersionData', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersionData", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('EnvironmentVersionData', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersionData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_jobs_operations.py index e8197d202f3e..80d787fd2c8f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_jobs_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_jobs_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -25,9 +31,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + Union, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -243,6 +264,7 @@ def build_cancel_request( **kwargs ) + # fmt: on class JobsOperations(object): """JobsOperations operations. @@ -307,14 +329,19 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.JobBaseResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -325,13 +352,13 @@ def prepare_request(next_link=None): list_view_type=list_view_type, scheduled=scheduled, schedule_id=schedule_id, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -350,7 +377,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("JobBaseResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "JobBaseResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -359,21 +388,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs"} # type: ignore def _delete_initial( self, @@ -383,42 +420,58 @@ def _delete_initial( **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}'} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace def begin_delete( @@ -451,42 +504,52 @@ def begin_delete( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}'} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace def get( @@ -512,40 +575,50 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.JobBaseData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBaseData"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.JobBaseData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('JobBaseData', pipeline_response) + deserialized = self._deserialize("JobBaseData", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace def create_or_update( @@ -574,15 +647,19 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.JobBaseData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBaseData"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.JobBaseData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'JobBaseData') + _json = self._serialize.body(body, "JobBaseData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -591,32 +668,41 @@ def create_or_update( id=id, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('JobBaseData', pipeline_response) + deserialized = self._deserialize("JobBaseData", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('JobBaseData', pipeline_response) + deserialized = self._deserialize("JobBaseData", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace def cancel( @@ -642,33 +728,43 @@ def cancel( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_cancel_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, - template_url=self.cancel.metadata['url'], + template_url=self.cancel.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel'} # type: ignore - + cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_model_containers_operations.py index d136a15baca3..c470f7104c0e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_model_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_model_containers_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -23,9 +29,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + Union, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -194,6 +215,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class ModelContainersOperations(object): """ModelContainersOperations operations. @@ -249,14 +271,19 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -264,13 +291,13 @@ def prepare_request(next_link=None): skip=skip, count=count, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -286,7 +313,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -295,21 +324,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models"} # type: ignore @distributed_trace def delete( @@ -335,36 +372,46 @@ def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore @distributed_trace def get( @@ -390,40 +437,54 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainerData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelContainerData', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "ModelContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore @distributed_trace def create_or_update( @@ -452,15 +513,21 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainerData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelContainerData') + _json = self._serialize.body(body, "ModelContainerData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -469,29 +536,42 @@ def create_or_update( name=name, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ModelContainerData', pipeline_response) + deserialized = self._deserialize( + "ModelContainerData", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ModelContainerData', pipeline_response) + deserialized = self._deserialize( + "ModelContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_model_versions_operations.py index 369cf06f7125..3773b0a93721 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_model_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_model_versions_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -23,9 +29,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + Union, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -223,6 +244,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class ModelVersionsOperations(object): """ModelVersionsOperations operations. @@ -304,14 +326,19 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -327,13 +354,13 @@ def prepare_request(next_link=None): properties=properties, feed=feed, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -357,7 +384,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -366,21 +395,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions"} # type: ignore @distributed_trace def delete( @@ -409,37 +446,47 @@ def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version=version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -468,41 +515,53 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersionData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelVersionData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version=version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelVersionData', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize("ModelVersionData", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace def create_or_update( @@ -534,15 +593,21 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersionData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelVersionData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelVersionData') + _json = self._serialize.body(body, "ModelVersionData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -552,29 +617,42 @@ def create_or_update( version=version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ModelVersionData', pipeline_response) + deserialized = self._deserialize( + "ModelVersionData", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ModelVersionData', pipeline_response) + deserialized = self._deserialize( + "ModelVersionData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_online_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_online_deployments_operations.py index 734da688e6c1..1b4995f46116 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_online_deployments_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_online_deployments_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -25,9 +31,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + Union, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -339,6 +360,7 @@ def build_list_skus_request( **kwargs ) + # fmt: on class OnlineDeploymentsOperations(object): """OnlineDeploymentsOperations operations. @@ -397,14 +419,19 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.OnlineDeploymentTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -413,13 +440,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -436,7 +463,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineDeploymentTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "OnlineDeploymentTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -445,21 +475,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments"} # type: ignore def _delete_initial( self, @@ -470,43 +508,59 @@ def _delete_initial( **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, deployment_name=deployment_name, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def begin_delete( @@ -542,43 +596,53 @@ def begin_delete( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, deployment_name=deployment_name, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def get( @@ -607,41 +671,55 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.OnlineDeploymentData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeploymentData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, deployment_name=deployment_name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('OnlineDeploymentData', pipeline_response) + deserialized = self._deserialize( + "OnlineDeploymentData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore def _update_initial( self, @@ -653,15 +731,23 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.OnlineDeploymentData"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineDeploymentData"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.OnlineDeploymentData"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialOnlineDeploymentPartialTrackedResource') + _json = self._serialize.body( + body, "PartialOnlineDeploymentPartialTrackedResource" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -671,36 +757,53 @@ def _update_initial( deployment_name=deployment_name, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineDeploymentData', pipeline_response) + deserialized = self._deserialize( + "OnlineDeploymentData", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def begin_update( @@ -742,14 +845,21 @@ def begin_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeploymentData] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentData"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeploymentData"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -758,33 +868,42 @@ def begin_update( deployment_name=deployment_name, body=body, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeploymentData', pipeline_response) + deserialized = self._deserialize( + "OnlineDeploymentData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore def _create_or_update_initial( self, @@ -796,15 +915,21 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.OnlineDeploymentData" - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeploymentData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'OnlineDeploymentData') + _json = self._serialize.body(body, "OnlineDeploymentData") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -814,35 +939,53 @@ def _create_or_update_initial( deployment_name=deployment_name, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineDeploymentData', pipeline_response) + deserialized = self._deserialize( + "OnlineDeploymentData", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineDeploymentData', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "OnlineDeploymentData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -883,14 +1026,21 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeploymentData] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentData"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeploymentData"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -899,33 +1049,42 @@ def begin_create_or_update( deployment_name=deployment_name, body=body, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeploymentData', pipeline_response) + deserialized = self._deserialize( + "OnlineDeploymentData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def get_logs( @@ -957,15 +1116,21 @@ def get_logs( :rtype: ~azure.mgmt.machinelearningservices.models.DeploymentLogs :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentLogs"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DeploymentLogs"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DeploymentLogsRequest') + _json = self._serialize.body(body, "DeploymentLogsRequest") request = build_get_logs_request( subscription_id=self._config.subscription_id, @@ -975,28 +1140,37 @@ def get_logs( deployment_name=deployment_name, content_type=content_type, json=_json, - template_url=self.get_logs.metadata['url'], + template_url=self.get_logs.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DeploymentLogs', pipeline_response) + deserialized = self._deserialize("DeploymentLogs", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_logs.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs'} # type: ignore - + get_logs.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs"} # type: ignore @distributed_trace def list_skus( @@ -1033,14 +1207,19 @@ def list_skus( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.SkuResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.SkuResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_skus_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -1049,13 +1228,13 @@ def prepare_request(next_link=None): deployment_name=deployment_name, count=count, skip=skip, - template_url=self.list_skus.metadata['url'], + template_url=self.list_skus.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_skus_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -1072,7 +1251,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("SkuResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "SkuResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1081,18 +1262,26 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_skus.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus'} # type: ignore + list_skus.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_online_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_online_endpoints_operations.py index c09668a6ad08..1a2af1fa6c65 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_online_endpoints_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_online_endpoints_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -25,9 +31,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + Union, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -368,6 +389,7 @@ def build_get_token_request( **kwargs ) + # fmt: on class OnlineEndpointsOperations(object): """OnlineEndpointsOperations operations. @@ -438,14 +460,19 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.OnlineEndpointTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -457,13 +484,13 @@ def prepare_request(next_link=None): tags=tags, properties=properties, order_by=order_by, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -483,7 +510,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineEndpointTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "OnlineEndpointTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -492,21 +522,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints"} # type: ignore def _delete_initial( self, @@ -516,42 +554,58 @@ def _delete_initial( **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace def begin_delete( @@ -584,42 +638,52 @@ def begin_delete( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace def get( @@ -645,40 +709,54 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.OnlineEndpointData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpointData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('OnlineEndpointData', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpointData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore def _update_initial( self, @@ -689,15 +767,23 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.OnlineEndpointData"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineEndpointData"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.OnlineEndpointData"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialOnlineEndpointPartialTrackedResource') + _json = self._serialize.body( + body, "PartialOnlineEndpointPartialTrackedResource" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -706,36 +792,53 @@ def _update_initial( endpoint_name=endpoint_name, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpointData', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpointData", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace def begin_update( @@ -774,14 +877,21 @@ def begin_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpointData] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointData"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpointData"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -789,33 +899,42 @@ def begin_update( endpoint_name=endpoint_name, body=body, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpointData', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpointData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore def _create_or_update_initial( self, @@ -826,15 +945,21 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.OnlineEndpointData" - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpointData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'OnlineEndpointData') + _json = self._serialize.body(body, "OnlineEndpointData") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -843,35 +968,53 @@ def _create_or_update_initial( endpoint_name=endpoint_name, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpointData', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpointData", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineEndpointData', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "OnlineEndpointData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -909,14 +1052,21 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpointData] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointData"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpointData"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -924,33 +1074,42 @@ def begin_create_or_update( endpoint_name=endpoint_name, body=body, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpointData', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpointData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace def list_keys( @@ -976,40 +1135,52 @@ def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthKeys"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) + deserialized = self._deserialize("EndpointAuthKeys", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys'} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys"} # type: ignore def _regenerate_keys_initial( self, @@ -1020,15 +1191,19 @@ def _regenerate_keys_initial( **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'RegenerateEndpointKeysRequest') + _json = self._serialize.body(body, "RegenerateEndpointKeysRequest") request = build_regenerate_keys_request_initial( subscription_id=self._config.subscription_id, @@ -1037,29 +1212,39 @@ def _regenerate_keys_initial( endpoint_name=endpoint_name, content_type=content_type, json=_json, - template_url=self._regenerate_keys_initial.metadata['url'], + template_url=self._regenerate_keys_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _regenerate_keys_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys'} # type: ignore - + _regenerate_keys_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore @distributed_trace def begin_regenerate_keys( @@ -1095,14 +1280,19 @@ def begin_regenerate_keys( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._regenerate_keys_initial( resource_group_name=resource_group_name, @@ -1110,30 +1300,41 @@ def begin_regenerate_keys( endpoint_name=endpoint_name, body=body, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_regenerate_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys'} # type: ignore + begin_regenerate_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore @distributed_trace def get_token( @@ -1159,37 +1360,51 @@ def get_token( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthToken :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthToken"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthToken"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_token_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, - template_url=self.get_token.metadata['url'], + template_url=self.get_token.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EndpointAuthToken', pipeline_response) + deserialized = self._deserialize( + "EndpointAuthToken", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token'} # type: ignore - + get_token.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/__init__.py index da46614477a9..71cf8fdc020d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/__init__.py @@ -10,9 +10,10 @@ from ._version import VERSION __version__ = VERSION -__all__ = ['AzureMachineLearningWorkspaces'] +__all__ = ["AzureMachineLearningWorkspaces"] # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk + patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/_azure_machine_learning_workspaces.py index d1d0c8e0c9f0..ceb8d36db4c8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/_azure_machine_learning_workspaces.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/_azure_machine_learning_workspaces.py @@ -14,7 +14,34 @@ from . import models from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import BatchDeploymentsOperations, BatchEndpointsOperations, CodeContainersOperations, CodeVersionsOperations, ComponentContainersOperations, ComponentVersionsOperations, ComputeOperations, DataContainersOperations, DataVersionsOperations, DatastoresOperations, EnvironmentContainersOperations, EnvironmentVersionsOperations, JobsOperations, ModelContainersOperations, ModelVersionsOperations, OnlineDeploymentsOperations, OnlineEndpointsOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, QuotasOperations, UsagesOperations, VirtualMachineSizesOperations, WorkspaceConnectionsOperations, WorkspaceFeaturesOperations, WorkspacesOperations +from .operations import ( + BatchDeploymentsOperations, + BatchEndpointsOperations, + CodeContainersOperations, + CodeVersionsOperations, + ComponentContainersOperations, + ComponentVersionsOperations, + ComputeOperations, + DataContainersOperations, + DataVersionsOperations, + DatastoresOperations, + EnvironmentContainersOperations, + EnvironmentVersionsOperations, + JobsOperations, + ModelContainersOperations, + ModelVersionsOperations, + OnlineDeploymentsOperations, + OnlineEndpointsOperations, + Operations, + PrivateEndpointConnectionsOperations, + PrivateLinkResourcesOperations, + QuotasOperations, + UsagesOperations, + VirtualMachineSizesOperations, + WorkspaceConnectionsOperations, + WorkspaceFeaturesOperations, + WorkspacesOperations, +) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -23,6 +50,7 @@ from azure.core.credentials import TokenCredential from azure.core.rest import HttpRequest, HttpResponse + class AzureMachineLearningWorkspaces(object): """These APIs allow end users to operate on Azure Machine Learning Workspace resources. @@ -112,40 +140,99 @@ def __init__( **kwargs # type: Any ): # type: (...) -> None - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._config = AzureMachineLearningWorkspacesConfiguration( + credential=credential, subscription_id=subscription_id, **kwargs + ) + self._client = ARMPipelineClient( + base_url=base_url, config=self._config, **kwargs + ) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = { + k: v for k, v in models.__dict__.items() if isinstance(v, type) + } self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.batch_endpoints = BatchEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_deployments = BatchDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_containers = CodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_versions = CodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_containers = ComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_versions = ComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_containers = DataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_versions = DataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.datastores = DatastoresOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_containers = EnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_versions = EnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_containers = ModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_versions = ModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_endpoints = OnlineEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_deployments = OnlineDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.workspaces = WorkspacesOperations(self._client, self._config, self._serialize, self._deserialize) - self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) - self.virtual_machine_sizes = VirtualMachineSizesOperations(self._client, self._config, self._serialize, self._deserialize) - self.quotas = QuotasOperations(self._client, self._config, self._serialize, self._deserialize) - self.compute = ComputeOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_connections = WorkspaceConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_features = WorkspaceFeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - + self.batch_endpoints = BatchEndpointsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.batch_deployments = BatchDeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.code_containers = CodeContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.code_versions = CodeVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.component_containers = ComponentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.component_versions = ComponentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_containers = DataContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_versions = DataVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.datastores = DatastoresOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.environment_containers = EnvironmentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.environment_versions = EnvironmentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.jobs = JobsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.model_containers = ModelContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.model_versions = ModelVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.online_endpoints = OnlineEndpointsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.online_deployments = OnlineDeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspaces = WorkspacesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.usages = UsagesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.virtual_machine_sizes = VirtualMachineSizesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.quotas = QuotasOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.compute = ComputeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.private_endpoint_connections = ( + PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspace_connections = WorkspaceConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspace_features = WorkspaceFeaturesOperations( + self._client, self._config, self._serialize, self._deserialize + ) def _send_request( self, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/_configuration.py index e3e0b6ff4546..5efbba719076 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/_configuration.py @@ -10,7 +10,10 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ( + ARMChallengeAuthenticationPolicy, + ARMHttpLoggingPolicy, +) from ._version import VERSION @@ -40,7 +43,9 @@ def __init__( **kwargs # type: Any ): # type: (...) -> None - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) + super(AzureMachineLearningWorkspacesConfiguration, self).__init__( + **kwargs + ) if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: @@ -49,23 +54,44 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2022-05-01" - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) + self.credential_scopes = kwargs.pop( + "credential_scopes", ["https://management.azure.com/.default"] + ) + kwargs.setdefault( + "sdk_moniker", "mgmt-machinelearningservices/{}".format(VERSION) + ) self._configure(**kwargs) def _configure( - self, - **kwargs # type: Any + self, **kwargs # type: Any ): # type: (...) -> None - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') + self.user_agent_policy = kwargs.get( + "user_agent_policy" + ) or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get( + "headers_policy" + ) or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy( + **kwargs + ) + self.logging_policy = kwargs.get( + "logging_policy" + ) or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get( + "http_logging_policy" + ) or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy( + **kwargs + ) + self.custom_hook_policy = kwargs.get( + "custom_hook_policy" + ) or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get( + "redirect_policy" + ) or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = ARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/_patch.py index 74e48ecd07cf..17dbc073e01b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/_patch.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/_patch.py @@ -25,7 +25,8 @@ # # -------------------------------------------------------------------------- + # This file is used for handwritten extensions to the generated code. Example: # https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md def patch_sdk(): - pass \ No newline at end of file + pass diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/_vendor.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/_vendor.py index 138f663c53a4..ed3373e9699d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/_vendor.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/_vendor.py @@ -7,13 +7,20 @@ from azure.core.pipeline.transport import HttpRequest + def _convert_request(request, files=None): data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + request = HttpRequest( + method=request.method, + url=request.url, + headers=request.headers, + data=data, + ) if files: request.set_formdata_body(files) return request + def _format_url_section(template, **kwargs): components = template.split("/") while components: @@ -22,6 +29,8 @@ def _format_url_section(template, **kwargs): except KeyError as key: formatted_components = template.split("/") components = [ - c for c in formatted_components if "{}".format(key.args[0]) not in c + c + for c in formatted_components + if "{}".format(key.args[0]) not in c ] template = "/".join(components) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/__init__.py index f67ccda966f1..b90ec7485f14 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/__init__.py @@ -7,9 +7,11 @@ # -------------------------------------------------------------------------- from ._azure_machine_learning_workspaces import AzureMachineLearningWorkspaces -__all__ = ['AzureMachineLearningWorkspaces'] + +__all__ = ["AzureMachineLearningWorkspaces"] # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk + patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/_azure_machine_learning_workspaces.py index 028d3ad3464e..cc91237f0317 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/_azure_machine_learning_workspaces.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/_azure_machine_learning_workspaces.py @@ -15,12 +15,40 @@ from .. import models from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import BatchDeploymentsOperations, BatchEndpointsOperations, CodeContainersOperations, CodeVersionsOperations, ComponentContainersOperations, ComponentVersionsOperations, ComputeOperations, DataContainersOperations, DataVersionsOperations, DatastoresOperations, EnvironmentContainersOperations, EnvironmentVersionsOperations, JobsOperations, ModelContainersOperations, ModelVersionsOperations, OnlineDeploymentsOperations, OnlineEndpointsOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, QuotasOperations, UsagesOperations, VirtualMachineSizesOperations, WorkspaceConnectionsOperations, WorkspaceFeaturesOperations, WorkspacesOperations +from .operations import ( + BatchDeploymentsOperations, + BatchEndpointsOperations, + CodeContainersOperations, + CodeVersionsOperations, + ComponentContainersOperations, + ComponentVersionsOperations, + ComputeOperations, + DataContainersOperations, + DataVersionsOperations, + DatastoresOperations, + EnvironmentContainersOperations, + EnvironmentVersionsOperations, + JobsOperations, + ModelContainersOperations, + ModelVersionsOperations, + OnlineDeploymentsOperations, + OnlineEndpointsOperations, + Operations, + PrivateEndpointConnectionsOperations, + PrivateLinkResourcesOperations, + QuotasOperations, + UsagesOperations, + VirtualMachineSizesOperations, + WorkspaceConnectionsOperations, + WorkspaceFeaturesOperations, + WorkspacesOperations, +) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential + class AzureMachineLearningWorkspaces: """These APIs allow end users to operate on Azure Machine Learning Workspace resources. @@ -112,45 +140,102 @@ def __init__( base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._config = AzureMachineLearningWorkspacesConfiguration( + credential=credential, subscription_id=subscription_id, **kwargs + ) + self._client = AsyncARMPipelineClient( + base_url=base_url, config=self._config, **kwargs + ) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = { + k: v for k, v in models.__dict__.items() if isinstance(v, type) + } self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.batch_endpoints = BatchEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_deployments = BatchDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_containers = CodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_versions = CodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_containers = ComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_versions = ComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_containers = DataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_versions = DataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.datastores = DatastoresOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_containers = EnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_versions = EnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_containers = ModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_versions = ModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_endpoints = OnlineEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_deployments = OnlineDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.workspaces = WorkspacesOperations(self._client, self._config, self._serialize, self._deserialize) - self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) - self.virtual_machine_sizes = VirtualMachineSizesOperations(self._client, self._config, self._serialize, self._deserialize) - self.quotas = QuotasOperations(self._client, self._config, self._serialize, self._deserialize) - self.compute = ComputeOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_connections = WorkspaceConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_features = WorkspaceFeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - + self.batch_endpoints = BatchEndpointsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.batch_deployments = BatchDeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.code_containers = CodeContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.code_versions = CodeVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.component_containers = ComponentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.component_versions = ComponentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_containers = DataContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_versions = DataVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.datastores = DatastoresOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.environment_containers = EnvironmentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.environment_versions = EnvironmentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.jobs = JobsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.model_containers = ModelContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.model_versions = ModelVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.online_endpoints = OnlineEndpointsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.online_deployments = OnlineDeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspaces = WorkspacesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.usages = UsagesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.virtual_machine_sizes = VirtualMachineSizesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.quotas = QuotasOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.compute = ComputeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.private_endpoint_connections = ( + PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspace_connections = WorkspaceConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspace_features = WorkspaceFeaturesOperations( + self._client, self._config, self._serialize, self._deserialize + ) def _send_request( - self, - request: HttpRequest, - **kwargs: Any + self, request: HttpRequest, **kwargs: Any ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/_configuration.py index 7b3bb4831a5e..f98c0fdc7e59 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/_configuration.py @@ -10,7 +10,10 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy +from azure.mgmt.core.policies import ( + ARMHttpLoggingPolicy, + AsyncARMChallengeAuthenticationPolicy, +) from .._version import VERSION @@ -37,7 +40,9 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) + super(AzureMachineLearningWorkspacesConfiguration, self).__init__( + **kwargs + ) if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: @@ -46,22 +51,41 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2022-05-01" - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) + self.credential_scopes = kwargs.pop( + "credential_scopes", ["https://management.azure.com/.default"] + ) + kwargs.setdefault( + "sdk_moniker", "mgmt-machinelearningservices/{}".format(VERSION) + ) self._configure(**kwargs) - def _configure( - self, - **kwargs: Any - ) -> None: - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get( + "user_agent_policy" + ) or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get( + "headers_policy" + ) or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy( + **kwargs + ) + self.logging_policy = kwargs.get( + "logging_policy" + ) or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get( + "http_logging_policy" + ) or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get( + "retry_policy" + ) or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get( + "custom_hook_policy" + ) or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get( + "redirect_policy" + ) or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/_patch.py index 74e48ecd07cf..17dbc073e01b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/_patch.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/_patch.py @@ -25,7 +25,8 @@ # # -------------------------------------------------------------------------- + # This file is used for handwritten extensions to the generated code. Example: # https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md def patch_sdk(): - pass \ No newline at end of file + pass diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/__init__.py index 40c788dd392c..2fc4c581441b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/__init__.py @@ -28,36 +28,38 @@ from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations from ._quotas_operations import QuotasOperations from ._compute_operations import ComputeOperations -from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_endpoint_connections_operations import ( + PrivateEndpointConnectionsOperations, +) from ._private_link_resources_operations import PrivateLinkResourcesOperations from ._workspace_connections_operations import WorkspaceConnectionsOperations from ._workspace_features_operations import WorkspaceFeaturesOperations __all__ = [ - 'BatchEndpointsOperations', - 'BatchDeploymentsOperations', - 'CodeContainersOperations', - 'CodeVersionsOperations', - 'ComponentContainersOperations', - 'ComponentVersionsOperations', - 'DataContainersOperations', - 'DataVersionsOperations', - 'DatastoresOperations', - 'EnvironmentContainersOperations', - 'EnvironmentVersionsOperations', - 'JobsOperations', - 'ModelContainersOperations', - 'ModelVersionsOperations', - 'OnlineEndpointsOperations', - 'OnlineDeploymentsOperations', - 'Operations', - 'WorkspacesOperations', - 'UsagesOperations', - 'VirtualMachineSizesOperations', - 'QuotasOperations', - 'ComputeOperations', - 'PrivateEndpointConnectionsOperations', - 'PrivateLinkResourcesOperations', - 'WorkspaceConnectionsOperations', - 'WorkspaceFeaturesOperations', + "BatchEndpointsOperations", + "BatchDeploymentsOperations", + "CodeContainersOperations", + "CodeVersionsOperations", + "ComponentContainersOperations", + "ComponentVersionsOperations", + "DataContainersOperations", + "DataVersionsOperations", + "DatastoresOperations", + "EnvironmentContainersOperations", + "EnvironmentVersionsOperations", + "JobsOperations", + "ModelContainersOperations", + "ModelVersionsOperations", + "OnlineEndpointsOperations", + "OnlineDeploymentsOperations", + "Operations", + "WorkspacesOperations", + "UsagesOperations", + "VirtualMachineSizesOperations", + "QuotasOperations", + "ComputeOperations", + "PrivateEndpointConnectionsOperations", + "PrivateLinkResourcesOperations", + "WorkspaceConnectionsOperations", + "WorkspaceFeaturesOperations", ] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_batch_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_batch_deployments_operations.py index 779b06cebbc0..10d2dd57744e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_batch_deployments_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_batch_deployments_operations.py @@ -6,14 +6,33 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, + Union, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -22,9 +41,22 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._batch_deployments_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._batch_deployments_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class BatchDeploymentsOperations: """BatchDeploymentsOperations async operations. @@ -58,7 +90,9 @@ def list( top: Optional[int] = None, skip: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.BatchDeploymentTrackedResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.BatchDeploymentTrackedResourceArmPaginatedResult" + ]: """Lists Batch inference deployments in the workspace. Lists Batch inference deployments in the workspace. @@ -82,14 +116,19 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.BatchDeploymentTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -98,13 +137,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -121,7 +160,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("BatchDeploymentTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "BatchDeploymentTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -130,21 +172,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments"} # type: ignore async def _delete_initial( self, @@ -154,43 +204,59 @@ async def _delete_initial( deployment_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, deployment_name=deployment_name, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_delete( @@ -225,43 +291,53 @@ async def begin_delete( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, deployment_name=deployment_name, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def get( @@ -289,41 +365,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.BatchDeploymentData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeploymentData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, deployment_name=deployment_name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchDeploymentData', pipeline_response) + deserialized = self._deserialize( + "BatchDeploymentData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore async def _update_initial( self, @@ -334,15 +424,23 @@ async def _update_initial( body: "_models.PartialBatchDeploymentPartialTrackedResource", **kwargs: Any ) -> Optional["_models.BatchDeploymentData"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchDeploymentData"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.BatchDeploymentData"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialBatchDeploymentPartialTrackedResource') + _json = self._serialize.body( + body, "PartialBatchDeploymentPartialTrackedResource" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -352,36 +450,53 @@ async def _update_initial( deployment_name=deployment_name, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchDeploymentData', pipeline_response) + deserialized = self._deserialize( + "BatchDeploymentData", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -422,14 +537,21 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchDeploymentData] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentData"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeploymentData"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -438,33 +560,42 @@ async def begin_update( deployment_name=deployment_name, body=body, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeploymentData', pipeline_response) + deserialized = self._deserialize( + "BatchDeploymentData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore async def _create_or_update_initial( self, @@ -475,15 +606,21 @@ async def _create_or_update_initial( body: "_models.BatchDeploymentData", **kwargs: Any ) -> "_models.BatchDeploymentData": - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeploymentData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'BatchDeploymentData') + _json = self._serialize.body(body, "BatchDeploymentData") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -493,35 +630,53 @@ async def _create_or_update_initial( deployment_name=deployment_name, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchDeploymentData', pipeline_response) + deserialized = self._deserialize( + "BatchDeploymentData", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchDeploymentData', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "BatchDeploymentData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -561,14 +716,21 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchDeploymentData] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentData"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeploymentData"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -577,30 +739,39 @@ async def begin_create_or_update( deployment_name=deployment_name, body=body, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeploymentData', pipeline_response) + deserialized = self._deserialize( + "BatchDeploymentData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_batch_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_batch_endpoints_operations.py index daa3a681bd08..15976bf75da2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_batch_endpoints_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_batch_endpoints_operations.py @@ -6,14 +6,33 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, + Union, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -22,9 +41,23 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._batch_endpoints_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_keys_request, build_list_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._batch_endpoints_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_keys_request, + build_list_request, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class BatchEndpointsOperations: """BatchEndpointsOperations async operations. @@ -56,7 +89,9 @@ def list( count: Optional[int] = None, skip: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.BatchEndpointTrackedResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.BatchEndpointTrackedResourceArmPaginatedResult" + ]: """Lists Batch inference endpoint in the workspace. Lists Batch inference endpoint in the workspace. @@ -76,27 +111,32 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.BatchEndpointTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, count=count, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -111,7 +151,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("BatchEndpointTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "BatchEndpointTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -120,21 +163,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints"} # type: ignore async def _delete_initial( self, @@ -143,42 +194,58 @@ async def _delete_initial( endpoint_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_delete( @@ -210,42 +277,52 @@ async def begin_delete( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def get( @@ -270,40 +347,54 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.BatchEndpointData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchEndpointData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchEndpointData', pipeline_response) + deserialized = self._deserialize( + "BatchEndpointData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore async def _update_initial( self, @@ -313,15 +404,23 @@ async def _update_initial( body: "_models.PartialBatchEndpointPartialTrackedResource", **kwargs: Any ) -> Optional["_models.BatchEndpointData"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchEndpointData"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.BatchEndpointData"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialBatchEndpointPartialTrackedResource') + _json = self._serialize.body( + body, "PartialBatchEndpointPartialTrackedResource" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -330,36 +429,53 @@ async def _update_initial( endpoint_name=endpoint_name, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchEndpointData', pipeline_response) + deserialized = self._deserialize( + "BatchEndpointData", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -397,14 +513,21 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpointData] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointData"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchEndpointData"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -412,33 +535,42 @@ async def begin_update( endpoint_name=endpoint_name, body=body, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpointData', pipeline_response) + deserialized = self._deserialize( + "BatchEndpointData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore async def _create_or_update_initial( self, @@ -448,15 +580,21 @@ async def _create_or_update_initial( body: "_models.BatchEndpointData", **kwargs: Any ) -> "_models.BatchEndpointData": - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchEndpointData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'BatchEndpointData') + _json = self._serialize.body(body, "BatchEndpointData") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -465,35 +603,53 @@ async def _create_or_update_initial( endpoint_name=endpoint_name, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchEndpointData', pipeline_response) + deserialized = self._deserialize( + "BatchEndpointData", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchEndpointData', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "BatchEndpointData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -530,14 +686,21 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpointData] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointData"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchEndpointData"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -545,33 +708,42 @@ async def begin_create_or_update( endpoint_name=endpoint_name, body=body, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpointData', pipeline_response) + deserialized = self._deserialize( + "BatchEndpointData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def list_keys( @@ -596,37 +768,49 @@ async def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthKeys"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) + deserialized = self._deserialize("EndpointAuthKeys", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys'} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_code_containers_operations.py index db15fbee09f1..71fae78c0c7c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_code_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_code_containers_operations.py @@ -6,11 +6,26 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, + Union, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -20,9 +35,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._code_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._code_containers_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class CodeContainersOperations: """CodeContainersOperations async operations. @@ -71,26 +98,31 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -104,7 +136,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -113,21 +147,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes"} # type: ignore @distributed_trace_async async def delete( @@ -152,36 +194,46 @@ async def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore @distributed_trace_async async def get( @@ -206,40 +258,54 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeContainerData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeContainerData', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "CodeContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -267,15 +333,21 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeContainerData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeContainerData') + _json = self._serialize.body(body, "CodeContainerData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -284,29 +356,42 @@ async def create_or_update( name=name, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('CodeContainerData', pipeline_response) + deserialized = self._deserialize( + "CodeContainerData", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('CodeContainerData', pipeline_response) + deserialized = self._deserialize( + "CodeContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_code_versions_operations.py index dd78dbeec9e1..d48fc472fd39 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_code_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_code_versions_operations.py @@ -6,11 +6,26 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, + Union, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -20,9 +35,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._code_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._code_versions_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class CodeVersionsOperations: """CodeVersionsOperations async operations. @@ -80,14 +107,19 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -96,13 +128,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -119,7 +151,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -128,21 +162,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions"} # type: ignore @distributed_trace_async async def delete( @@ -170,37 +212,47 @@ async def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version=version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -228,41 +280,53 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersionData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeVersionData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version=version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeVersionData', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize("CodeVersionData", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -293,15 +357,21 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersionData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeVersionData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeVersionData') + _json = self._serialize.body(body, "CodeVersionData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -311,29 +381,42 @@ async def create_or_update( version=version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('CodeVersionData', pipeline_response) + deserialized = self._deserialize( + "CodeVersionData", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('CodeVersionData', pipeline_response) + deserialized = self._deserialize( + "CodeVersionData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_component_containers_operations.py index 99514f21c10d..a83ae2507f1f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_component_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_component_containers_operations.py @@ -6,11 +6,26 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, + Union, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -20,9 +35,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._component_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._component_containers_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ComponentContainersOperations: """ComponentContainersOperations async operations. @@ -74,27 +101,32 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -109,7 +141,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -118,21 +153,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components"} # type: ignore @distributed_trace_async async def delete( @@ -157,36 +200,46 @@ async def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore @distributed_trace_async async def get( @@ -211,40 +264,54 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainerData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentContainerData', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "ComponentContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -272,15 +339,21 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainerData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentContainerData') + _json = self._serialize.body(body, "ComponentContainerData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -289,29 +362,42 @@ async def create_or_update( name=name, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ComponentContainerData', pipeline_response) + deserialized = self._deserialize( + "ComponentContainerData", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ComponentContainerData', pipeline_response) + deserialized = self._deserialize( + "ComponentContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_component_versions_operations.py index 9908e7198437..0f4747d401d0 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_component_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_component_versions_operations.py @@ -6,11 +6,26 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, + Union, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -20,9 +35,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._component_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._component_versions_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ComponentVersionsOperations: """ComponentVersionsOperations async operations. @@ -83,14 +110,19 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -100,13 +132,13 @@ def prepare_request(next_link=None): top=top, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -124,7 +156,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -133,21 +167,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions"} # type: ignore @distributed_trace_async async def delete( @@ -175,37 +217,47 @@ async def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version=version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -233,41 +285,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersionData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersionData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version=version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentVersionData', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "ComponentVersionData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -298,15 +364,21 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersionData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersionData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentVersionData') + _json = self._serialize.body(body, "ComponentVersionData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -316,29 +388,42 @@ async def create_or_update( version=version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ComponentVersionData', pipeline_response) + deserialized = self._deserialize( + "ComponentVersionData", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ComponentVersionData', pipeline_response) + deserialized = self._deserialize( + "ComponentVersionData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_compute_operations.py index 2e0620b53d1b..fbfaa6c4cf41 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_compute_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_compute_operations.py @@ -6,14 +6,33 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, + Union, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -22,9 +41,27 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._compute_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_keys_request, build_list_nodes_request, build_list_request, build_restart_request_initial, build_start_request_initial, build_stop_request_initial, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._compute_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_keys_request, + build_list_nodes_request, + build_list_request, + build_restart_request_initial, + build_start_request_initial, + build_stop_request_initial, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ComputeOperations: """ComputeOperations async operations. @@ -71,26 +108,31 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedComputeResourcesList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedComputeResourcesList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedComputeResourcesList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -104,7 +146,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedComputeResourcesList", pipeline_response) + deserialized = self._deserialize( + "PaginatedComputeResourcesList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -113,21 +157,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes"} # type: ignore @distributed_trace_async async def get( @@ -151,40 +203,52 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComputeResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize("ComputeResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore async def _create_or_update_initial( self, @@ -194,15 +258,21 @@ async def _create_or_update_initial( parameters: "_models.ComputeResource", **kwargs: Any ) -> "_models.ComputeResource": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'ComputeResource') + _json = self._serialize.body(parameters, "ComputeResource") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -211,34 +281,47 @@ async def _create_or_update_initial( compute_name=compute_name, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if response.status_code == 201: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComputeResource', pipeline_response) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -275,14 +358,21 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -290,33 +380,42 @@ async def begin_create_or_update( compute_name=compute_name, parameters=parameters, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore async def _update_initial( self, @@ -326,15 +425,21 @@ async def _update_initial( parameters: "_models.ClusterUpdateParameters", **kwargs: Any ) -> "_models.ComputeResource": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'ClusterUpdateParameters') + _json = self._serialize.body(parameters, "ClusterUpdateParameters") request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -343,27 +448,34 @@ async def _update_initial( compute_name=compute_name, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize("ComputeResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -399,14 +511,21 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -414,78 +533,100 @@ async def begin_update( compute_name=compute_name, parameters=parameters, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore async def _delete_initial( self, resource_group_name: str, workspace_name: str, compute_name: str, - underlying_resource_action: Union[str, "_models.UnderlyingResourceAction"], + underlying_resource_action: Union[ + str, "_models.UnderlyingResourceAction" + ], **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, underlying_resource_action=underlying_resource_action, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace_async async def begin_delete( @@ -493,7 +634,9 @@ async def begin_delete( resource_group_name: str, workspace_name: str, compute_name: str, - underlying_resource_action: Union[str, "_models.UnderlyingResourceAction"], + underlying_resource_action: Union[ + str, "_models.UnderlyingResourceAction" + ], **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes specified Machine Learning compute. @@ -520,43 +663,53 @@ async def begin_delete( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, underlying_resource_action=underlying_resource_action, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace def list_nodes( @@ -581,26 +734,31 @@ def list_nodes( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.AmlComputeNodesInformation] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlComputeNodesInformation"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.AmlComputeNodesInformation"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_nodes_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, - template_url=self.list_nodes.metadata['url'], + template_url=self.list_nodes.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_nodes_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -614,7 +772,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("AmlComputeNodesInformation", pipeline_response) + deserialized = self._deserialize( + "AmlComputeNodesInformation", pipeline_response + ) list_of_elem = deserialized.nodes if cls: list_of_elem = cls(list_of_elem) @@ -623,21 +783,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_nodes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes'} # type: ignore + list_nodes.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes"} # type: ignore @distributed_trace_async async def list_keys( @@ -660,40 +828,52 @@ async def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ComputeSecrets :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeSecrets"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeSecrets"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComputeSecrets', pipeline_response) + deserialized = self._deserialize("ComputeSecrets", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys'} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys"} # type: ignore async def _start_initial( self, @@ -702,35 +882,43 @@ async def _start_initial( compute_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_start_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, - template_url=self._start_initial.metadata['url'], + template_url=self._start_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start'} # type: ignore - + _start_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore @distributed_trace_async async def begin_start( @@ -760,42 +948,52 @@ async def begin_start( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._start_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start'} # type: ignore + begin_start.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore async def _stop_initial( self, @@ -804,35 +1002,43 @@ async def _stop_initial( compute_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_stop_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, - template_url=self._stop_initial.metadata['url'], + template_url=self._stop_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop'} # type: ignore - + _stop_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore @distributed_trace_async async def begin_stop( @@ -862,42 +1068,52 @@ async def begin_stop( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._stop_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop'} # type: ignore + begin_stop.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore async def _restart_initial( self, @@ -906,35 +1122,43 @@ async def _restart_initial( compute_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_restart_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, - template_url=self._restart_initial.metadata['url'], + template_url=self._restart_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _restart_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart'} # type: ignore - + _restart_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore @distributed_trace_async async def begin_restart( @@ -964,39 +1188,49 @@ async def begin_restart( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._restart_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart'} # type: ignore + begin_restart.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_data_containers_operations.py index 749296ff4fbe..1fc1e4365a0a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_data_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_data_containers_operations.py @@ -6,11 +6,26 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, + Union, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -20,9 +35,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._data_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._data_containers_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class DataContainersOperations: """DataContainersOperations async operations. @@ -74,27 +101,32 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -109,7 +141,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -118,21 +152,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data"} # type: ignore @distributed_trace_async async def delete( @@ -157,36 +199,46 @@ async def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore @distributed_trace_async async def get( @@ -211,40 +263,54 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataContainerData', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "DataContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -272,15 +338,21 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DataContainerData') + _json = self._serialize.body(body, "DataContainerData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -289,29 +361,42 @@ async def create_or_update( name=name, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('DataContainerData', pipeline_response) + deserialized = self._deserialize( + "DataContainerData", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('DataContainerData', pipeline_response) + deserialized = self._deserialize( + "DataContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_data_versions_operations.py index cde23f60d1ee..490404b8464b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_data_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_data_versions_operations.py @@ -6,11 +6,26 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, + Union, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -20,9 +35,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._data_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._data_versions_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class DataVersionsOperations: """DataVersionsOperations async operations. @@ -90,14 +117,19 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -108,13 +140,13 @@ def prepare_request(next_link=None): skip=skip, tags=tags, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -133,7 +165,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataVersionBaseResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -142,21 +176,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions"} # type: ignore @distributed_trace_async async def delete( @@ -184,37 +226,47 @@ async def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version=version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -242,41 +294,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBaseData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBaseData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version=version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataVersionBaseData', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "DataVersionBaseData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -307,15 +373,21 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBaseData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBaseData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DataVersionBaseData') + _json = self._serialize.body(body, "DataVersionBaseData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -325,29 +397,42 @@ async def create_or_update( version=version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('DataVersionBaseData', pipeline_response) + deserialized = self._deserialize( + "DataVersionBaseData", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('DataVersionBaseData', pipeline_response) + deserialized = self._deserialize( + "DataVersionBaseData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_datastores_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_datastores_operations.py index 75233892dea4..12ac703dcaa0 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_datastores_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_datastores_operations.py @@ -6,11 +6,27 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, List, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + List, + Optional, + TypeVar, + Union, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -20,9 +36,22 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._datastores_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request, build_list_secrets_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._datastores_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, + build_list_secrets_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class DatastoresOperations: """DatastoresOperations async operations. @@ -89,14 +118,19 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DatastoreResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -108,13 +142,13 @@ def prepare_request(next_link=None): search_text=search_text, order_by=order_by, order_by_asc=order_by_asc, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -134,7 +168,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("DatastoreResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DatastoreResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -143,21 +179,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores"} # type: ignore @distributed_trace_async async def delete( @@ -182,36 +226,46 @@ async def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace_async async def get( @@ -236,40 +290,50 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.DatastoreData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreData"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DatastoreData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DatastoreData', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize("DatastoreData", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -300,15 +364,19 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.DatastoreData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreData"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DatastoreData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DatastoreData') + _json = self._serialize.body(body, "DatastoreData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -318,32 +386,45 @@ async def create_or_update( content_type=content_type, json=_json, skip_validation=skip_validation, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('DatastoreData', pipeline_response) + deserialized = self._deserialize( + "DatastoreData", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('DatastoreData', pipeline_response) + deserialized = self._deserialize( + "DatastoreData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace_async async def list_secrets( @@ -368,37 +449,49 @@ async def list_secrets( :rtype: ~azure.mgmt.machinelearningservices.models.DatastoreSecrets :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreSecrets"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DatastoreSecrets"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_secrets_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.list_secrets.metadata['url'], + template_url=self.list_secrets.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DatastoreSecrets', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize("DatastoreSecrets", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets'} # type: ignore - + list_secrets.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_environment_containers_operations.py index 828587256d53..e8641c3bd1da 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_environment_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_environment_containers_operations.py @@ -6,11 +6,26 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, + Union, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -20,9 +35,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._environment_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._environment_containers_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class EnvironmentContainersOperations: """EnvironmentContainersOperations async operations. @@ -54,7 +81,9 @@ def list( skip: Optional[str] = None, list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, **kwargs: Any - ) -> AsyncIterable["_models.EnvironmentContainerResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.EnvironmentContainerResourceArmPaginatedResult" + ]: """List environment containers. List environment containers. @@ -74,27 +103,32 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -109,7 +143,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -118,21 +155,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments"} # type: ignore @distributed_trace_async async def delete( @@ -157,36 +202,46 @@ async def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore @distributed_trace_async async def get( @@ -211,40 +266,54 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainerData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentContainerData', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "EnvironmentContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -272,15 +341,21 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainerData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentContainerData') + _json = self._serialize.body(body, "EnvironmentContainerData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -289,29 +364,42 @@ async def create_or_update( name=name, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainerData', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainerData", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('EnvironmentContainerData', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_environment_versions_operations.py index 232982ef7b8f..63384b4596e3 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_environment_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_environment_versions_operations.py @@ -6,11 +6,26 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, + Union, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -20,9 +35,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._environment_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._environment_versions_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class EnvironmentVersionsOperations: """EnvironmentVersionsOperations async operations. @@ -83,14 +110,19 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -100,13 +132,13 @@ def prepare_request(next_link=None): top=top, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -124,7 +156,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersionResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -133,21 +168,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions"} # type: ignore @distributed_trace_async async def delete( @@ -175,37 +218,47 @@ async def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version=version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -233,41 +286,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersionData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version=version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentVersionData', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "EnvironmentVersionData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -298,15 +365,21 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersionData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentVersionData') + _json = self._serialize.body(body, "EnvironmentVersionData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -316,29 +389,42 @@ async def create_or_update( version=version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersionData', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersionData", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('EnvironmentVersionData', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersionData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_jobs_operations.py index 3b7550be2936..86af91497d95 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_jobs_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_jobs_operations.py @@ -6,14 +6,33 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, + Union, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -22,9 +41,22 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._jobs_operations import build_cancel_request_initial, build_create_or_update_request, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._jobs_operations import ( + build_cancel_request_initial, + build_create_or_update_request, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class JobsOperations: """JobsOperations async operations. @@ -82,14 +114,19 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.JobBaseResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -98,13 +135,13 @@ def prepare_request(next_link=None): job_type=job_type, tag=tag, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -121,7 +158,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("JobBaseResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "JobBaseResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -130,21 +169,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs"} # type: ignore async def _delete_initial( self, @@ -153,42 +200,58 @@ async def _delete_initial( id: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}'} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace_async async def begin_delete( @@ -220,42 +283,52 @@ async def begin_delete( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}'} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace_async async def get( @@ -280,40 +353,50 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.JobBaseData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBaseData"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.JobBaseData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('JobBaseData', pipeline_response) + deserialized = self._deserialize("JobBaseData", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -341,15 +424,19 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.JobBaseData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBaseData"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.JobBaseData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'JobBaseData') + _json = self._serialize.body(body, "JobBaseData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -358,32 +445,41 @@ async def create_or_update( id=id, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('JobBaseData', pipeline_response) + deserialized = self._deserialize("JobBaseData", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('JobBaseData', pipeline_response) + deserialized = self._deserialize("JobBaseData", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore async def _cancel_initial( self, @@ -392,41 +488,52 @@ async def _cancel_initial( id: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_cancel_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, - template_url=self._cancel_initial.metadata['url'], + template_url=self._cancel_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _cancel_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel'} # type: ignore - + _cancel_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore @distributed_trace_async async def begin_cancel( @@ -458,39 +565,53 @@ async def begin_cancel( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._cancel_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel'} # type: ignore + begin_cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_model_containers_operations.py index cc6f0064424e..a02d983c8859 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_model_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_model_containers_operations.py @@ -6,11 +6,26 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, + Union, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -20,9 +35,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._model_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._model_containers_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ModelContainersOperations: """ModelContainersOperations async operations. @@ -77,14 +104,19 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -92,13 +124,13 @@ def prepare_request(next_link=None): skip=skip, count=count, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -114,7 +146,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -123,21 +157,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models"} # type: ignore @distributed_trace_async async def delete( @@ -162,36 +204,46 @@ async def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore @distributed_trace_async async def get( @@ -216,40 +268,54 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainerData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelContainerData', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "ModelContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -277,15 +343,21 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainerData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelContainerData') + _json = self._serialize.body(body, "ModelContainerData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -294,29 +366,42 @@ async def create_or_update( name=name, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ModelContainerData', pipeline_response) + deserialized = self._deserialize( + "ModelContainerData", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ModelContainerData', pipeline_response) + deserialized = self._deserialize( + "ModelContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_model_versions_operations.py index 8af2fa2c3297..3aec5564101c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_model_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_model_versions_operations.py @@ -6,11 +6,26 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, + Union, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -20,9 +35,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._model_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._model_versions_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ModelVersionsOperations: """ModelVersionsOperations async operations. @@ -103,14 +130,19 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -126,13 +158,13 @@ def prepare_request(next_link=None): properties=properties, feed=feed, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -156,7 +188,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -165,21 +199,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions"} # type: ignore @distributed_trace_async async def delete( @@ -207,37 +249,47 @@ async def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version=version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -265,41 +317,53 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersionData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelVersionData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version=version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelVersionData', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize("ModelVersionData", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -330,15 +394,21 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersionData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelVersionData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelVersionData') + _json = self._serialize.body(body, "ModelVersionData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -348,29 +418,42 @@ async def create_or_update( version=version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ModelVersionData', pipeline_response) + deserialized = self._deserialize( + "ModelVersionData", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ModelVersionData', pipeline_response) + deserialized = self._deserialize( + "ModelVersionData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_online_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_online_deployments_operations.py index 58b8185691ea..baef0be96dbc 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_online_deployments_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_online_deployments_operations.py @@ -6,14 +6,33 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, + Union, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -22,9 +41,24 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._online_deployments_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_logs_request, build_get_request, build_list_request, build_list_skus_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._online_deployments_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_logs_request, + build_get_request, + build_list_request, + build_list_skus_request, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class OnlineDeploymentsOperations: """OnlineDeploymentsOperations async operations. @@ -58,7 +92,9 @@ def list( top: Optional[int] = None, skip: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.OnlineDeploymentTrackedResourceArmPaginatedResult" + ]: """List Inference Endpoint Deployments. List Inference Endpoint Deployments. @@ -82,14 +118,19 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OnlineDeploymentTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -98,13 +139,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -121,7 +162,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineDeploymentTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "OnlineDeploymentTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -130,21 +174,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments"} # type: ignore async def _delete_initial( self, @@ -154,43 +206,59 @@ async def _delete_initial( deployment_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, deployment_name=deployment_name, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_delete( @@ -225,43 +293,53 @@ async def begin_delete( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, deployment_name=deployment_name, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def get( @@ -289,41 +367,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.OnlineDeploymentData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeploymentData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, deployment_name=deployment_name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('OnlineDeploymentData', pipeline_response) + deserialized = self._deserialize( + "OnlineDeploymentData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore async def _update_initial( self, @@ -334,15 +426,23 @@ async def _update_initial( body: "_models.PartialOnlineDeploymentPartialTrackedResource", **kwargs: Any ) -> Optional["_models.OnlineDeploymentData"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineDeploymentData"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.OnlineDeploymentData"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialOnlineDeploymentPartialTrackedResource') + _json = self._serialize.body( + body, "PartialOnlineDeploymentPartialTrackedResource" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -352,36 +452,53 @@ async def _update_initial( deployment_name=deployment_name, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineDeploymentData', pipeline_response) + deserialized = self._deserialize( + "OnlineDeploymentData", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -422,14 +539,21 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeploymentData] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentData"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeploymentData"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -438,33 +562,42 @@ async def begin_update( deployment_name=deployment_name, body=body, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeploymentData', pipeline_response) + deserialized = self._deserialize( + "OnlineDeploymentData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore async def _create_or_update_initial( self, @@ -475,15 +608,21 @@ async def _create_or_update_initial( body: "_models.OnlineDeploymentData", **kwargs: Any ) -> "_models.OnlineDeploymentData": - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeploymentData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'OnlineDeploymentData') + _json = self._serialize.body(body, "OnlineDeploymentData") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -493,35 +632,53 @@ async def _create_or_update_initial( deployment_name=deployment_name, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineDeploymentData', pipeline_response) + deserialized = self._deserialize( + "OnlineDeploymentData", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineDeploymentData', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "OnlineDeploymentData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -561,14 +718,21 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeploymentData] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentData"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeploymentData"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -577,33 +741,42 @@ async def begin_create_or_update( deployment_name=deployment_name, body=body, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeploymentData', pipeline_response) + deserialized = self._deserialize( + "OnlineDeploymentData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def get_logs( @@ -634,15 +807,21 @@ async def get_logs( :rtype: ~azure.mgmt.machinelearningservices.models.DeploymentLogs :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentLogs"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DeploymentLogs"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DeploymentLogsRequest') + _json = self._serialize.body(body, "DeploymentLogsRequest") request = build_get_logs_request( subscription_id=self._config.subscription_id, @@ -652,28 +831,37 @@ async def get_logs( deployment_name=deployment_name, content_type=content_type, json=_json, - template_url=self.get_logs.metadata['url'], + template_url=self.get_logs.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DeploymentLogs', pipeline_response) + deserialized = self._deserialize("DeploymentLogs", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_logs.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs'} # type: ignore - + get_logs.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs"} # type: ignore @distributed_trace def list_skus( @@ -709,14 +897,19 @@ def list_skus( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.SkuResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.SkuResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_skus_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -725,13 +918,13 @@ def prepare_request(next_link=None): deployment_name=deployment_name, count=count, skip=skip, - template_url=self.list_skus.metadata['url'], + template_url=self.list_skus.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_skus_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -748,7 +941,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("SkuResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "SkuResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -757,18 +952,26 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_skus.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus'} # type: ignore + list_skus.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_online_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_online_endpoints_operations.py index b660396ea34f..f2a140916d84 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_online_endpoints_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_online_endpoints_operations.py @@ -6,14 +6,33 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, + Union, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -22,9 +41,25 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._online_endpoints_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_get_token_request, build_list_keys_request, build_list_request, build_regenerate_keys_request_initial, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._online_endpoints_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_get_token_request, + build_list_keys_request, + build_list_request, + build_regenerate_keys_request_initial, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class OnlineEndpointsOperations: """OnlineEndpointsOperations async operations. @@ -55,13 +90,17 @@ def list( workspace_name: str, name: Optional[str] = None, count: Optional[int] = None, - compute_type: Optional[Union[str, "_models.EndpointComputeType"]] = None, + compute_type: Optional[ + Union[str, "_models.EndpointComputeType"] + ] = None, skip: Optional[str] = None, tags: Optional[str] = None, properties: Optional[str] = None, order_by: Optional[Union[str, "_models.OrderString"]] = None, **kwargs: Any - ) -> AsyncIterable["_models.OnlineEndpointTrackedResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.OnlineEndpointTrackedResourceArmPaginatedResult" + ]: """List Online Endpoints. List Online Endpoints. @@ -94,14 +133,19 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OnlineEndpointTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -113,13 +157,13 @@ def prepare_request(next_link=None): tags=tags, properties=properties, order_by=order_by, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -139,7 +183,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineEndpointTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "OnlineEndpointTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -148,21 +195,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints"} # type: ignore async def _delete_initial( self, @@ -171,42 +226,58 @@ async def _delete_initial( endpoint_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_delete( @@ -238,42 +309,52 @@ async def begin_delete( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def get( @@ -298,40 +379,54 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.OnlineEndpointData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpointData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('OnlineEndpointData', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpointData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore async def _update_initial( self, @@ -341,15 +436,23 @@ async def _update_initial( body: "_models.PartialOnlineEndpointPartialTrackedResource", **kwargs: Any ) -> Optional["_models.OnlineEndpointData"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineEndpointData"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.OnlineEndpointData"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialOnlineEndpointPartialTrackedResource') + _json = self._serialize.body( + body, "PartialOnlineEndpointPartialTrackedResource" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -358,36 +461,53 @@ async def _update_initial( endpoint_name=endpoint_name, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpointData', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpointData", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -425,14 +545,21 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpointData] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointData"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpointData"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -440,33 +567,42 @@ async def begin_update( endpoint_name=endpoint_name, body=body, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpointData', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpointData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore async def _create_or_update_initial( self, @@ -476,15 +612,21 @@ async def _create_or_update_initial( body: "_models.OnlineEndpointData", **kwargs: Any ) -> "_models.OnlineEndpointData": - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpointData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'OnlineEndpointData') + _json = self._serialize.body(body, "OnlineEndpointData") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -493,35 +635,53 @@ async def _create_or_update_initial( endpoint_name=endpoint_name, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpointData', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpointData", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineEndpointData', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "OnlineEndpointData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -558,14 +718,21 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpointData] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointData"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpointData"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -573,33 +740,42 @@ async def begin_create_or_update( endpoint_name=endpoint_name, body=body, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpointData', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpointData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def list_keys( @@ -624,40 +800,52 @@ async def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthKeys"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) + deserialized = self._deserialize("EndpointAuthKeys", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys'} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys"} # type: ignore async def _regenerate_keys_initial( self, @@ -667,15 +855,19 @@ async def _regenerate_keys_initial( body: "_models.RegenerateEndpointKeysRequest", **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'RegenerateEndpointKeysRequest') + _json = self._serialize.body(body, "RegenerateEndpointKeysRequest") request = build_regenerate_keys_request_initial( subscription_id=self._config.subscription_id, @@ -684,29 +876,39 @@ async def _regenerate_keys_initial( endpoint_name=endpoint_name, content_type=content_type, json=_json, - template_url=self._regenerate_keys_initial.metadata['url'], + template_url=self._regenerate_keys_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _regenerate_keys_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys'} # type: ignore - + _regenerate_keys_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore @distributed_trace_async async def begin_regenerate_keys( @@ -741,14 +943,19 @@ async def begin_regenerate_keys( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._regenerate_keys_initial( resource_group_name=resource_group_name, @@ -756,30 +963,41 @@ async def begin_regenerate_keys( endpoint_name=endpoint_name, body=body, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_regenerate_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys'} # type: ignore + begin_regenerate_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore @distributed_trace_async async def get_token( @@ -804,37 +1022,51 @@ async def get_token( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthToken :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthToken"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthToken"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_token_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, - template_url=self.get_token.metadata['url'], + template_url=self.get_token.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EndpointAuthToken', pipeline_response) + deserialized = self._deserialize( + "EndpointAuthToken", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token'} # type: ignore - + get_token.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_operations.py index 75ac95c763d8..3873016a24b8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_operations.py @@ -6,11 +6,25 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -21,8 +35,15 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class Operations: """Operations async operations. @@ -48,8 +69,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list( - self, - **kwargs: Any + self, **kwargs: Any ) -> AsyncIterable["_models.AmlOperationListResult"]: """Lists all of the available Azure Machine Learning Workspaces REST API operations. @@ -60,22 +80,27 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.AmlOperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlOperationListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.AmlOperationListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( template_url=next_link, ) @@ -85,7 +110,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("AmlOperationListResult", pipeline_response) + deserialized = self._deserialize( + "AmlOperationListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -94,18 +121,26 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/providers/Microsoft.MachineLearningServices/operations'} # type: ignore + list.metadata = {"url": "/providers/Microsoft.MachineLearningServices/operations"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_private_endpoint_connections_operations.py index d1228f865cba..fd4d382a0c7e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_private_endpoint_connections_operations.py @@ -6,11 +6,25 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -20,9 +34,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._private_endpoint_connections_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._private_endpoint_connections_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class PrivateEndpointConnectionsOperations: """PrivateEndpointConnectionsOperations async operations. @@ -48,10 +74,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> AsyncIterable["_models.PrivateEndpointConnectionListResult"]: """List all the private endpoint connections associated with the workspace. @@ -66,25 +89,30 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnectionListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( resource_group_name=resource_group_name, workspace_name=workspace_name, subscription_id=self._config.subscription_id, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( resource_group_name=resource_group_name, workspace_name=workspace_name, @@ -97,7 +125,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) + deserialized = self._deserialize( + "PrivateEndpointConnectionListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -106,21 +136,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections"} # type: ignore @distributed_trace_async async def get( @@ -144,40 +182,54 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, private_endpoint_connection_name=private_endpoint_connection_name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "PrivateEndpointConnection", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -204,15 +256,21 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(properties, 'PrivateEndpointConnection') + _json = self._serialize.body(properties, "PrivateEndpointConnection") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -221,28 +279,39 @@ async def create_or_update( private_endpoint_connection_name=private_endpoint_connection_name, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "PrivateEndpointConnection", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace_async async def delete( @@ -266,33 +335,43 @@ async def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, private_endpoint_connection_name=private_endpoint_connection_name, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_private_link_resources_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_private_link_resources_operations.py index e0d008b1fe5f..bacc2f8f311f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_private_link_resources_operations.py @@ -9,7 +9,13 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,8 +25,15 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class PrivateLinkResourcesOperations: """PrivateLinkResourcesOperations async operations. @@ -46,10 +59,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace_async async def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.PrivateLinkResourceListResult": """Gets the private link resources that need to be created for a workspace. @@ -62,36 +72,50 @@ async def list( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateLinkResourceListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateLinkResourceListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateLinkResourceListResult', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "PrivateLinkResourceListResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources'} # type: ignore - + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_quotas_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_quotas_operations.py index ce339e75d8b4..fc68a31e874b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_quotas_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_quotas_operations.py @@ -6,11 +6,25 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -20,9 +34,19 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._quotas_operations import build_list_request, build_update_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._quotas_operations import ( + build_list_request, + build_update_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class QuotasOperations: """QuotasOperations async operations. @@ -64,49 +88,64 @@ async def update( :rtype: ~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotasResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'QuotaUpdateParameters') + _json = self._serialize.body(parameters, "QuotaUpdateParameters") request = build_update_request( location=location, subscription_id=self._config.subscription_id, content_type=content_type, json=_json, - template_url=self.update.metadata['url'], + template_url=self.update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('UpdateWorkspaceQuotasResult', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "UpdateWorkspaceQuotasResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas'} # type: ignore - + update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas"} # type: ignore @distributed_trace def list( - self, - location: str, - **kwargs: Any + self, location: str, **kwargs: Any ) -> AsyncIterable["_models.ListWorkspaceQuotas"]: """Gets the currently assigned Workspace Quotas based on VMFamily. @@ -118,24 +157,29 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListWorkspaceQuotas] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceQuotas"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListWorkspaceQuotas"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, @@ -147,7 +191,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ListWorkspaceQuotas", pipeline_response) + deserialized = self._deserialize( + "ListWorkspaceQuotas", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -156,18 +202,26 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_usages_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_usages_operations.py index f42c02771ff6..3131a564c21e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_usages_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_usages_operations.py @@ -6,11 +6,25 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -21,8 +35,15 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._usages_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class UsagesOperations: """UsagesOperations async operations. @@ -48,9 +69,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list( - self, - location: str, - **kwargs: Any + self, location: str, **kwargs: Any ) -> AsyncIterable["_models.ListUsagesResult"]: """Gets the current usage information as well as limits for AML resources for given subscription and location. @@ -63,24 +82,29 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListUsagesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListUsagesResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, @@ -92,7 +116,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ListUsagesResult", pipeline_response) + deserialized = self._deserialize( + "ListUsagesResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -101,18 +127,26 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_virtual_machine_sizes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_virtual_machine_sizes_operations.py index 4bd0ecb964ae..0fd0cef16bf4 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_virtual_machine_sizes_operations.py @@ -9,7 +9,13 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,8 +25,15 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._virtual_machine_sizes_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class VirtualMachineSizesOperations: """VirtualMachineSizesOperations async operations. @@ -46,9 +59,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace_async async def list( - self, - location: str, - **kwargs: Any + self, location: str, **kwargs: Any ) -> "_models.VirtualMachineSizeListResult": """Returns supported VM Sizes in a location. @@ -59,35 +70,49 @@ async def list( :rtype: ~azure.mgmt.machinelearningservices.models.VirtualMachineSizeListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_request( location=location, subscription_id=self._config.subscription_id, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualMachineSizeListResult', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "VirtualMachineSizeListResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes'} # type: ignore - + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_workspace_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_workspace_connections_operations.py index eec0ff706432..d3e2e804c141 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_workspace_connections_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_workspace_connections_operations.py @@ -6,11 +6,25 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -20,9 +34,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._workspace_connections_operations import build_create_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._workspace_connections_operations import ( + build_create_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class WorkspaceConnectionsOperations: """WorkspaceConnectionsOperations async operations. @@ -71,15 +97,23 @@ async def create( :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'WorkspaceConnectionPropertiesV2BasicResource') + _json = self._serialize.body( + parameters, "WorkspaceConnectionPropertiesV2BasicResource" + ) request = build_create_request( subscription_id=self._config.subscription_id, @@ -88,28 +122,39 @@ async def create( connection_name=connection_name, content_type=content_type, json=_json, - template_url=self.create.metadata['url'], + template_url=self.create.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}'} # type: ignore - + create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace_async async def get( @@ -132,40 +177,54 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, connection_name=connection_name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace_async async def delete( @@ -188,36 +247,46 @@ async def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, connection_name=connection_name, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace def list( @@ -227,7 +296,9 @@ def list( target: Optional[str] = None, category: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult" + ]: """list. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -245,27 +316,32 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, target=target, category=category, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -280,7 +356,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -289,18 +368,26 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_workspace_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_workspace_features_operations.py index 2e4752bd6642..d356a6defb62 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_workspace_features_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_workspace_features_operations.py @@ -6,11 +6,25 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -21,8 +35,15 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._workspace_features_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class WorkspaceFeaturesOperations: """WorkspaceFeaturesOperations async operations. @@ -48,10 +69,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> AsyncIterable["_models.ListAmlUserFeatureResult"]: """Lists all enabled features for a workspace. @@ -66,25 +84,30 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListAmlUserFeatureResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAmlUserFeatureResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListAmlUserFeatureResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -97,7 +120,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ListAmlUserFeatureResult", pipeline_response) + deserialized = self._deserialize( + "ListAmlUserFeatureResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -106,18 +131,26 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_workspaces_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_workspaces_operations.py index f7ef8bea2374..4030c5a2130c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_workspaces_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/aio/operations/_workspaces_operations.py @@ -6,14 +6,33 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + Generic, + Optional, + TypeVar, + Union, +) import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -22,9 +41,31 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._workspaces_operations import build_create_or_update_request_initial, build_delete_request_initial, build_diagnose_request_initial, build_get_request, build_list_by_resource_group_request, build_list_by_subscription_request, build_list_keys_request, build_list_notebook_access_token_request, build_list_notebook_keys_request, build_list_outbound_network_dependencies_endpoints_request, build_list_storage_account_keys_request, build_prepare_notebook_request_initial, build_resync_keys_request_initial, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._workspaces_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_diagnose_request_initial, + build_get_request, + build_list_by_resource_group_request, + build_list_by_subscription_request, + build_list_keys_request, + build_list_notebook_access_token_request, + build_list_notebook_keys_request, + build_list_outbound_network_dependencies_endpoints_request, + build_list_storage_account_keys_request, + build_prepare_notebook_request_initial, + build_resync_keys_request_initial, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class WorkspacesOperations: """WorkspacesOperations async operations. @@ -50,10 +91,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace_async async def get( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.Workspace": """Gets the properties of the specified machine learning workspace. @@ -66,39 +104,49 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.Workspace :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore async def _create_or_update_initial( self, @@ -107,15 +155,21 @@ async def _create_or_update_initial( parameters: "_models.Workspace", **kwargs: Any ) -> Optional["_models.Workspace"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.Workspace"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'Workspace') + _json = self._serialize.body(parameters, "Workspace") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -123,29 +177,36 @@ async def _create_or_update_initial( workspace_name=workspace_name, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -177,89 +238,103 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Workspace] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, parameters=parameters, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore async def _delete_initial( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace_async async def begin_delete( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes a machine learning workspace. @@ -279,41 +354,51 @@ async def begin_delete( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore async def _update_initial( self, @@ -322,15 +407,21 @@ async def _update_initial( parameters: "_models.WorkspaceUpdateParameters", **kwargs: Any ) -> Optional["_models.Workspace"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.Workspace"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'WorkspaceUpdateParameters') + _json = self._serialize.body(parameters, "WorkspaceUpdateParameters") request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -338,29 +429,36 @@ async def _update_initial( workspace_name=workspace_name, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -392,47 +490,59 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Workspace] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, parameters=parameters, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace def list_by_resource_group( @@ -453,25 +563,30 @@ def list_by_resource_group( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_by_resource_group_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, skip=skip, - template_url=self.list_by_resource_group.metadata['url'], + template_url=self.list_by_resource_group.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_by_resource_group_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -484,7 +599,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -493,21 +610,29 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces'} # type: ignore + list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore async def _diagnose_initial( self, @@ -516,16 +641,24 @@ async def _diagnose_initial( parameters: Optional["_models.DiagnoseWorkspaceParameters"] = None, **kwargs: Any ) -> Optional["_models.DiagnoseResponseResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if parameters is not None: - _json = self._serialize.body(parameters, 'DiagnoseWorkspaceParameters') + _json = self._serialize.body( + parameters, "DiagnoseWorkspaceParameters" + ) else: _json = None @@ -535,35 +668,47 @@ async def _diagnose_initial( workspace_name=workspace_name, content_type=content_type, json=_json, - template_url=self._diagnose_initial.metadata['url'], + template_url=self._diagnose_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) + deserialized = self._deserialize( + "DiagnoseResponseResult", pipeline_response + ) if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _diagnose_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose'} # type: ignore - + _diagnose_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore @distributed_trace_async async def begin_diagnose( @@ -597,54 +742,71 @@ async def begin_diagnose( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.DiagnoseResponseResult] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnoseResponseResult"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DiagnoseResponseResult"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._diagnose_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, parameters=parameters, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) + deserialized = self._deserialize( + "DiagnoseResponseResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_diagnose.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose'} # type: ignore + begin_diagnose.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore @distributed_trace_async async def list_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.ListWorkspaceKeysResult": """Lists all the keys associated with this workspace. This includes keys for the storage account, app insights and password for container registry. @@ -658,81 +820,97 @@ async def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListWorkspaceKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceKeysResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListWorkspaceKeysResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ListWorkspaceKeysResult', pipeline_response) + deserialized = self._deserialize( + "ListWorkspaceKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys'} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys"} # type: ignore async def _resync_keys_initial( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_resync_keys_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self._resync_keys_initial.metadata['url'], + template_url=self._resync_keys_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _resync_keys_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys'} # type: ignore - + _resync_keys_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore @distributed_trace_async async def begin_resync_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: """Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and password for container registry. @@ -753,47 +931,55 @@ async def begin_resync_keys( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._resync_keys_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_resync_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys'} # type: ignore + begin_resync_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore @distributed_trace def list_by_subscription( - self, - skip: Optional[str] = None, - **kwargs: Any + self, skip: Optional[str] = None, **kwargs: Any ) -> AsyncIterable["_models.WorkspaceListResult"]: """Lists all the available machine learning workspaces under the specified subscription. @@ -805,24 +991,29 @@ def list_by_subscription( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, skip=skip, - template_url=self.list_by_subscription.metadata['url'], + template_url=self.list_by_subscription.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, skip=skip, @@ -834,7 +1025,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -843,28 +1036,33 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces'} # type: ignore + list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore @distributed_trace_async async def list_notebook_access_token( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.NotebookAccessTokenResult": """return notebook access token and refresh token. @@ -877,87 +1075,107 @@ async def list_notebook_access_token( :rtype: ~azure.mgmt.machinelearningservices.models.NotebookAccessTokenResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookAccessTokenResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.NotebookAccessTokenResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_notebook_access_token_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.list_notebook_access_token.metadata['url'], + template_url=self.list_notebook_access_token.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('NotebookAccessTokenResult', pipeline_response) + deserialized = self._deserialize( + "NotebookAccessTokenResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_notebook_access_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken'} # type: ignore - + list_notebook_access_token.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken"} # type: ignore async def _prepare_notebook_initial( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> Optional["_models.NotebookResourceInfo"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NotebookResourceInfo"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.NotebookResourceInfo"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_prepare_notebook_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self._prepare_notebook_initial.metadata['url'], + template_url=self._prepare_notebook_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) + deserialized = self._deserialize( + "NotebookResourceInfo", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _prepare_notebook_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook'} # type: ignore - + _prepare_notebook_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore @distributed_trace_async async def begin_prepare_notebook( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> AsyncLROPoller["_models.NotebookResourceInfo"]: """Prepare a notebook. @@ -979,51 +1197,66 @@ async def begin_prepare_notebook( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.NotebookResourceInfo] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookResourceInfo"] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.NotebookResourceInfo"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._prepare_notebook_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) + deserialized = self._deserialize( + "NotebookResourceInfo", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_prepare_notebook.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook'} # type: ignore + begin_prepare_notebook.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore @distributed_trace_async async def list_storage_account_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.ListStorageAccountKeysResult": """List storage account keys of a workspace. @@ -1036,46 +1269,57 @@ async def list_storage_account_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListStorageAccountKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListStorageAccountKeysResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListStorageAccountKeysResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_storage_account_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.list_storage_account_keys.metadata['url'], + template_url=self.list_storage_account_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ListStorageAccountKeysResult', pipeline_response) + deserialized = self._deserialize( + "ListStorageAccountKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_storage_account_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys'} # type: ignore - + list_storage_account_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys"} # type: ignore @distributed_trace_async async def list_notebook_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.ListNotebookKeysResult": """List keys of a notebook. @@ -1088,46 +1332,57 @@ async def list_notebook_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListNotebookKeysResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListNotebookKeysResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_notebook_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.list_notebook_keys.metadata['url'], + template_url=self.list_notebook_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ListNotebookKeysResult', pipeline_response) + deserialized = self._deserialize( + "ListNotebookKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_notebook_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys'} # type: ignore - + list_notebook_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys"} # type: ignore @distributed_trace_async async def list_outbound_network_dependencies_endpoints( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.ExternalFQDNResponse": """Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) programmatically. @@ -1144,36 +1399,52 @@ async def list_outbound_network_dependencies_endpoints( :rtype: ~azure.mgmt.machinelearningservices.models.ExternalFQDNResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExternalFQDNResponse"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ExternalFQDNResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_outbound_network_dependencies_endpoints_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], + template_url=self.list_outbound_network_dependencies_endpoints.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ExternalFQDNResponse', pipeline_response) + deserialized = self._deserialize( + "ExternalFQDNResponse", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_outbound_network_dependencies_endpoints.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints'} # type: ignore - + list_outbound_network_dependencies_endpoints.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/models/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/models/__init__.py index 014050585f18..9244e9299f6c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/models/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/models/__init__.py @@ -179,7 +179,9 @@ from ._models_py3 import MLTableJobInput from ._models_py3 import MLTableJobOutput from ._models_py3 import ManagedIdentity - from ._models_py3 import ManagedIdentityAuthTypeWorkspaceConnectionProperties + from ._models_py3 import ( + ManagedIdentityAuthTypeWorkspaceConnectionProperties, + ) from ._models_py3 import ManagedOnlineDeployment from ._models_py3 import ManagedServiceIdentity from ._models_py3 import MedianStoppingPolicy @@ -296,7 +298,9 @@ from ._models_py3 import UserAccountCredentials from ._models_py3 import UserAssignedIdentity from ._models_py3 import UserIdentity - from ._models_py3 import UsernamePasswordAuthTypeWorkspaceConnectionProperties + from ._models_py3 import ( + UsernamePasswordAuthTypeWorkspaceConnectionProperties, + ) from ._models_py3 import VirtualMachine from ._models_py3 import VirtualMachineImage from ._models_py3 import VirtualMachineSchema @@ -311,7 +315,9 @@ from ._models_py3 import WorkspaceConnectionPersonalAccessToken from ._models_py3 import WorkspaceConnectionPropertiesV2 from ._models_py3 import WorkspaceConnectionPropertiesV2BasicResource - from ._models_py3 import WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult + from ._models_py3 import ( + WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, + ) from ._models_py3 import WorkspaceConnectionSharedAccessSignature from ._models_py3 import WorkspaceConnectionUsernamePassword from ._models_py3 import WorkspaceListResult @@ -713,395 +719,395 @@ ) __all__ = [ - 'AKS', - 'AKSSchema', - 'AKSSchemaProperties', - 'AccountKeyDatastoreCredentials', - 'AccountKeyDatastoreSecrets', - 'AksComputeSecrets', - 'AksComputeSecretsProperties', - 'AksNetworkingConfiguration', - 'AmlCompute', - 'AmlComputeNodeInformation', - 'AmlComputeNodesInformation', - 'AmlComputeProperties', - 'AmlComputeSchema', - 'AmlOperation', - 'AmlOperationDisplay', - 'AmlOperationListResult', - 'AmlToken', - 'AmlUserFeature', - 'AssetBase', - 'AssetContainer', - 'AssetJobInput', - 'AssetJobOutput', - 'AssetReferenceBase', - 'AssignedUser', - 'AutoPauseProperties', - 'AutoScaleProperties', - 'AzureBlobDatastore', - 'AzureDataLakeGen1Datastore', - 'AzureDataLakeGen2Datastore', - 'AzureFileDatastore', - 'BanditPolicy', - 'BatchDeploymentData', - 'BatchDeploymentDetails', - 'BatchDeploymentTrackedResourceArmPaginatedResult', - 'BatchEndpointData', - 'BatchEndpointDefaults', - 'BatchEndpointDetails', - 'BatchEndpointTrackedResourceArmPaginatedResult', - 'BatchRetrySettings', - 'BayesianSamplingAlgorithm', - 'BuildContext', - 'CertificateDatastoreCredentials', - 'CertificateDatastoreSecrets', - 'ClusterUpdateParameters', - 'CodeConfiguration', - 'CodeContainerData', - 'CodeContainerDetails', - 'CodeContainerResourceArmPaginatedResult', - 'CodeVersionData', - 'CodeVersionDetails', - 'CodeVersionResourceArmPaginatedResult', - 'CommandJob', - 'CommandJobLimits', - 'ComponentContainerData', - 'ComponentContainerDetails', - 'ComponentContainerResourceArmPaginatedResult', - 'ComponentVersionData', - 'ComponentVersionDetails', - 'ComponentVersionResourceArmPaginatedResult', - 'Compute', - 'ComputeInstance', - 'ComputeInstanceApplication', - 'ComputeInstanceConnectivityEndpoints', - 'ComputeInstanceContainer', - 'ComputeInstanceCreatedBy', - 'ComputeInstanceDataDisk', - 'ComputeInstanceDataMount', - 'ComputeInstanceEnvironmentInfo', - 'ComputeInstanceLastOperation', - 'ComputeInstanceProperties', - 'ComputeInstanceSchema', - 'ComputeInstanceSshSettings', - 'ComputeInstanceVersion', - 'ComputeResource', - 'ComputeResourceSchema', - 'ComputeSchedules', - 'ComputeSecrets', - 'ComputeStartStopSchedule', - 'ContainerResourceRequirements', - 'ContainerResourceSettings', - 'CosmosDbSettings', - 'CronSchedule', - 'CustomModelJobInput', - 'CustomModelJobOutput', - 'DataContainerData', - 'DataContainerDetails', - 'DataContainerResourceArmPaginatedResult', - 'DataFactory', - 'DataLakeAnalytics', - 'DataLakeAnalyticsSchema', - 'DataLakeAnalyticsSchemaProperties', - 'DataPathAssetReference', - 'DataVersionBaseData', - 'DataVersionBaseDetails', - 'DataVersionBaseResourceArmPaginatedResult', - 'Databricks', - 'DatabricksComputeSecrets', - 'DatabricksComputeSecretsProperties', - 'DatabricksProperties', - 'DatabricksSchema', - 'DatastoreCredentials', - 'DatastoreData', - 'DatastoreDetails', - 'DatastoreResourceArmPaginatedResult', - 'DatastoreSecrets', - 'DefaultScaleSettings', - 'DeploymentLogs', - 'DeploymentLogsRequest', - 'DiagnoseRequestProperties', - 'DiagnoseResponseResult', - 'DiagnoseResponseResultValue', - 'DiagnoseResult', - 'DiagnoseWorkspaceParameters', - 'DistributionConfiguration', - 'EarlyTerminationPolicy', - 'EncryptionKeyVaultProperties', - 'EncryptionProperty', - 'EndpointAuthKeys', - 'EndpointAuthToken', - 'EndpointDeploymentPropertiesBase', - 'EndpointPropertiesBase', - 'EnvironmentContainerData', - 'EnvironmentContainerDetails', - 'EnvironmentContainerResourceArmPaginatedResult', - 'EnvironmentVersionData', - 'EnvironmentVersionDetails', - 'EnvironmentVersionResourceArmPaginatedResult', - 'ErrorAdditionalInfo', - 'ErrorDetail', - 'ErrorResponse', - 'EstimatedVMPrice', - 'EstimatedVMPrices', - 'ExternalFQDNResponse', - 'FQDNEndpoint', - 'FQDNEndpointDetail', - 'FQDNEndpoints', - 'FQDNEndpointsProperties', - 'FlavorData', - 'GridSamplingAlgorithm', - 'HDInsight', - 'HDInsightProperties', - 'HDInsightSchema', - 'IdAssetReference', - 'IdentityConfiguration', - 'IdentityForCmk', - 'InferenceContainerProperties', - 'InstanceTypeSchema', - 'InstanceTypeSchemaResources', - 'JobBaseData', - 'JobBaseDetails', - 'JobBaseResourceArmPaginatedResult', - 'JobInput', - 'JobLimits', - 'JobOutput', - 'JobService', - 'Kubernetes', - 'KubernetesOnlineDeployment', - 'KubernetesProperties', - 'KubernetesSchema', - 'ListAmlUserFeatureResult', - 'ListNotebookKeysResult', - 'ListStorageAccountKeysResult', - 'ListUsagesResult', - 'ListWorkspaceKeysResult', - 'ListWorkspaceQuotas', - 'LiteralJobInput', - 'MLFlowModelJobInput', - 'MLFlowModelJobOutput', - 'MLTableData', - 'MLTableJobInput', - 'MLTableJobOutput', - 'ManagedIdentity', - 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', - 'ManagedOnlineDeployment', - 'ManagedServiceIdentity', - 'MedianStoppingPolicy', - 'ModelContainerData', - 'ModelContainerDetails', - 'ModelContainerResourceArmPaginatedResult', - 'ModelVersionData', - 'ModelVersionDetails', - 'ModelVersionResourceArmPaginatedResult', - 'Mpi', - 'NodeStateCounts', - 'NoneAuthTypeWorkspaceConnectionProperties', - 'NoneDatastoreCredentials', - 'NotebookAccessTokenResult', - 'NotebookPreparationError', - 'NotebookResourceInfo', - 'Objective', - 'OnlineDeploymentData', - 'OnlineDeploymentDetails', - 'OnlineDeploymentTrackedResourceArmPaginatedResult', - 'OnlineEndpointData', - 'OnlineEndpointDetails', - 'OnlineEndpointTrackedResourceArmPaginatedResult', - 'OnlineRequestSettings', - 'OnlineScaleSettings', - 'OutputPathAssetReference', - 'PATAuthTypeWorkspaceConnectionProperties', - 'PaginatedComputeResourcesList', - 'PartialAssetReferenceBase', - 'PartialBatchDeployment', - 'PartialBatchDeploymentPartialTrackedResource', - 'PartialBatchEndpoint', - 'PartialBatchEndpointPartialTrackedResource', - 'PartialBatchRetrySettings', - 'PartialCodeConfiguration', - 'PartialDataPathAssetReference', - 'PartialIdAssetReference', - 'PartialKubernetesOnlineDeployment', - 'PartialManagedOnlineDeployment', - 'PartialManagedServiceIdentity', - 'PartialOnlineDeployment', - 'PartialOnlineDeploymentPartialTrackedResource', - 'PartialOnlineEndpointPartialTrackedResource', - 'PartialOutputPathAssetReference', - 'PartialSku', - 'Password', - 'PersonalComputeInstanceSettings', - 'PipelineJob', - 'PrivateEndpoint', - 'PrivateEndpointConnection', - 'PrivateEndpointConnectionListResult', - 'PrivateLinkResource', - 'PrivateLinkResourceListResult', - 'PrivateLinkServiceConnectionState', - 'ProbeSettings', - 'PyTorch', - 'QuotaBaseProperties', - 'QuotaUpdateParameters', - 'RandomSamplingAlgorithm', - 'RecurrencePattern', - 'RecurrenceSchedule', - 'RegenerateEndpointKeysRequest', - 'RegistryListCredentialsResult', - 'Resource', - 'ResourceBase', - 'ResourceConfiguration', - 'ResourceId', - 'ResourceName', - 'ResourceQuota', - 'Route', - 'SASAuthTypeWorkspaceConnectionProperties', - 'SamplingAlgorithm', - 'SasDatastoreCredentials', - 'SasDatastoreSecrets', - 'ScaleSettings', - 'ScaleSettingsInformation', - 'ScheduleBase', - 'ScriptReference', - 'ScriptsToExecute', - 'ServiceManagedResourcesSettings', - 'ServicePrincipalDatastoreCredentials', - 'ServicePrincipalDatastoreSecrets', - 'SetupScripts', - 'SharedPrivateLinkResource', - 'Sku', - 'SkuCapacity', - 'SkuResource', - 'SkuResourceArmPaginatedResult', - 'SkuSetting', - 'SslConfiguration', - 'SweepJob', - 'SweepJobLimits', - 'SynapseSpark', - 'SynapseSparkProperties', - 'SystemData', - 'SystemService', - 'TargetUtilizationScaleSettings', - 'TensorFlow', - 'TrackedResource', - 'TrialComponent', - 'TritonModelJobInput', - 'TritonModelJobOutput', - 'TruncationSelectionPolicy', - 'UpdateWorkspaceQuotas', - 'UpdateWorkspaceQuotasResult', - 'UriFileDataVersion', - 'UriFileJobInput', - 'UriFileJobOutput', - 'UriFolderDataVersion', - 'UriFolderJobInput', - 'UriFolderJobOutput', - 'Usage', - 'UsageName', - 'UserAccountCredentials', - 'UserAssignedIdentity', - 'UserIdentity', - 'UsernamePasswordAuthTypeWorkspaceConnectionProperties', - 'VirtualMachine', - 'VirtualMachineImage', - 'VirtualMachineSchema', - 'VirtualMachineSchemaProperties', - 'VirtualMachineSecrets', - 'VirtualMachineSecretsSchema', - 'VirtualMachineSize', - 'VirtualMachineSizeListResult', - 'VirtualMachineSshCredentials', - 'Workspace', - 'WorkspaceConnectionManagedIdentity', - 'WorkspaceConnectionPersonalAccessToken', - 'WorkspaceConnectionPropertiesV2', - 'WorkspaceConnectionPropertiesV2BasicResource', - 'WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult', - 'WorkspaceConnectionSharedAccessSignature', - 'WorkspaceConnectionUsernamePassword', - 'WorkspaceListResult', - 'WorkspaceUpdateParameters', - 'AllocationState', - 'ApplicationSharingPolicy', - 'Autosave', - 'BatchLoggingLevel', - 'BatchOutputAction', - 'BillingCurrency', - 'Caching', - 'ClusterPurpose', - 'ComputeInstanceAuthorizationType', - 'ComputeInstanceState', - 'ComputePowerAction', - 'ComputeType', - 'ConnectionAuthType', - 'ConnectionCategory', - 'ContainerType', - 'CreatedByType', - 'CredentialsType', - 'DataType', - 'DatastoreType', - 'DeploymentProvisioningState', - 'DiagnoseResultLevel', - 'DistributionType', - 'EarlyTerminationPolicyType', - 'EncryptionStatus', - 'EndpointAuthMode', - 'EndpointComputeType', - 'EndpointProvisioningState', - 'EnvironmentType', - 'Goal', - 'IdentityConfigurationType', - 'InputDeliveryMode', - 'JobInputType', - 'JobLimitsType', - 'JobOutputType', - 'JobStatus', - 'JobType', - 'KeyType', - 'ListViewType', - 'LoadBalancerType', - 'ManagedServiceIdentityType', - 'MountAction', - 'MountState', - 'Network', - 'NodeState', - 'OperatingSystemType', - 'OperationName', - 'OperationStatus', - 'OperationTrigger', - 'OrderString', - 'OsType', - 'OutputDeliveryMode', - 'PrivateEndpointConnectionProvisioningState', - 'PrivateEndpointServiceConnectionStatus', - 'ProvisioningState', - 'ProvisioningStatus', - 'PublicNetworkAccess', - 'QuotaUnit', - 'RandomSamplingAlgorithmRule', - 'RecurrenceFrequency', - 'ReferenceType', - 'RemoteLoginPortPublicAccess', - 'SamplingAlgorithmType', - 'ScaleType', - 'ScheduleStatus', - 'ScheduleType', - 'SecretsType', - 'ServiceDataAccessAuthIdentity', - 'SkuScaleType', - 'SkuTier', - 'SourceType', - 'SshPublicAccess', - 'SslConfigurationStatus', - 'Status', - 'StorageAccountType', - 'UnderlyingResourceAction', - 'UnitOfMeasure', - 'UsageUnit', - 'VMPriceOSType', - 'VMTier', - 'ValueFormat', - 'VmPriority', - 'Weekday', + "AKS", + "AKSSchema", + "AKSSchemaProperties", + "AccountKeyDatastoreCredentials", + "AccountKeyDatastoreSecrets", + "AksComputeSecrets", + "AksComputeSecretsProperties", + "AksNetworkingConfiguration", + "AmlCompute", + "AmlComputeNodeInformation", + "AmlComputeNodesInformation", + "AmlComputeProperties", + "AmlComputeSchema", + "AmlOperation", + "AmlOperationDisplay", + "AmlOperationListResult", + "AmlToken", + "AmlUserFeature", + "AssetBase", + "AssetContainer", + "AssetJobInput", + "AssetJobOutput", + "AssetReferenceBase", + "AssignedUser", + "AutoPauseProperties", + "AutoScaleProperties", + "AzureBlobDatastore", + "AzureDataLakeGen1Datastore", + "AzureDataLakeGen2Datastore", + "AzureFileDatastore", + "BanditPolicy", + "BatchDeploymentData", + "BatchDeploymentDetails", + "BatchDeploymentTrackedResourceArmPaginatedResult", + "BatchEndpointData", + "BatchEndpointDefaults", + "BatchEndpointDetails", + "BatchEndpointTrackedResourceArmPaginatedResult", + "BatchRetrySettings", + "BayesianSamplingAlgorithm", + "BuildContext", + "CertificateDatastoreCredentials", + "CertificateDatastoreSecrets", + "ClusterUpdateParameters", + "CodeConfiguration", + "CodeContainerData", + "CodeContainerDetails", + "CodeContainerResourceArmPaginatedResult", + "CodeVersionData", + "CodeVersionDetails", + "CodeVersionResourceArmPaginatedResult", + "CommandJob", + "CommandJobLimits", + "ComponentContainerData", + "ComponentContainerDetails", + "ComponentContainerResourceArmPaginatedResult", + "ComponentVersionData", + "ComponentVersionDetails", + "ComponentVersionResourceArmPaginatedResult", + "Compute", + "ComputeInstance", + "ComputeInstanceApplication", + "ComputeInstanceConnectivityEndpoints", + "ComputeInstanceContainer", + "ComputeInstanceCreatedBy", + "ComputeInstanceDataDisk", + "ComputeInstanceDataMount", + "ComputeInstanceEnvironmentInfo", + "ComputeInstanceLastOperation", + "ComputeInstanceProperties", + "ComputeInstanceSchema", + "ComputeInstanceSshSettings", + "ComputeInstanceVersion", + "ComputeResource", + "ComputeResourceSchema", + "ComputeSchedules", + "ComputeSecrets", + "ComputeStartStopSchedule", + "ContainerResourceRequirements", + "ContainerResourceSettings", + "CosmosDbSettings", + "CronSchedule", + "CustomModelJobInput", + "CustomModelJobOutput", + "DataContainerData", + "DataContainerDetails", + "DataContainerResourceArmPaginatedResult", + "DataFactory", + "DataLakeAnalytics", + "DataLakeAnalyticsSchema", + "DataLakeAnalyticsSchemaProperties", + "DataPathAssetReference", + "DataVersionBaseData", + "DataVersionBaseDetails", + "DataVersionBaseResourceArmPaginatedResult", + "Databricks", + "DatabricksComputeSecrets", + "DatabricksComputeSecretsProperties", + "DatabricksProperties", + "DatabricksSchema", + "DatastoreCredentials", + "DatastoreData", + "DatastoreDetails", + "DatastoreResourceArmPaginatedResult", + "DatastoreSecrets", + "DefaultScaleSettings", + "DeploymentLogs", + "DeploymentLogsRequest", + "DiagnoseRequestProperties", + "DiagnoseResponseResult", + "DiagnoseResponseResultValue", + "DiagnoseResult", + "DiagnoseWorkspaceParameters", + "DistributionConfiguration", + "EarlyTerminationPolicy", + "EncryptionKeyVaultProperties", + "EncryptionProperty", + "EndpointAuthKeys", + "EndpointAuthToken", + "EndpointDeploymentPropertiesBase", + "EndpointPropertiesBase", + "EnvironmentContainerData", + "EnvironmentContainerDetails", + "EnvironmentContainerResourceArmPaginatedResult", + "EnvironmentVersionData", + "EnvironmentVersionDetails", + "EnvironmentVersionResourceArmPaginatedResult", + "ErrorAdditionalInfo", + "ErrorDetail", + "ErrorResponse", + "EstimatedVMPrice", + "EstimatedVMPrices", + "ExternalFQDNResponse", + "FQDNEndpoint", + "FQDNEndpointDetail", + "FQDNEndpoints", + "FQDNEndpointsProperties", + "FlavorData", + "GridSamplingAlgorithm", + "HDInsight", + "HDInsightProperties", + "HDInsightSchema", + "IdAssetReference", + "IdentityConfiguration", + "IdentityForCmk", + "InferenceContainerProperties", + "InstanceTypeSchema", + "InstanceTypeSchemaResources", + "JobBaseData", + "JobBaseDetails", + "JobBaseResourceArmPaginatedResult", + "JobInput", + "JobLimits", + "JobOutput", + "JobService", + "Kubernetes", + "KubernetesOnlineDeployment", + "KubernetesProperties", + "KubernetesSchema", + "ListAmlUserFeatureResult", + "ListNotebookKeysResult", + "ListStorageAccountKeysResult", + "ListUsagesResult", + "ListWorkspaceKeysResult", + "ListWorkspaceQuotas", + "LiteralJobInput", + "MLFlowModelJobInput", + "MLFlowModelJobOutput", + "MLTableData", + "MLTableJobInput", + "MLTableJobOutput", + "ManagedIdentity", + "ManagedIdentityAuthTypeWorkspaceConnectionProperties", + "ManagedOnlineDeployment", + "ManagedServiceIdentity", + "MedianStoppingPolicy", + "ModelContainerData", + "ModelContainerDetails", + "ModelContainerResourceArmPaginatedResult", + "ModelVersionData", + "ModelVersionDetails", + "ModelVersionResourceArmPaginatedResult", + "Mpi", + "NodeStateCounts", + "NoneAuthTypeWorkspaceConnectionProperties", + "NoneDatastoreCredentials", + "NotebookAccessTokenResult", + "NotebookPreparationError", + "NotebookResourceInfo", + "Objective", + "OnlineDeploymentData", + "OnlineDeploymentDetails", + "OnlineDeploymentTrackedResourceArmPaginatedResult", + "OnlineEndpointData", + "OnlineEndpointDetails", + "OnlineEndpointTrackedResourceArmPaginatedResult", + "OnlineRequestSettings", + "OnlineScaleSettings", + "OutputPathAssetReference", + "PATAuthTypeWorkspaceConnectionProperties", + "PaginatedComputeResourcesList", + "PartialAssetReferenceBase", + "PartialBatchDeployment", + "PartialBatchDeploymentPartialTrackedResource", + "PartialBatchEndpoint", + "PartialBatchEndpointPartialTrackedResource", + "PartialBatchRetrySettings", + "PartialCodeConfiguration", + "PartialDataPathAssetReference", + "PartialIdAssetReference", + "PartialKubernetesOnlineDeployment", + "PartialManagedOnlineDeployment", + "PartialManagedServiceIdentity", + "PartialOnlineDeployment", + "PartialOnlineDeploymentPartialTrackedResource", + "PartialOnlineEndpointPartialTrackedResource", + "PartialOutputPathAssetReference", + "PartialSku", + "Password", + "PersonalComputeInstanceSettings", + "PipelineJob", + "PrivateEndpoint", + "PrivateEndpointConnection", + "PrivateEndpointConnectionListResult", + "PrivateLinkResource", + "PrivateLinkResourceListResult", + "PrivateLinkServiceConnectionState", + "ProbeSettings", + "PyTorch", + "QuotaBaseProperties", + "QuotaUpdateParameters", + "RandomSamplingAlgorithm", + "RecurrencePattern", + "RecurrenceSchedule", + "RegenerateEndpointKeysRequest", + "RegistryListCredentialsResult", + "Resource", + "ResourceBase", + "ResourceConfiguration", + "ResourceId", + "ResourceName", + "ResourceQuota", + "Route", + "SASAuthTypeWorkspaceConnectionProperties", + "SamplingAlgorithm", + "SasDatastoreCredentials", + "SasDatastoreSecrets", + "ScaleSettings", + "ScaleSettingsInformation", + "ScheduleBase", + "ScriptReference", + "ScriptsToExecute", + "ServiceManagedResourcesSettings", + "ServicePrincipalDatastoreCredentials", + "ServicePrincipalDatastoreSecrets", + "SetupScripts", + "SharedPrivateLinkResource", + "Sku", + "SkuCapacity", + "SkuResource", + "SkuResourceArmPaginatedResult", + "SkuSetting", + "SslConfiguration", + "SweepJob", + "SweepJobLimits", + "SynapseSpark", + "SynapseSparkProperties", + "SystemData", + "SystemService", + "TargetUtilizationScaleSettings", + "TensorFlow", + "TrackedResource", + "TrialComponent", + "TritonModelJobInput", + "TritonModelJobOutput", + "TruncationSelectionPolicy", + "UpdateWorkspaceQuotas", + "UpdateWorkspaceQuotasResult", + "UriFileDataVersion", + "UriFileJobInput", + "UriFileJobOutput", + "UriFolderDataVersion", + "UriFolderJobInput", + "UriFolderJobOutput", + "Usage", + "UsageName", + "UserAccountCredentials", + "UserAssignedIdentity", + "UserIdentity", + "UsernamePasswordAuthTypeWorkspaceConnectionProperties", + "VirtualMachine", + "VirtualMachineImage", + "VirtualMachineSchema", + "VirtualMachineSchemaProperties", + "VirtualMachineSecrets", + "VirtualMachineSecretsSchema", + "VirtualMachineSize", + "VirtualMachineSizeListResult", + "VirtualMachineSshCredentials", + "Workspace", + "WorkspaceConnectionManagedIdentity", + "WorkspaceConnectionPersonalAccessToken", + "WorkspaceConnectionPropertiesV2", + "WorkspaceConnectionPropertiesV2BasicResource", + "WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", + "WorkspaceConnectionSharedAccessSignature", + "WorkspaceConnectionUsernamePassword", + "WorkspaceListResult", + "WorkspaceUpdateParameters", + "AllocationState", + "ApplicationSharingPolicy", + "Autosave", + "BatchLoggingLevel", + "BatchOutputAction", + "BillingCurrency", + "Caching", + "ClusterPurpose", + "ComputeInstanceAuthorizationType", + "ComputeInstanceState", + "ComputePowerAction", + "ComputeType", + "ConnectionAuthType", + "ConnectionCategory", + "ContainerType", + "CreatedByType", + "CredentialsType", + "DataType", + "DatastoreType", + "DeploymentProvisioningState", + "DiagnoseResultLevel", + "DistributionType", + "EarlyTerminationPolicyType", + "EncryptionStatus", + "EndpointAuthMode", + "EndpointComputeType", + "EndpointProvisioningState", + "EnvironmentType", + "Goal", + "IdentityConfigurationType", + "InputDeliveryMode", + "JobInputType", + "JobLimitsType", + "JobOutputType", + "JobStatus", + "JobType", + "KeyType", + "ListViewType", + "LoadBalancerType", + "ManagedServiceIdentityType", + "MountAction", + "MountState", + "Network", + "NodeState", + "OperatingSystemType", + "OperationName", + "OperationStatus", + "OperationTrigger", + "OrderString", + "OsType", + "OutputDeliveryMode", + "PrivateEndpointConnectionProvisioningState", + "PrivateEndpointServiceConnectionStatus", + "ProvisioningState", + "ProvisioningStatus", + "PublicNetworkAccess", + "QuotaUnit", + "RandomSamplingAlgorithmRule", + "RecurrenceFrequency", + "ReferenceType", + "RemoteLoginPortPublicAccess", + "SamplingAlgorithmType", + "ScaleType", + "ScheduleStatus", + "ScheduleType", + "SecretsType", + "ServiceDataAccessAuthIdentity", + "SkuScaleType", + "SkuTier", + "SourceType", + "SshPublicAccess", + "SslConfigurationStatus", + "Status", + "StorageAccountType", + "UnderlyingResourceAction", + "UnitOfMeasure", + "UsageUnit", + "VMPriceOSType", + "VMTier", + "ValueFormat", + "VmPriority", + "Weekday", ] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/models/_azure_machine_learning_workspaces_enums.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/models/_azure_machine_learning_workspaces_enums.py index 3e85b7aa5bbf..d65638aa6a97 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/models/_azure_machine_learning_workspaces_enums.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/models/_azure_machine_learning_workspaces_enums.py @@ -21,6 +21,7 @@ class AllocationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): STEADY = "Steady" RESIZING = "Resizing" + class ApplicationSharingPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Policy for sharing applications on this compute instance among users of parent workspace. If Personal, only the creator can access applications on this compute instance. When Shared, any @@ -30,14 +31,15 @@ class ApplicationSharingPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): PERSONAL = "Personal" SHARED = "Shared" + class Autosave(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Auto save settings. - """ + """Auto save settings.""" NONE = "None" LOCAL = "Local" REMOTE = "Remote" + class BatchLoggingLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Log verbosity for batch inferencing. Increasing verbosity order for logging is : Warning, Info and Debug. @@ -48,44 +50,46 @@ class BatchLoggingLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): WARNING = "Warning" DEBUG = "Debug" + class BatchOutputAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine how batch inferencing will handle output - """ + """Enum to determine how batch inferencing will handle output""" SUMMARY_ONLY = "SummaryOnly" APPEND_ROW = "AppendRow" + class BillingCurrency(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Three lettered code specifying the currency of the VM price. Example: USD - """ + """Three lettered code specifying the currency of the VM price. Example: USD""" USD = "USD" + class Caching(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Caching type of Data Disk. - """ + """Caching type of Data Disk.""" NONE = "None" READ_ONLY = "ReadOnly" READ_WRITE = "ReadWrite" + class ClusterPurpose(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Intended usage of the cluster - """ + """Intended usage of the cluster""" FAST_PROD = "FastProd" DENSE_PROD = "DenseProd" DEV_TEST = "DevTest" -class ComputeInstanceAuthorizationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The Compute Instance Authorization type. Available values are personal (default). - """ + +class ComputeInstanceAuthorizationType( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """The Compute Instance Authorization type. Available values are personal (default).""" PERSONAL = "personal" + class ComputeInstanceState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Current state of an ComputeInstance. - """ + """Current state of an ComputeInstance.""" CREATING = "Creating" CREATE_FAILED = "CreateFailed" @@ -103,16 +107,16 @@ class ComputeInstanceState(str, Enum, metaclass=CaseInsensitiveEnumMeta): UNKNOWN = "Unknown" UNUSABLE = "Unusable" + class ComputePowerAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The compute power action. - """ + """The compute power action.""" START = "Start" STOP = "Stop" + class ComputeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of compute - """ + """The type of compute""" AKS = "AKS" KUBERNETES = "Kubernetes" @@ -125,9 +129,9 @@ class ComputeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): DATA_LAKE_ANALYTICS = "DataLakeAnalytics" SYNAPSE_SPARK = "SynapseSpark" + class ConnectionAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Authentication type of the connection target - """ + """Authentication type of the connection target""" PAT = "PAT" MANAGED_IDENTITY = "ManagedIdentity" @@ -135,31 +139,32 @@ class ConnectionAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): NONE = "None" SAS = "SAS" + class ConnectionCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Category of the connection - """ + """Category of the connection""" PYTHON_FEED = "PythonFeed" CONTAINER_REGISTRY = "ContainerRegistry" GIT = "Git" + class ContainerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): STORAGE_INITIALIZER = "StorageInitializer" INFERENCE_SERVER = "InferenceServer" + class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of identity that created the resource. - """ + """The type of identity that created the resource.""" USER = "User" APPLICATION = "Application" MANAGED_IDENTITY = "ManagedIdentity" KEY = "Key" + class CredentialsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the datastore credentials type. - """ + """Enum to determine the datastore credentials type.""" ACCOUNT_KEY = "AccountKey" CERTIFICATE = "Certificate" @@ -167,26 +172,28 @@ class CredentialsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): SAS = "Sas" SERVICE_PRINCIPAL = "ServicePrincipal" + class DatastoreType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the datastore contents type. - """ + """Enum to determine the datastore contents type.""" AZURE_BLOB = "AzureBlob" AZURE_DATA_LAKE_GEN1 = "AzureDataLakeGen1" AZURE_DATA_LAKE_GEN2 = "AzureDataLakeGen2" AZURE_FILE = "AzureFile" + class DataType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the type of data. - """ + """Enum to determine the type of data.""" URI_FILE = "uri_file" URI_FOLDER = "uri_folder" MLTABLE = "mltable" -class DeploymentProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Possible values for DeploymentProvisioningState. - """ + +class DeploymentProvisioningState( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """Possible values for DeploymentProvisioningState.""" CREATING = "Creating" DELETING = "Deleting" @@ -196,54 +203,55 @@ class DeploymentProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): FAILED = "Failed" CANCELED = "Canceled" + class DiagnoseResultLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Level of workspace setup error - """ + """Level of workspace setup error""" WARNING = "Warning" ERROR = "Error" INFORMATION = "Information" + class DistributionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the job distribution type. - """ + """Enum to determine the job distribution type.""" PY_TORCH = "PyTorch" TENSOR_FLOW = "TensorFlow" MPI = "Mpi" + class EarlyTerminationPolicyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): BANDIT = "Bandit" MEDIAN_STOPPING = "MedianStopping" TRUNCATION_SELECTION = "TruncationSelection" + class EncryptionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates whether or not the encryption is enabled for the workspace. - """ + """Indicates whether or not the encryption is enabled for the workspace.""" ENABLED = "Enabled" DISABLED = "Disabled" + class EndpointAuthMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine endpoint authentication mode. - """ + """Enum to determine endpoint authentication mode.""" AML_TOKEN = "AMLToken" KEY = "Key" AAD_TOKEN = "AADToken" + class EndpointComputeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine endpoint compute type. - """ + """Enum to determine endpoint compute type.""" MANAGED = "Managed" KUBERNETES = "Kubernetes" AZURE_ML_COMPUTE = "AzureMLCompute" + class EndpointProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """State of endpoint provisioning. - """ + """State of endpoint provisioning.""" CREATING = "Creating" DELETING = "Deleting" @@ -252,31 +260,31 @@ class EndpointProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): UPDATING = "Updating" CANCELED = "Canceled" + class EnvironmentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Environment type is either user created or curated by Azure ML service - """ + """Environment type is either user created or curated by Azure ML service""" CURATED = "Curated" USER_CREATED = "UserCreated" + class Goal(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Defines supported metric goals for hyperparameter tuning - """ + """Defines supported metric goals for hyperparameter tuning""" MINIMIZE = "Minimize" MAXIMIZE = "Maximize" + class IdentityConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine identity framework. - """ + """Enum to determine identity framework.""" MANAGED = "Managed" AML_TOKEN = "AMLToken" USER_IDENTITY = "UserIdentity" + class InputDeliveryMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the input data delivery mode. - """ + """Enum to determine the input data delivery mode.""" READ_ONLY_MOUNT = "ReadOnlyMount" READ_WRITE_MOUNT = "ReadWriteMount" @@ -285,9 +293,9 @@ class InputDeliveryMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): EVAL_MOUNT = "EvalMount" EVAL_DOWNLOAD = "EvalDownload" + class JobInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the Job Input Type. - """ + """Enum to determine the Job Input Type.""" LITERAL = "literal" URI_FILE = "uri_file" @@ -297,14 +305,15 @@ class JobInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): MLFLOW_MODEL = "mlflow_model" TRITON_MODEL = "triton_model" + class JobLimitsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): COMMAND = "Command" SWEEP = "Sweep" + class JobOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the Job Output Type. - """ + """Enum to determine the Job Output Type.""" URI_FILE = "uri_file" URI_FOLDER = "uri_folder" @@ -313,9 +322,9 @@ class JobOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): MLFLOW_MODEL = "mlflow_model" TRITON_MODEL = "triton_model" + class JobStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The status of a job. - """ + """The status of a job.""" #: Run hasn't started yet. NOT_STARTED = "NotStarted" @@ -351,32 +360,35 @@ class JobStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Default job status if not mapped to all other statuses. UNKNOWN = "Unknown" + class JobType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the type of job. - """ + """Enum to determine the type of job.""" COMMAND = "Command" SWEEP = "Sweep" PIPELINE = "Pipeline" + class KeyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): PRIMARY = "Primary" SECONDARY = "Secondary" + class ListViewType(str, Enum, metaclass=CaseInsensitiveEnumMeta): ACTIVE_ONLY = "ActiveOnly" ARCHIVED_ONLY = "ArchivedOnly" ALL = "All" + class LoadBalancerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Load Balancer Type - """ + """Load Balancer Type""" PUBLIC_IP = "PublicIp" INTERNAL_LOAD_BALANCER = "InternalLoadBalancer" + class ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). @@ -387,16 +399,16 @@ class ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): USER_ASSIGNED = "UserAssigned" SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" + class MountAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Mount Action. - """ + """Mount Action.""" MOUNT = "Mount" UNMOUNT = "Unmount" + class MountState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Mount state. - """ + """Mount state.""" MOUNT_REQUESTED = "MountRequested" MOUNTED = "Mounted" @@ -405,13 +417,14 @@ class MountState(str, Enum, metaclass=CaseInsensitiveEnumMeta): UNMOUNT_FAILED = "UnmountFailed" UNMOUNTED = "Unmounted" + class Network(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """network of this container. - """ + """network of this container.""" BRIDGE = "Bridge" HOST = "Host" + class NodeState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """State of the compute node. Values are idle, running, preparing, unusable, leaving and preempted. @@ -424,16 +437,16 @@ class NodeState(str, Enum, metaclass=CaseInsensitiveEnumMeta): LEAVING = "leaving" PREEMPTED = "preempted" + class OperatingSystemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of operating system. - """ + """The type of operating system.""" LINUX = "Linux" WINDOWS = "Windows" + class OperationName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Name of the last operation. - """ + """Name of the last operation.""" CREATE = "Create" START = "Start" @@ -442,9 +455,9 @@ class OperationName(str, Enum, metaclass=CaseInsensitiveEnumMeta): REIMAGE = "Reimage" DELETE = "Delete" + class OperationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Operation status. - """ + """Operation status.""" IN_PROGRESS = "InProgress" SUCCEEDED = "Succeeded" @@ -455,14 +468,15 @@ class OperationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): REIMAGE_FAILED = "ReimageFailed" DELETE_FAILED = "DeleteFailed" + class OperationTrigger(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Trigger of operation. - """ + """Trigger of operation.""" USER = "User" SCHEDULE = "Schedule" IDLE_SHUTDOWN = "IdleShutdown" + class OrderString(str, Enum, metaclass=CaseInsensitiveEnumMeta): CREATED_AT_DESC = "CreatedAtDesc" @@ -470,32 +484,36 @@ class OrderString(str, Enum, metaclass=CaseInsensitiveEnumMeta): UPDATED_AT_DESC = "UpdatedAtDesc" UPDATED_AT_ASC = "UpdatedAtAsc" + class OsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Compute OS Type - """ + """Compute OS Type""" LINUX = "Linux" WINDOWS = "Windows" + class OutputDeliveryMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Output data delivery mode enums. - """ + """Output data delivery mode enums.""" READ_WRITE_MOUNT = "ReadWriteMount" UPLOAD = "Upload" -class PrivateEndpointConnectionProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The current provisioning state. - """ + +class PrivateEndpointConnectionProvisioningState( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """The current provisioning state.""" SUCCEEDED = "Succeeded" CREATING = "Creating" DELETING = "Deleting" FAILED = "Failed" -class PrivateEndpointServiceConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The private endpoint connection status. - """ + +class PrivateEndpointServiceConnectionStatus( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """The private endpoint connection status.""" PENDING = "Pending" APPROVED = "Approved" @@ -503,6 +521,7 @@ class PrivateEndpointServiceConnectionStatus(str, Enum, metaclass=CaseInsensitiv DISCONNECTED = "Disconnected" TIMEOUT = "Timeout" + class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The current deployment state of workspace resource. The provisioningState is to indicate states for resource provisioning. @@ -516,37 +535,39 @@ class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): FAILED = "Failed" CANCELED = "Canceled" + class ProvisioningStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The current deployment state of schedule. - """ + """The current deployment state of schedule.""" COMPLETED = "Completed" PROVISIONING = "Provisioning" FAILED = "Failed" + class PublicNetworkAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Whether requests from Public Network are allowed. - """ + """Whether requests from Public Network are allowed.""" ENABLED = "Enabled" DISABLED = "Disabled" + class QuotaUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """An enum describing the unit of quota measurement. - """ + """An enum describing the unit of quota measurement.""" COUNT = "Count" -class RandomSamplingAlgorithmRule(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The specific type of random algorithm - """ + +class RandomSamplingAlgorithmRule( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """The specific type of random algorithm""" RANDOM = "Random" SOBOL = "Sobol" + class RecurrenceFrequency(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to describe the frequency of a recurrence schedule - """ + """Enum to describe the frequency of a recurrence schedule""" #: Minute frequency. MINUTE = "Minute" @@ -559,15 +580,18 @@ class RecurrenceFrequency(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Month frequency. MONTH = "Month" + class ReferenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine which reference method to use for an asset. - """ + """Enum to determine which reference method to use for an asset.""" ID = "Id" DATA_PATH = "DataPath" OUTPUT_PATH = "OutputPath" -class RemoteLoginPortPublicAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): + +class RemoteLoginPortPublicAccess( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): """State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - Indicates that the public ssh port is closed @@ -580,45 +604,50 @@ class RemoteLoginPortPublicAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): DISABLED = "Disabled" NOT_SPECIFIED = "NotSpecified" + class SamplingAlgorithmType(str, Enum, metaclass=CaseInsensitiveEnumMeta): GRID = "Grid" RANDOM = "Random" BAYESIAN = "Bayesian" + class ScaleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): DEFAULT = "Default" TARGET_UTILIZATION = "TargetUtilization" + class ScheduleStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to describe status of schedule - """ + """Enum to describe status of schedule""" #: Schedule is enabled. ENABLED = "Enabled" #: Schedule is disabled. DISABLED = "Disabled" + class ScheduleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to describe type of schedule - """ + """Enum to describe type of schedule""" #: Cron schedule type. CRON = "Cron" #: Recurrence schedule type. RECURRENCE = "Recurrence" + class SecretsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the datastore secrets type. - """ + """Enum to determine the datastore secrets type.""" ACCOUNT_KEY = "AccountKey" CERTIFICATE = "Certificate" SAS = "Sas" SERVICE_PRINCIPAL = "ServicePrincipal" -class ServiceDataAccessAuthIdentity(str, Enum, metaclass=CaseInsensitiveEnumMeta): + +class ServiceDataAccessAuthIdentity( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): #: Do not use any identity for service data access. NONE = "None" @@ -627,14 +656,15 @@ class ServiceDataAccessAuthIdentity(str, Enum, metaclass=CaseInsensitiveEnumMeta #: Use the user assigned managed identity of the Workspace to authenticate service data access. WORKSPACE_USER_ASSIGNED_IDENTITY = "WorkspaceUserAssignedIdentity" + class SkuScaleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """TODO - SKU scale type - """ + """TODO - SKU scale type""" AUTOMATIC = "Automatic" MANUAL = "Manual" NONE = "None" + class SkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): """This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT. @@ -645,14 +675,15 @@ class SkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): STANDARD = "Standard" PREMIUM = "Premium" + class SourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Data source type. - """ + """Data source type.""" DATASET = "Dataset" DATASTORE = "Datastore" URI = "URI" + class SshPublicAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): """State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the public ssh port is open and @@ -662,82 +693,85 @@ class SshPublicAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): ENABLED = "Enabled" DISABLED = "Disabled" + class SslConfigurationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enable or disable ssl for scoring - """ + """Enable or disable ssl for scoring""" DISABLED = "Disabled" ENABLED = "Enabled" AUTO = "Auto" + class Status(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Status of update workspace quota. - """ + """Status of update workspace quota.""" UNDEFINED = "Undefined" SUCCESS = "Success" FAILURE = "Failure" INVALID_QUOTA_BELOW_CLUSTER_MINIMUM = "InvalidQuotaBelowClusterMinimum" - INVALID_QUOTA_EXCEEDS_SUBSCRIPTION_LIMIT = "InvalidQuotaExceedsSubscriptionLimit" + INVALID_QUOTA_EXCEEDS_SUBSCRIPTION_LIMIT = ( + "InvalidQuotaExceedsSubscriptionLimit" + ) INVALID_VM_FAMILY_NAME = "InvalidVMFamilyName" OPERATION_NOT_SUPPORTED_FOR_SKU = "OperationNotSupportedForSku" OPERATION_NOT_ENABLED_FOR_REGION = "OperationNotEnabledForRegion" + class StorageAccountType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """type of this storage account. - """ + """type of this storage account.""" STANDARD_LRS = "Standard_LRS" PREMIUM_LRS = "Premium_LRS" + class UnderlyingResourceAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): DELETE = "Delete" DETACH = "Detach" + class UnitOfMeasure(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The unit of time measurement for the specified VM price. Example: OneHour - """ + """The unit of time measurement for the specified VM price. Example: OneHour""" ONE_HOUR = "OneHour" + class UsageUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """An enum describing the unit of usage measurement. - """ + """An enum describing the unit of usage measurement.""" COUNT = "Count" + class ValueFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """format for the workspace connection value - """ + """format for the workspace connection value""" JSON = "JSON" + class VMPriceOSType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Operating system type used by the VM. - """ + """Operating system type used by the VM.""" LINUX = "Linux" WINDOWS = "Windows" + class VmPriority(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Virtual Machine priority - """ + """Virtual Machine priority""" DEDICATED = "Dedicated" LOW_PRIORITY = "LowPriority" + class VMTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of the VM. - """ + """The type of the VM.""" STANDARD = "Standard" LOW_PRIORITY = "LowPriority" SPOT = "Spot" + class Weekday(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum of weekdays - """ + """Enum of weekdays""" #: Monday weekday. MONDAY = "Monday" diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/models/_models.py index f195106ee819..cb31815df39c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/models/_models.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/models/_models.py @@ -25,23 +25,25 @@ class DatastoreCredentials(msrest.serialization.Model): """ _validation = { - 'credentials_type': {'required': True}, + "credentials_type": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, } _subtype_map = { - 'credentials_type': {'AccountKey': 'AccountKeyDatastoreCredentials', 'Certificate': 'CertificateDatastoreCredentials', 'None': 'NoneDatastoreCredentials', 'Sas': 'SasDatastoreCredentials', 'ServicePrincipal': 'ServicePrincipalDatastoreCredentials'} + "credentials_type": { + "AccountKey": "AccountKeyDatastoreCredentials", + "Certificate": "CertificateDatastoreCredentials", + "None": "NoneDatastoreCredentials", + "Sas": "SasDatastoreCredentials", + "ServicePrincipal": "ServicePrincipalDatastoreCredentials", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DatastoreCredentials, self).__init__(**kwargs) self.credentials_type = None # type: Optional[str] @@ -60,26 +62,23 @@ class AccountKeyDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, + "credentials_type": {"required": True}, + "secrets": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'AccountKeyDatastoreSecrets'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "secrets": {"key": "secrets", "type": "AccountKeyDatastoreSecrets"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword secrets: Required. [Required] Storage account secrets. :paramtype secrets: ~azure.mgmt.machinelearningservices.models.AccountKeyDatastoreSecrets """ super(AccountKeyDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'AccountKey' # type: str - self.secrets = kwargs['secrets'] + self.credentials_type = "AccountKey" # type: str + self.secrets = kwargs["secrets"] class DatastoreSecrets(msrest.serialization.Model): @@ -97,23 +96,24 @@ class DatastoreSecrets(msrest.serialization.Model): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, } _subtype_map = { - 'secrets_type': {'AccountKey': 'AccountKeyDatastoreSecrets', 'Certificate': 'CertificateDatastoreSecrets', 'Sas': 'SasDatastoreSecrets', 'ServicePrincipal': 'ServicePrincipalDatastoreSecrets'} + "secrets_type": { + "AccountKey": "AccountKeyDatastoreSecrets", + "Certificate": "CertificateDatastoreSecrets", + "Sas": "SasDatastoreSecrets", + "ServicePrincipal": "ServicePrincipalDatastoreSecrets", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DatastoreSecrets, self).__init__(**kwargs) self.secrets_type = None # type: Optional[str] @@ -132,25 +132,22 @@ class AccountKeyDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "key": {"key": "key", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword key: Storage account key. :paramtype key: str """ super(AccountKeyDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'AccountKey' # type: str - self.key = kwargs.get('key', None) + self.secrets_type = "AccountKey" # type: str + self.key = kwargs.get("key", None) class AKSSchema(msrest.serialization.Model): @@ -161,19 +158,16 @@ class AKSSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, + "properties": {"key": "properties", "type": "AKSSchemaProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: AKS properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties """ super(AKSSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class Compute(msrest.serialization.Model): @@ -216,36 +210,47 @@ class Compute(msrest.serialization.Model): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } _subtype_map = { - 'compute_type': {'AKS': 'AKS', 'AmlCompute': 'AmlCompute', 'ComputeInstance': 'ComputeInstance', 'DataFactory': 'DataFactory', 'DataLakeAnalytics': 'DataLakeAnalytics', 'Databricks': 'Databricks', 'HDInsight': 'HDInsight', 'Kubernetes': 'Kubernetes', 'SynapseSpark': 'SynapseSpark', 'VirtualMachine': 'VirtualMachine'} - } - - def __init__( - self, - **kwargs - ): + "compute_type": { + "AKS": "AKS", + "AmlCompute": "AmlCompute", + "ComputeInstance": "ComputeInstance", + "DataFactory": "DataFactory", + "DataLakeAnalytics": "DataLakeAnalytics", + "Databricks": "Databricks", + "HDInsight": "HDInsight", + "Kubernetes": "Kubernetes", + "SynapseSpark": "SynapseSpark", + "VirtualMachine": "VirtualMachine", + } + } + + def __init__(self, **kwargs): """ :keyword description: The description of the Machine Learning compute. :paramtype description: str @@ -259,13 +264,13 @@ def __init__( self.compute_type = None # type: Optional[str] self.compute_location = None self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) + self.disable_local_auth = kwargs.get("disable_local_auth", None) class AKS(Compute, AKSSchema): @@ -307,33 +312,33 @@ class AKS(Compute, AKSSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "AKSSchemaProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: AKS properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties @@ -346,18 +351,18 @@ def __init__( :paramtype disable_local_auth: bool """ super(AKS, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'AKS' # type: str - self.compute_type = 'AKS' # type: str + self.properties = kwargs.get("properties", None) + self.compute_type = "AKS" # type: str + self.compute_type = "AKS" # type: str self.compute_location = None self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) + self.disable_local_auth = kwargs.get("disable_local_auth", None) class AksComputeSecretsProperties(msrest.serialization.Model): @@ -374,15 +379,15 @@ class AksComputeSecretsProperties(msrest.serialization.Model): """ _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, + "user_kube_config": {"key": "userKubeConfig", "type": "str"}, + "admin_kube_config": {"key": "adminKubeConfig", "type": "str"}, + "image_pull_secret_name": { + "key": "imagePullSecretName", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword user_kube_config: Content of kubeconfig file that can be used to connect to the Kubernetes cluster. @@ -394,9 +399,11 @@ def __init__( :paramtype image_pull_secret_name: str """ super(AksComputeSecretsProperties, self).__init__(**kwargs) - self.user_kube_config = kwargs.get('user_kube_config', None) - self.admin_kube_config = kwargs.get('admin_kube_config', None) - self.image_pull_secret_name = kwargs.get('image_pull_secret_name', None) + self.user_kube_config = kwargs.get("user_kube_config", None) + self.admin_kube_config = kwargs.get("admin_kube_config", None) + self.image_pull_secret_name = kwargs.get( + "image_pull_secret_name", None + ) class ComputeSecrets(msrest.serialization.Model): @@ -414,23 +421,23 @@ class ComputeSecrets(msrest.serialization.Model): """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "compute_type": {"key": "computeType", "type": "str"}, } _subtype_map = { - 'compute_type': {'AKS': 'AksComputeSecrets', 'Databricks': 'DatabricksComputeSecrets', 'VirtualMachine': 'VirtualMachineSecrets'} + "compute_type": { + "AKS": "AksComputeSecrets", + "Databricks": "DatabricksComputeSecrets", + "VirtualMachine": "VirtualMachineSecrets", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ComputeSecrets, self).__init__(**kwargs) self.compute_type = None # type: Optional[str] @@ -455,20 +462,20 @@ class AksComputeSecrets(ComputeSecrets, AksComputeSecretsProperties): """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "user_kube_config": {"key": "userKubeConfig", "type": "str"}, + "admin_kube_config": {"key": "adminKubeConfig", "type": "str"}, + "image_pull_secret_name": { + "key": "imagePullSecretName", + "type": "str", + }, + "compute_type": {"key": "computeType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword user_kube_config: Content of kubeconfig file that can be used to connect to the Kubernetes cluster. @@ -480,11 +487,13 @@ def __init__( :paramtype image_pull_secret_name: str """ super(AksComputeSecrets, self).__init__(**kwargs) - self.user_kube_config = kwargs.get('user_kube_config', None) - self.admin_kube_config = kwargs.get('admin_kube_config', None) - self.image_pull_secret_name = kwargs.get('image_pull_secret_name', None) - self.compute_type = 'AKS' # type: str - self.compute_type = 'AKS' # type: str + self.user_kube_config = kwargs.get("user_kube_config", None) + self.admin_kube_config = kwargs.get("admin_kube_config", None) + self.image_pull_secret_name = kwargs.get( + "image_pull_secret_name", None + ) + self.compute_type = "AKS" # type: str + self.compute_type = "AKS" # type: str class AksNetworkingConfiguration(msrest.serialization.Model): @@ -504,22 +513,25 @@ class AksNetworkingConfiguration(msrest.serialization.Model): """ _validation = { - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, + "service_cidr": { + "pattern": r"^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$" + }, + "dns_service_ip": { + "pattern": r"^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" + }, + "docker_bridge_cidr": { + "pattern": r"^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$" + }, } _attribute_map = { - 'subnet_id': {'key': 'subnetId', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, + "subnet_id": {"key": "subnetId", "type": "str"}, + "service_cidr": {"key": "serviceCidr", "type": "str"}, + "dns_service_ip": {"key": "dnsServiceIP", "type": "str"}, + "docker_bridge_cidr": {"key": "dockerBridgeCidr", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword subnet_id: Virtual network subnet resource ID the compute nodes belong to. :paramtype subnet_id: str @@ -534,10 +546,10 @@ def __init__( :paramtype docker_bridge_cidr: str """ super(AksNetworkingConfiguration, self).__init__(**kwargs) - self.subnet_id = kwargs.get('subnet_id', None) - self.service_cidr = kwargs.get('service_cidr', None) - self.dns_service_ip = kwargs.get('dns_service_ip', None) - self.docker_bridge_cidr = kwargs.get('docker_bridge_cidr', None) + self.subnet_id = kwargs.get("subnet_id", None) + self.service_cidr = kwargs.get("service_cidr", None) + self.dns_service_ip = kwargs.get("dns_service_ip", None) + self.docker_bridge_cidr = kwargs.get("docker_bridge_cidr", None) class AKSSchemaProperties(msrest.serialization.Model): @@ -569,26 +581,32 @@ class AKSSchemaProperties(msrest.serialization.Model): """ _validation = { - 'system_services': {'readonly': True}, - 'agent_count': {'minimum': 0}, + "system_services": {"readonly": True}, + "agent_count": {"minimum": 0}, } _attribute_map = { - 'cluster_fqdn': {'key': 'clusterFqdn', 'type': 'str'}, - 'system_services': {'key': 'systemServices', 'type': '[SystemService]'}, - 'agent_count': {'key': 'agentCount', 'type': 'int'}, - 'agent_vm_size': {'key': 'agentVmSize', 'type': 'str'}, - 'cluster_purpose': {'key': 'clusterPurpose', 'type': 'str'}, - 'ssl_configuration': {'key': 'sslConfiguration', 'type': 'SslConfiguration'}, - 'aks_networking_configuration': {'key': 'aksNetworkingConfiguration', 'type': 'AksNetworkingConfiguration'}, - 'load_balancer_type': {'key': 'loadBalancerType', 'type': 'str'}, - 'load_balancer_subnet': {'key': 'loadBalancerSubnet', 'type': 'str'}, + "cluster_fqdn": {"key": "clusterFqdn", "type": "str"}, + "system_services": { + "key": "systemServices", + "type": "[SystemService]", + }, + "agent_count": {"key": "agentCount", "type": "int"}, + "agent_vm_size": {"key": "agentVmSize", "type": "str"}, + "cluster_purpose": {"key": "clusterPurpose", "type": "str"}, + "ssl_configuration": { + "key": "sslConfiguration", + "type": "SslConfiguration", + }, + "aks_networking_configuration": { + "key": "aksNetworkingConfiguration", + "type": "AksNetworkingConfiguration", + }, + "load_balancer_type": {"key": "loadBalancerType", "type": "str"}, + "load_balancer_subnet": {"key": "loadBalancerSubnet", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword cluster_fqdn: Cluster full qualified domain name. :paramtype cluster_fqdn: str @@ -612,15 +630,17 @@ def __init__( :paramtype load_balancer_subnet: str """ super(AKSSchemaProperties, self).__init__(**kwargs) - self.cluster_fqdn = kwargs.get('cluster_fqdn', None) + self.cluster_fqdn = kwargs.get("cluster_fqdn", None) self.system_services = None - self.agent_count = kwargs.get('agent_count', None) - self.agent_vm_size = kwargs.get('agent_vm_size', None) - self.cluster_purpose = kwargs.get('cluster_purpose', "FastProd") - self.ssl_configuration = kwargs.get('ssl_configuration', None) - self.aks_networking_configuration = kwargs.get('aks_networking_configuration', None) - self.load_balancer_type = kwargs.get('load_balancer_type', "PublicIp") - self.load_balancer_subnet = kwargs.get('load_balancer_subnet', None) + self.agent_count = kwargs.get("agent_count", None) + self.agent_vm_size = kwargs.get("agent_vm_size", None) + self.cluster_purpose = kwargs.get("cluster_purpose", "FastProd") + self.ssl_configuration = kwargs.get("ssl_configuration", None) + self.aks_networking_configuration = kwargs.get( + "aks_networking_configuration", None + ) + self.load_balancer_type = kwargs.get("load_balancer_type", "PublicIp") + self.load_balancer_subnet = kwargs.get("load_balancer_subnet", None) class AmlComputeSchema(msrest.serialization.Model): @@ -631,19 +651,16 @@ class AmlComputeSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, + "properties": {"key": "properties", "type": "AmlComputeProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of AmlCompute. :paramtype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties """ super(AmlComputeSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class AmlCompute(Compute, AmlComputeSchema): @@ -685,33 +702,33 @@ class AmlCompute(Compute, AmlComputeSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "AmlComputeProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of AmlCompute. :paramtype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties @@ -724,18 +741,18 @@ def __init__( :paramtype disable_local_auth: bool """ super(AmlCompute, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'AmlCompute' # type: str - self.compute_type = 'AmlCompute' # type: str + self.properties = kwargs.get("properties", None) + self.compute_type = "AmlCompute" # type: str + self.compute_type = "AmlCompute" # type: str self.compute_location = None self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) + self.disable_local_auth = kwargs.get("disable_local_auth", None) class AmlComputeNodeInformation(msrest.serialization.Model): @@ -760,29 +777,25 @@ class AmlComputeNodeInformation(msrest.serialization.Model): """ _validation = { - 'node_id': {'readonly': True}, - 'private_ip_address': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'port': {'readonly': True}, - 'node_state': {'readonly': True}, - 'run_id': {'readonly': True}, + "node_id": {"readonly": True}, + "private_ip_address": {"readonly": True}, + "public_ip_address": {"readonly": True}, + "port": {"readonly": True}, + "node_state": {"readonly": True}, + "run_id": {"readonly": True}, } _attribute_map = { - 'node_id': {'key': 'nodeId', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'node_state': {'key': 'nodeState', 'type': 'str'}, - 'run_id': {'key': 'runId', 'type': 'str'}, + "node_id": {"key": "nodeId", "type": "str"}, + "private_ip_address": {"key": "privateIpAddress", "type": "str"}, + "public_ip_address": {"key": "publicIpAddress", "type": "str"}, + "port": {"key": "port", "type": "int"}, + "node_state": {"key": "nodeState", "type": "str"}, + "run_id": {"key": "runId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AmlComputeNodeInformation, self).__init__(**kwargs) self.node_id = None self.private_ip_address = None @@ -804,21 +817,17 @@ class AmlComputeNodesInformation(msrest.serialization.Model): """ _validation = { - 'nodes': {'readonly': True}, - 'next_link': {'readonly': True}, + "nodes": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'nodes': {'key': 'nodes', 'type': '[AmlComputeNodeInformation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "nodes": {"key": "nodes", "type": "[AmlComputeNodeInformation]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AmlComputeNodesInformation, self).__init__(**kwargs) self.nodes = None self.next_link = None @@ -889,38 +898,50 @@ class AmlComputeProperties(msrest.serialization.Model): """ _validation = { - 'allocation_state': {'readonly': True}, - 'allocation_state_transition_time': {'readonly': True}, - 'errors': {'readonly': True}, - 'current_node_count': {'readonly': True}, - 'target_node_count': {'readonly': True}, - 'node_state_counts': {'readonly': True}, - } - - _attribute_map = { - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'vm_priority': {'key': 'vmPriority', 'type': 'str'}, - 'virtual_machine_image': {'key': 'virtualMachineImage', 'type': 'VirtualMachineImage'}, - 'isolated_network': {'key': 'isolatedNetwork', 'type': 'bool'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, - 'user_account_credentials': {'key': 'userAccountCredentials', 'type': 'UserAccountCredentials'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'remote_login_port_public_access': {'key': 'remoteLoginPortPublicAccess', 'type': 'str'}, - 'allocation_state': {'key': 'allocationState', 'type': 'str'}, - 'allocation_state_transition_time': {'key': 'allocationStateTransitionTime', 'type': 'iso-8601'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'current_node_count': {'key': 'currentNodeCount', 'type': 'int'}, - 'target_node_count': {'key': 'targetNodeCount', 'type': 'int'}, - 'node_state_counts': {'key': 'nodeStateCounts', 'type': 'NodeStateCounts'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'property_bag': {'key': 'propertyBag', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): + "allocation_state": {"readonly": True}, + "allocation_state_transition_time": {"readonly": True}, + "errors": {"readonly": True}, + "current_node_count": {"readonly": True}, + "target_node_count": {"readonly": True}, + "node_state_counts": {"readonly": True}, + } + + _attribute_map = { + "os_type": {"key": "osType", "type": "str"}, + "vm_size": {"key": "vmSize", "type": "str"}, + "vm_priority": {"key": "vmPriority", "type": "str"}, + "virtual_machine_image": { + "key": "virtualMachineImage", + "type": "VirtualMachineImage", + }, + "isolated_network": {"key": "isolatedNetwork", "type": "bool"}, + "scale_settings": {"key": "scaleSettings", "type": "ScaleSettings"}, + "user_account_credentials": { + "key": "userAccountCredentials", + "type": "UserAccountCredentials", + }, + "subnet": {"key": "subnet", "type": "ResourceId"}, + "remote_login_port_public_access": { + "key": "remoteLoginPortPublicAccess", + "type": "str", + }, + "allocation_state": {"key": "allocationState", "type": "str"}, + "allocation_state_transition_time": { + "key": "allocationStateTransitionTime", + "type": "iso-8601", + }, + "errors": {"key": "errors", "type": "[ErrorResponse]"}, + "current_node_count": {"key": "currentNodeCount", "type": "int"}, + "target_node_count": {"key": "targetNodeCount", "type": "int"}, + "node_state_counts": { + "key": "nodeStateCounts", + "type": "NodeStateCounts", + }, + "enable_node_public_ip": {"key": "enableNodePublicIp", "type": "bool"}, + "property_bag": {"key": "propertyBag", "type": "object"}, + } + + def __init__(self, **kwargs): """ :keyword os_type: Compute OS Type. Possible values include: "Linux", "Windows". Default value: "Linux". @@ -961,23 +982,27 @@ def __init__( :paramtype property_bag: any """ super(AmlComputeProperties, self).__init__(**kwargs) - self.os_type = kwargs.get('os_type', "Linux") - self.vm_size = kwargs.get('vm_size', None) - self.vm_priority = kwargs.get('vm_priority', None) - self.virtual_machine_image = kwargs.get('virtual_machine_image', None) - self.isolated_network = kwargs.get('isolated_network', None) - self.scale_settings = kwargs.get('scale_settings', None) - self.user_account_credentials = kwargs.get('user_account_credentials', None) - self.subnet = kwargs.get('subnet', None) - self.remote_login_port_public_access = kwargs.get('remote_login_port_public_access', "NotSpecified") + self.os_type = kwargs.get("os_type", "Linux") + self.vm_size = kwargs.get("vm_size", None) + self.vm_priority = kwargs.get("vm_priority", None) + self.virtual_machine_image = kwargs.get("virtual_machine_image", None) + self.isolated_network = kwargs.get("isolated_network", None) + self.scale_settings = kwargs.get("scale_settings", None) + self.user_account_credentials = kwargs.get( + "user_account_credentials", None + ) + self.subnet = kwargs.get("subnet", None) + self.remote_login_port_public_access = kwargs.get( + "remote_login_port_public_access", "NotSpecified" + ) self.allocation_state = None self.allocation_state_transition_time = None self.errors = None self.current_node_count = None self.target_node_count = None self.node_state_counts = None - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', True) - self.property_bag = kwargs.get('property_bag', None) + self.enable_node_public_ip = kwargs.get("enable_node_public_ip", True) + self.property_bag = kwargs.get("property_bag", None) class AmlOperation(msrest.serialization.Model): @@ -992,15 +1017,12 @@ class AmlOperation(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'AmlOperationDisplay'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + "name": {"key": "name", "type": "str"}, + "display": {"key": "display", "type": "AmlOperationDisplay"}, + "is_data_action": {"key": "isDataAction", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: Operation name: {provider}/{resource}/{operation}. :paramtype name: str @@ -1010,9 +1032,9 @@ def __init__( :paramtype is_data_action: bool """ super(AmlOperation, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display = kwargs.get('display', None) - self.is_data_action = kwargs.get('is_data_action', None) + self.name = kwargs.get("name", None) + self.display = kwargs.get("display", None) + self.is_data_action = kwargs.get("is_data_action", None) class AmlOperationDisplay(msrest.serialization.Model): @@ -1029,16 +1051,13 @@ class AmlOperationDisplay(msrest.serialization.Model): """ _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, + "provider": {"key": "provider", "type": "str"}, + "resource": {"key": "resource", "type": "str"}, + "operation": {"key": "operation", "type": "str"}, + "description": {"key": "description", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword provider: The resource provider name: Microsoft.MachineLearningExperimentation. :paramtype provider: str @@ -1050,10 +1069,10 @@ def __init__( :paramtype description: str """ super(AmlOperationDisplay, self).__init__(**kwargs) - self.provider = kwargs.get('provider', None) - self.resource = kwargs.get('resource', None) - self.operation = kwargs.get('operation', None) - self.description = kwargs.get('description', None) + self.provider = kwargs.get("provider", None) + self.resource = kwargs.get("resource", None) + self.operation = kwargs.get("operation", None) + self.description = kwargs.get("description", None) class AmlOperationListResult(msrest.serialization.Model): @@ -1064,20 +1083,17 @@ class AmlOperationListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlOperation]'}, + "value": {"key": "value", "type": "[AmlOperation]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: List of AML workspace operations supported by the AML workspace resource provider. :paramtype value: list[~azure.mgmt.machinelearningservices.models.AmlOperation] """ super(AmlOperationListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class IdentityConfiguration(msrest.serialization.Model): @@ -1095,23 +1111,23 @@ class IdentityConfiguration(msrest.serialization.Model): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, } _subtype_map = { - 'identity_type': {'AMLToken': 'AmlToken', 'Managed': 'ManagedIdentity', 'UserIdentity': 'UserIdentity'} + "identity_type": { + "AMLToken": "AmlToken", + "Managed": "ManagedIdentity", + "UserIdentity": "UserIdentity", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(IdentityConfiguration, self).__init__(**kwargs) self.identity_type = None # type: Optional[str] @@ -1128,21 +1144,17 @@ class AmlToken(IdentityConfiguration): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AmlToken, self).__init__(**kwargs) - self.identity_type = 'AMLToken' # type: str + self.identity_type = "AMLToken" # type: str class AmlUserFeature(msrest.serialization.Model): @@ -1157,15 +1169,12 @@ class AmlUserFeature(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "description": {"key": "description", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword id: Specifies the feature ID. :paramtype id: str @@ -1175,9 +1184,9 @@ def __init__( :paramtype description: str """ super(AmlUserFeature, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.display_name = kwargs.get('display_name', None) - self.description = kwargs.get('description', None) + self.id = kwargs.get("id", None) + self.display_name = kwargs.get("display_name", None) + self.description = kwargs.get("description", None) class ResourceBase(msrest.serialization.Model): @@ -1192,15 +1201,12 @@ class ResourceBase(msrest.serialization.Model): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -1210,9 +1216,9 @@ def __init__( :paramtype tags: dict[str, str] """ super(ResourceBase, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) + self.description = kwargs.get("description", None) + self.properties = kwargs.get("properties", None) + self.tags = kwargs.get("tags", None) class AssetBase(ResourceBase): @@ -1231,17 +1237,14 @@ class AssetBase(ResourceBase): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -1255,8 +1258,8 @@ def __init__( :paramtype is_archived: bool """ super(AssetBase, self).__init__(**kwargs) - self.is_anonymous = kwargs.get('is_anonymous', False) - self.is_archived = kwargs.get('is_archived', False) + self.is_anonymous = kwargs.get("is_anonymous", False) + self.is_archived = kwargs.get("is_archived", False) class AssetContainer(ResourceBase): @@ -1279,23 +1282,20 @@ class AssetContainer(ResourceBase): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -1307,7 +1307,7 @@ def __init__( :paramtype is_archived: bool """ super(AssetContainer, self).__init__(**kwargs) - self.is_archived = kwargs.get('is_archived', False) + self.is_archived = kwargs.get("is_archived", False) self.latest_version = None self.next_version = None @@ -1325,18 +1325,15 @@ class AssetJobInput(msrest.serialization.Model): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -1345,8 +1342,8 @@ def __init__( :paramtype uri: str """ super(AssetJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] class AssetJobOutput(msrest.serialization.Model): @@ -1359,14 +1356,11 @@ class AssetJobOutput(msrest.serialization.Model): """ _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -1374,8 +1368,8 @@ def __init__( :paramtype uri: str """ super(AssetJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) class AssetReferenceBase(msrest.serialization.Model): @@ -1392,23 +1386,23 @@ class AssetReferenceBase(msrest.serialization.Model): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, } _subtype_map = { - 'reference_type': {'DataPath': 'DataPathAssetReference', 'Id': 'IdAssetReference', 'OutputPath': 'OutputPathAssetReference'} + "reference_type": { + "DataPath": "DataPathAssetReference", + "Id": "IdAssetReference", + "OutputPath": "OutputPathAssetReference", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AssetReferenceBase, self).__init__(**kwargs) self.reference_type = None # type: Optional[str] @@ -1425,19 +1419,16 @@ class AssignedUser(msrest.serialization.Model): """ _validation = { - 'object_id': {'required': True}, - 'tenant_id': {'required': True}, + "object_id": {"required": True}, + "tenant_id": {"required": True}, } _attribute_map = { - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + "object_id": {"key": "objectId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword object_id: Required. User�s AAD Object Id. :paramtype object_id: str @@ -1445,8 +1436,8 @@ def __init__( :paramtype tenant_id: str """ super(AssignedUser, self).__init__(**kwargs) - self.object_id = kwargs['object_id'] - self.tenant_id = kwargs['tenant_id'] + self.object_id = kwargs["object_id"] + self.tenant_id = kwargs["tenant_id"] class AutoPauseProperties(msrest.serialization.Model): @@ -1459,14 +1450,11 @@ class AutoPauseProperties(msrest.serialization.Model): """ _attribute_map = { - 'delay_in_minutes': {'key': 'delayInMinutes', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, + "delay_in_minutes": {"key": "delayInMinutes", "type": "int"}, + "enabled": {"key": "enabled", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword delay_in_minutes: :paramtype delay_in_minutes: int @@ -1474,8 +1462,8 @@ def __init__( :paramtype enabled: bool """ super(AutoPauseProperties, self).__init__(**kwargs) - self.delay_in_minutes = kwargs.get('delay_in_minutes', None) - self.enabled = kwargs.get('enabled', None) + self.delay_in_minutes = kwargs.get("delay_in_minutes", None) + self.enabled = kwargs.get("enabled", None) class AutoScaleProperties(msrest.serialization.Model): @@ -1490,15 +1478,12 @@ class AutoScaleProperties(msrest.serialization.Model): """ _attribute_map = { - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, + "min_node_count": {"key": "minNodeCount", "type": "int"}, + "enabled": {"key": "enabled", "type": "bool"}, + "max_node_count": {"key": "maxNodeCount", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword min_node_count: :paramtype min_node_count: int @@ -1508,9 +1493,9 @@ def __init__( :paramtype max_node_count: int """ super(AutoScaleProperties, self).__init__(**kwargs) - self.min_node_count = kwargs.get('min_node_count', None) - self.enabled = kwargs.get('enabled', None) - self.max_node_count = kwargs.get('max_node_count', None) + self.min_node_count = kwargs.get("min_node_count", None) + self.enabled = kwargs.get("enabled", None) + self.max_node_count = kwargs.get("max_node_count", None) class DatastoreDetails(ResourceBase): @@ -1541,28 +1526,30 @@ class DatastoreDetails(ResourceBase): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, } _subtype_map = { - 'datastore_type': {'AzureBlob': 'AzureBlobDatastore', 'AzureDataLakeGen1': 'AzureDataLakeGen1Datastore', 'AzureDataLakeGen2': 'AzureDataLakeGen2Datastore', 'AzureFile': 'AzureFileDatastore'} + "datastore_type": { + "AzureBlob": "AzureBlobDatastore", + "AzureDataLakeGen1": "AzureDataLakeGen1Datastore", + "AzureDataLakeGen2": "AzureDataLakeGen2Datastore", + "AzureFile": "AzureFileDatastore", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -1574,8 +1561,8 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials """ super(DatastoreDetails, self).__init__(**kwargs) - self.credentials = kwargs['credentials'] - self.datastore_type = 'DatastoreDetails' # type: str + self.credentials = kwargs["credentials"] + self.datastore_type = "DatastoreDetails" # type: str self.is_default = None @@ -1617,29 +1604,29 @@ class AzureBlobDatastore(DatastoreDetails): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "account_name": {"key": "accountName", "type": "str"}, + "container_name": {"key": "containerName", "type": "str"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -1664,12 +1651,14 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ super(AzureBlobDatastore, self).__init__(**kwargs) - self.datastore_type = 'AzureBlob' # type: str - self.account_name = kwargs.get('account_name', None) - self.container_name = kwargs.get('container_name', None) - self.endpoint = kwargs.get('endpoint', None) - self.protocol = kwargs.get('protocol', None) - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) + self.datastore_type = "AzureBlob" # type: str + self.account_name = kwargs.get("account_name", None) + self.container_name = kwargs.get("container_name", None) + self.endpoint = kwargs.get("endpoint", None) + self.protocol = kwargs.get("protocol", None) + self.service_data_access_auth_identity = kwargs.get( + "service_data_access_auth_identity", None + ) class AzureDataLakeGen1Datastore(DatastoreDetails): @@ -1704,27 +1693,27 @@ class AzureDataLakeGen1Datastore(DatastoreDetails): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'store_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "store_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - 'store_name': {'key': 'storeName', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, + "store_name": {"key": "storeName", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -1743,9 +1732,11 @@ def __init__( :paramtype store_name: str """ super(AzureDataLakeGen1Datastore, self).__init__(**kwargs) - self.datastore_type = 'AzureDataLakeGen1' # type: str - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) - self.store_name = kwargs['store_name'] + self.datastore_type = "AzureDataLakeGen1" # type: str + self.service_data_access_auth_identity = kwargs.get( + "service_data_access_auth_identity", None + ) + self.store_name = kwargs["store_name"] class AzureDataLakeGen2Datastore(DatastoreDetails): @@ -1786,31 +1777,31 @@ class AzureDataLakeGen2Datastore(DatastoreDetails): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'filesystem': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "account_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "filesystem": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'filesystem': {'key': 'filesystem', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "account_name": {"key": "accountName", "type": "str"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "filesystem": {"key": "filesystem", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -1835,12 +1826,14 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ super(AzureDataLakeGen2Datastore, self).__init__(**kwargs) - self.datastore_type = 'AzureDataLakeGen2' # type: str - self.account_name = kwargs['account_name'] - self.endpoint = kwargs.get('endpoint', None) - self.filesystem = kwargs['filesystem'] - self.protocol = kwargs.get('protocol', None) - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) + self.datastore_type = "AzureDataLakeGen2" # type: str + self.account_name = kwargs["account_name"] + self.endpoint = kwargs.get("endpoint", None) + self.filesystem = kwargs["filesystem"] + self.protocol = kwargs.get("protocol", None) + self.service_data_access_auth_identity = kwargs.get( + "service_data_access_auth_identity", None + ) class AzureFileDatastore(DatastoreDetails): @@ -1881,31 +1874,31 @@ class AzureFileDatastore(DatastoreDetails): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'file_share_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "account_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "file_share_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'file_share_name': {'key': 'fileShareName', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "account_name": {"key": "accountName", "type": "str"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "file_share_name": {"key": "fileShareName", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -1930,12 +1923,14 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ super(AzureFileDatastore, self).__init__(**kwargs) - self.datastore_type = 'AzureFile' # type: str - self.account_name = kwargs['account_name'] - self.endpoint = kwargs.get('endpoint', None) - self.file_share_name = kwargs['file_share_name'] - self.protocol = kwargs.get('protocol', None) - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) + self.datastore_type = "AzureFile" # type: str + self.account_name = kwargs["account_name"] + self.endpoint = kwargs.get("endpoint", None) + self.file_share_name = kwargs["file_share_name"] + self.protocol = kwargs.get("protocol", None) + self.service_data_access_auth_identity = kwargs.get( + "service_data_access_auth_identity", None + ) class EarlyTerminationPolicy(msrest.serialization.Model): @@ -1957,23 +1952,24 @@ class EarlyTerminationPolicy(msrest.serialization.Model): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, } _subtype_map = { - 'policy_type': {'Bandit': 'BanditPolicy', 'MedianStopping': 'MedianStoppingPolicy', 'TruncationSelection': 'TruncationSelectionPolicy'} + "policy_type": { + "Bandit": "BanditPolicy", + "MedianStopping": "MedianStoppingPolicy", + "TruncationSelection": "TruncationSelectionPolicy", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. :paramtype delay_evaluation: int @@ -1981,8 +1977,8 @@ def __init__( :paramtype evaluation_interval: int """ super(EarlyTerminationPolicy, self).__init__(**kwargs) - self.delay_evaluation = kwargs.get('delay_evaluation', 0) - self.evaluation_interval = kwargs.get('evaluation_interval', 0) + self.delay_evaluation = kwargs.get("delay_evaluation", 0) + self.evaluation_interval = kwargs.get("evaluation_interval", 0) self.policy_type = None # type: Optional[str] @@ -2006,21 +2002,18 @@ class BanditPolicy(EarlyTerminationPolicy): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'slack_amount': {'key': 'slackAmount', 'type': 'float'}, - 'slack_factor': {'key': 'slackFactor', 'type': 'float'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, + "slack_amount": {"key": "slackAmount", "type": "float"}, + "slack_factor": {"key": "slackFactor", "type": "float"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. :paramtype delay_evaluation: int @@ -2032,9 +2025,9 @@ def __init__( :paramtype slack_factor: float """ super(BanditPolicy, self).__init__(**kwargs) - self.policy_type = 'Bandit' # type: str - self.slack_amount = kwargs.get('slack_amount', 0) - self.slack_factor = kwargs.get('slack_factor', 0) + self.policy_type = "Bandit" # type: str + self.slack_amount = kwargs.get("slack_amount", 0) + self.slack_factor = kwargs.get("slack_factor", 0) class Resource(msrest.serialization.Model): @@ -2056,25 +2049,21 @@ class Resource(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -2107,26 +2096,23 @@ class TrackedResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -2134,8 +2120,8 @@ def __init__( :paramtype location: str """ super(TrackedResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.location = kwargs['location'] + self.tags = kwargs.get("tags", None) + self.location = kwargs["location"] class BatchDeploymentData(TrackedResource): @@ -2172,31 +2158,28 @@ class BatchDeploymentData(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchDeploymentDetails'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": {"key": "properties", "type": "BatchDeploymentDetails"}, + "sku": {"key": "sku", "type": "Sku"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -2213,10 +2196,10 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ super(BatchDeploymentData, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) + self.identity = kwargs.get("identity", None) + self.kind = kwargs.get("kind", None) + self.properties = kwargs["properties"] + self.sku = kwargs.get("sku", None) class EndpointDeploymentPropertiesBase(msrest.serialization.Model): @@ -2236,17 +2219,20 @@ class EndpointDeploymentPropertiesBase(msrest.serialization.Model): """ _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword code_configuration: Code configuration for the endpoint deployment. :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration @@ -2261,11 +2247,11 @@ def __init__( :paramtype properties: dict[str, str] """ super(EndpointDeploymentPropertiesBase, self).__init__(**kwargs) - self.code_configuration = kwargs.get('code_configuration', None) - self.description = kwargs.get('description', None) - self.environment_id = kwargs.get('environment_id', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.properties = kwargs.get('properties', None) + self.code_configuration = kwargs.get("code_configuration", None) + self.description = kwargs.get("description", None) + self.environment_id = kwargs.get("environment_id", None) + self.environment_variables = kwargs.get("environment_variables", None) + self.properties = kwargs.get("properties", None) class BatchDeploymentDetails(EndpointDeploymentPropertiesBase): @@ -2322,32 +2308,41 @@ class BatchDeploymentDetails(EndpointDeploymentPropertiesBase): """ _validation = { - 'provisioning_state': {'readonly': True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'error_threshold': {'key': 'errorThreshold', 'type': 'int'}, - 'logging_level': {'key': 'loggingLevel', 'type': 'str'}, - 'max_concurrency_per_instance': {'key': 'maxConcurrencyPerInstance', 'type': 'int'}, - 'mini_batch_size': {'key': 'miniBatchSize', 'type': 'long'}, - 'model': {'key': 'model', 'type': 'AssetReferenceBase'}, - 'output_action': {'key': 'outputAction', 'type': 'str'}, - 'output_file_name': {'key': 'outputFileName', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'resources': {'key': 'resources', 'type': 'ResourceConfiguration'}, - 'retry_settings': {'key': 'retrySettings', 'type': 'BatchRetrySettings'}, + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "compute": {"key": "compute", "type": "str"}, + "error_threshold": {"key": "errorThreshold", "type": "int"}, + "logging_level": {"key": "loggingLevel", "type": "str"}, + "max_concurrency_per_instance": { + "key": "maxConcurrencyPerInstance", + "type": "int", + }, + "mini_batch_size": {"key": "miniBatchSize", "type": "long"}, + "model": {"key": "model", "type": "AssetReferenceBase"}, + "output_action": {"key": "outputAction", "type": "str"}, + "output_file_name": {"key": "outputFileName", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "resources": {"key": "resources", "type": "ResourceConfiguration"}, + "retry_settings": { + "key": "retrySettings", + "type": "BatchRetrySettings", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword code_configuration: Code configuration for the endpoint deployment. :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration @@ -2393,20 +2388,26 @@ def __init__( :paramtype retry_settings: ~azure.mgmt.machinelearningservices.models.BatchRetrySettings """ super(BatchDeploymentDetails, self).__init__(**kwargs) - self.compute = kwargs.get('compute', None) - self.error_threshold = kwargs.get('error_threshold', -1) - self.logging_level = kwargs.get('logging_level', None) - self.max_concurrency_per_instance = kwargs.get('max_concurrency_per_instance', 1) - self.mini_batch_size = kwargs.get('mini_batch_size', 10) - self.model = kwargs.get('model', None) - self.output_action = kwargs.get('output_action', None) - self.output_file_name = kwargs.get('output_file_name', "predictions.csv") + self.compute = kwargs.get("compute", None) + self.error_threshold = kwargs.get("error_threshold", -1) + self.logging_level = kwargs.get("logging_level", None) + self.max_concurrency_per_instance = kwargs.get( + "max_concurrency_per_instance", 1 + ) + self.mini_batch_size = kwargs.get("mini_batch_size", 10) + self.model = kwargs.get("model", None) + self.output_action = kwargs.get("output_action", None) + self.output_file_name = kwargs.get( + "output_file_name", "predictions.csv" + ) self.provisioning_state = None - self.resources = kwargs.get('resources', None) - self.retry_settings = kwargs.get('retry_settings', None) + self.resources = kwargs.get("resources", None) + self.retry_settings = kwargs.get("retry_settings", None) -class BatchDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class BatchDeploymentTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of BatchDeployment entities. :ivar next_link: The link to the next page of BatchDeployment objects. If null, there are no @@ -2417,14 +2418,11 @@ class BatchDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Mode """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchDeploymentData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[BatchDeploymentData]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of BatchDeployment objects. If null, there are no additional pages. @@ -2432,9 +2430,11 @@ def __init__( :keyword value: An array of objects of type BatchDeployment. :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchDeploymentData] """ - super(BatchDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(BatchDeploymentTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class BatchEndpointData(TrackedResource): @@ -2471,31 +2471,28 @@ class BatchEndpointData(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchEndpointDetails'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": {"key": "properties", "type": "BatchEndpointDetails"}, + "sku": {"key": "sku", "type": "Sku"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -2512,10 +2509,10 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ super(BatchEndpointData, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) + self.identity = kwargs.get("identity", None) + self.kind = kwargs.get("kind", None) + self.properties = kwargs["properties"] + self.sku = kwargs.get("sku", None) class BatchEndpointDefaults(msrest.serialization.Model): @@ -2527,20 +2524,17 @@ class BatchEndpointDefaults(msrest.serialization.Model): """ _attribute_map = { - 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, + "deployment_name": {"key": "deploymentName", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword deployment_name: Name of the deployment that will be default for the endpoint. This deployment will end up getting 100% traffic when the endpoint scoring URL is invoked. :paramtype deployment_name: str """ super(BatchEndpointDefaults, self).__init__(**kwargs) - self.deployment_name = kwargs.get('deployment_name', None) + self.deployment_name = kwargs.get("deployment_name", None) class EndpointPropertiesBase(msrest.serialization.Model): @@ -2569,24 +2563,21 @@ class EndpointPropertiesBase(msrest.serialization.Model): """ _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, + "auth_mode": {"required": True}, + "scoring_uri": {"readonly": True}, + "swagger_uri": {"readonly": True}, } _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, + "auth_mode": {"key": "authMode", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "keys": {"key": "keys", "type": "EndpointAuthKeys"}, + "properties": {"key": "properties", "type": "{str}"}, + "scoring_uri": {"key": "scoringUri", "type": "str"}, + "swagger_uri": {"key": "swaggerUri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' @@ -2602,10 +2593,10 @@ def __init__( :paramtype properties: dict[str, str] """ super(EndpointPropertiesBase, self).__init__(**kwargs) - self.auth_mode = kwargs['auth_mode'] - self.description = kwargs.get('description', None) - self.keys = kwargs.get('keys', None) - self.properties = kwargs.get('properties', None) + self.auth_mode = kwargs["auth_mode"] + self.description = kwargs.get("description", None) + self.keys = kwargs.get("keys", None) + self.properties = kwargs.get("properties", None) self.scoring_uri = None self.swagger_uri = None @@ -2642,27 +2633,24 @@ class BatchEndpointDetails(EndpointPropertiesBase): """ _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "auth_mode": {"required": True}, + "scoring_uri": {"readonly": True}, + "swagger_uri": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'defaults': {'key': 'defaults', 'type': 'BatchEndpointDefaults'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "auth_mode": {"key": "authMode", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "keys": {"key": "keys", "type": "EndpointAuthKeys"}, + "properties": {"key": "properties", "type": "{str}"}, + "scoring_uri": {"key": "scoringUri", "type": "str"}, + "swagger_uri": {"key": "swaggerUri", "type": "str"}, + "defaults": {"key": "defaults", "type": "BatchEndpointDefaults"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' @@ -2680,11 +2668,13 @@ def __init__( :paramtype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults """ super(BatchEndpointDetails, self).__init__(**kwargs) - self.defaults = kwargs.get('defaults', None) + self.defaults = kwargs.get("defaults", None) self.provisioning_state = None -class BatchEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class BatchEndpointTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of BatchEndpoint entities. :ivar next_link: The link to the next page of BatchEndpoint objects. If null, there are no @@ -2695,14 +2685,11 @@ class BatchEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model) """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchEndpointData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[BatchEndpointData]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of BatchEndpoint objects. If null, there are no additional pages. @@ -2710,9 +2697,11 @@ def __init__( :keyword value: An array of objects of type BatchEndpoint. :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchEndpointData] """ - super(BatchEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(BatchEndpointTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class BatchRetrySettings(msrest.serialization.Model): @@ -2725,14 +2714,11 @@ class BatchRetrySettings(msrest.serialization.Model): """ _attribute_map = { - 'max_retries': {'key': 'maxRetries', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "max_retries": {"key": "maxRetries", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword max_retries: Maximum retry count for a mini-batch. :paramtype max_retries: int @@ -2740,44 +2726,47 @@ def __init__( :paramtype timeout: ~datetime.timedelta """ super(BatchRetrySettings, self).__init__(**kwargs) - self.max_retries = kwargs.get('max_retries', 3) - self.timeout = kwargs.get('timeout', "PT30S") + self.max_retries = kwargs.get("max_retries", 3) + self.timeout = kwargs.get("timeout", "PT30S") class SamplingAlgorithm(msrest.serialization.Model): """The Sampling Algorithm used to generate hyperparameter values, along with properties to -configure the algorithm. + configure the algorithm. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BayesianSamplingAlgorithm, GridSamplingAlgorithm, RandomSamplingAlgorithm. + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: BayesianSamplingAlgorithm, GridSamplingAlgorithm, RandomSamplingAlgorithm. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType + :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating + hyperparameter values, along with configuration properties.Constant filled by server. Possible + values include: "Grid", "Random", "Bayesian". + :vartype sampling_algorithm_type: str or + ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } _subtype_map = { - 'sampling_algorithm_type': {'Bayesian': 'BayesianSamplingAlgorithm', 'Grid': 'GridSamplingAlgorithm', 'Random': 'RandomSamplingAlgorithm'} + "sampling_algorithm_type": { + "Bayesian": "BayesianSamplingAlgorithm", + "Grid": "GridSamplingAlgorithm", + "Random": "RandomSamplingAlgorithm", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(SamplingAlgorithm, self).__init__(**kwargs) self.sampling_algorithm_type = None # type: Optional[str] @@ -2795,21 +2784,20 @@ class BayesianSamplingAlgorithm(SamplingAlgorithm): """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(BayesianSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Bayesian' # type: str + self.sampling_algorithm_type = "Bayesian" # type: str class BuildContext(msrest.serialization.Model): @@ -2819,56 +2807,53 @@ class BuildContext(msrest.serialization.Model): :ivar context_uri: Required. [Required] URI of the Docker build context used to build the image. Supports blob URIs on environment creation and may return blob or Git URIs. - - + + .. raw:: html - + . :vartype context_uri: str :ivar dockerfile_path: Path to the Dockerfile in the build context. - - + + .. raw:: html - + . :vartype dockerfile_path: str """ _validation = { - 'context_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "context_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'context_uri': {'key': 'contextUri', 'type': 'str'}, - 'dockerfile_path': {'key': 'dockerfilePath', 'type': 'str'}, + "context_uri": {"key": "contextUri", "type": "str"}, + "dockerfile_path": {"key": "dockerfilePath", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword context_uri: Required. [Required] URI of the Docker build context used to build the image. Supports blob URIs on environment creation and may return blob or Git URIs. - - + + .. raw:: html - + . :paramtype context_uri: str :keyword dockerfile_path: Path to the Dockerfile in the build context. - - + + .. raw:: html - + . :paramtype dockerfile_path: str """ super(BuildContext, self).__init__(**kwargs) - self.context_uri = kwargs['context_uri'] - self.dockerfile_path = kwargs.get('dockerfile_path', "Dockerfile") + self.context_uri = kwargs["context_uri"] + self.dockerfile_path = kwargs.get("dockerfile_path", "Dockerfile") class CertificateDatastoreCredentials(DatastoreCredentials): @@ -2895,27 +2880,24 @@ class CertificateDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, - 'thumbprint': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials_type": {"required": True}, + "client_id": {"required": True}, + "secrets": {"required": True}, + "tenant_id": {"required": True}, + "thumbprint": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'CertificateDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "authority_url": {"key": "authorityUrl", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + "resource_url": {"key": "resourceUrl", "type": "str"}, + "secrets": {"key": "secrets", "type": "CertificateDatastoreSecrets"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "thumbprint": {"key": "thumbprint", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword authority_url: Authority URL used for authentication. :paramtype authority_url: str @@ -2933,13 +2915,13 @@ def __init__( :paramtype thumbprint: str """ super(CertificateDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Certificate' # type: str - self.authority_url = kwargs.get('authority_url', None) - self.client_id = kwargs['client_id'] - self.resource_url = kwargs.get('resource_url', None) - self.secrets = kwargs['secrets'] - self.tenant_id = kwargs['tenant_id'] - self.thumbprint = kwargs['thumbprint'] + self.credentials_type = "Certificate" # type: str + self.authority_url = kwargs.get("authority_url", None) + self.client_id = kwargs["client_id"] + self.resource_url = kwargs.get("resource_url", None) + self.secrets = kwargs["secrets"] + self.tenant_id = kwargs["tenant_id"] + self.thumbprint = kwargs["thumbprint"] class CertificateDatastoreSecrets(DatastoreSecrets): @@ -2956,25 +2938,22 @@ class CertificateDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'certificate': {'key': 'certificate', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "certificate": {"key": "certificate", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword certificate: Service principal certificate. :paramtype certificate: str """ super(CertificateDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Certificate' # type: str - self.certificate = kwargs.get('certificate', None) + self.secrets_type = "Certificate" # type: str + self.certificate = kwargs.get("certificate", None) class ClusterUpdateParameters(msrest.serialization.Model): @@ -2985,19 +2964,19 @@ class ClusterUpdateParameters(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties.properties', 'type': 'ScaleSettingsInformation'}, + "properties": { + "key": "properties.properties", + "type": "ScaleSettingsInformation", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of ClusterUpdate. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ScaleSettingsInformation """ super(ClusterUpdateParameters, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class CodeConfiguration(msrest.serialization.Model): @@ -3012,18 +2991,19 @@ class CodeConfiguration(msrest.serialization.Model): """ _validation = { - 'scoring_script': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "scoring_script": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'scoring_script': {'key': 'scoringScript', 'type': 'str'}, + "code_id": {"key": "codeId", "type": "str"}, + "scoring_script": {"key": "scoringScript", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword code_id: ARM resource ID of the code asset. :paramtype code_id: str @@ -3031,8 +3011,8 @@ def __init__( :paramtype scoring_script: str """ super(CodeConfiguration, self).__init__(**kwargs) - self.code_id = kwargs.get('code_id', None) - self.scoring_script = kwargs['scoring_script'] + self.code_id = kwargs.get("code_id", None) + self.scoring_script = kwargs["scoring_script"] class CodeContainerData(Resource): @@ -3058,31 +3038,28 @@ class CodeContainerData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeContainerDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "CodeContainerDetails"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeContainerDetails """ super(CodeContainerData, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class CodeContainerDetails(AssetContainer): @@ -3105,23 +3082,20 @@ class CodeContainerDetails(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -3146,14 +3120,11 @@ class CodeContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeContainerData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[CodeContainerData]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of CodeContainer objects. If null, there are no additional pages. @@ -3162,8 +3133,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.CodeContainerData] """ super(CodeContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class CodeVersionData(Resource): @@ -3189,31 +3160,28 @@ class CodeVersionData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeVersionDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "CodeVersionDetails"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeVersionDetails """ super(CodeVersionData, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class CodeVersionDetails(AssetBase): @@ -3234,18 +3202,15 @@ class CodeVersionDetails(AssetBase): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'code_uri': {'key': 'codeUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "code_uri": {"key": "codeUri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -3261,7 +3226,7 @@ def __init__( :paramtype code_uri: str """ super(CodeVersionDetails, self).__init__(**kwargs) - self.code_uri = kwargs.get('code_uri', None) + self.code_uri = kwargs.get("code_uri", None) class CodeVersionResourceArmPaginatedResult(msrest.serialization.Model): @@ -3275,14 +3240,11 @@ class CodeVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeVersionData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[CodeVersionData]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of CodeVersion objects. If null, there are no additional pages. @@ -3291,8 +3253,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.CodeVersionData] """ super(CodeVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class JobBaseDetails(ResourceBase): @@ -3337,32 +3299,33 @@ class JobBaseDetails(ResourceBase): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, + "job_type": {"required": True}, + "status": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, } _subtype_map = { - 'job_type': {'Command': 'CommandJob', 'Pipeline': 'PipelineJob', 'Sweep': 'SweepJob'} + "job_type": { + "Command": "CommandJob", + "Pipeline": "PipelineJob", + "Sweep": "SweepJob", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -3388,13 +3351,13 @@ def __init__( :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] """ super(JobBaseDetails, self).__init__(**kwargs) - self.compute_id = kwargs.get('compute_id', None) - self.display_name = kwargs.get('display_name', None) - self.experiment_name = kwargs.get('experiment_name', "Default") - self.identity = kwargs.get('identity', None) - self.is_archived = kwargs.get('is_archived', False) - self.job_type = 'JobBaseDetails' # type: str - self.services = kwargs.get('services', None) + self.compute_id = kwargs.get("compute_id", None) + self.display_name = kwargs.get("display_name", None) + self.experiment_name = kwargs.get("experiment_name", "Default") + self.identity = kwargs.get("identity", None) + self.is_archived = kwargs.get("is_archived", False) + self.job_type = "JobBaseDetails" # type: str + self.services = kwargs.get("services", None) self.status = None @@ -3460,41 +3423,48 @@ class CommandJob(JobBaseDetails): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'parameters': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'CommandJobLimits'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, - 'resources': {'key': 'resources', 'type': 'ResourceConfiguration'}, - } - - def __init__( - self, - **kwargs - ): + "job_type": {"required": True}, + "status": {"readonly": True}, + "command": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "environment_id": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "parameters": {"readonly": True}, + } + + _attribute_map = { + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "code_id": {"key": "codeId", "type": "str"}, + "command": {"key": "command", "type": "str"}, + "distribution": { + "key": "distribution", + "type": "DistributionConfiguration", + }, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "limits": {"key": "limits", "type": "CommandJobLimits"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "parameters": {"key": "parameters", "type": "object"}, + "resources": {"key": "resources", "type": "ResourceConfiguration"}, + } + + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -3541,17 +3511,17 @@ def __init__( :paramtype resources: ~azure.mgmt.machinelearningservices.models.ResourceConfiguration """ super(CommandJob, self).__init__(**kwargs) - self.job_type = 'Command' # type: str - self.code_id = kwargs.get('code_id', None) - self.command = kwargs['command'] - self.distribution = kwargs.get('distribution', None) - self.environment_id = kwargs['environment_id'] - self.environment_variables = kwargs.get('environment_variables', None) - self.inputs = kwargs.get('inputs', None) - self.limits = kwargs.get('limits', None) - self.outputs = kwargs.get('outputs', None) + self.job_type = "Command" # type: str + self.code_id = kwargs.get("code_id", None) + self.command = kwargs["command"] + self.distribution = kwargs.get("distribution", None) + self.environment_id = kwargs["environment_id"] + self.environment_variables = kwargs.get("environment_variables", None) + self.inputs = kwargs.get("inputs", None) + self.limits = kwargs.get("limits", None) + self.outputs = kwargs.get("outputs", None) self.parameters = None - self.resources = kwargs.get('resources', None) + self.resources = kwargs.get("resources", None) class JobLimits(msrest.serialization.Model): @@ -3571,22 +3541,22 @@ class JobLimits(msrest.serialization.Model): """ _validation = { - 'job_limits_type': {'required': True}, + "job_limits_type": {"required": True}, } _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "job_limits_type": {"key": "jobLimitsType", "type": "str"}, + "timeout": {"key": "timeout", "type": "duration"}, } _subtype_map = { - 'job_limits_type': {'Command': 'CommandJobLimits', 'Sweep': 'SweepJobLimits'} + "job_limits_type": { + "Command": "CommandJobLimits", + "Sweep": "SweepJobLimits", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. Only supports duration with precision as low as Seconds. @@ -3594,7 +3564,7 @@ def __init__( """ super(JobLimits, self).__init__(**kwargs) self.job_limits_type = None # type: Optional[str] - self.timeout = kwargs.get('timeout', None) + self.timeout = kwargs.get("timeout", None) class CommandJobLimits(JobLimits): @@ -3611,25 +3581,22 @@ class CommandJobLimits(JobLimits): """ _validation = { - 'job_limits_type': {'required': True}, + "job_limits_type": {"required": True}, } _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "job_limits_type": {"key": "jobLimitsType", "type": "str"}, + "timeout": {"key": "timeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. Only supports duration with precision as low as Seconds. :paramtype timeout: ~datetime.timedelta """ super(CommandJobLimits, self).__init__(**kwargs) - self.job_limits_type = 'Command' # type: str + self.job_limits_type = "Command" # type: str class ComponentContainerData(Resource): @@ -3655,75 +3622,72 @@ class ComponentContainerData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentContainerDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "ComponentContainerDetails", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentContainerDetails """ super(ComponentContainerData, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class ComponentContainerDetails(AssetContainer): """Component container definition. -.. raw:: html + .. raw:: html - . + . - Variables are only populated by the server, and will be ignored when sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str + :ivar description: The asset description text. + :vartype description: str + :ivar properties: The asset property dictionary. + :vartype properties: dict[str, str] + :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + :ivar is_archived: Is the asset archived?. + :vartype is_archived: bool + :ivar latest_version: The latest version inside this container. + :vartype latest_version: str + :ivar next_version: The next auto incremental version. + :vartype next_version: str """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -3748,14 +3712,11 @@ class ComponentContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentContainerData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ComponentContainerData]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of ComponentContainer objects. If null, there are no additional pages. @@ -3763,9 +3724,11 @@ def __init__( :keyword value: An array of objects of type ComponentContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainerData] """ - super(ComponentContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(ComponentContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class ComponentVersionData(Resource): @@ -3791,31 +3754,28 @@ class ComponentVersionData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentVersionDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "ComponentVersionDetails"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentVersionDetails """ super(ComponentVersionData, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class ComponentVersionDetails(AssetBase): @@ -3832,10 +3792,10 @@ class ComponentVersionDetails(AssetBase): :ivar is_archived: Is the asset archived?. :vartype is_archived: bool :ivar component_spec: Defines Component definition details. - - + + .. raw:: html - + . @@ -3843,18 +3803,15 @@ class ComponentVersionDetails(AssetBase): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'component_spec': {'key': 'componentSpec', 'type': 'object'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "component_spec": {"key": "componentSpec", "type": "object"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -3867,17 +3824,17 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool :keyword component_spec: Defines Component definition details. - - + + .. raw:: html - + . :paramtype component_spec: any """ super(ComponentVersionDetails, self).__init__(**kwargs) - self.component_spec = kwargs.get('component_spec', None) + self.component_spec = kwargs.get("component_spec", None) class ComponentVersionResourceArmPaginatedResult(msrest.serialization.Model): @@ -3891,14 +3848,11 @@ class ComponentVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentVersionData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ComponentVersionData]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of ComponentVersion objects. If null, there are no additional pages. @@ -3906,9 +3860,11 @@ def __init__( :keyword value: An array of objects of type ComponentVersion. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersionData] """ - super(ComponentVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(ComponentVersionResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class ComputeInstanceSchema(msrest.serialization.Model): @@ -3919,19 +3875,19 @@ class ComputeInstanceSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, + "properties": { + "key": "properties", + "type": "ComputeInstanceProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of ComputeInstance. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties """ super(ComputeInstanceSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class ComputeInstance(Compute, ComputeInstanceSchema): @@ -3973,33 +3929,36 @@ class ComputeInstance(Compute, ComputeInstanceSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": { + "key": "properties", + "type": "ComputeInstanceProperties", + }, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of ComputeInstance. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties @@ -4012,18 +3971,18 @@ def __init__( :paramtype disable_local_auth: bool """ super(ComputeInstance, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'ComputeInstance' # type: str - self.compute_type = 'ComputeInstance' # type: str + self.properties = kwargs.get("properties", None) + self.compute_type = "ComputeInstance" # type: str + self.compute_type = "ComputeInstance" # type: str self.compute_location = None self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) + self.disable_local_auth = kwargs.get("disable_local_auth", None) class ComputeInstanceApplication(msrest.serialization.Model): @@ -4036,14 +3995,11 @@ class ComputeInstanceApplication(msrest.serialization.Model): """ _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, + "display_name": {"key": "displayName", "type": "str"}, + "endpoint_uri": {"key": "endpointUri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword display_name: Name of the ComputeInstance application. :paramtype display_name: str @@ -4051,8 +4007,8 @@ def __init__( :paramtype endpoint_uri: str """ super(ComputeInstanceApplication, self).__init__(**kwargs) - self.display_name = kwargs.get('display_name', None) - self.endpoint_uri = kwargs.get('endpoint_uri', None) + self.display_name = kwargs.get("display_name", None) + self.endpoint_uri = kwargs.get("endpoint_uri", None) class ComputeInstanceConnectivityEndpoints(msrest.serialization.Model): @@ -4068,21 +4024,17 @@ class ComputeInstanceConnectivityEndpoints(msrest.serialization.Model): """ _validation = { - 'public_ip_address': {'readonly': True}, - 'private_ip_address': {'readonly': True}, + "public_ip_address": {"readonly": True}, + "private_ip_address": {"readonly": True}, } _attribute_map = { - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + "public_ip_address": {"key": "publicIpAddress", "type": "str"}, + "private_ip_address": {"key": "privateIpAddress", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ComputeInstanceConnectivityEndpoints, self).__init__(**kwargs) self.public_ip_address = None self.private_ip_address = None @@ -4108,22 +4060,22 @@ class ComputeInstanceContainer(msrest.serialization.Model): """ _validation = { - 'services': {'readonly': True}, + "services": {"readonly": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'autosave': {'key': 'autosave', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'network': {'key': 'network', 'type': 'str'}, - 'environment': {'key': 'environment', 'type': 'ComputeInstanceEnvironmentInfo'}, - 'services': {'key': 'services', 'type': '[object]'}, + "name": {"key": "name", "type": "str"}, + "autosave": {"key": "autosave", "type": "str"}, + "gpu": {"key": "gpu", "type": "str"}, + "network": {"key": "network", "type": "str"}, + "environment": { + "key": "environment", + "type": "ComputeInstanceEnvironmentInfo", + }, + "services": {"key": "services", "type": "[object]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: Name of the ComputeInstance container. :paramtype name: str @@ -4138,11 +4090,11 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ComputeInstanceEnvironmentInfo """ super(ComputeInstanceContainer, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.autosave = kwargs.get('autosave', None) - self.gpu = kwargs.get('gpu', None) - self.network = kwargs.get('network', None) - self.environment = kwargs.get('environment', None) + self.name = kwargs.get("name", None) + self.autosave = kwargs.get("autosave", None) + self.gpu = kwargs.get("gpu", None) + self.network = kwargs.get("network", None) + self.environment = kwargs.get("environment", None) self.services = None @@ -4160,23 +4112,19 @@ class ComputeInstanceCreatedBy(msrest.serialization.Model): """ _validation = { - 'user_name': {'readonly': True}, - 'user_org_id': {'readonly': True}, - 'user_id': {'readonly': True}, + "user_name": {"readonly": True}, + "user_org_id": {"readonly": True}, + "user_id": {"readonly": True}, } _attribute_map = { - 'user_name': {'key': 'userName', 'type': 'str'}, - 'user_org_id': {'key': 'userOrgId', 'type': 'str'}, - 'user_id': {'key': 'userId', 'type': 'str'}, + "user_name": {"key": "userName", "type": "str"}, + "user_org_id": {"key": "userOrgId", "type": "str"}, + "user_id": {"key": "userId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ComputeInstanceCreatedBy, self).__init__(**kwargs) self.user_name = None self.user_org_id = None @@ -4201,16 +4149,13 @@ class ComputeInstanceDataDisk(msrest.serialization.Model): """ _attribute_map = { - 'caching': {'key': 'caching', 'type': 'str'}, - 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, - 'lun': {'key': 'lun', 'type': 'int'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + "caching": {"key": "caching", "type": "str"}, + "disk_size_gb": {"key": "diskSizeGB", "type": "int"}, + "lun": {"key": "lun", "type": "int"}, + "storage_account_type": {"key": "storageAccountType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword caching: Caching type of Data Disk. Possible values include: "None", "ReadOnly", "ReadWrite". @@ -4226,10 +4171,12 @@ def __init__( ~azure.mgmt.machinelearningservices.models.StorageAccountType """ super(ComputeInstanceDataDisk, self).__init__(**kwargs) - self.caching = kwargs.get('caching', None) - self.disk_size_gb = kwargs.get('disk_size_gb', None) - self.lun = kwargs.get('lun', None) - self.storage_account_type = kwargs.get('storage_account_type', "Standard_LRS") + self.caching = kwargs.get("caching", None) + self.disk_size_gb = kwargs.get("disk_size_gb", None) + self.lun = kwargs.get("lun", None) + self.storage_account_type = kwargs.get( + "storage_account_type", "Standard_LRS" + ) class ComputeInstanceDataMount(msrest.serialization.Model): @@ -4257,21 +4204,18 @@ class ComputeInstanceDataMount(msrest.serialization.Model): """ _attribute_map = { - 'source': {'key': 'source', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'mount_name': {'key': 'mountName', 'type': 'str'}, - 'mount_action': {'key': 'mountAction', 'type': 'str'}, - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - 'mount_state': {'key': 'mountState', 'type': 'str'}, - 'mounted_on': {'key': 'mountedOn', 'type': 'iso-8601'}, - 'error': {'key': 'error', 'type': 'str'}, + "source": {"key": "source", "type": "str"}, + "source_type": {"key": "sourceType", "type": "str"}, + "mount_name": {"key": "mountName", "type": "str"}, + "mount_action": {"key": "mountAction", "type": "str"}, + "created_by": {"key": "createdBy", "type": "str"}, + "mount_path": {"key": "mountPath", "type": "str"}, + "mount_state": {"key": "mountState", "type": "str"}, + "mounted_on": {"key": "mountedOn", "type": "iso-8601"}, + "error": {"key": "error", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword source: Source of the ComputeInstance data mount. :paramtype source: str @@ -4294,15 +4238,15 @@ def __init__( :paramtype error: str """ super(ComputeInstanceDataMount, self).__init__(**kwargs) - self.source = kwargs.get('source', None) - self.source_type = kwargs.get('source_type', None) - self.mount_name = kwargs.get('mount_name', None) - self.mount_action = kwargs.get('mount_action', None) - self.created_by = kwargs.get('created_by', None) - self.mount_path = kwargs.get('mount_path', None) - self.mount_state = kwargs.get('mount_state', None) - self.mounted_on = kwargs.get('mounted_on', None) - self.error = kwargs.get('error', None) + self.source = kwargs.get("source", None) + self.source_type = kwargs.get("source_type", None) + self.mount_name = kwargs.get("mount_name", None) + self.mount_action = kwargs.get("mount_action", None) + self.created_by = kwargs.get("created_by", None) + self.mount_path = kwargs.get("mount_path", None) + self.mount_state = kwargs.get("mount_state", None) + self.mounted_on = kwargs.get("mounted_on", None) + self.error = kwargs.get("error", None) class ComputeInstanceEnvironmentInfo(msrest.serialization.Model): @@ -4315,14 +4259,11 @@ class ComputeInstanceEnvironmentInfo(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "version": {"key": "version", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: name of environment. :paramtype name: str @@ -4330,8 +4271,8 @@ def __init__( :paramtype version: str """ super(ComputeInstanceEnvironmentInfo, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.version = kwargs.get('version', None) + self.name = kwargs.get("name", None) + self.version = kwargs.get("version", None) class ComputeInstanceLastOperation(msrest.serialization.Model): @@ -4351,16 +4292,13 @@ class ComputeInstanceLastOperation(msrest.serialization.Model): """ _attribute_map = { - 'operation_name': {'key': 'operationName', 'type': 'str'}, - 'operation_time': {'key': 'operationTime', 'type': 'iso-8601'}, - 'operation_status': {'key': 'operationStatus', 'type': 'str'}, - 'operation_trigger': {'key': 'operationTrigger', 'type': 'str'}, + "operation_name": {"key": "operationName", "type": "str"}, + "operation_time": {"key": "operationTime", "type": "iso-8601"}, + "operation_status": {"key": "operationStatus", "type": "str"}, + "operation_trigger": {"key": "operationTrigger", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword operation_name: Name of the last operation. Possible values include: "Create", "Start", "Stop", "Restart", "Reimage", "Delete". @@ -4377,10 +4315,10 @@ def __init__( ~azure.mgmt.machinelearningservices.models.OperationTrigger """ super(ComputeInstanceLastOperation, self).__init__(**kwargs) - self.operation_name = kwargs.get('operation_name', None) - self.operation_time = kwargs.get('operation_time', None) - self.operation_status = kwargs.get('operation_status', None) - self.operation_trigger = kwargs.get('operation_trigger', None) + self.operation_name = kwargs.get("operation_name", None) + self.operation_time = kwargs.get("operation_time", None) + self.operation_status = kwargs.get("operation_status", None) + self.operation_trigger = kwargs.get("operation_trigger", None) class ComputeInstanceProperties(msrest.serialization.Model): @@ -4447,45 +4385,72 @@ class ComputeInstanceProperties(msrest.serialization.Model): """ _validation = { - 'connectivity_endpoints': {'readonly': True}, - 'applications': {'readonly': True}, - 'created_by': {'readonly': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'last_operation': {'readonly': True}, - 'schedules': {'readonly': True}, - 'containers': {'readonly': True}, - 'data_disks': {'readonly': True}, - 'data_mounts': {'readonly': True}, - 'versions': {'readonly': True}, - } - - _attribute_map = { - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'application_sharing_policy': {'key': 'applicationSharingPolicy', 'type': 'str'}, - 'ssh_settings': {'key': 'sshSettings', 'type': 'ComputeInstanceSshSettings'}, - 'connectivity_endpoints': {'key': 'connectivityEndpoints', 'type': 'ComputeInstanceConnectivityEndpoints'}, - 'applications': {'key': 'applications', 'type': '[ComputeInstanceApplication]'}, - 'created_by': {'key': 'createdBy', 'type': 'ComputeInstanceCreatedBy'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'compute_instance_authorization_type': {'key': 'computeInstanceAuthorizationType', 'type': 'str'}, - 'personal_compute_instance_settings': {'key': 'personalComputeInstanceSettings', 'type': 'PersonalComputeInstanceSettings'}, - 'setup_scripts': {'key': 'setupScripts', 'type': 'SetupScripts'}, - 'last_operation': {'key': 'lastOperation', 'type': 'ComputeInstanceLastOperation'}, - 'schedules': {'key': 'schedules', 'type': 'ComputeSchedules'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'containers': {'key': 'containers', 'type': '[ComputeInstanceContainer]'}, - 'data_disks': {'key': 'dataDisks', 'type': '[ComputeInstanceDataDisk]'}, - 'data_mounts': {'key': 'dataMounts', 'type': '[ComputeInstanceDataMount]'}, - 'versions': {'key': 'versions', 'type': 'ComputeInstanceVersion'}, - } - - def __init__( - self, - **kwargs - ): + "connectivity_endpoints": {"readonly": True}, + "applications": {"readonly": True}, + "created_by": {"readonly": True}, + "errors": {"readonly": True}, + "state": {"readonly": True}, + "last_operation": {"readonly": True}, + "schedules": {"readonly": True}, + "containers": {"readonly": True}, + "data_disks": {"readonly": True}, + "data_mounts": {"readonly": True}, + "versions": {"readonly": True}, + } + + _attribute_map = { + "vm_size": {"key": "vmSize", "type": "str"}, + "subnet": {"key": "subnet", "type": "ResourceId"}, + "application_sharing_policy": { + "key": "applicationSharingPolicy", + "type": "str", + }, + "ssh_settings": { + "key": "sshSettings", + "type": "ComputeInstanceSshSettings", + }, + "connectivity_endpoints": { + "key": "connectivityEndpoints", + "type": "ComputeInstanceConnectivityEndpoints", + }, + "applications": { + "key": "applications", + "type": "[ComputeInstanceApplication]", + }, + "created_by": {"key": "createdBy", "type": "ComputeInstanceCreatedBy"}, + "errors": {"key": "errors", "type": "[ErrorResponse]"}, + "state": {"key": "state", "type": "str"}, + "compute_instance_authorization_type": { + "key": "computeInstanceAuthorizationType", + "type": "str", + }, + "personal_compute_instance_settings": { + "key": "personalComputeInstanceSettings", + "type": "PersonalComputeInstanceSettings", + }, + "setup_scripts": {"key": "setupScripts", "type": "SetupScripts"}, + "last_operation": { + "key": "lastOperation", + "type": "ComputeInstanceLastOperation", + }, + "schedules": {"key": "schedules", "type": "ComputeSchedules"}, + "enable_node_public_ip": {"key": "enableNodePublicIp", "type": "bool"}, + "containers": { + "key": "containers", + "type": "[ComputeInstanceContainer]", + }, + "data_disks": { + "key": "dataDisks", + "type": "[ComputeInstanceDataDisk]", + }, + "data_mounts": { + "key": "dataMounts", + "type": "[ComputeInstanceDataMount]", + }, + "versions": {"key": "versions", "type": "ComputeInstanceVersion"}, + } + + def __init__(self, **kwargs): """ :keyword vm_size: Virtual Machine Size. :paramtype vm_size: str @@ -4517,21 +4482,27 @@ def __init__( :paramtype enable_node_public_ip: bool """ super(ComputeInstanceProperties, self).__init__(**kwargs) - self.vm_size = kwargs.get('vm_size', None) - self.subnet = kwargs.get('subnet', None) - self.application_sharing_policy = kwargs.get('application_sharing_policy', "Shared") - self.ssh_settings = kwargs.get('ssh_settings', None) + self.vm_size = kwargs.get("vm_size", None) + self.subnet = kwargs.get("subnet", None) + self.application_sharing_policy = kwargs.get( + "application_sharing_policy", "Shared" + ) + self.ssh_settings = kwargs.get("ssh_settings", None) self.connectivity_endpoints = None self.applications = None self.created_by = None self.errors = None self.state = None - self.compute_instance_authorization_type = kwargs.get('compute_instance_authorization_type', "personal") - self.personal_compute_instance_settings = kwargs.get('personal_compute_instance_settings', None) - self.setup_scripts = kwargs.get('setup_scripts', None) + self.compute_instance_authorization_type = kwargs.get( + "compute_instance_authorization_type", "personal" + ) + self.personal_compute_instance_settings = kwargs.get( + "personal_compute_instance_settings", None + ) + self.setup_scripts = kwargs.get("setup_scripts", None) self.last_operation = None self.schedules = None - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) + self.enable_node_public_ip = kwargs.get("enable_node_public_ip", None) self.containers = None self.data_disks = None self.data_mounts = None @@ -4558,21 +4529,18 @@ class ComputeInstanceSshSettings(msrest.serialization.Model): """ _validation = { - 'admin_user_name': {'readonly': True}, - 'ssh_port': {'readonly': True}, + "admin_user_name": {"readonly": True}, + "ssh_port": {"readonly": True}, } _attribute_map = { - 'ssh_public_access': {'key': 'sshPublicAccess', 'type': 'str'}, - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'admin_public_key': {'key': 'adminPublicKey', 'type': 'str'}, + "ssh_public_access": {"key": "sshPublicAccess", "type": "str"}, + "admin_user_name": {"key": "adminUserName", "type": "str"}, + "ssh_port": {"key": "sshPort", "type": "int"}, + "admin_public_key": {"key": "adminPublicKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword ssh_public_access: State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the @@ -4584,10 +4552,10 @@ def __init__( :paramtype admin_public_key: str """ super(ComputeInstanceSshSettings, self).__init__(**kwargs) - self.ssh_public_access = kwargs.get('ssh_public_access', "Disabled") + self.ssh_public_access = kwargs.get("ssh_public_access", "Disabled") self.admin_user_name = None self.ssh_port = None - self.admin_public_key = kwargs.get('admin_public_key', None) + self.admin_public_key = kwargs.get("admin_public_key", None) class ComputeInstanceVersion(msrest.serialization.Model): @@ -4598,19 +4566,16 @@ class ComputeInstanceVersion(msrest.serialization.Model): """ _attribute_map = { - 'runtime': {'key': 'runtime', 'type': 'str'}, + "runtime": {"key": "runtime", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword runtime: Runtime of compute instance. :paramtype runtime: str """ super(ComputeInstanceVersion, self).__init__(**kwargs) - self.runtime = kwargs.get('runtime', None) + self.runtime = kwargs.get("runtime", None) class ComputeResourceSchema(msrest.serialization.Model): @@ -4621,19 +4586,16 @@ class ComputeResourceSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, + "properties": {"key": "properties", "type": "Compute"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Compute properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute """ super(ComputeResourceSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class ComputeResource(Resource, ComputeResourceSchema): @@ -4665,28 +4627,25 @@ class ComputeResource(Resource, ComputeResourceSchema): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "properties": {"key": "properties", "type": "Compute"}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Compute properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute @@ -4700,19 +4659,19 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ super(ComputeResource, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) + self.properties = kwargs.get("properties", None) + self.identity = kwargs.get("identity", None) + self.location = kwargs.get("location", None) + self.tags = kwargs.get("tags", None) + self.sku = kwargs.get("sku", None) self.id = None self.name = None self.type = None self.system_data = None - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) + self.identity = kwargs.get("identity", None) + self.location = kwargs.get("location", None) + self.tags = kwargs.get("tags", None) + self.sku = kwargs.get("sku", None) class ComputeSchedules(msrest.serialization.Model): @@ -4724,20 +4683,20 @@ class ComputeSchedules(msrest.serialization.Model): """ _attribute_map = { - 'compute_start_stop': {'key': 'computeStartStop', 'type': '[ComputeStartStopSchedule]'}, + "compute_start_stop": { + "key": "computeStartStop", + "type": "[ComputeStartStopSchedule]", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword compute_start_stop: The list of compute start stop schedules to be applied. :paramtype compute_start_stop: list[~azure.mgmt.machinelearningservices.models.ComputeStartStopSchedule] """ super(ComputeSchedules, self).__init__(**kwargs) - self.compute_start_stop = kwargs.get('compute_start_stop', None) + self.compute_start_stop = kwargs.get("compute_start_stop", None) class ComputeStartStopSchedule(msrest.serialization.Model): @@ -4758,21 +4717,18 @@ class ComputeStartStopSchedule(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'provisioning_status': {'readonly': True}, + "id": {"readonly": True}, + "provisioning_status": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'ScheduleBase'}, + "id": {"key": "id", "type": "str"}, + "provisioning_status": {"key": "provisioningStatus", "type": "str"}, + "action": {"key": "action", "type": "str"}, + "schedule": {"key": "schedule", "type": "ScheduleBase"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword action: The compute power action. Possible values include: "Start", "Stop". :paramtype action: str or ~azure.mgmt.machinelearningservices.models.ComputePowerAction @@ -4782,8 +4738,8 @@ def __init__( super(ComputeStartStopSchedule, self).__init__(**kwargs) self.id = None self.provisioning_status = None - self.action = kwargs.get('action', None) - self.schedule = kwargs.get('schedule', None) + self.action = kwargs.get("action", None) + self.schedule = kwargs.get("schedule", None) class ContainerResourceRequirements(msrest.serialization.Model): @@ -4798,14 +4754,17 @@ class ContainerResourceRequirements(msrest.serialization.Model): """ _attribute_map = { - 'container_resource_limits': {'key': 'containerResourceLimits', 'type': 'ContainerResourceSettings'}, - 'container_resource_requests': {'key': 'containerResourceRequests', 'type': 'ContainerResourceSettings'}, + "container_resource_limits": { + "key": "containerResourceLimits", + "type": "ContainerResourceSettings", + }, + "container_resource_requests": { + "key": "containerResourceRequests", + "type": "ContainerResourceSettings", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword container_resource_limits: Container resource limit info:. :paramtype container_resource_limits: @@ -4815,8 +4774,12 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings """ super(ContainerResourceRequirements, self).__init__(**kwargs) - self.container_resource_limits = kwargs.get('container_resource_limits', None) - self.container_resource_requests = kwargs.get('container_resource_requests', None) + self.container_resource_limits = kwargs.get( + "container_resource_limits", None + ) + self.container_resource_requests = kwargs.get( + "container_resource_requests", None + ) class ContainerResourceSettings(msrest.serialization.Model): @@ -4834,15 +4797,12 @@ class ContainerResourceSettings(msrest.serialization.Model): """ _attribute_map = { - 'cpu': {'key': 'cpu', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'memory': {'key': 'memory', 'type': 'str'}, + "cpu": {"key": "cpu", "type": "str"}, + "gpu": {"key": "gpu", "type": "str"}, + "memory": {"key": "memory", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword cpu: Number of vCPUs request/limit for container. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. @@ -4855,9 +4815,9 @@ def __init__( :paramtype memory: str """ super(ContainerResourceSettings, self).__init__(**kwargs) - self.cpu = kwargs.get('cpu', None) - self.gpu = kwargs.get('gpu', None) - self.memory = kwargs.get('memory', None) + self.cpu = kwargs.get("cpu", None) + self.gpu = kwargs.get("gpu", None) + self.memory = kwargs.get("memory", None) class CosmosDbSettings(msrest.serialization.Model): @@ -4868,19 +4828,21 @@ class CosmosDbSettings(msrest.serialization.Model): """ _attribute_map = { - 'collections_throughput': {'key': 'collectionsThroughput', 'type': 'int'}, + "collections_throughput": { + "key": "collectionsThroughput", + "type": "int", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword collections_throughput: The throughput of the collections in cosmosdb database. :paramtype collections_throughput: int """ super(CosmosDbSettings, self).__init__(**kwargs) - self.collections_throughput = kwargs.get('collections_throughput', None) + self.collections_throughput = kwargs.get( + "collections_throughput", None + ) class ScheduleBase(msrest.serialization.Model): @@ -4908,25 +4870,25 @@ class ScheduleBase(msrest.serialization.Model): """ _validation = { - 'schedule_type': {'required': True}, + "schedule_type": {"required": True}, } _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'schedule_status': {'key': 'scheduleStatus', 'type': 'str'}, - 'schedule_type': {'key': 'scheduleType', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, + "end_time": {"key": "endTime", "type": "iso-8601"}, + "schedule_status": {"key": "scheduleStatus", "type": "str"}, + "schedule_type": {"key": "scheduleType", "type": "str"}, + "start_time": {"key": "startTime", "type": "iso-8601"}, + "time_zone": {"key": "timeZone", "type": "str"}, } _subtype_map = { - 'schedule_type': {'Cron': 'CronSchedule', 'Recurrence': 'RecurrenceSchedule'} + "schedule_type": { + "Cron": "CronSchedule", + "Recurrence": "RecurrenceSchedule", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword end_time: Specifies end time of schedule in ISO 8601 format. If not present, the schedule will run indefinitely. @@ -4941,11 +4903,11 @@ def __init__( :paramtype time_zone: str """ super(ScheduleBase, self).__init__(**kwargs) - self.end_time = kwargs.get('end_time', None) - self.schedule_status = kwargs.get('schedule_status', None) + self.end_time = kwargs.get("end_time", None) + self.schedule_status = kwargs.get("schedule_status", None) self.schedule_type = None # type: Optional[str] - self.start_time = kwargs.get('start_time', None) - self.time_zone = kwargs.get('time_zone', "UTC") + self.start_time = kwargs.get("start_time", None) + self.time_zone = kwargs.get("time_zone", "UTC") class CronSchedule(ScheduleBase): @@ -4973,23 +4935,20 @@ class CronSchedule(ScheduleBase): """ _validation = { - 'schedule_type': {'required': True}, - 'expression': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "schedule_type": {"required": True}, + "expression": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'schedule_status': {'key': 'scheduleStatus', 'type': 'str'}, - 'schedule_type': {'key': 'scheduleType', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, + "end_time": {"key": "endTime", "type": "iso-8601"}, + "schedule_status": {"key": "scheduleStatus", "type": "str"}, + "schedule_type": {"key": "scheduleType", "type": "str"}, + "start_time": {"key": "startTime", "type": "iso-8601"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "expression": {"key": "expression", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword end_time: Specifies end time of schedule in ISO 8601 format. If not present, the schedule will run indefinitely. @@ -5007,8 +4966,8 @@ def __init__( :paramtype expression: str """ super(CronSchedule, self).__init__(**kwargs) - self.schedule_type = 'Cron' # type: str - self.expression = kwargs['expression'] + self.schedule_type = "Cron" # type: str + self.expression = kwargs["expression"] class JobInput(msrest.serialization.Model): @@ -5028,28 +4987,33 @@ class JobInput(msrest.serialization.Model): """ _validation = { - 'job_input_type': {'required': True}, + "job_input_type": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } _subtype_map = { - 'job_input_type': {'custom_model': 'CustomModelJobInput', 'literal': 'LiteralJobInput', 'mlflow_model': 'MLFlowModelJobInput', 'mltable': 'MLTableJobInput', 'triton_model': 'TritonModelJobInput', 'uri_file': 'UriFileJobInput', 'uri_folder': 'UriFolderJobInput'} + "job_input_type": { + "custom_model": "CustomModelJobInput", + "literal": "LiteralJobInput", + "mlflow_model": "MLFlowModelJobInput", + "mltable": "MLTableJobInput", + "triton_model": "TritonModelJobInput", + "uri_file": "UriFileJobInput", + "uri_folder": "UriFolderJobInput", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: Description for the input. :paramtype description: str """ super(JobInput, self).__init__(**kwargs) - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.job_input_type = None # type: Optional[str] @@ -5072,21 +5036,18 @@ class CustomModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -5097,11 +5058,11 @@ def __init__( :paramtype description: str """ super(CustomModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'custom_model' # type: str - self.description = kwargs.get('description', None) - self.job_input_type = 'custom_model' # type: str + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "custom_model" # type: str + self.description = kwargs.get("description", None) + self.job_input_type = "custom_model" # type: str class JobOutput(msrest.serialization.Model): @@ -5121,28 +5082,32 @@ class JobOutput(msrest.serialization.Model): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } _subtype_map = { - 'job_output_type': {'custom_model': 'CustomModelJobOutput', 'mlflow_model': 'MLFlowModelJobOutput', 'mltable': 'MLTableJobOutput', 'triton_model': 'TritonModelJobOutput', 'uri_file': 'UriFileJobOutput', 'uri_folder': 'UriFolderJobOutput'} + "job_output_type": { + "custom_model": "CustomModelJobOutput", + "mlflow_model": "MLFlowModelJobOutput", + "mltable": "MLTableJobOutput", + "triton_model": "TritonModelJobOutput", + "uri_file": "UriFileJobOutput", + "uri_folder": "UriFolderJobOutput", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: Description for the output. :paramtype description: str """ super(JobOutput, self).__init__(**kwargs) - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.job_output_type = None # type: Optional[str] @@ -5164,20 +5129,17 @@ class CustomModelJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -5187,11 +5149,11 @@ def __init__( :paramtype description: str """ super(CustomModelJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'custom_model' # type: str - self.description = kwargs.get('description', None) - self.job_output_type = 'custom_model' # type: str + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "custom_model" # type: str + self.description = kwargs.get("description", None) + self.job_output_type = "custom_model" # type: str class DatabricksSchema(msrest.serialization.Model): @@ -5202,19 +5164,16 @@ class DatabricksSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, + "properties": {"key": "properties", "type": "DatabricksProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of Databricks. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties """ super(DatabricksSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class Databricks(Compute, DatabricksSchema): @@ -5256,33 +5215,33 @@ class Databricks(Compute, DatabricksSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "DatabricksProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of Databricks. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties @@ -5295,18 +5254,18 @@ def __init__( :paramtype disable_local_auth: bool """ super(Databricks, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'Databricks' # type: str - self.compute_type = 'Databricks' # type: str + self.properties = kwargs.get("properties", None) + self.compute_type = "Databricks" # type: str + self.compute_type = "Databricks" # type: str self.compute_location = None self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) + self.disable_local_auth = kwargs.get("disable_local_auth", None) class DatabricksComputeSecretsProperties(msrest.serialization.Model): @@ -5317,22 +5276,26 @@ class DatabricksComputeSecretsProperties(msrest.serialization.Model): """ _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword databricks_access_token: access token for databricks account. :paramtype databricks_access_token: str """ super(DatabricksComputeSecretsProperties, self).__init__(**kwargs) - self.databricks_access_token = kwargs.get('databricks_access_token', None) + self.databricks_access_token = kwargs.get( + "databricks_access_token", None + ) -class DatabricksComputeSecrets(ComputeSecrets, DatabricksComputeSecretsProperties): +class DatabricksComputeSecrets( + ComputeSecrets, DatabricksComputeSecretsProperties +): """Secrets related to a Machine Learning compute based on Databricks. All required parameters must be populated in order to send to Azure. @@ -5346,26 +5309,28 @@ class DatabricksComputeSecrets(ComputeSecrets, DatabricksComputeSecretsPropertie """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, + "compute_type": {"key": "computeType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword databricks_access_token: access token for databricks account. :paramtype databricks_access_token: str """ super(DatabricksComputeSecrets, self).__init__(**kwargs) - self.databricks_access_token = kwargs.get('databricks_access_token', None) - self.compute_type = 'Databricks' # type: str - self.compute_type = 'Databricks' # type: str + self.databricks_access_token = kwargs.get( + "databricks_access_token", None + ) + self.compute_type = "Databricks" # type: str + self.compute_type = "Databricks" # type: str class DatabricksProperties(msrest.serialization.Model): @@ -5378,14 +5343,14 @@ class DatabricksProperties(msrest.serialization.Model): """ _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'workspace_url': {'key': 'workspaceUrl', 'type': 'str'}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, + "workspace_url": {"key": "workspaceUrl", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword databricks_access_token: Databricks access token. :paramtype databricks_access_token: str @@ -5393,8 +5358,10 @@ def __init__( :paramtype workspace_url: str """ super(DatabricksProperties, self).__init__(**kwargs) - self.databricks_access_token = kwargs.get('databricks_access_token', None) - self.workspace_url = kwargs.get('workspace_url', None) + self.databricks_access_token = kwargs.get( + "databricks_access_token", None + ) + self.workspace_url = kwargs.get("workspace_url", None) class DataContainerData(Resource): @@ -5420,31 +5387,28 @@ class DataContainerData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataContainerDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "DataContainerDetails"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataContainerDetails """ super(DataContainerData, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class DataContainerDetails(AssetContainer): @@ -5472,25 +5436,22 @@ class DataContainerDetails(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'data_type': {'required': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "data_type": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "data_type": {"key": "dataType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -5505,7 +5466,7 @@ def __init__( :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType """ super(DataContainerDetails, self).__init__(**kwargs) - self.data_type = kwargs['data_type'] + self.data_type = kwargs["data_type"] class DataContainerResourceArmPaginatedResult(msrest.serialization.Model): @@ -5519,14 +5480,11 @@ class DataContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataContainerData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[DataContainerData]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of DataContainer objects. If null, there are no additional pages. @@ -5535,8 +5493,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataContainerData] """ super(DataContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class DataFactory(Compute): @@ -5576,32 +5534,32 @@ class DataFactory(Compute): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The description of the Machine Learning compute. :paramtype description: str @@ -5612,7 +5570,7 @@ def __init__( :paramtype disable_local_auth: bool """ super(DataFactory, self).__init__(**kwargs) - self.compute_type = 'DataFactory' # type: str + self.compute_type = "DataFactory" # type: str class DataLakeAnalyticsSchema(msrest.serialization.Model): @@ -5624,20 +5582,20 @@ class DataLakeAnalyticsSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, + "properties": { + "key": "properties", + "type": "DataLakeAnalyticsSchemaProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties """ super(DataLakeAnalyticsSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class DataLakeAnalytics(Compute, DataLakeAnalyticsSchema): @@ -5680,33 +5638,36 @@ class DataLakeAnalytics(Compute, DataLakeAnalyticsSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": { + "key": "properties", + "type": "DataLakeAnalyticsSchemaProperties", + }, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: :paramtype properties: @@ -5720,18 +5681,18 @@ def __init__( :paramtype disable_local_auth: bool """ super(DataLakeAnalytics, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'DataLakeAnalytics' # type: str - self.compute_type = 'DataLakeAnalytics' # type: str + self.properties = kwargs.get("properties", None) + self.compute_type = "DataLakeAnalytics" # type: str + self.compute_type = "DataLakeAnalytics" # type: str self.compute_location = None self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) + self.disable_local_auth = kwargs.get("disable_local_auth", None) class DataLakeAnalyticsSchemaProperties(msrest.serialization.Model): @@ -5742,19 +5703,21 @@ class DataLakeAnalyticsSchemaProperties(msrest.serialization.Model): """ _attribute_map = { - 'data_lake_store_account_name': {'key': 'dataLakeStoreAccountName', 'type': 'str'}, + "data_lake_store_account_name": { + "key": "dataLakeStoreAccountName", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data_lake_store_account_name: DataLake Store Account Name. :paramtype data_lake_store_account_name: str """ super(DataLakeAnalyticsSchemaProperties, self).__init__(**kwargs) - self.data_lake_store_account_name = kwargs.get('data_lake_store_account_name', None) + self.data_lake_store_account_name = kwargs.get( + "data_lake_store_account_name", None + ) class DataPathAssetReference(AssetReferenceBase): @@ -5772,19 +5735,16 @@ class DataPathAssetReference(AssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'datastore_id': {'key': 'datastoreId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "datastore_id": {"key": "datastoreId", "type": "str"}, + "path": {"key": "path", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword datastore_id: ARM resource ID of the datastore where the asset is located. :paramtype datastore_id: str @@ -5792,9 +5752,9 @@ def __init__( :paramtype path: str """ super(DataPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'DataPath' # type: str - self.datastore_id = kwargs.get('datastore_id', None) - self.path = kwargs.get('path', None) + self.reference_type = "DataPath" # type: str + self.datastore_id = kwargs.get("datastore_id", None) + self.path = kwargs.get("path", None) class DatastoreData(Resource): @@ -5820,31 +5780,28 @@ class DatastoreData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DatastoreDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "DatastoreDetails"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatastoreDetails """ super(DatastoreData, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class DatastoreResourceArmPaginatedResult(msrest.serialization.Model): @@ -5858,14 +5815,11 @@ class DatastoreResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DatastoreData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[DatastoreData]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of Datastore objects. If null, there are no additional pages. @@ -5874,8 +5828,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.DatastoreData] """ super(DatastoreResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class DataVersionBaseData(Resource): @@ -5901,31 +5855,28 @@ class DataVersionBaseData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataVersionBaseDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "DataVersionBaseDetails"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataVersionBaseDetails """ super(DataVersionBaseData, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class DataVersionBaseDetails(AssetBase): @@ -5955,28 +5906,29 @@ class DataVersionBaseDetails(AssetBase): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, } _subtype_map = { - 'data_type': {'mltable': 'MLTableData', 'uri_file': 'UriFileDataVersion', 'uri_folder': 'UriFolderDataVersion'} + "data_type": { + "mltable": "MLTableData", + "uri_file": "UriFileDataVersion", + "uri_folder": "UriFolderDataVersion", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -5993,8 +5945,8 @@ def __init__( :paramtype data_uri: str """ super(DataVersionBaseDetails, self).__init__(**kwargs) - self.data_type = 'DataVersionBaseDetails' # type: str - self.data_uri = kwargs['data_uri'] + self.data_type = "DataVersionBaseDetails" # type: str + self.data_uri = kwargs["data_uri"] class DataVersionBaseResourceArmPaginatedResult(msrest.serialization.Model): @@ -6008,14 +5960,11 @@ class DataVersionBaseResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataVersionBaseData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[DataVersionBaseData]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of DataVersionBase objects. If null, there are no additional pages. @@ -6023,9 +5972,11 @@ def __init__( :keyword value: An array of objects of type DataVersionBase. :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBaseData] """ - super(DataVersionBaseResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(DataVersionBaseResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class OnlineScaleSettings(msrest.serialization.Model): @@ -6042,23 +5993,22 @@ class OnlineScaleSettings(msrest.serialization.Model): """ _validation = { - 'scale_type': {'required': True}, + "scale_type": {"required": True}, } _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, + "scale_type": {"key": "scaleType", "type": "str"}, } _subtype_map = { - 'scale_type': {'Default': 'DefaultScaleSettings', 'TargetUtilization': 'TargetUtilizationScaleSettings'} + "scale_type": { + "Default": "DefaultScaleSettings", + "TargetUtilization": "TargetUtilizationScaleSettings", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(OnlineScaleSettings, self).__init__(**kwargs) self.scale_type = None # type: Optional[str] @@ -6074,21 +6024,17 @@ class DefaultScaleSettings(OnlineScaleSettings): """ _validation = { - 'scale_type': {'required': True}, + "scale_type": {"required": True}, } _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, + "scale_type": {"key": "scaleType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DefaultScaleSettings, self).__init__(**kwargs) - self.scale_type = 'Default' # type: str + self.scale_type = "Default" # type: str class DeploymentLogs(msrest.serialization.Model): @@ -6099,19 +6045,16 @@ class DeploymentLogs(msrest.serialization.Model): """ _attribute_map = { - 'content': {'key': 'content', 'type': 'str'}, + "content": {"key": "content", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword content: The retrieved online deployment logs. :paramtype content: str """ super(DeploymentLogs, self).__init__(**kwargs) - self.content = kwargs.get('content', None) + self.content = kwargs.get("content", None) class DeploymentLogsRequest(msrest.serialization.Model): @@ -6125,14 +6068,11 @@ class DeploymentLogsRequest(msrest.serialization.Model): """ _attribute_map = { - 'container_type': {'key': 'containerType', 'type': 'str'}, - 'tail': {'key': 'tail', 'type': 'int'}, + "container_type": {"key": "containerType", "type": "str"}, + "tail": {"key": "tail", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword container_type: The type of container to retrieve logs from. Possible values include: "StorageInitializer", "InferenceServer". @@ -6141,8 +6081,8 @@ def __init__( :paramtype tail: int """ super(DeploymentLogsRequest, self).__init__(**kwargs) - self.container_type = kwargs.get('container_type', None) - self.tail = kwargs.get('tail', None) + self.container_type = kwargs.get("container_type", None) + self.tail = kwargs.get("tail", None) class DiagnoseRequestProperties(msrest.serialization.Model): @@ -6169,21 +6109,21 @@ class DiagnoseRequestProperties(msrest.serialization.Model): """ _attribute_map = { - 'udr': {'key': 'udr', 'type': '{object}'}, - 'nsg': {'key': 'nsg', 'type': '{object}'}, - 'resource_lock': {'key': 'resourceLock', 'type': '{object}'}, - 'dns_resolution': {'key': 'dnsResolution', 'type': '{object}'}, - 'storage_account': {'key': 'storageAccount', 'type': '{object}'}, - 'key_vault': {'key': 'keyVault', 'type': '{object}'}, - 'container_registry': {'key': 'containerRegistry', 'type': '{object}'}, - 'application_insights': {'key': 'applicationInsights', 'type': '{object}'}, - 'others': {'key': 'others', 'type': '{object}'}, + "udr": {"key": "udr", "type": "{object}"}, + "nsg": {"key": "nsg", "type": "{object}"}, + "resource_lock": {"key": "resourceLock", "type": "{object}"}, + "dns_resolution": {"key": "dnsResolution", "type": "{object}"}, + "storage_account": {"key": "storageAccount", "type": "{object}"}, + "key_vault": {"key": "keyVault", "type": "{object}"}, + "container_registry": {"key": "containerRegistry", "type": "{object}"}, + "application_insights": { + "key": "applicationInsights", + "type": "{object}", + }, + "others": {"key": "others", "type": "{object}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword udr: Setting for diagnosing user defined routing. :paramtype udr: dict[str, any] @@ -6205,15 +6145,15 @@ def __init__( :paramtype others: dict[str, any] """ super(DiagnoseRequestProperties, self).__init__(**kwargs) - self.udr = kwargs.get('udr', None) - self.nsg = kwargs.get('nsg', None) - self.resource_lock = kwargs.get('resource_lock', None) - self.dns_resolution = kwargs.get('dns_resolution', None) - self.storage_account = kwargs.get('storage_account', None) - self.key_vault = kwargs.get('key_vault', None) - self.container_registry = kwargs.get('container_registry', None) - self.application_insights = kwargs.get('application_insights', None) - self.others = kwargs.get('others', None) + self.udr = kwargs.get("udr", None) + self.nsg = kwargs.get("nsg", None) + self.resource_lock = kwargs.get("resource_lock", None) + self.dns_resolution = kwargs.get("dns_resolution", None) + self.storage_account = kwargs.get("storage_account", None) + self.key_vault = kwargs.get("key_vault", None) + self.container_registry = kwargs.get("container_registry", None) + self.application_insights = kwargs.get("application_insights", None) + self.others = kwargs.get("others", None) class DiagnoseResponseResult(msrest.serialization.Model): @@ -6224,19 +6164,16 @@ class DiagnoseResponseResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseResponseResultValue'}, + "value": {"key": "value", "type": "DiagnoseResponseResultValue"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: :paramtype value: ~azure.mgmt.machinelearningservices.models.DiagnoseResponseResultValue """ super(DiagnoseResponseResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class DiagnoseResponseResultValue(msrest.serialization.Model): @@ -6269,21 +6206,42 @@ class DiagnoseResponseResultValue(msrest.serialization.Model): """ _attribute_map = { - 'user_defined_route_results': {'key': 'userDefinedRouteResults', 'type': '[DiagnoseResult]'}, - 'network_security_rule_results': {'key': 'networkSecurityRuleResults', 'type': '[DiagnoseResult]'}, - 'resource_lock_results': {'key': 'resourceLockResults', 'type': '[DiagnoseResult]'}, - 'dns_resolution_results': {'key': 'dnsResolutionResults', 'type': '[DiagnoseResult]'}, - 'storage_account_results': {'key': 'storageAccountResults', 'type': '[DiagnoseResult]'}, - 'key_vault_results': {'key': 'keyVaultResults', 'type': '[DiagnoseResult]'}, - 'container_registry_results': {'key': 'containerRegistryResults', 'type': '[DiagnoseResult]'}, - 'application_insights_results': {'key': 'applicationInsightsResults', 'type': '[DiagnoseResult]'}, - 'other_results': {'key': 'otherResults', 'type': '[DiagnoseResult]'}, - } - - def __init__( - self, - **kwargs - ): + "user_defined_route_results": { + "key": "userDefinedRouteResults", + "type": "[DiagnoseResult]", + }, + "network_security_rule_results": { + "key": "networkSecurityRuleResults", + "type": "[DiagnoseResult]", + }, + "resource_lock_results": { + "key": "resourceLockResults", + "type": "[DiagnoseResult]", + }, + "dns_resolution_results": { + "key": "dnsResolutionResults", + "type": "[DiagnoseResult]", + }, + "storage_account_results": { + "key": "storageAccountResults", + "type": "[DiagnoseResult]", + }, + "key_vault_results": { + "key": "keyVaultResults", + "type": "[DiagnoseResult]", + }, + "container_registry_results": { + "key": "containerRegistryResults", + "type": "[DiagnoseResult]", + }, + "application_insights_results": { + "key": "applicationInsightsResults", + "type": "[DiagnoseResult]", + }, + "other_results": {"key": "otherResults", "type": "[DiagnoseResult]"}, + } + + def __init__(self, **kwargs): """ :keyword user_defined_route_results: :paramtype user_defined_route_results: @@ -6312,15 +6270,27 @@ def __init__( :paramtype other_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] """ super(DiagnoseResponseResultValue, self).__init__(**kwargs) - self.user_defined_route_results = kwargs.get('user_defined_route_results', None) - self.network_security_rule_results = kwargs.get('network_security_rule_results', None) - self.resource_lock_results = kwargs.get('resource_lock_results', None) - self.dns_resolution_results = kwargs.get('dns_resolution_results', None) - self.storage_account_results = kwargs.get('storage_account_results', None) - self.key_vault_results = kwargs.get('key_vault_results', None) - self.container_registry_results = kwargs.get('container_registry_results', None) - self.application_insights_results = kwargs.get('application_insights_results', None) - self.other_results = kwargs.get('other_results', None) + self.user_defined_route_results = kwargs.get( + "user_defined_route_results", None + ) + self.network_security_rule_results = kwargs.get( + "network_security_rule_results", None + ) + self.resource_lock_results = kwargs.get("resource_lock_results", None) + self.dns_resolution_results = kwargs.get( + "dns_resolution_results", None + ) + self.storage_account_results = kwargs.get( + "storage_account_results", None + ) + self.key_vault_results = kwargs.get("key_vault_results", None) + self.container_registry_results = kwargs.get( + "container_registry_results", None + ) + self.application_insights_results = kwargs.get( + "application_insights_results", None + ) + self.other_results = kwargs.get("other_results", None) class DiagnoseResult(msrest.serialization.Model): @@ -6338,23 +6308,19 @@ class DiagnoseResult(msrest.serialization.Model): """ _validation = { - 'code': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, + "code": {"readonly": True}, + "level": {"readonly": True}, + "message": {"readonly": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, + "code": {"key": "code", "type": "str"}, + "level": {"key": "level", "type": "str"}, + "message": {"key": "message", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DiagnoseResult, self).__init__(**kwargs) self.code = None self.level = None @@ -6369,19 +6335,16 @@ class DiagnoseWorkspaceParameters(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseRequestProperties'}, + "value": {"key": "value", "type": "DiagnoseRequestProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Value of Parameters. :paramtype value: ~azure.mgmt.machinelearningservices.models.DiagnoseRequestProperties """ super(DiagnoseWorkspaceParameters, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class DistributionConfiguration(msrest.serialization.Model): @@ -6398,23 +6361,23 @@ class DistributionConfiguration(msrest.serialization.Model): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, + "distribution_type": {"key": "distributionType", "type": "str"}, } _subtype_map = { - 'distribution_type': {'Mpi': 'Mpi', 'PyTorch': 'PyTorch', 'TensorFlow': 'TensorFlow'} + "distribution_type": { + "Mpi": "Mpi", + "PyTorch": "PyTorch", + "TensorFlow": "TensorFlow", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DistributionConfiguration, self).__init__(**kwargs) self.distribution_type = None # type: Optional[str] @@ -6435,20 +6398,17 @@ class EncryptionKeyVaultProperties(msrest.serialization.Model): """ _validation = { - 'key_vault_arm_id': {'required': True}, - 'key_identifier': {'required': True}, + "key_vault_arm_id": {"required": True}, + "key_identifier": {"required": True}, } _attribute_map = { - 'key_vault_arm_id': {'key': 'keyVaultArmId', 'type': 'str'}, - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - 'identity_client_id': {'key': 'identityClientId', 'type': 'str'}, + "key_vault_arm_id": {"key": "keyVaultArmId", "type": "str"}, + "key_identifier": {"key": "keyIdentifier", "type": "str"}, + "identity_client_id": {"key": "identityClientId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword key_vault_arm_id: Required. The ArmId of the keyVault where the customer owned encryption key is present. @@ -6460,9 +6420,9 @@ def __init__( :paramtype identity_client_id: str """ super(EncryptionKeyVaultProperties, self).__init__(**kwargs) - self.key_vault_arm_id = kwargs['key_vault_arm_id'] - self.key_identifier = kwargs['key_identifier'] - self.identity_client_id = kwargs.get('identity_client_id', None) + self.key_vault_arm_id = kwargs["key_vault_arm_id"] + self.key_identifier = kwargs["key_identifier"] + self.identity_client_id = kwargs.get("identity_client_id", None) class EncryptionProperty(msrest.serialization.Model): @@ -6481,20 +6441,20 @@ class EncryptionProperty(msrest.serialization.Model): """ _validation = { - 'status': {'required': True}, - 'key_vault_properties': {'required': True}, + "status": {"required": True}, + "key_vault_properties": {"required": True}, } _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityForCmk'}, - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'EncryptionKeyVaultProperties'}, + "status": {"key": "status", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityForCmk"}, + "key_vault_properties": { + "key": "keyVaultProperties", + "type": "EncryptionKeyVaultProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword status: Required. Indicates whether or not the encryption is enabled for the workspace. Possible values include: "Enabled", "Disabled". @@ -6507,9 +6467,9 @@ def __init__( ~azure.mgmt.machinelearningservices.models.EncryptionKeyVaultProperties """ super(EncryptionProperty, self).__init__(**kwargs) - self.status = kwargs['status'] - self.identity = kwargs.get('identity', None) - self.key_vault_properties = kwargs['key_vault_properties'] + self.status = kwargs["status"] + self.identity = kwargs.get("identity", None) + self.key_vault_properties = kwargs["key_vault_properties"] class EndpointAuthKeys(msrest.serialization.Model): @@ -6522,14 +6482,11 @@ class EndpointAuthKeys(msrest.serialization.Model): """ _attribute_map = { - 'primary_key': {'key': 'primaryKey', 'type': 'str'}, - 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, + "primary_key": {"key": "primaryKey", "type": "str"}, + "secondary_key": {"key": "secondaryKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword primary_key: The primary key. :paramtype primary_key: str @@ -6537,8 +6494,8 @@ def __init__( :paramtype secondary_key: str """ super(EndpointAuthKeys, self).__init__(**kwargs) - self.primary_key = kwargs.get('primary_key', None) - self.secondary_key = kwargs.get('secondary_key', None) + self.primary_key = kwargs.get("primary_key", None) + self.secondary_key = kwargs.get("secondary_key", None) class EndpointAuthToken(msrest.serialization.Model): @@ -6555,16 +6512,16 @@ class EndpointAuthToken(msrest.serialization.Model): """ _attribute_map = { - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'expiry_time_utc': {'key': 'expiryTimeUtc', 'type': 'long'}, - 'refresh_after_time_utc': {'key': 'refreshAfterTimeUtc', 'type': 'long'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, + "access_token": {"key": "accessToken", "type": "str"}, + "expiry_time_utc": {"key": "expiryTimeUtc", "type": "long"}, + "refresh_after_time_utc": { + "key": "refreshAfterTimeUtc", + "type": "long", + }, + "token_type": {"key": "tokenType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword access_token: Access token for endpoint authentication. :paramtype access_token: str @@ -6576,10 +6533,10 @@ def __init__( :paramtype token_type: str """ super(EndpointAuthToken, self).__init__(**kwargs) - self.access_token = kwargs.get('access_token', None) - self.expiry_time_utc = kwargs.get('expiry_time_utc', 0) - self.refresh_after_time_utc = kwargs.get('refresh_after_time_utc', 0) - self.token_type = kwargs.get('token_type', None) + self.access_token = kwargs.get("access_token", None) + self.expiry_time_utc = kwargs.get("expiry_time_utc", 0) + self.refresh_after_time_utc = kwargs.get("refresh_after_time_utc", 0) + self.token_type = kwargs.get("token_type", None) class EnvironmentContainerData(Resource): @@ -6605,31 +6562,31 @@ class EnvironmentContainerData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentContainerDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "EnvironmentContainerDetails", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerDetails """ super(EnvironmentContainerData, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class EnvironmentContainerDetails(AssetContainer): @@ -6652,23 +6609,20 @@ class EnvironmentContainerDetails(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -6682,7 +6636,9 @@ def __init__( super(EnvironmentContainerDetails, self).__init__(**kwargs) -class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model): +class EnvironmentContainerResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of EnvironmentContainer entities. :ivar next_link: The link to the next page of EnvironmentContainer objects. If null, there are @@ -6693,14 +6649,11 @@ class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model) """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentContainerData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[EnvironmentContainerData]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of EnvironmentContainer objects. If null, there are no additional pages. @@ -6708,9 +6661,11 @@ def __init__( :keyword value: An array of objects of type EnvironmentContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainerData] """ - super(EnvironmentContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(EnvironmentContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class EnvironmentVersionData(Resource): @@ -6736,31 +6691,31 @@ class EnvironmentVersionData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentVersionDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "EnvironmentVersionDetails", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionDetails """ super(EnvironmentVersionData, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class EnvironmentVersionDetails(AssetBase): @@ -6782,29 +6737,29 @@ class EnvironmentVersionDetails(AssetBase): :vartype build: ~azure.mgmt.machinelearningservices.models.BuildContext :ivar conda_file: Standard configuration file used by Conda that lets you install any kind of package, including Python, R, and C/C++ packages. - - + + .. raw:: html - + . :vartype conda_file: str :ivar environment_type: Environment type is either user managed or curated by the Azure ML service - - + + .. raw:: html - + . Possible values include: "Curated", "UserCreated". :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType :ivar image: Name of the image that will be used for the environment. - - + + .. raw:: html - + . @@ -6817,27 +6772,27 @@ class EnvironmentVersionDetails(AssetBase): """ _validation = { - 'environment_type': {'readonly': True}, + "environment_type": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'build': {'key': 'build', 'type': 'BuildContext'}, - 'conda_file': {'key': 'condaFile', 'type': 'str'}, - 'environment_type': {'key': 'environmentType', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'str'}, - 'inference_config': {'key': 'inferenceConfig', 'type': 'InferenceContainerProperties'}, - 'os_type': {'key': 'osType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "build": {"key": "build", "type": "BuildContext"}, + "conda_file": {"key": "condaFile", "type": "str"}, + "environment_type": {"key": "environmentType", "type": "str"}, + "image": {"key": "image", "type": "str"}, + "inference_config": { + "key": "inferenceConfig", + "type": "InferenceContainerProperties", + }, + "os_type": {"key": "osType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -6853,19 +6808,19 @@ def __init__( :paramtype build: ~azure.mgmt.machinelearningservices.models.BuildContext :keyword conda_file: Standard configuration file used by Conda that lets you install any kind of package, including Python, R, and C/C++ packages. - - + + .. raw:: html - + . :paramtype conda_file: str :keyword image: Name of the image that will be used for the environment. - - + + .. raw:: html - + . @@ -6877,12 +6832,12 @@ def __init__( :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.OperatingSystemType """ super(EnvironmentVersionDetails, self).__init__(**kwargs) - self.build = kwargs.get('build', None) - self.conda_file = kwargs.get('conda_file', None) + self.build = kwargs.get("build", None) + self.conda_file = kwargs.get("conda_file", None) self.environment_type = None - self.image = kwargs.get('image', None) - self.inference_config = kwargs.get('inference_config', None) - self.os_type = kwargs.get('os_type', None) + self.image = kwargs.get("image", None) + self.inference_config = kwargs.get("inference_config", None) + self.os_type = kwargs.get("os_type", None) class EnvironmentVersionResourceArmPaginatedResult(msrest.serialization.Model): @@ -6896,14 +6851,11 @@ class EnvironmentVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentVersionData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[EnvironmentVersionData]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of EnvironmentVersion objects. If null, there are no additional pages. @@ -6911,9 +6863,11 @@ def __init__( :keyword value: An array of objects of type EnvironmentVersion. :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersionData] """ - super(EnvironmentVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(EnvironmentVersionResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class ErrorAdditionalInfo(msrest.serialization.Model): @@ -6928,21 +6882,17 @@ class ErrorAdditionalInfo(msrest.serialization.Model): """ _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, + "type": {"readonly": True}, + "info": {"readonly": True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, + "type": {"key": "type", "type": "str"}, + "info": {"key": "info", "type": "object"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ErrorAdditionalInfo, self).__init__(**kwargs) self.type = None self.info = None @@ -6966,27 +6916,26 @@ class ErrorDetail(msrest.serialization.Model): """ _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, + "code": {"readonly": True}, + "message": {"readonly": True}, + "target": {"readonly": True}, + "details": {"readonly": True}, + "additional_info": {"readonly": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[ErrorDetail]"}, + "additional_info": { + "key": "additionalInfo", + "type": "[ErrorAdditionalInfo]", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ErrorDetail, self).__init__(**kwargs) self.code = None self.message = None @@ -7003,19 +6952,16 @@ class ErrorResponse(msrest.serialization.Model): """ _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, + "error": {"key": "error", "type": "ErrorDetail"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword error: The error object. :paramtype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail """ super(ErrorResponse, self).__init__(**kwargs) - self.error = kwargs.get('error', None) + self.error = kwargs.get("error", None) class EstimatedVMPrice(msrest.serialization.Model): @@ -7034,21 +6980,18 @@ class EstimatedVMPrice(msrest.serialization.Model): """ _validation = { - 'retail_price': {'required': True}, - 'os_type': {'required': True}, - 'vm_tier': {'required': True}, + "retail_price": {"required": True}, + "os_type": {"required": True}, + "vm_tier": {"required": True}, } _attribute_map = { - 'retail_price': {'key': 'retailPrice', 'type': 'float'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_tier': {'key': 'vmTier', 'type': 'str'}, + "retail_price": {"key": "retailPrice", "type": "float"}, + "os_type": {"key": "osType", "type": "str"}, + "vm_tier": {"key": "vmTier", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword retail_price: Required. The price charged for using the VM. :paramtype retail_price: float @@ -7060,9 +7003,9 @@ def __init__( :paramtype vm_tier: str or ~azure.mgmt.machinelearningservices.models.VMTier """ super(EstimatedVMPrice, self).__init__(**kwargs) - self.retail_price = kwargs['retail_price'] - self.os_type = kwargs['os_type'] - self.vm_tier = kwargs['vm_tier'] + self.retail_price = kwargs["retail_price"] + self.os_type = kwargs["os_type"] + self.vm_tier = kwargs["vm_tier"] class EstimatedVMPrices(msrest.serialization.Model): @@ -7082,21 +7025,18 @@ class EstimatedVMPrices(msrest.serialization.Model): """ _validation = { - 'billing_currency': {'required': True}, - 'unit_of_measure': {'required': True}, - 'values': {'required': True}, + "billing_currency": {"required": True}, + "unit_of_measure": {"required": True}, + "values": {"required": True}, } _attribute_map = { - 'billing_currency': {'key': 'billingCurrency', 'type': 'str'}, - 'unit_of_measure': {'key': 'unitOfMeasure', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[EstimatedVMPrice]'}, + "billing_currency": {"key": "billingCurrency", "type": "str"}, + "unit_of_measure": {"key": "unitOfMeasure", "type": "str"}, + "values": {"key": "values", "type": "[EstimatedVMPrice]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword billing_currency: Required. Three lettered code specifying the currency of the VM price. Example: USD. Possible values include: "USD". @@ -7109,9 +7049,9 @@ def __init__( :paramtype values: list[~azure.mgmt.machinelearningservices.models.EstimatedVMPrice] """ super(EstimatedVMPrices, self).__init__(**kwargs) - self.billing_currency = kwargs['billing_currency'] - self.unit_of_measure = kwargs['unit_of_measure'] - self.values = kwargs['values'] + self.billing_currency = kwargs["billing_currency"] + self.unit_of_measure = kwargs["unit_of_measure"] + self.values = kwargs["values"] class ExternalFQDNResponse(msrest.serialization.Model): @@ -7122,19 +7062,16 @@ class ExternalFQDNResponse(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[FQDNEndpoints]'}, + "value": {"key": "value", "type": "[FQDNEndpoints]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: :paramtype value: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoints] """ super(ExternalFQDNResponse, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class FlavorData(msrest.serialization.Model): @@ -7145,19 +7082,16 @@ class FlavorData(msrest.serialization.Model): """ _attribute_map = { - 'data': {'key': 'data', 'type': '{str}'}, + "data": {"key": "data", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data: Model flavor-specific data. :paramtype data: dict[str, str] """ super(FlavorData, self).__init__(**kwargs) - self.data = kwargs.get('data', None) + self.data = kwargs.get("data", None) class FQDNEndpoint(msrest.serialization.Model): @@ -7170,14 +7104,14 @@ class FQDNEndpoint(msrest.serialization.Model): """ _attribute_map = { - 'domain_name': {'key': 'domainName', 'type': 'str'}, - 'endpoint_details': {'key': 'endpointDetails', 'type': '[FQDNEndpointDetail]'}, + "domain_name": {"key": "domainName", "type": "str"}, + "endpoint_details": { + "key": "endpointDetails", + "type": "[FQDNEndpointDetail]", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword domain_name: :paramtype domain_name: str @@ -7186,8 +7120,8 @@ def __init__( list[~azure.mgmt.machinelearningservices.models.FQDNEndpointDetail] """ super(FQDNEndpoint, self).__init__(**kwargs) - self.domain_name = kwargs.get('domain_name', None) - self.endpoint_details = kwargs.get('endpoint_details', None) + self.domain_name = kwargs.get("domain_name", None) + self.endpoint_details = kwargs.get("endpoint_details", None) class FQDNEndpointDetail(msrest.serialization.Model): @@ -7198,19 +7132,16 @@ class FQDNEndpointDetail(msrest.serialization.Model): """ _attribute_map = { - 'port': {'key': 'port', 'type': 'int'}, + "port": {"key": "port", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword port: :paramtype port: int """ super(FQDNEndpointDetail, self).__init__(**kwargs) - self.port = kwargs.get('port', None) + self.port = kwargs.get("port", None) class FQDNEndpoints(msrest.serialization.Model): @@ -7221,19 +7152,16 @@ class FQDNEndpoints(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'FQDNEndpointsProperties'}, + "properties": {"key": "properties", "type": "FQDNEndpointsProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: :paramtype properties: ~azure.mgmt.machinelearningservices.models.FQDNEndpointsProperties """ super(FQDNEndpoints, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class FQDNEndpointsProperties(msrest.serialization.Model): @@ -7246,14 +7174,11 @@ class FQDNEndpointsProperties(msrest.serialization.Model): """ _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'endpoints': {'key': 'endpoints', 'type': '[FQDNEndpoint]'}, + "category": {"key": "category", "type": "str"}, + "endpoints": {"key": "endpoints", "type": "[FQDNEndpoint]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: :paramtype category: str @@ -7261,8 +7186,8 @@ def __init__( :paramtype endpoints: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoint] """ super(FQDNEndpointsProperties, self).__init__(**kwargs) - self.category = kwargs.get('category', None) - self.endpoints = kwargs.get('endpoints', None) + self.category = kwargs.get("category", None) + self.endpoints = kwargs.get("endpoints", None) class GridSamplingAlgorithm(SamplingAlgorithm): @@ -7278,21 +7203,20 @@ class GridSamplingAlgorithm(SamplingAlgorithm): """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(GridSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Grid' # type: str + self.sampling_algorithm_type = "Grid" # type: str class HDInsightSchema(msrest.serialization.Model): @@ -7303,19 +7227,16 @@ class HDInsightSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, + "properties": {"key": "properties", "type": "HDInsightProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: HDInsight compute properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties """ super(HDInsightSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class HDInsight(Compute, HDInsightSchema): @@ -7357,33 +7278,33 @@ class HDInsight(Compute, HDInsightSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "HDInsightProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: HDInsight compute properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties @@ -7396,18 +7317,18 @@ def __init__( :paramtype disable_local_auth: bool """ super(HDInsight, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'HDInsight' # type: str - self.compute_type = 'HDInsight' # type: str + self.properties = kwargs.get("properties", None) + self.compute_type = "HDInsight" # type: str + self.compute_type = "HDInsight" # type: str self.compute_location = None self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) + self.disable_local_auth = kwargs.get("disable_local_auth", None) class HDInsightProperties(msrest.serialization.Model): @@ -7423,15 +7344,15 @@ class HDInsightProperties(msrest.serialization.Model): """ _attribute_map = { - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, + "ssh_port": {"key": "sshPort", "type": "int"}, + "address": {"key": "address", "type": "str"}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword ssh_port: Port open for ssh connections on the master node of the cluster. :paramtype ssh_port: int @@ -7442,9 +7363,9 @@ def __init__( ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials """ super(HDInsightProperties, self).__init__(**kwargs) - self.ssh_port = kwargs.get('ssh_port', None) - self.address = kwargs.get('address', None) - self.administrator_account = kwargs.get('administrator_account', None) + self.ssh_port = kwargs.get("ssh_port", None) + self.address = kwargs.get("address", None) + self.administrator_account = kwargs.get("administrator_account", None) class IdAssetReference(AssetReferenceBase): @@ -7460,26 +7381,23 @@ class IdAssetReference(AssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, - 'asset_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "reference_type": {"required": True}, + "asset_id": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'asset_id': {'key': 'assetId', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "asset_id": {"key": "assetId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword asset_id: Required. [Required] ARM resource ID of the asset. :paramtype asset_id: str """ super(IdAssetReference, self).__init__(**kwargs) - self.reference_type = 'Id' # type: str - self.asset_id = kwargs['asset_id'] + self.reference_type = "Id" # type: str + self.asset_id = kwargs["asset_id"] class IdentityForCmk(msrest.serialization.Model): @@ -7491,20 +7409,22 @@ class IdentityForCmk(msrest.serialization.Model): """ _attribute_map = { - 'user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, + "user_assigned_identity": { + "key": "userAssignedIdentity", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword user_assigned_identity: The ArmId of the user assigned identity that will be used to access the customer managed key vault. :paramtype user_assigned_identity: str """ super(IdentityForCmk, self).__init__(**kwargs) - self.user_assigned_identity = kwargs.get('user_assigned_identity', None) + self.user_assigned_identity = kwargs.get( + "user_assigned_identity", None + ) class InferenceContainerProperties(msrest.serialization.Model): @@ -7520,15 +7440,12 @@ class InferenceContainerProperties(msrest.serialization.Model): """ _attribute_map = { - 'liveness_route': {'key': 'livenessRoute', 'type': 'Route'}, - 'readiness_route': {'key': 'readinessRoute', 'type': 'Route'}, - 'scoring_route': {'key': 'scoringRoute', 'type': 'Route'}, + "liveness_route": {"key": "livenessRoute", "type": "Route"}, + "readiness_route": {"key": "readinessRoute", "type": "Route"}, + "scoring_route": {"key": "scoringRoute", "type": "Route"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword liveness_route: The route to check the liveness of the inference server container. :paramtype liveness_route: ~azure.mgmt.machinelearningservices.models.Route @@ -7539,9 +7456,9 @@ def __init__( :paramtype scoring_route: ~azure.mgmt.machinelearningservices.models.Route """ super(InferenceContainerProperties, self).__init__(**kwargs) - self.liveness_route = kwargs.get('liveness_route', None) - self.readiness_route = kwargs.get('readiness_route', None) - self.scoring_route = kwargs.get('scoring_route', None) + self.liveness_route = kwargs.get("liveness_route", None) + self.readiness_route = kwargs.get("readiness_route", None) + self.scoring_route = kwargs.get("scoring_route", None) class InstanceTypeSchema(msrest.serialization.Model): @@ -7554,14 +7471,14 @@ class InstanceTypeSchema(msrest.serialization.Model): """ _attribute_map = { - 'node_selector': {'key': 'nodeSelector', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'InstanceTypeSchemaResources'}, + "node_selector": {"key": "nodeSelector", "type": "{str}"}, + "resources": { + "key": "resources", + "type": "InstanceTypeSchemaResources", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword node_selector: Node Selector. :paramtype node_selector: dict[str, str] @@ -7569,8 +7486,8 @@ def __init__( :paramtype resources: ~azure.mgmt.machinelearningservices.models.InstanceTypeSchemaResources """ super(InstanceTypeSchema, self).__init__(**kwargs) - self.node_selector = kwargs.get('node_selector', None) - self.resources = kwargs.get('resources', None) + self.node_selector = kwargs.get("node_selector", None) + self.resources = kwargs.get("resources", None) class InstanceTypeSchemaResources(msrest.serialization.Model): @@ -7583,14 +7500,11 @@ class InstanceTypeSchemaResources(msrest.serialization.Model): """ _attribute_map = { - 'requests': {'key': 'requests', 'type': '{str}'}, - 'limits': {'key': 'limits', 'type': '{str}'}, + "requests": {"key": "requests", "type": "{str}"}, + "limits": {"key": "limits", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword requests: Resource requests for this instance type. :paramtype requests: dict[str, str] @@ -7598,8 +7512,8 @@ def __init__( :paramtype limits: dict[str, str] """ super(InstanceTypeSchemaResources, self).__init__(**kwargs) - self.requests = kwargs.get('requests', None) - self.limits = kwargs.get('limits', None) + self.requests = kwargs.get("requests", None) + self.limits = kwargs.get("limits", None) class JobBaseData(Resource): @@ -7625,31 +7539,28 @@ class JobBaseData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'JobBaseDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "JobBaseDetails"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.JobBaseDetails """ super(JobBaseData, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class JobBaseResourceArmPaginatedResult(msrest.serialization.Model): @@ -7663,14 +7574,11 @@ class JobBaseResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[JobBaseData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[JobBaseData]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of JobBase objects. If null, there are no additional pages. @@ -7679,8 +7587,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.JobBaseData] """ super(JobBaseResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class JobService(msrest.serialization.Model): @@ -7703,23 +7611,20 @@ class JobService(msrest.serialization.Model): """ _validation = { - 'error_message': {'readonly': True}, - 'status': {'readonly': True}, + "error_message": {"readonly": True}, + "status": {"readonly": True}, } _attribute_map = { - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'job_service_type': {'key': 'jobServiceType', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'status': {'key': 'status', 'type': 'str'}, + "endpoint": {"key": "endpoint", "type": "str"}, + "error_message": {"key": "errorMessage", "type": "str"}, + "job_service_type": {"key": "jobServiceType", "type": "str"}, + "port": {"key": "port", "type": "int"}, + "properties": {"key": "properties", "type": "{str}"}, + "status": {"key": "status", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword endpoint: Url for endpoint. :paramtype endpoint: str @@ -7731,11 +7636,11 @@ def __init__( :paramtype properties: dict[str, str] """ super(JobService, self).__init__(**kwargs) - self.endpoint = kwargs.get('endpoint', None) + self.endpoint = kwargs.get("endpoint", None) self.error_message = None - self.job_service_type = kwargs.get('job_service_type', None) - self.port = kwargs.get('port', None) - self.properties = kwargs.get('properties', None) + self.job_service_type = kwargs.get("job_service_type", None) + self.port = kwargs.get("port", None) + self.properties = kwargs.get("properties", None) self.status = None @@ -7747,19 +7652,16 @@ class KubernetesSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, + "properties": {"key": "properties", "type": "KubernetesProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of Kubernetes. :paramtype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties """ super(KubernetesSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class Kubernetes(Compute, KubernetesSchema): @@ -7801,33 +7703,33 @@ class Kubernetes(Compute, KubernetesSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "KubernetesProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of Kubernetes. :paramtype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties @@ -7840,18 +7742,18 @@ def __init__( :paramtype disable_local_auth: bool """ super(Kubernetes, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'Kubernetes' # type: str - self.compute_type = 'Kubernetes' # type: str + self.properties = kwargs.get("properties", None) + self.compute_type = "Kubernetes" # type: str + self.compute_type = "Kubernetes" # type: str self.compute_location = None self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) + self.disable_local_auth = kwargs.get("disable_local_auth", None) class OnlineDeploymentDetails(EndpointDeploymentPropertiesBase): @@ -7906,36 +7808,48 @@ class OnlineDeploymentDetails(EndpointDeploymentPropertiesBase): """ _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, + "endpoint_compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, + "model": {"key": "model", "type": "str"}, + "model_mount_path": {"key": "modelMountPath", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, } _subtype_map = { - 'endpoint_compute_type': {'Kubernetes': 'KubernetesOnlineDeployment', 'Managed': 'ManagedOnlineDeployment'} + "endpoint_compute_type": { + "Kubernetes": "KubernetesOnlineDeployment", + "Managed": "ManagedOnlineDeployment", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword code_configuration: Code configuration for the endpoint deployment. :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration @@ -7970,16 +7884,16 @@ def __init__( :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings """ super(OnlineDeploymentDetails, self).__init__(**kwargs) - self.app_insights_enabled = kwargs.get('app_insights_enabled', False) - self.endpoint_compute_type = 'OnlineDeploymentDetails' # type: str - self.instance_type = kwargs.get('instance_type', None) - self.liveness_probe = kwargs.get('liveness_probe', None) - self.model = kwargs.get('model', None) - self.model_mount_path = kwargs.get('model_mount_path', None) + self.app_insights_enabled = kwargs.get("app_insights_enabled", False) + self.endpoint_compute_type = "OnlineDeploymentDetails" # type: str + self.instance_type = kwargs.get("instance_type", None) + self.liveness_probe = kwargs.get("liveness_probe", None) + self.model = kwargs.get("model", None) + self.model_mount_path = kwargs.get("model_mount_path", None) self.provisioning_state = None - self.readiness_probe = kwargs.get('readiness_probe', None) - self.request_settings = kwargs.get('request_settings', None) - self.scale_settings = kwargs.get('scale_settings', None) + self.readiness_probe = kwargs.get("readiness_probe", None) + self.request_settings = kwargs.get("request_settings", None) + self.scale_settings = kwargs.get("scale_settings", None) class KubernetesOnlineDeployment(OnlineDeploymentDetails): @@ -8035,33 +7949,45 @@ class KubernetesOnlineDeployment(OnlineDeploymentDetails): """ _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - 'container_resource_requirements': {'key': 'containerResourceRequirements', 'type': 'ContainerResourceRequirements'}, - } - - def __init__( - self, - **kwargs - ): + "endpoint_compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, + "model": {"key": "model", "type": "str"}, + "model_mount_path": {"key": "modelMountPath", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, + "container_resource_requirements": { + "key": "containerResourceRequirements", + "type": "ContainerResourceRequirements", + }, + } + + def __init__(self, **kwargs): """ :keyword code_configuration: Code configuration for the endpoint deployment. :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration @@ -8100,8 +8026,10 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ContainerResourceRequirements """ super(KubernetesOnlineDeployment, self).__init__(**kwargs) - self.endpoint_compute_type = 'Kubernetes' # type: str - self.container_resource_requirements = kwargs.get('container_resource_requirements', None) + self.endpoint_compute_type = "Kubernetes" # type: str + self.container_resource_requirements = kwargs.get( + "container_resource_requirements", None + ) class KubernetesProperties(msrest.serialization.Model): @@ -8127,20 +8055,32 @@ class KubernetesProperties(msrest.serialization.Model): """ _attribute_map = { - 'relay_connection_string': {'key': 'relayConnectionString', 'type': 'str'}, - 'service_bus_connection_string': {'key': 'serviceBusConnectionString', 'type': 'str'}, - 'extension_principal_id': {'key': 'extensionPrincipalId', 'type': 'str'}, - 'extension_instance_release_train': {'key': 'extensionInstanceReleaseTrain', 'type': 'str'}, - 'vc_name': {'key': 'vcName', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'default_instance_type': {'key': 'defaultInstanceType', 'type': 'str'}, - 'instance_types': {'key': 'instanceTypes', 'type': '{InstanceTypeSchema}'}, - } - - def __init__( - self, - **kwargs - ): + "relay_connection_string": { + "key": "relayConnectionString", + "type": "str", + }, + "service_bus_connection_string": { + "key": "serviceBusConnectionString", + "type": "str", + }, + "extension_principal_id": { + "key": "extensionPrincipalId", + "type": "str", + }, + "extension_instance_release_train": { + "key": "extensionInstanceReleaseTrain", + "type": "str", + }, + "vc_name": {"key": "vcName", "type": "str"}, + "namespace": {"key": "namespace", "type": "str"}, + "default_instance_type": {"key": "defaultInstanceType", "type": "str"}, + "instance_types": { + "key": "instanceTypes", + "type": "{InstanceTypeSchema}", + }, + } + + def __init__(self, **kwargs): """ :keyword relay_connection_string: Relay connection string. :paramtype relay_connection_string: str @@ -8161,14 +8101,22 @@ def __init__( ~azure.mgmt.machinelearningservices.models.InstanceTypeSchema] """ super(KubernetesProperties, self).__init__(**kwargs) - self.relay_connection_string = kwargs.get('relay_connection_string', None) - self.service_bus_connection_string = kwargs.get('service_bus_connection_string', None) - self.extension_principal_id = kwargs.get('extension_principal_id', None) - self.extension_instance_release_train = kwargs.get('extension_instance_release_train', None) - self.vc_name = kwargs.get('vc_name', None) - self.namespace = kwargs.get('namespace', "default") - self.default_instance_type = kwargs.get('default_instance_type', None) - self.instance_types = kwargs.get('instance_types', None) + self.relay_connection_string = kwargs.get( + "relay_connection_string", None + ) + self.service_bus_connection_string = kwargs.get( + "service_bus_connection_string", None + ) + self.extension_principal_id = kwargs.get( + "extension_principal_id", None + ) + self.extension_instance_release_train = kwargs.get( + "extension_instance_release_train", None + ) + self.vc_name = kwargs.get("vc_name", None) + self.namespace = kwargs.get("namespace", "default") + self.default_instance_type = kwargs.get("default_instance_type", None) + self.instance_types = kwargs.get("instance_types", None) class ListAmlUserFeatureResult(msrest.serialization.Model): @@ -8184,21 +8132,17 @@ class ListAmlUserFeatureResult(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlUserFeature]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[AmlUserFeature]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListAmlUserFeatureResult, self).__init__(**kwargs) self.value = None self.next_link = None @@ -8216,21 +8160,17 @@ class ListNotebookKeysResult(msrest.serialization.Model): """ _validation = { - 'primary_access_key': {'readonly': True}, - 'secondary_access_key': {'readonly': True}, + "primary_access_key": {"readonly": True}, + "secondary_access_key": {"readonly": True}, } _attribute_map = { - 'primary_access_key': {'key': 'primaryAccessKey', 'type': 'str'}, - 'secondary_access_key': {'key': 'secondaryAccessKey', 'type': 'str'}, + "primary_access_key": {"key": "primaryAccessKey", "type": "str"}, + "secondary_access_key": {"key": "secondaryAccessKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListNotebookKeysResult, self).__init__(**kwargs) self.primary_access_key = None self.secondary_access_key = None @@ -8246,19 +8186,15 @@ class ListStorageAccountKeysResult(msrest.serialization.Model): """ _validation = { - 'user_storage_key': {'readonly': True}, + "user_storage_key": {"readonly": True}, } _attribute_map = { - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, + "user_storage_key": {"key": "userStorageKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListStorageAccountKeysResult, self).__init__(**kwargs) self.user_storage_key = None @@ -8276,21 +8212,17 @@ class ListUsagesResult(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[Usage]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Usage]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListUsagesResult, self).__init__(**kwargs) self.value = None self.next_link = None @@ -8316,27 +8248,35 @@ class ListWorkspaceKeysResult(msrest.serialization.Model): """ _validation = { - 'user_storage_key': {'readonly': True}, - 'user_storage_resource_id': {'readonly': True}, - 'app_insights_instrumentation_key': {'readonly': True}, - 'container_registry_credentials': {'readonly': True}, - 'notebook_access_keys': {'readonly': True}, + "user_storage_key": {"readonly": True}, + "user_storage_resource_id": {"readonly": True}, + "app_insights_instrumentation_key": {"readonly": True}, + "container_registry_credentials": {"readonly": True}, + "notebook_access_keys": {"readonly": True}, } _attribute_map = { - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, - 'user_storage_resource_id': {'key': 'userStorageResourceId', 'type': 'str'}, - 'app_insights_instrumentation_key': {'key': 'appInsightsInstrumentationKey', 'type': 'str'}, - 'container_registry_credentials': {'key': 'containerRegistryCredentials', 'type': 'RegistryListCredentialsResult'}, - 'notebook_access_keys': {'key': 'notebookAccessKeys', 'type': 'ListNotebookKeysResult'}, + "user_storage_key": {"key": "userStorageKey", "type": "str"}, + "user_storage_resource_id": { + "key": "userStorageResourceId", + "type": "str", + }, + "app_insights_instrumentation_key": { + "key": "appInsightsInstrumentationKey", + "type": "str", + }, + "container_registry_credentials": { + "key": "containerRegistryCredentials", + "type": "RegistryListCredentialsResult", + }, + "notebook_access_keys": { + "key": "notebookAccessKeys", + "type": "ListNotebookKeysResult", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListWorkspaceKeysResult, self).__init__(**kwargs) self.user_storage_key = None self.user_storage_resource_id = None @@ -8358,21 +8298,17 @@ class ListWorkspaceQuotas(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[ResourceQuota]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[ResourceQuota]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListWorkspaceQuotas, self).__init__(**kwargs) self.value = None self.next_link = None @@ -8394,20 +8330,17 @@ class LiteralJobInput(JobInput): """ _validation = { - 'job_input_type': {'required': True}, - 'value': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "job_input_type": {"required": True}, + "value": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, + "value": {"key": "value", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: Description for the input. :paramtype description: str @@ -8415,8 +8348,8 @@ def __init__( :paramtype value: str """ super(LiteralJobInput, self).__init__(**kwargs) - self.job_input_type = 'literal' # type: str - self.value = kwargs['value'] + self.job_input_type = "literal" # type: str + self.value = kwargs["value"] class ManagedIdentity(IdentityConfiguration): @@ -8440,20 +8373,17 @@ class ManagedIdentity(IdentityConfiguration): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + "object_id": {"key": "objectId", "type": "str"}, + "resource_id": {"key": "resourceId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword client_id: Specifies a user-assigned identity by client ID. For system-assigned, do not set this field. @@ -8466,10 +8396,10 @@ def __init__( :paramtype resource_id: str """ super(ManagedIdentity, self).__init__(**kwargs) - self.identity_type = 'Managed' # type: str - self.client_id = kwargs.get('client_id', None) - self.object_id = kwargs.get('object_id', None) - self.resource_id = kwargs.get('resource_id', None) + self.identity_type = "Managed" # type: str + self.client_id = kwargs.get("client_id", None) + self.object_id = kwargs.get("object_id", None) + self.resource_id = kwargs.get("resource_id", None) class WorkspaceConnectionPropertiesV2(msrest.serialization.Model): @@ -8495,25 +8425,28 @@ class WorkspaceConnectionPropertiesV2(msrest.serialization.Model): """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, } _subtype_map = { - 'auth_type': {'ManagedIdentity': 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', 'None': 'NoneAuthTypeWorkspaceConnectionProperties', 'PAT': 'PATAuthTypeWorkspaceConnectionProperties', 'SAS': 'SASAuthTypeWorkspaceConnectionProperties', 'UsernamePassword': 'UsernamePasswordAuthTypeWorkspaceConnectionProperties'} + "auth_type": { + "ManagedIdentity": "ManagedIdentityAuthTypeWorkspaceConnectionProperties", + "None": "NoneAuthTypeWorkspaceConnectionProperties", + "PAT": "PATAuthTypeWorkspaceConnectionProperties", + "SAS": "SASAuthTypeWorkspaceConnectionProperties", + "UsernamePassword": "UsernamePasswordAuthTypeWorkspaceConnectionProperties", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: Category of the connection. Possible values include: "PythonFeed", "ContainerRegistry", "Git". @@ -8528,13 +8461,15 @@ def __init__( """ super(WorkspaceConnectionPropertiesV2, self).__init__(**kwargs) self.auth_type = None # type: Optional[str] - self.category = kwargs.get('category', None) - self.target = kwargs.get('target', None) - self.value = kwargs.get('value', None) - self.value_format = kwargs.get('value_format', None) + self.category = kwargs.get("category", None) + self.target = kwargs.get("target", None) + self.value = kwargs.get("value", None) + self.value_format = kwargs.get("value_format", None) -class ManagedIdentityAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class ManagedIdentityAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """ManagedIdentityAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -8557,22 +8492,22 @@ class ManagedIdentityAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPr """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionManagedIdentity'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionManagedIdentity", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: Category of the connection. Possible values include: "PythonFeed", "ContainerRegistry", "Git". @@ -8588,9 +8523,11 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity """ - super(ManagedIdentityAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'ManagedIdentity' # type: str - self.credentials = kwargs.get('credentials', None) + super( + ManagedIdentityAuthTypeWorkspaceConnectionProperties, self + ).__init__(**kwargs) + self.auth_type = "ManagedIdentity" # type: str + self.credentials = kwargs.get("credentials", None) class ManagedOnlineDeployment(OnlineDeploymentDetails): @@ -8642,32 +8579,41 @@ class ManagedOnlineDeployment(OnlineDeploymentDetails): """ _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, + "endpoint_compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, + "model": {"key": "model", "type": "str"}, + "model_mount_path": {"key": "modelMountPath", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword code_configuration: Code configuration for the endpoint deployment. :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration @@ -8702,7 +8648,7 @@ def __init__( :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings """ super(ManagedOnlineDeployment, self).__init__(**kwargs) - self.endpoint_compute_type = 'Managed' # type: str + self.endpoint_compute_type = "Managed" # type: str class ManagedServiceIdentity(msrest.serialization.Model): @@ -8731,22 +8677,22 @@ class ManagedServiceIdentity(msrest.serialization.Model): """ _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, + "principal_id": {"readonly": True}, + "tenant_id": {"readonly": True}, + "type": {"required": True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{UserAssignedIdentity}", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword type: Required. Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", @@ -8762,8 +8708,10 @@ def __init__( super(ManagedServiceIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None - self.type = kwargs['type'] - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + self.type = kwargs["type"] + self.user_assigned_identities = kwargs.get( + "user_assigned_identities", None + ) class MedianStoppingPolicy(EarlyTerminationPolicy): @@ -8782,19 +8730,16 @@ class MedianStoppingPolicy(EarlyTerminationPolicy): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. :paramtype delay_evaluation: int @@ -8802,7 +8747,7 @@ def __init__( :paramtype evaluation_interval: int """ super(MedianStoppingPolicy, self).__init__(**kwargs) - self.policy_type = 'MedianStopping' # type: str + self.policy_type = "MedianStopping" # type: str class MLFlowModelJobInput(JobInput, AssetJobInput): @@ -8824,21 +8769,18 @@ class MLFlowModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -8849,11 +8791,11 @@ def __init__( :paramtype description: str """ super(MLFlowModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'mlflow_model' # type: str - self.description = kwargs.get('description', None) - self.job_input_type = 'mlflow_model' # type: str + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "mlflow_model" # type: str + self.description = kwargs.get("description", None) + self.job_input_type = "mlflow_model" # type: str class MLFlowModelJobOutput(JobOutput, AssetJobOutput): @@ -8874,20 +8816,17 @@ class MLFlowModelJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -8897,11 +8836,11 @@ def __init__( :paramtype description: str """ super(MLFlowModelJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'mlflow_model' # type: str - self.description = kwargs.get('description', None) - self.job_output_type = 'mlflow_model' # type: str + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "mlflow_model" # type: str + self.description = kwargs.get("description", None) + self.job_output_type = "mlflow_model" # type: str class MLTableData(DataVersionBaseDetails): @@ -8930,25 +8869,22 @@ class MLTableData(DataVersionBaseDetails): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'referenced_uris': {'key': 'referencedUris', 'type': '[str]'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, + "referenced_uris": {"key": "referencedUris", "type": "[str]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -8967,8 +8903,8 @@ def __init__( :paramtype referenced_uris: list[str] """ super(MLTableData, self).__init__(**kwargs) - self.data_type = 'mltable' # type: str - self.referenced_uris = kwargs.get('referenced_uris', None) + self.data_type = "mltable" # type: str + self.referenced_uris = kwargs.get("referenced_uris", None) class MLTableJobInput(JobInput, AssetJobInput): @@ -8990,21 +8926,18 @@ class MLTableJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -9015,11 +8948,11 @@ def __init__( :paramtype description: str """ super(MLTableJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'mltable' # type: str - self.description = kwargs.get('description', None) - self.job_input_type = 'mltable' # type: str + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "mltable" # type: str + self.description = kwargs.get("description", None) + self.job_input_type = "mltable" # type: str class MLTableJobOutput(JobOutput, AssetJobOutput): @@ -9040,20 +8973,17 @@ class MLTableJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -9063,11 +8993,11 @@ def __init__( :paramtype description: str """ super(MLTableJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'mltable' # type: str - self.description = kwargs.get('description', None) - self.job_output_type = 'mltable' # type: str + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "mltable" # type: str + self.description = kwargs.get("description", None) + self.job_output_type = "mltable" # type: str class ModelContainerData(Resource): @@ -9093,31 +9023,28 @@ class ModelContainerData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelContainerDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "ModelContainerDetails"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelContainerDetails """ super(ModelContainerData, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class ModelContainerDetails(AssetContainer): @@ -9140,23 +9067,20 @@ class ModelContainerDetails(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -9181,14 +9105,11 @@ class ModelContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelContainerData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ModelContainerData]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of ModelContainer objects. If null, there are no additional pages. @@ -9196,9 +9117,11 @@ def __init__( :keyword value: An array of objects of type ModelContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelContainerData] """ - super(ModelContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(ModelContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class ModelVersionData(Resource): @@ -9224,31 +9147,28 @@ class ModelVersionData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelVersionDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "ModelVersionDetails"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelVersionDetails """ super(ModelVersionData, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class ModelVersionDetails(AssetBase): @@ -9275,21 +9195,18 @@ class ModelVersionDetails(AssetBase): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'flavors': {'key': 'flavors', 'type': '{FlavorData}'}, - 'job_name': {'key': 'jobName', 'type': 'str'}, - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'model_uri': {'key': 'modelUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "flavors": {"key": "flavors", "type": "{FlavorData}"}, + "job_name": {"key": "jobName", "type": "str"}, + "model_type": {"key": "modelType", "type": "str"}, + "model_uri": {"key": "modelUri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -9311,10 +9228,10 @@ def __init__( :paramtype model_uri: str """ super(ModelVersionDetails, self).__init__(**kwargs) - self.flavors = kwargs.get('flavors', None) - self.job_name = kwargs.get('job_name', None) - self.model_type = kwargs.get('model_type', None) - self.model_uri = kwargs.get('model_uri', None) + self.flavors = kwargs.get("flavors", None) + self.job_name = kwargs.get("job_name", None) + self.model_type = kwargs.get("model_type", None) + self.model_uri = kwargs.get("model_uri", None) class ModelVersionResourceArmPaginatedResult(msrest.serialization.Model): @@ -9328,14 +9245,11 @@ class ModelVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelVersionData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ModelVersionData]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of ModelVersion objects. If null, there are no additional pages. @@ -9344,8 +9258,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelVersionData] """ super(ModelVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class Mpi(DistributionConfiguration): @@ -9361,25 +9275,27 @@ class Mpi(DistributionConfiguration): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, + "distribution_type": {"key": "distributionType", "type": "str"}, + "process_count_per_instance": { + "key": "processCountPerInstance", + "type": "int", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword process_count_per_instance: Number of processes per MPI node. :paramtype process_count_per_instance: int """ super(Mpi, self).__init__(**kwargs) - self.distribution_type = 'Mpi' # type: str - self.process_count_per_instance = kwargs.get('process_count_per_instance', None) + self.distribution_type = "Mpi" # type: str + self.process_count_per_instance = kwargs.get( + "process_count_per_instance", None + ) class NodeStateCounts(msrest.serialization.Model): @@ -9402,29 +9318,25 @@ class NodeStateCounts(msrest.serialization.Model): """ _validation = { - 'idle_node_count': {'readonly': True}, - 'running_node_count': {'readonly': True}, - 'preparing_node_count': {'readonly': True}, - 'unusable_node_count': {'readonly': True}, - 'leaving_node_count': {'readonly': True}, - 'preempted_node_count': {'readonly': True}, + "idle_node_count": {"readonly": True}, + "running_node_count": {"readonly": True}, + "preparing_node_count": {"readonly": True}, + "unusable_node_count": {"readonly": True}, + "leaving_node_count": {"readonly": True}, + "preempted_node_count": {"readonly": True}, } _attribute_map = { - 'idle_node_count': {'key': 'idleNodeCount', 'type': 'int'}, - 'running_node_count': {'key': 'runningNodeCount', 'type': 'int'}, - 'preparing_node_count': {'key': 'preparingNodeCount', 'type': 'int'}, - 'unusable_node_count': {'key': 'unusableNodeCount', 'type': 'int'}, - 'leaving_node_count': {'key': 'leavingNodeCount', 'type': 'int'}, - 'preempted_node_count': {'key': 'preemptedNodeCount', 'type': 'int'}, + "idle_node_count": {"key": "idleNodeCount", "type": "int"}, + "running_node_count": {"key": "runningNodeCount", "type": "int"}, + "preparing_node_count": {"key": "preparingNodeCount", "type": "int"}, + "unusable_node_count": {"key": "unusableNodeCount", "type": "int"}, + "leaving_node_count": {"key": "leavingNodeCount", "type": "int"}, + "preempted_node_count": {"key": "preemptedNodeCount", "type": "int"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NodeStateCounts, self).__init__(**kwargs) self.idle_node_count = None self.running_node_count = None @@ -9434,7 +9346,9 @@ def __init__( self.preempted_node_count = None -class NoneAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class NoneAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """NoneAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -9454,21 +9368,18 @@ class NoneAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2) """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: Category of the connection. Possible values include: "PythonFeed", "ContainerRegistry", "Git". @@ -9481,8 +9392,10 @@ def __init__( "JSON". :paramtype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat """ - super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'None' # type: str + super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__( + **kwargs + ) + self.auth_type = "None" # type: str class NoneDatastoreCredentials(DatastoreCredentials): @@ -9497,21 +9410,17 @@ class NoneDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, + "credentials_type": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NoneDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'None' # type: str + self.credentials_type = "None" # type: str class NotebookAccessTokenResult(msrest.serialization.Model): @@ -9538,33 +9447,29 @@ class NotebookAccessTokenResult(msrest.serialization.Model): """ _validation = { - 'notebook_resource_id': {'readonly': True}, - 'host_name': {'readonly': True}, - 'public_dns': {'readonly': True}, - 'access_token': {'readonly': True}, - 'token_type': {'readonly': True}, - 'expires_in': {'readonly': True}, - 'refresh_token': {'readonly': True}, - 'scope': {'readonly': True}, + "notebook_resource_id": {"readonly": True}, + "host_name": {"readonly": True}, + "public_dns": {"readonly": True}, + "access_token": {"readonly": True}, + "token_type": {"readonly": True}, + "expires_in": {"readonly": True}, + "refresh_token": {"readonly": True}, + "scope": {"readonly": True}, } _attribute_map = { - 'notebook_resource_id': {'key': 'notebookResourceId', 'type': 'str'}, - 'host_name': {'key': 'hostName', 'type': 'str'}, - 'public_dns': {'key': 'publicDns', 'type': 'str'}, - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, - 'expires_in': {'key': 'expiresIn', 'type': 'int'}, - 'refresh_token': {'key': 'refreshToken', 'type': 'str'}, - 'scope': {'key': 'scope', 'type': 'str'}, + "notebook_resource_id": {"key": "notebookResourceId", "type": "str"}, + "host_name": {"key": "hostName", "type": "str"}, + "public_dns": {"key": "publicDns", "type": "str"}, + "access_token": {"key": "accessToken", "type": "str"}, + "token_type": {"key": "tokenType", "type": "str"}, + "expires_in": {"key": "expiresIn", "type": "int"}, + "refresh_token": {"key": "refreshToken", "type": "str"}, + "scope": {"key": "scope", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NotebookAccessTokenResult, self).__init__(**kwargs) self.notebook_resource_id = None self.host_name = None @@ -9586,14 +9491,11 @@ class NotebookPreparationError(msrest.serialization.Model): """ _attribute_map = { - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'status_code': {'key': 'statusCode', 'type': 'int'}, + "error_message": {"key": "errorMessage", "type": "str"}, + "status_code": {"key": "statusCode", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword error_message: :paramtype error_message: str @@ -9601,8 +9503,8 @@ def __init__( :paramtype status_code: int """ super(NotebookPreparationError, self).__init__(**kwargs) - self.error_message = kwargs.get('error_message', None) - self.status_code = kwargs.get('status_code', None) + self.error_message = kwargs.get("error_message", None) + self.status_code = kwargs.get("status_code", None) class NotebookResourceInfo(msrest.serialization.Model): @@ -9618,15 +9520,15 @@ class NotebookResourceInfo(msrest.serialization.Model): """ _attribute_map = { - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'notebook_preparation_error': {'key': 'notebookPreparationError', 'type': 'NotebookPreparationError'}, + "fqdn": {"key": "fqdn", "type": "str"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "notebook_preparation_error": { + "key": "notebookPreparationError", + "type": "NotebookPreparationError", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword fqdn: :paramtype fqdn: str @@ -9637,9 +9539,11 @@ def __init__( ~azure.mgmt.machinelearningservices.models.NotebookPreparationError """ super(NotebookResourceInfo, self).__init__(**kwargs) - self.fqdn = kwargs.get('fqdn', None) - self.resource_id = kwargs.get('resource_id', None) - self.notebook_preparation_error = kwargs.get('notebook_preparation_error', None) + self.fqdn = kwargs.get("fqdn", None) + self.resource_id = kwargs.get("resource_id", None) + self.notebook_preparation_error = kwargs.get( + "notebook_preparation_error", None + ) class Objective(msrest.serialization.Model): @@ -9655,19 +9559,16 @@ class Objective(msrest.serialization.Model): """ _validation = { - 'goal': {'required': True}, - 'primary_metric': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "goal": {"required": True}, + "primary_metric": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'goal': {'key': 'goal', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "goal": {"key": "goal", "type": "str"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword goal: Required. [Required] Defines supported metric goals for hyperparameter tuning. Possible values include: "Minimize", "Maximize". @@ -9676,8 +9577,8 @@ def __init__( :paramtype primary_metric: str """ super(Objective, self).__init__(**kwargs) - self.goal = kwargs['goal'] - self.primary_metric = kwargs['primary_metric'] + self.goal = kwargs["goal"] + self.primary_metric = kwargs["primary_metric"] class OnlineDeploymentData(TrackedResource): @@ -9714,31 +9615,28 @@ class OnlineDeploymentData(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineDeploymentDetails'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": {"key": "properties", "type": "OnlineDeploymentDetails"}, + "sku": {"key": "sku", "type": "Sku"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -9755,13 +9653,15 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ super(OnlineDeploymentData, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) + self.identity = kwargs.get("identity", None) + self.kind = kwargs.get("kind", None) + self.properties = kwargs["properties"] + self.sku = kwargs.get("sku", None) -class OnlineDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class OnlineDeploymentTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of OnlineDeployment entities. :ivar next_link: The link to the next page of OnlineDeployment objects. If null, there are no @@ -9772,14 +9672,11 @@ class OnlineDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Mod """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineDeploymentData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[OnlineDeploymentData]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of OnlineDeployment objects. If null, there are no additional pages. @@ -9787,9 +9684,11 @@ def __init__( :keyword value: An array of objects of type OnlineDeployment. :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineDeploymentData] """ - super(OnlineDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super( + OnlineDeploymentTrackedResourceArmPaginatedResult, self + ).__init__(**kwargs) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class OnlineEndpointData(TrackedResource): @@ -9826,31 +9725,28 @@ class OnlineEndpointData(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineEndpointDetails'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": {"key": "properties", "type": "OnlineEndpointDetails"}, + "sku": {"key": "sku", "type": "Sku"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -9867,10 +9763,10 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ super(OnlineEndpointData, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) + self.identity = kwargs.get("identity", None) + self.kind = kwargs.get("kind", None) + self.properties = kwargs["properties"] + self.sku = kwargs.get("sku", None) class OnlineEndpointDetails(EndpointPropertiesBase): @@ -9909,28 +9805,25 @@ class OnlineEndpointDetails(EndpointPropertiesBase): """ _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "auth_mode": {"required": True}, + "scoring_uri": {"readonly": True}, + "swagger_uri": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'traffic': {'key': 'traffic', 'type': '{int}'}, + "auth_mode": {"key": "authMode", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "keys": {"key": "keys", "type": "EndpointAuthKeys"}, + "properties": {"key": "properties", "type": "{str}"}, + "scoring_uri": {"key": "scoringUri", "type": "str"}, + "swagger_uri": {"key": "swaggerUri", "type": "str"}, + "compute": {"key": "compute", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "traffic": {"key": "traffic", "type": "{int}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' @@ -9952,12 +9845,14 @@ def __init__( :paramtype traffic: dict[str, int] """ super(OnlineEndpointDetails, self).__init__(**kwargs) - self.compute = kwargs.get('compute', None) + self.compute = kwargs.get("compute", None) self.provisioning_state = None - self.traffic = kwargs.get('traffic', None) + self.traffic = kwargs.get("traffic", None) -class OnlineEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class OnlineEndpointTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of OnlineEndpoint entities. :ivar next_link: The link to the next page of OnlineEndpoint objects. If null, there are no @@ -9968,14 +9863,11 @@ class OnlineEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineEndpointData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[OnlineEndpointData]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of OnlineEndpoint objects. If null, there are no additional pages. @@ -9983,9 +9875,11 @@ def __init__( :keyword value: An array of objects of type OnlineEndpoint. :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineEndpointData] """ - super(OnlineEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(OnlineEndpointTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class OnlineRequestSettings(msrest.serialization.Model): @@ -10004,15 +9898,15 @@ class OnlineRequestSettings(msrest.serialization.Model): """ _attribute_map = { - 'max_concurrent_requests_per_instance': {'key': 'maxConcurrentRequestsPerInstance', 'type': 'int'}, - 'max_queue_wait': {'key': 'maxQueueWait', 'type': 'duration'}, - 'request_timeout': {'key': 'requestTimeout', 'type': 'duration'}, + "max_concurrent_requests_per_instance": { + "key": "maxConcurrentRequestsPerInstance", + "type": "int", + }, + "max_queue_wait": {"key": "maxQueueWait", "type": "duration"}, + "request_timeout": {"key": "requestTimeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword max_concurrent_requests_per_instance: The number of maximum concurrent requests per node allowed per deployment. Defaults to 1. @@ -10026,9 +9920,11 @@ def __init__( :paramtype request_timeout: ~datetime.timedelta """ super(OnlineRequestSettings, self).__init__(**kwargs) - self.max_concurrent_requests_per_instance = kwargs.get('max_concurrent_requests_per_instance', 1) - self.max_queue_wait = kwargs.get('max_queue_wait', "PT0.5S") - self.request_timeout = kwargs.get('request_timeout', "PT5S") + self.max_concurrent_requests_per_instance = kwargs.get( + "max_concurrent_requests_per_instance", 1 + ) + self.max_queue_wait = kwargs.get("max_queue_wait", "PT0.5S") + self.request_timeout = kwargs.get("request_timeout", "PT5S") class OutputPathAssetReference(AssetReferenceBase): @@ -10046,19 +9942,16 @@ class OutputPathAssetReference(AssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "job_id": {"key": "jobId", "type": "str"}, + "path": {"key": "path", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword job_id: ARM resource ID of the job. :paramtype job_id: str @@ -10066,9 +9959,9 @@ def __init__( :paramtype path: str """ super(OutputPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'OutputPath' # type: str - self.job_id = kwargs.get('job_id', None) - self.path = kwargs.get('path', None) + self.reference_type = "OutputPath" # type: str + self.job_id = kwargs.get("job_id", None) + self.path = kwargs.get("path", None) class PaginatedComputeResourcesList(msrest.serialization.Model): @@ -10081,14 +9974,11 @@ class PaginatedComputeResourcesList(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[ComputeResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[ComputeResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: An array of Machine Learning compute objects wrapped in ARM resource envelope. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComputeResource] @@ -10096,8 +9986,8 @@ def __init__( :paramtype next_link: str """ super(PaginatedComputeResourcesList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get("value", None) + self.next_link = kwargs.get("next_link", None) class PartialAssetReferenceBase(msrest.serialization.Model): @@ -10114,23 +10004,23 @@ class PartialAssetReferenceBase(msrest.serialization.Model): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, } _subtype_map = { - 'reference_type': {'DataPath': 'PartialDataPathAssetReference', 'Id': 'PartialIdAssetReference', 'OutputPath': 'PartialOutputPathAssetReference'} + "reference_type": { + "DataPath": "PartialDataPathAssetReference", + "Id": "PartialIdAssetReference", + "OutputPath": "PartialOutputPathAssetReference", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(PartialAssetReferenceBase, self).__init__(**kwargs) self.reference_type = None # type: Optional[str] @@ -10180,26 +10070,35 @@ class PartialBatchDeployment(msrest.serialization.Model): """ _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'PartialCodeConfiguration'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'error_threshold': {'key': 'errorThreshold', 'type': 'int'}, - 'logging_level': {'key': 'loggingLevel', 'type': 'str'}, - 'max_concurrency_per_instance': {'key': 'maxConcurrencyPerInstance', 'type': 'int'}, - 'mini_batch_size': {'key': 'miniBatchSize', 'type': 'long'}, - 'model': {'key': 'model', 'type': 'PartialAssetReferenceBase'}, - 'output_action': {'key': 'outputAction', 'type': 'str'}, - 'output_file_name': {'key': 'outputFileName', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'retry_settings': {'key': 'retrySettings', 'type': 'PartialBatchRetrySettings'}, - } - - def __init__( - self, - **kwargs - ): + "code_configuration": { + "key": "codeConfiguration", + "type": "PartialCodeConfiguration", + }, + "compute": {"key": "compute", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "error_threshold": {"key": "errorThreshold", "type": "int"}, + "logging_level": {"key": "loggingLevel", "type": "str"}, + "max_concurrency_per_instance": { + "key": "maxConcurrencyPerInstance", + "type": "int", + }, + "mini_batch_size": {"key": "miniBatchSize", "type": "long"}, + "model": {"key": "model", "type": "PartialAssetReferenceBase"}, + "output_action": {"key": "outputAction", "type": "str"}, + "output_file_name": {"key": "outputFileName", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "retry_settings": { + "key": "retrySettings", + "type": "PartialBatchRetrySettings", + }, + } + + def __init__(self, **kwargs): """ :keyword code_configuration: Code configuration for the endpoint deployment. :paramtype code_configuration: @@ -10242,20 +10141,22 @@ def __init__( :paramtype retry_settings: ~azure.mgmt.machinelearningservices.models.PartialBatchRetrySettings """ super(PartialBatchDeployment, self).__init__(**kwargs) - self.code_configuration = kwargs.get('code_configuration', None) - self.compute = kwargs.get('compute', None) - self.description = kwargs.get('description', None) - self.environment_id = kwargs.get('environment_id', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.error_threshold = kwargs.get('error_threshold', None) - self.logging_level = kwargs.get('logging_level', None) - self.max_concurrency_per_instance = kwargs.get('max_concurrency_per_instance', None) - self.mini_batch_size = kwargs.get('mini_batch_size', None) - self.model = kwargs.get('model', None) - self.output_action = kwargs.get('output_action', None) - self.output_file_name = kwargs.get('output_file_name', None) - self.properties = kwargs.get('properties', None) - self.retry_settings = kwargs.get('retry_settings', None) + self.code_configuration = kwargs.get("code_configuration", None) + self.compute = kwargs.get("compute", None) + self.description = kwargs.get("description", None) + self.environment_id = kwargs.get("environment_id", None) + self.environment_variables = kwargs.get("environment_variables", None) + self.error_threshold = kwargs.get("error_threshold", None) + self.logging_level = kwargs.get("logging_level", None) + self.max_concurrency_per_instance = kwargs.get( + "max_concurrency_per_instance", None + ) + self.mini_batch_size = kwargs.get("mini_batch_size", None) + self.model = kwargs.get("model", None) + self.output_action = kwargs.get("output_action", None) + self.output_file_name = kwargs.get("output_file_name", None) + self.properties = kwargs.get("properties", None) + self.retry_settings = kwargs.get("retry_settings", None) class PartialBatchDeploymentPartialTrackedResource(msrest.serialization.Model): @@ -10277,18 +10178,18 @@ class PartialBatchDeploymentPartialTrackedResource(msrest.serialization.Model): """ _attribute_map = { - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'PartialBatchDeployment'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "identity": { + "key": "identity", + "type": "PartialManagedServiceIdentity", + }, + "kind": {"key": "kind", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "properties": {"key": "properties", "type": "PartialBatchDeployment"}, + "sku": {"key": "sku", "type": "PartialSku"}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword identity: Managed service identity (system assigned and/or user assigned identities). :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity @@ -10304,13 +10205,15 @@ def __init__( :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] """ - super(PartialBatchDeploymentPartialTrackedResource, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.location = kwargs.get('location', None) - self.properties = kwargs.get('properties', None) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) + super(PartialBatchDeploymentPartialTrackedResource, self).__init__( + **kwargs + ) + self.identity = kwargs.get("identity", None) + self.kind = kwargs.get("kind", None) + self.location = kwargs.get("location", None) + self.properties = kwargs.get("properties", None) + self.sku = kwargs.get("sku", None) + self.tags = kwargs.get("tags", None) class PartialBatchEndpoint(msrest.serialization.Model): @@ -10321,19 +10224,16 @@ class PartialBatchEndpoint(msrest.serialization.Model): """ _attribute_map = { - 'defaults': {'key': 'defaults', 'type': 'BatchEndpointDefaults'}, + "defaults": {"key": "defaults", "type": "BatchEndpointDefaults"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword defaults: Default values for Batch Endpoint. :paramtype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults """ super(PartialBatchEndpoint, self).__init__(**kwargs) - self.defaults = kwargs.get('defaults', None) + self.defaults = kwargs.get("defaults", None) class PartialBatchEndpointPartialTrackedResource(msrest.serialization.Model): @@ -10355,18 +10255,18 @@ class PartialBatchEndpointPartialTrackedResource(msrest.serialization.Model): """ _attribute_map = { - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'PartialBatchEndpoint'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "identity": { + "key": "identity", + "type": "PartialManagedServiceIdentity", + }, + "kind": {"key": "kind", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "properties": {"key": "properties", "type": "PartialBatchEndpoint"}, + "sku": {"key": "sku", "type": "PartialSku"}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword identity: Managed service identity (system assigned and/or user assigned identities). :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity @@ -10382,13 +10282,15 @@ def __init__( :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] """ - super(PartialBatchEndpointPartialTrackedResource, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.location = kwargs.get('location', None) - self.properties = kwargs.get('properties', None) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) + super(PartialBatchEndpointPartialTrackedResource, self).__init__( + **kwargs + ) + self.identity = kwargs.get("identity", None) + self.kind = kwargs.get("kind", None) + self.location = kwargs.get("location", None) + self.properties = kwargs.get("properties", None) + self.sku = kwargs.get("sku", None) + self.tags = kwargs.get("tags", None) class PartialBatchRetrySettings(msrest.serialization.Model): @@ -10401,14 +10303,11 @@ class PartialBatchRetrySettings(msrest.serialization.Model): """ _attribute_map = { - 'max_retries': {'key': 'maxRetries', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "max_retries": {"key": "maxRetries", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword max_retries: Maximum retry count for a mini-batch. :paramtype max_retries: int @@ -10416,8 +10315,8 @@ def __init__( :paramtype timeout: ~datetime.timedelta """ super(PartialBatchRetrySettings, self).__init__(**kwargs) - self.max_retries = kwargs.get('max_retries', None) - self.timeout = kwargs.get('timeout', None) + self.max_retries = kwargs.get("max_retries", None) + self.timeout = kwargs.get("timeout", None) class PartialCodeConfiguration(msrest.serialization.Model): @@ -10430,18 +10329,15 @@ class PartialCodeConfiguration(msrest.serialization.Model): """ _validation = { - 'scoring_script': {'min_length': 1}, + "scoring_script": {"min_length": 1}, } _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'scoring_script': {'key': 'scoringScript', 'type': 'str'}, + "code_id": {"key": "codeId", "type": "str"}, + "scoring_script": {"key": "scoringScript", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword code_id: ARM resource ID of the code asset. :paramtype code_id: str @@ -10449,8 +10345,8 @@ def __init__( :paramtype scoring_script: str """ super(PartialCodeConfiguration, self).__init__(**kwargs) - self.code_id = kwargs.get('code_id', None) - self.scoring_script = kwargs.get('scoring_script', None) + self.code_id = kwargs.get("code_id", None) + self.scoring_script = kwargs.get("scoring_script", None) class PartialDataPathAssetReference(PartialAssetReferenceBase): @@ -10468,19 +10364,16 @@ class PartialDataPathAssetReference(PartialAssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'datastore_id': {'key': 'datastoreId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "datastore_id": {"key": "datastoreId", "type": "str"}, + "path": {"key": "path", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword datastore_id: ARM resource ID of the datastore where the asset is located. :paramtype datastore_id: str @@ -10488,9 +10381,9 @@ def __init__( :paramtype path: str """ super(PartialDataPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'DataPath' # type: str - self.datastore_id = kwargs.get('datastore_id', None) - self.path = kwargs.get('path', None) + self.reference_type = "DataPath" # type: str + self.datastore_id = kwargs.get("datastore_id", None) + self.path = kwargs.get("path", None) class PartialIdAssetReference(PartialAssetReferenceBase): @@ -10506,25 +10399,22 @@ class PartialIdAssetReference(PartialAssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'asset_id': {'key': 'assetId', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "asset_id": {"key": "assetId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword asset_id: ARM resource ID of the asset. :paramtype asset_id: str """ super(PartialIdAssetReference, self).__init__(**kwargs) - self.reference_type = 'Id' # type: str - self.asset_id = kwargs.get('asset_id', None) + self.reference_type = "Id" # type: str + self.asset_id = kwargs.get("asset_id", None) class PartialOnlineDeployment(msrest.serialization.Model): @@ -10542,23 +10432,22 @@ class PartialOnlineDeployment(msrest.serialization.Model): """ _validation = { - 'endpoint_compute_type': {'required': True}, + "endpoint_compute_type": {"required": True}, } _attribute_map = { - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, } _subtype_map = { - 'endpoint_compute_type': {'Kubernetes': 'PartialKubernetesOnlineDeployment', 'Managed': 'PartialManagedOnlineDeployment'} + "endpoint_compute_type": { + "Kubernetes": "PartialKubernetesOnlineDeployment", + "Managed": "PartialManagedOnlineDeployment", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(PartialOnlineDeployment, self).__init__(**kwargs) self.endpoint_compute_type = None # type: Optional[str] @@ -10575,21 +10464,17 @@ class PartialKubernetesOnlineDeployment(PartialOnlineDeployment): """ _validation = { - 'endpoint_compute_type': {'required': True}, + "endpoint_compute_type": {"required": True}, } _attribute_map = { - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(PartialKubernetesOnlineDeployment, self).__init__(**kwargs) - self.endpoint_compute_type = 'Kubernetes' # type: str + self.endpoint_compute_type = "Kubernetes" # type: str class PartialManagedOnlineDeployment(PartialOnlineDeployment): @@ -10604,21 +10489,17 @@ class PartialManagedOnlineDeployment(PartialOnlineDeployment): """ _validation = { - 'endpoint_compute_type': {'required': True}, + "endpoint_compute_type": {"required": True}, } _attribute_map = { - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(PartialManagedOnlineDeployment, self).__init__(**kwargs) - self.endpoint_compute_type = 'Managed' # type: str + self.endpoint_compute_type = "Managed" # type: str class PartialManagedServiceIdentity(msrest.serialization.Model): @@ -10636,14 +10517,14 @@ class PartialManagedServiceIdentity(msrest.serialization.Model): """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{object}'}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{object}", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword type: Managed service identity (system assigned and/or user assigned identities). Possible values include: "None", "SystemAssigned", "UserAssigned", @@ -10656,11 +10537,15 @@ def __init__( :paramtype user_assigned_identities: dict[str, any] """ super(PartialManagedServiceIdentity, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + self.type = kwargs.get("type", None) + self.user_assigned_identities = kwargs.get( + "user_assigned_identities", None + ) -class PartialOnlineDeploymentPartialTrackedResource(msrest.serialization.Model): +class PartialOnlineDeploymentPartialTrackedResource( + msrest.serialization.Model +): """Strictly used in update requests. :ivar identity: Managed service identity (system assigned and/or user assigned identities). @@ -10679,18 +10564,18 @@ class PartialOnlineDeploymentPartialTrackedResource(msrest.serialization.Model): """ _attribute_map = { - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'PartialOnlineDeployment'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "identity": { + "key": "identity", + "type": "PartialManagedServiceIdentity", + }, + "kind": {"key": "kind", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "properties": {"key": "properties", "type": "PartialOnlineDeployment"}, + "sku": {"key": "sku", "type": "PartialSku"}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword identity: Managed service identity (system assigned and/or user assigned identities). :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity @@ -10706,13 +10591,15 @@ def __init__( :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] """ - super(PartialOnlineDeploymentPartialTrackedResource, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.location = kwargs.get('location', None) - self.properties = kwargs.get('properties', None) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) + super(PartialOnlineDeploymentPartialTrackedResource, self).__init__( + **kwargs + ) + self.identity = kwargs.get("identity", None) + self.kind = kwargs.get("kind", None) + self.location = kwargs.get("location", None) + self.properties = kwargs.get("properties", None) + self.sku = kwargs.get("sku", None) + self.tags = kwargs.get("tags", None) class PartialOnlineEndpointPartialTrackedResource(msrest.serialization.Model): @@ -10734,18 +10621,18 @@ class PartialOnlineEndpointPartialTrackedResource(msrest.serialization.Model): """ _attribute_map = { - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'object'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "identity": { + "key": "identity", + "type": "PartialManagedServiceIdentity", + }, + "kind": {"key": "kind", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "properties": {"key": "properties", "type": "object"}, + "sku": {"key": "sku", "type": "PartialSku"}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword identity: Managed service identity (system assigned and/or user assigned identities). :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity @@ -10761,13 +10648,15 @@ def __init__( :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] """ - super(PartialOnlineEndpointPartialTrackedResource, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.location = kwargs.get('location', None) - self.properties = kwargs.get('properties', None) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) + super(PartialOnlineEndpointPartialTrackedResource, self).__init__( + **kwargs + ) + self.identity = kwargs.get("identity", None) + self.kind = kwargs.get("kind", None) + self.location = kwargs.get("location", None) + self.properties = kwargs.get("properties", None) + self.sku = kwargs.get("sku", None) + self.tags = kwargs.get("tags", None) class PartialOutputPathAssetReference(PartialAssetReferenceBase): @@ -10785,19 +10674,16 @@ class PartialOutputPathAssetReference(PartialAssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "job_id": {"key": "jobId", "type": "str"}, + "path": {"key": "path", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword job_id: ARM resource ID of the job. :paramtype job_id: str @@ -10805,9 +10691,9 @@ def __init__( :paramtype path: str """ super(PartialOutputPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'OutputPath' # type: str - self.job_id = kwargs.get('job_id', None) - self.path = kwargs.get('path', None) + self.reference_type = "OutputPath" # type: str + self.job_id = kwargs.get("job_id", None) + self.path = kwargs.get("path", None) class PartialSku(msrest.serialization.Model): @@ -10831,17 +10717,14 @@ class PartialSku(msrest.serialization.Model): """ _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'int'}, - 'family': {'key': 'family', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, + "capacity": {"key": "capacity", "type": "int"}, + "family": {"key": "family", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "size": {"key": "size", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword capacity: If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted. @@ -10860,11 +10743,11 @@ def __init__( :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier """ super(PartialSku, self).__init__(**kwargs) - self.capacity = kwargs.get('capacity', None) - self.family = kwargs.get('family', None) - self.name = kwargs.get('name', None) - self.size = kwargs.get('size', None) - self.tier = kwargs.get('tier', None) + self.capacity = kwargs.get("capacity", None) + self.family = kwargs.get("family", None) + self.name = kwargs.get("name", None) + self.size = kwargs.get("size", None) + self.tier = kwargs.get("tier", None) class Password(msrest.serialization.Model): @@ -10879,27 +10762,25 @@ class Password(msrest.serialization.Model): """ _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, + "name": {"readonly": True}, + "value": {"readonly": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "value": {"key": "value", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Password, self).__init__(**kwargs) self.name = None self.value = None -class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class PATAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """PATAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -10922,22 +10803,22 @@ class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionPersonalAccessToken'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionPersonalAccessToken", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: Category of the connection. Possible values include: "PythonFeed", "ContainerRegistry", "Git". @@ -10953,9 +10834,11 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken """ - super(PATAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'PAT' # type: str - self.credentials = kwargs.get('credentials', None) + super(PATAuthTypeWorkspaceConnectionProperties, self).__init__( + **kwargs + ) + self.auth_type = "PAT" # type: str + self.credentials = kwargs.get("credentials", None) class PersonalComputeInstanceSettings(msrest.serialization.Model): @@ -10966,19 +10849,16 @@ class PersonalComputeInstanceSettings(msrest.serialization.Model): """ _attribute_map = { - 'assigned_user': {'key': 'assignedUser', 'type': 'AssignedUser'}, + "assigned_user": {"key": "assignedUser", "type": "AssignedUser"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword assigned_user: A user explicitly assigned to a personal compute instance. :paramtype assigned_user: ~azure.mgmt.machinelearningservices.models.AssignedUser """ super(PersonalComputeInstanceSettings, self).__init__(**kwargs) - self.assigned_user = kwargs.get('assigned_user', None) + self.assigned_user = kwargs.get("assigned_user", None) class PipelineJob(JobBaseDetails): @@ -11028,32 +10908,29 @@ class PipelineJob(JobBaseDetails): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, + "job_type": {"required": True}, + "status": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'jobs': {'key': 'jobs', 'type': '{object}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'settings': {'key': 'settings', 'type': 'object'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "jobs": {"key": "jobs", "type": "{object}"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "settings": {"key": "settings", "type": "object"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -11087,11 +10964,11 @@ def __init__( :paramtype settings: any """ super(PipelineJob, self).__init__(**kwargs) - self.job_type = 'Pipeline' # type: str - self.inputs = kwargs.get('inputs', None) - self.jobs = kwargs.get('jobs', None) - self.outputs = kwargs.get('outputs', None) - self.settings = kwargs.get('settings', None) + self.job_type = "Pipeline" # type: str + self.inputs = kwargs.get("inputs", None) + self.jobs = kwargs.get("jobs", None) + self.outputs = kwargs.get("outputs", None) + self.settings = kwargs.get("settings", None) class PrivateEndpoint(msrest.serialization.Model): @@ -11106,21 +10983,17 @@ class PrivateEndpoint(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'subnet_arm_id': {'readonly': True}, + "id": {"readonly": True}, + "subnet_arm_id": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'subnet_arm_id': {'key': 'subnetArmId', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "subnet_arm_id": {"key": "subnetArmId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(PrivateEndpoint, self).__init__(**kwargs) self.id = None self.subnet_arm_id = None @@ -11163,31 +11036,37 @@ class PrivateEndpointConnection(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "private_endpoint": { + "key": "properties.privateEndpoint", + "type": "PrivateEndpoint", + }, + "private_link_service_connection_state": { + "key": "properties.privateLinkServiceConnectionState", + "type": "PrivateLinkServiceConnectionState", + }, + "provisioning_state": { + "key": "properties.provisioningState", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword identity: The identity of the resource. :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity @@ -11205,12 +11084,14 @@ def __init__( ~azure.mgmt.machinelearningservices.models.PrivateLinkServiceConnectionState """ super(PrivateEndpointConnection, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) - self.private_endpoint = kwargs.get('private_endpoint', None) - self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + self.identity = kwargs.get("identity", None) + self.location = kwargs.get("location", None) + self.tags = kwargs.get("tags", None) + self.sku = kwargs.get("sku", None) + self.private_endpoint = kwargs.get("private_endpoint", None) + self.private_link_service_connection_state = kwargs.get( + "private_link_service_connection_state", None + ) self.provisioning_state = None @@ -11222,19 +11103,16 @@ class PrivateEndpointConnectionListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + "value": {"key": "value", "type": "[PrivateEndpointConnection]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Array of private endpoint connections. :paramtype value: list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] """ super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class PrivateLinkResource(Resource): @@ -11270,32 +11148,35 @@ class PrivateLinkResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'group_id': {'readonly': True}, - 'required_members': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "group_id": {"readonly": True}, + "required_members": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, - 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "group_id": {"key": "properties.groupId", "type": "str"}, + "required_members": { + "key": "properties.requiredMembers", + "type": "[str]", + }, + "required_zone_names": { + "key": "properties.requiredZoneNames", + "type": "[str]", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword identity: The identity of the resource. :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity @@ -11309,13 +11190,13 @@ def __init__( :paramtype required_zone_names: list[str] """ super(PrivateLinkResource, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) + self.identity = kwargs.get("identity", None) + self.location = kwargs.get("location", None) + self.tags = kwargs.get("tags", None) + self.sku = kwargs.get("sku", None) self.group_id = None self.required_members = None - self.required_zone_names = kwargs.get('required_zone_names', None) + self.required_zone_names = kwargs.get("required_zone_names", None) class PrivateLinkResourceListResult(msrest.serialization.Model): @@ -11326,19 +11207,16 @@ class PrivateLinkResourceListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + "value": {"key": "value", "type": "[PrivateLinkResource]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Array of private link resources. :paramtype value: list[~azure.mgmt.machinelearningservices.models.PrivateLinkResource] """ super(PrivateLinkResourceListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class PrivateLinkServiceConnectionState(msrest.serialization.Model): @@ -11357,15 +11235,12 @@ class PrivateLinkServiceConnectionState(msrest.serialization.Model): """ _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + "status": {"key": "status", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "actions_required": {"key": "actionsRequired", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword status: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Possible values include: "Pending", "Approved", "Rejected", @@ -11379,9 +11254,9 @@ def __init__( :paramtype actions_required: str """ super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.description = kwargs.get('description', None) - self.actions_required = kwargs.get('actions_required', None) + self.status = kwargs.get("status", None) + self.description = kwargs.get("description", None) + self.actions_required = kwargs.get("actions_required", None) class ProbeSettings(msrest.serialization.Model): @@ -11400,17 +11275,14 @@ class ProbeSettings(msrest.serialization.Model): """ _attribute_map = { - 'failure_threshold': {'key': 'failureThreshold', 'type': 'int'}, - 'initial_delay': {'key': 'initialDelay', 'type': 'duration'}, - 'period': {'key': 'period', 'type': 'duration'}, - 'success_threshold': {'key': 'successThreshold', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "failure_threshold": {"key": "failureThreshold", "type": "int"}, + "initial_delay": {"key": "initialDelay", "type": "duration"}, + "period": {"key": "period", "type": "duration"}, + "success_threshold": {"key": "successThreshold", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword failure_threshold: The number of failures to allow before returning an unhealthy status. @@ -11425,11 +11297,11 @@ def __init__( :paramtype timeout: ~datetime.timedelta """ super(ProbeSettings, self).__init__(**kwargs) - self.failure_threshold = kwargs.get('failure_threshold', 30) - self.initial_delay = kwargs.get('initial_delay', None) - self.period = kwargs.get('period', "PT10S") - self.success_threshold = kwargs.get('success_threshold', 1) - self.timeout = kwargs.get('timeout', "PT2S") + self.failure_threshold = kwargs.get("failure_threshold", 30) + self.initial_delay = kwargs.get("initial_delay", None) + self.period = kwargs.get("period", "PT10S") + self.success_threshold = kwargs.get("success_threshold", 1) + self.timeout = kwargs.get("timeout", "PT2S") class PyTorch(DistributionConfiguration): @@ -11445,25 +11317,27 @@ class PyTorch(DistributionConfiguration): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, + "distribution_type": {"key": "distributionType", "type": "str"}, + "process_count_per_instance": { + "key": "processCountPerInstance", + "type": "int", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword process_count_per_instance: Number of processes per node. :paramtype process_count_per_instance: int """ super(PyTorch, self).__init__(**kwargs) - self.distribution_type = 'PyTorch' # type: str - self.process_count_per_instance = kwargs.get('process_count_per_instance', None) + self.distribution_type = "PyTorch" # type: str + self.process_count_per_instance = kwargs.get( + "process_count_per_instance", None + ) class QuotaBaseProperties(msrest.serialization.Model): @@ -11480,16 +11354,13 @@ class QuotaBaseProperties(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "limit": {"key": "limit", "type": "long"}, + "unit": {"key": "unit", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword id: Specifies the resource ID. :paramtype id: str @@ -11502,10 +11373,10 @@ def __init__( :paramtype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit """ super(QuotaBaseProperties, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.type = kwargs.get('type', None) - self.limit = kwargs.get('limit', None) - self.unit = kwargs.get('unit', None) + self.id = kwargs.get("id", None) + self.type = kwargs.get("type", None) + self.limit = kwargs.get("limit", None) + self.unit = kwargs.get("unit", None) class QuotaUpdateParameters(msrest.serialization.Model): @@ -11518,14 +11389,11 @@ class QuotaUpdateParameters(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[QuotaBaseProperties]'}, - 'location': {'key': 'location', 'type': 'str'}, + "value": {"key": "value", "type": "[QuotaBaseProperties]"}, + "location": {"key": "location", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: The list for update quota. :paramtype value: list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] @@ -11533,8 +11401,8 @@ def __init__( :paramtype location: str """ super(QuotaUpdateParameters, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.location = kwargs.get('location', None) + self.value = kwargs.get("value", None) + self.location = kwargs.get("location", None) class RandomSamplingAlgorithm(SamplingAlgorithm): @@ -11554,19 +11422,19 @@ class RandomSamplingAlgorithm(SamplingAlgorithm): """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - 'rule': {'key': 'rule', 'type': 'str'}, - 'seed': {'key': 'seed', 'type': 'int'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, + "rule": {"key": "rule", "type": "str"}, + "seed": {"key": "seed", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword rule: The specific type of random algorithm. Possible values include: "Random", "Sobol". @@ -11575,9 +11443,9 @@ def __init__( :paramtype seed: int """ super(RandomSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Random' # type: str - self.rule = kwargs.get('rule', None) - self.seed = kwargs.get('seed', None) + self.sampling_algorithm_type = "Random" # type: str + self.rule = kwargs.get("rule", None) + self.seed = kwargs.get("seed", None) class RecurrencePattern(msrest.serialization.Model): @@ -11594,20 +11462,17 @@ class RecurrencePattern(msrest.serialization.Model): """ _validation = { - 'hours': {'required': True}, - 'minutes': {'required': True}, + "hours": {"required": True}, + "minutes": {"required": True}, } _attribute_map = { - 'hours': {'key': 'hours', 'type': '[int]'}, - 'minutes': {'key': 'minutes', 'type': '[int]'}, - 'weekdays': {'key': 'weekdays', 'type': '[str]'}, + "hours": {"key": "hours", "type": "[int]"}, + "minutes": {"key": "minutes", "type": "[int]"}, + "weekdays": {"key": "weekdays", "type": "[str]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword hours: Required. [Required] List of hours for recurrence schedule pattern. :paramtype hours: list[int] @@ -11617,9 +11482,9 @@ def __init__( :paramtype weekdays: list[str or ~azure.mgmt.machinelearningservices.models.Weekday] """ super(RecurrencePattern, self).__init__(**kwargs) - self.hours = kwargs['hours'] - self.minutes = kwargs['minutes'] - self.weekdays = kwargs.get('weekdays', None) + self.hours = kwargs["hours"] + self.minutes = kwargs["minutes"] + self.weekdays = kwargs.get("weekdays", None) class RecurrenceSchedule(ScheduleBase): @@ -11651,26 +11516,23 @@ class RecurrenceSchedule(ScheduleBase): """ _validation = { - 'schedule_type': {'required': True}, - 'frequency': {'required': True}, - 'interval': {'required': True}, + "schedule_type": {"required": True}, + "frequency": {"required": True}, + "interval": {"required": True}, } _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'schedule_status': {'key': 'scheduleStatus', 'type': 'str'}, - 'schedule_type': {'key': 'scheduleType', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'pattern': {'key': 'pattern', 'type': 'RecurrencePattern'}, + "end_time": {"key": "endTime", "type": "iso-8601"}, + "schedule_status": {"key": "scheduleStatus", "type": "str"}, + "schedule_type": {"key": "scheduleType", "type": "str"}, + "start_time": {"key": "startTime", "type": "iso-8601"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "frequency": {"key": "frequency", "type": "str"}, + "interval": {"key": "interval", "type": "int"}, + "pattern": {"key": "pattern", "type": "RecurrencePattern"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword end_time: Specifies end time of schedule in ISO 8601 format. If not present, the schedule will run indefinitely. @@ -11693,10 +11555,10 @@ def __init__( :paramtype pattern: ~azure.mgmt.machinelearningservices.models.RecurrencePattern """ super(RecurrenceSchedule, self).__init__(**kwargs) - self.schedule_type = 'Recurrence' # type: str - self.frequency = kwargs['frequency'] - self.interval = kwargs['interval'] - self.pattern = kwargs.get('pattern', None) + self.schedule_type = "Recurrence" # type: str + self.frequency = kwargs["frequency"] + self.interval = kwargs["interval"] + self.pattern = kwargs.get("pattern", None) class RegenerateEndpointKeysRequest(msrest.serialization.Model): @@ -11712,18 +11574,15 @@ class RegenerateEndpointKeysRequest(msrest.serialization.Model): """ _validation = { - 'key_type': {'required': True}, + "key_type": {"required": True}, } _attribute_map = { - 'key_type': {'key': 'keyType', 'type': 'str'}, - 'key_value': {'key': 'keyValue', 'type': 'str'}, + "key_type": {"key": "keyType", "type": "str"}, + "key_value": {"key": "keyValue", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword key_type: Required. [Required] Specification for which type of key to generate. Primary or Secondary. Possible values include: "Primary", "Secondary". @@ -11732,8 +11591,8 @@ def __init__( :paramtype key_value: str """ super(RegenerateEndpointKeysRequest, self).__init__(**kwargs) - self.key_type = kwargs['key_type'] - self.key_value = kwargs.get('key_value', None) + self.key_type = kwargs["key_type"] + self.key_value = kwargs.get("key_value", None) class RegistryListCredentialsResult(msrest.serialization.Model): @@ -11750,20 +11609,17 @@ class RegistryListCredentialsResult(msrest.serialization.Model): """ _validation = { - 'location': {'readonly': True}, - 'username': {'readonly': True}, + "location": {"readonly": True}, + "username": {"readonly": True}, } _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'username': {'key': 'username', 'type': 'str'}, - 'passwords': {'key': 'passwords', 'type': '[Password]'}, + "location": {"key": "location", "type": "str"}, + "username": {"key": "username", "type": "str"}, + "passwords": {"key": "passwords", "type": "[Password]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword passwords: :paramtype passwords: list[~azure.mgmt.machinelearningservices.models.Password] @@ -11771,7 +11627,7 @@ def __init__( super(RegistryListCredentialsResult, self).__init__(**kwargs) self.location = None self.username = None - self.passwords = kwargs.get('passwords', None) + self.passwords = kwargs.get("passwords", None) class ResourceConfiguration(msrest.serialization.Model): @@ -11786,15 +11642,12 @@ class ResourceConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "properties": {"key": "properties", "type": "{object}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword instance_count: Optional number of instances or nodes used by the compute target. :paramtype instance_count: int @@ -11804,9 +11657,9 @@ def __init__( :paramtype properties: dict[str, any] """ super(ResourceConfiguration, self).__init__(**kwargs) - self.instance_count = kwargs.get('instance_count', 1) - self.instance_type = kwargs.get('instance_type', None) - self.properties = kwargs.get('properties', None) + self.instance_count = kwargs.get("instance_count", 1) + self.instance_type = kwargs.get("instance_type", None) + self.properties = kwargs.get("properties", None) class ResourceId(msrest.serialization.Model): @@ -11819,23 +11672,20 @@ class ResourceId(msrest.serialization.Model): """ _validation = { - 'id': {'required': True}, + "id": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword id: Required. The ID of the resource. :paramtype id: str """ super(ResourceId, self).__init__(**kwargs) - self.id = kwargs['id'] + self.id = kwargs["id"] class ResourceName(msrest.serialization.Model): @@ -11850,21 +11700,17 @@ class ResourceName(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, + "value": {"readonly": True}, + "localized_value": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + "value": {"key": "value", "type": "str"}, + "localized_value": {"key": "localizedValue", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ResourceName, self).__init__(**kwargs) self.value = None self.localized_value = None @@ -11890,29 +11736,28 @@ class ResourceQuota(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'name': {'readonly': True}, - 'limit': {'readonly': True}, - 'unit': {'readonly': True}, + "id": {"readonly": True}, + "aml_workspace_location": {"readonly": True}, + "type": {"readonly": True}, + "name": {"readonly": True}, + "limit": {"readonly": True}, + "unit": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'ResourceName'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "aml_workspace_location": { + "key": "amlWorkspaceLocation", + "type": "str", + }, + "type": {"key": "type", "type": "str"}, + "name": {"key": "name", "type": "ResourceName"}, + "limit": {"key": "limit", "type": "long"}, + "unit": {"key": "unit", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ResourceQuota, self).__init__(**kwargs) self.id = None self.aml_workspace_location = None @@ -11934,19 +11779,16 @@ class Route(msrest.serialization.Model): """ _validation = { - 'path': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'port': {'required': True}, + "path": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "port": {"required": True}, } _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, + "path": {"key": "path", "type": "str"}, + "port": {"key": "port", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword path: Required. [Required] The path for the route. :paramtype path: str @@ -11954,11 +11796,13 @@ def __init__( :paramtype port: int """ super(Route, self).__init__(**kwargs) - self.path = kwargs['path'] - self.port = kwargs['port'] + self.path = kwargs["path"] + self.port = kwargs["port"] -class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class SASAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """SASAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -11981,22 +11825,22 @@ class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionSharedAccessSignature'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionSharedAccessSignature", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: Category of the connection. Possible values include: "PythonFeed", "ContainerRegistry", "Git". @@ -12012,9 +11856,11 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature """ - super(SASAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'SAS' # type: str - self.credentials = kwargs.get('credentials', None) + super(SASAuthTypeWorkspaceConnectionProperties, self).__init__( + **kwargs + ) + self.auth_type = "SAS" # type: str + self.credentials = kwargs.get("credentials", None) class SasDatastoreCredentials(DatastoreCredentials): @@ -12031,26 +11877,23 @@ class SasDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, + "credentials_type": {"required": True}, + "secrets": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'SasDatastoreSecrets'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "secrets": {"key": "secrets", "type": "SasDatastoreSecrets"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword secrets: Required. [Required] Storage container secrets. :paramtype secrets: ~azure.mgmt.machinelearningservices.models.SasDatastoreSecrets """ super(SasDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Sas' # type: str - self.secrets = kwargs['secrets'] + self.credentials_type = "Sas" # type: str + self.secrets = kwargs["secrets"] class SasDatastoreSecrets(DatastoreSecrets): @@ -12067,25 +11910,22 @@ class SasDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'sas_token': {'key': 'sasToken', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "sas_token": {"key": "sasToken", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword sas_token: Storage container SAS token. :paramtype sas_token: str """ super(SasDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Sas' # type: str - self.sas_token = kwargs.get('sas_token', None) + self.secrets_type = "Sas" # type: str + self.sas_token = kwargs.get("sas_token", None) class ScaleSettings(msrest.serialization.Model): @@ -12103,19 +11943,19 @@ class ScaleSettings(msrest.serialization.Model): """ _validation = { - 'max_node_count': {'required': True}, + "max_node_count": {"required": True}, } _attribute_map = { - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'node_idle_time_before_scale_down': {'key': 'nodeIdleTimeBeforeScaleDown', 'type': 'duration'}, + "max_node_count": {"key": "maxNodeCount", "type": "int"}, + "min_node_count": {"key": "minNodeCount", "type": "int"}, + "node_idle_time_before_scale_down": { + "key": "nodeIdleTimeBeforeScaleDown", + "type": "duration", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword max_node_count: Required. Max number of nodes to use. :paramtype max_node_count: int @@ -12126,9 +11966,11 @@ def __init__( :paramtype node_idle_time_before_scale_down: ~datetime.timedelta """ super(ScaleSettings, self).__init__(**kwargs) - self.max_node_count = kwargs['max_node_count'] - self.min_node_count = kwargs.get('min_node_count', 0) - self.node_idle_time_before_scale_down = kwargs.get('node_idle_time_before_scale_down', None) + self.max_node_count = kwargs["max_node_count"] + self.min_node_count = kwargs.get("min_node_count", 0) + self.node_idle_time_before_scale_down = kwargs.get( + "node_idle_time_before_scale_down", None + ) class ScaleSettingsInformation(msrest.serialization.Model): @@ -12139,19 +11981,16 @@ class ScaleSettingsInformation(msrest.serialization.Model): """ _attribute_map = { - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, + "scale_settings": {"key": "scaleSettings", "type": "ScaleSettings"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword scale_settings: scale settings for AML Compute. :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings """ super(ScaleSettingsInformation, self).__init__(**kwargs) - self.scale_settings = kwargs.get('scale_settings', None) + self.scale_settings = kwargs.get("scale_settings", None) class ScriptReference(msrest.serialization.Model): @@ -12168,16 +12007,13 @@ class ScriptReference(msrest.serialization.Model): """ _attribute_map = { - 'script_source': {'key': 'scriptSource', 'type': 'str'}, - 'script_data': {'key': 'scriptData', 'type': 'str'}, - 'script_arguments': {'key': 'scriptArguments', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'str'}, + "script_source": {"key": "scriptSource", "type": "str"}, + "script_data": {"key": "scriptData", "type": "str"}, + "script_arguments": {"key": "scriptArguments", "type": "str"}, + "timeout": {"key": "timeout", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword script_source: The storage source of the script: inline, workspace. :paramtype script_source: str @@ -12189,10 +12025,10 @@ def __init__( :paramtype timeout: str """ super(ScriptReference, self).__init__(**kwargs) - self.script_source = kwargs.get('script_source', None) - self.script_data = kwargs.get('script_data', None) - self.script_arguments = kwargs.get('script_arguments', None) - self.timeout = kwargs.get('timeout', None) + self.script_source = kwargs.get("script_source", None) + self.script_data = kwargs.get("script_data", None) + self.script_arguments = kwargs.get("script_arguments", None) + self.timeout = kwargs.get("timeout", None) class ScriptsToExecute(msrest.serialization.Model): @@ -12205,14 +12041,14 @@ class ScriptsToExecute(msrest.serialization.Model): """ _attribute_map = { - 'startup_script': {'key': 'startupScript', 'type': 'ScriptReference'}, - 'creation_script': {'key': 'creationScript', 'type': 'ScriptReference'}, + "startup_script": {"key": "startupScript", "type": "ScriptReference"}, + "creation_script": { + "key": "creationScript", + "type": "ScriptReference", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword startup_script: Script that's run every time the machine starts. :paramtype startup_script: ~azure.mgmt.machinelearningservices.models.ScriptReference @@ -12220,8 +12056,8 @@ def __init__( :paramtype creation_script: ~azure.mgmt.machinelearningservices.models.ScriptReference """ super(ScriptsToExecute, self).__init__(**kwargs) - self.startup_script = kwargs.get('startup_script', None) - self.creation_script = kwargs.get('creation_script', None) + self.startup_script = kwargs.get("startup_script", None) + self.creation_script = kwargs.get("creation_script", None) class ServiceManagedResourcesSettings(msrest.serialization.Model): @@ -12232,19 +12068,16 @@ class ServiceManagedResourcesSettings(msrest.serialization.Model): """ _attribute_map = { - 'cosmos_db': {'key': 'cosmosDb', 'type': 'CosmosDbSettings'}, + "cosmos_db": {"key": "cosmosDb", "type": "CosmosDbSettings"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword cosmos_db: The settings for the service managed cosmosdb account. :paramtype cosmos_db: ~azure.mgmt.machinelearningservices.models.CosmosDbSettings """ super(ServiceManagedResourcesSettings, self).__init__(**kwargs) - self.cosmos_db = kwargs.get('cosmos_db', None) + self.cosmos_db = kwargs.get("cosmos_db", None) class ServicePrincipalDatastoreCredentials(DatastoreCredentials): @@ -12269,25 +12102,25 @@ class ServicePrincipalDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, + "credentials_type": {"required": True}, + "client_id": {"required": True}, + "secrets": {"required": True}, + "tenant_id": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'ServicePrincipalDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "authority_url": {"key": "authorityUrl", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + "resource_url": {"key": "resourceUrl", "type": "str"}, + "secrets": { + "key": "secrets", + "type": "ServicePrincipalDatastoreSecrets", + }, + "tenant_id": {"key": "tenantId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword authority_url: Authority URL used for authentication. :paramtype authority_url: str @@ -12302,12 +12135,12 @@ def __init__( :paramtype tenant_id: str """ super(ServicePrincipalDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'ServicePrincipal' # type: str - self.authority_url = kwargs.get('authority_url', None) - self.client_id = kwargs['client_id'] - self.resource_url = kwargs.get('resource_url', None) - self.secrets = kwargs['secrets'] - self.tenant_id = kwargs['tenant_id'] + self.credentials_type = "ServicePrincipal" # type: str + self.authority_url = kwargs.get("authority_url", None) + self.client_id = kwargs["client_id"] + self.resource_url = kwargs.get("resource_url", None) + self.secrets = kwargs["secrets"] + self.tenant_id = kwargs["tenant_id"] class ServicePrincipalDatastoreSecrets(DatastoreSecrets): @@ -12324,25 +12157,22 @@ class ServicePrincipalDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "client_secret": {"key": "clientSecret", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword client_secret: Service principal secret. :paramtype client_secret: str """ super(ServicePrincipalDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'ServicePrincipal' # type: str - self.client_secret = kwargs.get('client_secret', None) + self.secrets_type = "ServicePrincipal" # type: str + self.client_secret = kwargs.get("client_secret", None) class SetupScripts(msrest.serialization.Model): @@ -12353,19 +12183,16 @@ class SetupScripts(msrest.serialization.Model): """ _attribute_map = { - 'scripts': {'key': 'scripts', 'type': 'ScriptsToExecute'}, + "scripts": {"key": "scripts", "type": "ScriptsToExecute"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword scripts: Customized setup scripts. :paramtype scripts: ~azure.mgmt.machinelearningservices.models.ScriptsToExecute """ super(SetupScripts, self).__init__(**kwargs) - self.scripts = kwargs.get('scripts', None) + self.scripts = kwargs.get("scripts", None) class SharedPrivateLinkResource(msrest.serialization.Model): @@ -12387,17 +12214,17 @@ class SharedPrivateLinkResource(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'private_link_resource_id': {'key': 'properties.privateLinkResourceId', 'type': 'str'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'request_message': {'key': 'properties.requestMessage', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "private_link_resource_id": { + "key": "properties.privateLinkResourceId", + "type": "str", + }, + "group_id": {"key": "properties.groupId", "type": "str"}, + "request_message": {"key": "properties.requestMessage", "type": "str"}, + "status": {"key": "properties.status", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: Unique name of the private link. :paramtype name: str @@ -12414,11 +12241,13 @@ def __init__( ~azure.mgmt.machinelearningservices.models.PrivateEndpointServiceConnectionStatus """ super(SharedPrivateLinkResource, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.private_link_resource_id = kwargs.get('private_link_resource_id', None) - self.group_id = kwargs.get('group_id', None) - self.request_message = kwargs.get('request_message', None) - self.status = kwargs.get('status', None) + self.name = kwargs.get("name", None) + self.private_link_resource_id = kwargs.get( + "private_link_resource_id", None + ) + self.group_id = kwargs.get("group_id", None) + self.request_message = kwargs.get("request_message", None) + self.status = kwargs.get("status", None) class Sku(msrest.serialization.Model): @@ -12444,21 +12273,18 @@ class Sku(msrest.serialization.Model): """ _validation = { - 'name': {'required': True}, + "name": {"required": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'int'}, + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, + "size": {"key": "size", "type": "str"}, + "family": {"key": "family", "type": "str"}, + "capacity": {"key": "capacity", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code. :paramtype name: str @@ -12477,11 +12303,11 @@ def __init__( :paramtype capacity: int """ super(Sku, self).__init__(**kwargs) - self.name = kwargs['name'] - self.tier = kwargs.get('tier', None) - self.size = kwargs.get('size', None) - self.family = kwargs.get('family', None) - self.capacity = kwargs.get('capacity', None) + self.name = kwargs["name"] + self.tier = kwargs.get("tier", None) + self.size = kwargs.get("size", None) + self.family = kwargs.get("family", None) + self.capacity = kwargs.get("capacity", None) class SkuCapacity(msrest.serialization.Model): @@ -12499,16 +12325,13 @@ class SkuCapacity(msrest.serialization.Model): """ _attribute_map = { - 'default': {'key': 'default', 'type': 'int'}, - 'maximum': {'key': 'maximum', 'type': 'int'}, - 'minimum': {'key': 'minimum', 'type': 'int'}, - 'scale_type': {'key': 'scaleType', 'type': 'str'}, + "default": {"key": "default", "type": "int"}, + "maximum": {"key": "maximum", "type": "int"}, + "minimum": {"key": "minimum", "type": "int"}, + "scale_type": {"key": "scaleType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword default: Gets or sets the default capacity. :paramtype default: int @@ -12521,10 +12344,10 @@ def __init__( :paramtype scale_type: str or ~azure.mgmt.machinelearningservices.models.SkuScaleType """ super(SkuCapacity, self).__init__(**kwargs) - self.default = kwargs.get('default', 0) - self.maximum = kwargs.get('maximum', 0) - self.minimum = kwargs.get('minimum', 0) - self.scale_type = kwargs.get('scale_type', None) + self.default = kwargs.get("default", 0) + self.maximum = kwargs.get("maximum", 0) + self.minimum = kwargs.get("minimum", 0) + self.scale_type = kwargs.get("scale_type", None) class SkuResource(msrest.serialization.Model): @@ -12541,19 +12364,16 @@ class SkuResource(msrest.serialization.Model): """ _validation = { - 'resource_type': {'readonly': True}, + "resource_type": {"readonly": True}, } _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'SkuSetting'}, + "capacity": {"key": "capacity", "type": "SkuCapacity"}, + "resource_type": {"key": "resourceType", "type": "str"}, + "sku": {"key": "sku", "type": "SkuSetting"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword capacity: Gets or sets the Sku Capacity. :paramtype capacity: ~azure.mgmt.machinelearningservices.models.SkuCapacity @@ -12561,9 +12381,9 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.SkuSetting """ super(SkuResource, self).__init__(**kwargs) - self.capacity = kwargs.get('capacity', None) + self.capacity = kwargs.get("capacity", None) self.resource_type = None - self.sku = kwargs.get('sku', None) + self.sku = kwargs.get("sku", None) class SkuResourceArmPaginatedResult(msrest.serialization.Model): @@ -12577,14 +12397,11 @@ class SkuResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[SkuResource]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[SkuResource]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of SkuResource objects. If null, there are no additional pages. @@ -12593,8 +12410,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.SkuResource] """ super(SkuResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class SkuSetting(msrest.serialization.Model): @@ -12612,18 +12429,15 @@ class SkuSetting(msrest.serialization.Model): """ _validation = { - 'name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: Required. [Required] The name of the SKU. Ex - P3. It is typically a letter+number code. @@ -12634,8 +12448,8 @@ def __init__( :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier """ super(SkuSetting, self).__init__(**kwargs) - self.name = kwargs['name'] - self.tier = kwargs.get('tier', None) + self.name = kwargs["name"] + self.tier = kwargs.get("tier", None) class SslConfiguration(msrest.serialization.Model): @@ -12657,18 +12471,18 @@ class SslConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'cert': {'key': 'cert', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - 'cname': {'key': 'cname', 'type': 'str'}, - 'leaf_domain_label': {'key': 'leafDomainLabel', 'type': 'str'}, - 'overwrite_existing_domain': {'key': 'overwriteExistingDomain', 'type': 'bool'}, + "status": {"key": "status", "type": "str"}, + "cert": {"key": "cert", "type": "str"}, + "key": {"key": "key", "type": "str"}, + "cname": {"key": "cname", "type": "str"}, + "leaf_domain_label": {"key": "leafDomainLabel", "type": "str"}, + "overwrite_existing_domain": { + "key": "overwriteExistingDomain", + "type": "bool", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword status: Enable or disable ssl for scoring. Possible values include: "Disabled", "Enabled", "Auto". @@ -12685,12 +12499,14 @@ def __init__( :paramtype overwrite_existing_domain: bool """ super(SslConfiguration, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.cert = kwargs.get('cert', None) - self.key = kwargs.get('key', None) - self.cname = kwargs.get('cname', None) - self.leaf_domain_label = kwargs.get('leaf_domain_label', None) - self.overwrite_existing_domain = kwargs.get('overwrite_existing_domain', None) + self.status = kwargs.get("status", None) + self.cert = kwargs.get("cert", None) + self.key = kwargs.get("key", None) + self.cname = kwargs.get("cname", None) + self.leaf_domain_label = kwargs.get("leaf_domain_label", None) + self.overwrite_existing_domain = kwargs.get( + "overwrite_existing_domain", None + ) class SweepJob(JobBaseDetails): @@ -12750,40 +12566,43 @@ class SweepJob(JobBaseDetails): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'objective': {'required': True}, - 'sampling_algorithm': {'required': True}, - 'search_space': {'required': True}, - 'trial': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'SweepJobLimits'}, - 'objective': {'key': 'objective', 'type': 'Objective'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'SamplingAlgorithm'}, - 'search_space': {'key': 'searchSpace', 'type': 'object'}, - 'trial': {'key': 'trial', 'type': 'TrialComponent'}, - } - - def __init__( - self, - **kwargs - ): + "job_type": {"required": True}, + "status": {"readonly": True}, + "objective": {"required": True}, + "sampling_algorithm": {"required": True}, + "search_space": {"required": True}, + "trial": {"required": True}, + } + + _attribute_map = { + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "limits": {"key": "limits", "type": "SweepJobLimits"}, + "objective": {"key": "objective", "type": "Objective"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "sampling_algorithm": { + "key": "samplingAlgorithm", + "type": "SamplingAlgorithm", + }, + "search_space": {"key": "searchSpace", "type": "object"}, + "trial": {"key": "trial", "type": "TrialComponent"}, + } + + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -12827,15 +12646,15 @@ def __init__( :paramtype trial: ~azure.mgmt.machinelearningservices.models.TrialComponent """ super(SweepJob, self).__init__(**kwargs) - self.job_type = 'Sweep' # type: str - self.early_termination = kwargs.get('early_termination', None) - self.inputs = kwargs.get('inputs', None) - self.limits = kwargs.get('limits', None) - self.objective = kwargs['objective'] - self.outputs = kwargs.get('outputs', None) - self.sampling_algorithm = kwargs['sampling_algorithm'] - self.search_space = kwargs['search_space'] - self.trial = kwargs['trial'] + self.job_type = "Sweep" # type: str + self.early_termination = kwargs.get("early_termination", None) + self.inputs = kwargs.get("inputs", None) + self.limits = kwargs.get("limits", None) + self.objective = kwargs["objective"] + self.outputs = kwargs.get("outputs", None) + self.sampling_algorithm = kwargs["sampling_algorithm"] + self.search_space = kwargs["search_space"] + self.trial = kwargs["trial"] class SweepJobLimits(JobLimits): @@ -12858,21 +12677,18 @@ class SweepJobLimits(JobLimits): """ _validation = { - 'job_limits_type': {'required': True}, + "job_limits_type": {"required": True}, } _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_total_trials': {'key': 'maxTotalTrials', 'type': 'int'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, + "job_limits_type": {"key": "jobLimitsType", "type": "str"}, + "timeout": {"key": "timeout", "type": "duration"}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_total_trials": {"key": "maxTotalTrials", "type": "int"}, + "trial_timeout": {"key": "trialTimeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. Only supports duration with precision as low as Seconds. @@ -12885,10 +12701,10 @@ def __init__( :paramtype trial_timeout: ~datetime.timedelta """ super(SweepJobLimits, self).__init__(**kwargs) - self.job_limits_type = 'Sweep' # type: str - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', None) - self.max_total_trials = kwargs.get('max_total_trials', None) - self.trial_timeout = kwargs.get('trial_timeout', None) + self.job_limits_type = "Sweep" # type: str + self.max_concurrent_trials = kwargs.get("max_concurrent_trials", None) + self.max_total_trials = kwargs.get("max_total_trials", None) + self.trial_timeout = kwargs.get("trial_timeout", None) class SynapseSpark(Compute): @@ -12930,33 +12746,33 @@ class SynapseSpark(Compute): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'SynapseSparkProperties'}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, + "properties": {"key": "properties", "type": "SynapseSparkProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The description of the Machine Learning compute. :paramtype description: str @@ -12969,8 +12785,8 @@ def __init__( :paramtype properties: ~azure.mgmt.machinelearningservices.models.SynapseSparkProperties """ super(SynapseSpark, self).__init__(**kwargs) - self.compute_type = 'SynapseSpark' # type: str - self.properties = kwargs.get('properties', None) + self.compute_type = "SynapseSpark" # type: str + self.properties = kwargs.get("properties", None) class SynapseSparkProperties(msrest.serialization.Model): @@ -12999,22 +12815,25 @@ class SynapseSparkProperties(msrest.serialization.Model): """ _attribute_map = { - 'auto_scale_properties': {'key': 'autoScaleProperties', 'type': 'AutoScaleProperties'}, - 'auto_pause_properties': {'key': 'autoPauseProperties', 'type': 'AutoPauseProperties'}, - 'spark_version': {'key': 'sparkVersion', 'type': 'str'}, - 'node_count': {'key': 'nodeCount', 'type': 'int'}, - 'node_size': {'key': 'nodeSize', 'type': 'str'}, - 'node_size_family': {'key': 'nodeSizeFamily', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'workspace_name': {'key': 'workspaceName', 'type': 'str'}, - 'pool_name': {'key': 'poolName', 'type': 'str'}, + "auto_scale_properties": { + "key": "autoScaleProperties", + "type": "AutoScaleProperties", + }, + "auto_pause_properties": { + "key": "autoPauseProperties", + "type": "AutoPauseProperties", + }, + "spark_version": {"key": "sparkVersion", "type": "str"}, + "node_count": {"key": "nodeCount", "type": "int"}, + "node_size": {"key": "nodeSize", "type": "str"}, + "node_size_family": {"key": "nodeSizeFamily", "type": "str"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, + "resource_group": {"key": "resourceGroup", "type": "str"}, + "workspace_name": {"key": "workspaceName", "type": "str"}, + "pool_name": {"key": "poolName", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword auto_scale_properties: Auto scale properties. :paramtype auto_scale_properties: @@ -13040,16 +12859,16 @@ def __init__( :paramtype pool_name: str """ super(SynapseSparkProperties, self).__init__(**kwargs) - self.auto_scale_properties = kwargs.get('auto_scale_properties', None) - self.auto_pause_properties = kwargs.get('auto_pause_properties', None) - self.spark_version = kwargs.get('spark_version', None) - self.node_count = kwargs.get('node_count', None) - self.node_size = kwargs.get('node_size', None) - self.node_size_family = kwargs.get('node_size_family', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.resource_group = kwargs.get('resource_group', None) - self.workspace_name = kwargs.get('workspace_name', None) - self.pool_name = kwargs.get('pool_name', None) + self.auto_scale_properties = kwargs.get("auto_scale_properties", None) + self.auto_pause_properties = kwargs.get("auto_pause_properties", None) + self.spark_version = kwargs.get("spark_version", None) + self.node_count = kwargs.get("node_count", None) + self.node_size = kwargs.get("node_size", None) + self.node_size_family = kwargs.get("node_size_family", None) + self.subscription_id = kwargs.get("subscription_id", None) + self.resource_group = kwargs.get("resource_group", None) + self.workspace_name = kwargs.get("workspace_name", None) + self.pool_name = kwargs.get("pool_name", None) class SystemData(msrest.serialization.Model): @@ -13072,18 +12891,15 @@ class SystemData(msrest.serialization.Model): """ _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + "created_by": {"key": "createdBy", "type": "str"}, + "created_by_type": {"key": "createdByType", "type": "str"}, + "created_at": {"key": "createdAt", "type": "iso-8601"}, + "last_modified_by": {"key": "lastModifiedBy", "type": "str"}, + "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"}, + "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword created_by: The identity that created the resource. :paramtype created_by: str @@ -13102,12 +12918,12 @@ def __init__( :paramtype last_modified_at: ~datetime.datetime """ super(SystemData, self).__init__(**kwargs) - self.created_by = kwargs.get('created_by', None) - self.created_by_type = kwargs.get('created_by_type', None) - self.created_at = kwargs.get('created_at', None) - self.last_modified_by = kwargs.get('last_modified_by', None) - self.last_modified_by_type = kwargs.get('last_modified_by_type', None) - self.last_modified_at = kwargs.get('last_modified_at', None) + self.created_by = kwargs.get("created_by", None) + self.created_by_type = kwargs.get("created_by_type", None) + self.created_at = kwargs.get("created_at", None) + self.last_modified_by = kwargs.get("last_modified_by", None) + self.last_modified_by_type = kwargs.get("last_modified_by_type", None) + self.last_modified_at = kwargs.get("last_modified_at", None) class SystemService(msrest.serialization.Model): @@ -13124,23 +12940,19 @@ class SystemService(msrest.serialization.Model): """ _validation = { - 'system_service_type': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'version': {'readonly': True}, + "system_service_type": {"readonly": True}, + "public_ip_address": {"readonly": True}, + "version": {"readonly": True}, } _attribute_map = { - 'system_service_type': {'key': 'systemServiceType', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, + "system_service_type": {"key": "systemServiceType", "type": "str"}, + "public_ip_address": {"key": "publicIpAddress", "type": "str"}, + "version": {"key": "version", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(SystemService, self).__init__(**kwargs) self.system_service_type = None self.public_ip_address = None @@ -13168,21 +12980,21 @@ class TargetUtilizationScaleSettings(OnlineScaleSettings): """ _validation = { - 'scale_type': {'required': True}, + "scale_type": {"required": True}, } _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - 'max_instances': {'key': 'maxInstances', 'type': 'int'}, - 'min_instances': {'key': 'minInstances', 'type': 'int'}, - 'polling_interval': {'key': 'pollingInterval', 'type': 'duration'}, - 'target_utilization_percentage': {'key': 'targetUtilizationPercentage', 'type': 'int'}, + "scale_type": {"key": "scaleType", "type": "str"}, + "max_instances": {"key": "maxInstances", "type": "int"}, + "min_instances": {"key": "minInstances", "type": "int"}, + "polling_interval": {"key": "pollingInterval", "type": "duration"}, + "target_utilization_percentage": { + "key": "targetUtilizationPercentage", + "type": "int", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword max_instances: The maximum number of instances that the deployment can scale to. The quota will be reserved for max_instances. @@ -13196,11 +13008,13 @@ def __init__( :paramtype target_utilization_percentage: int """ super(TargetUtilizationScaleSettings, self).__init__(**kwargs) - self.scale_type = 'TargetUtilization' # type: str - self.max_instances = kwargs.get('max_instances', 1) - self.min_instances = kwargs.get('min_instances', 1) - self.polling_interval = kwargs.get('polling_interval', "PT1S") - self.target_utilization_percentage = kwargs.get('target_utilization_percentage', 70) + self.scale_type = "TargetUtilization" # type: str + self.max_instances = kwargs.get("max_instances", 1) + self.min_instances = kwargs.get("min_instances", 1) + self.polling_interval = kwargs.get("polling_interval", "PT1S") + self.target_utilization_percentage = kwargs.get( + "target_utilization_percentage", 70 + ) class TensorFlow(DistributionConfiguration): @@ -13218,19 +13032,19 @@ class TensorFlow(DistributionConfiguration): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'parameter_server_count': {'key': 'parameterServerCount', 'type': 'int'}, - 'worker_count': {'key': 'workerCount', 'type': 'int'}, + "distribution_type": {"key": "distributionType", "type": "str"}, + "parameter_server_count": { + "key": "parameterServerCount", + "type": "int", + }, + "worker_count": {"key": "workerCount", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword parameter_server_count: Number of parameter server tasks. :paramtype parameter_server_count: int @@ -13238,9 +13052,9 @@ def __init__( :paramtype worker_count: int """ super(TensorFlow, self).__init__(**kwargs) - self.distribution_type = 'TensorFlow' # type: str - self.parameter_server_count = kwargs.get('parameter_server_count', 0) - self.worker_count = kwargs.get('worker_count', None) + self.distribution_type = "TensorFlow" # type: str + self.parameter_server_count = kwargs.get("parameter_server_count", 0) + self.worker_count = kwargs.get("worker_count", None) class TrialComponent(msrest.serialization.Model): @@ -13266,23 +13080,30 @@ class TrialComponent(msrest.serialization.Model): """ _validation = { - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "command": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "environment_id": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'ResourceConfiguration'}, + "code_id": {"key": "codeId", "type": "str"}, + "command": {"key": "command", "type": "str"}, + "distribution": { + "key": "distribution", + "type": "DistributionConfiguration", + }, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "resources": {"key": "resources", "type": "ResourceConfiguration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword code_id: ARM resource ID of the code asset. :paramtype code_id: str @@ -13301,12 +13122,12 @@ def __init__( :paramtype resources: ~azure.mgmt.machinelearningservices.models.ResourceConfiguration """ super(TrialComponent, self).__init__(**kwargs) - self.code_id = kwargs.get('code_id', None) - self.command = kwargs['command'] - self.distribution = kwargs.get('distribution', None) - self.environment_id = kwargs['environment_id'] - self.environment_variables = kwargs.get('environment_variables', None) - self.resources = kwargs.get('resources', None) + self.code_id = kwargs.get("code_id", None) + self.command = kwargs["command"] + self.distribution = kwargs.get("distribution", None) + self.environment_id = kwargs["environment_id"] + self.environment_variables = kwargs.get("environment_variables", None) + self.resources = kwargs.get("resources", None) class TritonModelJobInput(JobInput, AssetJobInput): @@ -13328,21 +13149,18 @@ class TritonModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -13353,11 +13171,11 @@ def __init__( :paramtype description: str """ super(TritonModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'triton_model' # type: str - self.description = kwargs.get('description', None) - self.job_input_type = 'triton_model' # type: str + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "triton_model" # type: str + self.description = kwargs.get("description", None) + self.job_input_type = "triton_model" # type: str class TritonModelJobOutput(JobOutput, AssetJobOutput): @@ -13378,20 +13196,17 @@ class TritonModelJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -13401,11 +13216,11 @@ def __init__( :paramtype description: str """ super(TritonModelJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'triton_model' # type: str - self.description = kwargs.get('description', None) - self.job_output_type = 'triton_model' # type: str + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "triton_model" # type: str + self.description = kwargs.get("description", None) + self.job_output_type = "triton_model" # type: str class TruncationSelectionPolicy(EarlyTerminationPolicy): @@ -13426,20 +13241,20 @@ class TruncationSelectionPolicy(EarlyTerminationPolicy): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'truncation_percentage': {'key': 'truncationPercentage', 'type': 'int'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, + "truncation_percentage": { + "key": "truncationPercentage", + "type": "int", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. :paramtype delay_evaluation: int @@ -13449,8 +13264,8 @@ def __init__( :paramtype truncation_percentage: int """ super(TruncationSelectionPolicy, self).__init__(**kwargs) - self.policy_type = 'TruncationSelection' # type: str - self.truncation_percentage = kwargs.get('truncation_percentage', 0) + self.policy_type = "TruncationSelection" # type: str + self.truncation_percentage = kwargs.get("truncation_percentage", 0) class UpdateWorkspaceQuotas(msrest.serialization.Model): @@ -13474,23 +13289,20 @@ class UpdateWorkspaceQuotas(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, + "id": {"readonly": True}, + "type": {"readonly": True}, + "unit": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "limit": {"key": "limit", "type": "long"}, + "unit": {"key": "unit", "type": "str"}, + "status": {"key": "status", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword limit: The maximum permitted quota of the resource. :paramtype limit: long @@ -13503,9 +13315,9 @@ def __init__( super(UpdateWorkspaceQuotas, self).__init__(**kwargs) self.id = None self.type = None - self.limit = kwargs.get('limit', None) + self.limit = kwargs.get("limit", None) self.unit = None - self.status = kwargs.get('status', None) + self.status = kwargs.get("status", None) class UpdateWorkspaceQuotasResult(msrest.serialization.Model): @@ -13521,21 +13333,17 @@ class UpdateWorkspaceQuotasResult(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[UpdateWorkspaceQuotas]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[UpdateWorkspaceQuotas]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UpdateWorkspaceQuotasResult, self).__init__(**kwargs) self.value = None self.next_link = None @@ -13565,24 +13373,21 @@ class UriFileDataVersion(DataVersionBaseDetails): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -13599,7 +13404,7 @@ def __init__( :paramtype data_uri: str """ super(UriFileDataVersion, self).__init__(**kwargs) - self.data_type = 'uri_file' # type: str + self.data_type = "uri_file" # type: str class UriFileJobInput(JobInput, AssetJobInput): @@ -13621,21 +13426,18 @@ class UriFileJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -13646,11 +13448,11 @@ def __init__( :paramtype description: str """ super(UriFileJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'uri_file' # type: str - self.description = kwargs.get('description', None) - self.job_input_type = 'uri_file' # type: str + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "uri_file" # type: str + self.description = kwargs.get("description", None) + self.job_input_type = "uri_file" # type: str class UriFileJobOutput(JobOutput, AssetJobOutput): @@ -13671,20 +13473,17 @@ class UriFileJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -13694,11 +13493,11 @@ def __init__( :paramtype description: str """ super(UriFileJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'uri_file' # type: str - self.description = kwargs.get('description', None) - self.job_output_type = 'uri_file' # type: str + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "uri_file" # type: str + self.description = kwargs.get("description", None) + self.job_output_type = "uri_file" # type: str class UriFolderDataVersion(DataVersionBaseDetails): @@ -13725,24 +13524,21 @@ class UriFolderDataVersion(DataVersionBaseDetails): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -13759,7 +13555,7 @@ def __init__( :paramtype data_uri: str """ super(UriFolderDataVersion, self).__init__(**kwargs) - self.data_type = 'uri_folder' # type: str + self.data_type = "uri_folder" # type: str class UriFolderJobInput(JobInput, AssetJobInput): @@ -13781,21 +13577,18 @@ class UriFolderJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -13806,11 +13599,11 @@ def __init__( :paramtype description: str """ super(UriFolderJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'uri_folder' # type: str - self.description = kwargs.get('description', None) - self.job_input_type = 'uri_folder' # type: str + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "uri_folder" # type: str + self.description = kwargs.get("description", None) + self.job_input_type = "uri_folder" # type: str class UriFolderJobOutput(JobOutput, AssetJobOutput): @@ -13831,20 +13624,17 @@ class UriFolderJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -13854,11 +13644,11 @@ def __init__( :paramtype description: str """ super(UriFolderJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'uri_folder' # type: str - self.description = kwargs.get('description', None) - self.job_output_type = 'uri_folder' # type: str + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "uri_folder" # type: str + self.description = kwargs.get("description", None) + self.job_output_type = "uri_folder" # type: str class Usage(msrest.serialization.Model): @@ -13883,31 +13673,30 @@ class Usage(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, + "id": {"readonly": True}, + "aml_workspace_location": {"readonly": True}, + "type": {"readonly": True}, + "unit": {"readonly": True}, + "current_value": {"readonly": True}, + "limit": {"readonly": True}, + "name": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'current_value': {'key': 'currentValue', 'type': 'long'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'name': {'key': 'name', 'type': 'UsageName'}, + "id": {"key": "id", "type": "str"}, + "aml_workspace_location": { + "key": "amlWorkspaceLocation", + "type": "str", + }, + "type": {"key": "type", "type": "str"}, + "unit": {"key": "unit", "type": "str"}, + "current_value": {"key": "currentValue", "type": "long"}, + "limit": {"key": "limit", "type": "long"}, + "name": {"key": "name", "type": "UsageName"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Usage, self).__init__(**kwargs) self.id = None self.aml_workspace_location = None @@ -13930,21 +13719,17 @@ class UsageName(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, + "value": {"readonly": True}, + "localized_value": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + "value": {"key": "value", "type": "str"}, + "localized_value": {"key": "localizedValue", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UsageName, self).__init__(**kwargs) self.value = None self.localized_value = None @@ -13965,19 +13750,19 @@ class UserAccountCredentials(msrest.serialization.Model): """ _validation = { - 'admin_user_name': {'required': True}, + "admin_user_name": {"required": True}, } _attribute_map = { - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'admin_user_ssh_public_key': {'key': 'adminUserSshPublicKey', 'type': 'str'}, - 'admin_user_password': {'key': 'adminUserPassword', 'type': 'str'}, + "admin_user_name": {"key": "adminUserName", "type": "str"}, + "admin_user_ssh_public_key": { + "key": "adminUserSshPublicKey", + "type": "str", + }, + "admin_user_password": {"key": "adminUserPassword", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword admin_user_name: Required. Name of the administrator user account which can be used to SSH to nodes. @@ -13988,9 +13773,11 @@ def __init__( :paramtype admin_user_password: str """ super(UserAccountCredentials, self).__init__(**kwargs) - self.admin_user_name = kwargs['admin_user_name'] - self.admin_user_ssh_public_key = kwargs.get('admin_user_ssh_public_key', None) - self.admin_user_password = kwargs.get('admin_user_password', None) + self.admin_user_name = kwargs["admin_user_name"] + self.admin_user_ssh_public_key = kwargs.get( + "admin_user_ssh_public_key", None + ) + self.admin_user_password = kwargs.get("admin_user_password", None) class UserAssignedIdentity(msrest.serialization.Model): @@ -14005,21 +13792,17 @@ class UserAssignedIdentity(msrest.serialization.Model): """ _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, + "principal_id": {"readonly": True}, + "client_id": {"readonly": True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, + "principal_id": {"key": "principalId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UserAssignedIdentity, self).__init__(**kwargs) self.principal_id = None self.client_id = None @@ -14037,24 +13820,22 @@ class UserIdentity(IdentityConfiguration): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UserIdentity, self).__init__(**kwargs) - self.identity_type = 'UserIdentity' # type: str + self.identity_type = "UserIdentity" # type: str -class UsernamePasswordAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class UsernamePasswordAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """UsernamePasswordAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -14077,22 +13858,22 @@ class UsernamePasswordAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionP """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionUsernamePassword'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionUsernamePassword", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: Category of the connection. Possible values include: "PythonFeed", "ContainerRegistry", "Git". @@ -14108,9 +13889,11 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword """ - super(UsernamePasswordAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'UsernamePassword' # type: str - self.credentials = kwargs.get('credentials', None) + super( + UsernamePasswordAuthTypeWorkspaceConnectionProperties, self + ).__init__(**kwargs) + self.auth_type = "UsernamePassword" # type: str + self.credentials = kwargs.get("credentials", None) class VirtualMachineSchema(msrest.serialization.Model): @@ -14121,20 +13904,20 @@ class VirtualMachineSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, + "properties": { + "key": "properties", + "type": "VirtualMachineSchemaProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: :paramtype properties: ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties """ super(VirtualMachineSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class VirtualMachine(Compute, VirtualMachineSchema): @@ -14176,33 +13959,36 @@ class VirtualMachine(Compute, VirtualMachineSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": { + "key": "properties", + "type": "VirtualMachineSchemaProperties", + }, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: :paramtype properties: @@ -14216,18 +14002,18 @@ def __init__( :paramtype disable_local_auth: bool """ super(VirtualMachine, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'VirtualMachine' # type: str - self.compute_type = 'VirtualMachine' # type: str + self.properties = kwargs.get("properties", None) + self.compute_type = "VirtualMachine" # type: str + self.compute_type = "VirtualMachine" # type: str self.compute_location = None self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) + self.disable_local_auth = kwargs.get("disable_local_auth", None) class VirtualMachineImage(msrest.serialization.Model): @@ -14240,23 +14026,20 @@ class VirtualMachineImage(msrest.serialization.Model): """ _validation = { - 'id': {'required': True}, + "id": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword id: Required. Virtual Machine image path. :paramtype id: str """ super(VirtualMachineImage, self).__init__(**kwargs) - self.id = kwargs['id'] + self.id = kwargs["id"] class VirtualMachineSchemaProperties(msrest.serialization.Model): @@ -14279,18 +14062,21 @@ class VirtualMachineSchemaProperties(msrest.serialization.Model): """ _attribute_map = { - 'virtual_machine_size': {'key': 'virtualMachineSize', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'notebook_server_port': {'key': 'notebookServerPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'is_notebook_instance_compute': {'key': 'isNotebookInstanceCompute', 'type': 'bool'}, + "virtual_machine_size": {"key": "virtualMachineSize", "type": "str"}, + "ssh_port": {"key": "sshPort", "type": "int"}, + "notebook_server_port": {"key": "notebookServerPort", "type": "int"}, + "address": {"key": "address", "type": "str"}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, + "is_notebook_instance_compute": { + "key": "isNotebookInstanceCompute", + "type": "bool", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword virtual_machine_size: Virtual Machine size. :paramtype virtual_machine_size: str @@ -14308,12 +14094,14 @@ def __init__( :paramtype is_notebook_instance_compute: bool """ super(VirtualMachineSchemaProperties, self).__init__(**kwargs) - self.virtual_machine_size = kwargs.get('virtual_machine_size', None) - self.ssh_port = kwargs.get('ssh_port', None) - self.notebook_server_port = kwargs.get('notebook_server_port', None) - self.address = kwargs.get('address', None) - self.administrator_account = kwargs.get('administrator_account', None) - self.is_notebook_instance_compute = kwargs.get('is_notebook_instance_compute', None) + self.virtual_machine_size = kwargs.get("virtual_machine_size", None) + self.ssh_port = kwargs.get("ssh_port", None) + self.notebook_server_port = kwargs.get("notebook_server_port", None) + self.address = kwargs.get("address", None) + self.administrator_account = kwargs.get("administrator_account", None) + self.is_notebook_instance_compute = kwargs.get( + "is_notebook_instance_compute", None + ) class VirtualMachineSecretsSchema(msrest.serialization.Model): @@ -14325,20 +14113,20 @@ class VirtualMachineSecretsSchema(msrest.serialization.Model): """ _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword administrator_account: Admin credentials for virtual machine. :paramtype administrator_account: ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials """ super(VirtualMachineSecretsSchema, self).__init__(**kwargs) - self.administrator_account = kwargs.get('administrator_account', None) + self.administrator_account = kwargs.get("administrator_account", None) class VirtualMachineSecrets(ComputeSecrets, VirtualMachineSecretsSchema): @@ -14356,27 +14144,27 @@ class VirtualMachineSecrets(ComputeSecrets, VirtualMachineSecretsSchema): """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, + "compute_type": {"key": "computeType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword administrator_account: Admin credentials for virtual machine. :paramtype administrator_account: ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials """ super(VirtualMachineSecrets, self).__init__(**kwargs) - self.administrator_account = kwargs.get('administrator_account', None) - self.compute_type = 'VirtualMachine' # type: str - self.compute_type = 'VirtualMachine' # type: str + self.administrator_account = kwargs.get("administrator_account", None) + self.compute_type = "VirtualMachine" # type: str + self.compute_type = "VirtualMachine" # type: str class VirtualMachineSize(msrest.serialization.Model): @@ -14411,35 +14199,41 @@ class VirtualMachineSize(msrest.serialization.Model): """ _validation = { - 'name': {'readonly': True}, - 'family': {'readonly': True}, - 'v_cp_us': {'readonly': True}, - 'gpus': {'readonly': True}, - 'os_vhd_size_mb': {'readonly': True}, - 'max_resource_volume_mb': {'readonly': True}, - 'memory_gb': {'readonly': True}, - 'low_priority_capable': {'readonly': True}, - 'premium_io': {'readonly': True}, + "name": {"readonly": True}, + "family": {"readonly": True}, + "v_cp_us": {"readonly": True}, + "gpus": {"readonly": True}, + "os_vhd_size_mb": {"readonly": True}, + "max_resource_volume_mb": {"readonly": True}, + "memory_gb": {"readonly": True}, + "low_priority_capable": {"readonly": True}, + "premium_io": {"readonly": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'v_cp_us': {'key': 'vCPUs', 'type': 'int'}, - 'gpus': {'key': 'gpus', 'type': 'int'}, - 'os_vhd_size_mb': {'key': 'osVhdSizeMB', 'type': 'int'}, - 'max_resource_volume_mb': {'key': 'maxResourceVolumeMB', 'type': 'int'}, - 'memory_gb': {'key': 'memoryGB', 'type': 'float'}, - 'low_priority_capable': {'key': 'lowPriorityCapable', 'type': 'bool'}, - 'premium_io': {'key': 'premiumIO', 'type': 'bool'}, - 'estimated_vm_prices': {'key': 'estimatedVMPrices', 'type': 'EstimatedVMPrices'}, - 'supported_compute_types': {'key': 'supportedComputeTypes', 'type': '[str]'}, + "name": {"key": "name", "type": "str"}, + "family": {"key": "family", "type": "str"}, + "v_cp_us": {"key": "vCPUs", "type": "int"}, + "gpus": {"key": "gpus", "type": "int"}, + "os_vhd_size_mb": {"key": "osVhdSizeMB", "type": "int"}, + "max_resource_volume_mb": { + "key": "maxResourceVolumeMB", + "type": "int", + }, + "memory_gb": {"key": "memoryGB", "type": "float"}, + "low_priority_capable": {"key": "lowPriorityCapable", "type": "bool"}, + "premium_io": {"key": "premiumIO", "type": "bool"}, + "estimated_vm_prices": { + "key": "estimatedVMPrices", + "type": "EstimatedVMPrices", + }, + "supported_compute_types": { + "key": "supportedComputeTypes", + "type": "[str]", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword estimated_vm_prices: The estimated price information for using a VM. :paramtype estimated_vm_prices: ~azure.mgmt.machinelearningservices.models.EstimatedVMPrices @@ -14457,8 +14251,10 @@ def __init__( self.memory_gb = None self.low_priority_capable = None self.premium_io = None - self.estimated_vm_prices = kwargs.get('estimated_vm_prices', None) - self.supported_compute_types = kwargs.get('supported_compute_types', None) + self.estimated_vm_prices = kwargs.get("estimated_vm_prices", None) + self.supported_compute_types = kwargs.get( + "supported_compute_types", None + ) class VirtualMachineSizeListResult(msrest.serialization.Model): @@ -14469,19 +14265,16 @@ class VirtualMachineSizeListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[VirtualMachineSize]'}, + "value": {"key": "value", "type": "[VirtualMachineSize]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: The list of virtual machine sizes supported by AmlCompute. :paramtype value: list[~azure.mgmt.machinelearningservices.models.VirtualMachineSize] """ super(VirtualMachineSizeListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class VirtualMachineSshCredentials(msrest.serialization.Model): @@ -14498,16 +14291,13 @@ class VirtualMachineSshCredentials(msrest.serialization.Model): """ _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'public_key_data': {'key': 'publicKeyData', 'type': 'str'}, - 'private_key_data': {'key': 'privateKeyData', 'type': 'str'}, + "username": {"key": "username", "type": "str"}, + "password": {"key": "password", "type": "str"}, + "public_key_data": {"key": "publicKeyData", "type": "str"}, + "private_key_data": {"key": "privateKeyData", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword username: Username of admin account. :paramtype username: str @@ -14519,10 +14309,10 @@ def __init__( :paramtype private_key_data: str """ super(VirtualMachineSshCredentials, self).__init__(**kwargs) - self.username = kwargs.get('username', None) - self.password = kwargs.get('password', None) - self.public_key_data = kwargs.get('public_key_data', None) - self.private_key_data = kwargs.get('private_key_data', None) + self.username = kwargs.get("username", None) + self.password = kwargs.get("password", None) + self.public_key_data = kwargs.get("public_key_data", None) + self.private_key_data = kwargs.get("private_key_data", None) class Workspace(Resource): @@ -14618,60 +14408,105 @@ class Workspace(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'workspace_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'service_provisioned_resource_group': {'readonly': True}, - 'private_link_count': {'readonly': True}, - 'private_endpoint_connections': {'readonly': True}, - 'notebook_info': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'storage_hns_enabled': {'readonly': True}, - 'ml_flow_tracking_uri': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'key_vault': {'key': 'properties.keyVault', 'type': 'str'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'storage_account': {'key': 'properties.storageAccount', 'type': 'str'}, - 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionProperty'}, - 'hbi_workspace': {'key': 'properties.hbiWorkspace', 'type': 'bool'}, - 'service_provisioned_resource_group': {'key': 'properties.serviceProvisionedResourceGroup', 'type': 'str'}, - 'private_link_count': {'key': 'properties.privateLinkCount', 'type': 'int'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'allow_public_access_when_behind_vnet': {'key': 'properties.allowPublicAccessWhenBehindVnet', 'type': 'bool'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, - 'shared_private_link_resources': {'key': 'properties.sharedPrivateLinkResources', 'type': '[SharedPrivateLinkResource]'}, - 'notebook_info': {'key': 'properties.notebookInfo', 'type': 'NotebookResourceInfo'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, - 'storage_hns_enabled': {'key': 'properties.storageHnsEnabled', 'type': 'bool'}, - 'ml_flow_tracking_uri': {'key': 'properties.mlFlowTrackingUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "workspace_id": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "service_provisioned_resource_group": {"readonly": True}, + "private_link_count": {"readonly": True}, + "private_endpoint_connections": {"readonly": True}, + "notebook_info": {"readonly": True}, + "tenant_id": {"readonly": True}, + "storage_hns_enabled": {"readonly": True}, + "ml_flow_tracking_uri": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "workspace_id": {"key": "properties.workspaceId", "type": "str"}, + "description": {"key": "properties.description", "type": "str"}, + "friendly_name": {"key": "properties.friendlyName", "type": "str"}, + "key_vault": {"key": "properties.keyVault", "type": "str"}, + "application_insights": { + "key": "properties.applicationInsights", + "type": "str", + }, + "container_registry": { + "key": "properties.containerRegistry", + "type": "str", + }, + "storage_account": {"key": "properties.storageAccount", "type": "str"}, + "discovery_url": {"key": "properties.discoveryUrl", "type": "str"}, + "provisioning_state": { + "key": "properties.provisioningState", + "type": "str", + }, + "encryption": { + "key": "properties.encryption", + "type": "EncryptionProperty", + }, + "hbi_workspace": {"key": "properties.hbiWorkspace", "type": "bool"}, + "service_provisioned_resource_group": { + "key": "properties.serviceProvisionedResourceGroup", + "type": "str", + }, + "private_link_count": { + "key": "properties.privateLinkCount", + "type": "int", + }, + "image_build_compute": { + "key": "properties.imageBuildCompute", + "type": "str", + }, + "allow_public_access_when_behind_vnet": { + "key": "properties.allowPublicAccessWhenBehindVnet", + "type": "bool", + }, + "public_network_access": { + "key": "properties.publicNetworkAccess", + "type": "str", + }, + "private_endpoint_connections": { + "key": "properties.privateEndpointConnections", + "type": "[PrivateEndpointConnection]", + }, + "shared_private_link_resources": { + "key": "properties.sharedPrivateLinkResources", + "type": "[SharedPrivateLinkResource]", + }, + "notebook_info": { + "key": "properties.notebookInfo", + "type": "NotebookResourceInfo", + }, + "service_managed_resources_settings": { + "key": "properties.serviceManagedResourcesSettings", + "type": "ServiceManagedResourcesSettings", + }, + "primary_user_assigned_identity": { + "key": "properties.primaryUserAssignedIdentity", + "type": "str", + }, + "tenant_id": {"key": "properties.tenantId", "type": "str"}, + "storage_hns_enabled": { + "key": "properties.storageHnsEnabled", + "type": "bool", + }, + "ml_flow_tracking_uri": { + "key": "properties.mlFlowTrackingUri", + "type": "str", + }, + } + + def __init__(self, **kwargs): """ :keyword identity: The identity of the resource. :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity @@ -14725,31 +14560,39 @@ def __init__( :paramtype primary_user_assigned_identity: str """ super(Workspace, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) + self.identity = kwargs.get("identity", None) + self.location = kwargs.get("location", None) + self.tags = kwargs.get("tags", None) + self.sku = kwargs.get("sku", None) self.workspace_id = None - self.description = kwargs.get('description', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.key_vault = kwargs.get('key_vault', None) - self.application_insights = kwargs.get('application_insights', None) - self.container_registry = kwargs.get('container_registry', None) - self.storage_account = kwargs.get('storage_account', None) - self.discovery_url = kwargs.get('discovery_url', None) + self.description = kwargs.get("description", None) + self.friendly_name = kwargs.get("friendly_name", None) + self.key_vault = kwargs.get("key_vault", None) + self.application_insights = kwargs.get("application_insights", None) + self.container_registry = kwargs.get("container_registry", None) + self.storage_account = kwargs.get("storage_account", None) + self.discovery_url = kwargs.get("discovery_url", None) self.provisioning_state = None - self.encryption = kwargs.get('encryption', None) - self.hbi_workspace = kwargs.get('hbi_workspace', False) + self.encryption = kwargs.get("encryption", None) + self.hbi_workspace = kwargs.get("hbi_workspace", False) self.service_provisioned_resource_group = None self.private_link_count = None - self.image_build_compute = kwargs.get('image_build_compute', None) - self.allow_public_access_when_behind_vnet = kwargs.get('allow_public_access_when_behind_vnet', False) - self.public_network_access = kwargs.get('public_network_access', None) + self.image_build_compute = kwargs.get("image_build_compute", None) + self.allow_public_access_when_behind_vnet = kwargs.get( + "allow_public_access_when_behind_vnet", False + ) + self.public_network_access = kwargs.get("public_network_access", None) self.private_endpoint_connections = None - self.shared_private_link_resources = kwargs.get('shared_private_link_resources', None) + self.shared_private_link_resources = kwargs.get( + "shared_private_link_resources", None + ) self.notebook_info = None - self.service_managed_resources_settings = kwargs.get('service_managed_resources_settings', None) - self.primary_user_assigned_identity = kwargs.get('primary_user_assigned_identity', None) + self.service_managed_resources_settings = kwargs.get( + "service_managed_resources_settings", None + ) + self.primary_user_assigned_identity = kwargs.get( + "primary_user_assigned_identity", None + ) self.tenant_id = None self.storage_hns_enabled = None self.ml_flow_tracking_uri = None @@ -14765,14 +14608,11 @@ class WorkspaceConnectionManagedIdentity(msrest.serialization.Model): """ _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, + "resource_id": {"key": "resourceId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword resource_id: :paramtype resource_id: str @@ -14780,8 +14620,8 @@ def __init__( :paramtype client_id: str """ super(WorkspaceConnectionManagedIdentity, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.client_id = kwargs.get('client_id', None) + self.resource_id = kwargs.get("resource_id", None) + self.client_id = kwargs.get("client_id", None) class WorkspaceConnectionPersonalAccessToken(msrest.serialization.Model): @@ -14792,19 +14632,16 @@ class WorkspaceConnectionPersonalAccessToken(msrest.serialization.Model): """ _attribute_map = { - 'pat': {'key': 'pat', 'type': 'str'}, + "pat": {"key": "pat", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword pat: :paramtype pat: str """ super(WorkspaceConnectionPersonalAccessToken, self).__init__(**kwargs) - self.pat = kwargs.get('pat', None) + self.pat = kwargs.get("pat", None) class WorkspaceConnectionPropertiesV2BasicResource(Resource): @@ -14830,35 +14667,39 @@ class WorkspaceConnectionPropertiesV2BasicResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'WorkspaceConnectionPropertiesV2'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "WorkspaceConnectionPropertiesV2", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. :paramtype properties: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 """ - super(WorkspaceConnectionPropertiesV2BasicResource, self).__init__(**kwargs) - self.properties = kwargs['properties'] + super(WorkspaceConnectionPropertiesV2BasicResource, self).__init__( + **kwargs + ) + self.properties = kwargs["properties"] -class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(msrest.serialization.Model): +class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult( + msrest.serialization.Model +): """WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult. Variables are only populated by the server, and will be ignored when sending a request. @@ -14871,25 +14712,28 @@ class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(msrest.seri """ _validation = { - 'next_link': {'readonly': True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[WorkspaceConnectionPropertiesV2BasicResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": { + "key": "value", + "type": "[WorkspaceConnectionPropertiesV2BasicResource]", + }, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: :paramtype value: list[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource] """ - super(WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + super( + WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, + self, + ).__init__(**kwargs) + self.value = kwargs.get("value", None) self.next_link = None @@ -14901,19 +14745,18 @@ class WorkspaceConnectionSharedAccessSignature(msrest.serialization.Model): """ _attribute_map = { - 'sas': {'key': 'sas', 'type': 'str'}, + "sas": {"key": "sas", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword sas: :paramtype sas: str """ - super(WorkspaceConnectionSharedAccessSignature, self).__init__(**kwargs) - self.sas = kwargs.get('sas', None) + super(WorkspaceConnectionSharedAccessSignature, self).__init__( + **kwargs + ) + self.sas = kwargs.get("sas", None) class WorkspaceConnectionUsernamePassword(msrest.serialization.Model): @@ -14926,14 +14769,11 @@ class WorkspaceConnectionUsernamePassword(msrest.serialization.Model): """ _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, + "username": {"key": "username", "type": "str"}, + "password": {"key": "password", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword username: :paramtype username: str @@ -14941,8 +14781,8 @@ def __init__( :paramtype password: str """ super(WorkspaceConnectionUsernamePassword, self).__init__(**kwargs) - self.username = kwargs.get('username', None) - self.password = kwargs.get('password', None) + self.username = kwargs.get("username", None) + self.password = kwargs.get("password", None) class WorkspaceListResult(msrest.serialization.Model): @@ -14957,14 +14797,11 @@ class WorkspaceListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[Workspace]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Workspace]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: The list of machine learning workspaces. Since this list may be incomplete, the nextLink field should be used to request the next list of machine learning workspaces. @@ -14974,8 +14811,8 @@ def __init__( :paramtype next_link: str """ super(WorkspaceListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get("value", None) + self.next_link = kwargs.get("next_link", None) class WorkspaceUpdateParameters(msrest.serialization.Model): @@ -15010,23 +14847,38 @@ class WorkspaceUpdateParameters(msrest.serialization.Model): """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "description": {"key": "properties.description", "type": "str"}, + "friendly_name": {"key": "properties.friendlyName", "type": "str"}, + "image_build_compute": { + "key": "properties.imageBuildCompute", + "type": "str", + }, + "service_managed_resources_settings": { + "key": "properties.serviceManagedResourcesSettings", + "type": "ServiceManagedResourcesSettings", + }, + "primary_user_assigned_identity": { + "key": "properties.primaryUserAssignedIdentity", + "type": "str", + }, + "public_network_access": { + "key": "properties.publicNetworkAccess", + "type": "str", + }, + "application_insights": { + "key": "properties.applicationInsights", + "type": "str", + }, + "container_registry": { + "key": "properties.containerRegistry", + "type": "str", + }, + } + + def __init__(self, **kwargs): """ :keyword tags: A set of tags. The resource tags for the machine learning workspace. :paramtype tags: dict[str, str] @@ -15057,14 +14909,18 @@ def __init__( :paramtype container_registry: str """ super(WorkspaceUpdateParameters, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) - self.identity = kwargs.get('identity', None) - self.description = kwargs.get('description', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.image_build_compute = kwargs.get('image_build_compute', None) - self.service_managed_resources_settings = kwargs.get('service_managed_resources_settings', None) - self.primary_user_assigned_identity = kwargs.get('primary_user_assigned_identity', None) - self.public_network_access = kwargs.get('public_network_access', None) - self.application_insights = kwargs.get('application_insights', None) - self.container_registry = kwargs.get('container_registry', None) + self.tags = kwargs.get("tags", None) + self.sku = kwargs.get("sku", None) + self.identity = kwargs.get("identity", None) + self.description = kwargs.get("description", None) + self.friendly_name = kwargs.get("friendly_name", None) + self.image_build_compute = kwargs.get("image_build_compute", None) + self.service_managed_resources_settings = kwargs.get( + "service_managed_resources_settings", None + ) + self.primary_user_assigned_identity = kwargs.get( + "primary_user_assigned_identity", None + ) + self.public_network_access = kwargs.get("public_network_access", None) + self.application_insights = kwargs.get("application_insights", None) + self.container_registry = kwargs.get("container_registry", None) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/models/_models_py3.py index d66af5653b57..c90bfa6c46dd 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/models/_models_py3.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/models/_models_py3.py @@ -30,23 +30,25 @@ class DatastoreCredentials(msrest.serialization.Model): """ _validation = { - 'credentials_type': {'required': True}, + "credentials_type": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, } _subtype_map = { - 'credentials_type': {'AccountKey': 'AccountKeyDatastoreCredentials', 'Certificate': 'CertificateDatastoreCredentials', 'None': 'NoneDatastoreCredentials', 'Sas': 'SasDatastoreCredentials', 'ServicePrincipal': 'ServicePrincipalDatastoreCredentials'} + "credentials_type": { + "AccountKey": "AccountKeyDatastoreCredentials", + "Certificate": "CertificateDatastoreCredentials", + "None": "NoneDatastoreCredentials", + "Sas": "SasDatastoreCredentials", + "ServicePrincipal": "ServicePrincipalDatastoreCredentials", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DatastoreCredentials, self).__init__(**kwargs) self.credentials_type = None # type: Optional[str] @@ -65,27 +67,22 @@ class AccountKeyDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, + "credentials_type": {"required": True}, + "secrets": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'AccountKeyDatastoreSecrets'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "secrets": {"key": "secrets", "type": "AccountKeyDatastoreSecrets"}, } - def __init__( - self, - *, - secrets: "AccountKeyDatastoreSecrets", - **kwargs - ): + def __init__(self, *, secrets: "AccountKeyDatastoreSecrets", **kwargs): """ :keyword secrets: Required. [Required] Storage account secrets. :paramtype secrets: ~azure.mgmt.machinelearningservices.models.AccountKeyDatastoreSecrets """ super(AccountKeyDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'AccountKey' # type: str + self.credentials_type = "AccountKey" # type: str self.secrets = secrets @@ -104,23 +101,24 @@ class DatastoreSecrets(msrest.serialization.Model): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, } _subtype_map = { - 'secrets_type': {'AccountKey': 'AccountKeyDatastoreSecrets', 'Certificate': 'CertificateDatastoreSecrets', 'Sas': 'SasDatastoreSecrets', 'ServicePrincipal': 'ServicePrincipalDatastoreSecrets'} + "secrets_type": { + "AccountKey": "AccountKeyDatastoreSecrets", + "Certificate": "CertificateDatastoreSecrets", + "Sas": "SasDatastoreSecrets", + "ServicePrincipal": "ServicePrincipalDatastoreSecrets", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DatastoreSecrets, self).__init__(**kwargs) self.secrets_type = None # type: Optional[str] @@ -139,26 +137,21 @@ class AccountKeyDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "key": {"key": "key", "type": "str"}, } - def __init__( - self, - *, - key: Optional[str] = None, - **kwargs - ): + def __init__(self, *, key: Optional[str] = None, **kwargs): """ :keyword key: Storage account key. :paramtype key: str """ super(AccountKeyDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'AccountKey' # type: str + self.secrets_type = "AccountKey" # type: str self.key = key @@ -170,14 +163,11 @@ class AKSSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, + "properties": {"key": "properties", "type": "AKSSchemaProperties"}, } def __init__( - self, - *, - properties: Optional["AKSSchemaProperties"] = None, - **kwargs + self, *, properties: Optional["AKSSchemaProperties"] = None, **kwargs ): """ :keyword properties: AKS properties. @@ -227,30 +217,44 @@ class Compute(msrest.serialization.Model): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + } + + _attribute_map = { + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } _subtype_map = { - 'compute_type': {'AKS': 'AKS', 'AmlCompute': 'AmlCompute', 'ComputeInstance': 'ComputeInstance', 'DataFactory': 'DataFactory', 'DataLakeAnalytics': 'DataLakeAnalytics', 'Databricks': 'Databricks', 'HDInsight': 'HDInsight', 'Kubernetes': 'Kubernetes', 'SynapseSpark': 'SynapseSpark', 'VirtualMachine': 'VirtualMachine'} + "compute_type": { + "AKS": "AKS", + "AmlCompute": "AmlCompute", + "ComputeInstance": "ComputeInstance", + "DataFactory": "DataFactory", + "DataLakeAnalytics": "DataLakeAnalytics", + "Databricks": "Databricks", + "HDInsight": "HDInsight", + "Kubernetes": "Kubernetes", + "SynapseSpark": "SynapseSpark", + "VirtualMachine": "VirtualMachine", + } } def __init__( @@ -322,27 +326,30 @@ class AKS(Compute, AKSSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "AKSSchemaProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -365,10 +372,16 @@ def __init__( MSI and AAD exclusively for authentication. :paramtype disable_local_auth: bool """ - super(AKS, self).__init__(description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) + super(AKS, self).__init__( + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'AKS' # type: str - self.compute_type = 'AKS' # type: str + self.compute_type = "AKS" # type: str + self.compute_type = "AKS" # type: str self.compute_location = None self.provisioning_state = None self.description = description @@ -394,9 +407,12 @@ class AksComputeSecretsProperties(msrest.serialization.Model): """ _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, + "user_kube_config": {"key": "userKubeConfig", "type": "str"}, + "admin_kube_config": {"key": "adminKubeConfig", "type": "str"}, + "image_pull_secret_name": { + "key": "imagePullSecretName", + "type": "str", + }, } def __init__( @@ -438,23 +454,23 @@ class ComputeSecrets(msrest.serialization.Model): """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "compute_type": {"key": "computeType", "type": "str"}, } _subtype_map = { - 'compute_type': {'AKS': 'AksComputeSecrets', 'Databricks': 'DatabricksComputeSecrets', 'VirtualMachine': 'VirtualMachineSecrets'} + "compute_type": { + "AKS": "AksComputeSecrets", + "Databricks": "DatabricksComputeSecrets", + "VirtualMachine": "VirtualMachineSecrets", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ComputeSecrets, self).__init__(**kwargs) self.compute_type = None # type: Optional[str] @@ -479,14 +495,17 @@ class AksComputeSecrets(ComputeSecrets, AksComputeSecretsProperties): """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "user_kube_config": {"key": "userKubeConfig", "type": "str"}, + "admin_kube_config": {"key": "adminKubeConfig", "type": "str"}, + "image_pull_secret_name": { + "key": "imagePullSecretName", + "type": "str", + }, + "compute_type": {"key": "computeType", "type": "str"}, } def __init__( @@ -507,12 +526,17 @@ def __init__( :keyword image_pull_secret_name: Image registry pull secret. :paramtype image_pull_secret_name: str """ - super(AksComputeSecrets, self).__init__(user_kube_config=user_kube_config, admin_kube_config=admin_kube_config, image_pull_secret_name=image_pull_secret_name, **kwargs) + super(AksComputeSecrets, self).__init__( + user_kube_config=user_kube_config, + admin_kube_config=admin_kube_config, + image_pull_secret_name=image_pull_secret_name, + **kwargs + ) self.user_kube_config = user_kube_config self.admin_kube_config = admin_kube_config self.image_pull_secret_name = image_pull_secret_name - self.compute_type = 'AKS' # type: str - self.compute_type = 'AKS' # type: str + self.compute_type = "AKS" # type: str + self.compute_type = "AKS" # type: str class AksNetworkingConfiguration(msrest.serialization.Model): @@ -532,16 +556,22 @@ class AksNetworkingConfiguration(msrest.serialization.Model): """ _validation = { - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, + "service_cidr": { + "pattern": r"^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$" + }, + "dns_service_ip": { + "pattern": r"^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" + }, + "docker_bridge_cidr": { + "pattern": r"^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$" + }, } _attribute_map = { - 'subnet_id': {'key': 'subnetId', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, + "subnet_id": {"key": "subnetId", "type": "str"}, + "service_cidr": {"key": "serviceCidr", "type": "str"}, + "dns_service_ip": {"key": "dnsServiceIP", "type": "str"}, + "docker_bridge_cidr": {"key": "dockerBridgeCidr", "type": "str"}, } def __init__( @@ -602,20 +632,29 @@ class AKSSchemaProperties(msrest.serialization.Model): """ _validation = { - 'system_services': {'readonly': True}, - 'agent_count': {'minimum': 0}, + "system_services": {"readonly": True}, + "agent_count": {"minimum": 0}, } _attribute_map = { - 'cluster_fqdn': {'key': 'clusterFqdn', 'type': 'str'}, - 'system_services': {'key': 'systemServices', 'type': '[SystemService]'}, - 'agent_count': {'key': 'agentCount', 'type': 'int'}, - 'agent_vm_size': {'key': 'agentVmSize', 'type': 'str'}, - 'cluster_purpose': {'key': 'clusterPurpose', 'type': 'str'}, - 'ssl_configuration': {'key': 'sslConfiguration', 'type': 'SslConfiguration'}, - 'aks_networking_configuration': {'key': 'aksNetworkingConfiguration', 'type': 'AksNetworkingConfiguration'}, - 'load_balancer_type': {'key': 'loadBalancerType', 'type': 'str'}, - 'load_balancer_subnet': {'key': 'loadBalancerSubnet', 'type': 'str'}, + "cluster_fqdn": {"key": "clusterFqdn", "type": "str"}, + "system_services": { + "key": "systemServices", + "type": "[SystemService]", + }, + "agent_count": {"key": "agentCount", "type": "int"}, + "agent_vm_size": {"key": "agentVmSize", "type": "str"}, + "cluster_purpose": {"key": "clusterPurpose", "type": "str"}, + "ssl_configuration": { + "key": "sslConfiguration", + "type": "SslConfiguration", + }, + "aks_networking_configuration": { + "key": "aksNetworkingConfiguration", + "type": "AksNetworkingConfiguration", + }, + "load_balancer_type": {"key": "loadBalancerType", "type": "str"}, + "load_balancer_subnet": {"key": "loadBalancerSubnet", "type": "str"}, } def __init__( @@ -626,8 +665,12 @@ def __init__( agent_vm_size: Optional[str] = None, cluster_purpose: Optional[Union[str, "ClusterPurpose"]] = "FastProd", ssl_configuration: Optional["SslConfiguration"] = None, - aks_networking_configuration: Optional["AksNetworkingConfiguration"] = None, - load_balancer_type: Optional[Union[str, "LoadBalancerType"]] = "PublicIp", + aks_networking_configuration: Optional[ + "AksNetworkingConfiguration" + ] = None, + load_balancer_type: Optional[ + Union[str, "LoadBalancerType"] + ] = "PublicIp", load_balancer_subnet: Optional[str] = None, **kwargs ): @@ -673,14 +716,11 @@ class AmlComputeSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, + "properties": {"key": "properties", "type": "AmlComputeProperties"}, } def __init__( - self, - *, - properties: Optional["AmlComputeProperties"] = None, - **kwargs + self, *, properties: Optional["AmlComputeProperties"] = None, **kwargs ): """ :keyword properties: Properties of AmlCompute. @@ -729,27 +769,30 @@ class AmlCompute(Compute, AmlComputeSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "AmlComputeProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -772,10 +815,16 @@ def __init__( MSI and AAD exclusively for authentication. :paramtype disable_local_auth: bool """ - super(AmlCompute, self).__init__(description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) + super(AmlCompute, self).__init__( + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'AmlCompute' # type: str - self.compute_type = 'AmlCompute' # type: str + self.compute_type = "AmlCompute" # type: str + self.compute_type = "AmlCompute" # type: str self.compute_location = None self.provisioning_state = None self.description = description @@ -809,29 +858,25 @@ class AmlComputeNodeInformation(msrest.serialization.Model): """ _validation = { - 'node_id': {'readonly': True}, - 'private_ip_address': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'port': {'readonly': True}, - 'node_state': {'readonly': True}, - 'run_id': {'readonly': True}, + "node_id": {"readonly": True}, + "private_ip_address": {"readonly": True}, + "public_ip_address": {"readonly": True}, + "port": {"readonly": True}, + "node_state": {"readonly": True}, + "run_id": {"readonly": True}, } _attribute_map = { - 'node_id': {'key': 'nodeId', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'node_state': {'key': 'nodeState', 'type': 'str'}, - 'run_id': {'key': 'runId', 'type': 'str'}, + "node_id": {"key": "nodeId", "type": "str"}, + "private_ip_address": {"key": "privateIpAddress", "type": "str"}, + "public_ip_address": {"key": "publicIpAddress", "type": "str"}, + "port": {"key": "port", "type": "int"}, + "node_state": {"key": "nodeState", "type": "str"}, + "run_id": {"key": "runId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AmlComputeNodeInformation, self).__init__(**kwargs) self.node_id = None self.private_ip_address = None @@ -853,21 +898,17 @@ class AmlComputeNodesInformation(msrest.serialization.Model): """ _validation = { - 'nodes': {'readonly': True}, - 'next_link': {'readonly': True}, + "nodes": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'nodes': {'key': 'nodes', 'type': '[AmlComputeNodeInformation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "nodes": {"key": "nodes", "type": "[AmlComputeNodeInformation]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AmlComputeNodesInformation, self).__init__(**kwargs) self.nodes = None self.next_link = None @@ -938,32 +979,47 @@ class AmlComputeProperties(msrest.serialization.Model): """ _validation = { - 'allocation_state': {'readonly': True}, - 'allocation_state_transition_time': {'readonly': True}, - 'errors': {'readonly': True}, - 'current_node_count': {'readonly': True}, - 'target_node_count': {'readonly': True}, - 'node_state_counts': {'readonly': True}, - } - - _attribute_map = { - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'vm_priority': {'key': 'vmPriority', 'type': 'str'}, - 'virtual_machine_image': {'key': 'virtualMachineImage', 'type': 'VirtualMachineImage'}, - 'isolated_network': {'key': 'isolatedNetwork', 'type': 'bool'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, - 'user_account_credentials': {'key': 'userAccountCredentials', 'type': 'UserAccountCredentials'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'remote_login_port_public_access': {'key': 'remoteLoginPortPublicAccess', 'type': 'str'}, - 'allocation_state': {'key': 'allocationState', 'type': 'str'}, - 'allocation_state_transition_time': {'key': 'allocationStateTransitionTime', 'type': 'iso-8601'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'current_node_count': {'key': 'currentNodeCount', 'type': 'int'}, - 'target_node_count': {'key': 'targetNodeCount', 'type': 'int'}, - 'node_state_counts': {'key': 'nodeStateCounts', 'type': 'NodeStateCounts'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'property_bag': {'key': 'propertyBag', 'type': 'object'}, + "allocation_state": {"readonly": True}, + "allocation_state_transition_time": {"readonly": True}, + "errors": {"readonly": True}, + "current_node_count": {"readonly": True}, + "target_node_count": {"readonly": True}, + "node_state_counts": {"readonly": True}, + } + + _attribute_map = { + "os_type": {"key": "osType", "type": "str"}, + "vm_size": {"key": "vmSize", "type": "str"}, + "vm_priority": {"key": "vmPriority", "type": "str"}, + "virtual_machine_image": { + "key": "virtualMachineImage", + "type": "VirtualMachineImage", + }, + "isolated_network": {"key": "isolatedNetwork", "type": "bool"}, + "scale_settings": {"key": "scaleSettings", "type": "ScaleSettings"}, + "user_account_credentials": { + "key": "userAccountCredentials", + "type": "UserAccountCredentials", + }, + "subnet": {"key": "subnet", "type": "ResourceId"}, + "remote_login_port_public_access": { + "key": "remoteLoginPortPublicAccess", + "type": "str", + }, + "allocation_state": {"key": "allocationState", "type": "str"}, + "allocation_state_transition_time": { + "key": "allocationStateTransitionTime", + "type": "iso-8601", + }, + "errors": {"key": "errors", "type": "[ErrorResponse]"}, + "current_node_count": {"key": "currentNodeCount", "type": "int"}, + "target_node_count": {"key": "targetNodeCount", "type": "int"}, + "node_state_counts": { + "key": "nodeStateCounts", + "type": "NodeStateCounts", + }, + "enable_node_public_ip": {"key": "enableNodePublicIp", "type": "bool"}, + "property_bag": {"key": "propertyBag", "type": "object"}, } def __init__( @@ -977,7 +1033,9 @@ def __init__( scale_settings: Optional["ScaleSettings"] = None, user_account_credentials: Optional["UserAccountCredentials"] = None, subnet: Optional["ResourceId"] = None, - remote_login_port_public_access: Optional[Union[str, "RemoteLoginPortPublicAccess"]] = "NotSpecified", + remote_login_port_public_access: Optional[ + Union[str, "RemoteLoginPortPublicAccess"] + ] = "NotSpecified", enable_node_public_ip: Optional[bool] = True, property_bag: Optional[Any] = None, **kwargs @@ -1053,9 +1111,9 @@ class AmlOperation(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'AmlOperationDisplay'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + "name": {"key": "name", "type": "str"}, + "display": {"key": "display", "type": "AmlOperationDisplay"}, + "is_data_action": {"key": "isDataAction", "type": "bool"}, } def __init__( @@ -1094,10 +1152,10 @@ class AmlOperationDisplay(msrest.serialization.Model): """ _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, + "provider": {"key": "provider", "type": "str"}, + "resource": {"key": "resource", "type": "str"}, + "operation": {"key": "operation", "type": "str"}, + "description": {"key": "description", "type": "str"}, } def __init__( @@ -1134,14 +1192,11 @@ class AmlOperationListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlOperation]'}, + "value": {"key": "value", "type": "[AmlOperation]"}, } def __init__( - self, - *, - value: Optional[List["AmlOperation"]] = None, - **kwargs + self, *, value: Optional[List["AmlOperation"]] = None, **kwargs ): """ :keyword value: List of AML workspace operations supported by the AML workspace resource @@ -1167,23 +1222,23 @@ class IdentityConfiguration(msrest.serialization.Model): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, } _subtype_map = { - 'identity_type': {'AMLToken': 'AmlToken', 'Managed': 'ManagedIdentity', 'UserIdentity': 'UserIdentity'} + "identity_type": { + "AMLToken": "AmlToken", + "Managed": "ManagedIdentity", + "UserIdentity": "UserIdentity", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(IdentityConfiguration, self).__init__(**kwargs) self.identity_type = None # type: Optional[str] @@ -1200,21 +1255,17 @@ class AmlToken(IdentityConfiguration): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AmlToken, self).__init__(**kwargs) - self.identity_type = 'AMLToken' # type: str + self.identity_type = "AMLToken" # type: str class AmlUserFeature(msrest.serialization.Model): @@ -1229,9 +1280,9 @@ class AmlUserFeature(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "description": {"key": "description", "type": "str"}, } def __init__( @@ -1268,9 +1319,9 @@ class ResourceBase(msrest.serialization.Model): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, } def __init__( @@ -1311,11 +1362,11 @@ class AssetBase(ResourceBase): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, } def __init__( @@ -1340,7 +1391,9 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(AssetBase, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + super(AssetBase, self).__init__( + description=description, properties=properties, tags=tags, **kwargs + ) self.is_anonymous = is_anonymous self.is_archived = is_archived @@ -1365,17 +1418,17 @@ class AssetContainer(ResourceBase): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, } def __init__( @@ -1397,7 +1450,9 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(AssetContainer, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + super(AssetContainer, self).__init__( + description=description, properties=properties, tags=tags, **kwargs + ) self.is_archived = is_archived self.latest_version = None self.next_version = None @@ -1416,12 +1471,12 @@ class AssetJobInput(msrest.serialization.Model): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, } def __init__( @@ -1453,8 +1508,8 @@ class AssetJobOutput(msrest.serialization.Model): """ _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, } def __init__( @@ -1489,23 +1544,23 @@ class AssetReferenceBase(msrest.serialization.Model): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, } _subtype_map = { - 'reference_type': {'DataPath': 'DataPathAssetReference', 'Id': 'IdAssetReference', 'OutputPath': 'OutputPathAssetReference'} + "reference_type": { + "DataPath": "DataPathAssetReference", + "Id": "IdAssetReference", + "OutputPath": "OutputPathAssetReference", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AssetReferenceBase, self).__init__(**kwargs) self.reference_type = None # type: Optional[str] @@ -1522,22 +1577,16 @@ class AssignedUser(msrest.serialization.Model): """ _validation = { - 'object_id': {'required': True}, - 'tenant_id': {'required': True}, + "object_id": {"required": True}, + "tenant_id": {"required": True}, } _attribute_map = { - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + "object_id": {"key": "objectId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, } - def __init__( - self, - *, - object_id: str, - tenant_id: str, - **kwargs - ): + def __init__(self, *, object_id: str, tenant_id: str, **kwargs): """ :keyword object_id: Required. User�s AAD Object Id. :paramtype object_id: str @@ -1559,8 +1608,8 @@ class AutoPauseProperties(msrest.serialization.Model): """ _attribute_map = { - 'delay_in_minutes': {'key': 'delayInMinutes', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, + "delay_in_minutes": {"key": "delayInMinutes", "type": "int"}, + "enabled": {"key": "enabled", "type": "bool"}, } def __init__( @@ -1593,9 +1642,9 @@ class AutoScaleProperties(msrest.serialization.Model): """ _attribute_map = { - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, + "min_node_count": {"key": "minNodeCount", "type": "int"}, + "enabled": {"key": "enabled", "type": "bool"}, + "max_node_count": {"key": "maxNodeCount", "type": "int"}, } def __init__( @@ -1648,22 +1697,27 @@ class DatastoreDetails(ResourceBase): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, } _subtype_map = { - 'datastore_type': {'AzureBlob': 'AzureBlobDatastore', 'AzureDataLakeGen1': 'AzureDataLakeGen1Datastore', 'AzureDataLakeGen2': 'AzureDataLakeGen2Datastore', 'AzureFile': 'AzureFileDatastore'} + "datastore_type": { + "AzureBlob": "AzureBlobDatastore", + "AzureDataLakeGen1": "AzureDataLakeGen1Datastore", + "AzureDataLakeGen2": "AzureDataLakeGen2Datastore", + "AzureFile": "AzureFileDatastore", + } } def __init__( @@ -1685,9 +1739,11 @@ def __init__( :keyword credentials: Required. [Required] Account credentials. :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials """ - super(DatastoreDetails, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + super(DatastoreDetails, self).__init__( + description=description, properties=properties, tags=tags, **kwargs + ) self.credentials = credentials - self.datastore_type = 'DatastoreDetails' # type: str + self.datastore_type = "DatastoreDetails" # type: str self.is_default = None @@ -1729,23 +1785,26 @@ class AzureBlobDatastore(DatastoreDetails): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "account_name": {"key": "accountName", "type": "str"}, + "container_name": {"key": "containerName", "type": "str"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } def __init__( @@ -1759,7 +1818,9 @@ def __init__( container_name: Optional[str] = None, endpoint: Optional[str] = None, protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, + service_data_access_auth_identity: Optional[ + Union[str, "ServiceDataAccessAuthIdentity"] + ] = None, **kwargs ): """ @@ -1785,13 +1846,21 @@ def __init__( :paramtype service_data_access_auth_identity: str or ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ - super(AzureBlobDatastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, **kwargs) - self.datastore_type = 'AzureBlob' # type: str + super(AzureBlobDatastore, self).__init__( + description=description, + properties=properties, + tags=tags, + credentials=credentials, + **kwargs + ) + self.datastore_type = "AzureBlob" # type: str self.account_name = account_name self.container_name = container_name self.endpoint = endpoint self.protocol = protocol - self.service_data_access_auth_identity = service_data_access_auth_identity + self.service_data_access_auth_identity = ( + service_data_access_auth_identity + ) class AzureDataLakeGen1Datastore(DatastoreDetails): @@ -1826,21 +1895,24 @@ class AzureDataLakeGen1Datastore(DatastoreDetails): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'store_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "store_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - 'store_name': {'key': 'storeName', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, + "store_name": {"key": "storeName", "type": "str"}, } def __init__( @@ -1851,7 +1923,9 @@ def __init__( description: Optional[str] = None, properties: Optional[Dict[str, str]] = None, tags: Optional[Dict[str, str]] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, + service_data_access_auth_identity: Optional[ + Union[str, "ServiceDataAccessAuthIdentity"] + ] = None, **kwargs ): """ @@ -1871,9 +1945,17 @@ def __init__( :keyword store_name: Required. [Required] Azure Data Lake store name. :paramtype store_name: str """ - super(AzureDataLakeGen1Datastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, **kwargs) - self.datastore_type = 'AzureDataLakeGen1' # type: str - self.service_data_access_auth_identity = service_data_access_auth_identity + super(AzureDataLakeGen1Datastore, self).__init__( + description=description, + properties=properties, + tags=tags, + credentials=credentials, + **kwargs + ) + self.datastore_type = "AzureDataLakeGen1" # type: str + self.service_data_access_auth_identity = ( + service_data_access_auth_identity + ) self.store_name = store_name @@ -1915,25 +1997,28 @@ class AzureDataLakeGen2Datastore(DatastoreDetails): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'filesystem': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "account_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "filesystem": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'filesystem': {'key': 'filesystem', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "account_name": {"key": "accountName", "type": "str"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "filesystem": {"key": "filesystem", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } def __init__( @@ -1947,7 +2032,9 @@ def __init__( tags: Optional[Dict[str, str]] = None, endpoint: Optional[str] = None, protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, + service_data_access_auth_identity: Optional[ + Union[str, "ServiceDataAccessAuthIdentity"] + ] = None, **kwargs ): """ @@ -1973,13 +2060,21 @@ def __init__( :paramtype service_data_access_auth_identity: str or ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ - super(AzureDataLakeGen2Datastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, **kwargs) - self.datastore_type = 'AzureDataLakeGen2' # type: str + super(AzureDataLakeGen2Datastore, self).__init__( + description=description, + properties=properties, + tags=tags, + credentials=credentials, + **kwargs + ) + self.datastore_type = "AzureDataLakeGen2" # type: str self.account_name = account_name self.endpoint = endpoint self.filesystem = filesystem self.protocol = protocol - self.service_data_access_auth_identity = service_data_access_auth_identity + self.service_data_access_auth_identity = ( + service_data_access_auth_identity + ) class AzureFileDatastore(DatastoreDetails): @@ -2020,25 +2115,28 @@ class AzureFileDatastore(DatastoreDetails): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'file_share_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "account_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "file_share_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'file_share_name': {'key': 'fileShareName', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "account_name": {"key": "accountName", "type": "str"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "file_share_name": {"key": "fileShareName", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } def __init__( @@ -2052,7 +2150,9 @@ def __init__( tags: Optional[Dict[str, str]] = None, endpoint: Optional[str] = None, protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, + service_data_access_auth_identity: Optional[ + Union[str, "ServiceDataAccessAuthIdentity"] + ] = None, **kwargs ): """ @@ -2078,13 +2178,21 @@ def __init__( :paramtype service_data_access_auth_identity: str or ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ - super(AzureFileDatastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, **kwargs) - self.datastore_type = 'AzureFile' # type: str + super(AzureFileDatastore, self).__init__( + description=description, + properties=properties, + tags=tags, + credentials=credentials, + **kwargs + ) + self.datastore_type = "AzureFile" # type: str self.account_name = account_name self.endpoint = endpoint self.file_share_name = file_share_name self.protocol = protocol - self.service_data_access_auth_identity = service_data_access_auth_identity + self.service_data_access_auth_identity = ( + service_data_access_auth_identity + ) class EarlyTerminationPolicy(msrest.serialization.Model): @@ -2106,17 +2214,21 @@ class EarlyTerminationPolicy(msrest.serialization.Model): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, } _subtype_map = { - 'policy_type': {'Bandit': 'BanditPolicy', 'MedianStopping': 'MedianStoppingPolicy', 'TruncationSelection': 'TruncationSelectionPolicy'} + "policy_type": { + "Bandit": "BanditPolicy", + "MedianStopping": "MedianStoppingPolicy", + "TruncationSelection": "TruncationSelectionPolicy", + } } def __init__( @@ -2158,15 +2270,15 @@ class BanditPolicy(EarlyTerminationPolicy): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'slack_amount': {'key': 'slackAmount', 'type': 'float'}, - 'slack_factor': {'key': 'slackFactor', 'type': 'float'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, + "slack_amount": {"key": "slackAmount", "type": "float"}, + "slack_factor": {"key": "slackFactor", "type": "float"}, } def __init__( @@ -2188,8 +2300,12 @@ def __init__( :keyword slack_factor: Ratio of the allowed distance from the best performing run. :paramtype slack_factor: float """ - super(BanditPolicy, self).__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs) - self.policy_type = 'Bandit' # type: str + super(BanditPolicy, self).__init__( + delay_evaluation=delay_evaluation, + evaluation_interval=evaluation_interval, + **kwargs + ) + self.policy_type = "Bandit" # type: str self.slack_amount = slack_amount self.slack_factor = slack_factor @@ -2213,25 +2329,21 @@ class Resource(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -2264,28 +2376,24 @@ class TrackedResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, } def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - **kwargs + self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs ): """ :keyword tags: A set of tags. Resource tags. @@ -2332,25 +2440,25 @@ class BatchDeploymentData(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchDeploymentDetails'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": {"key": "properties", "type": "BatchDeploymentDetails"}, + "sku": {"key": "sku", "type": "Sku"}, } def __init__( @@ -2379,7 +2487,9 @@ def __init__( :keyword sku: Sku details required for ARM contract for Autoscaling. :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ - super(BatchDeploymentData, self).__init__(tags=tags, location=location, **kwargs) + super(BatchDeploymentData, self).__init__( + tags=tags, location=location, **kwargs + ) self.identity = identity self.kind = kind self.properties = properties @@ -2403,11 +2513,17 @@ class EndpointDeploymentPropertiesBase(msrest.serialization.Model): """ _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, } def __init__( @@ -2495,26 +2611,38 @@ class BatchDeploymentDetails(EndpointDeploymentPropertiesBase): """ _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'error_threshold': {'key': 'errorThreshold', 'type': 'int'}, - 'logging_level': {'key': 'loggingLevel', 'type': 'str'}, - 'max_concurrency_per_instance': {'key': 'maxConcurrencyPerInstance', 'type': 'int'}, - 'mini_batch_size': {'key': 'miniBatchSize', 'type': 'long'}, - 'model': {'key': 'model', 'type': 'AssetReferenceBase'}, - 'output_action': {'key': 'outputAction', 'type': 'str'}, - 'output_file_name': {'key': 'outputFileName', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'resources': {'key': 'resources', 'type': 'ResourceConfiguration'}, - 'retry_settings': {'key': 'retrySettings', 'type': 'BatchRetrySettings'}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "compute": {"key": "compute", "type": "str"}, + "error_threshold": {"key": "errorThreshold", "type": "int"}, + "logging_level": {"key": "loggingLevel", "type": "str"}, + "max_concurrency_per_instance": { + "key": "maxConcurrencyPerInstance", + "type": "int", + }, + "mini_batch_size": {"key": "miniBatchSize", "type": "long"}, + "model": {"key": "model", "type": "AssetReferenceBase"}, + "output_action": {"key": "outputAction", "type": "str"}, + "output_file_name": {"key": "outputFileName", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "resources": {"key": "resources", "type": "ResourceConfiguration"}, + "retry_settings": { + "key": "retrySettings", + "type": "BatchRetrySettings", + }, } def __init__( @@ -2581,7 +2709,14 @@ def __init__( If not provided, will default to the defaults defined in BatchRetrySettings. :paramtype retry_settings: ~azure.mgmt.machinelearningservices.models.BatchRetrySettings """ - super(BatchDeploymentDetails, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, **kwargs) + super(BatchDeploymentDetails, self).__init__( + code_configuration=code_configuration, + description=description, + environment_id=environment_id, + environment_variables=environment_variables, + properties=properties, + **kwargs + ) self.compute = compute self.error_threshold = error_threshold self.logging_level = logging_level @@ -2595,7 +2730,9 @@ def __init__( self.retry_settings = retry_settings -class BatchDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class BatchDeploymentTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of BatchDeployment entities. :ivar next_link: The link to the next page of BatchDeployment objects. If null, there are no @@ -2606,8 +2743,8 @@ class BatchDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Mode """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchDeploymentData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[BatchDeploymentData]"}, } def __init__( @@ -2624,7 +2761,9 @@ def __init__( :keyword value: An array of objects of type BatchDeployment. :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchDeploymentData] """ - super(BatchDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) + super(BatchDeploymentTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -2663,25 +2802,25 @@ class BatchEndpointData(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchEndpointDetails'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": {"key": "properties", "type": "BatchEndpointDetails"}, + "sku": {"key": "sku", "type": "Sku"}, } def __init__( @@ -2710,7 +2849,9 @@ def __init__( :keyword sku: Sku details required for ARM contract for Autoscaling. :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ - super(BatchEndpointData, self).__init__(tags=tags, location=location, **kwargs) + super(BatchEndpointData, self).__init__( + tags=tags, location=location, **kwargs + ) self.identity = identity self.kind = kind self.properties = properties @@ -2726,15 +2867,10 @@ class BatchEndpointDefaults(msrest.serialization.Model): """ _attribute_map = { - 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, + "deployment_name": {"key": "deploymentName", "type": "str"}, } - def __init__( - self, - *, - deployment_name: Optional[str] = None, - **kwargs - ): + def __init__(self, *, deployment_name: Optional[str] = None, **kwargs): """ :keyword deployment_name: Name of the deployment that will be default for the endpoint. This deployment will end up getting 100% traffic when the endpoint scoring URL is invoked. @@ -2770,18 +2906,18 @@ class EndpointPropertiesBase(msrest.serialization.Model): """ _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, + "auth_mode": {"required": True}, + "scoring_uri": {"readonly": True}, + "swagger_uri": {"readonly": True}, } _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, + "auth_mode": {"key": "authMode", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "keys": {"key": "keys", "type": "EndpointAuthKeys"}, + "properties": {"key": "properties", "type": "{str}"}, + "scoring_uri": {"key": "scoringUri", "type": "str"}, + "swagger_uri": {"key": "swaggerUri", "type": "str"}, } def __init__( @@ -2848,21 +2984,21 @@ class BatchEndpointDetails(EndpointPropertiesBase): """ _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "auth_mode": {"required": True}, + "scoring_uri": {"readonly": True}, + "swagger_uri": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'defaults': {'key': 'defaults', 'type': 'BatchEndpointDefaults'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "auth_mode": {"key": "authMode", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "keys": {"key": "keys", "type": "EndpointAuthKeys"}, + "properties": {"key": "properties", "type": "{str}"}, + "scoring_uri": {"key": "scoringUri", "type": "str"}, + "swagger_uri": {"key": "swaggerUri", "type": "str"}, + "defaults": {"key": "defaults", "type": "BatchEndpointDefaults"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } def __init__( @@ -2891,12 +3027,20 @@ def __init__( :keyword defaults: Default values for Batch Endpoint. :paramtype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults """ - super(BatchEndpointDetails, self).__init__(auth_mode=auth_mode, description=description, keys=keys, properties=properties, **kwargs) + super(BatchEndpointDetails, self).__init__( + auth_mode=auth_mode, + description=description, + keys=keys, + properties=properties, + **kwargs + ) self.defaults = defaults self.provisioning_state = None -class BatchEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class BatchEndpointTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of BatchEndpoint entities. :ivar next_link: The link to the next page of BatchEndpoint objects. If null, there are no @@ -2907,8 +3051,8 @@ class BatchEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model) """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchEndpointData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[BatchEndpointData]"}, } def __init__( @@ -2925,7 +3069,9 @@ def __init__( :keyword value: An array of objects of type BatchEndpoint. :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchEndpointData] """ - super(BatchEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) + super(BatchEndpointTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -2940,8 +3086,8 @@ class BatchRetrySettings(msrest.serialization.Model): """ _attribute_map = { - 'max_retries': {'key': 'maxRetries', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "max_retries": {"key": "maxRetries", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } def __init__( @@ -2964,38 +3110,41 @@ def __init__( class SamplingAlgorithm(msrest.serialization.Model): """The Sampling Algorithm used to generate hyperparameter values, along with properties to -configure the algorithm. + configure the algorithm. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BayesianSamplingAlgorithm, GridSamplingAlgorithm, RandomSamplingAlgorithm. + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: BayesianSamplingAlgorithm, GridSamplingAlgorithm, RandomSamplingAlgorithm. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType + :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating + hyperparameter values, along with configuration properties.Constant filled by server. Possible + values include: "Grid", "Random", "Bayesian". + :vartype sampling_algorithm_type: str or + ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } _subtype_map = { - 'sampling_algorithm_type': {'Bayesian': 'BayesianSamplingAlgorithm', 'Grid': 'GridSamplingAlgorithm', 'Random': 'RandomSamplingAlgorithm'} + "sampling_algorithm_type": { + "Bayesian": "BayesianSamplingAlgorithm", + "Grid": "GridSamplingAlgorithm", + "Random": "RandomSamplingAlgorithm", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(SamplingAlgorithm, self).__init__(**kwargs) self.sampling_algorithm_type = None # type: Optional[str] @@ -3013,21 +3162,20 @@ class BayesianSamplingAlgorithm(SamplingAlgorithm): """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(BayesianSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Bayesian' # type: str + self.sampling_algorithm_type = "Bayesian" # type: str class BuildContext(msrest.serialization.Model): @@ -3037,29 +3185,29 @@ class BuildContext(msrest.serialization.Model): :ivar context_uri: Required. [Required] URI of the Docker build context used to build the image. Supports blob URIs on environment creation and may return blob or Git URIs. - - + + .. raw:: html - + . :vartype context_uri: str :ivar dockerfile_path: Path to the Dockerfile in the build context. - - + + .. raw:: html - + . :vartype dockerfile_path: str """ _validation = { - 'context_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "context_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'context_uri': {'key': 'contextUri', 'type': 'str'}, - 'dockerfile_path': {'key': 'dockerfilePath', 'type': 'str'}, + "context_uri": {"key": "contextUri", "type": "str"}, + "dockerfile_path": {"key": "dockerfilePath", "type": "str"}, } def __init__( @@ -3072,18 +3220,18 @@ def __init__( """ :keyword context_uri: Required. [Required] URI of the Docker build context used to build the image. Supports blob URIs on environment creation and may return blob or Git URIs. - - + + .. raw:: html - + . :paramtype context_uri: str :keyword dockerfile_path: Path to the Dockerfile in the build context. - - + + .. raw:: html - + . :paramtype dockerfile_path: str """ @@ -3116,21 +3264,21 @@ class CertificateDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, - 'thumbprint': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials_type": {"required": True}, + "client_id": {"required": True}, + "secrets": {"required": True}, + "tenant_id": {"required": True}, + "thumbprint": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'CertificateDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "authority_url": {"key": "authorityUrl", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + "resource_url": {"key": "resourceUrl", "type": "str"}, + "secrets": {"key": "secrets", "type": "CertificateDatastoreSecrets"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "thumbprint": {"key": "thumbprint", "type": "str"}, } def __init__( @@ -3161,7 +3309,7 @@ def __init__( :paramtype thumbprint: str """ super(CertificateDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Certificate' # type: str + self.credentials_type = "Certificate" # type: str self.authority_url = authority_url self.client_id = client_id self.resource_url = resource_url @@ -3184,26 +3332,21 @@ class CertificateDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'certificate': {'key': 'certificate', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "certificate": {"key": "certificate", "type": "str"}, } - def __init__( - self, - *, - certificate: Optional[str] = None, - **kwargs - ): + def __init__(self, *, certificate: Optional[str] = None, **kwargs): """ :keyword certificate: Service principal certificate. :paramtype certificate: str """ super(CertificateDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Certificate' # type: str + self.secrets_type = "Certificate" # type: str self.certificate = certificate @@ -3215,7 +3358,10 @@ class ClusterUpdateParameters(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties.properties', 'type': 'ScaleSettingsInformation'}, + "properties": { + "key": "properties.properties", + "type": "ScaleSettingsInformation", + }, } def __init__( @@ -3244,20 +3390,20 @@ class CodeConfiguration(msrest.serialization.Model): """ _validation = { - 'scoring_script': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "scoring_script": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'scoring_script': {'key': 'scoringScript', 'type': 'str'}, + "code_id": {"key": "codeId", "type": "str"}, + "scoring_script": {"key": "scoringScript", "type": "str"}, } def __init__( - self, - *, - scoring_script: str, - code_id: Optional[str] = None, - **kwargs + self, *, scoring_script: str, code_id: Optional[str] = None, **kwargs ): """ :keyword code_id: ARM resource ID of the code asset. @@ -3293,27 +3439,22 @@ class CodeContainerData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeContainerDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "CodeContainerDetails"}, } - def __init__( - self, - *, - properties: "CodeContainerDetails", - **kwargs - ): + def __init__(self, *, properties: "CodeContainerDetails", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeContainerDetails @@ -3342,17 +3483,17 @@ class CodeContainerDetails(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, } def __init__( @@ -3374,7 +3515,13 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(CodeContainerDetails, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) + super(CodeContainerDetails, self).__init__( + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs + ) class CodeContainerResourceArmPaginatedResult(msrest.serialization.Model): @@ -3388,8 +3535,8 @@ class CodeContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeContainerData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[CodeContainerData]"}, } def __init__( @@ -3434,27 +3581,22 @@ class CodeVersionData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeVersionDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "CodeVersionDetails"}, } - def __init__( - self, - *, - properties: "CodeVersionDetails", - **kwargs - ): + def __init__(self, *, properties: "CodeVersionDetails", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeVersionDetails @@ -3481,12 +3623,12 @@ class CodeVersionDetails(AssetBase): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'code_uri': {'key': 'codeUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "code_uri": {"key": "codeUri", "type": "str"}, } def __init__( @@ -3514,7 +3656,14 @@ def __init__( :keyword code_uri: Uri where code is located. :paramtype code_uri: str """ - super(CodeVersionDetails, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) + super(CodeVersionDetails, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + **kwargs + ) self.code_uri = code_uri @@ -3529,8 +3678,8 @@ class CodeVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeVersionData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[CodeVersionData]"}, } def __init__( @@ -3594,26 +3743,30 @@ class JobBaseDetails(ResourceBase): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, + "job_type": {"required": True}, + "status": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, } _subtype_map = { - 'job_type': {'Command': 'CommandJob', 'Pipeline': 'PipelineJob', 'Sweep': 'SweepJob'} + "job_type": { + "Command": "CommandJob", + "Pipeline": "PipelineJob", + "Sweep": "SweepJob", + } } def __init__( @@ -3654,13 +3807,15 @@ def __init__( For local jobs, a job endpoint will have an endpoint value of FileStreamObject. :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] """ - super(JobBaseDetails, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + super(JobBaseDetails, self).__init__( + description=description, properties=properties, tags=tags, **kwargs + ) self.compute_id = compute_id self.display_name = display_name self.experiment_name = experiment_name self.identity = identity self.is_archived = is_archived - self.job_type = 'JobBaseDetails' # type: str + self.job_type = "JobBaseDetails" # type: str self.services = services self.status = None @@ -3727,35 +3882,45 @@ class CommandJob(JobBaseDetails): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'parameters': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'CommandJobLimits'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, - 'resources': {'key': 'resources', 'type': 'ResourceConfiguration'}, + "job_type": {"required": True}, + "status": {"readonly": True}, + "command": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "environment_id": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "parameters": {"readonly": True}, + } + + _attribute_map = { + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "code_id": {"key": "codeId", "type": "str"}, + "command": {"key": "command", "type": "str"}, + "distribution": { + "key": "distribution", + "type": "DistributionConfiguration", + }, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "limits": {"key": "limits", "type": "CommandJobLimits"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "parameters": {"key": "parameters", "type": "object"}, + "resources": {"key": "resources", "type": "ResourceConfiguration"}, } def __init__( @@ -3826,8 +3991,19 @@ def __init__( :keyword resources: Compute Resource configuration for the job. :paramtype resources: ~azure.mgmt.machinelearningservices.models.ResourceConfiguration """ - super(CommandJob, self).__init__(description=description, properties=properties, tags=tags, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, services=services, **kwargs) - self.job_type = 'Command' # type: str + super(CommandJob, self).__init__( + description=description, + properties=properties, + tags=tags, + compute_id=compute_id, + display_name=display_name, + experiment_name=experiment_name, + identity=identity, + is_archived=is_archived, + services=services, + **kwargs + ) + self.job_type = "Command" # type: str self.code_id = code_id self.command = command self.distribution = distribution @@ -3857,23 +4033,23 @@ class JobLimits(msrest.serialization.Model): """ _validation = { - 'job_limits_type': {'required': True}, + "job_limits_type": {"required": True}, } _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "job_limits_type": {"key": "jobLimitsType", "type": "str"}, + "timeout": {"key": "timeout", "type": "duration"}, } _subtype_map = { - 'job_limits_type': {'Command': 'CommandJobLimits', 'Sweep': 'SweepJobLimits'} + "job_limits_type": { + "Command": "CommandJobLimits", + "Sweep": "SweepJobLimits", + } } def __init__( - self, - *, - timeout: Optional[datetime.timedelta] = None, - **kwargs + self, *, timeout: Optional[datetime.timedelta] = None, **kwargs ): """ :keyword timeout: The max run duration in ISO 8601 format, after which the job will be @@ -3899,19 +4075,16 @@ class CommandJobLimits(JobLimits): """ _validation = { - 'job_limits_type': {'required': True}, + "job_limits_type": {"required": True}, } _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "job_limits_type": {"key": "jobLimitsType", "type": "str"}, + "timeout": {"key": "timeout", "type": "duration"}, } def __init__( - self, - *, - timeout: Optional[datetime.timedelta] = None, - **kwargs + self, *, timeout: Optional[datetime.timedelta] = None, **kwargs ): """ :keyword timeout: The max run duration in ISO 8601 format, after which the job will be @@ -3919,7 +4092,7 @@ def __init__( :paramtype timeout: ~datetime.timedelta """ super(CommandJobLimits, self).__init__(timeout=timeout, **kwargs) - self.job_limits_type = 'Command' # type: str + self.job_limits_type = "Command" # type: str class ComponentContainerData(Resource): @@ -3945,27 +4118,25 @@ class ComponentContainerData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentContainerDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "ComponentContainerDetails", + }, } - def __init__( - self, - *, - properties: "ComponentContainerDetails", - **kwargs - ): + def __init__(self, *, properties: "ComponentContainerDetails", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentContainerDetails @@ -3978,38 +4149,38 @@ class ComponentContainerDetails(AssetContainer): """Component container definition. -.. raw:: html + .. raw:: html - . + . - Variables are only populated by the server, and will be ignored when sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str + :ivar description: The asset description text. + :vartype description: str + :ivar properties: The asset property dictionary. + :vartype properties: dict[str, str] + :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + :ivar is_archived: Is the asset archived?. + :vartype is_archived: bool + :ivar latest_version: The latest version inside this container. + :vartype latest_version: str + :ivar next_version: The next auto incremental version. + :vartype next_version: str """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, } def __init__( @@ -4031,7 +4202,13 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(ComponentContainerDetails, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) + super(ComponentContainerDetails, self).__init__( + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs + ) class ComponentContainerResourceArmPaginatedResult(msrest.serialization.Model): @@ -4045,8 +4222,8 @@ class ComponentContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentContainerData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ComponentContainerData]"}, } def __init__( @@ -4063,7 +4240,9 @@ def __init__( :keyword value: An array of objects of type ComponentContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainerData] """ - super(ComponentContainerResourceArmPaginatedResult, self).__init__(**kwargs) + super(ComponentContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -4091,27 +4270,22 @@ class ComponentVersionData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentVersionDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "ComponentVersionDetails"}, } - def __init__( - self, - *, - properties: "ComponentVersionDetails", - **kwargs - ): + def __init__(self, *, properties: "ComponentVersionDetails", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentVersionDetails @@ -4134,10 +4308,10 @@ class ComponentVersionDetails(AssetBase): :ivar is_archived: Is the asset archived?. :vartype is_archived: bool :ivar component_spec: Defines Component definition details. - - + + .. raw:: html - + . @@ -4145,12 +4319,12 @@ class ComponentVersionDetails(AssetBase): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'component_spec': {'key': 'componentSpec', 'type': 'object'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "component_spec": {"key": "componentSpec", "type": "object"}, } def __init__( @@ -4176,16 +4350,23 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool :keyword component_spec: Defines Component definition details. - - + + .. raw:: html - + . :paramtype component_spec: any """ - super(ComponentVersionDetails, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) + super(ComponentVersionDetails, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + **kwargs + ) self.component_spec = component_spec @@ -4200,8 +4381,8 @@ class ComponentVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentVersionData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ComponentVersionData]"}, } def __init__( @@ -4218,7 +4399,9 @@ def __init__( :keyword value: An array of objects of type ComponentVersion. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersionData] """ - super(ComponentVersionResourceArmPaginatedResult, self).__init__(**kwargs) + super(ComponentVersionResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -4231,7 +4414,10 @@ class ComputeInstanceSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, + "properties": { + "key": "properties", + "type": "ComputeInstanceProperties", + }, } def __init__( @@ -4287,27 +4473,33 @@ class ComputeInstance(Compute, ComputeInstanceSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": { + "key": "properties", + "type": "ComputeInstanceProperties", + }, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -4330,10 +4522,16 @@ def __init__( MSI and AAD exclusively for authentication. :paramtype disable_local_auth: bool """ - super(ComputeInstance, self).__init__(description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) + super(ComputeInstance, self).__init__( + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'ComputeInstance' # type: str - self.compute_type = 'ComputeInstance' # type: str + self.compute_type = "ComputeInstance" # type: str + self.compute_type = "ComputeInstance" # type: str self.compute_location = None self.provisioning_state = None self.description = description @@ -4355,8 +4553,8 @@ class ComputeInstanceApplication(msrest.serialization.Model): """ _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, + "display_name": {"key": "displayName", "type": "str"}, + "endpoint_uri": {"key": "endpointUri", "type": "str"}, } def __init__( @@ -4390,21 +4588,17 @@ class ComputeInstanceConnectivityEndpoints(msrest.serialization.Model): """ _validation = { - 'public_ip_address': {'readonly': True}, - 'private_ip_address': {'readonly': True}, + "public_ip_address": {"readonly": True}, + "private_ip_address": {"readonly": True}, } _attribute_map = { - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + "public_ip_address": {"key": "publicIpAddress", "type": "str"}, + "private_ip_address": {"key": "privateIpAddress", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ComputeInstanceConnectivityEndpoints, self).__init__(**kwargs) self.public_ip_address = None self.private_ip_address = None @@ -4430,16 +4624,19 @@ class ComputeInstanceContainer(msrest.serialization.Model): """ _validation = { - 'services': {'readonly': True}, + "services": {"readonly": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'autosave': {'key': 'autosave', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'network': {'key': 'network', 'type': 'str'}, - 'environment': {'key': 'environment', 'type': 'ComputeInstanceEnvironmentInfo'}, - 'services': {'key': 'services', 'type': '[object]'}, + "name": {"key": "name", "type": "str"}, + "autosave": {"key": "autosave", "type": "str"}, + "gpu": {"key": "gpu", "type": "str"}, + "network": {"key": "network", "type": "str"}, + "environment": { + "key": "environment", + "type": "ComputeInstanceEnvironmentInfo", + }, + "services": {"key": "services", "type": "[object]"}, } def __init__( @@ -4488,23 +4685,19 @@ class ComputeInstanceCreatedBy(msrest.serialization.Model): """ _validation = { - 'user_name': {'readonly': True}, - 'user_org_id': {'readonly': True}, - 'user_id': {'readonly': True}, + "user_name": {"readonly": True}, + "user_org_id": {"readonly": True}, + "user_id": {"readonly": True}, } _attribute_map = { - 'user_name': {'key': 'userName', 'type': 'str'}, - 'user_org_id': {'key': 'userOrgId', 'type': 'str'}, - 'user_id': {'key': 'userId', 'type': 'str'}, + "user_name": {"key": "userName", "type": "str"}, + "user_org_id": {"key": "userOrgId", "type": "str"}, + "user_id": {"key": "userId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ComputeInstanceCreatedBy, self).__init__(**kwargs) self.user_name = None self.user_org_id = None @@ -4529,10 +4722,10 @@ class ComputeInstanceDataDisk(msrest.serialization.Model): """ _attribute_map = { - 'caching': {'key': 'caching', 'type': 'str'}, - 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, - 'lun': {'key': 'lun', 'type': 'int'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + "caching": {"key": "caching", "type": "str"}, + "disk_size_gb": {"key": "diskSizeGB", "type": "int"}, + "lun": {"key": "lun", "type": "int"}, + "storage_account_type": {"key": "storageAccountType", "type": "str"}, } def __init__( @@ -4541,7 +4734,9 @@ def __init__( caching: Optional[Union[str, "Caching"]] = None, disk_size_gb: Optional[int] = None, lun: Optional[int] = None, - storage_account_type: Optional[Union[str, "StorageAccountType"]] = "Standard_LRS", + storage_account_type: Optional[ + Union[str, "StorageAccountType"] + ] = "Standard_LRS", **kwargs ): """ @@ -4590,15 +4785,15 @@ class ComputeInstanceDataMount(msrest.serialization.Model): """ _attribute_map = { - 'source': {'key': 'source', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'mount_name': {'key': 'mountName', 'type': 'str'}, - 'mount_action': {'key': 'mountAction', 'type': 'str'}, - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - 'mount_state': {'key': 'mountState', 'type': 'str'}, - 'mounted_on': {'key': 'mountedOn', 'type': 'iso-8601'}, - 'error': {'key': 'error', 'type': 'str'}, + "source": {"key": "source", "type": "str"}, + "source_type": {"key": "sourceType", "type": "str"}, + "mount_name": {"key": "mountName", "type": "str"}, + "mount_action": {"key": "mountAction", "type": "str"}, + "created_by": {"key": "createdBy", "type": "str"}, + "mount_path": {"key": "mountPath", "type": "str"}, + "mount_state": {"key": "mountState", "type": "str"}, + "mounted_on": {"key": "mountedOn", "type": "iso-8601"}, + "error": {"key": "error", "type": "str"}, } def __init__( @@ -4658,8 +4853,8 @@ class ComputeInstanceEnvironmentInfo(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "version": {"key": "version", "type": "str"}, } def __init__( @@ -4697,10 +4892,10 @@ class ComputeInstanceLastOperation(msrest.serialization.Model): """ _attribute_map = { - 'operation_name': {'key': 'operationName', 'type': 'str'}, - 'operation_time': {'key': 'operationTime', 'type': 'iso-8601'}, - 'operation_status': {'key': 'operationStatus', 'type': 'str'}, - 'operation_trigger': {'key': 'operationTrigger', 'type': 'str'}, + "operation_name": {"key": "operationName", "type": "str"}, + "operation_time": {"key": "operationTime", "type": "iso-8601"}, + "operation_status": {"key": "operationStatus", "type": "str"}, + "operation_trigger": {"key": "operationTrigger", "type": "str"}, } def __init__( @@ -4798,39 +4993,69 @@ class ComputeInstanceProperties(msrest.serialization.Model): """ _validation = { - 'connectivity_endpoints': {'readonly': True}, - 'applications': {'readonly': True}, - 'created_by': {'readonly': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'last_operation': {'readonly': True}, - 'schedules': {'readonly': True}, - 'containers': {'readonly': True}, - 'data_disks': {'readonly': True}, - 'data_mounts': {'readonly': True}, - 'versions': {'readonly': True}, - } - - _attribute_map = { - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'application_sharing_policy': {'key': 'applicationSharingPolicy', 'type': 'str'}, - 'ssh_settings': {'key': 'sshSettings', 'type': 'ComputeInstanceSshSettings'}, - 'connectivity_endpoints': {'key': 'connectivityEndpoints', 'type': 'ComputeInstanceConnectivityEndpoints'}, - 'applications': {'key': 'applications', 'type': '[ComputeInstanceApplication]'}, - 'created_by': {'key': 'createdBy', 'type': 'ComputeInstanceCreatedBy'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'compute_instance_authorization_type': {'key': 'computeInstanceAuthorizationType', 'type': 'str'}, - 'personal_compute_instance_settings': {'key': 'personalComputeInstanceSettings', 'type': 'PersonalComputeInstanceSettings'}, - 'setup_scripts': {'key': 'setupScripts', 'type': 'SetupScripts'}, - 'last_operation': {'key': 'lastOperation', 'type': 'ComputeInstanceLastOperation'}, - 'schedules': {'key': 'schedules', 'type': 'ComputeSchedules'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'containers': {'key': 'containers', 'type': '[ComputeInstanceContainer]'}, - 'data_disks': {'key': 'dataDisks', 'type': '[ComputeInstanceDataDisk]'}, - 'data_mounts': {'key': 'dataMounts', 'type': '[ComputeInstanceDataMount]'}, - 'versions': {'key': 'versions', 'type': 'ComputeInstanceVersion'}, + "connectivity_endpoints": {"readonly": True}, + "applications": {"readonly": True}, + "created_by": {"readonly": True}, + "errors": {"readonly": True}, + "state": {"readonly": True}, + "last_operation": {"readonly": True}, + "schedules": {"readonly": True}, + "containers": {"readonly": True}, + "data_disks": {"readonly": True}, + "data_mounts": {"readonly": True}, + "versions": {"readonly": True}, + } + + _attribute_map = { + "vm_size": {"key": "vmSize", "type": "str"}, + "subnet": {"key": "subnet", "type": "ResourceId"}, + "application_sharing_policy": { + "key": "applicationSharingPolicy", + "type": "str", + }, + "ssh_settings": { + "key": "sshSettings", + "type": "ComputeInstanceSshSettings", + }, + "connectivity_endpoints": { + "key": "connectivityEndpoints", + "type": "ComputeInstanceConnectivityEndpoints", + }, + "applications": { + "key": "applications", + "type": "[ComputeInstanceApplication]", + }, + "created_by": {"key": "createdBy", "type": "ComputeInstanceCreatedBy"}, + "errors": {"key": "errors", "type": "[ErrorResponse]"}, + "state": {"key": "state", "type": "str"}, + "compute_instance_authorization_type": { + "key": "computeInstanceAuthorizationType", + "type": "str", + }, + "personal_compute_instance_settings": { + "key": "personalComputeInstanceSettings", + "type": "PersonalComputeInstanceSettings", + }, + "setup_scripts": {"key": "setupScripts", "type": "SetupScripts"}, + "last_operation": { + "key": "lastOperation", + "type": "ComputeInstanceLastOperation", + }, + "schedules": {"key": "schedules", "type": "ComputeSchedules"}, + "enable_node_public_ip": {"key": "enableNodePublicIp", "type": "bool"}, + "containers": { + "key": "containers", + "type": "[ComputeInstanceContainer]", + }, + "data_disks": { + "key": "dataDisks", + "type": "[ComputeInstanceDataDisk]", + }, + "data_mounts": { + "key": "dataMounts", + "type": "[ComputeInstanceDataMount]", + }, + "versions": {"key": "versions", "type": "ComputeInstanceVersion"}, } def __init__( @@ -4838,10 +5063,16 @@ def __init__( *, vm_size: Optional[str] = None, subnet: Optional["ResourceId"] = None, - application_sharing_policy: Optional[Union[str, "ApplicationSharingPolicy"]] = "Shared", + application_sharing_policy: Optional[ + Union[str, "ApplicationSharingPolicy"] + ] = "Shared", ssh_settings: Optional["ComputeInstanceSshSettings"] = None, - compute_instance_authorization_type: Optional[Union[str, "ComputeInstanceAuthorizationType"]] = "personal", - personal_compute_instance_settings: Optional["PersonalComputeInstanceSettings"] = None, + compute_instance_authorization_type: Optional[ + Union[str, "ComputeInstanceAuthorizationType"] + ] = "personal", + personal_compute_instance_settings: Optional[ + "PersonalComputeInstanceSettings" + ] = None, setup_scripts: Optional["SetupScripts"] = None, enable_node_public_ip: Optional[bool] = None, **kwargs @@ -4886,8 +5117,12 @@ def __init__( self.created_by = None self.errors = None self.state = None - self.compute_instance_authorization_type = compute_instance_authorization_type - self.personal_compute_instance_settings = personal_compute_instance_settings + self.compute_instance_authorization_type = ( + compute_instance_authorization_type + ) + self.personal_compute_instance_settings = ( + personal_compute_instance_settings + ) self.setup_scripts = setup_scripts self.last_operation = None self.schedules = None @@ -4918,21 +5153,23 @@ class ComputeInstanceSshSettings(msrest.serialization.Model): """ _validation = { - 'admin_user_name': {'readonly': True}, - 'ssh_port': {'readonly': True}, + "admin_user_name": {"readonly": True}, + "ssh_port": {"readonly": True}, } _attribute_map = { - 'ssh_public_access': {'key': 'sshPublicAccess', 'type': 'str'}, - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'admin_public_key': {'key': 'adminPublicKey', 'type': 'str'}, + "ssh_public_access": {"key": "sshPublicAccess", "type": "str"}, + "admin_user_name": {"key": "adminUserName", "type": "str"}, + "ssh_port": {"key": "sshPort", "type": "int"}, + "admin_public_key": {"key": "adminPublicKey", "type": "str"}, } def __init__( self, *, - ssh_public_access: Optional[Union[str, "SshPublicAccess"]] = "Disabled", + ssh_public_access: Optional[ + Union[str, "SshPublicAccess"] + ] = "Disabled", admin_public_key: Optional[str] = None, **kwargs ): @@ -4961,15 +5198,10 @@ class ComputeInstanceVersion(msrest.serialization.Model): """ _attribute_map = { - 'runtime': {'key': 'runtime', 'type': 'str'}, + "runtime": {"key": "runtime", "type": "str"}, } - def __init__( - self, - *, - runtime: Optional[str] = None, - **kwargs - ): + def __init__(self, *, runtime: Optional[str] = None, **kwargs): """ :keyword runtime: Runtime of compute instance. :paramtype runtime: str @@ -4986,15 +5218,10 @@ class ComputeResourceSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, + "properties": {"key": "properties", "type": "Compute"}, } - def __init__( - self, - *, - properties: Optional["Compute"] = None, - **kwargs - ): + def __init__(self, *, properties: Optional["Compute"] = None, **kwargs): """ :keyword properties: Compute properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute @@ -5032,22 +5259,22 @@ class ComputeResource(Resource, ComputeResourceSchema): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "properties": {"key": "properties", "type": "Compute"}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, } def __init__( @@ -5097,7 +5324,10 @@ class ComputeSchedules(msrest.serialization.Model): """ _attribute_map = { - 'compute_start_stop': {'key': 'computeStartStop', 'type': '[ComputeStartStopSchedule]'}, + "compute_start_stop": { + "key": "computeStartStop", + "type": "[ComputeStartStopSchedule]", + }, } def __init__( @@ -5133,15 +5363,15 @@ class ComputeStartStopSchedule(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'provisioning_status': {'readonly': True}, + "id": {"readonly": True}, + "provisioning_status": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'ScheduleBase'}, + "id": {"key": "id", "type": "str"}, + "provisioning_status": {"key": "provisioningStatus", "type": "str"}, + "action": {"key": "action", "type": "str"}, + "schedule": {"key": "schedule", "type": "ScheduleBase"}, } def __init__( @@ -5176,15 +5406,25 @@ class ContainerResourceRequirements(msrest.serialization.Model): """ _attribute_map = { - 'container_resource_limits': {'key': 'containerResourceLimits', 'type': 'ContainerResourceSettings'}, - 'container_resource_requests': {'key': 'containerResourceRequests', 'type': 'ContainerResourceSettings'}, + "container_resource_limits": { + "key": "containerResourceLimits", + "type": "ContainerResourceSettings", + }, + "container_resource_requests": { + "key": "containerResourceRequests", + "type": "ContainerResourceSettings", + }, } def __init__( self, *, - container_resource_limits: Optional["ContainerResourceSettings"] = None, - container_resource_requests: Optional["ContainerResourceSettings"] = None, + container_resource_limits: Optional[ + "ContainerResourceSettings" + ] = None, + container_resource_requests: Optional[ + "ContainerResourceSettings" + ] = None, **kwargs ): """ @@ -5215,9 +5455,9 @@ class ContainerResourceSettings(msrest.serialization.Model): """ _attribute_map = { - 'cpu': {'key': 'cpu', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'memory': {'key': 'memory', 'type': 'str'}, + "cpu": {"key": "cpu", "type": "str"}, + "gpu": {"key": "gpu", "type": "str"}, + "memory": {"key": "memory", "type": "str"}, } def __init__( @@ -5253,14 +5493,14 @@ class CosmosDbSettings(msrest.serialization.Model): """ _attribute_map = { - 'collections_throughput': {'key': 'collectionsThroughput', 'type': 'int'}, + "collections_throughput": { + "key": "collectionsThroughput", + "type": "int", + }, } def __init__( - self, - *, - collections_throughput: Optional[int] = None, - **kwargs + self, *, collections_throughput: Optional[int] = None, **kwargs ): """ :keyword collections_throughput: The throughput of the collections in cosmosdb database. @@ -5295,19 +5535,22 @@ class ScheduleBase(msrest.serialization.Model): """ _validation = { - 'schedule_type': {'required': True}, + "schedule_type": {"required": True}, } _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'schedule_status': {'key': 'scheduleStatus', 'type': 'str'}, - 'schedule_type': {'key': 'scheduleType', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, + "end_time": {"key": "endTime", "type": "iso-8601"}, + "schedule_status": {"key": "scheduleStatus", "type": "str"}, + "schedule_type": {"key": "scheduleType", "type": "str"}, + "start_time": {"key": "startTime", "type": "iso-8601"}, + "time_zone": {"key": "timeZone", "type": "str"}, } _subtype_map = { - 'schedule_type': {'Cron': 'CronSchedule', 'Recurrence': 'RecurrenceSchedule'} + "schedule_type": { + "Cron": "CronSchedule", + "Recurrence": "RecurrenceSchedule", + } } def __init__( @@ -5365,17 +5608,17 @@ class CronSchedule(ScheduleBase): """ _validation = { - 'schedule_type': {'required': True}, - 'expression': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "schedule_type": {"required": True}, + "expression": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'schedule_status': {'key': 'scheduleStatus', 'type': 'str'}, - 'schedule_type': {'key': 'scheduleType', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, + "end_time": {"key": "endTime", "type": "iso-8601"}, + "schedule_status": {"key": "scheduleStatus", "type": "str"}, + "schedule_type": {"key": "scheduleType", "type": "str"}, + "start_time": {"key": "startTime", "type": "iso-8601"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "expression": {"key": "expression", "type": "str"}, } def __init__( @@ -5404,8 +5647,14 @@ def __init__( The expression should follow NCronTab format. :paramtype expression: str """ - super(CronSchedule, self).__init__(end_time=end_time, schedule_status=schedule_status, start_time=start_time, time_zone=time_zone, **kwargs) - self.schedule_type = 'Cron' # type: str + super(CronSchedule, self).__init__( + end_time=end_time, + schedule_status=schedule_status, + start_time=start_time, + time_zone=time_zone, + **kwargs + ) + self.schedule_type = "Cron" # type: str self.expression = expression @@ -5426,24 +5675,27 @@ class JobInput(msrest.serialization.Model): """ _validation = { - 'job_input_type': {'required': True}, + "job_input_type": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } _subtype_map = { - 'job_input_type': {'custom_model': 'CustomModelJobInput', 'literal': 'LiteralJobInput', 'mlflow_model': 'MLFlowModelJobInput', 'mltable': 'MLTableJobInput', 'triton_model': 'TritonModelJobInput', 'uri_file': 'UriFileJobInput', 'uri_folder': 'UriFolderJobInput'} + "job_input_type": { + "custom_model": "CustomModelJobInput", + "literal": "LiteralJobInput", + "mlflow_model": "MLFlowModelJobInput", + "mltable": "MLTableJobInput", + "triton_model": "TritonModelJobInput", + "uri_file": "UriFileJobInput", + "uri_folder": "UriFolderJobInput", + } } - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): + def __init__(self, *, description: Optional[str] = None, **kwargs): """ :keyword description: Description for the input. :paramtype description: str @@ -5472,15 +5724,15 @@ class CustomModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -5500,12 +5752,14 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(CustomModelJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(CustomModelJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'custom_model' # type: str + self.job_input_type = "custom_model" # type: str self.description = description - self.job_input_type = 'custom_model' # type: str + self.job_input_type = "custom_model" # type: str class JobOutput(msrest.serialization.Model): @@ -5525,24 +5779,26 @@ class JobOutput(msrest.serialization.Model): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } _subtype_map = { - 'job_output_type': {'custom_model': 'CustomModelJobOutput', 'mlflow_model': 'MLFlowModelJobOutput', 'mltable': 'MLTableJobOutput', 'triton_model': 'TritonModelJobOutput', 'uri_file': 'UriFileJobOutput', 'uri_folder': 'UriFolderJobOutput'} + "job_output_type": { + "custom_model": "CustomModelJobOutput", + "mlflow_model": "MLFlowModelJobOutput", + "mltable": "MLTableJobOutput", + "triton_model": "TritonModelJobOutput", + "uri_file": "UriFileJobOutput", + "uri_folder": "UriFolderJobOutput", + } } - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): + def __init__(self, *, description: Optional[str] = None, **kwargs): """ :keyword description: Description for the output. :paramtype description: str @@ -5570,14 +5826,14 @@ class CustomModelJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -5596,12 +5852,14 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(CustomModelJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(CustomModelJobOutput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_output_type = 'custom_model' # type: str + self.job_output_type = "custom_model" # type: str self.description = description - self.job_output_type = 'custom_model' # type: str + self.job_output_type = "custom_model" # type: str class DatabricksSchema(msrest.serialization.Model): @@ -5612,14 +5870,11 @@ class DatabricksSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, + "properties": {"key": "properties", "type": "DatabricksProperties"}, } def __init__( - self, - *, - properties: Optional["DatabricksProperties"] = None, - **kwargs + self, *, properties: Optional["DatabricksProperties"] = None, **kwargs ): """ :keyword properties: Properties of Databricks. @@ -5668,27 +5923,30 @@ class Databricks(Compute, DatabricksSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "DatabricksProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -5711,10 +5969,16 @@ def __init__( MSI and AAD exclusively for authentication. :paramtype disable_local_auth: bool """ - super(Databricks, self).__init__(description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) + super(Databricks, self).__init__( + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'Databricks' # type: str - self.compute_type = 'Databricks' # type: str + self.compute_type = "Databricks" # type: str + self.compute_type = "Databricks" # type: str self.compute_location = None self.provisioning_state = None self.description = description @@ -5734,14 +5998,14 @@ class DatabricksComputeSecretsProperties(msrest.serialization.Model): """ _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, } def __init__( - self, - *, - databricks_access_token: Optional[str] = None, - **kwargs + self, *, databricks_access_token: Optional[str] = None, **kwargs ): """ :keyword databricks_access_token: access token for databricks account. @@ -5751,7 +6015,9 @@ def __init__( self.databricks_access_token = databricks_access_token -class DatabricksComputeSecrets(ComputeSecrets, DatabricksComputeSecretsProperties): +class DatabricksComputeSecrets( + ComputeSecrets, DatabricksComputeSecretsProperties +): """Secrets related to a Machine Learning compute based on Databricks. All required parameters must be populated in order to send to Azure. @@ -5765,28 +6031,30 @@ class DatabricksComputeSecrets(ComputeSecrets, DatabricksComputeSecretsPropertie """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, + "compute_type": {"key": "computeType", "type": "str"}, } def __init__( - self, - *, - databricks_access_token: Optional[str] = None, - **kwargs + self, *, databricks_access_token: Optional[str] = None, **kwargs ): """ :keyword databricks_access_token: access token for databricks account. :paramtype databricks_access_token: str """ - super(DatabricksComputeSecrets, self).__init__(databricks_access_token=databricks_access_token, **kwargs) + super(DatabricksComputeSecrets, self).__init__( + databricks_access_token=databricks_access_token, **kwargs + ) self.databricks_access_token = databricks_access_token - self.compute_type = 'Databricks' # type: str - self.compute_type = 'Databricks' # type: str + self.compute_type = "Databricks" # type: str + self.compute_type = "Databricks" # type: str class DatabricksProperties(msrest.serialization.Model): @@ -5799,8 +6067,11 @@ class DatabricksProperties(msrest.serialization.Model): """ _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'workspace_url': {'key': 'workspaceUrl', 'type': 'str'}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, + "workspace_url": {"key": "workspaceUrl", "type": "str"}, } def __init__( @@ -5844,27 +6115,22 @@ class DataContainerData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataContainerDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "DataContainerDetails"}, } - def __init__( - self, - *, - properties: "DataContainerDetails", - **kwargs - ): + def __init__(self, *, properties: "DataContainerDetails", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataContainerDetails @@ -5898,19 +6164,19 @@ class DataContainerDetails(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'data_type': {'required': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "data_type": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "data_type": {"key": "dataType", "type": "str"}, } def __init__( @@ -5936,7 +6202,13 @@ def __init__( "uri_file", "uri_folder", "mltable". :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType """ - super(DataContainerDetails, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) + super(DataContainerDetails, self).__init__( + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs + ) self.data_type = data_type @@ -5951,8 +6223,8 @@ class DataContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataContainerData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[DataContainerData]"}, } def __init__( @@ -6011,26 +6283,29 @@ class DataFactory(Compute): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -6050,8 +6325,13 @@ def __init__( MSI and AAD exclusively for authentication. :paramtype disable_local_auth: bool """ - super(DataFactory, self).__init__(description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, **kwargs) - self.compute_type = 'DataFactory' # type: str + super(DataFactory, self).__init__( + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + **kwargs + ) + self.compute_type = "DataFactory" # type: str class DataLakeAnalyticsSchema(msrest.serialization.Model): @@ -6063,7 +6343,10 @@ class DataLakeAnalyticsSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, + "properties": { + "key": "properties", + "type": "DataLakeAnalyticsSchemaProperties", + }, } def __init__( @@ -6121,27 +6404,33 @@ class DataLakeAnalytics(Compute, DataLakeAnalyticsSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": { + "key": "properties", + "type": "DataLakeAnalyticsSchemaProperties", + }, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -6165,10 +6454,16 @@ def __init__( MSI and AAD exclusively for authentication. :paramtype disable_local_auth: bool """ - super(DataLakeAnalytics, self).__init__(description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) + super(DataLakeAnalytics, self).__init__( + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'DataLakeAnalytics' # type: str - self.compute_type = 'DataLakeAnalytics' # type: str + self.compute_type = "DataLakeAnalytics" # type: str + self.compute_type = "DataLakeAnalytics" # type: str self.compute_location = None self.provisioning_state = None self.description = description @@ -6188,14 +6483,14 @@ class DataLakeAnalyticsSchemaProperties(msrest.serialization.Model): """ _attribute_map = { - 'data_lake_store_account_name': {'key': 'dataLakeStoreAccountName', 'type': 'str'}, + "data_lake_store_account_name": { + "key": "dataLakeStoreAccountName", + "type": "str", + }, } def __init__( - self, - *, - data_lake_store_account_name: Optional[str] = None, - **kwargs + self, *, data_lake_store_account_name: Optional[str] = None, **kwargs ): """ :keyword data_lake_store_account_name: DataLake Store Account Name. @@ -6220,13 +6515,13 @@ class DataPathAssetReference(AssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'datastore_id': {'key': 'datastoreId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "datastore_id": {"key": "datastoreId", "type": "str"}, + "path": {"key": "path", "type": "str"}, } def __init__( @@ -6243,7 +6538,7 @@ def __init__( :paramtype path: str """ super(DataPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'DataPath' # type: str + self.reference_type = "DataPath" # type: str self.datastore_id = datastore_id self.path = path @@ -6271,27 +6566,22 @@ class DatastoreData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DatastoreDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "DatastoreDetails"}, } - def __init__( - self, - *, - properties: "DatastoreDetails", - **kwargs - ): + def __init__(self, *, properties: "DatastoreDetails", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatastoreDetails @@ -6311,8 +6601,8 @@ class DatastoreResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DatastoreData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[DatastoreData]"}, } def __init__( @@ -6357,27 +6647,22 @@ class DataVersionBaseData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataVersionBaseDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "DataVersionBaseDetails"}, } - def __init__( - self, - *, - properties: "DataVersionBaseDetails", - **kwargs - ): + def __init__(self, *, properties: "DataVersionBaseDetails", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataVersionBaseDetails @@ -6413,22 +6698,26 @@ class DataVersionBaseDetails(AssetBase): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, } _subtype_map = { - 'data_type': {'mltable': 'MLTableData', 'uri_file': 'UriFileDataVersion', 'uri_folder': 'UriFolderDataVersion'} + "data_type": { + "mltable": "MLTableData", + "uri_file": "UriFileDataVersion", + "uri_folder": "UriFolderDataVersion", + } } def __init__( @@ -6457,8 +6746,15 @@ def __init__( Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20220501.Assets.DataVersionBase.DataType. :paramtype data_uri: str """ - super(DataVersionBaseDetails, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.data_type = 'DataVersionBaseDetails' # type: str + super(DataVersionBaseDetails, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + **kwargs + ) + self.data_type = "DataVersionBaseDetails" # type: str self.data_uri = data_uri @@ -6473,8 +6769,8 @@ class DataVersionBaseResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataVersionBaseData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[DataVersionBaseData]"}, } def __init__( @@ -6491,7 +6787,9 @@ def __init__( :keyword value: An array of objects of type DataVersionBase. :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBaseData] """ - super(DataVersionBaseResourceArmPaginatedResult, self).__init__(**kwargs) + super(DataVersionBaseResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -6510,23 +6808,22 @@ class OnlineScaleSettings(msrest.serialization.Model): """ _validation = { - 'scale_type': {'required': True}, + "scale_type": {"required": True}, } _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, + "scale_type": {"key": "scaleType", "type": "str"}, } _subtype_map = { - 'scale_type': {'Default': 'DefaultScaleSettings', 'TargetUtilization': 'TargetUtilizationScaleSettings'} + "scale_type": { + "Default": "DefaultScaleSettings", + "TargetUtilization": "TargetUtilizationScaleSettings", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(OnlineScaleSettings, self).__init__(**kwargs) self.scale_type = None # type: Optional[str] @@ -6542,21 +6839,17 @@ class DefaultScaleSettings(OnlineScaleSettings): """ _validation = { - 'scale_type': {'required': True}, + "scale_type": {"required": True}, } _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, + "scale_type": {"key": "scaleType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DefaultScaleSettings, self).__init__(**kwargs) - self.scale_type = 'Default' # type: str + self.scale_type = "Default" # type: str class DeploymentLogs(msrest.serialization.Model): @@ -6567,15 +6860,10 @@ class DeploymentLogs(msrest.serialization.Model): """ _attribute_map = { - 'content': {'key': 'content', 'type': 'str'}, + "content": {"key": "content", "type": "str"}, } - def __init__( - self, - *, - content: Optional[str] = None, - **kwargs - ): + def __init__(self, *, content: Optional[str] = None, **kwargs): """ :keyword content: The retrieved online deployment logs. :paramtype content: str @@ -6595,8 +6883,8 @@ class DeploymentLogsRequest(msrest.serialization.Model): """ _attribute_map = { - 'container_type': {'key': 'containerType', 'type': 'str'}, - 'tail': {'key': 'tail', 'type': 'int'}, + "container_type": {"key": "containerType", "type": "str"}, + "tail": {"key": "tail", "type": "int"}, } def __init__( @@ -6642,15 +6930,18 @@ class DiagnoseRequestProperties(msrest.serialization.Model): """ _attribute_map = { - 'udr': {'key': 'udr', 'type': '{object}'}, - 'nsg': {'key': 'nsg', 'type': '{object}'}, - 'resource_lock': {'key': 'resourceLock', 'type': '{object}'}, - 'dns_resolution': {'key': 'dnsResolution', 'type': '{object}'}, - 'storage_account': {'key': 'storageAccount', 'type': '{object}'}, - 'key_vault': {'key': 'keyVault', 'type': '{object}'}, - 'container_registry': {'key': 'containerRegistry', 'type': '{object}'}, - 'application_insights': {'key': 'applicationInsights', 'type': '{object}'}, - 'others': {'key': 'others', 'type': '{object}'}, + "udr": {"key": "udr", "type": "{object}"}, + "nsg": {"key": "nsg", "type": "{object}"}, + "resource_lock": {"key": "resourceLock", "type": "{object}"}, + "dns_resolution": {"key": "dnsResolution", "type": "{object}"}, + "storage_account": {"key": "storageAccount", "type": "{object}"}, + "key_vault": {"key": "keyVault", "type": "{object}"}, + "container_registry": {"key": "containerRegistry", "type": "{object}"}, + "application_insights": { + "key": "applicationInsights", + "type": "{object}", + }, + "others": {"key": "others", "type": "{object}"}, } def __init__( @@ -6707,7 +6998,7 @@ class DiagnoseResponseResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseResponseResultValue'}, + "value": {"key": "value", "type": "DiagnoseResponseResultValue"}, } def __init__( @@ -6754,15 +7045,39 @@ class DiagnoseResponseResultValue(msrest.serialization.Model): """ _attribute_map = { - 'user_defined_route_results': {'key': 'userDefinedRouteResults', 'type': '[DiagnoseResult]'}, - 'network_security_rule_results': {'key': 'networkSecurityRuleResults', 'type': '[DiagnoseResult]'}, - 'resource_lock_results': {'key': 'resourceLockResults', 'type': '[DiagnoseResult]'}, - 'dns_resolution_results': {'key': 'dnsResolutionResults', 'type': '[DiagnoseResult]'}, - 'storage_account_results': {'key': 'storageAccountResults', 'type': '[DiagnoseResult]'}, - 'key_vault_results': {'key': 'keyVaultResults', 'type': '[DiagnoseResult]'}, - 'container_registry_results': {'key': 'containerRegistryResults', 'type': '[DiagnoseResult]'}, - 'application_insights_results': {'key': 'applicationInsightsResults', 'type': '[DiagnoseResult]'}, - 'other_results': {'key': 'otherResults', 'type': '[DiagnoseResult]'}, + "user_defined_route_results": { + "key": "userDefinedRouteResults", + "type": "[DiagnoseResult]", + }, + "network_security_rule_results": { + "key": "networkSecurityRuleResults", + "type": "[DiagnoseResult]", + }, + "resource_lock_results": { + "key": "resourceLockResults", + "type": "[DiagnoseResult]", + }, + "dns_resolution_results": { + "key": "dnsResolutionResults", + "type": "[DiagnoseResult]", + }, + "storage_account_results": { + "key": "storageAccountResults", + "type": "[DiagnoseResult]", + }, + "key_vault_results": { + "key": "keyVaultResults", + "type": "[DiagnoseResult]", + }, + "container_registry_results": { + "key": "containerRegistryResults", + "type": "[DiagnoseResult]", + }, + "application_insights_results": { + "key": "applicationInsightsResults", + "type": "[DiagnoseResult]", + }, + "other_results": {"key": "otherResults", "type": "[DiagnoseResult]"}, } def __init__( @@ -6833,23 +7148,19 @@ class DiagnoseResult(msrest.serialization.Model): """ _validation = { - 'code': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, + "code": {"readonly": True}, + "level": {"readonly": True}, + "message": {"readonly": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, + "code": {"key": "code", "type": "str"}, + "level": {"key": "level", "type": "str"}, + "message": {"key": "message", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DiagnoseResult, self).__init__(**kwargs) self.code = None self.level = None @@ -6864,14 +7175,11 @@ class DiagnoseWorkspaceParameters(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseRequestProperties'}, + "value": {"key": "value", "type": "DiagnoseRequestProperties"}, } def __init__( - self, - *, - value: Optional["DiagnoseRequestProperties"] = None, - **kwargs + self, *, value: Optional["DiagnoseRequestProperties"] = None, **kwargs ): """ :keyword value: Value of Parameters. @@ -6895,23 +7203,23 @@ class DistributionConfiguration(msrest.serialization.Model): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, + "distribution_type": {"key": "distributionType", "type": "str"}, } _subtype_map = { - 'distribution_type': {'Mpi': 'Mpi', 'PyTorch': 'PyTorch', 'TensorFlow': 'TensorFlow'} + "distribution_type": { + "Mpi": "Mpi", + "PyTorch": "PyTorch", + "TensorFlow": "TensorFlow", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DistributionConfiguration, self).__init__(**kwargs) self.distribution_type = None # type: Optional[str] @@ -6932,14 +7240,14 @@ class EncryptionKeyVaultProperties(msrest.serialization.Model): """ _validation = { - 'key_vault_arm_id': {'required': True}, - 'key_identifier': {'required': True}, + "key_vault_arm_id": {"required": True}, + "key_identifier": {"required": True}, } _attribute_map = { - 'key_vault_arm_id': {'key': 'keyVaultArmId', 'type': 'str'}, - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - 'identity_client_id': {'key': 'identityClientId', 'type': 'str'}, + "key_vault_arm_id": {"key": "keyVaultArmId", "type": "str"}, + "key_identifier": {"key": "keyIdentifier", "type": "str"}, + "identity_client_id": {"key": "identityClientId", "type": "str"}, } def __init__( @@ -6982,14 +7290,17 @@ class EncryptionProperty(msrest.serialization.Model): """ _validation = { - 'status': {'required': True}, - 'key_vault_properties': {'required': True}, + "status": {"required": True}, + "key_vault_properties": {"required": True}, } _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityForCmk'}, - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'EncryptionKeyVaultProperties'}, + "status": {"key": "status", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityForCmk"}, + "key_vault_properties": { + "key": "keyVaultProperties", + "type": "EncryptionKeyVaultProperties", + }, } def __init__( @@ -7027,8 +7338,8 @@ class EndpointAuthKeys(msrest.serialization.Model): """ _attribute_map = { - 'primary_key': {'key': 'primaryKey', 'type': 'str'}, - 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, + "primary_key": {"key": "primaryKey", "type": "str"}, + "secondary_key": {"key": "secondaryKey", "type": "str"}, } def __init__( @@ -7063,10 +7374,13 @@ class EndpointAuthToken(msrest.serialization.Model): """ _attribute_map = { - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'expiry_time_utc': {'key': 'expiryTimeUtc', 'type': 'long'}, - 'refresh_after_time_utc': {'key': 'refreshAfterTimeUtc', 'type': 'long'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, + "access_token": {"key": "accessToken", "type": "str"}, + "expiry_time_utc": {"key": "expiryTimeUtc", "type": "long"}, + "refresh_after_time_utc": { + "key": "refreshAfterTimeUtc", + "type": "long", + }, + "token_type": {"key": "tokenType", "type": "str"}, } def __init__( @@ -7118,27 +7432,25 @@ class EnvironmentContainerData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentContainerDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "EnvironmentContainerDetails", + }, } - def __init__( - self, - *, - properties: "EnvironmentContainerDetails", - **kwargs - ): + def __init__(self, *, properties: "EnvironmentContainerDetails", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerDetails @@ -7167,17 +7479,17 @@ class EnvironmentContainerDetails(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, } def __init__( @@ -7199,10 +7511,18 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(EnvironmentContainerDetails, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) + super(EnvironmentContainerDetails, self).__init__( + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs + ) -class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model): +class EnvironmentContainerResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of EnvironmentContainer entities. :ivar next_link: The link to the next page of EnvironmentContainer objects. If null, there are @@ -7213,8 +7533,8 @@ class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model) """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentContainerData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[EnvironmentContainerData]"}, } def __init__( @@ -7231,7 +7551,9 @@ def __init__( :keyword value: An array of objects of type EnvironmentContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainerData] """ - super(EnvironmentContainerResourceArmPaginatedResult, self).__init__(**kwargs) + super(EnvironmentContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -7259,27 +7581,25 @@ class EnvironmentVersionData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentVersionDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "EnvironmentVersionDetails", + }, } - def __init__( - self, - *, - properties: "EnvironmentVersionDetails", - **kwargs - ): + def __init__(self, *, properties: "EnvironmentVersionDetails", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionDetails @@ -7307,29 +7627,29 @@ class EnvironmentVersionDetails(AssetBase): :vartype build: ~azure.mgmt.machinelearningservices.models.BuildContext :ivar conda_file: Standard configuration file used by Conda that lets you install any kind of package, including Python, R, and C/C++ packages. - - + + .. raw:: html - + . :vartype conda_file: str :ivar environment_type: Environment type is either user managed or curated by the Azure ML service - - + + .. raw:: html - + . Possible values include: "Curated", "UserCreated". :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType :ivar image: Name of the image that will be used for the environment. - - + + .. raw:: html - + . @@ -7342,21 +7662,24 @@ class EnvironmentVersionDetails(AssetBase): """ _validation = { - 'environment_type': {'readonly': True}, + "environment_type": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'build': {'key': 'build', 'type': 'BuildContext'}, - 'conda_file': {'key': 'condaFile', 'type': 'str'}, - 'environment_type': {'key': 'environmentType', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'str'}, - 'inference_config': {'key': 'inferenceConfig', 'type': 'InferenceContainerProperties'}, - 'os_type': {'key': 'osType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "build": {"key": "build", "type": "BuildContext"}, + "conda_file": {"key": "condaFile", "type": "str"}, + "environment_type": {"key": "environmentType", "type": "str"}, + "image": {"key": "image", "type": "str"}, + "inference_config": { + "key": "inferenceConfig", + "type": "InferenceContainerProperties", + }, + "os_type": {"key": "osType", "type": "str"}, } def __init__( @@ -7389,19 +7712,19 @@ def __init__( :paramtype build: ~azure.mgmt.machinelearningservices.models.BuildContext :keyword conda_file: Standard configuration file used by Conda that lets you install any kind of package, including Python, R, and C/C++ packages. - - + + .. raw:: html - + . :paramtype conda_file: str :keyword image: Name of the image that will be used for the environment. - - + + .. raw:: html - + . @@ -7412,7 +7735,14 @@ def __init__( :keyword os_type: The OS type of the environment. Possible values include: "Linux", "Windows". :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.OperatingSystemType """ - super(EnvironmentVersionDetails, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) + super(EnvironmentVersionDetails, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + **kwargs + ) self.build = build self.conda_file = conda_file self.environment_type = None @@ -7432,8 +7762,8 @@ class EnvironmentVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentVersionData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[EnvironmentVersionData]"}, } def __init__( @@ -7450,7 +7780,9 @@ def __init__( :keyword value: An array of objects of type EnvironmentVersion. :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersionData] """ - super(EnvironmentVersionResourceArmPaginatedResult, self).__init__(**kwargs) + super(EnvironmentVersionResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -7467,21 +7799,17 @@ class ErrorAdditionalInfo(msrest.serialization.Model): """ _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, + "type": {"readonly": True}, + "info": {"readonly": True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, + "type": {"key": "type", "type": "str"}, + "info": {"key": "info", "type": "object"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ErrorAdditionalInfo, self).__init__(**kwargs) self.type = None self.info = None @@ -7505,27 +7833,26 @@ class ErrorDetail(msrest.serialization.Model): """ _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, + "code": {"readonly": True}, + "message": {"readonly": True}, + "target": {"readonly": True}, + "details": {"readonly": True}, + "additional_info": {"readonly": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[ErrorDetail]"}, + "additional_info": { + "key": "additionalInfo", + "type": "[ErrorAdditionalInfo]", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ErrorDetail, self).__init__(**kwargs) self.code = None self.message = None @@ -7542,15 +7869,10 @@ class ErrorResponse(msrest.serialization.Model): """ _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, + "error": {"key": "error", "type": "ErrorDetail"}, } - def __init__( - self, - *, - error: Optional["ErrorDetail"] = None, - **kwargs - ): + def __init__(self, *, error: Optional["ErrorDetail"] = None, **kwargs): """ :keyword error: The error object. :paramtype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail @@ -7575,15 +7897,15 @@ class EstimatedVMPrice(msrest.serialization.Model): """ _validation = { - 'retail_price': {'required': True}, - 'os_type': {'required': True}, - 'vm_tier': {'required': True}, + "retail_price": {"required": True}, + "os_type": {"required": True}, + "vm_tier": {"required": True}, } _attribute_map = { - 'retail_price': {'key': 'retailPrice', 'type': 'float'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_tier': {'key': 'vmTier', 'type': 'str'}, + "retail_price": {"key": "retailPrice", "type": "float"}, + "os_type": {"key": "osType", "type": "str"}, + "vm_tier": {"key": "vmTier", "type": "str"}, } def __init__( @@ -7627,15 +7949,15 @@ class EstimatedVMPrices(msrest.serialization.Model): """ _validation = { - 'billing_currency': {'required': True}, - 'unit_of_measure': {'required': True}, - 'values': {'required': True}, + "billing_currency": {"required": True}, + "unit_of_measure": {"required": True}, + "values": {"required": True}, } _attribute_map = { - 'billing_currency': {'key': 'billingCurrency', 'type': 'str'}, - 'unit_of_measure': {'key': 'unitOfMeasure', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[EstimatedVMPrice]'}, + "billing_currency": {"key": "billingCurrency", "type": "str"}, + "unit_of_measure": {"key": "unitOfMeasure", "type": "str"}, + "values": {"key": "values", "type": "[EstimatedVMPrice]"}, } def __init__( @@ -7671,14 +7993,11 @@ class ExternalFQDNResponse(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[FQDNEndpoints]'}, + "value": {"key": "value", "type": "[FQDNEndpoints]"}, } def __init__( - self, - *, - value: Optional[List["FQDNEndpoints"]] = None, - **kwargs + self, *, value: Optional[List["FQDNEndpoints"]] = None, **kwargs ): """ :keyword value: @@ -7696,15 +8015,10 @@ class FlavorData(msrest.serialization.Model): """ _attribute_map = { - 'data': {'key': 'data', 'type': '{str}'}, + "data": {"key": "data", "type": "{str}"}, } - def __init__( - self, - *, - data: Optional[Dict[str, str]] = None, - **kwargs - ): + def __init__(self, *, data: Optional[Dict[str, str]] = None, **kwargs): """ :keyword data: Model flavor-specific data. :paramtype data: dict[str, str] @@ -7723,8 +8037,11 @@ class FQDNEndpoint(msrest.serialization.Model): """ _attribute_map = { - 'domain_name': {'key': 'domainName', 'type': 'str'}, - 'endpoint_details': {'key': 'endpointDetails', 'type': '[FQDNEndpointDetail]'}, + "domain_name": {"key": "domainName", "type": "str"}, + "endpoint_details": { + "key": "endpointDetails", + "type": "[FQDNEndpointDetail]", + }, } def __init__( @@ -7754,15 +8071,10 @@ class FQDNEndpointDetail(msrest.serialization.Model): """ _attribute_map = { - 'port': {'key': 'port', 'type': 'int'}, + "port": {"key": "port", "type": "int"}, } - def __init__( - self, - *, - port: Optional[int] = None, - **kwargs - ): + def __init__(self, *, port: Optional[int] = None, **kwargs): """ :keyword port: :paramtype port: int @@ -7779,7 +8091,7 @@ class FQDNEndpoints(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'FQDNEndpointsProperties'}, + "properties": {"key": "properties", "type": "FQDNEndpointsProperties"}, } def __init__( @@ -7806,8 +8118,8 @@ class FQDNEndpointsProperties(msrest.serialization.Model): """ _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'endpoints': {'key': 'endpoints', 'type': '[FQDNEndpoint]'}, + "category": {"key": "category", "type": "str"}, + "endpoints": {"key": "endpoints", "type": "[FQDNEndpoint]"}, } def __init__( @@ -7841,21 +8153,20 @@ class GridSamplingAlgorithm(SamplingAlgorithm): """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(GridSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Grid' # type: str + self.sampling_algorithm_type = "Grid" # type: str class HDInsightSchema(msrest.serialization.Model): @@ -7866,14 +8177,11 @@ class HDInsightSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, + "properties": {"key": "properties", "type": "HDInsightProperties"}, } def __init__( - self, - *, - properties: Optional["HDInsightProperties"] = None, - **kwargs + self, *, properties: Optional["HDInsightProperties"] = None, **kwargs ): """ :keyword properties: HDInsight compute properties. @@ -7922,27 +8230,30 @@ class HDInsight(Compute, HDInsightSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "HDInsightProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -7965,10 +8276,16 @@ def __init__( MSI and AAD exclusively for authentication. :paramtype disable_local_auth: bool """ - super(HDInsight, self).__init__(description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) + super(HDInsight, self).__init__( + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'HDInsight' # type: str - self.compute_type = 'HDInsight' # type: str + self.compute_type = "HDInsight" # type: str + self.compute_type = "HDInsight" # type: str self.compute_location = None self.provisioning_state = None self.description = description @@ -7993,9 +8310,12 @@ class HDInsightProperties(msrest.serialization.Model): """ _attribute_map = { - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, + "ssh_port": {"key": "sshPort", "type": "int"}, + "address": {"key": "address", "type": "str"}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, } def __init__( @@ -8034,27 +8354,22 @@ class IdAssetReference(AssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, - 'asset_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "reference_type": {"required": True}, + "asset_id": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'asset_id': {'key': 'assetId', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "asset_id": {"key": "assetId", "type": "str"}, } - def __init__( - self, - *, - asset_id: str, - **kwargs - ): + def __init__(self, *, asset_id: str, **kwargs): """ :keyword asset_id: Required. [Required] ARM resource ID of the asset. :paramtype asset_id: str """ super(IdAssetReference, self).__init__(**kwargs) - self.reference_type = 'Id' # type: str + self.reference_type = "Id" # type: str self.asset_id = asset_id @@ -8067,14 +8382,14 @@ class IdentityForCmk(msrest.serialization.Model): """ _attribute_map = { - 'user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, + "user_assigned_identity": { + "key": "userAssignedIdentity", + "type": "str", + }, } def __init__( - self, - *, - user_assigned_identity: Optional[str] = None, - **kwargs + self, *, user_assigned_identity: Optional[str] = None, **kwargs ): """ :keyword user_assigned_identity: The ArmId of the user assigned identity that will be used to @@ -8098,9 +8413,9 @@ class InferenceContainerProperties(msrest.serialization.Model): """ _attribute_map = { - 'liveness_route': {'key': 'livenessRoute', 'type': 'Route'}, - 'readiness_route': {'key': 'readinessRoute', 'type': 'Route'}, - 'scoring_route': {'key': 'scoringRoute', 'type': 'Route'}, + "liveness_route": {"key": "livenessRoute", "type": "Route"}, + "readiness_route": {"key": "readinessRoute", "type": "Route"}, + "scoring_route": {"key": "scoringRoute", "type": "Route"}, } def __init__( @@ -8136,8 +8451,11 @@ class InstanceTypeSchema(msrest.serialization.Model): """ _attribute_map = { - 'node_selector': {'key': 'nodeSelector', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'InstanceTypeSchemaResources'}, + "node_selector": {"key": "nodeSelector", "type": "{str}"}, + "resources": { + "key": "resources", + "type": "InstanceTypeSchemaResources", + }, } def __init__( @@ -8168,8 +8486,8 @@ class InstanceTypeSchemaResources(msrest.serialization.Model): """ _attribute_map = { - 'requests': {'key': 'requests', 'type': '{str}'}, - 'limits': {'key': 'limits', 'type': '{str}'}, + "requests": {"key": "requests", "type": "{str}"}, + "limits": {"key": "limits", "type": "{str}"}, } def __init__( @@ -8213,27 +8531,22 @@ class JobBaseData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'JobBaseDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "JobBaseDetails"}, } - def __init__( - self, - *, - properties: "JobBaseDetails", - **kwargs - ): + def __init__(self, *, properties: "JobBaseDetails", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.JobBaseDetails @@ -8253,8 +8566,8 @@ class JobBaseResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[JobBaseData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[JobBaseData]"}, } def __init__( @@ -8296,17 +8609,17 @@ class JobService(msrest.serialization.Model): """ _validation = { - 'error_message': {'readonly': True}, - 'status': {'readonly': True}, + "error_message": {"readonly": True}, + "status": {"readonly": True}, } _attribute_map = { - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'job_service_type': {'key': 'jobServiceType', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'status': {'key': 'status', 'type': 'str'}, + "endpoint": {"key": "endpoint", "type": "str"}, + "error_message": {"key": "errorMessage", "type": "str"}, + "job_service_type": {"key": "jobServiceType", "type": "str"}, + "port": {"key": "port", "type": "int"}, + "properties": {"key": "properties", "type": "{str}"}, + "status": {"key": "status", "type": "str"}, } def __init__( @@ -8345,14 +8658,11 @@ class KubernetesSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, + "properties": {"key": "properties", "type": "KubernetesProperties"}, } def __init__( - self, - *, - properties: Optional["KubernetesProperties"] = None, - **kwargs + self, *, properties: Optional["KubernetesProperties"] = None, **kwargs ): """ :keyword properties: Properties of Kubernetes. @@ -8401,27 +8711,30 @@ class Kubernetes(Compute, KubernetesSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "KubernetesProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -8444,10 +8757,16 @@ def __init__( MSI and AAD exclusively for authentication. :paramtype disable_local_auth: bool """ - super(Kubernetes, self).__init__(description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) + super(Kubernetes, self).__init__( + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'Kubernetes' # type: str - self.compute_type = 'Kubernetes' # type: str + self.compute_type = "Kubernetes" # type: str + self.compute_type = "Kubernetes" # type: str self.compute_location = None self.provisioning_state = None self.description = description @@ -8511,30 +8830,45 @@ class OnlineDeploymentDetails(EndpointDeploymentPropertiesBase): """ _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, + "endpoint_compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, + "model": {"key": "model", "type": "str"}, + "model_mount_path": {"key": "modelMountPath", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, } _subtype_map = { - 'endpoint_compute_type': {'Kubernetes': 'KubernetesOnlineDeployment', 'Managed': 'ManagedOnlineDeployment'} + "endpoint_compute_type": { + "Kubernetes": "KubernetesOnlineDeployment", + "Managed": "ManagedOnlineDeployment", + } } def __init__( @@ -8588,9 +8922,16 @@ def __init__( and to DefaultScaleSettings for ManagedOnlineDeployment. :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings """ - super(OnlineDeploymentDetails, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, **kwargs) + super(OnlineDeploymentDetails, self).__init__( + code_configuration=code_configuration, + description=description, + environment_id=environment_id, + environment_variables=environment_variables, + properties=properties, + **kwargs + ) self.app_insights_enabled = app_insights_enabled - self.endpoint_compute_type = 'OnlineDeploymentDetails' # type: str + self.endpoint_compute_type = "OnlineDeploymentDetails" # type: str self.instance_type = instance_type self.liveness_probe = liveness_probe self.model = model @@ -8653,28 +8994,43 @@ class KubernetesOnlineDeployment(OnlineDeploymentDetails): ~azure.mgmt.machinelearningservices.models.ContainerResourceRequirements """ - _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - 'container_resource_requirements': {'key': 'containerResourceRequirements', 'type': 'ContainerResourceRequirements'}, + _validation = { + "endpoint_compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, + "model": {"key": "model", "type": "str"}, + "model_mount_path": {"key": "modelMountPath", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, + "container_resource_requirements": { + "key": "containerResourceRequirements", + "type": "ContainerResourceRequirements", + }, } def __init__( @@ -8693,7 +9049,9 @@ def __init__( readiness_probe: Optional["ProbeSettings"] = None, request_settings: Optional["OnlineRequestSettings"] = None, scale_settings: Optional["OnlineScaleSettings"] = None, - container_resource_requirements: Optional["ContainerResourceRequirements"] = None, + container_resource_requirements: Optional[ + "ContainerResourceRequirements" + ] = None, **kwargs ): """ @@ -8733,8 +9091,23 @@ def __init__( :paramtype container_resource_requirements: ~azure.mgmt.machinelearningservices.models.ContainerResourceRequirements """ - super(KubernetesOnlineDeployment, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, app_insights_enabled=app_insights_enabled, instance_type=instance_type, liveness_probe=liveness_probe, model=model, model_mount_path=model_mount_path, readiness_probe=readiness_probe, request_settings=request_settings, scale_settings=scale_settings, **kwargs) - self.endpoint_compute_type = 'Kubernetes' # type: str + super(KubernetesOnlineDeployment, self).__init__( + code_configuration=code_configuration, + description=description, + environment_id=environment_id, + environment_variables=environment_variables, + properties=properties, + app_insights_enabled=app_insights_enabled, + instance_type=instance_type, + liveness_probe=liveness_probe, + model=model, + model_mount_path=model_mount_path, + readiness_probe=readiness_probe, + request_settings=request_settings, + scale_settings=scale_settings, + **kwargs + ) + self.endpoint_compute_type = "Kubernetes" # type: str self.container_resource_requirements = container_resource_requirements @@ -8761,14 +9134,29 @@ class KubernetesProperties(msrest.serialization.Model): """ _attribute_map = { - 'relay_connection_string': {'key': 'relayConnectionString', 'type': 'str'}, - 'service_bus_connection_string': {'key': 'serviceBusConnectionString', 'type': 'str'}, - 'extension_principal_id': {'key': 'extensionPrincipalId', 'type': 'str'}, - 'extension_instance_release_train': {'key': 'extensionInstanceReleaseTrain', 'type': 'str'}, - 'vc_name': {'key': 'vcName', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'default_instance_type': {'key': 'defaultInstanceType', 'type': 'str'}, - 'instance_types': {'key': 'instanceTypes', 'type': '{InstanceTypeSchema}'}, + "relay_connection_string": { + "key": "relayConnectionString", + "type": "str", + }, + "service_bus_connection_string": { + "key": "serviceBusConnectionString", + "type": "str", + }, + "extension_principal_id": { + "key": "extensionPrincipalId", + "type": "str", + }, + "extension_instance_release_train": { + "key": "extensionInstanceReleaseTrain", + "type": "str", + }, + "vc_name": {"key": "vcName", "type": "str"}, + "namespace": {"key": "namespace", "type": "str"}, + "default_instance_type": {"key": "defaultInstanceType", "type": "str"}, + "instance_types": { + "key": "instanceTypes", + "type": "{InstanceTypeSchema}", + }, } def __init__( @@ -8807,7 +9195,9 @@ def __init__( self.relay_connection_string = relay_connection_string self.service_bus_connection_string = service_bus_connection_string self.extension_principal_id = extension_principal_id - self.extension_instance_release_train = extension_instance_release_train + self.extension_instance_release_train = ( + extension_instance_release_train + ) self.vc_name = vc_name self.namespace = namespace self.default_instance_type = default_instance_type @@ -8827,21 +9217,17 @@ class ListAmlUserFeatureResult(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlUserFeature]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[AmlUserFeature]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListAmlUserFeatureResult, self).__init__(**kwargs) self.value = None self.next_link = None @@ -8859,21 +9245,17 @@ class ListNotebookKeysResult(msrest.serialization.Model): """ _validation = { - 'primary_access_key': {'readonly': True}, - 'secondary_access_key': {'readonly': True}, + "primary_access_key": {"readonly": True}, + "secondary_access_key": {"readonly": True}, } _attribute_map = { - 'primary_access_key': {'key': 'primaryAccessKey', 'type': 'str'}, - 'secondary_access_key': {'key': 'secondaryAccessKey', 'type': 'str'}, + "primary_access_key": {"key": "primaryAccessKey", "type": "str"}, + "secondary_access_key": {"key": "secondaryAccessKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListNotebookKeysResult, self).__init__(**kwargs) self.primary_access_key = None self.secondary_access_key = None @@ -8889,19 +9271,15 @@ class ListStorageAccountKeysResult(msrest.serialization.Model): """ _validation = { - 'user_storage_key': {'readonly': True}, + "user_storage_key": {"readonly": True}, } _attribute_map = { - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, + "user_storage_key": {"key": "userStorageKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListStorageAccountKeysResult, self).__init__(**kwargs) self.user_storage_key = None @@ -8919,21 +9297,17 @@ class ListUsagesResult(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[Usage]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Usage]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListUsagesResult, self).__init__(**kwargs) self.value = None self.next_link = None @@ -8959,27 +9333,35 @@ class ListWorkspaceKeysResult(msrest.serialization.Model): """ _validation = { - 'user_storage_key': {'readonly': True}, - 'user_storage_resource_id': {'readonly': True}, - 'app_insights_instrumentation_key': {'readonly': True}, - 'container_registry_credentials': {'readonly': True}, - 'notebook_access_keys': {'readonly': True}, - } - - _attribute_map = { - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, - 'user_storage_resource_id': {'key': 'userStorageResourceId', 'type': 'str'}, - 'app_insights_instrumentation_key': {'key': 'appInsightsInstrumentationKey', 'type': 'str'}, - 'container_registry_credentials': {'key': 'containerRegistryCredentials', 'type': 'RegistryListCredentialsResult'}, - 'notebook_access_keys': {'key': 'notebookAccessKeys', 'type': 'ListNotebookKeysResult'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ + "user_storage_key": {"readonly": True}, + "user_storage_resource_id": {"readonly": True}, + "app_insights_instrumentation_key": {"readonly": True}, + "container_registry_credentials": {"readonly": True}, + "notebook_access_keys": {"readonly": True}, + } + + _attribute_map = { + "user_storage_key": {"key": "userStorageKey", "type": "str"}, + "user_storage_resource_id": { + "key": "userStorageResourceId", + "type": "str", + }, + "app_insights_instrumentation_key": { + "key": "appInsightsInstrumentationKey", + "type": "str", + }, + "container_registry_credentials": { + "key": "containerRegistryCredentials", + "type": "RegistryListCredentialsResult", + }, + "notebook_access_keys": { + "key": "notebookAccessKeys", + "type": "ListNotebookKeysResult", + }, + } + + def __init__(self, **kwargs): + """ """ super(ListWorkspaceKeysResult, self).__init__(**kwargs) self.user_storage_key = None self.user_storage_resource_id = None @@ -9001,21 +9383,17 @@ class ListWorkspaceQuotas(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[ResourceQuota]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[ResourceQuota]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListWorkspaceQuotas, self).__init__(**kwargs) self.value = None self.next_link = None @@ -9037,22 +9415,18 @@ class LiteralJobInput(JobInput): """ _validation = { - 'job_input_type': {'required': True}, - 'value': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "job_input_type": {"required": True}, + "value": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, + "value": {"key": "value", "type": "str"}, } def __init__( - self, - *, - value: str, - description: Optional[str] = None, - **kwargs + self, *, value: str, description: Optional[str] = None, **kwargs ): """ :keyword description: Description for the input. @@ -9060,8 +9434,10 @@ def __init__( :keyword value: Required. [Required] Literal value for the input. :paramtype value: str """ - super(LiteralJobInput, self).__init__(description=description, **kwargs) - self.job_input_type = 'literal' # type: str + super(LiteralJobInput, self).__init__( + description=description, **kwargs + ) + self.job_input_type = "literal" # type: str self.value = value @@ -9086,14 +9462,14 @@ class ManagedIdentity(IdentityConfiguration): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + "object_id": {"key": "objectId", "type": "str"}, + "resource_id": {"key": "resourceId", "type": "str"}, } def __init__( @@ -9116,7 +9492,7 @@ def __init__( :paramtype resource_id: str """ super(ManagedIdentity, self).__init__(**kwargs) - self.identity_type = 'Managed' # type: str + self.identity_type = "Managed" # type: str self.client_id = client_id self.object_id = object_id self.resource_id = resource_id @@ -9145,19 +9521,25 @@ class WorkspaceConnectionPropertiesV2(msrest.serialization.Model): """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, } _subtype_map = { - 'auth_type': {'ManagedIdentity': 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', 'None': 'NoneAuthTypeWorkspaceConnectionProperties', 'PAT': 'PATAuthTypeWorkspaceConnectionProperties', 'SAS': 'SASAuthTypeWorkspaceConnectionProperties', 'UsernamePassword': 'UsernamePasswordAuthTypeWorkspaceConnectionProperties'} + "auth_type": { + "ManagedIdentity": "ManagedIdentityAuthTypeWorkspaceConnectionProperties", + "None": "NoneAuthTypeWorkspaceConnectionProperties", + "PAT": "PATAuthTypeWorkspaceConnectionProperties", + "SAS": "SASAuthTypeWorkspaceConnectionProperties", + "UsernamePassword": "UsernamePasswordAuthTypeWorkspaceConnectionProperties", + } } def __init__( @@ -9189,7 +9571,9 @@ def __init__( self.value_format = value_format -class ManagedIdentityAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class ManagedIdentityAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """ManagedIdentityAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -9212,16 +9596,19 @@ class ManagedIdentityAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPr """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionManagedIdentity'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionManagedIdentity", + }, } def __init__( @@ -9249,8 +9636,16 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity """ - super(ManagedIdentityAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'ManagedIdentity' # type: str + super( + ManagedIdentityAuthTypeWorkspaceConnectionProperties, self + ).__init__( + category=category, + target=target, + value=value, + value_format=value_format, + **kwargs + ) + self.auth_type = "ManagedIdentity" # type: str self.credentials = credentials @@ -9303,26 +9698,38 @@ class ManagedOnlineDeployment(OnlineDeploymentDetails): """ _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, + "endpoint_compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, + "model": {"key": "model", "type": "str"}, + "model_mount_path": {"key": "modelMountPath", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, } def __init__( @@ -9376,8 +9783,23 @@ def __init__( and to DefaultScaleSettings for ManagedOnlineDeployment. :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings """ - super(ManagedOnlineDeployment, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, app_insights_enabled=app_insights_enabled, instance_type=instance_type, liveness_probe=liveness_probe, model=model, model_mount_path=model_mount_path, readiness_probe=readiness_probe, request_settings=request_settings, scale_settings=scale_settings, **kwargs) - self.endpoint_compute_type = 'Managed' # type: str + super(ManagedOnlineDeployment, self).__init__( + code_configuration=code_configuration, + description=description, + environment_id=environment_id, + environment_variables=environment_variables, + properties=properties, + app_insights_enabled=app_insights_enabled, + instance_type=instance_type, + liveness_probe=liveness_probe, + model=model, + model_mount_path=model_mount_path, + readiness_probe=readiness_probe, + request_settings=request_settings, + scale_settings=scale_settings, + **kwargs + ) + self.endpoint_compute_type = "Managed" # type: str class ManagedServiceIdentity(msrest.serialization.Model): @@ -9406,23 +9828,28 @@ class ManagedServiceIdentity(msrest.serialization.Model): """ _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, + "principal_id": {"readonly": True}, + "tenant_id": {"readonly": True}, + "type": {"required": True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{UserAssignedIdentity}", + }, } def __init__( self, *, type: Union[str, "ManagedServiceIdentityType"], - user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, + user_assigned_identities: Optional[ + Dict[str, "UserAssignedIdentity"] + ] = None, **kwargs ): """ @@ -9460,13 +9887,13 @@ class MedianStoppingPolicy(EarlyTerminationPolicy): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, } def __init__( @@ -9482,8 +9909,12 @@ def __init__( :keyword evaluation_interval: Interval (number of runs) between policy evaluations. :paramtype evaluation_interval: int """ - super(MedianStoppingPolicy, self).__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs) - self.policy_type = 'MedianStopping' # type: str + super(MedianStoppingPolicy, self).__init__( + delay_evaluation=delay_evaluation, + evaluation_interval=evaluation_interval, + **kwargs + ) + self.policy_type = "MedianStopping" # type: str class MLFlowModelJobInput(JobInput, AssetJobInput): @@ -9505,15 +9936,15 @@ class MLFlowModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -9533,12 +9964,14 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(MLFlowModelJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(MLFlowModelJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'mlflow_model' # type: str + self.job_input_type = "mlflow_model" # type: str self.description = description - self.job_input_type = 'mlflow_model' # type: str + self.job_input_type = "mlflow_model" # type: str class MLFlowModelJobOutput(JobOutput, AssetJobOutput): @@ -9559,14 +9992,14 @@ class MLFlowModelJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -9585,12 +10018,14 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(MLFlowModelJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(MLFlowModelJobOutput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_output_type = 'mlflow_model' # type: str + self.job_output_type = "mlflow_model" # type: str self.description = description - self.job_output_type = 'mlflow_model' # type: str + self.job_output_type = "mlflow_model" # type: str class MLTableData(DataVersionBaseDetails): @@ -9619,19 +10054,19 @@ class MLTableData(DataVersionBaseDetails): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'referenced_uris': {'key': 'referencedUris', 'type': '[str]'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, + "referenced_uris": {"key": "referencedUris", "type": "[str]"}, } def __init__( @@ -9663,8 +10098,16 @@ def __init__( :keyword referenced_uris: Uris referenced in the MLTable definition (required for lineage). :paramtype referenced_uris: list[str] """ - super(MLTableData, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, **kwargs) - self.data_type = 'mltable' # type: str + super(MLTableData, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + data_uri=data_uri, + **kwargs + ) + self.data_type = "mltable" # type: str self.referenced_uris = referenced_uris @@ -9687,15 +10130,15 @@ class MLTableJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -9715,12 +10158,14 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(MLTableJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(MLTableJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'mltable' # type: str + self.job_input_type = "mltable" # type: str self.description = description - self.job_input_type = 'mltable' # type: str + self.job_input_type = "mltable" # type: str class MLTableJobOutput(JobOutput, AssetJobOutput): @@ -9741,14 +10186,14 @@ class MLTableJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -9767,12 +10212,14 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(MLTableJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(MLTableJobOutput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_output_type = 'mltable' # type: str + self.job_output_type = "mltable" # type: str self.description = description - self.job_output_type = 'mltable' # type: str + self.job_output_type = "mltable" # type: str class ModelContainerData(Resource): @@ -9798,27 +10245,22 @@ class ModelContainerData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelContainerDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "ModelContainerDetails"}, } - def __init__( - self, - *, - properties: "ModelContainerDetails", - **kwargs - ): + def __init__(self, *, properties: "ModelContainerDetails", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelContainerDetails @@ -9847,17 +10289,17 @@ class ModelContainerDetails(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, } def __init__( @@ -9879,7 +10321,13 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(ModelContainerDetails, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) + super(ModelContainerDetails, self).__init__( + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs + ) class ModelContainerResourceArmPaginatedResult(msrest.serialization.Model): @@ -9893,8 +10341,8 @@ class ModelContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelContainerData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ModelContainerData]"}, } def __init__( @@ -9911,7 +10359,9 @@ def __init__( :keyword value: An array of objects of type ModelContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelContainerData] """ - super(ModelContainerResourceArmPaginatedResult, self).__init__(**kwargs) + super(ModelContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -9939,27 +10389,22 @@ class ModelVersionData(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelVersionDetails'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "ModelVersionDetails"}, } - def __init__( - self, - *, - properties: "ModelVersionDetails", - **kwargs - ): + def __init__(self, *, properties: "ModelVersionDetails", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelVersionDetails @@ -9992,15 +10437,15 @@ class ModelVersionDetails(AssetBase): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'flavors': {'key': 'flavors', 'type': '{FlavorData}'}, - 'job_name': {'key': 'jobName', 'type': 'str'}, - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'model_uri': {'key': 'modelUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "flavors": {"key": "flavors", "type": "{FlavorData}"}, + "job_name": {"key": "jobName", "type": "str"}, + "model_type": {"key": "modelType", "type": "str"}, + "model_uri": {"key": "modelUri", "type": "str"}, } def __init__( @@ -10037,7 +10482,14 @@ def __init__( :keyword model_uri: The URI path to the model contents. :paramtype model_uri: str """ - super(ModelVersionDetails, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) + super(ModelVersionDetails, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + **kwargs + ) self.flavors = flavors self.job_name = job_name self.model_type = model_type @@ -10055,8 +10507,8 @@ class ModelVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelVersionData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ModelVersionData]"}, } def __init__( @@ -10091,26 +10543,26 @@ class Mpi(DistributionConfiguration): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, + "distribution_type": {"key": "distributionType", "type": "str"}, + "process_count_per_instance": { + "key": "processCountPerInstance", + "type": "int", + }, } def __init__( - self, - *, - process_count_per_instance: Optional[int] = None, - **kwargs + self, *, process_count_per_instance: Optional[int] = None, **kwargs ): """ :keyword process_count_per_instance: Number of processes per MPI node. :paramtype process_count_per_instance: int """ super(Mpi, self).__init__(**kwargs) - self.distribution_type = 'Mpi' # type: str + self.distribution_type = "Mpi" # type: str self.process_count_per_instance = process_count_per_instance @@ -10134,29 +10586,25 @@ class NodeStateCounts(msrest.serialization.Model): """ _validation = { - 'idle_node_count': {'readonly': True}, - 'running_node_count': {'readonly': True}, - 'preparing_node_count': {'readonly': True}, - 'unusable_node_count': {'readonly': True}, - 'leaving_node_count': {'readonly': True}, - 'preempted_node_count': {'readonly': True}, + "idle_node_count": {"readonly": True}, + "running_node_count": {"readonly": True}, + "preparing_node_count": {"readonly": True}, + "unusable_node_count": {"readonly": True}, + "leaving_node_count": {"readonly": True}, + "preempted_node_count": {"readonly": True}, } _attribute_map = { - 'idle_node_count': {'key': 'idleNodeCount', 'type': 'int'}, - 'running_node_count': {'key': 'runningNodeCount', 'type': 'int'}, - 'preparing_node_count': {'key': 'preparingNodeCount', 'type': 'int'}, - 'unusable_node_count': {'key': 'unusableNodeCount', 'type': 'int'}, - 'leaving_node_count': {'key': 'leavingNodeCount', 'type': 'int'}, - 'preempted_node_count': {'key': 'preemptedNodeCount', 'type': 'int'}, + "idle_node_count": {"key": "idleNodeCount", "type": "int"}, + "running_node_count": {"key": "runningNodeCount", "type": "int"}, + "preparing_node_count": {"key": "preparingNodeCount", "type": "int"}, + "unusable_node_count": {"key": "unusableNodeCount", "type": "int"}, + "leaving_node_count": {"key": "leavingNodeCount", "type": "int"}, + "preempted_node_count": {"key": "preemptedNodeCount", "type": "int"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NodeStateCounts, self).__init__(**kwargs) self.idle_node_count = None self.running_node_count = None @@ -10166,7 +10614,9 @@ def __init__( self.preempted_node_count = None -class NoneAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class NoneAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """NoneAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -10186,15 +10636,15 @@ class NoneAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2) """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, } def __init__( @@ -10218,8 +10668,14 @@ def __init__( "JSON". :paramtype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat """ - super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'None' # type: str + super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__( + category=category, + target=target, + value=value, + value_format=value_format, + **kwargs + ) + self.auth_type = "None" # type: str class NoneDatastoreCredentials(DatastoreCredentials): @@ -10234,21 +10690,17 @@ class NoneDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, + "credentials_type": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NoneDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'None' # type: str + self.credentials_type = "None" # type: str class NotebookAccessTokenResult(msrest.serialization.Model): @@ -10275,33 +10727,29 @@ class NotebookAccessTokenResult(msrest.serialization.Model): """ _validation = { - 'notebook_resource_id': {'readonly': True}, - 'host_name': {'readonly': True}, - 'public_dns': {'readonly': True}, - 'access_token': {'readonly': True}, - 'token_type': {'readonly': True}, - 'expires_in': {'readonly': True}, - 'refresh_token': {'readonly': True}, - 'scope': {'readonly': True}, + "notebook_resource_id": {"readonly": True}, + "host_name": {"readonly": True}, + "public_dns": {"readonly": True}, + "access_token": {"readonly": True}, + "token_type": {"readonly": True}, + "expires_in": {"readonly": True}, + "refresh_token": {"readonly": True}, + "scope": {"readonly": True}, } _attribute_map = { - 'notebook_resource_id': {'key': 'notebookResourceId', 'type': 'str'}, - 'host_name': {'key': 'hostName', 'type': 'str'}, - 'public_dns': {'key': 'publicDns', 'type': 'str'}, - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, - 'expires_in': {'key': 'expiresIn', 'type': 'int'}, - 'refresh_token': {'key': 'refreshToken', 'type': 'str'}, - 'scope': {'key': 'scope', 'type': 'str'}, + "notebook_resource_id": {"key": "notebookResourceId", "type": "str"}, + "host_name": {"key": "hostName", "type": "str"}, + "public_dns": {"key": "publicDns", "type": "str"}, + "access_token": {"key": "accessToken", "type": "str"}, + "token_type": {"key": "tokenType", "type": "str"}, + "expires_in": {"key": "expiresIn", "type": "int"}, + "refresh_token": {"key": "refreshToken", "type": "str"}, + "scope": {"key": "scope", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NotebookAccessTokenResult, self).__init__(**kwargs) self.notebook_resource_id = None self.host_name = None @@ -10323,8 +10771,8 @@ class NotebookPreparationError(msrest.serialization.Model): """ _attribute_map = { - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'status_code': {'key': 'statusCode', 'type': 'int'}, + "error_message": {"key": "errorMessage", "type": "str"}, + "status_code": {"key": "statusCode", "type": "int"}, } def __init__( @@ -10358,9 +10806,12 @@ class NotebookResourceInfo(msrest.serialization.Model): """ _attribute_map = { - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'notebook_preparation_error': {'key': 'notebookPreparationError', 'type': 'NotebookPreparationError'}, + "fqdn": {"key": "fqdn", "type": "str"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "notebook_preparation_error": { + "key": "notebookPreparationError", + "type": "NotebookPreparationError", + }, } def __init__( @@ -10368,7 +10819,9 @@ def __init__( *, fqdn: Optional[str] = None, resource_id: Optional[str] = None, - notebook_preparation_error: Optional["NotebookPreparationError"] = None, + notebook_preparation_error: Optional[ + "NotebookPreparationError" + ] = None, **kwargs ): """ @@ -10399,21 +10852,17 @@ class Objective(msrest.serialization.Model): """ _validation = { - 'goal': {'required': True}, - 'primary_metric': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "goal": {"required": True}, + "primary_metric": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'goal': {'key': 'goal', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "goal": {"key": "goal", "type": "str"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( - self, - *, - goal: Union[str, "Goal"], - primary_metric: str, - **kwargs + self, *, goal: Union[str, "Goal"], primary_metric: str, **kwargs ): """ :keyword goal: Required. [Required] Defines supported metric goals for hyperparameter tuning. @@ -10461,25 +10910,25 @@ class OnlineDeploymentData(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineDeploymentDetails'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": {"key": "properties", "type": "OnlineDeploymentDetails"}, + "sku": {"key": "sku", "type": "Sku"}, } def __init__( @@ -10508,14 +10957,18 @@ def __init__( :keyword sku: Sku details required for ARM contract for Autoscaling. :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ - super(OnlineDeploymentData, self).__init__(tags=tags, location=location, **kwargs) + super(OnlineDeploymentData, self).__init__( + tags=tags, location=location, **kwargs + ) self.identity = identity self.kind = kind self.properties = properties self.sku = sku -class OnlineDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class OnlineDeploymentTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of OnlineDeployment entities. :ivar next_link: The link to the next page of OnlineDeployment objects. If null, there are no @@ -10526,8 +10979,8 @@ class OnlineDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Mod """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineDeploymentData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[OnlineDeploymentData]"}, } def __init__( @@ -10544,7 +10997,9 @@ def __init__( :keyword value: An array of objects of type OnlineDeployment. :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineDeploymentData] """ - super(OnlineDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) + super( + OnlineDeploymentTrackedResourceArmPaginatedResult, self + ).__init__(**kwargs) self.next_link = next_link self.value = value @@ -10583,25 +11038,25 @@ class OnlineEndpointData(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineEndpointDetails'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": {"key": "properties", "type": "OnlineEndpointDetails"}, + "sku": {"key": "sku", "type": "Sku"}, } def __init__( @@ -10630,7 +11085,9 @@ def __init__( :keyword sku: Sku details required for ARM contract for Autoscaling. :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ - super(OnlineEndpointData, self).__init__(tags=tags, location=location, **kwargs) + super(OnlineEndpointData, self).__init__( + tags=tags, location=location, **kwargs + ) self.identity = identity self.kind = kind self.properties = properties @@ -10673,22 +11130,22 @@ class OnlineEndpointDetails(EndpointPropertiesBase): """ _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "auth_mode": {"required": True}, + "scoring_uri": {"readonly": True}, + "swagger_uri": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'traffic': {'key': 'traffic', 'type': '{int}'}, + "auth_mode": {"key": "authMode", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "keys": {"key": "keys", "type": "EndpointAuthKeys"}, + "properties": {"key": "properties", "type": "{str}"}, + "scoring_uri": {"key": "scoringUri", "type": "str"}, + "swagger_uri": {"key": "swaggerUri", "type": "str"}, + "compute": {"key": "compute", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "traffic": {"key": "traffic", "type": "{int}"}, } def __init__( @@ -10722,13 +11179,21 @@ def __init__( values need to sum to 100. :paramtype traffic: dict[str, int] """ - super(OnlineEndpointDetails, self).__init__(auth_mode=auth_mode, description=description, keys=keys, properties=properties, **kwargs) + super(OnlineEndpointDetails, self).__init__( + auth_mode=auth_mode, + description=description, + keys=keys, + properties=properties, + **kwargs + ) self.compute = compute self.provisioning_state = None self.traffic = traffic -class OnlineEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class OnlineEndpointTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of OnlineEndpoint entities. :ivar next_link: The link to the next page of OnlineEndpoint objects. If null, there are no @@ -10739,8 +11204,8 @@ class OnlineEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineEndpointData]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[OnlineEndpointData]"}, } def __init__( @@ -10757,7 +11222,9 @@ def __init__( :keyword value: An array of objects of type OnlineEndpoint. :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineEndpointData] """ - super(OnlineEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) + super(OnlineEndpointTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -10778,9 +11245,12 @@ class OnlineRequestSettings(msrest.serialization.Model): """ _attribute_map = { - 'max_concurrent_requests_per_instance': {'key': 'maxConcurrentRequestsPerInstance', 'type': 'int'}, - 'max_queue_wait': {'key': 'maxQueueWait', 'type': 'duration'}, - 'request_timeout': {'key': 'requestTimeout', 'type': 'duration'}, + "max_concurrent_requests_per_instance": { + "key": "maxConcurrentRequestsPerInstance", + "type": "int", + }, + "max_queue_wait": {"key": "maxQueueWait", "type": "duration"}, + "request_timeout": {"key": "requestTimeout", "type": "duration"}, } def __init__( @@ -10804,7 +11274,9 @@ def __init__( :paramtype request_timeout: ~datetime.timedelta """ super(OnlineRequestSettings, self).__init__(**kwargs) - self.max_concurrent_requests_per_instance = max_concurrent_requests_per_instance + self.max_concurrent_requests_per_instance = ( + max_concurrent_requests_per_instance + ) self.max_queue_wait = max_queue_wait self.request_timeout = request_timeout @@ -10824,13 +11296,13 @@ class OutputPathAssetReference(AssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "job_id": {"key": "jobId", "type": "str"}, + "path": {"key": "path", "type": "str"}, } def __init__( @@ -10847,7 +11319,7 @@ def __init__( :paramtype path: str """ super(OutputPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'OutputPath' # type: str + self.reference_type = "OutputPath" # type: str self.job_id = job_id self.path = path @@ -10862,8 +11334,8 @@ class PaginatedComputeResourcesList(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[ComputeResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[ComputeResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( @@ -10898,23 +11370,23 @@ class PartialAssetReferenceBase(msrest.serialization.Model): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, } _subtype_map = { - 'reference_type': {'DataPath': 'PartialDataPathAssetReference', 'Id': 'PartialIdAssetReference', 'OutputPath': 'PartialOutputPathAssetReference'} + "reference_type": { + "DataPath": "PartialDataPathAssetReference", + "Id": "PartialIdAssetReference", + "OutputPath": "PartialOutputPathAssetReference", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(PartialAssetReferenceBase, self).__init__(**kwargs) self.reference_type = None # type: Optional[str] @@ -10964,20 +11436,32 @@ class PartialBatchDeployment(msrest.serialization.Model): """ _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'PartialCodeConfiguration'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'error_threshold': {'key': 'errorThreshold', 'type': 'int'}, - 'logging_level': {'key': 'loggingLevel', 'type': 'str'}, - 'max_concurrency_per_instance': {'key': 'maxConcurrencyPerInstance', 'type': 'int'}, - 'mini_batch_size': {'key': 'miniBatchSize', 'type': 'long'}, - 'model': {'key': 'model', 'type': 'PartialAssetReferenceBase'}, - 'output_action': {'key': 'outputAction', 'type': 'str'}, - 'output_file_name': {'key': 'outputFileName', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'retry_settings': {'key': 'retrySettings', 'type': 'PartialBatchRetrySettings'}, + "code_configuration": { + "key": "codeConfiguration", + "type": "PartialCodeConfiguration", + }, + "compute": {"key": "compute", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "error_threshold": {"key": "errorThreshold", "type": "int"}, + "logging_level": {"key": "loggingLevel", "type": "str"}, + "max_concurrency_per_instance": { + "key": "maxConcurrencyPerInstance", + "type": "int", + }, + "mini_batch_size": {"key": "miniBatchSize", "type": "long"}, + "model": {"key": "model", "type": "PartialAssetReferenceBase"}, + "output_action": {"key": "outputAction", "type": "str"}, + "output_file_name": {"key": "outputFileName", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "retry_settings": { + "key": "retrySettings", + "type": "PartialBatchRetrySettings", + }, } def __init__( @@ -11076,12 +11560,15 @@ class PartialBatchDeploymentPartialTrackedResource(msrest.serialization.Model): """ _attribute_map = { - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'PartialBatchDeployment'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "identity": { + "key": "identity", + "type": "PartialManagedServiceIdentity", + }, + "kind": {"key": "kind", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "properties": {"key": "properties", "type": "PartialBatchDeployment"}, + "sku": {"key": "sku", "type": "PartialSku"}, + "tags": {"key": "tags", "type": "{str}"}, } def __init__( @@ -11110,7 +11597,9 @@ def __init__( :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] """ - super(PartialBatchDeploymentPartialTrackedResource, self).__init__(**kwargs) + super(PartialBatchDeploymentPartialTrackedResource, self).__init__( + **kwargs + ) self.identity = identity self.kind = kind self.location = location @@ -11127,14 +11616,11 @@ class PartialBatchEndpoint(msrest.serialization.Model): """ _attribute_map = { - 'defaults': {'key': 'defaults', 'type': 'BatchEndpointDefaults'}, + "defaults": {"key": "defaults", "type": "BatchEndpointDefaults"}, } def __init__( - self, - *, - defaults: Optional["BatchEndpointDefaults"] = None, - **kwargs + self, *, defaults: Optional["BatchEndpointDefaults"] = None, **kwargs ): """ :keyword defaults: Default values for Batch Endpoint. @@ -11163,12 +11649,15 @@ class PartialBatchEndpointPartialTrackedResource(msrest.serialization.Model): """ _attribute_map = { - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'PartialBatchEndpoint'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "identity": { + "key": "identity", + "type": "PartialManagedServiceIdentity", + }, + "kind": {"key": "kind", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "properties": {"key": "properties", "type": "PartialBatchEndpoint"}, + "sku": {"key": "sku", "type": "PartialSku"}, + "tags": {"key": "tags", "type": "{str}"}, } def __init__( @@ -11197,7 +11686,9 @@ def __init__( :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] """ - super(PartialBatchEndpointPartialTrackedResource, self).__init__(**kwargs) + super(PartialBatchEndpointPartialTrackedResource, self).__init__( + **kwargs + ) self.identity = identity self.kind = kind self.location = location @@ -11216,8 +11707,8 @@ class PartialBatchRetrySettings(msrest.serialization.Model): """ _attribute_map = { - 'max_retries': {'key': 'maxRetries', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "max_retries": {"key": "maxRetries", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } def __init__( @@ -11248,12 +11739,12 @@ class PartialCodeConfiguration(msrest.serialization.Model): """ _validation = { - 'scoring_script': {'min_length': 1}, + "scoring_script": {"min_length": 1}, } _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'scoring_script': {'key': 'scoringScript', 'type': 'str'}, + "code_id": {"key": "codeId", "type": "str"}, + "scoring_script": {"key": "scoringScript", "type": "str"}, } def __init__( @@ -11289,13 +11780,13 @@ class PartialDataPathAssetReference(PartialAssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'datastore_id': {'key': 'datastoreId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "datastore_id": {"key": "datastoreId", "type": "str"}, + "path": {"key": "path", "type": "str"}, } def __init__( @@ -11312,7 +11803,7 @@ def __init__( :paramtype path: str """ super(PartialDataPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'DataPath' # type: str + self.reference_type = "DataPath" # type: str self.datastore_id = datastore_id self.path = path @@ -11330,26 +11821,21 @@ class PartialIdAssetReference(PartialAssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'asset_id': {'key': 'assetId', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "asset_id": {"key": "assetId", "type": "str"}, } - def __init__( - self, - *, - asset_id: Optional[str] = None, - **kwargs - ): + def __init__(self, *, asset_id: Optional[str] = None, **kwargs): """ :keyword asset_id: ARM resource ID of the asset. :paramtype asset_id: str """ super(PartialIdAssetReference, self).__init__(**kwargs) - self.reference_type = 'Id' # type: str + self.reference_type = "Id" # type: str self.asset_id = asset_id @@ -11368,23 +11854,22 @@ class PartialOnlineDeployment(msrest.serialization.Model): """ _validation = { - 'endpoint_compute_type': {'required': True}, + "endpoint_compute_type": {"required": True}, } _attribute_map = { - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, } _subtype_map = { - 'endpoint_compute_type': {'Kubernetes': 'PartialKubernetesOnlineDeployment', 'Managed': 'PartialManagedOnlineDeployment'} + "endpoint_compute_type": { + "Kubernetes": "PartialKubernetesOnlineDeployment", + "Managed": "PartialManagedOnlineDeployment", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(PartialOnlineDeployment, self).__init__(**kwargs) self.endpoint_compute_type = None # type: Optional[str] @@ -11401,21 +11886,17 @@ class PartialKubernetesOnlineDeployment(PartialOnlineDeployment): """ _validation = { - 'endpoint_compute_type': {'required': True}, + "endpoint_compute_type": {"required": True}, } _attribute_map = { - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(PartialKubernetesOnlineDeployment, self).__init__(**kwargs) - self.endpoint_compute_type = 'Kubernetes' # type: str + self.endpoint_compute_type = "Kubernetes" # type: str class PartialManagedOnlineDeployment(PartialOnlineDeployment): @@ -11430,21 +11911,17 @@ class PartialManagedOnlineDeployment(PartialOnlineDeployment): """ _validation = { - 'endpoint_compute_type': {'required': True}, + "endpoint_compute_type": {"required": True}, } _attribute_map = { - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(PartialManagedOnlineDeployment, self).__init__(**kwargs) - self.endpoint_compute_type = 'Managed' # type: str + self.endpoint_compute_type = "Managed" # type: str class PartialManagedServiceIdentity(msrest.serialization.Model): @@ -11462,8 +11939,11 @@ class PartialManagedServiceIdentity(msrest.serialization.Model): """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{object}'}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{object}", + }, } def __init__( @@ -11489,7 +11969,9 @@ def __init__( self.user_assigned_identities = user_assigned_identities -class PartialOnlineDeploymentPartialTrackedResource(msrest.serialization.Model): +class PartialOnlineDeploymentPartialTrackedResource( + msrest.serialization.Model +): """Strictly used in update requests. :ivar identity: Managed service identity (system assigned and/or user assigned identities). @@ -11508,12 +11990,15 @@ class PartialOnlineDeploymentPartialTrackedResource(msrest.serialization.Model): """ _attribute_map = { - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'PartialOnlineDeployment'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "identity": { + "key": "identity", + "type": "PartialManagedServiceIdentity", + }, + "kind": {"key": "kind", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "properties": {"key": "properties", "type": "PartialOnlineDeployment"}, + "sku": {"key": "sku", "type": "PartialSku"}, + "tags": {"key": "tags", "type": "{str}"}, } def __init__( @@ -11542,7 +12027,9 @@ def __init__( :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] """ - super(PartialOnlineDeploymentPartialTrackedResource, self).__init__(**kwargs) + super(PartialOnlineDeploymentPartialTrackedResource, self).__init__( + **kwargs + ) self.identity = identity self.kind = kind self.location = location @@ -11570,12 +12057,15 @@ class PartialOnlineEndpointPartialTrackedResource(msrest.serialization.Model): """ _attribute_map = { - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'object'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "identity": { + "key": "identity", + "type": "PartialManagedServiceIdentity", + }, + "kind": {"key": "kind", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "properties": {"key": "properties", "type": "object"}, + "sku": {"key": "sku", "type": "PartialSku"}, + "tags": {"key": "tags", "type": "{str}"}, } def __init__( @@ -11604,7 +12094,9 @@ def __init__( :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] """ - super(PartialOnlineEndpointPartialTrackedResource, self).__init__(**kwargs) + super(PartialOnlineEndpointPartialTrackedResource, self).__init__( + **kwargs + ) self.identity = identity self.kind = kind self.location = location @@ -11628,13 +12120,13 @@ class PartialOutputPathAssetReference(PartialAssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "job_id": {"key": "jobId", "type": "str"}, + "path": {"key": "path", "type": "str"}, } def __init__( @@ -11651,7 +12143,7 @@ def __init__( :paramtype path: str """ super(PartialOutputPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'OutputPath' # type: str + self.reference_type = "OutputPath" # type: str self.job_id = job_id self.path = path @@ -11677,11 +12169,11 @@ class PartialSku(msrest.serialization.Model): """ _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'int'}, - 'family': {'key': 'family', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, + "capacity": {"key": "capacity", "type": "int"}, + "family": {"key": "family", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "size": {"key": "size", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, } def __init__( @@ -11731,27 +12223,25 @@ class Password(msrest.serialization.Model): """ _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, + "name": {"readonly": True}, + "value": {"readonly": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "value": {"key": "value", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Password, self).__init__(**kwargs) self.name = None self.value = None -class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class PATAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """PATAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -11774,16 +12264,19 @@ class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionPersonalAccessToken'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionPersonalAccessToken", + }, } def __init__( @@ -11811,8 +12304,14 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken """ - super(PATAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'PAT' # type: str + super(PATAuthTypeWorkspaceConnectionProperties, self).__init__( + category=category, + target=target, + value=value, + value_format=value_format, + **kwargs + ) + self.auth_type = "PAT" # type: str self.credentials = credentials @@ -11824,14 +12323,11 @@ class PersonalComputeInstanceSettings(msrest.serialization.Model): """ _attribute_map = { - 'assigned_user': {'key': 'assignedUser', 'type': 'AssignedUser'}, + "assigned_user": {"key": "assignedUser", "type": "AssignedUser"}, } def __init__( - self, - *, - assigned_user: Optional["AssignedUser"] = None, - **kwargs + self, *, assigned_user: Optional["AssignedUser"] = None, **kwargs ): """ :keyword assigned_user: A user explicitly assigned to a personal compute instance. @@ -11888,26 +12384,26 @@ class PipelineJob(JobBaseDetails): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, + "job_type": {"required": True}, + "status": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'jobs': {'key': 'jobs', 'type': '{object}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'settings': {'key': 'settings', 'type': 'object'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "jobs": {"key": "jobs", "type": "{object}"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "settings": {"key": "settings", "type": "object"}, } def __init__( @@ -11960,8 +12456,19 @@ def __init__( :keyword settings: Pipeline settings, for things like ContinueRunOnStepFailure etc. :paramtype settings: any """ - super(PipelineJob, self).__init__(description=description, properties=properties, tags=tags, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, services=services, **kwargs) - self.job_type = 'Pipeline' # type: str + super(PipelineJob, self).__init__( + description=description, + properties=properties, + tags=tags, + compute_id=compute_id, + display_name=display_name, + experiment_name=experiment_name, + identity=identity, + is_archived=is_archived, + services=services, + **kwargs + ) + self.job_type = "Pipeline" # type: str self.inputs = inputs self.jobs = jobs self.outputs = outputs @@ -11980,21 +12487,17 @@ class PrivateEndpoint(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'subnet_arm_id': {'readonly': True}, + "id": {"readonly": True}, + "subnet_arm_id": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'subnet_arm_id': {'key': 'subnetArmId', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "subnet_arm_id": {"key": "subnetArmId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(PrivateEndpoint, self).__init__(**kwargs) self.id = None self.subnet_arm_id = None @@ -12037,25 +12540,34 @@ class PrivateEndpointConnection(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "private_endpoint": { + "key": "properties.privateEndpoint", + "type": "PrivateEndpoint", + }, + "private_link_service_connection_state": { + "key": "properties.privateLinkServiceConnectionState", + "type": "PrivateLinkServiceConnectionState", + }, + "provisioning_state": { + "key": "properties.provisioningState", + "type": "str", + }, } def __init__( @@ -12066,7 +12578,9 @@ def __init__( tags: Optional[Dict[str, str]] = None, sku: Optional["Sku"] = None, private_endpoint: Optional["PrivateEndpoint"] = None, - private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, + private_link_service_connection_state: Optional[ + "PrivateLinkServiceConnectionState" + ] = None, **kwargs ): """ @@ -12091,7 +12605,9 @@ def __init__( self.tags = tags self.sku = sku self.private_endpoint = private_endpoint - self.private_link_service_connection_state = private_link_service_connection_state + self.private_link_service_connection_state = ( + private_link_service_connection_state + ) self.provisioning_state = None @@ -12103,7 +12619,7 @@ class PrivateEndpointConnectionListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + "value": {"key": "value", "type": "[PrivateEndpointConnection]"}, } def __init__( @@ -12153,26 +12669,32 @@ class PrivateLinkResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'group_id': {'readonly': True}, - 'required_members': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "group_id": {"readonly": True}, + "required_members": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, - 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "group_id": {"key": "properties.groupId", "type": "str"}, + "required_members": { + "key": "properties.requiredMembers", + "type": "[str]", + }, + "required_zone_names": { + "key": "properties.requiredZoneNames", + "type": "[str]", + }, } def __init__( @@ -12215,14 +12737,11 @@ class PrivateLinkResourceListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + "value": {"key": "value", "type": "[PrivateLinkResource]"}, } def __init__( - self, - *, - value: Optional[List["PrivateLinkResource"]] = None, - **kwargs + self, *, value: Optional[List["PrivateLinkResource"]] = None, **kwargs ): """ :keyword value: Array of private link resources. @@ -12248,15 +12767,17 @@ class PrivateLinkServiceConnectionState(msrest.serialization.Model): """ _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + "status": {"key": "status", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "actions_required": {"key": "actionsRequired", "type": "str"}, } def __init__( self, *, - status: Optional[Union[str, "PrivateEndpointServiceConnectionStatus"]] = None, + status: Optional[ + Union[str, "PrivateEndpointServiceConnectionStatus"] + ] = None, description: Optional[str] = None, actions_required: Optional[str] = None, **kwargs @@ -12295,11 +12816,11 @@ class ProbeSettings(msrest.serialization.Model): """ _attribute_map = { - 'failure_threshold': {'key': 'failureThreshold', 'type': 'int'}, - 'initial_delay': {'key': 'initialDelay', 'type': 'duration'}, - 'period': {'key': 'period', 'type': 'duration'}, - 'success_threshold': {'key': 'successThreshold', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "failure_threshold": {"key": "failureThreshold", "type": "int"}, + "initial_delay": {"key": "initialDelay", "type": "duration"}, + "period": {"key": "period", "type": "duration"}, + "success_threshold": {"key": "successThreshold", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } def __init__( @@ -12346,26 +12867,26 @@ class PyTorch(DistributionConfiguration): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, + "distribution_type": {"key": "distributionType", "type": "str"}, + "process_count_per_instance": { + "key": "processCountPerInstance", + "type": "int", + }, } def __init__( - self, - *, - process_count_per_instance: Optional[int] = None, - **kwargs + self, *, process_count_per_instance: Optional[int] = None, **kwargs ): """ :keyword process_count_per_instance: Number of processes per node. :paramtype process_count_per_instance: int """ super(PyTorch, self).__init__(**kwargs) - self.distribution_type = 'PyTorch' # type: str + self.distribution_type = "PyTorch" # type: str self.process_count_per_instance = process_count_per_instance @@ -12383,10 +12904,10 @@ class QuotaBaseProperties(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "limit": {"key": "limit", "type": "long"}, + "unit": {"key": "unit", "type": "str"}, } def __init__( @@ -12426,8 +12947,8 @@ class QuotaUpdateParameters(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[QuotaBaseProperties]'}, - 'location': {'key': 'location', 'type': 'str'}, + "value": {"key": "value", "type": "[QuotaBaseProperties]"}, + "location": {"key": "location", "type": "str"}, } def __init__( @@ -12465,13 +12986,16 @@ class RandomSamplingAlgorithm(SamplingAlgorithm): """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - 'rule': {'key': 'rule', 'type': 'str'}, - 'seed': {'key': 'seed', 'type': 'int'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, + "rule": {"key": "rule", "type": "str"}, + "seed": {"key": "seed", "type": "int"}, } def __init__( @@ -12489,7 +13013,7 @@ def __init__( :paramtype seed: int """ super(RandomSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Random' # type: str + self.sampling_algorithm_type = "Random" # type: str self.rule = rule self.seed = seed @@ -12508,14 +13032,14 @@ class RecurrencePattern(msrest.serialization.Model): """ _validation = { - 'hours': {'required': True}, - 'minutes': {'required': True}, + "hours": {"required": True}, + "minutes": {"required": True}, } _attribute_map = { - 'hours': {'key': 'hours', 'type': '[int]'}, - 'minutes': {'key': 'minutes', 'type': '[int]'}, - 'weekdays': {'key': 'weekdays', 'type': '[str]'}, + "hours": {"key": "hours", "type": "[int]"}, + "minutes": {"key": "minutes", "type": "[int]"}, + "weekdays": {"key": "weekdays", "type": "[str]"}, } def __init__( @@ -12569,20 +13093,20 @@ class RecurrenceSchedule(ScheduleBase): """ _validation = { - 'schedule_type': {'required': True}, - 'frequency': {'required': True}, - 'interval': {'required': True}, + "schedule_type": {"required": True}, + "frequency": {"required": True}, + "interval": {"required": True}, } _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'schedule_status': {'key': 'scheduleStatus', 'type': 'str'}, - 'schedule_type': {'key': 'scheduleType', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'pattern': {'key': 'pattern', 'type': 'RecurrencePattern'}, + "end_time": {"key": "endTime", "type": "iso-8601"}, + "schedule_status": {"key": "scheduleStatus", "type": "str"}, + "schedule_type": {"key": "scheduleType", "type": "str"}, + "start_time": {"key": "startTime", "type": "iso-8601"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "frequency": {"key": "frequency", "type": "str"}, + "interval": {"key": "interval", "type": "int"}, + "pattern": {"key": "pattern", "type": "RecurrencePattern"}, } def __init__( @@ -12618,8 +13142,14 @@ def __init__( :keyword pattern: Specifies the recurrence schedule pattern. :paramtype pattern: ~azure.mgmt.machinelearningservices.models.RecurrencePattern """ - super(RecurrenceSchedule, self).__init__(end_time=end_time, schedule_status=schedule_status, start_time=start_time, time_zone=time_zone, **kwargs) - self.schedule_type = 'Recurrence' # type: str + super(RecurrenceSchedule, self).__init__( + end_time=end_time, + schedule_status=schedule_status, + start_time=start_time, + time_zone=time_zone, + **kwargs + ) + self.schedule_type = "Recurrence" # type: str self.frequency = frequency self.interval = interval self.pattern = pattern @@ -12638,12 +13168,12 @@ class RegenerateEndpointKeysRequest(msrest.serialization.Model): """ _validation = { - 'key_type': {'required': True}, + "key_type": {"required": True}, } _attribute_map = { - 'key_type': {'key': 'keyType', 'type': 'str'}, - 'key_value': {'key': 'keyValue', 'type': 'str'}, + "key_type": {"key": "keyType", "type": "str"}, + "key_value": {"key": "keyValue", "type": "str"}, } def __init__( @@ -12679,21 +13209,18 @@ class RegistryListCredentialsResult(msrest.serialization.Model): """ _validation = { - 'location': {'readonly': True}, - 'username': {'readonly': True}, + "location": {"readonly": True}, + "username": {"readonly": True}, } _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'username': {'key': 'username', 'type': 'str'}, - 'passwords': {'key': 'passwords', 'type': '[Password]'}, + "location": {"key": "location", "type": "str"}, + "username": {"key": "username", "type": "str"}, + "passwords": {"key": "passwords", "type": "[Password]"}, } def __init__( - self, - *, - passwords: Optional[List["Password"]] = None, - **kwargs + self, *, passwords: Optional[List["Password"]] = None, **kwargs ): """ :keyword passwords: @@ -12717,9 +13244,9 @@ class ResourceConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "properties": {"key": "properties", "type": "{object}"}, } def __init__( @@ -12754,19 +13281,14 @@ class ResourceId(msrest.serialization.Model): """ _validation = { - 'id': {'required': True}, + "id": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, } - def __init__( - self, - *, - id: str, - **kwargs - ): + def __init__(self, *, id: str, **kwargs): """ :keyword id: Required. The ID of the resource. :paramtype id: str @@ -12787,21 +13309,17 @@ class ResourceName(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, + "value": {"readonly": True}, + "localized_value": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + "value": {"key": "value", "type": "str"}, + "localized_value": {"key": "localizedValue", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ResourceName, self).__init__(**kwargs) self.value = None self.localized_value = None @@ -12827,29 +13345,28 @@ class ResourceQuota(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'name': {'readonly': True}, - 'limit': {'readonly': True}, - 'unit': {'readonly': True}, + "id": {"readonly": True}, + "aml_workspace_location": {"readonly": True}, + "type": {"readonly": True}, + "name": {"readonly": True}, + "limit": {"readonly": True}, + "unit": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'ResourceName'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "aml_workspace_location": { + "key": "amlWorkspaceLocation", + "type": "str", + }, + "type": {"key": "type", "type": "str"}, + "name": {"key": "name", "type": "ResourceName"}, + "limit": {"key": "limit", "type": "long"}, + "unit": {"key": "unit", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ResourceQuota, self).__init__(**kwargs) self.id = None self.aml_workspace_location = None @@ -12871,22 +13388,16 @@ class Route(msrest.serialization.Model): """ _validation = { - 'path': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'port': {'required': True}, + "path": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "port": {"required": True}, } _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, + "path": {"key": "path", "type": "str"}, + "port": {"key": "port", "type": "int"}, } - def __init__( - self, - *, - path: str, - port: int, - **kwargs - ): + def __init__(self, *, path: str, port: int, **kwargs): """ :keyword path: Required. [Required] The path for the route. :paramtype path: str @@ -12898,7 +13409,9 @@ def __init__( self.port = port -class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class SASAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """SASAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -12921,16 +13434,19 @@ class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionSharedAccessSignature'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionSharedAccessSignature", + }, } def __init__( @@ -12940,7 +13456,9 @@ def __init__( target: Optional[str] = None, value: Optional[str] = None, value_format: Optional[Union[str, "ValueFormat"]] = None, - credentials: Optional["WorkspaceConnectionSharedAccessSignature"] = None, + credentials: Optional[ + "WorkspaceConnectionSharedAccessSignature" + ] = None, **kwargs ): """ @@ -12958,8 +13476,14 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature """ - super(SASAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'SAS' # type: str + super(SASAuthTypeWorkspaceConnectionProperties, self).__init__( + category=category, + target=target, + value=value, + value_format=value_format, + **kwargs + ) + self.auth_type = "SAS" # type: str self.credentials = credentials @@ -12977,27 +13501,22 @@ class SasDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, + "credentials_type": {"required": True}, + "secrets": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'SasDatastoreSecrets'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "secrets": {"key": "secrets", "type": "SasDatastoreSecrets"}, } - def __init__( - self, - *, - secrets: "SasDatastoreSecrets", - **kwargs - ): + def __init__(self, *, secrets: "SasDatastoreSecrets", **kwargs): """ :keyword secrets: Required. [Required] Storage container secrets. :paramtype secrets: ~azure.mgmt.machinelearningservices.models.SasDatastoreSecrets """ super(SasDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Sas' # type: str + self.credentials_type = "Sas" # type: str self.secrets = secrets @@ -13015,26 +13534,21 @@ class SasDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'sas_token': {'key': 'sasToken', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "sas_token": {"key": "sasToken", "type": "str"}, } - def __init__( - self, - *, - sas_token: Optional[str] = None, - **kwargs - ): + def __init__(self, *, sas_token: Optional[str] = None, **kwargs): """ :keyword sas_token: Storage container SAS token. :paramtype sas_token: str """ super(SasDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Sas' # type: str + self.secrets_type = "Sas" # type: str self.sas_token = sas_token @@ -13053,13 +13567,16 @@ class ScaleSettings(msrest.serialization.Model): """ _validation = { - 'max_node_count': {'required': True}, + "max_node_count": {"required": True}, } _attribute_map = { - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'node_idle_time_before_scale_down': {'key': 'nodeIdleTimeBeforeScaleDown', 'type': 'duration'}, + "max_node_count": {"key": "maxNodeCount", "type": "int"}, + "min_node_count": {"key": "minNodeCount", "type": "int"}, + "node_idle_time_before_scale_down": { + "key": "nodeIdleTimeBeforeScaleDown", + "type": "duration", + }, } def __init__( @@ -13082,7 +13599,9 @@ def __init__( super(ScaleSettings, self).__init__(**kwargs) self.max_node_count = max_node_count self.min_node_count = min_node_count - self.node_idle_time_before_scale_down = node_idle_time_before_scale_down + self.node_idle_time_before_scale_down = ( + node_idle_time_before_scale_down + ) class ScaleSettingsInformation(msrest.serialization.Model): @@ -13093,14 +13612,11 @@ class ScaleSettingsInformation(msrest.serialization.Model): """ _attribute_map = { - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, + "scale_settings": {"key": "scaleSettings", "type": "ScaleSettings"}, } def __init__( - self, - *, - scale_settings: Optional["ScaleSettings"] = None, - **kwargs + self, *, scale_settings: Optional["ScaleSettings"] = None, **kwargs ): """ :keyword scale_settings: scale settings for AML Compute. @@ -13124,10 +13640,10 @@ class ScriptReference(msrest.serialization.Model): """ _attribute_map = { - 'script_source': {'key': 'scriptSource', 'type': 'str'}, - 'script_data': {'key': 'scriptData', 'type': 'str'}, - 'script_arguments': {'key': 'scriptArguments', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'str'}, + "script_source": {"key": "scriptSource", "type": "str"}, + "script_data": {"key": "scriptData", "type": "str"}, + "script_arguments": {"key": "scriptArguments", "type": "str"}, + "timeout": {"key": "timeout", "type": "str"}, } def __init__( @@ -13166,8 +13682,11 @@ class ScriptsToExecute(msrest.serialization.Model): """ _attribute_map = { - 'startup_script': {'key': 'startupScript', 'type': 'ScriptReference'}, - 'creation_script': {'key': 'creationScript', 'type': 'ScriptReference'}, + "startup_script": {"key": "startupScript", "type": "ScriptReference"}, + "creation_script": { + "key": "creationScript", + "type": "ScriptReference", + }, } def __init__( @@ -13196,14 +13715,11 @@ class ServiceManagedResourcesSettings(msrest.serialization.Model): """ _attribute_map = { - 'cosmos_db': {'key': 'cosmosDb', 'type': 'CosmosDbSettings'}, + "cosmos_db": {"key": "cosmosDb", "type": "CosmosDbSettings"}, } def __init__( - self, - *, - cosmos_db: Optional["CosmosDbSettings"] = None, - **kwargs + self, *, cosmos_db: Optional["CosmosDbSettings"] = None, **kwargs ): """ :keyword cosmos_db: The settings for the service managed cosmosdb account. @@ -13235,19 +13751,22 @@ class ServicePrincipalDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, + "credentials_type": {"required": True}, + "client_id": {"required": True}, + "secrets": {"required": True}, + "tenant_id": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'ServicePrincipalDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "authority_url": {"key": "authorityUrl", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + "resource_url": {"key": "resourceUrl", "type": "str"}, + "secrets": { + "key": "secrets", + "type": "ServicePrincipalDatastoreSecrets", + }, + "tenant_id": {"key": "tenantId", "type": "str"}, } def __init__( @@ -13274,7 +13793,7 @@ def __init__( :paramtype tenant_id: str """ super(ServicePrincipalDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'ServicePrincipal' # type: str + self.credentials_type = "ServicePrincipal" # type: str self.authority_url = authority_url self.client_id = client_id self.resource_url = resource_url @@ -13296,26 +13815,21 @@ class ServicePrincipalDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "client_secret": {"key": "clientSecret", "type": "str"}, } - def __init__( - self, - *, - client_secret: Optional[str] = None, - **kwargs - ): + def __init__(self, *, client_secret: Optional[str] = None, **kwargs): """ :keyword client_secret: Service principal secret. :paramtype client_secret: str """ super(ServicePrincipalDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'ServicePrincipal' # type: str + self.secrets_type = "ServicePrincipal" # type: str self.client_secret = client_secret @@ -13327,14 +13841,11 @@ class SetupScripts(msrest.serialization.Model): """ _attribute_map = { - 'scripts': {'key': 'scripts', 'type': 'ScriptsToExecute'}, + "scripts": {"key": "scripts", "type": "ScriptsToExecute"}, } def __init__( - self, - *, - scripts: Optional["ScriptsToExecute"] = None, - **kwargs + self, *, scripts: Optional["ScriptsToExecute"] = None, **kwargs ): """ :keyword scripts: Customized setup scripts. @@ -13363,11 +13874,14 @@ class SharedPrivateLinkResource(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'private_link_resource_id': {'key': 'properties.privateLinkResourceId', 'type': 'str'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'request_message': {'key': 'properties.requestMessage', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "private_link_resource_id": { + "key": "properties.privateLinkResourceId", + "type": "str", + }, + "group_id": {"key": "properties.groupId", "type": "str"}, + "request_message": {"key": "properties.requestMessage", "type": "str"}, + "status": {"key": "properties.status", "type": "str"}, } def __init__( @@ -13377,7 +13891,9 @@ def __init__( private_link_resource_id: Optional[str] = None, group_id: Optional[str] = None, request_message: Optional[str] = None, - status: Optional[Union[str, "PrivateEndpointServiceConnectionStatus"]] = None, + status: Optional[ + Union[str, "PrivateEndpointServiceConnectionStatus"] + ] = None, **kwargs ): """ @@ -13426,15 +13942,15 @@ class Sku(msrest.serialization.Model): """ _validation = { - 'name': {'required': True}, + "name": {"required": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'int'}, + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, + "size": {"key": "size", "type": "str"}, + "family": {"key": "family", "type": "str"}, + "capacity": {"key": "capacity", "type": "int"}, } def __init__( @@ -13487,10 +14003,10 @@ class SkuCapacity(msrest.serialization.Model): """ _attribute_map = { - 'default': {'key': 'default', 'type': 'int'}, - 'maximum': {'key': 'maximum', 'type': 'int'}, - 'minimum': {'key': 'minimum', 'type': 'int'}, - 'scale_type': {'key': 'scaleType', 'type': 'str'}, + "default": {"key": "default", "type": "int"}, + "maximum": {"key": "maximum", "type": "int"}, + "minimum": {"key": "minimum", "type": "int"}, + "scale_type": {"key": "scaleType", "type": "str"}, } def __init__( @@ -13534,13 +14050,13 @@ class SkuResource(msrest.serialization.Model): """ _validation = { - 'resource_type': {'readonly': True}, + "resource_type": {"readonly": True}, } _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'SkuSetting'}, + "capacity": {"key": "capacity", "type": "SkuCapacity"}, + "resource_type": {"key": "resourceType", "type": "str"}, + "sku": {"key": "sku", "type": "SkuSetting"}, } def __init__( @@ -13573,8 +14089,8 @@ class SkuResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[SkuResource]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[SkuResource]"}, } def __init__( @@ -13611,12 +14127,12 @@ class SkuSetting(msrest.serialization.Model): """ _validation = { - 'name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, } def __init__( @@ -13659,12 +14175,15 @@ class SslConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'cert': {'key': 'cert', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - 'cname': {'key': 'cname', 'type': 'str'}, - 'leaf_domain_label': {'key': 'leafDomainLabel', 'type': 'str'}, - 'overwrite_existing_domain': {'key': 'overwriteExistingDomain', 'type': 'bool'}, + "status": {"key": "status", "type": "str"}, + "cert": {"key": "cert", "type": "str"}, + "key": {"key": "key", "type": "str"}, + "cname": {"key": "cname", "type": "str"}, + "leaf_domain_label": {"key": "leafDomainLabel", "type": "str"}, + "overwrite_existing_domain": { + "key": "overwriteExistingDomain", + "type": "bool", + }, } def __init__( @@ -13759,34 +14278,40 @@ class SweepJob(JobBaseDetails): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'objective': {'required': True}, - 'sampling_algorithm': {'required': True}, - 'search_space': {'required': True}, - 'trial': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'SweepJobLimits'}, - 'objective': {'key': 'objective', 'type': 'Objective'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'SamplingAlgorithm'}, - 'search_space': {'key': 'searchSpace', 'type': 'object'}, - 'trial': {'key': 'trial', 'type': 'TrialComponent'}, + "job_type": {"required": True}, + "status": {"readonly": True}, + "objective": {"required": True}, + "sampling_algorithm": {"required": True}, + "search_space": {"required": True}, + "trial": {"required": True}, + } + + _attribute_map = { + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "limits": {"key": "limits", "type": "SweepJobLimits"}, + "objective": {"key": "objective", "type": "Objective"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "sampling_algorithm": { + "key": "samplingAlgorithm", + "type": "SamplingAlgorithm", + }, + "search_space": {"key": "searchSpace", "type": "object"}, + "trial": {"key": "trial", "type": "TrialComponent"}, } def __init__( @@ -13853,8 +14378,19 @@ def __init__( :keyword trial: Required. [Required] Trial component definition. :paramtype trial: ~azure.mgmt.machinelearningservices.models.TrialComponent """ - super(SweepJob, self).__init__(description=description, properties=properties, tags=tags, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, services=services, **kwargs) - self.job_type = 'Sweep' # type: str + super(SweepJob, self).__init__( + description=description, + properties=properties, + tags=tags, + compute_id=compute_id, + display_name=display_name, + experiment_name=experiment_name, + identity=identity, + is_archived=is_archived, + services=services, + **kwargs + ) + self.job_type = "Sweep" # type: str self.early_termination = early_termination self.inputs = inputs self.limits = limits @@ -13885,15 +14421,15 @@ class SweepJobLimits(JobLimits): """ _validation = { - 'job_limits_type': {'required': True}, + "job_limits_type": {"required": True}, } _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_total_trials': {'key': 'maxTotalTrials', 'type': 'int'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, + "job_limits_type": {"key": "jobLimitsType", "type": "str"}, + "timeout": {"key": "timeout", "type": "duration"}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_total_trials": {"key": "maxTotalTrials", "type": "int"}, + "trial_timeout": {"key": "trialTimeout", "type": "duration"}, } def __init__( @@ -13917,7 +14453,7 @@ def __init__( :paramtype trial_timeout: ~datetime.timedelta """ super(SweepJobLimits, self).__init__(timeout=timeout, **kwargs) - self.job_limits_type = 'Sweep' # type: str + self.job_limits_type = "Sweep" # type: str self.max_concurrent_trials = max_concurrent_trials self.max_total_trials = max_total_trials self.trial_timeout = trial_timeout @@ -13962,27 +14498,30 @@ class SynapseSpark(Compute): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'SynapseSparkProperties'}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, + "properties": {"key": "properties", "type": "SynapseSparkProperties"}, } def __init__( @@ -14005,8 +14544,13 @@ def __init__( :keyword properties: :paramtype properties: ~azure.mgmt.machinelearningservices.models.SynapseSparkProperties """ - super(SynapseSpark, self).__init__(description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, **kwargs) - self.compute_type = 'SynapseSpark' # type: str + super(SynapseSpark, self).__init__( + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + **kwargs + ) + self.compute_type = "SynapseSpark" # type: str self.properties = properties @@ -14036,16 +14580,22 @@ class SynapseSparkProperties(msrest.serialization.Model): """ _attribute_map = { - 'auto_scale_properties': {'key': 'autoScaleProperties', 'type': 'AutoScaleProperties'}, - 'auto_pause_properties': {'key': 'autoPauseProperties', 'type': 'AutoPauseProperties'}, - 'spark_version': {'key': 'sparkVersion', 'type': 'str'}, - 'node_count': {'key': 'nodeCount', 'type': 'int'}, - 'node_size': {'key': 'nodeSize', 'type': 'str'}, - 'node_size_family': {'key': 'nodeSizeFamily', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'workspace_name': {'key': 'workspaceName', 'type': 'str'}, - 'pool_name': {'key': 'poolName', 'type': 'str'}, + "auto_scale_properties": { + "key": "autoScaleProperties", + "type": "AutoScaleProperties", + }, + "auto_pause_properties": { + "key": "autoPauseProperties", + "type": "AutoPauseProperties", + }, + "spark_version": {"key": "sparkVersion", "type": "str"}, + "node_count": {"key": "nodeCount", "type": "int"}, + "node_size": {"key": "nodeSize", "type": "str"}, + "node_size_family": {"key": "nodeSizeFamily", "type": "str"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, + "resource_group": {"key": "resourceGroup", "type": "str"}, + "workspace_name": {"key": "workspaceName", "type": "str"}, + "pool_name": {"key": "poolName", "type": "str"}, } def __init__( @@ -14120,12 +14670,12 @@ class SystemData(msrest.serialization.Model): """ _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + "created_by": {"key": "createdBy", "type": "str"}, + "created_by_type": {"key": "createdByType", "type": "str"}, + "created_at": {"key": "createdAt", "type": "iso-8601"}, + "last_modified_by": {"key": "lastModifiedBy", "type": "str"}, + "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"}, + "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, } def __init__( @@ -14179,23 +14729,19 @@ class SystemService(msrest.serialization.Model): """ _validation = { - 'system_service_type': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'version': {'readonly': True}, + "system_service_type": {"readonly": True}, + "public_ip_address": {"readonly": True}, + "version": {"readonly": True}, } _attribute_map = { - 'system_service_type': {'key': 'systemServiceType', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, + "system_service_type": {"key": "systemServiceType", "type": "str"}, + "public_ip_address": {"key": "publicIpAddress", "type": "str"}, + "version": {"key": "version", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(SystemService, self).__init__(**kwargs) self.system_service_type = None self.public_ip_address = None @@ -14223,15 +14769,18 @@ class TargetUtilizationScaleSettings(OnlineScaleSettings): """ _validation = { - 'scale_type': {'required': True}, + "scale_type": {"required": True}, } _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - 'max_instances': {'key': 'maxInstances', 'type': 'int'}, - 'min_instances': {'key': 'minInstances', 'type': 'int'}, - 'polling_interval': {'key': 'pollingInterval', 'type': 'duration'}, - 'target_utilization_percentage': {'key': 'targetUtilizationPercentage', 'type': 'int'}, + "scale_type": {"key": "scaleType", "type": "str"}, + "max_instances": {"key": "maxInstances", "type": "int"}, + "min_instances": {"key": "minInstances", "type": "int"}, + "polling_interval": {"key": "pollingInterval", "type": "duration"}, + "target_utilization_percentage": { + "key": "targetUtilizationPercentage", + "type": "int", + }, } def __init__( @@ -14256,7 +14805,7 @@ def __init__( :paramtype target_utilization_percentage: int """ super(TargetUtilizationScaleSettings, self).__init__(**kwargs) - self.scale_type = 'TargetUtilization' # type: str + self.scale_type = "TargetUtilization" # type: str self.max_instances = max_instances self.min_instances = min_instances self.polling_interval = polling_interval @@ -14278,13 +14827,16 @@ class TensorFlow(DistributionConfiguration): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'parameter_server_count': {'key': 'parameterServerCount', 'type': 'int'}, - 'worker_count': {'key': 'workerCount', 'type': 'int'}, + "distribution_type": {"key": "distributionType", "type": "str"}, + "parameter_server_count": { + "key": "parameterServerCount", + "type": "int", + }, + "worker_count": {"key": "workerCount", "type": "int"}, } def __init__( @@ -14301,7 +14853,7 @@ def __init__( :paramtype worker_count: int """ super(TensorFlow, self).__init__(**kwargs) - self.distribution_type = 'TensorFlow' # type: str + self.distribution_type = "TensorFlow" # type: str self.parameter_server_count = parameter_server_count self.worker_count = worker_count @@ -14329,17 +14881,27 @@ class TrialComponent(msrest.serialization.Model): """ _validation = { - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "command": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "environment_id": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'ResourceConfiguration'}, + "code_id": {"key": "codeId", "type": "str"}, + "command": {"key": "command", "type": "str"}, + "distribution": { + "key": "distribution", + "type": "DistributionConfiguration", + }, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "resources": {"key": "resources", "type": "ResourceConfiguration"}, } def __init__( @@ -14398,15 +14960,15 @@ class TritonModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -14426,12 +14988,14 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(TritonModelJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(TritonModelJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'triton_model' # type: str + self.job_input_type = "triton_model" # type: str self.description = description - self.job_input_type = 'triton_model' # type: str + self.job_input_type = "triton_model" # type: str class TritonModelJobOutput(JobOutput, AssetJobOutput): @@ -14452,14 +15016,14 @@ class TritonModelJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -14478,12 +15042,14 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(TritonModelJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(TritonModelJobOutput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_output_type = 'triton_model' # type: str + self.job_output_type = "triton_model" # type: str self.description = description - self.job_output_type = 'triton_model' # type: str + self.job_output_type = "triton_model" # type: str class TruncationSelectionPolicy(EarlyTerminationPolicy): @@ -14504,14 +15070,17 @@ class TruncationSelectionPolicy(EarlyTerminationPolicy): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'truncation_percentage': {'key': 'truncationPercentage', 'type': 'int'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, + "truncation_percentage": { + "key": "truncationPercentage", + "type": "int", + }, } def __init__( @@ -14530,8 +15099,12 @@ def __init__( :keyword truncation_percentage: The percentage of runs to cancel at each evaluation interval. :paramtype truncation_percentage: int """ - super(TruncationSelectionPolicy, self).__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs) - self.policy_type = 'TruncationSelection' # type: str + super(TruncationSelectionPolicy, self).__init__( + delay_evaluation=delay_evaluation, + evaluation_interval=evaluation_interval, + **kwargs + ) + self.policy_type = "TruncationSelection" # type: str self.truncation_percentage = truncation_percentage @@ -14556,17 +15129,17 @@ class UpdateWorkspaceQuotas(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, + "id": {"readonly": True}, + "type": {"readonly": True}, + "unit": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "limit": {"key": "limit", "type": "long"}, + "unit": {"key": "unit", "type": "str"}, + "status": {"key": "status", "type": "str"}, } def __init__( @@ -14606,21 +15179,17 @@ class UpdateWorkspaceQuotasResult(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[UpdateWorkspaceQuotas]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[UpdateWorkspaceQuotas]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UpdateWorkspaceQuotasResult, self).__init__(**kwargs) self.value = None self.next_link = None @@ -14650,18 +15219,18 @@ class UriFileDataVersion(DataVersionBaseDetails): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, } def __init__( @@ -14690,8 +15259,16 @@ def __init__( Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20220501.Assets.DataVersionBase.DataType. :paramtype data_uri: str """ - super(UriFileDataVersion, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, **kwargs) - self.data_type = 'uri_file' # type: str + super(UriFileDataVersion, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + data_uri=data_uri, + **kwargs + ) + self.data_type = "uri_file" # type: str class UriFileJobInput(JobInput, AssetJobInput): @@ -14713,15 +15290,15 @@ class UriFileJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -14741,12 +15318,14 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(UriFileJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(UriFileJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'uri_file' # type: str + self.job_input_type = "uri_file" # type: str self.description = description - self.job_input_type = 'uri_file' # type: str + self.job_input_type = "uri_file" # type: str class UriFileJobOutput(JobOutput, AssetJobOutput): @@ -14767,14 +15346,14 @@ class UriFileJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -14793,12 +15372,14 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(UriFileJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(UriFileJobOutput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_output_type = 'uri_file' # type: str + self.job_output_type = "uri_file" # type: str self.description = description - self.job_output_type = 'uri_file' # type: str + self.job_output_type = "uri_file" # type: str class UriFolderDataVersion(DataVersionBaseDetails): @@ -14825,18 +15406,18 @@ class UriFolderDataVersion(DataVersionBaseDetails): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, } def __init__( @@ -14865,8 +15446,16 @@ def __init__( Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20220501.Assets.DataVersionBase.DataType. :paramtype data_uri: str """ - super(UriFolderDataVersion, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, **kwargs) - self.data_type = 'uri_folder' # type: str + super(UriFolderDataVersion, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + data_uri=data_uri, + **kwargs + ) + self.data_type = "uri_folder" # type: str class UriFolderJobInput(JobInput, AssetJobInput): @@ -14888,15 +15477,15 @@ class UriFolderJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -14916,12 +15505,14 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(UriFolderJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(UriFolderJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'uri_folder' # type: str + self.job_input_type = "uri_folder" # type: str self.description = description - self.job_input_type = 'uri_folder' # type: str + self.job_input_type = "uri_folder" # type: str class UriFolderJobOutput(JobOutput, AssetJobOutput): @@ -14942,14 +15533,14 @@ class UriFolderJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -14968,12 +15559,14 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(UriFolderJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(UriFolderJobOutput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_output_type = 'uri_folder' # type: str + self.job_output_type = "uri_folder" # type: str self.description = description - self.job_output_type = 'uri_folder' # type: str + self.job_output_type = "uri_folder" # type: str class Usage(msrest.serialization.Model): @@ -14998,31 +15591,30 @@ class Usage(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'current_value': {'key': 'currentValue', 'type': 'long'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'name': {'key': 'name', 'type': 'UsageName'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ + "id": {"readonly": True}, + "aml_workspace_location": {"readonly": True}, + "type": {"readonly": True}, + "unit": {"readonly": True}, + "current_value": {"readonly": True}, + "limit": {"readonly": True}, + "name": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "aml_workspace_location": { + "key": "amlWorkspaceLocation", + "type": "str", + }, + "type": {"key": "type", "type": "str"}, + "unit": {"key": "unit", "type": "str"}, + "current_value": {"key": "currentValue", "type": "long"}, + "limit": {"key": "limit", "type": "long"}, + "name": {"key": "name", "type": "UsageName"}, + } + + def __init__(self, **kwargs): + """ """ super(Usage, self).__init__(**kwargs) self.id = None self.aml_workspace_location = None @@ -15045,21 +15637,17 @@ class UsageName(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, + "value": {"readonly": True}, + "localized_value": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + "value": {"key": "value", "type": "str"}, + "localized_value": {"key": "localizedValue", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UsageName, self).__init__(**kwargs) self.value = None self.localized_value = None @@ -15080,13 +15668,16 @@ class UserAccountCredentials(msrest.serialization.Model): """ _validation = { - 'admin_user_name': {'required': True}, + "admin_user_name": {"required": True}, } _attribute_map = { - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'admin_user_ssh_public_key': {'key': 'adminUserSshPublicKey', 'type': 'str'}, - 'admin_user_password': {'key': 'adminUserPassword', 'type': 'str'}, + "admin_user_name": {"key": "adminUserName", "type": "str"}, + "admin_user_ssh_public_key": { + "key": "adminUserSshPublicKey", + "type": "str", + }, + "admin_user_password": {"key": "adminUserPassword", "type": "str"}, } def __init__( @@ -15124,21 +15715,17 @@ class UserAssignedIdentity(msrest.serialization.Model): """ _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, + "principal_id": {"readonly": True}, + "client_id": {"readonly": True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, + "principal_id": {"key": "principalId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UserAssignedIdentity, self).__init__(**kwargs) self.principal_id = None self.client_id = None @@ -15156,24 +15743,22 @@ class UserIdentity(IdentityConfiguration): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UserIdentity, self).__init__(**kwargs) - self.identity_type = 'UserIdentity' # type: str + self.identity_type = "UserIdentity" # type: str -class UsernamePasswordAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class UsernamePasswordAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """UsernamePasswordAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -15196,16 +15781,19 @@ class UsernamePasswordAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionP """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionUsernamePassword'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionUsernamePassword", + }, } def __init__( @@ -15233,8 +15821,16 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword """ - super(UsernamePasswordAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'UsernamePassword' # type: str + super( + UsernamePasswordAuthTypeWorkspaceConnectionProperties, self + ).__init__( + category=category, + target=target, + value=value, + value_format=value_format, + **kwargs + ) + self.auth_type = "UsernamePassword" # type: str self.credentials = credentials @@ -15246,7 +15842,10 @@ class VirtualMachineSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, + "properties": { + "key": "properties", + "type": "VirtualMachineSchemaProperties", + }, } def __init__( @@ -15303,27 +15902,33 @@ class VirtualMachine(Compute, VirtualMachineSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": { + "key": "properties", + "type": "VirtualMachineSchemaProperties", + }, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -15347,10 +15952,16 @@ def __init__( MSI and AAD exclusively for authentication. :paramtype disable_local_auth: bool """ - super(VirtualMachine, self).__init__(description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) + super(VirtualMachine, self).__init__( + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'VirtualMachine' # type: str - self.compute_type = 'VirtualMachine' # type: str + self.compute_type = "VirtualMachine" # type: str + self.compute_type = "VirtualMachine" # type: str self.compute_location = None self.provisioning_state = None self.description = description @@ -15372,19 +15983,14 @@ class VirtualMachineImage(msrest.serialization.Model): """ _validation = { - 'id': {'required': True}, + "id": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, } - def __init__( - self, - *, - id: str, - **kwargs - ): + def __init__(self, *, id: str, **kwargs): """ :keyword id: Required. Virtual Machine image path. :paramtype id: str @@ -15413,12 +16019,18 @@ class VirtualMachineSchemaProperties(msrest.serialization.Model): """ _attribute_map = { - 'virtual_machine_size': {'key': 'virtualMachineSize', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'notebook_server_port': {'key': 'notebookServerPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'is_notebook_instance_compute': {'key': 'isNotebookInstanceCompute', 'type': 'bool'}, + "virtual_machine_size": {"key": "virtualMachineSize", "type": "str"}, + "ssh_port": {"key": "sshPort", "type": "int"}, + "notebook_server_port": {"key": "notebookServerPort", "type": "int"}, + "address": {"key": "address", "type": "str"}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, + "is_notebook_instance_compute": { + "key": "isNotebookInstanceCompute", + "type": "bool", + }, } def __init__( @@ -15466,7 +16078,10 @@ class VirtualMachineSecretsSchema(msrest.serialization.Model): """ _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, } def __init__( @@ -15499,12 +16114,15 @@ class VirtualMachineSecrets(ComputeSecrets, VirtualMachineSecretsSchema): """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, + "compute_type": {"key": "computeType", "type": "str"}, } def __init__( @@ -15518,10 +16136,12 @@ def __init__( :paramtype administrator_account: ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials """ - super(VirtualMachineSecrets, self).__init__(administrator_account=administrator_account, **kwargs) + super(VirtualMachineSecrets, self).__init__( + administrator_account=administrator_account, **kwargs + ) self.administrator_account = administrator_account - self.compute_type = 'VirtualMachine' # type: str - self.compute_type = 'VirtualMachine' # type: str + self.compute_type = "VirtualMachine" # type: str + self.compute_type = "VirtualMachine" # type: str class VirtualMachineSize(msrest.serialization.Model): @@ -15556,29 +16176,38 @@ class VirtualMachineSize(msrest.serialization.Model): """ _validation = { - 'name': {'readonly': True}, - 'family': {'readonly': True}, - 'v_cp_us': {'readonly': True}, - 'gpus': {'readonly': True}, - 'os_vhd_size_mb': {'readonly': True}, - 'max_resource_volume_mb': {'readonly': True}, - 'memory_gb': {'readonly': True}, - 'low_priority_capable': {'readonly': True}, - 'premium_io': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'v_cp_us': {'key': 'vCPUs', 'type': 'int'}, - 'gpus': {'key': 'gpus', 'type': 'int'}, - 'os_vhd_size_mb': {'key': 'osVhdSizeMB', 'type': 'int'}, - 'max_resource_volume_mb': {'key': 'maxResourceVolumeMB', 'type': 'int'}, - 'memory_gb': {'key': 'memoryGB', 'type': 'float'}, - 'low_priority_capable': {'key': 'lowPriorityCapable', 'type': 'bool'}, - 'premium_io': {'key': 'premiumIO', 'type': 'bool'}, - 'estimated_vm_prices': {'key': 'estimatedVMPrices', 'type': 'EstimatedVMPrices'}, - 'supported_compute_types': {'key': 'supportedComputeTypes', 'type': '[str]'}, + "name": {"readonly": True}, + "family": {"readonly": True}, + "v_cp_us": {"readonly": True}, + "gpus": {"readonly": True}, + "os_vhd_size_mb": {"readonly": True}, + "max_resource_volume_mb": {"readonly": True}, + "memory_gb": {"readonly": True}, + "low_priority_capable": {"readonly": True}, + "premium_io": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "family": {"key": "family", "type": "str"}, + "v_cp_us": {"key": "vCPUs", "type": "int"}, + "gpus": {"key": "gpus", "type": "int"}, + "os_vhd_size_mb": {"key": "osVhdSizeMB", "type": "int"}, + "max_resource_volume_mb": { + "key": "maxResourceVolumeMB", + "type": "int", + }, + "memory_gb": {"key": "memoryGB", "type": "float"}, + "low_priority_capable": {"key": "lowPriorityCapable", "type": "bool"}, + "premium_io": {"key": "premiumIO", "type": "bool"}, + "estimated_vm_prices": { + "key": "estimatedVMPrices", + "type": "EstimatedVMPrices", + }, + "supported_compute_types": { + "key": "supportedComputeTypes", + "type": "[str]", + }, } def __init__( @@ -15617,14 +16246,11 @@ class VirtualMachineSizeListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[VirtualMachineSize]'}, + "value": {"key": "value", "type": "[VirtualMachineSize]"}, } def __init__( - self, - *, - value: Optional[List["VirtualMachineSize"]] = None, - **kwargs + self, *, value: Optional[List["VirtualMachineSize"]] = None, **kwargs ): """ :keyword value: The list of virtual machine sizes supported by AmlCompute. @@ -15648,10 +16274,10 @@ class VirtualMachineSshCredentials(msrest.serialization.Model): """ _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'public_key_data': {'key': 'publicKeyData', 'type': 'str'}, - 'private_key_data': {'key': 'privateKeyData', 'type': 'str'}, + "username": {"key": "username", "type": "str"}, + "password": {"key": "password", "type": "str"}, + "public_key_data": {"key": "publicKeyData", "type": "str"}, + "private_key_data": {"key": "privateKeyData", "type": "str"}, } def __init__( @@ -15773,54 +16399,102 @@ class Workspace(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'workspace_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'service_provisioned_resource_group': {'readonly': True}, - 'private_link_count': {'readonly': True}, - 'private_endpoint_connections': {'readonly': True}, - 'notebook_info': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'storage_hns_enabled': {'readonly': True}, - 'ml_flow_tracking_uri': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'key_vault': {'key': 'properties.keyVault', 'type': 'str'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'storage_account': {'key': 'properties.storageAccount', 'type': 'str'}, - 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionProperty'}, - 'hbi_workspace': {'key': 'properties.hbiWorkspace', 'type': 'bool'}, - 'service_provisioned_resource_group': {'key': 'properties.serviceProvisionedResourceGroup', 'type': 'str'}, - 'private_link_count': {'key': 'properties.privateLinkCount', 'type': 'int'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'allow_public_access_when_behind_vnet': {'key': 'properties.allowPublicAccessWhenBehindVnet', 'type': 'bool'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, - 'shared_private_link_resources': {'key': 'properties.sharedPrivateLinkResources', 'type': '[SharedPrivateLinkResource]'}, - 'notebook_info': {'key': 'properties.notebookInfo', 'type': 'NotebookResourceInfo'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, - 'storage_hns_enabled': {'key': 'properties.storageHnsEnabled', 'type': 'bool'}, - 'ml_flow_tracking_uri': {'key': 'properties.mlFlowTrackingUri', 'type': 'str'}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "workspace_id": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "service_provisioned_resource_group": {"readonly": True}, + "private_link_count": {"readonly": True}, + "private_endpoint_connections": {"readonly": True}, + "notebook_info": {"readonly": True}, + "tenant_id": {"readonly": True}, + "storage_hns_enabled": {"readonly": True}, + "ml_flow_tracking_uri": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "workspace_id": {"key": "properties.workspaceId", "type": "str"}, + "description": {"key": "properties.description", "type": "str"}, + "friendly_name": {"key": "properties.friendlyName", "type": "str"}, + "key_vault": {"key": "properties.keyVault", "type": "str"}, + "application_insights": { + "key": "properties.applicationInsights", + "type": "str", + }, + "container_registry": { + "key": "properties.containerRegistry", + "type": "str", + }, + "storage_account": {"key": "properties.storageAccount", "type": "str"}, + "discovery_url": {"key": "properties.discoveryUrl", "type": "str"}, + "provisioning_state": { + "key": "properties.provisioningState", + "type": "str", + }, + "encryption": { + "key": "properties.encryption", + "type": "EncryptionProperty", + }, + "hbi_workspace": {"key": "properties.hbiWorkspace", "type": "bool"}, + "service_provisioned_resource_group": { + "key": "properties.serviceProvisionedResourceGroup", + "type": "str", + }, + "private_link_count": { + "key": "properties.privateLinkCount", + "type": "int", + }, + "image_build_compute": { + "key": "properties.imageBuildCompute", + "type": "str", + }, + "allow_public_access_when_behind_vnet": { + "key": "properties.allowPublicAccessWhenBehindVnet", + "type": "bool", + }, + "public_network_access": { + "key": "properties.publicNetworkAccess", + "type": "str", + }, + "private_endpoint_connections": { + "key": "properties.privateEndpointConnections", + "type": "[PrivateEndpointConnection]", + }, + "shared_private_link_resources": { + "key": "properties.sharedPrivateLinkResources", + "type": "[SharedPrivateLinkResource]", + }, + "notebook_info": { + "key": "properties.notebookInfo", + "type": "NotebookResourceInfo", + }, + "service_managed_resources_settings": { + "key": "properties.serviceManagedResourcesSettings", + "type": "ServiceManagedResourcesSettings", + }, + "primary_user_assigned_identity": { + "key": "properties.primaryUserAssignedIdentity", + "type": "str", + }, + "tenant_id": {"key": "properties.tenantId", "type": "str"}, + "storage_hns_enabled": { + "key": "properties.storageHnsEnabled", + "type": "bool", + }, + "ml_flow_tracking_uri": { + "key": "properties.mlFlowTrackingUri", + "type": "str", + }, } def __init__( @@ -15841,9 +16515,15 @@ def __init__( hbi_workspace: Optional[bool] = False, image_build_compute: Optional[str] = None, allow_public_access_when_behind_vnet: Optional[bool] = False, - public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, - shared_private_link_resources: Optional[List["SharedPrivateLinkResource"]] = None, - service_managed_resources_settings: Optional["ServiceManagedResourcesSettings"] = None, + public_network_access: Optional[ + Union[str, "PublicNetworkAccess"] + ] = None, + shared_private_link_resources: Optional[ + List["SharedPrivateLinkResource"] + ] = None, + service_managed_resources_settings: Optional[ + "ServiceManagedResourcesSettings" + ] = None, primary_user_assigned_identity: Optional[str] = None, **kwargs ): @@ -15918,12 +16598,16 @@ def __init__( self.service_provisioned_resource_group = None self.private_link_count = None self.image_build_compute = image_build_compute - self.allow_public_access_when_behind_vnet = allow_public_access_when_behind_vnet + self.allow_public_access_when_behind_vnet = ( + allow_public_access_when_behind_vnet + ) self.public_network_access = public_network_access self.private_endpoint_connections = None self.shared_private_link_resources = shared_private_link_resources self.notebook_info = None - self.service_managed_resources_settings = service_managed_resources_settings + self.service_managed_resources_settings = ( + service_managed_resources_settings + ) self.primary_user_assigned_identity = primary_user_assigned_identity self.tenant_id = None self.storage_hns_enabled = None @@ -15940,8 +16624,8 @@ class WorkspaceConnectionManagedIdentity(msrest.serialization.Model): """ _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, + "resource_id": {"key": "resourceId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, } def __init__( @@ -15970,15 +16654,10 @@ class WorkspaceConnectionPersonalAccessToken(msrest.serialization.Model): """ _attribute_map = { - 'pat': {'key': 'pat', 'type': 'str'}, + "pat": {"key": "pat", "type": "str"}, } - def __init__( - self, - *, - pat: Optional[str] = None, - **kwargs - ): + def __init__(self, *, pat: Optional[str] = None, **kwargs): """ :keyword pat: :paramtype pat: str @@ -16010,37 +16689,41 @@ class WorkspaceConnectionPropertiesV2BasicResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'WorkspaceConnectionPropertiesV2'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "WorkspaceConnectionPropertiesV2", + }, } def __init__( - self, - *, - properties: "WorkspaceConnectionPropertiesV2", - **kwargs + self, *, properties: "WorkspaceConnectionPropertiesV2", **kwargs ): """ :keyword properties: Required. :paramtype properties: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 """ - super(WorkspaceConnectionPropertiesV2BasicResource, self).__init__(**kwargs) + super(WorkspaceConnectionPropertiesV2BasicResource, self).__init__( + **kwargs + ) self.properties = properties -class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(msrest.serialization.Model): +class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult( + msrest.serialization.Model +): """WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult. Variables are only populated by the server, and will be ignored when sending a request. @@ -16053,18 +16736,23 @@ class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(msrest.seri """ _validation = { - 'next_link': {'readonly': True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[WorkspaceConnectionPropertiesV2BasicResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": { + "key": "value", + "type": "[WorkspaceConnectionPropertiesV2BasicResource]", + }, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( self, *, - value: Optional[List["WorkspaceConnectionPropertiesV2BasicResource"]] = None, + value: Optional[ + List["WorkspaceConnectionPropertiesV2BasicResource"] + ] = None, **kwargs ): """ @@ -16072,7 +16760,10 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource] """ - super(WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, self).__init__(**kwargs) + super( + WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, + self, + ).__init__(**kwargs) self.value = value self.next_link = None @@ -16085,20 +16776,17 @@ class WorkspaceConnectionSharedAccessSignature(msrest.serialization.Model): """ _attribute_map = { - 'sas': {'key': 'sas', 'type': 'str'}, + "sas": {"key": "sas", "type": "str"}, } - def __init__( - self, - *, - sas: Optional[str] = None, - **kwargs - ): + def __init__(self, *, sas: Optional[str] = None, **kwargs): """ :keyword sas: :paramtype sas: str """ - super(WorkspaceConnectionSharedAccessSignature, self).__init__(**kwargs) + super(WorkspaceConnectionSharedAccessSignature, self).__init__( + **kwargs + ) self.sas = sas @@ -16112,8 +16800,8 @@ class WorkspaceConnectionUsernamePassword(msrest.serialization.Model): """ _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, + "username": {"key": "username", "type": "str"}, + "password": {"key": "password", "type": "str"}, } def __init__( @@ -16146,8 +16834,8 @@ class WorkspaceListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[Workspace]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Workspace]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( @@ -16202,17 +16890,35 @@ class WorkspaceUpdateParameters(msrest.serialization.Model): """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "description": {"key": "properties.description", "type": "str"}, + "friendly_name": {"key": "properties.friendlyName", "type": "str"}, + "image_build_compute": { + "key": "properties.imageBuildCompute", + "type": "str", + }, + "service_managed_resources_settings": { + "key": "properties.serviceManagedResourcesSettings", + "type": "ServiceManagedResourcesSettings", + }, + "primary_user_assigned_identity": { + "key": "properties.primaryUserAssignedIdentity", + "type": "str", + }, + "public_network_access": { + "key": "properties.publicNetworkAccess", + "type": "str", + }, + "application_insights": { + "key": "properties.applicationInsights", + "type": "str", + }, + "container_registry": { + "key": "properties.containerRegistry", + "type": "str", + }, } def __init__( @@ -16224,9 +16930,13 @@ def __init__( description: Optional[str] = None, friendly_name: Optional[str] = None, image_build_compute: Optional[str] = None, - service_managed_resources_settings: Optional["ServiceManagedResourcesSettings"] = None, + service_managed_resources_settings: Optional[ + "ServiceManagedResourcesSettings" + ] = None, primary_user_assigned_identity: Optional[str] = None, - public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, + public_network_access: Optional[ + Union[str, "PublicNetworkAccess"] + ] = None, application_insights: Optional[str] = None, container_registry: Optional[str] = None, **kwargs @@ -16267,7 +16977,9 @@ def __init__( self.description = description self.friendly_name = friendly_name self.image_build_compute = image_build_compute - self.service_managed_resources_settings = service_managed_resources_settings + self.service_managed_resources_settings = ( + service_managed_resources_settings + ) self.primary_user_assigned_identity = primary_user_assigned_identity self.public_network_access = public_network_access self.application_insights = application_insights diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/__init__.py index 40c788dd392c..2fc4c581441b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/__init__.py @@ -28,36 +28,38 @@ from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations from ._quotas_operations import QuotasOperations from ._compute_operations import ComputeOperations -from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_endpoint_connections_operations import ( + PrivateEndpointConnectionsOperations, +) from ._private_link_resources_operations import PrivateLinkResourcesOperations from ._workspace_connections_operations import WorkspaceConnectionsOperations from ._workspace_features_operations import WorkspaceFeaturesOperations __all__ = [ - 'BatchEndpointsOperations', - 'BatchDeploymentsOperations', - 'CodeContainersOperations', - 'CodeVersionsOperations', - 'ComponentContainersOperations', - 'ComponentVersionsOperations', - 'DataContainersOperations', - 'DataVersionsOperations', - 'DatastoresOperations', - 'EnvironmentContainersOperations', - 'EnvironmentVersionsOperations', - 'JobsOperations', - 'ModelContainersOperations', - 'ModelVersionsOperations', - 'OnlineEndpointsOperations', - 'OnlineDeploymentsOperations', - 'Operations', - 'WorkspacesOperations', - 'UsagesOperations', - 'VirtualMachineSizesOperations', - 'QuotasOperations', - 'ComputeOperations', - 'PrivateEndpointConnectionsOperations', - 'PrivateLinkResourcesOperations', - 'WorkspaceConnectionsOperations', - 'WorkspaceFeaturesOperations', + "BatchEndpointsOperations", + "BatchDeploymentsOperations", + "CodeContainersOperations", + "CodeVersionsOperations", + "ComponentContainersOperations", + "ComponentVersionsOperations", + "DataContainersOperations", + "DataVersionsOperations", + "DatastoresOperations", + "EnvironmentContainersOperations", + "EnvironmentVersionsOperations", + "JobsOperations", + "ModelContainersOperations", + "ModelVersionsOperations", + "OnlineEndpointsOperations", + "OnlineDeploymentsOperations", + "Operations", + "WorkspacesOperations", + "UsagesOperations", + "VirtualMachineSizesOperations", + "QuotasOperations", + "ComputeOperations", + "PrivateEndpointConnectionsOperations", + "PrivateLinkResourcesOperations", + "WorkspaceConnectionsOperations", + "WorkspaceFeaturesOperations", ] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_batch_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_batch_deployments_operations.py index 52e4dc1fb627..b5d038292856 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_batch_deployments_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_batch_deployments_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -25,9 +31,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + Union, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -248,6 +269,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class BatchDeploymentsOperations(object): """BatchDeploymentsOperations operations. @@ -306,14 +328,19 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.BatchDeploymentTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -322,13 +349,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -345,7 +372,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("BatchDeploymentTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "BatchDeploymentTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -354,21 +384,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments"} # type: ignore def _delete_initial( self, @@ -379,43 +417,59 @@ def _delete_initial( **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, deployment_name=deployment_name, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def begin_delete( @@ -451,43 +505,53 @@ def begin_delete( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, deployment_name=deployment_name, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def get( @@ -516,41 +580,55 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.BatchDeploymentData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeploymentData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, deployment_name=deployment_name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchDeploymentData', pipeline_response) + deserialized = self._deserialize( + "BatchDeploymentData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore def _update_initial( self, @@ -562,15 +640,23 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.BatchDeploymentData"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchDeploymentData"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.BatchDeploymentData"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialBatchDeploymentPartialTrackedResource') + _json = self._serialize.body( + body, "PartialBatchDeploymentPartialTrackedResource" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -580,36 +666,53 @@ def _update_initial( deployment_name=deployment_name, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchDeploymentData', pipeline_response) + deserialized = self._deserialize( + "BatchDeploymentData", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def begin_update( @@ -651,14 +754,21 @@ def begin_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchDeploymentData] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentData"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeploymentData"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -667,33 +777,42 @@ def begin_update( deployment_name=deployment_name, body=body, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeploymentData', pipeline_response) + deserialized = self._deserialize( + "BatchDeploymentData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore def _create_or_update_initial( self, @@ -705,15 +824,21 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.BatchDeploymentData" - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeploymentData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'BatchDeploymentData') + _json = self._serialize.body(body, "BatchDeploymentData") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -723,35 +848,53 @@ def _create_or_update_initial( deployment_name=deployment_name, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchDeploymentData', pipeline_response) + deserialized = self._deserialize( + "BatchDeploymentData", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchDeploymentData', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "BatchDeploymentData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -792,14 +935,21 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchDeploymentData] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentData"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeploymentData"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -808,30 +958,39 @@ def begin_create_or_update( deployment_name=deployment_name, body=body, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeploymentData', pipeline_response) + deserialized = self._deserialize( + "BatchDeploymentData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_batch_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_batch_endpoints_operations.py index dc1c088863b7..daef40e6fac2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_batch_endpoints_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_batch_endpoints_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -25,9 +31,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + Union, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -273,6 +294,7 @@ def build_list_keys_request( **kwargs ) + # fmt: on class BatchEndpointsOperations(object): """BatchEndpointsOperations operations. @@ -325,27 +347,32 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.BatchEndpointTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, count=count, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -360,7 +387,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("BatchEndpointTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "BatchEndpointTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -369,21 +399,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints"} # type: ignore def _delete_initial( self, @@ -393,42 +431,58 @@ def _delete_initial( **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace def begin_delete( @@ -461,42 +515,52 @@ def begin_delete( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace def get( @@ -522,40 +586,54 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.BatchEndpointData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchEndpointData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchEndpointData', pipeline_response) + deserialized = self._deserialize( + "BatchEndpointData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore def _update_initial( self, @@ -566,15 +644,23 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.BatchEndpointData"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchEndpointData"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.BatchEndpointData"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialBatchEndpointPartialTrackedResource') + _json = self._serialize.body( + body, "PartialBatchEndpointPartialTrackedResource" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -583,36 +669,53 @@ def _update_initial( endpoint_name=endpoint_name, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchEndpointData', pipeline_response) + deserialized = self._deserialize( + "BatchEndpointData", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace def begin_update( @@ -651,14 +754,21 @@ def begin_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpointData] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointData"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchEndpointData"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -666,33 +776,42 @@ def begin_update( endpoint_name=endpoint_name, body=body, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpointData', pipeline_response) + deserialized = self._deserialize( + "BatchEndpointData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore def _create_or_update_initial( self, @@ -703,15 +822,21 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.BatchEndpointData" - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchEndpointData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'BatchEndpointData') + _json = self._serialize.body(body, "BatchEndpointData") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -720,35 +845,53 @@ def _create_or_update_initial( endpoint_name=endpoint_name, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchEndpointData', pipeline_response) + deserialized = self._deserialize( + "BatchEndpointData", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchEndpointData', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "BatchEndpointData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -786,14 +929,21 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpointData] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointData"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchEndpointData"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -801,33 +951,42 @@ def begin_create_or_update( endpoint_name=endpoint_name, body=body, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpointData', pipeline_response) + deserialized = self._deserialize( + "BatchEndpointData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace def list_keys( @@ -853,37 +1012,49 @@ def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthKeys"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) + deserialized = self._deserialize("EndpointAuthKeys", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys'} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_code_containers_operations.py index 2685804ba921..050d213de89e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_code_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_code_containers_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -23,9 +29,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + Union, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -188,6 +209,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class CodeContainersOperations(object): """CodeContainersOperations operations. @@ -237,26 +259,31 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -270,7 +297,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -279,21 +308,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes"} # type: ignore @distributed_trace def delete( @@ -319,36 +356,46 @@ def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore @distributed_trace def get( @@ -374,40 +421,54 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeContainerData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeContainerData', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "CodeContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore @distributed_trace def create_or_update( @@ -436,15 +497,21 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeContainerData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeContainerData') + _json = self._serialize.body(body, "CodeContainerData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -453,29 +520,42 @@ def create_or_update( name=name, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('CodeContainerData', pipeline_response) + deserialized = self._deserialize( + "CodeContainerData", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('CodeContainerData', pipeline_response) + deserialized = self._deserialize( + "CodeContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_code_versions_operations.py index ba1a85214335..e796b2ea1cd6 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_code_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_code_versions_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -23,9 +29,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + Union, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -202,6 +223,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class CodeVersionsOperations(object): """CodeVersionsOperations operations. @@ -260,14 +282,19 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -276,13 +303,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -299,7 +326,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -308,21 +337,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions"} # type: ignore @distributed_trace def delete( @@ -351,37 +388,47 @@ def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version=version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -410,41 +457,53 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersionData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeVersionData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version=version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('CodeVersionData', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize("CodeVersionData", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace def create_or_update( @@ -476,15 +535,21 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersionData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeVersionData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeVersionData') + _json = self._serialize.body(body, "CodeVersionData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -494,29 +559,42 @@ def create_or_update( version=version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('CodeVersionData', pipeline_response) + deserialized = self._deserialize( + "CodeVersionData", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('CodeVersionData', pipeline_response) + deserialized = self._deserialize( + "CodeVersionData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_component_containers_operations.py index 163029dc4676..0af709cc825b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_component_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_component_containers_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -23,9 +29,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + Union, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -191,6 +212,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class ComponentContainersOperations(object): """ComponentContainersOperations operations. @@ -243,27 +265,32 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -278,7 +305,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -287,21 +317,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components"} # type: ignore @distributed_trace def delete( @@ -327,36 +365,46 @@ def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore @distributed_trace def get( @@ -382,40 +430,54 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainerData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentContainerData', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "ComponentContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore @distributed_trace def create_or_update( @@ -444,15 +506,21 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainerData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentContainerData') + _json = self._serialize.body(body, "ComponentContainerData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -461,29 +529,42 @@ def create_or_update( name=name, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ComponentContainerData', pipeline_response) + deserialized = self._deserialize( + "ComponentContainerData", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ComponentContainerData', pipeline_response) + deserialized = self._deserialize( + "ComponentContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_component_versions_operations.py index c3e7b7aa4dd6..b5b0315b41c7 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_component_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_component_versions_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -23,9 +29,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + Union, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -205,6 +226,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class ComponentVersionsOperations(object): """ComponentVersionsOperations operations. @@ -266,14 +288,19 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -283,13 +310,13 @@ def prepare_request(next_link=None): top=top, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -307,7 +334,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -316,21 +345,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions"} # type: ignore @distributed_trace def delete( @@ -359,37 +396,47 @@ def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version=version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -418,41 +465,55 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersionData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersionData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version=version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentVersionData', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "ComponentVersionData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace def create_or_update( @@ -484,15 +545,21 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersionData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersionData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentVersionData') + _json = self._serialize.body(body, "ComponentVersionData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -502,29 +569,42 @@ def create_or_update( version=version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ComponentVersionData', pipeline_response) + deserialized = self._deserialize( + "ComponentVersionData", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ComponentVersionData', pipeline_response) + deserialized = self._deserialize( + "ComponentVersionData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_compute_operations.py index 36e1c1cb3d4c..af4d379e37d5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_compute_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_compute_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -25,9 +31,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + Union, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -425,6 +446,7 @@ def build_restart_request_initial( **kwargs ) + # fmt: on class ComputeOperations(object): """ComputeOperations operations. @@ -472,26 +494,31 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedComputeResourcesList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedComputeResourcesList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedComputeResourcesList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -505,7 +532,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedComputeResourcesList", pipeline_response) + deserialized = self._deserialize( + "PaginatedComputeResourcesList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -514,21 +543,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes"} # type: ignore @distributed_trace def get( @@ -553,40 +590,52 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComputeResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize("ComputeResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore def _create_or_update_initial( self, @@ -597,15 +646,21 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.ComputeResource" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'ComputeResource') + _json = self._serialize.body(parameters, "ComputeResource") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -614,34 +669,47 @@ def _create_or_update_initial( compute_name=compute_name, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if response.status_code == 201: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComputeResource', pipeline_response) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -679,14 +747,21 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -694,33 +769,42 @@ def begin_create_or_update( compute_name=compute_name, parameters=parameters, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore def _update_initial( self, @@ -731,15 +815,21 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> "_models.ComputeResource" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'ClusterUpdateParameters') + _json = self._serialize.body(parameters, "ClusterUpdateParameters") request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -748,27 +838,34 @@ def _update_initial( compute_name=compute_name, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize("ComputeResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace def begin_update( @@ -805,14 +902,21 @@ def begin_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -820,33 +924,42 @@ def begin_update( compute_name=compute_name, parameters=parameters, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore def _delete_initial( self, @@ -857,42 +970,53 @@ def _delete_initial( **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, underlying_resource_action=underlying_resource_action, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace def begin_delete( @@ -928,43 +1052,53 @@ def begin_delete( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, underlying_resource_action=underlying_resource_action, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace def list_nodes( @@ -990,26 +1124,31 @@ def list_nodes( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.AmlComputeNodesInformation] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlComputeNodesInformation"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.AmlComputeNodesInformation"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_nodes_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, - template_url=self.list_nodes.metadata['url'], + template_url=self.list_nodes.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_nodes_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -1023,7 +1162,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("AmlComputeNodesInformation", pipeline_response) + deserialized = self._deserialize( + "AmlComputeNodesInformation", pipeline_response + ) list_of_elem = deserialized.nodes if cls: list_of_elem = cls(list_of_elem) @@ -1032,21 +1173,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_nodes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes'} # type: ignore + list_nodes.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes"} # type: ignore @distributed_trace def list_keys( @@ -1070,40 +1219,52 @@ def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ComputeSecrets :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeSecrets"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeSecrets"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComputeSecrets', pipeline_response) + deserialized = self._deserialize("ComputeSecrets", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys'} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys"} # type: ignore def _start_initial( self, @@ -1113,35 +1274,43 @@ def _start_initial( **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_start_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, - template_url=self._start_initial.metadata['url'], + template_url=self._start_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start'} # type: ignore - + _start_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore @distributed_trace def begin_start( @@ -1172,42 +1341,52 @@ def begin_start( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._start_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start'} # type: ignore + begin_start.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore def _stop_initial( self, @@ -1217,35 +1396,43 @@ def _stop_initial( **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_stop_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, - template_url=self._stop_initial.metadata['url'], + template_url=self._stop_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop'} # type: ignore - + _stop_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore @distributed_trace def begin_stop( @@ -1276,42 +1463,52 @@ def begin_stop( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._stop_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop'} # type: ignore + begin_stop.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore def _restart_initial( self, @@ -1321,35 +1518,43 @@ def _restart_initial( **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_restart_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, - template_url=self._restart_initial.metadata['url'], + template_url=self._restart_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _restart_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart'} # type: ignore - + _restart_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore @distributed_trace def begin_restart( @@ -1380,39 +1585,49 @@ def begin_restart( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._restart_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart'} # type: ignore + begin_restart.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_data_containers_operations.py index 5d2451915a41..f89d194fd209 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_data_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_data_containers_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -23,9 +29,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + Union, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -191,6 +212,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class DataContainersOperations(object): """DataContainersOperations operations. @@ -243,27 +265,32 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -278,7 +305,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -287,21 +316,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data"} # type: ignore @distributed_trace def delete( @@ -327,36 +364,46 @@ def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore @distributed_trace def get( @@ -382,40 +429,54 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataContainerData', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "DataContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore @distributed_trace def create_or_update( @@ -444,15 +505,21 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DataContainerData') + _json = self._serialize.body(body, "DataContainerData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -461,29 +528,42 @@ def create_or_update( name=name, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('DataContainerData', pipeline_response) + deserialized = self._deserialize( + "DataContainerData", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('DataContainerData', pipeline_response) + deserialized = self._deserialize( + "DataContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_data_versions_operations.py index 622e6a9ca052..f7de3146b0e9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_data_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_data_versions_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -23,9 +29,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + Union, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -208,6 +229,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class DataVersionsOperations(object): """DataVersionsOperations operations. @@ -276,14 +298,19 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -294,13 +321,13 @@ def prepare_request(next_link=None): skip=skip, tags=tags, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -319,7 +346,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataVersionBaseResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -328,21 +357,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions"} # type: ignore @distributed_trace def delete( @@ -371,37 +408,47 @@ def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version=version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -430,41 +477,55 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBaseData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBaseData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version=version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataVersionBaseData', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "DataVersionBaseData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace def create_or_update( @@ -496,15 +557,21 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBaseData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBaseData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DataVersionBaseData') + _json = self._serialize.body(body, "DataVersionBaseData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -514,29 +581,42 @@ def create_or_update( version=version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('DataVersionBaseData', pipeline_response) + deserialized = self._deserialize( + "DataVersionBaseData", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('DataVersionBaseData', pipeline_response) + deserialized = self._deserialize( + "DataVersionBaseData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_datastores_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_datastores_operations.py index ba3ca82b4aac..e935ec3e9a0b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_datastores_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_datastores_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -23,9 +29,25 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, List, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + List, + Optional, + TypeVar, + Union, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -247,6 +269,7 @@ def build_list_secrets_request( **kwargs ) + # fmt: on class DatastoresOperations(object): """DatastoresOperations operations. @@ -314,14 +337,19 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DatastoreResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -333,13 +361,13 @@ def prepare_request(next_link=None): search_text=search_text, order_by=order_by, order_by_asc=order_by_asc, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -359,7 +387,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("DatastoreResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DatastoreResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -368,21 +398,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores"} # type: ignore @distributed_trace def delete( @@ -408,36 +446,46 @@ def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace def get( @@ -463,40 +511,50 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.DatastoreData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreData"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DatastoreData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DatastoreData', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize("DatastoreData", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace def create_or_update( @@ -528,15 +586,19 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.DatastoreData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreData"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DatastoreData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DatastoreData') + _json = self._serialize.body(body, "DatastoreData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -546,32 +608,45 @@ def create_or_update( content_type=content_type, json=_json, skip_validation=skip_validation, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('DatastoreData', pipeline_response) + deserialized = self._deserialize( + "DatastoreData", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('DatastoreData', pipeline_response) + deserialized = self._deserialize( + "DatastoreData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace def list_secrets( @@ -597,37 +672,49 @@ def list_secrets( :rtype: ~azure.mgmt.machinelearningservices.models.DatastoreSecrets :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreSecrets"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DatastoreSecrets"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_secrets_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.list_secrets.metadata['url'], + template_url=self.list_secrets.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DatastoreSecrets', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize("DatastoreSecrets", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets'} # type: ignore - + list_secrets.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_environment_containers_operations.py index 204bce807b5a..aaac9db6c740 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_environment_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_environment_containers_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -23,9 +29,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + Union, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -191,6 +212,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class EnvironmentContainersOperations(object): """EnvironmentContainersOperations operations. @@ -243,27 +265,32 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -278,7 +305,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -287,21 +317,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments"} # type: ignore @distributed_trace def delete( @@ -327,36 +365,46 @@ def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore @distributed_trace def get( @@ -382,40 +430,54 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainerData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentContainerData', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "EnvironmentContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore @distributed_trace def create_or_update( @@ -444,15 +506,21 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainerData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentContainerData') + _json = self._serialize.body(body, "EnvironmentContainerData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -461,29 +529,42 @@ def create_or_update( name=name, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainerData', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainerData", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('EnvironmentContainerData', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_environment_versions_operations.py index 35e876131baa..cc73b6517572 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_environment_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_environment_versions_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -23,9 +29,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + Union, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -205,6 +226,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class EnvironmentVersionsOperations(object): """EnvironmentVersionsOperations operations. @@ -266,14 +288,19 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -283,13 +310,13 @@ def prepare_request(next_link=None): top=top, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -307,7 +334,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersionResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -316,21 +346,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions"} # type: ignore @distributed_trace def delete( @@ -359,37 +397,47 @@ def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version=version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -418,41 +466,55 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersionData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version=version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EnvironmentVersionData', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "EnvironmentVersionData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace def create_or_update( @@ -484,15 +546,21 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersionData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentVersionData') + _json = self._serialize.body(body, "EnvironmentVersionData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -502,29 +570,42 @@ def create_or_update( version=version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersionData', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersionData", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('EnvironmentVersionData', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersionData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_jobs_operations.py index 510b15ac53eb..02fe672b786c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_jobs_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_jobs_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -25,9 +31,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + Union, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -237,6 +258,7 @@ def build_cancel_request_initial( **kwargs ) + # fmt: on class JobsOperations(object): """JobsOperations operations. @@ -295,14 +317,19 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.JobBaseResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -311,13 +338,13 @@ def prepare_request(next_link=None): job_type=job_type, tag=tag, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -334,7 +361,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("JobBaseResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "JobBaseResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -343,21 +372,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs"} # type: ignore def _delete_initial( self, @@ -367,42 +404,58 @@ def _delete_initial( **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}'} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace def begin_delete( @@ -435,42 +488,52 @@ def begin_delete( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}'} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace def get( @@ -496,40 +559,50 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.JobBaseData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBaseData"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.JobBaseData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('JobBaseData', pipeline_response) + deserialized = self._deserialize("JobBaseData", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace def create_or_update( @@ -558,15 +631,19 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.JobBaseData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBaseData"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.JobBaseData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'JobBaseData') + _json = self._serialize.body(body, "JobBaseData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -575,32 +652,41 @@ def create_or_update( id=id, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('JobBaseData', pipeline_response) + deserialized = self._deserialize("JobBaseData", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('JobBaseData', pipeline_response) + deserialized = self._deserialize("JobBaseData", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore def _cancel_initial( self, @@ -610,41 +696,52 @@ def _cancel_initial( **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_cancel_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, - template_url=self._cancel_initial.metadata['url'], + template_url=self._cancel_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _cancel_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel'} # type: ignore - + _cancel_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore @distributed_trace def begin_cancel( @@ -677,39 +774,53 @@ def begin_cancel( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._cancel_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel'} # type: ignore + begin_cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_model_containers_operations.py index 4252fd722f64..f1ff92ccea5c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_model_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_model_containers_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -23,9 +29,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + Union, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -194,6 +215,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class ModelContainersOperations(object): """ModelContainersOperations operations. @@ -249,14 +271,19 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -264,13 +291,13 @@ def prepare_request(next_link=None): skip=skip, count=count, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -286,7 +313,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -295,21 +324,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models"} # type: ignore @distributed_trace def delete( @@ -335,36 +372,46 @@ def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore @distributed_trace def get( @@ -390,40 +437,54 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainerData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelContainerData', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "ModelContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore @distributed_trace def create_or_update( @@ -452,15 +513,21 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainerData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainerData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelContainerData') + _json = self._serialize.body(body, "ModelContainerData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -469,29 +536,42 @@ def create_or_update( name=name, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ModelContainerData', pipeline_response) + deserialized = self._deserialize( + "ModelContainerData", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ModelContainerData', pipeline_response) + deserialized = self._deserialize( + "ModelContainerData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_model_versions_operations.py index 9047e2c14c73..18274b6e8ee4 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_model_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_model_versions_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -23,9 +29,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + Union, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -223,6 +244,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class ModelVersionsOperations(object): """ModelVersionsOperations operations. @@ -304,14 +326,19 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -327,13 +354,13 @@ def prepare_request(next_link=None): properties=properties, feed=feed, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -357,7 +384,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -366,21 +395,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions"} # type: ignore @distributed_trace def delete( @@ -409,37 +446,47 @@ def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version=version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -468,41 +515,53 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersionData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelVersionData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, version=version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ModelVersionData', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize("ModelVersionData", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace def create_or_update( @@ -534,15 +593,21 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersionData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelVersionData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelVersionData') + _json = self._serialize.body(body, "ModelVersionData") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -552,29 +617,42 @@ def create_or_update( version=version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ModelVersionData', pipeline_response) + deserialized = self._deserialize( + "ModelVersionData", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ModelVersionData', pipeline_response) + deserialized = self._deserialize( + "ModelVersionData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_online_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_online_deployments_operations.py index 8398212d7d3b..b343873b96bc 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_online_deployments_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_online_deployments_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -25,9 +31,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + Union, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -339,6 +360,7 @@ def build_list_skus_request( **kwargs ) + # fmt: on class OnlineDeploymentsOperations(object): """OnlineDeploymentsOperations operations. @@ -397,14 +419,19 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.OnlineDeploymentTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -413,13 +440,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -436,7 +463,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineDeploymentTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "OnlineDeploymentTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -445,21 +475,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments"} # type: ignore def _delete_initial( self, @@ -470,43 +508,59 @@ def _delete_initial( **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, deployment_name=deployment_name, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def begin_delete( @@ -542,43 +596,53 @@ def begin_delete( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, deployment_name=deployment_name, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def get( @@ -607,41 +671,55 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.OnlineDeploymentData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeploymentData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, deployment_name=deployment_name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('OnlineDeploymentData', pipeline_response) + deserialized = self._deserialize( + "OnlineDeploymentData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore def _update_initial( self, @@ -653,15 +731,23 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.OnlineDeploymentData"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineDeploymentData"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.OnlineDeploymentData"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialOnlineDeploymentPartialTrackedResource') + _json = self._serialize.body( + body, "PartialOnlineDeploymentPartialTrackedResource" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -671,36 +757,53 @@ def _update_initial( deployment_name=deployment_name, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineDeploymentData', pipeline_response) + deserialized = self._deserialize( + "OnlineDeploymentData", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def begin_update( @@ -742,14 +845,21 @@ def begin_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeploymentData] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentData"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeploymentData"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -758,33 +868,42 @@ def begin_update( deployment_name=deployment_name, body=body, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeploymentData', pipeline_response) + deserialized = self._deserialize( + "OnlineDeploymentData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore def _create_or_update_initial( self, @@ -796,15 +915,21 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.OnlineDeploymentData" - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeploymentData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'OnlineDeploymentData') + _json = self._serialize.body(body, "OnlineDeploymentData") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -814,35 +939,53 @@ def _create_or_update_initial( deployment_name=deployment_name, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineDeploymentData', pipeline_response) + deserialized = self._deserialize( + "OnlineDeploymentData", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineDeploymentData', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "OnlineDeploymentData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -883,14 +1026,21 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeploymentData] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentData"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeploymentData"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -899,33 +1049,42 @@ def begin_create_or_update( deployment_name=deployment_name, body=body, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeploymentData', pipeline_response) + deserialized = self._deserialize( + "OnlineDeploymentData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def get_logs( @@ -957,15 +1116,21 @@ def get_logs( :rtype: ~azure.mgmt.machinelearningservices.models.DeploymentLogs :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentLogs"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DeploymentLogs"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DeploymentLogsRequest') + _json = self._serialize.body(body, "DeploymentLogsRequest") request = build_get_logs_request( subscription_id=self._config.subscription_id, @@ -975,28 +1140,37 @@ def get_logs( deployment_name=deployment_name, content_type=content_type, json=_json, - template_url=self.get_logs.metadata['url'], + template_url=self.get_logs.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DeploymentLogs', pipeline_response) + deserialized = self._deserialize("DeploymentLogs", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_logs.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs'} # type: ignore - + get_logs.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs"} # type: ignore @distributed_trace def list_skus( @@ -1033,14 +1207,19 @@ def list_skus( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.SkuResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.SkuResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_skus_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -1049,13 +1228,13 @@ def prepare_request(next_link=None): deployment_name=deployment_name, count=count, skip=skip, - template_url=self.list_skus.metadata['url'], + template_url=self.list_skus.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_skus_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -1072,7 +1251,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("SkuResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "SkuResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1081,18 +1262,26 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_skus.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus'} # type: ignore + list_skus.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_online_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_online_endpoints_operations.py index d13b2793c993..3579b7da42a8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_online_endpoints_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_online_endpoints_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -25,9 +31,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + Union, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -368,6 +389,7 @@ def build_get_token_request( **kwargs ) + # fmt: on class OnlineEndpointsOperations(object): """OnlineEndpointsOperations operations. @@ -438,14 +460,19 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.OnlineEndpointTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -457,13 +484,13 @@ def prepare_request(next_link=None): tags=tags, properties=properties, order_by=order_by, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -483,7 +510,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineEndpointTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "OnlineEndpointTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -492,21 +522,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints"} # type: ignore def _delete_initial( self, @@ -516,42 +554,58 @@ def _delete_initial( **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace def begin_delete( @@ -584,42 +638,52 @@ def begin_delete( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace def get( @@ -645,40 +709,54 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.OnlineEndpointData :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpointData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('OnlineEndpointData', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpointData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore def _update_initial( self, @@ -689,15 +767,23 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.OnlineEndpointData"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineEndpointData"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.OnlineEndpointData"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialOnlineEndpointPartialTrackedResource') + _json = self._serialize.body( + body, "PartialOnlineEndpointPartialTrackedResource" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -706,36 +792,53 @@ def _update_initial( endpoint_name=endpoint_name, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpointData', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpointData", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace def begin_update( @@ -774,14 +877,21 @@ def begin_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpointData] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointData"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpointData"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -789,33 +899,42 @@ def begin_update( endpoint_name=endpoint_name, body=body, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpointData', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpointData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore def _create_or_update_initial( self, @@ -826,15 +945,21 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.OnlineEndpointData" - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointData"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpointData"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'OnlineEndpointData') + _json = self._serialize.body(body, "OnlineEndpointData") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -843,35 +968,53 @@ def _create_or_update_initial( endpoint_name=endpoint_name, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpointData', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpointData", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineEndpointData', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "OnlineEndpointData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -909,14 +1052,21 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpointData] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointData"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpointData"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -924,33 +1074,42 @@ def begin_create_or_update( endpoint_name=endpoint_name, body=body, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpointData', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpointData", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace def list_keys( @@ -976,40 +1135,52 @@ def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthKeys"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) + deserialized = self._deserialize("EndpointAuthKeys", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys'} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys"} # type: ignore def _regenerate_keys_initial( self, @@ -1020,15 +1191,19 @@ def _regenerate_keys_initial( **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'RegenerateEndpointKeysRequest') + _json = self._serialize.body(body, "RegenerateEndpointKeysRequest") request = build_regenerate_keys_request_initial( subscription_id=self._config.subscription_id, @@ -1037,29 +1212,39 @@ def _regenerate_keys_initial( endpoint_name=endpoint_name, content_type=content_type, json=_json, - template_url=self._regenerate_keys_initial.metadata['url'], + template_url=self._regenerate_keys_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _regenerate_keys_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys'} # type: ignore - + _regenerate_keys_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore @distributed_trace def begin_regenerate_keys( @@ -1095,14 +1280,19 @@ def begin_regenerate_keys( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._regenerate_keys_initial( resource_group_name=resource_group_name, @@ -1110,30 +1300,41 @@ def begin_regenerate_keys( endpoint_name=endpoint_name, body=body, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_regenerate_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys'} # type: ignore + begin_regenerate_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore @distributed_trace def get_token( @@ -1159,37 +1360,51 @@ def get_token( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthToken :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthToken"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthToken"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_token_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, - template_url=self.get_token.metadata['url'], + template_url=self.get_token.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EndpointAuthToken', pipeline_response) + deserialized = self._deserialize( + "EndpointAuthToken", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token'} # type: ignore - + get_token.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_operations.py index a4b5add6f913..932d2c1cf791 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -23,9 +29,23 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -56,6 +76,7 @@ def build_list_request( **kwargs ) + # fmt: on class Operations(object): """Operations operations. @@ -81,8 +102,7 @@ def __init__(self, client, config, serializer, deserializer): @distributed_trace def list( - self, - **kwargs # type: Any + self, **kwargs # type: Any ): # type: (...) -> Iterable["_models.AmlOperationListResult"] """Lists all of the available Azure Machine Learning Workspaces REST API operations. @@ -94,22 +114,27 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.AmlOperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlOperationListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.AmlOperationListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( template_url=next_link, ) @@ -119,7 +144,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("AmlOperationListResult", pipeline_response) + deserialized = self._deserialize( + "AmlOperationListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -128,18 +155,26 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/providers/Microsoft.MachineLearningServices/operations'} # type: ignore + list.metadata = {"url": "/providers/Microsoft.MachineLearningServices/operations"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_private_endpoint_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_private_endpoint_connections_operations.py index 5d3c9c581d9b..263536829ff6 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_private_endpoint_connections_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -23,9 +29,23 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -184,6 +204,7 @@ def build_delete_request( **kwargs ) + # fmt: on class PrivateEndpointConnectionsOperations(object): """PrivateEndpointConnectionsOperations operations. @@ -228,25 +249,30 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnectionListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( resource_group_name=resource_group_name, workspace_name=workspace_name, subscription_id=self._config.subscription_id, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( resource_group_name=resource_group_name, workspace_name=workspace_name, @@ -259,7 +285,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) + deserialized = self._deserialize( + "PrivateEndpointConnectionListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -268,21 +296,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections"} # type: ignore @distributed_trace def get( @@ -307,40 +343,54 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, private_endpoint_connection_name=private_endpoint_connection_name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "PrivateEndpointConnection", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace def create_or_update( @@ -368,15 +418,21 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(properties, 'PrivateEndpointConnection') + _json = self._serialize.body(properties, "PrivateEndpointConnection") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -385,28 +441,39 @@ def create_or_update( private_endpoint_connection_name=private_endpoint_connection_name, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "PrivateEndpointConnection", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace def delete( @@ -431,33 +498,43 @@ def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, private_endpoint_connection_name=private_endpoint_connection_name, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_private_link_resources_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_private_link_resources_operations.py index df526a63a161..57825061da63 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_private_link_resources_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_private_link_resources_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest @@ -23,8 +29,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Generic, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -65,6 +77,7 @@ def build_list_request( **kwargs ) + # fmt: on class PrivateLinkResourcesOperations(object): """PrivateLinkResourcesOperations operations. @@ -107,36 +120,50 @@ def list( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateLinkResourceListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateLinkResourceListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateLinkResourceListResult', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "PrivateLinkResourceListResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources'} # type: ignore - + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_quotas_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_quotas_operations.py index 91e87974a20a..3077ec000231 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_quotas_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_quotas_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -23,9 +29,23 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -102,6 +122,7 @@ def build_list_request( **kwargs ) + # fmt: on class QuotasOperations(object): """QuotasOperations operations. @@ -144,43 +165,60 @@ def update( :rtype: ~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotasResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'QuotaUpdateParameters') + _json = self._serialize.body(parameters, "QuotaUpdateParameters") request = build_update_request( location=location, subscription_id=self._config.subscription_id, content_type=content_type, json=_json, - template_url=self.update.metadata['url'], + template_url=self.update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('UpdateWorkspaceQuotasResult', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "UpdateWorkspaceQuotasResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas'} # type: ignore - + update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas"} # type: ignore @distributed_trace def list( @@ -199,24 +237,29 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListWorkspaceQuotas] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceQuotas"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListWorkspaceQuotas"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, @@ -228,7 +271,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ListWorkspaceQuotas", pipeline_response) + deserialized = self._deserialize( + "ListWorkspaceQuotas", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -237,18 +282,26 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_usages_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_usages_operations.py index dabfb6053d45..e6a8f5057e96 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_usages_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_usages_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -23,9 +29,23 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -64,6 +84,7 @@ def build_list_request( **kwargs ) + # fmt: on class UsagesOperations(object): """UsagesOperations operations. @@ -105,24 +126,29 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListUsagesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListUsagesResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, @@ -134,7 +160,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ListUsagesResult", pipeline_response) + deserialized = self._deserialize( + "ListUsagesResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -143,18 +171,26 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_virtual_machine_sizes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_virtual_machine_sizes_operations.py index 6f9d8d295b5f..4d01fec2bd94 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_virtual_machine_sizes_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest @@ -23,8 +29,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Generic, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -63,6 +75,7 @@ def build_list_request( **kwargs ) + # fmt: on class VirtualMachineSizesOperations(object): """VirtualMachineSizesOperations operations. @@ -102,35 +115,49 @@ def list( :rtype: ~azure.mgmt.machinelearningservices.models.VirtualMachineSizeListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_request( location=location, subscription_id=self._config.subscription_id, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualMachineSizeListResult', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "VirtualMachineSizeListResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes'} # type: ignore - + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_workspace_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_workspace_connections_operations.py index 6fe40a2d108a..9bd4fe62577a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_workspace_connections_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_workspace_connections_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -23,9 +29,23 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -191,6 +211,7 @@ def build_list_request( **kwargs ) + # fmt: on class WorkspaceConnectionsOperations(object): """WorkspaceConnectionsOperations operations. @@ -240,15 +261,23 @@ def create( :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'WorkspaceConnectionPropertiesV2BasicResource') + _json = self._serialize.body( + parameters, "WorkspaceConnectionPropertiesV2BasicResource" + ) request = build_create_request( subscription_id=self._config.subscription_id, @@ -257,28 +286,39 @@ def create( connection_name=connection_name, content_type=content_type, json=_json, - template_url=self.create.metadata['url'], + template_url=self.create.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}'} # type: ignore - + create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace def get( @@ -302,40 +342,54 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, connection_name=connection_name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace def delete( @@ -359,36 +413,46 @@ def delete( :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, connection_name=connection_name, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}'} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace def list( @@ -417,27 +481,32 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, target=target, category=category, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -452,7 +521,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -461,18 +533,26 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_workspace_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_workspace_features_operations.py index 662d483818f9..1cb8aea42a4e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_workspace_features_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_workspace_features_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -23,9 +29,23 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -66,6 +86,7 @@ def build_list_request( **kwargs ) + # fmt: on class WorkspaceFeaturesOperations(object): """WorkspaceFeaturesOperations operations. @@ -110,25 +131,30 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListAmlUserFeatureResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAmlUserFeatureResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListAmlUserFeatureResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -141,7 +167,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ListAmlUserFeatureResult", pipeline_response) + deserialized = self._deserialize( + "ListAmlUserFeatureResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -150,18 +178,26 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features'} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_workspaces_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_workspaces_operations.py index 7033e6a9199f..a4ddd0049897 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_workspaces_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_05_01/operations/_workspaces_operations.py @@ -9,7 +9,13 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -25,9 +31,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + TypeVar, + Union, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -550,6 +571,7 @@ def build_list_outbound_network_dependencies_endpoints_request( **kwargs ) + # fmt: on class WorkspacesOperations(object): """WorkspacesOperations operations. @@ -592,39 +614,49 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.Workspace :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore def _create_or_update_initial( self, @@ -634,15 +666,21 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.Workspace"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.Workspace"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'Workspace') + _json = self._serialize.body(parameters, "Workspace") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -650,29 +688,36 @@ def _create_or_update_initial( workspace_name=workspace_name, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -703,47 +748,59 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Workspace] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, parameters=parameters, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore def _delete_initial( self, @@ -752,34 +809,42 @@ def _delete_initial( **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace def begin_delete( @@ -807,41 +872,51 @@ def begin_delete( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore def _update_initial( self, @@ -851,15 +926,21 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.Workspace"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.Workspace"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'WorkspaceUpdateParameters') + _json = self._serialize.body(parameters, "WorkspaceUpdateParameters") request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -867,29 +948,36 @@ def _update_initial( workspace_name=workspace_name, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace def begin_update( @@ -920,47 +1008,59 @@ def begin_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Workspace] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, parameters=parameters, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace def list_by_resource_group( @@ -982,25 +1082,30 @@ def list_by_resource_group( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_by_resource_group_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, skip=skip, - template_url=self.list_by_resource_group.metadata['url'], + template_url=self.list_by_resource_group.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_by_resource_group_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -1013,7 +1118,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1022,21 +1129,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces'} # type: ignore + list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore def _diagnose_initial( self, @@ -1046,16 +1161,24 @@ def _diagnose_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.DiagnoseResponseResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if parameters is not None: - _json = self._serialize.body(parameters, 'DiagnoseWorkspaceParameters') + _json = self._serialize.body( + parameters, "DiagnoseWorkspaceParameters" + ) else: _json = None @@ -1065,35 +1188,47 @@ def _diagnose_initial( workspace_name=workspace_name, content_type=content_type, json=_json, - template_url=self._diagnose_initial.metadata['url'], + template_url=self._diagnose_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) + deserialized = self._deserialize( + "DiagnoseResponseResult", pipeline_response + ) if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _diagnose_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose'} # type: ignore - + _diagnose_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore @distributed_trace def begin_diagnose( @@ -1128,47 +1263,67 @@ def begin_diagnose( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.DiagnoseResponseResult] :raises: ~azure.core.exceptions.HttpResponseError """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnoseResponseResult"] + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DiagnoseResponseResult"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._diagnose_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, parameters=parameters, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) + deserialized = self._deserialize( + "DiagnoseResponseResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_diagnose.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose'} # type: ignore + begin_diagnose.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore @distributed_trace def list_keys( @@ -1190,39 +1345,53 @@ def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListWorkspaceKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceKeysResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListWorkspaceKeysResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ListWorkspaceKeysResult', pipeline_response) + deserialized = self._deserialize( + "ListWorkspaceKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys'} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys"} # type: ignore def _resync_keys_initial( self, @@ -1231,34 +1400,42 @@ def _resync_keys_initial( **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_resync_keys_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self._resync_keys_initial.metadata['url'], + template_url=self._resync_keys_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _resync_keys_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys'} # type: ignore - + _resync_keys_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore @distributed_trace def begin_resync_keys( @@ -1287,41 +1464,51 @@ def begin_resync_keys( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._resync_keys_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_resync_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys'} # type: ignore + begin_resync_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore @distributed_trace def list_by_subscription( @@ -1340,24 +1527,29 @@ def list_by_subscription( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, skip=skip, - template_url=self.list_by_subscription.metadata['url'], + template_url=self.list_by_subscription.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, skip=skip, @@ -1369,7 +1561,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1378,21 +1572,29 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces'} # type: ignore + list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore @distributed_trace def list_notebook_access_token( @@ -1413,39 +1615,53 @@ def list_notebook_access_token( :rtype: ~azure.mgmt.machinelearningservices.models.NotebookAccessTokenResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookAccessTokenResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.NotebookAccessTokenResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_notebook_access_token_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.list_notebook_access_token.metadata['url'], + template_url=self.list_notebook_access_token.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('NotebookAccessTokenResult', pipeline_response) + deserialized = self._deserialize( + "NotebookAccessTokenResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_notebook_access_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken'} # type: ignore - + list_notebook_access_token.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken"} # type: ignore def _prepare_notebook_initial( self, @@ -1454,40 +1670,52 @@ def _prepare_notebook_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.NotebookResourceInfo"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NotebookResourceInfo"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.NotebookResourceInfo"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_prepare_notebook_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self._prepare_notebook_initial.metadata['url'], + template_url=self._prepare_notebook_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) + deserialized = self._deserialize( + "NotebookResourceInfo", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _prepare_notebook_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook'} # type: ignore - + _prepare_notebook_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore @distributed_trace def begin_prepare_notebook( @@ -1517,44 +1745,62 @@ def begin_prepare_notebook( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.NotebookResourceInfo] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookResourceInfo"] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.NotebookResourceInfo"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._prepare_notebook_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) + deserialized = self._deserialize( + "NotebookResourceInfo", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, + raw_result, + get_long_running_output, + polling_method, + ) - begin_prepare_notebook.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook'} # type: ignore + begin_prepare_notebook.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore @distributed_trace def list_storage_account_keys( @@ -1575,39 +1821,53 @@ def list_storage_account_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListStorageAccountKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListStorageAccountKeysResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListStorageAccountKeysResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_storage_account_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.list_storage_account_keys.metadata['url'], + template_url=self.list_storage_account_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ListStorageAccountKeysResult', pipeline_response) + deserialized = self._deserialize( + "ListStorageAccountKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_storage_account_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys'} # type: ignore - + list_storage_account_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys"} # type: ignore @distributed_trace def list_notebook_keys( @@ -1628,39 +1888,53 @@ def list_notebook_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListNotebookKeysResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListNotebookKeysResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_notebook_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.list_notebook_keys.metadata['url'], + template_url=self.list_notebook_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ListNotebookKeysResult', pipeline_response) + deserialized = self._deserialize( + "ListNotebookKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_notebook_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys'} # type: ignore - + list_notebook_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys"} # type: ignore @distributed_trace def list_outbound_network_dependencies_endpoints( @@ -1685,36 +1959,52 @@ def list_outbound_network_dependencies_endpoints( :rtype: ~azure.mgmt.machinelearningservices.models.ExternalFQDNResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExternalFQDNResponse"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ExternalFQDNResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - request = build_list_outbound_network_dependencies_endpoints_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, - template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], + template_url=self.list_outbound_network_dependencies_endpoints.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ExternalFQDNResponse', pipeline_response) + deserialized = self._deserialize( + "ExternalFQDNResponse", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_outbound_network_dependencies_endpoints.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints'} # type: ignore - + list_outbound_network_dependencies_endpoints.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/__init__.py index da46614477a9..71cf8fdc020d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/__init__.py @@ -10,9 +10,10 @@ from ._version import VERSION __version__ = VERSION -__all__ = ['AzureMachineLearningWorkspaces'] +__all__ = ["AzureMachineLearningWorkspaces"] # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk + patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/_azure_machine_learning_workspaces.py index 3feecd1dd5d7..b5ace3ea8315 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/_azure_machine_learning_workspaces.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/_azure_machine_learning_workspaces.py @@ -15,7 +15,35 @@ from . import models from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import BatchDeploymentsOperations, BatchEndpointsOperations, CodeContainersOperations, CodeVersionsOperations, ComponentContainersOperations, ComponentVersionsOperations, ComputeOperations, DataContainersOperations, DataVersionsOperations, DatastoresOperations, EnvironmentContainersOperations, EnvironmentVersionsOperations, JobsOperations, ModelContainersOperations, ModelVersionsOperations, OnlineDeploymentsOperations, OnlineEndpointsOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, QuotasOperations, SchedulesOperations, UsagesOperations, VirtualMachineSizesOperations, WorkspaceConnectionsOperations, WorkspaceFeaturesOperations, WorkspacesOperations +from .operations import ( + BatchDeploymentsOperations, + BatchEndpointsOperations, + CodeContainersOperations, + CodeVersionsOperations, + ComponentContainersOperations, + ComponentVersionsOperations, + ComputeOperations, + DataContainersOperations, + DataVersionsOperations, + DatastoresOperations, + EnvironmentContainersOperations, + EnvironmentVersionsOperations, + JobsOperations, + ModelContainersOperations, + ModelVersionsOperations, + OnlineDeploymentsOperations, + OnlineEndpointsOperations, + Operations, + PrivateEndpointConnectionsOperations, + PrivateLinkResourcesOperations, + QuotasOperations, + SchedulesOperations, + UsagesOperations, + VirtualMachineSizesOperations, + WorkspaceConnectionsOperations, + WorkspaceFeaturesOperations, + WorkspacesOperations, +) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -24,7 +52,10 @@ from azure.core.credentials import TokenCredential from azure.core.rest import HttpRequest, HttpResponse -class AzureMachineLearningWorkspaces(object): # pylint: disable=too-many-instance-attributes + +class AzureMachineLearningWorkspaces( + object +): # pylint: disable=too-many-instance-attributes """These APIs allow end users to operate on Azure Machine Learning Workspace resources. :ivar batch_endpoints: BatchEndpointsOperations operations @@ -118,41 +149,102 @@ def __init__( **kwargs # type: Any ): # type: (...) -> None - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._config = AzureMachineLearningWorkspacesConfiguration( + credential=credential, subscription_id=subscription_id, **kwargs + ) + self._client = ARMPipelineClient( + base_url=base_url, config=self._config, **kwargs + ) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = { + k: v for k, v in models.__dict__.items() if isinstance(v, type) + } self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.batch_endpoints = BatchEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_deployments = BatchDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_containers = CodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_versions = CodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_containers = ComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_versions = ComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_containers = DataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_versions = DataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.datastores = DatastoresOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_containers = EnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_versions = EnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_containers = ModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_versions = ModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_endpoints = OnlineEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_deployments = OnlineDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.schedules = SchedulesOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.workspaces = WorkspacesOperations(self._client, self._config, self._serialize, self._deserialize) - self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) - self.virtual_machine_sizes = VirtualMachineSizesOperations(self._client, self._config, self._serialize, self._deserialize) - self.quotas = QuotasOperations(self._client, self._config, self._serialize, self._deserialize) - self.compute = ComputeOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_connections = WorkspaceConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_features = WorkspaceFeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - + self.batch_endpoints = BatchEndpointsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.batch_deployments = BatchDeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.code_containers = CodeContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.code_versions = CodeVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.component_containers = ComponentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.component_versions = ComponentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_containers = DataContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_versions = DataVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.datastores = DatastoresOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.environment_containers = EnvironmentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.environment_versions = EnvironmentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.jobs = JobsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.model_containers = ModelContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.model_versions = ModelVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.online_endpoints = OnlineEndpointsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.online_deployments = OnlineDeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.schedules = SchedulesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspaces = WorkspacesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.usages = UsagesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.virtual_machine_sizes = VirtualMachineSizesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.quotas = QuotasOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.compute = ComputeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.private_endpoint_connections = ( + PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspace_connections = WorkspaceConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspace_features = WorkspaceFeaturesOperations( + self._client, self._config, self._serialize, self._deserialize + ) def _send_request( self, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/_configuration.py index 853a27ec7be7..a63577b747a0 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/_configuration.py @@ -10,7 +10,10 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ( + ARMChallengeAuthenticationPolicy, + ARMHttpLoggingPolicy, +) from ._version import VERSION @@ -21,7 +24,9 @@ from azure.core.credentials import TokenCredential -class AzureMachineLearningWorkspacesConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AzureMachineLearningWorkspacesConfiguration( + Configuration +): # pylint: disable=too-many-instance-attributes """Configuration for AzureMachineLearningWorkspaces. Note that all parameters used to create this instance are saved as instance @@ -43,8 +48,10 @@ def __init__( **kwargs # type: Any ): # type: (...) -> None - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + super(AzureMachineLearningWorkspacesConfiguration, self).__init__( + **kwargs + ) + api_version = kwargs.pop("api_version", "2022-10-01") # type: str if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -54,23 +61,44 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = api_version - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) + self.credential_scopes = kwargs.pop( + "credential_scopes", ["https://management.azure.com/.default"] + ) + kwargs.setdefault( + "sdk_moniker", "mgmt-machinelearningservices/{}".format(VERSION) + ) self._configure(**kwargs) def _configure( - self, - **kwargs # type: Any + self, **kwargs # type: Any ): # type: (...) -> None - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') + self.user_agent_policy = kwargs.get( + "user_agent_policy" + ) or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get( + "headers_policy" + ) or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy( + **kwargs + ) + self.logging_policy = kwargs.get( + "logging_policy" + ) or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get( + "http_logging_policy" + ) or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy( + **kwargs + ) + self.custom_hook_policy = kwargs.get( + "custom_hook_policy" + ) or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get( + "redirect_policy" + ) or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = ARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/_patch.py index 74e48ecd07cf..17dbc073e01b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/_patch.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/_patch.py @@ -25,7 +25,8 @@ # # -------------------------------------------------------------------------- + # This file is used for handwritten extensions to the generated code. Example: # https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md def patch_sdk(): - pass \ No newline at end of file + pass diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/_vendor.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/_vendor.py index 138f663c53a4..ed3373e9699d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/_vendor.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/_vendor.py @@ -7,13 +7,20 @@ from azure.core.pipeline.transport import HttpRequest + def _convert_request(request, files=None): data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + request = HttpRequest( + method=request.method, + url=request.url, + headers=request.headers, + data=data, + ) if files: request.set_formdata_body(files) return request + def _format_url_section(template, **kwargs): components = template.split("/") while components: @@ -22,6 +29,8 @@ def _format_url_section(template, **kwargs): except KeyError as key: formatted_components = template.split("/") components = [ - c for c in formatted_components if "{}".format(key.args[0]) not in c + c + for c in formatted_components + if "{}".format(key.args[0]) not in c ] template = "/".join(components) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/__init__.py index f67ccda966f1..b90ec7485f14 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/__init__.py @@ -7,9 +7,11 @@ # -------------------------------------------------------------------------- from ._azure_machine_learning_workspaces import AzureMachineLearningWorkspaces -__all__ = ['AzureMachineLearningWorkspaces'] + +__all__ = ["AzureMachineLearningWorkspaces"] # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk + patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/_azure_machine_learning_workspaces.py index dc532ff16cdd..83263f6047ce 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/_azure_machine_learning_workspaces.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/_azure_machine_learning_workspaces.py @@ -16,13 +16,42 @@ from .. import models from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import BatchDeploymentsOperations, BatchEndpointsOperations, CodeContainersOperations, CodeVersionsOperations, ComponentContainersOperations, ComponentVersionsOperations, ComputeOperations, DataContainersOperations, DataVersionsOperations, DatastoresOperations, EnvironmentContainersOperations, EnvironmentVersionsOperations, JobsOperations, ModelContainersOperations, ModelVersionsOperations, OnlineDeploymentsOperations, OnlineEndpointsOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, QuotasOperations, SchedulesOperations, UsagesOperations, VirtualMachineSizesOperations, WorkspaceConnectionsOperations, WorkspaceFeaturesOperations, WorkspacesOperations +from .operations import ( + BatchDeploymentsOperations, + BatchEndpointsOperations, + CodeContainersOperations, + CodeVersionsOperations, + ComponentContainersOperations, + ComponentVersionsOperations, + ComputeOperations, + DataContainersOperations, + DataVersionsOperations, + DatastoresOperations, + EnvironmentContainersOperations, + EnvironmentVersionsOperations, + JobsOperations, + ModelContainersOperations, + ModelVersionsOperations, + OnlineDeploymentsOperations, + OnlineEndpointsOperations, + Operations, + PrivateEndpointConnectionsOperations, + PrivateLinkResourcesOperations, + QuotasOperations, + SchedulesOperations, + UsagesOperations, + VirtualMachineSizesOperations, + WorkspaceConnectionsOperations, + WorkspaceFeaturesOperations, + WorkspacesOperations, +) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class AzureMachineLearningWorkspaces: # pylint: disable=too-many-instance-attributes + +class AzureMachineLearningWorkspaces: # pylint: disable=too-many-instance-attributes """These APIs allow end users to operate on Azure Machine Learning Workspace resources. :ivar batch_endpoints: BatchEndpointsOperations operations @@ -118,46 +147,105 @@ def __init__( base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._config = AzureMachineLearningWorkspacesConfiguration( + credential=credential, subscription_id=subscription_id, **kwargs + ) + self._client = AsyncARMPipelineClient( + base_url=base_url, config=self._config, **kwargs + ) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = { + k: v for k, v in models.__dict__.items() if isinstance(v, type) + } self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.batch_endpoints = BatchEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_deployments = BatchDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_containers = CodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_versions = CodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_containers = ComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_versions = ComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_containers = DataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_versions = DataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.datastores = DatastoresOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_containers = EnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_versions = EnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_containers = ModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_versions = ModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_endpoints = OnlineEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_deployments = OnlineDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.schedules = SchedulesOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.workspaces = WorkspacesOperations(self._client, self._config, self._serialize, self._deserialize) - self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) - self.virtual_machine_sizes = VirtualMachineSizesOperations(self._client, self._config, self._serialize, self._deserialize) - self.quotas = QuotasOperations(self._client, self._config, self._serialize, self._deserialize) - self.compute = ComputeOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_connections = WorkspaceConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_features = WorkspaceFeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - + self.batch_endpoints = BatchEndpointsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.batch_deployments = BatchDeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.code_containers = CodeContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.code_versions = CodeVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.component_containers = ComponentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.component_versions = ComponentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_containers = DataContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_versions = DataVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.datastores = DatastoresOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.environment_containers = EnvironmentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.environment_versions = EnvironmentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.jobs = JobsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.model_containers = ModelContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.model_versions = ModelVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.online_endpoints = OnlineEndpointsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.online_deployments = OnlineDeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.schedules = SchedulesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspaces = WorkspacesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.usages = UsagesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.virtual_machine_sizes = VirtualMachineSizesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.quotas = QuotasOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.compute = ComputeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.private_endpoint_connections = ( + PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspace_connections = WorkspaceConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspace_features = WorkspaceFeaturesOperations( + self._client, self._config, self._serialize, self._deserialize + ) def _send_request( - self, - request: HttpRequest, - **kwargs: Any + self, request: HttpRequest, **kwargs: Any ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/_configuration.py index aaac6cd461cc..1596f90e8a30 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/_configuration.py @@ -10,7 +10,10 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy +from azure.mgmt.core.policies import ( + ARMHttpLoggingPolicy, + AsyncARMChallengeAuthenticationPolicy, +) from .._version import VERSION @@ -19,7 +22,9 @@ from azure.core.credentials_async import AsyncTokenCredential -class AzureMachineLearningWorkspacesConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AzureMachineLearningWorkspacesConfiguration( + Configuration +): # pylint: disable=too-many-instance-attributes """Configuration for AzureMachineLearningWorkspaces. Note that all parameters used to create this instance are saved as instance @@ -40,8 +45,10 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + super(AzureMachineLearningWorkspacesConfiguration, self).__init__( + **kwargs + ) + api_version = kwargs.pop("api_version", "2022-10-01") # type: str if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -51,22 +58,41 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = api_version - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) + self.credential_scopes = kwargs.pop( + "credential_scopes", ["https://management.azure.com/.default"] + ) + kwargs.setdefault( + "sdk_moniker", "mgmt-machinelearningservices/{}".format(VERSION) + ) self._configure(**kwargs) - def _configure( - self, - **kwargs: Any - ) -> None: - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get( + "user_agent_policy" + ) or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get( + "headers_policy" + ) or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy( + **kwargs + ) + self.logging_policy = kwargs.get( + "logging_policy" + ) or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get( + "http_logging_policy" + ) or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get( + "retry_policy" + ) or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get( + "custom_hook_policy" + ) or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get( + "redirect_policy" + ) or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/_patch.py index 74e48ecd07cf..17dbc073e01b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/_patch.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/_patch.py @@ -25,7 +25,8 @@ # # -------------------------------------------------------------------------- + # This file is used for handwritten extensions to the generated code. Example: # https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md def patch_sdk(): - pass \ No newline at end of file + pass diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/__init__.py index 96b72908a0f1..7f3dc551607f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/__init__.py @@ -29,37 +29,39 @@ from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations from ._quotas_operations import QuotasOperations from ._compute_operations import ComputeOperations -from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_endpoint_connections_operations import ( + PrivateEndpointConnectionsOperations, +) from ._private_link_resources_operations import PrivateLinkResourcesOperations from ._workspace_connections_operations import WorkspaceConnectionsOperations from ._workspace_features_operations import WorkspaceFeaturesOperations __all__ = [ - 'BatchEndpointsOperations', - 'BatchDeploymentsOperations', - 'CodeContainersOperations', - 'CodeVersionsOperations', - 'ComponentContainersOperations', - 'ComponentVersionsOperations', - 'DataContainersOperations', - 'DataVersionsOperations', - 'DatastoresOperations', - 'EnvironmentContainersOperations', - 'EnvironmentVersionsOperations', - 'JobsOperations', - 'ModelContainersOperations', - 'ModelVersionsOperations', - 'OnlineEndpointsOperations', - 'OnlineDeploymentsOperations', - 'SchedulesOperations', - 'Operations', - 'WorkspacesOperations', - 'UsagesOperations', - 'VirtualMachineSizesOperations', - 'QuotasOperations', - 'ComputeOperations', - 'PrivateEndpointConnectionsOperations', - 'PrivateLinkResourcesOperations', - 'WorkspaceConnectionsOperations', - 'WorkspaceFeaturesOperations', + "BatchEndpointsOperations", + "BatchDeploymentsOperations", + "CodeContainersOperations", + "CodeVersionsOperations", + "ComponentContainersOperations", + "ComponentVersionsOperations", + "DataContainersOperations", + "DataVersionsOperations", + "DatastoresOperations", + "EnvironmentContainersOperations", + "EnvironmentVersionsOperations", + "JobsOperations", + "ModelContainersOperations", + "ModelVersionsOperations", + "OnlineEndpointsOperations", + "OnlineDeploymentsOperations", + "SchedulesOperations", + "Operations", + "WorkspacesOperations", + "UsagesOperations", + "VirtualMachineSizesOperations", + "QuotasOperations", + "ComputeOperations", + "PrivateEndpointConnectionsOperations", + "PrivateLinkResourcesOperations", + "WorkspaceConnectionsOperations", + "WorkspaceFeaturesOperations", ] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_batch_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_batch_deployments_operations.py index 0810326055f8..33f0f79ad153 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_batch_deployments_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_batch_deployments_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,22 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._batch_deployments_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._batch_deployments_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class BatchDeploymentsOperations: """BatchDeploymentsOperations async operations. @@ -57,7 +80,9 @@ def list( top: Optional[int] = None, skip: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.BatchDeploymentTrackedResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.BatchDeploymentTrackedResourceArmPaginatedResult" + ]: """Lists Batch inference deployments in the workspace. Lists Batch inference deployments in the workspace. @@ -81,16 +106,21 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.BatchDeploymentTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -100,13 +130,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -124,7 +154,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("BatchDeploymentTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "BatchDeploymentTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -134,24 +167,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -161,15 +198,16 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements deployment_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -177,34 +215,45 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -239,14 +288,17 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -254,29 +306,33 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def get( @@ -304,15 +360,18 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.BatchDeployment :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -320,32 +379,37 @@ async def get( endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize("BatchDeployment", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore async def _update_initial( self, @@ -356,16 +420,25 @@ async def _update_initial( body: "_models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties", **kwargs: Any ) -> Optional["_models.BatchDeployment"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchDeployment"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.BatchDeployment"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties') + _json = self._serialize.body( + body, + "PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties", + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -376,40 +449,53 @@ async def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -450,15 +536,22 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -468,32 +561,38 @@ async def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore async def _create_or_update_initial( self, @@ -504,16 +603,22 @@ async def _create_or_update_initial( body: "_models.BatchDeployment", **kwargs: Any ) -> "_models.BatchDeployment": - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'BatchDeployment') + _json = self._serialize.body(body, "BatchDeployment") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -524,39 +629,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchDeployment', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -596,15 +715,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -614,29 +740,35 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_batch_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_batch_endpoints_operations.py index 6c944b2957ee..7cbaa65764ed 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_batch_endpoints_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_batch_endpoints_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,23 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._batch_endpoints_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_keys_request, build_list_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._batch_endpoints_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_keys_request, + build_list_request, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class BatchEndpointsOperations: """BatchEndpointsOperations async operations. @@ -55,7 +79,9 @@ def list( count: Optional[int] = None, skip: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.BatchEndpointTrackedResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.BatchEndpointTrackedResourceArmPaginatedResult" + ]: """Lists Batch inference endpoint in the workspace. Lists Batch inference endpoint in the workspace. @@ -75,16 +101,21 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.BatchEndpointTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -92,13 +123,13 @@ def prepare_request(next_link=None): api_version=api_version, count=count, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -114,7 +145,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("BatchEndpointTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "BatchEndpointTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -124,24 +158,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -150,49 +188,61 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements endpoint_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -224,43 +274,50 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def get( @@ -285,47 +342,53 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.BatchEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize("BatchEndpoint", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore async def _update_initial( self, @@ -335,16 +398,24 @@ async def _update_initial( body: "_models.PartialMinimalTrackedResourceWithIdentity", **kwargs: Any ) -> Optional["_models.BatchEndpoint"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchEndpoint"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.BatchEndpoint"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') + _json = self._serialize.body( + body, "PartialMinimalTrackedResourceWithIdentity" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -354,40 +425,53 @@ async def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -425,15 +509,20 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -442,32 +531,38 @@ async def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore async def _create_or_update_initial( self, @@ -477,16 +572,20 @@ async def _create_or_update_initial( body: "_models.BatchEndpoint", **kwargs: Any ) -> "_models.BatchEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'BatchEndpoint') + _json = self._serialize.body(body, "BatchEndpoint") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -496,39 +595,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -565,15 +678,20 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -582,32 +700,38 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def list_keys( @@ -632,44 +756,52 @@ async def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthKeys"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) + deserialized = self._deserialize("EndpointAuthKeys", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys"} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_code_containers_operations.py index 9936d55e256b..52024569dda1 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_code_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_code_containers_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._code_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._code_containers_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class CodeContainersOperations: """CodeContainersOperations async operations. @@ -70,29 +88,34 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -107,7 +130,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -117,24 +142,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -159,43 +188,49 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore @distributed_trace_async async def get( @@ -220,47 +255,53 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize("CodeContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -288,16 +329,20 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeContainer') + _json = self._serialize.body(body, "CodeContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -307,33 +352,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_code_versions_operations.py index eb13b0c6d4f1..db22ec7b52a2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_code_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_code_versions_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._code_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._code_versions_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class CodeVersionsOperations: """CodeVersionsOperations async operations. @@ -79,16 +97,21 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -98,13 +121,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -122,7 +145,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -132,24 +157,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -177,15 +206,16 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -193,28 +223,33 @@ async def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -242,15 +277,16 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -258,32 +294,37 @@ async def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -314,16 +355,20 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeVersion') + _json = self._serialize.body(body, "CodeVersion") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -334,33 +379,38 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_component_containers_operations.py index d685edaf19ae..4a030c9ce00b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_component_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_component_containers_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._component_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._component_containers_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ComponentContainersOperations: """ComponentContainersOperations async operations. @@ -73,16 +91,21 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -90,13 +113,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -112,7 +135,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -122,24 +148,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -164,43 +194,49 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore @distributed_trace_async async def get( @@ -225,47 +261,57 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -293,16 +339,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentContainer') + _json = self._serialize.body(body, "ComponentContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -312,33 +364,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_component_versions_operations.py index 488b2f9b26b7..0b6c3345410d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_component_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_component_versions_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._component_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._component_versions_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ComponentVersionsOperations: """ComponentVersionsOperations async operations. @@ -82,16 +100,21 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -102,13 +125,13 @@ def prepare_request(next_link=None): top=top, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -127,7 +150,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -137,24 +162,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -182,15 +211,16 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -198,28 +228,33 @@ async def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -247,15 +282,18 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -263,32 +301,37 @@ async def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize("ComponentVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -319,16 +362,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentVersion') + _json = self._serialize.body(body, "ComponentVersion") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -339,33 +388,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_compute_operations.py index 450657b6ab7d..5372a104b6ad 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_compute_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_compute_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,27 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._compute_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_keys_request, build_list_nodes_request, build_list_request, build_restart_request_initial, build_start_request_initial, build_stop_request_initial, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._compute_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_keys_request, + build_list_nodes_request, + build_list_request, + build_restart_request_initial, + build_start_request_initial, + build_stop_request_initial, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ComputeOperations: """ComputeOperations async operations. @@ -70,29 +98,34 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedComputeResourcesList] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedComputeResourcesList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedComputeResourcesList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -107,7 +140,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedComputeResourcesList", pipeline_response) + deserialized = self._deserialize( + "PaginatedComputeResourcesList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -117,24 +152,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes"} # type: ignore @distributed_trace_async async def get( @@ -158,47 +197,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComputeResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize("ComputeResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore async def _create_or_update_initial( self, @@ -208,16 +255,22 @@ async def _create_or_update_initial( parameters: "_models.ComputeResource", **kwargs: Any ) -> "_models.ComputeResource": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'ComputeResource') + _json = self._serialize.body(parameters, "ComputeResource") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -227,38 +280,47 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if response.status_code == 201: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComputeResource', pipeline_response) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -295,15 +357,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -312,32 +381,38 @@ async def begin_create_or_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore async def _update_initial( self, @@ -347,16 +422,22 @@ async def _update_initial( parameters: "_models.ClusterUpdateParameters", **kwargs: Any ) -> "_models.ComputeResource": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'ClusterUpdateParameters') + _json = self._serialize.body(parameters, "ClusterUpdateParameters") request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -366,31 +447,34 @@ async def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize("ComputeResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -426,15 +510,22 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -443,50 +534,59 @@ async def begin_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, compute_name: str, - underlying_resource_action: Union[str, "_models.UnderlyingResourceAction"], + underlying_resource_action: Union[ + str, "_models.UnderlyingResourceAction" + ], **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -494,33 +594,39 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements compute_name=compute_name, api_version=api_version, underlying_resource_action=underlying_resource_action, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -528,7 +634,9 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements resource_group_name: str, workspace_name: str, compute_name: str, - underlying_resource_action: Union[str, "_models.UnderlyingResourceAction"], + underlying_resource_action: Union[ + str, "_models.UnderlyingResourceAction" + ], **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes specified Machine Learning compute. @@ -555,14 +663,17 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -570,29 +681,33 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements compute_name=compute_name, underlying_resource_action=underlying_resource_action, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace def list_nodes( @@ -617,29 +732,34 @@ def list_nodes( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.AmlComputeNodesInformation] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlComputeNodesInformation"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.AmlComputeNodesInformation"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_nodes_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self.list_nodes.metadata['url'], + template_url=self.list_nodes.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_nodes_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -654,7 +774,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("AmlComputeNodesInformation", pipeline_response) + deserialized = self._deserialize( + "AmlComputeNodesInformation", pipeline_response + ) list_of_elem = deserialized.nodes if cls: list_of_elem = cls(list_of_elem) @@ -664,24 +786,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_nodes.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes"} # type: ignore + list_nodes.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes"} # type: ignore @distributed_trace_async async def list_keys( @@ -704,47 +830,55 @@ async def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ComputeSecrets :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeSecrets"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeSecrets"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComputeSecrets', pipeline_response) + deserialized = self._deserialize("ComputeSecrets", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys"} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys"} # type: ignore async def _start_initial( # pylint: disable=inconsistent-return-statements self, @@ -753,42 +887,46 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements compute_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_start_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self._start_initial.metadata['url'], + template_url=self._start_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _start_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore - + _start_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore @distributed_trace_async async def begin_start( # pylint: disable=inconsistent-return-statements @@ -818,43 +956,50 @@ async def begin_start( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._start_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_start.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore + begin_start.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore async def _stop_initial( # pylint: disable=inconsistent-return-statements self, @@ -863,42 +1008,46 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements compute_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_stop_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self._stop_initial.metadata['url'], + template_url=self._stop_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _stop_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore - + _stop_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore @distributed_trace_async async def begin_stop( # pylint: disable=inconsistent-return-statements @@ -928,43 +1077,50 @@ async def begin_stop( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._stop_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_stop.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore + begin_stop.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore async def _restart_initial( # pylint: disable=inconsistent-return-statements self, @@ -973,42 +1129,46 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements compute_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_restart_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self._restart_initial.metadata['url'], + template_url=self._restart_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _restart_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore - + _restart_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore @distributed_trace_async async def begin_restart( # pylint: disable=inconsistent-return-statements @@ -1038,40 +1198,47 @@ async def begin_restart( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._restart_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_restart.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore + begin_restart.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_data_containers_operations.py index f28716d9c5a6..3c4b6975b59e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_data_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_data_containers_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._data_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._data_containers_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class DataContainersOperations: """DataContainersOperations async operations. @@ -73,16 +91,21 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -90,13 +113,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -112,7 +135,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -122,24 +147,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -164,43 +193,49 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore @distributed_trace_async async def get( @@ -225,47 +260,53 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize("DataContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -293,16 +334,20 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DataContainer') + _json = self._serialize.body(body, "DataContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -312,33 +357,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_data_versions_operations.py index a231f467725e..d2b499906fb9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_data_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_data_versions_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._data_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._data_versions_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class DataVersionsOperations: """DataVersionsOperations async operations. @@ -89,16 +107,21 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -110,13 +133,13 @@ def prepare_request(next_link=None): skip=skip, tags=tags, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -136,7 +159,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataVersionBaseResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -146,24 +171,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -191,15 +220,16 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -207,28 +237,33 @@ async def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -256,15 +291,18 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -272,32 +310,37 @@ async def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize("DataVersionBase", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -328,16 +371,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DataVersionBase') + _json = self._serialize.body(body, "DataVersionBase") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -348,33 +397,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_datastores_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_datastores_operations.py index 7e539cf1f7fd..fc38e84716c2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_datastores_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_datastores_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, List, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,22 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._datastores_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request, build_list_secrets_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._datastores_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, + build_list_secrets_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class DatastoresOperations: """DatastoresOperations async operations. @@ -88,16 +107,21 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DatastoreResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -110,13 +134,13 @@ def prepare_request(next_link=None): search_text=search_text, order_by=order_by, order_by_asc=order_by_asc, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -137,7 +161,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("DatastoreResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DatastoreResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -147,24 +173,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -189,43 +219,49 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace_async async def get( @@ -250,47 +286,53 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.Datastore :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Datastore"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Datastore"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Datastore', pipeline_response) + deserialized = self._deserialize("Datastore", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -321,16 +363,20 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.Datastore :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Datastore"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Datastore"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'Datastore') + _json = self._serialize.body(body, "Datastore") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -341,36 +387,41 @@ async def create_or_update( content_type=content_type, json=_json, skip_validation=skip_validation, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('Datastore', pipeline_response) + deserialized = self._deserialize("Datastore", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('Datastore', pipeline_response) + deserialized = self._deserialize("Datastore", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace_async async def list_secrets( @@ -395,44 +446,52 @@ async def list_secrets( :rtype: ~azure.mgmt.machinelearningservices.models.DatastoreSecrets :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreSecrets"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DatastoreSecrets"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_list_secrets_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.list_secrets.metadata['url'], + template_url=self.list_secrets.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DatastoreSecrets', pipeline_response) + deserialized = self._deserialize("DatastoreSecrets", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_secrets.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets"} # type: ignore - + list_secrets.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_environment_containers_operations.py index ff98446f8983..78ceb41b2bac 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_environment_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_environment_containers_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._environment_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._environment_containers_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class EnvironmentContainersOperations: """EnvironmentContainersOperations async operations. @@ -53,7 +71,9 @@ def list( skip: Optional[str] = None, list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, **kwargs: Any - ) -> AsyncIterable["_models.EnvironmentContainerResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.EnvironmentContainerResourceArmPaginatedResult" + ]: """List environment containers. List environment containers. @@ -73,16 +93,21 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -90,13 +115,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -112,7 +137,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -122,24 +150,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -164,43 +196,49 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore @distributed_trace_async async def get( @@ -225,47 +263,57 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -293,16 +341,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentContainer') + _json = self._serialize.body(body, "EnvironmentContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -312,33 +366,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_environment_versions_operations.py index 93a89dcc3147..5f5a9b885305 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_environment_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_environment_versions_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._environment_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._environment_versions_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class EnvironmentVersionsOperations: """EnvironmentVersionsOperations async operations. @@ -82,16 +100,21 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -102,13 +125,13 @@ def prepare_request(next_link=None): top=top, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -127,7 +150,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersionResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -137,24 +163,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -182,15 +212,16 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -198,28 +229,33 @@ async def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -247,15 +283,18 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -263,32 +302,39 @@ async def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -319,16 +365,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentVersion') + _json = self._serialize.body(body, "EnvironmentVersion") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -339,33 +391,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_jobs_operations.py index 699989cb7e1c..b2c35f2a39a3 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_jobs_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_jobs_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,22 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._jobs_operations import build_cancel_request_initial, build_create_or_update_request, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._jobs_operations import ( + build_cancel_request_initial, + build_create_or_update_request, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class JobsOperations: """JobsOperations async operations. @@ -81,16 +104,21 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.JobBaseResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -100,13 +128,13 @@ def prepare_request(next_link=None): job_type=job_type, tag=tag, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -124,7 +152,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("JobBaseResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "JobBaseResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -134,24 +164,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -160,49 +194,61 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements id: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -234,43 +280,50 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace_async async def get( @@ -295,47 +348,53 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.JobBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.JobBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('JobBase', pipeline_response) + deserialized = self._deserialize("JobBase", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -363,16 +422,20 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.JobBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.JobBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'JobBase') + _json = self._serialize.body(body, "JobBase") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -382,36 +445,41 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('JobBase', pipeline_response) + deserialized = self._deserialize("JobBase", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('JobBase', pipeline_response) + deserialized = self._deserialize("JobBase", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore async def _cancel_initial( # pylint: disable=inconsistent-return-statements self, @@ -420,48 +488,55 @@ async def _cancel_initial( # pylint: disable=inconsistent-return-statements id: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_cancel_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self._cancel_initial.metadata['url'], + template_url=self._cancel_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _cancel_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore - + _cancel_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore @distributed_trace_async async def begin_cancel( # pylint: disable=inconsistent-return-statements @@ -493,40 +568,51 @@ async def begin_cancel( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._cancel_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_cancel.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore + begin_cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_model_containers_operations.py index 38e3c197dd5c..688e2450bada 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_model_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_model_containers_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._model_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._model_containers_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ModelContainersOperations: """ModelContainersOperations async operations. @@ -76,16 +94,21 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -94,13 +117,13 @@ def prepare_request(next_link=None): skip=skip, count=count, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -117,7 +140,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -127,24 +152,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -169,43 +198,49 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore @distributed_trace_async async def get( @@ -230,47 +265,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize("ModelContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -298,16 +341,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelContainer') + _json = self._serialize.body(body, "ModelContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -317,33 +366,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_model_versions_operations.py index 5b2084f2229c..8388c263010d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_model_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_model_versions_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._model_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._model_versions_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ModelVersionsOperations: """ModelVersionsOperations async operations. @@ -102,16 +120,21 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -128,13 +151,13 @@ def prepare_request(next_link=None): properties=properties, feed=feed, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -159,7 +182,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -169,24 +194,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -214,15 +243,16 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -230,28 +260,33 @@ async def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -279,15 +314,16 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -295,32 +331,37 @@ async def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -351,16 +392,20 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelVersion') + _json = self._serialize.body(body, "ModelVersion") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -371,33 +416,38 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_online_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_online_deployments_operations.py index 96e908552f5f..00f962b8820c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_online_deployments_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_online_deployments_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,24 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._online_deployments_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_logs_request, build_get_request, build_list_request, build_list_skus_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._online_deployments_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_logs_request, + build_get_request, + build_list_request, + build_list_skus_request, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class OnlineDeploymentsOperations: """OnlineDeploymentsOperations async operations. @@ -57,7 +82,9 @@ def list( top: Optional[int] = None, skip: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.OnlineDeploymentTrackedResourceArmPaginatedResult" + ]: """List Inference Endpoint Deployments. List Inference Endpoint Deployments. @@ -81,16 +108,21 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OnlineDeploymentTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -100,13 +132,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -124,7 +156,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineDeploymentTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "OnlineDeploymentTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -134,24 +169,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -161,15 +200,16 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements deployment_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -177,34 +217,45 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -239,14 +290,17 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -254,29 +308,33 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def get( @@ -304,15 +362,18 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.OnlineDeployment :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -320,32 +381,37 @@ async def get( endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize("OnlineDeployment", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore async def _update_initial( self, @@ -356,16 +422,24 @@ async def _update_initial( body: "_models.PartialMinimalTrackedResourceWithSku", **kwargs: Any ) -> Optional["_models.OnlineDeployment"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineDeployment"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.OnlineDeployment"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSku') + _json = self._serialize.body( + body, "PartialMinimalTrackedResourceWithSku" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -376,40 +450,53 @@ async def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -449,15 +536,22 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -467,32 +561,38 @@ async def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore async def _create_or_update_initial( self, @@ -503,16 +603,22 @@ async def _create_or_update_initial( body: "_models.OnlineDeployment", **kwargs: Any ) -> "_models.OnlineDeployment": - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'OnlineDeployment') + _json = self._serialize.body(body, "OnlineDeployment") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -523,39 +629,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -595,15 +715,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -613,32 +740,38 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def get_logs( @@ -669,16 +802,22 @@ async def get_logs( :rtype: ~azure.mgmt.machinelearningservices.models.DeploymentLogs :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentLogs"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DeploymentLogs"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DeploymentLogsRequest') + _json = self._serialize.body(body, "DeploymentLogsRequest") request = build_get_logs_request( subscription_id=self._config.subscription_id, @@ -689,32 +828,37 @@ async def get_logs( api_version=api_version, content_type=content_type, json=_json, - template_url=self.get_logs.metadata['url'], + template_url=self.get_logs.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DeploymentLogs', pipeline_response) + deserialized = self._deserialize("DeploymentLogs", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_logs.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs"} # type: ignore - + get_logs.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs"} # type: ignore @distributed_trace def list_skus( @@ -750,16 +894,21 @@ def list_skus( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.SkuResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.SkuResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_skus_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -769,13 +918,13 @@ def prepare_request(next_link=None): api_version=api_version, count=count, skip=skip, - template_url=self.list_skus.metadata['url'], + template_url=self.list_skus.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_skus_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -793,7 +942,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("SkuResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "SkuResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -803,21 +954,25 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_skus.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus"} # type: ignore + list_skus.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_online_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_online_endpoints_operations.py index d63f3eba900e..8429b7434748 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_online_endpoints_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_online_endpoints_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,25 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._online_endpoints_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_get_token_request, build_list_keys_request, build_list_request, build_regenerate_keys_request_initial, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._online_endpoints_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_get_token_request, + build_list_keys_request, + build_list_request, + build_regenerate_keys_request_initial, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class OnlineEndpointsOperations: """OnlineEndpointsOperations async operations. @@ -54,13 +80,17 @@ def list( workspace_name: str, name: Optional[str] = None, count: Optional[int] = None, - compute_type: Optional[Union[str, "_models.EndpointComputeType"]] = None, + compute_type: Optional[ + Union[str, "_models.EndpointComputeType"] + ] = None, skip: Optional[str] = None, tags: Optional[str] = None, properties: Optional[str] = None, order_by: Optional[Union[str, "_models.OrderString"]] = None, **kwargs: Any - ) -> AsyncIterable["_models.OnlineEndpointTrackedResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.OnlineEndpointTrackedResourceArmPaginatedResult" + ]: """List Online Endpoints. List Online Endpoints. @@ -93,16 +123,21 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OnlineEndpointTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -115,13 +150,13 @@ def prepare_request(next_link=None): tags=tags, properties=properties, order_by=order_by, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -142,7 +177,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineEndpointTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "OnlineEndpointTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -152,24 +190,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -178,49 +220,61 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements endpoint_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -252,43 +306,50 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def get( @@ -313,47 +374,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.OnlineEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize("OnlineEndpoint", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore async def _update_initial( self, @@ -363,16 +432,24 @@ async def _update_initial( body: "_models.PartialMinimalTrackedResourceWithIdentity", **kwargs: Any ) -> Optional["_models.OnlineEndpoint"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineEndpoint"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.OnlineEndpoint"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') + _json = self._serialize.body( + body, "PartialMinimalTrackedResourceWithIdentity" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -382,40 +459,53 @@ async def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -453,15 +543,22 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -470,32 +567,38 @@ async def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore async def _create_or_update_initial( self, @@ -505,16 +608,22 @@ async def _create_or_update_initial( body: "_models.OnlineEndpoint", **kwargs: Any ) -> "_models.OnlineEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'OnlineEndpoint') + _json = self._serialize.body(body, "OnlineEndpoint") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -524,39 +633,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -593,15 +716,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -610,32 +740,38 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def list_keys( @@ -660,47 +796,55 @@ async def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthKeys"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) + deserialized = self._deserialize("EndpointAuthKeys", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys"} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys"} # type: ignore async def _regenerate_keys_initial( # pylint: disable=inconsistent-return-statements self, @@ -710,16 +854,20 @@ async def _regenerate_keys_initial( # pylint: disable=inconsistent-return-state body: "_models.RegenerateEndpointKeysRequest", **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'RegenerateEndpointKeysRequest') + _json = self._serialize.body(body, "RegenerateEndpointKeysRequest") request = build_regenerate_keys_request_initial( subscription_id=self._config.subscription_id, @@ -729,33 +877,39 @@ async def _regenerate_keys_initial( # pylint: disable=inconsistent-return-state api_version=api_version, content_type=content_type, json=_json, - template_url=self._regenerate_keys_initial.metadata['url'], + template_url=self._regenerate_keys_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _regenerate_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore - + _regenerate_keys_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore @distributed_trace_async async def begin_regenerate_keys( # pylint: disable=inconsistent-return-statements @@ -790,15 +944,20 @@ async def begin_regenerate_keys( # pylint: disable=inconsistent-return-statemen :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._regenerate_keys_initial( resource_group_name=resource_group_name, @@ -807,29 +966,37 @@ async def begin_regenerate_keys( # pylint: disable=inconsistent-return-statemen body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_regenerate_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore + begin_regenerate_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore @distributed_trace_async async def get_token( @@ -854,44 +1021,54 @@ async def get_token( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthToken :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthToken"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthToken"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_get_token_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.get_token.metadata['url'], + template_url=self.get_token.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EndpointAuthToken', pipeline_response) + deserialized = self._deserialize( + "EndpointAuthToken", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token"} # type: ignore - + get_token.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_operations.py index fa5ac123f6ca..0a2088c0f69f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,8 +25,15 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class Operations: """Operations async operations. @@ -46,8 +59,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list( - self, - **kwargs: Any + self, **kwargs: Any ) -> AsyncIterable["_models.AmlOperationListResult"]: """Lists all of the available Azure Machine Learning Workspaces REST API operations. @@ -58,25 +70,30 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.AmlOperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlOperationListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.AmlOperationListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( api_version=api_version, template_url=next_link, @@ -87,7 +104,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("AmlOperationListResult", pipeline_response) + deserialized = self._deserialize( + "AmlOperationListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -97,21 +116,25 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/providers/Microsoft.MachineLearningServices/operations"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.MachineLearningServices/operations"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_private_endpoint_connections_operations.py index ef722839d084..ca8041d77bc4 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_private_endpoint_connections_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._private_endpoint_connections_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._private_endpoint_connections_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class PrivateEndpointConnectionsOperations: """PrivateEndpointConnectionsOperations async operations. @@ -47,10 +65,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> AsyncIterable["_models.PrivateEndpointConnectionListResult"]: """List all the private endpoint connections associated with the workspace. @@ -65,28 +80,33 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnectionListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( resource_group_name=resource_group_name, workspace_name=workspace_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( resource_group_name=resource_group_name, workspace_name=workspace_name, @@ -100,7 +120,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) + deserialized = self._deserialize( + "PrivateEndpointConnectionListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -110,24 +132,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections"} # type: ignore @distributed_trace_async async def get( @@ -151,47 +177,57 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, private_endpoint_connection_name=private_endpoint_connection_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + deserialized = self._deserialize( + "PrivateEndpointConnection", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -218,16 +254,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(properties, 'PrivateEndpointConnection') + _json = self._serialize.body(properties, "PrivateEndpointConnection") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -237,32 +279,39 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + deserialized = self._deserialize( + "PrivateEndpointConnection", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -286,40 +335,46 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, private_endpoint_connection_name=private_endpoint_connection_name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_private_link_resources_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_private_link_resources_operations.py index 2764e32b4a3f..2f1334f2b65f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_private_link_resources_operations.py @@ -8,7 +8,13 @@ # -------------------------------------------------------------------------- from typing import Any, Callable, Dict, Optional, TypeVar -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -18,8 +24,15 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class PrivateLinkResourcesOperations: """PrivateLinkResourcesOperations async operations. @@ -45,10 +58,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace_async async def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.PrivateLinkResourceListResult": """Gets the private link resources that need to be created for a workspace. @@ -61,43 +71,53 @@ async def list( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateLinkResourceListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateLinkResourceListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateLinkResourceListResult', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "PrivateLinkResourceListResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources"} # type: ignore - + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_quotas_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_quotas_operations.py index 343c09b12660..9421cff7e595 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_quotas_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_quotas_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,19 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._quotas_operations import build_list_request, build_update_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._quotas_operations import ( + build_list_request, + build_update_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class QuotasOperations: """QuotasOperations async operations. @@ -63,16 +79,22 @@ async def update( :rtype: ~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotasResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'QuotaUpdateParameters') + _json = self._serialize.body(parameters, "QuotaUpdateParameters") request = build_update_request( location=location, @@ -80,38 +102,43 @@ async def update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.update.metadata['url'], + template_url=self.update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('UpdateWorkspaceQuotasResult', pipeline_response) + deserialized = self._deserialize( + "UpdateWorkspaceQuotasResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas"} # type: ignore - + update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas"} # type: ignore @distributed_trace def list( - self, - location: str, - **kwargs: Any + self, location: str, **kwargs: Any ) -> AsyncIterable["_models.ListWorkspaceQuotas"]: """Gets the currently assigned Workspace Quotas based on VMFamily. @@ -123,27 +150,32 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListWorkspaceQuotas] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceQuotas"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListWorkspaceQuotas"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, @@ -156,7 +188,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ListWorkspaceQuotas", pipeline_response) + deserialized = self._deserialize( + "ListWorkspaceQuotas", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -166,21 +200,25 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_schedules_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_schedules_operations.py index b22e9282c860..f036d2f8ed62 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_schedules_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_schedules_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._schedules_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._schedules_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class SchedulesOperations: """SchedulesOperations async operations. @@ -53,7 +75,9 @@ def list( resource_group_name: str, workspace_name: str, skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ScheduleListViewType"]] = None, + list_view_type: Optional[ + Union[str, "_models.ScheduleListViewType"] + ] = None, **kwargs: Any ) -> AsyncIterable["_models.ScheduleResourceArmPaginatedResult"]: """List schedules in specified workspace. @@ -75,16 +99,21 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ScheduleResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduleResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ScheduleResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -92,13 +121,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -114,7 +143,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ScheduleResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ScheduleResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -124,24 +155,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -150,49 +185,61 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -224,43 +271,50 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @distributed_trace_async async def get( @@ -285,47 +339,53 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.Schedule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Schedule"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Schedule', pipeline_response) + deserialized = self._deserialize("Schedule", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore async def _create_or_update_initial( self, @@ -335,16 +395,20 @@ async def _create_or_update_initial( body: "_models.Schedule", **kwargs: Any ) -> "_models.Schedule": - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Schedule"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'Schedule') + _json = self._serialize.body(body, "Schedule") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -354,39 +418,49 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('Schedule', pipeline_response) + deserialized = self._deserialize("Schedule", pipeline_response) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('Schedule', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("Schedule", pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -422,15 +496,20 @@ async def begin_create_or_update( :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Schedule] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Schedule"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -439,29 +518,33 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Schedule', pipeline_response) + deserialized = self._deserialize("Schedule", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_usages_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_usages_operations.py index 4df7cfc3c364..73b868e11bbb 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_usages_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_usages_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,8 +25,15 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._usages_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class UsagesOperations: """UsagesOperations async operations. @@ -46,9 +59,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list( - self, - location: str, - **kwargs: Any + self, location: str, **kwargs: Any ) -> AsyncIterable["_models.ListUsagesResult"]: """Gets the current usage information as well as limits for AML resources for given subscription and location. @@ -61,27 +72,32 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListUsagesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListUsagesResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, @@ -94,7 +110,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ListUsagesResult", pipeline_response) + deserialized = self._deserialize( + "ListUsagesResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -104,21 +122,25 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_virtual_machine_sizes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_virtual_machine_sizes_operations.py index d267835e1544..b682ea4d6022 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_virtual_machine_sizes_operations.py @@ -8,7 +8,13 @@ # -------------------------------------------------------------------------- from typing import Any, Callable, Dict, Optional, TypeVar -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -18,8 +24,15 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._virtual_machine_sizes_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class VirtualMachineSizesOperations: """VirtualMachineSizesOperations async operations. @@ -45,9 +58,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace_async async def list( - self, - location: str, - **kwargs: Any + self, location: str, **kwargs: Any ) -> "_models.VirtualMachineSizeListResult": """Returns supported VM Sizes in a location. @@ -58,42 +69,52 @@ async def list( :rtype: ~azure.mgmt.machinelearningservices.models.VirtualMachineSizeListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_list_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualMachineSizeListResult', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "VirtualMachineSizeListResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes"} # type: ignore - + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_workspace_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_workspace_connections_operations.py index 5ac9915ec079..f96267737ad0 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_workspace_connections_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_workspace_connections_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._workspace_connections_operations import build_create_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._workspace_connections_operations import ( + build_create_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class WorkspaceConnectionsOperations: """WorkspaceConnectionsOperations async operations. @@ -70,16 +88,24 @@ async def create( :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'WorkspaceConnectionPropertiesV2BasicResource') + _json = self._serialize.body( + parameters, "WorkspaceConnectionPropertiesV2BasicResource" + ) request = build_create_request( subscription_id=self._config.subscription_id, @@ -89,32 +115,39 @@ async def create( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create.metadata['url'], + template_url=self.create.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - + create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace_async async def get( @@ -137,47 +170,57 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, connection_name=connection_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -200,43 +243,49 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, connection_name=connection_name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace def list( @@ -246,7 +295,9 @@ def list( target: Optional[str] = None, category: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult" + ]: """list. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -264,16 +315,21 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -281,13 +337,13 @@ def prepare_request(next_link=None): api_version=api_version, target=target, category=category, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -303,7 +359,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -313,21 +372,25 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_workspace_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_workspace_features_operations.py index eb45522c236d..d3fba4683981 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_workspace_features_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_workspace_features_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,8 +25,15 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._workspace_features_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class WorkspaceFeaturesOperations: """WorkspaceFeaturesOperations async operations. @@ -46,10 +59,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> AsyncIterable["_models.ListAmlUserFeatureResult"]: """Lists all enabled features for a workspace. @@ -64,28 +74,33 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListAmlUserFeatureResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAmlUserFeatureResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListAmlUserFeatureResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -99,7 +114,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ListAmlUserFeatureResult", pipeline_response) + deserialized = self._deserialize( + "ListAmlUserFeatureResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -109,21 +126,25 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_workspaces_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_workspaces_operations.py index a388db0dbac8..308e884fcac5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_workspaces_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/aio/operations/_workspaces_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,31 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._workspaces_operations import build_create_or_update_request_initial, build_delete_request_initial, build_diagnose_request_initial, build_get_request, build_list_by_resource_group_request, build_list_by_subscription_request, build_list_keys_request, build_list_notebook_access_token_request, build_list_notebook_keys_request, build_list_outbound_network_dependencies_endpoints_request, build_list_storage_account_keys_request, build_prepare_notebook_request_initial, build_resync_keys_request_initial, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._workspaces_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_diagnose_request_initial, + build_get_request, + build_list_by_resource_group_request, + build_list_by_subscription_request, + build_list_keys_request, + build_list_notebook_access_token_request, + build_list_notebook_keys_request, + build_list_outbound_network_dependencies_endpoints_request, + build_list_storage_account_keys_request, + build_prepare_notebook_request_initial, + build_resync_keys_request_initial, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class WorkspacesOperations: """WorkspacesOperations async operations. @@ -49,10 +81,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace_async async def get( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.Workspace": """Gets the properties of the specified machine learning workspace. @@ -65,46 +94,52 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.Workspace :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore async def _create_or_update_initial( self, @@ -113,16 +148,22 @@ async def _create_or_update_initial( parameters: "_models.Workspace", **kwargs: Any ) -> Optional["_models.Workspace"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.Workspace"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'Workspace') + _json = self._serialize.body(parameters, "Workspace") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -131,33 +172,36 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -189,15 +233,20 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Workspace] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -205,81 +254,83 @@ async def begin_create_or_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes a machine learning workspace. @@ -299,42 +350,49 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore async def _update_initial( self, @@ -343,16 +401,22 @@ async def _update_initial( parameters: "_models.WorkspaceUpdateParameters", **kwargs: Any ) -> Optional["_models.Workspace"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.Workspace"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'WorkspaceUpdateParameters') + _json = self._serialize.body(parameters, "WorkspaceUpdateParameters") request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -361,33 +425,36 @@ async def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -419,15 +486,20 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Workspace] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -435,32 +507,36 @@ async def begin_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace def list_by_resource_group( @@ -481,28 +557,33 @@ def list_by_resource_group( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_by_resource_group_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, api_version=api_version, skip=skip, - template_url=self.list_by_resource_group.metadata['url'], + template_url=self.list_by_resource_group.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_by_resource_group_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -516,7 +597,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -526,24 +609,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore + list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore async def _diagnose_initial( self, @@ -552,17 +639,25 @@ async def _diagnose_initial( parameters: Optional["_models.DiagnoseWorkspaceParameters"] = None, **kwargs: Any ) -> Optional["_models.DiagnoseResponseResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if parameters is not None: - _json = self._serialize.body(parameters, 'DiagnoseWorkspaceParameters') + _json = self._serialize.body( + parameters, "DiagnoseWorkspaceParameters" + ) else: _json = None @@ -573,39 +668,47 @@ async def _diagnose_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._diagnose_initial.metadata['url'], + template_url=self._diagnose_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) + deserialized = self._deserialize( + "DiagnoseResponseResult", pipeline_response + ) if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _diagnose_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore - + _diagnose_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore @distributed_trace_async async def begin_diagnose( @@ -639,15 +742,22 @@ async def begin_diagnose( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.DiagnoseResponseResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnoseResponseResult"] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DiagnoseResponseResult"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._diagnose_initial( resource_group_name=resource_group_name, @@ -655,39 +765,46 @@ async def begin_diagnose( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) + deserialized = self._deserialize( + "DiagnoseResponseResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_diagnose.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore + begin_diagnose.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore @distributed_trace_async async def list_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.ListWorkspaceKeysResult": """Lists all the keys associated with this workspace. This includes keys for the storage account, app insights and password for container registry. @@ -701,95 +818,103 @@ async def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListWorkspaceKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceKeysResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListWorkspaceKeysResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ListWorkspaceKeysResult', pipeline_response) + deserialized = self._deserialize( + "ListWorkspaceKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys"} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys"} # type: ignore async def _resync_keys_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_resync_keys_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self._resync_keys_initial.metadata['url'], + template_url=self._resync_keys_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _resync_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore - + _resync_keys_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore @distributed_trace_async async def begin_resync_keys( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: """Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and password for container registry. @@ -810,48 +935,53 @@ async def begin_resync_keys( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._resync_keys_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_resync_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore + begin_resync_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore @distributed_trace def list_by_subscription( - self, - skip: Optional[str] = None, - **kwargs: Any + self, skip: Optional[str] = None, **kwargs: Any ) -> AsyncIterable["_models.WorkspaceListResult"]: """Lists all the available machine learning workspaces under the specified subscription. @@ -863,27 +993,32 @@ def list_by_subscription( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, skip=skip, - template_url=self.list_by_subscription.metadata['url'], + template_url=self.list_by_subscription.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, @@ -896,7 +1031,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -906,31 +1043,32 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore + list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore @distributed_trace_async async def list_notebook_access_token( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.NotebookAccessTokenResult": """return notebook access token and refresh token. @@ -943,101 +1081,113 @@ async def list_notebook_access_token( :rtype: ~azure.mgmt.machinelearningservices.models.NotebookAccessTokenResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookAccessTokenResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.NotebookAccessTokenResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_list_notebook_access_token_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_notebook_access_token.metadata['url'], + template_url=self.list_notebook_access_token.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('NotebookAccessTokenResult', pipeline_response) + deserialized = self._deserialize( + "NotebookAccessTokenResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_notebook_access_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken"} # type: ignore - + list_notebook_access_token.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken"} # type: ignore async def _prepare_notebook_initial( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> Optional["_models.NotebookResourceInfo"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NotebookResourceInfo"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.NotebookResourceInfo"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_prepare_notebook_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self._prepare_notebook_initial.metadata['url'], + template_url=self._prepare_notebook_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) + deserialized = self._deserialize( + "NotebookResourceInfo", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _prepare_notebook_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore - + _prepare_notebook_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore @distributed_trace_async async def begin_prepare_notebook( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> AsyncLROPoller["_models.NotebookResourceInfo"]: """Prepare a notebook. @@ -1059,52 +1209,64 @@ async def begin_prepare_notebook( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.NotebookResourceInfo] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookResourceInfo"] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.NotebookResourceInfo"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._prepare_notebook_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) + deserialized = self._deserialize( + "NotebookResourceInfo", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_prepare_notebook.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore + begin_prepare_notebook.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore @distributed_trace_async async def list_storage_account_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.ListStorageAccountKeysResult": """List storage account keys of a workspace. @@ -1117,53 +1279,60 @@ async def list_storage_account_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListStorageAccountKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListStorageAccountKeysResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListStorageAccountKeysResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_list_storage_account_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_storage_account_keys.metadata['url'], + template_url=self.list_storage_account_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ListStorageAccountKeysResult', pipeline_response) + deserialized = self._deserialize( + "ListStorageAccountKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_storage_account_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys"} # type: ignore - + list_storage_account_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys"} # type: ignore @distributed_trace_async async def list_notebook_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.ListNotebookKeysResult": """List keys of a notebook. @@ -1176,53 +1345,60 @@ async def list_notebook_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListNotebookKeysResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListNotebookKeysResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_list_notebook_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_notebook_keys.metadata['url'], + template_url=self.list_notebook_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ListNotebookKeysResult', pipeline_response) + deserialized = self._deserialize( + "ListNotebookKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_notebook_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys"} # type: ignore - + list_notebook_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys"} # type: ignore @distributed_trace_async async def list_outbound_network_dependencies_endpoints( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.ExternalFQDNResponse": """Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) programmatically. @@ -1239,43 +1415,55 @@ async def list_outbound_network_dependencies_endpoints( :rtype: ~azure.mgmt.machinelearningservices.models.ExternalFQDNResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExternalFQDNResponse"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ExternalFQDNResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_list_outbound_network_dependencies_endpoints_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], + template_url=self.list_outbound_network_dependencies_endpoints.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ExternalFQDNResponse', pipeline_response) + deserialized = self._deserialize( + "ExternalFQDNResponse", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_outbound_network_dependencies_endpoints.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints"} # type: ignore - + list_outbound_network_dependencies_endpoints.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/models/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/models/__init__.py index 02fca55b5ff7..aa13a5dca872 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/models/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/models/__init__.py @@ -218,7 +218,9 @@ from ._models_py3 import MLTableJobInput from ._models_py3 import MLTableJobOutput from ._models_py3 import ManagedIdentity - from ._models_py3 import ManagedIdentityAuthTypeWorkspaceConnectionProperties + from ._models_py3 import ( + ManagedIdentityAuthTypeWorkspaceConnectionProperties, + ) from ._models_py3 import ManagedOnlineDeployment from ._models_py3 import ManagedServiceIdentity from ._models_py3 import MedianStoppingPolicy @@ -252,7 +254,9 @@ from ._models_py3 import PATAuthTypeWorkspaceConnectionProperties from ._models_py3 import PaginatedComputeResourcesList from ._models_py3 import PartialBatchDeployment - from ._models_py3 import PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties + from ._models_py3 import ( + PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, + ) from ._models_py3 import PartialManagedServiceIdentity from ._models_py3 import PartialMinimalTrackedResource from ._models_py3 import PartialMinimalTrackedResourceWithIdentity @@ -347,7 +351,9 @@ from ._models_py3 import UserAccountCredentials from ._models_py3 import UserAssignedIdentity from ._models_py3 import UserIdentity - from ._models_py3 import UsernamePasswordAuthTypeWorkspaceConnectionProperties + from ._models_py3 import ( + UsernamePasswordAuthTypeWorkspaceConnectionProperties, + ) from ._models_py3 import VirtualMachine from ._models_py3 import VirtualMachineImage from ._models_py3 import VirtualMachineSchema @@ -362,7 +368,9 @@ from ._models_py3 import WorkspaceConnectionPersonalAccessToken from ._models_py3 import WorkspaceConnectionPropertiesV2 from ._models_py3 import WorkspaceConnectionPropertiesV2BasicResource - from ._models_py3 import WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult + from ._models_py3 import ( + WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, + ) from ._models_py3 import WorkspaceConnectionSharedAccessSignature from ._models_py3 import WorkspaceConnectionUsernamePassword from ._models_py3 import WorkspaceListResult @@ -849,480 +857,480 @@ ) __all__ = [ - 'AKS', - 'AKSSchema', - 'AKSSchemaProperties', - 'AccountKeyDatastoreCredentials', - 'AccountKeyDatastoreSecrets', - 'AksComputeSecrets', - 'AksComputeSecretsProperties', - 'AksNetworkingConfiguration', - 'AmlCompute', - 'AmlComputeNodeInformation', - 'AmlComputeNodesInformation', - 'AmlComputeProperties', - 'AmlComputeSchema', - 'AmlOperation', - 'AmlOperationDisplay', - 'AmlOperationListResult', - 'AmlToken', - 'AmlUserFeature', - 'AssetBase', - 'AssetContainer', - 'AssetJobInput', - 'AssetJobOutput', - 'AssetReferenceBase', - 'AssignedUser', - 'AutoForecastHorizon', - 'AutoMLJob', - 'AutoMLVertical', - 'AutoNCrossValidations', - 'AutoPauseProperties', - 'AutoScaleProperties', - 'AutoSeasonality', - 'AutoTargetLags', - 'AutoTargetRollingWindowSize', - 'AzureBlobDatastore', - 'AzureDataLakeGen1Datastore', - 'AzureDataLakeGen2Datastore', - 'AzureFileDatastore', - 'BanditPolicy', - 'BatchDeployment', - 'BatchDeploymentProperties', - 'BatchDeploymentTrackedResourceArmPaginatedResult', - 'BatchEndpoint', - 'BatchEndpointDefaults', - 'BatchEndpointProperties', - 'BatchEndpointTrackedResourceArmPaginatedResult', - 'BatchRetrySettings', - 'BayesianSamplingAlgorithm', - 'BuildContext', - 'CertificateDatastoreCredentials', - 'CertificateDatastoreSecrets', - 'Classification', - 'ClassificationTrainingSettings', - 'ClusterUpdateParameters', - 'CodeConfiguration', - 'CodeContainer', - 'CodeContainerProperties', - 'CodeContainerResourceArmPaginatedResult', - 'CodeVersion', - 'CodeVersionProperties', - 'CodeVersionResourceArmPaginatedResult', - 'ColumnTransformer', - 'CommandJob', - 'CommandJobLimits', - 'ComponentContainer', - 'ComponentContainerProperties', - 'ComponentContainerResourceArmPaginatedResult', - 'ComponentVersion', - 'ComponentVersionProperties', - 'ComponentVersionResourceArmPaginatedResult', - 'Compute', - 'ComputeInstance', - 'ComputeInstanceApplication', - 'ComputeInstanceConnectivityEndpoints', - 'ComputeInstanceContainer', - 'ComputeInstanceCreatedBy', - 'ComputeInstanceDataDisk', - 'ComputeInstanceDataMount', - 'ComputeInstanceEnvironmentInfo', - 'ComputeInstanceLastOperation', - 'ComputeInstanceProperties', - 'ComputeInstanceSchema', - 'ComputeInstanceSshSettings', - 'ComputeInstanceVersion', - 'ComputeResource', - 'ComputeResourceSchema', - 'ComputeSchedules', - 'ComputeSecrets', - 'ComputeStartStopSchedule', - 'ContainerResourceRequirements', - 'ContainerResourceSettings', - 'CosmosDbSettings', - 'CronTrigger', - 'CustomForecastHorizon', - 'CustomModelJobInput', - 'CustomModelJobOutput', - 'CustomNCrossValidations', - 'CustomSeasonality', - 'CustomTargetLags', - 'CustomTargetRollingWindowSize', - 'DataContainer', - 'DataContainerProperties', - 'DataContainerResourceArmPaginatedResult', - 'DataFactory', - 'DataLakeAnalytics', - 'DataLakeAnalyticsSchema', - 'DataLakeAnalyticsSchemaProperties', - 'DataPathAssetReference', - 'DataVersionBase', - 'DataVersionBaseProperties', - 'DataVersionBaseResourceArmPaginatedResult', - 'Databricks', - 'DatabricksComputeSecrets', - 'DatabricksComputeSecretsProperties', - 'DatabricksProperties', - 'DatabricksSchema', - 'Datastore', - 'DatastoreCredentials', - 'DatastoreProperties', - 'DatastoreResourceArmPaginatedResult', - 'DatastoreSecrets', - 'DefaultScaleSettings', - 'DeploymentLogs', - 'DeploymentLogsRequest', - 'DeploymentResourceConfiguration', - 'DiagnoseRequestProperties', - 'DiagnoseResponseResult', - 'DiagnoseResponseResultValue', - 'DiagnoseResult', - 'DiagnoseWorkspaceParameters', - 'DistributionConfiguration', - 'EarlyTerminationPolicy', - 'EncryptionKeyVaultProperties', - 'EncryptionProperty', - 'EndpointAuthKeys', - 'EndpointAuthToken', - 'EndpointDeploymentPropertiesBase', - 'EndpointPropertiesBase', - 'EndpointScheduleAction', - 'EnvironmentContainer', - 'EnvironmentContainerProperties', - 'EnvironmentContainerResourceArmPaginatedResult', - 'EnvironmentVersion', - 'EnvironmentVersionProperties', - 'EnvironmentVersionResourceArmPaginatedResult', - 'ErrorAdditionalInfo', - 'ErrorDetail', - 'ErrorResponse', - 'EstimatedVMPrice', - 'EstimatedVMPrices', - 'ExternalFQDNResponse', - 'FQDNEndpoint', - 'FQDNEndpointDetail', - 'FQDNEndpoints', - 'FQDNEndpointsProperties', - 'FeaturizationSettings', - 'FlavorData', - 'ForecastHorizon', - 'Forecasting', - 'ForecastingSettings', - 'ForecastingTrainingSettings', - 'GridSamplingAlgorithm', - 'HDInsight', - 'HDInsightProperties', - 'HDInsightSchema', - 'IdAssetReference', - 'IdentityConfiguration', - 'IdentityForCmk', - 'ImageClassification', - 'ImageClassificationBase', - 'ImageClassificationMultilabel', - 'ImageInstanceSegmentation', - 'ImageLimitSettings', - 'ImageModelDistributionSettings', - 'ImageModelDistributionSettingsClassification', - 'ImageModelDistributionSettingsObjectDetection', - 'ImageModelSettings', - 'ImageModelSettingsClassification', - 'ImageModelSettingsObjectDetection', - 'ImageObjectDetection', - 'ImageObjectDetectionBase', - 'ImageSweepSettings', - 'ImageVertical', - 'InferenceContainerProperties', - 'InstanceTypeSchema', - 'InstanceTypeSchemaResources', - 'JobBase', - 'JobBaseProperties', - 'JobBaseResourceArmPaginatedResult', - 'JobInput', - 'JobLimits', - 'JobOutput', - 'JobResourceConfiguration', - 'JobScheduleAction', - 'JobService', - 'Kubernetes', - 'KubernetesOnlineDeployment', - 'KubernetesProperties', - 'KubernetesSchema', - 'ListAmlUserFeatureResult', - 'ListNotebookKeysResult', - 'ListStorageAccountKeysResult', - 'ListUsagesResult', - 'ListWorkspaceKeysResult', - 'ListWorkspaceQuotas', - 'LiteralJobInput', - 'MLFlowModelJobInput', - 'MLFlowModelJobOutput', - 'MLTableData', - 'MLTableJobInput', - 'MLTableJobOutput', - 'ManagedIdentity', - 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', - 'ManagedOnlineDeployment', - 'ManagedServiceIdentity', - 'MedianStoppingPolicy', - 'ModelContainer', - 'ModelContainerProperties', - 'ModelContainerResourceArmPaginatedResult', - 'ModelVersion', - 'ModelVersionProperties', - 'ModelVersionResourceArmPaginatedResult', - 'Mpi', - 'NCrossValidations', - 'NlpVertical', - 'NlpVerticalFeaturizationSettings', - 'NlpVerticalLimitSettings', - 'NodeStateCounts', - 'NoneAuthTypeWorkspaceConnectionProperties', - 'NoneDatastoreCredentials', - 'NotebookAccessTokenResult', - 'NotebookPreparationError', - 'NotebookResourceInfo', - 'Objective', - 'OnlineDeployment', - 'OnlineDeploymentProperties', - 'OnlineDeploymentTrackedResourceArmPaginatedResult', - 'OnlineEndpoint', - 'OnlineEndpointProperties', - 'OnlineEndpointTrackedResourceArmPaginatedResult', - 'OnlineRequestSettings', - 'OnlineScaleSettings', - 'OutputPathAssetReference', - 'PATAuthTypeWorkspaceConnectionProperties', - 'PaginatedComputeResourcesList', - 'PartialBatchDeployment', - 'PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties', - 'PartialManagedServiceIdentity', - 'PartialMinimalTrackedResource', - 'PartialMinimalTrackedResourceWithIdentity', - 'PartialMinimalTrackedResourceWithSku', - 'PartialSku', - 'Password', - 'PersonalComputeInstanceSettings', - 'PipelineJob', - 'PrivateEndpoint', - 'PrivateEndpointConnection', - 'PrivateEndpointConnectionListResult', - 'PrivateLinkResource', - 'PrivateLinkResourceListResult', - 'PrivateLinkServiceConnectionState', - 'ProbeSettings', - 'PyTorch', - 'QuotaBaseProperties', - 'QuotaUpdateParameters', - 'RandomSamplingAlgorithm', - 'RecurrenceSchedule', - 'RecurrenceTrigger', - 'RegenerateEndpointKeysRequest', - 'RegistryListCredentialsResult', - 'Regression', - 'RegressionTrainingSettings', - 'Resource', - 'ResourceBase', - 'ResourceConfiguration', - 'ResourceId', - 'ResourceName', - 'ResourceQuota', - 'Route', - 'SASAuthTypeWorkspaceConnectionProperties', - 'SamplingAlgorithm', - 'SasDatastoreCredentials', - 'SasDatastoreSecrets', - 'ScaleSettings', - 'ScaleSettingsInformation', - 'Schedule', - 'ScheduleActionBase', - 'ScheduleBase', - 'ScheduleProperties', - 'ScheduleResourceArmPaginatedResult', - 'ScriptReference', - 'ScriptsToExecute', - 'Seasonality', - 'ServiceManagedResourcesSettings', - 'ServicePrincipalDatastoreCredentials', - 'ServicePrincipalDatastoreSecrets', - 'SetupScripts', - 'SharedPrivateLinkResource', - 'Sku', - 'SkuCapacity', - 'SkuResource', - 'SkuResourceArmPaginatedResult', - 'SkuSetting', - 'SslConfiguration', - 'StackEnsembleSettings', - 'SweepJob', - 'SweepJobLimits', - 'SynapseSpark', - 'SynapseSparkProperties', - 'SystemData', - 'SystemService', - 'TableVertical', - 'TableVerticalFeaturizationSettings', - 'TableVerticalLimitSettings', - 'TargetLags', - 'TargetRollingWindowSize', - 'TargetUtilizationScaleSettings', - 'TensorFlow', - 'TextClassification', - 'TextClassificationMultilabel', - 'TextNer', - 'TrackedResource', - 'TrainingSettings', - 'TrialComponent', - 'TriggerBase', - 'TritonModelJobInput', - 'TritonModelJobOutput', - 'TruncationSelectionPolicy', - 'UpdateWorkspaceQuotas', - 'UpdateWorkspaceQuotasResult', - 'UriFileDataVersion', - 'UriFileJobInput', - 'UriFileJobOutput', - 'UriFolderDataVersion', - 'UriFolderJobInput', - 'UriFolderJobOutput', - 'Usage', - 'UsageName', - 'UserAccountCredentials', - 'UserAssignedIdentity', - 'UserIdentity', - 'UsernamePasswordAuthTypeWorkspaceConnectionProperties', - 'VirtualMachine', - 'VirtualMachineImage', - 'VirtualMachineSchema', - 'VirtualMachineSchemaProperties', - 'VirtualMachineSecrets', - 'VirtualMachineSecretsSchema', - 'VirtualMachineSize', - 'VirtualMachineSizeListResult', - 'VirtualMachineSshCredentials', - 'Workspace', - 'WorkspaceConnectionManagedIdentity', - 'WorkspaceConnectionPersonalAccessToken', - 'WorkspaceConnectionPropertiesV2', - 'WorkspaceConnectionPropertiesV2BasicResource', - 'WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult', - 'WorkspaceConnectionSharedAccessSignature', - 'WorkspaceConnectionUsernamePassword', - 'WorkspaceListResult', - 'WorkspaceUpdateParameters', - 'AllocationState', - 'ApplicationSharingPolicy', - 'AutoRebuildSetting', - 'Autosave', - 'BatchLoggingLevel', - 'BatchOutputAction', - 'BillingCurrency', - 'BlockedTransformers', - 'Caching', - 'ClassificationModels', - 'ClassificationMultilabelPrimaryMetrics', - 'ClassificationPrimaryMetrics', - 'ClusterPurpose', - 'ComputeInstanceAuthorizationType', - 'ComputeInstanceState', - 'ComputePowerAction', - 'ComputeType', - 'ConnectionAuthType', - 'ConnectionCategory', - 'ContainerType', - 'CreatedByType', - 'CredentialsType', - 'DataType', - 'DatastoreType', - 'DeploymentProvisioningState', - 'DiagnoseResultLevel', - 'DistributionType', - 'EarlyTerminationPolicyType', - 'EgressPublicNetworkAccessType', - 'EncryptionStatus', - 'EndpointAuthMode', - 'EndpointComputeType', - 'EndpointProvisioningState', - 'EnvironmentType', - 'FeatureLags', - 'FeaturizationMode', - 'ForecastHorizonMode', - 'ForecastingModels', - 'ForecastingPrimaryMetrics', - 'Goal', - 'IdentityConfigurationType', - 'InputDeliveryMode', - 'InstanceSegmentationPrimaryMetrics', - 'JobInputType', - 'JobLimitsType', - 'JobOutputType', - 'JobStatus', - 'JobType', - 'KeyType', - 'LearningRateScheduler', - 'ListViewType', - 'LoadBalancerType', - 'LogVerbosity', - 'ManagedServiceIdentityType', - 'ModelSize', - 'MountAction', - 'MountState', - 'NCrossValidationsMode', - 'Network', - 'NodeState', - 'ObjectDetectionPrimaryMetrics', - 'OperatingSystemType', - 'OperationName', - 'OperationStatus', - 'OperationTrigger', - 'OrderString', - 'OsType', - 'OutputDeliveryMode', - 'PrivateEndpointConnectionProvisioningState', - 'PrivateEndpointServiceConnectionStatus', - 'ProvisioningState', - 'ProvisioningStatus', - 'PublicNetworkAccess', - 'PublicNetworkAccessType', - 'QuotaUnit', - 'RandomSamplingAlgorithmRule', - 'RecurrenceFrequency', - 'ReferenceType', - 'RegressionModels', - 'RegressionPrimaryMetrics', - 'RemoteLoginPortPublicAccess', - 'SamplingAlgorithmType', - 'ScaleType', - 'ScheduleActionType', - 'ScheduleListViewType', - 'ScheduleProvisioningState', - 'ScheduleProvisioningStatus', - 'ScheduleStatus', - 'SeasonalityMode', - 'SecretsType', - 'ServiceDataAccessAuthIdentity', - 'ShortSeriesHandlingConfiguration', - 'SkuScaleType', - 'SkuTier', - 'SourceType', - 'SshPublicAccess', - 'SslConfigStatus', - 'StackMetaLearnerType', - 'Status', - 'StochasticOptimizer', - 'StorageAccountType', - 'TargetAggregationFunction', - 'TargetLagsMode', - 'TargetRollingWindowSizeMode', - 'TaskType', - 'TriggerType', - 'UnderlyingResourceAction', - 'UnitOfMeasure', - 'UsageUnit', - 'UseStl', - 'VMPriceOSType', - 'VMTier', - 'ValidationMetricType', - 'ValueFormat', - 'VmPriority', - 'WeekDay', + "AKS", + "AKSSchema", + "AKSSchemaProperties", + "AccountKeyDatastoreCredentials", + "AccountKeyDatastoreSecrets", + "AksComputeSecrets", + "AksComputeSecretsProperties", + "AksNetworkingConfiguration", + "AmlCompute", + "AmlComputeNodeInformation", + "AmlComputeNodesInformation", + "AmlComputeProperties", + "AmlComputeSchema", + "AmlOperation", + "AmlOperationDisplay", + "AmlOperationListResult", + "AmlToken", + "AmlUserFeature", + "AssetBase", + "AssetContainer", + "AssetJobInput", + "AssetJobOutput", + "AssetReferenceBase", + "AssignedUser", + "AutoForecastHorizon", + "AutoMLJob", + "AutoMLVertical", + "AutoNCrossValidations", + "AutoPauseProperties", + "AutoScaleProperties", + "AutoSeasonality", + "AutoTargetLags", + "AutoTargetRollingWindowSize", + "AzureBlobDatastore", + "AzureDataLakeGen1Datastore", + "AzureDataLakeGen2Datastore", + "AzureFileDatastore", + "BanditPolicy", + "BatchDeployment", + "BatchDeploymentProperties", + "BatchDeploymentTrackedResourceArmPaginatedResult", + "BatchEndpoint", + "BatchEndpointDefaults", + "BatchEndpointProperties", + "BatchEndpointTrackedResourceArmPaginatedResult", + "BatchRetrySettings", + "BayesianSamplingAlgorithm", + "BuildContext", + "CertificateDatastoreCredentials", + "CertificateDatastoreSecrets", + "Classification", + "ClassificationTrainingSettings", + "ClusterUpdateParameters", + "CodeConfiguration", + "CodeContainer", + "CodeContainerProperties", + "CodeContainerResourceArmPaginatedResult", + "CodeVersion", + "CodeVersionProperties", + "CodeVersionResourceArmPaginatedResult", + "ColumnTransformer", + "CommandJob", + "CommandJobLimits", + "ComponentContainer", + "ComponentContainerProperties", + "ComponentContainerResourceArmPaginatedResult", + "ComponentVersion", + "ComponentVersionProperties", + "ComponentVersionResourceArmPaginatedResult", + "Compute", + "ComputeInstance", + "ComputeInstanceApplication", + "ComputeInstanceConnectivityEndpoints", + "ComputeInstanceContainer", + "ComputeInstanceCreatedBy", + "ComputeInstanceDataDisk", + "ComputeInstanceDataMount", + "ComputeInstanceEnvironmentInfo", + "ComputeInstanceLastOperation", + "ComputeInstanceProperties", + "ComputeInstanceSchema", + "ComputeInstanceSshSettings", + "ComputeInstanceVersion", + "ComputeResource", + "ComputeResourceSchema", + "ComputeSchedules", + "ComputeSecrets", + "ComputeStartStopSchedule", + "ContainerResourceRequirements", + "ContainerResourceSettings", + "CosmosDbSettings", + "CronTrigger", + "CustomForecastHorizon", + "CustomModelJobInput", + "CustomModelJobOutput", + "CustomNCrossValidations", + "CustomSeasonality", + "CustomTargetLags", + "CustomTargetRollingWindowSize", + "DataContainer", + "DataContainerProperties", + "DataContainerResourceArmPaginatedResult", + "DataFactory", + "DataLakeAnalytics", + "DataLakeAnalyticsSchema", + "DataLakeAnalyticsSchemaProperties", + "DataPathAssetReference", + "DataVersionBase", + "DataVersionBaseProperties", + "DataVersionBaseResourceArmPaginatedResult", + "Databricks", + "DatabricksComputeSecrets", + "DatabricksComputeSecretsProperties", + "DatabricksProperties", + "DatabricksSchema", + "Datastore", + "DatastoreCredentials", + "DatastoreProperties", + "DatastoreResourceArmPaginatedResult", + "DatastoreSecrets", + "DefaultScaleSettings", + "DeploymentLogs", + "DeploymentLogsRequest", + "DeploymentResourceConfiguration", + "DiagnoseRequestProperties", + "DiagnoseResponseResult", + "DiagnoseResponseResultValue", + "DiagnoseResult", + "DiagnoseWorkspaceParameters", + "DistributionConfiguration", + "EarlyTerminationPolicy", + "EncryptionKeyVaultProperties", + "EncryptionProperty", + "EndpointAuthKeys", + "EndpointAuthToken", + "EndpointDeploymentPropertiesBase", + "EndpointPropertiesBase", + "EndpointScheduleAction", + "EnvironmentContainer", + "EnvironmentContainerProperties", + "EnvironmentContainerResourceArmPaginatedResult", + "EnvironmentVersion", + "EnvironmentVersionProperties", + "EnvironmentVersionResourceArmPaginatedResult", + "ErrorAdditionalInfo", + "ErrorDetail", + "ErrorResponse", + "EstimatedVMPrice", + "EstimatedVMPrices", + "ExternalFQDNResponse", + "FQDNEndpoint", + "FQDNEndpointDetail", + "FQDNEndpoints", + "FQDNEndpointsProperties", + "FeaturizationSettings", + "FlavorData", + "ForecastHorizon", + "Forecasting", + "ForecastingSettings", + "ForecastingTrainingSettings", + "GridSamplingAlgorithm", + "HDInsight", + "HDInsightProperties", + "HDInsightSchema", + "IdAssetReference", + "IdentityConfiguration", + "IdentityForCmk", + "ImageClassification", + "ImageClassificationBase", + "ImageClassificationMultilabel", + "ImageInstanceSegmentation", + "ImageLimitSettings", + "ImageModelDistributionSettings", + "ImageModelDistributionSettingsClassification", + "ImageModelDistributionSettingsObjectDetection", + "ImageModelSettings", + "ImageModelSettingsClassification", + "ImageModelSettingsObjectDetection", + "ImageObjectDetection", + "ImageObjectDetectionBase", + "ImageSweepSettings", + "ImageVertical", + "InferenceContainerProperties", + "InstanceTypeSchema", + "InstanceTypeSchemaResources", + "JobBase", + "JobBaseProperties", + "JobBaseResourceArmPaginatedResult", + "JobInput", + "JobLimits", + "JobOutput", + "JobResourceConfiguration", + "JobScheduleAction", + "JobService", + "Kubernetes", + "KubernetesOnlineDeployment", + "KubernetesProperties", + "KubernetesSchema", + "ListAmlUserFeatureResult", + "ListNotebookKeysResult", + "ListStorageAccountKeysResult", + "ListUsagesResult", + "ListWorkspaceKeysResult", + "ListWorkspaceQuotas", + "LiteralJobInput", + "MLFlowModelJobInput", + "MLFlowModelJobOutput", + "MLTableData", + "MLTableJobInput", + "MLTableJobOutput", + "ManagedIdentity", + "ManagedIdentityAuthTypeWorkspaceConnectionProperties", + "ManagedOnlineDeployment", + "ManagedServiceIdentity", + "MedianStoppingPolicy", + "ModelContainer", + "ModelContainerProperties", + "ModelContainerResourceArmPaginatedResult", + "ModelVersion", + "ModelVersionProperties", + "ModelVersionResourceArmPaginatedResult", + "Mpi", + "NCrossValidations", + "NlpVertical", + "NlpVerticalFeaturizationSettings", + "NlpVerticalLimitSettings", + "NodeStateCounts", + "NoneAuthTypeWorkspaceConnectionProperties", + "NoneDatastoreCredentials", + "NotebookAccessTokenResult", + "NotebookPreparationError", + "NotebookResourceInfo", + "Objective", + "OnlineDeployment", + "OnlineDeploymentProperties", + "OnlineDeploymentTrackedResourceArmPaginatedResult", + "OnlineEndpoint", + "OnlineEndpointProperties", + "OnlineEndpointTrackedResourceArmPaginatedResult", + "OnlineRequestSettings", + "OnlineScaleSettings", + "OutputPathAssetReference", + "PATAuthTypeWorkspaceConnectionProperties", + "PaginatedComputeResourcesList", + "PartialBatchDeployment", + "PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties", + "PartialManagedServiceIdentity", + "PartialMinimalTrackedResource", + "PartialMinimalTrackedResourceWithIdentity", + "PartialMinimalTrackedResourceWithSku", + "PartialSku", + "Password", + "PersonalComputeInstanceSettings", + "PipelineJob", + "PrivateEndpoint", + "PrivateEndpointConnection", + "PrivateEndpointConnectionListResult", + "PrivateLinkResource", + "PrivateLinkResourceListResult", + "PrivateLinkServiceConnectionState", + "ProbeSettings", + "PyTorch", + "QuotaBaseProperties", + "QuotaUpdateParameters", + "RandomSamplingAlgorithm", + "RecurrenceSchedule", + "RecurrenceTrigger", + "RegenerateEndpointKeysRequest", + "RegistryListCredentialsResult", + "Regression", + "RegressionTrainingSettings", + "Resource", + "ResourceBase", + "ResourceConfiguration", + "ResourceId", + "ResourceName", + "ResourceQuota", + "Route", + "SASAuthTypeWorkspaceConnectionProperties", + "SamplingAlgorithm", + "SasDatastoreCredentials", + "SasDatastoreSecrets", + "ScaleSettings", + "ScaleSettingsInformation", + "Schedule", + "ScheduleActionBase", + "ScheduleBase", + "ScheduleProperties", + "ScheduleResourceArmPaginatedResult", + "ScriptReference", + "ScriptsToExecute", + "Seasonality", + "ServiceManagedResourcesSettings", + "ServicePrincipalDatastoreCredentials", + "ServicePrincipalDatastoreSecrets", + "SetupScripts", + "SharedPrivateLinkResource", + "Sku", + "SkuCapacity", + "SkuResource", + "SkuResourceArmPaginatedResult", + "SkuSetting", + "SslConfiguration", + "StackEnsembleSettings", + "SweepJob", + "SweepJobLimits", + "SynapseSpark", + "SynapseSparkProperties", + "SystemData", + "SystemService", + "TableVertical", + "TableVerticalFeaturizationSettings", + "TableVerticalLimitSettings", + "TargetLags", + "TargetRollingWindowSize", + "TargetUtilizationScaleSettings", + "TensorFlow", + "TextClassification", + "TextClassificationMultilabel", + "TextNer", + "TrackedResource", + "TrainingSettings", + "TrialComponent", + "TriggerBase", + "TritonModelJobInput", + "TritonModelJobOutput", + "TruncationSelectionPolicy", + "UpdateWorkspaceQuotas", + "UpdateWorkspaceQuotasResult", + "UriFileDataVersion", + "UriFileJobInput", + "UriFileJobOutput", + "UriFolderDataVersion", + "UriFolderJobInput", + "UriFolderJobOutput", + "Usage", + "UsageName", + "UserAccountCredentials", + "UserAssignedIdentity", + "UserIdentity", + "UsernamePasswordAuthTypeWorkspaceConnectionProperties", + "VirtualMachine", + "VirtualMachineImage", + "VirtualMachineSchema", + "VirtualMachineSchemaProperties", + "VirtualMachineSecrets", + "VirtualMachineSecretsSchema", + "VirtualMachineSize", + "VirtualMachineSizeListResult", + "VirtualMachineSshCredentials", + "Workspace", + "WorkspaceConnectionManagedIdentity", + "WorkspaceConnectionPersonalAccessToken", + "WorkspaceConnectionPropertiesV2", + "WorkspaceConnectionPropertiesV2BasicResource", + "WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", + "WorkspaceConnectionSharedAccessSignature", + "WorkspaceConnectionUsernamePassword", + "WorkspaceListResult", + "WorkspaceUpdateParameters", + "AllocationState", + "ApplicationSharingPolicy", + "AutoRebuildSetting", + "Autosave", + "BatchLoggingLevel", + "BatchOutputAction", + "BillingCurrency", + "BlockedTransformers", + "Caching", + "ClassificationModels", + "ClassificationMultilabelPrimaryMetrics", + "ClassificationPrimaryMetrics", + "ClusterPurpose", + "ComputeInstanceAuthorizationType", + "ComputeInstanceState", + "ComputePowerAction", + "ComputeType", + "ConnectionAuthType", + "ConnectionCategory", + "ContainerType", + "CreatedByType", + "CredentialsType", + "DataType", + "DatastoreType", + "DeploymentProvisioningState", + "DiagnoseResultLevel", + "DistributionType", + "EarlyTerminationPolicyType", + "EgressPublicNetworkAccessType", + "EncryptionStatus", + "EndpointAuthMode", + "EndpointComputeType", + "EndpointProvisioningState", + "EnvironmentType", + "FeatureLags", + "FeaturizationMode", + "ForecastHorizonMode", + "ForecastingModels", + "ForecastingPrimaryMetrics", + "Goal", + "IdentityConfigurationType", + "InputDeliveryMode", + "InstanceSegmentationPrimaryMetrics", + "JobInputType", + "JobLimitsType", + "JobOutputType", + "JobStatus", + "JobType", + "KeyType", + "LearningRateScheduler", + "ListViewType", + "LoadBalancerType", + "LogVerbosity", + "ManagedServiceIdentityType", + "ModelSize", + "MountAction", + "MountState", + "NCrossValidationsMode", + "Network", + "NodeState", + "ObjectDetectionPrimaryMetrics", + "OperatingSystemType", + "OperationName", + "OperationStatus", + "OperationTrigger", + "OrderString", + "OsType", + "OutputDeliveryMode", + "PrivateEndpointConnectionProvisioningState", + "PrivateEndpointServiceConnectionStatus", + "ProvisioningState", + "ProvisioningStatus", + "PublicNetworkAccess", + "PublicNetworkAccessType", + "QuotaUnit", + "RandomSamplingAlgorithmRule", + "RecurrenceFrequency", + "ReferenceType", + "RegressionModels", + "RegressionPrimaryMetrics", + "RemoteLoginPortPublicAccess", + "SamplingAlgorithmType", + "ScaleType", + "ScheduleActionType", + "ScheduleListViewType", + "ScheduleProvisioningState", + "ScheduleProvisioningStatus", + "ScheduleStatus", + "SeasonalityMode", + "SecretsType", + "ServiceDataAccessAuthIdentity", + "ShortSeriesHandlingConfiguration", + "SkuScaleType", + "SkuTier", + "SourceType", + "SshPublicAccess", + "SslConfigStatus", + "StackMetaLearnerType", + "Status", + "StochasticOptimizer", + "StorageAccountType", + "TargetAggregationFunction", + "TargetLagsMode", + "TargetRollingWindowSizeMode", + "TaskType", + "TriggerType", + "UnderlyingResourceAction", + "UnitOfMeasure", + "UsageUnit", + "UseStl", + "VMPriceOSType", + "VMTier", + "ValidationMetricType", + "ValueFormat", + "VmPriority", + "WeekDay", ] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/models/_azure_machine_learning_workspaces_enums.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/models/_azure_machine_learning_workspaces_enums.py index 53ff52db3f35..02ab780bba8b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/models/_azure_machine_learning_workspaces_enums.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/models/_azure_machine_learning_workspaces_enums.py @@ -21,6 +21,7 @@ class AllocationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): STEADY = "Steady" RESIZING = "Resizing" + class ApplicationSharingPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Policy for sharing applications on this compute instance among users of parent workspace. If Personal, only the creator can access applications on this compute instance. When Shared, any @@ -30,21 +31,22 @@ class ApplicationSharingPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): PERSONAL = "Personal" SHARED = "Shared" + class AutoRebuildSetting(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """AutoRebuild setting for the derived image - """ + """AutoRebuild setting for the derived image""" DISABLED = "Disabled" ON_BASE_IMAGE_UPDATE = "OnBaseImageUpdate" + class Autosave(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Auto save settings. - """ + """Auto save settings.""" NONE = "None" LOCAL = "Local" REMOTE = "Remote" + class BatchLoggingLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Log verbosity for batch inferencing. Increasing verbosity order for logging is : Warning, Info and Debug. @@ -55,22 +57,22 @@ class BatchLoggingLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): WARNING = "Warning" DEBUG = "Debug" + class BatchOutputAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine how batch inferencing will handle output - """ + """Enum to determine how batch inferencing will handle output""" SUMMARY_ONLY = "SummaryOnly" APPEND_ROW = "AppendRow" + class BillingCurrency(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Three lettered code specifying the currency of the VM price. Example: USD - """ + """Three lettered code specifying the currency of the VM price. Example: USD""" USD = "USD" + class BlockedTransformers(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum for all classification models supported by AutoML. - """ + """Enum for all classification models supported by AutoML.""" #: Target encoding for text data. TEXT_TARGET_ENCODER = "TextTargetEncoder" @@ -97,17 +99,17 @@ class BlockedTransformers(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: This is often used for high-cardinality categorical features. HASH_ONE_HOT_ENCODER = "HashOneHotEncoder" + class Caching(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Caching type of Data Disk. - """ + """Caching type of Data Disk.""" NONE = "None" READ_ONLY = "ReadOnly" READ_WRITE = "ReadWrite" + class ClassificationModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum for all classification models supported by AutoML. - """ + """Enum for all classification models supported by AutoML.""" #: Logistic regression is a fundamental classification technique. #: It belongs to the group of linear classifiers and is somewhat similar to polynomial and linear @@ -169,9 +171,11 @@ class ClassificationModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: target column values can be divided into distinct class values. XG_BOOST_CLASSIFIER = "XGBoostClassifier" -class ClassificationMultilabelPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for classification multilabel tasks. - """ + +class ClassificationMultilabelPrimaryMetrics( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """Primary metrics for classification multilabel tasks.""" #: AUC is the Area under the curve. #: This metric represents arithmetic mean of the score for each class, @@ -191,9 +195,11 @@ class ClassificationMultilabelPrimaryMetrics(str, Enum, metaclass=CaseInsensitiv #: Intersection Over Union. Intersection of predictions divided by union of predictions. IOU = "IOU" -class ClassificationPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for classification tasks. - """ + +class ClassificationPrimaryMetrics( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """Primary metrics for classification tasks.""" #: AUC is the Area under the curve. #: This metric represents arithmetic mean of the score for each class, @@ -211,23 +217,25 @@ class ClassificationPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta) #: class. PRECISION_SCORE_WEIGHTED = "PrecisionScoreWeighted" + class ClusterPurpose(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Intended usage of the cluster - """ + """Intended usage of the cluster""" FAST_PROD = "FastProd" DENSE_PROD = "DenseProd" DEV_TEST = "DevTest" -class ComputeInstanceAuthorizationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The Compute Instance Authorization type. Available values are personal (default). - """ + +class ComputeInstanceAuthorizationType( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """The Compute Instance Authorization type. Available values are personal (default).""" PERSONAL = "personal" + class ComputeInstanceState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Current state of an ComputeInstance. - """ + """Current state of an ComputeInstance.""" CREATING = "Creating" CREATE_FAILED = "CreateFailed" @@ -245,16 +253,16 @@ class ComputeInstanceState(str, Enum, metaclass=CaseInsensitiveEnumMeta): UNKNOWN = "Unknown" UNUSABLE = "Unusable" + class ComputePowerAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The compute power action. - """ + """The compute power action.""" START = "Start" STOP = "Stop" + class ComputeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of compute - """ + """The type of compute""" AKS = "AKS" KUBERNETES = "Kubernetes" @@ -267,9 +275,9 @@ class ComputeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): DATA_LAKE_ANALYTICS = "DataLakeAnalytics" SYNAPSE_SPARK = "SynapseSpark" + class ConnectionAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Authentication type of the connection target - """ + """Authentication type of the connection target""" PAT = "PAT" MANAGED_IDENTITY = "ManagedIdentity" @@ -277,31 +285,32 @@ class ConnectionAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): NONE = "None" SAS = "SAS" + class ConnectionCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Category of the connection - """ + """Category of the connection""" PYTHON_FEED = "PythonFeed" CONTAINER_REGISTRY = "ContainerRegistry" GIT = "Git" + class ContainerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): STORAGE_INITIALIZER = "StorageInitializer" INFERENCE_SERVER = "InferenceServer" + class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of identity that created the resource. - """ + """The type of identity that created the resource.""" USER = "User" APPLICATION = "Application" MANAGED_IDENTITY = "ManagedIdentity" KEY = "Key" + class CredentialsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the datastore credentials type. - """ + """Enum to determine the datastore credentials type.""" ACCOUNT_KEY = "AccountKey" CERTIFICATE = "Certificate" @@ -309,26 +318,28 @@ class CredentialsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): SAS = "Sas" SERVICE_PRINCIPAL = "ServicePrincipal" + class DatastoreType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the datastore contents type. - """ + """Enum to determine the datastore contents type.""" AZURE_BLOB = "AzureBlob" AZURE_DATA_LAKE_GEN1 = "AzureDataLakeGen1" AZURE_DATA_LAKE_GEN2 = "AzureDataLakeGen2" AZURE_FILE = "AzureFile" + class DataType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the type of data. - """ + """Enum to determine the type of data.""" URI_FILE = "uri_file" URI_FOLDER = "uri_folder" MLTABLE = "mltable" -class DeploymentProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Possible values for DeploymentProvisioningState. - """ + +class DeploymentProvisioningState( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """Possible values for DeploymentProvisioningState.""" CREATING = "Creating" DELETING = "Deleting" @@ -338,29 +349,33 @@ class DeploymentProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): FAILED = "Failed" CANCELED = "Canceled" + class DiagnoseResultLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Level of workspace setup error - """ + """Level of workspace setup error""" WARNING = "Warning" ERROR = "Error" INFORMATION = "Information" + class DistributionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the job distribution type. - """ + """Enum to determine the job distribution type.""" PY_TORCH = "PyTorch" TENSOR_FLOW = "TensorFlow" MPI = "Mpi" + class EarlyTerminationPolicyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): BANDIT = "Bandit" MEDIAN_STOPPING = "MedianStopping" TRUNCATION_SELECTION = "TruncationSelection" -class EgressPublicNetworkAccessType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + +class EgressPublicNetworkAccessType( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): """Enum to determine whether PublicNetworkAccess is Enabled or Disabled for egress of a deployment. """ @@ -368,32 +383,32 @@ class EgressPublicNetworkAccessType(str, Enum, metaclass=CaseInsensitiveEnumMeta ENABLED = "Enabled" DISABLED = "Disabled" + class EncryptionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates whether or not the encryption is enabled for the workspace. - """ + """Indicates whether or not the encryption is enabled for the workspace.""" ENABLED = "Enabled" DISABLED = "Disabled" + class EndpointAuthMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine endpoint authentication mode. - """ + """Enum to determine endpoint authentication mode.""" AML_TOKEN = "AMLToken" KEY = "Key" AAD_TOKEN = "AADToken" + class EndpointComputeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine endpoint compute type. - """ + """Enum to determine endpoint compute type.""" MANAGED = "Managed" KUBERNETES = "Kubernetes" AZURE_ML_COMPUTE = "AzureMLCompute" + class EndpointProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """State of endpoint provisioning. - """ + """State of endpoint provisioning.""" CREATING = "Creating" DELETING = "Deleting" @@ -402,25 +417,25 @@ class EndpointProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): UPDATING = "Updating" CANCELED = "Canceled" + class EnvironmentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Environment type is either user created or curated by Azure ML service - """ + """Environment type is either user created or curated by Azure ML service""" CURATED = "Curated" USER_CREATED = "UserCreated" + class FeatureLags(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Flag for generating lags for the numeric features. - """ + """Flag for generating lags for the numeric features.""" #: No feature lags generated. NONE = "None" #: System auto-generates feature lags. AUTO = "Auto" + class FeaturizationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Featurization mode - determines data featurization mode. - """ + """Featurization mode - determines data featurization mode.""" #: Auto mode, system performs featurization without any custom featurization inputs. AUTO = "Auto" @@ -429,18 +444,18 @@ class FeaturizationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Featurization off. 'Forecasting' task cannot use this value. OFF = "Off" + class ForecastHorizonMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine forecast horizon selection mode. - """ + """Enum to determine forecast horizon selection mode.""" #: Forecast horizon to be determined automatically. AUTO = "Auto" #: Use the custom forecast horizon. CUSTOM = "Custom" + class ForecastingModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum for all forecasting models supported by AutoML. - """ + """Enum for all forecasting models supported by AutoML.""" #: Auto-Autoregressive Integrated Moving Average (ARIMA) model uses time-series data and #: statistical analysis to interpret the data and make future predictions. @@ -517,9 +532,9 @@ class ForecastingModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: using ensemble of base learners. XG_BOOST_REGRESSOR = "XGBoostRegressor" + class ForecastingPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for Forecasting task. - """ + """Primary metrics for Forecasting task.""" #: The Spearman's rank coefficient of correlation is a non-parametric measure of rank correlation. SPEARMAN_CORRELATION = "SpearmanCorrelation" @@ -533,24 +548,24 @@ class ForecastingPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Error (MAE) of (time) series with different scales. NORMALIZED_MEAN_ABSOLUTE_ERROR = "NormalizedMeanAbsoluteError" + class Goal(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Defines supported metric goals for hyperparameter tuning - """ + """Defines supported metric goals for hyperparameter tuning""" MINIMIZE = "Minimize" MAXIMIZE = "Maximize" + class IdentityConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine identity framework. - """ + """Enum to determine identity framework.""" MANAGED = "Managed" AML_TOKEN = "AMLToken" USER_IDENTITY = "UserIdentity" + class InputDeliveryMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the input data delivery mode. - """ + """Enum to determine the input data delivery mode.""" READ_ONLY_MOUNT = "ReadOnlyMount" READ_WRITE_MOUNT = "ReadWriteMount" @@ -559,17 +574,19 @@ class InputDeliveryMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): EVAL_MOUNT = "EvalMount" EVAL_DOWNLOAD = "EvalDownload" -class InstanceSegmentationPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for InstanceSegmentation tasks. - """ + +class InstanceSegmentationPrimaryMetrics( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """Primary metrics for InstanceSegmentation tasks.""" #: Mean Average Precision (MAP) is the average of AP (Average Precision). #: AP is calculated for each class and averaged to get the MAP. MEAN_AVERAGE_PRECISION = "MeanAveragePrecision" + class JobInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the Job Input Type. - """ + """Enum to determine the Job Input Type.""" LITERAL = "literal" URI_FILE = "uri_file" @@ -579,14 +596,15 @@ class JobInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): MLFLOW_MODEL = "mlflow_model" TRITON_MODEL = "triton_model" + class JobLimitsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): COMMAND = "Command" SWEEP = "Sweep" + class JobOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the Job Output Type. - """ + """Enum to determine the Job Output Type.""" URI_FILE = "uri_file" URI_FOLDER = "uri_folder" @@ -595,9 +613,9 @@ class JobOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): MLFLOW_MODEL = "mlflow_model" TRITON_MODEL = "triton_model" + class JobStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The status of a job. - """ + """The status of a job.""" #: Run hasn't started yet. NOT_STARTED = "NotStarted" @@ -633,23 +651,24 @@ class JobStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Default job status if not mapped to all other statuses. UNKNOWN = "Unknown" + class JobType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the type of job. - """ + """Enum to determine the type of job.""" AUTO_ML = "AutoML" COMMAND = "Command" SWEEP = "Sweep" PIPELINE = "Pipeline" + class KeyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): PRIMARY = "Primary" SECONDARY = "Secondary" + class LearningRateScheduler(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Learning rate scheduler enum. - """ + """Learning rate scheduler enum.""" #: No learning rate scheduler selected. NONE = "None" @@ -658,22 +677,23 @@ class LearningRateScheduler(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Step learning rate scheduler. STEP = "Step" + class ListViewType(str, Enum, metaclass=CaseInsensitiveEnumMeta): ACTIVE_ONLY = "ActiveOnly" ARCHIVED_ONLY = "ArchivedOnly" ALL = "All" + class LoadBalancerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Load Balancer Type - """ + """Load Balancer Type""" PUBLIC_IP = "PublicIp" INTERNAL_LOAD_BALANCER = "InternalLoadBalancer" + class LogVerbosity(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum for setting log verbosity. - """ + """Enum for setting log verbosity.""" #: No logs emitted. NOT_SET = "NotSet" @@ -688,6 +708,7 @@ class LogVerbosity(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Only critical statements logged. CRITICAL = "Critical" + class ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). @@ -698,9 +719,9 @@ class ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): USER_ASSIGNED = "UserAssigned" SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" + class ModelSize(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Image model size. - """ + """Image model size.""" #: No value selected. NONE = "None" @@ -713,16 +734,16 @@ class ModelSize(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Extra large size. EXTRA_LARGE = "ExtraLarge" + class MountAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Mount Action. - """ + """Mount Action.""" MOUNT = "Mount" UNMOUNT = "Unmount" + class MountState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Mount state. - """ + """Mount state.""" MOUNT_REQUESTED = "MountRequested" MOUNTED = "Mounted" @@ -731,9 +752,9 @@ class MountState(str, Enum, metaclass=CaseInsensitiveEnumMeta): UNMOUNT_FAILED = "UnmountFailed" UNMOUNTED = "Unmounted" + class NCrossValidationsMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Determines how N-Cross validations value is determined. - """ + """Determines how N-Cross validations value is determined.""" #: Determine N-Cross validations value automatically. Supported only for 'Forecasting' AutoML #: task. @@ -741,13 +762,14 @@ class NCrossValidationsMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Use custom N-Cross validations value. CUSTOM = "Custom" + class Network(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """network of this container. - """ + """network of this container.""" BRIDGE = "Bridge" HOST = "Host" + class NodeState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """State of the compute node. Values are idle, running, preparing, unusable, leaving and preempted. @@ -760,24 +782,26 @@ class NodeState(str, Enum, metaclass=CaseInsensitiveEnumMeta): LEAVING = "leaving" PREEMPTED = "preempted" -class ObjectDetectionPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for Image ObjectDetection task. - """ + +class ObjectDetectionPrimaryMetrics( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """Primary metrics for Image ObjectDetection task.""" #: Mean Average Precision (MAP) is the average of AP (Average Precision). #: AP is calculated for each class and averaged to get the MAP. MEAN_AVERAGE_PRECISION = "MeanAveragePrecision" + class OperatingSystemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of operating system. - """ + """The type of operating system.""" LINUX = "Linux" WINDOWS = "Windows" + class OperationName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Name of the last operation. - """ + """Name of the last operation.""" CREATE = "Create" START = "Start" @@ -786,9 +810,9 @@ class OperationName(str, Enum, metaclass=CaseInsensitiveEnumMeta): REIMAGE = "Reimage" DELETE = "Delete" + class OperationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Operation status. - """ + """Operation status.""" IN_PROGRESS = "InProgress" SUCCEEDED = "Succeeded" @@ -799,14 +823,15 @@ class OperationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): REIMAGE_FAILED = "ReimageFailed" DELETE_FAILED = "DeleteFailed" + class OperationTrigger(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Trigger of operation. - """ + """Trigger of operation.""" USER = "User" SCHEDULE = "Schedule" IDLE_SHUTDOWN = "IdleShutdown" + class OrderString(str, Enum, metaclass=CaseInsensitiveEnumMeta): CREATED_AT_DESC = "CreatedAtDesc" @@ -814,32 +839,36 @@ class OrderString(str, Enum, metaclass=CaseInsensitiveEnumMeta): UPDATED_AT_DESC = "UpdatedAtDesc" UPDATED_AT_ASC = "UpdatedAtAsc" + class OsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Compute OS Type - """ + """Compute OS Type""" LINUX = "Linux" WINDOWS = "Windows" + class OutputDeliveryMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Output data delivery mode enums. - """ + """Output data delivery mode enums.""" READ_WRITE_MOUNT = "ReadWriteMount" UPLOAD = "Upload" -class PrivateEndpointConnectionProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The current provisioning state. - """ + +class PrivateEndpointConnectionProvisioningState( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """The current provisioning state.""" SUCCEEDED = "Succeeded" CREATING = "Creating" DELETING = "Deleting" FAILED = "Failed" -class PrivateEndpointServiceConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The private endpoint connection status. - """ + +class PrivateEndpointServiceConnectionStatus( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """The private endpoint connection status.""" PENDING = "Pending" APPROVED = "Approved" @@ -847,6 +876,7 @@ class PrivateEndpointServiceConnectionStatus(str, Enum, metaclass=CaseInsensitiv DISCONNECTED = "Disconnected" TIMEOUT = "Timeout" + class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The current deployment state of workspace resource. The provisioningState is to indicate states for resource provisioning. @@ -860,44 +890,46 @@ class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): FAILED = "Failed" CANCELED = "Canceled" + class ProvisioningStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The current deployment state of schedule. - """ + """The current deployment state of schedule.""" COMPLETED = "Completed" PROVISIONING = "Provisioning" FAILED = "Failed" + class PublicNetworkAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Whether requests from Public Network are allowed. - """ + """Whether requests from Public Network are allowed.""" ENABLED = "Enabled" DISABLED = "Disabled" + class PublicNetworkAccessType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine whether PublicNetworkAccess is Enabled or Disabled. - """ + """Enum to determine whether PublicNetworkAccess is Enabled or Disabled.""" ENABLED = "Enabled" DISABLED = "Disabled" + class QuotaUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """An enum describing the unit of quota measurement. - """ + """An enum describing the unit of quota measurement.""" COUNT = "Count" -class RandomSamplingAlgorithmRule(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The specific type of random algorithm - """ + +class RandomSamplingAlgorithmRule( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """The specific type of random algorithm""" RANDOM = "Random" SOBOL = "Sobol" + class RecurrenceFrequency(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to describe the frequency of a recurrence schedule - """ + """Enum to describe the frequency of a recurrence schedule""" #: Minute frequency. MINUTE = "Minute" @@ -910,17 +942,17 @@ class RecurrenceFrequency(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Month frequency. MONTH = "Month" + class ReferenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine which reference method to use for an asset. - """ + """Enum to determine which reference method to use for an asset.""" ID = "Id" DATA_PATH = "DataPath" OUTPUT_PATH = "OutputPath" + class RegressionModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum for all Regression models supported by AutoML. - """ + """Enum for all Regression models supported by AutoML.""" #: Elastic net is a popular type of regularized linear regression that combines two popular #: penalties, specifically the L1 and L2 penalty functions. @@ -962,9 +994,9 @@ class RegressionModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: using ensemble of base learners. XG_BOOST_REGRESSOR = "XGBoostRegressor" + class RegressionPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for Regression task. - """ + """Primary metrics for Regression task.""" #: The Spearman's rank coefficient of correlation is a nonparametric measure of rank correlation. SPEARMAN_CORRELATION = "SpearmanCorrelation" @@ -978,7 +1010,10 @@ class RegressionPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Error (MAE) of (time) series with different scales. NORMALIZED_MEAN_ABSOLUTE_ERROR = "NormalizedMeanAbsoluteError" -class RemoteLoginPortPublicAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): + +class RemoteLoginPortPublicAccess( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): """State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - Indicates that the public ssh port is closed @@ -991,36 +1026,41 @@ class RemoteLoginPortPublicAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): DISABLED = "Disabled" NOT_SPECIFIED = "NotSpecified" + class SamplingAlgorithmType(str, Enum, metaclass=CaseInsensitiveEnumMeta): GRID = "Grid" RANDOM = "Random" BAYESIAN = "Bayesian" + class ScaleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): DEFAULT = "Default" TARGET_UTILIZATION = "TargetUtilization" + class ScheduleActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): CREATE_JOB = "CreateJob" INVOKE_BATCH_ENDPOINT = "InvokeBatchEndpoint" + class ScheduleListViewType(str, Enum, metaclass=CaseInsensitiveEnumMeta): ENABLED_ONLY = "EnabledOnly" DISABLED_ONLY = "DisabledOnly" ALL = "All" + class ScheduleProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The current deployment state of schedule. - """ + """The current deployment state of schedule.""" COMPLETED = "Completed" PROVISIONING = "Provisioning" FAILED = "Failed" + class ScheduleProvisioningStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): CREATING = "Creating" @@ -1030,32 +1070,35 @@ class ScheduleProvisioningStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): FAILED = "Failed" CANCELED = "Canceled" + class ScheduleStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Is the schedule enabled or disabled? - """ + """Is the schedule enabled or disabled?""" ENABLED = "Enabled" DISABLED = "Disabled" + class SeasonalityMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Forecasting seasonality mode. - """ + """Forecasting seasonality mode.""" #: Seasonality to be determined automatically. AUTO = "Auto" #: Use the custom seasonality value. CUSTOM = "Custom" + class SecretsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the datastore secrets type. - """ + """Enum to determine the datastore secrets type.""" ACCOUNT_KEY = "AccountKey" CERTIFICATE = "Certificate" SAS = "Sas" SERVICE_PRINCIPAL = "ServicePrincipal" -class ServiceDataAccessAuthIdentity(str, Enum, metaclass=CaseInsensitiveEnumMeta): + +class ServiceDataAccessAuthIdentity( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): #: Do not use any identity for service data access. NONE = "None" @@ -1064,9 +1107,11 @@ class ServiceDataAccessAuthIdentity(str, Enum, metaclass=CaseInsensitiveEnumMeta #: Use the user assigned managed identity of the Workspace to authenticate service data access. WORKSPACE_USER_ASSIGNED_IDENTITY = "WorkspaceUserAssignedIdentity" -class ShortSeriesHandlingConfiguration(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The parameter defining how if AutoML should handle short time series. - """ + +class ShortSeriesHandlingConfiguration( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """The parameter defining how if AutoML should handle short time series.""" #: Represents no/null value. NONE = "None" @@ -1078,9 +1123,9 @@ class ShortSeriesHandlingConfiguration(str, Enum, metaclass=CaseInsensitiveEnumM #: All the short series will be dropped. DROP = "Drop" + class SkuScaleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Node scaling setting for the compute sku. - """ + """Node scaling setting for the compute sku.""" #: Automatically scales node count. AUTOMATIC = "Automatic" @@ -1089,6 +1134,7 @@ class SkuScaleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Fixed set of nodes. NONE = "None" + class SkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): """This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT. @@ -1099,14 +1145,15 @@ class SkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): STANDARD = "Standard" PREMIUM = "Premium" + class SourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Data source type. - """ + """Data source type.""" DATASET = "Dataset" DATASTORE = "Datastore" URI = "URI" + class SshPublicAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): """State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the public ssh port is open and @@ -1116,14 +1163,15 @@ class SshPublicAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): ENABLED = "Enabled" DISABLED = "Disabled" + class SslConfigStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enable or disable ssl for scoring - """ + """Enable or disable ssl for scoring""" DISABLED = "Disabled" ENABLED = "Enabled" AUTO = "Auto" + class StackMetaLearnerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The meta-learner is a model trained on the output of the individual heterogeneous models. Default meta-learners are LogisticRegression for classification tasks (or LogisticRegressionCV @@ -1146,22 +1194,24 @@ class StackMetaLearnerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): LIGHT_GBM_REGRESSOR = "LightGBMRegressor" LINEAR_REGRESSION = "LinearRegression" + class Status(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Status of update workspace quota. - """ + """Status of update workspace quota.""" UNDEFINED = "Undefined" SUCCESS = "Success" FAILURE = "Failure" INVALID_QUOTA_BELOW_CLUSTER_MINIMUM = "InvalidQuotaBelowClusterMinimum" - INVALID_QUOTA_EXCEEDS_SUBSCRIPTION_LIMIT = "InvalidQuotaExceedsSubscriptionLimit" + INVALID_QUOTA_EXCEEDS_SUBSCRIPTION_LIMIT = ( + "InvalidQuotaExceedsSubscriptionLimit" + ) INVALID_VM_FAMILY_NAME = "InvalidVMFamilyName" OPERATION_NOT_SUPPORTED_FOR_SKU = "OperationNotSupportedForSku" OPERATION_NOT_ENABLED_FOR_REGION = "OperationNotEnabledForRegion" + class StochasticOptimizer(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Stochastic optimizer for image models. - """ + """Stochastic optimizer for image models.""" #: No optimizer selected. NONE = "None" @@ -1173,16 +1223,16 @@ class StochasticOptimizer(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: AdamW is a variant of the optimizer Adam that has an improved implementation of weight decay. ADAMW = "Adamw" + class StorageAccountType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """type of this storage account. - """ + """type of this storage account.""" STANDARD_LRS = "Standard_LRS" PREMIUM_LRS = "Premium_LRS" + class TargetAggregationFunction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Target aggregate function. - """ + """Target aggregate function.""" #: Represent no value set. NONE = "None" @@ -1191,27 +1241,29 @@ class TargetAggregationFunction(str, Enum, metaclass=CaseInsensitiveEnumMeta): MIN = "Min" MEAN = "Mean" + class TargetLagsMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Target lags selection modes. - """ + """Target lags selection modes.""" #: Target lags to be determined automatically. AUTO = "Auto" #: Use the custom target lags. CUSTOM = "Custom" -class TargetRollingWindowSizeMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Target rolling windows size mode. - """ + +class TargetRollingWindowSizeMode( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """Target rolling windows size mode.""" #: Determine rolling windows size automatically. AUTO = "Auto" #: Use the specified rolling window size. CUSTOM = "Custom" + class TaskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """AutoMLJob Task type. - """ + """AutoMLJob Task type.""" #: Classification in machine learning and statistics is a supervised learning approach in which #: the computer program learns from the data given to it and make new observations or @@ -1252,40 +1304,42 @@ class TaskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: occurrences of entities such as people, locations, organizations, and more. TEXT_NER = "TextNER" + class TriggerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): RECURRENCE = "Recurrence" CRON = "Cron" + class UnderlyingResourceAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): DELETE = "Delete" DETACH = "Detach" + class UnitOfMeasure(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The unit of time measurement for the specified VM price. Example: OneHour - """ + """The unit of time measurement for the specified VM price. Example: OneHour""" ONE_HOUR = "OneHour" + class UsageUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """An enum describing the unit of usage measurement. - """ + """An enum describing the unit of usage measurement.""" COUNT = "Count" + class UseStl(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Configure STL Decomposition of the time-series target column. - """ + """Configure STL Decomposition of the time-series target column.""" #: No stl decomposition. NONE = "None" SEASON = "Season" SEASON_TREND = "SeasonTrend" + class ValidationMetricType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Metric computation method to use for validation metrics in image tasks. - """ + """Metric computation method to use for validation metrics in image tasks.""" #: No metric. NONE = "None" @@ -1296,37 +1350,37 @@ class ValidationMetricType(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: CocoVoc metric. COCO_VOC = "CocoVoc" + class ValueFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """format for the workspace connection value - """ + """format for the workspace connection value""" JSON = "JSON" + class VMPriceOSType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Operating system type used by the VM. - """ + """Operating system type used by the VM.""" LINUX = "Linux" WINDOWS = "Windows" + class VmPriority(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Virtual Machine priority - """ + """Virtual Machine priority""" DEDICATED = "Dedicated" LOW_PRIORITY = "LowPriority" + class VMTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of the VM. - """ + """The type of the VM.""" STANDARD = "Standard" LOW_PRIORITY = "LowPriority" SPOT = "Spot" + class WeekDay(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum of weekday - """ + """Enum of weekday""" #: Monday weekday. MONDAY = "Monday" diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/models/_models.py index fd44c8cb5b08..93150848fe79 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/models/_models.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/models/_models.py @@ -25,23 +25,25 @@ class DatastoreCredentials(msrest.serialization.Model): """ _validation = { - 'credentials_type': {'required': True}, + "credentials_type": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, } _subtype_map = { - 'credentials_type': {'AccountKey': 'AccountKeyDatastoreCredentials', 'Certificate': 'CertificateDatastoreCredentials', 'None': 'NoneDatastoreCredentials', 'Sas': 'SasDatastoreCredentials', 'ServicePrincipal': 'ServicePrincipalDatastoreCredentials'} + "credentials_type": { + "AccountKey": "AccountKeyDatastoreCredentials", + "Certificate": "CertificateDatastoreCredentials", + "None": "NoneDatastoreCredentials", + "Sas": "SasDatastoreCredentials", + "ServicePrincipal": "ServicePrincipalDatastoreCredentials", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DatastoreCredentials, self).__init__(**kwargs) self.credentials_type = None # type: Optional[str] @@ -60,26 +62,23 @@ class AccountKeyDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, + "credentials_type": {"required": True}, + "secrets": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'AccountKeyDatastoreSecrets'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "secrets": {"key": "secrets", "type": "AccountKeyDatastoreSecrets"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword secrets: Required. [Required] Storage account secrets. :paramtype secrets: ~azure.mgmt.machinelearningservices.models.AccountKeyDatastoreSecrets """ super(AccountKeyDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'AccountKey' # type: str - self.secrets = kwargs['secrets'] + self.credentials_type = "AccountKey" # type: str + self.secrets = kwargs["secrets"] class DatastoreSecrets(msrest.serialization.Model): @@ -97,23 +96,24 @@ class DatastoreSecrets(msrest.serialization.Model): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, } _subtype_map = { - 'secrets_type': {'AccountKey': 'AccountKeyDatastoreSecrets', 'Certificate': 'CertificateDatastoreSecrets', 'Sas': 'SasDatastoreSecrets', 'ServicePrincipal': 'ServicePrincipalDatastoreSecrets'} + "secrets_type": { + "AccountKey": "AccountKeyDatastoreSecrets", + "Certificate": "CertificateDatastoreSecrets", + "Sas": "SasDatastoreSecrets", + "ServicePrincipal": "ServicePrincipalDatastoreSecrets", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DatastoreSecrets, self).__init__(**kwargs) self.secrets_type = None # type: Optional[str] @@ -132,25 +132,22 @@ class AccountKeyDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "key": {"key": "key", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword key: Storage account key. :paramtype key: str """ super(AccountKeyDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'AccountKey' # type: str - self.key = kwargs.get('key', None) + self.secrets_type = "AccountKey" # type: str + self.key = kwargs.get("key", None) class AKSSchema(msrest.serialization.Model): @@ -161,19 +158,16 @@ class AKSSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, + "properties": {"key": "properties", "type": "AKSSchemaProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: AKS properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties """ super(AKSSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class Compute(msrest.serialization.Model): @@ -216,37 +210,48 @@ class Compute(msrest.serialization.Model): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + "disable_local_auth": {"readonly": True}, + } + + _attribute_map = { + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } _subtype_map = { - 'compute_type': {'AKS': 'AKS', 'AmlCompute': 'AmlCompute', 'ComputeInstance': 'ComputeInstance', 'DataFactory': 'DataFactory', 'DataLakeAnalytics': 'DataLakeAnalytics', 'Databricks': 'Databricks', 'HDInsight': 'HDInsight', 'Kubernetes': 'Kubernetes', 'SynapseSpark': 'SynapseSpark', 'VirtualMachine': 'VirtualMachine'} - } - - def __init__( - self, - **kwargs - ): + "compute_type": { + "AKS": "AKS", + "AmlCompute": "AmlCompute", + "ComputeInstance": "ComputeInstance", + "DataFactory": "DataFactory", + "DataLakeAnalytics": "DataLakeAnalytics", + "Databricks": "Databricks", + "HDInsight": "HDInsight", + "Kubernetes": "Kubernetes", + "SynapseSpark": "SynapseSpark", + "VirtualMachine": "VirtualMachine", + } + } + + def __init__(self, **kwargs): """ :keyword description: The description of the Machine Learning compute. :paramtype description: str @@ -257,10 +262,10 @@ def __init__( self.compute_type = None # type: Optional[str] self.compute_location = None self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None self.disable_local_auth = None @@ -305,34 +310,34 @@ class AKS(Compute, AKSSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + "disable_local_auth": {"readonly": True}, + } + + _attribute_map = { + "properties": {"key": "properties", "type": "AKSSchemaProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, + } + + def __init__(self, **kwargs): """ :keyword properties: AKS properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties @@ -342,14 +347,14 @@ def __init__( :paramtype resource_id: str """ super(AKS, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'AKS' # type: str + self.properties = kwargs.get("properties", None) + self.compute_type = "AKS" # type: str self.compute_location = None self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None self.disable_local_auth = None @@ -369,15 +374,15 @@ class AksComputeSecretsProperties(msrest.serialization.Model): """ _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, + "user_kube_config": {"key": "userKubeConfig", "type": "str"}, + "admin_kube_config": {"key": "adminKubeConfig", "type": "str"}, + "image_pull_secret_name": { + "key": "imagePullSecretName", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword user_kube_config: Content of kubeconfig file that can be used to connect to the Kubernetes cluster. @@ -389,9 +394,11 @@ def __init__( :paramtype image_pull_secret_name: str """ super(AksComputeSecretsProperties, self).__init__(**kwargs) - self.user_kube_config = kwargs.get('user_kube_config', None) - self.admin_kube_config = kwargs.get('admin_kube_config', None) - self.image_pull_secret_name = kwargs.get('image_pull_secret_name', None) + self.user_kube_config = kwargs.get("user_kube_config", None) + self.admin_kube_config = kwargs.get("admin_kube_config", None) + self.image_pull_secret_name = kwargs.get( + "image_pull_secret_name", None + ) class ComputeSecrets(msrest.serialization.Model): @@ -409,23 +416,23 @@ class ComputeSecrets(msrest.serialization.Model): """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "compute_type": {"key": "computeType", "type": "str"}, } _subtype_map = { - 'compute_type': {'AKS': 'AksComputeSecrets', 'Databricks': 'DatabricksComputeSecrets', 'VirtualMachine': 'VirtualMachineSecrets'} + "compute_type": { + "AKS": "AksComputeSecrets", + "Databricks": "DatabricksComputeSecrets", + "VirtualMachine": "VirtualMachineSecrets", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ComputeSecrets, self).__init__(**kwargs) self.compute_type = None # type: Optional[str] @@ -450,20 +457,20 @@ class AksComputeSecrets(ComputeSecrets, AksComputeSecretsProperties): """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "user_kube_config": {"key": "userKubeConfig", "type": "str"}, + "admin_kube_config": {"key": "adminKubeConfig", "type": "str"}, + "image_pull_secret_name": { + "key": "imagePullSecretName", + "type": "str", + }, + "compute_type": {"key": "computeType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword user_kube_config: Content of kubeconfig file that can be used to connect to the Kubernetes cluster. @@ -475,10 +482,12 @@ def __init__( :paramtype image_pull_secret_name: str """ super(AksComputeSecrets, self).__init__(**kwargs) - self.user_kube_config = kwargs.get('user_kube_config', None) - self.admin_kube_config = kwargs.get('admin_kube_config', None) - self.image_pull_secret_name = kwargs.get('image_pull_secret_name', None) - self.compute_type = 'AKS' # type: str + self.user_kube_config = kwargs.get("user_kube_config", None) + self.admin_kube_config = kwargs.get("admin_kube_config", None) + self.image_pull_secret_name = kwargs.get( + "image_pull_secret_name", None + ) + self.compute_type = "AKS" # type: str class AksNetworkingConfiguration(msrest.serialization.Model): @@ -498,22 +507,25 @@ class AksNetworkingConfiguration(msrest.serialization.Model): """ _validation = { - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, + "service_cidr": { + "pattern": r"^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$" + }, + "dns_service_ip": { + "pattern": r"^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" + }, + "docker_bridge_cidr": { + "pattern": r"^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$" + }, } _attribute_map = { - 'subnet_id': {'key': 'subnetId', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, + "subnet_id": {"key": "subnetId", "type": "str"}, + "service_cidr": {"key": "serviceCidr", "type": "str"}, + "dns_service_ip": {"key": "dnsServiceIP", "type": "str"}, + "docker_bridge_cidr": {"key": "dockerBridgeCidr", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword subnet_id: Virtual network subnet resource ID the compute nodes belong to. :paramtype subnet_id: str @@ -528,10 +540,10 @@ def __init__( :paramtype docker_bridge_cidr: str """ super(AksNetworkingConfiguration, self).__init__(**kwargs) - self.subnet_id = kwargs.get('subnet_id', None) - self.service_cidr = kwargs.get('service_cidr', None) - self.dns_service_ip = kwargs.get('dns_service_ip', None) - self.docker_bridge_cidr = kwargs.get('docker_bridge_cidr', None) + self.subnet_id = kwargs.get("subnet_id", None) + self.service_cidr = kwargs.get("service_cidr", None) + self.dns_service_ip = kwargs.get("dns_service_ip", None) + self.docker_bridge_cidr = kwargs.get("docker_bridge_cidr", None) class AKSSchemaProperties(msrest.serialization.Model): @@ -563,26 +575,32 @@ class AKSSchemaProperties(msrest.serialization.Model): """ _validation = { - 'system_services': {'readonly': True}, - 'agent_count': {'minimum': 0}, + "system_services": {"readonly": True}, + "agent_count": {"minimum": 0}, } _attribute_map = { - 'cluster_fqdn': {'key': 'clusterFqdn', 'type': 'str'}, - 'system_services': {'key': 'systemServices', 'type': '[SystemService]'}, - 'agent_count': {'key': 'agentCount', 'type': 'int'}, - 'agent_vm_size': {'key': 'agentVmSize', 'type': 'str'}, - 'cluster_purpose': {'key': 'clusterPurpose', 'type': 'str'}, - 'ssl_configuration': {'key': 'sslConfiguration', 'type': 'SslConfiguration'}, - 'aks_networking_configuration': {'key': 'aksNetworkingConfiguration', 'type': 'AksNetworkingConfiguration'}, - 'load_balancer_type': {'key': 'loadBalancerType', 'type': 'str'}, - 'load_balancer_subnet': {'key': 'loadBalancerSubnet', 'type': 'str'}, + "cluster_fqdn": {"key": "clusterFqdn", "type": "str"}, + "system_services": { + "key": "systemServices", + "type": "[SystemService]", + }, + "agent_count": {"key": "agentCount", "type": "int"}, + "agent_vm_size": {"key": "agentVmSize", "type": "str"}, + "cluster_purpose": {"key": "clusterPurpose", "type": "str"}, + "ssl_configuration": { + "key": "sslConfiguration", + "type": "SslConfiguration", + }, + "aks_networking_configuration": { + "key": "aksNetworkingConfiguration", + "type": "AksNetworkingConfiguration", + }, + "load_balancer_type": {"key": "loadBalancerType", "type": "str"}, + "load_balancer_subnet": {"key": "loadBalancerSubnet", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword cluster_fqdn: Cluster full qualified domain name. :paramtype cluster_fqdn: str @@ -606,15 +624,17 @@ def __init__( :paramtype load_balancer_subnet: str """ super(AKSSchemaProperties, self).__init__(**kwargs) - self.cluster_fqdn = kwargs.get('cluster_fqdn', None) + self.cluster_fqdn = kwargs.get("cluster_fqdn", None) self.system_services = None - self.agent_count = kwargs.get('agent_count', None) - self.agent_vm_size = kwargs.get('agent_vm_size', None) - self.cluster_purpose = kwargs.get('cluster_purpose', "FastProd") - self.ssl_configuration = kwargs.get('ssl_configuration', None) - self.aks_networking_configuration = kwargs.get('aks_networking_configuration', None) - self.load_balancer_type = kwargs.get('load_balancer_type', "PublicIp") - self.load_balancer_subnet = kwargs.get('load_balancer_subnet', None) + self.agent_count = kwargs.get("agent_count", None) + self.agent_vm_size = kwargs.get("agent_vm_size", None) + self.cluster_purpose = kwargs.get("cluster_purpose", "FastProd") + self.ssl_configuration = kwargs.get("ssl_configuration", None) + self.aks_networking_configuration = kwargs.get( + "aks_networking_configuration", None + ) + self.load_balancer_type = kwargs.get("load_balancer_type", "PublicIp") + self.load_balancer_subnet = kwargs.get("load_balancer_subnet", None) class AmlComputeSchema(msrest.serialization.Model): @@ -625,19 +645,16 @@ class AmlComputeSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, + "properties": {"key": "properties", "type": "AmlComputeProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of AmlCompute. :paramtype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties """ super(AmlComputeSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class AmlCompute(Compute, AmlComputeSchema): @@ -679,34 +696,34 @@ class AmlCompute(Compute, AmlComputeSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + "disable_local_auth": {"readonly": True}, + } + + _attribute_map = { + "properties": {"key": "properties", "type": "AmlComputeProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, + } + + def __init__(self, **kwargs): """ :keyword properties: Properties of AmlCompute. :paramtype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties @@ -716,14 +733,14 @@ def __init__( :paramtype resource_id: str """ super(AmlCompute, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'AmlCompute' # type: str + self.properties = kwargs.get("properties", None) + self.compute_type = "AmlCompute" # type: str self.compute_location = None self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None self.disable_local_auth = None @@ -751,29 +768,25 @@ class AmlComputeNodeInformation(msrest.serialization.Model): """ _validation = { - 'node_id': {'readonly': True}, - 'private_ip_address': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'port': {'readonly': True}, - 'node_state': {'readonly': True}, - 'run_id': {'readonly': True}, + "node_id": {"readonly": True}, + "private_ip_address": {"readonly": True}, + "public_ip_address": {"readonly": True}, + "port": {"readonly": True}, + "node_state": {"readonly": True}, + "run_id": {"readonly": True}, } _attribute_map = { - 'node_id': {'key': 'nodeId', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'node_state': {'key': 'nodeState', 'type': 'str'}, - 'run_id': {'key': 'runId', 'type': 'str'}, + "node_id": {"key": "nodeId", "type": "str"}, + "private_ip_address": {"key": "privateIpAddress", "type": "str"}, + "public_ip_address": {"key": "publicIpAddress", "type": "str"}, + "port": {"key": "port", "type": "int"}, + "node_state": {"key": "nodeState", "type": "str"}, + "run_id": {"key": "runId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AmlComputeNodeInformation, self).__init__(**kwargs) self.node_id = None self.private_ip_address = None @@ -795,21 +808,17 @@ class AmlComputeNodesInformation(msrest.serialization.Model): """ _validation = { - 'nodes': {'readonly': True}, - 'next_link': {'readonly': True}, + "nodes": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'nodes': {'key': 'nodes', 'type': '[AmlComputeNodeInformation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "nodes": {"key": "nodes", "type": "[AmlComputeNodeInformation]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AmlComputeNodesInformation, self).__init__(**kwargs) self.nodes = None self.next_link = None @@ -880,38 +889,50 @@ class AmlComputeProperties(msrest.serialization.Model): """ _validation = { - 'allocation_state': {'readonly': True}, - 'allocation_state_transition_time': {'readonly': True}, - 'errors': {'readonly': True}, - 'current_node_count': {'readonly': True}, - 'target_node_count': {'readonly': True}, - 'node_state_counts': {'readonly': True}, - } - - _attribute_map = { - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'vm_priority': {'key': 'vmPriority', 'type': 'str'}, - 'virtual_machine_image': {'key': 'virtualMachineImage', 'type': 'VirtualMachineImage'}, - 'isolated_network': {'key': 'isolatedNetwork', 'type': 'bool'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, - 'user_account_credentials': {'key': 'userAccountCredentials', 'type': 'UserAccountCredentials'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'remote_login_port_public_access': {'key': 'remoteLoginPortPublicAccess', 'type': 'str'}, - 'allocation_state': {'key': 'allocationState', 'type': 'str'}, - 'allocation_state_transition_time': {'key': 'allocationStateTransitionTime', 'type': 'iso-8601'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'current_node_count': {'key': 'currentNodeCount', 'type': 'int'}, - 'target_node_count': {'key': 'targetNodeCount', 'type': 'int'}, - 'node_state_counts': {'key': 'nodeStateCounts', 'type': 'NodeStateCounts'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'property_bag': {'key': 'propertyBag', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): + "allocation_state": {"readonly": True}, + "allocation_state_transition_time": {"readonly": True}, + "errors": {"readonly": True}, + "current_node_count": {"readonly": True}, + "target_node_count": {"readonly": True}, + "node_state_counts": {"readonly": True}, + } + + _attribute_map = { + "os_type": {"key": "osType", "type": "str"}, + "vm_size": {"key": "vmSize", "type": "str"}, + "vm_priority": {"key": "vmPriority", "type": "str"}, + "virtual_machine_image": { + "key": "virtualMachineImage", + "type": "VirtualMachineImage", + }, + "isolated_network": {"key": "isolatedNetwork", "type": "bool"}, + "scale_settings": {"key": "scaleSettings", "type": "ScaleSettings"}, + "user_account_credentials": { + "key": "userAccountCredentials", + "type": "UserAccountCredentials", + }, + "subnet": {"key": "subnet", "type": "ResourceId"}, + "remote_login_port_public_access": { + "key": "remoteLoginPortPublicAccess", + "type": "str", + }, + "allocation_state": {"key": "allocationState", "type": "str"}, + "allocation_state_transition_time": { + "key": "allocationStateTransitionTime", + "type": "iso-8601", + }, + "errors": {"key": "errors", "type": "[ErrorResponse]"}, + "current_node_count": {"key": "currentNodeCount", "type": "int"}, + "target_node_count": {"key": "targetNodeCount", "type": "int"}, + "node_state_counts": { + "key": "nodeStateCounts", + "type": "NodeStateCounts", + }, + "enable_node_public_ip": {"key": "enableNodePublicIp", "type": "bool"}, + "property_bag": {"key": "propertyBag", "type": "object"}, + } + + def __init__(self, **kwargs): """ :keyword os_type: Compute OS Type. Possible values include: "Linux", "Windows". Default value: "Linux". @@ -952,23 +973,27 @@ def __init__( :paramtype property_bag: any """ super(AmlComputeProperties, self).__init__(**kwargs) - self.os_type = kwargs.get('os_type', "Linux") - self.vm_size = kwargs.get('vm_size', None) - self.vm_priority = kwargs.get('vm_priority', None) - self.virtual_machine_image = kwargs.get('virtual_machine_image', None) - self.isolated_network = kwargs.get('isolated_network', None) - self.scale_settings = kwargs.get('scale_settings', None) - self.user_account_credentials = kwargs.get('user_account_credentials', None) - self.subnet = kwargs.get('subnet', None) - self.remote_login_port_public_access = kwargs.get('remote_login_port_public_access', "NotSpecified") + self.os_type = kwargs.get("os_type", "Linux") + self.vm_size = kwargs.get("vm_size", None) + self.vm_priority = kwargs.get("vm_priority", None) + self.virtual_machine_image = kwargs.get("virtual_machine_image", None) + self.isolated_network = kwargs.get("isolated_network", None) + self.scale_settings = kwargs.get("scale_settings", None) + self.user_account_credentials = kwargs.get( + "user_account_credentials", None + ) + self.subnet = kwargs.get("subnet", None) + self.remote_login_port_public_access = kwargs.get( + "remote_login_port_public_access", "NotSpecified" + ) self.allocation_state = None self.allocation_state_transition_time = None self.errors = None self.current_node_count = None self.target_node_count = None self.node_state_counts = None - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', True) - self.property_bag = kwargs.get('property_bag', None) + self.enable_node_public_ip = kwargs.get("enable_node_public_ip", True) + self.property_bag = kwargs.get("property_bag", None) class AmlOperation(msrest.serialization.Model): @@ -983,15 +1008,12 @@ class AmlOperation(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'AmlOperationDisplay'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + "name": {"key": "name", "type": "str"}, + "display": {"key": "display", "type": "AmlOperationDisplay"}, + "is_data_action": {"key": "isDataAction", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: Operation name: {provider}/{resource}/{operation}. :paramtype name: str @@ -1001,9 +1023,9 @@ def __init__( :paramtype is_data_action: bool """ super(AmlOperation, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display = kwargs.get('display', None) - self.is_data_action = kwargs.get('is_data_action', None) + self.name = kwargs.get("name", None) + self.display = kwargs.get("display", None) + self.is_data_action = kwargs.get("is_data_action", None) class AmlOperationDisplay(msrest.serialization.Model): @@ -1020,16 +1042,13 @@ class AmlOperationDisplay(msrest.serialization.Model): """ _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, + "provider": {"key": "provider", "type": "str"}, + "resource": {"key": "resource", "type": "str"}, + "operation": {"key": "operation", "type": "str"}, + "description": {"key": "description", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword provider: The resource provider name: Microsoft.MachineLearningExperimentation. :paramtype provider: str @@ -1041,10 +1060,10 @@ def __init__( :paramtype description: str """ super(AmlOperationDisplay, self).__init__(**kwargs) - self.provider = kwargs.get('provider', None) - self.resource = kwargs.get('resource', None) - self.operation = kwargs.get('operation', None) - self.description = kwargs.get('description', None) + self.provider = kwargs.get("provider", None) + self.resource = kwargs.get("resource", None) + self.operation = kwargs.get("operation", None) + self.description = kwargs.get("description", None) class AmlOperationListResult(msrest.serialization.Model): @@ -1055,20 +1074,17 @@ class AmlOperationListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlOperation]'}, + "value": {"key": "value", "type": "[AmlOperation]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: List of AML workspace operations supported by the AML workspace resource provider. :paramtype value: list[~azure.mgmt.machinelearningservices.models.AmlOperation] """ super(AmlOperationListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class IdentityConfiguration(msrest.serialization.Model): @@ -1086,23 +1102,23 @@ class IdentityConfiguration(msrest.serialization.Model): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, } _subtype_map = { - 'identity_type': {'AMLToken': 'AmlToken', 'Managed': 'ManagedIdentity', 'UserIdentity': 'UserIdentity'} + "identity_type": { + "AMLToken": "AmlToken", + "Managed": "ManagedIdentity", + "UserIdentity": "UserIdentity", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(IdentityConfiguration, self).__init__(**kwargs) self.identity_type = None # type: Optional[str] @@ -1119,21 +1135,17 @@ class AmlToken(IdentityConfiguration): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AmlToken, self).__init__(**kwargs) - self.identity_type = 'AMLToken' # type: str + self.identity_type = "AMLToken" # type: str class AmlUserFeature(msrest.serialization.Model): @@ -1148,15 +1160,12 @@ class AmlUserFeature(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "description": {"key": "description", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword id: Specifies the feature ID. :paramtype id: str @@ -1166,9 +1175,9 @@ def __init__( :paramtype description: str """ super(AmlUserFeature, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.display_name = kwargs.get('display_name', None) - self.description = kwargs.get('description', None) + self.id = kwargs.get("id", None) + self.display_name = kwargs.get("display_name", None) + self.description = kwargs.get("description", None) class ResourceBase(msrest.serialization.Model): @@ -1183,15 +1192,12 @@ class ResourceBase(msrest.serialization.Model): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -1201,9 +1207,9 @@ def __init__( :paramtype tags: dict[str, str] """ super(ResourceBase, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) + self.description = kwargs.get("description", None) + self.properties = kwargs.get("properties", None) + self.tags = kwargs.get("tags", None) class AssetBase(ResourceBase): @@ -1222,17 +1228,14 @@ class AssetBase(ResourceBase): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -1246,8 +1249,8 @@ def __init__( :paramtype is_archived: bool """ super(AssetBase, self).__init__(**kwargs) - self.is_anonymous = kwargs.get('is_anonymous', False) - self.is_archived = kwargs.get('is_archived', False) + self.is_anonymous = kwargs.get("is_anonymous", False) + self.is_archived = kwargs.get("is_archived", False) class AssetContainer(ResourceBase): @@ -1270,23 +1273,20 @@ class AssetContainer(ResourceBase): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -1298,7 +1298,7 @@ def __init__( :paramtype is_archived: bool """ super(AssetContainer, self).__init__(**kwargs) - self.is_archived = kwargs.get('is_archived', False) + self.is_archived = kwargs.get("is_archived", False) self.latest_version = None self.next_version = None @@ -1316,18 +1316,15 @@ class AssetJobInput(msrest.serialization.Model): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -1336,8 +1333,8 @@ def __init__( :paramtype uri: str """ super(AssetJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] class AssetJobOutput(msrest.serialization.Model): @@ -1350,14 +1347,11 @@ class AssetJobOutput(msrest.serialization.Model): """ _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -1365,8 +1359,8 @@ def __init__( :paramtype uri: str """ super(AssetJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) class AssetReferenceBase(msrest.serialization.Model): @@ -1383,23 +1377,23 @@ class AssetReferenceBase(msrest.serialization.Model): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, } _subtype_map = { - 'reference_type': {'DataPath': 'DataPathAssetReference', 'Id': 'IdAssetReference', 'OutputPath': 'OutputPathAssetReference'} + "reference_type": { + "DataPath": "DataPathAssetReference", + "Id": "IdAssetReference", + "OutputPath": "OutputPathAssetReference", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AssetReferenceBase, self).__init__(**kwargs) self.reference_type = None # type: Optional[str] @@ -1416,19 +1410,16 @@ class AssignedUser(msrest.serialization.Model): """ _validation = { - 'object_id': {'required': True}, - 'tenant_id': {'required': True}, + "object_id": {"required": True}, + "tenant_id": {"required": True}, } _attribute_map = { - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + "object_id": {"key": "objectId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword object_id: Required. User�s AAD Object Id. :paramtype object_id: str @@ -1436,8 +1427,8 @@ def __init__( :paramtype tenant_id: str """ super(AssignedUser, self).__init__(**kwargs) - self.object_id = kwargs['object_id'] - self.tenant_id = kwargs['tenant_id'] + self.object_id = kwargs["object_id"] + self.tenant_id = kwargs["tenant_id"] class ForecastHorizon(msrest.serialization.Model): @@ -1454,23 +1445,22 @@ class ForecastHorizon(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoForecastHorizon', 'Custom': 'CustomForecastHorizon'} + "mode": { + "Auto": "AutoForecastHorizon", + "Custom": "CustomForecastHorizon", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ForecastHorizon, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -1486,21 +1476,17 @@ class AutoForecastHorizon(ForecastHorizon): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoForecastHorizon, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class JobBaseProperties(ResourceBase): @@ -1547,33 +1533,35 @@ class JobBaseProperties(ResourceBase): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, + "job_type": {"required": True}, + "status": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, } _subtype_map = { - 'job_type': {'AutoML': 'AutoMLJob', 'Command': 'CommandJob', 'Pipeline': 'PipelineJob', 'Sweep': 'SweepJob'} + "job_type": { + "AutoML": "AutoMLJob", + "Command": "CommandJob", + "Pipeline": "PipelineJob", + "Sweep": "SweepJob", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -1601,102 +1589,102 @@ def __init__( :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] """ super(JobBaseProperties, self).__init__(**kwargs) - self.component_id = kwargs.get('component_id', None) - self.compute_id = kwargs.get('compute_id', None) - self.display_name = kwargs.get('display_name', None) - self.experiment_name = kwargs.get('experiment_name', "Default") - self.identity = kwargs.get('identity', None) - self.is_archived = kwargs.get('is_archived', False) - self.job_type = 'JobBaseProperties' # type: str - self.services = kwargs.get('services', None) + self.component_id = kwargs.get("component_id", None) + self.compute_id = kwargs.get("compute_id", None) + self.display_name = kwargs.get("display_name", None) + self.experiment_name = kwargs.get("experiment_name", "Default") + self.identity = kwargs.get("identity", None) + self.is_archived = kwargs.get("is_archived", False) + self.job_type = "JobBaseProperties" # type: str + self.services = kwargs.get("services", None) self.status = None class AutoMLJob(JobBaseProperties): """AutoMLJob class. -Use this class for executing AutoML tasks like Classification/Regression etc. -See TaskType enum for all the tasks supported. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Sweep", "Pipeline". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar environment_id: The ARM resource ID of the Environment specification for the job. - This is optional value to provide, if not provided, AutoML will default this to Production - AutoML curated environment version when running the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - :ivar task_details: Required. [Required] This represents scenario which can be one of - Tables/NLP/Image. - :vartype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical + Use this class for executing AutoML tasks like Classification/Regression etc. + See TaskType enum for all the tasks supported. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar description: The asset description text. + :vartype description: str + :ivar properties: The asset property dictionary. + :vartype properties: dict[str, str] + :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + :ivar component_id: ARM resource ID of the component resource. + :vartype component_id: str + :ivar compute_id: ARM resource ID of the compute resource. + :vartype compute_id: str + :ivar display_name: Display name of job. + :vartype display_name: str + :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is + placed in the "Default" experiment. + :vartype experiment_name: str + :ivar identity: Identity configuration. If set, this should be one of AmlToken, + ManagedIdentity, UserIdentity or null. + Defaults to AmlToken if null. + :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration + :ivar is_archived: Is the asset archived?. + :vartype is_archived: bool + :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. + Possible values include: "AutoML", "Command", "Sweep", "Pipeline". + :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType + :ivar services: List of JobEndpoints. + For local jobs, a job endpoint will have an endpoint value of FileStreamObject. + :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] + :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", + "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", + "Failed", "Canceled", "NotResponding", "Paused", "Unknown". + :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus + :ivar environment_id: The ARM resource ID of the Environment specification for the job. + This is optional value to provide, if not provided, AutoML will default this to Production + AutoML curated environment version when running the job. + :vartype environment_id: str + :ivar environment_variables: Environment variables included in the job. + :vartype environment_variables: dict[str, str] + :ivar outputs: Mapping of output data bindings used in the job. + :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] + :ivar resources: Compute Resource configuration for the job. + :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration + :ivar task_details: Required. [Required] This represents scenario which can be one of + Tables/NLP/Image. + :vartype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'task_details': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - 'task_details': {'key': 'taskDetails', 'type': 'AutoMLVertical'}, - } - - def __init__( - self, - **kwargs - ): + "job_type": {"required": True}, + "status": {"readonly": True}, + "task_details": {"required": True}, + } + + _attribute_map = { + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "resources": {"key": "resources", "type": "JobResourceConfiguration"}, + "task_details": {"key": "taskDetails", "type": "AutoMLVertical"}, + } + + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -1737,58 +1725,66 @@ def __init__( :paramtype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical """ super(AutoMLJob, self).__init__(**kwargs) - self.job_type = 'AutoML' # type: str - self.environment_id = kwargs.get('environment_id', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.outputs = kwargs.get('outputs', None) - self.resources = kwargs.get('resources', None) - self.task_details = kwargs['task_details'] + self.job_type = "AutoML" # type: str + self.environment_id = kwargs.get("environment_id", None) + self.environment_variables = kwargs.get("environment_variables", None) + self.outputs = kwargs.get("outputs", None) + self.resources = kwargs.get("resources", None) + self.task_details = kwargs["task_details"] class AutoMLVertical(msrest.serialization.Model): """AutoML vertical class. -Base class for AutoML verticals - TableVertical/ImageVertical/NLPVertical. + Base class for AutoML verticals - TableVertical/ImageVertical/NLPVertical. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Classification, Forecasting, ImageClassification, ImageClassificationMultilabel, ImageInstanceSegmentation, ImageObjectDetection, Regression, TextClassification, TextClassificationMultilabel, TextNer. + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Classification, Forecasting, ImageClassification, ImageClassificationMultilabel, ImageInstanceSegmentation, ImageObjectDetection, Regression, TextClassification, TextClassificationMultilabel, TextNer. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, + "task_type": {"required": True}, + "training_data": {"required": True}, } _attribute_map = { - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, } _subtype_map = { - 'task_type': {'Classification': 'Classification', 'Forecasting': 'Forecasting', 'ImageClassification': 'ImageClassification', 'ImageClassificationMultilabel': 'ImageClassificationMultilabel', 'ImageInstanceSegmentation': 'ImageInstanceSegmentation', 'ImageObjectDetection': 'ImageObjectDetection', 'Regression': 'Regression', 'TextClassification': 'TextClassification', 'TextClassificationMultilabel': 'TextClassificationMultilabel', 'TextNER': 'TextNer'} - } - - def __init__( - self, - **kwargs - ): + "task_type": { + "Classification": "Classification", + "Forecasting": "Forecasting", + "ImageClassification": "ImageClassification", + "ImageClassificationMultilabel": "ImageClassificationMultilabel", + "ImageInstanceSegmentation": "ImageInstanceSegmentation", + "ImageObjectDetection": "ImageObjectDetection", + "Regression": "Regression", + "TextClassification": "TextClassification", + "TextClassificationMultilabel": "TextClassificationMultilabel", + "TextNER": "TextNer", + } + } + + def __init__(self, **kwargs): """ :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", "Info", "Warning", "Error", "Critical". @@ -1800,10 +1796,10 @@ def __init__( :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ super(AutoMLVertical, self).__init__(**kwargs) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) self.task_type = None # type: Optional[str] - self.training_data = kwargs['training_data'] + self.training_data = kwargs["training_data"] class NCrossValidations(msrest.serialization.Model): @@ -1820,23 +1816,22 @@ class NCrossValidations(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoNCrossValidations', 'Custom': 'CustomNCrossValidations'} + "mode": { + "Auto": "AutoNCrossValidations", + "Custom": "CustomNCrossValidations", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NCrossValidations, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -1852,21 +1847,17 @@ class AutoNCrossValidations(NCrossValidations): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoNCrossValidations, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class AutoPauseProperties(msrest.serialization.Model): @@ -1879,14 +1870,11 @@ class AutoPauseProperties(msrest.serialization.Model): """ _attribute_map = { - 'delay_in_minutes': {'key': 'delayInMinutes', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, + "delay_in_minutes": {"key": "delayInMinutes", "type": "int"}, + "enabled": {"key": "enabled", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword delay_in_minutes: :paramtype delay_in_minutes: int @@ -1894,8 +1882,8 @@ def __init__( :paramtype enabled: bool """ super(AutoPauseProperties, self).__init__(**kwargs) - self.delay_in_minutes = kwargs.get('delay_in_minutes', None) - self.enabled = kwargs.get('enabled', None) + self.delay_in_minutes = kwargs.get("delay_in_minutes", None) + self.enabled = kwargs.get("enabled", None) class AutoScaleProperties(msrest.serialization.Model): @@ -1910,15 +1898,12 @@ class AutoScaleProperties(msrest.serialization.Model): """ _attribute_map = { - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, + "min_node_count": {"key": "minNodeCount", "type": "int"}, + "enabled": {"key": "enabled", "type": "bool"}, + "max_node_count": {"key": "maxNodeCount", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword min_node_count: :paramtype min_node_count: int @@ -1928,9 +1913,9 @@ def __init__( :paramtype max_node_count: int """ super(AutoScaleProperties, self).__init__(**kwargs) - self.min_node_count = kwargs.get('min_node_count', None) - self.enabled = kwargs.get('enabled', None) - self.max_node_count = kwargs.get('max_node_count', None) + self.min_node_count = kwargs.get("min_node_count", None) + self.enabled = kwargs.get("enabled", None) + self.max_node_count = kwargs.get("max_node_count", None) class Seasonality(msrest.serialization.Model): @@ -1947,23 +1932,19 @@ class Seasonality(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoSeasonality', 'Custom': 'CustomSeasonality'} + "mode": {"Auto": "AutoSeasonality", "Custom": "CustomSeasonality"} } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Seasonality, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -1979,21 +1960,17 @@ class AutoSeasonality(Seasonality): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoSeasonality, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class TargetLags(msrest.serialization.Model): @@ -2010,23 +1987,19 @@ class TargetLags(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoTargetLags', 'Custom': 'CustomTargetLags'} + "mode": {"Auto": "AutoTargetLags", "Custom": "CustomTargetLags"} } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(TargetLags, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -2042,21 +2015,17 @@ class AutoTargetLags(TargetLags): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoTargetLags, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class TargetRollingWindowSize(msrest.serialization.Model): @@ -2073,23 +2042,22 @@ class TargetRollingWindowSize(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoTargetRollingWindowSize', 'Custom': 'CustomTargetRollingWindowSize'} + "mode": { + "Auto": "AutoTargetRollingWindowSize", + "Custom": "CustomTargetRollingWindowSize", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(TargetRollingWindowSize, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -2105,21 +2073,17 @@ class AutoTargetRollingWindowSize(TargetRollingWindowSize): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class DatastoreProperties(ResourceBase): @@ -2150,28 +2114,30 @@ class DatastoreProperties(ResourceBase): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, } _subtype_map = { - 'datastore_type': {'AzureBlob': 'AzureBlobDatastore', 'AzureDataLakeGen1': 'AzureDataLakeGen1Datastore', 'AzureDataLakeGen2': 'AzureDataLakeGen2Datastore', 'AzureFile': 'AzureFileDatastore'} + "datastore_type": { + "AzureBlob": "AzureBlobDatastore", + "AzureDataLakeGen1": "AzureDataLakeGen1Datastore", + "AzureDataLakeGen2": "AzureDataLakeGen2Datastore", + "AzureFile": "AzureFileDatastore", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -2183,8 +2149,8 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials """ super(DatastoreProperties, self).__init__(**kwargs) - self.credentials = kwargs['credentials'] - self.datastore_type = 'DatastoreProperties' # type: str + self.credentials = kwargs["credentials"] + self.datastore_type = "DatastoreProperties" # type: str self.is_default = None @@ -2226,29 +2192,29 @@ class AzureBlobDatastore(DatastoreProperties): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "account_name": {"key": "accountName", "type": "str"}, + "container_name": {"key": "containerName", "type": "str"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -2273,12 +2239,14 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ super(AzureBlobDatastore, self).__init__(**kwargs) - self.datastore_type = 'AzureBlob' # type: str - self.account_name = kwargs.get('account_name', None) - self.container_name = kwargs.get('container_name', None) - self.endpoint = kwargs.get('endpoint', None) - self.protocol = kwargs.get('protocol', None) - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) + self.datastore_type = "AzureBlob" # type: str + self.account_name = kwargs.get("account_name", None) + self.container_name = kwargs.get("container_name", None) + self.endpoint = kwargs.get("endpoint", None) + self.protocol = kwargs.get("protocol", None) + self.service_data_access_auth_identity = kwargs.get( + "service_data_access_auth_identity", None + ) class AzureDataLakeGen1Datastore(DatastoreProperties): @@ -2313,27 +2281,27 @@ class AzureDataLakeGen1Datastore(DatastoreProperties): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'store_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "store_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - 'store_name': {'key': 'storeName', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, + "store_name": {"key": "storeName", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -2352,9 +2320,11 @@ def __init__( :paramtype store_name: str """ super(AzureDataLakeGen1Datastore, self).__init__(**kwargs) - self.datastore_type = 'AzureDataLakeGen1' # type: str - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) - self.store_name = kwargs['store_name'] + self.datastore_type = "AzureDataLakeGen1" # type: str + self.service_data_access_auth_identity = kwargs.get( + "service_data_access_auth_identity", None + ) + self.store_name = kwargs["store_name"] class AzureDataLakeGen2Datastore(DatastoreProperties): @@ -2395,31 +2365,31 @@ class AzureDataLakeGen2Datastore(DatastoreProperties): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'filesystem': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "account_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "filesystem": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'filesystem': {'key': 'filesystem', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "account_name": {"key": "accountName", "type": "str"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "filesystem": {"key": "filesystem", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -2444,12 +2414,14 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ super(AzureDataLakeGen2Datastore, self).__init__(**kwargs) - self.datastore_type = 'AzureDataLakeGen2' # type: str - self.account_name = kwargs['account_name'] - self.endpoint = kwargs.get('endpoint', None) - self.filesystem = kwargs['filesystem'] - self.protocol = kwargs.get('protocol', None) - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) + self.datastore_type = "AzureDataLakeGen2" # type: str + self.account_name = kwargs["account_name"] + self.endpoint = kwargs.get("endpoint", None) + self.filesystem = kwargs["filesystem"] + self.protocol = kwargs.get("protocol", None) + self.service_data_access_auth_identity = kwargs.get( + "service_data_access_auth_identity", None + ) class AzureFileDatastore(DatastoreProperties): @@ -2491,31 +2463,31 @@ class AzureFileDatastore(DatastoreProperties): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'file_share_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "account_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "file_share_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'file_share_name': {'key': 'fileShareName', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "account_name": {"key": "accountName", "type": "str"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "file_share_name": {"key": "fileShareName", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -2541,12 +2513,14 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ super(AzureFileDatastore, self).__init__(**kwargs) - self.datastore_type = 'AzureFile' # type: str - self.account_name = kwargs['account_name'] - self.endpoint = kwargs.get('endpoint', None) - self.file_share_name = kwargs['file_share_name'] - self.protocol = kwargs.get('protocol', None) - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) + self.datastore_type = "AzureFile" # type: str + self.account_name = kwargs["account_name"] + self.endpoint = kwargs.get("endpoint", None) + self.file_share_name = kwargs["file_share_name"] + self.protocol = kwargs.get("protocol", None) + self.service_data_access_auth_identity = kwargs.get( + "service_data_access_auth_identity", None + ) class EarlyTerminationPolicy(msrest.serialization.Model): @@ -2568,23 +2542,24 @@ class EarlyTerminationPolicy(msrest.serialization.Model): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, } _subtype_map = { - 'policy_type': {'Bandit': 'BanditPolicy', 'MedianStopping': 'MedianStoppingPolicy', 'TruncationSelection': 'TruncationSelectionPolicy'} + "policy_type": { + "Bandit": "BanditPolicy", + "MedianStopping": "MedianStoppingPolicy", + "TruncationSelection": "TruncationSelectionPolicy", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. :paramtype delay_evaluation: int @@ -2592,8 +2567,8 @@ def __init__( :paramtype evaluation_interval: int """ super(EarlyTerminationPolicy, self).__init__(**kwargs) - self.delay_evaluation = kwargs.get('delay_evaluation', 0) - self.evaluation_interval = kwargs.get('evaluation_interval', 0) + self.delay_evaluation = kwargs.get("delay_evaluation", 0) + self.evaluation_interval = kwargs.get("evaluation_interval", 0) self.policy_type = None # type: Optional[str] @@ -2617,21 +2592,18 @@ class BanditPolicy(EarlyTerminationPolicy): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'slack_amount': {'key': 'slackAmount', 'type': 'float'}, - 'slack_factor': {'key': 'slackFactor', 'type': 'float'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, + "slack_amount": {"key": "slackAmount", "type": "float"}, + "slack_factor": {"key": "slackFactor", "type": "float"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. :paramtype delay_evaluation: int @@ -2643,9 +2615,9 @@ def __init__( :paramtype slack_factor: float """ super(BanditPolicy, self).__init__(**kwargs) - self.policy_type = 'Bandit' # type: str - self.slack_amount = kwargs.get('slack_amount', 0) - self.slack_factor = kwargs.get('slack_factor', 0) + self.policy_type = "Bandit" # type: str + self.slack_amount = kwargs.get("slack_amount", 0) + self.slack_factor = kwargs.get("slack_factor", 0) class Resource(msrest.serialization.Model): @@ -2667,25 +2639,21 @@ class Resource(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -2718,26 +2686,23 @@ class TrackedResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -2745,8 +2710,8 @@ def __init__( :paramtype location: str """ super(TrackedResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.location = kwargs['location'] + self.tags = kwargs.get("tags", None) + self.location = kwargs["location"] class BatchDeployment(TrackedResource): @@ -2783,31 +2748,31 @@ class BatchDeployment(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchDeploymentProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": { + "key": "properties", + "type": "BatchDeploymentProperties", + }, + "sku": {"key": "sku", "type": "Sku"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -2824,10 +2789,10 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ super(BatchDeployment, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) + self.identity = kwargs.get("identity", None) + self.kind = kwargs.get("kind", None) + self.properties = kwargs["properties"] + self.sku = kwargs.get("sku", None) class EndpointDeploymentPropertiesBase(msrest.serialization.Model): @@ -2847,17 +2812,20 @@ class EndpointDeploymentPropertiesBase(msrest.serialization.Model): """ _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword code_configuration: Code configuration for the endpoint deployment. :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration @@ -2872,11 +2840,11 @@ def __init__( :paramtype properties: dict[str, str] """ super(EndpointDeploymentPropertiesBase, self).__init__(**kwargs) - self.code_configuration = kwargs.get('code_configuration', None) - self.description = kwargs.get('description', None) - self.environment_id = kwargs.get('environment_id', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.properties = kwargs.get('properties', None) + self.code_configuration = kwargs.get("code_configuration", None) + self.description = kwargs.get("description", None) + self.environment_id = kwargs.get("environment_id", None) + self.environment_variables = kwargs.get("environment_variables", None) + self.properties = kwargs.get("properties", None) class BatchDeploymentProperties(EndpointDeploymentPropertiesBase): @@ -2933,32 +2901,44 @@ class BatchDeploymentProperties(EndpointDeploymentPropertiesBase): """ _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'error_threshold': {'key': 'errorThreshold', 'type': 'int'}, - 'logging_level': {'key': 'loggingLevel', 'type': 'str'}, - 'max_concurrency_per_instance': {'key': 'maxConcurrencyPerInstance', 'type': 'int'}, - 'mini_batch_size': {'key': 'miniBatchSize', 'type': 'long'}, - 'model': {'key': 'model', 'type': 'AssetReferenceBase'}, - 'output_action': {'key': 'outputAction', 'type': 'str'}, - 'output_file_name': {'key': 'outputFileName', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'resources': {'key': 'resources', 'type': 'DeploymentResourceConfiguration'}, - 'retry_settings': {'key': 'retrySettings', 'type': 'BatchRetrySettings'}, - } - - def __init__( - self, - **kwargs - ): + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "compute": {"key": "compute", "type": "str"}, + "error_threshold": {"key": "errorThreshold", "type": "int"}, + "logging_level": {"key": "loggingLevel", "type": "str"}, + "max_concurrency_per_instance": { + "key": "maxConcurrencyPerInstance", + "type": "int", + }, + "mini_batch_size": {"key": "miniBatchSize", "type": "long"}, + "model": {"key": "model", "type": "AssetReferenceBase"}, + "output_action": {"key": "outputAction", "type": "str"}, + "output_file_name": {"key": "outputFileName", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "resources": { + "key": "resources", + "type": "DeploymentResourceConfiguration", + }, + "retry_settings": { + "key": "retrySettings", + "type": "BatchRetrySettings", + }, + } + + def __init__(self, **kwargs): """ :keyword code_configuration: Code configuration for the endpoint deployment. :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration @@ -3005,20 +2985,26 @@ def __init__( :paramtype retry_settings: ~azure.mgmt.machinelearningservices.models.BatchRetrySettings """ super(BatchDeploymentProperties, self).__init__(**kwargs) - self.compute = kwargs.get('compute', None) - self.error_threshold = kwargs.get('error_threshold', -1) - self.logging_level = kwargs.get('logging_level', None) - self.max_concurrency_per_instance = kwargs.get('max_concurrency_per_instance', 1) - self.mini_batch_size = kwargs.get('mini_batch_size', 10) - self.model = kwargs.get('model', None) - self.output_action = kwargs.get('output_action', None) - self.output_file_name = kwargs.get('output_file_name', "predictions.csv") + self.compute = kwargs.get("compute", None) + self.error_threshold = kwargs.get("error_threshold", -1) + self.logging_level = kwargs.get("logging_level", None) + self.max_concurrency_per_instance = kwargs.get( + "max_concurrency_per_instance", 1 + ) + self.mini_batch_size = kwargs.get("mini_batch_size", 10) + self.model = kwargs.get("model", None) + self.output_action = kwargs.get("output_action", None) + self.output_file_name = kwargs.get( + "output_file_name", "predictions.csv" + ) self.provisioning_state = None - self.resources = kwargs.get('resources', None) - self.retry_settings = kwargs.get('retry_settings', None) + self.resources = kwargs.get("resources", None) + self.retry_settings = kwargs.get("retry_settings", None) -class BatchDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class BatchDeploymentTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of BatchDeployment entities. :ivar next_link: The link to the next page of BatchDeployment objects. If null, there are no @@ -3029,14 +3015,11 @@ class BatchDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Mode """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchDeployment]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[BatchDeployment]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of BatchDeployment objects. If null, there are no additional pages. @@ -3044,9 +3027,11 @@ def __init__( :keyword value: An array of objects of type BatchDeployment. :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchDeployment] """ - super(BatchDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(BatchDeploymentTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class BatchEndpoint(TrackedResource): @@ -3083,31 +3068,28 @@ class BatchEndpoint(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": {"key": "properties", "type": "BatchEndpointProperties"}, + "sku": {"key": "sku", "type": "Sku"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -3124,10 +3106,10 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ super(BatchEndpoint, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) + self.identity = kwargs.get("identity", None) + self.kind = kwargs.get("kind", None) + self.properties = kwargs["properties"] + self.sku = kwargs.get("sku", None) class BatchEndpointDefaults(msrest.serialization.Model): @@ -3139,20 +3121,17 @@ class BatchEndpointDefaults(msrest.serialization.Model): """ _attribute_map = { - 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, + "deployment_name": {"key": "deploymentName", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword deployment_name: Name of the deployment that will be default for the endpoint. This deployment will end up getting 100% traffic when the endpoint scoring URL is invoked. :paramtype deployment_name: str """ super(BatchEndpointDefaults, self).__init__(**kwargs) - self.deployment_name = kwargs.get('deployment_name', None) + self.deployment_name = kwargs.get("deployment_name", None) class EndpointPropertiesBase(msrest.serialization.Model): @@ -3181,24 +3160,21 @@ class EndpointPropertiesBase(msrest.serialization.Model): """ _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, + "auth_mode": {"required": True}, + "scoring_uri": {"readonly": True}, + "swagger_uri": {"readonly": True}, } _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, + "auth_mode": {"key": "authMode", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "keys": {"key": "keys", "type": "EndpointAuthKeys"}, + "properties": {"key": "properties", "type": "{str}"}, + "scoring_uri": {"key": "scoringUri", "type": "str"}, + "swagger_uri": {"key": "swaggerUri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' @@ -3214,10 +3190,10 @@ def __init__( :paramtype properties: dict[str, str] """ super(EndpointPropertiesBase, self).__init__(**kwargs) - self.auth_mode = kwargs['auth_mode'] - self.description = kwargs.get('description', None) - self.keys = kwargs.get('keys', None) - self.properties = kwargs.get('properties', None) + self.auth_mode = kwargs["auth_mode"] + self.description = kwargs.get("description", None) + self.keys = kwargs.get("keys", None) + self.properties = kwargs.get("properties", None) self.scoring_uri = None self.swagger_uri = None @@ -3254,27 +3230,24 @@ class BatchEndpointProperties(EndpointPropertiesBase): """ _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "auth_mode": {"required": True}, + "scoring_uri": {"readonly": True}, + "swagger_uri": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'defaults': {'key': 'defaults', 'type': 'BatchEndpointDefaults'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "auth_mode": {"key": "authMode", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "keys": {"key": "keys", "type": "EndpointAuthKeys"}, + "properties": {"key": "properties", "type": "{str}"}, + "scoring_uri": {"key": "scoringUri", "type": "str"}, + "swagger_uri": {"key": "swaggerUri", "type": "str"}, + "defaults": {"key": "defaults", "type": "BatchEndpointDefaults"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' @@ -3292,11 +3265,13 @@ def __init__( :paramtype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults """ super(BatchEndpointProperties, self).__init__(**kwargs) - self.defaults = kwargs.get('defaults', None) + self.defaults = kwargs.get("defaults", None) self.provisioning_state = None -class BatchEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class BatchEndpointTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of BatchEndpoint entities. :ivar next_link: The link to the next page of BatchEndpoint objects. If null, there are no @@ -3307,14 +3282,11 @@ class BatchEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model) """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchEndpoint]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[BatchEndpoint]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of BatchEndpoint objects. If null, there are no additional pages. @@ -3322,9 +3294,11 @@ def __init__( :keyword value: An array of objects of type BatchEndpoint. :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchEndpoint] """ - super(BatchEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(BatchEndpointTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class BatchRetrySettings(msrest.serialization.Model): @@ -3337,14 +3311,11 @@ class BatchRetrySettings(msrest.serialization.Model): """ _attribute_map = { - 'max_retries': {'key': 'maxRetries', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "max_retries": {"key": "maxRetries", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword max_retries: Maximum retry count for a mini-batch. :paramtype max_retries: int @@ -3352,44 +3323,47 @@ def __init__( :paramtype timeout: ~datetime.timedelta """ super(BatchRetrySettings, self).__init__(**kwargs) - self.max_retries = kwargs.get('max_retries', 3) - self.timeout = kwargs.get('timeout', "PT30S") + self.max_retries = kwargs.get("max_retries", 3) + self.timeout = kwargs.get("timeout", "PT30S") class SamplingAlgorithm(msrest.serialization.Model): """The Sampling Algorithm used to generate hyperparameter values, along with properties to -configure the algorithm. + configure the algorithm. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BayesianSamplingAlgorithm, GridSamplingAlgorithm, RandomSamplingAlgorithm. + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: BayesianSamplingAlgorithm, GridSamplingAlgorithm, RandomSamplingAlgorithm. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType + :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating + hyperparameter values, along with configuration properties.Constant filled by server. Possible + values include: "Grid", "Random", "Bayesian". + :vartype sampling_algorithm_type: str or + ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } _subtype_map = { - 'sampling_algorithm_type': {'Bayesian': 'BayesianSamplingAlgorithm', 'Grid': 'GridSamplingAlgorithm', 'Random': 'RandomSamplingAlgorithm'} + "sampling_algorithm_type": { + "Bayesian": "BayesianSamplingAlgorithm", + "Grid": "GridSamplingAlgorithm", + "Random": "RandomSamplingAlgorithm", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(SamplingAlgorithm, self).__init__(**kwargs) self.sampling_algorithm_type = None # type: Optional[str] @@ -3407,21 +3381,20 @@ class BayesianSamplingAlgorithm(SamplingAlgorithm): """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(BayesianSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Bayesian' # type: str + self.sampling_algorithm_type = "Bayesian" # type: str class BuildContext(msrest.serialization.Model): @@ -3431,56 +3404,53 @@ class BuildContext(msrest.serialization.Model): :ivar context_uri: Required. [Required] URI of the Docker build context used to build the image. Supports blob URIs on environment creation and may return blob or Git URIs. - - + + .. raw:: html - + . :vartype context_uri: str :ivar dockerfile_path: Path to the Dockerfile in the build context. - - + + .. raw:: html - + . :vartype dockerfile_path: str """ _validation = { - 'context_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "context_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'context_uri': {'key': 'contextUri', 'type': 'str'}, - 'dockerfile_path': {'key': 'dockerfilePath', 'type': 'str'}, + "context_uri": {"key": "contextUri", "type": "str"}, + "dockerfile_path": {"key": "dockerfilePath", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword context_uri: Required. [Required] URI of the Docker build context used to build the image. Supports blob URIs on environment creation and may return blob or Git URIs. - - + + .. raw:: html - + . :paramtype context_uri: str :keyword dockerfile_path: Path to the Dockerfile in the build context. - - + + .. raw:: html - + . :paramtype dockerfile_path: str """ super(BuildContext, self).__init__(**kwargs) - self.context_uri = kwargs['context_uri'] - self.dockerfile_path = kwargs.get('dockerfile_path', "Dockerfile") + self.context_uri = kwargs["context_uri"] + self.dockerfile_path = kwargs.get("dockerfile_path", "Dockerfile") class CertificateDatastoreCredentials(DatastoreCredentials): @@ -3507,27 +3477,24 @@ class CertificateDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, - 'thumbprint': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials_type": {"required": True}, + "client_id": {"required": True}, + "secrets": {"required": True}, + "tenant_id": {"required": True}, + "thumbprint": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'CertificateDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "authority_url": {"key": "authorityUrl", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + "resource_url": {"key": "resourceUrl", "type": "str"}, + "secrets": {"key": "secrets", "type": "CertificateDatastoreSecrets"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "thumbprint": {"key": "thumbprint", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword authority_url: Authority URL used for authentication. :paramtype authority_url: str @@ -3545,13 +3512,13 @@ def __init__( :paramtype thumbprint: str """ super(CertificateDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Certificate' # type: str - self.authority_url = kwargs.get('authority_url', None) - self.client_id = kwargs['client_id'] - self.resource_url = kwargs.get('resource_url', None) - self.secrets = kwargs['secrets'] - self.tenant_id = kwargs['tenant_id'] - self.thumbprint = kwargs['thumbprint'] + self.credentials_type = "Certificate" # type: str + self.authority_url = kwargs.get("authority_url", None) + self.client_id = kwargs["client_id"] + self.resource_url = kwargs.get("resource_url", None) + self.secrets = kwargs["secrets"] + self.tenant_id = kwargs["tenant_id"] + self.thumbprint = kwargs["thumbprint"] class CertificateDatastoreSecrets(DatastoreSecrets): @@ -3568,25 +3535,22 @@ class CertificateDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'certificate': {'key': 'certificate', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "certificate": {"key": "certificate", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword certificate: Service principal certificate. :paramtype certificate: str """ super(CertificateDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Certificate' # type: str - self.certificate = kwargs.get('certificate', None) + self.secrets_type = "Certificate" # type: str + self.certificate = kwargs.get("certificate", None) class TableVertical(msrest.serialization.Model): @@ -3622,21 +3586,33 @@ class TableVertical(msrest.serialization.Model): """ _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "test_data": {"key": "testData", "type": "MLTableJobInput"}, + "test_data_size": {"key": "testDataSize", "type": "float"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "weight_column_name": {"key": "weightColumnName", "type": "str"}, + } + + def __init__(self, **kwargs): """ :keyword cv_split_column_names: Columns to use for CVSplit data. :paramtype cv_split_column_names: list[str] @@ -3669,15 +3645,17 @@ def __init__( :paramtype weight_column_name: str """ super(TableVertical, self).__init__(**kwargs) - self.cv_split_column_names = kwargs.get('cv_split_column_names', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.test_data = kwargs.get('test_data', None) - self.test_data_size = kwargs.get('test_data_size', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.weight_column_name = kwargs.get('weight_column_name', None) + self.cv_split_column_names = kwargs.get("cv_split_column_names", None) + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.limit_settings = kwargs.get("limit_settings", None) + self.n_cross_validations = kwargs.get("n_cross_validations", None) + self.test_data = kwargs.get("test_data", None) + self.test_data_size = kwargs.get("test_data_size", None) + self.validation_data = kwargs.get("validation_data", None) + self.validation_data_size = kwargs.get("validation_data_size", None) + self.weight_column_name = kwargs.get("weight_column_name", None) class Classification(AutoMLVertical, TableVertical): @@ -3737,33 +3715,48 @@ class Classification(AutoMLVertical, TableVertical): """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'positive_label': {'key': 'positiveLabel', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'ClassificationTrainingSettings'}, - } - - def __init__( - self, - **kwargs - ): + "task_type": {"required": True}, + "training_data": {"required": True}, + } + + _attribute_map = { + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "test_data": {"key": "testData", "type": "MLTableJobInput"}, + "test_data_size": {"key": "testDataSize", "type": "float"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "weight_column_name": {"key": "weightColumnName", "type": "str"}, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "positive_label": {"key": "positiveLabel", "type": "str"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, + "training_settings": { + "key": "trainingSettings", + "type": "ClassificationTrainingSettings", + }, + } + + def __init__(self, **kwargs): """ :keyword cv_split_column_names: Columns to use for CVSplit data. :paramtype cv_split_column_names: list[str] @@ -3813,22 +3806,24 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ClassificationTrainingSettings """ super(Classification, self).__init__(**kwargs) - self.cv_split_column_names = kwargs.get('cv_split_column_names', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.test_data = kwargs.get('test_data', None) - self.test_data_size = kwargs.get('test_data_size', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.weight_column_name = kwargs.get('weight_column_name', None) - self.task_type = 'Classification' # type: str - self.positive_label = kwargs.get('positive_label', None) - self.primary_metric = kwargs.get('primary_metric', None) - self.training_settings = kwargs.get('training_settings', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.cv_split_column_names = kwargs.get("cv_split_column_names", None) + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.limit_settings = kwargs.get("limit_settings", None) + self.n_cross_validations = kwargs.get("n_cross_validations", None) + self.test_data = kwargs.get("test_data", None) + self.test_data_size = kwargs.get("test_data_size", None) + self.validation_data = kwargs.get("validation_data", None) + self.validation_data_size = kwargs.get("validation_data_size", None) + self.weight_column_name = kwargs.get("weight_column_name", None) + self.task_type = "Classification" # type: str + self.positive_label = kwargs.get("positive_label", None) + self.primary_metric = kwargs.get("primary_metric", None) + self.training_settings = kwargs.get("training_settings", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class TrainingSettings(msrest.serialization.Model): @@ -3854,19 +3849,31 @@ class TrainingSettings(msrest.serialization.Model): """ _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - } - - def __init__( - self, - **kwargs - ): + "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, + "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, + } + + def __init__(self, **kwargs): """ :keyword enable_dnn_training: Enable recommendation of DNN models. :paramtype enable_dnn_training: bool @@ -3887,13 +3894,21 @@ def __init__( ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings """ super(TrainingSettings, self).__init__(**kwargs) - self.enable_dnn_training = kwargs.get('enable_dnn_training', False) - self.enable_model_explainability = kwargs.get('enable_model_explainability', True) - self.enable_onnx_compatible_models = kwargs.get('enable_onnx_compatible_models', False) - self.enable_stack_ensemble = kwargs.get('enable_stack_ensemble', True) - self.enable_vote_ensemble = kwargs.get('enable_vote_ensemble', True) - self.ensemble_model_download_timeout = kwargs.get('ensemble_model_download_timeout', "PT5M") - self.stack_ensemble_settings = kwargs.get('stack_ensemble_settings', None) + self.enable_dnn_training = kwargs.get("enable_dnn_training", False) + self.enable_model_explainability = kwargs.get( + "enable_model_explainability", True + ) + self.enable_onnx_compatible_models = kwargs.get( + "enable_onnx_compatible_models", False + ) + self.enable_stack_ensemble = kwargs.get("enable_stack_ensemble", True) + self.enable_vote_ensemble = kwargs.get("enable_vote_ensemble", True) + self.ensemble_model_download_timeout = kwargs.get( + "ensemble_model_download_timeout", "PT5M" + ) + self.stack_ensemble_settings = kwargs.get( + "stack_ensemble_settings", None + ) class ClassificationTrainingSettings(TrainingSettings): @@ -3925,21 +3940,39 @@ class ClassificationTrainingSettings(TrainingSettings): """ _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): + "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, + "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, + "allowed_training_algorithms": { + "key": "allowedTrainingAlgorithms", + "type": "[str]", + }, + "blocked_training_algorithms": { + "key": "blockedTrainingAlgorithms", + "type": "[str]", + }, + } + + def __init__(self, **kwargs): """ :keyword enable_dnn_training: Enable recommendation of DNN models. :paramtype enable_dnn_training: bool @@ -3966,8 +3999,12 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ClassificationModels] """ super(ClassificationTrainingSettings, self).__init__(**kwargs) - self.allowed_training_algorithms = kwargs.get('allowed_training_algorithms', None) - self.blocked_training_algorithms = kwargs.get('blocked_training_algorithms', None) + self.allowed_training_algorithms = kwargs.get( + "allowed_training_algorithms", None + ) + self.blocked_training_algorithms = kwargs.get( + "blocked_training_algorithms", None + ) class ClusterUpdateParameters(msrest.serialization.Model): @@ -3978,19 +4015,19 @@ class ClusterUpdateParameters(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties.properties', 'type': 'ScaleSettingsInformation'}, + "properties": { + "key": "properties.properties", + "type": "ScaleSettingsInformation", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of ClusterUpdate. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ScaleSettingsInformation """ super(ClusterUpdateParameters, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class CodeConfiguration(msrest.serialization.Model): @@ -4005,18 +4042,19 @@ class CodeConfiguration(msrest.serialization.Model): """ _validation = { - 'scoring_script': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "scoring_script": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'scoring_script': {'key': 'scoringScript', 'type': 'str'}, + "code_id": {"key": "codeId", "type": "str"}, + "scoring_script": {"key": "scoringScript", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword code_id: ARM resource ID of the code asset. :paramtype code_id: str @@ -4024,8 +4062,8 @@ def __init__( :paramtype scoring_script: str """ super(CodeConfiguration, self).__init__(**kwargs) - self.code_id = kwargs.get('code_id', None) - self.scoring_script = kwargs['scoring_script'] + self.code_id = kwargs.get("code_id", None) + self.scoring_script = kwargs["scoring_script"] class CodeContainer(Resource): @@ -4051,31 +4089,28 @@ class CodeContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "CodeContainerProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeContainerProperties """ super(CodeContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class CodeContainerProperties(AssetContainer): @@ -4098,23 +4133,20 @@ class CodeContainerProperties(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -4139,14 +4171,11 @@ class CodeContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[CodeContainer]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of CodeContainer objects. If null, there are no additional pages. @@ -4155,8 +4184,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.CodeContainer] """ super(CodeContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class CodeVersion(Resource): @@ -4182,31 +4211,28 @@ class CodeVersion(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeVersionProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "CodeVersionProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeVersionProperties """ super(CodeVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class CodeVersionProperties(AssetBase): @@ -4227,18 +4253,15 @@ class CodeVersionProperties(AssetBase): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'code_uri': {'key': 'codeUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "code_uri": {"key": "codeUri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -4254,7 +4277,7 @@ def __init__( :paramtype code_uri: str """ super(CodeVersionProperties, self).__init__(**kwargs) - self.code_uri = kwargs.get('code_uri', None) + self.code_uri = kwargs.get("code_uri", None) class CodeVersionResourceArmPaginatedResult(msrest.serialization.Model): @@ -4268,14 +4291,11 @@ class CodeVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeVersion]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[CodeVersion]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of CodeVersion objects. If null, there are no additional pages. @@ -4284,8 +4304,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.CodeVersion] """ super(CodeVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class ColumnTransformer(msrest.serialization.Model): @@ -4299,14 +4319,11 @@ class ColumnTransformer(msrest.serialization.Model): """ _attribute_map = { - 'fields': {'key': 'fields', 'type': '[str]'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, + "fields": {"key": "fields", "type": "[str]"}, + "parameters": {"key": "parameters", "type": "object"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword fields: Fields to apply transformer logic on. :paramtype fields: list[str] @@ -4315,8 +4332,8 @@ def __init__( :paramtype parameters: any """ super(ColumnTransformer, self).__init__(**kwargs) - self.fields = kwargs.get('fields', None) - self.parameters = kwargs.get('parameters', None) + self.fields = kwargs.get("fields", None) + self.parameters = kwargs.get("parameters", None) class CommandJob(JobBaseProperties): @@ -4383,42 +4400,49 @@ class CommandJob(JobBaseProperties): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'parameters': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'CommandJobLimits'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - } - - def __init__( - self, - **kwargs - ): + "job_type": {"required": True}, + "status": {"readonly": True}, + "command": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "environment_id": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "parameters": {"readonly": True}, + } + + _attribute_map = { + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "code_id": {"key": "codeId", "type": "str"}, + "command": {"key": "command", "type": "str"}, + "distribution": { + "key": "distribution", + "type": "DistributionConfiguration", + }, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "limits": {"key": "limits", "type": "CommandJobLimits"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "parameters": {"key": "parameters", "type": "object"}, + "resources": {"key": "resources", "type": "JobResourceConfiguration"}, + } + + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -4467,17 +4491,17 @@ def __init__( :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration """ super(CommandJob, self).__init__(**kwargs) - self.job_type = 'Command' # type: str - self.code_id = kwargs.get('code_id', None) - self.command = kwargs['command'] - self.distribution = kwargs.get('distribution', None) - self.environment_id = kwargs['environment_id'] - self.environment_variables = kwargs.get('environment_variables', None) - self.inputs = kwargs.get('inputs', None) - self.limits = kwargs.get('limits', None) - self.outputs = kwargs.get('outputs', None) + self.job_type = "Command" # type: str + self.code_id = kwargs.get("code_id", None) + self.command = kwargs["command"] + self.distribution = kwargs.get("distribution", None) + self.environment_id = kwargs["environment_id"] + self.environment_variables = kwargs.get("environment_variables", None) + self.inputs = kwargs.get("inputs", None) + self.limits = kwargs.get("limits", None) + self.outputs = kwargs.get("outputs", None) self.parameters = None - self.resources = kwargs.get('resources', None) + self.resources = kwargs.get("resources", None) class JobLimits(msrest.serialization.Model): @@ -4497,22 +4521,22 @@ class JobLimits(msrest.serialization.Model): """ _validation = { - 'job_limits_type': {'required': True}, + "job_limits_type": {"required": True}, } _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "job_limits_type": {"key": "jobLimitsType", "type": "str"}, + "timeout": {"key": "timeout", "type": "duration"}, } _subtype_map = { - 'job_limits_type': {'Command': 'CommandJobLimits', 'Sweep': 'SweepJobLimits'} + "job_limits_type": { + "Command": "CommandJobLimits", + "Sweep": "SweepJobLimits", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. Only supports duration with precision as low as Seconds. @@ -4520,7 +4544,7 @@ def __init__( """ super(JobLimits, self).__init__(**kwargs) self.job_limits_type = None # type: Optional[str] - self.timeout = kwargs.get('timeout', None) + self.timeout = kwargs.get("timeout", None) class CommandJobLimits(JobLimits): @@ -4537,25 +4561,22 @@ class CommandJobLimits(JobLimits): """ _validation = { - 'job_limits_type': {'required': True}, + "job_limits_type": {"required": True}, } _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "job_limits_type": {"key": "jobLimitsType", "type": "str"}, + "timeout": {"key": "timeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. Only supports duration with precision as low as Seconds. :paramtype timeout: ~datetime.timedelta """ super(CommandJobLimits, self).__init__(**kwargs) - self.job_limits_type = 'Command' # type: str + self.job_limits_type = "Command" # type: str class ComponentContainer(Resource): @@ -4581,75 +4602,72 @@ class ComponentContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "ComponentContainerProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentContainerProperties """ super(ComponentContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class ComponentContainerProperties(AssetContainer): """Component container definition. -.. raw:: html + .. raw:: html - . + . - Variables are only populated by the server, and will be ignored when sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str + :ivar description: The asset description text. + :vartype description: str + :ivar properties: The asset property dictionary. + :vartype properties: dict[str, str] + :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + :ivar is_archived: Is the asset archived?. + :vartype is_archived: bool + :ivar latest_version: The latest version inside this container. + :vartype latest_version: str + :ivar next_version: The next auto incremental version. + :vartype next_version: str """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -4674,14 +4692,11 @@ class ComponentContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ComponentContainer]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of ComponentContainer objects. If null, there are no additional pages. @@ -4689,9 +4704,11 @@ def __init__( :keyword value: An array of objects of type ComponentContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainer] """ - super(ComponentContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(ComponentContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class ComponentVersion(Resource): @@ -4717,31 +4734,31 @@ class ComponentVersion(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentVersionProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "ComponentVersionProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentVersionProperties """ super(ComponentVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class ComponentVersionProperties(AssetBase): @@ -4758,10 +4775,10 @@ class ComponentVersionProperties(AssetBase): :ivar is_archived: Is the asset archived?. :vartype is_archived: bool :ivar component_spec: Defines Component definition details. - - + + .. raw:: html - + . @@ -4769,18 +4786,15 @@ class ComponentVersionProperties(AssetBase): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'component_spec': {'key': 'componentSpec', 'type': 'object'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "component_spec": {"key": "componentSpec", "type": "object"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -4793,17 +4807,17 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool :keyword component_spec: Defines Component definition details. - - + + .. raw:: html - + . :paramtype component_spec: any """ super(ComponentVersionProperties, self).__init__(**kwargs) - self.component_spec = kwargs.get('component_spec', None) + self.component_spec = kwargs.get("component_spec", None) class ComponentVersionResourceArmPaginatedResult(msrest.serialization.Model): @@ -4817,14 +4831,11 @@ class ComponentVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentVersion]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ComponentVersion]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of ComponentVersion objects. If null, there are no additional pages. @@ -4832,9 +4843,11 @@ def __init__( :keyword value: An array of objects of type ComponentVersion. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersion] """ - super(ComponentVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(ComponentVersionResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class ComputeInstanceSchema(msrest.serialization.Model): @@ -4845,19 +4858,19 @@ class ComputeInstanceSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, + "properties": { + "key": "properties", + "type": "ComputeInstanceProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of ComputeInstance. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties """ super(ComputeInstanceSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class ComputeInstance(Compute, ComputeInstanceSchema): @@ -4899,34 +4912,37 @@ class ComputeInstance(Compute, ComputeInstanceSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + "disable_local_auth": {"readonly": True}, + } + + _attribute_map = { + "properties": { + "key": "properties", + "type": "ComputeInstanceProperties", + }, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, + } + + def __init__(self, **kwargs): """ :keyword properties: Properties of ComputeInstance. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties @@ -4936,14 +4952,14 @@ def __init__( :paramtype resource_id: str """ super(ComputeInstance, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'ComputeInstance' # type: str + self.properties = kwargs.get("properties", None) + self.compute_type = "ComputeInstance" # type: str self.compute_location = None self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None self.disable_local_auth = None @@ -4959,14 +4975,11 @@ class ComputeInstanceApplication(msrest.serialization.Model): """ _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, + "display_name": {"key": "displayName", "type": "str"}, + "endpoint_uri": {"key": "endpointUri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword display_name: Name of the ComputeInstance application. :paramtype display_name: str @@ -4974,8 +4987,8 @@ def __init__( :paramtype endpoint_uri: str """ super(ComputeInstanceApplication, self).__init__(**kwargs) - self.display_name = kwargs.get('display_name', None) - self.endpoint_uri = kwargs.get('endpoint_uri', None) + self.display_name = kwargs.get("display_name", None) + self.endpoint_uri = kwargs.get("endpoint_uri", None) class ComputeInstanceConnectivityEndpoints(msrest.serialization.Model): @@ -4991,21 +5004,17 @@ class ComputeInstanceConnectivityEndpoints(msrest.serialization.Model): """ _validation = { - 'public_ip_address': {'readonly': True}, - 'private_ip_address': {'readonly': True}, + "public_ip_address": {"readonly": True}, + "private_ip_address": {"readonly": True}, } _attribute_map = { - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + "public_ip_address": {"key": "publicIpAddress", "type": "str"}, + "private_ip_address": {"key": "privateIpAddress", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ComputeInstanceConnectivityEndpoints, self).__init__(**kwargs) self.public_ip_address = None self.private_ip_address = None @@ -5031,22 +5040,22 @@ class ComputeInstanceContainer(msrest.serialization.Model): """ _validation = { - 'services': {'readonly': True}, + "services": {"readonly": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'autosave': {'key': 'autosave', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'network': {'key': 'network', 'type': 'str'}, - 'environment': {'key': 'environment', 'type': 'ComputeInstanceEnvironmentInfo'}, - 'services': {'key': 'services', 'type': '[object]'}, + "name": {"key": "name", "type": "str"}, + "autosave": {"key": "autosave", "type": "str"}, + "gpu": {"key": "gpu", "type": "str"}, + "network": {"key": "network", "type": "str"}, + "environment": { + "key": "environment", + "type": "ComputeInstanceEnvironmentInfo", + }, + "services": {"key": "services", "type": "[object]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: Name of the ComputeInstance container. :paramtype name: str @@ -5061,11 +5070,11 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ComputeInstanceEnvironmentInfo """ super(ComputeInstanceContainer, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.autosave = kwargs.get('autosave', None) - self.gpu = kwargs.get('gpu', None) - self.network = kwargs.get('network', None) - self.environment = kwargs.get('environment', None) + self.name = kwargs.get("name", None) + self.autosave = kwargs.get("autosave", None) + self.gpu = kwargs.get("gpu", None) + self.network = kwargs.get("network", None) + self.environment = kwargs.get("environment", None) self.services = None @@ -5083,23 +5092,19 @@ class ComputeInstanceCreatedBy(msrest.serialization.Model): """ _validation = { - 'user_name': {'readonly': True}, - 'user_org_id': {'readonly': True}, - 'user_id': {'readonly': True}, + "user_name": {"readonly": True}, + "user_org_id": {"readonly": True}, + "user_id": {"readonly": True}, } _attribute_map = { - 'user_name': {'key': 'userName', 'type': 'str'}, - 'user_org_id': {'key': 'userOrgId', 'type': 'str'}, - 'user_id': {'key': 'userId', 'type': 'str'}, + "user_name": {"key": "userName", "type": "str"}, + "user_org_id": {"key": "userOrgId", "type": "str"}, + "user_id": {"key": "userId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ComputeInstanceCreatedBy, self).__init__(**kwargs) self.user_name = None self.user_org_id = None @@ -5124,16 +5129,13 @@ class ComputeInstanceDataDisk(msrest.serialization.Model): """ _attribute_map = { - 'caching': {'key': 'caching', 'type': 'str'}, - 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, - 'lun': {'key': 'lun', 'type': 'int'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + "caching": {"key": "caching", "type": "str"}, + "disk_size_gb": {"key": "diskSizeGB", "type": "int"}, + "lun": {"key": "lun", "type": "int"}, + "storage_account_type": {"key": "storageAccountType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword caching: Caching type of Data Disk. Possible values include: "None", "ReadOnly", "ReadWrite". @@ -5149,10 +5151,12 @@ def __init__( ~azure.mgmt.machinelearningservices.models.StorageAccountType """ super(ComputeInstanceDataDisk, self).__init__(**kwargs) - self.caching = kwargs.get('caching', None) - self.disk_size_gb = kwargs.get('disk_size_gb', None) - self.lun = kwargs.get('lun', None) - self.storage_account_type = kwargs.get('storage_account_type', "Standard_LRS") + self.caching = kwargs.get("caching", None) + self.disk_size_gb = kwargs.get("disk_size_gb", None) + self.lun = kwargs.get("lun", None) + self.storage_account_type = kwargs.get( + "storage_account_type", "Standard_LRS" + ) class ComputeInstanceDataMount(msrest.serialization.Model): @@ -5180,21 +5184,18 @@ class ComputeInstanceDataMount(msrest.serialization.Model): """ _attribute_map = { - 'source': {'key': 'source', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'mount_name': {'key': 'mountName', 'type': 'str'}, - 'mount_action': {'key': 'mountAction', 'type': 'str'}, - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - 'mount_state': {'key': 'mountState', 'type': 'str'}, - 'mounted_on': {'key': 'mountedOn', 'type': 'iso-8601'}, - 'error': {'key': 'error', 'type': 'str'}, + "source": {"key": "source", "type": "str"}, + "source_type": {"key": "sourceType", "type": "str"}, + "mount_name": {"key": "mountName", "type": "str"}, + "mount_action": {"key": "mountAction", "type": "str"}, + "created_by": {"key": "createdBy", "type": "str"}, + "mount_path": {"key": "mountPath", "type": "str"}, + "mount_state": {"key": "mountState", "type": "str"}, + "mounted_on": {"key": "mountedOn", "type": "iso-8601"}, + "error": {"key": "error", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword source: Source of the ComputeInstance data mount. :paramtype source: str @@ -5217,15 +5218,15 @@ def __init__( :paramtype error: str """ super(ComputeInstanceDataMount, self).__init__(**kwargs) - self.source = kwargs.get('source', None) - self.source_type = kwargs.get('source_type', None) - self.mount_name = kwargs.get('mount_name', None) - self.mount_action = kwargs.get('mount_action', None) - self.created_by = kwargs.get('created_by', None) - self.mount_path = kwargs.get('mount_path', None) - self.mount_state = kwargs.get('mount_state', None) - self.mounted_on = kwargs.get('mounted_on', None) - self.error = kwargs.get('error', None) + self.source = kwargs.get("source", None) + self.source_type = kwargs.get("source_type", None) + self.mount_name = kwargs.get("mount_name", None) + self.mount_action = kwargs.get("mount_action", None) + self.created_by = kwargs.get("created_by", None) + self.mount_path = kwargs.get("mount_path", None) + self.mount_state = kwargs.get("mount_state", None) + self.mounted_on = kwargs.get("mounted_on", None) + self.error = kwargs.get("error", None) class ComputeInstanceEnvironmentInfo(msrest.serialization.Model): @@ -5238,14 +5239,11 @@ class ComputeInstanceEnvironmentInfo(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "version": {"key": "version", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: name of environment. :paramtype name: str @@ -5253,8 +5251,8 @@ def __init__( :paramtype version: str """ super(ComputeInstanceEnvironmentInfo, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.version = kwargs.get('version', None) + self.name = kwargs.get("name", None) + self.version = kwargs.get("version", None) class ComputeInstanceLastOperation(msrest.serialization.Model): @@ -5274,16 +5272,13 @@ class ComputeInstanceLastOperation(msrest.serialization.Model): """ _attribute_map = { - 'operation_name': {'key': 'operationName', 'type': 'str'}, - 'operation_time': {'key': 'operationTime', 'type': 'iso-8601'}, - 'operation_status': {'key': 'operationStatus', 'type': 'str'}, - 'operation_trigger': {'key': 'operationTrigger', 'type': 'str'}, + "operation_name": {"key": "operationName", "type": "str"}, + "operation_time": {"key": "operationTime", "type": "iso-8601"}, + "operation_status": {"key": "operationStatus", "type": "str"}, + "operation_trigger": {"key": "operationTrigger", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword operation_name: Name of the last operation. Possible values include: "Create", "Start", "Stop", "Restart", "Reimage", "Delete". @@ -5300,10 +5295,10 @@ def __init__( ~azure.mgmt.machinelearningservices.models.OperationTrigger """ super(ComputeInstanceLastOperation, self).__init__(**kwargs) - self.operation_name = kwargs.get('operation_name', None) - self.operation_time = kwargs.get('operation_time', None) - self.operation_status = kwargs.get('operation_status', None) - self.operation_trigger = kwargs.get('operation_trigger', None) + self.operation_name = kwargs.get("operation_name", None) + self.operation_time = kwargs.get("operation_time", None) + self.operation_status = kwargs.get("operation_status", None) + self.operation_trigger = kwargs.get("operation_trigger", None) class ComputeInstanceProperties(msrest.serialization.Model): @@ -5370,45 +5365,72 @@ class ComputeInstanceProperties(msrest.serialization.Model): """ _validation = { - 'connectivity_endpoints': {'readonly': True}, - 'applications': {'readonly': True}, - 'created_by': {'readonly': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'last_operation': {'readonly': True}, - 'schedules': {'readonly': True}, - 'containers': {'readonly': True}, - 'data_disks': {'readonly': True}, - 'data_mounts': {'readonly': True}, - 'versions': {'readonly': True}, - } - - _attribute_map = { - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'application_sharing_policy': {'key': 'applicationSharingPolicy', 'type': 'str'}, - 'ssh_settings': {'key': 'sshSettings', 'type': 'ComputeInstanceSshSettings'}, - 'connectivity_endpoints': {'key': 'connectivityEndpoints', 'type': 'ComputeInstanceConnectivityEndpoints'}, - 'applications': {'key': 'applications', 'type': '[ComputeInstanceApplication]'}, - 'created_by': {'key': 'createdBy', 'type': 'ComputeInstanceCreatedBy'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'compute_instance_authorization_type': {'key': 'computeInstanceAuthorizationType', 'type': 'str'}, - 'personal_compute_instance_settings': {'key': 'personalComputeInstanceSettings', 'type': 'PersonalComputeInstanceSettings'}, - 'setup_scripts': {'key': 'setupScripts', 'type': 'SetupScripts'}, - 'last_operation': {'key': 'lastOperation', 'type': 'ComputeInstanceLastOperation'}, - 'schedules': {'key': 'schedules', 'type': 'ComputeSchedules'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'containers': {'key': 'containers', 'type': '[ComputeInstanceContainer]'}, - 'data_disks': {'key': 'dataDisks', 'type': '[ComputeInstanceDataDisk]'}, - 'data_mounts': {'key': 'dataMounts', 'type': '[ComputeInstanceDataMount]'}, - 'versions': {'key': 'versions', 'type': 'ComputeInstanceVersion'}, - } - - def __init__( - self, - **kwargs - ): + "connectivity_endpoints": {"readonly": True}, + "applications": {"readonly": True}, + "created_by": {"readonly": True}, + "errors": {"readonly": True}, + "state": {"readonly": True}, + "last_operation": {"readonly": True}, + "schedules": {"readonly": True}, + "containers": {"readonly": True}, + "data_disks": {"readonly": True}, + "data_mounts": {"readonly": True}, + "versions": {"readonly": True}, + } + + _attribute_map = { + "vm_size": {"key": "vmSize", "type": "str"}, + "subnet": {"key": "subnet", "type": "ResourceId"}, + "application_sharing_policy": { + "key": "applicationSharingPolicy", + "type": "str", + }, + "ssh_settings": { + "key": "sshSettings", + "type": "ComputeInstanceSshSettings", + }, + "connectivity_endpoints": { + "key": "connectivityEndpoints", + "type": "ComputeInstanceConnectivityEndpoints", + }, + "applications": { + "key": "applications", + "type": "[ComputeInstanceApplication]", + }, + "created_by": {"key": "createdBy", "type": "ComputeInstanceCreatedBy"}, + "errors": {"key": "errors", "type": "[ErrorResponse]"}, + "state": {"key": "state", "type": "str"}, + "compute_instance_authorization_type": { + "key": "computeInstanceAuthorizationType", + "type": "str", + }, + "personal_compute_instance_settings": { + "key": "personalComputeInstanceSettings", + "type": "PersonalComputeInstanceSettings", + }, + "setup_scripts": {"key": "setupScripts", "type": "SetupScripts"}, + "last_operation": { + "key": "lastOperation", + "type": "ComputeInstanceLastOperation", + }, + "schedules": {"key": "schedules", "type": "ComputeSchedules"}, + "enable_node_public_ip": {"key": "enableNodePublicIp", "type": "bool"}, + "containers": { + "key": "containers", + "type": "[ComputeInstanceContainer]", + }, + "data_disks": { + "key": "dataDisks", + "type": "[ComputeInstanceDataDisk]", + }, + "data_mounts": { + "key": "dataMounts", + "type": "[ComputeInstanceDataMount]", + }, + "versions": {"key": "versions", "type": "ComputeInstanceVersion"}, + } + + def __init__(self, **kwargs): """ :keyword vm_size: Virtual Machine Size. :paramtype vm_size: str @@ -5440,21 +5462,27 @@ def __init__( :paramtype enable_node_public_ip: bool """ super(ComputeInstanceProperties, self).__init__(**kwargs) - self.vm_size = kwargs.get('vm_size', None) - self.subnet = kwargs.get('subnet', None) - self.application_sharing_policy = kwargs.get('application_sharing_policy', "Shared") - self.ssh_settings = kwargs.get('ssh_settings', None) + self.vm_size = kwargs.get("vm_size", None) + self.subnet = kwargs.get("subnet", None) + self.application_sharing_policy = kwargs.get( + "application_sharing_policy", "Shared" + ) + self.ssh_settings = kwargs.get("ssh_settings", None) self.connectivity_endpoints = None self.applications = None self.created_by = None self.errors = None self.state = None - self.compute_instance_authorization_type = kwargs.get('compute_instance_authorization_type', "personal") - self.personal_compute_instance_settings = kwargs.get('personal_compute_instance_settings', None) - self.setup_scripts = kwargs.get('setup_scripts', None) + self.compute_instance_authorization_type = kwargs.get( + "compute_instance_authorization_type", "personal" + ) + self.personal_compute_instance_settings = kwargs.get( + "personal_compute_instance_settings", None + ) + self.setup_scripts = kwargs.get("setup_scripts", None) self.last_operation = None self.schedules = None - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) + self.enable_node_public_ip = kwargs.get("enable_node_public_ip", None) self.containers = None self.data_disks = None self.data_mounts = None @@ -5481,21 +5509,18 @@ class ComputeInstanceSshSettings(msrest.serialization.Model): """ _validation = { - 'admin_user_name': {'readonly': True}, - 'ssh_port': {'readonly': True}, + "admin_user_name": {"readonly": True}, + "ssh_port": {"readonly": True}, } _attribute_map = { - 'ssh_public_access': {'key': 'sshPublicAccess', 'type': 'str'}, - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'admin_public_key': {'key': 'adminPublicKey', 'type': 'str'}, + "ssh_public_access": {"key": "sshPublicAccess", "type": "str"}, + "admin_user_name": {"key": "adminUserName", "type": "str"}, + "ssh_port": {"key": "sshPort", "type": "int"}, + "admin_public_key": {"key": "adminPublicKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword ssh_public_access: State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the @@ -5507,10 +5532,10 @@ def __init__( :paramtype admin_public_key: str """ super(ComputeInstanceSshSettings, self).__init__(**kwargs) - self.ssh_public_access = kwargs.get('ssh_public_access', "Disabled") + self.ssh_public_access = kwargs.get("ssh_public_access", "Disabled") self.admin_user_name = None self.ssh_port = None - self.admin_public_key = kwargs.get('admin_public_key', None) + self.admin_public_key = kwargs.get("admin_public_key", None) class ComputeInstanceVersion(msrest.serialization.Model): @@ -5521,19 +5546,16 @@ class ComputeInstanceVersion(msrest.serialization.Model): """ _attribute_map = { - 'runtime': {'key': 'runtime', 'type': 'str'}, + "runtime": {"key": "runtime", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword runtime: Runtime of compute instance. :paramtype runtime: str """ super(ComputeInstanceVersion, self).__init__(**kwargs) - self.runtime = kwargs.get('runtime', None) + self.runtime = kwargs.get("runtime", None) class ComputeResourceSchema(msrest.serialization.Model): @@ -5544,19 +5566,16 @@ class ComputeResourceSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, + "properties": {"key": "properties", "type": "Compute"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Compute properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute """ super(ComputeResourceSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class ComputeResource(Resource, ComputeResourceSchema): @@ -5588,28 +5607,25 @@ class ComputeResource(Resource, ComputeResourceSchema): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "properties": {"key": "properties", "type": "Compute"}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Compute properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute @@ -5623,11 +5639,11 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ super(ComputeResource, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) + self.properties = kwargs.get("properties", None) + self.identity = kwargs.get("identity", None) + self.location = kwargs.get("location", None) + self.tags = kwargs.get("tags", None) + self.sku = kwargs.get("sku", None) self.id = None self.name = None self.type = None @@ -5643,20 +5659,20 @@ class ComputeSchedules(msrest.serialization.Model): """ _attribute_map = { - 'compute_start_stop': {'key': 'computeStartStop', 'type': '[ComputeStartStopSchedule]'}, + "compute_start_stop": { + "key": "computeStartStop", + "type": "[ComputeStartStopSchedule]", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword compute_start_stop: The list of compute start stop schedules to be applied. :paramtype compute_start_stop: list[~azure.mgmt.machinelearningservices.models.ComputeStartStopSchedule] """ super(ComputeSchedules, self).__init__(**kwargs) - self.compute_start_stop = kwargs.get('compute_start_stop', None) + self.compute_start_stop = kwargs.get("compute_start_stop", None) class ComputeStartStopSchedule(msrest.serialization.Model): @@ -5687,25 +5703,22 @@ class ComputeStartStopSchedule(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'provisioning_status': {'readonly': True}, + "id": {"readonly": True}, + "provisioning_status": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'recurrence': {'key': 'recurrence', 'type': 'RecurrenceTrigger'}, - 'cron': {'key': 'cron', 'type': 'CronTrigger'}, - 'schedule': {'key': 'schedule', 'type': 'ScheduleBase'}, + "id": {"key": "id", "type": "str"}, + "provisioning_status": {"key": "provisioningStatus", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "action": {"key": "action", "type": "str"}, + "trigger_type": {"key": "triggerType", "type": "str"}, + "recurrence": {"key": "recurrence", "type": "RecurrenceTrigger"}, + "cron": {"key": "cron", "type": "CronTrigger"}, + "schedule": {"key": "schedule", "type": "ScheduleBase"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword status: Is the schedule enabled or disabled?. Possible values include: "Enabled", "Disabled". @@ -5725,12 +5738,12 @@ def __init__( super(ComputeStartStopSchedule, self).__init__(**kwargs) self.id = None self.provisioning_status = None - self.status = kwargs.get('status', None) - self.action = kwargs.get('action', None) - self.trigger_type = kwargs.get('trigger_type', None) - self.recurrence = kwargs.get('recurrence', None) - self.cron = kwargs.get('cron', None) - self.schedule = kwargs.get('schedule', None) + self.status = kwargs.get("status", None) + self.action = kwargs.get("action", None) + self.trigger_type = kwargs.get("trigger_type", None) + self.recurrence = kwargs.get("recurrence", None) + self.cron = kwargs.get("cron", None) + self.schedule = kwargs.get("schedule", None) class ContainerResourceRequirements(msrest.serialization.Model): @@ -5745,14 +5758,17 @@ class ContainerResourceRequirements(msrest.serialization.Model): """ _attribute_map = { - 'container_resource_limits': {'key': 'containerResourceLimits', 'type': 'ContainerResourceSettings'}, - 'container_resource_requests': {'key': 'containerResourceRequests', 'type': 'ContainerResourceSettings'}, + "container_resource_limits": { + "key": "containerResourceLimits", + "type": "ContainerResourceSettings", + }, + "container_resource_requests": { + "key": "containerResourceRequests", + "type": "ContainerResourceSettings", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword container_resource_limits: Container resource limit info:. :paramtype container_resource_limits: @@ -5762,8 +5778,12 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings """ super(ContainerResourceRequirements, self).__init__(**kwargs) - self.container_resource_limits = kwargs.get('container_resource_limits', None) - self.container_resource_requests = kwargs.get('container_resource_requests', None) + self.container_resource_limits = kwargs.get( + "container_resource_limits", None + ) + self.container_resource_requests = kwargs.get( + "container_resource_requests", None + ) class ContainerResourceSettings(msrest.serialization.Model): @@ -5781,15 +5801,12 @@ class ContainerResourceSettings(msrest.serialization.Model): """ _attribute_map = { - 'cpu': {'key': 'cpu', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'memory': {'key': 'memory', 'type': 'str'}, + "cpu": {"key": "cpu", "type": "str"}, + "gpu": {"key": "gpu", "type": "str"}, + "memory": {"key": "memory", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword cpu: Number of vCPUs request/limit for container. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. @@ -5802,9 +5819,9 @@ def __init__( :paramtype memory: str """ super(ContainerResourceSettings, self).__init__(**kwargs) - self.cpu = kwargs.get('cpu', None) - self.gpu = kwargs.get('gpu', None) - self.memory = kwargs.get('memory', None) + self.cpu = kwargs.get("cpu", None) + self.gpu = kwargs.get("gpu", None) + self.memory = kwargs.get("memory", None) class CosmosDbSettings(msrest.serialization.Model): @@ -5815,19 +5832,21 @@ class CosmosDbSettings(msrest.serialization.Model): """ _attribute_map = { - 'collections_throughput': {'key': 'collectionsThroughput', 'type': 'int'}, + "collections_throughput": { + "key": "collectionsThroughput", + "type": "int", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword collections_throughput: The throughput of the collections in cosmosdb database. :paramtype collections_throughput: int """ super(CosmosDbSettings, self).__init__(**kwargs) - self.collections_throughput = kwargs.get('collections_throughput', None) + self.collections_throughput = kwargs.get( + "collections_throughput", None + ) class TriggerBase(msrest.serialization.Model): @@ -5856,24 +5875,24 @@ class TriggerBase(msrest.serialization.Model): """ _validation = { - 'trigger_type': {'required': True}, + "trigger_type": {"required": True}, } _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, + "end_time": {"key": "endTime", "type": "str"}, + "start_time": {"key": "startTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "trigger_type": {"key": "triggerType", "type": "str"}, } _subtype_map = { - 'trigger_type': {'Cron': 'CronTrigger', 'Recurrence': 'RecurrenceTrigger'} + "trigger_type": { + "Cron": "CronTrigger", + "Recurrence": "RecurrenceTrigger", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer https://en.wikipedia.org/wiki/ISO_8601. @@ -5889,9 +5908,9 @@ def __init__( :paramtype time_zone: str """ super(TriggerBase, self).__init__(**kwargs) - self.end_time = kwargs.get('end_time', None) - self.start_time = kwargs.get('start_time', None) - self.time_zone = kwargs.get('time_zone', "UTC") + self.end_time = kwargs.get("end_time", None) + self.start_time = kwargs.get("start_time", None) + self.time_zone = kwargs.get("time_zone", "UTC") self.trigger_type = None # type: Optional[str] @@ -5921,22 +5940,19 @@ class CronTrigger(TriggerBase): """ _validation = { - 'trigger_type': {'required': True}, - 'expression': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "trigger_type": {"required": True}, + "expression": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, + "end_time": {"key": "endTime", "type": "str"}, + "start_time": {"key": "startTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "trigger_type": {"key": "triggerType", "type": "str"}, + "expression": {"key": "expression", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer https://en.wikipedia.org/wiki/ISO_8601. @@ -5955,8 +5971,8 @@ def __init__( :paramtype expression: str """ super(CronTrigger, self).__init__(**kwargs) - self.trigger_type = 'Cron' # type: str - self.expression = kwargs['expression'] + self.trigger_type = "Cron" # type: str + self.expression = kwargs["expression"] class CustomForecastHorizon(ForecastHorizon): @@ -5972,26 +5988,23 @@ class CustomForecastHorizon(ForecastHorizon): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Required. [Required] Forecast horizon value. :paramtype value: int """ super(CustomForecastHorizon, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] + self.mode = "Custom" # type: str + self.value = kwargs["value"] class JobInput(msrest.serialization.Model): @@ -6011,28 +6024,33 @@ class JobInput(msrest.serialization.Model): """ _validation = { - 'job_input_type': {'required': True}, + "job_input_type": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } _subtype_map = { - 'job_input_type': {'custom_model': 'CustomModelJobInput', 'literal': 'LiteralJobInput', 'mlflow_model': 'MLFlowModelJobInput', 'mltable': 'MLTableJobInput', 'triton_model': 'TritonModelJobInput', 'uri_file': 'UriFileJobInput', 'uri_folder': 'UriFolderJobInput'} + "job_input_type": { + "custom_model": "CustomModelJobInput", + "literal": "LiteralJobInput", + "mlflow_model": "MLFlowModelJobInput", + "mltable": "MLTableJobInput", + "triton_model": "TritonModelJobInput", + "uri_file": "UriFileJobInput", + "uri_folder": "UriFolderJobInput", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: Description for the input. :paramtype description: str """ super(JobInput, self).__init__(**kwargs) - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.job_input_type = None # type: Optional[str] @@ -6055,21 +6073,18 @@ class CustomModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -6080,10 +6095,10 @@ def __init__( :paramtype description: str """ super(CustomModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'custom_model' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "custom_model" # type: str + self.description = kwargs.get("description", None) class JobOutput(msrest.serialization.Model): @@ -6103,28 +6118,32 @@ class JobOutput(msrest.serialization.Model): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } _subtype_map = { - 'job_output_type': {'custom_model': 'CustomModelJobOutput', 'mlflow_model': 'MLFlowModelJobOutput', 'mltable': 'MLTableJobOutput', 'triton_model': 'TritonModelJobOutput', 'uri_file': 'UriFileJobOutput', 'uri_folder': 'UriFolderJobOutput'} + "job_output_type": { + "custom_model": "CustomModelJobOutput", + "mlflow_model": "MLFlowModelJobOutput", + "mltable": "MLTableJobOutput", + "triton_model": "TritonModelJobOutput", + "uri_file": "UriFileJobOutput", + "uri_folder": "UriFolderJobOutput", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: Description for the output. :paramtype description: str """ super(JobOutput, self).__init__(**kwargs) - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.job_output_type = None # type: Optional[str] @@ -6146,20 +6165,17 @@ class CustomModelJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -6169,10 +6185,10 @@ def __init__( :paramtype description: str """ super(CustomModelJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'custom_model' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "custom_model" # type: str + self.description = kwargs.get("description", None) class CustomNCrossValidations(NCrossValidations): @@ -6188,26 +6204,23 @@ class CustomNCrossValidations(NCrossValidations): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Required. [Required] N-Cross validations value. :paramtype value: int """ super(CustomNCrossValidations, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] + self.mode = "Custom" # type: str + self.value = kwargs["value"] class CustomSeasonality(Seasonality): @@ -6223,26 +6236,23 @@ class CustomSeasonality(Seasonality): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Required. [Required] Seasonality value. :paramtype value: int """ super(CustomSeasonality, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] + self.mode = "Custom" # type: str + self.value = kwargs["value"] class CustomTargetLags(TargetLags): @@ -6258,26 +6268,23 @@ class CustomTargetLags(TargetLags): """ _validation = { - 'mode': {'required': True}, - 'values': {'required': True}, + "mode": {"required": True}, + "values": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[int]'}, + "mode": {"key": "mode", "type": "str"}, + "values": {"key": "values", "type": "[int]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword values: Required. [Required] Set target lags values. :paramtype values: list[int] """ super(CustomTargetLags, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.values = kwargs['values'] + self.mode = "Custom" # type: str + self.values = kwargs["values"] class CustomTargetRollingWindowSize(TargetRollingWindowSize): @@ -6293,26 +6300,23 @@ class CustomTargetRollingWindowSize(TargetRollingWindowSize): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Required. [Required] TargetRollingWindowSize value. :paramtype value: int """ super(CustomTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] + self.mode = "Custom" # type: str + self.value = kwargs["value"] class DatabricksSchema(msrest.serialization.Model): @@ -6323,19 +6327,16 @@ class DatabricksSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, + "properties": {"key": "properties", "type": "DatabricksProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of Databricks. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties """ super(DatabricksSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class Databricks(Compute, DatabricksSchema): @@ -6377,34 +6378,34 @@ class Databricks(Compute, DatabricksSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + "disable_local_auth": {"readonly": True}, + } + + _attribute_map = { + "properties": {"key": "properties", "type": "DatabricksProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, + } + + def __init__(self, **kwargs): """ :keyword properties: Properties of Databricks. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties @@ -6414,14 +6415,14 @@ def __init__( :paramtype resource_id: str """ super(Databricks, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'Databricks' # type: str + self.properties = kwargs.get("properties", None) + self.compute_type = "Databricks" # type: str self.compute_location = None self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None self.disable_local_auth = None @@ -6435,22 +6436,26 @@ class DatabricksComputeSecretsProperties(msrest.serialization.Model): """ _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword databricks_access_token: access token for databricks account. :paramtype databricks_access_token: str """ super(DatabricksComputeSecretsProperties, self).__init__(**kwargs) - self.databricks_access_token = kwargs.get('databricks_access_token', None) + self.databricks_access_token = kwargs.get( + "databricks_access_token", None + ) -class DatabricksComputeSecrets(ComputeSecrets, DatabricksComputeSecretsProperties): +class DatabricksComputeSecrets( + ComputeSecrets, DatabricksComputeSecretsProperties +): """Secrets related to a Machine Learning compute based on Databricks. All required parameters must be populated in order to send to Azure. @@ -6464,25 +6469,27 @@ class DatabricksComputeSecrets(ComputeSecrets, DatabricksComputeSecretsPropertie """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, + "compute_type": {"key": "computeType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword databricks_access_token: access token for databricks account. :paramtype databricks_access_token: str """ super(DatabricksComputeSecrets, self).__init__(**kwargs) - self.databricks_access_token = kwargs.get('databricks_access_token', None) - self.compute_type = 'Databricks' # type: str + self.databricks_access_token = kwargs.get( + "databricks_access_token", None + ) + self.compute_type = "Databricks" # type: str class DatabricksProperties(msrest.serialization.Model): @@ -6495,14 +6502,14 @@ class DatabricksProperties(msrest.serialization.Model): """ _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'workspace_url': {'key': 'workspaceUrl', 'type': 'str'}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, + "workspace_url": {"key": "workspaceUrl", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword databricks_access_token: Databricks access token. :paramtype databricks_access_token: str @@ -6510,8 +6517,10 @@ def __init__( :paramtype workspace_url: str """ super(DatabricksProperties, self).__init__(**kwargs) - self.databricks_access_token = kwargs.get('databricks_access_token', None) - self.workspace_url = kwargs.get('workspace_url', None) + self.databricks_access_token = kwargs.get( + "databricks_access_token", None + ) + self.workspace_url = kwargs.get("workspace_url", None) class DataContainer(Resource): @@ -6537,31 +6546,28 @@ class DataContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "DataContainerProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataContainerProperties """ super(DataContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class DataContainerProperties(AssetContainer): @@ -6589,25 +6595,22 @@ class DataContainerProperties(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'data_type': {'required': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "data_type": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "data_type": {"key": "dataType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -6622,7 +6625,7 @@ def __init__( :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType """ super(DataContainerProperties, self).__init__(**kwargs) - self.data_type = kwargs['data_type'] + self.data_type = kwargs["data_type"] class DataContainerResourceArmPaginatedResult(msrest.serialization.Model): @@ -6636,14 +6639,11 @@ class DataContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[DataContainer]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of DataContainer objects. If null, there are no additional pages. @@ -6652,8 +6652,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataContainer] """ super(DataContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class DataFactory(Compute): @@ -6693,33 +6693,33 @@ class DataFactory(Compute): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + "disable_local_auth": {"readonly": True}, + } + + _attribute_map = { + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, + } + + def __init__(self, **kwargs): """ :keyword description: The description of the Machine Learning compute. :paramtype description: str @@ -6727,7 +6727,7 @@ def __init__( :paramtype resource_id: str """ super(DataFactory, self).__init__(**kwargs) - self.compute_type = 'DataFactory' # type: str + self.compute_type = "DataFactory" # type: str class DataLakeAnalyticsSchema(msrest.serialization.Model): @@ -6739,20 +6739,20 @@ class DataLakeAnalyticsSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, + "properties": { + "key": "properties", + "type": "DataLakeAnalyticsSchemaProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties """ super(DataLakeAnalyticsSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class DataLakeAnalytics(Compute, DataLakeAnalyticsSchema): @@ -6795,34 +6795,37 @@ class DataLakeAnalytics(Compute, DataLakeAnalyticsSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + "disable_local_auth": {"readonly": True}, + } + + _attribute_map = { + "properties": { + "key": "properties", + "type": "DataLakeAnalyticsSchemaProperties", + }, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, + } + + def __init__(self, **kwargs): """ :keyword properties: :paramtype properties: @@ -6833,14 +6836,14 @@ def __init__( :paramtype resource_id: str """ super(DataLakeAnalytics, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'DataLakeAnalytics' # type: str + self.properties = kwargs.get("properties", None) + self.compute_type = "DataLakeAnalytics" # type: str self.compute_location = None self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None self.disable_local_auth = None @@ -6854,19 +6857,21 @@ class DataLakeAnalyticsSchemaProperties(msrest.serialization.Model): """ _attribute_map = { - 'data_lake_store_account_name': {'key': 'dataLakeStoreAccountName', 'type': 'str'}, + "data_lake_store_account_name": { + "key": "dataLakeStoreAccountName", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data_lake_store_account_name: DataLake Store Account Name. :paramtype data_lake_store_account_name: str """ super(DataLakeAnalyticsSchemaProperties, self).__init__(**kwargs) - self.data_lake_store_account_name = kwargs.get('data_lake_store_account_name', None) + self.data_lake_store_account_name = kwargs.get( + "data_lake_store_account_name", None + ) class DataPathAssetReference(AssetReferenceBase): @@ -6884,19 +6889,16 @@ class DataPathAssetReference(AssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'datastore_id': {'key': 'datastoreId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "datastore_id": {"key": "datastoreId", "type": "str"}, + "path": {"key": "path", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword datastore_id: ARM resource ID of the datastore where the asset is located. :paramtype datastore_id: str @@ -6904,9 +6906,9 @@ def __init__( :paramtype path: str """ super(DataPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'DataPath' # type: str - self.datastore_id = kwargs.get('datastore_id', None) - self.path = kwargs.get('path', None) + self.reference_type = "DataPath" # type: str + self.datastore_id = kwargs.get("datastore_id", None) + self.path = kwargs.get("path", None) class Datastore(Resource): @@ -6932,31 +6934,28 @@ class Datastore(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DatastoreProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "DatastoreProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatastoreProperties """ super(Datastore, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class DatastoreResourceArmPaginatedResult(msrest.serialization.Model): @@ -6970,14 +6969,11 @@ class DatastoreResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Datastore]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[Datastore]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of Datastore objects. If null, there are no additional pages. @@ -6986,8 +6982,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.Datastore] """ super(DatastoreResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class DataVersionBase(Resource): @@ -7013,31 +7009,31 @@ class DataVersionBase(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataVersionBaseProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "DataVersionBaseProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataVersionBaseProperties """ super(DataVersionBase, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class DataVersionBaseProperties(AssetBase): @@ -7067,28 +7063,29 @@ class DataVersionBaseProperties(AssetBase): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, } _subtype_map = { - 'data_type': {'mltable': 'MLTableData', 'uri_file': 'UriFileDataVersion', 'uri_folder': 'UriFolderDataVersion'} + "data_type": { + "mltable": "MLTableData", + "uri_file": "UriFileDataVersion", + "uri_folder": "UriFolderDataVersion", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -7105,8 +7102,8 @@ def __init__( :paramtype data_uri: str """ super(DataVersionBaseProperties, self).__init__(**kwargs) - self.data_type = 'DataVersionBaseProperties' # type: str - self.data_uri = kwargs['data_uri'] + self.data_type = "DataVersionBaseProperties" # type: str + self.data_uri = kwargs["data_uri"] class DataVersionBaseResourceArmPaginatedResult(msrest.serialization.Model): @@ -7120,14 +7117,11 @@ class DataVersionBaseResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataVersionBase]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[DataVersionBase]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of DataVersionBase objects. If null, there are no additional pages. @@ -7135,9 +7129,11 @@ def __init__( :keyword value: An array of objects of type DataVersionBase. :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBase] """ - super(DataVersionBaseResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(DataVersionBaseResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class OnlineScaleSettings(msrest.serialization.Model): @@ -7154,23 +7150,22 @@ class OnlineScaleSettings(msrest.serialization.Model): """ _validation = { - 'scale_type': {'required': True}, + "scale_type": {"required": True}, } _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, + "scale_type": {"key": "scaleType", "type": "str"}, } _subtype_map = { - 'scale_type': {'Default': 'DefaultScaleSettings', 'TargetUtilization': 'TargetUtilizationScaleSettings'} + "scale_type": { + "Default": "DefaultScaleSettings", + "TargetUtilization": "TargetUtilizationScaleSettings", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(OnlineScaleSettings, self).__init__(**kwargs) self.scale_type = None # type: Optional[str] @@ -7186,21 +7181,17 @@ class DefaultScaleSettings(OnlineScaleSettings): """ _validation = { - 'scale_type': {'required': True}, + "scale_type": {"required": True}, } _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, + "scale_type": {"key": "scaleType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DefaultScaleSettings, self).__init__(**kwargs) - self.scale_type = 'Default' # type: str + self.scale_type = "Default" # type: str class DeploymentLogs(msrest.serialization.Model): @@ -7211,19 +7202,16 @@ class DeploymentLogs(msrest.serialization.Model): """ _attribute_map = { - 'content': {'key': 'content', 'type': 'str'}, + "content": {"key": "content", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword content: The retrieved online deployment logs. :paramtype content: str """ super(DeploymentLogs, self).__init__(**kwargs) - self.content = kwargs.get('content', None) + self.content = kwargs.get("content", None) class DeploymentLogsRequest(msrest.serialization.Model): @@ -7237,14 +7225,11 @@ class DeploymentLogsRequest(msrest.serialization.Model): """ _attribute_map = { - 'container_type': {'key': 'containerType', 'type': 'str'}, - 'tail': {'key': 'tail', 'type': 'int'}, + "container_type": {"key": "containerType", "type": "str"}, + "tail": {"key": "tail", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword container_type: The type of container to retrieve logs from. Possible values include: "StorageInitializer", "InferenceServer". @@ -7253,8 +7238,8 @@ def __init__( :paramtype tail: int """ super(DeploymentLogsRequest, self).__init__(**kwargs) - self.container_type = kwargs.get('container_type', None) - self.tail = kwargs.get('tail', None) + self.container_type = kwargs.get("container_type", None) + self.tail = kwargs.get("tail", None) class ResourceConfiguration(msrest.serialization.Model): @@ -7269,15 +7254,12 @@ class ResourceConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "properties": {"key": "properties", "type": "{object}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword instance_count: Optional number of instances or nodes used by the compute target. :paramtype instance_count: int @@ -7287,9 +7269,9 @@ def __init__( :paramtype properties: dict[str, any] """ super(ResourceConfiguration, self).__init__(**kwargs) - self.instance_count = kwargs.get('instance_count', 1) - self.instance_type = kwargs.get('instance_type', None) - self.properties = kwargs.get('properties', None) + self.instance_count = kwargs.get("instance_count", 1) + self.instance_type = kwargs.get("instance_type", None) + self.properties = kwargs.get("properties", None) class DeploymentResourceConfiguration(ResourceConfiguration): @@ -7304,15 +7286,12 @@ class DeploymentResourceConfiguration(ResourceConfiguration): """ _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "properties": {"key": "properties", "type": "{object}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword instance_count: Optional number of instances or nodes used by the compute target. :paramtype instance_count: int @@ -7348,21 +7327,21 @@ class DiagnoseRequestProperties(msrest.serialization.Model): """ _attribute_map = { - 'udr': {'key': 'udr', 'type': '{object}'}, - 'nsg': {'key': 'nsg', 'type': '{object}'}, - 'resource_lock': {'key': 'resourceLock', 'type': '{object}'}, - 'dns_resolution': {'key': 'dnsResolution', 'type': '{object}'}, - 'storage_account': {'key': 'storageAccount', 'type': '{object}'}, - 'key_vault': {'key': 'keyVault', 'type': '{object}'}, - 'container_registry': {'key': 'containerRegistry', 'type': '{object}'}, - 'application_insights': {'key': 'applicationInsights', 'type': '{object}'}, - 'others': {'key': 'others', 'type': '{object}'}, + "udr": {"key": "udr", "type": "{object}"}, + "nsg": {"key": "nsg", "type": "{object}"}, + "resource_lock": {"key": "resourceLock", "type": "{object}"}, + "dns_resolution": {"key": "dnsResolution", "type": "{object}"}, + "storage_account": {"key": "storageAccount", "type": "{object}"}, + "key_vault": {"key": "keyVault", "type": "{object}"}, + "container_registry": {"key": "containerRegistry", "type": "{object}"}, + "application_insights": { + "key": "applicationInsights", + "type": "{object}", + }, + "others": {"key": "others", "type": "{object}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword udr: Setting for diagnosing user defined routing. :paramtype udr: dict[str, any] @@ -7384,15 +7363,15 @@ def __init__( :paramtype others: dict[str, any] """ super(DiagnoseRequestProperties, self).__init__(**kwargs) - self.udr = kwargs.get('udr', None) - self.nsg = kwargs.get('nsg', None) - self.resource_lock = kwargs.get('resource_lock', None) - self.dns_resolution = kwargs.get('dns_resolution', None) - self.storage_account = kwargs.get('storage_account', None) - self.key_vault = kwargs.get('key_vault', None) - self.container_registry = kwargs.get('container_registry', None) - self.application_insights = kwargs.get('application_insights', None) - self.others = kwargs.get('others', None) + self.udr = kwargs.get("udr", None) + self.nsg = kwargs.get("nsg", None) + self.resource_lock = kwargs.get("resource_lock", None) + self.dns_resolution = kwargs.get("dns_resolution", None) + self.storage_account = kwargs.get("storage_account", None) + self.key_vault = kwargs.get("key_vault", None) + self.container_registry = kwargs.get("container_registry", None) + self.application_insights = kwargs.get("application_insights", None) + self.others = kwargs.get("others", None) class DiagnoseResponseResult(msrest.serialization.Model): @@ -7403,19 +7382,16 @@ class DiagnoseResponseResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseResponseResultValue'}, + "value": {"key": "value", "type": "DiagnoseResponseResultValue"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: :paramtype value: ~azure.mgmt.machinelearningservices.models.DiagnoseResponseResultValue """ super(DiagnoseResponseResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class DiagnoseResponseResultValue(msrest.serialization.Model): @@ -7448,21 +7424,42 @@ class DiagnoseResponseResultValue(msrest.serialization.Model): """ _attribute_map = { - 'user_defined_route_results': {'key': 'userDefinedRouteResults', 'type': '[DiagnoseResult]'}, - 'network_security_rule_results': {'key': 'networkSecurityRuleResults', 'type': '[DiagnoseResult]'}, - 'resource_lock_results': {'key': 'resourceLockResults', 'type': '[DiagnoseResult]'}, - 'dns_resolution_results': {'key': 'dnsResolutionResults', 'type': '[DiagnoseResult]'}, - 'storage_account_results': {'key': 'storageAccountResults', 'type': '[DiagnoseResult]'}, - 'key_vault_results': {'key': 'keyVaultResults', 'type': '[DiagnoseResult]'}, - 'container_registry_results': {'key': 'containerRegistryResults', 'type': '[DiagnoseResult]'}, - 'application_insights_results': {'key': 'applicationInsightsResults', 'type': '[DiagnoseResult]'}, - 'other_results': {'key': 'otherResults', 'type': '[DiagnoseResult]'}, - } - - def __init__( - self, - **kwargs - ): + "user_defined_route_results": { + "key": "userDefinedRouteResults", + "type": "[DiagnoseResult]", + }, + "network_security_rule_results": { + "key": "networkSecurityRuleResults", + "type": "[DiagnoseResult]", + }, + "resource_lock_results": { + "key": "resourceLockResults", + "type": "[DiagnoseResult]", + }, + "dns_resolution_results": { + "key": "dnsResolutionResults", + "type": "[DiagnoseResult]", + }, + "storage_account_results": { + "key": "storageAccountResults", + "type": "[DiagnoseResult]", + }, + "key_vault_results": { + "key": "keyVaultResults", + "type": "[DiagnoseResult]", + }, + "container_registry_results": { + "key": "containerRegistryResults", + "type": "[DiagnoseResult]", + }, + "application_insights_results": { + "key": "applicationInsightsResults", + "type": "[DiagnoseResult]", + }, + "other_results": {"key": "otherResults", "type": "[DiagnoseResult]"}, + } + + def __init__(self, **kwargs): """ :keyword user_defined_route_results: :paramtype user_defined_route_results: @@ -7491,15 +7488,27 @@ def __init__( :paramtype other_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] """ super(DiagnoseResponseResultValue, self).__init__(**kwargs) - self.user_defined_route_results = kwargs.get('user_defined_route_results', None) - self.network_security_rule_results = kwargs.get('network_security_rule_results', None) - self.resource_lock_results = kwargs.get('resource_lock_results', None) - self.dns_resolution_results = kwargs.get('dns_resolution_results', None) - self.storage_account_results = kwargs.get('storage_account_results', None) - self.key_vault_results = kwargs.get('key_vault_results', None) - self.container_registry_results = kwargs.get('container_registry_results', None) - self.application_insights_results = kwargs.get('application_insights_results', None) - self.other_results = kwargs.get('other_results', None) + self.user_defined_route_results = kwargs.get( + "user_defined_route_results", None + ) + self.network_security_rule_results = kwargs.get( + "network_security_rule_results", None + ) + self.resource_lock_results = kwargs.get("resource_lock_results", None) + self.dns_resolution_results = kwargs.get( + "dns_resolution_results", None + ) + self.storage_account_results = kwargs.get( + "storage_account_results", None + ) + self.key_vault_results = kwargs.get("key_vault_results", None) + self.container_registry_results = kwargs.get( + "container_registry_results", None + ) + self.application_insights_results = kwargs.get( + "application_insights_results", None + ) + self.other_results = kwargs.get("other_results", None) class DiagnoseResult(msrest.serialization.Model): @@ -7517,23 +7526,19 @@ class DiagnoseResult(msrest.serialization.Model): """ _validation = { - 'code': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, + "code": {"readonly": True}, + "level": {"readonly": True}, + "message": {"readonly": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, + "code": {"key": "code", "type": "str"}, + "level": {"key": "level", "type": "str"}, + "message": {"key": "message", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DiagnoseResult, self).__init__(**kwargs) self.code = None self.level = None @@ -7548,19 +7553,16 @@ class DiagnoseWorkspaceParameters(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseRequestProperties'}, + "value": {"key": "value", "type": "DiagnoseRequestProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Value of Parameters. :paramtype value: ~azure.mgmt.machinelearningservices.models.DiagnoseRequestProperties """ super(DiagnoseWorkspaceParameters, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class DistributionConfiguration(msrest.serialization.Model): @@ -7577,23 +7579,23 @@ class DistributionConfiguration(msrest.serialization.Model): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, + "distribution_type": {"key": "distributionType", "type": "str"}, } _subtype_map = { - 'distribution_type': {'Mpi': 'Mpi', 'PyTorch': 'PyTorch', 'TensorFlow': 'TensorFlow'} + "distribution_type": { + "Mpi": "Mpi", + "PyTorch": "PyTorch", + "TensorFlow": "TensorFlow", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DistributionConfiguration, self).__init__(**kwargs) self.distribution_type = None # type: Optional[str] @@ -7614,20 +7616,17 @@ class EncryptionKeyVaultProperties(msrest.serialization.Model): """ _validation = { - 'key_vault_arm_id': {'required': True}, - 'key_identifier': {'required': True}, + "key_vault_arm_id": {"required": True}, + "key_identifier": {"required": True}, } _attribute_map = { - 'key_vault_arm_id': {'key': 'keyVaultArmId', 'type': 'str'}, - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - 'identity_client_id': {'key': 'identityClientId', 'type': 'str'}, + "key_vault_arm_id": {"key": "keyVaultArmId", "type": "str"}, + "key_identifier": {"key": "keyIdentifier", "type": "str"}, + "identity_client_id": {"key": "identityClientId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword key_vault_arm_id: Required. The ArmId of the keyVault where the customer owned encryption key is present. @@ -7639,9 +7638,9 @@ def __init__( :paramtype identity_client_id: str """ super(EncryptionKeyVaultProperties, self).__init__(**kwargs) - self.key_vault_arm_id = kwargs['key_vault_arm_id'] - self.key_identifier = kwargs['key_identifier'] - self.identity_client_id = kwargs.get('identity_client_id', None) + self.key_vault_arm_id = kwargs["key_vault_arm_id"] + self.key_identifier = kwargs["key_identifier"] + self.identity_client_id = kwargs.get("identity_client_id", None) class EncryptionProperty(msrest.serialization.Model): @@ -7660,20 +7659,20 @@ class EncryptionProperty(msrest.serialization.Model): """ _validation = { - 'status': {'required': True}, - 'key_vault_properties': {'required': True}, + "status": {"required": True}, + "key_vault_properties": {"required": True}, } _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityForCmk'}, - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'EncryptionKeyVaultProperties'}, + "status": {"key": "status", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityForCmk"}, + "key_vault_properties": { + "key": "keyVaultProperties", + "type": "EncryptionKeyVaultProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword status: Required. Indicates whether or not the encryption is enabled for the workspace. Possible values include: "Enabled", "Disabled". @@ -7686,9 +7685,9 @@ def __init__( ~azure.mgmt.machinelearningservices.models.EncryptionKeyVaultProperties """ super(EncryptionProperty, self).__init__(**kwargs) - self.status = kwargs['status'] - self.identity = kwargs.get('identity', None) - self.key_vault_properties = kwargs['key_vault_properties'] + self.status = kwargs["status"] + self.identity = kwargs.get("identity", None) + self.key_vault_properties = kwargs["key_vault_properties"] class EndpointAuthKeys(msrest.serialization.Model): @@ -7701,14 +7700,11 @@ class EndpointAuthKeys(msrest.serialization.Model): """ _attribute_map = { - 'primary_key': {'key': 'primaryKey', 'type': 'str'}, - 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, + "primary_key": {"key": "primaryKey", "type": "str"}, + "secondary_key": {"key": "secondaryKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword primary_key: The primary key. :paramtype primary_key: str @@ -7716,8 +7712,8 @@ def __init__( :paramtype secondary_key: str """ super(EndpointAuthKeys, self).__init__(**kwargs) - self.primary_key = kwargs.get('primary_key', None) - self.secondary_key = kwargs.get('secondary_key', None) + self.primary_key = kwargs.get("primary_key", None) + self.secondary_key = kwargs.get("secondary_key", None) class EndpointAuthToken(msrest.serialization.Model): @@ -7734,16 +7730,16 @@ class EndpointAuthToken(msrest.serialization.Model): """ _attribute_map = { - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'expiry_time_utc': {'key': 'expiryTimeUtc', 'type': 'long'}, - 'refresh_after_time_utc': {'key': 'refreshAfterTimeUtc', 'type': 'long'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, + "access_token": {"key": "accessToken", "type": "str"}, + "expiry_time_utc": {"key": "expiryTimeUtc", "type": "long"}, + "refresh_after_time_utc": { + "key": "refreshAfterTimeUtc", + "type": "long", + }, + "token_type": {"key": "tokenType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword access_token: Access token for endpoint authentication. :paramtype access_token: str @@ -7755,10 +7751,10 @@ def __init__( :paramtype token_type: str """ super(EndpointAuthToken, self).__init__(**kwargs) - self.access_token = kwargs.get('access_token', None) - self.expiry_time_utc = kwargs.get('expiry_time_utc', 0) - self.refresh_after_time_utc = kwargs.get('refresh_after_time_utc', 0) - self.token_type = kwargs.get('token_type', None) + self.access_token = kwargs.get("access_token", None) + self.expiry_time_utc = kwargs.get("expiry_time_utc", 0) + self.refresh_after_time_utc = kwargs.get("refresh_after_time_utc", 0) + self.token_type = kwargs.get("token_type", None) class ScheduleActionBase(msrest.serialization.Model): @@ -7775,23 +7771,22 @@ class ScheduleActionBase(msrest.serialization.Model): """ _validation = { - 'action_type': {'required': True}, + "action_type": {"required": True}, } _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, + "action_type": {"key": "actionType", "type": "str"}, } _subtype_map = { - 'action_type': {'CreateJob': 'JobScheduleAction', 'InvokeBatchEndpoint': 'EndpointScheduleAction'} + "action_type": { + "CreateJob": "JobScheduleAction", + "InvokeBatchEndpoint": "EndpointScheduleAction", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ScheduleActionBase, self).__init__(**kwargs) self.action_type = None # type: Optional[str] @@ -7806,41 +7801,43 @@ class EndpointScheduleAction(ScheduleActionBase): :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType :ivar endpoint_invocation_definition: Required. [Required] Defines Schedule action definition details. - - + + .. raw:: html - + . :vartype endpoint_invocation_definition: any """ _validation = { - 'action_type': {'required': True}, - 'endpoint_invocation_definition': {'required': True}, + "action_type": {"required": True}, + "endpoint_invocation_definition": {"required": True}, } _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'endpoint_invocation_definition': {'key': 'endpointInvocationDefinition', 'type': 'object'}, + "action_type": {"key": "actionType", "type": "str"}, + "endpoint_invocation_definition": { + "key": "endpointInvocationDefinition", + "type": "object", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword endpoint_invocation_definition: Required. [Required] Defines Schedule action definition details. - - + + .. raw:: html - + . :paramtype endpoint_invocation_definition: any """ super(EndpointScheduleAction, self).__init__(**kwargs) - self.action_type = 'InvokeBatchEndpoint' # type: str - self.endpoint_invocation_definition = kwargs['endpoint_invocation_definition'] + self.action_type = "InvokeBatchEndpoint" # type: str + self.endpoint_invocation_definition = kwargs[ + "endpoint_invocation_definition" + ] class EnvironmentContainer(Resource): @@ -7866,32 +7863,32 @@ class EnvironmentContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "EnvironmentContainerProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerProperties """ super(EnvironmentContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class EnvironmentContainerProperties(AssetContainer): @@ -7914,23 +7911,20 @@ class EnvironmentContainerProperties(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -7944,7 +7938,9 @@ def __init__( super(EnvironmentContainerProperties, self).__init__(**kwargs) -class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model): +class EnvironmentContainerResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of EnvironmentContainer entities. :ivar next_link: The link to the next page of EnvironmentContainer objects. If null, there are @@ -7955,14 +7951,11 @@ class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model) """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[EnvironmentContainer]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of EnvironmentContainer objects. If null, there are no additional pages. @@ -7970,9 +7963,11 @@ def __init__( :keyword value: An array of objects of type EnvironmentContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] """ - super(EnvironmentContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(EnvironmentContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class EnvironmentVersion(Resource): @@ -7998,31 +7993,31 @@ class EnvironmentVersion(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentVersionProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "EnvironmentVersionProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionProperties """ super(EnvironmentVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class EnvironmentVersionProperties(AssetBase): @@ -8047,29 +8042,29 @@ class EnvironmentVersionProperties(AssetBase): :vartype build: ~azure.mgmt.machinelearningservices.models.BuildContext :ivar conda_file: Standard configuration file used by Conda that lets you install any kind of package, including Python, R, and C/C++ packages. - - + + .. raw:: html - + . :vartype conda_file: str :ivar environment_type: Environment type is either user managed or curated by the Azure ML service - - + + .. raw:: html - + . Possible values include: "Curated", "UserCreated". :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType :ivar image: Name of the image that will be used for the environment. - - + + .. raw:: html - + . @@ -8082,28 +8077,28 @@ class EnvironmentVersionProperties(AssetBase): """ _validation = { - 'environment_type': {'readonly': True}, + "environment_type": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'auto_rebuild': {'key': 'autoRebuild', 'type': 'str'}, - 'build': {'key': 'build', 'type': 'BuildContext'}, - 'conda_file': {'key': 'condaFile', 'type': 'str'}, - 'environment_type': {'key': 'environmentType', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'str'}, - 'inference_config': {'key': 'inferenceConfig', 'type': 'InferenceContainerProperties'}, - 'os_type': {'key': 'osType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "auto_rebuild": {"key": "autoRebuild", "type": "str"}, + "build": {"key": "build", "type": "BuildContext"}, + "conda_file": {"key": "condaFile", "type": "str"}, + "environment_type": {"key": "environmentType", "type": "str"}, + "image": {"key": "image", "type": "str"}, + "inference_config": { + "key": "inferenceConfig", + "type": "InferenceContainerProperties", + }, + "os_type": {"key": "osType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -8122,19 +8117,19 @@ def __init__( :paramtype build: ~azure.mgmt.machinelearningservices.models.BuildContext :keyword conda_file: Standard configuration file used by Conda that lets you install any kind of package, including Python, R, and C/C++ packages. - - + + .. raw:: html - + . :paramtype conda_file: str :keyword image: Name of the image that will be used for the environment. - - + + .. raw:: html - + . @@ -8146,13 +8141,13 @@ def __init__( :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.OperatingSystemType """ super(EnvironmentVersionProperties, self).__init__(**kwargs) - self.auto_rebuild = kwargs.get('auto_rebuild', None) - self.build = kwargs.get('build', None) - self.conda_file = kwargs.get('conda_file', None) + self.auto_rebuild = kwargs.get("auto_rebuild", None) + self.build = kwargs.get("build", None) + self.conda_file = kwargs.get("conda_file", None) self.environment_type = None - self.image = kwargs.get('image', None) - self.inference_config = kwargs.get('inference_config', None) - self.os_type = kwargs.get('os_type', None) + self.image = kwargs.get("image", None) + self.inference_config = kwargs.get("inference_config", None) + self.os_type = kwargs.get("os_type", None) class EnvironmentVersionResourceArmPaginatedResult(msrest.serialization.Model): @@ -8166,14 +8161,11 @@ class EnvironmentVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentVersion]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[EnvironmentVersion]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of EnvironmentVersion objects. If null, there are no additional pages. @@ -8181,9 +8173,11 @@ def __init__( :keyword value: An array of objects of type EnvironmentVersion. :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] """ - super(EnvironmentVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(EnvironmentVersionResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class ErrorAdditionalInfo(msrest.serialization.Model): @@ -8198,21 +8192,17 @@ class ErrorAdditionalInfo(msrest.serialization.Model): """ _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, + "type": {"readonly": True}, + "info": {"readonly": True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, + "type": {"key": "type", "type": "str"}, + "info": {"key": "info", "type": "object"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ErrorAdditionalInfo, self).__init__(**kwargs) self.type = None self.info = None @@ -8236,27 +8226,26 @@ class ErrorDetail(msrest.serialization.Model): """ _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, + "code": {"readonly": True}, + "message": {"readonly": True}, + "target": {"readonly": True}, + "details": {"readonly": True}, + "additional_info": {"readonly": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[ErrorDetail]"}, + "additional_info": { + "key": "additionalInfo", + "type": "[ErrorAdditionalInfo]", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ErrorDetail, self).__init__(**kwargs) self.code = None self.message = None @@ -8273,19 +8262,16 @@ class ErrorResponse(msrest.serialization.Model): """ _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, + "error": {"key": "error", "type": "ErrorDetail"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword error: The error object. :paramtype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail """ super(ErrorResponse, self).__init__(**kwargs) - self.error = kwargs.get('error', None) + self.error = kwargs.get("error", None) class EstimatedVMPrice(msrest.serialization.Model): @@ -8304,21 +8290,18 @@ class EstimatedVMPrice(msrest.serialization.Model): """ _validation = { - 'retail_price': {'required': True}, - 'os_type': {'required': True}, - 'vm_tier': {'required': True}, + "retail_price": {"required": True}, + "os_type": {"required": True}, + "vm_tier": {"required": True}, } _attribute_map = { - 'retail_price': {'key': 'retailPrice', 'type': 'float'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_tier': {'key': 'vmTier', 'type': 'str'}, + "retail_price": {"key": "retailPrice", "type": "float"}, + "os_type": {"key": "osType", "type": "str"}, + "vm_tier": {"key": "vmTier", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword retail_price: Required. The price charged for using the VM. :paramtype retail_price: float @@ -8330,9 +8313,9 @@ def __init__( :paramtype vm_tier: str or ~azure.mgmt.machinelearningservices.models.VMTier """ super(EstimatedVMPrice, self).__init__(**kwargs) - self.retail_price = kwargs['retail_price'] - self.os_type = kwargs['os_type'] - self.vm_tier = kwargs['vm_tier'] + self.retail_price = kwargs["retail_price"] + self.os_type = kwargs["os_type"] + self.vm_tier = kwargs["vm_tier"] class EstimatedVMPrices(msrest.serialization.Model): @@ -8352,21 +8335,18 @@ class EstimatedVMPrices(msrest.serialization.Model): """ _validation = { - 'billing_currency': {'required': True}, - 'unit_of_measure': {'required': True}, - 'values': {'required': True}, + "billing_currency": {"required": True}, + "unit_of_measure": {"required": True}, + "values": {"required": True}, } _attribute_map = { - 'billing_currency': {'key': 'billingCurrency', 'type': 'str'}, - 'unit_of_measure': {'key': 'unitOfMeasure', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[EstimatedVMPrice]'}, + "billing_currency": {"key": "billingCurrency", "type": "str"}, + "unit_of_measure": {"key": "unitOfMeasure", "type": "str"}, + "values": {"key": "values", "type": "[EstimatedVMPrice]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword billing_currency: Required. Three lettered code specifying the currency of the VM price. Example: USD. Possible values include: "USD". @@ -8379,9 +8359,9 @@ def __init__( :paramtype values: list[~azure.mgmt.machinelearningservices.models.EstimatedVMPrice] """ super(EstimatedVMPrices, self).__init__(**kwargs) - self.billing_currency = kwargs['billing_currency'] - self.unit_of_measure = kwargs['unit_of_measure'] - self.values = kwargs['values'] + self.billing_currency = kwargs["billing_currency"] + self.unit_of_measure = kwargs["unit_of_measure"] + self.values = kwargs["values"] class ExternalFQDNResponse(msrest.serialization.Model): @@ -8392,19 +8372,16 @@ class ExternalFQDNResponse(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[FQDNEndpoints]'}, + "value": {"key": "value", "type": "[FQDNEndpoints]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: :paramtype value: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoints] """ super(ExternalFQDNResponse, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class FeaturizationSettings(msrest.serialization.Model): @@ -8415,19 +8392,16 @@ class FeaturizationSettings(msrest.serialization.Model): """ _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, + "dataset_language": {"key": "datasetLanguage", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword dataset_language: Dataset language, useful for the text data. :paramtype dataset_language: str """ super(FeaturizationSettings, self).__init__(**kwargs) - self.dataset_language = kwargs.get('dataset_language', None) + self.dataset_language = kwargs.get("dataset_language", None) class FlavorData(msrest.serialization.Model): @@ -8438,19 +8412,16 @@ class FlavorData(msrest.serialization.Model): """ _attribute_map = { - 'data': {'key': 'data', 'type': '{str}'}, + "data": {"key": "data", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data: Model flavor-specific data. :paramtype data: dict[str, str] """ super(FlavorData, self).__init__(**kwargs) - self.data = kwargs.get('data', None) + self.data = kwargs.get("data", None) class Forecasting(AutoMLVertical, TableVertical): @@ -8511,33 +8482,51 @@ class Forecasting(AutoMLVertical, TableVertical): """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'forecasting_settings': {'key': 'forecastingSettings', 'type': 'ForecastingSettings'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'ForecastingTrainingSettings'}, - } - - def __init__( - self, - **kwargs - ): + "task_type": {"required": True}, + "training_data": {"required": True}, + } + + _attribute_map = { + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "test_data": {"key": "testData", "type": "MLTableJobInput"}, + "test_data_size": {"key": "testDataSize", "type": "float"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "weight_column_name": {"key": "weightColumnName", "type": "str"}, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "forecasting_settings": { + "key": "forecastingSettings", + "type": "ForecastingSettings", + }, + "primary_metric": {"key": "primaryMetric", "type": "str"}, + "training_settings": { + "key": "trainingSettings", + "type": "ForecastingTrainingSettings", + }, + } + + def __init__(self, **kwargs): """ :keyword cv_split_column_names: Columns to use for CVSplit data. :paramtype cv_split_column_names: list[str] @@ -8588,22 +8577,24 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ForecastingTrainingSettings """ super(Forecasting, self).__init__(**kwargs) - self.cv_split_column_names = kwargs.get('cv_split_column_names', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.test_data = kwargs.get('test_data', None) - self.test_data_size = kwargs.get('test_data_size', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.weight_column_name = kwargs.get('weight_column_name', None) - self.task_type = 'Forecasting' # type: str - self.forecasting_settings = kwargs.get('forecasting_settings', None) - self.primary_metric = kwargs.get('primary_metric', None) - self.training_settings = kwargs.get('training_settings', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.cv_split_column_names = kwargs.get("cv_split_column_names", None) + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.limit_settings = kwargs.get("limit_settings", None) + self.n_cross_validations = kwargs.get("n_cross_validations", None) + self.test_data = kwargs.get("test_data", None) + self.test_data_size = kwargs.get("test_data_size", None) + self.validation_data = kwargs.get("validation_data", None) + self.validation_data_size = kwargs.get("validation_data_size", None) + self.weight_column_name = kwargs.get("weight_column_name", None) + self.task_type = "Forecasting" # type: str + self.forecasting_settings = kwargs.get("forecasting_settings", None) + self.primary_metric = kwargs.get("primary_metric", None) + self.training_settings = kwargs.get("training_settings", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class ForecastingSettings(msrest.serialization.Model): @@ -8661,25 +8652,40 @@ class ForecastingSettings(msrest.serialization.Model): """ _attribute_map = { - 'country_or_region_for_holidays': {'key': 'countryOrRegionForHolidays', 'type': 'str'}, - 'cv_step_size': {'key': 'cvStepSize', 'type': 'int'}, - 'feature_lags': {'key': 'featureLags', 'type': 'str'}, - 'forecast_horizon': {'key': 'forecastHorizon', 'type': 'ForecastHorizon'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'seasonality': {'key': 'seasonality', 'type': 'Seasonality'}, - 'short_series_handling_config': {'key': 'shortSeriesHandlingConfig', 'type': 'str'}, - 'target_aggregate_function': {'key': 'targetAggregateFunction', 'type': 'str'}, - 'target_lags': {'key': 'targetLags', 'type': 'TargetLags'}, - 'target_rolling_window_size': {'key': 'targetRollingWindowSize', 'type': 'TargetRollingWindowSize'}, - 'time_column_name': {'key': 'timeColumnName', 'type': 'str'}, - 'time_series_id_column_names': {'key': 'timeSeriesIdColumnNames', 'type': '[str]'}, - 'use_stl': {'key': 'useStl', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + "country_or_region_for_holidays": { + "key": "countryOrRegionForHolidays", + "type": "str", + }, + "cv_step_size": {"key": "cvStepSize", "type": "int"}, + "feature_lags": {"key": "featureLags", "type": "str"}, + "forecast_horizon": { + "key": "forecastHorizon", + "type": "ForecastHorizon", + }, + "frequency": {"key": "frequency", "type": "str"}, + "seasonality": {"key": "seasonality", "type": "Seasonality"}, + "short_series_handling_config": { + "key": "shortSeriesHandlingConfig", + "type": "str", + }, + "target_aggregate_function": { + "key": "targetAggregateFunction", + "type": "str", + }, + "target_lags": {"key": "targetLags", "type": "TargetLags"}, + "target_rolling_window_size": { + "key": "targetRollingWindowSize", + "type": "TargetRollingWindowSize", + }, + "time_column_name": {"key": "timeColumnName", "type": "str"}, + "time_series_id_column_names": { + "key": "timeSeriesIdColumnNames", + "type": "[str]", + }, + "use_stl": {"key": "useStl", "type": "str"}, + } + + def __init__(self, **kwargs): """ :keyword country_or_region_for_holidays: Country or region for holidays for forecasting tasks. These should be ISO 3166 two-letter country/region codes, for example 'US' or 'GB'. @@ -8734,19 +8740,29 @@ def __init__( :paramtype use_stl: str or ~azure.mgmt.machinelearningservices.models.UseStl """ super(ForecastingSettings, self).__init__(**kwargs) - self.country_or_region_for_holidays = kwargs.get('country_or_region_for_holidays', None) - self.cv_step_size = kwargs.get('cv_step_size', None) - self.feature_lags = kwargs.get('feature_lags', None) - self.forecast_horizon = kwargs.get('forecast_horizon', None) - self.frequency = kwargs.get('frequency', None) - self.seasonality = kwargs.get('seasonality', None) - self.short_series_handling_config = kwargs.get('short_series_handling_config', None) - self.target_aggregate_function = kwargs.get('target_aggregate_function', None) - self.target_lags = kwargs.get('target_lags', None) - self.target_rolling_window_size = kwargs.get('target_rolling_window_size', None) - self.time_column_name = kwargs.get('time_column_name', None) - self.time_series_id_column_names = kwargs.get('time_series_id_column_names', None) - self.use_stl = kwargs.get('use_stl', None) + self.country_or_region_for_holidays = kwargs.get( + "country_or_region_for_holidays", None + ) + self.cv_step_size = kwargs.get("cv_step_size", None) + self.feature_lags = kwargs.get("feature_lags", None) + self.forecast_horizon = kwargs.get("forecast_horizon", None) + self.frequency = kwargs.get("frequency", None) + self.seasonality = kwargs.get("seasonality", None) + self.short_series_handling_config = kwargs.get( + "short_series_handling_config", None + ) + self.target_aggregate_function = kwargs.get( + "target_aggregate_function", None + ) + self.target_lags = kwargs.get("target_lags", None) + self.target_rolling_window_size = kwargs.get( + "target_rolling_window_size", None + ) + self.time_column_name = kwargs.get("time_column_name", None) + self.time_series_id_column_names = kwargs.get( + "time_series_id_column_names", None + ) + self.use_stl = kwargs.get("use_stl", None) class ForecastingTrainingSettings(TrainingSettings): @@ -8778,21 +8794,39 @@ class ForecastingTrainingSettings(TrainingSettings): """ _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): + "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, + "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, + "allowed_training_algorithms": { + "key": "allowedTrainingAlgorithms", + "type": "[str]", + }, + "blocked_training_algorithms": { + "key": "blockedTrainingAlgorithms", + "type": "[str]", + }, + } + + def __init__(self, **kwargs): """ :keyword enable_dnn_training: Enable recommendation of DNN models. :paramtype enable_dnn_training: bool @@ -8819,8 +8853,12 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ForecastingModels] """ super(ForecastingTrainingSettings, self).__init__(**kwargs) - self.allowed_training_algorithms = kwargs.get('allowed_training_algorithms', None) - self.blocked_training_algorithms = kwargs.get('blocked_training_algorithms', None) + self.allowed_training_algorithms = kwargs.get( + "allowed_training_algorithms", None + ) + self.blocked_training_algorithms = kwargs.get( + "blocked_training_algorithms", None + ) class FQDNEndpoint(msrest.serialization.Model): @@ -8833,14 +8871,14 @@ class FQDNEndpoint(msrest.serialization.Model): """ _attribute_map = { - 'domain_name': {'key': 'domainName', 'type': 'str'}, - 'endpoint_details': {'key': 'endpointDetails', 'type': '[FQDNEndpointDetail]'}, + "domain_name": {"key": "domainName", "type": "str"}, + "endpoint_details": { + "key": "endpointDetails", + "type": "[FQDNEndpointDetail]", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword domain_name: :paramtype domain_name: str @@ -8849,8 +8887,8 @@ def __init__( list[~azure.mgmt.machinelearningservices.models.FQDNEndpointDetail] """ super(FQDNEndpoint, self).__init__(**kwargs) - self.domain_name = kwargs.get('domain_name', None) - self.endpoint_details = kwargs.get('endpoint_details', None) + self.domain_name = kwargs.get("domain_name", None) + self.endpoint_details = kwargs.get("endpoint_details", None) class FQDNEndpointDetail(msrest.serialization.Model): @@ -8861,19 +8899,16 @@ class FQDNEndpointDetail(msrest.serialization.Model): """ _attribute_map = { - 'port': {'key': 'port', 'type': 'int'}, + "port": {"key": "port", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword port: :paramtype port: int """ super(FQDNEndpointDetail, self).__init__(**kwargs) - self.port = kwargs.get('port', None) + self.port = kwargs.get("port", None) class FQDNEndpoints(msrest.serialization.Model): @@ -8884,19 +8919,16 @@ class FQDNEndpoints(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'FQDNEndpointsProperties'}, + "properties": {"key": "properties", "type": "FQDNEndpointsProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: :paramtype properties: ~azure.mgmt.machinelearningservices.models.FQDNEndpointsProperties """ super(FQDNEndpoints, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class FQDNEndpointsProperties(msrest.serialization.Model): @@ -8909,14 +8941,11 @@ class FQDNEndpointsProperties(msrest.serialization.Model): """ _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'endpoints': {'key': 'endpoints', 'type': '[FQDNEndpoint]'}, + "category": {"key": "category", "type": "str"}, + "endpoints": {"key": "endpoints", "type": "[FQDNEndpoint]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: :paramtype category: str @@ -8924,8 +8953,8 @@ def __init__( :paramtype endpoints: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoint] """ super(FQDNEndpointsProperties, self).__init__(**kwargs) - self.category = kwargs.get('category', None) - self.endpoints = kwargs.get('endpoints', None) + self.category = kwargs.get("category", None) + self.endpoints = kwargs.get("endpoints", None) class GridSamplingAlgorithm(SamplingAlgorithm): @@ -8941,21 +8970,20 @@ class GridSamplingAlgorithm(SamplingAlgorithm): """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(GridSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Grid' # type: str + self.sampling_algorithm_type = "Grid" # type: str class HDInsightSchema(msrest.serialization.Model): @@ -8966,19 +8994,16 @@ class HDInsightSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, + "properties": {"key": "properties", "type": "HDInsightProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: HDInsight compute properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties """ super(HDInsightSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class HDInsight(Compute, HDInsightSchema): @@ -9020,34 +9045,34 @@ class HDInsight(Compute, HDInsightSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + "disable_local_auth": {"readonly": True}, + } + + _attribute_map = { + "properties": {"key": "properties", "type": "HDInsightProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, + } + + def __init__(self, **kwargs): """ :keyword properties: HDInsight compute properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties @@ -9057,14 +9082,14 @@ def __init__( :paramtype resource_id: str """ super(HDInsight, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'HDInsight' # type: str + self.properties = kwargs.get("properties", None) + self.compute_type = "HDInsight" # type: str self.compute_location = None self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None self.disable_local_auth = None @@ -9083,15 +9108,15 @@ class HDInsightProperties(msrest.serialization.Model): """ _attribute_map = { - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, + "ssh_port": {"key": "sshPort", "type": "int"}, + "address": {"key": "address", "type": "str"}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword ssh_port: Port open for ssh connections on the master node of the cluster. :paramtype ssh_port: int @@ -9102,9 +9127,9 @@ def __init__( ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials """ super(HDInsightProperties, self).__init__(**kwargs) - self.ssh_port = kwargs.get('ssh_port', None) - self.address = kwargs.get('address', None) - self.administrator_account = kwargs.get('administrator_account', None) + self.ssh_port = kwargs.get("ssh_port", None) + self.address = kwargs.get("address", None) + self.administrator_account = kwargs.get("administrator_account", None) class IdAssetReference(AssetReferenceBase): @@ -9120,26 +9145,23 @@ class IdAssetReference(AssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, - 'asset_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "reference_type": {"required": True}, + "asset_id": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'asset_id': {'key': 'assetId', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "asset_id": {"key": "assetId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword asset_id: Required. [Required] ARM resource ID of the asset. :paramtype asset_id: str """ super(IdAssetReference, self).__init__(**kwargs) - self.reference_type = 'Id' # type: str - self.asset_id = kwargs['asset_id'] + self.reference_type = "Id" # type: str + self.asset_id = kwargs["asset_id"] class IdentityForCmk(msrest.serialization.Model): @@ -9151,56 +9173,64 @@ class IdentityForCmk(msrest.serialization.Model): """ _attribute_map = { - 'user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, + "user_assigned_identity": { + "key": "userAssignedIdentity", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword user_assigned_identity: The ArmId of the user assigned identity that will be used to access the customer managed key vault. :paramtype user_assigned_identity: str """ super(IdentityForCmk, self).__init__(**kwargs) - self.user_assigned_identity = kwargs.get('user_assigned_identity', None) + self.user_assigned_identity = kwargs.get( + "user_assigned_identity", None + ) class ImageVertical(msrest.serialization.Model): """Abstract class for AutoML tasks that train image (computer vision) models - -such as Image Classification / Image Classification Multilabel / Image Object Detection / Image Instance Segmentation. + such as Image Classification / Image Classification Multilabel / Image Object Detection / Image Instance Segmentation. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float """ _validation = { - 'limit_settings': {'required': True}, + "limit_settings": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings @@ -9215,10 +9245,10 @@ def __init__( :paramtype validation_data_size: float """ super(ImageVertical, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) + self.limit_settings = kwargs["limit_settings"] + self.sweep_settings = kwargs.get("sweep_settings", None) + self.validation_data = kwargs.get("validation_data", None) + self.validation_data_size = kwargs.get("validation_data_size", None) class ImageClassificationBase(ImageVertical): @@ -9247,22 +9277,34 @@ class ImageClassificationBase(ImageVertical): """ _validation = { - 'limit_settings': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - } - - def __init__( - self, - **kwargs - ): + "limit_settings": {"required": True}, + } + + _attribute_map = { + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsClassification", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsClassification]", + }, + } + + def __init__(self, **kwargs): """ :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings @@ -9284,78 +9326,90 @@ def __init__( list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] """ super(ImageClassificationBase, self).__init__(**kwargs) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) + self.model_settings = kwargs.get("model_settings", None) + self.search_space = kwargs.get("search_space", None) class ImageClassification(AutoMLVertical, ImageClassificationBase): """Image Classification. Multi-class image classification is used when an image is classified with only a single label -from a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' or a 'duck'. + from a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' or a 'duck'. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + "limit_settings": {"required": True}, + "task_type": {"required": True}, + "training_data": {"required": True}, + } + + _attribute_map = { + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsClassification", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsClassification]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, + } + + def __init__(self, **kwargs): """ :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings @@ -9390,87 +9444,99 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ super(ImageClassification, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageClassification' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.limit_settings = kwargs["limit_settings"] + self.sweep_settings = kwargs.get("sweep_settings", None) + self.validation_data = kwargs.get("validation_data", None) + self.validation_data_size = kwargs.get("validation_data_size", None) + self.model_settings = kwargs.get("model_settings", None) + self.search_space = kwargs.get("search_space", None) + self.task_type = "ImageClassification" # type: str + self.primary_metric = kwargs.get("primary_metric", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class ImageClassificationMultilabel(AutoMLVertical, ImageClassificationBase): """Image Classification Multilabel. Multi-label image classification is used when an image could have one or more labels -from a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'. + from a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted", "IOU". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics """ _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + "limit_settings": {"required": True}, + "task_type": {"required": True}, + "training_data": {"required": True}, + } + + _attribute_map = { + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsClassification", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsClassification]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, + } + + def __init__(self, **kwargs): """ :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings @@ -9505,17 +9571,17 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics """ super(ImageClassificationMultilabel, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageClassificationMultilabel' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.limit_settings = kwargs["limit_settings"] + self.sweep_settings = kwargs.get("sweep_settings", None) + self.validation_data = kwargs.get("validation_data", None) + self.validation_data_size = kwargs.get("validation_data_size", None) + self.model_settings = kwargs.get("model_settings", None) + self.search_space = kwargs.get("search_space", None) + self.task_type = "ImageClassificationMultilabel" # type: str + self.primary_metric = kwargs.get("primary_metric", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class ImageObjectDetectionBase(ImageVertical): @@ -9544,22 +9610,34 @@ class ImageObjectDetectionBase(ImageVertical): """ _validation = { - 'limit_settings': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - } - - def __init__( - self, - **kwargs - ): + "limit_settings": {"required": True}, + } + + _attribute_map = { + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsObjectDetection", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsObjectDetection]", + }, + } + + def __init__(self, **kwargs): """ :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings @@ -9581,77 +9659,89 @@ def __init__( list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] """ super(ImageObjectDetectionBase, self).__init__(**kwargs) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) + self.model_settings = kwargs.get("model_settings", None) + self.search_space = kwargs.get("search_space", None) class ImageInstanceSegmentation(AutoMLVertical, ImageObjectDetectionBase): """Image Instance Segmentation. Instance segmentation is used to identify objects in an image at the pixel level, -drawing a polygon around each object in the image. + drawing a polygon around each object in the image. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "MeanAveragePrecision". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics """ _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + "limit_settings": {"required": True}, + "task_type": {"required": True}, + "training_data": {"required": True}, + } + + _attribute_map = { + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsObjectDetection", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsObjectDetection]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, + } + + def __init__(self, **kwargs): """ :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings @@ -9685,17 +9775,17 @@ def __init__( ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics """ super(ImageInstanceSegmentation, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageInstanceSegmentation' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.limit_settings = kwargs["limit_settings"] + self.sweep_settings = kwargs.get("sweep_settings", None) + self.validation_data = kwargs.get("validation_data", None) + self.validation_data_size = kwargs.get("validation_data_size", None) + self.model_settings = kwargs.get("model_settings", None) + self.search_space = kwargs.get("search_space", None) + self.task_type = "ImageInstanceSegmentation" # type: str + self.primary_metric = kwargs.get("primary_metric", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class ImageLimitSettings(msrest.serialization.Model): @@ -9710,15 +9800,12 @@ class ImageLimitSettings(msrest.serialization.Model): """ _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_trials": {"key": "maxTrials", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword max_concurrent_trials: Maximum number of concurrent AutoML iterations. :paramtype max_concurrent_trials: int @@ -9728,143 +9815,158 @@ def __init__( :paramtype timeout: ~datetime.timedelta """ super(ImageLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', 1) - self.max_trials = kwargs.get('max_trials', 1) - self.timeout = kwargs.get('timeout', "P7D") + self.max_concurrent_trials = kwargs.get("max_concurrent_trials", 1) + self.max_trials = kwargs.get("max_trials", 1) + self.timeout = kwargs.get("timeout", "P7D") class ImageModelDistributionSettings(msrest.serialization.Model): """Distribution expressions to sweep over values of model settings. -:code:` -Some examples are: - -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -` -All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) -where distribution name can be: uniform, quniform, loguniform, etc -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + :code:` + Some examples are: + + ModelName = "choice('seresnext', 'resnest50')"; + LearningRate = "uniform(0.001, 0.01)"; + LayersToFreeze = "choice(0, 2)"; + ` + All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) + where distribution name can be: uniform, quniform, loguniform, etc + For more details on how to compose distribution expressions please check the documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: str + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: str + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: str + :ivar distributed: Whether to use distributer training. + :vartype distributed: str + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: str + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: str + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: str + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: str + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: str + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: str + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: str + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: str + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. + :vartype learning_rate_scheduler: str + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: str + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: str + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: str + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: str + :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. + :vartype optimizer: str + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: str + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: str + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: str + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: str + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: str + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: str + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: str + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: str + """ + + _attribute_map = { + "ams_gradient": {"key": "amsGradient", "type": "str"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "str"}, + "beta2": {"key": "beta2", "type": "str"}, + "distributed": {"key": "distributed", "type": "str"}, + "early_stopping": {"key": "earlyStopping", "type": "str"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "str"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "str", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "str", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "str"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "str", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "str"}, + "nesterov": {"key": "nesterov", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "str"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "str"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "str"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "str"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "str"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "str", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "str", + }, + "weight_decay": {"key": "weightDecay", "type": "str"}, + } + + def __init__(self, **kwargs): """ :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :paramtype ams_gradient: str @@ -9948,183 +10050,215 @@ def __init__( :paramtype weight_decay: str """ super(ImageModelDistributionSettings, self).__init__(**kwargs) - self.ams_gradient = kwargs.get('ams_gradient', None) - self.augmentations = kwargs.get('augmentations', None) - self.beta1 = kwargs.get('beta1', None) - self.beta2 = kwargs.get('beta2', None) - self.distributed = kwargs.get('distributed', None) - self.early_stopping = kwargs.get('early_stopping', None) - self.early_stopping_delay = kwargs.get('early_stopping_delay', None) - self.early_stopping_patience = kwargs.get('early_stopping_patience', None) - self.enable_onnx_normalization = kwargs.get('enable_onnx_normalization', None) - self.evaluation_frequency = kwargs.get('evaluation_frequency', None) - self.gradient_accumulation_step = kwargs.get('gradient_accumulation_step', None) - self.layers_to_freeze = kwargs.get('layers_to_freeze', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.learning_rate_scheduler = kwargs.get('learning_rate_scheduler', None) - self.model_name = kwargs.get('model_name', None) - self.momentum = kwargs.get('momentum', None) - self.nesterov = kwargs.get('nesterov', None) - self.number_of_epochs = kwargs.get('number_of_epochs', None) - self.number_of_workers = kwargs.get('number_of_workers', None) - self.optimizer = kwargs.get('optimizer', None) - self.random_seed = kwargs.get('random_seed', None) - self.step_lr_gamma = kwargs.get('step_lr_gamma', None) - self.step_lr_step_size = kwargs.get('step_lr_step_size', None) - self.training_batch_size = kwargs.get('training_batch_size', None) - self.validation_batch_size = kwargs.get('validation_batch_size', None) - self.warmup_cosine_lr_cycles = kwargs.get('warmup_cosine_lr_cycles', None) - self.warmup_cosine_lr_warmup_epochs = kwargs.get('warmup_cosine_lr_warmup_epochs', None) - self.weight_decay = kwargs.get('weight_decay', None) - - -class ImageModelDistributionSettingsClassification(ImageModelDistributionSettings): + self.ams_gradient = kwargs.get("ams_gradient", None) + self.augmentations = kwargs.get("augmentations", None) + self.beta1 = kwargs.get("beta1", None) + self.beta2 = kwargs.get("beta2", None) + self.distributed = kwargs.get("distributed", None) + self.early_stopping = kwargs.get("early_stopping", None) + self.early_stopping_delay = kwargs.get("early_stopping_delay", None) + self.early_stopping_patience = kwargs.get( + "early_stopping_patience", None + ) + self.enable_onnx_normalization = kwargs.get( + "enable_onnx_normalization", None + ) + self.evaluation_frequency = kwargs.get("evaluation_frequency", None) + self.gradient_accumulation_step = kwargs.get( + "gradient_accumulation_step", None + ) + self.layers_to_freeze = kwargs.get("layers_to_freeze", None) + self.learning_rate = kwargs.get("learning_rate", None) + self.learning_rate_scheduler = kwargs.get( + "learning_rate_scheduler", None + ) + self.model_name = kwargs.get("model_name", None) + self.momentum = kwargs.get("momentum", None) + self.nesterov = kwargs.get("nesterov", None) + self.number_of_epochs = kwargs.get("number_of_epochs", None) + self.number_of_workers = kwargs.get("number_of_workers", None) + self.optimizer = kwargs.get("optimizer", None) + self.random_seed = kwargs.get("random_seed", None) + self.step_lr_gamma = kwargs.get("step_lr_gamma", None) + self.step_lr_step_size = kwargs.get("step_lr_step_size", None) + self.training_batch_size = kwargs.get("training_batch_size", None) + self.validation_batch_size = kwargs.get("validation_batch_size", None) + self.warmup_cosine_lr_cycles = kwargs.get( + "warmup_cosine_lr_cycles", None + ) + self.warmup_cosine_lr_warmup_epochs = kwargs.get( + "warmup_cosine_lr_warmup_epochs", None + ) + self.weight_decay = kwargs.get("weight_decay", None) + + +class ImageModelDistributionSettingsClassification( + ImageModelDistributionSettings +): """Distribution expressions to sweep over values of model settings. -:code:` -Some examples are: - -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: str - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: str - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: str - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'str'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'str'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'str'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + :code:` + Some examples are: + + ModelName = "choice('seresnext', 'resnest50')"; + LearningRate = "uniform(0.001, 0.01)"; + LayersToFreeze = "choice(0, 2)"; + ` + For more details on how to compose distribution expressions please check the documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: str + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: str + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: str + :ivar distributed: Whether to use distributer training. + :vartype distributed: str + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: str + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: str + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: str + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: str + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: str + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: str + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: str + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: str + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. + :vartype learning_rate_scheduler: str + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: str + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: str + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: str + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: str + :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. + :vartype optimizer: str + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: str + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: str + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: str + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: str + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: str + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: str + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: str + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: str + :ivar training_crop_size: Image crop size that is input to the neural network for the training + dataset. Must be a positive integer. + :vartype training_crop_size: str + :ivar validation_crop_size: Image crop size that is input to the neural network for the + validation dataset. Must be a positive integer. + :vartype validation_crop_size: str + :ivar validation_resize_size: Image size to which to resize before cropping for validation + dataset. Must be a positive integer. + :vartype validation_resize_size: str + :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. + 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be + 0 or 1 or 2. + :vartype weighted_loss: str + """ + + _attribute_map = { + "ams_gradient": {"key": "amsGradient", "type": "str"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "str"}, + "beta2": {"key": "beta2", "type": "str"}, + "distributed": {"key": "distributed", "type": "str"}, + "early_stopping": {"key": "earlyStopping", "type": "str"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "str"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "str", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "str", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "str"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "str", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "str"}, + "nesterov": {"key": "nesterov", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "str"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "str"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "str"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "str"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "str"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "str", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "str", + }, + "weight_decay": {"key": "weightDecay", "type": "str"}, + "training_crop_size": {"key": "trainingCropSize", "type": "str"}, + "validation_crop_size": {"key": "validationCropSize", "type": "str"}, + "validation_resize_size": { + "key": "validationResizeSize", + "type": "str", + }, + "weighted_loss": {"key": "weightedLoss", "type": "str"}, + } + + def __init__(self, **kwargs): """ :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :paramtype ams_gradient: str @@ -10220,208 +10354,241 @@ def __init__( 0 or 1 or 2. :paramtype weighted_loss: str """ - super(ImageModelDistributionSettingsClassification, self).__init__(**kwargs) - self.training_crop_size = kwargs.get('training_crop_size', None) - self.validation_crop_size = kwargs.get('validation_crop_size', None) - self.validation_resize_size = kwargs.get('validation_resize_size', None) - self.weighted_loss = kwargs.get('weighted_loss', None) + super(ImageModelDistributionSettingsClassification, self).__init__( + **kwargs + ) + self.training_crop_size = kwargs.get("training_crop_size", None) + self.validation_crop_size = kwargs.get("validation_crop_size", None) + self.validation_resize_size = kwargs.get( + "validation_resize_size", None + ) + self.weighted_loss = kwargs.get("weighted_loss", None) -class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettings): +class ImageModelDistributionSettingsObjectDetection( + ImageModelDistributionSettings +): """Distribution expressions to sweep over values of model settings. -:code:` -Some examples are: - -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: str - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: str - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: str - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: str - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: str - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype model_size: str - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: str - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - float in the range [0, 1]. - :vartype nms_iou_threshold: str - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: str - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - NMS: Non-maximum suppression. - :vartype tile_predictions_nms_threshold: str - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: str - :ivar validation_metric_type: Metric computation method to use for validation metrics. Must be - 'none', 'coco', 'voc', or 'coco_voc'. - :vartype validation_metric_type: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'str'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'str'}, - 'image_size': {'key': 'imageSize', 'type': 'str'}, - 'max_size': {'key': 'maxSize', 'type': 'str'}, - 'min_size': {'key': 'minSize', 'type': 'str'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'str'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'str'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'str'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'str'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'str'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + :code:` + Some examples are: + + ModelName = "choice('seresnext', 'resnest50')"; + LearningRate = "uniform(0.001, 0.01)"; + LayersToFreeze = "choice(0, 2)"; + ` + For more details on how to compose distribution expressions please check the documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: str + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: str + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: str + :ivar distributed: Whether to use distributer training. + :vartype distributed: str + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: str + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: str + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: str + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: str + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: str + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: str + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: str + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: str + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. + :vartype learning_rate_scheduler: str + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: str + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: str + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: str + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: str + :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. + :vartype optimizer: str + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: str + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: str + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: str + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: str + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: str + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: str + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: str + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: str + :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must + be a positive integer. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype box_detections_per_image: str + :ivar box_score_threshold: During inference, only return proposals with a classification score + greater than + BoxScoreThreshold. Must be a float in the range[0, 1]. + :vartype box_score_threshold: str + :ivar image_size: Image size for train and validation. Must be a positive integer. + Note: The training run may get into CUDA OOM if the size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype image_size: str + :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype max_size: str + :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype min_size: str + :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. + Note: training run may get into CUDA OOM if the model size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype model_size: str + :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. + Note: training run may get into CUDA OOM if no sufficient GPU memory. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype multi_scale: str + :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be + float in the range [0, 1]. + :vartype nms_iou_threshold: str + :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not + be + None to enable small object detection logic. A string containing two integers in mxn format. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_grid_size: str + :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float + in the range [0, 1). + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_overlap_ratio: str + :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging + predictions from tiles and image. + Used in validation/ inference. Must be float in the range [0, 1]. + Note: This settings is not supported for the 'yolov5' algorithm. + NMS: Non-maximum suppression. + :vartype tile_predictions_nms_threshold: str + :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be + float in the range [0, 1]. + :vartype validation_iou_threshold: str + :ivar validation_metric_type: Metric computation method to use for validation metrics. Must be + 'none', 'coco', 'voc', or 'coco_voc'. + :vartype validation_metric_type: str + """ + + _attribute_map = { + "ams_gradient": {"key": "amsGradient", "type": "str"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "str"}, + "beta2": {"key": "beta2", "type": "str"}, + "distributed": {"key": "distributed", "type": "str"}, + "early_stopping": {"key": "earlyStopping", "type": "str"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "str"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "str", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "str", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "str"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "str", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "str"}, + "nesterov": {"key": "nesterov", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "str"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "str"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "str"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "str"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "str"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "str", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "str", + }, + "weight_decay": {"key": "weightDecay", "type": "str"}, + "box_detections_per_image": { + "key": "boxDetectionsPerImage", + "type": "str", + }, + "box_score_threshold": {"key": "boxScoreThreshold", "type": "str"}, + "image_size": {"key": "imageSize", "type": "str"}, + "max_size": {"key": "maxSize", "type": "str"}, + "min_size": {"key": "minSize", "type": "str"}, + "model_size": {"key": "modelSize", "type": "str"}, + "multi_scale": {"key": "multiScale", "type": "str"}, + "nms_iou_threshold": {"key": "nmsIouThreshold", "type": "str"}, + "tile_grid_size": {"key": "tileGridSize", "type": "str"}, + "tile_overlap_ratio": {"key": "tileOverlapRatio", "type": "str"}, + "tile_predictions_nms_threshold": { + "key": "tilePredictionsNmsThreshold", + "type": "str", + }, + "validation_iou_threshold": { + "key": "validationIouThreshold", + "type": "str", + }, + "validation_metric_type": { + "key": "validationMetricType", + "type": "str", + }, + } + + def __init__(self, **kwargs): """ :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :paramtype ams_gradient: str @@ -10556,156 +10723,184 @@ def __init__( be 'none', 'coco', 'voc', or 'coco_voc'. :paramtype validation_metric_type: str """ - super(ImageModelDistributionSettingsObjectDetection, self).__init__(**kwargs) - self.box_detections_per_image = kwargs.get('box_detections_per_image', None) - self.box_score_threshold = kwargs.get('box_score_threshold', None) - self.image_size = kwargs.get('image_size', None) - self.max_size = kwargs.get('max_size', None) - self.min_size = kwargs.get('min_size', None) - self.model_size = kwargs.get('model_size', None) - self.multi_scale = kwargs.get('multi_scale', None) - self.nms_iou_threshold = kwargs.get('nms_iou_threshold', None) - self.tile_grid_size = kwargs.get('tile_grid_size', None) - self.tile_overlap_ratio = kwargs.get('tile_overlap_ratio', None) - self.tile_predictions_nms_threshold = kwargs.get('tile_predictions_nms_threshold', None) - self.validation_iou_threshold = kwargs.get('validation_iou_threshold', None) - self.validation_metric_type = kwargs.get('validation_metric_type', None) + super(ImageModelDistributionSettingsObjectDetection, self).__init__( + **kwargs + ) + self.box_detections_per_image = kwargs.get( + "box_detections_per_image", None + ) + self.box_score_threshold = kwargs.get("box_score_threshold", None) + self.image_size = kwargs.get("image_size", None) + self.max_size = kwargs.get("max_size", None) + self.min_size = kwargs.get("min_size", None) + self.model_size = kwargs.get("model_size", None) + self.multi_scale = kwargs.get("multi_scale", None) + self.nms_iou_threshold = kwargs.get("nms_iou_threshold", None) + self.tile_grid_size = kwargs.get("tile_grid_size", None) + self.tile_overlap_ratio = kwargs.get("tile_overlap_ratio", None) + self.tile_predictions_nms_threshold = kwargs.get( + "tile_predictions_nms_threshold", None + ) + self.validation_iou_threshold = kwargs.get( + "validation_iou_threshold", None + ) + self.validation_metric_type = kwargs.get( + "validation_metric_type", None + ) class ImageModelSettings(msrest.serialization.Model): """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar advanced_settings: Settings for advanced scenarios. + :vartype advanced_settings: str + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: bool + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: float + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: float + :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. + :vartype checkpoint_frequency: int + :ivar checkpoint_model: The pretrained checkpoint model for incremental training. + :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput + :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for + incremental training. + :vartype checkpoint_run_id: str + :ivar distributed: Whether to use distributed training. + :vartype distributed: bool + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: bool + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: int + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: int + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: bool + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: int + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: int + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: int + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: float + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. Possible values include: "None", "WarmupCosine", "Step". + :vartype learning_rate_scheduler: str or + ~azure.mgmt.machinelearningservices.models.LearningRateScheduler + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: float + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: bool + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: int + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: int + :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". + :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: int + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: float + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: int + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: int + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: int + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: float + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: int + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: float + """ + + _attribute_map = { + "advanced_settings": {"key": "advancedSettings", "type": "str"}, + "ams_gradient": {"key": "amsGradient", "type": "bool"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "float"}, + "beta2": {"key": "beta2", "type": "float"}, + "checkpoint_frequency": {"key": "checkpointFrequency", "type": "int"}, + "checkpoint_model": { + "key": "checkpointModel", + "type": "MLFlowModelJobInput", + }, + "checkpoint_run_id": {"key": "checkpointRunId", "type": "str"}, + "distributed": {"key": "distributed", "type": "bool"}, + "early_stopping": {"key": "earlyStopping", "type": "bool"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "int"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "int", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "bool", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "int"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "int", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "int"}, + "learning_rate": {"key": "learningRate", "type": "float"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "float"}, + "nesterov": {"key": "nesterov", "type": "bool"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "int"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "int"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "int"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "float"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "int"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "float", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "int", + }, + "weight_decay": {"key": "weightDecay", "type": "float"}, + } + + def __init__(self, **kwargs): """ :keyword advanced_settings: Settings for advanced scenarios. :paramtype advanced_settings: str @@ -10800,191 +10995,224 @@ def __init__( :paramtype weight_decay: float """ super(ImageModelSettings, self).__init__(**kwargs) - self.advanced_settings = kwargs.get('advanced_settings', None) - self.ams_gradient = kwargs.get('ams_gradient', None) - self.augmentations = kwargs.get('augmentations', None) - self.beta1 = kwargs.get('beta1', None) - self.beta2 = kwargs.get('beta2', None) - self.checkpoint_frequency = kwargs.get('checkpoint_frequency', None) - self.checkpoint_model = kwargs.get('checkpoint_model', None) - self.checkpoint_run_id = kwargs.get('checkpoint_run_id', None) - self.distributed = kwargs.get('distributed', None) - self.early_stopping = kwargs.get('early_stopping', None) - self.early_stopping_delay = kwargs.get('early_stopping_delay', None) - self.early_stopping_patience = kwargs.get('early_stopping_patience', None) - self.enable_onnx_normalization = kwargs.get('enable_onnx_normalization', None) - self.evaluation_frequency = kwargs.get('evaluation_frequency', None) - self.gradient_accumulation_step = kwargs.get('gradient_accumulation_step', None) - self.layers_to_freeze = kwargs.get('layers_to_freeze', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.learning_rate_scheduler = kwargs.get('learning_rate_scheduler', None) - self.model_name = kwargs.get('model_name', None) - self.momentum = kwargs.get('momentum', None) - self.nesterov = kwargs.get('nesterov', None) - self.number_of_epochs = kwargs.get('number_of_epochs', None) - self.number_of_workers = kwargs.get('number_of_workers', None) - self.optimizer = kwargs.get('optimizer', None) - self.random_seed = kwargs.get('random_seed', None) - self.step_lr_gamma = kwargs.get('step_lr_gamma', None) - self.step_lr_step_size = kwargs.get('step_lr_step_size', None) - self.training_batch_size = kwargs.get('training_batch_size', None) - self.validation_batch_size = kwargs.get('validation_batch_size', None) - self.warmup_cosine_lr_cycles = kwargs.get('warmup_cosine_lr_cycles', None) - self.warmup_cosine_lr_warmup_epochs = kwargs.get('warmup_cosine_lr_warmup_epochs', None) - self.weight_decay = kwargs.get('weight_decay', None) + self.advanced_settings = kwargs.get("advanced_settings", None) + self.ams_gradient = kwargs.get("ams_gradient", None) + self.augmentations = kwargs.get("augmentations", None) + self.beta1 = kwargs.get("beta1", None) + self.beta2 = kwargs.get("beta2", None) + self.checkpoint_frequency = kwargs.get("checkpoint_frequency", None) + self.checkpoint_model = kwargs.get("checkpoint_model", None) + self.checkpoint_run_id = kwargs.get("checkpoint_run_id", None) + self.distributed = kwargs.get("distributed", None) + self.early_stopping = kwargs.get("early_stopping", None) + self.early_stopping_delay = kwargs.get("early_stopping_delay", None) + self.early_stopping_patience = kwargs.get( + "early_stopping_patience", None + ) + self.enable_onnx_normalization = kwargs.get( + "enable_onnx_normalization", None + ) + self.evaluation_frequency = kwargs.get("evaluation_frequency", None) + self.gradient_accumulation_step = kwargs.get( + "gradient_accumulation_step", None + ) + self.layers_to_freeze = kwargs.get("layers_to_freeze", None) + self.learning_rate = kwargs.get("learning_rate", None) + self.learning_rate_scheduler = kwargs.get( + "learning_rate_scheduler", None + ) + self.model_name = kwargs.get("model_name", None) + self.momentum = kwargs.get("momentum", None) + self.nesterov = kwargs.get("nesterov", None) + self.number_of_epochs = kwargs.get("number_of_epochs", None) + self.number_of_workers = kwargs.get("number_of_workers", None) + self.optimizer = kwargs.get("optimizer", None) + self.random_seed = kwargs.get("random_seed", None) + self.step_lr_gamma = kwargs.get("step_lr_gamma", None) + self.step_lr_step_size = kwargs.get("step_lr_step_size", None) + self.training_batch_size = kwargs.get("training_batch_size", None) + self.validation_batch_size = kwargs.get("validation_batch_size", None) + self.warmup_cosine_lr_cycles = kwargs.get( + "warmup_cosine_lr_cycles", None + ) + self.warmup_cosine_lr_warmup_epochs = kwargs.get( + "warmup_cosine_lr_warmup_epochs", None + ) + self.weight_decay = kwargs.get("weight_decay", None) class ImageModelSettingsClassification(ImageModelSettings): """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: int - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: int - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: int - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: int - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'int'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'int'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'int'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar advanced_settings: Settings for advanced scenarios. + :vartype advanced_settings: str + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: bool + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: float + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: float + :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. + :vartype checkpoint_frequency: int + :ivar checkpoint_model: The pretrained checkpoint model for incremental training. + :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput + :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for + incremental training. + :vartype checkpoint_run_id: str + :ivar distributed: Whether to use distributed training. + :vartype distributed: bool + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: bool + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: int + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: int + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: bool + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: int + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: int + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: int + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: float + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. Possible values include: "None", "WarmupCosine", "Step". + :vartype learning_rate_scheduler: str or + ~azure.mgmt.machinelearningservices.models.LearningRateScheduler + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: float + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: bool + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: int + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: int + :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". + :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: int + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: float + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: int + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: int + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: int + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: float + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: int + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: float + :ivar training_crop_size: Image crop size that is input to the neural network for the training + dataset. Must be a positive integer. + :vartype training_crop_size: int + :ivar validation_crop_size: Image crop size that is input to the neural network for the + validation dataset. Must be a positive integer. + :vartype validation_crop_size: int + :ivar validation_resize_size: Image size to which to resize before cropping for validation + dataset. Must be a positive integer. + :vartype validation_resize_size: int + :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. + 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be + 0 or 1 or 2. + :vartype weighted_loss: int + """ + + _attribute_map = { + "advanced_settings": {"key": "advancedSettings", "type": "str"}, + "ams_gradient": {"key": "amsGradient", "type": "bool"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "float"}, + "beta2": {"key": "beta2", "type": "float"}, + "checkpoint_frequency": {"key": "checkpointFrequency", "type": "int"}, + "checkpoint_model": { + "key": "checkpointModel", + "type": "MLFlowModelJobInput", + }, + "checkpoint_run_id": {"key": "checkpointRunId", "type": "str"}, + "distributed": {"key": "distributed", "type": "bool"}, + "early_stopping": {"key": "earlyStopping", "type": "bool"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "int"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "int", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "bool", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "int"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "int", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "int"}, + "learning_rate": {"key": "learningRate", "type": "float"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "float"}, + "nesterov": {"key": "nesterov", "type": "bool"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "int"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "int"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "int"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "float"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "int"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "float", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "int", + }, + "weight_decay": {"key": "weightDecay", "type": "float"}, + "training_crop_size": {"key": "trainingCropSize", "type": "int"}, + "validation_crop_size": {"key": "validationCropSize", "type": "int"}, + "validation_resize_size": { + "key": "validationResizeSize", + "type": "int", + }, + "weighted_loss": {"key": "weightedLoss", "type": "int"}, + } + + def __init__(self, **kwargs): """ :keyword advanced_settings: Settings for advanced scenarios. :paramtype advanced_settings: str @@ -11092,212 +11320,244 @@ def __init__( :paramtype weighted_loss: int """ super(ImageModelSettingsClassification, self).__init__(**kwargs) - self.training_crop_size = kwargs.get('training_crop_size', None) - self.validation_crop_size = kwargs.get('validation_crop_size', None) - self.validation_resize_size = kwargs.get('validation_resize_size', None) - self.weighted_loss = kwargs.get('weighted_loss', None) + self.training_crop_size = kwargs.get("training_crop_size", None) + self.validation_crop_size = kwargs.get("validation_crop_size", None) + self.validation_resize_size = kwargs.get( + "validation_resize_size", None + ) + self.weighted_loss = kwargs.get("weighted_loss", None) class ImageModelSettingsObjectDetection(ImageModelSettings): """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: int - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: float - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: int - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: int - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: int - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: - "None", "Small", "Medium", "Large", "ExtraLarge". - :vartype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: bool - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be a - float in the range [0, 1]. - :vartype nms_iou_threshold: float - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: float - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_predictions_nms_threshold: float - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: float - :ivar validation_metric_type: Metric computation method to use for validation metrics. Possible - values include: "None", "Coco", "Voc", "CocoVoc". - :vartype validation_metric_type: str or - ~azure.mgmt.machinelearningservices.models.ValidationMetricType - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'int'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'float'}, - 'image_size': {'key': 'imageSize', 'type': 'int'}, - 'max_size': {'key': 'maxSize', 'type': 'int'}, - 'min_size': {'key': 'minSize', 'type': 'int'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'bool'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'float'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'float'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'float'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'float'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar advanced_settings: Settings for advanced scenarios. + :vartype advanced_settings: str + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: bool + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: float + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: float + :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. + :vartype checkpoint_frequency: int + :ivar checkpoint_model: The pretrained checkpoint model for incremental training. + :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput + :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for + incremental training. + :vartype checkpoint_run_id: str + :ivar distributed: Whether to use distributed training. + :vartype distributed: bool + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: bool + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: int + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: int + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: bool + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: int + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: int + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: int + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: float + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. Possible values include: "None", "WarmupCosine", "Step". + :vartype learning_rate_scheduler: str or + ~azure.mgmt.machinelearningservices.models.LearningRateScheduler + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: float + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: bool + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: int + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: int + :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". + :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: int + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: float + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: int + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: int + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: int + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: float + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: int + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: float + :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must + be a positive integer. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype box_detections_per_image: int + :ivar box_score_threshold: During inference, only return proposals with a classification score + greater than + BoxScoreThreshold. Must be a float in the range[0, 1]. + :vartype box_score_threshold: float + :ivar image_size: Image size for train and validation. Must be a positive integer. + Note: The training run may get into CUDA OOM if the size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype image_size: int + :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype max_size: int + :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype min_size: int + :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. + Note: training run may get into CUDA OOM if the model size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: + "None", "Small", "Medium", "Large", "ExtraLarge". + :vartype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize + :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. + Note: training run may get into CUDA OOM if no sufficient GPU memory. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype multi_scale: bool + :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be a + float in the range [0, 1]. + :vartype nms_iou_threshold: float + :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not + be + None to enable small object detection logic. A string containing two integers in mxn format. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_grid_size: str + :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float + in the range [0, 1). + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_overlap_ratio: float + :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging + predictions from tiles and image. + Used in validation/ inference. Must be float in the range [0, 1]. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_predictions_nms_threshold: float + :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be + float in the range [0, 1]. + :vartype validation_iou_threshold: float + :ivar validation_metric_type: Metric computation method to use for validation metrics. Possible + values include: "None", "Coco", "Voc", "CocoVoc". + :vartype validation_metric_type: str or + ~azure.mgmt.machinelearningservices.models.ValidationMetricType + """ + + _attribute_map = { + "advanced_settings": {"key": "advancedSettings", "type": "str"}, + "ams_gradient": {"key": "amsGradient", "type": "bool"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "float"}, + "beta2": {"key": "beta2", "type": "float"}, + "checkpoint_frequency": {"key": "checkpointFrequency", "type": "int"}, + "checkpoint_model": { + "key": "checkpointModel", + "type": "MLFlowModelJobInput", + }, + "checkpoint_run_id": {"key": "checkpointRunId", "type": "str"}, + "distributed": {"key": "distributed", "type": "bool"}, + "early_stopping": {"key": "earlyStopping", "type": "bool"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "int"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "int", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "bool", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "int"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "int", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "int"}, + "learning_rate": {"key": "learningRate", "type": "float"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "float"}, + "nesterov": {"key": "nesterov", "type": "bool"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "int"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "int"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "int"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "float"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "int"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "float", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "int", + }, + "weight_decay": {"key": "weightDecay", "type": "float"}, + "box_detections_per_image": { + "key": "boxDetectionsPerImage", + "type": "int", + }, + "box_score_threshold": {"key": "boxScoreThreshold", "type": "float"}, + "image_size": {"key": "imageSize", "type": "int"}, + "max_size": {"key": "maxSize", "type": "int"}, + "min_size": {"key": "minSize", "type": "int"}, + "model_size": {"key": "modelSize", "type": "str"}, + "multi_scale": {"key": "multiScale", "type": "bool"}, + "nms_iou_threshold": {"key": "nmsIouThreshold", "type": "float"}, + "tile_grid_size": {"key": "tileGridSize", "type": "str"}, + "tile_overlap_ratio": {"key": "tileOverlapRatio", "type": "float"}, + "tile_predictions_nms_threshold": { + "key": "tilePredictionsNmsThreshold", + "type": "float", + }, + "validation_iou_threshold": { + "key": "validationIouThreshold", + "type": "float", + }, + "validation_metric_type": { + "key": "validationMetricType", + "type": "str", + }, + } + + def __init__(self, **kwargs): """ :keyword advanced_settings: Settings for advanced scenarios. :paramtype advanced_settings: str @@ -11445,88 +11705,108 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ValidationMetricType """ super(ImageModelSettingsObjectDetection, self).__init__(**kwargs) - self.box_detections_per_image = kwargs.get('box_detections_per_image', None) - self.box_score_threshold = kwargs.get('box_score_threshold', None) - self.image_size = kwargs.get('image_size', None) - self.max_size = kwargs.get('max_size', None) - self.min_size = kwargs.get('min_size', None) - self.model_size = kwargs.get('model_size', None) - self.multi_scale = kwargs.get('multi_scale', None) - self.nms_iou_threshold = kwargs.get('nms_iou_threshold', None) - self.tile_grid_size = kwargs.get('tile_grid_size', None) - self.tile_overlap_ratio = kwargs.get('tile_overlap_ratio', None) - self.tile_predictions_nms_threshold = kwargs.get('tile_predictions_nms_threshold', None) - self.validation_iou_threshold = kwargs.get('validation_iou_threshold', None) - self.validation_metric_type = kwargs.get('validation_metric_type', None) + self.box_detections_per_image = kwargs.get( + "box_detections_per_image", None + ) + self.box_score_threshold = kwargs.get("box_score_threshold", None) + self.image_size = kwargs.get("image_size", None) + self.max_size = kwargs.get("max_size", None) + self.min_size = kwargs.get("min_size", None) + self.model_size = kwargs.get("model_size", None) + self.multi_scale = kwargs.get("multi_scale", None) + self.nms_iou_threshold = kwargs.get("nms_iou_threshold", None) + self.tile_grid_size = kwargs.get("tile_grid_size", None) + self.tile_overlap_ratio = kwargs.get("tile_overlap_ratio", None) + self.tile_predictions_nms_threshold = kwargs.get( + "tile_predictions_nms_threshold", None + ) + self.validation_iou_threshold = kwargs.get( + "validation_iou_threshold", None + ) + self.validation_metric_type = kwargs.get( + "validation_metric_type", None + ) class ImageObjectDetection(AutoMLVertical, ImageObjectDetectionBase): """Image Object Detection. Object detection is used to identify objects in an image and locate each object with a -bounding box e.g. locate all dogs and cats in an image and draw a bounding box around each. + bounding box e.g. locate all dogs and cats in an image and draw a bounding box around each. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "MeanAveragePrecision". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics """ _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + "limit_settings": {"required": True}, + "task_type": {"required": True}, + "training_data": {"required": True}, + } + + _attribute_map = { + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsObjectDetection", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsObjectDetection]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, + } + + def __init__(self, **kwargs): """ :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings @@ -11560,17 +11840,17 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics """ super(ImageObjectDetection, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageObjectDetection' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.limit_settings = kwargs["limit_settings"] + self.sweep_settings = kwargs.get("sweep_settings", None) + self.validation_data = kwargs.get("validation_data", None) + self.validation_data_size = kwargs.get("validation_data_size", None) + self.model_settings = kwargs.get("model_settings", None) + self.search_space = kwargs.get("search_space", None) + self.task_type = "ImageObjectDetection" # type: str + self.primary_metric = kwargs.get("primary_metric", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class ImageSweepSettings(msrest.serialization.Model): @@ -11587,18 +11867,18 @@ class ImageSweepSettings(msrest.serialization.Model): """ _validation = { - 'sampling_algorithm': {'required': True}, + "sampling_algorithm": {"required": True}, } _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, + "sampling_algorithm": {"key": "samplingAlgorithm", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword early_termination: Type of early termination policy. :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy @@ -11608,8 +11888,8 @@ def __init__( ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType """ super(ImageSweepSettings, self).__init__(**kwargs) - self.early_termination = kwargs.get('early_termination', None) - self.sampling_algorithm = kwargs['sampling_algorithm'] + self.early_termination = kwargs.get("early_termination", None) + self.sampling_algorithm = kwargs["sampling_algorithm"] class InferenceContainerProperties(msrest.serialization.Model): @@ -11625,15 +11905,12 @@ class InferenceContainerProperties(msrest.serialization.Model): """ _attribute_map = { - 'liveness_route': {'key': 'livenessRoute', 'type': 'Route'}, - 'readiness_route': {'key': 'readinessRoute', 'type': 'Route'}, - 'scoring_route': {'key': 'scoringRoute', 'type': 'Route'}, + "liveness_route": {"key": "livenessRoute", "type": "Route"}, + "readiness_route": {"key": "readinessRoute", "type": "Route"}, + "scoring_route": {"key": "scoringRoute", "type": "Route"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword liveness_route: The route to check the liveness of the inference server container. :paramtype liveness_route: ~azure.mgmt.machinelearningservices.models.Route @@ -11644,9 +11921,9 @@ def __init__( :paramtype scoring_route: ~azure.mgmt.machinelearningservices.models.Route """ super(InferenceContainerProperties, self).__init__(**kwargs) - self.liveness_route = kwargs.get('liveness_route', None) - self.readiness_route = kwargs.get('readiness_route', None) - self.scoring_route = kwargs.get('scoring_route', None) + self.liveness_route = kwargs.get("liveness_route", None) + self.readiness_route = kwargs.get("readiness_route", None) + self.scoring_route = kwargs.get("scoring_route", None) class InstanceTypeSchema(msrest.serialization.Model): @@ -11659,14 +11936,14 @@ class InstanceTypeSchema(msrest.serialization.Model): """ _attribute_map = { - 'node_selector': {'key': 'nodeSelector', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'InstanceTypeSchemaResources'}, + "node_selector": {"key": "nodeSelector", "type": "{str}"}, + "resources": { + "key": "resources", + "type": "InstanceTypeSchemaResources", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword node_selector: Node Selector. :paramtype node_selector: dict[str, str] @@ -11674,8 +11951,8 @@ def __init__( :paramtype resources: ~azure.mgmt.machinelearningservices.models.InstanceTypeSchemaResources """ super(InstanceTypeSchema, self).__init__(**kwargs) - self.node_selector = kwargs.get('node_selector', None) - self.resources = kwargs.get('resources', None) + self.node_selector = kwargs.get("node_selector", None) + self.resources = kwargs.get("resources", None) class InstanceTypeSchemaResources(msrest.serialization.Model): @@ -11688,14 +11965,11 @@ class InstanceTypeSchemaResources(msrest.serialization.Model): """ _attribute_map = { - 'requests': {'key': 'requests', 'type': '{str}'}, - 'limits': {'key': 'limits', 'type': '{str}'}, + "requests": {"key": "requests", "type": "{str}"}, + "limits": {"key": "limits", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword requests: Resource requests for this instance type. :paramtype requests: dict[str, str] @@ -11703,8 +11977,8 @@ def __init__( :paramtype limits: dict[str, str] """ super(InstanceTypeSchemaResources, self).__init__(**kwargs) - self.requests = kwargs.get('requests', None) - self.limits = kwargs.get('limits', None) + self.requests = kwargs.get("requests", None) + self.limits = kwargs.get("limits", None) class JobBase(Resource): @@ -11730,31 +12004,28 @@ class JobBase(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'JobBaseProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "JobBaseProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.JobBaseProperties """ super(JobBase, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class JobBaseResourceArmPaginatedResult(msrest.serialization.Model): @@ -11768,14 +12039,11 @@ class JobBaseResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[JobBase]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[JobBase]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of JobBase objects. If null, there are no additional pages. @@ -11784,8 +12052,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.JobBase] """ super(JobBaseResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class JobResourceConfiguration(ResourceConfiguration): @@ -11808,21 +12076,18 @@ class JobResourceConfiguration(ResourceConfiguration): """ _validation = { - 'shm_size': {'pattern': r'\d+[bBkKmMgG]'}, + "shm_size": {"pattern": r"\d+[bBkKmMgG]"}, } _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - 'docker_args': {'key': 'dockerArgs', 'type': 'str'}, - 'shm_size': {'key': 'shmSize', 'type': 'str'}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "properties": {"key": "properties", "type": "{object}"}, + "docker_args": {"key": "dockerArgs", "type": "str"}, + "shm_size": {"key": "shmSize", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword instance_count: Optional number of instances or nodes used by the compute target. :paramtype instance_count: int @@ -11840,8 +12105,8 @@ def __init__( :paramtype shm_size: str """ super(JobResourceConfiguration, self).__init__(**kwargs) - self.docker_args = kwargs.get('docker_args', None) - self.shm_size = kwargs.get('shm_size', "2g") + self.docker_args = kwargs.get("docker_args", None) + self.shm_size = kwargs.get("shm_size", "2g") class JobScheduleAction(ScheduleActionBase): @@ -11857,26 +12122,26 @@ class JobScheduleAction(ScheduleActionBase): """ _validation = { - 'action_type': {'required': True}, - 'job_definition': {'required': True}, + "action_type": {"required": True}, + "job_definition": {"required": True}, } _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'job_definition': {'key': 'jobDefinition', 'type': 'JobBaseProperties'}, + "action_type": {"key": "actionType", "type": "str"}, + "job_definition": { + "key": "jobDefinition", + "type": "JobBaseProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword job_definition: Required. [Required] Defines Schedule action definition details. :paramtype job_definition: ~azure.mgmt.machinelearningservices.models.JobBaseProperties """ super(JobScheduleAction, self).__init__(**kwargs) - self.action_type = 'CreateJob' # type: str - self.job_definition = kwargs['job_definition'] + self.action_type = "CreateJob" # type: str + self.job_definition = kwargs["job_definition"] class JobService(msrest.serialization.Model): @@ -11899,23 +12164,20 @@ class JobService(msrest.serialization.Model): """ _validation = { - 'error_message': {'readonly': True}, - 'status': {'readonly': True}, + "error_message": {"readonly": True}, + "status": {"readonly": True}, } _attribute_map = { - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'job_service_type': {'key': 'jobServiceType', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'status': {'key': 'status', 'type': 'str'}, + "endpoint": {"key": "endpoint", "type": "str"}, + "error_message": {"key": "errorMessage", "type": "str"}, + "job_service_type": {"key": "jobServiceType", "type": "str"}, + "port": {"key": "port", "type": "int"}, + "properties": {"key": "properties", "type": "{str}"}, + "status": {"key": "status", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword endpoint: Url for endpoint. :paramtype endpoint: str @@ -11927,11 +12189,11 @@ def __init__( :paramtype properties: dict[str, str] """ super(JobService, self).__init__(**kwargs) - self.endpoint = kwargs.get('endpoint', None) + self.endpoint = kwargs.get("endpoint", None) self.error_message = None - self.job_service_type = kwargs.get('job_service_type', None) - self.port = kwargs.get('port', None) - self.properties = kwargs.get('properties', None) + self.job_service_type = kwargs.get("job_service_type", None) + self.port = kwargs.get("port", None) + self.properties = kwargs.get("properties", None) self.status = None @@ -11943,19 +12205,16 @@ class KubernetesSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, + "properties": {"key": "properties", "type": "KubernetesProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of Kubernetes. :paramtype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties """ super(KubernetesSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class Kubernetes(Compute, KubernetesSchema): @@ -11997,34 +12256,34 @@ class Kubernetes(Compute, KubernetesSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + "disable_local_auth": {"readonly": True}, + } + + _attribute_map = { + "properties": {"key": "properties", "type": "KubernetesProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, + } + + def __init__(self, **kwargs): """ :keyword properties: Properties of Kubernetes. :paramtype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties @@ -12034,14 +12293,14 @@ def __init__( :paramtype resource_id: str """ super(Kubernetes, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'Kubernetes' # type: str + self.properties = kwargs.get("properties", None) + self.compute_type = "Kubernetes" # type: str self.compute_location = None self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None self.disable_local_auth = None @@ -12104,37 +12363,52 @@ class OnlineDeploymentProperties(EndpointDeploymentPropertiesBase): """ _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, + "endpoint_compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, + "egress_public_network_access": { + "key": "egressPublicNetworkAccess", + "type": "str", + }, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, + "model": {"key": "model", "type": "str"}, + "model_mount_path": {"key": "modelMountPath", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, } _subtype_map = { - 'endpoint_compute_type': {'Kubernetes': 'KubernetesOnlineDeployment', 'Managed': 'ManagedOnlineDeployment'} + "endpoint_compute_type": { + "Kubernetes": "KubernetesOnlineDeployment", + "Managed": "ManagedOnlineDeployment", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword code_configuration: Code configuration for the endpoint deployment. :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration @@ -12174,17 +12448,19 @@ def __init__( :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings """ super(OnlineDeploymentProperties, self).__init__(**kwargs) - self.app_insights_enabled = kwargs.get('app_insights_enabled', False) - self.egress_public_network_access = kwargs.get('egress_public_network_access', None) - self.endpoint_compute_type = 'OnlineDeploymentProperties' # type: str - self.instance_type = kwargs.get('instance_type', None) - self.liveness_probe = kwargs.get('liveness_probe', None) - self.model = kwargs.get('model', None) - self.model_mount_path = kwargs.get('model_mount_path', None) + self.app_insights_enabled = kwargs.get("app_insights_enabled", False) + self.egress_public_network_access = kwargs.get( + "egress_public_network_access", None + ) + self.endpoint_compute_type = "OnlineDeploymentProperties" # type: str + self.instance_type = kwargs.get("instance_type", None) + self.liveness_probe = kwargs.get("liveness_probe", None) + self.model = kwargs.get("model", None) + self.model_mount_path = kwargs.get("model_mount_path", None) self.provisioning_state = None - self.readiness_probe = kwargs.get('readiness_probe', None) - self.request_settings = kwargs.get('request_settings', None) - self.scale_settings = kwargs.get('scale_settings', None) + self.readiness_probe = kwargs.get("readiness_probe", None) + self.request_settings = kwargs.get("request_settings", None) + self.scale_settings = kwargs.get("scale_settings", None) class KubernetesOnlineDeployment(OnlineDeploymentProperties): @@ -12245,34 +12521,49 @@ class KubernetesOnlineDeployment(OnlineDeploymentProperties): """ _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - 'container_resource_requirements': {'key': 'containerResourceRequirements', 'type': 'ContainerResourceRequirements'}, - } - - def __init__( - self, - **kwargs - ): + "endpoint_compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, + "egress_public_network_access": { + "key": "egressPublicNetworkAccess", + "type": "str", + }, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, + "model": {"key": "model", "type": "str"}, + "model_mount_path": {"key": "modelMountPath", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, + "container_resource_requirements": { + "key": "containerResourceRequirements", + "type": "ContainerResourceRequirements", + }, + } + + def __init__(self, **kwargs): """ :keyword code_configuration: Code configuration for the endpoint deployment. :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration @@ -12316,8 +12607,10 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ContainerResourceRequirements """ super(KubernetesOnlineDeployment, self).__init__(**kwargs) - self.endpoint_compute_type = 'Kubernetes' # type: str - self.container_resource_requirements = kwargs.get('container_resource_requirements', None) + self.endpoint_compute_type = "Kubernetes" # type: str + self.container_resource_requirements = kwargs.get( + "container_resource_requirements", None + ) class KubernetesProperties(msrest.serialization.Model): @@ -12343,20 +12636,32 @@ class KubernetesProperties(msrest.serialization.Model): """ _attribute_map = { - 'relay_connection_string': {'key': 'relayConnectionString', 'type': 'str'}, - 'service_bus_connection_string': {'key': 'serviceBusConnectionString', 'type': 'str'}, - 'extension_principal_id': {'key': 'extensionPrincipalId', 'type': 'str'}, - 'extension_instance_release_train': {'key': 'extensionInstanceReleaseTrain', 'type': 'str'}, - 'vc_name': {'key': 'vcName', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'default_instance_type': {'key': 'defaultInstanceType', 'type': 'str'}, - 'instance_types': {'key': 'instanceTypes', 'type': '{InstanceTypeSchema}'}, - } - - def __init__( - self, - **kwargs - ): + "relay_connection_string": { + "key": "relayConnectionString", + "type": "str", + }, + "service_bus_connection_string": { + "key": "serviceBusConnectionString", + "type": "str", + }, + "extension_principal_id": { + "key": "extensionPrincipalId", + "type": "str", + }, + "extension_instance_release_train": { + "key": "extensionInstanceReleaseTrain", + "type": "str", + }, + "vc_name": {"key": "vcName", "type": "str"}, + "namespace": {"key": "namespace", "type": "str"}, + "default_instance_type": {"key": "defaultInstanceType", "type": "str"}, + "instance_types": { + "key": "instanceTypes", + "type": "{InstanceTypeSchema}", + }, + } + + def __init__(self, **kwargs): """ :keyword relay_connection_string: Relay connection string. :paramtype relay_connection_string: str @@ -12377,14 +12682,22 @@ def __init__( ~azure.mgmt.machinelearningservices.models.InstanceTypeSchema] """ super(KubernetesProperties, self).__init__(**kwargs) - self.relay_connection_string = kwargs.get('relay_connection_string', None) - self.service_bus_connection_string = kwargs.get('service_bus_connection_string', None) - self.extension_principal_id = kwargs.get('extension_principal_id', None) - self.extension_instance_release_train = kwargs.get('extension_instance_release_train', None) - self.vc_name = kwargs.get('vc_name', None) - self.namespace = kwargs.get('namespace', "default") - self.default_instance_type = kwargs.get('default_instance_type', None) - self.instance_types = kwargs.get('instance_types', None) + self.relay_connection_string = kwargs.get( + "relay_connection_string", None + ) + self.service_bus_connection_string = kwargs.get( + "service_bus_connection_string", None + ) + self.extension_principal_id = kwargs.get( + "extension_principal_id", None + ) + self.extension_instance_release_train = kwargs.get( + "extension_instance_release_train", None + ) + self.vc_name = kwargs.get("vc_name", None) + self.namespace = kwargs.get("namespace", "default") + self.default_instance_type = kwargs.get("default_instance_type", None) + self.instance_types = kwargs.get("instance_types", None) class ListAmlUserFeatureResult(msrest.serialization.Model): @@ -12400,21 +12713,17 @@ class ListAmlUserFeatureResult(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlUserFeature]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[AmlUserFeature]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListAmlUserFeatureResult, self).__init__(**kwargs) self.value = None self.next_link = None @@ -12432,21 +12741,17 @@ class ListNotebookKeysResult(msrest.serialization.Model): """ _validation = { - 'primary_access_key': {'readonly': True}, - 'secondary_access_key': {'readonly': True}, + "primary_access_key": {"readonly": True}, + "secondary_access_key": {"readonly": True}, } _attribute_map = { - 'primary_access_key': {'key': 'primaryAccessKey', 'type': 'str'}, - 'secondary_access_key': {'key': 'secondaryAccessKey', 'type': 'str'}, + "primary_access_key": {"key": "primaryAccessKey", "type": "str"}, + "secondary_access_key": {"key": "secondaryAccessKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListNotebookKeysResult, self).__init__(**kwargs) self.primary_access_key = None self.secondary_access_key = None @@ -12462,19 +12767,15 @@ class ListStorageAccountKeysResult(msrest.serialization.Model): """ _validation = { - 'user_storage_key': {'readonly': True}, + "user_storage_key": {"readonly": True}, } _attribute_map = { - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, + "user_storage_key": {"key": "userStorageKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListStorageAccountKeysResult, self).__init__(**kwargs) self.user_storage_key = None @@ -12492,21 +12793,17 @@ class ListUsagesResult(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[Usage]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Usage]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListUsagesResult, self).__init__(**kwargs) self.value = None self.next_link = None @@ -12532,27 +12829,35 @@ class ListWorkspaceKeysResult(msrest.serialization.Model): """ _validation = { - 'user_storage_key': {'readonly': True}, - 'user_storage_resource_id': {'readonly': True}, - 'app_insights_instrumentation_key': {'readonly': True}, - 'container_registry_credentials': {'readonly': True}, - 'notebook_access_keys': {'readonly': True}, - } - - _attribute_map = { - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, - 'user_storage_resource_id': {'key': 'userStorageResourceId', 'type': 'str'}, - 'app_insights_instrumentation_key': {'key': 'appInsightsInstrumentationKey', 'type': 'str'}, - 'container_registry_credentials': {'key': 'containerRegistryCredentials', 'type': 'RegistryListCredentialsResult'}, - 'notebook_access_keys': {'key': 'notebookAccessKeys', 'type': 'ListNotebookKeysResult'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ + "user_storage_key": {"readonly": True}, + "user_storage_resource_id": {"readonly": True}, + "app_insights_instrumentation_key": {"readonly": True}, + "container_registry_credentials": {"readonly": True}, + "notebook_access_keys": {"readonly": True}, + } + + _attribute_map = { + "user_storage_key": {"key": "userStorageKey", "type": "str"}, + "user_storage_resource_id": { + "key": "userStorageResourceId", + "type": "str", + }, + "app_insights_instrumentation_key": { + "key": "appInsightsInstrumentationKey", + "type": "str", + }, + "container_registry_credentials": { + "key": "containerRegistryCredentials", + "type": "RegistryListCredentialsResult", + }, + "notebook_access_keys": { + "key": "notebookAccessKeys", + "type": "ListNotebookKeysResult", + }, + } + + def __init__(self, **kwargs): + """ """ super(ListWorkspaceKeysResult, self).__init__(**kwargs) self.user_storage_key = None self.user_storage_resource_id = None @@ -12574,21 +12879,17 @@ class ListWorkspaceQuotas(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[ResourceQuota]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[ResourceQuota]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListWorkspaceQuotas, self).__init__(**kwargs) self.value = None self.next_link = None @@ -12610,20 +12911,17 @@ class LiteralJobInput(JobInput): """ _validation = { - 'job_input_type': {'required': True}, - 'value': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "job_input_type": {"required": True}, + "value": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, + "value": {"key": "value", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: Description for the input. :paramtype description: str @@ -12631,8 +12929,8 @@ def __init__( :paramtype value: str """ super(LiteralJobInput, self).__init__(**kwargs) - self.job_input_type = 'literal' # type: str - self.value = kwargs['value'] + self.job_input_type = "literal" # type: str + self.value = kwargs["value"] class ManagedIdentity(IdentityConfiguration): @@ -12656,20 +12954,17 @@ class ManagedIdentity(IdentityConfiguration): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + "object_id": {"key": "objectId", "type": "str"}, + "resource_id": {"key": "resourceId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword client_id: Specifies a user-assigned identity by client ID. For system-assigned, do not set this field. @@ -12682,10 +12977,10 @@ def __init__( :paramtype resource_id: str """ super(ManagedIdentity, self).__init__(**kwargs) - self.identity_type = 'Managed' # type: str - self.client_id = kwargs.get('client_id', None) - self.object_id = kwargs.get('object_id', None) - self.resource_id = kwargs.get('resource_id', None) + self.identity_type = "Managed" # type: str + self.client_id = kwargs.get("client_id", None) + self.object_id = kwargs.get("object_id", None) + self.resource_id = kwargs.get("resource_id", None) class WorkspaceConnectionPropertiesV2(msrest.serialization.Model): @@ -12711,25 +13006,28 @@ class WorkspaceConnectionPropertiesV2(msrest.serialization.Model): """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, } _subtype_map = { - 'auth_type': {'ManagedIdentity': 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', 'None': 'NoneAuthTypeWorkspaceConnectionProperties', 'PAT': 'PATAuthTypeWorkspaceConnectionProperties', 'SAS': 'SASAuthTypeWorkspaceConnectionProperties', 'UsernamePassword': 'UsernamePasswordAuthTypeWorkspaceConnectionProperties'} + "auth_type": { + "ManagedIdentity": "ManagedIdentityAuthTypeWorkspaceConnectionProperties", + "None": "NoneAuthTypeWorkspaceConnectionProperties", + "PAT": "PATAuthTypeWorkspaceConnectionProperties", + "SAS": "SASAuthTypeWorkspaceConnectionProperties", + "UsernamePassword": "UsernamePasswordAuthTypeWorkspaceConnectionProperties", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: Category of the connection. Possible values include: "PythonFeed", "ContainerRegistry", "Git". @@ -12744,13 +13042,15 @@ def __init__( """ super(WorkspaceConnectionPropertiesV2, self).__init__(**kwargs) self.auth_type = None # type: Optional[str] - self.category = kwargs.get('category', None) - self.target = kwargs.get('target', None) - self.value = kwargs.get('value', None) - self.value_format = kwargs.get('value_format', None) + self.category = kwargs.get("category", None) + self.target = kwargs.get("target", None) + self.value = kwargs.get("value", None) + self.value_format = kwargs.get("value_format", None) -class ManagedIdentityAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class ManagedIdentityAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """ManagedIdentityAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -12773,22 +13073,22 @@ class ManagedIdentityAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPr """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionManagedIdentity'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionManagedIdentity", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: Category of the connection. Possible values include: "PythonFeed", "ContainerRegistry", "Git". @@ -12804,9 +13104,11 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity """ - super(ManagedIdentityAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'ManagedIdentity' # type: str - self.credentials = kwargs.get('credentials', None) + super( + ManagedIdentityAuthTypeWorkspaceConnectionProperties, self + ).__init__(**kwargs) + self.auth_type = "ManagedIdentity" # type: str + self.credentials = kwargs.get("credentials", None) class ManagedOnlineDeployment(OnlineDeploymentProperties): @@ -12863,33 +13165,45 @@ class ManagedOnlineDeployment(OnlineDeploymentProperties): """ _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - } - - def __init__( - self, - **kwargs - ): + "endpoint_compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, + "egress_public_network_access": { + "key": "egressPublicNetworkAccess", + "type": "str", + }, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, + "model": {"key": "model", "type": "str"}, + "model_mount_path": {"key": "modelMountPath", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, + } + + def __init__(self, **kwargs): """ :keyword code_configuration: Code configuration for the endpoint deployment. :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration @@ -12929,7 +13243,7 @@ def __init__( :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings """ super(ManagedOnlineDeployment, self).__init__(**kwargs) - self.endpoint_compute_type = 'Managed' # type: str + self.endpoint_compute_type = "Managed" # type: str class ManagedServiceIdentity(msrest.serialization.Model): @@ -12958,22 +13272,22 @@ class ManagedServiceIdentity(msrest.serialization.Model): """ _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, + "principal_id": {"readonly": True}, + "tenant_id": {"readonly": True}, + "type": {"required": True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{UserAssignedIdentity}", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword type: Required. Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", @@ -12989,8 +13303,10 @@ def __init__( super(ManagedServiceIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None - self.type = kwargs['type'] - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + self.type = kwargs["type"] + self.user_assigned_identities = kwargs.get( + "user_assigned_identities", None + ) class MedianStoppingPolicy(EarlyTerminationPolicy): @@ -13009,19 +13325,16 @@ class MedianStoppingPolicy(EarlyTerminationPolicy): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. :paramtype delay_evaluation: int @@ -13029,7 +13342,7 @@ def __init__( :paramtype evaluation_interval: int """ super(MedianStoppingPolicy, self).__init__(**kwargs) - self.policy_type = 'MedianStopping' # type: str + self.policy_type = "MedianStopping" # type: str class MLFlowModelJobInput(JobInput, AssetJobInput): @@ -13051,21 +13364,18 @@ class MLFlowModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -13076,10 +13386,10 @@ def __init__( :paramtype description: str """ super(MLFlowModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'mlflow_model' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "mlflow_model" # type: str + self.description = kwargs.get("description", None) class MLFlowModelJobOutput(JobOutput, AssetJobOutput): @@ -13100,20 +13410,17 @@ class MLFlowModelJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -13123,10 +13430,10 @@ def __init__( :paramtype description: str """ super(MLFlowModelJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'mlflow_model' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "mlflow_model" # type: str + self.description = kwargs.get("description", None) class MLTableData(DataVersionBaseProperties): @@ -13155,25 +13462,22 @@ class MLTableData(DataVersionBaseProperties): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'referenced_uris': {'key': 'referencedUris', 'type': '[str]'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, + "referenced_uris": {"key": "referencedUris", "type": "[str]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -13192,8 +13496,8 @@ def __init__( :paramtype referenced_uris: list[str] """ super(MLTableData, self).__init__(**kwargs) - self.data_type = 'mltable' # type: str - self.referenced_uris = kwargs.get('referenced_uris', None) + self.data_type = "mltable" # type: str + self.referenced_uris = kwargs.get("referenced_uris", None) class MLTableJobInput(JobInput, AssetJobInput): @@ -13215,21 +13519,18 @@ class MLTableJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -13240,10 +13541,10 @@ def __init__( :paramtype description: str """ super(MLTableJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'mltable' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "mltable" # type: str + self.description = kwargs.get("description", None) class MLTableJobOutput(JobOutput, AssetJobOutput): @@ -13264,20 +13565,17 @@ class MLTableJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -13287,10 +13585,10 @@ def __init__( :paramtype description: str """ super(MLTableJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'mltable' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "mltable" # type: str + self.description = kwargs.get("description", None) class ModelContainer(Resource): @@ -13316,31 +13614,31 @@ class ModelContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "ModelContainerProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelContainerProperties """ super(ModelContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class ModelContainerProperties(AssetContainer): @@ -13363,23 +13661,20 @@ class ModelContainerProperties(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -13404,14 +13699,11 @@ class ModelContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ModelContainer]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of ModelContainer objects. If null, there are no additional pages. @@ -13419,9 +13711,11 @@ def __init__( :keyword value: An array of objects of type ModelContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelContainer] """ - super(ModelContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(ModelContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class ModelVersion(Resource): @@ -13447,31 +13741,28 @@ class ModelVersion(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelVersionProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "ModelVersionProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelVersionProperties """ super(ModelVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class ModelVersionProperties(AssetBase): @@ -13498,21 +13789,18 @@ class ModelVersionProperties(AssetBase): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'flavors': {'key': 'flavors', 'type': '{FlavorData}'}, - 'job_name': {'key': 'jobName', 'type': 'str'}, - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'model_uri': {'key': 'modelUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "flavors": {"key": "flavors", "type": "{FlavorData}"}, + "job_name": {"key": "jobName", "type": "str"}, + "model_type": {"key": "modelType", "type": "str"}, + "model_uri": {"key": "modelUri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -13534,10 +13822,10 @@ def __init__( :paramtype model_uri: str """ super(ModelVersionProperties, self).__init__(**kwargs) - self.flavors = kwargs.get('flavors', None) - self.job_name = kwargs.get('job_name', None) - self.model_type = kwargs.get('model_type', None) - self.model_uri = kwargs.get('model_uri', None) + self.flavors = kwargs.get("flavors", None) + self.job_name = kwargs.get("job_name", None) + self.model_type = kwargs.get("model_type", None) + self.model_uri = kwargs.get("model_uri", None) class ModelVersionResourceArmPaginatedResult(msrest.serialization.Model): @@ -13551,14 +13839,11 @@ class ModelVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelVersion]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ModelVersion]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of ModelVersion objects. If null, there are no additional pages. @@ -13567,8 +13852,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelVersion] """ super(ModelVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class Mpi(DistributionConfiguration): @@ -13584,50 +13869,58 @@ class Mpi(DistributionConfiguration): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, + "distribution_type": {"key": "distributionType", "type": "str"}, + "process_count_per_instance": { + "key": "processCountPerInstance", + "type": "int", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword process_count_per_instance: Number of processes per MPI node. :paramtype process_count_per_instance: int """ super(Mpi, self).__init__(**kwargs) - self.distribution_type = 'Mpi' # type: str - self.process_count_per_instance = kwargs.get('process_count_per_instance', None) + self.distribution_type = "Mpi" # type: str + self.process_count_per_instance = kwargs.get( + "process_count_per_instance", None + ) class NlpVertical(msrest.serialization.Model): """Abstract class for NLP related AutoML tasks. -NLP - Natural Language Processing. + NLP - Natural Language Processing. - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword featurization_settings: Featurization inputs needed for AutoML job. :paramtype featurization_settings: @@ -13638,9 +13931,11 @@ def __init__( :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ super(NlpVertical, self).__init__(**kwargs) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.validation_data = kwargs.get('validation_data', None) + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.limit_settings = kwargs.get("limit_settings", None) + self.validation_data = kwargs.get("validation_data", None) class NlpVerticalFeaturizationSettings(FeaturizationSettings): @@ -13651,13 +13946,10 @@ class NlpVerticalFeaturizationSettings(FeaturizationSettings): """ _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, + "dataset_language": {"key": "datasetLanguage", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword dataset_language: Dataset language, useful for the text data. :paramtype dataset_language: str @@ -13677,15 +13969,12 @@ class NlpVerticalLimitSettings(msrest.serialization.Model): """ _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_trials": {"key": "maxTrials", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword max_concurrent_trials: Maximum Concurrent AutoML iterations. :paramtype max_concurrent_trials: int @@ -13695,9 +13984,9 @@ def __init__( :paramtype timeout: ~datetime.timedelta """ super(NlpVerticalLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', 1) - self.max_trials = kwargs.get('max_trials', 1) - self.timeout = kwargs.get('timeout', None) + self.max_concurrent_trials = kwargs.get("max_concurrent_trials", 1) + self.max_trials = kwargs.get("max_trials", 1) + self.timeout = kwargs.get("timeout", None) class NodeStateCounts(msrest.serialization.Model): @@ -13720,29 +14009,25 @@ class NodeStateCounts(msrest.serialization.Model): """ _validation = { - 'idle_node_count': {'readonly': True}, - 'running_node_count': {'readonly': True}, - 'preparing_node_count': {'readonly': True}, - 'unusable_node_count': {'readonly': True}, - 'leaving_node_count': {'readonly': True}, - 'preempted_node_count': {'readonly': True}, + "idle_node_count": {"readonly": True}, + "running_node_count": {"readonly": True}, + "preparing_node_count": {"readonly": True}, + "unusable_node_count": {"readonly": True}, + "leaving_node_count": {"readonly": True}, + "preempted_node_count": {"readonly": True}, } _attribute_map = { - 'idle_node_count': {'key': 'idleNodeCount', 'type': 'int'}, - 'running_node_count': {'key': 'runningNodeCount', 'type': 'int'}, - 'preparing_node_count': {'key': 'preparingNodeCount', 'type': 'int'}, - 'unusable_node_count': {'key': 'unusableNodeCount', 'type': 'int'}, - 'leaving_node_count': {'key': 'leavingNodeCount', 'type': 'int'}, - 'preempted_node_count': {'key': 'preemptedNodeCount', 'type': 'int'}, + "idle_node_count": {"key": "idleNodeCount", "type": "int"}, + "running_node_count": {"key": "runningNodeCount", "type": "int"}, + "preparing_node_count": {"key": "preparingNodeCount", "type": "int"}, + "unusable_node_count": {"key": "unusableNodeCount", "type": "int"}, + "leaving_node_count": {"key": "leavingNodeCount", "type": "int"}, + "preempted_node_count": {"key": "preemptedNodeCount", "type": "int"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NodeStateCounts, self).__init__(**kwargs) self.idle_node_count = None self.running_node_count = None @@ -13752,7 +14037,9 @@ def __init__( self.preempted_node_count = None -class NoneAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class NoneAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """NoneAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -13772,21 +14059,18 @@ class NoneAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2) """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: Category of the connection. Possible values include: "PythonFeed", "ContainerRegistry", "Git". @@ -13799,8 +14083,10 @@ def __init__( "JSON". :paramtype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat """ - super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'None' # type: str + super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__( + **kwargs + ) + self.auth_type = "None" # type: str class NoneDatastoreCredentials(DatastoreCredentials): @@ -13815,21 +14101,17 @@ class NoneDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, + "credentials_type": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NoneDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'None' # type: str + self.credentials_type = "None" # type: str class NotebookAccessTokenResult(msrest.serialization.Model): @@ -13856,33 +14138,29 @@ class NotebookAccessTokenResult(msrest.serialization.Model): """ _validation = { - 'notebook_resource_id': {'readonly': True}, - 'host_name': {'readonly': True}, - 'public_dns': {'readonly': True}, - 'access_token': {'readonly': True}, - 'token_type': {'readonly': True}, - 'expires_in': {'readonly': True}, - 'refresh_token': {'readonly': True}, - 'scope': {'readonly': True}, + "notebook_resource_id": {"readonly": True}, + "host_name": {"readonly": True}, + "public_dns": {"readonly": True}, + "access_token": {"readonly": True}, + "token_type": {"readonly": True}, + "expires_in": {"readonly": True}, + "refresh_token": {"readonly": True}, + "scope": {"readonly": True}, } _attribute_map = { - 'notebook_resource_id': {'key': 'notebookResourceId', 'type': 'str'}, - 'host_name': {'key': 'hostName', 'type': 'str'}, - 'public_dns': {'key': 'publicDns', 'type': 'str'}, - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, - 'expires_in': {'key': 'expiresIn', 'type': 'int'}, - 'refresh_token': {'key': 'refreshToken', 'type': 'str'}, - 'scope': {'key': 'scope', 'type': 'str'}, + "notebook_resource_id": {"key": "notebookResourceId", "type": "str"}, + "host_name": {"key": "hostName", "type": "str"}, + "public_dns": {"key": "publicDns", "type": "str"}, + "access_token": {"key": "accessToken", "type": "str"}, + "token_type": {"key": "tokenType", "type": "str"}, + "expires_in": {"key": "expiresIn", "type": "int"}, + "refresh_token": {"key": "refreshToken", "type": "str"}, + "scope": {"key": "scope", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NotebookAccessTokenResult, self).__init__(**kwargs) self.notebook_resource_id = None self.host_name = None @@ -13904,14 +14182,11 @@ class NotebookPreparationError(msrest.serialization.Model): """ _attribute_map = { - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'status_code': {'key': 'statusCode', 'type': 'int'}, + "error_message": {"key": "errorMessage", "type": "str"}, + "status_code": {"key": "statusCode", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword error_message: :paramtype error_message: str @@ -13919,8 +14194,8 @@ def __init__( :paramtype status_code: int """ super(NotebookPreparationError, self).__init__(**kwargs) - self.error_message = kwargs.get('error_message', None) - self.status_code = kwargs.get('status_code', None) + self.error_message = kwargs.get("error_message", None) + self.status_code = kwargs.get("status_code", None) class NotebookResourceInfo(msrest.serialization.Model): @@ -13936,15 +14211,15 @@ class NotebookResourceInfo(msrest.serialization.Model): """ _attribute_map = { - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'notebook_preparation_error': {'key': 'notebookPreparationError', 'type': 'NotebookPreparationError'}, + "fqdn": {"key": "fqdn", "type": "str"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "notebook_preparation_error": { + "key": "notebookPreparationError", + "type": "NotebookPreparationError", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword fqdn: :paramtype fqdn: str @@ -13955,9 +14230,11 @@ def __init__( ~azure.mgmt.machinelearningservices.models.NotebookPreparationError """ super(NotebookResourceInfo, self).__init__(**kwargs) - self.fqdn = kwargs.get('fqdn', None) - self.resource_id = kwargs.get('resource_id', None) - self.notebook_preparation_error = kwargs.get('notebook_preparation_error', None) + self.fqdn = kwargs.get("fqdn", None) + self.resource_id = kwargs.get("resource_id", None) + self.notebook_preparation_error = kwargs.get( + "notebook_preparation_error", None + ) class Objective(msrest.serialization.Model): @@ -13973,19 +14250,16 @@ class Objective(msrest.serialization.Model): """ _validation = { - 'goal': {'required': True}, - 'primary_metric': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "goal": {"required": True}, + "primary_metric": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'goal': {'key': 'goal', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "goal": {"key": "goal", "type": "str"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword goal: Required. [Required] Defines supported metric goals for hyperparameter tuning. Possible values include: "Minimize", "Maximize". @@ -13994,8 +14268,8 @@ def __init__( :paramtype primary_metric: str """ super(Objective, self).__init__(**kwargs) - self.goal = kwargs['goal'] - self.primary_metric = kwargs['primary_metric'] + self.goal = kwargs["goal"] + self.primary_metric = kwargs["primary_metric"] class OnlineDeployment(TrackedResource): @@ -14032,31 +14306,31 @@ class OnlineDeployment(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineDeploymentProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": { + "key": "properties", + "type": "OnlineDeploymentProperties", + }, + "sku": {"key": "sku", "type": "Sku"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -14073,13 +14347,15 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ super(OnlineDeployment, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) + self.identity = kwargs.get("identity", None) + self.kind = kwargs.get("kind", None) + self.properties = kwargs["properties"] + self.sku = kwargs.get("sku", None) -class OnlineDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class OnlineDeploymentTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of OnlineDeployment entities. :ivar next_link: The link to the next page of OnlineDeployment objects. If null, there are no @@ -14090,14 +14366,11 @@ class OnlineDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Mod """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineDeployment]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[OnlineDeployment]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of OnlineDeployment objects. If null, there are no additional pages. @@ -14105,9 +14378,11 @@ def __init__( :keyword value: An array of objects of type OnlineDeployment. :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineDeployment] """ - super(OnlineDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super( + OnlineDeploymentTrackedResourceArmPaginatedResult, self + ).__init__(**kwargs) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class OnlineEndpoint(TrackedResource): @@ -14144,31 +14419,31 @@ class OnlineEndpoint(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": { + "key": "properties", + "type": "OnlineEndpointProperties", + }, + "sku": {"key": "sku", "type": "Sku"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -14185,10 +14460,10 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ super(OnlineEndpoint, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) + self.identity = kwargs.get("identity", None) + self.kind = kwargs.get("kind", None) + self.properties = kwargs["properties"] + self.sku = kwargs.get("sku", None) class OnlineEndpointProperties(EndpointPropertiesBase): @@ -14231,29 +14506,26 @@ class OnlineEndpointProperties(EndpointPropertiesBase): """ _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "auth_mode": {"required": True}, + "scoring_uri": {"readonly": True}, + "swagger_uri": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, - 'traffic': {'key': 'traffic', 'type': '{int}'}, + "auth_mode": {"key": "authMode", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "keys": {"key": "keys", "type": "EndpointAuthKeys"}, + "properties": {"key": "properties", "type": "{str}"}, + "scoring_uri": {"key": "scoringUri", "type": "str"}, + "swagger_uri": {"key": "swaggerUri", "type": "str"}, + "compute": {"key": "compute", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "public_network_access": {"key": "publicNetworkAccess", "type": "str"}, + "traffic": {"key": "traffic", "type": "{int}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' @@ -14279,13 +14551,15 @@ def __init__( :paramtype traffic: dict[str, int] """ super(OnlineEndpointProperties, self).__init__(**kwargs) - self.compute = kwargs.get('compute', None) + self.compute = kwargs.get("compute", None) self.provisioning_state = None - self.public_network_access = kwargs.get('public_network_access', None) - self.traffic = kwargs.get('traffic', None) + self.public_network_access = kwargs.get("public_network_access", None) + self.traffic = kwargs.get("traffic", None) -class OnlineEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class OnlineEndpointTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of OnlineEndpoint entities. :ivar next_link: The link to the next page of OnlineEndpoint objects. If null, there are no @@ -14296,14 +14570,11 @@ class OnlineEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineEndpoint]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[OnlineEndpoint]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of OnlineEndpoint objects. If null, there are no additional pages. @@ -14311,9 +14582,11 @@ def __init__( :keyword value: An array of objects of type OnlineEndpoint. :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] """ - super(OnlineEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(OnlineEndpointTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class OnlineRequestSettings(msrest.serialization.Model): @@ -14332,15 +14605,15 @@ class OnlineRequestSettings(msrest.serialization.Model): """ _attribute_map = { - 'max_concurrent_requests_per_instance': {'key': 'maxConcurrentRequestsPerInstance', 'type': 'int'}, - 'max_queue_wait': {'key': 'maxQueueWait', 'type': 'duration'}, - 'request_timeout': {'key': 'requestTimeout', 'type': 'duration'}, + "max_concurrent_requests_per_instance": { + "key": "maxConcurrentRequestsPerInstance", + "type": "int", + }, + "max_queue_wait": {"key": "maxQueueWait", "type": "duration"}, + "request_timeout": {"key": "requestTimeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword max_concurrent_requests_per_instance: The number of maximum concurrent requests per node allowed per deployment. Defaults to 1. @@ -14354,9 +14627,11 @@ def __init__( :paramtype request_timeout: ~datetime.timedelta """ super(OnlineRequestSettings, self).__init__(**kwargs) - self.max_concurrent_requests_per_instance = kwargs.get('max_concurrent_requests_per_instance', 1) - self.max_queue_wait = kwargs.get('max_queue_wait', "PT0.5S") - self.request_timeout = kwargs.get('request_timeout', "PT5S") + self.max_concurrent_requests_per_instance = kwargs.get( + "max_concurrent_requests_per_instance", 1 + ) + self.max_queue_wait = kwargs.get("max_queue_wait", "PT0.5S") + self.request_timeout = kwargs.get("request_timeout", "PT5S") class OutputPathAssetReference(AssetReferenceBase): @@ -14374,19 +14649,16 @@ class OutputPathAssetReference(AssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "job_id": {"key": "jobId", "type": "str"}, + "path": {"key": "path", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword job_id: ARM resource ID of the job. :paramtype job_id: str @@ -14394,9 +14666,9 @@ def __init__( :paramtype path: str """ super(OutputPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'OutputPath' # type: str - self.job_id = kwargs.get('job_id', None) - self.path = kwargs.get('path', None) + self.reference_type = "OutputPath" # type: str + self.job_id = kwargs.get("job_id", None) + self.path = kwargs.get("path", None) class PaginatedComputeResourcesList(msrest.serialization.Model): @@ -14409,14 +14681,11 @@ class PaginatedComputeResourcesList(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[ComputeResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[ComputeResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: An array of Machine Learning compute objects wrapped in ARM resource envelope. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComputeResource] @@ -14424,8 +14693,8 @@ def __init__( :paramtype next_link: str """ super(PaginatedComputeResourcesList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get("value", None) + self.next_link = kwargs.get("next_link", None) class PartialBatchDeployment(msrest.serialization.Model): @@ -14436,22 +14705,21 @@ class PartialBatchDeployment(msrest.serialization.Model): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: Description of the endpoint deployment. :paramtype description: str """ super(PartialBatchDeployment, self).__init__(**kwargs) - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) -class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties(msrest.serialization.Model): +class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties( + msrest.serialization.Model +): """Strictly used in update requests. :ivar properties: Additional attributes of the entity. @@ -14461,23 +14729,23 @@ class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties(msrest.s """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'PartialBatchDeployment'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "properties": {"key": "properties", "type": "PartialBatchDeployment"}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.PartialBatchDeployment :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] """ - super(PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) + super( + PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, + self, + ).__init__(**kwargs) + self.properties = kwargs.get("properties", None) + self.tags = kwargs.get("tags", None) class PartialManagedServiceIdentity(msrest.serialization.Model): @@ -14495,14 +14763,14 @@ class PartialManagedServiceIdentity(msrest.serialization.Model): """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{object}'}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{object}", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword type: Managed service identity (system assigned and/or user assigned identities). Possible values include: "None", "SystemAssigned", "UserAssigned", @@ -14515,8 +14783,10 @@ def __init__( :paramtype user_assigned_identities: dict[str, any] """ super(PartialManagedServiceIdentity, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + self.type = kwargs.get("type", None) + self.user_assigned_identities = kwargs.get( + "user_assigned_identities", None + ) class PartialMinimalTrackedResource(msrest.serialization.Model): @@ -14527,19 +14797,16 @@ class PartialMinimalTrackedResource(msrest.serialization.Model): """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] """ super(PartialMinimalTrackedResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) + self.tags = kwargs.get("tags", None) class PartialMinimalTrackedResourceWithIdentity(PartialMinimalTrackedResource): @@ -14552,22 +14819,24 @@ class PartialMinimalTrackedResourceWithIdentity(PartialMinimalTrackedResource): """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, + "tags": {"key": "tags", "type": "{str}"}, + "identity": { + "key": "identity", + "type": "PartialManagedServiceIdentity", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] :keyword identity: Managed service identity (system assigned and/or user assigned identities). :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity """ - super(PartialMinimalTrackedResourceWithIdentity, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) + super(PartialMinimalTrackedResourceWithIdentity, self).__init__( + **kwargs + ) + self.identity = kwargs.get("identity", None) class PartialMinimalTrackedResourceWithSku(PartialMinimalTrackedResource): @@ -14580,14 +14849,11 @@ class PartialMinimalTrackedResourceWithSku(PartialMinimalTrackedResource): """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "PartialSku"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -14595,7 +14861,7 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku """ super(PartialMinimalTrackedResourceWithSku, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) + self.sku = kwargs.get("sku", None) class PartialSku(msrest.serialization.Model): @@ -14619,17 +14885,14 @@ class PartialSku(msrest.serialization.Model): """ _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'int'}, - 'family': {'key': 'family', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, + "capacity": {"key": "capacity", "type": "int"}, + "family": {"key": "family", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "size": {"key": "size", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword capacity: If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted. @@ -14648,11 +14911,11 @@ def __init__( :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier """ super(PartialSku, self).__init__(**kwargs) - self.capacity = kwargs.get('capacity', None) - self.family = kwargs.get('family', None) - self.name = kwargs.get('name', None) - self.size = kwargs.get('size', None) - self.tier = kwargs.get('tier', None) + self.capacity = kwargs.get("capacity", None) + self.family = kwargs.get("family", None) + self.name = kwargs.get("name", None) + self.size = kwargs.get("size", None) + self.tier = kwargs.get("tier", None) class Password(msrest.serialization.Model): @@ -14667,27 +14930,25 @@ class Password(msrest.serialization.Model): """ _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, + "name": {"readonly": True}, + "value": {"readonly": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "value": {"key": "value", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Password, self).__init__(**kwargs) self.name = None self.value = None -class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class PATAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """PATAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -14710,22 +14971,22 @@ class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionPersonalAccessToken'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionPersonalAccessToken", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: Category of the connection. Possible values include: "PythonFeed", "ContainerRegistry", "Git". @@ -14741,9 +15002,11 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken """ - super(PATAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'PAT' # type: str - self.credentials = kwargs.get('credentials', None) + super(PATAuthTypeWorkspaceConnectionProperties, self).__init__( + **kwargs + ) + self.auth_type = "PAT" # type: str + self.credentials = kwargs.get("credentials", None) class PersonalComputeInstanceSettings(msrest.serialization.Model): @@ -14754,19 +15017,16 @@ class PersonalComputeInstanceSettings(msrest.serialization.Model): """ _attribute_map = { - 'assigned_user': {'key': 'assignedUser', 'type': 'AssignedUser'}, + "assigned_user": {"key": "assignedUser", "type": "AssignedUser"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword assigned_user: A user explicitly assigned to a personal compute instance. :paramtype assigned_user: ~azure.mgmt.machinelearningservices.models.AssignedUser """ super(PersonalComputeInstanceSettings, self).__init__(**kwargs) - self.assigned_user = kwargs.get('assigned_user', None) + self.assigned_user = kwargs.get("assigned_user", None) class PipelineJob(JobBaseProperties): @@ -14820,34 +15080,31 @@ class PipelineJob(JobBaseProperties): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'jobs': {'key': 'jobs', 'type': '{object}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'settings': {'key': 'settings', 'type': 'object'}, - 'source_job_id': {'key': 'sourceJobId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + "job_type": {"required": True}, + "status": {"readonly": True}, + } + + _attribute_map = { + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "jobs": {"key": "jobs", "type": "{object}"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "settings": {"key": "settings", "type": "object"}, + "source_job_id": {"key": "sourceJobId", "type": "str"}, + } + + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -14885,12 +15142,12 @@ def __init__( :paramtype source_job_id: str """ super(PipelineJob, self).__init__(**kwargs) - self.job_type = 'Pipeline' # type: str - self.inputs = kwargs.get('inputs', None) - self.jobs = kwargs.get('jobs', None) - self.outputs = kwargs.get('outputs', None) - self.settings = kwargs.get('settings', None) - self.source_job_id = kwargs.get('source_job_id', None) + self.job_type = "Pipeline" # type: str + self.inputs = kwargs.get("inputs", None) + self.jobs = kwargs.get("jobs", None) + self.outputs = kwargs.get("outputs", None) + self.settings = kwargs.get("settings", None) + self.source_job_id = kwargs.get("source_job_id", None) class PrivateEndpoint(msrest.serialization.Model): @@ -14905,21 +15162,17 @@ class PrivateEndpoint(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'subnet_arm_id': {'readonly': True}, + "id": {"readonly": True}, + "subnet_arm_id": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'subnet_arm_id': {'key': 'subnetArmId', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "subnet_arm_id": {"key": "subnetArmId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(PrivateEndpoint, self).__init__(**kwargs) self.id = None self.subnet_arm_id = None @@ -14962,31 +15215,37 @@ class PrivateEndpointConnection(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "private_endpoint": { + "key": "properties.privateEndpoint", + "type": "PrivateEndpoint", + }, + "private_link_service_connection_state": { + "key": "properties.privateLinkServiceConnectionState", + "type": "PrivateLinkServiceConnectionState", + }, + "provisioning_state": { + "key": "properties.provisioningState", + "type": "str", + }, + } + + def __init__(self, **kwargs): """ :keyword identity: The identity of the resource. :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity @@ -15004,12 +15263,14 @@ def __init__( ~azure.mgmt.machinelearningservices.models.PrivateLinkServiceConnectionState """ super(PrivateEndpointConnection, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) - self.private_endpoint = kwargs.get('private_endpoint', None) - self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + self.identity = kwargs.get("identity", None) + self.location = kwargs.get("location", None) + self.tags = kwargs.get("tags", None) + self.sku = kwargs.get("sku", None) + self.private_endpoint = kwargs.get("private_endpoint", None) + self.private_link_service_connection_state = kwargs.get( + "private_link_service_connection_state", None + ) self.provisioning_state = None @@ -15021,19 +15282,16 @@ class PrivateEndpointConnectionListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + "value": {"key": "value", "type": "[PrivateEndpointConnection]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Array of private endpoint connections. :paramtype value: list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] """ super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class PrivateLinkResource(Resource): @@ -15069,32 +15327,35 @@ class PrivateLinkResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'group_id': {'readonly': True}, - 'required_members': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, - 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "group_id": {"readonly": True}, + "required_members": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "group_id": {"key": "properties.groupId", "type": "str"}, + "required_members": { + "key": "properties.requiredMembers", + "type": "[str]", + }, + "required_zone_names": { + "key": "properties.requiredZoneNames", + "type": "[str]", + }, + } + + def __init__(self, **kwargs): """ :keyword identity: The identity of the resource. :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity @@ -15108,13 +15369,13 @@ def __init__( :paramtype required_zone_names: list[str] """ super(PrivateLinkResource, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) + self.identity = kwargs.get("identity", None) + self.location = kwargs.get("location", None) + self.tags = kwargs.get("tags", None) + self.sku = kwargs.get("sku", None) self.group_id = None self.required_members = None - self.required_zone_names = kwargs.get('required_zone_names', None) + self.required_zone_names = kwargs.get("required_zone_names", None) class PrivateLinkResourceListResult(msrest.serialization.Model): @@ -15125,19 +15386,16 @@ class PrivateLinkResourceListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + "value": {"key": "value", "type": "[PrivateLinkResource]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Array of private link resources. :paramtype value: list[~azure.mgmt.machinelearningservices.models.PrivateLinkResource] """ super(PrivateLinkResourceListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class PrivateLinkServiceConnectionState(msrest.serialization.Model): @@ -15156,15 +15414,12 @@ class PrivateLinkServiceConnectionState(msrest.serialization.Model): """ _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + "status": {"key": "status", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "actions_required": {"key": "actionsRequired", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword status: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Possible values include: "Pending", "Approved", "Rejected", @@ -15178,9 +15433,9 @@ def __init__( :paramtype actions_required: str """ super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.description = kwargs.get('description', None) - self.actions_required = kwargs.get('actions_required', None) + self.status = kwargs.get("status", None) + self.description = kwargs.get("description", None) + self.actions_required = kwargs.get("actions_required", None) class ProbeSettings(msrest.serialization.Model): @@ -15199,17 +15454,14 @@ class ProbeSettings(msrest.serialization.Model): """ _attribute_map = { - 'failure_threshold': {'key': 'failureThreshold', 'type': 'int'}, - 'initial_delay': {'key': 'initialDelay', 'type': 'duration'}, - 'period': {'key': 'period', 'type': 'duration'}, - 'success_threshold': {'key': 'successThreshold', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "failure_threshold": {"key": "failureThreshold", "type": "int"}, + "initial_delay": {"key": "initialDelay", "type": "duration"}, + "period": {"key": "period", "type": "duration"}, + "success_threshold": {"key": "successThreshold", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword failure_threshold: The number of failures to allow before returning an unhealthy status. @@ -15224,11 +15476,11 @@ def __init__( :paramtype timeout: ~datetime.timedelta """ super(ProbeSettings, self).__init__(**kwargs) - self.failure_threshold = kwargs.get('failure_threshold', 30) - self.initial_delay = kwargs.get('initial_delay', None) - self.period = kwargs.get('period', "PT10S") - self.success_threshold = kwargs.get('success_threshold', 1) - self.timeout = kwargs.get('timeout', "PT2S") + self.failure_threshold = kwargs.get("failure_threshold", 30) + self.initial_delay = kwargs.get("initial_delay", None) + self.period = kwargs.get("period", "PT10S") + self.success_threshold = kwargs.get("success_threshold", 1) + self.timeout = kwargs.get("timeout", "PT2S") class PyTorch(DistributionConfiguration): @@ -15244,25 +15496,27 @@ class PyTorch(DistributionConfiguration): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, + "distribution_type": {"key": "distributionType", "type": "str"}, + "process_count_per_instance": { + "key": "processCountPerInstance", + "type": "int", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword process_count_per_instance: Number of processes per node. :paramtype process_count_per_instance: int """ super(PyTorch, self).__init__(**kwargs) - self.distribution_type = 'PyTorch' # type: str - self.process_count_per_instance = kwargs.get('process_count_per_instance', None) + self.distribution_type = "PyTorch" # type: str + self.process_count_per_instance = kwargs.get( + "process_count_per_instance", None + ) class QuotaBaseProperties(msrest.serialization.Model): @@ -15279,16 +15533,13 @@ class QuotaBaseProperties(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "limit": {"key": "limit", "type": "long"}, + "unit": {"key": "unit", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword id: Specifies the resource ID. :paramtype id: str @@ -15301,10 +15552,10 @@ def __init__( :paramtype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit """ super(QuotaBaseProperties, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.type = kwargs.get('type', None) - self.limit = kwargs.get('limit', None) - self.unit = kwargs.get('unit', None) + self.id = kwargs.get("id", None) + self.type = kwargs.get("type", None) + self.limit = kwargs.get("limit", None) + self.unit = kwargs.get("unit", None) class QuotaUpdateParameters(msrest.serialization.Model): @@ -15317,14 +15568,11 @@ class QuotaUpdateParameters(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[QuotaBaseProperties]'}, - 'location': {'key': 'location', 'type': 'str'}, + "value": {"key": "value", "type": "[QuotaBaseProperties]"}, + "location": {"key": "location", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: The list for update quota. :paramtype value: list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] @@ -15332,8 +15580,8 @@ def __init__( :paramtype location: str """ super(QuotaUpdateParameters, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.location = kwargs.get('location', None) + self.value = kwargs.get("value", None) + self.location = kwargs.get("location", None) class RandomSamplingAlgorithm(SamplingAlgorithm): @@ -15353,19 +15601,19 @@ class RandomSamplingAlgorithm(SamplingAlgorithm): """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - 'rule': {'key': 'rule', 'type': 'str'}, - 'seed': {'key': 'seed', 'type': 'int'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, + "rule": {"key": "rule", "type": "str"}, + "seed": {"key": "seed", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword rule: The specific type of random algorithm. Possible values include: "Random", "Sobol". @@ -15374,9 +15622,9 @@ def __init__( :paramtype seed: int """ super(RandomSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Random' # type: str - self.rule = kwargs.get('rule', None) - self.seed = kwargs.get('seed', None) + self.sampling_algorithm_type = "Random" # type: str + self.rule = kwargs.get("rule", None) + self.seed = kwargs.get("seed", None) class RecurrenceSchedule(msrest.serialization.Model): @@ -15395,21 +15643,18 @@ class RecurrenceSchedule(msrest.serialization.Model): """ _validation = { - 'hours': {'required': True}, - 'minutes': {'required': True}, + "hours": {"required": True}, + "minutes": {"required": True}, } _attribute_map = { - 'hours': {'key': 'hours', 'type': '[int]'}, - 'minutes': {'key': 'minutes', 'type': '[int]'}, - 'month_days': {'key': 'monthDays', 'type': '[int]'}, - 'week_days': {'key': 'weekDays', 'type': '[str]'}, + "hours": {"key": "hours", "type": "[int]"}, + "minutes": {"key": "minutes", "type": "[int]"}, + "month_days": {"key": "monthDays", "type": "[int]"}, + "week_days": {"key": "weekDays", "type": "[str]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword hours: Required. [Required] List of hours for the schedule. :paramtype hours: list[int] @@ -15421,10 +15666,10 @@ def __init__( :paramtype week_days: list[str or ~azure.mgmt.machinelearningservices.models.WeekDay] """ super(RecurrenceSchedule, self).__init__(**kwargs) - self.hours = kwargs['hours'] - self.minutes = kwargs['minutes'] - self.month_days = kwargs.get('month_days', None) - self.week_days = kwargs.get('week_days', None) + self.hours = kwargs["hours"] + self.minutes = kwargs["minutes"] + self.month_days = kwargs.get("month_days", None) + self.week_days = kwargs.get("week_days", None) class RecurrenceTrigger(TriggerBase): @@ -15457,25 +15702,22 @@ class RecurrenceTrigger(TriggerBase): """ _validation = { - 'trigger_type': {'required': True}, - 'frequency': {'required': True}, - 'interval': {'required': True}, + "trigger_type": {"required": True}, + "frequency": {"required": True}, + "interval": {"required": True}, } _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceSchedule'}, + "end_time": {"key": "endTime", "type": "str"}, + "start_time": {"key": "startTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "trigger_type": {"key": "triggerType", "type": "str"}, + "frequency": {"key": "frequency", "type": "str"}, + "interval": {"key": "interval", "type": "int"}, + "schedule": {"key": "schedule", "type": "RecurrenceSchedule"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer https://en.wikipedia.org/wiki/ISO_8601. @@ -15499,10 +15741,10 @@ def __init__( :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule """ super(RecurrenceTrigger, self).__init__(**kwargs) - self.trigger_type = 'Recurrence' # type: str - self.frequency = kwargs['frequency'] - self.interval = kwargs['interval'] - self.schedule = kwargs.get('schedule', None) + self.trigger_type = "Recurrence" # type: str + self.frequency = kwargs["frequency"] + self.interval = kwargs["interval"] + self.schedule = kwargs.get("schedule", None) class RegenerateEndpointKeysRequest(msrest.serialization.Model): @@ -15518,18 +15760,15 @@ class RegenerateEndpointKeysRequest(msrest.serialization.Model): """ _validation = { - 'key_type': {'required': True}, + "key_type": {"required": True}, } _attribute_map = { - 'key_type': {'key': 'keyType', 'type': 'str'}, - 'key_value': {'key': 'keyValue', 'type': 'str'}, + "key_type": {"key": "keyType", "type": "str"}, + "key_value": {"key": "keyValue", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword key_type: Required. [Required] Specification for which type of key to generate. Primary or Secondary. Possible values include: "Primary", "Secondary". @@ -15538,8 +15777,8 @@ def __init__( :paramtype key_value: str """ super(RegenerateEndpointKeysRequest, self).__init__(**kwargs) - self.key_type = kwargs['key_type'] - self.key_value = kwargs.get('key_value', None) + self.key_type = kwargs["key_type"] + self.key_value = kwargs.get("key_value", None) class RegistryListCredentialsResult(msrest.serialization.Model): @@ -15556,20 +15795,17 @@ class RegistryListCredentialsResult(msrest.serialization.Model): """ _validation = { - 'location': {'readonly': True}, - 'username': {'readonly': True}, + "location": {"readonly": True}, + "username": {"readonly": True}, } _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'username': {'key': 'username', 'type': 'str'}, - 'passwords': {'key': 'passwords', 'type': '[Password]'}, + "location": {"key": "location", "type": "str"}, + "username": {"key": "username", "type": "str"}, + "passwords": {"key": "passwords", "type": "[Password]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword passwords: :paramtype passwords: list[~azure.mgmt.machinelearningservices.models.Password] @@ -15577,7 +15813,7 @@ def __init__( super(RegistryListCredentialsResult, self).__init__(**kwargs) self.location = None self.username = None - self.passwords = kwargs.get('passwords', None) + self.passwords = kwargs.get("passwords", None) class Regression(AutoMLVertical, TableVertical): @@ -15636,32 +15872,47 @@ class Regression(AutoMLVertical, TableVertical): """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'RegressionTrainingSettings'}, - } - - def __init__( - self, - **kwargs - ): + "task_type": {"required": True}, + "training_data": {"required": True}, + } + + _attribute_map = { + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "test_data": {"key": "testData", "type": "MLTableJobInput"}, + "test_data_size": {"key": "testDataSize", "type": "float"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "weight_column_name": {"key": "weightColumnName", "type": "str"}, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, + "training_settings": { + "key": "trainingSettings", + "type": "RegressionTrainingSettings", + }, + } + + def __init__(self, **kwargs): """ :keyword cv_split_column_names: Columns to use for CVSplit data. :paramtype cv_split_column_names: list[str] @@ -15710,21 +15961,23 @@ def __init__( ~azure.mgmt.machinelearningservices.models.RegressionTrainingSettings """ super(Regression, self).__init__(**kwargs) - self.cv_split_column_names = kwargs.get('cv_split_column_names', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.test_data = kwargs.get('test_data', None) - self.test_data_size = kwargs.get('test_data_size', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.weight_column_name = kwargs.get('weight_column_name', None) - self.task_type = 'Regression' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.training_settings = kwargs.get('training_settings', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.cv_split_column_names = kwargs.get("cv_split_column_names", None) + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.limit_settings = kwargs.get("limit_settings", None) + self.n_cross_validations = kwargs.get("n_cross_validations", None) + self.test_data = kwargs.get("test_data", None) + self.test_data_size = kwargs.get("test_data_size", None) + self.validation_data = kwargs.get("validation_data", None) + self.validation_data_size = kwargs.get("validation_data_size", None) + self.weight_column_name = kwargs.get("weight_column_name", None) + self.task_type = "Regression" # type: str + self.primary_metric = kwargs.get("primary_metric", None) + self.training_settings = kwargs.get("training_settings", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class RegressionTrainingSettings(TrainingSettings): @@ -15756,21 +16009,39 @@ class RegressionTrainingSettings(TrainingSettings): """ _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): + "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, + "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, + "allowed_training_algorithms": { + "key": "allowedTrainingAlgorithms", + "type": "[str]", + }, + "blocked_training_algorithms": { + "key": "blockedTrainingAlgorithms", + "type": "[str]", + }, + } + + def __init__(self, **kwargs): """ :keyword enable_dnn_training: Enable recommendation of DNN models. :paramtype enable_dnn_training: bool @@ -15797,8 +16068,12 @@ def __init__( ~azure.mgmt.machinelearningservices.models.RegressionModels] """ super(RegressionTrainingSettings, self).__init__(**kwargs) - self.allowed_training_algorithms = kwargs.get('allowed_training_algorithms', None) - self.blocked_training_algorithms = kwargs.get('blocked_training_algorithms', None) + self.allowed_training_algorithms = kwargs.get( + "allowed_training_algorithms", None + ) + self.blocked_training_algorithms = kwargs.get( + "blocked_training_algorithms", None + ) class ResourceId(msrest.serialization.Model): @@ -15811,23 +16086,20 @@ class ResourceId(msrest.serialization.Model): """ _validation = { - 'id': {'required': True}, + "id": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword id: Required. The ID of the resource. :paramtype id: str """ super(ResourceId, self).__init__(**kwargs) - self.id = kwargs['id'] + self.id = kwargs["id"] class ResourceName(msrest.serialization.Model): @@ -15842,21 +16114,17 @@ class ResourceName(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, + "value": {"readonly": True}, + "localized_value": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + "value": {"key": "value", "type": "str"}, + "localized_value": {"key": "localizedValue", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ResourceName, self).__init__(**kwargs) self.value = None self.localized_value = None @@ -15882,29 +16150,28 @@ class ResourceQuota(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'name': {'readonly': True}, - 'limit': {'readonly': True}, - 'unit': {'readonly': True}, + "id": {"readonly": True}, + "aml_workspace_location": {"readonly": True}, + "type": {"readonly": True}, + "name": {"readonly": True}, + "limit": {"readonly": True}, + "unit": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'ResourceName'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "aml_workspace_location": { + "key": "amlWorkspaceLocation", + "type": "str", + }, + "type": {"key": "type", "type": "str"}, + "name": {"key": "name", "type": "ResourceName"}, + "limit": {"key": "limit", "type": "long"}, + "unit": {"key": "unit", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ResourceQuota, self).__init__(**kwargs) self.id = None self.aml_workspace_location = None @@ -15926,19 +16193,16 @@ class Route(msrest.serialization.Model): """ _validation = { - 'path': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'port': {'required': True}, + "path": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "port": {"required": True}, } _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, + "path": {"key": "path", "type": "str"}, + "port": {"key": "port", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword path: Required. [Required] The path for the route. :paramtype path: str @@ -15946,11 +16210,13 @@ def __init__( :paramtype port: int """ super(Route, self).__init__(**kwargs) - self.path = kwargs['path'] - self.port = kwargs['port'] + self.path = kwargs["path"] + self.port = kwargs["port"] -class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class SASAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """SASAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -15973,22 +16239,22 @@ class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionSharedAccessSignature'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionSharedAccessSignature", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: Category of the connection. Possible values include: "PythonFeed", "ContainerRegistry", "Git". @@ -16004,9 +16270,11 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature """ - super(SASAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'SAS' # type: str - self.credentials = kwargs.get('credentials', None) + super(SASAuthTypeWorkspaceConnectionProperties, self).__init__( + **kwargs + ) + self.auth_type = "SAS" # type: str + self.credentials = kwargs.get("credentials", None) class SasDatastoreCredentials(DatastoreCredentials): @@ -16023,26 +16291,23 @@ class SasDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, + "credentials_type": {"required": True}, + "secrets": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'SasDatastoreSecrets'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "secrets": {"key": "secrets", "type": "SasDatastoreSecrets"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword secrets: Required. [Required] Storage container secrets. :paramtype secrets: ~azure.mgmt.machinelearningservices.models.SasDatastoreSecrets """ super(SasDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Sas' # type: str - self.secrets = kwargs['secrets'] + self.credentials_type = "Sas" # type: str + self.secrets = kwargs["secrets"] class SasDatastoreSecrets(DatastoreSecrets): @@ -16059,25 +16324,22 @@ class SasDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'sas_token': {'key': 'sasToken', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "sas_token": {"key": "sasToken", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword sas_token: Storage container SAS token. :paramtype sas_token: str """ super(SasDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Sas' # type: str - self.sas_token = kwargs.get('sas_token', None) + self.secrets_type = "Sas" # type: str + self.sas_token = kwargs.get("sas_token", None) class ScaleSettings(msrest.serialization.Model): @@ -16095,19 +16357,19 @@ class ScaleSettings(msrest.serialization.Model): """ _validation = { - 'max_node_count': {'required': True}, + "max_node_count": {"required": True}, } _attribute_map = { - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'node_idle_time_before_scale_down': {'key': 'nodeIdleTimeBeforeScaleDown', 'type': 'duration'}, + "max_node_count": {"key": "maxNodeCount", "type": "int"}, + "min_node_count": {"key": "minNodeCount", "type": "int"}, + "node_idle_time_before_scale_down": { + "key": "nodeIdleTimeBeforeScaleDown", + "type": "duration", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword max_node_count: Required. Max number of nodes to use. :paramtype max_node_count: int @@ -16118,9 +16380,11 @@ def __init__( :paramtype node_idle_time_before_scale_down: ~datetime.timedelta """ super(ScaleSettings, self).__init__(**kwargs) - self.max_node_count = kwargs['max_node_count'] - self.min_node_count = kwargs.get('min_node_count', 0) - self.node_idle_time_before_scale_down = kwargs.get('node_idle_time_before_scale_down', None) + self.max_node_count = kwargs["max_node_count"] + self.min_node_count = kwargs.get("min_node_count", 0) + self.node_idle_time_before_scale_down = kwargs.get( + "node_idle_time_before_scale_down", None + ) class ScaleSettingsInformation(msrest.serialization.Model): @@ -16131,19 +16395,16 @@ class ScaleSettingsInformation(msrest.serialization.Model): """ _attribute_map = { - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, + "scale_settings": {"key": "scaleSettings", "type": "ScaleSettings"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword scale_settings: scale settings for AML Compute. :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings """ super(ScaleSettingsInformation, self).__init__(**kwargs) - self.scale_settings = kwargs.get('scale_settings', None) + self.scale_settings = kwargs.get("scale_settings", None) class Schedule(Resource): @@ -16169,31 +16430,28 @@ class Schedule(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ScheduleProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "ScheduleProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ScheduleProperties """ super(Schedule, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class ScheduleBase(msrest.serialization.Model): @@ -16211,15 +16469,12 @@ class ScheduleBase(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "provisioning_status": {"key": "provisioningStatus", "type": "str"}, + "status": {"key": "status", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword id: A system assigned id for the schedule. :paramtype id: str @@ -16232,9 +16487,9 @@ def __init__( :paramtype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus """ super(ScheduleBase, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.provisioning_status = kwargs.get('provisioning_status', None) - self.status = kwargs.get('status', None) + self.id = kwargs.get("id", None) + self.provisioning_status = kwargs.get("provisioning_status", None) + self.status = kwargs.get("status", None) class ScheduleProperties(ResourceBase): @@ -16265,26 +16520,23 @@ class ScheduleProperties(ResourceBase): """ _validation = { - 'action': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'trigger': {'required': True}, + "action": {"required": True}, + "provisioning_state": {"readonly": True}, + "trigger": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'action': {'key': 'action', 'type': 'ScheduleActionBase'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'trigger': {'key': 'trigger', 'type': 'TriggerBase'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "action": {"key": "action", "type": "ScheduleActionBase"}, + "display_name": {"key": "displayName", "type": "str"}, + "is_enabled": {"key": "isEnabled", "type": "bool"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "trigger": {"key": "trigger", "type": "TriggerBase"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -16302,11 +16554,11 @@ def __init__( :paramtype trigger: ~azure.mgmt.machinelearningservices.models.TriggerBase """ super(ScheduleProperties, self).__init__(**kwargs) - self.action = kwargs['action'] - self.display_name = kwargs.get('display_name', None) - self.is_enabled = kwargs.get('is_enabled', True) + self.action = kwargs["action"] + self.display_name = kwargs.get("display_name", None) + self.is_enabled = kwargs.get("is_enabled", True) self.provisioning_state = None - self.trigger = kwargs['trigger'] + self.trigger = kwargs["trigger"] class ScheduleResourceArmPaginatedResult(msrest.serialization.Model): @@ -16320,14 +16572,11 @@ class ScheduleResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Schedule]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[Schedule]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of Schedule objects. If null, there are no additional pages. @@ -16336,8 +16585,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.Schedule] """ super(ScheduleResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class ScriptReference(msrest.serialization.Model): @@ -16354,16 +16603,13 @@ class ScriptReference(msrest.serialization.Model): """ _attribute_map = { - 'script_source': {'key': 'scriptSource', 'type': 'str'}, - 'script_data': {'key': 'scriptData', 'type': 'str'}, - 'script_arguments': {'key': 'scriptArguments', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'str'}, + "script_source": {"key": "scriptSource", "type": "str"}, + "script_data": {"key": "scriptData", "type": "str"}, + "script_arguments": {"key": "scriptArguments", "type": "str"}, + "timeout": {"key": "timeout", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword script_source: The storage source of the script: inline, workspace. :paramtype script_source: str @@ -16375,10 +16621,10 @@ def __init__( :paramtype timeout: str """ super(ScriptReference, self).__init__(**kwargs) - self.script_source = kwargs.get('script_source', None) - self.script_data = kwargs.get('script_data', None) - self.script_arguments = kwargs.get('script_arguments', None) - self.timeout = kwargs.get('timeout', None) + self.script_source = kwargs.get("script_source", None) + self.script_data = kwargs.get("script_data", None) + self.script_arguments = kwargs.get("script_arguments", None) + self.timeout = kwargs.get("timeout", None) class ScriptsToExecute(msrest.serialization.Model): @@ -16391,14 +16637,14 @@ class ScriptsToExecute(msrest.serialization.Model): """ _attribute_map = { - 'startup_script': {'key': 'startupScript', 'type': 'ScriptReference'}, - 'creation_script': {'key': 'creationScript', 'type': 'ScriptReference'}, + "startup_script": {"key": "startupScript", "type": "ScriptReference"}, + "creation_script": { + "key": "creationScript", + "type": "ScriptReference", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword startup_script: Script that's run every time the machine starts. :paramtype startup_script: ~azure.mgmt.machinelearningservices.models.ScriptReference @@ -16406,8 +16652,8 @@ def __init__( :paramtype creation_script: ~azure.mgmt.machinelearningservices.models.ScriptReference """ super(ScriptsToExecute, self).__init__(**kwargs) - self.startup_script = kwargs.get('startup_script', None) - self.creation_script = kwargs.get('creation_script', None) + self.startup_script = kwargs.get("startup_script", None) + self.creation_script = kwargs.get("creation_script", None) class ServiceManagedResourcesSettings(msrest.serialization.Model): @@ -16418,19 +16664,16 @@ class ServiceManagedResourcesSettings(msrest.serialization.Model): """ _attribute_map = { - 'cosmos_db': {'key': 'cosmosDb', 'type': 'CosmosDbSettings'}, + "cosmos_db": {"key": "cosmosDb", "type": "CosmosDbSettings"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword cosmos_db: The settings for the service managed cosmosdb account. :paramtype cosmos_db: ~azure.mgmt.machinelearningservices.models.CosmosDbSettings """ super(ServiceManagedResourcesSettings, self).__init__(**kwargs) - self.cosmos_db = kwargs.get('cosmos_db', None) + self.cosmos_db = kwargs.get("cosmos_db", None) class ServicePrincipalDatastoreCredentials(DatastoreCredentials): @@ -16455,25 +16698,25 @@ class ServicePrincipalDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, + "credentials_type": {"required": True}, + "client_id": {"required": True}, + "secrets": {"required": True}, + "tenant_id": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'ServicePrincipalDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "authority_url": {"key": "authorityUrl", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + "resource_url": {"key": "resourceUrl", "type": "str"}, + "secrets": { + "key": "secrets", + "type": "ServicePrincipalDatastoreSecrets", + }, + "tenant_id": {"key": "tenantId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword authority_url: Authority URL used for authentication. :paramtype authority_url: str @@ -16488,12 +16731,12 @@ def __init__( :paramtype tenant_id: str """ super(ServicePrincipalDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'ServicePrincipal' # type: str - self.authority_url = kwargs.get('authority_url', None) - self.client_id = kwargs['client_id'] - self.resource_url = kwargs.get('resource_url', None) - self.secrets = kwargs['secrets'] - self.tenant_id = kwargs['tenant_id'] + self.credentials_type = "ServicePrincipal" # type: str + self.authority_url = kwargs.get("authority_url", None) + self.client_id = kwargs["client_id"] + self.resource_url = kwargs.get("resource_url", None) + self.secrets = kwargs["secrets"] + self.tenant_id = kwargs["tenant_id"] class ServicePrincipalDatastoreSecrets(DatastoreSecrets): @@ -16510,25 +16753,22 @@ class ServicePrincipalDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "client_secret": {"key": "clientSecret", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword client_secret: Service principal secret. :paramtype client_secret: str """ super(ServicePrincipalDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'ServicePrincipal' # type: str - self.client_secret = kwargs.get('client_secret', None) + self.secrets_type = "ServicePrincipal" # type: str + self.client_secret = kwargs.get("client_secret", None) class SetupScripts(msrest.serialization.Model): @@ -16539,19 +16779,16 @@ class SetupScripts(msrest.serialization.Model): """ _attribute_map = { - 'scripts': {'key': 'scripts', 'type': 'ScriptsToExecute'}, + "scripts": {"key": "scripts", "type": "ScriptsToExecute"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword scripts: Customized setup scripts. :paramtype scripts: ~azure.mgmt.machinelearningservices.models.ScriptsToExecute """ super(SetupScripts, self).__init__(**kwargs) - self.scripts = kwargs.get('scripts', None) + self.scripts = kwargs.get("scripts", None) class SharedPrivateLinkResource(msrest.serialization.Model): @@ -16573,17 +16810,17 @@ class SharedPrivateLinkResource(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'private_link_resource_id': {'key': 'properties.privateLinkResourceId', 'type': 'str'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'request_message': {'key': 'properties.requestMessage', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "private_link_resource_id": { + "key": "properties.privateLinkResourceId", + "type": "str", + }, + "group_id": {"key": "properties.groupId", "type": "str"}, + "request_message": {"key": "properties.requestMessage", "type": "str"}, + "status": {"key": "properties.status", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: Unique name of the private link. :paramtype name: str @@ -16600,11 +16837,13 @@ def __init__( ~azure.mgmt.machinelearningservices.models.PrivateEndpointServiceConnectionStatus """ super(SharedPrivateLinkResource, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.private_link_resource_id = kwargs.get('private_link_resource_id', None) - self.group_id = kwargs.get('group_id', None) - self.request_message = kwargs.get('request_message', None) - self.status = kwargs.get('status', None) + self.name = kwargs.get("name", None) + self.private_link_resource_id = kwargs.get( + "private_link_resource_id", None + ) + self.group_id = kwargs.get("group_id", None) + self.request_message = kwargs.get("request_message", None) + self.status = kwargs.get("status", None) class Sku(msrest.serialization.Model): @@ -16630,21 +16869,18 @@ class Sku(msrest.serialization.Model): """ _validation = { - 'name': {'required': True}, + "name": {"required": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'int'}, + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, + "size": {"key": "size", "type": "str"}, + "family": {"key": "family", "type": "str"}, + "capacity": {"key": "capacity", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code. :paramtype name: str @@ -16663,11 +16899,11 @@ def __init__( :paramtype capacity: int """ super(Sku, self).__init__(**kwargs) - self.name = kwargs['name'] - self.tier = kwargs.get('tier', None) - self.size = kwargs.get('size', None) - self.family = kwargs.get('family', None) - self.capacity = kwargs.get('capacity', None) + self.name = kwargs["name"] + self.tier = kwargs.get("tier", None) + self.size = kwargs.get("size", None) + self.family = kwargs.get("family", None) + self.capacity = kwargs.get("capacity", None) class SkuCapacity(msrest.serialization.Model): @@ -16685,16 +16921,13 @@ class SkuCapacity(msrest.serialization.Model): """ _attribute_map = { - 'default': {'key': 'default', 'type': 'int'}, - 'maximum': {'key': 'maximum', 'type': 'int'}, - 'minimum': {'key': 'minimum', 'type': 'int'}, - 'scale_type': {'key': 'scaleType', 'type': 'str'}, + "default": {"key": "default", "type": "int"}, + "maximum": {"key": "maximum", "type": "int"}, + "minimum": {"key": "minimum", "type": "int"}, + "scale_type": {"key": "scaleType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword default: Gets or sets the default capacity. :paramtype default: int @@ -16707,10 +16940,10 @@ def __init__( :paramtype scale_type: str or ~azure.mgmt.machinelearningservices.models.SkuScaleType """ super(SkuCapacity, self).__init__(**kwargs) - self.default = kwargs.get('default', 0) - self.maximum = kwargs.get('maximum', 0) - self.minimum = kwargs.get('minimum', 0) - self.scale_type = kwargs.get('scale_type', None) + self.default = kwargs.get("default", 0) + self.maximum = kwargs.get("maximum", 0) + self.minimum = kwargs.get("minimum", 0) + self.scale_type = kwargs.get("scale_type", None) class SkuResource(msrest.serialization.Model): @@ -16727,19 +16960,16 @@ class SkuResource(msrest.serialization.Model): """ _validation = { - 'resource_type': {'readonly': True}, + "resource_type": {"readonly": True}, } _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'SkuSetting'}, + "capacity": {"key": "capacity", "type": "SkuCapacity"}, + "resource_type": {"key": "resourceType", "type": "str"}, + "sku": {"key": "sku", "type": "SkuSetting"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword capacity: Gets or sets the Sku Capacity. :paramtype capacity: ~azure.mgmt.machinelearningservices.models.SkuCapacity @@ -16747,9 +16977,9 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.SkuSetting """ super(SkuResource, self).__init__(**kwargs) - self.capacity = kwargs.get('capacity', None) + self.capacity = kwargs.get("capacity", None) self.resource_type = None - self.sku = kwargs.get('sku', None) + self.sku = kwargs.get("sku", None) class SkuResourceArmPaginatedResult(msrest.serialization.Model): @@ -16763,14 +16993,11 @@ class SkuResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[SkuResource]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[SkuResource]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of SkuResource objects. If null, there are no additional pages. @@ -16779,8 +17006,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.SkuResource] """ super(SkuResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class SkuSetting(msrest.serialization.Model): @@ -16798,18 +17025,15 @@ class SkuSetting(msrest.serialization.Model): """ _validation = { - 'name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: Required. [Required] The name of the SKU. Ex - P3. It is typically a letter+number code. @@ -16820,8 +17044,8 @@ def __init__( :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier """ super(SkuSetting, self).__init__(**kwargs) - self.name = kwargs['name'] - self.tier = kwargs.get('tier', None) + self.name = kwargs["name"] + self.tier = kwargs.get("tier", None) class SslConfiguration(msrest.serialization.Model): @@ -16843,18 +17067,18 @@ class SslConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'cert': {'key': 'cert', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - 'cname': {'key': 'cname', 'type': 'str'}, - 'leaf_domain_label': {'key': 'leafDomainLabel', 'type': 'str'}, - 'overwrite_existing_domain': {'key': 'overwriteExistingDomain', 'type': 'bool'}, + "status": {"key": "status", "type": "str"}, + "cert": {"key": "cert", "type": "str"}, + "key": {"key": "key", "type": "str"}, + "cname": {"key": "cname", "type": "str"}, + "leaf_domain_label": {"key": "leafDomainLabel", "type": "str"}, + "overwrite_existing_domain": { + "key": "overwriteExistingDomain", + "type": "bool", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword status: Enable or disable ssl for scoring. Possible values include: "Disabled", "Enabled", "Auto". @@ -16871,12 +17095,14 @@ def __init__( :paramtype overwrite_existing_domain: bool """ super(SslConfiguration, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.cert = kwargs.get('cert', None) - self.key = kwargs.get('key', None) - self.cname = kwargs.get('cname', None) - self.leaf_domain_label = kwargs.get('leaf_domain_label', None) - self.overwrite_existing_domain = kwargs.get('overwrite_existing_domain', None) + self.status = kwargs.get("status", None) + self.cert = kwargs.get("cert", None) + self.key = kwargs.get("key", None) + self.cname = kwargs.get("cname", None) + self.leaf_domain_label = kwargs.get("leaf_domain_label", None) + self.overwrite_existing_domain = kwargs.get( + "overwrite_existing_domain", None + ) class StackEnsembleSettings(msrest.serialization.Model): @@ -16898,15 +17124,21 @@ class StackEnsembleSettings(msrest.serialization.Model): """ _attribute_map = { - 'stack_meta_learner_k_wargs': {'key': 'stackMetaLearnerKWargs', 'type': 'object'}, - 'stack_meta_learner_train_percentage': {'key': 'stackMetaLearnerTrainPercentage', 'type': 'float'}, - 'stack_meta_learner_type': {'key': 'stackMetaLearnerType', 'type': 'str'}, + "stack_meta_learner_k_wargs": { + "key": "stackMetaLearnerKWargs", + "type": "object", + }, + "stack_meta_learner_train_percentage": { + "key": "stackMetaLearnerTrainPercentage", + "type": "float", + }, + "stack_meta_learner_type": { + "key": "stackMetaLearnerType", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword stack_meta_learner_k_wargs: Optional parameters to pass to the initializer of the meta-learner. @@ -16923,9 +17155,15 @@ def __init__( ~azure.mgmt.machinelearningservices.models.StackMetaLearnerType """ super(StackEnsembleSettings, self).__init__(**kwargs) - self.stack_meta_learner_k_wargs = kwargs.get('stack_meta_learner_k_wargs', None) - self.stack_meta_learner_train_percentage = kwargs.get('stack_meta_learner_train_percentage', 0.2) - self.stack_meta_learner_type = kwargs.get('stack_meta_learner_type', None) + self.stack_meta_learner_k_wargs = kwargs.get( + "stack_meta_learner_k_wargs", None + ) + self.stack_meta_learner_train_percentage = kwargs.get( + "stack_meta_learner_train_percentage", 0.2 + ) + self.stack_meta_learner_type = kwargs.get( + "stack_meta_learner_type", None + ) class SweepJob(JobBaseProperties): @@ -16987,41 +17225,44 @@ class SweepJob(JobBaseProperties): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'objective': {'required': True}, - 'sampling_algorithm': {'required': True}, - 'search_space': {'required': True}, - 'trial': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'SweepJobLimits'}, - 'objective': {'key': 'objective', 'type': 'Objective'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'SamplingAlgorithm'}, - 'search_space': {'key': 'searchSpace', 'type': 'object'}, - 'trial': {'key': 'trial', 'type': 'TrialComponent'}, - } - - def __init__( - self, - **kwargs - ): + "job_type": {"required": True}, + "status": {"readonly": True}, + "objective": {"required": True}, + "sampling_algorithm": {"required": True}, + "search_space": {"required": True}, + "trial": {"required": True}, + } + + _attribute_map = { + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "limits": {"key": "limits", "type": "SweepJobLimits"}, + "objective": {"key": "objective", "type": "Objective"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "sampling_algorithm": { + "key": "samplingAlgorithm", + "type": "SamplingAlgorithm", + }, + "search_space": {"key": "searchSpace", "type": "object"}, + "trial": {"key": "trial", "type": "TrialComponent"}, + } + + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -17067,15 +17308,15 @@ def __init__( :paramtype trial: ~azure.mgmt.machinelearningservices.models.TrialComponent """ super(SweepJob, self).__init__(**kwargs) - self.job_type = 'Sweep' # type: str - self.early_termination = kwargs.get('early_termination', None) - self.inputs = kwargs.get('inputs', None) - self.limits = kwargs.get('limits', None) - self.objective = kwargs['objective'] - self.outputs = kwargs.get('outputs', None) - self.sampling_algorithm = kwargs['sampling_algorithm'] - self.search_space = kwargs['search_space'] - self.trial = kwargs['trial'] + self.job_type = "Sweep" # type: str + self.early_termination = kwargs.get("early_termination", None) + self.inputs = kwargs.get("inputs", None) + self.limits = kwargs.get("limits", None) + self.objective = kwargs["objective"] + self.outputs = kwargs.get("outputs", None) + self.sampling_algorithm = kwargs["sampling_algorithm"] + self.search_space = kwargs["search_space"] + self.trial = kwargs["trial"] class SweepJobLimits(JobLimits): @@ -17098,21 +17339,18 @@ class SweepJobLimits(JobLimits): """ _validation = { - 'job_limits_type': {'required': True}, + "job_limits_type": {"required": True}, } _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_total_trials': {'key': 'maxTotalTrials', 'type': 'int'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, + "job_limits_type": {"key": "jobLimitsType", "type": "str"}, + "timeout": {"key": "timeout", "type": "duration"}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_total_trials": {"key": "maxTotalTrials", "type": "int"}, + "trial_timeout": {"key": "trialTimeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. Only supports duration with precision as low as Seconds. @@ -17125,10 +17363,10 @@ def __init__( :paramtype trial_timeout: ~datetime.timedelta """ super(SweepJobLimits, self).__init__(**kwargs) - self.job_limits_type = 'Sweep' # type: str - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', None) - self.max_total_trials = kwargs.get('max_total_trials', None) - self.trial_timeout = kwargs.get('trial_timeout', None) + self.job_limits_type = "Sweep" # type: str + self.max_concurrent_trials = kwargs.get("max_concurrent_trials", None) + self.max_total_trials = kwargs.get("max_total_trials", None) + self.trial_timeout = kwargs.get("trial_timeout", None) class SynapseSpark(Compute): @@ -17170,34 +17408,34 @@ class SynapseSpark(Compute): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'SynapseSparkProperties'}, - } - - def __init__( - self, - **kwargs - ): + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + "disable_local_auth": {"readonly": True}, + } + + _attribute_map = { + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, + "properties": {"key": "properties", "type": "SynapseSparkProperties"}, + } + + def __init__(self, **kwargs): """ :keyword description: The description of the Machine Learning compute. :paramtype description: str @@ -17207,8 +17445,8 @@ def __init__( :paramtype properties: ~azure.mgmt.machinelearningservices.models.SynapseSparkProperties """ super(SynapseSpark, self).__init__(**kwargs) - self.compute_type = 'SynapseSpark' # type: str - self.properties = kwargs.get('properties', None) + self.compute_type = "SynapseSpark" # type: str + self.properties = kwargs.get("properties", None) class SynapseSparkProperties(msrest.serialization.Model): @@ -17237,22 +17475,25 @@ class SynapseSparkProperties(msrest.serialization.Model): """ _attribute_map = { - 'auto_scale_properties': {'key': 'autoScaleProperties', 'type': 'AutoScaleProperties'}, - 'auto_pause_properties': {'key': 'autoPauseProperties', 'type': 'AutoPauseProperties'}, - 'spark_version': {'key': 'sparkVersion', 'type': 'str'}, - 'node_count': {'key': 'nodeCount', 'type': 'int'}, - 'node_size': {'key': 'nodeSize', 'type': 'str'}, - 'node_size_family': {'key': 'nodeSizeFamily', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'workspace_name': {'key': 'workspaceName', 'type': 'str'}, - 'pool_name': {'key': 'poolName', 'type': 'str'}, + "auto_scale_properties": { + "key": "autoScaleProperties", + "type": "AutoScaleProperties", + }, + "auto_pause_properties": { + "key": "autoPauseProperties", + "type": "AutoPauseProperties", + }, + "spark_version": {"key": "sparkVersion", "type": "str"}, + "node_count": {"key": "nodeCount", "type": "int"}, + "node_size": {"key": "nodeSize", "type": "str"}, + "node_size_family": {"key": "nodeSizeFamily", "type": "str"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, + "resource_group": {"key": "resourceGroup", "type": "str"}, + "workspace_name": {"key": "workspaceName", "type": "str"}, + "pool_name": {"key": "poolName", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword auto_scale_properties: Auto scale properties. :paramtype auto_scale_properties: @@ -17278,16 +17519,16 @@ def __init__( :paramtype pool_name: str """ super(SynapseSparkProperties, self).__init__(**kwargs) - self.auto_scale_properties = kwargs.get('auto_scale_properties', None) - self.auto_pause_properties = kwargs.get('auto_pause_properties', None) - self.spark_version = kwargs.get('spark_version', None) - self.node_count = kwargs.get('node_count', None) - self.node_size = kwargs.get('node_size', None) - self.node_size_family = kwargs.get('node_size_family', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.resource_group = kwargs.get('resource_group', None) - self.workspace_name = kwargs.get('workspace_name', None) - self.pool_name = kwargs.get('pool_name', None) + self.auto_scale_properties = kwargs.get("auto_scale_properties", None) + self.auto_pause_properties = kwargs.get("auto_pause_properties", None) + self.spark_version = kwargs.get("spark_version", None) + self.node_count = kwargs.get("node_count", None) + self.node_size = kwargs.get("node_size", None) + self.node_size_family = kwargs.get("node_size_family", None) + self.subscription_id = kwargs.get("subscription_id", None) + self.resource_group = kwargs.get("resource_group", None) + self.workspace_name = kwargs.get("workspace_name", None) + self.pool_name = kwargs.get("pool_name", None) class SystemData(msrest.serialization.Model): @@ -17310,18 +17551,15 @@ class SystemData(msrest.serialization.Model): """ _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + "created_by": {"key": "createdBy", "type": "str"}, + "created_by_type": {"key": "createdByType", "type": "str"}, + "created_at": {"key": "createdAt", "type": "iso-8601"}, + "last_modified_by": {"key": "lastModifiedBy", "type": "str"}, + "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"}, + "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword created_by: The identity that created the resource. :paramtype created_by: str @@ -17340,12 +17578,12 @@ def __init__( :paramtype last_modified_at: ~datetime.datetime """ super(SystemData, self).__init__(**kwargs) - self.created_by = kwargs.get('created_by', None) - self.created_by_type = kwargs.get('created_by_type', None) - self.created_at = kwargs.get('created_at', None) - self.last_modified_by = kwargs.get('last_modified_by', None) - self.last_modified_by_type = kwargs.get('last_modified_by_type', None) - self.last_modified_at = kwargs.get('last_modified_at', None) + self.created_by = kwargs.get("created_by", None) + self.created_by_type = kwargs.get("created_by_type", None) + self.created_at = kwargs.get("created_at", None) + self.last_modified_by = kwargs.get("last_modified_by", None) + self.last_modified_by_type = kwargs.get("last_modified_by_type", None) + self.last_modified_at = kwargs.get("last_modified_at", None) class SystemService(msrest.serialization.Model): @@ -17362,23 +17600,19 @@ class SystemService(msrest.serialization.Model): """ _validation = { - 'system_service_type': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'version': {'readonly': True}, + "system_service_type": {"readonly": True}, + "public_ip_address": {"readonly": True}, + "version": {"readonly": True}, } _attribute_map = { - 'system_service_type': {'key': 'systemServiceType', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, + "system_service_type": {"key": "systemServiceType", "type": "str"}, + "public_ip_address": {"key": "publicIpAddress", "type": "str"}, + "version": {"key": "version", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(SystemService, self).__init__(**kwargs) self.system_service_type = None self.public_ip_address = None @@ -17412,18 +17646,27 @@ class TableVerticalFeaturizationSettings(FeaturizationSettings): """ _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - 'blocked_transformers': {'key': 'blockedTransformers', 'type': '[str]'}, - 'column_name_and_types': {'key': 'columnNameAndTypes', 'type': '{str}'}, - 'enable_dnn_featurization': {'key': 'enableDnnFeaturization', 'type': 'bool'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'transformer_params': {'key': 'transformerParams', 'type': '{[ColumnTransformer]}'}, + "dataset_language": {"key": "datasetLanguage", "type": "str"}, + "blocked_transformers": { + "key": "blockedTransformers", + "type": "[str]", + }, + "column_name_and_types": { + "key": "columnNameAndTypes", + "type": "{str}", + }, + "enable_dnn_featurization": { + "key": "enableDnnFeaturization", + "type": "bool", + }, + "mode": {"key": "mode", "type": "str"}, + "transformer_params": { + "key": "transformerParams", + "type": "{[ColumnTransformer]}", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword dataset_language: Dataset language, useful for the text data. :paramtype dataset_language: str @@ -17448,11 +17691,13 @@ def __init__( list[~azure.mgmt.machinelearningservices.models.ColumnTransformer]] """ super(TableVerticalFeaturizationSettings, self).__init__(**kwargs) - self.blocked_transformers = kwargs.get('blocked_transformers', None) - self.column_name_and_types = kwargs.get('column_name_and_types', None) - self.enable_dnn_featurization = kwargs.get('enable_dnn_featurization', False) - self.mode = kwargs.get('mode', None) - self.transformer_params = kwargs.get('transformer_params', None) + self.blocked_transformers = kwargs.get("blocked_transformers", None) + self.column_name_and_types = kwargs.get("column_name_and_types", None) + self.enable_dnn_featurization = kwargs.get( + "enable_dnn_featurization", False + ) + self.mode = kwargs.get("mode", None) + self.transformer_params = kwargs.get("transformer_params", None) class TableVerticalLimitSettings(msrest.serialization.Model): @@ -17476,19 +17721,19 @@ class TableVerticalLimitSettings(msrest.serialization.Model): """ _attribute_map = { - 'enable_early_termination': {'key': 'enableEarlyTermination', 'type': 'bool'}, - 'exit_score': {'key': 'exitScore', 'type': 'float'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_cores_per_trial': {'key': 'maxCoresPerTrial', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, + "enable_early_termination": { + "key": "enableEarlyTermination", + "type": "bool", + }, + "exit_score": {"key": "exitScore", "type": "float"}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_cores_per_trial": {"key": "maxCoresPerTrial", "type": "int"}, + "max_trials": {"key": "maxTrials", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, + "trial_timeout": {"key": "trialTimeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword enable_early_termination: Enable early termination, determines whether or not if AutoMLJob will terminate early if there is no score improvement in last 20 iterations. @@ -17507,13 +17752,15 @@ def __init__( :paramtype trial_timeout: ~datetime.timedelta """ super(TableVerticalLimitSettings, self).__init__(**kwargs) - self.enable_early_termination = kwargs.get('enable_early_termination', True) - self.exit_score = kwargs.get('exit_score', None) - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', 1) - self.max_cores_per_trial = kwargs.get('max_cores_per_trial', -1) - self.max_trials = kwargs.get('max_trials', 1000) - self.timeout = kwargs.get('timeout', "PT6H") - self.trial_timeout = kwargs.get('trial_timeout', "PT30M") + self.enable_early_termination = kwargs.get( + "enable_early_termination", True + ) + self.exit_score = kwargs.get("exit_score", None) + self.max_concurrent_trials = kwargs.get("max_concurrent_trials", 1) + self.max_cores_per_trial = kwargs.get("max_cores_per_trial", -1) + self.max_trials = kwargs.get("max_trials", 1000) + self.timeout = kwargs.get("timeout", "PT6H") + self.trial_timeout = kwargs.get("trial_timeout", "PT30M") class TargetUtilizationScaleSettings(OnlineScaleSettings): @@ -17537,21 +17784,21 @@ class TargetUtilizationScaleSettings(OnlineScaleSettings): """ _validation = { - 'scale_type': {'required': True}, + "scale_type": {"required": True}, } _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - 'max_instances': {'key': 'maxInstances', 'type': 'int'}, - 'min_instances': {'key': 'minInstances', 'type': 'int'}, - 'polling_interval': {'key': 'pollingInterval', 'type': 'duration'}, - 'target_utilization_percentage': {'key': 'targetUtilizationPercentage', 'type': 'int'}, + "scale_type": {"key": "scaleType", "type": "str"}, + "max_instances": {"key": "maxInstances", "type": "int"}, + "min_instances": {"key": "minInstances", "type": "int"}, + "polling_interval": {"key": "pollingInterval", "type": "duration"}, + "target_utilization_percentage": { + "key": "targetUtilizationPercentage", + "type": "int", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword max_instances: The maximum number of instances that the deployment can scale to. The quota will be reserved for max_instances. @@ -17565,11 +17812,13 @@ def __init__( :paramtype target_utilization_percentage: int """ super(TargetUtilizationScaleSettings, self).__init__(**kwargs) - self.scale_type = 'TargetUtilization' # type: str - self.max_instances = kwargs.get('max_instances', 1) - self.min_instances = kwargs.get('min_instances', 1) - self.polling_interval = kwargs.get('polling_interval', "PT1S") - self.target_utilization_percentage = kwargs.get('target_utilization_percentage', 70) + self.scale_type = "TargetUtilization" # type: str + self.max_instances = kwargs.get("max_instances", 1) + self.min_instances = kwargs.get("min_instances", 1) + self.polling_interval = kwargs.get("polling_interval", "PT1S") + self.target_utilization_percentage = kwargs.get( + "target_utilization_percentage", 70 + ) class TensorFlow(DistributionConfiguration): @@ -17587,19 +17836,19 @@ class TensorFlow(DistributionConfiguration): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'parameter_server_count': {'key': 'parameterServerCount', 'type': 'int'}, - 'worker_count': {'key': 'workerCount', 'type': 'int'}, + "distribution_type": {"key": "distributionType", "type": "str"}, + "parameter_server_count": { + "key": "parameterServerCount", + "type": "int", + }, + "worker_count": {"key": "workerCount", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword parameter_server_count: Number of parameter server tasks. :paramtype parameter_server_count: int @@ -17607,64 +17856,70 @@ def __init__( :paramtype worker_count: int """ super(TensorFlow, self).__init__(**kwargs) - self.distribution_type = 'TensorFlow' # type: str - self.parameter_server_count = kwargs.get('parameter_server_count', 0) - self.worker_count = kwargs.get('worker_count', None) + self.distribution_type = "TensorFlow" # type: str + self.parameter_server_count = kwargs.get("parameter_server_count", 0) + self.worker_count = kwargs.get("worker_count", None) class TextClassification(AutoMLVertical, NlpVertical): """Text Classification task in AutoML NLP vertical. -NLP - Natural Language Processing. + NLP - Natural Language Processing. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-Classification task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric for Text-Classification task. Possible values include: + "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, + "task_type": {"required": True}, + "training_data": {"required": True}, } _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword featurization_settings: Featurization inputs needed for AutoML job. :paramtype featurization_settings: @@ -17688,73 +17943,81 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ super(TextClassification, self).__init__(**kwargs) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.task_type = 'TextClassification' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.limit_settings = kwargs.get("limit_settings", None) + self.validation_data = kwargs.get("validation_data", None) + self.task_type = "TextClassification" # type: str + self.primary_metric = kwargs.get("primary_metric", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class TextClassificationMultilabel(AutoMLVertical, NlpVertical): """Text Classification Multilabel task in AutoML NLP vertical. -NLP - Natural Language Processing. + NLP - Natural Language Processing. - Variables are only populated by the server, and will be ignored when sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-Classification-Multilabel task. - Currently only Accuracy is supported as primary metric, hence user need not set it explicitly. - Possible values include: "AUCWeighted", "Accuracy", "NormMacroRecall", - "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric for Text-Classification-Multilabel task. + Currently only Accuracy is supported as primary metric, hence user need not set it explicitly. + Possible values include: "AUCWeighted", "Accuracy", "NormMacroRecall", + "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted", "IOU". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - 'primary_metric': {'readonly': True}, + "task_type": {"required": True}, + "training_data": {"required": True}, + "primary_metric": {"readonly": True}, } _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword featurization_settings: Featurization inputs needed for AutoML job. :paramtype featurization_settings: @@ -17773,74 +18036,82 @@ def __init__( :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ super(TextClassificationMultilabel, self).__init__(**kwargs) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.task_type = 'TextClassificationMultilabel' # type: str + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.limit_settings = kwargs.get("limit_settings", None) + self.validation_data = kwargs.get("validation_data", None) + self.task_type = "TextClassificationMultilabel" # type: str self.primary_metric = None - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class TextNer(AutoMLVertical, NlpVertical): """Text-NER task in AutoML NLP vertical. -NER - Named Entity Recognition. -NLP - Natural Language Processing. + NER - Named Entity Recognition. + NLP - Natural Language Processing. - Variables are only populated by the server, and will be ignored when sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-NER task. - Only 'Accuracy' is supported for Text-NER, so user need not set this explicitly. Possible - values include: "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric for Text-NER task. + Only 'Accuracy' is supported for Text-NER, so user need not set this explicitly. Possible + values include: "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - 'primary_metric': {'readonly': True}, + "task_type": {"required": True}, + "training_data": {"required": True}, + "primary_metric": {"readonly": True}, } _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword featurization_settings: Featurization inputs needed for AutoML job. :paramtype featurization_settings: @@ -17859,14 +18130,16 @@ def __init__( :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ super(TextNer, self).__init__(**kwargs) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.task_type = 'TextNER' # type: str + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.limit_settings = kwargs.get("limit_settings", None) + self.validation_data = kwargs.get("validation_data", None) + self.task_type = "TextNER" # type: str self.primary_metric = None - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class TrialComponent(msrest.serialization.Model): @@ -17892,23 +18165,30 @@ class TrialComponent(msrest.serialization.Model): """ _validation = { - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "command": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "environment_id": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, + "code_id": {"key": "codeId", "type": "str"}, + "command": {"key": "command", "type": "str"}, + "distribution": { + "key": "distribution", + "type": "DistributionConfiguration", + }, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "resources": {"key": "resources", "type": "JobResourceConfiguration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword code_id: ARM resource ID of the code asset. :paramtype code_id: str @@ -17927,12 +18207,12 @@ def __init__( :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration """ super(TrialComponent, self).__init__(**kwargs) - self.code_id = kwargs.get('code_id', None) - self.command = kwargs['command'] - self.distribution = kwargs.get('distribution', None) - self.environment_id = kwargs['environment_id'] - self.environment_variables = kwargs.get('environment_variables', None) - self.resources = kwargs.get('resources', None) + self.code_id = kwargs.get("code_id", None) + self.command = kwargs["command"] + self.distribution = kwargs.get("distribution", None) + self.environment_id = kwargs["environment_id"] + self.environment_variables = kwargs.get("environment_variables", None) + self.resources = kwargs.get("resources", None) class TritonModelJobInput(JobInput, AssetJobInput): @@ -17954,21 +18234,18 @@ class TritonModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -17979,10 +18256,10 @@ def __init__( :paramtype description: str """ super(TritonModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'triton_model' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "triton_model" # type: str + self.description = kwargs.get("description", None) class TritonModelJobOutput(JobOutput, AssetJobOutput): @@ -18003,20 +18280,17 @@ class TritonModelJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -18026,10 +18300,10 @@ def __init__( :paramtype description: str """ super(TritonModelJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'triton_model' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "triton_model" # type: str + self.description = kwargs.get("description", None) class TruncationSelectionPolicy(EarlyTerminationPolicy): @@ -18050,20 +18324,20 @@ class TruncationSelectionPolicy(EarlyTerminationPolicy): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'truncation_percentage': {'key': 'truncationPercentage', 'type': 'int'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, + "truncation_percentage": { + "key": "truncationPercentage", + "type": "int", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. :paramtype delay_evaluation: int @@ -18073,8 +18347,8 @@ def __init__( :paramtype truncation_percentage: int """ super(TruncationSelectionPolicy, self).__init__(**kwargs) - self.policy_type = 'TruncationSelection' # type: str - self.truncation_percentage = kwargs.get('truncation_percentage', 0) + self.policy_type = "TruncationSelection" # type: str + self.truncation_percentage = kwargs.get("truncation_percentage", 0) class UpdateWorkspaceQuotas(msrest.serialization.Model): @@ -18098,23 +18372,20 @@ class UpdateWorkspaceQuotas(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, + "id": {"readonly": True}, + "type": {"readonly": True}, + "unit": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "limit": {"key": "limit", "type": "long"}, + "unit": {"key": "unit", "type": "str"}, + "status": {"key": "status", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword limit: The maximum permitted quota of the resource. :paramtype limit: long @@ -18127,9 +18398,9 @@ def __init__( super(UpdateWorkspaceQuotas, self).__init__(**kwargs) self.id = None self.type = None - self.limit = kwargs.get('limit', None) + self.limit = kwargs.get("limit", None) self.unit = None - self.status = kwargs.get('status', None) + self.status = kwargs.get("status", None) class UpdateWorkspaceQuotasResult(msrest.serialization.Model): @@ -18145,21 +18416,17 @@ class UpdateWorkspaceQuotasResult(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[UpdateWorkspaceQuotas]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[UpdateWorkspaceQuotas]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UpdateWorkspaceQuotasResult, self).__init__(**kwargs) self.value = None self.next_link = None @@ -18189,24 +18456,21 @@ class UriFileDataVersion(DataVersionBaseProperties): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -18223,7 +18487,7 @@ def __init__( :paramtype data_uri: str """ super(UriFileDataVersion, self).__init__(**kwargs) - self.data_type = 'uri_file' # type: str + self.data_type = "uri_file" # type: str class UriFileJobInput(JobInput, AssetJobInput): @@ -18245,21 +18509,18 @@ class UriFileJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -18270,10 +18531,10 @@ def __init__( :paramtype description: str """ super(UriFileJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'uri_file' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "uri_file" # type: str + self.description = kwargs.get("description", None) class UriFileJobOutput(JobOutput, AssetJobOutput): @@ -18294,20 +18555,17 @@ class UriFileJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -18317,10 +18575,10 @@ def __init__( :paramtype description: str """ super(UriFileJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'uri_file' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "uri_file" # type: str + self.description = kwargs.get("description", None) class UriFolderDataVersion(DataVersionBaseProperties): @@ -18347,24 +18605,21 @@ class UriFolderDataVersion(DataVersionBaseProperties): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -18381,7 +18636,7 @@ def __init__( :paramtype data_uri: str """ super(UriFolderDataVersion, self).__init__(**kwargs) - self.data_type = 'uri_folder' # type: str + self.data_type = "uri_folder" # type: str class UriFolderJobInput(JobInput, AssetJobInput): @@ -18403,21 +18658,18 @@ class UriFolderJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -18428,10 +18680,10 @@ def __init__( :paramtype description: str """ super(UriFolderJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'uri_folder' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "uri_folder" # type: str + self.description = kwargs.get("description", None) class UriFolderJobOutput(JobOutput, AssetJobOutput): @@ -18452,20 +18704,17 @@ class UriFolderJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -18475,10 +18724,10 @@ def __init__( :paramtype description: str """ super(UriFolderJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'uri_folder' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "uri_folder" # type: str + self.description = kwargs.get("description", None) class Usage(msrest.serialization.Model): @@ -18503,31 +18752,30 @@ class Usage(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'current_value': {'key': 'currentValue', 'type': 'long'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'name': {'key': 'name', 'type': 'UsageName'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ + "id": {"readonly": True}, + "aml_workspace_location": {"readonly": True}, + "type": {"readonly": True}, + "unit": {"readonly": True}, + "current_value": {"readonly": True}, + "limit": {"readonly": True}, + "name": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "aml_workspace_location": { + "key": "amlWorkspaceLocation", + "type": "str", + }, + "type": {"key": "type", "type": "str"}, + "unit": {"key": "unit", "type": "str"}, + "current_value": {"key": "currentValue", "type": "long"}, + "limit": {"key": "limit", "type": "long"}, + "name": {"key": "name", "type": "UsageName"}, + } + + def __init__(self, **kwargs): + """ """ super(Usage, self).__init__(**kwargs) self.id = None self.aml_workspace_location = None @@ -18550,21 +18798,17 @@ class UsageName(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, + "value": {"readonly": True}, + "localized_value": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + "value": {"key": "value", "type": "str"}, + "localized_value": {"key": "localizedValue", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UsageName, self).__init__(**kwargs) self.value = None self.localized_value = None @@ -18585,19 +18829,19 @@ class UserAccountCredentials(msrest.serialization.Model): """ _validation = { - 'admin_user_name': {'required': True}, + "admin_user_name": {"required": True}, } _attribute_map = { - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'admin_user_ssh_public_key': {'key': 'adminUserSshPublicKey', 'type': 'str'}, - 'admin_user_password': {'key': 'adminUserPassword', 'type': 'str'}, + "admin_user_name": {"key": "adminUserName", "type": "str"}, + "admin_user_ssh_public_key": { + "key": "adminUserSshPublicKey", + "type": "str", + }, + "admin_user_password": {"key": "adminUserPassword", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword admin_user_name: Required. Name of the administrator user account which can be used to SSH to nodes. @@ -18608,9 +18852,11 @@ def __init__( :paramtype admin_user_password: str """ super(UserAccountCredentials, self).__init__(**kwargs) - self.admin_user_name = kwargs['admin_user_name'] - self.admin_user_ssh_public_key = kwargs.get('admin_user_ssh_public_key', None) - self.admin_user_password = kwargs.get('admin_user_password', None) + self.admin_user_name = kwargs["admin_user_name"] + self.admin_user_ssh_public_key = kwargs.get( + "admin_user_ssh_public_key", None + ) + self.admin_user_password = kwargs.get("admin_user_password", None) class UserAssignedIdentity(msrest.serialization.Model): @@ -18625,21 +18871,17 @@ class UserAssignedIdentity(msrest.serialization.Model): """ _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, + "principal_id": {"readonly": True}, + "client_id": {"readonly": True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, + "principal_id": {"key": "principalId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UserAssignedIdentity, self).__init__(**kwargs) self.principal_id = None self.client_id = None @@ -18657,24 +18899,22 @@ class UserIdentity(IdentityConfiguration): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UserIdentity, self).__init__(**kwargs) - self.identity_type = 'UserIdentity' # type: str + self.identity_type = "UserIdentity" # type: str -class UsernamePasswordAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class UsernamePasswordAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """UsernamePasswordAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -18697,22 +18937,22 @@ class UsernamePasswordAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionP """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionUsernamePassword'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionUsernamePassword", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: Category of the connection. Possible values include: "PythonFeed", "ContainerRegistry", "Git". @@ -18728,9 +18968,11 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword """ - super(UsernamePasswordAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'UsernamePassword' # type: str - self.credentials = kwargs.get('credentials', None) + super( + UsernamePasswordAuthTypeWorkspaceConnectionProperties, self + ).__init__(**kwargs) + self.auth_type = "UsernamePassword" # type: str + self.credentials = kwargs.get("credentials", None) class VirtualMachineSchema(msrest.serialization.Model): @@ -18741,20 +18983,20 @@ class VirtualMachineSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, + "properties": { + "key": "properties", + "type": "VirtualMachineSchemaProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: :paramtype properties: ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties """ super(VirtualMachineSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class VirtualMachine(Compute, VirtualMachineSchema): @@ -18796,34 +19038,37 @@ class VirtualMachine(Compute, VirtualMachineSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + "disable_local_auth": {"readonly": True}, + } + + _attribute_map = { + "properties": { + "key": "properties", + "type": "VirtualMachineSchemaProperties", + }, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, + } + + def __init__(self, **kwargs): """ :keyword properties: :paramtype properties: @@ -18834,14 +19079,14 @@ def __init__( :paramtype resource_id: str """ super(VirtualMachine, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'VirtualMachine' # type: str + self.properties = kwargs.get("properties", None) + self.compute_type = "VirtualMachine" # type: str self.compute_location = None self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None self.disable_local_auth = None @@ -18857,23 +19102,20 @@ class VirtualMachineImage(msrest.serialization.Model): """ _validation = { - 'id': {'required': True}, + "id": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword id: Required. Virtual Machine image path. :paramtype id: str """ super(VirtualMachineImage, self).__init__(**kwargs) - self.id = kwargs['id'] + self.id = kwargs["id"] class VirtualMachineSchemaProperties(msrest.serialization.Model): @@ -18896,18 +19138,21 @@ class VirtualMachineSchemaProperties(msrest.serialization.Model): """ _attribute_map = { - 'virtual_machine_size': {'key': 'virtualMachineSize', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'notebook_server_port': {'key': 'notebookServerPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'is_notebook_instance_compute': {'key': 'isNotebookInstanceCompute', 'type': 'bool'}, + "virtual_machine_size": {"key": "virtualMachineSize", "type": "str"}, + "ssh_port": {"key": "sshPort", "type": "int"}, + "notebook_server_port": {"key": "notebookServerPort", "type": "int"}, + "address": {"key": "address", "type": "str"}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, + "is_notebook_instance_compute": { + "key": "isNotebookInstanceCompute", + "type": "bool", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword virtual_machine_size: Virtual Machine size. :paramtype virtual_machine_size: str @@ -18925,12 +19170,14 @@ def __init__( :paramtype is_notebook_instance_compute: bool """ super(VirtualMachineSchemaProperties, self).__init__(**kwargs) - self.virtual_machine_size = kwargs.get('virtual_machine_size', None) - self.ssh_port = kwargs.get('ssh_port', None) - self.notebook_server_port = kwargs.get('notebook_server_port', None) - self.address = kwargs.get('address', None) - self.administrator_account = kwargs.get('administrator_account', None) - self.is_notebook_instance_compute = kwargs.get('is_notebook_instance_compute', None) + self.virtual_machine_size = kwargs.get("virtual_machine_size", None) + self.ssh_port = kwargs.get("ssh_port", None) + self.notebook_server_port = kwargs.get("notebook_server_port", None) + self.address = kwargs.get("address", None) + self.administrator_account = kwargs.get("administrator_account", None) + self.is_notebook_instance_compute = kwargs.get( + "is_notebook_instance_compute", None + ) class VirtualMachineSecretsSchema(msrest.serialization.Model): @@ -18942,20 +19189,20 @@ class VirtualMachineSecretsSchema(msrest.serialization.Model): """ _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword administrator_account: Admin credentials for virtual machine. :paramtype administrator_account: ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials """ super(VirtualMachineSecretsSchema, self).__init__(**kwargs) - self.administrator_account = kwargs.get('administrator_account', None) + self.administrator_account = kwargs.get("administrator_account", None) class VirtualMachineSecrets(ComputeSecrets, VirtualMachineSecretsSchema): @@ -18973,26 +19220,26 @@ class VirtualMachineSecrets(ComputeSecrets, VirtualMachineSecretsSchema): """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, + "compute_type": {"key": "computeType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword administrator_account: Admin credentials for virtual machine. :paramtype administrator_account: ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials """ super(VirtualMachineSecrets, self).__init__(**kwargs) - self.administrator_account = kwargs.get('administrator_account', None) - self.compute_type = 'VirtualMachine' # type: str + self.administrator_account = kwargs.get("administrator_account", None) + self.compute_type = "VirtualMachine" # type: str class VirtualMachineSize(msrest.serialization.Model): @@ -19027,35 +19274,41 @@ class VirtualMachineSize(msrest.serialization.Model): """ _validation = { - 'name': {'readonly': True}, - 'family': {'readonly': True}, - 'v_cp_us': {'readonly': True}, - 'gpus': {'readonly': True}, - 'os_vhd_size_mb': {'readonly': True}, - 'max_resource_volume_mb': {'readonly': True}, - 'memory_gb': {'readonly': True}, - 'low_priority_capable': {'readonly': True}, - 'premium_io': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'v_cp_us': {'key': 'vCPUs', 'type': 'int'}, - 'gpus': {'key': 'gpus', 'type': 'int'}, - 'os_vhd_size_mb': {'key': 'osVhdSizeMB', 'type': 'int'}, - 'max_resource_volume_mb': {'key': 'maxResourceVolumeMB', 'type': 'int'}, - 'memory_gb': {'key': 'memoryGB', 'type': 'float'}, - 'low_priority_capable': {'key': 'lowPriorityCapable', 'type': 'bool'}, - 'premium_io': {'key': 'premiumIO', 'type': 'bool'}, - 'estimated_vm_prices': {'key': 'estimatedVMPrices', 'type': 'EstimatedVMPrices'}, - 'supported_compute_types': {'key': 'supportedComputeTypes', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): + "name": {"readonly": True}, + "family": {"readonly": True}, + "v_cp_us": {"readonly": True}, + "gpus": {"readonly": True}, + "os_vhd_size_mb": {"readonly": True}, + "max_resource_volume_mb": {"readonly": True}, + "memory_gb": {"readonly": True}, + "low_priority_capable": {"readonly": True}, + "premium_io": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "family": {"key": "family", "type": "str"}, + "v_cp_us": {"key": "vCPUs", "type": "int"}, + "gpus": {"key": "gpus", "type": "int"}, + "os_vhd_size_mb": {"key": "osVhdSizeMB", "type": "int"}, + "max_resource_volume_mb": { + "key": "maxResourceVolumeMB", + "type": "int", + }, + "memory_gb": {"key": "memoryGB", "type": "float"}, + "low_priority_capable": {"key": "lowPriorityCapable", "type": "bool"}, + "premium_io": {"key": "premiumIO", "type": "bool"}, + "estimated_vm_prices": { + "key": "estimatedVMPrices", + "type": "EstimatedVMPrices", + }, + "supported_compute_types": { + "key": "supportedComputeTypes", + "type": "[str]", + }, + } + + def __init__(self, **kwargs): """ :keyword estimated_vm_prices: The estimated price information for using a VM. :paramtype estimated_vm_prices: ~azure.mgmt.machinelearningservices.models.EstimatedVMPrices @@ -19073,8 +19326,10 @@ def __init__( self.memory_gb = None self.low_priority_capable = None self.premium_io = None - self.estimated_vm_prices = kwargs.get('estimated_vm_prices', None) - self.supported_compute_types = kwargs.get('supported_compute_types', None) + self.estimated_vm_prices = kwargs.get("estimated_vm_prices", None) + self.supported_compute_types = kwargs.get( + "supported_compute_types", None + ) class VirtualMachineSizeListResult(msrest.serialization.Model): @@ -19085,19 +19340,16 @@ class VirtualMachineSizeListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[VirtualMachineSize]'}, + "value": {"key": "value", "type": "[VirtualMachineSize]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: The list of virtual machine sizes supported by AmlCompute. :paramtype value: list[~azure.mgmt.machinelearningservices.models.VirtualMachineSize] """ super(VirtualMachineSizeListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class VirtualMachineSshCredentials(msrest.serialization.Model): @@ -19114,16 +19366,13 @@ class VirtualMachineSshCredentials(msrest.serialization.Model): """ _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'public_key_data': {'key': 'publicKeyData', 'type': 'str'}, - 'private_key_data': {'key': 'privateKeyData', 'type': 'str'}, + "username": {"key": "username", "type": "str"}, + "password": {"key": "password", "type": "str"}, + "public_key_data": {"key": "publicKeyData", "type": "str"}, + "private_key_data": {"key": "privateKeyData", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword username: Username of admin account. :paramtype username: str @@ -19135,10 +19384,10 @@ def __init__( :paramtype private_key_data: str """ super(VirtualMachineSshCredentials, self).__init__(**kwargs) - self.username = kwargs.get('username', None) - self.password = kwargs.get('password', None) - self.public_key_data = kwargs.get('public_key_data', None) - self.private_key_data = kwargs.get('private_key_data', None) + self.username = kwargs.get("username", None) + self.password = kwargs.get("password", None) + self.public_key_data = kwargs.get("public_key_data", None) + self.private_key_data = kwargs.get("private_key_data", None) class Workspace(Resource): @@ -19237,61 +19486,106 @@ class Workspace(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'workspace_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'service_provisioned_resource_group': {'readonly': True}, - 'private_link_count': {'readonly': True}, - 'private_endpoint_connections': {'readonly': True}, - 'notebook_info': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'storage_hns_enabled': {'readonly': True}, - 'ml_flow_tracking_uri': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'key_vault': {'key': 'properties.keyVault', 'type': 'str'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'storage_account': {'key': 'properties.storageAccount', 'type': 'str'}, - 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionProperty'}, - 'hbi_workspace': {'key': 'properties.hbiWorkspace', 'type': 'bool'}, - 'service_provisioned_resource_group': {'key': 'properties.serviceProvisionedResourceGroup', 'type': 'str'}, - 'private_link_count': {'key': 'properties.privateLinkCount', 'type': 'int'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'allow_public_access_when_behind_vnet': {'key': 'properties.allowPublicAccessWhenBehindVnet', 'type': 'bool'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, - 'shared_private_link_resources': {'key': 'properties.sharedPrivateLinkResources', 'type': '[SharedPrivateLinkResource]'}, - 'notebook_info': {'key': 'properties.notebookInfo', 'type': 'NotebookResourceInfo'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, - 'storage_hns_enabled': {'key': 'properties.storageHnsEnabled', 'type': 'bool'}, - 'ml_flow_tracking_uri': {'key': 'properties.mlFlowTrackingUri', 'type': 'str'}, - 'v1_legacy_mode': {'key': 'properties.v1LegacyMode', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "workspace_id": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "service_provisioned_resource_group": {"readonly": True}, + "private_link_count": {"readonly": True}, + "private_endpoint_connections": {"readonly": True}, + "notebook_info": {"readonly": True}, + "tenant_id": {"readonly": True}, + "storage_hns_enabled": {"readonly": True}, + "ml_flow_tracking_uri": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "workspace_id": {"key": "properties.workspaceId", "type": "str"}, + "description": {"key": "properties.description", "type": "str"}, + "friendly_name": {"key": "properties.friendlyName", "type": "str"}, + "key_vault": {"key": "properties.keyVault", "type": "str"}, + "application_insights": { + "key": "properties.applicationInsights", + "type": "str", + }, + "container_registry": { + "key": "properties.containerRegistry", + "type": "str", + }, + "storage_account": {"key": "properties.storageAccount", "type": "str"}, + "discovery_url": {"key": "properties.discoveryUrl", "type": "str"}, + "provisioning_state": { + "key": "properties.provisioningState", + "type": "str", + }, + "encryption": { + "key": "properties.encryption", + "type": "EncryptionProperty", + }, + "hbi_workspace": {"key": "properties.hbiWorkspace", "type": "bool"}, + "service_provisioned_resource_group": { + "key": "properties.serviceProvisionedResourceGroup", + "type": "str", + }, + "private_link_count": { + "key": "properties.privateLinkCount", + "type": "int", + }, + "image_build_compute": { + "key": "properties.imageBuildCompute", + "type": "str", + }, + "allow_public_access_when_behind_vnet": { + "key": "properties.allowPublicAccessWhenBehindVnet", + "type": "bool", + }, + "public_network_access": { + "key": "properties.publicNetworkAccess", + "type": "str", + }, + "private_endpoint_connections": { + "key": "properties.privateEndpointConnections", + "type": "[PrivateEndpointConnection]", + }, + "shared_private_link_resources": { + "key": "properties.sharedPrivateLinkResources", + "type": "[SharedPrivateLinkResource]", + }, + "notebook_info": { + "key": "properties.notebookInfo", + "type": "NotebookResourceInfo", + }, + "service_managed_resources_settings": { + "key": "properties.serviceManagedResourcesSettings", + "type": "ServiceManagedResourcesSettings", + }, + "primary_user_assigned_identity": { + "key": "properties.primaryUserAssignedIdentity", + "type": "str", + }, + "tenant_id": {"key": "properties.tenantId", "type": "str"}, + "storage_hns_enabled": { + "key": "properties.storageHnsEnabled", + "type": "bool", + }, + "ml_flow_tracking_uri": { + "key": "properties.mlFlowTrackingUri", + "type": "str", + }, + "v1_legacy_mode": {"key": "properties.v1LegacyMode", "type": "bool"}, + } + + def __init__(self, **kwargs): """ :keyword identity: The identity of the resource. :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity @@ -19348,35 +19642,43 @@ def __init__( :paramtype v1_legacy_mode: bool """ super(Workspace, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) + self.identity = kwargs.get("identity", None) + self.location = kwargs.get("location", None) + self.tags = kwargs.get("tags", None) + self.sku = kwargs.get("sku", None) self.workspace_id = None - self.description = kwargs.get('description', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.key_vault = kwargs.get('key_vault', None) - self.application_insights = kwargs.get('application_insights', None) - self.container_registry = kwargs.get('container_registry', None) - self.storage_account = kwargs.get('storage_account', None) - self.discovery_url = kwargs.get('discovery_url', None) + self.description = kwargs.get("description", None) + self.friendly_name = kwargs.get("friendly_name", None) + self.key_vault = kwargs.get("key_vault", None) + self.application_insights = kwargs.get("application_insights", None) + self.container_registry = kwargs.get("container_registry", None) + self.storage_account = kwargs.get("storage_account", None) + self.discovery_url = kwargs.get("discovery_url", None) self.provisioning_state = None - self.encryption = kwargs.get('encryption', None) - self.hbi_workspace = kwargs.get('hbi_workspace', False) + self.encryption = kwargs.get("encryption", None) + self.hbi_workspace = kwargs.get("hbi_workspace", False) self.service_provisioned_resource_group = None self.private_link_count = None - self.image_build_compute = kwargs.get('image_build_compute', None) - self.allow_public_access_when_behind_vnet = kwargs.get('allow_public_access_when_behind_vnet', False) - self.public_network_access = kwargs.get('public_network_access', None) + self.image_build_compute = kwargs.get("image_build_compute", None) + self.allow_public_access_when_behind_vnet = kwargs.get( + "allow_public_access_when_behind_vnet", False + ) + self.public_network_access = kwargs.get("public_network_access", None) self.private_endpoint_connections = None - self.shared_private_link_resources = kwargs.get('shared_private_link_resources', None) + self.shared_private_link_resources = kwargs.get( + "shared_private_link_resources", None + ) self.notebook_info = None - self.service_managed_resources_settings = kwargs.get('service_managed_resources_settings', None) - self.primary_user_assigned_identity = kwargs.get('primary_user_assigned_identity', None) + self.service_managed_resources_settings = kwargs.get( + "service_managed_resources_settings", None + ) + self.primary_user_assigned_identity = kwargs.get( + "primary_user_assigned_identity", None + ) self.tenant_id = None self.storage_hns_enabled = None self.ml_flow_tracking_uri = None - self.v1_legacy_mode = kwargs.get('v1_legacy_mode', False) + self.v1_legacy_mode = kwargs.get("v1_legacy_mode", False) class WorkspaceConnectionManagedIdentity(msrest.serialization.Model): @@ -19389,14 +19691,11 @@ class WorkspaceConnectionManagedIdentity(msrest.serialization.Model): """ _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, + "resource_id": {"key": "resourceId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword resource_id: :paramtype resource_id: str @@ -19404,8 +19703,8 @@ def __init__( :paramtype client_id: str """ super(WorkspaceConnectionManagedIdentity, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.client_id = kwargs.get('client_id', None) + self.resource_id = kwargs.get("resource_id", None) + self.client_id = kwargs.get("client_id", None) class WorkspaceConnectionPersonalAccessToken(msrest.serialization.Model): @@ -19416,19 +19715,16 @@ class WorkspaceConnectionPersonalAccessToken(msrest.serialization.Model): """ _attribute_map = { - 'pat': {'key': 'pat', 'type': 'str'}, + "pat": {"key": "pat", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword pat: :paramtype pat: str """ super(WorkspaceConnectionPersonalAccessToken, self).__init__(**kwargs) - self.pat = kwargs.get('pat', None) + self.pat = kwargs.get("pat", None) class WorkspaceConnectionPropertiesV2BasicResource(Resource): @@ -19454,35 +19750,39 @@ class WorkspaceConnectionPropertiesV2BasicResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'WorkspaceConnectionPropertiesV2'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "WorkspaceConnectionPropertiesV2", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. :paramtype properties: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 """ - super(WorkspaceConnectionPropertiesV2BasicResource, self).__init__(**kwargs) - self.properties = kwargs['properties'] + super(WorkspaceConnectionPropertiesV2BasicResource, self).__init__( + **kwargs + ) + self.properties = kwargs["properties"] -class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(msrest.serialization.Model): +class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult( + msrest.serialization.Model +): """WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult. Variables are only populated by the server, and will be ignored when sending a request. @@ -19495,25 +19795,28 @@ class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(msrest.seri """ _validation = { - 'next_link': {'readonly': True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[WorkspaceConnectionPropertiesV2BasicResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": { + "key": "value", + "type": "[WorkspaceConnectionPropertiesV2BasicResource]", + }, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: :paramtype value: list[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource] """ - super(WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + super( + WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, + self, + ).__init__(**kwargs) + self.value = kwargs.get("value", None) self.next_link = None @@ -19525,19 +19828,18 @@ class WorkspaceConnectionSharedAccessSignature(msrest.serialization.Model): """ _attribute_map = { - 'sas': {'key': 'sas', 'type': 'str'}, + "sas": {"key": "sas", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword sas: :paramtype sas: str """ - super(WorkspaceConnectionSharedAccessSignature, self).__init__(**kwargs) - self.sas = kwargs.get('sas', None) + super(WorkspaceConnectionSharedAccessSignature, self).__init__( + **kwargs + ) + self.sas = kwargs.get("sas", None) class WorkspaceConnectionUsernamePassword(msrest.serialization.Model): @@ -19550,14 +19852,11 @@ class WorkspaceConnectionUsernamePassword(msrest.serialization.Model): """ _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, + "username": {"key": "username", "type": "str"}, + "password": {"key": "password", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword username: :paramtype username: str @@ -19565,8 +19864,8 @@ def __init__( :paramtype password: str """ super(WorkspaceConnectionUsernamePassword, self).__init__(**kwargs) - self.username = kwargs.get('username', None) - self.password = kwargs.get('password', None) + self.username = kwargs.get("username", None) + self.password = kwargs.get("password", None) class WorkspaceListResult(msrest.serialization.Model): @@ -19581,14 +19880,11 @@ class WorkspaceListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[Workspace]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Workspace]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: The list of machine learning workspaces. Since this list may be incomplete, the nextLink field should be used to request the next list of machine learning workspaces. @@ -19598,8 +19894,8 @@ def __init__( :paramtype next_link: str """ super(WorkspaceListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get("value", None) + self.next_link = kwargs.get("next_link", None) class WorkspaceUpdateParameters(msrest.serialization.Model): @@ -19634,23 +19930,38 @@ class WorkspaceUpdateParameters(msrest.serialization.Model): """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "description": {"key": "properties.description", "type": "str"}, + "friendly_name": {"key": "properties.friendlyName", "type": "str"}, + "image_build_compute": { + "key": "properties.imageBuildCompute", + "type": "str", + }, + "service_managed_resources_settings": { + "key": "properties.serviceManagedResourcesSettings", + "type": "ServiceManagedResourcesSettings", + }, + "primary_user_assigned_identity": { + "key": "properties.primaryUserAssignedIdentity", + "type": "str", + }, + "public_network_access": { + "key": "properties.publicNetworkAccess", + "type": "str", + }, + "application_insights": { + "key": "properties.applicationInsights", + "type": "str", + }, + "container_registry": { + "key": "properties.containerRegistry", + "type": "str", + }, + } + + def __init__(self, **kwargs): """ :keyword tags: A set of tags. The resource tags for the machine learning workspace. :paramtype tags: dict[str, str] @@ -19681,14 +19992,18 @@ def __init__( :paramtype container_registry: str """ super(WorkspaceUpdateParameters, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) - self.identity = kwargs.get('identity', None) - self.description = kwargs.get('description', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.image_build_compute = kwargs.get('image_build_compute', None) - self.service_managed_resources_settings = kwargs.get('service_managed_resources_settings', None) - self.primary_user_assigned_identity = kwargs.get('primary_user_assigned_identity', None) - self.public_network_access = kwargs.get('public_network_access', None) - self.application_insights = kwargs.get('application_insights', None) - self.container_registry = kwargs.get('container_registry', None) + self.tags = kwargs.get("tags", None) + self.sku = kwargs.get("sku", None) + self.identity = kwargs.get("identity", None) + self.description = kwargs.get("description", None) + self.friendly_name = kwargs.get("friendly_name", None) + self.image_build_compute = kwargs.get("image_build_compute", None) + self.service_managed_resources_settings = kwargs.get( + "service_managed_resources_settings", None + ) + self.primary_user_assigned_identity = kwargs.get( + "primary_user_assigned_identity", None + ) + self.public_network_access = kwargs.get("public_network_access", None) + self.application_insights = kwargs.get("application_insights", None) + self.container_registry = kwargs.get("container_registry", None) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/models/_models_py3.py index 9265fff1d6da..5ca73864f7b3 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/models/_models_py3.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/models/_models_py3.py @@ -30,23 +30,25 @@ class DatastoreCredentials(msrest.serialization.Model): """ _validation = { - 'credentials_type': {'required': True}, + "credentials_type": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, } _subtype_map = { - 'credentials_type': {'AccountKey': 'AccountKeyDatastoreCredentials', 'Certificate': 'CertificateDatastoreCredentials', 'None': 'NoneDatastoreCredentials', 'Sas': 'SasDatastoreCredentials', 'ServicePrincipal': 'ServicePrincipalDatastoreCredentials'} + "credentials_type": { + "AccountKey": "AccountKeyDatastoreCredentials", + "Certificate": "CertificateDatastoreCredentials", + "None": "NoneDatastoreCredentials", + "Sas": "SasDatastoreCredentials", + "ServicePrincipal": "ServicePrincipalDatastoreCredentials", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DatastoreCredentials, self).__init__(**kwargs) self.credentials_type = None # type: Optional[str] @@ -65,27 +67,22 @@ class AccountKeyDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, + "credentials_type": {"required": True}, + "secrets": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'AccountKeyDatastoreSecrets'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "secrets": {"key": "secrets", "type": "AccountKeyDatastoreSecrets"}, } - def __init__( - self, - *, - secrets: "AccountKeyDatastoreSecrets", - **kwargs - ): + def __init__(self, *, secrets: "AccountKeyDatastoreSecrets", **kwargs): """ :keyword secrets: Required. [Required] Storage account secrets. :paramtype secrets: ~azure.mgmt.machinelearningservices.models.AccountKeyDatastoreSecrets """ super(AccountKeyDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'AccountKey' # type: str + self.credentials_type = "AccountKey" # type: str self.secrets = secrets @@ -104,23 +101,24 @@ class DatastoreSecrets(msrest.serialization.Model): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, } _subtype_map = { - 'secrets_type': {'AccountKey': 'AccountKeyDatastoreSecrets', 'Certificate': 'CertificateDatastoreSecrets', 'Sas': 'SasDatastoreSecrets', 'ServicePrincipal': 'ServicePrincipalDatastoreSecrets'} + "secrets_type": { + "AccountKey": "AccountKeyDatastoreSecrets", + "Certificate": "CertificateDatastoreSecrets", + "Sas": "SasDatastoreSecrets", + "ServicePrincipal": "ServicePrincipalDatastoreSecrets", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DatastoreSecrets, self).__init__(**kwargs) self.secrets_type = None # type: Optional[str] @@ -139,26 +137,21 @@ class AccountKeyDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "key": {"key": "key", "type": "str"}, } - def __init__( - self, - *, - key: Optional[str] = None, - **kwargs - ): + def __init__(self, *, key: Optional[str] = None, **kwargs): """ :keyword key: Storage account key. :paramtype key: str """ super(AccountKeyDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'AccountKey' # type: str + self.secrets_type = "AccountKey" # type: str self.key = key @@ -170,14 +163,11 @@ class AKSSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, + "properties": {"key": "properties", "type": "AKSSchemaProperties"}, } def __init__( - self, - *, - properties: Optional["AKSSchemaProperties"] = None, - **kwargs + self, *, properties: Optional["AKSSchemaProperties"] = None, **kwargs ): """ :keyword properties: AKS properties. @@ -227,31 +217,45 @@ class Compute(msrest.serialization.Model): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + "disable_local_auth": {"readonly": True}, + } + + _attribute_map = { + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } _subtype_map = { - 'compute_type': {'AKS': 'AKS', 'AmlCompute': 'AmlCompute', 'ComputeInstance': 'ComputeInstance', 'DataFactory': 'DataFactory', 'DataLakeAnalytics': 'DataLakeAnalytics', 'Databricks': 'Databricks', 'HDInsight': 'HDInsight', 'Kubernetes': 'Kubernetes', 'SynapseSpark': 'SynapseSpark', 'VirtualMachine': 'VirtualMachine'} + "compute_type": { + "AKS": "AKS", + "AmlCompute": "AmlCompute", + "ComputeInstance": "ComputeInstance", + "DataFactory": "DataFactory", + "DataLakeAnalytics": "DataLakeAnalytics", + "Databricks": "Databricks", + "HDInsight": "HDInsight", + "Kubernetes": "Kubernetes", + "SynapseSpark": "SynapseSpark", + "VirtualMachine": "VirtualMachine", + } } def __init__( @@ -319,28 +323,31 @@ class AKS(Compute, AKSSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + "disable_local_auth": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "AKSSchemaProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -359,9 +366,14 @@ def __init__( :keyword resource_id: ARM resource id of the underlying compute. :paramtype resource_id: str """ - super(AKS, self).__init__(description=description, resource_id=resource_id, properties=properties, **kwargs) + super(AKS, self).__init__( + description=description, + resource_id=resource_id, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'AKS' # type: str + self.compute_type = "AKS" # type: str self.compute_location = None self.provisioning_state = None self.description = description @@ -387,9 +399,12 @@ class AksComputeSecretsProperties(msrest.serialization.Model): """ _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, + "user_kube_config": {"key": "userKubeConfig", "type": "str"}, + "admin_kube_config": {"key": "adminKubeConfig", "type": "str"}, + "image_pull_secret_name": { + "key": "imagePullSecretName", + "type": "str", + }, } def __init__( @@ -431,23 +446,23 @@ class ComputeSecrets(msrest.serialization.Model): """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "compute_type": {"key": "computeType", "type": "str"}, } _subtype_map = { - 'compute_type': {'AKS': 'AksComputeSecrets', 'Databricks': 'DatabricksComputeSecrets', 'VirtualMachine': 'VirtualMachineSecrets'} + "compute_type": { + "AKS": "AksComputeSecrets", + "Databricks": "DatabricksComputeSecrets", + "VirtualMachine": "VirtualMachineSecrets", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ComputeSecrets, self).__init__(**kwargs) self.compute_type = None # type: Optional[str] @@ -472,14 +487,17 @@ class AksComputeSecrets(ComputeSecrets, AksComputeSecretsProperties): """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "user_kube_config": {"key": "userKubeConfig", "type": "str"}, + "admin_kube_config": {"key": "adminKubeConfig", "type": "str"}, + "image_pull_secret_name": { + "key": "imagePullSecretName", + "type": "str", + }, + "compute_type": {"key": "computeType", "type": "str"}, } def __init__( @@ -500,11 +518,16 @@ def __init__( :keyword image_pull_secret_name: Image registry pull secret. :paramtype image_pull_secret_name: str """ - super(AksComputeSecrets, self).__init__(user_kube_config=user_kube_config, admin_kube_config=admin_kube_config, image_pull_secret_name=image_pull_secret_name, **kwargs) + super(AksComputeSecrets, self).__init__( + user_kube_config=user_kube_config, + admin_kube_config=admin_kube_config, + image_pull_secret_name=image_pull_secret_name, + **kwargs + ) self.user_kube_config = user_kube_config self.admin_kube_config = admin_kube_config self.image_pull_secret_name = image_pull_secret_name - self.compute_type = 'AKS' # type: str + self.compute_type = "AKS" # type: str class AksNetworkingConfiguration(msrest.serialization.Model): @@ -524,16 +547,22 @@ class AksNetworkingConfiguration(msrest.serialization.Model): """ _validation = { - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, + "service_cidr": { + "pattern": r"^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$" + }, + "dns_service_ip": { + "pattern": r"^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" + }, + "docker_bridge_cidr": { + "pattern": r"^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$" + }, } _attribute_map = { - 'subnet_id': {'key': 'subnetId', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, + "subnet_id": {"key": "subnetId", "type": "str"}, + "service_cidr": {"key": "serviceCidr", "type": "str"}, + "dns_service_ip": {"key": "dnsServiceIP", "type": "str"}, + "docker_bridge_cidr": {"key": "dockerBridgeCidr", "type": "str"}, } def __init__( @@ -594,20 +623,29 @@ class AKSSchemaProperties(msrest.serialization.Model): """ _validation = { - 'system_services': {'readonly': True}, - 'agent_count': {'minimum': 0}, + "system_services": {"readonly": True}, + "agent_count": {"minimum": 0}, } _attribute_map = { - 'cluster_fqdn': {'key': 'clusterFqdn', 'type': 'str'}, - 'system_services': {'key': 'systemServices', 'type': '[SystemService]'}, - 'agent_count': {'key': 'agentCount', 'type': 'int'}, - 'agent_vm_size': {'key': 'agentVmSize', 'type': 'str'}, - 'cluster_purpose': {'key': 'clusterPurpose', 'type': 'str'}, - 'ssl_configuration': {'key': 'sslConfiguration', 'type': 'SslConfiguration'}, - 'aks_networking_configuration': {'key': 'aksNetworkingConfiguration', 'type': 'AksNetworkingConfiguration'}, - 'load_balancer_type': {'key': 'loadBalancerType', 'type': 'str'}, - 'load_balancer_subnet': {'key': 'loadBalancerSubnet', 'type': 'str'}, + "cluster_fqdn": {"key": "clusterFqdn", "type": "str"}, + "system_services": { + "key": "systemServices", + "type": "[SystemService]", + }, + "agent_count": {"key": "agentCount", "type": "int"}, + "agent_vm_size": {"key": "agentVmSize", "type": "str"}, + "cluster_purpose": {"key": "clusterPurpose", "type": "str"}, + "ssl_configuration": { + "key": "sslConfiguration", + "type": "SslConfiguration", + }, + "aks_networking_configuration": { + "key": "aksNetworkingConfiguration", + "type": "AksNetworkingConfiguration", + }, + "load_balancer_type": {"key": "loadBalancerType", "type": "str"}, + "load_balancer_subnet": {"key": "loadBalancerSubnet", "type": "str"}, } def __init__( @@ -618,8 +656,12 @@ def __init__( agent_vm_size: Optional[str] = None, cluster_purpose: Optional[Union[str, "ClusterPurpose"]] = "FastProd", ssl_configuration: Optional["SslConfiguration"] = None, - aks_networking_configuration: Optional["AksNetworkingConfiguration"] = None, - load_balancer_type: Optional[Union[str, "LoadBalancerType"]] = "PublicIp", + aks_networking_configuration: Optional[ + "AksNetworkingConfiguration" + ] = None, + load_balancer_type: Optional[ + Union[str, "LoadBalancerType"] + ] = "PublicIp", load_balancer_subnet: Optional[str] = None, **kwargs ): @@ -665,14 +707,11 @@ class AmlComputeSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, + "properties": {"key": "properties", "type": "AmlComputeProperties"}, } def __init__( - self, - *, - properties: Optional["AmlComputeProperties"] = None, - **kwargs + self, *, properties: Optional["AmlComputeProperties"] = None, **kwargs ): """ :keyword properties: Properties of AmlCompute. @@ -721,28 +760,31 @@ class AmlCompute(Compute, AmlComputeSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + "disable_local_auth": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "AmlComputeProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -761,9 +803,14 @@ def __init__( :keyword resource_id: ARM resource id of the underlying compute. :paramtype resource_id: str """ - super(AmlCompute, self).__init__(description=description, resource_id=resource_id, properties=properties, **kwargs) + super(AmlCompute, self).__init__( + description=description, + resource_id=resource_id, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'AmlCompute' # type: str + self.compute_type = "AmlCompute" # type: str self.compute_location = None self.provisioning_state = None self.description = description @@ -797,29 +844,25 @@ class AmlComputeNodeInformation(msrest.serialization.Model): """ _validation = { - 'node_id': {'readonly': True}, - 'private_ip_address': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'port': {'readonly': True}, - 'node_state': {'readonly': True}, - 'run_id': {'readonly': True}, + "node_id": {"readonly": True}, + "private_ip_address": {"readonly": True}, + "public_ip_address": {"readonly": True}, + "port": {"readonly": True}, + "node_state": {"readonly": True}, + "run_id": {"readonly": True}, } _attribute_map = { - 'node_id': {'key': 'nodeId', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'node_state': {'key': 'nodeState', 'type': 'str'}, - 'run_id': {'key': 'runId', 'type': 'str'}, + "node_id": {"key": "nodeId", "type": "str"}, + "private_ip_address": {"key": "privateIpAddress", "type": "str"}, + "public_ip_address": {"key": "publicIpAddress", "type": "str"}, + "port": {"key": "port", "type": "int"}, + "node_state": {"key": "nodeState", "type": "str"}, + "run_id": {"key": "runId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AmlComputeNodeInformation, self).__init__(**kwargs) self.node_id = None self.private_ip_address = None @@ -841,21 +884,17 @@ class AmlComputeNodesInformation(msrest.serialization.Model): """ _validation = { - 'nodes': {'readonly': True}, - 'next_link': {'readonly': True}, + "nodes": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'nodes': {'key': 'nodes', 'type': '[AmlComputeNodeInformation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "nodes": {"key": "nodes", "type": "[AmlComputeNodeInformation]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AmlComputeNodesInformation, self).__init__(**kwargs) self.nodes = None self.next_link = None @@ -926,32 +965,47 @@ class AmlComputeProperties(msrest.serialization.Model): """ _validation = { - 'allocation_state': {'readonly': True}, - 'allocation_state_transition_time': {'readonly': True}, - 'errors': {'readonly': True}, - 'current_node_count': {'readonly': True}, - 'target_node_count': {'readonly': True}, - 'node_state_counts': {'readonly': True}, - } - - _attribute_map = { - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'vm_priority': {'key': 'vmPriority', 'type': 'str'}, - 'virtual_machine_image': {'key': 'virtualMachineImage', 'type': 'VirtualMachineImage'}, - 'isolated_network': {'key': 'isolatedNetwork', 'type': 'bool'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, - 'user_account_credentials': {'key': 'userAccountCredentials', 'type': 'UserAccountCredentials'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'remote_login_port_public_access': {'key': 'remoteLoginPortPublicAccess', 'type': 'str'}, - 'allocation_state': {'key': 'allocationState', 'type': 'str'}, - 'allocation_state_transition_time': {'key': 'allocationStateTransitionTime', 'type': 'iso-8601'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'current_node_count': {'key': 'currentNodeCount', 'type': 'int'}, - 'target_node_count': {'key': 'targetNodeCount', 'type': 'int'}, - 'node_state_counts': {'key': 'nodeStateCounts', 'type': 'NodeStateCounts'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'property_bag': {'key': 'propertyBag', 'type': 'object'}, + "allocation_state": {"readonly": True}, + "allocation_state_transition_time": {"readonly": True}, + "errors": {"readonly": True}, + "current_node_count": {"readonly": True}, + "target_node_count": {"readonly": True}, + "node_state_counts": {"readonly": True}, + } + + _attribute_map = { + "os_type": {"key": "osType", "type": "str"}, + "vm_size": {"key": "vmSize", "type": "str"}, + "vm_priority": {"key": "vmPriority", "type": "str"}, + "virtual_machine_image": { + "key": "virtualMachineImage", + "type": "VirtualMachineImage", + }, + "isolated_network": {"key": "isolatedNetwork", "type": "bool"}, + "scale_settings": {"key": "scaleSettings", "type": "ScaleSettings"}, + "user_account_credentials": { + "key": "userAccountCredentials", + "type": "UserAccountCredentials", + }, + "subnet": {"key": "subnet", "type": "ResourceId"}, + "remote_login_port_public_access": { + "key": "remoteLoginPortPublicAccess", + "type": "str", + }, + "allocation_state": {"key": "allocationState", "type": "str"}, + "allocation_state_transition_time": { + "key": "allocationStateTransitionTime", + "type": "iso-8601", + }, + "errors": {"key": "errors", "type": "[ErrorResponse]"}, + "current_node_count": {"key": "currentNodeCount", "type": "int"}, + "target_node_count": {"key": "targetNodeCount", "type": "int"}, + "node_state_counts": { + "key": "nodeStateCounts", + "type": "NodeStateCounts", + }, + "enable_node_public_ip": {"key": "enableNodePublicIp", "type": "bool"}, + "property_bag": {"key": "propertyBag", "type": "object"}, } def __init__( @@ -965,7 +1019,9 @@ def __init__( scale_settings: Optional["ScaleSettings"] = None, user_account_credentials: Optional["UserAccountCredentials"] = None, subnet: Optional["ResourceId"] = None, - remote_login_port_public_access: Optional[Union[str, "RemoteLoginPortPublicAccess"]] = "NotSpecified", + remote_login_port_public_access: Optional[ + Union[str, "RemoteLoginPortPublicAccess"] + ] = "NotSpecified", enable_node_public_ip: Optional[bool] = True, property_bag: Optional[Any] = None, **kwargs @@ -1041,9 +1097,9 @@ class AmlOperation(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'AmlOperationDisplay'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + "name": {"key": "name", "type": "str"}, + "display": {"key": "display", "type": "AmlOperationDisplay"}, + "is_data_action": {"key": "isDataAction", "type": "bool"}, } def __init__( @@ -1082,10 +1138,10 @@ class AmlOperationDisplay(msrest.serialization.Model): """ _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, + "provider": {"key": "provider", "type": "str"}, + "resource": {"key": "resource", "type": "str"}, + "operation": {"key": "operation", "type": "str"}, + "description": {"key": "description", "type": "str"}, } def __init__( @@ -1122,14 +1178,11 @@ class AmlOperationListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlOperation]'}, + "value": {"key": "value", "type": "[AmlOperation]"}, } def __init__( - self, - *, - value: Optional[List["AmlOperation"]] = None, - **kwargs + self, *, value: Optional[List["AmlOperation"]] = None, **kwargs ): """ :keyword value: List of AML workspace operations supported by the AML workspace resource @@ -1155,23 +1208,23 @@ class IdentityConfiguration(msrest.serialization.Model): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, } _subtype_map = { - 'identity_type': {'AMLToken': 'AmlToken', 'Managed': 'ManagedIdentity', 'UserIdentity': 'UserIdentity'} + "identity_type": { + "AMLToken": "AmlToken", + "Managed": "ManagedIdentity", + "UserIdentity": "UserIdentity", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(IdentityConfiguration, self).__init__(**kwargs) self.identity_type = None # type: Optional[str] @@ -1188,21 +1241,17 @@ class AmlToken(IdentityConfiguration): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AmlToken, self).__init__(**kwargs) - self.identity_type = 'AMLToken' # type: str + self.identity_type = "AMLToken" # type: str class AmlUserFeature(msrest.serialization.Model): @@ -1217,9 +1266,9 @@ class AmlUserFeature(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "description": {"key": "description", "type": "str"}, } def __init__( @@ -1256,9 +1305,9 @@ class ResourceBase(msrest.serialization.Model): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, } def __init__( @@ -1299,11 +1348,11 @@ class AssetBase(ResourceBase): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, } def __init__( @@ -1328,7 +1377,9 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(AssetBase, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + super(AssetBase, self).__init__( + description=description, properties=properties, tags=tags, **kwargs + ) self.is_anonymous = is_anonymous self.is_archived = is_archived @@ -1353,17 +1404,17 @@ class AssetContainer(ResourceBase): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, } def __init__( @@ -1385,7 +1436,9 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(AssetContainer, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + super(AssetContainer, self).__init__( + description=description, properties=properties, tags=tags, **kwargs + ) self.is_archived = is_archived self.latest_version = None self.next_version = None @@ -1404,12 +1457,12 @@ class AssetJobInput(msrest.serialization.Model): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, } def __init__( @@ -1441,8 +1494,8 @@ class AssetJobOutput(msrest.serialization.Model): """ _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, } def __init__( @@ -1477,23 +1530,23 @@ class AssetReferenceBase(msrest.serialization.Model): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, } _subtype_map = { - 'reference_type': {'DataPath': 'DataPathAssetReference', 'Id': 'IdAssetReference', 'OutputPath': 'OutputPathAssetReference'} + "reference_type": { + "DataPath": "DataPathAssetReference", + "Id": "IdAssetReference", + "OutputPath": "OutputPathAssetReference", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AssetReferenceBase, self).__init__(**kwargs) self.reference_type = None # type: Optional[str] @@ -1510,22 +1563,16 @@ class AssignedUser(msrest.serialization.Model): """ _validation = { - 'object_id': {'required': True}, - 'tenant_id': {'required': True}, + "object_id": {"required": True}, + "tenant_id": {"required": True}, } _attribute_map = { - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + "object_id": {"key": "objectId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, } - def __init__( - self, - *, - object_id: str, - tenant_id: str, - **kwargs - ): + def __init__(self, *, object_id: str, tenant_id: str, **kwargs): """ :keyword object_id: Required. User�s AAD Object Id. :paramtype object_id: str @@ -1551,23 +1598,22 @@ class ForecastHorizon(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoForecastHorizon', 'Custom': 'CustomForecastHorizon'} + "mode": { + "Auto": "AutoForecastHorizon", + "Custom": "CustomForecastHorizon", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ForecastHorizon, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -1583,21 +1629,17 @@ class AutoForecastHorizon(ForecastHorizon): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoForecastHorizon, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class JobBaseProperties(ResourceBase): @@ -1644,27 +1686,32 @@ class JobBaseProperties(ResourceBase): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, + "job_type": {"required": True}, + "status": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, } _subtype_map = { - 'job_type': {'AutoML': 'AutoMLJob', 'Command': 'CommandJob', 'Pipeline': 'PipelineJob', 'Sweep': 'SweepJob'} + "job_type": { + "AutoML": "AutoMLJob", + "Command": "CommandJob", + "Pipeline": "PipelineJob", + "Sweep": "SweepJob", + } } def __init__( @@ -1708,97 +1755,102 @@ def __init__( For local jobs, a job endpoint will have an endpoint value of FileStreamObject. :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] """ - super(JobBaseProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + super(JobBaseProperties, self).__init__( + description=description, properties=properties, tags=tags, **kwargs + ) self.component_id = component_id self.compute_id = compute_id self.display_name = display_name self.experiment_name = experiment_name self.identity = identity self.is_archived = is_archived - self.job_type = 'JobBaseProperties' # type: str + self.job_type = "JobBaseProperties" # type: str self.services = services self.status = None class AutoMLJob(JobBaseProperties): """AutoMLJob class. -Use this class for executing AutoML tasks like Classification/Regression etc. -See TaskType enum for all the tasks supported. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Sweep", "Pipeline". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar environment_id: The ARM resource ID of the Environment specification for the job. - This is optional value to provide, if not provided, AutoML will default this to Production - AutoML curated environment version when running the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - :ivar task_details: Required. [Required] This represents scenario which can be one of - Tables/NLP/Image. - :vartype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical + Use this class for executing AutoML tasks like Classification/Regression etc. + See TaskType enum for all the tasks supported. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar description: The asset description text. + :vartype description: str + :ivar properties: The asset property dictionary. + :vartype properties: dict[str, str] + :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + :ivar component_id: ARM resource ID of the component resource. + :vartype component_id: str + :ivar compute_id: ARM resource ID of the compute resource. + :vartype compute_id: str + :ivar display_name: Display name of job. + :vartype display_name: str + :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is + placed in the "Default" experiment. + :vartype experiment_name: str + :ivar identity: Identity configuration. If set, this should be one of AmlToken, + ManagedIdentity, UserIdentity or null. + Defaults to AmlToken if null. + :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration + :ivar is_archived: Is the asset archived?. + :vartype is_archived: bool + :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. + Possible values include: "AutoML", "Command", "Sweep", "Pipeline". + :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType + :ivar services: List of JobEndpoints. + For local jobs, a job endpoint will have an endpoint value of FileStreamObject. + :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] + :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", + "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", + "Failed", "Canceled", "NotResponding", "Paused", "Unknown". + :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus + :ivar environment_id: The ARM resource ID of the Environment specification for the job. + This is optional value to provide, if not provided, AutoML will default this to Production + AutoML curated environment version when running the job. + :vartype environment_id: str + :ivar environment_variables: Environment variables included in the job. + :vartype environment_variables: dict[str, str] + :ivar outputs: Mapping of output data bindings used in the job. + :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] + :ivar resources: Compute Resource configuration for the job. + :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration + :ivar task_details: Required. [Required] This represents scenario which can be one of + Tables/NLP/Image. + :vartype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'task_details': {'required': True}, + "job_type": {"required": True}, + "status": {"readonly": True}, + "task_details": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - 'task_details': {'key': 'taskDetails', 'type': 'AutoMLVertical'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "resources": {"key": "resources", "type": "JobResourceConfiguration"}, + "task_details": {"key": "taskDetails", "type": "AutoMLVertical"}, } def __init__( @@ -1860,8 +1912,20 @@ def __init__( Tables/NLP/Image. :paramtype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical """ - super(AutoMLJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, services=services, **kwargs) - self.job_type = 'AutoML' # type: str + super(AutoMLJob, self).__init__( + description=description, + properties=properties, + tags=tags, + component_id=component_id, + compute_id=compute_id, + display_name=display_name, + experiment_name=experiment_name, + identity=identity, + is_archived=is_archived, + services=services, + **kwargs + ) + self.job_type = "AutoML" # type: str self.environment_id = environment_id self.environment_variables = environment_variables self.outputs = outputs @@ -1871,42 +1935,53 @@ def __init__( class AutoMLVertical(msrest.serialization.Model): """AutoML vertical class. -Base class for AutoML verticals - TableVertical/ImageVertical/NLPVertical. + Base class for AutoML verticals - TableVertical/ImageVertical/NLPVertical. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Classification, Forecasting, ImageClassification, ImageClassificationMultilabel, ImageInstanceSegmentation, ImageObjectDetection, Regression, TextClassification, TextClassificationMultilabel, TextNer. + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Classification, Forecasting, ImageClassification, ImageClassificationMultilabel, ImageInstanceSegmentation, ImageObjectDetection, Regression, TextClassification, TextClassificationMultilabel, TextNer. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, + "task_type": {"required": True}, + "training_data": {"required": True}, } _attribute_map = { - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, } _subtype_map = { - 'task_type': {'Classification': 'Classification', 'Forecasting': 'Forecasting', 'ImageClassification': 'ImageClassification', 'ImageClassificationMultilabel': 'ImageClassificationMultilabel', 'ImageInstanceSegmentation': 'ImageInstanceSegmentation', 'ImageObjectDetection': 'ImageObjectDetection', 'Regression': 'Regression', 'TextClassification': 'TextClassification', 'TextClassificationMultilabel': 'TextClassificationMultilabel', 'TextNER': 'TextNer'} + "task_type": { + "Classification": "Classification", + "Forecasting": "Forecasting", + "ImageClassification": "ImageClassification", + "ImageClassificationMultilabel": "ImageClassificationMultilabel", + "ImageInstanceSegmentation": "ImageInstanceSegmentation", + "ImageObjectDetection": "ImageObjectDetection", + "Regression": "Regression", + "TextClassification": "TextClassification", + "TextClassificationMultilabel": "TextClassificationMultilabel", + "TextNER": "TextNer", + } } def __init__( @@ -1948,23 +2023,22 @@ class NCrossValidations(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoNCrossValidations', 'Custom': 'CustomNCrossValidations'} + "mode": { + "Auto": "AutoNCrossValidations", + "Custom": "CustomNCrossValidations", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NCrossValidations, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -1980,21 +2054,17 @@ class AutoNCrossValidations(NCrossValidations): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoNCrossValidations, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class AutoPauseProperties(msrest.serialization.Model): @@ -2007,8 +2077,8 @@ class AutoPauseProperties(msrest.serialization.Model): """ _attribute_map = { - 'delay_in_minutes': {'key': 'delayInMinutes', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, + "delay_in_minutes": {"key": "delayInMinutes", "type": "int"}, + "enabled": {"key": "enabled", "type": "bool"}, } def __init__( @@ -2041,9 +2111,9 @@ class AutoScaleProperties(msrest.serialization.Model): """ _attribute_map = { - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, + "min_node_count": {"key": "minNodeCount", "type": "int"}, + "enabled": {"key": "enabled", "type": "bool"}, + "max_node_count": {"key": "maxNodeCount", "type": "int"}, } def __init__( @@ -2082,23 +2152,19 @@ class Seasonality(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoSeasonality', 'Custom': 'CustomSeasonality'} + "mode": {"Auto": "AutoSeasonality", "Custom": "CustomSeasonality"} } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Seasonality, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -2114,21 +2180,17 @@ class AutoSeasonality(Seasonality): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoSeasonality, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class TargetLags(msrest.serialization.Model): @@ -2145,23 +2207,19 @@ class TargetLags(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoTargetLags', 'Custom': 'CustomTargetLags'} + "mode": {"Auto": "AutoTargetLags", "Custom": "CustomTargetLags"} } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(TargetLags, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -2177,21 +2235,17 @@ class AutoTargetLags(TargetLags): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoTargetLags, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class TargetRollingWindowSize(msrest.serialization.Model): @@ -2208,23 +2262,22 @@ class TargetRollingWindowSize(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoTargetRollingWindowSize', 'Custom': 'CustomTargetRollingWindowSize'} + "mode": { + "Auto": "AutoTargetRollingWindowSize", + "Custom": "CustomTargetRollingWindowSize", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(TargetRollingWindowSize, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -2240,21 +2293,17 @@ class AutoTargetRollingWindowSize(TargetRollingWindowSize): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class DatastoreProperties(ResourceBase): @@ -2285,22 +2334,27 @@ class DatastoreProperties(ResourceBase): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, } _subtype_map = { - 'datastore_type': {'AzureBlob': 'AzureBlobDatastore', 'AzureDataLakeGen1': 'AzureDataLakeGen1Datastore', 'AzureDataLakeGen2': 'AzureDataLakeGen2Datastore', 'AzureFile': 'AzureFileDatastore'} + "datastore_type": { + "AzureBlob": "AzureBlobDatastore", + "AzureDataLakeGen1": "AzureDataLakeGen1Datastore", + "AzureDataLakeGen2": "AzureDataLakeGen2Datastore", + "AzureFile": "AzureFileDatastore", + } } def __init__( @@ -2322,9 +2376,11 @@ def __init__( :keyword credentials: Required. [Required] Account credentials. :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials """ - super(DatastoreProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + super(DatastoreProperties, self).__init__( + description=description, properties=properties, tags=tags, **kwargs + ) self.credentials = credentials - self.datastore_type = 'DatastoreProperties' # type: str + self.datastore_type = "DatastoreProperties" # type: str self.is_default = None @@ -2366,23 +2422,26 @@ class AzureBlobDatastore(DatastoreProperties): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "account_name": {"key": "accountName", "type": "str"}, + "container_name": {"key": "containerName", "type": "str"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } def __init__( @@ -2396,7 +2455,9 @@ def __init__( container_name: Optional[str] = None, endpoint: Optional[str] = None, protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, + service_data_access_auth_identity: Optional[ + Union[str, "ServiceDataAccessAuthIdentity"] + ] = None, **kwargs ): """ @@ -2422,13 +2483,21 @@ def __init__( :paramtype service_data_access_auth_identity: str or ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ - super(AzureBlobDatastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, **kwargs) - self.datastore_type = 'AzureBlob' # type: str + super(AzureBlobDatastore, self).__init__( + description=description, + properties=properties, + tags=tags, + credentials=credentials, + **kwargs + ) + self.datastore_type = "AzureBlob" # type: str self.account_name = account_name self.container_name = container_name self.endpoint = endpoint self.protocol = protocol - self.service_data_access_auth_identity = service_data_access_auth_identity + self.service_data_access_auth_identity = ( + service_data_access_auth_identity + ) class AzureDataLakeGen1Datastore(DatastoreProperties): @@ -2463,21 +2532,24 @@ class AzureDataLakeGen1Datastore(DatastoreProperties): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'store_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "store_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - 'store_name': {'key': 'storeName', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, + "store_name": {"key": "storeName", "type": "str"}, } def __init__( @@ -2488,7 +2560,9 @@ def __init__( description: Optional[str] = None, properties: Optional[Dict[str, str]] = None, tags: Optional[Dict[str, str]] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, + service_data_access_auth_identity: Optional[ + Union[str, "ServiceDataAccessAuthIdentity"] + ] = None, **kwargs ): """ @@ -2508,9 +2582,17 @@ def __init__( :keyword store_name: Required. [Required] Azure Data Lake store name. :paramtype store_name: str """ - super(AzureDataLakeGen1Datastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, **kwargs) - self.datastore_type = 'AzureDataLakeGen1' # type: str - self.service_data_access_auth_identity = service_data_access_auth_identity + super(AzureDataLakeGen1Datastore, self).__init__( + description=description, + properties=properties, + tags=tags, + credentials=credentials, + **kwargs + ) + self.datastore_type = "AzureDataLakeGen1" # type: str + self.service_data_access_auth_identity = ( + service_data_access_auth_identity + ) self.store_name = store_name @@ -2552,25 +2634,28 @@ class AzureDataLakeGen2Datastore(DatastoreProperties): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'filesystem': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "account_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "filesystem": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'filesystem': {'key': 'filesystem', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "account_name": {"key": "accountName", "type": "str"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "filesystem": {"key": "filesystem", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } def __init__( @@ -2584,7 +2669,9 @@ def __init__( tags: Optional[Dict[str, str]] = None, endpoint: Optional[str] = None, protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, + service_data_access_auth_identity: Optional[ + Union[str, "ServiceDataAccessAuthIdentity"] + ] = None, **kwargs ): """ @@ -2610,13 +2697,21 @@ def __init__( :paramtype service_data_access_auth_identity: str or ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ - super(AzureDataLakeGen2Datastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, **kwargs) - self.datastore_type = 'AzureDataLakeGen2' # type: str + super(AzureDataLakeGen2Datastore, self).__init__( + description=description, + properties=properties, + tags=tags, + credentials=credentials, + **kwargs + ) + self.datastore_type = "AzureDataLakeGen2" # type: str self.account_name = account_name self.endpoint = endpoint self.filesystem = filesystem self.protocol = protocol - self.service_data_access_auth_identity = service_data_access_auth_identity + self.service_data_access_auth_identity = ( + service_data_access_auth_identity + ) class AzureFileDatastore(DatastoreProperties): @@ -2658,25 +2753,28 @@ class AzureFileDatastore(DatastoreProperties): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'file_share_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "account_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "file_share_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'file_share_name': {'key': 'fileShareName', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "account_name": {"key": "accountName", "type": "str"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "file_share_name": {"key": "fileShareName", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } def __init__( @@ -2690,7 +2788,9 @@ def __init__( tags: Optional[Dict[str, str]] = None, endpoint: Optional[str] = None, protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, + service_data_access_auth_identity: Optional[ + Union[str, "ServiceDataAccessAuthIdentity"] + ] = None, **kwargs ): """ @@ -2717,13 +2817,21 @@ def __init__( :paramtype service_data_access_auth_identity: str or ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ - super(AzureFileDatastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, **kwargs) - self.datastore_type = 'AzureFile' # type: str + super(AzureFileDatastore, self).__init__( + description=description, + properties=properties, + tags=tags, + credentials=credentials, + **kwargs + ) + self.datastore_type = "AzureFile" # type: str self.account_name = account_name self.endpoint = endpoint self.file_share_name = file_share_name self.protocol = protocol - self.service_data_access_auth_identity = service_data_access_auth_identity + self.service_data_access_auth_identity = ( + service_data_access_auth_identity + ) class EarlyTerminationPolicy(msrest.serialization.Model): @@ -2745,17 +2853,21 @@ class EarlyTerminationPolicy(msrest.serialization.Model): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, } _subtype_map = { - 'policy_type': {'Bandit': 'BanditPolicy', 'MedianStopping': 'MedianStoppingPolicy', 'TruncationSelection': 'TruncationSelectionPolicy'} + "policy_type": { + "Bandit": "BanditPolicy", + "MedianStopping": "MedianStoppingPolicy", + "TruncationSelection": "TruncationSelectionPolicy", + } } def __init__( @@ -2797,15 +2909,15 @@ class BanditPolicy(EarlyTerminationPolicy): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'slack_amount': {'key': 'slackAmount', 'type': 'float'}, - 'slack_factor': {'key': 'slackFactor', 'type': 'float'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, + "slack_amount": {"key": "slackAmount", "type": "float"}, + "slack_factor": {"key": "slackFactor", "type": "float"}, } def __init__( @@ -2827,8 +2939,12 @@ def __init__( :keyword slack_factor: Ratio of the allowed distance from the best performing run. :paramtype slack_factor: float """ - super(BanditPolicy, self).__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs) - self.policy_type = 'Bandit' # type: str + super(BanditPolicy, self).__init__( + delay_evaluation=delay_evaluation, + evaluation_interval=evaluation_interval, + **kwargs + ) + self.policy_type = "Bandit" # type: str self.slack_amount = slack_amount self.slack_factor = slack_factor @@ -2852,25 +2968,21 @@ class Resource(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -2903,28 +3015,24 @@ class TrackedResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, } def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - **kwargs + self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs ): """ :keyword tags: A set of tags. Resource tags. @@ -2971,25 +3079,28 @@ class BatchDeployment(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchDeploymentProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": { + "key": "properties", + "type": "BatchDeploymentProperties", + }, + "sku": {"key": "sku", "type": "Sku"}, } def __init__( @@ -3018,7 +3129,9 @@ def __init__( :keyword sku: Sku details required for ARM contract for Autoscaling. :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ - super(BatchDeployment, self).__init__(tags=tags, location=location, **kwargs) + super(BatchDeployment, self).__init__( + tags=tags, location=location, **kwargs + ) self.identity = identity self.kind = kind self.properties = properties @@ -3042,11 +3155,17 @@ class EndpointDeploymentPropertiesBase(msrest.serialization.Model): """ _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, } def __init__( @@ -3134,26 +3253,41 @@ class BatchDeploymentProperties(EndpointDeploymentPropertiesBase): """ _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'error_threshold': {'key': 'errorThreshold', 'type': 'int'}, - 'logging_level': {'key': 'loggingLevel', 'type': 'str'}, - 'max_concurrency_per_instance': {'key': 'maxConcurrencyPerInstance', 'type': 'int'}, - 'mini_batch_size': {'key': 'miniBatchSize', 'type': 'long'}, - 'model': {'key': 'model', 'type': 'AssetReferenceBase'}, - 'output_action': {'key': 'outputAction', 'type': 'str'}, - 'output_file_name': {'key': 'outputFileName', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'resources': {'key': 'resources', 'type': 'DeploymentResourceConfiguration'}, - 'retry_settings': {'key': 'retrySettings', 'type': 'BatchRetrySettings'}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "compute": {"key": "compute", "type": "str"}, + "error_threshold": {"key": "errorThreshold", "type": "int"}, + "logging_level": {"key": "loggingLevel", "type": "str"}, + "max_concurrency_per_instance": { + "key": "maxConcurrencyPerInstance", + "type": "int", + }, + "mini_batch_size": {"key": "miniBatchSize", "type": "long"}, + "model": {"key": "model", "type": "AssetReferenceBase"}, + "output_action": {"key": "outputAction", "type": "str"}, + "output_file_name": {"key": "outputFileName", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "resources": { + "key": "resources", + "type": "DeploymentResourceConfiguration", + }, + "retry_settings": { + "key": "retrySettings", + "type": "BatchRetrySettings", + }, } def __init__( @@ -3221,7 +3355,14 @@ def __init__( If not provided, will default to the defaults defined in BatchRetrySettings. :paramtype retry_settings: ~azure.mgmt.machinelearningservices.models.BatchRetrySettings """ - super(BatchDeploymentProperties, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, **kwargs) + super(BatchDeploymentProperties, self).__init__( + code_configuration=code_configuration, + description=description, + environment_id=environment_id, + environment_variables=environment_variables, + properties=properties, + **kwargs + ) self.compute = compute self.error_threshold = error_threshold self.logging_level = logging_level @@ -3235,7 +3376,9 @@ def __init__( self.retry_settings = retry_settings -class BatchDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class BatchDeploymentTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of BatchDeployment entities. :ivar next_link: The link to the next page of BatchDeployment objects. If null, there are no @@ -3246,8 +3389,8 @@ class BatchDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Mode """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchDeployment]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[BatchDeployment]"}, } def __init__( @@ -3264,7 +3407,9 @@ def __init__( :keyword value: An array of objects of type BatchDeployment. :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchDeployment] """ - super(BatchDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) + super(BatchDeploymentTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -3303,25 +3448,25 @@ class BatchEndpoint(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": {"key": "properties", "type": "BatchEndpointProperties"}, + "sku": {"key": "sku", "type": "Sku"}, } def __init__( @@ -3350,7 +3495,9 @@ def __init__( :keyword sku: Sku details required for ARM contract for Autoscaling. :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ - super(BatchEndpoint, self).__init__(tags=tags, location=location, **kwargs) + super(BatchEndpoint, self).__init__( + tags=tags, location=location, **kwargs + ) self.identity = identity self.kind = kind self.properties = properties @@ -3366,15 +3513,10 @@ class BatchEndpointDefaults(msrest.serialization.Model): """ _attribute_map = { - 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, + "deployment_name": {"key": "deploymentName", "type": "str"}, } - def __init__( - self, - *, - deployment_name: Optional[str] = None, - **kwargs - ): + def __init__(self, *, deployment_name: Optional[str] = None, **kwargs): """ :keyword deployment_name: Name of the deployment that will be default for the endpoint. This deployment will end up getting 100% traffic when the endpoint scoring URL is invoked. @@ -3410,18 +3552,18 @@ class EndpointPropertiesBase(msrest.serialization.Model): """ _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, + "auth_mode": {"required": True}, + "scoring_uri": {"readonly": True}, + "swagger_uri": {"readonly": True}, } _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, + "auth_mode": {"key": "authMode", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "keys": {"key": "keys", "type": "EndpointAuthKeys"}, + "properties": {"key": "properties", "type": "{str}"}, + "scoring_uri": {"key": "scoringUri", "type": "str"}, + "swagger_uri": {"key": "swaggerUri", "type": "str"}, } def __init__( @@ -3488,21 +3630,21 @@ class BatchEndpointProperties(EndpointPropertiesBase): """ _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "auth_mode": {"required": True}, + "scoring_uri": {"readonly": True}, + "swagger_uri": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'defaults': {'key': 'defaults', 'type': 'BatchEndpointDefaults'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "auth_mode": {"key": "authMode", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "keys": {"key": "keys", "type": "EndpointAuthKeys"}, + "properties": {"key": "properties", "type": "{str}"}, + "scoring_uri": {"key": "scoringUri", "type": "str"}, + "swagger_uri": {"key": "swaggerUri", "type": "str"}, + "defaults": {"key": "defaults", "type": "BatchEndpointDefaults"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } def __init__( @@ -3531,12 +3673,20 @@ def __init__( :keyword defaults: Default values for Batch Endpoint. :paramtype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults """ - super(BatchEndpointProperties, self).__init__(auth_mode=auth_mode, description=description, keys=keys, properties=properties, **kwargs) + super(BatchEndpointProperties, self).__init__( + auth_mode=auth_mode, + description=description, + keys=keys, + properties=properties, + **kwargs + ) self.defaults = defaults self.provisioning_state = None -class BatchEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class BatchEndpointTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of BatchEndpoint entities. :ivar next_link: The link to the next page of BatchEndpoint objects. If null, there are no @@ -3547,8 +3697,8 @@ class BatchEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model) """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchEndpoint]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[BatchEndpoint]"}, } def __init__( @@ -3565,7 +3715,9 @@ def __init__( :keyword value: An array of objects of type BatchEndpoint. :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchEndpoint] """ - super(BatchEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) + super(BatchEndpointTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -3580,8 +3732,8 @@ class BatchRetrySettings(msrest.serialization.Model): """ _attribute_map = { - 'max_retries': {'key': 'maxRetries', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "max_retries": {"key": "maxRetries", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } def __init__( @@ -3604,38 +3756,41 @@ def __init__( class SamplingAlgorithm(msrest.serialization.Model): """The Sampling Algorithm used to generate hyperparameter values, along with properties to -configure the algorithm. + configure the algorithm. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BayesianSamplingAlgorithm, GridSamplingAlgorithm, RandomSamplingAlgorithm. + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: BayesianSamplingAlgorithm, GridSamplingAlgorithm, RandomSamplingAlgorithm. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType + :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating + hyperparameter values, along with configuration properties.Constant filled by server. Possible + values include: "Grid", "Random", "Bayesian". + :vartype sampling_algorithm_type: str or + ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } _subtype_map = { - 'sampling_algorithm_type': {'Bayesian': 'BayesianSamplingAlgorithm', 'Grid': 'GridSamplingAlgorithm', 'Random': 'RandomSamplingAlgorithm'} + "sampling_algorithm_type": { + "Bayesian": "BayesianSamplingAlgorithm", + "Grid": "GridSamplingAlgorithm", + "Random": "RandomSamplingAlgorithm", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(SamplingAlgorithm, self).__init__(**kwargs) self.sampling_algorithm_type = None # type: Optional[str] @@ -3653,21 +3808,20 @@ class BayesianSamplingAlgorithm(SamplingAlgorithm): """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(BayesianSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Bayesian' # type: str + self.sampling_algorithm_type = "Bayesian" # type: str class BuildContext(msrest.serialization.Model): @@ -3677,29 +3831,29 @@ class BuildContext(msrest.serialization.Model): :ivar context_uri: Required. [Required] URI of the Docker build context used to build the image. Supports blob URIs on environment creation and may return blob or Git URIs. - - + + .. raw:: html - + . :vartype context_uri: str :ivar dockerfile_path: Path to the Dockerfile in the build context. - - + + .. raw:: html - + . :vartype dockerfile_path: str """ _validation = { - 'context_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "context_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'context_uri': {'key': 'contextUri', 'type': 'str'}, - 'dockerfile_path': {'key': 'dockerfilePath', 'type': 'str'}, + "context_uri": {"key": "contextUri", "type": "str"}, + "dockerfile_path": {"key": "dockerfilePath", "type": "str"}, } def __init__( @@ -3712,18 +3866,18 @@ def __init__( """ :keyword context_uri: Required. [Required] URI of the Docker build context used to build the image. Supports blob URIs on environment creation and may return blob or Git URIs. - - + + .. raw:: html - + . :paramtype context_uri: str :keyword dockerfile_path: Path to the Dockerfile in the build context. - - + + .. raw:: html - + . :paramtype dockerfile_path: str """ @@ -3756,21 +3910,21 @@ class CertificateDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, - 'thumbprint': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials_type": {"required": True}, + "client_id": {"required": True}, + "secrets": {"required": True}, + "tenant_id": {"required": True}, + "thumbprint": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'CertificateDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "authority_url": {"key": "authorityUrl", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + "resource_url": {"key": "resourceUrl", "type": "str"}, + "secrets": {"key": "secrets", "type": "CertificateDatastoreSecrets"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "thumbprint": {"key": "thumbprint", "type": "str"}, } def __init__( @@ -3801,7 +3955,7 @@ def __init__( :paramtype thumbprint: str """ super(CertificateDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Certificate' # type: str + self.credentials_type = "Certificate" # type: str self.authority_url = authority_url self.client_id = client_id self.resource_url = resource_url @@ -3824,26 +3978,21 @@ class CertificateDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'certificate': {'key': 'certificate', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "certificate": {"key": "certificate", "type": "str"}, } - def __init__( - self, - *, - certificate: Optional[str] = None, - **kwargs - ): + def __init__(self, *, certificate: Optional[str] = None, **kwargs): """ :keyword certificate: Service principal certificate. :paramtype certificate: str """ super(CertificateDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Certificate' # type: str + self.secrets_type = "Certificate" # type: str self.certificate = certificate @@ -3880,22 +4029,39 @@ class TableVertical(msrest.serialization.Model): """ _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "test_data": {"key": "testData", "type": "MLTableJobInput"}, + "test_data_size": {"key": "testDataSize", "type": "float"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "weight_column_name": {"key": "weightColumnName", "type": "str"}, } def __init__( self, *, cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "TableVerticalFeaturizationSettings" + ] = None, limit_settings: Optional["TableVerticalLimitSettings"] = None, n_cross_validations: Optional["NCrossValidations"] = None, test_data: Optional["MLTableJobInput"] = None, @@ -4005,27 +4171,45 @@ class Classification(AutoMLVertical, TableVertical): """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'positive_label': {'key': 'positiveLabel', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'ClassificationTrainingSettings'}, + "task_type": {"required": True}, + "training_data": {"required": True}, + } + + _attribute_map = { + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "test_data": {"key": "testData", "type": "MLTableJobInput"}, + "test_data_size": {"key": "testDataSize", "type": "float"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "weight_column_name": {"key": "weightColumnName", "type": "str"}, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "positive_label": {"key": "positiveLabel", "type": "str"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, + "training_settings": { + "key": "trainingSettings", + "type": "ClassificationTrainingSettings", + }, } def __init__( @@ -4033,7 +4217,9 @@ def __init__( *, training_data: "MLTableJobInput", cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "TableVerticalFeaturizationSettings" + ] = None, limit_settings: Optional["TableVerticalLimitSettings"] = None, n_cross_validations: Optional["NCrossValidations"] = None, test_data: Optional["MLTableJobInput"] = None, @@ -4044,7 +4230,9 @@ def __init__( log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, positive_label: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "ClassificationPrimaryMetrics"] + ] = None, training_settings: Optional["ClassificationTrainingSettings"] = None, **kwargs ): @@ -4096,7 +4284,21 @@ def __init__( :paramtype training_settings: ~azure.mgmt.machinelearningservices.models.ClassificationTrainingSettings """ - super(Classification, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, cv_split_column_names=cv_split_column_names, featurization_settings=featurization_settings, limit_settings=limit_settings, n_cross_validations=n_cross_validations, test_data=test_data, test_data_size=test_data_size, validation_data=validation_data, validation_data_size=validation_data_size, weight_column_name=weight_column_name, **kwargs) + super(Classification, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + cv_split_column_names=cv_split_column_names, + featurization_settings=featurization_settings, + limit_settings=limit_settings, + n_cross_validations=n_cross_validations, + test_data=test_data, + test_data_size=test_data_size, + validation_data=validation_data, + validation_data_size=validation_data_size, + weight_column_name=weight_column_name, + **kwargs + ) self.cv_split_column_names = cv_split_column_names self.featurization_settings = featurization_settings self.limit_settings = limit_settings @@ -4106,7 +4308,7 @@ def __init__( self.validation_data = validation_data self.validation_data_size = validation_data_size self.weight_column_name = weight_column_name - self.task_type = 'Classification' # type: str + self.task_type = "Classification" # type: str self.positive_label = positive_label self.primary_metric = primary_metric self.training_settings = training_settings @@ -4138,13 +4340,28 @@ class TrainingSettings(msrest.serialization.Model): """ _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, + "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, + "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, } def __init__( @@ -4217,15 +4434,36 @@ class ClassificationTrainingSettings(TrainingSettings): """ _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, + "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, + "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, + "allowed_training_algorithms": { + "key": "allowedTrainingAlgorithms", + "type": "[str]", + }, + "blocked_training_algorithms": { + "key": "blockedTrainingAlgorithms", + "type": "[str]", + }, } def __init__( @@ -4238,8 +4476,12 @@ def __init__( enable_vote_ensemble: Optional[bool] = True, ensemble_model_download_timeout: Optional[datetime.timedelta] = "PT5M", stack_ensemble_settings: Optional["StackEnsembleSettings"] = None, - allowed_training_algorithms: Optional[List[Union[str, "ClassificationModels"]]] = None, - blocked_training_algorithms: Optional[List[Union[str, "ClassificationModels"]]] = None, + allowed_training_algorithms: Optional[ + List[Union[str, "ClassificationModels"]] + ] = None, + blocked_training_algorithms: Optional[ + List[Union[str, "ClassificationModels"]] + ] = None, **kwargs ): """ @@ -4267,7 +4509,16 @@ def __init__( :paramtype blocked_training_algorithms: list[str or ~azure.mgmt.machinelearningservices.models.ClassificationModels] """ - super(ClassificationTrainingSettings, self).__init__(enable_dnn_training=enable_dnn_training, enable_model_explainability=enable_model_explainability, enable_onnx_compatible_models=enable_onnx_compatible_models, enable_stack_ensemble=enable_stack_ensemble, enable_vote_ensemble=enable_vote_ensemble, ensemble_model_download_timeout=ensemble_model_download_timeout, stack_ensemble_settings=stack_ensemble_settings, **kwargs) + super(ClassificationTrainingSettings, self).__init__( + enable_dnn_training=enable_dnn_training, + enable_model_explainability=enable_model_explainability, + enable_onnx_compatible_models=enable_onnx_compatible_models, + enable_stack_ensemble=enable_stack_ensemble, + enable_vote_ensemble=enable_vote_ensemble, + ensemble_model_download_timeout=ensemble_model_download_timeout, + stack_ensemble_settings=stack_ensemble_settings, + **kwargs + ) self.allowed_training_algorithms = allowed_training_algorithms self.blocked_training_algorithms = blocked_training_algorithms @@ -4280,7 +4531,10 @@ class ClusterUpdateParameters(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties.properties', 'type': 'ScaleSettingsInformation'}, + "properties": { + "key": "properties.properties", + "type": "ScaleSettingsInformation", + }, } def __init__( @@ -4309,20 +4563,20 @@ class CodeConfiguration(msrest.serialization.Model): """ _validation = { - 'scoring_script': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "scoring_script": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'scoring_script': {'key': 'scoringScript', 'type': 'str'}, + "code_id": {"key": "codeId", "type": "str"}, + "scoring_script": {"key": "scoringScript", "type": "str"}, } def __init__( - self, - *, - scoring_script: str, - code_id: Optional[str] = None, - **kwargs + self, *, scoring_script: str, code_id: Optional[str] = None, **kwargs ): """ :keyword code_id: ARM resource ID of the code asset. @@ -4358,27 +4612,22 @@ class CodeContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "CodeContainerProperties"}, } - def __init__( - self, - *, - properties: "CodeContainerProperties", - **kwargs - ): + def __init__(self, *, properties: "CodeContainerProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeContainerProperties @@ -4407,17 +4656,17 @@ class CodeContainerProperties(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, } def __init__( @@ -4439,7 +4688,13 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(CodeContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) + super(CodeContainerProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs + ) class CodeContainerResourceArmPaginatedResult(msrest.serialization.Model): @@ -4453,8 +4708,8 @@ class CodeContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[CodeContainer]"}, } def __init__( @@ -4499,27 +4754,22 @@ class CodeVersion(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeVersionProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "CodeVersionProperties"}, } - def __init__( - self, - *, - properties: "CodeVersionProperties", - **kwargs - ): + def __init__(self, *, properties: "CodeVersionProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeVersionProperties @@ -4546,12 +4796,12 @@ class CodeVersionProperties(AssetBase): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'code_uri': {'key': 'codeUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "code_uri": {"key": "codeUri", "type": "str"}, } def __init__( @@ -4579,7 +4829,14 @@ def __init__( :keyword code_uri: Uri where code is located. :paramtype code_uri: str """ - super(CodeVersionProperties, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) + super(CodeVersionProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + **kwargs + ) self.code_uri = code_uri @@ -4594,8 +4851,8 @@ class CodeVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeVersion]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[CodeVersion]"}, } def __init__( @@ -4628,8 +4885,8 @@ class ColumnTransformer(msrest.serialization.Model): """ _attribute_map = { - 'fields': {'key': 'fields', 'type': '[str]'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, + "fields": {"key": "fields", "type": "[str]"}, + "parameters": {"key": "parameters", "type": "object"}, } def __init__( @@ -4715,36 +4972,46 @@ class CommandJob(JobBaseProperties): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'parameters': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'CommandJobLimits'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, + "job_type": {"required": True}, + "status": {"readonly": True}, + "command": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "environment_id": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "parameters": {"readonly": True}, + } + + _attribute_map = { + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "code_id": {"key": "codeId", "type": "str"}, + "command": {"key": "command", "type": "str"}, + "distribution": { + "key": "distribution", + "type": "DistributionConfiguration", + }, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "limits": {"key": "limits", "type": "CommandJobLimits"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "parameters": {"key": "parameters", "type": "object"}, + "resources": {"key": "resources", "type": "JobResourceConfiguration"}, } def __init__( @@ -4818,8 +5085,20 @@ def __init__( :keyword resources: Compute Resource configuration for the job. :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration """ - super(CommandJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, services=services, **kwargs) - self.job_type = 'Command' # type: str + super(CommandJob, self).__init__( + description=description, + properties=properties, + tags=tags, + component_id=component_id, + compute_id=compute_id, + display_name=display_name, + experiment_name=experiment_name, + identity=identity, + is_archived=is_archived, + services=services, + **kwargs + ) + self.job_type = "Command" # type: str self.code_id = code_id self.command = command self.distribution = distribution @@ -4849,23 +5128,23 @@ class JobLimits(msrest.serialization.Model): """ _validation = { - 'job_limits_type': {'required': True}, + "job_limits_type": {"required": True}, } _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "job_limits_type": {"key": "jobLimitsType", "type": "str"}, + "timeout": {"key": "timeout", "type": "duration"}, } _subtype_map = { - 'job_limits_type': {'Command': 'CommandJobLimits', 'Sweep': 'SweepJobLimits'} + "job_limits_type": { + "Command": "CommandJobLimits", + "Sweep": "SweepJobLimits", + } } def __init__( - self, - *, - timeout: Optional[datetime.timedelta] = None, - **kwargs + self, *, timeout: Optional[datetime.timedelta] = None, **kwargs ): """ :keyword timeout: The max run duration in ISO 8601 format, after which the job will be @@ -4891,19 +5170,16 @@ class CommandJobLimits(JobLimits): """ _validation = { - 'job_limits_type': {'required': True}, + "job_limits_type": {"required": True}, } _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "job_limits_type": {"key": "jobLimitsType", "type": "str"}, + "timeout": {"key": "timeout", "type": "duration"}, } def __init__( - self, - *, - timeout: Optional[datetime.timedelta] = None, - **kwargs + self, *, timeout: Optional[datetime.timedelta] = None, **kwargs ): """ :keyword timeout: The max run duration in ISO 8601 format, after which the job will be @@ -4911,7 +5187,7 @@ def __init__( :paramtype timeout: ~datetime.timedelta """ super(CommandJobLimits, self).__init__(timeout=timeout, **kwargs) - self.job_limits_type = 'Command' # type: str + self.job_limits_type = "Command" # type: str class ComponentContainer(Resource): @@ -4937,26 +5213,26 @@ class ComponentContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "ComponentContainerProperties", + }, } def __init__( - self, - *, - properties: "ComponentContainerProperties", - **kwargs + self, *, properties: "ComponentContainerProperties", **kwargs ): """ :keyword properties: Required. [Required] Additional attributes of the entity. @@ -4970,38 +5246,38 @@ class ComponentContainerProperties(AssetContainer): """Component container definition. -.. raw:: html + .. raw:: html - . + . - Variables are only populated by the server, and will be ignored when sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str + :ivar description: The asset description text. + :vartype description: str + :ivar properties: The asset property dictionary. + :vartype properties: dict[str, str] + :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + :ivar is_archived: Is the asset archived?. + :vartype is_archived: bool + :ivar latest_version: The latest version inside this container. + :vartype latest_version: str + :ivar next_version: The next auto incremental version. + :vartype next_version: str """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, } def __init__( @@ -5023,7 +5299,13 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(ComponentContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) + super(ComponentContainerProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs + ) class ComponentContainerResourceArmPaginatedResult(msrest.serialization.Model): @@ -5037,8 +5319,8 @@ class ComponentContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ComponentContainer]"}, } def __init__( @@ -5055,7 +5337,9 @@ def __init__( :keyword value: An array of objects of type ComponentContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainer] """ - super(ComponentContainerResourceArmPaginatedResult, self).__init__(**kwargs) + super(ComponentContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -5083,27 +5367,25 @@ class ComponentVersion(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentVersionProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "ComponentVersionProperties", + }, } - def __init__( - self, - *, - properties: "ComponentVersionProperties", - **kwargs - ): + def __init__(self, *, properties: "ComponentVersionProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentVersionProperties @@ -5126,10 +5408,10 @@ class ComponentVersionProperties(AssetBase): :ivar is_archived: Is the asset archived?. :vartype is_archived: bool :ivar component_spec: Defines Component definition details. - - + + .. raw:: html - + . @@ -5137,12 +5419,12 @@ class ComponentVersionProperties(AssetBase): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'component_spec': {'key': 'componentSpec', 'type': 'object'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "component_spec": {"key": "componentSpec", "type": "object"}, } def __init__( @@ -5168,16 +5450,23 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool :keyword component_spec: Defines Component definition details. - - + + .. raw:: html - + . :paramtype component_spec: any """ - super(ComponentVersionProperties, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) + super(ComponentVersionProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + **kwargs + ) self.component_spec = component_spec @@ -5192,8 +5481,8 @@ class ComponentVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentVersion]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ComponentVersion]"}, } def __init__( @@ -5210,7 +5499,9 @@ def __init__( :keyword value: An array of objects of type ComponentVersion. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersion] """ - super(ComponentVersionResourceArmPaginatedResult, self).__init__(**kwargs) + super(ComponentVersionResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -5223,7 +5514,10 @@ class ComputeInstanceSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, + "properties": { + "key": "properties", + "type": "ComputeInstanceProperties", + }, } def __init__( @@ -5279,28 +5573,34 @@ class ComputeInstance(Compute, ComputeInstanceSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + "disable_local_auth": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": { + "key": "properties", + "type": "ComputeInstanceProperties", + }, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -5319,9 +5619,14 @@ def __init__( :keyword resource_id: ARM resource id of the underlying compute. :paramtype resource_id: str """ - super(ComputeInstance, self).__init__(description=description, resource_id=resource_id, properties=properties, **kwargs) + super(ComputeInstance, self).__init__( + description=description, + resource_id=resource_id, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'ComputeInstance' # type: str + self.compute_type = "ComputeInstance" # type: str self.compute_location = None self.provisioning_state = None self.description = description @@ -5343,8 +5648,8 @@ class ComputeInstanceApplication(msrest.serialization.Model): """ _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, + "display_name": {"key": "displayName", "type": "str"}, + "endpoint_uri": {"key": "endpointUri", "type": "str"}, } def __init__( @@ -5378,21 +5683,17 @@ class ComputeInstanceConnectivityEndpoints(msrest.serialization.Model): """ _validation = { - 'public_ip_address': {'readonly': True}, - 'private_ip_address': {'readonly': True}, + "public_ip_address": {"readonly": True}, + "private_ip_address": {"readonly": True}, } _attribute_map = { - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + "public_ip_address": {"key": "publicIpAddress", "type": "str"}, + "private_ip_address": {"key": "privateIpAddress", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ComputeInstanceConnectivityEndpoints, self).__init__(**kwargs) self.public_ip_address = None self.private_ip_address = None @@ -5418,16 +5719,19 @@ class ComputeInstanceContainer(msrest.serialization.Model): """ _validation = { - 'services': {'readonly': True}, + "services": {"readonly": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'autosave': {'key': 'autosave', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'network': {'key': 'network', 'type': 'str'}, - 'environment': {'key': 'environment', 'type': 'ComputeInstanceEnvironmentInfo'}, - 'services': {'key': 'services', 'type': '[object]'}, + "name": {"key": "name", "type": "str"}, + "autosave": {"key": "autosave", "type": "str"}, + "gpu": {"key": "gpu", "type": "str"}, + "network": {"key": "network", "type": "str"}, + "environment": { + "key": "environment", + "type": "ComputeInstanceEnvironmentInfo", + }, + "services": {"key": "services", "type": "[object]"}, } def __init__( @@ -5476,23 +5780,19 @@ class ComputeInstanceCreatedBy(msrest.serialization.Model): """ _validation = { - 'user_name': {'readonly': True}, - 'user_org_id': {'readonly': True}, - 'user_id': {'readonly': True}, + "user_name": {"readonly": True}, + "user_org_id": {"readonly": True}, + "user_id": {"readonly": True}, } _attribute_map = { - 'user_name': {'key': 'userName', 'type': 'str'}, - 'user_org_id': {'key': 'userOrgId', 'type': 'str'}, - 'user_id': {'key': 'userId', 'type': 'str'}, + "user_name": {"key": "userName", "type": "str"}, + "user_org_id": {"key": "userOrgId", "type": "str"}, + "user_id": {"key": "userId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ComputeInstanceCreatedBy, self).__init__(**kwargs) self.user_name = None self.user_org_id = None @@ -5517,10 +5817,10 @@ class ComputeInstanceDataDisk(msrest.serialization.Model): """ _attribute_map = { - 'caching': {'key': 'caching', 'type': 'str'}, - 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, - 'lun': {'key': 'lun', 'type': 'int'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + "caching": {"key": "caching", "type": "str"}, + "disk_size_gb": {"key": "diskSizeGB", "type": "int"}, + "lun": {"key": "lun", "type": "int"}, + "storage_account_type": {"key": "storageAccountType", "type": "str"}, } def __init__( @@ -5529,7 +5829,9 @@ def __init__( caching: Optional[Union[str, "Caching"]] = None, disk_size_gb: Optional[int] = None, lun: Optional[int] = None, - storage_account_type: Optional[Union[str, "StorageAccountType"]] = "Standard_LRS", + storage_account_type: Optional[ + Union[str, "StorageAccountType"] + ] = "Standard_LRS", **kwargs ): """ @@ -5578,15 +5880,15 @@ class ComputeInstanceDataMount(msrest.serialization.Model): """ _attribute_map = { - 'source': {'key': 'source', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'mount_name': {'key': 'mountName', 'type': 'str'}, - 'mount_action': {'key': 'mountAction', 'type': 'str'}, - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - 'mount_state': {'key': 'mountState', 'type': 'str'}, - 'mounted_on': {'key': 'mountedOn', 'type': 'iso-8601'}, - 'error': {'key': 'error', 'type': 'str'}, + "source": {"key": "source", "type": "str"}, + "source_type": {"key": "sourceType", "type": "str"}, + "mount_name": {"key": "mountName", "type": "str"}, + "mount_action": {"key": "mountAction", "type": "str"}, + "created_by": {"key": "createdBy", "type": "str"}, + "mount_path": {"key": "mountPath", "type": "str"}, + "mount_state": {"key": "mountState", "type": "str"}, + "mounted_on": {"key": "mountedOn", "type": "iso-8601"}, + "error": {"key": "error", "type": "str"}, } def __init__( @@ -5646,8 +5948,8 @@ class ComputeInstanceEnvironmentInfo(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "version": {"key": "version", "type": "str"}, } def __init__( @@ -5685,10 +5987,10 @@ class ComputeInstanceLastOperation(msrest.serialization.Model): """ _attribute_map = { - 'operation_name': {'key': 'operationName', 'type': 'str'}, - 'operation_time': {'key': 'operationTime', 'type': 'iso-8601'}, - 'operation_status': {'key': 'operationStatus', 'type': 'str'}, - 'operation_trigger': {'key': 'operationTrigger', 'type': 'str'}, + "operation_name": {"key": "operationName", "type": "str"}, + "operation_time": {"key": "operationTime", "type": "iso-8601"}, + "operation_status": {"key": "operationStatus", "type": "str"}, + "operation_trigger": {"key": "operationTrigger", "type": "str"}, } def __init__( @@ -5786,39 +6088,69 @@ class ComputeInstanceProperties(msrest.serialization.Model): """ _validation = { - 'connectivity_endpoints': {'readonly': True}, - 'applications': {'readonly': True}, - 'created_by': {'readonly': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'last_operation': {'readonly': True}, - 'schedules': {'readonly': True}, - 'containers': {'readonly': True}, - 'data_disks': {'readonly': True}, - 'data_mounts': {'readonly': True}, - 'versions': {'readonly': True}, - } - - _attribute_map = { - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'application_sharing_policy': {'key': 'applicationSharingPolicy', 'type': 'str'}, - 'ssh_settings': {'key': 'sshSettings', 'type': 'ComputeInstanceSshSettings'}, - 'connectivity_endpoints': {'key': 'connectivityEndpoints', 'type': 'ComputeInstanceConnectivityEndpoints'}, - 'applications': {'key': 'applications', 'type': '[ComputeInstanceApplication]'}, - 'created_by': {'key': 'createdBy', 'type': 'ComputeInstanceCreatedBy'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'compute_instance_authorization_type': {'key': 'computeInstanceAuthorizationType', 'type': 'str'}, - 'personal_compute_instance_settings': {'key': 'personalComputeInstanceSettings', 'type': 'PersonalComputeInstanceSettings'}, - 'setup_scripts': {'key': 'setupScripts', 'type': 'SetupScripts'}, - 'last_operation': {'key': 'lastOperation', 'type': 'ComputeInstanceLastOperation'}, - 'schedules': {'key': 'schedules', 'type': 'ComputeSchedules'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'containers': {'key': 'containers', 'type': '[ComputeInstanceContainer]'}, - 'data_disks': {'key': 'dataDisks', 'type': '[ComputeInstanceDataDisk]'}, - 'data_mounts': {'key': 'dataMounts', 'type': '[ComputeInstanceDataMount]'}, - 'versions': {'key': 'versions', 'type': 'ComputeInstanceVersion'}, + "connectivity_endpoints": {"readonly": True}, + "applications": {"readonly": True}, + "created_by": {"readonly": True}, + "errors": {"readonly": True}, + "state": {"readonly": True}, + "last_operation": {"readonly": True}, + "schedules": {"readonly": True}, + "containers": {"readonly": True}, + "data_disks": {"readonly": True}, + "data_mounts": {"readonly": True}, + "versions": {"readonly": True}, + } + + _attribute_map = { + "vm_size": {"key": "vmSize", "type": "str"}, + "subnet": {"key": "subnet", "type": "ResourceId"}, + "application_sharing_policy": { + "key": "applicationSharingPolicy", + "type": "str", + }, + "ssh_settings": { + "key": "sshSettings", + "type": "ComputeInstanceSshSettings", + }, + "connectivity_endpoints": { + "key": "connectivityEndpoints", + "type": "ComputeInstanceConnectivityEndpoints", + }, + "applications": { + "key": "applications", + "type": "[ComputeInstanceApplication]", + }, + "created_by": {"key": "createdBy", "type": "ComputeInstanceCreatedBy"}, + "errors": {"key": "errors", "type": "[ErrorResponse]"}, + "state": {"key": "state", "type": "str"}, + "compute_instance_authorization_type": { + "key": "computeInstanceAuthorizationType", + "type": "str", + }, + "personal_compute_instance_settings": { + "key": "personalComputeInstanceSettings", + "type": "PersonalComputeInstanceSettings", + }, + "setup_scripts": {"key": "setupScripts", "type": "SetupScripts"}, + "last_operation": { + "key": "lastOperation", + "type": "ComputeInstanceLastOperation", + }, + "schedules": {"key": "schedules", "type": "ComputeSchedules"}, + "enable_node_public_ip": {"key": "enableNodePublicIp", "type": "bool"}, + "containers": { + "key": "containers", + "type": "[ComputeInstanceContainer]", + }, + "data_disks": { + "key": "dataDisks", + "type": "[ComputeInstanceDataDisk]", + }, + "data_mounts": { + "key": "dataMounts", + "type": "[ComputeInstanceDataMount]", + }, + "versions": {"key": "versions", "type": "ComputeInstanceVersion"}, } def __init__( @@ -5826,10 +6158,16 @@ def __init__( *, vm_size: Optional[str] = None, subnet: Optional["ResourceId"] = None, - application_sharing_policy: Optional[Union[str, "ApplicationSharingPolicy"]] = "Shared", + application_sharing_policy: Optional[ + Union[str, "ApplicationSharingPolicy"] + ] = "Shared", ssh_settings: Optional["ComputeInstanceSshSettings"] = None, - compute_instance_authorization_type: Optional[Union[str, "ComputeInstanceAuthorizationType"]] = "personal", - personal_compute_instance_settings: Optional["PersonalComputeInstanceSettings"] = None, + compute_instance_authorization_type: Optional[ + Union[str, "ComputeInstanceAuthorizationType"] + ] = "personal", + personal_compute_instance_settings: Optional[ + "PersonalComputeInstanceSettings" + ] = None, setup_scripts: Optional["SetupScripts"] = None, enable_node_public_ip: Optional[bool] = None, **kwargs @@ -5874,8 +6212,12 @@ def __init__( self.created_by = None self.errors = None self.state = None - self.compute_instance_authorization_type = compute_instance_authorization_type - self.personal_compute_instance_settings = personal_compute_instance_settings + self.compute_instance_authorization_type = ( + compute_instance_authorization_type + ) + self.personal_compute_instance_settings = ( + personal_compute_instance_settings + ) self.setup_scripts = setup_scripts self.last_operation = None self.schedules = None @@ -5906,21 +6248,23 @@ class ComputeInstanceSshSettings(msrest.serialization.Model): """ _validation = { - 'admin_user_name': {'readonly': True}, - 'ssh_port': {'readonly': True}, + "admin_user_name": {"readonly": True}, + "ssh_port": {"readonly": True}, } _attribute_map = { - 'ssh_public_access': {'key': 'sshPublicAccess', 'type': 'str'}, - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'admin_public_key': {'key': 'adminPublicKey', 'type': 'str'}, + "ssh_public_access": {"key": "sshPublicAccess", "type": "str"}, + "admin_user_name": {"key": "adminUserName", "type": "str"}, + "ssh_port": {"key": "sshPort", "type": "int"}, + "admin_public_key": {"key": "adminPublicKey", "type": "str"}, } def __init__( self, *, - ssh_public_access: Optional[Union[str, "SshPublicAccess"]] = "Disabled", + ssh_public_access: Optional[ + Union[str, "SshPublicAccess"] + ] = "Disabled", admin_public_key: Optional[str] = None, **kwargs ): @@ -5949,15 +6293,10 @@ class ComputeInstanceVersion(msrest.serialization.Model): """ _attribute_map = { - 'runtime': {'key': 'runtime', 'type': 'str'}, + "runtime": {"key": "runtime", "type": "str"}, } - def __init__( - self, - *, - runtime: Optional[str] = None, - **kwargs - ): + def __init__(self, *, runtime: Optional[str] = None, **kwargs): """ :keyword runtime: Runtime of compute instance. :paramtype runtime: str @@ -5974,15 +6313,10 @@ class ComputeResourceSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, + "properties": {"key": "properties", "type": "Compute"}, } - def __init__( - self, - *, - properties: Optional["Compute"] = None, - **kwargs - ): + def __init__(self, *, properties: Optional["Compute"] = None, **kwargs): """ :keyword properties: Compute properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute @@ -6020,22 +6354,22 @@ class ComputeResource(Resource, ComputeResourceSchema): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "properties": {"key": "properties", "type": "Compute"}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, } def __init__( @@ -6081,7 +6415,10 @@ class ComputeSchedules(msrest.serialization.Model): """ _attribute_map = { - 'compute_start_stop': {'key': 'computeStartStop', 'type': '[ComputeStartStopSchedule]'}, + "compute_start_stop": { + "key": "computeStartStop", + "type": "[ComputeStartStopSchedule]", + }, } def __init__( @@ -6127,19 +6464,19 @@ class ComputeStartStopSchedule(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'provisioning_status': {'readonly': True}, + "id": {"readonly": True}, + "provisioning_status": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'recurrence': {'key': 'recurrence', 'type': 'RecurrenceTrigger'}, - 'cron': {'key': 'cron', 'type': 'CronTrigger'}, - 'schedule': {'key': 'schedule', 'type': 'ScheduleBase'}, + "id": {"key": "id", "type": "str"}, + "provisioning_status": {"key": "provisioningStatus", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "action": {"key": "action", "type": "str"}, + "trigger_type": {"key": "triggerType", "type": "str"}, + "recurrence": {"key": "recurrence", "type": "RecurrenceTrigger"}, + "cron": {"key": "cron", "type": "CronTrigger"}, + "schedule": {"key": "schedule", "type": "ScheduleBase"}, } def __init__( @@ -6192,15 +6529,25 @@ class ContainerResourceRequirements(msrest.serialization.Model): """ _attribute_map = { - 'container_resource_limits': {'key': 'containerResourceLimits', 'type': 'ContainerResourceSettings'}, - 'container_resource_requests': {'key': 'containerResourceRequests', 'type': 'ContainerResourceSettings'}, + "container_resource_limits": { + "key": "containerResourceLimits", + "type": "ContainerResourceSettings", + }, + "container_resource_requests": { + "key": "containerResourceRequests", + "type": "ContainerResourceSettings", + }, } def __init__( self, *, - container_resource_limits: Optional["ContainerResourceSettings"] = None, - container_resource_requests: Optional["ContainerResourceSettings"] = None, + container_resource_limits: Optional[ + "ContainerResourceSettings" + ] = None, + container_resource_requests: Optional[ + "ContainerResourceSettings" + ] = None, **kwargs ): """ @@ -6231,9 +6578,9 @@ class ContainerResourceSettings(msrest.serialization.Model): """ _attribute_map = { - 'cpu': {'key': 'cpu', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'memory': {'key': 'memory', 'type': 'str'}, + "cpu": {"key": "cpu", "type": "str"}, + "gpu": {"key": "gpu", "type": "str"}, + "memory": {"key": "memory", "type": "str"}, } def __init__( @@ -6269,14 +6616,14 @@ class CosmosDbSettings(msrest.serialization.Model): """ _attribute_map = { - 'collections_throughput': {'key': 'collectionsThroughput', 'type': 'int'}, + "collections_throughput": { + "key": "collectionsThroughput", + "type": "int", + }, } def __init__( - self, - *, - collections_throughput: Optional[int] = None, - **kwargs + self, *, collections_throughput: Optional[int] = None, **kwargs ): """ :keyword collections_throughput: The throughput of the collections in cosmosdb database. @@ -6312,18 +6659,21 @@ class TriggerBase(msrest.serialization.Model): """ _validation = { - 'trigger_type': {'required': True}, + "trigger_type": {"required": True}, } _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, + "end_time": {"key": "endTime", "type": "str"}, + "start_time": {"key": "startTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "trigger_type": {"key": "triggerType", "type": "str"}, } _subtype_map = { - 'trigger_type': {'Cron': 'CronTrigger', 'Recurrence': 'RecurrenceTrigger'} + "trigger_type": { + "Cron": "CronTrigger", + "Recurrence": "RecurrenceTrigger", + } } def __init__( @@ -6381,16 +6731,16 @@ class CronTrigger(TriggerBase): """ _validation = { - 'trigger_type': {'required': True}, - 'expression': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "trigger_type": {"required": True}, + "expression": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, + "end_time": {"key": "endTime", "type": "str"}, + "start_time": {"key": "startTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "trigger_type": {"key": "triggerType", "type": "str"}, + "expression": {"key": "expression", "type": "str"}, } def __init__( @@ -6419,8 +6769,13 @@ def __init__( The expression should follow NCronTab format. :paramtype expression: str """ - super(CronTrigger, self).__init__(end_time=end_time, start_time=start_time, time_zone=time_zone, **kwargs) - self.trigger_type = 'Cron' # type: str + super(CronTrigger, self).__init__( + end_time=end_time, + start_time=start_time, + time_zone=time_zone, + **kwargs + ) + self.trigger_type = "Cron" # type: str self.expression = expression @@ -6437,27 +6792,22 @@ class CustomForecastHorizon(ForecastHorizon): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - *, - value: int, - **kwargs - ): + def __init__(self, *, value: int, **kwargs): """ :keyword value: Required. [Required] Forecast horizon value. :paramtype value: int """ super(CustomForecastHorizon, self).__init__(**kwargs) - self.mode = 'Custom' # type: str + self.mode = "Custom" # type: str self.value = value @@ -6478,24 +6828,27 @@ class JobInput(msrest.serialization.Model): """ _validation = { - 'job_input_type': {'required': True}, + "job_input_type": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } _subtype_map = { - 'job_input_type': {'custom_model': 'CustomModelJobInput', 'literal': 'LiteralJobInput', 'mlflow_model': 'MLFlowModelJobInput', 'mltable': 'MLTableJobInput', 'triton_model': 'TritonModelJobInput', 'uri_file': 'UriFileJobInput', 'uri_folder': 'UriFolderJobInput'} + "job_input_type": { + "custom_model": "CustomModelJobInput", + "literal": "LiteralJobInput", + "mlflow_model": "MLFlowModelJobInput", + "mltable": "MLTableJobInput", + "triton_model": "TritonModelJobInput", + "uri_file": "UriFileJobInput", + "uri_folder": "UriFolderJobInput", + } } - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): + def __init__(self, *, description: Optional[str] = None, **kwargs): """ :keyword description: Description for the input. :paramtype description: str @@ -6524,15 +6877,15 @@ class CustomModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -6552,10 +6905,12 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(CustomModelJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(CustomModelJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'custom_model' # type: str + self.job_input_type = "custom_model" # type: str self.description = description @@ -6576,24 +6931,26 @@ class JobOutput(msrest.serialization.Model): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } _subtype_map = { - 'job_output_type': {'custom_model': 'CustomModelJobOutput', 'mlflow_model': 'MLFlowModelJobOutput', 'mltable': 'MLTableJobOutput', 'triton_model': 'TritonModelJobOutput', 'uri_file': 'UriFileJobOutput', 'uri_folder': 'UriFolderJobOutput'} + "job_output_type": { + "custom_model": "CustomModelJobOutput", + "mlflow_model": "MLFlowModelJobOutput", + "mltable": "MLTableJobOutput", + "triton_model": "TritonModelJobOutput", + "uri_file": "UriFileJobOutput", + "uri_folder": "UriFolderJobOutput", + } } - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): + def __init__(self, *, description: Optional[str] = None, **kwargs): """ :keyword description: Description for the output. :paramtype description: str @@ -6621,14 +6978,14 @@ class CustomModelJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -6647,10 +7004,12 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(CustomModelJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(CustomModelJobOutput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_output_type = 'custom_model' # type: str + self.job_output_type = "custom_model" # type: str self.description = description @@ -6667,27 +7026,22 @@ class CustomNCrossValidations(NCrossValidations): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - *, - value: int, - **kwargs - ): + def __init__(self, *, value: int, **kwargs): """ :keyword value: Required. [Required] N-Cross validations value. :paramtype value: int """ super(CustomNCrossValidations, self).__init__(**kwargs) - self.mode = 'Custom' # type: str + self.mode = "Custom" # type: str self.value = value @@ -6704,27 +7058,22 @@ class CustomSeasonality(Seasonality): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - *, - value: int, - **kwargs - ): + def __init__(self, *, value: int, **kwargs): """ :keyword value: Required. [Required] Seasonality value. :paramtype value: int """ super(CustomSeasonality, self).__init__(**kwargs) - self.mode = 'Custom' # type: str + self.mode = "Custom" # type: str self.value = value @@ -6741,27 +7090,22 @@ class CustomTargetLags(TargetLags): """ _validation = { - 'mode': {'required': True}, - 'values': {'required': True}, + "mode": {"required": True}, + "values": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[int]'}, + "mode": {"key": "mode", "type": "str"}, + "values": {"key": "values", "type": "[int]"}, } - def __init__( - self, - *, - values: List[int], - **kwargs - ): + def __init__(self, *, values: List[int], **kwargs): """ :keyword values: Required. [Required] Set target lags values. :paramtype values: list[int] """ super(CustomTargetLags, self).__init__(**kwargs) - self.mode = 'Custom' # type: str + self.mode = "Custom" # type: str self.values = values @@ -6778,27 +7122,22 @@ class CustomTargetRollingWindowSize(TargetRollingWindowSize): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - *, - value: int, - **kwargs - ): + def __init__(self, *, value: int, **kwargs): """ :keyword value: Required. [Required] TargetRollingWindowSize value. :paramtype value: int """ super(CustomTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Custom' # type: str + self.mode = "Custom" # type: str self.value = value @@ -6810,14 +7149,11 @@ class DatabricksSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, + "properties": {"key": "properties", "type": "DatabricksProperties"}, } def __init__( - self, - *, - properties: Optional["DatabricksProperties"] = None, - **kwargs + self, *, properties: Optional["DatabricksProperties"] = None, **kwargs ): """ :keyword properties: Properties of Databricks. @@ -6866,28 +7202,31 @@ class Databricks(Compute, DatabricksSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + "disable_local_auth": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "DatabricksProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -6906,9 +7245,14 @@ def __init__( :keyword resource_id: ARM resource id of the underlying compute. :paramtype resource_id: str """ - super(Databricks, self).__init__(description=description, resource_id=resource_id, properties=properties, **kwargs) + super(Databricks, self).__init__( + description=description, + resource_id=resource_id, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'Databricks' # type: str + self.compute_type = "Databricks" # type: str self.compute_location = None self.provisioning_state = None self.description = description @@ -6928,14 +7272,14 @@ class DatabricksComputeSecretsProperties(msrest.serialization.Model): """ _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, } def __init__( - self, - *, - databricks_access_token: Optional[str] = None, - **kwargs + self, *, databricks_access_token: Optional[str] = None, **kwargs ): """ :keyword databricks_access_token: access token for databricks account. @@ -6945,7 +7289,9 @@ def __init__( self.databricks_access_token = databricks_access_token -class DatabricksComputeSecrets(ComputeSecrets, DatabricksComputeSecretsProperties): +class DatabricksComputeSecrets( + ComputeSecrets, DatabricksComputeSecretsProperties +): """Secrets related to a Machine Learning compute based on Databricks. All required parameters must be populated in order to send to Azure. @@ -6959,27 +7305,29 @@ class DatabricksComputeSecrets(ComputeSecrets, DatabricksComputeSecretsPropertie """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, + "compute_type": {"key": "computeType", "type": "str"}, } def __init__( - self, - *, - databricks_access_token: Optional[str] = None, - **kwargs + self, *, databricks_access_token: Optional[str] = None, **kwargs ): """ :keyword databricks_access_token: access token for databricks account. :paramtype databricks_access_token: str """ - super(DatabricksComputeSecrets, self).__init__(databricks_access_token=databricks_access_token, **kwargs) + super(DatabricksComputeSecrets, self).__init__( + databricks_access_token=databricks_access_token, **kwargs + ) self.databricks_access_token = databricks_access_token - self.compute_type = 'Databricks' # type: str + self.compute_type = "Databricks" # type: str class DatabricksProperties(msrest.serialization.Model): @@ -6992,8 +7340,11 @@ class DatabricksProperties(msrest.serialization.Model): """ _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'workspace_url': {'key': 'workspaceUrl', 'type': 'str'}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, + "workspace_url": {"key": "workspaceUrl", "type": "str"}, } def __init__( @@ -7037,27 +7388,22 @@ class DataContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "DataContainerProperties"}, } - def __init__( - self, - *, - properties: "DataContainerProperties", - **kwargs - ): + def __init__(self, *, properties: "DataContainerProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataContainerProperties @@ -7091,19 +7437,19 @@ class DataContainerProperties(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'data_type': {'required': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "data_type": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "data_type": {"key": "dataType", "type": "str"}, } def __init__( @@ -7129,7 +7475,13 @@ def __init__( "uri_file", "uri_folder", "mltable". :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType """ - super(DataContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) + super(DataContainerProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs + ) self.data_type = data_type @@ -7144,8 +7496,8 @@ class DataContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[DataContainer]"}, } def __init__( @@ -7204,27 +7556,30 @@ class DataFactory(Compute): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + "disable_local_auth": {"readonly": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -7240,8 +7595,10 @@ def __init__( :keyword resource_id: ARM resource id of the underlying compute. :paramtype resource_id: str """ - super(DataFactory, self).__init__(description=description, resource_id=resource_id, **kwargs) - self.compute_type = 'DataFactory' # type: str + super(DataFactory, self).__init__( + description=description, resource_id=resource_id, **kwargs + ) + self.compute_type = "DataFactory" # type: str class DataLakeAnalyticsSchema(msrest.serialization.Model): @@ -7253,7 +7610,10 @@ class DataLakeAnalyticsSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, + "properties": { + "key": "properties", + "type": "DataLakeAnalyticsSchemaProperties", + }, } def __init__( @@ -7311,28 +7671,34 @@ class DataLakeAnalytics(Compute, DataLakeAnalyticsSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + "disable_local_auth": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": { + "key": "properties", + "type": "DataLakeAnalyticsSchemaProperties", + }, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -7352,9 +7718,14 @@ def __init__( :keyword resource_id: ARM resource id of the underlying compute. :paramtype resource_id: str """ - super(DataLakeAnalytics, self).__init__(description=description, resource_id=resource_id, properties=properties, **kwargs) + super(DataLakeAnalytics, self).__init__( + description=description, + resource_id=resource_id, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'DataLakeAnalytics' # type: str + self.compute_type = "DataLakeAnalytics" # type: str self.compute_location = None self.provisioning_state = None self.description = description @@ -7374,14 +7745,14 @@ class DataLakeAnalyticsSchemaProperties(msrest.serialization.Model): """ _attribute_map = { - 'data_lake_store_account_name': {'key': 'dataLakeStoreAccountName', 'type': 'str'}, + "data_lake_store_account_name": { + "key": "dataLakeStoreAccountName", + "type": "str", + }, } def __init__( - self, - *, - data_lake_store_account_name: Optional[str] = None, - **kwargs + self, *, data_lake_store_account_name: Optional[str] = None, **kwargs ): """ :keyword data_lake_store_account_name: DataLake Store Account Name. @@ -7406,13 +7777,13 @@ class DataPathAssetReference(AssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'datastore_id': {'key': 'datastoreId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "datastore_id": {"key": "datastoreId", "type": "str"}, + "path": {"key": "path", "type": "str"}, } def __init__( @@ -7429,7 +7800,7 @@ def __init__( :paramtype path: str """ super(DataPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'DataPath' # type: str + self.reference_type = "DataPath" # type: str self.datastore_id = datastore_id self.path = path @@ -7457,27 +7828,22 @@ class Datastore(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DatastoreProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "DatastoreProperties"}, } - def __init__( - self, - *, - properties: "DatastoreProperties", - **kwargs - ): + def __init__(self, *, properties: "DatastoreProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatastoreProperties @@ -7497,8 +7863,8 @@ class DatastoreResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Datastore]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[Datastore]"}, } def __init__( @@ -7543,27 +7909,25 @@ class DataVersionBase(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataVersionBaseProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "DataVersionBaseProperties", + }, } - def __init__( - self, - *, - properties: "DataVersionBaseProperties", - **kwargs - ): + def __init__(self, *, properties: "DataVersionBaseProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataVersionBaseProperties @@ -7599,22 +7963,26 @@ class DataVersionBaseProperties(AssetBase): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, } _subtype_map = { - 'data_type': {'mltable': 'MLTableData', 'uri_file': 'UriFileDataVersion', 'uri_folder': 'UriFolderDataVersion'} + "data_type": { + "mltable": "MLTableData", + "uri_file": "UriFileDataVersion", + "uri_folder": "UriFolderDataVersion", + } } def __init__( @@ -7643,8 +8011,15 @@ def __init__( Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20221001.Assets.DataVersionBase.DataType. :paramtype data_uri: str """ - super(DataVersionBaseProperties, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.data_type = 'DataVersionBaseProperties' # type: str + super(DataVersionBaseProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + **kwargs + ) + self.data_type = "DataVersionBaseProperties" # type: str self.data_uri = data_uri @@ -7659,8 +8034,8 @@ class DataVersionBaseResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataVersionBase]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[DataVersionBase]"}, } def __init__( @@ -7677,7 +8052,9 @@ def __init__( :keyword value: An array of objects of type DataVersionBase. :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBase] """ - super(DataVersionBaseResourceArmPaginatedResult, self).__init__(**kwargs) + super(DataVersionBaseResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -7696,23 +8073,22 @@ class OnlineScaleSettings(msrest.serialization.Model): """ _validation = { - 'scale_type': {'required': True}, + "scale_type": {"required": True}, } _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, + "scale_type": {"key": "scaleType", "type": "str"}, } _subtype_map = { - 'scale_type': {'Default': 'DefaultScaleSettings', 'TargetUtilization': 'TargetUtilizationScaleSettings'} + "scale_type": { + "Default": "DefaultScaleSettings", + "TargetUtilization": "TargetUtilizationScaleSettings", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(OnlineScaleSettings, self).__init__(**kwargs) self.scale_type = None # type: Optional[str] @@ -7728,21 +8104,17 @@ class DefaultScaleSettings(OnlineScaleSettings): """ _validation = { - 'scale_type': {'required': True}, + "scale_type": {"required": True}, } _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, + "scale_type": {"key": "scaleType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DefaultScaleSettings, self).__init__(**kwargs) - self.scale_type = 'Default' # type: str + self.scale_type = "Default" # type: str class DeploymentLogs(msrest.serialization.Model): @@ -7753,15 +8125,10 @@ class DeploymentLogs(msrest.serialization.Model): """ _attribute_map = { - 'content': {'key': 'content', 'type': 'str'}, + "content": {"key": "content", "type": "str"}, } - def __init__( - self, - *, - content: Optional[str] = None, - **kwargs - ): + def __init__(self, *, content: Optional[str] = None, **kwargs): """ :keyword content: The retrieved online deployment logs. :paramtype content: str @@ -7781,8 +8148,8 @@ class DeploymentLogsRequest(msrest.serialization.Model): """ _attribute_map = { - 'container_type': {'key': 'containerType', 'type': 'str'}, - 'tail': {'key': 'tail', 'type': 'int'}, + "container_type": {"key": "containerType", "type": "str"}, + "tail": {"key": "tail", "type": "int"}, } def __init__( @@ -7816,9 +8183,9 @@ class ResourceConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "properties": {"key": "properties", "type": "{object}"}, } def __init__( @@ -7855,9 +8222,9 @@ class DeploymentResourceConfiguration(ResourceConfiguration): """ _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "properties": {"key": "properties", "type": "{object}"}, } def __init__( @@ -7876,7 +8243,12 @@ def __init__( :keyword properties: Additional properties bag. :paramtype properties: dict[str, any] """ - super(DeploymentResourceConfiguration, self).__init__(instance_count=instance_count, instance_type=instance_type, properties=properties, **kwargs) + super(DeploymentResourceConfiguration, self).__init__( + instance_count=instance_count, + instance_type=instance_type, + properties=properties, + **kwargs + ) class DiagnoseRequestProperties(msrest.serialization.Model): @@ -7903,15 +8275,18 @@ class DiagnoseRequestProperties(msrest.serialization.Model): """ _attribute_map = { - 'udr': {'key': 'udr', 'type': '{object}'}, - 'nsg': {'key': 'nsg', 'type': '{object}'}, - 'resource_lock': {'key': 'resourceLock', 'type': '{object}'}, - 'dns_resolution': {'key': 'dnsResolution', 'type': '{object}'}, - 'storage_account': {'key': 'storageAccount', 'type': '{object}'}, - 'key_vault': {'key': 'keyVault', 'type': '{object}'}, - 'container_registry': {'key': 'containerRegistry', 'type': '{object}'}, - 'application_insights': {'key': 'applicationInsights', 'type': '{object}'}, - 'others': {'key': 'others', 'type': '{object}'}, + "udr": {"key": "udr", "type": "{object}"}, + "nsg": {"key": "nsg", "type": "{object}"}, + "resource_lock": {"key": "resourceLock", "type": "{object}"}, + "dns_resolution": {"key": "dnsResolution", "type": "{object}"}, + "storage_account": {"key": "storageAccount", "type": "{object}"}, + "key_vault": {"key": "keyVault", "type": "{object}"}, + "container_registry": {"key": "containerRegistry", "type": "{object}"}, + "application_insights": { + "key": "applicationInsights", + "type": "{object}", + }, + "others": {"key": "others", "type": "{object}"}, } def __init__( @@ -7968,7 +8343,7 @@ class DiagnoseResponseResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseResponseResultValue'}, + "value": {"key": "value", "type": "DiagnoseResponseResultValue"}, } def __init__( @@ -8015,15 +8390,39 @@ class DiagnoseResponseResultValue(msrest.serialization.Model): """ _attribute_map = { - 'user_defined_route_results': {'key': 'userDefinedRouteResults', 'type': '[DiagnoseResult]'}, - 'network_security_rule_results': {'key': 'networkSecurityRuleResults', 'type': '[DiagnoseResult]'}, - 'resource_lock_results': {'key': 'resourceLockResults', 'type': '[DiagnoseResult]'}, - 'dns_resolution_results': {'key': 'dnsResolutionResults', 'type': '[DiagnoseResult]'}, - 'storage_account_results': {'key': 'storageAccountResults', 'type': '[DiagnoseResult]'}, - 'key_vault_results': {'key': 'keyVaultResults', 'type': '[DiagnoseResult]'}, - 'container_registry_results': {'key': 'containerRegistryResults', 'type': '[DiagnoseResult]'}, - 'application_insights_results': {'key': 'applicationInsightsResults', 'type': '[DiagnoseResult]'}, - 'other_results': {'key': 'otherResults', 'type': '[DiagnoseResult]'}, + "user_defined_route_results": { + "key": "userDefinedRouteResults", + "type": "[DiagnoseResult]", + }, + "network_security_rule_results": { + "key": "networkSecurityRuleResults", + "type": "[DiagnoseResult]", + }, + "resource_lock_results": { + "key": "resourceLockResults", + "type": "[DiagnoseResult]", + }, + "dns_resolution_results": { + "key": "dnsResolutionResults", + "type": "[DiagnoseResult]", + }, + "storage_account_results": { + "key": "storageAccountResults", + "type": "[DiagnoseResult]", + }, + "key_vault_results": { + "key": "keyVaultResults", + "type": "[DiagnoseResult]", + }, + "container_registry_results": { + "key": "containerRegistryResults", + "type": "[DiagnoseResult]", + }, + "application_insights_results": { + "key": "applicationInsightsResults", + "type": "[DiagnoseResult]", + }, + "other_results": {"key": "otherResults", "type": "[DiagnoseResult]"}, } def __init__( @@ -8094,23 +8493,19 @@ class DiagnoseResult(msrest.serialization.Model): """ _validation = { - 'code': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, + "code": {"readonly": True}, + "level": {"readonly": True}, + "message": {"readonly": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, + "code": {"key": "code", "type": "str"}, + "level": {"key": "level", "type": "str"}, + "message": {"key": "message", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DiagnoseResult, self).__init__(**kwargs) self.code = None self.level = None @@ -8125,14 +8520,11 @@ class DiagnoseWorkspaceParameters(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseRequestProperties'}, + "value": {"key": "value", "type": "DiagnoseRequestProperties"}, } def __init__( - self, - *, - value: Optional["DiagnoseRequestProperties"] = None, - **kwargs + self, *, value: Optional["DiagnoseRequestProperties"] = None, **kwargs ): """ :keyword value: Value of Parameters. @@ -8156,23 +8548,23 @@ class DistributionConfiguration(msrest.serialization.Model): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, + "distribution_type": {"key": "distributionType", "type": "str"}, } _subtype_map = { - 'distribution_type': {'Mpi': 'Mpi', 'PyTorch': 'PyTorch', 'TensorFlow': 'TensorFlow'} + "distribution_type": { + "Mpi": "Mpi", + "PyTorch": "PyTorch", + "TensorFlow": "TensorFlow", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DistributionConfiguration, self).__init__(**kwargs) self.distribution_type = None # type: Optional[str] @@ -8193,14 +8585,14 @@ class EncryptionKeyVaultProperties(msrest.serialization.Model): """ _validation = { - 'key_vault_arm_id': {'required': True}, - 'key_identifier': {'required': True}, + "key_vault_arm_id": {"required": True}, + "key_identifier": {"required": True}, } _attribute_map = { - 'key_vault_arm_id': {'key': 'keyVaultArmId', 'type': 'str'}, - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - 'identity_client_id': {'key': 'identityClientId', 'type': 'str'}, + "key_vault_arm_id": {"key": "keyVaultArmId", "type": "str"}, + "key_identifier": {"key": "keyIdentifier", "type": "str"}, + "identity_client_id": {"key": "identityClientId", "type": "str"}, } def __init__( @@ -8243,14 +8635,17 @@ class EncryptionProperty(msrest.serialization.Model): """ _validation = { - 'status': {'required': True}, - 'key_vault_properties': {'required': True}, + "status": {"required": True}, + "key_vault_properties": {"required": True}, } _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityForCmk'}, - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'EncryptionKeyVaultProperties'}, + "status": {"key": "status", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityForCmk"}, + "key_vault_properties": { + "key": "keyVaultProperties", + "type": "EncryptionKeyVaultProperties", + }, } def __init__( @@ -8288,8 +8683,8 @@ class EndpointAuthKeys(msrest.serialization.Model): """ _attribute_map = { - 'primary_key': {'key': 'primaryKey', 'type': 'str'}, - 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, + "primary_key": {"key": "primaryKey", "type": "str"}, + "secondary_key": {"key": "secondaryKey", "type": "str"}, } def __init__( @@ -8324,10 +8719,13 @@ class EndpointAuthToken(msrest.serialization.Model): """ _attribute_map = { - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'expiry_time_utc': {'key': 'expiryTimeUtc', 'type': 'long'}, - 'refresh_after_time_utc': {'key': 'refreshAfterTimeUtc', 'type': 'long'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, + "access_token": {"key": "accessToken", "type": "str"}, + "expiry_time_utc": {"key": "expiryTimeUtc", "type": "long"}, + "refresh_after_time_utc": { + "key": "refreshAfterTimeUtc", + "type": "long", + }, + "token_type": {"key": "tokenType", "type": "str"}, } def __init__( @@ -8370,23 +8768,22 @@ class ScheduleActionBase(msrest.serialization.Model): """ _validation = { - 'action_type': {'required': True}, + "action_type": {"required": True}, } _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, + "action_type": {"key": "actionType", "type": "str"}, } _subtype_map = { - 'action_type': {'CreateJob': 'JobScheduleAction', 'InvokeBatchEndpoint': 'EndpointScheduleAction'} + "action_type": { + "CreateJob": "JobScheduleAction", + "InvokeBatchEndpoint": "EndpointScheduleAction", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ScheduleActionBase, self).__init__(**kwargs) self.action_type = None # type: Optional[str] @@ -8401,42 +8798,40 @@ class EndpointScheduleAction(ScheduleActionBase): :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType :ivar endpoint_invocation_definition: Required. [Required] Defines Schedule action definition details. - - + + .. raw:: html - + . :vartype endpoint_invocation_definition: any """ _validation = { - 'action_type': {'required': True}, - 'endpoint_invocation_definition': {'required': True}, + "action_type": {"required": True}, + "endpoint_invocation_definition": {"required": True}, } _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'endpoint_invocation_definition': {'key': 'endpointInvocationDefinition', 'type': 'object'}, + "action_type": {"key": "actionType", "type": "str"}, + "endpoint_invocation_definition": { + "key": "endpointInvocationDefinition", + "type": "object", + }, } - def __init__( - self, - *, - endpoint_invocation_definition: Any, - **kwargs - ): + def __init__(self, *, endpoint_invocation_definition: Any, **kwargs): """ :keyword endpoint_invocation_definition: Required. [Required] Defines Schedule action definition details. - - + + .. raw:: html - + . :paramtype endpoint_invocation_definition: any """ super(EndpointScheduleAction, self).__init__(**kwargs) - self.action_type = 'InvokeBatchEndpoint' # type: str + self.action_type = "InvokeBatchEndpoint" # type: str self.endpoint_invocation_definition = endpoint_invocation_definition @@ -8463,26 +8858,26 @@ class EnvironmentContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "EnvironmentContainerProperties", + }, } def __init__( - self, - *, - properties: "EnvironmentContainerProperties", - **kwargs + self, *, properties: "EnvironmentContainerProperties", **kwargs ): """ :keyword properties: Required. [Required] Additional attributes of the entity. @@ -8513,17 +8908,17 @@ class EnvironmentContainerProperties(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, } def __init__( @@ -8545,10 +8940,18 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(EnvironmentContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) + super(EnvironmentContainerProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs + ) -class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model): +class EnvironmentContainerResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of EnvironmentContainer entities. :ivar next_link: The link to the next page of EnvironmentContainer objects. If null, there are @@ -8559,8 +8962,8 @@ class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model) """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[EnvironmentContainer]"}, } def __init__( @@ -8577,7 +8980,9 @@ def __init__( :keyword value: An array of objects of type EnvironmentContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] """ - super(EnvironmentContainerResourceArmPaginatedResult, self).__init__(**kwargs) + super(EnvironmentContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -8605,26 +9010,26 @@ class EnvironmentVersion(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentVersionProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "EnvironmentVersionProperties", + }, } def __init__( - self, - *, - properties: "EnvironmentVersionProperties", - **kwargs + self, *, properties: "EnvironmentVersionProperties", **kwargs ): """ :keyword properties: Required. [Required] Additional attributes of the entity. @@ -8656,29 +9061,29 @@ class EnvironmentVersionProperties(AssetBase): :vartype build: ~azure.mgmt.machinelearningservices.models.BuildContext :ivar conda_file: Standard configuration file used by Conda that lets you install any kind of package, including Python, R, and C/C++ packages. - - + + .. raw:: html - + . :vartype conda_file: str :ivar environment_type: Environment type is either user managed or curated by the Azure ML service - - + + .. raw:: html - + . Possible values include: "Curated", "UserCreated". :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType :ivar image: Name of the image that will be used for the environment. - - + + .. raw:: html - + . @@ -8691,22 +9096,25 @@ class EnvironmentVersionProperties(AssetBase): """ _validation = { - 'environment_type': {'readonly': True}, + "environment_type": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'auto_rebuild': {'key': 'autoRebuild', 'type': 'str'}, - 'build': {'key': 'build', 'type': 'BuildContext'}, - 'conda_file': {'key': 'condaFile', 'type': 'str'}, - 'environment_type': {'key': 'environmentType', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'str'}, - 'inference_config': {'key': 'inferenceConfig', 'type': 'InferenceContainerProperties'}, - 'os_type': {'key': 'osType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "auto_rebuild": {"key": "autoRebuild", "type": "str"}, + "build": {"key": "build", "type": "BuildContext"}, + "conda_file": {"key": "condaFile", "type": "str"}, + "environment_type": {"key": "environmentType", "type": "str"}, + "image": {"key": "image", "type": "str"}, + "inference_config": { + "key": "inferenceConfig", + "type": "InferenceContainerProperties", + }, + "os_type": {"key": "osType", "type": "str"}, } def __init__( @@ -8743,19 +9151,19 @@ def __init__( :paramtype build: ~azure.mgmt.machinelearningservices.models.BuildContext :keyword conda_file: Standard configuration file used by Conda that lets you install any kind of package, including Python, R, and C/C++ packages. - - + + .. raw:: html - + . :paramtype conda_file: str :keyword image: Name of the image that will be used for the environment. - - + + .. raw:: html - + . @@ -8766,7 +9174,14 @@ def __init__( :keyword os_type: The OS type of the environment. Possible values include: "Linux", "Windows". :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.OperatingSystemType """ - super(EnvironmentVersionProperties, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) + super(EnvironmentVersionProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + **kwargs + ) self.auto_rebuild = auto_rebuild self.build = build self.conda_file = conda_file @@ -8787,8 +9202,8 @@ class EnvironmentVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentVersion]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[EnvironmentVersion]"}, } def __init__( @@ -8805,7 +9220,9 @@ def __init__( :keyword value: An array of objects of type EnvironmentVersion. :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] """ - super(EnvironmentVersionResourceArmPaginatedResult, self).__init__(**kwargs) + super(EnvironmentVersionResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -8822,21 +9239,17 @@ class ErrorAdditionalInfo(msrest.serialization.Model): """ _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, + "type": {"readonly": True}, + "info": {"readonly": True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, + "type": {"key": "type", "type": "str"}, + "info": {"key": "info", "type": "object"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ErrorAdditionalInfo, self).__init__(**kwargs) self.type = None self.info = None @@ -8860,27 +9273,26 @@ class ErrorDetail(msrest.serialization.Model): """ _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, + "code": {"readonly": True}, + "message": {"readonly": True}, + "target": {"readonly": True}, + "details": {"readonly": True}, + "additional_info": {"readonly": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[ErrorDetail]"}, + "additional_info": { + "key": "additionalInfo", + "type": "[ErrorAdditionalInfo]", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ErrorDetail, self).__init__(**kwargs) self.code = None self.message = None @@ -8897,15 +9309,10 @@ class ErrorResponse(msrest.serialization.Model): """ _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, + "error": {"key": "error", "type": "ErrorDetail"}, } - def __init__( - self, - *, - error: Optional["ErrorDetail"] = None, - **kwargs - ): + def __init__(self, *, error: Optional["ErrorDetail"] = None, **kwargs): """ :keyword error: The error object. :paramtype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail @@ -8930,15 +9337,15 @@ class EstimatedVMPrice(msrest.serialization.Model): """ _validation = { - 'retail_price': {'required': True}, - 'os_type': {'required': True}, - 'vm_tier': {'required': True}, + "retail_price": {"required": True}, + "os_type": {"required": True}, + "vm_tier": {"required": True}, } _attribute_map = { - 'retail_price': {'key': 'retailPrice', 'type': 'float'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_tier': {'key': 'vmTier', 'type': 'str'}, + "retail_price": {"key": "retailPrice", "type": "float"}, + "os_type": {"key": "osType", "type": "str"}, + "vm_tier": {"key": "vmTier", "type": "str"}, } def __init__( @@ -8982,15 +9389,15 @@ class EstimatedVMPrices(msrest.serialization.Model): """ _validation = { - 'billing_currency': {'required': True}, - 'unit_of_measure': {'required': True}, - 'values': {'required': True}, + "billing_currency": {"required": True}, + "unit_of_measure": {"required": True}, + "values": {"required": True}, } _attribute_map = { - 'billing_currency': {'key': 'billingCurrency', 'type': 'str'}, - 'unit_of_measure': {'key': 'unitOfMeasure', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[EstimatedVMPrice]'}, + "billing_currency": {"key": "billingCurrency", "type": "str"}, + "unit_of_measure": {"key": "unitOfMeasure", "type": "str"}, + "values": {"key": "values", "type": "[EstimatedVMPrice]"}, } def __init__( @@ -9026,14 +9433,11 @@ class ExternalFQDNResponse(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[FQDNEndpoints]'}, + "value": {"key": "value", "type": "[FQDNEndpoints]"}, } def __init__( - self, - *, - value: Optional[List["FQDNEndpoints"]] = None, - **kwargs + self, *, value: Optional[List["FQDNEndpoints"]] = None, **kwargs ): """ :keyword value: @@ -9051,15 +9455,10 @@ class FeaturizationSettings(msrest.serialization.Model): """ _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, + "dataset_language": {"key": "datasetLanguage", "type": "str"}, } - def __init__( - self, - *, - dataset_language: Optional[str] = None, - **kwargs - ): + def __init__(self, *, dataset_language: Optional[str] = None, **kwargs): """ :keyword dataset_language: Dataset language, useful for the text data. :paramtype dataset_language: str @@ -9076,15 +9475,10 @@ class FlavorData(msrest.serialization.Model): """ _attribute_map = { - 'data': {'key': 'data', 'type': '{str}'}, + "data": {"key": "data", "type": "{str}"}, } - def __init__( - self, - *, - data: Optional[Dict[str, str]] = None, - **kwargs - ): + def __init__(self, *, data: Optional[Dict[str, str]] = None, **kwargs): """ :keyword data: Model flavor-specific data. :paramtype data: dict[str, str] @@ -9151,27 +9545,48 @@ class Forecasting(AutoMLVertical, TableVertical): """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'forecasting_settings': {'key': 'forecastingSettings', 'type': 'ForecastingSettings'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'ForecastingTrainingSettings'}, + "task_type": {"required": True}, + "training_data": {"required": True}, + } + + _attribute_map = { + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "test_data": {"key": "testData", "type": "MLTableJobInput"}, + "test_data_size": {"key": "testDataSize", "type": "float"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "weight_column_name": {"key": "weightColumnName", "type": "str"}, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "forecasting_settings": { + "key": "forecastingSettings", + "type": "ForecastingSettings", + }, + "primary_metric": {"key": "primaryMetric", "type": "str"}, + "training_settings": { + "key": "trainingSettings", + "type": "ForecastingTrainingSettings", + }, } def __init__( @@ -9179,7 +9594,9 @@ def __init__( *, training_data: "MLTableJobInput", cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "TableVerticalFeaturizationSettings" + ] = None, limit_settings: Optional["TableVerticalLimitSettings"] = None, n_cross_validations: Optional["NCrossValidations"] = None, test_data: Optional["MLTableJobInput"] = None, @@ -9190,7 +9607,9 @@ def __init__( log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, forecasting_settings: Optional["ForecastingSettings"] = None, - primary_metric: Optional[Union[str, "ForecastingPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "ForecastingPrimaryMetrics"] + ] = None, training_settings: Optional["ForecastingTrainingSettings"] = None, **kwargs ): @@ -9243,7 +9662,21 @@ def __init__( :paramtype training_settings: ~azure.mgmt.machinelearningservices.models.ForecastingTrainingSettings """ - super(Forecasting, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, cv_split_column_names=cv_split_column_names, featurization_settings=featurization_settings, limit_settings=limit_settings, n_cross_validations=n_cross_validations, test_data=test_data, test_data_size=test_data_size, validation_data=validation_data, validation_data_size=validation_data_size, weight_column_name=weight_column_name, **kwargs) + super(Forecasting, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + cv_split_column_names=cv_split_column_names, + featurization_settings=featurization_settings, + limit_settings=limit_settings, + n_cross_validations=n_cross_validations, + test_data=test_data, + test_data_size=test_data_size, + validation_data=validation_data, + validation_data_size=validation_data_size, + weight_column_name=weight_column_name, + **kwargs + ) self.cv_split_column_names = cv_split_column_names self.featurization_settings = featurization_settings self.limit_settings = limit_settings @@ -9253,7 +9686,7 @@ def __init__( self.validation_data = validation_data self.validation_data_size = validation_data_size self.weight_column_name = weight_column_name - self.task_type = 'Forecasting' # type: str + self.task_type = "Forecasting" # type: str self.forecasting_settings = forecasting_settings self.primary_metric = primary_metric self.training_settings = training_settings @@ -9317,19 +9750,37 @@ class ForecastingSettings(msrest.serialization.Model): """ _attribute_map = { - 'country_or_region_for_holidays': {'key': 'countryOrRegionForHolidays', 'type': 'str'}, - 'cv_step_size': {'key': 'cvStepSize', 'type': 'int'}, - 'feature_lags': {'key': 'featureLags', 'type': 'str'}, - 'forecast_horizon': {'key': 'forecastHorizon', 'type': 'ForecastHorizon'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'seasonality': {'key': 'seasonality', 'type': 'Seasonality'}, - 'short_series_handling_config': {'key': 'shortSeriesHandlingConfig', 'type': 'str'}, - 'target_aggregate_function': {'key': 'targetAggregateFunction', 'type': 'str'}, - 'target_lags': {'key': 'targetLags', 'type': 'TargetLags'}, - 'target_rolling_window_size': {'key': 'targetRollingWindowSize', 'type': 'TargetRollingWindowSize'}, - 'time_column_name': {'key': 'timeColumnName', 'type': 'str'}, - 'time_series_id_column_names': {'key': 'timeSeriesIdColumnNames', 'type': '[str]'}, - 'use_stl': {'key': 'useStl', 'type': 'str'}, + "country_or_region_for_holidays": { + "key": "countryOrRegionForHolidays", + "type": "str", + }, + "cv_step_size": {"key": "cvStepSize", "type": "int"}, + "feature_lags": {"key": "featureLags", "type": "str"}, + "forecast_horizon": { + "key": "forecastHorizon", + "type": "ForecastHorizon", + }, + "frequency": {"key": "frequency", "type": "str"}, + "seasonality": {"key": "seasonality", "type": "Seasonality"}, + "short_series_handling_config": { + "key": "shortSeriesHandlingConfig", + "type": "str", + }, + "target_aggregate_function": { + "key": "targetAggregateFunction", + "type": "str", + }, + "target_lags": {"key": "targetLags", "type": "TargetLags"}, + "target_rolling_window_size": { + "key": "targetRollingWindowSize", + "type": "TargetRollingWindowSize", + }, + "time_column_name": {"key": "timeColumnName", "type": "str"}, + "time_series_id_column_names": { + "key": "timeSeriesIdColumnNames", + "type": "[str]", + }, + "use_stl": {"key": "useStl", "type": "str"}, } def __init__( @@ -9341,8 +9792,12 @@ def __init__( forecast_horizon: Optional["ForecastHorizon"] = None, frequency: Optional[str] = None, seasonality: Optional["Seasonality"] = None, - short_series_handling_config: Optional[Union[str, "ShortSeriesHandlingConfiguration"]] = None, - target_aggregate_function: Optional[Union[str, "TargetAggregationFunction"]] = None, + short_series_handling_config: Optional[ + Union[str, "ShortSeriesHandlingConfiguration"] + ] = None, + target_aggregate_function: Optional[ + Union[str, "TargetAggregationFunction"] + ] = None, target_lags: Optional["TargetLags"] = None, target_rolling_window_size: Optional["TargetRollingWindowSize"] = None, time_column_name: Optional[str] = None, @@ -9448,15 +9903,36 @@ class ForecastingTrainingSettings(TrainingSettings): """ _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, + "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, + "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, + "allowed_training_algorithms": { + "key": "allowedTrainingAlgorithms", + "type": "[str]", + }, + "blocked_training_algorithms": { + "key": "blockedTrainingAlgorithms", + "type": "[str]", + }, } def __init__( @@ -9469,8 +9945,12 @@ def __init__( enable_vote_ensemble: Optional[bool] = True, ensemble_model_download_timeout: Optional[datetime.timedelta] = "PT5M", stack_ensemble_settings: Optional["StackEnsembleSettings"] = None, - allowed_training_algorithms: Optional[List[Union[str, "ForecastingModels"]]] = None, - blocked_training_algorithms: Optional[List[Union[str, "ForecastingModels"]]] = None, + allowed_training_algorithms: Optional[ + List[Union[str, "ForecastingModels"]] + ] = None, + blocked_training_algorithms: Optional[ + List[Union[str, "ForecastingModels"]] + ] = None, **kwargs ): """ @@ -9498,7 +9978,16 @@ def __init__( :paramtype blocked_training_algorithms: list[str or ~azure.mgmt.machinelearningservices.models.ForecastingModels] """ - super(ForecastingTrainingSettings, self).__init__(enable_dnn_training=enable_dnn_training, enable_model_explainability=enable_model_explainability, enable_onnx_compatible_models=enable_onnx_compatible_models, enable_stack_ensemble=enable_stack_ensemble, enable_vote_ensemble=enable_vote_ensemble, ensemble_model_download_timeout=ensemble_model_download_timeout, stack_ensemble_settings=stack_ensemble_settings, **kwargs) + super(ForecastingTrainingSettings, self).__init__( + enable_dnn_training=enable_dnn_training, + enable_model_explainability=enable_model_explainability, + enable_onnx_compatible_models=enable_onnx_compatible_models, + enable_stack_ensemble=enable_stack_ensemble, + enable_vote_ensemble=enable_vote_ensemble, + ensemble_model_download_timeout=ensemble_model_download_timeout, + stack_ensemble_settings=stack_ensemble_settings, + **kwargs + ) self.allowed_training_algorithms = allowed_training_algorithms self.blocked_training_algorithms = blocked_training_algorithms @@ -9513,8 +10002,11 @@ class FQDNEndpoint(msrest.serialization.Model): """ _attribute_map = { - 'domain_name': {'key': 'domainName', 'type': 'str'}, - 'endpoint_details': {'key': 'endpointDetails', 'type': '[FQDNEndpointDetail]'}, + "domain_name": {"key": "domainName", "type": "str"}, + "endpoint_details": { + "key": "endpointDetails", + "type": "[FQDNEndpointDetail]", + }, } def __init__( @@ -9544,15 +10036,10 @@ class FQDNEndpointDetail(msrest.serialization.Model): """ _attribute_map = { - 'port': {'key': 'port', 'type': 'int'}, + "port": {"key": "port", "type": "int"}, } - def __init__( - self, - *, - port: Optional[int] = None, - **kwargs - ): + def __init__(self, *, port: Optional[int] = None, **kwargs): """ :keyword port: :paramtype port: int @@ -9569,7 +10056,7 @@ class FQDNEndpoints(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'FQDNEndpointsProperties'}, + "properties": {"key": "properties", "type": "FQDNEndpointsProperties"}, } def __init__( @@ -9596,8 +10083,8 @@ class FQDNEndpointsProperties(msrest.serialization.Model): """ _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'endpoints': {'key': 'endpoints', 'type': '[FQDNEndpoint]'}, + "category": {"key": "category", "type": "str"}, + "endpoints": {"key": "endpoints", "type": "[FQDNEndpoint]"}, } def __init__( @@ -9631,21 +10118,20 @@ class GridSamplingAlgorithm(SamplingAlgorithm): """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(GridSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Grid' # type: str + self.sampling_algorithm_type = "Grid" # type: str class HDInsightSchema(msrest.serialization.Model): @@ -9656,14 +10142,11 @@ class HDInsightSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, + "properties": {"key": "properties", "type": "HDInsightProperties"}, } def __init__( - self, - *, - properties: Optional["HDInsightProperties"] = None, - **kwargs + self, *, properties: Optional["HDInsightProperties"] = None, **kwargs ): """ :keyword properties: HDInsight compute properties. @@ -9712,28 +10195,31 @@ class HDInsight(Compute, HDInsightSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + "disable_local_auth": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "HDInsightProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -9752,9 +10238,14 @@ def __init__( :keyword resource_id: ARM resource id of the underlying compute. :paramtype resource_id: str """ - super(HDInsight, self).__init__(description=description, resource_id=resource_id, properties=properties, **kwargs) + super(HDInsight, self).__init__( + description=description, + resource_id=resource_id, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'HDInsight' # type: str + self.compute_type = "HDInsight" # type: str self.compute_location = None self.provisioning_state = None self.description = description @@ -9779,9 +10270,12 @@ class HDInsightProperties(msrest.serialization.Model): """ _attribute_map = { - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, + "ssh_port": {"key": "sshPort", "type": "int"}, + "address": {"key": "address", "type": "str"}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, } def __init__( @@ -9820,27 +10314,22 @@ class IdAssetReference(AssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, - 'asset_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "reference_type": {"required": True}, + "asset_id": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'asset_id': {'key': 'assetId', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "asset_id": {"key": "assetId", "type": "str"}, } - def __init__( - self, - *, - asset_id: str, - **kwargs - ): + def __init__(self, *, asset_id: str, **kwargs): """ :keyword asset_id: Required. [Required] ARM resource ID of the asset. :paramtype asset_id: str """ super(IdAssetReference, self).__init__(**kwargs) - self.reference_type = 'Id' # type: str + self.reference_type = "Id" # type: str self.asset_id = asset_id @@ -9853,14 +10342,14 @@ class IdentityForCmk(msrest.serialization.Model): """ _attribute_map = { - 'user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, + "user_assigned_identity": { + "key": "userAssignedIdentity", + "type": "str", + }, } def __init__( - self, - *, - user_assigned_identity: Optional[str] = None, - **kwargs + self, *, user_assigned_identity: Optional[str] = None, **kwargs ): """ :keyword user_assigned_identity: The ArmId of the user assigned identity that will be used to @@ -9873,32 +10362,41 @@ def __init__( class ImageVertical(msrest.serialization.Model): """Abstract class for AutoML tasks that train image (computer vision) models - -such as Image Classification / Image Classification Multilabel / Image Object Detection / Image Instance Segmentation. + such as Image Classification / Image Classification Multilabel / Image Object Detection / Image Instance Segmentation. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float """ _validation = { - 'limit_settings': {'required': True}, + "limit_settings": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, } def __init__( @@ -9956,16 +10454,31 @@ class ImageClassificationBase(ImageVertical): """ _validation = { - 'limit_settings': {'required': True}, + "limit_settings": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsClassification", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsClassification]", + }, } def __init__( @@ -9976,7 +10489,9 @@ def __init__( validation_data: Optional["MLTableJobInput"] = None, validation_data_size: Optional[float] = None, model_settings: Optional["ImageModelSettingsClassification"] = None, - search_space: Optional[List["ImageModelDistributionSettingsClassification"]] = None, + search_space: Optional[ + List["ImageModelDistributionSettingsClassification"] + ] = None, **kwargs ): """ @@ -9999,73 +10514,94 @@ def __init__( :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] """ - super(ImageClassificationBase, self).__init__(limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, **kwargs) + super(ImageClassificationBase, self).__init__( + limit_settings=limit_settings, + sweep_settings=sweep_settings, + validation_data=validation_data, + validation_data_size=validation_data_size, + **kwargs + ) self.model_settings = model_settings self.search_space = search_space class ImageClassification(AutoMLVertical, ImageClassificationBase): """Image Classification. Multi-class image classification is used when an image is classified with only a single label -from a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' or a 'duck'. + from a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' or a 'duck'. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "limit_settings": {"required": True}, + "task_type": {"required": True}, + "training_data": {"required": True}, + } + + _attribute_map = { + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsClassification", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsClassification]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( @@ -10077,10 +10613,14 @@ def __init__( validation_data: Optional["MLTableJobInput"] = None, validation_data_size: Optional[float] = None, model_settings: Optional["ImageModelSettingsClassification"] = None, - search_space: Optional[List["ImageModelDistributionSettingsClassification"]] = None, + search_space: Optional[ + List["ImageModelDistributionSettingsClassification"] + ] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "ClassificationPrimaryMetrics"] + ] = None, **kwargs ): """ @@ -10116,14 +10656,25 @@ def __init__( :paramtype primary_metric: str or ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ - super(ImageClassification, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, model_settings=model_settings, search_space=search_space, **kwargs) + super(ImageClassification, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + limit_settings=limit_settings, + sweep_settings=sweep_settings, + validation_data=validation_data, + validation_data_size=validation_data_size, + model_settings=model_settings, + search_space=search_space, + **kwargs + ) self.limit_settings = limit_settings self.sweep_settings = sweep_settings self.validation_data = validation_data self.validation_data_size = validation_data_size self.model_settings = model_settings self.search_space = search_space - self.task_type = 'ImageClassification' # type: str + self.task_type = "ImageClassification" # type: str self.primary_metric = primary_metric self.log_verbosity = log_verbosity self.target_column_name = target_column_name @@ -10132,66 +10683,81 @@ def __init__( class ImageClassificationMultilabel(AutoMLVertical, ImageClassificationBase): """Image Classification Multilabel. Multi-label image classification is used when an image could have one or more labels -from a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'. + from a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted", "IOU". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics """ _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "limit_settings": {"required": True}, + "task_type": {"required": True}, + "training_data": {"required": True}, + } + + _attribute_map = { + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsClassification", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsClassification]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( @@ -10203,10 +10769,14 @@ def __init__( validation_data: Optional["MLTableJobInput"] = None, validation_data_size: Optional[float] = None, model_settings: Optional["ImageModelSettingsClassification"] = None, - search_space: Optional[List["ImageModelDistributionSettingsClassification"]] = None, + search_space: Optional[ + List["ImageModelDistributionSettingsClassification"] + ] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationMultilabelPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "ClassificationMultilabelPrimaryMetrics"] + ] = None, **kwargs ): """ @@ -10242,14 +10812,25 @@ def __init__( :paramtype primary_metric: str or ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics """ - super(ImageClassificationMultilabel, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, model_settings=model_settings, search_space=search_space, **kwargs) + super(ImageClassificationMultilabel, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + limit_settings=limit_settings, + sweep_settings=sweep_settings, + validation_data=validation_data, + validation_data_size=validation_data_size, + model_settings=model_settings, + search_space=search_space, + **kwargs + ) self.limit_settings = limit_settings self.sweep_settings = sweep_settings self.validation_data = validation_data self.validation_data_size = validation_data_size self.model_settings = model_settings self.search_space = search_space - self.task_type = 'ImageClassificationMultilabel' # type: str + self.task_type = "ImageClassificationMultilabel" # type: str self.primary_metric = primary_metric self.log_verbosity = log_verbosity self.target_column_name = target_column_name @@ -10282,16 +10863,31 @@ class ImageObjectDetectionBase(ImageVertical): """ _validation = { - 'limit_settings': {'required': True}, + "limit_settings": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsObjectDetection", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsObjectDetection]", + }, } def __init__( @@ -10302,7 +10898,9 @@ def __init__( validation_data: Optional["MLTableJobInput"] = None, validation_data_size: Optional[float] = None, model_settings: Optional["ImageModelSettingsObjectDetection"] = None, - search_space: Optional[List["ImageModelDistributionSettingsObjectDetection"]] = None, + search_space: Optional[ + List["ImageModelDistributionSettingsObjectDetection"] + ] = None, **kwargs ): """ @@ -10325,72 +10923,93 @@ def __init__( :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] """ - super(ImageObjectDetectionBase, self).__init__(limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, **kwargs) + super(ImageObjectDetectionBase, self).__init__( + limit_settings=limit_settings, + sweep_settings=sweep_settings, + validation_data=validation_data, + validation_data_size=validation_data_size, + **kwargs + ) self.model_settings = model_settings self.search_space = search_space class ImageInstanceSegmentation(AutoMLVertical, ImageObjectDetectionBase): """Image Instance Segmentation. Instance segmentation is used to identify objects in an image at the pixel level, -drawing a polygon around each object in the image. + drawing a polygon around each object in the image. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "MeanAveragePrecision". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics """ _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "limit_settings": {"required": True}, + "task_type": {"required": True}, + "training_data": {"required": True}, + } + + _attribute_map = { + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsObjectDetection", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsObjectDetection]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( @@ -10402,10 +11021,14 @@ def __init__( validation_data: Optional["MLTableJobInput"] = None, validation_data_size: Optional[float] = None, model_settings: Optional["ImageModelSettingsObjectDetection"] = None, - search_space: Optional[List["ImageModelDistributionSettingsObjectDetection"]] = None, + search_space: Optional[ + List["ImageModelDistributionSettingsObjectDetection"] + ] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "InstanceSegmentationPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "InstanceSegmentationPrimaryMetrics"] + ] = None, **kwargs ): """ @@ -10440,14 +11063,25 @@ def __init__( :paramtype primary_metric: str or ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics """ - super(ImageInstanceSegmentation, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, model_settings=model_settings, search_space=search_space, **kwargs) + super(ImageInstanceSegmentation, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + limit_settings=limit_settings, + sweep_settings=sweep_settings, + validation_data=validation_data, + validation_data_size=validation_data_size, + model_settings=model_settings, + search_space=search_space, + **kwargs + ) self.limit_settings = limit_settings self.sweep_settings = sweep_settings self.validation_data = validation_data self.validation_data_size = validation_data_size self.model_settings = model_settings self.search_space = search_space - self.task_type = 'ImageInstanceSegmentation' # type: str + self.task_type = "ImageInstanceSegmentation" # type: str self.primary_metric = primary_metric self.log_verbosity = log_verbosity self.target_column_name = target_column_name @@ -10466,9 +11100,9 @@ class ImageLimitSettings(msrest.serialization.Model): """ _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_trials": {"key": "maxTrials", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } def __init__( @@ -10496,129 +11130,147 @@ def __init__( class ImageModelDistributionSettings(msrest.serialization.Model): """Distribution expressions to sweep over values of model settings. -:code:` -Some examples are: - -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -` -All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) -where distribution name can be: uniform, quniform, loguniform, etc -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, + :code:` + Some examples are: + + ModelName = "choice('seresnext', 'resnest50')"; + LearningRate = "uniform(0.001, 0.01)"; + LayersToFreeze = "choice(0, 2)"; + ` + All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) + where distribution name can be: uniform, quniform, loguniform, etc + For more details on how to compose distribution expressions please check the documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: str + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: str + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: str + :ivar distributed: Whether to use distributer training. + :vartype distributed: str + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: str + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: str + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: str + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: str + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: str + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: str + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: str + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: str + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. + :vartype learning_rate_scheduler: str + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: str + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: str + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: str + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: str + :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. + :vartype optimizer: str + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: str + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: str + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: str + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: str + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: str + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: str + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: str + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: str + """ + + _attribute_map = { + "ams_gradient": {"key": "amsGradient", "type": "str"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "str"}, + "beta2": {"key": "beta2", "type": "str"}, + "distributed": {"key": "distributed", "type": "str"}, + "early_stopping": {"key": "earlyStopping", "type": "str"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "str"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "str", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "str", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "str"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "str", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "str"}, + "nesterov": {"key": "nesterov", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "str"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "str"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "str"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "str"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "str"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "str", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "str", + }, + "weight_decay": {"key": "weightDecay", "type": "str"}, } def __init__( @@ -10767,147 +11419,170 @@ def __init__( self.weight_decay = weight_decay -class ImageModelDistributionSettingsClassification(ImageModelDistributionSettings): +class ImageModelDistributionSettingsClassification( + ImageModelDistributionSettings +): """Distribution expressions to sweep over values of model settings. -:code:` -Some examples are: - -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: str - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: str - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: str - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'str'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'str'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'str'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'str'}, + :code:` + Some examples are: + + ModelName = "choice('seresnext', 'resnest50')"; + LearningRate = "uniform(0.001, 0.01)"; + LayersToFreeze = "choice(0, 2)"; + ` + For more details on how to compose distribution expressions please check the documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: str + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: str + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: str + :ivar distributed: Whether to use distributer training. + :vartype distributed: str + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: str + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: str + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: str + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: str + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: str + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: str + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: str + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: str + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. + :vartype learning_rate_scheduler: str + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: str + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: str + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: str + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: str + :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. + :vartype optimizer: str + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: str + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: str + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: str + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: str + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: str + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: str + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: str + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: str + :ivar training_crop_size: Image crop size that is input to the neural network for the training + dataset. Must be a positive integer. + :vartype training_crop_size: str + :ivar validation_crop_size: Image crop size that is input to the neural network for the + validation dataset. Must be a positive integer. + :vartype validation_crop_size: str + :ivar validation_resize_size: Image size to which to resize before cropping for validation + dataset. Must be a positive integer. + :vartype validation_resize_size: str + :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. + 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be + 0 or 1 or 2. + :vartype weighted_loss: str + """ + + _attribute_map = { + "ams_gradient": {"key": "amsGradient", "type": "str"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "str"}, + "beta2": {"key": "beta2", "type": "str"}, + "distributed": {"key": "distributed", "type": "str"}, + "early_stopping": {"key": "earlyStopping", "type": "str"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "str"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "str", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "str", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "str"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "str", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "str"}, + "nesterov": {"key": "nesterov", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "str"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "str"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "str"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "str"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "str"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "str", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "str", + }, + "weight_decay": {"key": "weightDecay", "type": "str"}, + "training_crop_size": {"key": "trainingCropSize", "type": "str"}, + "validation_crop_size": {"key": "validationCropSize", "type": "str"}, + "validation_resize_size": { + "key": "validationResizeSize", + "type": "str", + }, + "weighted_loss": {"key": "weightedLoss", "type": "str"}, } def __init__( @@ -11042,202 +11717,264 @@ def __init__( 0 or 1 or 2. :paramtype weighted_loss: str """ - super(ImageModelDistributionSettingsClassification, self).__init__(ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) + super(ImageModelDistributionSettingsClassification, self).__init__( + ams_gradient=ams_gradient, + augmentations=augmentations, + beta1=beta1, + beta2=beta2, + distributed=distributed, + early_stopping=early_stopping, + early_stopping_delay=early_stopping_delay, + early_stopping_patience=early_stopping_patience, + enable_onnx_normalization=enable_onnx_normalization, + evaluation_frequency=evaluation_frequency, + gradient_accumulation_step=gradient_accumulation_step, + layers_to_freeze=layers_to_freeze, + learning_rate=learning_rate, + learning_rate_scheduler=learning_rate_scheduler, + model_name=model_name, + momentum=momentum, + nesterov=nesterov, + number_of_epochs=number_of_epochs, + number_of_workers=number_of_workers, + optimizer=optimizer, + random_seed=random_seed, + step_lr_gamma=step_lr_gamma, + step_lr_step_size=step_lr_step_size, + training_batch_size=training_batch_size, + validation_batch_size=validation_batch_size, + warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, + warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, + weight_decay=weight_decay, + **kwargs + ) self.training_crop_size = training_crop_size self.validation_crop_size = validation_crop_size self.validation_resize_size = validation_resize_size self.weighted_loss = weighted_loss -class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettings): +class ImageModelDistributionSettingsObjectDetection( + ImageModelDistributionSettings +): """Distribution expressions to sweep over values of model settings. -:code:` -Some examples are: - -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: str - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: str - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: str - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: str - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: str - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype model_size: str - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: str - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - float in the range [0, 1]. - :vartype nms_iou_threshold: str - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: str - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - NMS: Non-maximum suppression. - :vartype tile_predictions_nms_threshold: str - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: str - :ivar validation_metric_type: Metric computation method to use for validation metrics. Must be - 'none', 'coco', 'voc', or 'coco_voc'. - :vartype validation_metric_type: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'str'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'str'}, - 'image_size': {'key': 'imageSize', 'type': 'str'}, - 'max_size': {'key': 'maxSize', 'type': 'str'}, - 'min_size': {'key': 'minSize', 'type': 'str'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'str'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'str'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'str'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'str'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'str'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, + :code:` + Some examples are: + + ModelName = "choice('seresnext', 'resnest50')"; + LearningRate = "uniform(0.001, 0.01)"; + LayersToFreeze = "choice(0, 2)"; + ` + For more details on how to compose distribution expressions please check the documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: str + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: str + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: str + :ivar distributed: Whether to use distributer training. + :vartype distributed: str + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: str + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: str + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: str + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: str + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: str + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: str + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: str + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: str + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. + :vartype learning_rate_scheduler: str + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: str + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: str + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: str + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: str + :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. + :vartype optimizer: str + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: str + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: str + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: str + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: str + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: str + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: str + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: str + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: str + :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must + be a positive integer. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype box_detections_per_image: str + :ivar box_score_threshold: During inference, only return proposals with a classification score + greater than + BoxScoreThreshold. Must be a float in the range[0, 1]. + :vartype box_score_threshold: str + :ivar image_size: Image size for train and validation. Must be a positive integer. + Note: The training run may get into CUDA OOM if the size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype image_size: str + :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype max_size: str + :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype min_size: str + :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. + Note: training run may get into CUDA OOM if the model size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype model_size: str + :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. + Note: training run may get into CUDA OOM if no sufficient GPU memory. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype multi_scale: str + :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be + float in the range [0, 1]. + :vartype nms_iou_threshold: str + :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not + be + None to enable small object detection logic. A string containing two integers in mxn format. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_grid_size: str + :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float + in the range [0, 1). + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_overlap_ratio: str + :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging + predictions from tiles and image. + Used in validation/ inference. Must be float in the range [0, 1]. + Note: This settings is not supported for the 'yolov5' algorithm. + NMS: Non-maximum suppression. + :vartype tile_predictions_nms_threshold: str + :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be + float in the range [0, 1]. + :vartype validation_iou_threshold: str + :ivar validation_metric_type: Metric computation method to use for validation metrics. Must be + 'none', 'coco', 'voc', or 'coco_voc'. + :vartype validation_metric_type: str + """ + + _attribute_map = { + "ams_gradient": {"key": "amsGradient", "type": "str"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "str"}, + "beta2": {"key": "beta2", "type": "str"}, + "distributed": {"key": "distributed", "type": "str"}, + "early_stopping": {"key": "earlyStopping", "type": "str"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "str"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "str", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "str", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "str"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "str", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "str"}, + "nesterov": {"key": "nesterov", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "str"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "str"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "str"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "str"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "str"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "str", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "str", + }, + "weight_decay": {"key": "weightDecay", "type": "str"}, + "box_detections_per_image": { + "key": "boxDetectionsPerImage", + "type": "str", + }, + "box_score_threshold": {"key": "boxScoreThreshold", "type": "str"}, + "image_size": {"key": "imageSize", "type": "str"}, + "max_size": {"key": "maxSize", "type": "str"}, + "min_size": {"key": "minSize", "type": "str"}, + "model_size": {"key": "modelSize", "type": "str"}, + "multi_scale": {"key": "multiScale", "type": "str"}, + "nms_iou_threshold": {"key": "nmsIouThreshold", "type": "str"}, + "tile_grid_size": {"key": "tileGridSize", "type": "str"}, + "tile_overlap_ratio": {"key": "tileOverlapRatio", "type": "str"}, + "tile_predictions_nms_threshold": { + "key": "tilePredictionsNmsThreshold", + "type": "str", + }, + "validation_iou_threshold": { + "key": "validationIouThreshold", + "type": "str", + }, + "validation_metric_type": { + "key": "validationMetricType", + "type": "str", + }, } def __init__( @@ -11420,7 +12157,37 @@ def __init__( be 'none', 'coco', 'voc', or 'coco_voc'. :paramtype validation_metric_type: str """ - super(ImageModelDistributionSettingsObjectDetection, self).__init__(ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) + super(ImageModelDistributionSettingsObjectDetection, self).__init__( + ams_gradient=ams_gradient, + augmentations=augmentations, + beta1=beta1, + beta2=beta2, + distributed=distributed, + early_stopping=early_stopping, + early_stopping_delay=early_stopping_delay, + early_stopping_patience=early_stopping_patience, + enable_onnx_normalization=enable_onnx_normalization, + evaluation_frequency=evaluation_frequency, + gradient_accumulation_step=gradient_accumulation_step, + layers_to_freeze=layers_to_freeze, + learning_rate=learning_rate, + learning_rate_scheduler=learning_rate_scheduler, + model_name=model_name, + momentum=momentum, + nesterov=nesterov, + number_of_epochs=number_of_epochs, + number_of_workers=number_of_workers, + optimizer=optimizer, + random_seed=random_seed, + step_lr_gamma=step_lr_gamma, + step_lr_step_size=step_lr_step_size, + training_batch_size=training_batch_size, + validation_batch_size=validation_batch_size, + warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, + warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, + weight_decay=weight_decay, + **kwargs + ) self.box_detections_per_image = box_detections_per_image self.box_score_threshold = box_score_threshold self.image_size = image_size @@ -11438,132 +12205,153 @@ def __init__( class ImageModelSettings(msrest.serialization.Model): """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar advanced_settings: Settings for advanced scenarios. + :vartype advanced_settings: str + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: bool + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: float + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: float + :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. + :vartype checkpoint_frequency: int + :ivar checkpoint_model: The pretrained checkpoint model for incremental training. + :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput + :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for + incremental training. + :vartype checkpoint_run_id: str + :ivar distributed: Whether to use distributed training. + :vartype distributed: bool + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: bool + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: int + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: int + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: bool + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: int + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: int + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: int + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: float + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. Possible values include: "None", "WarmupCosine", "Step". + :vartype learning_rate_scheduler: str or + ~azure.mgmt.machinelearningservices.models.LearningRateScheduler + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: float + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: bool + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: int + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: int + :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". + :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: int + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: float + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: int + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: int + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: int + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: float + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: int + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: float + """ + + _attribute_map = { + "advanced_settings": {"key": "advancedSettings", "type": "str"}, + "ams_gradient": {"key": "amsGradient", "type": "bool"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "float"}, + "beta2": {"key": "beta2", "type": "float"}, + "checkpoint_frequency": {"key": "checkpointFrequency", "type": "int"}, + "checkpoint_model": { + "key": "checkpointModel", + "type": "MLFlowModelJobInput", + }, + "checkpoint_run_id": {"key": "checkpointRunId", "type": "str"}, + "distributed": {"key": "distributed", "type": "bool"}, + "early_stopping": {"key": "earlyStopping", "type": "bool"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "int"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "int", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "bool", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "int"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "int", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "int"}, + "learning_rate": {"key": "learningRate", "type": "float"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "float"}, + "nesterov": {"key": "nesterov", "type": "bool"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "int"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "int"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "int"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "float"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "int"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "float", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "int", + }, + "weight_decay": {"key": "weightDecay", "type": "float"}, } def __init__( @@ -11586,7 +12374,9 @@ def __init__( gradient_accumulation_step: Optional[int] = None, layers_to_freeze: Optional[int] = None, learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "LearningRateScheduler"]] = None, + learning_rate_scheduler: Optional[ + Union[str, "LearningRateScheduler"] + ] = None, model_name: Optional[str] = None, momentum: Optional[float] = None, nesterov: Optional[bool] = None, @@ -11733,149 +12523,173 @@ def __init__( class ImageModelSettingsClassification(ImageModelSettings): """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: int - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: int - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: int - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: int - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'int'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'int'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'int'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'int'}, + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar advanced_settings: Settings for advanced scenarios. + :vartype advanced_settings: str + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: bool + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: float + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: float + :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. + :vartype checkpoint_frequency: int + :ivar checkpoint_model: The pretrained checkpoint model for incremental training. + :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput + :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for + incremental training. + :vartype checkpoint_run_id: str + :ivar distributed: Whether to use distributed training. + :vartype distributed: bool + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: bool + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: int + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: int + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: bool + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: int + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: int + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: int + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: float + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. Possible values include: "None", "WarmupCosine", "Step". + :vartype learning_rate_scheduler: str or + ~azure.mgmt.machinelearningservices.models.LearningRateScheduler + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: float + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: bool + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: int + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: int + :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". + :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: int + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: float + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: int + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: int + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: int + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: float + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: int + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: float + :ivar training_crop_size: Image crop size that is input to the neural network for the training + dataset. Must be a positive integer. + :vartype training_crop_size: int + :ivar validation_crop_size: Image crop size that is input to the neural network for the + validation dataset. Must be a positive integer. + :vartype validation_crop_size: int + :ivar validation_resize_size: Image size to which to resize before cropping for validation + dataset. Must be a positive integer. + :vartype validation_resize_size: int + :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. + 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be + 0 or 1 or 2. + :vartype weighted_loss: int + """ + + _attribute_map = { + "advanced_settings": {"key": "advancedSettings", "type": "str"}, + "ams_gradient": {"key": "amsGradient", "type": "bool"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "float"}, + "beta2": {"key": "beta2", "type": "float"}, + "checkpoint_frequency": {"key": "checkpointFrequency", "type": "int"}, + "checkpoint_model": { + "key": "checkpointModel", + "type": "MLFlowModelJobInput", + }, + "checkpoint_run_id": {"key": "checkpointRunId", "type": "str"}, + "distributed": {"key": "distributed", "type": "bool"}, + "early_stopping": {"key": "earlyStopping", "type": "bool"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "int"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "int", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "bool", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "int"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "int", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "int"}, + "learning_rate": {"key": "learningRate", "type": "float"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "float"}, + "nesterov": {"key": "nesterov", "type": "bool"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "int"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "int"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "int"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "float"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "int"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "float", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "int", + }, + "weight_decay": {"key": "weightDecay", "type": "float"}, + "training_crop_size": {"key": "trainingCropSize", "type": "int"}, + "validation_crop_size": {"key": "validationCropSize", "type": "int"}, + "validation_resize_size": { + "key": "validationResizeSize", + "type": "int", + }, + "weighted_loss": {"key": "weightedLoss", "type": "int"}, } def __init__( @@ -11898,7 +12712,9 @@ def __init__( gradient_accumulation_step: Optional[int] = None, layers_to_freeze: Optional[int] = None, learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "LearningRateScheduler"]] = None, + learning_rate_scheduler: Optional[ + Union[str, "LearningRateScheduler"] + ] = None, model_name: Optional[str] = None, momentum: Optional[float] = None, nesterov: Optional[bool] = None, @@ -12025,7 +12841,41 @@ def __init__( 0 or 1 or 2. :paramtype weighted_loss: int """ - super(ImageModelSettingsClassification, self).__init__(advanced_settings=advanced_settings, ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, checkpoint_frequency=checkpoint_frequency, checkpoint_model=checkpoint_model, checkpoint_run_id=checkpoint_run_id, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) + super(ImageModelSettingsClassification, self).__init__( + advanced_settings=advanced_settings, + ams_gradient=ams_gradient, + augmentations=augmentations, + beta1=beta1, + beta2=beta2, + checkpoint_frequency=checkpoint_frequency, + checkpoint_model=checkpoint_model, + checkpoint_run_id=checkpoint_run_id, + distributed=distributed, + early_stopping=early_stopping, + early_stopping_delay=early_stopping_delay, + early_stopping_patience=early_stopping_patience, + enable_onnx_normalization=enable_onnx_normalization, + evaluation_frequency=evaluation_frequency, + gradient_accumulation_step=gradient_accumulation_step, + layers_to_freeze=layers_to_freeze, + learning_rate=learning_rate, + learning_rate_scheduler=learning_rate_scheduler, + model_name=model_name, + momentum=momentum, + nesterov=nesterov, + number_of_epochs=number_of_epochs, + number_of_workers=number_of_workers, + optimizer=optimizer, + random_seed=random_seed, + step_lr_gamma=step_lr_gamma, + step_lr_step_size=step_lr_step_size, + training_batch_size=training_batch_size, + validation_batch_size=validation_batch_size, + warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, + warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, + weight_decay=weight_decay, + **kwargs + ) self.training_crop_size = training_crop_size self.validation_crop_size = validation_crop_size self.validation_resize_size = validation_resize_size @@ -12034,198 +12884,231 @@ def __init__( class ImageModelSettingsObjectDetection(ImageModelSettings): """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: int - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: float - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: int - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: int - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: int - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: - "None", "Small", "Medium", "Large", "ExtraLarge". - :vartype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: bool - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be a - float in the range [0, 1]. - :vartype nms_iou_threshold: float - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: float - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_predictions_nms_threshold: float - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: float - :ivar validation_metric_type: Metric computation method to use for validation metrics. Possible - values include: "None", "Coco", "Voc", "CocoVoc". - :vartype validation_metric_type: str or - ~azure.mgmt.machinelearningservices.models.ValidationMetricType - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'int'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'float'}, - 'image_size': {'key': 'imageSize', 'type': 'int'}, - 'max_size': {'key': 'maxSize', 'type': 'int'}, - 'min_size': {'key': 'minSize', 'type': 'int'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'bool'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'float'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'float'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'float'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'float'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar advanced_settings: Settings for advanced scenarios. + :vartype advanced_settings: str + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: bool + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: float + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: float + :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. + :vartype checkpoint_frequency: int + :ivar checkpoint_model: The pretrained checkpoint model for incremental training. + :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput + :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for + incremental training. + :vartype checkpoint_run_id: str + :ivar distributed: Whether to use distributed training. + :vartype distributed: bool + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: bool + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: int + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: int + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: bool + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: int + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: int + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: int + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: float + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. Possible values include: "None", "WarmupCosine", "Step". + :vartype learning_rate_scheduler: str or + ~azure.mgmt.machinelearningservices.models.LearningRateScheduler + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: float + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: bool + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: int + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: int + :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". + :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: int + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: float + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: int + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: int + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: int + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: float + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: int + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: float + :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must + be a positive integer. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype box_detections_per_image: int + :ivar box_score_threshold: During inference, only return proposals with a classification score + greater than + BoxScoreThreshold. Must be a float in the range[0, 1]. + :vartype box_score_threshold: float + :ivar image_size: Image size for train and validation. Must be a positive integer. + Note: The training run may get into CUDA OOM if the size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype image_size: int + :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype max_size: int + :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype min_size: int + :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. + Note: training run may get into CUDA OOM if the model size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: + "None", "Small", "Medium", "Large", "ExtraLarge". + :vartype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize + :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. + Note: training run may get into CUDA OOM if no sufficient GPU memory. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype multi_scale: bool + :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be a + float in the range [0, 1]. + :vartype nms_iou_threshold: float + :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not + be + None to enable small object detection logic. A string containing two integers in mxn format. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_grid_size: str + :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float + in the range [0, 1). + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_overlap_ratio: float + :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging + predictions from tiles and image. + Used in validation/ inference. Must be float in the range [0, 1]. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_predictions_nms_threshold: float + :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be + float in the range [0, 1]. + :vartype validation_iou_threshold: float + :ivar validation_metric_type: Metric computation method to use for validation metrics. Possible + values include: "None", "Coco", "Voc", "CocoVoc". + :vartype validation_metric_type: str or + ~azure.mgmt.machinelearningservices.models.ValidationMetricType + """ + + _attribute_map = { + "advanced_settings": {"key": "advancedSettings", "type": "str"}, + "ams_gradient": {"key": "amsGradient", "type": "bool"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "float"}, + "beta2": {"key": "beta2", "type": "float"}, + "checkpoint_frequency": {"key": "checkpointFrequency", "type": "int"}, + "checkpoint_model": { + "key": "checkpointModel", + "type": "MLFlowModelJobInput", + }, + "checkpoint_run_id": {"key": "checkpointRunId", "type": "str"}, + "distributed": {"key": "distributed", "type": "bool"}, + "early_stopping": {"key": "earlyStopping", "type": "bool"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "int"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "int", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "bool", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "int"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "int", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "int"}, + "learning_rate": {"key": "learningRate", "type": "float"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "float"}, + "nesterov": {"key": "nesterov", "type": "bool"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "int"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "int"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "int"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "float"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "int"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "float", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "int", + }, + "weight_decay": {"key": "weightDecay", "type": "float"}, + "box_detections_per_image": { + "key": "boxDetectionsPerImage", + "type": "int", + }, + "box_score_threshold": {"key": "boxScoreThreshold", "type": "float"}, + "image_size": {"key": "imageSize", "type": "int"}, + "max_size": {"key": "maxSize", "type": "int"}, + "min_size": {"key": "minSize", "type": "int"}, + "model_size": {"key": "modelSize", "type": "str"}, + "multi_scale": {"key": "multiScale", "type": "bool"}, + "nms_iou_threshold": {"key": "nmsIouThreshold", "type": "float"}, + "tile_grid_size": {"key": "tileGridSize", "type": "str"}, + "tile_overlap_ratio": {"key": "tileOverlapRatio", "type": "float"}, + "tile_predictions_nms_threshold": { + "key": "tilePredictionsNmsThreshold", + "type": "float", + }, + "validation_iou_threshold": { + "key": "validationIouThreshold", + "type": "float", + }, + "validation_metric_type": { + "key": "validationMetricType", + "type": "str", + }, } def __init__( @@ -12248,7 +13131,9 @@ def __init__( gradient_accumulation_step: Optional[int] = None, layers_to_freeze: Optional[int] = None, learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "LearningRateScheduler"]] = None, + learning_rate_scheduler: Optional[ + Union[str, "LearningRateScheduler"] + ] = None, model_name: Optional[str] = None, momentum: Optional[float] = None, nesterov: Optional[bool] = None, @@ -12275,7 +13160,9 @@ def __init__( tile_overlap_ratio: Optional[float] = None, tile_predictions_nms_threshold: Optional[float] = None, validation_iou_threshold: Optional[float] = None, - validation_metric_type: Optional[Union[str, "ValidationMetricType"]] = None, + validation_metric_type: Optional[ + Union[str, "ValidationMetricType"] + ] = None, **kwargs ): """ @@ -12424,7 +13311,41 @@ def __init__( :paramtype validation_metric_type: str or ~azure.mgmt.machinelearningservices.models.ValidationMetricType """ - super(ImageModelSettingsObjectDetection, self).__init__(advanced_settings=advanced_settings, ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, checkpoint_frequency=checkpoint_frequency, checkpoint_model=checkpoint_model, checkpoint_run_id=checkpoint_run_id, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) + super(ImageModelSettingsObjectDetection, self).__init__( + advanced_settings=advanced_settings, + ams_gradient=ams_gradient, + augmentations=augmentations, + beta1=beta1, + beta2=beta2, + checkpoint_frequency=checkpoint_frequency, + checkpoint_model=checkpoint_model, + checkpoint_run_id=checkpoint_run_id, + distributed=distributed, + early_stopping=early_stopping, + early_stopping_delay=early_stopping_delay, + early_stopping_patience=early_stopping_patience, + enable_onnx_normalization=enable_onnx_normalization, + evaluation_frequency=evaluation_frequency, + gradient_accumulation_step=gradient_accumulation_step, + layers_to_freeze=layers_to_freeze, + learning_rate=learning_rate, + learning_rate_scheduler=learning_rate_scheduler, + model_name=model_name, + momentum=momentum, + nesterov=nesterov, + number_of_epochs=number_of_epochs, + number_of_workers=number_of_workers, + optimizer=optimizer, + random_seed=random_seed, + step_lr_gamma=step_lr_gamma, + step_lr_step_size=step_lr_step_size, + training_batch_size=training_batch_size, + validation_batch_size=validation_batch_size, + warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, + warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, + weight_decay=weight_decay, + **kwargs + ) self.box_detections_per_image = box_detections_per_image self.box_score_threshold = box_score_threshold self.image_size = image_size @@ -12442,65 +13363,80 @@ def __init__( class ImageObjectDetection(AutoMLVertical, ImageObjectDetectionBase): """Image Object Detection. Object detection is used to identify objects in an image and locate each object with a -bounding box e.g. locate all dogs and cats in an image and draw a bounding box around each. + bounding box e.g. locate all dogs and cats in an image and draw a bounding box around each. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "MeanAveragePrecision". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics """ _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "limit_settings": {"required": True}, + "task_type": {"required": True}, + "training_data": {"required": True}, + } + + _attribute_map = { + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsObjectDetection", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsObjectDetection]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( @@ -12512,10 +13448,14 @@ def __init__( validation_data: Optional["MLTableJobInput"] = None, validation_data_size: Optional[float] = None, model_settings: Optional["ImageModelSettingsObjectDetection"] = None, - search_space: Optional[List["ImageModelDistributionSettingsObjectDetection"]] = None, + search_space: Optional[ + List["ImageModelDistributionSettingsObjectDetection"] + ] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ObjectDetectionPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "ObjectDetectionPrimaryMetrics"] + ] = None, **kwargs ): """ @@ -12550,14 +13490,25 @@ def __init__( :paramtype primary_metric: str or ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics """ - super(ImageObjectDetection, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, model_settings=model_settings, search_space=search_space, **kwargs) + super(ImageObjectDetection, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + limit_settings=limit_settings, + sweep_settings=sweep_settings, + validation_data=validation_data, + validation_data_size=validation_data_size, + model_settings=model_settings, + search_space=search_space, + **kwargs + ) self.limit_settings = limit_settings self.sweep_settings = sweep_settings self.validation_data = validation_data self.validation_data_size = validation_data_size self.model_settings = model_settings self.search_space = search_space - self.task_type = 'ImageObjectDetection' # type: str + self.task_type = "ImageObjectDetection" # type: str self.primary_metric = primary_metric self.log_verbosity = log_verbosity self.target_column_name = target_column_name @@ -12578,12 +13529,15 @@ class ImageSweepSettings(msrest.serialization.Model): """ _validation = { - 'sampling_algorithm': {'required': True}, + "sampling_algorithm": {"required": True}, } _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, + "sampling_algorithm": {"key": "samplingAlgorithm", "type": "str"}, } def __init__( @@ -12619,9 +13573,9 @@ class InferenceContainerProperties(msrest.serialization.Model): """ _attribute_map = { - 'liveness_route': {'key': 'livenessRoute', 'type': 'Route'}, - 'readiness_route': {'key': 'readinessRoute', 'type': 'Route'}, - 'scoring_route': {'key': 'scoringRoute', 'type': 'Route'}, + "liveness_route": {"key": "livenessRoute", "type": "Route"}, + "readiness_route": {"key": "readinessRoute", "type": "Route"}, + "scoring_route": {"key": "scoringRoute", "type": "Route"}, } def __init__( @@ -12657,8 +13611,11 @@ class InstanceTypeSchema(msrest.serialization.Model): """ _attribute_map = { - 'node_selector': {'key': 'nodeSelector', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'InstanceTypeSchemaResources'}, + "node_selector": {"key": "nodeSelector", "type": "{str}"}, + "resources": { + "key": "resources", + "type": "InstanceTypeSchemaResources", + }, } def __init__( @@ -12689,8 +13646,8 @@ class InstanceTypeSchemaResources(msrest.serialization.Model): """ _attribute_map = { - 'requests': {'key': 'requests', 'type': '{str}'}, - 'limits': {'key': 'limits', 'type': '{str}'}, + "requests": {"key": "requests", "type": "{str}"}, + "limits": {"key": "limits", "type": "{str}"}, } def __init__( @@ -12734,27 +13691,22 @@ class JobBase(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'JobBaseProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "JobBaseProperties"}, } - def __init__( - self, - *, - properties: "JobBaseProperties", - **kwargs - ): + def __init__(self, *, properties: "JobBaseProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.JobBaseProperties @@ -12774,8 +13726,8 @@ class JobBaseResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[JobBase]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[JobBase]"}, } def __init__( @@ -12817,15 +13769,15 @@ class JobResourceConfiguration(ResourceConfiguration): """ _validation = { - 'shm_size': {'pattern': r'\d+[bBkKmMgG]'}, + "shm_size": {"pattern": r"\d+[bBkKmMgG]"}, } _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - 'docker_args': {'key': 'dockerArgs', 'type': 'str'}, - 'shm_size': {'key': 'shmSize', 'type': 'str'}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "properties": {"key": "properties", "type": "{object}"}, + "docker_args": {"key": "dockerArgs", "type": "str"}, + "shm_size": {"key": "shmSize", "type": "str"}, } def __init__( @@ -12854,7 +13806,12 @@ def __init__( b(bytes), k(kilobytes), m(megabytes), or g(gigabytes). :paramtype shm_size: str """ - super(JobResourceConfiguration, self).__init__(instance_count=instance_count, instance_type=instance_type, properties=properties, **kwargs) + super(JobResourceConfiguration, self).__init__( + instance_count=instance_count, + instance_type=instance_type, + properties=properties, + **kwargs + ) self.docker_args = docker_args self.shm_size = shm_size @@ -12872,27 +13829,25 @@ class JobScheduleAction(ScheduleActionBase): """ _validation = { - 'action_type': {'required': True}, - 'job_definition': {'required': True}, + "action_type": {"required": True}, + "job_definition": {"required": True}, } _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'job_definition': {'key': 'jobDefinition', 'type': 'JobBaseProperties'}, + "action_type": {"key": "actionType", "type": "str"}, + "job_definition": { + "key": "jobDefinition", + "type": "JobBaseProperties", + }, } - def __init__( - self, - *, - job_definition: "JobBaseProperties", - **kwargs - ): + def __init__(self, *, job_definition: "JobBaseProperties", **kwargs): """ :keyword job_definition: Required. [Required] Defines Schedule action definition details. :paramtype job_definition: ~azure.mgmt.machinelearningservices.models.JobBaseProperties """ super(JobScheduleAction, self).__init__(**kwargs) - self.action_type = 'CreateJob' # type: str + self.action_type = "CreateJob" # type: str self.job_definition = job_definition @@ -12916,17 +13871,17 @@ class JobService(msrest.serialization.Model): """ _validation = { - 'error_message': {'readonly': True}, - 'status': {'readonly': True}, + "error_message": {"readonly": True}, + "status": {"readonly": True}, } _attribute_map = { - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'job_service_type': {'key': 'jobServiceType', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'status': {'key': 'status', 'type': 'str'}, + "endpoint": {"key": "endpoint", "type": "str"}, + "error_message": {"key": "errorMessage", "type": "str"}, + "job_service_type": {"key": "jobServiceType", "type": "str"}, + "port": {"key": "port", "type": "int"}, + "properties": {"key": "properties", "type": "{str}"}, + "status": {"key": "status", "type": "str"}, } def __init__( @@ -12965,14 +13920,11 @@ class KubernetesSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, + "properties": {"key": "properties", "type": "KubernetesProperties"}, } def __init__( - self, - *, - properties: Optional["KubernetesProperties"] = None, - **kwargs + self, *, properties: Optional["KubernetesProperties"] = None, **kwargs ): """ :keyword properties: Properties of Kubernetes. @@ -13021,28 +13973,31 @@ class Kubernetes(Compute, KubernetesSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + "disable_local_auth": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "KubernetesProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -13061,9 +14016,14 @@ def __init__( :keyword resource_id: ARM resource id of the underlying compute. :paramtype resource_id: str """ - super(Kubernetes, self).__init__(description=description, resource_id=resource_id, properties=properties, **kwargs) + super(Kubernetes, self).__init__( + description=description, + resource_id=resource_id, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'Kubernetes' # type: str + self.compute_type = "Kubernetes" # type: str self.compute_location = None self.provisioning_state = None self.description = description @@ -13132,31 +14092,49 @@ class OnlineDeploymentProperties(EndpointDeploymentPropertiesBase): """ _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, + "endpoint_compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, + "egress_public_network_access": { + "key": "egressPublicNetworkAccess", + "type": "str", + }, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, + "model": {"key": "model", "type": "str"}, + "model_mount_path": {"key": "modelMountPath", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, } _subtype_map = { - 'endpoint_compute_type': {'Kubernetes': 'KubernetesOnlineDeployment', 'Managed': 'ManagedOnlineDeployment'} + "endpoint_compute_type": { + "Kubernetes": "KubernetesOnlineDeployment", + "Managed": "ManagedOnlineDeployment", + } } def __init__( @@ -13168,7 +14146,9 @@ def __init__( environment_variables: Optional[Dict[str, str]] = None, properties: Optional[Dict[str, str]] = None, app_insights_enabled: Optional[bool] = False, - egress_public_network_access: Optional[Union[str, "EgressPublicNetworkAccessType"]] = None, + egress_public_network_access: Optional[ + Union[str, "EgressPublicNetworkAccessType"] + ] = None, instance_type: Optional[str] = None, liveness_probe: Optional["ProbeSettings"] = None, model: Optional[str] = None, @@ -13216,10 +14196,17 @@ def __init__( and to DefaultScaleSettings for ManagedOnlineDeployment. :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings """ - super(OnlineDeploymentProperties, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, **kwargs) + super(OnlineDeploymentProperties, self).__init__( + code_configuration=code_configuration, + description=description, + environment_id=environment_id, + environment_variables=environment_variables, + properties=properties, + **kwargs + ) self.app_insights_enabled = app_insights_enabled self.egress_public_network_access = egress_public_network_access - self.endpoint_compute_type = 'OnlineDeploymentProperties' # type: str + self.endpoint_compute_type = "OnlineDeploymentProperties" # type: str self.instance_type = instance_type self.liveness_probe = liveness_probe self.model = model @@ -13288,28 +14275,46 @@ class KubernetesOnlineDeployment(OnlineDeploymentProperties): """ _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - 'container_resource_requirements': {'key': 'containerResourceRequirements', 'type': 'ContainerResourceRequirements'}, + "endpoint_compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, + "egress_public_network_access": { + "key": "egressPublicNetworkAccess", + "type": "str", + }, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, + "model": {"key": "model", "type": "str"}, + "model_mount_path": {"key": "modelMountPath", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, + "container_resource_requirements": { + "key": "containerResourceRequirements", + "type": "ContainerResourceRequirements", + }, } def __init__( @@ -13321,7 +14326,9 @@ def __init__( environment_variables: Optional[Dict[str, str]] = None, properties: Optional[Dict[str, str]] = None, app_insights_enabled: Optional[bool] = False, - egress_public_network_access: Optional[Union[str, "EgressPublicNetworkAccessType"]] = None, + egress_public_network_access: Optional[ + Union[str, "EgressPublicNetworkAccessType"] + ] = None, instance_type: Optional[str] = None, liveness_probe: Optional["ProbeSettings"] = None, model: Optional[str] = None, @@ -13329,7 +14336,9 @@ def __init__( readiness_probe: Optional["ProbeSettings"] = None, request_settings: Optional["OnlineRequestSettings"] = None, scale_settings: Optional["OnlineScaleSettings"] = None, - container_resource_requirements: Optional["ContainerResourceRequirements"] = None, + container_resource_requirements: Optional[ + "ContainerResourceRequirements" + ] = None, **kwargs ): """ @@ -13374,8 +14383,24 @@ def __init__( :paramtype container_resource_requirements: ~azure.mgmt.machinelearningservices.models.ContainerResourceRequirements """ - super(KubernetesOnlineDeployment, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, app_insights_enabled=app_insights_enabled, egress_public_network_access=egress_public_network_access, instance_type=instance_type, liveness_probe=liveness_probe, model=model, model_mount_path=model_mount_path, readiness_probe=readiness_probe, request_settings=request_settings, scale_settings=scale_settings, **kwargs) - self.endpoint_compute_type = 'Kubernetes' # type: str + super(KubernetesOnlineDeployment, self).__init__( + code_configuration=code_configuration, + description=description, + environment_id=environment_id, + environment_variables=environment_variables, + properties=properties, + app_insights_enabled=app_insights_enabled, + egress_public_network_access=egress_public_network_access, + instance_type=instance_type, + liveness_probe=liveness_probe, + model=model, + model_mount_path=model_mount_path, + readiness_probe=readiness_probe, + request_settings=request_settings, + scale_settings=scale_settings, + **kwargs + ) + self.endpoint_compute_type = "Kubernetes" # type: str self.container_resource_requirements = container_resource_requirements @@ -13402,14 +14427,29 @@ class KubernetesProperties(msrest.serialization.Model): """ _attribute_map = { - 'relay_connection_string': {'key': 'relayConnectionString', 'type': 'str'}, - 'service_bus_connection_string': {'key': 'serviceBusConnectionString', 'type': 'str'}, - 'extension_principal_id': {'key': 'extensionPrincipalId', 'type': 'str'}, - 'extension_instance_release_train': {'key': 'extensionInstanceReleaseTrain', 'type': 'str'}, - 'vc_name': {'key': 'vcName', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'default_instance_type': {'key': 'defaultInstanceType', 'type': 'str'}, - 'instance_types': {'key': 'instanceTypes', 'type': '{InstanceTypeSchema}'}, + "relay_connection_string": { + "key": "relayConnectionString", + "type": "str", + }, + "service_bus_connection_string": { + "key": "serviceBusConnectionString", + "type": "str", + }, + "extension_principal_id": { + "key": "extensionPrincipalId", + "type": "str", + }, + "extension_instance_release_train": { + "key": "extensionInstanceReleaseTrain", + "type": "str", + }, + "vc_name": {"key": "vcName", "type": "str"}, + "namespace": {"key": "namespace", "type": "str"}, + "default_instance_type": {"key": "defaultInstanceType", "type": "str"}, + "instance_types": { + "key": "instanceTypes", + "type": "{InstanceTypeSchema}", + }, } def __init__( @@ -13448,7 +14488,9 @@ def __init__( self.relay_connection_string = relay_connection_string self.service_bus_connection_string = service_bus_connection_string self.extension_principal_id = extension_principal_id - self.extension_instance_release_train = extension_instance_release_train + self.extension_instance_release_train = ( + extension_instance_release_train + ) self.vc_name = vc_name self.namespace = namespace self.default_instance_type = default_instance_type @@ -13468,21 +14510,17 @@ class ListAmlUserFeatureResult(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlUserFeature]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[AmlUserFeature]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListAmlUserFeatureResult, self).__init__(**kwargs) self.value = None self.next_link = None @@ -13500,21 +14538,17 @@ class ListNotebookKeysResult(msrest.serialization.Model): """ _validation = { - 'primary_access_key': {'readonly': True}, - 'secondary_access_key': {'readonly': True}, + "primary_access_key": {"readonly": True}, + "secondary_access_key": {"readonly": True}, } _attribute_map = { - 'primary_access_key': {'key': 'primaryAccessKey', 'type': 'str'}, - 'secondary_access_key': {'key': 'secondaryAccessKey', 'type': 'str'}, + "primary_access_key": {"key": "primaryAccessKey", "type": "str"}, + "secondary_access_key": {"key": "secondaryAccessKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListNotebookKeysResult, self).__init__(**kwargs) self.primary_access_key = None self.secondary_access_key = None @@ -13530,19 +14564,15 @@ class ListStorageAccountKeysResult(msrest.serialization.Model): """ _validation = { - 'user_storage_key': {'readonly': True}, + "user_storage_key": {"readonly": True}, } _attribute_map = { - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, + "user_storage_key": {"key": "userStorageKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListStorageAccountKeysResult, self).__init__(**kwargs) self.user_storage_key = None @@ -13560,21 +14590,17 @@ class ListUsagesResult(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[Usage]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Usage]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListUsagesResult, self).__init__(**kwargs) self.value = None self.next_link = None @@ -13600,27 +14626,35 @@ class ListWorkspaceKeysResult(msrest.serialization.Model): """ _validation = { - 'user_storage_key': {'readonly': True}, - 'user_storage_resource_id': {'readonly': True}, - 'app_insights_instrumentation_key': {'readonly': True}, - 'container_registry_credentials': {'readonly': True}, - 'notebook_access_keys': {'readonly': True}, - } - - _attribute_map = { - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, - 'user_storage_resource_id': {'key': 'userStorageResourceId', 'type': 'str'}, - 'app_insights_instrumentation_key': {'key': 'appInsightsInstrumentationKey', 'type': 'str'}, - 'container_registry_credentials': {'key': 'containerRegistryCredentials', 'type': 'RegistryListCredentialsResult'}, - 'notebook_access_keys': {'key': 'notebookAccessKeys', 'type': 'ListNotebookKeysResult'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ + "user_storage_key": {"readonly": True}, + "user_storage_resource_id": {"readonly": True}, + "app_insights_instrumentation_key": {"readonly": True}, + "container_registry_credentials": {"readonly": True}, + "notebook_access_keys": {"readonly": True}, + } + + _attribute_map = { + "user_storage_key": {"key": "userStorageKey", "type": "str"}, + "user_storage_resource_id": { + "key": "userStorageResourceId", + "type": "str", + }, + "app_insights_instrumentation_key": { + "key": "appInsightsInstrumentationKey", + "type": "str", + }, + "container_registry_credentials": { + "key": "containerRegistryCredentials", + "type": "RegistryListCredentialsResult", + }, + "notebook_access_keys": { + "key": "notebookAccessKeys", + "type": "ListNotebookKeysResult", + }, + } + + def __init__(self, **kwargs): + """ """ super(ListWorkspaceKeysResult, self).__init__(**kwargs) self.user_storage_key = None self.user_storage_resource_id = None @@ -13642,21 +14676,17 @@ class ListWorkspaceQuotas(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[ResourceQuota]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[ResourceQuota]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListWorkspaceQuotas, self).__init__(**kwargs) self.value = None self.next_link = None @@ -13678,22 +14708,18 @@ class LiteralJobInput(JobInput): """ _validation = { - 'job_input_type': {'required': True}, - 'value': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "job_input_type": {"required": True}, + "value": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, + "value": {"key": "value", "type": "str"}, } def __init__( - self, - *, - value: str, - description: Optional[str] = None, - **kwargs + self, *, value: str, description: Optional[str] = None, **kwargs ): """ :keyword description: Description for the input. @@ -13701,8 +14727,10 @@ def __init__( :keyword value: Required. [Required] Literal value for the input. :paramtype value: str """ - super(LiteralJobInput, self).__init__(description=description, **kwargs) - self.job_input_type = 'literal' # type: str + super(LiteralJobInput, self).__init__( + description=description, **kwargs + ) + self.job_input_type = "literal" # type: str self.value = value @@ -13727,14 +14755,14 @@ class ManagedIdentity(IdentityConfiguration): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + "object_id": {"key": "objectId", "type": "str"}, + "resource_id": {"key": "resourceId", "type": "str"}, } def __init__( @@ -13757,7 +14785,7 @@ def __init__( :paramtype resource_id: str """ super(ManagedIdentity, self).__init__(**kwargs) - self.identity_type = 'Managed' # type: str + self.identity_type = "Managed" # type: str self.client_id = client_id self.object_id = object_id self.resource_id = resource_id @@ -13786,19 +14814,25 @@ class WorkspaceConnectionPropertiesV2(msrest.serialization.Model): """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, } _subtype_map = { - 'auth_type': {'ManagedIdentity': 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', 'None': 'NoneAuthTypeWorkspaceConnectionProperties', 'PAT': 'PATAuthTypeWorkspaceConnectionProperties', 'SAS': 'SASAuthTypeWorkspaceConnectionProperties', 'UsernamePassword': 'UsernamePasswordAuthTypeWorkspaceConnectionProperties'} + "auth_type": { + "ManagedIdentity": "ManagedIdentityAuthTypeWorkspaceConnectionProperties", + "None": "NoneAuthTypeWorkspaceConnectionProperties", + "PAT": "PATAuthTypeWorkspaceConnectionProperties", + "SAS": "SASAuthTypeWorkspaceConnectionProperties", + "UsernamePassword": "UsernamePasswordAuthTypeWorkspaceConnectionProperties", + } } def __init__( @@ -13830,7 +14864,9 @@ def __init__( self.value_format = value_format -class ManagedIdentityAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class ManagedIdentityAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """ManagedIdentityAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -13853,16 +14889,19 @@ class ManagedIdentityAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPr """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionManagedIdentity'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionManagedIdentity", + }, } def __init__( @@ -13890,8 +14929,16 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity """ - super(ManagedIdentityAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'ManagedIdentity' # type: str + super( + ManagedIdentityAuthTypeWorkspaceConnectionProperties, self + ).__init__( + category=category, + target=target, + value=value, + value_format=value_format, + **kwargs + ) + self.auth_type = "ManagedIdentity" # type: str self.credentials = credentials @@ -13949,27 +14996,42 @@ class ManagedOnlineDeployment(OnlineDeploymentProperties): """ _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, + "endpoint_compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, + "egress_public_network_access": { + "key": "egressPublicNetworkAccess", + "type": "str", + }, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, + "model": {"key": "model", "type": "str"}, + "model_mount_path": {"key": "modelMountPath", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, } def __init__( @@ -13981,7 +15043,9 @@ def __init__( environment_variables: Optional[Dict[str, str]] = None, properties: Optional[Dict[str, str]] = None, app_insights_enabled: Optional[bool] = False, - egress_public_network_access: Optional[Union[str, "EgressPublicNetworkAccessType"]] = None, + egress_public_network_access: Optional[ + Union[str, "EgressPublicNetworkAccessType"] + ] = None, instance_type: Optional[str] = None, liveness_probe: Optional["ProbeSettings"] = None, model: Optional[str] = None, @@ -14029,8 +15093,24 @@ def __init__( and to DefaultScaleSettings for ManagedOnlineDeployment. :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings """ - super(ManagedOnlineDeployment, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, app_insights_enabled=app_insights_enabled, egress_public_network_access=egress_public_network_access, instance_type=instance_type, liveness_probe=liveness_probe, model=model, model_mount_path=model_mount_path, readiness_probe=readiness_probe, request_settings=request_settings, scale_settings=scale_settings, **kwargs) - self.endpoint_compute_type = 'Managed' # type: str + super(ManagedOnlineDeployment, self).__init__( + code_configuration=code_configuration, + description=description, + environment_id=environment_id, + environment_variables=environment_variables, + properties=properties, + app_insights_enabled=app_insights_enabled, + egress_public_network_access=egress_public_network_access, + instance_type=instance_type, + liveness_probe=liveness_probe, + model=model, + model_mount_path=model_mount_path, + readiness_probe=readiness_probe, + request_settings=request_settings, + scale_settings=scale_settings, + **kwargs + ) + self.endpoint_compute_type = "Managed" # type: str class ManagedServiceIdentity(msrest.serialization.Model): @@ -14059,23 +15139,28 @@ class ManagedServiceIdentity(msrest.serialization.Model): """ _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, + "principal_id": {"readonly": True}, + "tenant_id": {"readonly": True}, + "type": {"required": True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{UserAssignedIdentity}", + }, } def __init__( self, *, type: Union[str, "ManagedServiceIdentityType"], - user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, + user_assigned_identities: Optional[ + Dict[str, "UserAssignedIdentity"] + ] = None, **kwargs ): """ @@ -14113,13 +15198,13 @@ class MedianStoppingPolicy(EarlyTerminationPolicy): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, } def __init__( @@ -14135,8 +15220,12 @@ def __init__( :keyword evaluation_interval: Interval (number of runs) between policy evaluations. :paramtype evaluation_interval: int """ - super(MedianStoppingPolicy, self).__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs) - self.policy_type = 'MedianStopping' # type: str + super(MedianStoppingPolicy, self).__init__( + delay_evaluation=delay_evaluation, + evaluation_interval=evaluation_interval, + **kwargs + ) + self.policy_type = "MedianStopping" # type: str class MLFlowModelJobInput(JobInput, AssetJobInput): @@ -14158,15 +15247,15 @@ class MLFlowModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -14186,10 +15275,12 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(MLFlowModelJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(MLFlowModelJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'mlflow_model' # type: str + self.job_input_type = "mlflow_model" # type: str self.description = description @@ -14211,14 +15302,14 @@ class MLFlowModelJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -14237,10 +15328,12 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(MLFlowModelJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(MLFlowModelJobOutput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_output_type = 'mlflow_model' # type: str + self.job_output_type = "mlflow_model" # type: str self.description = description @@ -14270,19 +15363,19 @@ class MLTableData(DataVersionBaseProperties): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'referenced_uris': {'key': 'referencedUris', 'type': '[str]'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, + "referenced_uris": {"key": "referencedUris", "type": "[str]"}, } def __init__( @@ -14314,8 +15407,16 @@ def __init__( :keyword referenced_uris: Uris referenced in the MLTable definition (required for lineage). :paramtype referenced_uris: list[str] """ - super(MLTableData, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, **kwargs) - self.data_type = 'mltable' # type: str + super(MLTableData, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + data_uri=data_uri, + **kwargs + ) + self.data_type = "mltable" # type: str self.referenced_uris = referenced_uris @@ -14338,15 +15439,15 @@ class MLTableJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -14366,10 +15467,12 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(MLTableJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(MLTableJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'mltable' # type: str + self.job_input_type = "mltable" # type: str self.description = description @@ -14391,14 +15494,14 @@ class MLTableJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -14417,10 +15520,12 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(MLTableJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(MLTableJobOutput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_output_type = 'mltable' # type: str + self.job_output_type = "mltable" # type: str self.description = description @@ -14447,27 +15552,25 @@ class ModelContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "ModelContainerProperties", + }, } - def __init__( - self, - *, - properties: "ModelContainerProperties", - **kwargs - ): + def __init__(self, *, properties: "ModelContainerProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelContainerProperties @@ -14496,17 +15599,17 @@ class ModelContainerProperties(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, } def __init__( @@ -14528,7 +15631,13 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(ModelContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) + super(ModelContainerProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs + ) class ModelContainerResourceArmPaginatedResult(msrest.serialization.Model): @@ -14542,8 +15651,8 @@ class ModelContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ModelContainer]"}, } def __init__( @@ -14560,7 +15669,9 @@ def __init__( :keyword value: An array of objects of type ModelContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelContainer] """ - super(ModelContainerResourceArmPaginatedResult, self).__init__(**kwargs) + super(ModelContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -14588,27 +15699,22 @@ class ModelVersion(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelVersionProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "ModelVersionProperties"}, } - def __init__( - self, - *, - properties: "ModelVersionProperties", - **kwargs - ): + def __init__(self, *, properties: "ModelVersionProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelVersionProperties @@ -14641,15 +15747,15 @@ class ModelVersionProperties(AssetBase): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'flavors': {'key': 'flavors', 'type': '{FlavorData}'}, - 'job_name': {'key': 'jobName', 'type': 'str'}, - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'model_uri': {'key': 'modelUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "flavors": {"key": "flavors", "type": "{FlavorData}"}, + "job_name": {"key": "jobName", "type": "str"}, + "model_type": {"key": "modelType", "type": "str"}, + "model_uri": {"key": "modelUri", "type": "str"}, } def __init__( @@ -14686,7 +15792,14 @@ def __init__( :keyword model_uri: The URI path to the model contents. :paramtype model_uri: str """ - super(ModelVersionProperties, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) + super(ModelVersionProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + **kwargs + ) self.flavors = flavors self.job_name = job_name self.model_type = model_type @@ -14704,8 +15817,8 @@ class ModelVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelVersion]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ModelVersion]"}, } def __init__( @@ -14740,52 +15853,63 @@ class Mpi(DistributionConfiguration): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, + "distribution_type": {"key": "distributionType", "type": "str"}, + "process_count_per_instance": { + "key": "processCountPerInstance", + "type": "int", + }, } def __init__( - self, - *, - process_count_per_instance: Optional[int] = None, - **kwargs + self, *, process_count_per_instance: Optional[int] = None, **kwargs ): """ :keyword process_count_per_instance: Number of processes per MPI node. :paramtype process_count_per_instance: int """ super(Mpi, self).__init__(**kwargs) - self.distribution_type = 'Mpi' # type: str + self.distribution_type = "Mpi" # type: str self.process_count_per_instance = process_count_per_instance class NlpVertical(msrest.serialization.Model): """Abstract class for NLP related AutoML tasks. -NLP - Natural Language Processing. + NLP - Natural Language Processing. - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, } def __init__( self, *, - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "NlpVerticalFeaturizationSettings" + ] = None, limit_settings: Optional["NlpVerticalLimitSettings"] = None, validation_data: Optional["MLTableJobInput"] = None, **kwargs @@ -14813,20 +15937,17 @@ class NlpVerticalFeaturizationSettings(FeaturizationSettings): """ _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, + "dataset_language": {"key": "datasetLanguage", "type": "str"}, } - def __init__( - self, - *, - dataset_language: Optional[str] = None, - **kwargs - ): + def __init__(self, *, dataset_language: Optional[str] = None, **kwargs): """ :keyword dataset_language: Dataset language, useful for the text data. :paramtype dataset_language: str """ - super(NlpVerticalFeaturizationSettings, self).__init__(dataset_language=dataset_language, **kwargs) + super(NlpVerticalFeaturizationSettings, self).__init__( + dataset_language=dataset_language, **kwargs + ) class NlpVerticalLimitSettings(msrest.serialization.Model): @@ -14841,9 +15962,9 @@ class NlpVerticalLimitSettings(msrest.serialization.Model): """ _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_trials": {"key": "maxTrials", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } def __init__( @@ -14888,29 +16009,25 @@ class NodeStateCounts(msrest.serialization.Model): """ _validation = { - 'idle_node_count': {'readonly': True}, - 'running_node_count': {'readonly': True}, - 'preparing_node_count': {'readonly': True}, - 'unusable_node_count': {'readonly': True}, - 'leaving_node_count': {'readonly': True}, - 'preempted_node_count': {'readonly': True}, + "idle_node_count": {"readonly": True}, + "running_node_count": {"readonly": True}, + "preparing_node_count": {"readonly": True}, + "unusable_node_count": {"readonly": True}, + "leaving_node_count": {"readonly": True}, + "preempted_node_count": {"readonly": True}, } _attribute_map = { - 'idle_node_count': {'key': 'idleNodeCount', 'type': 'int'}, - 'running_node_count': {'key': 'runningNodeCount', 'type': 'int'}, - 'preparing_node_count': {'key': 'preparingNodeCount', 'type': 'int'}, - 'unusable_node_count': {'key': 'unusableNodeCount', 'type': 'int'}, - 'leaving_node_count': {'key': 'leavingNodeCount', 'type': 'int'}, - 'preempted_node_count': {'key': 'preemptedNodeCount', 'type': 'int'}, + "idle_node_count": {"key": "idleNodeCount", "type": "int"}, + "running_node_count": {"key": "runningNodeCount", "type": "int"}, + "preparing_node_count": {"key": "preparingNodeCount", "type": "int"}, + "unusable_node_count": {"key": "unusableNodeCount", "type": "int"}, + "leaving_node_count": {"key": "leavingNodeCount", "type": "int"}, + "preempted_node_count": {"key": "preemptedNodeCount", "type": "int"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NodeStateCounts, self).__init__(**kwargs) self.idle_node_count = None self.running_node_count = None @@ -14920,7 +16037,9 @@ def __init__( self.preempted_node_count = None -class NoneAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class NoneAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """NoneAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -14940,15 +16059,15 @@ class NoneAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2) """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, } def __init__( @@ -14972,8 +16091,14 @@ def __init__( "JSON". :paramtype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat """ - super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'None' # type: str + super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__( + category=category, + target=target, + value=value, + value_format=value_format, + **kwargs + ) + self.auth_type = "None" # type: str class NoneDatastoreCredentials(DatastoreCredentials): @@ -14988,21 +16113,17 @@ class NoneDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, + "credentials_type": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NoneDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'None' # type: str + self.credentials_type = "None" # type: str class NotebookAccessTokenResult(msrest.serialization.Model): @@ -15029,33 +16150,29 @@ class NotebookAccessTokenResult(msrest.serialization.Model): """ _validation = { - 'notebook_resource_id': {'readonly': True}, - 'host_name': {'readonly': True}, - 'public_dns': {'readonly': True}, - 'access_token': {'readonly': True}, - 'token_type': {'readonly': True}, - 'expires_in': {'readonly': True}, - 'refresh_token': {'readonly': True}, - 'scope': {'readonly': True}, + "notebook_resource_id": {"readonly": True}, + "host_name": {"readonly": True}, + "public_dns": {"readonly": True}, + "access_token": {"readonly": True}, + "token_type": {"readonly": True}, + "expires_in": {"readonly": True}, + "refresh_token": {"readonly": True}, + "scope": {"readonly": True}, } _attribute_map = { - 'notebook_resource_id': {'key': 'notebookResourceId', 'type': 'str'}, - 'host_name': {'key': 'hostName', 'type': 'str'}, - 'public_dns': {'key': 'publicDns', 'type': 'str'}, - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, - 'expires_in': {'key': 'expiresIn', 'type': 'int'}, - 'refresh_token': {'key': 'refreshToken', 'type': 'str'}, - 'scope': {'key': 'scope', 'type': 'str'}, + "notebook_resource_id": {"key": "notebookResourceId", "type": "str"}, + "host_name": {"key": "hostName", "type": "str"}, + "public_dns": {"key": "publicDns", "type": "str"}, + "access_token": {"key": "accessToken", "type": "str"}, + "token_type": {"key": "tokenType", "type": "str"}, + "expires_in": {"key": "expiresIn", "type": "int"}, + "refresh_token": {"key": "refreshToken", "type": "str"}, + "scope": {"key": "scope", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NotebookAccessTokenResult, self).__init__(**kwargs) self.notebook_resource_id = None self.host_name = None @@ -15077,8 +16194,8 @@ class NotebookPreparationError(msrest.serialization.Model): """ _attribute_map = { - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'status_code': {'key': 'statusCode', 'type': 'int'}, + "error_message": {"key": "errorMessage", "type": "str"}, + "status_code": {"key": "statusCode", "type": "int"}, } def __init__( @@ -15112,9 +16229,12 @@ class NotebookResourceInfo(msrest.serialization.Model): """ _attribute_map = { - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'notebook_preparation_error': {'key': 'notebookPreparationError', 'type': 'NotebookPreparationError'}, + "fqdn": {"key": "fqdn", "type": "str"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "notebook_preparation_error": { + "key": "notebookPreparationError", + "type": "NotebookPreparationError", + }, } def __init__( @@ -15122,7 +16242,9 @@ def __init__( *, fqdn: Optional[str] = None, resource_id: Optional[str] = None, - notebook_preparation_error: Optional["NotebookPreparationError"] = None, + notebook_preparation_error: Optional[ + "NotebookPreparationError" + ] = None, **kwargs ): """ @@ -15153,21 +16275,17 @@ class Objective(msrest.serialization.Model): """ _validation = { - 'goal': {'required': True}, - 'primary_metric': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "goal": {"required": True}, + "primary_metric": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'goal': {'key': 'goal', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "goal": {"key": "goal", "type": "str"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( - self, - *, - goal: Union[str, "Goal"], - primary_metric: str, - **kwargs + self, *, goal: Union[str, "Goal"], primary_metric: str, **kwargs ): """ :keyword goal: Required. [Required] Defines supported metric goals for hyperparameter tuning. @@ -15215,25 +16333,28 @@ class OnlineDeployment(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineDeploymentProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": { + "key": "properties", + "type": "OnlineDeploymentProperties", + }, + "sku": {"key": "sku", "type": "Sku"}, } def __init__( @@ -15262,14 +16383,18 @@ def __init__( :keyword sku: Sku details required for ARM contract for Autoscaling. :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ - super(OnlineDeployment, self).__init__(tags=tags, location=location, **kwargs) + super(OnlineDeployment, self).__init__( + tags=tags, location=location, **kwargs + ) self.identity = identity self.kind = kind self.properties = properties self.sku = sku -class OnlineDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class OnlineDeploymentTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of OnlineDeployment entities. :ivar next_link: The link to the next page of OnlineDeployment objects. If null, there are no @@ -15280,8 +16405,8 @@ class OnlineDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Mod """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineDeployment]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[OnlineDeployment]"}, } def __init__( @@ -15298,7 +16423,9 @@ def __init__( :keyword value: An array of objects of type OnlineDeployment. :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineDeployment] """ - super(OnlineDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) + super( + OnlineDeploymentTrackedResourceArmPaginatedResult, self + ).__init__(**kwargs) self.next_link = next_link self.value = value @@ -15337,25 +16464,28 @@ class OnlineEndpoint(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": { + "key": "properties", + "type": "OnlineEndpointProperties", + }, + "sku": {"key": "sku", "type": "Sku"}, } def __init__( @@ -15384,7 +16514,9 @@ def __init__( :keyword sku: Sku details required for ARM contract for Autoscaling. :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ - super(OnlineEndpoint, self).__init__(tags=tags, location=location, **kwargs) + super(OnlineEndpoint, self).__init__( + tags=tags, location=location, **kwargs + ) self.identity = identity self.kind = kind self.properties = properties @@ -15431,23 +16563,23 @@ class OnlineEndpointProperties(EndpointPropertiesBase): """ _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "auth_mode": {"required": True}, + "scoring_uri": {"readonly": True}, + "swagger_uri": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, - 'traffic': {'key': 'traffic', 'type': '{int}'}, + "auth_mode": {"key": "authMode", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "keys": {"key": "keys", "type": "EndpointAuthKeys"}, + "properties": {"key": "properties", "type": "{str}"}, + "scoring_uri": {"key": "scoringUri", "type": "str"}, + "swagger_uri": {"key": "swaggerUri", "type": "str"}, + "compute": {"key": "compute", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "public_network_access": {"key": "publicNetworkAccess", "type": "str"}, + "traffic": {"key": "traffic", "type": "{int}"}, } def __init__( @@ -15458,7 +16590,9 @@ def __init__( keys: Optional["EndpointAuthKeys"] = None, properties: Optional[Dict[str, str]] = None, compute: Optional[str] = None, - public_network_access: Optional[Union[str, "PublicNetworkAccessType"]] = None, + public_network_access: Optional[ + Union[str, "PublicNetworkAccessType"] + ] = None, traffic: Optional[Dict[str, int]] = None, **kwargs ): @@ -15486,14 +16620,22 @@ def __init__( values need to sum to 100. :paramtype traffic: dict[str, int] """ - super(OnlineEndpointProperties, self).__init__(auth_mode=auth_mode, description=description, keys=keys, properties=properties, **kwargs) + super(OnlineEndpointProperties, self).__init__( + auth_mode=auth_mode, + description=description, + keys=keys, + properties=properties, + **kwargs + ) self.compute = compute self.provisioning_state = None self.public_network_access = public_network_access self.traffic = traffic -class OnlineEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class OnlineEndpointTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of OnlineEndpoint entities. :ivar next_link: The link to the next page of OnlineEndpoint objects. If null, there are no @@ -15504,8 +16646,8 @@ class OnlineEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineEndpoint]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[OnlineEndpoint]"}, } def __init__( @@ -15522,7 +16664,9 @@ def __init__( :keyword value: An array of objects of type OnlineEndpoint. :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] """ - super(OnlineEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) + super(OnlineEndpointTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -15543,9 +16687,12 @@ class OnlineRequestSettings(msrest.serialization.Model): """ _attribute_map = { - 'max_concurrent_requests_per_instance': {'key': 'maxConcurrentRequestsPerInstance', 'type': 'int'}, - 'max_queue_wait': {'key': 'maxQueueWait', 'type': 'duration'}, - 'request_timeout': {'key': 'requestTimeout', 'type': 'duration'}, + "max_concurrent_requests_per_instance": { + "key": "maxConcurrentRequestsPerInstance", + "type": "int", + }, + "max_queue_wait": {"key": "maxQueueWait", "type": "duration"}, + "request_timeout": {"key": "requestTimeout", "type": "duration"}, } def __init__( @@ -15569,7 +16716,9 @@ def __init__( :paramtype request_timeout: ~datetime.timedelta """ super(OnlineRequestSettings, self).__init__(**kwargs) - self.max_concurrent_requests_per_instance = max_concurrent_requests_per_instance + self.max_concurrent_requests_per_instance = ( + max_concurrent_requests_per_instance + ) self.max_queue_wait = max_queue_wait self.request_timeout = request_timeout @@ -15589,13 +16738,13 @@ class OutputPathAssetReference(AssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "job_id": {"key": "jobId", "type": "str"}, + "path": {"key": "path", "type": "str"}, } def __init__( @@ -15612,7 +16761,7 @@ def __init__( :paramtype path: str """ super(OutputPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'OutputPath' # type: str + self.reference_type = "OutputPath" # type: str self.job_id = job_id self.path = path @@ -15627,8 +16776,8 @@ class PaginatedComputeResourcesList(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[ComputeResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[ComputeResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( @@ -15657,15 +16806,10 @@ class PartialBatchDeployment(msrest.serialization.Model): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, } - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): + def __init__(self, *, description: Optional[str] = None, **kwargs): """ :keyword description: Description of the endpoint deployment. :paramtype description: str @@ -15674,7 +16818,9 @@ def __init__( self.description = description -class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties(msrest.serialization.Model): +class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties( + msrest.serialization.Model +): """Strictly used in update requests. :ivar properties: Additional attributes of the entity. @@ -15684,8 +16830,8 @@ class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties(msrest.s """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'PartialBatchDeployment'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "properties": {"key": "properties", "type": "PartialBatchDeployment"}, + "tags": {"key": "tags", "type": "{str}"}, } def __init__( @@ -15701,7 +16847,10 @@ def __init__( :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] """ - super(PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, self).__init__(**kwargs) + super( + PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, + self, + ).__init__(**kwargs) self.properties = properties self.tags = tags @@ -15721,8 +16870,11 @@ class PartialManagedServiceIdentity(msrest.serialization.Model): """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{object}'}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{object}", + }, } def __init__( @@ -15756,15 +16908,10 @@ class PartialMinimalTrackedResource(msrest.serialization.Model): """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): + def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -15783,8 +16930,11 @@ class PartialMinimalTrackedResourceWithIdentity(PartialMinimalTrackedResource): """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, + "tags": {"key": "tags", "type": "{str}"}, + "identity": { + "key": "identity", + "type": "PartialManagedServiceIdentity", + }, } def __init__( @@ -15800,7 +16950,9 @@ def __init__( :keyword identity: Managed service identity (system assigned and/or user assigned identities). :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity """ - super(PartialMinimalTrackedResourceWithIdentity, self).__init__(tags=tags, **kwargs) + super(PartialMinimalTrackedResourceWithIdentity, self).__init__( + tags=tags, **kwargs + ) self.identity = identity @@ -15814,8 +16966,8 @@ class PartialMinimalTrackedResourceWithSku(PartialMinimalTrackedResource): """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "PartialSku"}, } def __init__( @@ -15831,7 +16983,9 @@ def __init__( :keyword sku: Sku details required for ARM contract for Autoscaling. :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku """ - super(PartialMinimalTrackedResourceWithSku, self).__init__(tags=tags, **kwargs) + super(PartialMinimalTrackedResourceWithSku, self).__init__( + tags=tags, **kwargs + ) self.sku = sku @@ -15856,11 +17010,11 @@ class PartialSku(msrest.serialization.Model): """ _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'int'}, - 'family': {'key': 'family', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, + "capacity": {"key": "capacity", "type": "int"}, + "family": {"key": "family", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "size": {"key": "size", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, } def __init__( @@ -15910,27 +17064,25 @@ class Password(msrest.serialization.Model): """ _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, + "name": {"readonly": True}, + "value": {"readonly": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "value": {"key": "value", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Password, self).__init__(**kwargs) self.name = None self.value = None -class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class PATAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """PATAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -15953,16 +17105,19 @@ class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionPersonalAccessToken'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionPersonalAccessToken", + }, } def __init__( @@ -15990,8 +17145,14 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken """ - super(PATAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'PAT' # type: str + super(PATAuthTypeWorkspaceConnectionProperties, self).__init__( + category=category, + target=target, + value=value, + value_format=value_format, + **kwargs + ) + self.auth_type = "PAT" # type: str self.credentials = credentials @@ -16003,14 +17164,11 @@ class PersonalComputeInstanceSettings(msrest.serialization.Model): """ _attribute_map = { - 'assigned_user': {'key': 'assignedUser', 'type': 'AssignedUser'}, + "assigned_user": {"key": "assignedUser", "type": "AssignedUser"}, } def __init__( - self, - *, - assigned_user: Optional["AssignedUser"] = None, - **kwargs + self, *, assigned_user: Optional["AssignedUser"] = None, **kwargs ): """ :keyword assigned_user: A user explicitly assigned to a personal compute instance. @@ -16071,28 +17229,28 @@ class PipelineJob(JobBaseProperties): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, + "job_type": {"required": True}, + "status": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'jobs': {'key': 'jobs', 'type': '{object}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'settings': {'key': 'settings', 'type': 'object'}, - 'source_job_id': {'key': 'sourceJobId', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "jobs": {"key": "jobs", "type": "{object}"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "settings": {"key": "settings", "type": "object"}, + "source_job_id": {"key": "sourceJobId", "type": "str"}, } def __init__( @@ -16151,8 +17309,20 @@ def __init__( :keyword source_job_id: ARM resource ID of source job. :paramtype source_job_id: str """ - super(PipelineJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, services=services, **kwargs) - self.job_type = 'Pipeline' # type: str + super(PipelineJob, self).__init__( + description=description, + properties=properties, + tags=tags, + component_id=component_id, + compute_id=compute_id, + display_name=display_name, + experiment_name=experiment_name, + identity=identity, + is_archived=is_archived, + services=services, + **kwargs + ) + self.job_type = "Pipeline" # type: str self.inputs = inputs self.jobs = jobs self.outputs = outputs @@ -16172,21 +17342,17 @@ class PrivateEndpoint(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'subnet_arm_id': {'readonly': True}, + "id": {"readonly": True}, + "subnet_arm_id": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'subnet_arm_id': {'key': 'subnetArmId', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "subnet_arm_id": {"key": "subnetArmId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(PrivateEndpoint, self).__init__(**kwargs) self.id = None self.subnet_arm_id = None @@ -16229,25 +17395,34 @@ class PrivateEndpointConnection(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "private_endpoint": { + "key": "properties.privateEndpoint", + "type": "PrivateEndpoint", + }, + "private_link_service_connection_state": { + "key": "properties.privateLinkServiceConnectionState", + "type": "PrivateLinkServiceConnectionState", + }, + "provisioning_state": { + "key": "properties.provisioningState", + "type": "str", + }, } def __init__( @@ -16258,7 +17433,9 @@ def __init__( tags: Optional[Dict[str, str]] = None, sku: Optional["Sku"] = None, private_endpoint: Optional["PrivateEndpoint"] = None, - private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, + private_link_service_connection_state: Optional[ + "PrivateLinkServiceConnectionState" + ] = None, **kwargs ): """ @@ -16283,7 +17460,9 @@ def __init__( self.tags = tags self.sku = sku self.private_endpoint = private_endpoint - self.private_link_service_connection_state = private_link_service_connection_state + self.private_link_service_connection_state = ( + private_link_service_connection_state + ) self.provisioning_state = None @@ -16295,7 +17474,7 @@ class PrivateEndpointConnectionListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + "value": {"key": "value", "type": "[PrivateEndpointConnection]"}, } def __init__( @@ -16345,26 +17524,32 @@ class PrivateLinkResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'group_id': {'readonly': True}, - 'required_members': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "group_id": {"readonly": True}, + "required_members": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, - 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "group_id": {"key": "properties.groupId", "type": "str"}, + "required_members": { + "key": "properties.requiredMembers", + "type": "[str]", + }, + "required_zone_names": { + "key": "properties.requiredZoneNames", + "type": "[str]", + }, } def __init__( @@ -16407,14 +17592,11 @@ class PrivateLinkResourceListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + "value": {"key": "value", "type": "[PrivateLinkResource]"}, } def __init__( - self, - *, - value: Optional[List["PrivateLinkResource"]] = None, - **kwargs + self, *, value: Optional[List["PrivateLinkResource"]] = None, **kwargs ): """ :keyword value: Array of private link resources. @@ -16440,15 +17622,17 @@ class PrivateLinkServiceConnectionState(msrest.serialization.Model): """ _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + "status": {"key": "status", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "actions_required": {"key": "actionsRequired", "type": "str"}, } def __init__( self, *, - status: Optional[Union[str, "PrivateEndpointServiceConnectionStatus"]] = None, + status: Optional[ + Union[str, "PrivateEndpointServiceConnectionStatus"] + ] = None, description: Optional[str] = None, actions_required: Optional[str] = None, **kwargs @@ -16487,11 +17671,11 @@ class ProbeSettings(msrest.serialization.Model): """ _attribute_map = { - 'failure_threshold': {'key': 'failureThreshold', 'type': 'int'}, - 'initial_delay': {'key': 'initialDelay', 'type': 'duration'}, - 'period': {'key': 'period', 'type': 'duration'}, - 'success_threshold': {'key': 'successThreshold', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "failure_threshold": {"key": "failureThreshold", "type": "int"}, + "initial_delay": {"key": "initialDelay", "type": "duration"}, + "period": {"key": "period", "type": "duration"}, + "success_threshold": {"key": "successThreshold", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } def __init__( @@ -16538,26 +17722,26 @@ class PyTorch(DistributionConfiguration): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, + "distribution_type": {"key": "distributionType", "type": "str"}, + "process_count_per_instance": { + "key": "processCountPerInstance", + "type": "int", + }, } def __init__( - self, - *, - process_count_per_instance: Optional[int] = None, - **kwargs + self, *, process_count_per_instance: Optional[int] = None, **kwargs ): """ :keyword process_count_per_instance: Number of processes per node. :paramtype process_count_per_instance: int """ super(PyTorch, self).__init__(**kwargs) - self.distribution_type = 'PyTorch' # type: str + self.distribution_type = "PyTorch" # type: str self.process_count_per_instance = process_count_per_instance @@ -16575,10 +17759,10 @@ class QuotaBaseProperties(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "limit": {"key": "limit", "type": "long"}, + "unit": {"key": "unit", "type": "str"}, } def __init__( @@ -16618,8 +17802,8 @@ class QuotaUpdateParameters(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[QuotaBaseProperties]'}, - 'location': {'key': 'location', 'type': 'str'}, + "value": {"key": "value", "type": "[QuotaBaseProperties]"}, + "location": {"key": "location", "type": "str"}, } def __init__( @@ -16657,13 +17841,16 @@ class RandomSamplingAlgorithm(SamplingAlgorithm): """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - 'rule': {'key': 'rule', 'type': 'str'}, - 'seed': {'key': 'seed', 'type': 'int'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, + "rule": {"key": "rule", "type": "str"}, + "seed": {"key": "seed", "type": "int"}, } def __init__( @@ -16681,7 +17868,7 @@ def __init__( :paramtype seed: int """ super(RandomSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Random' # type: str + self.sampling_algorithm_type = "Random" # type: str self.rule = rule self.seed = seed @@ -16702,15 +17889,15 @@ class RecurrenceSchedule(msrest.serialization.Model): """ _validation = { - 'hours': {'required': True}, - 'minutes': {'required': True}, + "hours": {"required": True}, + "minutes": {"required": True}, } _attribute_map = { - 'hours': {'key': 'hours', 'type': '[int]'}, - 'minutes': {'key': 'minutes', 'type': '[int]'}, - 'month_days': {'key': 'monthDays', 'type': '[int]'}, - 'week_days': {'key': 'weekDays', 'type': '[str]'}, + "hours": {"key": "hours", "type": "[int]"}, + "minutes": {"key": "minutes", "type": "[int]"}, + "month_days": {"key": "monthDays", "type": "[int]"}, + "week_days": {"key": "weekDays", "type": "[str]"}, } def __init__( @@ -16769,19 +17956,19 @@ class RecurrenceTrigger(TriggerBase): """ _validation = { - 'trigger_type': {'required': True}, - 'frequency': {'required': True}, - 'interval': {'required': True}, + "trigger_type": {"required": True}, + "frequency": {"required": True}, + "interval": {"required": True}, } _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceSchedule'}, + "end_time": {"key": "endTime", "type": "str"}, + "start_time": {"key": "startTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "trigger_type": {"key": "triggerType", "type": "str"}, + "frequency": {"key": "frequency", "type": "str"}, + "interval": {"key": "interval", "type": "int"}, + "schedule": {"key": "schedule", "type": "RecurrenceSchedule"}, } def __init__( @@ -16817,8 +18004,13 @@ def __init__( :keyword schedule: The recurrence schedule. :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule """ - super(RecurrenceTrigger, self).__init__(end_time=end_time, start_time=start_time, time_zone=time_zone, **kwargs) - self.trigger_type = 'Recurrence' # type: str + super(RecurrenceTrigger, self).__init__( + end_time=end_time, + start_time=start_time, + time_zone=time_zone, + **kwargs + ) + self.trigger_type = "Recurrence" # type: str self.frequency = frequency self.interval = interval self.schedule = schedule @@ -16837,12 +18029,12 @@ class RegenerateEndpointKeysRequest(msrest.serialization.Model): """ _validation = { - 'key_type': {'required': True}, + "key_type": {"required": True}, } _attribute_map = { - 'key_type': {'key': 'keyType', 'type': 'str'}, - 'key_value': {'key': 'keyValue', 'type': 'str'}, + "key_type": {"key": "keyType", "type": "str"}, + "key_value": {"key": "keyValue", "type": "str"}, } def __init__( @@ -16878,21 +18070,18 @@ class RegistryListCredentialsResult(msrest.serialization.Model): """ _validation = { - 'location': {'readonly': True}, - 'username': {'readonly': True}, + "location": {"readonly": True}, + "username": {"readonly": True}, } _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'username': {'key': 'username', 'type': 'str'}, - 'passwords': {'key': 'passwords', 'type': '[Password]'}, + "location": {"key": "location", "type": "str"}, + "username": {"key": "username", "type": "str"}, + "passwords": {"key": "passwords", "type": "[Password]"}, } def __init__( - self, - *, - passwords: Optional[List["Password"]] = None, - **kwargs + self, *, passwords: Optional[List["Password"]] = None, **kwargs ): """ :keyword passwords: @@ -16960,26 +18149,44 @@ class Regression(AutoMLVertical, TableVertical): """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'RegressionTrainingSettings'}, + "task_type": {"required": True}, + "training_data": {"required": True}, + } + + _attribute_map = { + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "test_data": {"key": "testData", "type": "MLTableJobInput"}, + "test_data_size": {"key": "testDataSize", "type": "float"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "weight_column_name": {"key": "weightColumnName", "type": "str"}, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, + "training_settings": { + "key": "trainingSettings", + "type": "RegressionTrainingSettings", + }, } def __init__( @@ -16987,7 +18194,9 @@ def __init__( *, training_data: "MLTableJobInput", cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "TableVerticalFeaturizationSettings" + ] = None, limit_settings: Optional["TableVerticalLimitSettings"] = None, n_cross_validations: Optional["NCrossValidations"] = None, test_data: Optional["MLTableJobInput"] = None, @@ -16997,7 +18206,9 @@ def __init__( weight_column_name: Optional[str] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "RegressionPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "RegressionPrimaryMetrics"] + ] = None, training_settings: Optional["RegressionTrainingSettings"] = None, **kwargs ): @@ -17048,7 +18259,21 @@ def __init__( :paramtype training_settings: ~azure.mgmt.machinelearningservices.models.RegressionTrainingSettings """ - super(Regression, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, cv_split_column_names=cv_split_column_names, featurization_settings=featurization_settings, limit_settings=limit_settings, n_cross_validations=n_cross_validations, test_data=test_data, test_data_size=test_data_size, validation_data=validation_data, validation_data_size=validation_data_size, weight_column_name=weight_column_name, **kwargs) + super(Regression, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + cv_split_column_names=cv_split_column_names, + featurization_settings=featurization_settings, + limit_settings=limit_settings, + n_cross_validations=n_cross_validations, + test_data=test_data, + test_data_size=test_data_size, + validation_data=validation_data, + validation_data_size=validation_data_size, + weight_column_name=weight_column_name, + **kwargs + ) self.cv_split_column_names = cv_split_column_names self.featurization_settings = featurization_settings self.limit_settings = limit_settings @@ -17058,7 +18283,7 @@ def __init__( self.validation_data = validation_data self.validation_data_size = validation_data_size self.weight_column_name = weight_column_name - self.task_type = 'Regression' # type: str + self.task_type = "Regression" # type: str self.primary_metric = primary_metric self.training_settings = training_settings self.log_verbosity = log_verbosity @@ -17095,15 +18320,36 @@ class RegressionTrainingSettings(TrainingSettings): """ _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, + "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, + "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, + "allowed_training_algorithms": { + "key": "allowedTrainingAlgorithms", + "type": "[str]", + }, + "blocked_training_algorithms": { + "key": "blockedTrainingAlgorithms", + "type": "[str]", + }, } def __init__( @@ -17116,8 +18362,12 @@ def __init__( enable_vote_ensemble: Optional[bool] = True, ensemble_model_download_timeout: Optional[datetime.timedelta] = "PT5M", stack_ensemble_settings: Optional["StackEnsembleSettings"] = None, - allowed_training_algorithms: Optional[List[Union[str, "RegressionModels"]]] = None, - blocked_training_algorithms: Optional[List[Union[str, "RegressionModels"]]] = None, + allowed_training_algorithms: Optional[ + List[Union[str, "RegressionModels"]] + ] = None, + blocked_training_algorithms: Optional[ + List[Union[str, "RegressionModels"]] + ] = None, **kwargs ): """ @@ -17145,7 +18395,16 @@ def __init__( :paramtype blocked_training_algorithms: list[str or ~azure.mgmt.machinelearningservices.models.RegressionModels] """ - super(RegressionTrainingSettings, self).__init__(enable_dnn_training=enable_dnn_training, enable_model_explainability=enable_model_explainability, enable_onnx_compatible_models=enable_onnx_compatible_models, enable_stack_ensemble=enable_stack_ensemble, enable_vote_ensemble=enable_vote_ensemble, ensemble_model_download_timeout=ensemble_model_download_timeout, stack_ensemble_settings=stack_ensemble_settings, **kwargs) + super(RegressionTrainingSettings, self).__init__( + enable_dnn_training=enable_dnn_training, + enable_model_explainability=enable_model_explainability, + enable_onnx_compatible_models=enable_onnx_compatible_models, + enable_stack_ensemble=enable_stack_ensemble, + enable_vote_ensemble=enable_vote_ensemble, + ensemble_model_download_timeout=ensemble_model_download_timeout, + stack_ensemble_settings=stack_ensemble_settings, + **kwargs + ) self.allowed_training_algorithms = allowed_training_algorithms self.blocked_training_algorithms = blocked_training_algorithms @@ -17160,19 +18419,14 @@ class ResourceId(msrest.serialization.Model): """ _validation = { - 'id': {'required': True}, + "id": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, } - def __init__( - self, - *, - id: str, - **kwargs - ): + def __init__(self, *, id: str, **kwargs): """ :keyword id: Required. The ID of the resource. :paramtype id: str @@ -17193,21 +18447,17 @@ class ResourceName(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, + "value": {"readonly": True}, + "localized_value": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + "value": {"key": "value", "type": "str"}, + "localized_value": {"key": "localizedValue", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ResourceName, self).__init__(**kwargs) self.value = None self.localized_value = None @@ -17233,29 +18483,28 @@ class ResourceQuota(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'name': {'readonly': True}, - 'limit': {'readonly': True}, - 'unit': {'readonly': True}, + "id": {"readonly": True}, + "aml_workspace_location": {"readonly": True}, + "type": {"readonly": True}, + "name": {"readonly": True}, + "limit": {"readonly": True}, + "unit": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'ResourceName'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "aml_workspace_location": { + "key": "amlWorkspaceLocation", + "type": "str", + }, + "type": {"key": "type", "type": "str"}, + "name": {"key": "name", "type": "ResourceName"}, + "limit": {"key": "limit", "type": "long"}, + "unit": {"key": "unit", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ResourceQuota, self).__init__(**kwargs) self.id = None self.aml_workspace_location = None @@ -17277,22 +18526,16 @@ class Route(msrest.serialization.Model): """ _validation = { - 'path': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'port': {'required': True}, + "path": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "port": {"required": True}, } _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, + "path": {"key": "path", "type": "str"}, + "port": {"key": "port", "type": "int"}, } - def __init__( - self, - *, - path: str, - port: int, - **kwargs - ): + def __init__(self, *, path: str, port: int, **kwargs): """ :keyword path: Required. [Required] The path for the route. :paramtype path: str @@ -17304,7 +18547,9 @@ def __init__( self.port = port -class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class SASAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """SASAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -17327,16 +18572,19 @@ class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionSharedAccessSignature'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionSharedAccessSignature", + }, } def __init__( @@ -17346,7 +18594,9 @@ def __init__( target: Optional[str] = None, value: Optional[str] = None, value_format: Optional[Union[str, "ValueFormat"]] = None, - credentials: Optional["WorkspaceConnectionSharedAccessSignature"] = None, + credentials: Optional[ + "WorkspaceConnectionSharedAccessSignature" + ] = None, **kwargs ): """ @@ -17364,8 +18614,14 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature """ - super(SASAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'SAS' # type: str + super(SASAuthTypeWorkspaceConnectionProperties, self).__init__( + category=category, + target=target, + value=value, + value_format=value_format, + **kwargs + ) + self.auth_type = "SAS" # type: str self.credentials = credentials @@ -17383,27 +18639,22 @@ class SasDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, + "credentials_type": {"required": True}, + "secrets": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'SasDatastoreSecrets'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "secrets": {"key": "secrets", "type": "SasDatastoreSecrets"}, } - def __init__( - self, - *, - secrets: "SasDatastoreSecrets", - **kwargs - ): + def __init__(self, *, secrets: "SasDatastoreSecrets", **kwargs): """ :keyword secrets: Required. [Required] Storage container secrets. :paramtype secrets: ~azure.mgmt.machinelearningservices.models.SasDatastoreSecrets """ super(SasDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Sas' # type: str + self.credentials_type = "Sas" # type: str self.secrets = secrets @@ -17421,26 +18672,21 @@ class SasDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'sas_token': {'key': 'sasToken', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "sas_token": {"key": "sasToken", "type": "str"}, } - def __init__( - self, - *, - sas_token: Optional[str] = None, - **kwargs - ): + def __init__(self, *, sas_token: Optional[str] = None, **kwargs): """ :keyword sas_token: Storage container SAS token. :paramtype sas_token: str """ super(SasDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Sas' # type: str + self.secrets_type = "Sas" # type: str self.sas_token = sas_token @@ -17459,13 +18705,16 @@ class ScaleSettings(msrest.serialization.Model): """ _validation = { - 'max_node_count': {'required': True}, + "max_node_count": {"required": True}, } _attribute_map = { - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'node_idle_time_before_scale_down': {'key': 'nodeIdleTimeBeforeScaleDown', 'type': 'duration'}, + "max_node_count": {"key": "maxNodeCount", "type": "int"}, + "min_node_count": {"key": "minNodeCount", "type": "int"}, + "node_idle_time_before_scale_down": { + "key": "nodeIdleTimeBeforeScaleDown", + "type": "duration", + }, } def __init__( @@ -17488,7 +18737,9 @@ def __init__( super(ScaleSettings, self).__init__(**kwargs) self.max_node_count = max_node_count self.min_node_count = min_node_count - self.node_idle_time_before_scale_down = node_idle_time_before_scale_down + self.node_idle_time_before_scale_down = ( + node_idle_time_before_scale_down + ) class ScaleSettingsInformation(msrest.serialization.Model): @@ -17499,14 +18750,11 @@ class ScaleSettingsInformation(msrest.serialization.Model): """ _attribute_map = { - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, + "scale_settings": {"key": "scaleSettings", "type": "ScaleSettings"}, } def __init__( - self, - *, - scale_settings: Optional["ScaleSettings"] = None, - **kwargs + self, *, scale_settings: Optional["ScaleSettings"] = None, **kwargs ): """ :keyword scale_settings: scale settings for AML Compute. @@ -17539,27 +18787,22 @@ class Schedule(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ScheduleProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "ScheduleProperties"}, } - def __init__( - self, - *, - properties: "ScheduleProperties", - **kwargs - ): + def __init__(self, *, properties: "ScheduleProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ScheduleProperties @@ -17583,16 +18826,18 @@ class ScheduleBase(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "provisioning_status": {"key": "provisioningStatus", "type": "str"}, + "status": {"key": "status", "type": "str"}, } def __init__( self, *, id: Optional[str] = None, - provisioning_status: Optional[Union[str, "ScheduleProvisioningState"]] = None, + provisioning_status: Optional[ + Union[str, "ScheduleProvisioningState"] + ] = None, status: Optional[Union[str, "ScheduleStatus"]] = None, **kwargs ): @@ -17641,20 +18886,20 @@ class ScheduleProperties(ResourceBase): """ _validation = { - 'action': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'trigger': {'required': True}, + "action": {"required": True}, + "provisioning_state": {"readonly": True}, + "trigger": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'action': {'key': 'action', 'type': 'ScheduleActionBase'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'trigger': {'key': 'trigger', 'type': 'TriggerBase'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "action": {"key": "action", "type": "ScheduleActionBase"}, + "display_name": {"key": "displayName", "type": "str"}, + "is_enabled": {"key": "isEnabled", "type": "bool"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "trigger": {"key": "trigger", "type": "TriggerBase"}, } def __init__( @@ -17685,7 +18930,9 @@ def __init__( :keyword trigger: Required. [Required] Specifies the trigger details. :paramtype trigger: ~azure.mgmt.machinelearningservices.models.TriggerBase """ - super(ScheduleProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + super(ScheduleProperties, self).__init__( + description=description, properties=properties, tags=tags, **kwargs + ) self.action = action self.display_name = display_name self.is_enabled = is_enabled @@ -17704,8 +18951,8 @@ class ScheduleResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Schedule]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[Schedule]"}, } def __init__( @@ -17741,10 +18988,10 @@ class ScriptReference(msrest.serialization.Model): """ _attribute_map = { - 'script_source': {'key': 'scriptSource', 'type': 'str'}, - 'script_data': {'key': 'scriptData', 'type': 'str'}, - 'script_arguments': {'key': 'scriptArguments', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'str'}, + "script_source": {"key": "scriptSource", "type": "str"}, + "script_data": {"key": "scriptData", "type": "str"}, + "script_arguments": {"key": "scriptArguments", "type": "str"}, + "timeout": {"key": "timeout", "type": "str"}, } def __init__( @@ -17783,8 +19030,11 @@ class ScriptsToExecute(msrest.serialization.Model): """ _attribute_map = { - 'startup_script': {'key': 'startupScript', 'type': 'ScriptReference'}, - 'creation_script': {'key': 'creationScript', 'type': 'ScriptReference'}, + "startup_script": {"key": "startupScript", "type": "ScriptReference"}, + "creation_script": { + "key": "creationScript", + "type": "ScriptReference", + }, } def __init__( @@ -17813,14 +19063,11 @@ class ServiceManagedResourcesSettings(msrest.serialization.Model): """ _attribute_map = { - 'cosmos_db': {'key': 'cosmosDb', 'type': 'CosmosDbSettings'}, + "cosmos_db": {"key": "cosmosDb", "type": "CosmosDbSettings"}, } def __init__( - self, - *, - cosmos_db: Optional["CosmosDbSettings"] = None, - **kwargs + self, *, cosmos_db: Optional["CosmosDbSettings"] = None, **kwargs ): """ :keyword cosmos_db: The settings for the service managed cosmosdb account. @@ -17852,19 +19099,22 @@ class ServicePrincipalDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, + "credentials_type": {"required": True}, + "client_id": {"required": True}, + "secrets": {"required": True}, + "tenant_id": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'ServicePrincipalDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "authority_url": {"key": "authorityUrl", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + "resource_url": {"key": "resourceUrl", "type": "str"}, + "secrets": { + "key": "secrets", + "type": "ServicePrincipalDatastoreSecrets", + }, + "tenant_id": {"key": "tenantId", "type": "str"}, } def __init__( @@ -17891,7 +19141,7 @@ def __init__( :paramtype tenant_id: str """ super(ServicePrincipalDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'ServicePrincipal' # type: str + self.credentials_type = "ServicePrincipal" # type: str self.authority_url = authority_url self.client_id = client_id self.resource_url = resource_url @@ -17913,26 +19163,21 @@ class ServicePrincipalDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "client_secret": {"key": "clientSecret", "type": "str"}, } - def __init__( - self, - *, - client_secret: Optional[str] = None, - **kwargs - ): + def __init__(self, *, client_secret: Optional[str] = None, **kwargs): """ :keyword client_secret: Service principal secret. :paramtype client_secret: str """ super(ServicePrincipalDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'ServicePrincipal' # type: str + self.secrets_type = "ServicePrincipal" # type: str self.client_secret = client_secret @@ -17944,14 +19189,11 @@ class SetupScripts(msrest.serialization.Model): """ _attribute_map = { - 'scripts': {'key': 'scripts', 'type': 'ScriptsToExecute'}, + "scripts": {"key": "scripts", "type": "ScriptsToExecute"}, } def __init__( - self, - *, - scripts: Optional["ScriptsToExecute"] = None, - **kwargs + self, *, scripts: Optional["ScriptsToExecute"] = None, **kwargs ): """ :keyword scripts: Customized setup scripts. @@ -17980,11 +19222,14 @@ class SharedPrivateLinkResource(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'private_link_resource_id': {'key': 'properties.privateLinkResourceId', 'type': 'str'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'request_message': {'key': 'properties.requestMessage', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "private_link_resource_id": { + "key": "properties.privateLinkResourceId", + "type": "str", + }, + "group_id": {"key": "properties.groupId", "type": "str"}, + "request_message": {"key": "properties.requestMessage", "type": "str"}, + "status": {"key": "properties.status", "type": "str"}, } def __init__( @@ -17994,7 +19239,9 @@ def __init__( private_link_resource_id: Optional[str] = None, group_id: Optional[str] = None, request_message: Optional[str] = None, - status: Optional[Union[str, "PrivateEndpointServiceConnectionStatus"]] = None, + status: Optional[ + Union[str, "PrivateEndpointServiceConnectionStatus"] + ] = None, **kwargs ): """ @@ -18043,15 +19290,15 @@ class Sku(msrest.serialization.Model): """ _validation = { - 'name': {'required': True}, + "name": {"required": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'int'}, + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, + "size": {"key": "size", "type": "str"}, + "family": {"key": "family", "type": "str"}, + "capacity": {"key": "capacity", "type": "int"}, } def __init__( @@ -18104,10 +19351,10 @@ class SkuCapacity(msrest.serialization.Model): """ _attribute_map = { - 'default': {'key': 'default', 'type': 'int'}, - 'maximum': {'key': 'maximum', 'type': 'int'}, - 'minimum': {'key': 'minimum', 'type': 'int'}, - 'scale_type': {'key': 'scaleType', 'type': 'str'}, + "default": {"key": "default", "type": "int"}, + "maximum": {"key": "maximum", "type": "int"}, + "minimum": {"key": "minimum", "type": "int"}, + "scale_type": {"key": "scaleType", "type": "str"}, } def __init__( @@ -18151,13 +19398,13 @@ class SkuResource(msrest.serialization.Model): """ _validation = { - 'resource_type': {'readonly': True}, + "resource_type": {"readonly": True}, } _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'SkuSetting'}, + "capacity": {"key": "capacity", "type": "SkuCapacity"}, + "resource_type": {"key": "resourceType", "type": "str"}, + "sku": {"key": "sku", "type": "SkuSetting"}, } def __init__( @@ -18190,8 +19437,8 @@ class SkuResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[SkuResource]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[SkuResource]"}, } def __init__( @@ -18228,12 +19475,12 @@ class SkuSetting(msrest.serialization.Model): """ _validation = { - 'name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, } def __init__( @@ -18276,12 +19523,15 @@ class SslConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'cert': {'key': 'cert', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - 'cname': {'key': 'cname', 'type': 'str'}, - 'leaf_domain_label': {'key': 'leafDomainLabel', 'type': 'str'}, - 'overwrite_existing_domain': {'key': 'overwriteExistingDomain', 'type': 'bool'}, + "status": {"key": "status", "type": "str"}, + "cert": {"key": "cert", "type": "str"}, + "key": {"key": "key", "type": "str"}, + "cname": {"key": "cname", "type": "str"}, + "leaf_domain_label": {"key": "leafDomainLabel", "type": "str"}, + "overwrite_existing_domain": { + "key": "overwriteExistingDomain", + "type": "bool", + }, } def __init__( @@ -18338,9 +19588,18 @@ class StackEnsembleSettings(msrest.serialization.Model): """ _attribute_map = { - 'stack_meta_learner_k_wargs': {'key': 'stackMetaLearnerKWargs', 'type': 'object'}, - 'stack_meta_learner_train_percentage': {'key': 'stackMetaLearnerTrainPercentage', 'type': 'float'}, - 'stack_meta_learner_type': {'key': 'stackMetaLearnerType', 'type': 'str'}, + "stack_meta_learner_k_wargs": { + "key": "stackMetaLearnerKWargs", + "type": "object", + }, + "stack_meta_learner_train_percentage": { + "key": "stackMetaLearnerTrainPercentage", + "type": "float", + }, + "stack_meta_learner_type": { + "key": "stackMetaLearnerType", + "type": "str", + }, } def __init__( @@ -18348,7 +19607,9 @@ def __init__( *, stack_meta_learner_k_wargs: Optional[Any] = None, stack_meta_learner_train_percentage: Optional[float] = 0.2, - stack_meta_learner_type: Optional[Union[str, "StackMetaLearnerType"]] = None, + stack_meta_learner_type: Optional[ + Union[str, "StackMetaLearnerType"] + ] = None, **kwargs ): """ @@ -18368,7 +19629,9 @@ def __init__( """ super(StackEnsembleSettings, self).__init__(**kwargs) self.stack_meta_learner_k_wargs = stack_meta_learner_k_wargs - self.stack_meta_learner_train_percentage = stack_meta_learner_train_percentage + self.stack_meta_learner_train_percentage = ( + stack_meta_learner_train_percentage + ) self.stack_meta_learner_type = stack_meta_learner_type @@ -18431,35 +19694,41 @@ class SweepJob(JobBaseProperties): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'objective': {'required': True}, - 'sampling_algorithm': {'required': True}, - 'search_space': {'required': True}, - 'trial': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'SweepJobLimits'}, - 'objective': {'key': 'objective', 'type': 'Objective'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'SamplingAlgorithm'}, - 'search_space': {'key': 'searchSpace', 'type': 'object'}, - 'trial': {'key': 'trial', 'type': 'TrialComponent'}, + "job_type": {"required": True}, + "status": {"readonly": True}, + "objective": {"required": True}, + "sampling_algorithm": {"required": True}, + "search_space": {"required": True}, + "trial": {"required": True}, + } + + _attribute_map = { + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "limits": {"key": "limits", "type": "SweepJobLimits"}, + "objective": {"key": "objective", "type": "Objective"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "sampling_algorithm": { + "key": "samplingAlgorithm", + "type": "SamplingAlgorithm", + }, + "search_space": {"key": "searchSpace", "type": "object"}, + "trial": {"key": "trial", "type": "TrialComponent"}, } def __init__( @@ -18529,8 +19798,20 @@ def __init__( :keyword trial: Required. [Required] Trial component definition. :paramtype trial: ~azure.mgmt.machinelearningservices.models.TrialComponent """ - super(SweepJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, services=services, **kwargs) - self.job_type = 'Sweep' # type: str + super(SweepJob, self).__init__( + description=description, + properties=properties, + tags=tags, + component_id=component_id, + compute_id=compute_id, + display_name=display_name, + experiment_name=experiment_name, + identity=identity, + is_archived=is_archived, + services=services, + **kwargs + ) + self.job_type = "Sweep" # type: str self.early_termination = early_termination self.inputs = inputs self.limits = limits @@ -18561,15 +19842,15 @@ class SweepJobLimits(JobLimits): """ _validation = { - 'job_limits_type': {'required': True}, + "job_limits_type": {"required": True}, } _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_total_trials': {'key': 'maxTotalTrials', 'type': 'int'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, + "job_limits_type": {"key": "jobLimitsType", "type": "str"}, + "timeout": {"key": "timeout", "type": "duration"}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_total_trials": {"key": "maxTotalTrials", "type": "int"}, + "trial_timeout": {"key": "trialTimeout", "type": "duration"}, } def __init__( @@ -18593,7 +19874,7 @@ def __init__( :paramtype trial_timeout: ~datetime.timedelta """ super(SweepJobLimits, self).__init__(timeout=timeout, **kwargs) - self.job_limits_type = 'Sweep' # type: str + self.job_limits_type = "Sweep" # type: str self.max_concurrent_trials = max_concurrent_trials self.max_total_trials = max_total_trials self.trial_timeout = trial_timeout @@ -18638,28 +19919,31 @@ class SynapseSpark(Compute): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + "disable_local_auth": {"readonly": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'SynapseSparkProperties'}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, + "properties": {"key": "properties", "type": "SynapseSparkProperties"}, } def __init__( @@ -18678,8 +19962,10 @@ def __init__( :keyword properties: :paramtype properties: ~azure.mgmt.machinelearningservices.models.SynapseSparkProperties """ - super(SynapseSpark, self).__init__(description=description, resource_id=resource_id, **kwargs) - self.compute_type = 'SynapseSpark' # type: str + super(SynapseSpark, self).__init__( + description=description, resource_id=resource_id, **kwargs + ) + self.compute_type = "SynapseSpark" # type: str self.properties = properties @@ -18709,16 +19995,22 @@ class SynapseSparkProperties(msrest.serialization.Model): """ _attribute_map = { - 'auto_scale_properties': {'key': 'autoScaleProperties', 'type': 'AutoScaleProperties'}, - 'auto_pause_properties': {'key': 'autoPauseProperties', 'type': 'AutoPauseProperties'}, - 'spark_version': {'key': 'sparkVersion', 'type': 'str'}, - 'node_count': {'key': 'nodeCount', 'type': 'int'}, - 'node_size': {'key': 'nodeSize', 'type': 'str'}, - 'node_size_family': {'key': 'nodeSizeFamily', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'workspace_name': {'key': 'workspaceName', 'type': 'str'}, - 'pool_name': {'key': 'poolName', 'type': 'str'}, + "auto_scale_properties": { + "key": "autoScaleProperties", + "type": "AutoScaleProperties", + }, + "auto_pause_properties": { + "key": "autoPauseProperties", + "type": "AutoPauseProperties", + }, + "spark_version": {"key": "sparkVersion", "type": "str"}, + "node_count": {"key": "nodeCount", "type": "int"}, + "node_size": {"key": "nodeSize", "type": "str"}, + "node_size_family": {"key": "nodeSizeFamily", "type": "str"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, + "resource_group": {"key": "resourceGroup", "type": "str"}, + "workspace_name": {"key": "workspaceName", "type": "str"}, + "pool_name": {"key": "poolName", "type": "str"}, } def __init__( @@ -18793,12 +20085,12 @@ class SystemData(msrest.serialization.Model): """ _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + "created_by": {"key": "createdBy", "type": "str"}, + "created_by_type": {"key": "createdByType", "type": "str"}, + "created_at": {"key": "createdAt", "type": "iso-8601"}, + "last_modified_by": {"key": "lastModifiedBy", "type": "str"}, + "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"}, + "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, } def __init__( @@ -18852,23 +20144,19 @@ class SystemService(msrest.serialization.Model): """ _validation = { - 'system_service_type': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'version': {'readonly': True}, + "system_service_type": {"readonly": True}, + "public_ip_address": {"readonly": True}, + "version": {"readonly": True}, } _attribute_map = { - 'system_service_type': {'key': 'systemServiceType', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, + "system_service_type": {"key": "systemServiceType", "type": "str"}, + "public_ip_address": {"key": "publicIpAddress", "type": "str"}, + "version": {"key": "version", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(SystemService, self).__init__(**kwargs) self.system_service_type = None self.public_ip_address = None @@ -18902,23 +20190,39 @@ class TableVerticalFeaturizationSettings(FeaturizationSettings): """ _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - 'blocked_transformers': {'key': 'blockedTransformers', 'type': '[str]'}, - 'column_name_and_types': {'key': 'columnNameAndTypes', 'type': '{str}'}, - 'enable_dnn_featurization': {'key': 'enableDnnFeaturization', 'type': 'bool'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'transformer_params': {'key': 'transformerParams', 'type': '{[ColumnTransformer]}'}, + "dataset_language": {"key": "datasetLanguage", "type": "str"}, + "blocked_transformers": { + "key": "blockedTransformers", + "type": "[str]", + }, + "column_name_and_types": { + "key": "columnNameAndTypes", + "type": "{str}", + }, + "enable_dnn_featurization": { + "key": "enableDnnFeaturization", + "type": "bool", + }, + "mode": {"key": "mode", "type": "str"}, + "transformer_params": { + "key": "transformerParams", + "type": "{[ColumnTransformer]}", + }, } def __init__( self, *, dataset_language: Optional[str] = None, - blocked_transformers: Optional[List[Union[str, "BlockedTransformers"]]] = None, + blocked_transformers: Optional[ + List[Union[str, "BlockedTransformers"]] + ] = None, column_name_and_types: Optional[Dict[str, str]] = None, enable_dnn_featurization: Optional[bool] = False, mode: Optional[Union[str, "FeaturizationMode"]] = None, - transformer_params: Optional[Dict[str, List["ColumnTransformer"]]] = None, + transformer_params: Optional[ + Dict[str, List["ColumnTransformer"]] + ] = None, **kwargs ): """ @@ -18944,7 +20248,9 @@ def __init__( :paramtype transformer_params: dict[str, list[~azure.mgmt.machinelearningservices.models.ColumnTransformer]] """ - super(TableVerticalFeaturizationSettings, self).__init__(dataset_language=dataset_language, **kwargs) + super(TableVerticalFeaturizationSettings, self).__init__( + dataset_language=dataset_language, **kwargs + ) self.blocked_transformers = blocked_transformers self.column_name_and_types = column_name_and_types self.enable_dnn_featurization = enable_dnn_featurization @@ -18973,13 +20279,16 @@ class TableVerticalLimitSettings(msrest.serialization.Model): """ _attribute_map = { - 'enable_early_termination': {'key': 'enableEarlyTermination', 'type': 'bool'}, - 'exit_score': {'key': 'exitScore', 'type': 'float'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_cores_per_trial': {'key': 'maxCoresPerTrial', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, + "enable_early_termination": { + "key": "enableEarlyTermination", + "type": "bool", + }, + "exit_score": {"key": "exitScore", "type": "float"}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_cores_per_trial": {"key": "maxCoresPerTrial", "type": "int"}, + "max_trials": {"key": "maxTrials", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, + "trial_timeout": {"key": "trialTimeout", "type": "duration"}, } def __init__( @@ -19042,15 +20351,18 @@ class TargetUtilizationScaleSettings(OnlineScaleSettings): """ _validation = { - 'scale_type': {'required': True}, + "scale_type": {"required": True}, } _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - 'max_instances': {'key': 'maxInstances', 'type': 'int'}, - 'min_instances': {'key': 'minInstances', 'type': 'int'}, - 'polling_interval': {'key': 'pollingInterval', 'type': 'duration'}, - 'target_utilization_percentage': {'key': 'targetUtilizationPercentage', 'type': 'int'}, + "scale_type": {"key": "scaleType", "type": "str"}, + "max_instances": {"key": "maxInstances", "type": "int"}, + "min_instances": {"key": "minInstances", "type": "int"}, + "polling_interval": {"key": "pollingInterval", "type": "duration"}, + "target_utilization_percentage": { + "key": "targetUtilizationPercentage", + "type": "int", + }, } def __init__( @@ -19075,7 +20387,7 @@ def __init__( :paramtype target_utilization_percentage: int """ super(TargetUtilizationScaleSettings, self).__init__(**kwargs) - self.scale_type = 'TargetUtilization' # type: str + self.scale_type = "TargetUtilization" # type: str self.max_instances = max_instances self.min_instances = min_instances self.polling_interval = polling_interval @@ -19097,13 +20409,16 @@ class TensorFlow(DistributionConfiguration): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'parameter_server_count': {'key': 'parameterServerCount', 'type': 'int'}, - 'worker_count': {'key': 'workerCount', 'type': 'int'}, + "distribution_type": {"key": "distributionType", "type": "str"}, + "parameter_server_count": { + "key": "parameterServerCount", + "type": "int", + }, + "worker_count": {"key": "workerCount", "type": "int"}, } def __init__( @@ -19120,70 +20435,83 @@ def __init__( :paramtype worker_count: int """ super(TensorFlow, self).__init__(**kwargs) - self.distribution_type = 'TensorFlow' # type: str + self.distribution_type = "TensorFlow" # type: str self.parameter_server_count = parameter_server_count self.worker_count = worker_count class TextClassification(AutoMLVertical, NlpVertical): """Text Classification task in AutoML NLP vertical. -NLP - Natural Language Processing. + NLP - Natural Language Processing. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-Classification task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric for Text-Classification task. Possible values include: + "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, + "task_type": {"required": True}, + "training_data": {"required": True}, } _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( self, *, training_data: "MLTableJobInput", - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "NlpVerticalFeaturizationSettings" + ] = None, limit_settings: Optional["NlpVerticalLimitSettings"] = None, validation_data: Optional["MLTableJobInput"] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "ClassificationPrimaryMetrics"] + ] = None, **kwargs ): """ @@ -19208,11 +20536,19 @@ def __init__( :paramtype primary_metric: str or ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ - super(TextClassification, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, featurization_settings=featurization_settings, limit_settings=limit_settings, validation_data=validation_data, **kwargs) + super(TextClassification, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + featurization_settings=featurization_settings, + limit_settings=limit_settings, + validation_data=validation_data, + **kwargs + ) self.featurization_settings = featurization_settings self.limit_settings = limit_settings self.validation_data = validation_data - self.task_type = 'TextClassification' # type: str + self.task_type = "TextClassification" # type: str self.primary_metric = primary_metric self.log_verbosity = log_verbosity self.target_column_name = target_column_name @@ -19221,62 +20557,73 @@ def __init__( class TextClassificationMultilabel(AutoMLVertical, NlpVertical): """Text Classification Multilabel task in AutoML NLP vertical. -NLP - Natural Language Processing. + NLP - Natural Language Processing. - Variables are only populated by the server, and will be ignored when sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-Classification-Multilabel task. - Currently only Accuracy is supported as primary metric, hence user need not set it explicitly. - Possible values include: "AUCWeighted", "Accuracy", "NormMacroRecall", - "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric for Text-Classification-Multilabel task. + Currently only Accuracy is supported as primary metric, hence user need not set it explicitly. + Possible values include: "AUCWeighted", "Accuracy", "NormMacroRecall", + "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted", "IOU". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - 'primary_metric': {'readonly': True}, + "task_type": {"required": True}, + "training_data": {"required": True}, + "primary_metric": {"readonly": True}, } _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( self, *, training_data: "MLTableJobInput", - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "NlpVerticalFeaturizationSettings" + ] = None, limit_settings: Optional["NlpVerticalLimitSettings"] = None, validation_data: Optional["MLTableJobInput"] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, @@ -19300,11 +20647,19 @@ def __init__( :keyword training_data: Required. [Required] Training data input. :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ - super(TextClassificationMultilabel, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, featurization_settings=featurization_settings, limit_settings=limit_settings, validation_data=validation_data, **kwargs) + super(TextClassificationMultilabel, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + featurization_settings=featurization_settings, + limit_settings=limit_settings, + validation_data=validation_data, + **kwargs + ) self.featurization_settings = featurization_settings self.limit_settings = limit_settings self.validation_data = validation_data - self.task_type = 'TextClassificationMultilabel' # type: str + self.task_type = "TextClassificationMultilabel" # type: str self.primary_metric = None self.log_verbosity = log_verbosity self.target_column_name = target_column_name @@ -19313,63 +20668,74 @@ def __init__( class TextNer(AutoMLVertical, NlpVertical): """Text-NER task in AutoML NLP vertical. -NER - Named Entity Recognition. -NLP - Natural Language Processing. + NER - Named Entity Recognition. + NLP - Natural Language Processing. - Variables are only populated by the server, and will be ignored when sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-NER task. - Only 'Accuracy' is supported for Text-NER, so user need not set this explicitly. Possible - values include: "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric for Text-NER task. + Only 'Accuracy' is supported for Text-NER, so user need not set this explicitly. Possible + values include: "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - 'primary_metric': {'readonly': True}, + "task_type": {"required": True}, + "training_data": {"required": True}, + "primary_metric": {"readonly": True}, } _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( self, *, training_data: "MLTableJobInput", - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "NlpVerticalFeaturizationSettings" + ] = None, limit_settings: Optional["NlpVerticalLimitSettings"] = None, validation_data: Optional["MLTableJobInput"] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, @@ -19393,11 +20759,19 @@ def __init__( :keyword training_data: Required. [Required] Training data input. :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ - super(TextNer, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, featurization_settings=featurization_settings, limit_settings=limit_settings, validation_data=validation_data, **kwargs) + super(TextNer, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + featurization_settings=featurization_settings, + limit_settings=limit_settings, + validation_data=validation_data, + **kwargs + ) self.featurization_settings = featurization_settings self.limit_settings = limit_settings self.validation_data = validation_data - self.task_type = 'TextNER' # type: str + self.task_type = "TextNER" # type: str self.primary_metric = None self.log_verbosity = log_verbosity self.target_column_name = target_column_name @@ -19427,17 +20801,27 @@ class TrialComponent(msrest.serialization.Model): """ _validation = { - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "command": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "environment_id": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, + "code_id": {"key": "codeId", "type": "str"}, + "command": {"key": "command", "type": "str"}, + "distribution": { + "key": "distribution", + "type": "DistributionConfiguration", + }, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "resources": {"key": "resources", "type": "JobResourceConfiguration"}, } def __init__( @@ -19496,15 +20880,15 @@ class TritonModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -19524,10 +20908,12 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(TritonModelJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(TritonModelJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'triton_model' # type: str + self.job_input_type = "triton_model" # type: str self.description = description @@ -19549,14 +20935,14 @@ class TritonModelJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -19575,10 +20961,12 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(TritonModelJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(TritonModelJobOutput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_output_type = 'triton_model' # type: str + self.job_output_type = "triton_model" # type: str self.description = description @@ -19600,14 +20988,17 @@ class TruncationSelectionPolicy(EarlyTerminationPolicy): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'truncation_percentage': {'key': 'truncationPercentage', 'type': 'int'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, + "truncation_percentage": { + "key": "truncationPercentage", + "type": "int", + }, } def __init__( @@ -19626,8 +21017,12 @@ def __init__( :keyword truncation_percentage: The percentage of runs to cancel at each evaluation interval. :paramtype truncation_percentage: int """ - super(TruncationSelectionPolicy, self).__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs) - self.policy_type = 'TruncationSelection' # type: str + super(TruncationSelectionPolicy, self).__init__( + delay_evaluation=delay_evaluation, + evaluation_interval=evaluation_interval, + **kwargs + ) + self.policy_type = "TruncationSelection" # type: str self.truncation_percentage = truncation_percentage @@ -19652,17 +21047,17 @@ class UpdateWorkspaceQuotas(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, + "id": {"readonly": True}, + "type": {"readonly": True}, + "unit": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "limit": {"key": "limit", "type": "long"}, + "unit": {"key": "unit", "type": "str"}, + "status": {"key": "status", "type": "str"}, } def __init__( @@ -19702,21 +21097,17 @@ class UpdateWorkspaceQuotasResult(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[UpdateWorkspaceQuotas]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[UpdateWorkspaceQuotas]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UpdateWorkspaceQuotasResult, self).__init__(**kwargs) self.value = None self.next_link = None @@ -19746,18 +21137,18 @@ class UriFileDataVersion(DataVersionBaseProperties): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, } def __init__( @@ -19786,8 +21177,16 @@ def __init__( Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20221001.Assets.DataVersionBase.DataType. :paramtype data_uri: str """ - super(UriFileDataVersion, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, **kwargs) - self.data_type = 'uri_file' # type: str + super(UriFileDataVersion, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + data_uri=data_uri, + **kwargs + ) + self.data_type = "uri_file" # type: str class UriFileJobInput(JobInput, AssetJobInput): @@ -19809,15 +21208,15 @@ class UriFileJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -19837,10 +21236,12 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(UriFileJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(UriFileJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'uri_file' # type: str + self.job_input_type = "uri_file" # type: str self.description = description @@ -19862,14 +21263,14 @@ class UriFileJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -19888,10 +21289,12 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(UriFileJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(UriFileJobOutput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_output_type = 'uri_file' # type: str + self.job_output_type = "uri_file" # type: str self.description = description @@ -19919,18 +21322,18 @@ class UriFolderDataVersion(DataVersionBaseProperties): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, } def __init__( @@ -19959,8 +21362,16 @@ def __init__( Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20221001.Assets.DataVersionBase.DataType. :paramtype data_uri: str """ - super(UriFolderDataVersion, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, **kwargs) - self.data_type = 'uri_folder' # type: str + super(UriFolderDataVersion, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + data_uri=data_uri, + **kwargs + ) + self.data_type = "uri_folder" # type: str class UriFolderJobInput(JobInput, AssetJobInput): @@ -19982,15 +21393,15 @@ class UriFolderJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -20010,10 +21421,12 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(UriFolderJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(UriFolderJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'uri_folder' # type: str + self.job_input_type = "uri_folder" # type: str self.description = description @@ -20035,14 +21448,14 @@ class UriFolderJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -20061,10 +21474,12 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(UriFolderJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(UriFolderJobOutput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_output_type = 'uri_folder' # type: str + self.job_output_type = "uri_folder" # type: str self.description = description @@ -20090,31 +21505,30 @@ class Usage(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'current_value': {'key': 'currentValue', 'type': 'long'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'name': {'key': 'name', 'type': 'UsageName'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ + "id": {"readonly": True}, + "aml_workspace_location": {"readonly": True}, + "type": {"readonly": True}, + "unit": {"readonly": True}, + "current_value": {"readonly": True}, + "limit": {"readonly": True}, + "name": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "aml_workspace_location": { + "key": "amlWorkspaceLocation", + "type": "str", + }, + "type": {"key": "type", "type": "str"}, + "unit": {"key": "unit", "type": "str"}, + "current_value": {"key": "currentValue", "type": "long"}, + "limit": {"key": "limit", "type": "long"}, + "name": {"key": "name", "type": "UsageName"}, + } + + def __init__(self, **kwargs): + """ """ super(Usage, self).__init__(**kwargs) self.id = None self.aml_workspace_location = None @@ -20137,21 +21551,17 @@ class UsageName(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, + "value": {"readonly": True}, + "localized_value": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + "value": {"key": "value", "type": "str"}, + "localized_value": {"key": "localizedValue", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UsageName, self).__init__(**kwargs) self.value = None self.localized_value = None @@ -20172,13 +21582,16 @@ class UserAccountCredentials(msrest.serialization.Model): """ _validation = { - 'admin_user_name': {'required': True}, + "admin_user_name": {"required": True}, } _attribute_map = { - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'admin_user_ssh_public_key': {'key': 'adminUserSshPublicKey', 'type': 'str'}, - 'admin_user_password': {'key': 'adminUserPassword', 'type': 'str'}, + "admin_user_name": {"key": "adminUserName", "type": "str"}, + "admin_user_ssh_public_key": { + "key": "adminUserSshPublicKey", + "type": "str", + }, + "admin_user_password": {"key": "adminUserPassword", "type": "str"}, } def __init__( @@ -20216,21 +21629,17 @@ class UserAssignedIdentity(msrest.serialization.Model): """ _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, + "principal_id": {"readonly": True}, + "client_id": {"readonly": True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, + "principal_id": {"key": "principalId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UserAssignedIdentity, self).__init__(**kwargs) self.principal_id = None self.client_id = None @@ -20248,24 +21657,22 @@ class UserIdentity(IdentityConfiguration): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UserIdentity, self).__init__(**kwargs) - self.identity_type = 'UserIdentity' # type: str + self.identity_type = "UserIdentity" # type: str -class UsernamePasswordAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class UsernamePasswordAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """UsernamePasswordAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -20288,16 +21695,19 @@ class UsernamePasswordAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionP """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionUsernamePassword'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionUsernamePassword", + }, } def __init__( @@ -20325,8 +21735,16 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword """ - super(UsernamePasswordAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'UsernamePassword' # type: str + super( + UsernamePasswordAuthTypeWorkspaceConnectionProperties, self + ).__init__( + category=category, + target=target, + value=value, + value_format=value_format, + **kwargs + ) + self.auth_type = "UsernamePassword" # type: str self.credentials = credentials @@ -20338,7 +21756,10 @@ class VirtualMachineSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, + "properties": { + "key": "properties", + "type": "VirtualMachineSchemaProperties", + }, } def __init__( @@ -20395,28 +21816,34 @@ class VirtualMachine(Compute, VirtualMachineSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + "disable_local_auth": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": { + "key": "properties", + "type": "VirtualMachineSchemaProperties", + }, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -20436,9 +21863,14 @@ def __init__( :keyword resource_id: ARM resource id of the underlying compute. :paramtype resource_id: str """ - super(VirtualMachine, self).__init__(description=description, resource_id=resource_id, properties=properties, **kwargs) + super(VirtualMachine, self).__init__( + description=description, + resource_id=resource_id, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'VirtualMachine' # type: str + self.compute_type = "VirtualMachine" # type: str self.compute_location = None self.provisioning_state = None self.description = description @@ -20460,19 +21892,14 @@ class VirtualMachineImage(msrest.serialization.Model): """ _validation = { - 'id': {'required': True}, + "id": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, } - def __init__( - self, - *, - id: str, - **kwargs - ): + def __init__(self, *, id: str, **kwargs): """ :keyword id: Required. Virtual Machine image path. :paramtype id: str @@ -20501,12 +21928,18 @@ class VirtualMachineSchemaProperties(msrest.serialization.Model): """ _attribute_map = { - 'virtual_machine_size': {'key': 'virtualMachineSize', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'notebook_server_port': {'key': 'notebookServerPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'is_notebook_instance_compute': {'key': 'isNotebookInstanceCompute', 'type': 'bool'}, + "virtual_machine_size": {"key": "virtualMachineSize", "type": "str"}, + "ssh_port": {"key": "sshPort", "type": "int"}, + "notebook_server_port": {"key": "notebookServerPort", "type": "int"}, + "address": {"key": "address", "type": "str"}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, + "is_notebook_instance_compute": { + "key": "isNotebookInstanceCompute", + "type": "bool", + }, } def __init__( @@ -20554,7 +21987,10 @@ class VirtualMachineSecretsSchema(msrest.serialization.Model): """ _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, } def __init__( @@ -20587,12 +22023,15 @@ class VirtualMachineSecrets(ComputeSecrets, VirtualMachineSecretsSchema): """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, + "compute_type": {"key": "computeType", "type": "str"}, } def __init__( @@ -20606,9 +22045,11 @@ def __init__( :paramtype administrator_account: ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials """ - super(VirtualMachineSecrets, self).__init__(administrator_account=administrator_account, **kwargs) + super(VirtualMachineSecrets, self).__init__( + administrator_account=administrator_account, **kwargs + ) self.administrator_account = administrator_account - self.compute_type = 'VirtualMachine' # type: str + self.compute_type = "VirtualMachine" # type: str class VirtualMachineSize(msrest.serialization.Model): @@ -20643,29 +22084,38 @@ class VirtualMachineSize(msrest.serialization.Model): """ _validation = { - 'name': {'readonly': True}, - 'family': {'readonly': True}, - 'v_cp_us': {'readonly': True}, - 'gpus': {'readonly': True}, - 'os_vhd_size_mb': {'readonly': True}, - 'max_resource_volume_mb': {'readonly': True}, - 'memory_gb': {'readonly': True}, - 'low_priority_capable': {'readonly': True}, - 'premium_io': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'v_cp_us': {'key': 'vCPUs', 'type': 'int'}, - 'gpus': {'key': 'gpus', 'type': 'int'}, - 'os_vhd_size_mb': {'key': 'osVhdSizeMB', 'type': 'int'}, - 'max_resource_volume_mb': {'key': 'maxResourceVolumeMB', 'type': 'int'}, - 'memory_gb': {'key': 'memoryGB', 'type': 'float'}, - 'low_priority_capable': {'key': 'lowPriorityCapable', 'type': 'bool'}, - 'premium_io': {'key': 'premiumIO', 'type': 'bool'}, - 'estimated_vm_prices': {'key': 'estimatedVMPrices', 'type': 'EstimatedVMPrices'}, - 'supported_compute_types': {'key': 'supportedComputeTypes', 'type': '[str]'}, + "name": {"readonly": True}, + "family": {"readonly": True}, + "v_cp_us": {"readonly": True}, + "gpus": {"readonly": True}, + "os_vhd_size_mb": {"readonly": True}, + "max_resource_volume_mb": {"readonly": True}, + "memory_gb": {"readonly": True}, + "low_priority_capable": {"readonly": True}, + "premium_io": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "family": {"key": "family", "type": "str"}, + "v_cp_us": {"key": "vCPUs", "type": "int"}, + "gpus": {"key": "gpus", "type": "int"}, + "os_vhd_size_mb": {"key": "osVhdSizeMB", "type": "int"}, + "max_resource_volume_mb": { + "key": "maxResourceVolumeMB", + "type": "int", + }, + "memory_gb": {"key": "memoryGB", "type": "float"}, + "low_priority_capable": {"key": "lowPriorityCapable", "type": "bool"}, + "premium_io": {"key": "premiumIO", "type": "bool"}, + "estimated_vm_prices": { + "key": "estimatedVMPrices", + "type": "EstimatedVMPrices", + }, + "supported_compute_types": { + "key": "supportedComputeTypes", + "type": "[str]", + }, } def __init__( @@ -20704,14 +22154,11 @@ class VirtualMachineSizeListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[VirtualMachineSize]'}, + "value": {"key": "value", "type": "[VirtualMachineSize]"}, } def __init__( - self, - *, - value: Optional[List["VirtualMachineSize"]] = None, - **kwargs + self, *, value: Optional[List["VirtualMachineSize"]] = None, **kwargs ): """ :keyword value: The list of virtual machine sizes supported by AmlCompute. @@ -20735,10 +22182,10 @@ class VirtualMachineSshCredentials(msrest.serialization.Model): """ _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'public_key_data': {'key': 'publicKeyData', 'type': 'str'}, - 'private_key_data': {'key': 'privateKeyData', 'type': 'str'}, + "username": {"key": "username", "type": "str"}, + "password": {"key": "password", "type": "str"}, + "public_key_data": {"key": "publicKeyData", "type": "str"}, + "private_key_data": {"key": "privateKeyData", "type": "str"}, } def __init__( @@ -20863,55 +22310,103 @@ class Workspace(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'workspace_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'service_provisioned_resource_group': {'readonly': True}, - 'private_link_count': {'readonly': True}, - 'private_endpoint_connections': {'readonly': True}, - 'notebook_info': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'storage_hns_enabled': {'readonly': True}, - 'ml_flow_tracking_uri': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'key_vault': {'key': 'properties.keyVault', 'type': 'str'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'storage_account': {'key': 'properties.storageAccount', 'type': 'str'}, - 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionProperty'}, - 'hbi_workspace': {'key': 'properties.hbiWorkspace', 'type': 'bool'}, - 'service_provisioned_resource_group': {'key': 'properties.serviceProvisionedResourceGroup', 'type': 'str'}, - 'private_link_count': {'key': 'properties.privateLinkCount', 'type': 'int'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'allow_public_access_when_behind_vnet': {'key': 'properties.allowPublicAccessWhenBehindVnet', 'type': 'bool'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, - 'shared_private_link_resources': {'key': 'properties.sharedPrivateLinkResources', 'type': '[SharedPrivateLinkResource]'}, - 'notebook_info': {'key': 'properties.notebookInfo', 'type': 'NotebookResourceInfo'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, - 'storage_hns_enabled': {'key': 'properties.storageHnsEnabled', 'type': 'bool'}, - 'ml_flow_tracking_uri': {'key': 'properties.mlFlowTrackingUri', 'type': 'str'}, - 'v1_legacy_mode': {'key': 'properties.v1LegacyMode', 'type': 'bool'}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "workspace_id": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "service_provisioned_resource_group": {"readonly": True}, + "private_link_count": {"readonly": True}, + "private_endpoint_connections": {"readonly": True}, + "notebook_info": {"readonly": True}, + "tenant_id": {"readonly": True}, + "storage_hns_enabled": {"readonly": True}, + "ml_flow_tracking_uri": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "workspace_id": {"key": "properties.workspaceId", "type": "str"}, + "description": {"key": "properties.description", "type": "str"}, + "friendly_name": {"key": "properties.friendlyName", "type": "str"}, + "key_vault": {"key": "properties.keyVault", "type": "str"}, + "application_insights": { + "key": "properties.applicationInsights", + "type": "str", + }, + "container_registry": { + "key": "properties.containerRegistry", + "type": "str", + }, + "storage_account": {"key": "properties.storageAccount", "type": "str"}, + "discovery_url": {"key": "properties.discoveryUrl", "type": "str"}, + "provisioning_state": { + "key": "properties.provisioningState", + "type": "str", + }, + "encryption": { + "key": "properties.encryption", + "type": "EncryptionProperty", + }, + "hbi_workspace": {"key": "properties.hbiWorkspace", "type": "bool"}, + "service_provisioned_resource_group": { + "key": "properties.serviceProvisionedResourceGroup", + "type": "str", + }, + "private_link_count": { + "key": "properties.privateLinkCount", + "type": "int", + }, + "image_build_compute": { + "key": "properties.imageBuildCompute", + "type": "str", + }, + "allow_public_access_when_behind_vnet": { + "key": "properties.allowPublicAccessWhenBehindVnet", + "type": "bool", + }, + "public_network_access": { + "key": "properties.publicNetworkAccess", + "type": "str", + }, + "private_endpoint_connections": { + "key": "properties.privateEndpointConnections", + "type": "[PrivateEndpointConnection]", + }, + "shared_private_link_resources": { + "key": "properties.sharedPrivateLinkResources", + "type": "[SharedPrivateLinkResource]", + }, + "notebook_info": { + "key": "properties.notebookInfo", + "type": "NotebookResourceInfo", + }, + "service_managed_resources_settings": { + "key": "properties.serviceManagedResourcesSettings", + "type": "ServiceManagedResourcesSettings", + }, + "primary_user_assigned_identity": { + "key": "properties.primaryUserAssignedIdentity", + "type": "str", + }, + "tenant_id": {"key": "properties.tenantId", "type": "str"}, + "storage_hns_enabled": { + "key": "properties.storageHnsEnabled", + "type": "bool", + }, + "ml_flow_tracking_uri": { + "key": "properties.mlFlowTrackingUri", + "type": "str", + }, + "v1_legacy_mode": {"key": "properties.v1LegacyMode", "type": "bool"}, } def __init__( @@ -20932,9 +22427,15 @@ def __init__( hbi_workspace: Optional[bool] = False, image_build_compute: Optional[str] = None, allow_public_access_when_behind_vnet: Optional[bool] = False, - public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, - shared_private_link_resources: Optional[List["SharedPrivateLinkResource"]] = None, - service_managed_resources_settings: Optional["ServiceManagedResourcesSettings"] = None, + public_network_access: Optional[ + Union[str, "PublicNetworkAccess"] + ] = None, + shared_private_link_resources: Optional[ + List["SharedPrivateLinkResource"] + ] = None, + service_managed_resources_settings: Optional[ + "ServiceManagedResourcesSettings" + ] = None, primary_user_assigned_identity: Optional[str] = None, v1_legacy_mode: Optional[bool] = False, **kwargs @@ -21013,12 +22514,16 @@ def __init__( self.service_provisioned_resource_group = None self.private_link_count = None self.image_build_compute = image_build_compute - self.allow_public_access_when_behind_vnet = allow_public_access_when_behind_vnet + self.allow_public_access_when_behind_vnet = ( + allow_public_access_when_behind_vnet + ) self.public_network_access = public_network_access self.private_endpoint_connections = None self.shared_private_link_resources = shared_private_link_resources self.notebook_info = None - self.service_managed_resources_settings = service_managed_resources_settings + self.service_managed_resources_settings = ( + service_managed_resources_settings + ) self.primary_user_assigned_identity = primary_user_assigned_identity self.tenant_id = None self.storage_hns_enabled = None @@ -21036,8 +22541,8 @@ class WorkspaceConnectionManagedIdentity(msrest.serialization.Model): """ _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, + "resource_id": {"key": "resourceId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, } def __init__( @@ -21066,15 +22571,10 @@ class WorkspaceConnectionPersonalAccessToken(msrest.serialization.Model): """ _attribute_map = { - 'pat': {'key': 'pat', 'type': 'str'}, + "pat": {"key": "pat", "type": "str"}, } - def __init__( - self, - *, - pat: Optional[str] = None, - **kwargs - ): + def __init__(self, *, pat: Optional[str] = None, **kwargs): """ :keyword pat: :paramtype pat: str @@ -21106,37 +22606,41 @@ class WorkspaceConnectionPropertiesV2BasicResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'WorkspaceConnectionPropertiesV2'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "WorkspaceConnectionPropertiesV2", + }, } def __init__( - self, - *, - properties: "WorkspaceConnectionPropertiesV2", - **kwargs + self, *, properties: "WorkspaceConnectionPropertiesV2", **kwargs ): """ :keyword properties: Required. :paramtype properties: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 """ - super(WorkspaceConnectionPropertiesV2BasicResource, self).__init__(**kwargs) + super(WorkspaceConnectionPropertiesV2BasicResource, self).__init__( + **kwargs + ) self.properties = properties -class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(msrest.serialization.Model): +class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult( + msrest.serialization.Model +): """WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult. Variables are only populated by the server, and will be ignored when sending a request. @@ -21149,18 +22653,23 @@ class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(msrest.seri """ _validation = { - 'next_link': {'readonly': True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[WorkspaceConnectionPropertiesV2BasicResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": { + "key": "value", + "type": "[WorkspaceConnectionPropertiesV2BasicResource]", + }, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( self, *, - value: Optional[List["WorkspaceConnectionPropertiesV2BasicResource"]] = None, + value: Optional[ + List["WorkspaceConnectionPropertiesV2BasicResource"] + ] = None, **kwargs ): """ @@ -21168,7 +22677,10 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource] """ - super(WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, self).__init__(**kwargs) + super( + WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, + self, + ).__init__(**kwargs) self.value = value self.next_link = None @@ -21181,20 +22693,17 @@ class WorkspaceConnectionSharedAccessSignature(msrest.serialization.Model): """ _attribute_map = { - 'sas': {'key': 'sas', 'type': 'str'}, + "sas": {"key": "sas", "type": "str"}, } - def __init__( - self, - *, - sas: Optional[str] = None, - **kwargs - ): + def __init__(self, *, sas: Optional[str] = None, **kwargs): """ :keyword sas: :paramtype sas: str """ - super(WorkspaceConnectionSharedAccessSignature, self).__init__(**kwargs) + super(WorkspaceConnectionSharedAccessSignature, self).__init__( + **kwargs + ) self.sas = sas @@ -21208,8 +22717,8 @@ class WorkspaceConnectionUsernamePassword(msrest.serialization.Model): """ _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, + "username": {"key": "username", "type": "str"}, + "password": {"key": "password", "type": "str"}, } def __init__( @@ -21242,8 +22751,8 @@ class WorkspaceListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[Workspace]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Workspace]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( @@ -21298,17 +22807,35 @@ class WorkspaceUpdateParameters(msrest.serialization.Model): """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "description": {"key": "properties.description", "type": "str"}, + "friendly_name": {"key": "properties.friendlyName", "type": "str"}, + "image_build_compute": { + "key": "properties.imageBuildCompute", + "type": "str", + }, + "service_managed_resources_settings": { + "key": "properties.serviceManagedResourcesSettings", + "type": "ServiceManagedResourcesSettings", + }, + "primary_user_assigned_identity": { + "key": "properties.primaryUserAssignedIdentity", + "type": "str", + }, + "public_network_access": { + "key": "properties.publicNetworkAccess", + "type": "str", + }, + "application_insights": { + "key": "properties.applicationInsights", + "type": "str", + }, + "container_registry": { + "key": "properties.containerRegistry", + "type": "str", + }, } def __init__( @@ -21320,9 +22847,13 @@ def __init__( description: Optional[str] = None, friendly_name: Optional[str] = None, image_build_compute: Optional[str] = None, - service_managed_resources_settings: Optional["ServiceManagedResourcesSettings"] = None, + service_managed_resources_settings: Optional[ + "ServiceManagedResourcesSettings" + ] = None, primary_user_assigned_identity: Optional[str] = None, - public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, + public_network_access: Optional[ + Union[str, "PublicNetworkAccess"] + ] = None, application_insights: Optional[str] = None, container_registry: Optional[str] = None, **kwargs @@ -21363,7 +22894,9 @@ def __init__( self.description = description self.friendly_name = friendly_name self.image_build_compute = image_build_compute - self.service_managed_resources_settings = service_managed_resources_settings + self.service_managed_resources_settings = ( + service_managed_resources_settings + ) self.primary_user_assigned_identity = primary_user_assigned_identity self.public_network_access = public_network_access self.application_insights = application_insights diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/__init__.py index 96b72908a0f1..7f3dc551607f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/__init__.py @@ -29,37 +29,39 @@ from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations from ._quotas_operations import QuotasOperations from ._compute_operations import ComputeOperations -from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_endpoint_connections_operations import ( + PrivateEndpointConnectionsOperations, +) from ._private_link_resources_operations import PrivateLinkResourcesOperations from ._workspace_connections_operations import WorkspaceConnectionsOperations from ._workspace_features_operations import WorkspaceFeaturesOperations __all__ = [ - 'BatchEndpointsOperations', - 'BatchDeploymentsOperations', - 'CodeContainersOperations', - 'CodeVersionsOperations', - 'ComponentContainersOperations', - 'ComponentVersionsOperations', - 'DataContainersOperations', - 'DataVersionsOperations', - 'DatastoresOperations', - 'EnvironmentContainersOperations', - 'EnvironmentVersionsOperations', - 'JobsOperations', - 'ModelContainersOperations', - 'ModelVersionsOperations', - 'OnlineEndpointsOperations', - 'OnlineDeploymentsOperations', - 'SchedulesOperations', - 'Operations', - 'WorkspacesOperations', - 'UsagesOperations', - 'VirtualMachineSizesOperations', - 'QuotasOperations', - 'ComputeOperations', - 'PrivateEndpointConnectionsOperations', - 'PrivateLinkResourcesOperations', - 'WorkspaceConnectionsOperations', - 'WorkspaceFeaturesOperations', + "BatchEndpointsOperations", + "BatchDeploymentsOperations", + "CodeContainersOperations", + "CodeVersionsOperations", + "ComponentContainersOperations", + "ComponentVersionsOperations", + "DataContainersOperations", + "DataVersionsOperations", + "DatastoresOperations", + "EnvironmentContainersOperations", + "EnvironmentVersionsOperations", + "JobsOperations", + "ModelContainersOperations", + "ModelVersionsOperations", + "OnlineEndpointsOperations", + "OnlineDeploymentsOperations", + "SchedulesOperations", + "Operations", + "WorkspacesOperations", + "UsagesOperations", + "VirtualMachineSizesOperations", + "QuotasOperations", + "ComputeOperations", + "PrivateEndpointConnectionsOperations", + "PrivateLinkResourcesOperations", + "WorkspaceConnectionsOperations", + "WorkspaceFeaturesOperations", ] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_batch_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_batch_deployments_operations.py index 85781f673e4b..a838256f0522 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_batch_deployments_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_batch_deployments_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -250,6 +262,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class BatchDeploymentsOperations(object): """BatchDeploymentsOperations operations. @@ -308,16 +321,21 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.BatchDeploymentTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -327,13 +345,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -351,7 +369,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("BatchDeploymentTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "BatchDeploymentTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -360,25 +381,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -389,15 +416,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -405,34 +433,47 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -468,14 +509,17 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -483,29 +527,33 @@ def begin_delete( # pylint: disable=inconsistent-return-statements endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def get( @@ -534,15 +582,18 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.BatchDeployment :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -550,32 +601,39 @@ def get( endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize("BatchDeployment", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore def _update_initial( self, @@ -587,16 +645,25 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.BatchDeployment"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchDeployment"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.BatchDeployment"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties') + _json = self._serialize.body( + body, + "PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties", + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -607,40 +674,55 @@ def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def begin_update( @@ -682,15 +764,22 @@ def begin_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -700,32 +789,38 @@ def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore def _create_or_update_initial( self, @@ -737,16 +832,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.BatchDeployment" - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'BatchDeployment') + _json = self._serialize.body(body, "BatchDeployment") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -757,39 +858,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchDeployment', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -830,15 +947,22 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -848,29 +972,35 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_batch_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_batch_endpoints_operations.py index a908e8aed5c5..a8e1d2483701 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_batch_endpoints_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_batch_endpoints_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -276,6 +288,7 @@ def build_list_keys_request( **kwargs ) + # fmt: on class BatchEndpointsOperations(object): """BatchEndpointsOperations operations. @@ -328,16 +341,21 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.BatchEndpointTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -345,13 +363,13 @@ def prepare_request(next_link=None): api_version=api_version, count=count, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -367,7 +385,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("BatchEndpointTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "BatchEndpointTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -376,25 +397,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -404,49 +431,63 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -479,43 +520,50 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace def get( @@ -541,47 +589,55 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.BatchEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize("BatchEndpoint", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore def _update_initial( self, @@ -592,16 +648,24 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.BatchEndpoint"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchEndpoint"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.BatchEndpoint"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') + _json = self._serialize.body( + body, "PartialMinimalTrackedResourceWithIdentity" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -611,40 +675,55 @@ def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace def begin_update( @@ -682,15 +761,20 @@ def begin_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -699,32 +783,38 @@ def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore def _create_or_update_initial( self, @@ -735,16 +825,20 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.BatchEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'BatchEndpoint') + _json = self._serialize.body(body, "BatchEndpoint") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -754,39 +848,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -823,15 +933,20 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -840,32 +955,38 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace def list_keys( @@ -891,44 +1012,54 @@ def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthKeys"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) + deserialized = self._deserialize("EndpointAuthKeys", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys"} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_code_containers_operations.py index 8c2fcb16c00a..e81a7d65fe63 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_code_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_code_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -190,6 +202,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class CodeContainersOperations(object): """CodeContainersOperations operations. @@ -239,29 +252,34 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -276,7 +294,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -285,25 +305,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -329,43 +355,51 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore @distributed_trace def get( @@ -391,47 +425,55 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize("CodeContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore @distributed_trace def create_or_update( @@ -460,16 +502,20 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeContainer') + _json = self._serialize.body(body, "CodeContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -479,33 +525,44 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_code_versions_operations.py index 42bdffe910a5..f881a37121d2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_code_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_code_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -204,6 +216,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class CodeVersionsOperations(object): """CodeVersionsOperations operations. @@ -262,16 +275,21 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -281,13 +299,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -305,7 +323,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -314,25 +334,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -361,15 +387,16 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -377,28 +404,35 @@ def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -427,15 +461,16 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -443,32 +478,39 @@ def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace def create_or_update( @@ -500,16 +542,20 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeVersion') + _json = self._serialize.body(body, "CodeVersion") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -520,33 +566,40 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_component_containers_operations.py index 27b265860b0a..7bd34d6b5667 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_component_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_component_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -193,6 +205,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class ComponentContainersOperations(object): """ComponentContainersOperations operations. @@ -245,16 +258,21 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -262,13 +280,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -284,7 +302,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -293,25 +314,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -337,43 +364,51 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore @distributed_trace def get( @@ -399,47 +434,59 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore @distributed_trace def create_or_update( @@ -468,16 +515,22 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentContainer') + _json = self._serialize.body(body, "ComponentContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -487,33 +540,44 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_component_versions_operations.py index 4bbe13757a7c..2a26f82d9db2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_component_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_component_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -207,6 +219,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class ComponentVersionsOperations(object): """ComponentVersionsOperations operations. @@ -268,16 +281,21 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -288,13 +306,13 @@ def prepare_request(next_link=None): top=top, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -313,7 +331,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -322,25 +342,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -369,15 +395,16 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -385,28 +412,35 @@ def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -435,15 +469,18 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -451,32 +488,39 @@ def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize("ComponentVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace def create_or_update( @@ -508,16 +552,22 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentVersion') + _json = self._serialize.body(body, "ComponentVersion") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -528,33 +578,44 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_compute_operations.py index a74f6c09f0ec..f4740fe57c68 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_compute_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_compute_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -431,6 +443,7 @@ def build_restart_request_initial( **kwargs ) + # fmt: on class ComputeOperations(object): """ComputeOperations operations. @@ -478,29 +491,34 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedComputeResourcesList] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedComputeResourcesList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedComputeResourcesList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -515,7 +533,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedComputeResourcesList", pipeline_response) + deserialized = self._deserialize( + "PaginatedComputeResourcesList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -524,25 +544,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes"} # type: ignore @distributed_trace def get( @@ -567,47 +593,57 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComputeResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize("ComputeResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore def _create_or_update_initial( self, @@ -618,16 +654,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.ComputeResource" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'ComputeResource') + _json = self._serialize.body(parameters, "ComputeResource") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -637,38 +679,49 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if response.status_code == 201: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComputeResource', pipeline_response) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -706,15 +759,22 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -723,32 +783,38 @@ def begin_create_or_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore def _update_initial( self, @@ -759,16 +825,22 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> "_models.ComputeResource" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'ClusterUpdateParameters') + _json = self._serialize.body(parameters, "ClusterUpdateParameters") request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -778,31 +850,36 @@ def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize("ComputeResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace def begin_update( @@ -839,15 +916,22 @@ def begin_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -856,32 +940,38 @@ def begin_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -892,15 +982,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -908,33 +999,41 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements compute_name=compute_name, api_version=api_version, underlying_resource_action=underlying_resource_action, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -970,14 +1069,17 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -985,29 +1087,33 @@ def begin_delete( # pylint: disable=inconsistent-return-statements compute_name=compute_name, underlying_resource_action=underlying_resource_action, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace def list_nodes( @@ -1033,29 +1139,34 @@ def list_nodes( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.AmlComputeNodesInformation] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlComputeNodesInformation"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.AmlComputeNodesInformation"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_nodes_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self.list_nodes.metadata['url'], + template_url=self.list_nodes.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_nodes_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -1070,7 +1181,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("AmlComputeNodesInformation", pipeline_response) + deserialized = self._deserialize( + "AmlComputeNodesInformation", pipeline_response + ) list_of_elem = deserialized.nodes if cls: list_of_elem = cls(list_of_elem) @@ -1079,25 +1192,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_nodes.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes"} # type: ignore + list_nodes.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes"} # type: ignore @distributed_trace def list_keys( @@ -1121,47 +1240,57 @@ def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ComputeSecrets :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeSecrets"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeSecrets"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComputeSecrets', pipeline_response) + deserialized = self._deserialize("ComputeSecrets", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys"} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys"} # type: ignore def _start_initial( # pylint: disable=inconsistent-return-statements self, @@ -1171,42 +1300,48 @@ def _start_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_start_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self._start_initial.metadata['url'], + template_url=self._start_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _start_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore - + _start_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore @distributed_trace def begin_start( # pylint: disable=inconsistent-return-statements @@ -1237,43 +1372,50 @@ def begin_start( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._start_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_start.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore + begin_start.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore def _stop_initial( # pylint: disable=inconsistent-return-statements self, @@ -1283,42 +1425,48 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_stop_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self._stop_initial.metadata['url'], + template_url=self._stop_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _stop_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore - + _stop_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore @distributed_trace def begin_stop( # pylint: disable=inconsistent-return-statements @@ -1349,43 +1497,50 @@ def begin_stop( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._stop_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_stop.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore + begin_stop.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore def _restart_initial( # pylint: disable=inconsistent-return-statements self, @@ -1395,42 +1550,48 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_restart_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self._restart_initial.metadata['url'], + template_url=self._restart_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _restart_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore - + _restart_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore @distributed_trace def begin_restart( # pylint: disable=inconsistent-return-statements @@ -1461,40 +1622,47 @@ def begin_restart( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._restart_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_restart.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore + begin_restart.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_data_containers_operations.py index 21c819068dae..30a675134c8f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_data_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_data_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -193,6 +205,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class DataContainersOperations(object): """DataContainersOperations operations. @@ -245,16 +258,21 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -262,13 +280,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -284,7 +302,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -293,25 +313,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -337,43 +363,51 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore @distributed_trace def get( @@ -399,47 +433,55 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize("DataContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore @distributed_trace def create_or_update( @@ -468,16 +510,20 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DataContainer') + _json = self._serialize.body(body, "DataContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -487,33 +533,44 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_data_versions_operations.py index bf1b67b9f6e1..bd9cf4252f83 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_data_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_data_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -210,6 +222,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class DataVersionsOperations(object): """DataVersionsOperations operations. @@ -278,16 +291,21 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -299,13 +317,13 @@ def prepare_request(next_link=None): skip=skip, tags=tags, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -325,7 +343,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataVersionBaseResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -334,25 +354,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -381,15 +407,16 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -397,28 +424,35 @@ def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -447,15 +481,18 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -463,32 +500,39 @@ def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize("DataVersionBase", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace def create_or_update( @@ -520,16 +564,22 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DataVersionBase') + _json = self._serialize.body(body, "DataVersionBase") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -540,33 +590,44 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_datastores_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_datastores_operations.py index a2d67b55ad73..6315dcf4ba88 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_datastores_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_datastores_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, List, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -250,6 +262,7 @@ def build_list_secrets_request( **kwargs ) + # fmt: on class DatastoresOperations(object): """DatastoresOperations operations. @@ -317,16 +330,21 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DatastoreResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -339,13 +357,13 @@ def prepare_request(next_link=None): search_text=search_text, order_by=order_by, order_by_asc=order_by_asc, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -366,7 +384,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("DatastoreResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DatastoreResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -375,25 +395,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -419,43 +445,51 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace def get( @@ -481,47 +515,55 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.Datastore :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Datastore"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Datastore"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Datastore', pipeline_response) + deserialized = self._deserialize("Datastore", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace def create_or_update( @@ -553,16 +595,20 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.Datastore :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Datastore"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Datastore"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'Datastore') + _json = self._serialize.body(body, "Datastore") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -573,36 +619,43 @@ def create_or_update( content_type=content_type, json=_json, skip_validation=skip_validation, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('Datastore', pipeline_response) + deserialized = self._deserialize("Datastore", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('Datastore', pipeline_response) + deserialized = self._deserialize("Datastore", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace def list_secrets( @@ -628,44 +681,54 @@ def list_secrets( :rtype: ~azure.mgmt.machinelearningservices.models.DatastoreSecrets :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreSecrets"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DatastoreSecrets"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_list_secrets_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.list_secrets.metadata['url'], + template_url=self.list_secrets.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DatastoreSecrets', pipeline_response) + deserialized = self._deserialize("DatastoreSecrets", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_secrets.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets"} # type: ignore - + list_secrets.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_environment_containers_operations.py index ee1f061bd07f..5b73f687acf4 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_environment_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_environment_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -193,6 +205,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class EnvironmentContainersOperations(object): """EnvironmentContainersOperations operations. @@ -245,16 +258,21 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -262,13 +280,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -284,7 +302,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -293,25 +314,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -337,43 +364,51 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore @distributed_trace def get( @@ -399,47 +434,59 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore @distributed_trace def create_or_update( @@ -468,16 +515,22 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentContainer') + _json = self._serialize.body(body, "EnvironmentContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -487,33 +540,44 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_environment_versions_operations.py index c262a3ac2cb9..0eb3b548cfde 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_environment_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_environment_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -207,6 +219,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class EnvironmentVersionsOperations(object): """EnvironmentVersionsOperations operations. @@ -268,16 +281,21 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -288,13 +306,13 @@ def prepare_request(next_link=None): top=top, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -313,7 +331,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersionResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -322,25 +343,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -369,15 +396,16 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -385,28 +413,35 @@ def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -435,15 +470,18 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -451,32 +489,41 @@ def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace def create_or_update( @@ -508,16 +555,22 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentVersion') + _json = self._serialize.body(body, "EnvironmentVersion") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -528,33 +581,44 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_jobs_operations.py index e27f83e495b0..844ef0787dd2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_jobs_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_jobs_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -240,6 +252,7 @@ def build_cancel_request_initial( **kwargs ) + # fmt: on class JobsOperations(object): """JobsOperations operations. @@ -298,16 +311,21 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.JobBaseResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -317,13 +335,13 @@ def prepare_request(next_link=None): job_type=job_type, tag=tag, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -341,7 +359,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("JobBaseResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "JobBaseResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -350,25 +370,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -378,49 +404,63 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -453,43 +493,50 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace def get( @@ -515,47 +562,55 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.JobBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.JobBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('JobBase', pipeline_response) + deserialized = self._deserialize("JobBase", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace def create_or_update( @@ -584,16 +639,20 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.JobBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.JobBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'JobBase') + _json = self._serialize.body(body, "JobBase") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -603,36 +662,43 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('JobBase', pipeline_response) + deserialized = self._deserialize("JobBase", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('JobBase', pipeline_response) + deserialized = self._deserialize("JobBase", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore def _cancel_initial( # pylint: disable=inconsistent-return-statements self, @@ -642,48 +708,57 @@ def _cancel_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_cancel_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self._cancel_initial.metadata['url'], + template_url=self._cancel_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _cancel_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore - + _cancel_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore @distributed_trace def begin_cancel( # pylint: disable=inconsistent-return-statements @@ -716,40 +791,51 @@ def begin_cancel( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._cancel_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_cancel.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore + begin_cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_model_containers_operations.py index fd47a2ec7deb..42332fd84047 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_model_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_model_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -196,6 +208,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class ModelContainersOperations(object): """ModelContainersOperations operations. @@ -251,16 +264,21 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -269,13 +287,13 @@ def prepare_request(next_link=None): skip=skip, count=count, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -292,7 +310,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -301,25 +321,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -345,43 +371,51 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore @distributed_trace def get( @@ -407,47 +441,57 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize("ModelContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore @distributed_trace def create_or_update( @@ -476,16 +520,22 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelContainer') + _json = self._serialize.body(body, "ModelContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -495,33 +545,44 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_model_versions_operations.py index b0195cd2a027..e3d759aaef09 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_model_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_model_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -225,6 +237,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class ModelVersionsOperations(object): """ModelVersionsOperations operations. @@ -306,16 +319,21 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -332,13 +350,13 @@ def prepare_request(next_link=None): properties=properties, feed=feed, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -363,7 +381,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -372,25 +392,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -419,15 +445,16 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -435,28 +462,35 @@ def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -485,15 +519,16 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -501,32 +536,39 @@ def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace def create_or_update( @@ -558,16 +600,20 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelVersion') + _json = self._serialize.body(body, "ModelVersion") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -578,33 +624,40 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_online_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_online_deployments_operations.py index 5bb9ef9e0c2a..a47289e142ec 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_online_deployments_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_online_deployments_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -341,6 +353,7 @@ def build_list_skus_request( **kwargs ) + # fmt: on class OnlineDeploymentsOperations(object): """OnlineDeploymentsOperations operations. @@ -399,16 +412,21 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.OnlineDeploymentTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -418,13 +436,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -442,7 +460,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineDeploymentTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "OnlineDeploymentTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -451,25 +472,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -480,15 +507,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -496,34 +524,47 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -559,14 +600,17 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -574,29 +618,33 @@ def begin_delete( # pylint: disable=inconsistent-return-statements endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def get( @@ -625,15 +673,18 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.OnlineDeployment :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -641,32 +692,39 @@ def get( endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize("OnlineDeployment", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore def _update_initial( self, @@ -678,16 +736,24 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.OnlineDeployment"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineDeployment"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.OnlineDeployment"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSku') + _json = self._serialize.body( + body, "PartialMinimalTrackedResourceWithSku" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -698,40 +764,55 @@ def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def begin_update( @@ -772,15 +853,22 @@ def begin_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -790,32 +878,38 @@ def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore def _create_or_update_initial( self, @@ -827,16 +921,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.OnlineDeployment" - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'OnlineDeployment') + _json = self._serialize.body(body, "OnlineDeployment") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -847,39 +947,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -920,15 +1036,22 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -938,32 +1061,38 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def get_logs( @@ -995,16 +1124,22 @@ def get_logs( :rtype: ~azure.mgmt.machinelearningservices.models.DeploymentLogs :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentLogs"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DeploymentLogs"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DeploymentLogsRequest') + _json = self._serialize.body(body, "DeploymentLogsRequest") request = build_get_logs_request( subscription_id=self._config.subscription_id, @@ -1015,32 +1150,39 @@ def get_logs( api_version=api_version, content_type=content_type, json=_json, - template_url=self.get_logs.metadata['url'], + template_url=self.get_logs.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DeploymentLogs', pipeline_response) + deserialized = self._deserialize("DeploymentLogs", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_logs.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs"} # type: ignore - + get_logs.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs"} # type: ignore @distributed_trace def list_skus( @@ -1077,16 +1219,21 @@ def list_skus( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.SkuResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.SkuResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_skus_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -1096,13 +1243,13 @@ def prepare_request(next_link=None): api_version=api_version, count=count, skip=skip, - template_url=self.list_skus.metadata['url'], + template_url=self.list_skus.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_skus_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -1120,7 +1267,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("SkuResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "SkuResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1129,22 +1278,28 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_skus.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus"} # type: ignore + list_skus.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_online_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_online_endpoints_operations.py index 20dceffac04f..d1accf60b21b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_online_endpoints_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_online_endpoints_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -372,6 +384,7 @@ def build_get_token_request( **kwargs ) + # fmt: on class OnlineEndpointsOperations(object): """OnlineEndpointsOperations operations. @@ -442,16 +455,21 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.OnlineEndpointTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -464,13 +482,13 @@ def prepare_request(next_link=None): tags=tags, properties=properties, order_by=order_by, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -491,7 +509,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineEndpointTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "OnlineEndpointTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -500,25 +521,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -528,49 +555,63 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -603,43 +644,50 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace def get( @@ -665,47 +713,57 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.OnlineEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize("OnlineEndpoint", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore def _update_initial( self, @@ -716,16 +774,24 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.OnlineEndpoint"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineEndpoint"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.OnlineEndpoint"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') + _json = self._serialize.body( + body, "PartialMinimalTrackedResourceWithIdentity" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -735,40 +801,55 @@ def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace def begin_update( @@ -807,15 +888,22 @@ def begin_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -824,32 +912,38 @@ def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore def _create_or_update_initial( self, @@ -860,16 +954,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.OnlineEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'OnlineEndpoint') + _json = self._serialize.body(body, "OnlineEndpoint") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -879,39 +979,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -949,15 +1065,22 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -966,32 +1089,38 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace def list_keys( @@ -1017,47 +1146,57 @@ def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthKeys"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) + deserialized = self._deserialize("EndpointAuthKeys", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys"} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys"} # type: ignore def _regenerate_keys_initial( # pylint: disable=inconsistent-return-statements self, @@ -1068,16 +1207,20 @@ def _regenerate_keys_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'RegenerateEndpointKeysRequest') + _json = self._serialize.body(body, "RegenerateEndpointKeysRequest") request = build_regenerate_keys_request_initial( subscription_id=self._config.subscription_id, @@ -1087,33 +1230,41 @@ def _regenerate_keys_initial( # pylint: disable=inconsistent-return-statements api_version=api_version, content_type=content_type, json=_json, - template_url=self._regenerate_keys_initial.metadata['url'], + template_url=self._regenerate_keys_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _regenerate_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore - + _regenerate_keys_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore @distributed_trace def begin_regenerate_keys( # pylint: disable=inconsistent-return-statements @@ -1149,15 +1300,20 @@ def begin_regenerate_keys( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._regenerate_keys_initial( resource_group_name=resource_group_name, @@ -1166,29 +1322,37 @@ def begin_regenerate_keys( # pylint: disable=inconsistent-return-statements body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_regenerate_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore + begin_regenerate_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore @distributed_trace def get_token( @@ -1214,44 +1378,56 @@ def get_token( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthToken :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthToken"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthToken"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_get_token_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.get_token.metadata['url'], + template_url=self.get_token.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EndpointAuthToken', pipeline_response) + deserialized = self._deserialize( + "EndpointAuthToken", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token"} # type: ignore - + get_token.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_operations.py index 6ba396209174..8f3000ef9e56 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -57,6 +69,7 @@ def build_list_request( **kwargs ) + # fmt: on class Operations(object): """Operations operations. @@ -82,8 +95,7 @@ def __init__(self, client, config, serializer, deserializer): @distributed_trace def list( - self, - **kwargs # type: Any + self, **kwargs # type: Any ): # type: (...) -> Iterable["_models.AmlOperationListResult"] """Lists all of the available Azure Machine Learning Workspaces REST API operations. @@ -95,25 +107,30 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.AmlOperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlOperationListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.AmlOperationListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( api_version=api_version, template_url=next_link, @@ -124,7 +141,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("AmlOperationListResult", pipeline_response) + deserialized = self._deserialize( + "AmlOperationListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -133,22 +152,28 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/providers/Microsoft.MachineLearningServices/operations"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.MachineLearningServices/operations"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_private_endpoint_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_private_endpoint_connections_operations.py index 7b0dfce57621..6a009d16405c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_private_endpoint_connections_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -187,6 +199,7 @@ def build_delete_request( **kwargs ) + # fmt: on class PrivateEndpointConnectionsOperations(object): """PrivateEndpointConnectionsOperations operations. @@ -231,28 +244,33 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnectionListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( resource_group_name=resource_group_name, workspace_name=workspace_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( resource_group_name=resource_group_name, workspace_name=workspace_name, @@ -266,7 +284,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) + deserialized = self._deserialize( + "PrivateEndpointConnectionListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -275,25 +295,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections"} # type: ignore @distributed_trace def get( @@ -318,47 +344,59 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, private_endpoint_connection_name=private_endpoint_connection_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + deserialized = self._deserialize( + "PrivateEndpointConnection", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace def create_or_update( @@ -386,16 +424,22 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(properties, 'PrivateEndpointConnection') + _json = self._serialize.body(properties, "PrivateEndpointConnection") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -405,32 +449,41 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + deserialized = self._deserialize( + "PrivateEndpointConnection", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -455,40 +508,48 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, private_endpoint_connection_name=private_endpoint_connection_name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_private_link_resources_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_private_link_resources_operations.py index bda5baaae2cb..7436828a6968 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_private_link_resources_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_private_link_resources_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest @@ -23,8 +29,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -66,6 +78,7 @@ def build_list_request( **kwargs ) + # fmt: on class PrivateLinkResourcesOperations(object): """PrivateLinkResourcesOperations operations. @@ -108,43 +121,55 @@ def list( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateLinkResourceListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateLinkResourceListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateLinkResourceListResult', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "PrivateLinkResourceListResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources"} # type: ignore - + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_quotas_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_quotas_operations.py index 165211ca1c78..b199a96b9981 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_quotas_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_quotas_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -103,6 +115,7 @@ def build_list_request( **kwargs ) + # fmt: on class QuotasOperations(object): """QuotasOperations operations. @@ -145,16 +158,22 @@ def update( :rtype: ~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotasResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'QuotaUpdateParameters') + _json = self._serialize.body(parameters, "QuotaUpdateParameters") request = build_update_request( location=location, @@ -162,32 +181,41 @@ def update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.update.metadata['url'], + template_url=self.update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('UpdateWorkspaceQuotasResult', pipeline_response) + deserialized = self._deserialize( + "UpdateWorkspaceQuotasResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas"} # type: ignore - + update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas"} # type: ignore @distributed_trace def list( @@ -206,27 +234,32 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListWorkspaceQuotas] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceQuotas"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListWorkspaceQuotas"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, @@ -239,7 +272,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ListWorkspaceQuotas", pipeline_response) + deserialized = self._deserialize( + "ListWorkspaceQuotas", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -248,22 +283,28 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_schedules_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_schedules_operations.py index f6063526d2ac..4211daa307e8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_schedules_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_schedules_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -195,6 +207,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class SchedulesOperations(object): """SchedulesOperations operations. @@ -247,16 +260,21 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ScheduleResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduleResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ScheduleResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -264,13 +282,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -286,7 +304,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ScheduleResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ScheduleResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -295,25 +315,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -323,49 +349,63 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -398,43 +438,50 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @distributed_trace def get( @@ -460,47 +507,55 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.Schedule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Schedule"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Schedule', pipeline_response) + deserialized = self._deserialize("Schedule", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore def _create_or_update_initial( self, @@ -511,16 +566,20 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.Schedule" - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Schedule"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'Schedule') + _json = self._serialize.body(body, "Schedule") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -530,39 +589,51 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('Schedule', pipeline_response) + deserialized = self._deserialize("Schedule", pipeline_response) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('Schedule', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("Schedule", pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -598,15 +669,20 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Schedule] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Schedule"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -615,29 +691,33 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Schedule', pipeline_response) + deserialized = self._deserialize("Schedule", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_usages_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_usages_operations.py index d35d00613ef5..c565a64287f3 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_usages_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_usages_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -65,6 +77,7 @@ def build_list_request( **kwargs ) + # fmt: on class UsagesOperations(object): """UsagesOperations operations. @@ -106,27 +119,32 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListUsagesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListUsagesResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, @@ -139,7 +157,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ListUsagesResult", pipeline_response) + deserialized = self._deserialize( + "ListUsagesResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -148,22 +168,28 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_virtual_machine_sizes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_virtual_machine_sizes_operations.py index 57dac5e010c2..8886aced7d1d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_virtual_machine_sizes_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest @@ -23,8 +29,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -64,6 +76,7 @@ def build_list_request( **kwargs ) + # fmt: on class VirtualMachineSizesOperations(object): """VirtualMachineSizesOperations operations. @@ -103,42 +116,54 @@ def list( :rtype: ~azure.mgmt.machinelearningservices.models.VirtualMachineSizeListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_list_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualMachineSizeListResult', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "VirtualMachineSizeListResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes"} # type: ignore - + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_workspace_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_workspace_connections_operations.py index e4da5821753c..05764a0ae8d5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_workspace_connections_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_workspace_connections_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -193,6 +205,7 @@ def build_list_request( **kwargs ) + # fmt: on class WorkspaceConnectionsOperations(object): """WorkspaceConnectionsOperations operations. @@ -242,16 +255,24 @@ def create( :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'WorkspaceConnectionPropertiesV2BasicResource') + _json = self._serialize.body( + parameters, "WorkspaceConnectionPropertiesV2BasicResource" + ) request = build_create_request( subscription_id=self._config.subscription_id, @@ -261,32 +282,41 @@ def create( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create.metadata['url'], + template_url=self.create.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - + create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace def get( @@ -310,47 +340,59 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, connection_name=connection_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -374,43 +416,51 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, connection_name=connection_name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace def list( @@ -439,16 +489,21 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -456,13 +511,13 @@ def prepare_request(next_link=None): api_version=api_version, target=target, category=category, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -478,7 +533,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -487,22 +545,28 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_workspace_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_workspace_features_operations.py index d70e95269c79..8302785d813e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_workspace_features_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_workspace_features_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -67,6 +79,7 @@ def build_list_request( **kwargs ) + # fmt: on class WorkspaceFeaturesOperations(object): """WorkspaceFeaturesOperations operations. @@ -111,28 +124,33 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListAmlUserFeatureResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAmlUserFeatureResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListAmlUserFeatureResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -146,7 +164,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ListAmlUserFeatureResult", pipeline_response) + deserialized = self._deserialize( + "ListAmlUserFeatureResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -155,22 +175,28 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_workspaces_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_workspaces_operations.py index a95e8f4c3edd..2789fd06cd33 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_workspaces_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01/operations/_workspaces_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -559,6 +571,7 @@ def build_list_outbound_network_dependencies_endpoints_request( **kwargs ) + # fmt: on class WorkspacesOperations(object): """WorkspacesOperations operations. @@ -601,46 +614,54 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.Workspace :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore def _create_or_update_initial( self, @@ -650,16 +671,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.Workspace"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.Workspace"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'Workspace') + _json = self._serialize.body(parameters, "Workspace") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -668,33 +695,38 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -725,15 +757,20 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Workspace] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -741,32 +778,36 @@ def begin_create_or_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -775,41 +816,47 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -837,42 +884,49 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore def _update_initial( self, @@ -882,16 +936,22 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.Workspace"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.Workspace"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'WorkspaceUpdateParameters') + _json = self._serialize.body(parameters, "WorkspaceUpdateParameters") request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -900,33 +960,38 @@ def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace def begin_update( @@ -957,15 +1022,20 @@ def begin_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Workspace] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -973,32 +1043,36 @@ def begin_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace def list_by_resource_group( @@ -1020,28 +1094,33 @@ def list_by_resource_group( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_by_resource_group_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, api_version=api_version, skip=skip, - template_url=self.list_by_resource_group.metadata['url'], + template_url=self.list_by_resource_group.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_by_resource_group_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -1055,7 +1134,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1064,25 +1145,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore + list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore def _diagnose_initial( self, @@ -1092,17 +1179,25 @@ def _diagnose_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.DiagnoseResponseResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if parameters is not None: - _json = self._serialize.body(parameters, 'DiagnoseWorkspaceParameters') + _json = self._serialize.body( + parameters, "DiagnoseWorkspaceParameters" + ) else: _json = None @@ -1113,39 +1208,49 @@ def _diagnose_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._diagnose_initial.metadata['url'], + template_url=self._diagnose_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) + deserialized = self._deserialize( + "DiagnoseResponseResult", pipeline_response + ) if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _diagnose_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore - + _diagnose_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore @distributed_trace def begin_diagnose( @@ -1180,15 +1285,22 @@ def begin_diagnose( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.DiagnoseResponseResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnoseResponseResult"] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DiagnoseResponseResult"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._diagnose_initial( resource_group_name=resource_group_name, @@ -1196,32 +1308,42 @@ def begin_diagnose( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) + deserialized = self._deserialize( + "DiagnoseResponseResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_diagnose.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore + begin_diagnose.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore @distributed_trace def list_keys( @@ -1243,46 +1365,58 @@ def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListWorkspaceKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceKeysResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListWorkspaceKeysResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ListWorkspaceKeysResult', pipeline_response) + deserialized = self._deserialize( + "ListWorkspaceKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys"} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys"} # type: ignore def _resync_keys_initial( # pylint: disable=inconsistent-return-statements self, @@ -1291,41 +1425,47 @@ def _resync_keys_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_resync_keys_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self._resync_keys_initial.metadata['url'], + template_url=self._resync_keys_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _resync_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore - + _resync_keys_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore @distributed_trace def begin_resync_keys( # pylint: disable=inconsistent-return-statements @@ -1354,42 +1494,49 @@ def begin_resync_keys( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._resync_keys_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_resync_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore + begin_resync_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore @distributed_trace def list_by_subscription( @@ -1408,27 +1555,32 @@ def list_by_subscription( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, skip=skip, - template_url=self.list_by_subscription.metadata['url'], + template_url=self.list_by_subscription.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, @@ -1441,7 +1593,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1450,25 +1604,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore + list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore @distributed_trace def list_notebook_access_token( @@ -1489,46 +1649,58 @@ def list_notebook_access_token( :rtype: ~azure.mgmt.machinelearningservices.models.NotebookAccessTokenResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookAccessTokenResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.NotebookAccessTokenResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_list_notebook_access_token_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_notebook_access_token.metadata['url'], + template_url=self.list_notebook_access_token.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('NotebookAccessTokenResult', pipeline_response) + deserialized = self._deserialize( + "NotebookAccessTokenResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_notebook_access_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken"} # type: ignore - + list_notebook_access_token.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken"} # type: ignore def _prepare_notebook_initial( self, @@ -1537,47 +1709,57 @@ def _prepare_notebook_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.NotebookResourceInfo"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NotebookResourceInfo"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.NotebookResourceInfo"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_prepare_notebook_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self._prepare_notebook_initial.metadata['url'], + template_url=self._prepare_notebook_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) + deserialized = self._deserialize( + "NotebookResourceInfo", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _prepare_notebook_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore - + _prepare_notebook_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore @distributed_trace def begin_prepare_notebook( @@ -1607,45 +1789,60 @@ def begin_prepare_notebook( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.NotebookResourceInfo] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookResourceInfo"] + api_version = kwargs.pop("api_version", "2022-10-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.NotebookResourceInfo"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._prepare_notebook_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) + deserialized = self._deserialize( + "NotebookResourceInfo", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_prepare_notebook.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore + begin_prepare_notebook.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore @distributed_trace def list_storage_account_keys( @@ -1666,46 +1863,58 @@ def list_storage_account_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListStorageAccountKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListStorageAccountKeysResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListStorageAccountKeysResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_list_storage_account_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_storage_account_keys.metadata['url'], + template_url=self.list_storage_account_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ListStorageAccountKeysResult', pipeline_response) + deserialized = self._deserialize( + "ListStorageAccountKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_storage_account_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys"} # type: ignore - + list_storage_account_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys"} # type: ignore @distributed_trace def list_notebook_keys( @@ -1726,46 +1935,58 @@ def list_notebook_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListNotebookKeysResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListNotebookKeysResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_list_notebook_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_notebook_keys.metadata['url'], + template_url=self.list_notebook_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ListNotebookKeysResult', pipeline_response) + deserialized = self._deserialize( + "ListNotebookKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_notebook_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys"} # type: ignore - + list_notebook_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys"} # type: ignore @distributed_trace def list_outbound_network_dependencies_endpoints( @@ -1790,43 +2011,57 @@ def list_outbound_network_dependencies_endpoints( :rtype: ~azure.mgmt.machinelearningservices.models.ExternalFQDNResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExternalFQDNResponse"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ExternalFQDNResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: str - request = build_list_outbound_network_dependencies_endpoints_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], + template_url=self.list_outbound_network_dependencies_endpoints.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ExternalFQDNResponse', pipeline_response) + deserialized = self._deserialize( + "ExternalFQDNResponse", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_outbound_network_dependencies_endpoints.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints"} # type: ignore - + list_outbound_network_dependencies_endpoints.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/__init__.py index da46614477a9..71cf8fdc020d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/__init__.py @@ -10,9 +10,10 @@ from ._version import VERSION __version__ = VERSION -__all__ = ['AzureMachineLearningWorkspaces'] +__all__ = ["AzureMachineLearningWorkspaces"] # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk + patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/_azure_machine_learning_workspaces.py index d3c92e8135bc..8af9e9f3d446 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/_azure_machine_learning_workspaces.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/_azure_machine_learning_workspaces.py @@ -15,7 +15,45 @@ from . import models from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import BatchDeploymentsOperations, BatchEndpointsOperations, CodeContainersOperations, CodeVersionsOperations, ComponentContainersOperations, ComponentVersionsOperations, ComputeOperations, DataContainersOperations, DataVersionsOperations, DatastoresOperations, EnvironmentContainersOperations, EnvironmentVersionsOperations, JobsOperations, LabelingJobsOperations, ModelContainersOperations, ModelVersionsOperations, OnlineDeploymentsOperations, OnlineEndpointsOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, QuotasOperations, RegistriesOperations, RegistryCodeContainersOperations, RegistryCodeVersionsOperations, RegistryComponentContainersOperations, RegistryComponentVersionsOperations, RegistryEnvironmentContainersOperations, RegistryEnvironmentVersionsOperations, RegistryModelContainersOperations, RegistryModelVersionsOperations, SchedulesOperations, UsagesOperations, VirtualMachineSizesOperations, WorkspaceConnectionsOperations, WorkspaceFeaturesOperations, WorkspacesOperations +from .operations import ( + BatchDeploymentsOperations, + BatchEndpointsOperations, + CodeContainersOperations, + CodeVersionsOperations, + ComponentContainersOperations, + ComponentVersionsOperations, + ComputeOperations, + DataContainersOperations, + DataVersionsOperations, + DatastoresOperations, + EnvironmentContainersOperations, + EnvironmentVersionsOperations, + JobsOperations, + LabelingJobsOperations, + ModelContainersOperations, + ModelVersionsOperations, + OnlineDeploymentsOperations, + OnlineEndpointsOperations, + Operations, + PrivateEndpointConnectionsOperations, + PrivateLinkResourcesOperations, + QuotasOperations, + RegistriesOperations, + RegistryCodeContainersOperations, + RegistryCodeVersionsOperations, + RegistryComponentContainersOperations, + RegistryComponentVersionsOperations, + RegistryEnvironmentContainersOperations, + RegistryEnvironmentVersionsOperations, + RegistryModelContainersOperations, + RegistryModelVersionsOperations, + SchedulesOperations, + UsagesOperations, + VirtualMachineSizesOperations, + WorkspaceConnectionsOperations, + WorkspaceFeaturesOperations, + WorkspacesOperations, +) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -24,7 +62,10 @@ from azure.core.credentials import TokenCredential from azure.core.rest import HttpRequest, HttpResponse -class AzureMachineLearningWorkspaces(object): # pylint: disable=too-many-instance-attributes + +class AzureMachineLearningWorkspaces( + object +): # pylint: disable=too-many-instance-attributes """These APIs allow end users to operate on Azure Machine Learning Workspace resources. :ivar operations: Operations operations @@ -146,51 +187,138 @@ def __init__( **kwargs # type: Any ): # type: (...) -> None - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._config = AzureMachineLearningWorkspacesConfiguration( + credential=credential, subscription_id=subscription_id, **kwargs + ) + self._client = ARMPipelineClient( + base_url=base_url, config=self._config, **kwargs + ) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = { + k: v for k, v in models.__dict__.items() if isinstance(v, type) + } self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.workspaces = WorkspacesOperations(self._client, self._config, self._serialize, self._deserialize) - self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) - self.virtual_machine_sizes = VirtualMachineSizesOperations(self._client, self._config, self._serialize, self._deserialize) - self.quotas = QuotasOperations(self._client, self._config, self._serialize, self._deserialize) - self.compute = ComputeOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_connections = WorkspaceConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registries = RegistriesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_features = WorkspaceFeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_code_containers = RegistryCodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_code_versions = RegistryCodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_component_containers = RegistryComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_component_versions = RegistryComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_environment_containers = RegistryEnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_environment_versions = RegistryEnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_model_containers = RegistryModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_model_versions = RegistryModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_endpoints = BatchEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_deployments = BatchDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_containers = CodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_versions = CodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_containers = ComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_versions = ComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_containers = DataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_versions = DataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.datastores = DatastoresOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_containers = EnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_versions = EnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.labeling_jobs = LabelingJobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_containers = ModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_versions = ModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_endpoints = OnlineEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_deployments = OnlineDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.schedules = SchedulesOperations(self._client, self._config, self._serialize, self._deserialize) - + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspaces = WorkspacesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.usages = UsagesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.virtual_machine_sizes = VirtualMachineSizesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.quotas = QuotasOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.compute = ComputeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.private_endpoint_connections = ( + PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspace_connections = WorkspaceConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registries = RegistriesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspace_features = WorkspaceFeaturesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_code_containers = RegistryCodeContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_code_versions = RegistryCodeVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_component_containers = ( + RegistryComponentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.registry_component_versions = RegistryComponentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_environment_containers = ( + RegistryEnvironmentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.registry_environment_versions = ( + RegistryEnvironmentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.registry_model_containers = RegistryModelContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_model_versions = RegistryModelVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.batch_endpoints = BatchEndpointsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.batch_deployments = BatchDeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.code_containers = CodeContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.code_versions = CodeVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.component_containers = ComponentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.component_versions = ComponentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_containers = DataContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_versions = DataVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.datastores = DatastoresOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.environment_containers = EnvironmentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.environment_versions = EnvironmentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.jobs = JobsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.labeling_jobs = LabelingJobsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.model_containers = ModelContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.model_versions = ModelVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.online_endpoints = OnlineEndpointsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.online_deployments = OnlineDeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.schedules = SchedulesOperations( + self._client, self._config, self._serialize, self._deserialize + ) def _send_request( self, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/_configuration.py index f395f71d01fe..bcaa662d4032 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/_configuration.py @@ -10,7 +10,10 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ( + ARMChallengeAuthenticationPolicy, + ARMHttpLoggingPolicy, +) from ._version import VERSION @@ -21,7 +24,9 @@ from azure.core.credentials import TokenCredential -class AzureMachineLearningWorkspacesConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AzureMachineLearningWorkspacesConfiguration( + Configuration +): # pylint: disable=too-many-instance-attributes """Configuration for AzureMachineLearningWorkspaces. Note that all parameters used to create this instance are saved as instance @@ -43,8 +48,12 @@ def __init__( **kwargs # type: Any ): # type: (...) -> None - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + super(AzureMachineLearningWorkspacesConfiguration, self).__init__( + **kwargs + ) + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -54,23 +63,44 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = api_version - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) + self.credential_scopes = kwargs.pop( + "credential_scopes", ["https://management.azure.com/.default"] + ) + kwargs.setdefault( + "sdk_moniker", "mgmt-machinelearningservices/{}".format(VERSION) + ) self._configure(**kwargs) def _configure( - self, - **kwargs # type: Any + self, **kwargs # type: Any ): # type: (...) -> None - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') + self.user_agent_policy = kwargs.get( + "user_agent_policy" + ) or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get( + "headers_policy" + ) or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy( + **kwargs + ) + self.logging_policy = kwargs.get( + "logging_policy" + ) or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get( + "http_logging_policy" + ) or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy( + **kwargs + ) + self.custom_hook_policy = kwargs.get( + "custom_hook_policy" + ) or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get( + "redirect_policy" + ) or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = ARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/_patch.py index 74e48ecd07cf..17dbc073e01b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/_patch.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/_patch.py @@ -25,7 +25,8 @@ # # -------------------------------------------------------------------------- + # This file is used for handwritten extensions to the generated code. Example: # https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md def patch_sdk(): - pass \ No newline at end of file + pass diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/_vendor.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/_vendor.py index 138f663c53a4..ed3373e9699d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/_vendor.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/_vendor.py @@ -7,13 +7,20 @@ from azure.core.pipeline.transport import HttpRequest + def _convert_request(request, files=None): data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + request = HttpRequest( + method=request.method, + url=request.url, + headers=request.headers, + data=data, + ) if files: request.set_formdata_body(files) return request + def _format_url_section(template, **kwargs): components = template.split("/") while components: @@ -22,6 +29,8 @@ def _format_url_section(template, **kwargs): except KeyError as key: formatted_components = template.split("/") components = [ - c for c in formatted_components if "{}".format(key.args[0]) not in c + c + for c in formatted_components + if "{}".format(key.args[0]) not in c ] template = "/".join(components) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/__init__.py index f67ccda966f1..b90ec7485f14 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/__init__.py @@ -7,9 +7,11 @@ # -------------------------------------------------------------------------- from ._azure_machine_learning_workspaces import AzureMachineLearningWorkspaces -__all__ = ['AzureMachineLearningWorkspaces'] + +__all__ = ["AzureMachineLearningWorkspaces"] # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk + patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/_azure_machine_learning_workspaces.py index bd38eaf1f3d9..4a001f319b46 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/_azure_machine_learning_workspaces.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/_azure_machine_learning_workspaces.py @@ -16,13 +16,52 @@ from .. import models from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import BatchDeploymentsOperations, BatchEndpointsOperations, CodeContainersOperations, CodeVersionsOperations, ComponentContainersOperations, ComponentVersionsOperations, ComputeOperations, DataContainersOperations, DataVersionsOperations, DatastoresOperations, EnvironmentContainersOperations, EnvironmentVersionsOperations, JobsOperations, LabelingJobsOperations, ModelContainersOperations, ModelVersionsOperations, OnlineDeploymentsOperations, OnlineEndpointsOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, QuotasOperations, RegistriesOperations, RegistryCodeContainersOperations, RegistryCodeVersionsOperations, RegistryComponentContainersOperations, RegistryComponentVersionsOperations, RegistryEnvironmentContainersOperations, RegistryEnvironmentVersionsOperations, RegistryModelContainersOperations, RegistryModelVersionsOperations, SchedulesOperations, UsagesOperations, VirtualMachineSizesOperations, WorkspaceConnectionsOperations, WorkspaceFeaturesOperations, WorkspacesOperations +from .operations import ( + BatchDeploymentsOperations, + BatchEndpointsOperations, + CodeContainersOperations, + CodeVersionsOperations, + ComponentContainersOperations, + ComponentVersionsOperations, + ComputeOperations, + DataContainersOperations, + DataVersionsOperations, + DatastoresOperations, + EnvironmentContainersOperations, + EnvironmentVersionsOperations, + JobsOperations, + LabelingJobsOperations, + ModelContainersOperations, + ModelVersionsOperations, + OnlineDeploymentsOperations, + OnlineEndpointsOperations, + Operations, + PrivateEndpointConnectionsOperations, + PrivateLinkResourcesOperations, + QuotasOperations, + RegistriesOperations, + RegistryCodeContainersOperations, + RegistryCodeVersionsOperations, + RegistryComponentContainersOperations, + RegistryComponentVersionsOperations, + RegistryEnvironmentContainersOperations, + RegistryEnvironmentVersionsOperations, + RegistryModelContainersOperations, + RegistryModelVersionsOperations, + SchedulesOperations, + UsagesOperations, + VirtualMachineSizesOperations, + WorkspaceConnectionsOperations, + WorkspaceFeaturesOperations, + WorkspacesOperations, +) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class AzureMachineLearningWorkspaces: # pylint: disable=too-many-instance-attributes + +class AzureMachineLearningWorkspaces: # pylint: disable=too-many-instance-attributes """These APIs allow end users to operate on Azure Machine Learning Workspace resources. :ivar operations: Operations operations @@ -147,56 +186,141 @@ def __init__( base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._config = AzureMachineLearningWorkspacesConfiguration( + credential=credential, subscription_id=subscription_id, **kwargs + ) + self._client = AsyncARMPipelineClient( + base_url=base_url, config=self._config, **kwargs + ) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = { + k: v for k, v in models.__dict__.items() if isinstance(v, type) + } self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.workspaces = WorkspacesOperations(self._client, self._config, self._serialize, self._deserialize) - self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) - self.virtual_machine_sizes = VirtualMachineSizesOperations(self._client, self._config, self._serialize, self._deserialize) - self.quotas = QuotasOperations(self._client, self._config, self._serialize, self._deserialize) - self.compute = ComputeOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_connections = WorkspaceConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registries = RegistriesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_features = WorkspaceFeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_code_containers = RegistryCodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_code_versions = RegistryCodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_component_containers = RegistryComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_component_versions = RegistryComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_environment_containers = RegistryEnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_environment_versions = RegistryEnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_model_containers = RegistryModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_model_versions = RegistryModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_endpoints = BatchEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_deployments = BatchDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_containers = CodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_versions = CodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_containers = ComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_versions = ComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_containers = DataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_versions = DataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.datastores = DatastoresOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_containers = EnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_versions = EnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.labeling_jobs = LabelingJobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_containers = ModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_versions = ModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_endpoints = OnlineEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_deployments = OnlineDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.schedules = SchedulesOperations(self._client, self._config, self._serialize, self._deserialize) - + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspaces = WorkspacesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.usages = UsagesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.virtual_machine_sizes = VirtualMachineSizesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.quotas = QuotasOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.compute = ComputeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.private_endpoint_connections = ( + PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspace_connections = WorkspaceConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registries = RegistriesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspace_features = WorkspaceFeaturesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_code_containers = RegistryCodeContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_code_versions = RegistryCodeVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_component_containers = ( + RegistryComponentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.registry_component_versions = RegistryComponentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_environment_containers = ( + RegistryEnvironmentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.registry_environment_versions = ( + RegistryEnvironmentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.registry_model_containers = RegistryModelContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_model_versions = RegistryModelVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.batch_endpoints = BatchEndpointsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.batch_deployments = BatchDeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.code_containers = CodeContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.code_versions = CodeVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.component_containers = ComponentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.component_versions = ComponentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_containers = DataContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_versions = DataVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.datastores = DatastoresOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.environment_containers = EnvironmentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.environment_versions = EnvironmentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.jobs = JobsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.labeling_jobs = LabelingJobsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.model_containers = ModelContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.model_versions = ModelVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.online_endpoints = OnlineEndpointsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.online_deployments = OnlineDeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.schedules = SchedulesOperations( + self._client, self._config, self._serialize, self._deserialize + ) def _send_request( - self, - request: HttpRequest, - **kwargs: Any + self, request: HttpRequest, **kwargs: Any ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/_configuration.py index dde99f5c7bff..d534afb41834 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/_configuration.py @@ -10,7 +10,10 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy +from azure.mgmt.core.policies import ( + ARMHttpLoggingPolicy, + AsyncARMChallengeAuthenticationPolicy, +) from .._version import VERSION @@ -19,7 +22,9 @@ from azure.core.credentials_async import AsyncTokenCredential -class AzureMachineLearningWorkspacesConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AzureMachineLearningWorkspacesConfiguration( + Configuration +): # pylint: disable=too-many-instance-attributes """Configuration for AzureMachineLearningWorkspaces. Note that all parameters used to create this instance are saved as instance @@ -40,8 +45,12 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + super(AzureMachineLearningWorkspacesConfiguration, self).__init__( + **kwargs + ) + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -51,22 +60,41 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = api_version - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) + self.credential_scopes = kwargs.pop( + "credential_scopes", ["https://management.azure.com/.default"] + ) + kwargs.setdefault( + "sdk_moniker", "mgmt-machinelearningservices/{}".format(VERSION) + ) self._configure(**kwargs) - def _configure( - self, - **kwargs: Any - ) -> None: - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get( + "user_agent_policy" + ) or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get( + "headers_policy" + ) or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy( + **kwargs + ) + self.logging_policy = kwargs.get( + "logging_policy" + ) or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get( + "http_logging_policy" + ) or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get( + "retry_policy" + ) or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get( + "custom_hook_policy" + ) or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get( + "redirect_policy" + ) or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/_patch.py index 74e48ecd07cf..17dbc073e01b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/_patch.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/_patch.py @@ -25,7 +25,8 @@ # # -------------------------------------------------------------------------- + # This file is used for handwritten extensions to the generated code. Example: # https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md def patch_sdk(): - pass \ No newline at end of file + pass diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/__init__.py index 01fa2d886d14..90a9382c6dbd 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/__init__.py @@ -12,19 +12,35 @@ from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations from ._quotas_operations import QuotasOperations from ._compute_operations import ComputeOperations -from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_endpoint_connections_operations import ( + PrivateEndpointConnectionsOperations, +) from ._private_link_resources_operations import PrivateLinkResourcesOperations from ._workspace_connections_operations import WorkspaceConnectionsOperations from ._registries_operations import RegistriesOperations from ._workspace_features_operations import WorkspaceFeaturesOperations -from ._registry_code_containers_operations import RegistryCodeContainersOperations +from ._registry_code_containers_operations import ( + RegistryCodeContainersOperations, +) from ._registry_code_versions_operations import RegistryCodeVersionsOperations -from ._registry_component_containers_operations import RegistryComponentContainersOperations -from ._registry_component_versions_operations import RegistryComponentVersionsOperations -from ._registry_environment_containers_operations import RegistryEnvironmentContainersOperations -from ._registry_environment_versions_operations import RegistryEnvironmentVersionsOperations -from ._registry_model_containers_operations import RegistryModelContainersOperations -from ._registry_model_versions_operations import RegistryModelVersionsOperations +from ._registry_component_containers_operations import ( + RegistryComponentContainersOperations, +) +from ._registry_component_versions_operations import ( + RegistryComponentVersionsOperations, +) +from ._registry_environment_containers_operations import ( + RegistryEnvironmentContainersOperations, +) +from ._registry_environment_versions_operations import ( + RegistryEnvironmentVersionsOperations, +) +from ._registry_model_containers_operations import ( + RegistryModelContainersOperations, +) +from ._registry_model_versions_operations import ( + RegistryModelVersionsOperations, +) from ._batch_endpoints_operations import BatchEndpointsOperations from ._batch_deployments_operations import BatchDeploymentsOperations from ._code_containers_operations import CodeContainersOperations @@ -45,41 +61,41 @@ from ._schedules_operations import SchedulesOperations __all__ = [ - 'Operations', - 'WorkspacesOperations', - 'UsagesOperations', - 'VirtualMachineSizesOperations', - 'QuotasOperations', - 'ComputeOperations', - 'PrivateEndpointConnectionsOperations', - 'PrivateLinkResourcesOperations', - 'WorkspaceConnectionsOperations', - 'RegistriesOperations', - 'WorkspaceFeaturesOperations', - 'RegistryCodeContainersOperations', - 'RegistryCodeVersionsOperations', - 'RegistryComponentContainersOperations', - 'RegistryComponentVersionsOperations', - 'RegistryEnvironmentContainersOperations', - 'RegistryEnvironmentVersionsOperations', - 'RegistryModelContainersOperations', - 'RegistryModelVersionsOperations', - 'BatchEndpointsOperations', - 'BatchDeploymentsOperations', - 'CodeContainersOperations', - 'CodeVersionsOperations', - 'ComponentContainersOperations', - 'ComponentVersionsOperations', - 'DataContainersOperations', - 'DataVersionsOperations', - 'DatastoresOperations', - 'EnvironmentContainersOperations', - 'EnvironmentVersionsOperations', - 'JobsOperations', - 'LabelingJobsOperations', - 'ModelContainersOperations', - 'ModelVersionsOperations', - 'OnlineEndpointsOperations', - 'OnlineDeploymentsOperations', - 'SchedulesOperations', + "Operations", + "WorkspacesOperations", + "UsagesOperations", + "VirtualMachineSizesOperations", + "QuotasOperations", + "ComputeOperations", + "PrivateEndpointConnectionsOperations", + "PrivateLinkResourcesOperations", + "WorkspaceConnectionsOperations", + "RegistriesOperations", + "WorkspaceFeaturesOperations", + "RegistryCodeContainersOperations", + "RegistryCodeVersionsOperations", + "RegistryComponentContainersOperations", + "RegistryComponentVersionsOperations", + "RegistryEnvironmentContainersOperations", + "RegistryEnvironmentVersionsOperations", + "RegistryModelContainersOperations", + "RegistryModelVersionsOperations", + "BatchEndpointsOperations", + "BatchDeploymentsOperations", + "CodeContainersOperations", + "CodeVersionsOperations", + "ComponentContainersOperations", + "ComponentVersionsOperations", + "DataContainersOperations", + "DataVersionsOperations", + "DatastoresOperations", + "EnvironmentContainersOperations", + "EnvironmentVersionsOperations", + "JobsOperations", + "LabelingJobsOperations", + "ModelContainersOperations", + "ModelVersionsOperations", + "OnlineEndpointsOperations", + "OnlineDeploymentsOperations", + "SchedulesOperations", ] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_batch_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_batch_deployments_operations.py index 1483c2fe2ca7..7fb45e56f22b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_batch_deployments_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_batch_deployments_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,22 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._batch_deployments_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._batch_deployments_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class BatchDeploymentsOperations: """BatchDeploymentsOperations async operations. @@ -57,7 +80,9 @@ def list( top: Optional[int] = None, skip: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.BatchDeploymentTrackedResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.BatchDeploymentTrackedResourceArmPaginatedResult" + ]: """Lists Batch inference deployments in the workspace. Lists Batch inference deployments in the workspace. @@ -81,16 +106,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.BatchDeploymentTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -100,13 +132,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -124,7 +156,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("BatchDeploymentTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "BatchDeploymentTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -134,24 +169,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -161,15 +200,18 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements deployment_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -177,34 +219,45 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -239,14 +292,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -254,29 +312,33 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def get( @@ -304,15 +366,20 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.BatchDeployment :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -320,32 +387,37 @@ async def get( endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize("BatchDeployment", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore async def _update_initial( self, @@ -356,16 +428,27 @@ async def _update_initial( body: "_models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties", **kwargs: Any ) -> Optional["_models.BatchDeployment"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchDeployment"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.BatchDeployment"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties') + error_map.update(kwargs.pop("error_map", {})) + + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + + _json = self._serialize.body( + body, + "PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties", + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -376,40 +459,53 @@ async def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -450,15 +546,24 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -468,32 +573,38 @@ async def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore async def _create_or_update_initial( self, @@ -504,16 +615,24 @@ async def _create_or_update_initial( body: "_models.BatchDeployment", **kwargs: Any ) -> "_models.BatchDeployment": - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'BatchDeployment') + _json = self._serialize.body(body, "BatchDeployment") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -524,39 +643,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchDeployment', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -596,15 +729,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -614,29 +756,35 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_batch_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_batch_endpoints_operations.py index a31ef8ddd428..fecfc1c563d1 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_batch_endpoints_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_batch_endpoints_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,23 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._batch_endpoints_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_keys_request, build_list_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._batch_endpoints_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_keys_request, + build_list_request, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class BatchEndpointsOperations: """BatchEndpointsOperations async operations. @@ -55,7 +79,9 @@ def list( count: Optional[int] = None, skip: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.BatchEndpointTrackedResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.BatchEndpointTrackedResourceArmPaginatedResult" + ]: """Lists Batch inference endpoint in the workspace. Lists Batch inference endpoint in the workspace. @@ -75,16 +101,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.BatchEndpointTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -92,13 +125,13 @@ def prepare_request(next_link=None): api_version=api_version, count=count, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -114,7 +147,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("BatchEndpointTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "BatchEndpointTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -124,24 +160,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -150,49 +190,63 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements endpoint_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -224,43 +278,52 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def get( @@ -285,47 +348,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.BatchEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize("BatchEndpoint", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore async def _update_initial( self, @@ -335,16 +406,26 @@ async def _update_initial( body: "_models.PartialMinimalTrackedResourceWithIdentity", **kwargs: Any ) -> Optional["_models.BatchEndpoint"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchEndpoint"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.BatchEndpoint"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') + _json = self._serialize.body( + body, "PartialMinimalTrackedResourceWithIdentity" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -354,40 +435,53 @@ async def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -425,15 +519,22 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -442,32 +543,38 @@ async def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore async def _create_or_update_initial( self, @@ -477,16 +584,22 @@ async def _create_or_update_initial( body: "_models.BatchEndpoint", **kwargs: Any ) -> "_models.BatchEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'BatchEndpoint') + _json = self._serialize.body(body, "BatchEndpoint") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -496,39 +609,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -565,15 +692,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -582,32 +716,38 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def list_keys( @@ -632,44 +772,54 @@ async def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthKeys"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) + deserialized = self._deserialize("EndpointAuthKeys", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys"} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_code_containers_operations.py index 51250fad9f43..e50b3a2cd793 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_code_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_code_containers_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._code_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._code_containers_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class CodeContainersOperations: """CodeContainersOperations async operations. @@ -70,29 +88,36 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -107,7 +132,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -117,24 +144,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -159,43 +190,51 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore @distributed_trace_async async def get( @@ -220,47 +259,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize("CodeContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -288,16 +335,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeContainer') + _json = self._serialize.body(body, "CodeContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -307,33 +360,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_code_versions_operations.py index 6470da292155..1616c367927b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_code_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_code_versions_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._code_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._code_versions_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class CodeVersionsOperations: """CodeVersionsOperations async operations. @@ -79,16 +97,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -98,13 +123,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -122,7 +147,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -132,24 +159,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -177,15 +208,18 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -193,28 +227,33 @@ async def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -242,15 +281,18 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -258,32 +300,37 @@ async def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -314,16 +361,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeVersion') + _json = self._serialize.body(body, "CodeVersion") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -334,33 +387,38 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_component_containers_operations.py index acbc0fe6d2a6..8fc52c5abda8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_component_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_component_containers_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._component_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._component_containers_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ComponentContainersOperations: """ComponentContainersOperations async operations. @@ -73,16 +91,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -90,13 +115,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -112,7 +137,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -122,24 +150,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -164,43 +196,51 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore @distributed_trace_async async def get( @@ -225,47 +265,59 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -293,16 +345,24 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentContainer') + _json = self._serialize.body(body, "ComponentContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -312,33 +372,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_component_versions_operations.py index d3dbca43c2b8..322b9a3c3523 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_component_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_component_versions_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._component_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._component_versions_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ComponentVersionsOperations: """ComponentVersionsOperations async operations. @@ -82,16 +100,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -102,13 +127,13 @@ def prepare_request(next_link=None): top=top, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -127,7 +152,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -137,24 +164,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -182,15 +213,18 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -198,28 +232,33 @@ async def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -247,15 +286,20 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -263,32 +307,37 @@ async def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize("ComponentVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -319,16 +368,24 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentVersion') + _json = self._serialize.body(body, "ComponentVersion") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -339,33 +396,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_compute_operations.py index bf8c25a14d65..63cb5444bc7a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_compute_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_compute_operations.py @@ -6,13 +6,32 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, List, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + List, + Optional, + TypeVar, + Union, +) from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +40,29 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._compute_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_keys_request, build_list_nodes_request, build_list_request, build_restart_request_initial, build_start_request_initial, build_stop_request_initial, build_update_custom_services_request, build_update_idle_shutdown_setting_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._compute_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_keys_request, + build_list_nodes_request, + build_list_request, + build_restart_request_initial, + build_start_request_initial, + build_stop_request_initial, + build_update_custom_services_request, + build_update_idle_shutdown_setting_request, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ComputeOperations: """ComputeOperations async operations. @@ -70,29 +109,36 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedComputeResourcesList] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedComputeResourcesList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedComputeResourcesList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -107,7 +153,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedComputeResourcesList", pipeline_response) + deserialized = self._deserialize( + "PaginatedComputeResourcesList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -117,24 +165,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes"} # type: ignore @distributed_trace_async async def get( @@ -158,47 +210,57 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComputeResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize("ComputeResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore async def _create_or_update_initial( self, @@ -208,16 +270,24 @@ async def _create_or_update_initial( parameters: "_models.ComputeResource", **kwargs: Any ) -> "_models.ComputeResource": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'ComputeResource') + _json = self._serialize.body(parameters, "ComputeResource") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -227,38 +297,47 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if response.status_code == 201: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComputeResource', pipeline_response) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -295,15 +374,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -312,32 +400,38 @@ async def begin_create_or_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore async def _update_initial( self, @@ -347,16 +441,24 @@ async def _update_initial( parameters: "_models.ClusterUpdateParameters", **kwargs: Any ) -> "_models.ComputeResource": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'ClusterUpdateParameters') + _json = self._serialize.body(parameters, "ClusterUpdateParameters") request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -366,31 +468,34 @@ async def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize("ComputeResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -426,15 +531,24 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -443,50 +557,61 @@ async def begin_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, compute_name: str, - underlying_resource_action: Union[str, "_models.UnderlyingResourceAction"], + underlying_resource_action: Union[ + str, "_models.UnderlyingResourceAction" + ], **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -494,33 +619,39 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements compute_name=compute_name, api_version=api_version, underlying_resource_action=underlying_resource_action, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -528,7 +659,9 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements resource_group_name: str, workspace_name: str, compute_name: str, - underlying_resource_action: Union[str, "_models.UnderlyingResourceAction"], + underlying_resource_action: Union[ + str, "_models.UnderlyingResourceAction" + ], **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes specified Machine Learning compute. @@ -555,14 +688,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -570,29 +708,33 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements compute_name=compute_name, underlying_resource_action=underlying_resource_action, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace_async async def update_custom_services( # pylint: disable=inconsistent-return-statements @@ -618,16 +760,22 @@ async def update_custom_services( # pylint: disable=inconsistent-return-stateme :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(custom_services, '[CustomService]') + _json = self._serialize.body(custom_services, "[CustomService]") request = build_update_custom_services_request( subscription_id=self._config.subscription_id, @@ -637,28 +785,33 @@ async def update_custom_services( # pylint: disable=inconsistent-return-stateme api_version=api_version, content_type=content_type, json=_json, - template_url=self.update_custom_services.metadata['url'], + template_url=self.update_custom_services.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - update_custom_services.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/customServices"} # type: ignore - + update_custom_services.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/customServices"} # type: ignore @distributed_trace def list_nodes( @@ -683,29 +836,36 @@ def list_nodes( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.AmlComputeNodesInformation] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlComputeNodesInformation"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.AmlComputeNodesInformation"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_nodes_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self.list_nodes.metadata['url'], + template_url=self.list_nodes.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_nodes_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -720,7 +880,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("AmlComputeNodesInformation", pipeline_response) + deserialized = self._deserialize( + "AmlComputeNodesInformation", pipeline_response + ) list_of_elem = deserialized.nodes if cls: list_of_elem = cls(list_of_elem) @@ -730,24 +892,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_nodes.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes"} # type: ignore + list_nodes.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes"} # type: ignore @distributed_trace_async async def list_keys( @@ -770,47 +936,57 @@ async def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ComputeSecrets :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeSecrets"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeSecrets"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComputeSecrets', pipeline_response) + deserialized = self._deserialize("ComputeSecrets", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys"} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys"} # type: ignore async def _start_initial( # pylint: disable=inconsistent-return-statements self, @@ -819,42 +995,48 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements compute_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_start_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self._start_initial.metadata['url'], + template_url=self._start_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _start_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore - + _start_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore @distributed_trace_async async def begin_start( # pylint: disable=inconsistent-return-statements @@ -884,43 +1066,52 @@ async def begin_start( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._start_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_start.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore + begin_start.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore async def _stop_initial( # pylint: disable=inconsistent-return-statements self, @@ -929,42 +1120,48 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements compute_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_stop_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self._stop_initial.metadata['url'], + template_url=self._stop_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _stop_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore - + _stop_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore @distributed_trace_async async def begin_stop( # pylint: disable=inconsistent-return-statements @@ -994,43 +1191,52 @@ async def begin_stop( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._stop_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_stop.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore + begin_stop.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore async def _restart_initial( # pylint: disable=inconsistent-return-statements self, @@ -1039,42 +1245,48 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements compute_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_restart_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self._restart_initial.metadata['url'], + template_url=self._restart_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _restart_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore - + _restart_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore @distributed_trace_async async def begin_restart( # pylint: disable=inconsistent-return-statements @@ -1104,43 +1316,52 @@ async def begin_restart( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._restart_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_restart.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore + begin_restart.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore @distributed_trace_async async def update_idle_shutdown_setting( # pylint: disable=inconsistent-return-statements @@ -1166,16 +1387,22 @@ async def update_idle_shutdown_setting( # pylint: disable=inconsistent-return-s :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'IdleShutdownSetting') + _json = self._serialize.body(parameters, "IdleShutdownSetting") request = build_update_idle_shutdown_setting_request( subscription_id=self._config.subscription_id, @@ -1185,25 +1412,30 @@ async def update_idle_shutdown_setting( # pylint: disable=inconsistent-return-s api_version=api_version, content_type=content_type, json=_json, - template_url=self.update_idle_shutdown_setting.metadata['url'], + template_url=self.update_idle_shutdown_setting.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - update_idle_shutdown_setting.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateIdleShutdownSetting"} # type: ignore - + update_idle_shutdown_setting.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateIdleShutdownSetting"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_data_containers_operations.py index 431836783f5f..8c6b5aabe2f5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_data_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_data_containers_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._data_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._data_containers_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class DataContainersOperations: """DataContainersOperations async operations. @@ -73,16 +91,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -90,13 +115,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -112,7 +137,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -122,24 +149,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -164,43 +195,51 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore @distributed_trace_async async def get( @@ -225,47 +264,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize("DataContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -293,16 +340,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DataContainer') + _json = self._serialize.body(body, "DataContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -312,33 +365,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_data_versions_operations.py index 36293053cf04..672f3767f407 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_data_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_data_versions_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._data_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._data_versions_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class DataVersionsOperations: """DataVersionsOperations async operations. @@ -89,16 +107,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -110,13 +135,13 @@ def prepare_request(next_link=None): skip=skip, tags=tags, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -136,7 +161,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataVersionBaseResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -146,24 +173,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -191,15 +222,18 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -207,28 +241,33 @@ async def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -256,15 +295,20 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -272,32 +316,37 @@ async def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize("DataVersionBase", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -328,16 +377,24 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DataVersionBase') + _json = self._serialize.body(body, "DataVersionBase") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -348,33 +405,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_datastores_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_datastores_operations.py index 4599f14170cc..3b091b4f69d0 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_datastores_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_datastores_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, List, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,22 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._datastores_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request, build_list_secrets_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._datastores_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, + build_list_secrets_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class DatastoresOperations: """DatastoresOperations async operations. @@ -88,16 +107,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DatastoreResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -110,13 +136,13 @@ def prepare_request(next_link=None): search_text=search_text, order_by=order_by, order_by_asc=order_by_asc, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -137,7 +163,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("DatastoreResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DatastoreResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -147,24 +175,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -189,43 +221,51 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace_async async def get( @@ -250,47 +290,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.Datastore :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Datastore"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Datastore"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Datastore', pipeline_response) + deserialized = self._deserialize("Datastore", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -321,16 +369,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.Datastore :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Datastore"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Datastore"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'Datastore') + _json = self._serialize.body(body, "Datastore") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -341,36 +395,41 @@ async def create_or_update( content_type=content_type, json=_json, skip_validation=skip_validation, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('Datastore', pipeline_response) + deserialized = self._deserialize("Datastore", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('Datastore', pipeline_response) + deserialized = self._deserialize("Datastore", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace_async async def list_secrets( @@ -395,44 +454,54 @@ async def list_secrets( :rtype: ~azure.mgmt.machinelearningservices.models.DatastoreSecrets :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreSecrets"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DatastoreSecrets"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_list_secrets_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.list_secrets.metadata['url'], + template_url=self.list_secrets.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DatastoreSecrets', pipeline_response) + deserialized = self._deserialize("DatastoreSecrets", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_secrets.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets"} # type: ignore - + list_secrets.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_environment_containers_operations.py index 774d9f5bdf4d..fddf1b3501f8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_environment_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_environment_containers_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._environment_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._environment_containers_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class EnvironmentContainersOperations: """EnvironmentContainersOperations async operations. @@ -53,7 +71,9 @@ def list( skip: Optional[str] = None, list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, **kwargs: Any - ) -> AsyncIterable["_models.EnvironmentContainerResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.EnvironmentContainerResourceArmPaginatedResult" + ]: """List environment containers. List environment containers. @@ -73,16 +93,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -90,13 +117,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -112,7 +139,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -122,24 +152,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -164,43 +198,51 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore @distributed_trace_async async def get( @@ -225,47 +267,59 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -293,16 +347,24 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentContainer') + _json = self._serialize.body(body, "EnvironmentContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -312,33 +374,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_environment_versions_operations.py index d5d425464fa6..ba71cf2bf1bb 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_environment_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_environment_versions_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._environment_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._environment_versions_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class EnvironmentVersionsOperations: """EnvironmentVersionsOperations async operations. @@ -82,16 +100,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -102,13 +127,13 @@ def prepare_request(next_link=None): top=top, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -127,7 +152,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersionResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -137,24 +165,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -182,15 +214,18 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -198,28 +233,33 @@ async def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -247,15 +287,20 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -263,32 +308,39 @@ async def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -319,16 +371,24 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentVersion') + _json = self._serialize.body(body, "EnvironmentVersion") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -339,33 +399,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_jobs_operations.py index 70edbcfcf4b2..b7232f500747 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_jobs_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_jobs_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,22 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._jobs_operations import build_cancel_request_initial, build_create_or_update_request, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._jobs_operations import ( + build_cancel_request_initial, + build_create_or_update_request, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class JobsOperations: """JobsOperations async operations. @@ -87,16 +110,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.JobBaseResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -108,13 +138,13 @@ def prepare_request(next_link=None): list_view_type=list_view_type, scheduled=scheduled, schedule_id=schedule_id, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -134,7 +164,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("JobBaseResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "JobBaseResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -144,24 +176,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -170,49 +206,63 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements id: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -244,43 +294,52 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace_async async def get( @@ -305,47 +364,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.JobBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.JobBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('JobBase', pipeline_response) + deserialized = self._deserialize("JobBase", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -373,16 +440,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.JobBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.JobBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'JobBase') + _json = self._serialize.body(body, "JobBase") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -392,36 +465,41 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('JobBase', pipeline_response) + deserialized = self._deserialize("JobBase", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('JobBase', pipeline_response) + deserialized = self._deserialize("JobBase", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore async def _cancel_initial( # pylint: disable=inconsistent-return-statements self, @@ -430,48 +508,57 @@ async def _cancel_initial( # pylint: disable=inconsistent-return-statements id: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_cancel_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self._cancel_initial.metadata['url'], + template_url=self._cancel_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _cancel_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore - + _cancel_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore @distributed_trace_async async def begin_cancel( # pylint: disable=inconsistent-return-statements @@ -503,40 +590,53 @@ async def begin_cancel( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._cancel_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_cancel.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore + begin_cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_labeling_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_labeling_jobs_operations.py index c29db25275c4..d103ca181133 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_labeling_jobs_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_labeling_jobs_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,24 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._labeling_jobs_operations import build_create_or_update_request_initial, build_delete_request, build_export_labels_request_initial, build_get_request, build_list_request, build_pause_request, build_resume_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._labeling_jobs_operations import ( + build_create_or_update_request_initial, + build_delete_request, + build_export_labels_request_initial, + build_get_request, + build_list_request, + build_pause_request, + build_resume_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class LabelingJobsOperations: """LabelingJobsOperations async operations. @@ -75,16 +100,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.LabelingJobResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJobResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.LabelingJobResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -92,13 +124,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, count=count, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -114,7 +146,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("LabelingJobResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "LabelingJobResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -124,24 +158,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -166,43 +204,51 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore @distributed_trace_async async def get( @@ -235,15 +281,18 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.LabelingJob :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.LabelingJob"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -252,32 +301,37 @@ async def get( api_version=api_version, include_job_instructions=include_job_instructions, include_label_categories=include_label_categories, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('LabelingJob', pipeline_response) + deserialized = self._deserialize("LabelingJob", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore async def _create_or_update_initial( self, @@ -287,16 +341,22 @@ async def _create_or_update_initial( body: "_models.LabelingJob", **kwargs: Any ) -> "_models.LabelingJob": - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.LabelingJob"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'LabelingJob') + _json = self._serialize.body(body, "LabelingJob") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -306,39 +366,49 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('LabelingJob', pipeline_response) + deserialized = self._deserialize("LabelingJob", pipeline_response) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('LabelingJob', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("LabelingJob", pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -375,15 +445,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.LabelingJob] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.LabelingJob"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -392,32 +469,36 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('LabelingJob', pipeline_response) + deserialized = self._deserialize("LabelingJob", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore async def _export_labels_initial( self, @@ -427,16 +508,24 @@ async def _export_labels_initial( body: "_models.ExportSummary", **kwargs: Any ) -> Optional["_models.ExportSummary"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExportSummary"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.ExportSummary"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ExportSummary') + _json = self._serialize.body(body, "ExportSummary") request = build_export_labels_request_initial( subscription_id=self._config.subscription_id, @@ -446,39 +535,47 @@ async def _export_labels_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._export_labels_initial.metadata['url'], + template_url=self._export_labels_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ExportSummary', pipeline_response) + deserialized = self._deserialize( + "ExportSummary", pipeline_response + ) if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _export_labels_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore - + _export_labels_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore @distributed_trace_async async def begin_export_labels( @@ -515,15 +612,22 @@ async def begin_export_labels( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ExportSummary] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExportSummary"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ExportSummary"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._export_labels_initial( resource_group_name=resource_group_name, @@ -532,32 +636,42 @@ async def begin_export_labels( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ExportSummary', pipeline_response) + deserialized = self._deserialize( + "ExportSummary", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_export_labels.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore + begin_export_labels.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore @distributed_trace_async async def pause( # pylint: disable=inconsistent-return-statements @@ -582,43 +696,51 @@ async def pause( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_pause_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self.pause.metadata['url'], + template_url=self.pause.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - pause.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause"} # type: ignore - + pause.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause"} # type: ignore async def _resume_initial( # pylint: disable=inconsistent-return-statements self, @@ -627,48 +749,57 @@ async def _resume_initial( # pylint: disable=inconsistent-return-statements id: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_resume_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self._resume_initial.metadata['url'], + template_url=self._resume_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _resume_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore - + _resume_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore @distributed_trace_async async def begin_resume( # pylint: disable=inconsistent-return-statements @@ -700,40 +831,53 @@ async def begin_resume( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._resume_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_resume.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore + begin_resume.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_model_containers_operations.py index 5013a222b365..88e909e2956d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_model_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_model_containers_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._model_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._model_containers_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ModelContainersOperations: """ModelContainersOperations async operations. @@ -76,16 +94,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -94,13 +119,13 @@ def prepare_request(next_link=None): skip=skip, count=count, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -117,7 +142,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -127,24 +154,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -169,43 +200,51 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore @distributed_trace_async async def get( @@ -230,47 +269,57 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize("ModelContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -298,16 +347,24 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelContainer') + _json = self._serialize.body(body, "ModelContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -317,33 +374,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_model_versions_operations.py index 1f9f681bbfac..e094a2ea5cb1 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_model_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_model_versions_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._model_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._model_versions_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ModelVersionsOperations: """ModelVersionsOperations async operations. @@ -102,16 +120,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -128,13 +153,13 @@ def prepare_request(next_link=None): properties=properties, feed=feed, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -159,7 +184,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -169,24 +196,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -214,15 +245,18 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -230,28 +264,33 @@ async def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -279,15 +318,18 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -295,32 +337,37 @@ async def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -351,16 +398,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelVersion') + _json = self._serialize.body(body, "ModelVersion") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -371,33 +424,38 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_online_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_online_deployments_operations.py index a880752577b2..71732675d35d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_online_deployments_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_online_deployments_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,24 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._online_deployments_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_logs_request, build_get_request, build_list_request, build_list_skus_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._online_deployments_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_logs_request, + build_get_request, + build_list_request, + build_list_skus_request, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class OnlineDeploymentsOperations: """OnlineDeploymentsOperations async operations. @@ -57,7 +82,9 @@ def list( top: Optional[int] = None, skip: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.OnlineDeploymentTrackedResourceArmPaginatedResult" + ]: """List Inference Endpoint Deployments. List Inference Endpoint Deployments. @@ -81,16 +108,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OnlineDeploymentTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -100,13 +134,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -124,7 +158,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineDeploymentTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "OnlineDeploymentTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -134,24 +171,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -161,15 +202,18 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements deployment_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -177,34 +221,45 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -239,14 +294,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -254,29 +314,33 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def get( @@ -304,15 +368,20 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.OnlineDeployment :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -320,32 +389,37 @@ async def get( endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize("OnlineDeployment", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore async def _update_initial( self, @@ -356,16 +430,26 @@ async def _update_initial( body: "_models.PartialMinimalTrackedResourceWithSku", **kwargs: Any ) -> Optional["_models.OnlineDeployment"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineDeployment"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.OnlineDeployment"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSku') + _json = self._serialize.body( + body, "PartialMinimalTrackedResourceWithSku" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -376,40 +460,53 @@ async def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -449,15 +546,24 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -467,32 +573,38 @@ async def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore async def _create_or_update_initial( self, @@ -503,16 +615,24 @@ async def _create_or_update_initial( body: "_models.OnlineDeployment", **kwargs: Any ) -> "_models.OnlineDeployment": - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'OnlineDeployment') + _json = self._serialize.body(body, "OnlineDeployment") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -523,39 +643,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -595,15 +729,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -613,32 +756,38 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def get_logs( @@ -669,16 +818,24 @@ async def get_logs( :rtype: ~azure.mgmt.machinelearningservices.models.DeploymentLogs :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentLogs"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DeploymentLogs"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DeploymentLogsRequest') + _json = self._serialize.body(body, "DeploymentLogsRequest") request = build_get_logs_request( subscription_id=self._config.subscription_id, @@ -689,32 +846,37 @@ async def get_logs( api_version=api_version, content_type=content_type, json=_json, - template_url=self.get_logs.metadata['url'], + template_url=self.get_logs.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DeploymentLogs', pipeline_response) + deserialized = self._deserialize("DeploymentLogs", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_logs.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs"} # type: ignore - + get_logs.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs"} # type: ignore @distributed_trace def list_skus( @@ -750,16 +912,23 @@ def list_skus( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.SkuResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.SkuResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_skus_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -769,13 +938,13 @@ def prepare_request(next_link=None): api_version=api_version, count=count, skip=skip, - template_url=self.list_skus.metadata['url'], + template_url=self.list_skus.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_skus_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -793,7 +962,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("SkuResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "SkuResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -803,21 +974,25 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_skus.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus"} # type: ignore + list_skus.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_online_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_online_endpoints_operations.py index e8333e8beee5..d2acb94215e4 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_online_endpoints_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_online_endpoints_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,25 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._online_endpoints_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_get_token_request, build_list_keys_request, build_list_request, build_regenerate_keys_request_initial, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._online_endpoints_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_get_token_request, + build_list_keys_request, + build_list_request, + build_regenerate_keys_request_initial, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class OnlineEndpointsOperations: """OnlineEndpointsOperations async operations. @@ -54,13 +80,17 @@ def list( workspace_name: str, name: Optional[str] = None, count: Optional[int] = None, - compute_type: Optional[Union[str, "_models.EndpointComputeType"]] = None, + compute_type: Optional[ + Union[str, "_models.EndpointComputeType"] + ] = None, skip: Optional[str] = None, tags: Optional[str] = None, properties: Optional[str] = None, order_by: Optional[Union[str, "_models.OrderString"]] = None, **kwargs: Any - ) -> AsyncIterable["_models.OnlineEndpointTrackedResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.OnlineEndpointTrackedResourceArmPaginatedResult" + ]: """List Online Endpoints. List Online Endpoints. @@ -93,16 +123,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OnlineEndpointTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -115,13 +152,13 @@ def prepare_request(next_link=None): tags=tags, properties=properties, order_by=order_by, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -142,7 +179,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineEndpointTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "OnlineEndpointTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -152,24 +192,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -178,49 +222,63 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements endpoint_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -252,43 +310,52 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def get( @@ -313,47 +380,57 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.OnlineEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize("OnlineEndpoint", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore async def _update_initial( self, @@ -363,16 +440,26 @@ async def _update_initial( body: "_models.PartialMinimalTrackedResourceWithIdentity", **kwargs: Any ) -> Optional["_models.OnlineEndpoint"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineEndpoint"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.OnlineEndpoint"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') + _json = self._serialize.body( + body, "PartialMinimalTrackedResourceWithIdentity" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -382,40 +469,53 @@ async def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -453,15 +553,24 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -470,32 +579,38 @@ async def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore async def _create_or_update_initial( self, @@ -505,16 +620,24 @@ async def _create_or_update_initial( body: "_models.OnlineEndpoint", **kwargs: Any ) -> "_models.OnlineEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'OnlineEndpoint') + _json = self._serialize.body(body, "OnlineEndpoint") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -524,39 +647,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -593,15 +730,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -610,32 +756,38 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def list_keys( @@ -660,47 +812,57 @@ async def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthKeys"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) + deserialized = self._deserialize("EndpointAuthKeys", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys"} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys"} # type: ignore async def _regenerate_keys_initial( # pylint: disable=inconsistent-return-statements self, @@ -710,16 +872,22 @@ async def _regenerate_keys_initial( # pylint: disable=inconsistent-return-state body: "_models.RegenerateEndpointKeysRequest", **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'RegenerateEndpointKeysRequest') + _json = self._serialize.body(body, "RegenerateEndpointKeysRequest") request = build_regenerate_keys_request_initial( subscription_id=self._config.subscription_id, @@ -729,33 +897,39 @@ async def _regenerate_keys_initial( # pylint: disable=inconsistent-return-state api_version=api_version, content_type=content_type, json=_json, - template_url=self._regenerate_keys_initial.metadata['url'], + template_url=self._regenerate_keys_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _regenerate_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore - + _regenerate_keys_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore @distributed_trace_async async def begin_regenerate_keys( # pylint: disable=inconsistent-return-statements @@ -790,15 +964,22 @@ async def begin_regenerate_keys( # pylint: disable=inconsistent-return-statemen :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._regenerate_keys_initial( resource_group_name=resource_group_name, @@ -807,29 +988,37 @@ async def begin_regenerate_keys( # pylint: disable=inconsistent-return-statemen body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_regenerate_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore + begin_regenerate_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore @distributed_trace_async async def get_token( @@ -854,44 +1043,56 @@ async def get_token( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthToken :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthToken"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthToken"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_token_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.get_token.metadata['url'], + template_url=self.get_token.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EndpointAuthToken', pipeline_response) + deserialized = self._deserialize( + "EndpointAuthToken", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token"} # type: ignore - + get_token.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_operations.py index 4b016ee8371c..705e0f6772eb 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,8 +25,15 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class Operations: """Operations async operations. @@ -46,8 +59,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list( - self, - **kwargs: Any + self, **kwargs: Any ) -> AsyncIterable["_models.AmlOperationListResult"]: """Lists all of the available Azure Machine Learning Services REST API operations. @@ -58,25 +70,32 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.AmlOperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlOperationListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.AmlOperationListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( api_version=api_version, template_url=next_link, @@ -87,7 +106,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("AmlOperationListResult", pipeline_response) + deserialized = self._deserialize( + "AmlOperationListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -97,21 +118,25 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/providers/Microsoft.MachineLearningServices/operations"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.MachineLearningServices/operations"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_private_endpoint_connections_operations.py index 023c936ebc7c..a193ec972be5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_private_endpoint_connections_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._private_endpoint_connections_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._private_endpoint_connections_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class PrivateEndpointConnectionsOperations: """PrivateEndpointConnectionsOperations async operations. @@ -47,10 +65,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> AsyncIterable["_models.PrivateEndpointConnectionListResult"]: """List all the private endpoint connections associated with the workspace. @@ -65,28 +80,35 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnectionListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( resource_group_name=resource_group_name, workspace_name=workspace_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( resource_group_name=resource_group_name, workspace_name=workspace_name, @@ -100,7 +122,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) + deserialized = self._deserialize( + "PrivateEndpointConnectionListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -110,24 +134,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections"} # type: ignore @distributed_trace_async async def get( @@ -151,47 +179,59 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, private_endpoint_connection_name=private_endpoint_connection_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + deserialized = self._deserialize( + "PrivateEndpointConnection", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -218,16 +258,24 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(properties, 'PrivateEndpointConnection') + _json = self._serialize.body(properties, "PrivateEndpointConnection") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -237,32 +285,39 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + deserialized = self._deserialize( + "PrivateEndpointConnection", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -286,40 +341,48 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, private_endpoint_connection_name=private_endpoint_connection_name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_private_link_resources_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_private_link_resources_operations.py index 990798e11422..7adc36d5f563 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_private_link_resources_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_private_link_resources_operations.py @@ -8,7 +8,13 @@ # -------------------------------------------------------------------------- from typing import Any, Callable, Dict, Optional, TypeVar -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -18,8 +24,15 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class PrivateLinkResourcesOperations: """PrivateLinkResourcesOperations async operations. @@ -45,10 +58,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace_async async def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.PrivateLinkResourceListResult": """Gets the private link resources that need to be created for a workspace. @@ -61,43 +71,55 @@ async def list( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateLinkResourceListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateLinkResourceListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateLinkResourceListResult', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "PrivateLinkResourceListResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources"} # type: ignore - + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_quotas_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_quotas_operations.py index bf793b7dea97..306a7f6d7de9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_quotas_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_quotas_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,19 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._quotas_operations import build_list_request, build_update_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._quotas_operations import ( + build_list_request, + build_update_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class QuotasOperations: """QuotasOperations async operations. @@ -63,16 +79,24 @@ async def update( :rtype: ~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotasResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'QuotaUpdateParameters') + _json = self._serialize.body(parameters, "QuotaUpdateParameters") request = build_update_request( location=location, @@ -80,38 +104,43 @@ async def update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.update.metadata['url'], + template_url=self.update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('UpdateWorkspaceQuotasResult', pipeline_response) + deserialized = self._deserialize( + "UpdateWorkspaceQuotasResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas"} # type: ignore - + update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas"} # type: ignore @distributed_trace def list( - self, - location: str, - **kwargs: Any + self, location: str, **kwargs: Any ) -> AsyncIterable["_models.ListWorkspaceQuotas"]: """Gets the currently assigned Workspace Quotas based on VMFamily. @@ -123,27 +152,34 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListWorkspaceQuotas] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceQuotas"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListWorkspaceQuotas"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, @@ -156,7 +192,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ListWorkspaceQuotas", pipeline_response) + deserialized = self._deserialize( + "ListWorkspaceQuotas", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -166,21 +204,25 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registries_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registries_operations.py index 0d7b8e8946cc..3a161e2e73a2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registries_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registries_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,23 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registries_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_subscription_request, build_list_request, build_update_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registries_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_by_subscription_request, + build_list_request, + build_update_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistriesOperations: """RegistriesOperations async operations. @@ -49,9 +73,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list_by_subscription( - self, - skip: Optional[str] = None, - **kwargs: Any + self, skip: Optional[str] = None, **kwargs: Any ) -> AsyncIterable["_models.RegistryTrackedResourceArmPaginatedResult"]: """List registries by subscription. @@ -66,27 +88,34 @@ def list_by_subscription( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.RegistryTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, skip=skip, - template_url=self.list_by_subscription.metadata['url'], + template_url=self.list_by_subscription.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, @@ -99,7 +128,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("RegistryTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "RegistryTrackedResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -109,24 +140,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore + list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore @distributed_trace def list( @@ -150,28 +185,35 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.RegistryTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, api_version=api_version, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -185,7 +227,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("RegistryTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "RegistryTrackedResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -195,80 +239,92 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - **kwargs: Any + self, resource_group_name: str, registry_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - **kwargs: Any + self, resource_group_name: str, registry_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: """Delete registry. @@ -290,49 +346,55 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace_async async def get( - self, - resource_group_name: str, - registry_name: str, - **kwargs: Any + self, resource_group_name: str, registry_name: str, **kwargs: Any ) -> "_models.Registry": """Get registry. @@ -347,46 +409,54 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.Registry :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace_async async def update( @@ -411,16 +481,24 @@ async def update( :rtype: ~azure.mgmt.machinelearningservices.models.Registry :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialRegistryPartialTrackedResource') + _json = self._serialize.body( + body, "PartialRegistryPartialTrackedResource" + ) request = build_update_request( subscription_id=self._config.subscription_id, @@ -429,36 +507,41 @@ async def update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.update.metadata['url'], + template_url=self.update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if response.status_code == 202: - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - + update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore async def _create_or_update_initial( self, @@ -467,16 +550,22 @@ async def _create_or_update_initial( body: "_models.Registry", **kwargs: Any ) -> "_models.Registry": - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'Registry') + _json = self._serialize.body(body, "Registry") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -485,38 +574,41 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if response.status_code == 202: - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -549,15 +641,22 @@ async def begin_create_or_update( :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Registry] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -565,29 +664,37 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_code_containers_operations.py index 29626af6ce4a..1aa04a64e6d1 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_code_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_code_containers_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_code_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_code_containers_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryCodeContainersOperations: """RegistryCodeContainersOperations async operations. @@ -72,29 +94,36 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, api_version=api_version, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -109,7 +138,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -119,24 +150,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -145,49 +180,63 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements code_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, code_name=code_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -219,43 +268,56 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, code_name=code_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore @distributed_trace_async async def get( @@ -280,47 +342,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, code_name=code_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize("CodeContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore async def _create_or_update_initial( self, @@ -330,16 +400,22 @@ async def _create_or_update_initial( body: "_models.CodeContainer", **kwargs: Any ) -> "_models.CodeContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeContainer') + _json = self._serialize.body(body, "CodeContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -349,39 +425,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('CodeContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -418,15 +508,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.CodeContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -435,29 +532,39 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_code_versions_operations.py index cd048ea6d788..c1bd107de3d6 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_code_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_code_versions_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_code_versions_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_code_versions_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryCodeVersionsOperations: """RegistryCodeVersionsOperations async operations. @@ -81,16 +103,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -100,13 +129,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -124,7 +153,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -134,24 +165,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -161,15 +196,18 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements version: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -177,34 +215,45 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements code_name=code_name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -239,14 +288,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -254,29 +308,37 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements code_name=code_name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -304,15 +366,18 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -320,32 +385,37 @@ async def get( code_name=code_name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore async def _create_or_update_initial( self, @@ -356,16 +426,22 @@ async def _create_or_update_initial( body: "_models.CodeVersion", **kwargs: Any ) -> "_models.CodeVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeVersion') + _json = self._serialize.body(body, "CodeVersion") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -376,39 +452,49 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('CodeVersion', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -448,15 +534,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.CodeVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -466,29 +559,37 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_component_containers_operations.py index 1889749353ea..a58f18eac845 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_component_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_component_containers_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_component_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_component_containers_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryComponentContainersOperations: """RegistryComponentContainersOperations async operations. @@ -72,29 +94,36 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, api_version=api_version, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -109,7 +138,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -119,24 +151,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -145,49 +181,63 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements component_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, component_name=component_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -219,43 +269,56 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, component_name=component_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore @distributed_trace_async async def get( @@ -280,47 +343,59 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, component_name=component_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore async def _create_or_update_initial( self, @@ -330,16 +405,24 @@ async def _create_or_update_initial( body: "_models.ComponentContainer", **kwargs: Any ) -> "_models.ComponentContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentContainer') + _json = self._serialize.body(body, "ComponentContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -349,39 +432,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComponentContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -418,15 +515,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComponentContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -435,29 +541,39 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_component_versions_operations.py index 6267a8df8873..f7b8581d09ce 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_component_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_component_versions_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_component_versions_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_component_versions_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryComponentVersionsOperations: """RegistryComponentVersionsOperations async operations. @@ -81,16 +103,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -100,13 +129,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -124,7 +153,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -134,24 +165,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -161,15 +196,18 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements version: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -177,34 +215,45 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements component_name=component_name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -239,14 +288,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -254,29 +308,37 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements component_name=component_name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -304,15 +366,20 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -320,32 +387,37 @@ async def get( component_name=component_name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize("ComponentVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore async def _create_or_update_initial( self, @@ -356,16 +428,24 @@ async def _create_or_update_initial( body: "_models.ComponentVersion", **kwargs: Any ) -> "_models.ComponentVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentVersion') + _json = self._serialize.body(body, "ComponentVersion") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -376,39 +456,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComponentVersion', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -448,15 +542,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComponentVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -466,29 +569,39 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_environment_containers_operations.py index 6231b1e8ca77..5772b636e208 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_environment_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_environment_containers_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_environment_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_environment_containers_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryEnvironmentContainersOperations: """RegistryEnvironmentContainersOperations async operations. @@ -55,7 +77,9 @@ def list( skip: Optional[str] = None, list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, **kwargs: Any - ) -> AsyncIterable["_models.EnvironmentContainerResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.EnvironmentContainerResourceArmPaginatedResult" + ]: """List environment containers. List environment containers. @@ -75,16 +99,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -92,13 +123,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -114,7 +145,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -124,24 +158,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -150,49 +188,63 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements environment_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, environment_name=environment_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -224,43 +276,56 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, environment_name=environment_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore @distributed_trace_async async def get( @@ -285,47 +350,59 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, environment_name=environment_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore async def _create_or_update_initial( self, @@ -335,16 +412,24 @@ async def _create_or_update_initial( body: "_models.EnvironmentContainer", **kwargs: Any ) -> "_models.EnvironmentContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentContainer') + _json = self._serialize.body(body, "EnvironmentContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -354,39 +439,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -423,15 +522,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -440,29 +548,39 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_environment_versions_operations.py index 0f53286a5fd7..83fbf54d8f11 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_environment_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_environment_versions_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_environment_versions_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_environment_versions_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryEnvironmentVersionsOperations: """RegistryEnvironmentVersionsOperations async operations. @@ -84,16 +106,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -104,13 +133,13 @@ def prepare_request(next_link=None): top=top, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -129,7 +158,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersionResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -139,24 +171,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -166,15 +202,18 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements version: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -182,34 +221,45 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements environment_name=environment_name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -244,14 +294,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -259,29 +314,37 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements environment_name=environment_name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -309,15 +372,20 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -325,32 +393,39 @@ async def get( environment_name=environment_name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore async def _create_or_update_initial( self, @@ -361,16 +436,24 @@ async def _create_or_update_initial( body: "_models.EnvironmentVersion", **kwargs: Any ) -> "_models.EnvironmentVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentVersion') + _json = self._serialize.body(body, "EnvironmentVersion") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -381,39 +464,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -453,15 +550,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -471,29 +577,39 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_model_containers_operations.py index 649666a304d2..e17b8a5204ec 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_model_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_model_containers_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_model_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_model_containers_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryModelContainersOperations: """RegistryModelContainersOperations async operations. @@ -75,16 +97,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -92,13 +121,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -114,7 +143,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -124,24 +155,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -150,49 +185,63 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements model_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, model_name=model_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -224,43 +273,56 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, model_name=model_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore @distributed_trace_async async def get( @@ -285,47 +347,57 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, model_name=model_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize("ModelContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore async def _create_or_update_initial( self, @@ -335,16 +407,24 @@ async def _create_or_update_initial( body: "_models.ModelContainer", **kwargs: Any ) -> "_models.ModelContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelContainer') + _json = self._serialize.body(body, "ModelContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -354,39 +434,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ModelContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -423,15 +517,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ModelContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -440,29 +543,39 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_model_versions_operations.py index fe53e30507b3..6381edf0031f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_model_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_model_versions_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_model_versions_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_model_versions_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryModelVersionsOperations: """RegistryModelVersionsOperations async operations. @@ -98,16 +120,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -122,13 +151,13 @@ def prepare_request(next_link=None): tags=tags, properties=properties, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -151,7 +180,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -161,24 +192,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -188,15 +223,18 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements version: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -204,34 +242,45 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements model_name=model_name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -266,14 +315,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -281,29 +335,37 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements model_name=model_name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -331,15 +393,18 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -347,32 +412,37 @@ async def get( model_name=model_name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore async def _create_or_update_initial( self, @@ -383,16 +453,22 @@ async def _create_or_update_initial( body: "_models.ModelVersion", **kwargs: Any ) -> "_models.ModelVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelVersion') + _json = self._serialize.body(body, "ModelVersion") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -403,39 +479,49 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ModelVersion', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -475,15 +561,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ModelVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -493,29 +586,37 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_schedules_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_schedules_operations.py index d73251e23420..1bf9deaf46d1 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_schedules_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_schedules_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._schedules_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._schedules_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class SchedulesOperations: """SchedulesOperations async operations. @@ -53,7 +75,9 @@ def list( resource_group_name: str, workspace_name: str, skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ScheduleListViewType"]] = None, + list_view_type: Optional[ + Union[str, "_models.ScheduleListViewType"] + ] = None, **kwargs: Any ) -> AsyncIterable["_models.ScheduleResourceArmPaginatedResult"]: """List schedules in specified workspace. @@ -75,16 +99,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ScheduleResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduleResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ScheduleResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -92,13 +123,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -114,7 +145,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ScheduleResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ScheduleResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -124,24 +157,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -150,49 +187,63 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -224,43 +275,52 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @distributed_trace_async async def get( @@ -285,47 +345,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.Schedule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Schedule"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Schedule', pipeline_response) + deserialized = self._deserialize("Schedule", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore async def _create_or_update_initial( self, @@ -335,16 +403,22 @@ async def _create_or_update_initial( body: "_models.Schedule", **kwargs: Any ) -> "_models.Schedule": - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Schedule"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'Schedule') + _json = self._serialize.body(body, "Schedule") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -354,39 +428,49 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('Schedule', pipeline_response) + deserialized = self._deserialize("Schedule", pipeline_response) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('Schedule', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("Schedule", pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -422,15 +506,22 @@ async def begin_create_or_update( :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Schedule] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Schedule"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -439,29 +530,33 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Schedule', pipeline_response) + deserialized = self._deserialize("Schedule", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_usages_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_usages_operations.py index 86be8ad1ca4e..1baadaedac2d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_usages_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_usages_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,8 +25,15 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._usages_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class UsagesOperations: """UsagesOperations async operations. @@ -46,9 +59,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list( - self, - location: str, - **kwargs: Any + self, location: str, **kwargs: Any ) -> AsyncIterable["_models.ListUsagesResult"]: """Gets the current usage information as well as limits for AML resources for given subscription and location. @@ -61,27 +72,34 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListUsagesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListUsagesResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, @@ -94,7 +112,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ListUsagesResult", pipeline_response) + deserialized = self._deserialize( + "ListUsagesResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -104,21 +124,25 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_virtual_machine_sizes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_virtual_machine_sizes_operations.py index 4bbc9f98e159..b3420af846e4 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_virtual_machine_sizes_operations.py @@ -8,7 +8,13 @@ # -------------------------------------------------------------------------- from typing import Any, Callable, Dict, Optional, TypeVar -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -18,8 +24,15 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._virtual_machine_sizes_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class VirtualMachineSizesOperations: """VirtualMachineSizesOperations async operations. @@ -45,9 +58,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace_async async def list( - self, - location: str, - **kwargs: Any + self, location: str, **kwargs: Any ) -> "_models.VirtualMachineSizeListResult": """Returns supported VM Sizes in a location. @@ -58,42 +69,54 @@ async def list( :rtype: ~azure.mgmt.machinelearningservices.models.VirtualMachineSizeListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_list_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualMachineSizeListResult', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "VirtualMachineSizeListResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes"} # type: ignore - + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_workspace_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_workspace_connections_operations.py index e29a99c87f44..b5ff0990afe1 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_workspace_connections_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_workspace_connections_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._workspace_connections_operations import build_create_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._workspace_connections_operations import ( + build_create_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class WorkspaceConnectionsOperations: """WorkspaceConnectionsOperations async operations. @@ -70,16 +88,26 @@ async def create( :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'WorkspaceConnectionPropertiesV2BasicResource') + _json = self._serialize.body( + parameters, "WorkspaceConnectionPropertiesV2BasicResource" + ) request = build_create_request( subscription_id=self._config.subscription_id, @@ -89,32 +117,39 @@ async def create( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create.metadata['url'], + template_url=self.create.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - + create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace_async async def get( @@ -137,47 +172,59 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, connection_name=connection_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -200,43 +247,51 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, connection_name=connection_name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace def list( @@ -246,7 +301,9 @@ def list( target: Optional[str] = None, category: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult" + ]: """list. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -264,16 +321,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -281,13 +345,13 @@ def prepare_request(next_link=None): api_version=api_version, target=target, category=category, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -303,7 +367,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -313,21 +380,25 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_workspace_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_workspace_features_operations.py index 005b34f1cc62..a5dccf76b813 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_workspace_features_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_workspace_features_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,8 +25,15 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._workspace_features_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class WorkspaceFeaturesOperations: """WorkspaceFeaturesOperations async operations. @@ -46,10 +59,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> AsyncIterable["_models.ListAmlUserFeatureResult"]: """Lists all enabled features for a workspace. @@ -64,28 +74,35 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListAmlUserFeatureResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAmlUserFeatureResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListAmlUserFeatureResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -99,7 +116,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ListAmlUserFeatureResult", pipeline_response) + deserialized = self._deserialize( + "ListAmlUserFeatureResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -109,21 +128,25 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_workspaces_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_workspaces_operations.py index c56bd5ff84f5..c35a14475348 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_workspaces_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_workspaces_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,31 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._workspaces_operations import build_create_or_update_request_initial, build_delete_request_initial, build_diagnose_request_initial, build_get_request, build_list_by_resource_group_request, build_list_by_subscription_request, build_list_keys_request, build_list_notebook_access_token_request, build_list_notebook_keys_request, build_list_outbound_network_dependencies_endpoints_request, build_list_storage_account_keys_request, build_prepare_notebook_request_initial, build_resync_keys_request_initial, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._workspaces_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_diagnose_request_initial, + build_get_request, + build_list_by_resource_group_request, + build_list_by_subscription_request, + build_list_keys_request, + build_list_notebook_access_token_request, + build_list_notebook_keys_request, + build_list_outbound_network_dependencies_endpoints_request, + build_list_storage_account_keys_request, + build_prepare_notebook_request_initial, + build_resync_keys_request_initial, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class WorkspacesOperations: """WorkspacesOperations async operations. @@ -49,10 +81,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace_async async def get( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.Workspace": """Gets the properties of the specified machine learning workspace. @@ -65,46 +94,54 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.Workspace :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore async def _create_or_update_initial( self, @@ -113,16 +150,24 @@ async def _create_or_update_initial( parameters: "_models.Workspace", **kwargs: Any ) -> Optional["_models.Workspace"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.Workspace"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'Workspace') + _json = self._serialize.body(parameters, "Workspace") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -131,33 +176,36 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -189,15 +237,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Workspace] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -205,81 +260,85 @@ async def begin_create_or_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes a machine learning workspace. @@ -299,42 +358,51 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore async def _update_initial( self, @@ -343,16 +411,24 @@ async def _update_initial( parameters: "_models.WorkspaceUpdateParameters", **kwargs: Any ) -> Optional["_models.Workspace"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.Workspace"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'WorkspaceUpdateParameters') + _json = self._serialize.body(parameters, "WorkspaceUpdateParameters") request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -361,33 +437,36 @@ async def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -419,15 +498,22 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Workspace] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -435,32 +521,36 @@ async def begin_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace def list_by_resource_group( @@ -481,28 +571,35 @@ def list_by_resource_group( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_by_resource_group_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, api_version=api_version, skip=skip, - template_url=self.list_by_resource_group.metadata['url'], + template_url=self.list_by_resource_group.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_by_resource_group_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -516,7 +613,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -526,24 +625,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore + list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore async def _diagnose_initial( self, @@ -552,17 +655,27 @@ async def _diagnose_initial( parameters: Optional["_models.DiagnoseWorkspaceParameters"] = None, **kwargs: Any ) -> Optional["_models.DiagnoseResponseResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if parameters is not None: - _json = self._serialize.body(parameters, 'DiagnoseWorkspaceParameters') + _json = self._serialize.body( + parameters, "DiagnoseWorkspaceParameters" + ) else: _json = None @@ -573,39 +686,47 @@ async def _diagnose_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._diagnose_initial.metadata['url'], + template_url=self._diagnose_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) + deserialized = self._deserialize( + "DiagnoseResponseResult", pipeline_response + ) if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _diagnose_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore - + _diagnose_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore @distributed_trace_async async def begin_diagnose( @@ -639,15 +760,24 @@ async def begin_diagnose( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.DiagnoseResponseResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnoseResponseResult"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DiagnoseResponseResult"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._diagnose_initial( resource_group_name=resource_group_name, @@ -655,39 +785,46 @@ async def begin_diagnose( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) + deserialized = self._deserialize( + "DiagnoseResponseResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_diagnose.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore + begin_diagnose.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore @distributed_trace_async async def list_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.ListWorkspaceKeysResult": """Lists all the keys associated with this workspace. This includes keys for the storage account, app insights and password for container registry. @@ -701,95 +838,107 @@ async def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListWorkspaceKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceKeysResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListWorkspaceKeysResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ListWorkspaceKeysResult', pipeline_response) + deserialized = self._deserialize( + "ListWorkspaceKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys"} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys"} # type: ignore async def _resync_keys_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_resync_keys_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self._resync_keys_initial.metadata['url'], + template_url=self._resync_keys_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _resync_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore - + _resync_keys_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore @distributed_trace_async async def begin_resync_keys( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: """Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and password for container registry. @@ -810,48 +959,55 @@ async def begin_resync_keys( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._resync_keys_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_resync_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore + begin_resync_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore @distributed_trace def list_by_subscription( - self, - skip: Optional[str] = None, - **kwargs: Any + self, skip: Optional[str] = None, **kwargs: Any ) -> AsyncIterable["_models.WorkspaceListResult"]: """Lists all the available machine learning workspaces under the specified subscription. @@ -863,27 +1019,34 @@ def list_by_subscription( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, skip=skip, - template_url=self.list_by_subscription.metadata['url'], + template_url=self.list_by_subscription.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, @@ -896,7 +1059,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -906,31 +1071,32 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore + list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore @distributed_trace_async async def list_notebook_access_token( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.NotebookAccessTokenResult": """return notebook access token and refresh token. @@ -943,101 +1109,117 @@ async def list_notebook_access_token( :rtype: ~azure.mgmt.machinelearningservices.models.NotebookAccessTokenResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookAccessTokenResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.NotebookAccessTokenResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_list_notebook_access_token_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_notebook_access_token.metadata['url'], + template_url=self.list_notebook_access_token.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('NotebookAccessTokenResult', pipeline_response) + deserialized = self._deserialize( + "NotebookAccessTokenResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_notebook_access_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken"} # type: ignore - + list_notebook_access_token.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken"} # type: ignore async def _prepare_notebook_initial( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> Optional["_models.NotebookResourceInfo"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NotebookResourceInfo"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.NotebookResourceInfo"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_prepare_notebook_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self._prepare_notebook_initial.metadata['url'], + template_url=self._prepare_notebook_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) + deserialized = self._deserialize( + "NotebookResourceInfo", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _prepare_notebook_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore - + _prepare_notebook_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore @distributed_trace_async async def begin_prepare_notebook( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> AsyncLROPoller["_models.NotebookResourceInfo"]: """Prepare a notebook. @@ -1059,52 +1241,66 @@ async def begin_prepare_notebook( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.NotebookResourceInfo] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookResourceInfo"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.NotebookResourceInfo"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._prepare_notebook_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) + deserialized = self._deserialize( + "NotebookResourceInfo", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_prepare_notebook.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore + begin_prepare_notebook.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore @distributed_trace_async async def list_storage_account_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.ListStorageAccountKeysResult": """List storage account keys of a workspace. @@ -1117,53 +1313,62 @@ async def list_storage_account_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListStorageAccountKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListStorageAccountKeysResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListStorageAccountKeysResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_list_storage_account_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_storage_account_keys.metadata['url'], + template_url=self.list_storage_account_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ListStorageAccountKeysResult', pipeline_response) + deserialized = self._deserialize( + "ListStorageAccountKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_storage_account_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys"} # type: ignore - + list_storage_account_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys"} # type: ignore @distributed_trace_async async def list_notebook_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.ListNotebookKeysResult": """List keys of a notebook. @@ -1176,53 +1381,62 @@ async def list_notebook_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListNotebookKeysResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListNotebookKeysResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_list_notebook_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_notebook_keys.metadata['url'], + template_url=self.list_notebook_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ListNotebookKeysResult', pipeline_response) + deserialized = self._deserialize( + "ListNotebookKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_notebook_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys"} # type: ignore - + list_notebook_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys"} # type: ignore @distributed_trace_async async def list_outbound_network_dependencies_endpoints( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.ExternalFQDNResponse": """Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) programmatically. @@ -1239,43 +1453,57 @@ async def list_outbound_network_dependencies_endpoints( :rtype: ~azure.mgmt.machinelearningservices.models.ExternalFQDNResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExternalFQDNResponse"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ExternalFQDNResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_list_outbound_network_dependencies_endpoints_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], + template_url=self.list_outbound_network_dependencies_endpoints.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ExternalFQDNResponse', pipeline_response) + deserialized = self._deserialize( + "ExternalFQDNResponse", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_outbound_network_dependencies_endpoints.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints"} # type: ignore - + list_outbound_network_dependencies_endpoints.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/__init__.py index 4da32226fd56..97a40d432677 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/__init__.py @@ -259,7 +259,9 @@ from ._models_py3 import MLTableJobInput from ._models_py3 import MLTableJobOutput from ._models_py3 import ManagedIdentity - from ._models_py3 import ManagedIdentityAuthTypeWorkspaceConnectionProperties + from ._models_py3 import ( + ManagedIdentityAuthTypeWorkspaceConnectionProperties, + ) from ._models_py3 import ManagedOnlineDeployment from ._models_py3 import ManagedServiceIdentity from ._models_py3 import MedianStoppingPolicy @@ -297,7 +299,9 @@ from ._models_py3 import PATAuthTypeWorkspaceConnectionProperties from ._models_py3 import PaginatedComputeResourcesList from ._models_py3 import PartialBatchDeployment - from ._models_py3 import PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties + from ._models_py3 import ( + PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, + ) from ._models_py3 import PartialManagedServiceIdentity from ._models_py3 import PartialMinimalTrackedResource from ._models_py3 import PartialMinimalTrackedResourceWithIdentity @@ -352,7 +356,9 @@ from ._models_py3 import ScriptsToExecute from ._models_py3 import Seasonality from ._models_py3 import ServiceManagedResourcesSettings - from ._models_py3 import ServicePrincipalAuthTypeWorkspaceConnectionProperties + from ._models_py3 import ( + ServicePrincipalAuthTypeWorkspaceConnectionProperties, + ) from ._models_py3 import ServicePrincipalDatastoreCredentials from ._models_py3 import ServicePrincipalDatastoreSecrets from ._models_py3 import SetupScripts @@ -415,7 +421,9 @@ from ._models_py3 import UserCreatedAcrAccount from ._models_py3 import UserCreatedStorageAccount from ._models_py3 import UserIdentity - from ._models_py3 import UsernamePasswordAuthTypeWorkspaceConnectionProperties + from ._models_py3 import ( + UsernamePasswordAuthTypeWorkspaceConnectionProperties, + ) from ._models_py3 import VirtualMachine from ._models_py3 import VirtualMachineImage from ._models_py3 import VirtualMachineSchema @@ -433,7 +441,9 @@ from ._models_py3 import WorkspaceConnectionPersonalAccessToken from ._models_py3 import WorkspaceConnectionPropertiesV2 from ._models_py3 import WorkspaceConnectionPropertiesV2BasicResource - from ._models_py3 import WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult + from ._models_py3 import ( + WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, + ) from ._models_py3 import WorkspaceConnectionServicePrincipal from ._models_py3 import WorkspaceConnectionSharedAccessSignature from ._models_py3 import WorkspaceConnectionUsernamePassword @@ -1009,568 +1019,568 @@ ) __all__ = [ - 'AKS', - 'AKSSchema', - 'AKSSchemaProperties', - 'AccessKeyAuthTypeWorkspaceConnectionProperties', - 'AccountKeyDatastoreCredentials', - 'AccountKeyDatastoreSecrets', - 'AcrDetails', - 'AksComputeSecrets', - 'AksComputeSecretsProperties', - 'AksNetworkingConfiguration', - 'AllNodes', - 'AmlCompute', - 'AmlComputeNodeInformation', - 'AmlComputeNodesInformation', - 'AmlComputeProperties', - 'AmlComputeSchema', - 'AmlOperation', - 'AmlOperationDisplay', - 'AmlOperationListResult', - 'AmlToken', - 'AmlUserFeature', - 'ArmResourceId', - 'AssetBase', - 'AssetContainer', - 'AssetJobInput', - 'AssetJobOutput', - 'AssetReferenceBase', - 'AssignedUser', - 'AutoForecastHorizon', - 'AutoMLJob', - 'AutoMLVertical', - 'AutoNCrossValidations', - 'AutoPauseProperties', - 'AutoScaleProperties', - 'AutoSeasonality', - 'AutoTargetLags', - 'AutoTargetRollingWindowSize', - 'AutologgerSettings', - 'AzureBlobDatastore', - 'AzureDataLakeGen1Datastore', - 'AzureDataLakeGen2Datastore', - 'AzureDatastore', - 'AzureFileDatastore', - 'BanditPolicy', - 'BatchDeployment', - 'BatchDeploymentProperties', - 'BatchDeploymentTrackedResourceArmPaginatedResult', - 'BatchEndpoint', - 'BatchEndpointDefaults', - 'BatchEndpointProperties', - 'BatchEndpointTrackedResourceArmPaginatedResult', - 'BatchRetrySettings', - 'BayesianSamplingAlgorithm', - 'BindOptions', - 'BuildContext', - 'CertificateDatastoreCredentials', - 'CertificateDatastoreSecrets', - 'Classification', - 'ClassificationTrainingSettings', - 'ClusterUpdateParameters', - 'CocoExportSummary', - 'CodeConfiguration', - 'CodeContainer', - 'CodeContainerProperties', - 'CodeContainerResourceArmPaginatedResult', - 'CodeVersion', - 'CodeVersionProperties', - 'CodeVersionResourceArmPaginatedResult', - 'ColumnTransformer', - 'CommandJob', - 'CommandJobLimits', - 'ComponentContainer', - 'ComponentContainerProperties', - 'ComponentContainerResourceArmPaginatedResult', - 'ComponentVersion', - 'ComponentVersionProperties', - 'ComponentVersionResourceArmPaginatedResult', - 'Compute', - 'ComputeInstance', - 'ComputeInstanceApplication', - 'ComputeInstanceAutologgerSettings', - 'ComputeInstanceConnectivityEndpoints', - 'ComputeInstanceContainer', - 'ComputeInstanceCreatedBy', - 'ComputeInstanceDataDisk', - 'ComputeInstanceDataMount', - 'ComputeInstanceEnvironmentInfo', - 'ComputeInstanceLastOperation', - 'ComputeInstanceProperties', - 'ComputeInstanceSchema', - 'ComputeInstanceSshSettings', - 'ComputeInstanceVersion', - 'ComputeResource', - 'ComputeResourceSchema', - 'ComputeSchedules', - 'ComputeSecrets', - 'ComputeStartStopSchedule', - 'ContainerResourceRequirements', - 'ContainerResourceSettings', - 'CosmosDbSettings', - 'Cron', - 'CronTrigger', - 'CsvExportSummary', - 'CustomForecastHorizon', - 'CustomModelJobInput', - 'CustomModelJobOutput', - 'CustomNCrossValidations', - 'CustomSeasonality', - 'CustomService', - 'CustomTargetLags', - 'CustomTargetRollingWindowSize', - 'DataContainer', - 'DataContainerProperties', - 'DataContainerResourceArmPaginatedResult', - 'DataFactory', - 'DataLakeAnalytics', - 'DataLakeAnalyticsSchema', - 'DataLakeAnalyticsSchemaProperties', - 'DataPathAssetReference', - 'DataVersionBase', - 'DataVersionBaseProperties', - 'DataVersionBaseResourceArmPaginatedResult', - 'Databricks', - 'DatabricksComputeSecrets', - 'DatabricksComputeSecretsProperties', - 'DatabricksProperties', - 'DatabricksSchema', - 'DatasetExportSummary', - 'Datastore', - 'DatastoreCredentials', - 'DatastoreProperties', - 'DatastoreResourceArmPaginatedResult', - 'DatastoreSecrets', - 'DefaultScaleSettings', - 'DeploymentLogs', - 'DeploymentLogsRequest', - 'DeploymentResourceConfiguration', - 'DiagnoseRequestProperties', - 'DiagnoseResponseResult', - 'DiagnoseResponseResultValue', - 'DiagnoseResult', - 'DiagnoseWorkspaceParameters', - 'DistributionConfiguration', - 'Docker', - 'EarlyTerminationPolicy', - 'EncryptionKeyVaultProperties', - 'EncryptionKeyVaultUpdateProperties', - 'EncryptionProperty', - 'EncryptionUpdateProperties', - 'Endpoint', - 'EndpointAuthKeys', - 'EndpointAuthToken', - 'EndpointDeploymentPropertiesBase', - 'EndpointPropertiesBase', - 'EndpointScheduleAction', - 'EnvironmentContainer', - 'EnvironmentContainerProperties', - 'EnvironmentContainerResourceArmPaginatedResult', - 'EnvironmentVariable', - 'EnvironmentVersion', - 'EnvironmentVersionProperties', - 'EnvironmentVersionResourceArmPaginatedResult', - 'ErrorAdditionalInfo', - 'ErrorDetail', - 'ErrorResponse', - 'EstimatedVMPrice', - 'EstimatedVMPrices', - 'ExportSummary', - 'ExternalFQDNResponse', - 'FQDNEndpoint', - 'FQDNEndpointDetail', - 'FQDNEndpoints', - 'FQDNEndpointsProperties', - 'FeaturizationSettings', - 'FlavorData', - 'ForecastHorizon', - 'Forecasting', - 'ForecastingSettings', - 'ForecastingTrainingSettings', - 'GridSamplingAlgorithm', - 'HDInsight', - 'HDInsightProperties', - 'HDInsightSchema', - 'HdfsDatastore', - 'IdAssetReference', - 'IdentityConfiguration', - 'IdentityForCmk', - 'IdleShutdownSetting', - 'Image', - 'ImageClassification', - 'ImageClassificationBase', - 'ImageClassificationMultilabel', - 'ImageInstanceSegmentation', - 'ImageLimitSettings', - 'ImageMetadata', - 'ImageModelDistributionSettings', - 'ImageModelDistributionSettingsClassification', - 'ImageModelDistributionSettingsObjectDetection', - 'ImageModelSettings', - 'ImageModelSettingsClassification', - 'ImageModelSettingsObjectDetection', - 'ImageObjectDetection', - 'ImageObjectDetectionBase', - 'ImageSweepSettings', - 'ImageVertical', - 'InferenceContainerProperties', - 'InstanceTypeSchema', - 'InstanceTypeSchemaResources', - 'JobBase', - 'JobBaseProperties', - 'JobBaseResourceArmPaginatedResult', - 'JobInput', - 'JobLimits', - 'JobOutput', - 'JobResourceConfiguration', - 'JobScheduleAction', - 'JobService', - 'KerberosCredentials', - 'KerberosKeytabCredentials', - 'KerberosKeytabSecrets', - 'KerberosPasswordCredentials', - 'KerberosPasswordSecrets', - 'Kubernetes', - 'KubernetesOnlineDeployment', - 'KubernetesProperties', - 'KubernetesSchema', - 'LabelCategory', - 'LabelClass', - 'LabelingDataConfiguration', - 'LabelingJob', - 'LabelingJobImageProperties', - 'LabelingJobInstructions', - 'LabelingJobMediaProperties', - 'LabelingJobProperties', - 'LabelingJobResourceArmPaginatedResult', - 'LabelingJobTextProperties', - 'ListAmlUserFeatureResult', - 'ListNotebookKeysResult', - 'ListStorageAccountKeysResult', - 'ListUsagesResult', - 'ListWorkspaceKeysResult', - 'ListWorkspaceQuotas', - 'LiteralJobInput', - 'MLAssistConfiguration', - 'MLAssistConfigurationDisabled', - 'MLAssistConfigurationEnabled', - 'MLFlowModelJobInput', - 'MLFlowModelJobOutput', - 'MLTableData', - 'MLTableJobInput', - 'MLTableJobOutput', - 'ManagedIdentity', - 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', - 'ManagedOnlineDeployment', - 'ManagedServiceIdentity', - 'MedianStoppingPolicy', - 'ModelContainer', - 'ModelContainerProperties', - 'ModelContainerResourceArmPaginatedResult', - 'ModelVersion', - 'ModelVersionProperties', - 'ModelVersionResourceArmPaginatedResult', - 'Mpi', - 'NCrossValidations', - 'NlpFixedParameters', - 'NlpParameterSubspace', - 'NlpSweepSettings', - 'NlpVertical', - 'NlpVerticalFeaturizationSettings', - 'NlpVerticalLimitSettings', - 'NodeStateCounts', - 'Nodes', - 'NoneAuthTypeWorkspaceConnectionProperties', - 'NoneDatastoreCredentials', - 'NotebookAccessTokenResult', - 'NotebookPreparationError', - 'NotebookResourceInfo', - 'Objective', - 'OnlineDeployment', - 'OnlineDeploymentProperties', - 'OnlineDeploymentTrackedResourceArmPaginatedResult', - 'OnlineEndpoint', - 'OnlineEndpointProperties', - 'OnlineEndpointTrackedResourceArmPaginatedResult', - 'OnlineRequestSettings', - 'OnlineScaleSettings', - 'OutputPathAssetReference', - 'PATAuthTypeWorkspaceConnectionProperties', - 'PaginatedComputeResourcesList', - 'PartialBatchDeployment', - 'PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties', - 'PartialManagedServiceIdentity', - 'PartialMinimalTrackedResource', - 'PartialMinimalTrackedResourceWithIdentity', - 'PartialMinimalTrackedResourceWithSku', - 'PartialRegistryPartialTrackedResource', - 'PartialSku', - 'Password', - 'PersonalComputeInstanceSettings', - 'PipelineJob', - 'PrivateEndpoint', - 'PrivateEndpointConnection', - 'PrivateEndpointConnectionListResult', - 'PrivateLinkResource', - 'PrivateLinkResourceListResult', - 'PrivateLinkServiceConnectionState', - 'ProbeSettings', - 'ProgressMetrics', - 'PyTorch', - 'QuotaBaseProperties', - 'QuotaUpdateParameters', - 'RandomSamplingAlgorithm', - 'Recurrence', - 'RecurrenceSchedule', - 'RecurrenceTrigger', - 'RegenerateEndpointKeysRequest', - 'Registry', - 'RegistryListCredentialsResult', - 'RegistryProperties', - 'RegistryRegionArmDetails', - 'RegistryTrackedResourceArmPaginatedResult', - 'Regression', - 'RegressionTrainingSettings', - 'Resource', - 'ResourceBase', - 'ResourceConfiguration', - 'ResourceId', - 'ResourceName', - 'ResourceQuota', - 'Route', - 'SASAuthTypeWorkspaceConnectionProperties', - 'SamplingAlgorithm', - 'SasDatastoreCredentials', - 'SasDatastoreSecrets', - 'ScaleSettings', - 'ScaleSettingsInformation', - 'Schedule', - 'ScheduleActionBase', - 'ScheduleBase', - 'ScheduleProperties', - 'ScheduleResourceArmPaginatedResult', - 'ScriptReference', - 'ScriptsToExecute', - 'Seasonality', - 'ServiceManagedResourcesSettings', - 'ServicePrincipalAuthTypeWorkspaceConnectionProperties', - 'ServicePrincipalDatastoreCredentials', - 'ServicePrincipalDatastoreSecrets', - 'SetupScripts', - 'SharedPrivateLinkResource', - 'Sku', - 'SkuCapacity', - 'SkuResource', - 'SkuResourceArmPaginatedResult', - 'SkuSetting', - 'SparkJob', - 'SparkJobEntry', - 'SparkJobPythonEntry', - 'SparkJobScalaEntry', - 'SparkResourceConfiguration', - 'SslConfiguration', - 'StackEnsembleSettings', - 'StatusMessage', - 'StorageAccountDetails', - 'SweepJob', - 'SweepJobLimits', - 'SynapseSpark', - 'SynapseSparkProperties', - 'SystemCreatedAcrAccount', - 'SystemCreatedStorageAccount', - 'SystemData', - 'SystemService', - 'TableFixedParameters', - 'TableParameterSubspace', - 'TableSweepSettings', - 'TableVertical', - 'TableVerticalFeaturizationSettings', - 'TableVerticalLimitSettings', - 'TargetLags', - 'TargetRollingWindowSize', - 'TargetUtilizationScaleSettings', - 'TensorFlow', - 'TextClassification', - 'TextClassificationMultilabel', - 'TextNer', - 'TmpfsOptions', - 'TrackedResource', - 'TrainingSettings', - 'TrialComponent', - 'TriggerBase', - 'TritonModelJobInput', - 'TritonModelJobOutput', - 'TruncationSelectionPolicy', - 'UpdateWorkspaceQuotas', - 'UpdateWorkspaceQuotasResult', - 'UriFileDataVersion', - 'UriFileJobInput', - 'UriFileJobOutput', - 'UriFolderDataVersion', - 'UriFolderJobInput', - 'UriFolderJobOutput', - 'Usage', - 'UsageName', - 'UserAccountCredentials', - 'UserAssignedIdentity', - 'UserCreatedAcrAccount', - 'UserCreatedStorageAccount', - 'UserIdentity', - 'UsernamePasswordAuthTypeWorkspaceConnectionProperties', - 'VirtualMachine', - 'VirtualMachineImage', - 'VirtualMachineSchema', - 'VirtualMachineSchemaProperties', - 'VirtualMachineSecrets', - 'VirtualMachineSecretsSchema', - 'VirtualMachineSize', - 'VirtualMachineSizeListResult', - 'VirtualMachineSshCredentials', - 'VolumeDefinition', - 'VolumeOptions', - 'Workspace', - 'WorkspaceConnectionAccessKey', - 'WorkspaceConnectionManagedIdentity', - 'WorkspaceConnectionPersonalAccessToken', - 'WorkspaceConnectionPropertiesV2', - 'WorkspaceConnectionPropertiesV2BasicResource', - 'WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult', - 'WorkspaceConnectionServicePrincipal', - 'WorkspaceConnectionSharedAccessSignature', - 'WorkspaceConnectionUsernamePassword', - 'WorkspaceListResult', - 'WorkspaceUpdateParameters', - 'AllocationState', - 'ApplicationSharingPolicy', - 'AssetProvisioningState', - 'Autosave', - 'BatchLoggingLevel', - 'BatchOutputAction', - 'BillingCurrency', - 'BlockedTransformers', - 'Caching', - 'ClassificationModels', - 'ClassificationMultilabelPrimaryMetrics', - 'ClassificationPrimaryMetrics', - 'ClusterPurpose', - 'ComputeInstanceAuthorizationType', - 'ComputeInstanceState', - 'ComputePowerAction', - 'ComputeProvisioningState', - 'ComputeType', - 'ConnectionAuthType', - 'ContainerType', - 'CreatedByType', - 'CredentialsType', - 'DataType', - 'DatastoreType', - 'DeploymentProvisioningState', - 'DiagnoseResultLevel', - 'DistributionType', - 'EarlyTerminationPolicyType', - 'EgressPublicNetworkAccessType', - 'EncryptionStatus', - 'EndpointAuthMode', - 'EndpointComputeType', - 'EndpointProvisioningState', - 'EnvironmentType', - 'EnvironmentVariableType', - 'ExportFormatType', - 'FeatureLags', - 'FeaturizationMode', - 'ForecastHorizonMode', - 'ForecastingModels', - 'ForecastingPrimaryMetrics', - 'Goal', - 'IdentityConfigurationType', - 'ImageAnnotationType', - 'ImageType', - 'InputDeliveryMode', - 'InstanceSegmentationPrimaryMetrics', - 'JobInputType', - 'JobLimitsType', - 'JobOutputType', - 'JobProvisioningState', - 'JobStatus', - 'JobType', - 'KeyType', - 'LearningRateScheduler', - 'ListViewType', - 'LoadBalancerType', - 'LogVerbosity', - 'MLAssistConfigurationType', - 'MLFlowAutologgerState', - 'ManagedServiceIdentityType', - 'MediaType', - 'MlflowAutologger', - 'ModelSize', - 'MountAction', - 'MountState', - 'NCrossValidationsMode', - 'Network', - 'NlpLearningRateScheduler', - 'NodeState', - 'NodesValueType', - 'ObjectDetectionPrimaryMetrics', - 'OperatingSystemType', - 'OperationName', - 'OperationStatus', - 'OperationTrigger', - 'OrderString', - 'OsType', - 'OutputDeliveryMode', - 'PrivateEndpointConnectionProvisioningState', - 'PrivateEndpointServiceConnectionStatus', - 'Protocol', - 'ProvisioningStatus', - 'PublicNetworkAccess', - 'PublicNetworkAccessType', - 'QuotaUnit', - 'RandomSamplingAlgorithmRule', - 'RecurrenceFrequency', - 'ReferenceType', - 'RegressionModels', - 'RegressionPrimaryMetrics', - 'RemoteLoginPortPublicAccess', - 'SamplingAlgorithmType', - 'ScaleType', - 'ScheduleActionType', - 'ScheduleListViewType', - 'ScheduleProvisioningState', - 'ScheduleProvisioningStatus', - 'ScheduleStatus', - 'SeasonalityMode', - 'SecretsType', - 'ServiceDataAccessAuthIdentity', - 'ShortSeriesHandlingConfiguration', - 'SkuScaleType', - 'SkuTier', - 'SourceType', - 'SparkJobEntryType', - 'SshPublicAccess', - 'SslConfigStatus', - 'StackMetaLearnerType', - 'Status', - 'StatusMessageLevel', - 'StochasticOptimizer', - 'StorageAccountType', - 'TargetAggregationFunction', - 'TargetLagsMode', - 'TargetRollingWindowSizeMode', - 'TaskType', - 'TextAnnotationType', - 'TriggerType', - 'UnderlyingResourceAction', - 'UnitOfMeasure', - 'UsageUnit', - 'UseStl', - 'VMPriceOSType', - 'VMTier', - 'ValidationMetricType', - 'ValueFormat', - 'VmPriority', - 'VolumeDefinitionType', - 'WeekDay', - 'WorkspaceProvisioningState', + "AKS", + "AKSSchema", + "AKSSchemaProperties", + "AccessKeyAuthTypeWorkspaceConnectionProperties", + "AccountKeyDatastoreCredentials", + "AccountKeyDatastoreSecrets", + "AcrDetails", + "AksComputeSecrets", + "AksComputeSecretsProperties", + "AksNetworkingConfiguration", + "AllNodes", + "AmlCompute", + "AmlComputeNodeInformation", + "AmlComputeNodesInformation", + "AmlComputeProperties", + "AmlComputeSchema", + "AmlOperation", + "AmlOperationDisplay", + "AmlOperationListResult", + "AmlToken", + "AmlUserFeature", + "ArmResourceId", + "AssetBase", + "AssetContainer", + "AssetJobInput", + "AssetJobOutput", + "AssetReferenceBase", + "AssignedUser", + "AutoForecastHorizon", + "AutoMLJob", + "AutoMLVertical", + "AutoNCrossValidations", + "AutoPauseProperties", + "AutoScaleProperties", + "AutoSeasonality", + "AutoTargetLags", + "AutoTargetRollingWindowSize", + "AutologgerSettings", + "AzureBlobDatastore", + "AzureDataLakeGen1Datastore", + "AzureDataLakeGen2Datastore", + "AzureDatastore", + "AzureFileDatastore", + "BanditPolicy", + "BatchDeployment", + "BatchDeploymentProperties", + "BatchDeploymentTrackedResourceArmPaginatedResult", + "BatchEndpoint", + "BatchEndpointDefaults", + "BatchEndpointProperties", + "BatchEndpointTrackedResourceArmPaginatedResult", + "BatchRetrySettings", + "BayesianSamplingAlgorithm", + "BindOptions", + "BuildContext", + "CertificateDatastoreCredentials", + "CertificateDatastoreSecrets", + "Classification", + "ClassificationTrainingSettings", + "ClusterUpdateParameters", + "CocoExportSummary", + "CodeConfiguration", + "CodeContainer", + "CodeContainerProperties", + "CodeContainerResourceArmPaginatedResult", + "CodeVersion", + "CodeVersionProperties", + "CodeVersionResourceArmPaginatedResult", + "ColumnTransformer", + "CommandJob", + "CommandJobLimits", + "ComponentContainer", + "ComponentContainerProperties", + "ComponentContainerResourceArmPaginatedResult", + "ComponentVersion", + "ComponentVersionProperties", + "ComponentVersionResourceArmPaginatedResult", + "Compute", + "ComputeInstance", + "ComputeInstanceApplication", + "ComputeInstanceAutologgerSettings", + "ComputeInstanceConnectivityEndpoints", + "ComputeInstanceContainer", + "ComputeInstanceCreatedBy", + "ComputeInstanceDataDisk", + "ComputeInstanceDataMount", + "ComputeInstanceEnvironmentInfo", + "ComputeInstanceLastOperation", + "ComputeInstanceProperties", + "ComputeInstanceSchema", + "ComputeInstanceSshSettings", + "ComputeInstanceVersion", + "ComputeResource", + "ComputeResourceSchema", + "ComputeSchedules", + "ComputeSecrets", + "ComputeStartStopSchedule", + "ContainerResourceRequirements", + "ContainerResourceSettings", + "CosmosDbSettings", + "Cron", + "CronTrigger", + "CsvExportSummary", + "CustomForecastHorizon", + "CustomModelJobInput", + "CustomModelJobOutput", + "CustomNCrossValidations", + "CustomSeasonality", + "CustomService", + "CustomTargetLags", + "CustomTargetRollingWindowSize", + "DataContainer", + "DataContainerProperties", + "DataContainerResourceArmPaginatedResult", + "DataFactory", + "DataLakeAnalytics", + "DataLakeAnalyticsSchema", + "DataLakeAnalyticsSchemaProperties", + "DataPathAssetReference", + "DataVersionBase", + "DataVersionBaseProperties", + "DataVersionBaseResourceArmPaginatedResult", + "Databricks", + "DatabricksComputeSecrets", + "DatabricksComputeSecretsProperties", + "DatabricksProperties", + "DatabricksSchema", + "DatasetExportSummary", + "Datastore", + "DatastoreCredentials", + "DatastoreProperties", + "DatastoreResourceArmPaginatedResult", + "DatastoreSecrets", + "DefaultScaleSettings", + "DeploymentLogs", + "DeploymentLogsRequest", + "DeploymentResourceConfiguration", + "DiagnoseRequestProperties", + "DiagnoseResponseResult", + "DiagnoseResponseResultValue", + "DiagnoseResult", + "DiagnoseWorkspaceParameters", + "DistributionConfiguration", + "Docker", + "EarlyTerminationPolicy", + "EncryptionKeyVaultProperties", + "EncryptionKeyVaultUpdateProperties", + "EncryptionProperty", + "EncryptionUpdateProperties", + "Endpoint", + "EndpointAuthKeys", + "EndpointAuthToken", + "EndpointDeploymentPropertiesBase", + "EndpointPropertiesBase", + "EndpointScheduleAction", + "EnvironmentContainer", + "EnvironmentContainerProperties", + "EnvironmentContainerResourceArmPaginatedResult", + "EnvironmentVariable", + "EnvironmentVersion", + "EnvironmentVersionProperties", + "EnvironmentVersionResourceArmPaginatedResult", + "ErrorAdditionalInfo", + "ErrorDetail", + "ErrorResponse", + "EstimatedVMPrice", + "EstimatedVMPrices", + "ExportSummary", + "ExternalFQDNResponse", + "FQDNEndpoint", + "FQDNEndpointDetail", + "FQDNEndpoints", + "FQDNEndpointsProperties", + "FeaturizationSettings", + "FlavorData", + "ForecastHorizon", + "Forecasting", + "ForecastingSettings", + "ForecastingTrainingSettings", + "GridSamplingAlgorithm", + "HDInsight", + "HDInsightProperties", + "HDInsightSchema", + "HdfsDatastore", + "IdAssetReference", + "IdentityConfiguration", + "IdentityForCmk", + "IdleShutdownSetting", + "Image", + "ImageClassification", + "ImageClassificationBase", + "ImageClassificationMultilabel", + "ImageInstanceSegmentation", + "ImageLimitSettings", + "ImageMetadata", + "ImageModelDistributionSettings", + "ImageModelDistributionSettingsClassification", + "ImageModelDistributionSettingsObjectDetection", + "ImageModelSettings", + "ImageModelSettingsClassification", + "ImageModelSettingsObjectDetection", + "ImageObjectDetection", + "ImageObjectDetectionBase", + "ImageSweepSettings", + "ImageVertical", + "InferenceContainerProperties", + "InstanceTypeSchema", + "InstanceTypeSchemaResources", + "JobBase", + "JobBaseProperties", + "JobBaseResourceArmPaginatedResult", + "JobInput", + "JobLimits", + "JobOutput", + "JobResourceConfiguration", + "JobScheduleAction", + "JobService", + "KerberosCredentials", + "KerberosKeytabCredentials", + "KerberosKeytabSecrets", + "KerberosPasswordCredentials", + "KerberosPasswordSecrets", + "Kubernetes", + "KubernetesOnlineDeployment", + "KubernetesProperties", + "KubernetesSchema", + "LabelCategory", + "LabelClass", + "LabelingDataConfiguration", + "LabelingJob", + "LabelingJobImageProperties", + "LabelingJobInstructions", + "LabelingJobMediaProperties", + "LabelingJobProperties", + "LabelingJobResourceArmPaginatedResult", + "LabelingJobTextProperties", + "ListAmlUserFeatureResult", + "ListNotebookKeysResult", + "ListStorageAccountKeysResult", + "ListUsagesResult", + "ListWorkspaceKeysResult", + "ListWorkspaceQuotas", + "LiteralJobInput", + "MLAssistConfiguration", + "MLAssistConfigurationDisabled", + "MLAssistConfigurationEnabled", + "MLFlowModelJobInput", + "MLFlowModelJobOutput", + "MLTableData", + "MLTableJobInput", + "MLTableJobOutput", + "ManagedIdentity", + "ManagedIdentityAuthTypeWorkspaceConnectionProperties", + "ManagedOnlineDeployment", + "ManagedServiceIdentity", + "MedianStoppingPolicy", + "ModelContainer", + "ModelContainerProperties", + "ModelContainerResourceArmPaginatedResult", + "ModelVersion", + "ModelVersionProperties", + "ModelVersionResourceArmPaginatedResult", + "Mpi", + "NCrossValidations", + "NlpFixedParameters", + "NlpParameterSubspace", + "NlpSweepSettings", + "NlpVertical", + "NlpVerticalFeaturizationSettings", + "NlpVerticalLimitSettings", + "NodeStateCounts", + "Nodes", + "NoneAuthTypeWorkspaceConnectionProperties", + "NoneDatastoreCredentials", + "NotebookAccessTokenResult", + "NotebookPreparationError", + "NotebookResourceInfo", + "Objective", + "OnlineDeployment", + "OnlineDeploymentProperties", + "OnlineDeploymentTrackedResourceArmPaginatedResult", + "OnlineEndpoint", + "OnlineEndpointProperties", + "OnlineEndpointTrackedResourceArmPaginatedResult", + "OnlineRequestSettings", + "OnlineScaleSettings", + "OutputPathAssetReference", + "PATAuthTypeWorkspaceConnectionProperties", + "PaginatedComputeResourcesList", + "PartialBatchDeployment", + "PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties", + "PartialManagedServiceIdentity", + "PartialMinimalTrackedResource", + "PartialMinimalTrackedResourceWithIdentity", + "PartialMinimalTrackedResourceWithSku", + "PartialRegistryPartialTrackedResource", + "PartialSku", + "Password", + "PersonalComputeInstanceSettings", + "PipelineJob", + "PrivateEndpoint", + "PrivateEndpointConnection", + "PrivateEndpointConnectionListResult", + "PrivateLinkResource", + "PrivateLinkResourceListResult", + "PrivateLinkServiceConnectionState", + "ProbeSettings", + "ProgressMetrics", + "PyTorch", + "QuotaBaseProperties", + "QuotaUpdateParameters", + "RandomSamplingAlgorithm", + "Recurrence", + "RecurrenceSchedule", + "RecurrenceTrigger", + "RegenerateEndpointKeysRequest", + "Registry", + "RegistryListCredentialsResult", + "RegistryProperties", + "RegistryRegionArmDetails", + "RegistryTrackedResourceArmPaginatedResult", + "Regression", + "RegressionTrainingSettings", + "Resource", + "ResourceBase", + "ResourceConfiguration", + "ResourceId", + "ResourceName", + "ResourceQuota", + "Route", + "SASAuthTypeWorkspaceConnectionProperties", + "SamplingAlgorithm", + "SasDatastoreCredentials", + "SasDatastoreSecrets", + "ScaleSettings", + "ScaleSettingsInformation", + "Schedule", + "ScheduleActionBase", + "ScheduleBase", + "ScheduleProperties", + "ScheduleResourceArmPaginatedResult", + "ScriptReference", + "ScriptsToExecute", + "Seasonality", + "ServiceManagedResourcesSettings", + "ServicePrincipalAuthTypeWorkspaceConnectionProperties", + "ServicePrincipalDatastoreCredentials", + "ServicePrincipalDatastoreSecrets", + "SetupScripts", + "SharedPrivateLinkResource", + "Sku", + "SkuCapacity", + "SkuResource", + "SkuResourceArmPaginatedResult", + "SkuSetting", + "SparkJob", + "SparkJobEntry", + "SparkJobPythonEntry", + "SparkJobScalaEntry", + "SparkResourceConfiguration", + "SslConfiguration", + "StackEnsembleSettings", + "StatusMessage", + "StorageAccountDetails", + "SweepJob", + "SweepJobLimits", + "SynapseSpark", + "SynapseSparkProperties", + "SystemCreatedAcrAccount", + "SystemCreatedStorageAccount", + "SystemData", + "SystemService", + "TableFixedParameters", + "TableParameterSubspace", + "TableSweepSettings", + "TableVertical", + "TableVerticalFeaturizationSettings", + "TableVerticalLimitSettings", + "TargetLags", + "TargetRollingWindowSize", + "TargetUtilizationScaleSettings", + "TensorFlow", + "TextClassification", + "TextClassificationMultilabel", + "TextNer", + "TmpfsOptions", + "TrackedResource", + "TrainingSettings", + "TrialComponent", + "TriggerBase", + "TritonModelJobInput", + "TritonModelJobOutput", + "TruncationSelectionPolicy", + "UpdateWorkspaceQuotas", + "UpdateWorkspaceQuotasResult", + "UriFileDataVersion", + "UriFileJobInput", + "UriFileJobOutput", + "UriFolderDataVersion", + "UriFolderJobInput", + "UriFolderJobOutput", + "Usage", + "UsageName", + "UserAccountCredentials", + "UserAssignedIdentity", + "UserCreatedAcrAccount", + "UserCreatedStorageAccount", + "UserIdentity", + "UsernamePasswordAuthTypeWorkspaceConnectionProperties", + "VirtualMachine", + "VirtualMachineImage", + "VirtualMachineSchema", + "VirtualMachineSchemaProperties", + "VirtualMachineSecrets", + "VirtualMachineSecretsSchema", + "VirtualMachineSize", + "VirtualMachineSizeListResult", + "VirtualMachineSshCredentials", + "VolumeDefinition", + "VolumeOptions", + "Workspace", + "WorkspaceConnectionAccessKey", + "WorkspaceConnectionManagedIdentity", + "WorkspaceConnectionPersonalAccessToken", + "WorkspaceConnectionPropertiesV2", + "WorkspaceConnectionPropertiesV2BasicResource", + "WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", + "WorkspaceConnectionServicePrincipal", + "WorkspaceConnectionSharedAccessSignature", + "WorkspaceConnectionUsernamePassword", + "WorkspaceListResult", + "WorkspaceUpdateParameters", + "AllocationState", + "ApplicationSharingPolicy", + "AssetProvisioningState", + "Autosave", + "BatchLoggingLevel", + "BatchOutputAction", + "BillingCurrency", + "BlockedTransformers", + "Caching", + "ClassificationModels", + "ClassificationMultilabelPrimaryMetrics", + "ClassificationPrimaryMetrics", + "ClusterPurpose", + "ComputeInstanceAuthorizationType", + "ComputeInstanceState", + "ComputePowerAction", + "ComputeProvisioningState", + "ComputeType", + "ConnectionAuthType", + "ContainerType", + "CreatedByType", + "CredentialsType", + "DataType", + "DatastoreType", + "DeploymentProvisioningState", + "DiagnoseResultLevel", + "DistributionType", + "EarlyTerminationPolicyType", + "EgressPublicNetworkAccessType", + "EncryptionStatus", + "EndpointAuthMode", + "EndpointComputeType", + "EndpointProvisioningState", + "EnvironmentType", + "EnvironmentVariableType", + "ExportFormatType", + "FeatureLags", + "FeaturizationMode", + "ForecastHorizonMode", + "ForecastingModels", + "ForecastingPrimaryMetrics", + "Goal", + "IdentityConfigurationType", + "ImageAnnotationType", + "ImageType", + "InputDeliveryMode", + "InstanceSegmentationPrimaryMetrics", + "JobInputType", + "JobLimitsType", + "JobOutputType", + "JobProvisioningState", + "JobStatus", + "JobType", + "KeyType", + "LearningRateScheduler", + "ListViewType", + "LoadBalancerType", + "LogVerbosity", + "MLAssistConfigurationType", + "MLFlowAutologgerState", + "ManagedServiceIdentityType", + "MediaType", + "MlflowAutologger", + "ModelSize", + "MountAction", + "MountState", + "NCrossValidationsMode", + "Network", + "NlpLearningRateScheduler", + "NodeState", + "NodesValueType", + "ObjectDetectionPrimaryMetrics", + "OperatingSystemType", + "OperationName", + "OperationStatus", + "OperationTrigger", + "OrderString", + "OsType", + "OutputDeliveryMode", + "PrivateEndpointConnectionProvisioningState", + "PrivateEndpointServiceConnectionStatus", + "Protocol", + "ProvisioningStatus", + "PublicNetworkAccess", + "PublicNetworkAccessType", + "QuotaUnit", + "RandomSamplingAlgorithmRule", + "RecurrenceFrequency", + "ReferenceType", + "RegressionModels", + "RegressionPrimaryMetrics", + "RemoteLoginPortPublicAccess", + "SamplingAlgorithmType", + "ScaleType", + "ScheduleActionType", + "ScheduleListViewType", + "ScheduleProvisioningState", + "ScheduleProvisioningStatus", + "ScheduleStatus", + "SeasonalityMode", + "SecretsType", + "ServiceDataAccessAuthIdentity", + "ShortSeriesHandlingConfiguration", + "SkuScaleType", + "SkuTier", + "SourceType", + "SparkJobEntryType", + "SshPublicAccess", + "SslConfigStatus", + "StackMetaLearnerType", + "Status", + "StatusMessageLevel", + "StochasticOptimizer", + "StorageAccountType", + "TargetAggregationFunction", + "TargetLagsMode", + "TargetRollingWindowSizeMode", + "TaskType", + "TextAnnotationType", + "TriggerType", + "UnderlyingResourceAction", + "UnitOfMeasure", + "UsageUnit", + "UseStl", + "VMPriceOSType", + "VMTier", + "ValidationMetricType", + "ValueFormat", + "VmPriority", + "VolumeDefinitionType", + "WeekDay", + "WorkspaceProvisioningState", ] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/_azure_machine_learning_workspaces_enums.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/_azure_machine_learning_workspaces_enums.py index 0ac0a0f2cce5..e7758e848f66 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/_azure_machine_learning_workspaces_enums.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/_azure_machine_learning_workspaces_enums.py @@ -21,6 +21,7 @@ class AllocationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): STEADY = "Steady" RESIZING = "Resizing" + class ApplicationSharingPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Policy for sharing applications on this compute instance among users of parent workspace. If Personal, only the creator can access applications on this compute instance. When Shared, any @@ -30,9 +31,9 @@ class ApplicationSharingPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): PERSONAL = "Personal" SHARED = "Shared" + class AssetProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Provisioning state of registry asset. - """ + """Provisioning state of registry asset.""" SUCCEEDED = "Succeeded" FAILED = "Failed" @@ -41,14 +42,15 @@ class AssetProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): UPDATING = "Updating" DELETING = "Deleting" + class Autosave(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Auto save settings. - """ + """Auto save settings.""" NONE = "None" LOCAL = "Local" REMOTE = "Remote" + class BatchLoggingLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Log verbosity for batch inferencing. Increasing verbosity order for logging is : Warning, Info and Debug. @@ -59,22 +61,22 @@ class BatchLoggingLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): WARNING = "Warning" DEBUG = "Debug" + class BatchOutputAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine how batch inferencing will handle output - """ + """Enum to determine how batch inferencing will handle output""" SUMMARY_ONLY = "SummaryOnly" APPEND_ROW = "AppendRow" + class BillingCurrency(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Three lettered code specifying the currency of the VM price. Example: USD - """ + """Three lettered code specifying the currency of the VM price. Example: USD""" USD = "USD" + class BlockedTransformers(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum for all classification models supported by AutoML. - """ + """Enum for all classification models supported by AutoML.""" #: Target encoding for text data. TEXT_TARGET_ENCODER = "TextTargetEncoder" @@ -101,17 +103,17 @@ class BlockedTransformers(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: This is often used for high-cardinality categorical features. HASH_ONE_HOT_ENCODER = "HashOneHotEncoder" + class Caching(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Caching type of Data Disk. - """ + """Caching type of Data Disk.""" NONE = "None" READ_ONLY = "ReadOnly" READ_WRITE = "ReadWrite" + class ClassificationModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum for all classification models supported by AutoML. - """ + """Enum for all classification models supported by AutoML.""" #: Logistic regression is a fundamental classification technique. #: It belongs to the group of linear classifiers and is somewhat similar to polynomial and linear @@ -173,9 +175,11 @@ class ClassificationModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: target column values can be divided into distinct class values. XG_BOOST_CLASSIFIER = "XGBoostClassifier" -class ClassificationMultilabelPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for classification multilabel tasks. - """ + +class ClassificationMultilabelPrimaryMetrics( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """Primary metrics for classification multilabel tasks.""" #: AUC is the Area under the curve. #: This metric represents arithmetic mean of the score for each class, @@ -195,9 +199,11 @@ class ClassificationMultilabelPrimaryMetrics(str, Enum, metaclass=CaseInsensitiv #: Intersection Over Union. Intersection of predictions divided by union of predictions. IOU = "IOU" -class ClassificationPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for classification tasks. - """ + +class ClassificationPrimaryMetrics( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """Primary metrics for classification tasks.""" #: AUC is the Area under the curve. #: This metric represents arithmetic mean of the score for each class, @@ -215,23 +221,25 @@ class ClassificationPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta) #: class. PRECISION_SCORE_WEIGHTED = "PrecisionScoreWeighted" + class ClusterPurpose(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Intended usage of the cluster - """ + """Intended usage of the cluster""" FAST_PROD = "FastProd" DENSE_PROD = "DenseProd" DEV_TEST = "DevTest" -class ComputeInstanceAuthorizationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The Compute Instance Authorization type. Available values are personal (default). - """ + +class ComputeInstanceAuthorizationType( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """The Compute Instance Authorization type. Available values are personal (default).""" PERSONAL = "personal" + class ComputeInstanceState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Current state of an ComputeInstance. - """ + """Current state of an ComputeInstance.""" CREATING = "Creating" CREATE_FAILED = "CreateFailed" @@ -249,13 +257,14 @@ class ComputeInstanceState(str, Enum, metaclass=CaseInsensitiveEnumMeta): UNKNOWN = "Unknown" UNUSABLE = "Unusable" + class ComputePowerAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """[Required] The compute power action. - """ + """[Required] The compute power action.""" START = "Start" STOP = "Stop" + class ComputeProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. @@ -269,9 +278,9 @@ class ComputeProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): FAILED = "Failed" CANCELED = "Canceled" + class ComputeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of compute - """ + """The type of compute""" AKS = "AKS" KUBERNETES = "Kubernetes" @@ -284,9 +293,9 @@ class ComputeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): DATA_LAKE_ANALYTICS = "DataLakeAnalytics" SYNAPSE_SPARK = "SynapseSpark" + class ConnectionAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Authentication type of the connection target - """ + """Authentication type of the connection target""" PAT = "PAT" MANAGED_IDENTITY = "ManagedIdentity" @@ -296,23 +305,24 @@ class ConnectionAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): SERVICE_PRINCIPAL = "ServicePrincipal" ACCESS_KEY = "AccessKey" + class ContainerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): STORAGE_INITIALIZER = "StorageInitializer" INFERENCE_SERVER = "InferenceServer" + class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of identity that created the resource. - """ + """The type of identity that created the resource.""" USER = "User" APPLICATION = "Application" MANAGED_IDENTITY = "ManagedIdentity" KEY = "Key" + class CredentialsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the datastore credentials type. - """ + """Enum to determine the datastore credentials type.""" ACCOUNT_KEY = "AccountKey" CERTIFICATE = "Certificate" @@ -322,9 +332,9 @@ class CredentialsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): KERBEROS_KEYTAB = "KerberosKeytab" KERBEROS_PASSWORD = "KerberosPassword" + class DatastoreType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the datastore contents type. - """ + """Enum to determine the datastore contents type.""" AZURE_BLOB = "AzureBlob" AZURE_DATA_LAKE_GEN1 = "AzureDataLakeGen1" @@ -332,17 +342,19 @@ class DatastoreType(str, Enum, metaclass=CaseInsensitiveEnumMeta): AZURE_FILE = "AzureFile" HDFS = "Hdfs" + class DataType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the type of data. - """ + """Enum to determine the type of data.""" URI_FILE = "uri_file" URI_FOLDER = "uri_folder" MLTABLE = "mltable" -class DeploymentProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Possible values for DeploymentProvisioningState. - """ + +class DeploymentProvisioningState( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """Possible values for DeploymentProvisioningState.""" CREATING = "Creating" DELETING = "Deleting" @@ -352,29 +364,33 @@ class DeploymentProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): FAILED = "Failed" CANCELED = "Canceled" + class DiagnoseResultLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Level of workspace setup error - """ + """Level of workspace setup error""" WARNING = "Warning" ERROR = "Error" INFORMATION = "Information" + class DistributionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the job distribution type. - """ + """Enum to determine the job distribution type.""" PY_TORCH = "PyTorch" TENSOR_FLOW = "TensorFlow" MPI = "Mpi" + class EarlyTerminationPolicyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): BANDIT = "Bandit" MEDIAN_STOPPING = "MedianStopping" TRUNCATION_SELECTION = "TruncationSelection" -class EgressPublicNetworkAccessType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + +class EgressPublicNetworkAccessType( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): """Enum to determine whether PublicNetworkAccess is Enabled or Disabled for egress of a deployment. """ @@ -382,32 +398,32 @@ class EgressPublicNetworkAccessType(str, Enum, metaclass=CaseInsensitiveEnumMeta ENABLED = "Enabled" DISABLED = "Disabled" + class EncryptionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates whether or not the encryption is enabled for the workspace. - """ + """Indicates whether or not the encryption is enabled for the workspace.""" ENABLED = "Enabled" DISABLED = "Disabled" + class EndpointAuthMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine endpoint authentication mode. - """ + """Enum to determine endpoint authentication mode.""" AML_TOKEN = "AMLToken" KEY = "Key" AAD_TOKEN = "AADToken" + class EndpointComputeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine endpoint compute type. - """ + """Enum to determine endpoint compute type.""" MANAGED = "Managed" KUBERNETES = "Kubernetes" AZURE_ML_COMPUTE = "AzureMLCompute" + class EndpointProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """State of endpoint provisioning. - """ + """State of endpoint provisioning.""" CREATING = "Creating" DELETING = "Deleting" @@ -416,39 +432,39 @@ class EndpointProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): UPDATING = "Updating" CANCELED = "Canceled" + class EnvironmentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Environment type is either user created or curated by Azure ML service - """ + """Environment type is either user created or curated by Azure ML service""" CURATED = "Curated" USER_CREATED = "UserCreated" + class EnvironmentVariableType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the Environment Variable. Possible values are: local - For local variable - """ + """Type of the Environment Variable. Possible values are: local - For local variable""" LOCAL = "local" + class ExportFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The format of exported labels. - """ + """The format of exported labels.""" DATASET = "Dataset" COCO = "Coco" CSV = "CSV" + class FeatureLags(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Flag for generating lags for the numeric features. - """ + """Flag for generating lags for the numeric features.""" #: No feature lags generated. NONE = "None" #: System auto-generates feature lags. AUTO = "Auto" + class FeaturizationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Featurization mode - determines data featurization mode. - """ + """Featurization mode - determines data featurization mode.""" #: Auto mode, system performs featurization without any custom featurization inputs. AUTO = "Auto" @@ -457,18 +473,18 @@ class FeaturizationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Featurization off. 'Forecasting' task cannot use this value. OFF = "Off" + class ForecastHorizonMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine forecast horizon selection mode. - """ + """Enum to determine forecast horizon selection mode.""" #: Forecast horizon to be determined automatically. AUTO = "Auto" #: Use the custom forecast horizon. CUSTOM = "Custom" + class ForecastingModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum for all forecasting models supported by AutoML. - """ + """Enum for all forecasting models supported by AutoML.""" #: Auto-Autoregressive Integrated Moving Average (ARIMA) model uses time-series data and #: statistical analysis to interpret the data and make future predictions. @@ -545,9 +561,9 @@ class ForecastingModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: using ensemble of base learners. XG_BOOST_REGRESSOR = "XGBoostRegressor" + class ForecastingPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for Forecasting task. - """ + """Primary metrics for Forecasting task.""" #: The Spearman's rank coefficient of correlation is a non-parametric measure of rank correlation. SPEARMAN_CORRELATION = "SpearmanCorrelation" @@ -561,29 +577,30 @@ class ForecastingPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Error (MAE) of (time) series with different scales. NORMALIZED_MEAN_ABSOLUTE_ERROR = "NormalizedMeanAbsoluteError" + class Goal(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Defines supported metric goals for hyperparameter tuning - """ + """Defines supported metric goals for hyperparameter tuning""" MINIMIZE = "Minimize" MAXIMIZE = "Maximize" + class IdentityConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine identity framework. - """ + """Enum to determine identity framework.""" MANAGED = "Managed" AML_TOKEN = "AMLToken" USER_IDENTITY = "UserIdentity" + class ImageAnnotationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Annotation type of image data. - """ + """Annotation type of image data.""" CLASSIFICATION = "Classification" BOUNDING_BOX = "BoundingBox" INSTANCE_SEGMENTATION = "InstanceSegmentation" + class ImageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of the image. Possible values are: docker - For docker images. azureml - For AzureML images @@ -592,9 +609,9 @@ class ImageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): DOCKER = "docker" AZUREML = "azureml" + class InputDeliveryMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the input data delivery mode. - """ + """Enum to determine the input data delivery mode.""" READ_ONLY_MOUNT = "ReadOnlyMount" READ_WRITE_MOUNT = "ReadWriteMount" @@ -603,17 +620,19 @@ class InputDeliveryMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): EVAL_MOUNT = "EvalMount" EVAL_DOWNLOAD = "EvalDownload" -class InstanceSegmentationPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for InstanceSegmentation tasks. - """ + +class InstanceSegmentationPrimaryMetrics( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """Primary metrics for InstanceSegmentation tasks.""" #: Mean Average Precision (MAP) is the average of AP (Average Precision). #: AP is calculated for each class and averaged to get the MAP. MEAN_AVERAGE_PRECISION = "MeanAveragePrecision" + class JobInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the Job Input Type. - """ + """Enum to determine the Job Input Type.""" LITERAL = "literal" URI_FILE = "uri_file" @@ -623,14 +642,15 @@ class JobInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): MLFLOW_MODEL = "mlflow_model" TRITON_MODEL = "triton_model" + class JobLimitsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): COMMAND = "Command" SWEEP = "Sweep" + class JobOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the Job Output Type. - """ + """Enum to determine the Job Output Type.""" URI_FILE = "uri_file" URI_FOLDER = "uri_folder" @@ -639,18 +659,18 @@ class JobOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): MLFLOW_MODEL = "mlflow_model" TRITON_MODEL = "triton_model" + class JobProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the job provisioning state. - """ + """Enum to determine the job provisioning state.""" SUCCEEDED = "Succeeded" FAILED = "Failed" CANCELED = "Canceled" IN_PROGRESS = "InProgress" + class JobStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The status of a job. - """ + """The status of a job.""" #: Run hasn't started yet. NOT_STARTED = "NotStarted" @@ -688,9 +708,9 @@ class JobStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: The job is in a scheduled state. Job is not in any active state. SCHEDULED = "Scheduled" + class JobType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the type of job. - """ + """Enum to determine the type of job.""" AUTO_ML = "AutoML" COMMAND = "Command" @@ -699,14 +719,15 @@ class JobType(str, Enum, metaclass=CaseInsensitiveEnumMeta): PIPELINE = "Pipeline" SPARK = "Spark" + class KeyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): PRIMARY = "Primary" SECONDARY = "Secondary" + class LearningRateScheduler(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Learning rate scheduler enum. - """ + """Learning rate scheduler enum.""" #: No learning rate scheduler selected. NONE = "None" @@ -715,22 +736,23 @@ class LearningRateScheduler(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Step learning rate scheduler. STEP = "Step" + class ListViewType(str, Enum, metaclass=CaseInsensitiveEnumMeta): ACTIVE_ONLY = "ActiveOnly" ARCHIVED_ONLY = "ArchivedOnly" ALL = "All" + class LoadBalancerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Load Balancer Type - """ + """Load Balancer Type""" PUBLIC_IP = "PublicIp" INTERNAL_LOAD_BALANCER = "InternalLoadBalancer" + class LogVerbosity(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum for setting log verbosity. - """ + """Enum for setting log verbosity.""" #: No logs emitted. NOT_SET = "NotSet" @@ -745,6 +767,7 @@ class LogVerbosity(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Only critical statements logged. CRITICAL = "Critical" + class ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). @@ -755,35 +778,36 @@ class ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): USER_ASSIGNED = "UserAssigned" SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" + class MediaType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Media type of data asset. - """ + """Media type of data asset.""" IMAGE = "Image" TEXT = "Text" + class MLAssistConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): ENABLED = "Enabled" DISABLED = "Disabled" + class MlflowAutologger(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates whether mlflow autologger is enabled for notebooks. - """ + """Indicates whether mlflow autologger is enabled for notebooks.""" ENABLED = "Enabled" DISABLED = "Disabled" + class MLFlowAutologgerState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the state of mlflow autologger. - """ + """Enum to determine the state of mlflow autologger.""" ENABLED = "Enabled" DISABLED = "Disabled" + class ModelSize(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Image model size. - """ + """Image model size.""" #: No value selected. NONE = "None" @@ -796,16 +820,16 @@ class ModelSize(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Extra large size. EXTRA_LARGE = "ExtraLarge" + class MountAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Mount Action. - """ + """Mount Action.""" MOUNT = "Mount" UNMOUNT = "Unmount" + class MountState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Mount state. - """ + """Mount state.""" MOUNT_REQUESTED = "MountRequested" MOUNTED = "Mounted" @@ -814,9 +838,9 @@ class MountState(str, Enum, metaclass=CaseInsensitiveEnumMeta): UNMOUNT_FAILED = "UnmountFailed" UNMOUNTED = "Unmounted" + class NCrossValidationsMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Determines how N-Cross validations value is determined. - """ + """Determines how N-Cross validations value is determined.""" #: Determine N-Cross validations value automatically. Supported only for 'Forecasting' AutoML #: task. @@ -824,16 +848,16 @@ class NCrossValidationsMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Use custom N-Cross validations value. CUSTOM = "Custom" + class Network(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """network of this container. - """ + """network of this container.""" BRIDGE = "Bridge" HOST = "Host" + class NlpLearningRateScheduler(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum of learning rate schedulers that aligns with those supported by HF - """ + """Enum of learning rate schedulers that aligns with those supported by HF""" #: No learning rate schedule. NONE = "None" @@ -850,6 +874,7 @@ class NlpLearningRateScheduler(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Linear warmup followed by constant value. CONSTANT_WITH_WARMUP = "ConstantWithWarmup" + class NodeState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """State of the compute node. Values are idle, running, preparing, unusable, leaving and preempted. @@ -862,31 +887,33 @@ class NodeState(str, Enum, metaclass=CaseInsensitiveEnumMeta): LEAVING = "leaving" PREEMPTED = "preempted" + class NodesValueType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The enumerated types for the nodes value - """ + """The enumerated types for the nodes value""" ALL = "All" CUSTOM = "Custom" -class ObjectDetectionPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for Image ObjectDetection task. - """ + +class ObjectDetectionPrimaryMetrics( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """Primary metrics for Image ObjectDetection task.""" #: Mean Average Precision (MAP) is the average of AP (Average Precision). #: AP is calculated for each class and averaged to get the MAP. MEAN_AVERAGE_PRECISION = "MeanAveragePrecision" + class OperatingSystemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of operating system. - """ + """The type of operating system.""" LINUX = "Linux" WINDOWS = "Windows" + class OperationName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Name of the last operation. - """ + """Name of the last operation.""" CREATE = "Create" START = "Start" @@ -895,9 +922,9 @@ class OperationName(str, Enum, metaclass=CaseInsensitiveEnumMeta): REIMAGE = "Reimage" DELETE = "Delete" + class OperationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Operation status. - """ + """Operation status.""" IN_PROGRESS = "InProgress" SUCCEEDED = "Succeeded" @@ -908,14 +935,15 @@ class OperationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): REIMAGE_FAILED = "ReimageFailed" DELETE_FAILED = "DeleteFailed" + class OperationTrigger(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Trigger of operation. - """ + """Trigger of operation.""" USER = "User" SCHEDULE = "Schedule" IDLE_SHUTDOWN = "IdleShutdown" + class OrderString(str, Enum, metaclass=CaseInsensitiveEnumMeta): CREATED_AT_DESC = "CreatedAtDesc" @@ -923,33 +951,37 @@ class OrderString(str, Enum, metaclass=CaseInsensitiveEnumMeta): UPDATED_AT_DESC = "UpdatedAtDesc" UPDATED_AT_ASC = "UpdatedAtAsc" + class OsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Compute OS Type - """ + """Compute OS Type""" LINUX = "Linux" WINDOWS = "Windows" + class OutputDeliveryMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Output data delivery mode enums. - """ + """Output data delivery mode enums.""" READ_WRITE_MOUNT = "ReadWriteMount" UPLOAD = "Upload" DIRECT = "Direct" -class PrivateEndpointConnectionProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The current provisioning state. - """ + +class PrivateEndpointConnectionProvisioningState( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """The current provisioning state.""" SUCCEEDED = "Succeeded" CREATING = "Creating" DELETING = "Deleting" FAILED = "Failed" -class PrivateEndpointServiceConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The private endpoint connection status. - """ + +class PrivateEndpointServiceConnectionStatus( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """The private endpoint connection status.""" PENDING = "Pending" APPROVED = "Approved" @@ -957,52 +989,54 @@ class PrivateEndpointServiceConnectionStatus(str, Enum, metaclass=CaseInsensitiv DISCONNECTED = "Disconnected" TIMEOUT = "Timeout" + class Protocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Protocol over which communication will happen over this endpoint - """ + """Protocol over which communication will happen over this endpoint""" TCP = "tcp" UDP = "udp" HTTP = "http" + class ProvisioningStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The current deployment state of schedule. - """ + """The current deployment state of schedule.""" COMPLETED = "Completed" PROVISIONING = "Provisioning" FAILED = "Failed" + class PublicNetworkAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Whether requests from Public Network are allowed. - """ + """Whether requests from Public Network are allowed.""" ENABLED = "Enabled" DISABLED = "Disabled" + class PublicNetworkAccessType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine whether PublicNetworkAccess is Enabled or Disabled. - """ + """Enum to determine whether PublicNetworkAccess is Enabled or Disabled.""" ENABLED = "Enabled" DISABLED = "Disabled" + class QuotaUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """An enum describing the unit of quota measurement. - """ + """An enum describing the unit of quota measurement.""" COUNT = "Count" -class RandomSamplingAlgorithmRule(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The specific type of random algorithm - """ + +class RandomSamplingAlgorithmRule( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """The specific type of random algorithm""" RANDOM = "Random" SOBOL = "Sobol" + class RecurrenceFrequency(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to describe the frequency of a recurrence schedule - """ + """Enum to describe the frequency of a recurrence schedule""" #: Minute frequency. MINUTE = "Minute" @@ -1015,17 +1049,17 @@ class RecurrenceFrequency(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Month frequency. MONTH = "Month" + class ReferenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine which reference method to use for an asset. - """ + """Enum to determine which reference method to use for an asset.""" ID = "Id" DATA_PATH = "DataPath" OUTPUT_PATH = "OutputPath" + class RegressionModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum for all Regression models supported by AutoML. - """ + """Enum for all Regression models supported by AutoML.""" #: Elastic net is a popular type of regularized linear regression that combines two popular #: penalties, specifically the L1 and L2 penalty functions. @@ -1067,9 +1101,9 @@ class RegressionModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: using ensemble of base learners. XG_BOOST_REGRESSOR = "XGBoostRegressor" + class RegressionPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for Regression task. - """ + """Primary metrics for Regression task.""" #: The Spearman's rank coefficient of correlation is a nonparametric measure of rank correlation. SPEARMAN_CORRELATION = "SpearmanCorrelation" @@ -1083,7 +1117,10 @@ class RegressionPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Error (MAE) of (time) series with different scales. NORMALIZED_MEAN_ABSOLUTE_ERROR = "NormalizedMeanAbsoluteError" -class RemoteLoginPortPublicAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): + +class RemoteLoginPortPublicAccess( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): """State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - Indicates that the public ssh port is closed @@ -1096,36 +1133,41 @@ class RemoteLoginPortPublicAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): DISABLED = "Disabled" NOT_SPECIFIED = "NotSpecified" + class SamplingAlgorithmType(str, Enum, metaclass=CaseInsensitiveEnumMeta): GRID = "Grid" RANDOM = "Random" BAYESIAN = "Bayesian" + class ScaleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): DEFAULT = "Default" TARGET_UTILIZATION = "TargetUtilization" + class ScheduleActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): CREATE_JOB = "CreateJob" INVOKE_BATCH_ENDPOINT = "InvokeBatchEndpoint" + class ScheduleListViewType(str, Enum, metaclass=CaseInsensitiveEnumMeta): ENABLED_ONLY = "EnabledOnly" DISABLED_ONLY = "DisabledOnly" ALL = "All" + class ScheduleProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The current deployment state of schedule. - """ + """The current deployment state of schedule.""" COMPLETED = "Completed" PROVISIONING = "Provisioning" FAILED = "Failed" + class ScheduleProvisioningStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): CREATING = "Creating" @@ -1135,25 +1177,25 @@ class ScheduleProvisioningStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): FAILED = "Failed" CANCELED = "Canceled" + class ScheduleStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Is the schedule enabled or disabled? - """ + """Is the schedule enabled or disabled?""" ENABLED = "Enabled" DISABLED = "Disabled" + class SeasonalityMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Forecasting seasonality mode. - """ + """Forecasting seasonality mode.""" #: Seasonality to be determined automatically. AUTO = "Auto" #: Use the custom seasonality value. CUSTOM = "Custom" + class SecretsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the datastore secrets type. - """ + """Enum to determine the datastore secrets type.""" ACCOUNT_KEY = "AccountKey" CERTIFICATE = "Certificate" @@ -1162,7 +1204,10 @@ class SecretsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): KERBEROS_PASSWORD = "KerberosPassword" KERBEROS_KEYTAB = "KerberosKeytab" -class ServiceDataAccessAuthIdentity(str, Enum, metaclass=CaseInsensitiveEnumMeta): + +class ServiceDataAccessAuthIdentity( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): #: Do not use any identity for service data access. NONE = "None" @@ -1171,9 +1216,11 @@ class ServiceDataAccessAuthIdentity(str, Enum, metaclass=CaseInsensitiveEnumMeta #: Use the user assigned managed identity of the Workspace to authenticate service data access. WORKSPACE_USER_ASSIGNED_IDENTITY = "WorkspaceUserAssignedIdentity" -class ShortSeriesHandlingConfiguration(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The parameter defining how if AutoML should handle short time series. - """ + +class ShortSeriesHandlingConfiguration( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """The parameter defining how if AutoML should handle short time series.""" #: Represents no/null value. NONE = "None" @@ -1185,9 +1232,9 @@ class ShortSeriesHandlingConfiguration(str, Enum, metaclass=CaseInsensitiveEnumM #: All the short series will be dropped. DROP = "Drop" + class SkuScaleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Node scaling setting for the compute sku. - """ + """Node scaling setting for the compute sku.""" #: Automatically scales node count. AUTOMATIC = "Automatic" @@ -1196,6 +1243,7 @@ class SkuScaleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Fixed set of nodes. NONE = "None" + class SkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): """This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT. @@ -1206,19 +1254,21 @@ class SkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): STANDARD = "Standard" PREMIUM = "Premium" + class SourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Data source type. - """ + """Data source type.""" DATASET = "Dataset" DATASTORE = "Datastore" URI = "URI" + class SparkJobEntryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): SPARK_JOB_PYTHON_ENTRY = "SparkJobPythonEntry" SPARK_JOB_SCALA_ENTRY = "SparkJobScalaEntry" + class SshPublicAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): """State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the public ssh port is open and @@ -1228,14 +1278,15 @@ class SshPublicAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): ENABLED = "Enabled" DISABLED = "Disabled" + class SslConfigStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enable or disable ssl for scoring - """ + """Enable or disable ssl for scoring""" DISABLED = "Disabled" ENABLED = "Enabled" AUTO = "Auto" + class StackMetaLearnerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The meta-learner is a model trained on the output of the individual heterogeneous models. Default meta-learners are LogisticRegression for classification tasks (or LogisticRegressionCV @@ -1258,28 +1309,31 @@ class StackMetaLearnerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): LIGHT_GBM_REGRESSOR = "LightGBMRegressor" LINEAR_REGRESSION = "LinearRegression" + class Status(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Status of update workspace quota. - """ + """Status of update workspace quota.""" UNDEFINED = "Undefined" SUCCESS = "Success" FAILURE = "Failure" INVALID_QUOTA_BELOW_CLUSTER_MINIMUM = "InvalidQuotaBelowClusterMinimum" - INVALID_QUOTA_EXCEEDS_SUBSCRIPTION_LIMIT = "InvalidQuotaExceedsSubscriptionLimit" + INVALID_QUOTA_EXCEEDS_SUBSCRIPTION_LIMIT = ( + "InvalidQuotaExceedsSubscriptionLimit" + ) INVALID_VM_FAMILY_NAME = "InvalidVMFamilyName" OPERATION_NOT_SUPPORTED_FOR_SKU = "OperationNotSupportedForSku" OPERATION_NOT_ENABLED_FOR_REGION = "OperationNotEnabledForRegion" + class StatusMessageLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): ERROR = "Error" INFORMATION = "Information" WARNING = "Warning" + class StochasticOptimizer(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Stochastic optimizer for image models. - """ + """Stochastic optimizer for image models.""" #: No optimizer selected. NONE = "None" @@ -1291,16 +1345,16 @@ class StochasticOptimizer(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: AdamW is a variant of the optimizer Adam that has an improved implementation of weight decay. ADAMW = "Adamw" + class StorageAccountType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """type of this storage account. - """ + """type of this storage account.""" STANDARD_LRS = "Standard_LRS" PREMIUM_LRS = "Premium_LRS" + class TargetAggregationFunction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Target aggregate function. - """ + """Target aggregate function.""" #: Represent no value set. NONE = "None" @@ -1309,27 +1363,29 @@ class TargetAggregationFunction(str, Enum, metaclass=CaseInsensitiveEnumMeta): MIN = "Min" MEAN = "Mean" + class TargetLagsMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Target lags selection modes. - """ + """Target lags selection modes.""" #: Target lags to be determined automatically. AUTO = "Auto" #: Use the custom target lags. CUSTOM = "Custom" -class TargetRollingWindowSizeMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Target rolling windows size mode. - """ + +class TargetRollingWindowSizeMode( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """Target rolling windows size mode.""" #: Determine rolling windows size automatically. AUTO = "Auto" #: Use the specified rolling window size. CUSTOM = "Custom" + class TaskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """AutoMLJob Task type. - """ + """AutoMLJob Task type.""" #: Classification in machine learning and statistics is a supervised learning approach in which #: the computer program learns from the data given to it and make new observations or @@ -1370,47 +1426,49 @@ class TaskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: occurrences of entities such as people, locations, organizations, and more. TEXT_NER = "TextNER" + class TextAnnotationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Annotation type of text data. - """ + """Annotation type of text data.""" CLASSIFICATION = "Classification" NAMED_ENTITY_RECOGNITION = "NamedEntityRecognition" + class TriggerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): RECURRENCE = "Recurrence" CRON = "Cron" + class UnderlyingResourceAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): DELETE = "Delete" DETACH = "Detach" + class UnitOfMeasure(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The unit of time measurement for the specified VM price. Example: OneHour - """ + """The unit of time measurement for the specified VM price. Example: OneHour""" ONE_HOUR = "OneHour" + class UsageUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """An enum describing the unit of usage measurement. - """ + """An enum describing the unit of usage measurement.""" COUNT = "Count" + class UseStl(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Configure STL Decomposition of the time-series target column. - """ + """Configure STL Decomposition of the time-series target column.""" #: No stl decomposition. NONE = "None" SEASON = "Season" SEASON_TREND = "SeasonTrend" + class ValidationMetricType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Metric computation method to use for validation metrics in image tasks. - """ + """Metric computation method to use for validation metrics in image tasks.""" #: No metric. NONE = "None" @@ -1421,46 +1479,46 @@ class ValidationMetricType(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: CocoVoc metric. COCO_VOC = "CocoVoc" + class ValueFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """format for the workspace connection value - """ + """format for the workspace connection value""" JSON = "JSON" + class VMPriceOSType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Operating system type used by the VM. - """ + """Operating system type used by the VM.""" LINUX = "Linux" WINDOWS = "Windows" + class VmPriority(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Virtual Machine priority - """ + """Virtual Machine priority""" DEDICATED = "Dedicated" LOW_PRIORITY = "LowPriority" + class VMTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of the VM. - """ + """The type of the VM.""" STANDARD = "Standard" LOW_PRIORITY = "LowPriority" SPOT = "Spot" + class VolumeDefinitionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe - """ + """Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe""" BIND = "bind" VOLUME = "volume" TMPFS = "tmpfs" NPIPE = "npipe" + class WeekDay(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum of weekday - """ + """Enum of weekday""" #: Monday weekday. MONDAY = "Monday" @@ -1477,6 +1535,7 @@ class WeekDay(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Sunday weekday. SUNDAY = "Sunday" + class WorkspaceProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The current deployment state of workspace resource. The provisioningState is to indicate states for resource provisioning. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/_models.py index 44231122f8a4..1ac0af96612a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/_models.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/_models.py @@ -33,25 +33,30 @@ class WorkspaceConnectionPropertiesV2(msrest.serialization.Model): """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, } _subtype_map = { - 'auth_type': {'AccessKey': 'AccessKeyAuthTypeWorkspaceConnectionProperties', 'ManagedIdentity': 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', 'None': 'NoneAuthTypeWorkspaceConnectionProperties', 'PAT': 'PATAuthTypeWorkspaceConnectionProperties', 'SAS': 'SASAuthTypeWorkspaceConnectionProperties', 'ServicePrincipal': 'ServicePrincipalAuthTypeWorkspaceConnectionProperties', 'UsernamePassword': 'UsernamePasswordAuthTypeWorkspaceConnectionProperties'} + "auth_type": { + "AccessKey": "AccessKeyAuthTypeWorkspaceConnectionProperties", + "ManagedIdentity": "ManagedIdentityAuthTypeWorkspaceConnectionProperties", + "None": "NoneAuthTypeWorkspaceConnectionProperties", + "PAT": "PATAuthTypeWorkspaceConnectionProperties", + "SAS": "SASAuthTypeWorkspaceConnectionProperties", + "ServicePrincipal": "ServicePrincipalAuthTypeWorkspaceConnectionProperties", + "UsernamePassword": "UsernamePasswordAuthTypeWorkspaceConnectionProperties", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: Category of the connection. :paramtype category: str @@ -65,13 +70,15 @@ def __init__( """ super(WorkspaceConnectionPropertiesV2, self).__init__(**kwargs) self.auth_type = None # type: Optional[str] - self.category = kwargs.get('category', None) - self.target = kwargs.get('target', None) - self.value = kwargs.get('value', None) - self.value_format = kwargs.get('value_format', None) + self.category = kwargs.get("category", None) + self.target = kwargs.get("target", None) + self.value = kwargs.get("value", None) + self.value_format = kwargs.get("value_format", None) -class AccessKeyAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class AccessKeyAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """AccessKeyAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -93,22 +100,22 @@ class AccessKeyAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionProperti """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionAccessKey'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionAccessKey", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: Category of the connection. :paramtype category: str @@ -122,9 +129,11 @@ def __init__( :keyword credentials: :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccessKey """ - super(AccessKeyAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'AccessKey' # type: str - self.credentials = kwargs.get('credentials', None) + super(AccessKeyAuthTypeWorkspaceConnectionProperties, self).__init__( + **kwargs + ) + self.auth_type = "AccessKey" # type: str + self.credentials = kwargs.get("credentials", None) class DatastoreCredentials(msrest.serialization.Model): @@ -142,23 +151,27 @@ class DatastoreCredentials(msrest.serialization.Model): """ _validation = { - 'credentials_type': {'required': True}, + "credentials_type": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, } _subtype_map = { - 'credentials_type': {'AccountKey': 'AccountKeyDatastoreCredentials', 'Certificate': 'CertificateDatastoreCredentials', 'KerberosKeytab': 'KerberosKeytabCredentials', 'KerberosPassword': 'KerberosPasswordCredentials', 'None': 'NoneDatastoreCredentials', 'Sas': 'SasDatastoreCredentials', 'ServicePrincipal': 'ServicePrincipalDatastoreCredentials'} - } - - def __init__( - self, - **kwargs - ): - """ - """ + "credentials_type": { + "AccountKey": "AccountKeyDatastoreCredentials", + "Certificate": "CertificateDatastoreCredentials", + "KerberosKeytab": "KerberosKeytabCredentials", + "KerberosPassword": "KerberosPasswordCredentials", + "None": "NoneDatastoreCredentials", + "Sas": "SasDatastoreCredentials", + "ServicePrincipal": "ServicePrincipalDatastoreCredentials", + } + } + + def __init__(self, **kwargs): + """ """ super(DatastoreCredentials, self).__init__(**kwargs) self.credentials_type = None # type: Optional[str] @@ -177,26 +190,23 @@ class AccountKeyDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, + "credentials_type": {"required": True}, + "secrets": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'AccountKeyDatastoreSecrets'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "secrets": {"key": "secrets", "type": "AccountKeyDatastoreSecrets"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword secrets: Required. [Required] Storage account secrets. :paramtype secrets: ~azure.mgmt.machinelearningservices.models.AccountKeyDatastoreSecrets """ super(AccountKeyDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'AccountKey' # type: str - self.secrets = kwargs['secrets'] + self.credentials_type = "AccountKey" # type: str + self.secrets = kwargs["secrets"] class DatastoreSecrets(msrest.serialization.Model): @@ -214,23 +224,26 @@ class DatastoreSecrets(msrest.serialization.Model): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, } _subtype_map = { - 'secrets_type': {'AccountKey': 'AccountKeyDatastoreSecrets', 'Certificate': 'CertificateDatastoreSecrets', 'KerberosKeytab': 'KerberosKeytabSecrets', 'KerberosPassword': 'KerberosPasswordSecrets', 'Sas': 'SasDatastoreSecrets', 'ServicePrincipal': 'ServicePrincipalDatastoreSecrets'} - } - - def __init__( - self, - **kwargs - ): - """ - """ + "secrets_type": { + "AccountKey": "AccountKeyDatastoreSecrets", + "Certificate": "CertificateDatastoreSecrets", + "KerberosKeytab": "KerberosKeytabSecrets", + "KerberosPassword": "KerberosPasswordSecrets", + "Sas": "SasDatastoreSecrets", + "ServicePrincipal": "ServicePrincipalDatastoreSecrets", + } + } + + def __init__(self, **kwargs): + """ """ super(DatastoreSecrets, self).__init__(**kwargs) self.secrets_type = None # type: Optional[str] @@ -249,25 +262,22 @@ class AccountKeyDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "key": {"key": "key", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword key: Storage account key. :paramtype key: str """ super(AccountKeyDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'AccountKey' # type: str - self.key = kwargs.get('key', None) + self.secrets_type = "AccountKey" # type: str + self.key = kwargs.get("key", None) class AcrDetails(msrest.serialization.Model): @@ -282,14 +292,17 @@ class AcrDetails(msrest.serialization.Model): """ _attribute_map = { - 'system_created_acr_account': {'key': 'systemCreatedAcrAccount', 'type': 'SystemCreatedAcrAccount'}, - 'user_created_acr_account': {'key': 'userCreatedAcrAccount', 'type': 'UserCreatedAcrAccount'}, + "system_created_acr_account": { + "key": "systemCreatedAcrAccount", + "type": "SystemCreatedAcrAccount", + }, + "user_created_acr_account": { + "key": "userCreatedAcrAccount", + "type": "UserCreatedAcrAccount", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword system_created_acr_account: :paramtype system_created_acr_account: @@ -299,8 +312,12 @@ def __init__( ~azure.mgmt.machinelearningservices.models.UserCreatedAcrAccount """ super(AcrDetails, self).__init__(**kwargs) - self.system_created_acr_account = kwargs.get('system_created_acr_account', None) - self.user_created_acr_account = kwargs.get('user_created_acr_account', None) + self.system_created_acr_account = kwargs.get( + "system_created_acr_account", None + ) + self.user_created_acr_account = kwargs.get( + "user_created_acr_account", None + ) class AKSSchema(msrest.serialization.Model): @@ -311,19 +328,16 @@ class AKSSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, + "properties": {"key": "properties", "type": "AKSSchemaProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: AKS properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties """ super(AKSSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class Compute(msrest.serialization.Model): @@ -366,37 +380,48 @@ class Compute(msrest.serialization.Model): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + "disable_local_auth": {"readonly": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } _subtype_map = { - 'compute_type': {'AKS': 'AKS', 'AmlCompute': 'AmlCompute', 'ComputeInstance': 'ComputeInstance', 'DataFactory': 'DataFactory', 'DataLakeAnalytics': 'DataLakeAnalytics', 'Databricks': 'Databricks', 'HDInsight': 'HDInsight', 'Kubernetes': 'Kubernetes', 'SynapseSpark': 'SynapseSpark', 'VirtualMachine': 'VirtualMachine'} - } - - def __init__( - self, - **kwargs - ): + "compute_type": { + "AKS": "AKS", + "AmlCompute": "AmlCompute", + "ComputeInstance": "ComputeInstance", + "DataFactory": "DataFactory", + "DataLakeAnalytics": "DataLakeAnalytics", + "Databricks": "Databricks", + "HDInsight": "HDInsight", + "Kubernetes": "Kubernetes", + "SynapseSpark": "SynapseSpark", + "VirtualMachine": "VirtualMachine", + } + } + + def __init__(self, **kwargs): """ :keyword description: The description of the Machine Learning compute. :paramtype description: str @@ -407,10 +432,10 @@ def __init__( self.compute_type = None # type: Optional[str] self.compute_location = None self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None self.disable_local_auth = None @@ -455,34 +480,34 @@ class AKS(Compute, AKSSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + "disable_local_auth": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "AKSSchemaProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: AKS properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties @@ -492,14 +517,14 @@ def __init__( :paramtype resource_id: str """ super(AKS, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'AKS' # type: str + self.properties = kwargs.get("properties", None) + self.compute_type = "AKS" # type: str self.compute_location = None self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None self.disable_local_auth = None @@ -519,15 +544,15 @@ class AksComputeSecretsProperties(msrest.serialization.Model): """ _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, + "user_kube_config": {"key": "userKubeConfig", "type": "str"}, + "admin_kube_config": {"key": "adminKubeConfig", "type": "str"}, + "image_pull_secret_name": { + "key": "imagePullSecretName", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword user_kube_config: Content of kubeconfig file that can be used to connect to the Kubernetes cluster. @@ -539,9 +564,11 @@ def __init__( :paramtype image_pull_secret_name: str """ super(AksComputeSecretsProperties, self).__init__(**kwargs) - self.user_kube_config = kwargs.get('user_kube_config', None) - self.admin_kube_config = kwargs.get('admin_kube_config', None) - self.image_pull_secret_name = kwargs.get('image_pull_secret_name', None) + self.user_kube_config = kwargs.get("user_kube_config", None) + self.admin_kube_config = kwargs.get("admin_kube_config", None) + self.image_pull_secret_name = kwargs.get( + "image_pull_secret_name", None + ) class ComputeSecrets(msrest.serialization.Model): @@ -559,23 +586,23 @@ class ComputeSecrets(msrest.serialization.Model): """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "compute_type": {"key": "computeType", "type": "str"}, } _subtype_map = { - 'compute_type': {'AKS': 'AksComputeSecrets', 'Databricks': 'DatabricksComputeSecrets', 'VirtualMachine': 'VirtualMachineSecrets'} + "compute_type": { + "AKS": "AksComputeSecrets", + "Databricks": "DatabricksComputeSecrets", + "VirtualMachine": "VirtualMachineSecrets", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ComputeSecrets, self).__init__(**kwargs) self.compute_type = None # type: Optional[str] @@ -600,20 +627,20 @@ class AksComputeSecrets(ComputeSecrets, AksComputeSecretsProperties): """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "user_kube_config": {"key": "userKubeConfig", "type": "str"}, + "admin_kube_config": {"key": "adminKubeConfig", "type": "str"}, + "image_pull_secret_name": { + "key": "imagePullSecretName", + "type": "str", + }, + "compute_type": {"key": "computeType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword user_kube_config: Content of kubeconfig file that can be used to connect to the Kubernetes cluster. @@ -625,10 +652,12 @@ def __init__( :paramtype image_pull_secret_name: str """ super(AksComputeSecrets, self).__init__(**kwargs) - self.user_kube_config = kwargs.get('user_kube_config', None) - self.admin_kube_config = kwargs.get('admin_kube_config', None) - self.image_pull_secret_name = kwargs.get('image_pull_secret_name', None) - self.compute_type = 'AKS' # type: str + self.user_kube_config = kwargs.get("user_kube_config", None) + self.admin_kube_config = kwargs.get("admin_kube_config", None) + self.image_pull_secret_name = kwargs.get( + "image_pull_secret_name", None + ) + self.compute_type = "AKS" # type: str class AksNetworkingConfiguration(msrest.serialization.Model): @@ -648,22 +677,25 @@ class AksNetworkingConfiguration(msrest.serialization.Model): """ _validation = { - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, + "service_cidr": { + "pattern": r"^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$" + }, + "dns_service_ip": { + "pattern": r"^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" + }, + "docker_bridge_cidr": { + "pattern": r"^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$" + }, } _attribute_map = { - 'subnet_id': {'key': 'subnetId', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, + "subnet_id": {"key": "subnetId", "type": "str"}, + "service_cidr": {"key": "serviceCidr", "type": "str"}, + "dns_service_ip": {"key": "dnsServiceIP", "type": "str"}, + "docker_bridge_cidr": {"key": "dockerBridgeCidr", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword subnet_id: Virtual network subnet resource ID the compute nodes belong to. :paramtype subnet_id: str @@ -678,10 +710,10 @@ def __init__( :paramtype docker_bridge_cidr: str """ super(AksNetworkingConfiguration, self).__init__(**kwargs) - self.subnet_id = kwargs.get('subnet_id', None) - self.service_cidr = kwargs.get('service_cidr', None) - self.dns_service_ip = kwargs.get('dns_service_ip', None) - self.docker_bridge_cidr = kwargs.get('docker_bridge_cidr', None) + self.subnet_id = kwargs.get("subnet_id", None) + self.service_cidr = kwargs.get("service_cidr", None) + self.dns_service_ip = kwargs.get("dns_service_ip", None) + self.docker_bridge_cidr = kwargs.get("docker_bridge_cidr", None) class AKSSchemaProperties(msrest.serialization.Model): @@ -713,26 +745,32 @@ class AKSSchemaProperties(msrest.serialization.Model): """ _validation = { - 'system_services': {'readonly': True}, - 'agent_count': {'minimum': 0}, + "system_services": {"readonly": True}, + "agent_count": {"minimum": 0}, } _attribute_map = { - 'cluster_fqdn': {'key': 'clusterFqdn', 'type': 'str'}, - 'system_services': {'key': 'systemServices', 'type': '[SystemService]'}, - 'agent_count': {'key': 'agentCount', 'type': 'int'}, - 'agent_vm_size': {'key': 'agentVmSize', 'type': 'str'}, - 'cluster_purpose': {'key': 'clusterPurpose', 'type': 'str'}, - 'ssl_configuration': {'key': 'sslConfiguration', 'type': 'SslConfiguration'}, - 'aks_networking_configuration': {'key': 'aksNetworkingConfiguration', 'type': 'AksNetworkingConfiguration'}, - 'load_balancer_type': {'key': 'loadBalancerType', 'type': 'str'}, - 'load_balancer_subnet': {'key': 'loadBalancerSubnet', 'type': 'str'}, + "cluster_fqdn": {"key": "clusterFqdn", "type": "str"}, + "system_services": { + "key": "systemServices", + "type": "[SystemService]", + }, + "agent_count": {"key": "agentCount", "type": "int"}, + "agent_vm_size": {"key": "agentVmSize", "type": "str"}, + "cluster_purpose": {"key": "clusterPurpose", "type": "str"}, + "ssl_configuration": { + "key": "sslConfiguration", + "type": "SslConfiguration", + }, + "aks_networking_configuration": { + "key": "aksNetworkingConfiguration", + "type": "AksNetworkingConfiguration", + }, + "load_balancer_type": {"key": "loadBalancerType", "type": "str"}, + "load_balancer_subnet": {"key": "loadBalancerSubnet", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword cluster_fqdn: Cluster full qualified domain name. :paramtype cluster_fqdn: str @@ -756,15 +794,17 @@ def __init__( :paramtype load_balancer_subnet: str """ super(AKSSchemaProperties, self).__init__(**kwargs) - self.cluster_fqdn = kwargs.get('cluster_fqdn', None) + self.cluster_fqdn = kwargs.get("cluster_fqdn", None) self.system_services = None - self.agent_count = kwargs.get('agent_count', None) - self.agent_vm_size = kwargs.get('agent_vm_size', None) - self.cluster_purpose = kwargs.get('cluster_purpose', "FastProd") - self.ssl_configuration = kwargs.get('ssl_configuration', None) - self.aks_networking_configuration = kwargs.get('aks_networking_configuration', None) - self.load_balancer_type = kwargs.get('load_balancer_type', "PublicIp") - self.load_balancer_subnet = kwargs.get('load_balancer_subnet', None) + self.agent_count = kwargs.get("agent_count", None) + self.agent_vm_size = kwargs.get("agent_vm_size", None) + self.cluster_purpose = kwargs.get("cluster_purpose", "FastProd") + self.ssl_configuration = kwargs.get("ssl_configuration", None) + self.aks_networking_configuration = kwargs.get( + "aks_networking_configuration", None + ) + self.load_balancer_type = kwargs.get("load_balancer_type", "PublicIp") + self.load_balancer_subnet = kwargs.get("load_balancer_subnet", None) class Nodes(msrest.serialization.Model): @@ -781,23 +821,17 @@ class Nodes(msrest.serialization.Model): """ _validation = { - 'nodes_value_type': {'required': True}, + "nodes_value_type": {"required": True}, } _attribute_map = { - 'nodes_value_type': {'key': 'nodesValueType', 'type': 'str'}, + "nodes_value_type": {"key": "nodesValueType", "type": "str"}, } - _subtype_map = { - 'nodes_value_type': {'All': 'AllNodes'} - } + _subtype_map = {"nodes_value_type": {"All": "AllNodes"}} - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Nodes, self).__init__(**kwargs) self.nodes_value_type = None # type: Optional[str] @@ -813,21 +847,17 @@ class AllNodes(Nodes): """ _validation = { - 'nodes_value_type': {'required': True}, + "nodes_value_type": {"required": True}, } _attribute_map = { - 'nodes_value_type': {'key': 'nodesValueType', 'type': 'str'}, + "nodes_value_type": {"key": "nodesValueType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AllNodes, self).__init__(**kwargs) - self.nodes_value_type = 'All' # type: str + self.nodes_value_type = "All" # type: str class AmlComputeSchema(msrest.serialization.Model): @@ -838,19 +868,16 @@ class AmlComputeSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, + "properties": {"key": "properties", "type": "AmlComputeProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of AmlCompute. :paramtype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties """ super(AmlComputeSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class AmlCompute(Compute, AmlComputeSchema): @@ -892,34 +919,34 @@ class AmlCompute(Compute, AmlComputeSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + "disable_local_auth": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "AmlComputeProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of AmlCompute. :paramtype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties @@ -929,14 +956,14 @@ def __init__( :paramtype resource_id: str """ super(AmlCompute, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'AmlCompute' # type: str + self.properties = kwargs.get("properties", None) + self.compute_type = "AmlCompute" # type: str self.compute_location = None self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None self.disable_local_auth = None @@ -964,29 +991,25 @@ class AmlComputeNodeInformation(msrest.serialization.Model): """ _validation = { - 'node_id': {'readonly': True}, - 'private_ip_address': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'port': {'readonly': True}, - 'node_state': {'readonly': True}, - 'run_id': {'readonly': True}, + "node_id": {"readonly": True}, + "private_ip_address": {"readonly": True}, + "public_ip_address": {"readonly": True}, + "port": {"readonly": True}, + "node_state": {"readonly": True}, + "run_id": {"readonly": True}, } _attribute_map = { - 'node_id': {'key': 'nodeId', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'node_state': {'key': 'nodeState', 'type': 'str'}, - 'run_id': {'key': 'runId', 'type': 'str'}, + "node_id": {"key": "nodeId", "type": "str"}, + "private_ip_address": {"key": "privateIpAddress", "type": "str"}, + "public_ip_address": {"key": "publicIpAddress", "type": "str"}, + "port": {"key": "port", "type": "int"}, + "node_state": {"key": "nodeState", "type": "str"}, + "run_id": {"key": "runId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AmlComputeNodeInformation, self).__init__(**kwargs) self.node_id = None self.private_ip_address = None @@ -1008,21 +1031,17 @@ class AmlComputeNodesInformation(msrest.serialization.Model): """ _validation = { - 'nodes': {'readonly': True}, - 'next_link': {'readonly': True}, + "nodes": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'nodes': {'key': 'nodes', 'type': '[AmlComputeNodeInformation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "nodes": {"key": "nodes", "type": "[AmlComputeNodeInformation]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AmlComputeNodesInformation, self).__init__(**kwargs) self.nodes = None self.next_link = None @@ -1093,38 +1112,50 @@ class AmlComputeProperties(msrest.serialization.Model): """ _validation = { - 'allocation_state': {'readonly': True}, - 'allocation_state_transition_time': {'readonly': True}, - 'errors': {'readonly': True}, - 'current_node_count': {'readonly': True}, - 'target_node_count': {'readonly': True}, - 'node_state_counts': {'readonly': True}, - } - - _attribute_map = { - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'vm_priority': {'key': 'vmPriority', 'type': 'str'}, - 'virtual_machine_image': {'key': 'virtualMachineImage', 'type': 'VirtualMachineImage'}, - 'isolated_network': {'key': 'isolatedNetwork', 'type': 'bool'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, - 'user_account_credentials': {'key': 'userAccountCredentials', 'type': 'UserAccountCredentials'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'remote_login_port_public_access': {'key': 'remoteLoginPortPublicAccess', 'type': 'str'}, - 'allocation_state': {'key': 'allocationState', 'type': 'str'}, - 'allocation_state_transition_time': {'key': 'allocationStateTransitionTime', 'type': 'iso-8601'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'current_node_count': {'key': 'currentNodeCount', 'type': 'int'}, - 'target_node_count': {'key': 'targetNodeCount', 'type': 'int'}, - 'node_state_counts': {'key': 'nodeStateCounts', 'type': 'NodeStateCounts'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'property_bag': {'key': 'propertyBag', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): + "allocation_state": {"readonly": True}, + "allocation_state_transition_time": {"readonly": True}, + "errors": {"readonly": True}, + "current_node_count": {"readonly": True}, + "target_node_count": {"readonly": True}, + "node_state_counts": {"readonly": True}, + } + + _attribute_map = { + "os_type": {"key": "osType", "type": "str"}, + "vm_size": {"key": "vmSize", "type": "str"}, + "vm_priority": {"key": "vmPriority", "type": "str"}, + "virtual_machine_image": { + "key": "virtualMachineImage", + "type": "VirtualMachineImage", + }, + "isolated_network": {"key": "isolatedNetwork", "type": "bool"}, + "scale_settings": {"key": "scaleSettings", "type": "ScaleSettings"}, + "user_account_credentials": { + "key": "userAccountCredentials", + "type": "UserAccountCredentials", + }, + "subnet": {"key": "subnet", "type": "ResourceId"}, + "remote_login_port_public_access": { + "key": "remoteLoginPortPublicAccess", + "type": "str", + }, + "allocation_state": {"key": "allocationState", "type": "str"}, + "allocation_state_transition_time": { + "key": "allocationStateTransitionTime", + "type": "iso-8601", + }, + "errors": {"key": "errors", "type": "[ErrorResponse]"}, + "current_node_count": {"key": "currentNodeCount", "type": "int"}, + "target_node_count": {"key": "targetNodeCount", "type": "int"}, + "node_state_counts": { + "key": "nodeStateCounts", + "type": "NodeStateCounts", + }, + "enable_node_public_ip": {"key": "enableNodePublicIp", "type": "bool"}, + "property_bag": {"key": "propertyBag", "type": "object"}, + } + + def __init__(self, **kwargs): """ :keyword os_type: Compute OS Type. Possible values include: "Linux", "Windows". Default value: "Linux". @@ -1165,23 +1196,27 @@ def __init__( :paramtype property_bag: any """ super(AmlComputeProperties, self).__init__(**kwargs) - self.os_type = kwargs.get('os_type', "Linux") - self.vm_size = kwargs.get('vm_size', None) - self.vm_priority = kwargs.get('vm_priority', None) - self.virtual_machine_image = kwargs.get('virtual_machine_image', None) - self.isolated_network = kwargs.get('isolated_network', None) - self.scale_settings = kwargs.get('scale_settings', None) - self.user_account_credentials = kwargs.get('user_account_credentials', None) - self.subnet = kwargs.get('subnet', None) - self.remote_login_port_public_access = kwargs.get('remote_login_port_public_access', "NotSpecified") + self.os_type = kwargs.get("os_type", "Linux") + self.vm_size = kwargs.get("vm_size", None) + self.vm_priority = kwargs.get("vm_priority", None) + self.virtual_machine_image = kwargs.get("virtual_machine_image", None) + self.isolated_network = kwargs.get("isolated_network", None) + self.scale_settings = kwargs.get("scale_settings", None) + self.user_account_credentials = kwargs.get( + "user_account_credentials", None + ) + self.subnet = kwargs.get("subnet", None) + self.remote_login_port_public_access = kwargs.get( + "remote_login_port_public_access", "NotSpecified" + ) self.allocation_state = None self.allocation_state_transition_time = None self.errors = None self.current_node_count = None self.target_node_count = None self.node_state_counts = None - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', True) - self.property_bag = kwargs.get('property_bag', None) + self.enable_node_public_ip = kwargs.get("enable_node_public_ip", True) + self.property_bag = kwargs.get("property_bag", None) class AmlOperation(msrest.serialization.Model): @@ -1196,15 +1231,12 @@ class AmlOperation(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'AmlOperationDisplay'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + "name": {"key": "name", "type": "str"}, + "display": {"key": "display", "type": "AmlOperationDisplay"}, + "is_data_action": {"key": "isDataAction", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: Operation name: {provider}/{resource}/{operation}. :paramtype name: str @@ -1214,9 +1246,9 @@ def __init__( :paramtype is_data_action: bool """ super(AmlOperation, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display = kwargs.get('display', None) - self.is_data_action = kwargs.get('is_data_action', None) + self.name = kwargs.get("name", None) + self.display = kwargs.get("display", None) + self.is_data_action = kwargs.get("is_data_action", None) class AmlOperationDisplay(msrest.serialization.Model): @@ -1233,16 +1265,13 @@ class AmlOperationDisplay(msrest.serialization.Model): """ _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, + "provider": {"key": "provider", "type": "str"}, + "resource": {"key": "resource", "type": "str"}, + "operation": {"key": "operation", "type": "str"}, + "description": {"key": "description", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword provider: The resource provider name: Microsoft.MachineLearningExperimentation. :paramtype provider: str @@ -1254,10 +1283,10 @@ def __init__( :paramtype description: str """ super(AmlOperationDisplay, self).__init__(**kwargs) - self.provider = kwargs.get('provider', None) - self.resource = kwargs.get('resource', None) - self.operation = kwargs.get('operation', None) - self.description = kwargs.get('description', None) + self.provider = kwargs.get("provider", None) + self.resource = kwargs.get("resource", None) + self.operation = kwargs.get("operation", None) + self.description = kwargs.get("description", None) class AmlOperationListResult(msrest.serialization.Model): @@ -1268,19 +1297,16 @@ class AmlOperationListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlOperation]'}, + "value": {"key": "value", "type": "[AmlOperation]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: List of AML operations supported by the AML resource provider. :paramtype value: list[~azure.mgmt.machinelearningservices.models.AmlOperation] """ super(AmlOperationListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class IdentityConfiguration(msrest.serialization.Model): @@ -1298,23 +1324,23 @@ class IdentityConfiguration(msrest.serialization.Model): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, } _subtype_map = { - 'identity_type': {'AMLToken': 'AmlToken', 'Managed': 'ManagedIdentity', 'UserIdentity': 'UserIdentity'} + "identity_type": { + "AMLToken": "AmlToken", + "Managed": "ManagedIdentity", + "UserIdentity": "UserIdentity", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(IdentityConfiguration, self).__init__(**kwargs) self.identity_type = None # type: Optional[str] @@ -1331,21 +1357,17 @@ class AmlToken(IdentityConfiguration): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AmlToken, self).__init__(**kwargs) - self.identity_type = 'AMLToken' # type: str + self.identity_type = "AMLToken" # type: str class AmlUserFeature(msrest.serialization.Model): @@ -1360,15 +1382,12 @@ class AmlUserFeature(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "description": {"key": "description", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword id: Specifies the feature ID. :paramtype id: str @@ -1378,9 +1397,9 @@ def __init__( :paramtype description: str """ super(AmlUserFeature, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.display_name = kwargs.get('display_name', None) - self.description = kwargs.get('description', None) + self.id = kwargs.get("id", None) + self.display_name = kwargs.get("display_name", None) + self.description = kwargs.get("description", None) class ArmResourceId(msrest.serialization.Model): @@ -1394,13 +1413,10 @@ class ArmResourceId(msrest.serialization.Model): """ _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, + "resource_id": {"key": "resourceId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword resource_id: Arm ResourceId is in the format "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName}" @@ -1409,7 +1425,7 @@ def __init__( :paramtype resource_id: str """ super(ArmResourceId, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) class ResourceBase(msrest.serialization.Model): @@ -1424,15 +1440,12 @@ class ResourceBase(msrest.serialization.Model): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -1442,9 +1455,9 @@ def __init__( :paramtype tags: dict[str, str] """ super(ResourceBase, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) + self.description = kwargs.get("description", None) + self.properties = kwargs.get("properties", None) + self.tags = kwargs.get("tags", None) class AssetBase(ResourceBase): @@ -1463,17 +1476,14 @@ class AssetBase(ResourceBase): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -1487,8 +1497,8 @@ def __init__( :paramtype is_archived: bool """ super(AssetBase, self).__init__(**kwargs) - self.is_anonymous = kwargs.get('is_anonymous', False) - self.is_archived = kwargs.get('is_archived', False) + self.is_anonymous = kwargs.get("is_anonymous", False) + self.is_archived = kwargs.get("is_archived", False) class AssetContainer(ResourceBase): @@ -1511,23 +1521,20 @@ class AssetContainer(ResourceBase): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -1539,7 +1546,7 @@ def __init__( :paramtype is_archived: bool """ super(AssetContainer, self).__init__(**kwargs) - self.is_archived = kwargs.get('is_archived', False) + self.is_archived = kwargs.get("is_archived", False) self.latest_version = None self.next_version = None @@ -1557,18 +1564,15 @@ class AssetJobInput(msrest.serialization.Model): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -1577,8 +1581,8 @@ def __init__( :paramtype uri: str """ super(AssetJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] class AssetJobOutput(msrest.serialization.Model): @@ -1592,14 +1596,11 @@ class AssetJobOutput(msrest.serialization.Model): """ _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", "Direct". @@ -1608,8 +1609,8 @@ def __init__( :paramtype uri: str """ super(AssetJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) class AssetReferenceBase(msrest.serialization.Model): @@ -1626,23 +1627,23 @@ class AssetReferenceBase(msrest.serialization.Model): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, } _subtype_map = { - 'reference_type': {'DataPath': 'DataPathAssetReference', 'Id': 'IdAssetReference', 'OutputPath': 'OutputPathAssetReference'} + "reference_type": { + "DataPath": "DataPathAssetReference", + "Id": "IdAssetReference", + "OutputPath": "OutputPathAssetReference", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AssetReferenceBase, self).__init__(**kwargs) self.reference_type = None # type: Optional[str] @@ -1659,19 +1660,16 @@ class AssignedUser(msrest.serialization.Model): """ _validation = { - 'object_id': {'required': True}, - 'tenant_id': {'required': True}, + "object_id": {"required": True}, + "tenant_id": {"required": True}, } _attribute_map = { - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + "object_id": {"key": "objectId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword object_id: Required. User’s AAD Object Id. :paramtype object_id: str @@ -1679,8 +1677,8 @@ def __init__( :paramtype tenant_id: str """ super(AssignedUser, self).__init__(**kwargs) - self.object_id = kwargs['object_id'] - self.tenant_id = kwargs['tenant_id'] + self.object_id = kwargs["object_id"] + self.tenant_id = kwargs["tenant_id"] class ForecastHorizon(msrest.serialization.Model): @@ -1697,23 +1695,22 @@ class ForecastHorizon(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoForecastHorizon', 'Custom': 'CustomForecastHorizon'} + "mode": { + "Auto": "AutoForecastHorizon", + "Custom": "CustomForecastHorizon", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ForecastHorizon, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -1729,21 +1726,17 @@ class AutoForecastHorizon(ForecastHorizon): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoForecastHorizon, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class AutologgerSettings(msrest.serialization.Model): @@ -1758,17 +1751,14 @@ class AutologgerSettings(msrest.serialization.Model): """ _validation = { - 'mlflow_autologger': {'required': True}, + "mlflow_autologger": {"required": True}, } _attribute_map = { - 'mlflow_autologger': {'key': 'mlflowAutologger', 'type': 'str'}, + "mlflow_autologger": {"key": "mlflowAutologger", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mlflow_autologger: Required. [Required] Indicates whether mlflow autologger is enabled. Possible values include: "Enabled", "Disabled". @@ -1776,7 +1766,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.MLFlowAutologgerState """ super(AutologgerSettings, self).__init__(**kwargs) - self.mlflow_autologger = kwargs['mlflow_autologger'] + self.mlflow_autologger = kwargs["mlflow_autologger"] class JobBaseProperties(ResourceBase): @@ -1823,33 +1813,37 @@ class JobBaseProperties(ResourceBase): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, + "job_type": {"required": True}, + "status": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, } _subtype_map = { - 'job_type': {'AutoML': 'AutoMLJob', 'Command': 'CommandJob', 'Labeling': 'LabelingJobProperties', 'Pipeline': 'PipelineJob', 'Spark': 'SparkJob', 'Sweep': 'SweepJob'} + "job_type": { + "AutoML": "AutoMLJob", + "Command": "CommandJob", + "Labeling": "LabelingJobProperties", + "Pipeline": "PipelineJob", + "Spark": "SparkJob", + "Sweep": "SweepJob", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -1877,102 +1871,102 @@ def __init__( :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] """ super(JobBaseProperties, self).__init__(**kwargs) - self.component_id = kwargs.get('component_id', None) - self.compute_id = kwargs.get('compute_id', None) - self.display_name = kwargs.get('display_name', None) - self.experiment_name = kwargs.get('experiment_name', "Default") - self.identity = kwargs.get('identity', None) - self.is_archived = kwargs.get('is_archived', False) - self.job_type = 'JobBaseProperties' # type: str - self.services = kwargs.get('services', None) + self.component_id = kwargs.get("component_id", None) + self.compute_id = kwargs.get("compute_id", None) + self.display_name = kwargs.get("display_name", None) + self.experiment_name = kwargs.get("experiment_name", "Default") + self.identity = kwargs.get("identity", None) + self.is_archived = kwargs.get("is_archived", False) + self.job_type = "JobBaseProperties" # type: str + self.services = kwargs.get("services", None) self.status = None class AutoMLJob(JobBaseProperties): """AutoMLJob class. -Use this class for executing AutoML tasks like Classification/Regression etc. -See TaskType enum for all the tasks supported. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar environment_id: The ARM resource ID of the Environment specification for the job. - This is optional value to provide, if not provided, AutoML will default this to Production - AutoML curated environment version when running the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - :ivar task_details: Required. [Required] This represents scenario which can be one of - Tables/NLP/Image. - :vartype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical + Use this class for executing AutoML tasks like Classification/Regression etc. + See TaskType enum for all the tasks supported. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar description: The asset description text. + :vartype description: str + :ivar properties: The asset property dictionary. + :vartype properties: dict[str, str] + :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + :ivar component_id: ARM resource ID of the component resource. + :vartype component_id: str + :ivar compute_id: ARM resource ID of the compute resource. + :vartype compute_id: str + :ivar display_name: Display name of job. + :vartype display_name: str + :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is + placed in the "Default" experiment. + :vartype experiment_name: str + :ivar identity: Identity configuration. If set, this should be one of AmlToken, + ManagedIdentity, UserIdentity or null. + Defaults to AmlToken if null. + :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration + :ivar is_archived: Is the asset archived?. + :vartype is_archived: bool + :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. + Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark". + :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType + :ivar services: List of JobEndpoints. + For local jobs, a job endpoint will have an endpoint value of FileStreamObject. + :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] + :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", + "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", + "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". + :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus + :ivar environment_id: The ARM resource ID of the Environment specification for the job. + This is optional value to provide, if not provided, AutoML will default this to Production + AutoML curated environment version when running the job. + :vartype environment_id: str + :ivar environment_variables: Environment variables included in the job. + :vartype environment_variables: dict[str, str] + :ivar outputs: Mapping of output data bindings used in the job. + :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] + :ivar resources: Compute Resource configuration for the job. + :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration + :ivar task_details: Required. [Required] This represents scenario which can be one of + Tables/NLP/Image. + :vartype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'task_details': {'required': True}, + "job_type": {"required": True}, + "status": {"readonly": True}, + "task_details": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - 'task_details': {'key': 'taskDetails', 'type': 'AutoMLVertical'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "resources": {"key": "resources", "type": "JobResourceConfiguration"}, + "task_details": {"key": "taskDetails", "type": "AutoMLVertical"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -2013,58 +2007,66 @@ def __init__( :paramtype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical """ super(AutoMLJob, self).__init__(**kwargs) - self.job_type = 'AutoML' # type: str - self.environment_id = kwargs.get('environment_id', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.outputs = kwargs.get('outputs', None) - self.resources = kwargs.get('resources', None) - self.task_details = kwargs['task_details'] + self.job_type = "AutoML" # type: str + self.environment_id = kwargs.get("environment_id", None) + self.environment_variables = kwargs.get("environment_variables", None) + self.outputs = kwargs.get("outputs", None) + self.resources = kwargs.get("resources", None) + self.task_details = kwargs["task_details"] class AutoMLVertical(msrest.serialization.Model): """AutoML vertical class. -Base class for AutoML verticals - TableVertical/ImageVertical/NLPVertical. + Base class for AutoML verticals - TableVertical/ImageVertical/NLPVertical. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Classification, Forecasting, ImageClassification, ImageClassificationMultilabel, ImageInstanceSegmentation, ImageObjectDetection, Regression, TextClassification, TextClassificationMultilabel, TextNer. + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Classification, Forecasting, ImageClassification, ImageClassificationMultilabel, ImageInstanceSegmentation, ImageObjectDetection, Regression, TextClassification, TextClassificationMultilabel, TextNer. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, + "task_type": {"required": True}, + "training_data": {"required": True}, } _attribute_map = { - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, } _subtype_map = { - 'task_type': {'Classification': 'Classification', 'Forecasting': 'Forecasting', 'ImageClassification': 'ImageClassification', 'ImageClassificationMultilabel': 'ImageClassificationMultilabel', 'ImageInstanceSegmentation': 'ImageInstanceSegmentation', 'ImageObjectDetection': 'ImageObjectDetection', 'Regression': 'Regression', 'TextClassification': 'TextClassification', 'TextClassificationMultilabel': 'TextClassificationMultilabel', 'TextNER': 'TextNer'} - } - - def __init__( - self, - **kwargs - ): + "task_type": { + "Classification": "Classification", + "Forecasting": "Forecasting", + "ImageClassification": "ImageClassification", + "ImageClassificationMultilabel": "ImageClassificationMultilabel", + "ImageInstanceSegmentation": "ImageInstanceSegmentation", + "ImageObjectDetection": "ImageObjectDetection", + "Regression": "Regression", + "TextClassification": "TextClassification", + "TextClassificationMultilabel": "TextClassificationMultilabel", + "TextNER": "TextNer", + } + } + + def __init__(self, **kwargs): """ :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", "Info", "Warning", "Error", "Critical". @@ -2076,10 +2078,10 @@ def __init__( :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ super(AutoMLVertical, self).__init__(**kwargs) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) self.task_type = None # type: Optional[str] - self.training_data = kwargs['training_data'] + self.training_data = kwargs["training_data"] class NCrossValidations(msrest.serialization.Model): @@ -2096,23 +2098,22 @@ class NCrossValidations(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoNCrossValidations', 'Custom': 'CustomNCrossValidations'} + "mode": { + "Auto": "AutoNCrossValidations", + "Custom": "CustomNCrossValidations", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NCrossValidations, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -2128,21 +2129,17 @@ class AutoNCrossValidations(NCrossValidations): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoNCrossValidations, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class AutoPauseProperties(msrest.serialization.Model): @@ -2155,14 +2152,11 @@ class AutoPauseProperties(msrest.serialization.Model): """ _attribute_map = { - 'delay_in_minutes': {'key': 'delayInMinutes', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, + "delay_in_minutes": {"key": "delayInMinutes", "type": "int"}, + "enabled": {"key": "enabled", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword delay_in_minutes: :paramtype delay_in_minutes: int @@ -2170,8 +2164,8 @@ def __init__( :paramtype enabled: bool """ super(AutoPauseProperties, self).__init__(**kwargs) - self.delay_in_minutes = kwargs.get('delay_in_minutes', None) - self.enabled = kwargs.get('enabled', None) + self.delay_in_minutes = kwargs.get("delay_in_minutes", None) + self.enabled = kwargs.get("enabled", None) class AutoScaleProperties(msrest.serialization.Model): @@ -2186,15 +2180,12 @@ class AutoScaleProperties(msrest.serialization.Model): """ _attribute_map = { - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, + "min_node_count": {"key": "minNodeCount", "type": "int"}, + "enabled": {"key": "enabled", "type": "bool"}, + "max_node_count": {"key": "maxNodeCount", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword min_node_count: :paramtype min_node_count: int @@ -2204,9 +2195,9 @@ def __init__( :paramtype max_node_count: int """ super(AutoScaleProperties, self).__init__(**kwargs) - self.min_node_count = kwargs.get('min_node_count', None) - self.enabled = kwargs.get('enabled', None) - self.max_node_count = kwargs.get('max_node_count', None) + self.min_node_count = kwargs.get("min_node_count", None) + self.enabled = kwargs.get("enabled", None) + self.max_node_count = kwargs.get("max_node_count", None) class Seasonality(msrest.serialization.Model): @@ -2223,23 +2214,19 @@ class Seasonality(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoSeasonality', 'Custom': 'CustomSeasonality'} + "mode": {"Auto": "AutoSeasonality", "Custom": "CustomSeasonality"} } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Seasonality, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -2255,21 +2242,17 @@ class AutoSeasonality(Seasonality): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoSeasonality, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class TargetLags(msrest.serialization.Model): @@ -2286,23 +2269,19 @@ class TargetLags(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoTargetLags', 'Custom': 'CustomTargetLags'} + "mode": {"Auto": "AutoTargetLags", "Custom": "CustomTargetLags"} } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(TargetLags, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -2318,21 +2297,17 @@ class AutoTargetLags(TargetLags): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoTargetLags, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class TargetRollingWindowSize(msrest.serialization.Model): @@ -2349,23 +2324,22 @@ class TargetRollingWindowSize(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoTargetRollingWindowSize', 'Custom': 'CustomTargetRollingWindowSize'} + "mode": { + "Auto": "AutoTargetRollingWindowSize", + "Custom": "CustomTargetRollingWindowSize", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(TargetRollingWindowSize, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -2381,21 +2355,17 @@ class AutoTargetRollingWindowSize(TargetRollingWindowSize): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class AzureDatastore(msrest.serialization.Model): @@ -2408,14 +2378,11 @@ class AzureDatastore(msrest.serialization.Model): """ _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + "resource_group": {"key": "resourceGroup", "type": "str"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword resource_group: Azure Resource Group name. :paramtype resource_group: str @@ -2423,8 +2390,8 @@ def __init__( :paramtype subscription_id: str """ super(AzureDatastore, self).__init__(**kwargs) - self.resource_group = kwargs.get('resource_group', None) - self.subscription_id = kwargs.get('subscription_id', None) + self.resource_group = kwargs.get("resource_group", None) + self.subscription_id = kwargs.get("subscription_id", None) class DatastoreProperties(ResourceBase): @@ -2455,28 +2422,31 @@ class DatastoreProperties(ResourceBase): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, } _subtype_map = { - 'datastore_type': {'AzureBlob': 'AzureBlobDatastore', 'AzureDataLakeGen1': 'AzureDataLakeGen1Datastore', 'AzureDataLakeGen2': 'AzureDataLakeGen2Datastore', 'AzureFile': 'AzureFileDatastore', 'Hdfs': 'HdfsDatastore'} + "datastore_type": { + "AzureBlob": "AzureBlobDatastore", + "AzureDataLakeGen1": "AzureDataLakeGen1Datastore", + "AzureDataLakeGen2": "AzureDataLakeGen2Datastore", + "AzureFile": "AzureFileDatastore", + "Hdfs": "HdfsDatastore", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -2488,8 +2458,8 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials """ super(DatastoreProperties, self).__init__(**kwargs) - self.credentials = kwargs['credentials'] - self.datastore_type = 'DatastoreProperties' # type: str + self.credentials = kwargs["credentials"] + self.datastore_type = "DatastoreProperties" # type: str self.is_default = None @@ -2535,31 +2505,31 @@ class AzureBlobDatastore(DatastoreProperties, AzureDatastore): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, } _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, + "resource_group": {"key": "resourceGroup", "type": "str"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "account_name": {"key": "accountName", "type": "str"}, + "container_name": {"key": "containerName", "type": "str"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword resource_group: Azure Resource Group name. :paramtype resource_group: str @@ -2588,18 +2558,20 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ super(AzureBlobDatastore, self).__init__(**kwargs) - self.resource_group = kwargs.get('resource_group', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.datastore_type = 'AzureBlob' # type: str - self.account_name = kwargs.get('account_name', None) - self.container_name = kwargs.get('container_name', None) - self.endpoint = kwargs.get('endpoint', None) - self.protocol = kwargs.get('protocol', None) - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - self.credentials = kwargs['credentials'] + self.resource_group = kwargs.get("resource_group", None) + self.subscription_id = kwargs.get("subscription_id", None) + self.datastore_type = "AzureBlob" # type: str + self.account_name = kwargs.get("account_name", None) + self.container_name = kwargs.get("container_name", None) + self.endpoint = kwargs.get("endpoint", None) + self.protocol = kwargs.get("protocol", None) + self.service_data_access_auth_identity = kwargs.get( + "service_data_access_auth_identity", None + ) + self.description = kwargs.get("description", None) + self.properties = kwargs.get("properties", None) + self.tags = kwargs.get("tags", None) + self.credentials = kwargs["credentials"] self.is_default = None @@ -2639,29 +2611,29 @@ class AzureDataLakeGen1Datastore(DatastoreProperties, AzureDatastore): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'store_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "store_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - 'store_name': {'key': 'storeName', 'type': 'str'}, + "resource_group": {"key": "resourceGroup", "type": "str"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, + "store_name": {"key": "storeName", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword resource_group: Azure Resource Group name. :paramtype resource_group: str @@ -2684,15 +2656,17 @@ def __init__( :paramtype store_name: str """ super(AzureDataLakeGen1Datastore, self).__init__(**kwargs) - self.resource_group = kwargs.get('resource_group', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.datastore_type = 'AzureDataLakeGen1' # type: str - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) - self.store_name = kwargs['store_name'] - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - self.credentials = kwargs['credentials'] + self.resource_group = kwargs.get("resource_group", None) + self.subscription_id = kwargs.get("subscription_id", None) + self.datastore_type = "AzureDataLakeGen1" # type: str + self.service_data_access_auth_identity = kwargs.get( + "service_data_access_auth_identity", None + ) + self.store_name = kwargs["store_name"] + self.description = kwargs.get("description", None) + self.properties = kwargs.get("properties", None) + self.tags = kwargs.get("tags", None) + self.credentials = kwargs["credentials"] self.is_default = None @@ -2738,33 +2712,33 @@ class AzureDataLakeGen2Datastore(DatastoreProperties, AzureDatastore): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'filesystem': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "account_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "filesystem": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'filesystem': {'key': 'filesystem', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, + "resource_group": {"key": "resourceGroup", "type": "str"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "account_name": {"key": "accountName", "type": "str"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "filesystem": {"key": "filesystem", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword resource_group: Azure Resource Group name. :paramtype resource_group: str @@ -2793,18 +2767,20 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ super(AzureDataLakeGen2Datastore, self).__init__(**kwargs) - self.resource_group = kwargs.get('resource_group', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.datastore_type = 'AzureDataLakeGen2' # type: str - self.account_name = kwargs['account_name'] - self.endpoint = kwargs.get('endpoint', None) - self.filesystem = kwargs['filesystem'] - self.protocol = kwargs.get('protocol', None) - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - self.credentials = kwargs['credentials'] + self.resource_group = kwargs.get("resource_group", None) + self.subscription_id = kwargs.get("subscription_id", None) + self.datastore_type = "AzureDataLakeGen2" # type: str + self.account_name = kwargs["account_name"] + self.endpoint = kwargs.get("endpoint", None) + self.filesystem = kwargs["filesystem"] + self.protocol = kwargs.get("protocol", None) + self.service_data_access_auth_identity = kwargs.get( + "service_data_access_auth_identity", None + ) + self.description = kwargs.get("description", None) + self.properties = kwargs.get("properties", None) + self.tags = kwargs.get("tags", None) + self.credentials = kwargs["credentials"] self.is_default = None @@ -2851,33 +2827,33 @@ class AzureFileDatastore(DatastoreProperties, AzureDatastore): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'file_share_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "account_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "file_share_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'file_share_name': {'key': 'fileShareName', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, + "resource_group": {"key": "resourceGroup", "type": "str"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "account_name": {"key": "accountName", "type": "str"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "file_share_name": {"key": "fileShareName", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword resource_group: Azure Resource Group name. :paramtype resource_group: str @@ -2907,18 +2883,20 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ super(AzureFileDatastore, self).__init__(**kwargs) - self.resource_group = kwargs.get('resource_group', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.datastore_type = 'AzureFile' # type: str - self.account_name = kwargs['account_name'] - self.endpoint = kwargs.get('endpoint', None) - self.file_share_name = kwargs['file_share_name'] - self.protocol = kwargs.get('protocol', None) - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - self.credentials = kwargs['credentials'] + self.resource_group = kwargs.get("resource_group", None) + self.subscription_id = kwargs.get("subscription_id", None) + self.datastore_type = "AzureFile" # type: str + self.account_name = kwargs["account_name"] + self.endpoint = kwargs.get("endpoint", None) + self.file_share_name = kwargs["file_share_name"] + self.protocol = kwargs.get("protocol", None) + self.service_data_access_auth_identity = kwargs.get( + "service_data_access_auth_identity", None + ) + self.description = kwargs.get("description", None) + self.properties = kwargs.get("properties", None) + self.tags = kwargs.get("tags", None) + self.credentials = kwargs["credentials"] self.is_default = None @@ -2941,23 +2919,24 @@ class EarlyTerminationPolicy(msrest.serialization.Model): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, } _subtype_map = { - 'policy_type': {'Bandit': 'BanditPolicy', 'MedianStopping': 'MedianStoppingPolicy', 'TruncationSelection': 'TruncationSelectionPolicy'} + "policy_type": { + "Bandit": "BanditPolicy", + "MedianStopping": "MedianStoppingPolicy", + "TruncationSelection": "TruncationSelectionPolicy", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. :paramtype delay_evaluation: int @@ -2965,8 +2944,8 @@ def __init__( :paramtype evaluation_interval: int """ super(EarlyTerminationPolicy, self).__init__(**kwargs) - self.delay_evaluation = kwargs.get('delay_evaluation', 0) - self.evaluation_interval = kwargs.get('evaluation_interval', 0) + self.delay_evaluation = kwargs.get("delay_evaluation", 0) + self.evaluation_interval = kwargs.get("evaluation_interval", 0) self.policy_type = None # type: Optional[str] @@ -2990,21 +2969,18 @@ class BanditPolicy(EarlyTerminationPolicy): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'slack_amount': {'key': 'slackAmount', 'type': 'float'}, - 'slack_factor': {'key': 'slackFactor', 'type': 'float'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, + "slack_amount": {"key": "slackAmount", "type": "float"}, + "slack_factor": {"key": "slackFactor", "type": "float"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. :paramtype delay_evaluation: int @@ -3016,9 +2992,9 @@ def __init__( :paramtype slack_factor: float """ super(BanditPolicy, self).__init__(**kwargs) - self.policy_type = 'Bandit' # type: str - self.slack_amount = kwargs.get('slack_amount', 0) - self.slack_factor = kwargs.get('slack_factor', 0) + self.policy_type = "Bandit" # type: str + self.slack_amount = kwargs.get("slack_amount", 0) + self.slack_factor = kwargs.get("slack_factor", 0) class Resource(msrest.serialization.Model): @@ -3040,25 +3016,21 @@ class Resource(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -3091,26 +3063,23 @@ class TrackedResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -3118,8 +3087,8 @@ def __init__( :paramtype location: str """ super(TrackedResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.location = kwargs['location'] + self.tags = kwargs.get("tags", None) + self.location = kwargs["location"] class BatchDeployment(TrackedResource): @@ -3156,31 +3125,31 @@ class BatchDeployment(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchDeploymentProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": { + "key": "properties", + "type": "BatchDeploymentProperties", + }, + "sku": {"key": "sku", "type": "Sku"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -3197,10 +3166,10 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ super(BatchDeployment, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) + self.identity = kwargs.get("identity", None) + self.kind = kwargs.get("kind", None) + self.properties = kwargs["properties"] + self.sku = kwargs.get("sku", None) class EndpointDeploymentPropertiesBase(msrest.serialization.Model): @@ -3220,17 +3189,20 @@ class EndpointDeploymentPropertiesBase(msrest.serialization.Model): """ _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword code_configuration: Code configuration for the endpoint deployment. :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration @@ -3245,11 +3217,11 @@ def __init__( :paramtype properties: dict[str, str] """ super(EndpointDeploymentPropertiesBase, self).__init__(**kwargs) - self.code_configuration = kwargs.get('code_configuration', None) - self.description = kwargs.get('description', None) - self.environment_id = kwargs.get('environment_id', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.properties = kwargs.get('properties', None) + self.code_configuration = kwargs.get("code_configuration", None) + self.description = kwargs.get("description", None) + self.environment_id = kwargs.get("environment_id", None) + self.environment_variables = kwargs.get("environment_variables", None) + self.properties = kwargs.get("properties", None) class BatchDeploymentProperties(EndpointDeploymentPropertiesBase): @@ -3306,32 +3278,44 @@ class BatchDeploymentProperties(EndpointDeploymentPropertiesBase): """ _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'error_threshold': {'key': 'errorThreshold', 'type': 'int'}, - 'logging_level': {'key': 'loggingLevel', 'type': 'str'}, - 'max_concurrency_per_instance': {'key': 'maxConcurrencyPerInstance', 'type': 'int'}, - 'mini_batch_size': {'key': 'miniBatchSize', 'type': 'long'}, - 'model': {'key': 'model', 'type': 'AssetReferenceBase'}, - 'output_action': {'key': 'outputAction', 'type': 'str'}, - 'output_file_name': {'key': 'outputFileName', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'resources': {'key': 'resources', 'type': 'DeploymentResourceConfiguration'}, - 'retry_settings': {'key': 'retrySettings', 'type': 'BatchRetrySettings'}, - } - - def __init__( - self, - **kwargs - ): + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "compute": {"key": "compute", "type": "str"}, + "error_threshold": {"key": "errorThreshold", "type": "int"}, + "logging_level": {"key": "loggingLevel", "type": "str"}, + "max_concurrency_per_instance": { + "key": "maxConcurrencyPerInstance", + "type": "int", + }, + "mini_batch_size": {"key": "miniBatchSize", "type": "long"}, + "model": {"key": "model", "type": "AssetReferenceBase"}, + "output_action": {"key": "outputAction", "type": "str"}, + "output_file_name": {"key": "outputFileName", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "resources": { + "key": "resources", + "type": "DeploymentResourceConfiguration", + }, + "retry_settings": { + "key": "retrySettings", + "type": "BatchRetrySettings", + }, + } + + def __init__(self, **kwargs): """ :keyword code_configuration: Code configuration for the endpoint deployment. :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration @@ -3378,20 +3362,26 @@ def __init__( :paramtype retry_settings: ~azure.mgmt.machinelearningservices.models.BatchRetrySettings """ super(BatchDeploymentProperties, self).__init__(**kwargs) - self.compute = kwargs.get('compute', None) - self.error_threshold = kwargs.get('error_threshold', -1) - self.logging_level = kwargs.get('logging_level', None) - self.max_concurrency_per_instance = kwargs.get('max_concurrency_per_instance', 1) - self.mini_batch_size = kwargs.get('mini_batch_size', 10) - self.model = kwargs.get('model', None) - self.output_action = kwargs.get('output_action', None) - self.output_file_name = kwargs.get('output_file_name', "predictions.csv") + self.compute = kwargs.get("compute", None) + self.error_threshold = kwargs.get("error_threshold", -1) + self.logging_level = kwargs.get("logging_level", None) + self.max_concurrency_per_instance = kwargs.get( + "max_concurrency_per_instance", 1 + ) + self.mini_batch_size = kwargs.get("mini_batch_size", 10) + self.model = kwargs.get("model", None) + self.output_action = kwargs.get("output_action", None) + self.output_file_name = kwargs.get( + "output_file_name", "predictions.csv" + ) self.provisioning_state = None - self.resources = kwargs.get('resources', None) - self.retry_settings = kwargs.get('retry_settings', None) + self.resources = kwargs.get("resources", None) + self.retry_settings = kwargs.get("retry_settings", None) -class BatchDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class BatchDeploymentTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of BatchDeployment entities. :ivar next_link: The link to the next page of BatchDeployment objects. If null, there are no @@ -3402,14 +3392,11 @@ class BatchDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Mode """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchDeployment]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[BatchDeployment]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of BatchDeployment objects. If null, there are no additional pages. @@ -3417,9 +3404,11 @@ def __init__( :keyword value: An array of objects of type BatchDeployment. :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchDeployment] """ - super(BatchDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(BatchDeploymentTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class BatchEndpoint(TrackedResource): @@ -3456,31 +3445,28 @@ class BatchEndpoint(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": {"key": "properties", "type": "BatchEndpointProperties"}, + "sku": {"key": "sku", "type": "Sku"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -3497,10 +3483,10 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ super(BatchEndpoint, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) + self.identity = kwargs.get("identity", None) + self.kind = kwargs.get("kind", None) + self.properties = kwargs["properties"] + self.sku = kwargs.get("sku", None) class BatchEndpointDefaults(msrest.serialization.Model): @@ -3512,20 +3498,17 @@ class BatchEndpointDefaults(msrest.serialization.Model): """ _attribute_map = { - 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, + "deployment_name": {"key": "deploymentName", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword deployment_name: Name of the deployment that will be default for the endpoint. This deployment will end up getting 100% traffic when the endpoint scoring URL is invoked. :paramtype deployment_name: str """ super(BatchEndpointDefaults, self).__init__(**kwargs) - self.deployment_name = kwargs.get('deployment_name', None) + self.deployment_name = kwargs.get("deployment_name", None) class EndpointPropertiesBase(msrest.serialization.Model): @@ -3554,24 +3537,21 @@ class EndpointPropertiesBase(msrest.serialization.Model): """ _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, + "auth_mode": {"required": True}, + "scoring_uri": {"readonly": True}, + "swagger_uri": {"readonly": True}, } _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, + "auth_mode": {"key": "authMode", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "keys": {"key": "keys", "type": "EndpointAuthKeys"}, + "properties": {"key": "properties", "type": "{str}"}, + "scoring_uri": {"key": "scoringUri", "type": "str"}, + "swagger_uri": {"key": "swaggerUri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' @@ -3587,10 +3567,10 @@ def __init__( :paramtype properties: dict[str, str] """ super(EndpointPropertiesBase, self).__init__(**kwargs) - self.auth_mode = kwargs['auth_mode'] - self.description = kwargs.get('description', None) - self.keys = kwargs.get('keys', None) - self.properties = kwargs.get('properties', None) + self.auth_mode = kwargs["auth_mode"] + self.description = kwargs.get("description", None) + self.keys = kwargs.get("keys", None) + self.properties = kwargs.get("properties", None) self.scoring_uri = None self.swagger_uri = None @@ -3627,27 +3607,24 @@ class BatchEndpointProperties(EndpointPropertiesBase): """ _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "auth_mode": {"required": True}, + "scoring_uri": {"readonly": True}, + "swagger_uri": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'defaults': {'key': 'defaults', 'type': 'BatchEndpointDefaults'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "auth_mode": {"key": "authMode", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "keys": {"key": "keys", "type": "EndpointAuthKeys"}, + "properties": {"key": "properties", "type": "{str}"}, + "scoring_uri": {"key": "scoringUri", "type": "str"}, + "swagger_uri": {"key": "swaggerUri", "type": "str"}, + "defaults": {"key": "defaults", "type": "BatchEndpointDefaults"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' @@ -3665,11 +3642,13 @@ def __init__( :paramtype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults """ super(BatchEndpointProperties, self).__init__(**kwargs) - self.defaults = kwargs.get('defaults', None) + self.defaults = kwargs.get("defaults", None) self.provisioning_state = None -class BatchEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class BatchEndpointTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of BatchEndpoint entities. :ivar next_link: The link to the next page of BatchEndpoint objects. If null, there are no @@ -3680,14 +3659,11 @@ class BatchEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model) """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchEndpoint]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[BatchEndpoint]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of BatchEndpoint objects. If null, there are no additional pages. @@ -3695,9 +3671,11 @@ def __init__( :keyword value: An array of objects of type BatchEndpoint. :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchEndpoint] """ - super(BatchEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(BatchEndpointTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class BatchRetrySettings(msrest.serialization.Model): @@ -3710,14 +3688,11 @@ class BatchRetrySettings(msrest.serialization.Model): """ _attribute_map = { - 'max_retries': {'key': 'maxRetries', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "max_retries": {"key": "maxRetries", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword max_retries: Maximum retry count for a mini-batch. :paramtype max_retries: int @@ -3725,44 +3700,47 @@ def __init__( :paramtype timeout: ~datetime.timedelta """ super(BatchRetrySettings, self).__init__(**kwargs) - self.max_retries = kwargs.get('max_retries', 3) - self.timeout = kwargs.get('timeout', "PT30S") + self.max_retries = kwargs.get("max_retries", 3) + self.timeout = kwargs.get("timeout", "PT30S") class SamplingAlgorithm(msrest.serialization.Model): """The Sampling Algorithm used to generate hyperparameter values, along with properties to -configure the algorithm. + configure the algorithm. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BayesianSamplingAlgorithm, GridSamplingAlgorithm, RandomSamplingAlgorithm. + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: BayesianSamplingAlgorithm, GridSamplingAlgorithm, RandomSamplingAlgorithm. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType + :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating + hyperparameter values, along with configuration properties.Constant filled by server. Possible + values include: "Grid", "Random", "Bayesian". + :vartype sampling_algorithm_type: str or + ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } _subtype_map = { - 'sampling_algorithm_type': {'Bayesian': 'BayesianSamplingAlgorithm', 'Grid': 'GridSamplingAlgorithm', 'Random': 'RandomSamplingAlgorithm'} + "sampling_algorithm_type": { + "Bayesian": "BayesianSamplingAlgorithm", + "Grid": "GridSamplingAlgorithm", + "Random": "RandomSamplingAlgorithm", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(SamplingAlgorithm, self).__init__(**kwargs) self.sampling_algorithm_type = None # type: Optional[str] @@ -3780,21 +3758,20 @@ class BayesianSamplingAlgorithm(SamplingAlgorithm): """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(BayesianSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Bayesian' # type: str + self.sampling_algorithm_type = "Bayesian" # type: str class BindOptions(msrest.serialization.Model): @@ -3809,15 +3786,12 @@ class BindOptions(msrest.serialization.Model): """ _attribute_map = { - 'propagation': {'key': 'propagation', 'type': 'str'}, - 'create_host_path': {'key': 'createHostPath', 'type': 'bool'}, - 'selinux': {'key': 'selinux', 'type': 'str'}, + "propagation": {"key": "propagation", "type": "str"}, + "create_host_path": {"key": "createHostPath", "type": "bool"}, + "selinux": {"key": "selinux", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword propagation: Type of Bind Option. :paramtype propagation: str @@ -3827,9 +3801,9 @@ def __init__( :paramtype selinux: str """ super(BindOptions, self).__init__(**kwargs) - self.propagation = kwargs.get('propagation', None) - self.create_host_path = kwargs.get('create_host_path', None) - self.selinux = kwargs.get('selinux', None) + self.propagation = kwargs.get("propagation", None) + self.create_host_path = kwargs.get("create_host_path", None) + self.selinux = kwargs.get("selinux", None) class BuildContext(msrest.serialization.Model): @@ -3839,56 +3813,53 @@ class BuildContext(msrest.serialization.Model): :ivar context_uri: Required. [Required] URI of the Docker build context used to build the image. Supports blob URIs on environment creation and may return blob or Git URIs. - - + + .. raw:: html - + . :vartype context_uri: str :ivar dockerfile_path: Path to the Dockerfile in the build context. - - + + .. raw:: html - + . :vartype dockerfile_path: str """ _validation = { - 'context_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "context_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'context_uri': {'key': 'contextUri', 'type': 'str'}, - 'dockerfile_path': {'key': 'dockerfilePath', 'type': 'str'}, + "context_uri": {"key": "contextUri", "type": "str"}, + "dockerfile_path": {"key": "dockerfilePath", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword context_uri: Required. [Required] URI of the Docker build context used to build the image. Supports blob URIs on environment creation and may return blob or Git URIs. - - + + .. raw:: html - + . :paramtype context_uri: str :keyword dockerfile_path: Path to the Dockerfile in the build context. - - + + .. raw:: html - + . :paramtype dockerfile_path: str """ super(BuildContext, self).__init__(**kwargs) - self.context_uri = kwargs['context_uri'] - self.dockerfile_path = kwargs.get('dockerfile_path', "Dockerfile") + self.context_uri = kwargs["context_uri"] + self.dockerfile_path = kwargs.get("dockerfile_path", "Dockerfile") class CertificateDatastoreCredentials(DatastoreCredentials): @@ -3915,27 +3886,24 @@ class CertificateDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, - 'thumbprint': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials_type": {"required": True}, + "client_id": {"required": True}, + "secrets": {"required": True}, + "tenant_id": {"required": True}, + "thumbprint": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'CertificateDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "authority_url": {"key": "authorityUrl", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + "resource_url": {"key": "resourceUrl", "type": "str"}, + "secrets": {"key": "secrets", "type": "CertificateDatastoreSecrets"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "thumbprint": {"key": "thumbprint", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword authority_url: Authority URL used for authentication. :paramtype authority_url: str @@ -3953,13 +3921,13 @@ def __init__( :paramtype thumbprint: str """ super(CertificateDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Certificate' # type: str - self.authority_url = kwargs.get('authority_url', None) - self.client_id = kwargs['client_id'] - self.resource_url = kwargs.get('resource_url', None) - self.secrets = kwargs['secrets'] - self.tenant_id = kwargs['tenant_id'] - self.thumbprint = kwargs['thumbprint'] + self.credentials_type = "Certificate" # type: str + self.authority_url = kwargs.get("authority_url", None) + self.client_id = kwargs["client_id"] + self.resource_url = kwargs.get("resource_url", None) + self.secrets = kwargs["secrets"] + self.tenant_id = kwargs["tenant_id"] + self.thumbprint = kwargs["thumbprint"] class CertificateDatastoreSecrets(DatastoreSecrets): @@ -3976,25 +3944,22 @@ class CertificateDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'certificate': {'key': 'certificate', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "certificate": {"key": "certificate", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword certificate: Service principal certificate. :paramtype certificate: str """ super(CertificateDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Certificate' # type: str - self.certificate = kwargs.get('certificate', None) + self.secrets_type = "Certificate" # type: str + self.certificate = kwargs.get("certificate", None) class TableVertical(msrest.serialization.Model): @@ -4038,24 +4003,45 @@ class TableVertical(msrest.serialization.Model): """ _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "TableFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "search_space": { + "key": "searchSpace", + "type": "[TableParameterSubspace]", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "TableSweepSettings", + }, + "test_data": {"key": "testData", "type": "MLTableJobInput"}, + "test_data_size": {"key": "testDataSize", "type": "float"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "weight_column_name": {"key": "weightColumnName", "type": "str"}, + } + + def __init__(self, **kwargs): """ :keyword cv_split_column_names: Columns to use for CVSplit data. :paramtype cv_split_column_names: list[str] @@ -4097,18 +4083,20 @@ def __init__( :paramtype weight_column_name: str """ super(TableVertical, self).__init__(**kwargs) - self.cv_split_column_names = kwargs.get('cv_split_column_names', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.test_data = kwargs.get('test_data', None) - self.test_data_size = kwargs.get('test_data_size', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.weight_column_name = kwargs.get('weight_column_name', None) + self.cv_split_column_names = kwargs.get("cv_split_column_names", None) + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.fixed_parameters = kwargs.get("fixed_parameters", None) + self.limit_settings = kwargs.get("limit_settings", None) + self.n_cross_validations = kwargs.get("n_cross_validations", None) + self.search_space = kwargs.get("search_space", None) + self.sweep_settings = kwargs.get("sweep_settings", None) + self.test_data = kwargs.get("test_data", None) + self.test_data_size = kwargs.get("test_data_size", None) + self.validation_data = kwargs.get("validation_data", None) + self.validation_data_size = kwargs.get("validation_data_size", None) + self.weight_column_name = kwargs.get("weight_column_name", None) class Classification(AutoMLVertical, TableVertical): @@ -4176,36 +4164,60 @@ class Classification(AutoMLVertical, TableVertical): """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'positive_label': {'key': 'positiveLabel', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'ClassificationTrainingSettings'}, - } - - def __init__( - self, - **kwargs - ): + "task_type": {"required": True}, + "training_data": {"required": True}, + } + + _attribute_map = { + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "TableFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "search_space": { + "key": "searchSpace", + "type": "[TableParameterSubspace]", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "TableSweepSettings", + }, + "test_data": {"key": "testData", "type": "MLTableJobInput"}, + "test_data_size": {"key": "testDataSize", "type": "float"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "weight_column_name": {"key": "weightColumnName", "type": "str"}, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "positive_label": {"key": "positiveLabel", "type": "str"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, + "training_settings": { + "key": "trainingSettings", + "type": "ClassificationTrainingSettings", + }, + } + + def __init__(self, **kwargs): """ :keyword cv_split_column_names: Columns to use for CVSplit data. :paramtype cv_split_column_names: list[str] @@ -4264,25 +4276,27 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ClassificationTrainingSettings """ super(Classification, self).__init__(**kwargs) - self.cv_split_column_names = kwargs.get('cv_split_column_names', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.test_data = kwargs.get('test_data', None) - self.test_data_size = kwargs.get('test_data_size', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.weight_column_name = kwargs.get('weight_column_name', None) - self.task_type = 'Classification' # type: str - self.positive_label = kwargs.get('positive_label', None) - self.primary_metric = kwargs.get('primary_metric', None) - self.training_settings = kwargs.get('training_settings', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.cv_split_column_names = kwargs.get("cv_split_column_names", None) + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.fixed_parameters = kwargs.get("fixed_parameters", None) + self.limit_settings = kwargs.get("limit_settings", None) + self.n_cross_validations = kwargs.get("n_cross_validations", None) + self.search_space = kwargs.get("search_space", None) + self.sweep_settings = kwargs.get("sweep_settings", None) + self.test_data = kwargs.get("test_data", None) + self.test_data_size = kwargs.get("test_data_size", None) + self.validation_data = kwargs.get("validation_data", None) + self.validation_data_size = kwargs.get("validation_data_size", None) + self.weight_column_name = kwargs.get("weight_column_name", None) + self.task_type = "Classification" # type: str + self.positive_label = kwargs.get("positive_label", None) + self.primary_metric = kwargs.get("primary_metric", None) + self.training_settings = kwargs.get("training_settings", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class TrainingSettings(msrest.serialization.Model): @@ -4308,19 +4322,31 @@ class TrainingSettings(msrest.serialization.Model): """ _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - } - - def __init__( - self, - **kwargs - ): + "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, + "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, + } + + def __init__(self, **kwargs): """ :keyword enable_dnn_training: Enable recommendation of DNN models. :paramtype enable_dnn_training: bool @@ -4341,13 +4367,21 @@ def __init__( ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings """ super(TrainingSettings, self).__init__(**kwargs) - self.enable_dnn_training = kwargs.get('enable_dnn_training', False) - self.enable_model_explainability = kwargs.get('enable_model_explainability', True) - self.enable_onnx_compatible_models = kwargs.get('enable_onnx_compatible_models', False) - self.enable_stack_ensemble = kwargs.get('enable_stack_ensemble', True) - self.enable_vote_ensemble = kwargs.get('enable_vote_ensemble', True) - self.ensemble_model_download_timeout = kwargs.get('ensemble_model_download_timeout', "PT5M") - self.stack_ensemble_settings = kwargs.get('stack_ensemble_settings', None) + self.enable_dnn_training = kwargs.get("enable_dnn_training", False) + self.enable_model_explainability = kwargs.get( + "enable_model_explainability", True + ) + self.enable_onnx_compatible_models = kwargs.get( + "enable_onnx_compatible_models", False + ) + self.enable_stack_ensemble = kwargs.get("enable_stack_ensemble", True) + self.enable_vote_ensemble = kwargs.get("enable_vote_ensemble", True) + self.ensemble_model_download_timeout = kwargs.get( + "ensemble_model_download_timeout", "PT5M" + ) + self.stack_ensemble_settings = kwargs.get( + "stack_ensemble_settings", None + ) class ClassificationTrainingSettings(TrainingSettings): @@ -4379,21 +4413,39 @@ class ClassificationTrainingSettings(TrainingSettings): """ _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): + "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, + "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, + "allowed_training_algorithms": { + "key": "allowedTrainingAlgorithms", + "type": "[str]", + }, + "blocked_training_algorithms": { + "key": "blockedTrainingAlgorithms", + "type": "[str]", + }, + } + + def __init__(self, **kwargs): """ :keyword enable_dnn_training: Enable recommendation of DNN models. :paramtype enable_dnn_training: bool @@ -4420,8 +4472,12 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ClassificationModels] """ super(ClassificationTrainingSettings, self).__init__(**kwargs) - self.allowed_training_algorithms = kwargs.get('allowed_training_algorithms', None) - self.blocked_training_algorithms = kwargs.get('blocked_training_algorithms', None) + self.allowed_training_algorithms = kwargs.get( + "allowed_training_algorithms", None + ) + self.blocked_training_algorithms = kwargs.get( + "blocked_training_algorithms", None + ) class ClusterUpdateParameters(msrest.serialization.Model): @@ -4432,19 +4488,19 @@ class ClusterUpdateParameters(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties.properties', 'type': 'ScaleSettingsInformation'}, + "properties": { + "key": "properties.properties", + "type": "ScaleSettingsInformation", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of ClusterUpdate. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ScaleSettingsInformation """ super(ClusterUpdateParameters, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class ExportSummary(msrest.serialization.Model): @@ -4471,31 +4527,31 @@ class ExportSummary(msrest.serialization.Model): """ _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, + "end_date_time": {"readonly": True}, + "exported_row_count": {"readonly": True}, + "format": {"required": True}, + "labeling_job_id": {"readonly": True}, + "start_date_time": {"readonly": True}, } _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, + "end_date_time": {"key": "endDateTime", "type": "iso-8601"}, + "exported_row_count": {"key": "exportedRowCount", "type": "long"}, + "format": {"key": "format", "type": "str"}, + "labeling_job_id": {"key": "labelingJobId", "type": "str"}, + "start_date_time": {"key": "startDateTime", "type": "iso-8601"}, } _subtype_map = { - 'format': {'CSV': 'CsvExportSummary', 'Coco': 'CocoExportSummary', 'Dataset': 'DatasetExportSummary'} + "format": { + "CSV": "CsvExportSummary", + "Coco": "CocoExportSummary", + "Dataset": "DatasetExportSummary", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ExportSummary, self).__init__(**kwargs) self.end_date_time = None self.exported_row_count = None @@ -4529,33 +4585,29 @@ class CocoExportSummary(ExportSummary): """ _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'container_name': {'readonly': True}, - 'snapshot_path': {'readonly': True}, + "end_date_time": {"readonly": True}, + "exported_row_count": {"readonly": True}, + "format": {"required": True}, + "labeling_job_id": {"readonly": True}, + "start_date_time": {"readonly": True}, + "container_name": {"readonly": True}, + "snapshot_path": {"readonly": True}, } _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'snapshot_path': {'key': 'snapshotPath', 'type': 'str'}, + "end_date_time": {"key": "endDateTime", "type": "iso-8601"}, + "exported_row_count": {"key": "exportedRowCount", "type": "long"}, + "format": {"key": "format", "type": "str"}, + "labeling_job_id": {"key": "labelingJobId", "type": "str"}, + "start_date_time": {"key": "startDateTime", "type": "iso-8601"}, + "container_name": {"key": "containerName", "type": "str"}, + "snapshot_path": {"key": "snapshotPath", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(CocoExportSummary, self).__init__(**kwargs) - self.format = 'Coco' # type: str + self.format = "Coco" # type: str self.container_name = None self.snapshot_path = None @@ -4572,18 +4624,19 @@ class CodeConfiguration(msrest.serialization.Model): """ _validation = { - 'scoring_script': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "scoring_script": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'scoring_script': {'key': 'scoringScript', 'type': 'str'}, + "code_id": {"key": "codeId", "type": "str"}, + "scoring_script": {"key": "scoringScript", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword code_id: ARM resource ID of the code asset. :paramtype code_id: str @@ -4591,8 +4644,8 @@ def __init__( :paramtype scoring_script: str """ super(CodeConfiguration, self).__init__(**kwargs) - self.code_id = kwargs.get('code_id', None) - self.scoring_script = kwargs['scoring_script'] + self.code_id = kwargs.get("code_id", None) + self.scoring_script = kwargs["scoring_script"] class CodeContainer(Resource): @@ -4618,31 +4671,28 @@ class CodeContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "CodeContainerProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeContainerProperties """ super(CodeContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class CodeContainerProperties(AssetContainer): @@ -4669,25 +4719,22 @@ class CodeContainerProperties(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -4713,14 +4760,11 @@ class CodeContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[CodeContainer]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of CodeContainer objects. If null, there are no additional pages. @@ -4729,8 +4773,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.CodeContainer] """ super(CodeContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class CodeVersion(Resource): @@ -4756,31 +4800,28 @@ class CodeVersion(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeVersionProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "CodeVersionProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeVersionProperties """ super(CodeVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class CodeVersionProperties(AssetBase): @@ -4807,23 +4848,20 @@ class CodeVersionProperties(AssetBase): """ _validation = { - 'provisioning_state': {'readonly': True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'code_uri': {'key': 'codeUri', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "code_uri": {"key": "codeUri", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -4839,7 +4877,7 @@ def __init__( :paramtype code_uri: str """ super(CodeVersionProperties, self).__init__(**kwargs) - self.code_uri = kwargs.get('code_uri', None) + self.code_uri = kwargs.get("code_uri", None) self.provisioning_state = None @@ -4854,14 +4892,11 @@ class CodeVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeVersion]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[CodeVersion]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of CodeVersion objects. If null, there are no additional pages. @@ -4870,8 +4905,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.CodeVersion] """ super(CodeVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class ColumnTransformer(msrest.serialization.Model): @@ -4885,14 +4920,11 @@ class ColumnTransformer(msrest.serialization.Model): """ _attribute_map = { - 'fields': {'key': 'fields', 'type': '[str]'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, + "fields": {"key": "fields", "type": "[str]"}, + "parameters": {"key": "parameters", "type": "object"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword fields: Fields to apply transformer logic on. :paramtype fields: list[str] @@ -4901,8 +4933,8 @@ def __init__( :paramtype parameters: any """ super(ColumnTransformer, self).__init__(**kwargs) - self.fields = kwargs.get('fields', None) - self.parameters = kwargs.get('parameters', None) + self.fields = kwargs.get("fields", None) + self.parameters = kwargs.get("parameters", None) class CommandJob(JobBaseProperties): @@ -4972,43 +5004,53 @@ class CommandJob(JobBaseProperties): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'parameters': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'autologger_settings': {'key': 'autologgerSettings', 'type': 'AutologgerSettings'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'CommandJobLimits'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - } - - def __init__( - self, - **kwargs - ): + "job_type": {"required": True}, + "status": {"readonly": True}, + "command": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "environment_id": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "parameters": {"readonly": True}, + } + + _attribute_map = { + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "autologger_settings": { + "key": "autologgerSettings", + "type": "AutologgerSettings", + }, + "code_id": {"key": "codeId", "type": "str"}, + "command": {"key": "command", "type": "str"}, + "distribution": { + "key": "distribution", + "type": "DistributionConfiguration", + }, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "limits": {"key": "limits", "type": "CommandJobLimits"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "parameters": {"key": "parameters", "type": "object"}, + "resources": {"key": "resources", "type": "JobResourceConfiguration"}, + } + + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -5060,18 +5102,18 @@ def __init__( :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration """ super(CommandJob, self).__init__(**kwargs) - self.job_type = 'Command' # type: str - self.autologger_settings = kwargs.get('autologger_settings', None) - self.code_id = kwargs.get('code_id', None) - self.command = kwargs['command'] - self.distribution = kwargs.get('distribution', None) - self.environment_id = kwargs['environment_id'] - self.environment_variables = kwargs.get('environment_variables', None) - self.inputs = kwargs.get('inputs', None) - self.limits = kwargs.get('limits', None) - self.outputs = kwargs.get('outputs', None) + self.job_type = "Command" # type: str + self.autologger_settings = kwargs.get("autologger_settings", None) + self.code_id = kwargs.get("code_id", None) + self.command = kwargs["command"] + self.distribution = kwargs.get("distribution", None) + self.environment_id = kwargs["environment_id"] + self.environment_variables = kwargs.get("environment_variables", None) + self.inputs = kwargs.get("inputs", None) + self.limits = kwargs.get("limits", None) + self.outputs = kwargs.get("outputs", None) self.parameters = None - self.resources = kwargs.get('resources', None) + self.resources = kwargs.get("resources", None) class JobLimits(msrest.serialization.Model): @@ -5091,22 +5133,22 @@ class JobLimits(msrest.serialization.Model): """ _validation = { - 'job_limits_type': {'required': True}, + "job_limits_type": {"required": True}, } _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "job_limits_type": {"key": "jobLimitsType", "type": "str"}, + "timeout": {"key": "timeout", "type": "duration"}, } _subtype_map = { - 'job_limits_type': {'Command': 'CommandJobLimits', 'Sweep': 'SweepJobLimits'} + "job_limits_type": { + "Command": "CommandJobLimits", + "Sweep": "SweepJobLimits", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. Only supports duration with precision as low as Seconds. @@ -5114,7 +5156,7 @@ def __init__( """ super(JobLimits, self).__init__(**kwargs) self.job_limits_type = None # type: Optional[str] - self.timeout = kwargs.get('timeout', None) + self.timeout = kwargs.get("timeout", None) class CommandJobLimits(JobLimits): @@ -5131,25 +5173,22 @@ class CommandJobLimits(JobLimits): """ _validation = { - 'job_limits_type': {'required': True}, + "job_limits_type": {"required": True}, } _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "job_limits_type": {"key": "jobLimitsType", "type": "str"}, + "timeout": {"key": "timeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. Only supports duration with precision as low as Seconds. :paramtype timeout: ~datetime.timedelta """ super(CommandJobLimits, self).__init__(**kwargs) - self.job_limits_type = 'Command' # type: str + self.job_limits_type = "Command" # type: str class ComponentContainer(Resource): @@ -5175,81 +5214,78 @@ class ComponentContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "ComponentContainerProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentContainerProperties """ super(ComponentContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class ComponentContainerProperties(AssetContainer): """Component container definition. -.. raw:: html + .. raw:: html - . + . - Variables are only populated by the server, and will be ignored when sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the component container. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState + :ivar description: The asset description text. + :vartype description: str + :ivar properties: The asset property dictionary. + :vartype properties: dict[str, str] + :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + :ivar is_archived: Is the asset archived?. + :vartype is_archived: bool + :ivar latest_version: The latest version inside this container. + :vartype latest_version: str + :ivar next_version: The next auto incremental version. + :vartype next_version: str + :ivar provisioning_state: Provisioning state for the component container. Possible values + include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.machinelearningservices.models.AssetProvisioningState """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -5275,14 +5311,11 @@ class ComponentContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ComponentContainer]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of ComponentContainer objects. If null, there are no additional pages. @@ -5290,9 +5323,11 @@ def __init__( :keyword value: An array of objects of type ComponentContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainer] """ - super(ComponentContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(ComponentContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class ComponentVersion(Resource): @@ -5318,31 +5353,31 @@ class ComponentVersion(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentVersionProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "ComponentVersionProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentVersionProperties """ super(ComponentVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class ComponentVersionProperties(AssetBase): @@ -5361,10 +5396,10 @@ class ComponentVersionProperties(AssetBase): :ivar is_archived: Is the asset archived?. :vartype is_archived: bool :ivar component_spec: Defines Component definition details. - - + + .. raw:: html - + . @@ -5376,23 +5411,20 @@ class ComponentVersionProperties(AssetBase): """ _validation = { - 'provisioning_state': {'readonly': True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'component_spec': {'key': 'componentSpec', 'type': 'object'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "component_spec": {"key": "componentSpec", "type": "object"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -5405,17 +5437,17 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool :keyword component_spec: Defines Component definition details. - - + + .. raw:: html - + . :paramtype component_spec: any """ super(ComponentVersionProperties, self).__init__(**kwargs) - self.component_spec = kwargs.get('component_spec', None) + self.component_spec = kwargs.get("component_spec", None) self.provisioning_state = None @@ -5430,14 +5462,11 @@ class ComponentVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentVersion]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ComponentVersion]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of ComponentVersion objects. If null, there are no additional pages. @@ -5445,9 +5474,11 @@ def __init__( :keyword value: An array of objects of type ComponentVersion. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersion] """ - super(ComponentVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(ComponentVersionResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class ComputeInstanceSchema(msrest.serialization.Model): @@ -5458,19 +5489,19 @@ class ComputeInstanceSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, + "properties": { + "key": "properties", + "type": "ComputeInstanceProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of ComputeInstance. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties """ super(ComputeInstanceSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class ComputeInstance(Compute, ComputeInstanceSchema): @@ -5512,34 +5543,37 @@ class ComputeInstance(Compute, ComputeInstanceSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + "disable_local_auth": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": { + "key": "properties", + "type": "ComputeInstanceProperties", + }, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of ComputeInstance. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties @@ -5549,14 +5583,14 @@ def __init__( :paramtype resource_id: str """ super(ComputeInstance, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'ComputeInstance' # type: str + self.properties = kwargs.get("properties", None) + self.compute_type = "ComputeInstance" # type: str self.compute_location = None self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None self.disable_local_auth = None @@ -5572,14 +5606,11 @@ class ComputeInstanceApplication(msrest.serialization.Model): """ _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, + "display_name": {"key": "displayName", "type": "str"}, + "endpoint_uri": {"key": "endpointUri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword display_name: Name of the ComputeInstance application. :paramtype display_name: str @@ -5587,8 +5618,8 @@ def __init__( :paramtype endpoint_uri: str """ super(ComputeInstanceApplication, self).__init__(**kwargs) - self.display_name = kwargs.get('display_name', None) - self.endpoint_uri = kwargs.get('endpoint_uri', None) + self.display_name = kwargs.get("display_name", None) + self.endpoint_uri = kwargs.get("endpoint_uri", None) class ComputeInstanceAutologgerSettings(msrest.serialization.Model): @@ -5600,13 +5631,10 @@ class ComputeInstanceAutologgerSettings(msrest.serialization.Model): """ _attribute_map = { - 'mlflow_autologger': {'key': 'mlflowAutologger', 'type': 'str'}, + "mlflow_autologger": {"key": "mlflowAutologger", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mlflow_autologger: Indicates whether mlflow autologger is enabled for notebooks. Possible values include: "Enabled", "Disabled". @@ -5614,7 +5642,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.MlflowAutologger """ super(ComputeInstanceAutologgerSettings, self).__init__(**kwargs) - self.mlflow_autologger = kwargs.get('mlflow_autologger', None) + self.mlflow_autologger = kwargs.get("mlflow_autologger", None) class ComputeInstanceConnectivityEndpoints(msrest.serialization.Model): @@ -5630,21 +5658,17 @@ class ComputeInstanceConnectivityEndpoints(msrest.serialization.Model): """ _validation = { - 'public_ip_address': {'readonly': True}, - 'private_ip_address': {'readonly': True}, + "public_ip_address": {"readonly": True}, + "private_ip_address": {"readonly": True}, } _attribute_map = { - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + "public_ip_address": {"key": "publicIpAddress", "type": "str"}, + "private_ip_address": {"key": "privateIpAddress", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ComputeInstanceConnectivityEndpoints, self).__init__(**kwargs) self.public_ip_address = None self.private_ip_address = None @@ -5670,22 +5694,22 @@ class ComputeInstanceContainer(msrest.serialization.Model): """ _validation = { - 'services': {'readonly': True}, + "services": {"readonly": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'autosave': {'key': 'autosave', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'network': {'key': 'network', 'type': 'str'}, - 'environment': {'key': 'environment', 'type': 'ComputeInstanceEnvironmentInfo'}, - 'services': {'key': 'services', 'type': '[object]'}, + "name": {"key": "name", "type": "str"}, + "autosave": {"key": "autosave", "type": "str"}, + "gpu": {"key": "gpu", "type": "str"}, + "network": {"key": "network", "type": "str"}, + "environment": { + "key": "environment", + "type": "ComputeInstanceEnvironmentInfo", + }, + "services": {"key": "services", "type": "[object]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: Name of the ComputeInstance container. :paramtype name: str @@ -5700,11 +5724,11 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ComputeInstanceEnvironmentInfo """ super(ComputeInstanceContainer, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.autosave = kwargs.get('autosave', None) - self.gpu = kwargs.get('gpu', None) - self.network = kwargs.get('network', None) - self.environment = kwargs.get('environment', None) + self.name = kwargs.get("name", None) + self.autosave = kwargs.get("autosave", None) + self.gpu = kwargs.get("gpu", None) + self.network = kwargs.get("network", None) + self.environment = kwargs.get("environment", None) self.services = None @@ -5722,23 +5746,19 @@ class ComputeInstanceCreatedBy(msrest.serialization.Model): """ _validation = { - 'user_name': {'readonly': True}, - 'user_org_id': {'readonly': True}, - 'user_id': {'readonly': True}, + "user_name": {"readonly": True}, + "user_org_id": {"readonly": True}, + "user_id": {"readonly": True}, } _attribute_map = { - 'user_name': {'key': 'userName', 'type': 'str'}, - 'user_org_id': {'key': 'userOrgId', 'type': 'str'}, - 'user_id': {'key': 'userId', 'type': 'str'}, + "user_name": {"key": "userName", "type": "str"}, + "user_org_id": {"key": "userOrgId", "type": "str"}, + "user_id": {"key": "userId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ComputeInstanceCreatedBy, self).__init__(**kwargs) self.user_name = None self.user_org_id = None @@ -5763,16 +5783,13 @@ class ComputeInstanceDataDisk(msrest.serialization.Model): """ _attribute_map = { - 'caching': {'key': 'caching', 'type': 'str'}, - 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, - 'lun': {'key': 'lun', 'type': 'int'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + "caching": {"key": "caching", "type": "str"}, + "disk_size_gb": {"key": "diskSizeGB", "type": "int"}, + "lun": {"key": "lun", "type": "int"}, + "storage_account_type": {"key": "storageAccountType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword caching: Caching type of Data Disk. Possible values include: "None", "ReadOnly", "ReadWrite". @@ -5788,10 +5805,12 @@ def __init__( ~azure.mgmt.machinelearningservices.models.StorageAccountType """ super(ComputeInstanceDataDisk, self).__init__(**kwargs) - self.caching = kwargs.get('caching', None) - self.disk_size_gb = kwargs.get('disk_size_gb', None) - self.lun = kwargs.get('lun', None) - self.storage_account_type = kwargs.get('storage_account_type', "Standard_LRS") + self.caching = kwargs.get("caching", None) + self.disk_size_gb = kwargs.get("disk_size_gb", None) + self.lun = kwargs.get("lun", None) + self.storage_account_type = kwargs.get( + "storage_account_type", "Standard_LRS" + ) class ComputeInstanceDataMount(msrest.serialization.Model): @@ -5819,21 +5838,18 @@ class ComputeInstanceDataMount(msrest.serialization.Model): """ _attribute_map = { - 'source': {'key': 'source', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'mount_name': {'key': 'mountName', 'type': 'str'}, - 'mount_action': {'key': 'mountAction', 'type': 'str'}, - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - 'mount_state': {'key': 'mountState', 'type': 'str'}, - 'mounted_on': {'key': 'mountedOn', 'type': 'iso-8601'}, - 'error': {'key': 'error', 'type': 'str'}, + "source": {"key": "source", "type": "str"}, + "source_type": {"key": "sourceType", "type": "str"}, + "mount_name": {"key": "mountName", "type": "str"}, + "mount_action": {"key": "mountAction", "type": "str"}, + "created_by": {"key": "createdBy", "type": "str"}, + "mount_path": {"key": "mountPath", "type": "str"}, + "mount_state": {"key": "mountState", "type": "str"}, + "mounted_on": {"key": "mountedOn", "type": "iso-8601"}, + "error": {"key": "error", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword source: Source of the ComputeInstance data mount. :paramtype source: str @@ -5856,15 +5872,15 @@ def __init__( :paramtype error: str """ super(ComputeInstanceDataMount, self).__init__(**kwargs) - self.source = kwargs.get('source', None) - self.source_type = kwargs.get('source_type', None) - self.mount_name = kwargs.get('mount_name', None) - self.mount_action = kwargs.get('mount_action', None) - self.created_by = kwargs.get('created_by', None) - self.mount_path = kwargs.get('mount_path', None) - self.mount_state = kwargs.get('mount_state', None) - self.mounted_on = kwargs.get('mounted_on', None) - self.error = kwargs.get('error', None) + self.source = kwargs.get("source", None) + self.source_type = kwargs.get("source_type", None) + self.mount_name = kwargs.get("mount_name", None) + self.mount_action = kwargs.get("mount_action", None) + self.created_by = kwargs.get("created_by", None) + self.mount_path = kwargs.get("mount_path", None) + self.mount_state = kwargs.get("mount_state", None) + self.mounted_on = kwargs.get("mounted_on", None) + self.error = kwargs.get("error", None) class ComputeInstanceEnvironmentInfo(msrest.serialization.Model): @@ -5877,14 +5893,11 @@ class ComputeInstanceEnvironmentInfo(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "version": {"key": "version", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: name of environment. :paramtype name: str @@ -5892,8 +5905,8 @@ def __init__( :paramtype version: str """ super(ComputeInstanceEnvironmentInfo, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.version = kwargs.get('version', None) + self.name = kwargs.get("name", None) + self.version = kwargs.get("version", None) class ComputeInstanceLastOperation(msrest.serialization.Model): @@ -5913,16 +5926,13 @@ class ComputeInstanceLastOperation(msrest.serialization.Model): """ _attribute_map = { - 'operation_name': {'key': 'operationName', 'type': 'str'}, - 'operation_time': {'key': 'operationTime', 'type': 'iso-8601'}, - 'operation_status': {'key': 'operationStatus', 'type': 'str'}, - 'operation_trigger': {'key': 'operationTrigger', 'type': 'str'}, + "operation_name": {"key": "operationName", "type": "str"}, + "operation_time": {"key": "operationTime", "type": "iso-8601"}, + "operation_status": {"key": "operationStatus", "type": "str"}, + "operation_trigger": {"key": "operationTrigger", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword operation_name: Name of the last operation. Possible values include: "Create", "Start", "Stop", "Restart", "Reimage", "Delete". @@ -5939,10 +5949,10 @@ def __init__( ~azure.mgmt.machinelearningservices.models.OperationTrigger """ super(ComputeInstanceLastOperation, self).__init__(**kwargs) - self.operation_name = kwargs.get('operation_name', None) - self.operation_time = kwargs.get('operation_time', None) - self.operation_status = kwargs.get('operation_status', None) - self.operation_trigger = kwargs.get('operation_trigger', None) + self.operation_name = kwargs.get("operation_name", None) + self.operation_time = kwargs.get("operation_time", None) + self.operation_status = kwargs.get("operation_status", None) + self.operation_trigger = kwargs.get("operation_trigger", None) class ComputeInstanceProperties(msrest.serialization.Model): @@ -6020,50 +6030,89 @@ class ComputeInstanceProperties(msrest.serialization.Model): """ _validation = { - 'os_image_metadata': {'readonly': True}, - 'connectivity_endpoints': {'readonly': True}, - 'applications': {'readonly': True}, - 'created_by': {'readonly': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'last_operation': {'readonly': True}, - 'schedules': {'readonly': True}, - 'containers': {'readonly': True}, - 'data_disks': {'readonly': True}, - 'data_mounts': {'readonly': True}, - 'versions': {'readonly': True}, - } - - _attribute_map = { - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'application_sharing_policy': {'key': 'applicationSharingPolicy', 'type': 'str'}, - 'autologger_settings': {'key': 'autologgerSettings', 'type': 'ComputeInstanceAutologgerSettings'}, - 'ssh_settings': {'key': 'sshSettings', 'type': 'ComputeInstanceSshSettings'}, - 'custom_services': {'key': 'customServices', 'type': '[CustomService]'}, - 'os_image_metadata': {'key': 'osImageMetadata', 'type': 'ImageMetadata'}, - 'connectivity_endpoints': {'key': 'connectivityEndpoints', 'type': 'ComputeInstanceConnectivityEndpoints'}, - 'applications': {'key': 'applications', 'type': '[ComputeInstanceApplication]'}, - 'created_by': {'key': 'createdBy', 'type': 'ComputeInstanceCreatedBy'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'compute_instance_authorization_type': {'key': 'computeInstanceAuthorizationType', 'type': 'str'}, - 'personal_compute_instance_settings': {'key': 'personalComputeInstanceSettings', 'type': 'PersonalComputeInstanceSettings'}, - 'setup_scripts': {'key': 'setupScripts', 'type': 'SetupScripts'}, - 'last_operation': {'key': 'lastOperation', 'type': 'ComputeInstanceLastOperation'}, - 'schedules': {'key': 'schedules', 'type': 'ComputeSchedules'}, - 'idle_time_before_shutdown': {'key': 'idleTimeBeforeShutdown', 'type': 'str'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'containers': {'key': 'containers', 'type': '[ComputeInstanceContainer]'}, - 'data_disks': {'key': 'dataDisks', 'type': '[ComputeInstanceDataDisk]'}, - 'data_mounts': {'key': 'dataMounts', 'type': '[ComputeInstanceDataMount]'}, - 'versions': {'key': 'versions', 'type': 'ComputeInstanceVersion'}, - } - - def __init__( - self, - **kwargs - ): + "os_image_metadata": {"readonly": True}, + "connectivity_endpoints": {"readonly": True}, + "applications": {"readonly": True}, + "created_by": {"readonly": True}, + "errors": {"readonly": True}, + "state": {"readonly": True}, + "last_operation": {"readonly": True}, + "schedules": {"readonly": True}, + "containers": {"readonly": True}, + "data_disks": {"readonly": True}, + "data_mounts": {"readonly": True}, + "versions": {"readonly": True}, + } + + _attribute_map = { + "vm_size": {"key": "vmSize", "type": "str"}, + "subnet": {"key": "subnet", "type": "ResourceId"}, + "application_sharing_policy": { + "key": "applicationSharingPolicy", + "type": "str", + }, + "autologger_settings": { + "key": "autologgerSettings", + "type": "ComputeInstanceAutologgerSettings", + }, + "ssh_settings": { + "key": "sshSettings", + "type": "ComputeInstanceSshSettings", + }, + "custom_services": { + "key": "customServices", + "type": "[CustomService]", + }, + "os_image_metadata": { + "key": "osImageMetadata", + "type": "ImageMetadata", + }, + "connectivity_endpoints": { + "key": "connectivityEndpoints", + "type": "ComputeInstanceConnectivityEndpoints", + }, + "applications": { + "key": "applications", + "type": "[ComputeInstanceApplication]", + }, + "created_by": {"key": "createdBy", "type": "ComputeInstanceCreatedBy"}, + "errors": {"key": "errors", "type": "[ErrorResponse]"}, + "state": {"key": "state", "type": "str"}, + "compute_instance_authorization_type": { + "key": "computeInstanceAuthorizationType", + "type": "str", + }, + "personal_compute_instance_settings": { + "key": "personalComputeInstanceSettings", + "type": "PersonalComputeInstanceSettings", + }, + "setup_scripts": {"key": "setupScripts", "type": "SetupScripts"}, + "last_operation": { + "key": "lastOperation", + "type": "ComputeInstanceLastOperation", + }, + "schedules": {"key": "schedules", "type": "ComputeSchedules"}, + "idle_time_before_shutdown": { + "key": "idleTimeBeforeShutdown", + "type": "str", + }, + "enable_node_public_ip": {"key": "enableNodePublicIp", "type": "bool"}, + "containers": { + "key": "containers", + "type": "[ComputeInstanceContainer]", + }, + "data_disks": { + "key": "dataDisks", + "type": "[ComputeInstanceDataDisk]", + }, + "data_mounts": { + "key": "dataMounts", + "type": "[ComputeInstanceDataMount]", + }, + "versions": {"key": "versions", "type": "ComputeInstanceVersion"}, + } + + def __init__(self, **kwargs): """ :keyword vm_size: Virtual Machine Size. :paramtype vm_size: str @@ -6103,25 +6152,33 @@ def __init__( :paramtype enable_node_public_ip: bool """ super(ComputeInstanceProperties, self).__init__(**kwargs) - self.vm_size = kwargs.get('vm_size', None) - self.subnet = kwargs.get('subnet', None) - self.application_sharing_policy = kwargs.get('application_sharing_policy', "Shared") - self.autologger_settings = kwargs.get('autologger_settings', None) - self.ssh_settings = kwargs.get('ssh_settings', None) - self.custom_services = kwargs.get('custom_services', None) + self.vm_size = kwargs.get("vm_size", None) + self.subnet = kwargs.get("subnet", None) + self.application_sharing_policy = kwargs.get( + "application_sharing_policy", "Shared" + ) + self.autologger_settings = kwargs.get("autologger_settings", None) + self.ssh_settings = kwargs.get("ssh_settings", None) + self.custom_services = kwargs.get("custom_services", None) self.os_image_metadata = None self.connectivity_endpoints = None self.applications = None self.created_by = None self.errors = None self.state = None - self.compute_instance_authorization_type = kwargs.get('compute_instance_authorization_type', "personal") - self.personal_compute_instance_settings = kwargs.get('personal_compute_instance_settings', None) - self.setup_scripts = kwargs.get('setup_scripts', None) + self.compute_instance_authorization_type = kwargs.get( + "compute_instance_authorization_type", "personal" + ) + self.personal_compute_instance_settings = kwargs.get( + "personal_compute_instance_settings", None + ) + self.setup_scripts = kwargs.get("setup_scripts", None) self.last_operation = None self.schedules = None - self.idle_time_before_shutdown = kwargs.get('idle_time_before_shutdown', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) + self.idle_time_before_shutdown = kwargs.get( + "idle_time_before_shutdown", None + ) + self.enable_node_public_ip = kwargs.get("enable_node_public_ip", None) self.containers = None self.data_disks = None self.data_mounts = None @@ -6148,21 +6205,18 @@ class ComputeInstanceSshSettings(msrest.serialization.Model): """ _validation = { - 'admin_user_name': {'readonly': True}, - 'ssh_port': {'readonly': True}, + "admin_user_name": {"readonly": True}, + "ssh_port": {"readonly": True}, } _attribute_map = { - 'ssh_public_access': {'key': 'sshPublicAccess', 'type': 'str'}, - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'admin_public_key': {'key': 'adminPublicKey', 'type': 'str'}, + "ssh_public_access": {"key": "sshPublicAccess", "type": "str"}, + "admin_user_name": {"key": "adminUserName", "type": "str"}, + "ssh_port": {"key": "sshPort", "type": "int"}, + "admin_public_key": {"key": "adminPublicKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword ssh_public_access: State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the @@ -6174,10 +6228,10 @@ def __init__( :paramtype admin_public_key: str """ super(ComputeInstanceSshSettings, self).__init__(**kwargs) - self.ssh_public_access = kwargs.get('ssh_public_access', "Disabled") + self.ssh_public_access = kwargs.get("ssh_public_access", "Disabled") self.admin_user_name = None self.ssh_port = None - self.admin_public_key = kwargs.get('admin_public_key', None) + self.admin_public_key = kwargs.get("admin_public_key", None) class ComputeInstanceVersion(msrest.serialization.Model): @@ -6188,19 +6242,16 @@ class ComputeInstanceVersion(msrest.serialization.Model): """ _attribute_map = { - 'runtime': {'key': 'runtime', 'type': 'str'}, + "runtime": {"key": "runtime", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword runtime: Runtime of compute instance. :paramtype runtime: str """ super(ComputeInstanceVersion, self).__init__(**kwargs) - self.runtime = kwargs.get('runtime', None) + self.runtime = kwargs.get("runtime", None) class ComputeResourceSchema(msrest.serialization.Model): @@ -6211,19 +6262,16 @@ class ComputeResourceSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, + "properties": {"key": "properties", "type": "Compute"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Compute properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute """ super(ComputeResourceSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class ComputeResource(Resource, ComputeResourceSchema): @@ -6255,28 +6303,25 @@ class ComputeResource(Resource, ComputeResourceSchema): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "properties": {"key": "properties", "type": "Compute"}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Compute properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute @@ -6290,11 +6335,11 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ super(ComputeResource, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) + self.properties = kwargs.get("properties", None) + self.identity = kwargs.get("identity", None) + self.location = kwargs.get("location", None) + self.tags = kwargs.get("tags", None) + self.sku = kwargs.get("sku", None) self.id = None self.name = None self.type = None @@ -6310,20 +6355,20 @@ class ComputeSchedules(msrest.serialization.Model): """ _attribute_map = { - 'compute_start_stop': {'key': 'computeStartStop', 'type': '[ComputeStartStopSchedule]'}, + "compute_start_stop": { + "key": "computeStartStop", + "type": "[ComputeStartStopSchedule]", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword compute_start_stop: The list of compute start stop schedules to be applied. :paramtype compute_start_stop: list[~azure.mgmt.machinelearningservices.models.ComputeStartStopSchedule] """ super(ComputeSchedules, self).__init__(**kwargs) - self.compute_start_stop = kwargs.get('compute_start_stop', None) + self.compute_start_stop = kwargs.get("compute_start_stop", None) class ComputeStartStopSchedule(msrest.serialization.Model): @@ -6353,25 +6398,22 @@ class ComputeStartStopSchedule(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'provisioning_status': {'readonly': True}, + "id": {"readonly": True}, + "provisioning_status": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'recurrence': {'key': 'recurrence', 'type': 'Recurrence'}, - 'cron': {'key': 'cron', 'type': 'Cron'}, - 'schedule': {'key': 'schedule', 'type': 'ScheduleBase'}, + "id": {"key": "id", "type": "str"}, + "provisioning_status": {"key": "provisioningStatus", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "action": {"key": "action", "type": "str"}, + "trigger_type": {"key": "triggerType", "type": "str"}, + "recurrence": {"key": "recurrence", "type": "Recurrence"}, + "cron": {"key": "cron", "type": "Cron"}, + "schedule": {"key": "schedule", "type": "ScheduleBase"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword status: Is the schedule enabled or disabled?. Possible values include: "Enabled", "Disabled". @@ -6390,12 +6432,12 @@ def __init__( super(ComputeStartStopSchedule, self).__init__(**kwargs) self.id = None self.provisioning_status = None - self.status = kwargs.get('status', None) - self.action = kwargs.get('action', None) - self.trigger_type = kwargs.get('trigger_type', None) - self.recurrence = kwargs.get('recurrence', None) - self.cron = kwargs.get('cron', None) - self.schedule = kwargs.get('schedule', None) + self.status = kwargs.get("status", None) + self.action = kwargs.get("action", None) + self.trigger_type = kwargs.get("trigger_type", None) + self.recurrence = kwargs.get("recurrence", None) + self.cron = kwargs.get("cron", None) + self.schedule = kwargs.get("schedule", None) class ContainerResourceRequirements(msrest.serialization.Model): @@ -6410,14 +6452,17 @@ class ContainerResourceRequirements(msrest.serialization.Model): """ _attribute_map = { - 'container_resource_limits': {'key': 'containerResourceLimits', 'type': 'ContainerResourceSettings'}, - 'container_resource_requests': {'key': 'containerResourceRequests', 'type': 'ContainerResourceSettings'}, + "container_resource_limits": { + "key": "containerResourceLimits", + "type": "ContainerResourceSettings", + }, + "container_resource_requests": { + "key": "containerResourceRequests", + "type": "ContainerResourceSettings", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword container_resource_limits: Container resource limit info:. :paramtype container_resource_limits: @@ -6427,8 +6472,12 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings """ super(ContainerResourceRequirements, self).__init__(**kwargs) - self.container_resource_limits = kwargs.get('container_resource_limits', None) - self.container_resource_requests = kwargs.get('container_resource_requests', None) + self.container_resource_limits = kwargs.get( + "container_resource_limits", None + ) + self.container_resource_requests = kwargs.get( + "container_resource_requests", None + ) class ContainerResourceSettings(msrest.serialization.Model): @@ -6446,15 +6495,12 @@ class ContainerResourceSettings(msrest.serialization.Model): """ _attribute_map = { - 'cpu': {'key': 'cpu', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'memory': {'key': 'memory', 'type': 'str'}, + "cpu": {"key": "cpu", "type": "str"}, + "gpu": {"key": "gpu", "type": "str"}, + "memory": {"key": "memory", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword cpu: Number of vCPUs request/limit for container. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. @@ -6467,9 +6513,9 @@ def __init__( :paramtype memory: str """ super(ContainerResourceSettings, self).__init__(**kwargs) - self.cpu = kwargs.get('cpu', None) - self.gpu = kwargs.get('gpu', None) - self.memory = kwargs.get('memory', None) + self.cpu = kwargs.get("cpu", None) + self.gpu = kwargs.get("gpu", None) + self.memory = kwargs.get("memory", None) class CosmosDbSettings(msrest.serialization.Model): @@ -6480,19 +6526,21 @@ class CosmosDbSettings(msrest.serialization.Model): """ _attribute_map = { - 'collections_throughput': {'key': 'collectionsThroughput', 'type': 'int'}, + "collections_throughput": { + "key": "collectionsThroughput", + "type": "int", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword collections_throughput: The throughput of the collections in cosmosdb database. :paramtype collections_throughput: int """ super(CosmosDbSettings, self).__init__(**kwargs) - self.collections_throughput = kwargs.get('collections_throughput', None) + self.collections_throughput = kwargs.get( + "collections_throughput", None + ) class Cron(msrest.serialization.Model): @@ -6510,15 +6558,12 @@ class Cron(msrest.serialization.Model): """ _attribute_map = { - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, + "start_time": {"key": "startTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "expression": {"key": "expression", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword start_time: The start time in yyyy-MM-ddTHH:mm:ss format. :paramtype start_time: str @@ -6531,9 +6576,9 @@ def __init__( :paramtype expression: str """ super(Cron, self).__init__(**kwargs) - self.start_time = kwargs.get('start_time', None) - self.time_zone = kwargs.get('time_zone', "UTC") - self.expression = kwargs.get('expression', None) + self.start_time = kwargs.get("start_time", None) + self.time_zone = kwargs.get("time_zone", "UTC") + self.expression = kwargs.get("expression", None) class TriggerBase(msrest.serialization.Model): @@ -6562,24 +6607,24 @@ class TriggerBase(msrest.serialization.Model): """ _validation = { - 'trigger_type': {'required': True}, + "trigger_type": {"required": True}, } _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, + "end_time": {"key": "endTime", "type": "str"}, + "start_time": {"key": "startTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "trigger_type": {"key": "triggerType", "type": "str"}, } _subtype_map = { - 'trigger_type': {'Cron': 'CronTrigger', 'Recurrence': 'RecurrenceTrigger'} + "trigger_type": { + "Cron": "CronTrigger", + "Recurrence": "RecurrenceTrigger", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer https://en.wikipedia.org/wiki/ISO_8601. @@ -6595,9 +6640,9 @@ def __init__( :paramtype time_zone: str """ super(TriggerBase, self).__init__(**kwargs) - self.end_time = kwargs.get('end_time', None) - self.start_time = kwargs.get('start_time', None) - self.time_zone = kwargs.get('time_zone', "UTC") + self.end_time = kwargs.get("end_time", None) + self.start_time = kwargs.get("start_time", None) + self.time_zone = kwargs.get("time_zone", "UTC") self.trigger_type = None # type: Optional[str] @@ -6627,22 +6672,19 @@ class CronTrigger(TriggerBase): """ _validation = { - 'trigger_type': {'required': True}, - 'expression': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "trigger_type": {"required": True}, + "expression": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, + "end_time": {"key": "endTime", "type": "str"}, + "start_time": {"key": "startTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "trigger_type": {"key": "triggerType", "type": "str"}, + "expression": {"key": "expression", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer https://en.wikipedia.org/wiki/ISO_8601. @@ -6661,8 +6703,8 @@ def __init__( :paramtype expression: str """ super(CronTrigger, self).__init__(**kwargs) - self.trigger_type = 'Cron' # type: str - self.expression = kwargs['expression'] + self.trigger_type = "Cron" # type: str + self.expression = kwargs["expression"] class CsvExportSummary(ExportSummary): @@ -6690,33 +6732,29 @@ class CsvExportSummary(ExportSummary): """ _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'container_name': {'readonly': True}, - 'snapshot_path': {'readonly': True}, + "end_date_time": {"readonly": True}, + "exported_row_count": {"readonly": True}, + "format": {"required": True}, + "labeling_job_id": {"readonly": True}, + "start_date_time": {"readonly": True}, + "container_name": {"readonly": True}, + "snapshot_path": {"readonly": True}, } _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'snapshot_path': {'key': 'snapshotPath', 'type': 'str'}, + "end_date_time": {"key": "endDateTime", "type": "iso-8601"}, + "exported_row_count": {"key": "exportedRowCount", "type": "long"}, + "format": {"key": "format", "type": "str"}, + "labeling_job_id": {"key": "labelingJobId", "type": "str"}, + "start_date_time": {"key": "startDateTime", "type": "iso-8601"}, + "container_name": {"key": "containerName", "type": "str"}, + "snapshot_path": {"key": "snapshotPath", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(CsvExportSummary, self).__init__(**kwargs) - self.format = 'CSV' # type: str + self.format = "CSV" # type: str self.container_name = None self.snapshot_path = None @@ -6734,26 +6772,23 @@ class CustomForecastHorizon(ForecastHorizon): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Required. [Required] Forecast horizon value. :paramtype value: int """ super(CustomForecastHorizon, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] + self.mode = "Custom" # type: str + self.value = kwargs["value"] class JobInput(msrest.serialization.Model): @@ -6773,28 +6808,33 @@ class JobInput(msrest.serialization.Model): """ _validation = { - 'job_input_type': {'required': True}, + "job_input_type": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } _subtype_map = { - 'job_input_type': {'custom_model': 'CustomModelJobInput', 'literal': 'LiteralJobInput', 'mlflow_model': 'MLFlowModelJobInput', 'mltable': 'MLTableJobInput', 'triton_model': 'TritonModelJobInput', 'uri_file': 'UriFileJobInput', 'uri_folder': 'UriFolderJobInput'} + "job_input_type": { + "custom_model": "CustomModelJobInput", + "literal": "LiteralJobInput", + "mlflow_model": "MLFlowModelJobInput", + "mltable": "MLTableJobInput", + "triton_model": "TritonModelJobInput", + "uri_file": "UriFileJobInput", + "uri_folder": "UriFolderJobInput", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: Description for the input. :paramtype description: str """ super(JobInput, self).__init__(**kwargs) - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.job_input_type = None # type: Optional[str] @@ -6817,21 +6857,18 @@ class CustomModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -6842,10 +6879,10 @@ def __init__( :paramtype description: str """ super(CustomModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'custom_model' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "custom_model" # type: str + self.description = kwargs.get("description", None) class JobOutput(msrest.serialization.Model): @@ -6865,28 +6902,32 @@ class JobOutput(msrest.serialization.Model): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } _subtype_map = { - 'job_output_type': {'custom_model': 'CustomModelJobOutput', 'mlflow_model': 'MLFlowModelJobOutput', 'mltable': 'MLTableJobOutput', 'triton_model': 'TritonModelJobOutput', 'uri_file': 'UriFileJobOutput', 'uri_folder': 'UriFolderJobOutput'} + "job_output_type": { + "custom_model": "CustomModelJobOutput", + "mlflow_model": "MLFlowModelJobOutput", + "mltable": "MLTableJobOutput", + "triton_model": "TritonModelJobOutput", + "uri_file": "UriFileJobOutput", + "uri_folder": "UriFolderJobOutput", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: Description for the output. :paramtype description: str """ super(JobOutput, self).__init__(**kwargs) - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.job_output_type = None # type: Optional[str] @@ -6909,20 +6950,17 @@ class CustomModelJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", "Direct". @@ -6933,10 +6971,10 @@ def __init__( :paramtype description: str """ super(CustomModelJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'custom_model' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "custom_model" # type: str + self.description = kwargs.get("description", None) class CustomNCrossValidations(NCrossValidations): @@ -6952,26 +6990,23 @@ class CustomNCrossValidations(NCrossValidations): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Required. [Required] N-Cross validations value. :paramtype value: int """ super(CustomNCrossValidations, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] + self.mode = "Custom" # type: str + self.value = kwargs["value"] class CustomSeasonality(Seasonality): @@ -6987,26 +7022,23 @@ class CustomSeasonality(Seasonality): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Required. [Required] Seasonality value. :paramtype value: int """ super(CustomSeasonality, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] + self.mode = "Custom" # type: str + self.value = kwargs["value"] class CustomService(msrest.serialization.Model): @@ -7031,19 +7063,19 @@ class CustomService(msrest.serialization.Model): """ _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'name': {'key': 'name', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'Image'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{EnvironmentVariable}'}, - 'docker': {'key': 'docker', 'type': 'Docker'}, - 'endpoints': {'key': 'endpoints', 'type': '[Endpoint]'}, - 'volumes': {'key': 'volumes', 'type': '[VolumeDefinition]'}, + "additional_properties": {"key": "", "type": "{object}"}, + "name": {"key": "name", "type": "str"}, + "image": {"key": "image", "type": "Image"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{EnvironmentVariable}", + }, + "docker": {"key": "docker", "type": "Docker"}, + "endpoints": {"key": "endpoints", "type": "[Endpoint]"}, + "volumes": {"key": "volumes", "type": "[VolumeDefinition]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword additional_properties: Unmatched properties from the message are deserialized to this collection. @@ -7063,13 +7095,13 @@ def __init__( :paramtype volumes: list[~azure.mgmt.machinelearningservices.models.VolumeDefinition] """ super(CustomService, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.name = kwargs.get('name', None) - self.image = kwargs.get('image', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.docker = kwargs.get('docker', None) - self.endpoints = kwargs.get('endpoints', None) - self.volumes = kwargs.get('volumes', None) + self.additional_properties = kwargs.get("additional_properties", None) + self.name = kwargs.get("name", None) + self.image = kwargs.get("image", None) + self.environment_variables = kwargs.get("environment_variables", None) + self.docker = kwargs.get("docker", None) + self.endpoints = kwargs.get("endpoints", None) + self.volumes = kwargs.get("volumes", None) class CustomTargetLags(TargetLags): @@ -7085,26 +7117,23 @@ class CustomTargetLags(TargetLags): """ _validation = { - 'mode': {'required': True}, - 'values': {'required': True}, + "mode": {"required": True}, + "values": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[int]'}, + "mode": {"key": "mode", "type": "str"}, + "values": {"key": "values", "type": "[int]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword values: Required. [Required] Set target lags values. :paramtype values: list[int] """ super(CustomTargetLags, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.values = kwargs['values'] + self.mode = "Custom" # type: str + self.values = kwargs["values"] class CustomTargetRollingWindowSize(TargetRollingWindowSize): @@ -7120,26 +7149,23 @@ class CustomTargetRollingWindowSize(TargetRollingWindowSize): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Required. [Required] TargetRollingWindowSize value. :paramtype value: int """ super(CustomTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] + self.mode = "Custom" # type: str + self.value = kwargs["value"] class DatabricksSchema(msrest.serialization.Model): @@ -7150,19 +7176,16 @@ class DatabricksSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, + "properties": {"key": "properties", "type": "DatabricksProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of Databricks. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties """ super(DatabricksSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class Databricks(Compute, DatabricksSchema): @@ -7204,34 +7227,34 @@ class Databricks(Compute, DatabricksSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + "disable_local_auth": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "DatabricksProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of Databricks. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties @@ -7241,14 +7264,14 @@ def __init__( :paramtype resource_id: str """ super(Databricks, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'Databricks' # type: str + self.properties = kwargs.get("properties", None) + self.compute_type = "Databricks" # type: str self.compute_location = None self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None self.disable_local_auth = None @@ -7262,22 +7285,26 @@ class DatabricksComputeSecretsProperties(msrest.serialization.Model): """ _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword databricks_access_token: access token for databricks account. :paramtype databricks_access_token: str """ super(DatabricksComputeSecretsProperties, self).__init__(**kwargs) - self.databricks_access_token = kwargs.get('databricks_access_token', None) + self.databricks_access_token = kwargs.get( + "databricks_access_token", None + ) -class DatabricksComputeSecrets(ComputeSecrets, DatabricksComputeSecretsProperties): +class DatabricksComputeSecrets( + ComputeSecrets, DatabricksComputeSecretsProperties +): """Secrets related to a Machine Learning compute based on Databricks. All required parameters must be populated in order to send to Azure. @@ -7291,25 +7318,27 @@ class DatabricksComputeSecrets(ComputeSecrets, DatabricksComputeSecretsPropertie """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, + "compute_type": {"key": "computeType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword databricks_access_token: access token for databricks account. :paramtype databricks_access_token: str """ super(DatabricksComputeSecrets, self).__init__(**kwargs) - self.databricks_access_token = kwargs.get('databricks_access_token', None) - self.compute_type = 'Databricks' # type: str + self.databricks_access_token = kwargs.get( + "databricks_access_token", None + ) + self.compute_type = "Databricks" # type: str class DatabricksProperties(msrest.serialization.Model): @@ -7322,14 +7351,14 @@ class DatabricksProperties(msrest.serialization.Model): """ _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'workspace_url': {'key': 'workspaceUrl', 'type': 'str'}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, + "workspace_url": {"key": "workspaceUrl", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword databricks_access_token: Databricks access token. :paramtype databricks_access_token: str @@ -7337,8 +7366,10 @@ def __init__( :paramtype workspace_url: str """ super(DatabricksProperties, self).__init__(**kwargs) - self.databricks_access_token = kwargs.get('databricks_access_token', None) - self.workspace_url = kwargs.get('workspace_url', None) + self.databricks_access_token = kwargs.get( + "databricks_access_token", None + ) + self.workspace_url = kwargs.get("workspace_url", None) class DataContainer(Resource): @@ -7364,31 +7395,28 @@ class DataContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "DataContainerProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataContainerProperties """ super(DataContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class DataContainerProperties(AssetContainer): @@ -7416,25 +7444,22 @@ class DataContainerProperties(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'data_type': {'required': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "data_type": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "data_type": {"key": "dataType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -7449,7 +7474,7 @@ def __init__( :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType """ super(DataContainerProperties, self).__init__(**kwargs) - self.data_type = kwargs['data_type'] + self.data_type = kwargs["data_type"] class DataContainerResourceArmPaginatedResult(msrest.serialization.Model): @@ -7463,14 +7488,11 @@ class DataContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[DataContainer]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of DataContainer objects. If null, there are no additional pages. @@ -7479,8 +7501,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataContainer] """ super(DataContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class DataFactory(Compute): @@ -7520,33 +7542,33 @@ class DataFactory(Compute): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + "disable_local_auth": {"readonly": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The description of the Machine Learning compute. :paramtype description: str @@ -7554,7 +7576,7 @@ def __init__( :paramtype resource_id: str """ super(DataFactory, self).__init__(**kwargs) - self.compute_type = 'DataFactory' # type: str + self.compute_type = "DataFactory" # type: str class DataLakeAnalyticsSchema(msrest.serialization.Model): @@ -7566,20 +7588,20 @@ class DataLakeAnalyticsSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, + "properties": { + "key": "properties", + "type": "DataLakeAnalyticsSchemaProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties """ super(DataLakeAnalyticsSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class DataLakeAnalytics(Compute, DataLakeAnalyticsSchema): @@ -7622,34 +7644,37 @@ class DataLakeAnalytics(Compute, DataLakeAnalyticsSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + "disable_local_auth": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": { + "key": "properties", + "type": "DataLakeAnalyticsSchemaProperties", + }, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: :paramtype properties: @@ -7660,14 +7685,14 @@ def __init__( :paramtype resource_id: str """ super(DataLakeAnalytics, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'DataLakeAnalytics' # type: str + self.properties = kwargs.get("properties", None) + self.compute_type = "DataLakeAnalytics" # type: str self.compute_location = None self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None self.disable_local_auth = None @@ -7681,19 +7706,21 @@ class DataLakeAnalyticsSchemaProperties(msrest.serialization.Model): """ _attribute_map = { - 'data_lake_store_account_name': {'key': 'dataLakeStoreAccountName', 'type': 'str'}, + "data_lake_store_account_name": { + "key": "dataLakeStoreAccountName", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data_lake_store_account_name: DataLake Store Account Name. :paramtype data_lake_store_account_name: str """ super(DataLakeAnalyticsSchemaProperties, self).__init__(**kwargs) - self.data_lake_store_account_name = kwargs.get('data_lake_store_account_name', None) + self.data_lake_store_account_name = kwargs.get( + "data_lake_store_account_name", None + ) class DataPathAssetReference(AssetReferenceBase): @@ -7711,19 +7738,16 @@ class DataPathAssetReference(AssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'datastore_id': {'key': 'datastoreId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "datastore_id": {"key": "datastoreId", "type": "str"}, + "path": {"key": "path", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword datastore_id: ARM resource ID of the datastore where the asset is located. :paramtype datastore_id: str @@ -7731,9 +7755,9 @@ def __init__( :paramtype path: str """ super(DataPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'DataPath' # type: str - self.datastore_id = kwargs.get('datastore_id', None) - self.path = kwargs.get('path', None) + self.reference_type = "DataPath" # type: str + self.datastore_id = kwargs.get("datastore_id", None) + self.path = kwargs.get("path", None) class DatasetExportSummary(ExportSummary): @@ -7759,31 +7783,27 @@ class DatasetExportSummary(ExportSummary): """ _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'labeled_asset_name': {'readonly': True}, + "end_date_time": {"readonly": True}, + "exported_row_count": {"readonly": True}, + "format": {"required": True}, + "labeling_job_id": {"readonly": True}, + "start_date_time": {"readonly": True}, + "labeled_asset_name": {"readonly": True}, } _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'labeled_asset_name': {'key': 'labeledAssetName', 'type': 'str'}, + "end_date_time": {"key": "endDateTime", "type": "iso-8601"}, + "exported_row_count": {"key": "exportedRowCount", "type": "long"}, + "format": {"key": "format", "type": "str"}, + "labeling_job_id": {"key": "labelingJobId", "type": "str"}, + "start_date_time": {"key": "startDateTime", "type": "iso-8601"}, + "labeled_asset_name": {"key": "labeledAssetName", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DatasetExportSummary, self).__init__(**kwargs) - self.format = 'Dataset' # type: str + self.format = "Dataset" # type: str self.labeled_asset_name = None @@ -7810,31 +7830,28 @@ class Datastore(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DatastoreProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "DatastoreProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatastoreProperties """ super(Datastore, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class DatastoreResourceArmPaginatedResult(msrest.serialization.Model): @@ -7848,14 +7865,11 @@ class DatastoreResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Datastore]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[Datastore]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of Datastore objects. If null, there are no additional pages. @@ -7864,8 +7878,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.Datastore] """ super(DatastoreResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class DataVersionBase(Resource): @@ -7891,31 +7905,31 @@ class DataVersionBase(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataVersionBaseProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "DataVersionBaseProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataVersionBaseProperties """ super(DataVersionBase, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class DataVersionBaseProperties(AssetBase): @@ -7945,28 +7959,29 @@ class DataVersionBaseProperties(AssetBase): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, } _subtype_map = { - 'data_type': {'mltable': 'MLTableData', 'uri_file': 'UriFileDataVersion', 'uri_folder': 'UriFolderDataVersion'} + "data_type": { + "mltable": "MLTableData", + "uri_file": "UriFileDataVersion", + "uri_folder": "UriFolderDataVersion", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -7983,8 +7998,8 @@ def __init__( :paramtype data_uri: str """ super(DataVersionBaseProperties, self).__init__(**kwargs) - self.data_type = 'DataVersionBaseProperties' # type: str - self.data_uri = kwargs['data_uri'] + self.data_type = "DataVersionBaseProperties" # type: str + self.data_uri = kwargs["data_uri"] class DataVersionBaseResourceArmPaginatedResult(msrest.serialization.Model): @@ -7998,14 +8013,11 @@ class DataVersionBaseResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataVersionBase]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[DataVersionBase]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of DataVersionBase objects. If null, there are no additional pages. @@ -8013,9 +8025,11 @@ def __init__( :keyword value: An array of objects of type DataVersionBase. :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBase] """ - super(DataVersionBaseResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(DataVersionBaseResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class OnlineScaleSettings(msrest.serialization.Model): @@ -8032,23 +8046,22 @@ class OnlineScaleSettings(msrest.serialization.Model): """ _validation = { - 'scale_type': {'required': True}, + "scale_type": {"required": True}, } _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, + "scale_type": {"key": "scaleType", "type": "str"}, } _subtype_map = { - 'scale_type': {'Default': 'DefaultScaleSettings', 'TargetUtilization': 'TargetUtilizationScaleSettings'} + "scale_type": { + "Default": "DefaultScaleSettings", + "TargetUtilization": "TargetUtilizationScaleSettings", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(OnlineScaleSettings, self).__init__(**kwargs) self.scale_type = None # type: Optional[str] @@ -8064,21 +8077,17 @@ class DefaultScaleSettings(OnlineScaleSettings): """ _validation = { - 'scale_type': {'required': True}, + "scale_type": {"required": True}, } _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, + "scale_type": {"key": "scaleType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DefaultScaleSettings, self).__init__(**kwargs) - self.scale_type = 'Default' # type: str + self.scale_type = "Default" # type: str class DeploymentLogs(msrest.serialization.Model): @@ -8089,19 +8098,16 @@ class DeploymentLogs(msrest.serialization.Model): """ _attribute_map = { - 'content': {'key': 'content', 'type': 'str'}, + "content": {"key": "content", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword content: The retrieved online deployment logs. :paramtype content: str """ super(DeploymentLogs, self).__init__(**kwargs) - self.content = kwargs.get('content', None) + self.content = kwargs.get("content", None) class DeploymentLogsRequest(msrest.serialization.Model): @@ -8115,14 +8121,11 @@ class DeploymentLogsRequest(msrest.serialization.Model): """ _attribute_map = { - 'container_type': {'key': 'containerType', 'type': 'str'}, - 'tail': {'key': 'tail', 'type': 'int'}, + "container_type": {"key": "containerType", "type": "str"}, + "tail": {"key": "tail", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword container_type: The type of container to retrieve logs from. Possible values include: "StorageInitializer", "InferenceServer". @@ -8131,8 +8134,8 @@ def __init__( :paramtype tail: int """ super(DeploymentLogsRequest, self).__init__(**kwargs) - self.container_type = kwargs.get('container_type', None) - self.tail = kwargs.get('tail', None) + self.container_type = kwargs.get("container_type", None) + self.tail = kwargs.get("tail", None) class ResourceConfiguration(msrest.serialization.Model): @@ -8147,15 +8150,12 @@ class ResourceConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "properties": {"key": "properties", "type": "{object}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword instance_count: Optional number of instances or nodes used by the compute target. :paramtype instance_count: int @@ -8165,9 +8165,9 @@ def __init__( :paramtype properties: dict[str, any] """ super(ResourceConfiguration, self).__init__(**kwargs) - self.instance_count = kwargs.get('instance_count', 1) - self.instance_type = kwargs.get('instance_type', None) - self.properties = kwargs.get('properties', None) + self.instance_count = kwargs.get("instance_count", 1) + self.instance_type = kwargs.get("instance_type", None) + self.properties = kwargs.get("properties", None) class DeploymentResourceConfiguration(ResourceConfiguration): @@ -8182,15 +8182,12 @@ class DeploymentResourceConfiguration(ResourceConfiguration): """ _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "properties": {"key": "properties", "type": "{object}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword instance_count: Optional number of instances or nodes used by the compute target. :paramtype instance_count: int @@ -8226,21 +8223,21 @@ class DiagnoseRequestProperties(msrest.serialization.Model): """ _attribute_map = { - 'udr': {'key': 'udr', 'type': '{object}'}, - 'nsg': {'key': 'nsg', 'type': '{object}'}, - 'resource_lock': {'key': 'resourceLock', 'type': '{object}'}, - 'dns_resolution': {'key': 'dnsResolution', 'type': '{object}'}, - 'storage_account': {'key': 'storageAccount', 'type': '{object}'}, - 'key_vault': {'key': 'keyVault', 'type': '{object}'}, - 'container_registry': {'key': 'containerRegistry', 'type': '{object}'}, - 'application_insights': {'key': 'applicationInsights', 'type': '{object}'}, - 'others': {'key': 'others', 'type': '{object}'}, + "udr": {"key": "udr", "type": "{object}"}, + "nsg": {"key": "nsg", "type": "{object}"}, + "resource_lock": {"key": "resourceLock", "type": "{object}"}, + "dns_resolution": {"key": "dnsResolution", "type": "{object}"}, + "storage_account": {"key": "storageAccount", "type": "{object}"}, + "key_vault": {"key": "keyVault", "type": "{object}"}, + "container_registry": {"key": "containerRegistry", "type": "{object}"}, + "application_insights": { + "key": "applicationInsights", + "type": "{object}", + }, + "others": {"key": "others", "type": "{object}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword udr: Setting for diagnosing user defined routing. :paramtype udr: dict[str, any] @@ -8262,15 +8259,15 @@ def __init__( :paramtype others: dict[str, any] """ super(DiagnoseRequestProperties, self).__init__(**kwargs) - self.udr = kwargs.get('udr', None) - self.nsg = kwargs.get('nsg', None) - self.resource_lock = kwargs.get('resource_lock', None) - self.dns_resolution = kwargs.get('dns_resolution', None) - self.storage_account = kwargs.get('storage_account', None) - self.key_vault = kwargs.get('key_vault', None) - self.container_registry = kwargs.get('container_registry', None) - self.application_insights = kwargs.get('application_insights', None) - self.others = kwargs.get('others', None) + self.udr = kwargs.get("udr", None) + self.nsg = kwargs.get("nsg", None) + self.resource_lock = kwargs.get("resource_lock", None) + self.dns_resolution = kwargs.get("dns_resolution", None) + self.storage_account = kwargs.get("storage_account", None) + self.key_vault = kwargs.get("key_vault", None) + self.container_registry = kwargs.get("container_registry", None) + self.application_insights = kwargs.get("application_insights", None) + self.others = kwargs.get("others", None) class DiagnoseResponseResult(msrest.serialization.Model): @@ -8281,19 +8278,16 @@ class DiagnoseResponseResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseResponseResultValue'}, + "value": {"key": "value", "type": "DiagnoseResponseResultValue"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: :paramtype value: ~azure.mgmt.machinelearningservices.models.DiagnoseResponseResultValue """ super(DiagnoseResponseResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class DiagnoseResponseResultValue(msrest.serialization.Model): @@ -8326,21 +8320,42 @@ class DiagnoseResponseResultValue(msrest.serialization.Model): """ _attribute_map = { - 'user_defined_route_results': {'key': 'userDefinedRouteResults', 'type': '[DiagnoseResult]'}, - 'network_security_rule_results': {'key': 'networkSecurityRuleResults', 'type': '[DiagnoseResult]'}, - 'resource_lock_results': {'key': 'resourceLockResults', 'type': '[DiagnoseResult]'}, - 'dns_resolution_results': {'key': 'dnsResolutionResults', 'type': '[DiagnoseResult]'}, - 'storage_account_results': {'key': 'storageAccountResults', 'type': '[DiagnoseResult]'}, - 'key_vault_results': {'key': 'keyVaultResults', 'type': '[DiagnoseResult]'}, - 'container_registry_results': {'key': 'containerRegistryResults', 'type': '[DiagnoseResult]'}, - 'application_insights_results': {'key': 'applicationInsightsResults', 'type': '[DiagnoseResult]'}, - 'other_results': {'key': 'otherResults', 'type': '[DiagnoseResult]'}, - } - - def __init__( - self, - **kwargs - ): + "user_defined_route_results": { + "key": "userDefinedRouteResults", + "type": "[DiagnoseResult]", + }, + "network_security_rule_results": { + "key": "networkSecurityRuleResults", + "type": "[DiagnoseResult]", + }, + "resource_lock_results": { + "key": "resourceLockResults", + "type": "[DiagnoseResult]", + }, + "dns_resolution_results": { + "key": "dnsResolutionResults", + "type": "[DiagnoseResult]", + }, + "storage_account_results": { + "key": "storageAccountResults", + "type": "[DiagnoseResult]", + }, + "key_vault_results": { + "key": "keyVaultResults", + "type": "[DiagnoseResult]", + }, + "container_registry_results": { + "key": "containerRegistryResults", + "type": "[DiagnoseResult]", + }, + "application_insights_results": { + "key": "applicationInsightsResults", + "type": "[DiagnoseResult]", + }, + "other_results": {"key": "otherResults", "type": "[DiagnoseResult]"}, + } + + def __init__(self, **kwargs): """ :keyword user_defined_route_results: :paramtype user_defined_route_results: @@ -8369,15 +8384,27 @@ def __init__( :paramtype other_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] """ super(DiagnoseResponseResultValue, self).__init__(**kwargs) - self.user_defined_route_results = kwargs.get('user_defined_route_results', None) - self.network_security_rule_results = kwargs.get('network_security_rule_results', None) - self.resource_lock_results = kwargs.get('resource_lock_results', None) - self.dns_resolution_results = kwargs.get('dns_resolution_results', None) - self.storage_account_results = kwargs.get('storage_account_results', None) - self.key_vault_results = kwargs.get('key_vault_results', None) - self.container_registry_results = kwargs.get('container_registry_results', None) - self.application_insights_results = kwargs.get('application_insights_results', None) - self.other_results = kwargs.get('other_results', None) + self.user_defined_route_results = kwargs.get( + "user_defined_route_results", None + ) + self.network_security_rule_results = kwargs.get( + "network_security_rule_results", None + ) + self.resource_lock_results = kwargs.get("resource_lock_results", None) + self.dns_resolution_results = kwargs.get( + "dns_resolution_results", None + ) + self.storage_account_results = kwargs.get( + "storage_account_results", None + ) + self.key_vault_results = kwargs.get("key_vault_results", None) + self.container_registry_results = kwargs.get( + "container_registry_results", None + ) + self.application_insights_results = kwargs.get( + "application_insights_results", None + ) + self.other_results = kwargs.get("other_results", None) class DiagnoseResult(msrest.serialization.Model): @@ -8395,23 +8422,19 @@ class DiagnoseResult(msrest.serialization.Model): """ _validation = { - 'code': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, + "code": {"readonly": True}, + "level": {"readonly": True}, + "message": {"readonly": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, + "code": {"key": "code", "type": "str"}, + "level": {"key": "level", "type": "str"}, + "message": {"key": "message", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DiagnoseResult, self).__init__(**kwargs) self.code = None self.level = None @@ -8426,19 +8449,16 @@ class DiagnoseWorkspaceParameters(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseRequestProperties'}, + "value": {"key": "value", "type": "DiagnoseRequestProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Value of Parameters. :paramtype value: ~azure.mgmt.machinelearningservices.models.DiagnoseRequestProperties """ super(DiagnoseWorkspaceParameters, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class DistributionConfiguration(msrest.serialization.Model): @@ -8455,23 +8475,23 @@ class DistributionConfiguration(msrest.serialization.Model): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, + "distribution_type": {"key": "distributionType", "type": "str"}, } _subtype_map = { - 'distribution_type': {'Mpi': 'Mpi', 'PyTorch': 'PyTorch', 'TensorFlow': 'TensorFlow'} + "distribution_type": { + "Mpi": "Mpi", + "PyTorch": "PyTorch", + "TensorFlow": "TensorFlow", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DistributionConfiguration, self).__init__(**kwargs) self.distribution_type = None # type: Optional[str] @@ -8487,14 +8507,11 @@ class Docker(msrest.serialization.Model): """ _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'privileged': {'key': 'privileged', 'type': 'bool'}, + "additional_properties": {"key": "", "type": "{object}"}, + "privileged": {"key": "privileged", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword additional_properties: Unmatched properties from the message are deserialized to this collection. @@ -8503,8 +8520,8 @@ def __init__( :paramtype privileged: bool """ super(Docker, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.privileged = kwargs.get('privileged', None) + self.additional_properties = kwargs.get("additional_properties", None) + self.privileged = kwargs.get("privileged", None) class EncryptionKeyVaultProperties(msrest.serialization.Model): @@ -8523,20 +8540,17 @@ class EncryptionKeyVaultProperties(msrest.serialization.Model): """ _validation = { - 'key_vault_arm_id': {'required': True}, - 'key_identifier': {'required': True}, + "key_vault_arm_id": {"required": True}, + "key_identifier": {"required": True}, } _attribute_map = { - 'key_vault_arm_id': {'key': 'keyVaultArmId', 'type': 'str'}, - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - 'identity_client_id': {'key': 'identityClientId', 'type': 'str'}, + "key_vault_arm_id": {"key": "keyVaultArmId", "type": "str"}, + "key_identifier": {"key": "keyIdentifier", "type": "str"}, + "identity_client_id": {"key": "identityClientId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword key_vault_arm_id: Required. The ArmId of the keyVault where the customer owned encryption key is present. @@ -8548,9 +8562,9 @@ def __init__( :paramtype identity_client_id: str """ super(EncryptionKeyVaultProperties, self).__init__(**kwargs) - self.key_vault_arm_id = kwargs['key_vault_arm_id'] - self.key_identifier = kwargs['key_identifier'] - self.identity_client_id = kwargs.get('identity_client_id', None) + self.key_vault_arm_id = kwargs["key_vault_arm_id"] + self.key_identifier = kwargs["key_identifier"] + self.identity_client_id = kwargs.get("identity_client_id", None) class EncryptionKeyVaultUpdateProperties(msrest.serialization.Model): @@ -8563,23 +8577,20 @@ class EncryptionKeyVaultUpdateProperties(msrest.serialization.Model): """ _validation = { - 'key_identifier': {'required': True}, + "key_identifier": {"required": True}, } _attribute_map = { - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, + "key_identifier": {"key": "keyIdentifier", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword key_identifier: Required. Key Vault uri to access the encryption key. :paramtype key_identifier: str """ super(EncryptionKeyVaultUpdateProperties, self).__init__(**kwargs) - self.key_identifier = kwargs['key_identifier'] + self.key_identifier = kwargs["key_identifier"] class EncryptionProperty(msrest.serialization.Model): @@ -8598,20 +8609,20 @@ class EncryptionProperty(msrest.serialization.Model): """ _validation = { - 'status': {'required': True}, - 'key_vault_properties': {'required': True}, + "status": {"required": True}, + "key_vault_properties": {"required": True}, } _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityForCmk'}, - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'EncryptionKeyVaultProperties'}, + "status": {"key": "status", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityForCmk"}, + "key_vault_properties": { + "key": "keyVaultProperties", + "type": "EncryptionKeyVaultProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword status: Required. Indicates whether or not the encryption is enabled for the workspace. Possible values include: "Enabled", "Disabled". @@ -8624,9 +8635,9 @@ def __init__( ~azure.mgmt.machinelearningservices.models.EncryptionKeyVaultProperties """ super(EncryptionProperty, self).__init__(**kwargs) - self.status = kwargs['status'] - self.identity = kwargs.get('identity', None) - self.key_vault_properties = kwargs['key_vault_properties'] + self.status = kwargs["status"] + self.identity = kwargs.get("identity", None) + self.key_vault_properties = kwargs["key_vault_properties"] class EncryptionUpdateProperties(msrest.serialization.Model): @@ -8640,24 +8651,24 @@ class EncryptionUpdateProperties(msrest.serialization.Model): """ _validation = { - 'key_vault_properties': {'required': True}, + "key_vault_properties": {"required": True}, } _attribute_map = { - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'EncryptionKeyVaultUpdateProperties'}, + "key_vault_properties": { + "key": "keyVaultProperties", + "type": "EncryptionKeyVaultUpdateProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword key_vault_properties: Required. Customer Key vault properties. :paramtype key_vault_properties: ~azure.mgmt.machinelearningservices.models.EncryptionKeyVaultUpdateProperties """ super(EncryptionUpdateProperties, self).__init__(**kwargs) - self.key_vault_properties = kwargs['key_vault_properties'] + self.key_vault_properties = kwargs["key_vault_properties"] class Endpoint(msrest.serialization.Model): @@ -8677,17 +8688,14 @@ class Endpoint(msrest.serialization.Model): """ _attribute_map = { - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'int'}, - 'published': {'key': 'published', 'type': 'int'}, - 'host_ip': {'key': 'hostIp', 'type': 'str'}, + "protocol": {"key": "protocol", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "target": {"key": "target", "type": "int"}, + "published": {"key": "published", "type": "int"}, + "host_ip": {"key": "hostIp", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword protocol: Protocol over which communication will happen over this endpoint. Possible values include: "tcp", "udp", "http". Default value: "tcp". @@ -8702,11 +8710,11 @@ def __init__( :paramtype host_ip: str """ super(Endpoint, self).__init__(**kwargs) - self.protocol = kwargs.get('protocol', "tcp") - self.name = kwargs.get('name', None) - self.target = kwargs.get('target', None) - self.published = kwargs.get('published', None) - self.host_ip = kwargs.get('host_ip', None) + self.protocol = kwargs.get("protocol", "tcp") + self.name = kwargs.get("name", None) + self.target = kwargs.get("target", None) + self.published = kwargs.get("published", None) + self.host_ip = kwargs.get("host_ip", None) class EndpointAuthKeys(msrest.serialization.Model): @@ -8719,14 +8727,11 @@ class EndpointAuthKeys(msrest.serialization.Model): """ _attribute_map = { - 'primary_key': {'key': 'primaryKey', 'type': 'str'}, - 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, + "primary_key": {"key": "primaryKey", "type": "str"}, + "secondary_key": {"key": "secondaryKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword primary_key: The primary key. :paramtype primary_key: str @@ -8734,8 +8739,8 @@ def __init__( :paramtype secondary_key: str """ super(EndpointAuthKeys, self).__init__(**kwargs) - self.primary_key = kwargs.get('primary_key', None) - self.secondary_key = kwargs.get('secondary_key', None) + self.primary_key = kwargs.get("primary_key", None) + self.secondary_key = kwargs.get("secondary_key", None) class EndpointAuthToken(msrest.serialization.Model): @@ -8752,16 +8757,16 @@ class EndpointAuthToken(msrest.serialization.Model): """ _attribute_map = { - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'expiry_time_utc': {'key': 'expiryTimeUtc', 'type': 'long'}, - 'refresh_after_time_utc': {'key': 'refreshAfterTimeUtc', 'type': 'long'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, + "access_token": {"key": "accessToken", "type": "str"}, + "expiry_time_utc": {"key": "expiryTimeUtc", "type": "long"}, + "refresh_after_time_utc": { + "key": "refreshAfterTimeUtc", + "type": "long", + }, + "token_type": {"key": "tokenType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword access_token: Access token for endpoint authentication. :paramtype access_token: str @@ -8773,10 +8778,10 @@ def __init__( :paramtype token_type: str """ super(EndpointAuthToken, self).__init__(**kwargs) - self.access_token = kwargs.get('access_token', None) - self.expiry_time_utc = kwargs.get('expiry_time_utc', 0) - self.refresh_after_time_utc = kwargs.get('refresh_after_time_utc', 0) - self.token_type = kwargs.get('token_type', None) + self.access_token = kwargs.get("access_token", None) + self.expiry_time_utc = kwargs.get("expiry_time_utc", 0) + self.refresh_after_time_utc = kwargs.get("refresh_after_time_utc", 0) + self.token_type = kwargs.get("token_type", None) class ScheduleActionBase(msrest.serialization.Model): @@ -8793,23 +8798,22 @@ class ScheduleActionBase(msrest.serialization.Model): """ _validation = { - 'action_type': {'required': True}, + "action_type": {"required": True}, } _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, + "action_type": {"key": "actionType", "type": "str"}, } _subtype_map = { - 'action_type': {'CreateJob': 'JobScheduleAction', 'InvokeBatchEndpoint': 'EndpointScheduleAction'} + "action_type": { + "CreateJob": "JobScheduleAction", + "InvokeBatchEndpoint": "EndpointScheduleAction", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ScheduleActionBase, self).__init__(**kwargs) self.action_type = None # type: Optional[str] @@ -8824,41 +8828,43 @@ class EndpointScheduleAction(ScheduleActionBase): :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType :ivar endpoint_invocation_definition: Required. [Required] Defines Schedule action definition details. - - + + .. raw:: html - + . :vartype endpoint_invocation_definition: any """ _validation = { - 'action_type': {'required': True}, - 'endpoint_invocation_definition': {'required': True}, + "action_type": {"required": True}, + "endpoint_invocation_definition": {"required": True}, } _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'endpoint_invocation_definition': {'key': 'endpointInvocationDefinition', 'type': 'object'}, + "action_type": {"key": "actionType", "type": "str"}, + "endpoint_invocation_definition": { + "key": "endpointInvocationDefinition", + "type": "object", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword endpoint_invocation_definition: Required. [Required] Defines Schedule action definition details. - - + + .. raw:: html - + . :paramtype endpoint_invocation_definition: any """ super(EndpointScheduleAction, self).__init__(**kwargs) - self.action_type = 'InvokeBatchEndpoint' # type: str - self.endpoint_invocation_definition = kwargs['endpoint_invocation_definition'] + self.action_type = "InvokeBatchEndpoint" # type: str + self.endpoint_invocation_definition = kwargs[ + "endpoint_invocation_definition" + ] class EnvironmentContainer(Resource): @@ -8884,32 +8890,32 @@ class EnvironmentContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "EnvironmentContainerProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerProperties """ super(EnvironmentContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class EnvironmentContainerProperties(AssetContainer): @@ -8936,25 +8942,22 @@ class EnvironmentContainerProperties(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -8969,7 +8972,9 @@ def __init__( self.provisioning_state = None -class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model): +class EnvironmentContainerResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of EnvironmentContainer entities. :ivar next_link: The link to the next page of EnvironmentContainer objects. If null, there are @@ -8980,14 +8985,11 @@ class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model) """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[EnvironmentContainer]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of EnvironmentContainer objects. If null, there are no additional pages. @@ -8995,9 +8997,11 @@ def __init__( :keyword value: An array of objects of type EnvironmentContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] """ - super(EnvironmentContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(EnvironmentContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class EnvironmentVariable(msrest.serialization.Model): @@ -9014,15 +9018,12 @@ class EnvironmentVariable(msrest.serialization.Model): """ _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "additional_properties": {"key": "", "type": "{object}"}, + "type": {"key": "type", "type": "str"}, + "value": {"key": "value", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword additional_properties: Unmatched properties from the message are deserialized to this collection. @@ -9034,9 +9035,9 @@ def __init__( :paramtype value: str """ super(EnvironmentVariable, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.type = kwargs.get('type', "local") - self.value = kwargs.get('value', None) + self.additional_properties = kwargs.get("additional_properties", None) + self.type = kwargs.get("type", "local") + self.value = kwargs.get("value", None) class EnvironmentVersion(Resource): @@ -9062,31 +9063,31 @@ class EnvironmentVersion(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentVersionProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "EnvironmentVersionProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionProperties """ super(EnvironmentVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class EnvironmentVersionProperties(AssetBase): @@ -9108,29 +9109,29 @@ class EnvironmentVersionProperties(AssetBase): :vartype build: ~azure.mgmt.machinelearningservices.models.BuildContext :ivar conda_file: Standard configuration file used by Conda that lets you install any kind of package, including Python, R, and C/C++ packages. - - + + .. raw:: html - + . :vartype conda_file: str :ivar environment_type: Environment type is either user managed or curated by the Azure ML service - - + + .. raw:: html - + . Possible values include: "Curated", "UserCreated". :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType :ivar image: Name of the image that will be used for the environment. - - + + .. raw:: html - + . @@ -9147,29 +9148,29 @@ class EnvironmentVersionProperties(AssetBase): """ _validation = { - 'environment_type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "environment_type": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'build': {'key': 'build', 'type': 'BuildContext'}, - 'conda_file': {'key': 'condaFile', 'type': 'str'}, - 'environment_type': {'key': 'environmentType', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'str'}, - 'inference_config': {'key': 'inferenceConfig', 'type': 'InferenceContainerProperties'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "build": {"key": "build", "type": "BuildContext"}, + "conda_file": {"key": "condaFile", "type": "str"}, + "environment_type": {"key": "environmentType", "type": "str"}, + "image": {"key": "image", "type": "str"}, + "inference_config": { + "key": "inferenceConfig", + "type": "InferenceContainerProperties", + }, + "os_type": {"key": "osType", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -9185,19 +9186,19 @@ def __init__( :paramtype build: ~azure.mgmt.machinelearningservices.models.BuildContext :keyword conda_file: Standard configuration file used by Conda that lets you install any kind of package, including Python, R, and C/C++ packages. - - + + .. raw:: html - + . :paramtype conda_file: str :keyword image: Name of the image that will be used for the environment. - - + + .. raw:: html - + . @@ -9209,12 +9210,12 @@ def __init__( :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.OperatingSystemType """ super(EnvironmentVersionProperties, self).__init__(**kwargs) - self.build = kwargs.get('build', None) - self.conda_file = kwargs.get('conda_file', None) + self.build = kwargs.get("build", None) + self.conda_file = kwargs.get("conda_file", None) self.environment_type = None - self.image = kwargs.get('image', None) - self.inference_config = kwargs.get('inference_config', None) - self.os_type = kwargs.get('os_type', None) + self.image = kwargs.get("image", None) + self.inference_config = kwargs.get("inference_config", None) + self.os_type = kwargs.get("os_type", None) self.provisioning_state = None @@ -9229,14 +9230,11 @@ class EnvironmentVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentVersion]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[EnvironmentVersion]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of EnvironmentVersion objects. If null, there are no additional pages. @@ -9244,9 +9242,11 @@ def __init__( :keyword value: An array of objects of type EnvironmentVersion. :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] """ - super(EnvironmentVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(EnvironmentVersionResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class ErrorAdditionalInfo(msrest.serialization.Model): @@ -9261,21 +9261,17 @@ class ErrorAdditionalInfo(msrest.serialization.Model): """ _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, + "type": {"readonly": True}, + "info": {"readonly": True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, + "type": {"key": "type", "type": "str"}, + "info": {"key": "info", "type": "object"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ErrorAdditionalInfo, self).__init__(**kwargs) self.type = None self.info = None @@ -9299,27 +9295,26 @@ class ErrorDetail(msrest.serialization.Model): """ _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, + "code": {"readonly": True}, + "message": {"readonly": True}, + "target": {"readonly": True}, + "details": {"readonly": True}, + "additional_info": {"readonly": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[ErrorDetail]"}, + "additional_info": { + "key": "additionalInfo", + "type": "[ErrorAdditionalInfo]", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ErrorDetail, self).__init__(**kwargs) self.code = None self.message = None @@ -9336,19 +9331,16 @@ class ErrorResponse(msrest.serialization.Model): """ _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, + "error": {"key": "error", "type": "ErrorDetail"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword error: The error object. :paramtype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail """ super(ErrorResponse, self).__init__(**kwargs) - self.error = kwargs.get('error', None) + self.error = kwargs.get("error", None) class EstimatedVMPrice(msrest.serialization.Model): @@ -9367,21 +9359,18 @@ class EstimatedVMPrice(msrest.serialization.Model): """ _validation = { - 'retail_price': {'required': True}, - 'os_type': {'required': True}, - 'vm_tier': {'required': True}, + "retail_price": {"required": True}, + "os_type": {"required": True}, + "vm_tier": {"required": True}, } _attribute_map = { - 'retail_price': {'key': 'retailPrice', 'type': 'float'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_tier': {'key': 'vmTier', 'type': 'str'}, + "retail_price": {"key": "retailPrice", "type": "float"}, + "os_type": {"key": "osType", "type": "str"}, + "vm_tier": {"key": "vmTier", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword retail_price: Required. The price charged for using the VM. :paramtype retail_price: float @@ -9393,9 +9382,9 @@ def __init__( :paramtype vm_tier: str or ~azure.mgmt.machinelearningservices.models.VMTier """ super(EstimatedVMPrice, self).__init__(**kwargs) - self.retail_price = kwargs['retail_price'] - self.os_type = kwargs['os_type'] - self.vm_tier = kwargs['vm_tier'] + self.retail_price = kwargs["retail_price"] + self.os_type = kwargs["os_type"] + self.vm_tier = kwargs["vm_tier"] class EstimatedVMPrices(msrest.serialization.Model): @@ -9415,21 +9404,18 @@ class EstimatedVMPrices(msrest.serialization.Model): """ _validation = { - 'billing_currency': {'required': True}, - 'unit_of_measure': {'required': True}, - 'values': {'required': True}, + "billing_currency": {"required": True}, + "unit_of_measure": {"required": True}, + "values": {"required": True}, } _attribute_map = { - 'billing_currency': {'key': 'billingCurrency', 'type': 'str'}, - 'unit_of_measure': {'key': 'unitOfMeasure', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[EstimatedVMPrice]'}, + "billing_currency": {"key": "billingCurrency", "type": "str"}, + "unit_of_measure": {"key": "unitOfMeasure", "type": "str"}, + "values": {"key": "values", "type": "[EstimatedVMPrice]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword billing_currency: Required. Three lettered code specifying the currency of the VM price. Example: USD. Possible values include: "USD". @@ -9442,9 +9428,9 @@ def __init__( :paramtype values: list[~azure.mgmt.machinelearningservices.models.EstimatedVMPrice] """ super(EstimatedVMPrices, self).__init__(**kwargs) - self.billing_currency = kwargs['billing_currency'] - self.unit_of_measure = kwargs['unit_of_measure'] - self.values = kwargs['values'] + self.billing_currency = kwargs["billing_currency"] + self.unit_of_measure = kwargs["unit_of_measure"] + self.values = kwargs["values"] class ExternalFQDNResponse(msrest.serialization.Model): @@ -9455,19 +9441,16 @@ class ExternalFQDNResponse(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[FQDNEndpoints]'}, + "value": {"key": "value", "type": "[FQDNEndpoints]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: :paramtype value: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoints] """ super(ExternalFQDNResponse, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class FeaturizationSettings(msrest.serialization.Model): @@ -9478,19 +9461,16 @@ class FeaturizationSettings(msrest.serialization.Model): """ _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, + "dataset_language": {"key": "datasetLanguage", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword dataset_language: Dataset language, useful for the text data. :paramtype dataset_language: str """ super(FeaturizationSettings, self).__init__(**kwargs) - self.dataset_language = kwargs.get('dataset_language', None) + self.dataset_language = kwargs.get("dataset_language", None) class FlavorData(msrest.serialization.Model): @@ -9501,19 +9481,16 @@ class FlavorData(msrest.serialization.Model): """ _attribute_map = { - 'data': {'key': 'data', 'type': '{str}'}, + "data": {"key": "data", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data: Model flavor-specific data. :paramtype data: dict[str, str] """ super(FlavorData, self).__init__(**kwargs) - self.data = kwargs.get('data', None) + self.data = kwargs.get("data", None) class Forecasting(AutoMLVertical, TableVertical): @@ -9582,36 +9559,63 @@ class Forecasting(AutoMLVertical, TableVertical): """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'forecasting_settings': {'key': 'forecastingSettings', 'type': 'ForecastingSettings'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'ForecastingTrainingSettings'}, - } - - def __init__( - self, - **kwargs - ): + "task_type": {"required": True}, + "training_data": {"required": True}, + } + + _attribute_map = { + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "TableFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "search_space": { + "key": "searchSpace", + "type": "[TableParameterSubspace]", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "TableSweepSettings", + }, + "test_data": {"key": "testData", "type": "MLTableJobInput"}, + "test_data_size": {"key": "testDataSize", "type": "float"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "weight_column_name": {"key": "weightColumnName", "type": "str"}, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "forecasting_settings": { + "key": "forecastingSettings", + "type": "ForecastingSettings", + }, + "primary_metric": {"key": "primaryMetric", "type": "str"}, + "training_settings": { + "key": "trainingSettings", + "type": "ForecastingTrainingSettings", + }, + } + + def __init__(self, **kwargs): """ :keyword cv_split_column_names: Columns to use for CVSplit data. :paramtype cv_split_column_names: list[str] @@ -9671,25 +9675,27 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ForecastingTrainingSettings """ super(Forecasting, self).__init__(**kwargs) - self.cv_split_column_names = kwargs.get('cv_split_column_names', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.test_data = kwargs.get('test_data', None) - self.test_data_size = kwargs.get('test_data_size', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.weight_column_name = kwargs.get('weight_column_name', None) - self.task_type = 'Forecasting' # type: str - self.forecasting_settings = kwargs.get('forecasting_settings', None) - self.primary_metric = kwargs.get('primary_metric', None) - self.training_settings = kwargs.get('training_settings', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.cv_split_column_names = kwargs.get("cv_split_column_names", None) + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.fixed_parameters = kwargs.get("fixed_parameters", None) + self.limit_settings = kwargs.get("limit_settings", None) + self.n_cross_validations = kwargs.get("n_cross_validations", None) + self.search_space = kwargs.get("search_space", None) + self.sweep_settings = kwargs.get("sweep_settings", None) + self.test_data = kwargs.get("test_data", None) + self.test_data_size = kwargs.get("test_data_size", None) + self.validation_data = kwargs.get("validation_data", None) + self.validation_data_size = kwargs.get("validation_data_size", None) + self.weight_column_name = kwargs.get("weight_column_name", None) + self.task_type = "Forecasting" # type: str + self.forecasting_settings = kwargs.get("forecasting_settings", None) + self.primary_metric = kwargs.get("primary_metric", None) + self.training_settings = kwargs.get("training_settings", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class ForecastingSettings(msrest.serialization.Model): @@ -9747,25 +9753,40 @@ class ForecastingSettings(msrest.serialization.Model): """ _attribute_map = { - 'country_or_region_for_holidays': {'key': 'countryOrRegionForHolidays', 'type': 'str'}, - 'cv_step_size': {'key': 'cvStepSize', 'type': 'int'}, - 'feature_lags': {'key': 'featureLags', 'type': 'str'}, - 'forecast_horizon': {'key': 'forecastHorizon', 'type': 'ForecastHorizon'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'seasonality': {'key': 'seasonality', 'type': 'Seasonality'}, - 'short_series_handling_config': {'key': 'shortSeriesHandlingConfig', 'type': 'str'}, - 'target_aggregate_function': {'key': 'targetAggregateFunction', 'type': 'str'}, - 'target_lags': {'key': 'targetLags', 'type': 'TargetLags'}, - 'target_rolling_window_size': {'key': 'targetRollingWindowSize', 'type': 'TargetRollingWindowSize'}, - 'time_column_name': {'key': 'timeColumnName', 'type': 'str'}, - 'time_series_id_column_names': {'key': 'timeSeriesIdColumnNames', 'type': '[str]'}, - 'use_stl': {'key': 'useStl', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + "country_or_region_for_holidays": { + "key": "countryOrRegionForHolidays", + "type": "str", + }, + "cv_step_size": {"key": "cvStepSize", "type": "int"}, + "feature_lags": {"key": "featureLags", "type": "str"}, + "forecast_horizon": { + "key": "forecastHorizon", + "type": "ForecastHorizon", + }, + "frequency": {"key": "frequency", "type": "str"}, + "seasonality": {"key": "seasonality", "type": "Seasonality"}, + "short_series_handling_config": { + "key": "shortSeriesHandlingConfig", + "type": "str", + }, + "target_aggregate_function": { + "key": "targetAggregateFunction", + "type": "str", + }, + "target_lags": {"key": "targetLags", "type": "TargetLags"}, + "target_rolling_window_size": { + "key": "targetRollingWindowSize", + "type": "TargetRollingWindowSize", + }, + "time_column_name": {"key": "timeColumnName", "type": "str"}, + "time_series_id_column_names": { + "key": "timeSeriesIdColumnNames", + "type": "[str]", + }, + "use_stl": {"key": "useStl", "type": "str"}, + } + + def __init__(self, **kwargs): """ :keyword country_or_region_for_holidays: Country or region for holidays for forecasting tasks. These should be ISO 3166 two-letter country/region codes, for example 'US' or 'GB'. @@ -9820,19 +9841,29 @@ def __init__( :paramtype use_stl: str or ~azure.mgmt.machinelearningservices.models.UseStl """ super(ForecastingSettings, self).__init__(**kwargs) - self.country_or_region_for_holidays = kwargs.get('country_or_region_for_holidays', None) - self.cv_step_size = kwargs.get('cv_step_size', None) - self.feature_lags = kwargs.get('feature_lags', None) - self.forecast_horizon = kwargs.get('forecast_horizon', None) - self.frequency = kwargs.get('frequency', None) - self.seasonality = kwargs.get('seasonality', None) - self.short_series_handling_config = kwargs.get('short_series_handling_config', None) - self.target_aggregate_function = kwargs.get('target_aggregate_function', None) - self.target_lags = kwargs.get('target_lags', None) - self.target_rolling_window_size = kwargs.get('target_rolling_window_size', None) - self.time_column_name = kwargs.get('time_column_name', None) - self.time_series_id_column_names = kwargs.get('time_series_id_column_names', None) - self.use_stl = kwargs.get('use_stl', None) + self.country_or_region_for_holidays = kwargs.get( + "country_or_region_for_holidays", None + ) + self.cv_step_size = kwargs.get("cv_step_size", None) + self.feature_lags = kwargs.get("feature_lags", None) + self.forecast_horizon = kwargs.get("forecast_horizon", None) + self.frequency = kwargs.get("frequency", None) + self.seasonality = kwargs.get("seasonality", None) + self.short_series_handling_config = kwargs.get( + "short_series_handling_config", None + ) + self.target_aggregate_function = kwargs.get( + "target_aggregate_function", None + ) + self.target_lags = kwargs.get("target_lags", None) + self.target_rolling_window_size = kwargs.get( + "target_rolling_window_size", None + ) + self.time_column_name = kwargs.get("time_column_name", None) + self.time_series_id_column_names = kwargs.get( + "time_series_id_column_names", None + ) + self.use_stl = kwargs.get("use_stl", None) class ForecastingTrainingSettings(TrainingSettings): @@ -9864,21 +9895,39 @@ class ForecastingTrainingSettings(TrainingSettings): """ _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): + "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, + "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, + "allowed_training_algorithms": { + "key": "allowedTrainingAlgorithms", + "type": "[str]", + }, + "blocked_training_algorithms": { + "key": "blockedTrainingAlgorithms", + "type": "[str]", + }, + } + + def __init__(self, **kwargs): """ :keyword enable_dnn_training: Enable recommendation of DNN models. :paramtype enable_dnn_training: bool @@ -9905,8 +9954,12 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ForecastingModels] """ super(ForecastingTrainingSettings, self).__init__(**kwargs) - self.allowed_training_algorithms = kwargs.get('allowed_training_algorithms', None) - self.blocked_training_algorithms = kwargs.get('blocked_training_algorithms', None) + self.allowed_training_algorithms = kwargs.get( + "allowed_training_algorithms", None + ) + self.blocked_training_algorithms = kwargs.get( + "blocked_training_algorithms", None + ) class FQDNEndpoint(msrest.serialization.Model): @@ -9919,14 +9972,14 @@ class FQDNEndpoint(msrest.serialization.Model): """ _attribute_map = { - 'domain_name': {'key': 'domainName', 'type': 'str'}, - 'endpoint_details': {'key': 'endpointDetails', 'type': '[FQDNEndpointDetail]'}, + "domain_name": {"key": "domainName", "type": "str"}, + "endpoint_details": { + "key": "endpointDetails", + "type": "[FQDNEndpointDetail]", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword domain_name: :paramtype domain_name: str @@ -9935,8 +9988,8 @@ def __init__( list[~azure.mgmt.machinelearningservices.models.FQDNEndpointDetail] """ super(FQDNEndpoint, self).__init__(**kwargs) - self.domain_name = kwargs.get('domain_name', None) - self.endpoint_details = kwargs.get('endpoint_details', None) + self.domain_name = kwargs.get("domain_name", None) + self.endpoint_details = kwargs.get("endpoint_details", None) class FQDNEndpointDetail(msrest.serialization.Model): @@ -9947,19 +10000,16 @@ class FQDNEndpointDetail(msrest.serialization.Model): """ _attribute_map = { - 'port': {'key': 'port', 'type': 'int'}, + "port": {"key": "port", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword port: :paramtype port: int """ super(FQDNEndpointDetail, self).__init__(**kwargs) - self.port = kwargs.get('port', None) + self.port = kwargs.get("port", None) class FQDNEndpoints(msrest.serialization.Model): @@ -9970,19 +10020,16 @@ class FQDNEndpoints(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'FQDNEndpointsProperties'}, + "properties": {"key": "properties", "type": "FQDNEndpointsProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: :paramtype properties: ~azure.mgmt.machinelearningservices.models.FQDNEndpointsProperties """ super(FQDNEndpoints, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class FQDNEndpointsProperties(msrest.serialization.Model): @@ -9995,14 +10042,11 @@ class FQDNEndpointsProperties(msrest.serialization.Model): """ _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'endpoints': {'key': 'endpoints', 'type': '[FQDNEndpoint]'}, + "category": {"key": "category", "type": "str"}, + "endpoints": {"key": "endpoints", "type": "[FQDNEndpoint]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: :paramtype category: str @@ -10010,8 +10054,8 @@ def __init__( :paramtype endpoints: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoint] """ super(FQDNEndpointsProperties, self).__init__(**kwargs) - self.category = kwargs.get('category', None) - self.endpoints = kwargs.get('endpoints', None) + self.category = kwargs.get("category", None) + self.endpoints = kwargs.get("endpoints", None) class GridSamplingAlgorithm(SamplingAlgorithm): @@ -10027,21 +10071,20 @@ class GridSamplingAlgorithm(SamplingAlgorithm): """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(GridSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Grid' # type: str + self.sampling_algorithm_type = "Grid" # type: str class HdfsDatastore(DatastoreProperties): @@ -10076,28 +10119,28 @@ class HdfsDatastore(DatastoreProperties): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'name_node_address': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "name_node_address": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'hdfs_server_certificate': {'key': 'hdfsServerCertificate', 'type': 'str'}, - 'name_node_address': {'key': 'nameNodeAddress', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "hdfs_server_certificate": { + "key": "hdfsServerCertificate", + "type": "str", + }, + "name_node_address": {"key": "nameNodeAddress", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -10116,10 +10159,12 @@ def __init__( :paramtype protocol: str """ super(HdfsDatastore, self).__init__(**kwargs) - self.datastore_type = 'Hdfs' # type: str - self.hdfs_server_certificate = kwargs.get('hdfs_server_certificate', None) - self.name_node_address = kwargs['name_node_address'] - self.protocol = kwargs.get('protocol', "http") + self.datastore_type = "Hdfs" # type: str + self.hdfs_server_certificate = kwargs.get( + "hdfs_server_certificate", None + ) + self.name_node_address = kwargs["name_node_address"] + self.protocol = kwargs.get("protocol", "http") class HDInsightSchema(msrest.serialization.Model): @@ -10130,19 +10175,16 @@ class HDInsightSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, + "properties": {"key": "properties", "type": "HDInsightProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: HDInsight compute properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties """ super(HDInsightSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class HDInsight(Compute, HDInsightSchema): @@ -10184,34 +10226,34 @@ class HDInsight(Compute, HDInsightSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + "disable_local_auth": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "HDInsightProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: HDInsight compute properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties @@ -10221,14 +10263,14 @@ def __init__( :paramtype resource_id: str """ super(HDInsight, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'HDInsight' # type: str + self.properties = kwargs.get("properties", None) + self.compute_type = "HDInsight" # type: str self.compute_location = None self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None self.disable_local_auth = None @@ -10247,15 +10289,15 @@ class HDInsightProperties(msrest.serialization.Model): """ _attribute_map = { - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, + "ssh_port": {"key": "sshPort", "type": "int"}, + "address": {"key": "address", "type": "str"}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword ssh_port: Port open for ssh connections on the master node of the cluster. :paramtype ssh_port: int @@ -10266,9 +10308,9 @@ def __init__( ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials """ super(HDInsightProperties, self).__init__(**kwargs) - self.ssh_port = kwargs.get('ssh_port', None) - self.address = kwargs.get('address', None) - self.administrator_account = kwargs.get('administrator_account', None) + self.ssh_port = kwargs.get("ssh_port", None) + self.address = kwargs.get("address", None) + self.administrator_account = kwargs.get("administrator_account", None) class IdAssetReference(AssetReferenceBase): @@ -10284,26 +10326,23 @@ class IdAssetReference(AssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, - 'asset_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "reference_type": {"required": True}, + "asset_id": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'asset_id': {'key': 'assetId', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "asset_id": {"key": "assetId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword asset_id: Required. [Required] ARM resource ID of the asset. :paramtype asset_id: str """ super(IdAssetReference, self).__init__(**kwargs) - self.reference_type = 'Id' # type: str - self.asset_id = kwargs['asset_id'] + self.reference_type = "Id" # type: str + self.asset_id = kwargs["asset_id"] class IdentityForCmk(msrest.serialization.Model): @@ -10315,20 +10354,22 @@ class IdentityForCmk(msrest.serialization.Model): """ _attribute_map = { - 'user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, + "user_assigned_identity": { + "key": "userAssignedIdentity", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword user_assigned_identity: The ArmId of the user assigned identity that will be used to access the customer managed key vault. :paramtype user_assigned_identity: str """ super(IdentityForCmk, self).__init__(**kwargs) - self.user_assigned_identity = kwargs.get('user_assigned_identity', None) + self.user_assigned_identity = kwargs.get( + "user_assigned_identity", None + ) class IdleShutdownSetting(msrest.serialization.Model): @@ -10340,20 +10381,22 @@ class IdleShutdownSetting(msrest.serialization.Model): """ _attribute_map = { - 'idle_time_before_shutdown': {'key': 'idleTimeBeforeShutdown', 'type': 'str'}, + "idle_time_before_shutdown": { + "key": "idleTimeBeforeShutdown", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword idle_time_before_shutdown: Time is defined in ISO8601 format. Minimum is 15 min, maximum is 3 days. :paramtype idle_time_before_shutdown: str """ super(IdleShutdownSetting, self).__init__(**kwargs) - self.idle_time_before_shutdown = kwargs.get('idle_time_before_shutdown', None) + self.idle_time_before_shutdown = kwargs.get( + "idle_time_before_shutdown", None + ) class Image(msrest.serialization.Model): @@ -10370,15 +10413,12 @@ class Image(msrest.serialization.Model): """ _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'reference': {'key': 'reference', 'type': 'str'}, + "additional_properties": {"key": "", "type": "{object}"}, + "type": {"key": "type", "type": "str"}, + "reference": {"key": "reference", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword additional_properties: Unmatched properties from the message are deserialized to this collection. @@ -10390,45 +10430,51 @@ def __init__( :paramtype reference: str """ super(Image, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.type = kwargs.get('type', "docker") - self.reference = kwargs.get('reference', None) + self.additional_properties = kwargs.get("additional_properties", None) + self.type = kwargs.get("type", "docker") + self.reference = kwargs.get("reference", None) class ImageVertical(msrest.serialization.Model): """Abstract class for AutoML tasks that train image (computer vision) models - -such as Image Classification / Image Classification Multilabel / Image Object Detection / Image Instance Segmentation. + such as Image Classification / Image Classification Multilabel / Image Object Detection / Image Instance Segmentation. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float """ _validation = { - 'limit_settings': {'required': True}, + "limit_settings": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings @@ -10443,10 +10489,10 @@ def __init__( :paramtype validation_data_size: float """ super(ImageVertical, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) + self.limit_settings = kwargs["limit_settings"] + self.sweep_settings = kwargs.get("sweep_settings", None) + self.validation_data = kwargs.get("validation_data", None) + self.validation_data_size = kwargs.get("validation_data_size", None) class ImageClassificationBase(ImageVertical): @@ -10475,22 +10521,34 @@ class ImageClassificationBase(ImageVertical): """ _validation = { - 'limit_settings': {'required': True}, + "limit_settings": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsClassification", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsClassification]", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings @@ -10512,78 +10570,90 @@ def __init__( list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] """ super(ImageClassificationBase, self).__init__(**kwargs) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) + self.model_settings = kwargs.get("model_settings", None) + self.search_space = kwargs.get("search_space", None) class ImageClassification(AutoMLVertical, ImageClassificationBase): """Image Classification. Multi-class image classification is used when an image is classified with only a single label -from a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' or a 'duck'. + from a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' or a 'duck'. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, + "limit_settings": {"required": True}, + "task_type": {"required": True}, + "training_data": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsClassification", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsClassification]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings @@ -10618,87 +10688,99 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ super(ImageClassification, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageClassification' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.limit_settings = kwargs["limit_settings"] + self.sweep_settings = kwargs.get("sweep_settings", None) + self.validation_data = kwargs.get("validation_data", None) + self.validation_data_size = kwargs.get("validation_data_size", None) + self.model_settings = kwargs.get("model_settings", None) + self.search_space = kwargs.get("search_space", None) + self.task_type = "ImageClassification" # type: str + self.primary_metric = kwargs.get("primary_metric", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class ImageClassificationMultilabel(AutoMLVertical, ImageClassificationBase): """Image Classification Multilabel. Multi-label image classification is used when an image could have one or more labels -from a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'. + from a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted", "IOU". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics """ _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, + "limit_settings": {"required": True}, + "task_type": {"required": True}, + "training_data": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsClassification", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsClassification]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings @@ -10733,17 +10815,17 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics """ super(ImageClassificationMultilabel, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageClassificationMultilabel' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.limit_settings = kwargs["limit_settings"] + self.sweep_settings = kwargs.get("sweep_settings", None) + self.validation_data = kwargs.get("validation_data", None) + self.validation_data_size = kwargs.get("validation_data_size", None) + self.model_settings = kwargs.get("model_settings", None) + self.search_space = kwargs.get("search_space", None) + self.task_type = "ImageClassificationMultilabel" # type: str + self.primary_metric = kwargs.get("primary_metric", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class ImageObjectDetectionBase(ImageVertical): @@ -10772,22 +10854,34 @@ class ImageObjectDetectionBase(ImageVertical): """ _validation = { - 'limit_settings': {'required': True}, + "limit_settings": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsObjectDetection", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsObjectDetection]", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings @@ -10809,77 +10903,89 @@ def __init__( list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] """ super(ImageObjectDetectionBase, self).__init__(**kwargs) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) + self.model_settings = kwargs.get("model_settings", None) + self.search_space = kwargs.get("search_space", None) class ImageInstanceSegmentation(AutoMLVertical, ImageObjectDetectionBase): """Image Instance Segmentation. Instance segmentation is used to identify objects in an image at the pixel level, -drawing a polygon around each object in the image. + drawing a polygon around each object in the image. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "MeanAveragePrecision". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics """ _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, + "limit_settings": {"required": True}, + "task_type": {"required": True}, + "training_data": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsObjectDetection", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsObjectDetection]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings @@ -10913,17 +11019,17 @@ def __init__( ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics """ super(ImageInstanceSegmentation, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageInstanceSegmentation' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.limit_settings = kwargs["limit_settings"] + self.sweep_settings = kwargs.get("sweep_settings", None) + self.validation_data = kwargs.get("validation_data", None) + self.validation_data_size = kwargs.get("validation_data_size", None) + self.model_settings = kwargs.get("model_settings", None) + self.search_space = kwargs.get("search_space", None) + self.task_type = "ImageInstanceSegmentation" # type: str + self.primary_metric = kwargs.get("primary_metric", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class ImageLimitSettings(msrest.serialization.Model): @@ -10938,15 +11044,12 @@ class ImageLimitSettings(msrest.serialization.Model): """ _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_trials": {"key": "maxTrials", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword max_concurrent_trials: Maximum number of concurrent AutoML iterations. :paramtype max_concurrent_trials: int @@ -10956,9 +11059,9 @@ def __init__( :paramtype timeout: ~datetime.timedelta """ super(ImageLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', 1) - self.max_trials = kwargs.get('max_trials', 1) - self.timeout = kwargs.get('timeout', "P7D") + self.max_concurrent_trials = kwargs.get("max_concurrent_trials", 1) + self.max_trials = kwargs.get("max_trials", 1) + self.timeout = kwargs.get("timeout", "P7D") class ImageMetadata(msrest.serialization.Model): @@ -10975,15 +11078,15 @@ class ImageMetadata(msrest.serialization.Model): """ _attribute_map = { - 'current_image_version': {'key': 'currentImageVersion', 'type': 'str'}, - 'latest_image_version': {'key': 'latestImageVersion', 'type': 'str'}, - 'is_latest_os_image_version': {'key': 'isLatestOsImageVersion', 'type': 'bool'}, + "current_image_version": {"key": "currentImageVersion", "type": "str"}, + "latest_image_version": {"key": "latestImageVersion", "type": "str"}, + "is_latest_os_image_version": { + "key": "isLatestOsImageVersion", + "type": "bool", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword current_image_version: Specifies the current operating system image version this compute instance is running on. @@ -10995,143 +11098,160 @@ def __init__( :paramtype is_latest_os_image_version: bool """ super(ImageMetadata, self).__init__(**kwargs) - self.current_image_version = kwargs.get('current_image_version', None) - self.latest_image_version = kwargs.get('latest_image_version', None) - self.is_latest_os_image_version = kwargs.get('is_latest_os_image_version', None) + self.current_image_version = kwargs.get("current_image_version", None) + self.latest_image_version = kwargs.get("latest_image_version", None) + self.is_latest_os_image_version = kwargs.get( + "is_latest_os_image_version", None + ) class ImageModelDistributionSettings(msrest.serialization.Model): """Distribution expressions to sweep over values of model settings. -:code:` -Some examples are: - -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -` -All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) -where distribution name can be: uniform, quniform, loguniform, etc -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + :code:` + Some examples are: + + ModelName = "choice('seresnext', 'resnest50')"; + LearningRate = "uniform(0.001, 0.01)"; + LayersToFreeze = "choice(0, 2)"; + ` + All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) + where distribution name can be: uniform, quniform, loguniform, etc + For more details on how to compose distribution expressions please check the documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: str + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: str + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: str + :ivar distributed: Whether to use distributer training. + :vartype distributed: str + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: str + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: str + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: str + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: str + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: str + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: str + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: str + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: str + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. + :vartype learning_rate_scheduler: str + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: str + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: str + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: str + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: str + :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. + :vartype optimizer: str + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: str + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: str + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: str + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: str + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: str + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: str + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: str + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: str + """ + + _attribute_map = { + "ams_gradient": {"key": "amsGradient", "type": "str"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "str"}, + "beta2": {"key": "beta2", "type": "str"}, + "distributed": {"key": "distributed", "type": "str"}, + "early_stopping": {"key": "earlyStopping", "type": "str"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "str"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "str", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "str", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "str"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "str", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "str"}, + "nesterov": {"key": "nesterov", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "str"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "str"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "str"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "str"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "str"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "str", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "str", + }, + "weight_decay": {"key": "weightDecay", "type": "str"}, + } + + def __init__(self, **kwargs): """ :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :paramtype ams_gradient: str @@ -11215,183 +11335,215 @@ def __init__( :paramtype weight_decay: str """ super(ImageModelDistributionSettings, self).__init__(**kwargs) - self.ams_gradient = kwargs.get('ams_gradient', None) - self.augmentations = kwargs.get('augmentations', None) - self.beta1 = kwargs.get('beta1', None) - self.beta2 = kwargs.get('beta2', None) - self.distributed = kwargs.get('distributed', None) - self.early_stopping = kwargs.get('early_stopping', None) - self.early_stopping_delay = kwargs.get('early_stopping_delay', None) - self.early_stopping_patience = kwargs.get('early_stopping_patience', None) - self.enable_onnx_normalization = kwargs.get('enable_onnx_normalization', None) - self.evaluation_frequency = kwargs.get('evaluation_frequency', None) - self.gradient_accumulation_step = kwargs.get('gradient_accumulation_step', None) - self.layers_to_freeze = kwargs.get('layers_to_freeze', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.learning_rate_scheduler = kwargs.get('learning_rate_scheduler', None) - self.model_name = kwargs.get('model_name', None) - self.momentum = kwargs.get('momentum', None) - self.nesterov = kwargs.get('nesterov', None) - self.number_of_epochs = kwargs.get('number_of_epochs', None) - self.number_of_workers = kwargs.get('number_of_workers', None) - self.optimizer = kwargs.get('optimizer', None) - self.random_seed = kwargs.get('random_seed', None) - self.step_lr_gamma = kwargs.get('step_lr_gamma', None) - self.step_lr_step_size = kwargs.get('step_lr_step_size', None) - self.training_batch_size = kwargs.get('training_batch_size', None) - self.validation_batch_size = kwargs.get('validation_batch_size', None) - self.warmup_cosine_lr_cycles = kwargs.get('warmup_cosine_lr_cycles', None) - self.warmup_cosine_lr_warmup_epochs = kwargs.get('warmup_cosine_lr_warmup_epochs', None) - self.weight_decay = kwargs.get('weight_decay', None) - - -class ImageModelDistributionSettingsClassification(ImageModelDistributionSettings): + self.ams_gradient = kwargs.get("ams_gradient", None) + self.augmentations = kwargs.get("augmentations", None) + self.beta1 = kwargs.get("beta1", None) + self.beta2 = kwargs.get("beta2", None) + self.distributed = kwargs.get("distributed", None) + self.early_stopping = kwargs.get("early_stopping", None) + self.early_stopping_delay = kwargs.get("early_stopping_delay", None) + self.early_stopping_patience = kwargs.get( + "early_stopping_patience", None + ) + self.enable_onnx_normalization = kwargs.get( + "enable_onnx_normalization", None + ) + self.evaluation_frequency = kwargs.get("evaluation_frequency", None) + self.gradient_accumulation_step = kwargs.get( + "gradient_accumulation_step", None + ) + self.layers_to_freeze = kwargs.get("layers_to_freeze", None) + self.learning_rate = kwargs.get("learning_rate", None) + self.learning_rate_scheduler = kwargs.get( + "learning_rate_scheduler", None + ) + self.model_name = kwargs.get("model_name", None) + self.momentum = kwargs.get("momentum", None) + self.nesterov = kwargs.get("nesterov", None) + self.number_of_epochs = kwargs.get("number_of_epochs", None) + self.number_of_workers = kwargs.get("number_of_workers", None) + self.optimizer = kwargs.get("optimizer", None) + self.random_seed = kwargs.get("random_seed", None) + self.step_lr_gamma = kwargs.get("step_lr_gamma", None) + self.step_lr_step_size = kwargs.get("step_lr_step_size", None) + self.training_batch_size = kwargs.get("training_batch_size", None) + self.validation_batch_size = kwargs.get("validation_batch_size", None) + self.warmup_cosine_lr_cycles = kwargs.get( + "warmup_cosine_lr_cycles", None + ) + self.warmup_cosine_lr_warmup_epochs = kwargs.get( + "warmup_cosine_lr_warmup_epochs", None + ) + self.weight_decay = kwargs.get("weight_decay", None) + + +class ImageModelDistributionSettingsClassification( + ImageModelDistributionSettings +): """Distribution expressions to sweep over values of model settings. -:code:` -Some examples are: - -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: str - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: str - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: str - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'str'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'str'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'str'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + :code:` + Some examples are: + + ModelName = "choice('seresnext', 'resnest50')"; + LearningRate = "uniform(0.001, 0.01)"; + LayersToFreeze = "choice(0, 2)"; + ` + For more details on how to compose distribution expressions please check the documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: str + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: str + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: str + :ivar distributed: Whether to use distributer training. + :vartype distributed: str + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: str + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: str + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: str + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: str + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: str + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: str + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: str + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: str + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. + :vartype learning_rate_scheduler: str + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: str + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: str + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: str + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: str + :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. + :vartype optimizer: str + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: str + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: str + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: str + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: str + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: str + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: str + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: str + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: str + :ivar training_crop_size: Image crop size that is input to the neural network for the training + dataset. Must be a positive integer. + :vartype training_crop_size: str + :ivar validation_crop_size: Image crop size that is input to the neural network for the + validation dataset. Must be a positive integer. + :vartype validation_crop_size: str + :ivar validation_resize_size: Image size to which to resize before cropping for validation + dataset. Must be a positive integer. + :vartype validation_resize_size: str + :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. + 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be + 0 or 1 or 2. + :vartype weighted_loss: str + """ + + _attribute_map = { + "ams_gradient": {"key": "amsGradient", "type": "str"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "str"}, + "beta2": {"key": "beta2", "type": "str"}, + "distributed": {"key": "distributed", "type": "str"}, + "early_stopping": {"key": "earlyStopping", "type": "str"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "str"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "str", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "str", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "str"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "str", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "str"}, + "nesterov": {"key": "nesterov", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "str"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "str"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "str"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "str"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "str"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "str", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "str", + }, + "weight_decay": {"key": "weightDecay", "type": "str"}, + "training_crop_size": {"key": "trainingCropSize", "type": "str"}, + "validation_crop_size": {"key": "validationCropSize", "type": "str"}, + "validation_resize_size": { + "key": "validationResizeSize", + "type": "str", + }, + "weighted_loss": {"key": "weightedLoss", "type": "str"}, + } + + def __init__(self, **kwargs): """ :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :paramtype ams_gradient: str @@ -11487,208 +11639,241 @@ def __init__( 0 or 1 or 2. :paramtype weighted_loss: str """ - super(ImageModelDistributionSettingsClassification, self).__init__(**kwargs) - self.training_crop_size = kwargs.get('training_crop_size', None) - self.validation_crop_size = kwargs.get('validation_crop_size', None) - self.validation_resize_size = kwargs.get('validation_resize_size', None) - self.weighted_loss = kwargs.get('weighted_loss', None) + super(ImageModelDistributionSettingsClassification, self).__init__( + **kwargs + ) + self.training_crop_size = kwargs.get("training_crop_size", None) + self.validation_crop_size = kwargs.get("validation_crop_size", None) + self.validation_resize_size = kwargs.get( + "validation_resize_size", None + ) + self.weighted_loss = kwargs.get("weighted_loss", None) -class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettings): +class ImageModelDistributionSettingsObjectDetection( + ImageModelDistributionSettings +): """Distribution expressions to sweep over values of model settings. -:code:` -Some examples are: - -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: str - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: str - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: str - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: str - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: str - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype model_size: str - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: str - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - float in the range [0, 1]. - :vartype nms_iou_threshold: str - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: str - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - NMS: Non-maximum suppression. - :vartype tile_predictions_nms_threshold: str - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: str - :ivar validation_metric_type: Metric computation method to use for validation metrics. Must be - 'none', 'coco', 'voc', or 'coco_voc'. - :vartype validation_metric_type: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'str'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'str'}, - 'image_size': {'key': 'imageSize', 'type': 'str'}, - 'max_size': {'key': 'maxSize', 'type': 'str'}, - 'min_size': {'key': 'minSize', 'type': 'str'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'str'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'str'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'str'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'str'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'str'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + :code:` + Some examples are: + + ModelName = "choice('seresnext', 'resnest50')"; + LearningRate = "uniform(0.001, 0.01)"; + LayersToFreeze = "choice(0, 2)"; + ` + For more details on how to compose distribution expressions please check the documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: str + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: str + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: str + :ivar distributed: Whether to use distributer training. + :vartype distributed: str + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: str + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: str + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: str + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: str + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: str + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: str + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: str + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: str + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. + :vartype learning_rate_scheduler: str + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: str + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: str + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: str + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: str + :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. + :vartype optimizer: str + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: str + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: str + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: str + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: str + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: str + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: str + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: str + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: str + :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must + be a positive integer. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype box_detections_per_image: str + :ivar box_score_threshold: During inference, only return proposals with a classification score + greater than + BoxScoreThreshold. Must be a float in the range[0, 1]. + :vartype box_score_threshold: str + :ivar image_size: Image size for train and validation. Must be a positive integer. + Note: The training run may get into CUDA OOM if the size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype image_size: str + :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype max_size: str + :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype min_size: str + :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. + Note: training run may get into CUDA OOM if the model size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype model_size: str + :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. + Note: training run may get into CUDA OOM if no sufficient GPU memory. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype multi_scale: str + :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be + float in the range [0, 1]. + :vartype nms_iou_threshold: str + :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not + be + None to enable small object detection logic. A string containing two integers in mxn format. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_grid_size: str + :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float + in the range [0, 1). + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_overlap_ratio: str + :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging + predictions from tiles and image. + Used in validation/ inference. Must be float in the range [0, 1]. + Note: This settings is not supported for the 'yolov5' algorithm. + NMS: Non-maximum suppression. + :vartype tile_predictions_nms_threshold: str + :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be + float in the range [0, 1]. + :vartype validation_iou_threshold: str + :ivar validation_metric_type: Metric computation method to use for validation metrics. Must be + 'none', 'coco', 'voc', or 'coco_voc'. + :vartype validation_metric_type: str + """ + + _attribute_map = { + "ams_gradient": {"key": "amsGradient", "type": "str"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "str"}, + "beta2": {"key": "beta2", "type": "str"}, + "distributed": {"key": "distributed", "type": "str"}, + "early_stopping": {"key": "earlyStopping", "type": "str"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "str"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "str", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "str", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "str"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "str", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "str"}, + "nesterov": {"key": "nesterov", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "str"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "str"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "str"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "str"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "str"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "str", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "str", + }, + "weight_decay": {"key": "weightDecay", "type": "str"}, + "box_detections_per_image": { + "key": "boxDetectionsPerImage", + "type": "str", + }, + "box_score_threshold": {"key": "boxScoreThreshold", "type": "str"}, + "image_size": {"key": "imageSize", "type": "str"}, + "max_size": {"key": "maxSize", "type": "str"}, + "min_size": {"key": "minSize", "type": "str"}, + "model_size": {"key": "modelSize", "type": "str"}, + "multi_scale": {"key": "multiScale", "type": "str"}, + "nms_iou_threshold": {"key": "nmsIouThreshold", "type": "str"}, + "tile_grid_size": {"key": "tileGridSize", "type": "str"}, + "tile_overlap_ratio": {"key": "tileOverlapRatio", "type": "str"}, + "tile_predictions_nms_threshold": { + "key": "tilePredictionsNmsThreshold", + "type": "str", + }, + "validation_iou_threshold": { + "key": "validationIouThreshold", + "type": "str", + }, + "validation_metric_type": { + "key": "validationMetricType", + "type": "str", + }, + } + + def __init__(self, **kwargs): """ :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :paramtype ams_gradient: str @@ -11823,156 +12008,184 @@ def __init__( be 'none', 'coco', 'voc', or 'coco_voc'. :paramtype validation_metric_type: str """ - super(ImageModelDistributionSettingsObjectDetection, self).__init__(**kwargs) - self.box_detections_per_image = kwargs.get('box_detections_per_image', None) - self.box_score_threshold = kwargs.get('box_score_threshold', None) - self.image_size = kwargs.get('image_size', None) - self.max_size = kwargs.get('max_size', None) - self.min_size = kwargs.get('min_size', None) - self.model_size = kwargs.get('model_size', None) - self.multi_scale = kwargs.get('multi_scale', None) - self.nms_iou_threshold = kwargs.get('nms_iou_threshold', None) - self.tile_grid_size = kwargs.get('tile_grid_size', None) - self.tile_overlap_ratio = kwargs.get('tile_overlap_ratio', None) - self.tile_predictions_nms_threshold = kwargs.get('tile_predictions_nms_threshold', None) - self.validation_iou_threshold = kwargs.get('validation_iou_threshold', None) - self.validation_metric_type = kwargs.get('validation_metric_type', None) + super(ImageModelDistributionSettingsObjectDetection, self).__init__( + **kwargs + ) + self.box_detections_per_image = kwargs.get( + "box_detections_per_image", None + ) + self.box_score_threshold = kwargs.get("box_score_threshold", None) + self.image_size = kwargs.get("image_size", None) + self.max_size = kwargs.get("max_size", None) + self.min_size = kwargs.get("min_size", None) + self.model_size = kwargs.get("model_size", None) + self.multi_scale = kwargs.get("multi_scale", None) + self.nms_iou_threshold = kwargs.get("nms_iou_threshold", None) + self.tile_grid_size = kwargs.get("tile_grid_size", None) + self.tile_overlap_ratio = kwargs.get("tile_overlap_ratio", None) + self.tile_predictions_nms_threshold = kwargs.get( + "tile_predictions_nms_threshold", None + ) + self.validation_iou_threshold = kwargs.get( + "validation_iou_threshold", None + ) + self.validation_metric_type = kwargs.get( + "validation_metric_type", None + ) class ImageModelSettings(msrest.serialization.Model): """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar advanced_settings: Settings for advanced scenarios. + :vartype advanced_settings: str + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: bool + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: float + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: float + :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. + :vartype checkpoint_frequency: int + :ivar checkpoint_model: The pretrained checkpoint model for incremental training. + :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput + :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for + incremental training. + :vartype checkpoint_run_id: str + :ivar distributed: Whether to use distributed training. + :vartype distributed: bool + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: bool + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: int + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: int + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: bool + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: int + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: int + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: int + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: float + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. Possible values include: "None", "WarmupCosine", "Step". + :vartype learning_rate_scheduler: str or + ~azure.mgmt.machinelearningservices.models.LearningRateScheduler + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: float + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: bool + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: int + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: int + :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". + :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: int + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: float + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: int + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: int + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: int + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: float + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: int + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: float + """ + + _attribute_map = { + "advanced_settings": {"key": "advancedSettings", "type": "str"}, + "ams_gradient": {"key": "amsGradient", "type": "bool"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "float"}, + "beta2": {"key": "beta2", "type": "float"}, + "checkpoint_frequency": {"key": "checkpointFrequency", "type": "int"}, + "checkpoint_model": { + "key": "checkpointModel", + "type": "MLFlowModelJobInput", + }, + "checkpoint_run_id": {"key": "checkpointRunId", "type": "str"}, + "distributed": {"key": "distributed", "type": "bool"}, + "early_stopping": {"key": "earlyStopping", "type": "bool"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "int"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "int", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "bool", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "int"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "int", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "int"}, + "learning_rate": {"key": "learningRate", "type": "float"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "float"}, + "nesterov": {"key": "nesterov", "type": "bool"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "int"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "int"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "int"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "float"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "int"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "float", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "int", + }, + "weight_decay": {"key": "weightDecay", "type": "float"}, + } + + def __init__(self, **kwargs): """ :keyword advanced_settings: Settings for advanced scenarios. :paramtype advanced_settings: str @@ -12067,191 +12280,224 @@ def __init__( :paramtype weight_decay: float """ super(ImageModelSettings, self).__init__(**kwargs) - self.advanced_settings = kwargs.get('advanced_settings', None) - self.ams_gradient = kwargs.get('ams_gradient', None) - self.augmentations = kwargs.get('augmentations', None) - self.beta1 = kwargs.get('beta1', None) - self.beta2 = kwargs.get('beta2', None) - self.checkpoint_frequency = kwargs.get('checkpoint_frequency', None) - self.checkpoint_model = kwargs.get('checkpoint_model', None) - self.checkpoint_run_id = kwargs.get('checkpoint_run_id', None) - self.distributed = kwargs.get('distributed', None) - self.early_stopping = kwargs.get('early_stopping', None) - self.early_stopping_delay = kwargs.get('early_stopping_delay', None) - self.early_stopping_patience = kwargs.get('early_stopping_patience', None) - self.enable_onnx_normalization = kwargs.get('enable_onnx_normalization', None) - self.evaluation_frequency = kwargs.get('evaluation_frequency', None) - self.gradient_accumulation_step = kwargs.get('gradient_accumulation_step', None) - self.layers_to_freeze = kwargs.get('layers_to_freeze', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.learning_rate_scheduler = kwargs.get('learning_rate_scheduler', None) - self.model_name = kwargs.get('model_name', None) - self.momentum = kwargs.get('momentum', None) - self.nesterov = kwargs.get('nesterov', None) - self.number_of_epochs = kwargs.get('number_of_epochs', None) - self.number_of_workers = kwargs.get('number_of_workers', None) - self.optimizer = kwargs.get('optimizer', None) - self.random_seed = kwargs.get('random_seed', None) - self.step_lr_gamma = kwargs.get('step_lr_gamma', None) - self.step_lr_step_size = kwargs.get('step_lr_step_size', None) - self.training_batch_size = kwargs.get('training_batch_size', None) - self.validation_batch_size = kwargs.get('validation_batch_size', None) - self.warmup_cosine_lr_cycles = kwargs.get('warmup_cosine_lr_cycles', None) - self.warmup_cosine_lr_warmup_epochs = kwargs.get('warmup_cosine_lr_warmup_epochs', None) - self.weight_decay = kwargs.get('weight_decay', None) + self.advanced_settings = kwargs.get("advanced_settings", None) + self.ams_gradient = kwargs.get("ams_gradient", None) + self.augmentations = kwargs.get("augmentations", None) + self.beta1 = kwargs.get("beta1", None) + self.beta2 = kwargs.get("beta2", None) + self.checkpoint_frequency = kwargs.get("checkpoint_frequency", None) + self.checkpoint_model = kwargs.get("checkpoint_model", None) + self.checkpoint_run_id = kwargs.get("checkpoint_run_id", None) + self.distributed = kwargs.get("distributed", None) + self.early_stopping = kwargs.get("early_stopping", None) + self.early_stopping_delay = kwargs.get("early_stopping_delay", None) + self.early_stopping_patience = kwargs.get( + "early_stopping_patience", None + ) + self.enable_onnx_normalization = kwargs.get( + "enable_onnx_normalization", None + ) + self.evaluation_frequency = kwargs.get("evaluation_frequency", None) + self.gradient_accumulation_step = kwargs.get( + "gradient_accumulation_step", None + ) + self.layers_to_freeze = kwargs.get("layers_to_freeze", None) + self.learning_rate = kwargs.get("learning_rate", None) + self.learning_rate_scheduler = kwargs.get( + "learning_rate_scheduler", None + ) + self.model_name = kwargs.get("model_name", None) + self.momentum = kwargs.get("momentum", None) + self.nesterov = kwargs.get("nesterov", None) + self.number_of_epochs = kwargs.get("number_of_epochs", None) + self.number_of_workers = kwargs.get("number_of_workers", None) + self.optimizer = kwargs.get("optimizer", None) + self.random_seed = kwargs.get("random_seed", None) + self.step_lr_gamma = kwargs.get("step_lr_gamma", None) + self.step_lr_step_size = kwargs.get("step_lr_step_size", None) + self.training_batch_size = kwargs.get("training_batch_size", None) + self.validation_batch_size = kwargs.get("validation_batch_size", None) + self.warmup_cosine_lr_cycles = kwargs.get( + "warmup_cosine_lr_cycles", None + ) + self.warmup_cosine_lr_warmup_epochs = kwargs.get( + "warmup_cosine_lr_warmup_epochs", None + ) + self.weight_decay = kwargs.get("weight_decay", None) class ImageModelSettingsClassification(ImageModelSettings): """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: int - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: int - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: int - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: int - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'int'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'int'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'int'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar advanced_settings: Settings for advanced scenarios. + :vartype advanced_settings: str + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: bool + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: float + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: float + :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. + :vartype checkpoint_frequency: int + :ivar checkpoint_model: The pretrained checkpoint model for incremental training. + :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput + :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for + incremental training. + :vartype checkpoint_run_id: str + :ivar distributed: Whether to use distributed training. + :vartype distributed: bool + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: bool + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: int + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: int + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: bool + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: int + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: int + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: int + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: float + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. Possible values include: "None", "WarmupCosine", "Step". + :vartype learning_rate_scheduler: str or + ~azure.mgmt.machinelearningservices.models.LearningRateScheduler + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: float + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: bool + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: int + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: int + :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". + :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: int + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: float + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: int + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: int + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: int + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: float + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: int + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: float + :ivar training_crop_size: Image crop size that is input to the neural network for the training + dataset. Must be a positive integer. + :vartype training_crop_size: int + :ivar validation_crop_size: Image crop size that is input to the neural network for the + validation dataset. Must be a positive integer. + :vartype validation_crop_size: int + :ivar validation_resize_size: Image size to which to resize before cropping for validation + dataset. Must be a positive integer. + :vartype validation_resize_size: int + :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. + 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be + 0 or 1 or 2. + :vartype weighted_loss: int + """ + + _attribute_map = { + "advanced_settings": {"key": "advancedSettings", "type": "str"}, + "ams_gradient": {"key": "amsGradient", "type": "bool"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "float"}, + "beta2": {"key": "beta2", "type": "float"}, + "checkpoint_frequency": {"key": "checkpointFrequency", "type": "int"}, + "checkpoint_model": { + "key": "checkpointModel", + "type": "MLFlowModelJobInput", + }, + "checkpoint_run_id": {"key": "checkpointRunId", "type": "str"}, + "distributed": {"key": "distributed", "type": "bool"}, + "early_stopping": {"key": "earlyStopping", "type": "bool"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "int"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "int", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "bool", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "int"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "int", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "int"}, + "learning_rate": {"key": "learningRate", "type": "float"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "float"}, + "nesterov": {"key": "nesterov", "type": "bool"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "int"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "int"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "int"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "float"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "int"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "float", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "int", + }, + "weight_decay": {"key": "weightDecay", "type": "float"}, + "training_crop_size": {"key": "trainingCropSize", "type": "int"}, + "validation_crop_size": {"key": "validationCropSize", "type": "int"}, + "validation_resize_size": { + "key": "validationResizeSize", + "type": "int", + }, + "weighted_loss": {"key": "weightedLoss", "type": "int"}, + } + + def __init__(self, **kwargs): """ :keyword advanced_settings: Settings for advanced scenarios. :paramtype advanced_settings: str @@ -12359,212 +12605,244 @@ def __init__( :paramtype weighted_loss: int """ super(ImageModelSettingsClassification, self).__init__(**kwargs) - self.training_crop_size = kwargs.get('training_crop_size', None) - self.validation_crop_size = kwargs.get('validation_crop_size', None) - self.validation_resize_size = kwargs.get('validation_resize_size', None) - self.weighted_loss = kwargs.get('weighted_loss', None) + self.training_crop_size = kwargs.get("training_crop_size", None) + self.validation_crop_size = kwargs.get("validation_crop_size", None) + self.validation_resize_size = kwargs.get( + "validation_resize_size", None + ) + self.weighted_loss = kwargs.get("weighted_loss", None) -class ImageModelSettingsObjectDetection(ImageModelSettings): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: int - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: float - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: int - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: int - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: int - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: - "None", "Small", "Medium", "Large", "ExtraLarge". - :vartype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: bool - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be a - float in the range [0, 1]. - :vartype nms_iou_threshold: float - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: float - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_predictions_nms_threshold: float - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: float - :ivar validation_metric_type: Metric computation method to use for validation metrics. Possible - values include: "None", "Coco", "Voc", "CocoVoc". - :vartype validation_metric_type: str or - ~azure.mgmt.machinelearningservices.models.ValidationMetricType - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'int'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'float'}, - 'image_size': {'key': 'imageSize', 'type': 'int'}, - 'max_size': {'key': 'maxSize', 'type': 'int'}, - 'min_size': {'key': 'minSize', 'type': 'int'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'bool'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'float'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'float'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'float'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'float'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): +class ImageModelSettingsObjectDetection(ImageModelSettings): + """Settings used for training the model. + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar advanced_settings: Settings for advanced scenarios. + :vartype advanced_settings: str + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: bool + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: float + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: float + :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. + :vartype checkpoint_frequency: int + :ivar checkpoint_model: The pretrained checkpoint model for incremental training. + :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput + :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for + incremental training. + :vartype checkpoint_run_id: str + :ivar distributed: Whether to use distributed training. + :vartype distributed: bool + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: bool + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: int + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: int + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: bool + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: int + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: int + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: int + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: float + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. Possible values include: "None", "WarmupCosine", "Step". + :vartype learning_rate_scheduler: str or + ~azure.mgmt.machinelearningservices.models.LearningRateScheduler + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: float + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: bool + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: int + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: int + :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". + :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: int + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: float + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: int + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: int + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: int + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: float + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: int + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: float + :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must + be a positive integer. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype box_detections_per_image: int + :ivar box_score_threshold: During inference, only return proposals with a classification score + greater than + BoxScoreThreshold. Must be a float in the range[0, 1]. + :vartype box_score_threshold: float + :ivar image_size: Image size for train and validation. Must be a positive integer. + Note: The training run may get into CUDA OOM if the size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype image_size: int + :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype max_size: int + :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype min_size: int + :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. + Note: training run may get into CUDA OOM if the model size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: + "None", "Small", "Medium", "Large", "ExtraLarge". + :vartype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize + :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. + Note: training run may get into CUDA OOM if no sufficient GPU memory. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype multi_scale: bool + :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be a + float in the range [0, 1]. + :vartype nms_iou_threshold: float + :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not + be + None to enable small object detection logic. A string containing two integers in mxn format. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_grid_size: str + :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float + in the range [0, 1). + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_overlap_ratio: float + :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging + predictions from tiles and image. + Used in validation/ inference. Must be float in the range [0, 1]. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_predictions_nms_threshold: float + :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be + float in the range [0, 1]. + :vartype validation_iou_threshold: float + :ivar validation_metric_type: Metric computation method to use for validation metrics. Possible + values include: "None", "Coco", "Voc", "CocoVoc". + :vartype validation_metric_type: str or + ~azure.mgmt.machinelearningservices.models.ValidationMetricType + """ + + _attribute_map = { + "advanced_settings": {"key": "advancedSettings", "type": "str"}, + "ams_gradient": {"key": "amsGradient", "type": "bool"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "float"}, + "beta2": {"key": "beta2", "type": "float"}, + "checkpoint_frequency": {"key": "checkpointFrequency", "type": "int"}, + "checkpoint_model": { + "key": "checkpointModel", + "type": "MLFlowModelJobInput", + }, + "checkpoint_run_id": {"key": "checkpointRunId", "type": "str"}, + "distributed": {"key": "distributed", "type": "bool"}, + "early_stopping": {"key": "earlyStopping", "type": "bool"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "int"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "int", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "bool", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "int"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "int", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "int"}, + "learning_rate": {"key": "learningRate", "type": "float"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "float"}, + "nesterov": {"key": "nesterov", "type": "bool"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "int"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "int"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "int"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "float"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "int"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "float", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "int", + }, + "weight_decay": {"key": "weightDecay", "type": "float"}, + "box_detections_per_image": { + "key": "boxDetectionsPerImage", + "type": "int", + }, + "box_score_threshold": {"key": "boxScoreThreshold", "type": "float"}, + "image_size": {"key": "imageSize", "type": "int"}, + "max_size": {"key": "maxSize", "type": "int"}, + "min_size": {"key": "minSize", "type": "int"}, + "model_size": {"key": "modelSize", "type": "str"}, + "multi_scale": {"key": "multiScale", "type": "bool"}, + "nms_iou_threshold": {"key": "nmsIouThreshold", "type": "float"}, + "tile_grid_size": {"key": "tileGridSize", "type": "str"}, + "tile_overlap_ratio": {"key": "tileOverlapRatio", "type": "float"}, + "tile_predictions_nms_threshold": { + "key": "tilePredictionsNmsThreshold", + "type": "float", + }, + "validation_iou_threshold": { + "key": "validationIouThreshold", + "type": "float", + }, + "validation_metric_type": { + "key": "validationMetricType", + "type": "str", + }, + } + + def __init__(self, **kwargs): """ :keyword advanced_settings: Settings for advanced scenarios. :paramtype advanced_settings: str @@ -12712,88 +12990,108 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ValidationMetricType """ super(ImageModelSettingsObjectDetection, self).__init__(**kwargs) - self.box_detections_per_image = kwargs.get('box_detections_per_image', None) - self.box_score_threshold = kwargs.get('box_score_threshold', None) - self.image_size = kwargs.get('image_size', None) - self.max_size = kwargs.get('max_size', None) - self.min_size = kwargs.get('min_size', None) - self.model_size = kwargs.get('model_size', None) - self.multi_scale = kwargs.get('multi_scale', None) - self.nms_iou_threshold = kwargs.get('nms_iou_threshold', None) - self.tile_grid_size = kwargs.get('tile_grid_size', None) - self.tile_overlap_ratio = kwargs.get('tile_overlap_ratio', None) - self.tile_predictions_nms_threshold = kwargs.get('tile_predictions_nms_threshold', None) - self.validation_iou_threshold = kwargs.get('validation_iou_threshold', None) - self.validation_metric_type = kwargs.get('validation_metric_type', None) + self.box_detections_per_image = kwargs.get( + "box_detections_per_image", None + ) + self.box_score_threshold = kwargs.get("box_score_threshold", None) + self.image_size = kwargs.get("image_size", None) + self.max_size = kwargs.get("max_size", None) + self.min_size = kwargs.get("min_size", None) + self.model_size = kwargs.get("model_size", None) + self.multi_scale = kwargs.get("multi_scale", None) + self.nms_iou_threshold = kwargs.get("nms_iou_threshold", None) + self.tile_grid_size = kwargs.get("tile_grid_size", None) + self.tile_overlap_ratio = kwargs.get("tile_overlap_ratio", None) + self.tile_predictions_nms_threshold = kwargs.get( + "tile_predictions_nms_threshold", None + ) + self.validation_iou_threshold = kwargs.get( + "validation_iou_threshold", None + ) + self.validation_metric_type = kwargs.get( + "validation_metric_type", None + ) class ImageObjectDetection(AutoMLVertical, ImageObjectDetectionBase): """Image Object Detection. Object detection is used to identify objects in an image and locate each object with a -bounding box e.g. locate all dogs and cats in an image and draw a bounding box around each. + bounding box e.g. locate all dogs and cats in an image and draw a bounding box around each. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "MeanAveragePrecision". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics """ _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, + "limit_settings": {"required": True}, + "task_type": {"required": True}, + "training_data": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsObjectDetection", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsObjectDetection]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings @@ -12827,17 +13125,17 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics """ super(ImageObjectDetection, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageObjectDetection' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.limit_settings = kwargs["limit_settings"] + self.sweep_settings = kwargs.get("sweep_settings", None) + self.validation_data = kwargs.get("validation_data", None) + self.validation_data_size = kwargs.get("validation_data_size", None) + self.model_settings = kwargs.get("model_settings", None) + self.search_space = kwargs.get("search_space", None) + self.task_type = "ImageObjectDetection" # type: str + self.primary_metric = kwargs.get("primary_metric", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class ImageSweepSettings(msrest.serialization.Model): @@ -12854,18 +13152,18 @@ class ImageSweepSettings(msrest.serialization.Model): """ _validation = { - 'sampling_algorithm': {'required': True}, + "sampling_algorithm": {"required": True}, } _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, + "sampling_algorithm": {"key": "samplingAlgorithm", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword early_termination: Type of early termination policy. :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy @@ -12875,8 +13173,8 @@ def __init__( ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType """ super(ImageSweepSettings, self).__init__(**kwargs) - self.early_termination = kwargs.get('early_termination', None) - self.sampling_algorithm = kwargs['sampling_algorithm'] + self.early_termination = kwargs.get("early_termination", None) + self.sampling_algorithm = kwargs["sampling_algorithm"] class InferenceContainerProperties(msrest.serialization.Model): @@ -12892,15 +13190,12 @@ class InferenceContainerProperties(msrest.serialization.Model): """ _attribute_map = { - 'liveness_route': {'key': 'livenessRoute', 'type': 'Route'}, - 'readiness_route': {'key': 'readinessRoute', 'type': 'Route'}, - 'scoring_route': {'key': 'scoringRoute', 'type': 'Route'}, + "liveness_route": {"key": "livenessRoute", "type": "Route"}, + "readiness_route": {"key": "readinessRoute", "type": "Route"}, + "scoring_route": {"key": "scoringRoute", "type": "Route"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword liveness_route: The route to check the liveness of the inference server container. :paramtype liveness_route: ~azure.mgmt.machinelearningservices.models.Route @@ -12911,9 +13206,9 @@ def __init__( :paramtype scoring_route: ~azure.mgmt.machinelearningservices.models.Route """ super(InferenceContainerProperties, self).__init__(**kwargs) - self.liveness_route = kwargs.get('liveness_route', None) - self.readiness_route = kwargs.get('readiness_route', None) - self.scoring_route = kwargs.get('scoring_route', None) + self.liveness_route = kwargs.get("liveness_route", None) + self.readiness_route = kwargs.get("readiness_route", None) + self.scoring_route = kwargs.get("scoring_route", None) class InstanceTypeSchema(msrest.serialization.Model): @@ -12926,14 +13221,14 @@ class InstanceTypeSchema(msrest.serialization.Model): """ _attribute_map = { - 'node_selector': {'key': 'nodeSelector', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'InstanceTypeSchemaResources'}, + "node_selector": {"key": "nodeSelector", "type": "{str}"}, + "resources": { + "key": "resources", + "type": "InstanceTypeSchemaResources", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword node_selector: Node Selector. :paramtype node_selector: dict[str, str] @@ -12941,8 +13236,8 @@ def __init__( :paramtype resources: ~azure.mgmt.machinelearningservices.models.InstanceTypeSchemaResources """ super(InstanceTypeSchema, self).__init__(**kwargs) - self.node_selector = kwargs.get('node_selector', None) - self.resources = kwargs.get('resources', None) + self.node_selector = kwargs.get("node_selector", None) + self.resources = kwargs.get("resources", None) class InstanceTypeSchemaResources(msrest.serialization.Model): @@ -12955,14 +13250,11 @@ class InstanceTypeSchemaResources(msrest.serialization.Model): """ _attribute_map = { - 'requests': {'key': 'requests', 'type': '{str}'}, - 'limits': {'key': 'limits', 'type': '{str}'}, + "requests": {"key": "requests", "type": "{str}"}, + "limits": {"key": "limits", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword requests: Resource requests for this instance type. :paramtype requests: dict[str, str] @@ -12970,8 +13262,8 @@ def __init__( :paramtype limits: dict[str, str] """ super(InstanceTypeSchemaResources, self).__init__(**kwargs) - self.requests = kwargs.get('requests', None) - self.limits = kwargs.get('limits', None) + self.requests = kwargs.get("requests", None) + self.limits = kwargs.get("limits", None) class JobBase(Resource): @@ -12997,31 +13289,28 @@ class JobBase(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'JobBaseProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "JobBaseProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.JobBaseProperties """ super(JobBase, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class JobBaseResourceArmPaginatedResult(msrest.serialization.Model): @@ -13035,14 +13324,11 @@ class JobBaseResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[JobBase]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[JobBase]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of JobBase objects. If null, there are no additional pages. @@ -13051,8 +13337,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.JobBase] """ super(JobBaseResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class JobResourceConfiguration(ResourceConfiguration): @@ -13075,21 +13361,18 @@ class JobResourceConfiguration(ResourceConfiguration): """ _validation = { - 'shm_size': {'pattern': r'\d+[bBkKmMgG]'}, + "shm_size": {"pattern": r"\d+[bBkKmMgG]"}, } _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - 'docker_args': {'key': 'dockerArgs', 'type': 'str'}, - 'shm_size': {'key': 'shmSize', 'type': 'str'}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "properties": {"key": "properties", "type": "{object}"}, + "docker_args": {"key": "dockerArgs", "type": "str"}, + "shm_size": {"key": "shmSize", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword instance_count: Optional number of instances or nodes used by the compute target. :paramtype instance_count: int @@ -13107,8 +13390,8 @@ def __init__( :paramtype shm_size: str """ super(JobResourceConfiguration, self).__init__(**kwargs) - self.docker_args = kwargs.get('docker_args', None) - self.shm_size = kwargs.get('shm_size', "2g") + self.docker_args = kwargs.get("docker_args", None) + self.shm_size = kwargs.get("shm_size", "2g") class JobScheduleAction(ScheduleActionBase): @@ -13124,26 +13407,26 @@ class JobScheduleAction(ScheduleActionBase): """ _validation = { - 'action_type': {'required': True}, - 'job_definition': {'required': True}, + "action_type": {"required": True}, + "job_definition": {"required": True}, } _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'job_definition': {'key': 'jobDefinition', 'type': 'JobBaseProperties'}, + "action_type": {"key": "actionType", "type": "str"}, + "job_definition": { + "key": "jobDefinition", + "type": "JobBaseProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword job_definition: Required. [Required] Defines Schedule action definition details. :paramtype job_definition: ~azure.mgmt.machinelearningservices.models.JobBaseProperties """ super(JobScheduleAction, self).__init__(**kwargs) - self.action_type = 'CreateJob' # type: str - self.job_definition = kwargs['job_definition'] + self.action_type = "CreateJob" # type: str + self.job_definition = kwargs["job_definition"] class JobService(msrest.serialization.Model): @@ -13169,24 +13452,21 @@ class JobService(msrest.serialization.Model): """ _validation = { - 'error_message': {'readonly': True}, - 'status': {'readonly': True}, + "error_message": {"readonly": True}, + "status": {"readonly": True}, } _attribute_map = { - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'job_service_type': {'key': 'jobServiceType', 'type': 'str'}, - 'nodes': {'key': 'nodes', 'type': 'Nodes'}, - 'port': {'key': 'port', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'status': {'key': 'status', 'type': 'str'}, + "endpoint": {"key": "endpoint", "type": "str"}, + "error_message": {"key": "errorMessage", "type": "str"}, + "job_service_type": {"key": "jobServiceType", "type": "str"}, + "nodes": {"key": "nodes", "type": "Nodes"}, + "port": {"key": "port", "type": "int"}, + "properties": {"key": "properties", "type": "{str}"}, + "status": {"key": "status", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword endpoint: Url for endpoint. :paramtype endpoint: str @@ -13201,12 +13481,12 @@ def __init__( :paramtype properties: dict[str, str] """ super(JobService, self).__init__(**kwargs) - self.endpoint = kwargs.get('endpoint', None) + self.endpoint = kwargs.get("endpoint", None) self.error_message = None - self.job_service_type = kwargs.get('job_service_type', None) - self.nodes = kwargs.get('nodes', None) - self.port = kwargs.get('port', None) - self.properties = kwargs.get('properties', None) + self.job_service_type = kwargs.get("job_service_type", None) + self.nodes = kwargs.get("nodes", None) + self.port = kwargs.get("port", None) + self.properties = kwargs.get("properties", None) self.status = None @@ -13225,21 +13505,18 @@ class KerberosCredentials(msrest.serialization.Model): """ _validation = { - 'kerberos_kdc_address': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "kerberos_kdc_address": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "kerberos_principal": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "kerberos_realm": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, + "kerberos_kdc_address": {"key": "kerberosKdcAddress", "type": "str"}, + "kerberos_principal": {"key": "kerberosPrincipal", "type": "str"}, + "kerberos_realm": {"key": "kerberosRealm", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. :paramtype kerberos_kdc_address: str @@ -13250,9 +13527,9 @@ def __init__( :paramtype kerberos_realm: str """ super(KerberosCredentials, self).__init__(**kwargs) - self.kerberos_kdc_address = kwargs['kerberos_kdc_address'] - self.kerberos_principal = kwargs['kerberos_principal'] - self.kerberos_realm = kwargs['kerberos_realm'] + self.kerberos_kdc_address = kwargs["kerberos_kdc_address"] + self.kerberos_principal = kwargs["kerberos_principal"] + self.kerberos_realm = kwargs["kerberos_realm"] class KerberosKeytabCredentials(DatastoreCredentials, KerberosCredentials): @@ -13276,25 +13553,22 @@ class KerberosKeytabCredentials(DatastoreCredentials, KerberosCredentials): """ _validation = { - 'kerberos_kdc_address': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, + "kerberos_kdc_address": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "kerberos_principal": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "kerberos_realm": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "credentials_type": {"required": True}, + "secrets": {"required": True}, } _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'KerberosKeytabSecrets'}, + "kerberos_kdc_address": {"key": "kerberosKdcAddress", "type": "str"}, + "kerberos_principal": {"key": "kerberosPrincipal", "type": "str"}, + "kerberos_realm": {"key": "kerberosRealm", "type": "str"}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "secrets": {"key": "secrets", "type": "KerberosKeytabSecrets"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. :paramtype kerberos_kdc_address: str @@ -13307,11 +13581,11 @@ def __init__( :paramtype secrets: ~azure.mgmt.machinelearningservices.models.KerberosKeytabSecrets """ super(KerberosKeytabCredentials, self).__init__(**kwargs) - self.kerberos_kdc_address = kwargs['kerberos_kdc_address'] - self.kerberos_principal = kwargs['kerberos_principal'] - self.kerberos_realm = kwargs['kerberos_realm'] - self.credentials_type = 'KerberosKeytab' # type: str - self.secrets = kwargs['secrets'] + self.kerberos_kdc_address = kwargs["kerberos_kdc_address"] + self.kerberos_principal = kwargs["kerberos_principal"] + self.kerberos_realm = kwargs["kerberos_realm"] + self.credentials_type = "KerberosKeytab" # type: str + self.secrets = kwargs["secrets"] class KerberosKeytabSecrets(DatastoreSecrets): @@ -13328,25 +13602,22 @@ class KerberosKeytabSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'kerberos_keytab': {'key': 'kerberosKeytab', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "kerberos_keytab": {"key": "kerberosKeytab", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword kerberos_keytab: Kerberos keytab secret. :paramtype kerberos_keytab: str """ super(KerberosKeytabSecrets, self).__init__(**kwargs) - self.secrets_type = 'KerberosKeytab' # type: str - self.kerberos_keytab = kwargs.get('kerberos_keytab', None) + self.secrets_type = "KerberosKeytab" # type: str + self.kerberos_keytab = kwargs.get("kerberos_keytab", None) class KerberosPasswordCredentials(DatastoreCredentials, KerberosCredentials): @@ -13370,25 +13641,22 @@ class KerberosPasswordCredentials(DatastoreCredentials, KerberosCredentials): """ _validation = { - 'kerberos_kdc_address': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, + "kerberos_kdc_address": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "kerberos_principal": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "kerberos_realm": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "credentials_type": {"required": True}, + "secrets": {"required": True}, } _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'KerberosPasswordSecrets'}, + "kerberos_kdc_address": {"key": "kerberosKdcAddress", "type": "str"}, + "kerberos_principal": {"key": "kerberosPrincipal", "type": "str"}, + "kerberos_realm": {"key": "kerberosRealm", "type": "str"}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "secrets": {"key": "secrets", "type": "KerberosPasswordSecrets"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. :paramtype kerberos_kdc_address: str @@ -13401,11 +13669,11 @@ def __init__( :paramtype secrets: ~azure.mgmt.machinelearningservices.models.KerberosPasswordSecrets """ super(KerberosPasswordCredentials, self).__init__(**kwargs) - self.kerberos_kdc_address = kwargs['kerberos_kdc_address'] - self.kerberos_principal = kwargs['kerberos_principal'] - self.kerberos_realm = kwargs['kerberos_realm'] - self.credentials_type = 'KerberosPassword' # type: str - self.secrets = kwargs['secrets'] + self.kerberos_kdc_address = kwargs["kerberos_kdc_address"] + self.kerberos_principal = kwargs["kerberos_principal"] + self.kerberos_realm = kwargs["kerberos_realm"] + self.credentials_type = "KerberosPassword" # type: str + self.secrets = kwargs["secrets"] class KerberosPasswordSecrets(DatastoreSecrets): @@ -13422,25 +13690,22 @@ class KerberosPasswordSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'kerberos_password': {'key': 'kerberosPassword', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "kerberos_password": {"key": "kerberosPassword", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword kerberos_password: Kerberos password secret. :paramtype kerberos_password: str """ super(KerberosPasswordSecrets, self).__init__(**kwargs) - self.secrets_type = 'KerberosPassword' # type: str - self.kerberos_password = kwargs.get('kerberos_password', None) + self.secrets_type = "KerberosPassword" # type: str + self.kerberos_password = kwargs.get("kerberos_password", None) class KubernetesSchema(msrest.serialization.Model): @@ -13451,19 +13716,16 @@ class KubernetesSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, + "properties": {"key": "properties", "type": "KubernetesProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of Kubernetes. :paramtype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties """ super(KubernetesSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class Kubernetes(Compute, KubernetesSchema): @@ -13505,34 +13767,34 @@ class Kubernetes(Compute, KubernetesSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + "disable_local_auth": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "KubernetesProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of Kubernetes. :paramtype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties @@ -13542,14 +13804,14 @@ def __init__( :paramtype resource_id: str """ super(Kubernetes, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'Kubernetes' # type: str + self.properties = kwargs.get("properties", None) + self.compute_type = "Kubernetes" # type: str self.compute_location = None self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None self.disable_local_auth = None @@ -13612,37 +13874,52 @@ class OnlineDeploymentProperties(EndpointDeploymentPropertiesBase): """ _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, + "endpoint_compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, + "egress_public_network_access": { + "key": "egressPublicNetworkAccess", + "type": "str", + }, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, + "model": {"key": "model", "type": "str"}, + "model_mount_path": {"key": "modelMountPath", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, } _subtype_map = { - 'endpoint_compute_type': {'Kubernetes': 'KubernetesOnlineDeployment', 'Managed': 'ManagedOnlineDeployment'} + "endpoint_compute_type": { + "Kubernetes": "KubernetesOnlineDeployment", + "Managed": "ManagedOnlineDeployment", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword code_configuration: Code configuration for the endpoint deployment. :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration @@ -13682,17 +13959,19 @@ def __init__( :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings """ super(OnlineDeploymentProperties, self).__init__(**kwargs) - self.app_insights_enabled = kwargs.get('app_insights_enabled', False) - self.egress_public_network_access = kwargs.get('egress_public_network_access', None) - self.endpoint_compute_type = 'OnlineDeploymentProperties' # type: str - self.instance_type = kwargs.get('instance_type', None) - self.liveness_probe = kwargs.get('liveness_probe', None) - self.model = kwargs.get('model', None) - self.model_mount_path = kwargs.get('model_mount_path', None) + self.app_insights_enabled = kwargs.get("app_insights_enabled", False) + self.egress_public_network_access = kwargs.get( + "egress_public_network_access", None + ) + self.endpoint_compute_type = "OnlineDeploymentProperties" # type: str + self.instance_type = kwargs.get("instance_type", None) + self.liveness_probe = kwargs.get("liveness_probe", None) + self.model = kwargs.get("model", None) + self.model_mount_path = kwargs.get("model_mount_path", None) self.provisioning_state = None - self.readiness_probe = kwargs.get('readiness_probe', None) - self.request_settings = kwargs.get('request_settings', None) - self.scale_settings = kwargs.get('scale_settings', None) + self.readiness_probe = kwargs.get("readiness_probe", None) + self.request_settings = kwargs.get("request_settings", None) + self.scale_settings = kwargs.get("scale_settings", None) class KubernetesOnlineDeployment(OnlineDeploymentProperties): @@ -13753,34 +14032,49 @@ class KubernetesOnlineDeployment(OnlineDeploymentProperties): """ _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - 'container_resource_requirements': {'key': 'containerResourceRequirements', 'type': 'ContainerResourceRequirements'}, - } - - def __init__( - self, - **kwargs - ): + "endpoint_compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, + "egress_public_network_access": { + "key": "egressPublicNetworkAccess", + "type": "str", + }, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, + "model": {"key": "model", "type": "str"}, + "model_mount_path": {"key": "modelMountPath", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, + "container_resource_requirements": { + "key": "containerResourceRequirements", + "type": "ContainerResourceRequirements", + }, + } + + def __init__(self, **kwargs): """ :keyword code_configuration: Code configuration for the endpoint deployment. :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration @@ -13824,8 +14118,10 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ContainerResourceRequirements """ super(KubernetesOnlineDeployment, self).__init__(**kwargs) - self.endpoint_compute_type = 'Kubernetes' # type: str - self.container_resource_requirements = kwargs.get('container_resource_requirements', None) + self.endpoint_compute_type = "Kubernetes" # type: str + self.container_resource_requirements = kwargs.get( + "container_resource_requirements", None + ) class KubernetesProperties(msrest.serialization.Model): @@ -13851,20 +14147,32 @@ class KubernetesProperties(msrest.serialization.Model): """ _attribute_map = { - 'relay_connection_string': {'key': 'relayConnectionString', 'type': 'str'}, - 'service_bus_connection_string': {'key': 'serviceBusConnectionString', 'type': 'str'}, - 'extension_principal_id': {'key': 'extensionPrincipalId', 'type': 'str'}, - 'extension_instance_release_train': {'key': 'extensionInstanceReleaseTrain', 'type': 'str'}, - 'vc_name': {'key': 'vcName', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'default_instance_type': {'key': 'defaultInstanceType', 'type': 'str'}, - 'instance_types': {'key': 'instanceTypes', 'type': '{InstanceTypeSchema}'}, - } - - def __init__( - self, - **kwargs - ): + "relay_connection_string": { + "key": "relayConnectionString", + "type": "str", + }, + "service_bus_connection_string": { + "key": "serviceBusConnectionString", + "type": "str", + }, + "extension_principal_id": { + "key": "extensionPrincipalId", + "type": "str", + }, + "extension_instance_release_train": { + "key": "extensionInstanceReleaseTrain", + "type": "str", + }, + "vc_name": {"key": "vcName", "type": "str"}, + "namespace": {"key": "namespace", "type": "str"}, + "default_instance_type": {"key": "defaultInstanceType", "type": "str"}, + "instance_types": { + "key": "instanceTypes", + "type": "{InstanceTypeSchema}", + }, + } + + def __init__(self, **kwargs): """ :keyword relay_connection_string: Relay connection string. :paramtype relay_connection_string: str @@ -13885,14 +14193,22 @@ def __init__( ~azure.mgmt.machinelearningservices.models.InstanceTypeSchema] """ super(KubernetesProperties, self).__init__(**kwargs) - self.relay_connection_string = kwargs.get('relay_connection_string', None) - self.service_bus_connection_string = kwargs.get('service_bus_connection_string', None) - self.extension_principal_id = kwargs.get('extension_principal_id', None) - self.extension_instance_release_train = kwargs.get('extension_instance_release_train', None) - self.vc_name = kwargs.get('vc_name', None) - self.namespace = kwargs.get('namespace', "default") - self.default_instance_type = kwargs.get('default_instance_type', None) - self.instance_types = kwargs.get('instance_types', None) + self.relay_connection_string = kwargs.get( + "relay_connection_string", None + ) + self.service_bus_connection_string = kwargs.get( + "service_bus_connection_string", None + ) + self.extension_principal_id = kwargs.get( + "extension_principal_id", None + ) + self.extension_instance_release_train = kwargs.get( + "extension_instance_release_train", None + ) + self.vc_name = kwargs.get("vc_name", None) + self.namespace = kwargs.get("namespace", "default") + self.default_instance_type = kwargs.get("default_instance_type", None) + self.instance_types = kwargs.get("instance_types", None) class LabelCategory(msrest.serialization.Model): @@ -13908,15 +14224,12 @@ class LabelCategory(msrest.serialization.Model): """ _attribute_map = { - 'classes': {'key': 'classes', 'type': '{LabelClass}'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'multi_select_enabled': {'key': 'multiSelectEnabled', 'type': 'bool'}, + "classes": {"key": "classes", "type": "{LabelClass}"}, + "display_name": {"key": "displayName", "type": "str"}, + "multi_select_enabled": {"key": "multiSelectEnabled", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword classes: Dictionary of label classes in this category. :paramtype classes: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] @@ -13927,9 +14240,9 @@ def __init__( :paramtype multi_select_enabled: bool """ super(LabelCategory, self).__init__(**kwargs) - self.classes = kwargs.get('classes', None) - self.display_name = kwargs.get('display_name', None) - self.multi_select_enabled = kwargs.get('multi_select_enabled', False) + self.classes = kwargs.get("classes", None) + self.display_name = kwargs.get("display_name", None) + self.multi_select_enabled = kwargs.get("multi_select_enabled", False) class LabelClass(msrest.serialization.Model): @@ -13942,14 +14255,11 @@ class LabelClass(msrest.serialization.Model): """ _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'subclasses': {'key': 'subclasses', 'type': '{LabelClass}'}, + "display_name": {"key": "displayName", "type": "str"}, + "subclasses": {"key": "subclasses", "type": "{LabelClass}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword display_name: Display name of the label class. :paramtype display_name: str @@ -13957,8 +14267,8 @@ def __init__( :paramtype subclasses: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] """ super(LabelClass, self).__init__(**kwargs) - self.display_name = kwargs.get('display_name', None) - self.subclasses = kwargs.get('subclasses', None) + self.display_name = kwargs.get("display_name", None) + self.subclasses = kwargs.get("subclasses", None) class LabelingDataConfiguration(msrest.serialization.Model): @@ -13971,14 +14281,14 @@ class LabelingDataConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'data_id': {'key': 'dataId', 'type': 'str'}, - 'incremental_data_refresh_enabled': {'key': 'incrementalDataRefreshEnabled', 'type': 'bool'}, + "data_id": {"key": "dataId", "type": "str"}, + "incremental_data_refresh_enabled": { + "key": "incrementalDataRefreshEnabled", + "type": "bool", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data_id: Resource Id of the data asset to perform labeling. :paramtype data_id: str @@ -13987,8 +14297,10 @@ def __init__( :paramtype incremental_data_refresh_enabled: bool """ super(LabelingDataConfiguration, self).__init__(**kwargs) - self.data_id = kwargs.get('data_id', None) - self.incremental_data_refresh_enabled = kwargs.get('incremental_data_refresh_enabled', False) + self.data_id = kwargs.get("data_id", None) + self.incremental_data_refresh_enabled = kwargs.get( + "incremental_data_refresh_enabled", False + ) class LabelingJob(Resource): @@ -14014,31 +14326,28 @@ class LabelingJob(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'LabelingJobProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "LabelingJobProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.LabelingJobProperties """ super(LabelingJob, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class LabelingJobMediaProperties(msrest.serialization.Model): @@ -14055,23 +14364,22 @@ class LabelingJobMediaProperties(msrest.serialization.Model): """ _validation = { - 'media_type': {'required': True}, + "media_type": {"required": True}, } _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, + "media_type": {"key": "mediaType", "type": "str"}, } _subtype_map = { - 'media_type': {'Image': 'LabelingJobImageProperties', 'Text': 'LabelingJobTextProperties'} + "media_type": { + "Image": "LabelingJobImageProperties", + "Text": "LabelingJobTextProperties", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(LabelingJobMediaProperties, self).__init__(**kwargs) self.media_type = None # type: Optional[str] @@ -14090,18 +14398,15 @@ class LabelingJobImageProperties(LabelingJobMediaProperties): """ _validation = { - 'media_type': {'required': True}, + "media_type": {"required": True}, } _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - 'annotation_type': {'key': 'annotationType', 'type': 'str'}, + "media_type": {"key": "mediaType", "type": "str"}, + "annotation_type": {"key": "annotationType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword annotation_type: Annotation type of image labeling job. Possible values include: "Classification", "BoundingBox", "InstanceSegmentation". @@ -14109,8 +14414,8 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ImageAnnotationType """ super(LabelingJobImageProperties, self).__init__(**kwargs) - self.media_type = 'Image' # type: str - self.annotation_type = kwargs.get('annotation_type', None) + self.media_type = "Image" # type: str + self.annotation_type = kwargs.get("annotation_type", None) class LabelingJobInstructions(msrest.serialization.Model): @@ -14121,19 +14426,16 @@ class LabelingJobInstructions(msrest.serialization.Model): """ _attribute_map = { - 'uri': {'key': 'uri', 'type': 'str'}, + "uri": {"key": "uri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword uri: The link to a page with detailed labeling instructions for labelers. :paramtype uri: str """ super(LabelingJobInstructions, self).__init__(**kwargs) - self.uri = kwargs.get('uri', None) + self.uri = kwargs.get("uri", None) class LabelingJobProperties(JobBaseProperties): @@ -14202,44 +14504,62 @@ class LabelingJobProperties(JobBaseProperties): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'created_date_time': {'readonly': True}, - 'progress_metrics': {'readonly': True}, - 'project_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'status_messages': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'data_configuration': {'key': 'dataConfiguration', 'type': 'LabelingDataConfiguration'}, - 'job_instructions': {'key': 'jobInstructions', 'type': 'LabelingJobInstructions'}, - 'label_categories': {'key': 'labelCategories', 'type': '{LabelCategory}'}, - 'labeling_job_media_properties': {'key': 'labelingJobMediaProperties', 'type': 'LabelingJobMediaProperties'}, - 'ml_assist_configuration': {'key': 'mlAssistConfiguration', 'type': 'MLAssistConfiguration'}, - 'progress_metrics': {'key': 'progressMetrics', 'type': 'ProgressMetrics'}, - 'project_id': {'key': 'projectId', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'status_messages': {'key': 'statusMessages', 'type': '[StatusMessage]'}, - } - - def __init__( - self, - **kwargs - ): + "job_type": {"required": True}, + "status": {"readonly": True}, + "created_date_time": {"readonly": True}, + "progress_metrics": {"readonly": True}, + "project_id": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "status_messages": {"readonly": True}, + } + + _attribute_map = { + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "created_date_time": {"key": "createdDateTime", "type": "iso-8601"}, + "data_configuration": { + "key": "dataConfiguration", + "type": "LabelingDataConfiguration", + }, + "job_instructions": { + "key": "jobInstructions", + "type": "LabelingJobInstructions", + }, + "label_categories": { + "key": "labelCategories", + "type": "{LabelCategory}", + }, + "labeling_job_media_properties": { + "key": "labelingJobMediaProperties", + "type": "LabelingJobMediaProperties", + }, + "ml_assist_configuration": { + "key": "mlAssistConfiguration", + "type": "MLAssistConfiguration", + }, + "progress_metrics": { + "key": "progressMetrics", + "type": "ProgressMetrics", + }, + "project_id": {"key": "projectId", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "status_messages": { + "key": "statusMessages", + "type": "[StatusMessage]", + }, + } + + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -14281,13 +14601,17 @@ def __init__( ~azure.mgmt.machinelearningservices.models.MLAssistConfiguration """ super(LabelingJobProperties, self).__init__(**kwargs) - self.job_type = 'Labeling' # type: str + self.job_type = "Labeling" # type: str self.created_date_time = None - self.data_configuration = kwargs.get('data_configuration', None) - self.job_instructions = kwargs.get('job_instructions', None) - self.label_categories = kwargs.get('label_categories', None) - self.labeling_job_media_properties = kwargs.get('labeling_job_media_properties', None) - self.ml_assist_configuration = kwargs.get('ml_assist_configuration', None) + self.data_configuration = kwargs.get("data_configuration", None) + self.job_instructions = kwargs.get("job_instructions", None) + self.label_categories = kwargs.get("label_categories", None) + self.labeling_job_media_properties = kwargs.get( + "labeling_job_media_properties", None + ) + self.ml_assist_configuration = kwargs.get( + "ml_assist_configuration", None + ) self.progress_metrics = None self.project_id = None self.provisioning_state = None @@ -14305,14 +14629,11 @@ class LabelingJobResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[LabelingJob]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[LabelingJob]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of LabelingJob objects. If null, there are no additional pages. @@ -14321,8 +14642,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.LabelingJob] """ super(LabelingJobResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class LabelingJobTextProperties(LabelingJobMediaProperties): @@ -14339,18 +14660,15 @@ class LabelingJobTextProperties(LabelingJobMediaProperties): """ _validation = { - 'media_type': {'required': True}, + "media_type": {"required": True}, } _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - 'annotation_type': {'key': 'annotationType', 'type': 'str'}, + "media_type": {"key": "mediaType", "type": "str"}, + "annotation_type": {"key": "annotationType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword annotation_type: Annotation type of text labeling job. Possible values include: "Classification", "NamedEntityRecognition". @@ -14358,8 +14676,8 @@ def __init__( ~azure.mgmt.machinelearningservices.models.TextAnnotationType """ super(LabelingJobTextProperties, self).__init__(**kwargs) - self.media_type = 'Text' # type: str - self.annotation_type = kwargs.get('annotation_type', None) + self.media_type = "Text" # type: str + self.annotation_type = kwargs.get("annotation_type", None) class ListAmlUserFeatureResult(msrest.serialization.Model): @@ -14375,21 +14693,17 @@ class ListAmlUserFeatureResult(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlUserFeature]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[AmlUserFeature]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListAmlUserFeatureResult, self).__init__(**kwargs) self.value = None self.next_link = None @@ -14407,21 +14721,17 @@ class ListNotebookKeysResult(msrest.serialization.Model): """ _validation = { - 'primary_access_key': {'readonly': True}, - 'secondary_access_key': {'readonly': True}, + "primary_access_key": {"readonly": True}, + "secondary_access_key": {"readonly": True}, } _attribute_map = { - 'primary_access_key': {'key': 'primaryAccessKey', 'type': 'str'}, - 'secondary_access_key': {'key': 'secondaryAccessKey', 'type': 'str'}, + "primary_access_key": {"key": "primaryAccessKey", "type": "str"}, + "secondary_access_key": {"key": "secondaryAccessKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListNotebookKeysResult, self).__init__(**kwargs) self.primary_access_key = None self.secondary_access_key = None @@ -14437,19 +14747,15 @@ class ListStorageAccountKeysResult(msrest.serialization.Model): """ _validation = { - 'user_storage_key': {'readonly': True}, + "user_storage_key": {"readonly": True}, } _attribute_map = { - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, + "user_storage_key": {"key": "userStorageKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListStorageAccountKeysResult, self).__init__(**kwargs) self.user_storage_key = None @@ -14467,21 +14773,17 @@ class ListUsagesResult(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[Usage]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Usage]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListUsagesResult, self).__init__(**kwargs) self.value = None self.next_link = None @@ -14507,27 +14809,35 @@ class ListWorkspaceKeysResult(msrest.serialization.Model): """ _validation = { - 'user_storage_key': {'readonly': True}, - 'user_storage_resource_id': {'readonly': True}, - 'app_insights_instrumentation_key': {'readonly': True}, - 'container_registry_credentials': {'readonly': True}, - 'notebook_access_keys': {'readonly': True}, + "user_storage_key": {"readonly": True}, + "user_storage_resource_id": {"readonly": True}, + "app_insights_instrumentation_key": {"readonly": True}, + "container_registry_credentials": {"readonly": True}, + "notebook_access_keys": {"readonly": True}, } _attribute_map = { - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, - 'user_storage_resource_id': {'key': 'userStorageResourceId', 'type': 'str'}, - 'app_insights_instrumentation_key': {'key': 'appInsightsInstrumentationKey', 'type': 'str'}, - 'container_registry_credentials': {'key': 'containerRegistryCredentials', 'type': 'RegistryListCredentialsResult'}, - 'notebook_access_keys': {'key': 'notebookAccessKeys', 'type': 'ListNotebookKeysResult'}, + "user_storage_key": {"key": "userStorageKey", "type": "str"}, + "user_storage_resource_id": { + "key": "userStorageResourceId", + "type": "str", + }, + "app_insights_instrumentation_key": { + "key": "appInsightsInstrumentationKey", + "type": "str", + }, + "container_registry_credentials": { + "key": "containerRegistryCredentials", + "type": "RegistryListCredentialsResult", + }, + "notebook_access_keys": { + "key": "notebookAccessKeys", + "type": "ListNotebookKeysResult", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListWorkspaceKeysResult, self).__init__(**kwargs) self.user_storage_key = None self.user_storage_resource_id = None @@ -14549,21 +14859,17 @@ class ListWorkspaceQuotas(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[ResourceQuota]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[ResourceQuota]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListWorkspaceQuotas, self).__init__(**kwargs) self.value = None self.next_link = None @@ -14585,20 +14891,17 @@ class LiteralJobInput(JobInput): """ _validation = { - 'job_input_type': {'required': True}, - 'value': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "job_input_type": {"required": True}, + "value": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, + "value": {"key": "value", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: Description for the input. :paramtype description: str @@ -14606,8 +14909,8 @@ def __init__( :paramtype value: str """ super(LiteralJobInput, self).__init__(**kwargs) - self.job_input_type = 'literal' # type: str - self.value = kwargs['value'] + self.job_input_type = "literal" # type: str + self.value = kwargs["value"] class ManagedIdentity(IdentityConfiguration): @@ -14631,20 +14934,17 @@ class ManagedIdentity(IdentityConfiguration): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + "object_id": {"key": "objectId", "type": "str"}, + "resource_id": {"key": "resourceId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword client_id: Specifies a user-assigned identity by client ID. For system-assigned, do not set this field. @@ -14657,13 +14957,15 @@ def __init__( :paramtype resource_id: str """ super(ManagedIdentity, self).__init__(**kwargs) - self.identity_type = 'Managed' # type: str - self.client_id = kwargs.get('client_id', None) - self.object_id = kwargs.get('object_id', None) - self.resource_id = kwargs.get('resource_id', None) + self.identity_type = "Managed" # type: str + self.client_id = kwargs.get("client_id", None) + self.object_id = kwargs.get("object_id", None) + self.resource_id = kwargs.get("resource_id", None) -class ManagedIdentityAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class ManagedIdentityAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """ManagedIdentityAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -14686,22 +14988,22 @@ class ManagedIdentityAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPr """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionManagedIdentity'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionManagedIdentity", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: Category of the connection. :paramtype category: str @@ -14716,9 +15018,11 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity """ - super(ManagedIdentityAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'ManagedIdentity' # type: str - self.credentials = kwargs.get('credentials', None) + super( + ManagedIdentityAuthTypeWorkspaceConnectionProperties, self + ).__init__(**kwargs) + self.auth_type = "ManagedIdentity" # type: str + self.credentials = kwargs.get("credentials", None) class ManagedOnlineDeployment(OnlineDeploymentProperties): @@ -14775,33 +15079,45 @@ class ManagedOnlineDeployment(OnlineDeploymentProperties): """ _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - } - - def __init__( - self, - **kwargs - ): + "endpoint_compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, + "egress_public_network_access": { + "key": "egressPublicNetworkAccess", + "type": "str", + }, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, + "model": {"key": "model", "type": "str"}, + "model_mount_path": {"key": "modelMountPath", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, + } + + def __init__(self, **kwargs): """ :keyword code_configuration: Code configuration for the endpoint deployment. :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration @@ -14841,7 +15157,7 @@ def __init__( :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings """ super(ManagedOnlineDeployment, self).__init__(**kwargs) - self.endpoint_compute_type = 'Managed' # type: str + self.endpoint_compute_type = "Managed" # type: str class ManagedServiceIdentity(msrest.serialization.Model): @@ -14870,22 +15186,22 @@ class ManagedServiceIdentity(msrest.serialization.Model): """ _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, + "principal_id": {"readonly": True}, + "tenant_id": {"readonly": True}, + "type": {"required": True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{UserAssignedIdentity}", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword type: Required. Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", @@ -14901,8 +15217,10 @@ def __init__( super(ManagedServiceIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None - self.type = kwargs['type'] - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + self.type = kwargs["type"] + self.user_assigned_identities = kwargs.get( + "user_assigned_identities", None + ) class MedianStoppingPolicy(EarlyTerminationPolicy): @@ -14921,19 +15239,16 @@ class MedianStoppingPolicy(EarlyTerminationPolicy): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. :paramtype delay_evaluation: int @@ -14941,7 +15256,7 @@ def __init__( :paramtype evaluation_interval: int """ super(MedianStoppingPolicy, self).__init__(**kwargs) - self.policy_type = 'MedianStopping' # type: str + self.policy_type = "MedianStopping" # type: str class MLAssistConfiguration(msrest.serialization.Model): @@ -14958,23 +15273,22 @@ class MLAssistConfiguration(msrest.serialization.Model): """ _validation = { - 'ml_assist': {'required': True}, + "ml_assist": {"required": True}, } _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, + "ml_assist": {"key": "mlAssist", "type": "str"}, } _subtype_map = { - 'ml_assist': {'Disabled': 'MLAssistConfigurationDisabled', 'Enabled': 'MLAssistConfigurationEnabled'} + "ml_assist": { + "Disabled": "MLAssistConfigurationDisabled", + "Enabled": "MLAssistConfigurationEnabled", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(MLAssistConfiguration, self).__init__(**kwargs) self.ml_assist = None # type: Optional[str] @@ -14990,21 +15304,17 @@ class MLAssistConfigurationDisabled(MLAssistConfiguration): """ _validation = { - 'ml_assist': {'required': True}, + "ml_assist": {"required": True}, } _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, + "ml_assist": {"key": "mlAssist", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(MLAssistConfigurationDisabled, self).__init__(**kwargs) - self.ml_assist = 'Disabled' # type: str + self.ml_assist = "Disabled" # type: str class MLAssistConfigurationEnabled(MLAssistConfiguration): @@ -15023,21 +15333,30 @@ class MLAssistConfigurationEnabled(MLAssistConfiguration): """ _validation = { - 'ml_assist': {'required': True}, - 'inferencing_compute_binding': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'training_compute_binding': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "ml_assist": {"required": True}, + "inferencing_compute_binding": { + "required": True, + "pattern": r"[a-zA-Z0-9_]", + }, + "training_compute_binding": { + "required": True, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - 'inferencing_compute_binding': {'key': 'inferencingComputeBinding', 'type': 'str'}, - 'training_compute_binding': {'key': 'trainingComputeBinding', 'type': 'str'}, + "ml_assist": {"key": "mlAssist", "type": "str"}, + "inferencing_compute_binding": { + "key": "inferencingComputeBinding", + "type": "str", + }, + "training_compute_binding": { + "key": "trainingComputeBinding", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword inferencing_compute_binding: Required. [Required] AML compute binding used in inferencing. @@ -15046,9 +15365,11 @@ def __init__( :paramtype training_compute_binding: str """ super(MLAssistConfigurationEnabled, self).__init__(**kwargs) - self.ml_assist = 'Enabled' # type: str - self.inferencing_compute_binding = kwargs['inferencing_compute_binding'] - self.training_compute_binding = kwargs['training_compute_binding'] + self.ml_assist = "Enabled" # type: str + self.inferencing_compute_binding = kwargs[ + "inferencing_compute_binding" + ] + self.training_compute_binding = kwargs["training_compute_binding"] class MLFlowModelJobInput(JobInput, AssetJobInput): @@ -15070,21 +15391,18 @@ class MLFlowModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -15095,10 +15413,10 @@ def __init__( :paramtype description: str """ super(MLFlowModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'mlflow_model' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "mlflow_model" # type: str + self.description = kwargs.get("description", None) class MLFlowModelJobOutput(JobOutput, AssetJobOutput): @@ -15120,20 +15438,17 @@ class MLFlowModelJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", "Direct". @@ -15144,10 +15459,10 @@ def __init__( :paramtype description: str """ super(MLFlowModelJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'mlflow_model' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "mlflow_model" # type: str + self.description = kwargs.get("description", None) class MLTableData(DataVersionBaseProperties): @@ -15176,25 +15491,22 @@ class MLTableData(DataVersionBaseProperties): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'referenced_uris': {'key': 'referencedUris', 'type': '[str]'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, + "referenced_uris": {"key": "referencedUris", "type": "[str]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -15213,8 +15525,8 @@ def __init__( :paramtype referenced_uris: list[str] """ super(MLTableData, self).__init__(**kwargs) - self.data_type = 'mltable' # type: str - self.referenced_uris = kwargs.get('referenced_uris', None) + self.data_type = "mltable" # type: str + self.referenced_uris = kwargs.get("referenced_uris", None) class MLTableJobInput(JobInput, AssetJobInput): @@ -15236,21 +15548,18 @@ class MLTableJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -15261,10 +15570,10 @@ def __init__( :paramtype description: str """ super(MLTableJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'mltable' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "mltable" # type: str + self.description = kwargs.get("description", None) class MLTableJobOutput(JobOutput, AssetJobOutput): @@ -15286,20 +15595,17 @@ class MLTableJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", "Direct". @@ -15310,10 +15616,10 @@ def __init__( :paramtype description: str """ super(MLTableJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'mltable' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "mltable" # type: str + self.description = kwargs.get("description", None) class ModelContainer(Resource): @@ -15339,31 +15645,31 @@ class ModelContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "ModelContainerProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelContainerProperties """ super(ModelContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class ModelContainerProperties(AssetContainer): @@ -15390,25 +15696,22 @@ class ModelContainerProperties(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -15434,14 +15737,11 @@ class ModelContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ModelContainer]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of ModelContainer objects. If null, there are no additional pages. @@ -15449,9 +15749,11 @@ def __init__( :keyword value: An array of objects of type ModelContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelContainer] """ - super(ModelContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(ModelContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class ModelVersion(Resource): @@ -15477,31 +15779,28 @@ class ModelVersion(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelVersionProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "ModelVersionProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelVersionProperties """ super(ModelVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class ModelVersionProperties(AssetBase): @@ -15534,26 +15833,23 @@ class ModelVersionProperties(AssetBase): """ _validation = { - 'provisioning_state': {'readonly': True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'flavors': {'key': 'flavors', 'type': '{FlavorData}'}, - 'job_name': {'key': 'jobName', 'type': 'str'}, - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'model_uri': {'key': 'modelUri', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "flavors": {"key": "flavors", "type": "{FlavorData}"}, + "job_name": {"key": "jobName", "type": "str"}, + "model_type": {"key": "modelType", "type": "str"}, + "model_uri": {"key": "modelUri", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -15575,10 +15871,10 @@ def __init__( :paramtype model_uri: str """ super(ModelVersionProperties, self).__init__(**kwargs) - self.flavors = kwargs.get('flavors', None) - self.job_name = kwargs.get('job_name', None) - self.model_type = kwargs.get('model_type', None) - self.model_uri = kwargs.get('model_uri', None) + self.flavors = kwargs.get("flavors", None) + self.job_name = kwargs.get("job_name", None) + self.model_type = kwargs.get("model_type", None) + self.model_uri = kwargs.get("model_uri", None) self.provisioning_state = None @@ -15593,14 +15889,11 @@ class ModelVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelVersion]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ModelVersion]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of ModelVersion objects. If null, there are no additional pages. @@ -15609,8 +15902,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelVersion] """ super(ModelVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class Mpi(DistributionConfiguration): @@ -15626,25 +15919,27 @@ class Mpi(DistributionConfiguration): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, + "distribution_type": {"key": "distributionType", "type": "str"}, + "process_count_per_instance": { + "key": "processCountPerInstance", + "type": "int", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword process_count_per_instance: Number of processes per MPI node. :paramtype process_count_per_instance: int """ super(Mpi, self).__init__(**kwargs) - self.distribution_type = 'Mpi' # type: str - self.process_count_per_instance = kwargs.get('process_count_per_instance', None) + self.distribution_type = "Mpi" # type: str + self.process_count_per_instance = kwargs.get( + "process_count_per_instance", None + ) class NlpFixedParameters(msrest.serialization.Model): @@ -15675,21 +15970,24 @@ class NlpFixedParameters(msrest.serialization.Model): """ _attribute_map = { - 'gradient_accumulation_steps': {'key': 'gradientAccumulationSteps', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_ratio': {'key': 'warmupRatio', 'type': 'float'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, + "gradient_accumulation_steps": { + "key": "gradientAccumulationSteps", + "type": "int", + }, + "learning_rate": {"key": "learningRate", "type": "float"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "int"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, + "warmup_ratio": {"key": "warmupRatio", "type": "float"}, + "weight_decay": {"key": "weightDecay", "type": "float"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword gradient_accumulation_steps: Number of steps to accumulate gradients over before running a backward pass. @@ -15715,15 +16013,19 @@ def __init__( :paramtype weight_decay: float """ super(NlpFixedParameters, self).__init__(**kwargs) - self.gradient_accumulation_steps = kwargs.get('gradient_accumulation_steps', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.learning_rate_scheduler = kwargs.get('learning_rate_scheduler', None) - self.model_name = kwargs.get('model_name', None) - self.number_of_epochs = kwargs.get('number_of_epochs', None) - self.training_batch_size = kwargs.get('training_batch_size', None) - self.validation_batch_size = kwargs.get('validation_batch_size', None) - self.warmup_ratio = kwargs.get('warmup_ratio', None) - self.weight_decay = kwargs.get('weight_decay', None) + self.gradient_accumulation_steps = kwargs.get( + "gradient_accumulation_steps", None + ) + self.learning_rate = kwargs.get("learning_rate", None) + self.learning_rate_scheduler = kwargs.get( + "learning_rate_scheduler", None + ) + self.model_name = kwargs.get("model_name", None) + self.number_of_epochs = kwargs.get("number_of_epochs", None) + self.training_batch_size = kwargs.get("training_batch_size", None) + self.validation_batch_size = kwargs.get("validation_batch_size", None) + self.warmup_ratio = kwargs.get("warmup_ratio", None) + self.weight_decay = kwargs.get("weight_decay", None) class NlpParameterSubspace(msrest.serialization.Model): @@ -15752,21 +16054,24 @@ class NlpParameterSubspace(msrest.serialization.Model): """ _attribute_map = { - 'gradient_accumulation_steps': {'key': 'gradientAccumulationSteps', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_ratio': {'key': 'warmupRatio', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, + "gradient_accumulation_steps": { + "key": "gradientAccumulationSteps", + "type": "str", + }, + "learning_rate": {"key": "learningRate", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "str"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, + "warmup_ratio": {"key": "warmupRatio", "type": "str"}, + "weight_decay": {"key": "weightDecay", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword gradient_accumulation_steps: Number of steps to accumulate gradients over before running a backward pass. @@ -15790,15 +16095,19 @@ def __init__( :paramtype weight_decay: str """ super(NlpParameterSubspace, self).__init__(**kwargs) - self.gradient_accumulation_steps = kwargs.get('gradient_accumulation_steps', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.learning_rate_scheduler = kwargs.get('learning_rate_scheduler', None) - self.model_name = kwargs.get('model_name', None) - self.number_of_epochs = kwargs.get('number_of_epochs', None) - self.training_batch_size = kwargs.get('training_batch_size', None) - self.validation_batch_size = kwargs.get('validation_batch_size', None) - self.warmup_ratio = kwargs.get('warmup_ratio', None) - self.weight_decay = kwargs.get('weight_decay', None) + self.gradient_accumulation_steps = kwargs.get( + "gradient_accumulation_steps", None + ) + self.learning_rate = kwargs.get("learning_rate", None) + self.learning_rate_scheduler = kwargs.get( + "learning_rate_scheduler", None + ) + self.model_name = kwargs.get("model_name", None) + self.number_of_epochs = kwargs.get("number_of_epochs", None) + self.training_batch_size = kwargs.get("training_batch_size", None) + self.validation_batch_size = kwargs.get("validation_batch_size", None) + self.warmup_ratio = kwargs.get("warmup_ratio", None) + self.weight_decay = kwargs.get("weight_decay", None) class NlpSweepSettings(msrest.serialization.Model): @@ -15815,18 +16124,18 @@ class NlpSweepSettings(msrest.serialization.Model): """ _validation = { - 'sampling_algorithm': {'required': True}, + "sampling_algorithm": {"required": True}, } _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, + "sampling_algorithm": {"key": "samplingAlgorithm", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword early_termination: Type of early termination policy for the sweeping job. :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy @@ -15836,44 +16145,56 @@ def __init__( ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType """ super(NlpSweepSettings, self).__init__(**kwargs) - self.early_termination = kwargs.get('early_termination', None) - self.sampling_algorithm = kwargs['sampling_algorithm'] + self.early_termination = kwargs.get("early_termination", None) + self.sampling_algorithm = kwargs["sampling_algorithm"] class NlpVertical(msrest.serialization.Model): """Abstract class for NLP related AutoML tasks. -NLP - Natural Language Processing. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - } + NLP - Natural Language Processing. - def __init__( - self, - **kwargs - ): + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar fixed_parameters: Model/training parameters that will remain constant throughout + training. + :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] + :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + """ + + _attribute_map = { + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "NlpFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "search_space": { + "key": "searchSpace", + "type": "[NlpParameterSubspace]", + }, + "sweep_settings": {"key": "sweepSettings", "type": "NlpSweepSettings"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + } + + def __init__(self, **kwargs): """ :keyword featurization_settings: Featurization inputs needed for AutoML job. :paramtype featurization_settings: @@ -15892,12 +16213,14 @@ def __init__( :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ super(NlpVertical, self).__init__(**kwargs) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.fixed_parameters = kwargs.get("fixed_parameters", None) + self.limit_settings = kwargs.get("limit_settings", None) + self.search_space = kwargs.get("search_space", None) + self.sweep_settings = kwargs.get("sweep_settings", None) + self.validation_data = kwargs.get("validation_data", None) class NlpVerticalFeaturizationSettings(FeaturizationSettings): @@ -15908,13 +16231,10 @@ class NlpVerticalFeaturizationSettings(FeaturizationSettings): """ _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, + "dataset_language": {"key": "datasetLanguage", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword dataset_language: Dataset language, useful for the text data. :paramtype dataset_language: str @@ -15939,17 +16259,14 @@ class NlpVerticalLimitSettings(msrest.serialization.Model): """ _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_nodes': {'key': 'maxNodes', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_nodes": {"key": "maxNodes", "type": "int"}, + "max_trials": {"key": "maxTrials", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, + "trial_timeout": {"key": "trialTimeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword max_concurrent_trials: Maximum Concurrent AutoML iterations. :paramtype max_concurrent_trials: int @@ -15964,11 +16281,11 @@ def __init__( :paramtype trial_timeout: ~datetime.timedelta """ super(NlpVerticalLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', 1) - self.max_nodes = kwargs.get('max_nodes', 1) - self.max_trials = kwargs.get('max_trials', 1) - self.timeout = kwargs.get('timeout', "P7D") - self.trial_timeout = kwargs.get('trial_timeout', None) + self.max_concurrent_trials = kwargs.get("max_concurrent_trials", 1) + self.max_nodes = kwargs.get("max_nodes", 1) + self.max_trials = kwargs.get("max_trials", 1) + self.timeout = kwargs.get("timeout", "P7D") + self.trial_timeout = kwargs.get("trial_timeout", None) class NodeStateCounts(msrest.serialization.Model): @@ -15991,29 +16308,25 @@ class NodeStateCounts(msrest.serialization.Model): """ _validation = { - 'idle_node_count': {'readonly': True}, - 'running_node_count': {'readonly': True}, - 'preparing_node_count': {'readonly': True}, - 'unusable_node_count': {'readonly': True}, - 'leaving_node_count': {'readonly': True}, - 'preempted_node_count': {'readonly': True}, + "idle_node_count": {"readonly": True}, + "running_node_count": {"readonly": True}, + "preparing_node_count": {"readonly": True}, + "unusable_node_count": {"readonly": True}, + "leaving_node_count": {"readonly": True}, + "preempted_node_count": {"readonly": True}, } _attribute_map = { - 'idle_node_count': {'key': 'idleNodeCount', 'type': 'int'}, - 'running_node_count': {'key': 'runningNodeCount', 'type': 'int'}, - 'preparing_node_count': {'key': 'preparingNodeCount', 'type': 'int'}, - 'unusable_node_count': {'key': 'unusableNodeCount', 'type': 'int'}, - 'leaving_node_count': {'key': 'leavingNodeCount', 'type': 'int'}, - 'preempted_node_count': {'key': 'preemptedNodeCount', 'type': 'int'}, + "idle_node_count": {"key": "idleNodeCount", "type": "int"}, + "running_node_count": {"key": "runningNodeCount", "type": "int"}, + "preparing_node_count": {"key": "preparingNodeCount", "type": "int"}, + "unusable_node_count": {"key": "unusableNodeCount", "type": "int"}, + "leaving_node_count": {"key": "leavingNodeCount", "type": "int"}, + "preempted_node_count": {"key": "preemptedNodeCount", "type": "int"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NodeStateCounts, self).__init__(**kwargs) self.idle_node_count = None self.running_node_count = None @@ -16023,7 +16336,9 @@ def __init__( self.preempted_node_count = None -class NoneAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class NoneAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """NoneAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -16043,21 +16358,18 @@ class NoneAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2) """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: Category of the connection. :paramtype category: str @@ -16069,8 +16381,10 @@ def __init__( "JSON". :paramtype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat """ - super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'None' # type: str + super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__( + **kwargs + ) + self.auth_type = "None" # type: str class NoneDatastoreCredentials(DatastoreCredentials): @@ -16085,21 +16399,17 @@ class NoneDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, + "credentials_type": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NoneDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'None' # type: str + self.credentials_type = "None" # type: str class NotebookAccessTokenResult(msrest.serialization.Model): @@ -16126,33 +16436,29 @@ class NotebookAccessTokenResult(msrest.serialization.Model): """ _validation = { - 'notebook_resource_id': {'readonly': True}, - 'host_name': {'readonly': True}, - 'public_dns': {'readonly': True}, - 'access_token': {'readonly': True}, - 'token_type': {'readonly': True}, - 'expires_in': {'readonly': True}, - 'refresh_token': {'readonly': True}, - 'scope': {'readonly': True}, + "notebook_resource_id": {"readonly": True}, + "host_name": {"readonly": True}, + "public_dns": {"readonly": True}, + "access_token": {"readonly": True}, + "token_type": {"readonly": True}, + "expires_in": {"readonly": True}, + "refresh_token": {"readonly": True}, + "scope": {"readonly": True}, } _attribute_map = { - 'notebook_resource_id': {'key': 'notebookResourceId', 'type': 'str'}, - 'host_name': {'key': 'hostName', 'type': 'str'}, - 'public_dns': {'key': 'publicDns', 'type': 'str'}, - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, - 'expires_in': {'key': 'expiresIn', 'type': 'int'}, - 'refresh_token': {'key': 'refreshToken', 'type': 'str'}, - 'scope': {'key': 'scope', 'type': 'str'}, + "notebook_resource_id": {"key": "notebookResourceId", "type": "str"}, + "host_name": {"key": "hostName", "type": "str"}, + "public_dns": {"key": "publicDns", "type": "str"}, + "access_token": {"key": "accessToken", "type": "str"}, + "token_type": {"key": "tokenType", "type": "str"}, + "expires_in": {"key": "expiresIn", "type": "int"}, + "refresh_token": {"key": "refreshToken", "type": "str"}, + "scope": {"key": "scope", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NotebookAccessTokenResult, self).__init__(**kwargs) self.notebook_resource_id = None self.host_name = None @@ -16174,14 +16480,11 @@ class NotebookPreparationError(msrest.serialization.Model): """ _attribute_map = { - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'status_code': {'key': 'statusCode', 'type': 'int'}, + "error_message": {"key": "errorMessage", "type": "str"}, + "status_code": {"key": "statusCode", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword error_message: :paramtype error_message: str @@ -16189,8 +16492,8 @@ def __init__( :paramtype status_code: int """ super(NotebookPreparationError, self).__init__(**kwargs) - self.error_message = kwargs.get('error_message', None) - self.status_code = kwargs.get('status_code', None) + self.error_message = kwargs.get("error_message", None) + self.status_code = kwargs.get("status_code", None) class NotebookResourceInfo(msrest.serialization.Model): @@ -16206,15 +16509,15 @@ class NotebookResourceInfo(msrest.serialization.Model): """ _attribute_map = { - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'notebook_preparation_error': {'key': 'notebookPreparationError', 'type': 'NotebookPreparationError'}, + "fqdn": {"key": "fqdn", "type": "str"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "notebook_preparation_error": { + "key": "notebookPreparationError", + "type": "NotebookPreparationError", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword fqdn: :paramtype fqdn: str @@ -16225,9 +16528,11 @@ def __init__( ~azure.mgmt.machinelearningservices.models.NotebookPreparationError """ super(NotebookResourceInfo, self).__init__(**kwargs) - self.fqdn = kwargs.get('fqdn', None) - self.resource_id = kwargs.get('resource_id', None) - self.notebook_preparation_error = kwargs.get('notebook_preparation_error', None) + self.fqdn = kwargs.get("fqdn", None) + self.resource_id = kwargs.get("resource_id", None) + self.notebook_preparation_error = kwargs.get( + "notebook_preparation_error", None + ) class Objective(msrest.serialization.Model): @@ -16243,19 +16548,16 @@ class Objective(msrest.serialization.Model): """ _validation = { - 'goal': {'required': True}, - 'primary_metric': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "goal": {"required": True}, + "primary_metric": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'goal': {'key': 'goal', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "goal": {"key": "goal", "type": "str"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword goal: Required. [Required] Defines supported metric goals for hyperparameter tuning. Possible values include: "Minimize", "Maximize". @@ -16264,8 +16566,8 @@ def __init__( :paramtype primary_metric: str """ super(Objective, self).__init__(**kwargs) - self.goal = kwargs['goal'] - self.primary_metric = kwargs['primary_metric'] + self.goal = kwargs["goal"] + self.primary_metric = kwargs["primary_metric"] class OnlineDeployment(TrackedResource): @@ -16302,31 +16604,31 @@ class OnlineDeployment(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineDeploymentProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": { + "key": "properties", + "type": "OnlineDeploymentProperties", + }, + "sku": {"key": "sku", "type": "Sku"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -16343,13 +16645,15 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ super(OnlineDeployment, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) + self.identity = kwargs.get("identity", None) + self.kind = kwargs.get("kind", None) + self.properties = kwargs["properties"] + self.sku = kwargs.get("sku", None) -class OnlineDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class OnlineDeploymentTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of OnlineDeployment entities. :ivar next_link: The link to the next page of OnlineDeployment objects. If null, there are no @@ -16360,14 +16664,11 @@ class OnlineDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Mod """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineDeployment]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[OnlineDeployment]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of OnlineDeployment objects. If null, there are no additional pages. @@ -16375,9 +16676,11 @@ def __init__( :keyword value: An array of objects of type OnlineDeployment. :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineDeployment] """ - super(OnlineDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super( + OnlineDeploymentTrackedResourceArmPaginatedResult, self + ).__init__(**kwargs) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class OnlineEndpoint(TrackedResource): @@ -16414,31 +16717,31 @@ class OnlineEndpoint(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": { + "key": "properties", + "type": "OnlineEndpointProperties", + }, + "sku": {"key": "sku", "type": "Sku"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -16455,10 +16758,10 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ super(OnlineEndpoint, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) + self.identity = kwargs.get("identity", None) + self.kind = kwargs.get("kind", None) + self.properties = kwargs["properties"] + self.sku = kwargs.get("sku", None) class OnlineEndpointProperties(EndpointPropertiesBase): @@ -16504,30 +16807,27 @@ class OnlineEndpointProperties(EndpointPropertiesBase): """ _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "auth_mode": {"required": True}, + "scoring_uri": {"readonly": True}, + "swagger_uri": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'mirror_traffic': {'key': 'mirrorTraffic', 'type': '{int}'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, - 'traffic': {'key': 'traffic', 'type': '{int}'}, + "auth_mode": {"key": "authMode", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "keys": {"key": "keys", "type": "EndpointAuthKeys"}, + "properties": {"key": "properties", "type": "{str}"}, + "scoring_uri": {"key": "scoringUri", "type": "str"}, + "swagger_uri": {"key": "swaggerUri", "type": "str"}, + "compute": {"key": "compute", "type": "str"}, + "mirror_traffic": {"key": "mirrorTraffic", "type": "{int}"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "public_network_access": {"key": "publicNetworkAccess", "type": "str"}, + "traffic": {"key": "traffic", "type": "{int}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' @@ -16556,14 +16856,16 @@ def __init__( :paramtype traffic: dict[str, int] """ super(OnlineEndpointProperties, self).__init__(**kwargs) - self.compute = kwargs.get('compute', None) - self.mirror_traffic = kwargs.get('mirror_traffic', None) + self.compute = kwargs.get("compute", None) + self.mirror_traffic = kwargs.get("mirror_traffic", None) self.provisioning_state = None - self.public_network_access = kwargs.get('public_network_access', None) - self.traffic = kwargs.get('traffic', None) + self.public_network_access = kwargs.get("public_network_access", None) + self.traffic = kwargs.get("traffic", None) -class OnlineEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class OnlineEndpointTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of OnlineEndpoint entities. :ivar next_link: The link to the next page of OnlineEndpoint objects. If null, there are no @@ -16574,14 +16876,11 @@ class OnlineEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineEndpoint]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[OnlineEndpoint]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of OnlineEndpoint objects. If null, there are no additional pages. @@ -16589,9 +16888,11 @@ def __init__( :keyword value: An array of objects of type OnlineEndpoint. :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] """ - super(OnlineEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(OnlineEndpointTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class OnlineRequestSettings(msrest.serialization.Model): @@ -16610,15 +16911,15 @@ class OnlineRequestSettings(msrest.serialization.Model): """ _attribute_map = { - 'max_concurrent_requests_per_instance': {'key': 'maxConcurrentRequestsPerInstance', 'type': 'int'}, - 'max_queue_wait': {'key': 'maxQueueWait', 'type': 'duration'}, - 'request_timeout': {'key': 'requestTimeout', 'type': 'duration'}, + "max_concurrent_requests_per_instance": { + "key": "maxConcurrentRequestsPerInstance", + "type": "int", + }, + "max_queue_wait": {"key": "maxQueueWait", "type": "duration"}, + "request_timeout": {"key": "requestTimeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword max_concurrent_requests_per_instance: The number of maximum concurrent requests per node allowed per deployment. Defaults to 1. @@ -16632,9 +16933,11 @@ def __init__( :paramtype request_timeout: ~datetime.timedelta """ super(OnlineRequestSettings, self).__init__(**kwargs) - self.max_concurrent_requests_per_instance = kwargs.get('max_concurrent_requests_per_instance', 1) - self.max_queue_wait = kwargs.get('max_queue_wait', "PT0.5S") - self.request_timeout = kwargs.get('request_timeout', "PT5S") + self.max_concurrent_requests_per_instance = kwargs.get( + "max_concurrent_requests_per_instance", 1 + ) + self.max_queue_wait = kwargs.get("max_queue_wait", "PT0.5S") + self.request_timeout = kwargs.get("request_timeout", "PT5S") class OutputPathAssetReference(AssetReferenceBase): @@ -16652,19 +16955,16 @@ class OutputPathAssetReference(AssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "job_id": {"key": "jobId", "type": "str"}, + "path": {"key": "path", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword job_id: ARM resource ID of the job. :paramtype job_id: str @@ -16672,9 +16972,9 @@ def __init__( :paramtype path: str """ super(OutputPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'OutputPath' # type: str - self.job_id = kwargs.get('job_id', None) - self.path = kwargs.get('path', None) + self.reference_type = "OutputPath" # type: str + self.job_id = kwargs.get("job_id", None) + self.path = kwargs.get("path", None) class PaginatedComputeResourcesList(msrest.serialization.Model): @@ -16687,14 +16987,11 @@ class PaginatedComputeResourcesList(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[ComputeResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[ComputeResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: An array of Machine Learning compute objects wrapped in ARM resource envelope. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComputeResource] @@ -16702,8 +16999,8 @@ def __init__( :paramtype next_link: str """ super(PaginatedComputeResourcesList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get("value", None) + self.next_link = kwargs.get("next_link", None) class PartialBatchDeployment(msrest.serialization.Model): @@ -16714,22 +17011,21 @@ class PartialBatchDeployment(msrest.serialization.Model): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: Description of the endpoint deployment. :paramtype description: str """ super(PartialBatchDeployment, self).__init__(**kwargs) - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) -class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties(msrest.serialization.Model): +class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties( + msrest.serialization.Model +): """Strictly used in update requests. :ivar properties: Additional attributes of the entity. @@ -16739,23 +17035,23 @@ class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties(msrest.s """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'PartialBatchDeployment'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "properties": {"key": "properties", "type": "PartialBatchDeployment"}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.PartialBatchDeployment :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] """ - super(PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) + super( + PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, + self, + ).__init__(**kwargs) + self.properties = kwargs.get("properties", None) + self.tags = kwargs.get("tags", None) class PartialManagedServiceIdentity(msrest.serialization.Model): @@ -16773,14 +17069,14 @@ class PartialManagedServiceIdentity(msrest.serialization.Model): """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{object}'}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{object}", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword type: Managed service identity (system assigned and/or user assigned identities). Possible values include: "None", "SystemAssigned", "UserAssigned", @@ -16793,8 +17089,10 @@ def __init__( :paramtype user_assigned_identities: dict[str, any] """ super(PartialManagedServiceIdentity, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + self.type = kwargs.get("type", None) + self.user_assigned_identities = kwargs.get( + "user_assigned_identities", None + ) class PartialMinimalTrackedResource(msrest.serialization.Model): @@ -16805,19 +17103,16 @@ class PartialMinimalTrackedResource(msrest.serialization.Model): """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] """ super(PartialMinimalTrackedResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) + self.tags = kwargs.get("tags", None) class PartialMinimalTrackedResourceWithIdentity(PartialMinimalTrackedResource): @@ -16830,22 +17125,24 @@ class PartialMinimalTrackedResourceWithIdentity(PartialMinimalTrackedResource): """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, + "tags": {"key": "tags", "type": "{str}"}, + "identity": { + "key": "identity", + "type": "PartialManagedServiceIdentity", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] :keyword identity: Managed service identity (system assigned and/or user assigned identities). :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity """ - super(PartialMinimalTrackedResourceWithIdentity, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) + super(PartialMinimalTrackedResourceWithIdentity, self).__init__( + **kwargs + ) + self.identity = kwargs.get("identity", None) class PartialMinimalTrackedResourceWithSku(PartialMinimalTrackedResource): @@ -16858,14 +17155,11 @@ class PartialMinimalTrackedResourceWithSku(PartialMinimalTrackedResource): """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "PartialSku"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -16873,7 +17167,7 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku """ super(PartialMinimalTrackedResourceWithSku, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) + self.sku = kwargs.get("sku", None) class PartialRegistryPartialTrackedResource(msrest.serialization.Model): @@ -16895,18 +17189,18 @@ class PartialRegistryPartialTrackedResource(msrest.serialization.Model): """ _attribute_map = { - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'object'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "identity": { + "key": "identity", + "type": "PartialManagedServiceIdentity", + }, + "kind": {"key": "kind", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "properties": {"key": "properties", "type": "object"}, + "sku": {"key": "sku", "type": "PartialSku"}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword identity: Managed service identity (system assigned and/or user assigned identities). :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity @@ -16923,12 +17217,12 @@ def __init__( :paramtype tags: dict[str, str] """ super(PartialRegistryPartialTrackedResource, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.location = kwargs.get('location', None) - self.properties = kwargs.get('properties', None) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) + self.identity = kwargs.get("identity", None) + self.kind = kwargs.get("kind", None) + self.location = kwargs.get("location", None) + self.properties = kwargs.get("properties", None) + self.sku = kwargs.get("sku", None) + self.tags = kwargs.get("tags", None) class PartialSku(msrest.serialization.Model): @@ -16952,17 +17246,14 @@ class PartialSku(msrest.serialization.Model): """ _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'int'}, - 'family': {'key': 'family', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, + "capacity": {"key": "capacity", "type": "int"}, + "family": {"key": "family", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "size": {"key": "size", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword capacity: If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted. @@ -16981,11 +17272,11 @@ def __init__( :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier """ super(PartialSku, self).__init__(**kwargs) - self.capacity = kwargs.get('capacity', None) - self.family = kwargs.get('family', None) - self.name = kwargs.get('name', None) - self.size = kwargs.get('size', None) - self.tier = kwargs.get('tier', None) + self.capacity = kwargs.get("capacity", None) + self.family = kwargs.get("family", None) + self.name = kwargs.get("name", None) + self.size = kwargs.get("size", None) + self.tier = kwargs.get("tier", None) class Password(msrest.serialization.Model): @@ -17000,27 +17291,25 @@ class Password(msrest.serialization.Model): """ _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, + "name": {"readonly": True}, + "value": {"readonly": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "value": {"key": "value", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Password, self).__init__(**kwargs) self.name = None self.value = None -class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class PATAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """PATAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -17043,22 +17332,22 @@ class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionPersonalAccessToken'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionPersonalAccessToken", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: Category of the connection. :paramtype category: str @@ -17073,9 +17362,11 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken """ - super(PATAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'PAT' # type: str - self.credentials = kwargs.get('credentials', None) + super(PATAuthTypeWorkspaceConnectionProperties, self).__init__( + **kwargs + ) + self.auth_type = "PAT" # type: str + self.credentials = kwargs.get("credentials", None) class PersonalComputeInstanceSettings(msrest.serialization.Model): @@ -17086,19 +17377,16 @@ class PersonalComputeInstanceSettings(msrest.serialization.Model): """ _attribute_map = { - 'assigned_user': {'key': 'assignedUser', 'type': 'AssignedUser'}, + "assigned_user": {"key": "assignedUser", "type": "AssignedUser"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword assigned_user: A user explicitly assigned to a personal compute instance. :paramtype assigned_user: ~azure.mgmt.machinelearningservices.models.AssignedUser """ super(PersonalComputeInstanceSettings, self).__init__(**kwargs) - self.assigned_user = kwargs.get('assigned_user', None) + self.assigned_user = kwargs.get("assigned_user", None) class PipelineJob(JobBaseProperties): @@ -17152,34 +17440,31 @@ class PipelineJob(JobBaseProperties): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, + "job_type": {"required": True}, + "status": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'jobs': {'key': 'jobs', 'type': '{object}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'settings': {'key': 'settings', 'type': 'object'}, - 'source_job_id': {'key': 'sourceJobId', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "jobs": {"key": "jobs", "type": "{object}"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "settings": {"key": "settings", "type": "object"}, + "source_job_id": {"key": "sourceJobId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -17217,12 +17502,12 @@ def __init__( :paramtype source_job_id: str """ super(PipelineJob, self).__init__(**kwargs) - self.job_type = 'Pipeline' # type: str - self.inputs = kwargs.get('inputs', None) - self.jobs = kwargs.get('jobs', None) - self.outputs = kwargs.get('outputs', None) - self.settings = kwargs.get('settings', None) - self.source_job_id = kwargs.get('source_job_id', None) + self.job_type = "Pipeline" # type: str + self.inputs = kwargs.get("inputs", None) + self.jobs = kwargs.get("jobs", None) + self.outputs = kwargs.get("outputs", None) + self.settings = kwargs.get("settings", None) + self.source_job_id = kwargs.get("source_job_id", None) class PrivateEndpoint(msrest.serialization.Model): @@ -17237,21 +17522,17 @@ class PrivateEndpoint(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'subnet_arm_id': {'readonly': True}, + "id": {"readonly": True}, + "subnet_arm_id": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'subnet_arm_id': {'key': 'subnetArmId', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "subnet_arm_id": {"key": "subnetArmId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(PrivateEndpoint, self).__init__(**kwargs) self.id = None self.subnet_arm_id = None @@ -17294,31 +17575,37 @@ class PrivateEndpointConnection(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "private_endpoint": { + "key": "properties.privateEndpoint", + "type": "PrivateEndpoint", + }, + "private_link_service_connection_state": { + "key": "properties.privateLinkServiceConnectionState", + "type": "PrivateLinkServiceConnectionState", + }, + "provisioning_state": { + "key": "properties.provisioningState", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword identity: The identity of the resource. :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity @@ -17336,12 +17623,14 @@ def __init__( ~azure.mgmt.machinelearningservices.models.PrivateLinkServiceConnectionState """ super(PrivateEndpointConnection, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) - self.private_endpoint = kwargs.get('private_endpoint', None) - self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + self.identity = kwargs.get("identity", None) + self.location = kwargs.get("location", None) + self.tags = kwargs.get("tags", None) + self.sku = kwargs.get("sku", None) + self.private_endpoint = kwargs.get("private_endpoint", None) + self.private_link_service_connection_state = kwargs.get( + "private_link_service_connection_state", None + ) self.provisioning_state = None @@ -17353,19 +17642,16 @@ class PrivateEndpointConnectionListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + "value": {"key": "value", "type": "[PrivateEndpointConnection]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Array of private endpoint connections. :paramtype value: list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] """ super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class PrivateLinkResource(Resource): @@ -17401,32 +17687,35 @@ class PrivateLinkResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'group_id': {'readonly': True}, - 'required_members': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "group_id": {"readonly": True}, + "required_members": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, - 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "group_id": {"key": "properties.groupId", "type": "str"}, + "required_members": { + "key": "properties.requiredMembers", + "type": "[str]", + }, + "required_zone_names": { + "key": "properties.requiredZoneNames", + "type": "[str]", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword identity: The identity of the resource. :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity @@ -17440,13 +17729,13 @@ def __init__( :paramtype required_zone_names: list[str] """ super(PrivateLinkResource, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) + self.identity = kwargs.get("identity", None) + self.location = kwargs.get("location", None) + self.tags = kwargs.get("tags", None) + self.sku = kwargs.get("sku", None) self.group_id = None self.required_members = None - self.required_zone_names = kwargs.get('required_zone_names', None) + self.required_zone_names = kwargs.get("required_zone_names", None) class PrivateLinkResourceListResult(msrest.serialization.Model): @@ -17457,19 +17746,16 @@ class PrivateLinkResourceListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + "value": {"key": "value", "type": "[PrivateLinkResource]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Array of private link resources. :paramtype value: list[~azure.mgmt.machinelearningservices.models.PrivateLinkResource] """ super(PrivateLinkResourceListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class PrivateLinkServiceConnectionState(msrest.serialization.Model): @@ -17488,15 +17774,12 @@ class PrivateLinkServiceConnectionState(msrest.serialization.Model): """ _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + "status": {"key": "status", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "actions_required": {"key": "actionsRequired", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword status: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Possible values include: "Pending", "Approved", "Rejected", @@ -17510,9 +17793,9 @@ def __init__( :paramtype actions_required: str """ super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.description = kwargs.get('description', None) - self.actions_required = kwargs.get('actions_required', None) + self.status = kwargs.get("status", None) + self.description = kwargs.get("description", None) + self.actions_required = kwargs.get("actions_required", None) class ProbeSettings(msrest.serialization.Model): @@ -17531,17 +17814,14 @@ class ProbeSettings(msrest.serialization.Model): """ _attribute_map = { - 'failure_threshold': {'key': 'failureThreshold', 'type': 'int'}, - 'initial_delay': {'key': 'initialDelay', 'type': 'duration'}, - 'period': {'key': 'period', 'type': 'duration'}, - 'success_threshold': {'key': 'successThreshold', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "failure_threshold": {"key": "failureThreshold", "type": "int"}, + "initial_delay": {"key": "initialDelay", "type": "duration"}, + "period": {"key": "period", "type": "duration"}, + "success_threshold": {"key": "successThreshold", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword failure_threshold: The number of failures to allow before returning an unhealthy status. @@ -17556,11 +17836,11 @@ def __init__( :paramtype timeout: ~datetime.timedelta """ super(ProbeSettings, self).__init__(**kwargs) - self.failure_threshold = kwargs.get('failure_threshold', 30) - self.initial_delay = kwargs.get('initial_delay', None) - self.period = kwargs.get('period', "PT10S") - self.success_threshold = kwargs.get('success_threshold', 1) - self.timeout = kwargs.get('timeout', "PT2S") + self.failure_threshold = kwargs.get("failure_threshold", 30) + self.initial_delay = kwargs.get("initial_delay", None) + self.period = kwargs.get("period", "PT10S") + self.success_threshold = kwargs.get("success_threshold", 1) + self.timeout = kwargs.get("timeout", "PT2S") class ProgressMetrics(msrest.serialization.Model): @@ -17580,25 +17860,33 @@ class ProgressMetrics(msrest.serialization.Model): """ _validation = { - 'completed_datapoint_count': {'readonly': True}, - 'incremental_data_last_refresh_date_time': {'readonly': True}, - 'skipped_datapoint_count': {'readonly': True}, - 'total_datapoint_count': {'readonly': True}, + "completed_datapoint_count": {"readonly": True}, + "incremental_data_last_refresh_date_time": {"readonly": True}, + "skipped_datapoint_count": {"readonly": True}, + "total_datapoint_count": {"readonly": True}, } _attribute_map = { - 'completed_datapoint_count': {'key': 'completedDatapointCount', 'type': 'long'}, - 'incremental_data_last_refresh_date_time': {'key': 'incrementalDataLastRefreshDateTime', 'type': 'iso-8601'}, - 'skipped_datapoint_count': {'key': 'skippedDatapointCount', 'type': 'long'}, - 'total_datapoint_count': {'key': 'totalDatapointCount', 'type': 'long'}, + "completed_datapoint_count": { + "key": "completedDatapointCount", + "type": "long", + }, + "incremental_data_last_refresh_date_time": { + "key": "incrementalDataLastRefreshDateTime", + "type": "iso-8601", + }, + "skipped_datapoint_count": { + "key": "skippedDatapointCount", + "type": "long", + }, + "total_datapoint_count": { + "key": "totalDatapointCount", + "type": "long", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ProgressMetrics, self).__init__(**kwargs) self.completed_datapoint_count = None self.incremental_data_last_refresh_date_time = None @@ -17619,25 +17907,27 @@ class PyTorch(DistributionConfiguration): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, + "distribution_type": {"key": "distributionType", "type": "str"}, + "process_count_per_instance": { + "key": "processCountPerInstance", + "type": "int", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword process_count_per_instance: Number of processes per node. :paramtype process_count_per_instance: int """ super(PyTorch, self).__init__(**kwargs) - self.distribution_type = 'PyTorch' # type: str - self.process_count_per_instance = kwargs.get('process_count_per_instance', None) + self.distribution_type = "PyTorch" # type: str + self.process_count_per_instance = kwargs.get( + "process_count_per_instance", None + ) class QuotaBaseProperties(msrest.serialization.Model): @@ -17654,16 +17944,13 @@ class QuotaBaseProperties(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "limit": {"key": "limit", "type": "long"}, + "unit": {"key": "unit", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword id: Specifies the resource ID. :paramtype id: str @@ -17676,10 +17963,10 @@ def __init__( :paramtype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit """ super(QuotaBaseProperties, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.type = kwargs.get('type', None) - self.limit = kwargs.get('limit', None) - self.unit = kwargs.get('unit', None) + self.id = kwargs.get("id", None) + self.type = kwargs.get("type", None) + self.limit = kwargs.get("limit", None) + self.unit = kwargs.get("unit", None) class QuotaUpdateParameters(msrest.serialization.Model): @@ -17692,14 +17979,11 @@ class QuotaUpdateParameters(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[QuotaBaseProperties]'}, - 'location': {'key': 'location', 'type': 'str'}, + "value": {"key": "value", "type": "[QuotaBaseProperties]"}, + "location": {"key": "location", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: The list for update quota. :paramtype value: list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] @@ -17707,8 +17991,8 @@ def __init__( :paramtype location: str """ super(QuotaUpdateParameters, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.location = kwargs.get('location', None) + self.value = kwargs.get("value", None) + self.location = kwargs.get("location", None) class RandomSamplingAlgorithm(SamplingAlgorithm): @@ -17728,19 +18012,19 @@ class RandomSamplingAlgorithm(SamplingAlgorithm): """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - 'rule': {'key': 'rule', 'type': 'str'}, - 'seed': {'key': 'seed', 'type': 'int'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, + "rule": {"key": "rule", "type": "str"}, + "seed": {"key": "seed", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword rule: The specific type of random algorithm. Possible values include: "Random", "Sobol". @@ -17749,9 +18033,9 @@ def __init__( :paramtype seed: int """ super(RandomSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Random' # type: str - self.rule = kwargs.get('rule', None) - self.seed = kwargs.get('seed', None) + self.sampling_algorithm_type = "Random" # type: str + self.rule = kwargs.get("rule", None) + self.seed = kwargs.get("seed", None) class Recurrence(msrest.serialization.Model): @@ -17773,17 +18057,14 @@ class Recurrence(msrest.serialization.Model): """ _attribute_map = { - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceSchedule'}, + "frequency": {"key": "frequency", "type": "str"}, + "interval": {"key": "interval", "type": "int"}, + "start_time": {"key": "startTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "schedule": {"key": "schedule", "type": "RecurrenceSchedule"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword frequency: [Required] The frequency to trigger schedule. Possible values include: "Minute", "Hour", "Day", "Week", "Month". @@ -17800,11 +18081,11 @@ def __init__( :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule """ super(Recurrence, self).__init__(**kwargs) - self.frequency = kwargs.get('frequency', None) - self.interval = kwargs.get('interval', None) - self.start_time = kwargs.get('start_time', None) - self.time_zone = kwargs.get('time_zone', "UTC") - self.schedule = kwargs.get('schedule', None) + self.frequency = kwargs.get("frequency", None) + self.interval = kwargs.get("interval", None) + self.start_time = kwargs.get("start_time", None) + self.time_zone = kwargs.get("time_zone", "UTC") + self.schedule = kwargs.get("schedule", None) class RecurrenceSchedule(msrest.serialization.Model): @@ -17823,21 +18104,18 @@ class RecurrenceSchedule(msrest.serialization.Model): """ _validation = { - 'hours': {'required': True}, - 'minutes': {'required': True}, + "hours": {"required": True}, + "minutes": {"required": True}, } _attribute_map = { - 'hours': {'key': 'hours', 'type': '[int]'}, - 'minutes': {'key': 'minutes', 'type': '[int]'}, - 'month_days': {'key': 'monthDays', 'type': '[int]'}, - 'week_days': {'key': 'weekDays', 'type': '[str]'}, + "hours": {"key": "hours", "type": "[int]"}, + "minutes": {"key": "minutes", "type": "[int]"}, + "month_days": {"key": "monthDays", "type": "[int]"}, + "week_days": {"key": "weekDays", "type": "[str]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword hours: Required. [Required] List of hours for the schedule. :paramtype hours: list[int] @@ -17849,10 +18127,10 @@ def __init__( :paramtype week_days: list[str or ~azure.mgmt.machinelearningservices.models.WeekDay] """ super(RecurrenceSchedule, self).__init__(**kwargs) - self.hours = kwargs['hours'] - self.minutes = kwargs['minutes'] - self.month_days = kwargs.get('month_days', None) - self.week_days = kwargs.get('week_days', None) + self.hours = kwargs["hours"] + self.minutes = kwargs["minutes"] + self.month_days = kwargs.get("month_days", None) + self.week_days = kwargs.get("week_days", None) class RecurrenceTrigger(TriggerBase): @@ -17885,25 +18163,22 @@ class RecurrenceTrigger(TriggerBase): """ _validation = { - 'trigger_type': {'required': True}, - 'frequency': {'required': True}, - 'interval': {'required': True}, + "trigger_type": {"required": True}, + "frequency": {"required": True}, + "interval": {"required": True}, } _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceSchedule'}, + "end_time": {"key": "endTime", "type": "str"}, + "start_time": {"key": "startTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "trigger_type": {"key": "triggerType", "type": "str"}, + "frequency": {"key": "frequency", "type": "str"}, + "interval": {"key": "interval", "type": "int"}, + "schedule": {"key": "schedule", "type": "RecurrenceSchedule"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer https://en.wikipedia.org/wiki/ISO_8601. @@ -17927,10 +18202,10 @@ def __init__( :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule """ super(RecurrenceTrigger, self).__init__(**kwargs) - self.trigger_type = 'Recurrence' # type: str - self.frequency = kwargs['frequency'] - self.interval = kwargs['interval'] - self.schedule = kwargs.get('schedule', None) + self.trigger_type = "Recurrence" # type: str + self.frequency = kwargs["frequency"] + self.interval = kwargs["interval"] + self.schedule = kwargs.get("schedule", None) class RegenerateEndpointKeysRequest(msrest.serialization.Model): @@ -17946,18 +18221,15 @@ class RegenerateEndpointKeysRequest(msrest.serialization.Model): """ _validation = { - 'key_type': {'required': True}, + "key_type": {"required": True}, } _attribute_map = { - 'key_type': {'key': 'keyType', 'type': 'str'}, - 'key_value': {'key': 'keyValue', 'type': 'str'}, + "key_type": {"key": "keyType", "type": "str"}, + "key_value": {"key": "keyValue", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword key_type: Required. [Required] Specification for which type of key to generate. Primary or Secondary. Possible values include: "Primary", "Secondary". @@ -17966,8 +18238,8 @@ def __init__( :paramtype key_value: str """ super(RegenerateEndpointKeysRequest, self).__init__(**kwargs) - self.key_type = kwargs['key_type'] - self.key_value = kwargs.get('key_value', None) + self.key_type = kwargs["key_type"] + self.key_value = kwargs.get("key_value", None) class Registry(TrackedResource): @@ -18004,31 +18276,28 @@ class Registry(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'RegistryProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": {"key": "properties", "type": "RegistryProperties"}, + "sku": {"key": "sku", "type": "Sku"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -18045,10 +18314,10 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ super(Registry, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) + self.identity = kwargs.get("identity", None) + self.kind = kwargs.get("kind", None) + self.properties = kwargs["properties"] + self.sku = kwargs.get("sku", None) class RegistryListCredentialsResult(msrest.serialization.Model): @@ -18065,20 +18334,17 @@ class RegistryListCredentialsResult(msrest.serialization.Model): """ _validation = { - 'location': {'readonly': True}, - 'username': {'readonly': True}, + "location": {"readonly": True}, + "username": {"readonly": True}, } _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'username': {'key': 'username', 'type': 'str'}, - 'passwords': {'key': 'passwords', 'type': '[Password]'}, + "location": {"key": "location", "type": "str"}, + "username": {"key": "username", "type": "str"}, + "passwords": {"key": "passwords", "type": "[Password]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword passwords: :paramtype passwords: list[~azure.mgmt.machinelearningservices.models.Password] @@ -18086,7 +18352,7 @@ def __init__( super(RegistryListCredentialsResult, self).__init__(**kwargs) self.location = None self.username = None - self.passwords = kwargs.get('passwords', None) + self.passwords = kwargs.get("passwords", None) class RegistryProperties(ResourceBase): @@ -18119,23 +18385,32 @@ class RegistryProperties(ResourceBase): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, - 'discovery_url': {'key': 'discoveryUrl', 'type': 'str'}, - 'intellectual_property_publisher': {'key': 'intellectualPropertyPublisher', 'type': 'str'}, - 'managed_resource_group': {'key': 'managedResourceGroup', 'type': 'ArmResourceId'}, - 'ml_flow_registry_uri': {'key': 'mlFlowRegistryUri', 'type': 'str'}, - 'private_link_count': {'key': 'privateLinkCount', 'type': 'int'}, - 'region_details': {'key': 'regionDetails', 'type': '[RegistryRegionArmDetails]'}, - 'managed_resource_group_tags': {'key': 'managedResourceGroupTags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "public_network_access": {"key": "publicNetworkAccess", "type": "str"}, + "discovery_url": {"key": "discoveryUrl", "type": "str"}, + "intellectual_property_publisher": { + "key": "intellectualPropertyPublisher", + "type": "str", + }, + "managed_resource_group": { + "key": "managedResourceGroup", + "type": "ArmResourceId", + }, + "ml_flow_registry_uri": {"key": "mlFlowRegistryUri", "type": "str"}, + "private_link_count": {"key": "privateLinkCount", "type": "int"}, + "region_details": { + "key": "regionDetails", + "type": "[RegistryRegionArmDetails]", + }, + "managed_resource_group_tags": { + "key": "managedResourceGroupTags", + "type": "{str}", + }, + } + + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -18163,14 +18438,20 @@ def __init__( :paramtype managed_resource_group_tags: dict[str, str] """ super(RegistryProperties, self).__init__(**kwargs) - self.public_network_access = kwargs.get('public_network_access', None) - self.discovery_url = kwargs.get('discovery_url', None) - self.intellectual_property_publisher = kwargs.get('intellectual_property_publisher', None) - self.managed_resource_group = kwargs.get('managed_resource_group', None) - self.ml_flow_registry_uri = kwargs.get('ml_flow_registry_uri', None) - self.private_link_count = kwargs.get('private_link_count', None) - self.region_details = kwargs.get('region_details', None) - self.managed_resource_group_tags = kwargs.get('managed_resource_group_tags', None) + self.public_network_access = kwargs.get("public_network_access", None) + self.discovery_url = kwargs.get("discovery_url", None) + self.intellectual_property_publisher = kwargs.get( + "intellectual_property_publisher", None + ) + self.managed_resource_group = kwargs.get( + "managed_resource_group", None + ) + self.ml_flow_registry_uri = kwargs.get("ml_flow_registry_uri", None) + self.private_link_count = kwargs.get("private_link_count", None) + self.region_details = kwargs.get("region_details", None) + self.managed_resource_group_tags = kwargs.get( + "managed_resource_group_tags", None + ) class RegistryRegionArmDetails(msrest.serialization.Model): @@ -18186,15 +18467,15 @@ class RegistryRegionArmDetails(msrest.serialization.Model): """ _attribute_map = { - 'acr_details': {'key': 'acrDetails', 'type': '[AcrDetails]'}, - 'location': {'key': 'location', 'type': 'str'}, - 'storage_account_details': {'key': 'storageAccountDetails', 'type': '[StorageAccountDetails]'}, + "acr_details": {"key": "acrDetails", "type": "[AcrDetails]"}, + "location": {"key": "location", "type": "str"}, + "storage_account_details": { + "key": "storageAccountDetails", + "type": "[StorageAccountDetails]", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword acr_details: List of ACR accounts. :paramtype acr_details: list[~azure.mgmt.machinelearningservices.models.AcrDetails] @@ -18205,9 +18486,11 @@ def __init__( list[~azure.mgmt.machinelearningservices.models.StorageAccountDetails] """ super(RegistryRegionArmDetails, self).__init__(**kwargs) - self.acr_details = kwargs.get('acr_details', None) - self.location = kwargs.get('location', None) - self.storage_account_details = kwargs.get('storage_account_details', None) + self.acr_details = kwargs.get("acr_details", None) + self.location = kwargs.get("location", None) + self.storage_account_details = kwargs.get( + "storage_account_details", None + ) class RegistryTrackedResourceArmPaginatedResult(msrest.serialization.Model): @@ -18221,14 +18504,11 @@ class RegistryTrackedResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Registry]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[Registry]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of Registry objects. If null, there are no additional pages. @@ -18236,9 +18516,11 @@ def __init__( :keyword value: An array of objects of type Registry. :paramtype value: list[~azure.mgmt.machinelearningservices.models.Registry] """ - super(RegistryTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(RegistryTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class Regression(AutoMLVertical, TableVertical): @@ -18305,35 +18587,59 @@ class Regression(AutoMLVertical, TableVertical): """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'RegressionTrainingSettings'}, - } - - def __init__( - self, - **kwargs - ): + "task_type": {"required": True}, + "training_data": {"required": True}, + } + + _attribute_map = { + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "TableFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "search_space": { + "key": "searchSpace", + "type": "[TableParameterSubspace]", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "TableSweepSettings", + }, + "test_data": {"key": "testData", "type": "MLTableJobInput"}, + "test_data_size": {"key": "testDataSize", "type": "float"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "weight_column_name": {"key": "weightColumnName", "type": "str"}, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, + "training_settings": { + "key": "trainingSettings", + "type": "RegressionTrainingSettings", + }, + } + + def __init__(self, **kwargs): """ :keyword cv_split_column_names: Columns to use for CVSplit data. :paramtype cv_split_column_names: list[str] @@ -18391,24 +18697,26 @@ def __init__( ~azure.mgmt.machinelearningservices.models.RegressionTrainingSettings """ super(Regression, self).__init__(**kwargs) - self.cv_split_column_names = kwargs.get('cv_split_column_names', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.test_data = kwargs.get('test_data', None) - self.test_data_size = kwargs.get('test_data_size', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.weight_column_name = kwargs.get('weight_column_name', None) - self.task_type = 'Regression' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.training_settings = kwargs.get('training_settings', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.cv_split_column_names = kwargs.get("cv_split_column_names", None) + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.fixed_parameters = kwargs.get("fixed_parameters", None) + self.limit_settings = kwargs.get("limit_settings", None) + self.n_cross_validations = kwargs.get("n_cross_validations", None) + self.search_space = kwargs.get("search_space", None) + self.sweep_settings = kwargs.get("sweep_settings", None) + self.test_data = kwargs.get("test_data", None) + self.test_data_size = kwargs.get("test_data_size", None) + self.validation_data = kwargs.get("validation_data", None) + self.validation_data_size = kwargs.get("validation_data_size", None) + self.weight_column_name = kwargs.get("weight_column_name", None) + self.task_type = "Regression" # type: str + self.primary_metric = kwargs.get("primary_metric", None) + self.training_settings = kwargs.get("training_settings", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class RegressionTrainingSettings(TrainingSettings): @@ -18440,21 +18748,39 @@ class RegressionTrainingSettings(TrainingSettings): """ _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): + "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, + "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, + "allowed_training_algorithms": { + "key": "allowedTrainingAlgorithms", + "type": "[str]", + }, + "blocked_training_algorithms": { + "key": "blockedTrainingAlgorithms", + "type": "[str]", + }, + } + + def __init__(self, **kwargs): """ :keyword enable_dnn_training: Enable recommendation of DNN models. :paramtype enable_dnn_training: bool @@ -18481,8 +18807,12 @@ def __init__( ~azure.mgmt.machinelearningservices.models.RegressionModels] """ super(RegressionTrainingSettings, self).__init__(**kwargs) - self.allowed_training_algorithms = kwargs.get('allowed_training_algorithms', None) - self.blocked_training_algorithms = kwargs.get('blocked_training_algorithms', None) + self.allowed_training_algorithms = kwargs.get( + "allowed_training_algorithms", None + ) + self.blocked_training_algorithms = kwargs.get( + "blocked_training_algorithms", None + ) class ResourceId(msrest.serialization.Model): @@ -18495,23 +18825,20 @@ class ResourceId(msrest.serialization.Model): """ _validation = { - 'id': {'required': True}, + "id": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword id: Required. The ID of the resource. :paramtype id: str """ super(ResourceId, self).__init__(**kwargs) - self.id = kwargs['id'] + self.id = kwargs["id"] class ResourceName(msrest.serialization.Model): @@ -18526,21 +18853,17 @@ class ResourceName(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, + "value": {"readonly": True}, + "localized_value": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + "value": {"key": "value", "type": "str"}, + "localized_value": {"key": "localizedValue", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ResourceName, self).__init__(**kwargs) self.value = None self.localized_value = None @@ -18566,29 +18889,28 @@ class ResourceQuota(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'name': {'readonly': True}, - 'limit': {'readonly': True}, - 'unit': {'readonly': True}, + "id": {"readonly": True}, + "aml_workspace_location": {"readonly": True}, + "type": {"readonly": True}, + "name": {"readonly": True}, + "limit": {"readonly": True}, + "unit": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'ResourceName'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "aml_workspace_location": { + "key": "amlWorkspaceLocation", + "type": "str", + }, + "type": {"key": "type", "type": "str"}, + "name": {"key": "name", "type": "ResourceName"}, + "limit": {"key": "limit", "type": "long"}, + "unit": {"key": "unit", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ResourceQuota, self).__init__(**kwargs) self.id = None self.aml_workspace_location = None @@ -18610,19 +18932,16 @@ class Route(msrest.serialization.Model): """ _validation = { - 'path': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'port': {'required': True}, + "path": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "port": {"required": True}, } _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, + "path": {"key": "path", "type": "str"}, + "port": {"key": "port", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword path: Required. [Required] The path for the route. :paramtype path: str @@ -18630,11 +18949,13 @@ def __init__( :paramtype port: int """ super(Route, self).__init__(**kwargs) - self.path = kwargs['path'] - self.port = kwargs['port'] + self.path = kwargs["path"] + self.port = kwargs["port"] -class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class SASAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """SASAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -18657,22 +18978,22 @@ class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionSharedAccessSignature'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionSharedAccessSignature", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: Category of the connection. :paramtype category: str @@ -18687,9 +19008,11 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature """ - super(SASAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'SAS' # type: str - self.credentials = kwargs.get('credentials', None) + super(SASAuthTypeWorkspaceConnectionProperties, self).__init__( + **kwargs + ) + self.auth_type = "SAS" # type: str + self.credentials = kwargs.get("credentials", None) class SasDatastoreCredentials(DatastoreCredentials): @@ -18706,26 +19029,23 @@ class SasDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, + "credentials_type": {"required": True}, + "secrets": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'SasDatastoreSecrets'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "secrets": {"key": "secrets", "type": "SasDatastoreSecrets"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword secrets: Required. [Required] Storage container secrets. :paramtype secrets: ~azure.mgmt.machinelearningservices.models.SasDatastoreSecrets """ super(SasDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Sas' # type: str - self.secrets = kwargs['secrets'] + self.credentials_type = "Sas" # type: str + self.secrets = kwargs["secrets"] class SasDatastoreSecrets(DatastoreSecrets): @@ -18742,25 +19062,22 @@ class SasDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'sas_token': {'key': 'sasToken', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "sas_token": {"key": "sasToken", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword sas_token: Storage container SAS token. :paramtype sas_token: str """ super(SasDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Sas' # type: str - self.sas_token = kwargs.get('sas_token', None) + self.secrets_type = "Sas" # type: str + self.sas_token = kwargs.get("sas_token", None) class ScaleSettings(msrest.serialization.Model): @@ -18778,19 +19095,19 @@ class ScaleSettings(msrest.serialization.Model): """ _validation = { - 'max_node_count': {'required': True}, + "max_node_count": {"required": True}, } _attribute_map = { - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'node_idle_time_before_scale_down': {'key': 'nodeIdleTimeBeforeScaleDown', 'type': 'duration'}, + "max_node_count": {"key": "maxNodeCount", "type": "int"}, + "min_node_count": {"key": "minNodeCount", "type": "int"}, + "node_idle_time_before_scale_down": { + "key": "nodeIdleTimeBeforeScaleDown", + "type": "duration", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword max_node_count: Required. Max number of nodes to use. :paramtype max_node_count: int @@ -18801,9 +19118,11 @@ def __init__( :paramtype node_idle_time_before_scale_down: ~datetime.timedelta """ super(ScaleSettings, self).__init__(**kwargs) - self.max_node_count = kwargs['max_node_count'] - self.min_node_count = kwargs.get('min_node_count', 0) - self.node_idle_time_before_scale_down = kwargs.get('node_idle_time_before_scale_down', None) + self.max_node_count = kwargs["max_node_count"] + self.min_node_count = kwargs.get("min_node_count", 0) + self.node_idle_time_before_scale_down = kwargs.get( + "node_idle_time_before_scale_down", None + ) class ScaleSettingsInformation(msrest.serialization.Model): @@ -18814,19 +19133,16 @@ class ScaleSettingsInformation(msrest.serialization.Model): """ _attribute_map = { - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, + "scale_settings": {"key": "scaleSettings", "type": "ScaleSettings"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword scale_settings: scale settings for AML Compute. :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings """ super(ScaleSettingsInformation, self).__init__(**kwargs) - self.scale_settings = kwargs.get('scale_settings', None) + self.scale_settings = kwargs.get("scale_settings", None) class Schedule(Resource): @@ -18852,31 +19168,28 @@ class Schedule(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ScheduleProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "ScheduleProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ScheduleProperties """ super(Schedule, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class ScheduleBase(msrest.serialization.Model): @@ -18894,15 +19207,12 @@ class ScheduleBase(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "provisioning_status": {"key": "provisioningStatus", "type": "str"}, + "status": {"key": "status", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword id: A system assigned id for the schedule. :paramtype id: str @@ -18915,9 +19225,9 @@ def __init__( :paramtype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus """ super(ScheduleBase, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.provisioning_status = kwargs.get('provisioning_status', None) - self.status = kwargs.get('status', None) + self.id = kwargs.get("id", None) + self.provisioning_status = kwargs.get("provisioning_status", None) + self.status = kwargs.get("status", None) class ScheduleProperties(ResourceBase): @@ -18948,26 +19258,23 @@ class ScheduleProperties(ResourceBase): """ _validation = { - 'action': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'trigger': {'required': True}, + "action": {"required": True}, + "provisioning_state": {"readonly": True}, + "trigger": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'action': {'key': 'action', 'type': 'ScheduleActionBase'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'trigger': {'key': 'trigger', 'type': 'TriggerBase'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "action": {"key": "action", "type": "ScheduleActionBase"}, + "display_name": {"key": "displayName", "type": "str"}, + "is_enabled": {"key": "isEnabled", "type": "bool"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "trigger": {"key": "trigger", "type": "TriggerBase"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -18985,11 +19292,11 @@ def __init__( :paramtype trigger: ~azure.mgmt.machinelearningservices.models.TriggerBase """ super(ScheduleProperties, self).__init__(**kwargs) - self.action = kwargs['action'] - self.display_name = kwargs.get('display_name', None) - self.is_enabled = kwargs.get('is_enabled', True) + self.action = kwargs["action"] + self.display_name = kwargs.get("display_name", None) + self.is_enabled = kwargs.get("is_enabled", True) self.provisioning_state = None - self.trigger = kwargs['trigger'] + self.trigger = kwargs["trigger"] class ScheduleResourceArmPaginatedResult(msrest.serialization.Model): @@ -19003,14 +19310,11 @@ class ScheduleResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Schedule]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[Schedule]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of Schedule objects. If null, there are no additional pages. @@ -19019,8 +19323,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.Schedule] """ super(ScheduleResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class ScriptReference(msrest.serialization.Model): @@ -19037,16 +19341,13 @@ class ScriptReference(msrest.serialization.Model): """ _attribute_map = { - 'script_source': {'key': 'scriptSource', 'type': 'str'}, - 'script_data': {'key': 'scriptData', 'type': 'str'}, - 'script_arguments': {'key': 'scriptArguments', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'str'}, + "script_source": {"key": "scriptSource", "type": "str"}, + "script_data": {"key": "scriptData", "type": "str"}, + "script_arguments": {"key": "scriptArguments", "type": "str"}, + "timeout": {"key": "timeout", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword script_source: The storage source of the script: workspace. :paramtype script_source: str @@ -19058,10 +19359,10 @@ def __init__( :paramtype timeout: str """ super(ScriptReference, self).__init__(**kwargs) - self.script_source = kwargs.get('script_source', None) - self.script_data = kwargs.get('script_data', None) - self.script_arguments = kwargs.get('script_arguments', None) - self.timeout = kwargs.get('timeout', None) + self.script_source = kwargs.get("script_source", None) + self.script_data = kwargs.get("script_data", None) + self.script_arguments = kwargs.get("script_arguments", None) + self.timeout = kwargs.get("timeout", None) class ScriptsToExecute(msrest.serialization.Model): @@ -19074,14 +19375,14 @@ class ScriptsToExecute(msrest.serialization.Model): """ _attribute_map = { - 'startup_script': {'key': 'startupScript', 'type': 'ScriptReference'}, - 'creation_script': {'key': 'creationScript', 'type': 'ScriptReference'}, + "startup_script": {"key": "startupScript", "type": "ScriptReference"}, + "creation_script": { + "key": "creationScript", + "type": "ScriptReference", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword startup_script: Script that's run every time the machine starts. :paramtype startup_script: ~azure.mgmt.machinelearningservices.models.ScriptReference @@ -19089,8 +19390,8 @@ def __init__( :paramtype creation_script: ~azure.mgmt.machinelearningservices.models.ScriptReference """ super(ScriptsToExecute, self).__init__(**kwargs) - self.startup_script = kwargs.get('startup_script', None) - self.creation_script = kwargs.get('creation_script', None) + self.startup_script = kwargs.get("startup_script", None) + self.creation_script = kwargs.get("creation_script", None) class ServiceManagedResourcesSettings(msrest.serialization.Model): @@ -19101,22 +19402,21 @@ class ServiceManagedResourcesSettings(msrest.serialization.Model): """ _attribute_map = { - 'cosmos_db': {'key': 'cosmosDb', 'type': 'CosmosDbSettings'}, + "cosmos_db": {"key": "cosmosDb", "type": "CosmosDbSettings"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword cosmos_db: The settings for the service managed cosmosdb account. :paramtype cosmos_db: ~azure.mgmt.machinelearningservices.models.CosmosDbSettings """ super(ServiceManagedResourcesSettings, self).__init__(**kwargs) - self.cosmos_db = kwargs.get('cosmos_db', None) + self.cosmos_db = kwargs.get("cosmos_db", None) -class ServicePrincipalAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class ServicePrincipalAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """ServicePrincipalAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -19139,22 +19439,22 @@ class ServicePrincipalAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionP """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionServicePrincipal'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionServicePrincipal", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: Category of the connection. :paramtype category: str @@ -19169,9 +19469,11 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionServicePrincipal """ - super(ServicePrincipalAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'ServicePrincipal' # type: str - self.credentials = kwargs.get('credentials', None) + super( + ServicePrincipalAuthTypeWorkspaceConnectionProperties, self + ).__init__(**kwargs) + self.auth_type = "ServicePrincipal" # type: str + self.credentials = kwargs.get("credentials", None) class ServicePrincipalDatastoreCredentials(DatastoreCredentials): @@ -19196,25 +19498,25 @@ class ServicePrincipalDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, + "credentials_type": {"required": True}, + "client_id": {"required": True}, + "secrets": {"required": True}, + "tenant_id": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'ServicePrincipalDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "authority_url": {"key": "authorityUrl", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + "resource_url": {"key": "resourceUrl", "type": "str"}, + "secrets": { + "key": "secrets", + "type": "ServicePrincipalDatastoreSecrets", + }, + "tenant_id": {"key": "tenantId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword authority_url: Authority URL used for authentication. :paramtype authority_url: str @@ -19229,12 +19531,12 @@ def __init__( :paramtype tenant_id: str """ super(ServicePrincipalDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'ServicePrincipal' # type: str - self.authority_url = kwargs.get('authority_url', None) - self.client_id = kwargs['client_id'] - self.resource_url = kwargs.get('resource_url', None) - self.secrets = kwargs['secrets'] - self.tenant_id = kwargs['tenant_id'] + self.credentials_type = "ServicePrincipal" # type: str + self.authority_url = kwargs.get("authority_url", None) + self.client_id = kwargs["client_id"] + self.resource_url = kwargs.get("resource_url", None) + self.secrets = kwargs["secrets"] + self.tenant_id = kwargs["tenant_id"] class ServicePrincipalDatastoreSecrets(DatastoreSecrets): @@ -19251,25 +19553,22 @@ class ServicePrincipalDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "client_secret": {"key": "clientSecret", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword client_secret: Service principal secret. :paramtype client_secret: str """ super(ServicePrincipalDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'ServicePrincipal' # type: str - self.client_secret = kwargs.get('client_secret', None) + self.secrets_type = "ServicePrincipal" # type: str + self.client_secret = kwargs.get("client_secret", None) class SetupScripts(msrest.serialization.Model): @@ -19280,19 +19579,16 @@ class SetupScripts(msrest.serialization.Model): """ _attribute_map = { - 'scripts': {'key': 'scripts', 'type': 'ScriptsToExecute'}, + "scripts": {"key": "scripts", "type": "ScriptsToExecute"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword scripts: Customized setup scripts. :paramtype scripts: ~azure.mgmt.machinelearningservices.models.ScriptsToExecute """ super(SetupScripts, self).__init__(**kwargs) - self.scripts = kwargs.get('scripts', None) + self.scripts = kwargs.get("scripts", None) class SharedPrivateLinkResource(msrest.serialization.Model): @@ -19314,17 +19610,17 @@ class SharedPrivateLinkResource(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'private_link_resource_id': {'key': 'properties.privateLinkResourceId', 'type': 'str'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'request_message': {'key': 'properties.requestMessage', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "private_link_resource_id": { + "key": "properties.privateLinkResourceId", + "type": "str", + }, + "group_id": {"key": "properties.groupId", "type": "str"}, + "request_message": {"key": "properties.requestMessage", "type": "str"}, + "status": {"key": "properties.status", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: Unique name of the private link. :paramtype name: str @@ -19341,11 +19637,13 @@ def __init__( ~azure.mgmt.machinelearningservices.models.PrivateEndpointServiceConnectionStatus """ super(SharedPrivateLinkResource, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.private_link_resource_id = kwargs.get('private_link_resource_id', None) - self.group_id = kwargs.get('group_id', None) - self.request_message = kwargs.get('request_message', None) - self.status = kwargs.get('status', None) + self.name = kwargs.get("name", None) + self.private_link_resource_id = kwargs.get( + "private_link_resource_id", None + ) + self.group_id = kwargs.get("group_id", None) + self.request_message = kwargs.get("request_message", None) + self.status = kwargs.get("status", None) class Sku(msrest.serialization.Model): @@ -19371,21 +19669,18 @@ class Sku(msrest.serialization.Model): """ _validation = { - 'name': {'required': True}, + "name": {"required": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'int'}, + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, + "size": {"key": "size", "type": "str"}, + "family": {"key": "family", "type": "str"}, + "capacity": {"key": "capacity", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code. :paramtype name: str @@ -19404,11 +19699,11 @@ def __init__( :paramtype capacity: int """ super(Sku, self).__init__(**kwargs) - self.name = kwargs['name'] - self.tier = kwargs.get('tier', None) - self.size = kwargs.get('size', None) - self.family = kwargs.get('family', None) - self.capacity = kwargs.get('capacity', None) + self.name = kwargs["name"] + self.tier = kwargs.get("tier", None) + self.size = kwargs.get("size", None) + self.family = kwargs.get("family", None) + self.capacity = kwargs.get("capacity", None) class SkuCapacity(msrest.serialization.Model): @@ -19426,16 +19721,13 @@ class SkuCapacity(msrest.serialization.Model): """ _attribute_map = { - 'default': {'key': 'default', 'type': 'int'}, - 'maximum': {'key': 'maximum', 'type': 'int'}, - 'minimum': {'key': 'minimum', 'type': 'int'}, - 'scale_type': {'key': 'scaleType', 'type': 'str'}, + "default": {"key": "default", "type": "int"}, + "maximum": {"key": "maximum", "type": "int"}, + "minimum": {"key": "minimum", "type": "int"}, + "scale_type": {"key": "scaleType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword default: Gets or sets the default capacity. :paramtype default: int @@ -19448,10 +19740,10 @@ def __init__( :paramtype scale_type: str or ~azure.mgmt.machinelearningservices.models.SkuScaleType """ super(SkuCapacity, self).__init__(**kwargs) - self.default = kwargs.get('default', 0) - self.maximum = kwargs.get('maximum', 0) - self.minimum = kwargs.get('minimum', 0) - self.scale_type = kwargs.get('scale_type', None) + self.default = kwargs.get("default", 0) + self.maximum = kwargs.get("maximum", 0) + self.minimum = kwargs.get("minimum", 0) + self.scale_type = kwargs.get("scale_type", None) class SkuResource(msrest.serialization.Model): @@ -19468,19 +19760,16 @@ class SkuResource(msrest.serialization.Model): """ _validation = { - 'resource_type': {'readonly': True}, + "resource_type": {"readonly": True}, } _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'SkuSetting'}, + "capacity": {"key": "capacity", "type": "SkuCapacity"}, + "resource_type": {"key": "resourceType", "type": "str"}, + "sku": {"key": "sku", "type": "SkuSetting"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword capacity: Gets or sets the Sku Capacity. :paramtype capacity: ~azure.mgmt.machinelearningservices.models.SkuCapacity @@ -19488,9 +19777,9 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.SkuSetting """ super(SkuResource, self).__init__(**kwargs) - self.capacity = kwargs.get('capacity', None) + self.capacity = kwargs.get("capacity", None) self.resource_type = None - self.sku = kwargs.get('sku', None) + self.sku = kwargs.get("sku", None) class SkuResourceArmPaginatedResult(msrest.serialization.Model): @@ -19504,14 +19793,11 @@ class SkuResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[SkuResource]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[SkuResource]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of SkuResource objects. If null, there are no additional pages. @@ -19520,8 +19806,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.SkuResource] """ super(SkuResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class SkuSetting(msrest.serialization.Model): @@ -19539,18 +19825,15 @@ class SkuSetting(msrest.serialization.Model): """ _validation = { - 'name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: Required. [Required] The name of the SKU. Ex - P3. It is typically a letter+number code. @@ -19561,8 +19844,8 @@ def __init__( :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier """ super(SkuSetting, self).__init__(**kwargs) - self.name = kwargs['name'] - self.tier = kwargs.get('tier', None) + self.name = kwargs["name"] + self.tier = kwargs.get("tier", None) class SparkJob(JobBaseProperties): @@ -19630,43 +19913,43 @@ class SparkJob(JobBaseProperties): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'code_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'entry': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'archives': {'key': 'archives', 'type': '[str]'}, - 'args': {'key': 'args', 'type': 'str'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'conf': {'key': 'conf', 'type': '{str}'}, - 'entry': {'key': 'entry', 'type': 'SparkJobEntry'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'files': {'key': 'files', 'type': '[str]'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'jars': {'key': 'jars', 'type': '[str]'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'py_files': {'key': 'pyFiles', 'type': '[str]'}, - 'resources': {'key': 'resources', 'type': 'SparkResourceConfiguration'}, - } - - def __init__( - self, - **kwargs - ): + "job_type": {"required": True}, + "status": {"readonly": True}, + "code_id": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "entry": {"required": True}, + } + + _attribute_map = { + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "archives": {"key": "archives", "type": "[str]"}, + "args": {"key": "args", "type": "str"}, + "code_id": {"key": "codeId", "type": "str"}, + "conf": {"key": "conf", "type": "{str}"}, + "entry": {"key": "entry", "type": "SparkJobEntry"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "files": {"key": "files", "type": "[str]"}, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "jars": {"key": "jars", "type": "[str]"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "py_files": {"key": "pyFiles", "type": "[str]"}, + "resources": { + "key": "resources", + "type": "SparkResourceConfiguration", + }, + } + + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -19718,19 +20001,19 @@ def __init__( :paramtype resources: ~azure.mgmt.machinelearningservices.models.SparkResourceConfiguration """ super(SparkJob, self).__init__(**kwargs) - self.job_type = 'Spark' # type: str - self.archives = kwargs.get('archives', None) - self.args = kwargs.get('args', None) - self.code_id = kwargs['code_id'] - self.conf = kwargs.get('conf', None) - self.entry = kwargs['entry'] - self.environment_id = kwargs.get('environment_id', None) - self.files = kwargs.get('files', None) - self.inputs = kwargs.get('inputs', None) - self.jars = kwargs.get('jars', None) - self.outputs = kwargs.get('outputs', None) - self.py_files = kwargs.get('py_files', None) - self.resources = kwargs.get('resources', None) + self.job_type = "Spark" # type: str + self.archives = kwargs.get("archives", None) + self.args = kwargs.get("args", None) + self.code_id = kwargs["code_id"] + self.conf = kwargs.get("conf", None) + self.entry = kwargs["entry"] + self.environment_id = kwargs.get("environment_id", None) + self.files = kwargs.get("files", None) + self.inputs = kwargs.get("inputs", None) + self.jars = kwargs.get("jars", None) + self.outputs = kwargs.get("outputs", None) + self.py_files = kwargs.get("py_files", None) + self.resources = kwargs.get("resources", None) class SparkJobEntry(msrest.serialization.Model): @@ -19748,23 +20031,22 @@ class SparkJobEntry(msrest.serialization.Model): """ _validation = { - 'spark_job_entry_type': {'required': True}, + "spark_job_entry_type": {"required": True}, } _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, + "spark_job_entry_type": {"key": "sparkJobEntryType", "type": "str"}, } _subtype_map = { - 'spark_job_entry_type': {'SparkJobPythonEntry': 'SparkJobPythonEntry', 'SparkJobScalaEntry': 'SparkJobScalaEntry'} + "spark_job_entry_type": { + "SparkJobPythonEntry": "SparkJobPythonEntry", + "SparkJobScalaEntry": "SparkJobScalaEntry", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(SparkJobEntry, self).__init__(**kwargs) self.spark_job_entry_type = None # type: Optional[str] @@ -19783,26 +20065,27 @@ class SparkJobPythonEntry(SparkJobEntry): """ _validation = { - 'spark_job_entry_type': {'required': True}, - 'file': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "spark_job_entry_type": {"required": True}, + "file": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - 'file': {'key': 'file', 'type': 'str'}, + "spark_job_entry_type": {"key": "sparkJobEntryType", "type": "str"}, + "file": {"key": "file", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword file: Required. [Required] Relative python file path for job entry point. :paramtype file: str """ super(SparkJobPythonEntry, self).__init__(**kwargs) - self.spark_job_entry_type = 'SparkJobPythonEntry' # type: str - self.file = kwargs['file'] + self.spark_job_entry_type = "SparkJobPythonEntry" # type: str + self.file = kwargs["file"] class SparkJobScalaEntry(SparkJobEntry): @@ -19819,26 +20102,27 @@ class SparkJobScalaEntry(SparkJobEntry): """ _validation = { - 'spark_job_entry_type': {'required': True}, - 'class_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "spark_job_entry_type": {"required": True}, + "class_name": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - 'class_name': {'key': 'className', 'type': 'str'}, + "spark_job_entry_type": {"key": "sparkJobEntryType", "type": "str"}, + "class_name": {"key": "className", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword class_name: Required. [Required] Scala class name used as entry point. :paramtype class_name: str """ super(SparkJobScalaEntry, self).__init__(**kwargs) - self.spark_job_entry_type = 'SparkJobScalaEntry' # type: str - self.class_name = kwargs['class_name'] + self.spark_job_entry_type = "SparkJobScalaEntry" # type: str + self.class_name = kwargs["class_name"] class SparkResourceConfiguration(msrest.serialization.Model): @@ -19851,14 +20135,11 @@ class SparkResourceConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, + "instance_type": {"key": "instanceType", "type": "str"}, + "runtime_version": {"key": "runtimeVersion", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword instance_type: Optional type of VM used as supported by the compute target. :paramtype instance_type: str @@ -19866,8 +20147,8 @@ def __init__( :paramtype runtime_version: str """ super(SparkResourceConfiguration, self).__init__(**kwargs) - self.instance_type = kwargs.get('instance_type', None) - self.runtime_version = kwargs.get('runtime_version', "3.1") + self.instance_type = kwargs.get("instance_type", None) + self.runtime_version = kwargs.get("runtime_version", "3.1") class SslConfiguration(msrest.serialization.Model): @@ -19889,18 +20170,18 @@ class SslConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'cert': {'key': 'cert', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - 'cname': {'key': 'cname', 'type': 'str'}, - 'leaf_domain_label': {'key': 'leafDomainLabel', 'type': 'str'}, - 'overwrite_existing_domain': {'key': 'overwriteExistingDomain', 'type': 'bool'}, + "status": {"key": "status", "type": "str"}, + "cert": {"key": "cert", "type": "str"}, + "key": {"key": "key", "type": "str"}, + "cname": {"key": "cname", "type": "str"}, + "leaf_domain_label": {"key": "leafDomainLabel", "type": "str"}, + "overwrite_existing_domain": { + "key": "overwriteExistingDomain", + "type": "bool", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword status: Enable or disable ssl for scoring. Possible values include: "Disabled", "Enabled", "Auto". @@ -19917,12 +20198,14 @@ def __init__( :paramtype overwrite_existing_domain: bool """ super(SslConfiguration, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.cert = kwargs.get('cert', None) - self.key = kwargs.get('key', None) - self.cname = kwargs.get('cname', None) - self.leaf_domain_label = kwargs.get('leaf_domain_label', None) - self.overwrite_existing_domain = kwargs.get('overwrite_existing_domain', None) + self.status = kwargs.get("status", None) + self.cert = kwargs.get("cert", None) + self.key = kwargs.get("key", None) + self.cname = kwargs.get("cname", None) + self.leaf_domain_label = kwargs.get("leaf_domain_label", None) + self.overwrite_existing_domain = kwargs.get( + "overwrite_existing_domain", None + ) class StackEnsembleSettings(msrest.serialization.Model): @@ -19944,15 +20227,21 @@ class StackEnsembleSettings(msrest.serialization.Model): """ _attribute_map = { - 'stack_meta_learner_k_wargs': {'key': 'stackMetaLearnerKWargs', 'type': 'object'}, - 'stack_meta_learner_train_percentage': {'key': 'stackMetaLearnerTrainPercentage', 'type': 'float'}, - 'stack_meta_learner_type': {'key': 'stackMetaLearnerType', 'type': 'str'}, + "stack_meta_learner_k_wargs": { + "key": "stackMetaLearnerKWargs", + "type": "object", + }, + "stack_meta_learner_train_percentage": { + "key": "stackMetaLearnerTrainPercentage", + "type": "float", + }, + "stack_meta_learner_type": { + "key": "stackMetaLearnerType", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword stack_meta_learner_k_wargs: Optional parameters to pass to the initializer of the meta-learner. @@ -19969,9 +20258,15 @@ def __init__( ~azure.mgmt.machinelearningservices.models.StackMetaLearnerType """ super(StackEnsembleSettings, self).__init__(**kwargs) - self.stack_meta_learner_k_wargs = kwargs.get('stack_meta_learner_k_wargs', None) - self.stack_meta_learner_train_percentage = kwargs.get('stack_meta_learner_train_percentage', 0.2) - self.stack_meta_learner_type = kwargs.get('stack_meta_learner_type', None) + self.stack_meta_learner_k_wargs = kwargs.get( + "stack_meta_learner_k_wargs", None + ) + self.stack_meta_learner_train_percentage = kwargs.get( + "stack_meta_learner_train_percentage", 0.2 + ) + self.stack_meta_learner_type = kwargs.get( + "stack_meta_learner_type", None + ) class StatusMessage(msrest.serialization.Model): @@ -19991,25 +20286,21 @@ class StatusMessage(msrest.serialization.Model): """ _validation = { - 'code': {'readonly': True}, - 'created_date_time': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, + "code": {"readonly": True}, + "created_date_time": {"readonly": True}, + "level": {"readonly": True}, + "message": {"readonly": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, + "code": {"key": "code", "type": "str"}, + "created_date_time": {"key": "createdDateTime", "type": "iso-8601"}, + "level": {"key": "level", "type": "str"}, + "message": {"key": "message", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(StatusMessage, self).__init__(**kwargs) self.code = None self.created_date_time = None @@ -20029,14 +20320,17 @@ class StorageAccountDetails(msrest.serialization.Model): """ _attribute_map = { - 'system_created_storage_account': {'key': 'systemCreatedStorageAccount', 'type': 'SystemCreatedStorageAccount'}, - 'user_created_storage_account': {'key': 'userCreatedStorageAccount', 'type': 'UserCreatedStorageAccount'}, + "system_created_storage_account": { + "key": "systemCreatedStorageAccount", + "type": "SystemCreatedStorageAccount", + }, + "user_created_storage_account": { + "key": "userCreatedStorageAccount", + "type": "UserCreatedStorageAccount", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword system_created_storage_account: :paramtype system_created_storage_account: @@ -20046,8 +20340,12 @@ def __init__( ~azure.mgmt.machinelearningservices.models.UserCreatedStorageAccount """ super(StorageAccountDetails, self).__init__(**kwargs) - self.system_created_storage_account = kwargs.get('system_created_storage_account', None) - self.user_created_storage_account = kwargs.get('user_created_storage_account', None) + self.system_created_storage_account = kwargs.get( + "system_created_storage_account", None + ) + self.user_created_storage_account = kwargs.get( + "user_created_storage_account", None + ) class SweepJob(JobBaseProperties): @@ -20109,41 +20407,44 @@ class SweepJob(JobBaseProperties): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'objective': {'required': True}, - 'sampling_algorithm': {'required': True}, - 'search_space': {'required': True}, - 'trial': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'SweepJobLimits'}, - 'objective': {'key': 'objective', 'type': 'Objective'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'SamplingAlgorithm'}, - 'search_space': {'key': 'searchSpace', 'type': 'object'}, - 'trial': {'key': 'trial', 'type': 'TrialComponent'}, - } - - def __init__( - self, - **kwargs - ): + "job_type": {"required": True}, + "status": {"readonly": True}, + "objective": {"required": True}, + "sampling_algorithm": {"required": True}, + "search_space": {"required": True}, + "trial": {"required": True}, + } + + _attribute_map = { + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "limits": {"key": "limits", "type": "SweepJobLimits"}, + "objective": {"key": "objective", "type": "Objective"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "sampling_algorithm": { + "key": "samplingAlgorithm", + "type": "SamplingAlgorithm", + }, + "search_space": {"key": "searchSpace", "type": "object"}, + "trial": {"key": "trial", "type": "TrialComponent"}, + } + + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -20189,15 +20490,15 @@ def __init__( :paramtype trial: ~azure.mgmt.machinelearningservices.models.TrialComponent """ super(SweepJob, self).__init__(**kwargs) - self.job_type = 'Sweep' # type: str - self.early_termination = kwargs.get('early_termination', None) - self.inputs = kwargs.get('inputs', None) - self.limits = kwargs.get('limits', None) - self.objective = kwargs['objective'] - self.outputs = kwargs.get('outputs', None) - self.sampling_algorithm = kwargs['sampling_algorithm'] - self.search_space = kwargs['search_space'] - self.trial = kwargs['trial'] + self.job_type = "Sweep" # type: str + self.early_termination = kwargs.get("early_termination", None) + self.inputs = kwargs.get("inputs", None) + self.limits = kwargs.get("limits", None) + self.objective = kwargs["objective"] + self.outputs = kwargs.get("outputs", None) + self.sampling_algorithm = kwargs["sampling_algorithm"] + self.search_space = kwargs["search_space"] + self.trial = kwargs["trial"] class SweepJobLimits(JobLimits): @@ -20220,21 +20521,18 @@ class SweepJobLimits(JobLimits): """ _validation = { - 'job_limits_type': {'required': True}, + "job_limits_type": {"required": True}, } _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_total_trials': {'key': 'maxTotalTrials', 'type': 'int'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, + "job_limits_type": {"key": "jobLimitsType", "type": "str"}, + "timeout": {"key": "timeout", "type": "duration"}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_total_trials": {"key": "maxTotalTrials", "type": "int"}, + "trial_timeout": {"key": "trialTimeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. Only supports duration with precision as low as Seconds. @@ -20247,10 +20545,10 @@ def __init__( :paramtype trial_timeout: ~datetime.timedelta """ super(SweepJobLimits, self).__init__(**kwargs) - self.job_limits_type = 'Sweep' # type: str - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', None) - self.max_total_trials = kwargs.get('max_total_trials', None) - self.trial_timeout = kwargs.get('trial_timeout', None) + self.job_limits_type = "Sweep" # type: str + self.max_concurrent_trials = kwargs.get("max_concurrent_trials", None) + self.max_total_trials = kwargs.get("max_total_trials", None) + self.trial_timeout = kwargs.get("trial_timeout", None) class SynapseSpark(Compute): @@ -20292,34 +20590,34 @@ class SynapseSpark(Compute): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + "disable_local_auth": {"readonly": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'SynapseSparkProperties'}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, + "properties": {"key": "properties", "type": "SynapseSparkProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The description of the Machine Learning compute. :paramtype description: str @@ -20329,8 +20627,8 @@ def __init__( :paramtype properties: ~azure.mgmt.machinelearningservices.models.SynapseSparkProperties """ super(SynapseSpark, self).__init__(**kwargs) - self.compute_type = 'SynapseSpark' # type: str - self.properties = kwargs.get('properties', None) + self.compute_type = "SynapseSpark" # type: str + self.properties = kwargs.get("properties", None) class SynapseSparkProperties(msrest.serialization.Model): @@ -20359,22 +20657,25 @@ class SynapseSparkProperties(msrest.serialization.Model): """ _attribute_map = { - 'auto_scale_properties': {'key': 'autoScaleProperties', 'type': 'AutoScaleProperties'}, - 'auto_pause_properties': {'key': 'autoPauseProperties', 'type': 'AutoPauseProperties'}, - 'spark_version': {'key': 'sparkVersion', 'type': 'str'}, - 'node_count': {'key': 'nodeCount', 'type': 'int'}, - 'node_size': {'key': 'nodeSize', 'type': 'str'}, - 'node_size_family': {'key': 'nodeSizeFamily', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'workspace_name': {'key': 'workspaceName', 'type': 'str'}, - 'pool_name': {'key': 'poolName', 'type': 'str'}, + "auto_scale_properties": { + "key": "autoScaleProperties", + "type": "AutoScaleProperties", + }, + "auto_pause_properties": { + "key": "autoPauseProperties", + "type": "AutoPauseProperties", + }, + "spark_version": {"key": "sparkVersion", "type": "str"}, + "node_count": {"key": "nodeCount", "type": "int"}, + "node_size": {"key": "nodeSize", "type": "str"}, + "node_size_family": {"key": "nodeSizeFamily", "type": "str"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, + "resource_group": {"key": "resourceGroup", "type": "str"}, + "workspace_name": {"key": "workspaceName", "type": "str"}, + "pool_name": {"key": "poolName", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword auto_scale_properties: Auto scale properties. :paramtype auto_scale_properties: @@ -20400,16 +20701,16 @@ def __init__( :paramtype pool_name: str """ super(SynapseSparkProperties, self).__init__(**kwargs) - self.auto_scale_properties = kwargs.get('auto_scale_properties', None) - self.auto_pause_properties = kwargs.get('auto_pause_properties', None) - self.spark_version = kwargs.get('spark_version', None) - self.node_count = kwargs.get('node_count', None) - self.node_size = kwargs.get('node_size', None) - self.node_size_family = kwargs.get('node_size_family', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.resource_group = kwargs.get('resource_group', None) - self.workspace_name = kwargs.get('workspace_name', None) - self.pool_name = kwargs.get('pool_name', None) + self.auto_scale_properties = kwargs.get("auto_scale_properties", None) + self.auto_pause_properties = kwargs.get("auto_pause_properties", None) + self.spark_version = kwargs.get("spark_version", None) + self.node_count = kwargs.get("node_count", None) + self.node_size = kwargs.get("node_size", None) + self.node_size_family = kwargs.get("node_size_family", None) + self.subscription_id = kwargs.get("subscription_id", None) + self.resource_group = kwargs.get("resource_group", None) + self.workspace_name = kwargs.get("workspace_name", None) + self.pool_name = kwargs.get("pool_name", None) class SystemCreatedAcrAccount(msrest.serialization.Model): @@ -20422,14 +20723,11 @@ class SystemCreatedAcrAccount(msrest.serialization.Model): """ _attribute_map = { - 'acr_account_sku': {'key': 'acrAccountSku', 'type': 'str'}, - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, + "acr_account_sku": {"key": "acrAccountSku", "type": "str"}, + "arm_resource_id": {"key": "armResourceId", "type": "ArmResourceId"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword acr_account_sku: :paramtype acr_account_sku: str @@ -20437,8 +20735,8 @@ def __init__( :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId """ super(SystemCreatedAcrAccount, self).__init__(**kwargs) - self.acr_account_sku = kwargs.get('acr_account_sku', None) - self.arm_resource_id = kwargs.get('arm_resource_id', None) + self.acr_account_sku = kwargs.get("acr_account_sku", None) + self.arm_resource_id = kwargs.get("arm_resource_id", None) class SystemCreatedStorageAccount(msrest.serialization.Model): @@ -20461,15 +20759,15 @@ class SystemCreatedStorageAccount(msrest.serialization.Model): """ _attribute_map = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - 'storage_account_hns_enabled': {'key': 'storageAccountHnsEnabled', 'type': 'bool'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + "arm_resource_id": {"key": "armResourceId", "type": "ArmResourceId"}, + "storage_account_hns_enabled": { + "key": "storageAccountHnsEnabled", + "type": "bool", + }, + "storage_account_type": {"key": "storageAccountType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword arm_resource_id: ARM ResourceId of a resource. :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId @@ -20487,9 +20785,11 @@ def __init__( :paramtype storage_account_type: str """ super(SystemCreatedStorageAccount, self).__init__(**kwargs) - self.arm_resource_id = kwargs.get('arm_resource_id', None) - self.storage_account_hns_enabled = kwargs.get('storage_account_hns_enabled', None) - self.storage_account_type = kwargs.get('storage_account_type', None) + self.arm_resource_id = kwargs.get("arm_resource_id", None) + self.storage_account_hns_enabled = kwargs.get( + "storage_account_hns_enabled", None + ) + self.storage_account_type = kwargs.get("storage_account_type", None) class SystemData(msrest.serialization.Model): @@ -20512,18 +20812,15 @@ class SystemData(msrest.serialization.Model): """ _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + "created_by": {"key": "createdBy", "type": "str"}, + "created_by_type": {"key": "createdByType", "type": "str"}, + "created_at": {"key": "createdAt", "type": "iso-8601"}, + "last_modified_by": {"key": "lastModifiedBy", "type": "str"}, + "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"}, + "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword created_by: The identity that created the resource. :paramtype created_by: str @@ -20542,12 +20839,12 @@ def __init__( :paramtype last_modified_at: ~datetime.datetime """ super(SystemData, self).__init__(**kwargs) - self.created_by = kwargs.get('created_by', None) - self.created_by_type = kwargs.get('created_by_type', None) - self.created_at = kwargs.get('created_at', None) - self.last_modified_by = kwargs.get('last_modified_by', None) - self.last_modified_by_type = kwargs.get('last_modified_by_type', None) - self.last_modified_at = kwargs.get('last_modified_at', None) + self.created_by = kwargs.get("created_by", None) + self.created_by_type = kwargs.get("created_by_type", None) + self.created_at = kwargs.get("created_at", None) + self.last_modified_by = kwargs.get("last_modified_by", None) + self.last_modified_by_type = kwargs.get("last_modified_by_type", None) + self.last_modified_at = kwargs.get("last_modified_at", None) class SystemService(msrest.serialization.Model): @@ -20564,23 +20861,19 @@ class SystemService(msrest.serialization.Model): """ _validation = { - 'system_service_type': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'version': {'readonly': True}, + "system_service_type": {"readonly": True}, + "public_ip_address": {"readonly": True}, + "version": {"readonly": True}, } _attribute_map = { - 'system_service_type': {'key': 'systemServiceType', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, + "system_service_type": {"key": "systemServiceType", "type": "str"}, + "public_ip_address": {"key": "publicIpAddress", "type": "str"}, + "version": {"key": "version", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(SystemService, self).__init__(**kwargs) self.system_service_type = None self.public_ip_address = None @@ -20635,32 +20928,29 @@ class TableFixedParameters(msrest.serialization.Model): """ _attribute_map = { - 'booster': {'key': 'booster', 'type': 'str'}, - 'boosting_type': {'key': 'boostingType', 'type': 'str'}, - 'grow_policy': {'key': 'growPolicy', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'max_bin': {'key': 'maxBin', 'type': 'int'}, - 'max_depth': {'key': 'maxDepth', 'type': 'int'}, - 'max_leaves': {'key': 'maxLeaves', 'type': 'int'}, - 'min_data_in_leaf': {'key': 'minDataInLeaf', 'type': 'int'}, - 'min_split_gain': {'key': 'minSplitGain', 'type': 'float'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'n_estimators': {'key': 'nEstimators', 'type': 'int'}, - 'num_leaves': {'key': 'numLeaves', 'type': 'int'}, - 'preprocessor_name': {'key': 'preprocessorName', 'type': 'str'}, - 'reg_alpha': {'key': 'regAlpha', 'type': 'float'}, - 'reg_lambda': {'key': 'regLambda', 'type': 'float'}, - 'subsample': {'key': 'subsample', 'type': 'float'}, - 'subsample_freq': {'key': 'subsampleFreq', 'type': 'float'}, - 'tree_method': {'key': 'treeMethod', 'type': 'str'}, - 'with_mean': {'key': 'withMean', 'type': 'bool'}, - 'with_std': {'key': 'withStd', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): + "booster": {"key": "booster", "type": "str"}, + "boosting_type": {"key": "boostingType", "type": "str"}, + "grow_policy": {"key": "growPolicy", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "float"}, + "max_bin": {"key": "maxBin", "type": "int"}, + "max_depth": {"key": "maxDepth", "type": "int"}, + "max_leaves": {"key": "maxLeaves", "type": "int"}, + "min_data_in_leaf": {"key": "minDataInLeaf", "type": "int"}, + "min_split_gain": {"key": "minSplitGain", "type": "float"}, + "model_name": {"key": "modelName", "type": "str"}, + "n_estimators": {"key": "nEstimators", "type": "int"}, + "num_leaves": {"key": "numLeaves", "type": "int"}, + "preprocessor_name": {"key": "preprocessorName", "type": "str"}, + "reg_alpha": {"key": "regAlpha", "type": "float"}, + "reg_lambda": {"key": "regLambda", "type": "float"}, + "subsample": {"key": "subsample", "type": "float"}, + "subsample_freq": {"key": "subsampleFreq", "type": "float"}, + "tree_method": {"key": "treeMethod", "type": "str"}, + "with_mean": {"key": "withMean", "type": "bool"}, + "with_std": {"key": "withStd", "type": "bool"}, + } + + def __init__(self, **kwargs): """ :keyword booster: Specify the boosting type, e.g gbdt for XGBoost. :paramtype booster: str @@ -20706,26 +20996,26 @@ def __init__( :paramtype with_std: bool """ super(TableFixedParameters, self).__init__(**kwargs) - self.booster = kwargs.get('booster', None) - self.boosting_type = kwargs.get('boosting_type', None) - self.grow_policy = kwargs.get('grow_policy', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.max_bin = kwargs.get('max_bin', None) - self.max_depth = kwargs.get('max_depth', None) - self.max_leaves = kwargs.get('max_leaves', None) - self.min_data_in_leaf = kwargs.get('min_data_in_leaf', None) - self.min_split_gain = kwargs.get('min_split_gain', None) - self.model_name = kwargs.get('model_name', None) - self.n_estimators = kwargs.get('n_estimators', None) - self.num_leaves = kwargs.get('num_leaves', None) - self.preprocessor_name = kwargs.get('preprocessor_name', None) - self.reg_alpha = kwargs.get('reg_alpha', None) - self.reg_lambda = kwargs.get('reg_lambda', None) - self.subsample = kwargs.get('subsample', None) - self.subsample_freq = kwargs.get('subsample_freq', None) - self.tree_method = kwargs.get('tree_method', None) - self.with_mean = kwargs.get('with_mean', False) - self.with_std = kwargs.get('with_std', False) + self.booster = kwargs.get("booster", None) + self.boosting_type = kwargs.get("boosting_type", None) + self.grow_policy = kwargs.get("grow_policy", None) + self.learning_rate = kwargs.get("learning_rate", None) + self.max_bin = kwargs.get("max_bin", None) + self.max_depth = kwargs.get("max_depth", None) + self.max_leaves = kwargs.get("max_leaves", None) + self.min_data_in_leaf = kwargs.get("min_data_in_leaf", None) + self.min_split_gain = kwargs.get("min_split_gain", None) + self.model_name = kwargs.get("model_name", None) + self.n_estimators = kwargs.get("n_estimators", None) + self.num_leaves = kwargs.get("num_leaves", None) + self.preprocessor_name = kwargs.get("preprocessor_name", None) + self.reg_alpha = kwargs.get("reg_alpha", None) + self.reg_lambda = kwargs.get("reg_lambda", None) + self.subsample = kwargs.get("subsample", None) + self.subsample_freq = kwargs.get("subsample_freq", None) + self.tree_method = kwargs.get("tree_method", None) + self.with_mean = kwargs.get("with_mean", False) + self.with_std = kwargs.get("with_std", False) class TableParameterSubspace(msrest.serialization.Model): @@ -20776,32 +21066,29 @@ class TableParameterSubspace(msrest.serialization.Model): """ _attribute_map = { - 'booster': {'key': 'booster', 'type': 'str'}, - 'boosting_type': {'key': 'boostingType', 'type': 'str'}, - 'grow_policy': {'key': 'growPolicy', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'max_bin': {'key': 'maxBin', 'type': 'str'}, - 'max_depth': {'key': 'maxDepth', 'type': 'str'}, - 'max_leaves': {'key': 'maxLeaves', 'type': 'str'}, - 'min_data_in_leaf': {'key': 'minDataInLeaf', 'type': 'str'}, - 'min_split_gain': {'key': 'minSplitGain', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'n_estimators': {'key': 'nEstimators', 'type': 'str'}, - 'num_leaves': {'key': 'numLeaves', 'type': 'str'}, - 'preprocessor_name': {'key': 'preprocessorName', 'type': 'str'}, - 'reg_alpha': {'key': 'regAlpha', 'type': 'str'}, - 'reg_lambda': {'key': 'regLambda', 'type': 'str'}, - 'subsample': {'key': 'subsample', 'type': 'str'}, - 'subsample_freq': {'key': 'subsampleFreq', 'type': 'str'}, - 'tree_method': {'key': 'treeMethod', 'type': 'str'}, - 'with_mean': {'key': 'withMean', 'type': 'str'}, - 'with_std': {'key': 'withStd', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + "booster": {"key": "booster", "type": "str"}, + "boosting_type": {"key": "boostingType", "type": "str"}, + "grow_policy": {"key": "growPolicy", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "str"}, + "max_bin": {"key": "maxBin", "type": "str"}, + "max_depth": {"key": "maxDepth", "type": "str"}, + "max_leaves": {"key": "maxLeaves", "type": "str"}, + "min_data_in_leaf": {"key": "minDataInLeaf", "type": "str"}, + "min_split_gain": {"key": "minSplitGain", "type": "str"}, + "model_name": {"key": "modelName", "type": "str"}, + "n_estimators": {"key": "nEstimators", "type": "str"}, + "num_leaves": {"key": "numLeaves", "type": "str"}, + "preprocessor_name": {"key": "preprocessorName", "type": "str"}, + "reg_alpha": {"key": "regAlpha", "type": "str"}, + "reg_lambda": {"key": "regLambda", "type": "str"}, + "subsample": {"key": "subsample", "type": "str"}, + "subsample_freq": {"key": "subsampleFreq", "type": "str"}, + "tree_method": {"key": "treeMethod", "type": "str"}, + "with_mean": {"key": "withMean", "type": "str"}, + "with_std": {"key": "withStd", "type": "str"}, + } + + def __init__(self, **kwargs): """ :keyword booster: Specify the boosting type, e.g gbdt for XGBoost. :paramtype booster: str @@ -20847,26 +21134,26 @@ def __init__( :paramtype with_std: str """ super(TableParameterSubspace, self).__init__(**kwargs) - self.booster = kwargs.get('booster', None) - self.boosting_type = kwargs.get('boosting_type', None) - self.grow_policy = kwargs.get('grow_policy', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.max_bin = kwargs.get('max_bin', None) - self.max_depth = kwargs.get('max_depth', None) - self.max_leaves = kwargs.get('max_leaves', None) - self.min_data_in_leaf = kwargs.get('min_data_in_leaf', None) - self.min_split_gain = kwargs.get('min_split_gain', None) - self.model_name = kwargs.get('model_name', None) - self.n_estimators = kwargs.get('n_estimators', None) - self.num_leaves = kwargs.get('num_leaves', None) - self.preprocessor_name = kwargs.get('preprocessor_name', None) - self.reg_alpha = kwargs.get('reg_alpha', None) - self.reg_lambda = kwargs.get('reg_lambda', None) - self.subsample = kwargs.get('subsample', None) - self.subsample_freq = kwargs.get('subsample_freq', None) - self.tree_method = kwargs.get('tree_method', None) - self.with_mean = kwargs.get('with_mean', None) - self.with_std = kwargs.get('with_std', None) + self.booster = kwargs.get("booster", None) + self.boosting_type = kwargs.get("boosting_type", None) + self.grow_policy = kwargs.get("grow_policy", None) + self.learning_rate = kwargs.get("learning_rate", None) + self.max_bin = kwargs.get("max_bin", None) + self.max_depth = kwargs.get("max_depth", None) + self.max_leaves = kwargs.get("max_leaves", None) + self.min_data_in_leaf = kwargs.get("min_data_in_leaf", None) + self.min_split_gain = kwargs.get("min_split_gain", None) + self.model_name = kwargs.get("model_name", None) + self.n_estimators = kwargs.get("n_estimators", None) + self.num_leaves = kwargs.get("num_leaves", None) + self.preprocessor_name = kwargs.get("preprocessor_name", None) + self.reg_alpha = kwargs.get("reg_alpha", None) + self.reg_lambda = kwargs.get("reg_lambda", None) + self.subsample = kwargs.get("subsample", None) + self.subsample_freq = kwargs.get("subsample_freq", None) + self.tree_method = kwargs.get("tree_method", None) + self.with_mean = kwargs.get("with_mean", None) + self.with_std = kwargs.get("with_std", None) class TableSweepSettings(msrest.serialization.Model): @@ -20883,18 +21170,18 @@ class TableSweepSettings(msrest.serialization.Model): """ _validation = { - 'sampling_algorithm': {'required': True}, + "sampling_algorithm": {"required": True}, } _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, + "sampling_algorithm": {"key": "samplingAlgorithm", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword early_termination: Type of early termination policy for the sweeping job. :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy @@ -20904,8 +21191,8 @@ def __init__( ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType """ super(TableSweepSettings, self).__init__(**kwargs) - self.early_termination = kwargs.get('early_termination', None) - self.sampling_algorithm = kwargs['sampling_algorithm'] + self.early_termination = kwargs.get("early_termination", None) + self.sampling_algorithm = kwargs["sampling_algorithm"] class TableVerticalFeaturizationSettings(FeaturizationSettings): @@ -20935,18 +21222,27 @@ class TableVerticalFeaturizationSettings(FeaturizationSettings): """ _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - 'blocked_transformers': {'key': 'blockedTransformers', 'type': '[str]'}, - 'column_name_and_types': {'key': 'columnNameAndTypes', 'type': '{str}'}, - 'enable_dnn_featurization': {'key': 'enableDnnFeaturization', 'type': 'bool'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'transformer_params': {'key': 'transformerParams', 'type': '{[ColumnTransformer]}'}, + "dataset_language": {"key": "datasetLanguage", "type": "str"}, + "blocked_transformers": { + "key": "blockedTransformers", + "type": "[str]", + }, + "column_name_and_types": { + "key": "columnNameAndTypes", + "type": "{str}", + }, + "enable_dnn_featurization": { + "key": "enableDnnFeaturization", + "type": "bool", + }, + "mode": {"key": "mode", "type": "str"}, + "transformer_params": { + "key": "transformerParams", + "type": "{[ColumnTransformer]}", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword dataset_language: Dataset language, useful for the text data. :paramtype dataset_language: str @@ -20971,11 +21267,13 @@ def __init__( list[~azure.mgmt.machinelearningservices.models.ColumnTransformer]] """ super(TableVerticalFeaturizationSettings, self).__init__(**kwargs) - self.blocked_transformers = kwargs.get('blocked_transformers', None) - self.column_name_and_types = kwargs.get('column_name_and_types', None) - self.enable_dnn_featurization = kwargs.get('enable_dnn_featurization', False) - self.mode = kwargs.get('mode', None) - self.transformer_params = kwargs.get('transformer_params', None) + self.blocked_transformers = kwargs.get("blocked_transformers", None) + self.column_name_and_types = kwargs.get("column_name_and_types", None) + self.enable_dnn_featurization = kwargs.get( + "enable_dnn_featurization", False + ) + self.mode = kwargs.get("mode", None) + self.transformer_params = kwargs.get("transformer_params", None) class TableVerticalLimitSettings(msrest.serialization.Model): @@ -21003,21 +21301,24 @@ class TableVerticalLimitSettings(msrest.serialization.Model): """ _attribute_map = { - 'enable_early_termination': {'key': 'enableEarlyTermination', 'type': 'bool'}, - 'exit_score': {'key': 'exitScore', 'type': 'float'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_cores_per_trial': {'key': 'maxCoresPerTrial', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'sweep_concurrent_trials': {'key': 'sweepConcurrentTrials', 'type': 'int'}, - 'sweep_trials': {'key': 'sweepTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, + "enable_early_termination": { + "key": "enableEarlyTermination", + "type": "bool", + }, + "exit_score": {"key": "exitScore", "type": "float"}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_cores_per_trial": {"key": "maxCoresPerTrial", "type": "int"}, + "max_trials": {"key": "maxTrials", "type": "int"}, + "sweep_concurrent_trials": { + "key": "sweepConcurrentTrials", + "type": "int", + }, + "sweep_trials": {"key": "sweepTrials", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, + "trial_timeout": {"key": "trialTimeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword enable_early_termination: Enable early termination, determines whether or not if AutoMLJob will terminate early if there is no score improvement in last 20 iterations. @@ -21041,15 +21342,17 @@ def __init__( :paramtype trial_timeout: ~datetime.timedelta """ super(TableVerticalLimitSettings, self).__init__(**kwargs) - self.enable_early_termination = kwargs.get('enable_early_termination', True) - self.exit_score = kwargs.get('exit_score', None) - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', 1) - self.max_cores_per_trial = kwargs.get('max_cores_per_trial', -1) - self.max_trials = kwargs.get('max_trials', 1000) - self.sweep_concurrent_trials = kwargs.get('sweep_concurrent_trials', 0) - self.sweep_trials = kwargs.get('sweep_trials', 0) - self.timeout = kwargs.get('timeout', "PT6H") - self.trial_timeout = kwargs.get('trial_timeout', "PT30M") + self.enable_early_termination = kwargs.get( + "enable_early_termination", True + ) + self.exit_score = kwargs.get("exit_score", None) + self.max_concurrent_trials = kwargs.get("max_concurrent_trials", 1) + self.max_cores_per_trial = kwargs.get("max_cores_per_trial", -1) + self.max_trials = kwargs.get("max_trials", 1000) + self.sweep_concurrent_trials = kwargs.get("sweep_concurrent_trials", 0) + self.sweep_trials = kwargs.get("sweep_trials", 0) + self.timeout = kwargs.get("timeout", "PT6H") + self.trial_timeout = kwargs.get("trial_timeout", "PT30M") class TargetUtilizationScaleSettings(OnlineScaleSettings): @@ -21073,21 +21376,21 @@ class TargetUtilizationScaleSettings(OnlineScaleSettings): """ _validation = { - 'scale_type': {'required': True}, + "scale_type": {"required": True}, } _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - 'max_instances': {'key': 'maxInstances', 'type': 'int'}, - 'min_instances': {'key': 'minInstances', 'type': 'int'}, - 'polling_interval': {'key': 'pollingInterval', 'type': 'duration'}, - 'target_utilization_percentage': {'key': 'targetUtilizationPercentage', 'type': 'int'}, + "scale_type": {"key": "scaleType", "type": "str"}, + "max_instances": {"key": "maxInstances", "type": "int"}, + "min_instances": {"key": "minInstances", "type": "int"}, + "polling_interval": {"key": "pollingInterval", "type": "duration"}, + "target_utilization_percentage": { + "key": "targetUtilizationPercentage", + "type": "int", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword max_instances: The maximum number of instances that the deployment can scale to. The quota will be reserved for max_instances. @@ -21101,11 +21404,13 @@ def __init__( :paramtype target_utilization_percentage: int """ super(TargetUtilizationScaleSettings, self).__init__(**kwargs) - self.scale_type = 'TargetUtilization' # type: str - self.max_instances = kwargs.get('max_instances', 1) - self.min_instances = kwargs.get('min_instances', 1) - self.polling_interval = kwargs.get('polling_interval', "PT1S") - self.target_utilization_percentage = kwargs.get('target_utilization_percentage', 70) + self.scale_type = "TargetUtilization" # type: str + self.max_instances = kwargs.get("max_instances", 1) + self.min_instances = kwargs.get("min_instances", 1) + self.polling_interval = kwargs.get("polling_interval", "PT1S") + self.target_utilization_percentage = kwargs.get( + "target_utilization_percentage", 70 + ) class TensorFlow(DistributionConfiguration): @@ -21123,19 +21428,19 @@ class TensorFlow(DistributionConfiguration): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'parameter_server_count': {'key': 'parameterServerCount', 'type': 'int'}, - 'worker_count': {'key': 'workerCount', 'type': 'int'}, + "distribution_type": {"key": "distributionType", "type": "str"}, + "parameter_server_count": { + "key": "parameterServerCount", + "type": "int", + }, + "worker_count": {"key": "workerCount", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword parameter_server_count: Number of parameter server tasks. :paramtype parameter_server_count: int @@ -21143,75 +21448,87 @@ def __init__( :paramtype worker_count: int """ super(TensorFlow, self).__init__(**kwargs) - self.distribution_type = 'TensorFlow' # type: str - self.parameter_server_count = kwargs.get('parameter_server_count', 0) - self.worker_count = kwargs.get('worker_count', None) + self.distribution_type = "TensorFlow" # type: str + self.parameter_server_count = kwargs.get("parameter_server_count", 0) + self.worker_count = kwargs.get("worker_count", None) class TextClassification(AutoMLVertical, NlpVertical): """Text Classification task in AutoML NLP vertical. -NLP - Natural Language Processing. + NLP - Natural Language Processing. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-Classification task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar fixed_parameters: Model/training parameters that will remain constant throughout + training. + :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] + :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric for Text-Classification task. Possible values include: + "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, + "task_type": {"required": True}, + "training_data": {"required": True}, } _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "NlpFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "search_space": { + "key": "searchSpace", + "type": "[NlpParameterSubspace]", + }, + "sweep_settings": {"key": "sweepSettings", "type": "NlpSweepSettings"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword featurization_settings: Featurization inputs needed for AutoML job. :paramtype featurization_settings: @@ -21243,87 +21560,101 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ super(TextClassification, self).__init__(**kwargs) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.task_type = 'TextClassification' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.fixed_parameters = kwargs.get("fixed_parameters", None) + self.limit_settings = kwargs.get("limit_settings", None) + self.search_space = kwargs.get("search_space", None) + self.sweep_settings = kwargs.get("sweep_settings", None) + self.validation_data = kwargs.get("validation_data", None) + self.task_type = "TextClassification" # type: str + self.primary_metric = kwargs.get("primary_metric", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class TextClassificationMultilabel(AutoMLVertical, NlpVertical): """Text Classification Multilabel task in AutoML NLP vertical. -NLP - Natural Language Processing. + NLP - Natural Language Processing. - Variables are only populated by the server, and will be ignored when sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-Classification-Multilabel task. - Currently only Accuracy is supported as primary metric, hence user need not set it explicitly. - Possible values include: "AUCWeighted", "Accuracy", "NormMacroRecall", - "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar fixed_parameters: Model/training parameters that will remain constant throughout + training. + :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] + :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric for Text-Classification-Multilabel task. + Currently only Accuracy is supported as primary metric, hence user need not set it explicitly. + Possible values include: "AUCWeighted", "Accuracy", "NormMacroRecall", + "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted", "IOU". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - 'primary_metric': {'readonly': True}, + "task_type": {"required": True}, + "training_data": {"required": True}, + "primary_metric": {"readonly": True}, } _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "NlpFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "search_space": { + "key": "searchSpace", + "type": "[NlpParameterSubspace]", + }, + "sweep_settings": {"key": "sweepSettings", "type": "NlpSweepSettings"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword featurization_settings: Featurization inputs needed for AutoML job. :paramtype featurization_settings: @@ -21350,88 +21681,102 @@ def __init__( :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ super(TextClassificationMultilabel, self).__init__(**kwargs) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.task_type = 'TextClassificationMultilabel' # type: str + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.fixed_parameters = kwargs.get("fixed_parameters", None) + self.limit_settings = kwargs.get("limit_settings", None) + self.search_space = kwargs.get("search_space", None) + self.sweep_settings = kwargs.get("sweep_settings", None) + self.validation_data = kwargs.get("validation_data", None) + self.task_type = "TextClassificationMultilabel" # type: str self.primary_metric = None - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class TextNer(AutoMLVertical, NlpVertical): """Text-NER task in AutoML NLP vertical. -NER - Named Entity Recognition. -NLP - Natural Language Processing. + NER - Named Entity Recognition. + NLP - Natural Language Processing. - Variables are only populated by the server, and will be ignored when sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-NER task. - Only 'Accuracy' is supported for Text-NER, so user need not set this explicitly. Possible - values include: "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar fixed_parameters: Model/training parameters that will remain constant throughout + training. + :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] + :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric for Text-NER task. + Only 'Accuracy' is supported for Text-NER, so user need not set this explicitly. Possible + values include: "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - 'primary_metric': {'readonly': True}, + "task_type": {"required": True}, + "training_data": {"required": True}, + "primary_metric": {"readonly": True}, } _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "NlpFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "search_space": { + "key": "searchSpace", + "type": "[NlpParameterSubspace]", + }, + "sweep_settings": {"key": "sweepSettings", "type": "NlpSweepSettings"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword featurization_settings: Featurization inputs needed for AutoML job. :paramtype featurization_settings: @@ -21458,17 +21803,19 @@ def __init__( :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ super(TextNer, self).__init__(**kwargs) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.task_type = 'TextNER' # type: str + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.fixed_parameters = kwargs.get("fixed_parameters", None) + self.limit_settings = kwargs.get("limit_settings", None) + self.search_space = kwargs.get("search_space", None) + self.sweep_settings = kwargs.get("sweep_settings", None) + self.validation_data = kwargs.get("validation_data", None) + self.task_type = "TextNER" # type: str self.primary_metric = None - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class TmpfsOptions(msrest.serialization.Model): @@ -21479,19 +21826,16 @@ class TmpfsOptions(msrest.serialization.Model): """ _attribute_map = { - 'size': {'key': 'size', 'type': 'int'}, + "size": {"key": "size", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword size: Mention the Tmpfs size. :paramtype size: int """ super(TmpfsOptions, self).__init__(**kwargs) - self.size = kwargs.get('size', None) + self.size = kwargs.get("size", None) class TrialComponent(msrest.serialization.Model): @@ -21517,23 +21861,30 @@ class TrialComponent(msrest.serialization.Model): """ _validation = { - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "command": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "environment_id": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, + "code_id": {"key": "codeId", "type": "str"}, + "command": {"key": "command", "type": "str"}, + "distribution": { + "key": "distribution", + "type": "DistributionConfiguration", + }, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "resources": {"key": "resources", "type": "JobResourceConfiguration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword code_id: ARM resource ID of the code asset. :paramtype code_id: str @@ -21552,12 +21903,12 @@ def __init__( :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration """ super(TrialComponent, self).__init__(**kwargs) - self.code_id = kwargs.get('code_id', None) - self.command = kwargs['command'] - self.distribution = kwargs.get('distribution', None) - self.environment_id = kwargs['environment_id'] - self.environment_variables = kwargs.get('environment_variables', None) - self.resources = kwargs.get('resources', None) + self.code_id = kwargs.get("code_id", None) + self.command = kwargs["command"] + self.distribution = kwargs.get("distribution", None) + self.environment_id = kwargs["environment_id"] + self.environment_variables = kwargs.get("environment_variables", None) + self.resources = kwargs.get("resources", None) class TritonModelJobInput(JobInput, AssetJobInput): @@ -21579,21 +21930,18 @@ class TritonModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -21604,10 +21952,10 @@ def __init__( :paramtype description: str """ super(TritonModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'triton_model' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "triton_model" # type: str + self.description = kwargs.get("description", None) class TritonModelJobOutput(JobOutput, AssetJobOutput): @@ -21629,20 +21977,17 @@ class TritonModelJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", "Direct". @@ -21653,10 +21998,10 @@ def __init__( :paramtype description: str """ super(TritonModelJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'triton_model' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "triton_model" # type: str + self.description = kwargs.get("description", None) class TruncationSelectionPolicy(EarlyTerminationPolicy): @@ -21677,20 +22022,20 @@ class TruncationSelectionPolicy(EarlyTerminationPolicy): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'truncation_percentage': {'key': 'truncationPercentage', 'type': 'int'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, + "truncation_percentage": { + "key": "truncationPercentage", + "type": "int", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. :paramtype delay_evaluation: int @@ -21700,8 +22045,8 @@ def __init__( :paramtype truncation_percentage: int """ super(TruncationSelectionPolicy, self).__init__(**kwargs) - self.policy_type = 'TruncationSelection' # type: str - self.truncation_percentage = kwargs.get('truncation_percentage', 0) + self.policy_type = "TruncationSelection" # type: str + self.truncation_percentage = kwargs.get("truncation_percentage", 0) class UpdateWorkspaceQuotas(msrest.serialization.Model): @@ -21725,23 +22070,20 @@ class UpdateWorkspaceQuotas(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, + "id": {"readonly": True}, + "type": {"readonly": True}, + "unit": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "limit": {"key": "limit", "type": "long"}, + "unit": {"key": "unit", "type": "str"}, + "status": {"key": "status", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword limit: The maximum permitted quota of the resource. :paramtype limit: long @@ -21754,9 +22096,9 @@ def __init__( super(UpdateWorkspaceQuotas, self).__init__(**kwargs) self.id = None self.type = None - self.limit = kwargs.get('limit', None) + self.limit = kwargs.get("limit", None) self.unit = None - self.status = kwargs.get('status', None) + self.status = kwargs.get("status", None) class UpdateWorkspaceQuotasResult(msrest.serialization.Model): @@ -21772,21 +22114,17 @@ class UpdateWorkspaceQuotasResult(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[UpdateWorkspaceQuotas]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[UpdateWorkspaceQuotas]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UpdateWorkspaceQuotasResult, self).__init__(**kwargs) self.value = None self.next_link = None @@ -21816,24 +22154,21 @@ class UriFileDataVersion(DataVersionBaseProperties): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -21850,7 +22185,7 @@ def __init__( :paramtype data_uri: str """ super(UriFileDataVersion, self).__init__(**kwargs) - self.data_type = 'uri_file' # type: str + self.data_type = "uri_file" # type: str class UriFileJobInput(JobInput, AssetJobInput): @@ -21872,21 +22207,18 @@ class UriFileJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -21897,10 +22229,10 @@ def __init__( :paramtype description: str """ super(UriFileJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'uri_file' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "uri_file" # type: str + self.description = kwargs.get("description", None) class UriFileJobOutput(JobOutput, AssetJobOutput): @@ -21922,20 +22254,17 @@ class UriFileJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", "Direct". @@ -21946,10 +22275,10 @@ def __init__( :paramtype description: str """ super(UriFileJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'uri_file' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "uri_file" # type: str + self.description = kwargs.get("description", None) class UriFolderDataVersion(DataVersionBaseProperties): @@ -21976,24 +22305,21 @@ class UriFolderDataVersion(DataVersionBaseProperties): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -22010,7 +22336,7 @@ def __init__( :paramtype data_uri: str """ super(UriFolderDataVersion, self).__init__(**kwargs) - self.data_type = 'uri_folder' # type: str + self.data_type = "uri_folder" # type: str class UriFolderJobInput(JobInput, AssetJobInput): @@ -22032,21 +22358,18 @@ class UriFolderJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -22057,10 +22380,10 @@ def __init__( :paramtype description: str """ super(UriFolderJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'uri_folder' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "uri_folder" # type: str + self.description = kwargs.get("description", None) class UriFolderJobOutput(JobOutput, AssetJobOutput): @@ -22082,20 +22405,17 @@ class UriFolderJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", "Direct". @@ -22106,10 +22426,10 @@ def __init__( :paramtype description: str """ super(UriFolderJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'uri_folder' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "uri_folder" # type: str + self.description = kwargs.get("description", None) class Usage(msrest.serialization.Model): @@ -22134,31 +22454,30 @@ class Usage(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, + "id": {"readonly": True}, + "aml_workspace_location": {"readonly": True}, + "type": {"readonly": True}, + "unit": {"readonly": True}, + "current_value": {"readonly": True}, + "limit": {"readonly": True}, + "name": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'current_value': {'key': 'currentValue', 'type': 'long'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'name': {'key': 'name', 'type': 'UsageName'}, + "id": {"key": "id", "type": "str"}, + "aml_workspace_location": { + "key": "amlWorkspaceLocation", + "type": "str", + }, + "type": {"key": "type", "type": "str"}, + "unit": {"key": "unit", "type": "str"}, + "current_value": {"key": "currentValue", "type": "long"}, + "limit": {"key": "limit", "type": "long"}, + "name": {"key": "name", "type": "UsageName"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Usage, self).__init__(**kwargs) self.id = None self.aml_workspace_location = None @@ -22181,21 +22500,17 @@ class UsageName(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, + "value": {"readonly": True}, + "localized_value": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + "value": {"key": "value", "type": "str"}, + "localized_value": {"key": "localizedValue", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UsageName, self).__init__(**kwargs) self.value = None self.localized_value = None @@ -22216,19 +22531,19 @@ class UserAccountCredentials(msrest.serialization.Model): """ _validation = { - 'admin_user_name': {'required': True}, + "admin_user_name": {"required": True}, } _attribute_map = { - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'admin_user_ssh_public_key': {'key': 'adminUserSshPublicKey', 'type': 'str'}, - 'admin_user_password': {'key': 'adminUserPassword', 'type': 'str'}, + "admin_user_name": {"key": "adminUserName", "type": "str"}, + "admin_user_ssh_public_key": { + "key": "adminUserSshPublicKey", + "type": "str", + }, + "admin_user_password": {"key": "adminUserPassword", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword admin_user_name: Required. Name of the administrator user account which can be used to SSH to nodes. @@ -22239,9 +22554,11 @@ def __init__( :paramtype admin_user_password: str """ super(UserAccountCredentials, self).__init__(**kwargs) - self.admin_user_name = kwargs['admin_user_name'] - self.admin_user_ssh_public_key = kwargs.get('admin_user_ssh_public_key', None) - self.admin_user_password = kwargs.get('admin_user_password', None) + self.admin_user_name = kwargs["admin_user_name"] + self.admin_user_ssh_public_key = kwargs.get( + "admin_user_ssh_public_key", None + ) + self.admin_user_password = kwargs.get("admin_user_password", None) class UserAssignedIdentity(msrest.serialization.Model): @@ -22256,21 +22573,17 @@ class UserAssignedIdentity(msrest.serialization.Model): """ _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, + "principal_id": {"readonly": True}, + "client_id": {"readonly": True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, + "principal_id": {"key": "principalId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UserAssignedIdentity, self).__init__(**kwargs) self.principal_id = None self.client_id = None @@ -22284,19 +22597,16 @@ class UserCreatedAcrAccount(msrest.serialization.Model): """ _attribute_map = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, + "arm_resource_id": {"key": "armResourceId", "type": "ArmResourceId"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword arm_resource_id: ARM ResourceId of a resource. :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId """ super(UserCreatedAcrAccount, self).__init__(**kwargs) - self.arm_resource_id = kwargs.get('arm_resource_id', None) + self.arm_resource_id = kwargs.get("arm_resource_id", None) class UserCreatedStorageAccount(msrest.serialization.Model): @@ -22307,19 +22617,16 @@ class UserCreatedStorageAccount(msrest.serialization.Model): """ _attribute_map = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, + "arm_resource_id": {"key": "armResourceId", "type": "ArmResourceId"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword arm_resource_id: ARM ResourceId of a resource. :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId """ super(UserCreatedStorageAccount, self).__init__(**kwargs) - self.arm_resource_id = kwargs.get('arm_resource_id', None) + self.arm_resource_id = kwargs.get("arm_resource_id", None) class UserIdentity(IdentityConfiguration): @@ -22334,24 +22641,22 @@ class UserIdentity(IdentityConfiguration): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UserIdentity, self).__init__(**kwargs) - self.identity_type = 'UserIdentity' # type: str + self.identity_type = "UserIdentity" # type: str -class UsernamePasswordAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class UsernamePasswordAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """UsernamePasswordAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -22374,22 +22679,22 @@ class UsernamePasswordAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionP """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionUsernamePassword'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionUsernamePassword", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: Category of the connection. :paramtype category: str @@ -22404,9 +22709,11 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword """ - super(UsernamePasswordAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'UsernamePassword' # type: str - self.credentials = kwargs.get('credentials', None) + super( + UsernamePasswordAuthTypeWorkspaceConnectionProperties, self + ).__init__(**kwargs) + self.auth_type = "UsernamePassword" # type: str + self.credentials = kwargs.get("credentials", None) class VirtualMachineSchema(msrest.serialization.Model): @@ -22417,20 +22724,20 @@ class VirtualMachineSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, + "properties": { + "key": "properties", + "type": "VirtualMachineSchemaProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: :paramtype properties: ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties """ super(VirtualMachineSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class VirtualMachine(Compute, VirtualMachineSchema): @@ -22472,34 +22779,37 @@ class VirtualMachine(Compute, VirtualMachineSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + "disable_local_auth": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": { + "key": "properties", + "type": "VirtualMachineSchemaProperties", + }, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: :paramtype properties: @@ -22510,14 +22820,14 @@ def __init__( :paramtype resource_id: str """ super(VirtualMachine, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'VirtualMachine' # type: str + self.properties = kwargs.get("properties", None) + self.compute_type = "VirtualMachine" # type: str self.compute_location = None self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None self.disable_local_auth = None @@ -22533,23 +22843,20 @@ class VirtualMachineImage(msrest.serialization.Model): """ _validation = { - 'id': {'required': True}, + "id": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword id: Required. Virtual Machine image path. :paramtype id: str """ super(VirtualMachineImage, self).__init__(**kwargs) - self.id = kwargs['id'] + self.id = kwargs["id"] class VirtualMachineSchemaProperties(msrest.serialization.Model): @@ -22572,18 +22879,21 @@ class VirtualMachineSchemaProperties(msrest.serialization.Model): """ _attribute_map = { - 'virtual_machine_size': {'key': 'virtualMachineSize', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'notebook_server_port': {'key': 'notebookServerPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'is_notebook_instance_compute': {'key': 'isNotebookInstanceCompute', 'type': 'bool'}, + "virtual_machine_size": {"key": "virtualMachineSize", "type": "str"}, + "ssh_port": {"key": "sshPort", "type": "int"}, + "notebook_server_port": {"key": "notebookServerPort", "type": "int"}, + "address": {"key": "address", "type": "str"}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, + "is_notebook_instance_compute": { + "key": "isNotebookInstanceCompute", + "type": "bool", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword virtual_machine_size: Virtual Machine size. :paramtype virtual_machine_size: str @@ -22601,12 +22911,14 @@ def __init__( :paramtype is_notebook_instance_compute: bool """ super(VirtualMachineSchemaProperties, self).__init__(**kwargs) - self.virtual_machine_size = kwargs.get('virtual_machine_size', None) - self.ssh_port = kwargs.get('ssh_port', None) - self.notebook_server_port = kwargs.get('notebook_server_port', None) - self.address = kwargs.get('address', None) - self.administrator_account = kwargs.get('administrator_account', None) - self.is_notebook_instance_compute = kwargs.get('is_notebook_instance_compute', None) + self.virtual_machine_size = kwargs.get("virtual_machine_size", None) + self.ssh_port = kwargs.get("ssh_port", None) + self.notebook_server_port = kwargs.get("notebook_server_port", None) + self.address = kwargs.get("address", None) + self.administrator_account = kwargs.get("administrator_account", None) + self.is_notebook_instance_compute = kwargs.get( + "is_notebook_instance_compute", None + ) class VirtualMachineSecretsSchema(msrest.serialization.Model): @@ -22618,20 +22930,20 @@ class VirtualMachineSecretsSchema(msrest.serialization.Model): """ _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword administrator_account: Admin credentials for virtual machine. :paramtype administrator_account: ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials """ super(VirtualMachineSecretsSchema, self).__init__(**kwargs) - self.administrator_account = kwargs.get('administrator_account', None) + self.administrator_account = kwargs.get("administrator_account", None) class VirtualMachineSecrets(ComputeSecrets, VirtualMachineSecretsSchema): @@ -22649,26 +22961,26 @@ class VirtualMachineSecrets(ComputeSecrets, VirtualMachineSecretsSchema): """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, + "compute_type": {"key": "computeType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword administrator_account: Admin credentials for virtual machine. :paramtype administrator_account: ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials """ super(VirtualMachineSecrets, self).__init__(**kwargs) - self.administrator_account = kwargs.get('administrator_account', None) - self.compute_type = 'VirtualMachine' # type: str + self.administrator_account = kwargs.get("administrator_account", None) + self.compute_type = "VirtualMachine" # type: str class VirtualMachineSize(msrest.serialization.Model): @@ -22703,35 +23015,41 @@ class VirtualMachineSize(msrest.serialization.Model): """ _validation = { - 'name': {'readonly': True}, - 'family': {'readonly': True}, - 'v_cp_us': {'readonly': True}, - 'gpus': {'readonly': True}, - 'os_vhd_size_mb': {'readonly': True}, - 'max_resource_volume_mb': {'readonly': True}, - 'memory_gb': {'readonly': True}, - 'low_priority_capable': {'readonly': True}, - 'premium_io': {'readonly': True}, + "name": {"readonly": True}, + "family": {"readonly": True}, + "v_cp_us": {"readonly": True}, + "gpus": {"readonly": True}, + "os_vhd_size_mb": {"readonly": True}, + "max_resource_volume_mb": {"readonly": True}, + "memory_gb": {"readonly": True}, + "low_priority_capable": {"readonly": True}, + "premium_io": {"readonly": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'v_cp_us': {'key': 'vCPUs', 'type': 'int'}, - 'gpus': {'key': 'gpus', 'type': 'int'}, - 'os_vhd_size_mb': {'key': 'osVhdSizeMB', 'type': 'int'}, - 'max_resource_volume_mb': {'key': 'maxResourceVolumeMB', 'type': 'int'}, - 'memory_gb': {'key': 'memoryGB', 'type': 'float'}, - 'low_priority_capable': {'key': 'lowPriorityCapable', 'type': 'bool'}, - 'premium_io': {'key': 'premiumIO', 'type': 'bool'}, - 'estimated_vm_prices': {'key': 'estimatedVMPrices', 'type': 'EstimatedVMPrices'}, - 'supported_compute_types': {'key': 'supportedComputeTypes', 'type': '[str]'}, + "name": {"key": "name", "type": "str"}, + "family": {"key": "family", "type": "str"}, + "v_cp_us": {"key": "vCPUs", "type": "int"}, + "gpus": {"key": "gpus", "type": "int"}, + "os_vhd_size_mb": {"key": "osVhdSizeMB", "type": "int"}, + "max_resource_volume_mb": { + "key": "maxResourceVolumeMB", + "type": "int", + }, + "memory_gb": {"key": "memoryGB", "type": "float"}, + "low_priority_capable": {"key": "lowPriorityCapable", "type": "bool"}, + "premium_io": {"key": "premiumIO", "type": "bool"}, + "estimated_vm_prices": { + "key": "estimatedVMPrices", + "type": "EstimatedVMPrices", + }, + "supported_compute_types": { + "key": "supportedComputeTypes", + "type": "[str]", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword estimated_vm_prices: The estimated price information for using a VM. :paramtype estimated_vm_prices: ~azure.mgmt.machinelearningservices.models.EstimatedVMPrices @@ -22749,8 +23067,10 @@ def __init__( self.memory_gb = None self.low_priority_capable = None self.premium_io = None - self.estimated_vm_prices = kwargs.get('estimated_vm_prices', None) - self.supported_compute_types = kwargs.get('supported_compute_types', None) + self.estimated_vm_prices = kwargs.get("estimated_vm_prices", None) + self.supported_compute_types = kwargs.get( + "supported_compute_types", None + ) class VirtualMachineSizeListResult(msrest.serialization.Model): @@ -22761,19 +23081,16 @@ class VirtualMachineSizeListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[VirtualMachineSize]'}, + "value": {"key": "value", "type": "[VirtualMachineSize]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: The list of virtual machine sizes supported by AmlCompute. :paramtype value: list[~azure.mgmt.machinelearningservices.models.VirtualMachineSize] """ super(VirtualMachineSizeListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class VirtualMachineSshCredentials(msrest.serialization.Model): @@ -22790,16 +23107,13 @@ class VirtualMachineSshCredentials(msrest.serialization.Model): """ _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'public_key_data': {'key': 'publicKeyData', 'type': 'str'}, - 'private_key_data': {'key': 'privateKeyData', 'type': 'str'}, + "username": {"key": "username", "type": "str"}, + "password": {"key": "password", "type": "str"}, + "public_key_data": {"key": "publicKeyData", "type": "str"}, + "private_key_data": {"key": "privateKeyData", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword username: Username of admin account. :paramtype username: str @@ -22811,10 +23125,10 @@ def __init__( :paramtype private_key_data: str """ super(VirtualMachineSshCredentials, self).__init__(**kwargs) - self.username = kwargs.get('username', None) - self.password = kwargs.get('password', None) - self.public_key_data = kwargs.get('public_key_data', None) - self.private_key_data = kwargs.get('private_key_data', None) + self.username = kwargs.get("username", None) + self.password = kwargs.get("password", None) + self.public_key_data = kwargs.get("public_key_data", None) + self.private_key_data = kwargs.get("private_key_data", None) class VolumeDefinition(msrest.serialization.Model): @@ -22840,20 +23154,17 @@ class VolumeDefinition(msrest.serialization.Model): """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'read_only': {'key': 'readOnly', 'type': 'bool'}, - 'source': {'key': 'source', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'consistency': {'key': 'consistency', 'type': 'str'}, - 'bind': {'key': 'bind', 'type': 'BindOptions'}, - 'volume': {'key': 'volume', 'type': 'VolumeOptions'}, - 'tmpfs': {'key': 'tmpfs', 'type': 'TmpfsOptions'}, + "type": {"key": "type", "type": "str"}, + "read_only": {"key": "readOnly", "type": "bool"}, + "source": {"key": "source", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "consistency": {"key": "consistency", "type": "str"}, + "bind": {"key": "bind", "type": "BindOptions"}, + "volume": {"key": "volume", "type": "VolumeOptions"}, + "tmpfs": {"key": "tmpfs", "type": "TmpfsOptions"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword type: Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe. Possible values include: "bind", "volume", "tmpfs", "npipe". Default value: "bind". @@ -22875,14 +23186,14 @@ def __init__( :paramtype tmpfs: ~azure.mgmt.machinelearningservices.models.TmpfsOptions """ super(VolumeDefinition, self).__init__(**kwargs) - self.type = kwargs.get('type', "bind") - self.read_only = kwargs.get('read_only', None) - self.source = kwargs.get('source', None) - self.target = kwargs.get('target', None) - self.consistency = kwargs.get('consistency', None) - self.bind = kwargs.get('bind', None) - self.volume = kwargs.get('volume', None) - self.tmpfs = kwargs.get('tmpfs', None) + self.type = kwargs.get("type", "bind") + self.read_only = kwargs.get("read_only", None) + self.source = kwargs.get("source", None) + self.target = kwargs.get("target", None) + self.consistency = kwargs.get("consistency", None) + self.bind = kwargs.get("bind", None) + self.volume = kwargs.get("volume", None) + self.tmpfs = kwargs.get("tmpfs", None) class VolumeOptions(msrest.serialization.Model): @@ -22893,19 +23204,16 @@ class VolumeOptions(msrest.serialization.Model): """ _attribute_map = { - 'nocopy': {'key': 'nocopy', 'type': 'bool'}, + "nocopy": {"key": "nocopy", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword nocopy: Indicate whether volume is nocopy. :paramtype nocopy: bool """ super(VolumeOptions, self).__init__(**kwargs) - self.nocopy = kwargs.get('nocopy', None) + self.nocopy = kwargs.get("nocopy", None) class Workspace(Resource): @@ -23010,65 +23318,113 @@ class Workspace(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'workspace_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'service_provisioned_resource_group': {'readonly': True}, - 'private_link_count': {'readonly': True}, - 'private_endpoint_connections': {'readonly': True}, - 'notebook_info': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'storage_hns_enabled': {'readonly': True}, - 'ml_flow_tracking_uri': {'readonly': True}, - 'soft_deleted_at': {'readonly': True}, - 'scheduled_purge_date': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'key_vault': {'key': 'properties.keyVault', 'type': 'str'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'storage_account': {'key': 'properties.storageAccount', 'type': 'str'}, - 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionProperty'}, - 'hbi_workspace': {'key': 'properties.hbiWorkspace', 'type': 'bool'}, - 'service_provisioned_resource_group': {'key': 'properties.serviceProvisionedResourceGroup', 'type': 'str'}, - 'private_link_count': {'key': 'properties.privateLinkCount', 'type': 'int'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'allow_public_access_when_behind_vnet': {'key': 'properties.allowPublicAccessWhenBehindVnet', 'type': 'bool'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, - 'shared_private_link_resources': {'key': 'properties.sharedPrivateLinkResources', 'type': '[SharedPrivateLinkResource]'}, - 'notebook_info': {'key': 'properties.notebookInfo', 'type': 'NotebookResourceInfo'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, - 'storage_hns_enabled': {'key': 'properties.storageHnsEnabled', 'type': 'bool'}, - 'ml_flow_tracking_uri': {'key': 'properties.mlFlowTrackingUri', 'type': 'str'}, - 'v1_legacy_mode': {'key': 'properties.v1LegacyMode', 'type': 'bool'}, - 'soft_deleted_at': {'key': 'properties.softDeletedAt', 'type': 'str'}, - 'scheduled_purge_date': {'key': 'properties.scheduledPurgeDate', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "workspace_id": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "service_provisioned_resource_group": {"readonly": True}, + "private_link_count": {"readonly": True}, + "private_endpoint_connections": {"readonly": True}, + "notebook_info": {"readonly": True}, + "tenant_id": {"readonly": True}, + "storage_hns_enabled": {"readonly": True}, + "ml_flow_tracking_uri": {"readonly": True}, + "soft_deleted_at": {"readonly": True}, + "scheduled_purge_date": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "workspace_id": {"key": "properties.workspaceId", "type": "str"}, + "description": {"key": "properties.description", "type": "str"}, + "friendly_name": {"key": "properties.friendlyName", "type": "str"}, + "key_vault": {"key": "properties.keyVault", "type": "str"}, + "application_insights": { + "key": "properties.applicationInsights", + "type": "str", + }, + "container_registry": { + "key": "properties.containerRegistry", + "type": "str", + }, + "storage_account": {"key": "properties.storageAccount", "type": "str"}, + "discovery_url": {"key": "properties.discoveryUrl", "type": "str"}, + "provisioning_state": { + "key": "properties.provisioningState", + "type": "str", + }, + "encryption": { + "key": "properties.encryption", + "type": "EncryptionProperty", + }, + "hbi_workspace": {"key": "properties.hbiWorkspace", "type": "bool"}, + "service_provisioned_resource_group": { + "key": "properties.serviceProvisionedResourceGroup", + "type": "str", + }, + "private_link_count": { + "key": "properties.privateLinkCount", + "type": "int", + }, + "image_build_compute": { + "key": "properties.imageBuildCompute", + "type": "str", + }, + "allow_public_access_when_behind_vnet": { + "key": "properties.allowPublicAccessWhenBehindVnet", + "type": "bool", + }, + "public_network_access": { + "key": "properties.publicNetworkAccess", + "type": "str", + }, + "private_endpoint_connections": { + "key": "properties.privateEndpointConnections", + "type": "[PrivateEndpointConnection]", + }, + "shared_private_link_resources": { + "key": "properties.sharedPrivateLinkResources", + "type": "[SharedPrivateLinkResource]", + }, + "notebook_info": { + "key": "properties.notebookInfo", + "type": "NotebookResourceInfo", + }, + "service_managed_resources_settings": { + "key": "properties.serviceManagedResourcesSettings", + "type": "ServiceManagedResourcesSettings", + }, + "primary_user_assigned_identity": { + "key": "properties.primaryUserAssignedIdentity", + "type": "str", + }, + "tenant_id": {"key": "properties.tenantId", "type": "str"}, + "storage_hns_enabled": { + "key": "properties.storageHnsEnabled", + "type": "bool", + }, + "ml_flow_tracking_uri": { + "key": "properties.mlFlowTrackingUri", + "type": "str", + }, + "v1_legacy_mode": {"key": "properties.v1LegacyMode", "type": "bool"}, + "soft_deleted_at": {"key": "properties.softDeletedAt", "type": "str"}, + "scheduled_purge_date": { + "key": "properties.scheduledPurgeDate", + "type": "str", + }, + } + + def __init__(self, **kwargs): """ :keyword identity: The identity of the resource. :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity @@ -23125,35 +23481,43 @@ def __init__( :paramtype v1_legacy_mode: bool """ super(Workspace, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) + self.identity = kwargs.get("identity", None) + self.location = kwargs.get("location", None) + self.tags = kwargs.get("tags", None) + self.sku = kwargs.get("sku", None) self.workspace_id = None - self.description = kwargs.get('description', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.key_vault = kwargs.get('key_vault', None) - self.application_insights = kwargs.get('application_insights', None) - self.container_registry = kwargs.get('container_registry', None) - self.storage_account = kwargs.get('storage_account', None) - self.discovery_url = kwargs.get('discovery_url', None) + self.description = kwargs.get("description", None) + self.friendly_name = kwargs.get("friendly_name", None) + self.key_vault = kwargs.get("key_vault", None) + self.application_insights = kwargs.get("application_insights", None) + self.container_registry = kwargs.get("container_registry", None) + self.storage_account = kwargs.get("storage_account", None) + self.discovery_url = kwargs.get("discovery_url", None) self.provisioning_state = None - self.encryption = kwargs.get('encryption', None) - self.hbi_workspace = kwargs.get('hbi_workspace', False) + self.encryption = kwargs.get("encryption", None) + self.hbi_workspace = kwargs.get("hbi_workspace", False) self.service_provisioned_resource_group = None self.private_link_count = None - self.image_build_compute = kwargs.get('image_build_compute', None) - self.allow_public_access_when_behind_vnet = kwargs.get('allow_public_access_when_behind_vnet', False) - self.public_network_access = kwargs.get('public_network_access', None) + self.image_build_compute = kwargs.get("image_build_compute", None) + self.allow_public_access_when_behind_vnet = kwargs.get( + "allow_public_access_when_behind_vnet", False + ) + self.public_network_access = kwargs.get("public_network_access", None) self.private_endpoint_connections = None - self.shared_private_link_resources = kwargs.get('shared_private_link_resources', None) + self.shared_private_link_resources = kwargs.get( + "shared_private_link_resources", None + ) self.notebook_info = None - self.service_managed_resources_settings = kwargs.get('service_managed_resources_settings', None) - self.primary_user_assigned_identity = kwargs.get('primary_user_assigned_identity', None) + self.service_managed_resources_settings = kwargs.get( + "service_managed_resources_settings", None + ) + self.primary_user_assigned_identity = kwargs.get( + "primary_user_assigned_identity", None + ) self.tenant_id = None self.storage_hns_enabled = None self.ml_flow_tracking_uri = None - self.v1_legacy_mode = kwargs.get('v1_legacy_mode', False) + self.v1_legacy_mode = kwargs.get("v1_legacy_mode", False) self.soft_deleted_at = None self.scheduled_purge_date = None @@ -23168,14 +23532,11 @@ class WorkspaceConnectionAccessKey(msrest.serialization.Model): """ _attribute_map = { - 'access_key_id': {'key': 'accessKeyId', 'type': 'str'}, - 'secret_access_key': {'key': 'secretAccessKey', 'type': 'str'}, + "access_key_id": {"key": "accessKeyId", "type": "str"}, + "secret_access_key": {"key": "secretAccessKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword access_key_id: :paramtype access_key_id: str @@ -23183,8 +23544,8 @@ def __init__( :paramtype secret_access_key: str """ super(WorkspaceConnectionAccessKey, self).__init__(**kwargs) - self.access_key_id = kwargs.get('access_key_id', None) - self.secret_access_key = kwargs.get('secret_access_key', None) + self.access_key_id = kwargs.get("access_key_id", None) + self.secret_access_key = kwargs.get("secret_access_key", None) class WorkspaceConnectionManagedIdentity(msrest.serialization.Model): @@ -23197,14 +23558,11 @@ class WorkspaceConnectionManagedIdentity(msrest.serialization.Model): """ _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, + "resource_id": {"key": "resourceId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword resource_id: :paramtype resource_id: str @@ -23212,8 +23570,8 @@ def __init__( :paramtype client_id: str """ super(WorkspaceConnectionManagedIdentity, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.client_id = kwargs.get('client_id', None) + self.resource_id = kwargs.get("resource_id", None) + self.client_id = kwargs.get("client_id", None) class WorkspaceConnectionPersonalAccessToken(msrest.serialization.Model): @@ -23224,19 +23582,16 @@ class WorkspaceConnectionPersonalAccessToken(msrest.serialization.Model): """ _attribute_map = { - 'pat': {'key': 'pat', 'type': 'str'}, + "pat": {"key": "pat", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword pat: :paramtype pat: str """ super(WorkspaceConnectionPersonalAccessToken, self).__init__(**kwargs) - self.pat = kwargs.get('pat', None) + self.pat = kwargs.get("pat", None) class WorkspaceConnectionPropertiesV2BasicResource(Resource): @@ -23262,35 +23617,39 @@ class WorkspaceConnectionPropertiesV2BasicResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'WorkspaceConnectionPropertiesV2'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "WorkspaceConnectionPropertiesV2", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. :paramtype properties: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 """ - super(WorkspaceConnectionPropertiesV2BasicResource, self).__init__(**kwargs) - self.properties = kwargs['properties'] + super(WorkspaceConnectionPropertiesV2BasicResource, self).__init__( + **kwargs + ) + self.properties = kwargs["properties"] -class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(msrest.serialization.Model): +class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult( + msrest.serialization.Model +): """WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult. Variables are only populated by the server, and will be ignored when sending a request. @@ -23303,25 +23662,28 @@ class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(msrest.seri """ _validation = { - 'next_link': {'readonly': True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[WorkspaceConnectionPropertiesV2BasicResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": { + "key": "value", + "type": "[WorkspaceConnectionPropertiesV2BasicResource]", + }, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: :paramtype value: list[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource] """ - super(WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + super( + WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, + self, + ).__init__(**kwargs) + self.value = kwargs.get("value", None) self.next_link = None @@ -23337,15 +23699,12 @@ class WorkspaceConnectionServicePrincipal(msrest.serialization.Model): """ _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + "client_id": {"key": "clientId", "type": "str"}, + "client_secret": {"key": "clientSecret", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword client_id: :paramtype client_id: str @@ -23355,9 +23714,9 @@ def __init__( :paramtype tenant_id: str """ super(WorkspaceConnectionServicePrincipal, self).__init__(**kwargs) - self.client_id = kwargs.get('client_id', None) - self.client_secret = kwargs.get('client_secret', None) - self.tenant_id = kwargs.get('tenant_id', None) + self.client_id = kwargs.get("client_id", None) + self.client_secret = kwargs.get("client_secret", None) + self.tenant_id = kwargs.get("tenant_id", None) class WorkspaceConnectionSharedAccessSignature(msrest.serialization.Model): @@ -23368,19 +23727,18 @@ class WorkspaceConnectionSharedAccessSignature(msrest.serialization.Model): """ _attribute_map = { - 'sas': {'key': 'sas', 'type': 'str'}, + "sas": {"key": "sas", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword sas: :paramtype sas: str """ - super(WorkspaceConnectionSharedAccessSignature, self).__init__(**kwargs) - self.sas = kwargs.get('sas', None) + super(WorkspaceConnectionSharedAccessSignature, self).__init__( + **kwargs + ) + self.sas = kwargs.get("sas", None) class WorkspaceConnectionUsernamePassword(msrest.serialization.Model): @@ -23393,14 +23751,11 @@ class WorkspaceConnectionUsernamePassword(msrest.serialization.Model): """ _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, + "username": {"key": "username", "type": "str"}, + "password": {"key": "password", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword username: :paramtype username: str @@ -23408,8 +23763,8 @@ def __init__( :paramtype password: str """ super(WorkspaceConnectionUsernamePassword, self).__init__(**kwargs) - self.username = kwargs.get('username', None) - self.password = kwargs.get('password', None) + self.username = kwargs.get("username", None) + self.password = kwargs.get("password", None) class WorkspaceListResult(msrest.serialization.Model): @@ -23424,14 +23779,11 @@ class WorkspaceListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[Workspace]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Workspace]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: The list of machine learning workspaces. Since this list may be incomplete, the nextLink field should be used to request the next list of machine learning workspaces. @@ -23441,8 +23793,8 @@ def __init__( :paramtype next_link: str """ super(WorkspaceListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get("value", None) + self.next_link = kwargs.get("next_link", None) class WorkspaceUpdateParameters(msrest.serialization.Model): @@ -23479,24 +23831,42 @@ class WorkspaceUpdateParameters(msrest.serialization.Model): """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionUpdateProperties'}, - } - - def __init__( - self, - **kwargs - ): + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "description": {"key": "properties.description", "type": "str"}, + "friendly_name": {"key": "properties.friendlyName", "type": "str"}, + "image_build_compute": { + "key": "properties.imageBuildCompute", + "type": "str", + }, + "service_managed_resources_settings": { + "key": "properties.serviceManagedResourcesSettings", + "type": "ServiceManagedResourcesSettings", + }, + "primary_user_assigned_identity": { + "key": "properties.primaryUserAssignedIdentity", + "type": "str", + }, + "public_network_access": { + "key": "properties.publicNetworkAccess", + "type": "str", + }, + "application_insights": { + "key": "properties.applicationInsights", + "type": "str", + }, + "container_registry": { + "key": "properties.containerRegistry", + "type": "str", + }, + "encryption": { + "key": "properties.encryption", + "type": "EncryptionUpdateProperties", + }, + } + + def __init__(self, **kwargs): """ :keyword tags: A set of tags. The resource tags for the machine learning workspace. :paramtype tags: dict[str, str] @@ -23529,15 +23899,19 @@ def __init__( :paramtype encryption: ~azure.mgmt.machinelearningservices.models.EncryptionUpdateProperties """ super(WorkspaceUpdateParameters, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) - self.identity = kwargs.get('identity', None) - self.description = kwargs.get('description', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.image_build_compute = kwargs.get('image_build_compute', None) - self.service_managed_resources_settings = kwargs.get('service_managed_resources_settings', None) - self.primary_user_assigned_identity = kwargs.get('primary_user_assigned_identity', None) - self.public_network_access = kwargs.get('public_network_access', None) - self.application_insights = kwargs.get('application_insights', None) - self.container_registry = kwargs.get('container_registry', None) - self.encryption = kwargs.get('encryption', None) + self.tags = kwargs.get("tags", None) + self.sku = kwargs.get("sku", None) + self.identity = kwargs.get("identity", None) + self.description = kwargs.get("description", None) + self.friendly_name = kwargs.get("friendly_name", None) + self.image_build_compute = kwargs.get("image_build_compute", None) + self.service_managed_resources_settings = kwargs.get( + "service_managed_resources_settings", None + ) + self.primary_user_assigned_identity = kwargs.get( + "primary_user_assigned_identity", None + ) + self.public_network_access = kwargs.get("public_network_access", None) + self.application_insights = kwargs.get("application_insights", None) + self.container_registry = kwargs.get("container_registry", None) + self.encryption = kwargs.get("encryption", None) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/_models_py3.py index 0906058e44d8..da593e6dfc64 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/_models_py3.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/_models_py3.py @@ -38,19 +38,27 @@ class WorkspaceConnectionPropertiesV2(msrest.serialization.Model): """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, } _subtype_map = { - 'auth_type': {'AccessKey': 'AccessKeyAuthTypeWorkspaceConnectionProperties', 'ManagedIdentity': 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', 'None': 'NoneAuthTypeWorkspaceConnectionProperties', 'PAT': 'PATAuthTypeWorkspaceConnectionProperties', 'SAS': 'SASAuthTypeWorkspaceConnectionProperties', 'ServicePrincipal': 'ServicePrincipalAuthTypeWorkspaceConnectionProperties', 'UsernamePassword': 'UsernamePasswordAuthTypeWorkspaceConnectionProperties'} + "auth_type": { + "AccessKey": "AccessKeyAuthTypeWorkspaceConnectionProperties", + "ManagedIdentity": "ManagedIdentityAuthTypeWorkspaceConnectionProperties", + "None": "NoneAuthTypeWorkspaceConnectionProperties", + "PAT": "PATAuthTypeWorkspaceConnectionProperties", + "SAS": "SASAuthTypeWorkspaceConnectionProperties", + "ServicePrincipal": "ServicePrincipalAuthTypeWorkspaceConnectionProperties", + "UsernamePassword": "UsernamePasswordAuthTypeWorkspaceConnectionProperties", + } } def __init__( @@ -81,7 +89,9 @@ def __init__( self.value_format = value_format -class AccessKeyAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class AccessKeyAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """AccessKeyAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -103,16 +113,19 @@ class AccessKeyAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionProperti """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionAccessKey'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionAccessKey", + }, } def __init__( @@ -138,8 +151,14 @@ def __init__( :keyword credentials: :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccessKey """ - super(AccessKeyAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'AccessKey' # type: str + super(AccessKeyAuthTypeWorkspaceConnectionProperties, self).__init__( + category=category, + target=target, + value=value, + value_format=value_format, + **kwargs + ) + self.auth_type = "AccessKey" # type: str self.credentials = credentials @@ -158,23 +177,27 @@ class DatastoreCredentials(msrest.serialization.Model): """ _validation = { - 'credentials_type': {'required': True}, + "credentials_type": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, } _subtype_map = { - 'credentials_type': {'AccountKey': 'AccountKeyDatastoreCredentials', 'Certificate': 'CertificateDatastoreCredentials', 'KerberosKeytab': 'KerberosKeytabCredentials', 'KerberosPassword': 'KerberosPasswordCredentials', 'None': 'NoneDatastoreCredentials', 'Sas': 'SasDatastoreCredentials', 'ServicePrincipal': 'ServicePrincipalDatastoreCredentials'} - } - - def __init__( - self, - **kwargs - ): - """ - """ + "credentials_type": { + "AccountKey": "AccountKeyDatastoreCredentials", + "Certificate": "CertificateDatastoreCredentials", + "KerberosKeytab": "KerberosKeytabCredentials", + "KerberosPassword": "KerberosPasswordCredentials", + "None": "NoneDatastoreCredentials", + "Sas": "SasDatastoreCredentials", + "ServicePrincipal": "ServicePrincipalDatastoreCredentials", + } + } + + def __init__(self, **kwargs): + """ """ super(DatastoreCredentials, self).__init__(**kwargs) self.credentials_type = None # type: Optional[str] @@ -193,27 +216,22 @@ class AccountKeyDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, + "credentials_type": {"required": True}, + "secrets": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'AccountKeyDatastoreSecrets'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "secrets": {"key": "secrets", "type": "AccountKeyDatastoreSecrets"}, } - def __init__( - self, - *, - secrets: "AccountKeyDatastoreSecrets", - **kwargs - ): + def __init__(self, *, secrets: "AccountKeyDatastoreSecrets", **kwargs): """ :keyword secrets: Required. [Required] Storage account secrets. :paramtype secrets: ~azure.mgmt.machinelearningservices.models.AccountKeyDatastoreSecrets """ super(AccountKeyDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'AccountKey' # type: str + self.credentials_type = "AccountKey" # type: str self.secrets = secrets @@ -232,23 +250,26 @@ class DatastoreSecrets(msrest.serialization.Model): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, } _subtype_map = { - 'secrets_type': {'AccountKey': 'AccountKeyDatastoreSecrets', 'Certificate': 'CertificateDatastoreSecrets', 'KerberosKeytab': 'KerberosKeytabSecrets', 'KerberosPassword': 'KerberosPasswordSecrets', 'Sas': 'SasDatastoreSecrets', 'ServicePrincipal': 'ServicePrincipalDatastoreSecrets'} - } - - def __init__( - self, - **kwargs - ): - """ - """ + "secrets_type": { + "AccountKey": "AccountKeyDatastoreSecrets", + "Certificate": "CertificateDatastoreSecrets", + "KerberosKeytab": "KerberosKeytabSecrets", + "KerberosPassword": "KerberosPasswordSecrets", + "Sas": "SasDatastoreSecrets", + "ServicePrincipal": "ServicePrincipalDatastoreSecrets", + } + } + + def __init__(self, **kwargs): + """ """ super(DatastoreSecrets, self).__init__(**kwargs) self.secrets_type = None # type: Optional[str] @@ -267,26 +288,21 @@ class AccountKeyDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "key": {"key": "key", "type": "str"}, } - def __init__( - self, - *, - key: Optional[str] = None, - **kwargs - ): + def __init__(self, *, key: Optional[str] = None, **kwargs): """ :keyword key: Storage account key. :paramtype key: str """ super(AccountKeyDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'AccountKey' # type: str + self.secrets_type = "AccountKey" # type: str self.key = key @@ -302,8 +318,14 @@ class AcrDetails(msrest.serialization.Model): """ _attribute_map = { - 'system_created_acr_account': {'key': 'systemCreatedAcrAccount', 'type': 'SystemCreatedAcrAccount'}, - 'user_created_acr_account': {'key': 'userCreatedAcrAccount', 'type': 'UserCreatedAcrAccount'}, + "system_created_acr_account": { + "key": "systemCreatedAcrAccount", + "type": "SystemCreatedAcrAccount", + }, + "user_created_acr_account": { + "key": "userCreatedAcrAccount", + "type": "UserCreatedAcrAccount", + }, } def __init__( @@ -334,14 +356,11 @@ class AKSSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, + "properties": {"key": "properties", "type": "AKSSchemaProperties"}, } def __init__( - self, - *, - properties: Optional["AKSSchemaProperties"] = None, - **kwargs + self, *, properties: Optional["AKSSchemaProperties"] = None, **kwargs ): """ :keyword properties: AKS properties. @@ -391,31 +410,45 @@ class Compute(msrest.serialization.Model): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + "disable_local_auth": {"readonly": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } _subtype_map = { - 'compute_type': {'AKS': 'AKS', 'AmlCompute': 'AmlCompute', 'ComputeInstance': 'ComputeInstance', 'DataFactory': 'DataFactory', 'DataLakeAnalytics': 'DataLakeAnalytics', 'Databricks': 'Databricks', 'HDInsight': 'HDInsight', 'Kubernetes': 'Kubernetes', 'SynapseSpark': 'SynapseSpark', 'VirtualMachine': 'VirtualMachine'} + "compute_type": { + "AKS": "AKS", + "AmlCompute": "AmlCompute", + "ComputeInstance": "ComputeInstance", + "DataFactory": "DataFactory", + "DataLakeAnalytics": "DataLakeAnalytics", + "Databricks": "Databricks", + "HDInsight": "HDInsight", + "Kubernetes": "Kubernetes", + "SynapseSpark": "SynapseSpark", + "VirtualMachine": "VirtualMachine", + } } def __init__( @@ -483,28 +516,31 @@ class AKS(Compute, AKSSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + "disable_local_auth": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "AKSSchemaProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -523,9 +559,14 @@ def __init__( :keyword resource_id: ARM resource id of the underlying compute. :paramtype resource_id: str """ - super(AKS, self).__init__(description=description, resource_id=resource_id, properties=properties, **kwargs) + super(AKS, self).__init__( + description=description, + resource_id=resource_id, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'AKS' # type: str + self.compute_type = "AKS" # type: str self.compute_location = None self.provisioning_state = None self.description = description @@ -551,9 +592,12 @@ class AksComputeSecretsProperties(msrest.serialization.Model): """ _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, + "user_kube_config": {"key": "userKubeConfig", "type": "str"}, + "admin_kube_config": {"key": "adminKubeConfig", "type": "str"}, + "image_pull_secret_name": { + "key": "imagePullSecretName", + "type": "str", + }, } def __init__( @@ -595,23 +639,23 @@ class ComputeSecrets(msrest.serialization.Model): """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "compute_type": {"key": "computeType", "type": "str"}, } _subtype_map = { - 'compute_type': {'AKS': 'AksComputeSecrets', 'Databricks': 'DatabricksComputeSecrets', 'VirtualMachine': 'VirtualMachineSecrets'} + "compute_type": { + "AKS": "AksComputeSecrets", + "Databricks": "DatabricksComputeSecrets", + "VirtualMachine": "VirtualMachineSecrets", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ComputeSecrets, self).__init__(**kwargs) self.compute_type = None # type: Optional[str] @@ -636,14 +680,17 @@ class AksComputeSecrets(ComputeSecrets, AksComputeSecretsProperties): """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "user_kube_config": {"key": "userKubeConfig", "type": "str"}, + "admin_kube_config": {"key": "adminKubeConfig", "type": "str"}, + "image_pull_secret_name": { + "key": "imagePullSecretName", + "type": "str", + }, + "compute_type": {"key": "computeType", "type": "str"}, } def __init__( @@ -664,11 +711,16 @@ def __init__( :keyword image_pull_secret_name: Image registry pull secret. :paramtype image_pull_secret_name: str """ - super(AksComputeSecrets, self).__init__(user_kube_config=user_kube_config, admin_kube_config=admin_kube_config, image_pull_secret_name=image_pull_secret_name, **kwargs) + super(AksComputeSecrets, self).__init__( + user_kube_config=user_kube_config, + admin_kube_config=admin_kube_config, + image_pull_secret_name=image_pull_secret_name, + **kwargs + ) self.user_kube_config = user_kube_config self.admin_kube_config = admin_kube_config self.image_pull_secret_name = image_pull_secret_name - self.compute_type = 'AKS' # type: str + self.compute_type = "AKS" # type: str class AksNetworkingConfiguration(msrest.serialization.Model): @@ -688,16 +740,22 @@ class AksNetworkingConfiguration(msrest.serialization.Model): """ _validation = { - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, + "service_cidr": { + "pattern": r"^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$" + }, + "dns_service_ip": { + "pattern": r"^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" + }, + "docker_bridge_cidr": { + "pattern": r"^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$" + }, } _attribute_map = { - 'subnet_id': {'key': 'subnetId', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, + "subnet_id": {"key": "subnetId", "type": "str"}, + "service_cidr": {"key": "serviceCidr", "type": "str"}, + "dns_service_ip": {"key": "dnsServiceIP", "type": "str"}, + "docker_bridge_cidr": {"key": "dockerBridgeCidr", "type": "str"}, } def __init__( @@ -758,20 +816,29 @@ class AKSSchemaProperties(msrest.serialization.Model): """ _validation = { - 'system_services': {'readonly': True}, - 'agent_count': {'minimum': 0}, + "system_services": {"readonly": True}, + "agent_count": {"minimum": 0}, } _attribute_map = { - 'cluster_fqdn': {'key': 'clusterFqdn', 'type': 'str'}, - 'system_services': {'key': 'systemServices', 'type': '[SystemService]'}, - 'agent_count': {'key': 'agentCount', 'type': 'int'}, - 'agent_vm_size': {'key': 'agentVmSize', 'type': 'str'}, - 'cluster_purpose': {'key': 'clusterPurpose', 'type': 'str'}, - 'ssl_configuration': {'key': 'sslConfiguration', 'type': 'SslConfiguration'}, - 'aks_networking_configuration': {'key': 'aksNetworkingConfiguration', 'type': 'AksNetworkingConfiguration'}, - 'load_balancer_type': {'key': 'loadBalancerType', 'type': 'str'}, - 'load_balancer_subnet': {'key': 'loadBalancerSubnet', 'type': 'str'}, + "cluster_fqdn": {"key": "clusterFqdn", "type": "str"}, + "system_services": { + "key": "systemServices", + "type": "[SystemService]", + }, + "agent_count": {"key": "agentCount", "type": "int"}, + "agent_vm_size": {"key": "agentVmSize", "type": "str"}, + "cluster_purpose": {"key": "clusterPurpose", "type": "str"}, + "ssl_configuration": { + "key": "sslConfiguration", + "type": "SslConfiguration", + }, + "aks_networking_configuration": { + "key": "aksNetworkingConfiguration", + "type": "AksNetworkingConfiguration", + }, + "load_balancer_type": {"key": "loadBalancerType", "type": "str"}, + "load_balancer_subnet": {"key": "loadBalancerSubnet", "type": "str"}, } def __init__( @@ -782,8 +849,12 @@ def __init__( agent_vm_size: Optional[str] = None, cluster_purpose: Optional[Union[str, "ClusterPurpose"]] = "FastProd", ssl_configuration: Optional["SslConfiguration"] = None, - aks_networking_configuration: Optional["AksNetworkingConfiguration"] = None, - load_balancer_type: Optional[Union[str, "LoadBalancerType"]] = "PublicIp", + aks_networking_configuration: Optional[ + "AksNetworkingConfiguration" + ] = None, + load_balancer_type: Optional[ + Union[str, "LoadBalancerType"] + ] = "PublicIp", load_balancer_subnet: Optional[str] = None, **kwargs ): @@ -835,23 +906,17 @@ class Nodes(msrest.serialization.Model): """ _validation = { - 'nodes_value_type': {'required': True}, + "nodes_value_type": {"required": True}, } _attribute_map = { - 'nodes_value_type': {'key': 'nodesValueType', 'type': 'str'}, + "nodes_value_type": {"key": "nodesValueType", "type": "str"}, } - _subtype_map = { - 'nodes_value_type': {'All': 'AllNodes'} - } + _subtype_map = {"nodes_value_type": {"All": "AllNodes"}} - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Nodes, self).__init__(**kwargs) self.nodes_value_type = None # type: Optional[str] @@ -867,21 +932,17 @@ class AllNodes(Nodes): """ _validation = { - 'nodes_value_type': {'required': True}, + "nodes_value_type": {"required": True}, } _attribute_map = { - 'nodes_value_type': {'key': 'nodesValueType', 'type': 'str'}, + "nodes_value_type": {"key": "nodesValueType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AllNodes, self).__init__(**kwargs) - self.nodes_value_type = 'All' # type: str + self.nodes_value_type = "All" # type: str class AmlComputeSchema(msrest.serialization.Model): @@ -892,14 +953,11 @@ class AmlComputeSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, + "properties": {"key": "properties", "type": "AmlComputeProperties"}, } def __init__( - self, - *, - properties: Optional["AmlComputeProperties"] = None, - **kwargs + self, *, properties: Optional["AmlComputeProperties"] = None, **kwargs ): """ :keyword properties: Properties of AmlCompute. @@ -948,28 +1006,31 @@ class AmlCompute(Compute, AmlComputeSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + "disable_local_auth": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "AmlComputeProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -988,9 +1049,14 @@ def __init__( :keyword resource_id: ARM resource id of the underlying compute. :paramtype resource_id: str """ - super(AmlCompute, self).__init__(description=description, resource_id=resource_id, properties=properties, **kwargs) + super(AmlCompute, self).__init__( + description=description, + resource_id=resource_id, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'AmlCompute' # type: str + self.compute_type = "AmlCompute" # type: str self.compute_location = None self.provisioning_state = None self.description = description @@ -1024,29 +1090,25 @@ class AmlComputeNodeInformation(msrest.serialization.Model): """ _validation = { - 'node_id': {'readonly': True}, - 'private_ip_address': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'port': {'readonly': True}, - 'node_state': {'readonly': True}, - 'run_id': {'readonly': True}, + "node_id": {"readonly": True}, + "private_ip_address": {"readonly": True}, + "public_ip_address": {"readonly": True}, + "port": {"readonly": True}, + "node_state": {"readonly": True}, + "run_id": {"readonly": True}, } _attribute_map = { - 'node_id': {'key': 'nodeId', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'node_state': {'key': 'nodeState', 'type': 'str'}, - 'run_id': {'key': 'runId', 'type': 'str'}, + "node_id": {"key": "nodeId", "type": "str"}, + "private_ip_address": {"key": "privateIpAddress", "type": "str"}, + "public_ip_address": {"key": "publicIpAddress", "type": "str"}, + "port": {"key": "port", "type": "int"}, + "node_state": {"key": "nodeState", "type": "str"}, + "run_id": {"key": "runId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AmlComputeNodeInformation, self).__init__(**kwargs) self.node_id = None self.private_ip_address = None @@ -1068,21 +1130,17 @@ class AmlComputeNodesInformation(msrest.serialization.Model): """ _validation = { - 'nodes': {'readonly': True}, - 'next_link': {'readonly': True}, + "nodes": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'nodes': {'key': 'nodes', 'type': '[AmlComputeNodeInformation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "nodes": {"key": "nodes", "type": "[AmlComputeNodeInformation]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AmlComputeNodesInformation, self).__init__(**kwargs) self.nodes = None self.next_link = None @@ -1153,32 +1211,47 @@ class AmlComputeProperties(msrest.serialization.Model): """ _validation = { - 'allocation_state': {'readonly': True}, - 'allocation_state_transition_time': {'readonly': True}, - 'errors': {'readonly': True}, - 'current_node_count': {'readonly': True}, - 'target_node_count': {'readonly': True}, - 'node_state_counts': {'readonly': True}, - } - - _attribute_map = { - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'vm_priority': {'key': 'vmPriority', 'type': 'str'}, - 'virtual_machine_image': {'key': 'virtualMachineImage', 'type': 'VirtualMachineImage'}, - 'isolated_network': {'key': 'isolatedNetwork', 'type': 'bool'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, - 'user_account_credentials': {'key': 'userAccountCredentials', 'type': 'UserAccountCredentials'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'remote_login_port_public_access': {'key': 'remoteLoginPortPublicAccess', 'type': 'str'}, - 'allocation_state': {'key': 'allocationState', 'type': 'str'}, - 'allocation_state_transition_time': {'key': 'allocationStateTransitionTime', 'type': 'iso-8601'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'current_node_count': {'key': 'currentNodeCount', 'type': 'int'}, - 'target_node_count': {'key': 'targetNodeCount', 'type': 'int'}, - 'node_state_counts': {'key': 'nodeStateCounts', 'type': 'NodeStateCounts'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'property_bag': {'key': 'propertyBag', 'type': 'object'}, + "allocation_state": {"readonly": True}, + "allocation_state_transition_time": {"readonly": True}, + "errors": {"readonly": True}, + "current_node_count": {"readonly": True}, + "target_node_count": {"readonly": True}, + "node_state_counts": {"readonly": True}, + } + + _attribute_map = { + "os_type": {"key": "osType", "type": "str"}, + "vm_size": {"key": "vmSize", "type": "str"}, + "vm_priority": {"key": "vmPriority", "type": "str"}, + "virtual_machine_image": { + "key": "virtualMachineImage", + "type": "VirtualMachineImage", + }, + "isolated_network": {"key": "isolatedNetwork", "type": "bool"}, + "scale_settings": {"key": "scaleSettings", "type": "ScaleSettings"}, + "user_account_credentials": { + "key": "userAccountCredentials", + "type": "UserAccountCredentials", + }, + "subnet": {"key": "subnet", "type": "ResourceId"}, + "remote_login_port_public_access": { + "key": "remoteLoginPortPublicAccess", + "type": "str", + }, + "allocation_state": {"key": "allocationState", "type": "str"}, + "allocation_state_transition_time": { + "key": "allocationStateTransitionTime", + "type": "iso-8601", + }, + "errors": {"key": "errors", "type": "[ErrorResponse]"}, + "current_node_count": {"key": "currentNodeCount", "type": "int"}, + "target_node_count": {"key": "targetNodeCount", "type": "int"}, + "node_state_counts": { + "key": "nodeStateCounts", + "type": "NodeStateCounts", + }, + "enable_node_public_ip": {"key": "enableNodePublicIp", "type": "bool"}, + "property_bag": {"key": "propertyBag", "type": "object"}, } def __init__( @@ -1192,7 +1265,9 @@ def __init__( scale_settings: Optional["ScaleSettings"] = None, user_account_credentials: Optional["UserAccountCredentials"] = None, subnet: Optional["ResourceId"] = None, - remote_login_port_public_access: Optional[Union[str, "RemoteLoginPortPublicAccess"]] = "NotSpecified", + remote_login_port_public_access: Optional[ + Union[str, "RemoteLoginPortPublicAccess"] + ] = "NotSpecified", enable_node_public_ip: Optional[bool] = True, property_bag: Optional[Any] = None, **kwargs @@ -1268,9 +1343,9 @@ class AmlOperation(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'AmlOperationDisplay'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + "name": {"key": "name", "type": "str"}, + "display": {"key": "display", "type": "AmlOperationDisplay"}, + "is_data_action": {"key": "isDataAction", "type": "bool"}, } def __init__( @@ -1309,10 +1384,10 @@ class AmlOperationDisplay(msrest.serialization.Model): """ _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, + "provider": {"key": "provider", "type": "str"}, + "resource": {"key": "resource", "type": "str"}, + "operation": {"key": "operation", "type": "str"}, + "description": {"key": "description", "type": "str"}, } def __init__( @@ -1349,14 +1424,11 @@ class AmlOperationListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlOperation]'}, + "value": {"key": "value", "type": "[AmlOperation]"}, } def __init__( - self, - *, - value: Optional[List["AmlOperation"]] = None, - **kwargs + self, *, value: Optional[List["AmlOperation"]] = None, **kwargs ): """ :keyword value: List of AML operations supported by the AML resource provider. @@ -1381,23 +1453,23 @@ class IdentityConfiguration(msrest.serialization.Model): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, } _subtype_map = { - 'identity_type': {'AMLToken': 'AmlToken', 'Managed': 'ManagedIdentity', 'UserIdentity': 'UserIdentity'} + "identity_type": { + "AMLToken": "AmlToken", + "Managed": "ManagedIdentity", + "UserIdentity": "UserIdentity", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(IdentityConfiguration, self).__init__(**kwargs) self.identity_type = None # type: Optional[str] @@ -1414,21 +1486,17 @@ class AmlToken(IdentityConfiguration): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AmlToken, self).__init__(**kwargs) - self.identity_type = 'AMLToken' # type: str + self.identity_type = "AMLToken" # type: str class AmlUserFeature(msrest.serialization.Model): @@ -1443,9 +1511,9 @@ class AmlUserFeature(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "description": {"key": "description", "type": "str"}, } def __init__( @@ -1481,15 +1549,10 @@ class ArmResourceId(msrest.serialization.Model): """ _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, + "resource_id": {"key": "resourceId", "type": "str"}, } - def __init__( - self, - *, - resource_id: Optional[str] = None, - **kwargs - ): + def __init__(self, *, resource_id: Optional[str] = None, **kwargs): """ :keyword resource_id: Arm ResourceId is in the format "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName}" @@ -1513,9 +1576,9 @@ class ResourceBase(msrest.serialization.Model): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, } def __init__( @@ -1556,11 +1619,11 @@ class AssetBase(ResourceBase): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, } def __init__( @@ -1585,7 +1648,9 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(AssetBase, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + super(AssetBase, self).__init__( + description=description, properties=properties, tags=tags, **kwargs + ) self.is_anonymous = is_anonymous self.is_archived = is_archived @@ -1610,17 +1675,17 @@ class AssetContainer(ResourceBase): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, } def __init__( @@ -1642,7 +1707,9 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(AssetContainer, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + super(AssetContainer, self).__init__( + description=description, properties=properties, tags=tags, **kwargs + ) self.is_archived = is_archived self.latest_version = None self.next_version = None @@ -1661,12 +1728,12 @@ class AssetJobInput(msrest.serialization.Model): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, } def __init__( @@ -1699,8 +1766,8 @@ class AssetJobOutput(msrest.serialization.Model): """ _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, } def __init__( @@ -1736,23 +1803,23 @@ class AssetReferenceBase(msrest.serialization.Model): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, } _subtype_map = { - 'reference_type': {'DataPath': 'DataPathAssetReference', 'Id': 'IdAssetReference', 'OutputPath': 'OutputPathAssetReference'} + "reference_type": { + "DataPath": "DataPathAssetReference", + "Id": "IdAssetReference", + "OutputPath": "OutputPathAssetReference", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AssetReferenceBase, self).__init__(**kwargs) self.reference_type = None # type: Optional[str] @@ -1769,22 +1836,16 @@ class AssignedUser(msrest.serialization.Model): """ _validation = { - 'object_id': {'required': True}, - 'tenant_id': {'required': True}, + "object_id": {"required": True}, + "tenant_id": {"required": True}, } _attribute_map = { - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + "object_id": {"key": "objectId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, } - def __init__( - self, - *, - object_id: str, - tenant_id: str, - **kwargs - ): + def __init__(self, *, object_id: str, tenant_id: str, **kwargs): """ :keyword object_id: Required. User’s AAD Object Id. :paramtype object_id: str @@ -1810,23 +1871,22 @@ class ForecastHorizon(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoForecastHorizon', 'Custom': 'CustomForecastHorizon'} + "mode": { + "Auto": "AutoForecastHorizon", + "Custom": "CustomForecastHorizon", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ForecastHorizon, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -1842,21 +1902,17 @@ class AutoForecastHorizon(ForecastHorizon): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoForecastHorizon, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class AutologgerSettings(msrest.serialization.Model): @@ -1871,11 +1927,11 @@ class AutologgerSettings(msrest.serialization.Model): """ _validation = { - 'mlflow_autologger': {'required': True}, + "mlflow_autologger": {"required": True}, } _attribute_map = { - 'mlflow_autologger': {'key': 'mlflowAutologger', 'type': 'str'}, + "mlflow_autologger": {"key": "mlflowAutologger", "type": "str"}, } def __init__( @@ -1938,27 +1994,34 @@ class JobBaseProperties(ResourceBase): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, + "job_type": {"required": True}, + "status": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, } _subtype_map = { - 'job_type': {'AutoML': 'AutoMLJob', 'Command': 'CommandJob', 'Labeling': 'LabelingJobProperties', 'Pipeline': 'PipelineJob', 'Spark': 'SparkJob', 'Sweep': 'SweepJob'} + "job_type": { + "AutoML": "AutoMLJob", + "Command": "CommandJob", + "Labeling": "LabelingJobProperties", + "Pipeline": "PipelineJob", + "Spark": "SparkJob", + "Sweep": "SweepJob", + } } def __init__( @@ -2002,97 +2065,102 @@ def __init__( For local jobs, a job endpoint will have an endpoint value of FileStreamObject. :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] """ - super(JobBaseProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + super(JobBaseProperties, self).__init__( + description=description, properties=properties, tags=tags, **kwargs + ) self.component_id = component_id self.compute_id = compute_id self.display_name = display_name self.experiment_name = experiment_name self.identity = identity self.is_archived = is_archived - self.job_type = 'JobBaseProperties' # type: str + self.job_type = "JobBaseProperties" # type: str self.services = services self.status = None class AutoMLJob(JobBaseProperties): """AutoMLJob class. -Use this class for executing AutoML tasks like Classification/Regression etc. -See TaskType enum for all the tasks supported. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar environment_id: The ARM resource ID of the Environment specification for the job. - This is optional value to provide, if not provided, AutoML will default this to Production - AutoML curated environment version when running the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - :ivar task_details: Required. [Required] This represents scenario which can be one of - Tables/NLP/Image. - :vartype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical + Use this class for executing AutoML tasks like Classification/Regression etc. + See TaskType enum for all the tasks supported. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar description: The asset description text. + :vartype description: str + :ivar properties: The asset property dictionary. + :vartype properties: dict[str, str] + :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + :ivar component_id: ARM resource ID of the component resource. + :vartype component_id: str + :ivar compute_id: ARM resource ID of the compute resource. + :vartype compute_id: str + :ivar display_name: Display name of job. + :vartype display_name: str + :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is + placed in the "Default" experiment. + :vartype experiment_name: str + :ivar identity: Identity configuration. If set, this should be one of AmlToken, + ManagedIdentity, UserIdentity or null. + Defaults to AmlToken if null. + :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration + :ivar is_archived: Is the asset archived?. + :vartype is_archived: bool + :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. + Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark". + :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType + :ivar services: List of JobEndpoints. + For local jobs, a job endpoint will have an endpoint value of FileStreamObject. + :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] + :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", + "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", + "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". + :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus + :ivar environment_id: The ARM resource ID of the Environment specification for the job. + This is optional value to provide, if not provided, AutoML will default this to Production + AutoML curated environment version when running the job. + :vartype environment_id: str + :ivar environment_variables: Environment variables included in the job. + :vartype environment_variables: dict[str, str] + :ivar outputs: Mapping of output data bindings used in the job. + :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] + :ivar resources: Compute Resource configuration for the job. + :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration + :ivar task_details: Required. [Required] This represents scenario which can be one of + Tables/NLP/Image. + :vartype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'task_details': {'required': True}, + "job_type": {"required": True}, + "status": {"readonly": True}, + "task_details": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - 'task_details': {'key': 'taskDetails', 'type': 'AutoMLVertical'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "resources": {"key": "resources", "type": "JobResourceConfiguration"}, + "task_details": {"key": "taskDetails", "type": "AutoMLVertical"}, } def __init__( @@ -2154,8 +2222,20 @@ def __init__( Tables/NLP/Image. :paramtype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical """ - super(AutoMLJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, services=services, **kwargs) - self.job_type = 'AutoML' # type: str + super(AutoMLJob, self).__init__( + description=description, + properties=properties, + tags=tags, + component_id=component_id, + compute_id=compute_id, + display_name=display_name, + experiment_name=experiment_name, + identity=identity, + is_archived=is_archived, + services=services, + **kwargs + ) + self.job_type = "AutoML" # type: str self.environment_id = environment_id self.environment_variables = environment_variables self.outputs = outputs @@ -2165,42 +2245,53 @@ def __init__( class AutoMLVertical(msrest.serialization.Model): """AutoML vertical class. -Base class for AutoML verticals - TableVertical/ImageVertical/NLPVertical. + Base class for AutoML verticals - TableVertical/ImageVertical/NLPVertical. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Classification, Forecasting, ImageClassification, ImageClassificationMultilabel, ImageInstanceSegmentation, ImageObjectDetection, Regression, TextClassification, TextClassificationMultilabel, TextNer. + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Classification, Forecasting, ImageClassification, ImageClassificationMultilabel, ImageInstanceSegmentation, ImageObjectDetection, Regression, TextClassification, TextClassificationMultilabel, TextNer. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, + "task_type": {"required": True}, + "training_data": {"required": True}, } _attribute_map = { - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, } _subtype_map = { - 'task_type': {'Classification': 'Classification', 'Forecasting': 'Forecasting', 'ImageClassification': 'ImageClassification', 'ImageClassificationMultilabel': 'ImageClassificationMultilabel', 'ImageInstanceSegmentation': 'ImageInstanceSegmentation', 'ImageObjectDetection': 'ImageObjectDetection', 'Regression': 'Regression', 'TextClassification': 'TextClassification', 'TextClassificationMultilabel': 'TextClassificationMultilabel', 'TextNER': 'TextNer'} + "task_type": { + "Classification": "Classification", + "Forecasting": "Forecasting", + "ImageClassification": "ImageClassification", + "ImageClassificationMultilabel": "ImageClassificationMultilabel", + "ImageInstanceSegmentation": "ImageInstanceSegmentation", + "ImageObjectDetection": "ImageObjectDetection", + "Regression": "Regression", + "TextClassification": "TextClassification", + "TextClassificationMultilabel": "TextClassificationMultilabel", + "TextNER": "TextNer", + } } def __init__( @@ -2242,23 +2333,22 @@ class NCrossValidations(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoNCrossValidations', 'Custom': 'CustomNCrossValidations'} + "mode": { + "Auto": "AutoNCrossValidations", + "Custom": "CustomNCrossValidations", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NCrossValidations, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -2274,21 +2364,17 @@ class AutoNCrossValidations(NCrossValidations): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoNCrossValidations, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class AutoPauseProperties(msrest.serialization.Model): @@ -2301,8 +2387,8 @@ class AutoPauseProperties(msrest.serialization.Model): """ _attribute_map = { - 'delay_in_minutes': {'key': 'delayInMinutes', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, + "delay_in_minutes": {"key": "delayInMinutes", "type": "int"}, + "enabled": {"key": "enabled", "type": "bool"}, } def __init__( @@ -2335,9 +2421,9 @@ class AutoScaleProperties(msrest.serialization.Model): """ _attribute_map = { - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, + "min_node_count": {"key": "minNodeCount", "type": "int"}, + "enabled": {"key": "enabled", "type": "bool"}, + "max_node_count": {"key": "maxNodeCount", "type": "int"}, } def __init__( @@ -2376,23 +2462,19 @@ class Seasonality(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoSeasonality', 'Custom': 'CustomSeasonality'} + "mode": {"Auto": "AutoSeasonality", "Custom": "CustomSeasonality"} } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Seasonality, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -2408,21 +2490,17 @@ class AutoSeasonality(Seasonality): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoSeasonality, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class TargetLags(msrest.serialization.Model): @@ -2439,23 +2517,19 @@ class TargetLags(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoTargetLags', 'Custom': 'CustomTargetLags'} + "mode": {"Auto": "AutoTargetLags", "Custom": "CustomTargetLags"} } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(TargetLags, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -2471,21 +2545,17 @@ class AutoTargetLags(TargetLags): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoTargetLags, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class TargetRollingWindowSize(msrest.serialization.Model): @@ -2502,23 +2572,22 @@ class TargetRollingWindowSize(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoTargetRollingWindowSize', 'Custom': 'CustomTargetRollingWindowSize'} + "mode": { + "Auto": "AutoTargetRollingWindowSize", + "Custom": "CustomTargetRollingWindowSize", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(TargetRollingWindowSize, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -2534,21 +2603,17 @@ class AutoTargetRollingWindowSize(TargetRollingWindowSize): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class AzureDatastore(msrest.serialization.Model): @@ -2561,8 +2626,8 @@ class AzureDatastore(msrest.serialization.Model): """ _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + "resource_group": {"key": "resourceGroup", "type": "str"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, } def __init__( @@ -2611,22 +2676,28 @@ class DatastoreProperties(ResourceBase): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, } _subtype_map = { - 'datastore_type': {'AzureBlob': 'AzureBlobDatastore', 'AzureDataLakeGen1': 'AzureDataLakeGen1Datastore', 'AzureDataLakeGen2': 'AzureDataLakeGen2Datastore', 'AzureFile': 'AzureFileDatastore', 'Hdfs': 'HdfsDatastore'} + "datastore_type": { + "AzureBlob": "AzureBlobDatastore", + "AzureDataLakeGen1": "AzureDataLakeGen1Datastore", + "AzureDataLakeGen2": "AzureDataLakeGen2Datastore", + "AzureFile": "AzureFileDatastore", + "Hdfs": "HdfsDatastore", + } } def __init__( @@ -2648,9 +2719,11 @@ def __init__( :keyword credentials: Required. [Required] Account credentials. :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials """ - super(DatastoreProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + super(DatastoreProperties, self).__init__( + description=description, properties=properties, tags=tags, **kwargs + ) self.credentials = credentials - self.datastore_type = 'DatastoreProperties' # type: str + self.datastore_type = "DatastoreProperties" # type: str self.is_default = None @@ -2696,25 +2769,28 @@ class AzureBlobDatastore(DatastoreProperties, AzureDatastore): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, } _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, + "resource_group": {"key": "resourceGroup", "type": "str"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "account_name": {"key": "accountName", "type": "str"}, + "container_name": {"key": "containerName", "type": "str"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } def __init__( @@ -2730,7 +2806,9 @@ def __init__( container_name: Optional[str] = None, endpoint: Optional[str] = None, protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, + service_data_access_auth_identity: Optional[ + Union[str, "ServiceDataAccessAuthIdentity"] + ] = None, **kwargs ): """ @@ -2760,15 +2838,25 @@ def __init__( :paramtype service_data_access_auth_identity: str or ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ - super(AzureBlobDatastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, resource_group=resource_group, subscription_id=subscription_id, **kwargs) + super(AzureBlobDatastore, self).__init__( + description=description, + properties=properties, + tags=tags, + credentials=credentials, + resource_group=resource_group, + subscription_id=subscription_id, + **kwargs + ) self.resource_group = resource_group self.subscription_id = subscription_id - self.datastore_type = 'AzureBlob' # type: str + self.datastore_type = "AzureBlob" # type: str self.account_name = account_name self.container_name = container_name self.endpoint = endpoint self.protocol = protocol - self.service_data_access_auth_identity = service_data_access_auth_identity + self.service_data_access_auth_identity = ( + service_data_access_auth_identity + ) self.description = description self.properties = properties self.tags = tags @@ -2812,23 +2900,26 @@ class AzureDataLakeGen1Datastore(DatastoreProperties, AzureDatastore): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'store_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "store_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - 'store_name': {'key': 'storeName', 'type': 'str'}, + "resource_group": {"key": "resourceGroup", "type": "str"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, + "store_name": {"key": "storeName", "type": "str"}, } def __init__( @@ -2841,7 +2932,9 @@ def __init__( description: Optional[str] = None, properties: Optional[Dict[str, str]] = None, tags: Optional[Dict[str, str]] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, + service_data_access_auth_identity: Optional[ + Union[str, "ServiceDataAccessAuthIdentity"] + ] = None, **kwargs ): """ @@ -2865,11 +2958,21 @@ def __init__( :keyword store_name: Required. [Required] Azure Data Lake store name. :paramtype store_name: str """ - super(AzureDataLakeGen1Datastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, resource_group=resource_group, subscription_id=subscription_id, **kwargs) + super(AzureDataLakeGen1Datastore, self).__init__( + description=description, + properties=properties, + tags=tags, + credentials=credentials, + resource_group=resource_group, + subscription_id=subscription_id, + **kwargs + ) self.resource_group = resource_group self.subscription_id = subscription_id - self.datastore_type = 'AzureDataLakeGen1' # type: str - self.service_data_access_auth_identity = service_data_access_auth_identity + self.datastore_type = "AzureDataLakeGen1" # type: str + self.service_data_access_auth_identity = ( + service_data_access_auth_identity + ) self.store_name = store_name self.description = description self.properties = properties @@ -2920,27 +3023,30 @@ class AzureDataLakeGen2Datastore(DatastoreProperties, AzureDatastore): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'filesystem': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "account_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "filesystem": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'filesystem': {'key': 'filesystem', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, + "resource_group": {"key": "resourceGroup", "type": "str"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "account_name": {"key": "accountName", "type": "str"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "filesystem": {"key": "filesystem", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } def __init__( @@ -2956,7 +3062,9 @@ def __init__( tags: Optional[Dict[str, str]] = None, endpoint: Optional[str] = None, protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, + service_data_access_auth_identity: Optional[ + Union[str, "ServiceDataAccessAuthIdentity"] + ] = None, **kwargs ): """ @@ -2986,15 +3094,25 @@ def __init__( :paramtype service_data_access_auth_identity: str or ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ - super(AzureDataLakeGen2Datastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, resource_group=resource_group, subscription_id=subscription_id, **kwargs) + super(AzureDataLakeGen2Datastore, self).__init__( + description=description, + properties=properties, + tags=tags, + credentials=credentials, + resource_group=resource_group, + subscription_id=subscription_id, + **kwargs + ) self.resource_group = resource_group self.subscription_id = subscription_id - self.datastore_type = 'AzureDataLakeGen2' # type: str + self.datastore_type = "AzureDataLakeGen2" # type: str self.account_name = account_name self.endpoint = endpoint self.filesystem = filesystem self.protocol = protocol - self.service_data_access_auth_identity = service_data_access_auth_identity + self.service_data_access_auth_identity = ( + service_data_access_auth_identity + ) self.description = description self.properties = properties self.tags = tags @@ -3045,27 +3163,30 @@ class AzureFileDatastore(DatastoreProperties, AzureDatastore): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'file_share_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "account_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "file_share_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'file_share_name': {'key': 'fileShareName', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, + "resource_group": {"key": "resourceGroup", "type": "str"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "account_name": {"key": "accountName", "type": "str"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "file_share_name": {"key": "fileShareName", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } def __init__( @@ -3081,7 +3202,9 @@ def __init__( tags: Optional[Dict[str, str]] = None, endpoint: Optional[str] = None, protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, + service_data_access_auth_identity: Optional[ + Union[str, "ServiceDataAccessAuthIdentity"] + ] = None, **kwargs ): """ @@ -3112,15 +3235,25 @@ def __init__( :paramtype service_data_access_auth_identity: str or ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ - super(AzureFileDatastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, resource_group=resource_group, subscription_id=subscription_id, **kwargs) + super(AzureFileDatastore, self).__init__( + description=description, + properties=properties, + tags=tags, + credentials=credentials, + resource_group=resource_group, + subscription_id=subscription_id, + **kwargs + ) self.resource_group = resource_group self.subscription_id = subscription_id - self.datastore_type = 'AzureFile' # type: str + self.datastore_type = "AzureFile" # type: str self.account_name = account_name self.endpoint = endpoint self.file_share_name = file_share_name self.protocol = protocol - self.service_data_access_auth_identity = service_data_access_auth_identity + self.service_data_access_auth_identity = ( + service_data_access_auth_identity + ) self.description = description self.properties = properties self.tags = tags @@ -3147,17 +3280,21 @@ class EarlyTerminationPolicy(msrest.serialization.Model): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, } _subtype_map = { - 'policy_type': {'Bandit': 'BanditPolicy', 'MedianStopping': 'MedianStoppingPolicy', 'TruncationSelection': 'TruncationSelectionPolicy'} + "policy_type": { + "Bandit": "BanditPolicy", + "MedianStopping": "MedianStoppingPolicy", + "TruncationSelection": "TruncationSelectionPolicy", + } } def __init__( @@ -3199,15 +3336,15 @@ class BanditPolicy(EarlyTerminationPolicy): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'slack_amount': {'key': 'slackAmount', 'type': 'float'}, - 'slack_factor': {'key': 'slackFactor', 'type': 'float'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, + "slack_amount": {"key": "slackAmount", "type": "float"}, + "slack_factor": {"key": "slackFactor", "type": "float"}, } def __init__( @@ -3229,8 +3366,12 @@ def __init__( :keyword slack_factor: Ratio of the allowed distance from the best performing run. :paramtype slack_factor: float """ - super(BanditPolicy, self).__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs) - self.policy_type = 'Bandit' # type: str + super(BanditPolicy, self).__init__( + delay_evaluation=delay_evaluation, + evaluation_interval=evaluation_interval, + **kwargs + ) + self.policy_type = "Bandit" # type: str self.slack_amount = slack_amount self.slack_factor = slack_factor @@ -3254,25 +3395,21 @@ class Resource(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -3305,28 +3442,24 @@ class TrackedResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, } def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - **kwargs + self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs ): """ :keyword tags: A set of tags. Resource tags. @@ -3373,25 +3506,28 @@ class BatchDeployment(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchDeploymentProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": { + "key": "properties", + "type": "BatchDeploymentProperties", + }, + "sku": {"key": "sku", "type": "Sku"}, } def __init__( @@ -3420,7 +3556,9 @@ def __init__( :keyword sku: Sku details required for ARM contract for Autoscaling. :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ - super(BatchDeployment, self).__init__(tags=tags, location=location, **kwargs) + super(BatchDeployment, self).__init__( + tags=tags, location=location, **kwargs + ) self.identity = identity self.kind = kind self.properties = properties @@ -3444,11 +3582,17 @@ class EndpointDeploymentPropertiesBase(msrest.serialization.Model): """ _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, } def __init__( @@ -3536,26 +3680,41 @@ class BatchDeploymentProperties(EndpointDeploymentPropertiesBase): """ _validation = { - 'provisioning_state': {'readonly': True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'error_threshold': {'key': 'errorThreshold', 'type': 'int'}, - 'logging_level': {'key': 'loggingLevel', 'type': 'str'}, - 'max_concurrency_per_instance': {'key': 'maxConcurrencyPerInstance', 'type': 'int'}, - 'mini_batch_size': {'key': 'miniBatchSize', 'type': 'long'}, - 'model': {'key': 'model', 'type': 'AssetReferenceBase'}, - 'output_action': {'key': 'outputAction', 'type': 'str'}, - 'output_file_name': {'key': 'outputFileName', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'resources': {'key': 'resources', 'type': 'DeploymentResourceConfiguration'}, - 'retry_settings': {'key': 'retrySettings', 'type': 'BatchRetrySettings'}, + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "compute": {"key": "compute", "type": "str"}, + "error_threshold": {"key": "errorThreshold", "type": "int"}, + "logging_level": {"key": "loggingLevel", "type": "str"}, + "max_concurrency_per_instance": { + "key": "maxConcurrencyPerInstance", + "type": "int", + }, + "mini_batch_size": {"key": "miniBatchSize", "type": "long"}, + "model": {"key": "model", "type": "AssetReferenceBase"}, + "output_action": {"key": "outputAction", "type": "str"}, + "output_file_name": {"key": "outputFileName", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "resources": { + "key": "resources", + "type": "DeploymentResourceConfiguration", + }, + "retry_settings": { + "key": "retrySettings", + "type": "BatchRetrySettings", + }, } def __init__( @@ -3623,7 +3782,14 @@ def __init__( If not provided, will default to the defaults defined in BatchRetrySettings. :paramtype retry_settings: ~azure.mgmt.machinelearningservices.models.BatchRetrySettings """ - super(BatchDeploymentProperties, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, **kwargs) + super(BatchDeploymentProperties, self).__init__( + code_configuration=code_configuration, + description=description, + environment_id=environment_id, + environment_variables=environment_variables, + properties=properties, + **kwargs + ) self.compute = compute self.error_threshold = error_threshold self.logging_level = logging_level @@ -3637,7 +3803,9 @@ def __init__( self.retry_settings = retry_settings -class BatchDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class BatchDeploymentTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of BatchDeployment entities. :ivar next_link: The link to the next page of BatchDeployment objects. If null, there are no @@ -3648,8 +3816,8 @@ class BatchDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Mode """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchDeployment]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[BatchDeployment]"}, } def __init__( @@ -3666,7 +3834,9 @@ def __init__( :keyword value: An array of objects of type BatchDeployment. :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchDeployment] """ - super(BatchDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) + super(BatchDeploymentTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -3705,25 +3875,25 @@ class BatchEndpoint(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": {"key": "properties", "type": "BatchEndpointProperties"}, + "sku": {"key": "sku", "type": "Sku"}, } def __init__( @@ -3752,7 +3922,9 @@ def __init__( :keyword sku: Sku details required for ARM contract for Autoscaling. :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ - super(BatchEndpoint, self).__init__(tags=tags, location=location, **kwargs) + super(BatchEndpoint, self).__init__( + tags=tags, location=location, **kwargs + ) self.identity = identity self.kind = kind self.properties = properties @@ -3768,15 +3940,10 @@ class BatchEndpointDefaults(msrest.serialization.Model): """ _attribute_map = { - 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, + "deployment_name": {"key": "deploymentName", "type": "str"}, } - def __init__( - self, - *, - deployment_name: Optional[str] = None, - **kwargs - ): + def __init__(self, *, deployment_name: Optional[str] = None, **kwargs): """ :keyword deployment_name: Name of the deployment that will be default for the endpoint. This deployment will end up getting 100% traffic when the endpoint scoring URL is invoked. @@ -3812,18 +3979,18 @@ class EndpointPropertiesBase(msrest.serialization.Model): """ _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, + "auth_mode": {"required": True}, + "scoring_uri": {"readonly": True}, + "swagger_uri": {"readonly": True}, } _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, + "auth_mode": {"key": "authMode", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "keys": {"key": "keys", "type": "EndpointAuthKeys"}, + "properties": {"key": "properties", "type": "{str}"}, + "scoring_uri": {"key": "scoringUri", "type": "str"}, + "swagger_uri": {"key": "swaggerUri", "type": "str"}, } def __init__( @@ -3890,21 +4057,21 @@ class BatchEndpointProperties(EndpointPropertiesBase): """ _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "auth_mode": {"required": True}, + "scoring_uri": {"readonly": True}, + "swagger_uri": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'defaults': {'key': 'defaults', 'type': 'BatchEndpointDefaults'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "auth_mode": {"key": "authMode", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "keys": {"key": "keys", "type": "EndpointAuthKeys"}, + "properties": {"key": "properties", "type": "{str}"}, + "scoring_uri": {"key": "scoringUri", "type": "str"}, + "swagger_uri": {"key": "swaggerUri", "type": "str"}, + "defaults": {"key": "defaults", "type": "BatchEndpointDefaults"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } def __init__( @@ -3933,12 +4100,20 @@ def __init__( :keyword defaults: Default values for Batch Endpoint. :paramtype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults """ - super(BatchEndpointProperties, self).__init__(auth_mode=auth_mode, description=description, keys=keys, properties=properties, **kwargs) + super(BatchEndpointProperties, self).__init__( + auth_mode=auth_mode, + description=description, + keys=keys, + properties=properties, + **kwargs + ) self.defaults = defaults self.provisioning_state = None -class BatchEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class BatchEndpointTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of BatchEndpoint entities. :ivar next_link: The link to the next page of BatchEndpoint objects. If null, there are no @@ -3949,8 +4124,8 @@ class BatchEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model) """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchEndpoint]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[BatchEndpoint]"}, } def __init__( @@ -3967,7 +4142,9 @@ def __init__( :keyword value: An array of objects of type BatchEndpoint. :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchEndpoint] """ - super(BatchEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) + super(BatchEndpointTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -3982,8 +4159,8 @@ class BatchRetrySettings(msrest.serialization.Model): """ _attribute_map = { - 'max_retries': {'key': 'maxRetries', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "max_retries": {"key": "maxRetries", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } def __init__( @@ -4006,38 +4183,41 @@ def __init__( class SamplingAlgorithm(msrest.serialization.Model): """The Sampling Algorithm used to generate hyperparameter values, along with properties to -configure the algorithm. + configure the algorithm. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BayesianSamplingAlgorithm, GridSamplingAlgorithm, RandomSamplingAlgorithm. + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: BayesianSamplingAlgorithm, GridSamplingAlgorithm, RandomSamplingAlgorithm. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType + :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating + hyperparameter values, along with configuration properties.Constant filled by server. Possible + values include: "Grid", "Random", "Bayesian". + :vartype sampling_algorithm_type: str or + ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } _subtype_map = { - 'sampling_algorithm_type': {'Bayesian': 'BayesianSamplingAlgorithm', 'Grid': 'GridSamplingAlgorithm', 'Random': 'RandomSamplingAlgorithm'} + "sampling_algorithm_type": { + "Bayesian": "BayesianSamplingAlgorithm", + "Grid": "GridSamplingAlgorithm", + "Random": "RandomSamplingAlgorithm", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(SamplingAlgorithm, self).__init__(**kwargs) self.sampling_algorithm_type = None # type: Optional[str] @@ -4055,21 +4235,20 @@ class BayesianSamplingAlgorithm(SamplingAlgorithm): """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(BayesianSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Bayesian' # type: str + self.sampling_algorithm_type = "Bayesian" # type: str class BindOptions(msrest.serialization.Model): @@ -4084,9 +4263,9 @@ class BindOptions(msrest.serialization.Model): """ _attribute_map = { - 'propagation': {'key': 'propagation', 'type': 'str'}, - 'create_host_path': {'key': 'createHostPath', 'type': 'bool'}, - 'selinux': {'key': 'selinux', 'type': 'str'}, + "propagation": {"key": "propagation", "type": "str"}, + "create_host_path": {"key": "createHostPath", "type": "bool"}, + "selinux": {"key": "selinux", "type": "str"}, } def __init__( @@ -4135,12 +4314,12 @@ class BuildContext(msrest.serialization.Model): """ _validation = { - 'context_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "context_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'context_uri': {'key': 'contextUri', 'type': 'str'}, - 'dockerfile_path': {'key': 'dockerfilePath', 'type': 'str'}, + "context_uri": {"key": "contextUri", "type": "str"}, + "dockerfile_path": {"key": "dockerfilePath", "type": "str"}, } def __init__( @@ -4197,21 +4376,21 @@ class CertificateDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, - 'thumbprint': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials_type": {"required": True}, + "client_id": {"required": True}, + "secrets": {"required": True}, + "tenant_id": {"required": True}, + "thumbprint": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'CertificateDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "authority_url": {"key": "authorityUrl", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + "resource_url": {"key": "resourceUrl", "type": "str"}, + "secrets": {"key": "secrets", "type": "CertificateDatastoreSecrets"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "thumbprint": {"key": "thumbprint", "type": "str"}, } def __init__( @@ -4242,7 +4421,7 @@ def __init__( :paramtype thumbprint: str """ super(CertificateDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Certificate' # type: str + self.credentials_type = "Certificate" # type: str self.authority_url = authority_url self.client_id = client_id self.resource_url = resource_url @@ -4265,26 +4444,21 @@ class CertificateDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'certificate': {'key': 'certificate', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "certificate": {"key": "certificate", "type": "str"}, } - def __init__( - self, - *, - certificate: Optional[str] = None, - **kwargs - ): + def __init__(self, *, certificate: Optional[str] = None, **kwargs): """ :keyword certificate: Service principal certificate. :paramtype certificate: str """ super(CertificateDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Certificate' # type: str + self.secrets_type = "Certificate" # type: str self.certificate = certificate @@ -4329,25 +4503,51 @@ class TableVertical(msrest.serialization.Model): """ _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "TableFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "search_space": { + "key": "searchSpace", + "type": "[TableParameterSubspace]", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "TableSweepSettings", + }, + "test_data": {"key": "testData", "type": "MLTableJobInput"}, + "test_data_size": {"key": "testDataSize", "type": "float"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "weight_column_name": {"key": "weightColumnName", "type": "str"}, } def __init__( self, *, cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "TableVerticalFeaturizationSettings" + ] = None, fixed_parameters: Optional["TableFixedParameters"] = None, limit_settings: Optional["TableVerticalLimitSettings"] = None, n_cross_validations: Optional["NCrossValidations"] = None, @@ -4480,30 +4680,57 @@ class Classification(AutoMLVertical, TableVertical): """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'positive_label': {'key': 'positiveLabel', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'ClassificationTrainingSettings'}, + "task_type": {"required": True}, + "training_data": {"required": True}, + } + + _attribute_map = { + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "TableFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "search_space": { + "key": "searchSpace", + "type": "[TableParameterSubspace]", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "TableSweepSettings", + }, + "test_data": {"key": "testData", "type": "MLTableJobInput"}, + "test_data_size": {"key": "testDataSize", "type": "float"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "weight_column_name": {"key": "weightColumnName", "type": "str"}, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "positive_label": {"key": "positiveLabel", "type": "str"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, + "training_settings": { + "key": "trainingSettings", + "type": "ClassificationTrainingSettings", + }, } def __init__( @@ -4511,7 +4738,9 @@ def __init__( *, training_data: "MLTableJobInput", cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "TableVerticalFeaturizationSettings" + ] = None, fixed_parameters: Optional["TableFixedParameters"] = None, limit_settings: Optional["TableVerticalLimitSettings"] = None, n_cross_validations: Optional["NCrossValidations"] = None, @@ -4525,7 +4754,9 @@ def __init__( log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, positive_label: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "ClassificationPrimaryMetrics"] + ] = None, training_settings: Optional["ClassificationTrainingSettings"] = None, **kwargs ): @@ -4586,7 +4817,24 @@ def __init__( :paramtype training_settings: ~azure.mgmt.machinelearningservices.models.ClassificationTrainingSettings """ - super(Classification, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, cv_split_column_names=cv_split_column_names, featurization_settings=featurization_settings, fixed_parameters=fixed_parameters, limit_settings=limit_settings, n_cross_validations=n_cross_validations, search_space=search_space, sweep_settings=sweep_settings, test_data=test_data, test_data_size=test_data_size, validation_data=validation_data, validation_data_size=validation_data_size, weight_column_name=weight_column_name, **kwargs) + super(Classification, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + cv_split_column_names=cv_split_column_names, + featurization_settings=featurization_settings, + fixed_parameters=fixed_parameters, + limit_settings=limit_settings, + n_cross_validations=n_cross_validations, + search_space=search_space, + sweep_settings=sweep_settings, + test_data=test_data, + test_data_size=test_data_size, + validation_data=validation_data, + validation_data_size=validation_data_size, + weight_column_name=weight_column_name, + **kwargs + ) self.cv_split_column_names = cv_split_column_names self.featurization_settings = featurization_settings self.fixed_parameters = fixed_parameters @@ -4599,7 +4847,7 @@ def __init__( self.validation_data = validation_data self.validation_data_size = validation_data_size self.weight_column_name = weight_column_name - self.task_type = 'Classification' # type: str + self.task_type = "Classification" # type: str self.positive_label = positive_label self.primary_metric = primary_metric self.training_settings = training_settings @@ -4631,13 +4879,28 @@ class TrainingSettings(msrest.serialization.Model): """ _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, + "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, + "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, } def __init__( @@ -4710,15 +4973,36 @@ class ClassificationTrainingSettings(TrainingSettings): """ _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, + "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, + "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, + "allowed_training_algorithms": { + "key": "allowedTrainingAlgorithms", + "type": "[str]", + }, + "blocked_training_algorithms": { + "key": "blockedTrainingAlgorithms", + "type": "[str]", + }, } def __init__( @@ -4731,8 +5015,12 @@ def __init__( enable_vote_ensemble: Optional[bool] = True, ensemble_model_download_timeout: Optional[datetime.timedelta] = "PT5M", stack_ensemble_settings: Optional["StackEnsembleSettings"] = None, - allowed_training_algorithms: Optional[List[Union[str, "ClassificationModels"]]] = None, - blocked_training_algorithms: Optional[List[Union[str, "ClassificationModels"]]] = None, + allowed_training_algorithms: Optional[ + List[Union[str, "ClassificationModels"]] + ] = None, + blocked_training_algorithms: Optional[ + List[Union[str, "ClassificationModels"]] + ] = None, **kwargs ): """ @@ -4760,7 +5048,16 @@ def __init__( :paramtype blocked_training_algorithms: list[str or ~azure.mgmt.machinelearningservices.models.ClassificationModels] """ - super(ClassificationTrainingSettings, self).__init__(enable_dnn_training=enable_dnn_training, enable_model_explainability=enable_model_explainability, enable_onnx_compatible_models=enable_onnx_compatible_models, enable_stack_ensemble=enable_stack_ensemble, enable_vote_ensemble=enable_vote_ensemble, ensemble_model_download_timeout=ensemble_model_download_timeout, stack_ensemble_settings=stack_ensemble_settings, **kwargs) + super(ClassificationTrainingSettings, self).__init__( + enable_dnn_training=enable_dnn_training, + enable_model_explainability=enable_model_explainability, + enable_onnx_compatible_models=enable_onnx_compatible_models, + enable_stack_ensemble=enable_stack_ensemble, + enable_vote_ensemble=enable_vote_ensemble, + ensemble_model_download_timeout=ensemble_model_download_timeout, + stack_ensemble_settings=stack_ensemble_settings, + **kwargs + ) self.allowed_training_algorithms = allowed_training_algorithms self.blocked_training_algorithms = blocked_training_algorithms @@ -4773,7 +5070,10 @@ class ClusterUpdateParameters(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties.properties', 'type': 'ScaleSettingsInformation'}, + "properties": { + "key": "properties.properties", + "type": "ScaleSettingsInformation", + }, } def __init__( @@ -4814,31 +5114,31 @@ class ExportSummary(msrest.serialization.Model): """ _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, + "end_date_time": {"readonly": True}, + "exported_row_count": {"readonly": True}, + "format": {"required": True}, + "labeling_job_id": {"readonly": True}, + "start_date_time": {"readonly": True}, } _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, + "end_date_time": {"key": "endDateTime", "type": "iso-8601"}, + "exported_row_count": {"key": "exportedRowCount", "type": "long"}, + "format": {"key": "format", "type": "str"}, + "labeling_job_id": {"key": "labelingJobId", "type": "str"}, + "start_date_time": {"key": "startDateTime", "type": "iso-8601"}, } _subtype_map = { - 'format': {'CSV': 'CsvExportSummary', 'Coco': 'CocoExportSummary', 'Dataset': 'DatasetExportSummary'} + "format": { + "CSV": "CsvExportSummary", + "Coco": "CocoExportSummary", + "Dataset": "DatasetExportSummary", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ExportSummary, self).__init__(**kwargs) self.end_date_time = None self.exported_row_count = None @@ -4872,33 +5172,29 @@ class CocoExportSummary(ExportSummary): """ _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'container_name': {'readonly': True}, - 'snapshot_path': {'readonly': True}, + "end_date_time": {"readonly": True}, + "exported_row_count": {"readonly": True}, + "format": {"required": True}, + "labeling_job_id": {"readonly": True}, + "start_date_time": {"readonly": True}, + "container_name": {"readonly": True}, + "snapshot_path": {"readonly": True}, } _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'snapshot_path': {'key': 'snapshotPath', 'type': 'str'}, + "end_date_time": {"key": "endDateTime", "type": "iso-8601"}, + "exported_row_count": {"key": "exportedRowCount", "type": "long"}, + "format": {"key": "format", "type": "str"}, + "labeling_job_id": {"key": "labelingJobId", "type": "str"}, + "start_date_time": {"key": "startDateTime", "type": "iso-8601"}, + "container_name": {"key": "containerName", "type": "str"}, + "snapshot_path": {"key": "snapshotPath", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(CocoExportSummary, self).__init__(**kwargs) - self.format = 'Coco' # type: str + self.format = "Coco" # type: str self.container_name = None self.snapshot_path = None @@ -4915,20 +5211,20 @@ class CodeConfiguration(msrest.serialization.Model): """ _validation = { - 'scoring_script': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "scoring_script": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'scoring_script': {'key': 'scoringScript', 'type': 'str'}, + "code_id": {"key": "codeId", "type": "str"}, + "scoring_script": {"key": "scoringScript", "type": "str"}, } def __init__( - self, - *, - scoring_script: str, - code_id: Optional[str] = None, - **kwargs + self, *, scoring_script: str, code_id: Optional[str] = None, **kwargs ): """ :keyword code_id: ARM resource ID of the code asset. @@ -4964,27 +5260,22 @@ class CodeContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "CodeContainerProperties"}, } - def __init__( - self, - *, - properties: "CodeContainerProperties", - **kwargs - ): + def __init__(self, *, properties: "CodeContainerProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeContainerProperties @@ -5017,19 +5308,19 @@ class CodeContainerProperties(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } def __init__( @@ -5051,7 +5342,13 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(CodeContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) + super(CodeContainerProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs + ) self.provisioning_state = None @@ -5066,8 +5363,8 @@ class CodeContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[CodeContainer]"}, } def __init__( @@ -5112,27 +5409,22 @@ class CodeVersion(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeVersionProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "CodeVersionProperties"}, } - def __init__( - self, - *, - properties: "CodeVersionProperties", - **kwargs - ): + def __init__(self, *, properties: "CodeVersionProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeVersionProperties @@ -5165,17 +5457,17 @@ class CodeVersionProperties(AssetBase): """ _validation = { - 'provisioning_state': {'readonly': True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'code_uri': {'key': 'codeUri', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "code_uri": {"key": "codeUri", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } def __init__( @@ -5203,7 +5495,14 @@ def __init__( :keyword code_uri: Uri where code is located. :paramtype code_uri: str """ - super(CodeVersionProperties, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) + super(CodeVersionProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + **kwargs + ) self.code_uri = code_uri self.provisioning_state = None @@ -5219,8 +5518,8 @@ class CodeVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeVersion]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[CodeVersion]"}, } def __init__( @@ -5253,8 +5552,8 @@ class ColumnTransformer(msrest.serialization.Model): """ _attribute_map = { - 'fields': {'key': 'fields', 'type': '[str]'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, + "fields": {"key": "fields", "type": "[str]"}, + "parameters": {"key": "parameters", "type": "object"}, } def __init__( @@ -5343,37 +5642,50 @@ class CommandJob(JobBaseProperties): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'parameters': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'autologger_settings': {'key': 'autologgerSettings', 'type': 'AutologgerSettings'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'CommandJobLimits'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, + "job_type": {"required": True}, + "status": {"readonly": True}, + "command": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "environment_id": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "parameters": {"readonly": True}, + } + + _attribute_map = { + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "autologger_settings": { + "key": "autologgerSettings", + "type": "AutologgerSettings", + }, + "code_id": {"key": "codeId", "type": "str"}, + "command": {"key": "command", "type": "str"}, + "distribution": { + "key": "distribution", + "type": "DistributionConfiguration", + }, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "limits": {"key": "limits", "type": "CommandJobLimits"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "parameters": {"key": "parameters", "type": "object"}, + "resources": {"key": "resources", "type": "JobResourceConfiguration"}, } def __init__( @@ -5451,8 +5763,20 @@ def __init__( :keyword resources: Compute Resource configuration for the job. :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration """ - super(CommandJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, services=services, **kwargs) - self.job_type = 'Command' # type: str + super(CommandJob, self).__init__( + description=description, + properties=properties, + tags=tags, + component_id=component_id, + compute_id=compute_id, + display_name=display_name, + experiment_name=experiment_name, + identity=identity, + is_archived=is_archived, + services=services, + **kwargs + ) + self.job_type = "Command" # type: str self.autologger_settings = autologger_settings self.code_id = code_id self.command = command @@ -5483,23 +5807,23 @@ class JobLimits(msrest.serialization.Model): """ _validation = { - 'job_limits_type': {'required': True}, + "job_limits_type": {"required": True}, } _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "job_limits_type": {"key": "jobLimitsType", "type": "str"}, + "timeout": {"key": "timeout", "type": "duration"}, } _subtype_map = { - 'job_limits_type': {'Command': 'CommandJobLimits', 'Sweep': 'SweepJobLimits'} + "job_limits_type": { + "Command": "CommandJobLimits", + "Sweep": "SweepJobLimits", + } } def __init__( - self, - *, - timeout: Optional[datetime.timedelta] = None, - **kwargs + self, *, timeout: Optional[datetime.timedelta] = None, **kwargs ): """ :keyword timeout: The max run duration in ISO 8601 format, after which the job will be @@ -5525,19 +5849,16 @@ class CommandJobLimits(JobLimits): """ _validation = { - 'job_limits_type': {'required': True}, + "job_limits_type": {"required": True}, } _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "job_limits_type": {"key": "jobLimitsType", "type": "str"}, + "timeout": {"key": "timeout", "type": "duration"}, } def __init__( - self, - *, - timeout: Optional[datetime.timedelta] = None, - **kwargs + self, *, timeout: Optional[datetime.timedelta] = None, **kwargs ): """ :keyword timeout: The max run duration in ISO 8601 format, after which the job will be @@ -5545,7 +5866,7 @@ def __init__( :paramtype timeout: ~datetime.timedelta """ super(CommandJobLimits, self).__init__(timeout=timeout, **kwargs) - self.job_limits_type = 'Command' # type: str + self.job_limits_type = "Command" # type: str class ComponentContainer(Resource): @@ -5571,26 +5892,26 @@ class ComponentContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "ComponentContainerProperties", + }, } def __init__( - self, - *, - properties: "ComponentContainerProperties", - **kwargs + self, *, properties: "ComponentContainerProperties", **kwargs ): """ :keyword properties: Required. [Required] Additional attributes of the entity. @@ -5604,44 +5925,44 @@ class ComponentContainerProperties(AssetContainer): """Component container definition. -.. raw:: html + .. raw:: html - . + . - Variables are only populated by the server, and will be ignored when sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the component container. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState + :ivar description: The asset description text. + :vartype description: str + :ivar properties: The asset property dictionary. + :vartype properties: dict[str, str] + :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + :ivar is_archived: Is the asset archived?. + :vartype is_archived: bool + :ivar latest_version: The latest version inside this container. + :vartype latest_version: str + :ivar next_version: The next auto incremental version. + :vartype next_version: str + :ivar provisioning_state: Provisioning state for the component container. Possible values + include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.machinelearningservices.models.AssetProvisioningState """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } def __init__( @@ -5663,7 +5984,13 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(ComponentContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) + super(ComponentContainerProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs + ) self.provisioning_state = None @@ -5678,8 +6005,8 @@ class ComponentContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ComponentContainer]"}, } def __init__( @@ -5696,7 +6023,9 @@ def __init__( :keyword value: An array of objects of type ComponentContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainer] """ - super(ComponentContainerResourceArmPaginatedResult, self).__init__(**kwargs) + super(ComponentContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -5724,27 +6053,25 @@ class ComponentVersion(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentVersionProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "ComponentVersionProperties", + }, } - def __init__( - self, - *, - properties: "ComponentVersionProperties", - **kwargs - ): + def __init__(self, *, properties: "ComponentVersionProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentVersionProperties @@ -5784,17 +6111,17 @@ class ComponentVersionProperties(AssetBase): """ _validation = { - 'provisioning_state': {'readonly': True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'component_spec': {'key': 'componentSpec', 'type': 'object'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "component_spec": {"key": "componentSpec", "type": "object"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } def __init__( @@ -5829,7 +6156,14 @@ def __init__( />. :paramtype component_spec: any """ - super(ComponentVersionProperties, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) + super(ComponentVersionProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + **kwargs + ) self.component_spec = component_spec self.provisioning_state = None @@ -5845,8 +6179,8 @@ class ComponentVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentVersion]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ComponentVersion]"}, } def __init__( @@ -5863,7 +6197,9 @@ def __init__( :keyword value: An array of objects of type ComponentVersion. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersion] """ - super(ComponentVersionResourceArmPaginatedResult, self).__init__(**kwargs) + super(ComponentVersionResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -5876,7 +6212,10 @@ class ComputeInstanceSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, + "properties": { + "key": "properties", + "type": "ComputeInstanceProperties", + }, } def __init__( @@ -5932,28 +6271,34 @@ class ComputeInstance(Compute, ComputeInstanceSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + "disable_local_auth": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": { + "key": "properties", + "type": "ComputeInstanceProperties", + }, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -5972,9 +6317,14 @@ def __init__( :keyword resource_id: ARM resource id of the underlying compute. :paramtype resource_id: str """ - super(ComputeInstance, self).__init__(description=description, resource_id=resource_id, properties=properties, **kwargs) + super(ComputeInstance, self).__init__( + description=description, + resource_id=resource_id, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'ComputeInstance' # type: str + self.compute_type = "ComputeInstance" # type: str self.compute_location = None self.provisioning_state = None self.description = description @@ -5996,8 +6346,8 @@ class ComputeInstanceApplication(msrest.serialization.Model): """ _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, + "display_name": {"key": "displayName", "type": "str"}, + "endpoint_uri": {"key": "endpointUri", "type": "str"}, } def __init__( @@ -6027,7 +6377,7 @@ class ComputeInstanceAutologgerSettings(msrest.serialization.Model): """ _attribute_map = { - 'mlflow_autologger': {'key': 'mlflowAutologger', 'type': 'str'}, + "mlflow_autologger": {"key": "mlflowAutologger", "type": "str"}, } def __init__( @@ -6059,21 +6409,17 @@ class ComputeInstanceConnectivityEndpoints(msrest.serialization.Model): """ _validation = { - 'public_ip_address': {'readonly': True}, - 'private_ip_address': {'readonly': True}, + "public_ip_address": {"readonly": True}, + "private_ip_address": {"readonly": True}, } _attribute_map = { - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + "public_ip_address": {"key": "publicIpAddress", "type": "str"}, + "private_ip_address": {"key": "privateIpAddress", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ComputeInstanceConnectivityEndpoints, self).__init__(**kwargs) self.public_ip_address = None self.private_ip_address = None @@ -6099,16 +6445,19 @@ class ComputeInstanceContainer(msrest.serialization.Model): """ _validation = { - 'services': {'readonly': True}, + "services": {"readonly": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'autosave': {'key': 'autosave', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'network': {'key': 'network', 'type': 'str'}, - 'environment': {'key': 'environment', 'type': 'ComputeInstanceEnvironmentInfo'}, - 'services': {'key': 'services', 'type': '[object]'}, + "name": {"key": "name", "type": "str"}, + "autosave": {"key": "autosave", "type": "str"}, + "gpu": {"key": "gpu", "type": "str"}, + "network": {"key": "network", "type": "str"}, + "environment": { + "key": "environment", + "type": "ComputeInstanceEnvironmentInfo", + }, + "services": {"key": "services", "type": "[object]"}, } def __init__( @@ -6157,23 +6506,19 @@ class ComputeInstanceCreatedBy(msrest.serialization.Model): """ _validation = { - 'user_name': {'readonly': True}, - 'user_org_id': {'readonly': True}, - 'user_id': {'readonly': True}, + "user_name": {"readonly": True}, + "user_org_id": {"readonly": True}, + "user_id": {"readonly": True}, } _attribute_map = { - 'user_name': {'key': 'userName', 'type': 'str'}, - 'user_org_id': {'key': 'userOrgId', 'type': 'str'}, - 'user_id': {'key': 'userId', 'type': 'str'}, + "user_name": {"key": "userName", "type": "str"}, + "user_org_id": {"key": "userOrgId", "type": "str"}, + "user_id": {"key": "userId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ComputeInstanceCreatedBy, self).__init__(**kwargs) self.user_name = None self.user_org_id = None @@ -6198,10 +6543,10 @@ class ComputeInstanceDataDisk(msrest.serialization.Model): """ _attribute_map = { - 'caching': {'key': 'caching', 'type': 'str'}, - 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, - 'lun': {'key': 'lun', 'type': 'int'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + "caching": {"key": "caching", "type": "str"}, + "disk_size_gb": {"key": "diskSizeGB", "type": "int"}, + "lun": {"key": "lun", "type": "int"}, + "storage_account_type": {"key": "storageAccountType", "type": "str"}, } def __init__( @@ -6210,7 +6555,9 @@ def __init__( caching: Optional[Union[str, "Caching"]] = None, disk_size_gb: Optional[int] = None, lun: Optional[int] = None, - storage_account_type: Optional[Union[str, "StorageAccountType"]] = "Standard_LRS", + storage_account_type: Optional[ + Union[str, "StorageAccountType"] + ] = "Standard_LRS", **kwargs ): """ @@ -6259,15 +6606,15 @@ class ComputeInstanceDataMount(msrest.serialization.Model): """ _attribute_map = { - 'source': {'key': 'source', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'mount_name': {'key': 'mountName', 'type': 'str'}, - 'mount_action': {'key': 'mountAction', 'type': 'str'}, - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - 'mount_state': {'key': 'mountState', 'type': 'str'}, - 'mounted_on': {'key': 'mountedOn', 'type': 'iso-8601'}, - 'error': {'key': 'error', 'type': 'str'}, + "source": {"key": "source", "type": "str"}, + "source_type": {"key": "sourceType", "type": "str"}, + "mount_name": {"key": "mountName", "type": "str"}, + "mount_action": {"key": "mountAction", "type": "str"}, + "created_by": {"key": "createdBy", "type": "str"}, + "mount_path": {"key": "mountPath", "type": "str"}, + "mount_state": {"key": "mountState", "type": "str"}, + "mounted_on": {"key": "mountedOn", "type": "iso-8601"}, + "error": {"key": "error", "type": "str"}, } def __init__( @@ -6327,8 +6674,8 @@ class ComputeInstanceEnvironmentInfo(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "version": {"key": "version", "type": "str"}, } def __init__( @@ -6366,10 +6713,10 @@ class ComputeInstanceLastOperation(msrest.serialization.Model): """ _attribute_map = { - 'operation_name': {'key': 'operationName', 'type': 'str'}, - 'operation_time': {'key': 'operationTime', 'type': 'iso-8601'}, - 'operation_status': {'key': 'operationStatus', 'type': 'str'}, - 'operation_trigger': {'key': 'operationTrigger', 'type': 'str'}, + "operation_name": {"key": "operationName", "type": "str"}, + "operation_time": {"key": "operationTime", "type": "iso-8601"}, + "operation_status": {"key": "operationStatus", "type": "str"}, + "operation_trigger": {"key": "operationTrigger", "type": "str"}, } def __init__( @@ -6478,43 +6825,85 @@ class ComputeInstanceProperties(msrest.serialization.Model): """ _validation = { - 'os_image_metadata': {'readonly': True}, - 'connectivity_endpoints': {'readonly': True}, - 'applications': {'readonly': True}, - 'created_by': {'readonly': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'last_operation': {'readonly': True}, - 'containers': {'readonly': True}, - 'data_disks': {'readonly': True}, - 'data_mounts': {'readonly': True}, - 'versions': {'readonly': True}, - } - - _attribute_map = { - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'application_sharing_policy': {'key': 'applicationSharingPolicy', 'type': 'str'}, - 'autologger_settings': {'key': 'autologgerSettings', 'type': 'ComputeInstanceAutologgerSettings'}, - 'ssh_settings': {'key': 'sshSettings', 'type': 'ComputeInstanceSshSettings'}, - 'custom_services': {'key': 'customServices', 'type': '[CustomService]'}, - 'os_image_metadata': {'key': 'osImageMetadata', 'type': 'ImageMetadata'}, - 'connectivity_endpoints': {'key': 'connectivityEndpoints', 'type': 'ComputeInstanceConnectivityEndpoints'}, - 'applications': {'key': 'applications', 'type': '[ComputeInstanceApplication]'}, - 'created_by': {'key': 'createdBy', 'type': 'ComputeInstanceCreatedBy'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'compute_instance_authorization_type': {'key': 'computeInstanceAuthorizationType', 'type': 'str'}, - 'personal_compute_instance_settings': {'key': 'personalComputeInstanceSettings', 'type': 'PersonalComputeInstanceSettings'}, - 'setup_scripts': {'key': 'setupScripts', 'type': 'SetupScripts'}, - 'last_operation': {'key': 'lastOperation', 'type': 'ComputeInstanceLastOperation'}, - 'schedules': {'key': 'schedules', 'type': 'ComputeSchedules'}, - 'idle_time_before_shutdown': {'key': 'idleTimeBeforeShutdown', 'type': 'str'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'containers': {'key': 'containers', 'type': '[ComputeInstanceContainer]'}, - 'data_disks': {'key': 'dataDisks', 'type': '[ComputeInstanceDataDisk]'}, - 'data_mounts': {'key': 'dataMounts', 'type': '[ComputeInstanceDataMount]'}, - 'versions': {'key': 'versions', 'type': 'ComputeInstanceVersion'}, + "os_image_metadata": {"readonly": True}, + "connectivity_endpoints": {"readonly": True}, + "applications": {"readonly": True}, + "created_by": {"readonly": True}, + "errors": {"readonly": True}, + "state": {"readonly": True}, + "last_operation": {"readonly": True}, + "containers": {"readonly": True}, + "data_disks": {"readonly": True}, + "data_mounts": {"readonly": True}, + "versions": {"readonly": True}, + } + + _attribute_map = { + "vm_size": {"key": "vmSize", "type": "str"}, + "subnet": {"key": "subnet", "type": "ResourceId"}, + "application_sharing_policy": { + "key": "applicationSharingPolicy", + "type": "str", + }, + "autologger_settings": { + "key": "autologgerSettings", + "type": "ComputeInstanceAutologgerSettings", + }, + "ssh_settings": { + "key": "sshSettings", + "type": "ComputeInstanceSshSettings", + }, + "custom_services": { + "key": "customServices", + "type": "[CustomService]", + }, + "os_image_metadata": { + "key": "osImageMetadata", + "type": "ImageMetadata", + }, + "connectivity_endpoints": { + "key": "connectivityEndpoints", + "type": "ComputeInstanceConnectivityEndpoints", + }, + "applications": { + "key": "applications", + "type": "[ComputeInstanceApplication]", + }, + "created_by": {"key": "createdBy", "type": "ComputeInstanceCreatedBy"}, + "errors": {"key": "errors", "type": "[ErrorResponse]"}, + "state": {"key": "state", "type": "str"}, + "compute_instance_authorization_type": { + "key": "computeInstanceAuthorizationType", + "type": "str", + }, + "personal_compute_instance_settings": { + "key": "personalComputeInstanceSettings", + "type": "PersonalComputeInstanceSettings", + }, + "setup_scripts": {"key": "setupScripts", "type": "SetupScripts"}, + "last_operation": { + "key": "lastOperation", + "type": "ComputeInstanceLastOperation", + }, + "schedules": {"key": "schedules", "type": "ComputeSchedules"}, + "idle_time_before_shutdown": { + "key": "idleTimeBeforeShutdown", + "type": "str", + }, + "enable_node_public_ip": {"key": "enableNodePublicIp", "type": "bool"}, + "containers": { + "key": "containers", + "type": "[ComputeInstanceContainer]", + }, + "data_disks": { + "key": "dataDisks", + "type": "[ComputeInstanceDataDisk]", + }, + "data_mounts": { + "key": "dataMounts", + "type": "[ComputeInstanceDataMount]", + }, + "versions": {"key": "versions", "type": "ComputeInstanceVersion"}, } def __init__( @@ -6522,12 +6911,20 @@ def __init__( *, vm_size: Optional[str] = None, subnet: Optional["ResourceId"] = None, - application_sharing_policy: Optional[Union[str, "ApplicationSharingPolicy"]] = "Shared", - autologger_settings: Optional["ComputeInstanceAutologgerSettings"] = None, + application_sharing_policy: Optional[ + Union[str, "ApplicationSharingPolicy"] + ] = "Shared", + autologger_settings: Optional[ + "ComputeInstanceAutologgerSettings" + ] = None, ssh_settings: Optional["ComputeInstanceSshSettings"] = None, custom_services: Optional[List["CustomService"]] = None, - compute_instance_authorization_type: Optional[Union[str, "ComputeInstanceAuthorizationType"]] = "personal", - personal_compute_instance_settings: Optional["PersonalComputeInstanceSettings"] = None, + compute_instance_authorization_type: Optional[ + Union[str, "ComputeInstanceAuthorizationType"] + ] = "personal", + personal_compute_instance_settings: Optional[ + "PersonalComputeInstanceSettings" + ] = None, setup_scripts: Optional["SetupScripts"] = None, idle_time_before_shutdown: Optional[str] = None, enable_node_public_ip: Optional[bool] = None, @@ -6585,8 +6982,12 @@ def __init__( self.created_by = None self.errors = None self.state = None - self.compute_instance_authorization_type = compute_instance_authorization_type - self.personal_compute_instance_settings = personal_compute_instance_settings + self.compute_instance_authorization_type = ( + compute_instance_authorization_type + ) + self.personal_compute_instance_settings = ( + personal_compute_instance_settings + ) self.setup_scripts = setup_scripts self.last_operation = None self.schedules = schedules @@ -6618,21 +7019,23 @@ class ComputeInstanceSshSettings(msrest.serialization.Model): """ _validation = { - 'admin_user_name': {'readonly': True}, - 'ssh_port': {'readonly': True}, + "admin_user_name": {"readonly": True}, + "ssh_port": {"readonly": True}, } _attribute_map = { - 'ssh_public_access': {'key': 'sshPublicAccess', 'type': 'str'}, - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'admin_public_key': {'key': 'adminPublicKey', 'type': 'str'}, + "ssh_public_access": {"key": "sshPublicAccess", "type": "str"}, + "admin_user_name": {"key": "adminUserName", "type": "str"}, + "ssh_port": {"key": "sshPort", "type": "int"}, + "admin_public_key": {"key": "adminPublicKey", "type": "str"}, } def __init__( self, *, - ssh_public_access: Optional[Union[str, "SshPublicAccess"]] = "Disabled", + ssh_public_access: Optional[ + Union[str, "SshPublicAccess"] + ] = "Disabled", admin_public_key: Optional[str] = None, **kwargs ): @@ -6661,15 +7064,10 @@ class ComputeInstanceVersion(msrest.serialization.Model): """ _attribute_map = { - 'runtime': {'key': 'runtime', 'type': 'str'}, + "runtime": {"key": "runtime", "type": "str"}, } - def __init__( - self, - *, - runtime: Optional[str] = None, - **kwargs - ): + def __init__(self, *, runtime: Optional[str] = None, **kwargs): """ :keyword runtime: Runtime of compute instance. :paramtype runtime: str @@ -6686,15 +7084,10 @@ class ComputeResourceSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, + "properties": {"key": "properties", "type": "Compute"}, } - def __init__( - self, - *, - properties: Optional["Compute"] = None, - **kwargs - ): + def __init__(self, *, properties: Optional["Compute"] = None, **kwargs): """ :keyword properties: Compute properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute @@ -6732,22 +7125,22 @@ class ComputeResource(Resource, ComputeResourceSchema): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "properties": {"key": "properties", "type": "Compute"}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, } def __init__( @@ -6793,7 +7186,10 @@ class ComputeSchedules(msrest.serialization.Model): """ _attribute_map = { - 'compute_start_stop': {'key': 'computeStartStop', 'type': '[ComputeStartStopSchedule]'}, + "compute_start_stop": { + "key": "computeStartStop", + "type": "[ComputeStartStopSchedule]", + }, } def __init__( @@ -6838,19 +7234,19 @@ class ComputeStartStopSchedule(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'provisioning_status': {'readonly': True}, + "id": {"readonly": True}, + "provisioning_status": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'recurrence': {'key': 'recurrence', 'type': 'Recurrence'}, - 'cron': {'key': 'cron', 'type': 'Cron'}, - 'schedule': {'key': 'schedule', 'type': 'ScheduleBase'}, + "id": {"key": "id", "type": "str"}, + "provisioning_status": {"key": "provisioningStatus", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "action": {"key": "action", "type": "str"}, + "trigger_type": {"key": "triggerType", "type": "str"}, + "recurrence": {"key": "recurrence", "type": "Recurrence"}, + "cron": {"key": "cron", "type": "Cron"}, + "schedule": {"key": "schedule", "type": "ScheduleBase"}, } def __init__( @@ -6902,15 +7298,25 @@ class ContainerResourceRequirements(msrest.serialization.Model): """ _attribute_map = { - 'container_resource_limits': {'key': 'containerResourceLimits', 'type': 'ContainerResourceSettings'}, - 'container_resource_requests': {'key': 'containerResourceRequests', 'type': 'ContainerResourceSettings'}, + "container_resource_limits": { + "key": "containerResourceLimits", + "type": "ContainerResourceSettings", + }, + "container_resource_requests": { + "key": "containerResourceRequests", + "type": "ContainerResourceSettings", + }, } def __init__( self, *, - container_resource_limits: Optional["ContainerResourceSettings"] = None, - container_resource_requests: Optional["ContainerResourceSettings"] = None, + container_resource_limits: Optional[ + "ContainerResourceSettings" + ] = None, + container_resource_requests: Optional[ + "ContainerResourceSettings" + ] = None, **kwargs ): """ @@ -6941,9 +7347,9 @@ class ContainerResourceSettings(msrest.serialization.Model): """ _attribute_map = { - 'cpu': {'key': 'cpu', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'memory': {'key': 'memory', 'type': 'str'}, + "cpu": {"key": "cpu", "type": "str"}, + "gpu": {"key": "gpu", "type": "str"}, + "memory": {"key": "memory", "type": "str"}, } def __init__( @@ -6979,14 +7385,14 @@ class CosmosDbSettings(msrest.serialization.Model): """ _attribute_map = { - 'collections_throughput': {'key': 'collectionsThroughput', 'type': 'int'}, + "collections_throughput": { + "key": "collectionsThroughput", + "type": "int", + }, } def __init__( - self, - *, - collections_throughput: Optional[int] = None, - **kwargs + self, *, collections_throughput: Optional[int] = None, **kwargs ): """ :keyword collections_throughput: The throughput of the collections in cosmosdb database. @@ -7011,9 +7417,9 @@ class Cron(msrest.serialization.Model): """ _attribute_map = { - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, + "start_time": {"key": "startTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "expression": {"key": "expression", "type": "str"}, } def __init__( @@ -7067,18 +7473,21 @@ class TriggerBase(msrest.serialization.Model): """ _validation = { - 'trigger_type': {'required': True}, + "trigger_type": {"required": True}, } _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, + "end_time": {"key": "endTime", "type": "str"}, + "start_time": {"key": "startTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "trigger_type": {"key": "triggerType", "type": "str"}, } _subtype_map = { - 'trigger_type': {'Cron': 'CronTrigger', 'Recurrence': 'RecurrenceTrigger'} + "trigger_type": { + "Cron": "CronTrigger", + "Recurrence": "RecurrenceTrigger", + } } def __init__( @@ -7136,16 +7545,16 @@ class CronTrigger(TriggerBase): """ _validation = { - 'trigger_type': {'required': True}, - 'expression': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "trigger_type": {"required": True}, + "expression": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, + "end_time": {"key": "endTime", "type": "str"}, + "start_time": {"key": "startTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "trigger_type": {"key": "triggerType", "type": "str"}, + "expression": {"key": "expression", "type": "str"}, } def __init__( @@ -7174,8 +7583,13 @@ def __init__( The expression should follow NCronTab format. :paramtype expression: str """ - super(CronTrigger, self).__init__(end_time=end_time, start_time=start_time, time_zone=time_zone, **kwargs) - self.trigger_type = 'Cron' # type: str + super(CronTrigger, self).__init__( + end_time=end_time, + start_time=start_time, + time_zone=time_zone, + **kwargs + ) + self.trigger_type = "Cron" # type: str self.expression = expression @@ -7204,33 +7618,29 @@ class CsvExportSummary(ExportSummary): """ _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'container_name': {'readonly': True}, - 'snapshot_path': {'readonly': True}, + "end_date_time": {"readonly": True}, + "exported_row_count": {"readonly": True}, + "format": {"required": True}, + "labeling_job_id": {"readonly": True}, + "start_date_time": {"readonly": True}, + "container_name": {"readonly": True}, + "snapshot_path": {"readonly": True}, } _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'snapshot_path': {'key': 'snapshotPath', 'type': 'str'}, + "end_date_time": {"key": "endDateTime", "type": "iso-8601"}, + "exported_row_count": {"key": "exportedRowCount", "type": "long"}, + "format": {"key": "format", "type": "str"}, + "labeling_job_id": {"key": "labelingJobId", "type": "str"}, + "start_date_time": {"key": "startDateTime", "type": "iso-8601"}, + "container_name": {"key": "containerName", "type": "str"}, + "snapshot_path": {"key": "snapshotPath", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(CsvExportSummary, self).__init__(**kwargs) - self.format = 'CSV' # type: str + self.format = "CSV" # type: str self.container_name = None self.snapshot_path = None @@ -7248,27 +7658,22 @@ class CustomForecastHorizon(ForecastHorizon): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - *, - value: int, - **kwargs - ): + def __init__(self, *, value: int, **kwargs): """ :keyword value: Required. [Required] Forecast horizon value. :paramtype value: int """ super(CustomForecastHorizon, self).__init__(**kwargs) - self.mode = 'Custom' # type: str + self.mode = "Custom" # type: str self.value = value @@ -7289,24 +7694,27 @@ class JobInput(msrest.serialization.Model): """ _validation = { - 'job_input_type': {'required': True}, + "job_input_type": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } _subtype_map = { - 'job_input_type': {'custom_model': 'CustomModelJobInput', 'literal': 'LiteralJobInput', 'mlflow_model': 'MLFlowModelJobInput', 'mltable': 'MLTableJobInput', 'triton_model': 'TritonModelJobInput', 'uri_file': 'UriFileJobInput', 'uri_folder': 'UriFolderJobInput'} + "job_input_type": { + "custom_model": "CustomModelJobInput", + "literal": "LiteralJobInput", + "mlflow_model": "MLFlowModelJobInput", + "mltable": "MLTableJobInput", + "triton_model": "TritonModelJobInput", + "uri_file": "UriFileJobInput", + "uri_folder": "UriFolderJobInput", + } } - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): + def __init__(self, *, description: Optional[str] = None, **kwargs): """ :keyword description: Description for the input. :paramtype description: str @@ -7335,15 +7743,15 @@ class CustomModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -7363,10 +7771,12 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(CustomModelJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(CustomModelJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'custom_model' # type: str + self.job_input_type = "custom_model" # type: str self.description = description @@ -7387,24 +7797,26 @@ class JobOutput(msrest.serialization.Model): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } _subtype_map = { - 'job_output_type': {'custom_model': 'CustomModelJobOutput', 'mlflow_model': 'MLFlowModelJobOutput', 'mltable': 'MLTableJobOutput', 'triton_model': 'TritonModelJobOutput', 'uri_file': 'UriFileJobOutput', 'uri_folder': 'UriFolderJobOutput'} + "job_output_type": { + "custom_model": "CustomModelJobOutput", + "mlflow_model": "MLFlowModelJobOutput", + "mltable": "MLTableJobOutput", + "triton_model": "TritonModelJobOutput", + "uri_file": "UriFileJobOutput", + "uri_folder": "UriFolderJobOutput", + } } - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): + def __init__(self, *, description: Optional[str] = None, **kwargs): """ :keyword description: Description for the output. :paramtype description: str @@ -7433,14 +7845,14 @@ class CustomModelJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -7460,10 +7872,12 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(CustomModelJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(CustomModelJobOutput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_output_type = 'custom_model' # type: str + self.job_output_type = "custom_model" # type: str self.description = description @@ -7480,27 +7894,22 @@ class CustomNCrossValidations(NCrossValidations): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - *, - value: int, - **kwargs - ): + def __init__(self, *, value: int, **kwargs): """ :keyword value: Required. [Required] N-Cross validations value. :paramtype value: int """ super(CustomNCrossValidations, self).__init__(**kwargs) - self.mode = 'Custom' # type: str + self.mode = "Custom" # type: str self.value = value @@ -7517,27 +7926,22 @@ class CustomSeasonality(Seasonality): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - *, - value: int, - **kwargs - ): + def __init__(self, *, value: int, **kwargs): """ :keyword value: Required. [Required] Seasonality value. :paramtype value: int """ super(CustomSeasonality, self).__init__(**kwargs) - self.mode = 'Custom' # type: str + self.mode = "Custom" # type: str self.value = value @@ -7563,13 +7967,16 @@ class CustomService(msrest.serialization.Model): """ _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'name': {'key': 'name', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'Image'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{EnvironmentVariable}'}, - 'docker': {'key': 'docker', 'type': 'Docker'}, - 'endpoints': {'key': 'endpoints', 'type': '[Endpoint]'}, - 'volumes': {'key': 'volumes', 'type': '[VolumeDefinition]'}, + "additional_properties": {"key": "", "type": "{object}"}, + "name": {"key": "name", "type": "str"}, + "image": {"key": "image", "type": "Image"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{EnvironmentVariable}", + }, + "docker": {"key": "docker", "type": "Docker"}, + "endpoints": {"key": "endpoints", "type": "[Endpoint]"}, + "volumes": {"key": "volumes", "type": "[VolumeDefinition]"}, } def __init__( @@ -7578,7 +7985,9 @@ def __init__( additional_properties: Optional[Dict[str, Any]] = None, name: Optional[str] = None, image: Optional["Image"] = None, - environment_variables: Optional[Dict[str, "EnvironmentVariable"]] = None, + environment_variables: Optional[ + Dict[str, "EnvironmentVariable"] + ] = None, docker: Optional["Docker"] = None, endpoints: Optional[List["Endpoint"]] = None, volumes: Optional[List["VolumeDefinition"]] = None, @@ -7625,27 +8034,22 @@ class CustomTargetLags(TargetLags): """ _validation = { - 'mode': {'required': True}, - 'values': {'required': True}, + "mode": {"required": True}, + "values": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[int]'}, + "mode": {"key": "mode", "type": "str"}, + "values": {"key": "values", "type": "[int]"}, } - def __init__( - self, - *, - values: List[int], - **kwargs - ): + def __init__(self, *, values: List[int], **kwargs): """ :keyword values: Required. [Required] Set target lags values. :paramtype values: list[int] """ super(CustomTargetLags, self).__init__(**kwargs) - self.mode = 'Custom' # type: str + self.mode = "Custom" # type: str self.values = values @@ -7662,27 +8066,22 @@ class CustomTargetRollingWindowSize(TargetRollingWindowSize): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - *, - value: int, - **kwargs - ): + def __init__(self, *, value: int, **kwargs): """ :keyword value: Required. [Required] TargetRollingWindowSize value. :paramtype value: int """ super(CustomTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Custom' # type: str + self.mode = "Custom" # type: str self.value = value @@ -7694,14 +8093,11 @@ class DatabricksSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, + "properties": {"key": "properties", "type": "DatabricksProperties"}, } def __init__( - self, - *, - properties: Optional["DatabricksProperties"] = None, - **kwargs + self, *, properties: Optional["DatabricksProperties"] = None, **kwargs ): """ :keyword properties: Properties of Databricks. @@ -7750,28 +8146,31 @@ class Databricks(Compute, DatabricksSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + "disable_local_auth": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "DatabricksProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -7790,9 +8189,14 @@ def __init__( :keyword resource_id: ARM resource id of the underlying compute. :paramtype resource_id: str """ - super(Databricks, self).__init__(description=description, resource_id=resource_id, properties=properties, **kwargs) + super(Databricks, self).__init__( + description=description, + resource_id=resource_id, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'Databricks' # type: str + self.compute_type = "Databricks" # type: str self.compute_location = None self.provisioning_state = None self.description = description @@ -7812,14 +8216,14 @@ class DatabricksComputeSecretsProperties(msrest.serialization.Model): """ _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, } def __init__( - self, - *, - databricks_access_token: Optional[str] = None, - **kwargs + self, *, databricks_access_token: Optional[str] = None, **kwargs ): """ :keyword databricks_access_token: access token for databricks account. @@ -7829,7 +8233,9 @@ def __init__( self.databricks_access_token = databricks_access_token -class DatabricksComputeSecrets(ComputeSecrets, DatabricksComputeSecretsProperties): +class DatabricksComputeSecrets( + ComputeSecrets, DatabricksComputeSecretsProperties +): """Secrets related to a Machine Learning compute based on Databricks. All required parameters must be populated in order to send to Azure. @@ -7843,27 +8249,29 @@ class DatabricksComputeSecrets(ComputeSecrets, DatabricksComputeSecretsPropertie """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, + "compute_type": {"key": "computeType", "type": "str"}, } def __init__( - self, - *, - databricks_access_token: Optional[str] = None, - **kwargs + self, *, databricks_access_token: Optional[str] = None, **kwargs ): """ :keyword databricks_access_token: access token for databricks account. :paramtype databricks_access_token: str """ - super(DatabricksComputeSecrets, self).__init__(databricks_access_token=databricks_access_token, **kwargs) + super(DatabricksComputeSecrets, self).__init__( + databricks_access_token=databricks_access_token, **kwargs + ) self.databricks_access_token = databricks_access_token - self.compute_type = 'Databricks' # type: str + self.compute_type = "Databricks" # type: str class DatabricksProperties(msrest.serialization.Model): @@ -7876,8 +8284,11 @@ class DatabricksProperties(msrest.serialization.Model): """ _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'workspace_url': {'key': 'workspaceUrl', 'type': 'str'}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, + "workspace_url": {"key": "workspaceUrl", "type": "str"}, } def __init__( @@ -7921,27 +8332,22 @@ class DataContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "DataContainerProperties"}, } - def __init__( - self, - *, - properties: "DataContainerProperties", - **kwargs - ): + def __init__(self, *, properties: "DataContainerProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataContainerProperties @@ -7975,19 +8381,19 @@ class DataContainerProperties(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'data_type': {'required': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "data_type": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "data_type": {"key": "dataType", "type": "str"}, } def __init__( @@ -8013,7 +8419,13 @@ def __init__( "uri_file", "uri_folder", "mltable". :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType """ - super(DataContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) + super(DataContainerProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs + ) self.data_type = data_type @@ -8028,8 +8440,8 @@ class DataContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[DataContainer]"}, } def __init__( @@ -8088,27 +8500,30 @@ class DataFactory(Compute): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + "disable_local_auth": {"readonly": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -8124,8 +8539,10 @@ def __init__( :keyword resource_id: ARM resource id of the underlying compute. :paramtype resource_id: str """ - super(DataFactory, self).__init__(description=description, resource_id=resource_id, **kwargs) - self.compute_type = 'DataFactory' # type: str + super(DataFactory, self).__init__( + description=description, resource_id=resource_id, **kwargs + ) + self.compute_type = "DataFactory" # type: str class DataLakeAnalyticsSchema(msrest.serialization.Model): @@ -8137,7 +8554,10 @@ class DataLakeAnalyticsSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, + "properties": { + "key": "properties", + "type": "DataLakeAnalyticsSchemaProperties", + }, } def __init__( @@ -8195,28 +8615,34 @@ class DataLakeAnalytics(Compute, DataLakeAnalyticsSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + "disable_local_auth": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": { + "key": "properties", + "type": "DataLakeAnalyticsSchemaProperties", + }, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -8236,9 +8662,14 @@ def __init__( :keyword resource_id: ARM resource id of the underlying compute. :paramtype resource_id: str """ - super(DataLakeAnalytics, self).__init__(description=description, resource_id=resource_id, properties=properties, **kwargs) + super(DataLakeAnalytics, self).__init__( + description=description, + resource_id=resource_id, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'DataLakeAnalytics' # type: str + self.compute_type = "DataLakeAnalytics" # type: str self.compute_location = None self.provisioning_state = None self.description = description @@ -8258,14 +8689,14 @@ class DataLakeAnalyticsSchemaProperties(msrest.serialization.Model): """ _attribute_map = { - 'data_lake_store_account_name': {'key': 'dataLakeStoreAccountName', 'type': 'str'}, + "data_lake_store_account_name": { + "key": "dataLakeStoreAccountName", + "type": "str", + }, } def __init__( - self, - *, - data_lake_store_account_name: Optional[str] = None, - **kwargs + self, *, data_lake_store_account_name: Optional[str] = None, **kwargs ): """ :keyword data_lake_store_account_name: DataLake Store Account Name. @@ -8290,13 +8721,13 @@ class DataPathAssetReference(AssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'datastore_id': {'key': 'datastoreId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "datastore_id": {"key": "datastoreId", "type": "str"}, + "path": {"key": "path", "type": "str"}, } def __init__( @@ -8313,7 +8744,7 @@ def __init__( :paramtype path: str """ super(DataPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'DataPath' # type: str + self.reference_type = "DataPath" # type: str self.datastore_id = datastore_id self.path = path @@ -8341,31 +8772,27 @@ class DatasetExportSummary(ExportSummary): """ _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'labeled_asset_name': {'readonly': True}, + "end_date_time": {"readonly": True}, + "exported_row_count": {"readonly": True}, + "format": {"required": True}, + "labeling_job_id": {"readonly": True}, + "start_date_time": {"readonly": True}, + "labeled_asset_name": {"readonly": True}, } _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'labeled_asset_name': {'key': 'labeledAssetName', 'type': 'str'}, + "end_date_time": {"key": "endDateTime", "type": "iso-8601"}, + "exported_row_count": {"key": "exportedRowCount", "type": "long"}, + "format": {"key": "format", "type": "str"}, + "labeling_job_id": {"key": "labelingJobId", "type": "str"}, + "start_date_time": {"key": "startDateTime", "type": "iso-8601"}, + "labeled_asset_name": {"key": "labeledAssetName", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DatasetExportSummary, self).__init__(**kwargs) - self.format = 'Dataset' # type: str + self.format = "Dataset" # type: str self.labeled_asset_name = None @@ -8392,27 +8819,22 @@ class Datastore(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DatastoreProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "DatastoreProperties"}, } - def __init__( - self, - *, - properties: "DatastoreProperties", - **kwargs - ): + def __init__(self, *, properties: "DatastoreProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatastoreProperties @@ -8432,8 +8854,8 @@ class DatastoreResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Datastore]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[Datastore]"}, } def __init__( @@ -8478,27 +8900,25 @@ class DataVersionBase(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataVersionBaseProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "DataVersionBaseProperties", + }, } - def __init__( - self, - *, - properties: "DataVersionBaseProperties", - **kwargs - ): + def __init__(self, *, properties: "DataVersionBaseProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataVersionBaseProperties @@ -8534,22 +8954,26 @@ class DataVersionBaseProperties(AssetBase): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, } _subtype_map = { - 'data_type': {'mltable': 'MLTableData', 'uri_file': 'UriFileDataVersion', 'uri_folder': 'UriFolderDataVersion'} + "data_type": { + "mltable": "MLTableData", + "uri_file": "UriFileDataVersion", + "uri_folder": "UriFolderDataVersion", + } } def __init__( @@ -8578,8 +9002,15 @@ def __init__( Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20221001Preview.Assets.DataVersionBase.DataType. :paramtype data_uri: str """ - super(DataVersionBaseProperties, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.data_type = 'DataVersionBaseProperties' # type: str + super(DataVersionBaseProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + **kwargs + ) + self.data_type = "DataVersionBaseProperties" # type: str self.data_uri = data_uri @@ -8594,8 +9025,8 @@ class DataVersionBaseResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataVersionBase]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[DataVersionBase]"}, } def __init__( @@ -8612,7 +9043,9 @@ def __init__( :keyword value: An array of objects of type DataVersionBase. :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBase] """ - super(DataVersionBaseResourceArmPaginatedResult, self).__init__(**kwargs) + super(DataVersionBaseResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -8631,23 +9064,22 @@ class OnlineScaleSettings(msrest.serialization.Model): """ _validation = { - 'scale_type': {'required': True}, + "scale_type": {"required": True}, } _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, + "scale_type": {"key": "scaleType", "type": "str"}, } _subtype_map = { - 'scale_type': {'Default': 'DefaultScaleSettings', 'TargetUtilization': 'TargetUtilizationScaleSettings'} + "scale_type": { + "Default": "DefaultScaleSettings", + "TargetUtilization": "TargetUtilizationScaleSettings", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(OnlineScaleSettings, self).__init__(**kwargs) self.scale_type = None # type: Optional[str] @@ -8663,21 +9095,17 @@ class DefaultScaleSettings(OnlineScaleSettings): """ _validation = { - 'scale_type': {'required': True}, + "scale_type": {"required": True}, } _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, + "scale_type": {"key": "scaleType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DefaultScaleSettings, self).__init__(**kwargs) - self.scale_type = 'Default' # type: str + self.scale_type = "Default" # type: str class DeploymentLogs(msrest.serialization.Model): @@ -8688,15 +9116,10 @@ class DeploymentLogs(msrest.serialization.Model): """ _attribute_map = { - 'content': {'key': 'content', 'type': 'str'}, + "content": {"key": "content", "type": "str"}, } - def __init__( - self, - *, - content: Optional[str] = None, - **kwargs - ): + def __init__(self, *, content: Optional[str] = None, **kwargs): """ :keyword content: The retrieved online deployment logs. :paramtype content: str @@ -8716,8 +9139,8 @@ class DeploymentLogsRequest(msrest.serialization.Model): """ _attribute_map = { - 'container_type': {'key': 'containerType', 'type': 'str'}, - 'tail': {'key': 'tail', 'type': 'int'}, + "container_type": {"key": "containerType", "type": "str"}, + "tail": {"key": "tail", "type": "int"}, } def __init__( @@ -8751,9 +9174,9 @@ class ResourceConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "properties": {"key": "properties", "type": "{object}"}, } def __init__( @@ -8790,9 +9213,9 @@ class DeploymentResourceConfiguration(ResourceConfiguration): """ _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "properties": {"key": "properties", "type": "{object}"}, } def __init__( @@ -8811,7 +9234,12 @@ def __init__( :keyword properties: Additional properties bag. :paramtype properties: dict[str, any] """ - super(DeploymentResourceConfiguration, self).__init__(instance_count=instance_count, instance_type=instance_type, properties=properties, **kwargs) + super(DeploymentResourceConfiguration, self).__init__( + instance_count=instance_count, + instance_type=instance_type, + properties=properties, + **kwargs + ) class DiagnoseRequestProperties(msrest.serialization.Model): @@ -8838,15 +9266,18 @@ class DiagnoseRequestProperties(msrest.serialization.Model): """ _attribute_map = { - 'udr': {'key': 'udr', 'type': '{object}'}, - 'nsg': {'key': 'nsg', 'type': '{object}'}, - 'resource_lock': {'key': 'resourceLock', 'type': '{object}'}, - 'dns_resolution': {'key': 'dnsResolution', 'type': '{object}'}, - 'storage_account': {'key': 'storageAccount', 'type': '{object}'}, - 'key_vault': {'key': 'keyVault', 'type': '{object}'}, - 'container_registry': {'key': 'containerRegistry', 'type': '{object}'}, - 'application_insights': {'key': 'applicationInsights', 'type': '{object}'}, - 'others': {'key': 'others', 'type': '{object}'}, + "udr": {"key": "udr", "type": "{object}"}, + "nsg": {"key": "nsg", "type": "{object}"}, + "resource_lock": {"key": "resourceLock", "type": "{object}"}, + "dns_resolution": {"key": "dnsResolution", "type": "{object}"}, + "storage_account": {"key": "storageAccount", "type": "{object}"}, + "key_vault": {"key": "keyVault", "type": "{object}"}, + "container_registry": {"key": "containerRegistry", "type": "{object}"}, + "application_insights": { + "key": "applicationInsights", + "type": "{object}", + }, + "others": {"key": "others", "type": "{object}"}, } def __init__( @@ -8903,7 +9334,7 @@ class DiagnoseResponseResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseResponseResultValue'}, + "value": {"key": "value", "type": "DiagnoseResponseResultValue"}, } def __init__( @@ -8950,15 +9381,39 @@ class DiagnoseResponseResultValue(msrest.serialization.Model): """ _attribute_map = { - 'user_defined_route_results': {'key': 'userDefinedRouteResults', 'type': '[DiagnoseResult]'}, - 'network_security_rule_results': {'key': 'networkSecurityRuleResults', 'type': '[DiagnoseResult]'}, - 'resource_lock_results': {'key': 'resourceLockResults', 'type': '[DiagnoseResult]'}, - 'dns_resolution_results': {'key': 'dnsResolutionResults', 'type': '[DiagnoseResult]'}, - 'storage_account_results': {'key': 'storageAccountResults', 'type': '[DiagnoseResult]'}, - 'key_vault_results': {'key': 'keyVaultResults', 'type': '[DiagnoseResult]'}, - 'container_registry_results': {'key': 'containerRegistryResults', 'type': '[DiagnoseResult]'}, - 'application_insights_results': {'key': 'applicationInsightsResults', 'type': '[DiagnoseResult]'}, - 'other_results': {'key': 'otherResults', 'type': '[DiagnoseResult]'}, + "user_defined_route_results": { + "key": "userDefinedRouteResults", + "type": "[DiagnoseResult]", + }, + "network_security_rule_results": { + "key": "networkSecurityRuleResults", + "type": "[DiagnoseResult]", + }, + "resource_lock_results": { + "key": "resourceLockResults", + "type": "[DiagnoseResult]", + }, + "dns_resolution_results": { + "key": "dnsResolutionResults", + "type": "[DiagnoseResult]", + }, + "storage_account_results": { + "key": "storageAccountResults", + "type": "[DiagnoseResult]", + }, + "key_vault_results": { + "key": "keyVaultResults", + "type": "[DiagnoseResult]", + }, + "container_registry_results": { + "key": "containerRegistryResults", + "type": "[DiagnoseResult]", + }, + "application_insights_results": { + "key": "applicationInsightsResults", + "type": "[DiagnoseResult]", + }, + "other_results": {"key": "otherResults", "type": "[DiagnoseResult]"}, } def __init__( @@ -9029,23 +9484,19 @@ class DiagnoseResult(msrest.serialization.Model): """ _validation = { - 'code': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, + "code": {"readonly": True}, + "level": {"readonly": True}, + "message": {"readonly": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, + "code": {"key": "code", "type": "str"}, + "level": {"key": "level", "type": "str"}, + "message": {"key": "message", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DiagnoseResult, self).__init__(**kwargs) self.code = None self.level = None @@ -9060,14 +9511,11 @@ class DiagnoseWorkspaceParameters(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseRequestProperties'}, + "value": {"key": "value", "type": "DiagnoseRequestProperties"}, } def __init__( - self, - *, - value: Optional["DiagnoseRequestProperties"] = None, - **kwargs + self, *, value: Optional["DiagnoseRequestProperties"] = None, **kwargs ): """ :keyword value: Value of Parameters. @@ -9091,23 +9539,23 @@ class DistributionConfiguration(msrest.serialization.Model): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, + "distribution_type": {"key": "distributionType", "type": "str"}, } _subtype_map = { - 'distribution_type': {'Mpi': 'Mpi', 'PyTorch': 'PyTorch', 'TensorFlow': 'TensorFlow'} + "distribution_type": { + "Mpi": "Mpi", + "PyTorch": "PyTorch", + "TensorFlow": "TensorFlow", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DistributionConfiguration, self).__init__(**kwargs) self.distribution_type = None # type: Optional[str] @@ -9123,8 +9571,8 @@ class Docker(msrest.serialization.Model): """ _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'privileged': {'key': 'privileged', 'type': 'bool'}, + "additional_properties": {"key": "", "type": "{object}"}, + "privileged": {"key": "privileged", "type": "bool"}, } def __init__( @@ -9162,14 +9610,14 @@ class EncryptionKeyVaultProperties(msrest.serialization.Model): """ _validation = { - 'key_vault_arm_id': {'required': True}, - 'key_identifier': {'required': True}, + "key_vault_arm_id": {"required": True}, + "key_identifier": {"required": True}, } _attribute_map = { - 'key_vault_arm_id': {'key': 'keyVaultArmId', 'type': 'str'}, - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - 'identity_client_id': {'key': 'identityClientId', 'type': 'str'}, + "key_vault_arm_id": {"key": "keyVaultArmId", "type": "str"}, + "key_identifier": {"key": "keyIdentifier", "type": "str"}, + "identity_client_id": {"key": "identityClientId", "type": "str"}, } def __init__( @@ -9206,19 +9654,14 @@ class EncryptionKeyVaultUpdateProperties(msrest.serialization.Model): """ _validation = { - 'key_identifier': {'required': True}, + "key_identifier": {"required": True}, } _attribute_map = { - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, + "key_identifier": {"key": "keyIdentifier", "type": "str"}, } - def __init__( - self, - *, - key_identifier: str, - **kwargs - ): + def __init__(self, *, key_identifier: str, **kwargs): """ :keyword key_identifier: Required. Key Vault uri to access the encryption key. :paramtype key_identifier: str @@ -9243,14 +9686,17 @@ class EncryptionProperty(msrest.serialization.Model): """ _validation = { - 'status': {'required': True}, - 'key_vault_properties': {'required': True}, + "status": {"required": True}, + "key_vault_properties": {"required": True}, } _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityForCmk'}, - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'EncryptionKeyVaultProperties'}, + "status": {"key": "status", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityForCmk"}, + "key_vault_properties": { + "key": "keyVaultProperties", + "type": "EncryptionKeyVaultProperties", + }, } def __init__( @@ -9289,11 +9735,14 @@ class EncryptionUpdateProperties(msrest.serialization.Model): """ _validation = { - 'key_vault_properties': {'required': True}, + "key_vault_properties": {"required": True}, } _attribute_map = { - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'EncryptionKeyVaultUpdateProperties'}, + "key_vault_properties": { + "key": "keyVaultProperties", + "type": "EncryptionKeyVaultUpdateProperties", + }, } def __init__( @@ -9328,11 +9777,11 @@ class Endpoint(msrest.serialization.Model): """ _attribute_map = { - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'int'}, - 'published': {'key': 'published', 'type': 'int'}, - 'host_ip': {'key': 'hostIp', 'type': 'str'}, + "protocol": {"key": "protocol", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "target": {"key": "target", "type": "int"}, + "published": {"key": "published", "type": "int"}, + "host_ip": {"key": "hostIp", "type": "str"}, } def __init__( @@ -9376,8 +9825,8 @@ class EndpointAuthKeys(msrest.serialization.Model): """ _attribute_map = { - 'primary_key': {'key': 'primaryKey', 'type': 'str'}, - 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, + "primary_key": {"key": "primaryKey", "type": "str"}, + "secondary_key": {"key": "secondaryKey", "type": "str"}, } def __init__( @@ -9412,10 +9861,13 @@ class EndpointAuthToken(msrest.serialization.Model): """ _attribute_map = { - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'expiry_time_utc': {'key': 'expiryTimeUtc', 'type': 'long'}, - 'refresh_after_time_utc': {'key': 'refreshAfterTimeUtc', 'type': 'long'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, + "access_token": {"key": "accessToken", "type": "str"}, + "expiry_time_utc": {"key": "expiryTimeUtc", "type": "long"}, + "refresh_after_time_utc": { + "key": "refreshAfterTimeUtc", + "type": "long", + }, + "token_type": {"key": "tokenType", "type": "str"}, } def __init__( @@ -9458,23 +9910,22 @@ class ScheduleActionBase(msrest.serialization.Model): """ _validation = { - 'action_type': {'required': True}, + "action_type": {"required": True}, } _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, + "action_type": {"key": "actionType", "type": "str"}, } _subtype_map = { - 'action_type': {'CreateJob': 'JobScheduleAction', 'InvokeBatchEndpoint': 'EndpointScheduleAction'} + "action_type": { + "CreateJob": "JobScheduleAction", + "InvokeBatchEndpoint": "EndpointScheduleAction", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ScheduleActionBase, self).__init__(**kwargs) self.action_type = None # type: Optional[str] @@ -9498,21 +9949,19 @@ class EndpointScheduleAction(ScheduleActionBase): """ _validation = { - 'action_type': {'required': True}, - 'endpoint_invocation_definition': {'required': True}, + "action_type": {"required": True}, + "endpoint_invocation_definition": {"required": True}, } _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'endpoint_invocation_definition': {'key': 'endpointInvocationDefinition', 'type': 'object'}, + "action_type": {"key": "actionType", "type": "str"}, + "endpoint_invocation_definition": { + "key": "endpointInvocationDefinition", + "type": "object", + }, } - def __init__( - self, - *, - endpoint_invocation_definition: Any, - **kwargs - ): + def __init__(self, *, endpoint_invocation_definition: Any, **kwargs): """ :keyword endpoint_invocation_definition: Required. [Required] Defines Schedule action definition details. @@ -9524,7 +9973,7 @@ def __init__( :paramtype endpoint_invocation_definition: any """ super(EndpointScheduleAction, self).__init__(**kwargs) - self.action_type = 'InvokeBatchEndpoint' # type: str + self.action_type = "InvokeBatchEndpoint" # type: str self.endpoint_invocation_definition = endpoint_invocation_definition @@ -9551,26 +10000,26 @@ class EnvironmentContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "EnvironmentContainerProperties", + }, } def __init__( - self, - *, - properties: "EnvironmentContainerProperties", - **kwargs + self, *, properties: "EnvironmentContainerProperties", **kwargs ): """ :keyword properties: Required. [Required] Additional attributes of the entity. @@ -9605,19 +10054,19 @@ class EnvironmentContainerProperties(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } def __init__( @@ -9639,11 +10088,19 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(EnvironmentContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) + super(EnvironmentContainerProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs + ) self.provisioning_state = None -class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model): +class EnvironmentContainerResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of EnvironmentContainer entities. :ivar next_link: The link to the next page of EnvironmentContainer objects. If null, there are @@ -9654,8 +10111,8 @@ class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model) """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[EnvironmentContainer]"}, } def __init__( @@ -9672,7 +10129,9 @@ def __init__( :keyword value: An array of objects of type EnvironmentContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] """ - super(EnvironmentContainerResourceArmPaginatedResult, self).__init__(**kwargs) + super(EnvironmentContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -9691,9 +10150,9 @@ class EnvironmentVariable(msrest.serialization.Model): """ _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "additional_properties": {"key": "", "type": "{object}"}, + "type": {"key": "type", "type": "str"}, + "value": {"key": "value", "type": "str"}, } def __init__( @@ -9743,26 +10202,26 @@ class EnvironmentVersion(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentVersionProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "EnvironmentVersionProperties", + }, } def __init__( - self, - *, - properties: "EnvironmentVersionProperties", - **kwargs + self, *, properties: "EnvironmentVersionProperties", **kwargs ): """ :keyword properties: Required. [Required] Additional attributes of the entity. @@ -9830,23 +10289,26 @@ class EnvironmentVersionProperties(AssetBase): """ _validation = { - 'environment_type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "environment_type": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'build': {'key': 'build', 'type': 'BuildContext'}, - 'conda_file': {'key': 'condaFile', 'type': 'str'}, - 'environment_type': {'key': 'environmentType', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'str'}, - 'inference_config': {'key': 'inferenceConfig', 'type': 'InferenceContainerProperties'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "build": {"key": "build", "type": "BuildContext"}, + "conda_file": {"key": "condaFile", "type": "str"}, + "environment_type": {"key": "environmentType", "type": "str"}, + "image": {"key": "image", "type": "str"}, + "inference_config": { + "key": "inferenceConfig", + "type": "InferenceContainerProperties", + }, + "os_type": {"key": "osType", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } def __init__( @@ -9902,7 +10364,14 @@ def __init__( :keyword os_type: The OS type of the environment. Possible values include: "Linux", "Windows". :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.OperatingSystemType """ - super(EnvironmentVersionProperties, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) + super(EnvironmentVersionProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + **kwargs + ) self.build = build self.conda_file = conda_file self.environment_type = None @@ -9923,8 +10392,8 @@ class EnvironmentVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentVersion]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[EnvironmentVersion]"}, } def __init__( @@ -9941,7 +10410,9 @@ def __init__( :keyword value: An array of objects of type EnvironmentVersion. :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] """ - super(EnvironmentVersionResourceArmPaginatedResult, self).__init__(**kwargs) + super(EnvironmentVersionResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -9958,21 +10429,17 @@ class ErrorAdditionalInfo(msrest.serialization.Model): """ _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, + "type": {"readonly": True}, + "info": {"readonly": True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, + "type": {"key": "type", "type": "str"}, + "info": {"key": "info", "type": "object"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ErrorAdditionalInfo, self).__init__(**kwargs) self.type = None self.info = None @@ -9996,27 +10463,26 @@ class ErrorDetail(msrest.serialization.Model): """ _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, + "code": {"readonly": True}, + "message": {"readonly": True}, + "target": {"readonly": True}, + "details": {"readonly": True}, + "additional_info": {"readonly": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[ErrorDetail]"}, + "additional_info": { + "key": "additionalInfo", + "type": "[ErrorAdditionalInfo]", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ErrorDetail, self).__init__(**kwargs) self.code = None self.message = None @@ -10033,15 +10499,10 @@ class ErrorResponse(msrest.serialization.Model): """ _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, + "error": {"key": "error", "type": "ErrorDetail"}, } - def __init__( - self, - *, - error: Optional["ErrorDetail"] = None, - **kwargs - ): + def __init__(self, *, error: Optional["ErrorDetail"] = None, **kwargs): """ :keyword error: The error object. :paramtype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail @@ -10066,15 +10527,15 @@ class EstimatedVMPrice(msrest.serialization.Model): """ _validation = { - 'retail_price': {'required': True}, - 'os_type': {'required': True}, - 'vm_tier': {'required': True}, + "retail_price": {"required": True}, + "os_type": {"required": True}, + "vm_tier": {"required": True}, } _attribute_map = { - 'retail_price': {'key': 'retailPrice', 'type': 'float'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_tier': {'key': 'vmTier', 'type': 'str'}, + "retail_price": {"key": "retailPrice", "type": "float"}, + "os_type": {"key": "osType", "type": "str"}, + "vm_tier": {"key": "vmTier", "type": "str"}, } def __init__( @@ -10118,15 +10579,15 @@ class EstimatedVMPrices(msrest.serialization.Model): """ _validation = { - 'billing_currency': {'required': True}, - 'unit_of_measure': {'required': True}, - 'values': {'required': True}, + "billing_currency": {"required": True}, + "unit_of_measure": {"required": True}, + "values": {"required": True}, } _attribute_map = { - 'billing_currency': {'key': 'billingCurrency', 'type': 'str'}, - 'unit_of_measure': {'key': 'unitOfMeasure', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[EstimatedVMPrice]'}, + "billing_currency": {"key": "billingCurrency", "type": "str"}, + "unit_of_measure": {"key": "unitOfMeasure", "type": "str"}, + "values": {"key": "values", "type": "[EstimatedVMPrice]"}, } def __init__( @@ -10162,14 +10623,11 @@ class ExternalFQDNResponse(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[FQDNEndpoints]'}, + "value": {"key": "value", "type": "[FQDNEndpoints]"}, } def __init__( - self, - *, - value: Optional[List["FQDNEndpoints"]] = None, - **kwargs + self, *, value: Optional[List["FQDNEndpoints"]] = None, **kwargs ): """ :keyword value: @@ -10187,15 +10645,10 @@ class FeaturizationSettings(msrest.serialization.Model): """ _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, + "dataset_language": {"key": "datasetLanguage", "type": "str"}, } - def __init__( - self, - *, - dataset_language: Optional[str] = None, - **kwargs - ): + def __init__(self, *, dataset_language: Optional[str] = None, **kwargs): """ :keyword dataset_language: Dataset language, useful for the text data. :paramtype dataset_language: str @@ -10212,15 +10665,10 @@ class FlavorData(msrest.serialization.Model): """ _attribute_map = { - 'data': {'key': 'data', 'type': '{str}'}, + "data": {"key": "data", "type": "{str}"}, } - def __init__( - self, - *, - data: Optional[Dict[str, str]] = None, - **kwargs - ): + def __init__(self, *, data: Optional[Dict[str, str]] = None, **kwargs): """ :keyword data: Model flavor-specific data. :paramtype data: dict[str, str] @@ -10295,30 +10743,60 @@ class Forecasting(AutoMLVertical, TableVertical): """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'forecasting_settings': {'key': 'forecastingSettings', 'type': 'ForecastingSettings'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'ForecastingTrainingSettings'}, + "task_type": {"required": True}, + "training_data": {"required": True}, + } + + _attribute_map = { + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "TableFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "search_space": { + "key": "searchSpace", + "type": "[TableParameterSubspace]", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "TableSweepSettings", + }, + "test_data": {"key": "testData", "type": "MLTableJobInput"}, + "test_data_size": {"key": "testDataSize", "type": "float"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "weight_column_name": {"key": "weightColumnName", "type": "str"}, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "forecasting_settings": { + "key": "forecastingSettings", + "type": "ForecastingSettings", + }, + "primary_metric": {"key": "primaryMetric", "type": "str"}, + "training_settings": { + "key": "trainingSettings", + "type": "ForecastingTrainingSettings", + }, } def __init__( @@ -10326,7 +10804,9 @@ def __init__( *, training_data: "MLTableJobInput", cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "TableVerticalFeaturizationSettings" + ] = None, fixed_parameters: Optional["TableFixedParameters"] = None, limit_settings: Optional["TableVerticalLimitSettings"] = None, n_cross_validations: Optional["NCrossValidations"] = None, @@ -10340,7 +10820,9 @@ def __init__( log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, forecasting_settings: Optional["ForecastingSettings"] = None, - primary_metric: Optional[Union[str, "ForecastingPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "ForecastingPrimaryMetrics"] + ] = None, training_settings: Optional["ForecastingTrainingSettings"] = None, **kwargs ): @@ -10402,7 +10884,24 @@ def __init__( :paramtype training_settings: ~azure.mgmt.machinelearningservices.models.ForecastingTrainingSettings """ - super(Forecasting, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, cv_split_column_names=cv_split_column_names, featurization_settings=featurization_settings, fixed_parameters=fixed_parameters, limit_settings=limit_settings, n_cross_validations=n_cross_validations, search_space=search_space, sweep_settings=sweep_settings, test_data=test_data, test_data_size=test_data_size, validation_data=validation_data, validation_data_size=validation_data_size, weight_column_name=weight_column_name, **kwargs) + super(Forecasting, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + cv_split_column_names=cv_split_column_names, + featurization_settings=featurization_settings, + fixed_parameters=fixed_parameters, + limit_settings=limit_settings, + n_cross_validations=n_cross_validations, + search_space=search_space, + sweep_settings=sweep_settings, + test_data=test_data, + test_data_size=test_data_size, + validation_data=validation_data, + validation_data_size=validation_data_size, + weight_column_name=weight_column_name, + **kwargs + ) self.cv_split_column_names = cv_split_column_names self.featurization_settings = featurization_settings self.fixed_parameters = fixed_parameters @@ -10415,7 +10914,7 @@ def __init__( self.validation_data = validation_data self.validation_data_size = validation_data_size self.weight_column_name = weight_column_name - self.task_type = 'Forecasting' # type: str + self.task_type = "Forecasting" # type: str self.forecasting_settings = forecasting_settings self.primary_metric = primary_metric self.training_settings = training_settings @@ -10479,19 +10978,37 @@ class ForecastingSettings(msrest.serialization.Model): """ _attribute_map = { - 'country_or_region_for_holidays': {'key': 'countryOrRegionForHolidays', 'type': 'str'}, - 'cv_step_size': {'key': 'cvStepSize', 'type': 'int'}, - 'feature_lags': {'key': 'featureLags', 'type': 'str'}, - 'forecast_horizon': {'key': 'forecastHorizon', 'type': 'ForecastHorizon'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'seasonality': {'key': 'seasonality', 'type': 'Seasonality'}, - 'short_series_handling_config': {'key': 'shortSeriesHandlingConfig', 'type': 'str'}, - 'target_aggregate_function': {'key': 'targetAggregateFunction', 'type': 'str'}, - 'target_lags': {'key': 'targetLags', 'type': 'TargetLags'}, - 'target_rolling_window_size': {'key': 'targetRollingWindowSize', 'type': 'TargetRollingWindowSize'}, - 'time_column_name': {'key': 'timeColumnName', 'type': 'str'}, - 'time_series_id_column_names': {'key': 'timeSeriesIdColumnNames', 'type': '[str]'}, - 'use_stl': {'key': 'useStl', 'type': 'str'}, + "country_or_region_for_holidays": { + "key": "countryOrRegionForHolidays", + "type": "str", + }, + "cv_step_size": {"key": "cvStepSize", "type": "int"}, + "feature_lags": {"key": "featureLags", "type": "str"}, + "forecast_horizon": { + "key": "forecastHorizon", + "type": "ForecastHorizon", + }, + "frequency": {"key": "frequency", "type": "str"}, + "seasonality": {"key": "seasonality", "type": "Seasonality"}, + "short_series_handling_config": { + "key": "shortSeriesHandlingConfig", + "type": "str", + }, + "target_aggregate_function": { + "key": "targetAggregateFunction", + "type": "str", + }, + "target_lags": {"key": "targetLags", "type": "TargetLags"}, + "target_rolling_window_size": { + "key": "targetRollingWindowSize", + "type": "TargetRollingWindowSize", + }, + "time_column_name": {"key": "timeColumnName", "type": "str"}, + "time_series_id_column_names": { + "key": "timeSeriesIdColumnNames", + "type": "[str]", + }, + "use_stl": {"key": "useStl", "type": "str"}, } def __init__( @@ -10503,8 +11020,12 @@ def __init__( forecast_horizon: Optional["ForecastHorizon"] = None, frequency: Optional[str] = None, seasonality: Optional["Seasonality"] = None, - short_series_handling_config: Optional[Union[str, "ShortSeriesHandlingConfiguration"]] = None, - target_aggregate_function: Optional[Union[str, "TargetAggregationFunction"]] = None, + short_series_handling_config: Optional[ + Union[str, "ShortSeriesHandlingConfiguration"] + ] = None, + target_aggregate_function: Optional[ + Union[str, "TargetAggregationFunction"] + ] = None, target_lags: Optional["TargetLags"] = None, target_rolling_window_size: Optional["TargetRollingWindowSize"] = None, time_column_name: Optional[str] = None, @@ -10610,15 +11131,36 @@ class ForecastingTrainingSettings(TrainingSettings): """ _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, + "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, + "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, + "allowed_training_algorithms": { + "key": "allowedTrainingAlgorithms", + "type": "[str]", + }, + "blocked_training_algorithms": { + "key": "blockedTrainingAlgorithms", + "type": "[str]", + }, } def __init__( @@ -10631,8 +11173,12 @@ def __init__( enable_vote_ensemble: Optional[bool] = True, ensemble_model_download_timeout: Optional[datetime.timedelta] = "PT5M", stack_ensemble_settings: Optional["StackEnsembleSettings"] = None, - allowed_training_algorithms: Optional[List[Union[str, "ForecastingModels"]]] = None, - blocked_training_algorithms: Optional[List[Union[str, "ForecastingModels"]]] = None, + allowed_training_algorithms: Optional[ + List[Union[str, "ForecastingModels"]] + ] = None, + blocked_training_algorithms: Optional[ + List[Union[str, "ForecastingModels"]] + ] = None, **kwargs ): """ @@ -10660,7 +11206,16 @@ def __init__( :paramtype blocked_training_algorithms: list[str or ~azure.mgmt.machinelearningservices.models.ForecastingModels] """ - super(ForecastingTrainingSettings, self).__init__(enable_dnn_training=enable_dnn_training, enable_model_explainability=enable_model_explainability, enable_onnx_compatible_models=enable_onnx_compatible_models, enable_stack_ensemble=enable_stack_ensemble, enable_vote_ensemble=enable_vote_ensemble, ensemble_model_download_timeout=ensemble_model_download_timeout, stack_ensemble_settings=stack_ensemble_settings, **kwargs) + super(ForecastingTrainingSettings, self).__init__( + enable_dnn_training=enable_dnn_training, + enable_model_explainability=enable_model_explainability, + enable_onnx_compatible_models=enable_onnx_compatible_models, + enable_stack_ensemble=enable_stack_ensemble, + enable_vote_ensemble=enable_vote_ensemble, + ensemble_model_download_timeout=ensemble_model_download_timeout, + stack_ensemble_settings=stack_ensemble_settings, + **kwargs + ) self.allowed_training_algorithms = allowed_training_algorithms self.blocked_training_algorithms = blocked_training_algorithms @@ -10675,8 +11230,11 @@ class FQDNEndpoint(msrest.serialization.Model): """ _attribute_map = { - 'domain_name': {'key': 'domainName', 'type': 'str'}, - 'endpoint_details': {'key': 'endpointDetails', 'type': '[FQDNEndpointDetail]'}, + "domain_name": {"key": "domainName", "type": "str"}, + "endpoint_details": { + "key": "endpointDetails", + "type": "[FQDNEndpointDetail]", + }, } def __init__( @@ -10706,15 +11264,10 @@ class FQDNEndpointDetail(msrest.serialization.Model): """ _attribute_map = { - 'port': {'key': 'port', 'type': 'int'}, + "port": {"key": "port", "type": "int"}, } - def __init__( - self, - *, - port: Optional[int] = None, - **kwargs - ): + def __init__(self, *, port: Optional[int] = None, **kwargs): """ :keyword port: :paramtype port: int @@ -10731,7 +11284,7 @@ class FQDNEndpoints(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'FQDNEndpointsProperties'}, + "properties": {"key": "properties", "type": "FQDNEndpointsProperties"}, } def __init__( @@ -10758,8 +11311,8 @@ class FQDNEndpointsProperties(msrest.serialization.Model): """ _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'endpoints': {'key': 'endpoints', 'type': '[FQDNEndpoint]'}, + "category": {"key": "category", "type": "str"}, + "endpoints": {"key": "endpoints", "type": "[FQDNEndpoint]"}, } def __init__( @@ -10793,21 +11346,20 @@ class GridSamplingAlgorithm(SamplingAlgorithm): """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(GridSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Grid' # type: str + self.sampling_algorithm_type = "Grid" # type: str class HdfsDatastore(DatastoreProperties): @@ -10842,22 +11394,25 @@ class HdfsDatastore(DatastoreProperties): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'name_node_address': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "name_node_address": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'hdfs_server_certificate': {'key': 'hdfsServerCertificate', 'type': 'str'}, - 'name_node_address': {'key': 'nameNodeAddress', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "hdfs_server_certificate": { + "key": "hdfsServerCertificate", + "type": "str", + }, + "name_node_address": {"key": "nameNodeAddress", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, } def __init__( @@ -10889,8 +11444,14 @@ def __init__( :keyword protocol: Protocol used to communicate with the storage account (Https/Http). :paramtype protocol: str """ - super(HdfsDatastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, **kwargs) - self.datastore_type = 'Hdfs' # type: str + super(HdfsDatastore, self).__init__( + description=description, + properties=properties, + tags=tags, + credentials=credentials, + **kwargs + ) + self.datastore_type = "Hdfs" # type: str self.hdfs_server_certificate = hdfs_server_certificate self.name_node_address = name_node_address self.protocol = protocol @@ -10904,14 +11465,11 @@ class HDInsightSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, + "properties": {"key": "properties", "type": "HDInsightProperties"}, } def __init__( - self, - *, - properties: Optional["HDInsightProperties"] = None, - **kwargs + self, *, properties: Optional["HDInsightProperties"] = None, **kwargs ): """ :keyword properties: HDInsight compute properties. @@ -10960,28 +11518,31 @@ class HDInsight(Compute, HDInsightSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + "disable_local_auth": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "HDInsightProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -11000,9 +11561,14 @@ def __init__( :keyword resource_id: ARM resource id of the underlying compute. :paramtype resource_id: str """ - super(HDInsight, self).__init__(description=description, resource_id=resource_id, properties=properties, **kwargs) + super(HDInsight, self).__init__( + description=description, + resource_id=resource_id, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'HDInsight' # type: str + self.compute_type = "HDInsight" # type: str self.compute_location = None self.provisioning_state = None self.description = description @@ -11027,9 +11593,12 @@ class HDInsightProperties(msrest.serialization.Model): """ _attribute_map = { - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, + "ssh_port": {"key": "sshPort", "type": "int"}, + "address": {"key": "address", "type": "str"}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, } def __init__( @@ -11068,27 +11637,22 @@ class IdAssetReference(AssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, - 'asset_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "reference_type": {"required": True}, + "asset_id": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'asset_id': {'key': 'assetId', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "asset_id": {"key": "assetId", "type": "str"}, } - def __init__( - self, - *, - asset_id: str, - **kwargs - ): + def __init__(self, *, asset_id: str, **kwargs): """ :keyword asset_id: Required. [Required] ARM resource ID of the asset. :paramtype asset_id: str """ super(IdAssetReference, self).__init__(**kwargs) - self.reference_type = 'Id' # type: str + self.reference_type = "Id" # type: str self.asset_id = asset_id @@ -11101,14 +11665,14 @@ class IdentityForCmk(msrest.serialization.Model): """ _attribute_map = { - 'user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, + "user_assigned_identity": { + "key": "userAssignedIdentity", + "type": "str", + }, } def __init__( - self, - *, - user_assigned_identity: Optional[str] = None, - **kwargs + self, *, user_assigned_identity: Optional[str] = None, **kwargs ): """ :keyword user_assigned_identity: The ArmId of the user assigned identity that will be used to @@ -11128,14 +11692,14 @@ class IdleShutdownSetting(msrest.serialization.Model): """ _attribute_map = { - 'idle_time_before_shutdown': {'key': 'idleTimeBeforeShutdown', 'type': 'str'}, + "idle_time_before_shutdown": { + "key": "idleTimeBeforeShutdown", + "type": "str", + }, } def __init__( - self, - *, - idle_time_before_shutdown: Optional[str] = None, - **kwargs + self, *, idle_time_before_shutdown: Optional[str] = None, **kwargs ): """ :keyword idle_time_before_shutdown: Time is defined in ISO8601 format. Minimum is 15 min, @@ -11160,9 +11724,9 @@ class Image(msrest.serialization.Model): """ _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'reference': {'key': 'reference', 'type': 'str'}, + "additional_properties": {"key": "", "type": "{object}"}, + "type": {"key": "type", "type": "str"}, + "reference": {"key": "reference", "type": "str"}, } def __init__( @@ -11191,32 +11755,41 @@ def __init__( class ImageVertical(msrest.serialization.Model): """Abstract class for AutoML tasks that train image (computer vision) models - -such as Image Classification / Image Classification Multilabel / Image Object Detection / Image Instance Segmentation. + such as Image Classification / Image Classification Multilabel / Image Object Detection / Image Instance Segmentation. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float """ _validation = { - 'limit_settings': {'required': True}, + "limit_settings": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, } def __init__( @@ -11274,16 +11847,31 @@ class ImageClassificationBase(ImageVertical): """ _validation = { - 'limit_settings': {'required': True}, + "limit_settings": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsClassification", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsClassification]", + }, } def __init__( @@ -11294,7 +11882,9 @@ def __init__( validation_data: Optional["MLTableJobInput"] = None, validation_data_size: Optional[float] = None, model_settings: Optional["ImageModelSettingsClassification"] = None, - search_space: Optional[List["ImageModelDistributionSettingsClassification"]] = None, + search_space: Optional[ + List["ImageModelDistributionSettingsClassification"] + ] = None, **kwargs ): """ @@ -11317,73 +11907,94 @@ def __init__( :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] """ - super(ImageClassificationBase, self).__init__(limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, **kwargs) + super(ImageClassificationBase, self).__init__( + limit_settings=limit_settings, + sweep_settings=sweep_settings, + validation_data=validation_data, + validation_data_size=validation_data_size, + **kwargs + ) self.model_settings = model_settings self.search_space = search_space class ImageClassification(AutoMLVertical, ImageClassificationBase): """Image Classification. Multi-class image classification is used when an image is classified with only a single label -from a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' or a 'duck'. + from a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' or a 'duck'. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, + "limit_settings": {"required": True}, + "task_type": {"required": True}, + "training_data": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsClassification", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsClassification]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( @@ -11395,10 +12006,14 @@ def __init__( validation_data: Optional["MLTableJobInput"] = None, validation_data_size: Optional[float] = None, model_settings: Optional["ImageModelSettingsClassification"] = None, - search_space: Optional[List["ImageModelDistributionSettingsClassification"]] = None, + search_space: Optional[ + List["ImageModelDistributionSettingsClassification"] + ] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "ClassificationPrimaryMetrics"] + ] = None, **kwargs ): """ @@ -11434,14 +12049,25 @@ def __init__( :paramtype primary_metric: str or ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ - super(ImageClassification, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, model_settings=model_settings, search_space=search_space, **kwargs) + super(ImageClassification, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + limit_settings=limit_settings, + sweep_settings=sweep_settings, + validation_data=validation_data, + validation_data_size=validation_data_size, + model_settings=model_settings, + search_space=search_space, + **kwargs + ) self.limit_settings = limit_settings self.sweep_settings = sweep_settings self.validation_data = validation_data self.validation_data_size = validation_data_size self.model_settings = model_settings self.search_space = search_space - self.task_type = 'ImageClassification' # type: str + self.task_type = "ImageClassification" # type: str self.primary_metric = primary_metric self.log_verbosity = log_verbosity self.target_column_name = target_column_name @@ -11450,66 +12076,81 @@ def __init__( class ImageClassificationMultilabel(AutoMLVertical, ImageClassificationBase): """Image Classification Multilabel. Multi-label image classification is used when an image could have one or more labels -from a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'. + from a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted", "IOU". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics """ _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, + "limit_settings": {"required": True}, + "task_type": {"required": True}, + "training_data": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsClassification", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsClassification]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( @@ -11521,10 +12162,14 @@ def __init__( validation_data: Optional["MLTableJobInput"] = None, validation_data_size: Optional[float] = None, model_settings: Optional["ImageModelSettingsClassification"] = None, - search_space: Optional[List["ImageModelDistributionSettingsClassification"]] = None, + search_space: Optional[ + List["ImageModelDistributionSettingsClassification"] + ] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationMultilabelPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "ClassificationMultilabelPrimaryMetrics"] + ] = None, **kwargs ): """ @@ -11560,14 +12205,25 @@ def __init__( :paramtype primary_metric: str or ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics """ - super(ImageClassificationMultilabel, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, model_settings=model_settings, search_space=search_space, **kwargs) + super(ImageClassificationMultilabel, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + limit_settings=limit_settings, + sweep_settings=sweep_settings, + validation_data=validation_data, + validation_data_size=validation_data_size, + model_settings=model_settings, + search_space=search_space, + **kwargs + ) self.limit_settings = limit_settings self.sweep_settings = sweep_settings self.validation_data = validation_data self.validation_data_size = validation_data_size self.model_settings = model_settings self.search_space = search_space - self.task_type = 'ImageClassificationMultilabel' # type: str + self.task_type = "ImageClassificationMultilabel" # type: str self.primary_metric = primary_metric self.log_verbosity = log_verbosity self.target_column_name = target_column_name @@ -11600,16 +12256,31 @@ class ImageObjectDetectionBase(ImageVertical): """ _validation = { - 'limit_settings': {'required': True}, + "limit_settings": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsObjectDetection", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsObjectDetection]", + }, } def __init__( @@ -11620,7 +12291,9 @@ def __init__( validation_data: Optional["MLTableJobInput"] = None, validation_data_size: Optional[float] = None, model_settings: Optional["ImageModelSettingsObjectDetection"] = None, - search_space: Optional[List["ImageModelDistributionSettingsObjectDetection"]] = None, + search_space: Optional[ + List["ImageModelDistributionSettingsObjectDetection"] + ] = None, **kwargs ): """ @@ -11643,72 +12316,93 @@ def __init__( :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] """ - super(ImageObjectDetectionBase, self).__init__(limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, **kwargs) + super(ImageObjectDetectionBase, self).__init__( + limit_settings=limit_settings, + sweep_settings=sweep_settings, + validation_data=validation_data, + validation_data_size=validation_data_size, + **kwargs + ) self.model_settings = model_settings self.search_space = search_space class ImageInstanceSegmentation(AutoMLVertical, ImageObjectDetectionBase): """Image Instance Segmentation. Instance segmentation is used to identify objects in an image at the pixel level, -drawing a polygon around each object in the image. + drawing a polygon around each object in the image. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "MeanAveragePrecision". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics """ _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, + "limit_settings": {"required": True}, + "task_type": {"required": True}, + "training_data": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsObjectDetection", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsObjectDetection]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( @@ -11720,10 +12414,14 @@ def __init__( validation_data: Optional["MLTableJobInput"] = None, validation_data_size: Optional[float] = None, model_settings: Optional["ImageModelSettingsObjectDetection"] = None, - search_space: Optional[List["ImageModelDistributionSettingsObjectDetection"]] = None, + search_space: Optional[ + List["ImageModelDistributionSettingsObjectDetection"] + ] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "InstanceSegmentationPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "InstanceSegmentationPrimaryMetrics"] + ] = None, **kwargs ): """ @@ -11758,14 +12456,25 @@ def __init__( :paramtype primary_metric: str or ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics """ - super(ImageInstanceSegmentation, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, model_settings=model_settings, search_space=search_space, **kwargs) + super(ImageInstanceSegmentation, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + limit_settings=limit_settings, + sweep_settings=sweep_settings, + validation_data=validation_data, + validation_data_size=validation_data_size, + model_settings=model_settings, + search_space=search_space, + **kwargs + ) self.limit_settings = limit_settings self.sweep_settings = sweep_settings self.validation_data = validation_data self.validation_data_size = validation_data_size self.model_settings = model_settings self.search_space = search_space - self.task_type = 'ImageInstanceSegmentation' # type: str + self.task_type = "ImageInstanceSegmentation" # type: str self.primary_metric = primary_metric self.log_verbosity = log_verbosity self.target_column_name = target_column_name @@ -11784,9 +12493,9 @@ class ImageLimitSettings(msrest.serialization.Model): """ _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_trials": {"key": "maxTrials", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } def __init__( @@ -11825,9 +12534,12 @@ class ImageMetadata(msrest.serialization.Model): """ _attribute_map = { - 'current_image_version': {'key': 'currentImageVersion', 'type': 'str'}, - 'latest_image_version': {'key': 'latestImageVersion', 'type': 'str'}, - 'is_latest_os_image_version': {'key': 'isLatestOsImageVersion', 'type': 'bool'}, + "current_image_version": {"key": "currentImageVersion", "type": "str"}, + "latest_image_version": {"key": "latestImageVersion", "type": "str"}, + "is_latest_os_image_version": { + "key": "isLatestOsImageVersion", + "type": "bool", + }, } def __init__( @@ -11857,129 +12569,147 @@ def __init__( class ImageModelDistributionSettings(msrest.serialization.Model): """Distribution expressions to sweep over values of model settings. -:code:` -Some examples are: - -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -` -All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) -where distribution name can be: uniform, quniform, loguniform, etc -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, + :code:` + Some examples are: + + ModelName = "choice('seresnext', 'resnest50')"; + LearningRate = "uniform(0.001, 0.01)"; + LayersToFreeze = "choice(0, 2)"; + ` + All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) + where distribution name can be: uniform, quniform, loguniform, etc + For more details on how to compose distribution expressions please check the documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: str + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: str + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: str + :ivar distributed: Whether to use distributer training. + :vartype distributed: str + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: str + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: str + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: str + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: str + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: str + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: str + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: str + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: str + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. + :vartype learning_rate_scheduler: str + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: str + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: str + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: str + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: str + :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. + :vartype optimizer: str + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: str + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: str + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: str + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: str + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: str + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: str + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: str + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: str + """ + + _attribute_map = { + "ams_gradient": {"key": "amsGradient", "type": "str"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "str"}, + "beta2": {"key": "beta2", "type": "str"}, + "distributed": {"key": "distributed", "type": "str"}, + "early_stopping": {"key": "earlyStopping", "type": "str"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "str"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "str", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "str", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "str"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "str", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "str"}, + "nesterov": {"key": "nesterov", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "str"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "str"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "str"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "str"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "str"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "str", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "str", + }, + "weight_decay": {"key": "weightDecay", "type": "str"}, } def __init__( @@ -12128,147 +12858,170 @@ def __init__( self.weight_decay = weight_decay -class ImageModelDistributionSettingsClassification(ImageModelDistributionSettings): +class ImageModelDistributionSettingsClassification( + ImageModelDistributionSettings +): """Distribution expressions to sweep over values of model settings. -:code:` -Some examples are: - -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: str - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: str - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: str - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'str'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'str'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'str'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'str'}, + :code:` + Some examples are: + + ModelName = "choice('seresnext', 'resnest50')"; + LearningRate = "uniform(0.001, 0.01)"; + LayersToFreeze = "choice(0, 2)"; + ` + For more details on how to compose distribution expressions please check the documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: str + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: str + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: str + :ivar distributed: Whether to use distributer training. + :vartype distributed: str + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: str + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: str + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: str + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: str + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: str + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: str + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: str + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: str + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. + :vartype learning_rate_scheduler: str + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: str + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: str + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: str + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: str + :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. + :vartype optimizer: str + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: str + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: str + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: str + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: str + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: str + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: str + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: str + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: str + :ivar training_crop_size: Image crop size that is input to the neural network for the training + dataset. Must be a positive integer. + :vartype training_crop_size: str + :ivar validation_crop_size: Image crop size that is input to the neural network for the + validation dataset. Must be a positive integer. + :vartype validation_crop_size: str + :ivar validation_resize_size: Image size to which to resize before cropping for validation + dataset. Must be a positive integer. + :vartype validation_resize_size: str + :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. + 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be + 0 or 1 or 2. + :vartype weighted_loss: str + """ + + _attribute_map = { + "ams_gradient": {"key": "amsGradient", "type": "str"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "str"}, + "beta2": {"key": "beta2", "type": "str"}, + "distributed": {"key": "distributed", "type": "str"}, + "early_stopping": {"key": "earlyStopping", "type": "str"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "str"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "str", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "str", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "str"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "str", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "str"}, + "nesterov": {"key": "nesterov", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "str"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "str"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "str"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "str"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "str"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "str", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "str", + }, + "weight_decay": {"key": "weightDecay", "type": "str"}, + "training_crop_size": {"key": "trainingCropSize", "type": "str"}, + "validation_crop_size": {"key": "validationCropSize", "type": "str"}, + "validation_resize_size": { + "key": "validationResizeSize", + "type": "str", + }, + "weighted_loss": {"key": "weightedLoss", "type": "str"}, } def __init__( @@ -12403,202 +13156,264 @@ def __init__( 0 or 1 or 2. :paramtype weighted_loss: str """ - super(ImageModelDistributionSettingsClassification, self).__init__(ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) + super(ImageModelDistributionSettingsClassification, self).__init__( + ams_gradient=ams_gradient, + augmentations=augmentations, + beta1=beta1, + beta2=beta2, + distributed=distributed, + early_stopping=early_stopping, + early_stopping_delay=early_stopping_delay, + early_stopping_patience=early_stopping_patience, + enable_onnx_normalization=enable_onnx_normalization, + evaluation_frequency=evaluation_frequency, + gradient_accumulation_step=gradient_accumulation_step, + layers_to_freeze=layers_to_freeze, + learning_rate=learning_rate, + learning_rate_scheduler=learning_rate_scheduler, + model_name=model_name, + momentum=momentum, + nesterov=nesterov, + number_of_epochs=number_of_epochs, + number_of_workers=number_of_workers, + optimizer=optimizer, + random_seed=random_seed, + step_lr_gamma=step_lr_gamma, + step_lr_step_size=step_lr_step_size, + training_batch_size=training_batch_size, + validation_batch_size=validation_batch_size, + warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, + warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, + weight_decay=weight_decay, + **kwargs + ) self.training_crop_size = training_crop_size self.validation_crop_size = validation_crop_size self.validation_resize_size = validation_resize_size self.weighted_loss = weighted_loss -class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettings): +class ImageModelDistributionSettingsObjectDetection( + ImageModelDistributionSettings +): """Distribution expressions to sweep over values of model settings. -:code:` -Some examples are: - -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: str - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: str - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: str - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: str - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: str - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype model_size: str - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: str - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - float in the range [0, 1]. - :vartype nms_iou_threshold: str - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: str - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - NMS: Non-maximum suppression. - :vartype tile_predictions_nms_threshold: str - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: str - :ivar validation_metric_type: Metric computation method to use for validation metrics. Must be - 'none', 'coco', 'voc', or 'coco_voc'. - :vartype validation_metric_type: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'str'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'str'}, - 'image_size': {'key': 'imageSize', 'type': 'str'}, - 'max_size': {'key': 'maxSize', 'type': 'str'}, - 'min_size': {'key': 'minSize', 'type': 'str'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'str'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'str'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'str'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'str'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'str'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, + :code:` + Some examples are: + + ModelName = "choice('seresnext', 'resnest50')"; + LearningRate = "uniform(0.001, 0.01)"; + LayersToFreeze = "choice(0, 2)"; + ` + For more details on how to compose distribution expressions please check the documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: str + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: str + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: str + :ivar distributed: Whether to use distributer training. + :vartype distributed: str + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: str + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: str + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: str + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: str + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: str + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: str + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: str + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: str + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. + :vartype learning_rate_scheduler: str + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: str + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: str + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: str + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: str + :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. + :vartype optimizer: str + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: str + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: str + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: str + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: str + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: str + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: str + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: str + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: str + :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must + be a positive integer. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype box_detections_per_image: str + :ivar box_score_threshold: During inference, only return proposals with a classification score + greater than + BoxScoreThreshold. Must be a float in the range[0, 1]. + :vartype box_score_threshold: str + :ivar image_size: Image size for train and validation. Must be a positive integer. + Note: The training run may get into CUDA OOM if the size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype image_size: str + :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype max_size: str + :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype min_size: str + :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. + Note: training run may get into CUDA OOM if the model size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype model_size: str + :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. + Note: training run may get into CUDA OOM if no sufficient GPU memory. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype multi_scale: str + :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be + float in the range [0, 1]. + :vartype nms_iou_threshold: str + :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not + be + None to enable small object detection logic. A string containing two integers in mxn format. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_grid_size: str + :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float + in the range [0, 1). + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_overlap_ratio: str + :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging + predictions from tiles and image. + Used in validation/ inference. Must be float in the range [0, 1]. + Note: This settings is not supported for the 'yolov5' algorithm. + NMS: Non-maximum suppression. + :vartype tile_predictions_nms_threshold: str + :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be + float in the range [0, 1]. + :vartype validation_iou_threshold: str + :ivar validation_metric_type: Metric computation method to use for validation metrics. Must be + 'none', 'coco', 'voc', or 'coco_voc'. + :vartype validation_metric_type: str + """ + + _attribute_map = { + "ams_gradient": {"key": "amsGradient", "type": "str"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "str"}, + "beta2": {"key": "beta2", "type": "str"}, + "distributed": {"key": "distributed", "type": "str"}, + "early_stopping": {"key": "earlyStopping", "type": "str"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "str"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "str", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "str", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "str"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "str", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "str"}, + "nesterov": {"key": "nesterov", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "str"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "str"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "str"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "str"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "str"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "str", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "str", + }, + "weight_decay": {"key": "weightDecay", "type": "str"}, + "box_detections_per_image": { + "key": "boxDetectionsPerImage", + "type": "str", + }, + "box_score_threshold": {"key": "boxScoreThreshold", "type": "str"}, + "image_size": {"key": "imageSize", "type": "str"}, + "max_size": {"key": "maxSize", "type": "str"}, + "min_size": {"key": "minSize", "type": "str"}, + "model_size": {"key": "modelSize", "type": "str"}, + "multi_scale": {"key": "multiScale", "type": "str"}, + "nms_iou_threshold": {"key": "nmsIouThreshold", "type": "str"}, + "tile_grid_size": {"key": "tileGridSize", "type": "str"}, + "tile_overlap_ratio": {"key": "tileOverlapRatio", "type": "str"}, + "tile_predictions_nms_threshold": { + "key": "tilePredictionsNmsThreshold", + "type": "str", + }, + "validation_iou_threshold": { + "key": "validationIouThreshold", + "type": "str", + }, + "validation_metric_type": { + "key": "validationMetricType", + "type": "str", + }, } def __init__( @@ -12781,7 +13596,37 @@ def __init__( be 'none', 'coco', 'voc', or 'coco_voc'. :paramtype validation_metric_type: str """ - super(ImageModelDistributionSettingsObjectDetection, self).__init__(ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) + super(ImageModelDistributionSettingsObjectDetection, self).__init__( + ams_gradient=ams_gradient, + augmentations=augmentations, + beta1=beta1, + beta2=beta2, + distributed=distributed, + early_stopping=early_stopping, + early_stopping_delay=early_stopping_delay, + early_stopping_patience=early_stopping_patience, + enable_onnx_normalization=enable_onnx_normalization, + evaluation_frequency=evaluation_frequency, + gradient_accumulation_step=gradient_accumulation_step, + layers_to_freeze=layers_to_freeze, + learning_rate=learning_rate, + learning_rate_scheduler=learning_rate_scheduler, + model_name=model_name, + momentum=momentum, + nesterov=nesterov, + number_of_epochs=number_of_epochs, + number_of_workers=number_of_workers, + optimizer=optimizer, + random_seed=random_seed, + step_lr_gamma=step_lr_gamma, + step_lr_step_size=step_lr_step_size, + training_batch_size=training_batch_size, + validation_batch_size=validation_batch_size, + warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, + warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, + weight_decay=weight_decay, + **kwargs + ) self.box_detections_per_image = box_detections_per_image self.box_score_threshold = box_score_threshold self.image_size = image_size @@ -12799,132 +13644,153 @@ def __init__( class ImageModelSettings(msrest.serialization.Model): """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar advanced_settings: Settings for advanced scenarios. + :vartype advanced_settings: str + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: bool + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: float + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: float + :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. + :vartype checkpoint_frequency: int + :ivar checkpoint_model: The pretrained checkpoint model for incremental training. + :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput + :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for + incremental training. + :vartype checkpoint_run_id: str + :ivar distributed: Whether to use distributed training. + :vartype distributed: bool + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: bool + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: int + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: int + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: bool + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: int + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: int + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: int + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: float + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. Possible values include: "None", "WarmupCosine", "Step". + :vartype learning_rate_scheduler: str or + ~azure.mgmt.machinelearningservices.models.LearningRateScheduler + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: float + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: bool + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: int + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: int + :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". + :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: int + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: float + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: int + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: int + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: int + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: float + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: int + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: float + """ + + _attribute_map = { + "advanced_settings": {"key": "advancedSettings", "type": "str"}, + "ams_gradient": {"key": "amsGradient", "type": "bool"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "float"}, + "beta2": {"key": "beta2", "type": "float"}, + "checkpoint_frequency": {"key": "checkpointFrequency", "type": "int"}, + "checkpoint_model": { + "key": "checkpointModel", + "type": "MLFlowModelJobInput", + }, + "checkpoint_run_id": {"key": "checkpointRunId", "type": "str"}, + "distributed": {"key": "distributed", "type": "bool"}, + "early_stopping": {"key": "earlyStopping", "type": "bool"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "int"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "int", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "bool", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "int"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "int", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "int"}, + "learning_rate": {"key": "learningRate", "type": "float"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "float"}, + "nesterov": {"key": "nesterov", "type": "bool"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "int"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "int"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "int"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "float"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "int"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "float", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "int", + }, + "weight_decay": {"key": "weightDecay", "type": "float"}, } def __init__( @@ -12947,7 +13813,9 @@ def __init__( gradient_accumulation_step: Optional[int] = None, layers_to_freeze: Optional[int] = None, learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "LearningRateScheduler"]] = None, + learning_rate_scheduler: Optional[ + Union[str, "LearningRateScheduler"] + ] = None, model_name: Optional[str] = None, momentum: Optional[float] = None, nesterov: Optional[bool] = None, @@ -13094,149 +13962,173 @@ def __init__( class ImageModelSettingsClassification(ImageModelSettings): """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: int - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: int - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: int - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: int - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'int'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'int'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'int'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'int'}, + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar advanced_settings: Settings for advanced scenarios. + :vartype advanced_settings: str + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: bool + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: float + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: float + :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. + :vartype checkpoint_frequency: int + :ivar checkpoint_model: The pretrained checkpoint model for incremental training. + :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput + :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for + incremental training. + :vartype checkpoint_run_id: str + :ivar distributed: Whether to use distributed training. + :vartype distributed: bool + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: bool + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: int + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: int + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: bool + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: int + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: int + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: int + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: float + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. Possible values include: "None", "WarmupCosine", "Step". + :vartype learning_rate_scheduler: str or + ~azure.mgmt.machinelearningservices.models.LearningRateScheduler + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: float + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: bool + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: int + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: int + :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". + :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: int + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: float + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: int + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: int + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: int + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: float + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: int + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: float + :ivar training_crop_size: Image crop size that is input to the neural network for the training + dataset. Must be a positive integer. + :vartype training_crop_size: int + :ivar validation_crop_size: Image crop size that is input to the neural network for the + validation dataset. Must be a positive integer. + :vartype validation_crop_size: int + :ivar validation_resize_size: Image size to which to resize before cropping for validation + dataset. Must be a positive integer. + :vartype validation_resize_size: int + :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. + 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be + 0 or 1 or 2. + :vartype weighted_loss: int + """ + + _attribute_map = { + "advanced_settings": {"key": "advancedSettings", "type": "str"}, + "ams_gradient": {"key": "amsGradient", "type": "bool"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "float"}, + "beta2": {"key": "beta2", "type": "float"}, + "checkpoint_frequency": {"key": "checkpointFrequency", "type": "int"}, + "checkpoint_model": { + "key": "checkpointModel", + "type": "MLFlowModelJobInput", + }, + "checkpoint_run_id": {"key": "checkpointRunId", "type": "str"}, + "distributed": {"key": "distributed", "type": "bool"}, + "early_stopping": {"key": "earlyStopping", "type": "bool"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "int"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "int", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "bool", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "int"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "int", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "int"}, + "learning_rate": {"key": "learningRate", "type": "float"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "float"}, + "nesterov": {"key": "nesterov", "type": "bool"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "int"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "int"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "int"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "float"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "int"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "float", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "int", + }, + "weight_decay": {"key": "weightDecay", "type": "float"}, + "training_crop_size": {"key": "trainingCropSize", "type": "int"}, + "validation_crop_size": {"key": "validationCropSize", "type": "int"}, + "validation_resize_size": { + "key": "validationResizeSize", + "type": "int", + }, + "weighted_loss": {"key": "weightedLoss", "type": "int"}, } def __init__( @@ -13259,7 +14151,9 @@ def __init__( gradient_accumulation_step: Optional[int] = None, layers_to_freeze: Optional[int] = None, learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "LearningRateScheduler"]] = None, + learning_rate_scheduler: Optional[ + Union[str, "LearningRateScheduler"] + ] = None, model_name: Optional[str] = None, momentum: Optional[float] = None, nesterov: Optional[bool] = None, @@ -13386,207 +14280,274 @@ def __init__( 0 or 1 or 2. :paramtype weighted_loss: int """ - super(ImageModelSettingsClassification, self).__init__(advanced_settings=advanced_settings, ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, checkpoint_frequency=checkpoint_frequency, checkpoint_model=checkpoint_model, checkpoint_run_id=checkpoint_run_id, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) + super(ImageModelSettingsClassification, self).__init__( + advanced_settings=advanced_settings, + ams_gradient=ams_gradient, + augmentations=augmentations, + beta1=beta1, + beta2=beta2, + checkpoint_frequency=checkpoint_frequency, + checkpoint_model=checkpoint_model, + checkpoint_run_id=checkpoint_run_id, + distributed=distributed, + early_stopping=early_stopping, + early_stopping_delay=early_stopping_delay, + early_stopping_patience=early_stopping_patience, + enable_onnx_normalization=enable_onnx_normalization, + evaluation_frequency=evaluation_frequency, + gradient_accumulation_step=gradient_accumulation_step, + layers_to_freeze=layers_to_freeze, + learning_rate=learning_rate, + learning_rate_scheduler=learning_rate_scheduler, + model_name=model_name, + momentum=momentum, + nesterov=nesterov, + number_of_epochs=number_of_epochs, + number_of_workers=number_of_workers, + optimizer=optimizer, + random_seed=random_seed, + step_lr_gamma=step_lr_gamma, + step_lr_step_size=step_lr_step_size, + training_batch_size=training_batch_size, + validation_batch_size=validation_batch_size, + warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, + warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, + weight_decay=weight_decay, + **kwargs + ) self.training_crop_size = training_crop_size self.validation_crop_size = validation_crop_size self.validation_resize_size = validation_resize_size self.weighted_loss = weighted_loss -class ImageModelSettingsObjectDetection(ImageModelSettings): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: int - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: float - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: int - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: int - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: int - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: - "None", "Small", "Medium", "Large", "ExtraLarge". - :vartype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: bool - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be a - float in the range [0, 1]. - :vartype nms_iou_threshold: float - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: float - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_predictions_nms_threshold: float - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: float - :ivar validation_metric_type: Metric computation method to use for validation metrics. Possible - values include: "None", "Coco", "Voc", "CocoVoc". - :vartype validation_metric_type: str or - ~azure.mgmt.machinelearningservices.models.ValidationMetricType - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'int'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'float'}, - 'image_size': {'key': 'imageSize', 'type': 'int'}, - 'max_size': {'key': 'maxSize', 'type': 'int'}, - 'min_size': {'key': 'minSize', 'type': 'int'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'bool'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'float'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'float'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'float'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'float'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, +class ImageModelSettingsObjectDetection(ImageModelSettings): + """Settings used for training the model. + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar advanced_settings: Settings for advanced scenarios. + :vartype advanced_settings: str + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: bool + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: float + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: float + :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. + :vartype checkpoint_frequency: int + :ivar checkpoint_model: The pretrained checkpoint model for incremental training. + :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput + :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for + incremental training. + :vartype checkpoint_run_id: str + :ivar distributed: Whether to use distributed training. + :vartype distributed: bool + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: bool + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: int + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: int + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: bool + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: int + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: int + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: int + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: float + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. Possible values include: "None", "WarmupCosine", "Step". + :vartype learning_rate_scheduler: str or + ~azure.mgmt.machinelearningservices.models.LearningRateScheduler + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: float + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: bool + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: int + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: int + :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". + :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: int + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: float + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: int + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: int + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: int + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: float + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: int + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: float + :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must + be a positive integer. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype box_detections_per_image: int + :ivar box_score_threshold: During inference, only return proposals with a classification score + greater than + BoxScoreThreshold. Must be a float in the range[0, 1]. + :vartype box_score_threshold: float + :ivar image_size: Image size for train and validation. Must be a positive integer. + Note: The training run may get into CUDA OOM if the size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype image_size: int + :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype max_size: int + :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype min_size: int + :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. + Note: training run may get into CUDA OOM if the model size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: + "None", "Small", "Medium", "Large", "ExtraLarge". + :vartype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize + :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. + Note: training run may get into CUDA OOM if no sufficient GPU memory. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype multi_scale: bool + :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be a + float in the range [0, 1]. + :vartype nms_iou_threshold: float + :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not + be + None to enable small object detection logic. A string containing two integers in mxn format. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_grid_size: str + :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float + in the range [0, 1). + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_overlap_ratio: float + :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging + predictions from tiles and image. + Used in validation/ inference. Must be float in the range [0, 1]. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_predictions_nms_threshold: float + :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be + float in the range [0, 1]. + :vartype validation_iou_threshold: float + :ivar validation_metric_type: Metric computation method to use for validation metrics. Possible + values include: "None", "Coco", "Voc", "CocoVoc". + :vartype validation_metric_type: str or + ~azure.mgmt.machinelearningservices.models.ValidationMetricType + """ + + _attribute_map = { + "advanced_settings": {"key": "advancedSettings", "type": "str"}, + "ams_gradient": {"key": "amsGradient", "type": "bool"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "float"}, + "beta2": {"key": "beta2", "type": "float"}, + "checkpoint_frequency": {"key": "checkpointFrequency", "type": "int"}, + "checkpoint_model": { + "key": "checkpointModel", + "type": "MLFlowModelJobInput", + }, + "checkpoint_run_id": {"key": "checkpointRunId", "type": "str"}, + "distributed": {"key": "distributed", "type": "bool"}, + "early_stopping": {"key": "earlyStopping", "type": "bool"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "int"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "int", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "bool", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "int"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "int", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "int"}, + "learning_rate": {"key": "learningRate", "type": "float"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "float"}, + "nesterov": {"key": "nesterov", "type": "bool"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "int"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "int"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "int"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "float"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "int"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "float", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "int", + }, + "weight_decay": {"key": "weightDecay", "type": "float"}, + "box_detections_per_image": { + "key": "boxDetectionsPerImage", + "type": "int", + }, + "box_score_threshold": {"key": "boxScoreThreshold", "type": "float"}, + "image_size": {"key": "imageSize", "type": "int"}, + "max_size": {"key": "maxSize", "type": "int"}, + "min_size": {"key": "minSize", "type": "int"}, + "model_size": {"key": "modelSize", "type": "str"}, + "multi_scale": {"key": "multiScale", "type": "bool"}, + "nms_iou_threshold": {"key": "nmsIouThreshold", "type": "float"}, + "tile_grid_size": {"key": "tileGridSize", "type": "str"}, + "tile_overlap_ratio": {"key": "tileOverlapRatio", "type": "float"}, + "tile_predictions_nms_threshold": { + "key": "tilePredictionsNmsThreshold", + "type": "float", + }, + "validation_iou_threshold": { + "key": "validationIouThreshold", + "type": "float", + }, + "validation_metric_type": { + "key": "validationMetricType", + "type": "str", + }, } def __init__( @@ -13609,7 +14570,9 @@ def __init__( gradient_accumulation_step: Optional[int] = None, layers_to_freeze: Optional[int] = None, learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "LearningRateScheduler"]] = None, + learning_rate_scheduler: Optional[ + Union[str, "LearningRateScheduler"] + ] = None, model_name: Optional[str] = None, momentum: Optional[float] = None, nesterov: Optional[bool] = None, @@ -13636,7 +14599,9 @@ def __init__( tile_overlap_ratio: Optional[float] = None, tile_predictions_nms_threshold: Optional[float] = None, validation_iou_threshold: Optional[float] = None, - validation_metric_type: Optional[Union[str, "ValidationMetricType"]] = None, + validation_metric_type: Optional[ + Union[str, "ValidationMetricType"] + ] = None, **kwargs ): """ @@ -13785,7 +14750,41 @@ def __init__( :paramtype validation_metric_type: str or ~azure.mgmt.machinelearningservices.models.ValidationMetricType """ - super(ImageModelSettingsObjectDetection, self).__init__(advanced_settings=advanced_settings, ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, checkpoint_frequency=checkpoint_frequency, checkpoint_model=checkpoint_model, checkpoint_run_id=checkpoint_run_id, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) + super(ImageModelSettingsObjectDetection, self).__init__( + advanced_settings=advanced_settings, + ams_gradient=ams_gradient, + augmentations=augmentations, + beta1=beta1, + beta2=beta2, + checkpoint_frequency=checkpoint_frequency, + checkpoint_model=checkpoint_model, + checkpoint_run_id=checkpoint_run_id, + distributed=distributed, + early_stopping=early_stopping, + early_stopping_delay=early_stopping_delay, + early_stopping_patience=early_stopping_patience, + enable_onnx_normalization=enable_onnx_normalization, + evaluation_frequency=evaluation_frequency, + gradient_accumulation_step=gradient_accumulation_step, + layers_to_freeze=layers_to_freeze, + learning_rate=learning_rate, + learning_rate_scheduler=learning_rate_scheduler, + model_name=model_name, + momentum=momentum, + nesterov=nesterov, + number_of_epochs=number_of_epochs, + number_of_workers=number_of_workers, + optimizer=optimizer, + random_seed=random_seed, + step_lr_gamma=step_lr_gamma, + step_lr_step_size=step_lr_step_size, + training_batch_size=training_batch_size, + validation_batch_size=validation_batch_size, + warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, + warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, + weight_decay=weight_decay, + **kwargs + ) self.box_detections_per_image = box_detections_per_image self.box_score_threshold = box_score_threshold self.image_size = image_size @@ -13803,65 +14802,80 @@ def __init__( class ImageObjectDetection(AutoMLVertical, ImageObjectDetectionBase): """Image Object Detection. Object detection is used to identify objects in an image and locate each object with a -bounding box e.g. locate all dogs and cats in an image and draw a bounding box around each. + bounding box e.g. locate all dogs and cats in an image and draw a bounding box around each. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "MeanAveragePrecision". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics """ _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, + "limit_settings": {"required": True}, + "task_type": {"required": True}, + "training_data": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsObjectDetection", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsObjectDetection]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( @@ -13873,10 +14887,14 @@ def __init__( validation_data: Optional["MLTableJobInput"] = None, validation_data_size: Optional[float] = None, model_settings: Optional["ImageModelSettingsObjectDetection"] = None, - search_space: Optional[List["ImageModelDistributionSettingsObjectDetection"]] = None, + search_space: Optional[ + List["ImageModelDistributionSettingsObjectDetection"] + ] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ObjectDetectionPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "ObjectDetectionPrimaryMetrics"] + ] = None, **kwargs ): """ @@ -13911,14 +14929,25 @@ def __init__( :paramtype primary_metric: str or ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics """ - super(ImageObjectDetection, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, model_settings=model_settings, search_space=search_space, **kwargs) + super(ImageObjectDetection, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + limit_settings=limit_settings, + sweep_settings=sweep_settings, + validation_data=validation_data, + validation_data_size=validation_data_size, + model_settings=model_settings, + search_space=search_space, + **kwargs + ) self.limit_settings = limit_settings self.sweep_settings = sweep_settings self.validation_data = validation_data self.validation_data_size = validation_data_size self.model_settings = model_settings self.search_space = search_space - self.task_type = 'ImageObjectDetection' # type: str + self.task_type = "ImageObjectDetection" # type: str self.primary_metric = primary_metric self.log_verbosity = log_verbosity self.target_column_name = target_column_name @@ -13939,12 +14968,15 @@ class ImageSweepSettings(msrest.serialization.Model): """ _validation = { - 'sampling_algorithm': {'required': True}, + "sampling_algorithm": {"required": True}, } _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, + "sampling_algorithm": {"key": "samplingAlgorithm", "type": "str"}, } def __init__( @@ -13980,9 +15012,9 @@ class InferenceContainerProperties(msrest.serialization.Model): """ _attribute_map = { - 'liveness_route': {'key': 'livenessRoute', 'type': 'Route'}, - 'readiness_route': {'key': 'readinessRoute', 'type': 'Route'}, - 'scoring_route': {'key': 'scoringRoute', 'type': 'Route'}, + "liveness_route": {"key": "livenessRoute", "type": "Route"}, + "readiness_route": {"key": "readinessRoute", "type": "Route"}, + "scoring_route": {"key": "scoringRoute", "type": "Route"}, } def __init__( @@ -14018,8 +15050,11 @@ class InstanceTypeSchema(msrest.serialization.Model): """ _attribute_map = { - 'node_selector': {'key': 'nodeSelector', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'InstanceTypeSchemaResources'}, + "node_selector": {"key": "nodeSelector", "type": "{str}"}, + "resources": { + "key": "resources", + "type": "InstanceTypeSchemaResources", + }, } def __init__( @@ -14050,8 +15085,8 @@ class InstanceTypeSchemaResources(msrest.serialization.Model): """ _attribute_map = { - 'requests': {'key': 'requests', 'type': '{str}'}, - 'limits': {'key': 'limits', 'type': '{str}'}, + "requests": {"key": "requests", "type": "{str}"}, + "limits": {"key": "limits", "type": "{str}"}, } def __init__( @@ -14095,27 +15130,22 @@ class JobBase(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'JobBaseProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "JobBaseProperties"}, } - def __init__( - self, - *, - properties: "JobBaseProperties", - **kwargs - ): + def __init__(self, *, properties: "JobBaseProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.JobBaseProperties @@ -14135,8 +15165,8 @@ class JobBaseResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[JobBase]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[JobBase]"}, } def __init__( @@ -14178,15 +15208,15 @@ class JobResourceConfiguration(ResourceConfiguration): """ _validation = { - 'shm_size': {'pattern': r'\d+[bBkKmMgG]'}, + "shm_size": {"pattern": r"\d+[bBkKmMgG]"}, } _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - 'docker_args': {'key': 'dockerArgs', 'type': 'str'}, - 'shm_size': {'key': 'shmSize', 'type': 'str'}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "properties": {"key": "properties", "type": "{object}"}, + "docker_args": {"key": "dockerArgs", "type": "str"}, + "shm_size": {"key": "shmSize", "type": "str"}, } def __init__( @@ -14215,7 +15245,12 @@ def __init__( b(bytes), k(kilobytes), m(megabytes), or g(gigabytes). :paramtype shm_size: str """ - super(JobResourceConfiguration, self).__init__(instance_count=instance_count, instance_type=instance_type, properties=properties, **kwargs) + super(JobResourceConfiguration, self).__init__( + instance_count=instance_count, + instance_type=instance_type, + properties=properties, + **kwargs + ) self.docker_args = docker_args self.shm_size = shm_size @@ -14233,27 +15268,25 @@ class JobScheduleAction(ScheduleActionBase): """ _validation = { - 'action_type': {'required': True}, - 'job_definition': {'required': True}, + "action_type": {"required": True}, + "job_definition": {"required": True}, } _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'job_definition': {'key': 'jobDefinition', 'type': 'JobBaseProperties'}, + "action_type": {"key": "actionType", "type": "str"}, + "job_definition": { + "key": "jobDefinition", + "type": "JobBaseProperties", + }, } - def __init__( - self, - *, - job_definition: "JobBaseProperties", - **kwargs - ): + def __init__(self, *, job_definition: "JobBaseProperties", **kwargs): """ :keyword job_definition: Required. [Required] Defines Schedule action definition details. :paramtype job_definition: ~azure.mgmt.machinelearningservices.models.JobBaseProperties """ super(JobScheduleAction, self).__init__(**kwargs) - self.action_type = 'CreateJob' # type: str + self.action_type = "CreateJob" # type: str self.job_definition = job_definition @@ -14280,18 +15313,18 @@ class JobService(msrest.serialization.Model): """ _validation = { - 'error_message': {'readonly': True}, - 'status': {'readonly': True}, + "error_message": {"readonly": True}, + "status": {"readonly": True}, } _attribute_map = { - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'job_service_type': {'key': 'jobServiceType', 'type': 'str'}, - 'nodes': {'key': 'nodes', 'type': 'Nodes'}, - 'port': {'key': 'port', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'status': {'key': 'status', 'type': 'str'}, + "endpoint": {"key": "endpoint", "type": "str"}, + "error_message": {"key": "errorMessage", "type": "str"}, + "job_service_type": {"key": "jobServiceType", "type": "str"}, + "nodes": {"key": "nodes", "type": "Nodes"}, + "port": {"key": "port", "type": "int"}, + "properties": {"key": "properties", "type": "{str}"}, + "status": {"key": "status", "type": "str"}, } def __init__( @@ -14342,15 +15375,15 @@ class KerberosCredentials(msrest.serialization.Model): """ _validation = { - 'kerberos_kdc_address': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "kerberos_kdc_address": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "kerberos_principal": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "kerberos_realm": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, + "kerberos_kdc_address": {"key": "kerberosKdcAddress", "type": "str"}, + "kerberos_principal": {"key": "kerberosPrincipal", "type": "str"}, + "kerberos_realm": {"key": "kerberosRealm", "type": "str"}, } def __init__( @@ -14397,19 +15430,19 @@ class KerberosKeytabCredentials(DatastoreCredentials, KerberosCredentials): """ _validation = { - 'kerberos_kdc_address': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, + "kerberos_kdc_address": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "kerberos_principal": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "kerberos_realm": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "credentials_type": {"required": True}, + "secrets": {"required": True}, } _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'KerberosKeytabSecrets'}, + "kerberos_kdc_address": {"key": "kerberosKdcAddress", "type": "str"}, + "kerberos_principal": {"key": "kerberosPrincipal", "type": "str"}, + "kerberos_realm": {"key": "kerberosRealm", "type": "str"}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "secrets": {"key": "secrets", "type": "KerberosKeytabSecrets"}, } def __init__( @@ -14432,11 +15465,16 @@ def __init__( :keyword secrets: Required. [Required] Keytab secrets. :paramtype secrets: ~azure.mgmt.machinelearningservices.models.KerberosKeytabSecrets """ - super(KerberosKeytabCredentials, self).__init__(kerberos_kdc_address=kerberos_kdc_address, kerberos_principal=kerberos_principal, kerberos_realm=kerberos_realm, **kwargs) + super(KerberosKeytabCredentials, self).__init__( + kerberos_kdc_address=kerberos_kdc_address, + kerberos_principal=kerberos_principal, + kerberos_realm=kerberos_realm, + **kwargs + ) self.kerberos_kdc_address = kerberos_kdc_address self.kerberos_principal = kerberos_principal self.kerberos_realm = kerberos_realm - self.credentials_type = 'KerberosKeytab' # type: str + self.credentials_type = "KerberosKeytab" # type: str self.secrets = secrets @@ -14454,26 +15492,21 @@ class KerberosKeytabSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'kerberos_keytab': {'key': 'kerberosKeytab', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "kerberos_keytab": {"key": "kerberosKeytab", "type": "str"}, } - def __init__( - self, - *, - kerberos_keytab: Optional[str] = None, - **kwargs - ): + def __init__(self, *, kerberos_keytab: Optional[str] = None, **kwargs): """ :keyword kerberos_keytab: Kerberos keytab secret. :paramtype kerberos_keytab: str """ super(KerberosKeytabSecrets, self).__init__(**kwargs) - self.secrets_type = 'KerberosKeytab' # type: str + self.secrets_type = "KerberosKeytab" # type: str self.kerberos_keytab = kerberos_keytab @@ -14498,19 +15531,19 @@ class KerberosPasswordCredentials(DatastoreCredentials, KerberosCredentials): """ _validation = { - 'kerberos_kdc_address': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, + "kerberos_kdc_address": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "kerberos_principal": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "kerberos_realm": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "credentials_type": {"required": True}, + "secrets": {"required": True}, } _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'KerberosPasswordSecrets'}, + "kerberos_kdc_address": {"key": "kerberosKdcAddress", "type": "str"}, + "kerberos_principal": {"key": "kerberosPrincipal", "type": "str"}, + "kerberos_realm": {"key": "kerberosRealm", "type": "str"}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "secrets": {"key": "secrets", "type": "KerberosPasswordSecrets"}, } def __init__( @@ -14533,11 +15566,16 @@ def __init__( :keyword secrets: Required. [Required] Kerberos password secrets. :paramtype secrets: ~azure.mgmt.machinelearningservices.models.KerberosPasswordSecrets """ - super(KerberosPasswordCredentials, self).__init__(kerberos_kdc_address=kerberos_kdc_address, kerberos_principal=kerberos_principal, kerberos_realm=kerberos_realm, **kwargs) + super(KerberosPasswordCredentials, self).__init__( + kerberos_kdc_address=kerberos_kdc_address, + kerberos_principal=kerberos_principal, + kerberos_realm=kerberos_realm, + **kwargs + ) self.kerberos_kdc_address = kerberos_kdc_address self.kerberos_principal = kerberos_principal self.kerberos_realm = kerberos_realm - self.credentials_type = 'KerberosPassword' # type: str + self.credentials_type = "KerberosPassword" # type: str self.secrets = secrets @@ -14555,26 +15593,21 @@ class KerberosPasswordSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'kerberos_password': {'key': 'kerberosPassword', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "kerberos_password": {"key": "kerberosPassword", "type": "str"}, } - def __init__( - self, - *, - kerberos_password: Optional[str] = None, - **kwargs - ): + def __init__(self, *, kerberos_password: Optional[str] = None, **kwargs): """ :keyword kerberos_password: Kerberos password secret. :paramtype kerberos_password: str """ super(KerberosPasswordSecrets, self).__init__(**kwargs) - self.secrets_type = 'KerberosPassword' # type: str + self.secrets_type = "KerberosPassword" # type: str self.kerberos_password = kerberos_password @@ -14586,14 +15619,11 @@ class KubernetesSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, + "properties": {"key": "properties", "type": "KubernetesProperties"}, } def __init__( - self, - *, - properties: Optional["KubernetesProperties"] = None, - **kwargs + self, *, properties: Optional["KubernetesProperties"] = None, **kwargs ): """ :keyword properties: Properties of Kubernetes. @@ -14642,28 +15672,31 @@ class Kubernetes(Compute, KubernetesSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + "disable_local_auth": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "KubernetesProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -14682,9 +15715,14 @@ def __init__( :keyword resource_id: ARM resource id of the underlying compute. :paramtype resource_id: str """ - super(Kubernetes, self).__init__(description=description, resource_id=resource_id, properties=properties, **kwargs) + super(Kubernetes, self).__init__( + description=description, + resource_id=resource_id, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'Kubernetes' # type: str + self.compute_type = "Kubernetes" # type: str self.compute_location = None self.provisioning_state = None self.description = description @@ -14753,31 +15791,49 @@ class OnlineDeploymentProperties(EndpointDeploymentPropertiesBase): """ _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, + "endpoint_compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, + "egress_public_network_access": { + "key": "egressPublicNetworkAccess", + "type": "str", + }, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, + "model": {"key": "model", "type": "str"}, + "model_mount_path": {"key": "modelMountPath", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, } _subtype_map = { - 'endpoint_compute_type': {'Kubernetes': 'KubernetesOnlineDeployment', 'Managed': 'ManagedOnlineDeployment'} + "endpoint_compute_type": { + "Kubernetes": "KubernetesOnlineDeployment", + "Managed": "ManagedOnlineDeployment", + } } def __init__( @@ -14789,7 +15845,9 @@ def __init__( environment_variables: Optional[Dict[str, str]] = None, properties: Optional[Dict[str, str]] = None, app_insights_enabled: Optional[bool] = False, - egress_public_network_access: Optional[Union[str, "EgressPublicNetworkAccessType"]] = None, + egress_public_network_access: Optional[ + Union[str, "EgressPublicNetworkAccessType"] + ] = None, instance_type: Optional[str] = None, liveness_probe: Optional["ProbeSettings"] = None, model: Optional[str] = None, @@ -14837,10 +15895,17 @@ def __init__( and to DefaultScaleSettings for ManagedOnlineDeployment. :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings """ - super(OnlineDeploymentProperties, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, **kwargs) + super(OnlineDeploymentProperties, self).__init__( + code_configuration=code_configuration, + description=description, + environment_id=environment_id, + environment_variables=environment_variables, + properties=properties, + **kwargs + ) self.app_insights_enabled = app_insights_enabled self.egress_public_network_access = egress_public_network_access - self.endpoint_compute_type = 'OnlineDeploymentProperties' # type: str + self.endpoint_compute_type = "OnlineDeploymentProperties" # type: str self.instance_type = instance_type self.liveness_probe = liveness_probe self.model = model @@ -14909,28 +15974,46 @@ class KubernetesOnlineDeployment(OnlineDeploymentProperties): """ _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - 'container_resource_requirements': {'key': 'containerResourceRequirements', 'type': 'ContainerResourceRequirements'}, + "endpoint_compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, + "egress_public_network_access": { + "key": "egressPublicNetworkAccess", + "type": "str", + }, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, + "model": {"key": "model", "type": "str"}, + "model_mount_path": {"key": "modelMountPath", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, + "container_resource_requirements": { + "key": "containerResourceRequirements", + "type": "ContainerResourceRequirements", + }, } def __init__( @@ -14942,7 +16025,9 @@ def __init__( environment_variables: Optional[Dict[str, str]] = None, properties: Optional[Dict[str, str]] = None, app_insights_enabled: Optional[bool] = False, - egress_public_network_access: Optional[Union[str, "EgressPublicNetworkAccessType"]] = None, + egress_public_network_access: Optional[ + Union[str, "EgressPublicNetworkAccessType"] + ] = None, instance_type: Optional[str] = None, liveness_probe: Optional["ProbeSettings"] = None, model: Optional[str] = None, @@ -14950,7 +16035,9 @@ def __init__( readiness_probe: Optional["ProbeSettings"] = None, request_settings: Optional["OnlineRequestSettings"] = None, scale_settings: Optional["OnlineScaleSettings"] = None, - container_resource_requirements: Optional["ContainerResourceRequirements"] = None, + container_resource_requirements: Optional[ + "ContainerResourceRequirements" + ] = None, **kwargs ): """ @@ -14995,8 +16082,24 @@ def __init__( :paramtype container_resource_requirements: ~azure.mgmt.machinelearningservices.models.ContainerResourceRequirements """ - super(KubernetesOnlineDeployment, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, app_insights_enabled=app_insights_enabled, egress_public_network_access=egress_public_network_access, instance_type=instance_type, liveness_probe=liveness_probe, model=model, model_mount_path=model_mount_path, readiness_probe=readiness_probe, request_settings=request_settings, scale_settings=scale_settings, **kwargs) - self.endpoint_compute_type = 'Kubernetes' # type: str + super(KubernetesOnlineDeployment, self).__init__( + code_configuration=code_configuration, + description=description, + environment_id=environment_id, + environment_variables=environment_variables, + properties=properties, + app_insights_enabled=app_insights_enabled, + egress_public_network_access=egress_public_network_access, + instance_type=instance_type, + liveness_probe=liveness_probe, + model=model, + model_mount_path=model_mount_path, + readiness_probe=readiness_probe, + request_settings=request_settings, + scale_settings=scale_settings, + **kwargs + ) + self.endpoint_compute_type = "Kubernetes" # type: str self.container_resource_requirements = container_resource_requirements @@ -15023,14 +16126,29 @@ class KubernetesProperties(msrest.serialization.Model): """ _attribute_map = { - 'relay_connection_string': {'key': 'relayConnectionString', 'type': 'str'}, - 'service_bus_connection_string': {'key': 'serviceBusConnectionString', 'type': 'str'}, - 'extension_principal_id': {'key': 'extensionPrincipalId', 'type': 'str'}, - 'extension_instance_release_train': {'key': 'extensionInstanceReleaseTrain', 'type': 'str'}, - 'vc_name': {'key': 'vcName', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'default_instance_type': {'key': 'defaultInstanceType', 'type': 'str'}, - 'instance_types': {'key': 'instanceTypes', 'type': '{InstanceTypeSchema}'}, + "relay_connection_string": { + "key": "relayConnectionString", + "type": "str", + }, + "service_bus_connection_string": { + "key": "serviceBusConnectionString", + "type": "str", + }, + "extension_principal_id": { + "key": "extensionPrincipalId", + "type": "str", + }, + "extension_instance_release_train": { + "key": "extensionInstanceReleaseTrain", + "type": "str", + }, + "vc_name": {"key": "vcName", "type": "str"}, + "namespace": {"key": "namespace", "type": "str"}, + "default_instance_type": {"key": "defaultInstanceType", "type": "str"}, + "instance_types": { + "key": "instanceTypes", + "type": "{InstanceTypeSchema}", + }, } def __init__( @@ -15069,7 +16187,9 @@ def __init__( self.relay_connection_string = relay_connection_string self.service_bus_connection_string = service_bus_connection_string self.extension_principal_id = extension_principal_id - self.extension_instance_release_train = extension_instance_release_train + self.extension_instance_release_train = ( + extension_instance_release_train + ) self.vc_name = vc_name self.namespace = namespace self.default_instance_type = default_instance_type @@ -15089,9 +16209,9 @@ class LabelCategory(msrest.serialization.Model): """ _attribute_map = { - 'classes': {'key': 'classes', 'type': '{LabelClass}'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'multi_select_enabled': {'key': 'multiSelectEnabled', 'type': 'bool'}, + "classes": {"key": "classes", "type": "{LabelClass}"}, + "display_name": {"key": "displayName", "type": "str"}, + "multi_select_enabled": {"key": "multiSelectEnabled", "type": "bool"}, } def __init__( @@ -15127,8 +16247,8 @@ class LabelClass(msrest.serialization.Model): """ _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'subclasses': {'key': 'subclasses', 'type': '{LabelClass}'}, + "display_name": {"key": "displayName", "type": "str"}, + "subclasses": {"key": "subclasses", "type": "{LabelClass}"}, } def __init__( @@ -15159,8 +16279,11 @@ class LabelingDataConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'data_id': {'key': 'dataId', 'type': 'str'}, - 'incremental_data_refresh_enabled': {'key': 'incrementalDataRefreshEnabled', 'type': 'bool'}, + "data_id": {"key": "dataId", "type": "str"}, + "incremental_data_refresh_enabled": { + "key": "incrementalDataRefreshEnabled", + "type": "bool", + }, } def __init__( @@ -15179,7 +16302,9 @@ def __init__( """ super(LabelingDataConfiguration, self).__init__(**kwargs) self.data_id = data_id - self.incremental_data_refresh_enabled = incremental_data_refresh_enabled + self.incremental_data_refresh_enabled = ( + incremental_data_refresh_enabled + ) class LabelingJob(Resource): @@ -15205,27 +16330,22 @@ class LabelingJob(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'LabelingJobProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "LabelingJobProperties"}, } - def __init__( - self, - *, - properties: "LabelingJobProperties", - **kwargs - ): + def __init__(self, *, properties: "LabelingJobProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.LabelingJobProperties @@ -15248,23 +16368,22 @@ class LabelingJobMediaProperties(msrest.serialization.Model): """ _validation = { - 'media_type': {'required': True}, + "media_type": {"required": True}, } _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, + "media_type": {"key": "mediaType", "type": "str"}, } _subtype_map = { - 'media_type': {'Image': 'LabelingJobImageProperties', 'Text': 'LabelingJobTextProperties'} + "media_type": { + "Image": "LabelingJobImageProperties", + "Text": "LabelingJobTextProperties", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(LabelingJobMediaProperties, self).__init__(**kwargs) self.media_type = None # type: Optional[str] @@ -15283,12 +16402,12 @@ class LabelingJobImageProperties(LabelingJobMediaProperties): """ _validation = { - 'media_type': {'required': True}, + "media_type": {"required": True}, } _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - 'annotation_type': {'key': 'annotationType', 'type': 'str'}, + "media_type": {"key": "mediaType", "type": "str"}, + "annotation_type": {"key": "annotationType", "type": "str"}, } def __init__( @@ -15304,7 +16423,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ImageAnnotationType """ super(LabelingJobImageProperties, self).__init__(**kwargs) - self.media_type = 'Image' # type: str + self.media_type = "Image" # type: str self.annotation_type = annotation_type @@ -15316,15 +16435,10 @@ class LabelingJobInstructions(msrest.serialization.Model): """ _attribute_map = { - 'uri': {'key': 'uri', 'type': 'str'}, + "uri": {"key": "uri", "type": "str"}, } - def __init__( - self, - *, - uri: Optional[str] = None, - **kwargs - ): + def __init__(self, *, uri: Optional[str] = None, **kwargs): """ :keyword uri: The link to a page with detailed labeling instructions for labelers. :paramtype uri: str @@ -15399,38 +16513,59 @@ class LabelingJobProperties(JobBaseProperties): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'created_date_time': {'readonly': True}, - 'progress_metrics': {'readonly': True}, - 'project_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'status_messages': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'data_configuration': {'key': 'dataConfiguration', 'type': 'LabelingDataConfiguration'}, - 'job_instructions': {'key': 'jobInstructions', 'type': 'LabelingJobInstructions'}, - 'label_categories': {'key': 'labelCategories', 'type': '{LabelCategory}'}, - 'labeling_job_media_properties': {'key': 'labelingJobMediaProperties', 'type': 'LabelingJobMediaProperties'}, - 'ml_assist_configuration': {'key': 'mlAssistConfiguration', 'type': 'MLAssistConfiguration'}, - 'progress_metrics': {'key': 'progressMetrics', 'type': 'ProgressMetrics'}, - 'project_id': {'key': 'projectId', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'status_messages': {'key': 'statusMessages', 'type': '[StatusMessage]'}, + "job_type": {"required": True}, + "status": {"readonly": True}, + "created_date_time": {"readonly": True}, + "progress_metrics": {"readonly": True}, + "project_id": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "status_messages": {"readonly": True}, + } + + _attribute_map = { + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "created_date_time": {"key": "createdDateTime", "type": "iso-8601"}, + "data_configuration": { + "key": "dataConfiguration", + "type": "LabelingDataConfiguration", + }, + "job_instructions": { + "key": "jobInstructions", + "type": "LabelingJobInstructions", + }, + "label_categories": { + "key": "labelCategories", + "type": "{LabelCategory}", + }, + "labeling_job_media_properties": { + "key": "labelingJobMediaProperties", + "type": "LabelingJobMediaProperties", + }, + "ml_assist_configuration": { + "key": "mlAssistConfiguration", + "type": "MLAssistConfiguration", + }, + "progress_metrics": { + "key": "progressMetrics", + "type": "ProgressMetrics", + }, + "project_id": {"key": "projectId", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "status_messages": { + "key": "statusMessages", + "type": "[StatusMessage]", + }, } def __init__( @@ -15449,7 +16584,9 @@ def __init__( data_configuration: Optional["LabelingDataConfiguration"] = None, job_instructions: Optional["LabelingJobInstructions"] = None, label_categories: Optional[Dict[str, "LabelCategory"]] = None, - labeling_job_media_properties: Optional["LabelingJobMediaProperties"] = None, + labeling_job_media_properties: Optional[ + "LabelingJobMediaProperties" + ] = None, ml_assist_configuration: Optional["MLAssistConfiguration"] = None, **kwargs ): @@ -15493,8 +16630,20 @@ def __init__( :paramtype ml_assist_configuration: ~azure.mgmt.machinelearningservices.models.MLAssistConfiguration """ - super(LabelingJobProperties, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, services=services, **kwargs) - self.job_type = 'Labeling' # type: str + super(LabelingJobProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + component_id=component_id, + compute_id=compute_id, + display_name=display_name, + experiment_name=experiment_name, + identity=identity, + is_archived=is_archived, + services=services, + **kwargs + ) + self.job_type = "Labeling" # type: str self.created_date_time = None self.data_configuration = data_configuration self.job_instructions = job_instructions @@ -15518,8 +16667,8 @@ class LabelingJobResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[LabelingJob]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[LabelingJob]"}, } def __init__( @@ -15555,12 +16704,12 @@ class LabelingJobTextProperties(LabelingJobMediaProperties): """ _validation = { - 'media_type': {'required': True}, + "media_type": {"required": True}, } _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - 'annotation_type': {'key': 'annotationType', 'type': 'str'}, + "media_type": {"key": "mediaType", "type": "str"}, + "annotation_type": {"key": "annotationType", "type": "str"}, } def __init__( @@ -15576,7 +16725,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.TextAnnotationType """ super(LabelingJobTextProperties, self).__init__(**kwargs) - self.media_type = 'Text' # type: str + self.media_type = "Text" # type: str self.annotation_type = annotation_type @@ -15593,21 +16742,17 @@ class ListAmlUserFeatureResult(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlUserFeature]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[AmlUserFeature]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListAmlUserFeatureResult, self).__init__(**kwargs) self.value = None self.next_link = None @@ -15625,21 +16770,17 @@ class ListNotebookKeysResult(msrest.serialization.Model): """ _validation = { - 'primary_access_key': {'readonly': True}, - 'secondary_access_key': {'readonly': True}, + "primary_access_key": {"readonly": True}, + "secondary_access_key": {"readonly": True}, } _attribute_map = { - 'primary_access_key': {'key': 'primaryAccessKey', 'type': 'str'}, - 'secondary_access_key': {'key': 'secondaryAccessKey', 'type': 'str'}, + "primary_access_key": {"key": "primaryAccessKey", "type": "str"}, + "secondary_access_key": {"key": "secondaryAccessKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListNotebookKeysResult, self).__init__(**kwargs) self.primary_access_key = None self.secondary_access_key = None @@ -15655,19 +16796,15 @@ class ListStorageAccountKeysResult(msrest.serialization.Model): """ _validation = { - 'user_storage_key': {'readonly': True}, + "user_storage_key": {"readonly": True}, } _attribute_map = { - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, + "user_storage_key": {"key": "userStorageKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListStorageAccountKeysResult, self).__init__(**kwargs) self.user_storage_key = None @@ -15685,21 +16822,17 @@ class ListUsagesResult(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[Usage]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Usage]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListUsagesResult, self).__init__(**kwargs) self.value = None self.next_link = None @@ -15725,27 +16858,35 @@ class ListWorkspaceKeysResult(msrest.serialization.Model): """ _validation = { - 'user_storage_key': {'readonly': True}, - 'user_storage_resource_id': {'readonly': True}, - 'app_insights_instrumentation_key': {'readonly': True}, - 'container_registry_credentials': {'readonly': True}, - 'notebook_access_keys': {'readonly': True}, + "user_storage_key": {"readonly": True}, + "user_storage_resource_id": {"readonly": True}, + "app_insights_instrumentation_key": {"readonly": True}, + "container_registry_credentials": {"readonly": True}, + "notebook_access_keys": {"readonly": True}, } _attribute_map = { - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, - 'user_storage_resource_id': {'key': 'userStorageResourceId', 'type': 'str'}, - 'app_insights_instrumentation_key': {'key': 'appInsightsInstrumentationKey', 'type': 'str'}, - 'container_registry_credentials': {'key': 'containerRegistryCredentials', 'type': 'RegistryListCredentialsResult'}, - 'notebook_access_keys': {'key': 'notebookAccessKeys', 'type': 'ListNotebookKeysResult'}, + "user_storage_key": {"key": "userStorageKey", "type": "str"}, + "user_storage_resource_id": { + "key": "userStorageResourceId", + "type": "str", + }, + "app_insights_instrumentation_key": { + "key": "appInsightsInstrumentationKey", + "type": "str", + }, + "container_registry_credentials": { + "key": "containerRegistryCredentials", + "type": "RegistryListCredentialsResult", + }, + "notebook_access_keys": { + "key": "notebookAccessKeys", + "type": "ListNotebookKeysResult", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListWorkspaceKeysResult, self).__init__(**kwargs) self.user_storage_key = None self.user_storage_resource_id = None @@ -15767,21 +16908,17 @@ class ListWorkspaceQuotas(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[ResourceQuota]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[ResourceQuota]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListWorkspaceQuotas, self).__init__(**kwargs) self.value = None self.next_link = None @@ -15803,22 +16940,18 @@ class LiteralJobInput(JobInput): """ _validation = { - 'job_input_type': {'required': True}, - 'value': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "job_input_type": {"required": True}, + "value": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, + "value": {"key": "value", "type": "str"}, } def __init__( - self, - *, - value: str, - description: Optional[str] = None, - **kwargs + self, *, value: str, description: Optional[str] = None, **kwargs ): """ :keyword description: Description for the input. @@ -15826,8 +16959,10 @@ def __init__( :keyword value: Required. [Required] Literal value for the input. :paramtype value: str """ - super(LiteralJobInput, self).__init__(description=description, **kwargs) - self.job_input_type = 'literal' # type: str + super(LiteralJobInput, self).__init__( + description=description, **kwargs + ) + self.job_input_type = "literal" # type: str self.value = value @@ -15852,14 +16987,14 @@ class ManagedIdentity(IdentityConfiguration): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + "object_id": {"key": "objectId", "type": "str"}, + "resource_id": {"key": "resourceId", "type": "str"}, } def __init__( @@ -15882,13 +17017,15 @@ def __init__( :paramtype resource_id: str """ super(ManagedIdentity, self).__init__(**kwargs) - self.identity_type = 'Managed' # type: str + self.identity_type = "Managed" # type: str self.client_id = client_id self.object_id = object_id self.resource_id = resource_id -class ManagedIdentityAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class ManagedIdentityAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """ManagedIdentityAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -15911,16 +17048,19 @@ class ManagedIdentityAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPr """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionManagedIdentity'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionManagedIdentity", + }, } def __init__( @@ -15947,8 +17087,16 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity """ - super(ManagedIdentityAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'ManagedIdentity' # type: str + super( + ManagedIdentityAuthTypeWorkspaceConnectionProperties, self + ).__init__( + category=category, + target=target, + value=value, + value_format=value_format, + **kwargs + ) + self.auth_type = "ManagedIdentity" # type: str self.credentials = credentials @@ -16006,27 +17154,42 @@ class ManagedOnlineDeployment(OnlineDeploymentProperties): """ _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, + "endpoint_compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, + "egress_public_network_access": { + "key": "egressPublicNetworkAccess", + "type": "str", + }, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, + "model": {"key": "model", "type": "str"}, + "model_mount_path": {"key": "modelMountPath", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, } def __init__( @@ -16038,7 +17201,9 @@ def __init__( environment_variables: Optional[Dict[str, str]] = None, properties: Optional[Dict[str, str]] = None, app_insights_enabled: Optional[bool] = False, - egress_public_network_access: Optional[Union[str, "EgressPublicNetworkAccessType"]] = None, + egress_public_network_access: Optional[ + Union[str, "EgressPublicNetworkAccessType"] + ] = None, instance_type: Optional[str] = None, liveness_probe: Optional["ProbeSettings"] = None, model: Optional[str] = None, @@ -16086,8 +17251,24 @@ def __init__( and to DefaultScaleSettings for ManagedOnlineDeployment. :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings """ - super(ManagedOnlineDeployment, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, app_insights_enabled=app_insights_enabled, egress_public_network_access=egress_public_network_access, instance_type=instance_type, liveness_probe=liveness_probe, model=model, model_mount_path=model_mount_path, readiness_probe=readiness_probe, request_settings=request_settings, scale_settings=scale_settings, **kwargs) - self.endpoint_compute_type = 'Managed' # type: str + super(ManagedOnlineDeployment, self).__init__( + code_configuration=code_configuration, + description=description, + environment_id=environment_id, + environment_variables=environment_variables, + properties=properties, + app_insights_enabled=app_insights_enabled, + egress_public_network_access=egress_public_network_access, + instance_type=instance_type, + liveness_probe=liveness_probe, + model=model, + model_mount_path=model_mount_path, + readiness_probe=readiness_probe, + request_settings=request_settings, + scale_settings=scale_settings, + **kwargs + ) + self.endpoint_compute_type = "Managed" # type: str class ManagedServiceIdentity(msrest.serialization.Model): @@ -16116,23 +17297,28 @@ class ManagedServiceIdentity(msrest.serialization.Model): """ _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, + "principal_id": {"readonly": True}, + "tenant_id": {"readonly": True}, + "type": {"required": True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{UserAssignedIdentity}", + }, } def __init__( self, *, type: Union[str, "ManagedServiceIdentityType"], - user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, + user_assigned_identities: Optional[ + Dict[str, "UserAssignedIdentity"] + ] = None, **kwargs ): """ @@ -16170,13 +17356,13 @@ class MedianStoppingPolicy(EarlyTerminationPolicy): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, } def __init__( @@ -16192,8 +17378,12 @@ def __init__( :keyword evaluation_interval: Interval (number of runs) between policy evaluations. :paramtype evaluation_interval: int """ - super(MedianStoppingPolicy, self).__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs) - self.policy_type = 'MedianStopping' # type: str + super(MedianStoppingPolicy, self).__init__( + delay_evaluation=delay_evaluation, + evaluation_interval=evaluation_interval, + **kwargs + ) + self.policy_type = "MedianStopping" # type: str class MLAssistConfiguration(msrest.serialization.Model): @@ -16210,23 +17400,22 @@ class MLAssistConfiguration(msrest.serialization.Model): """ _validation = { - 'ml_assist': {'required': True}, + "ml_assist": {"required": True}, } _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, + "ml_assist": {"key": "mlAssist", "type": "str"}, } _subtype_map = { - 'ml_assist': {'Disabled': 'MLAssistConfigurationDisabled', 'Enabled': 'MLAssistConfigurationEnabled'} + "ml_assist": { + "Disabled": "MLAssistConfigurationDisabled", + "Enabled": "MLAssistConfigurationEnabled", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(MLAssistConfiguration, self).__init__(**kwargs) self.ml_assist = None # type: Optional[str] @@ -16242,21 +17431,17 @@ class MLAssistConfigurationDisabled(MLAssistConfiguration): """ _validation = { - 'ml_assist': {'required': True}, + "ml_assist": {"required": True}, } _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, + "ml_assist": {"key": "mlAssist", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(MLAssistConfigurationDisabled, self).__init__(**kwargs) - self.ml_assist = 'Disabled' # type: str + self.ml_assist = "Disabled" # type: str class MLAssistConfigurationEnabled(MLAssistConfiguration): @@ -16275,15 +17460,27 @@ class MLAssistConfigurationEnabled(MLAssistConfiguration): """ _validation = { - 'ml_assist': {'required': True}, - 'inferencing_compute_binding': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'training_compute_binding': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "ml_assist": {"required": True}, + "inferencing_compute_binding": { + "required": True, + "pattern": r"[a-zA-Z0-9_]", + }, + "training_compute_binding": { + "required": True, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - 'inferencing_compute_binding': {'key': 'inferencingComputeBinding', 'type': 'str'}, - 'training_compute_binding': {'key': 'trainingComputeBinding', 'type': 'str'}, + "ml_assist": {"key": "mlAssist", "type": "str"}, + "inferencing_compute_binding": { + "key": "inferencingComputeBinding", + "type": "str", + }, + "training_compute_binding": { + "key": "trainingComputeBinding", + "type": "str", + }, } def __init__( @@ -16301,7 +17498,7 @@ def __init__( :paramtype training_compute_binding: str """ super(MLAssistConfigurationEnabled, self).__init__(**kwargs) - self.ml_assist = 'Enabled' # type: str + self.ml_assist = "Enabled" # type: str self.inferencing_compute_binding = inferencing_compute_binding self.training_compute_binding = training_compute_binding @@ -16325,15 +17522,15 @@ class MLFlowModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -16353,10 +17550,12 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(MLFlowModelJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(MLFlowModelJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'mlflow_model' # type: str + self.job_input_type = "mlflow_model" # type: str self.description = description @@ -16379,14 +17578,14 @@ class MLFlowModelJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -16406,10 +17605,12 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(MLFlowModelJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(MLFlowModelJobOutput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_output_type = 'mlflow_model' # type: str + self.job_output_type = "mlflow_model" # type: str self.description = description @@ -16439,19 +17640,19 @@ class MLTableData(DataVersionBaseProperties): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'referenced_uris': {'key': 'referencedUris', 'type': '[str]'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, + "referenced_uris": {"key": "referencedUris", "type": "[str]"}, } def __init__( @@ -16483,8 +17684,16 @@ def __init__( :keyword referenced_uris: Uris referenced in the MLTable definition (required for lineage). :paramtype referenced_uris: list[str] """ - super(MLTableData, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, **kwargs) - self.data_type = 'mltable' # type: str + super(MLTableData, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + data_uri=data_uri, + **kwargs + ) + self.data_type = "mltable" # type: str self.referenced_uris = referenced_uris @@ -16507,15 +17716,15 @@ class MLTableJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -16535,10 +17744,12 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(MLTableJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(MLTableJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'mltable' # type: str + self.job_input_type = "mltable" # type: str self.description = description @@ -16561,14 +17772,14 @@ class MLTableJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -16588,10 +17799,12 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(MLTableJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(MLTableJobOutput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_output_type = 'mltable' # type: str + self.job_output_type = "mltable" # type: str self.description = description @@ -16618,27 +17831,25 @@ class ModelContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "ModelContainerProperties", + }, } - def __init__( - self, - *, - properties: "ModelContainerProperties", - **kwargs - ): + def __init__(self, *, properties: "ModelContainerProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelContainerProperties @@ -16671,19 +17882,19 @@ class ModelContainerProperties(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } def __init__( @@ -16705,7 +17916,13 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(ModelContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) + super(ModelContainerProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs + ) self.provisioning_state = None @@ -16720,8 +17937,8 @@ class ModelContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ModelContainer]"}, } def __init__( @@ -16738,7 +17955,9 @@ def __init__( :keyword value: An array of objects of type ModelContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelContainer] """ - super(ModelContainerResourceArmPaginatedResult, self).__init__(**kwargs) + super(ModelContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -16766,27 +17985,22 @@ class ModelVersion(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelVersionProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "ModelVersionProperties"}, } - def __init__( - self, - *, - properties: "ModelVersionProperties", - **kwargs - ): + def __init__(self, *, properties: "ModelVersionProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelVersionProperties @@ -16825,20 +18039,20 @@ class ModelVersionProperties(AssetBase): """ _validation = { - 'provisioning_state': {'readonly': True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'flavors': {'key': 'flavors', 'type': '{FlavorData}'}, - 'job_name': {'key': 'jobName', 'type': 'str'}, - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'model_uri': {'key': 'modelUri', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "flavors": {"key": "flavors", "type": "{FlavorData}"}, + "job_name": {"key": "jobName", "type": "str"}, + "model_type": {"key": "modelType", "type": "str"}, + "model_uri": {"key": "modelUri", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } def __init__( @@ -16875,7 +18089,14 @@ def __init__( :keyword model_uri: The URI path to the model contents. :paramtype model_uri: str """ - super(ModelVersionProperties, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) + super(ModelVersionProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + **kwargs + ) self.flavors = flavors self.job_name = job_name self.model_type = model_type @@ -16894,8 +18115,8 @@ class ModelVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelVersion]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ModelVersion]"}, } def __init__( @@ -16930,26 +18151,26 @@ class Mpi(DistributionConfiguration): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, + "distribution_type": {"key": "distributionType", "type": "str"}, + "process_count_per_instance": { + "key": "processCountPerInstance", + "type": "int", + }, } def __init__( - self, - *, - process_count_per_instance: Optional[int] = None, - **kwargs + self, *, process_count_per_instance: Optional[int] = None, **kwargs ): """ :keyword process_count_per_instance: Number of processes per MPI node. :paramtype process_count_per_instance: int """ super(Mpi, self).__init__(**kwargs) - self.distribution_type = 'Mpi' # type: str + self.distribution_type = "Mpi" # type: str self.process_count_per_instance = process_count_per_instance @@ -16981,15 +18202,21 @@ class NlpFixedParameters(msrest.serialization.Model): """ _attribute_map = { - 'gradient_accumulation_steps': {'key': 'gradientAccumulationSteps', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_ratio': {'key': 'warmupRatio', 'type': 'float'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, + "gradient_accumulation_steps": { + "key": "gradientAccumulationSteps", + "type": "int", + }, + "learning_rate": {"key": "learningRate", "type": "float"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "int"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, + "warmup_ratio": {"key": "warmupRatio", "type": "float"}, + "weight_decay": {"key": "weightDecay", "type": "float"}, } def __init__( @@ -16997,7 +18224,9 @@ def __init__( *, gradient_accumulation_steps: Optional[int] = None, learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "NlpLearningRateScheduler"]] = None, + learning_rate_scheduler: Optional[ + Union[str, "NlpLearningRateScheduler"] + ] = None, model_name: Optional[str] = None, number_of_epochs: Optional[int] = None, training_batch_size: Optional[int] = None, @@ -17068,15 +18297,21 @@ class NlpParameterSubspace(msrest.serialization.Model): """ _attribute_map = { - 'gradient_accumulation_steps': {'key': 'gradientAccumulationSteps', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_ratio': {'key': 'warmupRatio', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, + "gradient_accumulation_steps": { + "key": "gradientAccumulationSteps", + "type": "str", + }, + "learning_rate": {"key": "learningRate", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "str"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, + "warmup_ratio": {"key": "warmupRatio", "type": "str"}, + "weight_decay": {"key": "weightDecay", "type": "str"}, } def __init__( @@ -17141,12 +18376,15 @@ class NlpSweepSettings(msrest.serialization.Model): """ _validation = { - 'sampling_algorithm': {'required': True}, + "sampling_algorithm": {"required": True}, } _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, + "sampling_algorithm": {"key": "samplingAlgorithm", "type": "str"}, } def __init__( @@ -17171,38 +18409,55 @@ def __init__( class NlpVertical(msrest.serialization.Model): """Abstract class for NLP related AutoML tasks. -NLP - Natural Language Processing. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - } + NLP - Natural Language Processing. - def __init__( - self, - *, - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar fixed_parameters: Model/training parameters that will remain constant throughout + training. + :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] + :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + """ + + _attribute_map = { + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "NlpFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "search_space": { + "key": "searchSpace", + "type": "[NlpParameterSubspace]", + }, + "sweep_settings": {"key": "sweepSettings", "type": "NlpSweepSettings"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + } + + def __init__( + self, + *, + featurization_settings: Optional[ + "NlpVerticalFeaturizationSettings" + ] = None, fixed_parameters: Optional["NlpFixedParameters"] = None, limit_settings: Optional["NlpVerticalLimitSettings"] = None, search_space: Optional[List["NlpParameterSubspace"]] = None, @@ -17244,20 +18499,17 @@ class NlpVerticalFeaturizationSettings(FeaturizationSettings): """ _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, + "dataset_language": {"key": "datasetLanguage", "type": "str"}, } - def __init__( - self, - *, - dataset_language: Optional[str] = None, - **kwargs - ): + def __init__(self, *, dataset_language: Optional[str] = None, **kwargs): """ :keyword dataset_language: Dataset language, useful for the text data. :paramtype dataset_language: str """ - super(NlpVerticalFeaturizationSettings, self).__init__(dataset_language=dataset_language, **kwargs) + super(NlpVerticalFeaturizationSettings, self).__init__( + dataset_language=dataset_language, **kwargs + ) class NlpVerticalLimitSettings(msrest.serialization.Model): @@ -17277,11 +18529,11 @@ class NlpVerticalLimitSettings(msrest.serialization.Model): """ _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_nodes': {'key': 'maxNodes', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_nodes": {"key": "maxNodes", "type": "int"}, + "max_trials": {"key": "maxTrials", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, + "trial_timeout": {"key": "trialTimeout", "type": "duration"}, } def __init__( @@ -17335,29 +18587,25 @@ class NodeStateCounts(msrest.serialization.Model): """ _validation = { - 'idle_node_count': {'readonly': True}, - 'running_node_count': {'readonly': True}, - 'preparing_node_count': {'readonly': True}, - 'unusable_node_count': {'readonly': True}, - 'leaving_node_count': {'readonly': True}, - 'preempted_node_count': {'readonly': True}, + "idle_node_count": {"readonly": True}, + "running_node_count": {"readonly": True}, + "preparing_node_count": {"readonly": True}, + "unusable_node_count": {"readonly": True}, + "leaving_node_count": {"readonly": True}, + "preempted_node_count": {"readonly": True}, } _attribute_map = { - 'idle_node_count': {'key': 'idleNodeCount', 'type': 'int'}, - 'running_node_count': {'key': 'runningNodeCount', 'type': 'int'}, - 'preparing_node_count': {'key': 'preparingNodeCount', 'type': 'int'}, - 'unusable_node_count': {'key': 'unusableNodeCount', 'type': 'int'}, - 'leaving_node_count': {'key': 'leavingNodeCount', 'type': 'int'}, - 'preempted_node_count': {'key': 'preemptedNodeCount', 'type': 'int'}, + "idle_node_count": {"key": "idleNodeCount", "type": "int"}, + "running_node_count": {"key": "runningNodeCount", "type": "int"}, + "preparing_node_count": {"key": "preparingNodeCount", "type": "int"}, + "unusable_node_count": {"key": "unusableNodeCount", "type": "int"}, + "leaving_node_count": {"key": "leavingNodeCount", "type": "int"}, + "preempted_node_count": {"key": "preemptedNodeCount", "type": "int"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NodeStateCounts, self).__init__(**kwargs) self.idle_node_count = None self.running_node_count = None @@ -17367,7 +18615,9 @@ def __init__( self.preempted_node_count = None -class NoneAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class NoneAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """NoneAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -17387,15 +18637,15 @@ class NoneAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2) """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, } def __init__( @@ -17418,8 +18668,14 @@ def __init__( "JSON". :paramtype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat """ - super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'None' # type: str + super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__( + category=category, + target=target, + value=value, + value_format=value_format, + **kwargs + ) + self.auth_type = "None" # type: str class NoneDatastoreCredentials(DatastoreCredentials): @@ -17434,21 +18690,17 @@ class NoneDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, + "credentials_type": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NoneDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'None' # type: str + self.credentials_type = "None" # type: str class NotebookAccessTokenResult(msrest.serialization.Model): @@ -17475,33 +18727,29 @@ class NotebookAccessTokenResult(msrest.serialization.Model): """ _validation = { - 'notebook_resource_id': {'readonly': True}, - 'host_name': {'readonly': True}, - 'public_dns': {'readonly': True}, - 'access_token': {'readonly': True}, - 'token_type': {'readonly': True}, - 'expires_in': {'readonly': True}, - 'refresh_token': {'readonly': True}, - 'scope': {'readonly': True}, + "notebook_resource_id": {"readonly": True}, + "host_name": {"readonly": True}, + "public_dns": {"readonly": True}, + "access_token": {"readonly": True}, + "token_type": {"readonly": True}, + "expires_in": {"readonly": True}, + "refresh_token": {"readonly": True}, + "scope": {"readonly": True}, } _attribute_map = { - 'notebook_resource_id': {'key': 'notebookResourceId', 'type': 'str'}, - 'host_name': {'key': 'hostName', 'type': 'str'}, - 'public_dns': {'key': 'publicDns', 'type': 'str'}, - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, - 'expires_in': {'key': 'expiresIn', 'type': 'int'}, - 'refresh_token': {'key': 'refreshToken', 'type': 'str'}, - 'scope': {'key': 'scope', 'type': 'str'}, + "notebook_resource_id": {"key": "notebookResourceId", "type": "str"}, + "host_name": {"key": "hostName", "type": "str"}, + "public_dns": {"key": "publicDns", "type": "str"}, + "access_token": {"key": "accessToken", "type": "str"}, + "token_type": {"key": "tokenType", "type": "str"}, + "expires_in": {"key": "expiresIn", "type": "int"}, + "refresh_token": {"key": "refreshToken", "type": "str"}, + "scope": {"key": "scope", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NotebookAccessTokenResult, self).__init__(**kwargs) self.notebook_resource_id = None self.host_name = None @@ -17523,8 +18771,8 @@ class NotebookPreparationError(msrest.serialization.Model): """ _attribute_map = { - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'status_code': {'key': 'statusCode', 'type': 'int'}, + "error_message": {"key": "errorMessage", "type": "str"}, + "status_code": {"key": "statusCode", "type": "int"}, } def __init__( @@ -17558,9 +18806,12 @@ class NotebookResourceInfo(msrest.serialization.Model): """ _attribute_map = { - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'notebook_preparation_error': {'key': 'notebookPreparationError', 'type': 'NotebookPreparationError'}, + "fqdn": {"key": "fqdn", "type": "str"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "notebook_preparation_error": { + "key": "notebookPreparationError", + "type": "NotebookPreparationError", + }, } def __init__( @@ -17568,7 +18819,9 @@ def __init__( *, fqdn: Optional[str] = None, resource_id: Optional[str] = None, - notebook_preparation_error: Optional["NotebookPreparationError"] = None, + notebook_preparation_error: Optional[ + "NotebookPreparationError" + ] = None, **kwargs ): """ @@ -17599,21 +18852,17 @@ class Objective(msrest.serialization.Model): """ _validation = { - 'goal': {'required': True}, - 'primary_metric': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "goal": {"required": True}, + "primary_metric": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'goal': {'key': 'goal', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "goal": {"key": "goal", "type": "str"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( - self, - *, - goal: Union[str, "Goal"], - primary_metric: str, - **kwargs + self, *, goal: Union[str, "Goal"], primary_metric: str, **kwargs ): """ :keyword goal: Required. [Required] Defines supported metric goals for hyperparameter tuning. @@ -17661,25 +18910,28 @@ class OnlineDeployment(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineDeploymentProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": { + "key": "properties", + "type": "OnlineDeploymentProperties", + }, + "sku": {"key": "sku", "type": "Sku"}, } def __init__( @@ -17708,14 +18960,18 @@ def __init__( :keyword sku: Sku details required for ARM contract for Autoscaling. :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ - super(OnlineDeployment, self).__init__(tags=tags, location=location, **kwargs) + super(OnlineDeployment, self).__init__( + tags=tags, location=location, **kwargs + ) self.identity = identity self.kind = kind self.properties = properties self.sku = sku -class OnlineDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class OnlineDeploymentTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of OnlineDeployment entities. :ivar next_link: The link to the next page of OnlineDeployment objects. If null, there are no @@ -17726,8 +18982,8 @@ class OnlineDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Mod """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineDeployment]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[OnlineDeployment]"}, } def __init__( @@ -17744,7 +19000,9 @@ def __init__( :keyword value: An array of objects of type OnlineDeployment. :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineDeployment] """ - super(OnlineDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) + super( + OnlineDeploymentTrackedResourceArmPaginatedResult, self + ).__init__(**kwargs) self.next_link = next_link self.value = value @@ -17783,25 +19041,28 @@ class OnlineEndpoint(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": { + "key": "properties", + "type": "OnlineEndpointProperties", + }, + "sku": {"key": "sku", "type": "Sku"}, } def __init__( @@ -17830,7 +19091,9 @@ def __init__( :keyword sku: Sku details required for ARM contract for Autoscaling. :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ - super(OnlineEndpoint, self).__init__(tags=tags, location=location, **kwargs) + super(OnlineEndpoint, self).__init__( + tags=tags, location=location, **kwargs + ) self.identity = identity self.kind = kind self.properties = properties @@ -17880,24 +19143,24 @@ class OnlineEndpointProperties(EndpointPropertiesBase): """ _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "auth_mode": {"required": True}, + "scoring_uri": {"readonly": True}, + "swagger_uri": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'mirror_traffic': {'key': 'mirrorTraffic', 'type': '{int}'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, - 'traffic': {'key': 'traffic', 'type': '{int}'}, + "auth_mode": {"key": "authMode", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "keys": {"key": "keys", "type": "EndpointAuthKeys"}, + "properties": {"key": "properties", "type": "{str}"}, + "scoring_uri": {"key": "scoringUri", "type": "str"}, + "swagger_uri": {"key": "swaggerUri", "type": "str"}, + "compute": {"key": "compute", "type": "str"}, + "mirror_traffic": {"key": "mirrorTraffic", "type": "{int}"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "public_network_access": {"key": "publicNetworkAccess", "type": "str"}, + "traffic": {"key": "traffic", "type": "{int}"}, } def __init__( @@ -17909,7 +19172,9 @@ def __init__( properties: Optional[Dict[str, str]] = None, compute: Optional[str] = None, mirror_traffic: Optional[Dict[str, int]] = None, - public_network_access: Optional[Union[str, "PublicNetworkAccessType"]] = None, + public_network_access: Optional[ + Union[str, "PublicNetworkAccessType"] + ] = None, traffic: Optional[Dict[str, int]] = None, **kwargs ): @@ -17940,7 +19205,13 @@ def __init__( values need to sum to 100. :paramtype traffic: dict[str, int] """ - super(OnlineEndpointProperties, self).__init__(auth_mode=auth_mode, description=description, keys=keys, properties=properties, **kwargs) + super(OnlineEndpointProperties, self).__init__( + auth_mode=auth_mode, + description=description, + keys=keys, + properties=properties, + **kwargs + ) self.compute = compute self.mirror_traffic = mirror_traffic self.provisioning_state = None @@ -17948,7 +19219,9 @@ def __init__( self.traffic = traffic -class OnlineEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class OnlineEndpointTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of OnlineEndpoint entities. :ivar next_link: The link to the next page of OnlineEndpoint objects. If null, there are no @@ -17959,8 +19232,8 @@ class OnlineEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineEndpoint]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[OnlineEndpoint]"}, } def __init__( @@ -17977,7 +19250,9 @@ def __init__( :keyword value: An array of objects of type OnlineEndpoint. :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] """ - super(OnlineEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) + super(OnlineEndpointTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -17998,9 +19273,12 @@ class OnlineRequestSettings(msrest.serialization.Model): """ _attribute_map = { - 'max_concurrent_requests_per_instance': {'key': 'maxConcurrentRequestsPerInstance', 'type': 'int'}, - 'max_queue_wait': {'key': 'maxQueueWait', 'type': 'duration'}, - 'request_timeout': {'key': 'requestTimeout', 'type': 'duration'}, + "max_concurrent_requests_per_instance": { + "key": "maxConcurrentRequestsPerInstance", + "type": "int", + }, + "max_queue_wait": {"key": "maxQueueWait", "type": "duration"}, + "request_timeout": {"key": "requestTimeout", "type": "duration"}, } def __init__( @@ -18024,7 +19302,9 @@ def __init__( :paramtype request_timeout: ~datetime.timedelta """ super(OnlineRequestSettings, self).__init__(**kwargs) - self.max_concurrent_requests_per_instance = max_concurrent_requests_per_instance + self.max_concurrent_requests_per_instance = ( + max_concurrent_requests_per_instance + ) self.max_queue_wait = max_queue_wait self.request_timeout = request_timeout @@ -18044,13 +19324,13 @@ class OutputPathAssetReference(AssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "job_id": {"key": "jobId", "type": "str"}, + "path": {"key": "path", "type": "str"}, } def __init__( @@ -18067,7 +19347,7 @@ def __init__( :paramtype path: str """ super(OutputPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'OutputPath' # type: str + self.reference_type = "OutputPath" # type: str self.job_id = job_id self.path = path @@ -18082,8 +19362,8 @@ class PaginatedComputeResourcesList(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[ComputeResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[ComputeResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( @@ -18112,15 +19392,10 @@ class PartialBatchDeployment(msrest.serialization.Model): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, } - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): + def __init__(self, *, description: Optional[str] = None, **kwargs): """ :keyword description: Description of the endpoint deployment. :paramtype description: str @@ -18129,7 +19404,9 @@ def __init__( self.description = description -class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties(msrest.serialization.Model): +class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties( + msrest.serialization.Model +): """Strictly used in update requests. :ivar properties: Additional attributes of the entity. @@ -18139,8 +19416,8 @@ class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties(msrest.s """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'PartialBatchDeployment'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "properties": {"key": "properties", "type": "PartialBatchDeployment"}, + "tags": {"key": "tags", "type": "{str}"}, } def __init__( @@ -18156,7 +19433,10 @@ def __init__( :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] """ - super(PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, self).__init__(**kwargs) + super( + PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, + self, + ).__init__(**kwargs) self.properties = properties self.tags = tags @@ -18176,8 +19456,11 @@ class PartialManagedServiceIdentity(msrest.serialization.Model): """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{object}'}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{object}", + }, } def __init__( @@ -18211,15 +19494,10 @@ class PartialMinimalTrackedResource(msrest.serialization.Model): """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): + def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -18238,8 +19516,11 @@ class PartialMinimalTrackedResourceWithIdentity(PartialMinimalTrackedResource): """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, + "tags": {"key": "tags", "type": "{str}"}, + "identity": { + "key": "identity", + "type": "PartialManagedServiceIdentity", + }, } def __init__( @@ -18255,7 +19536,9 @@ def __init__( :keyword identity: Managed service identity (system assigned and/or user assigned identities). :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity """ - super(PartialMinimalTrackedResourceWithIdentity, self).__init__(tags=tags, **kwargs) + super(PartialMinimalTrackedResourceWithIdentity, self).__init__( + tags=tags, **kwargs + ) self.identity = identity @@ -18269,8 +19552,8 @@ class PartialMinimalTrackedResourceWithSku(PartialMinimalTrackedResource): """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "PartialSku"}, } def __init__( @@ -18286,7 +19569,9 @@ def __init__( :keyword sku: Sku details required for ARM contract for Autoscaling. :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku """ - super(PartialMinimalTrackedResourceWithSku, self).__init__(tags=tags, **kwargs) + super(PartialMinimalTrackedResourceWithSku, self).__init__( + tags=tags, **kwargs + ) self.sku = sku @@ -18309,12 +19594,15 @@ class PartialRegistryPartialTrackedResource(msrest.serialization.Model): """ _attribute_map = { - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'object'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "identity": { + "key": "identity", + "type": "PartialManagedServiceIdentity", + }, + "kind": {"key": "kind", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "properties": {"key": "properties", "type": "object"}, + "sku": {"key": "sku", "type": "PartialSku"}, + "tags": {"key": "tags", "type": "{str}"}, } def __init__( @@ -18373,11 +19661,11 @@ class PartialSku(msrest.serialization.Model): """ _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'int'}, - 'family': {'key': 'family', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, + "capacity": {"key": "capacity", "type": "int"}, + "family": {"key": "family", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "size": {"key": "size", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, } def __init__( @@ -18427,27 +19715,25 @@ class Password(msrest.serialization.Model): """ _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, + "name": {"readonly": True}, + "value": {"readonly": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "value": {"key": "value", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Password, self).__init__(**kwargs) self.name = None self.value = None -class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class PATAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """PATAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -18470,16 +19756,19 @@ class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionPersonalAccessToken'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionPersonalAccessToken", + }, } def __init__( @@ -18506,8 +19795,14 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken """ - super(PATAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'PAT' # type: str + super(PATAuthTypeWorkspaceConnectionProperties, self).__init__( + category=category, + target=target, + value=value, + value_format=value_format, + **kwargs + ) + self.auth_type = "PAT" # type: str self.credentials = credentials @@ -18519,14 +19814,11 @@ class PersonalComputeInstanceSettings(msrest.serialization.Model): """ _attribute_map = { - 'assigned_user': {'key': 'assignedUser', 'type': 'AssignedUser'}, + "assigned_user": {"key": "assignedUser", "type": "AssignedUser"}, } def __init__( - self, - *, - assigned_user: Optional["AssignedUser"] = None, - **kwargs + self, *, assigned_user: Optional["AssignedUser"] = None, **kwargs ): """ :keyword assigned_user: A user explicitly assigned to a personal compute instance. @@ -18587,28 +19879,28 @@ class PipelineJob(JobBaseProperties): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, + "job_type": {"required": True}, + "status": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'jobs': {'key': 'jobs', 'type': '{object}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'settings': {'key': 'settings', 'type': 'object'}, - 'source_job_id': {'key': 'sourceJobId', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "jobs": {"key": "jobs", "type": "{object}"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "settings": {"key": "settings", "type": "object"}, + "source_job_id": {"key": "sourceJobId", "type": "str"}, } def __init__( @@ -18667,8 +19959,20 @@ def __init__( :keyword source_job_id: ARM resource ID of source job. :paramtype source_job_id: str """ - super(PipelineJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, services=services, **kwargs) - self.job_type = 'Pipeline' # type: str + super(PipelineJob, self).__init__( + description=description, + properties=properties, + tags=tags, + component_id=component_id, + compute_id=compute_id, + display_name=display_name, + experiment_name=experiment_name, + identity=identity, + is_archived=is_archived, + services=services, + **kwargs + ) + self.job_type = "Pipeline" # type: str self.inputs = inputs self.jobs = jobs self.outputs = outputs @@ -18688,21 +19992,17 @@ class PrivateEndpoint(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'subnet_arm_id': {'readonly': True}, + "id": {"readonly": True}, + "subnet_arm_id": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'subnet_arm_id': {'key': 'subnetArmId', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "subnet_arm_id": {"key": "subnetArmId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(PrivateEndpoint, self).__init__(**kwargs) self.id = None self.subnet_arm_id = None @@ -18745,25 +20045,34 @@ class PrivateEndpointConnection(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "private_endpoint": { + "key": "properties.privateEndpoint", + "type": "PrivateEndpoint", + }, + "private_link_service_connection_state": { + "key": "properties.privateLinkServiceConnectionState", + "type": "PrivateLinkServiceConnectionState", + }, + "provisioning_state": { + "key": "properties.provisioningState", + "type": "str", + }, } def __init__( @@ -18774,7 +20083,9 @@ def __init__( tags: Optional[Dict[str, str]] = None, sku: Optional["Sku"] = None, private_endpoint: Optional["PrivateEndpoint"] = None, - private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, + private_link_service_connection_state: Optional[ + "PrivateLinkServiceConnectionState" + ] = None, **kwargs ): """ @@ -18799,7 +20110,9 @@ def __init__( self.tags = tags self.sku = sku self.private_endpoint = private_endpoint - self.private_link_service_connection_state = private_link_service_connection_state + self.private_link_service_connection_state = ( + private_link_service_connection_state + ) self.provisioning_state = None @@ -18811,7 +20124,7 @@ class PrivateEndpointConnectionListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + "value": {"key": "value", "type": "[PrivateEndpointConnection]"}, } def __init__( @@ -18861,26 +20174,32 @@ class PrivateLinkResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'group_id': {'readonly': True}, - 'required_members': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "group_id": {"readonly": True}, + "required_members": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, - 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "group_id": {"key": "properties.groupId", "type": "str"}, + "required_members": { + "key": "properties.requiredMembers", + "type": "[str]", + }, + "required_zone_names": { + "key": "properties.requiredZoneNames", + "type": "[str]", + }, } def __init__( @@ -18923,14 +20242,11 @@ class PrivateLinkResourceListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + "value": {"key": "value", "type": "[PrivateLinkResource]"}, } def __init__( - self, - *, - value: Optional[List["PrivateLinkResource"]] = None, - **kwargs + self, *, value: Optional[List["PrivateLinkResource"]] = None, **kwargs ): """ :keyword value: Array of private link resources. @@ -18956,15 +20272,17 @@ class PrivateLinkServiceConnectionState(msrest.serialization.Model): """ _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + "status": {"key": "status", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "actions_required": {"key": "actionsRequired", "type": "str"}, } def __init__( self, *, - status: Optional[Union[str, "PrivateEndpointServiceConnectionStatus"]] = None, + status: Optional[ + Union[str, "PrivateEndpointServiceConnectionStatus"] + ] = None, description: Optional[str] = None, actions_required: Optional[str] = None, **kwargs @@ -19003,11 +20321,11 @@ class ProbeSettings(msrest.serialization.Model): """ _attribute_map = { - 'failure_threshold': {'key': 'failureThreshold', 'type': 'int'}, - 'initial_delay': {'key': 'initialDelay', 'type': 'duration'}, - 'period': {'key': 'period', 'type': 'duration'}, - 'success_threshold': {'key': 'successThreshold', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "failure_threshold": {"key": "failureThreshold", "type": "int"}, + "initial_delay": {"key": "initialDelay", "type": "duration"}, + "period": {"key": "period", "type": "duration"}, + "success_threshold": {"key": "successThreshold", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } def __init__( @@ -19058,25 +20376,33 @@ class ProgressMetrics(msrest.serialization.Model): """ _validation = { - 'completed_datapoint_count': {'readonly': True}, - 'incremental_data_last_refresh_date_time': {'readonly': True}, - 'skipped_datapoint_count': {'readonly': True}, - 'total_datapoint_count': {'readonly': True}, + "completed_datapoint_count": {"readonly": True}, + "incremental_data_last_refresh_date_time": {"readonly": True}, + "skipped_datapoint_count": {"readonly": True}, + "total_datapoint_count": {"readonly": True}, } _attribute_map = { - 'completed_datapoint_count': {'key': 'completedDatapointCount', 'type': 'long'}, - 'incremental_data_last_refresh_date_time': {'key': 'incrementalDataLastRefreshDateTime', 'type': 'iso-8601'}, - 'skipped_datapoint_count': {'key': 'skippedDatapointCount', 'type': 'long'}, - 'total_datapoint_count': {'key': 'totalDatapointCount', 'type': 'long'}, + "completed_datapoint_count": { + "key": "completedDatapointCount", + "type": "long", + }, + "incremental_data_last_refresh_date_time": { + "key": "incrementalDataLastRefreshDateTime", + "type": "iso-8601", + }, + "skipped_datapoint_count": { + "key": "skippedDatapointCount", + "type": "long", + }, + "total_datapoint_count": { + "key": "totalDatapointCount", + "type": "long", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ProgressMetrics, self).__init__(**kwargs) self.completed_datapoint_count = None self.incremental_data_last_refresh_date_time = None @@ -19097,26 +20423,26 @@ class PyTorch(DistributionConfiguration): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, + "distribution_type": {"key": "distributionType", "type": "str"}, + "process_count_per_instance": { + "key": "processCountPerInstance", + "type": "int", + }, } def __init__( - self, - *, - process_count_per_instance: Optional[int] = None, - **kwargs + self, *, process_count_per_instance: Optional[int] = None, **kwargs ): """ :keyword process_count_per_instance: Number of processes per node. :paramtype process_count_per_instance: int """ super(PyTorch, self).__init__(**kwargs) - self.distribution_type = 'PyTorch' # type: str + self.distribution_type = "PyTorch" # type: str self.process_count_per_instance = process_count_per_instance @@ -19134,10 +20460,10 @@ class QuotaBaseProperties(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "limit": {"key": "limit", "type": "long"}, + "unit": {"key": "unit", "type": "str"}, } def __init__( @@ -19177,8 +20503,8 @@ class QuotaUpdateParameters(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[QuotaBaseProperties]'}, - 'location': {'key': 'location', 'type': 'str'}, + "value": {"key": "value", "type": "[QuotaBaseProperties]"}, + "location": {"key": "location", "type": "str"}, } def __init__( @@ -19216,13 +20542,16 @@ class RandomSamplingAlgorithm(SamplingAlgorithm): """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - 'rule': {'key': 'rule', 'type': 'str'}, - 'seed': {'key': 'seed', 'type': 'int'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, + "rule": {"key": "rule", "type": "str"}, + "seed": {"key": "seed", "type": "int"}, } def __init__( @@ -19240,7 +20569,7 @@ def __init__( :paramtype seed: int """ super(RandomSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Random' # type: str + self.sampling_algorithm_type = "Random" # type: str self.rule = rule self.seed = seed @@ -19264,11 +20593,11 @@ class Recurrence(msrest.serialization.Model): """ _attribute_map = { - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceSchedule'}, + "frequency": {"key": "frequency", "type": "str"}, + "interval": {"key": "interval", "type": "int"}, + "start_time": {"key": "startTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "schedule": {"key": "schedule", "type": "RecurrenceSchedule"}, } def __init__( @@ -19320,15 +20649,15 @@ class RecurrenceSchedule(msrest.serialization.Model): """ _validation = { - 'hours': {'required': True}, - 'minutes': {'required': True}, + "hours": {"required": True}, + "minutes": {"required": True}, } _attribute_map = { - 'hours': {'key': 'hours', 'type': '[int]'}, - 'minutes': {'key': 'minutes', 'type': '[int]'}, - 'month_days': {'key': 'monthDays', 'type': '[int]'}, - 'week_days': {'key': 'weekDays', 'type': '[str]'}, + "hours": {"key": "hours", "type": "[int]"}, + "minutes": {"key": "minutes", "type": "[int]"}, + "month_days": {"key": "monthDays", "type": "[int]"}, + "week_days": {"key": "weekDays", "type": "[str]"}, } def __init__( @@ -19387,19 +20716,19 @@ class RecurrenceTrigger(TriggerBase): """ _validation = { - 'trigger_type': {'required': True}, - 'frequency': {'required': True}, - 'interval': {'required': True}, + "trigger_type": {"required": True}, + "frequency": {"required": True}, + "interval": {"required": True}, } _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceSchedule'}, + "end_time": {"key": "endTime", "type": "str"}, + "start_time": {"key": "startTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "trigger_type": {"key": "triggerType", "type": "str"}, + "frequency": {"key": "frequency", "type": "str"}, + "interval": {"key": "interval", "type": "int"}, + "schedule": {"key": "schedule", "type": "RecurrenceSchedule"}, } def __init__( @@ -19435,8 +20764,13 @@ def __init__( :keyword schedule: The recurrence schedule. :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule """ - super(RecurrenceTrigger, self).__init__(end_time=end_time, start_time=start_time, time_zone=time_zone, **kwargs) - self.trigger_type = 'Recurrence' # type: str + super(RecurrenceTrigger, self).__init__( + end_time=end_time, + start_time=start_time, + time_zone=time_zone, + **kwargs + ) + self.trigger_type = "Recurrence" # type: str self.frequency = frequency self.interval = interval self.schedule = schedule @@ -19455,12 +20789,12 @@ class RegenerateEndpointKeysRequest(msrest.serialization.Model): """ _validation = { - 'key_type': {'required': True}, + "key_type": {"required": True}, } _attribute_map = { - 'key_type': {'key': 'keyType', 'type': 'str'}, - 'key_value': {'key': 'keyValue', 'type': 'str'}, + "key_type": {"key": "keyType", "type": "str"}, + "key_value": {"key": "keyValue", "type": "str"}, } def __init__( @@ -19516,25 +20850,25 @@ class Registry(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'RegistryProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": {"key": "properties", "type": "RegistryProperties"}, + "sku": {"key": "sku", "type": "Sku"}, } def __init__( @@ -19584,21 +20918,18 @@ class RegistryListCredentialsResult(msrest.serialization.Model): """ _validation = { - 'location': {'readonly': True}, - 'username': {'readonly': True}, + "location": {"readonly": True}, + "username": {"readonly": True}, } _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'username': {'key': 'username', 'type': 'str'}, - 'passwords': {'key': 'passwords', 'type': '[Password]'}, + "location": {"key": "location", "type": "str"}, + "username": {"key": "username", "type": "str"}, + "passwords": {"key": "passwords", "type": "[Password]"}, } def __init__( - self, - *, - passwords: Optional[List["Password"]] = None, - **kwargs + self, *, passwords: Optional[List["Password"]] = None, **kwargs ): """ :keyword passwords: @@ -19640,17 +20971,29 @@ class RegistryProperties(ResourceBase): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, - 'discovery_url': {'key': 'discoveryUrl', 'type': 'str'}, - 'intellectual_property_publisher': {'key': 'intellectualPropertyPublisher', 'type': 'str'}, - 'managed_resource_group': {'key': 'managedResourceGroup', 'type': 'ArmResourceId'}, - 'ml_flow_registry_uri': {'key': 'mlFlowRegistryUri', 'type': 'str'}, - 'private_link_count': {'key': 'privateLinkCount', 'type': 'int'}, - 'region_details': {'key': 'regionDetails', 'type': '[RegistryRegionArmDetails]'}, - 'managed_resource_group_tags': {'key': 'managedResourceGroupTags', 'type': '{str}'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "public_network_access": {"key": "publicNetworkAccess", "type": "str"}, + "discovery_url": {"key": "discoveryUrl", "type": "str"}, + "intellectual_property_publisher": { + "key": "intellectualPropertyPublisher", + "type": "str", + }, + "managed_resource_group": { + "key": "managedResourceGroup", + "type": "ArmResourceId", + }, + "ml_flow_registry_uri": {"key": "mlFlowRegistryUri", "type": "str"}, + "private_link_count": {"key": "privateLinkCount", "type": "int"}, + "region_details": { + "key": "regionDetails", + "type": "[RegistryRegionArmDetails]", + }, + "managed_resource_group_tags": { + "key": "managedResourceGroupTags", + "type": "{str}", + }, } def __init__( @@ -19695,7 +21038,9 @@ def __init__( associated with this registry. :paramtype managed_resource_group_tags: dict[str, str] """ - super(RegistryProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + super(RegistryProperties, self).__init__( + description=description, properties=properties, tags=tags, **kwargs + ) self.public_network_access = public_network_access self.discovery_url = discovery_url self.intellectual_property_publisher = intellectual_property_publisher @@ -19719,9 +21064,12 @@ class RegistryRegionArmDetails(msrest.serialization.Model): """ _attribute_map = { - 'acr_details': {'key': 'acrDetails', 'type': '[AcrDetails]'}, - 'location': {'key': 'location', 'type': 'str'}, - 'storage_account_details': {'key': 'storageAccountDetails', 'type': '[StorageAccountDetails]'}, + "acr_details": {"key": "acrDetails", "type": "[AcrDetails]"}, + "location": {"key": "location", "type": "str"}, + "storage_account_details": { + "key": "storageAccountDetails", + "type": "[StorageAccountDetails]", + }, } def __init__( @@ -19729,7 +21077,9 @@ def __init__( *, acr_details: Optional[List["AcrDetails"]] = None, location: Optional[str] = None, - storage_account_details: Optional[List["StorageAccountDetails"]] = None, + storage_account_details: Optional[ + List["StorageAccountDetails"] + ] = None, **kwargs ): """ @@ -19758,8 +21108,8 @@ class RegistryTrackedResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Registry]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[Registry]"}, } def __init__( @@ -19776,7 +21126,9 @@ def __init__( :keyword value: An array of objects of type Registry. :paramtype value: list[~azure.mgmt.machinelearningservices.models.Registry] """ - super(RegistryTrackedResourceArmPaginatedResult, self).__init__(**kwargs) + super(RegistryTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -19845,29 +21197,56 @@ class Regression(AutoMLVertical, TableVertical): """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'RegressionTrainingSettings'}, + "task_type": {"required": True}, + "training_data": {"required": True}, + } + + _attribute_map = { + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "TableFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "search_space": { + "key": "searchSpace", + "type": "[TableParameterSubspace]", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "TableSweepSettings", + }, + "test_data": {"key": "testData", "type": "MLTableJobInput"}, + "test_data_size": {"key": "testDataSize", "type": "float"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "weight_column_name": {"key": "weightColumnName", "type": "str"}, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, + "training_settings": { + "key": "trainingSettings", + "type": "RegressionTrainingSettings", + }, } def __init__( @@ -19875,7 +21254,9 @@ def __init__( *, training_data: "MLTableJobInput", cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "TableVerticalFeaturizationSettings" + ] = None, fixed_parameters: Optional["TableFixedParameters"] = None, limit_settings: Optional["TableVerticalLimitSettings"] = None, n_cross_validations: Optional["NCrossValidations"] = None, @@ -19888,7 +21269,9 @@ def __init__( weight_column_name: Optional[str] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "RegressionPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "RegressionPrimaryMetrics"] + ] = None, training_settings: Optional["RegressionTrainingSettings"] = None, **kwargs ): @@ -19948,7 +21331,24 @@ def __init__( :paramtype training_settings: ~azure.mgmt.machinelearningservices.models.RegressionTrainingSettings """ - super(Regression, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, cv_split_column_names=cv_split_column_names, featurization_settings=featurization_settings, fixed_parameters=fixed_parameters, limit_settings=limit_settings, n_cross_validations=n_cross_validations, search_space=search_space, sweep_settings=sweep_settings, test_data=test_data, test_data_size=test_data_size, validation_data=validation_data, validation_data_size=validation_data_size, weight_column_name=weight_column_name, **kwargs) + super(Regression, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + cv_split_column_names=cv_split_column_names, + featurization_settings=featurization_settings, + fixed_parameters=fixed_parameters, + limit_settings=limit_settings, + n_cross_validations=n_cross_validations, + search_space=search_space, + sweep_settings=sweep_settings, + test_data=test_data, + test_data_size=test_data_size, + validation_data=validation_data, + validation_data_size=validation_data_size, + weight_column_name=weight_column_name, + **kwargs + ) self.cv_split_column_names = cv_split_column_names self.featurization_settings = featurization_settings self.fixed_parameters = fixed_parameters @@ -19961,7 +21361,7 @@ def __init__( self.validation_data = validation_data self.validation_data_size = validation_data_size self.weight_column_name = weight_column_name - self.task_type = 'Regression' # type: str + self.task_type = "Regression" # type: str self.primary_metric = primary_metric self.training_settings = training_settings self.log_verbosity = log_verbosity @@ -19998,15 +21398,36 @@ class RegressionTrainingSettings(TrainingSettings): """ _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, + "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, + "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, + "allowed_training_algorithms": { + "key": "allowedTrainingAlgorithms", + "type": "[str]", + }, + "blocked_training_algorithms": { + "key": "blockedTrainingAlgorithms", + "type": "[str]", + }, } def __init__( @@ -20019,8 +21440,12 @@ def __init__( enable_vote_ensemble: Optional[bool] = True, ensemble_model_download_timeout: Optional[datetime.timedelta] = "PT5M", stack_ensemble_settings: Optional["StackEnsembleSettings"] = None, - allowed_training_algorithms: Optional[List[Union[str, "RegressionModels"]]] = None, - blocked_training_algorithms: Optional[List[Union[str, "RegressionModels"]]] = None, + allowed_training_algorithms: Optional[ + List[Union[str, "RegressionModels"]] + ] = None, + blocked_training_algorithms: Optional[ + List[Union[str, "RegressionModels"]] + ] = None, **kwargs ): """ @@ -20048,7 +21473,16 @@ def __init__( :paramtype blocked_training_algorithms: list[str or ~azure.mgmt.machinelearningservices.models.RegressionModels] """ - super(RegressionTrainingSettings, self).__init__(enable_dnn_training=enable_dnn_training, enable_model_explainability=enable_model_explainability, enable_onnx_compatible_models=enable_onnx_compatible_models, enable_stack_ensemble=enable_stack_ensemble, enable_vote_ensemble=enable_vote_ensemble, ensemble_model_download_timeout=ensemble_model_download_timeout, stack_ensemble_settings=stack_ensemble_settings, **kwargs) + super(RegressionTrainingSettings, self).__init__( + enable_dnn_training=enable_dnn_training, + enable_model_explainability=enable_model_explainability, + enable_onnx_compatible_models=enable_onnx_compatible_models, + enable_stack_ensemble=enable_stack_ensemble, + enable_vote_ensemble=enable_vote_ensemble, + ensemble_model_download_timeout=ensemble_model_download_timeout, + stack_ensemble_settings=stack_ensemble_settings, + **kwargs + ) self.allowed_training_algorithms = allowed_training_algorithms self.blocked_training_algorithms = blocked_training_algorithms @@ -20063,19 +21497,14 @@ class ResourceId(msrest.serialization.Model): """ _validation = { - 'id': {'required': True}, + "id": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, } - def __init__( - self, - *, - id: str, - **kwargs - ): + def __init__(self, *, id: str, **kwargs): """ :keyword id: Required. The ID of the resource. :paramtype id: str @@ -20096,21 +21525,17 @@ class ResourceName(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, + "value": {"readonly": True}, + "localized_value": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + "value": {"key": "value", "type": "str"}, + "localized_value": {"key": "localizedValue", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ResourceName, self).__init__(**kwargs) self.value = None self.localized_value = None @@ -20136,29 +21561,28 @@ class ResourceQuota(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'name': {'readonly': True}, - 'limit': {'readonly': True}, - 'unit': {'readonly': True}, + "id": {"readonly": True}, + "aml_workspace_location": {"readonly": True}, + "type": {"readonly": True}, + "name": {"readonly": True}, + "limit": {"readonly": True}, + "unit": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'ResourceName'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "aml_workspace_location": { + "key": "amlWorkspaceLocation", + "type": "str", + }, + "type": {"key": "type", "type": "str"}, + "name": {"key": "name", "type": "ResourceName"}, + "limit": {"key": "limit", "type": "long"}, + "unit": {"key": "unit", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ResourceQuota, self).__init__(**kwargs) self.id = None self.aml_workspace_location = None @@ -20180,22 +21604,16 @@ class Route(msrest.serialization.Model): """ _validation = { - 'path': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'port': {'required': True}, + "path": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "port": {"required": True}, } _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, + "path": {"key": "path", "type": "str"}, + "port": {"key": "port", "type": "int"}, } - def __init__( - self, - *, - path: str, - port: int, - **kwargs - ): + def __init__(self, *, path: str, port: int, **kwargs): """ :keyword path: Required. [Required] The path for the route. :paramtype path: str @@ -20207,7 +21625,9 @@ def __init__( self.port = port -class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class SASAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """SASAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -20230,16 +21650,19 @@ class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionSharedAccessSignature'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionSharedAccessSignature", + }, } def __init__( @@ -20249,7 +21672,9 @@ def __init__( target: Optional[str] = None, value: Optional[str] = None, value_format: Optional[Union[str, "ValueFormat"]] = None, - credentials: Optional["WorkspaceConnectionSharedAccessSignature"] = None, + credentials: Optional[ + "WorkspaceConnectionSharedAccessSignature" + ] = None, **kwargs ): """ @@ -20266,8 +21691,14 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature """ - super(SASAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'SAS' # type: str + super(SASAuthTypeWorkspaceConnectionProperties, self).__init__( + category=category, + target=target, + value=value, + value_format=value_format, + **kwargs + ) + self.auth_type = "SAS" # type: str self.credentials = credentials @@ -20285,27 +21716,22 @@ class SasDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, + "credentials_type": {"required": True}, + "secrets": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'SasDatastoreSecrets'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "secrets": {"key": "secrets", "type": "SasDatastoreSecrets"}, } - def __init__( - self, - *, - secrets: "SasDatastoreSecrets", - **kwargs - ): + def __init__(self, *, secrets: "SasDatastoreSecrets", **kwargs): """ :keyword secrets: Required. [Required] Storage container secrets. :paramtype secrets: ~azure.mgmt.machinelearningservices.models.SasDatastoreSecrets """ super(SasDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Sas' # type: str + self.credentials_type = "Sas" # type: str self.secrets = secrets @@ -20323,26 +21749,21 @@ class SasDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'sas_token': {'key': 'sasToken', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "sas_token": {"key": "sasToken", "type": "str"}, } - def __init__( - self, - *, - sas_token: Optional[str] = None, - **kwargs - ): + def __init__(self, *, sas_token: Optional[str] = None, **kwargs): """ :keyword sas_token: Storage container SAS token. :paramtype sas_token: str """ super(SasDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Sas' # type: str + self.secrets_type = "Sas" # type: str self.sas_token = sas_token @@ -20361,13 +21782,16 @@ class ScaleSettings(msrest.serialization.Model): """ _validation = { - 'max_node_count': {'required': True}, + "max_node_count": {"required": True}, } _attribute_map = { - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'node_idle_time_before_scale_down': {'key': 'nodeIdleTimeBeforeScaleDown', 'type': 'duration'}, + "max_node_count": {"key": "maxNodeCount", "type": "int"}, + "min_node_count": {"key": "minNodeCount", "type": "int"}, + "node_idle_time_before_scale_down": { + "key": "nodeIdleTimeBeforeScaleDown", + "type": "duration", + }, } def __init__( @@ -20390,7 +21814,9 @@ def __init__( super(ScaleSettings, self).__init__(**kwargs) self.max_node_count = max_node_count self.min_node_count = min_node_count - self.node_idle_time_before_scale_down = node_idle_time_before_scale_down + self.node_idle_time_before_scale_down = ( + node_idle_time_before_scale_down + ) class ScaleSettingsInformation(msrest.serialization.Model): @@ -20401,14 +21827,11 @@ class ScaleSettingsInformation(msrest.serialization.Model): """ _attribute_map = { - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, + "scale_settings": {"key": "scaleSettings", "type": "ScaleSettings"}, } def __init__( - self, - *, - scale_settings: Optional["ScaleSettings"] = None, - **kwargs + self, *, scale_settings: Optional["ScaleSettings"] = None, **kwargs ): """ :keyword scale_settings: scale settings for AML Compute. @@ -20441,27 +21864,22 @@ class Schedule(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ScheduleProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "ScheduleProperties"}, } - def __init__( - self, - *, - properties: "ScheduleProperties", - **kwargs - ): + def __init__(self, *, properties: "ScheduleProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ScheduleProperties @@ -20485,16 +21903,18 @@ class ScheduleBase(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "provisioning_status": {"key": "provisioningStatus", "type": "str"}, + "status": {"key": "status", "type": "str"}, } def __init__( self, *, id: Optional[str] = None, - provisioning_status: Optional[Union[str, "ScheduleProvisioningState"]] = None, + provisioning_status: Optional[ + Union[str, "ScheduleProvisioningState"] + ] = None, status: Optional[Union[str, "ScheduleStatus"]] = None, **kwargs ): @@ -20543,20 +21963,20 @@ class ScheduleProperties(ResourceBase): """ _validation = { - 'action': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'trigger': {'required': True}, + "action": {"required": True}, + "provisioning_state": {"readonly": True}, + "trigger": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'action': {'key': 'action', 'type': 'ScheduleActionBase'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'trigger': {'key': 'trigger', 'type': 'TriggerBase'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "action": {"key": "action", "type": "ScheduleActionBase"}, + "display_name": {"key": "displayName", "type": "str"}, + "is_enabled": {"key": "isEnabled", "type": "bool"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "trigger": {"key": "trigger", "type": "TriggerBase"}, } def __init__( @@ -20587,7 +22007,9 @@ def __init__( :keyword trigger: Required. [Required] Specifies the trigger details. :paramtype trigger: ~azure.mgmt.machinelearningservices.models.TriggerBase """ - super(ScheduleProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + super(ScheduleProperties, self).__init__( + description=description, properties=properties, tags=tags, **kwargs + ) self.action = action self.display_name = display_name self.is_enabled = is_enabled @@ -20606,8 +22028,8 @@ class ScheduleResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Schedule]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[Schedule]"}, } def __init__( @@ -20643,10 +22065,10 @@ class ScriptReference(msrest.serialization.Model): """ _attribute_map = { - 'script_source': {'key': 'scriptSource', 'type': 'str'}, - 'script_data': {'key': 'scriptData', 'type': 'str'}, - 'script_arguments': {'key': 'scriptArguments', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'str'}, + "script_source": {"key": "scriptSource", "type": "str"}, + "script_data": {"key": "scriptData", "type": "str"}, + "script_arguments": {"key": "scriptArguments", "type": "str"}, + "timeout": {"key": "timeout", "type": "str"}, } def __init__( @@ -20685,8 +22107,11 @@ class ScriptsToExecute(msrest.serialization.Model): """ _attribute_map = { - 'startup_script': {'key': 'startupScript', 'type': 'ScriptReference'}, - 'creation_script': {'key': 'creationScript', 'type': 'ScriptReference'}, + "startup_script": {"key": "startupScript", "type": "ScriptReference"}, + "creation_script": { + "key": "creationScript", + "type": "ScriptReference", + }, } def __init__( @@ -20715,14 +22140,11 @@ class ServiceManagedResourcesSettings(msrest.serialization.Model): """ _attribute_map = { - 'cosmos_db': {'key': 'cosmosDb', 'type': 'CosmosDbSettings'}, + "cosmos_db": {"key": "cosmosDb", "type": "CosmosDbSettings"}, } def __init__( - self, - *, - cosmos_db: Optional["CosmosDbSettings"] = None, - **kwargs + self, *, cosmos_db: Optional["CosmosDbSettings"] = None, **kwargs ): """ :keyword cosmos_db: The settings for the service managed cosmosdb account. @@ -20732,7 +22154,9 @@ def __init__( self.cosmos_db = cosmos_db -class ServicePrincipalAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class ServicePrincipalAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """ServicePrincipalAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -20755,16 +22179,19 @@ class ServicePrincipalAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionP """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionServicePrincipal'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionServicePrincipal", + }, } def __init__( @@ -20791,8 +22218,16 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionServicePrincipal """ - super(ServicePrincipalAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'ServicePrincipal' # type: str + super( + ServicePrincipalAuthTypeWorkspaceConnectionProperties, self + ).__init__( + category=category, + target=target, + value=value, + value_format=value_format, + **kwargs + ) + self.auth_type = "ServicePrincipal" # type: str self.credentials = credentials @@ -20818,19 +22253,22 @@ class ServicePrincipalDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, + "credentials_type": {"required": True}, + "client_id": {"required": True}, + "secrets": {"required": True}, + "tenant_id": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'ServicePrincipalDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "authority_url": {"key": "authorityUrl", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + "resource_url": {"key": "resourceUrl", "type": "str"}, + "secrets": { + "key": "secrets", + "type": "ServicePrincipalDatastoreSecrets", + }, + "tenant_id": {"key": "tenantId", "type": "str"}, } def __init__( @@ -20857,7 +22295,7 @@ def __init__( :paramtype tenant_id: str """ super(ServicePrincipalDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'ServicePrincipal' # type: str + self.credentials_type = "ServicePrincipal" # type: str self.authority_url = authority_url self.client_id = client_id self.resource_url = resource_url @@ -20879,26 +22317,21 @@ class ServicePrincipalDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "client_secret": {"key": "clientSecret", "type": "str"}, } - def __init__( - self, - *, - client_secret: Optional[str] = None, - **kwargs - ): + def __init__(self, *, client_secret: Optional[str] = None, **kwargs): """ :keyword client_secret: Service principal secret. :paramtype client_secret: str """ super(ServicePrincipalDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'ServicePrincipal' # type: str + self.secrets_type = "ServicePrincipal" # type: str self.client_secret = client_secret @@ -20910,14 +22343,11 @@ class SetupScripts(msrest.serialization.Model): """ _attribute_map = { - 'scripts': {'key': 'scripts', 'type': 'ScriptsToExecute'}, + "scripts": {"key": "scripts", "type": "ScriptsToExecute"}, } def __init__( - self, - *, - scripts: Optional["ScriptsToExecute"] = None, - **kwargs + self, *, scripts: Optional["ScriptsToExecute"] = None, **kwargs ): """ :keyword scripts: Customized setup scripts. @@ -20946,11 +22376,14 @@ class SharedPrivateLinkResource(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'private_link_resource_id': {'key': 'properties.privateLinkResourceId', 'type': 'str'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'request_message': {'key': 'properties.requestMessage', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "private_link_resource_id": { + "key": "properties.privateLinkResourceId", + "type": "str", + }, + "group_id": {"key": "properties.groupId", "type": "str"}, + "request_message": {"key": "properties.requestMessage", "type": "str"}, + "status": {"key": "properties.status", "type": "str"}, } def __init__( @@ -20960,7 +22393,9 @@ def __init__( private_link_resource_id: Optional[str] = None, group_id: Optional[str] = None, request_message: Optional[str] = None, - status: Optional[Union[str, "PrivateEndpointServiceConnectionStatus"]] = None, + status: Optional[ + Union[str, "PrivateEndpointServiceConnectionStatus"] + ] = None, **kwargs ): """ @@ -21009,15 +22444,15 @@ class Sku(msrest.serialization.Model): """ _validation = { - 'name': {'required': True}, + "name": {"required": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'int'}, + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, + "size": {"key": "size", "type": "str"}, + "family": {"key": "family", "type": "str"}, + "capacity": {"key": "capacity", "type": "int"}, } def __init__( @@ -21070,10 +22505,10 @@ class SkuCapacity(msrest.serialization.Model): """ _attribute_map = { - 'default': {'key': 'default', 'type': 'int'}, - 'maximum': {'key': 'maximum', 'type': 'int'}, - 'minimum': {'key': 'minimum', 'type': 'int'}, - 'scale_type': {'key': 'scaleType', 'type': 'str'}, + "default": {"key": "default", "type": "int"}, + "maximum": {"key": "maximum", "type": "int"}, + "minimum": {"key": "minimum", "type": "int"}, + "scale_type": {"key": "scaleType", "type": "str"}, } def __init__( @@ -21117,13 +22552,13 @@ class SkuResource(msrest.serialization.Model): """ _validation = { - 'resource_type': {'readonly': True}, + "resource_type": {"readonly": True}, } _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'SkuSetting'}, + "capacity": {"key": "capacity", "type": "SkuCapacity"}, + "resource_type": {"key": "resourceType", "type": "str"}, + "sku": {"key": "sku", "type": "SkuSetting"}, } def __init__( @@ -21156,8 +22591,8 @@ class SkuResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[SkuResource]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[SkuResource]"}, } def __init__( @@ -21194,12 +22629,12 @@ class SkuSetting(msrest.serialization.Model): """ _validation = { - 'name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, } def __init__( @@ -21288,37 +22723,40 @@ class SparkJob(JobBaseProperties): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'code_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'entry': {'required': True}, + "job_type": {"required": True}, + "status": {"readonly": True}, + "code_id": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "entry": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'archives': {'key': 'archives', 'type': '[str]'}, - 'args': {'key': 'args', 'type': 'str'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'conf': {'key': 'conf', 'type': '{str}'}, - 'entry': {'key': 'entry', 'type': 'SparkJobEntry'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'files': {'key': 'files', 'type': '[str]'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'jars': {'key': 'jars', 'type': '[str]'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'py_files': {'key': 'pyFiles', 'type': '[str]'}, - 'resources': {'key': 'resources', 'type': 'SparkResourceConfiguration'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "archives": {"key": "archives", "type": "[str]"}, + "args": {"key": "args", "type": "str"}, + "code_id": {"key": "codeId", "type": "str"}, + "conf": {"key": "conf", "type": "{str}"}, + "entry": {"key": "entry", "type": "SparkJobEntry"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "files": {"key": "files", "type": "[str]"}, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "jars": {"key": "jars", "type": "[str]"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "py_files": {"key": "pyFiles", "type": "[str]"}, + "resources": { + "key": "resources", + "type": "SparkResourceConfiguration", + }, } def __init__( @@ -21398,8 +22836,20 @@ def __init__( :keyword resources: Compute Resource configuration for the job. :paramtype resources: ~azure.mgmt.machinelearningservices.models.SparkResourceConfiguration """ - super(SparkJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, services=services, **kwargs) - self.job_type = 'Spark' # type: str + super(SparkJob, self).__init__( + description=description, + properties=properties, + tags=tags, + component_id=component_id, + compute_id=compute_id, + display_name=display_name, + experiment_name=experiment_name, + identity=identity, + is_archived=is_archived, + services=services, + **kwargs + ) + self.job_type = "Spark" # type: str self.archives = archives self.args = args self.code_id = code_id @@ -21429,23 +22879,22 @@ class SparkJobEntry(msrest.serialization.Model): """ _validation = { - 'spark_job_entry_type': {'required': True}, + "spark_job_entry_type": {"required": True}, } _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, + "spark_job_entry_type": {"key": "sparkJobEntryType", "type": "str"}, } _subtype_map = { - 'spark_job_entry_type': {'SparkJobPythonEntry': 'SparkJobPythonEntry', 'SparkJobScalaEntry': 'SparkJobScalaEntry'} + "spark_job_entry_type": { + "SparkJobPythonEntry": "SparkJobPythonEntry", + "SparkJobScalaEntry": "SparkJobScalaEntry", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(SparkJobEntry, self).__init__(**kwargs) self.spark_job_entry_type = None # type: Optional[str] @@ -21464,27 +22913,26 @@ class SparkJobPythonEntry(SparkJobEntry): """ _validation = { - 'spark_job_entry_type': {'required': True}, - 'file': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "spark_job_entry_type": {"required": True}, + "file": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - 'file': {'key': 'file', 'type': 'str'}, + "spark_job_entry_type": {"key": "sparkJobEntryType", "type": "str"}, + "file": {"key": "file", "type": "str"}, } - def __init__( - self, - *, - file: str, - **kwargs - ): + def __init__(self, *, file: str, **kwargs): """ :keyword file: Required. [Required] Relative python file path for job entry point. :paramtype file: str """ super(SparkJobPythonEntry, self).__init__(**kwargs) - self.spark_job_entry_type = 'SparkJobPythonEntry' # type: str + self.spark_job_entry_type = "SparkJobPythonEntry" # type: str self.file = file @@ -21502,27 +22950,26 @@ class SparkJobScalaEntry(SparkJobEntry): """ _validation = { - 'spark_job_entry_type': {'required': True}, - 'class_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "spark_job_entry_type": {"required": True}, + "class_name": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - 'class_name': {'key': 'className', 'type': 'str'}, + "spark_job_entry_type": {"key": "sparkJobEntryType", "type": "str"}, + "class_name": {"key": "className", "type": "str"}, } - def __init__( - self, - *, - class_name: str, - **kwargs - ): + def __init__(self, *, class_name: str, **kwargs): """ :keyword class_name: Required. [Required] Scala class name used as entry point. :paramtype class_name: str """ super(SparkJobScalaEntry, self).__init__(**kwargs) - self.spark_job_entry_type = 'SparkJobScalaEntry' # type: str + self.spark_job_entry_type = "SparkJobScalaEntry" # type: str self.class_name = class_name @@ -21536,8 +22983,8 @@ class SparkResourceConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, + "instance_type": {"key": "instanceType", "type": "str"}, + "runtime_version": {"key": "runtimeVersion", "type": "str"}, } def __init__( @@ -21577,12 +23024,15 @@ class SslConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'cert': {'key': 'cert', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - 'cname': {'key': 'cname', 'type': 'str'}, - 'leaf_domain_label': {'key': 'leafDomainLabel', 'type': 'str'}, - 'overwrite_existing_domain': {'key': 'overwriteExistingDomain', 'type': 'bool'}, + "status": {"key": "status", "type": "str"}, + "cert": {"key": "cert", "type": "str"}, + "key": {"key": "key", "type": "str"}, + "cname": {"key": "cname", "type": "str"}, + "leaf_domain_label": {"key": "leafDomainLabel", "type": "str"}, + "overwrite_existing_domain": { + "key": "overwriteExistingDomain", + "type": "bool", + }, } def __init__( @@ -21639,9 +23089,18 @@ class StackEnsembleSettings(msrest.serialization.Model): """ _attribute_map = { - 'stack_meta_learner_k_wargs': {'key': 'stackMetaLearnerKWargs', 'type': 'object'}, - 'stack_meta_learner_train_percentage': {'key': 'stackMetaLearnerTrainPercentage', 'type': 'float'}, - 'stack_meta_learner_type': {'key': 'stackMetaLearnerType', 'type': 'str'}, + "stack_meta_learner_k_wargs": { + "key": "stackMetaLearnerKWargs", + "type": "object", + }, + "stack_meta_learner_train_percentage": { + "key": "stackMetaLearnerTrainPercentage", + "type": "float", + }, + "stack_meta_learner_type": { + "key": "stackMetaLearnerType", + "type": "str", + }, } def __init__( @@ -21649,7 +23108,9 @@ def __init__( *, stack_meta_learner_k_wargs: Optional[Any] = None, stack_meta_learner_train_percentage: Optional[float] = 0.2, - stack_meta_learner_type: Optional[Union[str, "StackMetaLearnerType"]] = None, + stack_meta_learner_type: Optional[ + Union[str, "StackMetaLearnerType"] + ] = None, **kwargs ): """ @@ -21669,7 +23130,9 @@ def __init__( """ super(StackEnsembleSettings, self).__init__(**kwargs) self.stack_meta_learner_k_wargs = stack_meta_learner_k_wargs - self.stack_meta_learner_train_percentage = stack_meta_learner_train_percentage + self.stack_meta_learner_train_percentage = ( + stack_meta_learner_train_percentage + ) self.stack_meta_learner_type = stack_meta_learner_type @@ -21690,25 +23153,21 @@ class StatusMessage(msrest.serialization.Model): """ _validation = { - 'code': {'readonly': True}, - 'created_date_time': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, + "code": {"readonly": True}, + "created_date_time": {"readonly": True}, + "level": {"readonly": True}, + "message": {"readonly": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, + "code": {"key": "code", "type": "str"}, + "created_date_time": {"key": "createdDateTime", "type": "iso-8601"}, + "level": {"key": "level", "type": "str"}, + "message": {"key": "message", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(StatusMessage, self).__init__(**kwargs) self.code = None self.created_date_time = None @@ -21728,15 +23187,25 @@ class StorageAccountDetails(msrest.serialization.Model): """ _attribute_map = { - 'system_created_storage_account': {'key': 'systemCreatedStorageAccount', 'type': 'SystemCreatedStorageAccount'}, - 'user_created_storage_account': {'key': 'userCreatedStorageAccount', 'type': 'UserCreatedStorageAccount'}, + "system_created_storage_account": { + "key": "systemCreatedStorageAccount", + "type": "SystemCreatedStorageAccount", + }, + "user_created_storage_account": { + "key": "userCreatedStorageAccount", + "type": "UserCreatedStorageAccount", + }, } def __init__( self, *, - system_created_storage_account: Optional["SystemCreatedStorageAccount"] = None, - user_created_storage_account: Optional["UserCreatedStorageAccount"] = None, + system_created_storage_account: Optional[ + "SystemCreatedStorageAccount" + ] = None, + user_created_storage_account: Optional[ + "UserCreatedStorageAccount" + ] = None, **kwargs ): """ @@ -21811,35 +23280,41 @@ class SweepJob(JobBaseProperties): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'objective': {'required': True}, - 'sampling_algorithm': {'required': True}, - 'search_space': {'required': True}, - 'trial': {'required': True}, + "job_type": {"required": True}, + "status": {"readonly": True}, + "objective": {"required": True}, + "sampling_algorithm": {"required": True}, + "search_space": {"required": True}, + "trial": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'SweepJobLimits'}, - 'objective': {'key': 'objective', 'type': 'Objective'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'SamplingAlgorithm'}, - 'search_space': {'key': 'searchSpace', 'type': 'object'}, - 'trial': {'key': 'trial', 'type': 'TrialComponent'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "limits": {"key": "limits", "type": "SweepJobLimits"}, + "objective": {"key": "objective", "type": "Objective"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "sampling_algorithm": { + "key": "samplingAlgorithm", + "type": "SamplingAlgorithm", + }, + "search_space": {"key": "searchSpace", "type": "object"}, + "trial": {"key": "trial", "type": "TrialComponent"}, } def __init__( @@ -21909,8 +23384,20 @@ def __init__( :keyword trial: Required. [Required] Trial component definition. :paramtype trial: ~azure.mgmt.machinelearningservices.models.TrialComponent """ - super(SweepJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, services=services, **kwargs) - self.job_type = 'Sweep' # type: str + super(SweepJob, self).__init__( + description=description, + properties=properties, + tags=tags, + component_id=component_id, + compute_id=compute_id, + display_name=display_name, + experiment_name=experiment_name, + identity=identity, + is_archived=is_archived, + services=services, + **kwargs + ) + self.job_type = "Sweep" # type: str self.early_termination = early_termination self.inputs = inputs self.limits = limits @@ -21941,15 +23428,15 @@ class SweepJobLimits(JobLimits): """ _validation = { - 'job_limits_type': {'required': True}, + "job_limits_type": {"required": True}, } _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_total_trials': {'key': 'maxTotalTrials', 'type': 'int'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, + "job_limits_type": {"key": "jobLimitsType", "type": "str"}, + "timeout": {"key": "timeout", "type": "duration"}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_total_trials": {"key": "maxTotalTrials", "type": "int"}, + "trial_timeout": {"key": "trialTimeout", "type": "duration"}, } def __init__( @@ -21973,7 +23460,7 @@ def __init__( :paramtype trial_timeout: ~datetime.timedelta """ super(SweepJobLimits, self).__init__(timeout=timeout, **kwargs) - self.job_limits_type = 'Sweep' # type: str + self.job_limits_type = "Sweep" # type: str self.max_concurrent_trials = max_concurrent_trials self.max_total_trials = max_total_trials self.trial_timeout = trial_timeout @@ -22018,28 +23505,31 @@ class SynapseSpark(Compute): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + "disable_local_auth": {"readonly": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'SynapseSparkProperties'}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, + "properties": {"key": "properties", "type": "SynapseSparkProperties"}, } def __init__( @@ -22058,8 +23548,10 @@ def __init__( :keyword properties: :paramtype properties: ~azure.mgmt.machinelearningservices.models.SynapseSparkProperties """ - super(SynapseSpark, self).__init__(description=description, resource_id=resource_id, **kwargs) - self.compute_type = 'SynapseSpark' # type: str + super(SynapseSpark, self).__init__( + description=description, resource_id=resource_id, **kwargs + ) + self.compute_type = "SynapseSpark" # type: str self.properties = properties @@ -22089,16 +23581,22 @@ class SynapseSparkProperties(msrest.serialization.Model): """ _attribute_map = { - 'auto_scale_properties': {'key': 'autoScaleProperties', 'type': 'AutoScaleProperties'}, - 'auto_pause_properties': {'key': 'autoPauseProperties', 'type': 'AutoPauseProperties'}, - 'spark_version': {'key': 'sparkVersion', 'type': 'str'}, - 'node_count': {'key': 'nodeCount', 'type': 'int'}, - 'node_size': {'key': 'nodeSize', 'type': 'str'}, - 'node_size_family': {'key': 'nodeSizeFamily', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'workspace_name': {'key': 'workspaceName', 'type': 'str'}, - 'pool_name': {'key': 'poolName', 'type': 'str'}, + "auto_scale_properties": { + "key": "autoScaleProperties", + "type": "AutoScaleProperties", + }, + "auto_pause_properties": { + "key": "autoPauseProperties", + "type": "AutoPauseProperties", + }, + "spark_version": {"key": "sparkVersion", "type": "str"}, + "node_count": {"key": "nodeCount", "type": "int"}, + "node_size": {"key": "nodeSize", "type": "str"}, + "node_size_family": {"key": "nodeSizeFamily", "type": "str"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, + "resource_group": {"key": "resourceGroup", "type": "str"}, + "workspace_name": {"key": "workspaceName", "type": "str"}, + "pool_name": {"key": "poolName", "type": "str"}, } def __init__( @@ -22163,8 +23661,8 @@ class SystemCreatedAcrAccount(msrest.serialization.Model): """ _attribute_map = { - 'acr_account_sku': {'key': 'acrAccountSku', 'type': 'str'}, - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, + "acr_account_sku": {"key": "acrAccountSku", "type": "str"}, + "arm_resource_id": {"key": "armResourceId", "type": "ArmResourceId"}, } def __init__( @@ -22205,9 +23703,12 @@ class SystemCreatedStorageAccount(msrest.serialization.Model): """ _attribute_map = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - 'storage_account_hns_enabled': {'key': 'storageAccountHnsEnabled', 'type': 'bool'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + "arm_resource_id": {"key": "armResourceId", "type": "ArmResourceId"}, + "storage_account_hns_enabled": { + "key": "storageAccountHnsEnabled", + "type": "bool", + }, + "storage_account_type": {"key": "storageAccountType", "type": "str"}, } def __init__( @@ -22260,12 +23761,12 @@ class SystemData(msrest.serialization.Model): """ _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + "created_by": {"key": "createdBy", "type": "str"}, + "created_by_type": {"key": "createdByType", "type": "str"}, + "created_at": {"key": "createdAt", "type": "iso-8601"}, + "last_modified_by": {"key": "lastModifiedBy", "type": "str"}, + "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"}, + "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, } def __init__( @@ -22319,23 +23820,19 @@ class SystemService(msrest.serialization.Model): """ _validation = { - 'system_service_type': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'version': {'readonly': True}, + "system_service_type": {"readonly": True}, + "public_ip_address": {"readonly": True}, + "version": {"readonly": True}, } _attribute_map = { - 'system_service_type': {'key': 'systemServiceType', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, + "system_service_type": {"key": "systemServiceType", "type": "str"}, + "public_ip_address": {"key": "publicIpAddress", "type": "str"}, + "version": {"key": "version", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(SystemService, self).__init__(**kwargs) self.system_service_type = None self.public_ip_address = None @@ -22390,26 +23887,26 @@ class TableFixedParameters(msrest.serialization.Model): """ _attribute_map = { - 'booster': {'key': 'booster', 'type': 'str'}, - 'boosting_type': {'key': 'boostingType', 'type': 'str'}, - 'grow_policy': {'key': 'growPolicy', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'max_bin': {'key': 'maxBin', 'type': 'int'}, - 'max_depth': {'key': 'maxDepth', 'type': 'int'}, - 'max_leaves': {'key': 'maxLeaves', 'type': 'int'}, - 'min_data_in_leaf': {'key': 'minDataInLeaf', 'type': 'int'}, - 'min_split_gain': {'key': 'minSplitGain', 'type': 'float'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'n_estimators': {'key': 'nEstimators', 'type': 'int'}, - 'num_leaves': {'key': 'numLeaves', 'type': 'int'}, - 'preprocessor_name': {'key': 'preprocessorName', 'type': 'str'}, - 'reg_alpha': {'key': 'regAlpha', 'type': 'float'}, - 'reg_lambda': {'key': 'regLambda', 'type': 'float'}, - 'subsample': {'key': 'subsample', 'type': 'float'}, - 'subsample_freq': {'key': 'subsampleFreq', 'type': 'float'}, - 'tree_method': {'key': 'treeMethod', 'type': 'str'}, - 'with_mean': {'key': 'withMean', 'type': 'bool'}, - 'with_std': {'key': 'withStd', 'type': 'bool'}, + "booster": {"key": "booster", "type": "str"}, + "boosting_type": {"key": "boostingType", "type": "str"}, + "grow_policy": {"key": "growPolicy", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "float"}, + "max_bin": {"key": "maxBin", "type": "int"}, + "max_depth": {"key": "maxDepth", "type": "int"}, + "max_leaves": {"key": "maxLeaves", "type": "int"}, + "min_data_in_leaf": {"key": "minDataInLeaf", "type": "int"}, + "min_split_gain": {"key": "minSplitGain", "type": "float"}, + "model_name": {"key": "modelName", "type": "str"}, + "n_estimators": {"key": "nEstimators", "type": "int"}, + "num_leaves": {"key": "numLeaves", "type": "int"}, + "preprocessor_name": {"key": "preprocessorName", "type": "str"}, + "reg_alpha": {"key": "regAlpha", "type": "float"}, + "reg_lambda": {"key": "regLambda", "type": "float"}, + "subsample": {"key": "subsample", "type": "float"}, + "subsample_freq": {"key": "subsampleFreq", "type": "float"}, + "tree_method": {"key": "treeMethod", "type": "str"}, + "with_mean": {"key": "withMean", "type": "bool"}, + "with_std": {"key": "withStd", "type": "bool"}, } def __init__( @@ -22552,26 +24049,26 @@ class TableParameterSubspace(msrest.serialization.Model): """ _attribute_map = { - 'booster': {'key': 'booster', 'type': 'str'}, - 'boosting_type': {'key': 'boostingType', 'type': 'str'}, - 'grow_policy': {'key': 'growPolicy', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'max_bin': {'key': 'maxBin', 'type': 'str'}, - 'max_depth': {'key': 'maxDepth', 'type': 'str'}, - 'max_leaves': {'key': 'maxLeaves', 'type': 'str'}, - 'min_data_in_leaf': {'key': 'minDataInLeaf', 'type': 'str'}, - 'min_split_gain': {'key': 'minSplitGain', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'n_estimators': {'key': 'nEstimators', 'type': 'str'}, - 'num_leaves': {'key': 'numLeaves', 'type': 'str'}, - 'preprocessor_name': {'key': 'preprocessorName', 'type': 'str'}, - 'reg_alpha': {'key': 'regAlpha', 'type': 'str'}, - 'reg_lambda': {'key': 'regLambda', 'type': 'str'}, - 'subsample': {'key': 'subsample', 'type': 'str'}, - 'subsample_freq': {'key': 'subsampleFreq', 'type': 'str'}, - 'tree_method': {'key': 'treeMethod', 'type': 'str'}, - 'with_mean': {'key': 'withMean', 'type': 'str'}, - 'with_std': {'key': 'withStd', 'type': 'str'}, + "booster": {"key": "booster", "type": "str"}, + "boosting_type": {"key": "boostingType", "type": "str"}, + "grow_policy": {"key": "growPolicy", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "str"}, + "max_bin": {"key": "maxBin", "type": "str"}, + "max_depth": {"key": "maxDepth", "type": "str"}, + "max_leaves": {"key": "maxLeaves", "type": "str"}, + "min_data_in_leaf": {"key": "minDataInLeaf", "type": "str"}, + "min_split_gain": {"key": "minSplitGain", "type": "str"}, + "model_name": {"key": "modelName", "type": "str"}, + "n_estimators": {"key": "nEstimators", "type": "str"}, + "num_leaves": {"key": "numLeaves", "type": "str"}, + "preprocessor_name": {"key": "preprocessorName", "type": "str"}, + "reg_alpha": {"key": "regAlpha", "type": "str"}, + "reg_lambda": {"key": "regLambda", "type": "str"}, + "subsample": {"key": "subsample", "type": "str"}, + "subsample_freq": {"key": "subsampleFreq", "type": "str"}, + "tree_method": {"key": "treeMethod", "type": "str"}, + "with_mean": {"key": "withMean", "type": "str"}, + "with_std": {"key": "withStd", "type": "str"}, } def __init__( @@ -22680,12 +24177,15 @@ class TableSweepSettings(msrest.serialization.Model): """ _validation = { - 'sampling_algorithm': {'required': True}, + "sampling_algorithm": {"required": True}, } _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, + "sampling_algorithm": {"key": "samplingAlgorithm", "type": "str"}, } def __init__( @@ -22735,23 +24235,39 @@ class TableVerticalFeaturizationSettings(FeaturizationSettings): """ _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - 'blocked_transformers': {'key': 'blockedTransformers', 'type': '[str]'}, - 'column_name_and_types': {'key': 'columnNameAndTypes', 'type': '{str}'}, - 'enable_dnn_featurization': {'key': 'enableDnnFeaturization', 'type': 'bool'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'transformer_params': {'key': 'transformerParams', 'type': '{[ColumnTransformer]}'}, + "dataset_language": {"key": "datasetLanguage", "type": "str"}, + "blocked_transformers": { + "key": "blockedTransformers", + "type": "[str]", + }, + "column_name_and_types": { + "key": "columnNameAndTypes", + "type": "{str}", + }, + "enable_dnn_featurization": { + "key": "enableDnnFeaturization", + "type": "bool", + }, + "mode": {"key": "mode", "type": "str"}, + "transformer_params": { + "key": "transformerParams", + "type": "{[ColumnTransformer]}", + }, } def __init__( self, *, dataset_language: Optional[str] = None, - blocked_transformers: Optional[List[Union[str, "BlockedTransformers"]]] = None, + blocked_transformers: Optional[ + List[Union[str, "BlockedTransformers"]] + ] = None, column_name_and_types: Optional[Dict[str, str]] = None, enable_dnn_featurization: Optional[bool] = False, mode: Optional[Union[str, "FeaturizationMode"]] = None, - transformer_params: Optional[Dict[str, List["ColumnTransformer"]]] = None, + transformer_params: Optional[ + Dict[str, List["ColumnTransformer"]] + ] = None, **kwargs ): """ @@ -22777,7 +24293,9 @@ def __init__( :paramtype transformer_params: dict[str, list[~azure.mgmt.machinelearningservices.models.ColumnTransformer]] """ - super(TableVerticalFeaturizationSettings, self).__init__(dataset_language=dataset_language, **kwargs) + super(TableVerticalFeaturizationSettings, self).__init__( + dataset_language=dataset_language, **kwargs + ) self.blocked_transformers = blocked_transformers self.column_name_and_types = column_name_and_types self.enable_dnn_featurization = enable_dnn_featurization @@ -22810,15 +24328,21 @@ class TableVerticalLimitSettings(msrest.serialization.Model): """ _attribute_map = { - 'enable_early_termination': {'key': 'enableEarlyTermination', 'type': 'bool'}, - 'exit_score': {'key': 'exitScore', 'type': 'float'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_cores_per_trial': {'key': 'maxCoresPerTrial', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'sweep_concurrent_trials': {'key': 'sweepConcurrentTrials', 'type': 'int'}, - 'sweep_trials': {'key': 'sweepTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, + "enable_early_termination": { + "key": "enableEarlyTermination", + "type": "bool", + }, + "exit_score": {"key": "exitScore", "type": "float"}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_cores_per_trial": {"key": "maxCoresPerTrial", "type": "int"}, + "max_trials": {"key": "maxTrials", "type": "int"}, + "sweep_concurrent_trials": { + "key": "sweepConcurrentTrials", + "type": "int", + }, + "sweep_trials": {"key": "sweepTrials", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, + "trial_timeout": {"key": "trialTimeout", "type": "duration"}, } def __init__( @@ -22890,15 +24414,18 @@ class TargetUtilizationScaleSettings(OnlineScaleSettings): """ _validation = { - 'scale_type': {'required': True}, + "scale_type": {"required": True}, } _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - 'max_instances': {'key': 'maxInstances', 'type': 'int'}, - 'min_instances': {'key': 'minInstances', 'type': 'int'}, - 'polling_interval': {'key': 'pollingInterval', 'type': 'duration'}, - 'target_utilization_percentage': {'key': 'targetUtilizationPercentage', 'type': 'int'}, + "scale_type": {"key": "scaleType", "type": "str"}, + "max_instances": {"key": "maxInstances", "type": "int"}, + "min_instances": {"key": "minInstances", "type": "int"}, + "polling_interval": {"key": "pollingInterval", "type": "duration"}, + "target_utilization_percentage": { + "key": "targetUtilizationPercentage", + "type": "int", + }, } def __init__( @@ -22923,7 +24450,7 @@ def __init__( :paramtype target_utilization_percentage: int """ super(TargetUtilizationScaleSettings, self).__init__(**kwargs) - self.scale_type = 'TargetUtilization' # type: str + self.scale_type = "TargetUtilization" # type: str self.max_instances = max_instances self.min_instances = min_instances self.polling_interval = polling_interval @@ -22945,13 +24472,16 @@ class TensorFlow(DistributionConfiguration): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'parameter_server_count': {'key': 'parameterServerCount', 'type': 'int'}, - 'worker_count': {'key': 'workerCount', 'type': 'int'}, + "distribution_type": {"key": "distributionType", "type": "str"}, + "parameter_server_count": { + "key": "parameterServerCount", + "type": "int", + }, + "worker_count": {"key": "workerCount", "type": "int"}, } def __init__( @@ -22968,76 +24498,93 @@ def __init__( :paramtype worker_count: int """ super(TensorFlow, self).__init__(**kwargs) - self.distribution_type = 'TensorFlow' # type: str + self.distribution_type = "TensorFlow" # type: str self.parameter_server_count = parameter_server_count self.worker_count = worker_count class TextClassification(AutoMLVertical, NlpVertical): """Text Classification task in AutoML NLP vertical. -NLP - Natural Language Processing. + NLP - Natural Language Processing. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-Classification task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar fixed_parameters: Model/training parameters that will remain constant throughout + training. + :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] + :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric for Text-Classification task. Possible values include: + "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, + "task_type": {"required": True}, + "training_data": {"required": True}, } _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "NlpFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "search_space": { + "key": "searchSpace", + "type": "[NlpParameterSubspace]", + }, + "sweep_settings": {"key": "sweepSettings", "type": "NlpSweepSettings"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( self, *, training_data: "MLTableJobInput", - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "NlpVerticalFeaturizationSettings" + ] = None, fixed_parameters: Optional["NlpFixedParameters"] = None, limit_settings: Optional["NlpVerticalLimitSettings"] = None, search_space: Optional[List["NlpParameterSubspace"]] = None, @@ -23045,7 +24592,9 @@ def __init__( validation_data: Optional["MLTableJobInput"] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "ClassificationPrimaryMetrics"] + ] = None, **kwargs ): """ @@ -23078,14 +24627,25 @@ def __init__( :paramtype primary_metric: str or ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ - super(TextClassification, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, featurization_settings=featurization_settings, fixed_parameters=fixed_parameters, limit_settings=limit_settings, search_space=search_space, sweep_settings=sweep_settings, validation_data=validation_data, **kwargs) + super(TextClassification, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + featurization_settings=featurization_settings, + fixed_parameters=fixed_parameters, + limit_settings=limit_settings, + search_space=search_space, + sweep_settings=sweep_settings, + validation_data=validation_data, + **kwargs + ) self.featurization_settings = featurization_settings self.fixed_parameters = fixed_parameters self.limit_settings = limit_settings self.search_space = search_space self.sweep_settings = sweep_settings self.validation_data = validation_data - self.task_type = 'TextClassification' # type: str + self.task_type = "TextClassification" # type: str self.primary_metric = primary_metric self.log_verbosity = log_verbosity self.target_column_name = target_column_name @@ -23094,73 +24654,90 @@ def __init__( class TextClassificationMultilabel(AutoMLVertical, NlpVertical): """Text Classification Multilabel task in AutoML NLP vertical. -NLP - Natural Language Processing. + NLP - Natural Language Processing. - Variables are only populated by the server, and will be ignored when sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-Classification-Multilabel task. - Currently only Accuracy is supported as primary metric, hence user need not set it explicitly. - Possible values include: "AUCWeighted", "Accuracy", "NormMacroRecall", - "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar fixed_parameters: Model/training parameters that will remain constant throughout + training. + :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] + :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric for Text-Classification-Multilabel task. + Currently only Accuracy is supported as primary metric, hence user need not set it explicitly. + Possible values include: "AUCWeighted", "Accuracy", "NormMacroRecall", + "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted", "IOU". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - 'primary_metric': {'readonly': True}, + "task_type": {"required": True}, + "training_data": {"required": True}, + "primary_metric": {"readonly": True}, } _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "NlpFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "search_space": { + "key": "searchSpace", + "type": "[NlpParameterSubspace]", + }, + "sweep_settings": {"key": "sweepSettings", "type": "NlpSweepSettings"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( self, *, training_data: "MLTableJobInput", - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "NlpVerticalFeaturizationSettings" + ] = None, fixed_parameters: Optional["NlpFixedParameters"] = None, limit_settings: Optional["NlpVerticalLimitSettings"] = None, search_space: Optional[List["NlpParameterSubspace"]] = None, @@ -23195,14 +24772,25 @@ def __init__( :keyword training_data: Required. [Required] Training data input. :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ - super(TextClassificationMultilabel, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, featurization_settings=featurization_settings, fixed_parameters=fixed_parameters, limit_settings=limit_settings, search_space=search_space, sweep_settings=sweep_settings, validation_data=validation_data, **kwargs) + super(TextClassificationMultilabel, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + featurization_settings=featurization_settings, + fixed_parameters=fixed_parameters, + limit_settings=limit_settings, + search_space=search_space, + sweep_settings=sweep_settings, + validation_data=validation_data, + **kwargs + ) self.featurization_settings = featurization_settings self.fixed_parameters = fixed_parameters self.limit_settings = limit_settings self.search_space = search_space self.sweep_settings = sweep_settings self.validation_data = validation_data - self.task_type = 'TextClassificationMultilabel' # type: str + self.task_type = "TextClassificationMultilabel" # type: str self.primary_metric = None self.log_verbosity = log_verbosity self.target_column_name = target_column_name @@ -23211,74 +24799,91 @@ def __init__( class TextNer(AutoMLVertical, NlpVertical): """Text-NER task in AutoML NLP vertical. -NER - Named Entity Recognition. -NLP - Natural Language Processing. + NER - Named Entity Recognition. + NLP - Natural Language Processing. - Variables are only populated by the server, and will be ignored when sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-NER task. - Only 'Accuracy' is supported for Text-NER, so user need not set this explicitly. Possible - values include: "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar fixed_parameters: Model/training parameters that will remain constant throughout + training. + :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] + :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric for Text-NER task. + Only 'Accuracy' is supported for Text-NER, so user need not set this explicitly. Possible + values include: "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - 'primary_metric': {'readonly': True}, + "task_type": {"required": True}, + "training_data": {"required": True}, + "primary_metric": {"readonly": True}, } _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "NlpFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "search_space": { + "key": "searchSpace", + "type": "[NlpParameterSubspace]", + }, + "sweep_settings": {"key": "sweepSettings", "type": "NlpSweepSettings"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( self, *, training_data: "MLTableJobInput", - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "NlpVerticalFeaturizationSettings" + ] = None, fixed_parameters: Optional["NlpFixedParameters"] = None, limit_settings: Optional["NlpVerticalLimitSettings"] = None, search_space: Optional[List["NlpParameterSubspace"]] = None, @@ -23313,14 +24918,25 @@ def __init__( :keyword training_data: Required. [Required] Training data input. :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ - super(TextNer, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, featurization_settings=featurization_settings, fixed_parameters=fixed_parameters, limit_settings=limit_settings, search_space=search_space, sweep_settings=sweep_settings, validation_data=validation_data, **kwargs) + super(TextNer, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + featurization_settings=featurization_settings, + fixed_parameters=fixed_parameters, + limit_settings=limit_settings, + search_space=search_space, + sweep_settings=sweep_settings, + validation_data=validation_data, + **kwargs + ) self.featurization_settings = featurization_settings self.fixed_parameters = fixed_parameters self.limit_settings = limit_settings self.search_space = search_space self.sweep_settings = sweep_settings self.validation_data = validation_data - self.task_type = 'TextNER' # type: str + self.task_type = "TextNER" # type: str self.primary_metric = None self.log_verbosity = log_verbosity self.target_column_name = target_column_name @@ -23335,15 +24951,10 @@ class TmpfsOptions(msrest.serialization.Model): """ _attribute_map = { - 'size': {'key': 'size', 'type': 'int'}, + "size": {"key": "size", "type": "int"}, } - def __init__( - self, - *, - size: Optional[int] = None, - **kwargs - ): + def __init__(self, *, size: Optional[int] = None, **kwargs): """ :keyword size: Mention the Tmpfs size. :paramtype size: int @@ -23375,17 +24986,27 @@ class TrialComponent(msrest.serialization.Model): """ _validation = { - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "command": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "environment_id": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, + "code_id": {"key": "codeId", "type": "str"}, + "command": {"key": "command", "type": "str"}, + "distribution": { + "key": "distribution", + "type": "DistributionConfiguration", + }, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "resources": {"key": "resources", "type": "JobResourceConfiguration"}, } def __init__( @@ -23444,15 +25065,15 @@ class TritonModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -23472,10 +25093,12 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(TritonModelJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(TritonModelJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'triton_model' # type: str + self.job_input_type = "triton_model" # type: str self.description = description @@ -23498,14 +25121,14 @@ class TritonModelJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -23525,10 +25148,12 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(TritonModelJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(TritonModelJobOutput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_output_type = 'triton_model' # type: str + self.job_output_type = "triton_model" # type: str self.description = description @@ -23550,14 +25175,17 @@ class TruncationSelectionPolicy(EarlyTerminationPolicy): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'truncation_percentage': {'key': 'truncationPercentage', 'type': 'int'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, + "truncation_percentage": { + "key": "truncationPercentage", + "type": "int", + }, } def __init__( @@ -23576,8 +25204,12 @@ def __init__( :keyword truncation_percentage: The percentage of runs to cancel at each evaluation interval. :paramtype truncation_percentage: int """ - super(TruncationSelectionPolicy, self).__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs) - self.policy_type = 'TruncationSelection' # type: str + super(TruncationSelectionPolicy, self).__init__( + delay_evaluation=delay_evaluation, + evaluation_interval=evaluation_interval, + **kwargs + ) + self.policy_type = "TruncationSelection" # type: str self.truncation_percentage = truncation_percentage @@ -23602,17 +25234,17 @@ class UpdateWorkspaceQuotas(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, + "id": {"readonly": True}, + "type": {"readonly": True}, + "unit": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "limit": {"key": "limit", "type": "long"}, + "unit": {"key": "unit", "type": "str"}, + "status": {"key": "status", "type": "str"}, } def __init__( @@ -23652,21 +25284,17 @@ class UpdateWorkspaceQuotasResult(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[UpdateWorkspaceQuotas]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[UpdateWorkspaceQuotas]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UpdateWorkspaceQuotasResult, self).__init__(**kwargs) self.value = None self.next_link = None @@ -23696,18 +25324,18 @@ class UriFileDataVersion(DataVersionBaseProperties): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, } def __init__( @@ -23736,8 +25364,16 @@ def __init__( Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20221001Preview.Assets.DataVersionBase.DataType. :paramtype data_uri: str """ - super(UriFileDataVersion, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, **kwargs) - self.data_type = 'uri_file' # type: str + super(UriFileDataVersion, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + data_uri=data_uri, + **kwargs + ) + self.data_type = "uri_file" # type: str class UriFileJobInput(JobInput, AssetJobInput): @@ -23759,15 +25395,15 @@ class UriFileJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -23787,10 +25423,12 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(UriFileJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(UriFileJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'uri_file' # type: str + self.job_input_type = "uri_file" # type: str self.description = description @@ -23813,14 +25451,14 @@ class UriFileJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -23840,10 +25478,12 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(UriFileJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(UriFileJobOutput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_output_type = 'uri_file' # type: str + self.job_output_type = "uri_file" # type: str self.description = description @@ -23871,18 +25511,18 @@ class UriFolderDataVersion(DataVersionBaseProperties): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, } def __init__( @@ -23911,8 +25551,16 @@ def __init__( Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20221001Preview.Assets.DataVersionBase.DataType. :paramtype data_uri: str """ - super(UriFolderDataVersion, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, **kwargs) - self.data_type = 'uri_folder' # type: str + super(UriFolderDataVersion, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + data_uri=data_uri, + **kwargs + ) + self.data_type = "uri_folder" # type: str class UriFolderJobInput(JobInput, AssetJobInput): @@ -23934,15 +25582,15 @@ class UriFolderJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -23962,10 +25610,12 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(UriFolderJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(UriFolderJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'uri_folder' # type: str + self.job_input_type = "uri_folder" # type: str self.description = description @@ -23988,14 +25638,14 @@ class UriFolderJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -24015,10 +25665,12 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(UriFolderJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(UriFolderJobOutput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_output_type = 'uri_folder' # type: str + self.job_output_type = "uri_folder" # type: str self.description = description @@ -24044,31 +25696,30 @@ class Usage(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, + "id": {"readonly": True}, + "aml_workspace_location": {"readonly": True}, + "type": {"readonly": True}, + "unit": {"readonly": True}, + "current_value": {"readonly": True}, + "limit": {"readonly": True}, + "name": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'current_value': {'key': 'currentValue', 'type': 'long'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'name': {'key': 'name', 'type': 'UsageName'}, + "id": {"key": "id", "type": "str"}, + "aml_workspace_location": { + "key": "amlWorkspaceLocation", + "type": "str", + }, + "type": {"key": "type", "type": "str"}, + "unit": {"key": "unit", "type": "str"}, + "current_value": {"key": "currentValue", "type": "long"}, + "limit": {"key": "limit", "type": "long"}, + "name": {"key": "name", "type": "UsageName"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Usage, self).__init__(**kwargs) self.id = None self.aml_workspace_location = None @@ -24091,21 +25742,17 @@ class UsageName(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, + "value": {"readonly": True}, + "localized_value": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + "value": {"key": "value", "type": "str"}, + "localized_value": {"key": "localizedValue", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UsageName, self).__init__(**kwargs) self.value = None self.localized_value = None @@ -24126,13 +25773,16 @@ class UserAccountCredentials(msrest.serialization.Model): """ _validation = { - 'admin_user_name': {'required': True}, + "admin_user_name": {"required": True}, } _attribute_map = { - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'admin_user_ssh_public_key': {'key': 'adminUserSshPublicKey', 'type': 'str'}, - 'admin_user_password': {'key': 'adminUserPassword', 'type': 'str'}, + "admin_user_name": {"key": "adminUserName", "type": "str"}, + "admin_user_ssh_public_key": { + "key": "adminUserSshPublicKey", + "type": "str", + }, + "admin_user_password": {"key": "adminUserPassword", "type": "str"}, } def __init__( @@ -24170,21 +25820,17 @@ class UserAssignedIdentity(msrest.serialization.Model): """ _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, + "principal_id": {"readonly": True}, + "client_id": {"readonly": True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, + "principal_id": {"key": "principalId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UserAssignedIdentity, self).__init__(**kwargs) self.principal_id = None self.client_id = None @@ -24198,14 +25844,11 @@ class UserCreatedAcrAccount(msrest.serialization.Model): """ _attribute_map = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, + "arm_resource_id": {"key": "armResourceId", "type": "ArmResourceId"}, } def __init__( - self, - *, - arm_resource_id: Optional["ArmResourceId"] = None, - **kwargs + self, *, arm_resource_id: Optional["ArmResourceId"] = None, **kwargs ): """ :keyword arm_resource_id: ARM ResourceId of a resource. @@ -24223,14 +25866,11 @@ class UserCreatedStorageAccount(msrest.serialization.Model): """ _attribute_map = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, + "arm_resource_id": {"key": "armResourceId", "type": "ArmResourceId"}, } def __init__( - self, - *, - arm_resource_id: Optional["ArmResourceId"] = None, - **kwargs + self, *, arm_resource_id: Optional["ArmResourceId"] = None, **kwargs ): """ :keyword arm_resource_id: ARM ResourceId of a resource. @@ -24252,24 +25892,22 @@ class UserIdentity(IdentityConfiguration): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UserIdentity, self).__init__(**kwargs) - self.identity_type = 'UserIdentity' # type: str + self.identity_type = "UserIdentity" # type: str -class UsernamePasswordAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class UsernamePasswordAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """UsernamePasswordAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -24292,16 +25930,19 @@ class UsernamePasswordAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionP """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionUsernamePassword'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionUsernamePassword", + }, } def __init__( @@ -24328,8 +25969,16 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword """ - super(UsernamePasswordAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'UsernamePassword' # type: str + super( + UsernamePasswordAuthTypeWorkspaceConnectionProperties, self + ).__init__( + category=category, + target=target, + value=value, + value_format=value_format, + **kwargs + ) + self.auth_type = "UsernamePassword" # type: str self.credentials = credentials @@ -24341,7 +25990,10 @@ class VirtualMachineSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, + "properties": { + "key": "properties", + "type": "VirtualMachineSchemaProperties", + }, } def __init__( @@ -24398,28 +26050,34 @@ class VirtualMachine(Compute, VirtualMachineSchema): """ _validation = { - 'compute_type': {'required': True}, - 'compute_location': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - 'disable_local_auth': {'readonly': True}, + "compute_type": {"required": True}, + "compute_location": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + "disable_local_auth": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": { + "key": "properties", + "type": "VirtualMachineSchemaProperties", + }, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -24439,9 +26097,14 @@ def __init__( :keyword resource_id: ARM resource id of the underlying compute. :paramtype resource_id: str """ - super(VirtualMachine, self).__init__(description=description, resource_id=resource_id, properties=properties, **kwargs) + super(VirtualMachine, self).__init__( + description=description, + resource_id=resource_id, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'VirtualMachine' # type: str + self.compute_type = "VirtualMachine" # type: str self.compute_location = None self.provisioning_state = None self.description = description @@ -24463,19 +26126,14 @@ class VirtualMachineImage(msrest.serialization.Model): """ _validation = { - 'id': {'required': True}, + "id": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, } - def __init__( - self, - *, - id: str, - **kwargs - ): + def __init__(self, *, id: str, **kwargs): """ :keyword id: Required. Virtual Machine image path. :paramtype id: str @@ -24504,12 +26162,18 @@ class VirtualMachineSchemaProperties(msrest.serialization.Model): """ _attribute_map = { - 'virtual_machine_size': {'key': 'virtualMachineSize', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'notebook_server_port': {'key': 'notebookServerPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'is_notebook_instance_compute': {'key': 'isNotebookInstanceCompute', 'type': 'bool'}, + "virtual_machine_size": {"key": "virtualMachineSize", "type": "str"}, + "ssh_port": {"key": "sshPort", "type": "int"}, + "notebook_server_port": {"key": "notebookServerPort", "type": "int"}, + "address": {"key": "address", "type": "str"}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, + "is_notebook_instance_compute": { + "key": "isNotebookInstanceCompute", + "type": "bool", + }, } def __init__( @@ -24557,7 +26221,10 @@ class VirtualMachineSecretsSchema(msrest.serialization.Model): """ _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, } def __init__( @@ -24590,12 +26257,15 @@ class VirtualMachineSecrets(ComputeSecrets, VirtualMachineSecretsSchema): """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, + "compute_type": {"key": "computeType", "type": "str"}, } def __init__( @@ -24609,9 +26279,11 @@ def __init__( :paramtype administrator_account: ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials """ - super(VirtualMachineSecrets, self).__init__(administrator_account=administrator_account, **kwargs) + super(VirtualMachineSecrets, self).__init__( + administrator_account=administrator_account, **kwargs + ) self.administrator_account = administrator_account - self.compute_type = 'VirtualMachine' # type: str + self.compute_type = "VirtualMachine" # type: str class VirtualMachineSize(msrest.serialization.Model): @@ -24646,29 +26318,38 @@ class VirtualMachineSize(msrest.serialization.Model): """ _validation = { - 'name': {'readonly': True}, - 'family': {'readonly': True}, - 'v_cp_us': {'readonly': True}, - 'gpus': {'readonly': True}, - 'os_vhd_size_mb': {'readonly': True}, - 'max_resource_volume_mb': {'readonly': True}, - 'memory_gb': {'readonly': True}, - 'low_priority_capable': {'readonly': True}, - 'premium_io': {'readonly': True}, + "name": {"readonly": True}, + "family": {"readonly": True}, + "v_cp_us": {"readonly": True}, + "gpus": {"readonly": True}, + "os_vhd_size_mb": {"readonly": True}, + "max_resource_volume_mb": {"readonly": True}, + "memory_gb": {"readonly": True}, + "low_priority_capable": {"readonly": True}, + "premium_io": {"readonly": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'v_cp_us': {'key': 'vCPUs', 'type': 'int'}, - 'gpus': {'key': 'gpus', 'type': 'int'}, - 'os_vhd_size_mb': {'key': 'osVhdSizeMB', 'type': 'int'}, - 'max_resource_volume_mb': {'key': 'maxResourceVolumeMB', 'type': 'int'}, - 'memory_gb': {'key': 'memoryGB', 'type': 'float'}, - 'low_priority_capable': {'key': 'lowPriorityCapable', 'type': 'bool'}, - 'premium_io': {'key': 'premiumIO', 'type': 'bool'}, - 'estimated_vm_prices': {'key': 'estimatedVMPrices', 'type': 'EstimatedVMPrices'}, - 'supported_compute_types': {'key': 'supportedComputeTypes', 'type': '[str]'}, + "name": {"key": "name", "type": "str"}, + "family": {"key": "family", "type": "str"}, + "v_cp_us": {"key": "vCPUs", "type": "int"}, + "gpus": {"key": "gpus", "type": "int"}, + "os_vhd_size_mb": {"key": "osVhdSizeMB", "type": "int"}, + "max_resource_volume_mb": { + "key": "maxResourceVolumeMB", + "type": "int", + }, + "memory_gb": {"key": "memoryGB", "type": "float"}, + "low_priority_capable": {"key": "lowPriorityCapable", "type": "bool"}, + "premium_io": {"key": "premiumIO", "type": "bool"}, + "estimated_vm_prices": { + "key": "estimatedVMPrices", + "type": "EstimatedVMPrices", + }, + "supported_compute_types": { + "key": "supportedComputeTypes", + "type": "[str]", + }, } def __init__( @@ -24707,14 +26388,11 @@ class VirtualMachineSizeListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[VirtualMachineSize]'}, + "value": {"key": "value", "type": "[VirtualMachineSize]"}, } def __init__( - self, - *, - value: Optional[List["VirtualMachineSize"]] = None, - **kwargs + self, *, value: Optional[List["VirtualMachineSize"]] = None, **kwargs ): """ :keyword value: The list of virtual machine sizes supported by AmlCompute. @@ -24738,10 +26416,10 @@ class VirtualMachineSshCredentials(msrest.serialization.Model): """ _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'public_key_data': {'key': 'publicKeyData', 'type': 'str'}, - 'private_key_data': {'key': 'privateKeyData', 'type': 'str'}, + "username": {"key": "username", "type": "str"}, + "password": {"key": "password", "type": "str"}, + "public_key_data": {"key": "publicKeyData", "type": "str"}, + "private_key_data": {"key": "privateKeyData", "type": "str"}, } def __init__( @@ -24793,14 +26471,14 @@ class VolumeDefinition(msrest.serialization.Model): """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'read_only': {'key': 'readOnly', 'type': 'bool'}, - 'source': {'key': 'source', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'consistency': {'key': 'consistency', 'type': 'str'}, - 'bind': {'key': 'bind', 'type': 'BindOptions'}, - 'volume': {'key': 'volume', 'type': 'VolumeOptions'}, - 'tmpfs': {'key': 'tmpfs', 'type': 'TmpfsOptions'}, + "type": {"key": "type", "type": "str"}, + "read_only": {"key": "readOnly", "type": "bool"}, + "source": {"key": "source", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "consistency": {"key": "consistency", "type": "str"}, + "bind": {"key": "bind", "type": "BindOptions"}, + "volume": {"key": "volume", "type": "VolumeOptions"}, + "tmpfs": {"key": "tmpfs", "type": "TmpfsOptions"}, } def __init__( @@ -24855,15 +26533,10 @@ class VolumeOptions(msrest.serialization.Model): """ _attribute_map = { - 'nocopy': {'key': 'nocopy', 'type': 'bool'}, + "nocopy": {"key": "nocopy", "type": "bool"}, } - def __init__( - self, - *, - nocopy: Optional[bool] = None, - **kwargs - ): + def __init__(self, *, nocopy: Optional[bool] = None, **kwargs): """ :keyword nocopy: Indicate whether volume is nocopy. :paramtype nocopy: bool @@ -24974,59 +26647,110 @@ class Workspace(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'workspace_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'service_provisioned_resource_group': {'readonly': True}, - 'private_link_count': {'readonly': True}, - 'private_endpoint_connections': {'readonly': True}, - 'notebook_info': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'storage_hns_enabled': {'readonly': True}, - 'ml_flow_tracking_uri': {'readonly': True}, - 'soft_deleted_at': {'readonly': True}, - 'scheduled_purge_date': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'key_vault': {'key': 'properties.keyVault', 'type': 'str'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'storage_account': {'key': 'properties.storageAccount', 'type': 'str'}, - 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionProperty'}, - 'hbi_workspace': {'key': 'properties.hbiWorkspace', 'type': 'bool'}, - 'service_provisioned_resource_group': {'key': 'properties.serviceProvisionedResourceGroup', 'type': 'str'}, - 'private_link_count': {'key': 'properties.privateLinkCount', 'type': 'int'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'allow_public_access_when_behind_vnet': {'key': 'properties.allowPublicAccessWhenBehindVnet', 'type': 'bool'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, - 'shared_private_link_resources': {'key': 'properties.sharedPrivateLinkResources', 'type': '[SharedPrivateLinkResource]'}, - 'notebook_info': {'key': 'properties.notebookInfo', 'type': 'NotebookResourceInfo'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, - 'storage_hns_enabled': {'key': 'properties.storageHnsEnabled', 'type': 'bool'}, - 'ml_flow_tracking_uri': {'key': 'properties.mlFlowTrackingUri', 'type': 'str'}, - 'v1_legacy_mode': {'key': 'properties.v1LegacyMode', 'type': 'bool'}, - 'soft_deleted_at': {'key': 'properties.softDeletedAt', 'type': 'str'}, - 'scheduled_purge_date': {'key': 'properties.scheduledPurgeDate', 'type': 'str'}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "workspace_id": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "service_provisioned_resource_group": {"readonly": True}, + "private_link_count": {"readonly": True}, + "private_endpoint_connections": {"readonly": True}, + "notebook_info": {"readonly": True}, + "tenant_id": {"readonly": True}, + "storage_hns_enabled": {"readonly": True}, + "ml_flow_tracking_uri": {"readonly": True}, + "soft_deleted_at": {"readonly": True}, + "scheduled_purge_date": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "workspace_id": {"key": "properties.workspaceId", "type": "str"}, + "description": {"key": "properties.description", "type": "str"}, + "friendly_name": {"key": "properties.friendlyName", "type": "str"}, + "key_vault": {"key": "properties.keyVault", "type": "str"}, + "application_insights": { + "key": "properties.applicationInsights", + "type": "str", + }, + "container_registry": { + "key": "properties.containerRegistry", + "type": "str", + }, + "storage_account": {"key": "properties.storageAccount", "type": "str"}, + "discovery_url": {"key": "properties.discoveryUrl", "type": "str"}, + "provisioning_state": { + "key": "properties.provisioningState", + "type": "str", + }, + "encryption": { + "key": "properties.encryption", + "type": "EncryptionProperty", + }, + "hbi_workspace": {"key": "properties.hbiWorkspace", "type": "bool"}, + "service_provisioned_resource_group": { + "key": "properties.serviceProvisionedResourceGroup", + "type": "str", + }, + "private_link_count": { + "key": "properties.privateLinkCount", + "type": "int", + }, + "image_build_compute": { + "key": "properties.imageBuildCompute", + "type": "str", + }, + "allow_public_access_when_behind_vnet": { + "key": "properties.allowPublicAccessWhenBehindVnet", + "type": "bool", + }, + "public_network_access": { + "key": "properties.publicNetworkAccess", + "type": "str", + }, + "private_endpoint_connections": { + "key": "properties.privateEndpointConnections", + "type": "[PrivateEndpointConnection]", + }, + "shared_private_link_resources": { + "key": "properties.sharedPrivateLinkResources", + "type": "[SharedPrivateLinkResource]", + }, + "notebook_info": { + "key": "properties.notebookInfo", + "type": "NotebookResourceInfo", + }, + "service_managed_resources_settings": { + "key": "properties.serviceManagedResourcesSettings", + "type": "ServiceManagedResourcesSettings", + }, + "primary_user_assigned_identity": { + "key": "properties.primaryUserAssignedIdentity", + "type": "str", + }, + "tenant_id": {"key": "properties.tenantId", "type": "str"}, + "storage_hns_enabled": { + "key": "properties.storageHnsEnabled", + "type": "bool", + }, + "ml_flow_tracking_uri": { + "key": "properties.mlFlowTrackingUri", + "type": "str", + }, + "v1_legacy_mode": {"key": "properties.v1LegacyMode", "type": "bool"}, + "soft_deleted_at": {"key": "properties.softDeletedAt", "type": "str"}, + "scheduled_purge_date": { + "key": "properties.scheduledPurgeDate", + "type": "str", + }, } def __init__( @@ -25047,9 +26771,15 @@ def __init__( hbi_workspace: Optional[bool] = False, image_build_compute: Optional[str] = None, allow_public_access_when_behind_vnet: Optional[bool] = False, - public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, - shared_private_link_resources: Optional[List["SharedPrivateLinkResource"]] = None, - service_managed_resources_settings: Optional["ServiceManagedResourcesSettings"] = None, + public_network_access: Optional[ + Union[str, "PublicNetworkAccess"] + ] = None, + shared_private_link_resources: Optional[ + List["SharedPrivateLinkResource"] + ] = None, + service_managed_resources_settings: Optional[ + "ServiceManagedResourcesSettings" + ] = None, primary_user_assigned_identity: Optional[str] = None, v1_legacy_mode: Optional[bool] = False, **kwargs @@ -25128,12 +26858,16 @@ def __init__( self.service_provisioned_resource_group = None self.private_link_count = None self.image_build_compute = image_build_compute - self.allow_public_access_when_behind_vnet = allow_public_access_when_behind_vnet + self.allow_public_access_when_behind_vnet = ( + allow_public_access_when_behind_vnet + ) self.public_network_access = public_network_access self.private_endpoint_connections = None self.shared_private_link_resources = shared_private_link_resources self.notebook_info = None - self.service_managed_resources_settings = service_managed_resources_settings + self.service_managed_resources_settings = ( + service_managed_resources_settings + ) self.primary_user_assigned_identity = primary_user_assigned_identity self.tenant_id = None self.storage_hns_enabled = None @@ -25153,8 +26887,8 @@ class WorkspaceConnectionAccessKey(msrest.serialization.Model): """ _attribute_map = { - 'access_key_id': {'key': 'accessKeyId', 'type': 'str'}, - 'secret_access_key': {'key': 'secretAccessKey', 'type': 'str'}, + "access_key_id": {"key": "accessKeyId", "type": "str"}, + "secret_access_key": {"key": "secretAccessKey", "type": "str"}, } def __init__( @@ -25185,8 +26919,8 @@ class WorkspaceConnectionManagedIdentity(msrest.serialization.Model): """ _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, + "resource_id": {"key": "resourceId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, } def __init__( @@ -25215,15 +26949,10 @@ class WorkspaceConnectionPersonalAccessToken(msrest.serialization.Model): """ _attribute_map = { - 'pat': {'key': 'pat', 'type': 'str'}, + "pat": {"key": "pat", "type": "str"}, } - def __init__( - self, - *, - pat: Optional[str] = None, - **kwargs - ): + def __init__(self, *, pat: Optional[str] = None, **kwargs): """ :keyword pat: :paramtype pat: str @@ -25255,37 +26984,41 @@ class WorkspaceConnectionPropertiesV2BasicResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'WorkspaceConnectionPropertiesV2'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "WorkspaceConnectionPropertiesV2", + }, } def __init__( - self, - *, - properties: "WorkspaceConnectionPropertiesV2", - **kwargs + self, *, properties: "WorkspaceConnectionPropertiesV2", **kwargs ): """ :keyword properties: Required. :paramtype properties: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 """ - super(WorkspaceConnectionPropertiesV2BasicResource, self).__init__(**kwargs) + super(WorkspaceConnectionPropertiesV2BasicResource, self).__init__( + **kwargs + ) self.properties = properties -class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(msrest.serialization.Model): +class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult( + msrest.serialization.Model +): """WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult. Variables are only populated by the server, and will be ignored when sending a request. @@ -25298,18 +27031,23 @@ class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(msrest.seri """ _validation = { - 'next_link': {'readonly': True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[WorkspaceConnectionPropertiesV2BasicResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": { + "key": "value", + "type": "[WorkspaceConnectionPropertiesV2BasicResource]", + }, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( self, *, - value: Optional[List["WorkspaceConnectionPropertiesV2BasicResource"]] = None, + value: Optional[ + List["WorkspaceConnectionPropertiesV2BasicResource"] + ] = None, **kwargs ): """ @@ -25317,7 +27055,10 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource] """ - super(WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, self).__init__(**kwargs) + super( + WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, + self, + ).__init__(**kwargs) self.value = value self.next_link = None @@ -25334,9 +27075,9 @@ class WorkspaceConnectionServicePrincipal(msrest.serialization.Model): """ _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + "client_id": {"key": "clientId", "type": "str"}, + "client_secret": {"key": "clientSecret", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, } def __init__( @@ -25369,20 +27110,17 @@ class WorkspaceConnectionSharedAccessSignature(msrest.serialization.Model): """ _attribute_map = { - 'sas': {'key': 'sas', 'type': 'str'}, + "sas": {"key": "sas", "type": "str"}, } - def __init__( - self, - *, - sas: Optional[str] = None, - **kwargs - ): + def __init__(self, *, sas: Optional[str] = None, **kwargs): """ :keyword sas: :paramtype sas: str """ - super(WorkspaceConnectionSharedAccessSignature, self).__init__(**kwargs) + super(WorkspaceConnectionSharedAccessSignature, self).__init__( + **kwargs + ) self.sas = sas @@ -25396,8 +27134,8 @@ class WorkspaceConnectionUsernamePassword(msrest.serialization.Model): """ _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, + "username": {"key": "username", "type": "str"}, + "password": {"key": "password", "type": "str"}, } def __init__( @@ -25430,8 +27168,8 @@ class WorkspaceListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[Workspace]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Workspace]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( @@ -25488,18 +27226,39 @@ class WorkspaceUpdateParameters(msrest.serialization.Model): """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionUpdateProperties'}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "description": {"key": "properties.description", "type": "str"}, + "friendly_name": {"key": "properties.friendlyName", "type": "str"}, + "image_build_compute": { + "key": "properties.imageBuildCompute", + "type": "str", + }, + "service_managed_resources_settings": { + "key": "properties.serviceManagedResourcesSettings", + "type": "ServiceManagedResourcesSettings", + }, + "primary_user_assigned_identity": { + "key": "properties.primaryUserAssignedIdentity", + "type": "str", + }, + "public_network_access": { + "key": "properties.publicNetworkAccess", + "type": "str", + }, + "application_insights": { + "key": "properties.applicationInsights", + "type": "str", + }, + "container_registry": { + "key": "properties.containerRegistry", + "type": "str", + }, + "encryption": { + "key": "properties.encryption", + "type": "EncryptionUpdateProperties", + }, } def __init__( @@ -25511,9 +27270,13 @@ def __init__( description: Optional[str] = None, friendly_name: Optional[str] = None, image_build_compute: Optional[str] = None, - service_managed_resources_settings: Optional["ServiceManagedResourcesSettings"] = None, + service_managed_resources_settings: Optional[ + "ServiceManagedResourcesSettings" + ] = None, primary_user_assigned_identity: Optional[str] = None, - public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, + public_network_access: Optional[ + Union[str, "PublicNetworkAccess"] + ] = None, application_insights: Optional[str] = None, container_registry: Optional[str] = None, encryption: Optional["EncryptionUpdateProperties"] = None, @@ -25557,7 +27320,9 @@ def __init__( self.description = description self.friendly_name = friendly_name self.image_build_compute = image_build_compute - self.service_managed_resources_settings = service_managed_resources_settings + self.service_managed_resources_settings = ( + service_managed_resources_settings + ) self.primary_user_assigned_identity = primary_user_assigned_identity self.public_network_access = public_network_access self.application_insights = application_insights diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/__init__.py index 01fa2d886d14..90a9382c6dbd 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/__init__.py @@ -12,19 +12,35 @@ from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations from ._quotas_operations import QuotasOperations from ._compute_operations import ComputeOperations -from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_endpoint_connections_operations import ( + PrivateEndpointConnectionsOperations, +) from ._private_link_resources_operations import PrivateLinkResourcesOperations from ._workspace_connections_operations import WorkspaceConnectionsOperations from ._registries_operations import RegistriesOperations from ._workspace_features_operations import WorkspaceFeaturesOperations -from ._registry_code_containers_operations import RegistryCodeContainersOperations +from ._registry_code_containers_operations import ( + RegistryCodeContainersOperations, +) from ._registry_code_versions_operations import RegistryCodeVersionsOperations -from ._registry_component_containers_operations import RegistryComponentContainersOperations -from ._registry_component_versions_operations import RegistryComponentVersionsOperations -from ._registry_environment_containers_operations import RegistryEnvironmentContainersOperations -from ._registry_environment_versions_operations import RegistryEnvironmentVersionsOperations -from ._registry_model_containers_operations import RegistryModelContainersOperations -from ._registry_model_versions_operations import RegistryModelVersionsOperations +from ._registry_component_containers_operations import ( + RegistryComponentContainersOperations, +) +from ._registry_component_versions_operations import ( + RegistryComponentVersionsOperations, +) +from ._registry_environment_containers_operations import ( + RegistryEnvironmentContainersOperations, +) +from ._registry_environment_versions_operations import ( + RegistryEnvironmentVersionsOperations, +) +from ._registry_model_containers_operations import ( + RegistryModelContainersOperations, +) +from ._registry_model_versions_operations import ( + RegistryModelVersionsOperations, +) from ._batch_endpoints_operations import BatchEndpointsOperations from ._batch_deployments_operations import BatchDeploymentsOperations from ._code_containers_operations import CodeContainersOperations @@ -45,41 +61,41 @@ from ._schedules_operations import SchedulesOperations __all__ = [ - 'Operations', - 'WorkspacesOperations', - 'UsagesOperations', - 'VirtualMachineSizesOperations', - 'QuotasOperations', - 'ComputeOperations', - 'PrivateEndpointConnectionsOperations', - 'PrivateLinkResourcesOperations', - 'WorkspaceConnectionsOperations', - 'RegistriesOperations', - 'WorkspaceFeaturesOperations', - 'RegistryCodeContainersOperations', - 'RegistryCodeVersionsOperations', - 'RegistryComponentContainersOperations', - 'RegistryComponentVersionsOperations', - 'RegistryEnvironmentContainersOperations', - 'RegistryEnvironmentVersionsOperations', - 'RegistryModelContainersOperations', - 'RegistryModelVersionsOperations', - 'BatchEndpointsOperations', - 'BatchDeploymentsOperations', - 'CodeContainersOperations', - 'CodeVersionsOperations', - 'ComponentContainersOperations', - 'ComponentVersionsOperations', - 'DataContainersOperations', - 'DataVersionsOperations', - 'DatastoresOperations', - 'EnvironmentContainersOperations', - 'EnvironmentVersionsOperations', - 'JobsOperations', - 'LabelingJobsOperations', - 'ModelContainersOperations', - 'ModelVersionsOperations', - 'OnlineEndpointsOperations', - 'OnlineDeploymentsOperations', - 'SchedulesOperations', + "Operations", + "WorkspacesOperations", + "UsagesOperations", + "VirtualMachineSizesOperations", + "QuotasOperations", + "ComputeOperations", + "PrivateEndpointConnectionsOperations", + "PrivateLinkResourcesOperations", + "WorkspaceConnectionsOperations", + "RegistriesOperations", + "WorkspaceFeaturesOperations", + "RegistryCodeContainersOperations", + "RegistryCodeVersionsOperations", + "RegistryComponentContainersOperations", + "RegistryComponentVersionsOperations", + "RegistryEnvironmentContainersOperations", + "RegistryEnvironmentVersionsOperations", + "RegistryModelContainersOperations", + "RegistryModelVersionsOperations", + "BatchEndpointsOperations", + "BatchDeploymentsOperations", + "CodeContainersOperations", + "CodeVersionsOperations", + "ComponentContainersOperations", + "ComponentVersionsOperations", + "DataContainersOperations", + "DataVersionsOperations", + "DatastoresOperations", + "EnvironmentContainersOperations", + "EnvironmentVersionsOperations", + "JobsOperations", + "LabelingJobsOperations", + "ModelContainersOperations", + "ModelVersionsOperations", + "OnlineEndpointsOperations", + "OnlineDeploymentsOperations", + "SchedulesOperations", ] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_batch_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_batch_deployments_operations.py index cc437c31c4ca..5279e8669ff0 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_batch_deployments_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_batch_deployments_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -250,6 +262,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class BatchDeploymentsOperations(object): """BatchDeploymentsOperations operations. @@ -308,16 +321,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.BatchDeploymentTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -327,13 +347,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -351,7 +371,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("BatchDeploymentTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "BatchDeploymentTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -360,25 +383,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -389,15 +418,18 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -405,34 +437,47 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -468,14 +513,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -483,29 +533,33 @@ def begin_delete( # pylint: disable=inconsistent-return-statements endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def get( @@ -534,15 +588,20 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.BatchDeployment :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -550,32 +609,39 @@ def get( endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize("BatchDeployment", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore def _update_initial( self, @@ -587,16 +653,27 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.BatchDeployment"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchDeployment"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.BatchDeployment"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties') + error_map.update(kwargs.pop("error_map", {})) + + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + + _json = self._serialize.body( + body, + "PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties", + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -607,40 +684,55 @@ def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def begin_update( @@ -682,15 +774,24 @@ def begin_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -700,32 +801,38 @@ def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore def _create_or_update_initial( self, @@ -737,16 +844,24 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.BatchDeployment" - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'BatchDeployment') + _json = self._serialize.body(body, "BatchDeployment") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -757,39 +872,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchDeployment', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -830,15 +961,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -848,29 +988,35 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_batch_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_batch_endpoints_operations.py index ecfd3ea617d3..68e294d05efe 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_batch_endpoints_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_batch_endpoints_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -276,6 +288,7 @@ def build_list_keys_request( **kwargs ) + # fmt: on class BatchEndpointsOperations(object): """BatchEndpointsOperations operations. @@ -328,16 +341,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.BatchEndpointTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -345,13 +365,13 @@ def prepare_request(next_link=None): api_version=api_version, count=count, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -367,7 +387,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("BatchEndpointTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "BatchEndpointTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -376,25 +399,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -404,49 +433,65 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -479,43 +524,52 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace def get( @@ -541,47 +595,57 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.BatchEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize("BatchEndpoint", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore def _update_initial( self, @@ -592,16 +656,26 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.BatchEndpoint"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchEndpoint"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.BatchEndpoint"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') + _json = self._serialize.body( + body, "PartialMinimalTrackedResourceWithIdentity" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -611,40 +685,55 @@ def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace def begin_update( @@ -682,15 +771,22 @@ def begin_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -699,32 +795,38 @@ def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore def _create_or_update_initial( self, @@ -735,16 +837,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.BatchEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'BatchEndpoint') + _json = self._serialize.body(body, "BatchEndpoint") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -754,39 +862,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -823,15 +947,22 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -840,32 +971,38 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace def list_keys( @@ -891,44 +1028,56 @@ def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthKeys"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) + deserialized = self._deserialize("EndpointAuthKeys", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys"} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_code_containers_operations.py index 254317233f79..078b857f325f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_code_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_code_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -190,6 +202,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class CodeContainersOperations(object): """CodeContainersOperations operations. @@ -239,29 +252,36 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -276,7 +296,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -285,25 +307,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -329,43 +357,53 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore @distributed_trace def get( @@ -391,47 +429,57 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize("CodeContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore @distributed_trace def create_or_update( @@ -460,16 +508,22 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeContainer') + _json = self._serialize.body(body, "CodeContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -479,33 +533,44 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_code_versions_operations.py index 17a29c3b389e..de0d93b2d722 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_code_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_code_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -204,6 +216,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class CodeVersionsOperations(object): """CodeVersionsOperations operations. @@ -262,16 +275,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -281,13 +301,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -305,7 +325,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -314,25 +336,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -361,15 +389,18 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -377,28 +408,35 @@ def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -427,15 +465,18 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -443,32 +484,39 @@ def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace def create_or_update( @@ -500,16 +548,22 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeVersion') + _json = self._serialize.body(body, "CodeVersion") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -520,33 +574,40 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_component_containers_operations.py index 2568cbe99064..eff79cfdac83 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_component_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_component_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -193,6 +205,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class ComponentContainersOperations(object): """ComponentContainersOperations operations. @@ -245,16 +258,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -262,13 +282,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -284,7 +304,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -293,25 +316,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -337,43 +366,53 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore @distributed_trace def get( @@ -399,47 +438,61 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore @distributed_trace def create_or_update( @@ -468,16 +521,24 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentContainer') + _json = self._serialize.body(body, "ComponentContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -487,33 +548,44 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_component_versions_operations.py index 45ae72b476f5..7b266b6f4046 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_component_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_component_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -207,6 +219,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class ComponentVersionsOperations(object): """ComponentVersionsOperations operations. @@ -268,16 +281,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -288,13 +308,13 @@ def prepare_request(next_link=None): top=top, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -313,7 +333,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -322,25 +344,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -369,15 +397,18 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -385,28 +416,35 @@ def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -435,15 +473,20 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -451,32 +494,39 @@ def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize("ComponentVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace def create_or_update( @@ -508,16 +558,24 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentVersion') + _json = self._serialize.body(body, "ComponentVersion") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -528,33 +586,44 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_compute_operations.py index fc67fc0cfc9d..f6b48cdfdfe0 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_compute_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_compute_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -25,9 +31,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, List, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Iterable, + List, + Optional, + TypeVar, + Union, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -515,6 +536,7 @@ def build_update_idle_shutdown_setting_request( **kwargs ) + # fmt: on class ComputeOperations(object): """ComputeOperations operations. @@ -562,29 +584,36 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedComputeResourcesList] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedComputeResourcesList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedComputeResourcesList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -599,7 +628,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedComputeResourcesList", pipeline_response) + deserialized = self._deserialize( + "PaginatedComputeResourcesList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -608,25 +639,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes"} # type: ignore @distributed_trace def get( @@ -651,47 +688,59 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComputeResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize("ComputeResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore def _create_or_update_initial( self, @@ -702,16 +751,24 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.ComputeResource" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'ComputeResource') + _json = self._serialize.body(parameters, "ComputeResource") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -721,38 +778,49 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if response.status_code == 201: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComputeResource', pipeline_response) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -790,15 +858,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -807,32 +884,38 @@ def begin_create_or_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore def _update_initial( self, @@ -843,16 +926,24 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> "_models.ComputeResource" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'ClusterUpdateParameters') + _json = self._serialize.body(parameters, "ClusterUpdateParameters") request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -862,31 +953,36 @@ def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize("ComputeResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace def begin_update( @@ -923,15 +1019,24 @@ def begin_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -940,32 +1045,38 @@ def begin_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -976,15 +1087,18 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -992,33 +1106,41 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements compute_name=compute_name, api_version=api_version, underlying_resource_action=underlying_resource_action, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -1054,14 +1176,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -1069,29 +1196,33 @@ def begin_delete( # pylint: disable=inconsistent-return-statements compute_name=compute_name, underlying_resource_action=underlying_resource_action, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace def update_custom_services( # pylint: disable=inconsistent-return-statements @@ -1118,16 +1249,22 @@ def update_custom_services( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(custom_services, '[CustomService]') + _json = self._serialize.body(custom_services, "[CustomService]") request = build_update_custom_services_request( subscription_id=self._config.subscription_id, @@ -1137,28 +1274,35 @@ def update_custom_services( # pylint: disable=inconsistent-return-statements api_version=api_version, content_type=content_type, json=_json, - template_url=self.update_custom_services.metadata['url'], + template_url=self.update_custom_services.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - update_custom_services.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/customServices"} # type: ignore - + update_custom_services.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/customServices"} # type: ignore @distributed_trace def list_nodes( @@ -1184,29 +1328,36 @@ def list_nodes( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.AmlComputeNodesInformation] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlComputeNodesInformation"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.AmlComputeNodesInformation"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_nodes_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self.list_nodes.metadata['url'], + template_url=self.list_nodes.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_nodes_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -1221,7 +1372,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("AmlComputeNodesInformation", pipeline_response) + deserialized = self._deserialize( + "AmlComputeNodesInformation", pipeline_response + ) list_of_elem = deserialized.nodes if cls: list_of_elem = cls(list_of_elem) @@ -1230,25 +1383,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_nodes.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes"} # type: ignore + list_nodes.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes"} # type: ignore @distributed_trace def list_keys( @@ -1272,47 +1431,59 @@ def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ComputeSecrets :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeSecrets"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeSecrets"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComputeSecrets', pipeline_response) + deserialized = self._deserialize("ComputeSecrets", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys"} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys"} # type: ignore def _start_initial( # pylint: disable=inconsistent-return-statements self, @@ -1322,42 +1493,50 @@ def _start_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_start_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self._start_initial.metadata['url'], + template_url=self._start_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _start_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore - + _start_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore @distributed_trace def begin_start( # pylint: disable=inconsistent-return-statements @@ -1388,43 +1567,52 @@ def begin_start( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._start_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_start.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore + begin_start.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore def _stop_initial( # pylint: disable=inconsistent-return-statements self, @@ -1434,42 +1622,50 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_stop_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self._stop_initial.metadata['url'], + template_url=self._stop_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _stop_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore - + _stop_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore @distributed_trace def begin_stop( # pylint: disable=inconsistent-return-statements @@ -1500,43 +1696,52 @@ def begin_stop( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._stop_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_stop.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore + begin_stop.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore def _restart_initial( # pylint: disable=inconsistent-return-statements self, @@ -1546,42 +1751,50 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_restart_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self._restart_initial.metadata['url'], + template_url=self._restart_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _restart_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore - + _restart_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore @distributed_trace def begin_restart( # pylint: disable=inconsistent-return-statements @@ -1612,43 +1825,52 @@ def begin_restart( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._restart_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_restart.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore + begin_restart.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore @distributed_trace def update_idle_shutdown_setting( # pylint: disable=inconsistent-return-statements @@ -1675,16 +1897,22 @@ def update_idle_shutdown_setting( # pylint: disable=inconsistent-return-stateme :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'IdleShutdownSetting') + _json = self._serialize.body(parameters, "IdleShutdownSetting") request = build_update_idle_shutdown_setting_request( subscription_id=self._config.subscription_id, @@ -1694,25 +1922,32 @@ def update_idle_shutdown_setting( # pylint: disable=inconsistent-return-stateme api_version=api_version, content_type=content_type, json=_json, - template_url=self.update_idle_shutdown_setting.metadata['url'], + template_url=self.update_idle_shutdown_setting.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - update_idle_shutdown_setting.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateIdleShutdownSetting"} # type: ignore - + update_idle_shutdown_setting.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateIdleShutdownSetting"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_data_containers_operations.py index e809b6cc7a71..269fa1c5ddfe 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_data_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_data_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -193,6 +205,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class DataContainersOperations(object): """DataContainersOperations operations. @@ -245,16 +258,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -262,13 +282,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -284,7 +304,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -293,25 +315,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -337,43 +365,53 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore @distributed_trace def get( @@ -399,47 +437,57 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize("DataContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore @distributed_trace def create_or_update( @@ -468,16 +516,22 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DataContainer') + _json = self._serialize.body(body, "DataContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -487,33 +541,44 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_data_versions_operations.py index eae182ebdb75..ac2b3ee6707e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_data_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_data_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -210,6 +222,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class DataVersionsOperations(object): """DataVersionsOperations operations. @@ -278,16 +291,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -299,13 +319,13 @@ def prepare_request(next_link=None): skip=skip, tags=tags, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -325,7 +345,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataVersionBaseResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -334,25 +356,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -381,15 +409,18 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -397,28 +428,35 @@ def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -447,15 +485,20 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -463,32 +506,39 @@ def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize("DataVersionBase", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace def create_or_update( @@ -520,16 +570,24 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DataVersionBase') + _json = self._serialize.body(body, "DataVersionBase") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -540,33 +598,44 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_datastores_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_datastores_operations.py index 24fe3fbf1f80..624ac37b68d4 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_datastores_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_datastores_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, List, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -250,6 +262,7 @@ def build_list_secrets_request( **kwargs ) + # fmt: on class DatastoresOperations(object): """DatastoresOperations operations. @@ -317,16 +330,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DatastoreResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -339,13 +359,13 @@ def prepare_request(next_link=None): search_text=search_text, order_by=order_by, order_by_asc=order_by_asc, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -366,7 +386,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("DatastoreResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DatastoreResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -375,25 +397,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -419,43 +447,53 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace def get( @@ -481,47 +519,57 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.Datastore :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Datastore"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Datastore"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Datastore', pipeline_response) + deserialized = self._deserialize("Datastore", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace def create_or_update( @@ -553,16 +601,22 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.Datastore :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Datastore"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Datastore"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'Datastore') + _json = self._serialize.body(body, "Datastore") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -573,36 +627,43 @@ def create_or_update( content_type=content_type, json=_json, skip_validation=skip_validation, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('Datastore', pipeline_response) + deserialized = self._deserialize("Datastore", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('Datastore', pipeline_response) + deserialized = self._deserialize("Datastore", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace def list_secrets( @@ -628,44 +689,56 @@ def list_secrets( :rtype: ~azure.mgmt.machinelearningservices.models.DatastoreSecrets :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreSecrets"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DatastoreSecrets"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_list_secrets_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.list_secrets.metadata['url'], + template_url=self.list_secrets.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DatastoreSecrets', pipeline_response) + deserialized = self._deserialize("DatastoreSecrets", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_secrets.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets"} # type: ignore - + list_secrets.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_environment_containers_operations.py index 9234f37eb34a..91d5315b7096 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_environment_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_environment_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -193,6 +205,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class EnvironmentContainersOperations(object): """EnvironmentContainersOperations operations. @@ -245,16 +258,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -262,13 +282,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -284,7 +304,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -293,25 +316,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -337,43 +366,53 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore @distributed_trace def get( @@ -399,47 +438,61 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore @distributed_trace def create_or_update( @@ -468,16 +521,24 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentContainer') + _json = self._serialize.body(body, "EnvironmentContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -487,33 +548,44 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_environment_versions_operations.py index 167bbc040c85..a5b90d270002 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_environment_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_environment_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -207,6 +219,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class EnvironmentVersionsOperations(object): """EnvironmentVersionsOperations operations. @@ -268,16 +281,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -288,13 +308,13 @@ def prepare_request(next_link=None): top=top, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -313,7 +333,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersionResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -322,25 +345,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -369,15 +398,18 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -385,28 +417,35 @@ def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -435,15 +474,20 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -451,32 +495,41 @@ def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace def create_or_update( @@ -508,16 +561,24 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentVersion') + _json = self._serialize.body(body, "EnvironmentVersion") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -528,33 +589,44 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_jobs_operations.py index a3a443e03453..b45aeb805c0d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_jobs_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_jobs_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -246,6 +258,7 @@ def build_cancel_request_initial( **kwargs ) + # fmt: on class JobsOperations(object): """JobsOperations operations. @@ -310,16 +323,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.JobBaseResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -331,13 +351,13 @@ def prepare_request(next_link=None): list_view_type=list_view_type, scheduled=scheduled, schedule_id=schedule_id, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -357,7 +377,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("JobBaseResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "JobBaseResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -366,25 +388,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -394,49 +422,65 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -469,43 +513,52 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace def get( @@ -531,47 +584,57 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.JobBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.JobBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('JobBase', pipeline_response) + deserialized = self._deserialize("JobBase", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace def create_or_update( @@ -600,16 +663,22 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.JobBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.JobBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'JobBase') + _json = self._serialize.body(body, "JobBase") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -619,36 +688,43 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('JobBase', pipeline_response) + deserialized = self._deserialize("JobBase", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('JobBase', pipeline_response) + deserialized = self._deserialize("JobBase", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore def _cancel_initial( # pylint: disable=inconsistent-return-statements self, @@ -658,48 +734,59 @@ def _cancel_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_cancel_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self._cancel_initial.metadata['url'], + template_url=self._cancel_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _cancel_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore - + _cancel_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore @distributed_trace def begin_cancel( # pylint: disable=inconsistent-return-statements @@ -732,40 +819,53 @@ def begin_cancel( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._cancel_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_cancel.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore + begin_cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_labeling_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_labeling_jobs_operations.py index 6fb608de455b..2b999e5a3f54 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_labeling_jobs_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_labeling_jobs_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -321,6 +333,7 @@ def build_resume_request_initial( **kwargs ) + # fmt: on class LabelingJobsOperations(object): """LabelingJobsOperations operations. @@ -373,16 +386,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.LabelingJobResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJobResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.LabelingJobResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -390,13 +410,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, count=count, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -412,7 +432,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("LabelingJobResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "LabelingJobResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -421,25 +443,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -465,43 +493,53 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore @distributed_trace def get( @@ -535,15 +573,18 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.LabelingJob :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.LabelingJob"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -552,32 +593,39 @@ def get( api_version=api_version, include_job_instructions=include_job_instructions, include_label_categories=include_label_categories, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('LabelingJob', pipeline_response) + deserialized = self._deserialize("LabelingJob", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore def _create_or_update_initial( self, @@ -588,16 +636,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.LabelingJob" - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.LabelingJob"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'LabelingJob') + _json = self._serialize.body(body, "LabelingJob") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -607,39 +661,51 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('LabelingJob', pipeline_response) + deserialized = self._deserialize("LabelingJob", pipeline_response) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('LabelingJob', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("LabelingJob", pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -676,15 +742,22 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.LabelingJob] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.LabelingJob"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -693,32 +766,36 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('LabelingJob', pipeline_response) + deserialized = self._deserialize("LabelingJob", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore def _export_labels_initial( self, @@ -729,16 +806,24 @@ def _export_labels_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.ExportSummary"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExportSummary"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.ExportSummary"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ExportSummary') + _json = self._serialize.body(body, "ExportSummary") request = build_export_labels_request_initial( subscription_id=self._config.subscription_id, @@ -748,39 +833,49 @@ def _export_labels_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._export_labels_initial.metadata['url'], + template_url=self._export_labels_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ExportSummary', pipeline_response) + deserialized = self._deserialize( + "ExportSummary", pipeline_response + ) if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _export_labels_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore - + _export_labels_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore @distributed_trace def begin_export_labels( @@ -817,15 +912,22 @@ def begin_export_labels( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ExportSummary] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExportSummary"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ExportSummary"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._export_labels_initial( resource_group_name=resource_group_name, @@ -834,32 +936,42 @@ def begin_export_labels( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ExportSummary', pipeline_response) + deserialized = self._deserialize( + "ExportSummary", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_export_labels.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore + begin_export_labels.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore @distributed_trace def pause( # pylint: disable=inconsistent-return-statements @@ -885,43 +997,53 @@ def pause( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_pause_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self.pause.metadata['url'], + template_url=self.pause.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - pause.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause"} # type: ignore - + pause.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause"} # type: ignore def _resume_initial( # pylint: disable=inconsistent-return-statements self, @@ -931,48 +1053,59 @@ def _resume_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_resume_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self._resume_initial.metadata['url'], + template_url=self._resume_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _resume_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore - + _resume_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore @distributed_trace def begin_resume( # pylint: disable=inconsistent-return-statements @@ -1005,40 +1138,53 @@ def begin_resume( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._resume_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_resume.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore + begin_resume.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_model_containers_operations.py index 0d78a86fe090..1f04b450fc34 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_model_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_model_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -196,6 +208,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class ModelContainersOperations(object): """ModelContainersOperations operations. @@ -251,16 +264,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -269,13 +289,13 @@ def prepare_request(next_link=None): skip=skip, count=count, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -292,7 +312,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -301,25 +323,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -345,43 +373,53 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore @distributed_trace def get( @@ -407,47 +445,59 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize("ModelContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore @distributed_trace def create_or_update( @@ -476,16 +526,24 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelContainer') + _json = self._serialize.body(body, "ModelContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -495,33 +553,44 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_model_versions_operations.py index cf1c86a89d73..ece07bc8f7ba 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_model_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_model_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -225,6 +237,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class ModelVersionsOperations(object): """ModelVersionsOperations operations. @@ -306,16 +319,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -332,13 +352,13 @@ def prepare_request(next_link=None): properties=properties, feed=feed, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -363,7 +383,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -372,25 +394,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -419,15 +447,18 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -435,28 +466,35 @@ def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -485,15 +523,18 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -501,32 +542,39 @@ def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace def create_or_update( @@ -558,16 +606,22 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelVersion') + _json = self._serialize.body(body, "ModelVersion") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -578,33 +632,40 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_online_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_online_deployments_operations.py index 4d3d7e29176a..8c4db7b5bcb2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_online_deployments_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_online_deployments_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -341,6 +353,7 @@ def build_list_skus_request( **kwargs ) + # fmt: on class OnlineDeploymentsOperations(object): """OnlineDeploymentsOperations operations. @@ -399,16 +412,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.OnlineDeploymentTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -418,13 +438,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -442,7 +462,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineDeploymentTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "OnlineDeploymentTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -451,25 +474,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -480,15 +509,18 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -496,34 +528,47 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -559,14 +604,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -574,29 +624,33 @@ def begin_delete( # pylint: disable=inconsistent-return-statements endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def get( @@ -625,15 +679,20 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.OnlineDeployment :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -641,32 +700,39 @@ def get( endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize("OnlineDeployment", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore def _update_initial( self, @@ -678,16 +744,26 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.OnlineDeployment"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineDeployment"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.OnlineDeployment"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSku') + _json = self._serialize.body( + body, "PartialMinimalTrackedResourceWithSku" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -698,40 +774,55 @@ def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def begin_update( @@ -772,15 +863,24 @@ def begin_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -790,32 +890,38 @@ def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore def _create_or_update_initial( self, @@ -827,16 +933,24 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.OnlineDeployment" - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'OnlineDeployment') + _json = self._serialize.body(body, "OnlineDeployment") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -847,39 +961,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -920,15 +1050,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -938,32 +1077,38 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def get_logs( @@ -995,16 +1140,24 @@ def get_logs( :rtype: ~azure.mgmt.machinelearningservices.models.DeploymentLogs :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentLogs"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DeploymentLogs"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DeploymentLogsRequest') + _json = self._serialize.body(body, "DeploymentLogsRequest") request = build_get_logs_request( subscription_id=self._config.subscription_id, @@ -1015,32 +1168,39 @@ def get_logs( api_version=api_version, content_type=content_type, json=_json, - template_url=self.get_logs.metadata['url'], + template_url=self.get_logs.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DeploymentLogs', pipeline_response) + deserialized = self._deserialize("DeploymentLogs", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_logs.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs"} # type: ignore - + get_logs.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs"} # type: ignore @distributed_trace def list_skus( @@ -1077,16 +1237,23 @@ def list_skus( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.SkuResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.SkuResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_skus_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -1096,13 +1263,13 @@ def prepare_request(next_link=None): api_version=api_version, count=count, skip=skip, - template_url=self.list_skus.metadata['url'], + template_url=self.list_skus.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_skus_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -1120,7 +1287,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("SkuResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "SkuResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1129,22 +1298,28 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_skus.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus"} # type: ignore + list_skus.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_online_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_online_endpoints_operations.py index 448697196546..6f78936b234b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_online_endpoints_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_online_endpoints_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -372,6 +384,7 @@ def build_get_token_request( **kwargs ) + # fmt: on class OnlineEndpointsOperations(object): """OnlineEndpointsOperations operations. @@ -442,16 +455,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.OnlineEndpointTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -464,13 +484,13 @@ def prepare_request(next_link=None): tags=tags, properties=properties, order_by=order_by, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -491,7 +511,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineEndpointTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "OnlineEndpointTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -500,25 +523,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -528,49 +557,65 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -603,43 +648,52 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace def get( @@ -665,47 +719,59 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.OnlineEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize("OnlineEndpoint", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore def _update_initial( self, @@ -716,16 +782,26 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.OnlineEndpoint"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineEndpoint"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.OnlineEndpoint"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') + _json = self._serialize.body( + body, "PartialMinimalTrackedResourceWithIdentity" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -735,40 +811,55 @@ def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace def begin_update( @@ -807,15 +898,24 @@ def begin_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -824,32 +924,38 @@ def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore def _create_or_update_initial( self, @@ -860,16 +966,24 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.OnlineEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'OnlineEndpoint') + _json = self._serialize.body(body, "OnlineEndpoint") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -879,39 +993,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -949,15 +1079,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -966,32 +1105,38 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace def list_keys( @@ -1017,47 +1162,59 @@ def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthKeys"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) + deserialized = self._deserialize("EndpointAuthKeys", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys"} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys"} # type: ignore def _regenerate_keys_initial( # pylint: disable=inconsistent-return-statements self, @@ -1068,16 +1225,22 @@ def _regenerate_keys_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'RegenerateEndpointKeysRequest') + _json = self._serialize.body(body, "RegenerateEndpointKeysRequest") request = build_regenerate_keys_request_initial( subscription_id=self._config.subscription_id, @@ -1087,33 +1250,41 @@ def _regenerate_keys_initial( # pylint: disable=inconsistent-return-statements api_version=api_version, content_type=content_type, json=_json, - template_url=self._regenerate_keys_initial.metadata['url'], + template_url=self._regenerate_keys_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _regenerate_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore - + _regenerate_keys_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore @distributed_trace def begin_regenerate_keys( # pylint: disable=inconsistent-return-statements @@ -1149,15 +1320,22 @@ def begin_regenerate_keys( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._regenerate_keys_initial( resource_group_name=resource_group_name, @@ -1166,29 +1344,37 @@ def begin_regenerate_keys( # pylint: disable=inconsistent-return-statements body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_regenerate_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore + begin_regenerate_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore @distributed_trace def get_token( @@ -1214,44 +1400,58 @@ def get_token( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthToken :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthToken"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthToken"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_token_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.get_token.metadata['url'], + template_url=self.get_token.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EndpointAuthToken', pipeline_response) + deserialized = self._deserialize( + "EndpointAuthToken", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token"} # type: ignore - + get_token.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_operations.py index 28734bc56724..ec0eff0bcf65 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -57,6 +69,7 @@ def build_list_request( **kwargs ) + # fmt: on class Operations(object): """Operations operations. @@ -82,8 +95,7 @@ def __init__(self, client, config, serializer, deserializer): @distributed_trace def list( - self, - **kwargs # type: Any + self, **kwargs # type: Any ): # type: (...) -> Iterable["_models.AmlOperationListResult"] """Lists all of the available Azure Machine Learning Services REST API operations. @@ -95,25 +107,32 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.AmlOperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlOperationListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.AmlOperationListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( api_version=api_version, template_url=next_link, @@ -124,7 +143,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("AmlOperationListResult", pipeline_response) + deserialized = self._deserialize( + "AmlOperationListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -133,22 +154,28 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/providers/Microsoft.MachineLearningServices/operations"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.MachineLearningServices/operations"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_private_endpoint_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_private_endpoint_connections_operations.py index 58281925f838..440ef760d4a8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_private_endpoint_connections_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_private_endpoint_connections_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -187,6 +199,7 @@ def build_delete_request( **kwargs ) + # fmt: on class PrivateEndpointConnectionsOperations(object): """PrivateEndpointConnectionsOperations operations. @@ -231,28 +244,35 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnectionListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( resource_group_name=resource_group_name, workspace_name=workspace_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( resource_group_name=resource_group_name, workspace_name=workspace_name, @@ -266,7 +286,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) + deserialized = self._deserialize( + "PrivateEndpointConnectionListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -275,25 +297,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections"} # type: ignore @distributed_trace def get( @@ -318,47 +346,61 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, private_endpoint_connection_name=private_endpoint_connection_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + deserialized = self._deserialize( + "PrivateEndpointConnection", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace def create_or_update( @@ -386,16 +428,24 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(properties, 'PrivateEndpointConnection') + _json = self._serialize.body(properties, "PrivateEndpointConnection") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -405,32 +455,41 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + deserialized = self._deserialize( + "PrivateEndpointConnection", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -455,40 +514,50 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, private_endpoint_connection_name=private_endpoint_connection_name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_private_link_resources_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_private_link_resources_operations.py index 1ad9f1900055..9448905064b3 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_private_link_resources_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_private_link_resources_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest @@ -23,8 +29,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -66,6 +78,7 @@ def build_list_request( **kwargs ) + # fmt: on class PrivateLinkResourcesOperations(object): """PrivateLinkResourcesOperations operations. @@ -108,43 +121,57 @@ def list( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateLinkResourceListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateLinkResourceListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateLinkResourceListResult', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "PrivateLinkResourceListResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources"} # type: ignore - + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_quotas_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_quotas_operations.py index d69bf6dfa54f..753a8e1442f9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_quotas_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_quotas_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -103,6 +115,7 @@ def build_list_request( **kwargs ) + # fmt: on class QuotasOperations(object): """QuotasOperations operations. @@ -145,16 +158,24 @@ def update( :rtype: ~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotasResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'QuotaUpdateParameters') + _json = self._serialize.body(parameters, "QuotaUpdateParameters") request = build_update_request( location=location, @@ -162,32 +183,41 @@ def update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.update.metadata['url'], + template_url=self.update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('UpdateWorkspaceQuotasResult', pipeline_response) + deserialized = self._deserialize( + "UpdateWorkspaceQuotasResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas"} # type: ignore - + update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas"} # type: ignore @distributed_trace def list( @@ -206,27 +236,34 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListWorkspaceQuotas] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceQuotas"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListWorkspaceQuotas"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, @@ -239,7 +276,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ListWorkspaceQuotas", pipeline_response) + deserialized = self._deserialize( + "ListWorkspaceQuotas", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -248,22 +287,28 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registries_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registries_operations.py index 82b521391f8d..282b40c4f747 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registries_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registries_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -260,6 +272,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class RegistriesOperations(object): """RegistriesOperations operations. @@ -303,27 +316,34 @@ def list_by_subscription( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.RegistryTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, skip=skip, - template_url=self.list_by_subscription.metadata['url'], + template_url=self.list_by_subscription.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, @@ -336,7 +356,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("RegistryTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "RegistryTrackedResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -345,25 +367,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore + list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore @distributed_trace def list( @@ -388,28 +416,35 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.RegistryTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, api_version=api_version, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -423,7 +458,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("RegistryTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "RegistryTrackedResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -432,25 +469,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -459,48 +502,64 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -530,42 +589,51 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace def get( @@ -588,46 +656,56 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.Registry :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace def update( @@ -653,16 +731,24 @@ def update( :rtype: ~azure.mgmt.machinelearningservices.models.Registry :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialRegistryPartialTrackedResource') + _json = self._serialize.body( + body, "PartialRegistryPartialTrackedResource" + ) request = build_update_request( subscription_id=self._config.subscription_id, @@ -671,36 +757,43 @@ def update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.update.metadata['url'], + template_url=self.update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if response.status_code == 202: - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - + update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore def _create_or_update_initial( self, @@ -710,16 +803,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.Registry" - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'Registry') + _json = self._serialize.body(body, "Registry") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -728,38 +827,43 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if response.status_code == 202: - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -792,15 +896,22 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Registry] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -808,29 +919,37 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_code_containers_operations.py index 9bb4fac625ba..9ffcc57f5b00 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_code_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_code_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -192,6 +204,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class RegistryCodeContainersOperations(object): """RegistryCodeContainersOperations operations. @@ -241,29 +254,36 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, api_version=api_version, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -278,7 +298,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -287,25 +309,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -315,49 +343,65 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, code_name=code_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -390,43 +434,56 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, code_name=code_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore @distributed_trace def get( @@ -452,47 +509,57 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, code_name=code_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize("CodeContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore def _create_or_update_initial( self, @@ -503,16 +570,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.CodeContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeContainer') + _json = self._serialize.body(body, "CodeContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -522,39 +595,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('CodeContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -591,15 +680,22 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.CodeContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -608,29 +704,39 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_code_versions_operations.py index b06b751098d6..e63e3101b2cb 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_code_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_code_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -206,6 +218,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class RegistryCodeVersionsOperations(object): """RegistryCodeVersionsOperations operations. @@ -264,16 +277,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -283,13 +303,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -307,7 +327,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -316,25 +338,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -345,15 +373,18 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -361,34 +392,47 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements code_name=code_name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -424,14 +468,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -439,29 +488,37 @@ def begin_delete( # pylint: disable=inconsistent-return-statements code_name=code_name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -490,15 +547,18 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -506,32 +566,39 @@ def get( code_name=code_name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore def _create_or_update_initial( self, @@ -543,16 +610,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.CodeVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeVersion') + _json = self._serialize.body(body, "CodeVersion") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -563,39 +636,51 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('CodeVersion', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -635,15 +720,22 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.CodeVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -653,29 +745,37 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_component_containers_operations.py index 8b5332d2f1d7..9fcea3023e46 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_component_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_component_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -192,6 +204,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class RegistryComponentContainersOperations(object): """RegistryComponentContainersOperations operations. @@ -241,29 +254,36 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, api_version=api_version, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -278,7 +298,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -287,25 +310,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -315,49 +344,65 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, component_name=component_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -390,43 +435,56 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, component_name=component_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore @distributed_trace def get( @@ -452,47 +510,61 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, component_name=component_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore def _create_or_update_initial( self, @@ -503,16 +575,24 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.ComponentContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentContainer') + _json = self._serialize.body(body, "ComponentContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -522,39 +602,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComponentContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -592,15 +688,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComponentContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -609,29 +714,39 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_component_versions_operations.py index 5cdbb59cd928..16ce5603edca 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_component_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_component_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -206,6 +218,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class RegistryComponentVersionsOperations(object): """RegistryComponentVersionsOperations operations. @@ -264,16 +277,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -283,13 +303,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -307,7 +327,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -316,25 +338,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -345,15 +373,18 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -361,34 +392,47 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements component_name=component_name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -424,14 +468,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -439,29 +488,37 @@ def begin_delete( # pylint: disable=inconsistent-return-statements component_name=component_name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -490,15 +547,20 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -506,32 +568,39 @@ def get( component_name=component_name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize("ComponentVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore def _create_or_update_initial( self, @@ -543,16 +612,24 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.ComponentVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentVersion') + _json = self._serialize.body(body, "ComponentVersion") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -563,39 +640,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComponentVersion', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -636,15 +729,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComponentVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -654,29 +756,39 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_environment_containers_operations.py index 6f2dcc994ef2..cfb7968a8c3f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_environment_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_environment_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -195,6 +207,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class RegistryEnvironmentContainersOperations(object): """RegistryEnvironmentContainersOperations operations. @@ -247,16 +260,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -264,13 +284,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -286,7 +306,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -295,25 +318,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -323,49 +352,65 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, environment_name=environment_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -398,43 +443,56 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, environment_name=environment_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore @distributed_trace def get( @@ -460,47 +518,61 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, environment_name=environment_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore def _create_or_update_initial( self, @@ -511,16 +583,24 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.EnvironmentContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentContainer') + _json = self._serialize.body(body, "EnvironmentContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -530,39 +610,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -600,15 +696,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -617,29 +722,39 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_environment_versions_operations.py index b54f03c1f10d..583315ae4ea1 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_environment_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_environment_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -209,6 +221,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class RegistryEnvironmentVersionsOperations(object): """RegistryEnvironmentVersionsOperations operations. @@ -270,16 +283,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -290,13 +310,13 @@ def prepare_request(next_link=None): top=top, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -315,7 +335,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersionResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -324,25 +347,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -353,15 +382,18 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -369,34 +401,47 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements environment_name=environment_name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -432,14 +477,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -447,29 +497,37 @@ def begin_delete( # pylint: disable=inconsistent-return-statements environment_name=environment_name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -498,15 +556,20 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -514,32 +577,41 @@ def get( environment_name=environment_name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore def _create_or_update_initial( self, @@ -551,16 +623,24 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.EnvironmentVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentVersion') + _json = self._serialize.body(body, "EnvironmentVersion") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -571,39 +651,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -644,15 +740,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -662,29 +767,39 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_model_containers_operations.py index a321d4711e16..cbd6636e4200 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_model_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_model_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -195,6 +207,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class RegistryModelContainersOperations(object): """RegistryModelContainersOperations operations. @@ -247,16 +260,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -264,13 +284,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -286,7 +306,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -295,25 +317,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -323,49 +351,65 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, model_name=model_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -398,43 +442,56 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, model_name=model_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore @distributed_trace def get( @@ -460,47 +517,59 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, model_name=model_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize("ModelContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore def _create_or_update_initial( self, @@ -511,16 +580,24 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.ModelContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelContainer') + _json = self._serialize.body(body, "ModelContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -530,39 +607,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ModelContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -600,15 +693,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ModelContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -617,29 +719,39 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_model_versions_operations.py index f26bef0104a4..c08e1a675025 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_model_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_model_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -221,6 +233,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class RegistryModelVersionsOperations(object): """RegistryModelVersionsOperations operations. @@ -296,16 +309,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -320,13 +340,13 @@ def prepare_request(next_link=None): tags=tags, properties=properties, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -349,7 +369,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -358,25 +380,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -387,15 +415,18 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -403,34 +434,47 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements model_name=model_name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -466,14 +510,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -481,29 +530,37 @@ def begin_delete( # pylint: disable=inconsistent-return-statements model_name=model_name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -532,15 +589,18 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -548,32 +608,39 @@ def get( model_name=model_name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore def _create_or_update_initial( self, @@ -585,16 +652,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.ModelVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelVersion') + _json = self._serialize.body(body, "ModelVersion") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -605,39 +678,51 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ModelVersion', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -677,15 +762,22 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ModelVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -695,29 +787,37 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_schedules_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_schedules_operations.py index f86a36206fc2..44cb71885c4c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_schedules_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_schedules_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -195,6 +207,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class SchedulesOperations(object): """SchedulesOperations operations. @@ -247,16 +260,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ScheduleResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduleResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ScheduleResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -264,13 +284,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -286,7 +306,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ScheduleResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ScheduleResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -295,25 +317,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -323,49 +351,65 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -398,43 +442,52 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @distributed_trace def get( @@ -460,47 +513,57 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.Schedule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Schedule"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Schedule', pipeline_response) + deserialized = self._deserialize("Schedule", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore def _create_or_update_initial( self, @@ -511,16 +574,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.Schedule" - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Schedule"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'Schedule') + _json = self._serialize.body(body, "Schedule") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -530,39 +599,51 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('Schedule', pipeline_response) + deserialized = self._deserialize("Schedule", pipeline_response) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('Schedule', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("Schedule", pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -598,15 +679,22 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Schedule] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Schedule"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -615,29 +703,33 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Schedule', pipeline_response) + deserialized = self._deserialize("Schedule", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_usages_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_usages_operations.py index eaf2673542b7..2ca0fa5c1b2d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_usages_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_usages_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -65,6 +77,7 @@ def build_list_request( **kwargs ) + # fmt: on class UsagesOperations(object): """UsagesOperations operations. @@ -106,27 +119,34 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListUsagesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListUsagesResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, @@ -139,7 +159,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ListUsagesResult", pipeline_response) + deserialized = self._deserialize( + "ListUsagesResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -148,22 +170,28 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_virtual_machine_sizes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_virtual_machine_sizes_operations.py index 0c8ccb2106cb..9f54feca3578 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_virtual_machine_sizes_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_virtual_machine_sizes_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest @@ -23,8 +29,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -64,6 +76,7 @@ def build_list_request( **kwargs ) + # fmt: on class VirtualMachineSizesOperations(object): """VirtualMachineSizesOperations operations. @@ -103,42 +116,56 @@ def list( :rtype: ~azure.mgmt.machinelearningservices.models.VirtualMachineSizeListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_list_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualMachineSizeListResult', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "VirtualMachineSizeListResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes"} # type: ignore - + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_workspace_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_workspace_connections_operations.py index 0e8b54fa156e..52369303c30d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_workspace_connections_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_workspace_connections_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -193,6 +205,7 @@ def build_list_request( **kwargs ) + # fmt: on class WorkspaceConnectionsOperations(object): """WorkspaceConnectionsOperations operations. @@ -242,16 +255,26 @@ def create( :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'WorkspaceConnectionPropertiesV2BasicResource') + _json = self._serialize.body( + parameters, "WorkspaceConnectionPropertiesV2BasicResource" + ) request = build_create_request( subscription_id=self._config.subscription_id, @@ -261,32 +284,41 @@ def create( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create.metadata['url'], + template_url=self.create.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - + create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace def get( @@ -310,47 +342,61 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, connection_name=connection_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -374,43 +420,53 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, connection_name=connection_name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace def list( @@ -439,16 +495,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -456,13 +519,13 @@ def prepare_request(next_link=None): api_version=api_version, target=target, category=category, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -478,7 +541,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -487,22 +553,28 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_workspace_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_workspace_features_operations.py index 95365dd5eca7..e49e93c11baf 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_workspace_features_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_workspace_features_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -67,6 +79,7 @@ def build_list_request( **kwargs ) + # fmt: on class WorkspaceFeaturesOperations(object): """WorkspaceFeaturesOperations operations. @@ -111,28 +124,35 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListAmlUserFeatureResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAmlUserFeatureResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListAmlUserFeatureResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -146,7 +166,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ListAmlUserFeatureResult", pipeline_response) + deserialized = self._deserialize( + "ListAmlUserFeatureResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -155,22 +177,28 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_workspaces_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_workspaces_operations.py index 86fa0ef46b74..443d62c473d5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_workspaces_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_workspaces_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -559,6 +571,7 @@ def build_list_outbound_network_dependencies_endpoints_request( **kwargs ) + # fmt: on class WorkspacesOperations(object): """WorkspacesOperations operations. @@ -601,46 +614,56 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.Workspace :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore def _create_or_update_initial( self, @@ -650,16 +673,24 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.Workspace"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.Workspace"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'Workspace') + _json = self._serialize.body(parameters, "Workspace") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -668,33 +699,38 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -725,15 +761,22 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Workspace] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -741,32 +784,36 @@ def begin_create_or_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -775,41 +822,49 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -837,42 +892,51 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore def _update_initial( self, @@ -882,16 +946,24 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.Workspace"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.Workspace"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'WorkspaceUpdateParameters') + _json = self._serialize.body(parameters, "WorkspaceUpdateParameters") request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -900,33 +972,38 @@ def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace def begin_update( @@ -957,15 +1034,22 @@ def begin_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Workspace] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -973,32 +1057,36 @@ def begin_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace def list_by_resource_group( @@ -1020,28 +1108,35 @@ def list_by_resource_group( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_by_resource_group_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, api_version=api_version, skip=skip, - template_url=self.list_by_resource_group.metadata['url'], + template_url=self.list_by_resource_group.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_by_resource_group_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -1055,7 +1150,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1064,25 +1161,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore + list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore def _diagnose_initial( self, @@ -1092,17 +1195,27 @@ def _diagnose_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.DiagnoseResponseResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if parameters is not None: - _json = self._serialize.body(parameters, 'DiagnoseWorkspaceParameters') + _json = self._serialize.body( + parameters, "DiagnoseWorkspaceParameters" + ) else: _json = None @@ -1113,39 +1226,49 @@ def _diagnose_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._diagnose_initial.metadata['url'], + template_url=self._diagnose_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) + deserialized = self._deserialize( + "DiagnoseResponseResult", pipeline_response + ) if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _diagnose_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore - + _diagnose_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore @distributed_trace def begin_diagnose( @@ -1180,15 +1303,24 @@ def begin_diagnose( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.DiagnoseResponseResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnoseResponseResult"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DiagnoseResponseResult"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._diagnose_initial( resource_group_name=resource_group_name, @@ -1196,32 +1328,42 @@ def begin_diagnose( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) + deserialized = self._deserialize( + "DiagnoseResponseResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_diagnose.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore + begin_diagnose.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore @distributed_trace def list_keys( @@ -1243,46 +1385,60 @@ def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListWorkspaceKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceKeysResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListWorkspaceKeysResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ListWorkspaceKeysResult', pipeline_response) + deserialized = self._deserialize( + "ListWorkspaceKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys"} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys"} # type: ignore def _resync_keys_initial( # pylint: disable=inconsistent-return-statements self, @@ -1291,41 +1447,49 @@ def _resync_keys_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_resync_keys_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self._resync_keys_initial.metadata['url'], + template_url=self._resync_keys_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _resync_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore - + _resync_keys_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore @distributed_trace def begin_resync_keys( # pylint: disable=inconsistent-return-statements @@ -1354,42 +1518,51 @@ def begin_resync_keys( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._resync_keys_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_resync_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore + begin_resync_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore @distributed_trace def list_by_subscription( @@ -1408,27 +1581,34 @@ def list_by_subscription( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, skip=skip, - template_url=self.list_by_subscription.metadata['url'], + template_url=self.list_by_subscription.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, @@ -1441,7 +1621,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1450,25 +1632,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore + list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore @distributed_trace def list_notebook_access_token( @@ -1489,46 +1677,60 @@ def list_notebook_access_token( :rtype: ~azure.mgmt.machinelearningservices.models.NotebookAccessTokenResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookAccessTokenResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.NotebookAccessTokenResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_list_notebook_access_token_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_notebook_access_token.metadata['url'], + template_url=self.list_notebook_access_token.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('NotebookAccessTokenResult', pipeline_response) + deserialized = self._deserialize( + "NotebookAccessTokenResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_notebook_access_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken"} # type: ignore - + list_notebook_access_token.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken"} # type: ignore def _prepare_notebook_initial( self, @@ -1537,47 +1739,59 @@ def _prepare_notebook_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.NotebookResourceInfo"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NotebookResourceInfo"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.NotebookResourceInfo"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_prepare_notebook_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self._prepare_notebook_initial.metadata['url'], + template_url=self._prepare_notebook_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) + deserialized = self._deserialize( + "NotebookResourceInfo", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _prepare_notebook_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore - + _prepare_notebook_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore @distributed_trace def begin_prepare_notebook( @@ -1607,45 +1821,62 @@ def begin_prepare_notebook( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.NotebookResourceInfo] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookResourceInfo"] + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.NotebookResourceInfo"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._prepare_notebook_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) + deserialized = self._deserialize( + "NotebookResourceInfo", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_prepare_notebook.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore + begin_prepare_notebook.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore @distributed_trace def list_storage_account_keys( @@ -1666,46 +1897,60 @@ def list_storage_account_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListStorageAccountKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListStorageAccountKeysResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListStorageAccountKeysResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_list_storage_account_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_storage_account_keys.metadata['url'], + template_url=self.list_storage_account_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ListStorageAccountKeysResult', pipeline_response) + deserialized = self._deserialize( + "ListStorageAccountKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_storage_account_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys"} # type: ignore - + list_storage_account_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys"} # type: ignore @distributed_trace def list_notebook_keys( @@ -1726,46 +1971,60 @@ def list_notebook_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListNotebookKeysResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListNotebookKeysResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_list_notebook_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_notebook_keys.metadata['url'], + template_url=self.list_notebook_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ListNotebookKeysResult', pipeline_response) + deserialized = self._deserialize( + "ListNotebookKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_notebook_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys"} # type: ignore - + list_notebook_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys"} # type: ignore @distributed_trace def list_outbound_network_dependencies_endpoints( @@ -1790,43 +2049,59 @@ def list_outbound_network_dependencies_endpoints( :rtype: ~azure.mgmt.machinelearningservices.models.ExternalFQDNResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExternalFQDNResponse"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ExternalFQDNResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-10-01-preview" + ) # type: str - request = build_list_outbound_network_dependencies_endpoints_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], + template_url=self.list_outbound_network_dependencies_endpoints.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ExternalFQDNResponse', pipeline_response) + deserialized = self._deserialize( + "ExternalFQDNResponse", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_outbound_network_dependencies_endpoints.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints"} # type: ignore - + list_outbound_network_dependencies_endpoints.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/__init__.py index da46614477a9..71cf8fdc020d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/__init__.py @@ -10,9 +10,10 @@ from ._version import VERSION __version__ = VERSION -__all__ = ['AzureMachineLearningWorkspaces'] +__all__ = ["AzureMachineLearningWorkspaces"] # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk + patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/_azure_machine_learning_workspaces.py index 23c2eae6d090..7955c56d97cb 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/_azure_machine_learning_workspaces.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/_azure_machine_learning_workspaces.py @@ -15,7 +15,47 @@ from . import models from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import BatchDeploymentsOperations, BatchEndpointsOperations, CodeContainersOperations, CodeVersionsOperations, ComponentContainersOperations, ComponentVersionsOperations, ComputeOperations, DataContainersOperations, DataVersionsOperations, DatastoresOperations, EnvironmentContainersOperations, EnvironmentVersionsOperations, JobsOperations, LabelingJobsOperations, ManagedNetworkProvisionsOperations, ManagedNetworkSettingsRuleOperations, ModelContainersOperations, ModelVersionsOperations, OnlineDeploymentsOperations, OnlineEndpointsOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, QuotasOperations, RegistriesOperations, RegistryCodeContainersOperations, RegistryCodeVersionsOperations, RegistryComponentContainersOperations, RegistryComponentVersionsOperations, RegistryEnvironmentContainersOperations, RegistryEnvironmentVersionsOperations, RegistryModelContainersOperations, RegistryModelVersionsOperations, SchedulesOperations, UsagesOperations, VirtualMachineSizesOperations, WorkspaceConnectionsOperations, WorkspaceFeaturesOperations, WorkspacesOperations +from .operations import ( + BatchDeploymentsOperations, + BatchEndpointsOperations, + CodeContainersOperations, + CodeVersionsOperations, + ComponentContainersOperations, + ComponentVersionsOperations, + ComputeOperations, + DataContainersOperations, + DataVersionsOperations, + DatastoresOperations, + EnvironmentContainersOperations, + EnvironmentVersionsOperations, + JobsOperations, + LabelingJobsOperations, + ManagedNetworkProvisionsOperations, + ManagedNetworkSettingsRuleOperations, + ModelContainersOperations, + ModelVersionsOperations, + OnlineDeploymentsOperations, + OnlineEndpointsOperations, + Operations, + PrivateEndpointConnectionsOperations, + PrivateLinkResourcesOperations, + QuotasOperations, + RegistriesOperations, + RegistryCodeContainersOperations, + RegistryCodeVersionsOperations, + RegistryComponentContainersOperations, + RegistryComponentVersionsOperations, + RegistryEnvironmentContainersOperations, + RegistryEnvironmentVersionsOperations, + RegistryModelContainersOperations, + RegistryModelVersionsOperations, + SchedulesOperations, + UsagesOperations, + VirtualMachineSizesOperations, + WorkspaceConnectionsOperations, + WorkspaceFeaturesOperations, + WorkspacesOperations, +) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -24,7 +64,10 @@ from azure.core.credentials import TokenCredential from azure.core.rest import HttpRequest, HttpResponse -class AzureMachineLearningWorkspaces(object): # pylint: disable=too-many-instance-attributes + +class AzureMachineLearningWorkspaces( + object +): # pylint: disable=too-many-instance-attributes """These APIs allow end users to operate on Azure Machine Learning Workspace resources. :ivar operations: Operations operations @@ -152,53 +195,146 @@ def __init__( **kwargs # type: Any ): # type: (...) -> None - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._config = AzureMachineLearningWorkspacesConfiguration( + credential=credential, subscription_id=subscription_id, **kwargs + ) + self._client = ARMPipelineClient( + base_url=base_url, config=self._config, **kwargs + ) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = { + k: v for k, v in models.__dict__.items() if isinstance(v, type) + } self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.workspaces = WorkspacesOperations(self._client, self._config, self._serialize, self._deserialize) - self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) - self.virtual_machine_sizes = VirtualMachineSizesOperations(self._client, self._config, self._serialize, self._deserialize) - self.quotas = QuotasOperations(self._client, self._config, self._serialize, self._deserialize) - self.compute = ComputeOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_connections = WorkspaceConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.managed_network_settings_rule = ManagedNetworkSettingsRuleOperations(self._client, self._config, self._serialize, self._deserialize) - self.managed_network_provisions = ManagedNetworkProvisionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registries = RegistriesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_features = WorkspaceFeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_code_containers = RegistryCodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_code_versions = RegistryCodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_component_containers = RegistryComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_component_versions = RegistryComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_environment_containers = RegistryEnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_environment_versions = RegistryEnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_model_containers = RegistryModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_model_versions = RegistryModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_endpoints = BatchEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_deployments = BatchDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_containers = CodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_versions = CodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_containers = ComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_versions = ComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_containers = DataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_versions = DataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.datastores = DatastoresOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_containers = EnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_versions = EnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.labeling_jobs = LabelingJobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_containers = ModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_versions = ModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_endpoints = OnlineEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_deployments = OnlineDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.schedules = SchedulesOperations(self._client, self._config, self._serialize, self._deserialize) - + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspaces = WorkspacesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.usages = UsagesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.virtual_machine_sizes = VirtualMachineSizesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.quotas = QuotasOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.compute = ComputeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.private_endpoint_connections = ( + PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspace_connections = WorkspaceConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.managed_network_settings_rule = ( + ManagedNetworkSettingsRuleOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.managed_network_provisions = ManagedNetworkProvisionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registries = RegistriesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspace_features = WorkspaceFeaturesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_code_containers = RegistryCodeContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_code_versions = RegistryCodeVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_component_containers = ( + RegistryComponentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.registry_component_versions = RegistryComponentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_environment_containers = ( + RegistryEnvironmentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.registry_environment_versions = ( + RegistryEnvironmentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.registry_model_containers = RegistryModelContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_model_versions = RegistryModelVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.batch_endpoints = BatchEndpointsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.batch_deployments = BatchDeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.code_containers = CodeContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.code_versions = CodeVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.component_containers = ComponentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.component_versions = ComponentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_containers = DataContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_versions = DataVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.datastores = DatastoresOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.environment_containers = EnvironmentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.environment_versions = EnvironmentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.jobs = JobsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.labeling_jobs = LabelingJobsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.model_containers = ModelContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.model_versions = ModelVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.online_endpoints = OnlineEndpointsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.online_deployments = OnlineDeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.schedules = SchedulesOperations( + self._client, self._config, self._serialize, self._deserialize + ) def _send_request( self, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/_configuration.py index 00aa2745409c..ca1384693079 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/_configuration.py @@ -10,7 +10,10 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ( + ARMChallengeAuthenticationPolicy, + ARMHttpLoggingPolicy, +) from ._version import VERSION @@ -21,7 +24,9 @@ from azure.core.credentials import TokenCredential -class AzureMachineLearningWorkspacesConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AzureMachineLearningWorkspacesConfiguration( + Configuration +): # pylint: disable=too-many-instance-attributes """Configuration for AzureMachineLearningWorkspaces. Note that all parameters used to create this instance are saved as instance @@ -43,8 +48,12 @@ def __init__( **kwargs # type: Any ): # type: (...) -> None - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + super(AzureMachineLearningWorkspacesConfiguration, self).__init__( + **kwargs + ) + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -54,23 +63,44 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = api_version - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) + self.credential_scopes = kwargs.pop( + "credential_scopes", ["https://management.azure.com/.default"] + ) + kwargs.setdefault( + "sdk_moniker", "mgmt-machinelearningservices/{}".format(VERSION) + ) self._configure(**kwargs) def _configure( - self, - **kwargs # type: Any + self, **kwargs # type: Any ): # type: (...) -> None - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') + self.user_agent_policy = kwargs.get( + "user_agent_policy" + ) or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get( + "headers_policy" + ) or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy( + **kwargs + ) + self.logging_policy = kwargs.get( + "logging_policy" + ) or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get( + "http_logging_policy" + ) or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy( + **kwargs + ) + self.custom_hook_policy = kwargs.get( + "custom_hook_policy" + ) or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get( + "redirect_policy" + ) or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = ARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/_patch.py index 74e48ecd07cf..17dbc073e01b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/_patch.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/_patch.py @@ -25,7 +25,8 @@ # # -------------------------------------------------------------------------- + # This file is used for handwritten extensions to the generated code. Example: # https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md def patch_sdk(): - pass \ No newline at end of file + pass diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/_vendor.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/_vendor.py index 138f663c53a4..ed3373e9699d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/_vendor.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/_vendor.py @@ -7,13 +7,20 @@ from azure.core.pipeline.transport import HttpRequest + def _convert_request(request, files=None): data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + request = HttpRequest( + method=request.method, + url=request.url, + headers=request.headers, + data=data, + ) if files: request.set_formdata_body(files) return request + def _format_url_section(template, **kwargs): components = template.split("/") while components: @@ -22,6 +29,8 @@ def _format_url_section(template, **kwargs): except KeyError as key: formatted_components = template.split("/") components = [ - c for c in formatted_components if "{}".format(key.args[0]) not in c + c + for c in formatted_components + if "{}".format(key.args[0]) not in c ] template = "/".join(components) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/__init__.py index f67ccda966f1..b90ec7485f14 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/__init__.py @@ -7,9 +7,11 @@ # -------------------------------------------------------------------------- from ._azure_machine_learning_workspaces import AzureMachineLearningWorkspaces -__all__ = ['AzureMachineLearningWorkspaces'] + +__all__ = ["AzureMachineLearningWorkspaces"] # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk + patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/_azure_machine_learning_workspaces.py index 1c0b79d06b95..9f45c522cb7e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/_azure_machine_learning_workspaces.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/_azure_machine_learning_workspaces.py @@ -16,13 +16,54 @@ from .. import models from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import BatchDeploymentsOperations, BatchEndpointsOperations, CodeContainersOperations, CodeVersionsOperations, ComponentContainersOperations, ComponentVersionsOperations, ComputeOperations, DataContainersOperations, DataVersionsOperations, DatastoresOperations, EnvironmentContainersOperations, EnvironmentVersionsOperations, JobsOperations, LabelingJobsOperations, ManagedNetworkProvisionsOperations, ManagedNetworkSettingsRuleOperations, ModelContainersOperations, ModelVersionsOperations, OnlineDeploymentsOperations, OnlineEndpointsOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, QuotasOperations, RegistriesOperations, RegistryCodeContainersOperations, RegistryCodeVersionsOperations, RegistryComponentContainersOperations, RegistryComponentVersionsOperations, RegistryEnvironmentContainersOperations, RegistryEnvironmentVersionsOperations, RegistryModelContainersOperations, RegistryModelVersionsOperations, SchedulesOperations, UsagesOperations, VirtualMachineSizesOperations, WorkspaceConnectionsOperations, WorkspaceFeaturesOperations, WorkspacesOperations +from .operations import ( + BatchDeploymentsOperations, + BatchEndpointsOperations, + CodeContainersOperations, + CodeVersionsOperations, + ComponentContainersOperations, + ComponentVersionsOperations, + ComputeOperations, + DataContainersOperations, + DataVersionsOperations, + DatastoresOperations, + EnvironmentContainersOperations, + EnvironmentVersionsOperations, + JobsOperations, + LabelingJobsOperations, + ManagedNetworkProvisionsOperations, + ManagedNetworkSettingsRuleOperations, + ModelContainersOperations, + ModelVersionsOperations, + OnlineDeploymentsOperations, + OnlineEndpointsOperations, + Operations, + PrivateEndpointConnectionsOperations, + PrivateLinkResourcesOperations, + QuotasOperations, + RegistriesOperations, + RegistryCodeContainersOperations, + RegistryCodeVersionsOperations, + RegistryComponentContainersOperations, + RegistryComponentVersionsOperations, + RegistryEnvironmentContainersOperations, + RegistryEnvironmentVersionsOperations, + RegistryModelContainersOperations, + RegistryModelVersionsOperations, + SchedulesOperations, + UsagesOperations, + VirtualMachineSizesOperations, + WorkspaceConnectionsOperations, + WorkspaceFeaturesOperations, + WorkspacesOperations, +) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class AzureMachineLearningWorkspaces: # pylint: disable=too-many-instance-attributes + +class AzureMachineLearningWorkspaces: # pylint: disable=too-many-instance-attributes """These APIs allow end users to operate on Azure Machine Learning Workspace resources. :ivar operations: Operations operations @@ -153,58 +194,149 @@ def __init__( base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._config = AzureMachineLearningWorkspacesConfiguration( + credential=credential, subscription_id=subscription_id, **kwargs + ) + self._client = AsyncARMPipelineClient( + base_url=base_url, config=self._config, **kwargs + ) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = { + k: v for k, v in models.__dict__.items() if isinstance(v, type) + } self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.workspaces = WorkspacesOperations(self._client, self._config, self._serialize, self._deserialize) - self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) - self.virtual_machine_sizes = VirtualMachineSizesOperations(self._client, self._config, self._serialize, self._deserialize) - self.quotas = QuotasOperations(self._client, self._config, self._serialize, self._deserialize) - self.compute = ComputeOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_connections = WorkspaceConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.managed_network_settings_rule = ManagedNetworkSettingsRuleOperations(self._client, self._config, self._serialize, self._deserialize) - self.managed_network_provisions = ManagedNetworkProvisionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registries = RegistriesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_features = WorkspaceFeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_code_containers = RegistryCodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_code_versions = RegistryCodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_component_containers = RegistryComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_component_versions = RegistryComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_environment_containers = RegistryEnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_environment_versions = RegistryEnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_model_containers = RegistryModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_model_versions = RegistryModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_endpoints = BatchEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_deployments = BatchDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_containers = CodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_versions = CodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_containers = ComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_versions = ComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_containers = DataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_versions = DataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.datastores = DatastoresOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_containers = EnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_versions = EnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.labeling_jobs = LabelingJobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_containers = ModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_versions = ModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_endpoints = OnlineEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_deployments = OnlineDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.schedules = SchedulesOperations(self._client, self._config, self._serialize, self._deserialize) - + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspaces = WorkspacesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.usages = UsagesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.virtual_machine_sizes = VirtualMachineSizesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.quotas = QuotasOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.compute = ComputeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.private_endpoint_connections = ( + PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspace_connections = WorkspaceConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.managed_network_settings_rule = ( + ManagedNetworkSettingsRuleOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.managed_network_provisions = ManagedNetworkProvisionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registries = RegistriesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspace_features = WorkspaceFeaturesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_code_containers = RegistryCodeContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_code_versions = RegistryCodeVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_component_containers = ( + RegistryComponentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.registry_component_versions = RegistryComponentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_environment_containers = ( + RegistryEnvironmentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.registry_environment_versions = ( + RegistryEnvironmentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.registry_model_containers = RegistryModelContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_model_versions = RegistryModelVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.batch_endpoints = BatchEndpointsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.batch_deployments = BatchDeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.code_containers = CodeContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.code_versions = CodeVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.component_containers = ComponentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.component_versions = ComponentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_containers = DataContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_versions = DataVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.datastores = DatastoresOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.environment_containers = EnvironmentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.environment_versions = EnvironmentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.jobs = JobsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.labeling_jobs = LabelingJobsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.model_containers = ModelContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.model_versions = ModelVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.online_endpoints = OnlineEndpointsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.online_deployments = OnlineDeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.schedules = SchedulesOperations( + self._client, self._config, self._serialize, self._deserialize + ) def _send_request( - self, - request: HttpRequest, - **kwargs: Any + self, request: HttpRequest, **kwargs: Any ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/_configuration.py index 40a1d32cc86d..4174f8ea8d5b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/_configuration.py @@ -10,7 +10,10 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy +from azure.mgmt.core.policies import ( + ARMHttpLoggingPolicy, + AsyncARMChallengeAuthenticationPolicy, +) from .._version import VERSION @@ -19,7 +22,9 @@ from azure.core.credentials_async import AsyncTokenCredential -class AzureMachineLearningWorkspacesConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AzureMachineLearningWorkspacesConfiguration( + Configuration +): # pylint: disable=too-many-instance-attributes """Configuration for AzureMachineLearningWorkspaces. Note that all parameters used to create this instance are saved as instance @@ -40,8 +45,12 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + super(AzureMachineLearningWorkspacesConfiguration, self).__init__( + **kwargs + ) + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -51,22 +60,41 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = api_version - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) + self.credential_scopes = kwargs.pop( + "credential_scopes", ["https://management.azure.com/.default"] + ) + kwargs.setdefault( + "sdk_moniker", "mgmt-machinelearningservices/{}".format(VERSION) + ) self._configure(**kwargs) - def _configure( - self, - **kwargs: Any - ) -> None: - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get( + "user_agent_policy" + ) or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get( + "headers_policy" + ) or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy( + **kwargs + ) + self.logging_policy = kwargs.get( + "logging_policy" + ) or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get( + "http_logging_policy" + ) or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get( + "retry_policy" + ) or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get( + "custom_hook_policy" + ) or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get( + "redirect_policy" + ) or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/_patch.py index 74e48ecd07cf..17dbc073e01b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/_patch.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/_patch.py @@ -25,7 +25,8 @@ # # -------------------------------------------------------------------------- + # This file is used for handwritten extensions to the generated code. Example: # https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md def patch_sdk(): - pass \ No newline at end of file + pass diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/__init__.py index 3591226dc04e..145854760af9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/__init__.py @@ -12,21 +12,41 @@ from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations from ._quotas_operations import QuotasOperations from ._compute_operations import ComputeOperations -from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_endpoint_connections_operations import ( + PrivateEndpointConnectionsOperations, +) from ._private_link_resources_operations import PrivateLinkResourcesOperations from ._workspace_connections_operations import WorkspaceConnectionsOperations -from ._managed_network_settings_rule_operations import ManagedNetworkSettingsRuleOperations -from ._managed_network_provisions_operations import ManagedNetworkProvisionsOperations +from ._managed_network_settings_rule_operations import ( + ManagedNetworkSettingsRuleOperations, +) +from ._managed_network_provisions_operations import ( + ManagedNetworkProvisionsOperations, +) from ._registries_operations import RegistriesOperations from ._workspace_features_operations import WorkspaceFeaturesOperations -from ._registry_code_containers_operations import RegistryCodeContainersOperations +from ._registry_code_containers_operations import ( + RegistryCodeContainersOperations, +) from ._registry_code_versions_operations import RegistryCodeVersionsOperations -from ._registry_component_containers_operations import RegistryComponentContainersOperations -from ._registry_component_versions_operations import RegistryComponentVersionsOperations -from ._registry_environment_containers_operations import RegistryEnvironmentContainersOperations -from ._registry_environment_versions_operations import RegistryEnvironmentVersionsOperations -from ._registry_model_containers_operations import RegistryModelContainersOperations -from ._registry_model_versions_operations import RegistryModelVersionsOperations +from ._registry_component_containers_operations import ( + RegistryComponentContainersOperations, +) +from ._registry_component_versions_operations import ( + RegistryComponentVersionsOperations, +) +from ._registry_environment_containers_operations import ( + RegistryEnvironmentContainersOperations, +) +from ._registry_environment_versions_operations import ( + RegistryEnvironmentVersionsOperations, +) +from ._registry_model_containers_operations import ( + RegistryModelContainersOperations, +) +from ._registry_model_versions_operations import ( + RegistryModelVersionsOperations, +) from ._batch_endpoints_operations import BatchEndpointsOperations from ._batch_deployments_operations import BatchDeploymentsOperations from ._code_containers_operations import CodeContainersOperations @@ -47,43 +67,43 @@ from ._schedules_operations import SchedulesOperations __all__ = [ - 'Operations', - 'WorkspacesOperations', - 'UsagesOperations', - 'VirtualMachineSizesOperations', - 'QuotasOperations', - 'ComputeOperations', - 'PrivateEndpointConnectionsOperations', - 'PrivateLinkResourcesOperations', - 'WorkspaceConnectionsOperations', - 'ManagedNetworkSettingsRuleOperations', - 'ManagedNetworkProvisionsOperations', - 'RegistriesOperations', - 'WorkspaceFeaturesOperations', - 'RegistryCodeContainersOperations', - 'RegistryCodeVersionsOperations', - 'RegistryComponentContainersOperations', - 'RegistryComponentVersionsOperations', - 'RegistryEnvironmentContainersOperations', - 'RegistryEnvironmentVersionsOperations', - 'RegistryModelContainersOperations', - 'RegistryModelVersionsOperations', - 'BatchEndpointsOperations', - 'BatchDeploymentsOperations', - 'CodeContainersOperations', - 'CodeVersionsOperations', - 'ComponentContainersOperations', - 'ComponentVersionsOperations', - 'DataContainersOperations', - 'DataVersionsOperations', - 'DatastoresOperations', - 'EnvironmentContainersOperations', - 'EnvironmentVersionsOperations', - 'JobsOperations', - 'LabelingJobsOperations', - 'ModelContainersOperations', - 'ModelVersionsOperations', - 'OnlineEndpointsOperations', - 'OnlineDeploymentsOperations', - 'SchedulesOperations', + "Operations", + "WorkspacesOperations", + "UsagesOperations", + "VirtualMachineSizesOperations", + "QuotasOperations", + "ComputeOperations", + "PrivateEndpointConnectionsOperations", + "PrivateLinkResourcesOperations", + "WorkspaceConnectionsOperations", + "ManagedNetworkSettingsRuleOperations", + "ManagedNetworkProvisionsOperations", + "RegistriesOperations", + "WorkspaceFeaturesOperations", + "RegistryCodeContainersOperations", + "RegistryCodeVersionsOperations", + "RegistryComponentContainersOperations", + "RegistryComponentVersionsOperations", + "RegistryEnvironmentContainersOperations", + "RegistryEnvironmentVersionsOperations", + "RegistryModelContainersOperations", + "RegistryModelVersionsOperations", + "BatchEndpointsOperations", + "BatchDeploymentsOperations", + "CodeContainersOperations", + "CodeVersionsOperations", + "ComponentContainersOperations", + "ComponentVersionsOperations", + "DataContainersOperations", + "DataVersionsOperations", + "DatastoresOperations", + "EnvironmentContainersOperations", + "EnvironmentVersionsOperations", + "JobsOperations", + "LabelingJobsOperations", + "ModelContainersOperations", + "ModelVersionsOperations", + "OnlineEndpointsOperations", + "OnlineDeploymentsOperations", + "SchedulesOperations", ] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_batch_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_batch_deployments_operations.py index 01458590a5dc..4fb2d9b664d0 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_batch_deployments_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_batch_deployments_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,22 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._batch_deployments_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._batch_deployments_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class BatchDeploymentsOperations: """BatchDeploymentsOperations async operations. @@ -57,7 +80,9 @@ def list( top: Optional[int] = None, skip: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.BatchDeploymentTrackedResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.BatchDeploymentTrackedResourceArmPaginatedResult" + ]: """Lists Batch inference deployments in the workspace. Lists Batch inference deployments in the workspace. @@ -81,16 +106,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.BatchDeploymentTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -100,13 +132,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -124,7 +156,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("BatchDeploymentTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "BatchDeploymentTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -134,24 +169,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -161,15 +200,18 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements deployment_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -177,34 +219,45 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -239,14 +292,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -254,29 +312,33 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def get( @@ -304,15 +366,20 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.BatchDeployment :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -320,32 +387,37 @@ async def get( endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize("BatchDeployment", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore async def _update_initial( self, @@ -356,16 +428,27 @@ async def _update_initial( body: "_models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties", **kwargs: Any ) -> Optional["_models.BatchDeployment"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchDeployment"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.BatchDeployment"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties') + error_map.update(kwargs.pop("error_map", {})) + + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + + _json = self._serialize.body( + body, + "PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties", + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -376,40 +459,53 @@ async def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -450,15 +546,24 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -468,32 +573,38 @@ async def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore async def _create_or_update_initial( self, @@ -504,16 +615,24 @@ async def _create_or_update_initial( body: "_models.BatchDeployment", **kwargs: Any ) -> "_models.BatchDeployment": - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'BatchDeployment') + _json = self._serialize.body(body, "BatchDeployment") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -524,39 +643,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchDeployment', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -596,15 +729,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -614,29 +756,35 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_batch_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_batch_endpoints_operations.py index 8e810758ed64..e2b1fac1872c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_batch_endpoints_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_batch_endpoints_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,23 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._batch_endpoints_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_keys_request, build_list_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._batch_endpoints_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_keys_request, + build_list_request, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class BatchEndpointsOperations: """BatchEndpointsOperations async operations. @@ -55,7 +79,9 @@ def list( count: Optional[int] = None, skip: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.BatchEndpointTrackedResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.BatchEndpointTrackedResourceArmPaginatedResult" + ]: """Lists Batch inference endpoint in the workspace. Lists Batch inference endpoint in the workspace. @@ -75,16 +101,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.BatchEndpointTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -92,13 +125,13 @@ def prepare_request(next_link=None): api_version=api_version, count=count, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -114,7 +147,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("BatchEndpointTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "BatchEndpointTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -124,24 +160,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -150,49 +190,63 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements endpoint_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -224,43 +278,52 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def get( @@ -285,47 +348,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.BatchEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize("BatchEndpoint", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore async def _update_initial( self, @@ -335,16 +406,26 @@ async def _update_initial( body: "_models.PartialMinimalTrackedResourceWithIdentity", **kwargs: Any ) -> Optional["_models.BatchEndpoint"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchEndpoint"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.BatchEndpoint"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') + _json = self._serialize.body( + body, "PartialMinimalTrackedResourceWithIdentity" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -354,40 +435,53 @@ async def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -425,15 +519,22 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -442,32 +543,38 @@ async def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore async def _create_or_update_initial( self, @@ -477,16 +584,22 @@ async def _create_or_update_initial( body: "_models.BatchEndpoint", **kwargs: Any ) -> "_models.BatchEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'BatchEndpoint') + _json = self._serialize.body(body, "BatchEndpoint") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -496,39 +609,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -565,15 +692,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -582,32 +716,38 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def list_keys( @@ -632,44 +772,54 @@ async def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthKeys"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) + deserialized = self._deserialize("EndpointAuthKeys", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys"} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_code_containers_operations.py index a78ac69c15c1..5f36d8d97807 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_code_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_code_containers_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._code_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._code_containers_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class CodeContainersOperations: """CodeContainersOperations async operations. @@ -70,29 +88,36 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -107,7 +132,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -117,24 +144,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -159,43 +190,51 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore @distributed_trace_async async def get( @@ -220,47 +259,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize("CodeContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -288,16 +335,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeContainer') + _json = self._serialize.body(body, "CodeContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -307,33 +360,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_code_versions_operations.py index 5d60e3f9da58..a3f96f241b03 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_code_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_code_versions_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._code_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._code_versions_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class CodeVersionsOperations: """CodeVersionsOperations async operations. @@ -79,16 +97,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -98,13 +123,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -122,7 +147,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -132,24 +159,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -177,15 +208,18 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -193,28 +227,33 @@ async def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -242,15 +281,18 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -258,32 +300,37 @@ async def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -314,16 +361,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeVersion') + _json = self._serialize.body(body, "CodeVersion") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -334,33 +387,38 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_component_containers_operations.py index 61b05c620aa0..ea74a66b505e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_component_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_component_containers_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._component_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._component_containers_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ComponentContainersOperations: """ComponentContainersOperations async operations. @@ -73,16 +91,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -90,13 +115,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -112,7 +137,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -122,24 +150,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -164,43 +196,51 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore @distributed_trace_async async def get( @@ -225,47 +265,59 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -293,16 +345,24 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentContainer') + _json = self._serialize.body(body, "ComponentContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -312,33 +372,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_component_versions_operations.py index 7ae93db2ed41..7fcd70c61357 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_component_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_component_versions_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._component_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._component_versions_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ComponentVersionsOperations: """ComponentVersionsOperations async operations. @@ -82,16 +100,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -102,13 +127,13 @@ def prepare_request(next_link=None): top=top, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -127,7 +152,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -137,24 +164,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -182,15 +213,18 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -198,28 +232,33 @@ async def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -247,15 +286,20 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -263,32 +307,37 @@ async def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize("ComponentVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -319,16 +368,24 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentVersion') + _json = self._serialize.body(body, "ComponentVersion") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -339,33 +396,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_compute_operations.py index a92d0de3be14..bb3ad69cfa9e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_compute_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_compute_operations.py @@ -6,13 +6,32 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, List, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + List, + Optional, + TypeVar, + Union, +) from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +40,29 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._compute_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_keys_request, build_list_nodes_request, build_list_request, build_restart_request_initial, build_start_request_initial, build_stop_request_initial, build_update_custom_services_request, build_update_idle_shutdown_setting_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._compute_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_keys_request, + build_list_nodes_request, + build_list_request, + build_restart_request_initial, + build_start_request_initial, + build_stop_request_initial, + build_update_custom_services_request, + build_update_idle_shutdown_setting_request, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ComputeOperations: """ComputeOperations async operations. @@ -70,29 +109,36 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedComputeResourcesList] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedComputeResourcesList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedComputeResourcesList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -107,7 +153,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedComputeResourcesList", pipeline_response) + deserialized = self._deserialize( + "PaginatedComputeResourcesList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -117,24 +165,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes"} # type: ignore @distributed_trace_async async def get( @@ -158,47 +210,57 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComputeResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize("ComputeResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore async def _create_or_update_initial( self, @@ -208,16 +270,24 @@ async def _create_or_update_initial( parameters: "_models.ComputeResource", **kwargs: Any ) -> "_models.ComputeResource": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'ComputeResource') + _json = self._serialize.body(parameters, "ComputeResource") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -227,38 +297,47 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if response.status_code == 201: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComputeResource', pipeline_response) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -295,15 +374,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -312,32 +400,38 @@ async def begin_create_or_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore async def _update_initial( self, @@ -347,16 +441,24 @@ async def _update_initial( parameters: "_models.ClusterUpdateParameters", **kwargs: Any ) -> "_models.ComputeResource": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'ClusterUpdateParameters') + _json = self._serialize.body(parameters, "ClusterUpdateParameters") request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -366,31 +468,34 @@ async def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize("ComputeResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -426,15 +531,24 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -443,50 +557,61 @@ async def begin_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, compute_name: str, - underlying_resource_action: Union[str, "_models.UnderlyingResourceAction"], + underlying_resource_action: Union[ + str, "_models.UnderlyingResourceAction" + ], **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -494,33 +619,39 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements compute_name=compute_name, api_version=api_version, underlying_resource_action=underlying_resource_action, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -528,7 +659,9 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements resource_group_name: str, workspace_name: str, compute_name: str, - underlying_resource_action: Union[str, "_models.UnderlyingResourceAction"], + underlying_resource_action: Union[ + str, "_models.UnderlyingResourceAction" + ], **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes specified Machine Learning compute. @@ -555,14 +688,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -570,29 +708,33 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements compute_name=compute_name, underlying_resource_action=underlying_resource_action, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace_async async def update_custom_services( # pylint: disable=inconsistent-return-statements @@ -618,16 +760,22 @@ async def update_custom_services( # pylint: disable=inconsistent-return-stateme :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(custom_services, '[CustomService]') + _json = self._serialize.body(custom_services, "[CustomService]") request = build_update_custom_services_request( subscription_id=self._config.subscription_id, @@ -637,28 +785,33 @@ async def update_custom_services( # pylint: disable=inconsistent-return-stateme api_version=api_version, content_type=content_type, json=_json, - template_url=self.update_custom_services.metadata['url'], + template_url=self.update_custom_services.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - update_custom_services.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/customServices"} # type: ignore - + update_custom_services.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/customServices"} # type: ignore @distributed_trace def list_nodes( @@ -683,29 +836,36 @@ def list_nodes( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.AmlComputeNodesInformation] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlComputeNodesInformation"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.AmlComputeNodesInformation"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_nodes_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self.list_nodes.metadata['url'], + template_url=self.list_nodes.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_nodes_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -720,7 +880,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("AmlComputeNodesInformation", pipeline_response) + deserialized = self._deserialize( + "AmlComputeNodesInformation", pipeline_response + ) list_of_elem = deserialized.nodes if cls: list_of_elem = cls(list_of_elem) @@ -730,24 +892,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_nodes.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes"} # type: ignore + list_nodes.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes"} # type: ignore @distributed_trace_async async def list_keys( @@ -770,47 +936,57 @@ async def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ComputeSecrets :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeSecrets"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeSecrets"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComputeSecrets', pipeline_response) + deserialized = self._deserialize("ComputeSecrets", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys"} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys"} # type: ignore async def _start_initial( # pylint: disable=inconsistent-return-statements self, @@ -819,42 +995,48 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements compute_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_start_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self._start_initial.metadata['url'], + template_url=self._start_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _start_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore - + _start_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore @distributed_trace_async async def begin_start( # pylint: disable=inconsistent-return-statements @@ -884,43 +1066,52 @@ async def begin_start( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._start_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_start.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore + begin_start.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore async def _stop_initial( # pylint: disable=inconsistent-return-statements self, @@ -929,42 +1120,48 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements compute_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_stop_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self._stop_initial.metadata['url'], + template_url=self._stop_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _stop_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore - + _stop_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore @distributed_trace_async async def begin_stop( # pylint: disable=inconsistent-return-statements @@ -994,43 +1191,52 @@ async def begin_stop( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._stop_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_stop.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore + begin_stop.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore async def _restart_initial( # pylint: disable=inconsistent-return-statements self, @@ -1039,42 +1245,48 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements compute_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_restart_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self._restart_initial.metadata['url'], + template_url=self._restart_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _restart_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore - + _restart_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore @distributed_trace_async async def begin_restart( # pylint: disable=inconsistent-return-statements @@ -1104,43 +1316,52 @@ async def begin_restart( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._restart_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_restart.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore + begin_restart.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore @distributed_trace_async async def update_idle_shutdown_setting( # pylint: disable=inconsistent-return-statements @@ -1166,16 +1387,22 @@ async def update_idle_shutdown_setting( # pylint: disable=inconsistent-return-s :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'IdleShutdownSetting') + _json = self._serialize.body(parameters, "IdleShutdownSetting") request = build_update_idle_shutdown_setting_request( subscription_id=self._config.subscription_id, @@ -1185,25 +1412,30 @@ async def update_idle_shutdown_setting( # pylint: disable=inconsistent-return-s api_version=api_version, content_type=content_type, json=_json, - template_url=self.update_idle_shutdown_setting.metadata['url'], + template_url=self.update_idle_shutdown_setting.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - update_idle_shutdown_setting.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateIdleShutdownSetting"} # type: ignore - + update_idle_shutdown_setting.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateIdleShutdownSetting"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_data_containers_operations.py index 8ce2b9d5aec5..e638b8ca7994 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_data_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_data_containers_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._data_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._data_containers_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class DataContainersOperations: """DataContainersOperations async operations. @@ -73,16 +91,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -90,13 +115,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -112,7 +137,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -122,24 +149,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -164,43 +195,51 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore @distributed_trace_async async def get( @@ -225,47 +264,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize("DataContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -293,16 +340,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DataContainer') + _json = self._serialize.body(body, "DataContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -312,33 +365,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_data_versions_operations.py index e2bc7349b260..996f6f8e4e62 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_data_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_data_versions_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._data_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._data_versions_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class DataVersionsOperations: """DataVersionsOperations async operations. @@ -89,16 +107,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -110,13 +135,13 @@ def prepare_request(next_link=None): skip=skip, tags=tags, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -136,7 +161,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataVersionBaseResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -146,24 +173,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -191,15 +222,18 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -207,28 +241,33 @@ async def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -256,15 +295,20 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -272,32 +316,37 @@ async def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize("DataVersionBase", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -328,16 +377,24 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DataVersionBase') + _json = self._serialize.body(body, "DataVersionBase") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -348,33 +405,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_datastores_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_datastores_operations.py index b748d6debcd9..f93db05ae037 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_datastores_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_datastores_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, List, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,22 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._datastores_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request, build_list_secrets_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._datastores_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, + build_list_secrets_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class DatastoresOperations: """DatastoresOperations async operations. @@ -88,16 +107,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DatastoreResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -110,13 +136,13 @@ def prepare_request(next_link=None): search_text=search_text, order_by=order_by, order_by_asc=order_by_asc, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -137,7 +163,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("DatastoreResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DatastoreResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -147,24 +175,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -189,43 +221,51 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace_async async def get( @@ -250,47 +290,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.Datastore :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Datastore"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Datastore"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Datastore', pipeline_response) + deserialized = self._deserialize("Datastore", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -321,16 +369,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.Datastore :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Datastore"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Datastore"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'Datastore') + _json = self._serialize.body(body, "Datastore") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -341,36 +395,41 @@ async def create_or_update( content_type=content_type, json=_json, skip_validation=skip_validation, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('Datastore', pipeline_response) + deserialized = self._deserialize("Datastore", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('Datastore', pipeline_response) + deserialized = self._deserialize("Datastore", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace_async async def list_secrets( @@ -395,44 +454,54 @@ async def list_secrets( :rtype: ~azure.mgmt.machinelearningservices.models.DatastoreSecrets :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreSecrets"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DatastoreSecrets"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_list_secrets_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.list_secrets.metadata['url'], + template_url=self.list_secrets.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DatastoreSecrets', pipeline_response) + deserialized = self._deserialize("DatastoreSecrets", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_secrets.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets"} # type: ignore - + list_secrets.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_environment_containers_operations.py index fb8217f2a410..317e37198150 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_environment_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_environment_containers_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._environment_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._environment_containers_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class EnvironmentContainersOperations: """EnvironmentContainersOperations async operations. @@ -53,7 +71,9 @@ def list( skip: Optional[str] = None, list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, **kwargs: Any - ) -> AsyncIterable["_models.EnvironmentContainerResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.EnvironmentContainerResourceArmPaginatedResult" + ]: """List environment containers. List environment containers. @@ -73,16 +93,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -90,13 +117,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -112,7 +139,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -122,24 +152,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -164,43 +198,51 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore @distributed_trace_async async def get( @@ -225,47 +267,59 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -293,16 +347,24 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentContainer') + _json = self._serialize.body(body, "EnvironmentContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -312,33 +374,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_environment_versions_operations.py index 44ddf210bdcc..8fce28d92329 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_environment_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_environment_versions_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._environment_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._environment_versions_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class EnvironmentVersionsOperations: """EnvironmentVersionsOperations async operations. @@ -82,16 +100,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -102,13 +127,13 @@ def prepare_request(next_link=None): top=top, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -127,7 +152,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersionResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -137,24 +165,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -182,15 +214,18 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -198,28 +233,33 @@ async def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -247,15 +287,20 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -263,32 +308,39 @@ async def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -319,16 +371,24 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentVersion') + _json = self._serialize.body(body, "EnvironmentVersion") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -339,33 +399,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_jobs_operations.py index 8b9d9a5d1dc9..0ac9bd8bace4 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_jobs_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_jobs_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,22 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._jobs_operations import build_cancel_request_initial, build_create_or_update_request, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._jobs_operations import ( + build_cancel_request_initial, + build_create_or_update_request, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class JobsOperations: """JobsOperations async operations. @@ -87,16 +110,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.JobBaseResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -108,13 +138,13 @@ def prepare_request(next_link=None): list_view_type=list_view_type, scheduled=scheduled, schedule_id=schedule_id, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -134,7 +164,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("JobBaseResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "JobBaseResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -144,24 +176,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -170,49 +206,63 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements id: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -244,43 +294,52 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace_async async def get( @@ -305,47 +364,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.JobBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.JobBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('JobBase', pipeline_response) + deserialized = self._deserialize("JobBase", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -373,16 +440,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.JobBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.JobBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'JobBase') + _json = self._serialize.body(body, "JobBase") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -392,36 +465,41 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('JobBase', pipeline_response) + deserialized = self._deserialize("JobBase", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('JobBase', pipeline_response) + deserialized = self._deserialize("JobBase", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore async def _cancel_initial( # pylint: disable=inconsistent-return-statements self, @@ -430,48 +508,57 @@ async def _cancel_initial( # pylint: disable=inconsistent-return-statements id: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_cancel_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self._cancel_initial.metadata['url'], + template_url=self._cancel_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _cancel_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore - + _cancel_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore @distributed_trace_async async def begin_cancel( # pylint: disable=inconsistent-return-statements @@ -503,40 +590,53 @@ async def begin_cancel( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._cancel_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_cancel.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore + begin_cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_labeling_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_labeling_jobs_operations.py index 0f09de842342..0c7be985180f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_labeling_jobs_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_labeling_jobs_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,24 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._labeling_jobs_operations import build_create_or_update_request_initial, build_delete_request, build_export_labels_request_initial, build_get_request, build_list_request, build_pause_request, build_resume_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._labeling_jobs_operations import ( + build_create_or_update_request_initial, + build_delete_request, + build_export_labels_request_initial, + build_get_request, + build_list_request, + build_pause_request, + build_resume_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class LabelingJobsOperations: """LabelingJobsOperations async operations. @@ -75,16 +100,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.LabelingJobResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJobResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.LabelingJobResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -92,13 +124,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, top=top, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -114,7 +146,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("LabelingJobResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "LabelingJobResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -124,24 +158,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -166,43 +204,51 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore @distributed_trace_async async def get( @@ -235,15 +281,18 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.LabelingJob :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.LabelingJob"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -252,32 +301,37 @@ async def get( api_version=api_version, include_job_instructions=include_job_instructions, include_label_categories=include_label_categories, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('LabelingJob', pipeline_response) + deserialized = self._deserialize("LabelingJob", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore async def _create_or_update_initial( self, @@ -287,16 +341,22 @@ async def _create_or_update_initial( body: "_models.LabelingJob", **kwargs: Any ) -> "_models.LabelingJob": - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.LabelingJob"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'LabelingJob') + _json = self._serialize.body(body, "LabelingJob") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -306,39 +366,49 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('LabelingJob', pipeline_response) + deserialized = self._deserialize("LabelingJob", pipeline_response) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('LabelingJob', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("LabelingJob", pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -375,15 +445,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.LabelingJob] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.LabelingJob"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -392,32 +469,36 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('LabelingJob', pipeline_response) + deserialized = self._deserialize("LabelingJob", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore async def _export_labels_initial( self, @@ -427,16 +508,24 @@ async def _export_labels_initial( body: "_models.ExportSummary", **kwargs: Any ) -> Optional["_models.ExportSummary"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExportSummary"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.ExportSummary"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ExportSummary') + _json = self._serialize.body(body, "ExportSummary") request = build_export_labels_request_initial( subscription_id=self._config.subscription_id, @@ -446,39 +535,47 @@ async def _export_labels_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._export_labels_initial.metadata['url'], + template_url=self._export_labels_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ExportSummary', pipeline_response) + deserialized = self._deserialize( + "ExportSummary", pipeline_response + ) if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _export_labels_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore - + _export_labels_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore @distributed_trace_async async def begin_export_labels( @@ -515,15 +612,22 @@ async def begin_export_labels( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ExportSummary] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExportSummary"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ExportSummary"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._export_labels_initial( resource_group_name=resource_group_name, @@ -532,32 +636,42 @@ async def begin_export_labels( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ExportSummary', pipeline_response) + deserialized = self._deserialize( + "ExportSummary", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_export_labels.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore + begin_export_labels.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore @distributed_trace_async async def pause( # pylint: disable=inconsistent-return-statements @@ -582,43 +696,51 @@ async def pause( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_pause_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self.pause.metadata['url'], + template_url=self.pause.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - pause.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause"} # type: ignore - + pause.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause"} # type: ignore async def _resume_initial( # pylint: disable=inconsistent-return-statements self, @@ -627,48 +749,57 @@ async def _resume_initial( # pylint: disable=inconsistent-return-statements id: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_resume_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self._resume_initial.metadata['url'], + template_url=self._resume_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _resume_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore - + _resume_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore @distributed_trace_async async def begin_resume( # pylint: disable=inconsistent-return-statements @@ -700,40 +831,53 @@ async def begin_resume( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._resume_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_resume.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore + begin_resume.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_managed_network_provisions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_managed_network_provisions_operations.py index f9483b70e6ea..3c827a92f126 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_managed_network_provisions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_managed_network_provisions_operations.py @@ -8,10 +8,20 @@ # -------------------------------------------------------------------------- from typing import Any, Callable, Dict, Optional, TypeVar, Union -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat @@ -19,9 +29,18 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._managed_network_provisions_operations import build_provision_managed_network_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._managed_network_provisions_operations import ( + build_provision_managed_network_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ManagedNetworkProvisionsOperations: """ManagedNetworkProvisionsOperations async operations. @@ -52,17 +71,27 @@ async def _provision_managed_network_initial( parameters: Optional["_models.ManagedNetworkProvisionOptions"] = None, **kwargs: Any ) -> Optional["_models.ManagedNetworkProvisionStatus"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ManagedNetworkProvisionStatus"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.ManagedNetworkProvisionStatus"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if parameters is not None: - _json = self._serialize.body(parameters, 'ManagedNetworkProvisionOptions') + _json = self._serialize.body( + parameters, "ManagedNetworkProvisionOptions" + ) else: _json = None @@ -73,38 +102,46 @@ async def _provision_managed_network_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._provision_managed_network_initial.metadata['url'], + template_url=self._provision_managed_network_initial.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ManagedNetworkProvisionStatus', pipeline_response) + deserialized = self._deserialize( + "ManagedNetworkProvisionStatus", pipeline_response + ) if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _provision_managed_network_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork"} # type: ignore - + _provision_managed_network_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork"} # type: ignore @distributed_trace_async async def begin_provision_managed_network( @@ -136,15 +173,24 @@ async def begin_provision_managed_network( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionStatus] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedNetworkProvisionStatus"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ManagedNetworkProvisionStatus"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._provision_managed_network_initial( resource_group_name=resource_group_name, @@ -152,29 +198,39 @@ async def begin_provision_managed_network( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ManagedNetworkProvisionStatus', pipeline_response) + deserialized = self._deserialize( + "ManagedNetworkProvisionStatus", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_provision_managed_network.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork"} # type: ignore + begin_provision_managed_network.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_managed_network_settings_rule_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_managed_network_settings_rule_operations.py index fb594b8defc3..bbee33fbd45f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_managed_network_settings_rule_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_managed_network_settings_rule_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._managed_network_settings_rule_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._managed_network_settings_rule_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ManagedNetworkSettingsRuleOperations: """ManagedNetworkSettingsRuleOperations async operations. @@ -49,10 +71,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> AsyncIterable["_models.OutboundRuleListResult"]: """Lists the managed network outbound rules for a machine learning workspace. @@ -67,28 +86,35 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OutboundRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OutboundRuleListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -102,7 +128,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("OutboundRuleListResult", pipeline_response) + deserialized = self._deserialize( + "OutboundRuleListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -112,24 +140,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -138,47 +170,54 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements rule_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, rule_name=rule_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -208,43 +247,56 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, rule_name=rule_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore @distributed_trace_async async def get( @@ -267,47 +319,59 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleBasicResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OutboundRuleBasicResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, rule_name=rule_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) + deserialized = self._deserialize( + "OutboundRuleBasicResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore async def _create_or_update_initial( self, @@ -317,16 +381,24 @@ async def _create_or_update_initial( parameters: "_models.OutboundRuleBasicResource", **kwargs: Any ) -> Optional["_models.OutboundRuleBasicResource"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OutboundRuleBasicResource"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.OutboundRuleBasicResource"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'OutboundRuleBasicResource') + _json = self._serialize.body(parameters, "OutboundRuleBasicResource") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -336,38 +408,44 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) + deserialized = self._deserialize( + "OutboundRuleBasicResource", pipeline_response + ) if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -403,15 +481,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleBasicResource"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OutboundRuleBasicResource"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -420,29 +507,39 @@ async def begin_create_or_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) + deserialized = self._deserialize( + "OutboundRuleBasicResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_model_containers_operations.py index d4c1e0cb17e2..443b60a2b8f2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_model_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_model_containers_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._model_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._model_containers_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ModelContainersOperations: """ModelContainersOperations async operations. @@ -76,16 +94,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -94,13 +119,13 @@ def prepare_request(next_link=None): skip=skip, count=count, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -117,7 +142,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -127,24 +154,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -169,43 +200,51 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore @distributed_trace_async async def get( @@ -230,47 +269,57 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize("ModelContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -298,16 +347,24 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelContainer') + _json = self._serialize.body(body, "ModelContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -317,33 +374,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_model_versions_operations.py index 4a7898244189..c752c205e853 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_model_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_model_versions_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._model_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._model_versions_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ModelVersionsOperations: """ModelVersionsOperations async operations. @@ -102,16 +120,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -128,13 +153,13 @@ def prepare_request(next_link=None): properties=properties, feed=feed, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -159,7 +184,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -169,24 +196,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -214,15 +245,18 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -230,28 +264,33 @@ async def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -279,15 +318,18 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -295,32 +337,37 @@ async def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -351,16 +398,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelVersion') + _json = self._serialize.body(body, "ModelVersion") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -371,33 +424,38 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_online_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_online_deployments_operations.py index 5d0ca6856f39..1f7b22844b91 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_online_deployments_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_online_deployments_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,24 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._online_deployments_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_logs_request, build_get_request, build_list_request, build_list_skus_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._online_deployments_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_logs_request, + build_get_request, + build_list_request, + build_list_skus_request, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class OnlineDeploymentsOperations: """OnlineDeploymentsOperations async operations. @@ -57,7 +82,9 @@ def list( top: Optional[int] = None, skip: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.OnlineDeploymentTrackedResourceArmPaginatedResult" + ]: """List Inference Endpoint Deployments. List Inference Endpoint Deployments. @@ -81,16 +108,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OnlineDeploymentTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -100,13 +134,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -124,7 +158,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineDeploymentTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "OnlineDeploymentTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -134,24 +171,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -161,15 +202,18 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements deployment_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -177,34 +221,45 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -239,14 +294,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -254,29 +314,33 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def get( @@ -304,15 +368,20 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.OnlineDeployment :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -320,32 +389,37 @@ async def get( endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize("OnlineDeployment", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore async def _update_initial( self, @@ -356,16 +430,26 @@ async def _update_initial( body: "_models.PartialMinimalTrackedResourceWithSku", **kwargs: Any ) -> Optional["_models.OnlineDeployment"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineDeployment"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.OnlineDeployment"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSku') + _json = self._serialize.body( + body, "PartialMinimalTrackedResourceWithSku" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -376,40 +460,53 @@ async def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -449,15 +546,24 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -467,32 +573,38 @@ async def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore async def _create_or_update_initial( self, @@ -503,16 +615,24 @@ async def _create_or_update_initial( body: "_models.OnlineDeployment", **kwargs: Any ) -> "_models.OnlineDeployment": - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'OnlineDeployment') + _json = self._serialize.body(body, "OnlineDeployment") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -523,39 +643,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -595,15 +729,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -613,32 +756,38 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def get_logs( @@ -669,16 +818,24 @@ async def get_logs( :rtype: ~azure.mgmt.machinelearningservices.models.DeploymentLogs :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentLogs"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DeploymentLogs"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DeploymentLogsRequest') + _json = self._serialize.body(body, "DeploymentLogsRequest") request = build_get_logs_request( subscription_id=self._config.subscription_id, @@ -689,32 +846,37 @@ async def get_logs( api_version=api_version, content_type=content_type, json=_json, - template_url=self.get_logs.metadata['url'], + template_url=self.get_logs.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DeploymentLogs', pipeline_response) + deserialized = self._deserialize("DeploymentLogs", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_logs.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs"} # type: ignore - + get_logs.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs"} # type: ignore @distributed_trace def list_skus( @@ -750,16 +912,23 @@ def list_skus( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.SkuResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.SkuResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_skus_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -769,13 +938,13 @@ def prepare_request(next_link=None): api_version=api_version, count=count, skip=skip, - template_url=self.list_skus.metadata['url'], + template_url=self.list_skus.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_skus_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -793,7 +962,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("SkuResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "SkuResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -803,21 +974,25 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_skus.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus"} # type: ignore + list_skus.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_online_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_online_endpoints_operations.py index f76ab2fc118a..2362737c826c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_online_endpoints_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_online_endpoints_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,25 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._online_endpoints_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_get_token_request, build_list_keys_request, build_list_request, build_regenerate_keys_request_initial, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._online_endpoints_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_get_token_request, + build_list_keys_request, + build_list_request, + build_regenerate_keys_request_initial, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class OnlineEndpointsOperations: """OnlineEndpointsOperations async operations. @@ -54,13 +80,17 @@ def list( workspace_name: str, name: Optional[str] = None, count: Optional[int] = None, - compute_type: Optional[Union[str, "_models.EndpointComputeType"]] = None, + compute_type: Optional[ + Union[str, "_models.EndpointComputeType"] + ] = None, skip: Optional[str] = None, tags: Optional[str] = None, properties: Optional[str] = None, order_by: Optional[Union[str, "_models.OrderString"]] = None, **kwargs: Any - ) -> AsyncIterable["_models.OnlineEndpointTrackedResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.OnlineEndpointTrackedResourceArmPaginatedResult" + ]: """List Online Endpoints. List Online Endpoints. @@ -93,16 +123,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OnlineEndpointTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -115,13 +152,13 @@ def prepare_request(next_link=None): tags=tags, properties=properties, order_by=order_by, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -142,7 +179,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineEndpointTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "OnlineEndpointTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -152,24 +192,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -178,49 +222,63 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements endpoint_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -252,43 +310,52 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def get( @@ -313,47 +380,57 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.OnlineEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize("OnlineEndpoint", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore async def _update_initial( self, @@ -363,16 +440,26 @@ async def _update_initial( body: "_models.PartialMinimalTrackedResourceWithIdentity", **kwargs: Any ) -> Optional["_models.OnlineEndpoint"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineEndpoint"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.OnlineEndpoint"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') + _json = self._serialize.body( + body, "PartialMinimalTrackedResourceWithIdentity" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -382,40 +469,53 @@ async def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -453,15 +553,24 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -470,32 +579,38 @@ async def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore async def _create_or_update_initial( self, @@ -505,16 +620,24 @@ async def _create_or_update_initial( body: "_models.OnlineEndpoint", **kwargs: Any ) -> "_models.OnlineEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'OnlineEndpoint') + _json = self._serialize.body(body, "OnlineEndpoint") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -524,39 +647,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -593,15 +730,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -610,32 +756,38 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def list_keys( @@ -660,47 +812,57 @@ async def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthKeys"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) + deserialized = self._deserialize("EndpointAuthKeys", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys"} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys"} # type: ignore async def _regenerate_keys_initial( # pylint: disable=inconsistent-return-statements self, @@ -710,16 +872,22 @@ async def _regenerate_keys_initial( # pylint: disable=inconsistent-return-state body: "_models.RegenerateEndpointKeysRequest", **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'RegenerateEndpointKeysRequest') + _json = self._serialize.body(body, "RegenerateEndpointKeysRequest") request = build_regenerate_keys_request_initial( subscription_id=self._config.subscription_id, @@ -729,33 +897,39 @@ async def _regenerate_keys_initial( # pylint: disable=inconsistent-return-state api_version=api_version, content_type=content_type, json=_json, - template_url=self._regenerate_keys_initial.metadata['url'], + template_url=self._regenerate_keys_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _regenerate_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore - + _regenerate_keys_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore @distributed_trace_async async def begin_regenerate_keys( # pylint: disable=inconsistent-return-statements @@ -790,15 +964,22 @@ async def begin_regenerate_keys( # pylint: disable=inconsistent-return-statemen :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._regenerate_keys_initial( resource_group_name=resource_group_name, @@ -807,29 +988,37 @@ async def begin_regenerate_keys( # pylint: disable=inconsistent-return-statemen body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_regenerate_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore + begin_regenerate_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore @distributed_trace_async async def get_token( @@ -854,44 +1043,56 @@ async def get_token( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthToken :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthToken"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthToken"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_token_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.get_token.metadata['url'], + template_url=self.get_token.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EndpointAuthToken', pipeline_response) + deserialized = self._deserialize( + "EndpointAuthToken", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token"} # type: ignore - + get_token.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_operations.py index e7b501d80ebf..8fdc8ccd2a72 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,8 +25,15 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class Operations: """Operations async operations. @@ -46,8 +59,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list( - self, - **kwargs: Any + self, **kwargs: Any ) -> AsyncIterable["_models.AmlOperationListResult"]: """Lists all of the available Azure Machine Learning Services REST API operations. @@ -58,25 +70,32 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.AmlOperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlOperationListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.AmlOperationListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( api_version=api_version, template_url=next_link, @@ -87,7 +106,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("AmlOperationListResult", pipeline_response) + deserialized = self._deserialize( + "AmlOperationListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -97,21 +118,25 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/providers/Microsoft.MachineLearningServices/operations"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.MachineLearningServices/operations"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_private_endpoint_connections_operations.py index 140eb346b298..d02a531374a9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_private_endpoint_connections_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._private_endpoint_connections_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._private_endpoint_connections_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class PrivateEndpointConnectionsOperations: """PrivateEndpointConnectionsOperations async operations. @@ -47,10 +65,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> AsyncIterable["_models.PrivateEndpointConnectionListResult"]: """List all the private endpoint connections associated with the workspace. @@ -65,28 +80,35 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnectionListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( resource_group_name=resource_group_name, workspace_name=workspace_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( resource_group_name=resource_group_name, workspace_name=workspace_name, @@ -100,7 +122,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) + deserialized = self._deserialize( + "PrivateEndpointConnectionListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -110,24 +134,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections"} # type: ignore @distributed_trace_async async def get( @@ -151,47 +179,59 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, private_endpoint_connection_name=private_endpoint_connection_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + deserialized = self._deserialize( + "PrivateEndpointConnection", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -218,16 +258,24 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(properties, 'PrivateEndpointConnection') + _json = self._serialize.body(properties, "PrivateEndpointConnection") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -237,32 +285,39 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + deserialized = self._deserialize( + "PrivateEndpointConnection", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -286,40 +341,48 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, private_endpoint_connection_name=private_endpoint_connection_name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_private_link_resources_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_private_link_resources_operations.py index e9aa33d0ab82..c3035df846aa 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_private_link_resources_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_private_link_resources_operations.py @@ -8,7 +8,13 @@ # -------------------------------------------------------------------------- from typing import Any, Callable, Dict, Optional, TypeVar -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -18,8 +24,15 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class PrivateLinkResourcesOperations: """PrivateLinkResourcesOperations async operations. @@ -45,10 +58,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace_async async def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.PrivateLinkResourceListResult": """Gets the private link resources that need to be created for a workspace. @@ -61,43 +71,55 @@ async def list( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateLinkResourceListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateLinkResourceListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateLinkResourceListResult', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "PrivateLinkResourceListResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources"} # type: ignore - + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_quotas_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_quotas_operations.py index 7811773f8070..e0cb78d4674b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_quotas_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_quotas_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,19 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._quotas_operations import build_list_request, build_update_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._quotas_operations import ( + build_list_request, + build_update_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class QuotasOperations: """QuotasOperations async operations. @@ -63,16 +79,24 @@ async def update( :rtype: ~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotasResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'QuotaUpdateParameters') + _json = self._serialize.body(parameters, "QuotaUpdateParameters") request = build_update_request( location=location, @@ -80,38 +104,43 @@ async def update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.update.metadata['url'], + template_url=self.update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('UpdateWorkspaceQuotasResult', pipeline_response) + deserialized = self._deserialize( + "UpdateWorkspaceQuotasResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas"} # type: ignore - + update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas"} # type: ignore @distributed_trace def list( - self, - location: str, - **kwargs: Any + self, location: str, **kwargs: Any ) -> AsyncIterable["_models.ListWorkspaceQuotas"]: """Gets the currently assigned Workspace Quotas based on VMFamily. @@ -123,27 +152,34 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListWorkspaceQuotas] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceQuotas"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListWorkspaceQuotas"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, @@ -156,7 +192,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ListWorkspaceQuotas", pipeline_response) + deserialized = self._deserialize( + "ListWorkspaceQuotas", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -166,21 +204,25 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registries_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registries_operations.py index 62e971e40497..3c6e1a6763d2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registries_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registries_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,23 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registries_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_subscription_request, build_list_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registries_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_by_subscription_request, + build_list_request, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistriesOperations: """RegistriesOperations async operations. @@ -49,9 +73,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list_by_subscription( - self, - skip: Optional[str] = None, - **kwargs: Any + self, skip: Optional[str] = None, **kwargs: Any ) -> AsyncIterable["_models.RegistryTrackedResourceArmPaginatedResult"]: """List registries by subscription. @@ -66,27 +88,34 @@ def list_by_subscription( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.RegistryTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, skip=skip, - template_url=self.list_by_subscription.metadata['url'], + template_url=self.list_by_subscription.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, @@ -99,7 +128,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("RegistryTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "RegistryTrackedResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -109,24 +140,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore + list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore @distributed_trace def list( @@ -150,28 +185,35 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.RegistryTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, api_version=api_version, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -185,7 +227,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("RegistryTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "RegistryTrackedResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -195,80 +239,92 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - **kwargs: Any + self, resource_group_name: str, registry_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - **kwargs: Any + self, resource_group_name: str, registry_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: """Delete registry. @@ -290,49 +346,59 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace_async async def get( - self, - resource_group_name: str, - registry_name: str, - **kwargs: Any + self, resource_group_name: str, registry_name: str, **kwargs: Any ) -> "_models.Registry": """Get registry. @@ -347,46 +413,54 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.Registry :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore async def _update_initial( self, @@ -395,16 +469,24 @@ async def _update_initial( body: "_models.PartialRegistryPartialTrackedResource", **kwargs: Any ) -> "_models.Registry": - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialRegistryPartialTrackedResource') + _json = self._serialize.body( + body, "PartialRegistryPartialTrackedResource" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -413,39 +495,46 @@ async def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - deserialized = self._deserialize('Registry', pipeline_response) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) + + deserialized = self._deserialize("Registry", pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -478,15 +567,22 @@ async def begin_update( :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Registry] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -494,32 +590,40 @@ async def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore async def _create_or_update_initial( self, @@ -528,16 +632,24 @@ async def _create_or_update_initial( body: "_models.Registry", **kwargs: Any ) -> Optional["_models.Registry"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Registry"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.Registry"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'Registry') + _json = self._serialize.body(body, "Registry") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -546,36 +658,39 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -608,15 +723,22 @@ async def begin_create_or_update( :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Registry] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -624,29 +746,37 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registry_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registry_code_containers_operations.py index 60757f27121e..83c37cfe7d25 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registry_code_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registry_code_containers_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_code_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_code_containers_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryCodeContainersOperations: """RegistryCodeContainersOperations async operations. @@ -72,29 +94,36 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, api_version=api_version, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -109,7 +138,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -119,24 +150,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -145,49 +180,63 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements code_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, code_name=code_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -219,43 +268,56 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, code_name=code_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore @distributed_trace_async async def get( @@ -280,47 +342,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, code_name=code_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize("CodeContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore async def _create_or_update_initial( self, @@ -330,16 +400,22 @@ async def _create_or_update_initial( body: "_models.CodeContainer", **kwargs: Any ) -> "_models.CodeContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeContainer') + _json = self._serialize.body(body, "CodeContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -349,39 +425,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('CodeContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -418,15 +508,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.CodeContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -435,29 +532,39 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registry_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registry_code_versions_operations.py index c86e581bcfe5..2a29cfbbe214 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registry_code_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registry_code_versions_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_code_versions_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_code_versions_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryCodeVersionsOperations: """RegistryCodeVersionsOperations async operations. @@ -81,16 +103,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -100,13 +129,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -124,7 +153,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -134,24 +165,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -161,15 +196,18 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements version: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -177,34 +215,45 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements code_name=code_name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -239,14 +288,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -254,29 +308,37 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements code_name=code_name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -304,15 +366,18 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -320,32 +385,37 @@ async def get( code_name=code_name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore async def _create_or_update_initial( self, @@ -356,16 +426,22 @@ async def _create_or_update_initial( body: "_models.CodeVersion", **kwargs: Any ) -> "_models.CodeVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeVersion') + _json = self._serialize.body(body, "CodeVersion") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -376,39 +452,49 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('CodeVersion', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -448,15 +534,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.CodeVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -466,29 +559,37 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registry_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registry_component_containers_operations.py index 380b70d8111d..65b50229d8e7 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registry_component_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registry_component_containers_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_component_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_component_containers_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryComponentContainersOperations: """RegistryComponentContainersOperations async operations. @@ -72,29 +94,36 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, api_version=api_version, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -109,7 +138,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -119,24 +151,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -145,49 +181,63 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements component_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, component_name=component_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -219,43 +269,56 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, component_name=component_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore @distributed_trace_async async def get( @@ -280,47 +343,59 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, component_name=component_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore async def _create_or_update_initial( self, @@ -330,16 +405,24 @@ async def _create_or_update_initial( body: "_models.ComponentContainer", **kwargs: Any ) -> "_models.ComponentContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentContainer') + _json = self._serialize.body(body, "ComponentContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -349,39 +432,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComponentContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -418,15 +515,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComponentContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -435,29 +541,39 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registry_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registry_component_versions_operations.py index 0613f1e020ad..3f0f6903b519 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registry_component_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registry_component_versions_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_component_versions_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_component_versions_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryComponentVersionsOperations: """RegistryComponentVersionsOperations async operations. @@ -81,16 +103,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -100,13 +129,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -124,7 +153,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -134,24 +165,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -161,15 +196,18 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements version: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -177,34 +215,45 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements component_name=component_name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -239,14 +288,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -254,29 +308,37 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements component_name=component_name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -304,15 +366,20 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -320,32 +387,37 @@ async def get( component_name=component_name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize("ComponentVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore async def _create_or_update_initial( self, @@ -356,16 +428,24 @@ async def _create_or_update_initial( body: "_models.ComponentVersion", **kwargs: Any ) -> "_models.ComponentVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentVersion') + _json = self._serialize.body(body, "ComponentVersion") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -376,39 +456,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComponentVersion', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -448,15 +542,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComponentVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -466,29 +569,39 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registry_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registry_environment_containers_operations.py index e49f0ac53412..0b6e3ed9936e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registry_environment_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registry_environment_containers_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_environment_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_environment_containers_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryEnvironmentContainersOperations: """RegistryEnvironmentContainersOperations async operations. @@ -55,7 +77,9 @@ def list( skip: Optional[str] = None, list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, **kwargs: Any - ) -> AsyncIterable["_models.EnvironmentContainerResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.EnvironmentContainerResourceArmPaginatedResult" + ]: """List environment containers. List environment containers. @@ -75,16 +99,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -92,13 +123,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -114,7 +145,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -124,24 +158,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -150,49 +188,63 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements environment_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, environment_name=environment_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -224,43 +276,56 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, environment_name=environment_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore @distributed_trace_async async def get( @@ -285,47 +350,59 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, environment_name=environment_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore async def _create_or_update_initial( self, @@ -335,16 +412,24 @@ async def _create_or_update_initial( body: "_models.EnvironmentContainer", **kwargs: Any ) -> "_models.EnvironmentContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentContainer') + _json = self._serialize.body(body, "EnvironmentContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -354,39 +439,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -423,15 +522,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -440,29 +548,39 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registry_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registry_environment_versions_operations.py index 2fcaf965053d..f924c9b36008 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registry_environment_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registry_environment_versions_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_environment_versions_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_environment_versions_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryEnvironmentVersionsOperations: """RegistryEnvironmentVersionsOperations async operations. @@ -84,16 +106,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -104,13 +133,13 @@ def prepare_request(next_link=None): top=top, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -129,7 +158,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersionResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -139,24 +171,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -166,15 +202,18 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements version: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -182,34 +221,45 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements environment_name=environment_name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -244,14 +294,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -259,29 +314,37 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements environment_name=environment_name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -309,15 +372,20 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -325,32 +393,39 @@ async def get( environment_name=environment_name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore async def _create_or_update_initial( self, @@ -361,16 +436,24 @@ async def _create_or_update_initial( body: "_models.EnvironmentVersion", **kwargs: Any ) -> "_models.EnvironmentVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentVersion') + _json = self._serialize.body(body, "EnvironmentVersion") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -381,39 +464,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -453,15 +550,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -471,29 +577,39 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registry_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registry_model_containers_operations.py index 55c0e5bf8ecf..7c31c0d46ee9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registry_model_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registry_model_containers_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_model_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_model_containers_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryModelContainersOperations: """RegistryModelContainersOperations async operations. @@ -75,16 +97,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -92,13 +121,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -114,7 +143,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -124,24 +155,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -150,49 +185,63 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements model_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, model_name=model_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -224,43 +273,56 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, model_name=model_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore @distributed_trace_async async def get( @@ -285,47 +347,57 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, model_name=model_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize("ModelContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore async def _create_or_update_initial( self, @@ -335,16 +407,24 @@ async def _create_or_update_initial( body: "_models.ModelContainer", **kwargs: Any ) -> "_models.ModelContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelContainer') + _json = self._serialize.body(body, "ModelContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -354,39 +434,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ModelContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -423,15 +517,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ModelContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -440,29 +543,39 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registry_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registry_model_versions_operations.py index e1cf2a4e6fb4..0fe3b18ba769 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registry_model_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_registry_model_versions_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_model_versions_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_model_versions_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryModelVersionsOperations: """RegistryModelVersionsOperations async operations. @@ -98,16 +120,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -122,13 +151,13 @@ def prepare_request(next_link=None): tags=tags, properties=properties, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -151,7 +180,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -161,24 +192,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -188,15 +223,18 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements version: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -204,34 +242,45 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements model_name=model_name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -266,14 +315,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -281,29 +335,37 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements model_name=model_name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -331,15 +393,18 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -347,32 +412,37 @@ async def get( model_name=model_name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore async def _create_or_update_initial( self, @@ -383,16 +453,22 @@ async def _create_or_update_initial( body: "_models.ModelVersion", **kwargs: Any ) -> "_models.ModelVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelVersion') + _json = self._serialize.body(body, "ModelVersion") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -403,39 +479,49 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ModelVersion', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -475,15 +561,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ModelVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -493,29 +586,37 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_schedules_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_schedules_operations.py index 8c310ccc07d6..03d0f3c9fa24 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_schedules_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_schedules_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._schedules_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._schedules_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class SchedulesOperations: """SchedulesOperations async operations. @@ -53,7 +75,9 @@ def list( resource_group_name: str, workspace_name: str, skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ScheduleListViewType"]] = None, + list_view_type: Optional[ + Union[str, "_models.ScheduleListViewType"] + ] = None, **kwargs: Any ) -> AsyncIterable["_models.ScheduleResourceArmPaginatedResult"]: """List schedules in specified workspace. @@ -75,16 +99,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ScheduleResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduleResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ScheduleResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -92,13 +123,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -114,7 +145,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ScheduleResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ScheduleResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -124,24 +157,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -150,49 +187,63 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -224,43 +275,52 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @distributed_trace_async async def get( @@ -285,47 +345,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.Schedule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Schedule"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Schedule', pipeline_response) + deserialized = self._deserialize("Schedule", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore async def _create_or_update_initial( self, @@ -335,16 +403,22 @@ async def _create_or_update_initial( body: "_models.Schedule", **kwargs: Any ) -> "_models.Schedule": - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Schedule"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'Schedule') + _json = self._serialize.body(body, "Schedule") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -354,39 +428,49 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('Schedule', pipeline_response) + deserialized = self._deserialize("Schedule", pipeline_response) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('Schedule', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("Schedule", pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -422,15 +506,22 @@ async def begin_create_or_update( :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Schedule] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Schedule"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -439,29 +530,33 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Schedule', pipeline_response) + deserialized = self._deserialize("Schedule", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_usages_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_usages_operations.py index cde3e1a0bfb8..2e2eac06852d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_usages_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_usages_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,8 +25,15 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._usages_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class UsagesOperations: """UsagesOperations async operations. @@ -46,9 +59,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list( - self, - location: str, - **kwargs: Any + self, location: str, **kwargs: Any ) -> AsyncIterable["_models.ListUsagesResult"]: """Gets the current usage information as well as limits for AML resources for given subscription and location. @@ -61,27 +72,34 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListUsagesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListUsagesResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, @@ -94,7 +112,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ListUsagesResult", pipeline_response) + deserialized = self._deserialize( + "ListUsagesResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -104,21 +124,25 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_virtual_machine_sizes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_virtual_machine_sizes_operations.py index 4f13114c1c90..651e5a9972c8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_virtual_machine_sizes_operations.py @@ -8,7 +8,13 @@ # -------------------------------------------------------------------------- from typing import Any, Callable, Dict, Optional, TypeVar -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -18,8 +24,15 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._virtual_machine_sizes_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class VirtualMachineSizesOperations: """VirtualMachineSizesOperations async operations. @@ -45,9 +58,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace_async async def list( - self, - location: str, - **kwargs: Any + self, location: str, **kwargs: Any ) -> "_models.VirtualMachineSizeListResult": """Returns supported VM Sizes in a location. @@ -58,42 +69,54 @@ async def list( :rtype: ~azure.mgmt.machinelearningservices.models.VirtualMachineSizeListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_list_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualMachineSizeListResult', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "VirtualMachineSizeListResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes"} # type: ignore - + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_workspace_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_workspace_connections_operations.py index cfac1c97d0b2..a85a872bc2b0 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_workspace_connections_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_workspace_connections_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._workspace_connections_operations import build_create_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._workspace_connections_operations import ( + build_create_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class WorkspaceConnectionsOperations: """WorkspaceConnectionsOperations async operations. @@ -70,16 +88,26 @@ async def create( :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'WorkspaceConnectionPropertiesV2BasicResource') + _json = self._serialize.body( + parameters, "WorkspaceConnectionPropertiesV2BasicResource" + ) request = build_create_request( subscription_id=self._config.subscription_id, @@ -89,32 +117,39 @@ async def create( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create.metadata['url'], + template_url=self.create.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - + create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace_async async def get( @@ -137,47 +172,59 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, connection_name=connection_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -200,43 +247,51 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, connection_name=connection_name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace def list( @@ -246,7 +301,9 @@ def list( target: Optional[str] = None, category: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult" + ]: """list. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -264,16 +321,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -281,13 +345,13 @@ def prepare_request(next_link=None): api_version=api_version, target=target, category=category, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -303,7 +367,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -313,21 +380,25 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_workspace_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_workspace_features_operations.py index d85900d038e7..ddbc98485b1c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_workspace_features_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_workspace_features_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,8 +25,15 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._workspace_features_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class WorkspaceFeaturesOperations: """WorkspaceFeaturesOperations async operations. @@ -46,10 +59,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> AsyncIterable["_models.ListAmlUserFeatureResult"]: """Lists all enabled features for a workspace. @@ -64,28 +74,35 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListAmlUserFeatureResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAmlUserFeatureResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListAmlUserFeatureResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -99,7 +116,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ListAmlUserFeatureResult", pipeline_response) + deserialized = self._deserialize( + "ListAmlUserFeatureResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -109,21 +128,25 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_workspaces_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_workspaces_operations.py index a9d712237ab1..f6a4fe4c8e6e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_workspaces_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/aio/operations/_workspaces_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,31 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._workspaces_operations import build_create_or_update_request_initial, build_delete_request_initial, build_diagnose_request_initial, build_get_request, build_list_by_resource_group_request, build_list_by_subscription_request, build_list_keys_request, build_list_notebook_access_token_request, build_list_notebook_keys_request, build_list_outbound_network_dependencies_endpoints_request, build_list_storage_account_keys_request, build_prepare_notebook_request_initial, build_resync_keys_request_initial, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._workspaces_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_diagnose_request_initial, + build_get_request, + build_list_by_resource_group_request, + build_list_by_subscription_request, + build_list_keys_request, + build_list_notebook_access_token_request, + build_list_notebook_keys_request, + build_list_outbound_network_dependencies_endpoints_request, + build_list_storage_account_keys_request, + build_prepare_notebook_request_initial, + build_resync_keys_request_initial, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class WorkspacesOperations: """WorkspacesOperations async operations. @@ -49,10 +81,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace_async async def get( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.Workspace": """Gets the properties of the specified machine learning workspace. @@ -65,46 +94,54 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.Workspace :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore async def _create_or_update_initial( self, @@ -113,16 +150,24 @@ async def _create_or_update_initial( parameters: "_models.Workspace", **kwargs: Any ) -> Optional["_models.Workspace"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.Workspace"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'Workspace') + _json = self._serialize.body(parameters, "Workspace") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -131,33 +176,36 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -189,15 +237,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Workspace] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -205,81 +260,85 @@ async def begin_create_or_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes a machine learning workspace. @@ -299,42 +358,51 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore async def _update_initial( self, @@ -343,16 +411,24 @@ async def _update_initial( parameters: "_models.WorkspaceUpdateParameters", **kwargs: Any ) -> Optional["_models.Workspace"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.Workspace"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'WorkspaceUpdateParameters') + _json = self._serialize.body(parameters, "WorkspaceUpdateParameters") request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -361,33 +437,36 @@ async def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -419,15 +498,22 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Workspace] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -435,32 +521,36 @@ async def begin_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace def list_by_resource_group( @@ -481,28 +571,35 @@ def list_by_resource_group( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_by_resource_group_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, api_version=api_version, skip=skip, - template_url=self.list_by_resource_group.metadata['url'], + template_url=self.list_by_resource_group.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_by_resource_group_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -516,7 +613,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -526,24 +625,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore + list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore async def _diagnose_initial( self, @@ -552,17 +655,27 @@ async def _diagnose_initial( parameters: Optional["_models.DiagnoseWorkspaceParameters"] = None, **kwargs: Any ) -> Optional["_models.DiagnoseResponseResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if parameters is not None: - _json = self._serialize.body(parameters, 'DiagnoseWorkspaceParameters') + _json = self._serialize.body( + parameters, "DiagnoseWorkspaceParameters" + ) else: _json = None @@ -573,39 +686,47 @@ async def _diagnose_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._diagnose_initial.metadata['url'], + template_url=self._diagnose_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) + deserialized = self._deserialize( + "DiagnoseResponseResult", pipeline_response + ) if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _diagnose_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore - + _diagnose_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore @distributed_trace_async async def begin_diagnose( @@ -639,15 +760,24 @@ async def begin_diagnose( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.DiagnoseResponseResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnoseResponseResult"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DiagnoseResponseResult"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._diagnose_initial( resource_group_name=resource_group_name, @@ -655,39 +785,46 @@ async def begin_diagnose( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) + deserialized = self._deserialize( + "DiagnoseResponseResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_diagnose.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore + begin_diagnose.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore @distributed_trace_async async def list_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.ListWorkspaceKeysResult": """Lists all the keys associated with this workspace. This includes keys for the storage account, app insights and password for container registry. @@ -701,95 +838,107 @@ async def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListWorkspaceKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceKeysResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListWorkspaceKeysResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ListWorkspaceKeysResult', pipeline_response) + deserialized = self._deserialize( + "ListWorkspaceKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys"} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys"} # type: ignore async def _resync_keys_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_resync_keys_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self._resync_keys_initial.metadata['url'], + template_url=self._resync_keys_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _resync_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore - + _resync_keys_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore @distributed_trace_async async def begin_resync_keys( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: """Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and password for container registry. @@ -810,48 +959,55 @@ async def begin_resync_keys( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._resync_keys_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_resync_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore + begin_resync_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore @distributed_trace def list_by_subscription( - self, - skip: Optional[str] = None, - **kwargs: Any + self, skip: Optional[str] = None, **kwargs: Any ) -> AsyncIterable["_models.WorkspaceListResult"]: """Lists all the available machine learning workspaces under the specified subscription. @@ -863,27 +1019,34 @@ def list_by_subscription( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, skip=skip, - template_url=self.list_by_subscription.metadata['url'], + template_url=self.list_by_subscription.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, @@ -896,7 +1059,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -906,31 +1071,32 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore + list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore @distributed_trace_async async def list_notebook_access_token( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.NotebookAccessTokenResult": """return notebook access token and refresh token. @@ -943,101 +1109,117 @@ async def list_notebook_access_token( :rtype: ~azure.mgmt.machinelearningservices.models.NotebookAccessTokenResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookAccessTokenResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.NotebookAccessTokenResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_list_notebook_access_token_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_notebook_access_token.metadata['url'], + template_url=self.list_notebook_access_token.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('NotebookAccessTokenResult', pipeline_response) + deserialized = self._deserialize( + "NotebookAccessTokenResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_notebook_access_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken"} # type: ignore - + list_notebook_access_token.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken"} # type: ignore async def _prepare_notebook_initial( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> Optional["_models.NotebookResourceInfo"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NotebookResourceInfo"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.NotebookResourceInfo"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_prepare_notebook_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self._prepare_notebook_initial.metadata['url'], + template_url=self._prepare_notebook_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) + deserialized = self._deserialize( + "NotebookResourceInfo", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _prepare_notebook_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore - + _prepare_notebook_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore @distributed_trace_async async def begin_prepare_notebook( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> AsyncLROPoller["_models.NotebookResourceInfo"]: """Prepare a notebook. @@ -1059,52 +1241,66 @@ async def begin_prepare_notebook( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.NotebookResourceInfo] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookResourceInfo"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.NotebookResourceInfo"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._prepare_notebook_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) + deserialized = self._deserialize( + "NotebookResourceInfo", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_prepare_notebook.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore + begin_prepare_notebook.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore @distributed_trace_async async def list_storage_account_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.ListStorageAccountKeysResult": """List storage account keys of a workspace. @@ -1117,53 +1313,62 @@ async def list_storage_account_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListStorageAccountKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListStorageAccountKeysResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListStorageAccountKeysResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_list_storage_account_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_storage_account_keys.metadata['url'], + template_url=self.list_storage_account_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ListStorageAccountKeysResult', pipeline_response) + deserialized = self._deserialize( + "ListStorageAccountKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_storage_account_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys"} # type: ignore - + list_storage_account_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys"} # type: ignore @distributed_trace_async async def list_notebook_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.ListNotebookKeysResult": """List keys of a notebook. @@ -1176,53 +1381,62 @@ async def list_notebook_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListNotebookKeysResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListNotebookKeysResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_list_notebook_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_notebook_keys.metadata['url'], + template_url=self.list_notebook_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ListNotebookKeysResult', pipeline_response) + deserialized = self._deserialize( + "ListNotebookKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_notebook_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys"} # type: ignore - + list_notebook_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys"} # type: ignore @distributed_trace_async async def list_outbound_network_dependencies_endpoints( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.ExternalFQDNResponse": """Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) programmatically. @@ -1239,43 +1453,57 @@ async def list_outbound_network_dependencies_endpoints( :rtype: ~azure.mgmt.machinelearningservices.models.ExternalFQDNResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExternalFQDNResponse"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ExternalFQDNResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_list_outbound_network_dependencies_endpoints_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], + template_url=self.list_outbound_network_dependencies_endpoints.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ExternalFQDNResponse', pipeline_response) + deserialized = self._deserialize( + "ExternalFQDNResponse", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_outbound_network_dependencies_endpoints.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints"} # type: ignore - + list_outbound_network_dependencies_endpoints.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/models/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/models/__init__.py index 92a40e8bdd88..6b3c23c16d3f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/models/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/models/__init__.py @@ -261,7 +261,9 @@ from ._models_py3 import MLTableJobInput from ._models_py3 import MLTableJobOutput from ._models_py3 import ManagedIdentity - from ._models_py3 import ManagedIdentityAuthTypeWorkspaceConnectionProperties + from ._models_py3 import ( + ManagedIdentityAuthTypeWorkspaceConnectionProperties, + ) from ._models_py3 import ManagedNetworkProvisionOptions from ._models_py3 import ManagedNetworkProvisionStatus from ._models_py3 import ManagedNetworkSettings @@ -305,7 +307,9 @@ from ._models_py3 import PATAuthTypeWorkspaceConnectionProperties from ._models_py3 import PaginatedComputeResourcesList from ._models_py3 import PartialBatchDeployment - from ._models_py3 import PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties + from ._models_py3 import ( + PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, + ) from ._models_py3 import PartialManagedServiceIdentity from ._models_py3 import PartialMinimalTrackedResource from ._models_py3 import PartialMinimalTrackedResourceWithIdentity @@ -361,7 +365,9 @@ from ._models_py3 import ScriptsToExecute from ._models_py3 import Seasonality from ._models_py3 import ServiceManagedResourcesSettings - from ._models_py3 import ServicePrincipalAuthTypeWorkspaceConnectionProperties + from ._models_py3 import ( + ServicePrincipalAuthTypeWorkspaceConnectionProperties, + ) from ._models_py3 import ServicePrincipalDatastoreCredentials from ._models_py3 import ServicePrincipalDatastoreSecrets from ._models_py3 import ServiceTagDestination @@ -426,7 +432,9 @@ from ._models_py3 import UserCreatedAcrAccount from ._models_py3 import UserCreatedStorageAccount from ._models_py3 import UserIdentity - from ._models_py3 import UsernamePasswordAuthTypeWorkspaceConnectionProperties + from ._models_py3 import ( + UsernamePasswordAuthTypeWorkspaceConnectionProperties, + ) from ._models_py3 import VirtualMachine from ._models_py3 import VirtualMachineImage from ._models_py3 import VirtualMachineSchema @@ -444,7 +452,9 @@ from ._models_py3 import WorkspaceConnectionPersonalAccessToken from ._models_py3 import WorkspaceConnectionPropertiesV2 from ._models_py3 import WorkspaceConnectionPropertiesV2BasicResource - from ._models_py3 import WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult + from ._models_py3 import ( + WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, + ) from ._models_py3 import WorkspaceConnectionServicePrincipal from ._models_py3 import WorkspaceConnectionSharedAccessSignature from ._models_py3 import WorkspaceConnectionUsernamePassword @@ -1040,588 +1050,588 @@ ) __all__ = [ - 'AKS', - 'AKSSchema', - 'AKSSchemaProperties', - 'AccessKeyAuthTypeWorkspaceConnectionProperties', - 'AccountKeyDatastoreCredentials', - 'AccountKeyDatastoreSecrets', - 'AcrDetails', - 'AksComputeSecrets', - 'AksComputeSecretsProperties', - 'AksNetworkingConfiguration', - 'AllNodes', - 'AmlCompute', - 'AmlComputeNodeInformation', - 'AmlComputeNodesInformation', - 'AmlComputeProperties', - 'AmlComputeSchema', - 'AmlOperation', - 'AmlOperationDisplay', - 'AmlOperationListResult', - 'AmlToken', - 'AmlUserFeature', - 'ArmResourceId', - 'AssetBase', - 'AssetContainer', - 'AssetJobInput', - 'AssetJobOutput', - 'AssetReferenceBase', - 'AssignedUser', - 'AutoForecastHorizon', - 'AutoMLJob', - 'AutoMLVertical', - 'AutoNCrossValidations', - 'AutoPauseProperties', - 'AutoScaleProperties', - 'AutoSeasonality', - 'AutoTargetLags', - 'AutoTargetRollingWindowSize', - 'AutologgerSettings', - 'AzureBlobDatastore', - 'AzureDataLakeGen1Datastore', - 'AzureDataLakeGen2Datastore', - 'AzureDatastore', - 'AzureFileDatastore', - 'BanditPolicy', - 'BatchDeployment', - 'BatchDeploymentProperties', - 'BatchDeploymentTrackedResourceArmPaginatedResult', - 'BatchEndpoint', - 'BatchEndpointDefaults', - 'BatchEndpointProperties', - 'BatchEndpointTrackedResourceArmPaginatedResult', - 'BatchRetrySettings', - 'BayesianSamplingAlgorithm', - 'BindOptions', - 'BuildContext', - 'CertificateDatastoreCredentials', - 'CertificateDatastoreSecrets', - 'Classification', - 'ClassificationTrainingSettings', - 'ClusterUpdateParameters', - 'CocoExportSummary', - 'CodeConfiguration', - 'CodeContainer', - 'CodeContainerProperties', - 'CodeContainerResourceArmPaginatedResult', - 'CodeVersion', - 'CodeVersionProperties', - 'CodeVersionResourceArmPaginatedResult', - 'ColumnTransformer', - 'CommandJob', - 'CommandJobLimits', - 'ComponentContainer', - 'ComponentContainerProperties', - 'ComponentContainerResourceArmPaginatedResult', - 'ComponentVersion', - 'ComponentVersionProperties', - 'ComponentVersionResourceArmPaginatedResult', - 'Compute', - 'ComputeInstance', - 'ComputeInstanceApplication', - 'ComputeInstanceAutologgerSettings', - 'ComputeInstanceConnectivityEndpoints', - 'ComputeInstanceContainer', - 'ComputeInstanceCreatedBy', - 'ComputeInstanceDataDisk', - 'ComputeInstanceDataMount', - 'ComputeInstanceEnvironmentInfo', - 'ComputeInstanceLastOperation', - 'ComputeInstanceProperties', - 'ComputeInstanceSchema', - 'ComputeInstanceSshSettings', - 'ComputeInstanceVersion', - 'ComputeResource', - 'ComputeResourceSchema', - 'ComputeRuntimeDto', - 'ComputeSchedules', - 'ComputeSecrets', - 'ComputeStartStopSchedule', - 'ContainerResourceRequirements', - 'ContainerResourceSettings', - 'CosmosDbSettings', - 'CronTrigger', - 'CsvExportSummary', - 'CustomForecastHorizon', - 'CustomModelJobInput', - 'CustomModelJobOutput', - 'CustomNCrossValidations', - 'CustomSeasonality', - 'CustomService', - 'CustomTargetLags', - 'CustomTargetRollingWindowSize', - 'DataContainer', - 'DataContainerProperties', - 'DataContainerResourceArmPaginatedResult', - 'DataFactory', - 'DataLakeAnalytics', - 'DataLakeAnalyticsSchema', - 'DataLakeAnalyticsSchemaProperties', - 'DataPathAssetReference', - 'DataVersionBase', - 'DataVersionBaseProperties', - 'DataVersionBaseResourceArmPaginatedResult', - 'Databricks', - 'DatabricksComputeSecrets', - 'DatabricksComputeSecretsProperties', - 'DatabricksProperties', - 'DatabricksSchema', - 'DatasetExportSummary', - 'Datastore', - 'DatastoreCredentials', - 'DatastoreProperties', - 'DatastoreResourceArmPaginatedResult', - 'DatastoreSecrets', - 'DefaultScaleSettings', - 'DeploymentLogs', - 'DeploymentLogsRequest', - 'DeploymentResourceConfiguration', - 'DiagnoseRequestProperties', - 'DiagnoseResponseResult', - 'DiagnoseResponseResultValue', - 'DiagnoseResult', - 'DiagnoseWorkspaceParameters', - 'DistributionConfiguration', - 'Docker', - 'EarlyTerminationPolicy', - 'EncryptionKeyVaultProperties', - 'EncryptionKeyVaultUpdateProperties', - 'EncryptionProperty', - 'EncryptionUpdateProperties', - 'Endpoint', - 'EndpointAuthKeys', - 'EndpointAuthToken', - 'EndpointDeploymentPropertiesBase', - 'EndpointPropertiesBase', - 'EndpointScheduleAction', - 'EnvironmentContainer', - 'EnvironmentContainerProperties', - 'EnvironmentContainerResourceArmPaginatedResult', - 'EnvironmentVariable', - 'EnvironmentVersion', - 'EnvironmentVersionProperties', - 'EnvironmentVersionResourceArmPaginatedResult', - 'ErrorAdditionalInfo', - 'ErrorDetail', - 'ErrorResponse', - 'EstimatedVMPrice', - 'EstimatedVMPrices', - 'ExportSummary', - 'ExternalFQDNResponse', - 'FQDNEndpoint', - 'FQDNEndpointDetail', - 'FQDNEndpoints', - 'FQDNEndpointsProperties', - 'FeatureStoreSettings', - 'FeaturizationSettings', - 'FlavorData', - 'ForecastHorizon', - 'Forecasting', - 'ForecastingSettings', - 'ForecastingTrainingSettings', - 'FqdnOutboundRule', - 'GridSamplingAlgorithm', - 'HDInsight', - 'HDInsightProperties', - 'HDInsightSchema', - 'HdfsDatastore', - 'IdAssetReference', - 'IdentityConfiguration', - 'IdentityForCmk', - 'IdleShutdownSetting', - 'Image', - 'ImageClassification', - 'ImageClassificationBase', - 'ImageClassificationMultilabel', - 'ImageInstanceSegmentation', - 'ImageLimitSettings', - 'ImageMetadata', - 'ImageModelDistributionSettings', - 'ImageModelDistributionSettingsClassification', - 'ImageModelDistributionSettingsObjectDetection', - 'ImageModelSettings', - 'ImageModelSettingsClassification', - 'ImageModelSettingsObjectDetection', - 'ImageObjectDetection', - 'ImageObjectDetectionBase', - 'ImageSweepSettings', - 'ImageVertical', - 'InferenceContainerProperties', - 'InstanceTypeSchema', - 'InstanceTypeSchemaResources', - 'JobBase', - 'JobBaseProperties', - 'JobBaseResourceArmPaginatedResult', - 'JobInput', - 'JobLimits', - 'JobOutput', - 'JobResourceConfiguration', - 'JobScheduleAction', - 'JobService', - 'KerberosCredentials', - 'KerberosKeytabCredentials', - 'KerberosKeytabSecrets', - 'KerberosPasswordCredentials', - 'KerberosPasswordSecrets', - 'Kubernetes', - 'KubernetesOnlineDeployment', - 'KubernetesProperties', - 'KubernetesSchema', - 'LabelCategory', - 'LabelClass', - 'LabelingDataConfiguration', - 'LabelingJob', - 'LabelingJobImageProperties', - 'LabelingJobInstructions', - 'LabelingJobMediaProperties', - 'LabelingJobProperties', - 'LabelingJobResourceArmPaginatedResult', - 'LabelingJobTextProperties', - 'ListAmlUserFeatureResult', - 'ListNotebookKeysResult', - 'ListStorageAccountKeysResult', - 'ListUsagesResult', - 'ListWorkspaceKeysResult', - 'ListWorkspaceQuotas', - 'LiteralJobInput', - 'MLAssistConfiguration', - 'MLAssistConfigurationDisabled', - 'MLAssistConfigurationEnabled', - 'MLFlowModelJobInput', - 'MLFlowModelJobOutput', - 'MLTableData', - 'MLTableJobInput', - 'MLTableJobOutput', - 'ManagedIdentity', - 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', - 'ManagedNetworkProvisionOptions', - 'ManagedNetworkProvisionStatus', - 'ManagedNetworkSettings', - 'ManagedOnlineDeployment', - 'ManagedServiceIdentity', - 'MedianStoppingPolicy', - 'ModelContainer', - 'ModelContainerProperties', - 'ModelContainerResourceArmPaginatedResult', - 'ModelVersion', - 'ModelVersionProperties', - 'ModelVersionResourceArmPaginatedResult', - 'Mpi', - 'NCrossValidations', - 'NlpFixedParameters', - 'NlpParameterSubspace', - 'NlpSweepSettings', - 'NlpVertical', - 'NlpVerticalFeaturizationSettings', - 'NlpVerticalLimitSettings', - 'NodeStateCounts', - 'Nodes', - 'NoneAuthTypeWorkspaceConnectionProperties', - 'NoneDatastoreCredentials', - 'NotebookAccessTokenResult', - 'NotebookPreparationError', - 'NotebookResourceInfo', - 'Objective', - 'OnlineDeployment', - 'OnlineDeploymentProperties', - 'OnlineDeploymentTrackedResourceArmPaginatedResult', - 'OnlineEndpoint', - 'OnlineEndpointProperties', - 'OnlineEndpointTrackedResourceArmPaginatedResult', - 'OnlineRequestSettings', - 'OnlineScaleSettings', - 'OutboundRule', - 'OutboundRuleBasicResource', - 'OutboundRuleListResult', - 'OutputPathAssetReference', - 'PATAuthTypeWorkspaceConnectionProperties', - 'PaginatedComputeResourcesList', - 'PartialBatchDeployment', - 'PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties', - 'PartialManagedServiceIdentity', - 'PartialMinimalTrackedResource', - 'PartialMinimalTrackedResourceWithIdentity', - 'PartialMinimalTrackedResourceWithSku', - 'PartialRegistryPartialTrackedResource', - 'PartialSku', - 'Password', - 'PersonalComputeInstanceSettings', - 'PipelineJob', - 'PrivateEndpoint', - 'PrivateEndpointConnection', - 'PrivateEndpointConnectionListResult', - 'PrivateEndpointDestination', - 'PrivateEndpointOutboundRule', - 'PrivateLinkResource', - 'PrivateLinkResourceListResult', - 'PrivateLinkServiceConnectionState', - 'ProbeSettings', - 'ProgressMetrics', - 'PyTorch', - 'QuotaBaseProperties', - 'QuotaUpdateParameters', - 'RandomSamplingAlgorithm', - 'RecurrenceSchedule', - 'RecurrenceTrigger', - 'RegenerateEndpointKeysRequest', - 'Registry', - 'RegistryListCredentialsResult', - 'RegistryProperties', - 'RegistryRegionArmDetails', - 'RegistryTrackedResourceArmPaginatedResult', - 'Regression', - 'RegressionTrainingSettings', - 'Resource', - 'ResourceBase', - 'ResourceConfiguration', - 'ResourceId', - 'ResourceName', - 'ResourceQuota', - 'Route', - 'SASAuthTypeWorkspaceConnectionProperties', - 'SamplingAlgorithm', - 'SasDatastoreCredentials', - 'SasDatastoreSecrets', - 'ScaleSettings', - 'ScaleSettingsInformation', - 'Schedule', - 'ScheduleActionBase', - 'ScheduleBase', - 'ScheduleProperties', - 'ScheduleResourceArmPaginatedResult', - 'ScriptReference', - 'ScriptsToExecute', - 'Seasonality', - 'ServiceManagedResourcesSettings', - 'ServicePrincipalAuthTypeWorkspaceConnectionProperties', - 'ServicePrincipalDatastoreCredentials', - 'ServicePrincipalDatastoreSecrets', - 'ServiceTagDestination', - 'ServiceTagOutboundRule', - 'SetupScripts', - 'SharedPrivateLinkResource', - 'Sku', - 'SkuCapacity', - 'SkuResource', - 'SkuResourceArmPaginatedResult', - 'SkuSetting', - 'SparkJob', - 'SparkJobEntry', - 'SparkJobPythonEntry', - 'SparkJobScalaEntry', - 'SparkResourceConfiguration', - 'SslConfiguration', - 'StackEnsembleSettings', - 'StatusMessage', - 'StorageAccountDetails', - 'SweepJob', - 'SweepJobLimits', - 'SynapseSpark', - 'SynapseSparkProperties', - 'SystemCreatedAcrAccount', - 'SystemCreatedStorageAccount', - 'SystemData', - 'SystemService', - 'TableFixedParameters', - 'TableParameterSubspace', - 'TableSweepSettings', - 'TableVertical', - 'TableVerticalFeaturizationSettings', - 'TableVerticalLimitSettings', - 'TargetLags', - 'TargetRollingWindowSize', - 'TargetUtilizationScaleSettings', - 'TensorFlow', - 'TextClassification', - 'TextClassificationMultilabel', - 'TextNer', - 'TmpfsOptions', - 'TrackedResource', - 'TrainingSettings', - 'TrialComponent', - 'TriggerBase', - 'TritonModelJobInput', - 'TritonModelJobOutput', - 'TruncationSelectionPolicy', - 'UpdateWorkspaceQuotas', - 'UpdateWorkspaceQuotasResult', - 'UriFileDataVersion', - 'UriFileJobInput', - 'UriFileJobOutput', - 'UriFolderDataVersion', - 'UriFolderJobInput', - 'UriFolderJobOutput', - 'Usage', - 'UsageName', - 'UserAccountCredentials', - 'UserAssignedIdentity', - 'UserCreatedAcrAccount', - 'UserCreatedStorageAccount', - 'UserIdentity', - 'UsernamePasswordAuthTypeWorkspaceConnectionProperties', - 'VirtualMachine', - 'VirtualMachineImage', - 'VirtualMachineSchema', - 'VirtualMachineSchemaProperties', - 'VirtualMachineSecrets', - 'VirtualMachineSecretsSchema', - 'VirtualMachineSize', - 'VirtualMachineSizeListResult', - 'VirtualMachineSshCredentials', - 'VolumeDefinition', - 'VolumeOptions', - 'Workspace', - 'WorkspaceConnectionAccessKey', - 'WorkspaceConnectionManagedIdentity', - 'WorkspaceConnectionPersonalAccessToken', - 'WorkspaceConnectionPropertiesV2', - 'WorkspaceConnectionPropertiesV2BasicResource', - 'WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult', - 'WorkspaceConnectionServicePrincipal', - 'WorkspaceConnectionSharedAccessSignature', - 'WorkspaceConnectionUsernamePassword', - 'WorkspaceListResult', - 'WorkspaceUpdateParameters', - 'AllocationState', - 'ApplicationSharingPolicy', - 'AssetProvisioningState', - 'AutoRebuildSetting', - 'Autosave', - 'BatchLoggingLevel', - 'BatchOutputAction', - 'BillingCurrency', - 'BlockedTransformers', - 'Caching', - 'ClassificationModels', - 'ClassificationMultilabelPrimaryMetrics', - 'ClassificationPrimaryMetrics', - 'ClusterPurpose', - 'ComputeInstanceAuthorizationType', - 'ComputeInstanceState', - 'ComputePowerAction', - 'ComputeType', - 'ConnectionAuthType', - 'ConnectionCategory', - 'ContainerType', - 'CreatedByType', - 'CredentialsType', - 'DataType', - 'DatastoreType', - 'DeploymentProvisioningState', - 'DiagnoseResultLevel', - 'DistributionType', - 'EarlyTerminationPolicyType', - 'EgressPublicNetworkAccessType', - 'EncryptionStatus', - 'EndpointAuthMode', - 'EndpointComputeType', - 'EndpointProvisioningState', - 'EnvironmentType', - 'EnvironmentVariableType', - 'ExportFormatType', - 'FeatureLags', - 'FeaturizationMode', - 'ForecastHorizonMode', - 'ForecastingModels', - 'ForecastingPrimaryMetrics', - 'Goal', - 'IdentityConfigurationType', - 'ImageAnnotationType', - 'ImageType', - 'IncrementalDataRefresh', - 'InputDeliveryMode', - 'InstanceSegmentationPrimaryMetrics', - 'IsolationMode', - 'JobInputType', - 'JobLimitsType', - 'JobOutputType', - 'JobProvisioningState', - 'JobStatus', - 'JobType', - 'KeyType', - 'LearningRateScheduler', - 'ListViewType', - 'LoadBalancerType', - 'LogVerbosity', - 'MLAssistConfigurationType', - 'MLFlowAutologgerState', - 'ManagedNetworkStatus', - 'ManagedServiceIdentityType', - 'MediaType', - 'MlflowAutologger', - 'ModelSize', - 'MountAction', - 'MountState', - 'MultiSelect', - 'NCrossValidationsMode', - 'Network', - 'NlpLearningRateScheduler', - 'NodeState', - 'NodesValueType', - 'ObjectDetectionPrimaryMetrics', - 'OperatingSystemType', - 'OperationName', - 'OperationStatus', - 'OperationTrigger', - 'OrderString', - 'OsType', - 'OutputDeliveryMode', - 'PrivateEndpointConnectionProvisioningState', - 'PrivateEndpointServiceConnectionStatus', - 'Protocol', - 'ProvisioningState', - 'ProvisioningStatus', - 'PublicNetworkAccess', - 'PublicNetworkAccessType', - 'QuotaUnit', - 'RandomSamplingAlgorithmRule', - 'RecurrenceFrequency', - 'ReferenceType', - 'RegressionModels', - 'RegressionPrimaryMetrics', - 'RemoteLoginPortPublicAccess', - 'RuleCategory', - 'RuleStatus', - 'RuleType', - 'SamplingAlgorithmType', - 'ScaleType', - 'ScheduleActionType', - 'ScheduleListViewType', - 'ScheduleProvisioningState', - 'ScheduleProvisioningStatus', - 'ScheduleStatus', - 'SeasonalityMode', - 'SecretsType', - 'ServiceDataAccessAuthIdentity', - 'ShortSeriesHandlingConfiguration', - 'SkuScaleType', - 'SkuTier', - 'SourceType', - 'SparkJobEntryType', - 'SshPublicAccess', - 'SslConfigStatus', - 'StackMetaLearnerType', - 'Status', - 'StatusMessageLevel', - 'StochasticOptimizer', - 'StorageAccountType', - 'TargetAggregationFunction', - 'TargetLagsMode', - 'TargetRollingWindowSizeMode', - 'TaskType', - 'TextAnnotationType', - 'TrainingMode', - 'TriggerType', - 'UnderlyingResourceAction', - 'UnitOfMeasure', - 'UsageUnit', - 'UseStl', - 'VMPriceOSType', - 'VMTier', - 'ValidationMetricType', - 'ValueFormat', - 'VmPriority', - 'VolumeDefinitionType', - 'WeekDay', + "AKS", + "AKSSchema", + "AKSSchemaProperties", + "AccessKeyAuthTypeWorkspaceConnectionProperties", + "AccountKeyDatastoreCredentials", + "AccountKeyDatastoreSecrets", + "AcrDetails", + "AksComputeSecrets", + "AksComputeSecretsProperties", + "AksNetworkingConfiguration", + "AllNodes", + "AmlCompute", + "AmlComputeNodeInformation", + "AmlComputeNodesInformation", + "AmlComputeProperties", + "AmlComputeSchema", + "AmlOperation", + "AmlOperationDisplay", + "AmlOperationListResult", + "AmlToken", + "AmlUserFeature", + "ArmResourceId", + "AssetBase", + "AssetContainer", + "AssetJobInput", + "AssetJobOutput", + "AssetReferenceBase", + "AssignedUser", + "AutoForecastHorizon", + "AutoMLJob", + "AutoMLVertical", + "AutoNCrossValidations", + "AutoPauseProperties", + "AutoScaleProperties", + "AutoSeasonality", + "AutoTargetLags", + "AutoTargetRollingWindowSize", + "AutologgerSettings", + "AzureBlobDatastore", + "AzureDataLakeGen1Datastore", + "AzureDataLakeGen2Datastore", + "AzureDatastore", + "AzureFileDatastore", + "BanditPolicy", + "BatchDeployment", + "BatchDeploymentProperties", + "BatchDeploymentTrackedResourceArmPaginatedResult", + "BatchEndpoint", + "BatchEndpointDefaults", + "BatchEndpointProperties", + "BatchEndpointTrackedResourceArmPaginatedResult", + "BatchRetrySettings", + "BayesianSamplingAlgorithm", + "BindOptions", + "BuildContext", + "CertificateDatastoreCredentials", + "CertificateDatastoreSecrets", + "Classification", + "ClassificationTrainingSettings", + "ClusterUpdateParameters", + "CocoExportSummary", + "CodeConfiguration", + "CodeContainer", + "CodeContainerProperties", + "CodeContainerResourceArmPaginatedResult", + "CodeVersion", + "CodeVersionProperties", + "CodeVersionResourceArmPaginatedResult", + "ColumnTransformer", + "CommandJob", + "CommandJobLimits", + "ComponentContainer", + "ComponentContainerProperties", + "ComponentContainerResourceArmPaginatedResult", + "ComponentVersion", + "ComponentVersionProperties", + "ComponentVersionResourceArmPaginatedResult", + "Compute", + "ComputeInstance", + "ComputeInstanceApplication", + "ComputeInstanceAutologgerSettings", + "ComputeInstanceConnectivityEndpoints", + "ComputeInstanceContainer", + "ComputeInstanceCreatedBy", + "ComputeInstanceDataDisk", + "ComputeInstanceDataMount", + "ComputeInstanceEnvironmentInfo", + "ComputeInstanceLastOperation", + "ComputeInstanceProperties", + "ComputeInstanceSchema", + "ComputeInstanceSshSettings", + "ComputeInstanceVersion", + "ComputeResource", + "ComputeResourceSchema", + "ComputeRuntimeDto", + "ComputeSchedules", + "ComputeSecrets", + "ComputeStartStopSchedule", + "ContainerResourceRequirements", + "ContainerResourceSettings", + "CosmosDbSettings", + "CronTrigger", + "CsvExportSummary", + "CustomForecastHorizon", + "CustomModelJobInput", + "CustomModelJobOutput", + "CustomNCrossValidations", + "CustomSeasonality", + "CustomService", + "CustomTargetLags", + "CustomTargetRollingWindowSize", + "DataContainer", + "DataContainerProperties", + "DataContainerResourceArmPaginatedResult", + "DataFactory", + "DataLakeAnalytics", + "DataLakeAnalyticsSchema", + "DataLakeAnalyticsSchemaProperties", + "DataPathAssetReference", + "DataVersionBase", + "DataVersionBaseProperties", + "DataVersionBaseResourceArmPaginatedResult", + "Databricks", + "DatabricksComputeSecrets", + "DatabricksComputeSecretsProperties", + "DatabricksProperties", + "DatabricksSchema", + "DatasetExportSummary", + "Datastore", + "DatastoreCredentials", + "DatastoreProperties", + "DatastoreResourceArmPaginatedResult", + "DatastoreSecrets", + "DefaultScaleSettings", + "DeploymentLogs", + "DeploymentLogsRequest", + "DeploymentResourceConfiguration", + "DiagnoseRequestProperties", + "DiagnoseResponseResult", + "DiagnoseResponseResultValue", + "DiagnoseResult", + "DiagnoseWorkspaceParameters", + "DistributionConfiguration", + "Docker", + "EarlyTerminationPolicy", + "EncryptionKeyVaultProperties", + "EncryptionKeyVaultUpdateProperties", + "EncryptionProperty", + "EncryptionUpdateProperties", + "Endpoint", + "EndpointAuthKeys", + "EndpointAuthToken", + "EndpointDeploymentPropertiesBase", + "EndpointPropertiesBase", + "EndpointScheduleAction", + "EnvironmentContainer", + "EnvironmentContainerProperties", + "EnvironmentContainerResourceArmPaginatedResult", + "EnvironmentVariable", + "EnvironmentVersion", + "EnvironmentVersionProperties", + "EnvironmentVersionResourceArmPaginatedResult", + "ErrorAdditionalInfo", + "ErrorDetail", + "ErrorResponse", + "EstimatedVMPrice", + "EstimatedVMPrices", + "ExportSummary", + "ExternalFQDNResponse", + "FQDNEndpoint", + "FQDNEndpointDetail", + "FQDNEndpoints", + "FQDNEndpointsProperties", + "FeatureStoreSettings", + "FeaturizationSettings", + "FlavorData", + "ForecastHorizon", + "Forecasting", + "ForecastingSettings", + "ForecastingTrainingSettings", + "FqdnOutboundRule", + "GridSamplingAlgorithm", + "HDInsight", + "HDInsightProperties", + "HDInsightSchema", + "HdfsDatastore", + "IdAssetReference", + "IdentityConfiguration", + "IdentityForCmk", + "IdleShutdownSetting", + "Image", + "ImageClassification", + "ImageClassificationBase", + "ImageClassificationMultilabel", + "ImageInstanceSegmentation", + "ImageLimitSettings", + "ImageMetadata", + "ImageModelDistributionSettings", + "ImageModelDistributionSettingsClassification", + "ImageModelDistributionSettingsObjectDetection", + "ImageModelSettings", + "ImageModelSettingsClassification", + "ImageModelSettingsObjectDetection", + "ImageObjectDetection", + "ImageObjectDetectionBase", + "ImageSweepSettings", + "ImageVertical", + "InferenceContainerProperties", + "InstanceTypeSchema", + "InstanceTypeSchemaResources", + "JobBase", + "JobBaseProperties", + "JobBaseResourceArmPaginatedResult", + "JobInput", + "JobLimits", + "JobOutput", + "JobResourceConfiguration", + "JobScheduleAction", + "JobService", + "KerberosCredentials", + "KerberosKeytabCredentials", + "KerberosKeytabSecrets", + "KerberosPasswordCredentials", + "KerberosPasswordSecrets", + "Kubernetes", + "KubernetesOnlineDeployment", + "KubernetesProperties", + "KubernetesSchema", + "LabelCategory", + "LabelClass", + "LabelingDataConfiguration", + "LabelingJob", + "LabelingJobImageProperties", + "LabelingJobInstructions", + "LabelingJobMediaProperties", + "LabelingJobProperties", + "LabelingJobResourceArmPaginatedResult", + "LabelingJobTextProperties", + "ListAmlUserFeatureResult", + "ListNotebookKeysResult", + "ListStorageAccountKeysResult", + "ListUsagesResult", + "ListWorkspaceKeysResult", + "ListWorkspaceQuotas", + "LiteralJobInput", + "MLAssistConfiguration", + "MLAssistConfigurationDisabled", + "MLAssistConfigurationEnabled", + "MLFlowModelJobInput", + "MLFlowModelJobOutput", + "MLTableData", + "MLTableJobInput", + "MLTableJobOutput", + "ManagedIdentity", + "ManagedIdentityAuthTypeWorkspaceConnectionProperties", + "ManagedNetworkProvisionOptions", + "ManagedNetworkProvisionStatus", + "ManagedNetworkSettings", + "ManagedOnlineDeployment", + "ManagedServiceIdentity", + "MedianStoppingPolicy", + "ModelContainer", + "ModelContainerProperties", + "ModelContainerResourceArmPaginatedResult", + "ModelVersion", + "ModelVersionProperties", + "ModelVersionResourceArmPaginatedResult", + "Mpi", + "NCrossValidations", + "NlpFixedParameters", + "NlpParameterSubspace", + "NlpSweepSettings", + "NlpVertical", + "NlpVerticalFeaturizationSettings", + "NlpVerticalLimitSettings", + "NodeStateCounts", + "Nodes", + "NoneAuthTypeWorkspaceConnectionProperties", + "NoneDatastoreCredentials", + "NotebookAccessTokenResult", + "NotebookPreparationError", + "NotebookResourceInfo", + "Objective", + "OnlineDeployment", + "OnlineDeploymentProperties", + "OnlineDeploymentTrackedResourceArmPaginatedResult", + "OnlineEndpoint", + "OnlineEndpointProperties", + "OnlineEndpointTrackedResourceArmPaginatedResult", + "OnlineRequestSettings", + "OnlineScaleSettings", + "OutboundRule", + "OutboundRuleBasicResource", + "OutboundRuleListResult", + "OutputPathAssetReference", + "PATAuthTypeWorkspaceConnectionProperties", + "PaginatedComputeResourcesList", + "PartialBatchDeployment", + "PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties", + "PartialManagedServiceIdentity", + "PartialMinimalTrackedResource", + "PartialMinimalTrackedResourceWithIdentity", + "PartialMinimalTrackedResourceWithSku", + "PartialRegistryPartialTrackedResource", + "PartialSku", + "Password", + "PersonalComputeInstanceSettings", + "PipelineJob", + "PrivateEndpoint", + "PrivateEndpointConnection", + "PrivateEndpointConnectionListResult", + "PrivateEndpointDestination", + "PrivateEndpointOutboundRule", + "PrivateLinkResource", + "PrivateLinkResourceListResult", + "PrivateLinkServiceConnectionState", + "ProbeSettings", + "ProgressMetrics", + "PyTorch", + "QuotaBaseProperties", + "QuotaUpdateParameters", + "RandomSamplingAlgorithm", + "RecurrenceSchedule", + "RecurrenceTrigger", + "RegenerateEndpointKeysRequest", + "Registry", + "RegistryListCredentialsResult", + "RegistryProperties", + "RegistryRegionArmDetails", + "RegistryTrackedResourceArmPaginatedResult", + "Regression", + "RegressionTrainingSettings", + "Resource", + "ResourceBase", + "ResourceConfiguration", + "ResourceId", + "ResourceName", + "ResourceQuota", + "Route", + "SASAuthTypeWorkspaceConnectionProperties", + "SamplingAlgorithm", + "SasDatastoreCredentials", + "SasDatastoreSecrets", + "ScaleSettings", + "ScaleSettingsInformation", + "Schedule", + "ScheduleActionBase", + "ScheduleBase", + "ScheduleProperties", + "ScheduleResourceArmPaginatedResult", + "ScriptReference", + "ScriptsToExecute", + "Seasonality", + "ServiceManagedResourcesSettings", + "ServicePrincipalAuthTypeWorkspaceConnectionProperties", + "ServicePrincipalDatastoreCredentials", + "ServicePrincipalDatastoreSecrets", + "ServiceTagDestination", + "ServiceTagOutboundRule", + "SetupScripts", + "SharedPrivateLinkResource", + "Sku", + "SkuCapacity", + "SkuResource", + "SkuResourceArmPaginatedResult", + "SkuSetting", + "SparkJob", + "SparkJobEntry", + "SparkJobPythonEntry", + "SparkJobScalaEntry", + "SparkResourceConfiguration", + "SslConfiguration", + "StackEnsembleSettings", + "StatusMessage", + "StorageAccountDetails", + "SweepJob", + "SweepJobLimits", + "SynapseSpark", + "SynapseSparkProperties", + "SystemCreatedAcrAccount", + "SystemCreatedStorageAccount", + "SystemData", + "SystemService", + "TableFixedParameters", + "TableParameterSubspace", + "TableSweepSettings", + "TableVertical", + "TableVerticalFeaturizationSettings", + "TableVerticalLimitSettings", + "TargetLags", + "TargetRollingWindowSize", + "TargetUtilizationScaleSettings", + "TensorFlow", + "TextClassification", + "TextClassificationMultilabel", + "TextNer", + "TmpfsOptions", + "TrackedResource", + "TrainingSettings", + "TrialComponent", + "TriggerBase", + "TritonModelJobInput", + "TritonModelJobOutput", + "TruncationSelectionPolicy", + "UpdateWorkspaceQuotas", + "UpdateWorkspaceQuotasResult", + "UriFileDataVersion", + "UriFileJobInput", + "UriFileJobOutput", + "UriFolderDataVersion", + "UriFolderJobInput", + "UriFolderJobOutput", + "Usage", + "UsageName", + "UserAccountCredentials", + "UserAssignedIdentity", + "UserCreatedAcrAccount", + "UserCreatedStorageAccount", + "UserIdentity", + "UsernamePasswordAuthTypeWorkspaceConnectionProperties", + "VirtualMachine", + "VirtualMachineImage", + "VirtualMachineSchema", + "VirtualMachineSchemaProperties", + "VirtualMachineSecrets", + "VirtualMachineSecretsSchema", + "VirtualMachineSize", + "VirtualMachineSizeListResult", + "VirtualMachineSshCredentials", + "VolumeDefinition", + "VolumeOptions", + "Workspace", + "WorkspaceConnectionAccessKey", + "WorkspaceConnectionManagedIdentity", + "WorkspaceConnectionPersonalAccessToken", + "WorkspaceConnectionPropertiesV2", + "WorkspaceConnectionPropertiesV2BasicResource", + "WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", + "WorkspaceConnectionServicePrincipal", + "WorkspaceConnectionSharedAccessSignature", + "WorkspaceConnectionUsernamePassword", + "WorkspaceListResult", + "WorkspaceUpdateParameters", + "AllocationState", + "ApplicationSharingPolicy", + "AssetProvisioningState", + "AutoRebuildSetting", + "Autosave", + "BatchLoggingLevel", + "BatchOutputAction", + "BillingCurrency", + "BlockedTransformers", + "Caching", + "ClassificationModels", + "ClassificationMultilabelPrimaryMetrics", + "ClassificationPrimaryMetrics", + "ClusterPurpose", + "ComputeInstanceAuthorizationType", + "ComputeInstanceState", + "ComputePowerAction", + "ComputeType", + "ConnectionAuthType", + "ConnectionCategory", + "ContainerType", + "CreatedByType", + "CredentialsType", + "DataType", + "DatastoreType", + "DeploymentProvisioningState", + "DiagnoseResultLevel", + "DistributionType", + "EarlyTerminationPolicyType", + "EgressPublicNetworkAccessType", + "EncryptionStatus", + "EndpointAuthMode", + "EndpointComputeType", + "EndpointProvisioningState", + "EnvironmentType", + "EnvironmentVariableType", + "ExportFormatType", + "FeatureLags", + "FeaturizationMode", + "ForecastHorizonMode", + "ForecastingModels", + "ForecastingPrimaryMetrics", + "Goal", + "IdentityConfigurationType", + "ImageAnnotationType", + "ImageType", + "IncrementalDataRefresh", + "InputDeliveryMode", + "InstanceSegmentationPrimaryMetrics", + "IsolationMode", + "JobInputType", + "JobLimitsType", + "JobOutputType", + "JobProvisioningState", + "JobStatus", + "JobType", + "KeyType", + "LearningRateScheduler", + "ListViewType", + "LoadBalancerType", + "LogVerbosity", + "MLAssistConfigurationType", + "MLFlowAutologgerState", + "ManagedNetworkStatus", + "ManagedServiceIdentityType", + "MediaType", + "MlflowAutologger", + "ModelSize", + "MountAction", + "MountState", + "MultiSelect", + "NCrossValidationsMode", + "Network", + "NlpLearningRateScheduler", + "NodeState", + "NodesValueType", + "ObjectDetectionPrimaryMetrics", + "OperatingSystemType", + "OperationName", + "OperationStatus", + "OperationTrigger", + "OrderString", + "OsType", + "OutputDeliveryMode", + "PrivateEndpointConnectionProvisioningState", + "PrivateEndpointServiceConnectionStatus", + "Protocol", + "ProvisioningState", + "ProvisioningStatus", + "PublicNetworkAccess", + "PublicNetworkAccessType", + "QuotaUnit", + "RandomSamplingAlgorithmRule", + "RecurrenceFrequency", + "ReferenceType", + "RegressionModels", + "RegressionPrimaryMetrics", + "RemoteLoginPortPublicAccess", + "RuleCategory", + "RuleStatus", + "RuleType", + "SamplingAlgorithmType", + "ScaleType", + "ScheduleActionType", + "ScheduleListViewType", + "ScheduleProvisioningState", + "ScheduleProvisioningStatus", + "ScheduleStatus", + "SeasonalityMode", + "SecretsType", + "ServiceDataAccessAuthIdentity", + "ShortSeriesHandlingConfiguration", + "SkuScaleType", + "SkuTier", + "SourceType", + "SparkJobEntryType", + "SshPublicAccess", + "SslConfigStatus", + "StackMetaLearnerType", + "Status", + "StatusMessageLevel", + "StochasticOptimizer", + "StorageAccountType", + "TargetAggregationFunction", + "TargetLagsMode", + "TargetRollingWindowSizeMode", + "TaskType", + "TextAnnotationType", + "TrainingMode", + "TriggerType", + "UnderlyingResourceAction", + "UnitOfMeasure", + "UsageUnit", + "UseStl", + "VMPriceOSType", + "VMTier", + "ValidationMetricType", + "ValueFormat", + "VmPriority", + "VolumeDefinitionType", + "WeekDay", ] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/models/_azure_machine_learning_workspaces_enums.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/models/_azure_machine_learning_workspaces_enums.py index af8639765265..54fc1d7b1aa6 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/models/_azure_machine_learning_workspaces_enums.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/models/_azure_machine_learning_workspaces_enums.py @@ -21,6 +21,7 @@ class AllocationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): STEADY = "Steady" RESIZING = "Resizing" + class ApplicationSharingPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Policy for sharing applications on this compute instance among users of parent workspace. If Personal, only the creator can access applications on this compute instance. When Shared, any @@ -30,9 +31,9 @@ class ApplicationSharingPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): PERSONAL = "Personal" SHARED = "Shared" + class AssetProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Provisioning state of registry asset. - """ + """Provisioning state of registry asset.""" SUCCEEDED = "Succeeded" FAILED = "Failed" @@ -41,21 +42,22 @@ class AssetProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): UPDATING = "Updating" DELETING = "Deleting" + class AutoRebuildSetting(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """AutoRebuild setting for the derived image - """ + """AutoRebuild setting for the derived image""" DISABLED = "Disabled" ON_BASE_IMAGE_UPDATE = "OnBaseImageUpdate" + class Autosave(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Auto save settings. - """ + """Auto save settings.""" NONE = "None" LOCAL = "Local" REMOTE = "Remote" + class BatchLoggingLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Log verbosity for batch inferencing. Increasing verbosity order for logging is : Warning, Info and Debug. @@ -66,22 +68,22 @@ class BatchLoggingLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): WARNING = "Warning" DEBUG = "Debug" + class BatchOutputAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine how batch inferencing will handle output - """ + """Enum to determine how batch inferencing will handle output""" SUMMARY_ONLY = "SummaryOnly" APPEND_ROW = "AppendRow" + class BillingCurrency(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Three lettered code specifying the currency of the VM price. Example: USD - """ + """Three lettered code specifying the currency of the VM price. Example: USD""" USD = "USD" + class BlockedTransformers(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum for all classification models supported by AutoML. - """ + """Enum for all classification models supported by AutoML.""" #: Target encoding for text data. TEXT_TARGET_ENCODER = "TextTargetEncoder" @@ -108,17 +110,17 @@ class BlockedTransformers(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: This is often used for high-cardinality categorical features. HASH_ONE_HOT_ENCODER = "HashOneHotEncoder" + class Caching(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Caching type of Data Disk. - """ + """Caching type of Data Disk.""" NONE = "None" READ_ONLY = "ReadOnly" READ_WRITE = "ReadWrite" + class ClassificationModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum for all classification models supported by AutoML. - """ + """Enum for all classification models supported by AutoML.""" #: Logistic regression is a fundamental classification technique. #: It belongs to the group of linear classifiers and is somewhat similar to polynomial and linear @@ -180,9 +182,11 @@ class ClassificationModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: target column values can be divided into distinct class values. XG_BOOST_CLASSIFIER = "XGBoostClassifier" -class ClassificationMultilabelPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for classification multilabel tasks. - """ + +class ClassificationMultilabelPrimaryMetrics( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """Primary metrics for classification multilabel tasks.""" #: AUC is the Area under the curve. #: This metric represents arithmetic mean of the score for each class, @@ -202,9 +206,11 @@ class ClassificationMultilabelPrimaryMetrics(str, Enum, metaclass=CaseInsensitiv #: Intersection Over Union. Intersection of predictions divided by union of predictions. IOU = "IOU" -class ClassificationPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for classification tasks. - """ + +class ClassificationPrimaryMetrics( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """Primary metrics for classification tasks.""" #: AUC is the Area under the curve. #: This metric represents arithmetic mean of the score for each class, @@ -222,23 +228,25 @@ class ClassificationPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta) #: class. PRECISION_SCORE_WEIGHTED = "PrecisionScoreWeighted" + class ClusterPurpose(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Intended usage of the cluster - """ + """Intended usage of the cluster""" FAST_PROD = "FastProd" DENSE_PROD = "DenseProd" DEV_TEST = "DevTest" -class ComputeInstanceAuthorizationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The Compute Instance Authorization type. Available values are personal (default). - """ + +class ComputeInstanceAuthorizationType( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """The Compute Instance Authorization type. Available values are personal (default).""" PERSONAL = "personal" + class ComputeInstanceState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Current state of an ComputeInstance. - """ + """Current state of an ComputeInstance.""" CREATING = "Creating" CREATE_FAILED = "CreateFailed" @@ -256,16 +264,16 @@ class ComputeInstanceState(str, Enum, metaclass=CaseInsensitiveEnumMeta): UNKNOWN = "Unknown" UNUSABLE = "Unusable" + class ComputePowerAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """[Required] The compute power action. - """ + """[Required] The compute power action.""" START = "Start" STOP = "Stop" + class ComputeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of compute - """ + """The type of compute""" AKS = "AKS" KUBERNETES = "Kubernetes" @@ -278,9 +286,9 @@ class ComputeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): DATA_LAKE_ANALYTICS = "DataLakeAnalytics" SYNAPSE_SPARK = "SynapseSpark" + class ConnectionAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Authentication type of the connection target - """ + """Authentication type of the connection target""" PAT = "PAT" MANAGED_IDENTITY = "ManagedIdentity" @@ -290,9 +298,9 @@ class ConnectionAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): SERVICE_PRINCIPAL = "ServicePrincipal" ACCESS_KEY = "AccessKey" + class ConnectionCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Category of the connection - """ + """Category of the connection""" PYTHON_FEED = "PythonFeed" CONTAINER_REGISTRY = "ContainerRegistry" @@ -307,9 +315,9 @@ class ConnectionCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): AZURE_DATA_LAKE_GEN2 = "AzureDataLakeGen2" REDIS = "Redis" + class ContainerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of container to retrieve logs from. - """ + """The type of container to retrieve logs from.""" #: The container used to download models and score script. STORAGE_INITIALIZER = "StorageInitializer" @@ -318,18 +326,18 @@ class ContainerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: The container used to collect payload and custom logging when mdc is enabled. MODEL_DATA_COLLECTOR = "ModelDataCollector" + class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of identity that created the resource. - """ + """The type of identity that created the resource.""" USER = "User" APPLICATION = "Application" MANAGED_IDENTITY = "ManagedIdentity" KEY = "Key" + class CredentialsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the datastore credentials type. - """ + """Enum to determine the datastore credentials type.""" ACCOUNT_KEY = "AccountKey" CERTIFICATE = "Certificate" @@ -339,9 +347,9 @@ class CredentialsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): KERBEROS_KEYTAB = "KerberosKeytab" KERBEROS_PASSWORD = "KerberosPassword" + class DatastoreType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the datastore contents type. - """ + """Enum to determine the datastore contents type.""" AZURE_BLOB = "AzureBlob" AZURE_DATA_LAKE_GEN1 = "AzureDataLakeGen1" @@ -349,17 +357,19 @@ class DatastoreType(str, Enum, metaclass=CaseInsensitiveEnumMeta): AZURE_FILE = "AzureFile" HDFS = "Hdfs" + class DataType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the type of data. - """ + """Enum to determine the type of data.""" URI_FILE = "uri_file" URI_FOLDER = "uri_folder" MLTABLE = "mltable" -class DeploymentProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Possible values for DeploymentProvisioningState. - """ + +class DeploymentProvisioningState( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """Possible values for DeploymentProvisioningState.""" CREATING = "Creating" DELETING = "Deleting" @@ -369,29 +379,33 @@ class DeploymentProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): FAILED = "Failed" CANCELED = "Canceled" + class DiagnoseResultLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Level of workspace setup error - """ + """Level of workspace setup error""" WARNING = "Warning" ERROR = "Error" INFORMATION = "Information" + class DistributionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the job distribution type. - """ + """Enum to determine the job distribution type.""" PY_TORCH = "PyTorch" TENSOR_FLOW = "TensorFlow" MPI = "Mpi" + class EarlyTerminationPolicyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): BANDIT = "Bandit" MEDIAN_STOPPING = "MedianStopping" TRUNCATION_SELECTION = "TruncationSelection" -class EgressPublicNetworkAccessType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + +class EgressPublicNetworkAccessType( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): """Enum to determine whether PublicNetworkAccess is Enabled or Disabled for egress of a deployment. """ @@ -399,32 +413,32 @@ class EgressPublicNetworkAccessType(str, Enum, metaclass=CaseInsensitiveEnumMeta ENABLED = "Enabled" DISABLED = "Disabled" + class EncryptionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates whether or not the encryption is enabled for the workspace. - """ + """Indicates whether or not the encryption is enabled for the workspace.""" ENABLED = "Enabled" DISABLED = "Disabled" + class EndpointAuthMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine endpoint authentication mode. - """ + """Enum to determine endpoint authentication mode.""" AML_TOKEN = "AMLToken" KEY = "Key" AAD_TOKEN = "AADToken" + class EndpointComputeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine endpoint compute type. - """ + """Enum to determine endpoint compute type.""" MANAGED = "Managed" KUBERNETES = "Kubernetes" AZURE_ML_COMPUTE = "AzureMLCompute" + class EndpointProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """State of endpoint provisioning. - """ + """State of endpoint provisioning.""" CREATING = "Creating" DELETING = "Deleting" @@ -433,39 +447,39 @@ class EndpointProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): UPDATING = "Updating" CANCELED = "Canceled" + class EnvironmentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Environment type is either user created or curated by Azure ML service - """ + """Environment type is either user created or curated by Azure ML service""" CURATED = "Curated" USER_CREATED = "UserCreated" + class EnvironmentVariableType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the Environment Variable. Possible values are: local - For local variable - """ + """Type of the Environment Variable. Possible values are: local - For local variable""" LOCAL = "local" + class ExportFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The format of exported labels. - """ + """The format of exported labels.""" DATASET = "Dataset" COCO = "Coco" CSV = "CSV" + class FeatureLags(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Flag for generating lags for the numeric features. - """ + """Flag for generating lags for the numeric features.""" #: No feature lags generated. NONE = "None" #: System auto-generates feature lags. AUTO = "Auto" + class FeaturizationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Featurization mode - determines data featurization mode. - """ + """Featurization mode - determines data featurization mode.""" #: Auto mode, system performs featurization without any custom featurization inputs. AUTO = "Auto" @@ -474,18 +488,18 @@ class FeaturizationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Featurization off. 'Forecasting' task cannot use this value. OFF = "Off" + class ForecastHorizonMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine forecast horizon selection mode. - """ + """Enum to determine forecast horizon selection mode.""" #: Forecast horizon to be determined automatically. AUTO = "Auto" #: Use the custom forecast horizon. CUSTOM = "Custom" + class ForecastingModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum for all forecasting models supported by AutoML. - """ + """Enum for all forecasting models supported by AutoML.""" #: Auto-Autoregressive Integrated Moving Average (ARIMA) model uses time-series data and #: statistical analysis to interpret the data and make future predictions. @@ -562,9 +576,9 @@ class ForecastingModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: using ensemble of base learners. XG_BOOST_REGRESSOR = "XGBoostRegressor" + class ForecastingPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for Forecasting task. - """ + """Primary metrics for Forecasting task.""" #: The Spearman's rank coefficient of correlation is a non-parametric measure of rank correlation. SPEARMAN_CORRELATION = "SpearmanCorrelation" @@ -578,29 +592,30 @@ class ForecastingPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Error (MAE) of (time) series with different scales. NORMALIZED_MEAN_ABSOLUTE_ERROR = "NormalizedMeanAbsoluteError" + class Goal(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Defines supported metric goals for hyperparameter tuning - """ + """Defines supported metric goals for hyperparameter tuning""" MINIMIZE = "Minimize" MAXIMIZE = "Maximize" + class IdentityConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine identity framework. - """ + """Enum to determine identity framework.""" MANAGED = "Managed" AML_TOKEN = "AMLToken" USER_IDENTITY = "UserIdentity" + class ImageAnnotationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Annotation type of image data. - """ + """Annotation type of image data.""" CLASSIFICATION = "Classification" BOUNDING_BOX = "BoundingBox" INSTANCE_SEGMENTATION = "InstanceSegmentation" + class ImageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of the image. Possible values are: docker - For docker images. azureml - For AzureML images @@ -609,16 +624,16 @@ class ImageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): DOCKER = "docker" AZUREML = "azureml" + class IncrementalDataRefresh(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Whether IncrementalDataRefresh is enabled - """ + """Whether IncrementalDataRefresh is enabled""" ENABLED = "Enabled" DISABLED = "Disabled" + class InputDeliveryMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the input data delivery mode. - """ + """Enum to determine the input data delivery mode.""" READ_ONLY_MOUNT = "ReadOnlyMount" READ_WRITE_MOUNT = "ReadWriteMount" @@ -627,25 +642,27 @@ class InputDeliveryMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): EVAL_MOUNT = "EvalMount" EVAL_DOWNLOAD = "EvalDownload" -class InstanceSegmentationPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for InstanceSegmentation tasks. - """ + +class InstanceSegmentationPrimaryMetrics( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """Primary metrics for InstanceSegmentation tasks.""" #: Mean Average Precision (MAP) is the average of AP (Average Precision). #: AP is calculated for each class and averaged to get the MAP. MEAN_AVERAGE_PRECISION = "MeanAveragePrecision" + class IsolationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Isolation mode for the managed network of a machine learning workspace. - """ + """Isolation mode for the managed network of a machine learning workspace.""" DISABLED = "Disabled" ALLOW_INTERNET_OUTBOUND = "AllowInternetOutbound" ALLOW_ONLY_APPROVED_OUTBOUND = "AllowOnlyApprovedOutbound" + class JobInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the Job Input Type. - """ + """Enum to determine the Job Input Type.""" LITERAL = "literal" URI_FILE = "uri_file" @@ -655,14 +672,15 @@ class JobInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): MLFLOW_MODEL = "mlflow_model" TRITON_MODEL = "triton_model" + class JobLimitsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): COMMAND = "Command" SWEEP = "Sweep" + class JobOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the Job Output Type. - """ + """Enum to determine the Job Output Type.""" URI_FILE = "uri_file" URI_FOLDER = "uri_folder" @@ -671,18 +689,18 @@ class JobOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): MLFLOW_MODEL = "mlflow_model" TRITON_MODEL = "triton_model" + class JobProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the job provisioning state. - """ + """Enum to determine the job provisioning state.""" SUCCEEDED = "Succeeded" FAILED = "Failed" CANCELED = "Canceled" IN_PROGRESS = "InProgress" + class JobStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The status of a job. - """ + """The status of a job.""" #: Run hasn't started yet. NOT_STARTED = "NotStarted" @@ -720,9 +738,9 @@ class JobStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: The job is in a scheduled state. Job is not in any active state. SCHEDULED = "Scheduled" + class JobType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the type of job. - """ + """Enum to determine the type of job.""" AUTO_ML = "AutoML" COMMAND = "Command" @@ -731,14 +749,15 @@ class JobType(str, Enum, metaclass=CaseInsensitiveEnumMeta): PIPELINE = "Pipeline" SPARK = "Spark" + class KeyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): PRIMARY = "Primary" SECONDARY = "Secondary" + class LearningRateScheduler(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Learning rate scheduler enum. - """ + """Learning rate scheduler enum.""" #: No learning rate scheduler selected. NONE = "None" @@ -747,22 +766,23 @@ class LearningRateScheduler(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Step learning rate scheduler. STEP = "Step" + class ListViewType(str, Enum, metaclass=CaseInsensitiveEnumMeta): ACTIVE_ONLY = "ActiveOnly" ARCHIVED_ONLY = "ArchivedOnly" ALL = "All" + class LoadBalancerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Load Balancer Type - """ + """Load Balancer Type""" PUBLIC_IP = "PublicIp" INTERNAL_LOAD_BALANCER = "InternalLoadBalancer" + class LogVerbosity(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum for setting log verbosity. - """ + """Enum for setting log verbosity.""" #: No logs emitted. NOT_SET = "NotSet" @@ -777,13 +797,14 @@ class LogVerbosity(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Only critical statements logged. CRITICAL = "Critical" + class ManagedNetworkStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Status for the managed network of a machine learning workspace. - """ + """Status for the managed network of a machine learning workspace.""" INACTIVE = "Inactive" ACTIVE = "Active" + class ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). @@ -794,35 +815,36 @@ class ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): USER_ASSIGNED = "UserAssigned" SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" + class MediaType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Media type of data asset. - """ + """Media type of data asset.""" IMAGE = "Image" TEXT = "Text" + class MLAssistConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): ENABLED = "Enabled" DISABLED = "Disabled" + class MlflowAutologger(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates whether mlflow autologger is enabled for notebooks. - """ + """Indicates whether mlflow autologger is enabled for notebooks.""" ENABLED = "Enabled" DISABLED = "Disabled" + class MLFlowAutologgerState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the state of mlflow autologger. - """ + """Enum to determine the state of mlflow autologger.""" ENABLED = "Enabled" DISABLED = "Disabled" + class ModelSize(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Image model size. - """ + """Image model size.""" #: No value selected. NONE = "None" @@ -835,16 +857,16 @@ class ModelSize(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Extra large size. EXTRA_LARGE = "ExtraLarge" + class MountAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Mount Action. - """ + """Mount Action.""" MOUNT = "Mount" UNMOUNT = "Unmount" + class MountState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Mount state. - """ + """Mount state.""" MOUNT_REQUESTED = "MountRequested" MOUNTED = "Mounted" @@ -853,16 +875,16 @@ class MountState(str, Enum, metaclass=CaseInsensitiveEnumMeta): UNMOUNT_FAILED = "UnmountFailed" UNMOUNTED = "Unmounted" + class MultiSelect(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Whether multiSelect is enabled - """ + """Whether multiSelect is enabled""" ENABLED = "Enabled" DISABLED = "Disabled" + class NCrossValidationsMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Determines how N-Cross validations value is determined. - """ + """Determines how N-Cross validations value is determined.""" #: Determine N-Cross validations value automatically. Supported only for 'Forecasting' AutoML #: task. @@ -870,16 +892,16 @@ class NCrossValidationsMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Use custom N-Cross validations value. CUSTOM = "Custom" + class Network(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """network of this container. - """ + """network of this container.""" BRIDGE = "Bridge" HOST = "Host" + class NlpLearningRateScheduler(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum of learning rate schedulers that aligns with those supported by HF - """ + """Enum of learning rate schedulers that aligns with those supported by HF""" #: No learning rate schedule. NONE = "None" @@ -896,6 +918,7 @@ class NlpLearningRateScheduler(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Linear warmup followed by constant value. CONSTANT_WITH_WARMUP = "ConstantWithWarmup" + class NodeState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """State of the compute node. Values are idle, running, preparing, unusable, leaving and preempted. @@ -908,31 +931,33 @@ class NodeState(str, Enum, metaclass=CaseInsensitiveEnumMeta): LEAVING = "leaving" PREEMPTED = "preempted" + class NodesValueType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The enumerated types for the nodes value - """ + """The enumerated types for the nodes value""" ALL = "All" CUSTOM = "Custom" -class ObjectDetectionPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for Image ObjectDetection task. - """ + +class ObjectDetectionPrimaryMetrics( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """Primary metrics for Image ObjectDetection task.""" #: Mean Average Precision (MAP) is the average of AP (Average Precision). #: AP is calculated for each class and averaged to get the MAP. MEAN_AVERAGE_PRECISION = "MeanAveragePrecision" + class OperatingSystemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of operating system. - """ + """The type of operating system.""" LINUX = "Linux" WINDOWS = "Windows" + class OperationName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Name of the last operation. - """ + """Name of the last operation.""" CREATE = "Create" START = "Start" @@ -941,9 +966,9 @@ class OperationName(str, Enum, metaclass=CaseInsensitiveEnumMeta): REIMAGE = "Reimage" DELETE = "Delete" + class OperationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Operation status. - """ + """Operation status.""" IN_PROGRESS = "InProgress" SUCCEEDED = "Succeeded" @@ -954,14 +979,15 @@ class OperationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): REIMAGE_FAILED = "ReimageFailed" DELETE_FAILED = "DeleteFailed" + class OperationTrigger(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Trigger of operation. - """ + """Trigger of operation.""" USER = "User" SCHEDULE = "Schedule" IDLE_SHUTDOWN = "IdleShutdown" + class OrderString(str, Enum, metaclass=CaseInsensitiveEnumMeta): CREATED_AT_DESC = "CreatedAtDesc" @@ -969,33 +995,37 @@ class OrderString(str, Enum, metaclass=CaseInsensitiveEnumMeta): UPDATED_AT_DESC = "UpdatedAtDesc" UPDATED_AT_ASC = "UpdatedAtAsc" + class OsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Compute OS Type - """ + """Compute OS Type""" LINUX = "Linux" WINDOWS = "Windows" + class OutputDeliveryMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Output data delivery mode enums. - """ + """Output data delivery mode enums.""" READ_WRITE_MOUNT = "ReadWriteMount" UPLOAD = "Upload" DIRECT = "Direct" -class PrivateEndpointConnectionProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The current provisioning state. - """ + +class PrivateEndpointConnectionProvisioningState( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """The current provisioning state.""" SUCCEEDED = "Succeeded" CREATING = "Creating" DELETING = "Deleting" FAILED = "Failed" -class PrivateEndpointServiceConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The private endpoint connection status. - """ + +class PrivateEndpointServiceConnectionStatus( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """The private endpoint connection status.""" PENDING = "Pending" APPROVED = "Approved" @@ -1003,14 +1033,15 @@ class PrivateEndpointServiceConnectionStatus(str, Enum, metaclass=CaseInsensitiv DISCONNECTED = "Disconnected" TIMEOUT = "Timeout" + class Protocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Protocol over which communication will happen over this endpoint - """ + """Protocol over which communication will happen over this endpoint""" TCP = "tcp" UDP = "udp" HTTP = "http" + class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The current deployment state of workspace resource. The provisioningState is to indicate states for resource provisioning. @@ -1025,44 +1056,46 @@ class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): CANCELED = "Canceled" SOFT_DELETED = "SoftDeleted" + class ProvisioningStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The current deployment state of schedule. - """ + """The current deployment state of schedule.""" COMPLETED = "Completed" PROVISIONING = "Provisioning" FAILED = "Failed" + class PublicNetworkAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Whether requests from Public Network are allowed. - """ + """Whether requests from Public Network are allowed.""" ENABLED = "Enabled" DISABLED = "Disabled" + class PublicNetworkAccessType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine whether PublicNetworkAccess is Enabled or Disabled. - """ + """Enum to determine whether PublicNetworkAccess is Enabled or Disabled.""" ENABLED = "Enabled" DISABLED = "Disabled" + class QuotaUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """An enum describing the unit of quota measurement. - """ + """An enum describing the unit of quota measurement.""" COUNT = "Count" -class RandomSamplingAlgorithmRule(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The specific type of random algorithm - """ + +class RandomSamplingAlgorithmRule( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """The specific type of random algorithm""" RANDOM = "Random" SOBOL = "Sobol" + class RecurrenceFrequency(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to describe the frequency of a recurrence schedule - """ + """Enum to describe the frequency of a recurrence schedule""" #: Minute frequency. MINUTE = "Minute" @@ -1075,17 +1108,17 @@ class RecurrenceFrequency(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Month frequency. MONTH = "Month" + class ReferenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine which reference method to use for an asset. - """ + """Enum to determine which reference method to use for an asset.""" ID = "Id" DATA_PATH = "DataPath" OUTPUT_PATH = "OutputPath" + class RegressionModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum for all Regression models supported by AutoML. - """ + """Enum for all Regression models supported by AutoML.""" #: Elastic net is a popular type of regularized linear regression that combines two popular #: penalties, specifically the L1 and L2 penalty functions. @@ -1127,9 +1160,9 @@ class RegressionModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: using ensemble of base learners. XG_BOOST_REGRESSOR = "XGBoostRegressor" + class RegressionPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for Regression task. - """ + """Primary metrics for Regression task.""" #: The Spearman's rank coefficient of correlation is a nonparametric measure of rank correlation. SPEARMAN_CORRELATION = "SpearmanCorrelation" @@ -1143,7 +1176,10 @@ class RegressionPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Error (MAE) of (time) series with different scales. NORMALIZED_MEAN_ABSOLUTE_ERROR = "NormalizedMeanAbsoluteError" -class RemoteLoginPortPublicAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): + +class RemoteLoginPortPublicAccess( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): """State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - Indicates that the public ssh port is closed @@ -1156,59 +1192,64 @@ class RemoteLoginPortPublicAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): DISABLED = "Disabled" NOT_SPECIFIED = "NotSpecified" + class RuleCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Category of a managed network Outbound Rule of a machine learning workspace. - """ + """Category of a managed network Outbound Rule of a machine learning workspace.""" REQUIRED = "Required" RECOMMENDED = "Recommended" USER_DEFINED = "UserDefined" + class RuleStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Status of a managed network Outbound Rule of a machine learning workspace. - """ + """Status of a managed network Outbound Rule of a machine learning workspace.""" INACTIVE = "Inactive" ACTIVE = "Active" + class RuleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of a managed network Outbound Rule of a machine learning workspace. - """ + """Type of a managed network Outbound Rule of a machine learning workspace.""" FQDN = "FQDN" PRIVATE_ENDPOINT = "PrivateEndpoint" SERVICE_TAG = "ServiceTag" + class SamplingAlgorithmType(str, Enum, metaclass=CaseInsensitiveEnumMeta): GRID = "Grid" RANDOM = "Random" BAYESIAN = "Bayesian" + class ScaleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): DEFAULT = "Default" TARGET_UTILIZATION = "TargetUtilization" + class ScheduleActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): CREATE_JOB = "CreateJob" INVOKE_BATCH_ENDPOINT = "InvokeBatchEndpoint" + class ScheduleListViewType(str, Enum, metaclass=CaseInsensitiveEnumMeta): ENABLED_ONLY = "EnabledOnly" DISABLED_ONLY = "DisabledOnly" ALL = "All" + class ScheduleProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The current deployment state of schedule. - """ + """The current deployment state of schedule.""" COMPLETED = "Completed" PROVISIONING = "Provisioning" FAILED = "Failed" + class ScheduleProvisioningStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): CREATING = "Creating" @@ -1218,25 +1259,25 @@ class ScheduleProvisioningStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): FAILED = "Failed" CANCELED = "Canceled" + class ScheduleStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Is the schedule enabled or disabled? - """ + """Is the schedule enabled or disabled?""" ENABLED = "Enabled" DISABLED = "Disabled" + class SeasonalityMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Forecasting seasonality mode. - """ + """Forecasting seasonality mode.""" #: Seasonality to be determined automatically. AUTO = "Auto" #: Use the custom seasonality value. CUSTOM = "Custom" + class SecretsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the datastore secrets type. - """ + """Enum to determine the datastore secrets type.""" ACCOUNT_KEY = "AccountKey" CERTIFICATE = "Certificate" @@ -1245,7 +1286,10 @@ class SecretsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): KERBEROS_PASSWORD = "KerberosPassword" KERBEROS_KEYTAB = "KerberosKeytab" -class ServiceDataAccessAuthIdentity(str, Enum, metaclass=CaseInsensitiveEnumMeta): + +class ServiceDataAccessAuthIdentity( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): #: Do not use any identity for service data access. NONE = "None" @@ -1254,9 +1298,11 @@ class ServiceDataAccessAuthIdentity(str, Enum, metaclass=CaseInsensitiveEnumMeta #: Use the user assigned managed identity of the Workspace to authenticate service data access. WORKSPACE_USER_ASSIGNED_IDENTITY = "WorkspaceUserAssignedIdentity" -class ShortSeriesHandlingConfiguration(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The parameter defining how if AutoML should handle short time series. - """ + +class ShortSeriesHandlingConfiguration( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """The parameter defining how if AutoML should handle short time series.""" #: Represents no/null value. NONE = "None" @@ -1268,9 +1314,9 @@ class ShortSeriesHandlingConfiguration(str, Enum, metaclass=CaseInsensitiveEnumM #: All the short series will be dropped. DROP = "Drop" + class SkuScaleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Node scaling setting for the compute sku. - """ + """Node scaling setting for the compute sku.""" #: Automatically scales node count. AUTOMATIC = "Automatic" @@ -1279,6 +1325,7 @@ class SkuScaleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Fixed set of nodes. NONE = "None" + class SkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): """This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT. @@ -1289,19 +1336,21 @@ class SkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): STANDARD = "Standard" PREMIUM = "Premium" + class SourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Data source type. - """ + """Data source type.""" DATASET = "Dataset" DATASTORE = "Datastore" URI = "URI" + class SparkJobEntryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): SPARK_JOB_PYTHON_ENTRY = "SparkJobPythonEntry" SPARK_JOB_SCALA_ENTRY = "SparkJobScalaEntry" + class SshPublicAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): """State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the public ssh port is open and @@ -1311,14 +1360,15 @@ class SshPublicAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): ENABLED = "Enabled" DISABLED = "Disabled" + class SslConfigStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enable or disable ssl for scoring - """ + """Enable or disable ssl for scoring""" DISABLED = "Disabled" ENABLED = "Enabled" AUTO = "Auto" + class StackMetaLearnerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The meta-learner is a model trained on the output of the individual heterogeneous models. Default meta-learners are LogisticRegression for classification tasks (or LogisticRegressionCV @@ -1341,28 +1391,31 @@ class StackMetaLearnerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): LIGHT_GBM_REGRESSOR = "LightGBMRegressor" LINEAR_REGRESSION = "LinearRegression" + class Status(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Status of update workspace quota. - """ + """Status of update workspace quota.""" UNDEFINED = "Undefined" SUCCESS = "Success" FAILURE = "Failure" INVALID_QUOTA_BELOW_CLUSTER_MINIMUM = "InvalidQuotaBelowClusterMinimum" - INVALID_QUOTA_EXCEEDS_SUBSCRIPTION_LIMIT = "InvalidQuotaExceedsSubscriptionLimit" + INVALID_QUOTA_EXCEEDS_SUBSCRIPTION_LIMIT = ( + "InvalidQuotaExceedsSubscriptionLimit" + ) INVALID_VM_FAMILY_NAME = "InvalidVMFamilyName" OPERATION_NOT_SUPPORTED_FOR_SKU = "OperationNotSupportedForSku" OPERATION_NOT_ENABLED_FOR_REGION = "OperationNotEnabledForRegion" + class StatusMessageLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): ERROR = "Error" INFORMATION = "Information" WARNING = "Warning" + class StochasticOptimizer(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Stochastic optimizer for image models. - """ + """Stochastic optimizer for image models.""" #: No optimizer selected. NONE = "None" @@ -1374,16 +1427,16 @@ class StochasticOptimizer(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: AdamW is a variant of the optimizer Adam that has an improved implementation of weight decay. ADAMW = "Adamw" + class StorageAccountType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """type of this storage account. - """ + """type of this storage account.""" STANDARD_LRS = "Standard_LRS" PREMIUM_LRS = "Premium_LRS" + class TargetAggregationFunction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Target aggregate function. - """ + """Target aggregate function.""" #: Represent no value set. NONE = "None" @@ -1392,27 +1445,29 @@ class TargetAggregationFunction(str, Enum, metaclass=CaseInsensitiveEnumMeta): MIN = "Min" MEAN = "Mean" + class TargetLagsMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Target lags selection modes. - """ + """Target lags selection modes.""" #: Target lags to be determined automatically. AUTO = "Auto" #: Use the custom target lags. CUSTOM = "Custom" -class TargetRollingWindowSizeMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Target rolling windows size mode. - """ + +class TargetRollingWindowSizeMode( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """Target rolling windows size mode.""" #: Determine rolling windows size automatically. AUTO = "Auto" #: Use the specified rolling window size. CUSTOM = "Custom" + class TaskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """AutoMLJob Task type. - """ + """AutoMLJob Task type.""" #: Classification in machine learning and statistics is a supervised learning approach in which #: the computer program learns from the data given to it and make new observations or @@ -1453,16 +1508,16 @@ class TaskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: occurrences of entities such as people, locations, organizations, and more. TEXT_NER = "TextNER" + class TextAnnotationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Annotation type of text data. - """ + """Annotation type of text data.""" CLASSIFICATION = "Classification" NAMED_ENTITY_RECOGNITION = "NamedEntityRecognition" + class TrainingMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Training mode dictates whether to use distributed training or not - """ + """Training mode dictates whether to use distributed training or not""" #: Auto mode. AUTO = "Auto" @@ -1471,40 +1526,42 @@ class TrainingMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Non distributed training mode. NON_DISTRIBUTED = "NonDistributed" + class TriggerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): RECURRENCE = "Recurrence" CRON = "Cron" + class UnderlyingResourceAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): DELETE = "Delete" DETACH = "Detach" + class UnitOfMeasure(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The unit of time measurement for the specified VM price. Example: OneHour - """ + """The unit of time measurement for the specified VM price. Example: OneHour""" ONE_HOUR = "OneHour" + class UsageUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """An enum describing the unit of usage measurement. - """ + """An enum describing the unit of usage measurement.""" COUNT = "Count" + class UseStl(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Configure STL Decomposition of the time-series target column. - """ + """Configure STL Decomposition of the time-series target column.""" #: No stl decomposition. NONE = "None" SEASON = "Season" SEASON_TREND = "SeasonTrend" + class ValidationMetricType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Metric computation method to use for validation metrics in image tasks. - """ + """Metric computation method to use for validation metrics in image tasks.""" #: No metric. NONE = "None" @@ -1515,46 +1572,46 @@ class ValidationMetricType(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: CocoVoc metric. COCO_VOC = "CocoVoc" + class ValueFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """format for the workspace connection value - """ + """format for the workspace connection value""" JSON = "JSON" + class VMPriceOSType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Operating system type used by the VM. - """ + """Operating system type used by the VM.""" LINUX = "Linux" WINDOWS = "Windows" + class VmPriority(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Virtual Machine priority - """ + """Virtual Machine priority""" DEDICATED = "Dedicated" LOW_PRIORITY = "LowPriority" + class VMTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of the VM. - """ + """The type of the VM.""" STANDARD = "Standard" LOW_PRIORITY = "LowPriority" SPOT = "Spot" + class VolumeDefinitionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe - """ + """Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe""" BIND = "bind" VOLUME = "volume" TMPFS = "tmpfs" NPIPE = "npipe" + class WeekDay(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum of weekday - """ + """Enum of weekday""" #: Monday weekday. MONDAY = "Monday" diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/models/_models.py index ee6cd0648ca6..bce4efbc4776 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/models/_models.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/models/_models.py @@ -35,25 +35,30 @@ class WorkspaceConnectionPropertiesV2(msrest.serialization.Model): """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, } _subtype_map = { - 'auth_type': {'AccessKey': 'AccessKeyAuthTypeWorkspaceConnectionProperties', 'ManagedIdentity': 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', 'None': 'NoneAuthTypeWorkspaceConnectionProperties', 'PAT': 'PATAuthTypeWorkspaceConnectionProperties', 'SAS': 'SASAuthTypeWorkspaceConnectionProperties', 'ServicePrincipal': 'ServicePrincipalAuthTypeWorkspaceConnectionProperties', 'UsernamePassword': 'UsernamePasswordAuthTypeWorkspaceConnectionProperties'} + "auth_type": { + "AccessKey": "AccessKeyAuthTypeWorkspaceConnectionProperties", + "ManagedIdentity": "ManagedIdentityAuthTypeWorkspaceConnectionProperties", + "None": "NoneAuthTypeWorkspaceConnectionProperties", + "PAT": "PATAuthTypeWorkspaceConnectionProperties", + "SAS": "SASAuthTypeWorkspaceConnectionProperties", + "ServicePrincipal": "ServicePrincipalAuthTypeWorkspaceConnectionProperties", + "UsernamePassword": "UsernamePasswordAuthTypeWorkspaceConnectionProperties", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: Category of the connection. Possible values include: "PythonFeed", "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", @@ -69,13 +74,15 @@ def __init__( """ super(WorkspaceConnectionPropertiesV2, self).__init__(**kwargs) self.auth_type = None # type: Optional[str] - self.category = kwargs.get('category', None) - self.target = kwargs.get('target', None) - self.value = kwargs.get('value', None) - self.value_format = kwargs.get('value_format', None) + self.category = kwargs.get("category", None) + self.target = kwargs.get("target", None) + self.value = kwargs.get("value", None) + self.value_format = kwargs.get("value_format", None) -class AccessKeyAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class AccessKeyAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """AccessKeyAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -99,22 +106,22 @@ class AccessKeyAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionProperti """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionAccessKey'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionAccessKey", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: Category of the connection. Possible values include: "PythonFeed", "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", @@ -130,9 +137,11 @@ def __init__( :keyword credentials: :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccessKey """ - super(AccessKeyAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'AccessKey' # type: str - self.credentials = kwargs.get('credentials', None) + super(AccessKeyAuthTypeWorkspaceConnectionProperties, self).__init__( + **kwargs + ) + self.auth_type = "AccessKey" # type: str + self.credentials = kwargs.get("credentials", None) class DatastoreCredentials(msrest.serialization.Model): @@ -150,23 +159,27 @@ class DatastoreCredentials(msrest.serialization.Model): """ _validation = { - 'credentials_type': {'required': True}, + "credentials_type": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, } _subtype_map = { - 'credentials_type': {'AccountKey': 'AccountKeyDatastoreCredentials', 'Certificate': 'CertificateDatastoreCredentials', 'KerberosKeytab': 'KerberosKeytabCredentials', 'KerberosPassword': 'KerberosPasswordCredentials', 'None': 'NoneDatastoreCredentials', 'Sas': 'SasDatastoreCredentials', 'ServicePrincipal': 'ServicePrincipalDatastoreCredentials'} - } - - def __init__( - self, - **kwargs - ): - """ - """ + "credentials_type": { + "AccountKey": "AccountKeyDatastoreCredentials", + "Certificate": "CertificateDatastoreCredentials", + "KerberosKeytab": "KerberosKeytabCredentials", + "KerberosPassword": "KerberosPasswordCredentials", + "None": "NoneDatastoreCredentials", + "Sas": "SasDatastoreCredentials", + "ServicePrincipal": "ServicePrincipalDatastoreCredentials", + } + } + + def __init__(self, **kwargs): + """ """ super(DatastoreCredentials, self).__init__(**kwargs) self.credentials_type = None # type: Optional[str] @@ -185,26 +198,23 @@ class AccountKeyDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, + "credentials_type": {"required": True}, + "secrets": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'AccountKeyDatastoreSecrets'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "secrets": {"key": "secrets", "type": "AccountKeyDatastoreSecrets"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword secrets: Required. [Required] Storage account secrets. :paramtype secrets: ~azure.mgmt.machinelearningservices.models.AccountKeyDatastoreSecrets """ super(AccountKeyDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'AccountKey' # type: str - self.secrets = kwargs['secrets'] + self.credentials_type = "AccountKey" # type: str + self.secrets = kwargs["secrets"] class DatastoreSecrets(msrest.serialization.Model): @@ -222,23 +232,26 @@ class DatastoreSecrets(msrest.serialization.Model): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, } _subtype_map = { - 'secrets_type': {'AccountKey': 'AccountKeyDatastoreSecrets', 'Certificate': 'CertificateDatastoreSecrets', 'KerberosKeytab': 'KerberosKeytabSecrets', 'KerberosPassword': 'KerberosPasswordSecrets', 'Sas': 'SasDatastoreSecrets', 'ServicePrincipal': 'ServicePrincipalDatastoreSecrets'} - } - - def __init__( - self, - **kwargs - ): - """ - """ + "secrets_type": { + "AccountKey": "AccountKeyDatastoreSecrets", + "Certificate": "CertificateDatastoreSecrets", + "KerberosKeytab": "KerberosKeytabSecrets", + "KerberosPassword": "KerberosPasswordSecrets", + "Sas": "SasDatastoreSecrets", + "ServicePrincipal": "ServicePrincipalDatastoreSecrets", + } + } + + def __init__(self, **kwargs): + """ """ super(DatastoreSecrets, self).__init__(**kwargs) self.secrets_type = None # type: Optional[str] @@ -257,25 +270,22 @@ class AccountKeyDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "key": {"key": "key", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword key: Storage account key. :paramtype key: str """ super(AccountKeyDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'AccountKey' # type: str - self.key = kwargs.get('key', None) + self.secrets_type = "AccountKey" # type: str + self.key = kwargs.get("key", None) class AcrDetails(msrest.serialization.Model): @@ -290,14 +300,17 @@ class AcrDetails(msrest.serialization.Model): """ _attribute_map = { - 'system_created_acr_account': {'key': 'systemCreatedAcrAccount', 'type': 'SystemCreatedAcrAccount'}, - 'user_created_acr_account': {'key': 'userCreatedAcrAccount', 'type': 'UserCreatedAcrAccount'}, + "system_created_acr_account": { + "key": "systemCreatedAcrAccount", + "type": "SystemCreatedAcrAccount", + }, + "user_created_acr_account": { + "key": "userCreatedAcrAccount", + "type": "UserCreatedAcrAccount", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword system_created_acr_account: :paramtype system_created_acr_account: @@ -307,8 +320,12 @@ def __init__( ~azure.mgmt.machinelearningservices.models.UserCreatedAcrAccount """ super(AcrDetails, self).__init__(**kwargs) - self.system_created_acr_account = kwargs.get('system_created_acr_account', None) - self.user_created_acr_account = kwargs.get('user_created_acr_account', None) + self.system_created_acr_account = kwargs.get( + "system_created_acr_account", None + ) + self.user_created_acr_account = kwargs.get( + "user_created_acr_account", None + ) class AKSSchema(msrest.serialization.Model): @@ -319,19 +336,16 @@ class AKSSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, + "properties": {"key": "properties", "type": "AKSSchemaProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: AKS properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties """ super(AKSSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class Compute(msrest.serialization.Model): @@ -374,35 +388,46 @@ class Compute(msrest.serialization.Model): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } _subtype_map = { - 'compute_type': {'AKS': 'AKS', 'AmlCompute': 'AmlCompute', 'ComputeInstance': 'ComputeInstance', 'DataFactory': 'DataFactory', 'DataLakeAnalytics': 'DataLakeAnalytics', 'Databricks': 'Databricks', 'HDInsight': 'HDInsight', 'Kubernetes': 'Kubernetes', 'SynapseSpark': 'SynapseSpark', 'VirtualMachine': 'VirtualMachine'} - } - - def __init__( - self, - **kwargs - ): + "compute_type": { + "AKS": "AKS", + "AmlCompute": "AmlCompute", + "ComputeInstance": "ComputeInstance", + "DataFactory": "DataFactory", + "DataLakeAnalytics": "DataLakeAnalytics", + "Databricks": "Databricks", + "HDInsight": "HDInsight", + "Kubernetes": "Kubernetes", + "SynapseSpark": "SynapseSpark", + "VirtualMachine": "VirtualMachine", + } + } + + def __init__(self, **kwargs): """ :keyword compute_location: Location for the underlying compute. :paramtype compute_location: str @@ -416,15 +441,15 @@ def __init__( """ super(Compute, self).__init__(**kwargs) self.compute_type = None # type: Optional[str] - self.compute_location = kwargs.get('compute_location', None) + self.compute_location = kwargs.get("compute_location", None) self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) + self.disable_local_auth = kwargs.get("disable_local_auth", None) class AKS(Compute, AKSSchema): @@ -466,32 +491,32 @@ class AKS(Compute, AKSSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "AKSSchemaProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: AKS properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties @@ -506,17 +531,17 @@ def __init__( :paramtype disable_local_auth: bool """ super(AKS, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'AKS' # type: str - self.compute_location = kwargs.get('compute_location', None) + self.properties = kwargs.get("properties", None) + self.compute_type = "AKS" # type: str + self.compute_location = kwargs.get("compute_location", None) self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) + self.disable_local_auth = kwargs.get("disable_local_auth", None) class AksComputeSecretsProperties(msrest.serialization.Model): @@ -533,15 +558,15 @@ class AksComputeSecretsProperties(msrest.serialization.Model): """ _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, + "user_kube_config": {"key": "userKubeConfig", "type": "str"}, + "admin_kube_config": {"key": "adminKubeConfig", "type": "str"}, + "image_pull_secret_name": { + "key": "imagePullSecretName", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword user_kube_config: Content of kubeconfig file that can be used to connect to the Kubernetes cluster. @@ -553,9 +578,11 @@ def __init__( :paramtype image_pull_secret_name: str """ super(AksComputeSecretsProperties, self).__init__(**kwargs) - self.user_kube_config = kwargs.get('user_kube_config', None) - self.admin_kube_config = kwargs.get('admin_kube_config', None) - self.image_pull_secret_name = kwargs.get('image_pull_secret_name', None) + self.user_kube_config = kwargs.get("user_kube_config", None) + self.admin_kube_config = kwargs.get("admin_kube_config", None) + self.image_pull_secret_name = kwargs.get( + "image_pull_secret_name", None + ) class ComputeSecrets(msrest.serialization.Model): @@ -573,23 +600,23 @@ class ComputeSecrets(msrest.serialization.Model): """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "compute_type": {"key": "computeType", "type": "str"}, } _subtype_map = { - 'compute_type': {'AKS': 'AksComputeSecrets', 'Databricks': 'DatabricksComputeSecrets', 'VirtualMachine': 'VirtualMachineSecrets'} + "compute_type": { + "AKS": "AksComputeSecrets", + "Databricks": "DatabricksComputeSecrets", + "VirtualMachine": "VirtualMachineSecrets", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ComputeSecrets, self).__init__(**kwargs) self.compute_type = None # type: Optional[str] @@ -614,20 +641,20 @@ class AksComputeSecrets(ComputeSecrets, AksComputeSecretsProperties): """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "user_kube_config": {"key": "userKubeConfig", "type": "str"}, + "admin_kube_config": {"key": "adminKubeConfig", "type": "str"}, + "image_pull_secret_name": { + "key": "imagePullSecretName", + "type": "str", + }, + "compute_type": {"key": "computeType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword user_kube_config: Content of kubeconfig file that can be used to connect to the Kubernetes cluster. @@ -639,10 +666,12 @@ def __init__( :paramtype image_pull_secret_name: str """ super(AksComputeSecrets, self).__init__(**kwargs) - self.user_kube_config = kwargs.get('user_kube_config', None) - self.admin_kube_config = kwargs.get('admin_kube_config', None) - self.image_pull_secret_name = kwargs.get('image_pull_secret_name', None) - self.compute_type = 'AKS' # type: str + self.user_kube_config = kwargs.get("user_kube_config", None) + self.admin_kube_config = kwargs.get("admin_kube_config", None) + self.image_pull_secret_name = kwargs.get( + "image_pull_secret_name", None + ) + self.compute_type = "AKS" # type: str class AksNetworkingConfiguration(msrest.serialization.Model): @@ -662,22 +691,25 @@ class AksNetworkingConfiguration(msrest.serialization.Model): """ _validation = { - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, + "service_cidr": { + "pattern": r"^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$" + }, + "dns_service_ip": { + "pattern": r"^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" + }, + "docker_bridge_cidr": { + "pattern": r"^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$" + }, } _attribute_map = { - 'subnet_id': {'key': 'subnetId', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, + "subnet_id": {"key": "subnetId", "type": "str"}, + "service_cidr": {"key": "serviceCidr", "type": "str"}, + "dns_service_ip": {"key": "dnsServiceIP", "type": "str"}, + "docker_bridge_cidr": {"key": "dockerBridgeCidr", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword subnet_id: Virtual network subnet resource ID the compute nodes belong to. :paramtype subnet_id: str @@ -692,10 +724,10 @@ def __init__( :paramtype docker_bridge_cidr: str """ super(AksNetworkingConfiguration, self).__init__(**kwargs) - self.subnet_id = kwargs.get('subnet_id', None) - self.service_cidr = kwargs.get('service_cidr', None) - self.dns_service_ip = kwargs.get('dns_service_ip', None) - self.docker_bridge_cidr = kwargs.get('docker_bridge_cidr', None) + self.subnet_id = kwargs.get("subnet_id", None) + self.service_cidr = kwargs.get("service_cidr", None) + self.dns_service_ip = kwargs.get("dns_service_ip", None) + self.docker_bridge_cidr = kwargs.get("docker_bridge_cidr", None) class AKSSchemaProperties(msrest.serialization.Model): @@ -727,26 +759,32 @@ class AKSSchemaProperties(msrest.serialization.Model): """ _validation = { - 'system_services': {'readonly': True}, - 'agent_count': {'minimum': 0}, + "system_services": {"readonly": True}, + "agent_count": {"minimum": 0}, } _attribute_map = { - 'cluster_fqdn': {'key': 'clusterFqdn', 'type': 'str'}, - 'system_services': {'key': 'systemServices', 'type': '[SystemService]'}, - 'agent_count': {'key': 'agentCount', 'type': 'int'}, - 'agent_vm_size': {'key': 'agentVmSize', 'type': 'str'}, - 'cluster_purpose': {'key': 'clusterPurpose', 'type': 'str'}, - 'ssl_configuration': {'key': 'sslConfiguration', 'type': 'SslConfiguration'}, - 'aks_networking_configuration': {'key': 'aksNetworkingConfiguration', 'type': 'AksNetworkingConfiguration'}, - 'load_balancer_type': {'key': 'loadBalancerType', 'type': 'str'}, - 'load_balancer_subnet': {'key': 'loadBalancerSubnet', 'type': 'str'}, + "cluster_fqdn": {"key": "clusterFqdn", "type": "str"}, + "system_services": { + "key": "systemServices", + "type": "[SystemService]", + }, + "agent_count": {"key": "agentCount", "type": "int"}, + "agent_vm_size": {"key": "agentVmSize", "type": "str"}, + "cluster_purpose": {"key": "clusterPurpose", "type": "str"}, + "ssl_configuration": { + "key": "sslConfiguration", + "type": "SslConfiguration", + }, + "aks_networking_configuration": { + "key": "aksNetworkingConfiguration", + "type": "AksNetworkingConfiguration", + }, + "load_balancer_type": {"key": "loadBalancerType", "type": "str"}, + "load_balancer_subnet": {"key": "loadBalancerSubnet", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword cluster_fqdn: Cluster full qualified domain name. :paramtype cluster_fqdn: str @@ -770,15 +808,17 @@ def __init__( :paramtype load_balancer_subnet: str """ super(AKSSchemaProperties, self).__init__(**kwargs) - self.cluster_fqdn = kwargs.get('cluster_fqdn', None) + self.cluster_fqdn = kwargs.get("cluster_fqdn", None) self.system_services = None - self.agent_count = kwargs.get('agent_count', None) - self.agent_vm_size = kwargs.get('agent_vm_size', None) - self.cluster_purpose = kwargs.get('cluster_purpose', "FastProd") - self.ssl_configuration = kwargs.get('ssl_configuration', None) - self.aks_networking_configuration = kwargs.get('aks_networking_configuration', None) - self.load_balancer_type = kwargs.get('load_balancer_type', "PublicIp") - self.load_balancer_subnet = kwargs.get('load_balancer_subnet', None) + self.agent_count = kwargs.get("agent_count", None) + self.agent_vm_size = kwargs.get("agent_vm_size", None) + self.cluster_purpose = kwargs.get("cluster_purpose", "FastProd") + self.ssl_configuration = kwargs.get("ssl_configuration", None) + self.aks_networking_configuration = kwargs.get( + "aks_networking_configuration", None + ) + self.load_balancer_type = kwargs.get("load_balancer_type", "PublicIp") + self.load_balancer_subnet = kwargs.get("load_balancer_subnet", None) class Nodes(msrest.serialization.Model): @@ -795,23 +835,17 @@ class Nodes(msrest.serialization.Model): """ _validation = { - 'nodes_value_type': {'required': True}, + "nodes_value_type": {"required": True}, } _attribute_map = { - 'nodes_value_type': {'key': 'nodesValueType', 'type': 'str'}, + "nodes_value_type": {"key": "nodesValueType", "type": "str"}, } - _subtype_map = { - 'nodes_value_type': {'All': 'AllNodes'} - } + _subtype_map = {"nodes_value_type": {"All": "AllNodes"}} - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Nodes, self).__init__(**kwargs) self.nodes_value_type = None # type: Optional[str] @@ -827,21 +861,17 @@ class AllNodes(Nodes): """ _validation = { - 'nodes_value_type': {'required': True}, + "nodes_value_type": {"required": True}, } _attribute_map = { - 'nodes_value_type': {'key': 'nodesValueType', 'type': 'str'}, + "nodes_value_type": {"key": "nodesValueType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AllNodes, self).__init__(**kwargs) - self.nodes_value_type = 'All' # type: str + self.nodes_value_type = "All" # type: str class AmlComputeSchema(msrest.serialization.Model): @@ -852,19 +882,16 @@ class AmlComputeSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, + "properties": {"key": "properties", "type": "AmlComputeProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of AmlCompute. :paramtype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties """ super(AmlComputeSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class AmlCompute(Compute, AmlComputeSchema): @@ -906,32 +933,32 @@ class AmlCompute(Compute, AmlComputeSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "AmlComputeProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of AmlCompute. :paramtype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties @@ -946,17 +973,17 @@ def __init__( :paramtype disable_local_auth: bool """ super(AmlCompute, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'AmlCompute' # type: str - self.compute_location = kwargs.get('compute_location', None) + self.properties = kwargs.get("properties", None) + self.compute_type = "AmlCompute" # type: str + self.compute_location = kwargs.get("compute_location", None) self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) + self.disable_local_auth = kwargs.get("disable_local_auth", None) class AmlComputeNodeInformation(msrest.serialization.Model): @@ -981,29 +1008,25 @@ class AmlComputeNodeInformation(msrest.serialization.Model): """ _validation = { - 'node_id': {'readonly': True}, - 'private_ip_address': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'port': {'readonly': True}, - 'node_state': {'readonly': True}, - 'run_id': {'readonly': True}, + "node_id": {"readonly": True}, + "private_ip_address": {"readonly": True}, + "public_ip_address": {"readonly": True}, + "port": {"readonly": True}, + "node_state": {"readonly": True}, + "run_id": {"readonly": True}, } _attribute_map = { - 'node_id': {'key': 'nodeId', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'node_state': {'key': 'nodeState', 'type': 'str'}, - 'run_id': {'key': 'runId', 'type': 'str'}, + "node_id": {"key": "nodeId", "type": "str"}, + "private_ip_address": {"key": "privateIpAddress", "type": "str"}, + "public_ip_address": {"key": "publicIpAddress", "type": "str"}, + "port": {"key": "port", "type": "int"}, + "node_state": {"key": "nodeState", "type": "str"}, + "run_id": {"key": "runId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AmlComputeNodeInformation, self).__init__(**kwargs) self.node_id = None self.private_ip_address = None @@ -1025,21 +1048,17 @@ class AmlComputeNodesInformation(msrest.serialization.Model): """ _validation = { - 'nodes': {'readonly': True}, - 'next_link': {'readonly': True}, + "nodes": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'nodes': {'key': 'nodes', 'type': '[AmlComputeNodeInformation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "nodes": {"key": "nodes", "type": "[AmlComputeNodeInformation]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AmlComputeNodesInformation, self).__init__(**kwargs) self.nodes = None self.next_link = None @@ -1110,38 +1129,50 @@ class AmlComputeProperties(msrest.serialization.Model): """ _validation = { - 'allocation_state': {'readonly': True}, - 'allocation_state_transition_time': {'readonly': True}, - 'errors': {'readonly': True}, - 'current_node_count': {'readonly': True}, - 'target_node_count': {'readonly': True}, - 'node_state_counts': {'readonly': True}, - } - - _attribute_map = { - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'vm_priority': {'key': 'vmPriority', 'type': 'str'}, - 'virtual_machine_image': {'key': 'virtualMachineImage', 'type': 'VirtualMachineImage'}, - 'isolated_network': {'key': 'isolatedNetwork', 'type': 'bool'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, - 'user_account_credentials': {'key': 'userAccountCredentials', 'type': 'UserAccountCredentials'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'remote_login_port_public_access': {'key': 'remoteLoginPortPublicAccess', 'type': 'str'}, - 'allocation_state': {'key': 'allocationState', 'type': 'str'}, - 'allocation_state_transition_time': {'key': 'allocationStateTransitionTime', 'type': 'iso-8601'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'current_node_count': {'key': 'currentNodeCount', 'type': 'int'}, - 'target_node_count': {'key': 'targetNodeCount', 'type': 'int'}, - 'node_state_counts': {'key': 'nodeStateCounts', 'type': 'NodeStateCounts'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'property_bag': {'key': 'propertyBag', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): + "allocation_state": {"readonly": True}, + "allocation_state_transition_time": {"readonly": True}, + "errors": {"readonly": True}, + "current_node_count": {"readonly": True}, + "target_node_count": {"readonly": True}, + "node_state_counts": {"readonly": True}, + } + + _attribute_map = { + "os_type": {"key": "osType", "type": "str"}, + "vm_size": {"key": "vmSize", "type": "str"}, + "vm_priority": {"key": "vmPriority", "type": "str"}, + "virtual_machine_image": { + "key": "virtualMachineImage", + "type": "VirtualMachineImage", + }, + "isolated_network": {"key": "isolatedNetwork", "type": "bool"}, + "scale_settings": {"key": "scaleSettings", "type": "ScaleSettings"}, + "user_account_credentials": { + "key": "userAccountCredentials", + "type": "UserAccountCredentials", + }, + "subnet": {"key": "subnet", "type": "ResourceId"}, + "remote_login_port_public_access": { + "key": "remoteLoginPortPublicAccess", + "type": "str", + }, + "allocation_state": {"key": "allocationState", "type": "str"}, + "allocation_state_transition_time": { + "key": "allocationStateTransitionTime", + "type": "iso-8601", + }, + "errors": {"key": "errors", "type": "[ErrorResponse]"}, + "current_node_count": {"key": "currentNodeCount", "type": "int"}, + "target_node_count": {"key": "targetNodeCount", "type": "int"}, + "node_state_counts": { + "key": "nodeStateCounts", + "type": "NodeStateCounts", + }, + "enable_node_public_ip": {"key": "enableNodePublicIp", "type": "bool"}, + "property_bag": {"key": "propertyBag", "type": "object"}, + } + + def __init__(self, **kwargs): """ :keyword os_type: Compute OS Type. Possible values include: "Linux", "Windows". Default value: "Linux". @@ -1182,23 +1213,27 @@ def __init__( :paramtype property_bag: any """ super(AmlComputeProperties, self).__init__(**kwargs) - self.os_type = kwargs.get('os_type', "Linux") - self.vm_size = kwargs.get('vm_size', None) - self.vm_priority = kwargs.get('vm_priority', None) - self.virtual_machine_image = kwargs.get('virtual_machine_image', None) - self.isolated_network = kwargs.get('isolated_network', None) - self.scale_settings = kwargs.get('scale_settings', None) - self.user_account_credentials = kwargs.get('user_account_credentials', None) - self.subnet = kwargs.get('subnet', None) - self.remote_login_port_public_access = kwargs.get('remote_login_port_public_access', "NotSpecified") + self.os_type = kwargs.get("os_type", "Linux") + self.vm_size = kwargs.get("vm_size", None) + self.vm_priority = kwargs.get("vm_priority", None) + self.virtual_machine_image = kwargs.get("virtual_machine_image", None) + self.isolated_network = kwargs.get("isolated_network", None) + self.scale_settings = kwargs.get("scale_settings", None) + self.user_account_credentials = kwargs.get( + "user_account_credentials", None + ) + self.subnet = kwargs.get("subnet", None) + self.remote_login_port_public_access = kwargs.get( + "remote_login_port_public_access", "NotSpecified" + ) self.allocation_state = None self.allocation_state_transition_time = None self.errors = None self.current_node_count = None self.target_node_count = None self.node_state_counts = None - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', True) - self.property_bag = kwargs.get('property_bag', None) + self.enable_node_public_ip = kwargs.get("enable_node_public_ip", True) + self.property_bag = kwargs.get("property_bag", None) class AmlOperation(msrest.serialization.Model): @@ -1213,15 +1248,12 @@ class AmlOperation(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'AmlOperationDisplay'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + "name": {"key": "name", "type": "str"}, + "display": {"key": "display", "type": "AmlOperationDisplay"}, + "is_data_action": {"key": "isDataAction", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: Operation name: {provider}/{resource}/{operation}. :paramtype name: str @@ -1231,9 +1263,9 @@ def __init__( :paramtype is_data_action: bool """ super(AmlOperation, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display = kwargs.get('display', None) - self.is_data_action = kwargs.get('is_data_action', None) + self.name = kwargs.get("name", None) + self.display = kwargs.get("display", None) + self.is_data_action = kwargs.get("is_data_action", None) class AmlOperationDisplay(msrest.serialization.Model): @@ -1250,16 +1282,13 @@ class AmlOperationDisplay(msrest.serialization.Model): """ _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, + "provider": {"key": "provider", "type": "str"}, + "resource": {"key": "resource", "type": "str"}, + "operation": {"key": "operation", "type": "str"}, + "description": {"key": "description", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword provider: The resource provider name: Microsoft.MachineLearningExperimentation. :paramtype provider: str @@ -1271,10 +1300,10 @@ def __init__( :paramtype description: str """ super(AmlOperationDisplay, self).__init__(**kwargs) - self.provider = kwargs.get('provider', None) - self.resource = kwargs.get('resource', None) - self.operation = kwargs.get('operation', None) - self.description = kwargs.get('description', None) + self.provider = kwargs.get("provider", None) + self.resource = kwargs.get("resource", None) + self.operation = kwargs.get("operation", None) + self.description = kwargs.get("description", None) class AmlOperationListResult(msrest.serialization.Model): @@ -1285,19 +1314,16 @@ class AmlOperationListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlOperation]'}, + "value": {"key": "value", "type": "[AmlOperation]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: List of AML operations supported by the AML resource provider. :paramtype value: list[~azure.mgmt.machinelearningservices.models.AmlOperation] """ super(AmlOperationListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class IdentityConfiguration(msrest.serialization.Model): @@ -1315,23 +1341,23 @@ class IdentityConfiguration(msrest.serialization.Model): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, } _subtype_map = { - 'identity_type': {'AMLToken': 'AmlToken', 'Managed': 'ManagedIdentity', 'UserIdentity': 'UserIdentity'} + "identity_type": { + "AMLToken": "AmlToken", + "Managed": "ManagedIdentity", + "UserIdentity": "UserIdentity", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(IdentityConfiguration, self).__init__(**kwargs) self.identity_type = None # type: Optional[str] @@ -1348,21 +1374,17 @@ class AmlToken(IdentityConfiguration): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AmlToken, self).__init__(**kwargs) - self.identity_type = 'AMLToken' # type: str + self.identity_type = "AMLToken" # type: str class AmlUserFeature(msrest.serialization.Model): @@ -1377,15 +1399,12 @@ class AmlUserFeature(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "description": {"key": "description", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword id: Specifies the feature ID. :paramtype id: str @@ -1395,9 +1414,9 @@ def __init__( :paramtype description: str """ super(AmlUserFeature, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.display_name = kwargs.get('display_name', None) - self.description = kwargs.get('description', None) + self.id = kwargs.get("id", None) + self.display_name = kwargs.get("display_name", None) + self.description = kwargs.get("description", None) class ArmResourceId(msrest.serialization.Model): @@ -1411,13 +1430,10 @@ class ArmResourceId(msrest.serialization.Model): """ _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, + "resource_id": {"key": "resourceId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword resource_id: Arm ResourceId is in the format "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName}" @@ -1426,7 +1442,7 @@ def __init__( :paramtype resource_id: str """ super(ArmResourceId, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) class ResourceBase(msrest.serialization.Model): @@ -1441,15 +1457,12 @@ class ResourceBase(msrest.serialization.Model): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -1459,9 +1472,9 @@ def __init__( :paramtype tags: dict[str, str] """ super(ResourceBase, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) + self.description = kwargs.get("description", None) + self.properties = kwargs.get("properties", None) + self.tags = kwargs.get("tags", None) class AssetBase(ResourceBase): @@ -1480,17 +1493,14 @@ class AssetBase(ResourceBase): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -1504,8 +1514,8 @@ def __init__( :paramtype is_archived: bool """ super(AssetBase, self).__init__(**kwargs) - self.is_anonymous = kwargs.get('is_anonymous', False) - self.is_archived = kwargs.get('is_archived', False) + self.is_anonymous = kwargs.get("is_anonymous", False) + self.is_archived = kwargs.get("is_archived", False) class AssetContainer(ResourceBase): @@ -1528,23 +1538,20 @@ class AssetContainer(ResourceBase): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -1556,7 +1563,7 @@ def __init__( :paramtype is_archived: bool """ super(AssetContainer, self).__init__(**kwargs) - self.is_archived = kwargs.get('is_archived', False) + self.is_archived = kwargs.get("is_archived", False) self.latest_version = None self.next_version = None @@ -1574,18 +1581,15 @@ class AssetJobInput(msrest.serialization.Model): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -1594,8 +1598,8 @@ def __init__( :paramtype uri: str """ super(AssetJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] class AssetJobOutput(msrest.serialization.Model): @@ -1613,16 +1617,13 @@ class AssetJobOutput(msrest.serialization.Model): """ _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, + "asset_name": {"key": "assetName", "type": "str"}, + "asset_version": {"key": "assetVersion", "type": "str"}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword asset_name: Output Asset Name. :paramtype asset_name: str @@ -1635,10 +1636,10 @@ def __init__( :paramtype uri: str """ super(AssetJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.asset_version = kwargs.get('asset_version', None) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) + self.asset_name = kwargs.get("asset_name", None) + self.asset_version = kwargs.get("asset_version", None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) class AssetReferenceBase(msrest.serialization.Model): @@ -1655,23 +1656,23 @@ class AssetReferenceBase(msrest.serialization.Model): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, } _subtype_map = { - 'reference_type': {'DataPath': 'DataPathAssetReference', 'Id': 'IdAssetReference', 'OutputPath': 'OutputPathAssetReference'} + "reference_type": { + "DataPath": "DataPathAssetReference", + "Id": "IdAssetReference", + "OutputPath": "OutputPathAssetReference", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AssetReferenceBase, self).__init__(**kwargs) self.reference_type = None # type: Optional[str] @@ -1688,19 +1689,16 @@ class AssignedUser(msrest.serialization.Model): """ _validation = { - 'object_id': {'required': True}, - 'tenant_id': {'required': True}, + "object_id": {"required": True}, + "tenant_id": {"required": True}, } _attribute_map = { - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + "object_id": {"key": "objectId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword object_id: Required. User’s AAD Object Id. :paramtype object_id: str @@ -1708,8 +1706,8 @@ def __init__( :paramtype tenant_id: str """ super(AssignedUser, self).__init__(**kwargs) - self.object_id = kwargs['object_id'] - self.tenant_id = kwargs['tenant_id'] + self.object_id = kwargs["object_id"] + self.tenant_id = kwargs["tenant_id"] class ForecastHorizon(msrest.serialization.Model): @@ -1726,23 +1724,22 @@ class ForecastHorizon(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoForecastHorizon', 'Custom': 'CustomForecastHorizon'} + "mode": { + "Auto": "AutoForecastHorizon", + "Custom": "CustomForecastHorizon", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ForecastHorizon, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -1758,21 +1755,17 @@ class AutoForecastHorizon(ForecastHorizon): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoForecastHorizon, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class AutologgerSettings(msrest.serialization.Model): @@ -1787,17 +1780,14 @@ class AutologgerSettings(msrest.serialization.Model): """ _validation = { - 'mlflow_autologger': {'required': True}, + "mlflow_autologger": {"required": True}, } _attribute_map = { - 'mlflow_autologger': {'key': 'mlflowAutologger', 'type': 'str'}, + "mlflow_autologger": {"key": "mlflowAutologger", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mlflow_autologger: Required. [Required] Indicates whether mlflow autologger is enabled. Possible values include: "Enabled", "Disabled". @@ -1805,7 +1795,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.MLFlowAutologgerState """ super(AutologgerSettings, self).__init__(**kwargs) - self.mlflow_autologger = kwargs['mlflow_autologger'] + self.mlflow_autologger = kwargs["mlflow_autologger"] class JobBaseProperties(ResourceBase): @@ -1852,33 +1842,37 @@ class JobBaseProperties(ResourceBase): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, + "job_type": {"required": True}, + "status": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, } _subtype_map = { - 'job_type': {'AutoML': 'AutoMLJob', 'Command': 'CommandJob', 'Labeling': 'LabelingJobProperties', 'Pipeline': 'PipelineJob', 'Spark': 'SparkJob', 'Sweep': 'SweepJob'} + "job_type": { + "AutoML": "AutoMLJob", + "Command": "CommandJob", + "Labeling": "LabelingJobProperties", + "Pipeline": "PipelineJob", + "Spark": "SparkJob", + "Sweep": "SweepJob", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -1906,102 +1900,102 @@ def __init__( :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] """ super(JobBaseProperties, self).__init__(**kwargs) - self.component_id = kwargs.get('component_id', None) - self.compute_id = kwargs.get('compute_id', None) - self.display_name = kwargs.get('display_name', None) - self.experiment_name = kwargs.get('experiment_name', "Default") - self.identity = kwargs.get('identity', None) - self.is_archived = kwargs.get('is_archived', False) - self.job_type = 'JobBaseProperties' # type: str - self.services = kwargs.get('services', None) + self.component_id = kwargs.get("component_id", None) + self.compute_id = kwargs.get("compute_id", None) + self.display_name = kwargs.get("display_name", None) + self.experiment_name = kwargs.get("experiment_name", "Default") + self.identity = kwargs.get("identity", None) + self.is_archived = kwargs.get("is_archived", False) + self.job_type = "JobBaseProperties" # type: str + self.services = kwargs.get("services", None) self.status = None class AutoMLJob(JobBaseProperties): """AutoMLJob class. -Use this class for executing AutoML tasks like Classification/Regression etc. -See TaskType enum for all the tasks supported. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar environment_id: The ARM resource ID of the Environment specification for the job. - This is optional value to provide, if not provided, AutoML will default this to Production - AutoML curated environment version when running the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - :ivar task_details: Required. [Required] This represents scenario which can be one of - Tables/NLP/Image. - :vartype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical + Use this class for executing AutoML tasks like Classification/Regression etc. + See TaskType enum for all the tasks supported. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar description: The asset description text. + :vartype description: str + :ivar properties: The asset property dictionary. + :vartype properties: dict[str, str] + :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + :ivar component_id: ARM resource ID of the component resource. + :vartype component_id: str + :ivar compute_id: ARM resource ID of the compute resource. + :vartype compute_id: str + :ivar display_name: Display name of job. + :vartype display_name: str + :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is + placed in the "Default" experiment. + :vartype experiment_name: str + :ivar identity: Identity configuration. If set, this should be one of AmlToken, + ManagedIdentity, UserIdentity or null. + Defaults to AmlToken if null. + :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration + :ivar is_archived: Is the asset archived?. + :vartype is_archived: bool + :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. + Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark". + :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType + :ivar services: List of JobEndpoints. + For local jobs, a job endpoint will have an endpoint value of FileStreamObject. + :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] + :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", + "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", + "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". + :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus + :ivar environment_id: The ARM resource ID of the Environment specification for the job. + This is optional value to provide, if not provided, AutoML will default this to Production + AutoML curated environment version when running the job. + :vartype environment_id: str + :ivar environment_variables: Environment variables included in the job. + :vartype environment_variables: dict[str, str] + :ivar outputs: Mapping of output data bindings used in the job. + :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] + :ivar resources: Compute Resource configuration for the job. + :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration + :ivar task_details: Required. [Required] This represents scenario which can be one of + Tables/NLP/Image. + :vartype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'task_details': {'required': True}, + "job_type": {"required": True}, + "status": {"readonly": True}, + "task_details": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - 'task_details': {'key': 'taskDetails', 'type': 'AutoMLVertical'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "resources": {"key": "resources", "type": "JobResourceConfiguration"}, + "task_details": {"key": "taskDetails", "type": "AutoMLVertical"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -2042,58 +2036,66 @@ def __init__( :paramtype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical """ super(AutoMLJob, self).__init__(**kwargs) - self.job_type = 'AutoML' # type: str - self.environment_id = kwargs.get('environment_id', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.outputs = kwargs.get('outputs', None) - self.resources = kwargs.get('resources', None) - self.task_details = kwargs['task_details'] + self.job_type = "AutoML" # type: str + self.environment_id = kwargs.get("environment_id", None) + self.environment_variables = kwargs.get("environment_variables", None) + self.outputs = kwargs.get("outputs", None) + self.resources = kwargs.get("resources", None) + self.task_details = kwargs["task_details"] class AutoMLVertical(msrest.serialization.Model): """AutoML vertical class. -Base class for AutoML verticals - TableVertical/ImageVertical/NLPVertical. + Base class for AutoML verticals - TableVertical/ImageVertical/NLPVertical. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Classification, Forecasting, ImageClassification, ImageClassificationMultilabel, ImageInstanceSegmentation, ImageObjectDetection, Regression, TextClassification, TextClassificationMultilabel, TextNer. + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Classification, Forecasting, ImageClassification, ImageClassificationMultilabel, ImageInstanceSegmentation, ImageObjectDetection, Regression, TextClassification, TextClassificationMultilabel, TextNer. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, + "task_type": {"required": True}, + "training_data": {"required": True}, } _attribute_map = { - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, } _subtype_map = { - 'task_type': {'Classification': 'Classification', 'Forecasting': 'Forecasting', 'ImageClassification': 'ImageClassification', 'ImageClassificationMultilabel': 'ImageClassificationMultilabel', 'ImageInstanceSegmentation': 'ImageInstanceSegmentation', 'ImageObjectDetection': 'ImageObjectDetection', 'Regression': 'Regression', 'TextClassification': 'TextClassification', 'TextClassificationMultilabel': 'TextClassificationMultilabel', 'TextNER': 'TextNer'} - } - - def __init__( - self, - **kwargs - ): + "task_type": { + "Classification": "Classification", + "Forecasting": "Forecasting", + "ImageClassification": "ImageClassification", + "ImageClassificationMultilabel": "ImageClassificationMultilabel", + "ImageInstanceSegmentation": "ImageInstanceSegmentation", + "ImageObjectDetection": "ImageObjectDetection", + "Regression": "Regression", + "TextClassification": "TextClassification", + "TextClassificationMultilabel": "TextClassificationMultilabel", + "TextNER": "TextNer", + } + } + + def __init__(self, **kwargs): """ :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", "Info", "Warning", "Error", "Critical". @@ -2105,10 +2107,10 @@ def __init__( :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ super(AutoMLVertical, self).__init__(**kwargs) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) self.task_type = None # type: Optional[str] - self.training_data = kwargs['training_data'] + self.training_data = kwargs["training_data"] class NCrossValidations(msrest.serialization.Model): @@ -2125,23 +2127,22 @@ class NCrossValidations(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoNCrossValidations', 'Custom': 'CustomNCrossValidations'} + "mode": { + "Auto": "AutoNCrossValidations", + "Custom": "CustomNCrossValidations", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NCrossValidations, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -2157,21 +2158,17 @@ class AutoNCrossValidations(NCrossValidations): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoNCrossValidations, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class AutoPauseProperties(msrest.serialization.Model): @@ -2184,14 +2181,11 @@ class AutoPauseProperties(msrest.serialization.Model): """ _attribute_map = { - 'delay_in_minutes': {'key': 'delayInMinutes', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, + "delay_in_minutes": {"key": "delayInMinutes", "type": "int"}, + "enabled": {"key": "enabled", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword delay_in_minutes: :paramtype delay_in_minutes: int @@ -2199,8 +2193,8 @@ def __init__( :paramtype enabled: bool """ super(AutoPauseProperties, self).__init__(**kwargs) - self.delay_in_minutes = kwargs.get('delay_in_minutes', None) - self.enabled = kwargs.get('enabled', None) + self.delay_in_minutes = kwargs.get("delay_in_minutes", None) + self.enabled = kwargs.get("enabled", None) class AutoScaleProperties(msrest.serialization.Model): @@ -2215,15 +2209,12 @@ class AutoScaleProperties(msrest.serialization.Model): """ _attribute_map = { - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, + "min_node_count": {"key": "minNodeCount", "type": "int"}, + "enabled": {"key": "enabled", "type": "bool"}, + "max_node_count": {"key": "maxNodeCount", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword min_node_count: :paramtype min_node_count: int @@ -2233,9 +2224,9 @@ def __init__( :paramtype max_node_count: int """ super(AutoScaleProperties, self).__init__(**kwargs) - self.min_node_count = kwargs.get('min_node_count', None) - self.enabled = kwargs.get('enabled', None) - self.max_node_count = kwargs.get('max_node_count', None) + self.min_node_count = kwargs.get("min_node_count", None) + self.enabled = kwargs.get("enabled", None) + self.max_node_count = kwargs.get("max_node_count", None) class Seasonality(msrest.serialization.Model): @@ -2252,23 +2243,19 @@ class Seasonality(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoSeasonality', 'Custom': 'CustomSeasonality'} + "mode": {"Auto": "AutoSeasonality", "Custom": "CustomSeasonality"} } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Seasonality, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -2284,21 +2271,17 @@ class AutoSeasonality(Seasonality): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoSeasonality, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class TargetLags(msrest.serialization.Model): @@ -2315,23 +2298,19 @@ class TargetLags(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoTargetLags', 'Custom': 'CustomTargetLags'} + "mode": {"Auto": "AutoTargetLags", "Custom": "CustomTargetLags"} } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(TargetLags, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -2347,21 +2326,17 @@ class AutoTargetLags(TargetLags): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoTargetLags, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class TargetRollingWindowSize(msrest.serialization.Model): @@ -2378,23 +2353,22 @@ class TargetRollingWindowSize(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoTargetRollingWindowSize', 'Custom': 'CustomTargetRollingWindowSize'} + "mode": { + "Auto": "AutoTargetRollingWindowSize", + "Custom": "CustomTargetRollingWindowSize", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(TargetRollingWindowSize, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -2410,21 +2384,17 @@ class AutoTargetRollingWindowSize(TargetRollingWindowSize): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class AzureDatastore(msrest.serialization.Model): @@ -2437,14 +2407,11 @@ class AzureDatastore(msrest.serialization.Model): """ _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + "resource_group": {"key": "resourceGroup", "type": "str"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword resource_group: Azure Resource Group name. :paramtype resource_group: str @@ -2452,8 +2419,8 @@ def __init__( :paramtype subscription_id: str """ super(AzureDatastore, self).__init__(**kwargs) - self.resource_group = kwargs.get('resource_group', None) - self.subscription_id = kwargs.get('subscription_id', None) + self.resource_group = kwargs.get("resource_group", None) + self.subscription_id = kwargs.get("subscription_id", None) class DatastoreProperties(ResourceBase): @@ -2484,28 +2451,31 @@ class DatastoreProperties(ResourceBase): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, } _subtype_map = { - 'datastore_type': {'AzureBlob': 'AzureBlobDatastore', 'AzureDataLakeGen1': 'AzureDataLakeGen1Datastore', 'AzureDataLakeGen2': 'AzureDataLakeGen2Datastore', 'AzureFile': 'AzureFileDatastore', 'Hdfs': 'HdfsDatastore'} + "datastore_type": { + "AzureBlob": "AzureBlobDatastore", + "AzureDataLakeGen1": "AzureDataLakeGen1Datastore", + "AzureDataLakeGen2": "AzureDataLakeGen2Datastore", + "AzureFile": "AzureFileDatastore", + "Hdfs": "HdfsDatastore", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -2517,8 +2487,8 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials """ super(DatastoreProperties, self).__init__(**kwargs) - self.credentials = kwargs['credentials'] - self.datastore_type = 'DatastoreProperties' # type: str + self.credentials = kwargs["credentials"] + self.datastore_type = "DatastoreProperties" # type: str self.is_default = None @@ -2564,31 +2534,31 @@ class AzureBlobDatastore(DatastoreProperties, AzureDatastore): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, } _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, + "resource_group": {"key": "resourceGroup", "type": "str"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "account_name": {"key": "accountName", "type": "str"}, + "container_name": {"key": "containerName", "type": "str"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword resource_group: Azure Resource Group name. :paramtype resource_group: str @@ -2617,18 +2587,20 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ super(AzureBlobDatastore, self).__init__(**kwargs) - self.resource_group = kwargs.get('resource_group', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.datastore_type = 'AzureBlob' # type: str - self.account_name = kwargs.get('account_name', None) - self.container_name = kwargs.get('container_name', None) - self.endpoint = kwargs.get('endpoint', None) - self.protocol = kwargs.get('protocol', None) - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - self.credentials = kwargs['credentials'] + self.resource_group = kwargs.get("resource_group", None) + self.subscription_id = kwargs.get("subscription_id", None) + self.datastore_type = "AzureBlob" # type: str + self.account_name = kwargs.get("account_name", None) + self.container_name = kwargs.get("container_name", None) + self.endpoint = kwargs.get("endpoint", None) + self.protocol = kwargs.get("protocol", None) + self.service_data_access_auth_identity = kwargs.get( + "service_data_access_auth_identity", None + ) + self.description = kwargs.get("description", None) + self.properties = kwargs.get("properties", None) + self.tags = kwargs.get("tags", None) + self.credentials = kwargs["credentials"] self.is_default = None @@ -2668,29 +2640,29 @@ class AzureDataLakeGen1Datastore(DatastoreProperties, AzureDatastore): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'store_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "store_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - 'store_name': {'key': 'storeName', 'type': 'str'}, + "resource_group": {"key": "resourceGroup", "type": "str"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, + "store_name": {"key": "storeName", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword resource_group: Azure Resource Group name. :paramtype resource_group: str @@ -2713,15 +2685,17 @@ def __init__( :paramtype store_name: str """ super(AzureDataLakeGen1Datastore, self).__init__(**kwargs) - self.resource_group = kwargs.get('resource_group', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.datastore_type = 'AzureDataLakeGen1' # type: str - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) - self.store_name = kwargs['store_name'] - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - self.credentials = kwargs['credentials'] + self.resource_group = kwargs.get("resource_group", None) + self.subscription_id = kwargs.get("subscription_id", None) + self.datastore_type = "AzureDataLakeGen1" # type: str + self.service_data_access_auth_identity = kwargs.get( + "service_data_access_auth_identity", None + ) + self.store_name = kwargs["store_name"] + self.description = kwargs.get("description", None) + self.properties = kwargs.get("properties", None) + self.tags = kwargs.get("tags", None) + self.credentials = kwargs["credentials"] self.is_default = None @@ -2767,33 +2741,33 @@ class AzureDataLakeGen2Datastore(DatastoreProperties, AzureDatastore): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'filesystem': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "account_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "filesystem": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'filesystem': {'key': 'filesystem', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, + "resource_group": {"key": "resourceGroup", "type": "str"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "account_name": {"key": "accountName", "type": "str"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "filesystem": {"key": "filesystem", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword resource_group: Azure Resource Group name. :paramtype resource_group: str @@ -2822,18 +2796,20 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ super(AzureDataLakeGen2Datastore, self).__init__(**kwargs) - self.resource_group = kwargs.get('resource_group', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.datastore_type = 'AzureDataLakeGen2' # type: str - self.account_name = kwargs['account_name'] - self.endpoint = kwargs.get('endpoint', None) - self.filesystem = kwargs['filesystem'] - self.protocol = kwargs.get('protocol', None) - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - self.credentials = kwargs['credentials'] + self.resource_group = kwargs.get("resource_group", None) + self.subscription_id = kwargs.get("subscription_id", None) + self.datastore_type = "AzureDataLakeGen2" # type: str + self.account_name = kwargs["account_name"] + self.endpoint = kwargs.get("endpoint", None) + self.filesystem = kwargs["filesystem"] + self.protocol = kwargs.get("protocol", None) + self.service_data_access_auth_identity = kwargs.get( + "service_data_access_auth_identity", None + ) + self.description = kwargs.get("description", None) + self.properties = kwargs.get("properties", None) + self.tags = kwargs.get("tags", None) + self.credentials = kwargs["credentials"] self.is_default = None @@ -2880,33 +2856,33 @@ class AzureFileDatastore(DatastoreProperties, AzureDatastore): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'file_share_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "account_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "file_share_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'file_share_name': {'key': 'fileShareName', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, + "resource_group": {"key": "resourceGroup", "type": "str"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "account_name": {"key": "accountName", "type": "str"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "file_share_name": {"key": "fileShareName", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword resource_group: Azure Resource Group name. :paramtype resource_group: str @@ -2936,18 +2912,20 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ super(AzureFileDatastore, self).__init__(**kwargs) - self.resource_group = kwargs.get('resource_group', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.datastore_type = 'AzureFile' # type: str - self.account_name = kwargs['account_name'] - self.endpoint = kwargs.get('endpoint', None) - self.file_share_name = kwargs['file_share_name'] - self.protocol = kwargs.get('protocol', None) - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - self.credentials = kwargs['credentials'] + self.resource_group = kwargs.get("resource_group", None) + self.subscription_id = kwargs.get("subscription_id", None) + self.datastore_type = "AzureFile" # type: str + self.account_name = kwargs["account_name"] + self.endpoint = kwargs.get("endpoint", None) + self.file_share_name = kwargs["file_share_name"] + self.protocol = kwargs.get("protocol", None) + self.service_data_access_auth_identity = kwargs.get( + "service_data_access_auth_identity", None + ) + self.description = kwargs.get("description", None) + self.properties = kwargs.get("properties", None) + self.tags = kwargs.get("tags", None) + self.credentials = kwargs["credentials"] self.is_default = None @@ -2970,23 +2948,24 @@ class EarlyTerminationPolicy(msrest.serialization.Model): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, } _subtype_map = { - 'policy_type': {'Bandit': 'BanditPolicy', 'MedianStopping': 'MedianStoppingPolicy', 'TruncationSelection': 'TruncationSelectionPolicy'} + "policy_type": { + "Bandit": "BanditPolicy", + "MedianStopping": "MedianStoppingPolicy", + "TruncationSelection": "TruncationSelectionPolicy", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. :paramtype delay_evaluation: int @@ -2994,8 +2973,8 @@ def __init__( :paramtype evaluation_interval: int """ super(EarlyTerminationPolicy, self).__init__(**kwargs) - self.delay_evaluation = kwargs.get('delay_evaluation', 0) - self.evaluation_interval = kwargs.get('evaluation_interval', 0) + self.delay_evaluation = kwargs.get("delay_evaluation", 0) + self.evaluation_interval = kwargs.get("evaluation_interval", 0) self.policy_type = None # type: Optional[str] @@ -3019,21 +2998,18 @@ class BanditPolicy(EarlyTerminationPolicy): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'slack_amount': {'key': 'slackAmount', 'type': 'float'}, - 'slack_factor': {'key': 'slackFactor', 'type': 'float'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, + "slack_amount": {"key": "slackAmount", "type": "float"}, + "slack_factor": {"key": "slackFactor", "type": "float"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. :paramtype delay_evaluation: int @@ -3045,9 +3021,9 @@ def __init__( :paramtype slack_factor: float """ super(BanditPolicy, self).__init__(**kwargs) - self.policy_type = 'Bandit' # type: str - self.slack_amount = kwargs.get('slack_amount', 0) - self.slack_factor = kwargs.get('slack_factor', 0) + self.policy_type = "Bandit" # type: str + self.slack_amount = kwargs.get("slack_amount", 0) + self.slack_factor = kwargs.get("slack_factor", 0) class Resource(msrest.serialization.Model): @@ -3069,25 +3045,21 @@ class Resource(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -3120,26 +3092,23 @@ class TrackedResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -3147,8 +3116,8 @@ def __init__( :paramtype location: str """ super(TrackedResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.location = kwargs['location'] + self.tags = kwargs.get("tags", None) + self.location = kwargs["location"] class BatchDeployment(TrackedResource): @@ -3185,31 +3154,31 @@ class BatchDeployment(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchDeploymentProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": { + "key": "properties", + "type": "BatchDeploymentProperties", + }, + "sku": {"key": "sku", "type": "Sku"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -3226,10 +3195,10 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ super(BatchDeployment, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) + self.identity = kwargs.get("identity", None) + self.kind = kwargs.get("kind", None) + self.properties = kwargs["properties"] + self.sku = kwargs.get("sku", None) class EndpointDeploymentPropertiesBase(msrest.serialization.Model): @@ -3249,17 +3218,20 @@ class EndpointDeploymentPropertiesBase(msrest.serialization.Model): """ _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword code_configuration: Code configuration for the endpoint deployment. :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration @@ -3274,11 +3246,11 @@ def __init__( :paramtype properties: dict[str, str] """ super(EndpointDeploymentPropertiesBase, self).__init__(**kwargs) - self.code_configuration = kwargs.get('code_configuration', None) - self.description = kwargs.get('description', None) - self.environment_id = kwargs.get('environment_id', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.properties = kwargs.get('properties', None) + self.code_configuration = kwargs.get("code_configuration", None) + self.description = kwargs.get("description", None) + self.environment_id = kwargs.get("environment_id", None) + self.environment_variables = kwargs.get("environment_variables", None) + self.properties = kwargs.get("properties", None) class BatchDeploymentProperties(EndpointDeploymentPropertiesBase): @@ -3335,32 +3307,44 @@ class BatchDeploymentProperties(EndpointDeploymentPropertiesBase): """ _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'error_threshold': {'key': 'errorThreshold', 'type': 'int'}, - 'logging_level': {'key': 'loggingLevel', 'type': 'str'}, - 'max_concurrency_per_instance': {'key': 'maxConcurrencyPerInstance', 'type': 'int'}, - 'mini_batch_size': {'key': 'miniBatchSize', 'type': 'long'}, - 'model': {'key': 'model', 'type': 'AssetReferenceBase'}, - 'output_action': {'key': 'outputAction', 'type': 'str'}, - 'output_file_name': {'key': 'outputFileName', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'resources': {'key': 'resources', 'type': 'DeploymentResourceConfiguration'}, - 'retry_settings': {'key': 'retrySettings', 'type': 'BatchRetrySettings'}, - } - - def __init__( - self, - **kwargs - ): + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "compute": {"key": "compute", "type": "str"}, + "error_threshold": {"key": "errorThreshold", "type": "int"}, + "logging_level": {"key": "loggingLevel", "type": "str"}, + "max_concurrency_per_instance": { + "key": "maxConcurrencyPerInstance", + "type": "int", + }, + "mini_batch_size": {"key": "miniBatchSize", "type": "long"}, + "model": {"key": "model", "type": "AssetReferenceBase"}, + "output_action": {"key": "outputAction", "type": "str"}, + "output_file_name": {"key": "outputFileName", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "resources": { + "key": "resources", + "type": "DeploymentResourceConfiguration", + }, + "retry_settings": { + "key": "retrySettings", + "type": "BatchRetrySettings", + }, + } + + def __init__(self, **kwargs): """ :keyword code_configuration: Code configuration for the endpoint deployment. :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration @@ -3407,20 +3391,26 @@ def __init__( :paramtype retry_settings: ~azure.mgmt.machinelearningservices.models.BatchRetrySettings """ super(BatchDeploymentProperties, self).__init__(**kwargs) - self.compute = kwargs.get('compute', None) - self.error_threshold = kwargs.get('error_threshold', -1) - self.logging_level = kwargs.get('logging_level', None) - self.max_concurrency_per_instance = kwargs.get('max_concurrency_per_instance', 1) - self.mini_batch_size = kwargs.get('mini_batch_size', 10) - self.model = kwargs.get('model', None) - self.output_action = kwargs.get('output_action', None) - self.output_file_name = kwargs.get('output_file_name', "predictions.csv") + self.compute = kwargs.get("compute", None) + self.error_threshold = kwargs.get("error_threshold", -1) + self.logging_level = kwargs.get("logging_level", None) + self.max_concurrency_per_instance = kwargs.get( + "max_concurrency_per_instance", 1 + ) + self.mini_batch_size = kwargs.get("mini_batch_size", 10) + self.model = kwargs.get("model", None) + self.output_action = kwargs.get("output_action", None) + self.output_file_name = kwargs.get( + "output_file_name", "predictions.csv" + ) self.provisioning_state = None - self.resources = kwargs.get('resources', None) - self.retry_settings = kwargs.get('retry_settings', None) + self.resources = kwargs.get("resources", None) + self.retry_settings = kwargs.get("retry_settings", None) -class BatchDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class BatchDeploymentTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of BatchDeployment entities. :ivar next_link: The link to the next page of BatchDeployment objects. If null, there are no @@ -3431,14 +3421,11 @@ class BatchDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Mode """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchDeployment]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[BatchDeployment]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of BatchDeployment objects. If null, there are no additional pages. @@ -3446,9 +3433,11 @@ def __init__( :keyword value: An array of objects of type BatchDeployment. :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchDeployment] """ - super(BatchDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(BatchDeploymentTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class BatchEndpoint(TrackedResource): @@ -3485,31 +3474,28 @@ class BatchEndpoint(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": {"key": "properties", "type": "BatchEndpointProperties"}, + "sku": {"key": "sku", "type": "Sku"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -3526,10 +3512,10 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ super(BatchEndpoint, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) + self.identity = kwargs.get("identity", None) + self.kind = kwargs.get("kind", None) + self.properties = kwargs["properties"] + self.sku = kwargs.get("sku", None) class BatchEndpointDefaults(msrest.serialization.Model): @@ -3541,20 +3527,17 @@ class BatchEndpointDefaults(msrest.serialization.Model): """ _attribute_map = { - 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, + "deployment_name": {"key": "deploymentName", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword deployment_name: Name of the deployment that will be default for the endpoint. This deployment will end up getting 100% traffic when the endpoint scoring URL is invoked. :paramtype deployment_name: str """ super(BatchEndpointDefaults, self).__init__(**kwargs) - self.deployment_name = kwargs.get('deployment_name', None) + self.deployment_name = kwargs.get("deployment_name", None) class EndpointPropertiesBase(msrest.serialization.Model): @@ -3583,24 +3566,21 @@ class EndpointPropertiesBase(msrest.serialization.Model): """ _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, + "auth_mode": {"required": True}, + "scoring_uri": {"readonly": True}, + "swagger_uri": {"readonly": True}, } _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, + "auth_mode": {"key": "authMode", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "keys": {"key": "keys", "type": "EndpointAuthKeys"}, + "properties": {"key": "properties", "type": "{str}"}, + "scoring_uri": {"key": "scoringUri", "type": "str"}, + "swagger_uri": {"key": "swaggerUri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' @@ -3616,10 +3596,10 @@ def __init__( :paramtype properties: dict[str, str] """ super(EndpointPropertiesBase, self).__init__(**kwargs) - self.auth_mode = kwargs['auth_mode'] - self.description = kwargs.get('description', None) - self.keys = kwargs.get('keys', None) - self.properties = kwargs.get('properties', None) + self.auth_mode = kwargs["auth_mode"] + self.description = kwargs.get("description", None) + self.keys = kwargs.get("keys", None) + self.properties = kwargs.get("properties", None) self.scoring_uri = None self.swagger_uri = None @@ -3656,27 +3636,24 @@ class BatchEndpointProperties(EndpointPropertiesBase): """ _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "auth_mode": {"required": True}, + "scoring_uri": {"readonly": True}, + "swagger_uri": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'defaults': {'key': 'defaults', 'type': 'BatchEndpointDefaults'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "auth_mode": {"key": "authMode", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "keys": {"key": "keys", "type": "EndpointAuthKeys"}, + "properties": {"key": "properties", "type": "{str}"}, + "scoring_uri": {"key": "scoringUri", "type": "str"}, + "swagger_uri": {"key": "swaggerUri", "type": "str"}, + "defaults": {"key": "defaults", "type": "BatchEndpointDefaults"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' @@ -3694,11 +3671,13 @@ def __init__( :paramtype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults """ super(BatchEndpointProperties, self).__init__(**kwargs) - self.defaults = kwargs.get('defaults', None) + self.defaults = kwargs.get("defaults", None) self.provisioning_state = None -class BatchEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class BatchEndpointTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of BatchEndpoint entities. :ivar next_link: The link to the next page of BatchEndpoint objects. If null, there are no @@ -3709,14 +3688,11 @@ class BatchEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model) """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchEndpoint]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[BatchEndpoint]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of BatchEndpoint objects. If null, there are no additional pages. @@ -3724,9 +3700,11 @@ def __init__( :keyword value: An array of objects of type BatchEndpoint. :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchEndpoint] """ - super(BatchEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(BatchEndpointTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class BatchRetrySettings(msrest.serialization.Model): @@ -3739,14 +3717,11 @@ class BatchRetrySettings(msrest.serialization.Model): """ _attribute_map = { - 'max_retries': {'key': 'maxRetries', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "max_retries": {"key": "maxRetries", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword max_retries: Maximum retry count for a mini-batch. :paramtype max_retries: int @@ -3754,44 +3729,47 @@ def __init__( :paramtype timeout: ~datetime.timedelta """ super(BatchRetrySettings, self).__init__(**kwargs) - self.max_retries = kwargs.get('max_retries', 3) - self.timeout = kwargs.get('timeout', "PT30S") + self.max_retries = kwargs.get("max_retries", 3) + self.timeout = kwargs.get("timeout", "PT30S") class SamplingAlgorithm(msrest.serialization.Model): """The Sampling Algorithm used to generate hyperparameter values, along with properties to -configure the algorithm. + configure the algorithm. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BayesianSamplingAlgorithm, GridSamplingAlgorithm, RandomSamplingAlgorithm. + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: BayesianSamplingAlgorithm, GridSamplingAlgorithm, RandomSamplingAlgorithm. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType + :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating + hyperparameter values, along with configuration properties.Constant filled by server. Possible + values include: "Grid", "Random", "Bayesian". + :vartype sampling_algorithm_type: str or + ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } _subtype_map = { - 'sampling_algorithm_type': {'Bayesian': 'BayesianSamplingAlgorithm', 'Grid': 'GridSamplingAlgorithm', 'Random': 'RandomSamplingAlgorithm'} + "sampling_algorithm_type": { + "Bayesian": "BayesianSamplingAlgorithm", + "Grid": "GridSamplingAlgorithm", + "Random": "RandomSamplingAlgorithm", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(SamplingAlgorithm, self).__init__(**kwargs) self.sampling_algorithm_type = None # type: Optional[str] @@ -3809,21 +3787,20 @@ class BayesianSamplingAlgorithm(SamplingAlgorithm): """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(BayesianSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Bayesian' # type: str + self.sampling_algorithm_type = "Bayesian" # type: str class BindOptions(msrest.serialization.Model): @@ -3838,15 +3815,12 @@ class BindOptions(msrest.serialization.Model): """ _attribute_map = { - 'propagation': {'key': 'propagation', 'type': 'str'}, - 'create_host_path': {'key': 'createHostPath', 'type': 'bool'}, - 'selinux': {'key': 'selinux', 'type': 'str'}, + "propagation": {"key": "propagation", "type": "str"}, + "create_host_path": {"key": "createHostPath", "type": "bool"}, + "selinux": {"key": "selinux", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword propagation: Type of Bind Option. :paramtype propagation: str @@ -3856,9 +3830,9 @@ def __init__( :paramtype selinux: str """ super(BindOptions, self).__init__(**kwargs) - self.propagation = kwargs.get('propagation', None) - self.create_host_path = kwargs.get('create_host_path', None) - self.selinux = kwargs.get('selinux', None) + self.propagation = kwargs.get("propagation", None) + self.create_host_path = kwargs.get("create_host_path", None) + self.selinux = kwargs.get("selinux", None) class BuildContext(msrest.serialization.Model): @@ -3868,56 +3842,53 @@ class BuildContext(msrest.serialization.Model): :ivar context_uri: Required. [Required] URI of the Docker build context used to build the image. Supports blob URIs on environment creation and may return blob or Git URIs. - - + + .. raw:: html - + . :vartype context_uri: str :ivar dockerfile_path: Path to the Dockerfile in the build context. - - + + .. raw:: html - + . :vartype dockerfile_path: str """ _validation = { - 'context_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "context_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'context_uri': {'key': 'contextUri', 'type': 'str'}, - 'dockerfile_path': {'key': 'dockerfilePath', 'type': 'str'}, + "context_uri": {"key": "contextUri", "type": "str"}, + "dockerfile_path": {"key": "dockerfilePath", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword context_uri: Required. [Required] URI of the Docker build context used to build the image. Supports blob URIs on environment creation and may return blob or Git URIs. - - + + .. raw:: html - + . :paramtype context_uri: str :keyword dockerfile_path: Path to the Dockerfile in the build context. - - + + .. raw:: html - + . :paramtype dockerfile_path: str """ super(BuildContext, self).__init__(**kwargs) - self.context_uri = kwargs['context_uri'] - self.dockerfile_path = kwargs.get('dockerfile_path', "Dockerfile") + self.context_uri = kwargs["context_uri"] + self.dockerfile_path = kwargs.get("dockerfile_path", "Dockerfile") class CertificateDatastoreCredentials(DatastoreCredentials): @@ -3944,27 +3915,24 @@ class CertificateDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, - 'thumbprint': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials_type": {"required": True}, + "client_id": {"required": True}, + "secrets": {"required": True}, + "tenant_id": {"required": True}, + "thumbprint": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'CertificateDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "authority_url": {"key": "authorityUrl", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + "resource_url": {"key": "resourceUrl", "type": "str"}, + "secrets": {"key": "secrets", "type": "CertificateDatastoreSecrets"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "thumbprint": {"key": "thumbprint", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword authority_url: Authority URL used for authentication. :paramtype authority_url: str @@ -3982,13 +3950,13 @@ def __init__( :paramtype thumbprint: str """ super(CertificateDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Certificate' # type: str - self.authority_url = kwargs.get('authority_url', None) - self.client_id = kwargs['client_id'] - self.resource_url = kwargs.get('resource_url', None) - self.secrets = kwargs['secrets'] - self.tenant_id = kwargs['tenant_id'] - self.thumbprint = kwargs['thumbprint'] + self.credentials_type = "Certificate" # type: str + self.authority_url = kwargs.get("authority_url", None) + self.client_id = kwargs["client_id"] + self.resource_url = kwargs.get("resource_url", None) + self.secrets = kwargs["secrets"] + self.tenant_id = kwargs["tenant_id"] + self.thumbprint = kwargs["thumbprint"] class CertificateDatastoreSecrets(DatastoreSecrets): @@ -4005,25 +3973,22 @@ class CertificateDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'certificate': {'key': 'certificate', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "certificate": {"key": "certificate", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword certificate: Service principal certificate. :paramtype certificate: str """ super(CertificateDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Certificate' # type: str - self.certificate = kwargs.get('certificate', None) + self.secrets_type = "Certificate" # type: str + self.certificate = kwargs.get("certificate", None) class TableVertical(msrest.serialization.Model): @@ -4067,24 +4032,45 @@ class TableVertical(msrest.serialization.Model): """ _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "TableFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "search_space": { + "key": "searchSpace", + "type": "[TableParameterSubspace]", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "TableSweepSettings", + }, + "test_data": {"key": "testData", "type": "MLTableJobInput"}, + "test_data_size": {"key": "testDataSize", "type": "float"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "weight_column_name": {"key": "weightColumnName", "type": "str"}, + } + + def __init__(self, **kwargs): """ :keyword cv_split_column_names: Columns to use for CVSplit data. :paramtype cv_split_column_names: list[str] @@ -4126,18 +4112,20 @@ def __init__( :paramtype weight_column_name: str """ super(TableVertical, self).__init__(**kwargs) - self.cv_split_column_names = kwargs.get('cv_split_column_names', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.test_data = kwargs.get('test_data', None) - self.test_data_size = kwargs.get('test_data_size', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.weight_column_name = kwargs.get('weight_column_name', None) + self.cv_split_column_names = kwargs.get("cv_split_column_names", None) + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.fixed_parameters = kwargs.get("fixed_parameters", None) + self.limit_settings = kwargs.get("limit_settings", None) + self.n_cross_validations = kwargs.get("n_cross_validations", None) + self.search_space = kwargs.get("search_space", None) + self.sweep_settings = kwargs.get("sweep_settings", None) + self.test_data = kwargs.get("test_data", None) + self.test_data_size = kwargs.get("test_data_size", None) + self.validation_data = kwargs.get("validation_data", None) + self.validation_data_size = kwargs.get("validation_data_size", None) + self.weight_column_name = kwargs.get("weight_column_name", None) class Classification(AutoMLVertical, TableVertical): @@ -4205,36 +4193,60 @@ class Classification(AutoMLVertical, TableVertical): """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'positive_label': {'key': 'positiveLabel', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'ClassificationTrainingSettings'}, - } - - def __init__( - self, - **kwargs - ): + "task_type": {"required": True}, + "training_data": {"required": True}, + } + + _attribute_map = { + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "TableFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "search_space": { + "key": "searchSpace", + "type": "[TableParameterSubspace]", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "TableSweepSettings", + }, + "test_data": {"key": "testData", "type": "MLTableJobInput"}, + "test_data_size": {"key": "testDataSize", "type": "float"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "weight_column_name": {"key": "weightColumnName", "type": "str"}, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "positive_label": {"key": "positiveLabel", "type": "str"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, + "training_settings": { + "key": "trainingSettings", + "type": "ClassificationTrainingSettings", + }, + } + + def __init__(self, **kwargs): """ :keyword cv_split_column_names: Columns to use for CVSplit data. :paramtype cv_split_column_names: list[str] @@ -4293,25 +4305,27 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ClassificationTrainingSettings """ super(Classification, self).__init__(**kwargs) - self.cv_split_column_names = kwargs.get('cv_split_column_names', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.test_data = kwargs.get('test_data', None) - self.test_data_size = kwargs.get('test_data_size', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.weight_column_name = kwargs.get('weight_column_name', None) - self.task_type = 'Classification' # type: str - self.positive_label = kwargs.get('positive_label', None) - self.primary_metric = kwargs.get('primary_metric', None) - self.training_settings = kwargs.get('training_settings', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.cv_split_column_names = kwargs.get("cv_split_column_names", None) + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.fixed_parameters = kwargs.get("fixed_parameters", None) + self.limit_settings = kwargs.get("limit_settings", None) + self.n_cross_validations = kwargs.get("n_cross_validations", None) + self.search_space = kwargs.get("search_space", None) + self.sweep_settings = kwargs.get("sweep_settings", None) + self.test_data = kwargs.get("test_data", None) + self.test_data_size = kwargs.get("test_data_size", None) + self.validation_data = kwargs.get("validation_data", None) + self.validation_data_size = kwargs.get("validation_data_size", None) + self.weight_column_name = kwargs.get("weight_column_name", None) + self.task_type = "Classification" # type: str + self.positive_label = kwargs.get("positive_label", None) + self.primary_metric = kwargs.get("primary_metric", None) + self.training_settings = kwargs.get("training_settings", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class TrainingSettings(msrest.serialization.Model): @@ -4345,20 +4359,32 @@ class TrainingSettings(msrest.serialization.Model): """ _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, + "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, + "training_mode": {"key": "trainingMode", "type": "str"}, + } + + def __init__(self, **kwargs): """ :keyword enable_dnn_training: Enable recommendation of DNN models. :paramtype enable_dnn_training: bool @@ -4387,14 +4413,22 @@ def __init__( :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode """ super(TrainingSettings, self).__init__(**kwargs) - self.enable_dnn_training = kwargs.get('enable_dnn_training', False) - self.enable_model_explainability = kwargs.get('enable_model_explainability', True) - self.enable_onnx_compatible_models = kwargs.get('enable_onnx_compatible_models', False) - self.enable_stack_ensemble = kwargs.get('enable_stack_ensemble', True) - self.enable_vote_ensemble = kwargs.get('enable_vote_ensemble', True) - self.ensemble_model_download_timeout = kwargs.get('ensemble_model_download_timeout', "PT5M") - self.stack_ensemble_settings = kwargs.get('stack_ensemble_settings', None) - self.training_mode = kwargs.get('training_mode', None) + self.enable_dnn_training = kwargs.get("enable_dnn_training", False) + self.enable_model_explainability = kwargs.get( + "enable_model_explainability", True + ) + self.enable_onnx_compatible_models = kwargs.get( + "enable_onnx_compatible_models", False + ) + self.enable_stack_ensemble = kwargs.get("enable_stack_ensemble", True) + self.enable_vote_ensemble = kwargs.get("enable_vote_ensemble", True) + self.ensemble_model_download_timeout = kwargs.get( + "ensemble_model_download_timeout", "PT5M" + ) + self.stack_ensemble_settings = kwargs.get( + "stack_ensemble_settings", None + ) + self.training_mode = kwargs.get("training_mode", None) class ClassificationTrainingSettings(TrainingSettings): @@ -4434,22 +4468,40 @@ class ClassificationTrainingSettings(TrainingSettings): """ _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): + "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, + "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, + "training_mode": {"key": "trainingMode", "type": "str"}, + "allowed_training_algorithms": { + "key": "allowedTrainingAlgorithms", + "type": "[str]", + }, + "blocked_training_algorithms": { + "key": "blockedTrainingAlgorithms", + "type": "[str]", + }, + } + + def __init__(self, **kwargs): """ :keyword enable_dnn_training: Enable recommendation of DNN models. :paramtype enable_dnn_training: bool @@ -4484,8 +4536,12 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ClassificationModels] """ super(ClassificationTrainingSettings, self).__init__(**kwargs) - self.allowed_training_algorithms = kwargs.get('allowed_training_algorithms', None) - self.blocked_training_algorithms = kwargs.get('blocked_training_algorithms', None) + self.allowed_training_algorithms = kwargs.get( + "allowed_training_algorithms", None + ) + self.blocked_training_algorithms = kwargs.get( + "blocked_training_algorithms", None + ) class ClusterUpdateParameters(msrest.serialization.Model): @@ -4496,19 +4552,19 @@ class ClusterUpdateParameters(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties.properties', 'type': 'ScaleSettingsInformation'}, + "properties": { + "key": "properties.properties", + "type": "ScaleSettingsInformation", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of ClusterUpdate. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ScaleSettingsInformation """ super(ClusterUpdateParameters, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class ExportSummary(msrest.serialization.Model): @@ -4535,31 +4591,31 @@ class ExportSummary(msrest.serialization.Model): """ _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, + "end_date_time": {"readonly": True}, + "exported_row_count": {"readonly": True}, + "format": {"required": True}, + "labeling_job_id": {"readonly": True}, + "start_date_time": {"readonly": True}, } _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, + "end_date_time": {"key": "endDateTime", "type": "iso-8601"}, + "exported_row_count": {"key": "exportedRowCount", "type": "long"}, + "format": {"key": "format", "type": "str"}, + "labeling_job_id": {"key": "labelingJobId", "type": "str"}, + "start_date_time": {"key": "startDateTime", "type": "iso-8601"}, } _subtype_map = { - 'format': {'CSV': 'CsvExportSummary', 'Coco': 'CocoExportSummary', 'Dataset': 'DatasetExportSummary'} + "format": { + "CSV": "CsvExportSummary", + "Coco": "CocoExportSummary", + "Dataset": "DatasetExportSummary", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ExportSummary, self).__init__(**kwargs) self.end_date_time = None self.exported_row_count = None @@ -4593,33 +4649,29 @@ class CocoExportSummary(ExportSummary): """ _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'container_name': {'readonly': True}, - 'snapshot_path': {'readonly': True}, + "end_date_time": {"readonly": True}, + "exported_row_count": {"readonly": True}, + "format": {"required": True}, + "labeling_job_id": {"readonly": True}, + "start_date_time": {"readonly": True}, + "container_name": {"readonly": True}, + "snapshot_path": {"readonly": True}, } _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'snapshot_path': {'key': 'snapshotPath', 'type': 'str'}, + "end_date_time": {"key": "endDateTime", "type": "iso-8601"}, + "exported_row_count": {"key": "exportedRowCount", "type": "long"}, + "format": {"key": "format", "type": "str"}, + "labeling_job_id": {"key": "labelingJobId", "type": "str"}, + "start_date_time": {"key": "startDateTime", "type": "iso-8601"}, + "container_name": {"key": "containerName", "type": "str"}, + "snapshot_path": {"key": "snapshotPath", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(CocoExportSummary, self).__init__(**kwargs) - self.format = 'Coco' # type: str + self.format = "Coco" # type: str self.container_name = None self.snapshot_path = None @@ -4636,18 +4688,19 @@ class CodeConfiguration(msrest.serialization.Model): """ _validation = { - 'scoring_script': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "scoring_script": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'scoring_script': {'key': 'scoringScript', 'type': 'str'}, + "code_id": {"key": "codeId", "type": "str"}, + "scoring_script": {"key": "scoringScript", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword code_id: ARM resource ID of the code asset. :paramtype code_id: str @@ -4655,8 +4708,8 @@ def __init__( :paramtype scoring_script: str """ super(CodeConfiguration, self).__init__(**kwargs) - self.code_id = kwargs.get('code_id', None) - self.scoring_script = kwargs['scoring_script'] + self.code_id = kwargs.get("code_id", None) + self.scoring_script = kwargs["scoring_script"] class CodeContainer(Resource): @@ -4682,31 +4735,28 @@ class CodeContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "CodeContainerProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeContainerProperties """ super(CodeContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class CodeContainerProperties(AssetContainer): @@ -4733,25 +4783,22 @@ class CodeContainerProperties(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -4777,14 +4824,11 @@ class CodeContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[CodeContainer]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of CodeContainer objects. If null, there are no additional pages. @@ -4793,8 +4837,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.CodeContainer] """ super(CodeContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class CodeVersion(Resource): @@ -4820,31 +4864,28 @@ class CodeVersion(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeVersionProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "CodeVersionProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeVersionProperties """ super(CodeVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class CodeVersionProperties(AssetBase): @@ -4871,23 +4912,20 @@ class CodeVersionProperties(AssetBase): """ _validation = { - 'provisioning_state': {'readonly': True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'code_uri': {'key': 'codeUri', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "code_uri": {"key": "codeUri", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -4903,7 +4941,7 @@ def __init__( :paramtype code_uri: str """ super(CodeVersionProperties, self).__init__(**kwargs) - self.code_uri = kwargs.get('code_uri', None) + self.code_uri = kwargs.get("code_uri", None) self.provisioning_state = None @@ -4918,14 +4956,11 @@ class CodeVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeVersion]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[CodeVersion]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of CodeVersion objects. If null, there are no additional pages. @@ -4934,8 +4969,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.CodeVersion] """ super(CodeVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class ColumnTransformer(msrest.serialization.Model): @@ -4949,14 +4984,11 @@ class ColumnTransformer(msrest.serialization.Model): """ _attribute_map = { - 'fields': {'key': 'fields', 'type': '[str]'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, + "fields": {"key": "fields", "type": "[str]"}, + "parameters": {"key": "parameters", "type": "object"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword fields: Fields to apply transformer logic on. :paramtype fields: list[str] @@ -4965,8 +4997,8 @@ def __init__( :paramtype parameters: any """ super(ColumnTransformer, self).__init__(**kwargs) - self.fields = kwargs.get('fields', None) - self.parameters = kwargs.get('parameters', None) + self.fields = kwargs.get("fields", None) + self.parameters = kwargs.get("parameters", None) class CommandJob(JobBaseProperties): @@ -5036,43 +5068,53 @@ class CommandJob(JobBaseProperties): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'parameters': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'autologger_settings': {'key': 'autologgerSettings', 'type': 'AutologgerSettings'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'CommandJobLimits'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - } - - def __init__( - self, - **kwargs - ): + "job_type": {"required": True}, + "status": {"readonly": True}, + "command": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "environment_id": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "parameters": {"readonly": True}, + } + + _attribute_map = { + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "autologger_settings": { + "key": "autologgerSettings", + "type": "AutologgerSettings", + }, + "code_id": {"key": "codeId", "type": "str"}, + "command": {"key": "command", "type": "str"}, + "distribution": { + "key": "distribution", + "type": "DistributionConfiguration", + }, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "limits": {"key": "limits", "type": "CommandJobLimits"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "parameters": {"key": "parameters", "type": "object"}, + "resources": {"key": "resources", "type": "JobResourceConfiguration"}, + } + + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -5124,18 +5166,18 @@ def __init__( :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration """ super(CommandJob, self).__init__(**kwargs) - self.job_type = 'Command' # type: str - self.autologger_settings = kwargs.get('autologger_settings', None) - self.code_id = kwargs.get('code_id', None) - self.command = kwargs['command'] - self.distribution = kwargs.get('distribution', None) - self.environment_id = kwargs['environment_id'] - self.environment_variables = kwargs.get('environment_variables', None) - self.inputs = kwargs.get('inputs', None) - self.limits = kwargs.get('limits', None) - self.outputs = kwargs.get('outputs', None) + self.job_type = "Command" # type: str + self.autologger_settings = kwargs.get("autologger_settings", None) + self.code_id = kwargs.get("code_id", None) + self.command = kwargs["command"] + self.distribution = kwargs.get("distribution", None) + self.environment_id = kwargs["environment_id"] + self.environment_variables = kwargs.get("environment_variables", None) + self.inputs = kwargs.get("inputs", None) + self.limits = kwargs.get("limits", None) + self.outputs = kwargs.get("outputs", None) self.parameters = None - self.resources = kwargs.get('resources', None) + self.resources = kwargs.get("resources", None) class JobLimits(msrest.serialization.Model): @@ -5155,22 +5197,22 @@ class JobLimits(msrest.serialization.Model): """ _validation = { - 'job_limits_type': {'required': True}, + "job_limits_type": {"required": True}, } _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "job_limits_type": {"key": "jobLimitsType", "type": "str"}, + "timeout": {"key": "timeout", "type": "duration"}, } _subtype_map = { - 'job_limits_type': {'Command': 'CommandJobLimits', 'Sweep': 'SweepJobLimits'} + "job_limits_type": { + "Command": "CommandJobLimits", + "Sweep": "SweepJobLimits", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. Only supports duration with precision as low as Seconds. @@ -5178,7 +5220,7 @@ def __init__( """ super(JobLimits, self).__init__(**kwargs) self.job_limits_type = None # type: Optional[str] - self.timeout = kwargs.get('timeout', None) + self.timeout = kwargs.get("timeout", None) class CommandJobLimits(JobLimits): @@ -5195,25 +5237,22 @@ class CommandJobLimits(JobLimits): """ _validation = { - 'job_limits_type': {'required': True}, + "job_limits_type": {"required": True}, } _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "job_limits_type": {"key": "jobLimitsType", "type": "str"}, + "timeout": {"key": "timeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. Only supports duration with precision as low as Seconds. :paramtype timeout: ~datetime.timedelta """ super(CommandJobLimits, self).__init__(**kwargs) - self.job_limits_type = 'Command' # type: str + self.job_limits_type = "Command" # type: str class ComponentContainer(Resource): @@ -5239,81 +5278,78 @@ class ComponentContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "ComponentContainerProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentContainerProperties """ super(ComponentContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class ComponentContainerProperties(AssetContainer): """Component container definition. -.. raw:: html + .. raw:: html - . + . - Variables are only populated by the server, and will be ignored when sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the component container. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState + :ivar description: The asset description text. + :vartype description: str + :ivar properties: The asset property dictionary. + :vartype properties: dict[str, str] + :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + :ivar is_archived: Is the asset archived?. + :vartype is_archived: bool + :ivar latest_version: The latest version inside this container. + :vartype latest_version: str + :ivar next_version: The next auto incremental version. + :vartype next_version: str + :ivar provisioning_state: Provisioning state for the component container. Possible values + include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.machinelearningservices.models.AssetProvisioningState """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -5339,14 +5375,11 @@ class ComponentContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ComponentContainer]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of ComponentContainer objects. If null, there are no additional pages. @@ -5354,9 +5387,11 @@ def __init__( :keyword value: An array of objects of type ComponentContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainer] """ - super(ComponentContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(ComponentContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class ComponentVersion(Resource): @@ -5382,31 +5417,31 @@ class ComponentVersion(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentVersionProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "ComponentVersionProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentVersionProperties """ super(ComponentVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class ComponentVersionProperties(AssetBase): @@ -5425,10 +5460,10 @@ class ComponentVersionProperties(AssetBase): :ivar is_archived: Is the asset archived?. :vartype is_archived: bool :ivar component_spec: Defines Component definition details. - - + + .. raw:: html - + . @@ -5440,23 +5475,20 @@ class ComponentVersionProperties(AssetBase): """ _validation = { - 'provisioning_state': {'readonly': True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'component_spec': {'key': 'componentSpec', 'type': 'object'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "component_spec": {"key": "componentSpec", "type": "object"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -5469,17 +5501,17 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool :keyword component_spec: Defines Component definition details. - - + + .. raw:: html - + . :paramtype component_spec: any """ super(ComponentVersionProperties, self).__init__(**kwargs) - self.component_spec = kwargs.get('component_spec', None) + self.component_spec = kwargs.get("component_spec", None) self.provisioning_state = None @@ -5494,14 +5526,11 @@ class ComponentVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentVersion]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ComponentVersion]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of ComponentVersion objects. If null, there are no additional pages. @@ -5509,9 +5538,11 @@ def __init__( :keyword value: An array of objects of type ComponentVersion. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersion] """ - super(ComponentVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(ComponentVersionResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class ComputeInstanceSchema(msrest.serialization.Model): @@ -5522,19 +5553,19 @@ class ComputeInstanceSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, + "properties": { + "key": "properties", + "type": "ComputeInstanceProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of ComputeInstance. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties """ super(ComputeInstanceSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class ComputeInstance(Compute, ComputeInstanceSchema): @@ -5576,32 +5607,35 @@ class ComputeInstance(Compute, ComputeInstanceSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": { + "key": "properties", + "type": "ComputeInstanceProperties", + }, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of ComputeInstance. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties @@ -5616,17 +5650,17 @@ def __init__( :paramtype disable_local_auth: bool """ super(ComputeInstance, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'ComputeInstance' # type: str - self.compute_location = kwargs.get('compute_location', None) + self.properties = kwargs.get("properties", None) + self.compute_type = "ComputeInstance" # type: str + self.compute_location = kwargs.get("compute_location", None) self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) + self.disable_local_auth = kwargs.get("disable_local_auth", None) class ComputeInstanceApplication(msrest.serialization.Model): @@ -5639,14 +5673,11 @@ class ComputeInstanceApplication(msrest.serialization.Model): """ _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, + "display_name": {"key": "displayName", "type": "str"}, + "endpoint_uri": {"key": "endpointUri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword display_name: Name of the ComputeInstance application. :paramtype display_name: str @@ -5654,8 +5685,8 @@ def __init__( :paramtype endpoint_uri: str """ super(ComputeInstanceApplication, self).__init__(**kwargs) - self.display_name = kwargs.get('display_name', None) - self.endpoint_uri = kwargs.get('endpoint_uri', None) + self.display_name = kwargs.get("display_name", None) + self.endpoint_uri = kwargs.get("endpoint_uri", None) class ComputeInstanceAutologgerSettings(msrest.serialization.Model): @@ -5667,13 +5698,10 @@ class ComputeInstanceAutologgerSettings(msrest.serialization.Model): """ _attribute_map = { - 'mlflow_autologger': {'key': 'mlflowAutologger', 'type': 'str'}, + "mlflow_autologger": {"key": "mlflowAutologger", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mlflow_autologger: Indicates whether mlflow autologger is enabled for notebooks. Possible values include: "Enabled", "Disabled". @@ -5681,7 +5709,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.MlflowAutologger """ super(ComputeInstanceAutologgerSettings, self).__init__(**kwargs) - self.mlflow_autologger = kwargs.get('mlflow_autologger', None) + self.mlflow_autologger = kwargs.get("mlflow_autologger", None) class ComputeInstanceConnectivityEndpoints(msrest.serialization.Model): @@ -5697,21 +5725,17 @@ class ComputeInstanceConnectivityEndpoints(msrest.serialization.Model): """ _validation = { - 'public_ip_address': {'readonly': True}, - 'private_ip_address': {'readonly': True}, + "public_ip_address": {"readonly": True}, + "private_ip_address": {"readonly": True}, } _attribute_map = { - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + "public_ip_address": {"key": "publicIpAddress", "type": "str"}, + "private_ip_address": {"key": "privateIpAddress", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ComputeInstanceConnectivityEndpoints, self).__init__(**kwargs) self.public_ip_address = None self.private_ip_address = None @@ -5737,22 +5761,22 @@ class ComputeInstanceContainer(msrest.serialization.Model): """ _validation = { - 'services': {'readonly': True}, + "services": {"readonly": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'autosave': {'key': 'autosave', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'network': {'key': 'network', 'type': 'str'}, - 'environment': {'key': 'environment', 'type': 'ComputeInstanceEnvironmentInfo'}, - 'services': {'key': 'services', 'type': '[object]'}, + "name": {"key": "name", "type": "str"}, + "autosave": {"key": "autosave", "type": "str"}, + "gpu": {"key": "gpu", "type": "str"}, + "network": {"key": "network", "type": "str"}, + "environment": { + "key": "environment", + "type": "ComputeInstanceEnvironmentInfo", + }, + "services": {"key": "services", "type": "[object]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: Name of the ComputeInstance container. :paramtype name: str @@ -5767,11 +5791,11 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ComputeInstanceEnvironmentInfo """ super(ComputeInstanceContainer, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.autosave = kwargs.get('autosave', None) - self.gpu = kwargs.get('gpu', None) - self.network = kwargs.get('network', None) - self.environment = kwargs.get('environment', None) + self.name = kwargs.get("name", None) + self.autosave = kwargs.get("autosave", None) + self.gpu = kwargs.get("gpu", None) + self.network = kwargs.get("network", None) + self.environment = kwargs.get("environment", None) self.services = None @@ -5789,23 +5813,19 @@ class ComputeInstanceCreatedBy(msrest.serialization.Model): """ _validation = { - 'user_name': {'readonly': True}, - 'user_org_id': {'readonly': True}, - 'user_id': {'readonly': True}, + "user_name": {"readonly": True}, + "user_org_id": {"readonly": True}, + "user_id": {"readonly": True}, } _attribute_map = { - 'user_name': {'key': 'userName', 'type': 'str'}, - 'user_org_id': {'key': 'userOrgId', 'type': 'str'}, - 'user_id': {'key': 'userId', 'type': 'str'}, + "user_name": {"key": "userName", "type": "str"}, + "user_org_id": {"key": "userOrgId", "type": "str"}, + "user_id": {"key": "userId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ComputeInstanceCreatedBy, self).__init__(**kwargs) self.user_name = None self.user_org_id = None @@ -5830,16 +5850,13 @@ class ComputeInstanceDataDisk(msrest.serialization.Model): """ _attribute_map = { - 'caching': {'key': 'caching', 'type': 'str'}, - 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, - 'lun': {'key': 'lun', 'type': 'int'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + "caching": {"key": "caching", "type": "str"}, + "disk_size_gb": {"key": "diskSizeGB", "type": "int"}, + "lun": {"key": "lun", "type": "int"}, + "storage_account_type": {"key": "storageAccountType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword caching: Caching type of Data Disk. Possible values include: "None", "ReadOnly", "ReadWrite". @@ -5855,10 +5872,12 @@ def __init__( ~azure.mgmt.machinelearningservices.models.StorageAccountType """ super(ComputeInstanceDataDisk, self).__init__(**kwargs) - self.caching = kwargs.get('caching', None) - self.disk_size_gb = kwargs.get('disk_size_gb', None) - self.lun = kwargs.get('lun', None) - self.storage_account_type = kwargs.get('storage_account_type', "Standard_LRS") + self.caching = kwargs.get("caching", None) + self.disk_size_gb = kwargs.get("disk_size_gb", None) + self.lun = kwargs.get("lun", None) + self.storage_account_type = kwargs.get( + "storage_account_type", "Standard_LRS" + ) class ComputeInstanceDataMount(msrest.serialization.Model): @@ -5886,21 +5905,18 @@ class ComputeInstanceDataMount(msrest.serialization.Model): """ _attribute_map = { - 'source': {'key': 'source', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'mount_name': {'key': 'mountName', 'type': 'str'}, - 'mount_action': {'key': 'mountAction', 'type': 'str'}, - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - 'mount_state': {'key': 'mountState', 'type': 'str'}, - 'mounted_on': {'key': 'mountedOn', 'type': 'iso-8601'}, - 'error': {'key': 'error', 'type': 'str'}, + "source": {"key": "source", "type": "str"}, + "source_type": {"key": "sourceType", "type": "str"}, + "mount_name": {"key": "mountName", "type": "str"}, + "mount_action": {"key": "mountAction", "type": "str"}, + "created_by": {"key": "createdBy", "type": "str"}, + "mount_path": {"key": "mountPath", "type": "str"}, + "mount_state": {"key": "mountState", "type": "str"}, + "mounted_on": {"key": "mountedOn", "type": "iso-8601"}, + "error": {"key": "error", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword source: Source of the ComputeInstance data mount. :paramtype source: str @@ -5923,15 +5939,15 @@ def __init__( :paramtype error: str """ super(ComputeInstanceDataMount, self).__init__(**kwargs) - self.source = kwargs.get('source', None) - self.source_type = kwargs.get('source_type', None) - self.mount_name = kwargs.get('mount_name', None) - self.mount_action = kwargs.get('mount_action', None) - self.created_by = kwargs.get('created_by', None) - self.mount_path = kwargs.get('mount_path', None) - self.mount_state = kwargs.get('mount_state', None) - self.mounted_on = kwargs.get('mounted_on', None) - self.error = kwargs.get('error', None) + self.source = kwargs.get("source", None) + self.source_type = kwargs.get("source_type", None) + self.mount_name = kwargs.get("mount_name", None) + self.mount_action = kwargs.get("mount_action", None) + self.created_by = kwargs.get("created_by", None) + self.mount_path = kwargs.get("mount_path", None) + self.mount_state = kwargs.get("mount_state", None) + self.mounted_on = kwargs.get("mounted_on", None) + self.error = kwargs.get("error", None) class ComputeInstanceEnvironmentInfo(msrest.serialization.Model): @@ -5944,14 +5960,11 @@ class ComputeInstanceEnvironmentInfo(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "version": {"key": "version", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: name of environment. :paramtype name: str @@ -5959,8 +5972,8 @@ def __init__( :paramtype version: str """ super(ComputeInstanceEnvironmentInfo, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.version = kwargs.get('version', None) + self.name = kwargs.get("name", None) + self.version = kwargs.get("version", None) class ComputeInstanceLastOperation(msrest.serialization.Model): @@ -5980,16 +5993,13 @@ class ComputeInstanceLastOperation(msrest.serialization.Model): """ _attribute_map = { - 'operation_name': {'key': 'operationName', 'type': 'str'}, - 'operation_time': {'key': 'operationTime', 'type': 'iso-8601'}, - 'operation_status': {'key': 'operationStatus', 'type': 'str'}, - 'operation_trigger': {'key': 'operationTrigger', 'type': 'str'}, + "operation_name": {"key": "operationName", "type": "str"}, + "operation_time": {"key": "operationTime", "type": "iso-8601"}, + "operation_status": {"key": "operationStatus", "type": "str"}, + "operation_trigger": {"key": "operationTrigger", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword operation_name: Name of the last operation. Possible values include: "Create", "Start", "Stop", "Restart", "Reimage", "Delete". @@ -6006,10 +6016,10 @@ def __init__( ~azure.mgmt.machinelearningservices.models.OperationTrigger """ super(ComputeInstanceLastOperation, self).__init__(**kwargs) - self.operation_name = kwargs.get('operation_name', None) - self.operation_time = kwargs.get('operation_time', None) - self.operation_status = kwargs.get('operation_status', None) - self.operation_trigger = kwargs.get('operation_trigger', None) + self.operation_name = kwargs.get("operation_name", None) + self.operation_time = kwargs.get("operation_time", None) + self.operation_status = kwargs.get("operation_status", None) + self.operation_trigger = kwargs.get("operation_trigger", None) class ComputeInstanceProperties(msrest.serialization.Model): @@ -6087,49 +6097,88 @@ class ComputeInstanceProperties(msrest.serialization.Model): """ _validation = { - 'os_image_metadata': {'readonly': True}, - 'connectivity_endpoints': {'readonly': True}, - 'applications': {'readonly': True}, - 'created_by': {'readonly': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'last_operation': {'readonly': True}, - 'containers': {'readonly': True}, - 'data_disks': {'readonly': True}, - 'data_mounts': {'readonly': True}, - 'versions': {'readonly': True}, - } - - _attribute_map = { - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'application_sharing_policy': {'key': 'applicationSharingPolicy', 'type': 'str'}, - 'autologger_settings': {'key': 'autologgerSettings', 'type': 'ComputeInstanceAutologgerSettings'}, - 'ssh_settings': {'key': 'sshSettings', 'type': 'ComputeInstanceSshSettings'}, - 'custom_services': {'key': 'customServices', 'type': '[CustomService]'}, - 'os_image_metadata': {'key': 'osImageMetadata', 'type': 'ImageMetadata'}, - 'connectivity_endpoints': {'key': 'connectivityEndpoints', 'type': 'ComputeInstanceConnectivityEndpoints'}, - 'applications': {'key': 'applications', 'type': '[ComputeInstanceApplication]'}, - 'created_by': {'key': 'createdBy', 'type': 'ComputeInstanceCreatedBy'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'compute_instance_authorization_type': {'key': 'computeInstanceAuthorizationType', 'type': 'str'}, - 'personal_compute_instance_settings': {'key': 'personalComputeInstanceSettings', 'type': 'PersonalComputeInstanceSettings'}, - 'setup_scripts': {'key': 'setupScripts', 'type': 'SetupScripts'}, - 'last_operation': {'key': 'lastOperation', 'type': 'ComputeInstanceLastOperation'}, - 'schedules': {'key': 'schedules', 'type': 'ComputeSchedules'}, - 'idle_time_before_shutdown': {'key': 'idleTimeBeforeShutdown', 'type': 'str'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'containers': {'key': 'containers', 'type': '[ComputeInstanceContainer]'}, - 'data_disks': {'key': 'dataDisks', 'type': '[ComputeInstanceDataDisk]'}, - 'data_mounts': {'key': 'dataMounts', 'type': '[ComputeInstanceDataMount]'}, - 'versions': {'key': 'versions', 'type': 'ComputeInstanceVersion'}, - } - - def __init__( - self, - **kwargs - ): + "os_image_metadata": {"readonly": True}, + "connectivity_endpoints": {"readonly": True}, + "applications": {"readonly": True}, + "created_by": {"readonly": True}, + "errors": {"readonly": True}, + "state": {"readonly": True}, + "last_operation": {"readonly": True}, + "containers": {"readonly": True}, + "data_disks": {"readonly": True}, + "data_mounts": {"readonly": True}, + "versions": {"readonly": True}, + } + + _attribute_map = { + "vm_size": {"key": "vmSize", "type": "str"}, + "subnet": {"key": "subnet", "type": "ResourceId"}, + "application_sharing_policy": { + "key": "applicationSharingPolicy", + "type": "str", + }, + "autologger_settings": { + "key": "autologgerSettings", + "type": "ComputeInstanceAutologgerSettings", + }, + "ssh_settings": { + "key": "sshSettings", + "type": "ComputeInstanceSshSettings", + }, + "custom_services": { + "key": "customServices", + "type": "[CustomService]", + }, + "os_image_metadata": { + "key": "osImageMetadata", + "type": "ImageMetadata", + }, + "connectivity_endpoints": { + "key": "connectivityEndpoints", + "type": "ComputeInstanceConnectivityEndpoints", + }, + "applications": { + "key": "applications", + "type": "[ComputeInstanceApplication]", + }, + "created_by": {"key": "createdBy", "type": "ComputeInstanceCreatedBy"}, + "errors": {"key": "errors", "type": "[ErrorResponse]"}, + "state": {"key": "state", "type": "str"}, + "compute_instance_authorization_type": { + "key": "computeInstanceAuthorizationType", + "type": "str", + }, + "personal_compute_instance_settings": { + "key": "personalComputeInstanceSettings", + "type": "PersonalComputeInstanceSettings", + }, + "setup_scripts": {"key": "setupScripts", "type": "SetupScripts"}, + "last_operation": { + "key": "lastOperation", + "type": "ComputeInstanceLastOperation", + }, + "schedules": {"key": "schedules", "type": "ComputeSchedules"}, + "idle_time_before_shutdown": { + "key": "idleTimeBeforeShutdown", + "type": "str", + }, + "enable_node_public_ip": {"key": "enableNodePublicIp", "type": "bool"}, + "containers": { + "key": "containers", + "type": "[ComputeInstanceContainer]", + }, + "data_disks": { + "key": "dataDisks", + "type": "[ComputeInstanceDataDisk]", + }, + "data_mounts": { + "key": "dataMounts", + "type": "[ComputeInstanceDataMount]", + }, + "versions": {"key": "versions", "type": "ComputeInstanceVersion"}, + } + + def __init__(self, **kwargs): """ :keyword vm_size: Virtual Machine Size. :paramtype vm_size: str @@ -6171,25 +6220,33 @@ def __init__( :paramtype enable_node_public_ip: bool """ super(ComputeInstanceProperties, self).__init__(**kwargs) - self.vm_size = kwargs.get('vm_size', None) - self.subnet = kwargs.get('subnet', None) - self.application_sharing_policy = kwargs.get('application_sharing_policy', "Shared") - self.autologger_settings = kwargs.get('autologger_settings', None) - self.ssh_settings = kwargs.get('ssh_settings', None) - self.custom_services = kwargs.get('custom_services', None) + self.vm_size = kwargs.get("vm_size", None) + self.subnet = kwargs.get("subnet", None) + self.application_sharing_policy = kwargs.get( + "application_sharing_policy", "Shared" + ) + self.autologger_settings = kwargs.get("autologger_settings", None) + self.ssh_settings = kwargs.get("ssh_settings", None) + self.custom_services = kwargs.get("custom_services", None) self.os_image_metadata = None self.connectivity_endpoints = None self.applications = None self.created_by = None self.errors = None self.state = None - self.compute_instance_authorization_type = kwargs.get('compute_instance_authorization_type', "personal") - self.personal_compute_instance_settings = kwargs.get('personal_compute_instance_settings', None) - self.setup_scripts = kwargs.get('setup_scripts', None) + self.compute_instance_authorization_type = kwargs.get( + "compute_instance_authorization_type", "personal" + ) + self.personal_compute_instance_settings = kwargs.get( + "personal_compute_instance_settings", None + ) + self.setup_scripts = kwargs.get("setup_scripts", None) self.last_operation = None - self.schedules = kwargs.get('schedules', None) - self.idle_time_before_shutdown = kwargs.get('idle_time_before_shutdown', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) + self.schedules = kwargs.get("schedules", None) + self.idle_time_before_shutdown = kwargs.get( + "idle_time_before_shutdown", None + ) + self.enable_node_public_ip = kwargs.get("enable_node_public_ip", None) self.containers = None self.data_disks = None self.data_mounts = None @@ -6216,21 +6273,18 @@ class ComputeInstanceSshSettings(msrest.serialization.Model): """ _validation = { - 'admin_user_name': {'readonly': True}, - 'ssh_port': {'readonly': True}, + "admin_user_name": {"readonly": True}, + "ssh_port": {"readonly": True}, } _attribute_map = { - 'ssh_public_access': {'key': 'sshPublicAccess', 'type': 'str'}, - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'admin_public_key': {'key': 'adminPublicKey', 'type': 'str'}, + "ssh_public_access": {"key": "sshPublicAccess", "type": "str"}, + "admin_user_name": {"key": "adminUserName", "type": "str"}, + "ssh_port": {"key": "sshPort", "type": "int"}, + "admin_public_key": {"key": "adminPublicKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword ssh_public_access: State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the @@ -6242,10 +6296,10 @@ def __init__( :paramtype admin_public_key: str """ super(ComputeInstanceSshSettings, self).__init__(**kwargs) - self.ssh_public_access = kwargs.get('ssh_public_access', "Disabled") + self.ssh_public_access = kwargs.get("ssh_public_access", "Disabled") self.admin_user_name = None self.ssh_port = None - self.admin_public_key = kwargs.get('admin_public_key', None) + self.admin_public_key = kwargs.get("admin_public_key", None) class ComputeInstanceVersion(msrest.serialization.Model): @@ -6256,19 +6310,16 @@ class ComputeInstanceVersion(msrest.serialization.Model): """ _attribute_map = { - 'runtime': {'key': 'runtime', 'type': 'str'}, + "runtime": {"key": "runtime", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword runtime: Runtime of compute instance. :paramtype runtime: str """ super(ComputeInstanceVersion, self).__init__(**kwargs) - self.runtime = kwargs.get('runtime', None) + self.runtime = kwargs.get("runtime", None) class ComputeResourceSchema(msrest.serialization.Model): @@ -6279,19 +6330,16 @@ class ComputeResourceSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, + "properties": {"key": "properties", "type": "Compute"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Compute properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute """ super(ComputeResourceSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class ComputeResource(Resource, ComputeResourceSchema): @@ -6323,28 +6371,25 @@ class ComputeResource(Resource, ComputeResourceSchema): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "properties": {"key": "properties", "type": "Compute"}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Compute properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute @@ -6358,11 +6403,11 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ super(ComputeResource, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) + self.properties = kwargs.get("properties", None) + self.identity = kwargs.get("identity", None) + self.location = kwargs.get("location", None) + self.tags = kwargs.get("tags", None) + self.sku = kwargs.get("sku", None) self.id = None self.name = None self.type = None @@ -6377,19 +6422,16 @@ class ComputeRuntimeDto(msrest.serialization.Model): """ _attribute_map = { - 'spark_runtime_version': {'key': 'sparkRuntimeVersion', 'type': 'str'}, + "spark_runtime_version": {"key": "sparkRuntimeVersion", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword spark_runtime_version: :paramtype spark_runtime_version: str """ super(ComputeRuntimeDto, self).__init__(**kwargs) - self.spark_runtime_version = kwargs.get('spark_runtime_version', None) + self.spark_runtime_version = kwargs.get("spark_runtime_version", None) class ComputeSchedules(msrest.serialization.Model): @@ -6401,20 +6443,20 @@ class ComputeSchedules(msrest.serialization.Model): """ _attribute_map = { - 'compute_start_stop': {'key': 'computeStartStop', 'type': '[ComputeStartStopSchedule]'}, + "compute_start_stop": { + "key": "computeStartStop", + "type": "[ComputeStartStopSchedule]", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword compute_start_stop: The list of compute start stop schedules to be applied. :paramtype compute_start_stop: list[~azure.mgmt.machinelearningservices.models.ComputeStartStopSchedule] """ super(ComputeSchedules, self).__init__(**kwargs) - self.compute_start_stop = kwargs.get('compute_start_stop', None) + self.compute_start_stop = kwargs.get("compute_start_stop", None) class ComputeStartStopSchedule(msrest.serialization.Model): @@ -6445,25 +6487,22 @@ class ComputeStartStopSchedule(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'provisioning_status': {'readonly': True}, + "id": {"readonly": True}, + "provisioning_status": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'recurrence': {'key': 'recurrence', 'type': 'RecurrenceTrigger'}, - 'cron': {'key': 'cron', 'type': 'CronTrigger'}, - 'schedule': {'key': 'schedule', 'type': 'ScheduleBase'}, + "id": {"key": "id", "type": "str"}, + "provisioning_status": {"key": "provisioningStatus", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "action": {"key": "action", "type": "str"}, + "trigger_type": {"key": "triggerType", "type": "str"}, + "recurrence": {"key": "recurrence", "type": "RecurrenceTrigger"}, + "cron": {"key": "cron", "type": "CronTrigger"}, + "schedule": {"key": "schedule", "type": "ScheduleBase"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword status: Is the schedule enabled or disabled?. Possible values include: "Enabled", "Disabled". @@ -6483,12 +6522,12 @@ def __init__( super(ComputeStartStopSchedule, self).__init__(**kwargs) self.id = None self.provisioning_status = None - self.status = kwargs.get('status', None) - self.action = kwargs.get('action', None) - self.trigger_type = kwargs.get('trigger_type', None) - self.recurrence = kwargs.get('recurrence', None) - self.cron = kwargs.get('cron', None) - self.schedule = kwargs.get('schedule', None) + self.status = kwargs.get("status", None) + self.action = kwargs.get("action", None) + self.trigger_type = kwargs.get("trigger_type", None) + self.recurrence = kwargs.get("recurrence", None) + self.cron = kwargs.get("cron", None) + self.schedule = kwargs.get("schedule", None) class ContainerResourceRequirements(msrest.serialization.Model): @@ -6503,14 +6542,17 @@ class ContainerResourceRequirements(msrest.serialization.Model): """ _attribute_map = { - 'container_resource_limits': {'key': 'containerResourceLimits', 'type': 'ContainerResourceSettings'}, - 'container_resource_requests': {'key': 'containerResourceRequests', 'type': 'ContainerResourceSettings'}, + "container_resource_limits": { + "key": "containerResourceLimits", + "type": "ContainerResourceSettings", + }, + "container_resource_requests": { + "key": "containerResourceRequests", + "type": "ContainerResourceSettings", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword container_resource_limits: Container resource limit info:. :paramtype container_resource_limits: @@ -6520,8 +6562,12 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings """ super(ContainerResourceRequirements, self).__init__(**kwargs) - self.container_resource_limits = kwargs.get('container_resource_limits', None) - self.container_resource_requests = kwargs.get('container_resource_requests', None) + self.container_resource_limits = kwargs.get( + "container_resource_limits", None + ) + self.container_resource_requests = kwargs.get( + "container_resource_requests", None + ) class ContainerResourceSettings(msrest.serialization.Model): @@ -6539,15 +6585,12 @@ class ContainerResourceSettings(msrest.serialization.Model): """ _attribute_map = { - 'cpu': {'key': 'cpu', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'memory': {'key': 'memory', 'type': 'str'}, + "cpu": {"key": "cpu", "type": "str"}, + "gpu": {"key": "gpu", "type": "str"}, + "memory": {"key": "memory", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword cpu: Number of vCPUs request/limit for container. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. @@ -6560,9 +6603,9 @@ def __init__( :paramtype memory: str """ super(ContainerResourceSettings, self).__init__(**kwargs) - self.cpu = kwargs.get('cpu', None) - self.gpu = kwargs.get('gpu', None) - self.memory = kwargs.get('memory', None) + self.cpu = kwargs.get("cpu", None) + self.gpu = kwargs.get("gpu", None) + self.memory = kwargs.get("memory", None) class CosmosDbSettings(msrest.serialization.Model): @@ -6573,19 +6616,21 @@ class CosmosDbSettings(msrest.serialization.Model): """ _attribute_map = { - 'collections_throughput': {'key': 'collectionsThroughput', 'type': 'int'}, + "collections_throughput": { + "key": "collectionsThroughput", + "type": "int", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword collections_throughput: The throughput of the collections in cosmosdb database. :paramtype collections_throughput: int """ super(CosmosDbSettings, self).__init__(**kwargs) - self.collections_throughput = kwargs.get('collections_throughput', None) + self.collections_throughput = kwargs.get( + "collections_throughput", None + ) class TriggerBase(msrest.serialization.Model): @@ -6614,24 +6659,24 @@ class TriggerBase(msrest.serialization.Model): """ _validation = { - 'trigger_type': {'required': True}, + "trigger_type": {"required": True}, } _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, + "end_time": {"key": "endTime", "type": "str"}, + "start_time": {"key": "startTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "trigger_type": {"key": "triggerType", "type": "str"}, } _subtype_map = { - 'trigger_type': {'Cron': 'CronTrigger', 'Recurrence': 'RecurrenceTrigger'} + "trigger_type": { + "Cron": "CronTrigger", + "Recurrence": "RecurrenceTrigger", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer https://en.wikipedia.org/wiki/ISO_8601. @@ -6647,9 +6692,9 @@ def __init__( :paramtype time_zone: str """ super(TriggerBase, self).__init__(**kwargs) - self.end_time = kwargs.get('end_time', None) - self.start_time = kwargs.get('start_time', None) - self.time_zone = kwargs.get('time_zone', "UTC") + self.end_time = kwargs.get("end_time", None) + self.start_time = kwargs.get("start_time", None) + self.time_zone = kwargs.get("time_zone", "UTC") self.trigger_type = None # type: Optional[str] @@ -6679,22 +6724,19 @@ class CronTrigger(TriggerBase): """ _validation = { - 'trigger_type': {'required': True}, - 'expression': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "trigger_type": {"required": True}, + "expression": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, + "end_time": {"key": "endTime", "type": "str"}, + "start_time": {"key": "startTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "trigger_type": {"key": "triggerType", "type": "str"}, + "expression": {"key": "expression", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer https://en.wikipedia.org/wiki/ISO_8601. @@ -6713,8 +6755,8 @@ def __init__( :paramtype expression: str """ super(CronTrigger, self).__init__(**kwargs) - self.trigger_type = 'Cron' # type: str - self.expression = kwargs['expression'] + self.trigger_type = "Cron" # type: str + self.expression = kwargs["expression"] class CsvExportSummary(ExportSummary): @@ -6742,33 +6784,29 @@ class CsvExportSummary(ExportSummary): """ _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'container_name': {'readonly': True}, - 'snapshot_path': {'readonly': True}, + "end_date_time": {"readonly": True}, + "exported_row_count": {"readonly": True}, + "format": {"required": True}, + "labeling_job_id": {"readonly": True}, + "start_date_time": {"readonly": True}, + "container_name": {"readonly": True}, + "snapshot_path": {"readonly": True}, } _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'snapshot_path': {'key': 'snapshotPath', 'type': 'str'}, + "end_date_time": {"key": "endDateTime", "type": "iso-8601"}, + "exported_row_count": {"key": "exportedRowCount", "type": "long"}, + "format": {"key": "format", "type": "str"}, + "labeling_job_id": {"key": "labelingJobId", "type": "str"}, + "start_date_time": {"key": "startDateTime", "type": "iso-8601"}, + "container_name": {"key": "containerName", "type": "str"}, + "snapshot_path": {"key": "snapshotPath", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(CsvExportSummary, self).__init__(**kwargs) - self.format = 'CSV' # type: str + self.format = "CSV" # type: str self.container_name = None self.snapshot_path = None @@ -6786,26 +6824,23 @@ class CustomForecastHorizon(ForecastHorizon): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Required. [Required] Forecast horizon value. :paramtype value: int """ super(CustomForecastHorizon, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] + self.mode = "Custom" # type: str + self.value = kwargs["value"] class JobInput(msrest.serialization.Model): @@ -6825,28 +6860,33 @@ class JobInput(msrest.serialization.Model): """ _validation = { - 'job_input_type': {'required': True}, + "job_input_type": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } _subtype_map = { - 'job_input_type': {'custom_model': 'CustomModelJobInput', 'literal': 'LiteralJobInput', 'mlflow_model': 'MLFlowModelJobInput', 'mltable': 'MLTableJobInput', 'triton_model': 'TritonModelJobInput', 'uri_file': 'UriFileJobInput', 'uri_folder': 'UriFolderJobInput'} + "job_input_type": { + "custom_model": "CustomModelJobInput", + "literal": "LiteralJobInput", + "mlflow_model": "MLFlowModelJobInput", + "mltable": "MLTableJobInput", + "triton_model": "TritonModelJobInput", + "uri_file": "UriFileJobInput", + "uri_folder": "UriFolderJobInput", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: Description for the input. :paramtype description: str """ super(JobInput, self).__init__(**kwargs) - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.job_input_type = None # type: Optional[str] @@ -6869,21 +6909,18 @@ class CustomModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -6894,10 +6931,10 @@ def __init__( :paramtype description: str """ super(CustomModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'custom_model' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "custom_model" # type: str + self.description = kwargs.get("description", None) class JobOutput(msrest.serialization.Model): @@ -6917,28 +6954,32 @@ class JobOutput(msrest.serialization.Model): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } _subtype_map = { - 'job_output_type': {'custom_model': 'CustomModelJobOutput', 'mlflow_model': 'MLFlowModelJobOutput', 'mltable': 'MLTableJobOutput', 'triton_model': 'TritonModelJobOutput', 'uri_file': 'UriFileJobOutput', 'uri_folder': 'UriFolderJobOutput'} + "job_output_type": { + "custom_model": "CustomModelJobOutput", + "mlflow_model": "MLFlowModelJobOutput", + "mltable": "MLTableJobOutput", + "triton_model": "TritonModelJobOutput", + "uri_file": "UriFileJobOutput", + "uri_folder": "UriFolderJobOutput", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: Description for the output. :paramtype description: str """ super(JobOutput, self).__init__(**kwargs) - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.job_output_type = None # type: Optional[str] @@ -6965,22 +7006,19 @@ class CustomModelJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "asset_name": {"key": "assetName", "type": "str"}, + "asset_version": {"key": "assetVersion", "type": "str"}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword asset_name: Output Asset Name. :paramtype asset_name: str @@ -6995,12 +7033,12 @@ def __init__( :paramtype description: str """ super(CustomModelJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.asset_version = kwargs.get('asset_version', None) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'custom_model' # type: str - self.description = kwargs.get('description', None) + self.asset_name = kwargs.get("asset_name", None) + self.asset_version = kwargs.get("asset_version", None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "custom_model" # type: str + self.description = kwargs.get("description", None) class CustomNCrossValidations(NCrossValidations): @@ -7016,26 +7054,23 @@ class CustomNCrossValidations(NCrossValidations): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Required. [Required] N-Cross validations value. :paramtype value: int """ super(CustomNCrossValidations, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] + self.mode = "Custom" # type: str + self.value = kwargs["value"] class CustomSeasonality(Seasonality): @@ -7051,26 +7086,23 @@ class CustomSeasonality(Seasonality): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Required. [Required] Seasonality value. :paramtype value: int """ super(CustomSeasonality, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] + self.mode = "Custom" # type: str + self.value = kwargs["value"] class CustomService(msrest.serialization.Model): @@ -7095,19 +7127,19 @@ class CustomService(msrest.serialization.Model): """ _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'name': {'key': 'name', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'Image'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{EnvironmentVariable}'}, - 'docker': {'key': 'docker', 'type': 'Docker'}, - 'endpoints': {'key': 'endpoints', 'type': '[Endpoint]'}, - 'volumes': {'key': 'volumes', 'type': '[VolumeDefinition]'}, + "additional_properties": {"key": "", "type": "{object}"}, + "name": {"key": "name", "type": "str"}, + "image": {"key": "image", "type": "Image"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{EnvironmentVariable}", + }, + "docker": {"key": "docker", "type": "Docker"}, + "endpoints": {"key": "endpoints", "type": "[Endpoint]"}, + "volumes": {"key": "volumes", "type": "[VolumeDefinition]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword additional_properties: Unmatched properties from the message are deserialized to this collection. @@ -7127,13 +7159,13 @@ def __init__( :paramtype volumes: list[~azure.mgmt.machinelearningservices.models.VolumeDefinition] """ super(CustomService, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.name = kwargs.get('name', None) - self.image = kwargs.get('image', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.docker = kwargs.get('docker', None) - self.endpoints = kwargs.get('endpoints', None) - self.volumes = kwargs.get('volumes', None) + self.additional_properties = kwargs.get("additional_properties", None) + self.name = kwargs.get("name", None) + self.image = kwargs.get("image", None) + self.environment_variables = kwargs.get("environment_variables", None) + self.docker = kwargs.get("docker", None) + self.endpoints = kwargs.get("endpoints", None) + self.volumes = kwargs.get("volumes", None) class CustomTargetLags(TargetLags): @@ -7149,26 +7181,23 @@ class CustomTargetLags(TargetLags): """ _validation = { - 'mode': {'required': True}, - 'values': {'required': True}, + "mode": {"required": True}, + "values": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[int]'}, + "mode": {"key": "mode", "type": "str"}, + "values": {"key": "values", "type": "[int]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword values: Required. [Required] Set target lags values. :paramtype values: list[int] """ super(CustomTargetLags, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.values = kwargs['values'] + self.mode = "Custom" # type: str + self.values = kwargs["values"] class CustomTargetRollingWindowSize(TargetRollingWindowSize): @@ -7184,26 +7213,23 @@ class CustomTargetRollingWindowSize(TargetRollingWindowSize): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Required. [Required] TargetRollingWindowSize value. :paramtype value: int """ super(CustomTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] + self.mode = "Custom" # type: str + self.value = kwargs["value"] class DatabricksSchema(msrest.serialization.Model): @@ -7214,19 +7240,16 @@ class DatabricksSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, + "properties": {"key": "properties", "type": "DatabricksProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of Databricks. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties """ super(DatabricksSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class Databricks(Compute, DatabricksSchema): @@ -7268,32 +7291,32 @@ class Databricks(Compute, DatabricksSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "DatabricksProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of Databricks. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties @@ -7308,17 +7331,17 @@ def __init__( :paramtype disable_local_auth: bool """ super(Databricks, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'Databricks' # type: str - self.compute_location = kwargs.get('compute_location', None) + self.properties = kwargs.get("properties", None) + self.compute_type = "Databricks" # type: str + self.compute_location = kwargs.get("compute_location", None) self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) + self.disable_local_auth = kwargs.get("disable_local_auth", None) class DatabricksComputeSecretsProperties(msrest.serialization.Model): @@ -7329,22 +7352,26 @@ class DatabricksComputeSecretsProperties(msrest.serialization.Model): """ _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword databricks_access_token: access token for databricks account. :paramtype databricks_access_token: str """ super(DatabricksComputeSecretsProperties, self).__init__(**kwargs) - self.databricks_access_token = kwargs.get('databricks_access_token', None) + self.databricks_access_token = kwargs.get( + "databricks_access_token", None + ) -class DatabricksComputeSecrets(ComputeSecrets, DatabricksComputeSecretsProperties): +class DatabricksComputeSecrets( + ComputeSecrets, DatabricksComputeSecretsProperties +): """Secrets related to a Machine Learning compute based on Databricks. All required parameters must be populated in order to send to Azure. @@ -7358,25 +7385,27 @@ class DatabricksComputeSecrets(ComputeSecrets, DatabricksComputeSecretsPropertie """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, + "compute_type": {"key": "computeType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword databricks_access_token: access token for databricks account. :paramtype databricks_access_token: str """ super(DatabricksComputeSecrets, self).__init__(**kwargs) - self.databricks_access_token = kwargs.get('databricks_access_token', None) - self.compute_type = 'Databricks' # type: str + self.databricks_access_token = kwargs.get( + "databricks_access_token", None + ) + self.compute_type = "Databricks" # type: str class DatabricksProperties(msrest.serialization.Model): @@ -7389,14 +7418,14 @@ class DatabricksProperties(msrest.serialization.Model): """ _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'workspace_url': {'key': 'workspaceUrl', 'type': 'str'}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, + "workspace_url": {"key": "workspaceUrl", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword databricks_access_token: Databricks access token. :paramtype databricks_access_token: str @@ -7404,8 +7433,10 @@ def __init__( :paramtype workspace_url: str """ super(DatabricksProperties, self).__init__(**kwargs) - self.databricks_access_token = kwargs.get('databricks_access_token', None) - self.workspace_url = kwargs.get('workspace_url', None) + self.databricks_access_token = kwargs.get( + "databricks_access_token", None + ) + self.workspace_url = kwargs.get("workspace_url", None) class DataContainer(Resource): @@ -7431,31 +7462,28 @@ class DataContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "DataContainerProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataContainerProperties """ super(DataContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class DataContainerProperties(AssetContainer): @@ -7483,25 +7511,22 @@ class DataContainerProperties(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'data_type': {'required': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "data_type": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "data_type": {"key": "dataType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -7516,7 +7541,7 @@ def __init__( :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType """ super(DataContainerProperties, self).__init__(**kwargs) - self.data_type = kwargs['data_type'] + self.data_type = kwargs["data_type"] class DataContainerResourceArmPaginatedResult(msrest.serialization.Model): @@ -7530,14 +7555,11 @@ class DataContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[DataContainer]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of DataContainer objects. If null, there are no additional pages. @@ -7546,8 +7568,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataContainer] """ super(DataContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class DataFactory(Compute): @@ -7587,31 +7609,31 @@ class DataFactory(Compute): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword compute_location: Location for the underlying compute. :paramtype compute_location: str @@ -7624,7 +7646,7 @@ def __init__( :paramtype disable_local_auth: bool """ super(DataFactory, self).__init__(**kwargs) - self.compute_type = 'DataFactory' # type: str + self.compute_type = "DataFactory" # type: str class DataLakeAnalyticsSchema(msrest.serialization.Model): @@ -7636,20 +7658,20 @@ class DataLakeAnalyticsSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, + "properties": { + "key": "properties", + "type": "DataLakeAnalyticsSchemaProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties """ super(DataLakeAnalyticsSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class DataLakeAnalytics(Compute, DataLakeAnalyticsSchema): @@ -7692,32 +7714,35 @@ class DataLakeAnalytics(Compute, DataLakeAnalyticsSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": { + "key": "properties", + "type": "DataLakeAnalyticsSchemaProperties", + }, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: :paramtype properties: @@ -7733,17 +7758,17 @@ def __init__( :paramtype disable_local_auth: bool """ super(DataLakeAnalytics, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'DataLakeAnalytics' # type: str - self.compute_location = kwargs.get('compute_location', None) + self.properties = kwargs.get("properties", None) + self.compute_type = "DataLakeAnalytics" # type: str + self.compute_location = kwargs.get("compute_location", None) self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) + self.disable_local_auth = kwargs.get("disable_local_auth", None) class DataLakeAnalyticsSchemaProperties(msrest.serialization.Model): @@ -7754,19 +7779,21 @@ class DataLakeAnalyticsSchemaProperties(msrest.serialization.Model): """ _attribute_map = { - 'data_lake_store_account_name': {'key': 'dataLakeStoreAccountName', 'type': 'str'}, + "data_lake_store_account_name": { + "key": "dataLakeStoreAccountName", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data_lake_store_account_name: DataLake Store Account Name. :paramtype data_lake_store_account_name: str """ super(DataLakeAnalyticsSchemaProperties, self).__init__(**kwargs) - self.data_lake_store_account_name = kwargs.get('data_lake_store_account_name', None) + self.data_lake_store_account_name = kwargs.get( + "data_lake_store_account_name", None + ) class DataPathAssetReference(AssetReferenceBase): @@ -7784,19 +7811,16 @@ class DataPathAssetReference(AssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'datastore_id': {'key': 'datastoreId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "datastore_id": {"key": "datastoreId", "type": "str"}, + "path": {"key": "path", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword datastore_id: ARM resource ID of the datastore where the asset is located. :paramtype datastore_id: str @@ -7804,9 +7828,9 @@ def __init__( :paramtype path: str """ super(DataPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'DataPath' # type: str - self.datastore_id = kwargs.get('datastore_id', None) - self.path = kwargs.get('path', None) + self.reference_type = "DataPath" # type: str + self.datastore_id = kwargs.get("datastore_id", None) + self.path = kwargs.get("path", None) class DatasetExportSummary(ExportSummary): @@ -7832,31 +7856,27 @@ class DatasetExportSummary(ExportSummary): """ _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'labeled_asset_name': {'readonly': True}, + "end_date_time": {"readonly": True}, + "exported_row_count": {"readonly": True}, + "format": {"required": True}, + "labeling_job_id": {"readonly": True}, + "start_date_time": {"readonly": True}, + "labeled_asset_name": {"readonly": True}, } _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'labeled_asset_name': {'key': 'labeledAssetName', 'type': 'str'}, + "end_date_time": {"key": "endDateTime", "type": "iso-8601"}, + "exported_row_count": {"key": "exportedRowCount", "type": "long"}, + "format": {"key": "format", "type": "str"}, + "labeling_job_id": {"key": "labelingJobId", "type": "str"}, + "start_date_time": {"key": "startDateTime", "type": "iso-8601"}, + "labeled_asset_name": {"key": "labeledAssetName", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DatasetExportSummary, self).__init__(**kwargs) - self.format = 'Dataset' # type: str + self.format = "Dataset" # type: str self.labeled_asset_name = None @@ -7883,31 +7903,28 @@ class Datastore(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DatastoreProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "DatastoreProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatastoreProperties """ super(Datastore, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class DatastoreResourceArmPaginatedResult(msrest.serialization.Model): @@ -7921,14 +7938,11 @@ class DatastoreResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Datastore]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[Datastore]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of Datastore objects. If null, there are no additional pages. @@ -7937,8 +7951,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.Datastore] """ super(DatastoreResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class DataVersionBase(Resource): @@ -7964,31 +7978,31 @@ class DataVersionBase(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataVersionBaseProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "DataVersionBaseProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataVersionBaseProperties """ super(DataVersionBase, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class DataVersionBaseProperties(AssetBase): @@ -8018,28 +8032,29 @@ class DataVersionBaseProperties(AssetBase): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, } _subtype_map = { - 'data_type': {'mltable': 'MLTableData', 'uri_file': 'UriFileDataVersion', 'uri_folder': 'UriFolderDataVersion'} + "data_type": { + "mltable": "MLTableData", + "uri_file": "UriFileDataVersion", + "uri_folder": "UriFolderDataVersion", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -8056,8 +8071,8 @@ def __init__( :paramtype data_uri: str """ super(DataVersionBaseProperties, self).__init__(**kwargs) - self.data_type = 'DataVersionBaseProperties' # type: str - self.data_uri = kwargs['data_uri'] + self.data_type = "DataVersionBaseProperties" # type: str + self.data_uri = kwargs["data_uri"] class DataVersionBaseResourceArmPaginatedResult(msrest.serialization.Model): @@ -8071,14 +8086,11 @@ class DataVersionBaseResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataVersionBase]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[DataVersionBase]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of DataVersionBase objects. If null, there are no additional pages. @@ -8086,9 +8098,11 @@ def __init__( :keyword value: An array of objects of type DataVersionBase. :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBase] """ - super(DataVersionBaseResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(DataVersionBaseResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class OnlineScaleSettings(msrest.serialization.Model): @@ -8105,23 +8119,22 @@ class OnlineScaleSettings(msrest.serialization.Model): """ _validation = { - 'scale_type': {'required': True}, + "scale_type": {"required": True}, } _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, + "scale_type": {"key": "scaleType", "type": "str"}, } _subtype_map = { - 'scale_type': {'Default': 'DefaultScaleSettings', 'TargetUtilization': 'TargetUtilizationScaleSettings'} + "scale_type": { + "Default": "DefaultScaleSettings", + "TargetUtilization": "TargetUtilizationScaleSettings", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(OnlineScaleSettings, self).__init__(**kwargs) self.scale_type = None # type: Optional[str] @@ -8137,21 +8150,17 @@ class DefaultScaleSettings(OnlineScaleSettings): """ _validation = { - 'scale_type': {'required': True}, + "scale_type": {"required": True}, } _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, + "scale_type": {"key": "scaleType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DefaultScaleSettings, self).__init__(**kwargs) - self.scale_type = 'Default' # type: str + self.scale_type = "Default" # type: str class DeploymentLogs(msrest.serialization.Model): @@ -8162,19 +8171,16 @@ class DeploymentLogs(msrest.serialization.Model): """ _attribute_map = { - 'content': {'key': 'content', 'type': 'str'}, + "content": {"key": "content", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword content: The retrieved online deployment logs. :paramtype content: str """ super(DeploymentLogs, self).__init__(**kwargs) - self.content = kwargs.get('content', None) + self.content = kwargs.get("content", None) class DeploymentLogsRequest(msrest.serialization.Model): @@ -8188,14 +8194,11 @@ class DeploymentLogsRequest(msrest.serialization.Model): """ _attribute_map = { - 'container_type': {'key': 'containerType', 'type': 'str'}, - 'tail': {'key': 'tail', 'type': 'int'}, + "container_type": {"key": "containerType", "type": "str"}, + "tail": {"key": "tail", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword container_type: The type of container to retrieve logs from. Possible values include: "StorageInitializer", "InferenceServer", "ModelDataCollector". @@ -8204,8 +8207,8 @@ def __init__( :paramtype tail: int """ super(DeploymentLogsRequest, self).__init__(**kwargs) - self.container_type = kwargs.get('container_type', None) - self.tail = kwargs.get('tail', None) + self.container_type = kwargs.get("container_type", None) + self.tail = kwargs.get("tail", None) class ResourceConfiguration(msrest.serialization.Model): @@ -8220,15 +8223,12 @@ class ResourceConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "properties": {"key": "properties", "type": "{object}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword instance_count: Optional number of instances or nodes used by the compute target. :paramtype instance_count: int @@ -8238,9 +8238,9 @@ def __init__( :paramtype properties: dict[str, any] """ super(ResourceConfiguration, self).__init__(**kwargs) - self.instance_count = kwargs.get('instance_count', 1) - self.instance_type = kwargs.get('instance_type', None) - self.properties = kwargs.get('properties', None) + self.instance_count = kwargs.get("instance_count", 1) + self.instance_type = kwargs.get("instance_type", None) + self.properties = kwargs.get("properties", None) class DeploymentResourceConfiguration(ResourceConfiguration): @@ -8255,15 +8255,12 @@ class DeploymentResourceConfiguration(ResourceConfiguration): """ _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "properties": {"key": "properties", "type": "{object}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword instance_count: Optional number of instances or nodes used by the compute target. :paramtype instance_count: int @@ -8299,21 +8296,21 @@ class DiagnoseRequestProperties(msrest.serialization.Model): """ _attribute_map = { - 'udr': {'key': 'udr', 'type': '{object}'}, - 'nsg': {'key': 'nsg', 'type': '{object}'}, - 'resource_lock': {'key': 'resourceLock', 'type': '{object}'}, - 'dns_resolution': {'key': 'dnsResolution', 'type': '{object}'}, - 'storage_account': {'key': 'storageAccount', 'type': '{object}'}, - 'key_vault': {'key': 'keyVault', 'type': '{object}'}, - 'container_registry': {'key': 'containerRegistry', 'type': '{object}'}, - 'application_insights': {'key': 'applicationInsights', 'type': '{object}'}, - 'others': {'key': 'others', 'type': '{object}'}, + "udr": {"key": "udr", "type": "{object}"}, + "nsg": {"key": "nsg", "type": "{object}"}, + "resource_lock": {"key": "resourceLock", "type": "{object}"}, + "dns_resolution": {"key": "dnsResolution", "type": "{object}"}, + "storage_account": {"key": "storageAccount", "type": "{object}"}, + "key_vault": {"key": "keyVault", "type": "{object}"}, + "container_registry": {"key": "containerRegistry", "type": "{object}"}, + "application_insights": { + "key": "applicationInsights", + "type": "{object}", + }, + "others": {"key": "others", "type": "{object}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword udr: Setting for diagnosing user defined routing. :paramtype udr: dict[str, any] @@ -8335,15 +8332,15 @@ def __init__( :paramtype others: dict[str, any] """ super(DiagnoseRequestProperties, self).__init__(**kwargs) - self.udr = kwargs.get('udr', None) - self.nsg = kwargs.get('nsg', None) - self.resource_lock = kwargs.get('resource_lock', None) - self.dns_resolution = kwargs.get('dns_resolution', None) - self.storage_account = kwargs.get('storage_account', None) - self.key_vault = kwargs.get('key_vault', None) - self.container_registry = kwargs.get('container_registry', None) - self.application_insights = kwargs.get('application_insights', None) - self.others = kwargs.get('others', None) + self.udr = kwargs.get("udr", None) + self.nsg = kwargs.get("nsg", None) + self.resource_lock = kwargs.get("resource_lock", None) + self.dns_resolution = kwargs.get("dns_resolution", None) + self.storage_account = kwargs.get("storage_account", None) + self.key_vault = kwargs.get("key_vault", None) + self.container_registry = kwargs.get("container_registry", None) + self.application_insights = kwargs.get("application_insights", None) + self.others = kwargs.get("others", None) class DiagnoseResponseResult(msrest.serialization.Model): @@ -8354,19 +8351,16 @@ class DiagnoseResponseResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseResponseResultValue'}, + "value": {"key": "value", "type": "DiagnoseResponseResultValue"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: :paramtype value: ~azure.mgmt.machinelearningservices.models.DiagnoseResponseResultValue """ super(DiagnoseResponseResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class DiagnoseResponseResultValue(msrest.serialization.Model): @@ -8399,21 +8393,42 @@ class DiagnoseResponseResultValue(msrest.serialization.Model): """ _attribute_map = { - 'user_defined_route_results': {'key': 'userDefinedRouteResults', 'type': '[DiagnoseResult]'}, - 'network_security_rule_results': {'key': 'networkSecurityRuleResults', 'type': '[DiagnoseResult]'}, - 'resource_lock_results': {'key': 'resourceLockResults', 'type': '[DiagnoseResult]'}, - 'dns_resolution_results': {'key': 'dnsResolutionResults', 'type': '[DiagnoseResult]'}, - 'storage_account_results': {'key': 'storageAccountResults', 'type': '[DiagnoseResult]'}, - 'key_vault_results': {'key': 'keyVaultResults', 'type': '[DiagnoseResult]'}, - 'container_registry_results': {'key': 'containerRegistryResults', 'type': '[DiagnoseResult]'}, - 'application_insights_results': {'key': 'applicationInsightsResults', 'type': '[DiagnoseResult]'}, - 'other_results': {'key': 'otherResults', 'type': '[DiagnoseResult]'}, - } - - def __init__( - self, - **kwargs - ): + "user_defined_route_results": { + "key": "userDefinedRouteResults", + "type": "[DiagnoseResult]", + }, + "network_security_rule_results": { + "key": "networkSecurityRuleResults", + "type": "[DiagnoseResult]", + }, + "resource_lock_results": { + "key": "resourceLockResults", + "type": "[DiagnoseResult]", + }, + "dns_resolution_results": { + "key": "dnsResolutionResults", + "type": "[DiagnoseResult]", + }, + "storage_account_results": { + "key": "storageAccountResults", + "type": "[DiagnoseResult]", + }, + "key_vault_results": { + "key": "keyVaultResults", + "type": "[DiagnoseResult]", + }, + "container_registry_results": { + "key": "containerRegistryResults", + "type": "[DiagnoseResult]", + }, + "application_insights_results": { + "key": "applicationInsightsResults", + "type": "[DiagnoseResult]", + }, + "other_results": {"key": "otherResults", "type": "[DiagnoseResult]"}, + } + + def __init__(self, **kwargs): """ :keyword user_defined_route_results: :paramtype user_defined_route_results: @@ -8442,15 +8457,27 @@ def __init__( :paramtype other_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] """ super(DiagnoseResponseResultValue, self).__init__(**kwargs) - self.user_defined_route_results = kwargs.get('user_defined_route_results', None) - self.network_security_rule_results = kwargs.get('network_security_rule_results', None) - self.resource_lock_results = kwargs.get('resource_lock_results', None) - self.dns_resolution_results = kwargs.get('dns_resolution_results', None) - self.storage_account_results = kwargs.get('storage_account_results', None) - self.key_vault_results = kwargs.get('key_vault_results', None) - self.container_registry_results = kwargs.get('container_registry_results', None) - self.application_insights_results = kwargs.get('application_insights_results', None) - self.other_results = kwargs.get('other_results', None) + self.user_defined_route_results = kwargs.get( + "user_defined_route_results", None + ) + self.network_security_rule_results = kwargs.get( + "network_security_rule_results", None + ) + self.resource_lock_results = kwargs.get("resource_lock_results", None) + self.dns_resolution_results = kwargs.get( + "dns_resolution_results", None + ) + self.storage_account_results = kwargs.get( + "storage_account_results", None + ) + self.key_vault_results = kwargs.get("key_vault_results", None) + self.container_registry_results = kwargs.get( + "container_registry_results", None + ) + self.application_insights_results = kwargs.get( + "application_insights_results", None + ) + self.other_results = kwargs.get("other_results", None) class DiagnoseResult(msrest.serialization.Model): @@ -8468,23 +8495,19 @@ class DiagnoseResult(msrest.serialization.Model): """ _validation = { - 'code': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, + "code": {"readonly": True}, + "level": {"readonly": True}, + "message": {"readonly": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, + "code": {"key": "code", "type": "str"}, + "level": {"key": "level", "type": "str"}, + "message": {"key": "message", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DiagnoseResult, self).__init__(**kwargs) self.code = None self.level = None @@ -8499,19 +8522,16 @@ class DiagnoseWorkspaceParameters(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseRequestProperties'}, + "value": {"key": "value", "type": "DiagnoseRequestProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Value of Parameters. :paramtype value: ~azure.mgmt.machinelearningservices.models.DiagnoseRequestProperties """ super(DiagnoseWorkspaceParameters, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class DistributionConfiguration(msrest.serialization.Model): @@ -8528,23 +8548,23 @@ class DistributionConfiguration(msrest.serialization.Model): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, + "distribution_type": {"key": "distributionType", "type": "str"}, } _subtype_map = { - 'distribution_type': {'Mpi': 'Mpi', 'PyTorch': 'PyTorch', 'TensorFlow': 'TensorFlow'} + "distribution_type": { + "Mpi": "Mpi", + "PyTorch": "PyTorch", + "TensorFlow": "TensorFlow", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DistributionConfiguration, self).__init__(**kwargs) self.distribution_type = None # type: Optional[str] @@ -8560,14 +8580,11 @@ class Docker(msrest.serialization.Model): """ _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'privileged': {'key': 'privileged', 'type': 'bool'}, + "additional_properties": {"key": "", "type": "{object}"}, + "privileged": {"key": "privileged", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword additional_properties: Unmatched properties from the message are deserialized to this collection. @@ -8576,8 +8593,8 @@ def __init__( :paramtype privileged: bool """ super(Docker, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.privileged = kwargs.get('privileged', None) + self.additional_properties = kwargs.get("additional_properties", None) + self.privileged = kwargs.get("privileged", None) class EncryptionKeyVaultProperties(msrest.serialization.Model): @@ -8596,20 +8613,17 @@ class EncryptionKeyVaultProperties(msrest.serialization.Model): """ _validation = { - 'key_vault_arm_id': {'required': True}, - 'key_identifier': {'required': True}, + "key_vault_arm_id": {"required": True}, + "key_identifier": {"required": True}, } _attribute_map = { - 'key_vault_arm_id': {'key': 'keyVaultArmId', 'type': 'str'}, - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - 'identity_client_id': {'key': 'identityClientId', 'type': 'str'}, + "key_vault_arm_id": {"key": "keyVaultArmId", "type": "str"}, + "key_identifier": {"key": "keyIdentifier", "type": "str"}, + "identity_client_id": {"key": "identityClientId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword key_vault_arm_id: Required. The ArmId of the keyVault where the customer owned encryption key is present. @@ -8621,9 +8635,9 @@ def __init__( :paramtype identity_client_id: str """ super(EncryptionKeyVaultProperties, self).__init__(**kwargs) - self.key_vault_arm_id = kwargs['key_vault_arm_id'] - self.key_identifier = kwargs['key_identifier'] - self.identity_client_id = kwargs.get('identity_client_id', None) + self.key_vault_arm_id = kwargs["key_vault_arm_id"] + self.key_identifier = kwargs["key_identifier"] + self.identity_client_id = kwargs.get("identity_client_id", None) class EncryptionKeyVaultUpdateProperties(msrest.serialization.Model): @@ -8636,23 +8650,20 @@ class EncryptionKeyVaultUpdateProperties(msrest.serialization.Model): """ _validation = { - 'key_identifier': {'required': True}, + "key_identifier": {"required": True}, } _attribute_map = { - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, + "key_identifier": {"key": "keyIdentifier", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword key_identifier: Required. Key Vault uri to access the encryption key. :paramtype key_identifier: str """ super(EncryptionKeyVaultUpdateProperties, self).__init__(**kwargs) - self.key_identifier = kwargs['key_identifier'] + self.key_identifier = kwargs["key_identifier"] class EncryptionProperty(msrest.serialization.Model): @@ -8671,20 +8682,20 @@ class EncryptionProperty(msrest.serialization.Model): """ _validation = { - 'status': {'required': True}, - 'key_vault_properties': {'required': True}, + "status": {"required": True}, + "key_vault_properties": {"required": True}, } _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityForCmk'}, - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'EncryptionKeyVaultProperties'}, + "status": {"key": "status", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityForCmk"}, + "key_vault_properties": { + "key": "keyVaultProperties", + "type": "EncryptionKeyVaultProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword status: Required. Indicates whether or not the encryption is enabled for the workspace. Possible values include: "Enabled", "Disabled". @@ -8697,9 +8708,9 @@ def __init__( ~azure.mgmt.machinelearningservices.models.EncryptionKeyVaultProperties """ super(EncryptionProperty, self).__init__(**kwargs) - self.status = kwargs['status'] - self.identity = kwargs.get('identity', None) - self.key_vault_properties = kwargs['key_vault_properties'] + self.status = kwargs["status"] + self.identity = kwargs.get("identity", None) + self.key_vault_properties = kwargs["key_vault_properties"] class EncryptionUpdateProperties(msrest.serialization.Model): @@ -8713,24 +8724,24 @@ class EncryptionUpdateProperties(msrest.serialization.Model): """ _validation = { - 'key_vault_properties': {'required': True}, + "key_vault_properties": {"required": True}, } _attribute_map = { - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'EncryptionKeyVaultUpdateProperties'}, + "key_vault_properties": { + "key": "keyVaultProperties", + "type": "EncryptionKeyVaultUpdateProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword key_vault_properties: Required. Customer Key vault properties. :paramtype key_vault_properties: ~azure.mgmt.machinelearningservices.models.EncryptionKeyVaultUpdateProperties """ super(EncryptionUpdateProperties, self).__init__(**kwargs) - self.key_vault_properties = kwargs['key_vault_properties'] + self.key_vault_properties = kwargs["key_vault_properties"] class Endpoint(msrest.serialization.Model): @@ -8750,17 +8761,14 @@ class Endpoint(msrest.serialization.Model): """ _attribute_map = { - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'int'}, - 'published': {'key': 'published', 'type': 'int'}, - 'host_ip': {'key': 'hostIp', 'type': 'str'}, + "protocol": {"key": "protocol", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "target": {"key": "target", "type": "int"}, + "published": {"key": "published", "type": "int"}, + "host_ip": {"key": "hostIp", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword protocol: Protocol over which communication will happen over this endpoint. Possible values include: "tcp", "udp", "http". Default value: "tcp". @@ -8775,11 +8783,11 @@ def __init__( :paramtype host_ip: str """ super(Endpoint, self).__init__(**kwargs) - self.protocol = kwargs.get('protocol', "tcp") - self.name = kwargs.get('name', None) - self.target = kwargs.get('target', None) - self.published = kwargs.get('published', None) - self.host_ip = kwargs.get('host_ip', None) + self.protocol = kwargs.get("protocol", "tcp") + self.name = kwargs.get("name", None) + self.target = kwargs.get("target", None) + self.published = kwargs.get("published", None) + self.host_ip = kwargs.get("host_ip", None) class EndpointAuthKeys(msrest.serialization.Model): @@ -8792,14 +8800,11 @@ class EndpointAuthKeys(msrest.serialization.Model): """ _attribute_map = { - 'primary_key': {'key': 'primaryKey', 'type': 'str'}, - 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, + "primary_key": {"key": "primaryKey", "type": "str"}, + "secondary_key": {"key": "secondaryKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword primary_key: The primary key. :paramtype primary_key: str @@ -8807,8 +8812,8 @@ def __init__( :paramtype secondary_key: str """ super(EndpointAuthKeys, self).__init__(**kwargs) - self.primary_key = kwargs.get('primary_key', None) - self.secondary_key = kwargs.get('secondary_key', None) + self.primary_key = kwargs.get("primary_key", None) + self.secondary_key = kwargs.get("secondary_key", None) class EndpointAuthToken(msrest.serialization.Model): @@ -8825,16 +8830,16 @@ class EndpointAuthToken(msrest.serialization.Model): """ _attribute_map = { - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'expiry_time_utc': {'key': 'expiryTimeUtc', 'type': 'long'}, - 'refresh_after_time_utc': {'key': 'refreshAfterTimeUtc', 'type': 'long'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, + "access_token": {"key": "accessToken", "type": "str"}, + "expiry_time_utc": {"key": "expiryTimeUtc", "type": "long"}, + "refresh_after_time_utc": { + "key": "refreshAfterTimeUtc", + "type": "long", + }, + "token_type": {"key": "tokenType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword access_token: Access token for endpoint authentication. :paramtype access_token: str @@ -8846,10 +8851,10 @@ def __init__( :paramtype token_type: str """ super(EndpointAuthToken, self).__init__(**kwargs) - self.access_token = kwargs.get('access_token', None) - self.expiry_time_utc = kwargs.get('expiry_time_utc', 0) - self.refresh_after_time_utc = kwargs.get('refresh_after_time_utc', 0) - self.token_type = kwargs.get('token_type', None) + self.access_token = kwargs.get("access_token", None) + self.expiry_time_utc = kwargs.get("expiry_time_utc", 0) + self.refresh_after_time_utc = kwargs.get("refresh_after_time_utc", 0) + self.token_type = kwargs.get("token_type", None) class ScheduleActionBase(msrest.serialization.Model): @@ -8866,23 +8871,22 @@ class ScheduleActionBase(msrest.serialization.Model): """ _validation = { - 'action_type': {'required': True}, + "action_type": {"required": True}, } _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, + "action_type": {"key": "actionType", "type": "str"}, } _subtype_map = { - 'action_type': {'CreateJob': 'JobScheduleAction', 'InvokeBatchEndpoint': 'EndpointScheduleAction'} + "action_type": { + "CreateJob": "JobScheduleAction", + "InvokeBatchEndpoint": "EndpointScheduleAction", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ScheduleActionBase, self).__init__(**kwargs) self.action_type = None # type: Optional[str] @@ -8897,41 +8901,43 @@ class EndpointScheduleAction(ScheduleActionBase): :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType :ivar endpoint_invocation_definition: Required. [Required] Defines Schedule action definition details. - - + + .. raw:: html - + . :vartype endpoint_invocation_definition: any """ _validation = { - 'action_type': {'required': True}, - 'endpoint_invocation_definition': {'required': True}, + "action_type": {"required": True}, + "endpoint_invocation_definition": {"required": True}, } _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'endpoint_invocation_definition': {'key': 'endpointInvocationDefinition', 'type': 'object'}, + "action_type": {"key": "actionType", "type": "str"}, + "endpoint_invocation_definition": { + "key": "endpointInvocationDefinition", + "type": "object", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword endpoint_invocation_definition: Required. [Required] Defines Schedule action definition details. - - + + .. raw:: html - + . :paramtype endpoint_invocation_definition: any """ super(EndpointScheduleAction, self).__init__(**kwargs) - self.action_type = 'InvokeBatchEndpoint' # type: str - self.endpoint_invocation_definition = kwargs['endpoint_invocation_definition'] + self.action_type = "InvokeBatchEndpoint" # type: str + self.endpoint_invocation_definition = kwargs[ + "endpoint_invocation_definition" + ] class EnvironmentContainer(Resource): @@ -8957,32 +8963,32 @@ class EnvironmentContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "EnvironmentContainerProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerProperties """ super(EnvironmentContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class EnvironmentContainerProperties(AssetContainer): @@ -9009,25 +9015,22 @@ class EnvironmentContainerProperties(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -9042,7 +9045,9 @@ def __init__( self.provisioning_state = None -class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model): +class EnvironmentContainerResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of EnvironmentContainer entities. :ivar next_link: The link to the next page of EnvironmentContainer objects. If null, there are @@ -9053,14 +9058,11 @@ class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model) """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[EnvironmentContainer]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of EnvironmentContainer objects. If null, there are no additional pages. @@ -9068,9 +9070,11 @@ def __init__( :keyword value: An array of objects of type EnvironmentContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] """ - super(EnvironmentContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(EnvironmentContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class EnvironmentVariable(msrest.serialization.Model): @@ -9087,15 +9091,12 @@ class EnvironmentVariable(msrest.serialization.Model): """ _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "additional_properties": {"key": "", "type": "{object}"}, + "type": {"key": "type", "type": "str"}, + "value": {"key": "value", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword additional_properties: Unmatched properties from the message are deserialized to this collection. @@ -9107,9 +9108,9 @@ def __init__( :paramtype value: str """ super(EnvironmentVariable, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.type = kwargs.get('type', "local") - self.value = kwargs.get('value', None) + self.additional_properties = kwargs.get("additional_properties", None) + self.type = kwargs.get("type", "local") + self.value = kwargs.get("value", None) class EnvironmentVersion(Resource): @@ -9135,31 +9136,31 @@ class EnvironmentVersion(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentVersionProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "EnvironmentVersionProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionProperties """ super(EnvironmentVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class EnvironmentVersionProperties(AssetBase): @@ -9184,29 +9185,29 @@ class EnvironmentVersionProperties(AssetBase): :vartype build: ~azure.mgmt.machinelearningservices.models.BuildContext :ivar conda_file: Standard configuration file used by Conda that lets you install any kind of package, including Python, R, and C/C++ packages. - - + + .. raw:: html - + . :vartype conda_file: str :ivar environment_type: Environment type is either user managed or curated by the Azure ML service - - + + .. raw:: html - + . Possible values include: "Curated", "UserCreated". :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType :ivar image: Name of the image that will be used for the environment. - - + + .. raw:: html - + . @@ -9223,30 +9224,30 @@ class EnvironmentVersionProperties(AssetBase): """ _validation = { - 'environment_type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "environment_type": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'auto_rebuild': {'key': 'autoRebuild', 'type': 'str'}, - 'build': {'key': 'build', 'type': 'BuildContext'}, - 'conda_file': {'key': 'condaFile', 'type': 'str'}, - 'environment_type': {'key': 'environmentType', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'str'}, - 'inference_config': {'key': 'inferenceConfig', 'type': 'InferenceContainerProperties'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "auto_rebuild": {"key": "autoRebuild", "type": "str"}, + "build": {"key": "build", "type": "BuildContext"}, + "conda_file": {"key": "condaFile", "type": "str"}, + "environment_type": {"key": "environmentType", "type": "str"}, + "image": {"key": "image", "type": "str"}, + "inference_config": { + "key": "inferenceConfig", + "type": "InferenceContainerProperties", + }, + "os_type": {"key": "osType", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -9265,19 +9266,19 @@ def __init__( :paramtype build: ~azure.mgmt.machinelearningservices.models.BuildContext :keyword conda_file: Standard configuration file used by Conda that lets you install any kind of package, including Python, R, and C/C++ packages. - - + + .. raw:: html - + . :paramtype conda_file: str :keyword image: Name of the image that will be used for the environment. - - + + .. raw:: html - + . @@ -9289,13 +9290,13 @@ def __init__( :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.OperatingSystemType """ super(EnvironmentVersionProperties, self).__init__(**kwargs) - self.auto_rebuild = kwargs.get('auto_rebuild', None) - self.build = kwargs.get('build', None) - self.conda_file = kwargs.get('conda_file', None) + self.auto_rebuild = kwargs.get("auto_rebuild", None) + self.build = kwargs.get("build", None) + self.conda_file = kwargs.get("conda_file", None) self.environment_type = None - self.image = kwargs.get('image', None) - self.inference_config = kwargs.get('inference_config', None) - self.os_type = kwargs.get('os_type', None) + self.image = kwargs.get("image", None) + self.inference_config = kwargs.get("inference_config", None) + self.os_type = kwargs.get("os_type", None) self.provisioning_state = None @@ -9310,14 +9311,11 @@ class EnvironmentVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentVersion]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[EnvironmentVersion]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of EnvironmentVersion objects. If null, there are no additional pages. @@ -9325,9 +9323,11 @@ def __init__( :keyword value: An array of objects of type EnvironmentVersion. :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] """ - super(EnvironmentVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(EnvironmentVersionResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class ErrorAdditionalInfo(msrest.serialization.Model): @@ -9342,21 +9342,17 @@ class ErrorAdditionalInfo(msrest.serialization.Model): """ _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, + "type": {"readonly": True}, + "info": {"readonly": True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, + "type": {"key": "type", "type": "str"}, + "info": {"key": "info", "type": "object"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ErrorAdditionalInfo, self).__init__(**kwargs) self.type = None self.info = None @@ -9380,27 +9376,26 @@ class ErrorDetail(msrest.serialization.Model): """ _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, + "code": {"readonly": True}, + "message": {"readonly": True}, + "target": {"readonly": True}, + "details": {"readonly": True}, + "additional_info": {"readonly": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[ErrorDetail]"}, + "additional_info": { + "key": "additionalInfo", + "type": "[ErrorAdditionalInfo]", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ErrorDetail, self).__init__(**kwargs) self.code = None self.message = None @@ -9417,19 +9412,16 @@ class ErrorResponse(msrest.serialization.Model): """ _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, + "error": {"key": "error", "type": "ErrorDetail"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword error: The error object. :paramtype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail """ super(ErrorResponse, self).__init__(**kwargs) - self.error = kwargs.get('error', None) + self.error = kwargs.get("error", None) class EstimatedVMPrice(msrest.serialization.Model): @@ -9448,21 +9440,18 @@ class EstimatedVMPrice(msrest.serialization.Model): """ _validation = { - 'retail_price': {'required': True}, - 'os_type': {'required': True}, - 'vm_tier': {'required': True}, + "retail_price": {"required": True}, + "os_type": {"required": True}, + "vm_tier": {"required": True}, } _attribute_map = { - 'retail_price': {'key': 'retailPrice', 'type': 'float'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_tier': {'key': 'vmTier', 'type': 'str'}, + "retail_price": {"key": "retailPrice", "type": "float"}, + "os_type": {"key": "osType", "type": "str"}, + "vm_tier": {"key": "vmTier", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword retail_price: Required. The price charged for using the VM. :paramtype retail_price: float @@ -9474,9 +9463,9 @@ def __init__( :paramtype vm_tier: str or ~azure.mgmt.machinelearningservices.models.VMTier """ super(EstimatedVMPrice, self).__init__(**kwargs) - self.retail_price = kwargs['retail_price'] - self.os_type = kwargs['os_type'] - self.vm_tier = kwargs['vm_tier'] + self.retail_price = kwargs["retail_price"] + self.os_type = kwargs["os_type"] + self.vm_tier = kwargs["vm_tier"] class EstimatedVMPrices(msrest.serialization.Model): @@ -9496,21 +9485,18 @@ class EstimatedVMPrices(msrest.serialization.Model): """ _validation = { - 'billing_currency': {'required': True}, - 'unit_of_measure': {'required': True}, - 'values': {'required': True}, + "billing_currency": {"required": True}, + "unit_of_measure": {"required": True}, + "values": {"required": True}, } _attribute_map = { - 'billing_currency': {'key': 'billingCurrency', 'type': 'str'}, - 'unit_of_measure': {'key': 'unitOfMeasure', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[EstimatedVMPrice]'}, + "billing_currency": {"key": "billingCurrency", "type": "str"}, + "unit_of_measure": {"key": "unitOfMeasure", "type": "str"}, + "values": {"key": "values", "type": "[EstimatedVMPrice]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword billing_currency: Required. Three lettered code specifying the currency of the VM price. Example: USD. Possible values include: "USD". @@ -9523,9 +9509,9 @@ def __init__( :paramtype values: list[~azure.mgmt.machinelearningservices.models.EstimatedVMPrice] """ super(EstimatedVMPrices, self).__init__(**kwargs) - self.billing_currency = kwargs['billing_currency'] - self.unit_of_measure = kwargs['unit_of_measure'] - self.values = kwargs['values'] + self.billing_currency = kwargs["billing_currency"] + self.unit_of_measure = kwargs["unit_of_measure"] + self.values = kwargs["values"] class ExternalFQDNResponse(msrest.serialization.Model): @@ -9536,19 +9522,16 @@ class ExternalFQDNResponse(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[FQDNEndpoints]'}, + "value": {"key": "value", "type": "[FQDNEndpoints]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: :paramtype value: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoints] """ super(ExternalFQDNResponse, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class FeatureStoreSettings(msrest.serialization.Model): @@ -9565,16 +9548,25 @@ class FeatureStoreSettings(msrest.serialization.Model): """ _attribute_map = { - 'compute_runtime': {'key': 'computeRuntime', 'type': 'ComputeRuntimeDto'}, - 'offline_store_connection_name': {'key': 'offlineStoreConnectionName', 'type': 'str'}, - 'online_store_connection_name': {'key': 'onlineStoreConnectionName', 'type': 'str'}, - 'allow_role_assignments_on_resource_group_level': {'key': 'allowRoleAssignmentsOnResourceGroupLevel', 'type': 'bool'}, + "compute_runtime": { + "key": "computeRuntime", + "type": "ComputeRuntimeDto", + }, + "offline_store_connection_name": { + "key": "offlineStoreConnectionName", + "type": "str", + }, + "online_store_connection_name": { + "key": "onlineStoreConnectionName", + "type": "str", + }, + "allow_role_assignments_on_resource_group_level": { + "key": "allowRoleAssignmentsOnResourceGroupLevel", + "type": "bool", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword compute_runtime: :paramtype compute_runtime: ~azure.mgmt.machinelearningservices.models.ComputeRuntimeDto @@ -9586,10 +9578,16 @@ def __init__( :paramtype allow_role_assignments_on_resource_group_level: bool """ super(FeatureStoreSettings, self).__init__(**kwargs) - self.compute_runtime = kwargs.get('compute_runtime', None) - self.offline_store_connection_name = kwargs.get('offline_store_connection_name', None) - self.online_store_connection_name = kwargs.get('online_store_connection_name', None) - self.allow_role_assignments_on_resource_group_level = kwargs.get('allow_role_assignments_on_resource_group_level', None) + self.compute_runtime = kwargs.get("compute_runtime", None) + self.offline_store_connection_name = kwargs.get( + "offline_store_connection_name", None + ) + self.online_store_connection_name = kwargs.get( + "online_store_connection_name", None + ) + self.allow_role_assignments_on_resource_group_level = kwargs.get( + "allow_role_assignments_on_resource_group_level", None + ) class FeaturizationSettings(msrest.serialization.Model): @@ -9600,19 +9598,16 @@ class FeaturizationSettings(msrest.serialization.Model): """ _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, + "dataset_language": {"key": "datasetLanguage", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword dataset_language: Dataset language, useful for the text data. :paramtype dataset_language: str """ super(FeaturizationSettings, self).__init__(**kwargs) - self.dataset_language = kwargs.get('dataset_language', None) + self.dataset_language = kwargs.get("dataset_language", None) class FlavorData(msrest.serialization.Model): @@ -9623,19 +9618,16 @@ class FlavorData(msrest.serialization.Model): """ _attribute_map = { - 'data': {'key': 'data', 'type': '{str}'}, + "data": {"key": "data", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data: Model flavor-specific data. :paramtype data: dict[str, str] """ super(FlavorData, self).__init__(**kwargs) - self.data = kwargs.get('data', None) + self.data = kwargs.get("data", None) class Forecasting(AutoMLVertical, TableVertical): @@ -9704,36 +9696,63 @@ class Forecasting(AutoMLVertical, TableVertical): """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'forecasting_settings': {'key': 'forecastingSettings', 'type': 'ForecastingSettings'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'ForecastingTrainingSettings'}, - } - - def __init__( - self, - **kwargs - ): + "task_type": {"required": True}, + "training_data": {"required": True}, + } + + _attribute_map = { + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "TableFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "search_space": { + "key": "searchSpace", + "type": "[TableParameterSubspace]", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "TableSweepSettings", + }, + "test_data": {"key": "testData", "type": "MLTableJobInput"}, + "test_data_size": {"key": "testDataSize", "type": "float"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "weight_column_name": {"key": "weightColumnName", "type": "str"}, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "forecasting_settings": { + "key": "forecastingSettings", + "type": "ForecastingSettings", + }, + "primary_metric": {"key": "primaryMetric", "type": "str"}, + "training_settings": { + "key": "trainingSettings", + "type": "ForecastingTrainingSettings", + }, + } + + def __init__(self, **kwargs): """ :keyword cv_split_column_names: Columns to use for CVSplit data. :paramtype cv_split_column_names: list[str] @@ -9793,25 +9812,27 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ForecastingTrainingSettings """ super(Forecasting, self).__init__(**kwargs) - self.cv_split_column_names = kwargs.get('cv_split_column_names', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.test_data = kwargs.get('test_data', None) - self.test_data_size = kwargs.get('test_data_size', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.weight_column_name = kwargs.get('weight_column_name', None) - self.task_type = 'Forecasting' # type: str - self.forecasting_settings = kwargs.get('forecasting_settings', None) - self.primary_metric = kwargs.get('primary_metric', None) - self.training_settings = kwargs.get('training_settings', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.cv_split_column_names = kwargs.get("cv_split_column_names", None) + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.fixed_parameters = kwargs.get("fixed_parameters", None) + self.limit_settings = kwargs.get("limit_settings", None) + self.n_cross_validations = kwargs.get("n_cross_validations", None) + self.search_space = kwargs.get("search_space", None) + self.sweep_settings = kwargs.get("sweep_settings", None) + self.test_data = kwargs.get("test_data", None) + self.test_data_size = kwargs.get("test_data_size", None) + self.validation_data = kwargs.get("validation_data", None) + self.validation_data_size = kwargs.get("validation_data_size", None) + self.weight_column_name = kwargs.get("weight_column_name", None) + self.task_type = "Forecasting" # type: str + self.forecasting_settings = kwargs.get("forecasting_settings", None) + self.primary_metric = kwargs.get("primary_metric", None) + self.training_settings = kwargs.get("training_settings", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class ForecastingSettings(msrest.serialization.Model): @@ -9869,25 +9890,40 @@ class ForecastingSettings(msrest.serialization.Model): """ _attribute_map = { - 'country_or_region_for_holidays': {'key': 'countryOrRegionForHolidays', 'type': 'str'}, - 'cv_step_size': {'key': 'cvStepSize', 'type': 'int'}, - 'feature_lags': {'key': 'featureLags', 'type': 'str'}, - 'forecast_horizon': {'key': 'forecastHorizon', 'type': 'ForecastHorizon'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'seasonality': {'key': 'seasonality', 'type': 'Seasonality'}, - 'short_series_handling_config': {'key': 'shortSeriesHandlingConfig', 'type': 'str'}, - 'target_aggregate_function': {'key': 'targetAggregateFunction', 'type': 'str'}, - 'target_lags': {'key': 'targetLags', 'type': 'TargetLags'}, - 'target_rolling_window_size': {'key': 'targetRollingWindowSize', 'type': 'TargetRollingWindowSize'}, - 'time_column_name': {'key': 'timeColumnName', 'type': 'str'}, - 'time_series_id_column_names': {'key': 'timeSeriesIdColumnNames', 'type': '[str]'}, - 'use_stl': {'key': 'useStl', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + "country_or_region_for_holidays": { + "key": "countryOrRegionForHolidays", + "type": "str", + }, + "cv_step_size": {"key": "cvStepSize", "type": "int"}, + "feature_lags": {"key": "featureLags", "type": "str"}, + "forecast_horizon": { + "key": "forecastHorizon", + "type": "ForecastHorizon", + }, + "frequency": {"key": "frequency", "type": "str"}, + "seasonality": {"key": "seasonality", "type": "Seasonality"}, + "short_series_handling_config": { + "key": "shortSeriesHandlingConfig", + "type": "str", + }, + "target_aggregate_function": { + "key": "targetAggregateFunction", + "type": "str", + }, + "target_lags": {"key": "targetLags", "type": "TargetLags"}, + "target_rolling_window_size": { + "key": "targetRollingWindowSize", + "type": "TargetRollingWindowSize", + }, + "time_column_name": {"key": "timeColumnName", "type": "str"}, + "time_series_id_column_names": { + "key": "timeSeriesIdColumnNames", + "type": "[str]", + }, + "use_stl": {"key": "useStl", "type": "str"}, + } + + def __init__(self, **kwargs): """ :keyword country_or_region_for_holidays: Country or region for holidays for forecasting tasks. These should be ISO 3166 two-letter country/region codes, for example 'US' or 'GB'. @@ -9942,19 +9978,29 @@ def __init__( :paramtype use_stl: str or ~azure.mgmt.machinelearningservices.models.UseStl """ super(ForecastingSettings, self).__init__(**kwargs) - self.country_or_region_for_holidays = kwargs.get('country_or_region_for_holidays', None) - self.cv_step_size = kwargs.get('cv_step_size', None) - self.feature_lags = kwargs.get('feature_lags', None) - self.forecast_horizon = kwargs.get('forecast_horizon', None) - self.frequency = kwargs.get('frequency', None) - self.seasonality = kwargs.get('seasonality', None) - self.short_series_handling_config = kwargs.get('short_series_handling_config', None) - self.target_aggregate_function = kwargs.get('target_aggregate_function', None) - self.target_lags = kwargs.get('target_lags', None) - self.target_rolling_window_size = kwargs.get('target_rolling_window_size', None) - self.time_column_name = kwargs.get('time_column_name', None) - self.time_series_id_column_names = kwargs.get('time_series_id_column_names', None) - self.use_stl = kwargs.get('use_stl', None) + self.country_or_region_for_holidays = kwargs.get( + "country_or_region_for_holidays", None + ) + self.cv_step_size = kwargs.get("cv_step_size", None) + self.feature_lags = kwargs.get("feature_lags", None) + self.forecast_horizon = kwargs.get("forecast_horizon", None) + self.frequency = kwargs.get("frequency", None) + self.seasonality = kwargs.get("seasonality", None) + self.short_series_handling_config = kwargs.get( + "short_series_handling_config", None + ) + self.target_aggregate_function = kwargs.get( + "target_aggregate_function", None + ) + self.target_lags = kwargs.get("target_lags", None) + self.target_rolling_window_size = kwargs.get( + "target_rolling_window_size", None + ) + self.time_column_name = kwargs.get("time_column_name", None) + self.time_series_id_column_names = kwargs.get( + "time_series_id_column_names", None + ) + self.use_stl = kwargs.get("use_stl", None) class ForecastingTrainingSettings(TrainingSettings): @@ -9994,22 +10040,40 @@ class ForecastingTrainingSettings(TrainingSettings): """ _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): + "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, + "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, + "training_mode": {"key": "trainingMode", "type": "str"}, + "allowed_training_algorithms": { + "key": "allowedTrainingAlgorithms", + "type": "[str]", + }, + "blocked_training_algorithms": { + "key": "blockedTrainingAlgorithms", + "type": "[str]", + }, + } + + def __init__(self, **kwargs): """ :keyword enable_dnn_training: Enable recommendation of DNN models. :paramtype enable_dnn_training: bool @@ -10044,8 +10108,12 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ForecastingModels] """ super(ForecastingTrainingSettings, self).__init__(**kwargs) - self.allowed_training_algorithms = kwargs.get('allowed_training_algorithms', None) - self.blocked_training_algorithms = kwargs.get('blocked_training_algorithms', None) + self.allowed_training_algorithms = kwargs.get( + "allowed_training_algorithms", None + ) + self.blocked_training_algorithms = kwargs.get( + "blocked_training_algorithms", None + ) class FQDNEndpoint(msrest.serialization.Model): @@ -10058,14 +10126,14 @@ class FQDNEndpoint(msrest.serialization.Model): """ _attribute_map = { - 'domain_name': {'key': 'domainName', 'type': 'str'}, - 'endpoint_details': {'key': 'endpointDetails', 'type': '[FQDNEndpointDetail]'}, + "domain_name": {"key": "domainName", "type": "str"}, + "endpoint_details": { + "key": "endpointDetails", + "type": "[FQDNEndpointDetail]", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword domain_name: :paramtype domain_name: str @@ -10074,8 +10142,8 @@ def __init__( list[~azure.mgmt.machinelearningservices.models.FQDNEndpointDetail] """ super(FQDNEndpoint, self).__init__(**kwargs) - self.domain_name = kwargs.get('domain_name', None) - self.endpoint_details = kwargs.get('endpoint_details', None) + self.domain_name = kwargs.get("domain_name", None) + self.endpoint_details = kwargs.get("endpoint_details", None) class FQDNEndpointDetail(msrest.serialization.Model): @@ -10086,19 +10154,16 @@ class FQDNEndpointDetail(msrest.serialization.Model): """ _attribute_map = { - 'port': {'key': 'port', 'type': 'int'}, + "port": {"key": "port", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword port: :paramtype port: int """ super(FQDNEndpointDetail, self).__init__(**kwargs) - self.port = kwargs.get('port', None) + self.port = kwargs.get("port", None) class FQDNEndpoints(msrest.serialization.Model): @@ -10109,19 +10174,16 @@ class FQDNEndpoints(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'FQDNEndpointsProperties'}, + "properties": {"key": "properties", "type": "FQDNEndpointsProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: :paramtype properties: ~azure.mgmt.machinelearningservices.models.FQDNEndpointsProperties """ super(FQDNEndpoints, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class FQDNEndpointsProperties(msrest.serialization.Model): @@ -10134,14 +10196,11 @@ class FQDNEndpointsProperties(msrest.serialization.Model): """ _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'endpoints': {'key': 'endpoints', 'type': '[FQDNEndpoint]'}, + "category": {"key": "category", "type": "str"}, + "endpoints": {"key": "endpoints", "type": "[FQDNEndpoint]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: :paramtype category: str @@ -10149,8 +10208,8 @@ def __init__( :paramtype endpoints: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoint] """ super(FQDNEndpointsProperties, self).__init__(**kwargs) - self.category = kwargs.get('category', None) - self.endpoints = kwargs.get('endpoints', None) + self.category = kwargs.get("category", None) + self.endpoints = kwargs.get("endpoints", None) class OutboundRule(msrest.serialization.Model): @@ -10174,23 +10233,24 @@ class OutboundRule(msrest.serialization.Model): """ _validation = { - 'type': {'required': True}, + "type": {"required": True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, + "type": {"key": "type", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "category": {"key": "category", "type": "str"}, } _subtype_map = { - 'type': {'FQDN': 'FqdnOutboundRule', 'PrivateEndpoint': 'PrivateEndpointOutboundRule', 'ServiceTag': 'ServiceTagOutboundRule'} + "type": { + "FQDN": "FqdnOutboundRule", + "PrivateEndpoint": "PrivateEndpointOutboundRule", + "ServiceTag": "ServiceTagOutboundRule", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword status: Status of a managed network Outbound Rule of a machine learning workspace. Possible values include: "Inactive", "Active". @@ -10201,8 +10261,8 @@ def __init__( """ super(OutboundRule, self).__init__(**kwargs) self.type = None # type: Optional[str] - self.status = kwargs.get('status', None) - self.category = kwargs.get('category', None) + self.status = kwargs.get("status", None) + self.category = kwargs.get("category", None) class FqdnOutboundRule(OutboundRule): @@ -10225,20 +10285,17 @@ class FqdnOutboundRule(OutboundRule): """ _validation = { - 'type': {'required': True}, + "type": {"required": True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'str'}, + "type": {"key": "type", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "destination": {"key": "destination", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword status: Status of a managed network Outbound Rule of a machine learning workspace. Possible values include: "Inactive", "Active". @@ -10250,8 +10307,8 @@ def __init__( :paramtype destination: str """ super(FqdnOutboundRule, self).__init__(**kwargs) - self.type = 'FQDN' # type: str - self.destination = kwargs.get('destination', None) + self.type = "FQDN" # type: str + self.destination = kwargs.get("destination", None) class GridSamplingAlgorithm(SamplingAlgorithm): @@ -10267,21 +10324,20 @@ class GridSamplingAlgorithm(SamplingAlgorithm): """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(GridSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Grid' # type: str + self.sampling_algorithm_type = "Grid" # type: str class HdfsDatastore(DatastoreProperties): @@ -10316,28 +10372,28 @@ class HdfsDatastore(DatastoreProperties): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'name_node_address': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "name_node_address": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'hdfs_server_certificate': {'key': 'hdfsServerCertificate', 'type': 'str'}, - 'name_node_address': {'key': 'nameNodeAddress', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "hdfs_server_certificate": { + "key": "hdfsServerCertificate", + "type": "str", + }, + "name_node_address": {"key": "nameNodeAddress", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -10356,10 +10412,12 @@ def __init__( :paramtype protocol: str """ super(HdfsDatastore, self).__init__(**kwargs) - self.datastore_type = 'Hdfs' # type: str - self.hdfs_server_certificate = kwargs.get('hdfs_server_certificate', None) - self.name_node_address = kwargs['name_node_address'] - self.protocol = kwargs.get('protocol', "http") + self.datastore_type = "Hdfs" # type: str + self.hdfs_server_certificate = kwargs.get( + "hdfs_server_certificate", None + ) + self.name_node_address = kwargs["name_node_address"] + self.protocol = kwargs.get("protocol", "http") class HDInsightSchema(msrest.serialization.Model): @@ -10370,19 +10428,16 @@ class HDInsightSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, + "properties": {"key": "properties", "type": "HDInsightProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: HDInsight compute properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties """ super(HDInsightSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class HDInsight(Compute, HDInsightSchema): @@ -10424,32 +10479,32 @@ class HDInsight(Compute, HDInsightSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "HDInsightProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: HDInsight compute properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties @@ -10464,17 +10519,17 @@ def __init__( :paramtype disable_local_auth: bool """ super(HDInsight, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'HDInsight' # type: str - self.compute_location = kwargs.get('compute_location', None) + self.properties = kwargs.get("properties", None) + self.compute_type = "HDInsight" # type: str + self.compute_location = kwargs.get("compute_location", None) self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) + self.disable_local_auth = kwargs.get("disable_local_auth", None) class HDInsightProperties(msrest.serialization.Model): @@ -10490,15 +10545,15 @@ class HDInsightProperties(msrest.serialization.Model): """ _attribute_map = { - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, + "ssh_port": {"key": "sshPort", "type": "int"}, + "address": {"key": "address", "type": "str"}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword ssh_port: Port open for ssh connections on the master node of the cluster. :paramtype ssh_port: int @@ -10509,9 +10564,9 @@ def __init__( ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials """ super(HDInsightProperties, self).__init__(**kwargs) - self.ssh_port = kwargs.get('ssh_port', None) - self.address = kwargs.get('address', None) - self.administrator_account = kwargs.get('administrator_account', None) + self.ssh_port = kwargs.get("ssh_port", None) + self.address = kwargs.get("address", None) + self.administrator_account = kwargs.get("administrator_account", None) class IdAssetReference(AssetReferenceBase): @@ -10527,26 +10582,23 @@ class IdAssetReference(AssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, - 'asset_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "reference_type": {"required": True}, + "asset_id": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'asset_id': {'key': 'assetId', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "asset_id": {"key": "assetId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword asset_id: Required. [Required] ARM resource ID of the asset. :paramtype asset_id: str """ super(IdAssetReference, self).__init__(**kwargs) - self.reference_type = 'Id' # type: str - self.asset_id = kwargs['asset_id'] + self.reference_type = "Id" # type: str + self.asset_id = kwargs["asset_id"] class IdentityForCmk(msrest.serialization.Model): @@ -10558,20 +10610,22 @@ class IdentityForCmk(msrest.serialization.Model): """ _attribute_map = { - 'user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, + "user_assigned_identity": { + "key": "userAssignedIdentity", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword user_assigned_identity: The ArmId of the user assigned identity that will be used to access the customer managed key vault. :paramtype user_assigned_identity: str """ super(IdentityForCmk, self).__init__(**kwargs) - self.user_assigned_identity = kwargs.get('user_assigned_identity', None) + self.user_assigned_identity = kwargs.get( + "user_assigned_identity", None + ) class IdleShutdownSetting(msrest.serialization.Model): @@ -10583,20 +10637,22 @@ class IdleShutdownSetting(msrest.serialization.Model): """ _attribute_map = { - 'idle_time_before_shutdown': {'key': 'idleTimeBeforeShutdown', 'type': 'str'}, + "idle_time_before_shutdown": { + "key": "idleTimeBeforeShutdown", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword idle_time_before_shutdown: Time is defined in ISO8601 format. Minimum is 15 min, maximum is 3 days. :paramtype idle_time_before_shutdown: str """ super(IdleShutdownSetting, self).__init__(**kwargs) - self.idle_time_before_shutdown = kwargs.get('idle_time_before_shutdown', None) + self.idle_time_before_shutdown = kwargs.get( + "idle_time_before_shutdown", None + ) class Image(msrest.serialization.Model): @@ -10613,15 +10669,12 @@ class Image(msrest.serialization.Model): """ _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'reference': {'key': 'reference', 'type': 'str'}, + "additional_properties": {"key": "", "type": "{object}"}, + "type": {"key": "type", "type": "str"}, + "reference": {"key": "reference", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword additional_properties: Unmatched properties from the message are deserialized to this collection. @@ -10633,45 +10686,51 @@ def __init__( :paramtype reference: str """ super(Image, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.type = kwargs.get('type', "docker") - self.reference = kwargs.get('reference', None) + self.additional_properties = kwargs.get("additional_properties", None) + self.type = kwargs.get("type", "docker") + self.reference = kwargs.get("reference", None) class ImageVertical(msrest.serialization.Model): """Abstract class for AutoML tasks that train image (computer vision) models - -such as Image Classification / Image Classification Multilabel / Image Object Detection / Image Instance Segmentation. + such as Image Classification / Image Classification Multilabel / Image Object Detection / Image Instance Segmentation. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float """ _validation = { - 'limit_settings': {'required': True}, + "limit_settings": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings @@ -10686,10 +10745,10 @@ def __init__( :paramtype validation_data_size: float """ super(ImageVertical, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) + self.limit_settings = kwargs["limit_settings"] + self.sweep_settings = kwargs.get("sweep_settings", None) + self.validation_data = kwargs.get("validation_data", None) + self.validation_data_size = kwargs.get("validation_data_size", None) class ImageClassificationBase(ImageVertical): @@ -10718,22 +10777,34 @@ class ImageClassificationBase(ImageVertical): """ _validation = { - 'limit_settings': {'required': True}, + "limit_settings": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsClassification", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsClassification]", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings @@ -10755,78 +10826,90 @@ def __init__( list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] """ super(ImageClassificationBase, self).__init__(**kwargs) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) + self.model_settings = kwargs.get("model_settings", None) + self.search_space = kwargs.get("search_space", None) class ImageClassification(AutoMLVertical, ImageClassificationBase): """Image Classification. Multi-class image classification is used when an image is classified with only a single label -from a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' or a 'duck'. + from a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' or a 'duck'. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, + "limit_settings": {"required": True}, + "task_type": {"required": True}, + "training_data": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsClassification", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsClassification]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings @@ -10861,87 +10944,99 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ super(ImageClassification, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageClassification' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.limit_settings = kwargs["limit_settings"] + self.sweep_settings = kwargs.get("sweep_settings", None) + self.validation_data = kwargs.get("validation_data", None) + self.validation_data_size = kwargs.get("validation_data_size", None) + self.model_settings = kwargs.get("model_settings", None) + self.search_space = kwargs.get("search_space", None) + self.task_type = "ImageClassification" # type: str + self.primary_metric = kwargs.get("primary_metric", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class ImageClassificationMultilabel(AutoMLVertical, ImageClassificationBase): """Image Classification Multilabel. Multi-label image classification is used when an image could have one or more labels -from a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'. + from a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted", "IOU". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics """ _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, + "limit_settings": {"required": True}, + "task_type": {"required": True}, + "training_data": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsClassification", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsClassification]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings @@ -10976,17 +11071,17 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics """ super(ImageClassificationMultilabel, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageClassificationMultilabel' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.limit_settings = kwargs["limit_settings"] + self.sweep_settings = kwargs.get("sweep_settings", None) + self.validation_data = kwargs.get("validation_data", None) + self.validation_data_size = kwargs.get("validation_data_size", None) + self.model_settings = kwargs.get("model_settings", None) + self.search_space = kwargs.get("search_space", None) + self.task_type = "ImageClassificationMultilabel" # type: str + self.primary_metric = kwargs.get("primary_metric", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class ImageObjectDetectionBase(ImageVertical): @@ -11015,22 +11110,34 @@ class ImageObjectDetectionBase(ImageVertical): """ _validation = { - 'limit_settings': {'required': True}, + "limit_settings": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsObjectDetection", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsObjectDetection]", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings @@ -11052,77 +11159,89 @@ def __init__( list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] """ super(ImageObjectDetectionBase, self).__init__(**kwargs) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) + self.model_settings = kwargs.get("model_settings", None) + self.search_space = kwargs.get("search_space", None) class ImageInstanceSegmentation(AutoMLVertical, ImageObjectDetectionBase): """Image Instance Segmentation. Instance segmentation is used to identify objects in an image at the pixel level, -drawing a polygon around each object in the image. + drawing a polygon around each object in the image. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "MeanAveragePrecision". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics """ _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, + "limit_settings": {"required": True}, + "task_type": {"required": True}, + "training_data": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsObjectDetection", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsObjectDetection]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings @@ -11156,17 +11275,17 @@ def __init__( ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics """ super(ImageInstanceSegmentation, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageInstanceSegmentation' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.limit_settings = kwargs["limit_settings"] + self.sweep_settings = kwargs.get("sweep_settings", None) + self.validation_data = kwargs.get("validation_data", None) + self.validation_data_size = kwargs.get("validation_data_size", None) + self.model_settings = kwargs.get("model_settings", None) + self.search_space = kwargs.get("search_space", None) + self.task_type = "ImageInstanceSegmentation" # type: str + self.primary_metric = kwargs.get("primary_metric", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class ImageLimitSettings(msrest.serialization.Model): @@ -11181,15 +11300,12 @@ class ImageLimitSettings(msrest.serialization.Model): """ _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_trials": {"key": "maxTrials", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword max_concurrent_trials: Maximum number of concurrent AutoML iterations. :paramtype max_concurrent_trials: int @@ -11199,9 +11315,9 @@ def __init__( :paramtype timeout: ~datetime.timedelta """ super(ImageLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', 1) - self.max_trials = kwargs.get('max_trials', 1) - self.timeout = kwargs.get('timeout', "P7D") + self.max_concurrent_trials = kwargs.get("max_concurrent_trials", 1) + self.max_trials = kwargs.get("max_trials", 1) + self.timeout = kwargs.get("timeout", "P7D") class ImageMetadata(msrest.serialization.Model): @@ -11218,15 +11334,15 @@ class ImageMetadata(msrest.serialization.Model): """ _attribute_map = { - 'current_image_version': {'key': 'currentImageVersion', 'type': 'str'}, - 'latest_image_version': {'key': 'latestImageVersion', 'type': 'str'}, - 'is_latest_os_image_version': {'key': 'isLatestOsImageVersion', 'type': 'bool'}, + "current_image_version": {"key": "currentImageVersion", "type": "str"}, + "latest_image_version": {"key": "latestImageVersion", "type": "str"}, + "is_latest_os_image_version": { + "key": "isLatestOsImageVersion", + "type": "bool", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword current_image_version: Specifies the current operating system image version this compute instance is running on. @@ -11238,143 +11354,160 @@ def __init__( :paramtype is_latest_os_image_version: bool """ super(ImageMetadata, self).__init__(**kwargs) - self.current_image_version = kwargs.get('current_image_version', None) - self.latest_image_version = kwargs.get('latest_image_version', None) - self.is_latest_os_image_version = kwargs.get('is_latest_os_image_version', None) + self.current_image_version = kwargs.get("current_image_version", None) + self.latest_image_version = kwargs.get("latest_image_version", None) + self.is_latest_os_image_version = kwargs.get( + "is_latest_os_image_version", None + ) class ImageModelDistributionSettings(msrest.serialization.Model): """Distribution expressions to sweep over values of model settings. -:code:` -Some examples are: - -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -` -All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) -where distribution name can be: uniform, quniform, loguniform, etc -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + :code:` + Some examples are: + + ModelName = "choice('seresnext', 'resnest50')"; + LearningRate = "uniform(0.001, 0.01)"; + LayersToFreeze = "choice(0, 2)"; + ` + All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) + where distribution name can be: uniform, quniform, loguniform, etc + For more details on how to compose distribution expressions please check the documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: str + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: str + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: str + :ivar distributed: Whether to use distributer training. + :vartype distributed: str + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: str + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: str + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: str + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: str + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: str + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: str + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: str + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: str + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. + :vartype learning_rate_scheduler: str + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: str + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: str + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: str + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: str + :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. + :vartype optimizer: str + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: str + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: str + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: str + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: str + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: str + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: str + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: str + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: str + """ + + _attribute_map = { + "ams_gradient": {"key": "amsGradient", "type": "str"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "str"}, + "beta2": {"key": "beta2", "type": "str"}, + "distributed": {"key": "distributed", "type": "str"}, + "early_stopping": {"key": "earlyStopping", "type": "str"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "str"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "str", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "str", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "str"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "str", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "str"}, + "nesterov": {"key": "nesterov", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "str"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "str"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "str"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "str"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "str"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "str", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "str", + }, + "weight_decay": {"key": "weightDecay", "type": "str"}, + } + + def __init__(self, **kwargs): """ :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :paramtype ams_gradient: str @@ -11458,183 +11591,215 @@ def __init__( :paramtype weight_decay: str """ super(ImageModelDistributionSettings, self).__init__(**kwargs) - self.ams_gradient = kwargs.get('ams_gradient', None) - self.augmentations = kwargs.get('augmentations', None) - self.beta1 = kwargs.get('beta1', None) - self.beta2 = kwargs.get('beta2', None) - self.distributed = kwargs.get('distributed', None) - self.early_stopping = kwargs.get('early_stopping', None) - self.early_stopping_delay = kwargs.get('early_stopping_delay', None) - self.early_stopping_patience = kwargs.get('early_stopping_patience', None) - self.enable_onnx_normalization = kwargs.get('enable_onnx_normalization', None) - self.evaluation_frequency = kwargs.get('evaluation_frequency', None) - self.gradient_accumulation_step = kwargs.get('gradient_accumulation_step', None) - self.layers_to_freeze = kwargs.get('layers_to_freeze', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.learning_rate_scheduler = kwargs.get('learning_rate_scheduler', None) - self.model_name = kwargs.get('model_name', None) - self.momentum = kwargs.get('momentum', None) - self.nesterov = kwargs.get('nesterov', None) - self.number_of_epochs = kwargs.get('number_of_epochs', None) - self.number_of_workers = kwargs.get('number_of_workers', None) - self.optimizer = kwargs.get('optimizer', None) - self.random_seed = kwargs.get('random_seed', None) - self.step_lr_gamma = kwargs.get('step_lr_gamma', None) - self.step_lr_step_size = kwargs.get('step_lr_step_size', None) - self.training_batch_size = kwargs.get('training_batch_size', None) - self.validation_batch_size = kwargs.get('validation_batch_size', None) - self.warmup_cosine_lr_cycles = kwargs.get('warmup_cosine_lr_cycles', None) - self.warmup_cosine_lr_warmup_epochs = kwargs.get('warmup_cosine_lr_warmup_epochs', None) - self.weight_decay = kwargs.get('weight_decay', None) - - -class ImageModelDistributionSettingsClassification(ImageModelDistributionSettings): + self.ams_gradient = kwargs.get("ams_gradient", None) + self.augmentations = kwargs.get("augmentations", None) + self.beta1 = kwargs.get("beta1", None) + self.beta2 = kwargs.get("beta2", None) + self.distributed = kwargs.get("distributed", None) + self.early_stopping = kwargs.get("early_stopping", None) + self.early_stopping_delay = kwargs.get("early_stopping_delay", None) + self.early_stopping_patience = kwargs.get( + "early_stopping_patience", None + ) + self.enable_onnx_normalization = kwargs.get( + "enable_onnx_normalization", None + ) + self.evaluation_frequency = kwargs.get("evaluation_frequency", None) + self.gradient_accumulation_step = kwargs.get( + "gradient_accumulation_step", None + ) + self.layers_to_freeze = kwargs.get("layers_to_freeze", None) + self.learning_rate = kwargs.get("learning_rate", None) + self.learning_rate_scheduler = kwargs.get( + "learning_rate_scheduler", None + ) + self.model_name = kwargs.get("model_name", None) + self.momentum = kwargs.get("momentum", None) + self.nesterov = kwargs.get("nesterov", None) + self.number_of_epochs = kwargs.get("number_of_epochs", None) + self.number_of_workers = kwargs.get("number_of_workers", None) + self.optimizer = kwargs.get("optimizer", None) + self.random_seed = kwargs.get("random_seed", None) + self.step_lr_gamma = kwargs.get("step_lr_gamma", None) + self.step_lr_step_size = kwargs.get("step_lr_step_size", None) + self.training_batch_size = kwargs.get("training_batch_size", None) + self.validation_batch_size = kwargs.get("validation_batch_size", None) + self.warmup_cosine_lr_cycles = kwargs.get( + "warmup_cosine_lr_cycles", None + ) + self.warmup_cosine_lr_warmup_epochs = kwargs.get( + "warmup_cosine_lr_warmup_epochs", None + ) + self.weight_decay = kwargs.get("weight_decay", None) + + +class ImageModelDistributionSettingsClassification( + ImageModelDistributionSettings +): """Distribution expressions to sweep over values of model settings. -:code:` -Some examples are: - -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: str - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: str - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: str - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'str'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'str'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'str'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + :code:` + Some examples are: + + ModelName = "choice('seresnext', 'resnest50')"; + LearningRate = "uniform(0.001, 0.01)"; + LayersToFreeze = "choice(0, 2)"; + ` + For more details on how to compose distribution expressions please check the documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: str + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: str + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: str + :ivar distributed: Whether to use distributer training. + :vartype distributed: str + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: str + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: str + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: str + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: str + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: str + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: str + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: str + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: str + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. + :vartype learning_rate_scheduler: str + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: str + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: str + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: str + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: str + :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. + :vartype optimizer: str + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: str + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: str + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: str + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: str + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: str + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: str + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: str + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: str + :ivar training_crop_size: Image crop size that is input to the neural network for the training + dataset. Must be a positive integer. + :vartype training_crop_size: str + :ivar validation_crop_size: Image crop size that is input to the neural network for the + validation dataset. Must be a positive integer. + :vartype validation_crop_size: str + :ivar validation_resize_size: Image size to which to resize before cropping for validation + dataset. Must be a positive integer. + :vartype validation_resize_size: str + :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. + 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be + 0 or 1 or 2. + :vartype weighted_loss: str + """ + + _attribute_map = { + "ams_gradient": {"key": "amsGradient", "type": "str"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "str"}, + "beta2": {"key": "beta2", "type": "str"}, + "distributed": {"key": "distributed", "type": "str"}, + "early_stopping": {"key": "earlyStopping", "type": "str"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "str"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "str", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "str", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "str"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "str", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "str"}, + "nesterov": {"key": "nesterov", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "str"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "str"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "str"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "str"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "str"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "str", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "str", + }, + "weight_decay": {"key": "weightDecay", "type": "str"}, + "training_crop_size": {"key": "trainingCropSize", "type": "str"}, + "validation_crop_size": {"key": "validationCropSize", "type": "str"}, + "validation_resize_size": { + "key": "validationResizeSize", + "type": "str", + }, + "weighted_loss": {"key": "weightedLoss", "type": "str"}, + } + + def __init__(self, **kwargs): """ :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :paramtype ams_gradient: str @@ -11730,208 +11895,241 @@ def __init__( 0 or 1 or 2. :paramtype weighted_loss: str """ - super(ImageModelDistributionSettingsClassification, self).__init__(**kwargs) - self.training_crop_size = kwargs.get('training_crop_size', None) - self.validation_crop_size = kwargs.get('validation_crop_size', None) - self.validation_resize_size = kwargs.get('validation_resize_size', None) - self.weighted_loss = kwargs.get('weighted_loss', None) + super(ImageModelDistributionSettingsClassification, self).__init__( + **kwargs + ) + self.training_crop_size = kwargs.get("training_crop_size", None) + self.validation_crop_size = kwargs.get("validation_crop_size", None) + self.validation_resize_size = kwargs.get( + "validation_resize_size", None + ) + self.weighted_loss = kwargs.get("weighted_loss", None) -class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettings): +class ImageModelDistributionSettingsObjectDetection( + ImageModelDistributionSettings +): """Distribution expressions to sweep over values of model settings. -:code:` -Some examples are: - -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: str - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: str - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: str - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: str - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: str - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype model_size: str - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: str - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - float in the range [0, 1]. - :vartype nms_iou_threshold: str - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: str - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - NMS: Non-maximum suppression. - :vartype tile_predictions_nms_threshold: str - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: str - :ivar validation_metric_type: Metric computation method to use for validation metrics. Must be - 'none', 'coco', 'voc', or 'coco_voc'. - :vartype validation_metric_type: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'str'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'str'}, - 'image_size': {'key': 'imageSize', 'type': 'str'}, - 'max_size': {'key': 'maxSize', 'type': 'str'}, - 'min_size': {'key': 'minSize', 'type': 'str'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'str'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'str'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'str'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'str'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'str'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + :code:` + Some examples are: + + ModelName = "choice('seresnext', 'resnest50')"; + LearningRate = "uniform(0.001, 0.01)"; + LayersToFreeze = "choice(0, 2)"; + ` + For more details on how to compose distribution expressions please check the documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: str + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: str + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: str + :ivar distributed: Whether to use distributer training. + :vartype distributed: str + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: str + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: str + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: str + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: str + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: str + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: str + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: str + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: str + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. + :vartype learning_rate_scheduler: str + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: str + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: str + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: str + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: str + :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. + :vartype optimizer: str + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: str + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: str + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: str + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: str + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: str + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: str + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: str + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: str + :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must + be a positive integer. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype box_detections_per_image: str + :ivar box_score_threshold: During inference, only return proposals with a classification score + greater than + BoxScoreThreshold. Must be a float in the range[0, 1]. + :vartype box_score_threshold: str + :ivar image_size: Image size for train and validation. Must be a positive integer. + Note: The training run may get into CUDA OOM if the size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype image_size: str + :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype max_size: str + :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype min_size: str + :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. + Note: training run may get into CUDA OOM if the model size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype model_size: str + :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. + Note: training run may get into CUDA OOM if no sufficient GPU memory. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype multi_scale: str + :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be + float in the range [0, 1]. + :vartype nms_iou_threshold: str + :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not + be + None to enable small object detection logic. A string containing two integers in mxn format. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_grid_size: str + :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float + in the range [0, 1). + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_overlap_ratio: str + :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging + predictions from tiles and image. + Used in validation/ inference. Must be float in the range [0, 1]. + Note: This settings is not supported for the 'yolov5' algorithm. + NMS: Non-maximum suppression. + :vartype tile_predictions_nms_threshold: str + :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be + float in the range [0, 1]. + :vartype validation_iou_threshold: str + :ivar validation_metric_type: Metric computation method to use for validation metrics. Must be + 'none', 'coco', 'voc', or 'coco_voc'. + :vartype validation_metric_type: str + """ + + _attribute_map = { + "ams_gradient": {"key": "amsGradient", "type": "str"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "str"}, + "beta2": {"key": "beta2", "type": "str"}, + "distributed": {"key": "distributed", "type": "str"}, + "early_stopping": {"key": "earlyStopping", "type": "str"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "str"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "str", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "str", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "str"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "str", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "str"}, + "nesterov": {"key": "nesterov", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "str"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "str"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "str"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "str"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "str"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "str", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "str", + }, + "weight_decay": {"key": "weightDecay", "type": "str"}, + "box_detections_per_image": { + "key": "boxDetectionsPerImage", + "type": "str", + }, + "box_score_threshold": {"key": "boxScoreThreshold", "type": "str"}, + "image_size": {"key": "imageSize", "type": "str"}, + "max_size": {"key": "maxSize", "type": "str"}, + "min_size": {"key": "minSize", "type": "str"}, + "model_size": {"key": "modelSize", "type": "str"}, + "multi_scale": {"key": "multiScale", "type": "str"}, + "nms_iou_threshold": {"key": "nmsIouThreshold", "type": "str"}, + "tile_grid_size": {"key": "tileGridSize", "type": "str"}, + "tile_overlap_ratio": {"key": "tileOverlapRatio", "type": "str"}, + "tile_predictions_nms_threshold": { + "key": "tilePredictionsNmsThreshold", + "type": "str", + }, + "validation_iou_threshold": { + "key": "validationIouThreshold", + "type": "str", + }, + "validation_metric_type": { + "key": "validationMetricType", + "type": "str", + }, + } + + def __init__(self, **kwargs): """ :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :paramtype ams_gradient: str @@ -12066,156 +12264,184 @@ def __init__( be 'none', 'coco', 'voc', or 'coco_voc'. :paramtype validation_metric_type: str """ - super(ImageModelDistributionSettingsObjectDetection, self).__init__(**kwargs) - self.box_detections_per_image = kwargs.get('box_detections_per_image', None) - self.box_score_threshold = kwargs.get('box_score_threshold', None) - self.image_size = kwargs.get('image_size', None) - self.max_size = kwargs.get('max_size', None) - self.min_size = kwargs.get('min_size', None) - self.model_size = kwargs.get('model_size', None) - self.multi_scale = kwargs.get('multi_scale', None) - self.nms_iou_threshold = kwargs.get('nms_iou_threshold', None) - self.tile_grid_size = kwargs.get('tile_grid_size', None) - self.tile_overlap_ratio = kwargs.get('tile_overlap_ratio', None) - self.tile_predictions_nms_threshold = kwargs.get('tile_predictions_nms_threshold', None) - self.validation_iou_threshold = kwargs.get('validation_iou_threshold', None) - self.validation_metric_type = kwargs.get('validation_metric_type', None) + super(ImageModelDistributionSettingsObjectDetection, self).__init__( + **kwargs + ) + self.box_detections_per_image = kwargs.get( + "box_detections_per_image", None + ) + self.box_score_threshold = kwargs.get("box_score_threshold", None) + self.image_size = kwargs.get("image_size", None) + self.max_size = kwargs.get("max_size", None) + self.min_size = kwargs.get("min_size", None) + self.model_size = kwargs.get("model_size", None) + self.multi_scale = kwargs.get("multi_scale", None) + self.nms_iou_threshold = kwargs.get("nms_iou_threshold", None) + self.tile_grid_size = kwargs.get("tile_grid_size", None) + self.tile_overlap_ratio = kwargs.get("tile_overlap_ratio", None) + self.tile_predictions_nms_threshold = kwargs.get( + "tile_predictions_nms_threshold", None + ) + self.validation_iou_threshold = kwargs.get( + "validation_iou_threshold", None + ) + self.validation_metric_type = kwargs.get( + "validation_metric_type", None + ) class ImageModelSettings(msrest.serialization.Model): """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar advanced_settings: Settings for advanced scenarios. + :vartype advanced_settings: str + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: bool + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: float + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: float + :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. + :vartype checkpoint_frequency: int + :ivar checkpoint_model: The pretrained checkpoint model for incremental training. + :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput + :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for + incremental training. + :vartype checkpoint_run_id: str + :ivar distributed: Whether to use distributed training. + :vartype distributed: bool + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: bool + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: int + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: int + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: bool + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: int + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: int + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: int + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: float + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. Possible values include: "None", "WarmupCosine", "Step". + :vartype learning_rate_scheduler: str or + ~azure.mgmt.machinelearningservices.models.LearningRateScheduler + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: float + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: bool + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: int + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: int + :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". + :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: int + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: float + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: int + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: int + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: int + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: float + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: int + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: float + """ + + _attribute_map = { + "advanced_settings": {"key": "advancedSettings", "type": "str"}, + "ams_gradient": {"key": "amsGradient", "type": "bool"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "float"}, + "beta2": {"key": "beta2", "type": "float"}, + "checkpoint_frequency": {"key": "checkpointFrequency", "type": "int"}, + "checkpoint_model": { + "key": "checkpointModel", + "type": "MLFlowModelJobInput", + }, + "checkpoint_run_id": {"key": "checkpointRunId", "type": "str"}, + "distributed": {"key": "distributed", "type": "bool"}, + "early_stopping": {"key": "earlyStopping", "type": "bool"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "int"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "int", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "bool", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "int"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "int", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "int"}, + "learning_rate": {"key": "learningRate", "type": "float"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "float"}, + "nesterov": {"key": "nesterov", "type": "bool"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "int"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "int"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "int"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "float"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "int"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "float", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "int", + }, + "weight_decay": {"key": "weightDecay", "type": "float"}, + } + + def __init__(self, **kwargs): """ :keyword advanced_settings: Settings for advanced scenarios. :paramtype advanced_settings: str @@ -12310,191 +12536,224 @@ def __init__( :paramtype weight_decay: float """ super(ImageModelSettings, self).__init__(**kwargs) - self.advanced_settings = kwargs.get('advanced_settings', None) - self.ams_gradient = kwargs.get('ams_gradient', None) - self.augmentations = kwargs.get('augmentations', None) - self.beta1 = kwargs.get('beta1', None) - self.beta2 = kwargs.get('beta2', None) - self.checkpoint_frequency = kwargs.get('checkpoint_frequency', None) - self.checkpoint_model = kwargs.get('checkpoint_model', None) - self.checkpoint_run_id = kwargs.get('checkpoint_run_id', None) - self.distributed = kwargs.get('distributed', None) - self.early_stopping = kwargs.get('early_stopping', None) - self.early_stopping_delay = kwargs.get('early_stopping_delay', None) - self.early_stopping_patience = kwargs.get('early_stopping_patience', None) - self.enable_onnx_normalization = kwargs.get('enable_onnx_normalization', None) - self.evaluation_frequency = kwargs.get('evaluation_frequency', None) - self.gradient_accumulation_step = kwargs.get('gradient_accumulation_step', None) - self.layers_to_freeze = kwargs.get('layers_to_freeze', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.learning_rate_scheduler = kwargs.get('learning_rate_scheduler', None) - self.model_name = kwargs.get('model_name', None) - self.momentum = kwargs.get('momentum', None) - self.nesterov = kwargs.get('nesterov', None) - self.number_of_epochs = kwargs.get('number_of_epochs', None) - self.number_of_workers = kwargs.get('number_of_workers', None) - self.optimizer = kwargs.get('optimizer', None) - self.random_seed = kwargs.get('random_seed', None) - self.step_lr_gamma = kwargs.get('step_lr_gamma', None) - self.step_lr_step_size = kwargs.get('step_lr_step_size', None) - self.training_batch_size = kwargs.get('training_batch_size', None) - self.validation_batch_size = kwargs.get('validation_batch_size', None) - self.warmup_cosine_lr_cycles = kwargs.get('warmup_cosine_lr_cycles', None) - self.warmup_cosine_lr_warmup_epochs = kwargs.get('warmup_cosine_lr_warmup_epochs', None) - self.weight_decay = kwargs.get('weight_decay', None) + self.advanced_settings = kwargs.get("advanced_settings", None) + self.ams_gradient = kwargs.get("ams_gradient", None) + self.augmentations = kwargs.get("augmentations", None) + self.beta1 = kwargs.get("beta1", None) + self.beta2 = kwargs.get("beta2", None) + self.checkpoint_frequency = kwargs.get("checkpoint_frequency", None) + self.checkpoint_model = kwargs.get("checkpoint_model", None) + self.checkpoint_run_id = kwargs.get("checkpoint_run_id", None) + self.distributed = kwargs.get("distributed", None) + self.early_stopping = kwargs.get("early_stopping", None) + self.early_stopping_delay = kwargs.get("early_stopping_delay", None) + self.early_stopping_patience = kwargs.get( + "early_stopping_patience", None + ) + self.enable_onnx_normalization = kwargs.get( + "enable_onnx_normalization", None + ) + self.evaluation_frequency = kwargs.get("evaluation_frequency", None) + self.gradient_accumulation_step = kwargs.get( + "gradient_accumulation_step", None + ) + self.layers_to_freeze = kwargs.get("layers_to_freeze", None) + self.learning_rate = kwargs.get("learning_rate", None) + self.learning_rate_scheduler = kwargs.get( + "learning_rate_scheduler", None + ) + self.model_name = kwargs.get("model_name", None) + self.momentum = kwargs.get("momentum", None) + self.nesterov = kwargs.get("nesterov", None) + self.number_of_epochs = kwargs.get("number_of_epochs", None) + self.number_of_workers = kwargs.get("number_of_workers", None) + self.optimizer = kwargs.get("optimizer", None) + self.random_seed = kwargs.get("random_seed", None) + self.step_lr_gamma = kwargs.get("step_lr_gamma", None) + self.step_lr_step_size = kwargs.get("step_lr_step_size", None) + self.training_batch_size = kwargs.get("training_batch_size", None) + self.validation_batch_size = kwargs.get("validation_batch_size", None) + self.warmup_cosine_lr_cycles = kwargs.get( + "warmup_cosine_lr_cycles", None + ) + self.warmup_cosine_lr_warmup_epochs = kwargs.get( + "warmup_cosine_lr_warmup_epochs", None + ) + self.weight_decay = kwargs.get("weight_decay", None) class ImageModelSettingsClassification(ImageModelSettings): """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: int - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: int - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: int - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: int - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'int'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'int'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'int'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar advanced_settings: Settings for advanced scenarios. + :vartype advanced_settings: str + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: bool + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: float + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: float + :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. + :vartype checkpoint_frequency: int + :ivar checkpoint_model: The pretrained checkpoint model for incremental training. + :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput + :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for + incremental training. + :vartype checkpoint_run_id: str + :ivar distributed: Whether to use distributed training. + :vartype distributed: bool + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: bool + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: int + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: int + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: bool + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: int + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: int + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: int + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: float + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. Possible values include: "None", "WarmupCosine", "Step". + :vartype learning_rate_scheduler: str or + ~azure.mgmt.machinelearningservices.models.LearningRateScheduler + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: float + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: bool + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: int + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: int + :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". + :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: int + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: float + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: int + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: int + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: int + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: float + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: int + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: float + :ivar training_crop_size: Image crop size that is input to the neural network for the training + dataset. Must be a positive integer. + :vartype training_crop_size: int + :ivar validation_crop_size: Image crop size that is input to the neural network for the + validation dataset. Must be a positive integer. + :vartype validation_crop_size: int + :ivar validation_resize_size: Image size to which to resize before cropping for validation + dataset. Must be a positive integer. + :vartype validation_resize_size: int + :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. + 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be + 0 or 1 or 2. + :vartype weighted_loss: int + """ + + _attribute_map = { + "advanced_settings": {"key": "advancedSettings", "type": "str"}, + "ams_gradient": {"key": "amsGradient", "type": "bool"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "float"}, + "beta2": {"key": "beta2", "type": "float"}, + "checkpoint_frequency": {"key": "checkpointFrequency", "type": "int"}, + "checkpoint_model": { + "key": "checkpointModel", + "type": "MLFlowModelJobInput", + }, + "checkpoint_run_id": {"key": "checkpointRunId", "type": "str"}, + "distributed": {"key": "distributed", "type": "bool"}, + "early_stopping": {"key": "earlyStopping", "type": "bool"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "int"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "int", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "bool", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "int"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "int", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "int"}, + "learning_rate": {"key": "learningRate", "type": "float"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "float"}, + "nesterov": {"key": "nesterov", "type": "bool"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "int"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "int"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "int"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "float"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "int"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "float", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "int", + }, + "weight_decay": {"key": "weightDecay", "type": "float"}, + "training_crop_size": {"key": "trainingCropSize", "type": "int"}, + "validation_crop_size": {"key": "validationCropSize", "type": "int"}, + "validation_resize_size": { + "key": "validationResizeSize", + "type": "int", + }, + "weighted_loss": {"key": "weightedLoss", "type": "int"}, + } + + def __init__(self, **kwargs): """ :keyword advanced_settings: Settings for advanced scenarios. :paramtype advanced_settings: str @@ -12602,212 +12861,244 @@ def __init__( :paramtype weighted_loss: int """ super(ImageModelSettingsClassification, self).__init__(**kwargs) - self.training_crop_size = kwargs.get('training_crop_size', None) - self.validation_crop_size = kwargs.get('validation_crop_size', None) - self.validation_resize_size = kwargs.get('validation_resize_size', None) - self.weighted_loss = kwargs.get('weighted_loss', None) + self.training_crop_size = kwargs.get("training_crop_size", None) + self.validation_crop_size = kwargs.get("validation_crop_size", None) + self.validation_resize_size = kwargs.get( + "validation_resize_size", None + ) + self.weighted_loss = kwargs.get("weighted_loss", None) -class ImageModelSettingsObjectDetection(ImageModelSettings): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: int - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: float - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: int - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: int - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: int - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: - "None", "Small", "Medium", "Large", "ExtraLarge". - :vartype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: bool - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be a - float in the range [0, 1]. - :vartype nms_iou_threshold: float - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: float - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_predictions_nms_threshold: float - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: float - :ivar validation_metric_type: Metric computation method to use for validation metrics. Possible - values include: "None", "Coco", "Voc", "CocoVoc". - :vartype validation_metric_type: str or - ~azure.mgmt.machinelearningservices.models.ValidationMetricType - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'int'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'float'}, - 'image_size': {'key': 'imageSize', 'type': 'int'}, - 'max_size': {'key': 'maxSize', 'type': 'int'}, - 'min_size': {'key': 'minSize', 'type': 'int'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'bool'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'float'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'float'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'float'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'float'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): +class ImageModelSettingsObjectDetection(ImageModelSettings): + """Settings used for training the model. + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar advanced_settings: Settings for advanced scenarios. + :vartype advanced_settings: str + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: bool + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: float + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: float + :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. + :vartype checkpoint_frequency: int + :ivar checkpoint_model: The pretrained checkpoint model for incremental training. + :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput + :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for + incremental training. + :vartype checkpoint_run_id: str + :ivar distributed: Whether to use distributed training. + :vartype distributed: bool + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: bool + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: int + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: int + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: bool + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: int + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: int + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: int + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: float + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. Possible values include: "None", "WarmupCosine", "Step". + :vartype learning_rate_scheduler: str or + ~azure.mgmt.machinelearningservices.models.LearningRateScheduler + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: float + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: bool + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: int + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: int + :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". + :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: int + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: float + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: int + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: int + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: int + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: float + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: int + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: float + :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must + be a positive integer. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype box_detections_per_image: int + :ivar box_score_threshold: During inference, only return proposals with a classification score + greater than + BoxScoreThreshold. Must be a float in the range[0, 1]. + :vartype box_score_threshold: float + :ivar image_size: Image size for train and validation. Must be a positive integer. + Note: The training run may get into CUDA OOM if the size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype image_size: int + :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype max_size: int + :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype min_size: int + :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. + Note: training run may get into CUDA OOM if the model size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: + "None", "Small", "Medium", "Large", "ExtraLarge". + :vartype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize + :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. + Note: training run may get into CUDA OOM if no sufficient GPU memory. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype multi_scale: bool + :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be a + float in the range [0, 1]. + :vartype nms_iou_threshold: float + :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not + be + None to enable small object detection logic. A string containing two integers in mxn format. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_grid_size: str + :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float + in the range [0, 1). + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_overlap_ratio: float + :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging + predictions from tiles and image. + Used in validation/ inference. Must be float in the range [0, 1]. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_predictions_nms_threshold: float + :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be + float in the range [0, 1]. + :vartype validation_iou_threshold: float + :ivar validation_metric_type: Metric computation method to use for validation metrics. Possible + values include: "None", "Coco", "Voc", "CocoVoc". + :vartype validation_metric_type: str or + ~azure.mgmt.machinelearningservices.models.ValidationMetricType + """ + + _attribute_map = { + "advanced_settings": {"key": "advancedSettings", "type": "str"}, + "ams_gradient": {"key": "amsGradient", "type": "bool"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "float"}, + "beta2": {"key": "beta2", "type": "float"}, + "checkpoint_frequency": {"key": "checkpointFrequency", "type": "int"}, + "checkpoint_model": { + "key": "checkpointModel", + "type": "MLFlowModelJobInput", + }, + "checkpoint_run_id": {"key": "checkpointRunId", "type": "str"}, + "distributed": {"key": "distributed", "type": "bool"}, + "early_stopping": {"key": "earlyStopping", "type": "bool"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "int"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "int", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "bool", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "int"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "int", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "int"}, + "learning_rate": {"key": "learningRate", "type": "float"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "float"}, + "nesterov": {"key": "nesterov", "type": "bool"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "int"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "int"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "int"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "float"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "int"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "float", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "int", + }, + "weight_decay": {"key": "weightDecay", "type": "float"}, + "box_detections_per_image": { + "key": "boxDetectionsPerImage", + "type": "int", + }, + "box_score_threshold": {"key": "boxScoreThreshold", "type": "float"}, + "image_size": {"key": "imageSize", "type": "int"}, + "max_size": {"key": "maxSize", "type": "int"}, + "min_size": {"key": "minSize", "type": "int"}, + "model_size": {"key": "modelSize", "type": "str"}, + "multi_scale": {"key": "multiScale", "type": "bool"}, + "nms_iou_threshold": {"key": "nmsIouThreshold", "type": "float"}, + "tile_grid_size": {"key": "tileGridSize", "type": "str"}, + "tile_overlap_ratio": {"key": "tileOverlapRatio", "type": "float"}, + "tile_predictions_nms_threshold": { + "key": "tilePredictionsNmsThreshold", + "type": "float", + }, + "validation_iou_threshold": { + "key": "validationIouThreshold", + "type": "float", + }, + "validation_metric_type": { + "key": "validationMetricType", + "type": "str", + }, + } + + def __init__(self, **kwargs): """ :keyword advanced_settings: Settings for advanced scenarios. :paramtype advanced_settings: str @@ -12955,88 +13246,108 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ValidationMetricType """ super(ImageModelSettingsObjectDetection, self).__init__(**kwargs) - self.box_detections_per_image = kwargs.get('box_detections_per_image', None) - self.box_score_threshold = kwargs.get('box_score_threshold', None) - self.image_size = kwargs.get('image_size', None) - self.max_size = kwargs.get('max_size', None) - self.min_size = kwargs.get('min_size', None) - self.model_size = kwargs.get('model_size', None) - self.multi_scale = kwargs.get('multi_scale', None) - self.nms_iou_threshold = kwargs.get('nms_iou_threshold', None) - self.tile_grid_size = kwargs.get('tile_grid_size', None) - self.tile_overlap_ratio = kwargs.get('tile_overlap_ratio', None) - self.tile_predictions_nms_threshold = kwargs.get('tile_predictions_nms_threshold', None) - self.validation_iou_threshold = kwargs.get('validation_iou_threshold', None) - self.validation_metric_type = kwargs.get('validation_metric_type', None) + self.box_detections_per_image = kwargs.get( + "box_detections_per_image", None + ) + self.box_score_threshold = kwargs.get("box_score_threshold", None) + self.image_size = kwargs.get("image_size", None) + self.max_size = kwargs.get("max_size", None) + self.min_size = kwargs.get("min_size", None) + self.model_size = kwargs.get("model_size", None) + self.multi_scale = kwargs.get("multi_scale", None) + self.nms_iou_threshold = kwargs.get("nms_iou_threshold", None) + self.tile_grid_size = kwargs.get("tile_grid_size", None) + self.tile_overlap_ratio = kwargs.get("tile_overlap_ratio", None) + self.tile_predictions_nms_threshold = kwargs.get( + "tile_predictions_nms_threshold", None + ) + self.validation_iou_threshold = kwargs.get( + "validation_iou_threshold", None + ) + self.validation_metric_type = kwargs.get( + "validation_metric_type", None + ) class ImageObjectDetection(AutoMLVertical, ImageObjectDetectionBase): """Image Object Detection. Object detection is used to identify objects in an image and locate each object with a -bounding box e.g. locate all dogs and cats in an image and draw a bounding box around each. + bounding box e.g. locate all dogs and cats in an image and draw a bounding box around each. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "MeanAveragePrecision". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics """ _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, + "limit_settings": {"required": True}, + "task_type": {"required": True}, + "training_data": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsObjectDetection", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsObjectDetection]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings @@ -13070,17 +13381,17 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics """ super(ImageObjectDetection, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageObjectDetection' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.limit_settings = kwargs["limit_settings"] + self.sweep_settings = kwargs.get("sweep_settings", None) + self.validation_data = kwargs.get("validation_data", None) + self.validation_data_size = kwargs.get("validation_data_size", None) + self.model_settings = kwargs.get("model_settings", None) + self.search_space = kwargs.get("search_space", None) + self.task_type = "ImageObjectDetection" # type: str + self.primary_metric = kwargs.get("primary_metric", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class ImageSweepSettings(msrest.serialization.Model): @@ -13097,18 +13408,18 @@ class ImageSweepSettings(msrest.serialization.Model): """ _validation = { - 'sampling_algorithm': {'required': True}, + "sampling_algorithm": {"required": True}, } _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, + "sampling_algorithm": {"key": "samplingAlgorithm", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword early_termination: Type of early termination policy. :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy @@ -13118,8 +13429,8 @@ def __init__( ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType """ super(ImageSweepSettings, self).__init__(**kwargs) - self.early_termination = kwargs.get('early_termination', None) - self.sampling_algorithm = kwargs['sampling_algorithm'] + self.early_termination = kwargs.get("early_termination", None) + self.sampling_algorithm = kwargs["sampling_algorithm"] class InferenceContainerProperties(msrest.serialization.Model): @@ -13135,15 +13446,12 @@ class InferenceContainerProperties(msrest.serialization.Model): """ _attribute_map = { - 'liveness_route': {'key': 'livenessRoute', 'type': 'Route'}, - 'readiness_route': {'key': 'readinessRoute', 'type': 'Route'}, - 'scoring_route': {'key': 'scoringRoute', 'type': 'Route'}, + "liveness_route": {"key": "livenessRoute", "type": "Route"}, + "readiness_route": {"key": "readinessRoute", "type": "Route"}, + "scoring_route": {"key": "scoringRoute", "type": "Route"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword liveness_route: The route to check the liveness of the inference server container. :paramtype liveness_route: ~azure.mgmt.machinelearningservices.models.Route @@ -13154,9 +13462,9 @@ def __init__( :paramtype scoring_route: ~azure.mgmt.machinelearningservices.models.Route """ super(InferenceContainerProperties, self).__init__(**kwargs) - self.liveness_route = kwargs.get('liveness_route', None) - self.readiness_route = kwargs.get('readiness_route', None) - self.scoring_route = kwargs.get('scoring_route', None) + self.liveness_route = kwargs.get("liveness_route", None) + self.readiness_route = kwargs.get("readiness_route", None) + self.scoring_route = kwargs.get("scoring_route", None) class InstanceTypeSchema(msrest.serialization.Model): @@ -13169,14 +13477,14 @@ class InstanceTypeSchema(msrest.serialization.Model): """ _attribute_map = { - 'node_selector': {'key': 'nodeSelector', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'InstanceTypeSchemaResources'}, + "node_selector": {"key": "nodeSelector", "type": "{str}"}, + "resources": { + "key": "resources", + "type": "InstanceTypeSchemaResources", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword node_selector: Node Selector. :paramtype node_selector: dict[str, str] @@ -13184,8 +13492,8 @@ def __init__( :paramtype resources: ~azure.mgmt.machinelearningservices.models.InstanceTypeSchemaResources """ super(InstanceTypeSchema, self).__init__(**kwargs) - self.node_selector = kwargs.get('node_selector', None) - self.resources = kwargs.get('resources', None) + self.node_selector = kwargs.get("node_selector", None) + self.resources = kwargs.get("resources", None) class InstanceTypeSchemaResources(msrest.serialization.Model): @@ -13198,14 +13506,11 @@ class InstanceTypeSchemaResources(msrest.serialization.Model): """ _attribute_map = { - 'requests': {'key': 'requests', 'type': '{str}'}, - 'limits': {'key': 'limits', 'type': '{str}'}, + "requests": {"key": "requests", "type": "{str}"}, + "limits": {"key": "limits", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword requests: Resource requests for this instance type. :paramtype requests: dict[str, str] @@ -13213,8 +13518,8 @@ def __init__( :paramtype limits: dict[str, str] """ super(InstanceTypeSchemaResources, self).__init__(**kwargs) - self.requests = kwargs.get('requests', None) - self.limits = kwargs.get('limits', None) + self.requests = kwargs.get("requests", None) + self.limits = kwargs.get("limits", None) class JobBase(Resource): @@ -13240,31 +13545,28 @@ class JobBase(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'JobBaseProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "JobBaseProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.JobBaseProperties """ super(JobBase, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class JobBaseResourceArmPaginatedResult(msrest.serialization.Model): @@ -13278,14 +13580,11 @@ class JobBaseResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[JobBase]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[JobBase]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of JobBase objects. If null, there are no additional pages. @@ -13294,8 +13593,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.JobBase] """ super(JobBaseResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class JobResourceConfiguration(ResourceConfiguration): @@ -13318,21 +13617,18 @@ class JobResourceConfiguration(ResourceConfiguration): """ _validation = { - 'shm_size': {'pattern': r'\d+[bBkKmMgG]'}, + "shm_size": {"pattern": r"\d+[bBkKmMgG]"}, } _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - 'docker_args': {'key': 'dockerArgs', 'type': 'str'}, - 'shm_size': {'key': 'shmSize', 'type': 'str'}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "properties": {"key": "properties", "type": "{object}"}, + "docker_args": {"key": "dockerArgs", "type": "str"}, + "shm_size": {"key": "shmSize", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword instance_count: Optional number of instances or nodes used by the compute target. :paramtype instance_count: int @@ -13350,8 +13646,8 @@ def __init__( :paramtype shm_size: str """ super(JobResourceConfiguration, self).__init__(**kwargs) - self.docker_args = kwargs.get('docker_args', None) - self.shm_size = kwargs.get('shm_size', "2g") + self.docker_args = kwargs.get("docker_args", None) + self.shm_size = kwargs.get("shm_size", "2g") class JobScheduleAction(ScheduleActionBase): @@ -13367,26 +13663,26 @@ class JobScheduleAction(ScheduleActionBase): """ _validation = { - 'action_type': {'required': True}, - 'job_definition': {'required': True}, + "action_type": {"required": True}, + "job_definition": {"required": True}, } _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'job_definition': {'key': 'jobDefinition', 'type': 'JobBaseProperties'}, + "action_type": {"key": "actionType", "type": "str"}, + "job_definition": { + "key": "jobDefinition", + "type": "JobBaseProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword job_definition: Required. [Required] Defines Schedule action definition details. :paramtype job_definition: ~azure.mgmt.machinelearningservices.models.JobBaseProperties """ super(JobScheduleAction, self).__init__(**kwargs) - self.action_type = 'CreateJob' # type: str - self.job_definition = kwargs['job_definition'] + self.action_type = "CreateJob" # type: str + self.job_definition = kwargs["job_definition"] class JobService(msrest.serialization.Model): @@ -13412,24 +13708,21 @@ class JobService(msrest.serialization.Model): """ _validation = { - 'error_message': {'readonly': True}, - 'status': {'readonly': True}, + "error_message": {"readonly": True}, + "status": {"readonly": True}, } _attribute_map = { - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'job_service_type': {'key': 'jobServiceType', 'type': 'str'}, - 'nodes': {'key': 'nodes', 'type': 'Nodes'}, - 'port': {'key': 'port', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'status': {'key': 'status', 'type': 'str'}, + "endpoint": {"key": "endpoint", "type": "str"}, + "error_message": {"key": "errorMessage", "type": "str"}, + "job_service_type": {"key": "jobServiceType", "type": "str"}, + "nodes": {"key": "nodes", "type": "Nodes"}, + "port": {"key": "port", "type": "int"}, + "properties": {"key": "properties", "type": "{str}"}, + "status": {"key": "status", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword endpoint: Url for endpoint. :paramtype endpoint: str @@ -13444,12 +13737,12 @@ def __init__( :paramtype properties: dict[str, str] """ super(JobService, self).__init__(**kwargs) - self.endpoint = kwargs.get('endpoint', None) + self.endpoint = kwargs.get("endpoint", None) self.error_message = None - self.job_service_type = kwargs.get('job_service_type', None) - self.nodes = kwargs.get('nodes', None) - self.port = kwargs.get('port', None) - self.properties = kwargs.get('properties', None) + self.job_service_type = kwargs.get("job_service_type", None) + self.nodes = kwargs.get("nodes", None) + self.port = kwargs.get("port", None) + self.properties = kwargs.get("properties", None) self.status = None @@ -13468,21 +13761,18 @@ class KerberosCredentials(msrest.serialization.Model): """ _validation = { - 'kerberos_kdc_address': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "kerberos_kdc_address": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "kerberos_principal": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "kerberos_realm": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, + "kerberos_kdc_address": {"key": "kerberosKdcAddress", "type": "str"}, + "kerberos_principal": {"key": "kerberosPrincipal", "type": "str"}, + "kerberos_realm": {"key": "kerberosRealm", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. :paramtype kerberos_kdc_address: str @@ -13493,9 +13783,9 @@ def __init__( :paramtype kerberos_realm: str """ super(KerberosCredentials, self).__init__(**kwargs) - self.kerberos_kdc_address = kwargs['kerberos_kdc_address'] - self.kerberos_principal = kwargs['kerberos_principal'] - self.kerberos_realm = kwargs['kerberos_realm'] + self.kerberos_kdc_address = kwargs["kerberos_kdc_address"] + self.kerberos_principal = kwargs["kerberos_principal"] + self.kerberos_realm = kwargs["kerberos_realm"] class KerberosKeytabCredentials(DatastoreCredentials, KerberosCredentials): @@ -13519,25 +13809,22 @@ class KerberosKeytabCredentials(DatastoreCredentials, KerberosCredentials): """ _validation = { - 'kerberos_kdc_address': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, + "kerberos_kdc_address": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "kerberos_principal": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "kerberos_realm": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "credentials_type": {"required": True}, + "secrets": {"required": True}, } _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'KerberosKeytabSecrets'}, + "kerberos_kdc_address": {"key": "kerberosKdcAddress", "type": "str"}, + "kerberos_principal": {"key": "kerberosPrincipal", "type": "str"}, + "kerberos_realm": {"key": "kerberosRealm", "type": "str"}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "secrets": {"key": "secrets", "type": "KerberosKeytabSecrets"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. :paramtype kerberos_kdc_address: str @@ -13550,11 +13837,11 @@ def __init__( :paramtype secrets: ~azure.mgmt.machinelearningservices.models.KerberosKeytabSecrets """ super(KerberosKeytabCredentials, self).__init__(**kwargs) - self.kerberos_kdc_address = kwargs['kerberos_kdc_address'] - self.kerberos_principal = kwargs['kerberos_principal'] - self.kerberos_realm = kwargs['kerberos_realm'] - self.credentials_type = 'KerberosKeytab' # type: str - self.secrets = kwargs['secrets'] + self.kerberos_kdc_address = kwargs["kerberos_kdc_address"] + self.kerberos_principal = kwargs["kerberos_principal"] + self.kerberos_realm = kwargs["kerberos_realm"] + self.credentials_type = "KerberosKeytab" # type: str + self.secrets = kwargs["secrets"] class KerberosKeytabSecrets(DatastoreSecrets): @@ -13571,25 +13858,22 @@ class KerberosKeytabSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'kerberos_keytab': {'key': 'kerberosKeytab', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "kerberos_keytab": {"key": "kerberosKeytab", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword kerberos_keytab: Kerberos keytab secret. :paramtype kerberos_keytab: str """ super(KerberosKeytabSecrets, self).__init__(**kwargs) - self.secrets_type = 'KerberosKeytab' # type: str - self.kerberos_keytab = kwargs.get('kerberos_keytab', None) + self.secrets_type = "KerberosKeytab" # type: str + self.kerberos_keytab = kwargs.get("kerberos_keytab", None) class KerberosPasswordCredentials(DatastoreCredentials, KerberosCredentials): @@ -13613,25 +13897,22 @@ class KerberosPasswordCredentials(DatastoreCredentials, KerberosCredentials): """ _validation = { - 'kerberos_kdc_address': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, + "kerberos_kdc_address": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "kerberos_principal": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "kerberos_realm": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "credentials_type": {"required": True}, + "secrets": {"required": True}, } _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'KerberosPasswordSecrets'}, + "kerberos_kdc_address": {"key": "kerberosKdcAddress", "type": "str"}, + "kerberos_principal": {"key": "kerberosPrincipal", "type": "str"}, + "kerberos_realm": {"key": "kerberosRealm", "type": "str"}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "secrets": {"key": "secrets", "type": "KerberosPasswordSecrets"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. :paramtype kerberos_kdc_address: str @@ -13644,11 +13925,11 @@ def __init__( :paramtype secrets: ~azure.mgmt.machinelearningservices.models.KerberosPasswordSecrets """ super(KerberosPasswordCredentials, self).__init__(**kwargs) - self.kerberos_kdc_address = kwargs['kerberos_kdc_address'] - self.kerberos_principal = kwargs['kerberos_principal'] - self.kerberos_realm = kwargs['kerberos_realm'] - self.credentials_type = 'KerberosPassword' # type: str - self.secrets = kwargs['secrets'] + self.kerberos_kdc_address = kwargs["kerberos_kdc_address"] + self.kerberos_principal = kwargs["kerberos_principal"] + self.kerberos_realm = kwargs["kerberos_realm"] + self.credentials_type = "KerberosPassword" # type: str + self.secrets = kwargs["secrets"] class KerberosPasswordSecrets(DatastoreSecrets): @@ -13665,25 +13946,22 @@ class KerberosPasswordSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'kerberos_password': {'key': 'kerberosPassword', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "kerberos_password": {"key": "kerberosPassword", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword kerberos_password: Kerberos password secret. :paramtype kerberos_password: str """ super(KerberosPasswordSecrets, self).__init__(**kwargs) - self.secrets_type = 'KerberosPassword' # type: str - self.kerberos_password = kwargs.get('kerberos_password', None) + self.secrets_type = "KerberosPassword" # type: str + self.kerberos_password = kwargs.get("kerberos_password", None) class KubernetesSchema(msrest.serialization.Model): @@ -13694,19 +13972,16 @@ class KubernetesSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, + "properties": {"key": "properties", "type": "KubernetesProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of Kubernetes. :paramtype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties """ super(KubernetesSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class Kubernetes(Compute, KubernetesSchema): @@ -13748,32 +14023,32 @@ class Kubernetes(Compute, KubernetesSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "KubernetesProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of Kubernetes. :paramtype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties @@ -13788,17 +14063,17 @@ def __init__( :paramtype disable_local_auth: bool """ super(Kubernetes, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'Kubernetes' # type: str - self.compute_location = kwargs.get('compute_location', None) + self.properties = kwargs.get("properties", None) + self.compute_type = "Kubernetes" # type: str + self.compute_location = kwargs.get("compute_location", None) self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) + self.disable_local_auth = kwargs.get("disable_local_auth", None) class OnlineDeploymentProperties(EndpointDeploymentPropertiesBase): @@ -13858,37 +14133,52 @@ class OnlineDeploymentProperties(EndpointDeploymentPropertiesBase): """ _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, + "endpoint_compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, + "egress_public_network_access": { + "key": "egressPublicNetworkAccess", + "type": "str", + }, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, + "model": {"key": "model", "type": "str"}, + "model_mount_path": {"key": "modelMountPath", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, } _subtype_map = { - 'endpoint_compute_type': {'Kubernetes': 'KubernetesOnlineDeployment', 'Managed': 'ManagedOnlineDeployment'} + "endpoint_compute_type": { + "Kubernetes": "KubernetesOnlineDeployment", + "Managed": "ManagedOnlineDeployment", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword code_configuration: Code configuration for the endpoint deployment. :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration @@ -13928,17 +14218,19 @@ def __init__( :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings """ super(OnlineDeploymentProperties, self).__init__(**kwargs) - self.app_insights_enabled = kwargs.get('app_insights_enabled', False) - self.egress_public_network_access = kwargs.get('egress_public_network_access', None) - self.endpoint_compute_type = 'OnlineDeploymentProperties' # type: str - self.instance_type = kwargs.get('instance_type', None) - self.liveness_probe = kwargs.get('liveness_probe', None) - self.model = kwargs.get('model', None) - self.model_mount_path = kwargs.get('model_mount_path', None) + self.app_insights_enabled = kwargs.get("app_insights_enabled", False) + self.egress_public_network_access = kwargs.get( + "egress_public_network_access", None + ) + self.endpoint_compute_type = "OnlineDeploymentProperties" # type: str + self.instance_type = kwargs.get("instance_type", None) + self.liveness_probe = kwargs.get("liveness_probe", None) + self.model = kwargs.get("model", None) + self.model_mount_path = kwargs.get("model_mount_path", None) self.provisioning_state = None - self.readiness_probe = kwargs.get('readiness_probe', None) - self.request_settings = kwargs.get('request_settings', None) - self.scale_settings = kwargs.get('scale_settings', None) + self.readiness_probe = kwargs.get("readiness_probe", None) + self.request_settings = kwargs.get("request_settings", None) + self.scale_settings = kwargs.get("scale_settings", None) class KubernetesOnlineDeployment(OnlineDeploymentProperties): @@ -13999,34 +14291,49 @@ class KubernetesOnlineDeployment(OnlineDeploymentProperties): """ _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - 'container_resource_requirements': {'key': 'containerResourceRequirements', 'type': 'ContainerResourceRequirements'}, - } - - def __init__( - self, - **kwargs - ): + "endpoint_compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, + "egress_public_network_access": { + "key": "egressPublicNetworkAccess", + "type": "str", + }, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, + "model": {"key": "model", "type": "str"}, + "model_mount_path": {"key": "modelMountPath", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, + "container_resource_requirements": { + "key": "containerResourceRequirements", + "type": "ContainerResourceRequirements", + }, + } + + def __init__(self, **kwargs): """ :keyword code_configuration: Code configuration for the endpoint deployment. :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration @@ -14070,8 +14377,10 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ContainerResourceRequirements """ super(KubernetesOnlineDeployment, self).__init__(**kwargs) - self.endpoint_compute_type = 'Kubernetes' # type: str - self.container_resource_requirements = kwargs.get('container_resource_requirements', None) + self.endpoint_compute_type = "Kubernetes" # type: str + self.container_resource_requirements = kwargs.get( + "container_resource_requirements", None + ) class KubernetesProperties(msrest.serialization.Model): @@ -14097,20 +14406,32 @@ class KubernetesProperties(msrest.serialization.Model): """ _attribute_map = { - 'relay_connection_string': {'key': 'relayConnectionString', 'type': 'str'}, - 'service_bus_connection_string': {'key': 'serviceBusConnectionString', 'type': 'str'}, - 'extension_principal_id': {'key': 'extensionPrincipalId', 'type': 'str'}, - 'extension_instance_release_train': {'key': 'extensionInstanceReleaseTrain', 'type': 'str'}, - 'vc_name': {'key': 'vcName', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'default_instance_type': {'key': 'defaultInstanceType', 'type': 'str'}, - 'instance_types': {'key': 'instanceTypes', 'type': '{InstanceTypeSchema}'}, - } - - def __init__( - self, - **kwargs - ): + "relay_connection_string": { + "key": "relayConnectionString", + "type": "str", + }, + "service_bus_connection_string": { + "key": "serviceBusConnectionString", + "type": "str", + }, + "extension_principal_id": { + "key": "extensionPrincipalId", + "type": "str", + }, + "extension_instance_release_train": { + "key": "extensionInstanceReleaseTrain", + "type": "str", + }, + "vc_name": {"key": "vcName", "type": "str"}, + "namespace": {"key": "namespace", "type": "str"}, + "default_instance_type": {"key": "defaultInstanceType", "type": "str"}, + "instance_types": { + "key": "instanceTypes", + "type": "{InstanceTypeSchema}", + }, + } + + def __init__(self, **kwargs): """ :keyword relay_connection_string: Relay connection string. :paramtype relay_connection_string: str @@ -14131,14 +14452,22 @@ def __init__( ~azure.mgmt.machinelearningservices.models.InstanceTypeSchema] """ super(KubernetesProperties, self).__init__(**kwargs) - self.relay_connection_string = kwargs.get('relay_connection_string', None) - self.service_bus_connection_string = kwargs.get('service_bus_connection_string', None) - self.extension_principal_id = kwargs.get('extension_principal_id', None) - self.extension_instance_release_train = kwargs.get('extension_instance_release_train', None) - self.vc_name = kwargs.get('vc_name', None) - self.namespace = kwargs.get('namespace', "default") - self.default_instance_type = kwargs.get('default_instance_type', None) - self.instance_types = kwargs.get('instance_types', None) + self.relay_connection_string = kwargs.get( + "relay_connection_string", None + ) + self.service_bus_connection_string = kwargs.get( + "service_bus_connection_string", None + ) + self.extension_principal_id = kwargs.get( + "extension_principal_id", None + ) + self.extension_instance_release_train = kwargs.get( + "extension_instance_release_train", None + ) + self.vc_name = kwargs.get("vc_name", None) + self.namespace = kwargs.get("namespace", "default") + self.default_instance_type = kwargs.get("default_instance_type", None) + self.instance_types = kwargs.get("instance_types", None) class LabelCategory(msrest.serialization.Model): @@ -14154,15 +14483,12 @@ class LabelCategory(msrest.serialization.Model): """ _attribute_map = { - 'classes': {'key': 'classes', 'type': '{LabelClass}'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'multi_select': {'key': 'multiSelect', 'type': 'str'}, + "classes": {"key": "classes", "type": "{LabelClass}"}, + "display_name": {"key": "displayName", "type": "str"}, + "multi_select": {"key": "multiSelect", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword classes: Dictionary of label classes in this category. :paramtype classes: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] @@ -14173,9 +14499,9 @@ def __init__( :paramtype multi_select: str or ~azure.mgmt.machinelearningservices.models.MultiSelect """ super(LabelCategory, self).__init__(**kwargs) - self.classes = kwargs.get('classes', None) - self.display_name = kwargs.get('display_name', None) - self.multi_select = kwargs.get('multi_select', None) + self.classes = kwargs.get("classes", None) + self.display_name = kwargs.get("display_name", None) + self.multi_select = kwargs.get("multi_select", None) class LabelClass(msrest.serialization.Model): @@ -14188,14 +14514,11 @@ class LabelClass(msrest.serialization.Model): """ _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'subclasses': {'key': 'subclasses', 'type': '{LabelClass}'}, + "display_name": {"key": "displayName", "type": "str"}, + "subclasses": {"key": "subclasses", "type": "{LabelClass}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword display_name: Display name of the label class. :paramtype display_name: str @@ -14203,8 +14526,8 @@ def __init__( :paramtype subclasses: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] """ super(LabelClass, self).__init__(**kwargs) - self.display_name = kwargs.get('display_name', None) - self.subclasses = kwargs.get('subclasses', None) + self.display_name = kwargs.get("display_name", None) + self.subclasses = kwargs.get("subclasses", None) class LabelingDataConfiguration(msrest.serialization.Model): @@ -14219,14 +14542,14 @@ class LabelingDataConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'data_id': {'key': 'dataId', 'type': 'str'}, - 'incremental_data_refresh': {'key': 'incrementalDataRefresh', 'type': 'str'}, + "data_id": {"key": "dataId", "type": "str"}, + "incremental_data_refresh": { + "key": "incrementalDataRefresh", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data_id: Resource Id of the data asset to perform labeling. :paramtype data_id: str @@ -14236,8 +14559,10 @@ def __init__( ~azure.mgmt.machinelearningservices.models.IncrementalDataRefresh """ super(LabelingDataConfiguration, self).__init__(**kwargs) - self.data_id = kwargs.get('data_id', None) - self.incremental_data_refresh = kwargs.get('incremental_data_refresh', None) + self.data_id = kwargs.get("data_id", None) + self.incremental_data_refresh = kwargs.get( + "incremental_data_refresh", None + ) class LabelingJob(Resource): @@ -14263,31 +14588,28 @@ class LabelingJob(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'LabelingJobProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "LabelingJobProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.LabelingJobProperties """ super(LabelingJob, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class LabelingJobMediaProperties(msrest.serialization.Model): @@ -14304,23 +14626,22 @@ class LabelingJobMediaProperties(msrest.serialization.Model): """ _validation = { - 'media_type': {'required': True}, + "media_type": {"required": True}, } _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, + "media_type": {"key": "mediaType", "type": "str"}, } _subtype_map = { - 'media_type': {'Image': 'LabelingJobImageProperties', 'Text': 'LabelingJobTextProperties'} + "media_type": { + "Image": "LabelingJobImageProperties", + "Text": "LabelingJobTextProperties", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(LabelingJobMediaProperties, self).__init__(**kwargs) self.media_type = None # type: Optional[str] @@ -14339,18 +14660,15 @@ class LabelingJobImageProperties(LabelingJobMediaProperties): """ _validation = { - 'media_type': {'required': True}, + "media_type": {"required": True}, } _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - 'annotation_type': {'key': 'annotationType', 'type': 'str'}, + "media_type": {"key": "mediaType", "type": "str"}, + "annotation_type": {"key": "annotationType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword annotation_type: Annotation type of image labeling job. Possible values include: "Classification", "BoundingBox", "InstanceSegmentation". @@ -14358,8 +14676,8 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ImageAnnotationType """ super(LabelingJobImageProperties, self).__init__(**kwargs) - self.media_type = 'Image' # type: str - self.annotation_type = kwargs.get('annotation_type', None) + self.media_type = "Image" # type: str + self.annotation_type = kwargs.get("annotation_type", None) class LabelingJobInstructions(msrest.serialization.Model): @@ -14370,19 +14688,16 @@ class LabelingJobInstructions(msrest.serialization.Model): """ _attribute_map = { - 'uri': {'key': 'uri', 'type': 'str'}, + "uri": {"key": "uri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword uri: The link to a page with detailed labeling instructions for labelers. :paramtype uri: str """ super(LabelingJobInstructions, self).__init__(**kwargs) - self.uri = kwargs.get('uri', None) + self.uri = kwargs.get("uri", None) class LabelingJobProperties(JobBaseProperties): @@ -14451,44 +14766,62 @@ class LabelingJobProperties(JobBaseProperties): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'created_date_time': {'readonly': True}, - 'progress_metrics': {'readonly': True}, - 'project_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'status_messages': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'data_configuration': {'key': 'dataConfiguration', 'type': 'LabelingDataConfiguration'}, - 'job_instructions': {'key': 'jobInstructions', 'type': 'LabelingJobInstructions'}, - 'label_categories': {'key': 'labelCategories', 'type': '{LabelCategory}'}, - 'labeling_job_media_properties': {'key': 'labelingJobMediaProperties', 'type': 'LabelingJobMediaProperties'}, - 'ml_assist_configuration': {'key': 'mlAssistConfiguration', 'type': 'MLAssistConfiguration'}, - 'progress_metrics': {'key': 'progressMetrics', 'type': 'ProgressMetrics'}, - 'project_id': {'key': 'projectId', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'status_messages': {'key': 'statusMessages', 'type': '[StatusMessage]'}, - } - - def __init__( - self, - **kwargs - ): + "job_type": {"required": True}, + "status": {"readonly": True}, + "created_date_time": {"readonly": True}, + "progress_metrics": {"readonly": True}, + "project_id": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "status_messages": {"readonly": True}, + } + + _attribute_map = { + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "created_date_time": {"key": "createdDateTime", "type": "iso-8601"}, + "data_configuration": { + "key": "dataConfiguration", + "type": "LabelingDataConfiguration", + }, + "job_instructions": { + "key": "jobInstructions", + "type": "LabelingJobInstructions", + }, + "label_categories": { + "key": "labelCategories", + "type": "{LabelCategory}", + }, + "labeling_job_media_properties": { + "key": "labelingJobMediaProperties", + "type": "LabelingJobMediaProperties", + }, + "ml_assist_configuration": { + "key": "mlAssistConfiguration", + "type": "MLAssistConfiguration", + }, + "progress_metrics": { + "key": "progressMetrics", + "type": "ProgressMetrics", + }, + "project_id": {"key": "projectId", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "status_messages": { + "key": "statusMessages", + "type": "[StatusMessage]", + }, + } + + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -14530,13 +14863,17 @@ def __init__( ~azure.mgmt.machinelearningservices.models.MLAssistConfiguration """ super(LabelingJobProperties, self).__init__(**kwargs) - self.job_type = 'Labeling' # type: str + self.job_type = "Labeling" # type: str self.created_date_time = None - self.data_configuration = kwargs.get('data_configuration', None) - self.job_instructions = kwargs.get('job_instructions', None) - self.label_categories = kwargs.get('label_categories', None) - self.labeling_job_media_properties = kwargs.get('labeling_job_media_properties', None) - self.ml_assist_configuration = kwargs.get('ml_assist_configuration', None) + self.data_configuration = kwargs.get("data_configuration", None) + self.job_instructions = kwargs.get("job_instructions", None) + self.label_categories = kwargs.get("label_categories", None) + self.labeling_job_media_properties = kwargs.get( + "labeling_job_media_properties", None + ) + self.ml_assist_configuration = kwargs.get( + "ml_assist_configuration", None + ) self.progress_metrics = None self.project_id = None self.provisioning_state = None @@ -14554,14 +14891,11 @@ class LabelingJobResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[LabelingJob]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[LabelingJob]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of LabelingJob objects. If null, there are no additional pages. @@ -14570,8 +14904,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.LabelingJob] """ super(LabelingJobResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class LabelingJobTextProperties(LabelingJobMediaProperties): @@ -14588,18 +14922,15 @@ class LabelingJobTextProperties(LabelingJobMediaProperties): """ _validation = { - 'media_type': {'required': True}, + "media_type": {"required": True}, } _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - 'annotation_type': {'key': 'annotationType', 'type': 'str'}, + "media_type": {"key": "mediaType", "type": "str"}, + "annotation_type": {"key": "annotationType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword annotation_type: Annotation type of text labeling job. Possible values include: "Classification", "NamedEntityRecognition". @@ -14607,8 +14938,8 @@ def __init__( ~azure.mgmt.machinelearningservices.models.TextAnnotationType """ super(LabelingJobTextProperties, self).__init__(**kwargs) - self.media_type = 'Text' # type: str - self.annotation_type = kwargs.get('annotation_type', None) + self.media_type = "Text" # type: str + self.annotation_type = kwargs.get("annotation_type", None) class ListAmlUserFeatureResult(msrest.serialization.Model): @@ -14624,21 +14955,17 @@ class ListAmlUserFeatureResult(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlUserFeature]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[AmlUserFeature]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListAmlUserFeatureResult, self).__init__(**kwargs) self.value = None self.next_link = None @@ -14656,21 +14983,17 @@ class ListNotebookKeysResult(msrest.serialization.Model): """ _validation = { - 'primary_access_key': {'readonly': True}, - 'secondary_access_key': {'readonly': True}, + "primary_access_key": {"readonly": True}, + "secondary_access_key": {"readonly": True}, } _attribute_map = { - 'primary_access_key': {'key': 'primaryAccessKey', 'type': 'str'}, - 'secondary_access_key': {'key': 'secondaryAccessKey', 'type': 'str'}, + "primary_access_key": {"key": "primaryAccessKey", "type": "str"}, + "secondary_access_key": {"key": "secondaryAccessKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListNotebookKeysResult, self).__init__(**kwargs) self.primary_access_key = None self.secondary_access_key = None @@ -14686,19 +15009,15 @@ class ListStorageAccountKeysResult(msrest.serialization.Model): """ _validation = { - 'user_storage_key': {'readonly': True}, + "user_storage_key": {"readonly": True}, } _attribute_map = { - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, + "user_storage_key": {"key": "userStorageKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListStorageAccountKeysResult, self).__init__(**kwargs) self.user_storage_key = None @@ -14716,21 +15035,17 @@ class ListUsagesResult(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[Usage]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Usage]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListUsagesResult, self).__init__(**kwargs) self.value = None self.next_link = None @@ -14756,27 +15071,35 @@ class ListWorkspaceKeysResult(msrest.serialization.Model): """ _validation = { - 'user_storage_key': {'readonly': True}, - 'user_storage_resource_id': {'readonly': True}, - 'app_insights_instrumentation_key': {'readonly': True}, - 'container_registry_credentials': {'readonly': True}, - 'notebook_access_keys': {'readonly': True}, + "user_storage_key": {"readonly": True}, + "user_storage_resource_id": {"readonly": True}, + "app_insights_instrumentation_key": {"readonly": True}, + "container_registry_credentials": {"readonly": True}, + "notebook_access_keys": {"readonly": True}, } _attribute_map = { - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, - 'user_storage_resource_id': {'key': 'userStorageResourceId', 'type': 'str'}, - 'app_insights_instrumentation_key': {'key': 'appInsightsInstrumentationKey', 'type': 'str'}, - 'container_registry_credentials': {'key': 'containerRegistryCredentials', 'type': 'RegistryListCredentialsResult'}, - 'notebook_access_keys': {'key': 'notebookAccessKeys', 'type': 'ListNotebookKeysResult'}, + "user_storage_key": {"key": "userStorageKey", "type": "str"}, + "user_storage_resource_id": { + "key": "userStorageResourceId", + "type": "str", + }, + "app_insights_instrumentation_key": { + "key": "appInsightsInstrumentationKey", + "type": "str", + }, + "container_registry_credentials": { + "key": "containerRegistryCredentials", + "type": "RegistryListCredentialsResult", + }, + "notebook_access_keys": { + "key": "notebookAccessKeys", + "type": "ListNotebookKeysResult", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListWorkspaceKeysResult, self).__init__(**kwargs) self.user_storage_key = None self.user_storage_resource_id = None @@ -14798,21 +15121,17 @@ class ListWorkspaceQuotas(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[ResourceQuota]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[ResourceQuota]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListWorkspaceQuotas, self).__init__(**kwargs) self.value = None self.next_link = None @@ -14834,20 +15153,17 @@ class LiteralJobInput(JobInput): """ _validation = { - 'job_input_type': {'required': True}, - 'value': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "job_input_type": {"required": True}, + "value": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, + "value": {"key": "value", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: Description for the input. :paramtype description: str @@ -14855,8 +15171,8 @@ def __init__( :paramtype value: str """ super(LiteralJobInput, self).__init__(**kwargs) - self.job_input_type = 'literal' # type: str - self.value = kwargs['value'] + self.job_input_type = "literal" # type: str + self.value = kwargs["value"] class ManagedIdentity(IdentityConfiguration): @@ -14880,20 +15196,17 @@ class ManagedIdentity(IdentityConfiguration): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + "object_id": {"key": "objectId", "type": "str"}, + "resource_id": {"key": "resourceId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword client_id: Specifies a user-assigned identity by client ID. For system-assigned, do not set this field. @@ -14906,13 +15219,15 @@ def __init__( :paramtype resource_id: str """ super(ManagedIdentity, self).__init__(**kwargs) - self.identity_type = 'Managed' # type: str - self.client_id = kwargs.get('client_id', None) - self.object_id = kwargs.get('object_id', None) - self.resource_id = kwargs.get('resource_id', None) + self.identity_type = "Managed" # type: str + self.client_id = kwargs.get("client_id", None) + self.object_id = kwargs.get("object_id", None) + self.resource_id = kwargs.get("resource_id", None) -class ManagedIdentityAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class ManagedIdentityAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """ManagedIdentityAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -14937,22 +15252,22 @@ class ManagedIdentityAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPr """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionManagedIdentity'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionManagedIdentity", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: Category of the connection. Possible values include: "PythonFeed", "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", @@ -14969,9 +15284,11 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity """ - super(ManagedIdentityAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'ManagedIdentity' # type: str - self.credentials = kwargs.get('credentials', None) + super( + ManagedIdentityAuthTypeWorkspaceConnectionProperties, self + ).__init__(**kwargs) + self.auth_type = "ManagedIdentity" # type: str + self.credentials = kwargs.get("credentials", None) class ManagedNetworkProvisionOptions(msrest.serialization.Model): @@ -14982,19 +15299,16 @@ class ManagedNetworkProvisionOptions(msrest.serialization.Model): """ _attribute_map = { - 'include_spark': {'key': 'includeSpark', 'type': 'bool'}, + "include_spark": {"key": "includeSpark", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword include_spark: :paramtype include_spark: bool """ super(ManagedNetworkProvisionOptions, self).__init__(**kwargs) - self.include_spark = kwargs.get('include_spark', None) + self.include_spark = kwargs.get("include_spark", None) class ManagedNetworkProvisionStatus(msrest.serialization.Model): @@ -15008,14 +15322,11 @@ class ManagedNetworkProvisionStatus(msrest.serialization.Model): """ _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'spark_ready': {'key': 'sparkReady', 'type': 'bool'}, + "status": {"key": "status", "type": "str"}, + "spark_ready": {"key": "sparkReady", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword status: Status for the managed network of a machine learning workspace. Possible values include: "Inactive", "Active". @@ -15024,8 +15335,8 @@ def __init__( :paramtype spark_ready: bool """ super(ManagedNetworkProvisionStatus, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.spark_ready = kwargs.get('spark_ready', None) + self.status = kwargs.get("status", None) + self.spark_ready = kwargs.get("spark_ready", None) class ManagedNetworkSettings(msrest.serialization.Model): @@ -15046,20 +15357,17 @@ class ManagedNetworkSettings(msrest.serialization.Model): """ _validation = { - 'network_id': {'readonly': True}, + "network_id": {"readonly": True}, } _attribute_map = { - 'isolation_mode': {'key': 'isolationMode', 'type': 'str'}, - 'network_id': {'key': 'networkId', 'type': 'str'}, - 'outbound_rules': {'key': 'outboundRules', 'type': '{OutboundRule}'}, - 'status': {'key': 'status', 'type': 'ManagedNetworkProvisionStatus'}, + "isolation_mode": {"key": "isolationMode", "type": "str"}, + "network_id": {"key": "networkId", "type": "str"}, + "outbound_rules": {"key": "outboundRules", "type": "{OutboundRule}"}, + "status": {"key": "status", "type": "ManagedNetworkProvisionStatus"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword isolation_mode: Isolation mode for the managed network of a machine learning workspace. Possible values include: "Disabled", "AllowInternetOutbound", @@ -15072,10 +15380,10 @@ def __init__( :paramtype status: ~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionStatus """ super(ManagedNetworkSettings, self).__init__(**kwargs) - self.isolation_mode = kwargs.get('isolation_mode', None) + self.isolation_mode = kwargs.get("isolation_mode", None) self.network_id = None - self.outbound_rules = kwargs.get('outbound_rules', None) - self.status = kwargs.get('status', None) + self.outbound_rules = kwargs.get("outbound_rules", None) + self.status = kwargs.get("status", None) class ManagedOnlineDeployment(OnlineDeploymentProperties): @@ -15132,33 +15440,45 @@ class ManagedOnlineDeployment(OnlineDeploymentProperties): """ _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - } - - def __init__( - self, - **kwargs - ): + "endpoint_compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, + "egress_public_network_access": { + "key": "egressPublicNetworkAccess", + "type": "str", + }, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, + "model": {"key": "model", "type": "str"}, + "model_mount_path": {"key": "modelMountPath", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, + } + + def __init__(self, **kwargs): """ :keyword code_configuration: Code configuration for the endpoint deployment. :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration @@ -15198,7 +15518,7 @@ def __init__( :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings """ super(ManagedOnlineDeployment, self).__init__(**kwargs) - self.endpoint_compute_type = 'Managed' # type: str + self.endpoint_compute_type = "Managed" # type: str class ManagedServiceIdentity(msrest.serialization.Model): @@ -15227,22 +15547,22 @@ class ManagedServiceIdentity(msrest.serialization.Model): """ _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, + "principal_id": {"readonly": True}, + "tenant_id": {"readonly": True}, + "type": {"required": True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{UserAssignedIdentity}", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword type: Required. Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", @@ -15258,8 +15578,10 @@ def __init__( super(ManagedServiceIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None - self.type = kwargs['type'] - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + self.type = kwargs["type"] + self.user_assigned_identities = kwargs.get( + "user_assigned_identities", None + ) class MedianStoppingPolicy(EarlyTerminationPolicy): @@ -15278,19 +15600,16 @@ class MedianStoppingPolicy(EarlyTerminationPolicy): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. :paramtype delay_evaluation: int @@ -15298,7 +15617,7 @@ def __init__( :paramtype evaluation_interval: int """ super(MedianStoppingPolicy, self).__init__(**kwargs) - self.policy_type = 'MedianStopping' # type: str + self.policy_type = "MedianStopping" # type: str class MLAssistConfiguration(msrest.serialization.Model): @@ -15315,23 +15634,22 @@ class MLAssistConfiguration(msrest.serialization.Model): """ _validation = { - 'ml_assist': {'required': True}, + "ml_assist": {"required": True}, } _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, + "ml_assist": {"key": "mlAssist", "type": "str"}, } _subtype_map = { - 'ml_assist': {'Disabled': 'MLAssistConfigurationDisabled', 'Enabled': 'MLAssistConfigurationEnabled'} + "ml_assist": { + "Disabled": "MLAssistConfigurationDisabled", + "Enabled": "MLAssistConfigurationEnabled", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(MLAssistConfiguration, self).__init__(**kwargs) self.ml_assist = None # type: Optional[str] @@ -15347,21 +15665,17 @@ class MLAssistConfigurationDisabled(MLAssistConfiguration): """ _validation = { - 'ml_assist': {'required': True}, + "ml_assist": {"required": True}, } _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, + "ml_assist": {"key": "mlAssist", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(MLAssistConfigurationDisabled, self).__init__(**kwargs) - self.ml_assist = 'Disabled' # type: str + self.ml_assist = "Disabled" # type: str class MLAssistConfigurationEnabled(MLAssistConfiguration): @@ -15380,21 +15694,30 @@ class MLAssistConfigurationEnabled(MLAssistConfiguration): """ _validation = { - 'ml_assist': {'required': True}, - 'inferencing_compute_binding': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'training_compute_binding': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "ml_assist": {"required": True}, + "inferencing_compute_binding": { + "required": True, + "pattern": r"[a-zA-Z0-9_]", + }, + "training_compute_binding": { + "required": True, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - 'inferencing_compute_binding': {'key': 'inferencingComputeBinding', 'type': 'str'}, - 'training_compute_binding': {'key': 'trainingComputeBinding', 'type': 'str'}, + "ml_assist": {"key": "mlAssist", "type": "str"}, + "inferencing_compute_binding": { + "key": "inferencingComputeBinding", + "type": "str", + }, + "training_compute_binding": { + "key": "trainingComputeBinding", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword inferencing_compute_binding: Required. [Required] AML compute binding used in inferencing. @@ -15403,9 +15726,11 @@ def __init__( :paramtype training_compute_binding: str """ super(MLAssistConfigurationEnabled, self).__init__(**kwargs) - self.ml_assist = 'Enabled' # type: str - self.inferencing_compute_binding = kwargs['inferencing_compute_binding'] - self.training_compute_binding = kwargs['training_compute_binding'] + self.ml_assist = "Enabled" # type: str + self.inferencing_compute_binding = kwargs[ + "inferencing_compute_binding" + ] + self.training_compute_binding = kwargs["training_compute_binding"] class MLFlowModelJobInput(JobInput, AssetJobInput): @@ -15427,21 +15752,18 @@ class MLFlowModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -15452,10 +15774,10 @@ def __init__( :paramtype description: str """ super(MLFlowModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'mlflow_model' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "mlflow_model" # type: str + self.description = kwargs.get("description", None) class MLFlowModelJobOutput(JobOutput, AssetJobOutput): @@ -15481,22 +15803,19 @@ class MLFlowModelJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "asset_name": {"key": "assetName", "type": "str"}, + "asset_version": {"key": "assetVersion", "type": "str"}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword asset_name: Output Asset Name. :paramtype asset_name: str @@ -15511,12 +15830,12 @@ def __init__( :paramtype description: str """ super(MLFlowModelJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.asset_version = kwargs.get('asset_version', None) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'mlflow_model' # type: str - self.description = kwargs.get('description', None) + self.asset_name = kwargs.get("asset_name", None) + self.asset_version = kwargs.get("asset_version", None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "mlflow_model" # type: str + self.description = kwargs.get("description", None) class MLTableData(DataVersionBaseProperties): @@ -15545,25 +15864,22 @@ class MLTableData(DataVersionBaseProperties): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'referenced_uris': {'key': 'referencedUris', 'type': '[str]'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, + "referenced_uris": {"key": "referencedUris", "type": "[str]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -15582,8 +15898,8 @@ def __init__( :paramtype referenced_uris: list[str] """ super(MLTableData, self).__init__(**kwargs) - self.data_type = 'mltable' # type: str - self.referenced_uris = kwargs.get('referenced_uris', None) + self.data_type = "mltable" # type: str + self.referenced_uris = kwargs.get("referenced_uris", None) class MLTableJobInput(JobInput, AssetJobInput): @@ -15605,21 +15921,18 @@ class MLTableJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -15630,10 +15943,10 @@ def __init__( :paramtype description: str """ super(MLTableJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'mltable' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "mltable" # type: str + self.description = kwargs.get("description", None) class MLTableJobOutput(JobOutput, AssetJobOutput): @@ -15659,22 +15972,19 @@ class MLTableJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "asset_name": {"key": "assetName", "type": "str"}, + "asset_version": {"key": "assetVersion", "type": "str"}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword asset_name: Output Asset Name. :paramtype asset_name: str @@ -15689,12 +15999,12 @@ def __init__( :paramtype description: str """ super(MLTableJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.asset_version = kwargs.get('asset_version', None) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'mltable' # type: str - self.description = kwargs.get('description', None) + self.asset_name = kwargs.get("asset_name", None) + self.asset_version = kwargs.get("asset_version", None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "mltable" # type: str + self.description = kwargs.get("description", None) class ModelContainer(Resource): @@ -15720,31 +16030,31 @@ class ModelContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "ModelContainerProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelContainerProperties """ super(ModelContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class ModelContainerProperties(AssetContainer): @@ -15771,25 +16081,22 @@ class ModelContainerProperties(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -15815,14 +16122,11 @@ class ModelContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ModelContainer]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of ModelContainer objects. If null, there are no additional pages. @@ -15830,9 +16134,11 @@ def __init__( :keyword value: An array of objects of type ModelContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelContainer] """ - super(ModelContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(ModelContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class ModelVersion(Resource): @@ -15858,31 +16164,28 @@ class ModelVersion(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelVersionProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "ModelVersionProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelVersionProperties """ super(ModelVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class ModelVersionProperties(AssetBase): @@ -15915,26 +16218,23 @@ class ModelVersionProperties(AssetBase): """ _validation = { - 'provisioning_state': {'readonly': True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'flavors': {'key': 'flavors', 'type': '{FlavorData}'}, - 'job_name': {'key': 'jobName', 'type': 'str'}, - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'model_uri': {'key': 'modelUri', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "flavors": {"key": "flavors", "type": "{FlavorData}"}, + "job_name": {"key": "jobName", "type": "str"}, + "model_type": {"key": "modelType", "type": "str"}, + "model_uri": {"key": "modelUri", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -15956,10 +16256,10 @@ def __init__( :paramtype model_uri: str """ super(ModelVersionProperties, self).__init__(**kwargs) - self.flavors = kwargs.get('flavors', None) - self.job_name = kwargs.get('job_name', None) - self.model_type = kwargs.get('model_type', None) - self.model_uri = kwargs.get('model_uri', None) + self.flavors = kwargs.get("flavors", None) + self.job_name = kwargs.get("job_name", None) + self.model_type = kwargs.get("model_type", None) + self.model_uri = kwargs.get("model_uri", None) self.provisioning_state = None @@ -15974,14 +16274,11 @@ class ModelVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelVersion]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ModelVersion]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of ModelVersion objects. If null, there are no additional pages. @@ -15990,8 +16287,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelVersion] """ super(ModelVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class Mpi(DistributionConfiguration): @@ -16007,25 +16304,27 @@ class Mpi(DistributionConfiguration): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, + "distribution_type": {"key": "distributionType", "type": "str"}, + "process_count_per_instance": { + "key": "processCountPerInstance", + "type": "int", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword process_count_per_instance: Number of processes per MPI node. :paramtype process_count_per_instance: int """ super(Mpi, self).__init__(**kwargs) - self.distribution_type = 'Mpi' # type: str - self.process_count_per_instance = kwargs.get('process_count_per_instance', None) + self.distribution_type = "Mpi" # type: str + self.process_count_per_instance = kwargs.get( + "process_count_per_instance", None + ) class NlpFixedParameters(msrest.serialization.Model): @@ -16056,21 +16355,24 @@ class NlpFixedParameters(msrest.serialization.Model): """ _attribute_map = { - 'gradient_accumulation_steps': {'key': 'gradientAccumulationSteps', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_ratio': {'key': 'warmupRatio', 'type': 'float'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, + "gradient_accumulation_steps": { + "key": "gradientAccumulationSteps", + "type": "int", + }, + "learning_rate": {"key": "learningRate", "type": "float"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "int"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, + "warmup_ratio": {"key": "warmupRatio", "type": "float"}, + "weight_decay": {"key": "weightDecay", "type": "float"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword gradient_accumulation_steps: Number of steps to accumulate gradients over before running a backward pass. @@ -16096,15 +16398,19 @@ def __init__( :paramtype weight_decay: float """ super(NlpFixedParameters, self).__init__(**kwargs) - self.gradient_accumulation_steps = kwargs.get('gradient_accumulation_steps', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.learning_rate_scheduler = kwargs.get('learning_rate_scheduler', None) - self.model_name = kwargs.get('model_name', None) - self.number_of_epochs = kwargs.get('number_of_epochs', None) - self.training_batch_size = kwargs.get('training_batch_size', None) - self.validation_batch_size = kwargs.get('validation_batch_size', None) - self.warmup_ratio = kwargs.get('warmup_ratio', None) - self.weight_decay = kwargs.get('weight_decay', None) + self.gradient_accumulation_steps = kwargs.get( + "gradient_accumulation_steps", None + ) + self.learning_rate = kwargs.get("learning_rate", None) + self.learning_rate_scheduler = kwargs.get( + "learning_rate_scheduler", None + ) + self.model_name = kwargs.get("model_name", None) + self.number_of_epochs = kwargs.get("number_of_epochs", None) + self.training_batch_size = kwargs.get("training_batch_size", None) + self.validation_batch_size = kwargs.get("validation_batch_size", None) + self.warmup_ratio = kwargs.get("warmup_ratio", None) + self.weight_decay = kwargs.get("weight_decay", None) class NlpParameterSubspace(msrest.serialization.Model): @@ -16133,21 +16439,24 @@ class NlpParameterSubspace(msrest.serialization.Model): """ _attribute_map = { - 'gradient_accumulation_steps': {'key': 'gradientAccumulationSteps', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_ratio': {'key': 'warmupRatio', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, + "gradient_accumulation_steps": { + "key": "gradientAccumulationSteps", + "type": "str", + }, + "learning_rate": {"key": "learningRate", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "str"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, + "warmup_ratio": {"key": "warmupRatio", "type": "str"}, + "weight_decay": {"key": "weightDecay", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword gradient_accumulation_steps: Number of steps to accumulate gradients over before running a backward pass. @@ -16171,15 +16480,19 @@ def __init__( :paramtype weight_decay: str """ super(NlpParameterSubspace, self).__init__(**kwargs) - self.gradient_accumulation_steps = kwargs.get('gradient_accumulation_steps', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.learning_rate_scheduler = kwargs.get('learning_rate_scheduler', None) - self.model_name = kwargs.get('model_name', None) - self.number_of_epochs = kwargs.get('number_of_epochs', None) - self.training_batch_size = kwargs.get('training_batch_size', None) - self.validation_batch_size = kwargs.get('validation_batch_size', None) - self.warmup_ratio = kwargs.get('warmup_ratio', None) - self.weight_decay = kwargs.get('weight_decay', None) + self.gradient_accumulation_steps = kwargs.get( + "gradient_accumulation_steps", None + ) + self.learning_rate = kwargs.get("learning_rate", None) + self.learning_rate_scheduler = kwargs.get( + "learning_rate_scheduler", None + ) + self.model_name = kwargs.get("model_name", None) + self.number_of_epochs = kwargs.get("number_of_epochs", None) + self.training_batch_size = kwargs.get("training_batch_size", None) + self.validation_batch_size = kwargs.get("validation_batch_size", None) + self.warmup_ratio = kwargs.get("warmup_ratio", None) + self.weight_decay = kwargs.get("weight_decay", None) class NlpSweepSettings(msrest.serialization.Model): @@ -16196,18 +16509,18 @@ class NlpSweepSettings(msrest.serialization.Model): """ _validation = { - 'sampling_algorithm': {'required': True}, + "sampling_algorithm": {"required": True}, } _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, + "sampling_algorithm": {"key": "samplingAlgorithm", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword early_termination: Type of early termination policy for the sweeping job. :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy @@ -16217,44 +16530,56 @@ def __init__( ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType """ super(NlpSweepSettings, self).__init__(**kwargs) - self.early_termination = kwargs.get('early_termination', None) - self.sampling_algorithm = kwargs['sampling_algorithm'] + self.early_termination = kwargs.get("early_termination", None) + self.sampling_algorithm = kwargs["sampling_algorithm"] class NlpVertical(msrest.serialization.Model): """Abstract class for NLP related AutoML tasks. -NLP - Natural Language Processing. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - } + NLP - Natural Language Processing. - def __init__( - self, - **kwargs - ): + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar fixed_parameters: Model/training parameters that will remain constant throughout + training. + :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] + :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + """ + + _attribute_map = { + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "NlpFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "search_space": { + "key": "searchSpace", + "type": "[NlpParameterSubspace]", + }, + "sweep_settings": {"key": "sweepSettings", "type": "NlpSweepSettings"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + } + + def __init__(self, **kwargs): """ :keyword featurization_settings: Featurization inputs needed for AutoML job. :paramtype featurization_settings: @@ -16273,12 +16598,14 @@ def __init__( :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ super(NlpVertical, self).__init__(**kwargs) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.fixed_parameters = kwargs.get("fixed_parameters", None) + self.limit_settings = kwargs.get("limit_settings", None) + self.search_space = kwargs.get("search_space", None) + self.sweep_settings = kwargs.get("sweep_settings", None) + self.validation_data = kwargs.get("validation_data", None) class NlpVerticalFeaturizationSettings(FeaturizationSettings): @@ -16289,13 +16616,10 @@ class NlpVerticalFeaturizationSettings(FeaturizationSettings): """ _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, + "dataset_language": {"key": "datasetLanguage", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword dataset_language: Dataset language, useful for the text data. :paramtype dataset_language: str @@ -16319,17 +16643,14 @@ class NlpVerticalLimitSettings(msrest.serialization.Model): """ _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_nodes': {'key': 'maxNodes', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_nodes": {"key": "maxNodes", "type": "int"}, + "max_trials": {"key": "maxTrials", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, + "trial_timeout": {"key": "trialTimeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword max_concurrent_trials: Maximum Concurrent AutoML iterations. :paramtype max_concurrent_trials: int @@ -16343,11 +16664,11 @@ def __init__( :paramtype trial_timeout: ~datetime.timedelta """ super(NlpVerticalLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', 1) - self.max_nodes = kwargs.get('max_nodes', 1) - self.max_trials = kwargs.get('max_trials', 1) - self.timeout = kwargs.get('timeout', "P7D") - self.trial_timeout = kwargs.get('trial_timeout', None) + self.max_concurrent_trials = kwargs.get("max_concurrent_trials", 1) + self.max_nodes = kwargs.get("max_nodes", 1) + self.max_trials = kwargs.get("max_trials", 1) + self.timeout = kwargs.get("timeout", "P7D") + self.trial_timeout = kwargs.get("trial_timeout", None) class NodeStateCounts(msrest.serialization.Model): @@ -16370,29 +16691,25 @@ class NodeStateCounts(msrest.serialization.Model): """ _validation = { - 'idle_node_count': {'readonly': True}, - 'running_node_count': {'readonly': True}, - 'preparing_node_count': {'readonly': True}, - 'unusable_node_count': {'readonly': True}, - 'leaving_node_count': {'readonly': True}, - 'preempted_node_count': {'readonly': True}, + "idle_node_count": {"readonly": True}, + "running_node_count": {"readonly": True}, + "preparing_node_count": {"readonly": True}, + "unusable_node_count": {"readonly": True}, + "leaving_node_count": {"readonly": True}, + "preempted_node_count": {"readonly": True}, } _attribute_map = { - 'idle_node_count': {'key': 'idleNodeCount', 'type': 'int'}, - 'running_node_count': {'key': 'runningNodeCount', 'type': 'int'}, - 'preparing_node_count': {'key': 'preparingNodeCount', 'type': 'int'}, - 'unusable_node_count': {'key': 'unusableNodeCount', 'type': 'int'}, - 'leaving_node_count': {'key': 'leavingNodeCount', 'type': 'int'}, - 'preempted_node_count': {'key': 'preemptedNodeCount', 'type': 'int'}, + "idle_node_count": {"key": "idleNodeCount", "type": "int"}, + "running_node_count": {"key": "runningNodeCount", "type": "int"}, + "preparing_node_count": {"key": "preparingNodeCount", "type": "int"}, + "unusable_node_count": {"key": "unusableNodeCount", "type": "int"}, + "leaving_node_count": {"key": "leavingNodeCount", "type": "int"}, + "preempted_node_count": {"key": "preemptedNodeCount", "type": "int"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NodeStateCounts, self).__init__(**kwargs) self.idle_node_count = None self.running_node_count = None @@ -16402,7 +16719,9 @@ def __init__( self.preempted_node_count = None -class NoneAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class NoneAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """NoneAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -16424,21 +16743,18 @@ class NoneAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2) """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: Category of the connection. Possible values include: "PythonFeed", "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", @@ -16452,8 +16768,10 @@ def __init__( "JSON". :paramtype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat """ - super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'None' # type: str + super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__( + **kwargs + ) + self.auth_type = "None" # type: str class NoneDatastoreCredentials(DatastoreCredentials): @@ -16468,21 +16786,17 @@ class NoneDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, + "credentials_type": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NoneDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'None' # type: str + self.credentials_type = "None" # type: str class NotebookAccessTokenResult(msrest.serialization.Model): @@ -16509,33 +16823,29 @@ class NotebookAccessTokenResult(msrest.serialization.Model): """ _validation = { - 'notebook_resource_id': {'readonly': True}, - 'host_name': {'readonly': True}, - 'public_dns': {'readonly': True}, - 'access_token': {'readonly': True}, - 'token_type': {'readonly': True}, - 'expires_in': {'readonly': True}, - 'refresh_token': {'readonly': True}, - 'scope': {'readonly': True}, + "notebook_resource_id": {"readonly": True}, + "host_name": {"readonly": True}, + "public_dns": {"readonly": True}, + "access_token": {"readonly": True}, + "token_type": {"readonly": True}, + "expires_in": {"readonly": True}, + "refresh_token": {"readonly": True}, + "scope": {"readonly": True}, } _attribute_map = { - 'notebook_resource_id': {'key': 'notebookResourceId', 'type': 'str'}, - 'host_name': {'key': 'hostName', 'type': 'str'}, - 'public_dns': {'key': 'publicDns', 'type': 'str'}, - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, - 'expires_in': {'key': 'expiresIn', 'type': 'int'}, - 'refresh_token': {'key': 'refreshToken', 'type': 'str'}, - 'scope': {'key': 'scope', 'type': 'str'}, + "notebook_resource_id": {"key": "notebookResourceId", "type": "str"}, + "host_name": {"key": "hostName", "type": "str"}, + "public_dns": {"key": "publicDns", "type": "str"}, + "access_token": {"key": "accessToken", "type": "str"}, + "token_type": {"key": "tokenType", "type": "str"}, + "expires_in": {"key": "expiresIn", "type": "int"}, + "refresh_token": {"key": "refreshToken", "type": "str"}, + "scope": {"key": "scope", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NotebookAccessTokenResult, self).__init__(**kwargs) self.notebook_resource_id = None self.host_name = None @@ -16557,14 +16867,11 @@ class NotebookPreparationError(msrest.serialization.Model): """ _attribute_map = { - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'status_code': {'key': 'statusCode', 'type': 'int'}, + "error_message": {"key": "errorMessage", "type": "str"}, + "status_code": {"key": "statusCode", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword error_message: :paramtype error_message: str @@ -16572,8 +16879,8 @@ def __init__( :paramtype status_code: int """ super(NotebookPreparationError, self).__init__(**kwargs) - self.error_message = kwargs.get('error_message', None) - self.status_code = kwargs.get('status_code', None) + self.error_message = kwargs.get("error_message", None) + self.status_code = kwargs.get("status_code", None) class NotebookResourceInfo(msrest.serialization.Model): @@ -16589,15 +16896,15 @@ class NotebookResourceInfo(msrest.serialization.Model): """ _attribute_map = { - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'notebook_preparation_error': {'key': 'notebookPreparationError', 'type': 'NotebookPreparationError'}, + "fqdn": {"key": "fqdn", "type": "str"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "notebook_preparation_error": { + "key": "notebookPreparationError", + "type": "NotebookPreparationError", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword fqdn: :paramtype fqdn: str @@ -16608,9 +16915,11 @@ def __init__( ~azure.mgmt.machinelearningservices.models.NotebookPreparationError """ super(NotebookResourceInfo, self).__init__(**kwargs) - self.fqdn = kwargs.get('fqdn', None) - self.resource_id = kwargs.get('resource_id', None) - self.notebook_preparation_error = kwargs.get('notebook_preparation_error', None) + self.fqdn = kwargs.get("fqdn", None) + self.resource_id = kwargs.get("resource_id", None) + self.notebook_preparation_error = kwargs.get( + "notebook_preparation_error", None + ) class Objective(msrest.serialization.Model): @@ -16626,19 +16935,16 @@ class Objective(msrest.serialization.Model): """ _validation = { - 'goal': {'required': True}, - 'primary_metric': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "goal": {"required": True}, + "primary_metric": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'goal': {'key': 'goal', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "goal": {"key": "goal", "type": "str"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword goal: Required. [Required] Defines supported metric goals for hyperparameter tuning. Possible values include: "Minimize", "Maximize". @@ -16647,8 +16953,8 @@ def __init__( :paramtype primary_metric: str """ super(Objective, self).__init__(**kwargs) - self.goal = kwargs['goal'] - self.primary_metric = kwargs['primary_metric'] + self.goal = kwargs["goal"] + self.primary_metric = kwargs["primary_metric"] class OnlineDeployment(TrackedResource): @@ -16685,31 +16991,31 @@ class OnlineDeployment(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineDeploymentProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": { + "key": "properties", + "type": "OnlineDeploymentProperties", + }, + "sku": {"key": "sku", "type": "Sku"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -16726,13 +17032,15 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ super(OnlineDeployment, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) + self.identity = kwargs.get("identity", None) + self.kind = kwargs.get("kind", None) + self.properties = kwargs["properties"] + self.sku = kwargs.get("sku", None) -class OnlineDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class OnlineDeploymentTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of OnlineDeployment entities. :ivar next_link: The link to the next page of OnlineDeployment objects. If null, there are no @@ -16743,14 +17051,11 @@ class OnlineDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Mod """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineDeployment]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[OnlineDeployment]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of OnlineDeployment objects. If null, there are no additional pages. @@ -16758,9 +17063,11 @@ def __init__( :keyword value: An array of objects of type OnlineDeployment. :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineDeployment] """ - super(OnlineDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super( + OnlineDeploymentTrackedResourceArmPaginatedResult, self + ).__init__(**kwargs) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class OnlineEndpoint(TrackedResource): @@ -16797,31 +17104,31 @@ class OnlineEndpoint(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": { + "key": "properties", + "type": "OnlineEndpointProperties", + }, + "sku": {"key": "sku", "type": "Sku"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -16838,10 +17145,10 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ super(OnlineEndpoint, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) + self.identity = kwargs.get("identity", None) + self.kind = kwargs.get("kind", None) + self.properties = kwargs["properties"] + self.sku = kwargs.get("sku", None) class OnlineEndpointProperties(EndpointPropertiesBase): @@ -16887,30 +17194,27 @@ class OnlineEndpointProperties(EndpointPropertiesBase): """ _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "auth_mode": {"required": True}, + "scoring_uri": {"readonly": True}, + "swagger_uri": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'mirror_traffic': {'key': 'mirrorTraffic', 'type': '{int}'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, - 'traffic': {'key': 'traffic', 'type': '{int}'}, + "auth_mode": {"key": "authMode", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "keys": {"key": "keys", "type": "EndpointAuthKeys"}, + "properties": {"key": "properties", "type": "{str}"}, + "scoring_uri": {"key": "scoringUri", "type": "str"}, + "swagger_uri": {"key": "swaggerUri", "type": "str"}, + "compute": {"key": "compute", "type": "str"}, + "mirror_traffic": {"key": "mirrorTraffic", "type": "{int}"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "public_network_access": {"key": "publicNetworkAccess", "type": "str"}, + "traffic": {"key": "traffic", "type": "{int}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' @@ -16939,14 +17243,16 @@ def __init__( :paramtype traffic: dict[str, int] """ super(OnlineEndpointProperties, self).__init__(**kwargs) - self.compute = kwargs.get('compute', None) - self.mirror_traffic = kwargs.get('mirror_traffic', None) + self.compute = kwargs.get("compute", None) + self.mirror_traffic = kwargs.get("mirror_traffic", None) self.provisioning_state = None - self.public_network_access = kwargs.get('public_network_access', None) - self.traffic = kwargs.get('traffic', None) + self.public_network_access = kwargs.get("public_network_access", None) + self.traffic = kwargs.get("traffic", None) -class OnlineEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class OnlineEndpointTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of OnlineEndpoint entities. :ivar next_link: The link to the next page of OnlineEndpoint objects. If null, there are no @@ -16957,14 +17263,11 @@ class OnlineEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineEndpoint]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[OnlineEndpoint]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of OnlineEndpoint objects. If null, there are no additional pages. @@ -16972,9 +17275,11 @@ def __init__( :keyword value: An array of objects of type OnlineEndpoint. :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] """ - super(OnlineEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(OnlineEndpointTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class OnlineRequestSettings(msrest.serialization.Model): @@ -16993,15 +17298,15 @@ class OnlineRequestSettings(msrest.serialization.Model): """ _attribute_map = { - 'max_concurrent_requests_per_instance': {'key': 'maxConcurrentRequestsPerInstance', 'type': 'int'}, - 'max_queue_wait': {'key': 'maxQueueWait', 'type': 'duration'}, - 'request_timeout': {'key': 'requestTimeout', 'type': 'duration'}, + "max_concurrent_requests_per_instance": { + "key": "maxConcurrentRequestsPerInstance", + "type": "int", + }, + "max_queue_wait": {"key": "maxQueueWait", "type": "duration"}, + "request_timeout": {"key": "requestTimeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword max_concurrent_requests_per_instance: The number of maximum concurrent requests per node allowed per deployment. Defaults to 1. @@ -17015,9 +17320,11 @@ def __init__( :paramtype request_timeout: ~datetime.timedelta """ super(OnlineRequestSettings, self).__init__(**kwargs) - self.max_concurrent_requests_per_instance = kwargs.get('max_concurrent_requests_per_instance', 1) - self.max_queue_wait = kwargs.get('max_queue_wait', "PT0.5S") - self.request_timeout = kwargs.get('request_timeout', "PT5S") + self.max_concurrent_requests_per_instance = kwargs.get( + "max_concurrent_requests_per_instance", 1 + ) + self.max_queue_wait = kwargs.get("max_queue_wait", "PT0.5S") + self.request_timeout = kwargs.get("request_timeout", "PT5S") class OutboundRuleBasicResource(Resource): @@ -17044,32 +17351,29 @@ class OutboundRuleBasicResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'OutboundRule'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "OutboundRule"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. Outbound Rule for the managed network of a machine learning workspace. :paramtype properties: ~azure.mgmt.machinelearningservices.models.OutboundRule """ super(OutboundRuleBasicResource, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class OutboundRuleListResult(msrest.serialization.Model): @@ -17084,14 +17388,11 @@ class OutboundRuleListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[OutboundRuleBasicResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[OutboundRuleBasicResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: The list of machine learning workspaces. Since this list may be incomplete, the nextLink field should be used to request the next list of machine learning workspaces. @@ -17101,8 +17402,8 @@ def __init__( :paramtype next_link: str """ super(OutboundRuleListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get("value", None) + self.next_link = kwargs.get("next_link", None) class OutputPathAssetReference(AssetReferenceBase): @@ -17120,19 +17421,16 @@ class OutputPathAssetReference(AssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "job_id": {"key": "jobId", "type": "str"}, + "path": {"key": "path", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword job_id: ARM resource ID of the job. :paramtype job_id: str @@ -17140,9 +17438,9 @@ def __init__( :paramtype path: str """ super(OutputPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'OutputPath' # type: str - self.job_id = kwargs.get('job_id', None) - self.path = kwargs.get('path', None) + self.reference_type = "OutputPath" # type: str + self.job_id = kwargs.get("job_id", None) + self.path = kwargs.get("path", None) class PaginatedComputeResourcesList(msrest.serialization.Model): @@ -17155,14 +17453,11 @@ class PaginatedComputeResourcesList(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[ComputeResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[ComputeResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: An array of Machine Learning compute objects wrapped in ARM resource envelope. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComputeResource] @@ -17170,8 +17465,8 @@ def __init__( :paramtype next_link: str """ super(PaginatedComputeResourcesList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get("value", None) + self.next_link = kwargs.get("next_link", None) class PartialBatchDeployment(msrest.serialization.Model): @@ -17182,22 +17477,21 @@ class PartialBatchDeployment(msrest.serialization.Model): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: Description of the endpoint deployment. :paramtype description: str """ super(PartialBatchDeployment, self).__init__(**kwargs) - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) -class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties(msrest.serialization.Model): +class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties( + msrest.serialization.Model +): """Strictly used in update requests. :ivar properties: Additional attributes of the entity. @@ -17207,23 +17501,23 @@ class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties(msrest.s """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'PartialBatchDeployment'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "properties": {"key": "properties", "type": "PartialBatchDeployment"}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.PartialBatchDeployment :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] """ - super(PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) + super( + PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, + self, + ).__init__(**kwargs) + self.properties = kwargs.get("properties", None) + self.tags = kwargs.get("tags", None) class PartialManagedServiceIdentity(msrest.serialization.Model): @@ -17241,14 +17535,14 @@ class PartialManagedServiceIdentity(msrest.serialization.Model): """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{object}'}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{object}", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword type: Managed service identity (system assigned and/or user assigned identities). Possible values include: "None", "SystemAssigned", "UserAssigned", @@ -17261,8 +17555,10 @@ def __init__( :paramtype user_assigned_identities: dict[str, any] """ super(PartialManagedServiceIdentity, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + self.type = kwargs.get("type", None) + self.user_assigned_identities = kwargs.get( + "user_assigned_identities", None + ) class PartialMinimalTrackedResource(msrest.serialization.Model): @@ -17273,19 +17569,16 @@ class PartialMinimalTrackedResource(msrest.serialization.Model): """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] """ super(PartialMinimalTrackedResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) + self.tags = kwargs.get("tags", None) class PartialMinimalTrackedResourceWithIdentity(PartialMinimalTrackedResource): @@ -17298,22 +17591,24 @@ class PartialMinimalTrackedResourceWithIdentity(PartialMinimalTrackedResource): """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, + "tags": {"key": "tags", "type": "{str}"}, + "identity": { + "key": "identity", + "type": "PartialManagedServiceIdentity", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] :keyword identity: Managed service identity (system assigned and/or user assigned identities). :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity """ - super(PartialMinimalTrackedResourceWithIdentity, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) + super(PartialMinimalTrackedResourceWithIdentity, self).__init__( + **kwargs + ) + self.identity = kwargs.get("identity", None) class PartialMinimalTrackedResourceWithSku(PartialMinimalTrackedResource): @@ -17326,14 +17621,11 @@ class PartialMinimalTrackedResourceWithSku(PartialMinimalTrackedResource): """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "PartialSku"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -17341,7 +17633,7 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku """ super(PartialMinimalTrackedResourceWithSku, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) + self.sku = kwargs.get("sku", None) class PartialRegistryPartialTrackedResource(msrest.serialization.Model): @@ -17361,17 +17653,17 @@ class PartialRegistryPartialTrackedResource(msrest.serialization.Model): """ _attribute_map = { - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'object'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "identity": { + "key": "identity", + "type": "PartialManagedServiceIdentity", + }, + "kind": {"key": "kind", "type": "str"}, + "properties": {"key": "properties", "type": "object"}, + "sku": {"key": "sku", "type": "PartialSku"}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword identity: Managed service identity (system assigned and/or user assigned identities). :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity @@ -17386,11 +17678,11 @@ def __init__( :paramtype tags: dict[str, str] """ super(PartialRegistryPartialTrackedResource, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs.get('properties', None) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) + self.identity = kwargs.get("identity", None) + self.kind = kwargs.get("kind", None) + self.properties = kwargs.get("properties", None) + self.sku = kwargs.get("sku", None) + self.tags = kwargs.get("tags", None) class PartialSku(msrest.serialization.Model): @@ -17414,17 +17706,14 @@ class PartialSku(msrest.serialization.Model): """ _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'int'}, - 'family': {'key': 'family', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, + "capacity": {"key": "capacity", "type": "int"}, + "family": {"key": "family", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "size": {"key": "size", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword capacity: If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted. @@ -17443,11 +17732,11 @@ def __init__( :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier """ super(PartialSku, self).__init__(**kwargs) - self.capacity = kwargs.get('capacity', None) - self.family = kwargs.get('family', None) - self.name = kwargs.get('name', None) - self.size = kwargs.get('size', None) - self.tier = kwargs.get('tier', None) + self.capacity = kwargs.get("capacity", None) + self.family = kwargs.get("family", None) + self.name = kwargs.get("name", None) + self.size = kwargs.get("size", None) + self.tier = kwargs.get("tier", None) class Password(msrest.serialization.Model): @@ -17462,27 +17751,25 @@ class Password(msrest.serialization.Model): """ _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, + "name": {"readonly": True}, + "value": {"readonly": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "value": {"key": "value", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Password, self).__init__(**kwargs) self.name = None self.value = None -class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class PATAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """PATAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -17507,22 +17794,22 @@ class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionPersonalAccessToken'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionPersonalAccessToken", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: Category of the connection. Possible values include: "PythonFeed", "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", @@ -17539,9 +17826,11 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken """ - super(PATAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'PAT' # type: str - self.credentials = kwargs.get('credentials', None) + super(PATAuthTypeWorkspaceConnectionProperties, self).__init__( + **kwargs + ) + self.auth_type = "PAT" # type: str + self.credentials = kwargs.get("credentials", None) class PersonalComputeInstanceSettings(msrest.serialization.Model): @@ -17552,19 +17841,16 @@ class PersonalComputeInstanceSettings(msrest.serialization.Model): """ _attribute_map = { - 'assigned_user': {'key': 'assignedUser', 'type': 'AssignedUser'}, + "assigned_user": {"key": "assignedUser", "type": "AssignedUser"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword assigned_user: A user explicitly assigned to a personal compute instance. :paramtype assigned_user: ~azure.mgmt.machinelearningservices.models.AssignedUser """ super(PersonalComputeInstanceSettings, self).__init__(**kwargs) - self.assigned_user = kwargs.get('assigned_user', None) + self.assigned_user = kwargs.get("assigned_user", None) class PipelineJob(JobBaseProperties): @@ -17618,34 +17904,31 @@ class PipelineJob(JobBaseProperties): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, + "job_type": {"required": True}, + "status": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'jobs': {'key': 'jobs', 'type': '{object}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'settings': {'key': 'settings', 'type': 'object'}, - 'source_job_id': {'key': 'sourceJobId', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "jobs": {"key": "jobs", "type": "{object}"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "settings": {"key": "settings", "type": "object"}, + "source_job_id": {"key": "sourceJobId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -17683,12 +17966,12 @@ def __init__( :paramtype source_job_id: str """ super(PipelineJob, self).__init__(**kwargs) - self.job_type = 'Pipeline' # type: str - self.inputs = kwargs.get('inputs', None) - self.jobs = kwargs.get('jobs', None) - self.outputs = kwargs.get('outputs', None) - self.settings = kwargs.get('settings', None) - self.source_job_id = kwargs.get('source_job_id', None) + self.job_type = "Pipeline" # type: str + self.inputs = kwargs.get("inputs", None) + self.jobs = kwargs.get("jobs", None) + self.outputs = kwargs.get("outputs", None) + self.settings = kwargs.get("settings", None) + self.source_job_id = kwargs.get("source_job_id", None) class PrivateEndpoint(msrest.serialization.Model): @@ -17703,21 +17986,17 @@ class PrivateEndpoint(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'subnet_arm_id': {'readonly': True}, + "id": {"readonly": True}, + "subnet_arm_id": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'subnet_arm_id': {'key': 'subnetArmId', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "subnet_arm_id": {"key": "subnetArmId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(PrivateEndpoint, self).__init__(**kwargs) self.id = None self.subnet_arm_id = None @@ -17760,31 +18039,37 @@ class PrivateEndpointConnection(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "private_endpoint": { + "key": "properties.privateEndpoint", + "type": "PrivateEndpoint", + }, + "private_link_service_connection_state": { + "key": "properties.privateLinkServiceConnectionState", + "type": "PrivateLinkServiceConnectionState", + }, + "provisioning_state": { + "key": "properties.provisioningState", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword identity: The identity of the resource. :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity @@ -17802,12 +18087,14 @@ def __init__( ~azure.mgmt.machinelearningservices.models.PrivateLinkServiceConnectionState """ super(PrivateEndpointConnection, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) - self.private_endpoint = kwargs.get('private_endpoint', None) - self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + self.identity = kwargs.get("identity", None) + self.location = kwargs.get("location", None) + self.tags = kwargs.get("tags", None) + self.sku = kwargs.get("sku", None) + self.private_endpoint = kwargs.get("private_endpoint", None) + self.private_link_service_connection_state = kwargs.get( + "private_link_service_connection_state", None + ) self.provisioning_state = None @@ -17819,19 +18106,16 @@ class PrivateEndpointConnectionListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + "value": {"key": "value", "type": "[PrivateEndpointConnection]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Array of private endpoint connections. :paramtype value: list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] """ super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class PrivateEndpointDestination(msrest.serialization.Model): @@ -17849,16 +18133,13 @@ class PrivateEndpointDestination(msrest.serialization.Model): """ _attribute_map = { - 'service_resource_id': {'key': 'serviceResourceId', 'type': 'str'}, - 'subresource_target': {'key': 'subresourceTarget', 'type': 'str'}, - 'spark_enabled': {'key': 'sparkEnabled', 'type': 'bool'}, - 'spark_status': {'key': 'sparkStatus', 'type': 'str'}, + "service_resource_id": {"key": "serviceResourceId", "type": "str"}, + "subresource_target": {"key": "subresourceTarget", "type": "str"}, + "spark_enabled": {"key": "sparkEnabled", "type": "bool"}, + "spark_status": {"key": "sparkStatus", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword service_resource_id: :paramtype service_resource_id: str @@ -17871,10 +18152,10 @@ def __init__( :paramtype spark_status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus """ super(PrivateEndpointDestination, self).__init__(**kwargs) - self.service_resource_id = kwargs.get('service_resource_id', None) - self.subresource_target = kwargs.get('subresource_target', None) - self.spark_enabled = kwargs.get('spark_enabled', None) - self.spark_status = kwargs.get('spark_status', None) + self.service_resource_id = kwargs.get("service_resource_id", None) + self.subresource_target = kwargs.get("subresource_target", None) + self.spark_enabled = kwargs.get("spark_enabled", None) + self.spark_status = kwargs.get("spark_status", None) class PrivateEndpointOutboundRule(OutboundRule): @@ -17898,20 +18179,20 @@ class PrivateEndpointOutboundRule(OutboundRule): """ _validation = { - 'type': {'required': True}, + "type": {"required": True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'PrivateEndpointDestination'}, + "type": {"key": "type", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "destination": { + "key": "destination", + "type": "PrivateEndpointDestination", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword status: Status of a managed network Outbound Rule of a machine learning workspace. Possible values include: "Inactive", "Active". @@ -17924,8 +18205,8 @@ def __init__( :paramtype destination: ~azure.mgmt.machinelearningservices.models.PrivateEndpointDestination """ super(PrivateEndpointOutboundRule, self).__init__(**kwargs) - self.type = 'PrivateEndpoint' # type: str - self.destination = kwargs.get('destination', None) + self.type = "PrivateEndpoint" # type: str + self.destination = kwargs.get("destination", None) class PrivateLinkResource(Resource): @@ -17961,32 +18242,35 @@ class PrivateLinkResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'group_id': {'readonly': True}, - 'required_members': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "group_id": {"readonly": True}, + "required_members": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, - 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "group_id": {"key": "properties.groupId", "type": "str"}, + "required_members": { + "key": "properties.requiredMembers", + "type": "[str]", + }, + "required_zone_names": { + "key": "properties.requiredZoneNames", + "type": "[str]", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword identity: The identity of the resource. :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity @@ -18000,13 +18284,13 @@ def __init__( :paramtype required_zone_names: list[str] """ super(PrivateLinkResource, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) + self.identity = kwargs.get("identity", None) + self.location = kwargs.get("location", None) + self.tags = kwargs.get("tags", None) + self.sku = kwargs.get("sku", None) self.group_id = None self.required_members = None - self.required_zone_names = kwargs.get('required_zone_names', None) + self.required_zone_names = kwargs.get("required_zone_names", None) class PrivateLinkResourceListResult(msrest.serialization.Model): @@ -18017,19 +18301,16 @@ class PrivateLinkResourceListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + "value": {"key": "value", "type": "[PrivateLinkResource]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Array of private link resources. :paramtype value: list[~azure.mgmt.machinelearningservices.models.PrivateLinkResource] """ super(PrivateLinkResourceListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class PrivateLinkServiceConnectionState(msrest.serialization.Model): @@ -18048,15 +18329,12 @@ class PrivateLinkServiceConnectionState(msrest.serialization.Model): """ _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + "status": {"key": "status", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "actions_required": {"key": "actionsRequired", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword status: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Possible values include: "Pending", "Approved", "Rejected", @@ -18070,9 +18348,9 @@ def __init__( :paramtype actions_required: str """ super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.description = kwargs.get('description', None) - self.actions_required = kwargs.get('actions_required', None) + self.status = kwargs.get("status", None) + self.description = kwargs.get("description", None) + self.actions_required = kwargs.get("actions_required", None) class ProbeSettings(msrest.serialization.Model): @@ -18091,17 +18369,14 @@ class ProbeSettings(msrest.serialization.Model): """ _attribute_map = { - 'failure_threshold': {'key': 'failureThreshold', 'type': 'int'}, - 'initial_delay': {'key': 'initialDelay', 'type': 'duration'}, - 'period': {'key': 'period', 'type': 'duration'}, - 'success_threshold': {'key': 'successThreshold', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "failure_threshold": {"key": "failureThreshold", "type": "int"}, + "initial_delay": {"key": "initialDelay", "type": "duration"}, + "period": {"key": "period", "type": "duration"}, + "success_threshold": {"key": "successThreshold", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword failure_threshold: The number of failures to allow before returning an unhealthy status. @@ -18116,11 +18391,11 @@ def __init__( :paramtype timeout: ~datetime.timedelta """ super(ProbeSettings, self).__init__(**kwargs) - self.failure_threshold = kwargs.get('failure_threshold', 30) - self.initial_delay = kwargs.get('initial_delay', None) - self.period = kwargs.get('period', "PT10S") - self.success_threshold = kwargs.get('success_threshold', 1) - self.timeout = kwargs.get('timeout', "PT2S") + self.failure_threshold = kwargs.get("failure_threshold", 30) + self.initial_delay = kwargs.get("initial_delay", None) + self.period = kwargs.get("period", "PT10S") + self.success_threshold = kwargs.get("success_threshold", 1) + self.timeout = kwargs.get("timeout", "PT2S") class ProgressMetrics(msrest.serialization.Model): @@ -18140,25 +18415,33 @@ class ProgressMetrics(msrest.serialization.Model): """ _validation = { - 'completed_datapoint_count': {'readonly': True}, - 'incremental_data_last_refresh_date_time': {'readonly': True}, - 'skipped_datapoint_count': {'readonly': True}, - 'total_datapoint_count': {'readonly': True}, + "completed_datapoint_count": {"readonly": True}, + "incremental_data_last_refresh_date_time": {"readonly": True}, + "skipped_datapoint_count": {"readonly": True}, + "total_datapoint_count": {"readonly": True}, } _attribute_map = { - 'completed_datapoint_count': {'key': 'completedDatapointCount', 'type': 'long'}, - 'incremental_data_last_refresh_date_time': {'key': 'incrementalDataLastRefreshDateTime', 'type': 'iso-8601'}, - 'skipped_datapoint_count': {'key': 'skippedDatapointCount', 'type': 'long'}, - 'total_datapoint_count': {'key': 'totalDatapointCount', 'type': 'long'}, + "completed_datapoint_count": { + "key": "completedDatapointCount", + "type": "long", + }, + "incremental_data_last_refresh_date_time": { + "key": "incrementalDataLastRefreshDateTime", + "type": "iso-8601", + }, + "skipped_datapoint_count": { + "key": "skippedDatapointCount", + "type": "long", + }, + "total_datapoint_count": { + "key": "totalDatapointCount", + "type": "long", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ProgressMetrics, self).__init__(**kwargs) self.completed_datapoint_count = None self.incremental_data_last_refresh_date_time = None @@ -18179,25 +18462,27 @@ class PyTorch(DistributionConfiguration): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, + "distribution_type": {"key": "distributionType", "type": "str"}, + "process_count_per_instance": { + "key": "processCountPerInstance", + "type": "int", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword process_count_per_instance: Number of processes per node. :paramtype process_count_per_instance: int """ super(PyTorch, self).__init__(**kwargs) - self.distribution_type = 'PyTorch' # type: str - self.process_count_per_instance = kwargs.get('process_count_per_instance', None) + self.distribution_type = "PyTorch" # type: str + self.process_count_per_instance = kwargs.get( + "process_count_per_instance", None + ) class QuotaBaseProperties(msrest.serialization.Model): @@ -18214,16 +18499,13 @@ class QuotaBaseProperties(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "limit": {"key": "limit", "type": "long"}, + "unit": {"key": "unit", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword id: Specifies the resource ID. :paramtype id: str @@ -18236,10 +18518,10 @@ def __init__( :paramtype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit """ super(QuotaBaseProperties, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.type = kwargs.get('type', None) - self.limit = kwargs.get('limit', None) - self.unit = kwargs.get('unit', None) + self.id = kwargs.get("id", None) + self.type = kwargs.get("type", None) + self.limit = kwargs.get("limit", None) + self.unit = kwargs.get("unit", None) class QuotaUpdateParameters(msrest.serialization.Model): @@ -18252,14 +18534,11 @@ class QuotaUpdateParameters(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[QuotaBaseProperties]'}, - 'location': {'key': 'location', 'type': 'str'}, + "value": {"key": "value", "type": "[QuotaBaseProperties]"}, + "location": {"key": "location", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: The list for update quota. :paramtype value: list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] @@ -18267,8 +18546,8 @@ def __init__( :paramtype location: str """ super(QuotaUpdateParameters, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.location = kwargs.get('location', None) + self.value = kwargs.get("value", None) + self.location = kwargs.get("location", None) class RandomSamplingAlgorithm(SamplingAlgorithm): @@ -18291,20 +18570,20 @@ class RandomSamplingAlgorithm(SamplingAlgorithm): """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - 'logbase': {'key': 'logbase', 'type': 'str'}, - 'rule': {'key': 'rule', 'type': 'str'}, - 'seed': {'key': 'seed', 'type': 'int'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, + "logbase": {"key": "logbase", "type": "str"}, + "rule": {"key": "rule", "type": "str"}, + "seed": {"key": "seed", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword logbase: An optional positive number or e in string format to be used as base for log based random sampling. @@ -18316,10 +18595,10 @@ def __init__( :paramtype seed: int """ super(RandomSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Random' # type: str - self.logbase = kwargs.get('logbase', None) - self.rule = kwargs.get('rule', None) - self.seed = kwargs.get('seed', None) + self.sampling_algorithm_type = "Random" # type: str + self.logbase = kwargs.get("logbase", None) + self.rule = kwargs.get("rule", None) + self.seed = kwargs.get("seed", None) class RecurrenceSchedule(msrest.serialization.Model): @@ -18338,21 +18617,18 @@ class RecurrenceSchedule(msrest.serialization.Model): """ _validation = { - 'hours': {'required': True}, - 'minutes': {'required': True}, + "hours": {"required": True}, + "minutes": {"required": True}, } _attribute_map = { - 'hours': {'key': 'hours', 'type': '[int]'}, - 'minutes': {'key': 'minutes', 'type': '[int]'}, - 'month_days': {'key': 'monthDays', 'type': '[int]'}, - 'week_days': {'key': 'weekDays', 'type': '[str]'}, + "hours": {"key": "hours", "type": "[int]"}, + "minutes": {"key": "minutes", "type": "[int]"}, + "month_days": {"key": "monthDays", "type": "[int]"}, + "week_days": {"key": "weekDays", "type": "[str]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword hours: Required. [Required] List of hours for the schedule. :paramtype hours: list[int] @@ -18364,10 +18640,10 @@ def __init__( :paramtype week_days: list[str or ~azure.mgmt.machinelearningservices.models.WeekDay] """ super(RecurrenceSchedule, self).__init__(**kwargs) - self.hours = kwargs['hours'] - self.minutes = kwargs['minutes'] - self.month_days = kwargs.get('month_days', None) - self.week_days = kwargs.get('week_days', None) + self.hours = kwargs["hours"] + self.minutes = kwargs["minutes"] + self.month_days = kwargs.get("month_days", None) + self.week_days = kwargs.get("week_days", None) class RecurrenceTrigger(TriggerBase): @@ -18400,25 +18676,22 @@ class RecurrenceTrigger(TriggerBase): """ _validation = { - 'trigger_type': {'required': True}, - 'frequency': {'required': True}, - 'interval': {'required': True}, + "trigger_type": {"required": True}, + "frequency": {"required": True}, + "interval": {"required": True}, } _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceSchedule'}, + "end_time": {"key": "endTime", "type": "str"}, + "start_time": {"key": "startTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "trigger_type": {"key": "triggerType", "type": "str"}, + "frequency": {"key": "frequency", "type": "str"}, + "interval": {"key": "interval", "type": "int"}, + "schedule": {"key": "schedule", "type": "RecurrenceSchedule"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer https://en.wikipedia.org/wiki/ISO_8601. @@ -18442,10 +18715,10 @@ def __init__( :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule """ super(RecurrenceTrigger, self).__init__(**kwargs) - self.trigger_type = 'Recurrence' # type: str - self.frequency = kwargs['frequency'] - self.interval = kwargs['interval'] - self.schedule = kwargs.get('schedule', None) + self.trigger_type = "Recurrence" # type: str + self.frequency = kwargs["frequency"] + self.interval = kwargs["interval"] + self.schedule = kwargs.get("schedule", None) class RegenerateEndpointKeysRequest(msrest.serialization.Model): @@ -18461,18 +18734,15 @@ class RegenerateEndpointKeysRequest(msrest.serialization.Model): """ _validation = { - 'key_type': {'required': True}, + "key_type": {"required": True}, } _attribute_map = { - 'key_type': {'key': 'keyType', 'type': 'str'}, - 'key_value': {'key': 'keyValue', 'type': 'str'}, + "key_type": {"key": "keyType", "type": "str"}, + "key_value": {"key": "keyValue", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword key_type: Required. [Required] Specification for which type of key to generate. Primary or Secondary. Possible values include: "Primary", "Secondary". @@ -18481,8 +18751,8 @@ def __init__( :paramtype key_value: str """ super(RegenerateEndpointKeysRequest, self).__init__(**kwargs) - self.key_type = kwargs['key_type'] - self.key_value = kwargs.get('key_value', None) + self.key_type = kwargs["key_type"] + self.key_value = kwargs.get("key_value", None) class Registry(TrackedResource): @@ -18519,31 +18789,28 @@ class Registry(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'RegistryProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": {"key": "properties", "type": "RegistryProperties"}, + "sku": {"key": "sku", "type": "Sku"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -18560,10 +18827,10 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ super(Registry, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) + self.identity = kwargs.get("identity", None) + self.kind = kwargs.get("kind", None) + self.properties = kwargs["properties"] + self.sku = kwargs.get("sku", None) class RegistryListCredentialsResult(msrest.serialization.Model): @@ -18580,20 +18847,17 @@ class RegistryListCredentialsResult(msrest.serialization.Model): """ _validation = { - 'location': {'readonly': True}, - 'username': {'readonly': True}, + "location": {"readonly": True}, + "username": {"readonly": True}, } _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'username': {'key': 'username', 'type': 'str'}, - 'passwords': {'key': 'passwords', 'type': '[Password]'}, + "location": {"key": "location", "type": "str"}, + "username": {"key": "username", "type": "str"}, + "passwords": {"key": "passwords", "type": "[Password]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword passwords: :paramtype passwords: list[~azure.mgmt.machinelearningservices.models.Password] @@ -18601,7 +18865,7 @@ def __init__( super(RegistryListCredentialsResult, self).__init__(**kwargs) self.location = None self.username = None - self.passwords = kwargs.get('passwords', None) + self.passwords = kwargs.get("passwords", None) class RegistryProperties(ResourceBase): @@ -18634,23 +18898,32 @@ class RegistryProperties(ResourceBase): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, - 'discovery_url': {'key': 'discoveryUrl', 'type': 'str'}, - 'intellectual_property_publisher': {'key': 'intellectualPropertyPublisher', 'type': 'str'}, - 'managed_resource_group': {'key': 'managedResourceGroup', 'type': 'ArmResourceId'}, - 'ml_flow_registry_uri': {'key': 'mlFlowRegistryUri', 'type': 'str'}, - 'private_link_count': {'key': 'privateLinkCount', 'type': 'int'}, - 'region_details': {'key': 'regionDetails', 'type': '[RegistryRegionArmDetails]'}, - 'managed_resource_group_tags': {'key': 'managedResourceGroupTags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "public_network_access": {"key": "publicNetworkAccess", "type": "str"}, + "discovery_url": {"key": "discoveryUrl", "type": "str"}, + "intellectual_property_publisher": { + "key": "intellectualPropertyPublisher", + "type": "str", + }, + "managed_resource_group": { + "key": "managedResourceGroup", + "type": "ArmResourceId", + }, + "ml_flow_registry_uri": {"key": "mlFlowRegistryUri", "type": "str"}, + "private_link_count": {"key": "privateLinkCount", "type": "int"}, + "region_details": { + "key": "regionDetails", + "type": "[RegistryRegionArmDetails]", + }, + "managed_resource_group_tags": { + "key": "managedResourceGroupTags", + "type": "{str}", + }, + } + + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -18678,14 +18951,20 @@ def __init__( :paramtype managed_resource_group_tags: dict[str, str] """ super(RegistryProperties, self).__init__(**kwargs) - self.public_network_access = kwargs.get('public_network_access', None) - self.discovery_url = kwargs.get('discovery_url', None) - self.intellectual_property_publisher = kwargs.get('intellectual_property_publisher', None) - self.managed_resource_group = kwargs.get('managed_resource_group', None) - self.ml_flow_registry_uri = kwargs.get('ml_flow_registry_uri', None) - self.private_link_count = kwargs.get('private_link_count', None) - self.region_details = kwargs.get('region_details', None) - self.managed_resource_group_tags = kwargs.get('managed_resource_group_tags', None) + self.public_network_access = kwargs.get("public_network_access", None) + self.discovery_url = kwargs.get("discovery_url", None) + self.intellectual_property_publisher = kwargs.get( + "intellectual_property_publisher", None + ) + self.managed_resource_group = kwargs.get( + "managed_resource_group", None + ) + self.ml_flow_registry_uri = kwargs.get("ml_flow_registry_uri", None) + self.private_link_count = kwargs.get("private_link_count", None) + self.region_details = kwargs.get("region_details", None) + self.managed_resource_group_tags = kwargs.get( + "managed_resource_group_tags", None + ) class RegistryRegionArmDetails(msrest.serialization.Model): @@ -18701,15 +18980,15 @@ class RegistryRegionArmDetails(msrest.serialization.Model): """ _attribute_map = { - 'acr_details': {'key': 'acrDetails', 'type': '[AcrDetails]'}, - 'location': {'key': 'location', 'type': 'str'}, - 'storage_account_details': {'key': 'storageAccountDetails', 'type': '[StorageAccountDetails]'}, + "acr_details": {"key": "acrDetails", "type": "[AcrDetails]"}, + "location": {"key": "location", "type": "str"}, + "storage_account_details": { + "key": "storageAccountDetails", + "type": "[StorageAccountDetails]", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword acr_details: List of ACR accounts. :paramtype acr_details: list[~azure.mgmt.machinelearningservices.models.AcrDetails] @@ -18720,9 +18999,11 @@ def __init__( list[~azure.mgmt.machinelearningservices.models.StorageAccountDetails] """ super(RegistryRegionArmDetails, self).__init__(**kwargs) - self.acr_details = kwargs.get('acr_details', None) - self.location = kwargs.get('location', None) - self.storage_account_details = kwargs.get('storage_account_details', None) + self.acr_details = kwargs.get("acr_details", None) + self.location = kwargs.get("location", None) + self.storage_account_details = kwargs.get( + "storage_account_details", None + ) class RegistryTrackedResourceArmPaginatedResult(msrest.serialization.Model): @@ -18736,14 +19017,11 @@ class RegistryTrackedResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Registry]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[Registry]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of Registry objects. If null, there are no additional pages. @@ -18751,9 +19029,11 @@ def __init__( :keyword value: An array of objects of type Registry. :paramtype value: list[~azure.mgmt.machinelearningservices.models.Registry] """ - super(RegistryTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(RegistryTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class Regression(AutoMLVertical, TableVertical): @@ -18820,35 +19100,59 @@ class Regression(AutoMLVertical, TableVertical): """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'RegressionTrainingSettings'}, - } - - def __init__( - self, - **kwargs - ): + "task_type": {"required": True}, + "training_data": {"required": True}, + } + + _attribute_map = { + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "TableFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "search_space": { + "key": "searchSpace", + "type": "[TableParameterSubspace]", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "TableSweepSettings", + }, + "test_data": {"key": "testData", "type": "MLTableJobInput"}, + "test_data_size": {"key": "testDataSize", "type": "float"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "weight_column_name": {"key": "weightColumnName", "type": "str"}, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, + "training_settings": { + "key": "trainingSettings", + "type": "RegressionTrainingSettings", + }, + } + + def __init__(self, **kwargs): """ :keyword cv_split_column_names: Columns to use for CVSplit data. :paramtype cv_split_column_names: list[str] @@ -18906,24 +19210,26 @@ def __init__( ~azure.mgmt.machinelearningservices.models.RegressionTrainingSettings """ super(Regression, self).__init__(**kwargs) - self.cv_split_column_names = kwargs.get('cv_split_column_names', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.test_data = kwargs.get('test_data', None) - self.test_data_size = kwargs.get('test_data_size', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.weight_column_name = kwargs.get('weight_column_name', None) - self.task_type = 'Regression' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.training_settings = kwargs.get('training_settings', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.cv_split_column_names = kwargs.get("cv_split_column_names", None) + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.fixed_parameters = kwargs.get("fixed_parameters", None) + self.limit_settings = kwargs.get("limit_settings", None) + self.n_cross_validations = kwargs.get("n_cross_validations", None) + self.search_space = kwargs.get("search_space", None) + self.sweep_settings = kwargs.get("sweep_settings", None) + self.test_data = kwargs.get("test_data", None) + self.test_data_size = kwargs.get("test_data_size", None) + self.validation_data = kwargs.get("validation_data", None) + self.validation_data_size = kwargs.get("validation_data_size", None) + self.weight_column_name = kwargs.get("weight_column_name", None) + self.task_type = "Regression" # type: str + self.primary_metric = kwargs.get("primary_metric", None) + self.training_settings = kwargs.get("training_settings", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class RegressionTrainingSettings(TrainingSettings): @@ -18963,22 +19269,40 @@ class RegressionTrainingSettings(TrainingSettings): """ _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): + "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, + "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, + "training_mode": {"key": "trainingMode", "type": "str"}, + "allowed_training_algorithms": { + "key": "allowedTrainingAlgorithms", + "type": "[str]", + }, + "blocked_training_algorithms": { + "key": "blockedTrainingAlgorithms", + "type": "[str]", + }, + } + + def __init__(self, **kwargs): """ :keyword enable_dnn_training: Enable recommendation of DNN models. :paramtype enable_dnn_training: bool @@ -19013,8 +19337,12 @@ def __init__( ~azure.mgmt.machinelearningservices.models.RegressionModels] """ super(RegressionTrainingSettings, self).__init__(**kwargs) - self.allowed_training_algorithms = kwargs.get('allowed_training_algorithms', None) - self.blocked_training_algorithms = kwargs.get('blocked_training_algorithms', None) + self.allowed_training_algorithms = kwargs.get( + "allowed_training_algorithms", None + ) + self.blocked_training_algorithms = kwargs.get( + "blocked_training_algorithms", None + ) class ResourceId(msrest.serialization.Model): @@ -19027,23 +19355,20 @@ class ResourceId(msrest.serialization.Model): """ _validation = { - 'id': {'required': True}, + "id": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword id: Required. The ID of the resource. :paramtype id: str """ super(ResourceId, self).__init__(**kwargs) - self.id = kwargs['id'] + self.id = kwargs["id"] class ResourceName(msrest.serialization.Model): @@ -19058,21 +19383,17 @@ class ResourceName(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, + "value": {"readonly": True}, + "localized_value": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + "value": {"key": "value", "type": "str"}, + "localized_value": {"key": "localizedValue", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ResourceName, self).__init__(**kwargs) self.value = None self.localized_value = None @@ -19098,29 +19419,28 @@ class ResourceQuota(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'name': {'readonly': True}, - 'limit': {'readonly': True}, - 'unit': {'readonly': True}, + "id": {"readonly": True}, + "aml_workspace_location": {"readonly": True}, + "type": {"readonly": True}, + "name": {"readonly": True}, + "limit": {"readonly": True}, + "unit": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'ResourceName'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "aml_workspace_location": { + "key": "amlWorkspaceLocation", + "type": "str", + }, + "type": {"key": "type", "type": "str"}, + "name": {"key": "name", "type": "ResourceName"}, + "limit": {"key": "limit", "type": "long"}, + "unit": {"key": "unit", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ResourceQuota, self).__init__(**kwargs) self.id = None self.aml_workspace_location = None @@ -19142,19 +19462,16 @@ class Route(msrest.serialization.Model): """ _validation = { - 'path': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'port': {'required': True}, + "path": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "port": {"required": True}, } _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, + "path": {"key": "path", "type": "str"}, + "port": {"key": "port", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword path: Required. [Required] The path for the route. :paramtype path: str @@ -19162,11 +19479,13 @@ def __init__( :paramtype port: int """ super(Route, self).__init__(**kwargs) - self.path = kwargs['path'] - self.port = kwargs['port'] + self.path = kwargs["path"] + self.port = kwargs["port"] -class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class SASAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """SASAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -19191,22 +19510,22 @@ class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionSharedAccessSignature'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionSharedAccessSignature", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: Category of the connection. Possible values include: "PythonFeed", "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", @@ -19223,9 +19542,11 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature """ - super(SASAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'SAS' # type: str - self.credentials = kwargs.get('credentials', None) + super(SASAuthTypeWorkspaceConnectionProperties, self).__init__( + **kwargs + ) + self.auth_type = "SAS" # type: str + self.credentials = kwargs.get("credentials", None) class SasDatastoreCredentials(DatastoreCredentials): @@ -19242,26 +19563,23 @@ class SasDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, + "credentials_type": {"required": True}, + "secrets": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'SasDatastoreSecrets'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "secrets": {"key": "secrets", "type": "SasDatastoreSecrets"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword secrets: Required. [Required] Storage container secrets. :paramtype secrets: ~azure.mgmt.machinelearningservices.models.SasDatastoreSecrets """ super(SasDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Sas' # type: str - self.secrets = kwargs['secrets'] + self.credentials_type = "Sas" # type: str + self.secrets = kwargs["secrets"] class SasDatastoreSecrets(DatastoreSecrets): @@ -19278,25 +19596,22 @@ class SasDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'sas_token': {'key': 'sasToken', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "sas_token": {"key": "sasToken", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword sas_token: Storage container SAS token. :paramtype sas_token: str """ super(SasDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Sas' # type: str - self.sas_token = kwargs.get('sas_token', None) + self.secrets_type = "Sas" # type: str + self.sas_token = kwargs.get("sas_token", None) class ScaleSettings(msrest.serialization.Model): @@ -19314,19 +19629,19 @@ class ScaleSettings(msrest.serialization.Model): """ _validation = { - 'max_node_count': {'required': True}, + "max_node_count": {"required": True}, } _attribute_map = { - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'node_idle_time_before_scale_down': {'key': 'nodeIdleTimeBeforeScaleDown', 'type': 'duration'}, + "max_node_count": {"key": "maxNodeCount", "type": "int"}, + "min_node_count": {"key": "minNodeCount", "type": "int"}, + "node_idle_time_before_scale_down": { + "key": "nodeIdleTimeBeforeScaleDown", + "type": "duration", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword max_node_count: Required. Max number of nodes to use. :paramtype max_node_count: int @@ -19337,9 +19652,11 @@ def __init__( :paramtype node_idle_time_before_scale_down: ~datetime.timedelta """ super(ScaleSettings, self).__init__(**kwargs) - self.max_node_count = kwargs['max_node_count'] - self.min_node_count = kwargs.get('min_node_count', 0) - self.node_idle_time_before_scale_down = kwargs.get('node_idle_time_before_scale_down', None) + self.max_node_count = kwargs["max_node_count"] + self.min_node_count = kwargs.get("min_node_count", 0) + self.node_idle_time_before_scale_down = kwargs.get( + "node_idle_time_before_scale_down", None + ) class ScaleSettingsInformation(msrest.serialization.Model): @@ -19350,19 +19667,16 @@ class ScaleSettingsInformation(msrest.serialization.Model): """ _attribute_map = { - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, + "scale_settings": {"key": "scaleSettings", "type": "ScaleSettings"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword scale_settings: scale settings for AML Compute. :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings """ super(ScaleSettingsInformation, self).__init__(**kwargs) - self.scale_settings = kwargs.get('scale_settings', None) + self.scale_settings = kwargs.get("scale_settings", None) class Schedule(Resource): @@ -19388,31 +19702,28 @@ class Schedule(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ScheduleProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "ScheduleProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ScheduleProperties """ super(Schedule, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class ScheduleBase(msrest.serialization.Model): @@ -19430,15 +19741,12 @@ class ScheduleBase(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "provisioning_status": {"key": "provisioningStatus", "type": "str"}, + "status": {"key": "status", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword id: A system assigned id for the schedule. :paramtype id: str @@ -19451,9 +19759,9 @@ def __init__( :paramtype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus """ super(ScheduleBase, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.provisioning_status = kwargs.get('provisioning_status', None) - self.status = kwargs.get('status', None) + self.id = kwargs.get("id", None) + self.provisioning_status = kwargs.get("provisioning_status", None) + self.status = kwargs.get("status", None) class ScheduleProperties(ResourceBase): @@ -19484,26 +19792,23 @@ class ScheduleProperties(ResourceBase): """ _validation = { - 'action': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'trigger': {'required': True}, + "action": {"required": True}, + "provisioning_state": {"readonly": True}, + "trigger": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'action': {'key': 'action', 'type': 'ScheduleActionBase'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'trigger': {'key': 'trigger', 'type': 'TriggerBase'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "action": {"key": "action", "type": "ScheduleActionBase"}, + "display_name": {"key": "displayName", "type": "str"}, + "is_enabled": {"key": "isEnabled", "type": "bool"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "trigger": {"key": "trigger", "type": "TriggerBase"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -19521,11 +19826,11 @@ def __init__( :paramtype trigger: ~azure.mgmt.machinelearningservices.models.TriggerBase """ super(ScheduleProperties, self).__init__(**kwargs) - self.action = kwargs['action'] - self.display_name = kwargs.get('display_name', None) - self.is_enabled = kwargs.get('is_enabled', True) + self.action = kwargs["action"] + self.display_name = kwargs.get("display_name", None) + self.is_enabled = kwargs.get("is_enabled", True) self.provisioning_state = None - self.trigger = kwargs['trigger'] + self.trigger = kwargs["trigger"] class ScheduleResourceArmPaginatedResult(msrest.serialization.Model): @@ -19539,14 +19844,11 @@ class ScheduleResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Schedule]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[Schedule]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of Schedule objects. If null, there are no additional pages. @@ -19555,8 +19857,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.Schedule] """ super(ScheduleResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class ScriptReference(msrest.serialization.Model): @@ -19573,16 +19875,13 @@ class ScriptReference(msrest.serialization.Model): """ _attribute_map = { - 'script_source': {'key': 'scriptSource', 'type': 'str'}, - 'script_data': {'key': 'scriptData', 'type': 'str'}, - 'script_arguments': {'key': 'scriptArguments', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'str'}, + "script_source": {"key": "scriptSource", "type": "str"}, + "script_data": {"key": "scriptData", "type": "str"}, + "script_arguments": {"key": "scriptArguments", "type": "str"}, + "timeout": {"key": "timeout", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword script_source: The storage source of the script: inline, workspace. :paramtype script_source: str @@ -19594,10 +19893,10 @@ def __init__( :paramtype timeout: str """ super(ScriptReference, self).__init__(**kwargs) - self.script_source = kwargs.get('script_source', None) - self.script_data = kwargs.get('script_data', None) - self.script_arguments = kwargs.get('script_arguments', None) - self.timeout = kwargs.get('timeout', None) + self.script_source = kwargs.get("script_source", None) + self.script_data = kwargs.get("script_data", None) + self.script_arguments = kwargs.get("script_arguments", None) + self.timeout = kwargs.get("timeout", None) class ScriptsToExecute(msrest.serialization.Model): @@ -19610,14 +19909,14 @@ class ScriptsToExecute(msrest.serialization.Model): """ _attribute_map = { - 'startup_script': {'key': 'startupScript', 'type': 'ScriptReference'}, - 'creation_script': {'key': 'creationScript', 'type': 'ScriptReference'}, + "startup_script": {"key": "startupScript", "type": "ScriptReference"}, + "creation_script": { + "key": "creationScript", + "type": "ScriptReference", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword startup_script: Script that's run every time the machine starts. :paramtype startup_script: ~azure.mgmt.machinelearningservices.models.ScriptReference @@ -19625,8 +19924,8 @@ def __init__( :paramtype creation_script: ~azure.mgmt.machinelearningservices.models.ScriptReference """ super(ScriptsToExecute, self).__init__(**kwargs) - self.startup_script = kwargs.get('startup_script', None) - self.creation_script = kwargs.get('creation_script', None) + self.startup_script = kwargs.get("startup_script", None) + self.creation_script = kwargs.get("creation_script", None) class ServiceManagedResourcesSettings(msrest.serialization.Model): @@ -19637,22 +19936,21 @@ class ServiceManagedResourcesSettings(msrest.serialization.Model): """ _attribute_map = { - 'cosmos_db': {'key': 'cosmosDb', 'type': 'CosmosDbSettings'}, + "cosmos_db": {"key": "cosmosDb", "type": "CosmosDbSettings"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword cosmos_db: The settings for the service managed cosmosdb account. :paramtype cosmos_db: ~azure.mgmt.machinelearningservices.models.CosmosDbSettings """ super(ServiceManagedResourcesSettings, self).__init__(**kwargs) - self.cosmos_db = kwargs.get('cosmos_db', None) + self.cosmos_db = kwargs.get("cosmos_db", None) -class ServicePrincipalAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class ServicePrincipalAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """ServicePrincipalAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -19677,22 +19975,22 @@ class ServicePrincipalAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionP """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionServicePrincipal'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionServicePrincipal", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: Category of the connection. Possible values include: "PythonFeed", "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", @@ -19709,9 +20007,11 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionServicePrincipal """ - super(ServicePrincipalAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'ServicePrincipal' # type: str - self.credentials = kwargs.get('credentials', None) + super( + ServicePrincipalAuthTypeWorkspaceConnectionProperties, self + ).__init__(**kwargs) + self.auth_type = "ServicePrincipal" # type: str + self.credentials = kwargs.get("credentials", None) class ServicePrincipalDatastoreCredentials(DatastoreCredentials): @@ -19736,25 +20036,25 @@ class ServicePrincipalDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, + "credentials_type": {"required": True}, + "client_id": {"required": True}, + "secrets": {"required": True}, + "tenant_id": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'ServicePrincipalDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "authority_url": {"key": "authorityUrl", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + "resource_url": {"key": "resourceUrl", "type": "str"}, + "secrets": { + "key": "secrets", + "type": "ServicePrincipalDatastoreSecrets", + }, + "tenant_id": {"key": "tenantId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword authority_url: Authority URL used for authentication. :paramtype authority_url: str @@ -19769,12 +20069,12 @@ def __init__( :paramtype tenant_id: str """ super(ServicePrincipalDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'ServicePrincipal' # type: str - self.authority_url = kwargs.get('authority_url', None) - self.client_id = kwargs['client_id'] - self.resource_url = kwargs.get('resource_url', None) - self.secrets = kwargs['secrets'] - self.tenant_id = kwargs['tenant_id'] + self.credentials_type = "ServicePrincipal" # type: str + self.authority_url = kwargs.get("authority_url", None) + self.client_id = kwargs["client_id"] + self.resource_url = kwargs.get("resource_url", None) + self.secrets = kwargs["secrets"] + self.tenant_id = kwargs["tenant_id"] class ServicePrincipalDatastoreSecrets(DatastoreSecrets): @@ -19791,25 +20091,22 @@ class ServicePrincipalDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "client_secret": {"key": "clientSecret", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword client_secret: Service principal secret. :paramtype client_secret: str """ super(ServicePrincipalDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'ServicePrincipal' # type: str - self.client_secret = kwargs.get('client_secret', None) + self.secrets_type = "ServicePrincipal" # type: str + self.client_secret = kwargs.get("client_secret", None) class ServiceTagDestination(msrest.serialization.Model): @@ -19824,15 +20121,12 @@ class ServiceTagDestination(msrest.serialization.Model): """ _attribute_map = { - 'service_tag': {'key': 'serviceTag', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'port_ranges': {'key': 'portRanges', 'type': 'str'}, + "service_tag": {"key": "serviceTag", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "port_ranges": {"key": "portRanges", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword service_tag: :paramtype service_tag: str @@ -19842,9 +20136,9 @@ def __init__( :paramtype port_ranges: str """ super(ServiceTagDestination, self).__init__(**kwargs) - self.service_tag = kwargs.get('service_tag', None) - self.protocol = kwargs.get('protocol', None) - self.port_ranges = kwargs.get('port_ranges', None) + self.service_tag = kwargs.get("service_tag", None) + self.protocol = kwargs.get("protocol", None) + self.port_ranges = kwargs.get("port_ranges", None) class ServiceTagOutboundRule(OutboundRule): @@ -19868,20 +20162,17 @@ class ServiceTagOutboundRule(OutboundRule): """ _validation = { - 'type': {'required': True}, + "type": {"required": True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'ServiceTagDestination'}, + "type": {"key": "type", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "destination": {"key": "destination", "type": "ServiceTagDestination"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword status: Status of a managed network Outbound Rule of a machine learning workspace. Possible values include: "Inactive", "Active". @@ -19894,8 +20185,8 @@ def __init__( :paramtype destination: ~azure.mgmt.machinelearningservices.models.ServiceTagDestination """ super(ServiceTagOutboundRule, self).__init__(**kwargs) - self.type = 'ServiceTag' # type: str - self.destination = kwargs.get('destination', None) + self.type = "ServiceTag" # type: str + self.destination = kwargs.get("destination", None) class SetupScripts(msrest.serialization.Model): @@ -19906,19 +20197,16 @@ class SetupScripts(msrest.serialization.Model): """ _attribute_map = { - 'scripts': {'key': 'scripts', 'type': 'ScriptsToExecute'}, + "scripts": {"key": "scripts", "type": "ScriptsToExecute"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword scripts: Customized setup scripts. :paramtype scripts: ~azure.mgmt.machinelearningservices.models.ScriptsToExecute """ super(SetupScripts, self).__init__(**kwargs) - self.scripts = kwargs.get('scripts', None) + self.scripts = kwargs.get("scripts", None) class SharedPrivateLinkResource(msrest.serialization.Model): @@ -19940,17 +20228,17 @@ class SharedPrivateLinkResource(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'private_link_resource_id': {'key': 'properties.privateLinkResourceId', 'type': 'str'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'request_message': {'key': 'properties.requestMessage', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "private_link_resource_id": { + "key": "properties.privateLinkResourceId", + "type": "str", + }, + "group_id": {"key": "properties.groupId", "type": "str"}, + "request_message": {"key": "properties.requestMessage", "type": "str"}, + "status": {"key": "properties.status", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: Unique name of the private link. :paramtype name: str @@ -19967,11 +20255,13 @@ def __init__( ~azure.mgmt.machinelearningservices.models.PrivateEndpointServiceConnectionStatus """ super(SharedPrivateLinkResource, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.private_link_resource_id = kwargs.get('private_link_resource_id', None) - self.group_id = kwargs.get('group_id', None) - self.request_message = kwargs.get('request_message', None) - self.status = kwargs.get('status', None) + self.name = kwargs.get("name", None) + self.private_link_resource_id = kwargs.get( + "private_link_resource_id", None + ) + self.group_id = kwargs.get("group_id", None) + self.request_message = kwargs.get("request_message", None) + self.status = kwargs.get("status", None) class Sku(msrest.serialization.Model): @@ -19997,21 +20287,18 @@ class Sku(msrest.serialization.Model): """ _validation = { - 'name': {'required': True}, + "name": {"required": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'int'}, + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, + "size": {"key": "size", "type": "str"}, + "family": {"key": "family", "type": "str"}, + "capacity": {"key": "capacity", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code. :paramtype name: str @@ -20030,11 +20317,11 @@ def __init__( :paramtype capacity: int """ super(Sku, self).__init__(**kwargs) - self.name = kwargs['name'] - self.tier = kwargs.get('tier', None) - self.size = kwargs.get('size', None) - self.family = kwargs.get('family', None) - self.capacity = kwargs.get('capacity', None) + self.name = kwargs["name"] + self.tier = kwargs.get("tier", None) + self.size = kwargs.get("size", None) + self.family = kwargs.get("family", None) + self.capacity = kwargs.get("capacity", None) class SkuCapacity(msrest.serialization.Model): @@ -20052,16 +20339,13 @@ class SkuCapacity(msrest.serialization.Model): """ _attribute_map = { - 'default': {'key': 'default', 'type': 'int'}, - 'maximum': {'key': 'maximum', 'type': 'int'}, - 'minimum': {'key': 'minimum', 'type': 'int'}, - 'scale_type': {'key': 'scaleType', 'type': 'str'}, + "default": {"key": "default", "type": "int"}, + "maximum": {"key": "maximum", "type": "int"}, + "minimum": {"key": "minimum", "type": "int"}, + "scale_type": {"key": "scaleType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword default: Gets or sets the default capacity. :paramtype default: int @@ -20074,10 +20358,10 @@ def __init__( :paramtype scale_type: str or ~azure.mgmt.machinelearningservices.models.SkuScaleType """ super(SkuCapacity, self).__init__(**kwargs) - self.default = kwargs.get('default', 0) - self.maximum = kwargs.get('maximum', 0) - self.minimum = kwargs.get('minimum', 0) - self.scale_type = kwargs.get('scale_type', None) + self.default = kwargs.get("default", 0) + self.maximum = kwargs.get("maximum", 0) + self.minimum = kwargs.get("minimum", 0) + self.scale_type = kwargs.get("scale_type", None) class SkuResource(msrest.serialization.Model): @@ -20094,19 +20378,16 @@ class SkuResource(msrest.serialization.Model): """ _validation = { - 'resource_type': {'readonly': True}, + "resource_type": {"readonly": True}, } _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'SkuSetting'}, + "capacity": {"key": "capacity", "type": "SkuCapacity"}, + "resource_type": {"key": "resourceType", "type": "str"}, + "sku": {"key": "sku", "type": "SkuSetting"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword capacity: Gets or sets the Sku Capacity. :paramtype capacity: ~azure.mgmt.machinelearningservices.models.SkuCapacity @@ -20114,9 +20395,9 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.SkuSetting """ super(SkuResource, self).__init__(**kwargs) - self.capacity = kwargs.get('capacity', None) + self.capacity = kwargs.get("capacity", None) self.resource_type = None - self.sku = kwargs.get('sku', None) + self.sku = kwargs.get("sku", None) class SkuResourceArmPaginatedResult(msrest.serialization.Model): @@ -20130,14 +20411,11 @@ class SkuResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[SkuResource]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[SkuResource]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of SkuResource objects. If null, there are no additional pages. @@ -20146,8 +20424,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.SkuResource] """ super(SkuResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class SkuSetting(msrest.serialization.Model): @@ -20165,18 +20443,15 @@ class SkuSetting(msrest.serialization.Model): """ _validation = { - 'name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: Required. [Required] The name of the SKU. Ex - P3. It is typically a letter+number code. @@ -20187,8 +20462,8 @@ def __init__( :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier """ super(SkuSetting, self).__init__(**kwargs) - self.name = kwargs['name'] - self.tier = kwargs.get('tier', None) + self.name = kwargs["name"] + self.tier = kwargs.get("tier", None) class SparkJob(JobBaseProperties): @@ -20256,43 +20531,43 @@ class SparkJob(JobBaseProperties): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'code_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'entry': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'archives': {'key': 'archives', 'type': '[str]'}, - 'args': {'key': 'args', 'type': 'str'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'conf': {'key': 'conf', 'type': '{str}'}, - 'entry': {'key': 'entry', 'type': 'SparkJobEntry'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'files': {'key': 'files', 'type': '[str]'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'jars': {'key': 'jars', 'type': '[str]'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'py_files': {'key': 'pyFiles', 'type': '[str]'}, - 'resources': {'key': 'resources', 'type': 'SparkResourceConfiguration'}, - } - - def __init__( - self, - **kwargs - ): + "job_type": {"required": True}, + "status": {"readonly": True}, + "code_id": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "entry": {"required": True}, + } + + _attribute_map = { + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "archives": {"key": "archives", "type": "[str]"}, + "args": {"key": "args", "type": "str"}, + "code_id": {"key": "codeId", "type": "str"}, + "conf": {"key": "conf", "type": "{str}"}, + "entry": {"key": "entry", "type": "SparkJobEntry"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "files": {"key": "files", "type": "[str]"}, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "jars": {"key": "jars", "type": "[str]"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "py_files": {"key": "pyFiles", "type": "[str]"}, + "resources": { + "key": "resources", + "type": "SparkResourceConfiguration", + }, + } + + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -20344,19 +20619,19 @@ def __init__( :paramtype resources: ~azure.mgmt.machinelearningservices.models.SparkResourceConfiguration """ super(SparkJob, self).__init__(**kwargs) - self.job_type = 'Spark' # type: str - self.archives = kwargs.get('archives', None) - self.args = kwargs.get('args', None) - self.code_id = kwargs['code_id'] - self.conf = kwargs.get('conf', None) - self.entry = kwargs['entry'] - self.environment_id = kwargs.get('environment_id', None) - self.files = kwargs.get('files', None) - self.inputs = kwargs.get('inputs', None) - self.jars = kwargs.get('jars', None) - self.outputs = kwargs.get('outputs', None) - self.py_files = kwargs.get('py_files', None) - self.resources = kwargs.get('resources', None) + self.job_type = "Spark" # type: str + self.archives = kwargs.get("archives", None) + self.args = kwargs.get("args", None) + self.code_id = kwargs["code_id"] + self.conf = kwargs.get("conf", None) + self.entry = kwargs["entry"] + self.environment_id = kwargs.get("environment_id", None) + self.files = kwargs.get("files", None) + self.inputs = kwargs.get("inputs", None) + self.jars = kwargs.get("jars", None) + self.outputs = kwargs.get("outputs", None) + self.py_files = kwargs.get("py_files", None) + self.resources = kwargs.get("resources", None) class SparkJobEntry(msrest.serialization.Model): @@ -20374,23 +20649,22 @@ class SparkJobEntry(msrest.serialization.Model): """ _validation = { - 'spark_job_entry_type': {'required': True}, + "spark_job_entry_type": {"required": True}, } _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, + "spark_job_entry_type": {"key": "sparkJobEntryType", "type": "str"}, } _subtype_map = { - 'spark_job_entry_type': {'SparkJobPythonEntry': 'SparkJobPythonEntry', 'SparkJobScalaEntry': 'SparkJobScalaEntry'} + "spark_job_entry_type": { + "SparkJobPythonEntry": "SparkJobPythonEntry", + "SparkJobScalaEntry": "SparkJobScalaEntry", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(SparkJobEntry, self).__init__(**kwargs) self.spark_job_entry_type = None # type: Optional[str] @@ -20409,26 +20683,27 @@ class SparkJobPythonEntry(SparkJobEntry): """ _validation = { - 'spark_job_entry_type': {'required': True}, - 'file': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "spark_job_entry_type": {"required": True}, + "file": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - 'file': {'key': 'file', 'type': 'str'}, + "spark_job_entry_type": {"key": "sparkJobEntryType", "type": "str"}, + "file": {"key": "file", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword file: Required. [Required] Relative python file path for job entry point. :paramtype file: str """ super(SparkJobPythonEntry, self).__init__(**kwargs) - self.spark_job_entry_type = 'SparkJobPythonEntry' # type: str - self.file = kwargs['file'] + self.spark_job_entry_type = "SparkJobPythonEntry" # type: str + self.file = kwargs["file"] class SparkJobScalaEntry(SparkJobEntry): @@ -20445,26 +20720,27 @@ class SparkJobScalaEntry(SparkJobEntry): """ _validation = { - 'spark_job_entry_type': {'required': True}, - 'class_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "spark_job_entry_type": {"required": True}, + "class_name": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - 'class_name': {'key': 'className', 'type': 'str'}, + "spark_job_entry_type": {"key": "sparkJobEntryType", "type": "str"}, + "class_name": {"key": "className", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword class_name: Required. [Required] Scala class name used as entry point. :paramtype class_name: str """ super(SparkJobScalaEntry, self).__init__(**kwargs) - self.spark_job_entry_type = 'SparkJobScalaEntry' # type: str - self.class_name = kwargs['class_name'] + self.spark_job_entry_type = "SparkJobScalaEntry" # type: str + self.class_name = kwargs["class_name"] class SparkResourceConfiguration(msrest.serialization.Model): @@ -20477,14 +20753,11 @@ class SparkResourceConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, + "instance_type": {"key": "instanceType", "type": "str"}, + "runtime_version": {"key": "runtimeVersion", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword instance_type: Optional type of VM used as supported by the compute target. :paramtype instance_type: str @@ -20492,8 +20765,8 @@ def __init__( :paramtype runtime_version: str """ super(SparkResourceConfiguration, self).__init__(**kwargs) - self.instance_type = kwargs.get('instance_type', None) - self.runtime_version = kwargs.get('runtime_version', "3.1") + self.instance_type = kwargs.get("instance_type", None) + self.runtime_version = kwargs.get("runtime_version", "3.1") class SslConfiguration(msrest.serialization.Model): @@ -20515,18 +20788,18 @@ class SslConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'cert': {'key': 'cert', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - 'cname': {'key': 'cname', 'type': 'str'}, - 'leaf_domain_label': {'key': 'leafDomainLabel', 'type': 'str'}, - 'overwrite_existing_domain': {'key': 'overwriteExistingDomain', 'type': 'bool'}, + "status": {"key": "status", "type": "str"}, + "cert": {"key": "cert", "type": "str"}, + "key": {"key": "key", "type": "str"}, + "cname": {"key": "cname", "type": "str"}, + "leaf_domain_label": {"key": "leafDomainLabel", "type": "str"}, + "overwrite_existing_domain": { + "key": "overwriteExistingDomain", + "type": "bool", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword status: Enable or disable ssl for scoring. Possible values include: "Disabled", "Enabled", "Auto". @@ -20543,12 +20816,14 @@ def __init__( :paramtype overwrite_existing_domain: bool """ super(SslConfiguration, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.cert = kwargs.get('cert', None) - self.key = kwargs.get('key', None) - self.cname = kwargs.get('cname', None) - self.leaf_domain_label = kwargs.get('leaf_domain_label', None) - self.overwrite_existing_domain = kwargs.get('overwrite_existing_domain', None) + self.status = kwargs.get("status", None) + self.cert = kwargs.get("cert", None) + self.key = kwargs.get("key", None) + self.cname = kwargs.get("cname", None) + self.leaf_domain_label = kwargs.get("leaf_domain_label", None) + self.overwrite_existing_domain = kwargs.get( + "overwrite_existing_domain", None + ) class StackEnsembleSettings(msrest.serialization.Model): @@ -20570,15 +20845,21 @@ class StackEnsembleSettings(msrest.serialization.Model): """ _attribute_map = { - 'stack_meta_learner_k_wargs': {'key': 'stackMetaLearnerKWargs', 'type': 'object'}, - 'stack_meta_learner_train_percentage': {'key': 'stackMetaLearnerTrainPercentage', 'type': 'float'}, - 'stack_meta_learner_type': {'key': 'stackMetaLearnerType', 'type': 'str'}, + "stack_meta_learner_k_wargs": { + "key": "stackMetaLearnerKWargs", + "type": "object", + }, + "stack_meta_learner_train_percentage": { + "key": "stackMetaLearnerTrainPercentage", + "type": "float", + }, + "stack_meta_learner_type": { + "key": "stackMetaLearnerType", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword stack_meta_learner_k_wargs: Optional parameters to pass to the initializer of the meta-learner. @@ -20595,9 +20876,15 @@ def __init__( ~azure.mgmt.machinelearningservices.models.StackMetaLearnerType """ super(StackEnsembleSettings, self).__init__(**kwargs) - self.stack_meta_learner_k_wargs = kwargs.get('stack_meta_learner_k_wargs', None) - self.stack_meta_learner_train_percentage = kwargs.get('stack_meta_learner_train_percentage', 0.2) - self.stack_meta_learner_type = kwargs.get('stack_meta_learner_type', None) + self.stack_meta_learner_k_wargs = kwargs.get( + "stack_meta_learner_k_wargs", None + ) + self.stack_meta_learner_train_percentage = kwargs.get( + "stack_meta_learner_train_percentage", 0.2 + ) + self.stack_meta_learner_type = kwargs.get( + "stack_meta_learner_type", None + ) class StatusMessage(msrest.serialization.Model): @@ -20617,25 +20904,21 @@ class StatusMessage(msrest.serialization.Model): """ _validation = { - 'code': {'readonly': True}, - 'created_date_time': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, + "code": {"readonly": True}, + "created_date_time": {"readonly": True}, + "level": {"readonly": True}, + "message": {"readonly": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, + "code": {"key": "code", "type": "str"}, + "created_date_time": {"key": "createdDateTime", "type": "iso-8601"}, + "level": {"key": "level", "type": "str"}, + "message": {"key": "message", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(StatusMessage, self).__init__(**kwargs) self.code = None self.created_date_time = None @@ -20655,14 +20938,17 @@ class StorageAccountDetails(msrest.serialization.Model): """ _attribute_map = { - 'system_created_storage_account': {'key': 'systemCreatedStorageAccount', 'type': 'SystemCreatedStorageAccount'}, - 'user_created_storage_account': {'key': 'userCreatedStorageAccount', 'type': 'UserCreatedStorageAccount'}, + "system_created_storage_account": { + "key": "systemCreatedStorageAccount", + "type": "SystemCreatedStorageAccount", + }, + "user_created_storage_account": { + "key": "userCreatedStorageAccount", + "type": "UserCreatedStorageAccount", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword system_created_storage_account: :paramtype system_created_storage_account: @@ -20672,8 +20958,12 @@ def __init__( ~azure.mgmt.machinelearningservices.models.UserCreatedStorageAccount """ super(StorageAccountDetails, self).__init__(**kwargs) - self.system_created_storage_account = kwargs.get('system_created_storage_account', None) - self.user_created_storage_account = kwargs.get('user_created_storage_account', None) + self.system_created_storage_account = kwargs.get( + "system_created_storage_account", None + ) + self.user_created_storage_account = kwargs.get( + "user_created_storage_account", None + ) class SweepJob(JobBaseProperties): @@ -20735,41 +21025,44 @@ class SweepJob(JobBaseProperties): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'objective': {'required': True}, - 'sampling_algorithm': {'required': True}, - 'search_space': {'required': True}, - 'trial': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'SweepJobLimits'}, - 'objective': {'key': 'objective', 'type': 'Objective'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'SamplingAlgorithm'}, - 'search_space': {'key': 'searchSpace', 'type': 'object'}, - 'trial': {'key': 'trial', 'type': 'TrialComponent'}, - } - - def __init__( - self, - **kwargs - ): + "job_type": {"required": True}, + "status": {"readonly": True}, + "objective": {"required": True}, + "sampling_algorithm": {"required": True}, + "search_space": {"required": True}, + "trial": {"required": True}, + } + + _attribute_map = { + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "limits": {"key": "limits", "type": "SweepJobLimits"}, + "objective": {"key": "objective", "type": "Objective"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "sampling_algorithm": { + "key": "samplingAlgorithm", + "type": "SamplingAlgorithm", + }, + "search_space": {"key": "searchSpace", "type": "object"}, + "trial": {"key": "trial", "type": "TrialComponent"}, + } + + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -20815,15 +21108,15 @@ def __init__( :paramtype trial: ~azure.mgmt.machinelearningservices.models.TrialComponent """ super(SweepJob, self).__init__(**kwargs) - self.job_type = 'Sweep' # type: str - self.early_termination = kwargs.get('early_termination', None) - self.inputs = kwargs.get('inputs', None) - self.limits = kwargs.get('limits', None) - self.objective = kwargs['objective'] - self.outputs = kwargs.get('outputs', None) - self.sampling_algorithm = kwargs['sampling_algorithm'] - self.search_space = kwargs['search_space'] - self.trial = kwargs['trial'] + self.job_type = "Sweep" # type: str + self.early_termination = kwargs.get("early_termination", None) + self.inputs = kwargs.get("inputs", None) + self.limits = kwargs.get("limits", None) + self.objective = kwargs["objective"] + self.outputs = kwargs.get("outputs", None) + self.sampling_algorithm = kwargs["sampling_algorithm"] + self.search_space = kwargs["search_space"] + self.trial = kwargs["trial"] class SweepJobLimits(JobLimits): @@ -20846,21 +21139,18 @@ class SweepJobLimits(JobLimits): """ _validation = { - 'job_limits_type': {'required': True}, + "job_limits_type": {"required": True}, } _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_total_trials': {'key': 'maxTotalTrials', 'type': 'int'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, + "job_limits_type": {"key": "jobLimitsType", "type": "str"}, + "timeout": {"key": "timeout", "type": "duration"}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_total_trials": {"key": "maxTotalTrials", "type": "int"}, + "trial_timeout": {"key": "trialTimeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. Only supports duration with precision as low as Seconds. @@ -20873,10 +21163,10 @@ def __init__( :paramtype trial_timeout: ~datetime.timedelta """ super(SweepJobLimits, self).__init__(**kwargs) - self.job_limits_type = 'Sweep' # type: str - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', None) - self.max_total_trials = kwargs.get('max_total_trials', None) - self.trial_timeout = kwargs.get('trial_timeout', None) + self.job_limits_type = "Sweep" # type: str + self.max_concurrent_trials = kwargs.get("max_concurrent_trials", None) + self.max_total_trials = kwargs.get("max_total_trials", None) + self.trial_timeout = kwargs.get("trial_timeout", None) class SynapseSpark(Compute): @@ -20918,32 +21208,32 @@ class SynapseSpark(Compute): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'SynapseSparkProperties'}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, + "properties": {"key": "properties", "type": "SynapseSparkProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword compute_location: Location for the underlying compute. :paramtype compute_location: str @@ -20958,8 +21248,8 @@ def __init__( :paramtype properties: ~azure.mgmt.machinelearningservices.models.SynapseSparkProperties """ super(SynapseSpark, self).__init__(**kwargs) - self.compute_type = 'SynapseSpark' # type: str - self.properties = kwargs.get('properties', None) + self.compute_type = "SynapseSpark" # type: str + self.properties = kwargs.get("properties", None) class SynapseSparkProperties(msrest.serialization.Model): @@ -20988,22 +21278,25 @@ class SynapseSparkProperties(msrest.serialization.Model): """ _attribute_map = { - 'auto_scale_properties': {'key': 'autoScaleProperties', 'type': 'AutoScaleProperties'}, - 'auto_pause_properties': {'key': 'autoPauseProperties', 'type': 'AutoPauseProperties'}, - 'spark_version': {'key': 'sparkVersion', 'type': 'str'}, - 'node_count': {'key': 'nodeCount', 'type': 'int'}, - 'node_size': {'key': 'nodeSize', 'type': 'str'}, - 'node_size_family': {'key': 'nodeSizeFamily', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'workspace_name': {'key': 'workspaceName', 'type': 'str'}, - 'pool_name': {'key': 'poolName', 'type': 'str'}, + "auto_scale_properties": { + "key": "autoScaleProperties", + "type": "AutoScaleProperties", + }, + "auto_pause_properties": { + "key": "autoPauseProperties", + "type": "AutoPauseProperties", + }, + "spark_version": {"key": "sparkVersion", "type": "str"}, + "node_count": {"key": "nodeCount", "type": "int"}, + "node_size": {"key": "nodeSize", "type": "str"}, + "node_size_family": {"key": "nodeSizeFamily", "type": "str"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, + "resource_group": {"key": "resourceGroup", "type": "str"}, + "workspace_name": {"key": "workspaceName", "type": "str"}, + "pool_name": {"key": "poolName", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword auto_scale_properties: Auto scale properties. :paramtype auto_scale_properties: @@ -21029,16 +21322,16 @@ def __init__( :paramtype pool_name: str """ super(SynapseSparkProperties, self).__init__(**kwargs) - self.auto_scale_properties = kwargs.get('auto_scale_properties', None) - self.auto_pause_properties = kwargs.get('auto_pause_properties', None) - self.spark_version = kwargs.get('spark_version', None) - self.node_count = kwargs.get('node_count', None) - self.node_size = kwargs.get('node_size', None) - self.node_size_family = kwargs.get('node_size_family', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.resource_group = kwargs.get('resource_group', None) - self.workspace_name = kwargs.get('workspace_name', None) - self.pool_name = kwargs.get('pool_name', None) + self.auto_scale_properties = kwargs.get("auto_scale_properties", None) + self.auto_pause_properties = kwargs.get("auto_pause_properties", None) + self.spark_version = kwargs.get("spark_version", None) + self.node_count = kwargs.get("node_count", None) + self.node_size = kwargs.get("node_size", None) + self.node_size_family = kwargs.get("node_size_family", None) + self.subscription_id = kwargs.get("subscription_id", None) + self.resource_group = kwargs.get("resource_group", None) + self.workspace_name = kwargs.get("workspace_name", None) + self.pool_name = kwargs.get("pool_name", None) class SystemCreatedAcrAccount(msrest.serialization.Model): @@ -21051,14 +21344,11 @@ class SystemCreatedAcrAccount(msrest.serialization.Model): """ _attribute_map = { - 'acr_account_sku': {'key': 'acrAccountSku', 'type': 'str'}, - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, + "acr_account_sku": {"key": "acrAccountSku", "type": "str"}, + "arm_resource_id": {"key": "armResourceId", "type": "ArmResourceId"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword acr_account_sku: :paramtype acr_account_sku: str @@ -21066,8 +21356,8 @@ def __init__( :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId """ super(SystemCreatedAcrAccount, self).__init__(**kwargs) - self.acr_account_sku = kwargs.get('acr_account_sku', None) - self.arm_resource_id = kwargs.get('arm_resource_id', None) + self.acr_account_sku = kwargs.get("acr_account_sku", None) + self.arm_resource_id = kwargs.get("arm_resource_id", None) class SystemCreatedStorageAccount(msrest.serialization.Model): @@ -21092,16 +21382,19 @@ class SystemCreatedStorageAccount(msrest.serialization.Model): """ _attribute_map = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - 'storage_account_hns_enabled': {'key': 'storageAccountHnsEnabled', 'type': 'bool'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, - 'allow_blob_public_access': {'key': 'allowBlobPublicAccess', 'type': 'bool'}, + "arm_resource_id": {"key": "armResourceId", "type": "ArmResourceId"}, + "storage_account_hns_enabled": { + "key": "storageAccountHnsEnabled", + "type": "bool", + }, + "storage_account_type": {"key": "storageAccountType", "type": "str"}, + "allow_blob_public_access": { + "key": "allowBlobPublicAccess", + "type": "bool", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword arm_resource_id: ARM ResourceId of a resource. :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId @@ -21121,10 +21414,14 @@ def __init__( :paramtype allow_blob_public_access: bool """ super(SystemCreatedStorageAccount, self).__init__(**kwargs) - self.arm_resource_id = kwargs.get('arm_resource_id', None) - self.storage_account_hns_enabled = kwargs.get('storage_account_hns_enabled', None) - self.storage_account_type = kwargs.get('storage_account_type', None) - self.allow_blob_public_access = kwargs.get('allow_blob_public_access', None) + self.arm_resource_id = kwargs.get("arm_resource_id", None) + self.storage_account_hns_enabled = kwargs.get( + "storage_account_hns_enabled", None + ) + self.storage_account_type = kwargs.get("storage_account_type", None) + self.allow_blob_public_access = kwargs.get( + "allow_blob_public_access", None + ) class SystemData(msrest.serialization.Model): @@ -21147,18 +21444,15 @@ class SystemData(msrest.serialization.Model): """ _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + "created_by": {"key": "createdBy", "type": "str"}, + "created_by_type": {"key": "createdByType", "type": "str"}, + "created_at": {"key": "createdAt", "type": "iso-8601"}, + "last_modified_by": {"key": "lastModifiedBy", "type": "str"}, + "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"}, + "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword created_by: The identity that created the resource. :paramtype created_by: str @@ -21177,12 +21471,12 @@ def __init__( :paramtype last_modified_at: ~datetime.datetime """ super(SystemData, self).__init__(**kwargs) - self.created_by = kwargs.get('created_by', None) - self.created_by_type = kwargs.get('created_by_type', None) - self.created_at = kwargs.get('created_at', None) - self.last_modified_by = kwargs.get('last_modified_by', None) - self.last_modified_by_type = kwargs.get('last_modified_by_type', None) - self.last_modified_at = kwargs.get('last_modified_at', None) + self.created_by = kwargs.get("created_by", None) + self.created_by_type = kwargs.get("created_by_type", None) + self.created_at = kwargs.get("created_at", None) + self.last_modified_by = kwargs.get("last_modified_by", None) + self.last_modified_by_type = kwargs.get("last_modified_by_type", None) + self.last_modified_at = kwargs.get("last_modified_at", None) class SystemService(msrest.serialization.Model): @@ -21199,23 +21493,19 @@ class SystemService(msrest.serialization.Model): """ _validation = { - 'system_service_type': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'version': {'readonly': True}, + "system_service_type": {"readonly": True}, + "public_ip_address": {"readonly": True}, + "version": {"readonly": True}, } _attribute_map = { - 'system_service_type': {'key': 'systemServiceType', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, + "system_service_type": {"key": "systemServiceType", "type": "str"}, + "public_ip_address": {"key": "publicIpAddress", "type": "str"}, + "version": {"key": "version", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(SystemService, self).__init__(**kwargs) self.system_service_type = None self.public_ip_address = None @@ -21270,32 +21560,29 @@ class TableFixedParameters(msrest.serialization.Model): """ _attribute_map = { - 'booster': {'key': 'booster', 'type': 'str'}, - 'boosting_type': {'key': 'boostingType', 'type': 'str'}, - 'grow_policy': {'key': 'growPolicy', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'max_bin': {'key': 'maxBin', 'type': 'int'}, - 'max_depth': {'key': 'maxDepth', 'type': 'int'}, - 'max_leaves': {'key': 'maxLeaves', 'type': 'int'}, - 'min_data_in_leaf': {'key': 'minDataInLeaf', 'type': 'int'}, - 'min_split_gain': {'key': 'minSplitGain', 'type': 'float'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'n_estimators': {'key': 'nEstimators', 'type': 'int'}, - 'num_leaves': {'key': 'numLeaves', 'type': 'int'}, - 'preprocessor_name': {'key': 'preprocessorName', 'type': 'str'}, - 'reg_alpha': {'key': 'regAlpha', 'type': 'float'}, - 'reg_lambda': {'key': 'regLambda', 'type': 'float'}, - 'subsample': {'key': 'subsample', 'type': 'float'}, - 'subsample_freq': {'key': 'subsampleFreq', 'type': 'float'}, - 'tree_method': {'key': 'treeMethod', 'type': 'str'}, - 'with_mean': {'key': 'withMean', 'type': 'bool'}, - 'with_std': {'key': 'withStd', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): + "booster": {"key": "booster", "type": "str"}, + "boosting_type": {"key": "boostingType", "type": "str"}, + "grow_policy": {"key": "growPolicy", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "float"}, + "max_bin": {"key": "maxBin", "type": "int"}, + "max_depth": {"key": "maxDepth", "type": "int"}, + "max_leaves": {"key": "maxLeaves", "type": "int"}, + "min_data_in_leaf": {"key": "minDataInLeaf", "type": "int"}, + "min_split_gain": {"key": "minSplitGain", "type": "float"}, + "model_name": {"key": "modelName", "type": "str"}, + "n_estimators": {"key": "nEstimators", "type": "int"}, + "num_leaves": {"key": "numLeaves", "type": "int"}, + "preprocessor_name": {"key": "preprocessorName", "type": "str"}, + "reg_alpha": {"key": "regAlpha", "type": "float"}, + "reg_lambda": {"key": "regLambda", "type": "float"}, + "subsample": {"key": "subsample", "type": "float"}, + "subsample_freq": {"key": "subsampleFreq", "type": "float"}, + "tree_method": {"key": "treeMethod", "type": "str"}, + "with_mean": {"key": "withMean", "type": "bool"}, + "with_std": {"key": "withStd", "type": "bool"}, + } + + def __init__(self, **kwargs): """ :keyword booster: Specify the boosting type, e.g gbdt for XGBoost. :paramtype booster: str @@ -21341,26 +21628,26 @@ def __init__( :paramtype with_std: bool """ super(TableFixedParameters, self).__init__(**kwargs) - self.booster = kwargs.get('booster', None) - self.boosting_type = kwargs.get('boosting_type', None) - self.grow_policy = kwargs.get('grow_policy', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.max_bin = kwargs.get('max_bin', None) - self.max_depth = kwargs.get('max_depth', None) - self.max_leaves = kwargs.get('max_leaves', None) - self.min_data_in_leaf = kwargs.get('min_data_in_leaf', None) - self.min_split_gain = kwargs.get('min_split_gain', None) - self.model_name = kwargs.get('model_name', None) - self.n_estimators = kwargs.get('n_estimators', None) - self.num_leaves = kwargs.get('num_leaves', None) - self.preprocessor_name = kwargs.get('preprocessor_name', None) - self.reg_alpha = kwargs.get('reg_alpha', None) - self.reg_lambda = kwargs.get('reg_lambda', None) - self.subsample = kwargs.get('subsample', None) - self.subsample_freq = kwargs.get('subsample_freq', None) - self.tree_method = kwargs.get('tree_method', None) - self.with_mean = kwargs.get('with_mean', False) - self.with_std = kwargs.get('with_std', False) + self.booster = kwargs.get("booster", None) + self.boosting_type = kwargs.get("boosting_type", None) + self.grow_policy = kwargs.get("grow_policy", None) + self.learning_rate = kwargs.get("learning_rate", None) + self.max_bin = kwargs.get("max_bin", None) + self.max_depth = kwargs.get("max_depth", None) + self.max_leaves = kwargs.get("max_leaves", None) + self.min_data_in_leaf = kwargs.get("min_data_in_leaf", None) + self.min_split_gain = kwargs.get("min_split_gain", None) + self.model_name = kwargs.get("model_name", None) + self.n_estimators = kwargs.get("n_estimators", None) + self.num_leaves = kwargs.get("num_leaves", None) + self.preprocessor_name = kwargs.get("preprocessor_name", None) + self.reg_alpha = kwargs.get("reg_alpha", None) + self.reg_lambda = kwargs.get("reg_lambda", None) + self.subsample = kwargs.get("subsample", None) + self.subsample_freq = kwargs.get("subsample_freq", None) + self.tree_method = kwargs.get("tree_method", None) + self.with_mean = kwargs.get("with_mean", False) + self.with_std = kwargs.get("with_std", False) class TableParameterSubspace(msrest.serialization.Model): @@ -21411,32 +21698,29 @@ class TableParameterSubspace(msrest.serialization.Model): """ _attribute_map = { - 'booster': {'key': 'booster', 'type': 'str'}, - 'boosting_type': {'key': 'boostingType', 'type': 'str'}, - 'grow_policy': {'key': 'growPolicy', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'max_bin': {'key': 'maxBin', 'type': 'str'}, - 'max_depth': {'key': 'maxDepth', 'type': 'str'}, - 'max_leaves': {'key': 'maxLeaves', 'type': 'str'}, - 'min_data_in_leaf': {'key': 'minDataInLeaf', 'type': 'str'}, - 'min_split_gain': {'key': 'minSplitGain', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'n_estimators': {'key': 'nEstimators', 'type': 'str'}, - 'num_leaves': {'key': 'numLeaves', 'type': 'str'}, - 'preprocessor_name': {'key': 'preprocessorName', 'type': 'str'}, - 'reg_alpha': {'key': 'regAlpha', 'type': 'str'}, - 'reg_lambda': {'key': 'regLambda', 'type': 'str'}, - 'subsample': {'key': 'subsample', 'type': 'str'}, - 'subsample_freq': {'key': 'subsampleFreq', 'type': 'str'}, - 'tree_method': {'key': 'treeMethod', 'type': 'str'}, - 'with_mean': {'key': 'withMean', 'type': 'str'}, - 'with_std': {'key': 'withStd', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + "booster": {"key": "booster", "type": "str"}, + "boosting_type": {"key": "boostingType", "type": "str"}, + "grow_policy": {"key": "growPolicy", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "str"}, + "max_bin": {"key": "maxBin", "type": "str"}, + "max_depth": {"key": "maxDepth", "type": "str"}, + "max_leaves": {"key": "maxLeaves", "type": "str"}, + "min_data_in_leaf": {"key": "minDataInLeaf", "type": "str"}, + "min_split_gain": {"key": "minSplitGain", "type": "str"}, + "model_name": {"key": "modelName", "type": "str"}, + "n_estimators": {"key": "nEstimators", "type": "str"}, + "num_leaves": {"key": "numLeaves", "type": "str"}, + "preprocessor_name": {"key": "preprocessorName", "type": "str"}, + "reg_alpha": {"key": "regAlpha", "type": "str"}, + "reg_lambda": {"key": "regLambda", "type": "str"}, + "subsample": {"key": "subsample", "type": "str"}, + "subsample_freq": {"key": "subsampleFreq", "type": "str"}, + "tree_method": {"key": "treeMethod", "type": "str"}, + "with_mean": {"key": "withMean", "type": "str"}, + "with_std": {"key": "withStd", "type": "str"}, + } + + def __init__(self, **kwargs): """ :keyword booster: Specify the boosting type, e.g gbdt for XGBoost. :paramtype booster: str @@ -21482,26 +21766,26 @@ def __init__( :paramtype with_std: str """ super(TableParameterSubspace, self).__init__(**kwargs) - self.booster = kwargs.get('booster', None) - self.boosting_type = kwargs.get('boosting_type', None) - self.grow_policy = kwargs.get('grow_policy', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.max_bin = kwargs.get('max_bin', None) - self.max_depth = kwargs.get('max_depth', None) - self.max_leaves = kwargs.get('max_leaves', None) - self.min_data_in_leaf = kwargs.get('min_data_in_leaf', None) - self.min_split_gain = kwargs.get('min_split_gain', None) - self.model_name = kwargs.get('model_name', None) - self.n_estimators = kwargs.get('n_estimators', None) - self.num_leaves = kwargs.get('num_leaves', None) - self.preprocessor_name = kwargs.get('preprocessor_name', None) - self.reg_alpha = kwargs.get('reg_alpha', None) - self.reg_lambda = kwargs.get('reg_lambda', None) - self.subsample = kwargs.get('subsample', None) - self.subsample_freq = kwargs.get('subsample_freq', None) - self.tree_method = kwargs.get('tree_method', None) - self.with_mean = kwargs.get('with_mean', None) - self.with_std = kwargs.get('with_std', None) + self.booster = kwargs.get("booster", None) + self.boosting_type = kwargs.get("boosting_type", None) + self.grow_policy = kwargs.get("grow_policy", None) + self.learning_rate = kwargs.get("learning_rate", None) + self.max_bin = kwargs.get("max_bin", None) + self.max_depth = kwargs.get("max_depth", None) + self.max_leaves = kwargs.get("max_leaves", None) + self.min_data_in_leaf = kwargs.get("min_data_in_leaf", None) + self.min_split_gain = kwargs.get("min_split_gain", None) + self.model_name = kwargs.get("model_name", None) + self.n_estimators = kwargs.get("n_estimators", None) + self.num_leaves = kwargs.get("num_leaves", None) + self.preprocessor_name = kwargs.get("preprocessor_name", None) + self.reg_alpha = kwargs.get("reg_alpha", None) + self.reg_lambda = kwargs.get("reg_lambda", None) + self.subsample = kwargs.get("subsample", None) + self.subsample_freq = kwargs.get("subsample_freq", None) + self.tree_method = kwargs.get("tree_method", None) + self.with_mean = kwargs.get("with_mean", None) + self.with_std = kwargs.get("with_std", None) class TableSweepSettings(msrest.serialization.Model): @@ -21518,18 +21802,18 @@ class TableSweepSettings(msrest.serialization.Model): """ _validation = { - 'sampling_algorithm': {'required': True}, + "sampling_algorithm": {"required": True}, } _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, + "sampling_algorithm": {"key": "samplingAlgorithm", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword early_termination: Type of early termination policy for the sweeping job. :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy @@ -21539,8 +21823,8 @@ def __init__( ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType """ super(TableSweepSettings, self).__init__(**kwargs) - self.early_termination = kwargs.get('early_termination', None) - self.sampling_algorithm = kwargs['sampling_algorithm'] + self.early_termination = kwargs.get("early_termination", None) + self.sampling_algorithm = kwargs["sampling_algorithm"] class TableVerticalFeaturizationSettings(FeaturizationSettings): @@ -21570,18 +21854,27 @@ class TableVerticalFeaturizationSettings(FeaturizationSettings): """ _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - 'blocked_transformers': {'key': 'blockedTransformers', 'type': '[str]'}, - 'column_name_and_types': {'key': 'columnNameAndTypes', 'type': '{str}'}, - 'enable_dnn_featurization': {'key': 'enableDnnFeaturization', 'type': 'bool'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'transformer_params': {'key': 'transformerParams', 'type': '{[ColumnTransformer]}'}, + "dataset_language": {"key": "datasetLanguage", "type": "str"}, + "blocked_transformers": { + "key": "blockedTransformers", + "type": "[str]", + }, + "column_name_and_types": { + "key": "columnNameAndTypes", + "type": "{str}", + }, + "enable_dnn_featurization": { + "key": "enableDnnFeaturization", + "type": "bool", + }, + "mode": {"key": "mode", "type": "str"}, + "transformer_params": { + "key": "transformerParams", + "type": "{[ColumnTransformer]}", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword dataset_language: Dataset language, useful for the text data. :paramtype dataset_language: str @@ -21606,11 +21899,13 @@ def __init__( list[~azure.mgmt.machinelearningservices.models.ColumnTransformer]] """ super(TableVerticalFeaturizationSettings, self).__init__(**kwargs) - self.blocked_transformers = kwargs.get('blocked_transformers', None) - self.column_name_and_types = kwargs.get('column_name_and_types', None) - self.enable_dnn_featurization = kwargs.get('enable_dnn_featurization', False) - self.mode = kwargs.get('mode', None) - self.transformer_params = kwargs.get('transformer_params', None) + self.blocked_transformers = kwargs.get("blocked_transformers", None) + self.column_name_and_types = kwargs.get("column_name_and_types", None) + self.enable_dnn_featurization = kwargs.get( + "enable_dnn_featurization", False + ) + self.mode = kwargs.get("mode", None) + self.transformer_params = kwargs.get("transformer_params", None) class TableVerticalLimitSettings(msrest.serialization.Model): @@ -21640,22 +21935,25 @@ class TableVerticalLimitSettings(msrest.serialization.Model): """ _attribute_map = { - 'enable_early_termination': {'key': 'enableEarlyTermination', 'type': 'bool'}, - 'exit_score': {'key': 'exitScore', 'type': 'float'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_cores_per_trial': {'key': 'maxCoresPerTrial', 'type': 'int'}, - 'max_nodes': {'key': 'maxNodes', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'sweep_concurrent_trials': {'key': 'sweepConcurrentTrials', 'type': 'int'}, - 'sweep_trials': {'key': 'sweepTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, + "enable_early_termination": { + "key": "enableEarlyTermination", + "type": "bool", + }, + "exit_score": {"key": "exitScore", "type": "float"}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_cores_per_trial": {"key": "maxCoresPerTrial", "type": "int"}, + "max_nodes": {"key": "maxNodes", "type": "int"}, + "max_trials": {"key": "maxTrials", "type": "int"}, + "sweep_concurrent_trials": { + "key": "sweepConcurrentTrials", + "type": "int", + }, + "sweep_trials": {"key": "sweepTrials", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, + "trial_timeout": {"key": "trialTimeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword enable_early_termination: Enable early termination, determines whether or not if AutoMLJob will terminate early if there is no score improvement in last 20 iterations. @@ -21681,16 +21979,18 @@ def __init__( :paramtype trial_timeout: ~datetime.timedelta """ super(TableVerticalLimitSettings, self).__init__(**kwargs) - self.enable_early_termination = kwargs.get('enable_early_termination', True) - self.exit_score = kwargs.get('exit_score', None) - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', 1) - self.max_cores_per_trial = kwargs.get('max_cores_per_trial', -1) - self.max_nodes = kwargs.get('max_nodes', 1) - self.max_trials = kwargs.get('max_trials', 1000) - self.sweep_concurrent_trials = kwargs.get('sweep_concurrent_trials', 0) - self.sweep_trials = kwargs.get('sweep_trials', 0) - self.timeout = kwargs.get('timeout', "PT6H") - self.trial_timeout = kwargs.get('trial_timeout', "PT30M") + self.enable_early_termination = kwargs.get( + "enable_early_termination", True + ) + self.exit_score = kwargs.get("exit_score", None) + self.max_concurrent_trials = kwargs.get("max_concurrent_trials", 1) + self.max_cores_per_trial = kwargs.get("max_cores_per_trial", -1) + self.max_nodes = kwargs.get("max_nodes", 1) + self.max_trials = kwargs.get("max_trials", 1000) + self.sweep_concurrent_trials = kwargs.get("sweep_concurrent_trials", 0) + self.sweep_trials = kwargs.get("sweep_trials", 0) + self.timeout = kwargs.get("timeout", "PT6H") + self.trial_timeout = kwargs.get("trial_timeout", "PT30M") class TargetUtilizationScaleSettings(OnlineScaleSettings): @@ -21714,21 +22014,21 @@ class TargetUtilizationScaleSettings(OnlineScaleSettings): """ _validation = { - 'scale_type': {'required': True}, + "scale_type": {"required": True}, } _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - 'max_instances': {'key': 'maxInstances', 'type': 'int'}, - 'min_instances': {'key': 'minInstances', 'type': 'int'}, - 'polling_interval': {'key': 'pollingInterval', 'type': 'duration'}, - 'target_utilization_percentage': {'key': 'targetUtilizationPercentage', 'type': 'int'}, + "scale_type": {"key": "scaleType", "type": "str"}, + "max_instances": {"key": "maxInstances", "type": "int"}, + "min_instances": {"key": "minInstances", "type": "int"}, + "polling_interval": {"key": "pollingInterval", "type": "duration"}, + "target_utilization_percentage": { + "key": "targetUtilizationPercentage", + "type": "int", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword max_instances: The maximum number of instances that the deployment can scale to. The quota will be reserved for max_instances. @@ -21742,11 +22042,13 @@ def __init__( :paramtype target_utilization_percentage: int """ super(TargetUtilizationScaleSettings, self).__init__(**kwargs) - self.scale_type = 'TargetUtilization' # type: str - self.max_instances = kwargs.get('max_instances', 1) - self.min_instances = kwargs.get('min_instances', 1) - self.polling_interval = kwargs.get('polling_interval', "PT1S") - self.target_utilization_percentage = kwargs.get('target_utilization_percentage', 70) + self.scale_type = "TargetUtilization" # type: str + self.max_instances = kwargs.get("max_instances", 1) + self.min_instances = kwargs.get("min_instances", 1) + self.polling_interval = kwargs.get("polling_interval", "PT1S") + self.target_utilization_percentage = kwargs.get( + "target_utilization_percentage", 70 + ) class TensorFlow(DistributionConfiguration): @@ -21764,19 +22066,19 @@ class TensorFlow(DistributionConfiguration): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'parameter_server_count': {'key': 'parameterServerCount', 'type': 'int'}, - 'worker_count': {'key': 'workerCount', 'type': 'int'}, + "distribution_type": {"key": "distributionType", "type": "str"}, + "parameter_server_count": { + "key": "parameterServerCount", + "type": "int", + }, + "worker_count": {"key": "workerCount", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword parameter_server_count: Number of parameter server tasks. :paramtype parameter_server_count: int @@ -21784,75 +22086,87 @@ def __init__( :paramtype worker_count: int """ super(TensorFlow, self).__init__(**kwargs) - self.distribution_type = 'TensorFlow' # type: str - self.parameter_server_count = kwargs.get('parameter_server_count', 0) - self.worker_count = kwargs.get('worker_count', None) + self.distribution_type = "TensorFlow" # type: str + self.parameter_server_count = kwargs.get("parameter_server_count", 0) + self.worker_count = kwargs.get("worker_count", None) class TextClassification(AutoMLVertical, NlpVertical): """Text Classification task in AutoML NLP vertical. -NLP - Natural Language Processing. + NLP - Natural Language Processing. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-Classification task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar fixed_parameters: Model/training parameters that will remain constant throughout + training. + :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] + :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric for Text-Classification task. Possible values include: + "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, + "task_type": {"required": True}, + "training_data": {"required": True}, } _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "NlpFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "search_space": { + "key": "searchSpace", + "type": "[NlpParameterSubspace]", + }, + "sweep_settings": {"key": "sweepSettings", "type": "NlpSweepSettings"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword featurization_settings: Featurization inputs needed for AutoML job. :paramtype featurization_settings: @@ -21884,87 +22198,101 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ super(TextClassification, self).__init__(**kwargs) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.task_type = 'TextClassification' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.fixed_parameters = kwargs.get("fixed_parameters", None) + self.limit_settings = kwargs.get("limit_settings", None) + self.search_space = kwargs.get("search_space", None) + self.sweep_settings = kwargs.get("sweep_settings", None) + self.validation_data = kwargs.get("validation_data", None) + self.task_type = "TextClassification" # type: str + self.primary_metric = kwargs.get("primary_metric", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class TextClassificationMultilabel(AutoMLVertical, NlpVertical): """Text Classification Multilabel task in AutoML NLP vertical. -NLP - Natural Language Processing. + NLP - Natural Language Processing. - Variables are only populated by the server, and will be ignored when sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-Classification-Multilabel task. - Currently only Accuracy is supported as primary metric, hence user need not set it explicitly. - Possible values include: "AUCWeighted", "Accuracy", "NormMacroRecall", - "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar fixed_parameters: Model/training parameters that will remain constant throughout + training. + :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] + :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric for Text-Classification-Multilabel task. + Currently only Accuracy is supported as primary metric, hence user need not set it explicitly. + Possible values include: "AUCWeighted", "Accuracy", "NormMacroRecall", + "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted", "IOU". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - 'primary_metric': {'readonly': True}, + "task_type": {"required": True}, + "training_data": {"required": True}, + "primary_metric": {"readonly": True}, } _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "NlpFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "search_space": { + "key": "searchSpace", + "type": "[NlpParameterSubspace]", + }, + "sweep_settings": {"key": "sweepSettings", "type": "NlpSweepSettings"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword featurization_settings: Featurization inputs needed for AutoML job. :paramtype featurization_settings: @@ -21991,88 +22319,102 @@ def __init__( :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ super(TextClassificationMultilabel, self).__init__(**kwargs) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.task_type = 'TextClassificationMultilabel' # type: str + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.fixed_parameters = kwargs.get("fixed_parameters", None) + self.limit_settings = kwargs.get("limit_settings", None) + self.search_space = kwargs.get("search_space", None) + self.sweep_settings = kwargs.get("sweep_settings", None) + self.validation_data = kwargs.get("validation_data", None) + self.task_type = "TextClassificationMultilabel" # type: str self.primary_metric = None - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class TextNer(AutoMLVertical, NlpVertical): """Text-NER task in AutoML NLP vertical. -NER - Named Entity Recognition. -NLP - Natural Language Processing. + NER - Named Entity Recognition. + NLP - Natural Language Processing. - Variables are only populated by the server, and will be ignored when sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-NER task. - Only 'Accuracy' is supported for Text-NER, so user need not set this explicitly. Possible - values include: "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar fixed_parameters: Model/training parameters that will remain constant throughout + training. + :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] + :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric for Text-NER task. + Only 'Accuracy' is supported for Text-NER, so user need not set this explicitly. Possible + values include: "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - 'primary_metric': {'readonly': True}, + "task_type": {"required": True}, + "training_data": {"required": True}, + "primary_metric": {"readonly": True}, } _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "NlpFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "search_space": { + "key": "searchSpace", + "type": "[NlpParameterSubspace]", + }, + "sweep_settings": {"key": "sweepSettings", "type": "NlpSweepSettings"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword featurization_settings: Featurization inputs needed for AutoML job. :paramtype featurization_settings: @@ -22099,17 +22441,19 @@ def __init__( :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ super(TextNer, self).__init__(**kwargs) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.task_type = 'TextNER' # type: str + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.fixed_parameters = kwargs.get("fixed_parameters", None) + self.limit_settings = kwargs.get("limit_settings", None) + self.search_space = kwargs.get("search_space", None) + self.sweep_settings = kwargs.get("sweep_settings", None) + self.validation_data = kwargs.get("validation_data", None) + self.task_type = "TextNER" # type: str self.primary_metric = None - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class TmpfsOptions(msrest.serialization.Model): @@ -22120,19 +22464,16 @@ class TmpfsOptions(msrest.serialization.Model): """ _attribute_map = { - 'size': {'key': 'size', 'type': 'int'}, + "size": {"key": "size", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword size: Mention the Tmpfs size. :paramtype size: int """ super(TmpfsOptions, self).__init__(**kwargs) - self.size = kwargs.get('size', None) + self.size = kwargs.get("size", None) class TrialComponent(msrest.serialization.Model): @@ -22158,23 +22499,30 @@ class TrialComponent(msrest.serialization.Model): """ _validation = { - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "command": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "environment_id": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, + "code_id": {"key": "codeId", "type": "str"}, + "command": {"key": "command", "type": "str"}, + "distribution": { + "key": "distribution", + "type": "DistributionConfiguration", + }, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "resources": {"key": "resources", "type": "JobResourceConfiguration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword code_id: ARM resource ID of the code asset. :paramtype code_id: str @@ -22193,12 +22541,12 @@ def __init__( :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration """ super(TrialComponent, self).__init__(**kwargs) - self.code_id = kwargs.get('code_id', None) - self.command = kwargs['command'] - self.distribution = kwargs.get('distribution', None) - self.environment_id = kwargs['environment_id'] - self.environment_variables = kwargs.get('environment_variables', None) - self.resources = kwargs.get('resources', None) + self.code_id = kwargs.get("code_id", None) + self.command = kwargs["command"] + self.distribution = kwargs.get("distribution", None) + self.environment_id = kwargs["environment_id"] + self.environment_variables = kwargs.get("environment_variables", None) + self.resources = kwargs.get("resources", None) class TritonModelJobInput(JobInput, AssetJobInput): @@ -22220,21 +22568,18 @@ class TritonModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -22245,10 +22590,10 @@ def __init__( :paramtype description: str """ super(TritonModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'triton_model' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "triton_model" # type: str + self.description = kwargs.get("description", None) class TritonModelJobOutput(JobOutput, AssetJobOutput): @@ -22274,22 +22619,19 @@ class TritonModelJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "asset_name": {"key": "assetName", "type": "str"}, + "asset_version": {"key": "assetVersion", "type": "str"}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword asset_name: Output Asset Name. :paramtype asset_name: str @@ -22304,12 +22646,12 @@ def __init__( :paramtype description: str """ super(TritonModelJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.asset_version = kwargs.get('asset_version', None) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'triton_model' # type: str - self.description = kwargs.get('description', None) + self.asset_name = kwargs.get("asset_name", None) + self.asset_version = kwargs.get("asset_version", None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "triton_model" # type: str + self.description = kwargs.get("description", None) class TruncationSelectionPolicy(EarlyTerminationPolicy): @@ -22330,20 +22672,20 @@ class TruncationSelectionPolicy(EarlyTerminationPolicy): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'truncation_percentage': {'key': 'truncationPercentage', 'type': 'int'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, + "truncation_percentage": { + "key": "truncationPercentage", + "type": "int", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. :paramtype delay_evaluation: int @@ -22353,8 +22695,8 @@ def __init__( :paramtype truncation_percentage: int """ super(TruncationSelectionPolicy, self).__init__(**kwargs) - self.policy_type = 'TruncationSelection' # type: str - self.truncation_percentage = kwargs.get('truncation_percentage', 0) + self.policy_type = "TruncationSelection" # type: str + self.truncation_percentage = kwargs.get("truncation_percentage", 0) class UpdateWorkspaceQuotas(msrest.serialization.Model): @@ -22378,23 +22720,20 @@ class UpdateWorkspaceQuotas(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, + "id": {"readonly": True}, + "type": {"readonly": True}, + "unit": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "limit": {"key": "limit", "type": "long"}, + "unit": {"key": "unit", "type": "str"}, + "status": {"key": "status", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword limit: The maximum permitted quota of the resource. :paramtype limit: long @@ -22407,9 +22746,9 @@ def __init__( super(UpdateWorkspaceQuotas, self).__init__(**kwargs) self.id = None self.type = None - self.limit = kwargs.get('limit', None) + self.limit = kwargs.get("limit", None) self.unit = None - self.status = kwargs.get('status', None) + self.status = kwargs.get("status", None) class UpdateWorkspaceQuotasResult(msrest.serialization.Model): @@ -22425,21 +22764,17 @@ class UpdateWorkspaceQuotasResult(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[UpdateWorkspaceQuotas]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[UpdateWorkspaceQuotas]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UpdateWorkspaceQuotasResult, self).__init__(**kwargs) self.value = None self.next_link = None @@ -22469,24 +22804,21 @@ class UriFileDataVersion(DataVersionBaseProperties): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -22503,7 +22835,7 @@ def __init__( :paramtype data_uri: str """ super(UriFileDataVersion, self).__init__(**kwargs) - self.data_type = 'uri_file' # type: str + self.data_type = "uri_file" # type: str class UriFileJobInput(JobInput, AssetJobInput): @@ -22525,21 +22857,18 @@ class UriFileJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -22550,10 +22879,10 @@ def __init__( :paramtype description: str """ super(UriFileJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'uri_file' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "uri_file" # type: str + self.description = kwargs.get("description", None) class UriFileJobOutput(JobOutput, AssetJobOutput): @@ -22579,22 +22908,19 @@ class UriFileJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "asset_name": {"key": "assetName", "type": "str"}, + "asset_version": {"key": "assetVersion", "type": "str"}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword asset_name: Output Asset Name. :paramtype asset_name: str @@ -22609,12 +22935,12 @@ def __init__( :paramtype description: str """ super(UriFileJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.asset_version = kwargs.get('asset_version', None) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'uri_file' # type: str - self.description = kwargs.get('description', None) + self.asset_name = kwargs.get("asset_name", None) + self.asset_version = kwargs.get("asset_version", None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "uri_file" # type: str + self.description = kwargs.get("description", None) class UriFolderDataVersion(DataVersionBaseProperties): @@ -22641,24 +22967,21 @@ class UriFolderDataVersion(DataVersionBaseProperties): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -22675,7 +22998,7 @@ def __init__( :paramtype data_uri: str """ super(UriFolderDataVersion, self).__init__(**kwargs) - self.data_type = 'uri_folder' # type: str + self.data_type = "uri_folder" # type: str class UriFolderJobInput(JobInput, AssetJobInput): @@ -22697,21 +23020,18 @@ class UriFolderJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -22722,10 +23042,10 @@ def __init__( :paramtype description: str """ super(UriFolderJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'uri_folder' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "uri_folder" # type: str + self.description = kwargs.get("description", None) class UriFolderJobOutput(JobOutput, AssetJobOutput): @@ -22751,22 +23071,19 @@ class UriFolderJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "asset_name": {"key": "assetName", "type": "str"}, + "asset_version": {"key": "assetVersion", "type": "str"}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword asset_name: Output Asset Name. :paramtype asset_name: str @@ -22781,12 +23098,12 @@ def __init__( :paramtype description: str """ super(UriFolderJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.asset_version = kwargs.get('asset_version', None) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'uri_folder' # type: str - self.description = kwargs.get('description', None) + self.asset_name = kwargs.get("asset_name", None) + self.asset_version = kwargs.get("asset_version", None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "uri_folder" # type: str + self.description = kwargs.get("description", None) class Usage(msrest.serialization.Model): @@ -22811,31 +23128,30 @@ class Usage(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, + "id": {"readonly": True}, + "aml_workspace_location": {"readonly": True}, + "type": {"readonly": True}, + "unit": {"readonly": True}, + "current_value": {"readonly": True}, + "limit": {"readonly": True}, + "name": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'current_value': {'key': 'currentValue', 'type': 'long'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'name': {'key': 'name', 'type': 'UsageName'}, + "id": {"key": "id", "type": "str"}, + "aml_workspace_location": { + "key": "amlWorkspaceLocation", + "type": "str", + }, + "type": {"key": "type", "type": "str"}, + "unit": {"key": "unit", "type": "str"}, + "current_value": {"key": "currentValue", "type": "long"}, + "limit": {"key": "limit", "type": "long"}, + "name": {"key": "name", "type": "UsageName"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Usage, self).__init__(**kwargs) self.id = None self.aml_workspace_location = None @@ -22858,21 +23174,17 @@ class UsageName(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, + "value": {"readonly": True}, + "localized_value": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + "value": {"key": "value", "type": "str"}, + "localized_value": {"key": "localizedValue", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UsageName, self).__init__(**kwargs) self.value = None self.localized_value = None @@ -22893,19 +23205,19 @@ class UserAccountCredentials(msrest.serialization.Model): """ _validation = { - 'admin_user_name': {'required': True}, + "admin_user_name": {"required": True}, } _attribute_map = { - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'admin_user_ssh_public_key': {'key': 'adminUserSshPublicKey', 'type': 'str'}, - 'admin_user_password': {'key': 'adminUserPassword', 'type': 'str'}, + "admin_user_name": {"key": "adminUserName", "type": "str"}, + "admin_user_ssh_public_key": { + "key": "adminUserSshPublicKey", + "type": "str", + }, + "admin_user_password": {"key": "adminUserPassword", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword admin_user_name: Required. Name of the administrator user account which can be used to SSH to nodes. @@ -22916,9 +23228,11 @@ def __init__( :paramtype admin_user_password: str """ super(UserAccountCredentials, self).__init__(**kwargs) - self.admin_user_name = kwargs['admin_user_name'] - self.admin_user_ssh_public_key = kwargs.get('admin_user_ssh_public_key', None) - self.admin_user_password = kwargs.get('admin_user_password', None) + self.admin_user_name = kwargs["admin_user_name"] + self.admin_user_ssh_public_key = kwargs.get( + "admin_user_ssh_public_key", None + ) + self.admin_user_password = kwargs.get("admin_user_password", None) class UserAssignedIdentity(msrest.serialization.Model): @@ -22933,21 +23247,17 @@ class UserAssignedIdentity(msrest.serialization.Model): """ _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, + "principal_id": {"readonly": True}, + "client_id": {"readonly": True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, + "principal_id": {"key": "principalId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UserAssignedIdentity, self).__init__(**kwargs) self.principal_id = None self.client_id = None @@ -22961,19 +23271,16 @@ class UserCreatedAcrAccount(msrest.serialization.Model): """ _attribute_map = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, + "arm_resource_id": {"key": "armResourceId", "type": "ArmResourceId"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword arm_resource_id: ARM ResourceId of a resource. :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId """ super(UserCreatedAcrAccount, self).__init__(**kwargs) - self.arm_resource_id = kwargs.get('arm_resource_id', None) + self.arm_resource_id = kwargs.get("arm_resource_id", None) class UserCreatedStorageAccount(msrest.serialization.Model): @@ -22984,19 +23291,16 @@ class UserCreatedStorageAccount(msrest.serialization.Model): """ _attribute_map = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, + "arm_resource_id": {"key": "armResourceId", "type": "ArmResourceId"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword arm_resource_id: ARM ResourceId of a resource. :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId """ super(UserCreatedStorageAccount, self).__init__(**kwargs) - self.arm_resource_id = kwargs.get('arm_resource_id', None) + self.arm_resource_id = kwargs.get("arm_resource_id", None) class UserIdentity(IdentityConfiguration): @@ -23011,24 +23315,22 @@ class UserIdentity(IdentityConfiguration): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UserIdentity, self).__init__(**kwargs) - self.identity_type = 'UserIdentity' # type: str + self.identity_type = "UserIdentity" # type: str -class UsernamePasswordAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class UsernamePasswordAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """UsernamePasswordAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -23053,22 +23355,22 @@ class UsernamePasswordAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionP """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionUsernamePassword'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionUsernamePassword", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: Category of the connection. Possible values include: "PythonFeed", "ContainerRegistry", "Git", "FeatureStore", "S3", "Snowflake", "AzureSqlDb", @@ -23085,9 +23387,11 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword """ - super(UsernamePasswordAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'UsernamePassword' # type: str - self.credentials = kwargs.get('credentials', None) + super( + UsernamePasswordAuthTypeWorkspaceConnectionProperties, self + ).__init__(**kwargs) + self.auth_type = "UsernamePassword" # type: str + self.credentials = kwargs.get("credentials", None) class VirtualMachineSchema(msrest.serialization.Model): @@ -23098,20 +23402,20 @@ class VirtualMachineSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, + "properties": { + "key": "properties", + "type": "VirtualMachineSchemaProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: :paramtype properties: ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties """ super(VirtualMachineSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class VirtualMachine(Compute, VirtualMachineSchema): @@ -23153,32 +23457,35 @@ class VirtualMachine(Compute, VirtualMachineSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": { + "key": "properties", + "type": "VirtualMachineSchemaProperties", + }, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: :paramtype properties: @@ -23194,17 +23501,17 @@ def __init__( :paramtype disable_local_auth: bool """ super(VirtualMachine, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'VirtualMachine' # type: str - self.compute_location = kwargs.get('compute_location', None) + self.properties = kwargs.get("properties", None) + self.compute_type = "VirtualMachine" # type: str + self.compute_location = kwargs.get("compute_location", None) self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) + self.disable_local_auth = kwargs.get("disable_local_auth", None) class VirtualMachineImage(msrest.serialization.Model): @@ -23217,23 +23524,20 @@ class VirtualMachineImage(msrest.serialization.Model): """ _validation = { - 'id': {'required': True}, + "id": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword id: Required. Virtual Machine image path. :paramtype id: str """ super(VirtualMachineImage, self).__init__(**kwargs) - self.id = kwargs['id'] + self.id = kwargs["id"] class VirtualMachineSchemaProperties(msrest.serialization.Model): @@ -23256,18 +23560,21 @@ class VirtualMachineSchemaProperties(msrest.serialization.Model): """ _attribute_map = { - 'virtual_machine_size': {'key': 'virtualMachineSize', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'notebook_server_port': {'key': 'notebookServerPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'is_notebook_instance_compute': {'key': 'isNotebookInstanceCompute', 'type': 'bool'}, + "virtual_machine_size": {"key": "virtualMachineSize", "type": "str"}, + "ssh_port": {"key": "sshPort", "type": "int"}, + "notebook_server_port": {"key": "notebookServerPort", "type": "int"}, + "address": {"key": "address", "type": "str"}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, + "is_notebook_instance_compute": { + "key": "isNotebookInstanceCompute", + "type": "bool", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword virtual_machine_size: Virtual Machine size. :paramtype virtual_machine_size: str @@ -23285,12 +23592,14 @@ def __init__( :paramtype is_notebook_instance_compute: bool """ super(VirtualMachineSchemaProperties, self).__init__(**kwargs) - self.virtual_machine_size = kwargs.get('virtual_machine_size', None) - self.ssh_port = kwargs.get('ssh_port', None) - self.notebook_server_port = kwargs.get('notebook_server_port', None) - self.address = kwargs.get('address', None) - self.administrator_account = kwargs.get('administrator_account', None) - self.is_notebook_instance_compute = kwargs.get('is_notebook_instance_compute', None) + self.virtual_machine_size = kwargs.get("virtual_machine_size", None) + self.ssh_port = kwargs.get("ssh_port", None) + self.notebook_server_port = kwargs.get("notebook_server_port", None) + self.address = kwargs.get("address", None) + self.administrator_account = kwargs.get("administrator_account", None) + self.is_notebook_instance_compute = kwargs.get( + "is_notebook_instance_compute", None + ) class VirtualMachineSecretsSchema(msrest.serialization.Model): @@ -23302,20 +23611,20 @@ class VirtualMachineSecretsSchema(msrest.serialization.Model): """ _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword administrator_account: Admin credentials for virtual machine. :paramtype administrator_account: ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials """ super(VirtualMachineSecretsSchema, self).__init__(**kwargs) - self.administrator_account = kwargs.get('administrator_account', None) + self.administrator_account = kwargs.get("administrator_account", None) class VirtualMachineSecrets(ComputeSecrets, VirtualMachineSecretsSchema): @@ -23333,26 +23642,26 @@ class VirtualMachineSecrets(ComputeSecrets, VirtualMachineSecretsSchema): """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, + "compute_type": {"key": "computeType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword administrator_account: Admin credentials for virtual machine. :paramtype administrator_account: ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials """ super(VirtualMachineSecrets, self).__init__(**kwargs) - self.administrator_account = kwargs.get('administrator_account', None) - self.compute_type = 'VirtualMachine' # type: str + self.administrator_account = kwargs.get("administrator_account", None) + self.compute_type = "VirtualMachine" # type: str class VirtualMachineSize(msrest.serialization.Model): @@ -23387,35 +23696,41 @@ class VirtualMachineSize(msrest.serialization.Model): """ _validation = { - 'name': {'readonly': True}, - 'family': {'readonly': True}, - 'v_cp_us': {'readonly': True}, - 'gpus': {'readonly': True}, - 'os_vhd_size_mb': {'readonly': True}, - 'max_resource_volume_mb': {'readonly': True}, - 'memory_gb': {'readonly': True}, - 'low_priority_capable': {'readonly': True}, - 'premium_io': {'readonly': True}, + "name": {"readonly": True}, + "family": {"readonly": True}, + "v_cp_us": {"readonly": True}, + "gpus": {"readonly": True}, + "os_vhd_size_mb": {"readonly": True}, + "max_resource_volume_mb": {"readonly": True}, + "memory_gb": {"readonly": True}, + "low_priority_capable": {"readonly": True}, + "premium_io": {"readonly": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'v_cp_us': {'key': 'vCPUs', 'type': 'int'}, - 'gpus': {'key': 'gpus', 'type': 'int'}, - 'os_vhd_size_mb': {'key': 'osVhdSizeMB', 'type': 'int'}, - 'max_resource_volume_mb': {'key': 'maxResourceVolumeMB', 'type': 'int'}, - 'memory_gb': {'key': 'memoryGB', 'type': 'float'}, - 'low_priority_capable': {'key': 'lowPriorityCapable', 'type': 'bool'}, - 'premium_io': {'key': 'premiumIO', 'type': 'bool'}, - 'estimated_vm_prices': {'key': 'estimatedVMPrices', 'type': 'EstimatedVMPrices'}, - 'supported_compute_types': {'key': 'supportedComputeTypes', 'type': '[str]'}, + "name": {"key": "name", "type": "str"}, + "family": {"key": "family", "type": "str"}, + "v_cp_us": {"key": "vCPUs", "type": "int"}, + "gpus": {"key": "gpus", "type": "int"}, + "os_vhd_size_mb": {"key": "osVhdSizeMB", "type": "int"}, + "max_resource_volume_mb": { + "key": "maxResourceVolumeMB", + "type": "int", + }, + "memory_gb": {"key": "memoryGB", "type": "float"}, + "low_priority_capable": {"key": "lowPriorityCapable", "type": "bool"}, + "premium_io": {"key": "premiumIO", "type": "bool"}, + "estimated_vm_prices": { + "key": "estimatedVMPrices", + "type": "EstimatedVMPrices", + }, + "supported_compute_types": { + "key": "supportedComputeTypes", + "type": "[str]", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword estimated_vm_prices: The estimated price information for using a VM. :paramtype estimated_vm_prices: ~azure.mgmt.machinelearningservices.models.EstimatedVMPrices @@ -23433,8 +23748,10 @@ def __init__( self.memory_gb = None self.low_priority_capable = None self.premium_io = None - self.estimated_vm_prices = kwargs.get('estimated_vm_prices', None) - self.supported_compute_types = kwargs.get('supported_compute_types', None) + self.estimated_vm_prices = kwargs.get("estimated_vm_prices", None) + self.supported_compute_types = kwargs.get( + "supported_compute_types", None + ) class VirtualMachineSizeListResult(msrest.serialization.Model): @@ -23445,19 +23762,16 @@ class VirtualMachineSizeListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[VirtualMachineSize]'}, + "value": {"key": "value", "type": "[VirtualMachineSize]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: The list of virtual machine sizes supported by AmlCompute. :paramtype value: list[~azure.mgmt.machinelearningservices.models.VirtualMachineSize] """ super(VirtualMachineSizeListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class VirtualMachineSshCredentials(msrest.serialization.Model): @@ -23474,16 +23788,13 @@ class VirtualMachineSshCredentials(msrest.serialization.Model): """ _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'public_key_data': {'key': 'publicKeyData', 'type': 'str'}, - 'private_key_data': {'key': 'privateKeyData', 'type': 'str'}, + "username": {"key": "username", "type": "str"}, + "password": {"key": "password", "type": "str"}, + "public_key_data": {"key": "publicKeyData", "type": "str"}, + "private_key_data": {"key": "privateKeyData", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword username: Username of admin account. :paramtype username: str @@ -23495,10 +23806,10 @@ def __init__( :paramtype private_key_data: str """ super(VirtualMachineSshCredentials, self).__init__(**kwargs) - self.username = kwargs.get('username', None) - self.password = kwargs.get('password', None) - self.public_key_data = kwargs.get('public_key_data', None) - self.private_key_data = kwargs.get('private_key_data', None) + self.username = kwargs.get("username", None) + self.password = kwargs.get("password", None) + self.public_key_data = kwargs.get("public_key_data", None) + self.private_key_data = kwargs.get("private_key_data", None) class VolumeDefinition(msrest.serialization.Model): @@ -23524,20 +23835,17 @@ class VolumeDefinition(msrest.serialization.Model): """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'read_only': {'key': 'readOnly', 'type': 'bool'}, - 'source': {'key': 'source', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'consistency': {'key': 'consistency', 'type': 'str'}, - 'bind': {'key': 'bind', 'type': 'BindOptions'}, - 'volume': {'key': 'volume', 'type': 'VolumeOptions'}, - 'tmpfs': {'key': 'tmpfs', 'type': 'TmpfsOptions'}, + "type": {"key": "type", "type": "str"}, + "read_only": {"key": "readOnly", "type": "bool"}, + "source": {"key": "source", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "consistency": {"key": "consistency", "type": "str"}, + "bind": {"key": "bind", "type": "BindOptions"}, + "volume": {"key": "volume", "type": "VolumeOptions"}, + "tmpfs": {"key": "tmpfs", "type": "TmpfsOptions"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword type: Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe. Possible values include: "bind", "volume", "tmpfs", "npipe". Default value: "bind". @@ -23559,14 +23867,14 @@ def __init__( :paramtype tmpfs: ~azure.mgmt.machinelearningservices.models.TmpfsOptions """ super(VolumeDefinition, self).__init__(**kwargs) - self.type = kwargs.get('type', "bind") - self.read_only = kwargs.get('read_only', None) - self.source = kwargs.get('source', None) - self.target = kwargs.get('target', None) - self.consistency = kwargs.get('consistency', None) - self.bind = kwargs.get('bind', None) - self.volume = kwargs.get('volume', None) - self.tmpfs = kwargs.get('tmpfs', None) + self.type = kwargs.get("type", "bind") + self.read_only = kwargs.get("read_only", None) + self.source = kwargs.get("source", None) + self.target = kwargs.get("target", None) + self.consistency = kwargs.get("consistency", None) + self.bind = kwargs.get("bind", None) + self.volume = kwargs.get("volume", None) + self.tmpfs = kwargs.get("tmpfs", None) class VolumeOptions(msrest.serialization.Model): @@ -23577,19 +23885,16 @@ class VolumeOptions(msrest.serialization.Model): """ _attribute_map = { - 'nocopy': {'key': 'nocopy', 'type': 'bool'}, + "nocopy": {"key": "nocopy", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword nocopy: Indicate whether volume is nocopy. :paramtype nocopy: bool """ super(VolumeOptions, self).__init__(**kwargs) - self.nocopy = kwargs.get('nocopy', None) + self.nocopy = kwargs.get("nocopy", None) class Workspace(Resource): @@ -23704,69 +24009,126 @@ class Workspace(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'workspace_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'service_provisioned_resource_group': {'readonly': True}, - 'private_link_count': {'readonly': True}, - 'private_endpoint_connections': {'readonly': True}, - 'notebook_info': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'storage_hns_enabled': {'readonly': True}, - 'ml_flow_tracking_uri': {'readonly': True}, - 'soft_deleted_at': {'readonly': True}, - 'scheduled_purge_date': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'key_vault': {'key': 'properties.keyVault', 'type': 'str'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'storage_account': {'key': 'properties.storageAccount', 'type': 'str'}, - 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionProperty'}, - 'hbi_workspace': {'key': 'properties.hbiWorkspace', 'type': 'bool'}, - 'service_provisioned_resource_group': {'key': 'properties.serviceProvisionedResourceGroup', 'type': 'str'}, - 'private_link_count': {'key': 'properties.privateLinkCount', 'type': 'int'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'allow_public_access_when_behind_vnet': {'key': 'properties.allowPublicAccessWhenBehindVnet', 'type': 'bool'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, - 'shared_private_link_resources': {'key': 'properties.sharedPrivateLinkResources', 'type': '[SharedPrivateLinkResource]'}, - 'notebook_info': {'key': 'properties.notebookInfo', 'type': 'NotebookResourceInfo'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, - 'storage_hns_enabled': {'key': 'properties.storageHnsEnabled', 'type': 'bool'}, - 'ml_flow_tracking_uri': {'key': 'properties.mlFlowTrackingUri', 'type': 'str'}, - 'v1_legacy_mode': {'key': 'properties.v1LegacyMode', 'type': 'bool'}, - 'soft_deleted_at': {'key': 'properties.softDeletedAt', 'type': 'str'}, - 'scheduled_purge_date': {'key': 'properties.scheduledPurgeDate', 'type': 'str'}, - 'system_datastores_auth_mode': {'key': 'properties.systemDatastoresAuthMode', 'type': 'str'}, - 'feature_store_settings': {'key': 'properties.featureStoreSettings', 'type': 'FeatureStoreSettings'}, - 'managed_network': {'key': 'properties.managedNetwork', 'type': 'ManagedNetworkSettings'}, - } - - def __init__( - self, - **kwargs - ): + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "workspace_id": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "service_provisioned_resource_group": {"readonly": True}, + "private_link_count": {"readonly": True}, + "private_endpoint_connections": {"readonly": True}, + "notebook_info": {"readonly": True}, + "tenant_id": {"readonly": True}, + "storage_hns_enabled": {"readonly": True}, + "ml_flow_tracking_uri": {"readonly": True}, + "soft_deleted_at": {"readonly": True}, + "scheduled_purge_date": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "kind": {"key": "kind", "type": "str"}, + "workspace_id": {"key": "properties.workspaceId", "type": "str"}, + "description": {"key": "properties.description", "type": "str"}, + "friendly_name": {"key": "properties.friendlyName", "type": "str"}, + "key_vault": {"key": "properties.keyVault", "type": "str"}, + "application_insights": { + "key": "properties.applicationInsights", + "type": "str", + }, + "container_registry": { + "key": "properties.containerRegistry", + "type": "str", + }, + "storage_account": {"key": "properties.storageAccount", "type": "str"}, + "discovery_url": {"key": "properties.discoveryUrl", "type": "str"}, + "provisioning_state": { + "key": "properties.provisioningState", + "type": "str", + }, + "encryption": { + "key": "properties.encryption", + "type": "EncryptionProperty", + }, + "hbi_workspace": {"key": "properties.hbiWorkspace", "type": "bool"}, + "service_provisioned_resource_group": { + "key": "properties.serviceProvisionedResourceGroup", + "type": "str", + }, + "private_link_count": { + "key": "properties.privateLinkCount", + "type": "int", + }, + "image_build_compute": { + "key": "properties.imageBuildCompute", + "type": "str", + }, + "allow_public_access_when_behind_vnet": { + "key": "properties.allowPublicAccessWhenBehindVnet", + "type": "bool", + }, + "public_network_access": { + "key": "properties.publicNetworkAccess", + "type": "str", + }, + "private_endpoint_connections": { + "key": "properties.privateEndpointConnections", + "type": "[PrivateEndpointConnection]", + }, + "shared_private_link_resources": { + "key": "properties.sharedPrivateLinkResources", + "type": "[SharedPrivateLinkResource]", + }, + "notebook_info": { + "key": "properties.notebookInfo", + "type": "NotebookResourceInfo", + }, + "service_managed_resources_settings": { + "key": "properties.serviceManagedResourcesSettings", + "type": "ServiceManagedResourcesSettings", + }, + "primary_user_assigned_identity": { + "key": "properties.primaryUserAssignedIdentity", + "type": "str", + }, + "tenant_id": {"key": "properties.tenantId", "type": "str"}, + "storage_hns_enabled": { + "key": "properties.storageHnsEnabled", + "type": "bool", + }, + "ml_flow_tracking_uri": { + "key": "properties.mlFlowTrackingUri", + "type": "str", + }, + "v1_legacy_mode": {"key": "properties.v1LegacyMode", "type": "bool"}, + "soft_deleted_at": {"key": "properties.softDeletedAt", "type": "str"}, + "scheduled_purge_date": { + "key": "properties.scheduledPurgeDate", + "type": "str", + }, + "system_datastores_auth_mode": { + "key": "properties.systemDatastoresAuthMode", + "type": "str", + }, + "feature_store_settings": { + "key": "properties.featureStoreSettings", + "type": "FeatureStoreSettings", + }, + "managed_network": { + "key": "properties.managedNetwork", + "type": "ManagedNetworkSettings", + }, + } + + def __init__(self, **kwargs): """ :keyword identity: The identity of the resource. :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity @@ -23833,41 +24195,53 @@ def __init__( :paramtype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings """ super(Workspace, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) - self.kind = kwargs.get('kind', None) + self.identity = kwargs.get("identity", None) + self.location = kwargs.get("location", None) + self.tags = kwargs.get("tags", None) + self.sku = kwargs.get("sku", None) + self.kind = kwargs.get("kind", None) self.workspace_id = None - self.description = kwargs.get('description', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.key_vault = kwargs.get('key_vault', None) - self.application_insights = kwargs.get('application_insights', None) - self.container_registry = kwargs.get('container_registry', None) - self.storage_account = kwargs.get('storage_account', None) - self.discovery_url = kwargs.get('discovery_url', None) + self.description = kwargs.get("description", None) + self.friendly_name = kwargs.get("friendly_name", None) + self.key_vault = kwargs.get("key_vault", None) + self.application_insights = kwargs.get("application_insights", None) + self.container_registry = kwargs.get("container_registry", None) + self.storage_account = kwargs.get("storage_account", None) + self.discovery_url = kwargs.get("discovery_url", None) self.provisioning_state = None - self.encryption = kwargs.get('encryption', None) - self.hbi_workspace = kwargs.get('hbi_workspace', False) + self.encryption = kwargs.get("encryption", None) + self.hbi_workspace = kwargs.get("hbi_workspace", False) self.service_provisioned_resource_group = None self.private_link_count = None - self.image_build_compute = kwargs.get('image_build_compute', None) - self.allow_public_access_when_behind_vnet = kwargs.get('allow_public_access_when_behind_vnet', False) - self.public_network_access = kwargs.get('public_network_access', None) + self.image_build_compute = kwargs.get("image_build_compute", None) + self.allow_public_access_when_behind_vnet = kwargs.get( + "allow_public_access_when_behind_vnet", False + ) + self.public_network_access = kwargs.get("public_network_access", None) self.private_endpoint_connections = None - self.shared_private_link_resources = kwargs.get('shared_private_link_resources', None) + self.shared_private_link_resources = kwargs.get( + "shared_private_link_resources", None + ) self.notebook_info = None - self.service_managed_resources_settings = kwargs.get('service_managed_resources_settings', None) - self.primary_user_assigned_identity = kwargs.get('primary_user_assigned_identity', None) + self.service_managed_resources_settings = kwargs.get( + "service_managed_resources_settings", None + ) + self.primary_user_assigned_identity = kwargs.get( + "primary_user_assigned_identity", None + ) self.tenant_id = None self.storage_hns_enabled = None self.ml_flow_tracking_uri = None - self.v1_legacy_mode = kwargs.get('v1_legacy_mode', False) + self.v1_legacy_mode = kwargs.get("v1_legacy_mode", False) self.soft_deleted_at = None self.scheduled_purge_date = None - self.system_datastores_auth_mode = kwargs.get('system_datastores_auth_mode', None) - self.feature_store_settings = kwargs.get('feature_store_settings', None) - self.managed_network = kwargs.get('managed_network', None) + self.system_datastores_auth_mode = kwargs.get( + "system_datastores_auth_mode", None + ) + self.feature_store_settings = kwargs.get( + "feature_store_settings", None + ) + self.managed_network = kwargs.get("managed_network", None) class WorkspaceConnectionAccessKey(msrest.serialization.Model): @@ -23880,14 +24254,11 @@ class WorkspaceConnectionAccessKey(msrest.serialization.Model): """ _attribute_map = { - 'access_key_id': {'key': 'accessKeyId', 'type': 'str'}, - 'secret_access_key': {'key': 'secretAccessKey', 'type': 'str'}, + "access_key_id": {"key": "accessKeyId", "type": "str"}, + "secret_access_key": {"key": "secretAccessKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword access_key_id: :paramtype access_key_id: str @@ -23895,8 +24266,8 @@ def __init__( :paramtype secret_access_key: str """ super(WorkspaceConnectionAccessKey, self).__init__(**kwargs) - self.access_key_id = kwargs.get('access_key_id', None) - self.secret_access_key = kwargs.get('secret_access_key', None) + self.access_key_id = kwargs.get("access_key_id", None) + self.secret_access_key = kwargs.get("secret_access_key", None) class WorkspaceConnectionManagedIdentity(msrest.serialization.Model): @@ -23909,14 +24280,11 @@ class WorkspaceConnectionManagedIdentity(msrest.serialization.Model): """ _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, + "resource_id": {"key": "resourceId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword resource_id: :paramtype resource_id: str @@ -23924,8 +24292,8 @@ def __init__( :paramtype client_id: str """ super(WorkspaceConnectionManagedIdentity, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.client_id = kwargs.get('client_id', None) + self.resource_id = kwargs.get("resource_id", None) + self.client_id = kwargs.get("client_id", None) class WorkspaceConnectionPersonalAccessToken(msrest.serialization.Model): @@ -23936,19 +24304,16 @@ class WorkspaceConnectionPersonalAccessToken(msrest.serialization.Model): """ _attribute_map = { - 'pat': {'key': 'pat', 'type': 'str'}, + "pat": {"key": "pat", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword pat: :paramtype pat: str """ super(WorkspaceConnectionPersonalAccessToken, self).__init__(**kwargs) - self.pat = kwargs.get('pat', None) + self.pat = kwargs.get("pat", None) class WorkspaceConnectionPropertiesV2BasicResource(Resource): @@ -23974,35 +24339,39 @@ class WorkspaceConnectionPropertiesV2BasicResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'WorkspaceConnectionPropertiesV2'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "WorkspaceConnectionPropertiesV2", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. :paramtype properties: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 """ - super(WorkspaceConnectionPropertiesV2BasicResource, self).__init__(**kwargs) - self.properties = kwargs['properties'] + super(WorkspaceConnectionPropertiesV2BasicResource, self).__init__( + **kwargs + ) + self.properties = kwargs["properties"] -class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(msrest.serialization.Model): +class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult( + msrest.serialization.Model +): """WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult. Variables are only populated by the server, and will be ignored when sending a request. @@ -24015,25 +24384,28 @@ class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(msrest.seri """ _validation = { - 'next_link': {'readonly': True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[WorkspaceConnectionPropertiesV2BasicResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": { + "key": "value", + "type": "[WorkspaceConnectionPropertiesV2BasicResource]", + }, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: :paramtype value: list[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource] """ - super(WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + super( + WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, + self, + ).__init__(**kwargs) + self.value = kwargs.get("value", None) self.next_link = None @@ -24049,15 +24421,12 @@ class WorkspaceConnectionServicePrincipal(msrest.serialization.Model): """ _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + "client_id": {"key": "clientId", "type": "str"}, + "client_secret": {"key": "clientSecret", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword client_id: :paramtype client_id: str @@ -24067,9 +24436,9 @@ def __init__( :paramtype tenant_id: str """ super(WorkspaceConnectionServicePrincipal, self).__init__(**kwargs) - self.client_id = kwargs.get('client_id', None) - self.client_secret = kwargs.get('client_secret', None) - self.tenant_id = kwargs.get('tenant_id', None) + self.client_id = kwargs.get("client_id", None) + self.client_secret = kwargs.get("client_secret", None) + self.tenant_id = kwargs.get("tenant_id", None) class WorkspaceConnectionSharedAccessSignature(msrest.serialization.Model): @@ -24080,19 +24449,18 @@ class WorkspaceConnectionSharedAccessSignature(msrest.serialization.Model): """ _attribute_map = { - 'sas': {'key': 'sas', 'type': 'str'}, + "sas": {"key": "sas", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword sas: :paramtype sas: str """ - super(WorkspaceConnectionSharedAccessSignature, self).__init__(**kwargs) - self.sas = kwargs.get('sas', None) + super(WorkspaceConnectionSharedAccessSignature, self).__init__( + **kwargs + ) + self.sas = kwargs.get("sas", None) class WorkspaceConnectionUsernamePassword(msrest.serialization.Model): @@ -24105,14 +24473,11 @@ class WorkspaceConnectionUsernamePassword(msrest.serialization.Model): """ _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, + "username": {"key": "username", "type": "str"}, + "password": {"key": "password", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword username: :paramtype username: str @@ -24120,8 +24485,8 @@ def __init__( :paramtype password: str """ super(WorkspaceConnectionUsernamePassword, self).__init__(**kwargs) - self.username = kwargs.get('username', None) - self.password = kwargs.get('password', None) + self.username = kwargs.get("username", None) + self.password = kwargs.get("password", None) class WorkspaceListResult(msrest.serialization.Model): @@ -24136,14 +24501,11 @@ class WorkspaceListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[Workspace]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Workspace]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: The list of machine learning workspaces. Since this list may be incomplete, the nextLink field should be used to request the next list of machine learning workspaces. @@ -24153,8 +24515,8 @@ def __init__( :paramtype next_link: str """ super(WorkspaceListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get("value", None) + self.next_link = kwargs.get("next_link", None) class WorkspaceUpdateParameters(msrest.serialization.Model): @@ -24196,26 +24558,50 @@ class WorkspaceUpdateParameters(msrest.serialization.Model): """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionUpdateProperties'}, - 'feature_store_settings': {'key': 'properties.featureStoreSettings', 'type': 'FeatureStoreSettings'}, - 'managed_network': {'key': 'properties.managedNetwork', 'type': 'ManagedNetworkSettings'}, - } - - def __init__( - self, - **kwargs - ): + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "description": {"key": "properties.description", "type": "str"}, + "friendly_name": {"key": "properties.friendlyName", "type": "str"}, + "image_build_compute": { + "key": "properties.imageBuildCompute", + "type": "str", + }, + "service_managed_resources_settings": { + "key": "properties.serviceManagedResourcesSettings", + "type": "ServiceManagedResourcesSettings", + }, + "primary_user_assigned_identity": { + "key": "properties.primaryUserAssignedIdentity", + "type": "str", + }, + "public_network_access": { + "key": "properties.publicNetworkAccess", + "type": "str", + }, + "application_insights": { + "key": "properties.applicationInsights", + "type": "str", + }, + "container_registry": { + "key": "properties.containerRegistry", + "type": "str", + }, + "encryption": { + "key": "properties.encryption", + "type": "EncryptionUpdateProperties", + }, + "feature_store_settings": { + "key": "properties.featureStoreSettings", + "type": "FeatureStoreSettings", + }, + "managed_network": { + "key": "properties.managedNetwork", + "type": "ManagedNetworkSettings", + }, + } + + def __init__(self, **kwargs): """ :keyword tags: A set of tags. The resource tags for the machine learning workspace. :paramtype tags: dict[str, str] @@ -24253,17 +24639,23 @@ def __init__( :paramtype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings """ super(WorkspaceUpdateParameters, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) - self.identity = kwargs.get('identity', None) - self.description = kwargs.get('description', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.image_build_compute = kwargs.get('image_build_compute', None) - self.service_managed_resources_settings = kwargs.get('service_managed_resources_settings', None) - self.primary_user_assigned_identity = kwargs.get('primary_user_assigned_identity', None) - self.public_network_access = kwargs.get('public_network_access', None) - self.application_insights = kwargs.get('application_insights', None) - self.container_registry = kwargs.get('container_registry', None) - self.encryption = kwargs.get('encryption', None) - self.feature_store_settings = kwargs.get('feature_store_settings', None) - self.managed_network = kwargs.get('managed_network', None) + self.tags = kwargs.get("tags", None) + self.sku = kwargs.get("sku", None) + self.identity = kwargs.get("identity", None) + self.description = kwargs.get("description", None) + self.friendly_name = kwargs.get("friendly_name", None) + self.image_build_compute = kwargs.get("image_build_compute", None) + self.service_managed_resources_settings = kwargs.get( + "service_managed_resources_settings", None + ) + self.primary_user_assigned_identity = kwargs.get( + "primary_user_assigned_identity", None + ) + self.public_network_access = kwargs.get("public_network_access", None) + self.application_insights = kwargs.get("application_insights", None) + self.container_registry = kwargs.get("container_registry", None) + self.encryption = kwargs.get("encryption", None) + self.feature_store_settings = kwargs.get( + "feature_store_settings", None + ) + self.managed_network = kwargs.get("managed_network", None) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/models/_models_py3.py index 3b0b4eebd05f..200a0befcc01 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/models/_models_py3.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/models/_models_py3.py @@ -40,19 +40,27 @@ class WorkspaceConnectionPropertiesV2(msrest.serialization.Model): """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, } _subtype_map = { - 'auth_type': {'AccessKey': 'AccessKeyAuthTypeWorkspaceConnectionProperties', 'ManagedIdentity': 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', 'None': 'NoneAuthTypeWorkspaceConnectionProperties', 'PAT': 'PATAuthTypeWorkspaceConnectionProperties', 'SAS': 'SASAuthTypeWorkspaceConnectionProperties', 'ServicePrincipal': 'ServicePrincipalAuthTypeWorkspaceConnectionProperties', 'UsernamePassword': 'UsernamePasswordAuthTypeWorkspaceConnectionProperties'} + "auth_type": { + "AccessKey": "AccessKeyAuthTypeWorkspaceConnectionProperties", + "ManagedIdentity": "ManagedIdentityAuthTypeWorkspaceConnectionProperties", + "None": "NoneAuthTypeWorkspaceConnectionProperties", + "PAT": "PATAuthTypeWorkspaceConnectionProperties", + "SAS": "SASAuthTypeWorkspaceConnectionProperties", + "ServicePrincipal": "ServicePrincipalAuthTypeWorkspaceConnectionProperties", + "UsernamePassword": "UsernamePasswordAuthTypeWorkspaceConnectionProperties", + } } def __init__( @@ -85,7 +93,9 @@ def __init__( self.value_format = value_format -class AccessKeyAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class AccessKeyAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """AccessKeyAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -109,16 +119,19 @@ class AccessKeyAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionProperti """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionAccessKey'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionAccessKey", + }, } def __init__( @@ -146,8 +159,14 @@ def __init__( :keyword credentials: :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccessKey """ - super(AccessKeyAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'AccessKey' # type: str + super(AccessKeyAuthTypeWorkspaceConnectionProperties, self).__init__( + category=category, + target=target, + value=value, + value_format=value_format, + **kwargs + ) + self.auth_type = "AccessKey" # type: str self.credentials = credentials @@ -166,23 +185,27 @@ class DatastoreCredentials(msrest.serialization.Model): """ _validation = { - 'credentials_type': {'required': True}, + "credentials_type": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, } _subtype_map = { - 'credentials_type': {'AccountKey': 'AccountKeyDatastoreCredentials', 'Certificate': 'CertificateDatastoreCredentials', 'KerberosKeytab': 'KerberosKeytabCredentials', 'KerberosPassword': 'KerberosPasswordCredentials', 'None': 'NoneDatastoreCredentials', 'Sas': 'SasDatastoreCredentials', 'ServicePrincipal': 'ServicePrincipalDatastoreCredentials'} - } - - def __init__( - self, - **kwargs - ): - """ - """ + "credentials_type": { + "AccountKey": "AccountKeyDatastoreCredentials", + "Certificate": "CertificateDatastoreCredentials", + "KerberosKeytab": "KerberosKeytabCredentials", + "KerberosPassword": "KerberosPasswordCredentials", + "None": "NoneDatastoreCredentials", + "Sas": "SasDatastoreCredentials", + "ServicePrincipal": "ServicePrincipalDatastoreCredentials", + } + } + + def __init__(self, **kwargs): + """ """ super(DatastoreCredentials, self).__init__(**kwargs) self.credentials_type = None # type: Optional[str] @@ -201,27 +224,22 @@ class AccountKeyDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, + "credentials_type": {"required": True}, + "secrets": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'AccountKeyDatastoreSecrets'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "secrets": {"key": "secrets", "type": "AccountKeyDatastoreSecrets"}, } - def __init__( - self, - *, - secrets: "AccountKeyDatastoreSecrets", - **kwargs - ): + def __init__(self, *, secrets: "AccountKeyDatastoreSecrets", **kwargs): """ :keyword secrets: Required. [Required] Storage account secrets. :paramtype secrets: ~azure.mgmt.machinelearningservices.models.AccountKeyDatastoreSecrets """ super(AccountKeyDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'AccountKey' # type: str + self.credentials_type = "AccountKey" # type: str self.secrets = secrets @@ -240,23 +258,26 @@ class DatastoreSecrets(msrest.serialization.Model): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, } _subtype_map = { - 'secrets_type': {'AccountKey': 'AccountKeyDatastoreSecrets', 'Certificate': 'CertificateDatastoreSecrets', 'KerberosKeytab': 'KerberosKeytabSecrets', 'KerberosPassword': 'KerberosPasswordSecrets', 'Sas': 'SasDatastoreSecrets', 'ServicePrincipal': 'ServicePrincipalDatastoreSecrets'} - } - - def __init__( - self, - **kwargs - ): - """ - """ + "secrets_type": { + "AccountKey": "AccountKeyDatastoreSecrets", + "Certificate": "CertificateDatastoreSecrets", + "KerberosKeytab": "KerberosKeytabSecrets", + "KerberosPassword": "KerberosPasswordSecrets", + "Sas": "SasDatastoreSecrets", + "ServicePrincipal": "ServicePrincipalDatastoreSecrets", + } + } + + def __init__(self, **kwargs): + """ """ super(DatastoreSecrets, self).__init__(**kwargs) self.secrets_type = None # type: Optional[str] @@ -275,26 +296,21 @@ class AccountKeyDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "key": {"key": "key", "type": "str"}, } - def __init__( - self, - *, - key: Optional[str] = None, - **kwargs - ): + def __init__(self, *, key: Optional[str] = None, **kwargs): """ :keyword key: Storage account key. :paramtype key: str """ super(AccountKeyDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'AccountKey' # type: str + self.secrets_type = "AccountKey" # type: str self.key = key @@ -310,8 +326,14 @@ class AcrDetails(msrest.serialization.Model): """ _attribute_map = { - 'system_created_acr_account': {'key': 'systemCreatedAcrAccount', 'type': 'SystemCreatedAcrAccount'}, - 'user_created_acr_account': {'key': 'userCreatedAcrAccount', 'type': 'UserCreatedAcrAccount'}, + "system_created_acr_account": { + "key": "systemCreatedAcrAccount", + "type": "SystemCreatedAcrAccount", + }, + "user_created_acr_account": { + "key": "userCreatedAcrAccount", + "type": "UserCreatedAcrAccount", + }, } def __init__( @@ -342,14 +364,11 @@ class AKSSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, + "properties": {"key": "properties", "type": "AKSSchemaProperties"}, } def __init__( - self, - *, - properties: Optional["AKSSchemaProperties"] = None, - **kwargs + self, *, properties: Optional["AKSSchemaProperties"] = None, **kwargs ): """ :keyword properties: AKS properties. @@ -399,29 +418,43 @@ class Compute(msrest.serialization.Model): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } _subtype_map = { - 'compute_type': {'AKS': 'AKS', 'AmlCompute': 'AmlCompute', 'ComputeInstance': 'ComputeInstance', 'DataFactory': 'DataFactory', 'DataLakeAnalytics': 'DataLakeAnalytics', 'Databricks': 'Databricks', 'HDInsight': 'HDInsight', 'Kubernetes': 'Kubernetes', 'SynapseSpark': 'SynapseSpark', 'VirtualMachine': 'VirtualMachine'} + "compute_type": { + "AKS": "AKS", + "AmlCompute": "AmlCompute", + "ComputeInstance": "ComputeInstance", + "DataFactory": "DataFactory", + "DataLakeAnalytics": "DataLakeAnalytics", + "Databricks": "Databricks", + "HDInsight": "HDInsight", + "Kubernetes": "Kubernetes", + "SynapseSpark": "SynapseSpark", + "VirtualMachine": "VirtualMachine", + } } def __init__( @@ -496,26 +529,29 @@ class AKS(Compute, AKSSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "AKSSchemaProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -541,9 +577,16 @@ def __init__( MSI and AAD exclusively for authentication. :paramtype disable_local_auth: bool """ - super(AKS, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) + super(AKS, self).__init__( + compute_location=compute_location, + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'AKS' # type: str + self.compute_type = "AKS" # type: str self.compute_location = compute_location self.provisioning_state = None self.description = description @@ -569,9 +612,12 @@ class AksComputeSecretsProperties(msrest.serialization.Model): """ _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, + "user_kube_config": {"key": "userKubeConfig", "type": "str"}, + "admin_kube_config": {"key": "adminKubeConfig", "type": "str"}, + "image_pull_secret_name": { + "key": "imagePullSecretName", + "type": "str", + }, } def __init__( @@ -613,23 +659,23 @@ class ComputeSecrets(msrest.serialization.Model): """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "compute_type": {"key": "computeType", "type": "str"}, } _subtype_map = { - 'compute_type': {'AKS': 'AksComputeSecrets', 'Databricks': 'DatabricksComputeSecrets', 'VirtualMachine': 'VirtualMachineSecrets'} + "compute_type": { + "AKS": "AksComputeSecrets", + "Databricks": "DatabricksComputeSecrets", + "VirtualMachine": "VirtualMachineSecrets", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ComputeSecrets, self).__init__(**kwargs) self.compute_type = None # type: Optional[str] @@ -654,14 +700,17 @@ class AksComputeSecrets(ComputeSecrets, AksComputeSecretsProperties): """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "user_kube_config": {"key": "userKubeConfig", "type": "str"}, + "admin_kube_config": {"key": "adminKubeConfig", "type": "str"}, + "image_pull_secret_name": { + "key": "imagePullSecretName", + "type": "str", + }, + "compute_type": {"key": "computeType", "type": "str"}, } def __init__( @@ -682,11 +731,16 @@ def __init__( :keyword image_pull_secret_name: Image registry pull secret. :paramtype image_pull_secret_name: str """ - super(AksComputeSecrets, self).__init__(user_kube_config=user_kube_config, admin_kube_config=admin_kube_config, image_pull_secret_name=image_pull_secret_name, **kwargs) + super(AksComputeSecrets, self).__init__( + user_kube_config=user_kube_config, + admin_kube_config=admin_kube_config, + image_pull_secret_name=image_pull_secret_name, + **kwargs + ) self.user_kube_config = user_kube_config self.admin_kube_config = admin_kube_config self.image_pull_secret_name = image_pull_secret_name - self.compute_type = 'AKS' # type: str + self.compute_type = "AKS" # type: str class AksNetworkingConfiguration(msrest.serialization.Model): @@ -706,16 +760,22 @@ class AksNetworkingConfiguration(msrest.serialization.Model): """ _validation = { - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, + "service_cidr": { + "pattern": r"^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$" + }, + "dns_service_ip": { + "pattern": r"^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" + }, + "docker_bridge_cidr": { + "pattern": r"^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$" + }, } _attribute_map = { - 'subnet_id': {'key': 'subnetId', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, + "subnet_id": {"key": "subnetId", "type": "str"}, + "service_cidr": {"key": "serviceCidr", "type": "str"}, + "dns_service_ip": {"key": "dnsServiceIP", "type": "str"}, + "docker_bridge_cidr": {"key": "dockerBridgeCidr", "type": "str"}, } def __init__( @@ -776,20 +836,29 @@ class AKSSchemaProperties(msrest.serialization.Model): """ _validation = { - 'system_services': {'readonly': True}, - 'agent_count': {'minimum': 0}, + "system_services": {"readonly": True}, + "agent_count": {"minimum": 0}, } _attribute_map = { - 'cluster_fqdn': {'key': 'clusterFqdn', 'type': 'str'}, - 'system_services': {'key': 'systemServices', 'type': '[SystemService]'}, - 'agent_count': {'key': 'agentCount', 'type': 'int'}, - 'agent_vm_size': {'key': 'agentVmSize', 'type': 'str'}, - 'cluster_purpose': {'key': 'clusterPurpose', 'type': 'str'}, - 'ssl_configuration': {'key': 'sslConfiguration', 'type': 'SslConfiguration'}, - 'aks_networking_configuration': {'key': 'aksNetworkingConfiguration', 'type': 'AksNetworkingConfiguration'}, - 'load_balancer_type': {'key': 'loadBalancerType', 'type': 'str'}, - 'load_balancer_subnet': {'key': 'loadBalancerSubnet', 'type': 'str'}, + "cluster_fqdn": {"key": "clusterFqdn", "type": "str"}, + "system_services": { + "key": "systemServices", + "type": "[SystemService]", + }, + "agent_count": {"key": "agentCount", "type": "int"}, + "agent_vm_size": {"key": "agentVmSize", "type": "str"}, + "cluster_purpose": {"key": "clusterPurpose", "type": "str"}, + "ssl_configuration": { + "key": "sslConfiguration", + "type": "SslConfiguration", + }, + "aks_networking_configuration": { + "key": "aksNetworkingConfiguration", + "type": "AksNetworkingConfiguration", + }, + "load_balancer_type": {"key": "loadBalancerType", "type": "str"}, + "load_balancer_subnet": {"key": "loadBalancerSubnet", "type": "str"}, } def __init__( @@ -800,8 +869,12 @@ def __init__( agent_vm_size: Optional[str] = None, cluster_purpose: Optional[Union[str, "ClusterPurpose"]] = "FastProd", ssl_configuration: Optional["SslConfiguration"] = None, - aks_networking_configuration: Optional["AksNetworkingConfiguration"] = None, - load_balancer_type: Optional[Union[str, "LoadBalancerType"]] = "PublicIp", + aks_networking_configuration: Optional[ + "AksNetworkingConfiguration" + ] = None, + load_balancer_type: Optional[ + Union[str, "LoadBalancerType"] + ] = "PublicIp", load_balancer_subnet: Optional[str] = None, **kwargs ): @@ -853,23 +926,17 @@ class Nodes(msrest.serialization.Model): """ _validation = { - 'nodes_value_type': {'required': True}, + "nodes_value_type": {"required": True}, } _attribute_map = { - 'nodes_value_type': {'key': 'nodesValueType', 'type': 'str'}, + "nodes_value_type": {"key": "nodesValueType", "type": "str"}, } - _subtype_map = { - 'nodes_value_type': {'All': 'AllNodes'} - } + _subtype_map = {"nodes_value_type": {"All": "AllNodes"}} - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Nodes, self).__init__(**kwargs) self.nodes_value_type = None # type: Optional[str] @@ -885,21 +952,17 @@ class AllNodes(Nodes): """ _validation = { - 'nodes_value_type': {'required': True}, + "nodes_value_type": {"required": True}, } _attribute_map = { - 'nodes_value_type': {'key': 'nodesValueType', 'type': 'str'}, + "nodes_value_type": {"key": "nodesValueType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AllNodes, self).__init__(**kwargs) - self.nodes_value_type = 'All' # type: str + self.nodes_value_type = "All" # type: str class AmlComputeSchema(msrest.serialization.Model): @@ -910,14 +973,11 @@ class AmlComputeSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, + "properties": {"key": "properties", "type": "AmlComputeProperties"}, } def __init__( - self, - *, - properties: Optional["AmlComputeProperties"] = None, - **kwargs + self, *, properties: Optional["AmlComputeProperties"] = None, **kwargs ): """ :keyword properties: Properties of AmlCompute. @@ -966,26 +1026,29 @@ class AmlCompute(Compute, AmlComputeSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "AmlComputeProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -1011,9 +1074,16 @@ def __init__( MSI and AAD exclusively for authentication. :paramtype disable_local_auth: bool """ - super(AmlCompute, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) + super(AmlCompute, self).__init__( + compute_location=compute_location, + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'AmlCompute' # type: str + self.compute_type = "AmlCompute" # type: str self.compute_location = compute_location self.provisioning_state = None self.description = description @@ -1047,29 +1117,25 @@ class AmlComputeNodeInformation(msrest.serialization.Model): """ _validation = { - 'node_id': {'readonly': True}, - 'private_ip_address': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'port': {'readonly': True}, - 'node_state': {'readonly': True}, - 'run_id': {'readonly': True}, + "node_id": {"readonly": True}, + "private_ip_address": {"readonly": True}, + "public_ip_address": {"readonly": True}, + "port": {"readonly": True}, + "node_state": {"readonly": True}, + "run_id": {"readonly": True}, } _attribute_map = { - 'node_id': {'key': 'nodeId', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'node_state': {'key': 'nodeState', 'type': 'str'}, - 'run_id': {'key': 'runId', 'type': 'str'}, + "node_id": {"key": "nodeId", "type": "str"}, + "private_ip_address": {"key": "privateIpAddress", "type": "str"}, + "public_ip_address": {"key": "publicIpAddress", "type": "str"}, + "port": {"key": "port", "type": "int"}, + "node_state": {"key": "nodeState", "type": "str"}, + "run_id": {"key": "runId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AmlComputeNodeInformation, self).__init__(**kwargs) self.node_id = None self.private_ip_address = None @@ -1091,21 +1157,17 @@ class AmlComputeNodesInformation(msrest.serialization.Model): """ _validation = { - 'nodes': {'readonly': True}, - 'next_link': {'readonly': True}, + "nodes": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'nodes': {'key': 'nodes', 'type': '[AmlComputeNodeInformation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "nodes": {"key": "nodes", "type": "[AmlComputeNodeInformation]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AmlComputeNodesInformation, self).__init__(**kwargs) self.nodes = None self.next_link = None @@ -1176,32 +1238,47 @@ class AmlComputeProperties(msrest.serialization.Model): """ _validation = { - 'allocation_state': {'readonly': True}, - 'allocation_state_transition_time': {'readonly': True}, - 'errors': {'readonly': True}, - 'current_node_count': {'readonly': True}, - 'target_node_count': {'readonly': True}, - 'node_state_counts': {'readonly': True}, - } - - _attribute_map = { - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'vm_priority': {'key': 'vmPriority', 'type': 'str'}, - 'virtual_machine_image': {'key': 'virtualMachineImage', 'type': 'VirtualMachineImage'}, - 'isolated_network': {'key': 'isolatedNetwork', 'type': 'bool'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, - 'user_account_credentials': {'key': 'userAccountCredentials', 'type': 'UserAccountCredentials'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'remote_login_port_public_access': {'key': 'remoteLoginPortPublicAccess', 'type': 'str'}, - 'allocation_state': {'key': 'allocationState', 'type': 'str'}, - 'allocation_state_transition_time': {'key': 'allocationStateTransitionTime', 'type': 'iso-8601'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'current_node_count': {'key': 'currentNodeCount', 'type': 'int'}, - 'target_node_count': {'key': 'targetNodeCount', 'type': 'int'}, - 'node_state_counts': {'key': 'nodeStateCounts', 'type': 'NodeStateCounts'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'property_bag': {'key': 'propertyBag', 'type': 'object'}, + "allocation_state": {"readonly": True}, + "allocation_state_transition_time": {"readonly": True}, + "errors": {"readonly": True}, + "current_node_count": {"readonly": True}, + "target_node_count": {"readonly": True}, + "node_state_counts": {"readonly": True}, + } + + _attribute_map = { + "os_type": {"key": "osType", "type": "str"}, + "vm_size": {"key": "vmSize", "type": "str"}, + "vm_priority": {"key": "vmPriority", "type": "str"}, + "virtual_machine_image": { + "key": "virtualMachineImage", + "type": "VirtualMachineImage", + }, + "isolated_network": {"key": "isolatedNetwork", "type": "bool"}, + "scale_settings": {"key": "scaleSettings", "type": "ScaleSettings"}, + "user_account_credentials": { + "key": "userAccountCredentials", + "type": "UserAccountCredentials", + }, + "subnet": {"key": "subnet", "type": "ResourceId"}, + "remote_login_port_public_access": { + "key": "remoteLoginPortPublicAccess", + "type": "str", + }, + "allocation_state": {"key": "allocationState", "type": "str"}, + "allocation_state_transition_time": { + "key": "allocationStateTransitionTime", + "type": "iso-8601", + }, + "errors": {"key": "errors", "type": "[ErrorResponse]"}, + "current_node_count": {"key": "currentNodeCount", "type": "int"}, + "target_node_count": {"key": "targetNodeCount", "type": "int"}, + "node_state_counts": { + "key": "nodeStateCounts", + "type": "NodeStateCounts", + }, + "enable_node_public_ip": {"key": "enableNodePublicIp", "type": "bool"}, + "property_bag": {"key": "propertyBag", "type": "object"}, } def __init__( @@ -1215,7 +1292,9 @@ def __init__( scale_settings: Optional["ScaleSettings"] = None, user_account_credentials: Optional["UserAccountCredentials"] = None, subnet: Optional["ResourceId"] = None, - remote_login_port_public_access: Optional[Union[str, "RemoteLoginPortPublicAccess"]] = "NotSpecified", + remote_login_port_public_access: Optional[ + Union[str, "RemoteLoginPortPublicAccess"] + ] = "NotSpecified", enable_node_public_ip: Optional[bool] = True, property_bag: Optional[Any] = None, **kwargs @@ -1291,9 +1370,9 @@ class AmlOperation(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'AmlOperationDisplay'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + "name": {"key": "name", "type": "str"}, + "display": {"key": "display", "type": "AmlOperationDisplay"}, + "is_data_action": {"key": "isDataAction", "type": "bool"}, } def __init__( @@ -1332,10 +1411,10 @@ class AmlOperationDisplay(msrest.serialization.Model): """ _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, + "provider": {"key": "provider", "type": "str"}, + "resource": {"key": "resource", "type": "str"}, + "operation": {"key": "operation", "type": "str"}, + "description": {"key": "description", "type": "str"}, } def __init__( @@ -1372,14 +1451,11 @@ class AmlOperationListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlOperation]'}, + "value": {"key": "value", "type": "[AmlOperation]"}, } def __init__( - self, - *, - value: Optional[List["AmlOperation"]] = None, - **kwargs + self, *, value: Optional[List["AmlOperation"]] = None, **kwargs ): """ :keyword value: List of AML operations supported by the AML resource provider. @@ -1404,23 +1480,23 @@ class IdentityConfiguration(msrest.serialization.Model): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, } _subtype_map = { - 'identity_type': {'AMLToken': 'AmlToken', 'Managed': 'ManagedIdentity', 'UserIdentity': 'UserIdentity'} + "identity_type": { + "AMLToken": "AmlToken", + "Managed": "ManagedIdentity", + "UserIdentity": "UserIdentity", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(IdentityConfiguration, self).__init__(**kwargs) self.identity_type = None # type: Optional[str] @@ -1437,21 +1513,17 @@ class AmlToken(IdentityConfiguration): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AmlToken, self).__init__(**kwargs) - self.identity_type = 'AMLToken' # type: str + self.identity_type = "AMLToken" # type: str class AmlUserFeature(msrest.serialization.Model): @@ -1466,9 +1538,9 @@ class AmlUserFeature(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "description": {"key": "description", "type": "str"}, } def __init__( @@ -1504,15 +1576,10 @@ class ArmResourceId(msrest.serialization.Model): """ _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, + "resource_id": {"key": "resourceId", "type": "str"}, } - def __init__( - self, - *, - resource_id: Optional[str] = None, - **kwargs - ): + def __init__(self, *, resource_id: Optional[str] = None, **kwargs): """ :keyword resource_id: Arm ResourceId is in the format "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName}" @@ -1536,9 +1603,9 @@ class ResourceBase(msrest.serialization.Model): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, } def __init__( @@ -1579,11 +1646,11 @@ class AssetBase(ResourceBase): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, } def __init__( @@ -1608,7 +1675,9 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(AssetBase, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + super(AssetBase, self).__init__( + description=description, properties=properties, tags=tags, **kwargs + ) self.is_anonymous = is_anonymous self.is_archived = is_archived @@ -1633,17 +1702,17 @@ class AssetContainer(ResourceBase): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, } def __init__( @@ -1665,7 +1734,9 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(AssetContainer, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + super(AssetContainer, self).__init__( + description=description, properties=properties, tags=tags, **kwargs + ) self.is_archived = is_archived self.latest_version = None self.next_version = None @@ -1684,12 +1755,12 @@ class AssetJobInput(msrest.serialization.Model): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, } def __init__( @@ -1726,10 +1797,10 @@ class AssetJobOutput(msrest.serialization.Model): """ _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, + "asset_name": {"key": "assetName", "type": "str"}, + "asset_version": {"key": "assetVersion", "type": "str"}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, } def __init__( @@ -1773,23 +1844,23 @@ class AssetReferenceBase(msrest.serialization.Model): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, } _subtype_map = { - 'reference_type': {'DataPath': 'DataPathAssetReference', 'Id': 'IdAssetReference', 'OutputPath': 'OutputPathAssetReference'} + "reference_type": { + "DataPath": "DataPathAssetReference", + "Id": "IdAssetReference", + "OutputPath": "OutputPathAssetReference", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AssetReferenceBase, self).__init__(**kwargs) self.reference_type = None # type: Optional[str] @@ -1806,22 +1877,16 @@ class AssignedUser(msrest.serialization.Model): """ _validation = { - 'object_id': {'required': True}, - 'tenant_id': {'required': True}, + "object_id": {"required": True}, + "tenant_id": {"required": True}, } _attribute_map = { - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + "object_id": {"key": "objectId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, } - def __init__( - self, - *, - object_id: str, - tenant_id: str, - **kwargs - ): + def __init__(self, *, object_id: str, tenant_id: str, **kwargs): """ :keyword object_id: Required. User’s AAD Object Id. :paramtype object_id: str @@ -1847,23 +1912,22 @@ class ForecastHorizon(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoForecastHorizon', 'Custom': 'CustomForecastHorizon'} + "mode": { + "Auto": "AutoForecastHorizon", + "Custom": "CustomForecastHorizon", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ForecastHorizon, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -1879,21 +1943,17 @@ class AutoForecastHorizon(ForecastHorizon): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoForecastHorizon, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class AutologgerSettings(msrest.serialization.Model): @@ -1908,11 +1968,11 @@ class AutologgerSettings(msrest.serialization.Model): """ _validation = { - 'mlflow_autologger': {'required': True}, + "mlflow_autologger": {"required": True}, } _attribute_map = { - 'mlflow_autologger': {'key': 'mlflowAutologger', 'type': 'str'}, + "mlflow_autologger": {"key": "mlflowAutologger", "type": "str"}, } def __init__( @@ -1975,27 +2035,34 @@ class JobBaseProperties(ResourceBase): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, + "job_type": {"required": True}, + "status": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, } _subtype_map = { - 'job_type': {'AutoML': 'AutoMLJob', 'Command': 'CommandJob', 'Labeling': 'LabelingJobProperties', 'Pipeline': 'PipelineJob', 'Spark': 'SparkJob', 'Sweep': 'SweepJob'} + "job_type": { + "AutoML": "AutoMLJob", + "Command": "CommandJob", + "Labeling": "LabelingJobProperties", + "Pipeline": "PipelineJob", + "Spark": "SparkJob", + "Sweep": "SweepJob", + } } def __init__( @@ -2039,97 +2106,102 @@ def __init__( For local jobs, a job endpoint will have an endpoint value of FileStreamObject. :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] """ - super(JobBaseProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + super(JobBaseProperties, self).__init__( + description=description, properties=properties, tags=tags, **kwargs + ) self.component_id = component_id self.compute_id = compute_id self.display_name = display_name self.experiment_name = experiment_name self.identity = identity self.is_archived = is_archived - self.job_type = 'JobBaseProperties' # type: str + self.job_type = "JobBaseProperties" # type: str self.services = services self.status = None class AutoMLJob(JobBaseProperties): """AutoMLJob class. -Use this class for executing AutoML tasks like Classification/Regression etc. -See TaskType enum for all the tasks supported. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar environment_id: The ARM resource ID of the Environment specification for the job. - This is optional value to provide, if not provided, AutoML will default this to Production - AutoML curated environment version when running the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - :ivar task_details: Required. [Required] This represents scenario which can be one of - Tables/NLP/Image. - :vartype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical + Use this class for executing AutoML tasks like Classification/Regression etc. + See TaskType enum for all the tasks supported. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar description: The asset description text. + :vartype description: str + :ivar properties: The asset property dictionary. + :vartype properties: dict[str, str] + :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + :ivar component_id: ARM resource ID of the component resource. + :vartype component_id: str + :ivar compute_id: ARM resource ID of the compute resource. + :vartype compute_id: str + :ivar display_name: Display name of job. + :vartype display_name: str + :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is + placed in the "Default" experiment. + :vartype experiment_name: str + :ivar identity: Identity configuration. If set, this should be one of AmlToken, + ManagedIdentity, UserIdentity or null. + Defaults to AmlToken if null. + :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration + :ivar is_archived: Is the asset archived?. + :vartype is_archived: bool + :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. + Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark". + :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType + :ivar services: List of JobEndpoints. + For local jobs, a job endpoint will have an endpoint value of FileStreamObject. + :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] + :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", + "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", + "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". + :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus + :ivar environment_id: The ARM resource ID of the Environment specification for the job. + This is optional value to provide, if not provided, AutoML will default this to Production + AutoML curated environment version when running the job. + :vartype environment_id: str + :ivar environment_variables: Environment variables included in the job. + :vartype environment_variables: dict[str, str] + :ivar outputs: Mapping of output data bindings used in the job. + :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] + :ivar resources: Compute Resource configuration for the job. + :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration + :ivar task_details: Required. [Required] This represents scenario which can be one of + Tables/NLP/Image. + :vartype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'task_details': {'required': True}, + "job_type": {"required": True}, + "status": {"readonly": True}, + "task_details": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - 'task_details': {'key': 'taskDetails', 'type': 'AutoMLVertical'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "resources": {"key": "resources", "type": "JobResourceConfiguration"}, + "task_details": {"key": "taskDetails", "type": "AutoMLVertical"}, } def __init__( @@ -2191,8 +2263,20 @@ def __init__( Tables/NLP/Image. :paramtype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical """ - super(AutoMLJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, services=services, **kwargs) - self.job_type = 'AutoML' # type: str + super(AutoMLJob, self).__init__( + description=description, + properties=properties, + tags=tags, + component_id=component_id, + compute_id=compute_id, + display_name=display_name, + experiment_name=experiment_name, + identity=identity, + is_archived=is_archived, + services=services, + **kwargs + ) + self.job_type = "AutoML" # type: str self.environment_id = environment_id self.environment_variables = environment_variables self.outputs = outputs @@ -2202,42 +2286,53 @@ def __init__( class AutoMLVertical(msrest.serialization.Model): """AutoML vertical class. -Base class for AutoML verticals - TableVertical/ImageVertical/NLPVertical. + Base class for AutoML verticals - TableVertical/ImageVertical/NLPVertical. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Classification, Forecasting, ImageClassification, ImageClassificationMultilabel, ImageInstanceSegmentation, ImageObjectDetection, Regression, TextClassification, TextClassificationMultilabel, TextNer. + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Classification, Forecasting, ImageClassification, ImageClassificationMultilabel, ImageInstanceSegmentation, ImageObjectDetection, Regression, TextClassification, TextClassificationMultilabel, TextNer. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, + "task_type": {"required": True}, + "training_data": {"required": True}, } _attribute_map = { - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, } _subtype_map = { - 'task_type': {'Classification': 'Classification', 'Forecasting': 'Forecasting', 'ImageClassification': 'ImageClassification', 'ImageClassificationMultilabel': 'ImageClassificationMultilabel', 'ImageInstanceSegmentation': 'ImageInstanceSegmentation', 'ImageObjectDetection': 'ImageObjectDetection', 'Regression': 'Regression', 'TextClassification': 'TextClassification', 'TextClassificationMultilabel': 'TextClassificationMultilabel', 'TextNER': 'TextNer'} + "task_type": { + "Classification": "Classification", + "Forecasting": "Forecasting", + "ImageClassification": "ImageClassification", + "ImageClassificationMultilabel": "ImageClassificationMultilabel", + "ImageInstanceSegmentation": "ImageInstanceSegmentation", + "ImageObjectDetection": "ImageObjectDetection", + "Regression": "Regression", + "TextClassification": "TextClassification", + "TextClassificationMultilabel": "TextClassificationMultilabel", + "TextNER": "TextNer", + } } def __init__( @@ -2279,23 +2374,22 @@ class NCrossValidations(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoNCrossValidations', 'Custom': 'CustomNCrossValidations'} + "mode": { + "Auto": "AutoNCrossValidations", + "Custom": "CustomNCrossValidations", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NCrossValidations, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -2311,21 +2405,17 @@ class AutoNCrossValidations(NCrossValidations): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoNCrossValidations, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class AutoPauseProperties(msrest.serialization.Model): @@ -2338,8 +2428,8 @@ class AutoPauseProperties(msrest.serialization.Model): """ _attribute_map = { - 'delay_in_minutes': {'key': 'delayInMinutes', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, + "delay_in_minutes": {"key": "delayInMinutes", "type": "int"}, + "enabled": {"key": "enabled", "type": "bool"}, } def __init__( @@ -2372,9 +2462,9 @@ class AutoScaleProperties(msrest.serialization.Model): """ _attribute_map = { - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, + "min_node_count": {"key": "minNodeCount", "type": "int"}, + "enabled": {"key": "enabled", "type": "bool"}, + "max_node_count": {"key": "maxNodeCount", "type": "int"}, } def __init__( @@ -2413,23 +2503,19 @@ class Seasonality(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoSeasonality', 'Custom': 'CustomSeasonality'} + "mode": {"Auto": "AutoSeasonality", "Custom": "CustomSeasonality"} } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Seasonality, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -2445,21 +2531,17 @@ class AutoSeasonality(Seasonality): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoSeasonality, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class TargetLags(msrest.serialization.Model): @@ -2476,23 +2558,19 @@ class TargetLags(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoTargetLags', 'Custom': 'CustomTargetLags'} + "mode": {"Auto": "AutoTargetLags", "Custom": "CustomTargetLags"} } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(TargetLags, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -2508,21 +2586,17 @@ class AutoTargetLags(TargetLags): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoTargetLags, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class TargetRollingWindowSize(msrest.serialization.Model): @@ -2539,23 +2613,22 @@ class TargetRollingWindowSize(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoTargetRollingWindowSize', 'Custom': 'CustomTargetRollingWindowSize'} + "mode": { + "Auto": "AutoTargetRollingWindowSize", + "Custom": "CustomTargetRollingWindowSize", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(TargetRollingWindowSize, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -2571,21 +2644,17 @@ class AutoTargetRollingWindowSize(TargetRollingWindowSize): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class AzureDatastore(msrest.serialization.Model): @@ -2598,8 +2667,8 @@ class AzureDatastore(msrest.serialization.Model): """ _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + "resource_group": {"key": "resourceGroup", "type": "str"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, } def __init__( @@ -2648,22 +2717,28 @@ class DatastoreProperties(ResourceBase): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, } _subtype_map = { - 'datastore_type': {'AzureBlob': 'AzureBlobDatastore', 'AzureDataLakeGen1': 'AzureDataLakeGen1Datastore', 'AzureDataLakeGen2': 'AzureDataLakeGen2Datastore', 'AzureFile': 'AzureFileDatastore', 'Hdfs': 'HdfsDatastore'} + "datastore_type": { + "AzureBlob": "AzureBlobDatastore", + "AzureDataLakeGen1": "AzureDataLakeGen1Datastore", + "AzureDataLakeGen2": "AzureDataLakeGen2Datastore", + "AzureFile": "AzureFileDatastore", + "Hdfs": "HdfsDatastore", + } } def __init__( @@ -2685,9 +2760,11 @@ def __init__( :keyword credentials: Required. [Required] Account credentials. :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials """ - super(DatastoreProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + super(DatastoreProperties, self).__init__( + description=description, properties=properties, tags=tags, **kwargs + ) self.credentials = credentials - self.datastore_type = 'DatastoreProperties' # type: str + self.datastore_type = "DatastoreProperties" # type: str self.is_default = None @@ -2733,25 +2810,28 @@ class AzureBlobDatastore(DatastoreProperties, AzureDatastore): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, } _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, + "resource_group": {"key": "resourceGroup", "type": "str"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "account_name": {"key": "accountName", "type": "str"}, + "container_name": {"key": "containerName", "type": "str"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } def __init__( @@ -2767,7 +2847,9 @@ def __init__( container_name: Optional[str] = None, endpoint: Optional[str] = None, protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, + service_data_access_auth_identity: Optional[ + Union[str, "ServiceDataAccessAuthIdentity"] + ] = None, **kwargs ): """ @@ -2797,15 +2879,25 @@ def __init__( :paramtype service_data_access_auth_identity: str or ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ - super(AzureBlobDatastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, resource_group=resource_group, subscription_id=subscription_id, **kwargs) + super(AzureBlobDatastore, self).__init__( + description=description, + properties=properties, + tags=tags, + credentials=credentials, + resource_group=resource_group, + subscription_id=subscription_id, + **kwargs + ) self.resource_group = resource_group self.subscription_id = subscription_id - self.datastore_type = 'AzureBlob' # type: str + self.datastore_type = "AzureBlob" # type: str self.account_name = account_name self.container_name = container_name self.endpoint = endpoint self.protocol = protocol - self.service_data_access_auth_identity = service_data_access_auth_identity + self.service_data_access_auth_identity = ( + service_data_access_auth_identity + ) self.description = description self.properties = properties self.tags = tags @@ -2849,23 +2941,26 @@ class AzureDataLakeGen1Datastore(DatastoreProperties, AzureDatastore): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'store_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "store_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - 'store_name': {'key': 'storeName', 'type': 'str'}, + "resource_group": {"key": "resourceGroup", "type": "str"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, + "store_name": {"key": "storeName", "type": "str"}, } def __init__( @@ -2878,7 +2973,9 @@ def __init__( description: Optional[str] = None, properties: Optional[Dict[str, str]] = None, tags: Optional[Dict[str, str]] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, + service_data_access_auth_identity: Optional[ + Union[str, "ServiceDataAccessAuthIdentity"] + ] = None, **kwargs ): """ @@ -2902,11 +2999,21 @@ def __init__( :keyword store_name: Required. [Required] Azure Data Lake store name. :paramtype store_name: str """ - super(AzureDataLakeGen1Datastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, resource_group=resource_group, subscription_id=subscription_id, **kwargs) + super(AzureDataLakeGen1Datastore, self).__init__( + description=description, + properties=properties, + tags=tags, + credentials=credentials, + resource_group=resource_group, + subscription_id=subscription_id, + **kwargs + ) self.resource_group = resource_group self.subscription_id = subscription_id - self.datastore_type = 'AzureDataLakeGen1' # type: str - self.service_data_access_auth_identity = service_data_access_auth_identity + self.datastore_type = "AzureDataLakeGen1" # type: str + self.service_data_access_auth_identity = ( + service_data_access_auth_identity + ) self.store_name = store_name self.description = description self.properties = properties @@ -2957,27 +3064,30 @@ class AzureDataLakeGen2Datastore(DatastoreProperties, AzureDatastore): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'filesystem': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "account_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "filesystem": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'filesystem': {'key': 'filesystem', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, + "resource_group": {"key": "resourceGroup", "type": "str"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "account_name": {"key": "accountName", "type": "str"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "filesystem": {"key": "filesystem", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } def __init__( @@ -2993,7 +3103,9 @@ def __init__( tags: Optional[Dict[str, str]] = None, endpoint: Optional[str] = None, protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, + service_data_access_auth_identity: Optional[ + Union[str, "ServiceDataAccessAuthIdentity"] + ] = None, **kwargs ): """ @@ -3023,15 +3135,25 @@ def __init__( :paramtype service_data_access_auth_identity: str or ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ - super(AzureDataLakeGen2Datastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, resource_group=resource_group, subscription_id=subscription_id, **kwargs) + super(AzureDataLakeGen2Datastore, self).__init__( + description=description, + properties=properties, + tags=tags, + credentials=credentials, + resource_group=resource_group, + subscription_id=subscription_id, + **kwargs + ) self.resource_group = resource_group self.subscription_id = subscription_id - self.datastore_type = 'AzureDataLakeGen2' # type: str + self.datastore_type = "AzureDataLakeGen2" # type: str self.account_name = account_name self.endpoint = endpoint self.filesystem = filesystem self.protocol = protocol - self.service_data_access_auth_identity = service_data_access_auth_identity + self.service_data_access_auth_identity = ( + service_data_access_auth_identity + ) self.description = description self.properties = properties self.tags = tags @@ -3082,27 +3204,30 @@ class AzureFileDatastore(DatastoreProperties, AzureDatastore): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'file_share_name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "account_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "file_share_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'file_share_name': {'key': 'fileShareName', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, + "resource_group": {"key": "resourceGroup", "type": "str"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "account_name": {"key": "accountName", "type": "str"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "file_share_name": {"key": "fileShareName", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } def __init__( @@ -3118,7 +3243,9 @@ def __init__( tags: Optional[Dict[str, str]] = None, endpoint: Optional[str] = None, protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, + service_data_access_auth_identity: Optional[ + Union[str, "ServiceDataAccessAuthIdentity"] + ] = None, **kwargs ): """ @@ -3149,15 +3276,25 @@ def __init__( :paramtype service_data_access_auth_identity: str or ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ - super(AzureFileDatastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, resource_group=resource_group, subscription_id=subscription_id, **kwargs) + super(AzureFileDatastore, self).__init__( + description=description, + properties=properties, + tags=tags, + credentials=credentials, + resource_group=resource_group, + subscription_id=subscription_id, + **kwargs + ) self.resource_group = resource_group self.subscription_id = subscription_id - self.datastore_type = 'AzureFile' # type: str + self.datastore_type = "AzureFile" # type: str self.account_name = account_name self.endpoint = endpoint self.file_share_name = file_share_name self.protocol = protocol - self.service_data_access_auth_identity = service_data_access_auth_identity + self.service_data_access_auth_identity = ( + service_data_access_auth_identity + ) self.description = description self.properties = properties self.tags = tags @@ -3184,17 +3321,21 @@ class EarlyTerminationPolicy(msrest.serialization.Model): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, } _subtype_map = { - 'policy_type': {'Bandit': 'BanditPolicy', 'MedianStopping': 'MedianStoppingPolicy', 'TruncationSelection': 'TruncationSelectionPolicy'} + "policy_type": { + "Bandit": "BanditPolicy", + "MedianStopping": "MedianStoppingPolicy", + "TruncationSelection": "TruncationSelectionPolicy", + } } def __init__( @@ -3236,15 +3377,15 @@ class BanditPolicy(EarlyTerminationPolicy): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'slack_amount': {'key': 'slackAmount', 'type': 'float'}, - 'slack_factor': {'key': 'slackFactor', 'type': 'float'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, + "slack_amount": {"key": "slackAmount", "type": "float"}, + "slack_factor": {"key": "slackFactor", "type": "float"}, } def __init__( @@ -3266,8 +3407,12 @@ def __init__( :keyword slack_factor: Ratio of the allowed distance from the best performing run. :paramtype slack_factor: float """ - super(BanditPolicy, self).__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs) - self.policy_type = 'Bandit' # type: str + super(BanditPolicy, self).__init__( + delay_evaluation=delay_evaluation, + evaluation_interval=evaluation_interval, + **kwargs + ) + self.policy_type = "Bandit" # type: str self.slack_amount = slack_amount self.slack_factor = slack_factor @@ -3291,25 +3436,21 @@ class Resource(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -3342,28 +3483,24 @@ class TrackedResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, } def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - **kwargs + self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs ): """ :keyword tags: A set of tags. Resource tags. @@ -3410,25 +3547,28 @@ class BatchDeployment(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchDeploymentProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": { + "key": "properties", + "type": "BatchDeploymentProperties", + }, + "sku": {"key": "sku", "type": "Sku"}, } def __init__( @@ -3457,7 +3597,9 @@ def __init__( :keyword sku: Sku details required for ARM contract for Autoscaling. :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ - super(BatchDeployment, self).__init__(tags=tags, location=location, **kwargs) + super(BatchDeployment, self).__init__( + tags=tags, location=location, **kwargs + ) self.identity = identity self.kind = kind self.properties = properties @@ -3481,11 +3623,17 @@ class EndpointDeploymentPropertiesBase(msrest.serialization.Model): """ _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, } def __init__( @@ -3573,26 +3721,41 @@ class BatchDeploymentProperties(EndpointDeploymentPropertiesBase): """ _validation = { - 'provisioning_state': {'readonly': True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'error_threshold': {'key': 'errorThreshold', 'type': 'int'}, - 'logging_level': {'key': 'loggingLevel', 'type': 'str'}, - 'max_concurrency_per_instance': {'key': 'maxConcurrencyPerInstance', 'type': 'int'}, - 'mini_batch_size': {'key': 'miniBatchSize', 'type': 'long'}, - 'model': {'key': 'model', 'type': 'AssetReferenceBase'}, - 'output_action': {'key': 'outputAction', 'type': 'str'}, - 'output_file_name': {'key': 'outputFileName', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'resources': {'key': 'resources', 'type': 'DeploymentResourceConfiguration'}, - 'retry_settings': {'key': 'retrySettings', 'type': 'BatchRetrySettings'}, + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "compute": {"key": "compute", "type": "str"}, + "error_threshold": {"key": "errorThreshold", "type": "int"}, + "logging_level": {"key": "loggingLevel", "type": "str"}, + "max_concurrency_per_instance": { + "key": "maxConcurrencyPerInstance", + "type": "int", + }, + "mini_batch_size": {"key": "miniBatchSize", "type": "long"}, + "model": {"key": "model", "type": "AssetReferenceBase"}, + "output_action": {"key": "outputAction", "type": "str"}, + "output_file_name": {"key": "outputFileName", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "resources": { + "key": "resources", + "type": "DeploymentResourceConfiguration", + }, + "retry_settings": { + "key": "retrySettings", + "type": "BatchRetrySettings", + }, } def __init__( @@ -3660,7 +3823,14 @@ def __init__( If not provided, will default to the defaults defined in BatchRetrySettings. :paramtype retry_settings: ~azure.mgmt.machinelearningservices.models.BatchRetrySettings """ - super(BatchDeploymentProperties, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, **kwargs) + super(BatchDeploymentProperties, self).__init__( + code_configuration=code_configuration, + description=description, + environment_id=environment_id, + environment_variables=environment_variables, + properties=properties, + **kwargs + ) self.compute = compute self.error_threshold = error_threshold self.logging_level = logging_level @@ -3674,7 +3844,9 @@ def __init__( self.retry_settings = retry_settings -class BatchDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class BatchDeploymentTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of BatchDeployment entities. :ivar next_link: The link to the next page of BatchDeployment objects. If null, there are no @@ -3685,8 +3857,8 @@ class BatchDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Mode """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchDeployment]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[BatchDeployment]"}, } def __init__( @@ -3703,7 +3875,9 @@ def __init__( :keyword value: An array of objects of type BatchDeployment. :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchDeployment] """ - super(BatchDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) + super(BatchDeploymentTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -3742,25 +3916,25 @@ class BatchEndpoint(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": {"key": "properties", "type": "BatchEndpointProperties"}, + "sku": {"key": "sku", "type": "Sku"}, } def __init__( @@ -3789,7 +3963,9 @@ def __init__( :keyword sku: Sku details required for ARM contract for Autoscaling. :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ - super(BatchEndpoint, self).__init__(tags=tags, location=location, **kwargs) + super(BatchEndpoint, self).__init__( + tags=tags, location=location, **kwargs + ) self.identity = identity self.kind = kind self.properties = properties @@ -3805,15 +3981,10 @@ class BatchEndpointDefaults(msrest.serialization.Model): """ _attribute_map = { - 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, + "deployment_name": {"key": "deploymentName", "type": "str"}, } - def __init__( - self, - *, - deployment_name: Optional[str] = None, - **kwargs - ): + def __init__(self, *, deployment_name: Optional[str] = None, **kwargs): """ :keyword deployment_name: Name of the deployment that will be default for the endpoint. This deployment will end up getting 100% traffic when the endpoint scoring URL is invoked. @@ -3849,18 +4020,18 @@ class EndpointPropertiesBase(msrest.serialization.Model): """ _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, + "auth_mode": {"required": True}, + "scoring_uri": {"readonly": True}, + "swagger_uri": {"readonly": True}, } _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, + "auth_mode": {"key": "authMode", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "keys": {"key": "keys", "type": "EndpointAuthKeys"}, + "properties": {"key": "properties", "type": "{str}"}, + "scoring_uri": {"key": "scoringUri", "type": "str"}, + "swagger_uri": {"key": "swaggerUri", "type": "str"}, } def __init__( @@ -3927,21 +4098,21 @@ class BatchEndpointProperties(EndpointPropertiesBase): """ _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "auth_mode": {"required": True}, + "scoring_uri": {"readonly": True}, + "swagger_uri": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'defaults': {'key': 'defaults', 'type': 'BatchEndpointDefaults'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "auth_mode": {"key": "authMode", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "keys": {"key": "keys", "type": "EndpointAuthKeys"}, + "properties": {"key": "properties", "type": "{str}"}, + "scoring_uri": {"key": "scoringUri", "type": "str"}, + "swagger_uri": {"key": "swaggerUri", "type": "str"}, + "defaults": {"key": "defaults", "type": "BatchEndpointDefaults"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } def __init__( @@ -3970,12 +4141,20 @@ def __init__( :keyword defaults: Default values for Batch Endpoint. :paramtype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults """ - super(BatchEndpointProperties, self).__init__(auth_mode=auth_mode, description=description, keys=keys, properties=properties, **kwargs) + super(BatchEndpointProperties, self).__init__( + auth_mode=auth_mode, + description=description, + keys=keys, + properties=properties, + **kwargs + ) self.defaults = defaults self.provisioning_state = None -class BatchEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class BatchEndpointTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of BatchEndpoint entities. :ivar next_link: The link to the next page of BatchEndpoint objects. If null, there are no @@ -3986,8 +4165,8 @@ class BatchEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model) """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchEndpoint]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[BatchEndpoint]"}, } def __init__( @@ -4004,7 +4183,9 @@ def __init__( :keyword value: An array of objects of type BatchEndpoint. :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchEndpoint] """ - super(BatchEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) + super(BatchEndpointTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -4019,8 +4200,8 @@ class BatchRetrySettings(msrest.serialization.Model): """ _attribute_map = { - 'max_retries': {'key': 'maxRetries', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "max_retries": {"key": "maxRetries", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } def __init__( @@ -4043,38 +4224,41 @@ def __init__( class SamplingAlgorithm(msrest.serialization.Model): """The Sampling Algorithm used to generate hyperparameter values, along with properties to -configure the algorithm. + configure the algorithm. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BayesianSamplingAlgorithm, GridSamplingAlgorithm, RandomSamplingAlgorithm. + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: BayesianSamplingAlgorithm, GridSamplingAlgorithm, RandomSamplingAlgorithm. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType + :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating + hyperparameter values, along with configuration properties.Constant filled by server. Possible + values include: "Grid", "Random", "Bayesian". + :vartype sampling_algorithm_type: str or + ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } _subtype_map = { - 'sampling_algorithm_type': {'Bayesian': 'BayesianSamplingAlgorithm', 'Grid': 'GridSamplingAlgorithm', 'Random': 'RandomSamplingAlgorithm'} + "sampling_algorithm_type": { + "Bayesian": "BayesianSamplingAlgorithm", + "Grid": "GridSamplingAlgorithm", + "Random": "RandomSamplingAlgorithm", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(SamplingAlgorithm, self).__init__(**kwargs) self.sampling_algorithm_type = None # type: Optional[str] @@ -4092,21 +4276,20 @@ class BayesianSamplingAlgorithm(SamplingAlgorithm): """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(BayesianSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Bayesian' # type: str + self.sampling_algorithm_type = "Bayesian" # type: str class BindOptions(msrest.serialization.Model): @@ -4121,9 +4304,9 @@ class BindOptions(msrest.serialization.Model): """ _attribute_map = { - 'propagation': {'key': 'propagation', 'type': 'str'}, - 'create_host_path': {'key': 'createHostPath', 'type': 'bool'}, - 'selinux': {'key': 'selinux', 'type': 'str'}, + "propagation": {"key": "propagation", "type": "str"}, + "create_host_path": {"key": "createHostPath", "type": "bool"}, + "selinux": {"key": "selinux", "type": "str"}, } def __init__( @@ -4155,29 +4338,29 @@ class BuildContext(msrest.serialization.Model): :ivar context_uri: Required. [Required] URI of the Docker build context used to build the image. Supports blob URIs on environment creation and may return blob or Git URIs. - - + + .. raw:: html - + . :vartype context_uri: str :ivar dockerfile_path: Path to the Dockerfile in the build context. - - + + .. raw:: html - + . :vartype dockerfile_path: str """ _validation = { - 'context_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "context_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'context_uri': {'key': 'contextUri', 'type': 'str'}, - 'dockerfile_path': {'key': 'dockerfilePath', 'type': 'str'}, + "context_uri": {"key": "contextUri", "type": "str"}, + "dockerfile_path": {"key": "dockerfilePath", "type": "str"}, } def __init__( @@ -4190,18 +4373,18 @@ def __init__( """ :keyword context_uri: Required. [Required] URI of the Docker build context used to build the image. Supports blob URIs on environment creation and may return blob or Git URIs. - - + + .. raw:: html - + . :paramtype context_uri: str :keyword dockerfile_path: Path to the Dockerfile in the build context. - - + + .. raw:: html - + . :paramtype dockerfile_path: str """ @@ -4234,21 +4417,21 @@ class CertificateDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, - 'thumbprint': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials_type": {"required": True}, + "client_id": {"required": True}, + "secrets": {"required": True}, + "tenant_id": {"required": True}, + "thumbprint": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'CertificateDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "authority_url": {"key": "authorityUrl", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + "resource_url": {"key": "resourceUrl", "type": "str"}, + "secrets": {"key": "secrets", "type": "CertificateDatastoreSecrets"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "thumbprint": {"key": "thumbprint", "type": "str"}, } def __init__( @@ -4279,7 +4462,7 @@ def __init__( :paramtype thumbprint: str """ super(CertificateDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Certificate' # type: str + self.credentials_type = "Certificate" # type: str self.authority_url = authority_url self.client_id = client_id self.resource_url = resource_url @@ -4302,26 +4485,21 @@ class CertificateDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'certificate': {'key': 'certificate', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "certificate": {"key": "certificate", "type": "str"}, } - def __init__( - self, - *, - certificate: Optional[str] = None, - **kwargs - ): + def __init__(self, *, certificate: Optional[str] = None, **kwargs): """ :keyword certificate: Service principal certificate. :paramtype certificate: str """ super(CertificateDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Certificate' # type: str + self.secrets_type = "Certificate" # type: str self.certificate = certificate @@ -4366,25 +4544,51 @@ class TableVertical(msrest.serialization.Model): """ _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "TableFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "search_space": { + "key": "searchSpace", + "type": "[TableParameterSubspace]", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "TableSweepSettings", + }, + "test_data": {"key": "testData", "type": "MLTableJobInput"}, + "test_data_size": {"key": "testDataSize", "type": "float"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "weight_column_name": {"key": "weightColumnName", "type": "str"}, } def __init__( self, *, cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "TableVerticalFeaturizationSettings" + ] = None, fixed_parameters: Optional["TableFixedParameters"] = None, limit_settings: Optional["TableVerticalLimitSettings"] = None, n_cross_validations: Optional["NCrossValidations"] = None, @@ -4517,30 +4721,57 @@ class Classification(AutoMLVertical, TableVertical): """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'positive_label': {'key': 'positiveLabel', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'ClassificationTrainingSettings'}, + "task_type": {"required": True}, + "training_data": {"required": True}, + } + + _attribute_map = { + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "TableFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "search_space": { + "key": "searchSpace", + "type": "[TableParameterSubspace]", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "TableSweepSettings", + }, + "test_data": {"key": "testData", "type": "MLTableJobInput"}, + "test_data_size": {"key": "testDataSize", "type": "float"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "weight_column_name": {"key": "weightColumnName", "type": "str"}, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "positive_label": {"key": "positiveLabel", "type": "str"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, + "training_settings": { + "key": "trainingSettings", + "type": "ClassificationTrainingSettings", + }, } def __init__( @@ -4548,7 +4779,9 @@ def __init__( *, training_data: "MLTableJobInput", cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "TableVerticalFeaturizationSettings" + ] = None, fixed_parameters: Optional["TableFixedParameters"] = None, limit_settings: Optional["TableVerticalLimitSettings"] = None, n_cross_validations: Optional["NCrossValidations"] = None, @@ -4562,7 +4795,9 @@ def __init__( log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, positive_label: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "ClassificationPrimaryMetrics"] + ] = None, training_settings: Optional["ClassificationTrainingSettings"] = None, **kwargs ): @@ -4623,7 +4858,24 @@ def __init__( :paramtype training_settings: ~azure.mgmt.machinelearningservices.models.ClassificationTrainingSettings """ - super(Classification, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, cv_split_column_names=cv_split_column_names, featurization_settings=featurization_settings, fixed_parameters=fixed_parameters, limit_settings=limit_settings, n_cross_validations=n_cross_validations, search_space=search_space, sweep_settings=sweep_settings, test_data=test_data, test_data_size=test_data_size, validation_data=validation_data, validation_data_size=validation_data_size, weight_column_name=weight_column_name, **kwargs) + super(Classification, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + cv_split_column_names=cv_split_column_names, + featurization_settings=featurization_settings, + fixed_parameters=fixed_parameters, + limit_settings=limit_settings, + n_cross_validations=n_cross_validations, + search_space=search_space, + sweep_settings=sweep_settings, + test_data=test_data, + test_data_size=test_data_size, + validation_data=validation_data, + validation_data_size=validation_data_size, + weight_column_name=weight_column_name, + **kwargs + ) self.cv_split_column_names = cv_split_column_names self.featurization_settings = featurization_settings self.fixed_parameters = fixed_parameters @@ -4636,7 +4888,7 @@ def __init__( self.validation_data = validation_data self.validation_data_size = validation_data_size self.weight_column_name = weight_column_name - self.task_type = 'Classification' # type: str + self.task_type = "Classification" # type: str self.positive_label = positive_label self.primary_metric = primary_metric self.training_settings = training_settings @@ -4676,14 +4928,29 @@ class TrainingSettings(msrest.serialization.Model): """ _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, + "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, + "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, + "training_mode": {"key": "trainingMode", "type": "str"}, } def __init__( @@ -4774,16 +5041,37 @@ class ClassificationTrainingSettings(TrainingSettings): """ _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, + "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, + "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, + "training_mode": {"key": "trainingMode", "type": "str"}, + "allowed_training_algorithms": { + "key": "allowedTrainingAlgorithms", + "type": "[str]", + }, + "blocked_training_algorithms": { + "key": "blockedTrainingAlgorithms", + "type": "[str]", + }, } def __init__( @@ -4797,8 +5085,12 @@ def __init__( ensemble_model_download_timeout: Optional[datetime.timedelta] = "PT5M", stack_ensemble_settings: Optional["StackEnsembleSettings"] = None, training_mode: Optional[Union[str, "TrainingMode"]] = None, - allowed_training_algorithms: Optional[List[Union[str, "ClassificationModels"]]] = None, - blocked_training_algorithms: Optional[List[Union[str, "ClassificationModels"]]] = None, + allowed_training_algorithms: Optional[ + List[Union[str, "ClassificationModels"]] + ] = None, + blocked_training_algorithms: Optional[ + List[Union[str, "ClassificationModels"]] + ] = None, **kwargs ): """ @@ -4834,7 +5126,17 @@ def __init__( :paramtype blocked_training_algorithms: list[str or ~azure.mgmt.machinelearningservices.models.ClassificationModels] """ - super(ClassificationTrainingSettings, self).__init__(enable_dnn_training=enable_dnn_training, enable_model_explainability=enable_model_explainability, enable_onnx_compatible_models=enable_onnx_compatible_models, enable_stack_ensemble=enable_stack_ensemble, enable_vote_ensemble=enable_vote_ensemble, ensemble_model_download_timeout=ensemble_model_download_timeout, stack_ensemble_settings=stack_ensemble_settings, training_mode=training_mode, **kwargs) + super(ClassificationTrainingSettings, self).__init__( + enable_dnn_training=enable_dnn_training, + enable_model_explainability=enable_model_explainability, + enable_onnx_compatible_models=enable_onnx_compatible_models, + enable_stack_ensemble=enable_stack_ensemble, + enable_vote_ensemble=enable_vote_ensemble, + ensemble_model_download_timeout=ensemble_model_download_timeout, + stack_ensemble_settings=stack_ensemble_settings, + training_mode=training_mode, + **kwargs + ) self.allowed_training_algorithms = allowed_training_algorithms self.blocked_training_algorithms = blocked_training_algorithms @@ -4847,7 +5149,10 @@ class ClusterUpdateParameters(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties.properties', 'type': 'ScaleSettingsInformation'}, + "properties": { + "key": "properties.properties", + "type": "ScaleSettingsInformation", + }, } def __init__( @@ -4888,31 +5193,31 @@ class ExportSummary(msrest.serialization.Model): """ _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, + "end_date_time": {"readonly": True}, + "exported_row_count": {"readonly": True}, + "format": {"required": True}, + "labeling_job_id": {"readonly": True}, + "start_date_time": {"readonly": True}, } _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, + "end_date_time": {"key": "endDateTime", "type": "iso-8601"}, + "exported_row_count": {"key": "exportedRowCount", "type": "long"}, + "format": {"key": "format", "type": "str"}, + "labeling_job_id": {"key": "labelingJobId", "type": "str"}, + "start_date_time": {"key": "startDateTime", "type": "iso-8601"}, } _subtype_map = { - 'format': {'CSV': 'CsvExportSummary', 'Coco': 'CocoExportSummary', 'Dataset': 'DatasetExportSummary'} + "format": { + "CSV": "CsvExportSummary", + "Coco": "CocoExportSummary", + "Dataset": "DatasetExportSummary", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ExportSummary, self).__init__(**kwargs) self.end_date_time = None self.exported_row_count = None @@ -4946,33 +5251,29 @@ class CocoExportSummary(ExportSummary): """ _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'container_name': {'readonly': True}, - 'snapshot_path': {'readonly': True}, + "end_date_time": {"readonly": True}, + "exported_row_count": {"readonly": True}, + "format": {"required": True}, + "labeling_job_id": {"readonly": True}, + "start_date_time": {"readonly": True}, + "container_name": {"readonly": True}, + "snapshot_path": {"readonly": True}, } _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'snapshot_path': {'key': 'snapshotPath', 'type': 'str'}, + "end_date_time": {"key": "endDateTime", "type": "iso-8601"}, + "exported_row_count": {"key": "exportedRowCount", "type": "long"}, + "format": {"key": "format", "type": "str"}, + "labeling_job_id": {"key": "labelingJobId", "type": "str"}, + "start_date_time": {"key": "startDateTime", "type": "iso-8601"}, + "container_name": {"key": "containerName", "type": "str"}, + "snapshot_path": {"key": "snapshotPath", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(CocoExportSummary, self).__init__(**kwargs) - self.format = 'Coco' # type: str + self.format = "Coco" # type: str self.container_name = None self.snapshot_path = None @@ -4989,20 +5290,20 @@ class CodeConfiguration(msrest.serialization.Model): """ _validation = { - 'scoring_script': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "scoring_script": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'scoring_script': {'key': 'scoringScript', 'type': 'str'}, + "code_id": {"key": "codeId", "type": "str"}, + "scoring_script": {"key": "scoringScript", "type": "str"}, } def __init__( - self, - *, - scoring_script: str, - code_id: Optional[str] = None, - **kwargs + self, *, scoring_script: str, code_id: Optional[str] = None, **kwargs ): """ :keyword code_id: ARM resource ID of the code asset. @@ -5038,27 +5339,22 @@ class CodeContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "CodeContainerProperties"}, } - def __init__( - self, - *, - properties: "CodeContainerProperties", - **kwargs - ): + def __init__(self, *, properties: "CodeContainerProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeContainerProperties @@ -5091,19 +5387,19 @@ class CodeContainerProperties(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } def __init__( @@ -5125,7 +5421,13 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(CodeContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) + super(CodeContainerProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs + ) self.provisioning_state = None @@ -5140,8 +5442,8 @@ class CodeContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[CodeContainer]"}, } def __init__( @@ -5186,27 +5488,22 @@ class CodeVersion(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeVersionProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "CodeVersionProperties"}, } - def __init__( - self, - *, - properties: "CodeVersionProperties", - **kwargs - ): + def __init__(self, *, properties: "CodeVersionProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeVersionProperties @@ -5239,17 +5536,17 @@ class CodeVersionProperties(AssetBase): """ _validation = { - 'provisioning_state': {'readonly': True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'code_uri': {'key': 'codeUri', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "code_uri": {"key": "codeUri", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } def __init__( @@ -5277,7 +5574,14 @@ def __init__( :keyword code_uri: Uri where code is located. :paramtype code_uri: str """ - super(CodeVersionProperties, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) + super(CodeVersionProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + **kwargs + ) self.code_uri = code_uri self.provisioning_state = None @@ -5293,8 +5597,8 @@ class CodeVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeVersion]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[CodeVersion]"}, } def __init__( @@ -5327,8 +5631,8 @@ class ColumnTransformer(msrest.serialization.Model): """ _attribute_map = { - 'fields': {'key': 'fields', 'type': '[str]'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, + "fields": {"key": "fields", "type": "[str]"}, + "parameters": {"key": "parameters", "type": "object"}, } def __init__( @@ -5417,37 +5721,50 @@ class CommandJob(JobBaseProperties): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'parameters': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'autologger_settings': {'key': 'autologgerSettings', 'type': 'AutologgerSettings'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'CommandJobLimits'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, + "job_type": {"required": True}, + "status": {"readonly": True}, + "command": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "environment_id": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "parameters": {"readonly": True}, + } + + _attribute_map = { + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "autologger_settings": { + "key": "autologgerSettings", + "type": "AutologgerSettings", + }, + "code_id": {"key": "codeId", "type": "str"}, + "command": {"key": "command", "type": "str"}, + "distribution": { + "key": "distribution", + "type": "DistributionConfiguration", + }, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "limits": {"key": "limits", "type": "CommandJobLimits"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "parameters": {"key": "parameters", "type": "object"}, + "resources": {"key": "resources", "type": "JobResourceConfiguration"}, } def __init__( @@ -5525,8 +5842,20 @@ def __init__( :keyword resources: Compute Resource configuration for the job. :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration """ - super(CommandJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, services=services, **kwargs) - self.job_type = 'Command' # type: str + super(CommandJob, self).__init__( + description=description, + properties=properties, + tags=tags, + component_id=component_id, + compute_id=compute_id, + display_name=display_name, + experiment_name=experiment_name, + identity=identity, + is_archived=is_archived, + services=services, + **kwargs + ) + self.job_type = "Command" # type: str self.autologger_settings = autologger_settings self.code_id = code_id self.command = command @@ -5557,23 +5886,23 @@ class JobLimits(msrest.serialization.Model): """ _validation = { - 'job_limits_type': {'required': True}, + "job_limits_type": {"required": True}, } _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "job_limits_type": {"key": "jobLimitsType", "type": "str"}, + "timeout": {"key": "timeout", "type": "duration"}, } _subtype_map = { - 'job_limits_type': {'Command': 'CommandJobLimits', 'Sweep': 'SweepJobLimits'} + "job_limits_type": { + "Command": "CommandJobLimits", + "Sweep": "SweepJobLimits", + } } def __init__( - self, - *, - timeout: Optional[datetime.timedelta] = None, - **kwargs + self, *, timeout: Optional[datetime.timedelta] = None, **kwargs ): """ :keyword timeout: The max run duration in ISO 8601 format, after which the job will be @@ -5599,19 +5928,16 @@ class CommandJobLimits(JobLimits): """ _validation = { - 'job_limits_type': {'required': True}, + "job_limits_type": {"required": True}, } _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "job_limits_type": {"key": "jobLimitsType", "type": "str"}, + "timeout": {"key": "timeout", "type": "duration"}, } def __init__( - self, - *, - timeout: Optional[datetime.timedelta] = None, - **kwargs + self, *, timeout: Optional[datetime.timedelta] = None, **kwargs ): """ :keyword timeout: The max run duration in ISO 8601 format, after which the job will be @@ -5619,7 +5945,7 @@ def __init__( :paramtype timeout: ~datetime.timedelta """ super(CommandJobLimits, self).__init__(timeout=timeout, **kwargs) - self.job_limits_type = 'Command' # type: str + self.job_limits_type = "Command" # type: str class ComponentContainer(Resource): @@ -5645,26 +5971,26 @@ class ComponentContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "ComponentContainerProperties", + }, } def __init__( - self, - *, - properties: "ComponentContainerProperties", - **kwargs + self, *, properties: "ComponentContainerProperties", **kwargs ): """ :keyword properties: Required. [Required] Additional attributes of the entity. @@ -5678,44 +6004,44 @@ class ComponentContainerProperties(AssetContainer): """Component container definition. -.. raw:: html + .. raw:: html - . + . - Variables are only populated by the server, and will be ignored when sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the component container. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState + :ivar description: The asset description text. + :vartype description: str + :ivar properties: The asset property dictionary. + :vartype properties: dict[str, str] + :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + :ivar is_archived: Is the asset archived?. + :vartype is_archived: bool + :ivar latest_version: The latest version inside this container. + :vartype latest_version: str + :ivar next_version: The next auto incremental version. + :vartype next_version: str + :ivar provisioning_state: Provisioning state for the component container. Possible values + include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.machinelearningservices.models.AssetProvisioningState """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } def __init__( @@ -5737,7 +6063,13 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(ComponentContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) + super(ComponentContainerProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs + ) self.provisioning_state = None @@ -5752,8 +6084,8 @@ class ComponentContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ComponentContainer]"}, } def __init__( @@ -5770,7 +6102,9 @@ def __init__( :keyword value: An array of objects of type ComponentContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainer] """ - super(ComponentContainerResourceArmPaginatedResult, self).__init__(**kwargs) + super(ComponentContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -5798,27 +6132,25 @@ class ComponentVersion(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentVersionProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "ComponentVersionProperties", + }, } - def __init__( - self, - *, - properties: "ComponentVersionProperties", - **kwargs - ): + def __init__(self, *, properties: "ComponentVersionProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentVersionProperties @@ -5843,10 +6175,10 @@ class ComponentVersionProperties(AssetBase): :ivar is_archived: Is the asset archived?. :vartype is_archived: bool :ivar component_spec: Defines Component definition details. - - + + .. raw:: html - + . @@ -5858,17 +6190,17 @@ class ComponentVersionProperties(AssetBase): """ _validation = { - 'provisioning_state': {'readonly': True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'component_spec': {'key': 'componentSpec', 'type': 'object'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "component_spec": {"key": "componentSpec", "type": "object"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } def __init__( @@ -5894,16 +6226,23 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool :keyword component_spec: Defines Component definition details. - - + + .. raw:: html - + . :paramtype component_spec: any """ - super(ComponentVersionProperties, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) + super(ComponentVersionProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + **kwargs + ) self.component_spec = component_spec self.provisioning_state = None @@ -5919,8 +6258,8 @@ class ComponentVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentVersion]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ComponentVersion]"}, } def __init__( @@ -5937,7 +6276,9 @@ def __init__( :keyword value: An array of objects of type ComponentVersion. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersion] """ - super(ComponentVersionResourceArmPaginatedResult, self).__init__(**kwargs) + super(ComponentVersionResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -5950,7 +6291,10 @@ class ComputeInstanceSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, + "properties": { + "key": "properties", + "type": "ComputeInstanceProperties", + }, } def __init__( @@ -6006,26 +6350,32 @@ class ComputeInstance(Compute, ComputeInstanceSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": { + "key": "properties", + "type": "ComputeInstanceProperties", + }, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -6051,9 +6401,16 @@ def __init__( MSI and AAD exclusively for authentication. :paramtype disable_local_auth: bool """ - super(ComputeInstance, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) + super(ComputeInstance, self).__init__( + compute_location=compute_location, + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'ComputeInstance' # type: str + self.compute_type = "ComputeInstance" # type: str self.compute_location = compute_location self.provisioning_state = None self.description = description @@ -6075,8 +6432,8 @@ class ComputeInstanceApplication(msrest.serialization.Model): """ _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, + "display_name": {"key": "displayName", "type": "str"}, + "endpoint_uri": {"key": "endpointUri", "type": "str"}, } def __init__( @@ -6106,7 +6463,7 @@ class ComputeInstanceAutologgerSettings(msrest.serialization.Model): """ _attribute_map = { - 'mlflow_autologger': {'key': 'mlflowAutologger', 'type': 'str'}, + "mlflow_autologger": {"key": "mlflowAutologger", "type": "str"}, } def __init__( @@ -6138,21 +6495,17 @@ class ComputeInstanceConnectivityEndpoints(msrest.serialization.Model): """ _validation = { - 'public_ip_address': {'readonly': True}, - 'private_ip_address': {'readonly': True}, + "public_ip_address": {"readonly": True}, + "private_ip_address": {"readonly": True}, } _attribute_map = { - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + "public_ip_address": {"key": "publicIpAddress", "type": "str"}, + "private_ip_address": {"key": "privateIpAddress", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ComputeInstanceConnectivityEndpoints, self).__init__(**kwargs) self.public_ip_address = None self.private_ip_address = None @@ -6178,16 +6531,19 @@ class ComputeInstanceContainer(msrest.serialization.Model): """ _validation = { - 'services': {'readonly': True}, + "services": {"readonly": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'autosave': {'key': 'autosave', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'network': {'key': 'network', 'type': 'str'}, - 'environment': {'key': 'environment', 'type': 'ComputeInstanceEnvironmentInfo'}, - 'services': {'key': 'services', 'type': '[object]'}, + "name": {"key": "name", "type": "str"}, + "autosave": {"key": "autosave", "type": "str"}, + "gpu": {"key": "gpu", "type": "str"}, + "network": {"key": "network", "type": "str"}, + "environment": { + "key": "environment", + "type": "ComputeInstanceEnvironmentInfo", + }, + "services": {"key": "services", "type": "[object]"}, } def __init__( @@ -6236,23 +6592,19 @@ class ComputeInstanceCreatedBy(msrest.serialization.Model): """ _validation = { - 'user_name': {'readonly': True}, - 'user_org_id': {'readonly': True}, - 'user_id': {'readonly': True}, + "user_name": {"readonly": True}, + "user_org_id": {"readonly": True}, + "user_id": {"readonly": True}, } _attribute_map = { - 'user_name': {'key': 'userName', 'type': 'str'}, - 'user_org_id': {'key': 'userOrgId', 'type': 'str'}, - 'user_id': {'key': 'userId', 'type': 'str'}, + "user_name": {"key": "userName", "type": "str"}, + "user_org_id": {"key": "userOrgId", "type": "str"}, + "user_id": {"key": "userId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ComputeInstanceCreatedBy, self).__init__(**kwargs) self.user_name = None self.user_org_id = None @@ -6277,10 +6629,10 @@ class ComputeInstanceDataDisk(msrest.serialization.Model): """ _attribute_map = { - 'caching': {'key': 'caching', 'type': 'str'}, - 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, - 'lun': {'key': 'lun', 'type': 'int'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + "caching": {"key": "caching", "type": "str"}, + "disk_size_gb": {"key": "diskSizeGB", "type": "int"}, + "lun": {"key": "lun", "type": "int"}, + "storage_account_type": {"key": "storageAccountType", "type": "str"}, } def __init__( @@ -6289,7 +6641,9 @@ def __init__( caching: Optional[Union[str, "Caching"]] = None, disk_size_gb: Optional[int] = None, lun: Optional[int] = None, - storage_account_type: Optional[Union[str, "StorageAccountType"]] = "Standard_LRS", + storage_account_type: Optional[ + Union[str, "StorageAccountType"] + ] = "Standard_LRS", **kwargs ): """ @@ -6338,15 +6692,15 @@ class ComputeInstanceDataMount(msrest.serialization.Model): """ _attribute_map = { - 'source': {'key': 'source', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'mount_name': {'key': 'mountName', 'type': 'str'}, - 'mount_action': {'key': 'mountAction', 'type': 'str'}, - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - 'mount_state': {'key': 'mountState', 'type': 'str'}, - 'mounted_on': {'key': 'mountedOn', 'type': 'iso-8601'}, - 'error': {'key': 'error', 'type': 'str'}, + "source": {"key": "source", "type": "str"}, + "source_type": {"key": "sourceType", "type": "str"}, + "mount_name": {"key": "mountName", "type": "str"}, + "mount_action": {"key": "mountAction", "type": "str"}, + "created_by": {"key": "createdBy", "type": "str"}, + "mount_path": {"key": "mountPath", "type": "str"}, + "mount_state": {"key": "mountState", "type": "str"}, + "mounted_on": {"key": "mountedOn", "type": "iso-8601"}, + "error": {"key": "error", "type": "str"}, } def __init__( @@ -6406,8 +6760,8 @@ class ComputeInstanceEnvironmentInfo(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "version": {"key": "version", "type": "str"}, } def __init__( @@ -6445,10 +6799,10 @@ class ComputeInstanceLastOperation(msrest.serialization.Model): """ _attribute_map = { - 'operation_name': {'key': 'operationName', 'type': 'str'}, - 'operation_time': {'key': 'operationTime', 'type': 'iso-8601'}, - 'operation_status': {'key': 'operationStatus', 'type': 'str'}, - 'operation_trigger': {'key': 'operationTrigger', 'type': 'str'}, + "operation_name": {"key": "operationName", "type": "str"}, + "operation_time": {"key": "operationTime", "type": "iso-8601"}, + "operation_status": {"key": "operationStatus", "type": "str"}, + "operation_trigger": {"key": "operationTrigger", "type": "str"}, } def __init__( @@ -6557,43 +6911,85 @@ class ComputeInstanceProperties(msrest.serialization.Model): """ _validation = { - 'os_image_metadata': {'readonly': True}, - 'connectivity_endpoints': {'readonly': True}, - 'applications': {'readonly': True}, - 'created_by': {'readonly': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'last_operation': {'readonly': True}, - 'containers': {'readonly': True}, - 'data_disks': {'readonly': True}, - 'data_mounts': {'readonly': True}, - 'versions': {'readonly': True}, - } - - _attribute_map = { - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'application_sharing_policy': {'key': 'applicationSharingPolicy', 'type': 'str'}, - 'autologger_settings': {'key': 'autologgerSettings', 'type': 'ComputeInstanceAutologgerSettings'}, - 'ssh_settings': {'key': 'sshSettings', 'type': 'ComputeInstanceSshSettings'}, - 'custom_services': {'key': 'customServices', 'type': '[CustomService]'}, - 'os_image_metadata': {'key': 'osImageMetadata', 'type': 'ImageMetadata'}, - 'connectivity_endpoints': {'key': 'connectivityEndpoints', 'type': 'ComputeInstanceConnectivityEndpoints'}, - 'applications': {'key': 'applications', 'type': '[ComputeInstanceApplication]'}, - 'created_by': {'key': 'createdBy', 'type': 'ComputeInstanceCreatedBy'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'compute_instance_authorization_type': {'key': 'computeInstanceAuthorizationType', 'type': 'str'}, - 'personal_compute_instance_settings': {'key': 'personalComputeInstanceSettings', 'type': 'PersonalComputeInstanceSettings'}, - 'setup_scripts': {'key': 'setupScripts', 'type': 'SetupScripts'}, - 'last_operation': {'key': 'lastOperation', 'type': 'ComputeInstanceLastOperation'}, - 'schedules': {'key': 'schedules', 'type': 'ComputeSchedules'}, - 'idle_time_before_shutdown': {'key': 'idleTimeBeforeShutdown', 'type': 'str'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'containers': {'key': 'containers', 'type': '[ComputeInstanceContainer]'}, - 'data_disks': {'key': 'dataDisks', 'type': '[ComputeInstanceDataDisk]'}, - 'data_mounts': {'key': 'dataMounts', 'type': '[ComputeInstanceDataMount]'}, - 'versions': {'key': 'versions', 'type': 'ComputeInstanceVersion'}, + "os_image_metadata": {"readonly": True}, + "connectivity_endpoints": {"readonly": True}, + "applications": {"readonly": True}, + "created_by": {"readonly": True}, + "errors": {"readonly": True}, + "state": {"readonly": True}, + "last_operation": {"readonly": True}, + "containers": {"readonly": True}, + "data_disks": {"readonly": True}, + "data_mounts": {"readonly": True}, + "versions": {"readonly": True}, + } + + _attribute_map = { + "vm_size": {"key": "vmSize", "type": "str"}, + "subnet": {"key": "subnet", "type": "ResourceId"}, + "application_sharing_policy": { + "key": "applicationSharingPolicy", + "type": "str", + }, + "autologger_settings": { + "key": "autologgerSettings", + "type": "ComputeInstanceAutologgerSettings", + }, + "ssh_settings": { + "key": "sshSettings", + "type": "ComputeInstanceSshSettings", + }, + "custom_services": { + "key": "customServices", + "type": "[CustomService]", + }, + "os_image_metadata": { + "key": "osImageMetadata", + "type": "ImageMetadata", + }, + "connectivity_endpoints": { + "key": "connectivityEndpoints", + "type": "ComputeInstanceConnectivityEndpoints", + }, + "applications": { + "key": "applications", + "type": "[ComputeInstanceApplication]", + }, + "created_by": {"key": "createdBy", "type": "ComputeInstanceCreatedBy"}, + "errors": {"key": "errors", "type": "[ErrorResponse]"}, + "state": {"key": "state", "type": "str"}, + "compute_instance_authorization_type": { + "key": "computeInstanceAuthorizationType", + "type": "str", + }, + "personal_compute_instance_settings": { + "key": "personalComputeInstanceSettings", + "type": "PersonalComputeInstanceSettings", + }, + "setup_scripts": {"key": "setupScripts", "type": "SetupScripts"}, + "last_operation": { + "key": "lastOperation", + "type": "ComputeInstanceLastOperation", + }, + "schedules": {"key": "schedules", "type": "ComputeSchedules"}, + "idle_time_before_shutdown": { + "key": "idleTimeBeforeShutdown", + "type": "str", + }, + "enable_node_public_ip": {"key": "enableNodePublicIp", "type": "bool"}, + "containers": { + "key": "containers", + "type": "[ComputeInstanceContainer]", + }, + "data_disks": { + "key": "dataDisks", + "type": "[ComputeInstanceDataDisk]", + }, + "data_mounts": { + "key": "dataMounts", + "type": "[ComputeInstanceDataMount]", + }, + "versions": {"key": "versions", "type": "ComputeInstanceVersion"}, } def __init__( @@ -6601,12 +6997,20 @@ def __init__( *, vm_size: Optional[str] = None, subnet: Optional["ResourceId"] = None, - application_sharing_policy: Optional[Union[str, "ApplicationSharingPolicy"]] = "Shared", - autologger_settings: Optional["ComputeInstanceAutologgerSettings"] = None, + application_sharing_policy: Optional[ + Union[str, "ApplicationSharingPolicy"] + ] = "Shared", + autologger_settings: Optional[ + "ComputeInstanceAutologgerSettings" + ] = None, ssh_settings: Optional["ComputeInstanceSshSettings"] = None, custom_services: Optional[List["CustomService"]] = None, - compute_instance_authorization_type: Optional[Union[str, "ComputeInstanceAuthorizationType"]] = "personal", - personal_compute_instance_settings: Optional["PersonalComputeInstanceSettings"] = None, + compute_instance_authorization_type: Optional[ + Union[str, "ComputeInstanceAuthorizationType"] + ] = "personal", + personal_compute_instance_settings: Optional[ + "PersonalComputeInstanceSettings" + ] = None, setup_scripts: Optional["SetupScripts"] = None, schedules: Optional["ComputeSchedules"] = None, idle_time_before_shutdown: Optional[str] = None, @@ -6666,8 +7070,12 @@ def __init__( self.created_by = None self.errors = None self.state = None - self.compute_instance_authorization_type = compute_instance_authorization_type - self.personal_compute_instance_settings = personal_compute_instance_settings + self.compute_instance_authorization_type = ( + compute_instance_authorization_type + ) + self.personal_compute_instance_settings = ( + personal_compute_instance_settings + ) self.setup_scripts = setup_scripts self.last_operation = None self.schedules = schedules @@ -6699,21 +7107,23 @@ class ComputeInstanceSshSettings(msrest.serialization.Model): """ _validation = { - 'admin_user_name': {'readonly': True}, - 'ssh_port': {'readonly': True}, + "admin_user_name": {"readonly": True}, + "ssh_port": {"readonly": True}, } _attribute_map = { - 'ssh_public_access': {'key': 'sshPublicAccess', 'type': 'str'}, - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'admin_public_key': {'key': 'adminPublicKey', 'type': 'str'}, + "ssh_public_access": {"key": "sshPublicAccess", "type": "str"}, + "admin_user_name": {"key": "adminUserName", "type": "str"}, + "ssh_port": {"key": "sshPort", "type": "int"}, + "admin_public_key": {"key": "adminPublicKey", "type": "str"}, } def __init__( self, *, - ssh_public_access: Optional[Union[str, "SshPublicAccess"]] = "Disabled", + ssh_public_access: Optional[ + Union[str, "SshPublicAccess"] + ] = "Disabled", admin_public_key: Optional[str] = None, **kwargs ): @@ -6742,15 +7152,10 @@ class ComputeInstanceVersion(msrest.serialization.Model): """ _attribute_map = { - 'runtime': {'key': 'runtime', 'type': 'str'}, + "runtime": {"key": "runtime", "type": "str"}, } - def __init__( - self, - *, - runtime: Optional[str] = None, - **kwargs - ): + def __init__(self, *, runtime: Optional[str] = None, **kwargs): """ :keyword runtime: Runtime of compute instance. :paramtype runtime: str @@ -6767,15 +7172,10 @@ class ComputeResourceSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, + "properties": {"key": "properties", "type": "Compute"}, } - def __init__( - self, - *, - properties: Optional["Compute"] = None, - **kwargs - ): + def __init__(self, *, properties: Optional["Compute"] = None, **kwargs): """ :keyword properties: Compute properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute @@ -6813,22 +7213,22 @@ class ComputeResource(Resource, ComputeResourceSchema): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "properties": {"key": "properties", "type": "Compute"}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, } def __init__( @@ -6873,14 +7273,11 @@ class ComputeRuntimeDto(msrest.serialization.Model): """ _attribute_map = { - 'spark_runtime_version': {'key': 'sparkRuntimeVersion', 'type': 'str'}, + "spark_runtime_version": {"key": "sparkRuntimeVersion", "type": "str"}, } def __init__( - self, - *, - spark_runtime_version: Optional[str] = None, - **kwargs + self, *, spark_runtime_version: Optional[str] = None, **kwargs ): """ :keyword spark_runtime_version: @@ -6899,7 +7296,10 @@ class ComputeSchedules(msrest.serialization.Model): """ _attribute_map = { - 'compute_start_stop': {'key': 'computeStartStop', 'type': '[ComputeStartStopSchedule]'}, + "compute_start_stop": { + "key": "computeStartStop", + "type": "[ComputeStartStopSchedule]", + }, } def __init__( @@ -6945,19 +7345,19 @@ class ComputeStartStopSchedule(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'provisioning_status': {'readonly': True}, + "id": {"readonly": True}, + "provisioning_status": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'recurrence': {'key': 'recurrence', 'type': 'RecurrenceTrigger'}, - 'cron': {'key': 'cron', 'type': 'CronTrigger'}, - 'schedule': {'key': 'schedule', 'type': 'ScheduleBase'}, + "id": {"key": "id", "type": "str"}, + "provisioning_status": {"key": "provisioningStatus", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "action": {"key": "action", "type": "str"}, + "trigger_type": {"key": "triggerType", "type": "str"}, + "recurrence": {"key": "recurrence", "type": "RecurrenceTrigger"}, + "cron": {"key": "cron", "type": "CronTrigger"}, + "schedule": {"key": "schedule", "type": "ScheduleBase"}, } def __init__( @@ -7010,15 +7410,25 @@ class ContainerResourceRequirements(msrest.serialization.Model): """ _attribute_map = { - 'container_resource_limits': {'key': 'containerResourceLimits', 'type': 'ContainerResourceSettings'}, - 'container_resource_requests': {'key': 'containerResourceRequests', 'type': 'ContainerResourceSettings'}, + "container_resource_limits": { + "key": "containerResourceLimits", + "type": "ContainerResourceSettings", + }, + "container_resource_requests": { + "key": "containerResourceRequests", + "type": "ContainerResourceSettings", + }, } def __init__( self, *, - container_resource_limits: Optional["ContainerResourceSettings"] = None, - container_resource_requests: Optional["ContainerResourceSettings"] = None, + container_resource_limits: Optional[ + "ContainerResourceSettings" + ] = None, + container_resource_requests: Optional[ + "ContainerResourceSettings" + ] = None, **kwargs ): """ @@ -7049,9 +7459,9 @@ class ContainerResourceSettings(msrest.serialization.Model): """ _attribute_map = { - 'cpu': {'key': 'cpu', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'memory': {'key': 'memory', 'type': 'str'}, + "cpu": {"key": "cpu", "type": "str"}, + "gpu": {"key": "gpu", "type": "str"}, + "memory": {"key": "memory", "type": "str"}, } def __init__( @@ -7087,14 +7497,14 @@ class CosmosDbSettings(msrest.serialization.Model): """ _attribute_map = { - 'collections_throughput': {'key': 'collectionsThroughput', 'type': 'int'}, + "collections_throughput": { + "key": "collectionsThroughput", + "type": "int", + }, } def __init__( - self, - *, - collections_throughput: Optional[int] = None, - **kwargs + self, *, collections_throughput: Optional[int] = None, **kwargs ): """ :keyword collections_throughput: The throughput of the collections in cosmosdb database. @@ -7130,18 +7540,21 @@ class TriggerBase(msrest.serialization.Model): """ _validation = { - 'trigger_type': {'required': True}, + "trigger_type": {"required": True}, } _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, + "end_time": {"key": "endTime", "type": "str"}, + "start_time": {"key": "startTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "trigger_type": {"key": "triggerType", "type": "str"}, } _subtype_map = { - 'trigger_type': {'Cron': 'CronTrigger', 'Recurrence': 'RecurrenceTrigger'} + "trigger_type": { + "Cron": "CronTrigger", + "Recurrence": "RecurrenceTrigger", + } } def __init__( @@ -7199,16 +7612,16 @@ class CronTrigger(TriggerBase): """ _validation = { - 'trigger_type': {'required': True}, - 'expression': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "trigger_type": {"required": True}, + "expression": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, + "end_time": {"key": "endTime", "type": "str"}, + "start_time": {"key": "startTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "trigger_type": {"key": "triggerType", "type": "str"}, + "expression": {"key": "expression", "type": "str"}, } def __init__( @@ -7237,8 +7650,13 @@ def __init__( The expression should follow NCronTab format. :paramtype expression: str """ - super(CronTrigger, self).__init__(end_time=end_time, start_time=start_time, time_zone=time_zone, **kwargs) - self.trigger_type = 'Cron' # type: str + super(CronTrigger, self).__init__( + end_time=end_time, + start_time=start_time, + time_zone=time_zone, + **kwargs + ) + self.trigger_type = "Cron" # type: str self.expression = expression @@ -7267,33 +7685,29 @@ class CsvExportSummary(ExportSummary): """ _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'container_name': {'readonly': True}, - 'snapshot_path': {'readonly': True}, + "end_date_time": {"readonly": True}, + "exported_row_count": {"readonly": True}, + "format": {"required": True}, + "labeling_job_id": {"readonly": True}, + "start_date_time": {"readonly": True}, + "container_name": {"readonly": True}, + "snapshot_path": {"readonly": True}, } _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'snapshot_path': {'key': 'snapshotPath', 'type': 'str'}, + "end_date_time": {"key": "endDateTime", "type": "iso-8601"}, + "exported_row_count": {"key": "exportedRowCount", "type": "long"}, + "format": {"key": "format", "type": "str"}, + "labeling_job_id": {"key": "labelingJobId", "type": "str"}, + "start_date_time": {"key": "startDateTime", "type": "iso-8601"}, + "container_name": {"key": "containerName", "type": "str"}, + "snapshot_path": {"key": "snapshotPath", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(CsvExportSummary, self).__init__(**kwargs) - self.format = 'CSV' # type: str + self.format = "CSV" # type: str self.container_name = None self.snapshot_path = None @@ -7311,27 +7725,22 @@ class CustomForecastHorizon(ForecastHorizon): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - *, - value: int, - **kwargs - ): + def __init__(self, *, value: int, **kwargs): """ :keyword value: Required. [Required] Forecast horizon value. :paramtype value: int """ super(CustomForecastHorizon, self).__init__(**kwargs) - self.mode = 'Custom' # type: str + self.mode = "Custom" # type: str self.value = value @@ -7352,24 +7761,27 @@ class JobInput(msrest.serialization.Model): """ _validation = { - 'job_input_type': {'required': True}, + "job_input_type": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } _subtype_map = { - 'job_input_type': {'custom_model': 'CustomModelJobInput', 'literal': 'LiteralJobInput', 'mlflow_model': 'MLFlowModelJobInput', 'mltable': 'MLTableJobInput', 'triton_model': 'TritonModelJobInput', 'uri_file': 'UriFileJobInput', 'uri_folder': 'UriFolderJobInput'} + "job_input_type": { + "custom_model": "CustomModelJobInput", + "literal": "LiteralJobInput", + "mlflow_model": "MLFlowModelJobInput", + "mltable": "MLTableJobInput", + "triton_model": "TritonModelJobInput", + "uri_file": "UriFileJobInput", + "uri_folder": "UriFolderJobInput", + } } - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): + def __init__(self, *, description: Optional[str] = None, **kwargs): """ :keyword description: Description for the input. :paramtype description: str @@ -7398,15 +7810,15 @@ class CustomModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -7426,10 +7838,12 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(CustomModelJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(CustomModelJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'custom_model' # type: str + self.job_input_type = "custom_model" # type: str self.description = description @@ -7450,24 +7864,26 @@ class JobOutput(msrest.serialization.Model): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } _subtype_map = { - 'job_output_type': {'custom_model': 'CustomModelJobOutput', 'mlflow_model': 'MLFlowModelJobOutput', 'mltable': 'MLTableJobOutput', 'triton_model': 'TritonModelJobOutput', 'uri_file': 'UriFileJobOutput', 'uri_folder': 'UriFolderJobOutput'} + "job_output_type": { + "custom_model": "CustomModelJobOutput", + "mlflow_model": "MLFlowModelJobOutput", + "mltable": "MLTableJobOutput", + "triton_model": "TritonModelJobOutput", + "uri_file": "UriFileJobOutput", + "uri_folder": "UriFolderJobOutput", + } } - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): + def __init__(self, *, description: Optional[str] = None, **kwargs): """ :keyword description: Description for the output. :paramtype description: str @@ -7500,16 +7916,16 @@ class CustomModelJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "asset_name": {"key": "assetName", "type": "str"}, + "asset_version": {"key": "assetVersion", "type": "str"}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -7535,12 +7951,19 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(CustomModelJobOutput, self).__init__(description=description, asset_name=asset_name, asset_version=asset_version, mode=mode, uri=uri, **kwargs) + super(CustomModelJobOutput, self).__init__( + description=description, + asset_name=asset_name, + asset_version=asset_version, + mode=mode, + uri=uri, + **kwargs + ) self.asset_name = asset_name self.asset_version = asset_version self.mode = mode self.uri = uri - self.job_output_type = 'custom_model' # type: str + self.job_output_type = "custom_model" # type: str self.description = description @@ -7557,27 +7980,22 @@ class CustomNCrossValidations(NCrossValidations): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - *, - value: int, - **kwargs - ): + def __init__(self, *, value: int, **kwargs): """ :keyword value: Required. [Required] N-Cross validations value. :paramtype value: int """ super(CustomNCrossValidations, self).__init__(**kwargs) - self.mode = 'Custom' # type: str + self.mode = "Custom" # type: str self.value = value @@ -7594,27 +8012,22 @@ class CustomSeasonality(Seasonality): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - *, - value: int, - **kwargs - ): + def __init__(self, *, value: int, **kwargs): """ :keyword value: Required. [Required] Seasonality value. :paramtype value: int """ super(CustomSeasonality, self).__init__(**kwargs) - self.mode = 'Custom' # type: str + self.mode = "Custom" # type: str self.value = value @@ -7640,13 +8053,16 @@ class CustomService(msrest.serialization.Model): """ _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'name': {'key': 'name', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'Image'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{EnvironmentVariable}'}, - 'docker': {'key': 'docker', 'type': 'Docker'}, - 'endpoints': {'key': 'endpoints', 'type': '[Endpoint]'}, - 'volumes': {'key': 'volumes', 'type': '[VolumeDefinition]'}, + "additional_properties": {"key": "", "type": "{object}"}, + "name": {"key": "name", "type": "str"}, + "image": {"key": "image", "type": "Image"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{EnvironmentVariable}", + }, + "docker": {"key": "docker", "type": "Docker"}, + "endpoints": {"key": "endpoints", "type": "[Endpoint]"}, + "volumes": {"key": "volumes", "type": "[VolumeDefinition]"}, } def __init__( @@ -7655,7 +8071,9 @@ def __init__( additional_properties: Optional[Dict[str, Any]] = None, name: Optional[str] = None, image: Optional["Image"] = None, - environment_variables: Optional[Dict[str, "EnvironmentVariable"]] = None, + environment_variables: Optional[ + Dict[str, "EnvironmentVariable"] + ] = None, docker: Optional["Docker"] = None, endpoints: Optional[List["Endpoint"]] = None, volumes: Optional[List["VolumeDefinition"]] = None, @@ -7702,27 +8120,22 @@ class CustomTargetLags(TargetLags): """ _validation = { - 'mode': {'required': True}, - 'values': {'required': True}, + "mode": {"required": True}, + "values": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[int]'}, + "mode": {"key": "mode", "type": "str"}, + "values": {"key": "values", "type": "[int]"}, } - def __init__( - self, - *, - values: List[int], - **kwargs - ): + def __init__(self, *, values: List[int], **kwargs): """ :keyword values: Required. [Required] Set target lags values. :paramtype values: list[int] """ super(CustomTargetLags, self).__init__(**kwargs) - self.mode = 'Custom' # type: str + self.mode = "Custom" # type: str self.values = values @@ -7739,27 +8152,22 @@ class CustomTargetRollingWindowSize(TargetRollingWindowSize): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - *, - value: int, - **kwargs - ): + def __init__(self, *, value: int, **kwargs): """ :keyword value: Required. [Required] TargetRollingWindowSize value. :paramtype value: int """ super(CustomTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Custom' # type: str + self.mode = "Custom" # type: str self.value = value @@ -7771,14 +8179,11 @@ class DatabricksSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, + "properties": {"key": "properties", "type": "DatabricksProperties"}, } def __init__( - self, - *, - properties: Optional["DatabricksProperties"] = None, - **kwargs + self, *, properties: Optional["DatabricksProperties"] = None, **kwargs ): """ :keyword properties: Properties of Databricks. @@ -7827,26 +8232,29 @@ class Databricks(Compute, DatabricksSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "DatabricksProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -7872,9 +8280,16 @@ def __init__( MSI and AAD exclusively for authentication. :paramtype disable_local_auth: bool """ - super(Databricks, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) + super(Databricks, self).__init__( + compute_location=compute_location, + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'Databricks' # type: str + self.compute_type = "Databricks" # type: str self.compute_location = compute_location self.provisioning_state = None self.description = description @@ -7894,14 +8309,14 @@ class DatabricksComputeSecretsProperties(msrest.serialization.Model): """ _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, } def __init__( - self, - *, - databricks_access_token: Optional[str] = None, - **kwargs + self, *, databricks_access_token: Optional[str] = None, **kwargs ): """ :keyword databricks_access_token: access token for databricks account. @@ -7911,7 +8326,9 @@ def __init__( self.databricks_access_token = databricks_access_token -class DatabricksComputeSecrets(ComputeSecrets, DatabricksComputeSecretsProperties): +class DatabricksComputeSecrets( + ComputeSecrets, DatabricksComputeSecretsProperties +): """Secrets related to a Machine Learning compute based on Databricks. All required parameters must be populated in order to send to Azure. @@ -7925,27 +8342,29 @@ class DatabricksComputeSecrets(ComputeSecrets, DatabricksComputeSecretsPropertie """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, + "compute_type": {"key": "computeType", "type": "str"}, } def __init__( - self, - *, - databricks_access_token: Optional[str] = None, - **kwargs + self, *, databricks_access_token: Optional[str] = None, **kwargs ): """ :keyword databricks_access_token: access token for databricks account. :paramtype databricks_access_token: str """ - super(DatabricksComputeSecrets, self).__init__(databricks_access_token=databricks_access_token, **kwargs) + super(DatabricksComputeSecrets, self).__init__( + databricks_access_token=databricks_access_token, **kwargs + ) self.databricks_access_token = databricks_access_token - self.compute_type = 'Databricks' # type: str + self.compute_type = "Databricks" # type: str class DatabricksProperties(msrest.serialization.Model): @@ -7958,8 +8377,11 @@ class DatabricksProperties(msrest.serialization.Model): """ _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'workspace_url': {'key': 'workspaceUrl', 'type': 'str'}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, + "workspace_url": {"key": "workspaceUrl", "type": "str"}, } def __init__( @@ -8003,27 +8425,22 @@ class DataContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "DataContainerProperties"}, } - def __init__( - self, - *, - properties: "DataContainerProperties", - **kwargs - ): + def __init__(self, *, properties: "DataContainerProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataContainerProperties @@ -8057,19 +8474,19 @@ class DataContainerProperties(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'data_type': {'required': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "data_type": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "data_type": {"key": "dataType", "type": "str"}, } def __init__( @@ -8095,7 +8512,13 @@ def __init__( "uri_file", "uri_folder", "mltable". :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType """ - super(DataContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) + super(DataContainerProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs + ) self.data_type = data_type @@ -8110,8 +8533,8 @@ class DataContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[DataContainer]"}, } def __init__( @@ -8170,25 +8593,28 @@ class DataFactory(Compute): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -8211,8 +8637,14 @@ def __init__( MSI and AAD exclusively for authentication. :paramtype disable_local_auth: bool """ - super(DataFactory, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, **kwargs) - self.compute_type = 'DataFactory' # type: str + super(DataFactory, self).__init__( + compute_location=compute_location, + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + **kwargs + ) + self.compute_type = "DataFactory" # type: str class DataLakeAnalyticsSchema(msrest.serialization.Model): @@ -8224,7 +8656,10 @@ class DataLakeAnalyticsSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, + "properties": { + "key": "properties", + "type": "DataLakeAnalyticsSchemaProperties", + }, } def __init__( @@ -8282,26 +8717,32 @@ class DataLakeAnalytics(Compute, DataLakeAnalyticsSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": { + "key": "properties", + "type": "DataLakeAnalyticsSchemaProperties", + }, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -8328,9 +8769,16 @@ def __init__( MSI and AAD exclusively for authentication. :paramtype disable_local_auth: bool """ - super(DataLakeAnalytics, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) + super(DataLakeAnalytics, self).__init__( + compute_location=compute_location, + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'DataLakeAnalytics' # type: str + self.compute_type = "DataLakeAnalytics" # type: str self.compute_location = compute_location self.provisioning_state = None self.description = description @@ -8350,14 +8798,14 @@ class DataLakeAnalyticsSchemaProperties(msrest.serialization.Model): """ _attribute_map = { - 'data_lake_store_account_name': {'key': 'dataLakeStoreAccountName', 'type': 'str'}, + "data_lake_store_account_name": { + "key": "dataLakeStoreAccountName", + "type": "str", + }, } def __init__( - self, - *, - data_lake_store_account_name: Optional[str] = None, - **kwargs + self, *, data_lake_store_account_name: Optional[str] = None, **kwargs ): """ :keyword data_lake_store_account_name: DataLake Store Account Name. @@ -8382,13 +8830,13 @@ class DataPathAssetReference(AssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'datastore_id': {'key': 'datastoreId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "datastore_id": {"key": "datastoreId", "type": "str"}, + "path": {"key": "path", "type": "str"}, } def __init__( @@ -8405,7 +8853,7 @@ def __init__( :paramtype path: str """ super(DataPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'DataPath' # type: str + self.reference_type = "DataPath" # type: str self.datastore_id = datastore_id self.path = path @@ -8433,31 +8881,27 @@ class DatasetExportSummary(ExportSummary): """ _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'labeled_asset_name': {'readonly': True}, + "end_date_time": {"readonly": True}, + "exported_row_count": {"readonly": True}, + "format": {"required": True}, + "labeling_job_id": {"readonly": True}, + "start_date_time": {"readonly": True}, + "labeled_asset_name": {"readonly": True}, } _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'labeled_asset_name': {'key': 'labeledAssetName', 'type': 'str'}, + "end_date_time": {"key": "endDateTime", "type": "iso-8601"}, + "exported_row_count": {"key": "exportedRowCount", "type": "long"}, + "format": {"key": "format", "type": "str"}, + "labeling_job_id": {"key": "labelingJobId", "type": "str"}, + "start_date_time": {"key": "startDateTime", "type": "iso-8601"}, + "labeled_asset_name": {"key": "labeledAssetName", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DatasetExportSummary, self).__init__(**kwargs) - self.format = 'Dataset' # type: str + self.format = "Dataset" # type: str self.labeled_asset_name = None @@ -8484,27 +8928,22 @@ class Datastore(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DatastoreProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "DatastoreProperties"}, } - def __init__( - self, - *, - properties: "DatastoreProperties", - **kwargs - ): + def __init__(self, *, properties: "DatastoreProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatastoreProperties @@ -8524,8 +8963,8 @@ class DatastoreResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Datastore]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[Datastore]"}, } def __init__( @@ -8570,27 +9009,25 @@ class DataVersionBase(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataVersionBaseProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "DataVersionBaseProperties", + }, } - def __init__( - self, - *, - properties: "DataVersionBaseProperties", - **kwargs - ): + def __init__(self, *, properties: "DataVersionBaseProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataVersionBaseProperties @@ -8626,22 +9063,26 @@ class DataVersionBaseProperties(AssetBase): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, } _subtype_map = { - 'data_type': {'mltable': 'MLTableData', 'uri_file': 'UriFileDataVersion', 'uri_folder': 'UriFolderDataVersion'} + "data_type": { + "mltable": "MLTableData", + "uri_file": "UriFileDataVersion", + "uri_folder": "UriFolderDataVersion", + } } def __init__( @@ -8670,8 +9111,15 @@ def __init__( https://go.microsoft.com/fwlink/?linkid=2202330. :paramtype data_uri: str """ - super(DataVersionBaseProperties, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.data_type = 'DataVersionBaseProperties' # type: str + super(DataVersionBaseProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + **kwargs + ) + self.data_type = "DataVersionBaseProperties" # type: str self.data_uri = data_uri @@ -8686,8 +9134,8 @@ class DataVersionBaseResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataVersionBase]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[DataVersionBase]"}, } def __init__( @@ -8704,7 +9152,9 @@ def __init__( :keyword value: An array of objects of type DataVersionBase. :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBase] """ - super(DataVersionBaseResourceArmPaginatedResult, self).__init__(**kwargs) + super(DataVersionBaseResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -8723,23 +9173,22 @@ class OnlineScaleSettings(msrest.serialization.Model): """ _validation = { - 'scale_type': {'required': True}, + "scale_type": {"required": True}, } _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, + "scale_type": {"key": "scaleType", "type": "str"}, } _subtype_map = { - 'scale_type': {'Default': 'DefaultScaleSettings', 'TargetUtilization': 'TargetUtilizationScaleSettings'} + "scale_type": { + "Default": "DefaultScaleSettings", + "TargetUtilization": "TargetUtilizationScaleSettings", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(OnlineScaleSettings, self).__init__(**kwargs) self.scale_type = None # type: Optional[str] @@ -8755,21 +9204,17 @@ class DefaultScaleSettings(OnlineScaleSettings): """ _validation = { - 'scale_type': {'required': True}, + "scale_type": {"required": True}, } _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, + "scale_type": {"key": "scaleType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DefaultScaleSettings, self).__init__(**kwargs) - self.scale_type = 'Default' # type: str + self.scale_type = "Default" # type: str class DeploymentLogs(msrest.serialization.Model): @@ -8780,15 +9225,10 @@ class DeploymentLogs(msrest.serialization.Model): """ _attribute_map = { - 'content': {'key': 'content', 'type': 'str'}, + "content": {"key": "content", "type": "str"}, } - def __init__( - self, - *, - content: Optional[str] = None, - **kwargs - ): + def __init__(self, *, content: Optional[str] = None, **kwargs): """ :keyword content: The retrieved online deployment logs. :paramtype content: str @@ -8808,8 +9248,8 @@ class DeploymentLogsRequest(msrest.serialization.Model): """ _attribute_map = { - 'container_type': {'key': 'containerType', 'type': 'str'}, - 'tail': {'key': 'tail', 'type': 'int'}, + "container_type": {"key": "containerType", "type": "str"}, + "tail": {"key": "tail", "type": "int"}, } def __init__( @@ -8843,9 +9283,9 @@ class ResourceConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "properties": {"key": "properties", "type": "{object}"}, } def __init__( @@ -8882,9 +9322,9 @@ class DeploymentResourceConfiguration(ResourceConfiguration): """ _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "properties": {"key": "properties", "type": "{object}"}, } def __init__( @@ -8903,7 +9343,12 @@ def __init__( :keyword properties: Additional properties bag. :paramtype properties: dict[str, any] """ - super(DeploymentResourceConfiguration, self).__init__(instance_count=instance_count, instance_type=instance_type, properties=properties, **kwargs) + super(DeploymentResourceConfiguration, self).__init__( + instance_count=instance_count, + instance_type=instance_type, + properties=properties, + **kwargs + ) class DiagnoseRequestProperties(msrest.serialization.Model): @@ -8930,15 +9375,18 @@ class DiagnoseRequestProperties(msrest.serialization.Model): """ _attribute_map = { - 'udr': {'key': 'udr', 'type': '{object}'}, - 'nsg': {'key': 'nsg', 'type': '{object}'}, - 'resource_lock': {'key': 'resourceLock', 'type': '{object}'}, - 'dns_resolution': {'key': 'dnsResolution', 'type': '{object}'}, - 'storage_account': {'key': 'storageAccount', 'type': '{object}'}, - 'key_vault': {'key': 'keyVault', 'type': '{object}'}, - 'container_registry': {'key': 'containerRegistry', 'type': '{object}'}, - 'application_insights': {'key': 'applicationInsights', 'type': '{object}'}, - 'others': {'key': 'others', 'type': '{object}'}, + "udr": {"key": "udr", "type": "{object}"}, + "nsg": {"key": "nsg", "type": "{object}"}, + "resource_lock": {"key": "resourceLock", "type": "{object}"}, + "dns_resolution": {"key": "dnsResolution", "type": "{object}"}, + "storage_account": {"key": "storageAccount", "type": "{object}"}, + "key_vault": {"key": "keyVault", "type": "{object}"}, + "container_registry": {"key": "containerRegistry", "type": "{object}"}, + "application_insights": { + "key": "applicationInsights", + "type": "{object}", + }, + "others": {"key": "others", "type": "{object}"}, } def __init__( @@ -8995,7 +9443,7 @@ class DiagnoseResponseResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseResponseResultValue'}, + "value": {"key": "value", "type": "DiagnoseResponseResultValue"}, } def __init__( @@ -9042,15 +9490,39 @@ class DiagnoseResponseResultValue(msrest.serialization.Model): """ _attribute_map = { - 'user_defined_route_results': {'key': 'userDefinedRouteResults', 'type': '[DiagnoseResult]'}, - 'network_security_rule_results': {'key': 'networkSecurityRuleResults', 'type': '[DiagnoseResult]'}, - 'resource_lock_results': {'key': 'resourceLockResults', 'type': '[DiagnoseResult]'}, - 'dns_resolution_results': {'key': 'dnsResolutionResults', 'type': '[DiagnoseResult]'}, - 'storage_account_results': {'key': 'storageAccountResults', 'type': '[DiagnoseResult]'}, - 'key_vault_results': {'key': 'keyVaultResults', 'type': '[DiagnoseResult]'}, - 'container_registry_results': {'key': 'containerRegistryResults', 'type': '[DiagnoseResult]'}, - 'application_insights_results': {'key': 'applicationInsightsResults', 'type': '[DiagnoseResult]'}, - 'other_results': {'key': 'otherResults', 'type': '[DiagnoseResult]'}, + "user_defined_route_results": { + "key": "userDefinedRouteResults", + "type": "[DiagnoseResult]", + }, + "network_security_rule_results": { + "key": "networkSecurityRuleResults", + "type": "[DiagnoseResult]", + }, + "resource_lock_results": { + "key": "resourceLockResults", + "type": "[DiagnoseResult]", + }, + "dns_resolution_results": { + "key": "dnsResolutionResults", + "type": "[DiagnoseResult]", + }, + "storage_account_results": { + "key": "storageAccountResults", + "type": "[DiagnoseResult]", + }, + "key_vault_results": { + "key": "keyVaultResults", + "type": "[DiagnoseResult]", + }, + "container_registry_results": { + "key": "containerRegistryResults", + "type": "[DiagnoseResult]", + }, + "application_insights_results": { + "key": "applicationInsightsResults", + "type": "[DiagnoseResult]", + }, + "other_results": {"key": "otherResults", "type": "[DiagnoseResult]"}, } def __init__( @@ -9121,23 +9593,19 @@ class DiagnoseResult(msrest.serialization.Model): """ _validation = { - 'code': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, + "code": {"readonly": True}, + "level": {"readonly": True}, + "message": {"readonly": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, + "code": {"key": "code", "type": "str"}, + "level": {"key": "level", "type": "str"}, + "message": {"key": "message", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DiagnoseResult, self).__init__(**kwargs) self.code = None self.level = None @@ -9152,14 +9620,11 @@ class DiagnoseWorkspaceParameters(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseRequestProperties'}, + "value": {"key": "value", "type": "DiagnoseRequestProperties"}, } def __init__( - self, - *, - value: Optional["DiagnoseRequestProperties"] = None, - **kwargs + self, *, value: Optional["DiagnoseRequestProperties"] = None, **kwargs ): """ :keyword value: Value of Parameters. @@ -9183,23 +9648,23 @@ class DistributionConfiguration(msrest.serialization.Model): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, + "distribution_type": {"key": "distributionType", "type": "str"}, } _subtype_map = { - 'distribution_type': {'Mpi': 'Mpi', 'PyTorch': 'PyTorch', 'TensorFlow': 'TensorFlow'} + "distribution_type": { + "Mpi": "Mpi", + "PyTorch": "PyTorch", + "TensorFlow": "TensorFlow", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DistributionConfiguration, self).__init__(**kwargs) self.distribution_type = None # type: Optional[str] @@ -9215,8 +9680,8 @@ class Docker(msrest.serialization.Model): """ _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'privileged': {'key': 'privileged', 'type': 'bool'}, + "additional_properties": {"key": "", "type": "{object}"}, + "privileged": {"key": "privileged", "type": "bool"}, } def __init__( @@ -9254,14 +9719,14 @@ class EncryptionKeyVaultProperties(msrest.serialization.Model): """ _validation = { - 'key_vault_arm_id': {'required': True}, - 'key_identifier': {'required': True}, + "key_vault_arm_id": {"required": True}, + "key_identifier": {"required": True}, } _attribute_map = { - 'key_vault_arm_id': {'key': 'keyVaultArmId', 'type': 'str'}, - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - 'identity_client_id': {'key': 'identityClientId', 'type': 'str'}, + "key_vault_arm_id": {"key": "keyVaultArmId", "type": "str"}, + "key_identifier": {"key": "keyIdentifier", "type": "str"}, + "identity_client_id": {"key": "identityClientId", "type": "str"}, } def __init__( @@ -9298,19 +9763,14 @@ class EncryptionKeyVaultUpdateProperties(msrest.serialization.Model): """ _validation = { - 'key_identifier': {'required': True}, + "key_identifier": {"required": True}, } _attribute_map = { - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, + "key_identifier": {"key": "keyIdentifier", "type": "str"}, } - def __init__( - self, - *, - key_identifier: str, - **kwargs - ): + def __init__(self, *, key_identifier: str, **kwargs): """ :keyword key_identifier: Required. Key Vault uri to access the encryption key. :paramtype key_identifier: str @@ -9335,14 +9795,17 @@ class EncryptionProperty(msrest.serialization.Model): """ _validation = { - 'status': {'required': True}, - 'key_vault_properties': {'required': True}, + "status": {"required": True}, + "key_vault_properties": {"required": True}, } _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityForCmk'}, - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'EncryptionKeyVaultProperties'}, + "status": {"key": "status", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityForCmk"}, + "key_vault_properties": { + "key": "keyVaultProperties", + "type": "EncryptionKeyVaultProperties", + }, } def __init__( @@ -9381,11 +9844,14 @@ class EncryptionUpdateProperties(msrest.serialization.Model): """ _validation = { - 'key_vault_properties': {'required': True}, + "key_vault_properties": {"required": True}, } _attribute_map = { - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'EncryptionKeyVaultUpdateProperties'}, + "key_vault_properties": { + "key": "keyVaultProperties", + "type": "EncryptionKeyVaultUpdateProperties", + }, } def __init__( @@ -9420,11 +9886,11 @@ class Endpoint(msrest.serialization.Model): """ _attribute_map = { - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'int'}, - 'published': {'key': 'published', 'type': 'int'}, - 'host_ip': {'key': 'hostIp', 'type': 'str'}, + "protocol": {"key": "protocol", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "target": {"key": "target", "type": "int"}, + "published": {"key": "published", "type": "int"}, + "host_ip": {"key": "hostIp", "type": "str"}, } def __init__( @@ -9468,8 +9934,8 @@ class EndpointAuthKeys(msrest.serialization.Model): """ _attribute_map = { - 'primary_key': {'key': 'primaryKey', 'type': 'str'}, - 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, + "primary_key": {"key": "primaryKey", "type": "str"}, + "secondary_key": {"key": "secondaryKey", "type": "str"}, } def __init__( @@ -9504,10 +9970,13 @@ class EndpointAuthToken(msrest.serialization.Model): """ _attribute_map = { - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'expiry_time_utc': {'key': 'expiryTimeUtc', 'type': 'long'}, - 'refresh_after_time_utc': {'key': 'refreshAfterTimeUtc', 'type': 'long'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, + "access_token": {"key": "accessToken", "type": "str"}, + "expiry_time_utc": {"key": "expiryTimeUtc", "type": "long"}, + "refresh_after_time_utc": { + "key": "refreshAfterTimeUtc", + "type": "long", + }, + "token_type": {"key": "tokenType", "type": "str"}, } def __init__( @@ -9550,23 +10019,22 @@ class ScheduleActionBase(msrest.serialization.Model): """ _validation = { - 'action_type': {'required': True}, + "action_type": {"required": True}, } _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, + "action_type": {"key": "actionType", "type": "str"}, } _subtype_map = { - 'action_type': {'CreateJob': 'JobScheduleAction', 'InvokeBatchEndpoint': 'EndpointScheduleAction'} + "action_type": { + "CreateJob": "JobScheduleAction", + "InvokeBatchEndpoint": "EndpointScheduleAction", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ScheduleActionBase, self).__init__(**kwargs) self.action_type = None # type: Optional[str] @@ -9581,42 +10049,40 @@ class EndpointScheduleAction(ScheduleActionBase): :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType :ivar endpoint_invocation_definition: Required. [Required] Defines Schedule action definition details. - - + + .. raw:: html - + . :vartype endpoint_invocation_definition: any """ _validation = { - 'action_type': {'required': True}, - 'endpoint_invocation_definition': {'required': True}, + "action_type": {"required": True}, + "endpoint_invocation_definition": {"required": True}, } _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'endpoint_invocation_definition': {'key': 'endpointInvocationDefinition', 'type': 'object'}, + "action_type": {"key": "actionType", "type": "str"}, + "endpoint_invocation_definition": { + "key": "endpointInvocationDefinition", + "type": "object", + }, } - def __init__( - self, - *, - endpoint_invocation_definition: Any, - **kwargs - ): + def __init__(self, *, endpoint_invocation_definition: Any, **kwargs): """ :keyword endpoint_invocation_definition: Required. [Required] Defines Schedule action definition details. - - + + .. raw:: html - + . :paramtype endpoint_invocation_definition: any """ super(EndpointScheduleAction, self).__init__(**kwargs) - self.action_type = 'InvokeBatchEndpoint' # type: str + self.action_type = "InvokeBatchEndpoint" # type: str self.endpoint_invocation_definition = endpoint_invocation_definition @@ -9643,26 +10109,26 @@ class EnvironmentContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "EnvironmentContainerProperties", + }, } def __init__( - self, - *, - properties: "EnvironmentContainerProperties", - **kwargs + self, *, properties: "EnvironmentContainerProperties", **kwargs ): """ :keyword properties: Required. [Required] Additional attributes of the entity. @@ -9697,19 +10163,19 @@ class EnvironmentContainerProperties(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } def __init__( @@ -9731,11 +10197,19 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(EnvironmentContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) + super(EnvironmentContainerProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs + ) self.provisioning_state = None -class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model): +class EnvironmentContainerResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of EnvironmentContainer entities. :ivar next_link: The link to the next page of EnvironmentContainer objects. If null, there are @@ -9746,8 +10220,8 @@ class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model) """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[EnvironmentContainer]"}, } def __init__( @@ -9764,7 +10238,9 @@ def __init__( :keyword value: An array of objects of type EnvironmentContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] """ - super(EnvironmentContainerResourceArmPaginatedResult, self).__init__(**kwargs) + super(EnvironmentContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -9783,9 +10259,9 @@ class EnvironmentVariable(msrest.serialization.Model): """ _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "additional_properties": {"key": "", "type": "{object}"}, + "type": {"key": "type", "type": "str"}, + "value": {"key": "value", "type": "str"}, } def __init__( @@ -9835,26 +10311,26 @@ class EnvironmentVersion(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentVersionProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "EnvironmentVersionProperties", + }, } def __init__( - self, - *, - properties: "EnvironmentVersionProperties", - **kwargs + self, *, properties: "EnvironmentVersionProperties", **kwargs ): """ :keyword properties: Required. [Required] Additional attributes of the entity. @@ -9886,29 +10362,29 @@ class EnvironmentVersionProperties(AssetBase): :vartype build: ~azure.mgmt.machinelearningservices.models.BuildContext :ivar conda_file: Standard configuration file used by Conda that lets you install any kind of package, including Python, R, and C/C++ packages. - - + + .. raw:: html - + . :vartype conda_file: str :ivar environment_type: Environment type is either user managed or curated by the Azure ML service - - + + .. raw:: html - + . Possible values include: "Curated", "UserCreated". :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType :ivar image: Name of the image that will be used for the environment. - - + + .. raw:: html - + . @@ -9925,24 +10401,27 @@ class EnvironmentVersionProperties(AssetBase): """ _validation = { - 'environment_type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "environment_type": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'auto_rebuild': {'key': 'autoRebuild', 'type': 'str'}, - 'build': {'key': 'build', 'type': 'BuildContext'}, - 'conda_file': {'key': 'condaFile', 'type': 'str'}, - 'environment_type': {'key': 'environmentType', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'str'}, - 'inference_config': {'key': 'inferenceConfig', 'type': 'InferenceContainerProperties'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "auto_rebuild": {"key": "autoRebuild", "type": "str"}, + "build": {"key": "build", "type": "BuildContext"}, + "conda_file": {"key": "condaFile", "type": "str"}, + "environment_type": {"key": "environmentType", "type": "str"}, + "image": {"key": "image", "type": "str"}, + "inference_config": { + "key": "inferenceConfig", + "type": "InferenceContainerProperties", + }, + "os_type": {"key": "osType", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } def __init__( @@ -9979,19 +10458,19 @@ def __init__( :paramtype build: ~azure.mgmt.machinelearningservices.models.BuildContext :keyword conda_file: Standard configuration file used by Conda that lets you install any kind of package, including Python, R, and C/C++ packages. - - + + .. raw:: html - + . :paramtype conda_file: str :keyword image: Name of the image that will be used for the environment. - - + + .. raw:: html - + . @@ -10002,7 +10481,14 @@ def __init__( :keyword os_type: The OS type of the environment. Possible values include: "Linux", "Windows". :paramtype os_type: str or ~azure.mgmt.machinelearningservices.models.OperatingSystemType """ - super(EnvironmentVersionProperties, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) + super(EnvironmentVersionProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + **kwargs + ) self.auto_rebuild = auto_rebuild self.build = build self.conda_file = conda_file @@ -10024,8 +10510,8 @@ class EnvironmentVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentVersion]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[EnvironmentVersion]"}, } def __init__( @@ -10042,7 +10528,9 @@ def __init__( :keyword value: An array of objects of type EnvironmentVersion. :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] """ - super(EnvironmentVersionResourceArmPaginatedResult, self).__init__(**kwargs) + super(EnvironmentVersionResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -10059,21 +10547,17 @@ class ErrorAdditionalInfo(msrest.serialization.Model): """ _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, + "type": {"readonly": True}, + "info": {"readonly": True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, + "type": {"key": "type", "type": "str"}, + "info": {"key": "info", "type": "object"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ErrorAdditionalInfo, self).__init__(**kwargs) self.type = None self.info = None @@ -10097,27 +10581,26 @@ class ErrorDetail(msrest.serialization.Model): """ _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, + "code": {"readonly": True}, + "message": {"readonly": True}, + "target": {"readonly": True}, + "details": {"readonly": True}, + "additional_info": {"readonly": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[ErrorDetail]"}, + "additional_info": { + "key": "additionalInfo", + "type": "[ErrorAdditionalInfo]", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ErrorDetail, self).__init__(**kwargs) self.code = None self.message = None @@ -10134,15 +10617,10 @@ class ErrorResponse(msrest.serialization.Model): """ _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, + "error": {"key": "error", "type": "ErrorDetail"}, } - def __init__( - self, - *, - error: Optional["ErrorDetail"] = None, - **kwargs - ): + def __init__(self, *, error: Optional["ErrorDetail"] = None, **kwargs): """ :keyword error: The error object. :paramtype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail @@ -10167,15 +10645,15 @@ class EstimatedVMPrice(msrest.serialization.Model): """ _validation = { - 'retail_price': {'required': True}, - 'os_type': {'required': True}, - 'vm_tier': {'required': True}, + "retail_price": {"required": True}, + "os_type": {"required": True}, + "vm_tier": {"required": True}, } _attribute_map = { - 'retail_price': {'key': 'retailPrice', 'type': 'float'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_tier': {'key': 'vmTier', 'type': 'str'}, + "retail_price": {"key": "retailPrice", "type": "float"}, + "os_type": {"key": "osType", "type": "str"}, + "vm_tier": {"key": "vmTier", "type": "str"}, } def __init__( @@ -10219,15 +10697,15 @@ class EstimatedVMPrices(msrest.serialization.Model): """ _validation = { - 'billing_currency': {'required': True}, - 'unit_of_measure': {'required': True}, - 'values': {'required': True}, + "billing_currency": {"required": True}, + "unit_of_measure": {"required": True}, + "values": {"required": True}, } _attribute_map = { - 'billing_currency': {'key': 'billingCurrency', 'type': 'str'}, - 'unit_of_measure': {'key': 'unitOfMeasure', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[EstimatedVMPrice]'}, + "billing_currency": {"key": "billingCurrency", "type": "str"}, + "unit_of_measure": {"key": "unitOfMeasure", "type": "str"}, + "values": {"key": "values", "type": "[EstimatedVMPrice]"}, } def __init__( @@ -10263,14 +10741,11 @@ class ExternalFQDNResponse(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[FQDNEndpoints]'}, + "value": {"key": "value", "type": "[FQDNEndpoints]"}, } def __init__( - self, - *, - value: Optional[List["FQDNEndpoints"]] = None, - **kwargs + self, *, value: Optional[List["FQDNEndpoints"]] = None, **kwargs ): """ :keyword value: @@ -10294,10 +10769,22 @@ class FeatureStoreSettings(msrest.serialization.Model): """ _attribute_map = { - 'compute_runtime': {'key': 'computeRuntime', 'type': 'ComputeRuntimeDto'}, - 'offline_store_connection_name': {'key': 'offlineStoreConnectionName', 'type': 'str'}, - 'online_store_connection_name': {'key': 'onlineStoreConnectionName', 'type': 'str'}, - 'allow_role_assignments_on_resource_group_level': {'key': 'allowRoleAssignmentsOnResourceGroupLevel', 'type': 'bool'}, + "compute_runtime": { + "key": "computeRuntime", + "type": "ComputeRuntimeDto", + }, + "offline_store_connection_name": { + "key": "offlineStoreConnectionName", + "type": "str", + }, + "online_store_connection_name": { + "key": "onlineStoreConnectionName", + "type": "str", + }, + "allow_role_assignments_on_resource_group_level": { + "key": "allowRoleAssignmentsOnResourceGroupLevel", + "type": "bool", + }, } def __init__( @@ -10323,7 +10810,9 @@ def __init__( self.compute_runtime = compute_runtime self.offline_store_connection_name = offline_store_connection_name self.online_store_connection_name = online_store_connection_name - self.allow_role_assignments_on_resource_group_level = allow_role_assignments_on_resource_group_level + self.allow_role_assignments_on_resource_group_level = ( + allow_role_assignments_on_resource_group_level + ) class FeaturizationSettings(msrest.serialization.Model): @@ -10334,15 +10823,10 @@ class FeaturizationSettings(msrest.serialization.Model): """ _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, + "dataset_language": {"key": "datasetLanguage", "type": "str"}, } - def __init__( - self, - *, - dataset_language: Optional[str] = None, - **kwargs - ): + def __init__(self, *, dataset_language: Optional[str] = None, **kwargs): """ :keyword dataset_language: Dataset language, useful for the text data. :paramtype dataset_language: str @@ -10359,15 +10843,10 @@ class FlavorData(msrest.serialization.Model): """ _attribute_map = { - 'data': {'key': 'data', 'type': '{str}'}, + "data": {"key": "data", "type": "{str}"}, } - def __init__( - self, - *, - data: Optional[Dict[str, str]] = None, - **kwargs - ): + def __init__(self, *, data: Optional[Dict[str, str]] = None, **kwargs): """ :keyword data: Model flavor-specific data. :paramtype data: dict[str, str] @@ -10442,30 +10921,60 @@ class Forecasting(AutoMLVertical, TableVertical): """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'forecasting_settings': {'key': 'forecastingSettings', 'type': 'ForecastingSettings'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'ForecastingTrainingSettings'}, + "task_type": {"required": True}, + "training_data": {"required": True}, + } + + _attribute_map = { + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "TableFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "search_space": { + "key": "searchSpace", + "type": "[TableParameterSubspace]", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "TableSweepSettings", + }, + "test_data": {"key": "testData", "type": "MLTableJobInput"}, + "test_data_size": {"key": "testDataSize", "type": "float"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "weight_column_name": {"key": "weightColumnName", "type": "str"}, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "forecasting_settings": { + "key": "forecastingSettings", + "type": "ForecastingSettings", + }, + "primary_metric": {"key": "primaryMetric", "type": "str"}, + "training_settings": { + "key": "trainingSettings", + "type": "ForecastingTrainingSettings", + }, } def __init__( @@ -10473,7 +10982,9 @@ def __init__( *, training_data: "MLTableJobInput", cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "TableVerticalFeaturizationSettings" + ] = None, fixed_parameters: Optional["TableFixedParameters"] = None, limit_settings: Optional["TableVerticalLimitSettings"] = None, n_cross_validations: Optional["NCrossValidations"] = None, @@ -10487,7 +10998,9 @@ def __init__( log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, forecasting_settings: Optional["ForecastingSettings"] = None, - primary_metric: Optional[Union[str, "ForecastingPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "ForecastingPrimaryMetrics"] + ] = None, training_settings: Optional["ForecastingTrainingSettings"] = None, **kwargs ): @@ -10549,7 +11062,24 @@ def __init__( :paramtype training_settings: ~azure.mgmt.machinelearningservices.models.ForecastingTrainingSettings """ - super(Forecasting, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, cv_split_column_names=cv_split_column_names, featurization_settings=featurization_settings, fixed_parameters=fixed_parameters, limit_settings=limit_settings, n_cross_validations=n_cross_validations, search_space=search_space, sweep_settings=sweep_settings, test_data=test_data, test_data_size=test_data_size, validation_data=validation_data, validation_data_size=validation_data_size, weight_column_name=weight_column_name, **kwargs) + super(Forecasting, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + cv_split_column_names=cv_split_column_names, + featurization_settings=featurization_settings, + fixed_parameters=fixed_parameters, + limit_settings=limit_settings, + n_cross_validations=n_cross_validations, + search_space=search_space, + sweep_settings=sweep_settings, + test_data=test_data, + test_data_size=test_data_size, + validation_data=validation_data, + validation_data_size=validation_data_size, + weight_column_name=weight_column_name, + **kwargs + ) self.cv_split_column_names = cv_split_column_names self.featurization_settings = featurization_settings self.fixed_parameters = fixed_parameters @@ -10562,7 +11092,7 @@ def __init__( self.validation_data = validation_data self.validation_data_size = validation_data_size self.weight_column_name = weight_column_name - self.task_type = 'Forecasting' # type: str + self.task_type = "Forecasting" # type: str self.forecasting_settings = forecasting_settings self.primary_metric = primary_metric self.training_settings = training_settings @@ -10626,19 +11156,37 @@ class ForecastingSettings(msrest.serialization.Model): """ _attribute_map = { - 'country_or_region_for_holidays': {'key': 'countryOrRegionForHolidays', 'type': 'str'}, - 'cv_step_size': {'key': 'cvStepSize', 'type': 'int'}, - 'feature_lags': {'key': 'featureLags', 'type': 'str'}, - 'forecast_horizon': {'key': 'forecastHorizon', 'type': 'ForecastHorizon'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'seasonality': {'key': 'seasonality', 'type': 'Seasonality'}, - 'short_series_handling_config': {'key': 'shortSeriesHandlingConfig', 'type': 'str'}, - 'target_aggregate_function': {'key': 'targetAggregateFunction', 'type': 'str'}, - 'target_lags': {'key': 'targetLags', 'type': 'TargetLags'}, - 'target_rolling_window_size': {'key': 'targetRollingWindowSize', 'type': 'TargetRollingWindowSize'}, - 'time_column_name': {'key': 'timeColumnName', 'type': 'str'}, - 'time_series_id_column_names': {'key': 'timeSeriesIdColumnNames', 'type': '[str]'}, - 'use_stl': {'key': 'useStl', 'type': 'str'}, + "country_or_region_for_holidays": { + "key": "countryOrRegionForHolidays", + "type": "str", + }, + "cv_step_size": {"key": "cvStepSize", "type": "int"}, + "feature_lags": {"key": "featureLags", "type": "str"}, + "forecast_horizon": { + "key": "forecastHorizon", + "type": "ForecastHorizon", + }, + "frequency": {"key": "frequency", "type": "str"}, + "seasonality": {"key": "seasonality", "type": "Seasonality"}, + "short_series_handling_config": { + "key": "shortSeriesHandlingConfig", + "type": "str", + }, + "target_aggregate_function": { + "key": "targetAggregateFunction", + "type": "str", + }, + "target_lags": {"key": "targetLags", "type": "TargetLags"}, + "target_rolling_window_size": { + "key": "targetRollingWindowSize", + "type": "TargetRollingWindowSize", + }, + "time_column_name": {"key": "timeColumnName", "type": "str"}, + "time_series_id_column_names": { + "key": "timeSeriesIdColumnNames", + "type": "[str]", + }, + "use_stl": {"key": "useStl", "type": "str"}, } def __init__( @@ -10650,8 +11198,12 @@ def __init__( forecast_horizon: Optional["ForecastHorizon"] = None, frequency: Optional[str] = None, seasonality: Optional["Seasonality"] = None, - short_series_handling_config: Optional[Union[str, "ShortSeriesHandlingConfiguration"]] = None, - target_aggregate_function: Optional[Union[str, "TargetAggregationFunction"]] = None, + short_series_handling_config: Optional[ + Union[str, "ShortSeriesHandlingConfiguration"] + ] = None, + target_aggregate_function: Optional[ + Union[str, "TargetAggregationFunction"] + ] = None, target_lags: Optional["TargetLags"] = None, target_rolling_window_size: Optional["TargetRollingWindowSize"] = None, time_column_name: Optional[str] = None, @@ -10765,16 +11317,37 @@ class ForecastingTrainingSettings(TrainingSettings): """ _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, + "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, + "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, + "training_mode": {"key": "trainingMode", "type": "str"}, + "allowed_training_algorithms": { + "key": "allowedTrainingAlgorithms", + "type": "[str]", + }, + "blocked_training_algorithms": { + "key": "blockedTrainingAlgorithms", + "type": "[str]", + }, } def __init__( @@ -10788,8 +11361,12 @@ def __init__( ensemble_model_download_timeout: Optional[datetime.timedelta] = "PT5M", stack_ensemble_settings: Optional["StackEnsembleSettings"] = None, training_mode: Optional[Union[str, "TrainingMode"]] = None, - allowed_training_algorithms: Optional[List[Union[str, "ForecastingModels"]]] = None, - blocked_training_algorithms: Optional[List[Union[str, "ForecastingModels"]]] = None, + allowed_training_algorithms: Optional[ + List[Union[str, "ForecastingModels"]] + ] = None, + blocked_training_algorithms: Optional[ + List[Union[str, "ForecastingModels"]] + ] = None, **kwargs ): """ @@ -10825,7 +11402,17 @@ def __init__( :paramtype blocked_training_algorithms: list[str or ~azure.mgmt.machinelearningservices.models.ForecastingModels] """ - super(ForecastingTrainingSettings, self).__init__(enable_dnn_training=enable_dnn_training, enable_model_explainability=enable_model_explainability, enable_onnx_compatible_models=enable_onnx_compatible_models, enable_stack_ensemble=enable_stack_ensemble, enable_vote_ensemble=enable_vote_ensemble, ensemble_model_download_timeout=ensemble_model_download_timeout, stack_ensemble_settings=stack_ensemble_settings, training_mode=training_mode, **kwargs) + super(ForecastingTrainingSettings, self).__init__( + enable_dnn_training=enable_dnn_training, + enable_model_explainability=enable_model_explainability, + enable_onnx_compatible_models=enable_onnx_compatible_models, + enable_stack_ensemble=enable_stack_ensemble, + enable_vote_ensemble=enable_vote_ensemble, + ensemble_model_download_timeout=ensemble_model_download_timeout, + stack_ensemble_settings=stack_ensemble_settings, + training_mode=training_mode, + **kwargs + ) self.allowed_training_algorithms = allowed_training_algorithms self.blocked_training_algorithms = blocked_training_algorithms @@ -10840,8 +11427,11 @@ class FQDNEndpoint(msrest.serialization.Model): """ _attribute_map = { - 'domain_name': {'key': 'domainName', 'type': 'str'}, - 'endpoint_details': {'key': 'endpointDetails', 'type': '[FQDNEndpointDetail]'}, + "domain_name": {"key": "domainName", "type": "str"}, + "endpoint_details": { + "key": "endpointDetails", + "type": "[FQDNEndpointDetail]", + }, } def __init__( @@ -10871,15 +11461,10 @@ class FQDNEndpointDetail(msrest.serialization.Model): """ _attribute_map = { - 'port': {'key': 'port', 'type': 'int'}, + "port": {"key": "port", "type": "int"}, } - def __init__( - self, - *, - port: Optional[int] = None, - **kwargs - ): + def __init__(self, *, port: Optional[int] = None, **kwargs): """ :keyword port: :paramtype port: int @@ -10896,7 +11481,7 @@ class FQDNEndpoints(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'FQDNEndpointsProperties'}, + "properties": {"key": "properties", "type": "FQDNEndpointsProperties"}, } def __init__( @@ -10923,8 +11508,8 @@ class FQDNEndpointsProperties(msrest.serialization.Model): """ _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'endpoints': {'key': 'endpoints', 'type': '[FQDNEndpoint]'}, + "category": {"key": "category", "type": "str"}, + "endpoints": {"key": "endpoints", "type": "[FQDNEndpoint]"}, } def __init__( @@ -10966,17 +11551,21 @@ class OutboundRule(msrest.serialization.Model): """ _validation = { - 'type': {'required': True}, + "type": {"required": True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, + "type": {"key": "type", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "category": {"key": "category", "type": "str"}, } _subtype_map = { - 'type': {'FQDN': 'FqdnOutboundRule', 'PrivateEndpoint': 'PrivateEndpointOutboundRule', 'ServiceTag': 'ServiceTagOutboundRule'} + "type": { + "FQDN": "FqdnOutboundRule", + "PrivateEndpoint": "PrivateEndpointOutboundRule", + "ServiceTag": "ServiceTagOutboundRule", + } } def __init__( @@ -11020,14 +11609,14 @@ class FqdnOutboundRule(OutboundRule): """ _validation = { - 'type': {'required': True}, + "type": {"required": True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'str'}, + "type": {"key": "type", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "destination": {"key": "destination", "type": "str"}, } def __init__( @@ -11048,8 +11637,10 @@ def __init__( :keyword destination: :paramtype destination: str """ - super(FqdnOutboundRule, self).__init__(status=status, category=category, **kwargs) - self.type = 'FQDN' # type: str + super(FqdnOutboundRule, self).__init__( + status=status, category=category, **kwargs + ) + self.type = "FQDN" # type: str self.destination = destination @@ -11066,21 +11657,20 @@ class GridSamplingAlgorithm(SamplingAlgorithm): """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(GridSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Grid' # type: str + self.sampling_algorithm_type = "Grid" # type: str class HdfsDatastore(DatastoreProperties): @@ -11115,22 +11705,25 @@ class HdfsDatastore(DatastoreProperties): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'name_node_address': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "name_node_address": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'hdfs_server_certificate': {'key': 'hdfsServerCertificate', 'type': 'str'}, - 'name_node_address': {'key': 'nameNodeAddress', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "hdfs_server_certificate": { + "key": "hdfsServerCertificate", + "type": "str", + }, + "name_node_address": {"key": "nameNodeAddress", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, } def __init__( @@ -11162,8 +11755,14 @@ def __init__( :keyword protocol: Protocol used to communicate with the storage account (Https/Http). :paramtype protocol: str """ - super(HdfsDatastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, **kwargs) - self.datastore_type = 'Hdfs' # type: str + super(HdfsDatastore, self).__init__( + description=description, + properties=properties, + tags=tags, + credentials=credentials, + **kwargs + ) + self.datastore_type = "Hdfs" # type: str self.hdfs_server_certificate = hdfs_server_certificate self.name_node_address = name_node_address self.protocol = protocol @@ -11177,14 +11776,11 @@ class HDInsightSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, + "properties": {"key": "properties", "type": "HDInsightProperties"}, } def __init__( - self, - *, - properties: Optional["HDInsightProperties"] = None, - **kwargs + self, *, properties: Optional["HDInsightProperties"] = None, **kwargs ): """ :keyword properties: HDInsight compute properties. @@ -11233,26 +11829,29 @@ class HDInsight(Compute, HDInsightSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "HDInsightProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -11278,9 +11877,16 @@ def __init__( MSI and AAD exclusively for authentication. :paramtype disable_local_auth: bool """ - super(HDInsight, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) + super(HDInsight, self).__init__( + compute_location=compute_location, + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'HDInsight' # type: str + self.compute_type = "HDInsight" # type: str self.compute_location = compute_location self.provisioning_state = None self.description = description @@ -11305,9 +11911,12 @@ class HDInsightProperties(msrest.serialization.Model): """ _attribute_map = { - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, + "ssh_port": {"key": "sshPort", "type": "int"}, + "address": {"key": "address", "type": "str"}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, } def __init__( @@ -11346,27 +11955,22 @@ class IdAssetReference(AssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, - 'asset_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "reference_type": {"required": True}, + "asset_id": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'asset_id': {'key': 'assetId', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "asset_id": {"key": "assetId", "type": "str"}, } - def __init__( - self, - *, - asset_id: str, - **kwargs - ): + def __init__(self, *, asset_id: str, **kwargs): """ :keyword asset_id: Required. [Required] ARM resource ID of the asset. :paramtype asset_id: str """ super(IdAssetReference, self).__init__(**kwargs) - self.reference_type = 'Id' # type: str + self.reference_type = "Id" # type: str self.asset_id = asset_id @@ -11379,14 +11983,14 @@ class IdentityForCmk(msrest.serialization.Model): """ _attribute_map = { - 'user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, + "user_assigned_identity": { + "key": "userAssignedIdentity", + "type": "str", + }, } def __init__( - self, - *, - user_assigned_identity: Optional[str] = None, - **kwargs + self, *, user_assigned_identity: Optional[str] = None, **kwargs ): """ :keyword user_assigned_identity: The ArmId of the user assigned identity that will be used to @@ -11406,14 +12010,14 @@ class IdleShutdownSetting(msrest.serialization.Model): """ _attribute_map = { - 'idle_time_before_shutdown': {'key': 'idleTimeBeforeShutdown', 'type': 'str'}, + "idle_time_before_shutdown": { + "key": "idleTimeBeforeShutdown", + "type": "str", + }, } def __init__( - self, - *, - idle_time_before_shutdown: Optional[str] = None, - **kwargs + self, *, idle_time_before_shutdown: Optional[str] = None, **kwargs ): """ :keyword idle_time_before_shutdown: Time is defined in ISO8601 format. Minimum is 15 min, @@ -11438,9 +12042,9 @@ class Image(msrest.serialization.Model): """ _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'reference': {'key': 'reference', 'type': 'str'}, + "additional_properties": {"key": "", "type": "{object}"}, + "type": {"key": "type", "type": "str"}, + "reference": {"key": "reference", "type": "str"}, } def __init__( @@ -11469,32 +12073,41 @@ def __init__( class ImageVertical(msrest.serialization.Model): """Abstract class for AutoML tasks that train image (computer vision) models - -such as Image Classification / Image Classification Multilabel / Image Object Detection / Image Instance Segmentation. + such as Image Classification / Image Classification Multilabel / Image Object Detection / Image Instance Segmentation. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float """ _validation = { - 'limit_settings': {'required': True}, + "limit_settings": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, } def __init__( @@ -11552,16 +12165,31 @@ class ImageClassificationBase(ImageVertical): """ _validation = { - 'limit_settings': {'required': True}, + "limit_settings": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsClassification", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsClassification]", + }, } def __init__( @@ -11572,7 +12200,9 @@ def __init__( validation_data: Optional["MLTableJobInput"] = None, validation_data_size: Optional[float] = None, model_settings: Optional["ImageModelSettingsClassification"] = None, - search_space: Optional[List["ImageModelDistributionSettingsClassification"]] = None, + search_space: Optional[ + List["ImageModelDistributionSettingsClassification"] + ] = None, **kwargs ): """ @@ -11595,73 +12225,94 @@ def __init__( :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] """ - super(ImageClassificationBase, self).__init__(limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, **kwargs) + super(ImageClassificationBase, self).__init__( + limit_settings=limit_settings, + sweep_settings=sweep_settings, + validation_data=validation_data, + validation_data_size=validation_data_size, + **kwargs + ) self.model_settings = model_settings self.search_space = search_space class ImageClassification(AutoMLVertical, ImageClassificationBase): """Image Classification. Multi-class image classification is used when an image is classified with only a single label -from a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' or a 'duck'. + from a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' or a 'duck'. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, + "limit_settings": {"required": True}, + "task_type": {"required": True}, + "training_data": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsClassification", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsClassification]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( @@ -11673,10 +12324,14 @@ def __init__( validation_data: Optional["MLTableJobInput"] = None, validation_data_size: Optional[float] = None, model_settings: Optional["ImageModelSettingsClassification"] = None, - search_space: Optional[List["ImageModelDistributionSettingsClassification"]] = None, + search_space: Optional[ + List["ImageModelDistributionSettingsClassification"] + ] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "ClassificationPrimaryMetrics"] + ] = None, **kwargs ): """ @@ -11712,14 +12367,25 @@ def __init__( :paramtype primary_metric: str or ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ - super(ImageClassification, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, model_settings=model_settings, search_space=search_space, **kwargs) + super(ImageClassification, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + limit_settings=limit_settings, + sweep_settings=sweep_settings, + validation_data=validation_data, + validation_data_size=validation_data_size, + model_settings=model_settings, + search_space=search_space, + **kwargs + ) self.limit_settings = limit_settings self.sweep_settings = sweep_settings self.validation_data = validation_data self.validation_data_size = validation_data_size self.model_settings = model_settings self.search_space = search_space - self.task_type = 'ImageClassification' # type: str + self.task_type = "ImageClassification" # type: str self.primary_metric = primary_metric self.log_verbosity = log_verbosity self.target_column_name = target_column_name @@ -11728,66 +12394,81 @@ def __init__( class ImageClassificationMultilabel(AutoMLVertical, ImageClassificationBase): """Image Classification Multilabel. Multi-label image classification is used when an image could have one or more labels -from a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'. + from a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted", "IOU". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics """ _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, + "limit_settings": {"required": True}, + "task_type": {"required": True}, + "training_data": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsClassification", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsClassification]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( @@ -11799,10 +12480,14 @@ def __init__( validation_data: Optional["MLTableJobInput"] = None, validation_data_size: Optional[float] = None, model_settings: Optional["ImageModelSettingsClassification"] = None, - search_space: Optional[List["ImageModelDistributionSettingsClassification"]] = None, + search_space: Optional[ + List["ImageModelDistributionSettingsClassification"] + ] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationMultilabelPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "ClassificationMultilabelPrimaryMetrics"] + ] = None, **kwargs ): """ @@ -11838,14 +12523,25 @@ def __init__( :paramtype primary_metric: str or ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics """ - super(ImageClassificationMultilabel, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, model_settings=model_settings, search_space=search_space, **kwargs) + super(ImageClassificationMultilabel, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + limit_settings=limit_settings, + sweep_settings=sweep_settings, + validation_data=validation_data, + validation_data_size=validation_data_size, + model_settings=model_settings, + search_space=search_space, + **kwargs + ) self.limit_settings = limit_settings self.sweep_settings = sweep_settings self.validation_data = validation_data self.validation_data_size = validation_data_size self.model_settings = model_settings self.search_space = search_space - self.task_type = 'ImageClassificationMultilabel' # type: str + self.task_type = "ImageClassificationMultilabel" # type: str self.primary_metric = primary_metric self.log_verbosity = log_verbosity self.target_column_name = target_column_name @@ -11878,16 +12574,31 @@ class ImageObjectDetectionBase(ImageVertical): """ _validation = { - 'limit_settings': {'required': True}, + "limit_settings": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsObjectDetection", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsObjectDetection]", + }, } def __init__( @@ -11898,7 +12609,9 @@ def __init__( validation_data: Optional["MLTableJobInput"] = None, validation_data_size: Optional[float] = None, model_settings: Optional["ImageModelSettingsObjectDetection"] = None, - search_space: Optional[List["ImageModelDistributionSettingsObjectDetection"]] = None, + search_space: Optional[ + List["ImageModelDistributionSettingsObjectDetection"] + ] = None, **kwargs ): """ @@ -11921,72 +12634,93 @@ def __init__( :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] """ - super(ImageObjectDetectionBase, self).__init__(limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, **kwargs) + super(ImageObjectDetectionBase, self).__init__( + limit_settings=limit_settings, + sweep_settings=sweep_settings, + validation_data=validation_data, + validation_data_size=validation_data_size, + **kwargs + ) self.model_settings = model_settings self.search_space = search_space class ImageInstanceSegmentation(AutoMLVertical, ImageObjectDetectionBase): """Image Instance Segmentation. Instance segmentation is used to identify objects in an image at the pixel level, -drawing a polygon around each object in the image. + drawing a polygon around each object in the image. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "MeanAveragePrecision". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics """ _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, + "limit_settings": {"required": True}, + "task_type": {"required": True}, + "training_data": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsObjectDetection", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsObjectDetection]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( @@ -11998,10 +12732,14 @@ def __init__( validation_data: Optional["MLTableJobInput"] = None, validation_data_size: Optional[float] = None, model_settings: Optional["ImageModelSettingsObjectDetection"] = None, - search_space: Optional[List["ImageModelDistributionSettingsObjectDetection"]] = None, + search_space: Optional[ + List["ImageModelDistributionSettingsObjectDetection"] + ] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "InstanceSegmentationPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "InstanceSegmentationPrimaryMetrics"] + ] = None, **kwargs ): """ @@ -12036,14 +12774,25 @@ def __init__( :paramtype primary_metric: str or ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics """ - super(ImageInstanceSegmentation, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, model_settings=model_settings, search_space=search_space, **kwargs) + super(ImageInstanceSegmentation, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + limit_settings=limit_settings, + sweep_settings=sweep_settings, + validation_data=validation_data, + validation_data_size=validation_data_size, + model_settings=model_settings, + search_space=search_space, + **kwargs + ) self.limit_settings = limit_settings self.sweep_settings = sweep_settings self.validation_data = validation_data self.validation_data_size = validation_data_size self.model_settings = model_settings self.search_space = search_space - self.task_type = 'ImageInstanceSegmentation' # type: str + self.task_type = "ImageInstanceSegmentation" # type: str self.primary_metric = primary_metric self.log_verbosity = log_verbosity self.target_column_name = target_column_name @@ -12062,9 +12811,9 @@ class ImageLimitSettings(msrest.serialization.Model): """ _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_trials": {"key": "maxTrials", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } def __init__( @@ -12103,9 +12852,12 @@ class ImageMetadata(msrest.serialization.Model): """ _attribute_map = { - 'current_image_version': {'key': 'currentImageVersion', 'type': 'str'}, - 'latest_image_version': {'key': 'latestImageVersion', 'type': 'str'}, - 'is_latest_os_image_version': {'key': 'isLatestOsImageVersion', 'type': 'bool'}, + "current_image_version": {"key": "currentImageVersion", "type": "str"}, + "latest_image_version": {"key": "latestImageVersion", "type": "str"}, + "is_latest_os_image_version": { + "key": "isLatestOsImageVersion", + "type": "bool", + }, } def __init__( @@ -12135,129 +12887,147 @@ def __init__( class ImageModelDistributionSettings(msrest.serialization.Model): """Distribution expressions to sweep over values of model settings. -:code:` -Some examples are: - -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -` -All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) -where distribution name can be: uniform, quniform, loguniform, etc -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, + :code:` + Some examples are: + + ModelName = "choice('seresnext', 'resnest50')"; + LearningRate = "uniform(0.001, 0.01)"; + LayersToFreeze = "choice(0, 2)"; + ` + All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) + where distribution name can be: uniform, quniform, loguniform, etc + For more details on how to compose distribution expressions please check the documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: str + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: str + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: str + :ivar distributed: Whether to use distributer training. + :vartype distributed: str + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: str + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: str + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: str + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: str + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: str + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: str + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: str + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: str + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. + :vartype learning_rate_scheduler: str + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: str + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: str + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: str + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: str + :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. + :vartype optimizer: str + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: str + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: str + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: str + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: str + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: str + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: str + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: str + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: str + """ + + _attribute_map = { + "ams_gradient": {"key": "amsGradient", "type": "str"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "str"}, + "beta2": {"key": "beta2", "type": "str"}, + "distributed": {"key": "distributed", "type": "str"}, + "early_stopping": {"key": "earlyStopping", "type": "str"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "str"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "str", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "str", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "str"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "str", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "str"}, + "nesterov": {"key": "nesterov", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "str"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "str"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "str"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "str"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "str"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "str", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "str", + }, + "weight_decay": {"key": "weightDecay", "type": "str"}, } def __init__( @@ -12406,147 +13176,170 @@ def __init__( self.weight_decay = weight_decay -class ImageModelDistributionSettingsClassification(ImageModelDistributionSettings): +class ImageModelDistributionSettingsClassification( + ImageModelDistributionSettings +): """Distribution expressions to sweep over values of model settings. -:code:` -Some examples are: - -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: str - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: str - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: str - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'str'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'str'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'str'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'str'}, + :code:` + Some examples are: + + ModelName = "choice('seresnext', 'resnest50')"; + LearningRate = "uniform(0.001, 0.01)"; + LayersToFreeze = "choice(0, 2)"; + ` + For more details on how to compose distribution expressions please check the documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: str + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: str + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: str + :ivar distributed: Whether to use distributer training. + :vartype distributed: str + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: str + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: str + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: str + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: str + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: str + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: str + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: str + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: str + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. + :vartype learning_rate_scheduler: str + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: str + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: str + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: str + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: str + :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. + :vartype optimizer: str + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: str + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: str + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: str + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: str + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: str + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: str + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: str + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: str + :ivar training_crop_size: Image crop size that is input to the neural network for the training + dataset. Must be a positive integer. + :vartype training_crop_size: str + :ivar validation_crop_size: Image crop size that is input to the neural network for the + validation dataset. Must be a positive integer. + :vartype validation_crop_size: str + :ivar validation_resize_size: Image size to which to resize before cropping for validation + dataset. Must be a positive integer. + :vartype validation_resize_size: str + :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. + 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be + 0 or 1 or 2. + :vartype weighted_loss: str + """ + + _attribute_map = { + "ams_gradient": {"key": "amsGradient", "type": "str"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "str"}, + "beta2": {"key": "beta2", "type": "str"}, + "distributed": {"key": "distributed", "type": "str"}, + "early_stopping": {"key": "earlyStopping", "type": "str"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "str"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "str", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "str", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "str"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "str", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "str"}, + "nesterov": {"key": "nesterov", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "str"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "str"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "str"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "str"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "str"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "str", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "str", + }, + "weight_decay": {"key": "weightDecay", "type": "str"}, + "training_crop_size": {"key": "trainingCropSize", "type": "str"}, + "validation_crop_size": {"key": "validationCropSize", "type": "str"}, + "validation_resize_size": { + "key": "validationResizeSize", + "type": "str", + }, + "weighted_loss": {"key": "weightedLoss", "type": "str"}, } def __init__( @@ -12681,202 +13474,264 @@ def __init__( 0 or 1 or 2. :paramtype weighted_loss: str """ - super(ImageModelDistributionSettingsClassification, self).__init__(ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) + super(ImageModelDistributionSettingsClassification, self).__init__( + ams_gradient=ams_gradient, + augmentations=augmentations, + beta1=beta1, + beta2=beta2, + distributed=distributed, + early_stopping=early_stopping, + early_stopping_delay=early_stopping_delay, + early_stopping_patience=early_stopping_patience, + enable_onnx_normalization=enable_onnx_normalization, + evaluation_frequency=evaluation_frequency, + gradient_accumulation_step=gradient_accumulation_step, + layers_to_freeze=layers_to_freeze, + learning_rate=learning_rate, + learning_rate_scheduler=learning_rate_scheduler, + model_name=model_name, + momentum=momentum, + nesterov=nesterov, + number_of_epochs=number_of_epochs, + number_of_workers=number_of_workers, + optimizer=optimizer, + random_seed=random_seed, + step_lr_gamma=step_lr_gamma, + step_lr_step_size=step_lr_step_size, + training_batch_size=training_batch_size, + validation_batch_size=validation_batch_size, + warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, + warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, + weight_decay=weight_decay, + **kwargs + ) self.training_crop_size = training_crop_size self.validation_crop_size = validation_crop_size self.validation_resize_size = validation_resize_size self.weighted_loss = weighted_loss -class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettings): +class ImageModelDistributionSettingsObjectDetection( + ImageModelDistributionSettings +): """Distribution expressions to sweep over values of model settings. -:code:` -Some examples are: - -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: str - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: str - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: str - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: str - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: str - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype model_size: str - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: str - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - float in the range [0, 1]. - :vartype nms_iou_threshold: str - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: str - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - NMS: Non-maximum suppression. - :vartype tile_predictions_nms_threshold: str - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: str - :ivar validation_metric_type: Metric computation method to use for validation metrics. Must be - 'none', 'coco', 'voc', or 'coco_voc'. - :vartype validation_metric_type: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'str'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'str'}, - 'image_size': {'key': 'imageSize', 'type': 'str'}, - 'max_size': {'key': 'maxSize', 'type': 'str'}, - 'min_size': {'key': 'minSize', 'type': 'str'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'str'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'str'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'str'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'str'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'str'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, + :code:` + Some examples are: + + ModelName = "choice('seresnext', 'resnest50')"; + LearningRate = "uniform(0.001, 0.01)"; + LayersToFreeze = "choice(0, 2)"; + ` + For more details on how to compose distribution expressions please check the documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: str + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: str + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: str + :ivar distributed: Whether to use distributer training. + :vartype distributed: str + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: str + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: str + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: str + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: str + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: str + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: str + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: str + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: str + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. + :vartype learning_rate_scheduler: str + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: str + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: str + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: str + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: str + :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. + :vartype optimizer: str + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: str + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: str + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: str + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: str + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: str + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: str + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: str + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: str + :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must + be a positive integer. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype box_detections_per_image: str + :ivar box_score_threshold: During inference, only return proposals with a classification score + greater than + BoxScoreThreshold. Must be a float in the range[0, 1]. + :vartype box_score_threshold: str + :ivar image_size: Image size for train and validation. Must be a positive integer. + Note: The training run may get into CUDA OOM if the size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype image_size: str + :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype max_size: str + :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype min_size: str + :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. + Note: training run may get into CUDA OOM if the model size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype model_size: str + :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. + Note: training run may get into CUDA OOM if no sufficient GPU memory. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype multi_scale: str + :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be + float in the range [0, 1]. + :vartype nms_iou_threshold: str + :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not + be + None to enable small object detection logic. A string containing two integers in mxn format. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_grid_size: str + :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float + in the range [0, 1). + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_overlap_ratio: str + :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging + predictions from tiles and image. + Used in validation/ inference. Must be float in the range [0, 1]. + Note: This settings is not supported for the 'yolov5' algorithm. + NMS: Non-maximum suppression. + :vartype tile_predictions_nms_threshold: str + :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be + float in the range [0, 1]. + :vartype validation_iou_threshold: str + :ivar validation_metric_type: Metric computation method to use for validation metrics. Must be + 'none', 'coco', 'voc', or 'coco_voc'. + :vartype validation_metric_type: str + """ + + _attribute_map = { + "ams_gradient": {"key": "amsGradient", "type": "str"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "str"}, + "beta2": {"key": "beta2", "type": "str"}, + "distributed": {"key": "distributed", "type": "str"}, + "early_stopping": {"key": "earlyStopping", "type": "str"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "str"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "str", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "str", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "str"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "str", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "str"}, + "nesterov": {"key": "nesterov", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "str"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "str"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "str"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "str"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "str"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "str", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "str", + }, + "weight_decay": {"key": "weightDecay", "type": "str"}, + "box_detections_per_image": { + "key": "boxDetectionsPerImage", + "type": "str", + }, + "box_score_threshold": {"key": "boxScoreThreshold", "type": "str"}, + "image_size": {"key": "imageSize", "type": "str"}, + "max_size": {"key": "maxSize", "type": "str"}, + "min_size": {"key": "minSize", "type": "str"}, + "model_size": {"key": "modelSize", "type": "str"}, + "multi_scale": {"key": "multiScale", "type": "str"}, + "nms_iou_threshold": {"key": "nmsIouThreshold", "type": "str"}, + "tile_grid_size": {"key": "tileGridSize", "type": "str"}, + "tile_overlap_ratio": {"key": "tileOverlapRatio", "type": "str"}, + "tile_predictions_nms_threshold": { + "key": "tilePredictionsNmsThreshold", + "type": "str", + }, + "validation_iou_threshold": { + "key": "validationIouThreshold", + "type": "str", + }, + "validation_metric_type": { + "key": "validationMetricType", + "type": "str", + }, } def __init__( @@ -13059,7 +13914,37 @@ def __init__( be 'none', 'coco', 'voc', or 'coco_voc'. :paramtype validation_metric_type: str """ - super(ImageModelDistributionSettingsObjectDetection, self).__init__(ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) + super(ImageModelDistributionSettingsObjectDetection, self).__init__( + ams_gradient=ams_gradient, + augmentations=augmentations, + beta1=beta1, + beta2=beta2, + distributed=distributed, + early_stopping=early_stopping, + early_stopping_delay=early_stopping_delay, + early_stopping_patience=early_stopping_patience, + enable_onnx_normalization=enable_onnx_normalization, + evaluation_frequency=evaluation_frequency, + gradient_accumulation_step=gradient_accumulation_step, + layers_to_freeze=layers_to_freeze, + learning_rate=learning_rate, + learning_rate_scheduler=learning_rate_scheduler, + model_name=model_name, + momentum=momentum, + nesterov=nesterov, + number_of_epochs=number_of_epochs, + number_of_workers=number_of_workers, + optimizer=optimizer, + random_seed=random_seed, + step_lr_gamma=step_lr_gamma, + step_lr_step_size=step_lr_step_size, + training_batch_size=training_batch_size, + validation_batch_size=validation_batch_size, + warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, + warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, + weight_decay=weight_decay, + **kwargs + ) self.box_detections_per_image = box_detections_per_image self.box_score_threshold = box_score_threshold self.image_size = image_size @@ -13077,132 +13962,153 @@ def __init__( class ImageModelSettings(msrest.serialization.Model): """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar advanced_settings: Settings for advanced scenarios. + :vartype advanced_settings: str + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: bool + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: float + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: float + :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. + :vartype checkpoint_frequency: int + :ivar checkpoint_model: The pretrained checkpoint model for incremental training. + :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput + :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for + incremental training. + :vartype checkpoint_run_id: str + :ivar distributed: Whether to use distributed training. + :vartype distributed: bool + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: bool + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: int + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: int + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: bool + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: int + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: int + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: int + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: float + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. Possible values include: "None", "WarmupCosine", "Step". + :vartype learning_rate_scheduler: str or + ~azure.mgmt.machinelearningservices.models.LearningRateScheduler + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: float + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: bool + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: int + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: int + :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". + :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: int + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: float + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: int + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: int + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: int + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: float + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: int + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: float + """ + + _attribute_map = { + "advanced_settings": {"key": "advancedSettings", "type": "str"}, + "ams_gradient": {"key": "amsGradient", "type": "bool"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "float"}, + "beta2": {"key": "beta2", "type": "float"}, + "checkpoint_frequency": {"key": "checkpointFrequency", "type": "int"}, + "checkpoint_model": { + "key": "checkpointModel", + "type": "MLFlowModelJobInput", + }, + "checkpoint_run_id": {"key": "checkpointRunId", "type": "str"}, + "distributed": {"key": "distributed", "type": "bool"}, + "early_stopping": {"key": "earlyStopping", "type": "bool"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "int"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "int", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "bool", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "int"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "int", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "int"}, + "learning_rate": {"key": "learningRate", "type": "float"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "float"}, + "nesterov": {"key": "nesterov", "type": "bool"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "int"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "int"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "int"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "float"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "int"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "float", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "int", + }, + "weight_decay": {"key": "weightDecay", "type": "float"}, } def __init__( @@ -13225,7 +14131,9 @@ def __init__( gradient_accumulation_step: Optional[int] = None, layers_to_freeze: Optional[int] = None, learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "LearningRateScheduler"]] = None, + learning_rate_scheduler: Optional[ + Union[str, "LearningRateScheduler"] + ] = None, model_name: Optional[str] = None, momentum: Optional[float] = None, nesterov: Optional[bool] = None, @@ -13372,149 +14280,173 @@ def __init__( class ImageModelSettingsClassification(ImageModelSettings): """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: int - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: int - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: int - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: int - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'int'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'int'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'int'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'int'}, + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar advanced_settings: Settings for advanced scenarios. + :vartype advanced_settings: str + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: bool + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: float + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: float + :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. + :vartype checkpoint_frequency: int + :ivar checkpoint_model: The pretrained checkpoint model for incremental training. + :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput + :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for + incremental training. + :vartype checkpoint_run_id: str + :ivar distributed: Whether to use distributed training. + :vartype distributed: bool + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: bool + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: int + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: int + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: bool + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: int + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: int + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: int + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: float + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. Possible values include: "None", "WarmupCosine", "Step". + :vartype learning_rate_scheduler: str or + ~azure.mgmt.machinelearningservices.models.LearningRateScheduler + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: float + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: bool + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: int + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: int + :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". + :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: int + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: float + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: int + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: int + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: int + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: float + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: int + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: float + :ivar training_crop_size: Image crop size that is input to the neural network for the training + dataset. Must be a positive integer. + :vartype training_crop_size: int + :ivar validation_crop_size: Image crop size that is input to the neural network for the + validation dataset. Must be a positive integer. + :vartype validation_crop_size: int + :ivar validation_resize_size: Image size to which to resize before cropping for validation + dataset. Must be a positive integer. + :vartype validation_resize_size: int + :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. + 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be + 0 or 1 or 2. + :vartype weighted_loss: int + """ + + _attribute_map = { + "advanced_settings": {"key": "advancedSettings", "type": "str"}, + "ams_gradient": {"key": "amsGradient", "type": "bool"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "float"}, + "beta2": {"key": "beta2", "type": "float"}, + "checkpoint_frequency": {"key": "checkpointFrequency", "type": "int"}, + "checkpoint_model": { + "key": "checkpointModel", + "type": "MLFlowModelJobInput", + }, + "checkpoint_run_id": {"key": "checkpointRunId", "type": "str"}, + "distributed": {"key": "distributed", "type": "bool"}, + "early_stopping": {"key": "earlyStopping", "type": "bool"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "int"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "int", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "bool", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "int"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "int", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "int"}, + "learning_rate": {"key": "learningRate", "type": "float"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "float"}, + "nesterov": {"key": "nesterov", "type": "bool"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "int"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "int"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "int"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "float"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "int"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "float", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "int", + }, + "weight_decay": {"key": "weightDecay", "type": "float"}, + "training_crop_size": {"key": "trainingCropSize", "type": "int"}, + "validation_crop_size": {"key": "validationCropSize", "type": "int"}, + "validation_resize_size": { + "key": "validationResizeSize", + "type": "int", + }, + "weighted_loss": {"key": "weightedLoss", "type": "int"}, } def __init__( @@ -13537,7 +14469,9 @@ def __init__( gradient_accumulation_step: Optional[int] = None, layers_to_freeze: Optional[int] = None, learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "LearningRateScheduler"]] = None, + learning_rate_scheduler: Optional[ + Union[str, "LearningRateScheduler"] + ] = None, model_name: Optional[str] = None, momentum: Optional[float] = None, nesterov: Optional[bool] = None, @@ -13664,7 +14598,41 @@ def __init__( 0 or 1 or 2. :paramtype weighted_loss: int """ - super(ImageModelSettingsClassification, self).__init__(advanced_settings=advanced_settings, ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, checkpoint_frequency=checkpoint_frequency, checkpoint_model=checkpoint_model, checkpoint_run_id=checkpoint_run_id, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) + super(ImageModelSettingsClassification, self).__init__( + advanced_settings=advanced_settings, + ams_gradient=ams_gradient, + augmentations=augmentations, + beta1=beta1, + beta2=beta2, + checkpoint_frequency=checkpoint_frequency, + checkpoint_model=checkpoint_model, + checkpoint_run_id=checkpoint_run_id, + distributed=distributed, + early_stopping=early_stopping, + early_stopping_delay=early_stopping_delay, + early_stopping_patience=early_stopping_patience, + enable_onnx_normalization=enable_onnx_normalization, + evaluation_frequency=evaluation_frequency, + gradient_accumulation_step=gradient_accumulation_step, + layers_to_freeze=layers_to_freeze, + learning_rate=learning_rate, + learning_rate_scheduler=learning_rate_scheduler, + model_name=model_name, + momentum=momentum, + nesterov=nesterov, + number_of_epochs=number_of_epochs, + number_of_workers=number_of_workers, + optimizer=optimizer, + random_seed=random_seed, + step_lr_gamma=step_lr_gamma, + step_lr_step_size=step_lr_step_size, + training_batch_size=training_batch_size, + validation_batch_size=validation_batch_size, + warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, + warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, + weight_decay=weight_decay, + **kwargs + ) self.training_crop_size = training_crop_size self.validation_crop_size = validation_crop_size self.validation_resize_size = validation_resize_size @@ -13673,198 +14641,231 @@ def __init__( class ImageModelSettingsObjectDetection(ImageModelSettings): """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: int - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: float - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: int - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: int - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: int - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: - "None", "Small", "Medium", "Large", "ExtraLarge". - :vartype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: bool - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be a - float in the range [0, 1]. - :vartype nms_iou_threshold: float - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: float - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_predictions_nms_threshold: float - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: float - :ivar validation_metric_type: Metric computation method to use for validation metrics. Possible - values include: "None", "Coco", "Voc", "CocoVoc". - :vartype validation_metric_type: str or - ~azure.mgmt.machinelearningservices.models.ValidationMetricType - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'int'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'float'}, - 'image_size': {'key': 'imageSize', 'type': 'int'}, - 'max_size': {'key': 'maxSize', 'type': 'int'}, - 'min_size': {'key': 'minSize', 'type': 'int'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'bool'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'float'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'float'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'float'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'float'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar advanced_settings: Settings for advanced scenarios. + :vartype advanced_settings: str + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: bool + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: float + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: float + :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. + :vartype checkpoint_frequency: int + :ivar checkpoint_model: The pretrained checkpoint model for incremental training. + :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput + :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for + incremental training. + :vartype checkpoint_run_id: str + :ivar distributed: Whether to use distributed training. + :vartype distributed: bool + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: bool + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: int + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: int + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: bool + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: int + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: int + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: int + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: float + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. Possible values include: "None", "WarmupCosine", "Step". + :vartype learning_rate_scheduler: str or + ~azure.mgmt.machinelearningservices.models.LearningRateScheduler + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: float + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: bool + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: int + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: int + :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". + :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: int + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: float + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: int + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: int + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: int + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: float + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: int + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: float + :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must + be a positive integer. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype box_detections_per_image: int + :ivar box_score_threshold: During inference, only return proposals with a classification score + greater than + BoxScoreThreshold. Must be a float in the range[0, 1]. + :vartype box_score_threshold: float + :ivar image_size: Image size for train and validation. Must be a positive integer. + Note: The training run may get into CUDA OOM if the size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype image_size: int + :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype max_size: int + :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype min_size: int + :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. + Note: training run may get into CUDA OOM if the model size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: + "None", "Small", "Medium", "Large", "ExtraLarge". + :vartype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize + :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. + Note: training run may get into CUDA OOM if no sufficient GPU memory. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype multi_scale: bool + :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be a + float in the range [0, 1]. + :vartype nms_iou_threshold: float + :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not + be + None to enable small object detection logic. A string containing two integers in mxn format. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_grid_size: str + :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float + in the range [0, 1). + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_overlap_ratio: float + :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging + predictions from tiles and image. + Used in validation/ inference. Must be float in the range [0, 1]. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_predictions_nms_threshold: float + :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be + float in the range [0, 1]. + :vartype validation_iou_threshold: float + :ivar validation_metric_type: Metric computation method to use for validation metrics. Possible + values include: "None", "Coco", "Voc", "CocoVoc". + :vartype validation_metric_type: str or + ~azure.mgmt.machinelearningservices.models.ValidationMetricType + """ + + _attribute_map = { + "advanced_settings": {"key": "advancedSettings", "type": "str"}, + "ams_gradient": {"key": "amsGradient", "type": "bool"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "float"}, + "beta2": {"key": "beta2", "type": "float"}, + "checkpoint_frequency": {"key": "checkpointFrequency", "type": "int"}, + "checkpoint_model": { + "key": "checkpointModel", + "type": "MLFlowModelJobInput", + }, + "checkpoint_run_id": {"key": "checkpointRunId", "type": "str"}, + "distributed": {"key": "distributed", "type": "bool"}, + "early_stopping": {"key": "earlyStopping", "type": "bool"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "int"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "int", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "bool", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "int"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "int", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "int"}, + "learning_rate": {"key": "learningRate", "type": "float"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "float"}, + "nesterov": {"key": "nesterov", "type": "bool"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "int"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "int"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "int"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "float"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "int"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "float", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "int", + }, + "weight_decay": {"key": "weightDecay", "type": "float"}, + "box_detections_per_image": { + "key": "boxDetectionsPerImage", + "type": "int", + }, + "box_score_threshold": {"key": "boxScoreThreshold", "type": "float"}, + "image_size": {"key": "imageSize", "type": "int"}, + "max_size": {"key": "maxSize", "type": "int"}, + "min_size": {"key": "minSize", "type": "int"}, + "model_size": {"key": "modelSize", "type": "str"}, + "multi_scale": {"key": "multiScale", "type": "bool"}, + "nms_iou_threshold": {"key": "nmsIouThreshold", "type": "float"}, + "tile_grid_size": {"key": "tileGridSize", "type": "str"}, + "tile_overlap_ratio": {"key": "tileOverlapRatio", "type": "float"}, + "tile_predictions_nms_threshold": { + "key": "tilePredictionsNmsThreshold", + "type": "float", + }, + "validation_iou_threshold": { + "key": "validationIouThreshold", + "type": "float", + }, + "validation_metric_type": { + "key": "validationMetricType", + "type": "str", + }, } def __init__( @@ -13887,7 +14888,9 @@ def __init__( gradient_accumulation_step: Optional[int] = None, layers_to_freeze: Optional[int] = None, learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "LearningRateScheduler"]] = None, + learning_rate_scheduler: Optional[ + Union[str, "LearningRateScheduler"] + ] = None, model_name: Optional[str] = None, momentum: Optional[float] = None, nesterov: Optional[bool] = None, @@ -13914,7 +14917,9 @@ def __init__( tile_overlap_ratio: Optional[float] = None, tile_predictions_nms_threshold: Optional[float] = None, validation_iou_threshold: Optional[float] = None, - validation_metric_type: Optional[Union[str, "ValidationMetricType"]] = None, + validation_metric_type: Optional[ + Union[str, "ValidationMetricType"] + ] = None, **kwargs ): """ @@ -14063,7 +15068,41 @@ def __init__( :paramtype validation_metric_type: str or ~azure.mgmt.machinelearningservices.models.ValidationMetricType """ - super(ImageModelSettingsObjectDetection, self).__init__(advanced_settings=advanced_settings, ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, checkpoint_frequency=checkpoint_frequency, checkpoint_model=checkpoint_model, checkpoint_run_id=checkpoint_run_id, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) + super(ImageModelSettingsObjectDetection, self).__init__( + advanced_settings=advanced_settings, + ams_gradient=ams_gradient, + augmentations=augmentations, + beta1=beta1, + beta2=beta2, + checkpoint_frequency=checkpoint_frequency, + checkpoint_model=checkpoint_model, + checkpoint_run_id=checkpoint_run_id, + distributed=distributed, + early_stopping=early_stopping, + early_stopping_delay=early_stopping_delay, + early_stopping_patience=early_stopping_patience, + enable_onnx_normalization=enable_onnx_normalization, + evaluation_frequency=evaluation_frequency, + gradient_accumulation_step=gradient_accumulation_step, + layers_to_freeze=layers_to_freeze, + learning_rate=learning_rate, + learning_rate_scheduler=learning_rate_scheduler, + model_name=model_name, + momentum=momentum, + nesterov=nesterov, + number_of_epochs=number_of_epochs, + number_of_workers=number_of_workers, + optimizer=optimizer, + random_seed=random_seed, + step_lr_gamma=step_lr_gamma, + step_lr_step_size=step_lr_step_size, + training_batch_size=training_batch_size, + validation_batch_size=validation_batch_size, + warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, + warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, + weight_decay=weight_decay, + **kwargs + ) self.box_detections_per_image = box_detections_per_image self.box_score_threshold = box_score_threshold self.image_size = image_size @@ -14081,65 +15120,80 @@ def __init__( class ImageObjectDetection(AutoMLVertical, ImageObjectDetectionBase): """Image Object Detection. Object detection is used to identify objects in an image and locate each object with a -bounding box e.g. locate all dogs and cats in an image and draw a bounding box around each. + bounding box e.g. locate all dogs and cats in an image and draw a bounding box around each. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "MeanAveragePrecision". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics """ _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, + "limit_settings": {"required": True}, + "task_type": {"required": True}, + "training_data": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsObjectDetection", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsObjectDetection]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( @@ -14151,10 +15205,14 @@ def __init__( validation_data: Optional["MLTableJobInput"] = None, validation_data_size: Optional[float] = None, model_settings: Optional["ImageModelSettingsObjectDetection"] = None, - search_space: Optional[List["ImageModelDistributionSettingsObjectDetection"]] = None, + search_space: Optional[ + List["ImageModelDistributionSettingsObjectDetection"] + ] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ObjectDetectionPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "ObjectDetectionPrimaryMetrics"] + ] = None, **kwargs ): """ @@ -14189,14 +15247,25 @@ def __init__( :paramtype primary_metric: str or ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics """ - super(ImageObjectDetection, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, model_settings=model_settings, search_space=search_space, **kwargs) + super(ImageObjectDetection, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + limit_settings=limit_settings, + sweep_settings=sweep_settings, + validation_data=validation_data, + validation_data_size=validation_data_size, + model_settings=model_settings, + search_space=search_space, + **kwargs + ) self.limit_settings = limit_settings self.sweep_settings = sweep_settings self.validation_data = validation_data self.validation_data_size = validation_data_size self.model_settings = model_settings self.search_space = search_space - self.task_type = 'ImageObjectDetection' # type: str + self.task_type = "ImageObjectDetection" # type: str self.primary_metric = primary_metric self.log_verbosity = log_verbosity self.target_column_name = target_column_name @@ -14217,12 +15286,15 @@ class ImageSweepSettings(msrest.serialization.Model): """ _validation = { - 'sampling_algorithm': {'required': True}, + "sampling_algorithm": {"required": True}, } _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, + "sampling_algorithm": {"key": "samplingAlgorithm", "type": "str"}, } def __init__( @@ -14258,9 +15330,9 @@ class InferenceContainerProperties(msrest.serialization.Model): """ _attribute_map = { - 'liveness_route': {'key': 'livenessRoute', 'type': 'Route'}, - 'readiness_route': {'key': 'readinessRoute', 'type': 'Route'}, - 'scoring_route': {'key': 'scoringRoute', 'type': 'Route'}, + "liveness_route": {"key": "livenessRoute", "type": "Route"}, + "readiness_route": {"key": "readinessRoute", "type": "Route"}, + "scoring_route": {"key": "scoringRoute", "type": "Route"}, } def __init__( @@ -14296,8 +15368,11 @@ class InstanceTypeSchema(msrest.serialization.Model): """ _attribute_map = { - 'node_selector': {'key': 'nodeSelector', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'InstanceTypeSchemaResources'}, + "node_selector": {"key": "nodeSelector", "type": "{str}"}, + "resources": { + "key": "resources", + "type": "InstanceTypeSchemaResources", + }, } def __init__( @@ -14328,8 +15403,8 @@ class InstanceTypeSchemaResources(msrest.serialization.Model): """ _attribute_map = { - 'requests': {'key': 'requests', 'type': '{str}'}, - 'limits': {'key': 'limits', 'type': '{str}'}, + "requests": {"key": "requests", "type": "{str}"}, + "limits": {"key": "limits", "type": "{str}"}, } def __init__( @@ -14373,27 +15448,22 @@ class JobBase(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'JobBaseProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "JobBaseProperties"}, } - def __init__( - self, - *, - properties: "JobBaseProperties", - **kwargs - ): + def __init__(self, *, properties: "JobBaseProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.JobBaseProperties @@ -14413,8 +15483,8 @@ class JobBaseResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[JobBase]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[JobBase]"}, } def __init__( @@ -14456,15 +15526,15 @@ class JobResourceConfiguration(ResourceConfiguration): """ _validation = { - 'shm_size': {'pattern': r'\d+[bBkKmMgG]'}, + "shm_size": {"pattern": r"\d+[bBkKmMgG]"}, } _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - 'docker_args': {'key': 'dockerArgs', 'type': 'str'}, - 'shm_size': {'key': 'shmSize', 'type': 'str'}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "properties": {"key": "properties", "type": "{object}"}, + "docker_args": {"key": "dockerArgs", "type": "str"}, + "shm_size": {"key": "shmSize", "type": "str"}, } def __init__( @@ -14493,7 +15563,12 @@ def __init__( b(bytes), k(kilobytes), m(megabytes), or g(gigabytes). :paramtype shm_size: str """ - super(JobResourceConfiguration, self).__init__(instance_count=instance_count, instance_type=instance_type, properties=properties, **kwargs) + super(JobResourceConfiguration, self).__init__( + instance_count=instance_count, + instance_type=instance_type, + properties=properties, + **kwargs + ) self.docker_args = docker_args self.shm_size = shm_size @@ -14511,27 +15586,25 @@ class JobScheduleAction(ScheduleActionBase): """ _validation = { - 'action_type': {'required': True}, - 'job_definition': {'required': True}, + "action_type": {"required": True}, + "job_definition": {"required": True}, } _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'job_definition': {'key': 'jobDefinition', 'type': 'JobBaseProperties'}, + "action_type": {"key": "actionType", "type": "str"}, + "job_definition": { + "key": "jobDefinition", + "type": "JobBaseProperties", + }, } - def __init__( - self, - *, - job_definition: "JobBaseProperties", - **kwargs - ): + def __init__(self, *, job_definition: "JobBaseProperties", **kwargs): """ :keyword job_definition: Required. [Required] Defines Schedule action definition details. :paramtype job_definition: ~azure.mgmt.machinelearningservices.models.JobBaseProperties """ super(JobScheduleAction, self).__init__(**kwargs) - self.action_type = 'CreateJob' # type: str + self.action_type = "CreateJob" # type: str self.job_definition = job_definition @@ -14558,18 +15631,18 @@ class JobService(msrest.serialization.Model): """ _validation = { - 'error_message': {'readonly': True}, - 'status': {'readonly': True}, + "error_message": {"readonly": True}, + "status": {"readonly": True}, } _attribute_map = { - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'job_service_type': {'key': 'jobServiceType', 'type': 'str'}, - 'nodes': {'key': 'nodes', 'type': 'Nodes'}, - 'port': {'key': 'port', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'status': {'key': 'status', 'type': 'str'}, + "endpoint": {"key": "endpoint", "type": "str"}, + "error_message": {"key": "errorMessage", "type": "str"}, + "job_service_type": {"key": "jobServiceType", "type": "str"}, + "nodes": {"key": "nodes", "type": "Nodes"}, + "port": {"key": "port", "type": "int"}, + "properties": {"key": "properties", "type": "{str}"}, + "status": {"key": "status", "type": "str"}, } def __init__( @@ -14620,15 +15693,15 @@ class KerberosCredentials(msrest.serialization.Model): """ _validation = { - 'kerberos_kdc_address': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "kerberos_kdc_address": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "kerberos_principal": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "kerberos_realm": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, + "kerberos_kdc_address": {"key": "kerberosKdcAddress", "type": "str"}, + "kerberos_principal": {"key": "kerberosPrincipal", "type": "str"}, + "kerberos_realm": {"key": "kerberosRealm", "type": "str"}, } def __init__( @@ -14675,19 +15748,19 @@ class KerberosKeytabCredentials(DatastoreCredentials, KerberosCredentials): """ _validation = { - 'kerberos_kdc_address': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, + "kerberos_kdc_address": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "kerberos_principal": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "kerberos_realm": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "credentials_type": {"required": True}, + "secrets": {"required": True}, } _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'KerberosKeytabSecrets'}, + "kerberos_kdc_address": {"key": "kerberosKdcAddress", "type": "str"}, + "kerberos_principal": {"key": "kerberosPrincipal", "type": "str"}, + "kerberos_realm": {"key": "kerberosRealm", "type": "str"}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "secrets": {"key": "secrets", "type": "KerberosKeytabSecrets"}, } def __init__( @@ -14710,11 +15783,16 @@ def __init__( :keyword secrets: Required. [Required] Keytab secrets. :paramtype secrets: ~azure.mgmt.machinelearningservices.models.KerberosKeytabSecrets """ - super(KerberosKeytabCredentials, self).__init__(kerberos_kdc_address=kerberos_kdc_address, kerberos_principal=kerberos_principal, kerberos_realm=kerberos_realm, **kwargs) + super(KerberosKeytabCredentials, self).__init__( + kerberos_kdc_address=kerberos_kdc_address, + kerberos_principal=kerberos_principal, + kerberos_realm=kerberos_realm, + **kwargs + ) self.kerberos_kdc_address = kerberos_kdc_address self.kerberos_principal = kerberos_principal self.kerberos_realm = kerberos_realm - self.credentials_type = 'KerberosKeytab' # type: str + self.credentials_type = "KerberosKeytab" # type: str self.secrets = secrets @@ -14732,26 +15810,21 @@ class KerberosKeytabSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'kerberos_keytab': {'key': 'kerberosKeytab', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "kerberos_keytab": {"key": "kerberosKeytab", "type": "str"}, } - def __init__( - self, - *, - kerberos_keytab: Optional[str] = None, - **kwargs - ): + def __init__(self, *, kerberos_keytab: Optional[str] = None, **kwargs): """ :keyword kerberos_keytab: Kerberos keytab secret. :paramtype kerberos_keytab: str """ super(KerberosKeytabSecrets, self).__init__(**kwargs) - self.secrets_type = 'KerberosKeytab' # type: str + self.secrets_type = "KerberosKeytab" # type: str self.kerberos_keytab = kerberos_keytab @@ -14776,19 +15849,19 @@ class KerberosPasswordCredentials(DatastoreCredentials, KerberosCredentials): """ _validation = { - 'kerberos_kdc_address': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, + "kerberos_kdc_address": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "kerberos_principal": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "kerberos_realm": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "credentials_type": {"required": True}, + "secrets": {"required": True}, } _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'KerberosPasswordSecrets'}, + "kerberos_kdc_address": {"key": "kerberosKdcAddress", "type": "str"}, + "kerberos_principal": {"key": "kerberosPrincipal", "type": "str"}, + "kerberos_realm": {"key": "kerberosRealm", "type": "str"}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "secrets": {"key": "secrets", "type": "KerberosPasswordSecrets"}, } def __init__( @@ -14811,11 +15884,16 @@ def __init__( :keyword secrets: Required. [Required] Kerberos password secrets. :paramtype secrets: ~azure.mgmt.machinelearningservices.models.KerberosPasswordSecrets """ - super(KerberosPasswordCredentials, self).__init__(kerberos_kdc_address=kerberos_kdc_address, kerberos_principal=kerberos_principal, kerberos_realm=kerberos_realm, **kwargs) + super(KerberosPasswordCredentials, self).__init__( + kerberos_kdc_address=kerberos_kdc_address, + kerberos_principal=kerberos_principal, + kerberos_realm=kerberos_realm, + **kwargs + ) self.kerberos_kdc_address = kerberos_kdc_address self.kerberos_principal = kerberos_principal self.kerberos_realm = kerberos_realm - self.credentials_type = 'KerberosPassword' # type: str + self.credentials_type = "KerberosPassword" # type: str self.secrets = secrets @@ -14833,26 +15911,21 @@ class KerberosPasswordSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'kerberos_password': {'key': 'kerberosPassword', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "kerberos_password": {"key": "kerberosPassword", "type": "str"}, } - def __init__( - self, - *, - kerberos_password: Optional[str] = None, - **kwargs - ): + def __init__(self, *, kerberos_password: Optional[str] = None, **kwargs): """ :keyword kerberos_password: Kerberos password secret. :paramtype kerberos_password: str """ super(KerberosPasswordSecrets, self).__init__(**kwargs) - self.secrets_type = 'KerberosPassword' # type: str + self.secrets_type = "KerberosPassword" # type: str self.kerberos_password = kerberos_password @@ -14864,14 +15937,11 @@ class KubernetesSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, + "properties": {"key": "properties", "type": "KubernetesProperties"}, } def __init__( - self, - *, - properties: Optional["KubernetesProperties"] = None, - **kwargs + self, *, properties: Optional["KubernetesProperties"] = None, **kwargs ): """ :keyword properties: Properties of Kubernetes. @@ -14920,26 +15990,29 @@ class Kubernetes(Compute, KubernetesSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "KubernetesProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -14965,9 +16038,16 @@ def __init__( MSI and AAD exclusively for authentication. :paramtype disable_local_auth: bool """ - super(Kubernetes, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) + super(Kubernetes, self).__init__( + compute_location=compute_location, + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'Kubernetes' # type: str + self.compute_type = "Kubernetes" # type: str self.compute_location = compute_location self.provisioning_state = None self.description = description @@ -15036,31 +16116,49 @@ class OnlineDeploymentProperties(EndpointDeploymentPropertiesBase): """ _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, + "endpoint_compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, + "egress_public_network_access": { + "key": "egressPublicNetworkAccess", + "type": "str", + }, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, + "model": {"key": "model", "type": "str"}, + "model_mount_path": {"key": "modelMountPath", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, } _subtype_map = { - 'endpoint_compute_type': {'Kubernetes': 'KubernetesOnlineDeployment', 'Managed': 'ManagedOnlineDeployment'} + "endpoint_compute_type": { + "Kubernetes": "KubernetesOnlineDeployment", + "Managed": "ManagedOnlineDeployment", + } } def __init__( @@ -15072,7 +16170,9 @@ def __init__( environment_variables: Optional[Dict[str, str]] = None, properties: Optional[Dict[str, str]] = None, app_insights_enabled: Optional[bool] = False, - egress_public_network_access: Optional[Union[str, "EgressPublicNetworkAccessType"]] = None, + egress_public_network_access: Optional[ + Union[str, "EgressPublicNetworkAccessType"] + ] = None, instance_type: Optional[str] = None, liveness_probe: Optional["ProbeSettings"] = None, model: Optional[str] = None, @@ -15120,10 +16220,17 @@ def __init__( and to DefaultScaleSettings for ManagedOnlineDeployment. :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings """ - super(OnlineDeploymentProperties, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, **kwargs) + super(OnlineDeploymentProperties, self).__init__( + code_configuration=code_configuration, + description=description, + environment_id=environment_id, + environment_variables=environment_variables, + properties=properties, + **kwargs + ) self.app_insights_enabled = app_insights_enabled self.egress_public_network_access = egress_public_network_access - self.endpoint_compute_type = 'OnlineDeploymentProperties' # type: str + self.endpoint_compute_type = "OnlineDeploymentProperties" # type: str self.instance_type = instance_type self.liveness_probe = liveness_probe self.model = model @@ -15192,28 +16299,46 @@ class KubernetesOnlineDeployment(OnlineDeploymentProperties): """ _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - 'container_resource_requirements': {'key': 'containerResourceRequirements', 'type': 'ContainerResourceRequirements'}, + "endpoint_compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, + "egress_public_network_access": { + "key": "egressPublicNetworkAccess", + "type": "str", + }, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, + "model": {"key": "model", "type": "str"}, + "model_mount_path": {"key": "modelMountPath", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, + "container_resource_requirements": { + "key": "containerResourceRequirements", + "type": "ContainerResourceRequirements", + }, } def __init__( @@ -15225,7 +16350,9 @@ def __init__( environment_variables: Optional[Dict[str, str]] = None, properties: Optional[Dict[str, str]] = None, app_insights_enabled: Optional[bool] = False, - egress_public_network_access: Optional[Union[str, "EgressPublicNetworkAccessType"]] = None, + egress_public_network_access: Optional[ + Union[str, "EgressPublicNetworkAccessType"] + ] = None, instance_type: Optional[str] = None, liveness_probe: Optional["ProbeSettings"] = None, model: Optional[str] = None, @@ -15233,7 +16360,9 @@ def __init__( readiness_probe: Optional["ProbeSettings"] = None, request_settings: Optional["OnlineRequestSettings"] = None, scale_settings: Optional["OnlineScaleSettings"] = None, - container_resource_requirements: Optional["ContainerResourceRequirements"] = None, + container_resource_requirements: Optional[ + "ContainerResourceRequirements" + ] = None, **kwargs ): """ @@ -15278,8 +16407,24 @@ def __init__( :paramtype container_resource_requirements: ~azure.mgmt.machinelearningservices.models.ContainerResourceRequirements """ - super(KubernetesOnlineDeployment, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, app_insights_enabled=app_insights_enabled, egress_public_network_access=egress_public_network_access, instance_type=instance_type, liveness_probe=liveness_probe, model=model, model_mount_path=model_mount_path, readiness_probe=readiness_probe, request_settings=request_settings, scale_settings=scale_settings, **kwargs) - self.endpoint_compute_type = 'Kubernetes' # type: str + super(KubernetesOnlineDeployment, self).__init__( + code_configuration=code_configuration, + description=description, + environment_id=environment_id, + environment_variables=environment_variables, + properties=properties, + app_insights_enabled=app_insights_enabled, + egress_public_network_access=egress_public_network_access, + instance_type=instance_type, + liveness_probe=liveness_probe, + model=model, + model_mount_path=model_mount_path, + readiness_probe=readiness_probe, + request_settings=request_settings, + scale_settings=scale_settings, + **kwargs + ) + self.endpoint_compute_type = "Kubernetes" # type: str self.container_resource_requirements = container_resource_requirements @@ -15306,14 +16451,29 @@ class KubernetesProperties(msrest.serialization.Model): """ _attribute_map = { - 'relay_connection_string': {'key': 'relayConnectionString', 'type': 'str'}, - 'service_bus_connection_string': {'key': 'serviceBusConnectionString', 'type': 'str'}, - 'extension_principal_id': {'key': 'extensionPrincipalId', 'type': 'str'}, - 'extension_instance_release_train': {'key': 'extensionInstanceReleaseTrain', 'type': 'str'}, - 'vc_name': {'key': 'vcName', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'default_instance_type': {'key': 'defaultInstanceType', 'type': 'str'}, - 'instance_types': {'key': 'instanceTypes', 'type': '{InstanceTypeSchema}'}, + "relay_connection_string": { + "key": "relayConnectionString", + "type": "str", + }, + "service_bus_connection_string": { + "key": "serviceBusConnectionString", + "type": "str", + }, + "extension_principal_id": { + "key": "extensionPrincipalId", + "type": "str", + }, + "extension_instance_release_train": { + "key": "extensionInstanceReleaseTrain", + "type": "str", + }, + "vc_name": {"key": "vcName", "type": "str"}, + "namespace": {"key": "namespace", "type": "str"}, + "default_instance_type": {"key": "defaultInstanceType", "type": "str"}, + "instance_types": { + "key": "instanceTypes", + "type": "{InstanceTypeSchema}", + }, } def __init__( @@ -15352,7 +16512,9 @@ def __init__( self.relay_connection_string = relay_connection_string self.service_bus_connection_string = service_bus_connection_string self.extension_principal_id = extension_principal_id - self.extension_instance_release_train = extension_instance_release_train + self.extension_instance_release_train = ( + extension_instance_release_train + ) self.vc_name = vc_name self.namespace = namespace self.default_instance_type = default_instance_type @@ -15372,9 +16534,9 @@ class LabelCategory(msrest.serialization.Model): """ _attribute_map = { - 'classes': {'key': 'classes', 'type': '{LabelClass}'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'multi_select': {'key': 'multiSelect', 'type': 'str'}, + "classes": {"key": "classes", "type": "{LabelClass}"}, + "display_name": {"key": "displayName", "type": "str"}, + "multi_select": {"key": "multiSelect", "type": "str"}, } def __init__( @@ -15410,8 +16572,8 @@ class LabelClass(msrest.serialization.Model): """ _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'subclasses': {'key': 'subclasses', 'type': '{LabelClass}'}, + "display_name": {"key": "displayName", "type": "str"}, + "subclasses": {"key": "subclasses", "type": "{LabelClass}"}, } def __init__( @@ -15444,15 +16606,20 @@ class LabelingDataConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'data_id': {'key': 'dataId', 'type': 'str'}, - 'incremental_data_refresh': {'key': 'incrementalDataRefresh', 'type': 'str'}, + "data_id": {"key": "dataId", "type": "str"}, + "incremental_data_refresh": { + "key": "incrementalDataRefresh", + "type": "str", + }, } def __init__( self, *, data_id: Optional[str] = None, - incremental_data_refresh: Optional[Union[str, "IncrementalDataRefresh"]] = None, + incremental_data_refresh: Optional[ + Union[str, "IncrementalDataRefresh"] + ] = None, **kwargs ): """ @@ -15491,27 +16658,22 @@ class LabelingJob(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'LabelingJobProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "LabelingJobProperties"}, } - def __init__( - self, - *, - properties: "LabelingJobProperties", - **kwargs - ): + def __init__(self, *, properties: "LabelingJobProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.LabelingJobProperties @@ -15534,23 +16696,22 @@ class LabelingJobMediaProperties(msrest.serialization.Model): """ _validation = { - 'media_type': {'required': True}, + "media_type": {"required": True}, } _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, + "media_type": {"key": "mediaType", "type": "str"}, } _subtype_map = { - 'media_type': {'Image': 'LabelingJobImageProperties', 'Text': 'LabelingJobTextProperties'} + "media_type": { + "Image": "LabelingJobImageProperties", + "Text": "LabelingJobTextProperties", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(LabelingJobMediaProperties, self).__init__(**kwargs) self.media_type = None # type: Optional[str] @@ -15569,12 +16730,12 @@ class LabelingJobImageProperties(LabelingJobMediaProperties): """ _validation = { - 'media_type': {'required': True}, + "media_type": {"required": True}, } _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - 'annotation_type': {'key': 'annotationType', 'type': 'str'}, + "media_type": {"key": "mediaType", "type": "str"}, + "annotation_type": {"key": "annotationType", "type": "str"}, } def __init__( @@ -15590,7 +16751,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ImageAnnotationType """ super(LabelingJobImageProperties, self).__init__(**kwargs) - self.media_type = 'Image' # type: str + self.media_type = "Image" # type: str self.annotation_type = annotation_type @@ -15602,15 +16763,10 @@ class LabelingJobInstructions(msrest.serialization.Model): """ _attribute_map = { - 'uri': {'key': 'uri', 'type': 'str'}, + "uri": {"key": "uri", "type": "str"}, } - def __init__( - self, - *, - uri: Optional[str] = None, - **kwargs - ): + def __init__(self, *, uri: Optional[str] = None, **kwargs): """ :keyword uri: The link to a page with detailed labeling instructions for labelers. :paramtype uri: str @@ -15685,38 +16841,59 @@ class LabelingJobProperties(JobBaseProperties): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'created_date_time': {'readonly': True}, - 'progress_metrics': {'readonly': True}, - 'project_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'status_messages': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'data_configuration': {'key': 'dataConfiguration', 'type': 'LabelingDataConfiguration'}, - 'job_instructions': {'key': 'jobInstructions', 'type': 'LabelingJobInstructions'}, - 'label_categories': {'key': 'labelCategories', 'type': '{LabelCategory}'}, - 'labeling_job_media_properties': {'key': 'labelingJobMediaProperties', 'type': 'LabelingJobMediaProperties'}, - 'ml_assist_configuration': {'key': 'mlAssistConfiguration', 'type': 'MLAssistConfiguration'}, - 'progress_metrics': {'key': 'progressMetrics', 'type': 'ProgressMetrics'}, - 'project_id': {'key': 'projectId', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'status_messages': {'key': 'statusMessages', 'type': '[StatusMessage]'}, + "job_type": {"required": True}, + "status": {"readonly": True}, + "created_date_time": {"readonly": True}, + "progress_metrics": {"readonly": True}, + "project_id": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "status_messages": {"readonly": True}, + } + + _attribute_map = { + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "created_date_time": {"key": "createdDateTime", "type": "iso-8601"}, + "data_configuration": { + "key": "dataConfiguration", + "type": "LabelingDataConfiguration", + }, + "job_instructions": { + "key": "jobInstructions", + "type": "LabelingJobInstructions", + }, + "label_categories": { + "key": "labelCategories", + "type": "{LabelCategory}", + }, + "labeling_job_media_properties": { + "key": "labelingJobMediaProperties", + "type": "LabelingJobMediaProperties", + }, + "ml_assist_configuration": { + "key": "mlAssistConfiguration", + "type": "MLAssistConfiguration", + }, + "progress_metrics": { + "key": "progressMetrics", + "type": "ProgressMetrics", + }, + "project_id": {"key": "projectId", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "status_messages": { + "key": "statusMessages", + "type": "[StatusMessage]", + }, } def __init__( @@ -15735,7 +16912,9 @@ def __init__( data_configuration: Optional["LabelingDataConfiguration"] = None, job_instructions: Optional["LabelingJobInstructions"] = None, label_categories: Optional[Dict[str, "LabelCategory"]] = None, - labeling_job_media_properties: Optional["LabelingJobMediaProperties"] = None, + labeling_job_media_properties: Optional[ + "LabelingJobMediaProperties" + ] = None, ml_assist_configuration: Optional["MLAssistConfiguration"] = None, **kwargs ): @@ -15779,8 +16958,20 @@ def __init__( :paramtype ml_assist_configuration: ~azure.mgmt.machinelearningservices.models.MLAssistConfiguration """ - super(LabelingJobProperties, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, services=services, **kwargs) - self.job_type = 'Labeling' # type: str + super(LabelingJobProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + component_id=component_id, + compute_id=compute_id, + display_name=display_name, + experiment_name=experiment_name, + identity=identity, + is_archived=is_archived, + services=services, + **kwargs + ) + self.job_type = "Labeling" # type: str self.created_date_time = None self.data_configuration = data_configuration self.job_instructions = job_instructions @@ -15804,8 +16995,8 @@ class LabelingJobResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[LabelingJob]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[LabelingJob]"}, } def __init__( @@ -15841,12 +17032,12 @@ class LabelingJobTextProperties(LabelingJobMediaProperties): """ _validation = { - 'media_type': {'required': True}, + "media_type": {"required": True}, } _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - 'annotation_type': {'key': 'annotationType', 'type': 'str'}, + "media_type": {"key": "mediaType", "type": "str"}, + "annotation_type": {"key": "annotationType", "type": "str"}, } def __init__( @@ -15862,7 +17053,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.TextAnnotationType """ super(LabelingJobTextProperties, self).__init__(**kwargs) - self.media_type = 'Text' # type: str + self.media_type = "Text" # type: str self.annotation_type = annotation_type @@ -15879,21 +17070,17 @@ class ListAmlUserFeatureResult(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlUserFeature]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[AmlUserFeature]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListAmlUserFeatureResult, self).__init__(**kwargs) self.value = None self.next_link = None @@ -15911,21 +17098,17 @@ class ListNotebookKeysResult(msrest.serialization.Model): """ _validation = { - 'primary_access_key': {'readonly': True}, - 'secondary_access_key': {'readonly': True}, + "primary_access_key": {"readonly": True}, + "secondary_access_key": {"readonly": True}, } _attribute_map = { - 'primary_access_key': {'key': 'primaryAccessKey', 'type': 'str'}, - 'secondary_access_key': {'key': 'secondaryAccessKey', 'type': 'str'}, + "primary_access_key": {"key": "primaryAccessKey", "type": "str"}, + "secondary_access_key": {"key": "secondaryAccessKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListNotebookKeysResult, self).__init__(**kwargs) self.primary_access_key = None self.secondary_access_key = None @@ -15941,19 +17124,15 @@ class ListStorageAccountKeysResult(msrest.serialization.Model): """ _validation = { - 'user_storage_key': {'readonly': True}, + "user_storage_key": {"readonly": True}, } _attribute_map = { - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, + "user_storage_key": {"key": "userStorageKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListStorageAccountKeysResult, self).__init__(**kwargs) self.user_storage_key = None @@ -15971,21 +17150,17 @@ class ListUsagesResult(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[Usage]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Usage]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListUsagesResult, self).__init__(**kwargs) self.value = None self.next_link = None @@ -16011,27 +17186,35 @@ class ListWorkspaceKeysResult(msrest.serialization.Model): """ _validation = { - 'user_storage_key': {'readonly': True}, - 'user_storage_resource_id': {'readonly': True}, - 'app_insights_instrumentation_key': {'readonly': True}, - 'container_registry_credentials': {'readonly': True}, - 'notebook_access_keys': {'readonly': True}, + "user_storage_key": {"readonly": True}, + "user_storage_resource_id": {"readonly": True}, + "app_insights_instrumentation_key": {"readonly": True}, + "container_registry_credentials": {"readonly": True}, + "notebook_access_keys": {"readonly": True}, } _attribute_map = { - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, - 'user_storage_resource_id': {'key': 'userStorageResourceId', 'type': 'str'}, - 'app_insights_instrumentation_key': {'key': 'appInsightsInstrumentationKey', 'type': 'str'}, - 'container_registry_credentials': {'key': 'containerRegistryCredentials', 'type': 'RegistryListCredentialsResult'}, - 'notebook_access_keys': {'key': 'notebookAccessKeys', 'type': 'ListNotebookKeysResult'}, + "user_storage_key": {"key": "userStorageKey", "type": "str"}, + "user_storage_resource_id": { + "key": "userStorageResourceId", + "type": "str", + }, + "app_insights_instrumentation_key": { + "key": "appInsightsInstrumentationKey", + "type": "str", + }, + "container_registry_credentials": { + "key": "containerRegistryCredentials", + "type": "RegistryListCredentialsResult", + }, + "notebook_access_keys": { + "key": "notebookAccessKeys", + "type": "ListNotebookKeysResult", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListWorkspaceKeysResult, self).__init__(**kwargs) self.user_storage_key = None self.user_storage_resource_id = None @@ -16053,21 +17236,17 @@ class ListWorkspaceQuotas(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[ResourceQuota]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[ResourceQuota]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListWorkspaceQuotas, self).__init__(**kwargs) self.value = None self.next_link = None @@ -16089,22 +17268,18 @@ class LiteralJobInput(JobInput): """ _validation = { - 'job_input_type': {'required': True}, - 'value': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "job_input_type": {"required": True}, + "value": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, + "value": {"key": "value", "type": "str"}, } def __init__( - self, - *, - value: str, - description: Optional[str] = None, - **kwargs + self, *, value: str, description: Optional[str] = None, **kwargs ): """ :keyword description: Description for the input. @@ -16112,8 +17287,10 @@ def __init__( :keyword value: Required. [Required] Literal value for the input. :paramtype value: str """ - super(LiteralJobInput, self).__init__(description=description, **kwargs) - self.job_input_type = 'literal' # type: str + super(LiteralJobInput, self).__init__( + description=description, **kwargs + ) + self.job_input_type = "literal" # type: str self.value = value @@ -16138,14 +17315,14 @@ class ManagedIdentity(IdentityConfiguration): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + "object_id": {"key": "objectId", "type": "str"}, + "resource_id": {"key": "resourceId", "type": "str"}, } def __init__( @@ -16168,13 +17345,15 @@ def __init__( :paramtype resource_id: str """ super(ManagedIdentity, self).__init__(**kwargs) - self.identity_type = 'Managed' # type: str + self.identity_type = "Managed" # type: str self.client_id = client_id self.object_id = object_id self.resource_id = resource_id -class ManagedIdentityAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class ManagedIdentityAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """ManagedIdentityAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -16199,16 +17378,19 @@ class ManagedIdentityAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPr """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionManagedIdentity'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionManagedIdentity", + }, } def __init__( @@ -16237,8 +17419,16 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity """ - super(ManagedIdentityAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'ManagedIdentity' # type: str + super( + ManagedIdentityAuthTypeWorkspaceConnectionProperties, self + ).__init__( + category=category, + target=target, + value=value, + value_format=value_format, + **kwargs + ) + self.auth_type = "ManagedIdentity" # type: str self.credentials = credentials @@ -16250,15 +17440,10 @@ class ManagedNetworkProvisionOptions(msrest.serialization.Model): """ _attribute_map = { - 'include_spark': {'key': 'includeSpark', 'type': 'bool'}, + "include_spark": {"key": "includeSpark", "type": "bool"}, } - def __init__( - self, - *, - include_spark: Optional[bool] = None, - **kwargs - ): + def __init__(self, *, include_spark: Optional[bool] = None, **kwargs): """ :keyword include_spark: :paramtype include_spark: bool @@ -16278,8 +17463,8 @@ class ManagedNetworkProvisionStatus(msrest.serialization.Model): """ _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'spark_ready': {'key': 'sparkReady', 'type': 'bool'}, + "status": {"key": "status", "type": "str"}, + "spark_ready": {"key": "sparkReady", "type": "bool"}, } def __init__( @@ -16319,14 +17504,14 @@ class ManagedNetworkSettings(msrest.serialization.Model): """ _validation = { - 'network_id': {'readonly': True}, + "network_id": {"readonly": True}, } _attribute_map = { - 'isolation_mode': {'key': 'isolationMode', 'type': 'str'}, - 'network_id': {'key': 'networkId', 'type': 'str'}, - 'outbound_rules': {'key': 'outboundRules', 'type': '{OutboundRule}'}, - 'status': {'key': 'status', 'type': 'ManagedNetworkProvisionStatus'}, + "isolation_mode": {"key": "isolationMode", "type": "str"}, + "network_id": {"key": "networkId", "type": "str"}, + "outbound_rules": {"key": "outboundRules", "type": "{OutboundRule}"}, + "status": {"key": "status", "type": "ManagedNetworkProvisionStatus"}, } def __init__( @@ -16409,27 +17594,42 @@ class ManagedOnlineDeployment(OnlineDeploymentProperties): """ _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, + "endpoint_compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, + "egress_public_network_access": { + "key": "egressPublicNetworkAccess", + "type": "str", + }, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, + "model": {"key": "model", "type": "str"}, + "model_mount_path": {"key": "modelMountPath", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, } def __init__( @@ -16441,7 +17641,9 @@ def __init__( environment_variables: Optional[Dict[str, str]] = None, properties: Optional[Dict[str, str]] = None, app_insights_enabled: Optional[bool] = False, - egress_public_network_access: Optional[Union[str, "EgressPublicNetworkAccessType"]] = None, + egress_public_network_access: Optional[ + Union[str, "EgressPublicNetworkAccessType"] + ] = None, instance_type: Optional[str] = None, liveness_probe: Optional["ProbeSettings"] = None, model: Optional[str] = None, @@ -16489,8 +17691,24 @@ def __init__( and to DefaultScaleSettings for ManagedOnlineDeployment. :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings """ - super(ManagedOnlineDeployment, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, app_insights_enabled=app_insights_enabled, egress_public_network_access=egress_public_network_access, instance_type=instance_type, liveness_probe=liveness_probe, model=model, model_mount_path=model_mount_path, readiness_probe=readiness_probe, request_settings=request_settings, scale_settings=scale_settings, **kwargs) - self.endpoint_compute_type = 'Managed' # type: str + super(ManagedOnlineDeployment, self).__init__( + code_configuration=code_configuration, + description=description, + environment_id=environment_id, + environment_variables=environment_variables, + properties=properties, + app_insights_enabled=app_insights_enabled, + egress_public_network_access=egress_public_network_access, + instance_type=instance_type, + liveness_probe=liveness_probe, + model=model, + model_mount_path=model_mount_path, + readiness_probe=readiness_probe, + request_settings=request_settings, + scale_settings=scale_settings, + **kwargs + ) + self.endpoint_compute_type = "Managed" # type: str class ManagedServiceIdentity(msrest.serialization.Model): @@ -16519,23 +17737,28 @@ class ManagedServiceIdentity(msrest.serialization.Model): """ _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, + "principal_id": {"readonly": True}, + "tenant_id": {"readonly": True}, + "type": {"required": True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{UserAssignedIdentity}", + }, } def __init__( self, *, type: Union[str, "ManagedServiceIdentityType"], - user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, + user_assigned_identities: Optional[ + Dict[str, "UserAssignedIdentity"] + ] = None, **kwargs ): """ @@ -16573,13 +17796,13 @@ class MedianStoppingPolicy(EarlyTerminationPolicy): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, } def __init__( @@ -16595,8 +17818,12 @@ def __init__( :keyword evaluation_interval: Interval (number of runs) between policy evaluations. :paramtype evaluation_interval: int """ - super(MedianStoppingPolicy, self).__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs) - self.policy_type = 'MedianStopping' # type: str + super(MedianStoppingPolicy, self).__init__( + delay_evaluation=delay_evaluation, + evaluation_interval=evaluation_interval, + **kwargs + ) + self.policy_type = "MedianStopping" # type: str class MLAssistConfiguration(msrest.serialization.Model): @@ -16613,23 +17840,22 @@ class MLAssistConfiguration(msrest.serialization.Model): """ _validation = { - 'ml_assist': {'required': True}, + "ml_assist": {"required": True}, } _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, + "ml_assist": {"key": "mlAssist", "type": "str"}, } _subtype_map = { - 'ml_assist': {'Disabled': 'MLAssistConfigurationDisabled', 'Enabled': 'MLAssistConfigurationEnabled'} + "ml_assist": { + "Disabled": "MLAssistConfigurationDisabled", + "Enabled": "MLAssistConfigurationEnabled", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(MLAssistConfiguration, self).__init__(**kwargs) self.ml_assist = None # type: Optional[str] @@ -16645,21 +17871,17 @@ class MLAssistConfigurationDisabled(MLAssistConfiguration): """ _validation = { - 'ml_assist': {'required': True}, + "ml_assist": {"required": True}, } _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, + "ml_assist": {"key": "mlAssist", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(MLAssistConfigurationDisabled, self).__init__(**kwargs) - self.ml_assist = 'Disabled' # type: str + self.ml_assist = "Disabled" # type: str class MLAssistConfigurationEnabled(MLAssistConfiguration): @@ -16678,15 +17900,27 @@ class MLAssistConfigurationEnabled(MLAssistConfiguration): """ _validation = { - 'ml_assist': {'required': True}, - 'inferencing_compute_binding': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'training_compute_binding': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "ml_assist": {"required": True}, + "inferencing_compute_binding": { + "required": True, + "pattern": r"[a-zA-Z0-9_]", + }, + "training_compute_binding": { + "required": True, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - 'inferencing_compute_binding': {'key': 'inferencingComputeBinding', 'type': 'str'}, - 'training_compute_binding': {'key': 'trainingComputeBinding', 'type': 'str'}, + "ml_assist": {"key": "mlAssist", "type": "str"}, + "inferencing_compute_binding": { + "key": "inferencingComputeBinding", + "type": "str", + }, + "training_compute_binding": { + "key": "trainingComputeBinding", + "type": "str", + }, } def __init__( @@ -16704,7 +17938,7 @@ def __init__( :paramtype training_compute_binding: str """ super(MLAssistConfigurationEnabled, self).__init__(**kwargs) - self.ml_assist = 'Enabled' # type: str + self.ml_assist = "Enabled" # type: str self.inferencing_compute_binding = inferencing_compute_binding self.training_compute_binding = training_compute_binding @@ -16728,15 +17962,15 @@ class MLFlowModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -16756,10 +17990,12 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(MLFlowModelJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(MLFlowModelJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'mlflow_model' # type: str + self.job_input_type = "mlflow_model" # type: str self.description = description @@ -16786,16 +18022,16 @@ class MLFlowModelJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "asset_name": {"key": "assetName", "type": "str"}, + "asset_version": {"key": "assetVersion", "type": "str"}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -16821,12 +18057,19 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(MLFlowModelJobOutput, self).__init__(description=description, asset_name=asset_name, asset_version=asset_version, mode=mode, uri=uri, **kwargs) + super(MLFlowModelJobOutput, self).__init__( + description=description, + asset_name=asset_name, + asset_version=asset_version, + mode=mode, + uri=uri, + **kwargs + ) self.asset_name = asset_name self.asset_version = asset_version self.mode = mode self.uri = uri - self.job_output_type = 'mlflow_model' # type: str + self.job_output_type = "mlflow_model" # type: str self.description = description @@ -16856,19 +18099,19 @@ class MLTableData(DataVersionBaseProperties): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'referenced_uris': {'key': 'referencedUris', 'type': '[str]'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, + "referenced_uris": {"key": "referencedUris", "type": "[str]"}, } def __init__( @@ -16900,8 +18143,16 @@ def __init__( :keyword referenced_uris: Uris referenced in the MLTable definition (required for lineage). :paramtype referenced_uris: list[str] """ - super(MLTableData, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, **kwargs) - self.data_type = 'mltable' # type: str + super(MLTableData, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + data_uri=data_uri, + **kwargs + ) + self.data_type = "mltable" # type: str self.referenced_uris = referenced_uris @@ -16924,15 +18175,15 @@ class MLTableJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -16952,10 +18203,12 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(MLTableJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(MLTableJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'mltable' # type: str + self.job_input_type = "mltable" # type: str self.description = description @@ -16982,16 +18235,16 @@ class MLTableJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "asset_name": {"key": "assetName", "type": "str"}, + "asset_version": {"key": "assetVersion", "type": "str"}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -17017,12 +18270,19 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(MLTableJobOutput, self).__init__(description=description, asset_name=asset_name, asset_version=asset_version, mode=mode, uri=uri, **kwargs) + super(MLTableJobOutput, self).__init__( + description=description, + asset_name=asset_name, + asset_version=asset_version, + mode=mode, + uri=uri, + **kwargs + ) self.asset_name = asset_name self.asset_version = asset_version self.mode = mode self.uri = uri - self.job_output_type = 'mltable' # type: str + self.job_output_type = "mltable" # type: str self.description = description @@ -17049,27 +18309,25 @@ class ModelContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "ModelContainerProperties", + }, } - def __init__( - self, - *, - properties: "ModelContainerProperties", - **kwargs - ): + def __init__(self, *, properties: "ModelContainerProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelContainerProperties @@ -17102,19 +18360,19 @@ class ModelContainerProperties(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } def __init__( @@ -17136,7 +18394,13 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(ModelContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) + super(ModelContainerProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs + ) self.provisioning_state = None @@ -17151,8 +18415,8 @@ class ModelContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ModelContainer]"}, } def __init__( @@ -17169,7 +18433,9 @@ def __init__( :keyword value: An array of objects of type ModelContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelContainer] """ - super(ModelContainerResourceArmPaginatedResult, self).__init__(**kwargs) + super(ModelContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -17197,27 +18463,22 @@ class ModelVersion(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelVersionProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "ModelVersionProperties"}, } - def __init__( - self, - *, - properties: "ModelVersionProperties", - **kwargs - ): + def __init__(self, *, properties: "ModelVersionProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelVersionProperties @@ -17256,20 +18517,20 @@ class ModelVersionProperties(AssetBase): """ _validation = { - 'provisioning_state': {'readonly': True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'flavors': {'key': 'flavors', 'type': '{FlavorData}'}, - 'job_name': {'key': 'jobName', 'type': 'str'}, - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'model_uri': {'key': 'modelUri', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "flavors": {"key": "flavors", "type": "{FlavorData}"}, + "job_name": {"key": "jobName", "type": "str"}, + "model_type": {"key": "modelType", "type": "str"}, + "model_uri": {"key": "modelUri", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } def __init__( @@ -17306,7 +18567,14 @@ def __init__( :keyword model_uri: The URI path to the model contents. :paramtype model_uri: str """ - super(ModelVersionProperties, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) + super(ModelVersionProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + **kwargs + ) self.flavors = flavors self.job_name = job_name self.model_type = model_type @@ -17325,8 +18593,8 @@ class ModelVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelVersion]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ModelVersion]"}, } def __init__( @@ -17361,26 +18629,26 @@ class Mpi(DistributionConfiguration): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, + "distribution_type": {"key": "distributionType", "type": "str"}, + "process_count_per_instance": { + "key": "processCountPerInstance", + "type": "int", + }, } def __init__( - self, - *, - process_count_per_instance: Optional[int] = None, - **kwargs + self, *, process_count_per_instance: Optional[int] = None, **kwargs ): """ :keyword process_count_per_instance: Number of processes per MPI node. :paramtype process_count_per_instance: int """ super(Mpi, self).__init__(**kwargs) - self.distribution_type = 'Mpi' # type: str + self.distribution_type = "Mpi" # type: str self.process_count_per_instance = process_count_per_instance @@ -17412,15 +18680,21 @@ class NlpFixedParameters(msrest.serialization.Model): """ _attribute_map = { - 'gradient_accumulation_steps': {'key': 'gradientAccumulationSteps', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_ratio': {'key': 'warmupRatio', 'type': 'float'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, + "gradient_accumulation_steps": { + "key": "gradientAccumulationSteps", + "type": "int", + }, + "learning_rate": {"key": "learningRate", "type": "float"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "int"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, + "warmup_ratio": {"key": "warmupRatio", "type": "float"}, + "weight_decay": {"key": "weightDecay", "type": "float"}, } def __init__( @@ -17428,7 +18702,9 @@ def __init__( *, gradient_accumulation_steps: Optional[int] = None, learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "NlpLearningRateScheduler"]] = None, + learning_rate_scheduler: Optional[ + Union[str, "NlpLearningRateScheduler"] + ] = None, model_name: Optional[str] = None, number_of_epochs: Optional[int] = None, training_batch_size: Optional[int] = None, @@ -17499,15 +18775,21 @@ class NlpParameterSubspace(msrest.serialization.Model): """ _attribute_map = { - 'gradient_accumulation_steps': {'key': 'gradientAccumulationSteps', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_ratio': {'key': 'warmupRatio', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, + "gradient_accumulation_steps": { + "key": "gradientAccumulationSteps", + "type": "str", + }, + "learning_rate": {"key": "learningRate", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "str"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, + "warmup_ratio": {"key": "warmupRatio", "type": "str"}, + "weight_decay": {"key": "weightDecay", "type": "str"}, } def __init__( @@ -17572,12 +18854,15 @@ class NlpSweepSettings(msrest.serialization.Model): """ _validation = { - 'sampling_algorithm': {'required': True}, + "sampling_algorithm": {"required": True}, } _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, + "sampling_algorithm": {"key": "samplingAlgorithm", "type": "str"}, } def __init__( @@ -17602,38 +18887,55 @@ def __init__( class NlpVertical(msrest.serialization.Model): """Abstract class for NLP related AutoML tasks. -NLP - Natural Language Processing. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ + NLP - Natural Language Processing. - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - } - - def __init__( - self, - *, - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar fixed_parameters: Model/training parameters that will remain constant throughout + training. + :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] + :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + """ + + _attribute_map = { + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "NlpFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "search_space": { + "key": "searchSpace", + "type": "[NlpParameterSubspace]", + }, + "sweep_settings": {"key": "sweepSettings", "type": "NlpSweepSettings"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + } + + def __init__( + self, + *, + featurization_settings: Optional[ + "NlpVerticalFeaturizationSettings" + ] = None, fixed_parameters: Optional["NlpFixedParameters"] = None, limit_settings: Optional["NlpVerticalLimitSettings"] = None, search_space: Optional[List["NlpParameterSubspace"]] = None, @@ -17675,20 +18977,17 @@ class NlpVerticalFeaturizationSettings(FeaturizationSettings): """ _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, + "dataset_language": {"key": "datasetLanguage", "type": "str"}, } - def __init__( - self, - *, - dataset_language: Optional[str] = None, - **kwargs - ): + def __init__(self, *, dataset_language: Optional[str] = None, **kwargs): """ :keyword dataset_language: Dataset language, useful for the text data. :paramtype dataset_language: str """ - super(NlpVerticalFeaturizationSettings, self).__init__(dataset_language=dataset_language, **kwargs) + super(NlpVerticalFeaturizationSettings, self).__init__( + dataset_language=dataset_language, **kwargs + ) class NlpVerticalLimitSettings(msrest.serialization.Model): @@ -17707,11 +19006,11 @@ class NlpVerticalLimitSettings(msrest.serialization.Model): """ _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_nodes': {'key': 'maxNodes', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_nodes": {"key": "maxNodes", "type": "int"}, + "max_trials": {"key": "maxTrials", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, + "trial_timeout": {"key": "trialTimeout", "type": "duration"}, } def __init__( @@ -17764,29 +19063,25 @@ class NodeStateCounts(msrest.serialization.Model): """ _validation = { - 'idle_node_count': {'readonly': True}, - 'running_node_count': {'readonly': True}, - 'preparing_node_count': {'readonly': True}, - 'unusable_node_count': {'readonly': True}, - 'leaving_node_count': {'readonly': True}, - 'preempted_node_count': {'readonly': True}, + "idle_node_count": {"readonly": True}, + "running_node_count": {"readonly": True}, + "preparing_node_count": {"readonly": True}, + "unusable_node_count": {"readonly": True}, + "leaving_node_count": {"readonly": True}, + "preempted_node_count": {"readonly": True}, } _attribute_map = { - 'idle_node_count': {'key': 'idleNodeCount', 'type': 'int'}, - 'running_node_count': {'key': 'runningNodeCount', 'type': 'int'}, - 'preparing_node_count': {'key': 'preparingNodeCount', 'type': 'int'}, - 'unusable_node_count': {'key': 'unusableNodeCount', 'type': 'int'}, - 'leaving_node_count': {'key': 'leavingNodeCount', 'type': 'int'}, - 'preempted_node_count': {'key': 'preemptedNodeCount', 'type': 'int'}, + "idle_node_count": {"key": "idleNodeCount", "type": "int"}, + "running_node_count": {"key": "runningNodeCount", "type": "int"}, + "preparing_node_count": {"key": "preparingNodeCount", "type": "int"}, + "unusable_node_count": {"key": "unusableNodeCount", "type": "int"}, + "leaving_node_count": {"key": "leavingNodeCount", "type": "int"}, + "preempted_node_count": {"key": "preemptedNodeCount", "type": "int"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NodeStateCounts, self).__init__(**kwargs) self.idle_node_count = None self.running_node_count = None @@ -17796,7 +19091,9 @@ def __init__( self.preempted_node_count = None -class NoneAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class NoneAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """NoneAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -17818,15 +19115,15 @@ class NoneAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2) """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, } def __init__( @@ -17851,8 +19148,14 @@ def __init__( "JSON". :paramtype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat """ - super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'None' # type: str + super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__( + category=category, + target=target, + value=value, + value_format=value_format, + **kwargs + ) + self.auth_type = "None" # type: str class NoneDatastoreCredentials(DatastoreCredentials): @@ -17867,21 +19170,17 @@ class NoneDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, + "credentials_type": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NoneDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'None' # type: str + self.credentials_type = "None" # type: str class NotebookAccessTokenResult(msrest.serialization.Model): @@ -17908,33 +19207,29 @@ class NotebookAccessTokenResult(msrest.serialization.Model): """ _validation = { - 'notebook_resource_id': {'readonly': True}, - 'host_name': {'readonly': True}, - 'public_dns': {'readonly': True}, - 'access_token': {'readonly': True}, - 'token_type': {'readonly': True}, - 'expires_in': {'readonly': True}, - 'refresh_token': {'readonly': True}, - 'scope': {'readonly': True}, + "notebook_resource_id": {"readonly": True}, + "host_name": {"readonly": True}, + "public_dns": {"readonly": True}, + "access_token": {"readonly": True}, + "token_type": {"readonly": True}, + "expires_in": {"readonly": True}, + "refresh_token": {"readonly": True}, + "scope": {"readonly": True}, } _attribute_map = { - 'notebook_resource_id': {'key': 'notebookResourceId', 'type': 'str'}, - 'host_name': {'key': 'hostName', 'type': 'str'}, - 'public_dns': {'key': 'publicDns', 'type': 'str'}, - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, - 'expires_in': {'key': 'expiresIn', 'type': 'int'}, - 'refresh_token': {'key': 'refreshToken', 'type': 'str'}, - 'scope': {'key': 'scope', 'type': 'str'}, + "notebook_resource_id": {"key": "notebookResourceId", "type": "str"}, + "host_name": {"key": "hostName", "type": "str"}, + "public_dns": {"key": "publicDns", "type": "str"}, + "access_token": {"key": "accessToken", "type": "str"}, + "token_type": {"key": "tokenType", "type": "str"}, + "expires_in": {"key": "expiresIn", "type": "int"}, + "refresh_token": {"key": "refreshToken", "type": "str"}, + "scope": {"key": "scope", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NotebookAccessTokenResult, self).__init__(**kwargs) self.notebook_resource_id = None self.host_name = None @@ -17956,8 +19251,8 @@ class NotebookPreparationError(msrest.serialization.Model): """ _attribute_map = { - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'status_code': {'key': 'statusCode', 'type': 'int'}, + "error_message": {"key": "errorMessage", "type": "str"}, + "status_code": {"key": "statusCode", "type": "int"}, } def __init__( @@ -17991,9 +19286,12 @@ class NotebookResourceInfo(msrest.serialization.Model): """ _attribute_map = { - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'notebook_preparation_error': {'key': 'notebookPreparationError', 'type': 'NotebookPreparationError'}, + "fqdn": {"key": "fqdn", "type": "str"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "notebook_preparation_error": { + "key": "notebookPreparationError", + "type": "NotebookPreparationError", + }, } def __init__( @@ -18001,7 +19299,9 @@ def __init__( *, fqdn: Optional[str] = None, resource_id: Optional[str] = None, - notebook_preparation_error: Optional["NotebookPreparationError"] = None, + notebook_preparation_error: Optional[ + "NotebookPreparationError" + ] = None, **kwargs ): """ @@ -18032,21 +19332,17 @@ class Objective(msrest.serialization.Model): """ _validation = { - 'goal': {'required': True}, - 'primary_metric': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "goal": {"required": True}, + "primary_metric": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'goal': {'key': 'goal', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "goal": {"key": "goal", "type": "str"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( - self, - *, - goal: Union[str, "Goal"], - primary_metric: str, - **kwargs + self, *, goal: Union[str, "Goal"], primary_metric: str, **kwargs ): """ :keyword goal: Required. [Required] Defines supported metric goals for hyperparameter tuning. @@ -18094,25 +19390,28 @@ class OnlineDeployment(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineDeploymentProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": { + "key": "properties", + "type": "OnlineDeploymentProperties", + }, + "sku": {"key": "sku", "type": "Sku"}, } def __init__( @@ -18141,14 +19440,18 @@ def __init__( :keyword sku: Sku details required for ARM contract for Autoscaling. :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ - super(OnlineDeployment, self).__init__(tags=tags, location=location, **kwargs) + super(OnlineDeployment, self).__init__( + tags=tags, location=location, **kwargs + ) self.identity = identity self.kind = kind self.properties = properties self.sku = sku -class OnlineDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class OnlineDeploymentTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of OnlineDeployment entities. :ivar next_link: The link to the next page of OnlineDeployment objects. If null, there are no @@ -18159,8 +19462,8 @@ class OnlineDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Mod """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineDeployment]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[OnlineDeployment]"}, } def __init__( @@ -18177,7 +19480,9 @@ def __init__( :keyword value: An array of objects of type OnlineDeployment. :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineDeployment] """ - super(OnlineDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) + super( + OnlineDeploymentTrackedResourceArmPaginatedResult, self + ).__init__(**kwargs) self.next_link = next_link self.value = value @@ -18216,25 +19521,28 @@ class OnlineEndpoint(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": { + "key": "properties", + "type": "OnlineEndpointProperties", + }, + "sku": {"key": "sku", "type": "Sku"}, } def __init__( @@ -18263,7 +19571,9 @@ def __init__( :keyword sku: Sku details required for ARM contract for Autoscaling. :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ - super(OnlineEndpoint, self).__init__(tags=tags, location=location, **kwargs) + super(OnlineEndpoint, self).__init__( + tags=tags, location=location, **kwargs + ) self.identity = identity self.kind = kind self.properties = properties @@ -18313,24 +19623,24 @@ class OnlineEndpointProperties(EndpointPropertiesBase): """ _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "auth_mode": {"required": True}, + "scoring_uri": {"readonly": True}, + "swagger_uri": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'mirror_traffic': {'key': 'mirrorTraffic', 'type': '{int}'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, - 'traffic': {'key': 'traffic', 'type': '{int}'}, + "auth_mode": {"key": "authMode", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "keys": {"key": "keys", "type": "EndpointAuthKeys"}, + "properties": {"key": "properties", "type": "{str}"}, + "scoring_uri": {"key": "scoringUri", "type": "str"}, + "swagger_uri": {"key": "swaggerUri", "type": "str"}, + "compute": {"key": "compute", "type": "str"}, + "mirror_traffic": {"key": "mirrorTraffic", "type": "{int}"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "public_network_access": {"key": "publicNetworkAccess", "type": "str"}, + "traffic": {"key": "traffic", "type": "{int}"}, } def __init__( @@ -18342,7 +19652,9 @@ def __init__( properties: Optional[Dict[str, str]] = None, compute: Optional[str] = None, mirror_traffic: Optional[Dict[str, int]] = None, - public_network_access: Optional[Union[str, "PublicNetworkAccessType"]] = None, + public_network_access: Optional[ + Union[str, "PublicNetworkAccessType"] + ] = None, traffic: Optional[Dict[str, int]] = None, **kwargs ): @@ -18373,7 +19685,13 @@ def __init__( values need to sum to 100. :paramtype traffic: dict[str, int] """ - super(OnlineEndpointProperties, self).__init__(auth_mode=auth_mode, description=description, keys=keys, properties=properties, **kwargs) + super(OnlineEndpointProperties, self).__init__( + auth_mode=auth_mode, + description=description, + keys=keys, + properties=properties, + **kwargs + ) self.compute = compute self.mirror_traffic = mirror_traffic self.provisioning_state = None @@ -18381,7 +19699,9 @@ def __init__( self.traffic = traffic -class OnlineEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class OnlineEndpointTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of OnlineEndpoint entities. :ivar next_link: The link to the next page of OnlineEndpoint objects. If null, there are no @@ -18392,8 +19712,8 @@ class OnlineEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineEndpoint]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[OnlineEndpoint]"}, } def __init__( @@ -18410,7 +19730,9 @@ def __init__( :keyword value: An array of objects of type OnlineEndpoint. :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] """ - super(OnlineEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) + super(OnlineEndpointTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -18431,9 +19753,12 @@ class OnlineRequestSettings(msrest.serialization.Model): """ _attribute_map = { - 'max_concurrent_requests_per_instance': {'key': 'maxConcurrentRequestsPerInstance', 'type': 'int'}, - 'max_queue_wait': {'key': 'maxQueueWait', 'type': 'duration'}, - 'request_timeout': {'key': 'requestTimeout', 'type': 'duration'}, + "max_concurrent_requests_per_instance": { + "key": "maxConcurrentRequestsPerInstance", + "type": "int", + }, + "max_queue_wait": {"key": "maxQueueWait", "type": "duration"}, + "request_timeout": {"key": "requestTimeout", "type": "duration"}, } def __init__( @@ -18457,7 +19782,9 @@ def __init__( :paramtype request_timeout: ~datetime.timedelta """ super(OnlineRequestSettings, self).__init__(**kwargs) - self.max_concurrent_requests_per_instance = max_concurrent_requests_per_instance + self.max_concurrent_requests_per_instance = ( + max_concurrent_requests_per_instance + ) self.max_queue_wait = max_queue_wait self.request_timeout = request_timeout @@ -18486,27 +19813,22 @@ class OutboundRuleBasicResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'OutboundRule'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "OutboundRule"}, } - def __init__( - self, - *, - properties: "OutboundRule", - **kwargs - ): + def __init__(self, *, properties: "OutboundRule", **kwargs): """ :keyword properties: Required. Outbound Rule for the managed network of a machine learning workspace. @@ -18528,8 +19850,8 @@ class OutboundRuleListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[OutboundRuleBasicResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[OutboundRuleBasicResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( @@ -18567,13 +19889,13 @@ class OutputPathAssetReference(AssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "job_id": {"key": "jobId", "type": "str"}, + "path": {"key": "path", "type": "str"}, } def __init__( @@ -18590,7 +19912,7 @@ def __init__( :paramtype path: str """ super(OutputPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'OutputPath' # type: str + self.reference_type = "OutputPath" # type: str self.job_id = job_id self.path = path @@ -18605,8 +19927,8 @@ class PaginatedComputeResourcesList(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[ComputeResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[ComputeResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( @@ -18635,15 +19957,10 @@ class PartialBatchDeployment(msrest.serialization.Model): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, } - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): + def __init__(self, *, description: Optional[str] = None, **kwargs): """ :keyword description: Description of the endpoint deployment. :paramtype description: str @@ -18652,7 +19969,9 @@ def __init__( self.description = description -class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties(msrest.serialization.Model): +class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties( + msrest.serialization.Model +): """Strictly used in update requests. :ivar properties: Additional attributes of the entity. @@ -18662,8 +19981,8 @@ class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties(msrest.s """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'PartialBatchDeployment'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "properties": {"key": "properties", "type": "PartialBatchDeployment"}, + "tags": {"key": "tags", "type": "{str}"}, } def __init__( @@ -18679,7 +19998,10 @@ def __init__( :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] """ - super(PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, self).__init__(**kwargs) + super( + PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, + self, + ).__init__(**kwargs) self.properties = properties self.tags = tags @@ -18699,8 +20021,11 @@ class PartialManagedServiceIdentity(msrest.serialization.Model): """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{object}'}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{object}", + }, } def __init__( @@ -18734,15 +20059,10 @@ class PartialMinimalTrackedResource(msrest.serialization.Model): """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): + def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -18761,8 +20081,11 @@ class PartialMinimalTrackedResourceWithIdentity(PartialMinimalTrackedResource): """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, + "tags": {"key": "tags", "type": "{str}"}, + "identity": { + "key": "identity", + "type": "PartialManagedServiceIdentity", + }, } def __init__( @@ -18778,7 +20101,9 @@ def __init__( :keyword identity: Managed service identity (system assigned and/or user assigned identities). :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity """ - super(PartialMinimalTrackedResourceWithIdentity, self).__init__(tags=tags, **kwargs) + super(PartialMinimalTrackedResourceWithIdentity, self).__init__( + tags=tags, **kwargs + ) self.identity = identity @@ -18792,8 +20117,8 @@ class PartialMinimalTrackedResourceWithSku(PartialMinimalTrackedResource): """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "PartialSku"}, } def __init__( @@ -18809,7 +20134,9 @@ def __init__( :keyword sku: Sku details required for ARM contract for Autoscaling. :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku """ - super(PartialMinimalTrackedResourceWithSku, self).__init__(tags=tags, **kwargs) + super(PartialMinimalTrackedResourceWithSku, self).__init__( + tags=tags, **kwargs + ) self.sku = sku @@ -18830,11 +20157,14 @@ class PartialRegistryPartialTrackedResource(msrest.serialization.Model): """ _attribute_map = { - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'object'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "identity": { + "key": "identity", + "type": "PartialManagedServiceIdentity", + }, + "kind": {"key": "kind", "type": "str"}, + "properties": {"key": "properties", "type": "object"}, + "sku": {"key": "sku", "type": "PartialSku"}, + "tags": {"key": "tags", "type": "{str}"}, } def __init__( @@ -18889,11 +20219,11 @@ class PartialSku(msrest.serialization.Model): """ _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'int'}, - 'family': {'key': 'family', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, + "capacity": {"key": "capacity", "type": "int"}, + "family": {"key": "family", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "size": {"key": "size", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, } def __init__( @@ -18943,27 +20273,25 @@ class Password(msrest.serialization.Model): """ _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, + "name": {"readonly": True}, + "value": {"readonly": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "value": {"key": "value", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Password, self).__init__(**kwargs) self.name = None self.value = None -class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class PATAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """PATAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -18988,16 +20316,19 @@ class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionPersonalAccessToken'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionPersonalAccessToken", + }, } def __init__( @@ -19026,8 +20357,14 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken """ - super(PATAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'PAT' # type: str + super(PATAuthTypeWorkspaceConnectionProperties, self).__init__( + category=category, + target=target, + value=value, + value_format=value_format, + **kwargs + ) + self.auth_type = "PAT" # type: str self.credentials = credentials @@ -19039,14 +20376,11 @@ class PersonalComputeInstanceSettings(msrest.serialization.Model): """ _attribute_map = { - 'assigned_user': {'key': 'assignedUser', 'type': 'AssignedUser'}, + "assigned_user": {"key": "assignedUser", "type": "AssignedUser"}, } def __init__( - self, - *, - assigned_user: Optional["AssignedUser"] = None, - **kwargs + self, *, assigned_user: Optional["AssignedUser"] = None, **kwargs ): """ :keyword assigned_user: A user explicitly assigned to a personal compute instance. @@ -19107,28 +20441,28 @@ class PipelineJob(JobBaseProperties): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, + "job_type": {"required": True}, + "status": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'jobs': {'key': 'jobs', 'type': '{object}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'settings': {'key': 'settings', 'type': 'object'}, - 'source_job_id': {'key': 'sourceJobId', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "jobs": {"key": "jobs", "type": "{object}"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "settings": {"key": "settings", "type": "object"}, + "source_job_id": {"key": "sourceJobId", "type": "str"}, } def __init__( @@ -19187,8 +20521,20 @@ def __init__( :keyword source_job_id: ARM resource ID of source job. :paramtype source_job_id: str """ - super(PipelineJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, services=services, **kwargs) - self.job_type = 'Pipeline' # type: str + super(PipelineJob, self).__init__( + description=description, + properties=properties, + tags=tags, + component_id=component_id, + compute_id=compute_id, + display_name=display_name, + experiment_name=experiment_name, + identity=identity, + is_archived=is_archived, + services=services, + **kwargs + ) + self.job_type = "Pipeline" # type: str self.inputs = inputs self.jobs = jobs self.outputs = outputs @@ -19208,21 +20554,17 @@ class PrivateEndpoint(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'subnet_arm_id': {'readonly': True}, + "id": {"readonly": True}, + "subnet_arm_id": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'subnet_arm_id': {'key': 'subnetArmId', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "subnet_arm_id": {"key": "subnetArmId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(PrivateEndpoint, self).__init__(**kwargs) self.id = None self.subnet_arm_id = None @@ -19265,25 +20607,34 @@ class PrivateEndpointConnection(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "private_endpoint": { + "key": "properties.privateEndpoint", + "type": "PrivateEndpoint", + }, + "private_link_service_connection_state": { + "key": "properties.privateLinkServiceConnectionState", + "type": "PrivateLinkServiceConnectionState", + }, + "provisioning_state": { + "key": "properties.provisioningState", + "type": "str", + }, } def __init__( @@ -19294,7 +20645,9 @@ def __init__( tags: Optional[Dict[str, str]] = None, sku: Optional["Sku"] = None, private_endpoint: Optional["PrivateEndpoint"] = None, - private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, + private_link_service_connection_state: Optional[ + "PrivateLinkServiceConnectionState" + ] = None, **kwargs ): """ @@ -19319,7 +20672,9 @@ def __init__( self.tags = tags self.sku = sku self.private_endpoint = private_endpoint - self.private_link_service_connection_state = private_link_service_connection_state + self.private_link_service_connection_state = ( + private_link_service_connection_state + ) self.provisioning_state = None @@ -19331,7 +20686,7 @@ class PrivateEndpointConnectionListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + "value": {"key": "value", "type": "[PrivateEndpointConnection]"}, } def __init__( @@ -19363,10 +20718,10 @@ class PrivateEndpointDestination(msrest.serialization.Model): """ _attribute_map = { - 'service_resource_id': {'key': 'serviceResourceId', 'type': 'str'}, - 'subresource_target': {'key': 'subresourceTarget', 'type': 'str'}, - 'spark_enabled': {'key': 'sparkEnabled', 'type': 'bool'}, - 'spark_status': {'key': 'sparkStatus', 'type': 'str'}, + "service_resource_id": {"key": "serviceResourceId", "type": "str"}, + "subresource_target": {"key": "subresourceTarget", "type": "str"}, + "spark_enabled": {"key": "sparkEnabled", "type": "bool"}, + "spark_status": {"key": "sparkStatus", "type": "str"}, } def __init__( @@ -19417,14 +20772,17 @@ class PrivateEndpointOutboundRule(OutboundRule): """ _validation = { - 'type': {'required': True}, + "type": {"required": True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'PrivateEndpointDestination'}, + "type": {"key": "type", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "destination": { + "key": "destination", + "type": "PrivateEndpointDestination", + }, } def __init__( @@ -19446,8 +20804,10 @@ def __init__( managed network of a machine learning workspace. :paramtype destination: ~azure.mgmt.machinelearningservices.models.PrivateEndpointDestination """ - super(PrivateEndpointOutboundRule, self).__init__(status=status, category=category, **kwargs) - self.type = 'PrivateEndpoint' # type: str + super(PrivateEndpointOutboundRule, self).__init__( + status=status, category=category, **kwargs + ) + self.type = "PrivateEndpoint" # type: str self.destination = destination @@ -19484,26 +20844,32 @@ class PrivateLinkResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'group_id': {'readonly': True}, - 'required_members': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "group_id": {"readonly": True}, + "required_members": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, - 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "group_id": {"key": "properties.groupId", "type": "str"}, + "required_members": { + "key": "properties.requiredMembers", + "type": "[str]", + }, + "required_zone_names": { + "key": "properties.requiredZoneNames", + "type": "[str]", + }, } def __init__( @@ -19546,14 +20912,11 @@ class PrivateLinkResourceListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + "value": {"key": "value", "type": "[PrivateLinkResource]"}, } def __init__( - self, - *, - value: Optional[List["PrivateLinkResource"]] = None, - **kwargs + self, *, value: Optional[List["PrivateLinkResource"]] = None, **kwargs ): """ :keyword value: Array of private link resources. @@ -19579,15 +20942,17 @@ class PrivateLinkServiceConnectionState(msrest.serialization.Model): """ _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + "status": {"key": "status", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "actions_required": {"key": "actionsRequired", "type": "str"}, } def __init__( self, *, - status: Optional[Union[str, "PrivateEndpointServiceConnectionStatus"]] = None, + status: Optional[ + Union[str, "PrivateEndpointServiceConnectionStatus"] + ] = None, description: Optional[str] = None, actions_required: Optional[str] = None, **kwargs @@ -19626,11 +20991,11 @@ class ProbeSettings(msrest.serialization.Model): """ _attribute_map = { - 'failure_threshold': {'key': 'failureThreshold', 'type': 'int'}, - 'initial_delay': {'key': 'initialDelay', 'type': 'duration'}, - 'period': {'key': 'period', 'type': 'duration'}, - 'success_threshold': {'key': 'successThreshold', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "failure_threshold": {"key": "failureThreshold", "type": "int"}, + "initial_delay": {"key": "initialDelay", "type": "duration"}, + "period": {"key": "period", "type": "duration"}, + "success_threshold": {"key": "successThreshold", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } def __init__( @@ -19681,25 +21046,33 @@ class ProgressMetrics(msrest.serialization.Model): """ _validation = { - 'completed_datapoint_count': {'readonly': True}, - 'incremental_data_last_refresh_date_time': {'readonly': True}, - 'skipped_datapoint_count': {'readonly': True}, - 'total_datapoint_count': {'readonly': True}, + "completed_datapoint_count": {"readonly": True}, + "incremental_data_last_refresh_date_time": {"readonly": True}, + "skipped_datapoint_count": {"readonly": True}, + "total_datapoint_count": {"readonly": True}, } _attribute_map = { - 'completed_datapoint_count': {'key': 'completedDatapointCount', 'type': 'long'}, - 'incremental_data_last_refresh_date_time': {'key': 'incrementalDataLastRefreshDateTime', 'type': 'iso-8601'}, - 'skipped_datapoint_count': {'key': 'skippedDatapointCount', 'type': 'long'}, - 'total_datapoint_count': {'key': 'totalDatapointCount', 'type': 'long'}, + "completed_datapoint_count": { + "key": "completedDatapointCount", + "type": "long", + }, + "incremental_data_last_refresh_date_time": { + "key": "incrementalDataLastRefreshDateTime", + "type": "iso-8601", + }, + "skipped_datapoint_count": { + "key": "skippedDatapointCount", + "type": "long", + }, + "total_datapoint_count": { + "key": "totalDatapointCount", + "type": "long", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ProgressMetrics, self).__init__(**kwargs) self.completed_datapoint_count = None self.incremental_data_last_refresh_date_time = None @@ -19720,26 +21093,26 @@ class PyTorch(DistributionConfiguration): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, + "distribution_type": {"key": "distributionType", "type": "str"}, + "process_count_per_instance": { + "key": "processCountPerInstance", + "type": "int", + }, } def __init__( - self, - *, - process_count_per_instance: Optional[int] = None, - **kwargs + self, *, process_count_per_instance: Optional[int] = None, **kwargs ): """ :keyword process_count_per_instance: Number of processes per node. :paramtype process_count_per_instance: int """ super(PyTorch, self).__init__(**kwargs) - self.distribution_type = 'PyTorch' # type: str + self.distribution_type = "PyTorch" # type: str self.process_count_per_instance = process_count_per_instance @@ -19757,10 +21130,10 @@ class QuotaBaseProperties(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "limit": {"key": "limit", "type": "long"}, + "unit": {"key": "unit", "type": "str"}, } def __init__( @@ -19800,8 +21173,8 @@ class QuotaUpdateParameters(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[QuotaBaseProperties]'}, - 'location': {'key': 'location', 'type': 'str'}, + "value": {"key": "value", "type": "[QuotaBaseProperties]"}, + "location": {"key": "location", "type": "str"}, } def __init__( @@ -19842,14 +21215,17 @@ class RandomSamplingAlgorithm(SamplingAlgorithm): """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - 'logbase': {'key': 'logbase', 'type': 'str'}, - 'rule': {'key': 'rule', 'type': 'str'}, - 'seed': {'key': 'seed', 'type': 'int'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, + "logbase": {"key": "logbase", "type": "str"}, + "rule": {"key": "rule", "type": "str"}, + "seed": {"key": "seed", "type": "int"}, } def __init__( @@ -19871,7 +21247,7 @@ def __init__( :paramtype seed: int """ super(RandomSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Random' # type: str + self.sampling_algorithm_type = "Random" # type: str self.logbase = logbase self.rule = rule self.seed = seed @@ -19893,15 +21269,15 @@ class RecurrenceSchedule(msrest.serialization.Model): """ _validation = { - 'hours': {'required': True}, - 'minutes': {'required': True}, + "hours": {"required": True}, + "minutes": {"required": True}, } _attribute_map = { - 'hours': {'key': 'hours', 'type': '[int]'}, - 'minutes': {'key': 'minutes', 'type': '[int]'}, - 'month_days': {'key': 'monthDays', 'type': '[int]'}, - 'week_days': {'key': 'weekDays', 'type': '[str]'}, + "hours": {"key": "hours", "type": "[int]"}, + "minutes": {"key": "minutes", "type": "[int]"}, + "month_days": {"key": "monthDays", "type": "[int]"}, + "week_days": {"key": "weekDays", "type": "[str]"}, } def __init__( @@ -19960,19 +21336,19 @@ class RecurrenceTrigger(TriggerBase): """ _validation = { - 'trigger_type': {'required': True}, - 'frequency': {'required': True}, - 'interval': {'required': True}, + "trigger_type": {"required": True}, + "frequency": {"required": True}, + "interval": {"required": True}, } _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceSchedule'}, + "end_time": {"key": "endTime", "type": "str"}, + "start_time": {"key": "startTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "trigger_type": {"key": "triggerType", "type": "str"}, + "frequency": {"key": "frequency", "type": "str"}, + "interval": {"key": "interval", "type": "int"}, + "schedule": {"key": "schedule", "type": "RecurrenceSchedule"}, } def __init__( @@ -20008,8 +21384,13 @@ def __init__( :keyword schedule: The recurrence schedule. :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule """ - super(RecurrenceTrigger, self).__init__(end_time=end_time, start_time=start_time, time_zone=time_zone, **kwargs) - self.trigger_type = 'Recurrence' # type: str + super(RecurrenceTrigger, self).__init__( + end_time=end_time, + start_time=start_time, + time_zone=time_zone, + **kwargs + ) + self.trigger_type = "Recurrence" # type: str self.frequency = frequency self.interval = interval self.schedule = schedule @@ -20028,12 +21409,12 @@ class RegenerateEndpointKeysRequest(msrest.serialization.Model): """ _validation = { - 'key_type': {'required': True}, + "key_type": {"required": True}, } _attribute_map = { - 'key_type': {'key': 'keyType', 'type': 'str'}, - 'key_value': {'key': 'keyValue', 'type': 'str'}, + "key_type": {"key": "keyType", "type": "str"}, + "key_value": {"key": "keyValue", "type": "str"}, } def __init__( @@ -20089,25 +21470,25 @@ class Registry(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'RegistryProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": {"key": "properties", "type": "RegistryProperties"}, + "sku": {"key": "sku", "type": "Sku"}, } def __init__( @@ -20157,21 +21538,18 @@ class RegistryListCredentialsResult(msrest.serialization.Model): """ _validation = { - 'location': {'readonly': True}, - 'username': {'readonly': True}, + "location": {"readonly": True}, + "username": {"readonly": True}, } _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'username': {'key': 'username', 'type': 'str'}, - 'passwords': {'key': 'passwords', 'type': '[Password]'}, + "location": {"key": "location", "type": "str"}, + "username": {"key": "username", "type": "str"}, + "passwords": {"key": "passwords", "type": "[Password]"}, } def __init__( - self, - *, - passwords: Optional[List["Password"]] = None, - **kwargs + self, *, passwords: Optional[List["Password"]] = None, **kwargs ): """ :keyword passwords: @@ -20213,17 +21591,29 @@ class RegistryProperties(ResourceBase): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, - 'discovery_url': {'key': 'discoveryUrl', 'type': 'str'}, - 'intellectual_property_publisher': {'key': 'intellectualPropertyPublisher', 'type': 'str'}, - 'managed_resource_group': {'key': 'managedResourceGroup', 'type': 'ArmResourceId'}, - 'ml_flow_registry_uri': {'key': 'mlFlowRegistryUri', 'type': 'str'}, - 'private_link_count': {'key': 'privateLinkCount', 'type': 'int'}, - 'region_details': {'key': 'regionDetails', 'type': '[RegistryRegionArmDetails]'}, - 'managed_resource_group_tags': {'key': 'managedResourceGroupTags', 'type': '{str}'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "public_network_access": {"key": "publicNetworkAccess", "type": "str"}, + "discovery_url": {"key": "discoveryUrl", "type": "str"}, + "intellectual_property_publisher": { + "key": "intellectualPropertyPublisher", + "type": "str", + }, + "managed_resource_group": { + "key": "managedResourceGroup", + "type": "ArmResourceId", + }, + "ml_flow_registry_uri": {"key": "mlFlowRegistryUri", "type": "str"}, + "private_link_count": {"key": "privateLinkCount", "type": "int"}, + "region_details": { + "key": "regionDetails", + "type": "[RegistryRegionArmDetails]", + }, + "managed_resource_group_tags": { + "key": "managedResourceGroupTags", + "type": "{str}", + }, } def __init__( @@ -20268,7 +21658,9 @@ def __init__( associated with this registry. :paramtype managed_resource_group_tags: dict[str, str] """ - super(RegistryProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + super(RegistryProperties, self).__init__( + description=description, properties=properties, tags=tags, **kwargs + ) self.public_network_access = public_network_access self.discovery_url = discovery_url self.intellectual_property_publisher = intellectual_property_publisher @@ -20292,9 +21684,12 @@ class RegistryRegionArmDetails(msrest.serialization.Model): """ _attribute_map = { - 'acr_details': {'key': 'acrDetails', 'type': '[AcrDetails]'}, - 'location': {'key': 'location', 'type': 'str'}, - 'storage_account_details': {'key': 'storageAccountDetails', 'type': '[StorageAccountDetails]'}, + "acr_details": {"key": "acrDetails", "type": "[AcrDetails]"}, + "location": {"key": "location", "type": "str"}, + "storage_account_details": { + "key": "storageAccountDetails", + "type": "[StorageAccountDetails]", + }, } def __init__( @@ -20302,7 +21697,9 @@ def __init__( *, acr_details: Optional[List["AcrDetails"]] = None, location: Optional[str] = None, - storage_account_details: Optional[List["StorageAccountDetails"]] = None, + storage_account_details: Optional[ + List["StorageAccountDetails"] + ] = None, **kwargs ): """ @@ -20331,8 +21728,8 @@ class RegistryTrackedResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Registry]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[Registry]"}, } def __init__( @@ -20349,7 +21746,9 @@ def __init__( :keyword value: An array of objects of type Registry. :paramtype value: list[~azure.mgmt.machinelearningservices.models.Registry] """ - super(RegistryTrackedResourceArmPaginatedResult, self).__init__(**kwargs) + super(RegistryTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -20418,29 +21817,56 @@ class Regression(AutoMLVertical, TableVertical): """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'RegressionTrainingSettings'}, + "task_type": {"required": True}, + "training_data": {"required": True}, + } + + _attribute_map = { + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "TableFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "search_space": { + "key": "searchSpace", + "type": "[TableParameterSubspace]", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "TableSweepSettings", + }, + "test_data": {"key": "testData", "type": "MLTableJobInput"}, + "test_data_size": {"key": "testDataSize", "type": "float"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "weight_column_name": {"key": "weightColumnName", "type": "str"}, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, + "training_settings": { + "key": "trainingSettings", + "type": "RegressionTrainingSettings", + }, } def __init__( @@ -20448,7 +21874,9 @@ def __init__( *, training_data: "MLTableJobInput", cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "TableVerticalFeaturizationSettings" + ] = None, fixed_parameters: Optional["TableFixedParameters"] = None, limit_settings: Optional["TableVerticalLimitSettings"] = None, n_cross_validations: Optional["NCrossValidations"] = None, @@ -20461,7 +21889,9 @@ def __init__( weight_column_name: Optional[str] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "RegressionPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "RegressionPrimaryMetrics"] + ] = None, training_settings: Optional["RegressionTrainingSettings"] = None, **kwargs ): @@ -20521,7 +21951,24 @@ def __init__( :paramtype training_settings: ~azure.mgmt.machinelearningservices.models.RegressionTrainingSettings """ - super(Regression, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, cv_split_column_names=cv_split_column_names, featurization_settings=featurization_settings, fixed_parameters=fixed_parameters, limit_settings=limit_settings, n_cross_validations=n_cross_validations, search_space=search_space, sweep_settings=sweep_settings, test_data=test_data, test_data_size=test_data_size, validation_data=validation_data, validation_data_size=validation_data_size, weight_column_name=weight_column_name, **kwargs) + super(Regression, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + cv_split_column_names=cv_split_column_names, + featurization_settings=featurization_settings, + fixed_parameters=fixed_parameters, + limit_settings=limit_settings, + n_cross_validations=n_cross_validations, + search_space=search_space, + sweep_settings=sweep_settings, + test_data=test_data, + test_data_size=test_data_size, + validation_data=validation_data, + validation_data_size=validation_data_size, + weight_column_name=weight_column_name, + **kwargs + ) self.cv_split_column_names = cv_split_column_names self.featurization_settings = featurization_settings self.fixed_parameters = fixed_parameters @@ -20534,7 +21981,7 @@ def __init__( self.validation_data = validation_data self.validation_data_size = validation_data_size self.weight_column_name = weight_column_name - self.task_type = 'Regression' # type: str + self.task_type = "Regression" # type: str self.primary_metric = primary_metric self.training_settings = training_settings self.log_verbosity = log_verbosity @@ -20579,16 +22026,37 @@ class RegressionTrainingSettings(TrainingSettings): """ _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, + "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, + "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, + "training_mode": {"key": "trainingMode", "type": "str"}, + "allowed_training_algorithms": { + "key": "allowedTrainingAlgorithms", + "type": "[str]", + }, + "blocked_training_algorithms": { + "key": "blockedTrainingAlgorithms", + "type": "[str]", + }, } def __init__( @@ -20602,8 +22070,12 @@ def __init__( ensemble_model_download_timeout: Optional[datetime.timedelta] = "PT5M", stack_ensemble_settings: Optional["StackEnsembleSettings"] = None, training_mode: Optional[Union[str, "TrainingMode"]] = None, - allowed_training_algorithms: Optional[List[Union[str, "RegressionModels"]]] = None, - blocked_training_algorithms: Optional[List[Union[str, "RegressionModels"]]] = None, + allowed_training_algorithms: Optional[ + List[Union[str, "RegressionModels"]] + ] = None, + blocked_training_algorithms: Optional[ + List[Union[str, "RegressionModels"]] + ] = None, **kwargs ): """ @@ -20639,7 +22111,17 @@ def __init__( :paramtype blocked_training_algorithms: list[str or ~azure.mgmt.machinelearningservices.models.RegressionModels] """ - super(RegressionTrainingSettings, self).__init__(enable_dnn_training=enable_dnn_training, enable_model_explainability=enable_model_explainability, enable_onnx_compatible_models=enable_onnx_compatible_models, enable_stack_ensemble=enable_stack_ensemble, enable_vote_ensemble=enable_vote_ensemble, ensemble_model_download_timeout=ensemble_model_download_timeout, stack_ensemble_settings=stack_ensemble_settings, training_mode=training_mode, **kwargs) + super(RegressionTrainingSettings, self).__init__( + enable_dnn_training=enable_dnn_training, + enable_model_explainability=enable_model_explainability, + enable_onnx_compatible_models=enable_onnx_compatible_models, + enable_stack_ensemble=enable_stack_ensemble, + enable_vote_ensemble=enable_vote_ensemble, + ensemble_model_download_timeout=ensemble_model_download_timeout, + stack_ensemble_settings=stack_ensemble_settings, + training_mode=training_mode, + **kwargs + ) self.allowed_training_algorithms = allowed_training_algorithms self.blocked_training_algorithms = blocked_training_algorithms @@ -20654,19 +22136,14 @@ class ResourceId(msrest.serialization.Model): """ _validation = { - 'id': {'required': True}, + "id": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, } - def __init__( - self, - *, - id: str, - **kwargs - ): + def __init__(self, *, id: str, **kwargs): """ :keyword id: Required. The ID of the resource. :paramtype id: str @@ -20687,21 +22164,17 @@ class ResourceName(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, + "value": {"readonly": True}, + "localized_value": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + "value": {"key": "value", "type": "str"}, + "localized_value": {"key": "localizedValue", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ResourceName, self).__init__(**kwargs) self.value = None self.localized_value = None @@ -20727,29 +22200,28 @@ class ResourceQuota(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'name': {'readonly': True}, - 'limit': {'readonly': True}, - 'unit': {'readonly': True}, + "id": {"readonly": True}, + "aml_workspace_location": {"readonly": True}, + "type": {"readonly": True}, + "name": {"readonly": True}, + "limit": {"readonly": True}, + "unit": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'ResourceName'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "aml_workspace_location": { + "key": "amlWorkspaceLocation", + "type": "str", + }, + "type": {"key": "type", "type": "str"}, + "name": {"key": "name", "type": "ResourceName"}, + "limit": {"key": "limit", "type": "long"}, + "unit": {"key": "unit", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ResourceQuota, self).__init__(**kwargs) self.id = None self.aml_workspace_location = None @@ -20771,22 +22243,16 @@ class Route(msrest.serialization.Model): """ _validation = { - 'path': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'port': {'required': True}, + "path": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "port": {"required": True}, } _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, + "path": {"key": "path", "type": "str"}, + "port": {"key": "port", "type": "int"}, } - def __init__( - self, - *, - path: str, - port: int, - **kwargs - ): + def __init__(self, *, path: str, port: int, **kwargs): """ :keyword path: Required. [Required] The path for the route. :paramtype path: str @@ -20798,7 +22264,9 @@ def __init__( self.port = port -class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class SASAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """SASAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -20823,16 +22291,19 @@ class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionSharedAccessSignature'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionSharedAccessSignature", + }, } def __init__( @@ -20842,7 +22313,9 @@ def __init__( target: Optional[str] = None, value: Optional[str] = None, value_format: Optional[Union[str, "ValueFormat"]] = None, - credentials: Optional["WorkspaceConnectionSharedAccessSignature"] = None, + credentials: Optional[ + "WorkspaceConnectionSharedAccessSignature" + ] = None, **kwargs ): """ @@ -20861,8 +22334,14 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature """ - super(SASAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'SAS' # type: str + super(SASAuthTypeWorkspaceConnectionProperties, self).__init__( + category=category, + target=target, + value=value, + value_format=value_format, + **kwargs + ) + self.auth_type = "SAS" # type: str self.credentials = credentials @@ -20880,27 +22359,22 @@ class SasDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, + "credentials_type": {"required": True}, + "secrets": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'SasDatastoreSecrets'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "secrets": {"key": "secrets", "type": "SasDatastoreSecrets"}, } - def __init__( - self, - *, - secrets: "SasDatastoreSecrets", - **kwargs - ): + def __init__(self, *, secrets: "SasDatastoreSecrets", **kwargs): """ :keyword secrets: Required. [Required] Storage container secrets. :paramtype secrets: ~azure.mgmt.machinelearningservices.models.SasDatastoreSecrets """ super(SasDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Sas' # type: str + self.credentials_type = "Sas" # type: str self.secrets = secrets @@ -20918,26 +22392,21 @@ class SasDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'sas_token': {'key': 'sasToken', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "sas_token": {"key": "sasToken", "type": "str"}, } - def __init__( - self, - *, - sas_token: Optional[str] = None, - **kwargs - ): + def __init__(self, *, sas_token: Optional[str] = None, **kwargs): """ :keyword sas_token: Storage container SAS token. :paramtype sas_token: str """ super(SasDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Sas' # type: str + self.secrets_type = "Sas" # type: str self.sas_token = sas_token @@ -20956,13 +22425,16 @@ class ScaleSettings(msrest.serialization.Model): """ _validation = { - 'max_node_count': {'required': True}, + "max_node_count": {"required": True}, } _attribute_map = { - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'node_idle_time_before_scale_down': {'key': 'nodeIdleTimeBeforeScaleDown', 'type': 'duration'}, + "max_node_count": {"key": "maxNodeCount", "type": "int"}, + "min_node_count": {"key": "minNodeCount", "type": "int"}, + "node_idle_time_before_scale_down": { + "key": "nodeIdleTimeBeforeScaleDown", + "type": "duration", + }, } def __init__( @@ -20985,7 +22457,9 @@ def __init__( super(ScaleSettings, self).__init__(**kwargs) self.max_node_count = max_node_count self.min_node_count = min_node_count - self.node_idle_time_before_scale_down = node_idle_time_before_scale_down + self.node_idle_time_before_scale_down = ( + node_idle_time_before_scale_down + ) class ScaleSettingsInformation(msrest.serialization.Model): @@ -20996,14 +22470,11 @@ class ScaleSettingsInformation(msrest.serialization.Model): """ _attribute_map = { - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, + "scale_settings": {"key": "scaleSettings", "type": "ScaleSettings"}, } def __init__( - self, - *, - scale_settings: Optional["ScaleSettings"] = None, - **kwargs + self, *, scale_settings: Optional["ScaleSettings"] = None, **kwargs ): """ :keyword scale_settings: scale settings for AML Compute. @@ -21036,27 +22507,22 @@ class Schedule(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ScheduleProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "ScheduleProperties"}, } - def __init__( - self, - *, - properties: "ScheduleProperties", - **kwargs - ): + def __init__(self, *, properties: "ScheduleProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ScheduleProperties @@ -21080,16 +22546,18 @@ class ScheduleBase(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "provisioning_status": {"key": "provisioningStatus", "type": "str"}, + "status": {"key": "status", "type": "str"}, } def __init__( self, *, id: Optional[str] = None, - provisioning_status: Optional[Union[str, "ScheduleProvisioningState"]] = None, + provisioning_status: Optional[ + Union[str, "ScheduleProvisioningState"] + ] = None, status: Optional[Union[str, "ScheduleStatus"]] = None, **kwargs ): @@ -21138,20 +22606,20 @@ class ScheduleProperties(ResourceBase): """ _validation = { - 'action': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'trigger': {'required': True}, + "action": {"required": True}, + "provisioning_state": {"readonly": True}, + "trigger": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'action': {'key': 'action', 'type': 'ScheduleActionBase'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'trigger': {'key': 'trigger', 'type': 'TriggerBase'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "action": {"key": "action", "type": "ScheduleActionBase"}, + "display_name": {"key": "displayName", "type": "str"}, + "is_enabled": {"key": "isEnabled", "type": "bool"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "trigger": {"key": "trigger", "type": "TriggerBase"}, } def __init__( @@ -21182,7 +22650,9 @@ def __init__( :keyword trigger: Required. [Required] Specifies the trigger details. :paramtype trigger: ~azure.mgmt.machinelearningservices.models.TriggerBase """ - super(ScheduleProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + super(ScheduleProperties, self).__init__( + description=description, properties=properties, tags=tags, **kwargs + ) self.action = action self.display_name = display_name self.is_enabled = is_enabled @@ -21201,8 +22671,8 @@ class ScheduleResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Schedule]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[Schedule]"}, } def __init__( @@ -21238,10 +22708,10 @@ class ScriptReference(msrest.serialization.Model): """ _attribute_map = { - 'script_source': {'key': 'scriptSource', 'type': 'str'}, - 'script_data': {'key': 'scriptData', 'type': 'str'}, - 'script_arguments': {'key': 'scriptArguments', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'str'}, + "script_source": {"key": "scriptSource", "type": "str"}, + "script_data": {"key": "scriptData", "type": "str"}, + "script_arguments": {"key": "scriptArguments", "type": "str"}, + "timeout": {"key": "timeout", "type": "str"}, } def __init__( @@ -21280,8 +22750,11 @@ class ScriptsToExecute(msrest.serialization.Model): """ _attribute_map = { - 'startup_script': {'key': 'startupScript', 'type': 'ScriptReference'}, - 'creation_script': {'key': 'creationScript', 'type': 'ScriptReference'}, + "startup_script": {"key": "startupScript", "type": "ScriptReference"}, + "creation_script": { + "key": "creationScript", + "type": "ScriptReference", + }, } def __init__( @@ -21310,14 +22783,11 @@ class ServiceManagedResourcesSettings(msrest.serialization.Model): """ _attribute_map = { - 'cosmos_db': {'key': 'cosmosDb', 'type': 'CosmosDbSettings'}, + "cosmos_db": {"key": "cosmosDb", "type": "CosmosDbSettings"}, } def __init__( - self, - *, - cosmos_db: Optional["CosmosDbSettings"] = None, - **kwargs + self, *, cosmos_db: Optional["CosmosDbSettings"] = None, **kwargs ): """ :keyword cosmos_db: The settings for the service managed cosmosdb account. @@ -21327,7 +22797,9 @@ def __init__( self.cosmos_db = cosmos_db -class ServicePrincipalAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class ServicePrincipalAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """ServicePrincipalAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -21352,16 +22824,19 @@ class ServicePrincipalAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionP """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionServicePrincipal'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionServicePrincipal", + }, } def __init__( @@ -21390,8 +22865,16 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionServicePrincipal """ - super(ServicePrincipalAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'ServicePrincipal' # type: str + super( + ServicePrincipalAuthTypeWorkspaceConnectionProperties, self + ).__init__( + category=category, + target=target, + value=value, + value_format=value_format, + **kwargs + ) + self.auth_type = "ServicePrincipal" # type: str self.credentials = credentials @@ -21417,19 +22900,22 @@ class ServicePrincipalDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, + "credentials_type": {"required": True}, + "client_id": {"required": True}, + "secrets": {"required": True}, + "tenant_id": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'ServicePrincipalDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "authority_url": {"key": "authorityUrl", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + "resource_url": {"key": "resourceUrl", "type": "str"}, + "secrets": { + "key": "secrets", + "type": "ServicePrincipalDatastoreSecrets", + }, + "tenant_id": {"key": "tenantId", "type": "str"}, } def __init__( @@ -21456,7 +22942,7 @@ def __init__( :paramtype tenant_id: str """ super(ServicePrincipalDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'ServicePrincipal' # type: str + self.credentials_type = "ServicePrincipal" # type: str self.authority_url = authority_url self.client_id = client_id self.resource_url = resource_url @@ -21478,26 +22964,21 @@ class ServicePrincipalDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "client_secret": {"key": "clientSecret", "type": "str"}, } - def __init__( - self, - *, - client_secret: Optional[str] = None, - **kwargs - ): + def __init__(self, *, client_secret: Optional[str] = None, **kwargs): """ :keyword client_secret: Service principal secret. :paramtype client_secret: str """ super(ServicePrincipalDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'ServicePrincipal' # type: str + self.secrets_type = "ServicePrincipal" # type: str self.client_secret = client_secret @@ -21513,9 +22994,9 @@ class ServiceTagDestination(msrest.serialization.Model): """ _attribute_map = { - 'service_tag': {'key': 'serviceTag', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'port_ranges': {'key': 'portRanges', 'type': 'str'}, + "service_tag": {"key": "serviceTag", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "port_ranges": {"key": "portRanges", "type": "str"}, } def __init__( @@ -21561,14 +23042,14 @@ class ServiceTagOutboundRule(OutboundRule): """ _validation = { - 'type': {'required': True}, + "type": {"required": True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'ServiceTagDestination'}, + "type": {"key": "type", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "destination": {"key": "destination", "type": "ServiceTagDestination"}, } def __init__( @@ -21590,8 +23071,10 @@ def __init__( network of a machine learning workspace. :paramtype destination: ~azure.mgmt.machinelearningservices.models.ServiceTagDestination """ - super(ServiceTagOutboundRule, self).__init__(status=status, category=category, **kwargs) - self.type = 'ServiceTag' # type: str + super(ServiceTagOutboundRule, self).__init__( + status=status, category=category, **kwargs + ) + self.type = "ServiceTag" # type: str self.destination = destination @@ -21603,14 +23086,11 @@ class SetupScripts(msrest.serialization.Model): """ _attribute_map = { - 'scripts': {'key': 'scripts', 'type': 'ScriptsToExecute'}, + "scripts": {"key": "scripts", "type": "ScriptsToExecute"}, } def __init__( - self, - *, - scripts: Optional["ScriptsToExecute"] = None, - **kwargs + self, *, scripts: Optional["ScriptsToExecute"] = None, **kwargs ): """ :keyword scripts: Customized setup scripts. @@ -21639,11 +23119,14 @@ class SharedPrivateLinkResource(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'private_link_resource_id': {'key': 'properties.privateLinkResourceId', 'type': 'str'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'request_message': {'key': 'properties.requestMessage', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "private_link_resource_id": { + "key": "properties.privateLinkResourceId", + "type": "str", + }, + "group_id": {"key": "properties.groupId", "type": "str"}, + "request_message": {"key": "properties.requestMessage", "type": "str"}, + "status": {"key": "properties.status", "type": "str"}, } def __init__( @@ -21653,7 +23136,9 @@ def __init__( private_link_resource_id: Optional[str] = None, group_id: Optional[str] = None, request_message: Optional[str] = None, - status: Optional[Union[str, "PrivateEndpointServiceConnectionStatus"]] = None, + status: Optional[ + Union[str, "PrivateEndpointServiceConnectionStatus"] + ] = None, **kwargs ): """ @@ -21702,15 +23187,15 @@ class Sku(msrest.serialization.Model): """ _validation = { - 'name': {'required': True}, + "name": {"required": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'int'}, + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, + "size": {"key": "size", "type": "str"}, + "family": {"key": "family", "type": "str"}, + "capacity": {"key": "capacity", "type": "int"}, } def __init__( @@ -21763,10 +23248,10 @@ class SkuCapacity(msrest.serialization.Model): """ _attribute_map = { - 'default': {'key': 'default', 'type': 'int'}, - 'maximum': {'key': 'maximum', 'type': 'int'}, - 'minimum': {'key': 'minimum', 'type': 'int'}, - 'scale_type': {'key': 'scaleType', 'type': 'str'}, + "default": {"key": "default", "type": "int"}, + "maximum": {"key": "maximum", "type": "int"}, + "minimum": {"key": "minimum", "type": "int"}, + "scale_type": {"key": "scaleType", "type": "str"}, } def __init__( @@ -21810,13 +23295,13 @@ class SkuResource(msrest.serialization.Model): """ _validation = { - 'resource_type': {'readonly': True}, + "resource_type": {"readonly": True}, } _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'SkuSetting'}, + "capacity": {"key": "capacity", "type": "SkuCapacity"}, + "resource_type": {"key": "resourceType", "type": "str"}, + "sku": {"key": "sku", "type": "SkuSetting"}, } def __init__( @@ -21849,8 +23334,8 @@ class SkuResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[SkuResource]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[SkuResource]"}, } def __init__( @@ -21887,12 +23372,12 @@ class SkuSetting(msrest.serialization.Model): """ _validation = { - 'name': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, } def __init__( @@ -21981,37 +23466,40 @@ class SparkJob(JobBaseProperties): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'code_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'entry': {'required': True}, + "job_type": {"required": True}, + "status": {"readonly": True}, + "code_id": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "entry": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'archives': {'key': 'archives', 'type': '[str]'}, - 'args': {'key': 'args', 'type': 'str'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'conf': {'key': 'conf', 'type': '{str}'}, - 'entry': {'key': 'entry', 'type': 'SparkJobEntry'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'files': {'key': 'files', 'type': '[str]'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'jars': {'key': 'jars', 'type': '[str]'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'py_files': {'key': 'pyFiles', 'type': '[str]'}, - 'resources': {'key': 'resources', 'type': 'SparkResourceConfiguration'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "archives": {"key": "archives", "type": "[str]"}, + "args": {"key": "args", "type": "str"}, + "code_id": {"key": "codeId", "type": "str"}, + "conf": {"key": "conf", "type": "{str}"}, + "entry": {"key": "entry", "type": "SparkJobEntry"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "files": {"key": "files", "type": "[str]"}, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "jars": {"key": "jars", "type": "[str]"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "py_files": {"key": "pyFiles", "type": "[str]"}, + "resources": { + "key": "resources", + "type": "SparkResourceConfiguration", + }, } def __init__( @@ -22091,8 +23579,20 @@ def __init__( :keyword resources: Compute Resource configuration for the job. :paramtype resources: ~azure.mgmt.machinelearningservices.models.SparkResourceConfiguration """ - super(SparkJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, services=services, **kwargs) - self.job_type = 'Spark' # type: str + super(SparkJob, self).__init__( + description=description, + properties=properties, + tags=tags, + component_id=component_id, + compute_id=compute_id, + display_name=display_name, + experiment_name=experiment_name, + identity=identity, + is_archived=is_archived, + services=services, + **kwargs + ) + self.job_type = "Spark" # type: str self.archives = archives self.args = args self.code_id = code_id @@ -22122,23 +23622,22 @@ class SparkJobEntry(msrest.serialization.Model): """ _validation = { - 'spark_job_entry_type': {'required': True}, + "spark_job_entry_type": {"required": True}, } _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, + "spark_job_entry_type": {"key": "sparkJobEntryType", "type": "str"}, } _subtype_map = { - 'spark_job_entry_type': {'SparkJobPythonEntry': 'SparkJobPythonEntry', 'SparkJobScalaEntry': 'SparkJobScalaEntry'} + "spark_job_entry_type": { + "SparkJobPythonEntry": "SparkJobPythonEntry", + "SparkJobScalaEntry": "SparkJobScalaEntry", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(SparkJobEntry, self).__init__(**kwargs) self.spark_job_entry_type = None # type: Optional[str] @@ -22157,27 +23656,26 @@ class SparkJobPythonEntry(SparkJobEntry): """ _validation = { - 'spark_job_entry_type': {'required': True}, - 'file': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "spark_job_entry_type": {"required": True}, + "file": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - 'file': {'key': 'file', 'type': 'str'}, + "spark_job_entry_type": {"key": "sparkJobEntryType", "type": "str"}, + "file": {"key": "file", "type": "str"}, } - def __init__( - self, - *, - file: str, - **kwargs - ): + def __init__(self, *, file: str, **kwargs): """ :keyword file: Required. [Required] Relative python file path for job entry point. :paramtype file: str """ super(SparkJobPythonEntry, self).__init__(**kwargs) - self.spark_job_entry_type = 'SparkJobPythonEntry' # type: str + self.spark_job_entry_type = "SparkJobPythonEntry" # type: str self.file = file @@ -22195,27 +23693,26 @@ class SparkJobScalaEntry(SparkJobEntry): """ _validation = { - 'spark_job_entry_type': {'required': True}, - 'class_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "spark_job_entry_type": {"required": True}, + "class_name": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - 'class_name': {'key': 'className', 'type': 'str'}, + "spark_job_entry_type": {"key": "sparkJobEntryType", "type": "str"}, + "class_name": {"key": "className", "type": "str"}, } - def __init__( - self, - *, - class_name: str, - **kwargs - ): + def __init__(self, *, class_name: str, **kwargs): """ :keyword class_name: Required. [Required] Scala class name used as entry point. :paramtype class_name: str """ super(SparkJobScalaEntry, self).__init__(**kwargs) - self.spark_job_entry_type = 'SparkJobScalaEntry' # type: str + self.spark_job_entry_type = "SparkJobScalaEntry" # type: str self.class_name = class_name @@ -22229,8 +23726,8 @@ class SparkResourceConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, + "instance_type": {"key": "instanceType", "type": "str"}, + "runtime_version": {"key": "runtimeVersion", "type": "str"}, } def __init__( @@ -22270,12 +23767,15 @@ class SslConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'cert': {'key': 'cert', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - 'cname': {'key': 'cname', 'type': 'str'}, - 'leaf_domain_label': {'key': 'leafDomainLabel', 'type': 'str'}, - 'overwrite_existing_domain': {'key': 'overwriteExistingDomain', 'type': 'bool'}, + "status": {"key": "status", "type": "str"}, + "cert": {"key": "cert", "type": "str"}, + "key": {"key": "key", "type": "str"}, + "cname": {"key": "cname", "type": "str"}, + "leaf_domain_label": {"key": "leafDomainLabel", "type": "str"}, + "overwrite_existing_domain": { + "key": "overwriteExistingDomain", + "type": "bool", + }, } def __init__( @@ -22332,9 +23832,18 @@ class StackEnsembleSettings(msrest.serialization.Model): """ _attribute_map = { - 'stack_meta_learner_k_wargs': {'key': 'stackMetaLearnerKWargs', 'type': 'object'}, - 'stack_meta_learner_train_percentage': {'key': 'stackMetaLearnerTrainPercentage', 'type': 'float'}, - 'stack_meta_learner_type': {'key': 'stackMetaLearnerType', 'type': 'str'}, + "stack_meta_learner_k_wargs": { + "key": "stackMetaLearnerKWargs", + "type": "object", + }, + "stack_meta_learner_train_percentage": { + "key": "stackMetaLearnerTrainPercentage", + "type": "float", + }, + "stack_meta_learner_type": { + "key": "stackMetaLearnerType", + "type": "str", + }, } def __init__( @@ -22342,7 +23851,9 @@ def __init__( *, stack_meta_learner_k_wargs: Optional[Any] = None, stack_meta_learner_train_percentage: Optional[float] = 0.2, - stack_meta_learner_type: Optional[Union[str, "StackMetaLearnerType"]] = None, + stack_meta_learner_type: Optional[ + Union[str, "StackMetaLearnerType"] + ] = None, **kwargs ): """ @@ -22362,7 +23873,9 @@ def __init__( """ super(StackEnsembleSettings, self).__init__(**kwargs) self.stack_meta_learner_k_wargs = stack_meta_learner_k_wargs - self.stack_meta_learner_train_percentage = stack_meta_learner_train_percentage + self.stack_meta_learner_train_percentage = ( + stack_meta_learner_train_percentage + ) self.stack_meta_learner_type = stack_meta_learner_type @@ -22383,25 +23896,21 @@ class StatusMessage(msrest.serialization.Model): """ _validation = { - 'code': {'readonly': True}, - 'created_date_time': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, + "code": {"readonly": True}, + "created_date_time": {"readonly": True}, + "level": {"readonly": True}, + "message": {"readonly": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, + "code": {"key": "code", "type": "str"}, + "created_date_time": {"key": "createdDateTime", "type": "iso-8601"}, + "level": {"key": "level", "type": "str"}, + "message": {"key": "message", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(StatusMessage, self).__init__(**kwargs) self.code = None self.created_date_time = None @@ -22421,15 +23930,25 @@ class StorageAccountDetails(msrest.serialization.Model): """ _attribute_map = { - 'system_created_storage_account': {'key': 'systemCreatedStorageAccount', 'type': 'SystemCreatedStorageAccount'}, - 'user_created_storage_account': {'key': 'userCreatedStorageAccount', 'type': 'UserCreatedStorageAccount'}, + "system_created_storage_account": { + "key": "systemCreatedStorageAccount", + "type": "SystemCreatedStorageAccount", + }, + "user_created_storage_account": { + "key": "userCreatedStorageAccount", + "type": "UserCreatedStorageAccount", + }, } def __init__( self, *, - system_created_storage_account: Optional["SystemCreatedStorageAccount"] = None, - user_created_storage_account: Optional["UserCreatedStorageAccount"] = None, + system_created_storage_account: Optional[ + "SystemCreatedStorageAccount" + ] = None, + user_created_storage_account: Optional[ + "UserCreatedStorageAccount" + ] = None, **kwargs ): """ @@ -22504,35 +24023,41 @@ class SweepJob(JobBaseProperties): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'objective': {'required': True}, - 'sampling_algorithm': {'required': True}, - 'search_space': {'required': True}, - 'trial': {'required': True}, + "job_type": {"required": True}, + "status": {"readonly": True}, + "objective": {"required": True}, + "sampling_algorithm": {"required": True}, + "search_space": {"required": True}, + "trial": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'SweepJobLimits'}, - 'objective': {'key': 'objective', 'type': 'Objective'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'SamplingAlgorithm'}, - 'search_space': {'key': 'searchSpace', 'type': 'object'}, - 'trial': {'key': 'trial', 'type': 'TrialComponent'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "limits": {"key": "limits", "type": "SweepJobLimits"}, + "objective": {"key": "objective", "type": "Objective"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "sampling_algorithm": { + "key": "samplingAlgorithm", + "type": "SamplingAlgorithm", + }, + "search_space": {"key": "searchSpace", "type": "object"}, + "trial": {"key": "trial", "type": "TrialComponent"}, } def __init__( @@ -22602,8 +24127,20 @@ def __init__( :keyword trial: Required. [Required] Trial component definition. :paramtype trial: ~azure.mgmt.machinelearningservices.models.TrialComponent """ - super(SweepJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, services=services, **kwargs) - self.job_type = 'Sweep' # type: str + super(SweepJob, self).__init__( + description=description, + properties=properties, + tags=tags, + component_id=component_id, + compute_id=compute_id, + display_name=display_name, + experiment_name=experiment_name, + identity=identity, + is_archived=is_archived, + services=services, + **kwargs + ) + self.job_type = "Sweep" # type: str self.early_termination = early_termination self.inputs = inputs self.limits = limits @@ -22634,15 +24171,15 @@ class SweepJobLimits(JobLimits): """ _validation = { - 'job_limits_type': {'required': True}, + "job_limits_type": {"required": True}, } _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_total_trials': {'key': 'maxTotalTrials', 'type': 'int'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, + "job_limits_type": {"key": "jobLimitsType", "type": "str"}, + "timeout": {"key": "timeout", "type": "duration"}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_total_trials": {"key": "maxTotalTrials", "type": "int"}, + "trial_timeout": {"key": "trialTimeout", "type": "duration"}, } def __init__( @@ -22666,7 +24203,7 @@ def __init__( :paramtype trial_timeout: ~datetime.timedelta """ super(SweepJobLimits, self).__init__(timeout=timeout, **kwargs) - self.job_limits_type = 'Sweep' # type: str + self.job_limits_type = "Sweep" # type: str self.max_concurrent_trials = max_concurrent_trials self.max_total_trials = max_total_trials self.trial_timeout = trial_timeout @@ -22711,26 +24248,29 @@ class SynapseSpark(Compute): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'SynapseSparkProperties'}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, + "properties": {"key": "properties", "type": "SynapseSparkProperties"}, } def __init__( @@ -22756,8 +24296,14 @@ def __init__( :keyword properties: :paramtype properties: ~azure.mgmt.machinelearningservices.models.SynapseSparkProperties """ - super(SynapseSpark, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, **kwargs) - self.compute_type = 'SynapseSpark' # type: str + super(SynapseSpark, self).__init__( + compute_location=compute_location, + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + **kwargs + ) + self.compute_type = "SynapseSpark" # type: str self.properties = properties @@ -22787,16 +24333,22 @@ class SynapseSparkProperties(msrest.serialization.Model): """ _attribute_map = { - 'auto_scale_properties': {'key': 'autoScaleProperties', 'type': 'AutoScaleProperties'}, - 'auto_pause_properties': {'key': 'autoPauseProperties', 'type': 'AutoPauseProperties'}, - 'spark_version': {'key': 'sparkVersion', 'type': 'str'}, - 'node_count': {'key': 'nodeCount', 'type': 'int'}, - 'node_size': {'key': 'nodeSize', 'type': 'str'}, - 'node_size_family': {'key': 'nodeSizeFamily', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'workspace_name': {'key': 'workspaceName', 'type': 'str'}, - 'pool_name': {'key': 'poolName', 'type': 'str'}, + "auto_scale_properties": { + "key": "autoScaleProperties", + "type": "AutoScaleProperties", + }, + "auto_pause_properties": { + "key": "autoPauseProperties", + "type": "AutoPauseProperties", + }, + "spark_version": {"key": "sparkVersion", "type": "str"}, + "node_count": {"key": "nodeCount", "type": "int"}, + "node_size": {"key": "nodeSize", "type": "str"}, + "node_size_family": {"key": "nodeSizeFamily", "type": "str"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, + "resource_group": {"key": "resourceGroup", "type": "str"}, + "workspace_name": {"key": "workspaceName", "type": "str"}, + "pool_name": {"key": "poolName", "type": "str"}, } def __init__( @@ -22861,8 +24413,8 @@ class SystemCreatedAcrAccount(msrest.serialization.Model): """ _attribute_map = { - 'acr_account_sku': {'key': 'acrAccountSku', 'type': 'str'}, - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, + "acr_account_sku": {"key": "acrAccountSku", "type": "str"}, + "arm_resource_id": {"key": "armResourceId", "type": "ArmResourceId"}, } def __init__( @@ -22905,10 +24457,16 @@ class SystemCreatedStorageAccount(msrest.serialization.Model): """ _attribute_map = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - 'storage_account_hns_enabled': {'key': 'storageAccountHnsEnabled', 'type': 'bool'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, - 'allow_blob_public_access': {'key': 'allowBlobPublicAccess', 'type': 'bool'}, + "arm_resource_id": {"key": "armResourceId", "type": "ArmResourceId"}, + "storage_account_hns_enabled": { + "key": "storageAccountHnsEnabled", + "type": "bool", + }, + "storage_account_type": {"key": "storageAccountType", "type": "str"}, + "allow_blob_public_access": { + "key": "allowBlobPublicAccess", + "type": "bool", + }, } def __init__( @@ -22965,12 +24523,12 @@ class SystemData(msrest.serialization.Model): """ _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + "created_by": {"key": "createdBy", "type": "str"}, + "created_by_type": {"key": "createdByType", "type": "str"}, + "created_at": {"key": "createdAt", "type": "iso-8601"}, + "last_modified_by": {"key": "lastModifiedBy", "type": "str"}, + "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"}, + "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, } def __init__( @@ -23024,23 +24582,19 @@ class SystemService(msrest.serialization.Model): """ _validation = { - 'system_service_type': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'version': {'readonly': True}, + "system_service_type": {"readonly": True}, + "public_ip_address": {"readonly": True}, + "version": {"readonly": True}, } _attribute_map = { - 'system_service_type': {'key': 'systemServiceType', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, + "system_service_type": {"key": "systemServiceType", "type": "str"}, + "public_ip_address": {"key": "publicIpAddress", "type": "str"}, + "version": {"key": "version", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(SystemService, self).__init__(**kwargs) self.system_service_type = None self.public_ip_address = None @@ -23095,26 +24649,26 @@ class TableFixedParameters(msrest.serialization.Model): """ _attribute_map = { - 'booster': {'key': 'booster', 'type': 'str'}, - 'boosting_type': {'key': 'boostingType', 'type': 'str'}, - 'grow_policy': {'key': 'growPolicy', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'max_bin': {'key': 'maxBin', 'type': 'int'}, - 'max_depth': {'key': 'maxDepth', 'type': 'int'}, - 'max_leaves': {'key': 'maxLeaves', 'type': 'int'}, - 'min_data_in_leaf': {'key': 'minDataInLeaf', 'type': 'int'}, - 'min_split_gain': {'key': 'minSplitGain', 'type': 'float'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'n_estimators': {'key': 'nEstimators', 'type': 'int'}, - 'num_leaves': {'key': 'numLeaves', 'type': 'int'}, - 'preprocessor_name': {'key': 'preprocessorName', 'type': 'str'}, - 'reg_alpha': {'key': 'regAlpha', 'type': 'float'}, - 'reg_lambda': {'key': 'regLambda', 'type': 'float'}, - 'subsample': {'key': 'subsample', 'type': 'float'}, - 'subsample_freq': {'key': 'subsampleFreq', 'type': 'float'}, - 'tree_method': {'key': 'treeMethod', 'type': 'str'}, - 'with_mean': {'key': 'withMean', 'type': 'bool'}, - 'with_std': {'key': 'withStd', 'type': 'bool'}, + "booster": {"key": "booster", "type": "str"}, + "boosting_type": {"key": "boostingType", "type": "str"}, + "grow_policy": {"key": "growPolicy", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "float"}, + "max_bin": {"key": "maxBin", "type": "int"}, + "max_depth": {"key": "maxDepth", "type": "int"}, + "max_leaves": {"key": "maxLeaves", "type": "int"}, + "min_data_in_leaf": {"key": "minDataInLeaf", "type": "int"}, + "min_split_gain": {"key": "minSplitGain", "type": "float"}, + "model_name": {"key": "modelName", "type": "str"}, + "n_estimators": {"key": "nEstimators", "type": "int"}, + "num_leaves": {"key": "numLeaves", "type": "int"}, + "preprocessor_name": {"key": "preprocessorName", "type": "str"}, + "reg_alpha": {"key": "regAlpha", "type": "float"}, + "reg_lambda": {"key": "regLambda", "type": "float"}, + "subsample": {"key": "subsample", "type": "float"}, + "subsample_freq": {"key": "subsampleFreq", "type": "float"}, + "tree_method": {"key": "treeMethod", "type": "str"}, + "with_mean": {"key": "withMean", "type": "bool"}, + "with_std": {"key": "withStd", "type": "bool"}, } def __init__( @@ -23257,26 +24811,26 @@ class TableParameterSubspace(msrest.serialization.Model): """ _attribute_map = { - 'booster': {'key': 'booster', 'type': 'str'}, - 'boosting_type': {'key': 'boostingType', 'type': 'str'}, - 'grow_policy': {'key': 'growPolicy', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'max_bin': {'key': 'maxBin', 'type': 'str'}, - 'max_depth': {'key': 'maxDepth', 'type': 'str'}, - 'max_leaves': {'key': 'maxLeaves', 'type': 'str'}, - 'min_data_in_leaf': {'key': 'minDataInLeaf', 'type': 'str'}, - 'min_split_gain': {'key': 'minSplitGain', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'n_estimators': {'key': 'nEstimators', 'type': 'str'}, - 'num_leaves': {'key': 'numLeaves', 'type': 'str'}, - 'preprocessor_name': {'key': 'preprocessorName', 'type': 'str'}, - 'reg_alpha': {'key': 'regAlpha', 'type': 'str'}, - 'reg_lambda': {'key': 'regLambda', 'type': 'str'}, - 'subsample': {'key': 'subsample', 'type': 'str'}, - 'subsample_freq': {'key': 'subsampleFreq', 'type': 'str'}, - 'tree_method': {'key': 'treeMethod', 'type': 'str'}, - 'with_mean': {'key': 'withMean', 'type': 'str'}, - 'with_std': {'key': 'withStd', 'type': 'str'}, + "booster": {"key": "booster", "type": "str"}, + "boosting_type": {"key": "boostingType", "type": "str"}, + "grow_policy": {"key": "growPolicy", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "str"}, + "max_bin": {"key": "maxBin", "type": "str"}, + "max_depth": {"key": "maxDepth", "type": "str"}, + "max_leaves": {"key": "maxLeaves", "type": "str"}, + "min_data_in_leaf": {"key": "minDataInLeaf", "type": "str"}, + "min_split_gain": {"key": "minSplitGain", "type": "str"}, + "model_name": {"key": "modelName", "type": "str"}, + "n_estimators": {"key": "nEstimators", "type": "str"}, + "num_leaves": {"key": "numLeaves", "type": "str"}, + "preprocessor_name": {"key": "preprocessorName", "type": "str"}, + "reg_alpha": {"key": "regAlpha", "type": "str"}, + "reg_lambda": {"key": "regLambda", "type": "str"}, + "subsample": {"key": "subsample", "type": "str"}, + "subsample_freq": {"key": "subsampleFreq", "type": "str"}, + "tree_method": {"key": "treeMethod", "type": "str"}, + "with_mean": {"key": "withMean", "type": "str"}, + "with_std": {"key": "withStd", "type": "str"}, } def __init__( @@ -23385,12 +24939,15 @@ class TableSweepSettings(msrest.serialization.Model): """ _validation = { - 'sampling_algorithm': {'required': True}, + "sampling_algorithm": {"required": True}, } _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, + "sampling_algorithm": {"key": "samplingAlgorithm", "type": "str"}, } def __init__( @@ -23440,23 +24997,39 @@ class TableVerticalFeaturizationSettings(FeaturizationSettings): """ _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - 'blocked_transformers': {'key': 'blockedTransformers', 'type': '[str]'}, - 'column_name_and_types': {'key': 'columnNameAndTypes', 'type': '{str}'}, - 'enable_dnn_featurization': {'key': 'enableDnnFeaturization', 'type': 'bool'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'transformer_params': {'key': 'transformerParams', 'type': '{[ColumnTransformer]}'}, + "dataset_language": {"key": "datasetLanguage", "type": "str"}, + "blocked_transformers": { + "key": "blockedTransformers", + "type": "[str]", + }, + "column_name_and_types": { + "key": "columnNameAndTypes", + "type": "{str}", + }, + "enable_dnn_featurization": { + "key": "enableDnnFeaturization", + "type": "bool", + }, + "mode": {"key": "mode", "type": "str"}, + "transformer_params": { + "key": "transformerParams", + "type": "{[ColumnTransformer]}", + }, } def __init__( self, *, dataset_language: Optional[str] = None, - blocked_transformers: Optional[List[Union[str, "BlockedTransformers"]]] = None, + blocked_transformers: Optional[ + List[Union[str, "BlockedTransformers"]] + ] = None, column_name_and_types: Optional[Dict[str, str]] = None, enable_dnn_featurization: Optional[bool] = False, mode: Optional[Union[str, "FeaturizationMode"]] = None, - transformer_params: Optional[Dict[str, List["ColumnTransformer"]]] = None, + transformer_params: Optional[ + Dict[str, List["ColumnTransformer"]] + ] = None, **kwargs ): """ @@ -23482,7 +25055,9 @@ def __init__( :paramtype transformer_params: dict[str, list[~azure.mgmt.machinelearningservices.models.ColumnTransformer]] """ - super(TableVerticalFeaturizationSettings, self).__init__(dataset_language=dataset_language, **kwargs) + super(TableVerticalFeaturizationSettings, self).__init__( + dataset_language=dataset_language, **kwargs + ) self.blocked_transformers = blocked_transformers self.column_name_and_types = column_name_and_types self.enable_dnn_featurization = enable_dnn_featurization @@ -23517,16 +25092,22 @@ class TableVerticalLimitSettings(msrest.serialization.Model): """ _attribute_map = { - 'enable_early_termination': {'key': 'enableEarlyTermination', 'type': 'bool'}, - 'exit_score': {'key': 'exitScore', 'type': 'float'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_cores_per_trial': {'key': 'maxCoresPerTrial', 'type': 'int'}, - 'max_nodes': {'key': 'maxNodes', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'sweep_concurrent_trials': {'key': 'sweepConcurrentTrials', 'type': 'int'}, - 'sweep_trials': {'key': 'sweepTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, + "enable_early_termination": { + "key": "enableEarlyTermination", + "type": "bool", + }, + "exit_score": {"key": "exitScore", "type": "float"}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_cores_per_trial": {"key": "maxCoresPerTrial", "type": "int"}, + "max_nodes": {"key": "maxNodes", "type": "int"}, + "max_trials": {"key": "maxTrials", "type": "int"}, + "sweep_concurrent_trials": { + "key": "sweepConcurrentTrials", + "type": "int", + }, + "sweep_trials": {"key": "sweepTrials", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, + "trial_timeout": {"key": "trialTimeout", "type": "duration"}, } def __init__( @@ -23602,15 +25183,18 @@ class TargetUtilizationScaleSettings(OnlineScaleSettings): """ _validation = { - 'scale_type': {'required': True}, + "scale_type": {"required": True}, } _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - 'max_instances': {'key': 'maxInstances', 'type': 'int'}, - 'min_instances': {'key': 'minInstances', 'type': 'int'}, - 'polling_interval': {'key': 'pollingInterval', 'type': 'duration'}, - 'target_utilization_percentage': {'key': 'targetUtilizationPercentage', 'type': 'int'}, + "scale_type": {"key": "scaleType", "type": "str"}, + "max_instances": {"key": "maxInstances", "type": "int"}, + "min_instances": {"key": "minInstances", "type": "int"}, + "polling_interval": {"key": "pollingInterval", "type": "duration"}, + "target_utilization_percentage": { + "key": "targetUtilizationPercentage", + "type": "int", + }, } def __init__( @@ -23635,7 +25219,7 @@ def __init__( :paramtype target_utilization_percentage: int """ super(TargetUtilizationScaleSettings, self).__init__(**kwargs) - self.scale_type = 'TargetUtilization' # type: str + self.scale_type = "TargetUtilization" # type: str self.max_instances = max_instances self.min_instances = min_instances self.polling_interval = polling_interval @@ -23657,13 +25241,16 @@ class TensorFlow(DistributionConfiguration): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'parameter_server_count': {'key': 'parameterServerCount', 'type': 'int'}, - 'worker_count': {'key': 'workerCount', 'type': 'int'}, + "distribution_type": {"key": "distributionType", "type": "str"}, + "parameter_server_count": { + "key": "parameterServerCount", + "type": "int", + }, + "worker_count": {"key": "workerCount", "type": "int"}, } def __init__( @@ -23680,76 +25267,93 @@ def __init__( :paramtype worker_count: int """ super(TensorFlow, self).__init__(**kwargs) - self.distribution_type = 'TensorFlow' # type: str + self.distribution_type = "TensorFlow" # type: str self.parameter_server_count = parameter_server_count self.worker_count = worker_count class TextClassification(AutoMLVertical, NlpVertical): """Text Classification task in AutoML NLP vertical. -NLP - Natural Language Processing. + NLP - Natural Language Processing. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-Classification task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar fixed_parameters: Model/training parameters that will remain constant throughout + training. + :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] + :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric for Text-Classification task. Possible values include: + "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, + "task_type": {"required": True}, + "training_data": {"required": True}, } _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "NlpFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "search_space": { + "key": "searchSpace", + "type": "[NlpParameterSubspace]", + }, + "sweep_settings": {"key": "sweepSettings", "type": "NlpSweepSettings"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( self, *, training_data: "MLTableJobInput", - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "NlpVerticalFeaturizationSettings" + ] = None, fixed_parameters: Optional["NlpFixedParameters"] = None, limit_settings: Optional["NlpVerticalLimitSettings"] = None, search_space: Optional[List["NlpParameterSubspace"]] = None, @@ -23757,7 +25361,9 @@ def __init__( validation_data: Optional["MLTableJobInput"] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "ClassificationPrimaryMetrics"] + ] = None, **kwargs ): """ @@ -23790,14 +25396,25 @@ def __init__( :paramtype primary_metric: str or ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ - super(TextClassification, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, featurization_settings=featurization_settings, fixed_parameters=fixed_parameters, limit_settings=limit_settings, search_space=search_space, sweep_settings=sweep_settings, validation_data=validation_data, **kwargs) + super(TextClassification, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + featurization_settings=featurization_settings, + fixed_parameters=fixed_parameters, + limit_settings=limit_settings, + search_space=search_space, + sweep_settings=sweep_settings, + validation_data=validation_data, + **kwargs + ) self.featurization_settings = featurization_settings self.fixed_parameters = fixed_parameters self.limit_settings = limit_settings self.search_space = search_space self.sweep_settings = sweep_settings self.validation_data = validation_data - self.task_type = 'TextClassification' # type: str + self.task_type = "TextClassification" # type: str self.primary_metric = primary_metric self.log_verbosity = log_verbosity self.target_column_name = target_column_name @@ -23806,73 +25423,90 @@ def __init__( class TextClassificationMultilabel(AutoMLVertical, NlpVertical): """Text Classification Multilabel task in AutoML NLP vertical. -NLP - Natural Language Processing. + NLP - Natural Language Processing. - Variables are only populated by the server, and will be ignored when sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-Classification-Multilabel task. - Currently only Accuracy is supported as primary metric, hence user need not set it explicitly. - Possible values include: "AUCWeighted", "Accuracy", "NormMacroRecall", - "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar fixed_parameters: Model/training parameters that will remain constant throughout + training. + :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] + :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric for Text-Classification-Multilabel task. + Currently only Accuracy is supported as primary metric, hence user need not set it explicitly. + Possible values include: "AUCWeighted", "Accuracy", "NormMacroRecall", + "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted", "IOU". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - 'primary_metric': {'readonly': True}, + "task_type": {"required": True}, + "training_data": {"required": True}, + "primary_metric": {"readonly": True}, } _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "NlpFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "search_space": { + "key": "searchSpace", + "type": "[NlpParameterSubspace]", + }, + "sweep_settings": {"key": "sweepSettings", "type": "NlpSweepSettings"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( self, *, training_data: "MLTableJobInput", - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "NlpVerticalFeaturizationSettings" + ] = None, fixed_parameters: Optional["NlpFixedParameters"] = None, limit_settings: Optional["NlpVerticalLimitSettings"] = None, search_space: Optional[List["NlpParameterSubspace"]] = None, @@ -23907,14 +25541,25 @@ def __init__( :keyword training_data: Required. [Required] Training data input. :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ - super(TextClassificationMultilabel, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, featurization_settings=featurization_settings, fixed_parameters=fixed_parameters, limit_settings=limit_settings, search_space=search_space, sweep_settings=sweep_settings, validation_data=validation_data, **kwargs) + super(TextClassificationMultilabel, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + featurization_settings=featurization_settings, + fixed_parameters=fixed_parameters, + limit_settings=limit_settings, + search_space=search_space, + sweep_settings=sweep_settings, + validation_data=validation_data, + **kwargs + ) self.featurization_settings = featurization_settings self.fixed_parameters = fixed_parameters self.limit_settings = limit_settings self.search_space = search_space self.sweep_settings = sweep_settings self.validation_data = validation_data - self.task_type = 'TextClassificationMultilabel' # type: str + self.task_type = "TextClassificationMultilabel" # type: str self.primary_metric = None self.log_verbosity = log_verbosity self.target_column_name = target_column_name @@ -23923,74 +25568,91 @@ def __init__( class TextNer(AutoMLVertical, NlpVertical): """Text-NER task in AutoML NLP vertical. -NER - Named Entity Recognition. -NLP - Natural Language Processing. + NER - Named Entity Recognition. + NLP - Natural Language Processing. - Variables are only populated by the server, and will be ignored when sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-NER task. - Only 'Accuracy' is supported for Text-NER, so user need not set this explicitly. Possible - values include: "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar fixed_parameters: Model/training parameters that will remain constant throughout + training. + :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] + :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric for Text-NER task. + Only 'Accuracy' is supported for Text-NER, so user need not set this explicitly. Possible + values include: "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - 'primary_metric': {'readonly': True}, + "task_type": {"required": True}, + "training_data": {"required": True}, + "primary_metric": {"readonly": True}, } _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "NlpFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "search_space": { + "key": "searchSpace", + "type": "[NlpParameterSubspace]", + }, + "sweep_settings": {"key": "sweepSettings", "type": "NlpSweepSettings"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( self, *, training_data: "MLTableJobInput", - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "NlpVerticalFeaturizationSettings" + ] = None, fixed_parameters: Optional["NlpFixedParameters"] = None, limit_settings: Optional["NlpVerticalLimitSettings"] = None, search_space: Optional[List["NlpParameterSubspace"]] = None, @@ -24025,14 +25687,25 @@ def __init__( :keyword training_data: Required. [Required] Training data input. :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ - super(TextNer, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, featurization_settings=featurization_settings, fixed_parameters=fixed_parameters, limit_settings=limit_settings, search_space=search_space, sweep_settings=sweep_settings, validation_data=validation_data, **kwargs) + super(TextNer, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + featurization_settings=featurization_settings, + fixed_parameters=fixed_parameters, + limit_settings=limit_settings, + search_space=search_space, + sweep_settings=sweep_settings, + validation_data=validation_data, + **kwargs + ) self.featurization_settings = featurization_settings self.fixed_parameters = fixed_parameters self.limit_settings = limit_settings self.search_space = search_space self.sweep_settings = sweep_settings self.validation_data = validation_data - self.task_type = 'TextNER' # type: str + self.task_type = "TextNER" # type: str self.primary_metric = None self.log_verbosity = log_verbosity self.target_column_name = target_column_name @@ -24047,15 +25720,10 @@ class TmpfsOptions(msrest.serialization.Model): """ _attribute_map = { - 'size': {'key': 'size', 'type': 'int'}, + "size": {"key": "size", "type": "int"}, } - def __init__( - self, - *, - size: Optional[int] = None, - **kwargs - ): + def __init__(self, *, size: Optional[int] = None, **kwargs): """ :keyword size: Mention the Tmpfs size. :paramtype size: int @@ -24087,17 +25755,27 @@ class TrialComponent(msrest.serialization.Model): """ _validation = { - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "command": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "environment_id": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, + "code_id": {"key": "codeId", "type": "str"}, + "command": {"key": "command", "type": "str"}, + "distribution": { + "key": "distribution", + "type": "DistributionConfiguration", + }, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "resources": {"key": "resources", "type": "JobResourceConfiguration"}, } def __init__( @@ -24156,15 +25834,15 @@ class TritonModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -24184,10 +25862,12 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(TritonModelJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(TritonModelJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'triton_model' # type: str + self.job_input_type = "triton_model" # type: str self.description = description @@ -24214,16 +25894,16 @@ class TritonModelJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "asset_name": {"key": "assetName", "type": "str"}, + "asset_version": {"key": "assetVersion", "type": "str"}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -24249,12 +25929,19 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(TritonModelJobOutput, self).__init__(description=description, asset_name=asset_name, asset_version=asset_version, mode=mode, uri=uri, **kwargs) + super(TritonModelJobOutput, self).__init__( + description=description, + asset_name=asset_name, + asset_version=asset_version, + mode=mode, + uri=uri, + **kwargs + ) self.asset_name = asset_name self.asset_version = asset_version self.mode = mode self.uri = uri - self.job_output_type = 'triton_model' # type: str + self.job_output_type = "triton_model" # type: str self.description = description @@ -24276,14 +25963,17 @@ class TruncationSelectionPolicy(EarlyTerminationPolicy): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'truncation_percentage': {'key': 'truncationPercentage', 'type': 'int'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, + "truncation_percentage": { + "key": "truncationPercentage", + "type": "int", + }, } def __init__( @@ -24302,8 +25992,12 @@ def __init__( :keyword truncation_percentage: The percentage of runs to cancel at each evaluation interval. :paramtype truncation_percentage: int """ - super(TruncationSelectionPolicy, self).__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs) - self.policy_type = 'TruncationSelection' # type: str + super(TruncationSelectionPolicy, self).__init__( + delay_evaluation=delay_evaluation, + evaluation_interval=evaluation_interval, + **kwargs + ) + self.policy_type = "TruncationSelection" # type: str self.truncation_percentage = truncation_percentage @@ -24328,17 +26022,17 @@ class UpdateWorkspaceQuotas(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, + "id": {"readonly": True}, + "type": {"readonly": True}, + "unit": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "limit": {"key": "limit", "type": "long"}, + "unit": {"key": "unit", "type": "str"}, + "status": {"key": "status", "type": "str"}, } def __init__( @@ -24378,21 +26072,17 @@ class UpdateWorkspaceQuotasResult(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[UpdateWorkspaceQuotas]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[UpdateWorkspaceQuotas]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UpdateWorkspaceQuotasResult, self).__init__(**kwargs) self.value = None self.next_link = None @@ -24422,18 +26112,18 @@ class UriFileDataVersion(DataVersionBaseProperties): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, } def __init__( @@ -24462,8 +26152,16 @@ def __init__( https://go.microsoft.com/fwlink/?linkid=2202330. :paramtype data_uri: str """ - super(UriFileDataVersion, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, **kwargs) - self.data_type = 'uri_file' # type: str + super(UriFileDataVersion, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + data_uri=data_uri, + **kwargs + ) + self.data_type = "uri_file" # type: str class UriFileJobInput(JobInput, AssetJobInput): @@ -24485,15 +26183,15 @@ class UriFileJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -24513,10 +26211,12 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(UriFileJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(UriFileJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'uri_file' # type: str + self.job_input_type = "uri_file" # type: str self.description = description @@ -24543,16 +26243,16 @@ class UriFileJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "asset_name": {"key": "assetName", "type": "str"}, + "asset_version": {"key": "assetVersion", "type": "str"}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -24578,12 +26278,19 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(UriFileJobOutput, self).__init__(description=description, asset_name=asset_name, asset_version=asset_version, mode=mode, uri=uri, **kwargs) + super(UriFileJobOutput, self).__init__( + description=description, + asset_name=asset_name, + asset_version=asset_version, + mode=mode, + uri=uri, + **kwargs + ) self.asset_name = asset_name self.asset_version = asset_version self.mode = mode self.uri = uri - self.job_output_type = 'uri_file' # type: str + self.job_output_type = "uri_file" # type: str self.description = description @@ -24611,18 +26318,18 @@ class UriFolderDataVersion(DataVersionBaseProperties): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, } def __init__( @@ -24651,8 +26358,16 @@ def __init__( https://go.microsoft.com/fwlink/?linkid=2202330. :paramtype data_uri: str """ - super(UriFolderDataVersion, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, **kwargs) - self.data_type = 'uri_folder' # type: str + super(UriFolderDataVersion, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + data_uri=data_uri, + **kwargs + ) + self.data_type = "uri_folder" # type: str class UriFolderJobInput(JobInput, AssetJobInput): @@ -24674,15 +26389,15 @@ class UriFolderJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -24702,10 +26417,12 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(UriFolderJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(UriFolderJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'uri_folder' # type: str + self.job_input_type = "uri_folder" # type: str self.description = description @@ -24732,16 +26449,16 @@ class UriFolderJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "asset_name": {"key": "assetName", "type": "str"}, + "asset_version": {"key": "assetVersion", "type": "str"}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -24767,12 +26484,19 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(UriFolderJobOutput, self).__init__(description=description, asset_name=asset_name, asset_version=asset_version, mode=mode, uri=uri, **kwargs) + super(UriFolderJobOutput, self).__init__( + description=description, + asset_name=asset_name, + asset_version=asset_version, + mode=mode, + uri=uri, + **kwargs + ) self.asset_name = asset_name self.asset_version = asset_version self.mode = mode self.uri = uri - self.job_output_type = 'uri_folder' # type: str + self.job_output_type = "uri_folder" # type: str self.description = description @@ -24798,31 +26522,30 @@ class Usage(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, + "id": {"readonly": True}, + "aml_workspace_location": {"readonly": True}, + "type": {"readonly": True}, + "unit": {"readonly": True}, + "current_value": {"readonly": True}, + "limit": {"readonly": True}, + "name": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'current_value': {'key': 'currentValue', 'type': 'long'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'name': {'key': 'name', 'type': 'UsageName'}, + "id": {"key": "id", "type": "str"}, + "aml_workspace_location": { + "key": "amlWorkspaceLocation", + "type": "str", + }, + "type": {"key": "type", "type": "str"}, + "unit": {"key": "unit", "type": "str"}, + "current_value": {"key": "currentValue", "type": "long"}, + "limit": {"key": "limit", "type": "long"}, + "name": {"key": "name", "type": "UsageName"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Usage, self).__init__(**kwargs) self.id = None self.aml_workspace_location = None @@ -24845,21 +26568,17 @@ class UsageName(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, + "value": {"readonly": True}, + "localized_value": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + "value": {"key": "value", "type": "str"}, + "localized_value": {"key": "localizedValue", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UsageName, self).__init__(**kwargs) self.value = None self.localized_value = None @@ -24880,13 +26599,16 @@ class UserAccountCredentials(msrest.serialization.Model): """ _validation = { - 'admin_user_name': {'required': True}, + "admin_user_name": {"required": True}, } _attribute_map = { - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'admin_user_ssh_public_key': {'key': 'adminUserSshPublicKey', 'type': 'str'}, - 'admin_user_password': {'key': 'adminUserPassword', 'type': 'str'}, + "admin_user_name": {"key": "adminUserName", "type": "str"}, + "admin_user_ssh_public_key": { + "key": "adminUserSshPublicKey", + "type": "str", + }, + "admin_user_password": {"key": "adminUserPassword", "type": "str"}, } def __init__( @@ -24924,21 +26646,17 @@ class UserAssignedIdentity(msrest.serialization.Model): """ _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, + "principal_id": {"readonly": True}, + "client_id": {"readonly": True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, + "principal_id": {"key": "principalId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UserAssignedIdentity, self).__init__(**kwargs) self.principal_id = None self.client_id = None @@ -24952,14 +26670,11 @@ class UserCreatedAcrAccount(msrest.serialization.Model): """ _attribute_map = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, + "arm_resource_id": {"key": "armResourceId", "type": "ArmResourceId"}, } def __init__( - self, - *, - arm_resource_id: Optional["ArmResourceId"] = None, - **kwargs + self, *, arm_resource_id: Optional["ArmResourceId"] = None, **kwargs ): """ :keyword arm_resource_id: ARM ResourceId of a resource. @@ -24977,14 +26692,11 @@ class UserCreatedStorageAccount(msrest.serialization.Model): """ _attribute_map = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, + "arm_resource_id": {"key": "armResourceId", "type": "ArmResourceId"}, } def __init__( - self, - *, - arm_resource_id: Optional["ArmResourceId"] = None, - **kwargs + self, *, arm_resource_id: Optional["ArmResourceId"] = None, **kwargs ): """ :keyword arm_resource_id: ARM ResourceId of a resource. @@ -25006,24 +26718,22 @@ class UserIdentity(IdentityConfiguration): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UserIdentity, self).__init__(**kwargs) - self.identity_type = 'UserIdentity' # type: str + self.identity_type = "UserIdentity" # type: str -class UsernamePasswordAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class UsernamePasswordAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """UsernamePasswordAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -25048,16 +26758,19 @@ class UsernamePasswordAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionP """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionUsernamePassword'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionUsernamePassword", + }, } def __init__( @@ -25086,8 +26799,16 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword """ - super(UsernamePasswordAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'UsernamePassword' # type: str + super( + UsernamePasswordAuthTypeWorkspaceConnectionProperties, self + ).__init__( + category=category, + target=target, + value=value, + value_format=value_format, + **kwargs + ) + self.auth_type = "UsernamePassword" # type: str self.credentials = credentials @@ -25099,7 +26820,10 @@ class VirtualMachineSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, + "properties": { + "key": "properties", + "type": "VirtualMachineSchemaProperties", + }, } def __init__( @@ -25156,26 +26880,32 @@ class VirtualMachine(Compute, VirtualMachineSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": { + "key": "properties", + "type": "VirtualMachineSchemaProperties", + }, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -25202,9 +26932,16 @@ def __init__( MSI and AAD exclusively for authentication. :paramtype disable_local_auth: bool """ - super(VirtualMachine, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) + super(VirtualMachine, self).__init__( + compute_location=compute_location, + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'VirtualMachine' # type: str + self.compute_type = "VirtualMachine" # type: str self.compute_location = compute_location self.provisioning_state = None self.description = description @@ -25226,19 +26963,14 @@ class VirtualMachineImage(msrest.serialization.Model): """ _validation = { - 'id': {'required': True}, + "id": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, } - def __init__( - self, - *, - id: str, - **kwargs - ): + def __init__(self, *, id: str, **kwargs): """ :keyword id: Required. Virtual Machine image path. :paramtype id: str @@ -25267,12 +26999,18 @@ class VirtualMachineSchemaProperties(msrest.serialization.Model): """ _attribute_map = { - 'virtual_machine_size': {'key': 'virtualMachineSize', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'notebook_server_port': {'key': 'notebookServerPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'is_notebook_instance_compute': {'key': 'isNotebookInstanceCompute', 'type': 'bool'}, + "virtual_machine_size": {"key": "virtualMachineSize", "type": "str"}, + "ssh_port": {"key": "sshPort", "type": "int"}, + "notebook_server_port": {"key": "notebookServerPort", "type": "int"}, + "address": {"key": "address", "type": "str"}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, + "is_notebook_instance_compute": { + "key": "isNotebookInstanceCompute", + "type": "bool", + }, } def __init__( @@ -25320,7 +27058,10 @@ class VirtualMachineSecretsSchema(msrest.serialization.Model): """ _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, } def __init__( @@ -25353,12 +27094,15 @@ class VirtualMachineSecrets(ComputeSecrets, VirtualMachineSecretsSchema): """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, + "compute_type": {"key": "computeType", "type": "str"}, } def __init__( @@ -25372,9 +27116,11 @@ def __init__( :paramtype administrator_account: ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials """ - super(VirtualMachineSecrets, self).__init__(administrator_account=administrator_account, **kwargs) + super(VirtualMachineSecrets, self).__init__( + administrator_account=administrator_account, **kwargs + ) self.administrator_account = administrator_account - self.compute_type = 'VirtualMachine' # type: str + self.compute_type = "VirtualMachine" # type: str class VirtualMachineSize(msrest.serialization.Model): @@ -25409,29 +27155,38 @@ class VirtualMachineSize(msrest.serialization.Model): """ _validation = { - 'name': {'readonly': True}, - 'family': {'readonly': True}, - 'v_cp_us': {'readonly': True}, - 'gpus': {'readonly': True}, - 'os_vhd_size_mb': {'readonly': True}, - 'max_resource_volume_mb': {'readonly': True}, - 'memory_gb': {'readonly': True}, - 'low_priority_capable': {'readonly': True}, - 'premium_io': {'readonly': True}, + "name": {"readonly": True}, + "family": {"readonly": True}, + "v_cp_us": {"readonly": True}, + "gpus": {"readonly": True}, + "os_vhd_size_mb": {"readonly": True}, + "max_resource_volume_mb": {"readonly": True}, + "memory_gb": {"readonly": True}, + "low_priority_capable": {"readonly": True}, + "premium_io": {"readonly": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'v_cp_us': {'key': 'vCPUs', 'type': 'int'}, - 'gpus': {'key': 'gpus', 'type': 'int'}, - 'os_vhd_size_mb': {'key': 'osVhdSizeMB', 'type': 'int'}, - 'max_resource_volume_mb': {'key': 'maxResourceVolumeMB', 'type': 'int'}, - 'memory_gb': {'key': 'memoryGB', 'type': 'float'}, - 'low_priority_capable': {'key': 'lowPriorityCapable', 'type': 'bool'}, - 'premium_io': {'key': 'premiumIO', 'type': 'bool'}, - 'estimated_vm_prices': {'key': 'estimatedVMPrices', 'type': 'EstimatedVMPrices'}, - 'supported_compute_types': {'key': 'supportedComputeTypes', 'type': '[str]'}, + "name": {"key": "name", "type": "str"}, + "family": {"key": "family", "type": "str"}, + "v_cp_us": {"key": "vCPUs", "type": "int"}, + "gpus": {"key": "gpus", "type": "int"}, + "os_vhd_size_mb": {"key": "osVhdSizeMB", "type": "int"}, + "max_resource_volume_mb": { + "key": "maxResourceVolumeMB", + "type": "int", + }, + "memory_gb": {"key": "memoryGB", "type": "float"}, + "low_priority_capable": {"key": "lowPriorityCapable", "type": "bool"}, + "premium_io": {"key": "premiumIO", "type": "bool"}, + "estimated_vm_prices": { + "key": "estimatedVMPrices", + "type": "EstimatedVMPrices", + }, + "supported_compute_types": { + "key": "supportedComputeTypes", + "type": "[str]", + }, } def __init__( @@ -25470,14 +27225,11 @@ class VirtualMachineSizeListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[VirtualMachineSize]'}, + "value": {"key": "value", "type": "[VirtualMachineSize]"}, } def __init__( - self, - *, - value: Optional[List["VirtualMachineSize"]] = None, - **kwargs + self, *, value: Optional[List["VirtualMachineSize"]] = None, **kwargs ): """ :keyword value: The list of virtual machine sizes supported by AmlCompute. @@ -25501,10 +27253,10 @@ class VirtualMachineSshCredentials(msrest.serialization.Model): """ _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'public_key_data': {'key': 'publicKeyData', 'type': 'str'}, - 'private_key_data': {'key': 'privateKeyData', 'type': 'str'}, + "username": {"key": "username", "type": "str"}, + "password": {"key": "password", "type": "str"}, + "public_key_data": {"key": "publicKeyData", "type": "str"}, + "private_key_data": {"key": "privateKeyData", "type": "str"}, } def __init__( @@ -25556,14 +27308,14 @@ class VolumeDefinition(msrest.serialization.Model): """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'read_only': {'key': 'readOnly', 'type': 'bool'}, - 'source': {'key': 'source', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'consistency': {'key': 'consistency', 'type': 'str'}, - 'bind': {'key': 'bind', 'type': 'BindOptions'}, - 'volume': {'key': 'volume', 'type': 'VolumeOptions'}, - 'tmpfs': {'key': 'tmpfs', 'type': 'TmpfsOptions'}, + "type": {"key": "type", "type": "str"}, + "read_only": {"key": "readOnly", "type": "bool"}, + "source": {"key": "source", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "consistency": {"key": "consistency", "type": "str"}, + "bind": {"key": "bind", "type": "BindOptions"}, + "volume": {"key": "volume", "type": "VolumeOptions"}, + "tmpfs": {"key": "tmpfs", "type": "TmpfsOptions"}, } def __init__( @@ -25618,15 +27370,10 @@ class VolumeOptions(msrest.serialization.Model): """ _attribute_map = { - 'nocopy': {'key': 'nocopy', 'type': 'bool'}, + "nocopy": {"key": "nocopy", "type": "bool"}, } - def __init__( - self, - *, - nocopy: Optional[bool] = None, - **kwargs - ): + def __init__(self, *, nocopy: Optional[bool] = None, **kwargs): """ :keyword nocopy: Indicate whether volume is nocopy. :paramtype nocopy: bool @@ -25747,63 +27494,123 @@ class Workspace(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'workspace_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'service_provisioned_resource_group': {'readonly': True}, - 'private_link_count': {'readonly': True}, - 'private_endpoint_connections': {'readonly': True}, - 'notebook_info': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'storage_hns_enabled': {'readonly': True}, - 'ml_flow_tracking_uri': {'readonly': True}, - 'soft_deleted_at': {'readonly': True}, - 'scheduled_purge_date': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'key_vault': {'key': 'properties.keyVault', 'type': 'str'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'storage_account': {'key': 'properties.storageAccount', 'type': 'str'}, - 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionProperty'}, - 'hbi_workspace': {'key': 'properties.hbiWorkspace', 'type': 'bool'}, - 'service_provisioned_resource_group': {'key': 'properties.serviceProvisionedResourceGroup', 'type': 'str'}, - 'private_link_count': {'key': 'properties.privateLinkCount', 'type': 'int'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'allow_public_access_when_behind_vnet': {'key': 'properties.allowPublicAccessWhenBehindVnet', 'type': 'bool'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, - 'shared_private_link_resources': {'key': 'properties.sharedPrivateLinkResources', 'type': '[SharedPrivateLinkResource]'}, - 'notebook_info': {'key': 'properties.notebookInfo', 'type': 'NotebookResourceInfo'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, - 'storage_hns_enabled': {'key': 'properties.storageHnsEnabled', 'type': 'bool'}, - 'ml_flow_tracking_uri': {'key': 'properties.mlFlowTrackingUri', 'type': 'str'}, - 'v1_legacy_mode': {'key': 'properties.v1LegacyMode', 'type': 'bool'}, - 'soft_deleted_at': {'key': 'properties.softDeletedAt', 'type': 'str'}, - 'scheduled_purge_date': {'key': 'properties.scheduledPurgeDate', 'type': 'str'}, - 'system_datastores_auth_mode': {'key': 'properties.systemDatastoresAuthMode', 'type': 'str'}, - 'feature_store_settings': {'key': 'properties.featureStoreSettings', 'type': 'FeatureStoreSettings'}, - 'managed_network': {'key': 'properties.managedNetwork', 'type': 'ManagedNetworkSettings'}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "workspace_id": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "service_provisioned_resource_group": {"readonly": True}, + "private_link_count": {"readonly": True}, + "private_endpoint_connections": {"readonly": True}, + "notebook_info": {"readonly": True}, + "tenant_id": {"readonly": True}, + "storage_hns_enabled": {"readonly": True}, + "ml_flow_tracking_uri": {"readonly": True}, + "soft_deleted_at": {"readonly": True}, + "scheduled_purge_date": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "kind": {"key": "kind", "type": "str"}, + "workspace_id": {"key": "properties.workspaceId", "type": "str"}, + "description": {"key": "properties.description", "type": "str"}, + "friendly_name": {"key": "properties.friendlyName", "type": "str"}, + "key_vault": {"key": "properties.keyVault", "type": "str"}, + "application_insights": { + "key": "properties.applicationInsights", + "type": "str", + }, + "container_registry": { + "key": "properties.containerRegistry", + "type": "str", + }, + "storage_account": {"key": "properties.storageAccount", "type": "str"}, + "discovery_url": {"key": "properties.discoveryUrl", "type": "str"}, + "provisioning_state": { + "key": "properties.provisioningState", + "type": "str", + }, + "encryption": { + "key": "properties.encryption", + "type": "EncryptionProperty", + }, + "hbi_workspace": {"key": "properties.hbiWorkspace", "type": "bool"}, + "service_provisioned_resource_group": { + "key": "properties.serviceProvisionedResourceGroup", + "type": "str", + }, + "private_link_count": { + "key": "properties.privateLinkCount", + "type": "int", + }, + "image_build_compute": { + "key": "properties.imageBuildCompute", + "type": "str", + }, + "allow_public_access_when_behind_vnet": { + "key": "properties.allowPublicAccessWhenBehindVnet", + "type": "bool", + }, + "public_network_access": { + "key": "properties.publicNetworkAccess", + "type": "str", + }, + "private_endpoint_connections": { + "key": "properties.privateEndpointConnections", + "type": "[PrivateEndpointConnection]", + }, + "shared_private_link_resources": { + "key": "properties.sharedPrivateLinkResources", + "type": "[SharedPrivateLinkResource]", + }, + "notebook_info": { + "key": "properties.notebookInfo", + "type": "NotebookResourceInfo", + }, + "service_managed_resources_settings": { + "key": "properties.serviceManagedResourcesSettings", + "type": "ServiceManagedResourcesSettings", + }, + "primary_user_assigned_identity": { + "key": "properties.primaryUserAssignedIdentity", + "type": "str", + }, + "tenant_id": {"key": "properties.tenantId", "type": "str"}, + "storage_hns_enabled": { + "key": "properties.storageHnsEnabled", + "type": "bool", + }, + "ml_flow_tracking_uri": { + "key": "properties.mlFlowTrackingUri", + "type": "str", + }, + "v1_legacy_mode": {"key": "properties.v1LegacyMode", "type": "bool"}, + "soft_deleted_at": {"key": "properties.softDeletedAt", "type": "str"}, + "scheduled_purge_date": { + "key": "properties.scheduledPurgeDate", + "type": "str", + }, + "system_datastores_auth_mode": { + "key": "properties.systemDatastoresAuthMode", + "type": "str", + }, + "feature_store_settings": { + "key": "properties.featureStoreSettings", + "type": "FeatureStoreSettings", + }, + "managed_network": { + "key": "properties.managedNetwork", + "type": "ManagedNetworkSettings", + }, } def __init__( @@ -25825,9 +27632,15 @@ def __init__( hbi_workspace: Optional[bool] = False, image_build_compute: Optional[str] = None, allow_public_access_when_behind_vnet: Optional[bool] = False, - public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, - shared_private_link_resources: Optional[List["SharedPrivateLinkResource"]] = None, - service_managed_resources_settings: Optional["ServiceManagedResourcesSettings"] = None, + public_network_access: Optional[ + Union[str, "PublicNetworkAccess"] + ] = None, + shared_private_link_resources: Optional[ + List["SharedPrivateLinkResource"] + ] = None, + service_managed_resources_settings: Optional[ + "ServiceManagedResourcesSettings" + ] = None, primary_user_assigned_identity: Optional[str] = None, v1_legacy_mode: Optional[bool] = False, system_datastores_auth_mode: Optional[str] = None, @@ -25920,12 +27733,16 @@ def __init__( self.service_provisioned_resource_group = None self.private_link_count = None self.image_build_compute = image_build_compute - self.allow_public_access_when_behind_vnet = allow_public_access_when_behind_vnet + self.allow_public_access_when_behind_vnet = ( + allow_public_access_when_behind_vnet + ) self.public_network_access = public_network_access self.private_endpoint_connections = None self.shared_private_link_resources = shared_private_link_resources self.notebook_info = None - self.service_managed_resources_settings = service_managed_resources_settings + self.service_managed_resources_settings = ( + service_managed_resources_settings + ) self.primary_user_assigned_identity = primary_user_assigned_identity self.tenant_id = None self.storage_hns_enabled = None @@ -25948,8 +27765,8 @@ class WorkspaceConnectionAccessKey(msrest.serialization.Model): """ _attribute_map = { - 'access_key_id': {'key': 'accessKeyId', 'type': 'str'}, - 'secret_access_key': {'key': 'secretAccessKey', 'type': 'str'}, + "access_key_id": {"key": "accessKeyId", "type": "str"}, + "secret_access_key": {"key": "secretAccessKey", "type": "str"}, } def __init__( @@ -25980,8 +27797,8 @@ class WorkspaceConnectionManagedIdentity(msrest.serialization.Model): """ _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, + "resource_id": {"key": "resourceId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, } def __init__( @@ -26010,15 +27827,10 @@ class WorkspaceConnectionPersonalAccessToken(msrest.serialization.Model): """ _attribute_map = { - 'pat': {'key': 'pat', 'type': 'str'}, + "pat": {"key": "pat", "type": "str"}, } - def __init__( - self, - *, - pat: Optional[str] = None, - **kwargs - ): + def __init__(self, *, pat: Optional[str] = None, **kwargs): """ :keyword pat: :paramtype pat: str @@ -26050,37 +27862,41 @@ class WorkspaceConnectionPropertiesV2BasicResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'WorkspaceConnectionPropertiesV2'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "WorkspaceConnectionPropertiesV2", + }, } def __init__( - self, - *, - properties: "WorkspaceConnectionPropertiesV2", - **kwargs + self, *, properties: "WorkspaceConnectionPropertiesV2", **kwargs ): """ :keyword properties: Required. :paramtype properties: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 """ - super(WorkspaceConnectionPropertiesV2BasicResource, self).__init__(**kwargs) + super(WorkspaceConnectionPropertiesV2BasicResource, self).__init__( + **kwargs + ) self.properties = properties -class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(msrest.serialization.Model): +class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult( + msrest.serialization.Model +): """WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult. Variables are only populated by the server, and will be ignored when sending a request. @@ -26093,18 +27909,23 @@ class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(msrest.seri """ _validation = { - 'next_link': {'readonly': True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[WorkspaceConnectionPropertiesV2BasicResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": { + "key": "value", + "type": "[WorkspaceConnectionPropertiesV2BasicResource]", + }, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( self, *, - value: Optional[List["WorkspaceConnectionPropertiesV2BasicResource"]] = None, + value: Optional[ + List["WorkspaceConnectionPropertiesV2BasicResource"] + ] = None, **kwargs ): """ @@ -26112,7 +27933,10 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource] """ - super(WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, self).__init__(**kwargs) + super( + WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, + self, + ).__init__(**kwargs) self.value = value self.next_link = None @@ -26129,9 +27953,9 @@ class WorkspaceConnectionServicePrincipal(msrest.serialization.Model): """ _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + "client_id": {"key": "clientId", "type": "str"}, + "client_secret": {"key": "clientSecret", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, } def __init__( @@ -26164,20 +27988,17 @@ class WorkspaceConnectionSharedAccessSignature(msrest.serialization.Model): """ _attribute_map = { - 'sas': {'key': 'sas', 'type': 'str'}, + "sas": {"key": "sas", "type": "str"}, } - def __init__( - self, - *, - sas: Optional[str] = None, - **kwargs - ): + def __init__(self, *, sas: Optional[str] = None, **kwargs): """ :keyword sas: :paramtype sas: str """ - super(WorkspaceConnectionSharedAccessSignature, self).__init__(**kwargs) + super(WorkspaceConnectionSharedAccessSignature, self).__init__( + **kwargs + ) self.sas = sas @@ -26191,8 +28012,8 @@ class WorkspaceConnectionUsernamePassword(msrest.serialization.Model): """ _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, + "username": {"key": "username", "type": "str"}, + "password": {"key": "password", "type": "str"}, } def __init__( @@ -26225,8 +28046,8 @@ class WorkspaceListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[Workspace]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Workspace]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( @@ -26288,20 +28109,47 @@ class WorkspaceUpdateParameters(msrest.serialization.Model): """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionUpdateProperties'}, - 'feature_store_settings': {'key': 'properties.featureStoreSettings', 'type': 'FeatureStoreSettings'}, - 'managed_network': {'key': 'properties.managedNetwork', 'type': 'ManagedNetworkSettings'}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "description": {"key": "properties.description", "type": "str"}, + "friendly_name": {"key": "properties.friendlyName", "type": "str"}, + "image_build_compute": { + "key": "properties.imageBuildCompute", + "type": "str", + }, + "service_managed_resources_settings": { + "key": "properties.serviceManagedResourcesSettings", + "type": "ServiceManagedResourcesSettings", + }, + "primary_user_assigned_identity": { + "key": "properties.primaryUserAssignedIdentity", + "type": "str", + }, + "public_network_access": { + "key": "properties.publicNetworkAccess", + "type": "str", + }, + "application_insights": { + "key": "properties.applicationInsights", + "type": "str", + }, + "container_registry": { + "key": "properties.containerRegistry", + "type": "str", + }, + "encryption": { + "key": "properties.encryption", + "type": "EncryptionUpdateProperties", + }, + "feature_store_settings": { + "key": "properties.featureStoreSettings", + "type": "FeatureStoreSettings", + }, + "managed_network": { + "key": "properties.managedNetwork", + "type": "ManagedNetworkSettings", + }, } def __init__( @@ -26313,9 +28161,13 @@ def __init__( description: Optional[str] = None, friendly_name: Optional[str] = None, image_build_compute: Optional[str] = None, - service_managed_resources_settings: Optional["ServiceManagedResourcesSettings"] = None, + service_managed_resources_settings: Optional[ + "ServiceManagedResourcesSettings" + ] = None, primary_user_assigned_identity: Optional[str] = None, - public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, + public_network_access: Optional[ + Union[str, "PublicNetworkAccess"] + ] = None, application_insights: Optional[str] = None, container_registry: Optional[str] = None, encryption: Optional["EncryptionUpdateProperties"] = None, @@ -26366,7 +28218,9 @@ def __init__( self.description = description self.friendly_name = friendly_name self.image_build_compute = image_build_compute - self.service_managed_resources_settings = service_managed_resources_settings + self.service_managed_resources_settings = ( + service_managed_resources_settings + ) self.primary_user_assigned_identity = primary_user_assigned_identity self.public_network_access = public_network_access self.application_insights = application_insights diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/__init__.py index 3591226dc04e..145854760af9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/__init__.py @@ -12,21 +12,41 @@ from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations from ._quotas_operations import QuotasOperations from ._compute_operations import ComputeOperations -from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_endpoint_connections_operations import ( + PrivateEndpointConnectionsOperations, +) from ._private_link_resources_operations import PrivateLinkResourcesOperations from ._workspace_connections_operations import WorkspaceConnectionsOperations -from ._managed_network_settings_rule_operations import ManagedNetworkSettingsRuleOperations -from ._managed_network_provisions_operations import ManagedNetworkProvisionsOperations +from ._managed_network_settings_rule_operations import ( + ManagedNetworkSettingsRuleOperations, +) +from ._managed_network_provisions_operations import ( + ManagedNetworkProvisionsOperations, +) from ._registries_operations import RegistriesOperations from ._workspace_features_operations import WorkspaceFeaturesOperations -from ._registry_code_containers_operations import RegistryCodeContainersOperations +from ._registry_code_containers_operations import ( + RegistryCodeContainersOperations, +) from ._registry_code_versions_operations import RegistryCodeVersionsOperations -from ._registry_component_containers_operations import RegistryComponentContainersOperations -from ._registry_component_versions_operations import RegistryComponentVersionsOperations -from ._registry_environment_containers_operations import RegistryEnvironmentContainersOperations -from ._registry_environment_versions_operations import RegistryEnvironmentVersionsOperations -from ._registry_model_containers_operations import RegistryModelContainersOperations -from ._registry_model_versions_operations import RegistryModelVersionsOperations +from ._registry_component_containers_operations import ( + RegistryComponentContainersOperations, +) +from ._registry_component_versions_operations import ( + RegistryComponentVersionsOperations, +) +from ._registry_environment_containers_operations import ( + RegistryEnvironmentContainersOperations, +) +from ._registry_environment_versions_operations import ( + RegistryEnvironmentVersionsOperations, +) +from ._registry_model_containers_operations import ( + RegistryModelContainersOperations, +) +from ._registry_model_versions_operations import ( + RegistryModelVersionsOperations, +) from ._batch_endpoints_operations import BatchEndpointsOperations from ._batch_deployments_operations import BatchDeploymentsOperations from ._code_containers_operations import CodeContainersOperations @@ -47,43 +67,43 @@ from ._schedules_operations import SchedulesOperations __all__ = [ - 'Operations', - 'WorkspacesOperations', - 'UsagesOperations', - 'VirtualMachineSizesOperations', - 'QuotasOperations', - 'ComputeOperations', - 'PrivateEndpointConnectionsOperations', - 'PrivateLinkResourcesOperations', - 'WorkspaceConnectionsOperations', - 'ManagedNetworkSettingsRuleOperations', - 'ManagedNetworkProvisionsOperations', - 'RegistriesOperations', - 'WorkspaceFeaturesOperations', - 'RegistryCodeContainersOperations', - 'RegistryCodeVersionsOperations', - 'RegistryComponentContainersOperations', - 'RegistryComponentVersionsOperations', - 'RegistryEnvironmentContainersOperations', - 'RegistryEnvironmentVersionsOperations', - 'RegistryModelContainersOperations', - 'RegistryModelVersionsOperations', - 'BatchEndpointsOperations', - 'BatchDeploymentsOperations', - 'CodeContainersOperations', - 'CodeVersionsOperations', - 'ComponentContainersOperations', - 'ComponentVersionsOperations', - 'DataContainersOperations', - 'DataVersionsOperations', - 'DatastoresOperations', - 'EnvironmentContainersOperations', - 'EnvironmentVersionsOperations', - 'JobsOperations', - 'LabelingJobsOperations', - 'ModelContainersOperations', - 'ModelVersionsOperations', - 'OnlineEndpointsOperations', - 'OnlineDeploymentsOperations', - 'SchedulesOperations', + "Operations", + "WorkspacesOperations", + "UsagesOperations", + "VirtualMachineSizesOperations", + "QuotasOperations", + "ComputeOperations", + "PrivateEndpointConnectionsOperations", + "PrivateLinkResourcesOperations", + "WorkspaceConnectionsOperations", + "ManagedNetworkSettingsRuleOperations", + "ManagedNetworkProvisionsOperations", + "RegistriesOperations", + "WorkspaceFeaturesOperations", + "RegistryCodeContainersOperations", + "RegistryCodeVersionsOperations", + "RegistryComponentContainersOperations", + "RegistryComponentVersionsOperations", + "RegistryEnvironmentContainersOperations", + "RegistryEnvironmentVersionsOperations", + "RegistryModelContainersOperations", + "RegistryModelVersionsOperations", + "BatchEndpointsOperations", + "BatchDeploymentsOperations", + "CodeContainersOperations", + "CodeVersionsOperations", + "ComponentContainersOperations", + "ComponentVersionsOperations", + "DataContainersOperations", + "DataVersionsOperations", + "DatastoresOperations", + "EnvironmentContainersOperations", + "EnvironmentVersionsOperations", + "JobsOperations", + "LabelingJobsOperations", + "ModelContainersOperations", + "ModelVersionsOperations", + "OnlineEndpointsOperations", + "OnlineDeploymentsOperations", + "SchedulesOperations", ] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_batch_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_batch_deployments_operations.py index cc371e34fc1b..d3d22978697b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_batch_deployments_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_batch_deployments_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -250,6 +262,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class BatchDeploymentsOperations(object): """BatchDeploymentsOperations operations. @@ -308,16 +321,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.BatchDeploymentTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -327,13 +347,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -351,7 +371,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("BatchDeploymentTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "BatchDeploymentTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -360,25 +383,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -389,15 +418,18 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -405,34 +437,47 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -468,14 +513,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -483,29 +533,33 @@ def begin_delete( # pylint: disable=inconsistent-return-statements endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def get( @@ -534,15 +588,20 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.BatchDeployment :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -550,32 +609,39 @@ def get( endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize("BatchDeployment", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore def _update_initial( self, @@ -587,16 +653,27 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.BatchDeployment"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchDeployment"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.BatchDeployment"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties') + error_map.update(kwargs.pop("error_map", {})) + + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + + _json = self._serialize.body( + body, + "PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties", + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -607,40 +684,55 @@ def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def begin_update( @@ -682,15 +774,24 @@ def begin_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -700,32 +801,38 @@ def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore def _create_or_update_initial( self, @@ -737,16 +844,24 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.BatchDeployment" - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'BatchDeployment') + _json = self._serialize.body(body, "BatchDeployment") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -757,39 +872,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchDeployment', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -830,15 +961,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -848,29 +988,35 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_batch_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_batch_endpoints_operations.py index 0f6be031da72..4e606fd98f79 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_batch_endpoints_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_batch_endpoints_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -276,6 +288,7 @@ def build_list_keys_request( **kwargs ) + # fmt: on class BatchEndpointsOperations(object): """BatchEndpointsOperations operations. @@ -328,16 +341,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.BatchEndpointTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -345,13 +365,13 @@ def prepare_request(next_link=None): api_version=api_version, count=count, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -367,7 +387,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("BatchEndpointTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "BatchEndpointTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -376,25 +399,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -404,49 +433,65 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -479,43 +524,52 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace def get( @@ -541,47 +595,57 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.BatchEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize("BatchEndpoint", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore def _update_initial( self, @@ -592,16 +656,26 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.BatchEndpoint"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchEndpoint"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.BatchEndpoint"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') + _json = self._serialize.body( + body, "PartialMinimalTrackedResourceWithIdentity" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -611,40 +685,55 @@ def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace def begin_update( @@ -682,15 +771,22 @@ def begin_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -699,32 +795,38 @@ def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore def _create_or_update_initial( self, @@ -735,16 +837,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.BatchEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'BatchEndpoint') + _json = self._serialize.body(body, "BatchEndpoint") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -754,39 +862,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -823,15 +947,22 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -840,32 +971,38 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace def list_keys( @@ -891,44 +1028,56 @@ def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthKeys"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) + deserialized = self._deserialize("EndpointAuthKeys", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys"} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_code_containers_operations.py index b870e79ef42c..138357795e80 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_code_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_code_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -190,6 +202,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class CodeContainersOperations(object): """CodeContainersOperations operations. @@ -239,29 +252,36 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -276,7 +296,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -285,25 +307,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -329,43 +357,53 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore @distributed_trace def get( @@ -391,47 +429,57 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize("CodeContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore @distributed_trace def create_or_update( @@ -460,16 +508,22 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeContainer') + _json = self._serialize.body(body, "CodeContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -479,33 +533,44 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_code_versions_operations.py index b45078e91820..39ad224b3765 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_code_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_code_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -204,6 +216,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class CodeVersionsOperations(object): """CodeVersionsOperations operations. @@ -262,16 +275,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -281,13 +301,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -305,7 +325,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -314,25 +336,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -361,15 +389,18 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -377,28 +408,35 @@ def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -427,15 +465,18 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -443,32 +484,39 @@ def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace def create_or_update( @@ -500,16 +548,22 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeVersion') + _json = self._serialize.body(body, "CodeVersion") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -520,33 +574,40 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_component_containers_operations.py index 71ed5b6886f2..ea0eb95da0cf 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_component_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_component_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -193,6 +205,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class ComponentContainersOperations(object): """ComponentContainersOperations operations. @@ -245,16 +258,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -262,13 +282,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -284,7 +304,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -293,25 +316,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -337,43 +366,53 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore @distributed_trace def get( @@ -399,47 +438,61 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore @distributed_trace def create_or_update( @@ -468,16 +521,24 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentContainer') + _json = self._serialize.body(body, "ComponentContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -487,33 +548,44 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_component_versions_operations.py index 7b6d7b61a964..84191451197e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_component_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_component_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -207,6 +219,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class ComponentVersionsOperations(object): """ComponentVersionsOperations operations. @@ -268,16 +281,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -288,13 +308,13 @@ def prepare_request(next_link=None): top=top, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -313,7 +333,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -322,25 +344,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -369,15 +397,18 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -385,28 +416,35 @@ def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -435,15 +473,20 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -451,32 +494,39 @@ def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize("ComponentVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace def create_or_update( @@ -508,16 +558,24 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentVersion') + _json = self._serialize.body(body, "ComponentVersion") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -528,33 +586,44 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_compute_operations.py index 16bb1f63d3c6..f1a8ee8e6510 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_compute_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_compute_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -25,9 +31,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, List, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Iterable, + List, + Optional, + TypeVar, + Union, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -515,6 +536,7 @@ def build_update_idle_shutdown_setting_request( **kwargs ) + # fmt: on class ComputeOperations(object): """ComputeOperations operations. @@ -562,29 +584,36 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedComputeResourcesList] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedComputeResourcesList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedComputeResourcesList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -599,7 +628,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedComputeResourcesList", pipeline_response) + deserialized = self._deserialize( + "PaginatedComputeResourcesList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -608,25 +639,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes"} # type: ignore @distributed_trace def get( @@ -651,47 +688,59 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComputeResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize("ComputeResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore def _create_or_update_initial( self, @@ -702,16 +751,24 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.ComputeResource" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'ComputeResource') + _json = self._serialize.body(parameters, "ComputeResource") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -721,38 +778,49 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if response.status_code == 201: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComputeResource', pipeline_response) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -790,15 +858,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -807,32 +884,38 @@ def begin_create_or_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore def _update_initial( self, @@ -843,16 +926,24 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> "_models.ComputeResource" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'ClusterUpdateParameters') + _json = self._serialize.body(parameters, "ClusterUpdateParameters") request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -862,31 +953,36 @@ def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize("ComputeResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace def begin_update( @@ -923,15 +1019,24 @@ def begin_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -940,32 +1045,38 @@ def begin_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -976,15 +1087,18 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -992,33 +1106,41 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements compute_name=compute_name, api_version=api_version, underlying_resource_action=underlying_resource_action, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -1054,14 +1176,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -1069,29 +1196,33 @@ def begin_delete( # pylint: disable=inconsistent-return-statements compute_name=compute_name, underlying_resource_action=underlying_resource_action, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace def update_custom_services( # pylint: disable=inconsistent-return-statements @@ -1118,16 +1249,22 @@ def update_custom_services( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(custom_services, '[CustomService]') + _json = self._serialize.body(custom_services, "[CustomService]") request = build_update_custom_services_request( subscription_id=self._config.subscription_id, @@ -1137,28 +1274,35 @@ def update_custom_services( # pylint: disable=inconsistent-return-statements api_version=api_version, content_type=content_type, json=_json, - template_url=self.update_custom_services.metadata['url'], + template_url=self.update_custom_services.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - update_custom_services.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/customServices"} # type: ignore - + update_custom_services.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/customServices"} # type: ignore @distributed_trace def list_nodes( @@ -1184,29 +1328,36 @@ def list_nodes( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.AmlComputeNodesInformation] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlComputeNodesInformation"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.AmlComputeNodesInformation"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_nodes_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self.list_nodes.metadata['url'], + template_url=self.list_nodes.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_nodes_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -1221,7 +1372,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("AmlComputeNodesInformation", pipeline_response) + deserialized = self._deserialize( + "AmlComputeNodesInformation", pipeline_response + ) list_of_elem = deserialized.nodes if cls: list_of_elem = cls(list_of_elem) @@ -1230,25 +1383,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_nodes.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes"} # type: ignore + list_nodes.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes"} # type: ignore @distributed_trace def list_keys( @@ -1272,47 +1431,59 @@ def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ComputeSecrets :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeSecrets"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeSecrets"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComputeSecrets', pipeline_response) + deserialized = self._deserialize("ComputeSecrets", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys"} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys"} # type: ignore def _start_initial( # pylint: disable=inconsistent-return-statements self, @@ -1322,42 +1493,50 @@ def _start_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_start_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self._start_initial.metadata['url'], + template_url=self._start_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _start_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore - + _start_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore @distributed_trace def begin_start( # pylint: disable=inconsistent-return-statements @@ -1388,43 +1567,52 @@ def begin_start( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._start_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_start.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore + begin_start.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore def _stop_initial( # pylint: disable=inconsistent-return-statements self, @@ -1434,42 +1622,50 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_stop_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self._stop_initial.metadata['url'], + template_url=self._stop_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _stop_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore - + _stop_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore @distributed_trace def begin_stop( # pylint: disable=inconsistent-return-statements @@ -1500,43 +1696,52 @@ def begin_stop( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._stop_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_stop.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore + begin_stop.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore def _restart_initial( # pylint: disable=inconsistent-return-statements self, @@ -1546,42 +1751,50 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_restart_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self._restart_initial.metadata['url'], + template_url=self._restart_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _restart_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore - + _restart_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore @distributed_trace def begin_restart( # pylint: disable=inconsistent-return-statements @@ -1612,43 +1825,52 @@ def begin_restart( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._restart_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_restart.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore + begin_restart.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore @distributed_trace def update_idle_shutdown_setting( # pylint: disable=inconsistent-return-statements @@ -1675,16 +1897,22 @@ def update_idle_shutdown_setting( # pylint: disable=inconsistent-return-stateme :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'IdleShutdownSetting') + _json = self._serialize.body(parameters, "IdleShutdownSetting") request = build_update_idle_shutdown_setting_request( subscription_id=self._config.subscription_id, @@ -1694,25 +1922,32 @@ def update_idle_shutdown_setting( # pylint: disable=inconsistent-return-stateme api_version=api_version, content_type=content_type, json=_json, - template_url=self.update_idle_shutdown_setting.metadata['url'], + template_url=self.update_idle_shutdown_setting.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - update_idle_shutdown_setting.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateIdleShutdownSetting"} # type: ignore - + update_idle_shutdown_setting.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateIdleShutdownSetting"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_data_containers_operations.py index 70e469b153eb..81f69c69b177 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_data_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_data_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -193,6 +205,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class DataContainersOperations(object): """DataContainersOperations operations. @@ -245,16 +258,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -262,13 +282,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -284,7 +304,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -293,25 +315,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -337,43 +365,53 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore @distributed_trace def get( @@ -399,47 +437,57 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize("DataContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore @distributed_trace def create_or_update( @@ -468,16 +516,22 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DataContainer') + _json = self._serialize.body(body, "DataContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -487,33 +541,44 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_data_versions_operations.py index 8ae5528ce3fc..12b4b35ddd23 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_data_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_data_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -210,6 +222,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class DataVersionsOperations(object): """DataVersionsOperations operations. @@ -278,16 +291,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -299,13 +319,13 @@ def prepare_request(next_link=None): skip=skip, tags=tags, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -325,7 +345,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataVersionBaseResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -334,25 +356,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -381,15 +409,18 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -397,28 +428,35 @@ def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -447,15 +485,20 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -463,32 +506,39 @@ def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize("DataVersionBase", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace def create_or_update( @@ -520,16 +570,24 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DataVersionBase') + _json = self._serialize.body(body, "DataVersionBase") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -540,33 +598,44 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_datastores_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_datastores_operations.py index 7c74ee2bc6a8..5b1a66e81604 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_datastores_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_datastores_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, List, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -250,6 +262,7 @@ def build_list_secrets_request( **kwargs ) + # fmt: on class DatastoresOperations(object): """DatastoresOperations operations. @@ -317,16 +330,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DatastoreResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -339,13 +359,13 @@ def prepare_request(next_link=None): search_text=search_text, order_by=order_by, order_by_asc=order_by_asc, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -366,7 +386,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("DatastoreResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DatastoreResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -375,25 +397,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -419,43 +447,53 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace def get( @@ -481,47 +519,57 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.Datastore :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Datastore"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Datastore"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Datastore', pipeline_response) + deserialized = self._deserialize("Datastore", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace def create_or_update( @@ -553,16 +601,22 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.Datastore :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Datastore"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Datastore"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'Datastore') + _json = self._serialize.body(body, "Datastore") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -573,36 +627,43 @@ def create_or_update( content_type=content_type, json=_json, skip_validation=skip_validation, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('Datastore', pipeline_response) + deserialized = self._deserialize("Datastore", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('Datastore', pipeline_response) + deserialized = self._deserialize("Datastore", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace def list_secrets( @@ -628,44 +689,56 @@ def list_secrets( :rtype: ~azure.mgmt.machinelearningservices.models.DatastoreSecrets :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreSecrets"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DatastoreSecrets"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_list_secrets_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.list_secrets.metadata['url'], + template_url=self.list_secrets.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DatastoreSecrets', pipeline_response) + deserialized = self._deserialize("DatastoreSecrets", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_secrets.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets"} # type: ignore - + list_secrets.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_environment_containers_operations.py index db6606ef014b..69cddf006f9f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_environment_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_environment_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -193,6 +205,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class EnvironmentContainersOperations(object): """EnvironmentContainersOperations operations. @@ -245,16 +258,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -262,13 +282,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -284,7 +304,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -293,25 +316,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -337,43 +366,53 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore @distributed_trace def get( @@ -399,47 +438,61 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore @distributed_trace def create_or_update( @@ -468,16 +521,24 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentContainer') + _json = self._serialize.body(body, "EnvironmentContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -487,33 +548,44 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_environment_versions_operations.py index 84a7e94dbd12..211d79e6dfcb 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_environment_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_environment_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -207,6 +219,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class EnvironmentVersionsOperations(object): """EnvironmentVersionsOperations operations. @@ -268,16 +281,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -288,13 +308,13 @@ def prepare_request(next_link=None): top=top, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -313,7 +333,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersionResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -322,25 +345,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -369,15 +398,18 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -385,28 +417,35 @@ def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -435,15 +474,20 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -451,32 +495,41 @@ def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace def create_or_update( @@ -508,16 +561,24 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentVersion') + _json = self._serialize.body(body, "EnvironmentVersion") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -528,33 +589,44 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_jobs_operations.py index 6559d57464af..7a3d22365391 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_jobs_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_jobs_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -246,6 +258,7 @@ def build_cancel_request_initial( **kwargs ) + # fmt: on class JobsOperations(object): """JobsOperations operations. @@ -310,16 +323,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.JobBaseResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -331,13 +351,13 @@ def prepare_request(next_link=None): list_view_type=list_view_type, scheduled=scheduled, schedule_id=schedule_id, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -357,7 +377,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("JobBaseResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "JobBaseResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -366,25 +388,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -394,49 +422,65 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -469,43 +513,52 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace def get( @@ -531,47 +584,57 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.JobBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.JobBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('JobBase', pipeline_response) + deserialized = self._deserialize("JobBase", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace def create_or_update( @@ -600,16 +663,22 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.JobBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.JobBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'JobBase') + _json = self._serialize.body(body, "JobBase") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -619,36 +688,43 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('JobBase', pipeline_response) + deserialized = self._deserialize("JobBase", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('JobBase', pipeline_response) + deserialized = self._deserialize("JobBase", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore def _cancel_initial( # pylint: disable=inconsistent-return-statements self, @@ -658,48 +734,59 @@ def _cancel_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_cancel_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self._cancel_initial.metadata['url'], + template_url=self._cancel_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _cancel_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore - + _cancel_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore @distributed_trace def begin_cancel( # pylint: disable=inconsistent-return-statements @@ -732,40 +819,53 @@ def begin_cancel( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._cancel_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_cancel.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore + begin_cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_labeling_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_labeling_jobs_operations.py index b8245907ca89..3253958005f4 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_labeling_jobs_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_labeling_jobs_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -321,6 +333,7 @@ def build_resume_request_initial( **kwargs ) + # fmt: on class LabelingJobsOperations(object): """LabelingJobsOperations operations. @@ -373,16 +386,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.LabelingJobResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJobResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.LabelingJobResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -390,13 +410,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, top=top, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -412,7 +432,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("LabelingJobResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "LabelingJobResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -421,25 +443,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -465,43 +493,53 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore @distributed_trace def get( @@ -535,15 +573,18 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.LabelingJob :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.LabelingJob"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -552,32 +593,39 @@ def get( api_version=api_version, include_job_instructions=include_job_instructions, include_label_categories=include_label_categories, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('LabelingJob', pipeline_response) + deserialized = self._deserialize("LabelingJob", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore def _create_or_update_initial( self, @@ -588,16 +636,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.LabelingJob" - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.LabelingJob"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'LabelingJob') + _json = self._serialize.body(body, "LabelingJob") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -607,39 +661,51 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('LabelingJob', pipeline_response) + deserialized = self._deserialize("LabelingJob", pipeline_response) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('LabelingJob', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("LabelingJob", pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -676,15 +742,22 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.LabelingJob] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.LabelingJob"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -693,32 +766,36 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('LabelingJob', pipeline_response) + deserialized = self._deserialize("LabelingJob", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore def _export_labels_initial( self, @@ -729,16 +806,24 @@ def _export_labels_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.ExportSummary"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExportSummary"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.ExportSummary"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ExportSummary') + _json = self._serialize.body(body, "ExportSummary") request = build_export_labels_request_initial( subscription_id=self._config.subscription_id, @@ -748,39 +833,49 @@ def _export_labels_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._export_labels_initial.metadata['url'], + template_url=self._export_labels_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ExportSummary', pipeline_response) + deserialized = self._deserialize( + "ExportSummary", pipeline_response + ) if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _export_labels_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore - + _export_labels_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore @distributed_trace def begin_export_labels( @@ -817,15 +912,22 @@ def begin_export_labels( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ExportSummary] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExportSummary"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ExportSummary"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._export_labels_initial( resource_group_name=resource_group_name, @@ -834,32 +936,42 @@ def begin_export_labels( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ExportSummary', pipeline_response) + deserialized = self._deserialize( + "ExportSummary", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_export_labels.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore + begin_export_labels.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore @distributed_trace def pause( # pylint: disable=inconsistent-return-statements @@ -885,43 +997,53 @@ def pause( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_pause_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self.pause.metadata['url'], + template_url=self.pause.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - pause.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause"} # type: ignore - + pause.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause"} # type: ignore def _resume_initial( # pylint: disable=inconsistent-return-statements self, @@ -931,48 +1053,59 @@ def _resume_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_resume_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self._resume_initial.metadata['url'], + template_url=self._resume_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _resume_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore - + _resume_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore @distributed_trace def begin_resume( # pylint: disable=inconsistent-return-statements @@ -1005,40 +1138,53 @@ def begin_resume( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._resume_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_resume.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore + begin_resume.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_managed_network_provisions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_managed_network_provisions_operations.py index df41457acccb..5119992939cc 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_managed_network_provisions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_managed_network_provisions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod @@ -25,8 +31,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -71,6 +83,7 @@ def build_provision_managed_network_request_initial( **kwargs ) + # fmt: on class ManagedNetworkProvisionsOperations(object): """ManagedNetworkProvisionsOperations operations. @@ -102,17 +115,27 @@ def _provision_managed_network_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.ManagedNetworkProvisionStatus"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ManagedNetworkProvisionStatus"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.ManagedNetworkProvisionStatus"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if parameters is not None: - _json = self._serialize.body(parameters, 'ManagedNetworkProvisionOptions') + _json = self._serialize.body( + parameters, "ManagedNetworkProvisionOptions" + ) else: _json = None @@ -123,38 +146,48 @@ def _provision_managed_network_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._provision_managed_network_initial.metadata['url'], + template_url=self._provision_managed_network_initial.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ManagedNetworkProvisionStatus', pipeline_response) + deserialized = self._deserialize( + "ManagedNetworkProvisionStatus", pipeline_response + ) if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _provision_managed_network_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork"} # type: ignore - + _provision_managed_network_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork"} # type: ignore @distributed_trace def begin_provision_managed_network( @@ -187,15 +220,24 @@ def begin_provision_managed_network( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionStatus] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedNetworkProvisionStatus"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ManagedNetworkProvisionStatus"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._provision_managed_network_initial( resource_group_name=resource_group_name, @@ -203,29 +245,39 @@ def begin_provision_managed_network( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ManagedNetworkProvisionStatus', pipeline_response) + deserialized = self._deserialize( + "ManagedNetworkProvisionStatus", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_provision_managed_network.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork"} # type: ignore + begin_provision_managed_network.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_managed_network_settings_rule_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_managed_network_settings_rule_operations.py index cc1ca26d209c..c8be944d35ff 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_managed_network_settings_rule_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_managed_network_settings_rule_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -189,6 +201,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class ManagedNetworkSettingsRuleOperations(object): """ManagedNetworkSettingsRuleOperations operations. @@ -233,28 +246,35 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.OutboundRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OutboundRuleListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -268,7 +288,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("OutboundRuleListResult", pipeline_response) + deserialized = self._deserialize( + "OutboundRuleListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -277,25 +299,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -305,47 +333,56 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, rule_name=rule_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -376,43 +413,56 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, rule_name=rule_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore @distributed_trace def get( @@ -436,47 +486,61 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleBasicResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OutboundRuleBasicResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, rule_name=rule_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) + deserialized = self._deserialize( + "OutboundRuleBasicResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore def _create_or_update_initial( self, @@ -487,16 +551,24 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.OutboundRuleBasicResource"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OutboundRuleBasicResource"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.OutboundRuleBasicResource"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'OutboundRuleBasicResource') + _json = self._serialize.body(parameters, "OutboundRuleBasicResource") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -506,38 +578,46 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) + deserialized = self._deserialize( + "OutboundRuleBasicResource", pipeline_response + ) if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -574,15 +654,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleBasicResource"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OutboundRuleBasicResource"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -591,29 +680,39 @@ def begin_create_or_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) + deserialized = self._deserialize( + "OutboundRuleBasicResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_model_containers_operations.py index 9cc54fe75439..08b10efadc81 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_model_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_model_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -196,6 +208,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class ModelContainersOperations(object): """ModelContainersOperations operations. @@ -251,16 +264,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -269,13 +289,13 @@ def prepare_request(next_link=None): skip=skip, count=count, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -292,7 +312,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -301,25 +323,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -345,43 +373,53 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore @distributed_trace def get( @@ -407,47 +445,59 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize("ModelContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore @distributed_trace def create_or_update( @@ -476,16 +526,24 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelContainer') + _json = self._serialize.body(body, "ModelContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -495,33 +553,44 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_model_versions_operations.py index ff48e496c9fd..ccaeed4e95a3 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_model_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_model_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -225,6 +237,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class ModelVersionsOperations(object): """ModelVersionsOperations operations. @@ -306,16 +319,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -332,13 +352,13 @@ def prepare_request(next_link=None): properties=properties, feed=feed, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -363,7 +383,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -372,25 +394,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -419,15 +447,18 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -435,28 +466,35 @@ def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -485,15 +523,18 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -501,32 +542,39 @@ def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace def create_or_update( @@ -558,16 +606,22 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelVersion') + _json = self._serialize.body(body, "ModelVersion") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -578,33 +632,40 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_online_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_online_deployments_operations.py index d8d4dc51ad19..a071f1bcbe48 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_online_deployments_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_online_deployments_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -341,6 +353,7 @@ def build_list_skus_request( **kwargs ) + # fmt: on class OnlineDeploymentsOperations(object): """OnlineDeploymentsOperations operations. @@ -399,16 +412,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.OnlineDeploymentTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -418,13 +438,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -442,7 +462,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineDeploymentTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "OnlineDeploymentTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -451,25 +474,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -480,15 +509,18 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -496,34 +528,47 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -559,14 +604,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -574,29 +624,33 @@ def begin_delete( # pylint: disable=inconsistent-return-statements endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def get( @@ -625,15 +679,20 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.OnlineDeployment :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -641,32 +700,39 @@ def get( endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize("OnlineDeployment", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore def _update_initial( self, @@ -678,16 +744,26 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.OnlineDeployment"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineDeployment"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.OnlineDeployment"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSku') + _json = self._serialize.body( + body, "PartialMinimalTrackedResourceWithSku" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -698,40 +774,55 @@ def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def begin_update( @@ -772,15 +863,24 @@ def begin_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -790,32 +890,38 @@ def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore def _create_or_update_initial( self, @@ -827,16 +933,24 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.OnlineDeployment" - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'OnlineDeployment') + _json = self._serialize.body(body, "OnlineDeployment") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -847,39 +961,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -920,15 +1050,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -938,32 +1077,38 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def get_logs( @@ -995,16 +1140,24 @@ def get_logs( :rtype: ~azure.mgmt.machinelearningservices.models.DeploymentLogs :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentLogs"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DeploymentLogs"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DeploymentLogsRequest') + _json = self._serialize.body(body, "DeploymentLogsRequest") request = build_get_logs_request( subscription_id=self._config.subscription_id, @@ -1015,32 +1168,39 @@ def get_logs( api_version=api_version, content_type=content_type, json=_json, - template_url=self.get_logs.metadata['url'], + template_url=self.get_logs.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DeploymentLogs', pipeline_response) + deserialized = self._deserialize("DeploymentLogs", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_logs.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs"} # type: ignore - + get_logs.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs"} # type: ignore @distributed_trace def list_skus( @@ -1077,16 +1237,23 @@ def list_skus( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.SkuResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.SkuResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_skus_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -1096,13 +1263,13 @@ def prepare_request(next_link=None): api_version=api_version, count=count, skip=skip, - template_url=self.list_skus.metadata['url'], + template_url=self.list_skus.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_skus_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -1120,7 +1287,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("SkuResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "SkuResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1129,22 +1298,28 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_skus.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus"} # type: ignore + list_skus.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_online_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_online_endpoints_operations.py index e4ed20f11274..6556ab52a913 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_online_endpoints_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_online_endpoints_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -372,6 +384,7 @@ def build_get_token_request( **kwargs ) + # fmt: on class OnlineEndpointsOperations(object): """OnlineEndpointsOperations operations. @@ -442,16 +455,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.OnlineEndpointTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -464,13 +484,13 @@ def prepare_request(next_link=None): tags=tags, properties=properties, order_by=order_by, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -491,7 +511,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineEndpointTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "OnlineEndpointTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -500,25 +523,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -528,49 +557,65 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -603,43 +648,52 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace def get( @@ -665,47 +719,59 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.OnlineEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize("OnlineEndpoint", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore def _update_initial( self, @@ -716,16 +782,26 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.OnlineEndpoint"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineEndpoint"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.OnlineEndpoint"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') + _json = self._serialize.body( + body, "PartialMinimalTrackedResourceWithIdentity" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -735,40 +811,55 @@ def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace def begin_update( @@ -807,15 +898,24 @@ def begin_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -824,32 +924,38 @@ def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore def _create_or_update_initial( self, @@ -860,16 +966,24 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.OnlineEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'OnlineEndpoint') + _json = self._serialize.body(body, "OnlineEndpoint") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -879,39 +993,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -949,15 +1079,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -966,32 +1105,38 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace def list_keys( @@ -1017,47 +1162,59 @@ def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthKeys"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) + deserialized = self._deserialize("EndpointAuthKeys", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys"} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys"} # type: ignore def _regenerate_keys_initial( # pylint: disable=inconsistent-return-statements self, @@ -1068,16 +1225,22 @@ def _regenerate_keys_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'RegenerateEndpointKeysRequest') + _json = self._serialize.body(body, "RegenerateEndpointKeysRequest") request = build_regenerate_keys_request_initial( subscription_id=self._config.subscription_id, @@ -1087,33 +1250,41 @@ def _regenerate_keys_initial( # pylint: disable=inconsistent-return-statements api_version=api_version, content_type=content_type, json=_json, - template_url=self._regenerate_keys_initial.metadata['url'], + template_url=self._regenerate_keys_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _regenerate_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore - + _regenerate_keys_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore @distributed_trace def begin_regenerate_keys( # pylint: disable=inconsistent-return-statements @@ -1149,15 +1320,22 @@ def begin_regenerate_keys( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._regenerate_keys_initial( resource_group_name=resource_group_name, @@ -1166,29 +1344,37 @@ def begin_regenerate_keys( # pylint: disable=inconsistent-return-statements body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_regenerate_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore + begin_regenerate_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore @distributed_trace def get_token( @@ -1214,44 +1400,58 @@ def get_token( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthToken :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthToken"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthToken"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_token_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.get_token.metadata['url'], + template_url=self.get_token.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EndpointAuthToken', pipeline_response) + deserialized = self._deserialize( + "EndpointAuthToken", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token"} # type: ignore - + get_token.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_operations.py index a0384e6de08d..921653b5bed8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -57,6 +69,7 @@ def build_list_request( **kwargs ) + # fmt: on class Operations(object): """Operations operations. @@ -82,8 +95,7 @@ def __init__(self, client, config, serializer, deserializer): @distributed_trace def list( - self, - **kwargs # type: Any + self, **kwargs # type: Any ): # type: (...) -> Iterable["_models.AmlOperationListResult"] """Lists all of the available Azure Machine Learning Services REST API operations. @@ -95,25 +107,32 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.AmlOperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlOperationListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.AmlOperationListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( api_version=api_version, template_url=next_link, @@ -124,7 +143,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("AmlOperationListResult", pipeline_response) + deserialized = self._deserialize( + "AmlOperationListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -133,22 +154,28 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/providers/Microsoft.MachineLearningServices/operations"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.MachineLearningServices/operations"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_private_endpoint_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_private_endpoint_connections_operations.py index bfd90aef963b..a1f4bb5f0dc5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_private_endpoint_connections_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_private_endpoint_connections_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -187,6 +199,7 @@ def build_delete_request( **kwargs ) + # fmt: on class PrivateEndpointConnectionsOperations(object): """PrivateEndpointConnectionsOperations operations. @@ -231,28 +244,35 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnectionListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( resource_group_name=resource_group_name, workspace_name=workspace_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( resource_group_name=resource_group_name, workspace_name=workspace_name, @@ -266,7 +286,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) + deserialized = self._deserialize( + "PrivateEndpointConnectionListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -275,25 +297,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections"} # type: ignore @distributed_trace def get( @@ -318,47 +346,61 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, private_endpoint_connection_name=private_endpoint_connection_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + deserialized = self._deserialize( + "PrivateEndpointConnection", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace def create_or_update( @@ -386,16 +428,24 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(properties, 'PrivateEndpointConnection') + _json = self._serialize.body(properties, "PrivateEndpointConnection") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -405,32 +455,41 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + deserialized = self._deserialize( + "PrivateEndpointConnection", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -455,40 +514,50 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, private_endpoint_connection_name=private_endpoint_connection_name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_private_link_resources_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_private_link_resources_operations.py index fac16cf8a162..00e506063f02 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_private_link_resources_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_private_link_resources_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest @@ -23,8 +29,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -66,6 +78,7 @@ def build_list_request( **kwargs ) + # fmt: on class PrivateLinkResourcesOperations(object): """PrivateLinkResourcesOperations operations. @@ -108,43 +121,57 @@ def list( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateLinkResourceListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateLinkResourceListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateLinkResourceListResult', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "PrivateLinkResourceListResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources"} # type: ignore - + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_quotas_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_quotas_operations.py index 23294259cba4..bac086280324 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_quotas_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_quotas_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -103,6 +115,7 @@ def build_list_request( **kwargs ) + # fmt: on class QuotasOperations(object): """QuotasOperations operations. @@ -145,16 +158,24 @@ def update( :rtype: ~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotasResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'QuotaUpdateParameters') + _json = self._serialize.body(parameters, "QuotaUpdateParameters") request = build_update_request( location=location, @@ -162,32 +183,41 @@ def update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.update.metadata['url'], + template_url=self.update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('UpdateWorkspaceQuotasResult', pipeline_response) + deserialized = self._deserialize( + "UpdateWorkspaceQuotasResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas"} # type: ignore - + update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas"} # type: ignore @distributed_trace def list( @@ -206,27 +236,34 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListWorkspaceQuotas] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceQuotas"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListWorkspaceQuotas"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, @@ -239,7 +276,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ListWorkspaceQuotas", pipeline_response) + deserialized = self._deserialize( + "ListWorkspaceQuotas", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -248,22 +287,28 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registries_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registries_operations.py index 7960e9ed5e68..5768026bb1ab 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registries_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registries_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -260,6 +272,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class RegistriesOperations(object): """RegistriesOperations operations. @@ -303,27 +316,34 @@ def list_by_subscription( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.RegistryTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, skip=skip, - template_url=self.list_by_subscription.metadata['url'], + template_url=self.list_by_subscription.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, @@ -336,7 +356,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("RegistryTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "RegistryTrackedResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -345,25 +367,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore + list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore @distributed_trace def list( @@ -388,28 +416,35 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.RegistryTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, api_version=api_version, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -423,7 +458,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("RegistryTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "RegistryTrackedResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -432,25 +469,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -459,48 +502,64 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -530,42 +589,55 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace def get( @@ -588,46 +660,56 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.Registry :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore def _update_initial( self, @@ -637,16 +719,24 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> "_models.Registry" - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialRegistryPartialTrackedResource') + _json = self._serialize.body( + body, "PartialRegistryPartialTrackedResource" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -655,39 +745,48 @@ def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - deserialized = self._deserialize('Registry', pipeline_response) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) + + deserialized = self._deserialize("Registry", pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace def begin_update( @@ -720,15 +819,22 @@ def begin_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Registry] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -736,32 +842,40 @@ def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore def _create_or_update_initial( self, @@ -771,16 +885,24 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.Registry"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Registry"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.Registry"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'Registry') + _json = self._serialize.body(body, "Registry") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -789,36 +911,41 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -851,15 +978,22 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Registry] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -867,29 +1001,37 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registry_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registry_code_containers_operations.py index 5397008875f2..9a731e777832 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registry_code_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registry_code_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -192,6 +204,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class RegistryCodeContainersOperations(object): """RegistryCodeContainersOperations operations. @@ -241,29 +254,36 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, api_version=api_version, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -278,7 +298,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -287,25 +309,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -315,49 +343,65 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, code_name=code_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -390,43 +434,56 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, code_name=code_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore @distributed_trace def get( @@ -452,47 +509,57 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, code_name=code_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize("CodeContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore def _create_or_update_initial( self, @@ -503,16 +570,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.CodeContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeContainer') + _json = self._serialize.body(body, "CodeContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -522,39 +595,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('CodeContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -591,15 +680,22 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.CodeContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -608,29 +704,39 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registry_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registry_code_versions_operations.py index 00e966ae0762..73b53bc818c4 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registry_code_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registry_code_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -206,6 +218,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class RegistryCodeVersionsOperations(object): """RegistryCodeVersionsOperations operations. @@ -264,16 +277,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -283,13 +303,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -307,7 +327,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -316,25 +338,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -345,15 +373,18 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -361,34 +392,47 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements code_name=code_name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -424,14 +468,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -439,29 +488,37 @@ def begin_delete( # pylint: disable=inconsistent-return-statements code_name=code_name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -490,15 +547,18 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -506,32 +566,39 @@ def get( code_name=code_name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore def _create_or_update_initial( self, @@ -543,16 +610,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.CodeVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeVersion') + _json = self._serialize.body(body, "CodeVersion") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -563,39 +636,51 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('CodeVersion', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -635,15 +720,22 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.CodeVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -653,29 +745,37 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registry_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registry_component_containers_operations.py index 38c1e8af22ab..6229a763ffd3 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registry_component_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registry_component_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -192,6 +204,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class RegistryComponentContainersOperations(object): """RegistryComponentContainersOperations operations. @@ -241,29 +254,36 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, api_version=api_version, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -278,7 +298,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -287,25 +310,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -315,49 +344,65 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, component_name=component_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -390,43 +435,56 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, component_name=component_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore @distributed_trace def get( @@ -452,47 +510,61 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, component_name=component_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore def _create_or_update_initial( self, @@ -503,16 +575,24 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.ComponentContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentContainer') + _json = self._serialize.body(body, "ComponentContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -522,39 +602,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComponentContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -592,15 +688,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComponentContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -609,29 +714,39 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registry_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registry_component_versions_operations.py index 5962470e0b7f..9466bdbbcc30 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registry_component_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registry_component_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -206,6 +218,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class RegistryComponentVersionsOperations(object): """RegistryComponentVersionsOperations operations. @@ -264,16 +277,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -283,13 +303,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -307,7 +327,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -316,25 +338,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -345,15 +373,18 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -361,34 +392,47 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements component_name=component_name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -424,14 +468,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -439,29 +488,37 @@ def begin_delete( # pylint: disable=inconsistent-return-statements component_name=component_name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -490,15 +547,20 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -506,32 +568,39 @@ def get( component_name=component_name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize("ComponentVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore def _create_or_update_initial( self, @@ -543,16 +612,24 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.ComponentVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentVersion') + _json = self._serialize.body(body, "ComponentVersion") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -563,39 +640,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComponentVersion', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -636,15 +729,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComponentVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -654,29 +756,39 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registry_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registry_environment_containers_operations.py index 08c96ac6156f..3dd3e661c342 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registry_environment_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registry_environment_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -195,6 +207,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class RegistryEnvironmentContainersOperations(object): """RegistryEnvironmentContainersOperations operations. @@ -247,16 +260,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -264,13 +284,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -286,7 +306,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -295,25 +318,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -323,49 +352,65 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, environment_name=environment_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -398,43 +443,56 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, environment_name=environment_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore @distributed_trace def get( @@ -460,47 +518,61 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, environment_name=environment_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore def _create_or_update_initial( self, @@ -511,16 +583,24 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.EnvironmentContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentContainer') + _json = self._serialize.body(body, "EnvironmentContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -530,39 +610,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -600,15 +696,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -617,29 +722,39 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registry_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registry_environment_versions_operations.py index b5264eee503b..0559a57c32db 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registry_environment_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registry_environment_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -209,6 +221,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class RegistryEnvironmentVersionsOperations(object): """RegistryEnvironmentVersionsOperations operations. @@ -270,16 +283,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -290,13 +310,13 @@ def prepare_request(next_link=None): top=top, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -315,7 +335,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersionResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -324,25 +347,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -353,15 +382,18 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -369,34 +401,47 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements environment_name=environment_name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -432,14 +477,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -447,29 +497,37 @@ def begin_delete( # pylint: disable=inconsistent-return-statements environment_name=environment_name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -498,15 +556,20 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -514,32 +577,41 @@ def get( environment_name=environment_name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore def _create_or_update_initial( self, @@ -551,16 +623,24 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.EnvironmentVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentVersion') + _json = self._serialize.body(body, "EnvironmentVersion") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -571,39 +651,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -644,15 +740,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -662,29 +767,39 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registry_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registry_model_containers_operations.py index 3748199a1e16..b42499d2a77c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registry_model_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registry_model_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -195,6 +207,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class RegistryModelContainersOperations(object): """RegistryModelContainersOperations operations. @@ -247,16 +260,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -264,13 +284,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -286,7 +306,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -295,25 +317,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -323,49 +351,65 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, model_name=model_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -398,43 +442,56 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, model_name=model_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore @distributed_trace def get( @@ -460,47 +517,59 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, model_name=model_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize("ModelContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore def _create_or_update_initial( self, @@ -511,16 +580,24 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.ModelContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelContainer') + _json = self._serialize.body(body, "ModelContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -530,39 +607,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ModelContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -600,15 +693,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ModelContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -617,29 +719,39 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registry_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registry_model_versions_operations.py index 4c257922f711..8916c6fae201 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registry_model_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_registry_model_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -221,6 +233,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class RegistryModelVersionsOperations(object): """RegistryModelVersionsOperations operations. @@ -296,16 +309,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -320,13 +340,13 @@ def prepare_request(next_link=None): tags=tags, properties=properties, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -349,7 +369,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -358,25 +380,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -387,15 +415,18 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -403,34 +434,47 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements model_name=model_name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -466,14 +510,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -481,29 +530,37 @@ def begin_delete( # pylint: disable=inconsistent-return-statements model_name=model_name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -532,15 +589,18 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -548,32 +608,39 @@ def get( model_name=model_name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore def _create_or_update_initial( self, @@ -585,16 +652,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.ModelVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelVersion') + _json = self._serialize.body(body, "ModelVersion") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -605,39 +678,51 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ModelVersion', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -677,15 +762,22 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ModelVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -695,29 +787,37 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_schedules_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_schedules_operations.py index 8da8f3baffe2..936619e63c90 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_schedules_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_schedules_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -195,6 +207,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class SchedulesOperations(object): """SchedulesOperations operations. @@ -247,16 +260,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ScheduleResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduleResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ScheduleResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -264,13 +284,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -286,7 +306,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ScheduleResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ScheduleResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -295,25 +317,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -323,49 +351,65 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -398,43 +442,52 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @distributed_trace def get( @@ -460,47 +513,57 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.Schedule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Schedule"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Schedule', pipeline_response) + deserialized = self._deserialize("Schedule", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore def _create_or_update_initial( self, @@ -511,16 +574,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.Schedule" - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Schedule"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'Schedule') + _json = self._serialize.body(body, "Schedule") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -530,39 +599,51 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('Schedule', pipeline_response) + deserialized = self._deserialize("Schedule", pipeline_response) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('Schedule', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("Schedule", pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -598,15 +679,22 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Schedule] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Schedule"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -615,29 +703,33 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Schedule', pipeline_response) + deserialized = self._deserialize("Schedule", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_usages_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_usages_operations.py index a638b0da2621..6d6f6e25c796 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_usages_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_usages_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -65,6 +77,7 @@ def build_list_request( **kwargs ) + # fmt: on class UsagesOperations(object): """UsagesOperations operations. @@ -106,27 +119,34 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListUsagesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListUsagesResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, @@ -139,7 +159,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ListUsagesResult", pipeline_response) + deserialized = self._deserialize( + "ListUsagesResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -148,22 +170,28 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_virtual_machine_sizes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_virtual_machine_sizes_operations.py index 0824521a8134..f6c4135b814e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_virtual_machine_sizes_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_virtual_machine_sizes_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest @@ -23,8 +29,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -64,6 +76,7 @@ def build_list_request( **kwargs ) + # fmt: on class VirtualMachineSizesOperations(object): """VirtualMachineSizesOperations operations. @@ -103,42 +116,56 @@ def list( :rtype: ~azure.mgmt.machinelearningservices.models.VirtualMachineSizeListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_list_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualMachineSizeListResult', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "VirtualMachineSizeListResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes"} # type: ignore - + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_workspace_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_workspace_connections_operations.py index 826d58aebf78..fddade5d9cda 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_workspace_connections_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_workspace_connections_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -193,6 +205,7 @@ def build_list_request( **kwargs ) + # fmt: on class WorkspaceConnectionsOperations(object): """WorkspaceConnectionsOperations operations. @@ -242,16 +255,26 @@ def create( :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'WorkspaceConnectionPropertiesV2BasicResource') + _json = self._serialize.body( + parameters, "WorkspaceConnectionPropertiesV2BasicResource" + ) request = build_create_request( subscription_id=self._config.subscription_id, @@ -261,32 +284,41 @@ def create( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create.metadata['url'], + template_url=self.create.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - + create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace def get( @@ -310,47 +342,61 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, connection_name=connection_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -374,43 +420,53 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, connection_name=connection_name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace def list( @@ -439,16 +495,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -456,13 +519,13 @@ def prepare_request(next_link=None): api_version=api_version, target=target, category=category, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -478,7 +541,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -487,22 +553,28 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_workspace_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_workspace_features_operations.py index 65193f985379..c53a2b29712e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_workspace_features_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_workspace_features_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -67,6 +79,7 @@ def build_list_request( **kwargs ) + # fmt: on class WorkspaceFeaturesOperations(object): """WorkspaceFeaturesOperations operations. @@ -111,28 +124,35 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListAmlUserFeatureResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAmlUserFeatureResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListAmlUserFeatureResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -146,7 +166,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ListAmlUserFeatureResult", pipeline_response) + deserialized = self._deserialize( + "ListAmlUserFeatureResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -155,22 +177,28 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_workspaces_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_workspaces_operations.py index 6811104c993c..2ff8bb8a769d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_workspaces_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_12_01_preview/operations/_workspaces_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -559,6 +571,7 @@ def build_list_outbound_network_dependencies_endpoints_request( **kwargs ) + # fmt: on class WorkspacesOperations(object): """WorkspacesOperations operations. @@ -601,46 +614,56 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.Workspace :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore def _create_or_update_initial( self, @@ -650,16 +673,24 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.Workspace"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.Workspace"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'Workspace') + _json = self._serialize.body(parameters, "Workspace") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -668,33 +699,38 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -725,15 +761,22 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Workspace] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -741,32 +784,36 @@ def begin_create_or_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -775,41 +822,49 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -837,42 +892,51 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore def _update_initial( self, @@ -882,16 +946,24 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.Workspace"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.Workspace"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'WorkspaceUpdateParameters') + _json = self._serialize.body(parameters, "WorkspaceUpdateParameters") request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -900,33 +972,38 @@ def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace def begin_update( @@ -957,15 +1034,22 @@ def begin_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Workspace] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -973,32 +1057,36 @@ def begin_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace def list_by_resource_group( @@ -1020,28 +1108,35 @@ def list_by_resource_group( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_by_resource_group_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, api_version=api_version, skip=skip, - template_url=self.list_by_resource_group.metadata['url'], + template_url=self.list_by_resource_group.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_by_resource_group_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -1055,7 +1150,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1064,25 +1161,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore + list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore def _diagnose_initial( self, @@ -1092,17 +1195,27 @@ def _diagnose_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.DiagnoseResponseResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if parameters is not None: - _json = self._serialize.body(parameters, 'DiagnoseWorkspaceParameters') + _json = self._serialize.body( + parameters, "DiagnoseWorkspaceParameters" + ) else: _json = None @@ -1113,39 +1226,49 @@ def _diagnose_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._diagnose_initial.metadata['url'], + template_url=self._diagnose_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) + deserialized = self._deserialize( + "DiagnoseResponseResult", pipeline_response + ) if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _diagnose_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore - + _diagnose_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore @distributed_trace def begin_diagnose( @@ -1180,15 +1303,24 @@ def begin_diagnose( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.DiagnoseResponseResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnoseResponseResult"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DiagnoseResponseResult"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._diagnose_initial( resource_group_name=resource_group_name, @@ -1196,32 +1328,42 @@ def begin_diagnose( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) + deserialized = self._deserialize( + "DiagnoseResponseResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_diagnose.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore + begin_diagnose.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore @distributed_trace def list_keys( @@ -1243,46 +1385,60 @@ def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListWorkspaceKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceKeysResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListWorkspaceKeysResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ListWorkspaceKeysResult', pipeline_response) + deserialized = self._deserialize( + "ListWorkspaceKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys"} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys"} # type: ignore def _resync_keys_initial( # pylint: disable=inconsistent-return-statements self, @@ -1291,41 +1447,49 @@ def _resync_keys_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_resync_keys_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self._resync_keys_initial.metadata['url'], + template_url=self._resync_keys_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _resync_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore - + _resync_keys_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore @distributed_trace def begin_resync_keys( # pylint: disable=inconsistent-return-statements @@ -1354,42 +1518,51 @@ def begin_resync_keys( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._resync_keys_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_resync_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore + begin_resync_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore @distributed_trace def list_by_subscription( @@ -1408,27 +1581,34 @@ def list_by_subscription( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, skip=skip, - template_url=self.list_by_subscription.metadata['url'], + template_url=self.list_by_subscription.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, @@ -1441,7 +1621,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1450,25 +1632,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore + list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore @distributed_trace def list_notebook_access_token( @@ -1489,46 +1677,60 @@ def list_notebook_access_token( :rtype: ~azure.mgmt.machinelearningservices.models.NotebookAccessTokenResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookAccessTokenResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.NotebookAccessTokenResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_list_notebook_access_token_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_notebook_access_token.metadata['url'], + template_url=self.list_notebook_access_token.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('NotebookAccessTokenResult', pipeline_response) + deserialized = self._deserialize( + "NotebookAccessTokenResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_notebook_access_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken"} # type: ignore - + list_notebook_access_token.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken"} # type: ignore def _prepare_notebook_initial( self, @@ -1537,47 +1739,59 @@ def _prepare_notebook_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.NotebookResourceInfo"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NotebookResourceInfo"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.NotebookResourceInfo"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_prepare_notebook_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self._prepare_notebook_initial.metadata['url'], + template_url=self._prepare_notebook_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) + deserialized = self._deserialize( + "NotebookResourceInfo", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _prepare_notebook_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore - + _prepare_notebook_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore @distributed_trace def begin_prepare_notebook( @@ -1607,45 +1821,62 @@ def begin_prepare_notebook( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.NotebookResourceInfo] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookResourceInfo"] + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.NotebookResourceInfo"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._prepare_notebook_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) + deserialized = self._deserialize( + "NotebookResourceInfo", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_prepare_notebook.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore + begin_prepare_notebook.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore @distributed_trace def list_storage_account_keys( @@ -1666,46 +1897,60 @@ def list_storage_account_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListStorageAccountKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListStorageAccountKeysResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListStorageAccountKeysResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_list_storage_account_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_storage_account_keys.metadata['url'], + template_url=self.list_storage_account_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ListStorageAccountKeysResult', pipeline_response) + deserialized = self._deserialize( + "ListStorageAccountKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_storage_account_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys"} # type: ignore - + list_storage_account_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys"} # type: ignore @distributed_trace def list_notebook_keys( @@ -1726,46 +1971,60 @@ def list_notebook_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListNotebookKeysResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListNotebookKeysResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_list_notebook_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_notebook_keys.metadata['url'], + template_url=self.list_notebook_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ListNotebookKeysResult', pipeline_response) + deserialized = self._deserialize( + "ListNotebookKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_notebook_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys"} # type: ignore - + list_notebook_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys"} # type: ignore @distributed_trace def list_outbound_network_dependencies_endpoints( @@ -1790,43 +2049,59 @@ def list_outbound_network_dependencies_endpoints( :rtype: ~azure.mgmt.machinelearningservices.models.ExternalFQDNResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExternalFQDNResponse"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ExternalFQDNResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2022-12-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2022-12-01-preview" + ) # type: str - request = build_list_outbound_network_dependencies_endpoints_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], + template_url=self.list_outbound_network_dependencies_endpoints.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ExternalFQDNResponse', pipeline_response) + deserialized = self._deserialize( + "ExternalFQDNResponse", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_outbound_network_dependencies_endpoints.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints"} # type: ignore - + list_outbound_network_dependencies_endpoints.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/_azure_machine_learning_workspaces.py index 88e7a536f27e..d88e0dbbc7aa 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/_azure_machine_learning_workspaces.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/_azure_machine_learning_workspaces.py @@ -69,7 +69,9 @@ from azure.core.rest import HttpRequest, HttpResponse -class AzureMachineLearningWorkspaces(object): # pylint: disable=too-many-instance-attributes +class AzureMachineLearningWorkspaces( + object +): # pylint: disable=too-many-instance-attributes """These APIs allow end users to operate on Azure Machine Learning Workspace resources. :ivar operations: Operations operations @@ -212,30 +214,48 @@ def __init__( self._config = AzureMachineLearningWorkspacesConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._client = ARMPipelineClient( + base_url=base_url, config=self._config, **kwargs + ) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = { + k: v for k, v in models.__dict__.items() if isinstance(v, type) + } self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.workspaces = WorkspacesOperations(self._client, self._config, self._serialize, self._deserialize) - self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspaces = WorkspacesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.usages = UsagesOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.virtual_machine_sizes = VirtualMachineSizesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.quotas = QuotasOperations(self._client, self._config, self._serialize, self._deserialize) - self.compute = ComputeOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self.quotas = QuotasOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.compute = ComputeOperations( self._client, self._config, self._serialize, self._deserialize ) + self.private_endpoint_connections = ( + PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) self.private_link_resources = PrivateLinkResourcesOperations( self._client, self._config, self._serialize, self._deserialize ) self.workspace_connections = WorkspaceConnectionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.registries = RegistriesOperations(self._client, self._config, self._serialize, self._deserialize) + self.registries = RegistriesOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.workspace_features = WorkspaceFeaturesOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -245,8 +265,10 @@ def __init__( self.registry_code_versions = RegistryCodeVersionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.registry_component_containers = RegistryComponentContainersOperations( - self._client, self._config, self._serialize, self._deserialize + self.registry_component_containers = ( + RegistryComponentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) ) self.registry_component_versions = RegistryComponentVersionsOperations( self._client, self._config, self._serialize, self._deserialize @@ -257,11 +279,15 @@ def __init__( self.registry_data_versions = RegistryDataVersionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.registry_environment_containers = RegistryEnvironmentContainersOperations( - self._client, self._config, self._serialize, self._deserialize + self.registry_environment_containers = ( + RegistryEnvironmentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) ) - self.registry_environment_versions = RegistryEnvironmentVersionsOperations( - self._client, self._config, self._serialize, self._deserialize + self.registry_environment_versions = ( + RegistryEnvironmentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) ) self.registry_model_containers = RegistryModelContainersOperations( self._client, self._config, self._serialize, self._deserialize @@ -269,21 +295,33 @@ def __init__( self.registry_model_versions = RegistryModelVersionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.batch_endpoints = BatchEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) + self.batch_endpoints = BatchEndpointsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.batch_deployments = BatchDeploymentsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.code_containers = CodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_versions = CodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.code_containers = CodeContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.code_versions = CodeVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.component_containers = ComponentContainersOperations( self._client, self._config, self._serialize, self._deserialize ) self.component_versions = ComponentVersionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.data_containers = DataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_versions = DataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.datastores = DatastoresOperations(self._client, self._config, self._serialize, self._deserialize) + self.data_containers = DataContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_versions = DataVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.datastores = DatastoresOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.environment_containers = EnvironmentContainersOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -296,25 +334,37 @@ def __init__( self.featureset_versions = FeaturesetVersionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.featurestore_entity_containers = FeaturestoreEntityContainersOperations( + self.featurestore_entity_containers = ( + FeaturestoreEntityContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.featurestore_entity_versions = ( + FeaturestoreEntityVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.jobs = JobsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.featurestore_entity_versions = FeaturestoreEntityVersionsOperations( + self.labeling_jobs = LabelingJobsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.labeling_jobs = LabelingJobsOperations(self._client, self._config, self._serialize, self._deserialize) self.model_containers = ModelContainersOperations( self._client, self._config, self._serialize, self._deserialize ) - self.model_versions = ModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.model_versions = ModelVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.online_endpoints = OnlineEndpointsOperations( self._client, self._config, self._serialize, self._deserialize ) self.online_deployments = OnlineDeploymentsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.schedules = SchedulesOperations(self._client, self._config, self._serialize, self._deserialize) + self.schedules = SchedulesOperations( + self._client, self._config, self._serialize, self._deserialize + ) def _send_request( self, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/_configuration.py index ac5b8a998405..cbe9cc893563 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/_configuration.py @@ -10,7 +10,10 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ( + ARMChallengeAuthenticationPolicy, + ARMHttpLoggingPolicy, +) from ._version import VERSION @@ -21,7 +24,9 @@ from azure.core.credentials import TokenCredential -class AzureMachineLearningWorkspacesConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AzureMachineLearningWorkspacesConfiguration( + Configuration +): # pylint: disable=too-many-instance-attributes """Configuration for AzureMachineLearningWorkspaces. Note that all parameters used to create this instance are saved as instance @@ -43,8 +48,12 @@ def __init__( **kwargs # type: Any ): # type: (...) -> None - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + super(AzureMachineLearningWorkspacesConfiguration, self).__init__( + **kwargs + ) + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -54,22 +63,42 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = api_version - self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) - kwargs.setdefault("sdk_moniker", "mgmt-machinelearningservices/{}".format(VERSION)) + self.credential_scopes = kwargs.pop( + "credential_scopes", ["https://management.azure.com/.default"] + ) + kwargs.setdefault( + "sdk_moniker", "mgmt-machinelearningservices/{}".format(VERSION) + ) self._configure(**kwargs) def _configure( self, **kwargs # type: Any ): # type: (...) -> None - self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.user_agent_policy = kwargs.get( + "user_agent_policy" + ) or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get( + "headers_policy" + ) or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy( + **kwargs + ) + self.logging_policy = kwargs.get( + "logging_policy" + ) or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get( + "http_logging_policy" + ) or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy( + **kwargs + ) + self.custom_hook_policy = kwargs.get( + "custom_hook_policy" + ) or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get( + "redirect_policy" + ) or policies.RedirectPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = ARMChallengeAuthenticationPolicy( diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/_patch.py index f99e77fef986..17dbc073e01b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/_patch.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/_patch.py @@ -25,6 +25,7 @@ # # -------------------------------------------------------------------------- + # This file is used for handwritten extensions to the generated code. Example: # https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md def patch_sdk(): diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/_vendor.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/_vendor.py index 9aad73fc743e..ed3373e9699d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/_vendor.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/_vendor.py @@ -10,7 +10,12 @@ def _convert_request(request, files=None): data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + request = HttpRequest( + method=request.method, + url=request.url, + headers=request.headers, + data=data, + ) if files: request.set_formdata_body(files) return request @@ -23,5 +28,9 @@ def _format_url_section(template, **kwargs): return template.format(**kwargs) except KeyError as key: formatted_components = template.split("/") - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] + components = [ + c + for c in formatted_components + if "{}".format(key.args[0]) not in c + ] template = "/".join(components) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/_azure_machine_learning_workspaces.py index af1d827b7dd5..aaf234e34351 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/_azure_machine_learning_workspaces.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/_azure_machine_learning_workspaces.py @@ -213,30 +213,48 @@ def __init__( self._config = AzureMachineLearningWorkspacesConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._client = AsyncARMPipelineClient( + base_url=base_url, config=self._config, **kwargs + ) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = { + k: v for k, v in models.__dict__.items() if isinstance(v, type) + } self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.workspaces = WorkspacesOperations(self._client, self._config, self._serialize, self._deserialize) - self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspaces = WorkspacesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.usages = UsagesOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.virtual_machine_sizes = VirtualMachineSizesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.quotas = QuotasOperations(self._client, self._config, self._serialize, self._deserialize) - self.compute = ComputeOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self.quotas = QuotasOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.compute = ComputeOperations( self._client, self._config, self._serialize, self._deserialize ) + self.private_endpoint_connections = ( + PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) self.private_link_resources = PrivateLinkResourcesOperations( self._client, self._config, self._serialize, self._deserialize ) self.workspace_connections = WorkspaceConnectionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.registries = RegistriesOperations(self._client, self._config, self._serialize, self._deserialize) + self.registries = RegistriesOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.workspace_features = WorkspaceFeaturesOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -246,8 +264,10 @@ def __init__( self.registry_code_versions = RegistryCodeVersionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.registry_component_containers = RegistryComponentContainersOperations( - self._client, self._config, self._serialize, self._deserialize + self.registry_component_containers = ( + RegistryComponentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) ) self.registry_component_versions = RegistryComponentVersionsOperations( self._client, self._config, self._serialize, self._deserialize @@ -258,11 +278,15 @@ def __init__( self.registry_data_versions = RegistryDataVersionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.registry_environment_containers = RegistryEnvironmentContainersOperations( - self._client, self._config, self._serialize, self._deserialize + self.registry_environment_containers = ( + RegistryEnvironmentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) ) - self.registry_environment_versions = RegistryEnvironmentVersionsOperations( - self._client, self._config, self._serialize, self._deserialize + self.registry_environment_versions = ( + RegistryEnvironmentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) ) self.registry_model_containers = RegistryModelContainersOperations( self._client, self._config, self._serialize, self._deserialize @@ -270,21 +294,33 @@ def __init__( self.registry_model_versions = RegistryModelVersionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.batch_endpoints = BatchEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) + self.batch_endpoints = BatchEndpointsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.batch_deployments = BatchDeploymentsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.code_containers = CodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_versions = CodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.code_containers = CodeContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.code_versions = CodeVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.component_containers = ComponentContainersOperations( self._client, self._config, self._serialize, self._deserialize ) self.component_versions = ComponentVersionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.data_containers = DataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_versions = DataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.datastores = DatastoresOperations(self._client, self._config, self._serialize, self._deserialize) + self.data_containers = DataContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_versions = DataVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.datastores = DatastoresOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.environment_containers = EnvironmentContainersOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -297,27 +333,41 @@ def __init__( self.featureset_versions = FeaturesetVersionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.featurestore_entity_containers = FeaturestoreEntityContainersOperations( + self.featurestore_entity_containers = ( + FeaturestoreEntityContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.featurestore_entity_versions = ( + FeaturestoreEntityVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.jobs = JobsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.featurestore_entity_versions = FeaturestoreEntityVersionsOperations( + self.labeling_jobs = LabelingJobsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.labeling_jobs = LabelingJobsOperations(self._client, self._config, self._serialize, self._deserialize) self.model_containers = ModelContainersOperations( self._client, self._config, self._serialize, self._deserialize ) - self.model_versions = ModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.model_versions = ModelVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.online_endpoints = OnlineEndpointsOperations( self._client, self._config, self._serialize, self._deserialize ) self.online_deployments = OnlineDeploymentsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.schedules = SchedulesOperations(self._client, self._config, self._serialize, self._deserialize) + self.schedules = SchedulesOperations( + self._client, self._config, self._serialize, self._deserialize + ) - def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: + def _send_request( + self, request: HttpRequest, **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/_configuration.py index 4404dd346232..3e6e8fbbf3bb 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/_configuration.py @@ -10,7 +10,10 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy +from azure.mgmt.core.policies import ( + ARMHttpLoggingPolicy, + AsyncARMChallengeAuthenticationPolicy, +) from .._version import VERSION @@ -19,7 +22,9 @@ from azure.core.credentials_async import AsyncTokenCredential -class AzureMachineLearningWorkspacesConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AzureMachineLearningWorkspacesConfiguration( + Configuration +): # pylint: disable=too-many-instance-attributes """Configuration for AzureMachineLearningWorkspaces. Note that all parameters used to create this instance are saved as instance @@ -34,9 +39,18 @@ class AzureMachineLearningWorkspacesConfiguration(Configuration): # pylint: dis :paramtype api_version: str """ - def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(AzureMachineLearningWorkspacesConfiguration, self).__init__( + **kwargs + ) + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -46,19 +60,39 @@ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **k self.credential = credential self.subscription_id = subscription_id self.api_version = api_version - self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) - kwargs.setdefault("sdk_moniker", "mgmt-machinelearningservices/{}".format(VERSION)) + self.credential_scopes = kwargs.pop( + "credential_scopes", ["https://management.azure.com/.default"] + ) + kwargs.setdefault( + "sdk_moniker", "mgmt-machinelearningservices/{}".format(VERSION) + ) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: - self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.user_agent_policy = kwargs.get( + "user_agent_policy" + ) or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get( + "headers_policy" + ) or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy( + **kwargs + ) + self.logging_policy = kwargs.get( + "logging_policy" + ) or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get( + "http_logging_policy" + ) or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get( + "retry_policy" + ) or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get( + "custom_hook_policy" + ) or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get( + "redirect_policy" + ) or policies.AsyncRedirectPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/_patch.py index f99e77fef986..17dbc073e01b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/_patch.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/_patch.py @@ -25,6 +25,7 @@ # # -------------------------------------------------------------------------- + # This file is used for handwritten extensions to the generated code. Example: # https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md def patch_sdk(): diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/__init__.py index cbd930017658..dec001f3a13b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/__init__.py @@ -12,21 +12,39 @@ from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations from ._quotas_operations import QuotasOperations from ._compute_operations import ComputeOperations -from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_endpoint_connections_operations import ( + PrivateEndpointConnectionsOperations, +) from ._private_link_resources_operations import PrivateLinkResourcesOperations from ._workspace_connections_operations import WorkspaceConnectionsOperations from ._registries_operations import RegistriesOperations from ._workspace_features_operations import WorkspaceFeaturesOperations -from ._registry_code_containers_operations import RegistryCodeContainersOperations +from ._registry_code_containers_operations import ( + RegistryCodeContainersOperations, +) from ._registry_code_versions_operations import RegistryCodeVersionsOperations -from ._registry_component_containers_operations import RegistryComponentContainersOperations -from ._registry_component_versions_operations import RegistryComponentVersionsOperations -from ._registry_data_containers_operations import RegistryDataContainersOperations +from ._registry_component_containers_operations import ( + RegistryComponentContainersOperations, +) +from ._registry_component_versions_operations import ( + RegistryComponentVersionsOperations, +) +from ._registry_data_containers_operations import ( + RegistryDataContainersOperations, +) from ._registry_data_versions_operations import RegistryDataVersionsOperations -from ._registry_environment_containers_operations import RegistryEnvironmentContainersOperations -from ._registry_environment_versions_operations import RegistryEnvironmentVersionsOperations -from ._registry_model_containers_operations import RegistryModelContainersOperations -from ._registry_model_versions_operations import RegistryModelVersionsOperations +from ._registry_environment_containers_operations import ( + RegistryEnvironmentContainersOperations, +) +from ._registry_environment_versions_operations import ( + RegistryEnvironmentVersionsOperations, +) +from ._registry_model_containers_operations import ( + RegistryModelContainersOperations, +) +from ._registry_model_versions_operations import ( + RegistryModelVersionsOperations, +) from ._batch_endpoints_operations import BatchEndpointsOperations from ._batch_deployments_operations import BatchDeploymentsOperations from ._code_containers_operations import CodeContainersOperations @@ -40,8 +58,12 @@ from ._environment_versions_operations import EnvironmentVersionsOperations from ._featureset_containers_operations import FeaturesetContainersOperations from ._featureset_versions_operations import FeaturesetVersionsOperations -from ._featurestore_entity_containers_operations import FeaturestoreEntityContainersOperations -from ._featurestore_entity_versions_operations import FeaturestoreEntityVersionsOperations +from ._featurestore_entity_containers_operations import ( + FeaturestoreEntityContainersOperations, +) +from ._featurestore_entity_versions_operations import ( + FeaturestoreEntityVersionsOperations, +) from ._jobs_operations import JobsOperations from ._labeling_jobs_operations import LabelingJobsOperations from ._model_containers_operations import ModelContainersOperations diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_batch_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_batch_deployments_operations.py index 29ca23a25950..e85936b68e7c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_batch_deployments_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_batch_deployments_operations.py @@ -18,7 +18,11 @@ ) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -36,7 +40,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class BatchDeploymentsOperations: @@ -71,7 +80,9 @@ def list( top: Optional[int] = None, skip: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.BatchDeploymentTrackedResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.BatchDeploymentTrackedResourceArmPaginatedResult" + ]: """Lists Batch inference deployments in the workspace. Lists Batch inference deployments in the workspace. @@ -95,10 +106,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.BatchDeploymentTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -137,7 +156,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("BatchDeploymentTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "BatchDeploymentTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -152,9 +174,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -163,13 +193,24 @@ async def get_next(next_link=None): list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, endpoint_name: str, deployment_name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + endpoint_name: str, + deployment_name: str, + **kwargs: Any ) -> None: cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -189,16 +230,29 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, None, response_headers) @@ -207,7 +261,12 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, endpoint_name: str, deployment_name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + endpoint_name: str, + deployment_name: str, + **kwargs: Any ) -> AsyncLROPoller[None]: """Delete Batch Inference deployment (asynchronous). @@ -233,11 +292,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -255,7 +322,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -267,13 +338,20 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def get( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, deployment_name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + endpoint_name: str, + deployment_name: str, + **kwargs: Any ) -> "_models.BatchDeployment": """Gets a batch inference deployment by id. @@ -292,11 +370,19 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.BatchDeployment :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchDeployment"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -316,9 +402,17 @@ async def get( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("BatchDeployment", pipeline_response) @@ -338,14 +432,27 @@ async def _update_initial( body: "_models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties", **kwargs: Any ) -> Optional["_models.BatchDeployment"]: - cls = kwargs.pop("cls", None) # type: ClsType[Optional["_models.BatchDeployment"]] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.BatchDeployment"]] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, "PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties") + _json = self._serialize.body( + body, + "PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties", + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -367,20 +474,35 @@ async def _update_initial( response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("BatchDeployment", pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -428,12 +550,24 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchDeployment"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -450,7 +584,9 @@ async def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("BatchDeployment", pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized @@ -468,7 +604,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @@ -481,12 +619,22 @@ async def _create_or_update_initial( body: "_models.BatchDeployment", **kwargs: Any ) -> "_models.BatchDeployment": - cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchDeployment"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "BatchDeployment") @@ -510,22 +658,35 @@ async def _create_or_update_initial( response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("BatchDeployment", pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if response.status_code == 201: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) ) response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) - deserialized = self._deserialize("BatchDeployment", pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -572,12 +733,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchDeployment"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -594,13 +767,19 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("BatchDeployment", pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -612,6 +791,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_batch_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_batch_endpoints_operations.py index db542ac3d1f2..10e9556668e6 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_batch_endpoints_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_batch_endpoints_operations.py @@ -18,7 +18,11 @@ ) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -37,7 +41,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class BatchEndpointsOperations: @@ -70,7 +79,9 @@ def list( count: Optional[int] = None, skip: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.BatchEndpointTrackedResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.BatchEndpointTrackedResourceArmPaginatedResult" + ]: """Lists Batch inference endpoint in the workspace. Lists Batch inference endpoint in the workspace. @@ -90,10 +101,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.BatchEndpointTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -128,7 +147,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("BatchEndpointTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "BatchEndpointTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -143,9 +165,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -154,13 +184,23 @@ async def get_next(next_link=None): list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, endpoint_name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + endpoint_name: str, + **kwargs: Any ) -> None: cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -179,16 +219,29 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, None, response_headers) @@ -197,7 +250,11 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, endpoint_name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + endpoint_name: str, + **kwargs: Any ) -> AsyncLROPoller[None]: """Delete Batch Inference Endpoint (asynchronous). @@ -221,11 +278,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -242,7 +307,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -254,13 +323,19 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def get( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + endpoint_name: str, + **kwargs: Any ) -> "_models.BatchEndpoint": """Gets a batch inference endpoint by name. @@ -278,10 +353,16 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -300,9 +381,17 @@ async def get( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("BatchEndpoint", pipeline_response) @@ -321,14 +410,26 @@ async def _update_initial( body: "_models.PartialMinimalTrackedResourceWithIdentity", **kwargs: Any ) -> Optional["_models.BatchEndpoint"]: - cls = kwargs.pop("cls", None) # type: ClsType[Optional["_models.BatchEndpoint"]] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.BatchEndpoint"]] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, "PartialMinimalTrackedResourceWithIdentity") + _json = self._serialize.body( + body, "PartialMinimalTrackedResourceWithIdentity" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -349,20 +450,35 @@ async def _update_initial( response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("BatchEndpoint", pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -407,12 +523,22 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -428,7 +554,9 @@ async def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("BatchEndpoint", pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized @@ -446,7 +574,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @@ -459,11 +589,19 @@ async def _create_or_update_initial( **kwargs: Any ) -> "_models.BatchEndpoint": cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "BatchEndpoint") @@ -486,22 +624,35 @@ async def _create_or_update_initial( response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("BatchEndpoint", pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if response.status_code == 201: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) ) response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) - deserialized = self._deserialize("BatchEndpoint", pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -545,12 +696,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -566,13 +727,19 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("BatchEndpoint", pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -584,13 +751,19 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def list_keys( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + endpoint_name: str, + **kwargs: Any ) -> "_models.EndpointAuthKeys": """Lists batch Inference Endpoint keys. @@ -607,11 +780,19 @@ async def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.EndpointAuthKeys"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthKeys"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_list_keys_request( subscription_id=self._config.subscription_id, @@ -630,9 +811,17 @@ async def list_keys( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("EndpointAuthKeys", pipeline_response) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_code_containers_operations.py index cc1bb58b8721..1e5c350dda76 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_code_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_code_containers_operations.py @@ -33,7 +33,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class CodeContainersOperations: @@ -60,7 +65,11 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list( - self, resource_group_name: str, workspace_name: str, skip: Optional[str] = None, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + skip: Optional[str] = None, + **kwargs: Any ) -> AsyncIterable["_models.CodeContainerResourceArmPaginatedResult"]: """List containers. @@ -79,10 +88,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -115,7 +132,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -130,9 +149,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -142,7 +169,11 @@ async def get_next(next_link=None): @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + name: str, + **kwargs: Any ) -> None: """Delete container. @@ -160,10 +191,16 @@ async def delete( # pylint: disable=inconsistent-return-statements :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request( subscription_id=self._config.subscription_id, @@ -182,9 +219,17 @@ async def delete( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -193,7 +238,11 @@ async def delete( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def get( - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + name: str, + **kwargs: Any ) -> "_models.CodeContainer": """Get container. @@ -211,10 +260,16 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -233,9 +288,17 @@ async def get( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("CodeContainer", pipeline_response) @@ -248,7 +311,12 @@ async def get( @distributed_trace_async async def create_or_update( - self, resource_group_name: str, workspace_name: str, name: str, body: "_models.CodeContainer", **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + name: str, + body: "_models.CodeContainer", + **kwargs: Any ) -> "_models.CodeContainer": """Create or update container. @@ -268,11 +336,19 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "CodeContainer") @@ -295,15 +371,27 @@ async def create_or_update( response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize("CodeContainer", pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize("CodeContainer", pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_code_versions_operations.py index 2bdbad859c47..27b43444ca0b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_code_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_code_versions_operations.py @@ -33,7 +33,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class CodeVersionsOperations: @@ -92,10 +97,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -134,7 +147,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -149,9 +164,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -161,7 +184,12 @@ async def get_next(next_link=None): @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + name: str, + version: str, + **kwargs: Any ) -> None: """Delete version. @@ -181,10 +209,16 @@ async def delete( # pylint: disable=inconsistent-return-statements :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request( subscription_id=self._config.subscription_id, @@ -204,9 +238,17 @@ async def delete( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -215,7 +257,12 @@ async def delete( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def get( - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + name: str, + version: str, + **kwargs: Any ) -> "_models.CodeVersion": """Get version. @@ -235,10 +282,16 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -258,9 +311,17 @@ async def get( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("CodeVersion", pipeline_response) @@ -301,11 +362,19 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "CodeVersion") @@ -329,9 +398,17 @@ async def create_or_update( response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: deserialized = self._deserialize("CodeVersion", pipeline_response) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_component_containers_operations.py index 805a189f053a..214254efb222 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_component_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_component_containers_operations.py @@ -33,7 +33,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class ComponentContainersOperations: @@ -86,10 +91,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -124,7 +137,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -139,9 +155,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -151,7 +175,11 @@ async def get_next(next_link=None): @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + name: str, + **kwargs: Any ) -> None: """Delete container. @@ -169,10 +197,16 @@ async def delete( # pylint: disable=inconsistent-return-statements :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request( subscription_id=self._config.subscription_id, @@ -191,9 +225,17 @@ async def delete( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -202,7 +244,11 @@ async def delete( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def get( - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + name: str, + **kwargs: Any ) -> "_models.ComponentContainer": """Get container. @@ -219,11 +265,19 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComponentContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -242,11 +296,21 @@ async def get( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("ComponentContainer", pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -281,12 +345,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComponentContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "ComponentContainer") @@ -309,15 +383,27 @@ async def create_or_update( response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize("ComponentContainer", pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize("ComponentContainer", pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_component_versions_operations.py index 2707a6a6e2d5..db680c711c46 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_component_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_component_versions_operations.py @@ -33,7 +33,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class ComponentVersionsOperations: @@ -95,10 +100,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -139,7 +152,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -154,9 +169,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -166,7 +189,12 @@ async def get_next(next_link=None): @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + name: str, + version: str, + **kwargs: Any ) -> None: """Delete version. @@ -186,10 +214,16 @@ async def delete( # pylint: disable=inconsistent-return-statements :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request( subscription_id=self._config.subscription_id, @@ -209,9 +243,17 @@ async def delete( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -220,7 +262,12 @@ async def delete( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def get( - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + name: str, + version: str, + **kwargs: Any ) -> "_models.ComponentVersion": """Get version. @@ -239,11 +286,19 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComponentVersion"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -263,9 +318,17 @@ async def get( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("ComponentVersion", pipeline_response) @@ -305,12 +368,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComponentVersion"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "ComponentVersion") @@ -334,15 +407,27 @@ async def create_or_update( response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize("ComponentVersion", pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize("ComponentVersion", pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_compute_operations.py index f7671fa05a31..9110610d73b9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_compute_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_compute_operations.py @@ -6,7 +6,16 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, List, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + List, + Optional, + TypeVar, + Union, +) from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -18,7 +27,11 @@ ) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -43,7 +56,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class ComputeOperations: @@ -70,7 +88,11 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list( - self, resource_group_name: str, workspace_name: str, skip: Optional[str] = None, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + skip: Optional[str] = None, + **kwargs: Any ) -> AsyncIterable["_models.PaginatedComputeResourcesList"]: """Gets computes in specified workspace. @@ -87,10 +109,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedComputeResourcesList] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.PaginatedComputeResourcesList"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedComputeResourcesList"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -123,7 +153,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedComputeResourcesList", pipeline_response) + deserialized = self._deserialize( + "PaginatedComputeResourcesList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -138,9 +170,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -150,7 +190,11 @@ async def get_next(next_link=None): @distributed_trace_async async def get( - self, resource_group_name: str, workspace_name: str, compute_name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + compute_name: str, + **kwargs: Any ) -> "_models.ComputeResource": """Gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are not returned - use 'keys' nested resource to get them. @@ -166,11 +210,19 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComputeResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComputeResource"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -189,9 +241,17 @@ async def get( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("ComputeResource", pipeline_response) @@ -210,12 +270,22 @@ async def _create_or_update_initial( parameters: "_models.ComputeResource", **kwargs: Any ) -> "_models.ComputeResource": - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComputeResource"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(parameters, "ComputeResource") @@ -238,19 +308,29 @@ async def _create_or_update_initial( response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("ComputeResource", pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if response.status_code == 201: response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) - deserialized = self._deserialize("ComputeResource", pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -294,12 +374,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComputeResource"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -315,7 +407,9 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("ComputeResource", pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized @@ -333,7 +427,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @@ -345,12 +441,22 @@ async def _update_initial( parameters: "_models.ClusterUpdateParameters", **kwargs: Any ) -> "_models.ComputeResource": - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComputeResource"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(parameters, "ClusterUpdateParameters") @@ -373,8 +479,14 @@ async def _update_initial( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = self._deserialize("ComputeResource", pipeline_response) @@ -419,12 +531,24 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComputeResource"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -440,7 +564,9 @@ async def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("ComputeResource", pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized @@ -458,7 +584,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @@ -467,14 +595,22 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements resource_group_name: str, workspace_name: str, compute_name: str, - underlying_resource_action: Union[str, "_models.UnderlyingResourceAction"], + underlying_resource_action: Union[ + str, "_models.UnderlyingResourceAction" + ], **kwargs: Any ) -> None: cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -494,15 +630,23 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) if cls: return cls(pipeline_response, None, response_headers) @@ -515,7 +659,9 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements resource_group_name: str, workspace_name: str, compute_name: str, - underlying_resource_action: Union[str, "_models.UnderlyingResourceAction"], + underlying_resource_action: Union[ + str, "_models.UnderlyingResourceAction" + ], **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes specified Machine Learning compute. @@ -542,11 +688,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -576,7 +730,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @@ -605,11 +761,19 @@ async def update_custom_services( # pylint: disable=inconsistent-return-stateme :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(custom_services, "[CustomService]") @@ -632,9 +796,17 @@ async def update_custom_services( # pylint: disable=inconsistent-return-stateme response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -643,7 +815,11 @@ async def update_custom_services( # pylint: disable=inconsistent-return-stateme @distributed_trace def list_nodes( - self, resource_group_name: str, workspace_name: str, compute_name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + compute_name: str, + **kwargs: Any ) -> AsyncIterable["_models.AmlComputeNodesInformation"]: """Get the details (e.g IP address, port etc) of all the compute nodes in the compute. @@ -660,10 +836,18 @@ def list_nodes( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.AmlComputeNodesInformation] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.AmlComputeNodesInformation"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.AmlComputeNodesInformation"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -696,7 +880,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("AmlComputeNodesInformation", pipeline_response) + deserialized = self._deserialize( + "AmlComputeNodesInformation", pipeline_response + ) list_of_elem = deserialized.nodes if cls: list_of_elem = cls(list_of_elem) @@ -711,9 +897,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -723,7 +917,11 @@ async def get_next(next_link=None): @distributed_trace_async async def list_keys( - self, resource_group_name: str, workspace_name: str, compute_name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + compute_name: str, + **kwargs: Any ) -> "_models.ComputeSecrets": """Gets secrets related to Machine Learning compute (storage keys, service credentials, etc). @@ -738,11 +936,19 @@ async def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ComputeSecrets :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComputeSecrets"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeSecrets"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_list_keys_request( subscription_id=self._config.subscription_id, @@ -761,9 +967,17 @@ async def list_keys( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("ComputeSecrets", pipeline_response) @@ -775,13 +989,23 @@ async def list_keys( list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys"} # type: ignore async def _start_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, compute_name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + compute_name: str, + **kwargs: Any ) -> None: cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_start_request_initial( subscription_id=self._config.subscription_id, @@ -800,8 +1024,14 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -810,7 +1040,11 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def begin_start( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, compute_name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + compute_name: str, + **kwargs: Any ) -> AsyncLROPoller[None]: """Posts a start action to a compute instance. @@ -832,11 +1066,19 @@ async def begin_start( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._start_initial( resource_group_name=resource_group_name, @@ -865,18 +1107,30 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_start.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore async def _stop_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, compute_name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + compute_name: str, + **kwargs: Any ) -> None: cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_stop_request_initial( subscription_id=self._config.subscription_id, @@ -895,8 +1149,14 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -905,7 +1165,11 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def begin_stop( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, compute_name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + compute_name: str, + **kwargs: Any ) -> AsyncLROPoller[None]: """Posts a stop action to a compute instance. @@ -927,11 +1191,19 @@ async def begin_stop( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._stop_initial( resource_group_name=resource_group_name, @@ -960,18 +1232,30 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_stop.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore async def _restart_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, compute_name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + compute_name: str, + **kwargs: Any ) -> None: cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_restart_request_initial( subscription_id=self._config.subscription_id, @@ -990,8 +1274,14 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -1000,7 +1290,11 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def begin_restart( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, compute_name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + compute_name: str, + **kwargs: Any ) -> AsyncLROPoller[None]: """Posts a restart action to a compute instance. @@ -1022,11 +1316,19 @@ async def begin_restart( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._restart_initial( resource_group_name=resource_group_name, @@ -1055,7 +1357,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_restart.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore @@ -1084,11 +1388,19 @@ async def update_idle_shutdown_setting( # pylint: disable=inconsistent-return-s :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(parameters, "IdleShutdownSetting") @@ -1111,9 +1423,17 @@ async def update_idle_shutdown_setting( # pylint: disable=inconsistent-return-s response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_data_containers_operations.py index c7f4cf6f91a7..5d75935296dc 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_data_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_data_containers_operations.py @@ -33,7 +33,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class DataContainersOperations: @@ -86,10 +91,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -124,7 +137,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -139,9 +154,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -151,7 +174,11 @@ async def get_next(next_link=None): @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + name: str, + **kwargs: Any ) -> None: """Delete container. @@ -169,10 +196,16 @@ async def delete( # pylint: disable=inconsistent-return-statements :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request( subscription_id=self._config.subscription_id, @@ -191,9 +224,17 @@ async def delete( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -202,7 +243,11 @@ async def delete( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def get( - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + name: str, + **kwargs: Any ) -> "_models.DataContainer": """Get container. @@ -220,10 +265,16 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -242,9 +293,17 @@ async def get( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("DataContainer", pipeline_response) @@ -257,7 +316,12 @@ async def get( @distributed_trace_async async def create_or_update( - self, resource_group_name: str, workspace_name: str, name: str, body: "_models.DataContainer", **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + name: str, + body: "_models.DataContainer", + **kwargs: Any ) -> "_models.DataContainer": """Create or update container. @@ -277,11 +341,19 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "DataContainer") @@ -304,15 +376,27 @@ async def create_or_update( response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize("DataContainer", pipeline_response) + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize("DataContainer", pipeline_response) + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_data_versions_operations.py index c077bc314f34..9d51ad299b31 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_data_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_data_versions_operations.py @@ -33,7 +33,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class DataVersionsOperations: @@ -102,10 +107,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -148,7 +161,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataVersionBaseResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -163,9 +178,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -175,7 +198,12 @@ async def get_next(next_link=None): @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + name: str, + version: str, + **kwargs: Any ) -> None: """Delete version. @@ -195,10 +223,16 @@ async def delete( # pylint: disable=inconsistent-return-statements :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request( subscription_id=self._config.subscription_id, @@ -218,9 +252,17 @@ async def delete( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -229,7 +271,12 @@ async def delete( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def get( - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + name: str, + version: str, + **kwargs: Any ) -> "_models.DataVersionBase": """Get version. @@ -248,11 +295,19 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.DataVersionBase"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -272,9 +327,17 @@ async def get( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("DataVersionBase", pipeline_response) @@ -314,12 +377,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.DataVersionBase"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "DataVersionBase") @@ -343,15 +416,27 @@ async def create_or_update( response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize("DataVersionBase", pipeline_response) + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize("DataVersionBase", pipeline_response) + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_datastores_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_datastores_operations.py index 3934a380bf4f..9d81befdba67 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_datastores_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_datastores_operations.py @@ -34,7 +34,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class DatastoresOperations: @@ -102,10 +107,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DatastoreResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -150,7 +163,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("DatastoreResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DatastoreResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -165,9 +180,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -177,7 +200,11 @@ async def get_next(next_link=None): @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + name: str, + **kwargs: Any ) -> None: """Delete datastore. @@ -195,10 +222,16 @@ async def delete( # pylint: disable=inconsistent-return-statements :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request( subscription_id=self._config.subscription_id, @@ -217,9 +250,17 @@ async def delete( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -227,7 +268,13 @@ async def delete( # pylint: disable=inconsistent-return-statements delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace_async - async def get(self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any) -> "_models.Datastore": + async def get( + self, + resource_group_name: str, + workspace_name: str, + name: str, + **kwargs: Any + ) -> "_models.Datastore": """Get datastore. Get datastore. @@ -244,10 +291,16 @@ async def get(self, resource_group_name: str, workspace_name: str, name: str, ** :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType["_models.Datastore"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -266,9 +319,17 @@ async def get(self, resource_group_name: str, workspace_name: str, name: str, ** response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("Datastore", pipeline_response) @@ -309,11 +370,19 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType["_models.Datastore"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "Datastore") @@ -337,9 +406,17 @@ async def create_or_update( response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: deserialized = self._deserialize("Datastore", pipeline_response) @@ -356,7 +433,11 @@ async def create_or_update( @distributed_trace_async async def list_secrets( - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + name: str, + **kwargs: Any ) -> "_models.DatastoreSecrets": """Get datastore secrets. @@ -373,11 +454,19 @@ async def list_secrets( :rtype: ~azure.mgmt.machinelearningservices.models.DatastoreSecrets :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.DatastoreSecrets"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DatastoreSecrets"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_list_secrets_request( subscription_id=self._config.subscription_id, @@ -396,9 +485,17 @@ async def list_secrets( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("DatastoreSecrets", pipeline_response) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_environment_containers_operations.py index 354e7f90ca5c..379340b67aab 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_environment_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_environment_containers_operations.py @@ -33,7 +33,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class EnvironmentContainersOperations: @@ -66,7 +71,9 @@ def list( skip: Optional[str] = None, list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, **kwargs: Any - ) -> AsyncIterable["_models.EnvironmentContainerResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.EnvironmentContainerResourceArmPaginatedResult" + ]: """List environment containers. List environment containers. @@ -86,10 +93,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -124,7 +139,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -139,9 +157,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -151,7 +177,11 @@ async def get_next(next_link=None): @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + name: str, + **kwargs: Any ) -> None: """Delete container. @@ -169,10 +199,16 @@ async def delete( # pylint: disable=inconsistent-return-statements :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request( subscription_id=self._config.subscription_id, @@ -191,9 +227,17 @@ async def delete( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -202,7 +246,11 @@ async def delete( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def get( - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + name: str, + **kwargs: Any ) -> "_models.EnvironmentContainer": """Get container. @@ -219,11 +267,19 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.EnvironmentContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -242,11 +298,21 @@ async def get( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("EnvironmentContainer", pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -281,12 +347,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.EnvironmentContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "EnvironmentContainer") @@ -309,15 +385,27 @@ async def create_or_update( response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize("EnvironmentContainer", pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize("EnvironmentContainer", pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_environment_versions_operations.py index 2b7ba57fef76..316550bece56 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_environment_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_environment_versions_operations.py @@ -33,7 +33,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class EnvironmentVersionsOperations: @@ -95,10 +100,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -139,7 +152,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersionResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -154,9 +170,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -166,7 +190,12 @@ async def get_next(next_link=None): @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + name: str, + version: str, + **kwargs: Any ) -> None: """Delete version. @@ -186,10 +215,16 @@ async def delete( # pylint: disable=inconsistent-return-statements :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request( subscription_id=self._config.subscription_id, @@ -209,9 +244,17 @@ async def delete( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -220,7 +263,12 @@ async def delete( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def get( - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + name: str, + version: str, + **kwargs: Any ) -> "_models.EnvironmentVersion": """Get version. @@ -239,11 +287,19 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.EnvironmentVersion"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -263,11 +319,21 @@ async def get( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("EnvironmentVersion", pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -305,12 +371,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.EnvironmentVersion"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "EnvironmentVersion") @@ -334,15 +410,27 @@ async def create_or_update( response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize("EnvironmentVersion", pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize("EnvironmentVersion", pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_featureset_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_featureset_containers_operations.py index 729a5ef162c8..fc9bf31ad4de 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_featureset_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_featureset_containers_operations.py @@ -18,7 +18,11 @@ ) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -35,7 +39,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class FeaturesetContainersOperations: @@ -69,7 +78,9 @@ def list( tags: Optional[str] = None, list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, **kwargs: Any - ) -> AsyncIterable["_models.FeaturesetContainerResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.FeaturesetContainerResourceArmPaginatedResult" + ]: """List featurestore entity containers. List featurestore entity containers. @@ -93,10 +104,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeaturesetContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.FeaturesetContainerResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetContainerResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -133,7 +152,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturesetContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "FeaturesetContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -148,9 +170,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -159,13 +189,23 @@ async def get_next(next_link=None): list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + name: str, + **kwargs: Any ) -> None: cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -184,16 +224,29 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, None, response_headers) @@ -202,7 +255,11 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + name: str, + **kwargs: Any ) -> AsyncLROPoller[None]: """Delete container. @@ -226,11 +283,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -247,7 +312,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -259,13 +328,19 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore @distributed_trace_async async def get_entity( - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + name: str, + **kwargs: Any ) -> "_models.FeaturesetContainer": """Get container. @@ -282,11 +357,19 @@ async def get_entity( :rtype: ~azure.mgmt.machinelearningservices.models.FeaturesetContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.FeaturesetContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetContainer"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_entity_request( subscription_id=self._config.subscription_id, @@ -305,11 +388,21 @@ async def get_entity( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("FeaturesetContainer", pipeline_response) + deserialized = self._deserialize( + "FeaturesetContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -326,12 +419,22 @@ async def _create_or_update_initial( body: "_models.FeaturesetContainer", **kwargs: Any ) -> "_models.FeaturesetContainer": - cls = kwargs.pop("cls", None) # type: ClsType["_models.FeaturesetContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetContainer"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "FeaturesetContainer") @@ -354,22 +457,35 @@ async def _create_or_update_initial( response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("FeaturesetContainer", pipeline_response) + deserialized = self._deserialize( + "FeaturesetContainer", pipeline_response + ) if response.status_code == 201: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) ) response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) - deserialized = self._deserialize("FeaturesetContainer", pipeline_response) + deserialized = self._deserialize( + "FeaturesetContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -413,12 +529,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.FeaturesetContainer"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetContainer"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -434,13 +562,19 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("FeaturesetContainer", pipeline_response) + deserialized = self._deserialize( + "FeaturesetContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -452,6 +586,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_featureset_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_featureset_versions_operations.py index 9816963be4bb..f7c3572129fe 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_featureset_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_featureset_versions_operations.py @@ -18,7 +18,11 @@ ) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -39,7 +43,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class FeaturesetVersionsOperations: @@ -100,10 +109,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeaturesetVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.FeaturesetVersionResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetVersionResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -142,7 +159,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturesetVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "FeaturesetVersionResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -157,9 +177,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -168,13 +196,24 @@ async def get_next(next_link=None): list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + name: str, + version: str, + **kwargs: Any ) -> None: cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -194,16 +233,29 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, None, response_headers) @@ -212,7 +264,12 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + name: str, + version: str, + **kwargs: Any ) -> AsyncLROPoller[None]: """Delete version. @@ -238,11 +295,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -260,7 +325,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -272,13 +341,20 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + name: str, + version: str, + **kwargs: Any ) -> "_models.FeaturesetVersion": """Get version. @@ -297,11 +373,19 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.FeaturesetVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.FeaturesetVersion"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetVersion"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -321,11 +405,21 @@ async def get( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("FeaturesetVersion", pipeline_response) + deserialized = self._deserialize( + "FeaturesetVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -343,12 +437,22 @@ async def _create_or_update_initial( body: "_models.FeaturesetVersion", **kwargs: Any ) -> "_models.FeaturesetVersion": - cls = kwargs.pop("cls", None) # type: ClsType["_models.FeaturesetVersion"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetVersion"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "FeaturesetVersion") @@ -372,22 +476,35 @@ async def _create_or_update_initial( response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("FeaturesetVersion", pipeline_response) + deserialized = self._deserialize( + "FeaturesetVersion", pipeline_response + ) if response.status_code == 201: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) ) response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) - deserialized = self._deserialize("FeaturesetVersion", pipeline_response) + deserialized = self._deserialize( + "FeaturesetVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -434,12 +551,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.FeaturesetVersion"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetVersion"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -456,13 +585,19 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("FeaturesetVersion", pipeline_response) + deserialized = self._deserialize( + "FeaturesetVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -474,7 +609,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore @@ -487,12 +624,22 @@ async def _backfill_initial( body: "_models.FeaturesetVersionBackfillRequest", **kwargs: Any ) -> Optional["_models.FeaturesetVersionBackfillResponse"]: - cls = kwargs.pop("cls", None) # type: ClsType[Optional["_models.FeaturesetVersionBackfillResponse"]] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.FeaturesetVersionBackfillResponse"]] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "FeaturesetVersionBackfillRequest") @@ -516,17 +663,29 @@ async def _backfill_initial( response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("FeaturesetVersionBackfillResponse", pipeline_response) + deserialized = self._deserialize( + "FeaturesetVersionBackfillResponse", pipeline_response + ) if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -573,12 +732,24 @@ async def begin_backfill( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetVersionBackfillResponse] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.FeaturesetVersionBackfillResponse"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetVersionBackfillResponse"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._backfill_initial( resource_group_name=resource_group_name, @@ -595,13 +766,19 @@ async def begin_backfill( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("FeaturesetVersionBackfillResponse", pipeline_response) + deserialized = self._deserialize( + "FeaturesetVersionBackfillResponse", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -613,7 +790,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_backfill.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill"} # type: ignore @@ -647,11 +826,19 @@ async def get_feature( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType["_models.Feature"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "GetFeatureRequest") @@ -675,9 +862,17 @@ async def get_feature( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("Feature", pipeline_response) @@ -723,10 +918,18 @@ def list_features( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeatureArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.FeatureArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeatureArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -765,7 +968,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("FeatureArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "FeatureArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -780,9 +985,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -831,10 +1044,18 @@ def list_materialization_jobs( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeaturesetJobArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.FeaturesetJobArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetJobArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -851,7 +1072,9 @@ def prepare_request(next_link=None): filters=filters, feature_window_start=feature_window_start, feature_window_end=feature_window_end, - template_url=self.list_materialization_jobs.metadata["url"], + template_url=self.list_materialization_jobs.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) @@ -877,7 +1100,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturesetJobArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "FeaturesetJobArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -892,9 +1117,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_featurestore_entity_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_featurestore_entity_containers_operations.py index a5b0e1626da4..37242da52305 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_featurestore_entity_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_featurestore_entity_containers_operations.py @@ -18,7 +18,11 @@ ) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -35,7 +39,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class FeaturestoreEntityContainersOperations: @@ -69,7 +78,9 @@ def list( tags: Optional[str] = None, list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, **kwargs: Any - ) -> AsyncIterable["_models.FeaturestoreEntityContainerResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.FeaturestoreEntityContainerResourceArmPaginatedResult" + ]: """List featurestore entity containers. List featurestore entity containers. @@ -93,10 +104,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.FeaturestoreEntityContainerResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturestoreEntityContainerResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -133,7 +152,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturestoreEntityContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "FeaturestoreEntityContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -148,9 +170,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -159,13 +189,23 @@ async def get_next(next_link=None): list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + name: str, + **kwargs: Any ) -> None: cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -184,16 +224,29 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, None, response_headers) @@ -202,7 +255,11 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + name: str, + **kwargs: Any ) -> AsyncLROPoller[None]: """Delete container. @@ -226,11 +283,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -247,7 +312,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -259,13 +328,19 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore @distributed_trace_async async def get_entity( - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + name: str, + **kwargs: Any ) -> "_models.FeaturestoreEntityContainer": """Get container. @@ -282,11 +357,19 @@ async def get_entity( :rtype: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.FeaturestoreEntityContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturestoreEntityContainer"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_entity_request( subscription_id=self._config.subscription_id, @@ -305,11 +388,21 @@ async def get_entity( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("FeaturestoreEntityContainer", pipeline_response) + deserialized = self._deserialize( + "FeaturestoreEntityContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -326,12 +419,22 @@ async def _create_or_update_initial( body: "_models.FeaturestoreEntityContainer", **kwargs: Any ) -> "_models.FeaturestoreEntityContainer": - cls = kwargs.pop("cls", None) # type: ClsType["_models.FeaturestoreEntityContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturestoreEntityContainer"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "FeaturestoreEntityContainer") @@ -354,22 +457,35 @@ async def _create_or_update_initial( response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("FeaturestoreEntityContainer", pipeline_response) + deserialized = self._deserialize( + "FeaturestoreEntityContainer", pipeline_response + ) if response.status_code == 201: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) ) response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) - deserialized = self._deserialize("FeaturestoreEntityContainer", pipeline_response) + deserialized = self._deserialize( + "FeaturestoreEntityContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -413,12 +529,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.FeaturestoreEntityContainer"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturestoreEntityContainer"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -434,13 +562,19 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("FeaturestoreEntityContainer", pipeline_response) + deserialized = self._deserialize( + "FeaturestoreEntityContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -452,6 +586,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_featurestore_entity_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_featurestore_entity_versions_operations.py index 85add1bd65d9..c324eb4993e4 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_featurestore_entity_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_featurestore_entity_versions_operations.py @@ -18,7 +18,11 @@ ) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -35,7 +39,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class FeaturestoreEntityVersionsOperations: @@ -70,7 +79,9 @@ def list( tags: Optional[str] = None, list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, **kwargs: Any - ) -> AsyncIterable["_models.FeaturestoreEntityVersionResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.FeaturestoreEntityVersionResourceArmPaginatedResult" + ]: """List versions. List versions. @@ -96,10 +107,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.FeaturestoreEntityVersionResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturestoreEntityVersionResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -138,7 +157,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturestoreEntityVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "FeaturestoreEntityVersionResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -153,9 +175,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -164,13 +194,24 @@ async def get_next(next_link=None): list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + name: str, + version: str, + **kwargs: Any ) -> None: cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -190,16 +231,29 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, None, response_headers) @@ -208,7 +262,12 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + name: str, + version: str, + **kwargs: Any ) -> AsyncLROPoller[None]: """Delete version. @@ -234,11 +293,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -256,7 +323,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -268,13 +339,20 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + name: str, + version: str, + **kwargs: Any ) -> "_models.FeaturestoreEntityVersion": """Get version. @@ -293,11 +371,19 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.FeaturestoreEntityVersion"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturestoreEntityVersion"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -317,11 +403,21 @@ async def get( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("FeaturestoreEntityVersion", pipeline_response) + deserialized = self._deserialize( + "FeaturestoreEntityVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -339,12 +435,22 @@ async def _create_or_update_initial( body: "_models.FeaturestoreEntityVersion", **kwargs: Any ) -> "_models.FeaturestoreEntityVersion": - cls = kwargs.pop("cls", None) # type: ClsType["_models.FeaturestoreEntityVersion"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturestoreEntityVersion"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "FeaturestoreEntityVersion") @@ -368,22 +474,35 @@ async def _create_or_update_initial( response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("FeaturestoreEntityVersion", pipeline_response) + deserialized = self._deserialize( + "FeaturestoreEntityVersion", pipeline_response + ) if response.status_code == 201: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) ) response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) - deserialized = self._deserialize("FeaturestoreEntityVersion", pipeline_response) + deserialized = self._deserialize( + "FeaturestoreEntityVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -430,12 +549,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.FeaturestoreEntityVersion"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturestoreEntityVersion"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -452,13 +583,19 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("FeaturestoreEntityVersion", pipeline_response) + deserialized = self._deserialize( + "FeaturestoreEntityVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -470,6 +607,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_jobs_operations.py index 15c199d4f4e3..f27e22150e95 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_jobs_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_jobs_operations.py @@ -18,7 +18,11 @@ ) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -36,7 +40,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class JobsOperations: @@ -104,10 +113,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.JobBaseResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -152,7 +169,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("JobBaseResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "JobBaseResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -167,9 +186,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -178,13 +205,23 @@ async def get_next(next_link=None): list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, id: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + id: str, + **kwargs: Any ) -> None: cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -203,16 +240,29 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, None, response_headers) @@ -221,7 +271,11 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, id: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + id: str, + **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes a Job (asynchronous). @@ -245,11 +299,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -266,7 +328,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -278,12 +344,20 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace_async - async def get(self, resource_group_name: str, workspace_name: str, id: str, **kwargs: Any) -> "_models.JobBase": + async def get( + self, + resource_group_name: str, + workspace_name: str, + id: str, + **kwargs: Any + ) -> "_models.JobBase": """Gets a Job by name/id. Gets a Job by name/id. @@ -300,10 +374,16 @@ async def get(self, resource_group_name: str, workspace_name: str, id: str, **kw :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType["_models.JobBase"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -322,9 +402,17 @@ async def get(self, resource_group_name: str, workspace_name: str, id: str, **kw response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("JobBase", pipeline_response) @@ -337,7 +425,12 @@ async def get(self, resource_group_name: str, workspace_name: str, id: str, **kw @distributed_trace_async async def create_or_update( - self, resource_group_name: str, workspace_name: str, id: str, body: "_models.JobBase", **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + id: str, + body: "_models.JobBase", + **kwargs: Any ) -> "_models.JobBase": """Creates and executes a Job. @@ -357,11 +450,19 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType["_models.JobBase"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "JobBase") @@ -384,9 +485,17 @@ async def create_or_update( response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: deserialized = self._deserialize("JobBase", pipeline_response) @@ -402,13 +511,23 @@ async def create_or_update( create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore async def _cancel_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, id: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + id: str, + **kwargs: Any ) -> None: cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_cancel_request_initial( subscription_id=self._config.subscription_id, @@ -427,13 +546,23 @@ async def _cancel_initial( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) @@ -442,7 +571,11 @@ async def _cancel_initial( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def begin_cancel( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, id: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + id: str, + **kwargs: Any ) -> AsyncLROPoller[None]: """Cancels a Job (asynchronous). @@ -466,11 +599,19 @@ async def begin_cancel( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._cancel_initial( resource_group_name=resource_group_name, @@ -487,7 +628,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -499,6 +644,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_labeling_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_labeling_jobs_operations.py index 38cb3351dd57..11bd744eaae6 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_labeling_jobs_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_labeling_jobs_operations.py @@ -18,7 +18,11 @@ ) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -38,7 +42,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class LabelingJobsOperations: @@ -91,10 +100,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.LabelingJobResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.LabelingJobResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.LabelingJobResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -129,7 +146,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("LabelingJobResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "LabelingJobResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -144,9 +163,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -156,7 +183,11 @@ async def get_next(next_link=None): @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, id: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + id: str, + **kwargs: Any ) -> None: """Delete a labeling job. @@ -174,10 +205,16 @@ async def delete( # pylint: disable=inconsistent-return-statements :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request( subscription_id=self._config.subscription_id, @@ -196,9 +233,17 @@ async def delete( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -237,10 +282,16 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType["_models.LabelingJob"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -261,9 +312,17 @@ async def get( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("LabelingJob", pipeline_response) @@ -275,14 +334,27 @@ async def get( get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore async def _create_or_update_initial( - self, resource_group_name: str, workspace_name: str, id: str, body: "_models.LabelingJob", **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + id: str, + body: "_models.LabelingJob", + **kwargs: Any ) -> "_models.LabelingJob": cls = kwargs.pop("cls", None) # type: ClsType["_models.LabelingJob"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "LabelingJob") @@ -305,16 +377,25 @@ async def _create_or_update_initial( response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: deserialized = self._deserialize("LabelingJob", pipeline_response) if response.status_code == 201: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) ) response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") @@ -331,7 +412,12 @@ async def _create_or_update_initial( @distributed_trace_async async def begin_create_or_update( - self, resource_group_name: str, workspace_name: str, id: str, body: "_models.LabelingJob", **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + id: str, + body: "_models.LabelingJob", + **kwargs: Any ) -> AsyncLROPoller["_models.LabelingJob"]: """Creates or updates a labeling job (asynchronous). @@ -359,12 +445,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.LabelingJob] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType["_models.LabelingJob"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -386,7 +482,11 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -398,19 +498,36 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore async def _export_labels_initial( - self, resource_group_name: str, workspace_name: str, id: str, body: "_models.ExportSummary", **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + id: str, + body: "_models.ExportSummary", + **kwargs: Any ) -> Optional["_models.ExportSummary"]: - cls = kwargs.pop("cls", None) # type: ClsType[Optional["_models.ExportSummary"]] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.ExportSummary"]] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "ExportSummary") @@ -433,17 +550,29 @@ async def _export_labels_initial( response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("ExportSummary", pipeline_response) + deserialized = self._deserialize( + "ExportSummary", pipeline_response + ) if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -454,7 +583,12 @@ async def _export_labels_initial( @distributed_trace_async async def begin_export_labels( - self, resource_group_name: str, workspace_name: str, id: str, body: "_models.ExportSummary", **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + id: str, + body: "_models.ExportSummary", + **kwargs: Any ) -> AsyncLROPoller["_models.ExportSummary"]: """Export labels from a labeling job (asynchronous). @@ -482,12 +616,22 @@ async def begin_export_labels( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ExportSummary] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType["_models.ExportSummary"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._export_labels_initial( resource_group_name=resource_group_name, @@ -503,13 +647,19 @@ async def begin_export_labels( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("ExportSummary", pipeline_response) + deserialized = self._deserialize( + "ExportSummary", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -521,13 +671,19 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_export_labels.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore @distributed_trace_async async def pause( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, id: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + id: str, + **kwargs: Any ) -> None: """Pause a labeling job. @@ -545,10 +701,16 @@ async def pause( # pylint: disable=inconsistent-return-statements :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_pause_request( subscription_id=self._config.subscription_id, @@ -567,9 +729,17 @@ async def pause( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -577,13 +747,23 @@ async def pause( # pylint: disable=inconsistent-return-statements pause.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause"} # type: ignore async def _resume_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, id: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + id: str, + **kwargs: Any ) -> None: cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_resume_request_initial( subscription_id=self._config.subscription_id, @@ -602,13 +782,23 @@ async def _resume_initial( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) @@ -617,7 +807,11 @@ async def _resume_initial( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def begin_resume( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, id: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + id: str, + **kwargs: Any ) -> AsyncLROPoller[None]: """Resume a labeling job (asynchronous). @@ -641,11 +835,19 @@ async def begin_resume( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._resume_initial( resource_group_name=resource_group_name, @@ -662,7 +864,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -674,6 +880,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_resume.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_model_containers_operations.py index 7f941eb87e45..4d2e0f78d2ab 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_model_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_model_containers_operations.py @@ -33,7 +33,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class ModelContainersOperations: @@ -89,10 +94,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -129,7 +142,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -144,9 +159,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -156,7 +179,11 @@ async def get_next(next_link=None): @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + name: str, + **kwargs: Any ) -> None: """Delete container. @@ -174,10 +201,16 @@ async def delete( # pylint: disable=inconsistent-return-statements :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request( subscription_id=self._config.subscription_id, @@ -196,9 +229,17 @@ async def delete( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -207,7 +248,11 @@ async def delete( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def get( - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + name: str, + **kwargs: Any ) -> "_models.ModelContainer": """Get container. @@ -224,11 +269,19 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -247,9 +300,17 @@ async def get( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("ModelContainer", pipeline_response) @@ -262,7 +323,12 @@ async def get( @distributed_trace_async async def create_or_update( - self, resource_group_name: str, workspace_name: str, name: str, body: "_models.ModelContainer", **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + name: str, + body: "_models.ModelContainer", + **kwargs: Any ) -> "_models.ModelContainer": """Create or update container. @@ -281,12 +347,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "ModelContainer") @@ -309,15 +385,27 @@ async def create_or_update( response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize("ModelContainer", pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize("ModelContainer", pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_model_versions_operations.py index 8a5e9b5fd28e..1b82a072900c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_model_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_model_versions_operations.py @@ -18,7 +18,11 @@ ) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -36,7 +40,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class ModelVersionsOperations: @@ -118,10 +127,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -174,7 +191,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -189,9 +208,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -201,7 +228,12 @@ async def get_next(next_link=None): @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + name: str, + version: str, + **kwargs: Any ) -> None: """Delete version. @@ -221,10 +253,16 @@ async def delete( # pylint: disable=inconsistent-return-statements :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request( subscription_id=self._config.subscription_id, @@ -244,9 +282,17 @@ async def delete( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -255,7 +301,12 @@ async def delete( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def get( - self, resource_group_name: str, workspace_name: str, name: str, version: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + name: str, + version: str, + **kwargs: Any ) -> "_models.ModelVersion": """Get version. @@ -275,10 +326,16 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -298,9 +355,17 @@ async def get( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("ModelVersion", pipeline_response) @@ -341,11 +406,19 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "ModelVersion") @@ -369,9 +442,17 @@ async def create_or_update( response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: deserialized = self._deserialize("ModelVersion", pipeline_response) @@ -387,14 +468,30 @@ async def create_or_update( create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore async def _package_initial( - self, resource_group_name: str, workspace_name: str, name: str, version: str, body: Any, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + name: str, + version: str, + body: Any, + **kwargs: Any ) -> Optional["_models.PackageResponse"]: - cls = kwargs.pop("cls", None) # type: ClsType[Optional["_models.PackageResponse"]] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.PackageResponse"]] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "object") @@ -418,17 +515,29 @@ async def _package_initial( response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("PackageResponse", pipeline_response) + deserialized = self._deserialize( + "PackageResponse", pipeline_response + ) if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -439,7 +548,13 @@ async def _package_initial( @distributed_trace_async async def begin_package( - self, resource_group_name: str, workspace_name: str, name: str, version: str, body: Any, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + name: str, + version: str, + body: Any, + **kwargs: Any ) -> AsyncLROPoller["_models.PackageResponse"]: """Model Version Package operation. @@ -469,12 +584,24 @@ async def begin_package( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.PackageResponse] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.PackageResponse"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PackageResponse"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._package_initial( resource_group_name=resource_group_name, @@ -491,13 +618,19 @@ async def begin_package( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("PackageResponse", pipeline_response) + deserialized = self._deserialize( + "PackageResponse", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -509,6 +642,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_package.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_online_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_online_deployments_operations.py index f84bb48b077e..2320bf3a61af 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_online_deployments_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_online_deployments_operations.py @@ -18,7 +18,11 @@ ) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -38,7 +42,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class OnlineDeploymentsOperations: @@ -73,7 +82,9 @@ def list( top: Optional[int] = None, skip: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.OnlineDeploymentTrackedResourceArmPaginatedResult" + ]: """List Inference Endpoint Deployments. List Inference Endpoint Deployments. @@ -97,10 +108,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OnlineDeploymentTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -139,7 +158,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineDeploymentTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "OnlineDeploymentTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -154,9 +176,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -165,13 +195,24 @@ async def get_next(next_link=None): list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, endpoint_name: str, deployment_name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + endpoint_name: str, + deployment_name: str, + **kwargs: Any ) -> None: cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -191,16 +232,29 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, None, response_headers) @@ -209,7 +263,12 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, endpoint_name: str, deployment_name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + endpoint_name: str, + deployment_name: str, + **kwargs: Any ) -> AsyncLROPoller[None]: """Delete Inference Endpoint Deployment (asynchronous). @@ -235,11 +294,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -257,7 +324,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -269,13 +340,20 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def get( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, deployment_name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + endpoint_name: str, + deployment_name: str, + **kwargs: Any ) -> "_models.OnlineDeployment": """Get Inference Deployment Deployment. @@ -294,11 +372,19 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.OnlineDeployment :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.OnlineDeployment"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -318,9 +404,17 @@ async def get( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("OnlineDeployment", pipeline_response) @@ -340,14 +434,26 @@ async def _update_initial( body: "_models.PartialMinimalTrackedResourceWithSku", **kwargs: Any ) -> Optional["_models.OnlineDeployment"]: - cls = kwargs.pop("cls", None) # type: ClsType[Optional["_models.OnlineDeployment"]] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.OnlineDeployment"]] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, "PartialMinimalTrackedResourceWithSku") + _json = self._serialize.body( + body, "PartialMinimalTrackedResourceWithSku" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -369,20 +475,35 @@ async def _update_initial( response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("OnlineDeployment", pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -429,12 +550,24 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.OnlineDeployment"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -451,7 +584,9 @@ async def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("OnlineDeployment", pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized @@ -469,7 +604,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @@ -482,12 +619,22 @@ async def _create_or_update_initial( body: "_models.OnlineDeployment", **kwargs: Any ) -> "_models.OnlineDeployment": - cls = kwargs.pop("cls", None) # type: ClsType["_models.OnlineDeployment"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "OnlineDeployment") @@ -511,22 +658,35 @@ async def _create_or_update_initial( response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("OnlineDeployment", pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if response.status_code == 201: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) ) response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) - deserialized = self._deserialize("OnlineDeployment", pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -573,12 +733,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.OnlineDeployment"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -595,13 +767,19 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("OnlineDeployment", pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -613,7 +791,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @@ -646,12 +826,22 @@ async def get_logs( :rtype: ~azure.mgmt.machinelearningservices.models.DeploymentLogs :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.DeploymentLogs"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DeploymentLogs"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "DeploymentLogsRequest") @@ -675,9 +865,17 @@ async def get_logs( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("DeploymentLogs", pipeline_response) @@ -722,10 +920,18 @@ def list_skus( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.SkuResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.SkuResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.SkuResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -764,7 +970,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("SkuResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "SkuResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -779,9 +987,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_online_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_online_endpoints_operations.py index bc77e0cc8f3f..9f8d1e6ac74f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_online_endpoints_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_online_endpoints_operations.py @@ -18,7 +18,11 @@ ) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -39,7 +43,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class OnlineEndpointsOperations: @@ -71,13 +80,17 @@ def list( workspace_name: str, name: Optional[str] = None, count: Optional[int] = None, - compute_type: Optional[Union[str, "_models.EndpointComputeType"]] = None, + compute_type: Optional[ + Union[str, "_models.EndpointComputeType"] + ] = None, skip: Optional[str] = None, tags: Optional[str] = None, properties: Optional[str] = None, order_by: Optional[Union[str, "_models.OrderString"]] = None, **kwargs: Any - ) -> AsyncIterable["_models.OnlineEndpointTrackedResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.OnlineEndpointTrackedResourceArmPaginatedResult" + ]: """List Online Endpoints. List Online Endpoints. @@ -110,10 +123,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OnlineEndpointTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -158,7 +179,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineEndpointTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "OnlineEndpointTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -173,9 +197,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -184,13 +216,23 @@ async def get_next(next_link=None): list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, endpoint_name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + endpoint_name: str, + **kwargs: Any ) -> None: cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -209,16 +251,29 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, None, response_headers) @@ -227,7 +282,11 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, endpoint_name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + endpoint_name: str, + **kwargs: Any ) -> AsyncLROPoller[None]: """Delete Online Endpoint (asynchronous). @@ -251,11 +310,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -272,7 +339,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -284,13 +355,19 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def get( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + endpoint_name: str, + **kwargs: Any ) -> "_models.OnlineEndpoint": """Get Online Endpoint. @@ -307,11 +384,19 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.OnlineEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.OnlineEndpoint"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -330,9 +415,17 @@ async def get( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("OnlineEndpoint", pipeline_response) @@ -351,14 +444,26 @@ async def _update_initial( body: "_models.PartialMinimalTrackedResourceWithIdentity", **kwargs: Any ) -> Optional["_models.OnlineEndpoint"]: - cls = kwargs.pop("cls", None) # type: ClsType[Optional["_models.OnlineEndpoint"]] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.OnlineEndpoint"]] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, "PartialMinimalTrackedResourceWithIdentity") + _json = self._serialize.body( + body, "PartialMinimalTrackedResourceWithIdentity" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -379,20 +484,35 @@ async def _update_initial( response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("OnlineEndpoint", pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -437,12 +557,24 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.OnlineEndpoint"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -458,7 +590,9 @@ async def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("OnlineEndpoint", pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized @@ -476,7 +610,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @@ -488,12 +624,22 @@ async def _create_or_update_initial( body: "_models.OnlineEndpoint", **kwargs: Any ) -> "_models.OnlineEndpoint": - cls = kwargs.pop("cls", None) # type: ClsType["_models.OnlineEndpoint"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "OnlineEndpoint") @@ -516,22 +662,35 @@ async def _create_or_update_initial( response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("OnlineEndpoint", pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if response.status_code == 201: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) ) response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) - deserialized = self._deserialize("OnlineEndpoint", pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -575,12 +734,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.OnlineEndpoint"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -596,13 +767,19 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("OnlineEndpoint", pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -614,13 +791,19 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def list_keys( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + endpoint_name: str, + **kwargs: Any ) -> "_models.EndpointAuthKeys": """List EndpointAuthKeys for an Endpoint using Key-based authentication. @@ -637,11 +820,19 @@ async def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.EndpointAuthKeys"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthKeys"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_list_keys_request( subscription_id=self._config.subscription_id, @@ -660,9 +851,17 @@ async def list_keys( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("EndpointAuthKeys", pipeline_response) @@ -682,11 +881,19 @@ async def _regenerate_keys_initial( # pylint: disable=inconsistent-return-state **kwargs: Any ) -> None: cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "RegenerateEndpointKeysRequest") @@ -709,13 +916,23 @@ async def _regenerate_keys_initial( # pylint: disable=inconsistent-return-state response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) @@ -755,12 +972,22 @@ async def begin_regenerate_keys( # pylint: disable=inconsistent-return-statemen :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._regenerate_keys_initial( resource_group_name=resource_group_name, @@ -779,7 +1006,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -791,13 +1022,19 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_regenerate_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore @distributed_trace_async async def get_token( - self, resource_group_name: str, workspace_name: str, endpoint_name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + endpoint_name: str, + **kwargs: Any ) -> "_models.EndpointAuthToken": """Retrieve a valid AAD token for an Endpoint using AMLToken-based authentication. @@ -814,11 +1051,19 @@ async def get_token( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthToken :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.EndpointAuthToken"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthToken"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_token_request( subscription_id=self._config.subscription_id, @@ -837,11 +1082,21 @@ async def get_token( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("EndpointAuthToken", pipeline_response) + deserialized = self._deserialize( + "EndpointAuthToken", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_operations.py index 7bfacf64e0c1..b7f0fda80784 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_operations.py @@ -27,7 +27,12 @@ from ...operations._operations import build_list_request T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class Operations: @@ -53,7 +58,9 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._config = config @distributed_trace - def list(self, **kwargs: Any) -> AsyncIterable["_models.AmlOperationListResult"]: + def list( + self, **kwargs: Any + ) -> AsyncIterable["_models.AmlOperationListResult"]: """Lists all of the available Azure Machine Learning Services REST API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -63,10 +70,18 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.AmlOperationListResult"] ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.AmlOperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.AmlOperationListResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.AmlOperationListResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -91,7 +106,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("AmlOperationListResult", pipeline_response) + deserialized = self._deserialize( + "AmlOperationListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -106,9 +123,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_private_endpoint_connections_operations.py index 25e58d070005..3ff6ae35af27 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_private_endpoint_connections_operations.py @@ -33,7 +33,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class PrivateEndpointConnectionsOperations: @@ -75,10 +80,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnectionListResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -109,7 +122,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) + deserialized = self._deserialize( + "PrivateEndpointConnectionListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -124,9 +139,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -136,7 +159,11 @@ async def get_next(next_link=None): @distributed_trace_async async def get( - self, resource_group_name: str, workspace_name: str, private_endpoint_connection_name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + private_endpoint_connection_name: str, + **kwargs: Any ) -> "_models.PrivateEndpointConnection": """Gets the specified private endpoint connection associated with the workspace. @@ -152,11 +179,19 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.PrivateEndpointConnection"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -175,11 +210,21 @@ async def get( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response) + deserialized = self._deserialize( + "PrivateEndpointConnection", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -213,12 +258,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.PrivateEndpointConnection"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(properties, "PrivateEndpointConnection") @@ -241,11 +296,21 @@ async def create_or_update( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response) + deserialized = self._deserialize( + "PrivateEndpointConnection", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -256,7 +321,11 @@ async def create_or_update( @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, private_endpoint_connection_name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + private_endpoint_connection_name: str, + **kwargs: Any ) -> None: """Deletes the specified private endpoint connection associated with the workspace. @@ -273,10 +342,16 @@ async def delete( # pylint: disable=inconsistent-return-statements :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request( subscription_id=self._config.subscription_id, @@ -295,9 +370,17 @@ async def delete( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_private_link_resources_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_private_link_resources_operations.py index 34893a1b2472..026aa7d71434 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_private_link_resources_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_private_link_resources_operations.py @@ -26,7 +26,12 @@ from ...operations._private_link_resources_operations import build_list_request T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class PrivateLinkResourcesOperations: @@ -66,11 +71,19 @@ async def list( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateLinkResourceListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.PrivateLinkResourceListResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateLinkResourceListResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_list_request( subscription_id=self._config.subscription_id, @@ -88,11 +101,21 @@ async def list( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("PrivateLinkResourceListResult", pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "PrivateLinkResourceListResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_quotas_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_quotas_operations.py index 33bbb771e8ae..4a06a201d2e9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_quotas_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_quotas_operations.py @@ -25,10 +25,18 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._quotas_operations import build_list_request, build_update_request +from ...operations._quotas_operations import ( + build_list_request, + build_update_request, +) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class QuotasOperations: @@ -55,7 +63,10 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace_async async def update( - self, location: str, parameters: "_models.QuotaUpdateParameters", **kwargs: Any + self, + location: str, + parameters: "_models.QuotaUpdateParameters", + **kwargs: Any ) -> "_models.UpdateWorkspaceQuotasResult": """Update quota for each VM family in workspace. @@ -68,12 +79,22 @@ async def update( :rtype: ~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotasResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(parameters, "QuotaUpdateParameters") @@ -94,11 +115,21 @@ async def update( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("UpdateWorkspaceQuotasResult", pipeline_response) + deserialized = self._deserialize( + "UpdateWorkspaceQuotasResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -108,7 +139,9 @@ async def update( update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas"} # type: ignore @distributed_trace - def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.ListWorkspaceQuotas"]: + def list( + self, location: str, **kwargs: Any + ) -> AsyncIterable["_models.ListWorkspaceQuotas"]: """Gets the currently assigned Workspace Quotas based on VMFamily. :param location: The location for which resource usage is queried. @@ -119,10 +152,18 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.ListWorks ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListWorkspaceQuotas] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.ListWorkspaceQuotas"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListWorkspaceQuotas"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -151,7 +192,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ListWorkspaceQuotas", pipeline_response) + deserialized = self._deserialize( + "ListWorkspaceQuotas", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -166,9 +209,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registries_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registries_operations.py index 5102cd9bd3ae..c9a7427affd7 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registries_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registries_operations.py @@ -18,7 +18,11 @@ ) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -37,7 +41,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class RegistriesOperations: @@ -79,10 +88,18 @@ def list_by_subscription( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.RegistryTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -111,7 +128,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("RegistryTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "RegistryTrackedResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -126,9 +145,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -138,7 +165,10 @@ async def get_next(next_link=None): @distributed_trace def list( - self, resource_group_name: str, skip: Optional[str] = None, **kwargs: Any + self, + resource_group_name: str, + skip: Optional[str] = None, + **kwargs: Any ) -> AsyncIterable["_models.RegistryTrackedResourceArmPaginatedResult"]: """List registries. @@ -155,10 +185,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.RegistryTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -189,7 +227,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("RegistryTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "RegistryTrackedResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -204,9 +244,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -218,10 +266,16 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, registry_name: str, **kwargs: Any ) -> None: cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -239,16 +293,29 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, None, response_headers) @@ -279,11 +346,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -299,7 +374,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -311,12 +390,16 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace_async - async def get(self, resource_group_name: str, registry_name: str, **kwargs: Any) -> "_models.Registry": + async def get( + self, resource_group_name: str, registry_name: str, **kwargs: Any + ) -> "_models.Registry": """Get registry. Get registry. @@ -331,10 +414,16 @@ async def get(self, resource_group_name: str, registry_name: str, **kwargs: Any) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -352,9 +441,17 @@ async def get(self, resource_group_name: str, registry_name: str, **kwargs: Any) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("Registry", pipeline_response) @@ -373,13 +470,23 @@ async def _update_initial( **kwargs: Any ) -> "_models.Registry": cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, "PartialRegistryPartialTrackedResource") + _json = self._serialize.body( + body, "PartialRegistryPartialTrackedResource" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -399,16 +506,26 @@ async def _update_initial( response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: deserialized = self._deserialize("Registry", pipeline_response) if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) deserialized = self._deserialize("Registry", pipeline_response) @@ -450,12 +567,22 @@ async def begin_update( :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Registry] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -476,7 +603,11 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -488,19 +619,35 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore async def _create_or_update_initial( - self, resource_group_name: str, registry_name: str, body: "_models.Registry", **kwargs: Any + self, + resource_group_name: str, + registry_name: str, + body: "_models.Registry", + **kwargs: Any ) -> Optional["_models.Registry"]: - cls = kwargs.pop("cls", None) # type: ClsType[Optional["_models.Registry"]] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.Registry"]] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "Registry") @@ -522,8 +669,14 @@ async def _create_or_update_initial( response = pipeline_response.http_response if response.status_code not in [200, 201, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: @@ -541,7 +694,11 @@ async def _create_or_update_initial( @distributed_trace_async async def begin_create_or_update( - self, resource_group_name: str, registry_name: str, body: "_models.Registry", **kwargs: Any + self, + resource_group_name: str, + registry_name: str, + body: "_models.Registry", + **kwargs: Any ) -> AsyncLROPoller["_models.Registry"]: """Create or update registry. @@ -566,12 +723,22 @@ async def begin_create_or_update( :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Registry] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -593,7 +760,9 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling( - lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs ) elif polling is False: polling_method = AsyncNoPolling() @@ -606,6 +775,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_code_containers_operations.py index 9b21770ef925..2f171ce21672 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_code_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_code_containers_operations.py @@ -18,7 +18,11 @@ ) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -35,7 +39,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class RegistryCodeContainersOperations: @@ -62,7 +71,11 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list( - self, resource_group_name: str, registry_name: str, skip: Optional[str] = None, **kwargs: Any + self, + resource_group_name: str, + registry_name: str, + skip: Optional[str] = None, + **kwargs: Any ) -> AsyncIterable["_models.CodeContainerResourceArmPaginatedResult"]: """List containers. @@ -81,10 +94,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -117,7 +138,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -132,9 +155,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -143,13 +174,23 @@ async def get_next(next_link=None): list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, registry_name: str, code_name: str, **kwargs: Any + self, + resource_group_name: str, + registry_name: str, + code_name: str, + **kwargs: Any ) -> None: cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -168,16 +209,29 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, None, response_headers) @@ -186,7 +240,11 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, registry_name: str, code_name: str, **kwargs: Any + self, + resource_group_name: str, + registry_name: str, + code_name: str, + **kwargs: Any ) -> AsyncLROPoller[None]: """Delete container. @@ -210,11 +268,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -231,7 +297,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -243,13 +313,19 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore @distributed_trace_async async def get( - self, resource_group_name: str, registry_name: str, code_name: str, **kwargs: Any + self, + resource_group_name: str, + registry_name: str, + code_name: str, + **kwargs: Any ) -> "_models.CodeContainer": """Get container. @@ -267,10 +343,16 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -289,9 +371,17 @@ async def get( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("CodeContainer", pipeline_response) @@ -303,14 +393,27 @@ async def get( get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore async def _create_or_update_initial( - self, resource_group_name: str, registry_name: str, code_name: str, body: "_models.CodeContainer", **kwargs: Any + self, + resource_group_name: str, + registry_name: str, + code_name: str, + body: "_models.CodeContainer", + **kwargs: Any ) -> "_models.CodeContainer": cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "CodeContainer") @@ -333,22 +436,35 @@ async def _create_or_update_initial( response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("CodeContainer", pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if response.status_code == 201: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) ) response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) - deserialized = self._deserialize("CodeContainer", pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -359,7 +475,12 @@ async def _create_or_update_initial( @distributed_trace_async async def begin_create_or_update( - self, resource_group_name: str, registry_name: str, code_name: str, body: "_models.CodeContainer", **kwargs: Any + self, + resource_group_name: str, + registry_name: str, + code_name: str, + body: "_models.CodeContainer", + **kwargs: Any ) -> AsyncLROPoller["_models.CodeContainer"]: """Create or update container. @@ -387,12 +508,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.CodeContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -408,13 +539,19 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("CodeContainer", pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -426,6 +563,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_code_versions_operations.py index ef26fd44c8e3..926b6b489e4c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_code_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_code_versions_operations.py @@ -18,7 +18,11 @@ ) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -35,7 +39,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class RegistryCodeVersionsOperations: @@ -94,10 +103,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -136,7 +153,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -151,9 +170,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -162,13 +189,24 @@ async def get_next(next_link=None): list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, registry_name: str, code_name: str, version: str, **kwargs: Any + self, + resource_group_name: str, + registry_name: str, + code_name: str, + version: str, + **kwargs: Any ) -> None: cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -188,16 +226,29 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, None, response_headers) @@ -206,7 +257,12 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, registry_name: str, code_name: str, version: str, **kwargs: Any + self, + resource_group_name: str, + registry_name: str, + code_name: str, + version: str, + **kwargs: Any ) -> AsyncLROPoller[None]: """Delete version. @@ -232,11 +288,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -254,7 +318,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -266,13 +334,20 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore @distributed_trace_async async def get( - self, resource_group_name: str, registry_name: str, code_name: str, version: str, **kwargs: Any + self, + resource_group_name: str, + registry_name: str, + code_name: str, + version: str, + **kwargs: Any ) -> "_models.CodeVersion": """Get version. @@ -292,10 +367,16 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -315,9 +396,17 @@ async def get( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("CodeVersion", pipeline_response) @@ -338,11 +427,19 @@ async def _create_or_update_initial( **kwargs: Any ) -> "_models.CodeVersion": cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "CodeVersion") @@ -366,16 +463,25 @@ async def _create_or_update_initial( response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: deserialized = self._deserialize("CodeVersion", pipeline_response) if response.status_code == 201: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) ) response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") @@ -428,12 +534,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.CodeVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -456,7 +572,11 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -468,6 +588,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_component_containers_operations.py index 61072c2b1b3a..b5580067fb28 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_component_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_component_containers_operations.py @@ -18,7 +18,11 @@ ) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -35,7 +39,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class RegistryComponentContainersOperations: @@ -62,7 +71,11 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list( - self, resource_group_name: str, registry_name: str, skip: Optional[str] = None, **kwargs: Any + self, + resource_group_name: str, + registry_name: str, + skip: Optional[str] = None, + **kwargs: Any ) -> AsyncIterable["_models.ComponentContainerResourceArmPaginatedResult"]: """List containers. @@ -81,10 +94,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -117,7 +138,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -132,9 +156,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -143,13 +175,23 @@ async def get_next(next_link=None): list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, registry_name: str, component_name: str, **kwargs: Any + self, + resource_group_name: str, + registry_name: str, + component_name: str, + **kwargs: Any ) -> None: cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -168,16 +210,29 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, None, response_headers) @@ -186,7 +241,11 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, registry_name: str, component_name: str, **kwargs: Any + self, + resource_group_name: str, + registry_name: str, + component_name: str, + **kwargs: Any ) -> AsyncLROPoller[None]: """Delete container. @@ -210,11 +269,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -231,7 +298,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -243,13 +314,19 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore @distributed_trace_async async def get( - self, resource_group_name: str, registry_name: str, component_name: str, **kwargs: Any + self, + resource_group_name: str, + registry_name: str, + component_name: str, + **kwargs: Any ) -> "_models.ComponentContainer": """Get container. @@ -266,11 +343,19 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComponentContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -289,11 +374,21 @@ async def get( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("ComponentContainer", pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -310,12 +405,22 @@ async def _create_or_update_initial( body: "_models.ComponentContainer", **kwargs: Any ) -> "_models.ComponentContainer": - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComponentContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "ComponentContainer") @@ -338,22 +443,35 @@ async def _create_or_update_initial( response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("ComponentContainer", pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if response.status_code == 201: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) ) response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) - deserialized = self._deserialize("ComponentContainer", pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -397,12 +515,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComponentContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComponentContainer"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -418,13 +548,19 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("ComponentContainer", pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -436,6 +572,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_component_versions_operations.py index 4479dcec9b27..a1975d7e3f6f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_component_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_component_versions_operations.py @@ -18,7 +18,11 @@ ) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -35,7 +39,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class RegistryComponentVersionsOperations: @@ -94,10 +103,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -136,7 +153,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -151,9 +170,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -162,13 +189,24 @@ async def get_next(next_link=None): list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, registry_name: str, component_name: str, version: str, **kwargs: Any + self, + resource_group_name: str, + registry_name: str, + component_name: str, + version: str, + **kwargs: Any ) -> None: cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -188,16 +226,29 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, None, response_headers) @@ -206,7 +257,12 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, registry_name: str, component_name: str, version: str, **kwargs: Any + self, + resource_group_name: str, + registry_name: str, + component_name: str, + version: str, + **kwargs: Any ) -> AsyncLROPoller[None]: """Delete version. @@ -232,11 +288,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -254,7 +318,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -266,13 +334,20 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore @distributed_trace_async async def get( - self, resource_group_name: str, registry_name: str, component_name: str, version: str, **kwargs: Any + self, + resource_group_name: str, + registry_name: str, + component_name: str, + version: str, + **kwargs: Any ) -> "_models.ComponentVersion": """Get version. @@ -291,11 +366,19 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComponentVersion"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -315,9 +398,17 @@ async def get( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("ComponentVersion", pipeline_response) @@ -337,12 +428,22 @@ async def _create_or_update_initial( body: "_models.ComponentVersion", **kwargs: Any ) -> "_models.ComponentVersion": - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComponentVersion"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "ComponentVersion") @@ -366,22 +467,35 @@ async def _create_or_update_initial( response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("ComponentVersion", pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if response.status_code == 201: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) ) response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) - deserialized = self._deserialize("ComponentVersion", pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -428,12 +542,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComponentVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComponentVersion"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -450,13 +576,19 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("ComponentVersion", pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -468,6 +600,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_data_containers_operations.py index b70a7aab4203..5fe5187216de 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_data_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_data_containers_operations.py @@ -18,7 +18,11 @@ ) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -35,7 +39,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class RegistryDataContainersOperations: @@ -88,10 +97,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -126,7 +143,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -141,9 +160,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -152,13 +179,23 @@ async def get_next(next_link=None): list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, registry_name: str, name: str, **kwargs: Any + self, + resource_group_name: str, + registry_name: str, + name: str, + **kwargs: Any ) -> None: cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -177,16 +214,29 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, None, response_headers) @@ -195,7 +245,11 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, registry_name: str, name: str, **kwargs: Any + self, + resource_group_name: str, + registry_name: str, + name: str, + **kwargs: Any ) -> AsyncLROPoller[None]: """Delete container. @@ -219,11 +273,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -240,7 +302,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -252,13 +318,19 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore @distributed_trace_async async def get( - self, resource_group_name: str, registry_name: str, name: str, **kwargs: Any + self, + resource_group_name: str, + registry_name: str, + name: str, + **kwargs: Any ) -> "_models.DataContainer": """Get container. @@ -276,10 +348,16 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -298,9 +376,17 @@ async def get( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("DataContainer", pipeline_response) @@ -312,14 +398,27 @@ async def get( get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore async def _create_or_update_initial( - self, resource_group_name: str, registry_name: str, name: str, body: "_models.DataContainer", **kwargs: Any + self, + resource_group_name: str, + registry_name: str, + name: str, + body: "_models.DataContainer", + **kwargs: Any ) -> "_models.DataContainer": cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "DataContainer") @@ -342,22 +441,35 @@ async def _create_or_update_initial( response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("DataContainer", pipeline_response) + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if response.status_code == 201: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) ) response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) - deserialized = self._deserialize("DataContainer", pipeline_response) + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -368,7 +480,12 @@ async def _create_or_update_initial( @distributed_trace_async async def begin_create_or_update( - self, resource_group_name: str, registry_name: str, name: str, body: "_models.DataContainer", **kwargs: Any + self, + resource_group_name: str, + registry_name: str, + name: str, + body: "_models.DataContainer", + **kwargs: Any ) -> AsyncLROPoller["_models.DataContainer"]: """Create or update container. @@ -396,12 +513,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.DataContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -417,13 +544,19 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("DataContainer", pipeline_response) + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -435,6 +568,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_data_versions_operations.py index 1919a81c3d2f..2fbfa7f63081 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_data_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_data_versions_operations.py @@ -18,7 +18,11 @@ ) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -35,7 +39,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class RegistryDataVersionsOperations: @@ -104,10 +113,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -150,7 +167,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataVersionBaseResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -165,9 +184,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -176,13 +203,24 @@ async def get_next(next_link=None): list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, registry_name: str, name: str, version: str, **kwargs: Any + self, + resource_group_name: str, + registry_name: str, + name: str, + version: str, + **kwargs: Any ) -> None: cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -202,16 +240,29 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, None, response_headers) @@ -220,7 +271,12 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, registry_name: str, name: str, version: str, **kwargs: Any + self, + resource_group_name: str, + registry_name: str, + name: str, + version: str, + **kwargs: Any ) -> AsyncLROPoller[None]: """Delete version. @@ -246,11 +302,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -268,7 +332,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -280,13 +348,20 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( - self, resource_group_name: str, registry_name: str, name: str, version: str, **kwargs: Any + self, + resource_group_name: str, + registry_name: str, + name: str, + version: str, + **kwargs: Any ) -> "_models.DataVersionBase": """Get version. @@ -305,11 +380,19 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.DataVersionBase"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -329,9 +412,17 @@ async def get( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("DataVersionBase", pipeline_response) @@ -351,12 +442,22 @@ async def _create_or_update_initial( body: "_models.DataVersionBase", **kwargs: Any ) -> "_models.DataVersionBase": - cls = kwargs.pop("cls", None) # type: ClsType["_models.DataVersionBase"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "DataVersionBase") @@ -380,22 +481,35 @@ async def _create_or_update_initial( response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("DataVersionBase", pipeline_response) + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if response.status_code == 201: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) ) response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) - deserialized = self._deserialize("DataVersionBase", pipeline_response) + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -442,12 +556,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.DataVersionBase] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.DataVersionBase"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -464,13 +590,19 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("DataVersionBase", pipeline_response) + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -482,6 +614,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_environment_containers_operations.py index 1608aec165a7..b28dcf04ef28 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_environment_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_environment_containers_operations.py @@ -18,7 +18,11 @@ ) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -35,7 +39,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class RegistryEnvironmentContainersOperations: @@ -68,7 +77,9 @@ def list( skip: Optional[str] = None, list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, **kwargs: Any - ) -> AsyncIterable["_models.EnvironmentContainerResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.EnvironmentContainerResourceArmPaginatedResult" + ]: """List environment containers. List environment containers. @@ -88,10 +99,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -126,7 +145,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -141,9 +163,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -152,13 +182,23 @@ async def get_next(next_link=None): list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, registry_name: str, environment_name: str, **kwargs: Any + self, + resource_group_name: str, + registry_name: str, + environment_name: str, + **kwargs: Any ) -> None: cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -177,16 +217,29 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, None, response_headers) @@ -195,7 +248,11 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, registry_name: str, environment_name: str, **kwargs: Any + self, + resource_group_name: str, + registry_name: str, + environment_name: str, + **kwargs: Any ) -> AsyncLROPoller[None]: """Delete container. @@ -219,11 +276,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -240,7 +305,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -252,13 +321,19 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore @distributed_trace_async async def get( - self, resource_group_name: str, registry_name: str, environment_name: str, **kwargs: Any + self, + resource_group_name: str, + registry_name: str, + environment_name: str, + **kwargs: Any ) -> "_models.EnvironmentContainer": """Get container. @@ -275,11 +350,19 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.EnvironmentContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -298,11 +381,21 @@ async def get( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("EnvironmentContainer", pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -319,12 +412,22 @@ async def _create_or_update_initial( body: "_models.EnvironmentContainer", **kwargs: Any ) -> "_models.EnvironmentContainer": - cls = kwargs.pop("cls", None) # type: ClsType["_models.EnvironmentContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "EnvironmentContainer") @@ -347,22 +450,35 @@ async def _create_or_update_initial( response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("EnvironmentContainer", pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if response.status_code == 201: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) ) response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) - deserialized = self._deserialize("EnvironmentContainer", pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -406,12 +522,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.EnvironmentContainer"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -427,13 +555,19 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("EnvironmentContainer", pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -445,6 +579,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_environment_versions_operations.py index 9c4d21aabb8b..d5bb7f0af7b3 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_environment_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_environment_versions_operations.py @@ -18,7 +18,11 @@ ) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -35,7 +39,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class RegistryEnvironmentVersionsOperations: @@ -97,10 +106,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -141,7 +158,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersionResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -156,9 +176,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -167,13 +195,24 @@ async def get_next(next_link=None): list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, registry_name: str, environment_name: str, version: str, **kwargs: Any + self, + resource_group_name: str, + registry_name: str, + environment_name: str, + version: str, + **kwargs: Any ) -> None: cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -193,16 +232,29 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, None, response_headers) @@ -211,7 +263,12 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, registry_name: str, environment_name: str, version: str, **kwargs: Any + self, + resource_group_name: str, + registry_name: str, + environment_name: str, + version: str, + **kwargs: Any ) -> AsyncLROPoller[None]: """Delete version. @@ -237,11 +294,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -259,7 +324,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -271,13 +340,20 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore @distributed_trace_async async def get( - self, resource_group_name: str, registry_name: str, environment_name: str, version: str, **kwargs: Any + self, + resource_group_name: str, + registry_name: str, + environment_name: str, + version: str, + **kwargs: Any ) -> "_models.EnvironmentVersion": """Get version. @@ -296,11 +372,19 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.EnvironmentVersion"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -320,11 +404,21 @@ async def get( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("EnvironmentVersion", pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -342,12 +436,22 @@ async def _create_or_update_initial( body: "_models.EnvironmentVersion", **kwargs: Any ) -> "_models.EnvironmentVersion": - cls = kwargs.pop("cls", None) # type: ClsType["_models.EnvironmentVersion"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "EnvironmentVersion") @@ -371,22 +475,35 @@ async def _create_or_update_initial( response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("EnvironmentVersion", pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if response.status_code == 201: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) ) response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) - deserialized = self._deserialize("EnvironmentVersion", pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -433,12 +550,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.EnvironmentVersion"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -455,13 +584,19 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("EnvironmentVersion", pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -473,6 +608,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_model_containers_operations.py index 5ed15cf89259..b8d63fcac7f5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_model_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_model_containers_operations.py @@ -18,7 +18,11 @@ ) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -35,7 +39,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class RegistryModelContainersOperations: @@ -88,10 +97,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -126,7 +143,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -141,9 +160,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -152,13 +179,23 @@ async def get_next(next_link=None): list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, registry_name: str, model_name: str, **kwargs: Any + self, + resource_group_name: str, + registry_name: str, + model_name: str, + **kwargs: Any ) -> None: cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -177,16 +214,29 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, None, response_headers) @@ -195,7 +245,11 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, registry_name: str, model_name: str, **kwargs: Any + self, + resource_group_name: str, + registry_name: str, + model_name: str, + **kwargs: Any ) -> AsyncLROPoller[None]: """Delete container. @@ -219,11 +273,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -240,7 +302,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -252,13 +318,19 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore @distributed_trace_async async def get( - self, resource_group_name: str, registry_name: str, model_name: str, **kwargs: Any + self, + resource_group_name: str, + registry_name: str, + model_name: str, + **kwargs: Any ) -> "_models.ModelContainer": """Get container. @@ -275,11 +347,19 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -298,9 +378,17 @@ async def get( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("ModelContainer", pipeline_response) @@ -319,12 +407,22 @@ async def _create_or_update_initial( body: "_models.ModelContainer", **kwargs: Any ) -> "_models.ModelContainer": - cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "ModelContainer") @@ -347,22 +445,35 @@ async def _create_or_update_initial( response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("ModelContainer", pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if response.status_code == 201: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) ) response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) - deserialized = self._deserialize("ModelContainer", pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -406,12 +517,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ModelContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelContainer"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -427,13 +550,19 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("ModelContainer", pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -445,6 +574,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_model_versions_operations.py index f6ba942a2b50..fdbbbeed561b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_model_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_registry_model_versions_operations.py @@ -18,7 +18,11 @@ ) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -35,7 +39,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class RegistryModelVersionsOperations: @@ -111,10 +120,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -163,7 +180,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -178,9 +197,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -189,13 +216,24 @@ async def get_next(next_link=None): list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, registry_name: str, model_name: str, version: str, **kwargs: Any + self, + resource_group_name: str, + registry_name: str, + model_name: str, + version: str, + **kwargs: Any ) -> None: cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -215,16 +253,29 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, None, response_headers) @@ -233,7 +284,12 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, registry_name: str, model_name: str, version: str, **kwargs: Any + self, + resource_group_name: str, + registry_name: str, + model_name: str, + version: str, + **kwargs: Any ) -> AsyncLROPoller[None]: """Delete version. @@ -259,11 +315,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -281,7 +345,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -293,13 +361,20 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore @distributed_trace_async async def get( - self, resource_group_name: str, registry_name: str, model_name: str, version: str, **kwargs: Any + self, + resource_group_name: str, + registry_name: str, + model_name: str, + version: str, + **kwargs: Any ) -> "_models.ModelVersion": """Get version. @@ -319,10 +394,16 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -342,9 +423,17 @@ async def get( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("ModelVersion", pipeline_response) @@ -365,11 +454,19 @@ async def _create_or_update_initial( **kwargs: Any ) -> "_models.ModelVersion": cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "ModelVersion") @@ -393,16 +490,25 @@ async def _create_or_update_initial( response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: deserialized = self._deserialize("ModelVersion", pipeline_response) if response.status_code == 201: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) ) response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") @@ -455,12 +561,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ModelVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -483,7 +599,11 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -495,6 +615,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_schedules_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_schedules_operations.py index 501e2b9f31af..462b21a9ff2b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_schedules_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_schedules_operations.py @@ -18,7 +18,11 @@ ) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -35,7 +39,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class SchedulesOperations: @@ -66,7 +75,9 @@ def list( resource_group_name: str, workspace_name: str, skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ScheduleListViewType"]] = None, + list_view_type: Optional[ + Union[str, "_models.ScheduleListViewType"] + ] = None, **kwargs: Any ) -> AsyncIterable["_models.ScheduleResourceArmPaginatedResult"]: """List schedules in specified workspace. @@ -88,10 +99,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ScheduleResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.ScheduleResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ScheduleResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -126,7 +145,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ScheduleResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ScheduleResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -141,9 +162,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -152,13 +181,23 @@ async def get_next(next_link=None): list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + name: str, + **kwargs: Any ) -> None: cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -177,16 +216,29 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, None, response_headers) @@ -195,7 +247,11 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + name: str, + **kwargs: Any ) -> AsyncLROPoller[None]: """Delete schedule. @@ -219,11 +275,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -240,7 +304,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -252,12 +320,20 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @distributed_trace_async - async def get(self, resource_group_name: str, workspace_name: str, name: str, **kwargs: Any) -> "_models.Schedule": + async def get( + self, + resource_group_name: str, + workspace_name: str, + name: str, + **kwargs: Any + ) -> "_models.Schedule": """Get schedule. Get schedule. @@ -274,10 +350,16 @@ async def get(self, resource_group_name: str, workspace_name: str, name: str, ** :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType["_models.Schedule"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -296,9 +378,17 @@ async def get(self, resource_group_name: str, workspace_name: str, name: str, ** response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("Schedule", pipeline_response) @@ -310,14 +400,27 @@ async def get(self, resource_group_name: str, workspace_name: str, name: str, ** get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore async def _create_or_update_initial( - self, resource_group_name: str, workspace_name: str, name: str, body: "_models.Schedule", **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + name: str, + body: "_models.Schedule", + **kwargs: Any ) -> "_models.Schedule": cls = kwargs.pop("cls", None) # type: ClsType["_models.Schedule"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "Schedule") @@ -340,16 +443,25 @@ async def _create_or_update_initial( response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: deserialized = self._deserialize("Schedule", pipeline_response) if response.status_code == 201: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) ) response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") @@ -366,7 +478,12 @@ async def _create_or_update_initial( @distributed_trace_async async def begin_create_or_update( - self, resource_group_name: str, workspace_name: str, name: str, body: "_models.Schedule", **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + name: str, + body: "_models.Schedule", + **kwargs: Any ) -> AsyncLROPoller["_models.Schedule"]: """Create or update schedule. @@ -393,12 +510,22 @@ async def begin_create_or_update( :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Schedule] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType["_models.Schedule"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -420,7 +547,11 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -432,6 +563,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_usages_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_usages_operations.py index 1cdee4fdcf38..3e33bcc27e51 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_usages_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_usages_operations.py @@ -27,7 +27,12 @@ from ...operations._usages_operations import build_list_request T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class UsagesOperations: @@ -53,7 +58,9 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._config = config @distributed_trace - def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.ListUsagesResult"]: + def list( + self, location: str, **kwargs: Any + ) -> AsyncIterable["_models.ListUsagesResult"]: """Gets the current usage information as well as limits for AML resources for given subscription and location. @@ -65,10 +72,18 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.ListUsage ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListUsagesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.ListUsagesResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListUsagesResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -97,7 +112,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ListUsagesResult", pipeline_response) + deserialized = self._deserialize( + "ListUsagesResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -112,9 +129,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_virtual_machine_sizes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_virtual_machine_sizes_operations.py index 959b2152f082..0b3a355cdba6 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_virtual_machine_sizes_operations.py @@ -26,7 +26,12 @@ from ...operations._virtual_machine_sizes_operations import build_list_request T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class VirtualMachineSizesOperations: @@ -52,7 +57,9 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._config = config @distributed_trace_async - async def list(self, location: str, **kwargs: Any) -> "_models.VirtualMachineSizeListResult": + async def list( + self, location: str, **kwargs: Any + ) -> "_models.VirtualMachineSizeListResult": """Returns supported VM Sizes in a location. :param location: The location upon which virtual-machine-sizes is queried. @@ -62,11 +69,19 @@ async def list(self, location: str, **kwargs: Any) -> "_models.VirtualMachineSiz :rtype: ~azure.mgmt.machinelearningservices.models.VirtualMachineSizeListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.VirtualMachineSizeListResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.VirtualMachineSizeListResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_list_request( location=location, @@ -83,11 +98,21 @@ async def list(self, location: str, **kwargs: Any) -> "_models.VirtualMachineSiz response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("VirtualMachineSizeListResult", pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "VirtualMachineSizeListResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_workspace_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_workspace_connections_operations.py index 0d614baeddd3..6305466afffb 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_workspace_connections_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_workspace_connections_operations.py @@ -33,7 +33,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class WorkspaceConnectionsOperations: @@ -83,14 +88,26 @@ async def create( :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, "WorkspaceConnectionPropertiesV2BasicResource") + _json = self._serialize.body( + parameters, "WorkspaceConnectionPropertiesV2BasicResource" + ) request = build_create_request( subscription_id=self._config.subscription_id, @@ -111,11 +128,21 @@ async def create( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("WorkspaceConnectionPropertiesV2BasicResource", pipeline_response) + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -126,7 +153,11 @@ async def create( @distributed_trace_async async def get( - self, resource_group_name: str, workspace_name: str, connection_name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + connection_name: str, + **kwargs: Any ) -> "_models.WorkspaceConnectionPropertiesV2BasicResource": """get. @@ -141,11 +172,19 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -164,11 +203,21 @@ async def get( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("WorkspaceConnectionPropertiesV2BasicResource", pipeline_response) + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -179,7 +228,11 @@ async def get( @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, connection_name: str, **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + connection_name: str, + **kwargs: Any ) -> None: """delete. @@ -195,10 +248,16 @@ async def delete( # pylint: disable=inconsistent-return-statements :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request( subscription_id=self._config.subscription_id, @@ -217,9 +276,17 @@ async def delete( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -234,7 +301,9 @@ def list( target: Optional[str] = None, category: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult" + ]: """list. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -252,12 +321,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str cls = kwargs.pop( "cls", None ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -293,7 +368,8 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = self._deserialize( - "WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", pipeline_response + "WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", + pipeline_response, ) list_of_elem = deserialized.value if cls: @@ -309,9 +385,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_workspace_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_workspace_features_operations.py index 9811905960d7..0fe5bf73c9c3 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_workspace_features_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_workspace_features_operations.py @@ -27,7 +27,12 @@ from ...operations._workspace_features_operations import build_list_request T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class WorkspaceFeaturesOperations: @@ -69,10 +74,18 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListAmlUserFeatureResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.ListAmlUserFeatureResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListAmlUserFeatureResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -103,7 +116,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ListAmlUserFeatureResult", pipeline_response) + deserialized = self._deserialize( + "ListAmlUserFeatureResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -118,9 +133,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_workspaces_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_workspaces_operations.py index 759b4dc3b034..070bdfe86faa 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_workspaces_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/aio/operations/_workspaces_operations.py @@ -18,7 +18,11 @@ ) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -45,7 +49,12 @@ ) T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] class WorkspacesOperations: @@ -71,7 +80,9 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._config = config @distributed_trace_async - async def get(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> "_models.Workspace": + async def get( + self, resource_group_name: str, workspace_name: str, **kwargs: Any + ) -> "_models.Workspace": """Gets the properties of the specified machine learning workspace. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -84,10 +95,16 @@ async def get(self, resource_group_name: str, workspace_name: str, **kwargs: Any :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -105,9 +122,17 @@ async def get(self, resource_group_name: str, workspace_name: str, **kwargs: Any response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("Workspace", pipeline_response) @@ -119,14 +144,28 @@ async def get(self, resource_group_name: str, workspace_name: str, **kwargs: Any get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore async def _create_or_update_initial( - self, resource_group_name: str, workspace_name: str, parameters: "_models.Workspace", **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + parameters: "_models.Workspace", + **kwargs: Any ) -> Optional["_models.Workspace"]: - cls = kwargs.pop("cls", None) # type: ClsType[Optional["_models.Workspace"]] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.Workspace"]] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(parameters, "Workspace") @@ -148,8 +187,14 @@ async def _create_or_update_initial( response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: @@ -164,7 +209,11 @@ async def _create_or_update_initial( @distributed_trace_async async def begin_create_or_update( - self, resource_group_name: str, workspace_name: str, parameters: "_models.Workspace", **kwargs: Any + self, + resource_group_name: str, + workspace_name: str, + parameters: "_models.Workspace", + **kwargs: Any ) -> AsyncLROPoller["_models.Workspace"]: """Creates or updates a workspace with the specified parameters. @@ -188,12 +237,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Workspace] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -226,7 +285,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @@ -234,10 +295,16 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> None: cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -255,8 +322,14 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -285,11 +358,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -317,7 +398,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @@ -328,12 +411,22 @@ async def _update_initial( parameters: "_models.WorkspaceUpdateParameters", **kwargs: Any ) -> Optional["_models.Workspace"]: - cls = kwargs.pop("cls", None) # type: ClsType[Optional["_models.Workspace"]] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.Workspace"]] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(parameters, "WorkspaceUpdateParameters") @@ -355,8 +448,14 @@ async def _update_initial( response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: @@ -399,12 +498,22 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Workspace] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -437,13 +546,18 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace def list_by_resource_group( - self, resource_group_name: str, skip: Optional[str] = None, **kwargs: Any + self, + resource_group_name: str, + skip: Optional[str] = None, + **kwargs: Any ) -> AsyncIterable["_models.WorkspaceListResult"]: """Lists all the available machine learning workspaces under the specified resource group. @@ -457,10 +571,18 @@ def list_by_resource_group( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.WorkspaceListResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceListResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -491,7 +613,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -506,9 +630,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -523,15 +655,27 @@ async def _diagnose_initial( parameters: Optional["_models.DiagnoseWorkspaceParameters"] = None, **kwargs: Any ) -> Optional["_models.DiagnoseResponseResult"]: - cls = kwargs.pop("cls", None) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if parameters is not None: - _json = self._serialize.body(parameters, "DiagnoseWorkspaceParameters") + _json = self._serialize.body( + parameters, "DiagnoseWorkspaceParameters" + ) else: _json = None @@ -553,17 +697,29 @@ async def _diagnose_initial( response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("DiagnoseResponseResult", pipeline_response) + deserialized = self._deserialize( + "DiagnoseResponseResult", pipeline_response + ) if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -604,12 +760,24 @@ async def begin_diagnose( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.DiagnoseResponseResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.DiagnoseResponseResult"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DiagnoseResponseResult"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._diagnose_initial( resource_group_name=resource_group_name, @@ -624,13 +792,19 @@ async def begin_diagnose( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("DiagnoseResponseResult", pipeline_response) + deserialized = self._deserialize( + "DiagnoseResponseResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -642,7 +816,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_diagnose.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore @@ -662,11 +838,19 @@ async def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListWorkspaceKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.ListWorkspaceKeysResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListWorkspaceKeysResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_list_keys_request( subscription_id=self._config.subscription_id, @@ -684,11 +868,21 @@ async def list_keys( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("ListWorkspaceKeysResult", pipeline_response) + deserialized = self._deserialize( + "ListWorkspaceKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -701,10 +895,16 @@ async def _resync_keys_initial( # pylint: disable=inconsistent-return-statement self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> None: cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_resync_keys_request_initial( subscription_id=self._config.subscription_id, @@ -722,8 +922,14 @@ async def _resync_keys_initial( # pylint: disable=inconsistent-return-statement response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -753,11 +959,19 @@ async def begin_resync_keys( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._resync_keys_initial( resource_group_name=resource_group_name, @@ -785,7 +999,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_resync_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore @@ -803,10 +1019,18 @@ def list_by_subscription( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.WorkspaceListResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceListResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -835,7 +1059,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -850,9 +1076,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -875,11 +1109,19 @@ async def list_notebook_access_token( :rtype: ~azure.mgmt.machinelearningservices.models.NotebookAccessTokenResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.NotebookAccessTokenResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.NotebookAccessTokenResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_list_notebook_access_token_request( subscription_id=self._config.subscription_id, @@ -897,11 +1139,21 @@ async def list_notebook_access_token( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("NotebookAccessTokenResult", pipeline_response) + deserialized = self._deserialize( + "NotebookAccessTokenResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -913,11 +1165,19 @@ async def list_notebook_access_token( async def _prepare_notebook_initial( self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> Optional["_models.NotebookResourceInfo"]: - cls = kwargs.pop("cls", None) # type: ClsType[Optional["_models.NotebookResourceInfo"]] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.NotebookResourceInfo"]] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_prepare_notebook_request_initial( subscription_id=self._config.subscription_id, @@ -935,12 +1195,20 @@ async def _prepare_notebook_initial( response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize("NotebookResourceInfo", pipeline_response) + deserialized = self._deserialize( + "NotebookResourceInfo", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -973,11 +1241,21 @@ async def begin_prepare_notebook( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.NotebookResourceInfo] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.NotebookResourceInfo"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.NotebookResourceInfo"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._prepare_notebook_initial( resource_group_name=resource_group_name, @@ -990,13 +1268,19 @@ async def begin_prepare_notebook( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("NotebookResourceInfo", pipeline_response) + deserialized = self._deserialize( + "NotebookResourceInfo", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method = AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = AsyncNoPolling() else: @@ -1008,7 +1292,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_prepare_notebook.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore @@ -1027,11 +1313,19 @@ async def list_storage_account_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListStorageAccountKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.ListStorageAccountKeysResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListStorageAccountKeysResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_list_storage_account_keys_request( subscription_id=self._config.subscription_id, @@ -1049,11 +1343,21 @@ async def list_storage_account_keys( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("ListStorageAccountKeysResult", pipeline_response) + deserialized = self._deserialize( + "ListStorageAccountKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -1077,11 +1381,19 @@ async def list_notebook_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.ListNotebookKeysResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListNotebookKeysResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_list_notebook_keys_request( subscription_id=self._config.subscription_id, @@ -1099,11 +1411,21 @@ async def list_notebook_keys( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("ListNotebookKeysResult", pipeline_response) + deserialized = self._deserialize( + "ListNotebookKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -1131,18 +1453,28 @@ async def list_outbound_network_dependencies_endpoints( :rtype: ~azure.mgmt.machinelearningservices.models.ExternalFQDNResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.ExternalFQDNResponse"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ExternalFQDNResponse"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_list_outbound_network_dependencies_endpoints_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_outbound_network_dependencies_endpoints.metadata["url"], + template_url=self.list_outbound_network_dependencies_endpoints.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) @@ -1153,11 +1485,21 @@ async def list_outbound_network_dependencies_endpoints( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("ExternalFQDNResponse", pipeline_response) + deserialized = self._deserialize( + "ExternalFQDNResponse", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/models/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/models/__init__.py index 1033641177df..30e0b5d7da55 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/models/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/models/__init__.py @@ -202,10 +202,14 @@ from ._models_py3 import FeaturesetVersionResourceArmPaginatedResult from ._models_py3 import FeaturestoreEntityContainer from ._models_py3 import FeaturestoreEntityContainerProperties - from ._models_py3 import FeaturestoreEntityContainerResourceArmPaginatedResult + from ._models_py3 import ( + FeaturestoreEntityContainerResourceArmPaginatedResult, + ) from ._models_py3 import FeaturestoreEntityVersion from ._models_py3 import FeaturestoreEntityVersionProperties - from ._models_py3 import FeaturestoreEntityVersionResourceArmPaginatedResult + from ._models_py3 import ( + FeaturestoreEntityVersionResourceArmPaginatedResult, + ) from ._models_py3 import FeaturizationSettings from ._models_py3 import FlavorData from ._models_py3 import ForecastHorizon @@ -288,7 +292,9 @@ from ._models_py3 import MLTableJobInput from ._models_py3 import MLTableJobOutput from ._models_py3 import ManagedIdentity - from ._models_py3 import ManagedIdentityAuthTypeWorkspaceConnectionProperties + from ._models_py3 import ( + ManagedIdentityAuthTypeWorkspaceConnectionProperties, + ) from ._models_py3 import ManagedOnlineDeployment from ._models_py3 import ManagedServiceIdentity from ._models_py3 import MaterializationComputeResource @@ -338,7 +344,9 @@ from ._models_py3 import PackageResponse from ._models_py3 import PaginatedComputeResourcesList from ._models_py3 import PartialBatchDeployment - from ._models_py3 import PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties + from ._models_py3 import ( + PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, + ) from ._models_py3 import PartialManagedServiceIdentity from ._models_py3 import PartialMinimalTrackedResource from ._models_py3 import PartialMinimalTrackedResourceWithIdentity @@ -393,7 +401,9 @@ from ._models_py3 import ScriptsToExecute from ._models_py3 import Seasonality from ._models_py3 import ServiceManagedResourcesSettings - from ._models_py3 import ServicePrincipalAuthTypeWorkspaceConnectionProperties + from ._models_py3 import ( + ServicePrincipalAuthTypeWorkspaceConnectionProperties, + ) from ._models_py3 import ServicePrincipalDatastoreCredentials from ._models_py3 import ServicePrincipalDatastoreSecrets from ._models_py3 import SetupScripts @@ -457,7 +467,9 @@ from ._models_py3 import UserCreatedAcrAccount from ._models_py3 import UserCreatedStorageAccount from ._models_py3 import UserIdentity - from ._models_py3 import UsernamePasswordAuthTypeWorkspaceConnectionProperties + from ._models_py3 import ( + UsernamePasswordAuthTypeWorkspaceConnectionProperties, + ) from ._models_py3 import VirtualMachine from ._models_py3 import VirtualMachineImage from ._models_py3 import VirtualMachineSchema @@ -475,7 +487,9 @@ from ._models_py3 import WorkspaceConnectionPersonalAccessToken from ._models_py3 import WorkspaceConnectionPropertiesV2 from ._models_py3 import WorkspaceConnectionPropertiesV2BasicResource - from ._models_py3 import WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult + from ._models_py3 import ( + WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, + ) from ._models_py3 import WorkspaceConnectionServicePrincipal from ._models_py3 import WorkspaceConnectionSharedAccessSignature from ._models_py3 import WorkspaceConnectionUsernamePassword diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/models/_azure_machine_learning_workspaces_enums.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/models/_azure_machine_learning_workspaces_enums.py index 6dfca11ed77c..aa8dc3dd1d7d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/models/_azure_machine_learning_workspaces_enums.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/models/_azure_machine_learning_workspaces_enums.py @@ -64,7 +64,9 @@ class BaseEnvironmentSourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): ENVIRONMENT_ASSET = "EnvironmentAsset" -class BatchDeploymentPropertyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): +class BatchDeploymentPropertyType( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): """The enumerated property types for batch deployments.""" MODEL = "Model" @@ -196,7 +198,9 @@ class ClassificationModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): XG_BOOST_CLASSIFIER = "XGBoostClassifier" -class ClassificationMultilabelPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): +class ClassificationMultilabelPrimaryMetrics( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): """Primary metrics for classification multilabel tasks.""" #: AUC is the Area under the curve. @@ -218,7 +222,9 @@ class ClassificationMultilabelPrimaryMetrics(str, Enum, metaclass=CaseInsensitiv IOU = "IOU" -class ClassificationPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): +class ClassificationPrimaryMetrics( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): """Primary metrics for classification tasks.""" #: AUC is the Area under the curve. @@ -246,7 +252,9 @@ class ClusterPurpose(str, Enum, metaclass=CaseInsensitiveEnumMeta): DEV_TEST = "DevTest" -class ComputeInstanceAuthorizationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): +class ComputeInstanceAuthorizationType( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): """The Compute Instance Authorization type. Available values are personal (default).""" PERSONAL = "personal" @@ -369,7 +377,9 @@ class DataType(str, Enum, metaclass=CaseInsensitiveEnumMeta): MLTABLE = "mltable" -class DeploymentProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): +class DeploymentProvisioningState( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): """Possible values for DeploymentProvisioningState.""" CREATING = "Creating" @@ -404,7 +414,9 @@ class EarlyTerminationPolicyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): TRUNCATION_SELECTION = "TruncationSelection" -class EgressPublicNetworkAccessType(str, Enum, metaclass=CaseInsensitiveEnumMeta): +class EgressPublicNetworkAccessType( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): """Enum to determine whether PublicNetworkAccess is Enabled or Disabled for egress of a deployment. """ @@ -413,7 +425,9 @@ class EgressPublicNetworkAccessType(str, Enum, metaclass=CaseInsensitiveEnumMeta DISABLED = "Disabled" -class EmailNotificationEnableType(str, Enum, metaclass=CaseInsensitiveEnumMeta): +class EmailNotificationEnableType( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): """Enum to determine the email notification type.""" JOB_COMPLETED = "JobCompleted" @@ -685,7 +699,9 @@ class InputPathType(str, Enum, metaclass=CaseInsensitiveEnumMeta): PATH_VERSION = "PathVersion" -class InstanceSegmentationPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): +class InstanceSegmentationPrimaryMetrics( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): """Primary metrics for InstanceSegmentation tasks.""" #: Mean Average Precision (MAP) is the average of AP (Average Precision). @@ -981,7 +997,9 @@ class NodesValueType(str, Enum, metaclass=CaseInsensitiveEnumMeta): CUSTOM = "Custom" -class ObjectDetectionPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): +class ObjectDetectionPrimaryMetrics( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): """Primary metrics for Image ObjectDetection task.""" #: Mean Average Precision (MAP) is the average of AP (Average Precision). @@ -1074,7 +1092,9 @@ class PackageInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): URI_FOLDER = "UriFolder" -class PrivateEndpointConnectionProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): +class PrivateEndpointConnectionProvisioningState( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): """The current provisioning state.""" SUCCEEDED = "Succeeded" @@ -1083,7 +1103,9 @@ class PrivateEndpointConnectionProvisioningState(str, Enum, metaclass=CaseInsens FAILED = "Failed" -class PrivateEndpointServiceConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): +class PrivateEndpointServiceConnectionStatus( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): """The private endpoint connection status.""" PENDING = "Pending" @@ -1144,7 +1166,9 @@ class QuotaUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): COUNT = "Count" -class RandomSamplingAlgorithmRule(str, Enum, metaclass=CaseInsensitiveEnumMeta): +class RandomSamplingAlgorithmRule( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): """The specific type of random algorithm""" RANDOM = "Random" @@ -1234,7 +1258,9 @@ class RegressionPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): NORMALIZED_MEAN_ABSOLUTE_ERROR = "NormalizedMeanAbsoluteError" -class RemoteLoginPortPublicAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): +class RemoteLoginPortPublicAccess( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): """State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - Indicates that the public ssh port is closed @@ -1319,7 +1345,9 @@ class SecretsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): KERBEROS_KEYTAB = "KerberosKeytab" -class ServiceDataAccessAuthIdentity(str, Enum, metaclass=CaseInsensitiveEnumMeta): +class ServiceDataAccessAuthIdentity( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): #: Do not use any identity for service data access. NONE = "None" @@ -1329,7 +1357,9 @@ class ServiceDataAccessAuthIdentity(str, Enum, metaclass=CaseInsensitiveEnumMeta WORKSPACE_USER_ASSIGNED_IDENTITY = "WorkspaceUserAssignedIdentity" -class ShortSeriesHandlingConfiguration(str, Enum, metaclass=CaseInsensitiveEnumMeta): +class ShortSeriesHandlingConfiguration( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): """The parameter defining how if AutoML should handle short time series.""" #: Represents no/null value. @@ -1427,7 +1457,9 @@ class Status(str, Enum, metaclass=CaseInsensitiveEnumMeta): SUCCESS = "Success" FAILURE = "Failure" INVALID_QUOTA_BELOW_CLUSTER_MINIMUM = "InvalidQuotaBelowClusterMinimum" - INVALID_QUOTA_EXCEEDS_SUBSCRIPTION_LIMIT = "InvalidQuotaExceedsSubscriptionLimit" + INVALID_QUOTA_EXCEEDS_SUBSCRIPTION_LIMIT = ( + "InvalidQuotaExceedsSubscriptionLimit" + ) INVALID_VM_FAMILY_NAME = "InvalidVMFamilyName" OPERATION_NOT_SUPPORTED_FOR_SKU = "OperationNotSupportedForSku" OPERATION_NOT_ENABLED_FOR_REGION = "OperationNotEnabledForRegion" @@ -1481,7 +1513,9 @@ class TargetLagsMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): CUSTOM = "Custom" -class TargetRollingWindowSizeMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): +class TargetRollingWindowSizeMode( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): """Target rolling windows size mode.""" #: Determine rolling windows size automatically. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/models/_models.py index b4e41749877c..40d4d06efe26 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/models/_models.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/models/_models.py @@ -80,7 +80,9 @@ def __init__(self, **kwargs): self.value_format = kwargs.get("value_format", None) -class AccessKeyAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class AccessKeyAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """AccessKeyAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -113,7 +115,10 @@ class AccessKeyAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionProperti "target": {"key": "target", "type": "str"}, "value": {"key": "value", "type": "str"}, "value_format": {"key": "valueFormat", "type": "str"}, - "credentials": {"key": "credentials", "type": "WorkspaceConnectionAccessKey"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionAccessKey", + }, } def __init__(self, **kwargs): @@ -132,7 +137,9 @@ def __init__(self, **kwargs): :keyword credentials: :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccessKey """ - super(AccessKeyAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) + super(AccessKeyAuthTypeWorkspaceConnectionProperties, self).__init__( + **kwargs + ) self.auth_type = "AccessKey" # type: str self.credentials = kwargs.get("credentials", None) @@ -293,8 +300,14 @@ class AcrDetails(msrest.serialization.Model): """ _attribute_map = { - "system_created_acr_account": {"key": "systemCreatedAcrAccount", "type": "SystemCreatedAcrAccount"}, - "user_created_acr_account": {"key": "userCreatedAcrAccount", "type": "UserCreatedAcrAccount"}, + "system_created_acr_account": { + "key": "systemCreatedAcrAccount", + "type": "SystemCreatedAcrAccount", + }, + "user_created_acr_account": { + "key": "userCreatedAcrAccount", + "type": "UserCreatedAcrAccount", + }, } def __init__(self, **kwargs): @@ -307,8 +320,12 @@ def __init__(self, **kwargs): ~azure.mgmt.machinelearningservices.models.UserCreatedAcrAccount """ super(AcrDetails, self).__init__(**kwargs) - self.system_created_acr_account = kwargs.get("system_created_acr_account", None) - self.user_created_acr_account = kwargs.get("user_created_acr_account", None) + self.system_created_acr_account = kwargs.get( + "system_created_acr_account", None + ) + self.user_created_acr_account = kwargs.get( + "user_created_acr_account", None + ) class AKSSchema(msrest.serialization.Model): @@ -387,7 +404,10 @@ class Compute(msrest.serialization.Model): "created_on": {"key": "createdOn", "type": "iso-8601"}, "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, "resource_id": {"key": "resourceId", "type": "str"}, - "provisioning_errors": {"key": "provisioningErrors", "type": "[ErrorResponse]"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } @@ -488,7 +508,10 @@ class AKS(Compute, AKSSchema): "created_on": {"key": "createdOn", "type": "iso-8601"}, "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, "resource_id": {"key": "resourceId", "type": "str"}, - "provisioning_errors": {"key": "provisioningErrors", "type": "[ErrorResponse]"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } @@ -537,7 +560,10 @@ class AksComputeSecretsProperties(msrest.serialization.Model): _attribute_map = { "user_kube_config": {"key": "userKubeConfig", "type": "str"}, "admin_kube_config": {"key": "adminKubeConfig", "type": "str"}, - "image_pull_secret_name": {"key": "imagePullSecretName", "type": "str"}, + "image_pull_secret_name": { + "key": "imagePullSecretName", + "type": "str", + }, } def __init__(self, **kwargs): @@ -554,7 +580,9 @@ def __init__(self, **kwargs): super(AksComputeSecretsProperties, self).__init__(**kwargs) self.user_kube_config = kwargs.get("user_kube_config", None) self.admin_kube_config = kwargs.get("admin_kube_config", None) - self.image_pull_secret_name = kwargs.get("image_pull_secret_name", None) + self.image_pull_secret_name = kwargs.get( + "image_pull_secret_name", None + ) class ComputeSecrets(msrest.serialization.Model): @@ -619,7 +647,10 @@ class AksComputeSecrets(ComputeSecrets, AksComputeSecretsProperties): _attribute_map = { "user_kube_config": {"key": "userKubeConfig", "type": "str"}, "admin_kube_config": {"key": "adminKubeConfig", "type": "str"}, - "image_pull_secret_name": {"key": "imagePullSecretName", "type": "str"}, + "image_pull_secret_name": { + "key": "imagePullSecretName", + "type": "str", + }, "compute_type": {"key": "computeType", "type": "str"}, } @@ -637,7 +668,9 @@ def __init__(self, **kwargs): super(AksComputeSecrets, self).__init__(**kwargs) self.user_kube_config = kwargs.get("user_kube_config", None) self.admin_kube_config = kwargs.get("admin_kube_config", None) - self.image_pull_secret_name = kwargs.get("image_pull_secret_name", None) + self.image_pull_secret_name = kwargs.get( + "image_pull_secret_name", None + ) self.compute_type = "AKS" # type: str @@ -658,11 +691,15 @@ class AksNetworkingConfiguration(msrest.serialization.Model): """ _validation = { - "service_cidr": {"pattern": r"^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$"}, + "service_cidr": { + "pattern": r"^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$" + }, "dns_service_ip": { "pattern": r"^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" }, - "docker_bridge_cidr": {"pattern": r"^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$"}, + "docker_bridge_cidr": { + "pattern": r"^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$" + }, } _attribute_map = { @@ -728,12 +765,21 @@ class AKSSchemaProperties(msrest.serialization.Model): _attribute_map = { "cluster_fqdn": {"key": "clusterFqdn", "type": "str"}, - "system_services": {"key": "systemServices", "type": "[SystemService]"}, + "system_services": { + "key": "systemServices", + "type": "[SystemService]", + }, "agent_count": {"key": "agentCount", "type": "int"}, "agent_vm_size": {"key": "agentVmSize", "type": "str"}, "cluster_purpose": {"key": "clusterPurpose", "type": "str"}, - "ssl_configuration": {"key": "sslConfiguration", "type": "SslConfiguration"}, - "aks_networking_configuration": {"key": "aksNetworkingConfiguration", "type": "AksNetworkingConfiguration"}, + "ssl_configuration": { + "key": "sslConfiguration", + "type": "SslConfiguration", + }, + "aks_networking_configuration": { + "key": "aksNetworkingConfiguration", + "type": "AksNetworkingConfiguration", + }, "load_balancer_type": {"key": "loadBalancerType", "type": "str"}, "load_balancer_subnet": {"key": "loadBalancerSubnet", "type": "str"}, } @@ -768,7 +814,9 @@ def __init__(self, **kwargs): self.agent_vm_size = kwargs.get("agent_vm_size", None) self.cluster_purpose = kwargs.get("cluster_purpose", "FastProd") self.ssl_configuration = kwargs.get("ssl_configuration", None) - self.aks_networking_configuration = kwargs.get("aks_networking_configuration", None) + self.aks_networking_configuration = kwargs.get( + "aks_networking_configuration", None + ) self.load_balancer_type = kwargs.get("load_balancer_type", "PublicIp") self.load_balancer_subnet = kwargs.get("load_balancer_subnet", None) @@ -902,7 +950,10 @@ class AmlCompute(Compute, AmlComputeSchema): "created_on": {"key": "createdOn", "type": "iso-8601"}, "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, "resource_id": {"key": "resourceId", "type": "str"}, - "provisioning_errors": {"key": "provisioningErrors", "type": "[ErrorResponse]"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } @@ -1090,18 +1141,33 @@ class AmlComputeProperties(msrest.serialization.Model): "os_type": {"key": "osType", "type": "str"}, "vm_size": {"key": "vmSize", "type": "str"}, "vm_priority": {"key": "vmPriority", "type": "str"}, - "virtual_machine_image": {"key": "virtualMachineImage", "type": "VirtualMachineImage"}, + "virtual_machine_image": { + "key": "virtualMachineImage", + "type": "VirtualMachineImage", + }, "isolated_network": {"key": "isolatedNetwork", "type": "bool"}, "scale_settings": {"key": "scaleSettings", "type": "ScaleSettings"}, - "user_account_credentials": {"key": "userAccountCredentials", "type": "UserAccountCredentials"}, + "user_account_credentials": { + "key": "userAccountCredentials", + "type": "UserAccountCredentials", + }, "subnet": {"key": "subnet", "type": "ResourceId"}, - "remote_login_port_public_access": {"key": "remoteLoginPortPublicAccess", "type": "str"}, + "remote_login_port_public_access": { + "key": "remoteLoginPortPublicAccess", + "type": "str", + }, "allocation_state": {"key": "allocationState", "type": "str"}, - "allocation_state_transition_time": {"key": "allocationStateTransitionTime", "type": "iso-8601"}, + "allocation_state_transition_time": { + "key": "allocationStateTransitionTime", + "type": "iso-8601", + }, "errors": {"key": "errors", "type": "[ErrorResponse]"}, "current_node_count": {"key": "currentNodeCount", "type": "int"}, "target_node_count": {"key": "targetNodeCount", "type": "int"}, - "node_state_counts": {"key": "nodeStateCounts", "type": "NodeStateCounts"}, + "node_state_counts": { + "key": "nodeStateCounts", + "type": "NodeStateCounts", + }, "enable_node_public_ip": {"key": "enableNodePublicIp", "type": "bool"}, "property_bag": {"key": "propertyBag", "type": "object"}, } @@ -1153,9 +1219,13 @@ def __init__(self, **kwargs): self.virtual_machine_image = kwargs.get("virtual_machine_image", None) self.isolated_network = kwargs.get("isolated_network", None) self.scale_settings = kwargs.get("scale_settings", None) - self.user_account_credentials = kwargs.get("user_account_credentials", None) + self.user_account_credentials = kwargs.get( + "user_account_credentials", None + ) self.subnet = kwargs.get("subnet", None) - self.remote_login_port_public_access = kwargs.get("remote_login_port_public_access", "NotSpecified") + self.remote_login_port_public_access = kwargs.get( + "remote_login_port_public_access", "NotSpecified" + ) self.allocation_state = None self.allocation_state_transition_time = None self.errors = None @@ -1279,7 +1349,11 @@ class IdentityConfiguration(msrest.serialization.Model): } _subtype_map = { - "identity_type": {"AMLToken": "AmlToken", "Managed": "ManagedIdentity", "UserIdentity": "UserIdentity"} + "identity_type": { + "AMLToken": "AmlToken", + "Managed": "ManagedIdentity", + "UserIdentity": "UserIdentity", + } } def __init__(self, **kwargs): @@ -1657,7 +1731,12 @@ class ForecastHorizon(msrest.serialization.Model): "mode": {"key": "mode", "type": "str"}, } - _subtype_map = {"mode": {"Auto": "AutoForecastHorizon", "Custom": "CustomForecastHorizon"}} + _subtype_map = { + "mode": { + "Auto": "AutoForecastHorizon", + "Custom": "CustomForecastHorizon", + } + } def __init__(self, **kwargs): """ """ @@ -1780,7 +1859,10 @@ class JobBaseProperties(ResourceBase): "identity": {"key": "identity", "type": "IdentityConfiguration"}, "is_archived": {"key": "isArchived", "type": "bool"}, "job_type": {"key": "jobType", "type": "str"}, - "notification_setting": {"key": "notificationSetting", "type": "NotificationSetting"}, + "notification_setting": { + "key": "notificationSetting", + "type": "NotificationSetting", + }, "services": {"key": "services", "type": "{JobService}"}, "status": {"key": "status", "type": "str"}, } @@ -1914,11 +1996,17 @@ class AutoMLJob(JobBaseProperties): "identity": {"key": "identity", "type": "IdentityConfiguration"}, "is_archived": {"key": "isArchived", "type": "bool"}, "job_type": {"key": "jobType", "type": "str"}, - "notification_setting": {"key": "notificationSetting", "type": "NotificationSetting"}, + "notification_setting": { + "key": "notificationSetting", + "type": "NotificationSetting", + }, "services": {"key": "services", "type": "{JobService}"}, "status": {"key": "status", "type": "str"}, "environment_id": {"key": "environmentId", "type": "str"}, - "environment_variables": {"key": "environmentVariables", "type": "{str}"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, "outputs": {"key": "outputs", "type": "{JobOutput}"}, "queue_settings": {"key": "queueSettings", "type": "QueueSettings"}, "resources": {"key": "resources", "type": "JobResourceConfiguration"}, @@ -2069,7 +2157,12 @@ class NCrossValidations(msrest.serialization.Model): "mode": {"key": "mode", "type": "str"}, } - _subtype_map = {"mode": {"Auto": "AutoNCrossValidations", "Custom": "CustomNCrossValidations"}} + _subtype_map = { + "mode": { + "Auto": "AutoNCrossValidations", + "Custom": "CustomNCrossValidations", + } + } def __init__(self, **kwargs): """ """ @@ -2180,7 +2273,9 @@ class Seasonality(msrest.serialization.Model): "mode": {"key": "mode", "type": "str"}, } - _subtype_map = {"mode": {"Auto": "AutoSeasonality", "Custom": "CustomSeasonality"}} + _subtype_map = { + "mode": {"Auto": "AutoSeasonality", "Custom": "CustomSeasonality"} + } def __init__(self, **kwargs): """ """ @@ -2233,7 +2328,9 @@ class TargetLags(msrest.serialization.Model): "mode": {"key": "mode", "type": "str"}, } - _subtype_map = {"mode": {"Auto": "AutoTargetLags", "Custom": "CustomTargetLags"}} + _subtype_map = { + "mode": {"Auto": "AutoTargetLags", "Custom": "CustomTargetLags"} + } def __init__(self, **kwargs): """ """ @@ -2286,7 +2383,12 @@ class TargetRollingWindowSize(msrest.serialization.Model): "mode": {"key": "mode", "type": "str"}, } - _subtype_map = {"mode": {"Auto": "AutoTargetRollingWindowSize", "Custom": "CustomTargetRollingWindowSize"}} + _subtype_map = { + "mode": { + "Auto": "AutoTargetRollingWindowSize", + "Custom": "CustomTargetRollingWindowSize", + } + } def __init__(self, **kwargs): """ """ @@ -2473,7 +2575,10 @@ class AzureBlobDatastore(DatastoreProperties, AzureDatastore): "container_name": {"key": "containerName", "type": "str"}, "endpoint": {"key": "endpoint", "type": "str"}, "protocol": {"key": "protocol", "type": "str"}, - "service_data_access_auth_identity": {"key": "serviceDataAccessAuthIdentity", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } def __init__(self, **kwargs): @@ -2512,7 +2617,9 @@ def __init__(self, **kwargs): self.container_name = kwargs.get("container_name", None) self.endpoint = kwargs.get("endpoint", None) self.protocol = kwargs.get("protocol", None) - self.service_data_access_auth_identity = kwargs.get("service_data_access_auth_identity", None) + self.service_data_access_auth_identity = kwargs.get( + "service_data_access_auth_identity", None + ) self.description = kwargs.get("description", None) self.properties = kwargs.get("properties", None) self.tags = kwargs.get("tags", None) @@ -2571,7 +2678,10 @@ class AzureDataLakeGen1Datastore(DatastoreProperties, AzureDatastore): "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, "datastore_type": {"key": "datastoreType", "type": "str"}, "is_default": {"key": "isDefault", "type": "bool"}, - "service_data_access_auth_identity": {"key": "serviceDataAccessAuthIdentity", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, "store_name": {"key": "storeName", "type": "str"}, } @@ -2601,7 +2711,9 @@ def __init__(self, **kwargs): self.resource_group = kwargs.get("resource_group", None) self.subscription_id = kwargs.get("subscription_id", None) self.datastore_type = "AzureDataLakeGen1" # type: str - self.service_data_access_auth_identity = kwargs.get("service_data_access_auth_identity", None) + self.service_data_access_auth_identity = kwargs.get( + "service_data_access_auth_identity", None + ) self.store_name = kwargs["store_name"] self.description = kwargs.get("description", None) self.properties = kwargs.get("properties", None) @@ -2672,7 +2784,10 @@ class AzureDataLakeGen2Datastore(DatastoreProperties, AzureDatastore): "endpoint": {"key": "endpoint", "type": "str"}, "filesystem": {"key": "filesystem", "type": "str"}, "protocol": {"key": "protocol", "type": "str"}, - "service_data_access_auth_identity": {"key": "serviceDataAccessAuthIdentity", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } def __init__(self, **kwargs): @@ -2711,7 +2826,9 @@ def __init__(self, **kwargs): self.endpoint = kwargs.get("endpoint", None) self.filesystem = kwargs["filesystem"] self.protocol = kwargs.get("protocol", None) - self.service_data_access_auth_identity = kwargs.get("service_data_access_auth_identity", None) + self.service_data_access_auth_identity = kwargs.get( + "service_data_access_auth_identity", None + ) self.description = kwargs.get("description", None) self.properties = kwargs.get("properties", None) self.tags = kwargs.get("tags", None) @@ -2782,7 +2899,10 @@ class AzureFileDatastore(DatastoreProperties, AzureDatastore): "endpoint": {"key": "endpoint", "type": "str"}, "file_share_name": {"key": "fileShareName", "type": "str"}, "protocol": {"key": "protocol", "type": "str"}, - "service_data_access_auth_identity": {"key": "serviceDataAccessAuthIdentity", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } def __init__(self, **kwargs): @@ -2822,7 +2942,9 @@ def __init__(self, **kwargs): self.endpoint = kwargs.get("endpoint", None) self.file_share_name = kwargs["file_share_name"] self.protocol = kwargs.get("protocol", None) - self.service_data_access_auth_identity = kwargs.get("service_data_access_auth_identity", None) + self.service_data_access_auth_identity = kwargs.get( + "service_data_access_auth_identity", None + ) self.description = kwargs.get("description", None) self.properties = kwargs.get("properties", None) self.tags = kwargs.get("tags", None) @@ -2884,7 +3006,10 @@ class AzureMLBatchInferencingServer(InferencingServer): _attribute_map = { "server_type": {"key": "serverType", "type": "str"}, - "code_configuration": {"key": "codeConfiguration", "type": "CodeConfiguration"}, + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, } def __init__(self, **kwargs): @@ -2915,7 +3040,10 @@ class AzureMLOnlineInferencingServer(InferencingServer): _attribute_map = { "server_type": {"key": "serverType", "type": "str"}, - "code_configuration": {"key": "codeConfiguration", "type": "CodeConfiguration"}, + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, } def __init__(self, **kwargs): @@ -3044,10 +3172,17 @@ class BaseEnvironmentSource(msrest.serialization.Model): } _attribute_map = { - "base_environment_source_type": {"key": "baseEnvironmentSourceType", "type": "str"}, + "base_environment_source_type": { + "key": "baseEnvironmentSourceType", + "type": "str", + }, } - _subtype_map = {"base_environment_source_type": {"EnvironmentAsset": "BaseEnvironmentId"}} + _subtype_map = { + "base_environment_source_type": { + "EnvironmentAsset": "BaseEnvironmentId" + } + } def __init__(self, **kwargs): """ """ @@ -3074,7 +3209,10 @@ class BaseEnvironmentId(BaseEnvironmentSource): } _attribute_map = { - "base_environment_source_type": {"key": "baseEnvironmentSourceType", "type": "str"}, + "base_environment_source_type": { + "key": "baseEnvironmentSourceType", + "type": "str", + }, "resource_id": {"key": "resourceId", "type": "str"}, } @@ -3233,7 +3371,10 @@ class BatchDeployment(TrackedResource): "location": {"key": "location", "type": "str"}, "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, "kind": {"key": "kind", "type": "str"}, - "properties": {"key": "properties", "type": "BatchDeploymentProperties"}, + "properties": { + "key": "properties", + "type": "BatchDeploymentProperties", + }, "sku": {"key": "sku", "type": "Sku"}, } @@ -3277,10 +3418,16 @@ class EndpointDeploymentPropertiesBase(msrest.serialization.Model): """ _attribute_map = { - "code_configuration": {"key": "codeConfiguration", "type": "CodeConfiguration"}, + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, "description": {"key": "description", "type": "str"}, "environment_id": {"key": "environmentId", "type": "str"}, - "environment_variables": {"key": "environmentVariables", "type": "{str}"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, "properties": {"key": "properties", "type": "{str}"}, } @@ -3367,23 +3514,41 @@ class BatchDeploymentProperties(EndpointDeploymentPropertiesBase): } _attribute_map = { - "code_configuration": {"key": "codeConfiguration", "type": "CodeConfiguration"}, + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, "description": {"key": "description", "type": "str"}, "environment_id": {"key": "environmentId", "type": "str"}, - "environment_variables": {"key": "environmentVariables", "type": "{str}"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, "properties": {"key": "properties", "type": "{str}"}, "compute": {"key": "compute", "type": "str"}, - "deployment_properties": {"key": "deploymentProperties", "type": "BatchDeploymentPropertiesAutoGenerated"}, + "deployment_properties": { + "key": "deploymentProperties", + "type": "BatchDeploymentPropertiesAutoGenerated", + }, "error_threshold": {"key": "errorThreshold", "type": "int"}, "logging_level": {"key": "loggingLevel", "type": "str"}, - "max_concurrency_per_instance": {"key": "maxConcurrencyPerInstance", "type": "int"}, + "max_concurrency_per_instance": { + "key": "maxConcurrencyPerInstance", + "type": "int", + }, "mini_batch_size": {"key": "miniBatchSize", "type": "long"}, "model": {"key": "model", "type": "AssetReferenceBase"}, "output_action": {"key": "outputAction", "type": "str"}, "output_file_name": {"key": "outputFileName", "type": "str"}, "provisioning_state": {"key": "provisioningState", "type": "str"}, - "resources": {"key": "resources", "type": "DeploymentResourceConfiguration"}, - "retry_settings": {"key": "retrySettings", "type": "BatchRetrySettings"}, + "resources": { + "key": "resources", + "type": "DeploymentResourceConfiguration", + }, + "retry_settings": { + "key": "retrySettings", + "type": "BatchRetrySettings", + }, } def __init__(self, **kwargs): @@ -3440,11 +3605,15 @@ def __init__(self, **kwargs): self.deployment_properties = kwargs.get("deployment_properties", None) self.error_threshold = kwargs.get("error_threshold", -1) self.logging_level = kwargs.get("logging_level", None) - self.max_concurrency_per_instance = kwargs.get("max_concurrency_per_instance", 1) + self.max_concurrency_per_instance = kwargs.get( + "max_concurrency_per_instance", 1 + ) self.mini_batch_size = kwargs.get("mini_batch_size", 10) self.model = kwargs.get("model", None) self.output_action = kwargs.get("output_action", None) - self.output_file_name = kwargs.get("output_file_name", "predictions.csv") + self.output_file_name = kwargs.get( + "output_file_name", "predictions.csv" + ) self.provisioning_state = None self.resources = kwargs.get("resources", None) self.retry_settings = kwargs.get("retry_settings", None) @@ -3469,10 +3638,17 @@ class BatchDeploymentPropertiesAutoGenerated(msrest.serialization.Model): } _attribute_map = { - "deployment_property_type": {"key": "deploymentPropertyType", "type": "str"}, + "deployment_property_type": { + "key": "deploymentPropertyType", + "type": "str", + }, } - _subtype_map = {"deployment_property_type": {"PipelineComponent": "BatchPipelineComponentDeploymentProperties"}} + _subtype_map = { + "deployment_property_type": { + "PipelineComponent": "BatchPipelineComponentDeploymentProperties" + } + } def __init__(self, **kwargs): """ """ @@ -3480,7 +3656,9 @@ def __init__(self, **kwargs): self.deployment_property_type = None # type: Optional[str] -class BatchDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class BatchDeploymentTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of BatchDeployment entities. :ivar next_link: The link to the next page of BatchDeployment objects. If null, there are no @@ -3503,7 +3681,9 @@ def __init__(self, **kwargs): :keyword value: An array of objects of type BatchDeployment. :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchDeployment] """ - super(BatchDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) + super(BatchDeploymentTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = kwargs.get("next_link", None) self.value = kwargs.get("value", None) @@ -3743,7 +3923,9 @@ def __init__(self, **kwargs): self.provisioning_state = None -class BatchEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class BatchEndpointTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of BatchEndpoint entities. :ivar next_link: The link to the next page of BatchEndpoint objects. If null, there are no @@ -3766,12 +3948,16 @@ def __init__(self, **kwargs): :keyword value: An array of objects of type BatchEndpoint. :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchEndpoint] """ - super(BatchEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) + super(BatchEndpointTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = kwargs.get("next_link", None) self.value = kwargs.get("value", None) -class BatchPipelineComponentDeploymentProperties(BatchDeploymentPropertiesAutoGenerated): +class BatchPipelineComponentDeploymentProperties( + BatchDeploymentPropertiesAutoGenerated +): """Properties for a Batch Pipeline Component Deployment. All required parameters must be populated in order to send to Azure. @@ -3795,7 +3981,10 @@ class BatchPipelineComponentDeploymentProperties(BatchDeploymentPropertiesAutoGe } _attribute_map = { - "deployment_property_type": {"key": "deploymentPropertyType", "type": "str"}, + "deployment_property_type": { + "key": "deploymentPropertyType", + "type": "str", + }, "component_id": {"key": "componentId", "type": "IdAssetReference"}, "description": {"key": "description", "type": "str"}, "settings": {"key": "settings", "type": "{str}"}, @@ -3813,7 +4002,9 @@ def __init__(self, **kwargs): :keyword tags: A set of tags. The tags which will be applied to the job. :paramtype tags: dict[str, str] """ - super(BatchPipelineComponentDeploymentProperties, self).__init__(**kwargs) + super(BatchPipelineComponentDeploymentProperties, self).__init__( + **kwargs + ) self.deployment_property_type = "PipelineComponent" # type: str self.component_id = kwargs.get("component_id", None) self.description = kwargs.get("description", None) @@ -3868,7 +4059,10 @@ class SamplingAlgorithm(msrest.serialization.Model): } _attribute_map = { - "sampling_algorithm_type": {"key": "samplingAlgorithmType", "type": "str"}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } _subtype_map = { @@ -3902,7 +4096,10 @@ class BayesianSamplingAlgorithm(SamplingAlgorithm): } _attribute_map = { - "sampling_algorithm_type": {"key": "samplingAlgorithmType", "type": "str"}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } def __init__(self, **kwargs): @@ -4140,16 +4337,40 @@ class TableVertical(msrest.serialization.Model): """ _attribute_map = { - "cv_split_column_names": {"key": "cvSplitColumnNames", "type": "[str]"}, - "featurization_settings": {"key": "featurizationSettings", "type": "TableVerticalFeaturizationSettings"}, - "fixed_parameters": {"key": "fixedParameters", "type": "TableFixedParameters"}, - "limit_settings": {"key": "limitSettings", "type": "TableVerticalLimitSettings"}, - "n_cross_validations": {"key": "nCrossValidations", "type": "NCrossValidations"}, - "search_space": {"key": "searchSpace", "type": "[TableParameterSubspace]"}, - "sweep_settings": {"key": "sweepSettings", "type": "TableSweepSettings"}, + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "TableFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "search_space": { + "key": "searchSpace", + "type": "[TableParameterSubspace]", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "TableSweepSettings", + }, "test_data": {"key": "testData", "type": "MLTableJobInput"}, "test_data_size": {"key": "testDataSize", "type": "float"}, - "validation_data": {"key": "validationData", "type": "MLTableJobInput"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, "validation_data_size": {"key": "validationDataSize", "type": "float"}, "weight_column_name": {"key": "weightColumnName", "type": "str"}, } @@ -4197,7 +4418,9 @@ def __init__(self, **kwargs): """ super(TableVertical, self).__init__(**kwargs) self.cv_split_column_names = kwargs.get("cv_split_column_names", None) - self.featurization_settings = kwargs.get("featurization_settings", None) + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) self.fixed_parameters = kwargs.get("fixed_parameters", None) self.limit_settings = kwargs.get("limit_settings", None) self.n_cross_validations = kwargs.get("n_cross_validations", None) @@ -4280,16 +4503,40 @@ class Classification(AutoMLVertical, TableVertical): } _attribute_map = { - "cv_split_column_names": {"key": "cvSplitColumnNames", "type": "[str]"}, - "featurization_settings": {"key": "featurizationSettings", "type": "TableVerticalFeaturizationSettings"}, - "fixed_parameters": {"key": "fixedParameters", "type": "TableFixedParameters"}, - "limit_settings": {"key": "limitSettings", "type": "TableVerticalLimitSettings"}, - "n_cross_validations": {"key": "nCrossValidations", "type": "NCrossValidations"}, - "search_space": {"key": "searchSpace", "type": "[TableParameterSubspace]"}, - "sweep_settings": {"key": "sweepSettings", "type": "TableSweepSettings"}, + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "TableFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "search_space": { + "key": "searchSpace", + "type": "[TableParameterSubspace]", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "TableSweepSettings", + }, "test_data": {"key": "testData", "type": "MLTableJobInput"}, "test_data_size": {"key": "testDataSize", "type": "float"}, - "validation_data": {"key": "validationData", "type": "MLTableJobInput"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, "validation_data_size": {"key": "validationDataSize", "type": "float"}, "weight_column_name": {"key": "weightColumnName", "type": "str"}, "log_verbosity": {"key": "logVerbosity", "type": "str"}, @@ -4298,7 +4545,10 @@ class Classification(AutoMLVertical, TableVertical): "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, "positive_label": {"key": "positiveLabel", "type": "str"}, "primary_metric": {"key": "primaryMetric", "type": "str"}, - "training_settings": {"key": "trainingSettings", "type": "ClassificationTrainingSettings"}, + "training_settings": { + "key": "trainingSettings", + "type": "ClassificationTrainingSettings", + }, } def __init__(self, **kwargs): @@ -4361,7 +4611,9 @@ def __init__(self, **kwargs): """ super(Classification, self).__init__(**kwargs) self.cv_split_column_names = kwargs.get("cv_split_column_names", None) - self.featurization_settings = kwargs.get("featurization_settings", None) + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) self.fixed_parameters = kwargs.get("fixed_parameters", None) self.limit_settings = kwargs.get("limit_settings", None) self.n_cross_validations = kwargs.get("n_cross_validations", None) @@ -4413,12 +4665,27 @@ class TrainingSettings(msrest.serialization.Model): _attribute_map = { "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, - "enable_model_explainability": {"key": "enableModelExplainability", "type": "bool"}, - "enable_onnx_compatible_models": {"key": "enableOnnxCompatibleModels", "type": "bool"}, - "enable_stack_ensemble": {"key": "enableStackEnsemble", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, - "ensemble_model_download_timeout": {"key": "ensembleModelDownloadTimeout", "type": "duration"}, - "stack_ensemble_settings": {"key": "stackEnsembleSettings", "type": "StackEnsembleSettings"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, "training_mode": {"key": "trainingMode", "type": "str"}, } @@ -4452,12 +4719,20 @@ def __init__(self, **kwargs): """ super(TrainingSettings, self).__init__(**kwargs) self.enable_dnn_training = kwargs.get("enable_dnn_training", False) - self.enable_model_explainability = kwargs.get("enable_model_explainability", True) - self.enable_onnx_compatible_models = kwargs.get("enable_onnx_compatible_models", False) + self.enable_model_explainability = kwargs.get( + "enable_model_explainability", True + ) + self.enable_onnx_compatible_models = kwargs.get( + "enable_onnx_compatible_models", False + ) self.enable_stack_ensemble = kwargs.get("enable_stack_ensemble", True) self.enable_vote_ensemble = kwargs.get("enable_vote_ensemble", True) - self.ensemble_model_download_timeout = kwargs.get("ensemble_model_download_timeout", "PT5M") - self.stack_ensemble_settings = kwargs.get("stack_ensemble_settings", None) + self.ensemble_model_download_timeout = kwargs.get( + "ensemble_model_download_timeout", "PT5M" + ) + self.stack_ensemble_settings = kwargs.get( + "stack_ensemble_settings", None + ) self.training_mode = kwargs.get("training_mode", None) @@ -4499,15 +4774,36 @@ class ClassificationTrainingSettings(TrainingSettings): _attribute_map = { "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, - "enable_model_explainability": {"key": "enableModelExplainability", "type": "bool"}, - "enable_onnx_compatible_models": {"key": "enableOnnxCompatibleModels", "type": "bool"}, - "enable_stack_ensemble": {"key": "enableStackEnsemble", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, - "ensemble_model_download_timeout": {"key": "ensembleModelDownloadTimeout", "type": "duration"}, - "stack_ensemble_settings": {"key": "stackEnsembleSettings", "type": "StackEnsembleSettings"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, "training_mode": {"key": "trainingMode", "type": "str"}, - "allowed_training_algorithms": {"key": "allowedTrainingAlgorithms", "type": "[str]"}, - "blocked_training_algorithms": {"key": "blockedTrainingAlgorithms", "type": "[str]"}, + "allowed_training_algorithms": { + "key": "allowedTrainingAlgorithms", + "type": "[str]", + }, + "blocked_training_algorithms": { + "key": "blockedTrainingAlgorithms", + "type": "[str]", + }, } def __init__(self, **kwargs): @@ -4545,8 +4841,12 @@ def __init__(self, **kwargs): ~azure.mgmt.machinelearningservices.models.ClassificationModels] """ super(ClassificationTrainingSettings, self).__init__(**kwargs) - self.allowed_training_algorithms = kwargs.get("allowed_training_algorithms", None) - self.blocked_training_algorithms = kwargs.get("blocked_training_algorithms", None) + self.allowed_training_algorithms = kwargs.get( + "allowed_training_algorithms", None + ) + self.blocked_training_algorithms = kwargs.get( + "blocked_training_algorithms", None + ) class ClusterUpdateParameters(msrest.serialization.Model): @@ -4557,7 +4857,10 @@ class ClusterUpdateParameters(msrest.serialization.Model): """ _attribute_map = { - "properties": {"key": "properties.properties", "type": "ScaleSettingsInformation"}, + "properties": { + "key": "properties.properties", + "type": "ScaleSettingsInformation", + }, } def __init__(self, **kwargs): @@ -4609,7 +4912,11 @@ class ExportSummary(msrest.serialization.Model): } _subtype_map = { - "format": {"CSV": "CsvExportSummary", "Coco": "CocoExportSummary", "Dataset": "DatasetExportSummary"} + "format": { + "CSV": "CsvExportSummary", + "Coco": "CocoExportSummary", + "Dataset": "DatasetExportSummary", + } } def __init__(self, **kwargs): @@ -4686,7 +4993,11 @@ class CodeConfiguration(msrest.serialization.Model): """ _validation = { - "scoring_script": {"required": True, "min_length": 1, "pattern": r"[a-zA-Z0-9_]"}, + "scoring_script": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { @@ -5068,7 +5379,11 @@ class CommandJob(JobBaseProperties): _validation = { "job_type": {"required": True}, "status": {"readonly": True}, - "command": {"required": True, "min_length": 1, "pattern": r"[a-zA-Z0-9_]"}, + "command": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, "environment_id": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, "parameters": {"readonly": True}, } @@ -5084,15 +5399,27 @@ class CommandJob(JobBaseProperties): "identity": {"key": "identity", "type": "IdentityConfiguration"}, "is_archived": {"key": "isArchived", "type": "bool"}, "job_type": {"key": "jobType", "type": "str"}, - "notification_setting": {"key": "notificationSetting", "type": "NotificationSetting"}, + "notification_setting": { + "key": "notificationSetting", + "type": "NotificationSetting", + }, "services": {"key": "services", "type": "{JobService}"}, "status": {"key": "status", "type": "str"}, - "autologger_settings": {"key": "autologgerSettings", "type": "AutologgerSettings"}, + "autologger_settings": { + "key": "autologgerSettings", + "type": "AutologgerSettings", + }, "code_id": {"key": "codeId", "type": "str"}, "command": {"key": "command", "type": "str"}, - "distribution": {"key": "distribution", "type": "DistributionConfiguration"}, + "distribution": { + "key": "distribution", + "type": "DistributionConfiguration", + }, "environment_id": {"key": "environmentId", "type": "str"}, - "environment_variables": {"key": "environmentVariables", "type": "{str}"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, "inputs": {"key": "inputs", "type": "{JobInput}"}, "limits": {"key": "limits", "type": "CommandJobLimits"}, "outputs": {"key": "outputs", "type": "{JobOutput}"}, @@ -5197,7 +5524,12 @@ class JobLimits(msrest.serialization.Model): "timeout": {"key": "timeout", "type": "duration"}, } - _subtype_map = {"job_limits_type": {"Command": "CommandJobLimits", "Sweep": "SweepJobLimits"}} + _subtype_map = { + "job_limits_type": { + "Command": "CommandJobLimits", + "Sweep": "SweepJobLimits", + } + } def __init__(self, **kwargs): """ @@ -5277,7 +5609,10 @@ class ComponentContainer(Resource): "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "ComponentContainerProperties"}, + "properties": { + "key": "properties", + "type": "ComponentContainerProperties", + }, } def __init__(self, **kwargs): @@ -5371,7 +5706,9 @@ def __init__(self, **kwargs): :keyword value: An array of objects of type ComponentContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainer] """ - super(ComponentContainerResourceArmPaginatedResult, self).__init__(**kwargs) + super(ComponentContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = kwargs.get("next_link", None) self.value = kwargs.get("value", None) @@ -5411,7 +5748,10 @@ class ComponentVersion(Resource): "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "ComponentVersionProperties"}, + "properties": { + "key": "properties", + "type": "ComponentVersionProperties", + }, } def __init__(self, **kwargs): @@ -5517,7 +5857,9 @@ def __init__(self, **kwargs): :keyword value: An array of objects of type ComponentVersion. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersion] """ - super(ComponentVersionResourceArmPaginatedResult, self).__init__(**kwargs) + super(ComponentVersionResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = kwargs.get("next_link", None) self.value = kwargs.get("value", None) @@ -5530,7 +5872,10 @@ class ComputeInstanceSchema(msrest.serialization.Model): """ _attribute_map = { - "properties": {"key": "properties", "type": "ComputeInstanceProperties"}, + "properties": { + "key": "properties", + "type": "ComputeInstanceProperties", + }, } def __init__(self, **kwargs): @@ -5590,7 +5935,10 @@ class ComputeInstance(Compute, ComputeInstanceSchema): } _attribute_map = { - "properties": {"key": "properties", "type": "ComputeInstanceProperties"}, + "properties": { + "key": "properties", + "type": "ComputeInstanceProperties", + }, "compute_type": {"key": "computeType", "type": "str"}, "compute_location": {"key": "computeLocation", "type": "str"}, "provisioning_state": {"key": "provisioningState", "type": "str"}, @@ -5598,7 +5946,10 @@ class ComputeInstance(Compute, ComputeInstanceSchema): "created_on": {"key": "createdOn", "type": "iso-8601"}, "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, "resource_id": {"key": "resourceId", "type": "str"}, - "provisioning_errors": {"key": "provisioningErrors", "type": "[ErrorResponse]"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } @@ -5737,7 +6088,10 @@ class ComputeInstanceContainer(msrest.serialization.Model): "autosave": {"key": "autosave", "type": "str"}, "gpu": {"key": "gpu", "type": "str"}, "network": {"key": "network", "type": "str"}, - "environment": {"key": "environment", "type": "ComputeInstanceEnvironmentInfo"}, + "environment": { + "key": "environment", + "type": "ComputeInstanceEnvironmentInfo", + }, "services": {"key": "services", "type": "[object]"}, } @@ -5840,7 +6194,9 @@ def __init__(self, **kwargs): self.caching = kwargs.get("caching", None) self.disk_size_gb = kwargs.get("disk_size_gb", None) self.lun = kwargs.get("lun", None) - self.storage_account_type = kwargs.get("storage_account_type", "Standard_LRS") + self.storage_account_type = kwargs.get( + "storage_account_type", "Standard_LRS" + ) class ComputeInstanceDataMount(msrest.serialization.Model): @@ -6076,29 +6432,68 @@ class ComputeInstanceProperties(msrest.serialization.Model): _attribute_map = { "vm_size": {"key": "vmSize", "type": "str"}, "subnet": {"key": "subnet", "type": "ResourceId"}, - "application_sharing_policy": {"key": "applicationSharingPolicy", "type": "str"}, - "autologger_settings": {"key": "autologgerSettings", "type": "ComputeInstanceAutologgerSettings"}, - "ssh_settings": {"key": "sshSettings", "type": "ComputeInstanceSshSettings"}, - "custom_services": {"key": "customServices", "type": "[CustomService]"}, - "os_image_metadata": {"key": "osImageMetadata", "type": "ImageMetadata"}, - "connectivity_endpoints": {"key": "connectivityEndpoints", "type": "ComputeInstanceConnectivityEndpoints"}, - "applications": {"key": "applications", "type": "[ComputeInstanceApplication]"}, + "application_sharing_policy": { + "key": "applicationSharingPolicy", + "type": "str", + }, + "autologger_settings": { + "key": "autologgerSettings", + "type": "ComputeInstanceAutologgerSettings", + }, + "ssh_settings": { + "key": "sshSettings", + "type": "ComputeInstanceSshSettings", + }, + "custom_services": { + "key": "customServices", + "type": "[CustomService]", + }, + "os_image_metadata": { + "key": "osImageMetadata", + "type": "ImageMetadata", + }, + "connectivity_endpoints": { + "key": "connectivityEndpoints", + "type": "ComputeInstanceConnectivityEndpoints", + }, + "applications": { + "key": "applications", + "type": "[ComputeInstanceApplication]", + }, "created_by": {"key": "createdBy", "type": "ComputeInstanceCreatedBy"}, "errors": {"key": "errors", "type": "[ErrorResponse]"}, "state": {"key": "state", "type": "str"}, - "compute_instance_authorization_type": {"key": "computeInstanceAuthorizationType", "type": "str"}, + "compute_instance_authorization_type": { + "key": "computeInstanceAuthorizationType", + "type": "str", + }, "personal_compute_instance_settings": { "key": "personalComputeInstanceSettings", "type": "PersonalComputeInstanceSettings", }, "setup_scripts": {"key": "setupScripts", "type": "SetupScripts"}, - "last_operation": {"key": "lastOperation", "type": "ComputeInstanceLastOperation"}, + "last_operation": { + "key": "lastOperation", + "type": "ComputeInstanceLastOperation", + }, "schedules": {"key": "schedules", "type": "ComputeSchedules"}, - "idle_time_before_shutdown": {"key": "idleTimeBeforeShutdown", "type": "str"}, + "idle_time_before_shutdown": { + "key": "idleTimeBeforeShutdown", + "type": "str", + }, "enable_node_public_ip": {"key": "enableNodePublicIp", "type": "bool"}, - "containers": {"key": "containers", "type": "[ComputeInstanceContainer]"}, - "data_disks": {"key": "dataDisks", "type": "[ComputeInstanceDataDisk]"}, - "data_mounts": {"key": "dataMounts", "type": "[ComputeInstanceDataMount]"}, + "containers": { + "key": "containers", + "type": "[ComputeInstanceContainer]", + }, + "data_disks": { + "key": "dataDisks", + "type": "[ComputeInstanceDataDisk]", + }, + "data_mounts": { + "key": "dataMounts", + "type": "[ComputeInstanceDataMount]", + }, "versions": {"key": "versions", "type": "ComputeInstanceVersion"}, } @@ -6146,7 +6541,9 @@ def __init__(self, **kwargs): super(ComputeInstanceProperties, self).__init__(**kwargs) self.vm_size = kwargs.get("vm_size", None) self.subnet = kwargs.get("subnet", None) - self.application_sharing_policy = kwargs.get("application_sharing_policy", "Shared") + self.application_sharing_policy = kwargs.get( + "application_sharing_policy", "Shared" + ) self.autologger_settings = kwargs.get("autologger_settings", None) self.ssh_settings = kwargs.get("ssh_settings", None) self.custom_services = kwargs.get("custom_services", None) @@ -6156,12 +6553,18 @@ def __init__(self, **kwargs): self.created_by = None self.errors = None self.state = None - self.compute_instance_authorization_type = kwargs.get("compute_instance_authorization_type", "personal") - self.personal_compute_instance_settings = kwargs.get("personal_compute_instance_settings", None) + self.compute_instance_authorization_type = kwargs.get( + "compute_instance_authorization_type", "personal" + ) + self.personal_compute_instance_settings = kwargs.get( + "personal_compute_instance_settings", None + ) self.setup_scripts = kwargs.get("setup_scripts", None) self.last_operation = None self.schedules = kwargs.get("schedules", None) - self.idle_time_before_shutdown = kwargs.get("idle_time_before_shutdown", None) + self.idle_time_before_shutdown = kwargs.get( + "idle_time_before_shutdown", None + ) self.enable_node_public_ip = kwargs.get("enable_node_public_ip", None) self.containers = None self.data_disks = None @@ -6339,7 +6742,10 @@ class ComputeSchedules(msrest.serialization.Model): """ _attribute_map = { - "compute_start_stop": {"key": "computeStartStop", "type": "[ComputeStartStopSchedule]"}, + "compute_start_stop": { + "key": "computeStartStop", + "type": "[ComputeStartStopSchedule]", + }, } def __init__(self, **kwargs): @@ -6435,8 +6841,14 @@ class ContainerResourceRequirements(msrest.serialization.Model): """ _attribute_map = { - "container_resource_limits": {"key": "containerResourceLimits", "type": "ContainerResourceSettings"}, - "container_resource_requests": {"key": "containerResourceRequests", "type": "ContainerResourceSettings"}, + "container_resource_limits": { + "key": "containerResourceLimits", + "type": "ContainerResourceSettings", + }, + "container_resource_requests": { + "key": "containerResourceRequests", + "type": "ContainerResourceSettings", + }, } def __init__(self, **kwargs): @@ -6449,8 +6861,12 @@ def __init__(self, **kwargs): ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings """ super(ContainerResourceRequirements, self).__init__(**kwargs) - self.container_resource_limits = kwargs.get("container_resource_limits", None) - self.container_resource_requests = kwargs.get("container_resource_requests", None) + self.container_resource_limits = kwargs.get( + "container_resource_limits", None + ) + self.container_resource_requests = kwargs.get( + "container_resource_requests", None + ) class ContainerResourceSettings(msrest.serialization.Model): @@ -6499,7 +6915,10 @@ class CosmosDbSettings(msrest.serialization.Model): """ _attribute_map = { - "collections_throughput": {"key": "collectionsThroughput", "type": "int"}, + "collections_throughput": { + "key": "collectionsThroughput", + "type": "int", + }, } def __init__(self, **kwargs): @@ -6508,7 +6927,9 @@ def __init__(self, **kwargs): :paramtype collections_throughput: int """ super(CosmosDbSettings, self).__init__(**kwargs) - self.collections_throughput = kwargs.get("collections_throughput", None) + self.collections_throughput = kwargs.get( + "collections_throughput", None + ) class TriggerBase(msrest.serialization.Model): @@ -6547,7 +6968,12 @@ class TriggerBase(msrest.serialization.Model): "trigger_type": {"key": "triggerType", "type": "str"}, } - _subtype_map = {"trigger_type": {"Cron": "CronTrigger", "Recurrence": "RecurrenceTrigger"}} + _subtype_map = { + "trigger_type": { + "Cron": "CronTrigger", + "Recurrence": "RecurrenceTrigger", + } + } def __init__(self, **kwargs): """ @@ -6735,7 +7161,10 @@ class CustomInferencingServer(InferencingServer): _attribute_map = { "server_type": {"key": "serverType", "type": "str"}, - "inference_configuration": {"key": "inferenceConfiguration", "type": "OnlineInferenceConfiguration"}, + "inference_configuration": { + "key": "inferenceConfiguration", + "type": "OnlineInferenceConfiguration", + }, } def __init__(self, **kwargs): @@ -6746,7 +7175,9 @@ def __init__(self, **kwargs): """ super(CustomInferencingServer, self).__init__(**kwargs) self.server_type = "Custom" # type: str - self.inference_configuration = kwargs.get("inference_configuration", None) + self.inference_configuration = kwargs.get( + "inference_configuration", None + ) class JobInput(msrest.serialization.Model): @@ -7036,7 +7467,10 @@ class CustomService(msrest.serialization.Model): "additional_properties": {"key": "", "type": "{object}"}, "name": {"key": "name", "type": "str"}, "image": {"key": "image", "type": "Image"}, - "environment_variables": {"key": "environmentVariables", "type": "{EnvironmentVariable}"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{EnvironmentVariable}", + }, "docker": {"key": "docker", "type": "Docker"}, "endpoints": {"key": "endpoints", "type": "[Endpoint]"}, "volumes": {"key": "volumes", "type": "[VolumeDefinition]"}, @@ -7211,7 +7645,10 @@ class Databricks(Compute, DatabricksSchema): "created_on": {"key": "createdOn", "type": "iso-8601"}, "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, "resource_id": {"key": "resourceId", "type": "str"}, - "provisioning_errors": {"key": "provisioningErrors", "type": "[ErrorResponse]"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } @@ -7252,7 +7689,10 @@ class DatabricksComputeSecretsProperties(msrest.serialization.Model): """ _attribute_map = { - "databricks_access_token": {"key": "databricksAccessToken", "type": "str"}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, } def __init__(self, **kwargs): @@ -7261,10 +7701,14 @@ def __init__(self, **kwargs): :paramtype databricks_access_token: str """ super(DatabricksComputeSecretsProperties, self).__init__(**kwargs) - self.databricks_access_token = kwargs.get("databricks_access_token", None) + self.databricks_access_token = kwargs.get( + "databricks_access_token", None + ) -class DatabricksComputeSecrets(ComputeSecrets, DatabricksComputeSecretsProperties): +class DatabricksComputeSecrets( + ComputeSecrets, DatabricksComputeSecretsProperties +): """Secrets related to a Machine Learning compute based on Databricks. All required parameters must be populated in order to send to Azure. @@ -7282,7 +7726,10 @@ class DatabricksComputeSecrets(ComputeSecrets, DatabricksComputeSecretsPropertie } _attribute_map = { - "databricks_access_token": {"key": "databricksAccessToken", "type": "str"}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, "compute_type": {"key": "computeType", "type": "str"}, } @@ -7292,7 +7739,9 @@ def __init__(self, **kwargs): :paramtype databricks_access_token: str """ super(DatabricksComputeSecrets, self).__init__(**kwargs) - self.databricks_access_token = kwargs.get("databricks_access_token", None) + self.databricks_access_token = kwargs.get( + "databricks_access_token", None + ) self.compute_type = "Databricks" # type: str @@ -7306,7 +7755,10 @@ class DatabricksProperties(msrest.serialization.Model): """ _attribute_map = { - "databricks_access_token": {"key": "databricksAccessToken", "type": "str"}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, "workspace_url": {"key": "workspaceUrl", "type": "str"}, } @@ -7318,7 +7770,9 @@ def __init__(self, **kwargs): :paramtype workspace_url: str """ super(DatabricksProperties, self).__init__(**kwargs) - self.databricks_access_token = kwargs.get("databricks_access_token", None) + self.databricks_access_token = kwargs.get( + "databricks_access_token", None + ) self.workspace_url = kwargs.get("workspace_url", None) @@ -7508,7 +7962,10 @@ class DataFactory(Compute): "created_on": {"key": "createdOn", "type": "iso-8601"}, "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, "resource_id": {"key": "resourceId", "type": "str"}, - "provisioning_errors": {"key": "provisioningErrors", "type": "[ErrorResponse]"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } @@ -7538,7 +7995,10 @@ class DataLakeAnalyticsSchema(msrest.serialization.Model): """ _attribute_map = { - "properties": {"key": "properties", "type": "DataLakeAnalyticsSchemaProperties"}, + "properties": { + "key": "properties", + "type": "DataLakeAnalyticsSchemaProperties", + }, } def __init__(self, **kwargs): @@ -7600,7 +8060,10 @@ class DataLakeAnalytics(Compute, DataLakeAnalyticsSchema): } _attribute_map = { - "properties": {"key": "properties", "type": "DataLakeAnalyticsSchemaProperties"}, + "properties": { + "key": "properties", + "type": "DataLakeAnalyticsSchemaProperties", + }, "compute_type": {"key": "computeType", "type": "str"}, "compute_location": {"key": "computeLocation", "type": "str"}, "provisioning_state": {"key": "provisioningState", "type": "str"}, @@ -7608,7 +8071,10 @@ class DataLakeAnalytics(Compute, DataLakeAnalyticsSchema): "created_on": {"key": "createdOn", "type": "iso-8601"}, "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, "resource_id": {"key": "resourceId", "type": "str"}, - "provisioning_errors": {"key": "provisioningErrors", "type": "[ErrorResponse]"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } @@ -7650,7 +8116,10 @@ class DataLakeAnalyticsSchemaProperties(msrest.serialization.Model): """ _attribute_map = { - "data_lake_store_account_name": {"key": "dataLakeStoreAccountName", "type": "str"}, + "data_lake_store_account_name": { + "key": "dataLakeStoreAccountName", + "type": "str", + }, } def __init__(self, **kwargs): @@ -7659,7 +8128,9 @@ def __init__(self, **kwargs): :paramtype data_lake_store_account_name: str """ super(DataLakeAnalyticsSchemaProperties, self).__init__(**kwargs) - self.data_lake_store_account_name = kwargs.get("data_lake_store_account_name", None) + self.data_lake_store_account_name = kwargs.get( + "data_lake_store_account_name", None + ) class DataPathAssetReference(AssetReferenceBase): @@ -7856,7 +8327,10 @@ class DataVersionBase(Resource): "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "DataVersionBaseProperties"}, + "properties": { + "key": "properties", + "type": "DataVersionBaseProperties", + }, } def __init__(self, **kwargs): @@ -7910,7 +8384,11 @@ class DataVersionBaseProperties(AssetBase): } _subtype_map = { - "data_type": {"mltable": "MLTableData", "uri_file": "UriFileDataVersion", "uri_folder": "UriFolderDataVersion"} + "data_type": { + "mltable": "MLTableData", + "uri_file": "UriFileDataVersion", + "uri_folder": "UriFolderDataVersion", + } } def __init__(self, **kwargs): @@ -7957,7 +8435,9 @@ def __init__(self, **kwargs): :keyword value: An array of objects of type DataVersionBase. :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBase] """ - super(DataVersionBaseResourceArmPaginatedResult, self).__init__(**kwargs) + super(DataVersionBaseResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = kwargs.get("next_link", None) self.value = kwargs.get("value", None) @@ -7984,7 +8464,10 @@ class OnlineScaleSettings(msrest.serialization.Model): } _subtype_map = { - "scale_type": {"Default": "DefaultScaleSettings", "TargetUtilization": "TargetUtilizationScaleSettings"} + "scale_type": { + "Default": "DefaultScaleSettings", + "TargetUtilization": "TargetUtilizationScaleSettings", + } } def __init__(self, **kwargs): @@ -8168,7 +8651,10 @@ class DiagnoseRequestProperties(msrest.serialization.Model): "storage_account": {"key": "storageAccount", "type": "{object}"}, "key_vault": {"key": "keyVault", "type": "{object}"}, "container_registry": {"key": "containerRegistry", "type": "{object}"}, - "application_insights": {"key": "applicationInsights", "type": "{object}"}, + "application_insights": { + "key": "applicationInsights", + "type": "{object}", + }, "others": {"key": "others", "type": "{object}"}, } @@ -8255,14 +8741,38 @@ class DiagnoseResponseResultValue(msrest.serialization.Model): """ _attribute_map = { - "user_defined_route_results": {"key": "userDefinedRouteResults", "type": "[DiagnoseResult]"}, - "network_security_rule_results": {"key": "networkSecurityRuleResults", "type": "[DiagnoseResult]"}, - "resource_lock_results": {"key": "resourceLockResults", "type": "[DiagnoseResult]"}, - "dns_resolution_results": {"key": "dnsResolutionResults", "type": "[DiagnoseResult]"}, - "storage_account_results": {"key": "storageAccountResults", "type": "[DiagnoseResult]"}, - "key_vault_results": {"key": "keyVaultResults", "type": "[DiagnoseResult]"}, - "container_registry_results": {"key": "containerRegistryResults", "type": "[DiagnoseResult]"}, - "application_insights_results": {"key": "applicationInsightsResults", "type": "[DiagnoseResult]"}, + "user_defined_route_results": { + "key": "userDefinedRouteResults", + "type": "[DiagnoseResult]", + }, + "network_security_rule_results": { + "key": "networkSecurityRuleResults", + "type": "[DiagnoseResult]", + }, + "resource_lock_results": { + "key": "resourceLockResults", + "type": "[DiagnoseResult]", + }, + "dns_resolution_results": { + "key": "dnsResolutionResults", + "type": "[DiagnoseResult]", + }, + "storage_account_results": { + "key": "storageAccountResults", + "type": "[DiagnoseResult]", + }, + "key_vault_results": { + "key": "keyVaultResults", + "type": "[DiagnoseResult]", + }, + "container_registry_results": { + "key": "containerRegistryResults", + "type": "[DiagnoseResult]", + }, + "application_insights_results": { + "key": "applicationInsightsResults", + "type": "[DiagnoseResult]", + }, "other_results": {"key": "otherResults", "type": "[DiagnoseResult]"}, } @@ -8295,14 +8805,26 @@ def __init__(self, **kwargs): :paramtype other_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] """ super(DiagnoseResponseResultValue, self).__init__(**kwargs) - self.user_defined_route_results = kwargs.get("user_defined_route_results", None) - self.network_security_rule_results = kwargs.get("network_security_rule_results", None) + self.user_defined_route_results = kwargs.get( + "user_defined_route_results", None + ) + self.network_security_rule_results = kwargs.get( + "network_security_rule_results", None + ) self.resource_lock_results = kwargs.get("resource_lock_results", None) - self.dns_resolution_results = kwargs.get("dns_resolution_results", None) - self.storage_account_results = kwargs.get("storage_account_results", None) + self.dns_resolution_results = kwargs.get( + "dns_resolution_results", None + ) + self.storage_account_results = kwargs.get( + "storage_account_results", None + ) self.key_vault_results = kwargs.get("key_vault_results", None) - self.container_registry_results = kwargs.get("container_registry_results", None) - self.application_insights_results = kwargs.get("application_insights_results", None) + self.container_registry_results = kwargs.get( + "container_registry_results", None + ) + self.application_insights_results = kwargs.get( + "application_insights_results", None + ) self.other_results = kwargs.get("other_results", None) @@ -8381,7 +8903,13 @@ class DistributionConfiguration(msrest.serialization.Model): "distribution_type": {"key": "distributionType", "type": "str"}, } - _subtype_map = {"distribution_type": {"Mpi": "Mpi", "PyTorch": "PyTorch", "TensorFlow": "TensorFlow"}} + _subtype_map = { + "distribution_type": { + "Mpi": "Mpi", + "PyTorch": "PyTorch", + "TensorFlow": "TensorFlow", + } + } def __init__(self, **kwargs): """ """ @@ -8509,7 +9037,10 @@ class EncryptionProperty(msrest.serialization.Model): _attribute_map = { "status": {"key": "status", "type": "str"}, "identity": {"key": "identity", "type": "IdentityForCmk"}, - "key_vault_properties": {"key": "keyVaultProperties", "type": "EncryptionKeyVaultProperties"}, + "key_vault_properties": { + "key": "keyVaultProperties", + "type": "EncryptionKeyVaultProperties", + }, } def __init__(self, **kwargs): @@ -8545,7 +9076,10 @@ class EncryptionUpdateProperties(msrest.serialization.Model): } _attribute_map = { - "key_vault_properties": {"key": "keyVaultProperties", "type": "EncryptionKeyVaultUpdateProperties"}, + "key_vault_properties": { + "key": "keyVaultProperties", + "type": "EncryptionKeyVaultUpdateProperties", + }, } def __init__(self, **kwargs): @@ -8646,7 +9180,10 @@ class EndpointAuthToken(msrest.serialization.Model): _attribute_map = { "access_token": {"key": "accessToken", "type": "str"}, "expiry_time_utc": {"key": "expiryTimeUtc", "type": "long"}, - "refresh_after_time_utc": {"key": "refreshAfterTimeUtc", "type": "long"}, + "refresh_after_time_utc": { + "key": "refreshAfterTimeUtc", + "type": "long", + }, "token_type": {"key": "tokenType", "type": "str"}, } @@ -8689,7 +9226,12 @@ class ScheduleActionBase(msrest.serialization.Model): "action_type": {"key": "actionType", "type": "str"}, } - _subtype_map = {"action_type": {"CreateJob": "JobScheduleAction", "InvokeBatchEndpoint": "EndpointScheduleAction"}} + _subtype_map = { + "action_type": { + "CreateJob": "JobScheduleAction", + "InvokeBatchEndpoint": "EndpointScheduleAction", + } + } def __init__(self, **kwargs): """ """ @@ -8722,7 +9264,10 @@ class EndpointScheduleAction(ScheduleActionBase): _attribute_map = { "action_type": {"key": "actionType", "type": "str"}, - "endpoint_invocation_definition": {"key": "endpointInvocationDefinition", "type": "object"}, + "endpoint_invocation_definition": { + "key": "endpointInvocationDefinition", + "type": "object", + }, } def __init__(self, **kwargs): @@ -8738,7 +9283,9 @@ def __init__(self, **kwargs): """ super(EndpointScheduleAction, self).__init__(**kwargs) self.action_type = "InvokeBatchEndpoint" # type: str - self.endpoint_invocation_definition = kwargs["endpoint_invocation_definition"] + self.endpoint_invocation_definition = kwargs[ + "endpoint_invocation_definition" + ] class EnvironmentContainer(Resource): @@ -8776,7 +9323,10 @@ class EnvironmentContainer(Resource): "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "EnvironmentContainerProperties"}, + "properties": { + "key": "properties", + "type": "EnvironmentContainerProperties", + }, } def __init__(self, **kwargs): @@ -8843,7 +9393,9 @@ def __init__(self, **kwargs): self.provisioning_state = None -class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model): +class EnvironmentContainerResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of EnvironmentContainer entities. :ivar next_link: The link to the next page of EnvironmentContainer objects. If null, there are @@ -8866,7 +9418,9 @@ def __init__(self, **kwargs): :keyword value: An array of objects of type EnvironmentContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] """ - super(EnvironmentContainerResourceArmPaginatedResult, self).__init__(**kwargs) + super(EnvironmentContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = kwargs.get("next_link", None) self.value = kwargs.get("value", None) @@ -8942,7 +9496,10 @@ class EnvironmentVersion(Resource): "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "EnvironmentVersionProperties"}, + "properties": { + "key": "properties", + "type": "EnvironmentVersionProperties", + }, } def __init__(self, **kwargs): @@ -9030,7 +9587,10 @@ class EnvironmentVersionProperties(AssetBase): "conda_file": {"key": "condaFile", "type": "str"}, "environment_type": {"key": "environmentType", "type": "str"}, "image": {"key": "image", "type": "str"}, - "inference_config": {"key": "inferenceConfig", "type": "InferenceContainerProperties"}, + "inference_config": { + "key": "inferenceConfig", + "type": "InferenceContainerProperties", + }, "os_type": {"key": "osType", "type": "str"}, "provisioning_state": {"key": "provisioningState", "type": "str"}, } @@ -9111,7 +9671,9 @@ def __init__(self, **kwargs): :keyword value: An array of objects of type EnvironmentVersion. :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] """ - super(EnvironmentVersionResourceArmPaginatedResult, self).__init__(**kwargs) + super(EnvironmentVersionResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = kwargs.get("next_link", None) self.value = kwargs.get("value", None) @@ -9174,7 +9736,10 @@ class ErrorDetail(msrest.serialization.Model): "message": {"key": "message", "type": "str"}, "target": {"key": "target", "type": "str"}, "details": {"key": "details", "type": "[ErrorDetail]"}, - "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"}, + "additional_info": { + "key": "additionalInfo", + "type": "[ErrorAdditionalInfo]", + }, } def __init__(self, **kwargs): @@ -9420,7 +9985,10 @@ class FeaturesetContainer(Resource): "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "FeaturesetContainerProperties"}, + "properties": { + "key": "properties", + "type": "FeaturesetContainerProperties", + }, } def __init__(self, **kwargs): @@ -9486,7 +10054,9 @@ def __init__(self, **kwargs): self.provisioning_state = None -class FeaturesetContainerResourceArmPaginatedResult(msrest.serialization.Model): +class FeaturesetContainerResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of FeaturesetContainer entities. :ivar next_link: The link to the next page of FeaturesetContainer objects. If null, there are @@ -9509,7 +10079,9 @@ def __init__(self, **kwargs): :keyword value: An array of objects of type FeaturesetContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetContainer] """ - super(FeaturesetContainerResourceArmPaginatedResult, self).__init__(**kwargs) + super(FeaturesetContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = kwargs.get("next_link", None) self.value = kwargs.get("value", None) @@ -9671,7 +10243,10 @@ class FeaturesetVersion(Resource): "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "FeaturesetVersionProperties"}, + "properties": { + "key": "properties", + "type": "FeaturesetVersionProperties", + }, } def __init__(self, **kwargs): @@ -9704,7 +10279,10 @@ class FeaturesetVersionBackfillRequest(msrest.serialization.Model): "description": {"key": "description", "type": "str"}, "display_name": {"key": "displayName", "type": "str"}, "feature_window": {"key": "featureWindow", "type": "FeatureWindow"}, - "resource": {"key": "resource", "type": "MaterializationComputeResource"}, + "resource": { + "key": "resource", + "type": "MaterializationComputeResource", + }, "spark_configuration": {"key": "sparkConfiguration", "type": "{str}"}, "tags": {"key": "tags", "type": "{str}"}, } @@ -9794,9 +10372,15 @@ class FeaturesetVersionProperties(AssetBase): "is_anonymous": {"key": "isAnonymous", "type": "bool"}, "is_archived": {"key": "isArchived", "type": "bool"}, "entities": {"key": "entities", "type": "[str]"}, - "materialization_settings": {"key": "materializationSettings", "type": "MaterializationSettings"}, + "materialization_settings": { + "key": "materializationSettings", + "type": "MaterializationSettings", + }, "provisioning_state": {"key": "provisioningState", "type": "str"}, - "specification": {"key": "specification", "type": "FeaturesetSpecification"}, + "specification": { + "key": "specification", + "type": "FeaturesetSpecification", + }, "stage": {"key": "stage", "type": "str"}, } @@ -9824,7 +10408,9 @@ def __init__(self, **kwargs): """ super(FeaturesetVersionProperties, self).__init__(**kwargs) self.entities = kwargs.get("entities", None) - self.materialization_settings = kwargs.get("materialization_settings", None) + self.materialization_settings = kwargs.get( + "materialization_settings", None + ) self.provisioning_state = None self.specification = kwargs.get("specification", None) self.stage = kwargs.get("stage", None) @@ -9853,7 +10439,9 @@ def __init__(self, **kwargs): :keyword value: An array of objects of type FeaturesetVersion. :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetVersion] """ - super(FeaturesetVersionResourceArmPaginatedResult, self).__init__(**kwargs) + super(FeaturesetVersionResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = kwargs.get("next_link", None) self.value = kwargs.get("value", None) @@ -9894,7 +10482,10 @@ class FeaturestoreEntityContainer(Resource): "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "FeaturestoreEntityContainerProperties"}, + "properties": { + "key": "properties", + "type": "FeaturestoreEntityContainerProperties", + }, } def __init__(self, **kwargs): @@ -9961,7 +10552,9 @@ def __init__(self, **kwargs): self.provisioning_state = None -class FeaturestoreEntityContainerResourceArmPaginatedResult(msrest.serialization.Model): +class FeaturestoreEntityContainerResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of FeaturestoreEntityContainer entities. :ivar next_link: The link to the next page of FeaturestoreEntityContainer objects. If null, @@ -9984,7 +10577,9 @@ def __init__(self, **kwargs): :keyword value: An array of objects of type FeaturestoreEntityContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer] """ - super(FeaturestoreEntityContainerResourceArmPaginatedResult, self).__init__(**kwargs) + super( + FeaturestoreEntityContainerResourceArmPaginatedResult, self + ).__init__(**kwargs) self.next_link = kwargs.get("next_link", None) self.value = kwargs.get("value", None) @@ -10025,7 +10620,10 @@ class FeaturestoreEntityVersion(Resource): "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "FeaturestoreEntityVersionProperties"}, + "properties": { + "key": "properties", + "type": "FeaturestoreEntityVersionProperties", + }, } def __init__(self, **kwargs): @@ -10095,7 +10693,9 @@ def __init__(self, **kwargs): self.provisioning_state = None -class FeaturestoreEntityVersionResourceArmPaginatedResult(msrest.serialization.Model): +class FeaturestoreEntityVersionResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of FeaturestoreEntityVersion entities. :ivar next_link: The link to the next page of FeaturestoreEntityVersion objects. If null, there @@ -10118,7 +10718,9 @@ def __init__(self, **kwargs): :keyword value: An array of objects of type FeaturestoreEntityVersion. :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion] """ - super(FeaturestoreEntityVersionResourceArmPaginatedResult, self).__init__(**kwargs) + super( + FeaturestoreEntityVersionResourceArmPaginatedResult, self + ).__init__(**kwargs) self.next_link = kwargs.get("next_link", None) self.value = kwargs.get("value", None) @@ -10134,7 +10736,10 @@ class FeatureWindow(msrest.serialization.Model): _attribute_map = { "feature_window_end": {"key": "featureWindowEnd", "type": "iso-8601"}, - "feature_window_start": {"key": "featureWindowStart", "type": "iso-8601"}, + "feature_window_start": { + "key": "featureWindowStart", + "type": "iso-8601", + }, } def __init__(self, **kwargs): @@ -10260,25 +10865,55 @@ class Forecasting(AutoMLVertical, TableVertical): } _attribute_map = { - "cv_split_column_names": {"key": "cvSplitColumnNames", "type": "[str]"}, - "featurization_settings": {"key": "featurizationSettings", "type": "TableVerticalFeaturizationSettings"}, - "fixed_parameters": {"key": "fixedParameters", "type": "TableFixedParameters"}, - "limit_settings": {"key": "limitSettings", "type": "TableVerticalLimitSettings"}, - "n_cross_validations": {"key": "nCrossValidations", "type": "NCrossValidations"}, - "search_space": {"key": "searchSpace", "type": "[TableParameterSubspace]"}, - "sweep_settings": {"key": "sweepSettings", "type": "TableSweepSettings"}, + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "TableFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "search_space": { + "key": "searchSpace", + "type": "[TableParameterSubspace]", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "TableSweepSettings", + }, "test_data": {"key": "testData", "type": "MLTableJobInput"}, "test_data_size": {"key": "testDataSize", "type": "float"}, - "validation_data": {"key": "validationData", "type": "MLTableJobInput"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, "validation_data_size": {"key": "validationDataSize", "type": "float"}, "weight_column_name": {"key": "weightColumnName", "type": "str"}, "log_verbosity": {"key": "logVerbosity", "type": "str"}, "target_column_name": {"key": "targetColumnName", "type": "str"}, "task_type": {"key": "taskType", "type": "str"}, "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, - "forecasting_settings": {"key": "forecastingSettings", "type": "ForecastingSettings"}, + "forecasting_settings": { + "key": "forecastingSettings", + "type": "ForecastingSettings", + }, "primary_metric": {"key": "primaryMetric", "type": "str"}, - "training_settings": {"key": "trainingSettings", "type": "ForecastingTrainingSettings"}, + "training_settings": { + "key": "trainingSettings", + "type": "ForecastingTrainingSettings", + }, } def __init__(self, **kwargs): @@ -10342,7 +10977,9 @@ def __init__(self, **kwargs): """ super(Forecasting, self).__init__(**kwargs) self.cv_split_column_names = kwargs.get("cv_split_column_names", None) - self.featurization_settings = kwargs.get("featurization_settings", None) + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) self.fixed_parameters = kwargs.get("fixed_parameters", None) self.limit_settings = kwargs.get("limit_settings", None) self.n_cross_validations = kwargs.get("n_cross_validations", None) @@ -10417,18 +11054,36 @@ class ForecastingSettings(msrest.serialization.Model): """ _attribute_map = { - "country_or_region_for_holidays": {"key": "countryOrRegionForHolidays", "type": "str"}, + "country_or_region_for_holidays": { + "key": "countryOrRegionForHolidays", + "type": "str", + }, "cv_step_size": {"key": "cvStepSize", "type": "int"}, "feature_lags": {"key": "featureLags", "type": "str"}, - "forecast_horizon": {"key": "forecastHorizon", "type": "ForecastHorizon"}, + "forecast_horizon": { + "key": "forecastHorizon", + "type": "ForecastHorizon", + }, "frequency": {"key": "frequency", "type": "str"}, "seasonality": {"key": "seasonality", "type": "Seasonality"}, - "short_series_handling_config": {"key": "shortSeriesHandlingConfig", "type": "str"}, - "target_aggregate_function": {"key": "targetAggregateFunction", "type": "str"}, + "short_series_handling_config": { + "key": "shortSeriesHandlingConfig", + "type": "str", + }, + "target_aggregate_function": { + "key": "targetAggregateFunction", + "type": "str", + }, "target_lags": {"key": "targetLags", "type": "TargetLags"}, - "target_rolling_window_size": {"key": "targetRollingWindowSize", "type": "TargetRollingWindowSize"}, + "target_rolling_window_size": { + "key": "targetRollingWindowSize", + "type": "TargetRollingWindowSize", + }, "time_column_name": {"key": "timeColumnName", "type": "str"}, - "time_series_id_column_names": {"key": "timeSeriesIdColumnNames", "type": "[str]"}, + "time_series_id_column_names": { + "key": "timeSeriesIdColumnNames", + "type": "[str]", + }, "use_stl": {"key": "useStl", "type": "str"}, } @@ -10487,18 +11142,28 @@ def __init__(self, **kwargs): :paramtype use_stl: str or ~azure.mgmt.machinelearningservices.models.UseStl """ super(ForecastingSettings, self).__init__(**kwargs) - self.country_or_region_for_holidays = kwargs.get("country_or_region_for_holidays", None) + self.country_or_region_for_holidays = kwargs.get( + "country_or_region_for_holidays", None + ) self.cv_step_size = kwargs.get("cv_step_size", None) self.feature_lags = kwargs.get("feature_lags", None) self.forecast_horizon = kwargs.get("forecast_horizon", None) self.frequency = kwargs.get("frequency", None) self.seasonality = kwargs.get("seasonality", None) - self.short_series_handling_config = kwargs.get("short_series_handling_config", None) - self.target_aggregate_function = kwargs.get("target_aggregate_function", None) + self.short_series_handling_config = kwargs.get( + "short_series_handling_config", None + ) + self.target_aggregate_function = kwargs.get( + "target_aggregate_function", None + ) self.target_lags = kwargs.get("target_lags", None) - self.target_rolling_window_size = kwargs.get("target_rolling_window_size", None) + self.target_rolling_window_size = kwargs.get( + "target_rolling_window_size", None + ) self.time_column_name = kwargs.get("time_column_name", None) - self.time_series_id_column_names = kwargs.get("time_series_id_column_names", None) + self.time_series_id_column_names = kwargs.get( + "time_series_id_column_names", None + ) self.use_stl = kwargs.get("use_stl", None) @@ -10540,15 +11205,36 @@ class ForecastingTrainingSettings(TrainingSettings): _attribute_map = { "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, - "enable_model_explainability": {"key": "enableModelExplainability", "type": "bool"}, - "enable_onnx_compatible_models": {"key": "enableOnnxCompatibleModels", "type": "bool"}, - "enable_stack_ensemble": {"key": "enableStackEnsemble", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, - "ensemble_model_download_timeout": {"key": "ensembleModelDownloadTimeout", "type": "duration"}, - "stack_ensemble_settings": {"key": "stackEnsembleSettings", "type": "StackEnsembleSettings"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, "training_mode": {"key": "trainingMode", "type": "str"}, - "allowed_training_algorithms": {"key": "allowedTrainingAlgorithms", "type": "[str]"}, - "blocked_training_algorithms": {"key": "blockedTrainingAlgorithms", "type": "[str]"}, + "allowed_training_algorithms": { + "key": "allowedTrainingAlgorithms", + "type": "[str]", + }, + "blocked_training_algorithms": { + "key": "blockedTrainingAlgorithms", + "type": "[str]", + }, } def __init__(self, **kwargs): @@ -10586,8 +11272,12 @@ def __init__(self, **kwargs): ~azure.mgmt.machinelearningservices.models.ForecastingModels] """ super(ForecastingTrainingSettings, self).__init__(**kwargs) - self.allowed_training_algorithms = kwargs.get("allowed_training_algorithms", None) - self.blocked_training_algorithms = kwargs.get("blocked_training_algorithms", None) + self.allowed_training_algorithms = kwargs.get( + "allowed_training_algorithms", None + ) + self.blocked_training_algorithms = kwargs.get( + "blocked_training_algorithms", None + ) class FQDNEndpoint(msrest.serialization.Model): @@ -10601,7 +11291,10 @@ class FQDNEndpoint(msrest.serialization.Model): _attribute_map = { "domain_name": {"key": "domainName", "type": "str"}, - "endpoint_details": {"key": "endpointDetails", "type": "[FQDNEndpointDetail]"}, + "endpoint_details": { + "key": "endpointDetails", + "type": "[FQDNEndpointDetail]", + }, } def __init__(self, **kwargs): @@ -10720,7 +11413,10 @@ class GridSamplingAlgorithm(SamplingAlgorithm): } _attribute_map = { - "sampling_algorithm_type": {"key": "samplingAlgorithmType", "type": "str"}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } def __init__(self, **kwargs): @@ -10774,7 +11470,10 @@ class HdfsDatastore(DatastoreProperties): "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, "datastore_type": {"key": "datastoreType", "type": "str"}, "is_default": {"key": "isDefault", "type": "bool"}, - "hdfs_server_certificate": {"key": "hdfsServerCertificate", "type": "str"}, + "hdfs_server_certificate": { + "key": "hdfsServerCertificate", + "type": "str", + }, "name_node_address": {"key": "nameNodeAddress", "type": "str"}, "protocol": {"key": "protocol", "type": "str"}, } @@ -10799,7 +11498,9 @@ def __init__(self, **kwargs): """ super(HdfsDatastore, self).__init__(**kwargs) self.datastore_type = "Hdfs" # type: str - self.hdfs_server_certificate = kwargs.get("hdfs_server_certificate", None) + self.hdfs_server_certificate = kwargs.get( + "hdfs_server_certificate", None + ) self.name_node_address = kwargs["name_node_address"] self.protocol = kwargs.get("protocol", "http") @@ -10880,7 +11581,10 @@ class HDInsight(Compute, HDInsightSchema): "created_on": {"key": "createdOn", "type": "iso-8601"}, "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, "resource_id": {"key": "resourceId", "type": "str"}, - "provisioning_errors": {"key": "provisioningErrors", "type": "[ErrorResponse]"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } @@ -10928,7 +11632,10 @@ class HDInsightProperties(msrest.serialization.Model): _attribute_map = { "ssh_port": {"key": "sshPort", "type": "int"}, "address": {"key": "address", "type": "str"}, - "administrator_account": {"key": "administratorAccount", "type": "VirtualMachineSshCredentials"}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, } def __init__(self, **kwargs): @@ -10988,7 +11695,10 @@ class IdentityForCmk(msrest.serialization.Model): """ _attribute_map = { - "user_assigned_identity": {"key": "userAssignedIdentity", "type": "str"}, + "user_assigned_identity": { + "key": "userAssignedIdentity", + "type": "str", + }, } def __init__(self, **kwargs): @@ -10998,7 +11708,9 @@ def __init__(self, **kwargs): :paramtype user_assigned_identity: str """ super(IdentityForCmk, self).__init__(**kwargs) - self.user_assigned_identity = kwargs.get("user_assigned_identity", None) + self.user_assigned_identity = kwargs.get( + "user_assigned_identity", None + ) class IdleShutdownSetting(msrest.serialization.Model): @@ -11010,7 +11722,10 @@ class IdleShutdownSetting(msrest.serialization.Model): """ _attribute_map = { - "idle_time_before_shutdown": {"key": "idleTimeBeforeShutdown", "type": "str"}, + "idle_time_before_shutdown": { + "key": "idleTimeBeforeShutdown", + "type": "str", + }, } def __init__(self, **kwargs): @@ -11020,7 +11735,9 @@ def __init__(self, **kwargs): :paramtype idle_time_before_shutdown: str """ super(IdleShutdownSetting, self).__init__(**kwargs) - self.idle_time_before_shutdown = kwargs.get("idle_time_before_shutdown", None) + self.idle_time_before_shutdown = kwargs.get( + "idle_time_before_shutdown", None + ) class Image(msrest.serialization.Model): @@ -11083,9 +11800,18 @@ class ImageVertical(msrest.serialization.Model): } _attribute_map = { - "limit_settings": {"key": "limitSettings", "type": "ImageLimitSettings"}, - "sweep_settings": {"key": "sweepSettings", "type": "ImageSweepSettings"}, - "validation_data": {"key": "validationData", "type": "MLTableJobInput"}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, "validation_data_size": {"key": "validationDataSize", "type": "float"}, } @@ -11140,12 +11866,27 @@ class ImageClassificationBase(ImageVertical): } _attribute_map = { - "limit_settings": {"key": "limitSettings", "type": "ImageLimitSettings"}, - "sweep_settings": {"key": "sweepSettings", "type": "ImageSweepSettings"}, - "validation_data": {"key": "validationData", "type": "MLTableJobInput"}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, "validation_data_size": {"key": "validationDataSize", "type": "float"}, - "model_settings": {"key": "modelSettings", "type": "ImageModelSettingsClassification"}, - "search_space": {"key": "searchSpace", "type": "[ImageModelDistributionSettingsClassification]"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsClassification", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsClassification]", + }, } def __init__(self, **kwargs): @@ -11225,12 +11966,27 @@ class ImageClassification(AutoMLVertical, ImageClassificationBase): } _attribute_map = { - "limit_settings": {"key": "limitSettings", "type": "ImageLimitSettings"}, - "sweep_settings": {"key": "sweepSettings", "type": "ImageSweepSettings"}, - "validation_data": {"key": "validationData", "type": "MLTableJobInput"}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, "validation_data_size": {"key": "validationDataSize", "type": "float"}, - "model_settings": {"key": "modelSettings", "type": "ImageModelSettingsClassification"}, - "search_space": {"key": "searchSpace", "type": "[ImageModelDistributionSettingsClassification]"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsClassification", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsClassification]", + }, "log_verbosity": {"key": "logVerbosity", "type": "str"}, "target_column_name": {"key": "targetColumnName", "type": "str"}, "task_type": {"key": "taskType", "type": "str"}, @@ -11337,12 +12093,27 @@ class ImageClassificationMultilabel(AutoMLVertical, ImageClassificationBase): } _attribute_map = { - "limit_settings": {"key": "limitSettings", "type": "ImageLimitSettings"}, - "sweep_settings": {"key": "sweepSettings", "type": "ImageSweepSettings"}, - "validation_data": {"key": "validationData", "type": "MLTableJobInput"}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, "validation_data_size": {"key": "validationDataSize", "type": "float"}, - "model_settings": {"key": "modelSettings", "type": "ImageModelSettingsClassification"}, - "search_space": {"key": "searchSpace", "type": "[ImageModelDistributionSettingsClassification]"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsClassification", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsClassification]", + }, "log_verbosity": {"key": "logVerbosity", "type": "str"}, "target_column_name": {"key": "targetColumnName", "type": "str"}, "task_type": {"key": "taskType", "type": "str"}, @@ -11428,12 +12199,27 @@ class ImageObjectDetectionBase(ImageVertical): } _attribute_map = { - "limit_settings": {"key": "limitSettings", "type": "ImageLimitSettings"}, - "sweep_settings": {"key": "sweepSettings", "type": "ImageSweepSettings"}, - "validation_data": {"key": "validationData", "type": "MLTableJobInput"}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, "validation_data_size": {"key": "validationDataSize", "type": "float"}, - "model_settings": {"key": "modelSettings", "type": "ImageModelSettingsObjectDetection"}, - "search_space": {"key": "searchSpace", "type": "[ImageModelDistributionSettingsObjectDetection]"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsObjectDetection", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsObjectDetection]", + }, } def __init__(self, **kwargs): @@ -11512,12 +12298,27 @@ class ImageInstanceSegmentation(AutoMLVertical, ImageObjectDetectionBase): } _attribute_map = { - "limit_settings": {"key": "limitSettings", "type": "ImageLimitSettings"}, - "sweep_settings": {"key": "sweepSettings", "type": "ImageSweepSettings"}, - "validation_data": {"key": "validationData", "type": "MLTableJobInput"}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, "validation_data_size": {"key": "validationDataSize", "type": "float"}, - "model_settings": {"key": "modelSettings", "type": "ImageModelSettingsObjectDetection"}, - "search_space": {"key": "searchSpace", "type": "[ImageModelDistributionSettingsObjectDetection]"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsObjectDetection", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsObjectDetection]", + }, "log_verbosity": {"key": "logVerbosity", "type": "str"}, "target_column_name": {"key": "targetColumnName", "type": "str"}, "task_type": {"key": "taskType", "type": "str"}, @@ -11620,7 +12421,10 @@ class ImageMetadata(msrest.serialization.Model): _attribute_map = { "current_image_version": {"key": "currentImageVersion", "type": "str"}, "latest_image_version": {"key": "latestImageVersion", "type": "str"}, - "is_latest_os_image_version": {"key": "isLatestOsImageVersion", "type": "bool"}, + "is_latest_os_image_version": { + "key": "isLatestOsImageVersion", + "type": "bool", + }, } def __init__(self, **kwargs): @@ -11637,7 +12441,9 @@ def __init__(self, **kwargs): super(ImageMetadata, self).__init__(**kwargs) self.current_image_version = kwargs.get("current_image_version", None) self.latest_image_version = kwargs.get("latest_image_version", None) - self.is_latest_os_image_version = kwargs.get("is_latest_os_image_version", None) + self.is_latest_os_image_version = kwargs.get( + "is_latest_os_image_version", None + ) class ImageModelDistributionSettings(msrest.serialization.Model): @@ -11745,13 +12551,25 @@ class ImageModelDistributionSettings(msrest.serialization.Model): "distributed": {"key": "distributed", "type": "str"}, "early_stopping": {"key": "earlyStopping", "type": "str"}, "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "str"}, - "early_stopping_patience": {"key": "earlyStoppingPatience", "type": "str"}, - "enable_onnx_normalization": {"key": "enableOnnxNormalization", "type": "str"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "str", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "str", + }, "evaluation_frequency": {"key": "evaluationFrequency", "type": "str"}, - "gradient_accumulation_step": {"key": "gradientAccumulationStep", "type": "str"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "str", + }, "layers_to_freeze": {"key": "layersToFreeze", "type": "str"}, "learning_rate": {"key": "learningRate", "type": "str"}, - "learning_rate_scheduler": {"key": "learningRateScheduler", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, "model_name": {"key": "modelName", "type": "str"}, "momentum": {"key": "momentum", "type": "str"}, "nesterov": {"key": "nesterov", "type": "str"}, @@ -11763,8 +12581,14 @@ class ImageModelDistributionSettings(msrest.serialization.Model): "step_lr_step_size": {"key": "stepLRStepSize", "type": "str"}, "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, - "warmup_cosine_lr_cycles": {"key": "warmupCosineLRCycles", "type": "str"}, - "warmup_cosine_lr_warmup_epochs": {"key": "warmupCosineLRWarmupEpochs", "type": "str"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "str", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "str", + }, "weight_decay": {"key": "weightDecay", "type": "str"}, } @@ -11859,13 +12683,21 @@ def __init__(self, **kwargs): self.distributed = kwargs.get("distributed", None) self.early_stopping = kwargs.get("early_stopping", None) self.early_stopping_delay = kwargs.get("early_stopping_delay", None) - self.early_stopping_patience = kwargs.get("early_stopping_patience", None) - self.enable_onnx_normalization = kwargs.get("enable_onnx_normalization", None) + self.early_stopping_patience = kwargs.get( + "early_stopping_patience", None + ) + self.enable_onnx_normalization = kwargs.get( + "enable_onnx_normalization", None + ) self.evaluation_frequency = kwargs.get("evaluation_frequency", None) - self.gradient_accumulation_step = kwargs.get("gradient_accumulation_step", None) + self.gradient_accumulation_step = kwargs.get( + "gradient_accumulation_step", None + ) self.layers_to_freeze = kwargs.get("layers_to_freeze", None) self.learning_rate = kwargs.get("learning_rate", None) - self.learning_rate_scheduler = kwargs.get("learning_rate_scheduler", None) + self.learning_rate_scheduler = kwargs.get( + "learning_rate_scheduler", None + ) self.model_name = kwargs.get("model_name", None) self.momentum = kwargs.get("momentum", None) self.nesterov = kwargs.get("nesterov", None) @@ -11877,12 +12709,18 @@ def __init__(self, **kwargs): self.step_lr_step_size = kwargs.get("step_lr_step_size", None) self.training_batch_size = kwargs.get("training_batch_size", None) self.validation_batch_size = kwargs.get("validation_batch_size", None) - self.warmup_cosine_lr_cycles = kwargs.get("warmup_cosine_lr_cycles", None) - self.warmup_cosine_lr_warmup_epochs = kwargs.get("warmup_cosine_lr_warmup_epochs", None) + self.warmup_cosine_lr_cycles = kwargs.get( + "warmup_cosine_lr_cycles", None + ) + self.warmup_cosine_lr_warmup_epochs = kwargs.get( + "warmup_cosine_lr_warmup_epochs", None + ) self.weight_decay = kwargs.get("weight_decay", None) -class ImageModelDistributionSettingsClassification(ImageModelDistributionSettings): +class ImageModelDistributionSettingsClassification( + ImageModelDistributionSettings +): """Distribution expressions to sweep over values of model settings. :code:` @@ -11998,13 +12836,25 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting "distributed": {"key": "distributed", "type": "str"}, "early_stopping": {"key": "earlyStopping", "type": "str"}, "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "str"}, - "early_stopping_patience": {"key": "earlyStoppingPatience", "type": "str"}, - "enable_onnx_normalization": {"key": "enableOnnxNormalization", "type": "str"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "str", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "str", + }, "evaluation_frequency": {"key": "evaluationFrequency", "type": "str"}, - "gradient_accumulation_step": {"key": "gradientAccumulationStep", "type": "str"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "str", + }, "layers_to_freeze": {"key": "layersToFreeze", "type": "str"}, "learning_rate": {"key": "learningRate", "type": "str"}, - "learning_rate_scheduler": {"key": "learningRateScheduler", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, "model_name": {"key": "modelName", "type": "str"}, "momentum": {"key": "momentum", "type": "str"}, "nesterov": {"key": "nesterov", "type": "str"}, @@ -12016,12 +12866,21 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting "step_lr_step_size": {"key": "stepLRStepSize", "type": "str"}, "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, - "warmup_cosine_lr_cycles": {"key": "warmupCosineLRCycles", "type": "str"}, - "warmup_cosine_lr_warmup_epochs": {"key": "warmupCosineLRWarmupEpochs", "type": "str"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "str", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "str", + }, "weight_decay": {"key": "weightDecay", "type": "str"}, "training_crop_size": {"key": "trainingCropSize", "type": "str"}, "validation_crop_size": {"key": "validationCropSize", "type": "str"}, - "validation_resize_size": {"key": "validationResizeSize", "type": "str"}, + "validation_resize_size": { + "key": "validationResizeSize", + "type": "str", + }, "weighted_loss": {"key": "weightedLoss", "type": "str"}, } @@ -12121,14 +12980,20 @@ def __init__(self, **kwargs): 0 or 1 or 2. :paramtype weighted_loss: str """ - super(ImageModelDistributionSettingsClassification, self).__init__(**kwargs) + super(ImageModelDistributionSettingsClassification, self).__init__( + **kwargs + ) self.training_crop_size = kwargs.get("training_crop_size", None) self.validation_crop_size = kwargs.get("validation_crop_size", None) - self.validation_resize_size = kwargs.get("validation_resize_size", None) + self.validation_resize_size = kwargs.get( + "validation_resize_size", None + ) self.weighted_loss = kwargs.get("weighted_loss", None) -class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettings): +class ImageModelDistributionSettingsObjectDetection( + ImageModelDistributionSettings +): """Distribution expressions to sweep over values of model settings. :code:` @@ -12283,13 +13148,25 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin "distributed": {"key": "distributed", "type": "str"}, "early_stopping": {"key": "earlyStopping", "type": "str"}, "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "str"}, - "early_stopping_patience": {"key": "earlyStoppingPatience", "type": "str"}, - "enable_onnx_normalization": {"key": "enableOnnxNormalization", "type": "str"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "str", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "str", + }, "evaluation_frequency": {"key": "evaluationFrequency", "type": "str"}, - "gradient_accumulation_step": {"key": "gradientAccumulationStep", "type": "str"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "str", + }, "layers_to_freeze": {"key": "layersToFreeze", "type": "str"}, "learning_rate": {"key": "learningRate", "type": "str"}, - "learning_rate_scheduler": {"key": "learningRateScheduler", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, "model_name": {"key": "modelName", "type": "str"}, "momentum": {"key": "momentum", "type": "str"}, "nesterov": {"key": "nesterov", "type": "str"}, @@ -12301,10 +13178,19 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin "step_lr_step_size": {"key": "stepLRStepSize", "type": "str"}, "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, - "warmup_cosine_lr_cycles": {"key": "warmupCosineLRCycles", "type": "str"}, - "warmup_cosine_lr_warmup_epochs": {"key": "warmupCosineLRWarmupEpochs", "type": "str"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "str", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "str", + }, "weight_decay": {"key": "weightDecay", "type": "str"}, - "box_detections_per_image": {"key": "boxDetectionsPerImage", "type": "str"}, + "box_detections_per_image": { + "key": "boxDetectionsPerImage", + "type": "str", + }, "box_score_threshold": {"key": "boxScoreThreshold", "type": "str"}, "image_size": {"key": "imageSize", "type": "str"}, "max_size": {"key": "maxSize", "type": "str"}, @@ -12314,9 +13200,18 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin "nms_iou_threshold": {"key": "nmsIouThreshold", "type": "str"}, "tile_grid_size": {"key": "tileGridSize", "type": "str"}, "tile_overlap_ratio": {"key": "tileOverlapRatio", "type": "str"}, - "tile_predictions_nms_threshold": {"key": "tilePredictionsNmsThreshold", "type": "str"}, - "validation_iou_threshold": {"key": "validationIouThreshold", "type": "str"}, - "validation_metric_type": {"key": "validationMetricType", "type": "str"}, + "tile_predictions_nms_threshold": { + "key": "tilePredictionsNmsThreshold", + "type": "str", + }, + "validation_iou_threshold": { + "key": "validationIouThreshold", + "type": "str", + }, + "validation_metric_type": { + "key": "validationMetricType", + "type": "str", + }, } def __init__(self, **kwargs): @@ -12454,8 +13349,12 @@ def __init__(self, **kwargs): be 'none', 'coco', 'voc', or 'coco_voc'. :paramtype validation_metric_type: str """ - super(ImageModelDistributionSettingsObjectDetection, self).__init__(**kwargs) - self.box_detections_per_image = kwargs.get("box_detections_per_image", None) + super(ImageModelDistributionSettingsObjectDetection, self).__init__( + **kwargs + ) + self.box_detections_per_image = kwargs.get( + "box_detections_per_image", None + ) self.box_score_threshold = kwargs.get("box_score_threshold", None) self.image_size = kwargs.get("image_size", None) self.max_size = kwargs.get("max_size", None) @@ -12465,9 +13364,15 @@ def __init__(self, **kwargs): self.nms_iou_threshold = kwargs.get("nms_iou_threshold", None) self.tile_grid_size = kwargs.get("tile_grid_size", None) self.tile_overlap_ratio = kwargs.get("tile_overlap_ratio", None) - self.tile_predictions_nms_threshold = kwargs.get("tile_predictions_nms_threshold", None) - self.validation_iou_threshold = kwargs.get("validation_iou_threshold", None) - self.validation_metric_type = kwargs.get("validation_metric_type", None) + self.tile_predictions_nms_threshold = kwargs.get( + "tile_predictions_nms_threshold", None + ) + self.validation_iou_threshold = kwargs.get( + "validation_iou_threshold", None + ) + self.validation_metric_type = kwargs.get( + "validation_metric_type", None + ) class ImageModelSettings(msrest.serialization.Model): @@ -12572,18 +13477,33 @@ class ImageModelSettings(msrest.serialization.Model): "beta1": {"key": "beta1", "type": "float"}, "beta2": {"key": "beta2", "type": "float"}, "checkpoint_frequency": {"key": "checkpointFrequency", "type": "int"}, - "checkpoint_model": {"key": "checkpointModel", "type": "MLFlowModelJobInput"}, + "checkpoint_model": { + "key": "checkpointModel", + "type": "MLFlowModelJobInput", + }, "checkpoint_run_id": {"key": "checkpointRunId", "type": "str"}, "distributed": {"key": "distributed", "type": "bool"}, "early_stopping": {"key": "earlyStopping", "type": "bool"}, "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "int"}, - "early_stopping_patience": {"key": "earlyStoppingPatience", "type": "int"}, - "enable_onnx_normalization": {"key": "enableOnnxNormalization", "type": "bool"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "int", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "bool", + }, "evaluation_frequency": {"key": "evaluationFrequency", "type": "int"}, - "gradient_accumulation_step": {"key": "gradientAccumulationStep", "type": "int"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "int", + }, "layers_to_freeze": {"key": "layersToFreeze", "type": "int"}, "learning_rate": {"key": "learningRate", "type": "float"}, - "learning_rate_scheduler": {"key": "learningRateScheduler", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, "model_name": {"key": "modelName", "type": "str"}, "momentum": {"key": "momentum", "type": "float"}, "nesterov": {"key": "nesterov", "type": "bool"}, @@ -12595,8 +13515,14 @@ class ImageModelSettings(msrest.serialization.Model): "step_lr_step_size": {"key": "stepLRStepSize", "type": "int"}, "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, - "warmup_cosine_lr_cycles": {"key": "warmupCosineLRCycles", "type": "float"}, - "warmup_cosine_lr_warmup_epochs": {"key": "warmupCosineLRWarmupEpochs", "type": "int"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "float", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "int", + }, "weight_decay": {"key": "weightDecay", "type": "float"}, } @@ -12706,13 +13632,21 @@ def __init__(self, **kwargs): self.distributed = kwargs.get("distributed", None) self.early_stopping = kwargs.get("early_stopping", None) self.early_stopping_delay = kwargs.get("early_stopping_delay", None) - self.early_stopping_patience = kwargs.get("early_stopping_patience", None) - self.enable_onnx_normalization = kwargs.get("enable_onnx_normalization", None) + self.early_stopping_patience = kwargs.get( + "early_stopping_patience", None + ) + self.enable_onnx_normalization = kwargs.get( + "enable_onnx_normalization", None + ) self.evaluation_frequency = kwargs.get("evaluation_frequency", None) - self.gradient_accumulation_step = kwargs.get("gradient_accumulation_step", None) + self.gradient_accumulation_step = kwargs.get( + "gradient_accumulation_step", None + ) self.layers_to_freeze = kwargs.get("layers_to_freeze", None) self.learning_rate = kwargs.get("learning_rate", None) - self.learning_rate_scheduler = kwargs.get("learning_rate_scheduler", None) + self.learning_rate_scheduler = kwargs.get( + "learning_rate_scheduler", None + ) self.model_name = kwargs.get("model_name", None) self.momentum = kwargs.get("momentum", None) self.nesterov = kwargs.get("nesterov", None) @@ -12724,8 +13658,12 @@ def __init__(self, **kwargs): self.step_lr_step_size = kwargs.get("step_lr_step_size", None) self.training_batch_size = kwargs.get("training_batch_size", None) self.validation_batch_size = kwargs.get("validation_batch_size", None) - self.warmup_cosine_lr_cycles = kwargs.get("warmup_cosine_lr_cycles", None) - self.warmup_cosine_lr_warmup_epochs = kwargs.get("warmup_cosine_lr_warmup_epochs", None) + self.warmup_cosine_lr_cycles = kwargs.get( + "warmup_cosine_lr_cycles", None + ) + self.warmup_cosine_lr_warmup_epochs = kwargs.get( + "warmup_cosine_lr_warmup_epochs", None + ) self.weight_decay = kwargs.get("weight_decay", None) @@ -12844,18 +13782,33 @@ class ImageModelSettingsClassification(ImageModelSettings): "beta1": {"key": "beta1", "type": "float"}, "beta2": {"key": "beta2", "type": "float"}, "checkpoint_frequency": {"key": "checkpointFrequency", "type": "int"}, - "checkpoint_model": {"key": "checkpointModel", "type": "MLFlowModelJobInput"}, + "checkpoint_model": { + "key": "checkpointModel", + "type": "MLFlowModelJobInput", + }, "checkpoint_run_id": {"key": "checkpointRunId", "type": "str"}, "distributed": {"key": "distributed", "type": "bool"}, "early_stopping": {"key": "earlyStopping", "type": "bool"}, "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "int"}, - "early_stopping_patience": {"key": "earlyStoppingPatience", "type": "int"}, - "enable_onnx_normalization": {"key": "enableOnnxNormalization", "type": "bool"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "int", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "bool", + }, "evaluation_frequency": {"key": "evaluationFrequency", "type": "int"}, - "gradient_accumulation_step": {"key": "gradientAccumulationStep", "type": "int"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "int", + }, "layers_to_freeze": {"key": "layersToFreeze", "type": "int"}, "learning_rate": {"key": "learningRate", "type": "float"}, - "learning_rate_scheduler": {"key": "learningRateScheduler", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, "model_name": {"key": "modelName", "type": "str"}, "momentum": {"key": "momentum", "type": "float"}, "nesterov": {"key": "nesterov", "type": "bool"}, @@ -12867,12 +13820,21 @@ class ImageModelSettingsClassification(ImageModelSettings): "step_lr_step_size": {"key": "stepLRStepSize", "type": "int"}, "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, - "warmup_cosine_lr_cycles": {"key": "warmupCosineLRCycles", "type": "float"}, - "warmup_cosine_lr_warmup_epochs": {"key": "warmupCosineLRWarmupEpochs", "type": "int"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "float", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "int", + }, "weight_decay": {"key": "weightDecay", "type": "float"}, "training_crop_size": {"key": "trainingCropSize", "type": "int"}, "validation_crop_size": {"key": "validationCropSize", "type": "int"}, - "validation_resize_size": {"key": "validationResizeSize", "type": "int"}, + "validation_resize_size": { + "key": "validationResizeSize", + "type": "int", + }, "weighted_loss": {"key": "weightedLoss", "type": "int"}, } @@ -12986,7 +13948,9 @@ def __init__(self, **kwargs): super(ImageModelSettingsClassification, self).__init__(**kwargs) self.training_crop_size = kwargs.get("training_crop_size", None) self.validation_crop_size = kwargs.get("validation_crop_size", None) - self.validation_resize_size = kwargs.get("validation_resize_size", None) + self.validation_resize_size = kwargs.get( + "validation_resize_size", None + ) self.weighted_loss = kwargs.get("weighted_loss", None) @@ -13145,18 +14109,33 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): "beta1": {"key": "beta1", "type": "float"}, "beta2": {"key": "beta2", "type": "float"}, "checkpoint_frequency": {"key": "checkpointFrequency", "type": "int"}, - "checkpoint_model": {"key": "checkpointModel", "type": "MLFlowModelJobInput"}, + "checkpoint_model": { + "key": "checkpointModel", + "type": "MLFlowModelJobInput", + }, "checkpoint_run_id": {"key": "checkpointRunId", "type": "str"}, "distributed": {"key": "distributed", "type": "bool"}, "early_stopping": {"key": "earlyStopping", "type": "bool"}, "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "int"}, - "early_stopping_patience": {"key": "earlyStoppingPatience", "type": "int"}, - "enable_onnx_normalization": {"key": "enableOnnxNormalization", "type": "bool"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "int", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "bool", + }, "evaluation_frequency": {"key": "evaluationFrequency", "type": "int"}, - "gradient_accumulation_step": {"key": "gradientAccumulationStep", "type": "int"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "int", + }, "layers_to_freeze": {"key": "layersToFreeze", "type": "int"}, "learning_rate": {"key": "learningRate", "type": "float"}, - "learning_rate_scheduler": {"key": "learningRateScheduler", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, "model_name": {"key": "modelName", "type": "str"}, "momentum": {"key": "momentum", "type": "float"}, "nesterov": {"key": "nesterov", "type": "bool"}, @@ -13168,10 +14147,19 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): "step_lr_step_size": {"key": "stepLRStepSize", "type": "int"}, "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, - "warmup_cosine_lr_cycles": {"key": "warmupCosineLRCycles", "type": "float"}, - "warmup_cosine_lr_warmup_epochs": {"key": "warmupCosineLRWarmupEpochs", "type": "int"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "float", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "int", + }, "weight_decay": {"key": "weightDecay", "type": "float"}, - "box_detections_per_image": {"key": "boxDetectionsPerImage", "type": "int"}, + "box_detections_per_image": { + "key": "boxDetectionsPerImage", + "type": "int", + }, "box_score_threshold": {"key": "boxScoreThreshold", "type": "float"}, "image_size": {"key": "imageSize", "type": "int"}, "max_size": {"key": "maxSize", "type": "int"}, @@ -13181,9 +14169,18 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): "nms_iou_threshold": {"key": "nmsIouThreshold", "type": "float"}, "tile_grid_size": {"key": "tileGridSize", "type": "str"}, "tile_overlap_ratio": {"key": "tileOverlapRatio", "type": "float"}, - "tile_predictions_nms_threshold": {"key": "tilePredictionsNmsThreshold", "type": "float"}, - "validation_iou_threshold": {"key": "validationIouThreshold", "type": "float"}, - "validation_metric_type": {"key": "validationMetricType", "type": "str"}, + "tile_predictions_nms_threshold": { + "key": "tilePredictionsNmsThreshold", + "type": "float", + }, + "validation_iou_threshold": { + "key": "validationIouThreshold", + "type": "float", + }, + "validation_metric_type": { + "key": "validationMetricType", + "type": "str", + }, } def __init__(self, **kwargs): @@ -13334,7 +14331,9 @@ def __init__(self, **kwargs): ~azure.mgmt.machinelearningservices.models.ValidationMetricType """ super(ImageModelSettingsObjectDetection, self).__init__(**kwargs) - self.box_detections_per_image = kwargs.get("box_detections_per_image", None) + self.box_detections_per_image = kwargs.get( + "box_detections_per_image", None + ) self.box_score_threshold = kwargs.get("box_score_threshold", None) self.image_size = kwargs.get("image_size", None) self.max_size = kwargs.get("max_size", None) @@ -13344,9 +14343,15 @@ def __init__(self, **kwargs): self.nms_iou_threshold = kwargs.get("nms_iou_threshold", None) self.tile_grid_size = kwargs.get("tile_grid_size", None) self.tile_overlap_ratio = kwargs.get("tile_overlap_ratio", None) - self.tile_predictions_nms_threshold = kwargs.get("tile_predictions_nms_threshold", None) - self.validation_iou_threshold = kwargs.get("validation_iou_threshold", None) - self.validation_metric_type = kwargs.get("validation_metric_type", None) + self.tile_predictions_nms_threshold = kwargs.get( + "tile_predictions_nms_threshold", None + ) + self.validation_iou_threshold = kwargs.get( + "validation_iou_threshold", None + ) + self.validation_metric_type = kwargs.get( + "validation_metric_type", None + ) class ImageObjectDetection(AutoMLVertical, ImageObjectDetectionBase): @@ -13399,12 +14404,27 @@ class ImageObjectDetection(AutoMLVertical, ImageObjectDetectionBase): } _attribute_map = { - "limit_settings": {"key": "limitSettings", "type": "ImageLimitSettings"}, - "sweep_settings": {"key": "sweepSettings", "type": "ImageSweepSettings"}, - "validation_data": {"key": "validationData", "type": "MLTableJobInput"}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, "validation_data_size": {"key": "validationDataSize", "type": "float"}, - "model_settings": {"key": "modelSettings", "type": "ImageModelSettingsObjectDetection"}, - "search_space": {"key": "searchSpace", "type": "[ImageModelDistributionSettingsObjectDetection]"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsObjectDetection", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsObjectDetection]", + }, "log_verbosity": {"key": "logVerbosity", "type": "str"}, "target_column_name": {"key": "targetColumnName", "type": "str"}, "task_type": {"key": "taskType", "type": "str"}, @@ -13477,7 +14497,10 @@ class ImageSweepSettings(msrest.serialization.Model): } _attribute_map = { - "early_termination": {"key": "earlyTermination", "type": "EarlyTerminationPolicy"}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, "sampling_algorithm": {"key": "samplingAlgorithm", "type": "str"}, } @@ -13568,7 +14591,10 @@ class InstanceTypeSchema(msrest.serialization.Model): _attribute_map = { "node_selector": {"key": "nodeSelector", "type": "{str}"}, - "resources": {"key": "resources", "type": "InstanceTypeSchemaResources"}, + "resources": { + "key": "resources", + "type": "InstanceTypeSchemaResources", + }, } def __init__(self, **kwargs): @@ -13761,7 +14787,10 @@ class JobScheduleAction(ScheduleActionBase): _attribute_map = { "action_type": {"key": "actionType", "type": "str"}, - "job_definition": {"key": "jobDefinition", "type": "JobBaseProperties"}, + "job_definition": { + "key": "jobDefinition", + "type": "JobBaseProperties", + }, } def __init__(self, **kwargs): @@ -14129,7 +15158,10 @@ class Kubernetes(Compute, KubernetesSchema): "created_on": {"key": "createdOn", "type": "iso-8601"}, "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, "resource_id": {"key": "resourceId", "type": "str"}, - "provisioning_errors": {"key": "provisioningErrors", "type": "[ErrorResponse]"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } @@ -14224,13 +15256,22 @@ class OnlineDeploymentProperties(EndpointDeploymentPropertiesBase): } _attribute_map = { - "code_configuration": {"key": "codeConfiguration", "type": "CodeConfiguration"}, + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, "description": {"key": "description", "type": "str"}, "environment_id": {"key": "environmentId", "type": "str"}, - "environment_variables": {"key": "environmentVariables", "type": "{str}"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, "properties": {"key": "properties", "type": "{str}"}, "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, - "egress_public_network_access": {"key": "egressPublicNetworkAccess", "type": "str"}, + "egress_public_network_access": { + "key": "egressPublicNetworkAccess", + "type": "str", + }, "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, "instance_type": {"key": "instanceType", "type": "str"}, "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, @@ -14238,12 +15279,21 @@ class OnlineDeploymentProperties(EndpointDeploymentPropertiesBase): "model_mount_path": {"key": "modelMountPath", "type": "str"}, "provisioning_state": {"key": "provisioningState", "type": "str"}, "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, - "request_settings": {"key": "requestSettings", "type": "OnlineRequestSettings"}, - "scale_settings": {"key": "scaleSettings", "type": "OnlineScaleSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, } _subtype_map = { - "endpoint_compute_type": {"Kubernetes": "KubernetesOnlineDeployment", "Managed": "ManagedOnlineDeployment"} + "endpoint_compute_type": { + "Kubernetes": "KubernetesOnlineDeployment", + "Managed": "ManagedOnlineDeployment", + } } def __init__(self, **kwargs): @@ -14287,7 +15337,9 @@ def __init__(self, **kwargs): """ super(OnlineDeploymentProperties, self).__init__(**kwargs) self.app_insights_enabled = kwargs.get("app_insights_enabled", False) - self.egress_public_network_access = kwargs.get("egress_public_network_access", None) + self.egress_public_network_access = kwargs.get( + "egress_public_network_access", None + ) self.endpoint_compute_type = "OnlineDeploymentProperties" # type: str self.instance_type = kwargs.get("instance_type", None) self.liveness_probe = kwargs.get("liveness_probe", None) @@ -14362,13 +15414,22 @@ class KubernetesOnlineDeployment(OnlineDeploymentProperties): } _attribute_map = { - "code_configuration": {"key": "codeConfiguration", "type": "CodeConfiguration"}, + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, "description": {"key": "description", "type": "str"}, "environment_id": {"key": "environmentId", "type": "str"}, - "environment_variables": {"key": "environmentVariables", "type": "{str}"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, "properties": {"key": "properties", "type": "{str}"}, "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, - "egress_public_network_access": {"key": "egressPublicNetworkAccess", "type": "str"}, + "egress_public_network_access": { + "key": "egressPublicNetworkAccess", + "type": "str", + }, "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, "instance_type": {"key": "instanceType", "type": "str"}, "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, @@ -14376,8 +15437,14 @@ class KubernetesOnlineDeployment(OnlineDeploymentProperties): "model_mount_path": {"key": "modelMountPath", "type": "str"}, "provisioning_state": {"key": "provisioningState", "type": "str"}, "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, - "request_settings": {"key": "requestSettings", "type": "OnlineRequestSettings"}, - "scale_settings": {"key": "scaleSettings", "type": "OnlineScaleSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, "container_resource_requirements": { "key": "containerResourceRequirements", "type": "ContainerResourceRequirements", @@ -14429,7 +15496,9 @@ def __init__(self, **kwargs): """ super(KubernetesOnlineDeployment, self).__init__(**kwargs) self.endpoint_compute_type = "Kubernetes" # type: str - self.container_resource_requirements = kwargs.get("container_resource_requirements", None) + self.container_resource_requirements = kwargs.get( + "container_resource_requirements", None + ) class KubernetesProperties(msrest.serialization.Model): @@ -14455,14 +15524,29 @@ class KubernetesProperties(msrest.serialization.Model): """ _attribute_map = { - "relay_connection_string": {"key": "relayConnectionString", "type": "str"}, - "service_bus_connection_string": {"key": "serviceBusConnectionString", "type": "str"}, - "extension_principal_id": {"key": "extensionPrincipalId", "type": "str"}, - "extension_instance_release_train": {"key": "extensionInstanceReleaseTrain", "type": "str"}, + "relay_connection_string": { + "key": "relayConnectionString", + "type": "str", + }, + "service_bus_connection_string": { + "key": "serviceBusConnectionString", + "type": "str", + }, + "extension_principal_id": { + "key": "extensionPrincipalId", + "type": "str", + }, + "extension_instance_release_train": { + "key": "extensionInstanceReleaseTrain", + "type": "str", + }, "vc_name": {"key": "vcName", "type": "str"}, "namespace": {"key": "namespace", "type": "str"}, "default_instance_type": {"key": "defaultInstanceType", "type": "str"}, - "instance_types": {"key": "instanceTypes", "type": "{InstanceTypeSchema}"}, + "instance_types": { + "key": "instanceTypes", + "type": "{InstanceTypeSchema}", + }, } def __init__(self, **kwargs): @@ -14486,10 +15570,18 @@ def __init__(self, **kwargs): ~azure.mgmt.machinelearningservices.models.InstanceTypeSchema] """ super(KubernetesProperties, self).__init__(**kwargs) - self.relay_connection_string = kwargs.get("relay_connection_string", None) - self.service_bus_connection_string = kwargs.get("service_bus_connection_string", None) - self.extension_principal_id = kwargs.get("extension_principal_id", None) - self.extension_instance_release_train = kwargs.get("extension_instance_release_train", None) + self.relay_connection_string = kwargs.get( + "relay_connection_string", None + ) + self.service_bus_connection_string = kwargs.get( + "service_bus_connection_string", None + ) + self.extension_principal_id = kwargs.get( + "extension_principal_id", None + ) + self.extension_instance_release_train = kwargs.get( + "extension_instance_release_train", None + ) self.vc_name = kwargs.get("vc_name", None) self.namespace = kwargs.get("namespace", "default") self.default_instance_type = kwargs.get("default_instance_type", None) @@ -14569,7 +15661,10 @@ class LabelingDataConfiguration(msrest.serialization.Model): _attribute_map = { "data_id": {"key": "dataId", "type": "str"}, - "incremental_data_refresh": {"key": "incrementalDataRefresh", "type": "str"}, + "incremental_data_refresh": { + "key": "incrementalDataRefresh", + "type": "str", + }, } def __init__(self, **kwargs): @@ -14583,7 +15678,9 @@ def __init__(self, **kwargs): """ super(LabelingDataConfiguration, self).__init__(**kwargs) self.data_id = kwargs.get("data_id", None) - self.incremental_data_refresh = kwargs.get("incremental_data_refresh", None) + self.incremental_data_refresh = kwargs.get( + "incremental_data_refresh", None + ) class LabelingJob(Resource): @@ -14654,7 +15751,12 @@ class LabelingJobMediaProperties(msrest.serialization.Model): "media_type": {"key": "mediaType", "type": "str"}, } - _subtype_map = {"media_type": {"Image": "LabelingJobImageProperties", "Text": "LabelingJobTextProperties"}} + _subtype_map = { + "media_type": { + "Image": "LabelingJobImageProperties", + "Text": "LabelingJobTextProperties", + } + } def __init__(self, **kwargs): """ """ @@ -14804,19 +15906,43 @@ class LabelingJobProperties(JobBaseProperties): "identity": {"key": "identity", "type": "IdentityConfiguration"}, "is_archived": {"key": "isArchived", "type": "bool"}, "job_type": {"key": "jobType", "type": "str"}, - "notification_setting": {"key": "notificationSetting", "type": "NotificationSetting"}, + "notification_setting": { + "key": "notificationSetting", + "type": "NotificationSetting", + }, "services": {"key": "services", "type": "{JobService}"}, "status": {"key": "status", "type": "str"}, "created_date_time": {"key": "createdDateTime", "type": "iso-8601"}, - "data_configuration": {"key": "dataConfiguration", "type": "LabelingDataConfiguration"}, - "job_instructions": {"key": "jobInstructions", "type": "LabelingJobInstructions"}, - "label_categories": {"key": "labelCategories", "type": "{LabelCategory}"}, - "labeling_job_media_properties": {"key": "labelingJobMediaProperties", "type": "LabelingJobMediaProperties"}, - "ml_assist_configuration": {"key": "mlAssistConfiguration", "type": "MLAssistConfiguration"}, - "progress_metrics": {"key": "progressMetrics", "type": "ProgressMetrics"}, + "data_configuration": { + "key": "dataConfiguration", + "type": "LabelingDataConfiguration", + }, + "job_instructions": { + "key": "jobInstructions", + "type": "LabelingJobInstructions", + }, + "label_categories": { + "key": "labelCategories", + "type": "{LabelCategory}", + }, + "labeling_job_media_properties": { + "key": "labelingJobMediaProperties", + "type": "LabelingJobMediaProperties", + }, + "ml_assist_configuration": { + "key": "mlAssistConfiguration", + "type": "MLAssistConfiguration", + }, + "progress_metrics": { + "key": "progressMetrics", + "type": "ProgressMetrics", + }, "project_id": {"key": "projectId", "type": "str"}, "provisioning_state": {"key": "provisioningState", "type": "str"}, - "status_messages": {"key": "statusMessages", "type": "[StatusMessage]"}, + "status_messages": { + "key": "statusMessages", + "type": "[StatusMessage]", + }, } def __init__(self, **kwargs): @@ -14868,8 +15994,12 @@ def __init__(self, **kwargs): self.data_configuration = kwargs.get("data_configuration", None) self.job_instructions = kwargs.get("job_instructions", None) self.label_categories = kwargs.get("label_categories", None) - self.labeling_job_media_properties = kwargs.get("labeling_job_media_properties", None) - self.ml_assist_configuration = kwargs.get("ml_assist_configuration", None) + self.labeling_job_media_properties = kwargs.get( + "labeling_job_media_properties", None + ) + self.ml_assist_configuration = kwargs.get( + "ml_assist_configuration", None + ) self.progress_metrics = None self.project_id = None self.provisioning_state = None @@ -15076,13 +16206,22 @@ class ListWorkspaceKeysResult(msrest.serialization.Model): _attribute_map = { "user_storage_key": {"key": "userStorageKey", "type": "str"}, - "user_storage_resource_id": {"key": "userStorageResourceId", "type": "str"}, - "app_insights_instrumentation_key": {"key": "appInsightsInstrumentationKey", "type": "str"}, + "user_storage_resource_id": { + "key": "userStorageResourceId", + "type": "str", + }, + "app_insights_instrumentation_key": { + "key": "appInsightsInstrumentationKey", + "type": "str", + }, "container_registry_credentials": { "key": "containerRegistryCredentials", "type": "RegistryListCredentialsResult", }, - "notebook_access_keys": {"key": "notebookAccessKeys", "type": "ListNotebookKeysResult"}, + "notebook_access_keys": { + "key": "notebookAccessKeys", + "type": "ListNotebookKeysResult", + }, } def __init__(self, **kwargs): @@ -15212,7 +16351,9 @@ def __init__(self, **kwargs): self.resource_id = kwargs.get("resource_id", None) -class ManagedIdentityAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class ManagedIdentityAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """ManagedIdentityAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -15246,7 +16387,10 @@ class ManagedIdentityAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPr "target": {"key": "target", "type": "str"}, "value": {"key": "value", "type": "str"}, "value_format": {"key": "valueFormat", "type": "str"}, - "credentials": {"key": "credentials", "type": "WorkspaceConnectionManagedIdentity"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionManagedIdentity", + }, } def __init__(self, **kwargs): @@ -15266,7 +16410,9 @@ def __init__(self, **kwargs): :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity """ - super(ManagedIdentityAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) + super( + ManagedIdentityAuthTypeWorkspaceConnectionProperties, self + ).__init__(**kwargs) self.auth_type = "ManagedIdentity" # type: str self.credentials = kwargs.get("credentials", None) @@ -15330,13 +16476,22 @@ class ManagedOnlineDeployment(OnlineDeploymentProperties): } _attribute_map = { - "code_configuration": {"key": "codeConfiguration", "type": "CodeConfiguration"}, + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, "description": {"key": "description", "type": "str"}, "environment_id": {"key": "environmentId", "type": "str"}, - "environment_variables": {"key": "environmentVariables", "type": "{str}"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, "properties": {"key": "properties", "type": "{str}"}, "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, - "egress_public_network_access": {"key": "egressPublicNetworkAccess", "type": "str"}, + "egress_public_network_access": { + "key": "egressPublicNetworkAccess", + "type": "str", + }, "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, "instance_type": {"key": "instanceType", "type": "str"}, "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, @@ -15344,8 +16499,14 @@ class ManagedOnlineDeployment(OnlineDeploymentProperties): "model_mount_path": {"key": "modelMountPath", "type": "str"}, "provisioning_state": {"key": "provisioningState", "type": "str"}, "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, - "request_settings": {"key": "requestSettings", "type": "OnlineRequestSettings"}, - "scale_settings": {"key": "scaleSettings", "type": "OnlineScaleSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, } def __init__(self, **kwargs): @@ -15426,7 +16587,10 @@ class ManagedServiceIdentity(msrest.serialization.Model): "principal_id": {"key": "principalId", "type": "str"}, "tenant_id": {"key": "tenantId", "type": "str"}, "type": {"key": "type", "type": "str"}, - "user_assigned_identities": {"key": "userAssignedIdentities", "type": "{UserAssignedIdentity}"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{UserAssignedIdentity}", + }, } def __init__(self, **kwargs): @@ -15446,7 +16610,9 @@ def __init__(self, **kwargs): self.principal_id = None self.tenant_id = None self.type = kwargs["type"] - self.user_assigned_identities = kwargs.get("user_assigned_identities", None) + self.user_assigned_identities = kwargs.get( + "user_assigned_identities", None + ) class MaterializationComputeResource(msrest.serialization.Model): @@ -15487,7 +16653,10 @@ class MaterializationSettings(msrest.serialization.Model): _attribute_map = { "notification": {"key": "notification", "type": "NotificationSetting"}, - "resource": {"key": "resource", "type": "MaterializationComputeResource"}, + "resource": { + "key": "resource", + "type": "MaterializationComputeResource", + }, "schedule": {"key": "schedule", "type": "RecurrenceTrigger"}, "spark_configuration": {"key": "sparkConfiguration", "type": "{str}"}, "store_type": {"key": "storeType", "type": "str"}, @@ -15574,7 +16743,10 @@ class MLAssistConfiguration(msrest.serialization.Model): } _subtype_map = { - "ml_assist": {"Disabled": "MLAssistConfigurationDisabled", "Enabled": "MLAssistConfigurationEnabled"} + "ml_assist": { + "Disabled": "MLAssistConfigurationDisabled", + "Enabled": "MLAssistConfigurationEnabled", + } } def __init__(self, **kwargs): @@ -15624,14 +16796,26 @@ class MLAssistConfigurationEnabled(MLAssistConfiguration): _validation = { "ml_assist": {"required": True}, - "inferencing_compute_binding": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, - "training_compute_binding": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "inferencing_compute_binding": { + "required": True, + "pattern": r"[a-zA-Z0-9_]", + }, + "training_compute_binding": { + "required": True, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { "ml_assist": {"key": "mlAssist", "type": "str"}, - "inferencing_compute_binding": {"key": "inferencingComputeBinding", "type": "str"}, - "training_compute_binding": {"key": "trainingComputeBinding", "type": "str"}, + "inferencing_compute_binding": { + "key": "inferencingComputeBinding", + "type": "str", + }, + "training_compute_binding": { + "key": "trainingComputeBinding", + "type": "str", + }, } def __init__(self, **kwargs): @@ -15644,7 +16828,9 @@ def __init__(self, **kwargs): """ super(MLAssistConfigurationEnabled, self).__init__(**kwargs) self.ml_assist = "Enabled" # type: str - self.inferencing_compute_binding = kwargs["inferencing_compute_binding"] + self.inferencing_compute_binding = kwargs[ + "inferencing_compute_binding" + ] self.training_compute_binding = kwargs["training_compute_binding"] @@ -15985,7 +17171,10 @@ class ModelContainer(Resource): "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "ModelContainerProperties"}, + "properties": { + "key": "properties", + "type": "ModelContainerProperties", + }, } def __init__(self, **kwargs): @@ -16074,7 +17263,9 @@ def __init__(self, **kwargs): :keyword value: An array of objects of type ModelContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelContainer] """ - super(ModelContainerResourceArmPaginatedResult, self).__init__(**kwargs) + super(ModelContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = kwargs.get("next_link", None) self.value = kwargs.get("value", None) @@ -16296,7 +17487,10 @@ class Mpi(DistributionConfiguration): _attribute_map = { "distribution_type": {"key": "distributionType", "type": "str"}, - "process_count_per_instance": {"key": "processCountPerInstance", "type": "int"}, + "process_count_per_instance": { + "key": "processCountPerInstance", + "type": "int", + }, } def __init__(self, **kwargs): @@ -16306,7 +17500,9 @@ def __init__(self, **kwargs): """ super(Mpi, self).__init__(**kwargs) self.distribution_type = "Mpi" # type: str - self.process_count_per_instance = kwargs.get("process_count_per_instance", None) + self.process_count_per_instance = kwargs.get( + "process_count_per_instance", None + ) class NlpFixedParameters(msrest.serialization.Model): @@ -16337,9 +17533,15 @@ class NlpFixedParameters(msrest.serialization.Model): """ _attribute_map = { - "gradient_accumulation_steps": {"key": "gradientAccumulationSteps", "type": "int"}, + "gradient_accumulation_steps": { + "key": "gradientAccumulationSteps", + "type": "int", + }, "learning_rate": {"key": "learningRate", "type": "float"}, - "learning_rate_scheduler": {"key": "learningRateScheduler", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, "model_name": {"key": "modelName", "type": "str"}, "number_of_epochs": {"key": "numberOfEpochs", "type": "int"}, "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, @@ -16374,9 +17576,13 @@ def __init__(self, **kwargs): :paramtype weight_decay: float """ super(NlpFixedParameters, self).__init__(**kwargs) - self.gradient_accumulation_steps = kwargs.get("gradient_accumulation_steps", None) + self.gradient_accumulation_steps = kwargs.get( + "gradient_accumulation_steps", None + ) self.learning_rate = kwargs.get("learning_rate", None) - self.learning_rate_scheduler = kwargs.get("learning_rate_scheduler", None) + self.learning_rate_scheduler = kwargs.get( + "learning_rate_scheduler", None + ) self.model_name = kwargs.get("model_name", None) self.number_of_epochs = kwargs.get("number_of_epochs", None) self.training_batch_size = kwargs.get("training_batch_size", None) @@ -16411,9 +17617,15 @@ class NlpParameterSubspace(msrest.serialization.Model): """ _attribute_map = { - "gradient_accumulation_steps": {"key": "gradientAccumulationSteps", "type": "str"}, + "gradient_accumulation_steps": { + "key": "gradientAccumulationSteps", + "type": "str", + }, "learning_rate": {"key": "learningRate", "type": "str"}, - "learning_rate_scheduler": {"key": "learningRateScheduler", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, "model_name": {"key": "modelName", "type": "str"}, "number_of_epochs": {"key": "numberOfEpochs", "type": "str"}, "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, @@ -16446,9 +17658,13 @@ def __init__(self, **kwargs): :paramtype weight_decay: str """ super(NlpParameterSubspace, self).__init__(**kwargs) - self.gradient_accumulation_steps = kwargs.get("gradient_accumulation_steps", None) + self.gradient_accumulation_steps = kwargs.get( + "gradient_accumulation_steps", None + ) self.learning_rate = kwargs.get("learning_rate", None) - self.learning_rate_scheduler = kwargs.get("learning_rate_scheduler", None) + self.learning_rate_scheduler = kwargs.get( + "learning_rate_scheduler", None + ) self.model_name = kwargs.get("model_name", None) self.number_of_epochs = kwargs.get("number_of_epochs", None) self.training_batch_size = kwargs.get("training_batch_size", None) @@ -16475,7 +17691,10 @@ class NlpSweepSettings(msrest.serialization.Model): } _attribute_map = { - "early_termination": {"key": "earlyTermination", "type": "EarlyTerminationPolicy"}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, "sampling_algorithm": {"key": "samplingAlgorithm", "type": "str"}, } @@ -16515,12 +17734,27 @@ class NlpVertical(msrest.serialization.Model): """ _attribute_map = { - "featurization_settings": {"key": "featurizationSettings", "type": "NlpVerticalFeaturizationSettings"}, - "fixed_parameters": {"key": "fixedParameters", "type": "NlpFixedParameters"}, - "limit_settings": {"key": "limitSettings", "type": "NlpVerticalLimitSettings"}, - "search_space": {"key": "searchSpace", "type": "[NlpParameterSubspace]"}, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "NlpFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "search_space": { + "key": "searchSpace", + "type": "[NlpParameterSubspace]", + }, "sweep_settings": {"key": "sweepSettings", "type": "NlpSweepSettings"}, - "validation_data": {"key": "validationData", "type": "MLTableJobInput"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, } def __init__(self, **kwargs): @@ -16542,7 +17776,9 @@ def __init__(self, **kwargs): :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ super(NlpVertical, self).__init__(**kwargs) - self.featurization_settings = kwargs.get("featurization_settings", None) + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) self.fixed_parameters = kwargs.get("fixed_parameters", None) self.limit_settings = kwargs.get("limit_settings", None) self.search_space = kwargs.get("search_space", None) @@ -16661,7 +17897,9 @@ def __init__(self, **kwargs): self.preempted_node_count = None -class NoneAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class NoneAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """NoneAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -16708,7 +17946,9 @@ def __init__(self, **kwargs): "JSON". :paramtype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat """ - super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) + super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__( + **kwargs + ) self.auth_type = "None" # type: str @@ -16836,7 +18076,10 @@ class NotebookResourceInfo(msrest.serialization.Model): _attribute_map = { "fqdn": {"key": "fqdn", "type": "str"}, "resource_id": {"key": "resourceId", "type": "str"}, - "notebook_preparation_error": {"key": "notebookPreparationError", "type": "NotebookPreparationError"}, + "notebook_preparation_error": { + "key": "notebookPreparationError", + "type": "NotebookPreparationError", + }, } def __init__(self, **kwargs): @@ -16852,7 +18095,9 @@ def __init__(self, **kwargs): super(NotebookResourceInfo, self).__init__(**kwargs) self.fqdn = kwargs.get("fqdn", None) self.resource_id = kwargs.get("resource_id", None) - self.notebook_preparation_error = kwargs.get("notebook_preparation_error", None) + self.notebook_preparation_error = kwargs.get( + "notebook_preparation_error", None + ) class NotificationSetting(msrest.serialization.Model): @@ -16971,7 +18216,10 @@ class OnlineDeployment(TrackedResource): "location": {"key": "location", "type": "str"}, "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, "kind": {"key": "kind", "type": "str"}, - "properties": {"key": "properties", "type": "OnlineDeploymentProperties"}, + "properties": { + "key": "properties", + "type": "OnlineDeploymentProperties", + }, "sku": {"key": "sku", "type": "Sku"}, } @@ -16998,7 +18246,9 @@ def __init__(self, **kwargs): self.sku = kwargs.get("sku", None) -class OnlineDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class OnlineDeploymentTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of OnlineDeployment entities. :ivar next_link: The link to the next page of OnlineDeployment objects. If null, there are no @@ -17021,7 +18271,9 @@ def __init__(self, **kwargs): :keyword value: An array of objects of type OnlineDeployment. :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineDeployment] """ - super(OnlineDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) + super( + OnlineDeploymentTrackedResourceArmPaginatedResult, self + ).__init__(**kwargs) self.next_link = kwargs.get("next_link", None) self.value = kwargs.get("value", None) @@ -17077,7 +18329,10 @@ class OnlineEndpoint(TrackedResource): "location": {"key": "location", "type": "str"}, "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, "kind": {"key": "kind", "type": "str"}, - "properties": {"key": "properties", "type": "OnlineEndpointProperties"}, + "properties": { + "key": "properties", + "type": "OnlineEndpointProperties", + }, "sku": {"key": "sku", "type": "Sku"}, } @@ -17203,7 +18458,9 @@ def __init__(self, **kwargs): self.traffic = kwargs.get("traffic", None) -class OnlineEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class OnlineEndpointTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of OnlineEndpoint entities. :ivar next_link: The link to the next page of OnlineEndpoint objects. If null, there are no @@ -17226,7 +18483,9 @@ def __init__(self, **kwargs): :keyword value: An array of objects of type OnlineEndpoint. :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] """ - super(OnlineEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) + super(OnlineEndpointTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = kwargs.get("next_link", None) self.value = kwargs.get("value", None) @@ -17293,7 +18552,10 @@ class OnlineRequestSettings(msrest.serialization.Model): """ _attribute_map = { - "max_concurrent_requests_per_instance": {"key": "maxConcurrentRequestsPerInstance", "type": "int"}, + "max_concurrent_requests_per_instance": { + "key": "maxConcurrentRequestsPerInstance", + "type": "int", + }, "max_queue_wait": {"key": "maxQueueWait", "type": "duration"}, "request_timeout": {"key": "requestTimeout", "type": "duration"}, } @@ -17312,7 +18574,9 @@ def __init__(self, **kwargs): :paramtype request_timeout: ~datetime.timedelta """ super(OnlineRequestSettings, self).__init__(**kwargs) - self.max_concurrent_requests_per_instance = kwargs.get("max_concurrent_requests_per_instance", 1) + self.max_concurrent_requests_per_instance = kwargs.get( + "max_concurrent_requests_per_instance", 1 + ) self.max_queue_wait = kwargs.get("max_queue_wait", "PT0.5S") self.request_timeout = kwargs.get("request_timeout", "PT5S") @@ -17515,18 +18779,39 @@ class PackageRequest(msrest.serialization.Model): _validation = { "inferencing_server": {"required": True}, - "target_environment_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "target_environment_name": { + "required": True, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - "base_environment_source": {"key": "baseEnvironmentSource", "type": "BaseEnvironmentSource"}, - "environment_variables": {"key": "environmentVariables", "type": "{str}"}, - "inferencing_server": {"key": "inferencingServer", "type": "InferencingServer"}, + "base_environment_source": { + "key": "baseEnvironmentSource", + "type": "BaseEnvironmentSource", + }, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "inferencing_server": { + "key": "inferencingServer", + "type": "InferencingServer", + }, "inputs": {"key": "inputs", "type": "[ModelPackageInput]"}, - "model_configuration": {"key": "modelConfiguration", "type": "ModelConfiguration"}, + "model_configuration": { + "key": "modelConfiguration", + "type": "ModelConfiguration", + }, "tags": {"key": "tags", "type": "{str}"}, - "target_environment_name": {"key": "targetEnvironmentName", "type": "str"}, - "target_environment_version": {"key": "targetEnvironmentVersion", "type": "str"}, + "target_environment_name": { + "key": "targetEnvironmentName", + "type": "str", + }, + "target_environment_version": { + "key": "targetEnvironmentVersion", + "type": "str", + }, } def __init__(self, **kwargs): @@ -17551,14 +18836,18 @@ def __init__(self, **kwargs): :paramtype target_environment_version: str """ super(PackageRequest, self).__init__(**kwargs) - self.base_environment_source = kwargs.get("base_environment_source", None) + self.base_environment_source = kwargs.get( + "base_environment_source", None + ) self.environment_variables = kwargs.get("environment_variables", None) self.inferencing_server = kwargs["inferencing_server"] self.inputs = kwargs.get("inputs", None) self.model_configuration = kwargs.get("model_configuration", None) self.tags = kwargs.get("tags", None) self.target_environment_name = kwargs["target_environment_name"] - self.target_environment_version = kwargs.get("target_environment_version", None) + self.target_environment_version = kwargs.get( + "target_environment_version", None + ) class PackageResponse(PackageRequest): @@ -17599,7 +18888,10 @@ class PackageResponse(PackageRequest): _validation = { "inferencing_server": {"required": True}, - "target_environment_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "target_environment_name": { + "required": True, + "pattern": r"[a-zA-Z0-9_]", + }, "build_id": {"readonly": True}, "build_state": {"readonly": True}, "log_url": {"readonly": True}, @@ -17607,14 +18899,32 @@ class PackageResponse(PackageRequest): } _attribute_map = { - "base_environment_source": {"key": "baseEnvironmentSource", "type": "BaseEnvironmentSource"}, - "environment_variables": {"key": "environmentVariables", "type": "{str}"}, - "inferencing_server": {"key": "inferencingServer", "type": "InferencingServer"}, + "base_environment_source": { + "key": "baseEnvironmentSource", + "type": "BaseEnvironmentSource", + }, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "inferencing_server": { + "key": "inferencingServer", + "type": "InferencingServer", + }, "inputs": {"key": "inputs", "type": "[ModelPackageInput]"}, - "model_configuration": {"key": "modelConfiguration", "type": "ModelConfiguration"}, + "model_configuration": { + "key": "modelConfiguration", + "type": "ModelConfiguration", + }, "tags": {"key": "tags", "type": "{str}"}, - "target_environment_name": {"key": "targetEnvironmentName", "type": "str"}, - "target_environment_version": {"key": "targetEnvironmentVersion", "type": "str"}, + "target_environment_name": { + "key": "targetEnvironmentName", + "type": "str", + }, + "target_environment_version": { + "key": "targetEnvironmentVersion", + "type": "str", + }, "build_id": {"key": "buildId", "type": "str"}, "build_state": {"key": "buildState", "type": "str"}, "log_url": {"key": "logUrl", "type": "str"}, @@ -17695,7 +19005,9 @@ def __init__(self, **kwargs): self.description = kwargs.get("description", None) -class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties(msrest.serialization.Model): +class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties( + msrest.serialization.Model +): """Strictly used in update requests. :ivar properties: Additional attributes of the entity. @@ -17716,7 +19028,10 @@ def __init__(self, **kwargs): :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] """ - super(PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, self).__init__(**kwargs) + super( + PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, + self, + ).__init__(**kwargs) self.properties = kwargs.get("properties", None) self.tags = kwargs.get("tags", None) @@ -17737,7 +19052,10 @@ class PartialManagedServiceIdentity(msrest.serialization.Model): _attribute_map = { "type": {"key": "type", "type": "str"}, - "user_assigned_identities": {"key": "userAssignedIdentities", "type": "{object}"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{object}", + }, } def __init__(self, **kwargs): @@ -17754,7 +19072,9 @@ def __init__(self, **kwargs): """ super(PartialManagedServiceIdentity, self).__init__(**kwargs) self.type = kwargs.get("type", None) - self.user_assigned_identities = kwargs.get("user_assigned_identities", None) + self.user_assigned_identities = kwargs.get( + "user_assigned_identities", None + ) class PartialMinimalTrackedResource(msrest.serialization.Model): @@ -17788,7 +19108,10 @@ class PartialMinimalTrackedResourceWithIdentity(PartialMinimalTrackedResource): _attribute_map = { "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "PartialManagedServiceIdentity"}, + "identity": { + "key": "identity", + "type": "PartialManagedServiceIdentity", + }, } def __init__(self, **kwargs): @@ -17798,7 +19121,9 @@ def __init__(self, **kwargs): :keyword identity: Managed service identity (system assigned and/or user assigned identities). :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity """ - super(PartialMinimalTrackedResourceWithIdentity, self).__init__(**kwargs) + super(PartialMinimalTrackedResourceWithIdentity, self).__init__( + **kwargs + ) self.identity = kwargs.get("identity", None) @@ -17844,7 +19169,10 @@ class PartialRegistryPartialTrackedResource(msrest.serialization.Model): """ _attribute_map = { - "identity": {"key": "identity", "type": "PartialManagedServiceIdentity"}, + "identity": { + "key": "identity", + "type": "PartialManagedServiceIdentity", + }, "kind": {"key": "kind", "type": "str"}, "properties": {"key": "properties", "type": "object"}, "sku": {"key": "sku", "type": "PartialSku"}, @@ -17955,7 +19283,9 @@ def __init__(self, **kwargs): self.value = None -class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class PATAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """PATAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -17989,7 +19319,10 @@ class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): "target": {"key": "target", "type": "str"}, "value": {"key": "value", "type": "str"}, "value_format": {"key": "valueFormat", "type": "str"}, - "credentials": {"key": "credentials", "type": "WorkspaceConnectionPersonalAccessToken"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionPersonalAccessToken", + }, } def __init__(self, **kwargs): @@ -18009,7 +19342,9 @@ def __init__(self, **kwargs): :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken """ - super(PATAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) + super(PATAuthTypeWorkspaceConnectionProperties, self).__init__( + **kwargs + ) self.auth_type = "PAT" # type: str self.credentials = kwargs.get("credentials", None) @@ -18102,7 +19437,10 @@ class PipelineJob(JobBaseProperties): "identity": {"key": "identity", "type": "IdentityConfiguration"}, "is_archived": {"key": "isArchived", "type": "bool"}, "job_type": {"key": "jobType", "type": "str"}, - "notification_setting": {"key": "notificationSetting", "type": "NotificationSetting"}, + "notification_setting": { + "key": "notificationSetting", + "type": "NotificationSetting", + }, "services": {"key": "services", "type": "{JobService}"}, "status": {"key": "status", "type": "str"}, "inputs": {"key": "inputs", "type": "{JobInput}"}, @@ -18241,12 +19579,18 @@ class PrivateEndpointConnection(Resource): "location": {"key": "location", "type": "str"}, "tags": {"key": "tags", "type": "{str}"}, "sku": {"key": "sku", "type": "Sku"}, - "private_endpoint": {"key": "properties.privateEndpoint", "type": "PrivateEndpoint"}, + "private_endpoint": { + "key": "properties.privateEndpoint", + "type": "PrivateEndpoint", + }, "private_link_service_connection_state": { "key": "properties.privateLinkServiceConnectionState", "type": "PrivateLinkServiceConnectionState", }, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "provisioning_state": { + "key": "properties.provisioningState", + "type": "str", + }, } def __init__(self, **kwargs): @@ -18272,7 +19616,9 @@ def __init__(self, **kwargs): self.tags = kwargs.get("tags", None) self.sku = kwargs.get("sku", None) self.private_endpoint = kwargs.get("private_endpoint", None) - self.private_link_service_connection_state = kwargs.get("private_link_service_connection_state", None) + self.private_link_service_connection_state = kwargs.get( + "private_link_service_connection_state", None + ) self.provisioning_state = None @@ -18347,8 +19693,14 @@ class PrivateLinkResource(Resource): "tags": {"key": "tags", "type": "{str}"}, "sku": {"key": "sku", "type": "Sku"}, "group_id": {"key": "properties.groupId", "type": "str"}, - "required_members": {"key": "properties.requiredMembers", "type": "[str]"}, - "required_zone_names": {"key": "properties.requiredZoneNames", "type": "[str]"}, + "required_members": { + "key": "properties.requiredMembers", + "type": "[str]", + }, + "required_zone_names": { + "key": "properties.requiredZoneNames", + "type": "[str]", + }, } def __init__(self, **kwargs): @@ -18503,10 +19855,22 @@ class ProgressMetrics(msrest.serialization.Model): } _attribute_map = { - "completed_datapoint_count": {"key": "completedDatapointCount", "type": "long"}, - "incremental_data_last_refresh_date_time": {"key": "incrementalDataLastRefreshDateTime", "type": "iso-8601"}, - "skipped_datapoint_count": {"key": "skippedDatapointCount", "type": "long"}, - "total_datapoint_count": {"key": "totalDatapointCount", "type": "long"}, + "completed_datapoint_count": { + "key": "completedDatapointCount", + "type": "long", + }, + "incremental_data_last_refresh_date_time": { + "key": "incrementalDataLastRefreshDateTime", + "type": "iso-8601", + }, + "skipped_datapoint_count": { + "key": "skippedDatapointCount", + "type": "long", + }, + "total_datapoint_count": { + "key": "totalDatapointCount", + "type": "long", + }, } def __init__(self, **kwargs): @@ -18536,7 +19900,10 @@ class PyTorch(DistributionConfiguration): _attribute_map = { "distribution_type": {"key": "distributionType", "type": "str"}, - "process_count_per_instance": {"key": "processCountPerInstance", "type": "int"}, + "process_count_per_instance": { + "key": "processCountPerInstance", + "type": "int", + }, } def __init__(self, **kwargs): @@ -18546,7 +19913,9 @@ def __init__(self, **kwargs): """ super(PyTorch, self).__init__(**kwargs) self.distribution_type = "PyTorch" # type: str - self.process_count_per_instance = kwargs.get("process_count_per_instance", None) + self.process_count_per_instance = kwargs.get( + "process_count_per_instance", None + ) class QueueSettings(msrest.serialization.Model): @@ -18666,7 +20035,10 @@ class RandomSamplingAlgorithm(SamplingAlgorithm): } _attribute_map = { - "sampling_algorithm_type": {"key": "samplingAlgorithmType", "type": "str"}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, "logbase": {"key": "logbase", "type": "str"}, "rule": {"key": "rule", "type": "str"}, "seed": {"key": "seed", "type": "int"}, @@ -18992,12 +20364,24 @@ class RegistryProperties(ResourceBase): "tags": {"key": "tags", "type": "{str}"}, "public_network_access": {"key": "publicNetworkAccess", "type": "str"}, "discovery_url": {"key": "discoveryUrl", "type": "str"}, - "intellectual_property_publisher": {"key": "intellectualPropertyPublisher", "type": "str"}, - "managed_resource_group": {"key": "managedResourceGroup", "type": "ArmResourceId"}, + "intellectual_property_publisher": { + "key": "intellectualPropertyPublisher", + "type": "str", + }, + "managed_resource_group": { + "key": "managedResourceGroup", + "type": "ArmResourceId", + }, "ml_flow_registry_uri": {"key": "mlFlowRegistryUri", "type": "str"}, "private_link_count": {"key": "privateLinkCount", "type": "int"}, - "region_details": {"key": "regionDetails", "type": "[RegistryRegionArmDetails]"}, - "managed_resource_group_tags": {"key": "managedResourceGroupTags", "type": "{str}"}, + "region_details": { + "key": "regionDetails", + "type": "[RegistryRegionArmDetails]", + }, + "managed_resource_group_tags": { + "key": "managedResourceGroupTags", + "type": "{str}", + }, } def __init__(self, **kwargs): @@ -19030,12 +20414,18 @@ def __init__(self, **kwargs): super(RegistryProperties, self).__init__(**kwargs) self.public_network_access = kwargs.get("public_network_access", None) self.discovery_url = kwargs.get("discovery_url", None) - self.intellectual_property_publisher = kwargs.get("intellectual_property_publisher", None) - self.managed_resource_group = kwargs.get("managed_resource_group", None) + self.intellectual_property_publisher = kwargs.get( + "intellectual_property_publisher", None + ) + self.managed_resource_group = kwargs.get( + "managed_resource_group", None + ) self.ml_flow_registry_uri = kwargs.get("ml_flow_registry_uri", None) self.private_link_count = kwargs.get("private_link_count", None) self.region_details = kwargs.get("region_details", None) - self.managed_resource_group_tags = kwargs.get("managed_resource_group_tags", None) + self.managed_resource_group_tags = kwargs.get( + "managed_resource_group_tags", None + ) class RegistryRegionArmDetails(msrest.serialization.Model): @@ -19053,7 +20443,10 @@ class RegistryRegionArmDetails(msrest.serialization.Model): _attribute_map = { "acr_details": {"key": "acrDetails", "type": "[AcrDetails]"}, "location": {"key": "location", "type": "str"}, - "storage_account_details": {"key": "storageAccountDetails", "type": "[StorageAccountDetails]"}, + "storage_account_details": { + "key": "storageAccountDetails", + "type": "[StorageAccountDetails]", + }, } def __init__(self, **kwargs): @@ -19069,7 +20462,9 @@ def __init__(self, **kwargs): super(RegistryRegionArmDetails, self).__init__(**kwargs) self.acr_details = kwargs.get("acr_details", None) self.location = kwargs.get("location", None) - self.storage_account_details = kwargs.get("storage_account_details", None) + self.storage_account_details = kwargs.get( + "storage_account_details", None + ) class RegistryTrackedResourceArmPaginatedResult(msrest.serialization.Model): @@ -19095,7 +20490,9 @@ def __init__(self, **kwargs): :keyword value: An array of objects of type Registry. :paramtype value: list[~azure.mgmt.machinelearningservices.models.Registry] """ - super(RegistryTrackedResourceArmPaginatedResult, self).__init__(**kwargs) + super(RegistryTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = kwargs.get("next_link", None) self.value = kwargs.get("value", None) @@ -19169,16 +20566,40 @@ class Regression(AutoMLVertical, TableVertical): } _attribute_map = { - "cv_split_column_names": {"key": "cvSplitColumnNames", "type": "[str]"}, - "featurization_settings": {"key": "featurizationSettings", "type": "TableVerticalFeaturizationSettings"}, - "fixed_parameters": {"key": "fixedParameters", "type": "TableFixedParameters"}, - "limit_settings": {"key": "limitSettings", "type": "TableVerticalLimitSettings"}, - "n_cross_validations": {"key": "nCrossValidations", "type": "NCrossValidations"}, - "search_space": {"key": "searchSpace", "type": "[TableParameterSubspace]"}, - "sweep_settings": {"key": "sweepSettings", "type": "TableSweepSettings"}, + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "TableFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "search_space": { + "key": "searchSpace", + "type": "[TableParameterSubspace]", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "TableSweepSettings", + }, "test_data": {"key": "testData", "type": "MLTableJobInput"}, "test_data_size": {"key": "testDataSize", "type": "float"}, - "validation_data": {"key": "validationData", "type": "MLTableJobInput"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, "validation_data_size": {"key": "validationDataSize", "type": "float"}, "weight_column_name": {"key": "weightColumnName", "type": "str"}, "log_verbosity": {"key": "logVerbosity", "type": "str"}, @@ -19186,7 +20607,10 @@ class Regression(AutoMLVertical, TableVertical): "task_type": {"key": "taskType", "type": "str"}, "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, "primary_metric": {"key": "primaryMetric", "type": "str"}, - "training_settings": {"key": "trainingSettings", "type": "RegressionTrainingSettings"}, + "training_settings": { + "key": "trainingSettings", + "type": "RegressionTrainingSettings", + }, } def __init__(self, **kwargs): @@ -19248,7 +20672,9 @@ def __init__(self, **kwargs): """ super(Regression, self).__init__(**kwargs) self.cv_split_column_names = kwargs.get("cv_split_column_names", None) - self.featurization_settings = kwargs.get("featurization_settings", None) + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) self.fixed_parameters = kwargs.get("fixed_parameters", None) self.limit_settings = kwargs.get("limit_settings", None) self.n_cross_validations = kwargs.get("n_cross_validations", None) @@ -19305,15 +20731,36 @@ class RegressionTrainingSettings(TrainingSettings): _attribute_map = { "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, - "enable_model_explainability": {"key": "enableModelExplainability", "type": "bool"}, - "enable_onnx_compatible_models": {"key": "enableOnnxCompatibleModels", "type": "bool"}, - "enable_stack_ensemble": {"key": "enableStackEnsemble", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, - "ensemble_model_download_timeout": {"key": "ensembleModelDownloadTimeout", "type": "duration"}, - "stack_ensemble_settings": {"key": "stackEnsembleSettings", "type": "StackEnsembleSettings"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, "training_mode": {"key": "trainingMode", "type": "str"}, - "allowed_training_algorithms": {"key": "allowedTrainingAlgorithms", "type": "[str]"}, - "blocked_training_algorithms": {"key": "blockedTrainingAlgorithms", "type": "[str]"}, + "allowed_training_algorithms": { + "key": "allowedTrainingAlgorithms", + "type": "[str]", + }, + "blocked_training_algorithms": { + "key": "blockedTrainingAlgorithms", + "type": "[str]", + }, } def __init__(self, **kwargs): @@ -19351,8 +20798,12 @@ def __init__(self, **kwargs): ~azure.mgmt.machinelearningservices.models.RegressionModels] """ super(RegressionTrainingSettings, self).__init__(**kwargs) - self.allowed_training_algorithms = kwargs.get("allowed_training_algorithms", None) - self.blocked_training_algorithms = kwargs.get("blocked_training_algorithms", None) + self.allowed_training_algorithms = kwargs.get( + "allowed_training_algorithms", None + ) + self.blocked_training_algorithms = kwargs.get( + "blocked_training_algorithms", None + ) class ResourceId(msrest.serialization.Model): @@ -19439,7 +20890,10 @@ class ResourceQuota(msrest.serialization.Model): _attribute_map = { "id": {"key": "id", "type": "str"}, - "aml_workspace_location": {"key": "amlWorkspaceLocation", "type": "str"}, + "aml_workspace_location": { + "key": "amlWorkspaceLocation", + "type": "str", + }, "type": {"key": "type", "type": "str"}, "name": {"key": "name", "type": "ResourceName"}, "limit": {"key": "limit", "type": "long"}, @@ -19490,7 +20944,9 @@ def __init__(self, **kwargs): self.port = kwargs["port"] -class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class SASAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """SASAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -19524,7 +20980,10 @@ class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): "target": {"key": "target", "type": "str"}, "value": {"key": "value", "type": "str"}, "value_format": {"key": "valueFormat", "type": "str"}, - "credentials": {"key": "credentials", "type": "WorkspaceConnectionSharedAccessSignature"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionSharedAccessSignature", + }, } def __init__(self, **kwargs): @@ -19544,7 +21003,9 @@ def __init__(self, **kwargs): :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature """ - super(SASAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) + super(SASAuthTypeWorkspaceConnectionProperties, self).__init__( + **kwargs + ) self.auth_type = "SAS" # type: str self.credentials = kwargs.get("credentials", None) @@ -19635,7 +21096,10 @@ class ScaleSettings(msrest.serialization.Model): _attribute_map = { "max_node_count": {"key": "maxNodeCount", "type": "int"}, "min_node_count": {"key": "minNodeCount", "type": "int"}, - "node_idle_time_before_scale_down": {"key": "nodeIdleTimeBeforeScaleDown", "type": "duration"}, + "node_idle_time_before_scale_down": { + "key": "nodeIdleTimeBeforeScaleDown", + "type": "duration", + }, } def __init__(self, **kwargs): @@ -19651,7 +21115,9 @@ def __init__(self, **kwargs): super(ScaleSettings, self).__init__(**kwargs) self.max_node_count = kwargs["max_node_count"] self.min_node_count = kwargs.get("min_node_count", 0) - self.node_idle_time_before_scale_down = kwargs.get("node_idle_time_before_scale_down", None) + self.node_idle_time_before_scale_down = kwargs.get( + "node_idle_time_before_scale_down", None + ) class ScaleSettingsInformation(msrest.serialization.Model): @@ -19905,7 +21371,10 @@ class ScriptsToExecute(msrest.serialization.Model): _attribute_map = { "startup_script": {"key": "startupScript", "type": "ScriptReference"}, - "creation_script": {"key": "creationScript", "type": "ScriptReference"}, + "creation_script": { + "key": "creationScript", + "type": "ScriptReference", + }, } def __init__(self, **kwargs): @@ -19940,7 +21409,9 @@ def __init__(self, **kwargs): self.cosmos_db = kwargs.get("cosmos_db", None) -class ServicePrincipalAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class ServicePrincipalAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """ServicePrincipalAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -19974,7 +21445,10 @@ class ServicePrincipalAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionP "target": {"key": "target", "type": "str"}, "value": {"key": "value", "type": "str"}, "value_format": {"key": "valueFormat", "type": "str"}, - "credentials": {"key": "credentials", "type": "WorkspaceConnectionServicePrincipal"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionServicePrincipal", + }, } def __init__(self, **kwargs): @@ -19994,7 +21468,9 @@ def __init__(self, **kwargs): :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionServicePrincipal """ - super(ServicePrincipalAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) + super( + ServicePrincipalAuthTypeWorkspaceConnectionProperties, self + ).__init__(**kwargs) self.auth_type = "ServicePrincipal" # type: str self.credentials = kwargs.get("credentials", None) @@ -20032,7 +21508,10 @@ class ServicePrincipalDatastoreCredentials(DatastoreCredentials): "authority_url": {"key": "authorityUrl", "type": "str"}, "client_id": {"key": "clientId", "type": "str"}, "resource_url": {"key": "resourceUrl", "type": "str"}, - "secrets": {"key": "secrets", "type": "ServicePrincipalDatastoreSecrets"}, + "secrets": { + "key": "secrets", + "type": "ServicePrincipalDatastoreSecrets", + }, "tenant_id": {"key": "tenantId", "type": "str"}, } @@ -20131,7 +21610,10 @@ class SharedPrivateLinkResource(msrest.serialization.Model): _attribute_map = { "name": {"key": "name", "type": "str"}, - "private_link_resource_id": {"key": "properties.privateLinkResourceId", "type": "str"}, + "private_link_resource_id": { + "key": "properties.privateLinkResourceId", + "type": "str", + }, "group_id": {"key": "properties.groupId", "type": "str"}, "request_message": {"key": "properties.requestMessage", "type": "str"}, "status": {"key": "properties.status", "type": "str"}, @@ -20155,7 +21637,9 @@ def __init__(self, **kwargs): """ super(SharedPrivateLinkResource, self).__init__(**kwargs) self.name = kwargs.get("name", None) - self.private_link_resource_id = kwargs.get("private_link_resource_id", None) + self.private_link_resource_id = kwargs.get( + "private_link_resource_id", None + ) self.group_id = kwargs.get("group_id", None) self.request_message = kwargs.get("request_message", None) self.status = kwargs.get("status", None) @@ -20449,7 +21933,10 @@ class SparkJob(JobBaseProperties): "identity": {"key": "identity", "type": "IdentityConfiguration"}, "is_archived": {"key": "isArchived", "type": "bool"}, "job_type": {"key": "jobType", "type": "str"}, - "notification_setting": {"key": "notificationSetting", "type": "NotificationSetting"}, + "notification_setting": { + "key": "notificationSetting", + "type": "NotificationSetting", + }, "services": {"key": "services", "type": "{JobService}"}, "status": {"key": "status", "type": "str"}, "archives": {"key": "archives", "type": "[str]"}, @@ -20464,7 +21951,10 @@ class SparkJob(JobBaseProperties): "outputs": {"key": "outputs", "type": "{JobOutput}"}, "py_files": {"key": "pyFiles", "type": "[str]"}, "queue_settings": {"key": "queueSettings", "type": "QueueSettings"}, - "resources": {"key": "resources", "type": "SparkResourceConfiguration"}, + "resources": { + "key": "resources", + "type": "SparkResourceConfiguration", + }, } def __init__(self, **kwargs): @@ -20589,7 +22079,11 @@ class SparkJobPythonEntry(SparkJobEntry): _validation = { "spark_job_entry_type": {"required": True}, - "file": {"required": True, "min_length": 1, "pattern": r"[a-zA-Z0-9_]"}, + "file": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { @@ -20622,7 +22116,11 @@ class SparkJobScalaEntry(SparkJobEntry): _validation = { "spark_job_entry_type": {"required": True}, - "class_name": {"required": True, "min_length": 1, "pattern": r"[a-zA-Z0-9_]"}, + "class_name": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { @@ -20690,7 +22188,10 @@ class SslConfiguration(msrest.serialization.Model): "key": {"key": "key", "type": "str"}, "cname": {"key": "cname", "type": "str"}, "leaf_domain_label": {"key": "leafDomainLabel", "type": "str"}, - "overwrite_existing_domain": {"key": "overwriteExistingDomain", "type": "bool"}, + "overwrite_existing_domain": { + "key": "overwriteExistingDomain", + "type": "bool", + }, } def __init__(self, **kwargs): @@ -20715,7 +22216,9 @@ def __init__(self, **kwargs): self.key = kwargs.get("key", None) self.cname = kwargs.get("cname", None) self.leaf_domain_label = kwargs.get("leaf_domain_label", None) - self.overwrite_existing_domain = kwargs.get("overwrite_existing_domain", None) + self.overwrite_existing_domain = kwargs.get( + "overwrite_existing_domain", None + ) class StackEnsembleSettings(msrest.serialization.Model): @@ -20737,9 +22240,18 @@ class StackEnsembleSettings(msrest.serialization.Model): """ _attribute_map = { - "stack_meta_learner_k_wargs": {"key": "stackMetaLearnerKWargs", "type": "object"}, - "stack_meta_learner_train_percentage": {"key": "stackMetaLearnerTrainPercentage", "type": "float"}, - "stack_meta_learner_type": {"key": "stackMetaLearnerType", "type": "str"}, + "stack_meta_learner_k_wargs": { + "key": "stackMetaLearnerKWargs", + "type": "object", + }, + "stack_meta_learner_train_percentage": { + "key": "stackMetaLearnerTrainPercentage", + "type": "float", + }, + "stack_meta_learner_type": { + "key": "stackMetaLearnerType", + "type": "str", + }, } def __init__(self, **kwargs): @@ -20759,9 +22271,15 @@ def __init__(self, **kwargs): ~azure.mgmt.machinelearningservices.models.StackMetaLearnerType """ super(StackEnsembleSettings, self).__init__(**kwargs) - self.stack_meta_learner_k_wargs = kwargs.get("stack_meta_learner_k_wargs", None) - self.stack_meta_learner_train_percentage = kwargs.get("stack_meta_learner_train_percentage", 0.2) - self.stack_meta_learner_type = kwargs.get("stack_meta_learner_type", None) + self.stack_meta_learner_k_wargs = kwargs.get( + "stack_meta_learner_k_wargs", None + ) + self.stack_meta_learner_train_percentage = kwargs.get( + "stack_meta_learner_train_percentage", 0.2 + ) + self.stack_meta_learner_type = kwargs.get( + "stack_meta_learner_type", None + ) class StatusMessage(msrest.serialization.Model): @@ -20815,8 +22333,14 @@ class StorageAccountDetails(msrest.serialization.Model): """ _attribute_map = { - "system_created_storage_account": {"key": "systemCreatedStorageAccount", "type": "SystemCreatedStorageAccount"}, - "user_created_storage_account": {"key": "userCreatedStorageAccount", "type": "UserCreatedStorageAccount"}, + "system_created_storage_account": { + "key": "systemCreatedStorageAccount", + "type": "SystemCreatedStorageAccount", + }, + "user_created_storage_account": { + "key": "userCreatedStorageAccount", + "type": "UserCreatedStorageAccount", + }, } def __init__(self, **kwargs): @@ -20829,8 +22353,12 @@ def __init__(self, **kwargs): ~azure.mgmt.machinelearningservices.models.UserCreatedStorageAccount """ super(StorageAccountDetails, self).__init__(**kwargs) - self.system_created_storage_account = kwargs.get("system_created_storage_account", None) - self.user_created_storage_account = kwargs.get("user_created_storage_account", None) + self.system_created_storage_account = kwargs.get( + "system_created_storage_account", None + ) + self.user_created_storage_account = kwargs.get( + "user_created_storage_account", None + ) class SweepJob(JobBaseProperties): @@ -20915,16 +22443,25 @@ class SweepJob(JobBaseProperties): "identity": {"key": "identity", "type": "IdentityConfiguration"}, "is_archived": {"key": "isArchived", "type": "bool"}, "job_type": {"key": "jobType", "type": "str"}, - "notification_setting": {"key": "notificationSetting", "type": "NotificationSetting"}, + "notification_setting": { + "key": "notificationSetting", + "type": "NotificationSetting", + }, "services": {"key": "services", "type": "{JobService}"}, "status": {"key": "status", "type": "str"}, - "early_termination": {"key": "earlyTermination", "type": "EarlyTerminationPolicy"}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, "inputs": {"key": "inputs", "type": "{JobInput}"}, "limits": {"key": "limits", "type": "SweepJobLimits"}, "objective": {"key": "objective", "type": "Objective"}, "outputs": {"key": "outputs", "type": "{JobOutput}"}, "queue_settings": {"key": "queueSettings", "type": "QueueSettings"}, - "sampling_algorithm": {"key": "samplingAlgorithm", "type": "SamplingAlgorithm"}, + "sampling_algorithm": { + "key": "samplingAlgorithm", + "type": "SamplingAlgorithm", + }, "search_space": {"key": "searchSpace", "type": "object"}, "trial": {"key": "trial", "type": "TrialComponent"}, } @@ -21096,7 +22633,10 @@ class SynapseSpark(Compute): "created_on": {"key": "createdOn", "type": "iso-8601"}, "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, "resource_id": {"key": "resourceId", "type": "str"}, - "provisioning_errors": {"key": "provisioningErrors", "type": "[ErrorResponse]"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, "properties": {"key": "properties", "type": "SynapseSparkProperties"}, @@ -21147,8 +22687,14 @@ class SynapseSparkProperties(msrest.serialization.Model): """ _attribute_map = { - "auto_scale_properties": {"key": "autoScaleProperties", "type": "AutoScaleProperties"}, - "auto_pause_properties": {"key": "autoPauseProperties", "type": "AutoPauseProperties"}, + "auto_scale_properties": { + "key": "autoScaleProperties", + "type": "AutoScaleProperties", + }, + "auto_pause_properties": { + "key": "autoPauseProperties", + "type": "AutoPauseProperties", + }, "spark_version": {"key": "sparkVersion", "type": "str"}, "node_count": {"key": "nodeCount", "type": "int"}, "node_size": {"key": "nodeSize", "type": "str"}, @@ -21246,9 +22792,15 @@ class SystemCreatedStorageAccount(msrest.serialization.Model): _attribute_map = { "arm_resource_id": {"key": "armResourceId", "type": "ArmResourceId"}, - "storage_account_hns_enabled": {"key": "storageAccountHnsEnabled", "type": "bool"}, + "storage_account_hns_enabled": { + "key": "storageAccountHnsEnabled", + "type": "bool", + }, "storage_account_type": {"key": "storageAccountType", "type": "str"}, - "allow_blob_public_access": {"key": "allowBlobPublicAccess", "type": "bool"}, + "allow_blob_public_access": { + "key": "allowBlobPublicAccess", + "type": "bool", + }, } def __init__(self, **kwargs): @@ -21272,9 +22824,13 @@ def __init__(self, **kwargs): """ super(SystemCreatedStorageAccount, self).__init__(**kwargs) self.arm_resource_id = kwargs.get("arm_resource_id", None) - self.storage_account_hns_enabled = kwargs.get("storage_account_hns_enabled", None) + self.storage_account_hns_enabled = kwargs.get( + "storage_account_hns_enabled", None + ) self.storage_account_type = kwargs.get("storage_account_type", None) - self.allow_blob_public_access = kwargs.get("allow_blob_public_access", None) + self.allow_blob_public_access = kwargs.get( + "allow_blob_public_access", None + ) class SystemData(msrest.serialization.Model): @@ -21659,7 +23215,10 @@ class TableSweepSettings(msrest.serialization.Model): } _attribute_map = { - "early_termination": {"key": "earlyTermination", "type": "EarlyTerminationPolicy"}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, "sampling_algorithm": {"key": "samplingAlgorithm", "type": "str"}, } @@ -21705,11 +23264,23 @@ class TableVerticalFeaturizationSettings(FeaturizationSettings): _attribute_map = { "dataset_language": {"key": "datasetLanguage", "type": "str"}, - "blocked_transformers": {"key": "blockedTransformers", "type": "[str]"}, - "column_name_and_types": {"key": "columnNameAndTypes", "type": "{str}"}, - "enable_dnn_featurization": {"key": "enableDnnFeaturization", "type": "bool"}, + "blocked_transformers": { + "key": "blockedTransformers", + "type": "[str]", + }, + "column_name_and_types": { + "key": "columnNameAndTypes", + "type": "{str}", + }, + "enable_dnn_featurization": { + "key": "enableDnnFeaturization", + "type": "bool", + }, "mode": {"key": "mode", "type": "str"}, - "transformer_params": {"key": "transformerParams", "type": "{[ColumnTransformer]}"}, + "transformer_params": { + "key": "transformerParams", + "type": "{[ColumnTransformer]}", + }, } def __init__(self, **kwargs): @@ -21739,7 +23310,9 @@ def __init__(self, **kwargs): super(TableVerticalFeaturizationSettings, self).__init__(**kwargs) self.blocked_transformers = kwargs.get("blocked_transformers", None) self.column_name_and_types = kwargs.get("column_name_and_types", None) - self.enable_dnn_featurization = kwargs.get("enable_dnn_featurization", False) + self.enable_dnn_featurization = kwargs.get( + "enable_dnn_featurization", False + ) self.mode = kwargs.get("mode", None) self.transformer_params = kwargs.get("transformer_params", None) @@ -21771,13 +23344,19 @@ class TableVerticalLimitSettings(msrest.serialization.Model): """ _attribute_map = { - "enable_early_termination": {"key": "enableEarlyTermination", "type": "bool"}, + "enable_early_termination": { + "key": "enableEarlyTermination", + "type": "bool", + }, "exit_score": {"key": "exitScore", "type": "float"}, "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, "max_cores_per_trial": {"key": "maxCoresPerTrial", "type": "int"}, "max_nodes": {"key": "maxNodes", "type": "int"}, "max_trials": {"key": "maxTrials", "type": "int"}, - "sweep_concurrent_trials": {"key": "sweepConcurrentTrials", "type": "int"}, + "sweep_concurrent_trials": { + "key": "sweepConcurrentTrials", + "type": "int", + }, "sweep_trials": {"key": "sweepTrials", "type": "int"}, "timeout": {"key": "timeout", "type": "duration"}, "trial_timeout": {"key": "trialTimeout", "type": "duration"}, @@ -21809,7 +23388,9 @@ def __init__(self, **kwargs): :paramtype trial_timeout: ~datetime.timedelta """ super(TableVerticalLimitSettings, self).__init__(**kwargs) - self.enable_early_termination = kwargs.get("enable_early_termination", True) + self.enable_early_termination = kwargs.get( + "enable_early_termination", True + ) self.exit_score = kwargs.get("exit_score", None) self.max_concurrent_trials = kwargs.get("max_concurrent_trials", 1) self.max_cores_per_trial = kwargs.get("max_cores_per_trial", -1) @@ -21850,7 +23431,10 @@ class TargetUtilizationScaleSettings(OnlineScaleSettings): "max_instances": {"key": "maxInstances", "type": "int"}, "min_instances": {"key": "minInstances", "type": "int"}, "polling_interval": {"key": "pollingInterval", "type": "duration"}, - "target_utilization_percentage": {"key": "targetUtilizationPercentage", "type": "int"}, + "target_utilization_percentage": { + "key": "targetUtilizationPercentage", + "type": "int", + }, } def __init__(self, **kwargs): @@ -21871,7 +23455,9 @@ def __init__(self, **kwargs): self.max_instances = kwargs.get("max_instances", 1) self.min_instances = kwargs.get("min_instances", 1) self.polling_interval = kwargs.get("polling_interval", "PT1S") - self.target_utilization_percentage = kwargs.get("target_utilization_percentage", 70) + self.target_utilization_percentage = kwargs.get( + "target_utilization_percentage", 70 + ) class TensorFlow(DistributionConfiguration): @@ -21894,7 +23480,10 @@ class TensorFlow(DistributionConfiguration): _attribute_map = { "distribution_type": {"key": "distributionType", "type": "str"}, - "parameter_server_count": {"key": "parameterServerCount", "type": "int"}, + "parameter_server_count": { + "key": "parameterServerCount", + "type": "int", + }, "worker_count": {"key": "workerCount", "type": "int"}, } @@ -21958,12 +23547,27 @@ class TextClassification(AutoMLVertical, NlpVertical): } _attribute_map = { - "featurization_settings": {"key": "featurizationSettings", "type": "NlpVerticalFeaturizationSettings"}, - "fixed_parameters": {"key": "fixedParameters", "type": "NlpFixedParameters"}, - "limit_settings": {"key": "limitSettings", "type": "NlpVerticalLimitSettings"}, - "search_space": {"key": "searchSpace", "type": "[NlpParameterSubspace]"}, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "NlpFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "search_space": { + "key": "searchSpace", + "type": "[NlpParameterSubspace]", + }, "sweep_settings": {"key": "sweepSettings", "type": "NlpSweepSettings"}, - "validation_data": {"key": "validationData", "type": "MLTableJobInput"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, "log_verbosity": {"key": "logVerbosity", "type": "str"}, "target_column_name": {"key": "targetColumnName", "type": "str"}, "task_type": {"key": "taskType", "type": "str"}, @@ -22003,7 +23607,9 @@ def __init__(self, **kwargs): ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ super(TextClassification, self).__init__(**kwargs) - self.featurization_settings = kwargs.get("featurization_settings", None) + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) self.fixed_parameters = kwargs.get("fixed_parameters", None) self.limit_settings = kwargs.get("limit_settings", None) self.search_space = kwargs.get("search_space", None) @@ -22067,12 +23673,27 @@ class TextClassificationMultilabel(AutoMLVertical, NlpVertical): } _attribute_map = { - "featurization_settings": {"key": "featurizationSettings", "type": "NlpVerticalFeaturizationSettings"}, - "fixed_parameters": {"key": "fixedParameters", "type": "NlpFixedParameters"}, - "limit_settings": {"key": "limitSettings", "type": "NlpVerticalLimitSettings"}, - "search_space": {"key": "searchSpace", "type": "[NlpParameterSubspace]"}, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "NlpFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "search_space": { + "key": "searchSpace", + "type": "[NlpParameterSubspace]", + }, "sweep_settings": {"key": "sweepSettings", "type": "NlpSweepSettings"}, - "validation_data": {"key": "validationData", "type": "MLTableJobInput"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, "log_verbosity": {"key": "logVerbosity", "type": "str"}, "target_column_name": {"key": "targetColumnName", "type": "str"}, "task_type": {"key": "taskType", "type": "str"}, @@ -22107,7 +23728,9 @@ def __init__(self, **kwargs): :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ super(TextClassificationMultilabel, self).__init__(**kwargs) - self.featurization_settings = kwargs.get("featurization_settings", None) + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) self.fixed_parameters = kwargs.get("fixed_parameters", None) self.limit_settings = kwargs.get("limit_settings", None) self.search_space = kwargs.get("search_space", None) @@ -22172,12 +23795,27 @@ class TextNer(AutoMLVertical, NlpVertical): } _attribute_map = { - "featurization_settings": {"key": "featurizationSettings", "type": "NlpVerticalFeaturizationSettings"}, - "fixed_parameters": {"key": "fixedParameters", "type": "NlpFixedParameters"}, - "limit_settings": {"key": "limitSettings", "type": "NlpVerticalLimitSettings"}, - "search_space": {"key": "searchSpace", "type": "[NlpParameterSubspace]"}, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "NlpFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "search_space": { + "key": "searchSpace", + "type": "[NlpParameterSubspace]", + }, "sweep_settings": {"key": "sweepSettings", "type": "NlpSweepSettings"}, - "validation_data": {"key": "validationData", "type": "MLTableJobInput"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, "log_verbosity": {"key": "logVerbosity", "type": "str"}, "target_column_name": {"key": "targetColumnName", "type": "str"}, "task_type": {"key": "taskType", "type": "str"}, @@ -22212,7 +23850,9 @@ def __init__(self, **kwargs): :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ super(TextNer, self).__init__(**kwargs) - self.featurization_settings = kwargs.get("featurization_settings", None) + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) self.fixed_parameters = kwargs.get("fixed_parameters", None) self.limit_settings = kwargs.get("limit_settings", None) self.search_space = kwargs.get("search_space", None) @@ -22268,16 +23908,26 @@ class TrialComponent(msrest.serialization.Model): """ _validation = { - "command": {"required": True, "min_length": 1, "pattern": r"[a-zA-Z0-9_]"}, + "command": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, "environment_id": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { "code_id": {"key": "codeId", "type": "str"}, "command": {"key": "command", "type": "str"}, - "distribution": {"key": "distribution", "type": "DistributionConfiguration"}, + "distribution": { + "key": "distribution", + "type": "DistributionConfiguration", + }, "environment_id": {"key": "environmentId", "type": "str"}, - "environment_variables": {"key": "environmentVariables", "type": "{str}"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, "resources": {"key": "resources", "type": "JobResourceConfiguration"}, } @@ -22327,7 +23977,10 @@ class TritonInferencingServer(InferencingServer): _attribute_map = { "server_type": {"key": "serverType", "type": "str"}, - "inference_configuration": {"key": "inferenceConfiguration", "type": "OnlineInferenceConfiguration"}, + "inference_configuration": { + "key": "inferenceConfiguration", + "type": "OnlineInferenceConfiguration", + }, } def __init__(self, **kwargs): @@ -22338,7 +23991,9 @@ def __init__(self, **kwargs): """ super(TritonInferencingServer, self).__init__(**kwargs) self.server_type = "Triton" # type: str - self.inference_configuration = kwargs.get("inference_configuration", None) + self.inference_configuration = kwargs.get( + "inference_configuration", None + ) class TritonModelJobInput(JobInput, AssetJobInput): @@ -22471,7 +24126,10 @@ class TruncationSelectionPolicy(EarlyTerminationPolicy): "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, "policy_type": {"key": "policyType", "type": "str"}, - "truncation_percentage": {"key": "truncationPercentage", "type": "int"}, + "truncation_percentage": { + "key": "truncationPercentage", + "type": "int", + }, } def __init__(self, **kwargs): @@ -22928,7 +24586,10 @@ class Usage(msrest.serialization.Model): _attribute_map = { "id": {"key": "id", "type": "str"}, - "aml_workspace_location": {"key": "amlWorkspaceLocation", "type": "str"}, + "aml_workspace_location": { + "key": "amlWorkspaceLocation", + "type": "str", + }, "type": {"key": "type", "type": "str"}, "unit": {"key": "unit", "type": "str"}, "current_value": {"key": "currentValue", "type": "long"}, @@ -22996,7 +24657,10 @@ class UserAccountCredentials(msrest.serialization.Model): _attribute_map = { "admin_user_name": {"key": "adminUserName", "type": "str"}, - "admin_user_ssh_public_key": {"key": "adminUserSshPublicKey", "type": "str"}, + "admin_user_ssh_public_key": { + "key": "adminUserSshPublicKey", + "type": "str", + }, "admin_user_password": {"key": "adminUserPassword", "type": "str"}, } @@ -23012,7 +24676,9 @@ def __init__(self, **kwargs): """ super(UserAccountCredentials, self).__init__(**kwargs) self.admin_user_name = kwargs["admin_user_name"] - self.admin_user_ssh_public_key = kwargs.get("admin_user_ssh_public_key", None) + self.admin_user_ssh_public_key = kwargs.get( + "admin_user_ssh_public_key", None + ) self.admin_user_password = kwargs.get("admin_user_password", None) @@ -23109,7 +24775,9 @@ def __init__(self, **kwargs): self.identity_type = "UserIdentity" # type: str -class UsernamePasswordAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class UsernamePasswordAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """UsernamePasswordAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -23143,7 +24811,10 @@ class UsernamePasswordAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionP "target": {"key": "target", "type": "str"}, "value": {"key": "value", "type": "str"}, "value_format": {"key": "valueFormat", "type": "str"}, - "credentials": {"key": "credentials", "type": "WorkspaceConnectionUsernamePassword"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionUsernamePassword", + }, } def __init__(self, **kwargs): @@ -23163,7 +24834,9 @@ def __init__(self, **kwargs): :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword """ - super(UsernamePasswordAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) + super( + UsernamePasswordAuthTypeWorkspaceConnectionProperties, self + ).__init__(**kwargs) self.auth_type = "UsernamePassword" # type: str self.credentials = kwargs.get("credentials", None) @@ -23176,7 +24849,10 @@ class VirtualMachineSchema(msrest.serialization.Model): """ _attribute_map = { - "properties": {"key": "properties", "type": "VirtualMachineSchemaProperties"}, + "properties": { + "key": "properties", + "type": "VirtualMachineSchemaProperties", + }, } def __init__(self, **kwargs): @@ -23237,7 +24913,10 @@ class VirtualMachine(Compute, VirtualMachineSchema): } _attribute_map = { - "properties": {"key": "properties", "type": "VirtualMachineSchemaProperties"}, + "properties": { + "key": "properties", + "type": "VirtualMachineSchemaProperties", + }, "compute_type": {"key": "computeType", "type": "str"}, "compute_location": {"key": "computeLocation", "type": "str"}, "provisioning_state": {"key": "provisioningState", "type": "str"}, @@ -23245,7 +24924,10 @@ class VirtualMachine(Compute, VirtualMachineSchema): "created_on": {"key": "createdOn", "type": "iso-8601"}, "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, "resource_id": {"key": "resourceId", "type": "str"}, - "provisioning_errors": {"key": "provisioningErrors", "type": "[ErrorResponse]"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } @@ -23329,8 +25011,14 @@ class VirtualMachineSchemaProperties(msrest.serialization.Model): "ssh_port": {"key": "sshPort", "type": "int"}, "notebook_server_port": {"key": "notebookServerPort", "type": "int"}, "address": {"key": "address", "type": "str"}, - "administrator_account": {"key": "administratorAccount", "type": "VirtualMachineSshCredentials"}, - "is_notebook_instance_compute": {"key": "isNotebookInstanceCompute", "type": "bool"}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, + "is_notebook_instance_compute": { + "key": "isNotebookInstanceCompute", + "type": "bool", + }, } def __init__(self, **kwargs): @@ -23356,7 +25044,9 @@ def __init__(self, **kwargs): self.notebook_server_port = kwargs.get("notebook_server_port", None) self.address = kwargs.get("address", None) self.administrator_account = kwargs.get("administrator_account", None) - self.is_notebook_instance_compute = kwargs.get("is_notebook_instance_compute", None) + self.is_notebook_instance_compute = kwargs.get( + "is_notebook_instance_compute", None + ) class VirtualMachineSecretsSchema(msrest.serialization.Model): @@ -23368,7 +25058,10 @@ class VirtualMachineSecretsSchema(msrest.serialization.Model): """ _attribute_map = { - "administrator_account": {"key": "administratorAccount", "type": "VirtualMachineSshCredentials"}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, } def __init__(self, **kwargs): @@ -23400,7 +25093,10 @@ class VirtualMachineSecrets(ComputeSecrets, VirtualMachineSecretsSchema): } _attribute_map = { - "administrator_account": {"key": "administratorAccount", "type": "VirtualMachineSshCredentials"}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, "compute_type": {"key": "computeType", "type": "str"}, } @@ -23464,12 +25160,21 @@ class VirtualMachineSize(msrest.serialization.Model): "v_cp_us": {"key": "vCPUs", "type": "int"}, "gpus": {"key": "gpus", "type": "int"}, "os_vhd_size_mb": {"key": "osVhdSizeMB", "type": "int"}, - "max_resource_volume_mb": {"key": "maxResourceVolumeMB", "type": "int"}, + "max_resource_volume_mb": { + "key": "maxResourceVolumeMB", + "type": "int", + }, "memory_gb": {"key": "memoryGB", "type": "float"}, "low_priority_capable": {"key": "lowPriorityCapable", "type": "bool"}, "premium_io": {"key": "premiumIO", "type": "bool"}, - "estimated_vm_prices": {"key": "estimatedVMPrices", "type": "EstimatedVMPrices"}, - "supported_compute_types": {"key": "supportedComputeTypes", "type": "[str]"}, + "estimated_vm_prices": { + "key": "estimatedVMPrices", + "type": "EstimatedVMPrices", + }, + "supported_compute_types": { + "key": "supportedComputeTypes", + "type": "[str]", + }, } def __init__(self, **kwargs): @@ -23491,7 +25196,9 @@ def __init__(self, **kwargs): self.low_priority_capable = None self.premium_io = None self.estimated_vm_prices = kwargs.get("estimated_vm_prices", None) - self.supported_compute_types = kwargs.get("supported_compute_types", None) + self.supported_compute_types = kwargs.get( + "supported_compute_types", None + ) class VirtualMachineSizeListResult(msrest.serialization.Model): @@ -23772,18 +25479,45 @@ class Workspace(Resource): "description": {"key": "properties.description", "type": "str"}, "friendly_name": {"key": "properties.friendlyName", "type": "str"}, "key_vault": {"key": "properties.keyVault", "type": "str"}, - "application_insights": {"key": "properties.applicationInsights", "type": "str"}, - "container_registry": {"key": "properties.containerRegistry", "type": "str"}, + "application_insights": { + "key": "properties.applicationInsights", + "type": "str", + }, + "container_registry": { + "key": "properties.containerRegistry", + "type": "str", + }, "storage_account": {"key": "properties.storageAccount", "type": "str"}, "discovery_url": {"key": "properties.discoveryUrl", "type": "str"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "encryption": {"key": "properties.encryption", "type": "EncryptionProperty"}, + "provisioning_state": { + "key": "properties.provisioningState", + "type": "str", + }, + "encryption": { + "key": "properties.encryption", + "type": "EncryptionProperty", + }, "hbi_workspace": {"key": "properties.hbiWorkspace", "type": "bool"}, - "service_provisioned_resource_group": {"key": "properties.serviceProvisionedResourceGroup", "type": "str"}, - "private_link_count": {"key": "properties.privateLinkCount", "type": "int"}, - "image_build_compute": {"key": "properties.imageBuildCompute", "type": "str"}, - "allow_public_access_when_behind_vnet": {"key": "properties.allowPublicAccessWhenBehindVnet", "type": "bool"}, - "public_network_access": {"key": "properties.publicNetworkAccess", "type": "str"}, + "service_provisioned_resource_group": { + "key": "properties.serviceProvisionedResourceGroup", + "type": "str", + }, + "private_link_count": { + "key": "properties.privateLinkCount", + "type": "int", + }, + "image_build_compute": { + "key": "properties.imageBuildCompute", + "type": "str", + }, + "allow_public_access_when_behind_vnet": { + "key": "properties.allowPublicAccessWhenBehindVnet", + "type": "bool", + }, + "public_network_access": { + "key": "properties.publicNetworkAccess", + "type": "str", + }, "private_endpoint_connections": { "key": "properties.privateEndpointConnections", "type": "[PrivateEndpointConnection]", @@ -23792,19 +25526,37 @@ class Workspace(Resource): "key": "properties.sharedPrivateLinkResources", "type": "[SharedPrivateLinkResource]", }, - "notebook_info": {"key": "properties.notebookInfo", "type": "NotebookResourceInfo"}, + "notebook_info": { + "key": "properties.notebookInfo", + "type": "NotebookResourceInfo", + }, "service_managed_resources_settings": { "key": "properties.serviceManagedResourcesSettings", "type": "ServiceManagedResourcesSettings", }, - "primary_user_assigned_identity": {"key": "properties.primaryUserAssignedIdentity", "type": "str"}, + "primary_user_assigned_identity": { + "key": "properties.primaryUserAssignedIdentity", + "type": "str", + }, "tenant_id": {"key": "properties.tenantId", "type": "str"}, - "storage_hns_enabled": {"key": "properties.storageHnsEnabled", "type": "bool"}, - "ml_flow_tracking_uri": {"key": "properties.mlFlowTrackingUri", "type": "str"}, + "storage_hns_enabled": { + "key": "properties.storageHnsEnabled", + "type": "bool", + }, + "ml_flow_tracking_uri": { + "key": "properties.mlFlowTrackingUri", + "type": "str", + }, "v1_legacy_mode": {"key": "properties.v1LegacyMode", "type": "bool"}, "soft_deleted_at": {"key": "properties.softDeletedAt", "type": "str"}, - "scheduled_purge_date": {"key": "properties.scheduledPurgeDate", "type": "str"}, - "system_datastores_auth_mode": {"key": "properties.systemDatastoresAuthMode", "type": "str"}, + "scheduled_purge_date": { + "key": "properties.scheduledPurgeDate", + "type": "str", + }, + "system_datastores_auth_mode": { + "key": "properties.systemDatastoresAuthMode", + "type": "str", + }, } def __init__(self, **kwargs): @@ -23885,20 +25637,30 @@ def __init__(self, **kwargs): self.service_provisioned_resource_group = None self.private_link_count = None self.image_build_compute = kwargs.get("image_build_compute", None) - self.allow_public_access_when_behind_vnet = kwargs.get("allow_public_access_when_behind_vnet", False) + self.allow_public_access_when_behind_vnet = kwargs.get( + "allow_public_access_when_behind_vnet", False + ) self.public_network_access = kwargs.get("public_network_access", None) self.private_endpoint_connections = None - self.shared_private_link_resources = kwargs.get("shared_private_link_resources", None) + self.shared_private_link_resources = kwargs.get( + "shared_private_link_resources", None + ) self.notebook_info = None - self.service_managed_resources_settings = kwargs.get("service_managed_resources_settings", None) - self.primary_user_assigned_identity = kwargs.get("primary_user_assigned_identity", None) + self.service_managed_resources_settings = kwargs.get( + "service_managed_resources_settings", None + ) + self.primary_user_assigned_identity = kwargs.get( + "primary_user_assigned_identity", None + ) self.tenant_id = None self.storage_hns_enabled = None self.ml_flow_tracking_uri = None self.v1_legacy_mode = kwargs.get("v1_legacy_mode", False) self.soft_deleted_at = None self.scheduled_purge_date = None - self.system_datastores_auth_mode = kwargs.get("system_datastores_auth_mode", None) + self.system_datastores_auth_mode = kwargs.get( + "system_datastores_auth_mode", None + ) class WorkspaceConnectionAccessKey(msrest.serialization.Model): @@ -24008,7 +25770,10 @@ class WorkspaceConnectionPropertiesV2BasicResource(Resource): "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "WorkspaceConnectionPropertiesV2"}, + "properties": { + "key": "properties", + "type": "WorkspaceConnectionPropertiesV2", + }, } def __init__(self, **kwargs): @@ -24017,11 +25782,15 @@ def __init__(self, **kwargs): :paramtype properties: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 """ - super(WorkspaceConnectionPropertiesV2BasicResource, self).__init__(**kwargs) + super(WorkspaceConnectionPropertiesV2BasicResource, self).__init__( + **kwargs + ) self.properties = kwargs["properties"] -class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(msrest.serialization.Model): +class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult( + msrest.serialization.Model +): """WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult. Variables are only populated by the server, and will be ignored when sending a request. @@ -24038,7 +25807,10 @@ class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(msrest.seri } _attribute_map = { - "value": {"key": "value", "type": "[WorkspaceConnectionPropertiesV2BasicResource]"}, + "value": { + "key": "value", + "type": "[WorkspaceConnectionPropertiesV2BasicResource]", + }, "next_link": {"key": "nextLink", "type": "str"}, } @@ -24048,7 +25820,10 @@ def __init__(self, **kwargs): :paramtype value: list[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource] """ - super(WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, self).__init__(**kwargs) + super( + WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, + self, + ).__init__(**kwargs) self.value = kwargs.get("value", None) self.next_link = None @@ -24101,7 +25876,9 @@ def __init__(self, **kwargs): :keyword sas: :paramtype sas: str """ - super(WorkspaceConnectionSharedAccessSignature, self).__init__(**kwargs) + super(WorkspaceConnectionSharedAccessSignature, self).__init__( + **kwargs + ) self.sas = kwargs.get("sas", None) @@ -24200,16 +25977,34 @@ class WorkspaceUpdateParameters(msrest.serialization.Model): "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, "description": {"key": "properties.description", "type": "str"}, "friendly_name": {"key": "properties.friendlyName", "type": "str"}, - "image_build_compute": {"key": "properties.imageBuildCompute", "type": "str"}, + "image_build_compute": { + "key": "properties.imageBuildCompute", + "type": "str", + }, "service_managed_resources_settings": { "key": "properties.serviceManagedResourcesSettings", "type": "ServiceManagedResourcesSettings", }, - "primary_user_assigned_identity": {"key": "properties.primaryUserAssignedIdentity", "type": "str"}, - "public_network_access": {"key": "properties.publicNetworkAccess", "type": "str"}, - "application_insights": {"key": "properties.applicationInsights", "type": "str"}, - "container_registry": {"key": "properties.containerRegistry", "type": "str"}, - "encryption": {"key": "properties.encryption", "type": "EncryptionUpdateProperties"}, + "primary_user_assigned_identity": { + "key": "properties.primaryUserAssignedIdentity", + "type": "str", + }, + "public_network_access": { + "key": "properties.publicNetworkAccess", + "type": "str", + }, + "application_insights": { + "key": "properties.applicationInsights", + "type": "str", + }, + "container_registry": { + "key": "properties.containerRegistry", + "type": "str", + }, + "encryption": { + "key": "properties.encryption", + "type": "EncryptionUpdateProperties", + }, } def __init__(self, **kwargs): @@ -24251,8 +26046,12 @@ def __init__(self, **kwargs): self.description = kwargs.get("description", None) self.friendly_name = kwargs.get("friendly_name", None) self.image_build_compute = kwargs.get("image_build_compute", None) - self.service_managed_resources_settings = kwargs.get("service_managed_resources_settings", None) - self.primary_user_assigned_identity = kwargs.get("primary_user_assigned_identity", None) + self.service_managed_resources_settings = kwargs.get( + "service_managed_resources_settings", None + ) + self.primary_user_assigned_identity = kwargs.get( + "primary_user_assigned_identity", None + ) self.public_network_access = kwargs.get("public_network_access", None) self.application_insights = kwargs.get("application_insights", None) self.container_registry = kwargs.get("container_registry", None) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/models/_models_py3.py index ec36e0e8877e..a198c1df4457 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/models/_models_py3.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/models/_models_py3.py @@ -93,7 +93,9 @@ def __init__( self.value_format = value_format -class AccessKeyAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class AccessKeyAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """AccessKeyAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -126,7 +128,10 @@ class AccessKeyAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionProperti "target": {"key": "target", "type": "str"}, "value": {"key": "value", "type": "str"}, "value_format": {"key": "valueFormat", "type": "str"}, - "credentials": {"key": "credentials", "type": "WorkspaceConnectionAccessKey"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionAccessKey", + }, } def __init__( @@ -155,7 +160,11 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccessKey """ super(AccessKeyAuthTypeWorkspaceConnectionProperties, self).__init__( - category=category, target=target, value=value, value_format=value_format, **kwargs + category=category, + target=target, + value=value, + value_format=value_format, + **kwargs ) self.auth_type = "AccessKey" # type: str self.credentials = credentials @@ -317,8 +326,14 @@ class AcrDetails(msrest.serialization.Model): """ _attribute_map = { - "system_created_acr_account": {"key": "systemCreatedAcrAccount", "type": "SystemCreatedAcrAccount"}, - "user_created_acr_account": {"key": "userCreatedAcrAccount", "type": "UserCreatedAcrAccount"}, + "system_created_acr_account": { + "key": "systemCreatedAcrAccount", + "type": "SystemCreatedAcrAccount", + }, + "user_created_acr_account": { + "key": "userCreatedAcrAccount", + "type": "UserCreatedAcrAccount", + }, } def __init__( @@ -352,7 +367,9 @@ class AKSSchema(msrest.serialization.Model): "properties": {"key": "properties", "type": "AKSSchemaProperties"}, } - def __init__(self, *, properties: Optional["AKSSchemaProperties"] = None, **kwargs): + def __init__( + self, *, properties: Optional["AKSSchemaProperties"] = None, **kwargs + ): """ :keyword properties: AKS properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties @@ -417,7 +434,10 @@ class Compute(msrest.serialization.Model): "created_on": {"key": "createdOn", "type": "iso-8601"}, "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, "resource_id": {"key": "resourceId", "type": "str"}, - "provisioning_errors": {"key": "provisioningErrors", "type": "[ErrorResponse]"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } @@ -526,7 +546,10 @@ class AKS(Compute, AKSSchema): "created_on": {"key": "createdOn", "type": "iso-8601"}, "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, "resource_id": {"key": "resourceId", "type": "str"}, - "provisioning_errors": {"key": "provisioningErrors", "type": "[ErrorResponse]"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } @@ -591,7 +614,10 @@ class AksComputeSecretsProperties(msrest.serialization.Model): _attribute_map = { "user_kube_config": {"key": "userKubeConfig", "type": "str"}, "admin_kube_config": {"key": "adminKubeConfig", "type": "str"}, - "image_pull_secret_name": {"key": "imagePullSecretName", "type": "str"}, + "image_pull_secret_name": { + "key": "imagePullSecretName", + "type": "str", + }, } def __init__( @@ -680,7 +706,10 @@ class AksComputeSecrets(ComputeSecrets, AksComputeSecretsProperties): _attribute_map = { "user_kube_config": {"key": "userKubeConfig", "type": "str"}, "admin_kube_config": {"key": "adminKubeConfig", "type": "str"}, - "image_pull_secret_name": {"key": "imagePullSecretName", "type": "str"}, + "image_pull_secret_name": { + "key": "imagePullSecretName", + "type": "str", + }, "compute_type": {"key": "computeType", "type": "str"}, } @@ -731,11 +760,15 @@ class AksNetworkingConfiguration(msrest.serialization.Model): """ _validation = { - "service_cidr": {"pattern": r"^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$"}, + "service_cidr": { + "pattern": r"^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$" + }, "dns_service_ip": { "pattern": r"^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" }, - "docker_bridge_cidr": {"pattern": r"^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$"}, + "docker_bridge_cidr": { + "pattern": r"^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$" + }, } _attribute_map = { @@ -809,12 +842,21 @@ class AKSSchemaProperties(msrest.serialization.Model): _attribute_map = { "cluster_fqdn": {"key": "clusterFqdn", "type": "str"}, - "system_services": {"key": "systemServices", "type": "[SystemService]"}, + "system_services": { + "key": "systemServices", + "type": "[SystemService]", + }, "agent_count": {"key": "agentCount", "type": "int"}, "agent_vm_size": {"key": "agentVmSize", "type": "str"}, "cluster_purpose": {"key": "clusterPurpose", "type": "str"}, - "ssl_configuration": {"key": "sslConfiguration", "type": "SslConfiguration"}, - "aks_networking_configuration": {"key": "aksNetworkingConfiguration", "type": "AksNetworkingConfiguration"}, + "ssl_configuration": { + "key": "sslConfiguration", + "type": "SslConfiguration", + }, + "aks_networking_configuration": { + "key": "aksNetworkingConfiguration", + "type": "AksNetworkingConfiguration", + }, "load_balancer_type": {"key": "loadBalancerType", "type": "str"}, "load_balancer_subnet": {"key": "loadBalancerSubnet", "type": "str"}, } @@ -827,8 +869,12 @@ def __init__( agent_vm_size: Optional[str] = None, cluster_purpose: Optional[Union[str, "ClusterPurpose"]] = "FastProd", ssl_configuration: Optional["SslConfiguration"] = None, - aks_networking_configuration: Optional["AksNetworkingConfiguration"] = None, - load_balancer_type: Optional[Union[str, "LoadBalancerType"]] = "PublicIp", + aks_networking_configuration: Optional[ + "AksNetworkingConfiguration" + ] = None, + load_balancer_type: Optional[ + Union[str, "LoadBalancerType"] + ] = "PublicIp", load_balancer_subnet: Optional[str] = None, **kwargs ): @@ -930,7 +976,9 @@ class AmlComputeSchema(msrest.serialization.Model): "properties": {"key": "properties", "type": "AmlComputeProperties"}, } - def __init__(self, *, properties: Optional["AmlComputeProperties"] = None, **kwargs): + def __init__( + self, *, properties: Optional["AmlComputeProperties"] = None, **kwargs + ): """ :keyword properties: Properties of AmlCompute. :paramtype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties @@ -995,7 +1043,10 @@ class AmlCompute(Compute, AmlComputeSchema): "created_on": {"key": "createdOn", "type": "iso-8601"}, "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, "resource_id": {"key": "resourceId", "type": "str"}, - "provisioning_errors": {"key": "provisioningErrors", "type": "[ErrorResponse]"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } @@ -1199,18 +1250,33 @@ class AmlComputeProperties(msrest.serialization.Model): "os_type": {"key": "osType", "type": "str"}, "vm_size": {"key": "vmSize", "type": "str"}, "vm_priority": {"key": "vmPriority", "type": "str"}, - "virtual_machine_image": {"key": "virtualMachineImage", "type": "VirtualMachineImage"}, + "virtual_machine_image": { + "key": "virtualMachineImage", + "type": "VirtualMachineImage", + }, "isolated_network": {"key": "isolatedNetwork", "type": "bool"}, "scale_settings": {"key": "scaleSettings", "type": "ScaleSettings"}, - "user_account_credentials": {"key": "userAccountCredentials", "type": "UserAccountCredentials"}, + "user_account_credentials": { + "key": "userAccountCredentials", + "type": "UserAccountCredentials", + }, "subnet": {"key": "subnet", "type": "ResourceId"}, - "remote_login_port_public_access": {"key": "remoteLoginPortPublicAccess", "type": "str"}, + "remote_login_port_public_access": { + "key": "remoteLoginPortPublicAccess", + "type": "str", + }, "allocation_state": {"key": "allocationState", "type": "str"}, - "allocation_state_transition_time": {"key": "allocationStateTransitionTime", "type": "iso-8601"}, + "allocation_state_transition_time": { + "key": "allocationStateTransitionTime", + "type": "iso-8601", + }, "errors": {"key": "errors", "type": "[ErrorResponse]"}, "current_node_count": {"key": "currentNodeCount", "type": "int"}, "target_node_count": {"key": "targetNodeCount", "type": "int"}, - "node_state_counts": {"key": "nodeStateCounts", "type": "NodeStateCounts"}, + "node_state_counts": { + "key": "nodeStateCounts", + "type": "NodeStateCounts", + }, "enable_node_public_ip": {"key": "enableNodePublicIp", "type": "bool"}, "property_bag": {"key": "propertyBag", "type": "object"}, } @@ -1226,7 +1292,9 @@ def __init__( scale_settings: Optional["ScaleSettings"] = None, user_account_credentials: Optional["UserAccountCredentials"] = None, subnet: Optional["ResourceId"] = None, - remote_login_port_public_access: Optional[Union[str, "RemoteLoginPortPublicAccess"]] = "NotSpecified", + remote_login_port_public_access: Optional[ + Union[str, "RemoteLoginPortPublicAccess"] + ] = "NotSpecified", enable_node_public_ip: Optional[bool] = True, property_bag: Optional[Any] = None, **kwargs @@ -1386,7 +1454,9 @@ class AmlOperationListResult(msrest.serialization.Model): "value": {"key": "value", "type": "[AmlOperation]"}, } - def __init__(self, *, value: Optional[List["AmlOperation"]] = None, **kwargs): + def __init__( + self, *, value: Optional[List["AmlOperation"]] = None, **kwargs + ): """ :keyword value: List of AML operations supported by the AML resource provider. :paramtype value: list[~azure.mgmt.machinelearningservices.models.AmlOperation] @@ -1418,7 +1488,11 @@ class IdentityConfiguration(msrest.serialization.Model): } _subtype_map = { - "identity_type": {"AMLToken": "AmlToken", "Managed": "ManagedIdentity", "UserIdentity": "UserIdentity"} + "identity_type": { + "AMLToken": "AmlToken", + "Managed": "ManagedIdentity", + "UserIdentity": "UserIdentity", + } } def __init__(self, **kwargs): @@ -1601,7 +1675,9 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(AssetBase, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + super(AssetBase, self).__init__( + description=description, properties=properties, tags=tags, **kwargs + ) self.is_anonymous = is_anonymous self.is_archived = is_archived @@ -1658,7 +1734,9 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(AssetContainer, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + super(AssetContainer, self).__init__( + description=description, properties=properties, tags=tags, **kwargs + ) self.is_archived = is_archived self.latest_version = None self.next_version = None @@ -1685,7 +1763,13 @@ class AssetJobInput(msrest.serialization.Model): "uri": {"key": "uri", "type": "str"}, } - def __init__(self, *, uri: str, mode: Optional[Union[str, "InputDeliveryMode"]] = None, **kwargs): + def __init__( + self, + *, + uri: str, + mode: Optional[Union[str, "InputDeliveryMode"]] = None, + **kwargs + ): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -1835,7 +1919,12 @@ class ForecastHorizon(msrest.serialization.Model): "mode": {"key": "mode", "type": "str"}, } - _subtype_map = {"mode": {"Auto": "AutoForecastHorizon", "Custom": "CustomForecastHorizon"}} + _subtype_map = { + "mode": { + "Auto": "AutoForecastHorizon", + "Custom": "CustomForecastHorizon", + } + } def __init__(self, **kwargs): """ """ @@ -1886,7 +1975,12 @@ class AutologgerSettings(msrest.serialization.Model): "mlflow_autologger": {"key": "mlflowAutologger", "type": "str"}, } - def __init__(self, *, mlflow_autologger: Union[str, "MLFlowAutologgerState"], **kwargs): + def __init__( + self, + *, + mlflow_autologger: Union[str, "MLFlowAutologgerState"], + **kwargs + ): """ :keyword mlflow_autologger: Required. [Required] Indicates whether mlflow autologger is enabled. Possible values include: "Enabled", "Disabled". @@ -1958,7 +2052,10 @@ class JobBaseProperties(ResourceBase): "identity": {"key": "identity", "type": "IdentityConfiguration"}, "is_archived": {"key": "isArchived", "type": "bool"}, "job_type": {"key": "jobType", "type": "str"}, - "notification_setting": {"key": "notificationSetting", "type": "NotificationSetting"}, + "notification_setting": { + "key": "notificationSetting", + "type": "NotificationSetting", + }, "services": {"key": "services", "type": "{JobService}"}, "status": {"key": "status", "type": "str"}, } @@ -2018,7 +2115,9 @@ def __init__( For local jobs, a job endpoint will have an endpoint value of FileStreamObject. :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] """ - super(JobBaseProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + super(JobBaseProperties, self).__init__( + description=description, properties=properties, tags=tags, **kwargs + ) self.component_id = component_id self.compute_id = compute_id self.display_name = display_name @@ -2107,11 +2206,17 @@ class AutoMLJob(JobBaseProperties): "identity": {"key": "identity", "type": "IdentityConfiguration"}, "is_archived": {"key": "isArchived", "type": "bool"}, "job_type": {"key": "jobType", "type": "str"}, - "notification_setting": {"key": "notificationSetting", "type": "NotificationSetting"}, + "notification_setting": { + "key": "notificationSetting", + "type": "NotificationSetting", + }, "services": {"key": "services", "type": "{JobService}"}, "status": {"key": "status", "type": "str"}, "environment_id": {"key": "environmentId", "type": "str"}, - "environment_variables": {"key": "environmentVariables", "type": "{str}"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, "outputs": {"key": "outputs", "type": "{JobOutput}"}, "queue_settings": {"key": "queueSettings", "type": "QueueSettings"}, "resources": {"key": "resources", "type": "JobResourceConfiguration"}, @@ -2303,7 +2408,12 @@ class NCrossValidations(msrest.serialization.Model): "mode": {"key": "mode", "type": "str"}, } - _subtype_map = {"mode": {"Auto": "AutoNCrossValidations", "Custom": "CustomNCrossValidations"}} + _subtype_map = { + "mode": { + "Auto": "AutoNCrossValidations", + "Custom": "CustomNCrossValidations", + } + } def __init__(self, **kwargs): """ """ @@ -2349,7 +2459,13 @@ class AutoPauseProperties(msrest.serialization.Model): "enabled": {"key": "enabled", "type": "bool"}, } - def __init__(self, *, delay_in_minutes: Optional[int] = None, enabled: Optional[bool] = None, **kwargs): + def __init__( + self, + *, + delay_in_minutes: Optional[int] = None, + enabled: Optional[bool] = None, + **kwargs + ): """ :keyword delay_in_minutes: :paramtype delay_in_minutes: int @@ -2421,7 +2537,9 @@ class Seasonality(msrest.serialization.Model): "mode": {"key": "mode", "type": "str"}, } - _subtype_map = {"mode": {"Auto": "AutoSeasonality", "Custom": "CustomSeasonality"}} + _subtype_map = { + "mode": {"Auto": "AutoSeasonality", "Custom": "CustomSeasonality"} + } def __init__(self, **kwargs): """ """ @@ -2474,7 +2592,9 @@ class TargetLags(msrest.serialization.Model): "mode": {"key": "mode", "type": "str"}, } - _subtype_map = {"mode": {"Auto": "AutoTargetLags", "Custom": "CustomTargetLags"}} + _subtype_map = { + "mode": {"Auto": "AutoTargetLags", "Custom": "CustomTargetLags"} + } def __init__(self, **kwargs): """ """ @@ -2527,7 +2647,12 @@ class TargetRollingWindowSize(msrest.serialization.Model): "mode": {"key": "mode", "type": "str"}, } - _subtype_map = {"mode": {"Auto": "AutoTargetRollingWindowSize", "Custom": "CustomTargetRollingWindowSize"}} + _subtype_map = { + "mode": { + "Auto": "AutoTargetRollingWindowSize", + "Custom": "CustomTargetRollingWindowSize", + } + } def __init__(self, **kwargs): """ """ @@ -2573,7 +2698,13 @@ class AzureDatastore(msrest.serialization.Model): "subscription_id": {"key": "subscriptionId", "type": "str"}, } - def __init__(self, *, resource_group: Optional[str] = None, subscription_id: Optional[str] = None, **kwargs): + def __init__( + self, + *, + resource_group: Optional[str] = None, + subscription_id: Optional[str] = None, + **kwargs + ): """ :keyword resource_group: Azure Resource Group name. :paramtype resource_group: str @@ -2656,7 +2787,9 @@ def __init__( :keyword credentials: Required. [Required] Account credentials. :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials """ - super(DatastoreProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + super(DatastoreProperties, self).__init__( + description=description, properties=properties, tags=tags, **kwargs + ) self.credentials = credentials self.datastore_type = "DatastoreProperties" # type: str self.is_default = None @@ -2722,7 +2855,10 @@ class AzureBlobDatastore(DatastoreProperties, AzureDatastore): "container_name": {"key": "containerName", "type": "str"}, "endpoint": {"key": "endpoint", "type": "str"}, "protocol": {"key": "protocol", "type": "str"}, - "service_data_access_auth_identity": {"key": "serviceDataAccessAuthIdentity", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } def __init__( @@ -2738,7 +2874,9 @@ def __init__( container_name: Optional[str] = None, endpoint: Optional[str] = None, protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, + service_data_access_auth_identity: Optional[ + Union[str, "ServiceDataAccessAuthIdentity"] + ] = None, **kwargs ): """ @@ -2784,7 +2922,9 @@ def __init__( self.container_name = container_name self.endpoint = endpoint self.protocol = protocol - self.service_data_access_auth_identity = service_data_access_auth_identity + self.service_data_access_auth_identity = ( + service_data_access_auth_identity + ) self.description = description self.properties = properties self.tags = tags @@ -2843,7 +2983,10 @@ class AzureDataLakeGen1Datastore(DatastoreProperties, AzureDatastore): "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, "datastore_type": {"key": "datastoreType", "type": "str"}, "is_default": {"key": "isDefault", "type": "bool"}, - "service_data_access_auth_identity": {"key": "serviceDataAccessAuthIdentity", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, "store_name": {"key": "storeName", "type": "str"}, } @@ -2857,7 +3000,9 @@ def __init__( description: Optional[str] = None, properties: Optional[Dict[str, str]] = None, tags: Optional[Dict[str, str]] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, + service_data_access_auth_identity: Optional[ + Union[str, "ServiceDataAccessAuthIdentity"] + ] = None, **kwargs ): """ @@ -2893,7 +3038,9 @@ def __init__( self.resource_group = resource_group self.subscription_id = subscription_id self.datastore_type = "AzureDataLakeGen1" # type: str - self.service_data_access_auth_identity = service_data_access_auth_identity + self.service_data_access_auth_identity = ( + service_data_access_auth_identity + ) self.store_name = store_name self.description = description self.properties = properties @@ -2964,7 +3111,10 @@ class AzureDataLakeGen2Datastore(DatastoreProperties, AzureDatastore): "endpoint": {"key": "endpoint", "type": "str"}, "filesystem": {"key": "filesystem", "type": "str"}, "protocol": {"key": "protocol", "type": "str"}, - "service_data_access_auth_identity": {"key": "serviceDataAccessAuthIdentity", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } def __init__( @@ -2980,7 +3130,9 @@ def __init__( tags: Optional[Dict[str, str]] = None, endpoint: Optional[str] = None, protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, + service_data_access_auth_identity: Optional[ + Union[str, "ServiceDataAccessAuthIdentity"] + ] = None, **kwargs ): """ @@ -3026,7 +3178,9 @@ def __init__( self.endpoint = endpoint self.filesystem = filesystem self.protocol = protocol - self.service_data_access_auth_identity = service_data_access_auth_identity + self.service_data_access_auth_identity = ( + service_data_access_auth_identity + ) self.description = description self.properties = properties self.tags = tags @@ -3097,7 +3251,10 @@ class AzureFileDatastore(DatastoreProperties, AzureDatastore): "endpoint": {"key": "endpoint", "type": "str"}, "file_share_name": {"key": "fileShareName", "type": "str"}, "protocol": {"key": "protocol", "type": "str"}, - "service_data_access_auth_identity": {"key": "serviceDataAccessAuthIdentity", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } def __init__( @@ -3113,7 +3270,9 @@ def __init__( tags: Optional[Dict[str, str]] = None, endpoint: Optional[str] = None, protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, + service_data_access_auth_identity: Optional[ + Union[str, "ServiceDataAccessAuthIdentity"] + ] = None, **kwargs ): """ @@ -3160,7 +3319,9 @@ def __init__( self.endpoint = endpoint self.file_share_name = file_share_name self.protocol = protocol - self.service_data_access_auth_identity = service_data_access_auth_identity + self.service_data_access_auth_identity = ( + service_data_access_auth_identity + ) self.description = description self.properties = properties self.tags = tags @@ -3222,10 +3383,18 @@ class AzureMLBatchInferencingServer(InferencingServer): _attribute_map = { "server_type": {"key": "serverType", "type": "str"}, - "code_configuration": {"key": "codeConfiguration", "type": "CodeConfiguration"}, + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, } - def __init__(self, *, code_configuration: Optional["CodeConfiguration"] = None, **kwargs): + def __init__( + self, + *, + code_configuration: Optional["CodeConfiguration"] = None, + **kwargs + ): """ :keyword code_configuration: Code configuration for AML batch inferencing server. :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration @@ -3253,10 +3422,18 @@ class AzureMLOnlineInferencingServer(InferencingServer): _attribute_map = { "server_type": {"key": "serverType", "type": "str"}, - "code_configuration": {"key": "codeConfiguration", "type": "CodeConfiguration"}, + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, } - def __init__(self, *, code_configuration: Optional["CodeConfiguration"] = None, **kwargs): + def __init__( + self, + *, + code_configuration: Optional["CodeConfiguration"] = None, + **kwargs + ): """ :keyword code_configuration: Code configuration for AML inferencing server. :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration @@ -3302,7 +3479,13 @@ class EarlyTerminationPolicy(msrest.serialization.Model): } } - def __init__(self, *, delay_evaluation: Optional[int] = 0, evaluation_interval: Optional[int] = 0, **kwargs): + def __init__( + self, + *, + delay_evaluation: Optional[int] = 0, + evaluation_interval: Optional[int] = 0, + **kwargs + ): """ :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. :paramtype delay_evaluation: int @@ -3366,7 +3549,9 @@ def __init__( :paramtype slack_factor: float """ super(BanditPolicy, self).__init__( - delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs + delay_evaluation=delay_evaluation, + evaluation_interval=evaluation_interval, + **kwargs ) self.policy_type = "Bandit" # type: str self.slack_amount = slack_amount @@ -3392,10 +3577,17 @@ class BaseEnvironmentSource(msrest.serialization.Model): } _attribute_map = { - "base_environment_source_type": {"key": "baseEnvironmentSourceType", "type": "str"}, + "base_environment_source_type": { + "key": "baseEnvironmentSourceType", + "type": "str", + }, } - _subtype_map = {"base_environment_source_type": {"EnvironmentAsset": "BaseEnvironmentId"}} + _subtype_map = { + "base_environment_source_type": { + "EnvironmentAsset": "BaseEnvironmentId" + } + } def __init__(self, **kwargs): """ """ @@ -3422,7 +3614,10 @@ class BaseEnvironmentId(BaseEnvironmentSource): } _attribute_map = { - "base_environment_source_type": {"key": "baseEnvironmentSourceType", "type": "str"}, + "base_environment_source_type": { + "key": "baseEnvironmentSourceType", + "type": "str", + }, "resource_id": {"key": "resourceId", "type": "str"}, } @@ -3518,7 +3713,9 @@ class TrackedResource(Resource): "location": {"key": "location", "type": "str"}, } - def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs): + def __init__( + self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs + ): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -3581,7 +3778,10 @@ class BatchDeployment(TrackedResource): "location": {"key": "location", "type": "str"}, "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, "kind": {"key": "kind", "type": "str"}, - "properties": {"key": "properties", "type": "BatchDeploymentProperties"}, + "properties": { + "key": "properties", + "type": "BatchDeploymentProperties", + }, "sku": {"key": "sku", "type": "Sku"}, } @@ -3611,7 +3811,9 @@ def __init__( :keyword sku: Sku details required for ARM contract for Autoscaling. :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ - super(BatchDeployment, self).__init__(tags=tags, location=location, **kwargs) + super(BatchDeployment, self).__init__( + tags=tags, location=location, **kwargs + ) self.identity = identity self.kind = kind self.properties = properties @@ -3635,10 +3837,16 @@ class EndpointDeploymentPropertiesBase(msrest.serialization.Model): """ _attribute_map = { - "code_configuration": {"key": "codeConfiguration", "type": "CodeConfiguration"}, + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, "description": {"key": "description", "type": "str"}, "environment_id": {"key": "environmentId", "type": "str"}, - "environment_variables": {"key": "environmentVariables", "type": "{str}"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, "properties": {"key": "properties", "type": "{str}"}, } @@ -3734,23 +3942,41 @@ class BatchDeploymentProperties(EndpointDeploymentPropertiesBase): } _attribute_map = { - "code_configuration": {"key": "codeConfiguration", "type": "CodeConfiguration"}, + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, "description": {"key": "description", "type": "str"}, "environment_id": {"key": "environmentId", "type": "str"}, - "environment_variables": {"key": "environmentVariables", "type": "{str}"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, "properties": {"key": "properties", "type": "{str}"}, "compute": {"key": "compute", "type": "str"}, - "deployment_properties": {"key": "deploymentProperties", "type": "BatchDeploymentPropertiesAutoGenerated"}, + "deployment_properties": { + "key": "deploymentProperties", + "type": "BatchDeploymentPropertiesAutoGenerated", + }, "error_threshold": {"key": "errorThreshold", "type": "int"}, "logging_level": {"key": "loggingLevel", "type": "str"}, - "max_concurrency_per_instance": {"key": "maxConcurrencyPerInstance", "type": "int"}, + "max_concurrency_per_instance": { + "key": "maxConcurrencyPerInstance", + "type": "int", + }, "mini_batch_size": {"key": "miniBatchSize", "type": "long"}, "model": {"key": "model", "type": "AssetReferenceBase"}, "output_action": {"key": "outputAction", "type": "str"}, "output_file_name": {"key": "outputFileName", "type": "str"}, "provisioning_state": {"key": "provisioningState", "type": "str"}, - "resources": {"key": "resources", "type": "DeploymentResourceConfiguration"}, - "retry_settings": {"key": "retrySettings", "type": "BatchRetrySettings"}, + "resources": { + "key": "resources", + "type": "DeploymentResourceConfiguration", + }, + "retry_settings": { + "key": "retrySettings", + "type": "BatchRetrySettings", + }, } def __init__( @@ -3762,7 +3988,9 @@ def __init__( environment_variables: Optional[Dict[str, str]] = None, properties: Optional[Dict[str, str]] = None, compute: Optional[str] = None, - deployment_properties: Optional["BatchDeploymentPropertiesAutoGenerated"] = None, + deployment_properties: Optional[ + "BatchDeploymentPropertiesAutoGenerated" + ] = None, error_threshold: Optional[int] = -1, logging_level: Optional[Union[str, "BatchLoggingLevel"]] = None, max_concurrency_per_instance: Optional[int] = 1, @@ -3863,10 +4091,17 @@ class BatchDeploymentPropertiesAutoGenerated(msrest.serialization.Model): } _attribute_map = { - "deployment_property_type": {"key": "deploymentPropertyType", "type": "str"}, + "deployment_property_type": { + "key": "deploymentPropertyType", + "type": "str", + }, } - _subtype_map = {"deployment_property_type": {"PipelineComponent": "BatchPipelineComponentDeploymentProperties"}} + _subtype_map = { + "deployment_property_type": { + "PipelineComponent": "BatchPipelineComponentDeploymentProperties" + } + } def __init__(self, **kwargs): """ """ @@ -3874,7 +4109,9 @@ def __init__(self, **kwargs): self.deployment_property_type = None # type: Optional[str] -class BatchDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class BatchDeploymentTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of BatchDeployment entities. :ivar next_link: The link to the next page of BatchDeployment objects. If null, there are no @@ -3889,7 +4126,13 @@ class BatchDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Mode "value": {"key": "value", "type": "[BatchDeployment]"}, } - def __init__(self, *, next_link: Optional[str] = None, value: Optional[List["BatchDeployment"]] = None, **kwargs): + def __init__( + self, + *, + next_link: Optional[str] = None, + value: Optional[List["BatchDeployment"]] = None, + **kwargs + ): """ :keyword next_link: The link to the next page of BatchDeployment objects. If null, there are no additional pages. @@ -3897,7 +4140,9 @@ def __init__(self, *, next_link: Optional[str] = None, value: Optional[List["Bat :keyword value: An array of objects of type BatchDeployment. :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchDeployment] """ - super(BatchDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) + super(BatchDeploymentTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -3983,7 +4228,9 @@ def __init__( :keyword sku: Sku details required for ARM contract for Autoscaling. :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ - super(BatchEndpoint, self).__init__(tags=tags, location=location, **kwargs) + super(BatchEndpoint, self).__init__( + tags=tags, location=location, **kwargs + ) self.identity = identity self.kind = kind self.properties = properties @@ -4160,13 +4407,19 @@ def __init__( :paramtype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults """ super(BatchEndpointProperties, self).__init__( - auth_mode=auth_mode, description=description, keys=keys, properties=properties, **kwargs + auth_mode=auth_mode, + description=description, + keys=keys, + properties=properties, + **kwargs ) self.defaults = defaults self.provisioning_state = None -class BatchEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class BatchEndpointTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of BatchEndpoint entities. :ivar next_link: The link to the next page of BatchEndpoint objects. If null, there are no @@ -4181,7 +4434,13 @@ class BatchEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model) "value": {"key": "value", "type": "[BatchEndpoint]"}, } - def __init__(self, *, next_link: Optional[str] = None, value: Optional[List["BatchEndpoint"]] = None, **kwargs): + def __init__( + self, + *, + next_link: Optional[str] = None, + value: Optional[List["BatchEndpoint"]] = None, + **kwargs + ): """ :keyword next_link: The link to the next page of BatchEndpoint objects. If null, there are no additional pages. @@ -4189,12 +4448,16 @@ def __init__(self, *, next_link: Optional[str] = None, value: Optional[List["Bat :keyword value: An array of objects of type BatchEndpoint. :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchEndpoint] """ - super(BatchEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) + super(BatchEndpointTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value -class BatchPipelineComponentDeploymentProperties(BatchDeploymentPropertiesAutoGenerated): +class BatchPipelineComponentDeploymentProperties( + BatchDeploymentPropertiesAutoGenerated +): """Properties for a Batch Pipeline Component Deployment. All required parameters must be populated in order to send to Azure. @@ -4218,7 +4481,10 @@ class BatchPipelineComponentDeploymentProperties(BatchDeploymentPropertiesAutoGe } _attribute_map = { - "deployment_property_type": {"key": "deploymentPropertyType", "type": "str"}, + "deployment_property_type": { + "key": "deploymentPropertyType", + "type": "str", + }, "component_id": {"key": "componentId", "type": "IdAssetReference"}, "description": {"key": "description", "type": "str"}, "settings": {"key": "settings", "type": "{str}"}, @@ -4244,7 +4510,9 @@ def __init__( :keyword tags: A set of tags. The tags which will be applied to the job. :paramtype tags: dict[str, str] """ - super(BatchPipelineComponentDeploymentProperties, self).__init__(**kwargs) + super(BatchPipelineComponentDeploymentProperties, self).__init__( + **kwargs + ) self.deployment_property_type = "PipelineComponent" # type: str self.component_id = component_id self.description = description @@ -4266,7 +4534,13 @@ class BatchRetrySettings(msrest.serialization.Model): "timeout": {"key": "timeout", "type": "duration"}, } - def __init__(self, *, max_retries: Optional[int] = 3, timeout: Optional[datetime.timedelta] = "PT30S", **kwargs): + def __init__( + self, + *, + max_retries: Optional[int] = 3, + timeout: Optional[datetime.timedelta] = "PT30S", + **kwargs + ): """ :keyword max_retries: Maximum retry count for a mini-batch. :paramtype max_retries: int @@ -4299,7 +4573,10 @@ class SamplingAlgorithm(msrest.serialization.Model): } _attribute_map = { - "sampling_algorithm_type": {"key": "samplingAlgorithmType", "type": "str"}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } _subtype_map = { @@ -4333,7 +4610,10 @@ class BayesianSamplingAlgorithm(SamplingAlgorithm): } _attribute_map = { - "sampling_algorithm_type": {"key": "samplingAlgorithmType", "type": "str"}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } def __init__(self, **kwargs): @@ -4413,7 +4693,13 @@ class BuildContext(msrest.serialization.Model): "dockerfile_path": {"key": "dockerfilePath", "type": "str"}, } - def __init__(self, *, context_uri: str, dockerfile_path: Optional[str] = "Dockerfile", **kwargs): + def __init__( + self, + *, + context_uri: str, + dockerfile_path: Optional[str] = "Dockerfile", + **kwargs + ): """ :keyword context_uri: Required. [Required] URI of the Docker build context used to build the image. Supports blob URIs on environment creation and may return blob or Git URIs. @@ -4588,16 +4874,40 @@ class TableVertical(msrest.serialization.Model): """ _attribute_map = { - "cv_split_column_names": {"key": "cvSplitColumnNames", "type": "[str]"}, - "featurization_settings": {"key": "featurizationSettings", "type": "TableVerticalFeaturizationSettings"}, - "fixed_parameters": {"key": "fixedParameters", "type": "TableFixedParameters"}, - "limit_settings": {"key": "limitSettings", "type": "TableVerticalLimitSettings"}, - "n_cross_validations": {"key": "nCrossValidations", "type": "NCrossValidations"}, - "search_space": {"key": "searchSpace", "type": "[TableParameterSubspace]"}, - "sweep_settings": {"key": "sweepSettings", "type": "TableSweepSettings"}, + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "TableFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "search_space": { + "key": "searchSpace", + "type": "[TableParameterSubspace]", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "TableSweepSettings", + }, "test_data": {"key": "testData", "type": "MLTableJobInput"}, "test_data_size": {"key": "testDataSize", "type": "float"}, - "validation_data": {"key": "validationData", "type": "MLTableJobInput"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, "validation_data_size": {"key": "validationDataSize", "type": "float"}, "weight_column_name": {"key": "weightColumnName", "type": "str"}, } @@ -4606,7 +4916,9 @@ def __init__( self, *, cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "TableVerticalFeaturizationSettings" + ] = None, fixed_parameters: Optional["TableFixedParameters"] = None, limit_settings: Optional["TableVerticalLimitSettings"] = None, n_cross_validations: Optional["NCrossValidations"] = None, @@ -4744,16 +5056,40 @@ class Classification(AutoMLVertical, TableVertical): } _attribute_map = { - "cv_split_column_names": {"key": "cvSplitColumnNames", "type": "[str]"}, - "featurization_settings": {"key": "featurizationSettings", "type": "TableVerticalFeaturizationSettings"}, - "fixed_parameters": {"key": "fixedParameters", "type": "TableFixedParameters"}, - "limit_settings": {"key": "limitSettings", "type": "TableVerticalLimitSettings"}, - "n_cross_validations": {"key": "nCrossValidations", "type": "NCrossValidations"}, - "search_space": {"key": "searchSpace", "type": "[TableParameterSubspace]"}, - "sweep_settings": {"key": "sweepSettings", "type": "TableSweepSettings"}, + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "TableFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "search_space": { + "key": "searchSpace", + "type": "[TableParameterSubspace]", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "TableSweepSettings", + }, "test_data": {"key": "testData", "type": "MLTableJobInput"}, "test_data_size": {"key": "testDataSize", "type": "float"}, - "validation_data": {"key": "validationData", "type": "MLTableJobInput"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, "validation_data_size": {"key": "validationDataSize", "type": "float"}, "weight_column_name": {"key": "weightColumnName", "type": "str"}, "log_verbosity": {"key": "logVerbosity", "type": "str"}, @@ -4762,7 +5098,10 @@ class Classification(AutoMLVertical, TableVertical): "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, "positive_label": {"key": "positiveLabel", "type": "str"}, "primary_metric": {"key": "primaryMetric", "type": "str"}, - "training_settings": {"key": "trainingSettings", "type": "ClassificationTrainingSettings"}, + "training_settings": { + "key": "trainingSettings", + "type": "ClassificationTrainingSettings", + }, } def __init__( @@ -4770,7 +5109,9 @@ def __init__( *, training_data: "MLTableJobInput", cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "TableVerticalFeaturizationSettings" + ] = None, fixed_parameters: Optional["TableFixedParameters"] = None, limit_settings: Optional["TableVerticalLimitSettings"] = None, n_cross_validations: Optional["NCrossValidations"] = None, @@ -4784,7 +5125,9 @@ def __init__( log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, positive_label: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "ClassificationPrimaryMetrics"] + ] = None, training_settings: Optional["ClassificationTrainingSettings"] = None, **kwargs ): @@ -4916,12 +5259,27 @@ class TrainingSettings(msrest.serialization.Model): _attribute_map = { "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, - "enable_model_explainability": {"key": "enableModelExplainability", "type": "bool"}, - "enable_onnx_compatible_models": {"key": "enableOnnxCompatibleModels", "type": "bool"}, - "enable_stack_ensemble": {"key": "enableStackEnsemble", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, - "ensemble_model_download_timeout": {"key": "ensembleModelDownloadTimeout", "type": "duration"}, - "stack_ensemble_settings": {"key": "stackEnsembleSettings", "type": "StackEnsembleSettings"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, "training_mode": {"key": "trainingMode", "type": "str"}, } @@ -5014,15 +5372,36 @@ class ClassificationTrainingSettings(TrainingSettings): _attribute_map = { "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, - "enable_model_explainability": {"key": "enableModelExplainability", "type": "bool"}, - "enable_onnx_compatible_models": {"key": "enableOnnxCompatibleModels", "type": "bool"}, - "enable_stack_ensemble": {"key": "enableStackEnsemble", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, - "ensemble_model_download_timeout": {"key": "ensembleModelDownloadTimeout", "type": "duration"}, - "stack_ensemble_settings": {"key": "stackEnsembleSettings", "type": "StackEnsembleSettings"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, "training_mode": {"key": "trainingMode", "type": "str"}, - "allowed_training_algorithms": {"key": "allowedTrainingAlgorithms", "type": "[str]"}, - "blocked_training_algorithms": {"key": "blockedTrainingAlgorithms", "type": "[str]"}, + "allowed_training_algorithms": { + "key": "allowedTrainingAlgorithms", + "type": "[str]", + }, + "blocked_training_algorithms": { + "key": "blockedTrainingAlgorithms", + "type": "[str]", + }, } def __init__( @@ -5036,8 +5415,12 @@ def __init__( ensemble_model_download_timeout: Optional[datetime.timedelta] = "PT5M", stack_ensemble_settings: Optional["StackEnsembleSettings"] = None, training_mode: Optional[Union[str, "TrainingMode"]] = None, - allowed_training_algorithms: Optional[List[Union[str, "ClassificationModels"]]] = None, - blocked_training_algorithms: Optional[List[Union[str, "ClassificationModels"]]] = None, + allowed_training_algorithms: Optional[ + List[Union[str, "ClassificationModels"]] + ] = None, + blocked_training_algorithms: Optional[ + List[Union[str, "ClassificationModels"]] + ] = None, **kwargs ): """ @@ -5096,10 +5479,18 @@ class ClusterUpdateParameters(msrest.serialization.Model): """ _attribute_map = { - "properties": {"key": "properties.properties", "type": "ScaleSettingsInformation"}, + "properties": { + "key": "properties.properties", + "type": "ScaleSettingsInformation", + }, } - def __init__(self, *, properties: Optional["ScaleSettingsInformation"] = None, **kwargs): + def __init__( + self, + *, + properties: Optional["ScaleSettingsInformation"] = None, + **kwargs + ): """ :keyword properties: Properties of ClusterUpdate. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ScaleSettingsInformation @@ -5148,7 +5539,11 @@ class ExportSummary(msrest.serialization.Model): } _subtype_map = { - "format": {"CSV": "CsvExportSummary", "Coco": "CocoExportSummary", "Dataset": "DatasetExportSummary"} + "format": { + "CSV": "CsvExportSummary", + "Coco": "CocoExportSummary", + "Dataset": "DatasetExportSummary", + } } def __init__(self, **kwargs): @@ -5225,7 +5620,11 @@ class CodeConfiguration(msrest.serialization.Model): """ _validation = { - "scoring_script": {"required": True, "min_length": 1, "pattern": r"[a-zA-Z0-9_]"}, + "scoring_script": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { @@ -5233,7 +5632,9 @@ class CodeConfiguration(msrest.serialization.Model): "scoring_script": {"key": "scoringScript", "type": "str"}, } - def __init__(self, *, scoring_script: str, code_id: Optional[str] = None, **kwargs): + def __init__( + self, *, scoring_script: str, code_id: Optional[str] = None, **kwargs + ): """ :keyword code_id: ARM resource ID of the code asset. :paramtype code_id: str @@ -5351,7 +5752,11 @@ def __init__( :paramtype is_archived: bool """ super(CodeContainerProperties, self).__init__( - description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs ) self.provisioning_state = None @@ -5371,7 +5776,13 @@ class CodeContainerResourceArmPaginatedResult(msrest.serialization.Model): "value": {"key": "value", "type": "[CodeContainer]"}, } - def __init__(self, *, next_link: Optional[str] = None, value: Optional[List["CodeContainer"]] = None, **kwargs): + def __init__( + self, + *, + next_link: Optional[str] = None, + value: Optional[List["CodeContainer"]] = None, + **kwargs + ): """ :keyword next_link: The link to the next page of CodeContainer objects. If null, there are no additional pages. @@ -5520,7 +5931,13 @@ class CodeVersionResourceArmPaginatedResult(msrest.serialization.Model): "value": {"key": "value", "type": "[CodeVersion]"}, } - def __init__(self, *, next_link: Optional[str] = None, value: Optional[List["CodeVersion"]] = None, **kwargs): + def __init__( + self, + *, + next_link: Optional[str] = None, + value: Optional[List["CodeVersion"]] = None, + **kwargs + ): """ :keyword next_link: The link to the next page of CodeVersion objects. If null, there are no additional pages. @@ -5548,7 +5965,13 @@ class ColumnTransformer(msrest.serialization.Model): "parameters": {"key": "parameters", "type": "object"}, } - def __init__(self, *, fields: Optional[List[str]] = None, parameters: Optional[Any] = None, **kwargs): + def __init__( + self, + *, + fields: Optional[List[str]] = None, + parameters: Optional[Any] = None, + **kwargs + ): """ :keyword fields: Fields to apply transformer logic on. :paramtype fields: list[str] @@ -5634,7 +6057,11 @@ class CommandJob(JobBaseProperties): _validation = { "job_type": {"required": True}, "status": {"readonly": True}, - "command": {"required": True, "min_length": 1, "pattern": r"[a-zA-Z0-9_]"}, + "command": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, "environment_id": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, "parameters": {"readonly": True}, } @@ -5650,15 +6077,27 @@ class CommandJob(JobBaseProperties): "identity": {"key": "identity", "type": "IdentityConfiguration"}, "is_archived": {"key": "isArchived", "type": "bool"}, "job_type": {"key": "jobType", "type": "str"}, - "notification_setting": {"key": "notificationSetting", "type": "NotificationSetting"}, + "notification_setting": { + "key": "notificationSetting", + "type": "NotificationSetting", + }, "services": {"key": "services", "type": "{JobService}"}, "status": {"key": "status", "type": "str"}, - "autologger_settings": {"key": "autologgerSettings", "type": "AutologgerSettings"}, + "autologger_settings": { + "key": "autologgerSettings", + "type": "AutologgerSettings", + }, "code_id": {"key": "codeId", "type": "str"}, "command": {"key": "command", "type": "str"}, - "distribution": {"key": "distribution", "type": "DistributionConfiguration"}, + "distribution": { + "key": "distribution", + "type": "DistributionConfiguration", + }, "environment_id": {"key": "environmentId", "type": "str"}, - "environment_variables": {"key": "environmentVariables", "type": "{str}"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, "inputs": {"key": "inputs", "type": "{JobInput}"}, "limits": {"key": "limits", "type": "CommandJobLimits"}, "outputs": {"key": "outputs", "type": "{JobOutput}"}, @@ -5802,9 +6241,16 @@ class JobLimits(msrest.serialization.Model): "timeout": {"key": "timeout", "type": "duration"}, } - _subtype_map = {"job_limits_type": {"Command": "CommandJobLimits", "Sweep": "SweepJobLimits"}} + _subtype_map = { + "job_limits_type": { + "Command": "CommandJobLimits", + "Sweep": "SweepJobLimits", + } + } - def __init__(self, *, timeout: Optional[datetime.timedelta] = None, **kwargs): + def __init__( + self, *, timeout: Optional[datetime.timedelta] = None, **kwargs + ): """ :keyword timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. Only supports duration with precision as low as Seconds. @@ -5837,7 +6283,9 @@ class CommandJobLimits(JobLimits): "timeout": {"key": "timeout", "type": "duration"}, } - def __init__(self, *, timeout: Optional[datetime.timedelta] = None, **kwargs): + def __init__( + self, *, timeout: Optional[datetime.timedelta] = None, **kwargs + ): """ :keyword timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. Only supports duration with precision as low as Seconds. @@ -5882,10 +6330,15 @@ class ComponentContainer(Resource): "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "ComponentContainerProperties"}, + "properties": { + "key": "properties", + "type": "ComponentContainerProperties", + }, } - def __init__(self, *, properties: "ComponentContainerProperties", **kwargs): + def __init__( + self, *, properties: "ComponentContainerProperties", **kwargs + ): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentContainerProperties @@ -5958,7 +6411,11 @@ def __init__( :paramtype is_archived: bool """ super(ComponentContainerProperties, self).__init__( - description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs ) self.provisioning_state = None @@ -5979,7 +6436,11 @@ class ComponentContainerResourceArmPaginatedResult(msrest.serialization.Model): } def __init__( - self, *, next_link: Optional[str] = None, value: Optional[List["ComponentContainer"]] = None, **kwargs + self, + *, + next_link: Optional[str] = None, + value: Optional[List["ComponentContainer"]] = None, + **kwargs ): """ :keyword next_link: The link to the next page of ComponentContainer objects. If null, there are @@ -5988,7 +6449,9 @@ def __init__( :keyword value: An array of objects of type ComponentContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainer] """ - super(ComponentContainerResourceArmPaginatedResult, self).__init__(**kwargs) + super(ComponentContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -6028,7 +6491,10 @@ class ComponentVersion(Resource): "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "ComponentVersionProperties"}, + "properties": { + "key": "properties", + "type": "ComponentVersionProperties", + }, } def __init__(self, *, properties: "ComponentVersionProperties", **kwargs): @@ -6143,7 +6609,13 @@ class ComponentVersionResourceArmPaginatedResult(msrest.serialization.Model): "value": {"key": "value", "type": "[ComponentVersion]"}, } - def __init__(self, *, next_link: Optional[str] = None, value: Optional[List["ComponentVersion"]] = None, **kwargs): + def __init__( + self, + *, + next_link: Optional[str] = None, + value: Optional[List["ComponentVersion"]] = None, + **kwargs + ): """ :keyword next_link: The link to the next page of ComponentVersion objects. If null, there are no additional pages. @@ -6151,7 +6623,9 @@ def __init__(self, *, next_link: Optional[str] = None, value: Optional[List["Com :keyword value: An array of objects of type ComponentVersion. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersion] """ - super(ComponentVersionResourceArmPaginatedResult, self).__init__(**kwargs) + super(ComponentVersionResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -6164,10 +6638,18 @@ class ComputeInstanceSchema(msrest.serialization.Model): """ _attribute_map = { - "properties": {"key": "properties", "type": "ComputeInstanceProperties"}, + "properties": { + "key": "properties", + "type": "ComputeInstanceProperties", + }, } - def __init__(self, *, properties: Optional["ComputeInstanceProperties"] = None, **kwargs): + def __init__( + self, + *, + properties: Optional["ComputeInstanceProperties"] = None, + **kwargs + ): """ :keyword properties: Properties of ComputeInstance. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties @@ -6224,7 +6706,10 @@ class ComputeInstance(Compute, ComputeInstanceSchema): } _attribute_map = { - "properties": {"key": "properties", "type": "ComputeInstanceProperties"}, + "properties": { + "key": "properties", + "type": "ComputeInstanceProperties", + }, "compute_type": {"key": "computeType", "type": "str"}, "compute_location": {"key": "computeLocation", "type": "str"}, "provisioning_state": {"key": "provisioningState", "type": "str"}, @@ -6232,7 +6717,10 @@ class ComputeInstance(Compute, ComputeInstanceSchema): "created_on": {"key": "createdOn", "type": "iso-8601"}, "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, "resource_id": {"key": "resourceId", "type": "str"}, - "provisioning_errors": {"key": "provisioningErrors", "type": "[ErrorResponse]"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } @@ -6295,7 +6783,13 @@ class ComputeInstanceApplication(msrest.serialization.Model): "endpoint_uri": {"key": "endpointUri", "type": "str"}, } - def __init__(self, *, display_name: Optional[str] = None, endpoint_uri: Optional[str] = None, **kwargs): + def __init__( + self, + *, + display_name: Optional[str] = None, + endpoint_uri: Optional[str] = None, + **kwargs + ): """ :keyword display_name: Name of the ComputeInstance application. :paramtype display_name: str @@ -6319,7 +6813,12 @@ class ComputeInstanceAutologgerSettings(msrest.serialization.Model): "mlflow_autologger": {"key": "mlflowAutologger", "type": "str"}, } - def __init__(self, *, mlflow_autologger: Optional[Union[str, "MlflowAutologger"]] = None, **kwargs): + def __init__( + self, + *, + mlflow_autologger: Optional[Union[str, "MlflowAutologger"]] = None, + **kwargs + ): """ :keyword mlflow_autologger: Indicates whether mlflow autologger is enabled for notebooks. Possible values include: "Enabled", "Disabled". @@ -6387,7 +6886,10 @@ class ComputeInstanceContainer(msrest.serialization.Model): "autosave": {"key": "autosave", "type": "str"}, "gpu": {"key": "gpu", "type": "str"}, "network": {"key": "network", "type": "str"}, - "environment": {"key": "environment", "type": "ComputeInstanceEnvironmentInfo"}, + "environment": { + "key": "environment", + "type": "ComputeInstanceEnvironmentInfo", + }, "services": {"key": "services", "type": "[object]"}, } @@ -6486,7 +6988,9 @@ def __init__( caching: Optional[Union[str, "Caching"]] = None, disk_size_gb: Optional[int] = None, lun: Optional[int] = None, - storage_account_type: Optional[Union[str, "StorageAccountType"]] = "Standard_LRS", + storage_account_type: Optional[ + Union[str, "StorageAccountType"] + ] = "Standard_LRS", **kwargs ): """ @@ -6607,7 +7111,13 @@ class ComputeInstanceEnvironmentInfo(msrest.serialization.Model): "version": {"key": "version", "type": "str"}, } - def __init__(self, *, name: Optional[str] = None, version: Optional[str] = None, **kwargs): + def __init__( + self, + *, + name: Optional[str] = None, + version: Optional[str] = None, + **kwargs + ): """ :keyword name: name of environment. :paramtype name: str @@ -6764,29 +7274,68 @@ class ComputeInstanceProperties(msrest.serialization.Model): _attribute_map = { "vm_size": {"key": "vmSize", "type": "str"}, "subnet": {"key": "subnet", "type": "ResourceId"}, - "application_sharing_policy": {"key": "applicationSharingPolicy", "type": "str"}, - "autologger_settings": {"key": "autologgerSettings", "type": "ComputeInstanceAutologgerSettings"}, - "ssh_settings": {"key": "sshSettings", "type": "ComputeInstanceSshSettings"}, - "custom_services": {"key": "customServices", "type": "[CustomService]"}, - "os_image_metadata": {"key": "osImageMetadata", "type": "ImageMetadata"}, - "connectivity_endpoints": {"key": "connectivityEndpoints", "type": "ComputeInstanceConnectivityEndpoints"}, - "applications": {"key": "applications", "type": "[ComputeInstanceApplication]"}, + "application_sharing_policy": { + "key": "applicationSharingPolicy", + "type": "str", + }, + "autologger_settings": { + "key": "autologgerSettings", + "type": "ComputeInstanceAutologgerSettings", + }, + "ssh_settings": { + "key": "sshSettings", + "type": "ComputeInstanceSshSettings", + }, + "custom_services": { + "key": "customServices", + "type": "[CustomService]", + }, + "os_image_metadata": { + "key": "osImageMetadata", + "type": "ImageMetadata", + }, + "connectivity_endpoints": { + "key": "connectivityEndpoints", + "type": "ComputeInstanceConnectivityEndpoints", + }, + "applications": { + "key": "applications", + "type": "[ComputeInstanceApplication]", + }, "created_by": {"key": "createdBy", "type": "ComputeInstanceCreatedBy"}, "errors": {"key": "errors", "type": "[ErrorResponse]"}, "state": {"key": "state", "type": "str"}, - "compute_instance_authorization_type": {"key": "computeInstanceAuthorizationType", "type": "str"}, + "compute_instance_authorization_type": { + "key": "computeInstanceAuthorizationType", + "type": "str", + }, "personal_compute_instance_settings": { "key": "personalComputeInstanceSettings", "type": "PersonalComputeInstanceSettings", }, "setup_scripts": {"key": "setupScripts", "type": "SetupScripts"}, - "last_operation": {"key": "lastOperation", "type": "ComputeInstanceLastOperation"}, + "last_operation": { + "key": "lastOperation", + "type": "ComputeInstanceLastOperation", + }, "schedules": {"key": "schedules", "type": "ComputeSchedules"}, - "idle_time_before_shutdown": {"key": "idleTimeBeforeShutdown", "type": "str"}, + "idle_time_before_shutdown": { + "key": "idleTimeBeforeShutdown", + "type": "str", + }, "enable_node_public_ip": {"key": "enableNodePublicIp", "type": "bool"}, - "containers": {"key": "containers", "type": "[ComputeInstanceContainer]"}, - "data_disks": {"key": "dataDisks", "type": "[ComputeInstanceDataDisk]"}, - "data_mounts": {"key": "dataMounts", "type": "[ComputeInstanceDataMount]"}, + "containers": { + "key": "containers", + "type": "[ComputeInstanceContainer]", + }, + "data_disks": { + "key": "dataDisks", + "type": "[ComputeInstanceDataDisk]", + }, + "data_mounts": { + "key": "dataMounts", + "type": "[ComputeInstanceDataMount]", + }, "versions": {"key": "versions", "type": "ComputeInstanceVersion"}, } @@ -6795,12 +7344,20 @@ def __init__( *, vm_size: Optional[str] = None, subnet: Optional["ResourceId"] = None, - application_sharing_policy: Optional[Union[str, "ApplicationSharingPolicy"]] = "Shared", - autologger_settings: Optional["ComputeInstanceAutologgerSettings"] = None, + application_sharing_policy: Optional[ + Union[str, "ApplicationSharingPolicy"] + ] = "Shared", + autologger_settings: Optional[ + "ComputeInstanceAutologgerSettings" + ] = None, ssh_settings: Optional["ComputeInstanceSshSettings"] = None, custom_services: Optional[List["CustomService"]] = None, - compute_instance_authorization_type: Optional[Union[str, "ComputeInstanceAuthorizationType"]] = "personal", - personal_compute_instance_settings: Optional["PersonalComputeInstanceSettings"] = None, + compute_instance_authorization_type: Optional[ + Union[str, "ComputeInstanceAuthorizationType"] + ] = "personal", + personal_compute_instance_settings: Optional[ + "PersonalComputeInstanceSettings" + ] = None, setup_scripts: Optional["SetupScripts"] = None, schedules: Optional["ComputeSchedules"] = None, idle_time_before_shutdown: Optional[str] = None, @@ -6860,8 +7417,12 @@ def __init__( self.created_by = None self.errors = None self.state = None - self.compute_instance_authorization_type = compute_instance_authorization_type - self.personal_compute_instance_settings = personal_compute_instance_settings + self.compute_instance_authorization_type = ( + compute_instance_authorization_type + ) + self.personal_compute_instance_settings = ( + personal_compute_instance_settings + ) self.setup_scripts = setup_scripts self.last_operation = None self.schedules = schedules @@ -6907,7 +7468,9 @@ class ComputeInstanceSshSettings(msrest.serialization.Model): def __init__( self, *, - ssh_public_access: Optional[Union[str, "SshPublicAccess"]] = "Disabled", + ssh_public_access: Optional[ + Union[str, "SshPublicAccess"] + ] = "Disabled", admin_public_key: Optional[str] = None, **kwargs ): @@ -7058,10 +7621,18 @@ class ComputeSchedules(msrest.serialization.Model): """ _attribute_map = { - "compute_start_stop": {"key": "computeStartStop", "type": "[ComputeStartStopSchedule]"}, + "compute_start_stop": { + "key": "computeStartStop", + "type": "[ComputeStartStopSchedule]", + }, } - def __init__(self, *, compute_start_stop: Optional[List["ComputeStartStopSchedule"]] = None, **kwargs): + def __init__( + self, + *, + compute_start_stop: Optional[List["ComputeStartStopSchedule"]] = None, + **kwargs + ): """ :keyword compute_start_stop: The list of compute start stop schedules to be applied. :paramtype compute_start_stop: @@ -7164,15 +7735,25 @@ class ContainerResourceRequirements(msrest.serialization.Model): """ _attribute_map = { - "container_resource_limits": {"key": "containerResourceLimits", "type": "ContainerResourceSettings"}, - "container_resource_requests": {"key": "containerResourceRequests", "type": "ContainerResourceSettings"}, + "container_resource_limits": { + "key": "containerResourceLimits", + "type": "ContainerResourceSettings", + }, + "container_resource_requests": { + "key": "containerResourceRequests", + "type": "ContainerResourceSettings", + }, } def __init__( self, *, - container_resource_limits: Optional["ContainerResourceSettings"] = None, - container_resource_requests: Optional["ContainerResourceSettings"] = None, + container_resource_limits: Optional[ + "ContainerResourceSettings" + ] = None, + container_resource_requests: Optional[ + "ContainerResourceSettings" + ] = None, **kwargs ): """ @@ -7208,7 +7789,14 @@ class ContainerResourceSettings(msrest.serialization.Model): "memory": {"key": "memory", "type": "str"}, } - def __init__(self, *, cpu: Optional[str] = None, gpu: Optional[str] = None, memory: Optional[str] = None, **kwargs): + def __init__( + self, + *, + cpu: Optional[str] = None, + gpu: Optional[str] = None, + memory: Optional[str] = None, + **kwargs + ): """ :keyword cpu: Number of vCPUs request/limit for container. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. @@ -7234,10 +7822,15 @@ class CosmosDbSettings(msrest.serialization.Model): """ _attribute_map = { - "collections_throughput": {"key": "collectionsThroughput", "type": "int"}, + "collections_throughput": { + "key": "collectionsThroughput", + "type": "int", + }, } - def __init__(self, *, collections_throughput: Optional[int] = None, **kwargs): + def __init__( + self, *, collections_throughput: Optional[int] = None, **kwargs + ): """ :keyword collections_throughput: The throughput of the collections in cosmosdb database. :paramtype collections_throughput: int @@ -7282,7 +7875,12 @@ class TriggerBase(msrest.serialization.Model): "trigger_type": {"key": "triggerType", "type": "str"}, } - _subtype_map = {"trigger_type": {"Cron": "CronTrigger", "Recurrence": "RecurrenceTrigger"}} + _subtype_map = { + "trigger_type": { + "Cron": "CronTrigger", + "Recurrence": "RecurrenceTrigger", + } + } def __init__( self, @@ -7377,7 +7975,12 @@ def __init__( The expression should follow NCronTab format. :paramtype expression: str """ - super(CronTrigger, self).__init__(end_time=end_time, start_time=start_time, time_zone=time_zone, **kwargs) + super(CronTrigger, self).__init__( + end_time=end_time, + start_time=start_time, + time_zone=time_zone, + **kwargs + ) self.trigger_type = "Cron" # type: str self.expression = expression @@ -7485,10 +8088,20 @@ class CustomInferencingServer(InferencingServer): _attribute_map = { "server_type": {"key": "serverType", "type": "str"}, - "inference_configuration": {"key": "inferenceConfiguration", "type": "OnlineInferenceConfiguration"}, + "inference_configuration": { + "key": "inferenceConfiguration", + "type": "OnlineInferenceConfiguration", + }, } - def __init__(self, *, inference_configuration: Optional["OnlineInferenceConfiguration"] = None, **kwargs): + def __init__( + self, + *, + inference_configuration: Optional[ + "OnlineInferenceConfiguration" + ] = None, + **kwargs + ): """ :keyword inference_configuration: Inference configuration for custom inferencing. :paramtype inference_configuration: @@ -7593,7 +8206,9 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(CustomModelJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(CustomModelJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri self.job_input_type = "custom_model" # type: str @@ -7705,7 +8320,12 @@ def __init__( :paramtype description: str """ super(CustomModelJobOutput, self).__init__( - description=description, asset_name=asset_name, asset_version=asset_version, mode=mode, uri=uri, **kwargs + description=description, + asset_name=asset_name, + asset_version=asset_version, + mode=mode, + uri=uri, + **kwargs ) self.asset_name = asset_name self.asset_version = asset_version @@ -7804,7 +8424,10 @@ class CustomService(msrest.serialization.Model): "additional_properties": {"key": "", "type": "{object}"}, "name": {"key": "name", "type": "str"}, "image": {"key": "image", "type": "Image"}, - "environment_variables": {"key": "environmentVariables", "type": "{EnvironmentVariable}"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{EnvironmentVariable}", + }, "docker": {"key": "docker", "type": "Docker"}, "endpoints": {"key": "endpoints", "type": "[Endpoint]"}, "volumes": {"key": "volumes", "type": "[VolumeDefinition]"}, @@ -7816,7 +8439,9 @@ def __init__( additional_properties: Optional[Dict[str, Any]] = None, name: Optional[str] = None, image: Optional["Image"] = None, - environment_variables: Optional[Dict[str, "EnvironmentVariable"]] = None, + environment_variables: Optional[ + Dict[str, "EnvironmentVariable"] + ] = None, docker: Optional["Docker"] = None, endpoints: Optional[List["Endpoint"]] = None, volumes: Optional[List["VolumeDefinition"]] = None, @@ -7925,7 +8550,9 @@ class DatabricksSchema(msrest.serialization.Model): "properties": {"key": "properties", "type": "DatabricksProperties"}, } - def __init__(self, *, properties: Optional["DatabricksProperties"] = None, **kwargs): + def __init__( + self, *, properties: Optional["DatabricksProperties"] = None, **kwargs + ): """ :keyword properties: Properties of Databricks. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties @@ -7990,7 +8617,10 @@ class Databricks(Compute, DatabricksSchema): "created_on": {"key": "createdOn", "type": "iso-8601"}, "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, "resource_id": {"key": "resourceId", "type": "str"}, - "provisioning_errors": {"key": "provisioningErrors", "type": "[ErrorResponse]"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } @@ -8047,10 +8677,15 @@ class DatabricksComputeSecretsProperties(msrest.serialization.Model): """ _attribute_map = { - "databricks_access_token": {"key": "databricksAccessToken", "type": "str"}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, } - def __init__(self, *, databricks_access_token: Optional[str] = None, **kwargs): + def __init__( + self, *, databricks_access_token: Optional[str] = None, **kwargs + ): """ :keyword databricks_access_token: access token for databricks account. :paramtype databricks_access_token: str @@ -8059,7 +8694,9 @@ def __init__(self, *, databricks_access_token: Optional[str] = None, **kwargs): self.databricks_access_token = databricks_access_token -class DatabricksComputeSecrets(ComputeSecrets, DatabricksComputeSecretsProperties): +class DatabricksComputeSecrets( + ComputeSecrets, DatabricksComputeSecretsProperties +): """Secrets related to a Machine Learning compute based on Databricks. All required parameters must be populated in order to send to Azure. @@ -8077,16 +8714,23 @@ class DatabricksComputeSecrets(ComputeSecrets, DatabricksComputeSecretsPropertie } _attribute_map = { - "databricks_access_token": {"key": "databricksAccessToken", "type": "str"}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, "compute_type": {"key": "computeType", "type": "str"}, } - def __init__(self, *, databricks_access_token: Optional[str] = None, **kwargs): + def __init__( + self, *, databricks_access_token: Optional[str] = None, **kwargs + ): """ :keyword databricks_access_token: access token for databricks account. :paramtype databricks_access_token: str """ - super(DatabricksComputeSecrets, self).__init__(databricks_access_token=databricks_access_token, **kwargs) + super(DatabricksComputeSecrets, self).__init__( + databricks_access_token=databricks_access_token, **kwargs + ) self.databricks_access_token = databricks_access_token self.compute_type = "Databricks" # type: str @@ -8101,11 +8745,20 @@ class DatabricksProperties(msrest.serialization.Model): """ _attribute_map = { - "databricks_access_token": {"key": "databricksAccessToken", "type": "str"}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, "workspace_url": {"key": "workspaceUrl", "type": "str"}, } - def __init__(self, *, databricks_access_token: Optional[str] = None, workspace_url: Optional[str] = None, **kwargs): + def __init__( + self, + *, + databricks_access_token: Optional[str] = None, + workspace_url: Optional[str] = None, + **kwargs + ): """ :keyword databricks_access_token: Databricks access token. :paramtype databricks_access_token: str @@ -8228,7 +8881,11 @@ def __init__( :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType """ super(DataContainerProperties, self).__init__( - description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs ) self.data_type = data_type @@ -8248,7 +8905,13 @@ class DataContainerResourceArmPaginatedResult(msrest.serialization.Model): "value": {"key": "value", "type": "[DataContainer]"}, } - def __init__(self, *, next_link: Optional[str] = None, value: Optional[List["DataContainer"]] = None, **kwargs): + def __init__( + self, + *, + next_link: Optional[str] = None, + value: Optional[List["DataContainer"]] = None, + **kwargs + ): """ :keyword next_link: The link to the next page of DataContainer objects. If null, there are no additional pages. @@ -8314,7 +8977,10 @@ class DataFactory(Compute): "created_on": {"key": "createdOn", "type": "iso-8601"}, "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, "resource_id": {"key": "resourceId", "type": "str"}, - "provisioning_errors": {"key": "provisioningErrors", "type": "[ErrorResponse]"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } @@ -8358,10 +9024,18 @@ class DataLakeAnalyticsSchema(msrest.serialization.Model): """ _attribute_map = { - "properties": {"key": "properties", "type": "DataLakeAnalyticsSchemaProperties"}, + "properties": { + "key": "properties", + "type": "DataLakeAnalyticsSchemaProperties", + }, } - def __init__(self, *, properties: Optional["DataLakeAnalyticsSchemaProperties"] = None, **kwargs): + def __init__( + self, + *, + properties: Optional["DataLakeAnalyticsSchemaProperties"] = None, + **kwargs + ): """ :keyword properties: :paramtype properties: @@ -8420,7 +9094,10 @@ class DataLakeAnalytics(Compute, DataLakeAnalyticsSchema): } _attribute_map = { - "properties": {"key": "properties", "type": "DataLakeAnalyticsSchemaProperties"}, + "properties": { + "key": "properties", + "type": "DataLakeAnalyticsSchemaProperties", + }, "compute_type": {"key": "computeType", "type": "str"}, "compute_location": {"key": "computeLocation", "type": "str"}, "provisioning_state": {"key": "provisioningState", "type": "str"}, @@ -8428,7 +9105,10 @@ class DataLakeAnalytics(Compute, DataLakeAnalyticsSchema): "created_on": {"key": "createdOn", "type": "iso-8601"}, "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, "resource_id": {"key": "resourceId", "type": "str"}, - "provisioning_errors": {"key": "provisioningErrors", "type": "[ErrorResponse]"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } @@ -8486,10 +9166,15 @@ class DataLakeAnalyticsSchemaProperties(msrest.serialization.Model): """ _attribute_map = { - "data_lake_store_account_name": {"key": "dataLakeStoreAccountName", "type": "str"}, + "data_lake_store_account_name": { + "key": "dataLakeStoreAccountName", + "type": "str", + }, } - def __init__(self, *, data_lake_store_account_name: Optional[str] = None, **kwargs): + def __init__( + self, *, data_lake_store_account_name: Optional[str] = None, **kwargs + ): """ :keyword data_lake_store_account_name: DataLake Store Account Name. :paramtype data_lake_store_account_name: str @@ -8522,7 +9207,13 @@ class DataPathAssetReference(AssetReferenceBase): "path": {"key": "path", "type": "str"}, } - def __init__(self, *, datastore_id: Optional[str] = None, path: Optional[str] = None, **kwargs): + def __init__( + self, + *, + datastore_id: Optional[str] = None, + path: Optional[str] = None, + **kwargs + ): """ :keyword datastore_id: ARM resource ID of the datastore where the asset is located. :paramtype datastore_id: str @@ -8644,7 +9335,13 @@ class DatastoreResourceArmPaginatedResult(msrest.serialization.Model): "value": {"key": "value", "type": "[Datastore]"}, } - def __init__(self, *, next_link: Optional[str] = None, value: Optional[List["Datastore"]] = None, **kwargs): + def __init__( + self, + *, + next_link: Optional[str] = None, + value: Optional[List["Datastore"]] = None, + **kwargs + ): """ :keyword next_link: The link to the next page of Datastore objects. If null, there are no additional pages. @@ -8692,7 +9389,10 @@ class DataVersionBase(Resource): "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "DataVersionBaseProperties"}, + "properties": { + "key": "properties", + "type": "DataVersionBaseProperties", + }, } def __init__(self, *, properties: "DataVersionBaseProperties", **kwargs): @@ -8746,7 +9446,11 @@ class DataVersionBaseProperties(AssetBase): } _subtype_map = { - "data_type": {"mltable": "MLTableData", "uri_file": "UriFileDataVersion", "uri_folder": "UriFolderDataVersion"} + "data_type": { + "mltable": "MLTableData", + "uri_file": "UriFileDataVersion", + "uri_folder": "UriFolderDataVersion", + } } def __init__( @@ -8802,7 +9506,13 @@ class DataVersionBaseResourceArmPaginatedResult(msrest.serialization.Model): "value": {"key": "value", "type": "[DataVersionBase]"}, } - def __init__(self, *, next_link: Optional[str] = None, value: Optional[List["DataVersionBase"]] = None, **kwargs): + def __init__( + self, + *, + next_link: Optional[str] = None, + value: Optional[List["DataVersionBase"]] = None, + **kwargs + ): """ :keyword next_link: The link to the next page of DataVersionBase objects. If null, there are no additional pages. @@ -8810,7 +9520,9 @@ def __init__(self, *, next_link: Optional[str] = None, value: Optional[List["Dat :keyword value: An array of objects of type DataVersionBase. :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBase] """ - super(DataVersionBaseResourceArmPaginatedResult, self).__init__(**kwargs) + super(DataVersionBaseResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -8837,7 +9549,10 @@ class OnlineScaleSettings(msrest.serialization.Model): } _subtype_map = { - "scale_type": {"Default": "DefaultScaleSettings", "TargetUtilization": "TargetUtilizationScaleSettings"} + "scale_type": { + "Default": "DefaultScaleSettings", + "TargetUtilization": "TargetUtilizationScaleSettings", + } } def __init__(self, **kwargs): @@ -8906,7 +9621,11 @@ class DeploymentLogsRequest(msrest.serialization.Model): } def __init__( - self, *, container_type: Optional[Union[str, "ContainerType"]] = None, tail: Optional[int] = None, **kwargs + self, + *, + container_type: Optional[Union[str, "ContainerType"]] = None, + tail: Optional[int] = None, + **kwargs ): """ :keyword container_type: The type of container to retrieve logs from. Possible values include: @@ -9045,7 +9764,10 @@ class DiagnoseRequestProperties(msrest.serialization.Model): "storage_account": {"key": "storageAccount", "type": "{object}"}, "key_vault": {"key": "keyVault", "type": "{object}"}, "container_registry": {"key": "containerRegistry", "type": "{object}"}, - "application_insights": {"key": "applicationInsights", "type": "{object}"}, + "application_insights": { + "key": "applicationInsights", + "type": "{object}", + }, "others": {"key": "others", "type": "{object}"}, } @@ -9106,7 +9828,12 @@ class DiagnoseResponseResult(msrest.serialization.Model): "value": {"key": "value", "type": "DiagnoseResponseResultValue"}, } - def __init__(self, *, value: Optional["DiagnoseResponseResultValue"] = None, **kwargs): + def __init__( + self, + *, + value: Optional["DiagnoseResponseResultValue"] = None, + **kwargs + ): """ :keyword value: :paramtype value: ~azure.mgmt.machinelearningservices.models.DiagnoseResponseResultValue @@ -9145,14 +9872,38 @@ class DiagnoseResponseResultValue(msrest.serialization.Model): """ _attribute_map = { - "user_defined_route_results": {"key": "userDefinedRouteResults", "type": "[DiagnoseResult]"}, - "network_security_rule_results": {"key": "networkSecurityRuleResults", "type": "[DiagnoseResult]"}, - "resource_lock_results": {"key": "resourceLockResults", "type": "[DiagnoseResult]"}, - "dns_resolution_results": {"key": "dnsResolutionResults", "type": "[DiagnoseResult]"}, - "storage_account_results": {"key": "storageAccountResults", "type": "[DiagnoseResult]"}, - "key_vault_results": {"key": "keyVaultResults", "type": "[DiagnoseResult]"}, - "container_registry_results": {"key": "containerRegistryResults", "type": "[DiagnoseResult]"}, - "application_insights_results": {"key": "applicationInsightsResults", "type": "[DiagnoseResult]"}, + "user_defined_route_results": { + "key": "userDefinedRouteResults", + "type": "[DiagnoseResult]", + }, + "network_security_rule_results": { + "key": "networkSecurityRuleResults", + "type": "[DiagnoseResult]", + }, + "resource_lock_results": { + "key": "resourceLockResults", + "type": "[DiagnoseResult]", + }, + "dns_resolution_results": { + "key": "dnsResolutionResults", + "type": "[DiagnoseResult]", + }, + "storage_account_results": { + "key": "storageAccountResults", + "type": "[DiagnoseResult]", + }, + "key_vault_results": { + "key": "keyVaultResults", + "type": "[DiagnoseResult]", + }, + "container_registry_results": { + "key": "containerRegistryResults", + "type": "[DiagnoseResult]", + }, + "application_insights_results": { + "key": "applicationInsightsResults", + "type": "[DiagnoseResult]", + }, "other_results": {"key": "otherResults", "type": "[DiagnoseResult]"}, } @@ -9254,7 +10005,9 @@ class DiagnoseWorkspaceParameters(msrest.serialization.Model): "value": {"key": "value", "type": "DiagnoseRequestProperties"}, } - def __init__(self, *, value: Optional["DiagnoseRequestProperties"] = None, **kwargs): + def __init__( + self, *, value: Optional["DiagnoseRequestProperties"] = None, **kwargs + ): """ :keyword value: Value of Parameters. :paramtype value: ~azure.mgmt.machinelearningservices.models.DiagnoseRequestProperties @@ -9284,7 +10037,13 @@ class DistributionConfiguration(msrest.serialization.Model): "distribution_type": {"key": "distributionType", "type": "str"}, } - _subtype_map = {"distribution_type": {"Mpi": "Mpi", "PyTorch": "PyTorch", "TensorFlow": "TensorFlow"}} + _subtype_map = { + "distribution_type": { + "Mpi": "Mpi", + "PyTorch": "PyTorch", + "TensorFlow": "TensorFlow", + } + } def __init__(self, **kwargs): """ """ @@ -9308,7 +10067,11 @@ class Docker(msrest.serialization.Model): } def __init__( - self, *, additional_properties: Optional[Dict[str, Any]] = None, privileged: Optional[bool] = None, **kwargs + self, + *, + additional_properties: Optional[Dict[str, Any]] = None, + privileged: Optional[bool] = None, + **kwargs ): """ :keyword additional_properties: Unmatched properties from the message are deserialized to this @@ -9349,7 +10112,12 @@ class EncryptionKeyVaultProperties(msrest.serialization.Model): } def __init__( - self, *, key_vault_arm_id: str, key_identifier: str, identity_client_id: Optional[str] = None, **kwargs + self, + *, + key_vault_arm_id: str, + key_identifier: str, + identity_client_id: Optional[str] = None, + **kwargs ): """ :keyword key_vault_arm_id: Required. The ArmId of the keyVault where the customer owned @@ -9416,7 +10184,10 @@ class EncryptionProperty(msrest.serialization.Model): _attribute_map = { "status": {"key": "status", "type": "str"}, "identity": {"key": "identity", "type": "IdentityForCmk"}, - "key_vault_properties": {"key": "keyVaultProperties", "type": "EncryptionKeyVaultProperties"}, + "key_vault_properties": { + "key": "keyVaultProperties", + "type": "EncryptionKeyVaultProperties", + }, } def __init__( @@ -9459,10 +10230,18 @@ class EncryptionUpdateProperties(msrest.serialization.Model): } _attribute_map = { - "key_vault_properties": {"key": "keyVaultProperties", "type": "EncryptionKeyVaultUpdateProperties"}, + "key_vault_properties": { + "key": "keyVaultProperties", + "type": "EncryptionKeyVaultUpdateProperties", + }, } - def __init__(self, *, key_vault_properties: "EncryptionKeyVaultUpdateProperties", **kwargs): + def __init__( + self, + *, + key_vault_properties: "EncryptionKeyVaultUpdateProperties", + **kwargs + ): """ :keyword key_vault_properties: Required. Customer Key vault properties. :paramtype key_vault_properties: @@ -9541,7 +10320,13 @@ class EndpointAuthKeys(msrest.serialization.Model): "secondary_key": {"key": "secondaryKey", "type": "str"}, } - def __init__(self, *, primary_key: Optional[str] = None, secondary_key: Optional[str] = None, **kwargs): + def __init__( + self, + *, + primary_key: Optional[str] = None, + secondary_key: Optional[str] = None, + **kwargs + ): """ :keyword primary_key: The primary key. :paramtype primary_key: str @@ -9569,7 +10354,10 @@ class EndpointAuthToken(msrest.serialization.Model): _attribute_map = { "access_token": {"key": "accessToken", "type": "str"}, "expiry_time_utc": {"key": "expiryTimeUtc", "type": "long"}, - "refresh_after_time_utc": {"key": "refreshAfterTimeUtc", "type": "long"}, + "refresh_after_time_utc": { + "key": "refreshAfterTimeUtc", + "type": "long", + }, "token_type": {"key": "tokenType", "type": "str"}, } @@ -9620,7 +10408,12 @@ class ScheduleActionBase(msrest.serialization.Model): "action_type": {"key": "actionType", "type": "str"}, } - _subtype_map = {"action_type": {"CreateJob": "JobScheduleAction", "InvokeBatchEndpoint": "EndpointScheduleAction"}} + _subtype_map = { + "action_type": { + "CreateJob": "JobScheduleAction", + "InvokeBatchEndpoint": "EndpointScheduleAction", + } + } def __init__(self, **kwargs): """ """ @@ -9653,7 +10446,10 @@ class EndpointScheduleAction(ScheduleActionBase): _attribute_map = { "action_type": {"key": "actionType", "type": "str"}, - "endpoint_invocation_definition": {"key": "endpointInvocationDefinition", "type": "object"}, + "endpoint_invocation_definition": { + "key": "endpointInvocationDefinition", + "type": "object", + }, } def __init__(self, *, endpoint_invocation_definition: Any, **kwargs): @@ -9707,10 +10503,15 @@ class EnvironmentContainer(Resource): "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "EnvironmentContainerProperties"}, + "properties": { + "key": "properties", + "type": "EnvironmentContainerProperties", + }, } - def __init__(self, *, properties: "EnvironmentContainerProperties", **kwargs): + def __init__( + self, *, properties: "EnvironmentContainerProperties", **kwargs + ): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: @@ -9779,12 +10580,18 @@ def __init__( :paramtype is_archived: bool """ super(EnvironmentContainerProperties, self).__init__( - description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs ) self.provisioning_state = None -class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model): +class EnvironmentContainerResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of EnvironmentContainer entities. :ivar next_link: The link to the next page of EnvironmentContainer objects. If null, there are @@ -9800,7 +10607,11 @@ class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model) } def __init__( - self, *, next_link: Optional[str] = None, value: Optional[List["EnvironmentContainer"]] = None, **kwargs + self, + *, + next_link: Optional[str] = None, + value: Optional[List["EnvironmentContainer"]] = None, + **kwargs ): """ :keyword next_link: The link to the next page of EnvironmentContainer objects. If null, there @@ -9809,7 +10620,9 @@ def __init__( :keyword value: An array of objects of type EnvironmentContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] """ - super(EnvironmentContainerResourceArmPaginatedResult, self).__init__(**kwargs) + super(EnvironmentContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -9892,10 +10705,15 @@ class EnvironmentVersion(Resource): "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "EnvironmentVersionProperties"}, + "properties": { + "key": "properties", + "type": "EnvironmentVersionProperties", + }, } - def __init__(self, *, properties: "EnvironmentVersionProperties", **kwargs): + def __init__( + self, *, properties: "EnvironmentVersionProperties", **kwargs + ): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionProperties @@ -9980,7 +10798,10 @@ class EnvironmentVersionProperties(AssetBase): "conda_file": {"key": "condaFile", "type": "str"}, "environment_type": {"key": "environmentType", "type": "str"}, "image": {"key": "image", "type": "str"}, - "inference_config": {"key": "inferenceConfig", "type": "InferenceContainerProperties"}, + "inference_config": { + "key": "inferenceConfig", + "type": "InferenceContainerProperties", + }, "os_type": {"key": "osType", "type": "str"}, "provisioning_state": {"key": "provisioningState", "type": "str"}, } @@ -10076,7 +10897,11 @@ class EnvironmentVersionResourceArmPaginatedResult(msrest.serialization.Model): } def __init__( - self, *, next_link: Optional[str] = None, value: Optional[List["EnvironmentVersion"]] = None, **kwargs + self, + *, + next_link: Optional[str] = None, + value: Optional[List["EnvironmentVersion"]] = None, + **kwargs ): """ :keyword next_link: The link to the next page of EnvironmentVersion objects. If null, there are @@ -10085,7 +10910,9 @@ def __init__( :keyword value: An array of objects of type EnvironmentVersion. :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] """ - super(EnvironmentVersionResourceArmPaginatedResult, self).__init__(**kwargs) + super(EnvironmentVersionResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -10148,7 +10975,10 @@ class ErrorDetail(msrest.serialization.Model): "message": {"key": "message", "type": "str"}, "target": {"key": "target", "type": "str"}, "details": {"key": "details", "type": "[ErrorDetail]"}, - "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"}, + "additional_info": { + "key": "additionalInfo", + "type": "[ErrorAdditionalInfo]", + }, } def __init__(self, **kwargs): @@ -10209,7 +11039,12 @@ class EstimatedVMPrice(msrest.serialization.Model): } def __init__( - self, *, retail_price: float, os_type: Union[str, "VMPriceOSType"], vm_tier: Union[str, "VMTier"], **kwargs + self, + *, + retail_price: float, + os_type: Union[str, "VMPriceOSType"], + vm_tier: Union[str, "VMTier"], + **kwargs ): """ :keyword retail_price: Required. The price charged for using the VM. @@ -10291,7 +11126,9 @@ class ExternalFQDNResponse(msrest.serialization.Model): "value": {"key": "value", "type": "[FQDNEndpoints]"}, } - def __init__(self, *, value: Optional[List["FQDNEndpoints"]] = None, **kwargs): + def __init__( + self, *, value: Optional[List["FQDNEndpoints"]] = None, **kwargs + ): """ :keyword value: :paramtype value: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoints] @@ -10363,7 +11200,13 @@ class FeatureArmPaginatedResult(msrest.serialization.Model): "value": {"key": "value", "type": "[Feature]"}, } - def __init__(self, *, next_link: Optional[str] = None, value: Optional[List["Feature"]] = None, **kwargs): + def __init__( + self, + *, + next_link: Optional[str] = None, + value: Optional[List["Feature"]] = None, + **kwargs + ): """ :keyword next_link: The link to the next page of Feature objects. If null, there are no additional pages. @@ -10411,10 +11254,15 @@ class FeaturesetContainer(Resource): "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "FeaturesetContainerProperties"}, + "properties": { + "key": "properties", + "type": "FeaturesetContainerProperties", + }, } - def __init__(self, *, properties: "FeaturesetContainerProperties", **kwargs): + def __init__( + self, *, properties: "FeaturesetContainerProperties", **kwargs + ): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetContainerProperties @@ -10482,12 +11330,18 @@ def __init__( :paramtype is_archived: bool """ super(FeaturesetContainerProperties, self).__init__( - description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs ) self.provisioning_state = None -class FeaturesetContainerResourceArmPaginatedResult(msrest.serialization.Model): +class FeaturesetContainerResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of FeaturesetContainer entities. :ivar next_link: The link to the next page of FeaturesetContainer objects. If null, there are @@ -10503,7 +11357,11 @@ class FeaturesetContainerResourceArmPaginatedResult(msrest.serialization.Model): } def __init__( - self, *, next_link: Optional[str] = None, value: Optional[List["FeaturesetContainer"]] = None, **kwargs + self, + *, + next_link: Optional[str] = None, + value: Optional[List["FeaturesetContainer"]] = None, + **kwargs ): """ :keyword next_link: The link to the next page of FeaturesetContainer objects. If null, there @@ -10512,7 +11370,9 @@ def __init__( :keyword value: An array of objects of type FeaturesetContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetContainer] """ - super(FeaturesetContainerResourceArmPaginatedResult, self).__init__(**kwargs) + super(FeaturesetContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -10619,7 +11479,13 @@ class FeaturesetJobArmPaginatedResult(msrest.serialization.Model): "value": {"key": "value", "type": "[FeaturesetJob]"}, } - def __init__(self, *, next_link: Optional[str] = None, value: Optional[List["FeaturesetJob"]] = None, **kwargs): + def __init__( + self, + *, + next_link: Optional[str] = None, + value: Optional[List["FeaturesetJob"]] = None, + **kwargs + ): """ :keyword next_link: The link to the next page of FeaturesetJob objects. If null, there are no additional pages. @@ -10687,7 +11553,10 @@ class FeaturesetVersion(Resource): "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "FeaturesetVersionProperties"}, + "properties": { + "key": "properties", + "type": "FeaturesetVersionProperties", + }, } def __init__(self, *, properties: "FeaturesetVersionProperties", **kwargs): @@ -10720,7 +11589,10 @@ class FeaturesetVersionBackfillRequest(msrest.serialization.Model): "description": {"key": "description", "type": "str"}, "display_name": {"key": "displayName", "type": "str"}, "feature_window": {"key": "featureWindow", "type": "FeatureWindow"}, - "resource": {"key": "resource", "type": "MaterializationComputeResource"}, + "resource": { + "key": "resource", + "type": "MaterializationComputeResource", + }, "spark_configuration": {"key": "sparkConfiguration", "type": "{str}"}, "tags": {"key": "tags", "type": "{str}"}, } @@ -10820,9 +11692,15 @@ class FeaturesetVersionProperties(AssetBase): "is_anonymous": {"key": "isAnonymous", "type": "bool"}, "is_archived": {"key": "isArchived", "type": "bool"}, "entities": {"key": "entities", "type": "[str]"}, - "materialization_settings": {"key": "materializationSettings", "type": "MaterializationSettings"}, + "materialization_settings": { + "key": "materializationSettings", + "type": "MaterializationSettings", + }, "provisioning_state": {"key": "provisioningState", "type": "str"}, - "specification": {"key": "specification", "type": "FeaturesetSpecification"}, + "specification": { + "key": "specification", + "type": "FeaturesetSpecification", + }, "stage": {"key": "stage", "type": "str"}, } @@ -10891,7 +11769,13 @@ class FeaturesetVersionResourceArmPaginatedResult(msrest.serialization.Model): "value": {"key": "value", "type": "[FeaturesetVersion]"}, } - def __init__(self, *, next_link: Optional[str] = None, value: Optional[List["FeaturesetVersion"]] = None, **kwargs): + def __init__( + self, + *, + next_link: Optional[str] = None, + value: Optional[List["FeaturesetVersion"]] = None, + **kwargs + ): """ :keyword next_link: The link to the next page of FeaturesetVersion objects. If null, there are no additional pages. @@ -10899,7 +11783,9 @@ def __init__(self, *, next_link: Optional[str] = None, value: Optional[List["Fea :keyword value: An array of objects of type FeaturesetVersion. :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetVersion] """ - super(FeaturesetVersionResourceArmPaginatedResult, self).__init__(**kwargs) + super(FeaturesetVersionResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -10940,10 +11826,15 @@ class FeaturestoreEntityContainer(Resource): "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "FeaturestoreEntityContainerProperties"}, + "properties": { + "key": "properties", + "type": "FeaturestoreEntityContainerProperties", + }, } - def __init__(self, *, properties: "FeaturestoreEntityContainerProperties", **kwargs): + def __init__( + self, *, properties: "FeaturestoreEntityContainerProperties", **kwargs + ): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: @@ -11012,12 +11903,18 @@ def __init__( :paramtype is_archived: bool """ super(FeaturestoreEntityContainerProperties, self).__init__( - description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs ) self.provisioning_state = None -class FeaturestoreEntityContainerResourceArmPaginatedResult(msrest.serialization.Model): +class FeaturestoreEntityContainerResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of FeaturestoreEntityContainer entities. :ivar next_link: The link to the next page of FeaturestoreEntityContainer objects. If null, @@ -11033,7 +11930,11 @@ class FeaturestoreEntityContainerResourceArmPaginatedResult(msrest.serialization } def __init__( - self, *, next_link: Optional[str] = None, value: Optional[List["FeaturestoreEntityContainer"]] = None, **kwargs + self, + *, + next_link: Optional[str] = None, + value: Optional[List["FeaturestoreEntityContainer"]] = None, + **kwargs ): """ :keyword next_link: The link to the next page of FeaturestoreEntityContainer objects. If null, @@ -11042,7 +11943,9 @@ def __init__( :keyword value: An array of objects of type FeaturestoreEntityContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer] """ - super(FeaturestoreEntityContainerResourceArmPaginatedResult, self).__init__(**kwargs) + super( + FeaturestoreEntityContainerResourceArmPaginatedResult, self + ).__init__(**kwargs) self.next_link = next_link self.value = value @@ -11083,10 +11986,15 @@ class FeaturestoreEntityVersion(Resource): "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "FeaturestoreEntityVersionProperties"}, + "properties": { + "key": "properties", + "type": "FeaturestoreEntityVersionProperties", + }, } - def __init__(self, *, properties: "FeaturestoreEntityVersionProperties", **kwargs): + def __init__( + self, *, properties: "FeaturestoreEntityVersionProperties", **kwargs + ): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: @@ -11170,7 +12078,9 @@ def __init__( self.provisioning_state = None -class FeaturestoreEntityVersionResourceArmPaginatedResult(msrest.serialization.Model): +class FeaturestoreEntityVersionResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of FeaturestoreEntityVersion entities. :ivar next_link: The link to the next page of FeaturestoreEntityVersion objects. If null, there @@ -11186,7 +12096,11 @@ class FeaturestoreEntityVersionResourceArmPaginatedResult(msrest.serialization.M } def __init__( - self, *, next_link: Optional[str] = None, value: Optional[List["FeaturestoreEntityVersion"]] = None, **kwargs + self, + *, + next_link: Optional[str] = None, + value: Optional[List["FeaturestoreEntityVersion"]] = None, + **kwargs ): """ :keyword next_link: The link to the next page of FeaturestoreEntityVersion objects. If null, @@ -11195,7 +12109,9 @@ def __init__( :keyword value: An array of objects of type FeaturestoreEntityVersion. :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion] """ - super(FeaturestoreEntityVersionResourceArmPaginatedResult, self).__init__(**kwargs) + super( + FeaturestoreEntityVersionResourceArmPaginatedResult, self + ).__init__(**kwargs) self.next_link = next_link self.value = value @@ -11211,7 +12127,10 @@ class FeatureWindow(msrest.serialization.Model): _attribute_map = { "feature_window_end": {"key": "featureWindowEnd", "type": "iso-8601"}, - "feature_window_start": {"key": "featureWindowStart", "type": "iso-8601"}, + "feature_window_start": { + "key": "featureWindowStart", + "type": "iso-8601", + }, } def __init__( @@ -11343,25 +12262,55 @@ class Forecasting(AutoMLVertical, TableVertical): } _attribute_map = { - "cv_split_column_names": {"key": "cvSplitColumnNames", "type": "[str]"}, - "featurization_settings": {"key": "featurizationSettings", "type": "TableVerticalFeaturizationSettings"}, - "fixed_parameters": {"key": "fixedParameters", "type": "TableFixedParameters"}, - "limit_settings": {"key": "limitSettings", "type": "TableVerticalLimitSettings"}, - "n_cross_validations": {"key": "nCrossValidations", "type": "NCrossValidations"}, - "search_space": {"key": "searchSpace", "type": "[TableParameterSubspace]"}, - "sweep_settings": {"key": "sweepSettings", "type": "TableSweepSettings"}, + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "TableFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "search_space": { + "key": "searchSpace", + "type": "[TableParameterSubspace]", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "TableSweepSettings", + }, "test_data": {"key": "testData", "type": "MLTableJobInput"}, "test_data_size": {"key": "testDataSize", "type": "float"}, - "validation_data": {"key": "validationData", "type": "MLTableJobInput"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, "validation_data_size": {"key": "validationDataSize", "type": "float"}, "weight_column_name": {"key": "weightColumnName", "type": "str"}, "log_verbosity": {"key": "logVerbosity", "type": "str"}, "target_column_name": {"key": "targetColumnName", "type": "str"}, "task_type": {"key": "taskType", "type": "str"}, "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, - "forecasting_settings": {"key": "forecastingSettings", "type": "ForecastingSettings"}, + "forecasting_settings": { + "key": "forecastingSettings", + "type": "ForecastingSettings", + }, "primary_metric": {"key": "primaryMetric", "type": "str"}, - "training_settings": {"key": "trainingSettings", "type": "ForecastingTrainingSettings"}, + "training_settings": { + "key": "trainingSettings", + "type": "ForecastingTrainingSettings", + }, } def __init__( @@ -11369,7 +12318,9 @@ def __init__( *, training_data: "MLTableJobInput", cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "TableVerticalFeaturizationSettings" + ] = None, fixed_parameters: Optional["TableFixedParameters"] = None, limit_settings: Optional["TableVerticalLimitSettings"] = None, n_cross_validations: Optional["NCrossValidations"] = None, @@ -11383,7 +12334,9 @@ def __init__( log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, forecasting_settings: Optional["ForecastingSettings"] = None, - primary_metric: Optional[Union[str, "ForecastingPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "ForecastingPrimaryMetrics"] + ] = None, training_settings: Optional["ForecastingTrainingSettings"] = None, **kwargs ): @@ -11539,18 +12492,36 @@ class ForecastingSettings(msrest.serialization.Model): """ _attribute_map = { - "country_or_region_for_holidays": {"key": "countryOrRegionForHolidays", "type": "str"}, + "country_or_region_for_holidays": { + "key": "countryOrRegionForHolidays", + "type": "str", + }, "cv_step_size": {"key": "cvStepSize", "type": "int"}, "feature_lags": {"key": "featureLags", "type": "str"}, - "forecast_horizon": {"key": "forecastHorizon", "type": "ForecastHorizon"}, + "forecast_horizon": { + "key": "forecastHorizon", + "type": "ForecastHorizon", + }, "frequency": {"key": "frequency", "type": "str"}, "seasonality": {"key": "seasonality", "type": "Seasonality"}, - "short_series_handling_config": {"key": "shortSeriesHandlingConfig", "type": "str"}, - "target_aggregate_function": {"key": "targetAggregateFunction", "type": "str"}, + "short_series_handling_config": { + "key": "shortSeriesHandlingConfig", + "type": "str", + }, + "target_aggregate_function": { + "key": "targetAggregateFunction", + "type": "str", + }, "target_lags": {"key": "targetLags", "type": "TargetLags"}, - "target_rolling_window_size": {"key": "targetRollingWindowSize", "type": "TargetRollingWindowSize"}, + "target_rolling_window_size": { + "key": "targetRollingWindowSize", + "type": "TargetRollingWindowSize", + }, "time_column_name": {"key": "timeColumnName", "type": "str"}, - "time_series_id_column_names": {"key": "timeSeriesIdColumnNames", "type": "[str]"}, + "time_series_id_column_names": { + "key": "timeSeriesIdColumnNames", + "type": "[str]", + }, "use_stl": {"key": "useStl", "type": "str"}, } @@ -11563,8 +12534,12 @@ def __init__( forecast_horizon: Optional["ForecastHorizon"] = None, frequency: Optional[str] = None, seasonality: Optional["Seasonality"] = None, - short_series_handling_config: Optional[Union[str, "ShortSeriesHandlingConfiguration"]] = None, - target_aggregate_function: Optional[Union[str, "TargetAggregationFunction"]] = None, + short_series_handling_config: Optional[ + Union[str, "ShortSeriesHandlingConfiguration"] + ] = None, + target_aggregate_function: Optional[ + Union[str, "TargetAggregationFunction"] + ] = None, target_lags: Optional["TargetLags"] = None, target_rolling_window_size: Optional["TargetRollingWindowSize"] = None, time_column_name: Optional[str] = None, @@ -11679,15 +12654,36 @@ class ForecastingTrainingSettings(TrainingSettings): _attribute_map = { "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, - "enable_model_explainability": {"key": "enableModelExplainability", "type": "bool"}, - "enable_onnx_compatible_models": {"key": "enableOnnxCompatibleModels", "type": "bool"}, - "enable_stack_ensemble": {"key": "enableStackEnsemble", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, - "ensemble_model_download_timeout": {"key": "ensembleModelDownloadTimeout", "type": "duration"}, - "stack_ensemble_settings": {"key": "stackEnsembleSettings", "type": "StackEnsembleSettings"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, "training_mode": {"key": "trainingMode", "type": "str"}, - "allowed_training_algorithms": {"key": "allowedTrainingAlgorithms", "type": "[str]"}, - "blocked_training_algorithms": {"key": "blockedTrainingAlgorithms", "type": "[str]"}, + "allowed_training_algorithms": { + "key": "allowedTrainingAlgorithms", + "type": "[str]", + }, + "blocked_training_algorithms": { + "key": "blockedTrainingAlgorithms", + "type": "[str]", + }, } def __init__( @@ -11701,8 +12697,12 @@ def __init__( ensemble_model_download_timeout: Optional[datetime.timedelta] = "PT5M", stack_ensemble_settings: Optional["StackEnsembleSettings"] = None, training_mode: Optional[Union[str, "TrainingMode"]] = None, - allowed_training_algorithms: Optional[List[Union[str, "ForecastingModels"]]] = None, - blocked_training_algorithms: Optional[List[Union[str, "ForecastingModels"]]] = None, + allowed_training_algorithms: Optional[ + List[Union[str, "ForecastingModels"]] + ] = None, + blocked_training_algorithms: Optional[ + List[Union[str, "ForecastingModels"]] + ] = None, **kwargs ): """ @@ -11764,7 +12764,10 @@ class FQDNEndpoint(msrest.serialization.Model): _attribute_map = { "domain_name": {"key": "domainName", "type": "str"}, - "endpoint_details": {"key": "endpointDetails", "type": "[FQDNEndpointDetail]"}, + "endpoint_details": { + "key": "endpointDetails", + "type": "[FQDNEndpointDetail]", + }, } def __init__( @@ -11817,7 +12820,12 @@ class FQDNEndpoints(msrest.serialization.Model): "properties": {"key": "properties", "type": "FQDNEndpointsProperties"}, } - def __init__(self, *, properties: Optional["FQDNEndpointsProperties"] = None, **kwargs): + def __init__( + self, + *, + properties: Optional["FQDNEndpointsProperties"] = None, + **kwargs + ): """ :keyword properties: :paramtype properties: ~azure.mgmt.machinelearningservices.models.FQDNEndpointsProperties @@ -11840,7 +12848,13 @@ class FQDNEndpointsProperties(msrest.serialization.Model): "endpoints": {"key": "endpoints", "type": "[FQDNEndpoint]"}, } - def __init__(self, *, category: Optional[str] = None, endpoints: Optional[List["FQDNEndpoint"]] = None, **kwargs): + def __init__( + self, + *, + category: Optional[str] = None, + endpoints: Optional[List["FQDNEndpoint"]] = None, + **kwargs + ): """ :keyword category: :paramtype category: str @@ -11889,7 +12903,10 @@ class GridSamplingAlgorithm(SamplingAlgorithm): } _attribute_map = { - "sampling_algorithm_type": {"key": "samplingAlgorithmType", "type": "str"}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } def __init__(self, **kwargs): @@ -11943,7 +12960,10 @@ class HdfsDatastore(DatastoreProperties): "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, "datastore_type": {"key": "datastoreType", "type": "str"}, "is_default": {"key": "isDefault", "type": "bool"}, - "hdfs_server_certificate": {"key": "hdfsServerCertificate", "type": "str"}, + "hdfs_server_certificate": { + "key": "hdfsServerCertificate", + "type": "str", + }, "name_node_address": {"key": "nameNodeAddress", "type": "str"}, "protocol": {"key": "protocol", "type": "str"}, } @@ -11978,7 +12998,11 @@ def __init__( :paramtype protocol: str """ super(HdfsDatastore, self).__init__( - description=description, properties=properties, tags=tags, credentials=credentials, **kwargs + description=description, + properties=properties, + tags=tags, + credentials=credentials, + **kwargs ) self.datastore_type = "Hdfs" # type: str self.hdfs_server_certificate = hdfs_server_certificate @@ -11997,7 +13021,9 @@ class HDInsightSchema(msrest.serialization.Model): "properties": {"key": "properties", "type": "HDInsightProperties"}, } - def __init__(self, *, properties: Optional["HDInsightProperties"] = None, **kwargs): + def __init__( + self, *, properties: Optional["HDInsightProperties"] = None, **kwargs + ): """ :keyword properties: HDInsight compute properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties @@ -12062,7 +13088,10 @@ class HDInsight(Compute, HDInsightSchema): "created_on": {"key": "createdOn", "type": "iso-8601"}, "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, "resource_id": {"key": "resourceId", "type": "str"}, - "provisioning_errors": {"key": "provisioningErrors", "type": "[ErrorResponse]"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } @@ -12126,7 +13155,10 @@ class HDInsightProperties(msrest.serialization.Model): _attribute_map = { "ssh_port": {"key": "sshPort", "type": "int"}, "address": {"key": "address", "type": "str"}, - "administrator_account": {"key": "administratorAccount", "type": "VirtualMachineSshCredentials"}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, } def __init__( @@ -12193,10 +13225,15 @@ class IdentityForCmk(msrest.serialization.Model): """ _attribute_map = { - "user_assigned_identity": {"key": "userAssignedIdentity", "type": "str"}, + "user_assigned_identity": { + "key": "userAssignedIdentity", + "type": "str", + }, } - def __init__(self, *, user_assigned_identity: Optional[str] = None, **kwargs): + def __init__( + self, *, user_assigned_identity: Optional[str] = None, **kwargs + ): """ :keyword user_assigned_identity: The ArmId of the user assigned identity that will be used to access the customer managed key vault. @@ -12215,10 +13252,15 @@ class IdleShutdownSetting(msrest.serialization.Model): """ _attribute_map = { - "idle_time_before_shutdown": {"key": "idleTimeBeforeShutdown", "type": "str"}, + "idle_time_before_shutdown": { + "key": "idleTimeBeforeShutdown", + "type": "str", + }, } - def __init__(self, *, idle_time_before_shutdown: Optional[str] = None, **kwargs): + def __init__( + self, *, idle_time_before_shutdown: Optional[str] = None, **kwargs + ): """ :keyword idle_time_before_shutdown: Time is defined in ISO8601 format. Minimum is 15 min, maximum is 3 days. @@ -12295,9 +13337,18 @@ class ImageVertical(msrest.serialization.Model): } _attribute_map = { - "limit_settings": {"key": "limitSettings", "type": "ImageLimitSettings"}, - "sweep_settings": {"key": "sweepSettings", "type": "ImageSweepSettings"}, - "validation_data": {"key": "validationData", "type": "MLTableJobInput"}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, "validation_data_size": {"key": "validationDataSize", "type": "float"}, } @@ -12360,12 +13411,27 @@ class ImageClassificationBase(ImageVertical): } _attribute_map = { - "limit_settings": {"key": "limitSettings", "type": "ImageLimitSettings"}, - "sweep_settings": {"key": "sweepSettings", "type": "ImageSweepSettings"}, - "validation_data": {"key": "validationData", "type": "MLTableJobInput"}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, "validation_data_size": {"key": "validationDataSize", "type": "float"}, - "model_settings": {"key": "modelSettings", "type": "ImageModelSettingsClassification"}, - "search_space": {"key": "searchSpace", "type": "[ImageModelDistributionSettingsClassification]"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsClassification", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsClassification]", + }, } def __init__( @@ -12376,7 +13442,9 @@ def __init__( validation_data: Optional["MLTableJobInput"] = None, validation_data_size: Optional[float] = None, model_settings: Optional["ImageModelSettingsClassification"] = None, - search_space: Optional[List["ImageModelDistributionSettingsClassification"]] = None, + search_space: Optional[ + List["ImageModelDistributionSettingsClassification"] + ] = None, **kwargs ): """ @@ -12461,12 +13529,27 @@ class ImageClassification(AutoMLVertical, ImageClassificationBase): } _attribute_map = { - "limit_settings": {"key": "limitSettings", "type": "ImageLimitSettings"}, - "sweep_settings": {"key": "sweepSettings", "type": "ImageSweepSettings"}, - "validation_data": {"key": "validationData", "type": "MLTableJobInput"}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, "validation_data_size": {"key": "validationDataSize", "type": "float"}, - "model_settings": {"key": "modelSettings", "type": "ImageModelSettingsClassification"}, - "search_space": {"key": "searchSpace", "type": "[ImageModelDistributionSettingsClassification]"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsClassification", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsClassification]", + }, "log_verbosity": {"key": "logVerbosity", "type": "str"}, "target_column_name": {"key": "targetColumnName", "type": "str"}, "task_type": {"key": "taskType", "type": "str"}, @@ -12483,10 +13566,14 @@ def __init__( validation_data: Optional["MLTableJobInput"] = None, validation_data_size: Optional[float] = None, model_settings: Optional["ImageModelSettingsClassification"] = None, - search_space: Optional[List["ImageModelDistributionSettingsClassification"]] = None, + search_space: Optional[ + List["ImageModelDistributionSettingsClassification"] + ] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "ClassificationPrimaryMetrics"] + ] = None, **kwargs ): """ @@ -12598,12 +13685,27 @@ class ImageClassificationMultilabel(AutoMLVertical, ImageClassificationBase): } _attribute_map = { - "limit_settings": {"key": "limitSettings", "type": "ImageLimitSettings"}, - "sweep_settings": {"key": "sweepSettings", "type": "ImageSweepSettings"}, - "validation_data": {"key": "validationData", "type": "MLTableJobInput"}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, "validation_data_size": {"key": "validationDataSize", "type": "float"}, - "model_settings": {"key": "modelSettings", "type": "ImageModelSettingsClassification"}, - "search_space": {"key": "searchSpace", "type": "[ImageModelDistributionSettingsClassification]"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsClassification", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsClassification]", + }, "log_verbosity": {"key": "logVerbosity", "type": "str"}, "target_column_name": {"key": "targetColumnName", "type": "str"}, "task_type": {"key": "taskType", "type": "str"}, @@ -12620,10 +13722,14 @@ def __init__( validation_data: Optional["MLTableJobInput"] = None, validation_data_size: Optional[float] = None, model_settings: Optional["ImageModelSettingsClassification"] = None, - search_space: Optional[List["ImageModelDistributionSettingsClassification"]] = None, + search_space: Optional[ + List["ImageModelDistributionSettingsClassification"] + ] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationMultilabelPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "ClassificationMultilabelPrimaryMetrics"] + ] = None, **kwargs ): """ @@ -12714,12 +13820,27 @@ class ImageObjectDetectionBase(ImageVertical): } _attribute_map = { - "limit_settings": {"key": "limitSettings", "type": "ImageLimitSettings"}, - "sweep_settings": {"key": "sweepSettings", "type": "ImageSweepSettings"}, - "validation_data": {"key": "validationData", "type": "MLTableJobInput"}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, "validation_data_size": {"key": "validationDataSize", "type": "float"}, - "model_settings": {"key": "modelSettings", "type": "ImageModelSettingsObjectDetection"}, - "search_space": {"key": "searchSpace", "type": "[ImageModelDistributionSettingsObjectDetection]"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsObjectDetection", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsObjectDetection]", + }, } def __init__( @@ -12730,7 +13851,9 @@ def __init__( validation_data: Optional["MLTableJobInput"] = None, validation_data_size: Optional[float] = None, model_settings: Optional["ImageModelSettingsObjectDetection"] = None, - search_space: Optional[List["ImageModelDistributionSettingsObjectDetection"]] = None, + search_space: Optional[ + List["ImageModelDistributionSettingsObjectDetection"] + ] = None, **kwargs ): """ @@ -12814,12 +13937,27 @@ class ImageInstanceSegmentation(AutoMLVertical, ImageObjectDetectionBase): } _attribute_map = { - "limit_settings": {"key": "limitSettings", "type": "ImageLimitSettings"}, - "sweep_settings": {"key": "sweepSettings", "type": "ImageSweepSettings"}, - "validation_data": {"key": "validationData", "type": "MLTableJobInput"}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, "validation_data_size": {"key": "validationDataSize", "type": "float"}, - "model_settings": {"key": "modelSettings", "type": "ImageModelSettingsObjectDetection"}, - "search_space": {"key": "searchSpace", "type": "[ImageModelDistributionSettingsObjectDetection]"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsObjectDetection", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsObjectDetection]", + }, "log_verbosity": {"key": "logVerbosity", "type": "str"}, "target_column_name": {"key": "targetColumnName", "type": "str"}, "task_type": {"key": "taskType", "type": "str"}, @@ -12836,10 +13974,14 @@ def __init__( validation_data: Optional["MLTableJobInput"] = None, validation_data_size: Optional[float] = None, model_settings: Optional["ImageModelSettingsObjectDetection"] = None, - search_space: Optional[List["ImageModelDistributionSettingsObjectDetection"]] = None, + search_space: Optional[ + List["ImageModelDistributionSettingsObjectDetection"] + ] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "InstanceSegmentationPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "InstanceSegmentationPrimaryMetrics"] + ] = None, **kwargs ): """ @@ -12954,7 +14096,10 @@ class ImageMetadata(msrest.serialization.Model): _attribute_map = { "current_image_version": {"key": "currentImageVersion", "type": "str"}, "latest_image_version": {"key": "latestImageVersion", "type": "str"}, - "is_latest_os_image_version": {"key": "isLatestOsImageVersion", "type": "bool"}, + "is_latest_os_image_version": { + "key": "isLatestOsImageVersion", + "type": "bool", + }, } def __init__( @@ -13086,13 +14231,25 @@ class ImageModelDistributionSettings(msrest.serialization.Model): "distributed": {"key": "distributed", "type": "str"}, "early_stopping": {"key": "earlyStopping", "type": "str"}, "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "str"}, - "early_stopping_patience": {"key": "earlyStoppingPatience", "type": "str"}, - "enable_onnx_normalization": {"key": "enableOnnxNormalization", "type": "str"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "str", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "str", + }, "evaluation_frequency": {"key": "evaluationFrequency", "type": "str"}, - "gradient_accumulation_step": {"key": "gradientAccumulationStep", "type": "str"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "str", + }, "layers_to_freeze": {"key": "layersToFreeze", "type": "str"}, "learning_rate": {"key": "learningRate", "type": "str"}, - "learning_rate_scheduler": {"key": "learningRateScheduler", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, "model_name": {"key": "modelName", "type": "str"}, "momentum": {"key": "momentum", "type": "str"}, "nesterov": {"key": "nesterov", "type": "str"}, @@ -13104,8 +14261,14 @@ class ImageModelDistributionSettings(msrest.serialization.Model): "step_lr_step_size": {"key": "stepLRStepSize", "type": "str"}, "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, - "warmup_cosine_lr_cycles": {"key": "warmupCosineLRCycles", "type": "str"}, - "warmup_cosine_lr_warmup_epochs": {"key": "warmupCosineLRWarmupEpochs", "type": "str"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "str", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "str", + }, "weight_decay": {"key": "weightDecay", "type": "str"}, } @@ -13255,7 +14418,9 @@ def __init__( self.weight_decay = weight_decay -class ImageModelDistributionSettingsClassification(ImageModelDistributionSettings): +class ImageModelDistributionSettingsClassification( + ImageModelDistributionSettings +): """Distribution expressions to sweep over values of model settings. :code:` @@ -13371,13 +14536,25 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting "distributed": {"key": "distributed", "type": "str"}, "early_stopping": {"key": "earlyStopping", "type": "str"}, "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "str"}, - "early_stopping_patience": {"key": "earlyStoppingPatience", "type": "str"}, - "enable_onnx_normalization": {"key": "enableOnnxNormalization", "type": "str"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "str", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "str", + }, "evaluation_frequency": {"key": "evaluationFrequency", "type": "str"}, - "gradient_accumulation_step": {"key": "gradientAccumulationStep", "type": "str"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "str", + }, "layers_to_freeze": {"key": "layersToFreeze", "type": "str"}, "learning_rate": {"key": "learningRate", "type": "str"}, - "learning_rate_scheduler": {"key": "learningRateScheduler", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, "model_name": {"key": "modelName", "type": "str"}, "momentum": {"key": "momentum", "type": "str"}, "nesterov": {"key": "nesterov", "type": "str"}, @@ -13389,12 +14566,21 @@ class ImageModelDistributionSettingsClassification(ImageModelDistributionSetting "step_lr_step_size": {"key": "stepLRStepSize", "type": "str"}, "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, - "warmup_cosine_lr_cycles": {"key": "warmupCosineLRCycles", "type": "str"}, - "warmup_cosine_lr_warmup_epochs": {"key": "warmupCosineLRWarmupEpochs", "type": "str"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "str", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "str", + }, "weight_decay": {"key": "weightDecay", "type": "str"}, "training_crop_size": {"key": "trainingCropSize", "type": "str"}, "validation_crop_size": {"key": "validationCropSize", "type": "str"}, - "validation_resize_size": {"key": "validationResizeSize", "type": "str"}, + "validation_resize_size": { + "key": "validationResizeSize", + "type": "str", + }, "weighted_loss": {"key": "weightedLoss", "type": "str"}, } @@ -13567,7 +14753,9 @@ def __init__( self.weighted_loss = weighted_loss -class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettings): +class ImageModelDistributionSettingsObjectDetection( + ImageModelDistributionSettings +): """Distribution expressions to sweep over values of model settings. :code:` @@ -13722,13 +14910,25 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin "distributed": {"key": "distributed", "type": "str"}, "early_stopping": {"key": "earlyStopping", "type": "str"}, "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "str"}, - "early_stopping_patience": {"key": "earlyStoppingPatience", "type": "str"}, - "enable_onnx_normalization": {"key": "enableOnnxNormalization", "type": "str"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "str", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "str", + }, "evaluation_frequency": {"key": "evaluationFrequency", "type": "str"}, - "gradient_accumulation_step": {"key": "gradientAccumulationStep", "type": "str"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "str", + }, "layers_to_freeze": {"key": "layersToFreeze", "type": "str"}, "learning_rate": {"key": "learningRate", "type": "str"}, - "learning_rate_scheduler": {"key": "learningRateScheduler", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, "model_name": {"key": "modelName", "type": "str"}, "momentum": {"key": "momentum", "type": "str"}, "nesterov": {"key": "nesterov", "type": "str"}, @@ -13740,10 +14940,19 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin "step_lr_step_size": {"key": "stepLRStepSize", "type": "str"}, "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, - "warmup_cosine_lr_cycles": {"key": "warmupCosineLRCycles", "type": "str"}, - "warmup_cosine_lr_warmup_epochs": {"key": "warmupCosineLRWarmupEpochs", "type": "str"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "str", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "str", + }, "weight_decay": {"key": "weightDecay", "type": "str"}, - "box_detections_per_image": {"key": "boxDetectionsPerImage", "type": "str"}, + "box_detections_per_image": { + "key": "boxDetectionsPerImage", + "type": "str", + }, "box_score_threshold": {"key": "boxScoreThreshold", "type": "str"}, "image_size": {"key": "imageSize", "type": "str"}, "max_size": {"key": "maxSize", "type": "str"}, @@ -13753,9 +14962,18 @@ class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettin "nms_iou_threshold": {"key": "nmsIouThreshold", "type": "str"}, "tile_grid_size": {"key": "tileGridSize", "type": "str"}, "tile_overlap_ratio": {"key": "tileOverlapRatio", "type": "str"}, - "tile_predictions_nms_threshold": {"key": "tilePredictionsNmsThreshold", "type": "str"}, - "validation_iou_threshold": {"key": "validationIouThreshold", "type": "str"}, - "validation_metric_type": {"key": "validationMetricType", "type": "str"}, + "tile_predictions_nms_threshold": { + "key": "tilePredictionsNmsThreshold", + "type": "str", + }, + "validation_iou_threshold": { + "key": "validationIouThreshold", + "type": "str", + }, + "validation_metric_type": { + "key": "validationMetricType", + "type": "str", + }, } def __init__( @@ -14086,18 +15304,33 @@ class ImageModelSettings(msrest.serialization.Model): "beta1": {"key": "beta1", "type": "float"}, "beta2": {"key": "beta2", "type": "float"}, "checkpoint_frequency": {"key": "checkpointFrequency", "type": "int"}, - "checkpoint_model": {"key": "checkpointModel", "type": "MLFlowModelJobInput"}, + "checkpoint_model": { + "key": "checkpointModel", + "type": "MLFlowModelJobInput", + }, "checkpoint_run_id": {"key": "checkpointRunId", "type": "str"}, "distributed": {"key": "distributed", "type": "bool"}, "early_stopping": {"key": "earlyStopping", "type": "bool"}, "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "int"}, - "early_stopping_patience": {"key": "earlyStoppingPatience", "type": "int"}, - "enable_onnx_normalization": {"key": "enableOnnxNormalization", "type": "bool"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "int", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "bool", + }, "evaluation_frequency": {"key": "evaluationFrequency", "type": "int"}, - "gradient_accumulation_step": {"key": "gradientAccumulationStep", "type": "int"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "int", + }, "layers_to_freeze": {"key": "layersToFreeze", "type": "int"}, "learning_rate": {"key": "learningRate", "type": "float"}, - "learning_rate_scheduler": {"key": "learningRateScheduler", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, "model_name": {"key": "modelName", "type": "str"}, "momentum": {"key": "momentum", "type": "float"}, "nesterov": {"key": "nesterov", "type": "bool"}, @@ -14109,8 +15342,14 @@ class ImageModelSettings(msrest.serialization.Model): "step_lr_step_size": {"key": "stepLRStepSize", "type": "int"}, "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, - "warmup_cosine_lr_cycles": {"key": "warmupCosineLRCycles", "type": "float"}, - "warmup_cosine_lr_warmup_epochs": {"key": "warmupCosineLRWarmupEpochs", "type": "int"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "float", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "int", + }, "weight_decay": {"key": "weightDecay", "type": "float"}, } @@ -14134,7 +15373,9 @@ def __init__( gradient_accumulation_step: Optional[int] = None, layers_to_freeze: Optional[int] = None, learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "LearningRateScheduler"]] = None, + learning_rate_scheduler: Optional[ + Union[str, "LearningRateScheduler"] + ] = None, model_name: Optional[str] = None, momentum: Optional[float] = None, nesterov: Optional[bool] = None, @@ -14394,18 +15635,33 @@ class ImageModelSettingsClassification(ImageModelSettings): "beta1": {"key": "beta1", "type": "float"}, "beta2": {"key": "beta2", "type": "float"}, "checkpoint_frequency": {"key": "checkpointFrequency", "type": "int"}, - "checkpoint_model": {"key": "checkpointModel", "type": "MLFlowModelJobInput"}, + "checkpoint_model": { + "key": "checkpointModel", + "type": "MLFlowModelJobInput", + }, "checkpoint_run_id": {"key": "checkpointRunId", "type": "str"}, "distributed": {"key": "distributed", "type": "bool"}, "early_stopping": {"key": "earlyStopping", "type": "bool"}, "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "int"}, - "early_stopping_patience": {"key": "earlyStoppingPatience", "type": "int"}, - "enable_onnx_normalization": {"key": "enableOnnxNormalization", "type": "bool"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "int", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "bool", + }, "evaluation_frequency": {"key": "evaluationFrequency", "type": "int"}, - "gradient_accumulation_step": {"key": "gradientAccumulationStep", "type": "int"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "int", + }, "layers_to_freeze": {"key": "layersToFreeze", "type": "int"}, "learning_rate": {"key": "learningRate", "type": "float"}, - "learning_rate_scheduler": {"key": "learningRateScheduler", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, "model_name": {"key": "modelName", "type": "str"}, "momentum": {"key": "momentum", "type": "float"}, "nesterov": {"key": "nesterov", "type": "bool"}, @@ -14417,12 +15673,21 @@ class ImageModelSettingsClassification(ImageModelSettings): "step_lr_step_size": {"key": "stepLRStepSize", "type": "int"}, "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, - "warmup_cosine_lr_cycles": {"key": "warmupCosineLRCycles", "type": "float"}, - "warmup_cosine_lr_warmup_epochs": {"key": "warmupCosineLRWarmupEpochs", "type": "int"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "float", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "int", + }, "weight_decay": {"key": "weightDecay", "type": "float"}, "training_crop_size": {"key": "trainingCropSize", "type": "int"}, "validation_crop_size": {"key": "validationCropSize", "type": "int"}, - "validation_resize_size": {"key": "validationResizeSize", "type": "int"}, + "validation_resize_size": { + "key": "validationResizeSize", + "type": "int", + }, "weighted_loss": {"key": "weightedLoss", "type": "int"}, } @@ -14446,7 +15711,9 @@ def __init__( gradient_accumulation_step: Optional[int] = None, layers_to_freeze: Optional[int] = None, learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "LearningRateScheduler"]] = None, + learning_rate_scheduler: Optional[ + Union[str, "LearningRateScheduler"] + ] = None, model_name: Optional[str] = None, momentum: Optional[float] = None, nesterov: Optional[bool] = None, @@ -14769,18 +16036,33 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): "beta1": {"key": "beta1", "type": "float"}, "beta2": {"key": "beta2", "type": "float"}, "checkpoint_frequency": {"key": "checkpointFrequency", "type": "int"}, - "checkpoint_model": {"key": "checkpointModel", "type": "MLFlowModelJobInput"}, + "checkpoint_model": { + "key": "checkpointModel", + "type": "MLFlowModelJobInput", + }, "checkpoint_run_id": {"key": "checkpointRunId", "type": "str"}, "distributed": {"key": "distributed", "type": "bool"}, "early_stopping": {"key": "earlyStopping", "type": "bool"}, "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "int"}, - "early_stopping_patience": {"key": "earlyStoppingPatience", "type": "int"}, - "enable_onnx_normalization": {"key": "enableOnnxNormalization", "type": "bool"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "int", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "bool", + }, "evaluation_frequency": {"key": "evaluationFrequency", "type": "int"}, - "gradient_accumulation_step": {"key": "gradientAccumulationStep", "type": "int"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "int", + }, "layers_to_freeze": {"key": "layersToFreeze", "type": "int"}, "learning_rate": {"key": "learningRate", "type": "float"}, - "learning_rate_scheduler": {"key": "learningRateScheduler", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, "model_name": {"key": "modelName", "type": "str"}, "momentum": {"key": "momentum", "type": "float"}, "nesterov": {"key": "nesterov", "type": "bool"}, @@ -14792,10 +16074,19 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): "step_lr_step_size": {"key": "stepLRStepSize", "type": "int"}, "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, - "warmup_cosine_lr_cycles": {"key": "warmupCosineLRCycles", "type": "float"}, - "warmup_cosine_lr_warmup_epochs": {"key": "warmupCosineLRWarmupEpochs", "type": "int"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "float", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "int", + }, "weight_decay": {"key": "weightDecay", "type": "float"}, - "box_detections_per_image": {"key": "boxDetectionsPerImage", "type": "int"}, + "box_detections_per_image": { + "key": "boxDetectionsPerImage", + "type": "int", + }, "box_score_threshold": {"key": "boxScoreThreshold", "type": "float"}, "image_size": {"key": "imageSize", "type": "int"}, "max_size": {"key": "maxSize", "type": "int"}, @@ -14805,9 +16096,18 @@ class ImageModelSettingsObjectDetection(ImageModelSettings): "nms_iou_threshold": {"key": "nmsIouThreshold", "type": "float"}, "tile_grid_size": {"key": "tileGridSize", "type": "str"}, "tile_overlap_ratio": {"key": "tileOverlapRatio", "type": "float"}, - "tile_predictions_nms_threshold": {"key": "tilePredictionsNmsThreshold", "type": "float"}, - "validation_iou_threshold": {"key": "validationIouThreshold", "type": "float"}, - "validation_metric_type": {"key": "validationMetricType", "type": "str"}, + "tile_predictions_nms_threshold": { + "key": "tilePredictionsNmsThreshold", + "type": "float", + }, + "validation_iou_threshold": { + "key": "validationIouThreshold", + "type": "float", + }, + "validation_metric_type": { + "key": "validationMetricType", + "type": "str", + }, } def __init__( @@ -14830,7 +16130,9 @@ def __init__( gradient_accumulation_step: Optional[int] = None, layers_to_freeze: Optional[int] = None, learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "LearningRateScheduler"]] = None, + learning_rate_scheduler: Optional[ + Union[str, "LearningRateScheduler"] + ] = None, model_name: Optional[str] = None, momentum: Optional[float] = None, nesterov: Optional[bool] = None, @@ -14857,7 +16159,9 @@ def __init__( tile_overlap_ratio: Optional[float] = None, tile_predictions_nms_threshold: Optional[float] = None, validation_iou_threshold: Optional[float] = None, - validation_metric_type: Optional[Union[str, "ValidationMetricType"]] = None, + validation_metric_type: Optional[ + Union[str, "ValidationMetricType"] + ] = None, **kwargs ): """ @@ -15106,12 +16410,27 @@ class ImageObjectDetection(AutoMLVertical, ImageObjectDetectionBase): } _attribute_map = { - "limit_settings": {"key": "limitSettings", "type": "ImageLimitSettings"}, - "sweep_settings": {"key": "sweepSettings", "type": "ImageSweepSettings"}, - "validation_data": {"key": "validationData", "type": "MLTableJobInput"}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, "validation_data_size": {"key": "validationDataSize", "type": "float"}, - "model_settings": {"key": "modelSettings", "type": "ImageModelSettingsObjectDetection"}, - "search_space": {"key": "searchSpace", "type": "[ImageModelDistributionSettingsObjectDetection]"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsObjectDetection", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsObjectDetection]", + }, "log_verbosity": {"key": "logVerbosity", "type": "str"}, "target_column_name": {"key": "targetColumnName", "type": "str"}, "task_type": {"key": "taskType", "type": "str"}, @@ -15128,10 +16447,14 @@ def __init__( validation_data: Optional["MLTableJobInput"] = None, validation_data_size: Optional[float] = None, model_settings: Optional["ImageModelSettingsObjectDetection"] = None, - search_space: Optional[List["ImageModelDistributionSettingsObjectDetection"]] = None, + search_space: Optional[ + List["ImageModelDistributionSettingsObjectDetection"] + ] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ObjectDetectionPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "ObjectDetectionPrimaryMetrics"] + ] = None, **kwargs ): """ @@ -15209,7 +16532,10 @@ class ImageSweepSettings(msrest.serialization.Model): } _attribute_map = { - "early_termination": {"key": "earlyTermination", "type": "EarlyTerminationPolicy"}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, "sampling_algorithm": {"key": "samplingAlgorithm", "type": "str"}, } @@ -15249,7 +16575,11 @@ class IndexColumn(msrest.serialization.Model): } def __init__( - self, *, column_name: Optional[str] = None, data_type: Optional[Union[str, "FeatureDataType"]] = None, **kwargs + self, + *, + column_name: Optional[str] = None, + data_type: Optional[Union[str, "FeatureDataType"]] = None, + **kwargs ): """ :keyword column_name: Specifies the column name. @@ -15315,7 +16645,10 @@ class InstanceTypeSchema(msrest.serialization.Model): _attribute_map = { "node_selector": {"key": "nodeSelector", "type": "{str}"}, - "resources": {"key": "resources", "type": "InstanceTypeSchemaResources"}, + "resources": { + "key": "resources", + "type": "InstanceTypeSchemaResources", + }, } def __init__( @@ -15350,7 +16683,13 @@ class InstanceTypeSchemaResources(msrest.serialization.Model): "limits": {"key": "limits", "type": "{str}"}, } - def __init__(self, *, requests: Optional[Dict[str, str]] = None, limits: Optional[Dict[str, str]] = None, **kwargs): + def __init__( + self, + *, + requests: Optional[Dict[str, str]] = None, + limits: Optional[Dict[str, str]] = None, + **kwargs + ): """ :keyword requests: Resource requests for this instance type. :paramtype requests: dict[str, str] @@ -15424,7 +16763,13 @@ class JobBaseResourceArmPaginatedResult(msrest.serialization.Model): "value": {"key": "value", "type": "[JobBase]"}, } - def __init__(self, *, next_link: Optional[str] = None, value: Optional[List["JobBase"]] = None, **kwargs): + def __init__( + self, + *, + next_link: Optional[str] = None, + value: Optional[List["JobBase"]] = None, + **kwargs + ): """ :keyword next_link: The link to the next page of JobBase objects. If null, there are no additional pages. @@ -15530,7 +16875,10 @@ class JobScheduleAction(ScheduleActionBase): _attribute_map = { "action_type": {"key": "actionType", "type": "str"}, - "job_definition": {"key": "jobDefinition", "type": "JobBaseProperties"}, + "job_definition": { + "key": "jobDefinition", + "type": "JobBaseProperties", + }, } def __init__(self, *, job_definition: "JobBaseProperties", **kwargs): @@ -15639,7 +16987,14 @@ class KerberosCredentials(msrest.serialization.Model): "kerberos_realm": {"key": "kerberosRealm", "type": "str"}, } - def __init__(self, *, kerberos_kdc_address: str, kerberos_principal: str, kerberos_realm: str, **kwargs): + def __init__( + self, + *, + kerberos_kdc_address: str, + kerberos_principal: str, + kerberos_realm: str, + **kwargs + ): """ :keyword kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. :paramtype kerberos_kdc_address: str @@ -15868,7 +17223,9 @@ class KubernetesSchema(msrest.serialization.Model): "properties": {"key": "properties", "type": "KubernetesProperties"}, } - def __init__(self, *, properties: Optional["KubernetesProperties"] = None, **kwargs): + def __init__( + self, *, properties: Optional["KubernetesProperties"] = None, **kwargs + ): """ :keyword properties: Properties of Kubernetes. :paramtype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties @@ -15933,7 +17290,10 @@ class Kubernetes(Compute, KubernetesSchema): "created_on": {"key": "createdOn", "type": "iso-8601"}, "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, "resource_id": {"key": "resourceId", "type": "str"}, - "provisioning_errors": {"key": "provisioningErrors", "type": "[ErrorResponse]"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } @@ -16044,13 +17404,22 @@ class OnlineDeploymentProperties(EndpointDeploymentPropertiesBase): } _attribute_map = { - "code_configuration": {"key": "codeConfiguration", "type": "CodeConfiguration"}, + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, "description": {"key": "description", "type": "str"}, "environment_id": {"key": "environmentId", "type": "str"}, - "environment_variables": {"key": "environmentVariables", "type": "{str}"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, "properties": {"key": "properties", "type": "{str}"}, "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, - "egress_public_network_access": {"key": "egressPublicNetworkAccess", "type": "str"}, + "egress_public_network_access": { + "key": "egressPublicNetworkAccess", + "type": "str", + }, "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, "instance_type": {"key": "instanceType", "type": "str"}, "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, @@ -16058,12 +17427,21 @@ class OnlineDeploymentProperties(EndpointDeploymentPropertiesBase): "model_mount_path": {"key": "modelMountPath", "type": "str"}, "provisioning_state": {"key": "provisioningState", "type": "str"}, "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, - "request_settings": {"key": "requestSettings", "type": "OnlineRequestSettings"}, - "scale_settings": {"key": "scaleSettings", "type": "OnlineScaleSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, } _subtype_map = { - "endpoint_compute_type": {"Kubernetes": "KubernetesOnlineDeployment", "Managed": "ManagedOnlineDeployment"} + "endpoint_compute_type": { + "Kubernetes": "KubernetesOnlineDeployment", + "Managed": "ManagedOnlineDeployment", + } } def __init__( @@ -16075,7 +17453,9 @@ def __init__( environment_variables: Optional[Dict[str, str]] = None, properties: Optional[Dict[str, str]] = None, app_insights_enabled: Optional[bool] = False, - egress_public_network_access: Optional[Union[str, "EgressPublicNetworkAccessType"]] = None, + egress_public_network_access: Optional[ + Union[str, "EgressPublicNetworkAccessType"] + ] = None, instance_type: Optional[str] = None, liveness_probe: Optional["ProbeSettings"] = None, model: Optional[str] = None, @@ -16207,13 +17587,22 @@ class KubernetesOnlineDeployment(OnlineDeploymentProperties): } _attribute_map = { - "code_configuration": {"key": "codeConfiguration", "type": "CodeConfiguration"}, + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, "description": {"key": "description", "type": "str"}, "environment_id": {"key": "environmentId", "type": "str"}, - "environment_variables": {"key": "environmentVariables", "type": "{str}"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, "properties": {"key": "properties", "type": "{str}"}, "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, - "egress_public_network_access": {"key": "egressPublicNetworkAccess", "type": "str"}, + "egress_public_network_access": { + "key": "egressPublicNetworkAccess", + "type": "str", + }, "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, "instance_type": {"key": "instanceType", "type": "str"}, "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, @@ -16221,8 +17610,14 @@ class KubernetesOnlineDeployment(OnlineDeploymentProperties): "model_mount_path": {"key": "modelMountPath", "type": "str"}, "provisioning_state": {"key": "provisioningState", "type": "str"}, "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, - "request_settings": {"key": "requestSettings", "type": "OnlineRequestSettings"}, - "scale_settings": {"key": "scaleSettings", "type": "OnlineScaleSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, "container_resource_requirements": { "key": "containerResourceRequirements", "type": "ContainerResourceRequirements", @@ -16238,7 +17633,9 @@ def __init__( environment_variables: Optional[Dict[str, str]] = None, properties: Optional[Dict[str, str]] = None, app_insights_enabled: Optional[bool] = False, - egress_public_network_access: Optional[Union[str, "EgressPublicNetworkAccessType"]] = None, + egress_public_network_access: Optional[ + Union[str, "EgressPublicNetworkAccessType"] + ] = None, instance_type: Optional[str] = None, liveness_probe: Optional["ProbeSettings"] = None, model: Optional[str] = None, @@ -16246,7 +17643,9 @@ def __init__( readiness_probe: Optional["ProbeSettings"] = None, request_settings: Optional["OnlineRequestSettings"] = None, scale_settings: Optional["OnlineScaleSettings"] = None, - container_resource_requirements: Optional["ContainerResourceRequirements"] = None, + container_resource_requirements: Optional[ + "ContainerResourceRequirements" + ] = None, **kwargs ): """ @@ -16335,14 +17734,29 @@ class KubernetesProperties(msrest.serialization.Model): """ _attribute_map = { - "relay_connection_string": {"key": "relayConnectionString", "type": "str"}, - "service_bus_connection_string": {"key": "serviceBusConnectionString", "type": "str"}, - "extension_principal_id": {"key": "extensionPrincipalId", "type": "str"}, - "extension_instance_release_train": {"key": "extensionInstanceReleaseTrain", "type": "str"}, + "relay_connection_string": { + "key": "relayConnectionString", + "type": "str", + }, + "service_bus_connection_string": { + "key": "serviceBusConnectionString", + "type": "str", + }, + "extension_principal_id": { + "key": "extensionPrincipalId", + "type": "str", + }, + "extension_instance_release_train": { + "key": "extensionInstanceReleaseTrain", + "type": "str", + }, "vc_name": {"key": "vcName", "type": "str"}, "namespace": {"key": "namespace", "type": "str"}, "default_instance_type": {"key": "defaultInstanceType", "type": "str"}, - "instance_types": {"key": "instanceTypes", "type": "{InstanceTypeSchema}"}, + "instance_types": { + "key": "instanceTypes", + "type": "{InstanceTypeSchema}", + }, } def __init__( @@ -16381,7 +17795,9 @@ def __init__( self.relay_connection_string = relay_connection_string self.service_bus_connection_string = service_bus_connection_string self.extension_principal_id = extension_principal_id - self.extension_instance_release_train = extension_instance_release_train + self.extension_instance_release_train = ( + extension_instance_release_train + ) self.vc_name = vc_name self.namespace = namespace self.default_instance_type = default_instance_type @@ -16444,7 +17860,11 @@ class LabelClass(msrest.serialization.Model): } def __init__( - self, *, display_name: Optional[str] = None, subclasses: Optional[Dict[str, "LabelClass"]] = None, **kwargs + self, + *, + display_name: Optional[str] = None, + subclasses: Optional[Dict[str, "LabelClass"]] = None, + **kwargs ): """ :keyword display_name: Display name of the label class. @@ -16470,14 +17890,19 @@ class LabelingDataConfiguration(msrest.serialization.Model): _attribute_map = { "data_id": {"key": "dataId", "type": "str"}, - "incremental_data_refresh": {"key": "incrementalDataRefresh", "type": "str"}, + "incremental_data_refresh": { + "key": "incrementalDataRefresh", + "type": "str", + }, } def __init__( self, *, data_id: Optional[str] = None, - incremental_data_refresh: Optional[Union[str, "IncrementalDataRefresh"]] = None, + incremental_data_refresh: Optional[ + Union[str, "IncrementalDataRefresh"] + ] = None, **kwargs ): """ @@ -16561,7 +17986,12 @@ class LabelingJobMediaProperties(msrest.serialization.Model): "media_type": {"key": "mediaType", "type": "str"}, } - _subtype_map = {"media_type": {"Image": "LabelingJobImageProperties", "Text": "LabelingJobTextProperties"}} + _subtype_map = { + "media_type": { + "Image": "LabelingJobImageProperties", + "Text": "LabelingJobTextProperties", + } + } def __init__(self, **kwargs): """ """ @@ -16591,7 +18021,12 @@ class LabelingJobImageProperties(LabelingJobMediaProperties): "annotation_type": {"key": "annotationType", "type": "str"}, } - def __init__(self, *, annotation_type: Optional[Union[str, "ImageAnnotationType"]] = None, **kwargs): + def __init__( + self, + *, + annotation_type: Optional[Union[str, "ImageAnnotationType"]] = None, + **kwargs + ): """ :keyword annotation_type: Annotation type of image labeling job. Possible values include: "Classification", "BoundingBox", "InstanceSegmentation". @@ -16711,19 +18146,43 @@ class LabelingJobProperties(JobBaseProperties): "identity": {"key": "identity", "type": "IdentityConfiguration"}, "is_archived": {"key": "isArchived", "type": "bool"}, "job_type": {"key": "jobType", "type": "str"}, - "notification_setting": {"key": "notificationSetting", "type": "NotificationSetting"}, + "notification_setting": { + "key": "notificationSetting", + "type": "NotificationSetting", + }, "services": {"key": "services", "type": "{JobService}"}, "status": {"key": "status", "type": "str"}, "created_date_time": {"key": "createdDateTime", "type": "iso-8601"}, - "data_configuration": {"key": "dataConfiguration", "type": "LabelingDataConfiguration"}, - "job_instructions": {"key": "jobInstructions", "type": "LabelingJobInstructions"}, - "label_categories": {"key": "labelCategories", "type": "{LabelCategory}"}, - "labeling_job_media_properties": {"key": "labelingJobMediaProperties", "type": "LabelingJobMediaProperties"}, - "ml_assist_configuration": {"key": "mlAssistConfiguration", "type": "MLAssistConfiguration"}, - "progress_metrics": {"key": "progressMetrics", "type": "ProgressMetrics"}, + "data_configuration": { + "key": "dataConfiguration", + "type": "LabelingDataConfiguration", + }, + "job_instructions": { + "key": "jobInstructions", + "type": "LabelingJobInstructions", + }, + "label_categories": { + "key": "labelCategories", + "type": "{LabelCategory}", + }, + "labeling_job_media_properties": { + "key": "labelingJobMediaProperties", + "type": "LabelingJobMediaProperties", + }, + "ml_assist_configuration": { + "key": "mlAssistConfiguration", + "type": "MLAssistConfiguration", + }, + "progress_metrics": { + "key": "progressMetrics", + "type": "ProgressMetrics", + }, "project_id": {"key": "projectId", "type": "str"}, "provisioning_state": {"key": "provisioningState", "type": "str"}, - "status_messages": {"key": "statusMessages", "type": "[StatusMessage]"}, + "status_messages": { + "key": "statusMessages", + "type": "[StatusMessage]", + }, } def __init__( @@ -16743,7 +18202,9 @@ def __init__( data_configuration: Optional["LabelingDataConfiguration"] = None, job_instructions: Optional["LabelingJobInstructions"] = None, label_categories: Optional[Dict[str, "LabelCategory"]] = None, - labeling_job_media_properties: Optional["LabelingJobMediaProperties"] = None, + labeling_job_media_properties: Optional[ + "LabelingJobMediaProperties" + ] = None, ml_assist_configuration: Optional["MLAssistConfiguration"] = None, **kwargs ): @@ -16831,7 +18292,13 @@ class LabelingJobResourceArmPaginatedResult(msrest.serialization.Model): "value": {"key": "value", "type": "[LabelingJob]"}, } - def __init__(self, *, next_link: Optional[str] = None, value: Optional[List["LabelingJob"]] = None, **kwargs): + def __init__( + self, + *, + next_link: Optional[str] = None, + value: Optional[List["LabelingJob"]] = None, + **kwargs + ): """ :keyword next_link: The link to the next page of LabelingJob objects. If null, there are no additional pages. @@ -16866,7 +18333,12 @@ class LabelingJobTextProperties(LabelingJobMediaProperties): "annotation_type": {"key": "annotationType", "type": "str"}, } - def __init__(self, *, annotation_type: Optional[Union[str, "TextAnnotationType"]] = None, **kwargs): + def __init__( + self, + *, + annotation_type: Optional[Union[str, "TextAnnotationType"]] = None, + **kwargs + ): """ :keyword annotation_type: Annotation type of text labeling job. Possible values include: "Classification", "NamedEntityRecognition". @@ -17016,13 +18488,22 @@ class ListWorkspaceKeysResult(msrest.serialization.Model): _attribute_map = { "user_storage_key": {"key": "userStorageKey", "type": "str"}, - "user_storage_resource_id": {"key": "userStorageResourceId", "type": "str"}, - "app_insights_instrumentation_key": {"key": "appInsightsInstrumentationKey", "type": "str"}, + "user_storage_resource_id": { + "key": "userStorageResourceId", + "type": "str", + }, + "app_insights_instrumentation_key": { + "key": "appInsightsInstrumentationKey", + "type": "str", + }, "container_registry_credentials": { "key": "containerRegistryCredentials", "type": "RegistryListCredentialsResult", }, - "notebook_access_keys": {"key": "notebookAccessKeys", "type": "ListNotebookKeysResult"}, + "notebook_access_keys": { + "key": "notebookAccessKeys", + "type": "ListNotebookKeysResult", + }, } def __init__(self, **kwargs): @@ -17090,14 +18571,18 @@ class LiteralJobInput(JobInput): "value": {"key": "value", "type": "str"}, } - def __init__(self, *, value: str, description: Optional[str] = None, **kwargs): + def __init__( + self, *, value: str, description: Optional[str] = None, **kwargs + ): """ :keyword description: Description for the input. :paramtype description: str :keyword value: Required. [Required] Literal value for the input. :paramtype value: str """ - super(LiteralJobInput, self).__init__(description=description, **kwargs) + super(LiteralJobInput, self).__init__( + description=description, **kwargs + ) self.job_input_type = "literal" # type: str self.value = value @@ -17159,7 +18644,9 @@ def __init__( self.resource_id = resource_id -class ManagedIdentityAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class ManagedIdentityAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """ManagedIdentityAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -17193,7 +18680,10 @@ class ManagedIdentityAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPr "target": {"key": "target", "type": "str"}, "value": {"key": "value", "type": "str"}, "value_format": {"key": "valueFormat", "type": "str"}, - "credentials": {"key": "credentials", "type": "WorkspaceConnectionManagedIdentity"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionManagedIdentity", + }, } def __init__( @@ -17222,8 +18712,14 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity """ - super(ManagedIdentityAuthTypeWorkspaceConnectionProperties, self).__init__( - category=category, target=target, value=value, value_format=value_format, **kwargs + super( + ManagedIdentityAuthTypeWorkspaceConnectionProperties, self + ).__init__( + category=category, + target=target, + value=value, + value_format=value_format, + **kwargs ) self.auth_type = "ManagedIdentity" # type: str self.credentials = credentials @@ -17288,13 +18784,22 @@ class ManagedOnlineDeployment(OnlineDeploymentProperties): } _attribute_map = { - "code_configuration": {"key": "codeConfiguration", "type": "CodeConfiguration"}, + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, "description": {"key": "description", "type": "str"}, "environment_id": {"key": "environmentId", "type": "str"}, - "environment_variables": {"key": "environmentVariables", "type": "{str}"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, "properties": {"key": "properties", "type": "{str}"}, "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, - "egress_public_network_access": {"key": "egressPublicNetworkAccess", "type": "str"}, + "egress_public_network_access": { + "key": "egressPublicNetworkAccess", + "type": "str", + }, "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, "instance_type": {"key": "instanceType", "type": "str"}, "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, @@ -17302,8 +18807,14 @@ class ManagedOnlineDeployment(OnlineDeploymentProperties): "model_mount_path": {"key": "modelMountPath", "type": "str"}, "provisioning_state": {"key": "provisioningState", "type": "str"}, "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, - "request_settings": {"key": "requestSettings", "type": "OnlineRequestSettings"}, - "scale_settings": {"key": "scaleSettings", "type": "OnlineScaleSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, } def __init__( @@ -17315,7 +18826,9 @@ def __init__( environment_variables: Optional[Dict[str, str]] = None, properties: Optional[Dict[str, str]] = None, app_insights_enabled: Optional[bool] = False, - egress_public_network_access: Optional[Union[str, "EgressPublicNetworkAccessType"]] = None, + egress_public_network_access: Optional[ + Union[str, "EgressPublicNetworkAccessType"] + ] = None, instance_type: Optional[str] = None, liveness_probe: Optional["ProbeSettings"] = None, model: Optional[str] = None, @@ -17418,14 +18931,19 @@ class ManagedServiceIdentity(msrest.serialization.Model): "principal_id": {"key": "principalId", "type": "str"}, "tenant_id": {"key": "tenantId", "type": "str"}, "type": {"key": "type", "type": "str"}, - "user_assigned_identities": {"key": "userAssignedIdentities", "type": "{UserAssignedIdentity}"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{UserAssignedIdentity}", + }, } def __init__( self, *, type: Union[str, "ManagedServiceIdentityType"], - user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, + user_assigned_identities: Optional[ + Dict[str, "UserAssignedIdentity"] + ] = None, **kwargs ): """ @@ -17485,7 +19003,10 @@ class MaterializationSettings(msrest.serialization.Model): _attribute_map = { "notification": {"key": "notification", "type": "NotificationSetting"}, - "resource": {"key": "resource", "type": "MaterializationComputeResource"}, + "resource": { + "key": "resource", + "type": "MaterializationComputeResource", + }, "schedule": {"key": "schedule", "type": "RecurrenceTrigger"}, "spark_configuration": {"key": "sparkConfiguration", "type": "{str}"}, "store_type": {"key": "storeType", "type": "str"}, @@ -17548,7 +19069,13 @@ class MedianStoppingPolicy(EarlyTerminationPolicy): "policy_type": {"key": "policyType", "type": "str"}, } - def __init__(self, *, delay_evaluation: Optional[int] = 0, evaluation_interval: Optional[int] = 0, **kwargs): + def __init__( + self, + *, + delay_evaluation: Optional[int] = 0, + evaluation_interval: Optional[int] = 0, + **kwargs + ): """ :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. :paramtype delay_evaluation: int @@ -17556,7 +19083,9 @@ def __init__(self, *, delay_evaluation: Optional[int] = 0, evaluation_interval: :paramtype evaluation_interval: int """ super(MedianStoppingPolicy, self).__init__( - delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs + delay_evaluation=delay_evaluation, + evaluation_interval=evaluation_interval, + **kwargs ) self.policy_type = "MedianStopping" # type: str @@ -17583,7 +19112,10 @@ class MLAssistConfiguration(msrest.serialization.Model): } _subtype_map = { - "ml_assist": {"Disabled": "MLAssistConfigurationDisabled", "Enabled": "MLAssistConfigurationEnabled"} + "ml_assist": { + "Disabled": "MLAssistConfigurationDisabled", + "Enabled": "MLAssistConfigurationEnabled", + } } def __init__(self, **kwargs): @@ -17633,17 +19165,35 @@ class MLAssistConfigurationEnabled(MLAssistConfiguration): _validation = { "ml_assist": {"required": True}, - "inferencing_compute_binding": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, - "training_compute_binding": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "inferencing_compute_binding": { + "required": True, + "pattern": r"[a-zA-Z0-9_]", + }, + "training_compute_binding": { + "required": True, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { "ml_assist": {"key": "mlAssist", "type": "str"}, - "inferencing_compute_binding": {"key": "inferencingComputeBinding", "type": "str"}, - "training_compute_binding": {"key": "trainingComputeBinding", "type": "str"}, + "inferencing_compute_binding": { + "key": "inferencingComputeBinding", + "type": "str", + }, + "training_compute_binding": { + "key": "trainingComputeBinding", + "type": "str", + }, } - def __init__(self, *, inferencing_compute_binding: str, training_compute_binding: str, **kwargs): + def __init__( + self, + *, + inferencing_compute_binding: str, + training_compute_binding: str, + **kwargs + ): """ :keyword inferencing_compute_binding: Required. [Required] AML compute binding used in inferencing. @@ -17704,7 +19254,9 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(MLFlowModelJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(MLFlowModelJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri self.job_input_type = "mlflow_model" # type: str @@ -17770,7 +19322,12 @@ def __init__( :paramtype description: str """ super(MLFlowModelJobOutput, self).__init__( - description=description, asset_name=asset_name, asset_version=asset_version, mode=mode, uri=uri, **kwargs + description=description, + asset_name=asset_name, + asset_version=asset_version, + mode=mode, + uri=uri, + **kwargs ) self.asset_name = asset_name self.asset_version = asset_version @@ -17910,7 +19467,9 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(MLTableJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(MLTableJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri self.job_input_type = "mltable" # type: str @@ -17976,7 +19535,12 @@ def __init__( :paramtype description: str """ super(MLTableJobOutput, self).__init__( - description=description, asset_name=asset_name, asset_version=asset_version, mode=mode, uri=uri, **kwargs + description=description, + asset_name=asset_name, + asset_version=asset_version, + mode=mode, + uri=uri, + **kwargs ) self.asset_name = asset_name self.asset_version = asset_version @@ -18055,7 +19619,10 @@ class ModelContainer(Resource): "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "ModelContainerProperties"}, + "properties": { + "key": "properties", + "type": "ModelContainerProperties", + }, } def __init__(self, *, properties: "ModelContainerProperties", **kwargs): @@ -18126,7 +19693,11 @@ def __init__( :paramtype is_archived: bool """ super(ModelContainerProperties, self).__init__( - description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs ) self.provisioning_state = None @@ -18146,7 +19717,13 @@ class ModelContainerResourceArmPaginatedResult(msrest.serialization.Model): "value": {"key": "value", "type": "[ModelContainer]"}, } - def __init__(self, *, next_link: Optional[str] = None, value: Optional[List["ModelContainer"]] = None, **kwargs): + def __init__( + self, + *, + next_link: Optional[str] = None, + value: Optional[List["ModelContainer"]] = None, + **kwargs + ): """ :keyword next_link: The link to the next page of ModelContainer objects. If null, there are no additional pages. @@ -18154,7 +19731,9 @@ def __init__(self, *, next_link: Optional[str] = None, value: Optional[List["Mod :keyword value: An array of objects of type ModelContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelContainer] """ - super(ModelContainerResourceArmPaginatedResult, self).__init__(**kwargs) + super(ModelContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -18373,7 +19952,13 @@ class ModelVersionResourceArmPaginatedResult(msrest.serialization.Model): "value": {"key": "value", "type": "[ModelVersion]"}, } - def __init__(self, *, next_link: Optional[str] = None, value: Optional[List["ModelVersion"]] = None, **kwargs): + def __init__( + self, + *, + next_link: Optional[str] = None, + value: Optional[List["ModelVersion"]] = None, + **kwargs + ): """ :keyword next_link: The link to the next page of ModelVersion objects. If null, there are no additional pages. @@ -18404,10 +19989,15 @@ class Mpi(DistributionConfiguration): _attribute_map = { "distribution_type": {"key": "distributionType", "type": "str"}, - "process_count_per_instance": {"key": "processCountPerInstance", "type": "int"}, + "process_count_per_instance": { + "key": "processCountPerInstance", + "type": "int", + }, } - def __init__(self, *, process_count_per_instance: Optional[int] = None, **kwargs): + def __init__( + self, *, process_count_per_instance: Optional[int] = None, **kwargs + ): """ :keyword process_count_per_instance: Number of processes per MPI node. :paramtype process_count_per_instance: int @@ -18445,9 +20035,15 @@ class NlpFixedParameters(msrest.serialization.Model): """ _attribute_map = { - "gradient_accumulation_steps": {"key": "gradientAccumulationSteps", "type": "int"}, + "gradient_accumulation_steps": { + "key": "gradientAccumulationSteps", + "type": "int", + }, "learning_rate": {"key": "learningRate", "type": "float"}, - "learning_rate_scheduler": {"key": "learningRateScheduler", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, "model_name": {"key": "modelName", "type": "str"}, "number_of_epochs": {"key": "numberOfEpochs", "type": "int"}, "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, @@ -18461,7 +20057,9 @@ def __init__( *, gradient_accumulation_steps: Optional[int] = None, learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "NlpLearningRateScheduler"]] = None, + learning_rate_scheduler: Optional[ + Union[str, "NlpLearningRateScheduler"] + ] = None, model_name: Optional[str] = None, number_of_epochs: Optional[int] = None, training_batch_size: Optional[int] = None, @@ -18532,9 +20130,15 @@ class NlpParameterSubspace(msrest.serialization.Model): """ _attribute_map = { - "gradient_accumulation_steps": {"key": "gradientAccumulationSteps", "type": "str"}, + "gradient_accumulation_steps": { + "key": "gradientAccumulationSteps", + "type": "str", + }, "learning_rate": {"key": "learningRate", "type": "str"}, - "learning_rate_scheduler": {"key": "learningRateScheduler", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, "model_name": {"key": "modelName", "type": "str"}, "number_of_epochs": {"key": "numberOfEpochs", "type": "str"}, "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, @@ -18609,7 +20213,10 @@ class NlpSweepSettings(msrest.serialization.Model): } _attribute_map = { - "early_termination": {"key": "earlyTermination", "type": "EarlyTerminationPolicy"}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, "sampling_algorithm": {"key": "samplingAlgorithm", "type": "str"}, } @@ -18655,18 +20262,35 @@ class NlpVertical(msrest.serialization.Model): """ _attribute_map = { - "featurization_settings": {"key": "featurizationSettings", "type": "NlpVerticalFeaturizationSettings"}, - "fixed_parameters": {"key": "fixedParameters", "type": "NlpFixedParameters"}, - "limit_settings": {"key": "limitSettings", "type": "NlpVerticalLimitSettings"}, - "search_space": {"key": "searchSpace", "type": "[NlpParameterSubspace]"}, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "NlpFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "search_space": { + "key": "searchSpace", + "type": "[NlpParameterSubspace]", + }, "sweep_settings": {"key": "sweepSettings", "type": "NlpSweepSettings"}, - "validation_data": {"key": "validationData", "type": "MLTableJobInput"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, } def __init__( self, *, - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "NlpVerticalFeaturizationSettings" + ] = None, fixed_parameters: Optional["NlpFixedParameters"] = None, limit_settings: Optional["NlpVerticalLimitSettings"] = None, search_space: Optional[List["NlpParameterSubspace"]] = None, @@ -18716,7 +20340,9 @@ def __init__(self, *, dataset_language: Optional[str] = None, **kwargs): :keyword dataset_language: Dataset language, useful for the text data. :paramtype dataset_language: str """ - super(NlpVerticalFeaturizationSettings, self).__init__(dataset_language=dataset_language, **kwargs) + super(NlpVerticalFeaturizationSettings, self).__init__( + dataset_language=dataset_language, **kwargs + ) class NlpVerticalLimitSettings(msrest.serialization.Model): @@ -18820,7 +20446,9 @@ def __init__(self, **kwargs): self.preempted_node_count = None -class NoneAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class NoneAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """NoneAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -18876,7 +20504,11 @@ def __init__( :paramtype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat """ super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__( - category=category, target=target, value=value, value_format=value_format, **kwargs + category=category, + target=target, + value=value, + value_format=value_format, + **kwargs ) self.auth_type = "None" # type: str @@ -18978,7 +20610,13 @@ class NotebookPreparationError(msrest.serialization.Model): "status_code": {"key": "statusCode", "type": "int"}, } - def __init__(self, *, error_message: Optional[str] = None, status_code: Optional[int] = None, **kwargs): + def __init__( + self, + *, + error_message: Optional[str] = None, + status_code: Optional[int] = None, + **kwargs + ): """ :keyword error_message: :paramtype error_message: str @@ -19005,7 +20643,10 @@ class NotebookResourceInfo(msrest.serialization.Model): _attribute_map = { "fqdn": {"key": "fqdn", "type": "str"}, "resource_id": {"key": "resourceId", "type": "str"}, - "notebook_preparation_error": {"key": "notebookPreparationError", "type": "NotebookPreparationError"}, + "notebook_preparation_error": { + "key": "notebookPreparationError", + "type": "NotebookPreparationError", + }, } def __init__( @@ -19013,7 +20654,9 @@ def __init__( *, fqdn: Optional[str] = None, resource_id: Optional[str] = None, - notebook_preparation_error: Optional["NotebookPreparationError"] = None, + notebook_preparation_error: Optional[ + "NotebookPreparationError" + ] = None, **kwargs ): """ @@ -19050,7 +20693,9 @@ class NotificationSetting(msrest.serialization.Model): def __init__( self, *, - email_on: Optional[List[Union[str, "EmailNotificationEnableType"]]] = None, + email_on: Optional[ + List[Union[str, "EmailNotificationEnableType"]] + ] = None, emails: Optional[List[str]] = None, **kwargs ): @@ -19089,7 +20734,9 @@ class Objective(msrest.serialization.Model): "primary_metric": {"key": "primaryMetric", "type": "str"}, } - def __init__(self, *, goal: Union[str, "Goal"], primary_metric: str, **kwargs): + def __init__( + self, *, goal: Union[str, "Goal"], primary_metric: str, **kwargs + ): """ :keyword goal: Required. [Required] Defines supported metric goals for hyperparameter tuning. Possible values include: "Minimize", "Maximize". @@ -19153,7 +20800,10 @@ class OnlineDeployment(TrackedResource): "location": {"key": "location", "type": "str"}, "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, "kind": {"key": "kind", "type": "str"}, - "properties": {"key": "properties", "type": "OnlineDeploymentProperties"}, + "properties": { + "key": "properties", + "type": "OnlineDeploymentProperties", + }, "sku": {"key": "sku", "type": "Sku"}, } @@ -19183,14 +20833,18 @@ def __init__( :keyword sku: Sku details required for ARM contract for Autoscaling. :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ - super(OnlineDeployment, self).__init__(tags=tags, location=location, **kwargs) + super(OnlineDeployment, self).__init__( + tags=tags, location=location, **kwargs + ) self.identity = identity self.kind = kind self.properties = properties self.sku = sku -class OnlineDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class OnlineDeploymentTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of OnlineDeployment entities. :ivar next_link: The link to the next page of OnlineDeployment objects. If null, there are no @@ -19205,7 +20859,13 @@ class OnlineDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Mod "value": {"key": "value", "type": "[OnlineDeployment]"}, } - def __init__(self, *, next_link: Optional[str] = None, value: Optional[List["OnlineDeployment"]] = None, **kwargs): + def __init__( + self, + *, + next_link: Optional[str] = None, + value: Optional[List["OnlineDeployment"]] = None, + **kwargs + ): """ :keyword next_link: The link to the next page of OnlineDeployment objects. If null, there are no additional pages. @@ -19213,7 +20873,9 @@ def __init__(self, *, next_link: Optional[str] = None, value: Optional[List["Onl :keyword value: An array of objects of type OnlineDeployment. :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineDeployment] """ - super(OnlineDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) + super( + OnlineDeploymentTrackedResourceArmPaginatedResult, self + ).__init__(**kwargs) self.next_link = next_link self.value = value @@ -19269,7 +20931,10 @@ class OnlineEndpoint(TrackedResource): "location": {"key": "location", "type": "str"}, "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, "kind": {"key": "kind", "type": "str"}, - "properties": {"key": "properties", "type": "OnlineEndpointProperties"}, + "properties": { + "key": "properties", + "type": "OnlineEndpointProperties", + }, "sku": {"key": "sku", "type": "Sku"}, } @@ -19299,7 +20964,9 @@ def __init__( :keyword sku: Sku details required for ARM contract for Autoscaling. :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ - super(OnlineEndpoint, self).__init__(tags=tags, location=location, **kwargs) + super(OnlineEndpoint, self).__init__( + tags=tags, location=location, **kwargs + ) self.identity = identity self.kind = kind self.properties = properties @@ -19378,7 +21045,9 @@ def __init__( properties: Optional[Dict[str, str]] = None, compute: Optional[str] = None, mirror_traffic: Optional[Dict[str, int]] = None, - public_network_access: Optional[Union[str, "PublicNetworkAccessType"]] = None, + public_network_access: Optional[ + Union[str, "PublicNetworkAccessType"] + ] = None, traffic: Optional[Dict[str, int]] = None, **kwargs ): @@ -19410,7 +21079,11 @@ def __init__( :paramtype traffic: dict[str, int] """ super(OnlineEndpointProperties, self).__init__( - auth_mode=auth_mode, description=description, keys=keys, properties=properties, **kwargs + auth_mode=auth_mode, + description=description, + keys=keys, + properties=properties, + **kwargs ) self.compute = compute self.mirror_traffic = mirror_traffic @@ -19419,7 +21092,9 @@ def __init__( self.traffic = traffic -class OnlineEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class OnlineEndpointTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of OnlineEndpoint entities. :ivar next_link: The link to the next page of OnlineEndpoint objects. If null, there are no @@ -19434,7 +21109,13 @@ class OnlineEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model "value": {"key": "value", "type": "[OnlineEndpoint]"}, } - def __init__(self, *, next_link: Optional[str] = None, value: Optional[List["OnlineEndpoint"]] = None, **kwargs): + def __init__( + self, + *, + next_link: Optional[str] = None, + value: Optional[List["OnlineEndpoint"]] = None, + **kwargs + ): """ :keyword next_link: The link to the next page of OnlineEndpoint objects. If null, there are no additional pages. @@ -19442,7 +21123,9 @@ def __init__(self, *, next_link: Optional[str] = None, value: Optional[List["Onl :keyword value: An array of objects of type OnlineEndpoint. :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] """ - super(OnlineEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) + super(OnlineEndpointTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -19518,7 +21201,10 @@ class OnlineRequestSettings(msrest.serialization.Model): """ _attribute_map = { - "max_concurrent_requests_per_instance": {"key": "maxConcurrentRequestsPerInstance", "type": "int"}, + "max_concurrent_requests_per_instance": { + "key": "maxConcurrentRequestsPerInstance", + "type": "int", + }, "max_queue_wait": {"key": "maxQueueWait", "type": "duration"}, "request_timeout": {"key": "requestTimeout", "type": "duration"}, } @@ -19544,7 +21230,9 @@ def __init__( :paramtype request_timeout: ~datetime.timedelta """ super(OnlineRequestSettings, self).__init__(**kwargs) - self.max_concurrent_requests_per_instance = max_concurrent_requests_per_instance + self.max_concurrent_requests_per_instance = ( + max_concurrent_requests_per_instance + ) self.max_queue_wait = max_queue_wait self.request_timeout = request_timeout @@ -19573,7 +21261,13 @@ class OutputPathAssetReference(AssetReferenceBase): "path": {"key": "path", "type": "str"}, } - def __init__(self, *, job_id: Optional[str] = None, path: Optional[str] = None, **kwargs): + def __init__( + self, + *, + job_id: Optional[str] = None, + path: Optional[str] = None, + **kwargs + ): """ :keyword job_id: ARM resource ID of the job. :paramtype job_id: str @@ -19707,7 +21401,13 @@ class PackageInputPathVersion(PackageInputPathBase): "resource_version": {"key": "resourceVersion", "type": "str"}, } - def __init__(self, *, resource_name: Optional[str] = None, resource_version: Optional[str] = None, **kwargs): + def __init__( + self, + *, + resource_name: Optional[str] = None, + resource_version: Optional[str] = None, + **kwargs + ): """ :keyword resource_name: Input resource name. :paramtype resource_name: str @@ -19747,18 +21447,39 @@ class PackageRequest(msrest.serialization.Model): _validation = { "inferencing_server": {"required": True}, - "target_environment_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "target_environment_name": { + "required": True, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - "base_environment_source": {"key": "baseEnvironmentSource", "type": "BaseEnvironmentSource"}, - "environment_variables": {"key": "environmentVariables", "type": "{str}"}, - "inferencing_server": {"key": "inferencingServer", "type": "InferencingServer"}, + "base_environment_source": { + "key": "baseEnvironmentSource", + "type": "BaseEnvironmentSource", + }, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "inferencing_server": { + "key": "inferencingServer", + "type": "InferencingServer", + }, "inputs": {"key": "inputs", "type": "[ModelPackageInput]"}, - "model_configuration": {"key": "modelConfiguration", "type": "ModelConfiguration"}, + "model_configuration": { + "key": "modelConfiguration", + "type": "ModelConfiguration", + }, "tags": {"key": "tags", "type": "{str}"}, - "target_environment_name": {"key": "targetEnvironmentName", "type": "str"}, - "target_environment_version": {"key": "targetEnvironmentVersion", "type": "str"}, + "target_environment_name": { + "key": "targetEnvironmentName", + "type": "str", + }, + "target_environment_version": { + "key": "targetEnvironmentVersion", + "type": "str", + }, } def __init__( @@ -19843,7 +21564,10 @@ class PackageResponse(PackageRequest): _validation = { "inferencing_server": {"required": True}, - "target_environment_name": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, + "target_environment_name": { + "required": True, + "pattern": r"[a-zA-Z0-9_]", + }, "build_id": {"readonly": True}, "build_state": {"readonly": True}, "log_url": {"readonly": True}, @@ -19851,14 +21575,32 @@ class PackageResponse(PackageRequest): } _attribute_map = { - "base_environment_source": {"key": "baseEnvironmentSource", "type": "BaseEnvironmentSource"}, - "environment_variables": {"key": "environmentVariables", "type": "{str}"}, - "inferencing_server": {"key": "inferencingServer", "type": "InferencingServer"}, + "base_environment_source": { + "key": "baseEnvironmentSource", + "type": "BaseEnvironmentSource", + }, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "inferencing_server": { + "key": "inferencingServer", + "type": "InferencingServer", + }, "inputs": {"key": "inputs", "type": "[ModelPackageInput]"}, - "model_configuration": {"key": "modelConfiguration", "type": "ModelConfiguration"}, + "model_configuration": { + "key": "modelConfiguration", + "type": "ModelConfiguration", + }, "tags": {"key": "tags", "type": "{str}"}, - "target_environment_name": {"key": "targetEnvironmentName", "type": "str"}, - "target_environment_version": {"key": "targetEnvironmentVersion", "type": "str"}, + "target_environment_name": { + "key": "targetEnvironmentName", + "type": "str", + }, + "target_environment_version": { + "key": "targetEnvironmentVersion", + "type": "str", + }, "build_id": {"key": "buildId", "type": "str"}, "build_state": {"key": "buildState", "type": "str"}, "log_url": {"key": "logUrl", "type": "str"}, @@ -19929,7 +21671,13 @@ class PaginatedComputeResourcesList(msrest.serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, value: Optional[List["ComputeResource"]] = None, next_link: Optional[str] = None, **kwargs): + def __init__( + self, + *, + value: Optional[List["ComputeResource"]] = None, + next_link: Optional[str] = None, + **kwargs + ): """ :keyword value: An array of Machine Learning compute objects wrapped in ARM resource envelope. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComputeResource] @@ -19961,7 +21709,9 @@ def __init__(self, *, description: Optional[str] = None, **kwargs): self.description = description -class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties(msrest.serialization.Model): +class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties( + msrest.serialization.Model +): """Strictly used in update requests. :ivar properties: Additional attributes of the entity. @@ -19976,7 +21726,11 @@ class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties(msrest.s } def __init__( - self, *, properties: Optional["PartialBatchDeployment"] = None, tags: Optional[Dict[str, str]] = None, **kwargs + self, + *, + properties: Optional["PartialBatchDeployment"] = None, + tags: Optional[Dict[str, str]] = None, + **kwargs ): """ :keyword properties: Additional attributes of the entity. @@ -19984,7 +21738,10 @@ def __init__( :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] """ - super(PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, self).__init__(**kwargs) + super( + PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, + self, + ).__init__(**kwargs) self.properties = properties self.tags = tags @@ -20005,7 +21762,10 @@ class PartialManagedServiceIdentity(msrest.serialization.Model): _attribute_map = { "type": {"key": "type", "type": "str"}, - "user_assigned_identities": {"key": "userAssignedIdentities", "type": "{object}"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{object}", + }, } def __init__( @@ -20062,7 +21822,10 @@ class PartialMinimalTrackedResourceWithIdentity(PartialMinimalTrackedResource): _attribute_map = { "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "PartialManagedServiceIdentity"}, + "identity": { + "key": "identity", + "type": "PartialManagedServiceIdentity", + }, } def __init__( @@ -20078,7 +21841,9 @@ def __init__( :keyword identity: Managed service identity (system assigned and/or user assigned identities). :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity """ - super(PartialMinimalTrackedResourceWithIdentity, self).__init__(tags=tags, **kwargs) + super(PartialMinimalTrackedResourceWithIdentity, self).__init__( + tags=tags, **kwargs + ) self.identity = identity @@ -20096,14 +21861,22 @@ class PartialMinimalTrackedResourceWithSku(PartialMinimalTrackedResource): "sku": {"key": "sku", "type": "PartialSku"}, } - def __init__(self, *, tags: Optional[Dict[str, str]] = None, sku: Optional["PartialSku"] = None, **kwargs): + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + sku: Optional["PartialSku"] = None, + **kwargs + ): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] :keyword sku: Sku details required for ARM contract for Autoscaling. :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku """ - super(PartialMinimalTrackedResourceWithSku, self).__init__(tags=tags, **kwargs) + super(PartialMinimalTrackedResourceWithSku, self).__init__( + tags=tags, **kwargs + ) self.sku = sku @@ -20124,7 +21897,10 @@ class PartialRegistryPartialTrackedResource(msrest.serialization.Model): """ _attribute_map = { - "identity": {"key": "identity", "type": "PartialManagedServiceIdentity"}, + "identity": { + "key": "identity", + "type": "PartialManagedServiceIdentity", + }, "kind": {"key": "kind", "type": "str"}, "properties": {"key": "properties", "type": "object"}, "sku": {"key": "sku", "type": "PartialSku"}, @@ -20253,7 +22029,9 @@ def __init__(self, **kwargs): self.value = None -class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class PATAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """PATAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -20287,7 +22065,10 @@ class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): "target": {"key": "target", "type": "str"}, "value": {"key": "value", "type": "str"}, "value_format": {"key": "valueFormat", "type": "str"}, - "credentials": {"key": "credentials", "type": "WorkspaceConnectionPersonalAccessToken"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionPersonalAccessToken", + }, } def __init__( @@ -20317,7 +22098,11 @@ def __init__( ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken """ super(PATAuthTypeWorkspaceConnectionProperties, self).__init__( - category=category, target=target, value=value, value_format=value_format, **kwargs + category=category, + target=target, + value=value, + value_format=value_format, + **kwargs ) self.auth_type = "PAT" # type: str self.credentials = credentials @@ -20334,7 +22119,9 @@ class PersonalComputeInstanceSettings(msrest.serialization.Model): "assigned_user": {"key": "assignedUser", "type": "AssignedUser"}, } - def __init__(self, *, assigned_user: Optional["AssignedUser"] = None, **kwargs): + def __init__( + self, *, assigned_user: Optional["AssignedUser"] = None, **kwargs + ): """ :keyword assigned_user: A user explicitly assigned to a personal compute instance. :paramtype assigned_user: ~azure.mgmt.machinelearningservices.models.AssignedUser @@ -20411,7 +22198,10 @@ class PipelineJob(JobBaseProperties): "identity": {"key": "identity", "type": "IdentityConfiguration"}, "is_archived": {"key": "isArchived", "type": "bool"}, "job_type": {"key": "jobType", "type": "str"}, - "notification_setting": {"key": "notificationSetting", "type": "NotificationSetting"}, + "notification_setting": { + "key": "notificationSetting", + "type": "NotificationSetting", + }, "services": {"key": "services", "type": "{JobService}"}, "status": {"key": "status", "type": "str"}, "inputs": {"key": "inputs", "type": "{JobInput}"}, @@ -20583,12 +22373,18 @@ class PrivateEndpointConnection(Resource): "location": {"key": "location", "type": "str"}, "tags": {"key": "tags", "type": "{str}"}, "sku": {"key": "sku", "type": "Sku"}, - "private_endpoint": {"key": "properties.privateEndpoint", "type": "PrivateEndpoint"}, + "private_endpoint": { + "key": "properties.privateEndpoint", + "type": "PrivateEndpoint", + }, "private_link_service_connection_state": { "key": "properties.privateLinkServiceConnectionState", "type": "PrivateLinkServiceConnectionState", }, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "provisioning_state": { + "key": "properties.provisioningState", + "type": "str", + }, } def __init__( @@ -20599,7 +22395,9 @@ def __init__( tags: Optional[Dict[str, str]] = None, sku: Optional["Sku"] = None, private_endpoint: Optional["PrivateEndpoint"] = None, - private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, + private_link_service_connection_state: Optional[ + "PrivateLinkServiceConnectionState" + ] = None, **kwargs ): """ @@ -20624,7 +22422,9 @@ def __init__( self.tags = tags self.sku = sku self.private_endpoint = private_endpoint - self.private_link_service_connection_state = private_link_service_connection_state + self.private_link_service_connection_state = ( + private_link_service_connection_state + ) self.provisioning_state = None @@ -20639,7 +22439,12 @@ class PrivateEndpointConnectionListResult(msrest.serialization.Model): "value": {"key": "value", "type": "[PrivateEndpointConnection]"}, } - def __init__(self, *, value: Optional[List["PrivateEndpointConnection"]] = None, **kwargs): + def __init__( + self, + *, + value: Optional[List["PrivateEndpointConnection"]] = None, + **kwargs + ): """ :keyword value: Array of private endpoint connections. :paramtype value: list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] @@ -20699,8 +22504,14 @@ class PrivateLinkResource(Resource): "tags": {"key": "tags", "type": "{str}"}, "sku": {"key": "sku", "type": "Sku"}, "group_id": {"key": "properties.groupId", "type": "str"}, - "required_members": {"key": "properties.requiredMembers", "type": "[str]"}, - "required_zone_names": {"key": "properties.requiredZoneNames", "type": "[str]"}, + "required_members": { + "key": "properties.requiredMembers", + "type": "[str]", + }, + "required_zone_names": { + "key": "properties.requiredZoneNames", + "type": "[str]", + }, } def __init__( @@ -20746,7 +22557,9 @@ class PrivateLinkResourceListResult(msrest.serialization.Model): "value": {"key": "value", "type": "[PrivateLinkResource]"}, } - def __init__(self, *, value: Optional[List["PrivateLinkResource"]] = None, **kwargs): + def __init__( + self, *, value: Optional[List["PrivateLinkResource"]] = None, **kwargs + ): """ :keyword value: Array of private link resources. :paramtype value: list[~azure.mgmt.machinelearningservices.models.PrivateLinkResource] @@ -20779,7 +22592,9 @@ class PrivateLinkServiceConnectionState(msrest.serialization.Model): def __init__( self, *, - status: Optional[Union[str, "PrivateEndpointServiceConnectionStatus"]] = None, + status: Optional[ + Union[str, "PrivateEndpointServiceConnectionStatus"] + ] = None, description: Optional[str] = None, actions_required: Optional[str] = None, **kwargs @@ -20880,10 +22695,22 @@ class ProgressMetrics(msrest.serialization.Model): } _attribute_map = { - "completed_datapoint_count": {"key": "completedDatapointCount", "type": "long"}, - "incremental_data_last_refresh_date_time": {"key": "incrementalDataLastRefreshDateTime", "type": "iso-8601"}, - "skipped_datapoint_count": {"key": "skippedDatapointCount", "type": "long"}, - "total_datapoint_count": {"key": "totalDatapointCount", "type": "long"}, + "completed_datapoint_count": { + "key": "completedDatapointCount", + "type": "long", + }, + "incremental_data_last_refresh_date_time": { + "key": "incrementalDataLastRefreshDateTime", + "type": "iso-8601", + }, + "skipped_datapoint_count": { + "key": "skippedDatapointCount", + "type": "long", + }, + "total_datapoint_count": { + "key": "totalDatapointCount", + "type": "long", + }, } def __init__(self, **kwargs): @@ -20913,10 +22740,15 @@ class PyTorch(DistributionConfiguration): _attribute_map = { "distribution_type": {"key": "distributionType", "type": "str"}, - "process_count_per_instance": {"key": "processCountPerInstance", "type": "int"}, + "process_count_per_instance": { + "key": "processCountPerInstance", + "type": "int", + }, } - def __init__(self, *, process_count_per_instance: Optional[int] = None, **kwargs): + def __init__( + self, *, process_count_per_instance: Optional[int] = None, **kwargs + ): """ :keyword process_count_per_instance: Number of processes per node. :paramtype process_count_per_instance: int @@ -20941,7 +22773,13 @@ class QueueSettings(msrest.serialization.Model): "priority": {"key": "priority", "type": "int"}, } - def __init__(self, *, job_tier: Optional[Union[str, "JobTier"]] = None, priority: Optional[int] = None, **kwargs): + def __init__( + self, + *, + job_tier: Optional[Union[str, "JobTier"]] = None, + priority: Optional[int] = None, + **kwargs + ): """ :keyword job_tier: Enum to determine the job tier. Possible values include: "Spot", "Basic", "Standard", "Premium". @@ -21016,7 +22854,11 @@ class QuotaUpdateParameters(msrest.serialization.Model): } def __init__( - self, *, value: Optional[List["QuotaBaseProperties"]] = None, location: Optional[str] = None, **kwargs + self, + *, + value: Optional[List["QuotaBaseProperties"]] = None, + location: Optional[str] = None, + **kwargs ): """ :keyword value: The list for update quota. @@ -21053,7 +22895,10 @@ class RandomSamplingAlgorithm(SamplingAlgorithm): } _attribute_map = { - "sampling_algorithm_type": {"key": "samplingAlgorithmType", "type": "str"}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, "logbase": {"key": "logbase", "type": "str"}, "rule": {"key": "rule", "type": "str"}, "seed": {"key": "seed", "type": "int"}, @@ -21215,7 +23060,12 @@ def __init__( :keyword schedule: The recurrence schedule. :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule """ - super(RecurrenceTrigger, self).__init__(end_time=end_time, start_time=start_time, time_zone=time_zone, **kwargs) + super(RecurrenceTrigger, self).__init__( + end_time=end_time, + start_time=start_time, + time_zone=time_zone, + **kwargs + ) self.trigger_type = "Recurrence" # type: str self.frequency = frequency self.interval = interval @@ -21243,7 +23093,13 @@ class RegenerateEndpointKeysRequest(msrest.serialization.Model): "key_value": {"key": "keyValue", "type": "str"}, } - def __init__(self, *, key_type: Union[str, "KeyType"], key_value: Optional[str] = None, **kwargs): + def __init__( + self, + *, + key_type: Union[str, "KeyType"], + key_value: Optional[str] = None, + **kwargs + ): """ :keyword key_type: Required. [Required] Specification for which type of key to generate. Primary or Secondary. Possible values include: "Primary", "Secondary". @@ -21368,7 +23224,9 @@ class RegistryListCredentialsResult(msrest.serialization.Model): "passwords": {"key": "passwords", "type": "[Password]"}, } - def __init__(self, *, passwords: Optional[List["Password"]] = None, **kwargs): + def __init__( + self, *, passwords: Optional[List["Password"]] = None, **kwargs + ): """ :keyword passwords: :paramtype passwords: list[~azure.mgmt.machinelearningservices.models.Password] @@ -21414,12 +23272,24 @@ class RegistryProperties(ResourceBase): "tags": {"key": "tags", "type": "{str}"}, "public_network_access": {"key": "publicNetworkAccess", "type": "str"}, "discovery_url": {"key": "discoveryUrl", "type": "str"}, - "intellectual_property_publisher": {"key": "intellectualPropertyPublisher", "type": "str"}, - "managed_resource_group": {"key": "managedResourceGroup", "type": "ArmResourceId"}, + "intellectual_property_publisher": { + "key": "intellectualPropertyPublisher", + "type": "str", + }, + "managed_resource_group": { + "key": "managedResourceGroup", + "type": "ArmResourceId", + }, "ml_flow_registry_uri": {"key": "mlFlowRegistryUri", "type": "str"}, "private_link_count": {"key": "privateLinkCount", "type": "int"}, - "region_details": {"key": "regionDetails", "type": "[RegistryRegionArmDetails]"}, - "managed_resource_group_tags": {"key": "managedResourceGroupTags", "type": "{str}"}, + "region_details": { + "key": "regionDetails", + "type": "[RegistryRegionArmDetails]", + }, + "managed_resource_group_tags": { + "key": "managedResourceGroupTags", + "type": "{str}", + }, } def __init__( @@ -21464,7 +23334,9 @@ def __init__( associated with this registry. :paramtype managed_resource_group_tags: dict[str, str] """ - super(RegistryProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + super(RegistryProperties, self).__init__( + description=description, properties=properties, tags=tags, **kwargs + ) self.public_network_access = public_network_access self.discovery_url = discovery_url self.intellectual_property_publisher = intellectual_property_publisher @@ -21490,7 +23362,10 @@ class RegistryRegionArmDetails(msrest.serialization.Model): _attribute_map = { "acr_details": {"key": "acrDetails", "type": "[AcrDetails]"}, "location": {"key": "location", "type": "str"}, - "storage_account_details": {"key": "storageAccountDetails", "type": "[StorageAccountDetails]"}, + "storage_account_details": { + "key": "storageAccountDetails", + "type": "[StorageAccountDetails]", + }, } def __init__( @@ -21498,7 +23373,9 @@ def __init__( *, acr_details: Optional[List["AcrDetails"]] = None, location: Optional[str] = None, - storage_account_details: Optional[List["StorageAccountDetails"]] = None, + storage_account_details: Optional[ + List["StorageAccountDetails"] + ] = None, **kwargs ): """ @@ -21531,7 +23408,13 @@ class RegistryTrackedResourceArmPaginatedResult(msrest.serialization.Model): "value": {"key": "value", "type": "[Registry]"}, } - def __init__(self, *, next_link: Optional[str] = None, value: Optional[List["Registry"]] = None, **kwargs): + def __init__( + self, + *, + next_link: Optional[str] = None, + value: Optional[List["Registry"]] = None, + **kwargs + ): """ :keyword next_link: The link to the next page of Registry objects. If null, there are no additional pages. @@ -21539,7 +23422,9 @@ def __init__(self, *, next_link: Optional[str] = None, value: Optional[List["Reg :keyword value: An array of objects of type Registry. :paramtype value: list[~azure.mgmt.machinelearningservices.models.Registry] """ - super(RegistryTrackedResourceArmPaginatedResult, self).__init__(**kwargs) + super(RegistryTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -21613,16 +23498,40 @@ class Regression(AutoMLVertical, TableVertical): } _attribute_map = { - "cv_split_column_names": {"key": "cvSplitColumnNames", "type": "[str]"}, - "featurization_settings": {"key": "featurizationSettings", "type": "TableVerticalFeaturizationSettings"}, - "fixed_parameters": {"key": "fixedParameters", "type": "TableFixedParameters"}, - "limit_settings": {"key": "limitSettings", "type": "TableVerticalLimitSettings"}, - "n_cross_validations": {"key": "nCrossValidations", "type": "NCrossValidations"}, - "search_space": {"key": "searchSpace", "type": "[TableParameterSubspace]"}, - "sweep_settings": {"key": "sweepSettings", "type": "TableSweepSettings"}, + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "TableFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "search_space": { + "key": "searchSpace", + "type": "[TableParameterSubspace]", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "TableSweepSettings", + }, "test_data": {"key": "testData", "type": "MLTableJobInput"}, "test_data_size": {"key": "testDataSize", "type": "float"}, - "validation_data": {"key": "validationData", "type": "MLTableJobInput"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, "validation_data_size": {"key": "validationDataSize", "type": "float"}, "weight_column_name": {"key": "weightColumnName", "type": "str"}, "log_verbosity": {"key": "logVerbosity", "type": "str"}, @@ -21630,7 +23539,10 @@ class Regression(AutoMLVertical, TableVertical): "task_type": {"key": "taskType", "type": "str"}, "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, "primary_metric": {"key": "primaryMetric", "type": "str"}, - "training_settings": {"key": "trainingSettings", "type": "RegressionTrainingSettings"}, + "training_settings": { + "key": "trainingSettings", + "type": "RegressionTrainingSettings", + }, } def __init__( @@ -21638,7 +23550,9 @@ def __init__( *, training_data: "MLTableJobInput", cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "TableVerticalFeaturizationSettings" + ] = None, fixed_parameters: Optional["TableFixedParameters"] = None, limit_settings: Optional["TableVerticalLimitSettings"] = None, n_cross_validations: Optional["NCrossValidations"] = None, @@ -21651,7 +23565,9 @@ def __init__( weight_column_name: Optional[str] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "RegressionPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "RegressionPrimaryMetrics"] + ] = None, training_settings: Optional["RegressionTrainingSettings"] = None, **kwargs ): @@ -21787,15 +23703,36 @@ class RegressionTrainingSettings(TrainingSettings): _attribute_map = { "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, - "enable_model_explainability": {"key": "enableModelExplainability", "type": "bool"}, - "enable_onnx_compatible_models": {"key": "enableOnnxCompatibleModels", "type": "bool"}, - "enable_stack_ensemble": {"key": "enableStackEnsemble", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, - "ensemble_model_download_timeout": {"key": "ensembleModelDownloadTimeout", "type": "duration"}, - "stack_ensemble_settings": {"key": "stackEnsembleSettings", "type": "StackEnsembleSettings"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, "training_mode": {"key": "trainingMode", "type": "str"}, - "allowed_training_algorithms": {"key": "allowedTrainingAlgorithms", "type": "[str]"}, - "blocked_training_algorithms": {"key": "blockedTrainingAlgorithms", "type": "[str]"}, + "allowed_training_algorithms": { + "key": "allowedTrainingAlgorithms", + "type": "[str]", + }, + "blocked_training_algorithms": { + "key": "blockedTrainingAlgorithms", + "type": "[str]", + }, } def __init__( @@ -21809,8 +23746,12 @@ def __init__( ensemble_model_download_timeout: Optional[datetime.timedelta] = "PT5M", stack_ensemble_settings: Optional["StackEnsembleSettings"] = None, training_mode: Optional[Union[str, "TrainingMode"]] = None, - allowed_training_algorithms: Optional[List[Union[str, "RegressionModels"]]] = None, - blocked_training_algorithms: Optional[List[Union[str, "RegressionModels"]]] = None, + allowed_training_algorithms: Optional[ + List[Union[str, "RegressionModels"]] + ] = None, + blocked_training_algorithms: Optional[ + List[Union[str, "RegressionModels"]] + ] = None, **kwargs ): """ @@ -21945,7 +23886,10 @@ class ResourceQuota(msrest.serialization.Model): _attribute_map = { "id": {"key": "id", "type": "str"}, - "aml_workspace_location": {"key": "amlWorkspaceLocation", "type": "str"}, + "aml_workspace_location": { + "key": "amlWorkspaceLocation", + "type": "str", + }, "type": {"key": "type", "type": "str"}, "name": {"key": "name", "type": "ResourceName"}, "limit": {"key": "limit", "type": "long"}, @@ -21996,7 +23940,9 @@ def __init__(self, *, path: str, port: int, **kwargs): self.port = port -class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class SASAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """SASAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -22030,7 +23976,10 @@ class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): "target": {"key": "target", "type": "str"}, "value": {"key": "value", "type": "str"}, "value_format": {"key": "valueFormat", "type": "str"}, - "credentials": {"key": "credentials", "type": "WorkspaceConnectionSharedAccessSignature"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionSharedAccessSignature", + }, } def __init__( @@ -22040,7 +23989,9 @@ def __init__( target: Optional[str] = None, value: Optional[str] = None, value_format: Optional[Union[str, "ValueFormat"]] = None, - credentials: Optional["WorkspaceConnectionSharedAccessSignature"] = None, + credentials: Optional[ + "WorkspaceConnectionSharedAccessSignature" + ] = None, **kwargs ): """ @@ -22060,7 +24011,11 @@ def __init__( ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature """ super(SASAuthTypeWorkspaceConnectionProperties, self).__init__( - category=category, target=target, value=value, value_format=value_format, **kwargs + category=category, + target=target, + value=value, + value_format=value_format, + **kwargs ) self.auth_type = "SAS" # type: str self.credentials = credentials @@ -22152,7 +24107,10 @@ class ScaleSettings(msrest.serialization.Model): _attribute_map = { "max_node_count": {"key": "maxNodeCount", "type": "int"}, "min_node_count": {"key": "minNodeCount", "type": "int"}, - "node_idle_time_before_scale_down": {"key": "nodeIdleTimeBeforeScaleDown", "type": "duration"}, + "node_idle_time_before_scale_down": { + "key": "nodeIdleTimeBeforeScaleDown", + "type": "duration", + }, } def __init__( @@ -22175,7 +24133,9 @@ def __init__( super(ScaleSettings, self).__init__(**kwargs) self.max_node_count = max_node_count self.min_node_count = min_node_count - self.node_idle_time_before_scale_down = node_idle_time_before_scale_down + self.node_idle_time_before_scale_down = ( + node_idle_time_before_scale_down + ) class ScaleSettingsInformation(msrest.serialization.Model): @@ -22189,7 +24149,9 @@ class ScaleSettingsInformation(msrest.serialization.Model): "scale_settings": {"key": "scaleSettings", "type": "ScaleSettings"}, } - def __init__(self, *, scale_settings: Optional["ScaleSettings"] = None, **kwargs): + def __init__( + self, *, scale_settings: Optional["ScaleSettings"] = None, **kwargs + ): """ :keyword scale_settings: scale settings for AML Compute. :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings @@ -22269,7 +24231,9 @@ def __init__( self, *, id: Optional[str] = None, - provisioning_status: Optional[Union[str, "ScheduleProvisioningState"]] = None, + provisioning_status: Optional[ + Union[str, "ScheduleProvisioningState"] + ] = None, status: Optional[Union[str, "ScheduleStatus"]] = None, **kwargs ): @@ -22362,7 +24326,9 @@ def __init__( :keyword trigger: Required. [Required] Specifies the trigger details. :paramtype trigger: ~azure.mgmt.machinelearningservices.models.TriggerBase """ - super(ScheduleProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + super(ScheduleProperties, self).__init__( + description=description, properties=properties, tags=tags, **kwargs + ) self.action = action self.display_name = display_name self.is_enabled = is_enabled @@ -22385,7 +24351,13 @@ class ScheduleResourceArmPaginatedResult(msrest.serialization.Model): "value": {"key": "value", "type": "[Schedule]"}, } - def __init__(self, *, next_link: Optional[str] = None, value: Optional[List["Schedule"]] = None, **kwargs): + def __init__( + self, + *, + next_link: Optional[str] = None, + value: Optional[List["Schedule"]] = None, + **kwargs + ): """ :keyword next_link: The link to the next page of Schedule objects. If null, there are no additional pages. @@ -22455,7 +24427,10 @@ class ScriptsToExecute(msrest.serialization.Model): _attribute_map = { "startup_script": {"key": "startupScript", "type": "ScriptReference"}, - "creation_script": {"key": "creationScript", "type": "ScriptReference"}, + "creation_script": { + "key": "creationScript", + "type": "ScriptReference", + }, } def __init__( @@ -22487,7 +24462,9 @@ class ServiceManagedResourcesSettings(msrest.serialization.Model): "cosmos_db": {"key": "cosmosDb", "type": "CosmosDbSettings"}, } - def __init__(self, *, cosmos_db: Optional["CosmosDbSettings"] = None, **kwargs): + def __init__( + self, *, cosmos_db: Optional["CosmosDbSettings"] = None, **kwargs + ): """ :keyword cosmos_db: The settings for the service managed cosmosdb account. :paramtype cosmos_db: ~azure.mgmt.machinelearningservices.models.CosmosDbSettings @@ -22496,7 +24473,9 @@ def __init__(self, *, cosmos_db: Optional["CosmosDbSettings"] = None, **kwargs): self.cosmos_db = cosmos_db -class ServicePrincipalAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class ServicePrincipalAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """ServicePrincipalAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -22530,7 +24509,10 @@ class ServicePrincipalAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionP "target": {"key": "target", "type": "str"}, "value": {"key": "value", "type": "str"}, "value_format": {"key": "valueFormat", "type": "str"}, - "credentials": {"key": "credentials", "type": "WorkspaceConnectionServicePrincipal"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionServicePrincipal", + }, } def __init__( @@ -22559,8 +24541,14 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionServicePrincipal """ - super(ServicePrincipalAuthTypeWorkspaceConnectionProperties, self).__init__( - category=category, target=target, value=value, value_format=value_format, **kwargs + super( + ServicePrincipalAuthTypeWorkspaceConnectionProperties, self + ).__init__( + category=category, + target=target, + value=value, + value_format=value_format, + **kwargs ) self.auth_type = "ServicePrincipal" # type: str self.credentials = credentials @@ -22599,7 +24587,10 @@ class ServicePrincipalDatastoreCredentials(DatastoreCredentials): "authority_url": {"key": "authorityUrl", "type": "str"}, "client_id": {"key": "clientId", "type": "str"}, "resource_url": {"key": "resourceUrl", "type": "str"}, - "secrets": {"key": "secrets", "type": "ServicePrincipalDatastoreSecrets"}, + "secrets": { + "key": "secrets", + "type": "ServicePrincipalDatastoreSecrets", + }, "tenant_id": {"key": "tenantId", "type": "str"}, } @@ -22678,7 +24669,9 @@ class SetupScripts(msrest.serialization.Model): "scripts": {"key": "scripts", "type": "ScriptsToExecute"}, } - def __init__(self, *, scripts: Optional["ScriptsToExecute"] = None, **kwargs): + def __init__( + self, *, scripts: Optional["ScriptsToExecute"] = None, **kwargs + ): """ :keyword scripts: Customized setup scripts. :paramtype scripts: ~azure.mgmt.machinelearningservices.models.ScriptsToExecute @@ -22707,7 +24700,10 @@ class SharedPrivateLinkResource(msrest.serialization.Model): _attribute_map = { "name": {"key": "name", "type": "str"}, - "private_link_resource_id": {"key": "properties.privateLinkResourceId", "type": "str"}, + "private_link_resource_id": { + "key": "properties.privateLinkResourceId", + "type": "str", + }, "group_id": {"key": "properties.groupId", "type": "str"}, "request_message": {"key": "properties.requestMessage", "type": "str"}, "status": {"key": "properties.status", "type": "str"}, @@ -22720,7 +24716,9 @@ def __init__( private_link_resource_id: Optional[str] = None, group_id: Optional[str] = None, request_message: Optional[str] = None, - status: Optional[Union[str, "PrivateEndpointServiceConnectionStatus"]] = None, + status: Optional[ + Union[str, "PrivateEndpointServiceConnectionStatus"] + ] = None, **kwargs ): """ @@ -22886,7 +24884,13 @@ class SkuResource(msrest.serialization.Model): "sku": {"key": "sku", "type": "SkuSetting"}, } - def __init__(self, *, capacity: Optional["SkuCapacity"] = None, sku: Optional["SkuSetting"] = None, **kwargs): + def __init__( + self, + *, + capacity: Optional["SkuCapacity"] = None, + sku: Optional["SkuSetting"] = None, + **kwargs + ): """ :keyword capacity: Gets or sets the Sku Capacity. :paramtype capacity: ~azure.mgmt.machinelearningservices.models.SkuCapacity @@ -22914,7 +24918,13 @@ class SkuResourceArmPaginatedResult(msrest.serialization.Model): "value": {"key": "value", "type": "[SkuResource]"}, } - def __init__(self, *, next_link: Optional[str] = None, value: Optional[List["SkuResource"]] = None, **kwargs): + def __init__( + self, + *, + next_link: Optional[str] = None, + value: Optional[List["SkuResource"]] = None, + **kwargs + ): """ :keyword next_link: The link to the next page of SkuResource objects. If null, there are no additional pages. @@ -22950,7 +24960,13 @@ class SkuSetting(msrest.serialization.Model): "tier": {"key": "tier", "type": "str"}, } - def __init__(self, *, name: str, tier: Optional[Union[str, "SkuTier"]] = None, **kwargs): + def __init__( + self, + *, + name: str, + tier: Optional[Union[str, "SkuTier"]] = None, + **kwargs + ): """ :keyword name: Required. [Required] The name of the SKU. Ex - P3. It is typically a letter+number code. @@ -23051,7 +25067,10 @@ class SparkJob(JobBaseProperties): "identity": {"key": "identity", "type": "IdentityConfiguration"}, "is_archived": {"key": "isArchived", "type": "bool"}, "job_type": {"key": "jobType", "type": "str"}, - "notification_setting": {"key": "notificationSetting", "type": "NotificationSetting"}, + "notification_setting": { + "key": "notificationSetting", + "type": "NotificationSetting", + }, "services": {"key": "services", "type": "{JobService}"}, "status": {"key": "status", "type": "str"}, "archives": {"key": "archives", "type": "[str]"}, @@ -23066,7 +25085,10 @@ class SparkJob(JobBaseProperties): "outputs": {"key": "outputs", "type": "{JobOutput}"}, "py_files": {"key": "pyFiles", "type": "[str]"}, "queue_settings": {"key": "queueSettings", "type": "QueueSettings"}, - "resources": {"key": "resources", "type": "SparkResourceConfiguration"}, + "resources": { + "key": "resources", + "type": "SparkResourceConfiguration", + }, } def __init__( @@ -23232,7 +25254,11 @@ class SparkJobPythonEntry(SparkJobEntry): _validation = { "spark_job_entry_type": {"required": True}, - "file": {"required": True, "min_length": 1, "pattern": r"[a-zA-Z0-9_]"}, + "file": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { @@ -23265,7 +25291,11 @@ class SparkJobScalaEntry(SparkJobEntry): _validation = { "spark_job_entry_type": {"required": True}, - "class_name": {"required": True, "min_length": 1, "pattern": r"[a-zA-Z0-9_]"}, + "class_name": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { @@ -23297,7 +25327,13 @@ class SparkResourceConfiguration(msrest.serialization.Model): "runtime_version": {"key": "runtimeVersion", "type": "str"}, } - def __init__(self, *, instance_type: Optional[str] = None, runtime_version: Optional[str] = "3.1", **kwargs): + def __init__( + self, + *, + instance_type: Optional[str] = None, + runtime_version: Optional[str] = "3.1", + **kwargs + ): """ :keyword instance_type: Optional type of VM used as supported by the compute target. :paramtype instance_type: str @@ -23333,7 +25369,10 @@ class SslConfiguration(msrest.serialization.Model): "key": {"key": "key", "type": "str"}, "cname": {"key": "cname", "type": "str"}, "leaf_domain_label": {"key": "leafDomainLabel", "type": "str"}, - "overwrite_existing_domain": {"key": "overwriteExistingDomain", "type": "bool"}, + "overwrite_existing_domain": { + "key": "overwriteExistingDomain", + "type": "bool", + }, } def __init__( @@ -23390,9 +25429,18 @@ class StackEnsembleSettings(msrest.serialization.Model): """ _attribute_map = { - "stack_meta_learner_k_wargs": {"key": "stackMetaLearnerKWargs", "type": "object"}, - "stack_meta_learner_train_percentage": {"key": "stackMetaLearnerTrainPercentage", "type": "float"}, - "stack_meta_learner_type": {"key": "stackMetaLearnerType", "type": "str"}, + "stack_meta_learner_k_wargs": { + "key": "stackMetaLearnerKWargs", + "type": "object", + }, + "stack_meta_learner_train_percentage": { + "key": "stackMetaLearnerTrainPercentage", + "type": "float", + }, + "stack_meta_learner_type": { + "key": "stackMetaLearnerType", + "type": "str", + }, } def __init__( @@ -23400,7 +25448,9 @@ def __init__( *, stack_meta_learner_k_wargs: Optional[Any] = None, stack_meta_learner_train_percentage: Optional[float] = 0.2, - stack_meta_learner_type: Optional[Union[str, "StackMetaLearnerType"]] = None, + stack_meta_learner_type: Optional[ + Union[str, "StackMetaLearnerType"] + ] = None, **kwargs ): """ @@ -23420,7 +25470,9 @@ def __init__( """ super(StackEnsembleSettings, self).__init__(**kwargs) self.stack_meta_learner_k_wargs = stack_meta_learner_k_wargs - self.stack_meta_learner_train_percentage = stack_meta_learner_train_percentage + self.stack_meta_learner_train_percentage = ( + stack_meta_learner_train_percentage + ) self.stack_meta_learner_type = stack_meta_learner_type @@ -23475,15 +25527,25 @@ class StorageAccountDetails(msrest.serialization.Model): """ _attribute_map = { - "system_created_storage_account": {"key": "systemCreatedStorageAccount", "type": "SystemCreatedStorageAccount"}, - "user_created_storage_account": {"key": "userCreatedStorageAccount", "type": "UserCreatedStorageAccount"}, + "system_created_storage_account": { + "key": "systemCreatedStorageAccount", + "type": "SystemCreatedStorageAccount", + }, + "user_created_storage_account": { + "key": "userCreatedStorageAccount", + "type": "UserCreatedStorageAccount", + }, } def __init__( self, *, - system_created_storage_account: Optional["SystemCreatedStorageAccount"] = None, - user_created_storage_account: Optional["UserCreatedStorageAccount"] = None, + system_created_storage_account: Optional[ + "SystemCreatedStorageAccount" + ] = None, + user_created_storage_account: Optional[ + "UserCreatedStorageAccount" + ] = None, **kwargs ): """ @@ -23581,16 +25643,25 @@ class SweepJob(JobBaseProperties): "identity": {"key": "identity", "type": "IdentityConfiguration"}, "is_archived": {"key": "isArchived", "type": "bool"}, "job_type": {"key": "jobType", "type": "str"}, - "notification_setting": {"key": "notificationSetting", "type": "NotificationSetting"}, + "notification_setting": { + "key": "notificationSetting", + "type": "NotificationSetting", + }, "services": {"key": "services", "type": "{JobService}"}, "status": {"key": "status", "type": "str"}, - "early_termination": {"key": "earlyTermination", "type": "EarlyTerminationPolicy"}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, "inputs": {"key": "inputs", "type": "{JobInput}"}, "limits": {"key": "limits", "type": "SweepJobLimits"}, "objective": {"key": "objective", "type": "Objective"}, "outputs": {"key": "outputs", "type": "{JobOutput}"}, "queue_settings": {"key": "queueSettings", "type": "QueueSettings"}, - "sampling_algorithm": {"key": "samplingAlgorithm", "type": "SamplingAlgorithm"}, + "sampling_algorithm": { + "key": "samplingAlgorithm", + "type": "SamplingAlgorithm", + }, "search_space": {"key": "searchSpace", "type": "object"}, "trial": {"key": "trial", "type": "TrialComponent"}, } @@ -23807,7 +25878,10 @@ class SynapseSpark(Compute): "created_on": {"key": "createdOn", "type": "iso-8601"}, "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, "resource_id": {"key": "resourceId", "type": "str"}, - "provisioning_errors": {"key": "provisioningErrors", "type": "[ErrorResponse]"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, "properties": {"key": "properties", "type": "SynapseSparkProperties"}, @@ -23873,8 +25947,14 @@ class SynapseSparkProperties(msrest.serialization.Model): """ _attribute_map = { - "auto_scale_properties": {"key": "autoScaleProperties", "type": "AutoScaleProperties"}, - "auto_pause_properties": {"key": "autoPauseProperties", "type": "AutoPauseProperties"}, + "auto_scale_properties": { + "key": "autoScaleProperties", + "type": "AutoScaleProperties", + }, + "auto_pause_properties": { + "key": "autoPauseProperties", + "type": "AutoPauseProperties", + }, "spark_version": {"key": "sparkVersion", "type": "str"}, "node_count": {"key": "nodeCount", "type": "int"}, "node_size": {"key": "nodeSize", "type": "str"}, @@ -23952,7 +26032,11 @@ class SystemCreatedAcrAccount(msrest.serialization.Model): } def __init__( - self, *, acr_account_sku: Optional[str] = None, arm_resource_id: Optional["ArmResourceId"] = None, **kwargs + self, + *, + acr_account_sku: Optional[str] = None, + arm_resource_id: Optional["ArmResourceId"] = None, + **kwargs ): """ :keyword acr_account_sku: @@ -23988,9 +26072,15 @@ class SystemCreatedStorageAccount(msrest.serialization.Model): _attribute_map = { "arm_resource_id": {"key": "armResourceId", "type": "ArmResourceId"}, - "storage_account_hns_enabled": {"key": "storageAccountHnsEnabled", "type": "bool"}, + "storage_account_hns_enabled": { + "key": "storageAccountHnsEnabled", + "type": "bool", + }, "storage_account_type": {"key": "storageAccountType", "type": "str"}, - "allow_blob_public_access": {"key": "allowBlobPublicAccess", "type": "bool"}, + "allow_blob_public_access": { + "key": "allowBlobPublicAccess", + "type": "bool", + }, } def __init__( @@ -24467,7 +26557,10 @@ class TableSweepSettings(msrest.serialization.Model): } _attribute_map = { - "early_termination": {"key": "earlyTermination", "type": "EarlyTerminationPolicy"}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, "sampling_algorithm": {"key": "samplingAlgorithm", "type": "str"}, } @@ -24519,22 +26612,38 @@ class TableVerticalFeaturizationSettings(FeaturizationSettings): _attribute_map = { "dataset_language": {"key": "datasetLanguage", "type": "str"}, - "blocked_transformers": {"key": "blockedTransformers", "type": "[str]"}, - "column_name_and_types": {"key": "columnNameAndTypes", "type": "{str}"}, - "enable_dnn_featurization": {"key": "enableDnnFeaturization", "type": "bool"}, + "blocked_transformers": { + "key": "blockedTransformers", + "type": "[str]", + }, + "column_name_and_types": { + "key": "columnNameAndTypes", + "type": "{str}", + }, + "enable_dnn_featurization": { + "key": "enableDnnFeaturization", + "type": "bool", + }, "mode": {"key": "mode", "type": "str"}, - "transformer_params": {"key": "transformerParams", "type": "{[ColumnTransformer]}"}, + "transformer_params": { + "key": "transformerParams", + "type": "{[ColumnTransformer]}", + }, } def __init__( self, *, dataset_language: Optional[str] = None, - blocked_transformers: Optional[List[Union[str, "BlockedTransformers"]]] = None, + blocked_transformers: Optional[ + List[Union[str, "BlockedTransformers"]] + ] = None, column_name_and_types: Optional[Dict[str, str]] = None, enable_dnn_featurization: Optional[bool] = False, mode: Optional[Union[str, "FeaturizationMode"]] = None, - transformer_params: Optional[Dict[str, List["ColumnTransformer"]]] = None, + transformer_params: Optional[ + Dict[str, List["ColumnTransformer"]] + ] = None, **kwargs ): """ @@ -24560,7 +26669,9 @@ def __init__( :paramtype transformer_params: dict[str, list[~azure.mgmt.machinelearningservices.models.ColumnTransformer]] """ - super(TableVerticalFeaturizationSettings, self).__init__(dataset_language=dataset_language, **kwargs) + super(TableVerticalFeaturizationSettings, self).__init__( + dataset_language=dataset_language, **kwargs + ) self.blocked_transformers = blocked_transformers self.column_name_and_types = column_name_and_types self.enable_dnn_featurization = enable_dnn_featurization @@ -24595,13 +26706,19 @@ class TableVerticalLimitSettings(msrest.serialization.Model): """ _attribute_map = { - "enable_early_termination": {"key": "enableEarlyTermination", "type": "bool"}, + "enable_early_termination": { + "key": "enableEarlyTermination", + "type": "bool", + }, "exit_score": {"key": "exitScore", "type": "float"}, "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, "max_cores_per_trial": {"key": "maxCoresPerTrial", "type": "int"}, "max_nodes": {"key": "maxNodes", "type": "int"}, "max_trials": {"key": "maxTrials", "type": "int"}, - "sweep_concurrent_trials": {"key": "sweepConcurrentTrials", "type": "int"}, + "sweep_concurrent_trials": { + "key": "sweepConcurrentTrials", + "type": "int", + }, "sweep_trials": {"key": "sweepTrials", "type": "int"}, "timeout": {"key": "timeout", "type": "duration"}, "trial_timeout": {"key": "trialTimeout", "type": "duration"}, @@ -24688,7 +26805,10 @@ class TargetUtilizationScaleSettings(OnlineScaleSettings): "max_instances": {"key": "maxInstances", "type": "int"}, "min_instances": {"key": "minInstances", "type": "int"}, "polling_interval": {"key": "pollingInterval", "type": "duration"}, - "target_utilization_percentage": {"key": "targetUtilizationPercentage", "type": "int"}, + "target_utilization_percentage": { + "key": "targetUtilizationPercentage", + "type": "int", + }, } def __init__( @@ -24740,11 +26860,20 @@ class TensorFlow(DistributionConfiguration): _attribute_map = { "distribution_type": {"key": "distributionType", "type": "str"}, - "parameter_server_count": {"key": "parameterServerCount", "type": "int"}, + "parameter_server_count": { + "key": "parameterServerCount", + "type": "int", + }, "worker_count": {"key": "workerCount", "type": "int"}, } - def __init__(self, *, parameter_server_count: Optional[int] = 0, worker_count: Optional[int] = None, **kwargs): + def __init__( + self, + *, + parameter_server_count: Optional[int] = 0, + worker_count: Optional[int] = None, + **kwargs + ): """ :keyword parameter_server_count: Number of parameter server tasks. :paramtype parameter_server_count: int @@ -24804,12 +26933,27 @@ class TextClassification(AutoMLVertical, NlpVertical): } _attribute_map = { - "featurization_settings": {"key": "featurizationSettings", "type": "NlpVerticalFeaturizationSettings"}, - "fixed_parameters": {"key": "fixedParameters", "type": "NlpFixedParameters"}, - "limit_settings": {"key": "limitSettings", "type": "NlpVerticalLimitSettings"}, - "search_space": {"key": "searchSpace", "type": "[NlpParameterSubspace]"}, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "NlpFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "search_space": { + "key": "searchSpace", + "type": "[NlpParameterSubspace]", + }, "sweep_settings": {"key": "sweepSettings", "type": "NlpSweepSettings"}, - "validation_data": {"key": "validationData", "type": "MLTableJobInput"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, "log_verbosity": {"key": "logVerbosity", "type": "str"}, "target_column_name": {"key": "targetColumnName", "type": "str"}, "task_type": {"key": "taskType", "type": "str"}, @@ -24821,7 +26965,9 @@ def __init__( self, *, training_data: "MLTableJobInput", - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "NlpVerticalFeaturizationSettings" + ] = None, fixed_parameters: Optional["NlpFixedParameters"] = None, limit_settings: Optional["NlpVerticalLimitSettings"] = None, search_space: Optional[List["NlpParameterSubspace"]] = None, @@ -24829,7 +26975,9 @@ def __init__( validation_data: Optional["MLTableJobInput"] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "ClassificationPrimaryMetrics"] + ] = None, **kwargs ): """ @@ -24938,12 +27086,27 @@ class TextClassificationMultilabel(AutoMLVertical, NlpVertical): } _attribute_map = { - "featurization_settings": {"key": "featurizationSettings", "type": "NlpVerticalFeaturizationSettings"}, - "fixed_parameters": {"key": "fixedParameters", "type": "NlpFixedParameters"}, - "limit_settings": {"key": "limitSettings", "type": "NlpVerticalLimitSettings"}, - "search_space": {"key": "searchSpace", "type": "[NlpParameterSubspace]"}, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "NlpFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "search_space": { + "key": "searchSpace", + "type": "[NlpParameterSubspace]", + }, "sweep_settings": {"key": "sweepSettings", "type": "NlpSweepSettings"}, - "validation_data": {"key": "validationData", "type": "MLTableJobInput"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, "log_verbosity": {"key": "logVerbosity", "type": "str"}, "target_column_name": {"key": "targetColumnName", "type": "str"}, "task_type": {"key": "taskType", "type": "str"}, @@ -24955,7 +27118,9 @@ def __init__( self, *, training_data: "MLTableJobInput", - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "NlpVerticalFeaturizationSettings" + ] = None, fixed_parameters: Optional["NlpFixedParameters"] = None, limit_settings: Optional["NlpVerticalLimitSettings"] = None, search_space: Optional[List["NlpParameterSubspace"]] = None, @@ -25067,12 +27232,27 @@ class TextNer(AutoMLVertical, NlpVertical): } _attribute_map = { - "featurization_settings": {"key": "featurizationSettings", "type": "NlpVerticalFeaturizationSettings"}, - "fixed_parameters": {"key": "fixedParameters", "type": "NlpFixedParameters"}, - "limit_settings": {"key": "limitSettings", "type": "NlpVerticalLimitSettings"}, - "search_space": {"key": "searchSpace", "type": "[NlpParameterSubspace]"}, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "NlpFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "search_space": { + "key": "searchSpace", + "type": "[NlpParameterSubspace]", + }, "sweep_settings": {"key": "sweepSettings", "type": "NlpSweepSettings"}, - "validation_data": {"key": "validationData", "type": "MLTableJobInput"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, "log_verbosity": {"key": "logVerbosity", "type": "str"}, "target_column_name": {"key": "targetColumnName", "type": "str"}, "task_type": {"key": "taskType", "type": "str"}, @@ -25084,7 +27264,9 @@ def __init__( self, *, training_data: "MLTableJobInput", - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "NlpVerticalFeaturizationSettings" + ] = None, fixed_parameters: Optional["NlpFixedParameters"] = None, limit_settings: Optional["NlpVerticalLimitSettings"] = None, search_space: Optional[List["NlpParameterSubspace"]] = None, @@ -25187,16 +27369,26 @@ class TrialComponent(msrest.serialization.Model): """ _validation = { - "command": {"required": True, "min_length": 1, "pattern": r"[a-zA-Z0-9_]"}, + "command": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, "environment_id": {"required": True, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { "code_id": {"key": "codeId", "type": "str"}, "command": {"key": "command", "type": "str"}, - "distribution": {"key": "distribution", "type": "DistributionConfiguration"}, + "distribution": { + "key": "distribution", + "type": "DistributionConfiguration", + }, "environment_id": {"key": "environmentId", "type": "str"}, - "environment_variables": {"key": "environmentVariables", "type": "{str}"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, "resources": {"key": "resources", "type": "JobResourceConfiguration"}, } @@ -25256,10 +27448,20 @@ class TritonInferencingServer(InferencingServer): _attribute_map = { "server_type": {"key": "serverType", "type": "str"}, - "inference_configuration": {"key": "inferenceConfiguration", "type": "OnlineInferenceConfiguration"}, + "inference_configuration": { + "key": "inferenceConfiguration", + "type": "OnlineInferenceConfiguration", + }, } - def __init__(self, *, inference_configuration: Optional["OnlineInferenceConfiguration"] = None, **kwargs): + def __init__( + self, + *, + inference_configuration: Optional[ + "OnlineInferenceConfiguration" + ] = None, + **kwargs + ): """ :keyword inference_configuration: Inference configuration for Triton. :paramtype inference_configuration: @@ -25317,7 +27519,9 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(TritonModelJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(TritonModelJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri self.job_input_type = "triton_model" # type: str @@ -25383,7 +27587,12 @@ def __init__( :paramtype description: str """ super(TritonModelJobOutput, self).__init__( - description=description, asset_name=asset_name, asset_version=asset_version, mode=mode, uri=uri, **kwargs + description=description, + asset_name=asset_name, + asset_version=asset_version, + mode=mode, + uri=uri, + **kwargs ) self.asset_name = asset_name self.asset_version = asset_version @@ -25418,7 +27627,10 @@ class TruncationSelectionPolicy(EarlyTerminationPolicy): "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, "policy_type": {"key": "policyType", "type": "str"}, - "truncation_percentage": {"key": "truncationPercentage", "type": "int"}, + "truncation_percentage": { + "key": "truncationPercentage", + "type": "int", + }, } def __init__( @@ -25438,7 +27650,9 @@ def __init__( :paramtype truncation_percentage: int """ super(TruncationSelectionPolicy, self).__init__( - delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs + delay_evaluation=delay_evaluation, + evaluation_interval=evaluation_interval, + **kwargs ) self.policy_type = "TruncationSelection" # type: str self.truncation_percentage = truncation_percentage @@ -25478,7 +27692,13 @@ class UpdateWorkspaceQuotas(msrest.serialization.Model): "status": {"key": "status", "type": "str"}, } - def __init__(self, *, limit: Optional[int] = None, status: Optional[Union[str, "Status"]] = None, **kwargs): + def __init__( + self, + *, + limit: Optional[int] = None, + status: Optional[Union[str, "Status"]] = None, + **kwargs + ): """ :keyword limit: The maximum permitted quota of the resource. :paramtype limit: long @@ -25648,7 +27868,9 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(UriFileJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(UriFileJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri self.job_input_type = "uri_file" # type: str @@ -25714,7 +27936,12 @@ def __init__( :paramtype description: str """ super(UriFileJobOutput, self).__init__( - description=description, asset_name=asset_name, asset_version=asset_version, mode=mode, uri=uri, **kwargs + description=description, + asset_name=asset_name, + asset_version=asset_version, + mode=mode, + uri=uri, + **kwargs ) self.asset_name = asset_name self.asset_version = asset_version @@ -25847,7 +28074,9 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(UriFolderJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(UriFolderJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri self.job_input_type = "uri_folder" # type: str @@ -25913,7 +28142,12 @@ def __init__( :paramtype description: str """ super(UriFolderJobOutput, self).__init__( - description=description, asset_name=asset_name, asset_version=asset_version, mode=mode, uri=uri, **kwargs + description=description, + asset_name=asset_name, + asset_version=asset_version, + mode=mode, + uri=uri, + **kwargs ) self.asset_name = asset_name self.asset_version = asset_version @@ -25956,7 +28190,10 @@ class Usage(msrest.serialization.Model): _attribute_map = { "id": {"key": "id", "type": "str"}, - "aml_workspace_location": {"key": "amlWorkspaceLocation", "type": "str"}, + "aml_workspace_location": { + "key": "amlWorkspaceLocation", + "type": "str", + }, "type": {"key": "type", "type": "str"}, "unit": {"key": "unit", "type": "str"}, "current_value": {"key": "currentValue", "type": "long"}, @@ -26024,7 +28261,10 @@ class UserAccountCredentials(msrest.serialization.Model): _attribute_map = { "admin_user_name": {"key": "adminUserName", "type": "str"}, - "admin_user_ssh_public_key": {"key": "adminUserSshPublicKey", "type": "str"}, + "admin_user_ssh_public_key": { + "key": "adminUserSshPublicKey", + "type": "str", + }, "admin_user_password": {"key": "adminUserPassword", "type": "str"}, } @@ -26090,7 +28330,9 @@ class UserCreatedAcrAccount(msrest.serialization.Model): "arm_resource_id": {"key": "armResourceId", "type": "ArmResourceId"}, } - def __init__(self, *, arm_resource_id: Optional["ArmResourceId"] = None, **kwargs): + def __init__( + self, *, arm_resource_id: Optional["ArmResourceId"] = None, **kwargs + ): """ :keyword arm_resource_id: ARM ResourceId of a resource. :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId @@ -26110,7 +28352,9 @@ class UserCreatedStorageAccount(msrest.serialization.Model): "arm_resource_id": {"key": "armResourceId", "type": "ArmResourceId"}, } - def __init__(self, *, arm_resource_id: Optional["ArmResourceId"] = None, **kwargs): + def __init__( + self, *, arm_resource_id: Optional["ArmResourceId"] = None, **kwargs + ): """ :keyword arm_resource_id: ARM ResourceId of a resource. :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId @@ -26144,7 +28388,9 @@ def __init__(self, **kwargs): self.identity_type = "UserIdentity" # type: str -class UsernamePasswordAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class UsernamePasswordAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """UsernamePasswordAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -26178,7 +28424,10 @@ class UsernamePasswordAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionP "target": {"key": "target", "type": "str"}, "value": {"key": "value", "type": "str"}, "value_format": {"key": "valueFormat", "type": "str"}, - "credentials": {"key": "credentials", "type": "WorkspaceConnectionUsernamePassword"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionUsernamePassword", + }, } def __init__( @@ -26207,8 +28456,14 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword """ - super(UsernamePasswordAuthTypeWorkspaceConnectionProperties, self).__init__( - category=category, target=target, value=value, value_format=value_format, **kwargs + super( + UsernamePasswordAuthTypeWorkspaceConnectionProperties, self + ).__init__( + category=category, + target=target, + value=value, + value_format=value_format, + **kwargs ) self.auth_type = "UsernamePassword" # type: str self.credentials = credentials @@ -26222,10 +28477,18 @@ class VirtualMachineSchema(msrest.serialization.Model): """ _attribute_map = { - "properties": {"key": "properties", "type": "VirtualMachineSchemaProperties"}, + "properties": { + "key": "properties", + "type": "VirtualMachineSchemaProperties", + }, } - def __init__(self, *, properties: Optional["VirtualMachineSchemaProperties"] = None, **kwargs): + def __init__( + self, + *, + properties: Optional["VirtualMachineSchemaProperties"] = None, + **kwargs + ): """ :keyword properties: :paramtype properties: @@ -26283,7 +28546,10 @@ class VirtualMachine(Compute, VirtualMachineSchema): } _attribute_map = { - "properties": {"key": "properties", "type": "VirtualMachineSchemaProperties"}, + "properties": { + "key": "properties", + "type": "VirtualMachineSchemaProperties", + }, "compute_type": {"key": "computeType", "type": "str"}, "compute_location": {"key": "computeLocation", "type": "str"}, "provisioning_state": {"key": "provisioningState", "type": "str"}, @@ -26291,7 +28557,10 @@ class VirtualMachine(Compute, VirtualMachineSchema): "created_on": {"key": "createdOn", "type": "iso-8601"}, "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, "resource_id": {"key": "resourceId", "type": "str"}, - "provisioning_errors": {"key": "provisioningErrors", "type": "[ErrorResponse]"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } @@ -26391,8 +28660,14 @@ class VirtualMachineSchemaProperties(msrest.serialization.Model): "ssh_port": {"key": "sshPort", "type": "int"}, "notebook_server_port": {"key": "notebookServerPort", "type": "int"}, "address": {"key": "address", "type": "str"}, - "administrator_account": {"key": "administratorAccount", "type": "VirtualMachineSshCredentials"}, - "is_notebook_instance_compute": {"key": "isNotebookInstanceCompute", "type": "bool"}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, + "is_notebook_instance_compute": { + "key": "isNotebookInstanceCompute", + "type": "bool", + }, } def __init__( @@ -26440,10 +28715,18 @@ class VirtualMachineSecretsSchema(msrest.serialization.Model): """ _attribute_map = { - "administrator_account": {"key": "administratorAccount", "type": "VirtualMachineSshCredentials"}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, } - def __init__(self, *, administrator_account: Optional["VirtualMachineSshCredentials"] = None, **kwargs): + def __init__( + self, + *, + administrator_account: Optional["VirtualMachineSshCredentials"] = None, + **kwargs + ): """ :keyword administrator_account: Admin credentials for virtual machine. :paramtype administrator_account: @@ -26472,17 +28755,27 @@ class VirtualMachineSecrets(ComputeSecrets, VirtualMachineSecretsSchema): } _attribute_map = { - "administrator_account": {"key": "administratorAccount", "type": "VirtualMachineSshCredentials"}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, "compute_type": {"key": "computeType", "type": "str"}, } - def __init__(self, *, administrator_account: Optional["VirtualMachineSshCredentials"] = None, **kwargs): + def __init__( + self, + *, + administrator_account: Optional["VirtualMachineSshCredentials"] = None, + **kwargs + ): """ :keyword administrator_account: Admin credentials for virtual machine. :paramtype administrator_account: ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials """ - super(VirtualMachineSecrets, self).__init__(administrator_account=administrator_account, **kwargs) + super(VirtualMachineSecrets, self).__init__( + administrator_account=administrator_account, **kwargs + ) self.administrator_account = administrator_account self.compute_type = "VirtualMachine" # type: str @@ -26536,12 +28829,21 @@ class VirtualMachineSize(msrest.serialization.Model): "v_cp_us": {"key": "vCPUs", "type": "int"}, "gpus": {"key": "gpus", "type": "int"}, "os_vhd_size_mb": {"key": "osVhdSizeMB", "type": "int"}, - "max_resource_volume_mb": {"key": "maxResourceVolumeMB", "type": "int"}, + "max_resource_volume_mb": { + "key": "maxResourceVolumeMB", + "type": "int", + }, "memory_gb": {"key": "memoryGB", "type": "float"}, "low_priority_capable": {"key": "lowPriorityCapable", "type": "bool"}, "premium_io": {"key": "premiumIO", "type": "bool"}, - "estimated_vm_prices": {"key": "estimatedVMPrices", "type": "EstimatedVMPrices"}, - "supported_compute_types": {"key": "supportedComputeTypes", "type": "[str]"}, + "estimated_vm_prices": { + "key": "estimatedVMPrices", + "type": "EstimatedVMPrices", + }, + "supported_compute_types": { + "key": "supportedComputeTypes", + "type": "[str]", + }, } def __init__( @@ -26583,7 +28885,9 @@ class VirtualMachineSizeListResult(msrest.serialization.Model): "value": {"key": "value", "type": "[VirtualMachineSize]"}, } - def __init__(self, *, value: Optional[List["VirtualMachineSize"]] = None, **kwargs): + def __init__( + self, *, value: Optional[List["VirtualMachineSize"]] = None, **kwargs + ): """ :keyword value: The list of virtual machine sizes supported by AmlCompute. :paramtype value: list[~azure.mgmt.machinelearningservices.models.VirtualMachineSize] @@ -26870,18 +29174,45 @@ class Workspace(Resource): "description": {"key": "properties.description", "type": "str"}, "friendly_name": {"key": "properties.friendlyName", "type": "str"}, "key_vault": {"key": "properties.keyVault", "type": "str"}, - "application_insights": {"key": "properties.applicationInsights", "type": "str"}, - "container_registry": {"key": "properties.containerRegistry", "type": "str"}, + "application_insights": { + "key": "properties.applicationInsights", + "type": "str", + }, + "container_registry": { + "key": "properties.containerRegistry", + "type": "str", + }, "storage_account": {"key": "properties.storageAccount", "type": "str"}, "discovery_url": {"key": "properties.discoveryUrl", "type": "str"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "encryption": {"key": "properties.encryption", "type": "EncryptionProperty"}, + "provisioning_state": { + "key": "properties.provisioningState", + "type": "str", + }, + "encryption": { + "key": "properties.encryption", + "type": "EncryptionProperty", + }, "hbi_workspace": {"key": "properties.hbiWorkspace", "type": "bool"}, - "service_provisioned_resource_group": {"key": "properties.serviceProvisionedResourceGroup", "type": "str"}, - "private_link_count": {"key": "properties.privateLinkCount", "type": "int"}, - "image_build_compute": {"key": "properties.imageBuildCompute", "type": "str"}, - "allow_public_access_when_behind_vnet": {"key": "properties.allowPublicAccessWhenBehindVnet", "type": "bool"}, - "public_network_access": {"key": "properties.publicNetworkAccess", "type": "str"}, + "service_provisioned_resource_group": { + "key": "properties.serviceProvisionedResourceGroup", + "type": "str", + }, + "private_link_count": { + "key": "properties.privateLinkCount", + "type": "int", + }, + "image_build_compute": { + "key": "properties.imageBuildCompute", + "type": "str", + }, + "allow_public_access_when_behind_vnet": { + "key": "properties.allowPublicAccessWhenBehindVnet", + "type": "bool", + }, + "public_network_access": { + "key": "properties.publicNetworkAccess", + "type": "str", + }, "private_endpoint_connections": { "key": "properties.privateEndpointConnections", "type": "[PrivateEndpointConnection]", @@ -26890,19 +29221,37 @@ class Workspace(Resource): "key": "properties.sharedPrivateLinkResources", "type": "[SharedPrivateLinkResource]", }, - "notebook_info": {"key": "properties.notebookInfo", "type": "NotebookResourceInfo"}, + "notebook_info": { + "key": "properties.notebookInfo", + "type": "NotebookResourceInfo", + }, "service_managed_resources_settings": { "key": "properties.serviceManagedResourcesSettings", "type": "ServiceManagedResourcesSettings", }, - "primary_user_assigned_identity": {"key": "properties.primaryUserAssignedIdentity", "type": "str"}, + "primary_user_assigned_identity": { + "key": "properties.primaryUserAssignedIdentity", + "type": "str", + }, "tenant_id": {"key": "properties.tenantId", "type": "str"}, - "storage_hns_enabled": {"key": "properties.storageHnsEnabled", "type": "bool"}, - "ml_flow_tracking_uri": {"key": "properties.mlFlowTrackingUri", "type": "str"}, + "storage_hns_enabled": { + "key": "properties.storageHnsEnabled", + "type": "bool", + }, + "ml_flow_tracking_uri": { + "key": "properties.mlFlowTrackingUri", + "type": "str", + }, "v1_legacy_mode": {"key": "properties.v1LegacyMode", "type": "bool"}, "soft_deleted_at": {"key": "properties.softDeletedAt", "type": "str"}, - "scheduled_purge_date": {"key": "properties.scheduledPurgeDate", "type": "str"}, - "system_datastores_auth_mode": {"key": "properties.systemDatastoresAuthMode", "type": "str"}, + "scheduled_purge_date": { + "key": "properties.scheduledPurgeDate", + "type": "str", + }, + "system_datastores_auth_mode": { + "key": "properties.systemDatastoresAuthMode", + "type": "str", + }, } def __init__( @@ -26923,9 +29272,15 @@ def __init__( hbi_workspace: Optional[bool] = False, image_build_compute: Optional[str] = None, allow_public_access_when_behind_vnet: Optional[bool] = False, - public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, - shared_private_link_resources: Optional[List["SharedPrivateLinkResource"]] = None, - service_managed_resources_settings: Optional["ServiceManagedResourcesSettings"] = None, + public_network_access: Optional[ + Union[str, "PublicNetworkAccess"] + ] = None, + shared_private_link_resources: Optional[ + List["SharedPrivateLinkResource"] + ] = None, + service_managed_resources_settings: Optional[ + "ServiceManagedResourcesSettings" + ] = None, primary_user_assigned_identity: Optional[str] = None, v1_legacy_mode: Optional[bool] = False, system_datastores_auth_mode: Optional[str] = None, @@ -27008,12 +29363,16 @@ def __init__( self.service_provisioned_resource_group = None self.private_link_count = None self.image_build_compute = image_build_compute - self.allow_public_access_when_behind_vnet = allow_public_access_when_behind_vnet + self.allow_public_access_when_behind_vnet = ( + allow_public_access_when_behind_vnet + ) self.public_network_access = public_network_access self.private_endpoint_connections = None self.shared_private_link_resources = shared_private_link_resources self.notebook_info = None - self.service_managed_resources_settings = service_managed_resources_settings + self.service_managed_resources_settings = ( + service_managed_resources_settings + ) self.primary_user_assigned_identity = primary_user_assigned_identity self.tenant_id = None self.storage_hns_enabled = None @@ -27038,7 +29397,13 @@ class WorkspaceConnectionAccessKey(msrest.serialization.Model): "secret_access_key": {"key": "secretAccessKey", "type": "str"}, } - def __init__(self, *, access_key_id: Optional[str] = None, secret_access_key: Optional[str] = None, **kwargs): + def __init__( + self, + *, + access_key_id: Optional[str] = None, + secret_access_key: Optional[str] = None, + **kwargs + ): """ :keyword access_key_id: :paramtype access_key_id: str @@ -27064,7 +29429,13 @@ class WorkspaceConnectionManagedIdentity(msrest.serialization.Model): "client_id": {"key": "clientId", "type": "str"}, } - def __init__(self, *, resource_id: Optional[str] = None, client_id: Optional[str] = None, **kwargs): + def __init__( + self, + *, + resource_id: Optional[str] = None, + client_id: Optional[str] = None, + **kwargs + ): """ :keyword resource_id: :paramtype resource_id: str @@ -27131,20 +29502,29 @@ class WorkspaceConnectionPropertiesV2BasicResource(Resource): "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "WorkspaceConnectionPropertiesV2"}, + "properties": { + "key": "properties", + "type": "WorkspaceConnectionPropertiesV2", + }, } - def __init__(self, *, properties: "WorkspaceConnectionPropertiesV2", **kwargs): + def __init__( + self, *, properties: "WorkspaceConnectionPropertiesV2", **kwargs + ): """ :keyword properties: Required. :paramtype properties: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 """ - super(WorkspaceConnectionPropertiesV2BasicResource, self).__init__(**kwargs) + super(WorkspaceConnectionPropertiesV2BasicResource, self).__init__( + **kwargs + ) self.properties = properties -class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(msrest.serialization.Model): +class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult( + msrest.serialization.Model +): """WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult. Variables are only populated by the server, and will be ignored when sending a request. @@ -27161,17 +29541,30 @@ class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(msrest.seri } _attribute_map = { - "value": {"key": "value", "type": "[WorkspaceConnectionPropertiesV2BasicResource]"}, + "value": { + "key": "value", + "type": "[WorkspaceConnectionPropertiesV2BasicResource]", + }, "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, value: Optional[List["WorkspaceConnectionPropertiesV2BasicResource"]] = None, **kwargs): + def __init__( + self, + *, + value: Optional[ + List["WorkspaceConnectionPropertiesV2BasicResource"] + ] = None, + **kwargs + ): """ :keyword value: :paramtype value: list[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource] """ - super(WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, self).__init__(**kwargs) + super( + WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, + self, + ).__init__(**kwargs) self.value = value self.next_link = None @@ -27231,7 +29624,9 @@ def __init__(self, *, sas: Optional[str] = None, **kwargs): :keyword sas: :paramtype sas: str """ - super(WorkspaceConnectionSharedAccessSignature, self).__init__(**kwargs) + super(WorkspaceConnectionSharedAccessSignature, self).__init__( + **kwargs + ) self.sas = sas @@ -27249,7 +29644,13 @@ class WorkspaceConnectionUsernamePassword(msrest.serialization.Model): "password": {"key": "password", "type": "str"}, } - def __init__(self, *, username: Optional[str] = None, password: Optional[str] = None, **kwargs): + def __init__( + self, + *, + username: Optional[str] = None, + password: Optional[str] = None, + **kwargs + ): """ :keyword username: :paramtype username: str @@ -27277,7 +29678,13 @@ class WorkspaceListResult(msrest.serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, value: Optional[List["Workspace"]] = None, next_link: Optional[str] = None, **kwargs): + def __init__( + self, + *, + value: Optional[List["Workspace"]] = None, + next_link: Optional[str] = None, + **kwargs + ): """ :keyword value: The list of machine learning workspaces. Since this list may be incomplete, the nextLink field should be used to request the next list of machine learning workspaces. @@ -27330,16 +29737,34 @@ class WorkspaceUpdateParameters(msrest.serialization.Model): "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, "description": {"key": "properties.description", "type": "str"}, "friendly_name": {"key": "properties.friendlyName", "type": "str"}, - "image_build_compute": {"key": "properties.imageBuildCompute", "type": "str"}, + "image_build_compute": { + "key": "properties.imageBuildCompute", + "type": "str", + }, "service_managed_resources_settings": { "key": "properties.serviceManagedResourcesSettings", "type": "ServiceManagedResourcesSettings", }, - "primary_user_assigned_identity": {"key": "properties.primaryUserAssignedIdentity", "type": "str"}, - "public_network_access": {"key": "properties.publicNetworkAccess", "type": "str"}, - "application_insights": {"key": "properties.applicationInsights", "type": "str"}, - "container_registry": {"key": "properties.containerRegistry", "type": "str"}, - "encryption": {"key": "properties.encryption", "type": "EncryptionUpdateProperties"}, + "primary_user_assigned_identity": { + "key": "properties.primaryUserAssignedIdentity", + "type": "str", + }, + "public_network_access": { + "key": "properties.publicNetworkAccess", + "type": "str", + }, + "application_insights": { + "key": "properties.applicationInsights", + "type": "str", + }, + "container_registry": { + "key": "properties.containerRegistry", + "type": "str", + }, + "encryption": { + "key": "properties.encryption", + "type": "EncryptionUpdateProperties", + }, } def __init__( @@ -27351,9 +29776,13 @@ def __init__( description: Optional[str] = None, friendly_name: Optional[str] = None, image_build_compute: Optional[str] = None, - service_managed_resources_settings: Optional["ServiceManagedResourcesSettings"] = None, + service_managed_resources_settings: Optional[ + "ServiceManagedResourcesSettings" + ] = None, primary_user_assigned_identity: Optional[str] = None, - public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, + public_network_access: Optional[ + Union[str, "PublicNetworkAccess"] + ] = None, application_insights: Optional[str] = None, container_registry: Optional[str] = None, encryption: Optional["EncryptionUpdateProperties"] = None, @@ -27397,7 +29826,9 @@ def __init__( self.description = description self.friendly_name = friendly_name self.image_build_compute = image_build_compute - self.service_managed_resources_settings = service_managed_resources_settings + self.service_managed_resources_settings = ( + service_managed_resources_settings + ) self.primary_user_assigned_identity = primary_user_assigned_identity self.public_network_access = public_network_access self.application_insights = application_insights diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/__init__.py index cbd930017658..dec001f3a13b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/__init__.py @@ -12,21 +12,39 @@ from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations from ._quotas_operations import QuotasOperations from ._compute_operations import ComputeOperations -from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_endpoint_connections_operations import ( + PrivateEndpointConnectionsOperations, +) from ._private_link_resources_operations import PrivateLinkResourcesOperations from ._workspace_connections_operations import WorkspaceConnectionsOperations from ._registries_operations import RegistriesOperations from ._workspace_features_operations import WorkspaceFeaturesOperations -from ._registry_code_containers_operations import RegistryCodeContainersOperations +from ._registry_code_containers_operations import ( + RegistryCodeContainersOperations, +) from ._registry_code_versions_operations import RegistryCodeVersionsOperations -from ._registry_component_containers_operations import RegistryComponentContainersOperations -from ._registry_component_versions_operations import RegistryComponentVersionsOperations -from ._registry_data_containers_operations import RegistryDataContainersOperations +from ._registry_component_containers_operations import ( + RegistryComponentContainersOperations, +) +from ._registry_component_versions_operations import ( + RegistryComponentVersionsOperations, +) +from ._registry_data_containers_operations import ( + RegistryDataContainersOperations, +) from ._registry_data_versions_operations import RegistryDataVersionsOperations -from ._registry_environment_containers_operations import RegistryEnvironmentContainersOperations -from ._registry_environment_versions_operations import RegistryEnvironmentVersionsOperations -from ._registry_model_containers_operations import RegistryModelContainersOperations -from ._registry_model_versions_operations import RegistryModelVersionsOperations +from ._registry_environment_containers_operations import ( + RegistryEnvironmentContainersOperations, +) +from ._registry_environment_versions_operations import ( + RegistryEnvironmentVersionsOperations, +) +from ._registry_model_containers_operations import ( + RegistryModelContainersOperations, +) +from ._registry_model_versions_operations import ( + RegistryModelVersionsOperations, +) from ._batch_endpoints_operations import BatchEndpointsOperations from ._batch_deployments_operations import BatchDeploymentsOperations from ._code_containers_operations import CodeContainersOperations @@ -40,8 +58,12 @@ from ._environment_versions_operations import EnvironmentVersionsOperations from ._featureset_containers_operations import FeaturesetContainersOperations from ._featureset_versions_operations import FeaturesetVersionsOperations -from ._featurestore_entity_containers_operations import FeaturestoreEntityContainersOperations -from ._featurestore_entity_versions_operations import FeaturestoreEntityVersionsOperations +from ._featurestore_entity_containers_operations import ( + FeaturestoreEntityContainersOperations, +) +from ._featurestore_entity_versions_operations import ( + FeaturestoreEntityVersionsOperations, +) from ._jobs_operations import JobsOperations from ._labeling_jobs_operations import LabelingJobsOperations from ._model_containers_operations import ModelContainersOperations diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_batch_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_batch_deployments_operations.py index 4b9ff3642f0a..8d655fda0c21 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_batch_deployments_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_batch_deployments_operations.py @@ -34,7 +34,12 @@ from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -257,6 +262,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class BatchDeploymentsOperations(object): """BatchDeploymentsOperations operations. @@ -315,10 +321,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.BatchDeploymentTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -357,7 +371,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("BatchDeploymentTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "BatchDeploymentTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -366,15 +383,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -392,10 +419,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ): # type: (...) -> None cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -409,22 +442,37 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, None, response_headers) @@ -465,11 +513,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -487,7 +543,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -499,7 +559,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @@ -530,11 +592,19 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.BatchDeployment :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchDeployment"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -548,15 +618,25 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("BatchDeployment", pipeline_response) @@ -577,14 +657,27 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.BatchDeployment"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional["_models.BatchDeployment"]] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.BatchDeployment"]] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, "PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties") + _json = self._serialize.body( + body, + "PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties", + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -600,26 +693,43 @@ def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("BatchDeployment", pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -668,12 +778,24 @@ def begin_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchDeployment"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -690,7 +812,9 @@ def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("BatchDeployment", pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized @@ -708,7 +832,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @@ -722,12 +848,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.BatchDeployment" - cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchDeployment"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "BatchDeployment") @@ -745,28 +881,43 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("BatchDeployment", pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if response.status_code == 201: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) ) response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) - deserialized = self._deserialize("BatchDeployment", pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -814,12 +965,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchDeployment"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -836,13 +999,19 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("BatchDeployment", pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -854,6 +1023,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_batch_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_batch_endpoints_operations.py index ff19df4c5157..e66695137802 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_batch_endpoints_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_batch_endpoints_operations.py @@ -34,7 +34,12 @@ from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -283,6 +288,7 @@ def build_list_keys_request( **kwargs ) + # fmt: on class BatchEndpointsOperations(object): """BatchEndpointsOperations operations. @@ -335,10 +341,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.BatchEndpointTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -373,7 +387,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("BatchEndpointTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "BatchEndpointTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -382,15 +399,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -407,10 +434,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ): # type: (...) -> None cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -423,22 +456,37 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, None, response_headers) @@ -476,11 +524,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -497,7 +553,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -509,7 +569,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @@ -538,10 +600,16 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -554,15 +622,25 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("BatchEndpoint", pipeline_response) @@ -582,14 +660,26 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.BatchEndpoint"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional["_models.BatchEndpoint"]] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.BatchEndpoint"]] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, "PartialMinimalTrackedResourceWithIdentity") + _json = self._serialize.body( + body, "PartialMinimalTrackedResourceWithIdentity" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -604,26 +694,43 @@ def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("BatchEndpoint", pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -668,12 +775,22 @@ def begin_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -689,7 +806,9 @@ def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("BatchEndpoint", pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized @@ -707,7 +826,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @@ -721,11 +842,19 @@ def _create_or_update_initial( ): # type: (...) -> "_models.BatchEndpoint" cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "BatchEndpoint") @@ -742,28 +871,43 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("BatchEndpoint", pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if response.status_code == 201: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) ) response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) - deserialized = self._deserialize("BatchEndpoint", pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -807,12 +951,22 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -828,13 +982,19 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("BatchEndpoint", pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -846,7 +1006,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @@ -874,11 +1036,19 @@ def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.EndpointAuthKeys"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthKeys"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_list_keys_request( subscription_id=self._config.subscription_id, @@ -891,15 +1061,25 @@ def list_keys( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("EndpointAuthKeys", pipeline_response) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_code_containers_operations.py index 390e87170049..3fb0af08638c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_code_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_code_containers_operations.py @@ -32,7 +32,12 @@ from typing import Any, Callable, Dict, Iterable, Optional, TypeVar T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -197,6 +202,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class CodeContainersOperations(object): """CodeContainersOperations operations. @@ -246,10 +252,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -282,7 +296,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -291,15 +307,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -332,10 +358,16 @@ def delete( # pylint: disable=inconsistent-return-statements :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request( subscription_id=self._config.subscription_id, @@ -348,15 +380,25 @@ def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -388,10 +430,16 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -404,15 +452,25 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("CodeContainer", pipeline_response) @@ -451,11 +509,19 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "CodeContainer") @@ -472,21 +538,35 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize("CodeContainer", pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize("CodeContainer", pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_code_versions_operations.py index 75708494a685..120e360276a0 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_code_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_code_versions_operations.py @@ -32,7 +32,12 @@ from typing import Any, Callable, Dict, Iterable, Optional, TypeVar T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -211,6 +216,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class CodeVersionsOperations(object): """CodeVersionsOperations operations. @@ -269,10 +275,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -311,7 +325,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -320,15 +336,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -364,10 +390,16 @@ def delete( # pylint: disable=inconsistent-return-statements :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request( subscription_id=self._config.subscription_id, @@ -381,15 +413,25 @@ def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -424,10 +466,16 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -441,15 +489,25 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("CodeVersion", pipeline_response) @@ -491,11 +549,19 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "CodeVersion") @@ -513,15 +579,25 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: deserialized = self._deserialize("CodeVersion", pipeline_response) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_component_containers_operations.py index 95a87dfa3201..6a692da14048 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_component_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_component_containers_operations.py @@ -32,7 +32,12 @@ from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -200,6 +205,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class ComponentContainersOperations(object): """ComponentContainersOperations operations. @@ -252,10 +258,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -290,7 +304,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -299,15 +316,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -340,10 +367,16 @@ def delete( # pylint: disable=inconsistent-return-statements :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request( subscription_id=self._config.subscription_id, @@ -356,15 +389,25 @@ def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -395,11 +438,19 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComponentContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -412,17 +463,29 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("ComponentContainer", pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -458,12 +521,22 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComponentContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "ComponentContainer") @@ -480,21 +553,35 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize("ComponentContainer", pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize("ComponentContainer", pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_component_versions_operations.py index 4e975f54e4e3..63ef0cb724c4 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_component_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_component_versions_operations.py @@ -32,7 +32,12 @@ from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -214,6 +219,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class ComponentVersionsOperations(object): """ComponentVersionsOperations operations. @@ -275,10 +281,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -319,7 +333,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -328,15 +344,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -372,10 +398,16 @@ def delete( # pylint: disable=inconsistent-return-statements :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request( subscription_id=self._config.subscription_id, @@ -389,15 +421,25 @@ def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -431,11 +473,19 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComponentVersion"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -449,15 +499,25 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("ComponentVersion", pipeline_response) @@ -498,12 +558,22 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComponentVersion"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "ComponentVersion") @@ -521,21 +591,35 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize("ComponentVersion", pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize("ComponentVersion", pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_compute_operations.py index 7c899b83b299..73186ebb0cd8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_compute_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_compute_operations.py @@ -31,10 +31,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, List, Optional, TypeVar, Union + from typing import ( + Any, + Callable, + Dict, + Iterable, + List, + Optional, + TypeVar, + Union, + ) T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -522,6 +536,7 @@ def build_update_idle_shutdown_setting_request( **kwargs ) + # fmt: on class ComputeOperations(object): """ComputeOperations operations. @@ -569,10 +584,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedComputeResourcesList] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.PaginatedComputeResourcesList"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedComputeResourcesList"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -605,7 +628,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedComputeResourcesList", pipeline_response) + deserialized = self._deserialize( + "PaginatedComputeResourcesList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -614,15 +639,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -653,11 +688,19 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComputeResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComputeResource"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -670,15 +713,25 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("ComputeResource", pipeline_response) @@ -698,12 +751,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.ComputeResource" - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComputeResource"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(parameters, "ComputeResource") @@ -720,25 +783,37 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("ComputeResource", pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if response.status_code == 201: response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) - deserialized = self._deserialize("ComputeResource", pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -783,12 +858,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComputeResource"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -804,7 +891,9 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("ComputeResource", pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized @@ -822,7 +911,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @@ -835,12 +926,22 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> "_models.ComputeResource" - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComputeResource"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(parameters, "ClusterUpdateParameters") @@ -857,14 +958,22 @@ def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = self._deserialize("ComputeResource", pipeline_response) @@ -910,12 +1019,24 @@ def begin_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComputeResource"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -931,7 +1052,9 @@ def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("ComputeResource", pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized @@ -949,7 +1072,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @@ -963,10 +1088,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ): # type: (...) -> None cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -980,21 +1111,31 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) if cls: return cls(pipeline_response, None, response_headers) @@ -1035,11 +1176,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -1069,7 +1218,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @@ -1099,11 +1250,19 @@ def update_custom_services( # pylint: disable=inconsistent-return-statements :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(custom_services, "[CustomService]") @@ -1120,15 +1279,25 @@ def update_custom_services( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -1159,10 +1328,18 @@ def list_nodes( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.AmlComputeNodesInformation] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.AmlComputeNodesInformation"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.AmlComputeNodesInformation"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -1195,7 +1372,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("AmlComputeNodesInformation", pipeline_response) + deserialized = self._deserialize( + "AmlComputeNodesInformation", pipeline_response + ) list_of_elem = deserialized.nodes if cls: list_of_elem = cls(list_of_elem) @@ -1204,15 +1383,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -1242,11 +1431,19 @@ def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ComputeSecrets :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComputeSecrets"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeSecrets"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_list_keys_request( subscription_id=self._config.subscription_id, @@ -1259,15 +1456,25 @@ def list_keys( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("ComputeSecrets", pipeline_response) @@ -1287,10 +1494,16 @@ def _start_initial( # pylint: disable=inconsistent-return-statements ): # type: (...) -> None cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_start_request_initial( subscription_id=self._config.subscription_id, @@ -1303,14 +1516,22 @@ def _start_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -1346,11 +1567,19 @@ def begin_start( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._start_initial( resource_group_name=resource_group_name, @@ -1379,7 +1608,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_start.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore @@ -1392,10 +1623,16 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements ): # type: (...) -> None cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_stop_request_initial( subscription_id=self._config.subscription_id, @@ -1408,14 +1645,22 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -1451,11 +1696,19 @@ def begin_stop( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._stop_initial( resource_group_name=resource_group_name, @@ -1484,7 +1737,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_stop.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore @@ -1497,10 +1752,16 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements ): # type: (...) -> None cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_restart_request_initial( subscription_id=self._config.subscription_id, @@ -1513,14 +1774,22 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -1556,11 +1825,19 @@ def begin_restart( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._restart_initial( resource_group_name=resource_group_name, @@ -1589,7 +1866,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_restart.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore @@ -1619,11 +1898,19 @@ def update_idle_shutdown_setting( # pylint: disable=inconsistent-return-stateme :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(parameters, "IdleShutdownSetting") @@ -1640,15 +1927,25 @@ def update_idle_shutdown_setting( # pylint: disable=inconsistent-return-stateme request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_data_containers_operations.py index b92b8a6ed788..ec06a5ebdc2c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_data_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_data_containers_operations.py @@ -32,7 +32,12 @@ from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -200,6 +205,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class DataContainersOperations(object): """DataContainersOperations operations. @@ -252,10 +258,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -290,7 +304,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -299,15 +315,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -340,10 +366,16 @@ def delete( # pylint: disable=inconsistent-return-statements :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request( subscription_id=self._config.subscription_id, @@ -356,15 +388,25 @@ def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -396,10 +438,16 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -412,15 +460,25 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("DataContainer", pipeline_response) @@ -459,11 +517,19 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "DataContainer") @@ -480,21 +546,35 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize("DataContainer", pipeline_response) + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize("DataContainer", pipeline_response) + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_data_versions_operations.py index 9a2b854b7857..5e1074792c2e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_data_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_data_versions_operations.py @@ -32,7 +32,12 @@ from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -217,6 +222,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class DataVersionsOperations(object): """DataVersionsOperations operations. @@ -285,10 +291,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -331,7 +345,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataVersionBaseResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -340,15 +356,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -384,10 +410,16 @@ def delete( # pylint: disable=inconsistent-return-statements :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request( subscription_id=self._config.subscription_id, @@ -401,15 +433,25 @@ def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -443,11 +485,19 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.DataVersionBase"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -461,15 +511,25 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("DataVersionBase", pipeline_response) @@ -510,12 +570,22 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.DataVersionBase"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "DataVersionBase") @@ -533,21 +603,35 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize("DataVersionBase", pipeline_response) + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize("DataVersionBase", pipeline_response) + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_datastores_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_datastores_operations.py index 51eaa2c89f36..ffb1d9bb69bb 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_datastores_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_datastores_operations.py @@ -32,7 +32,12 @@ from typing import Any, Callable, Dict, Iterable, List, Optional, TypeVar T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -257,6 +262,7 @@ def build_list_secrets_request( **kwargs ) + # fmt: on class DatastoresOperations(object): """DatastoresOperations operations. @@ -324,10 +330,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DatastoreResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -372,7 +386,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("DatastoreResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DatastoreResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -381,15 +397,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -422,10 +448,16 @@ def delete( # pylint: disable=inconsistent-return-statements :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request( subscription_id=self._config.subscription_id, @@ -438,15 +470,25 @@ def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -478,10 +520,16 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType["_models.Datastore"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -494,15 +542,25 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("Datastore", pipeline_response) @@ -544,11 +602,19 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType["_models.Datastore"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "Datastore") @@ -566,15 +632,25 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: deserialized = self._deserialize("Datastore", pipeline_response) @@ -613,11 +689,19 @@ def list_secrets( :rtype: ~azure.mgmt.machinelearningservices.models.DatastoreSecrets :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.DatastoreSecrets"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DatastoreSecrets"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_list_secrets_request( subscription_id=self._config.subscription_id, @@ -630,15 +714,25 @@ def list_secrets( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("DatastoreSecrets", pipeline_response) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_environment_containers_operations.py index 32f4b7f884ff..94935e01c118 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_environment_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_environment_containers_operations.py @@ -32,7 +32,12 @@ from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -200,6 +205,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class EnvironmentContainersOperations(object): """EnvironmentContainersOperations operations. @@ -252,10 +258,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -290,7 +304,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -299,15 +316,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -340,10 +367,16 @@ def delete( # pylint: disable=inconsistent-return-statements :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request( subscription_id=self._config.subscription_id, @@ -356,15 +389,25 @@ def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -395,11 +438,19 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.EnvironmentContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -412,17 +463,29 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("EnvironmentContainer", pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -458,12 +521,22 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.EnvironmentContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "EnvironmentContainer") @@ -480,21 +553,35 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize("EnvironmentContainer", pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize("EnvironmentContainer", pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_environment_versions_operations.py index 81857d4993f3..301145dd5e1b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_environment_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_environment_versions_operations.py @@ -32,7 +32,12 @@ from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -214,6 +219,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class EnvironmentVersionsOperations(object): """EnvironmentVersionsOperations operations. @@ -275,10 +281,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -319,7 +333,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersionResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -328,15 +345,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -372,10 +399,16 @@ def delete( # pylint: disable=inconsistent-return-statements :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request( subscription_id=self._config.subscription_id, @@ -389,15 +422,25 @@ def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -431,11 +474,19 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.EnvironmentVersion"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -449,17 +500,29 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("EnvironmentVersion", pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -498,12 +561,22 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.EnvironmentVersion"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "EnvironmentVersion") @@ -521,21 +594,35 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize("EnvironmentVersion", pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize("EnvironmentVersion", pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_featureset_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_featureset_containers_operations.py index 0a0b3911a8b3..6541639b356c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_featureset_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_featureset_containers_operations.py @@ -34,7 +34,12 @@ from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -205,6 +210,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class FeaturesetContainersOperations(object): """FeaturesetContainersOperations operations. @@ -262,10 +268,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.FeaturesetContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.FeaturesetContainerResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetContainerResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -302,7 +316,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturesetContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "FeaturesetContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -311,15 +328,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -336,10 +363,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ): # type: (...) -> None cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -352,22 +385,37 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, None, response_headers) @@ -405,11 +453,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -426,7 +482,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -438,7 +498,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore @@ -466,11 +528,19 @@ def get_entity( :rtype: ~azure.mgmt.machinelearningservices.models.FeaturesetContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.FeaturesetContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetContainer"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_entity_request( subscription_id=self._config.subscription_id, @@ -483,17 +553,29 @@ def get_entity( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("FeaturesetContainer", pipeline_response) + deserialized = self._deserialize( + "FeaturesetContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -511,12 +593,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.FeaturesetContainer" - cls = kwargs.pop("cls", None) # type: ClsType["_models.FeaturesetContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetContainer"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "FeaturesetContainer") @@ -533,28 +625,43 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("FeaturesetContainer", pipeline_response) + deserialized = self._deserialize( + "FeaturesetContainer", pipeline_response + ) if response.status_code == 201: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) ) response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) - deserialized = self._deserialize("FeaturesetContainer", pipeline_response) + deserialized = self._deserialize( + "FeaturesetContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -599,12 +706,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.FeaturesetContainer"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetContainer"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -620,13 +739,19 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("FeaturesetContainer", pipeline_response) + deserialized = self._deserialize( + "FeaturesetContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -638,6 +763,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_featureset_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_featureset_versions_operations.py index 250c25188584..49311de9bd88 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_featureset_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_featureset_versions_operations.py @@ -34,7 +34,12 @@ from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -401,6 +406,7 @@ def build_list_materialization_jobs_request( **kwargs ) + # fmt: on class FeaturesetVersionsOperations(object): """FeaturesetVersionsOperations operations. @@ -461,10 +467,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.FeaturesetVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.FeaturesetVersionResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetVersionResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -503,7 +517,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturesetVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "FeaturesetVersionResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -512,15 +529,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -538,10 +565,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ): # type: (...) -> None cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -555,22 +588,37 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, None, response_headers) @@ -611,11 +659,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -633,7 +689,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -645,7 +705,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore @@ -676,11 +738,19 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.FeaturesetVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.FeaturesetVersion"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetVersion"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -694,17 +764,29 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("FeaturesetVersion", pipeline_response) + deserialized = self._deserialize( + "FeaturesetVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -723,12 +805,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.FeaturesetVersion" - cls = kwargs.pop("cls", None) # type: ClsType["_models.FeaturesetVersion"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetVersion"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "FeaturesetVersion") @@ -746,28 +838,43 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("FeaturesetVersion", pipeline_response) + deserialized = self._deserialize( + "FeaturesetVersion", pipeline_response + ) if response.status_code == 201: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) ) response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) - deserialized = self._deserialize("FeaturesetVersion", pipeline_response) + deserialized = self._deserialize( + "FeaturesetVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -815,12 +922,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.FeaturesetVersion"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetVersion"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -837,13 +956,19 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("FeaturesetVersion", pipeline_response) + deserialized = self._deserialize( + "FeaturesetVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -855,7 +980,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore @@ -869,12 +996,22 @@ def _backfill_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.FeaturesetVersionBackfillResponse"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional["_models.FeaturesetVersionBackfillResponse"]] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.FeaturesetVersionBackfillResponse"]] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "FeaturesetVersionBackfillRequest") @@ -892,23 +1029,37 @@ def _backfill_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("FeaturesetVersionBackfillResponse", pipeline_response) + deserialized = self._deserialize( + "FeaturesetVersionBackfillResponse", pipeline_response + ) if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -956,12 +1107,24 @@ def begin_backfill( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetVersionBackfillResponse] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.FeaturesetVersionBackfillResponse"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetVersionBackfillResponse"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._backfill_initial( resource_group_name=resource_group_name, @@ -978,13 +1141,19 @@ def begin_backfill( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("FeaturesetVersionBackfillResponse", pipeline_response) + deserialized = self._deserialize( + "FeaturesetVersionBackfillResponse", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -996,7 +1165,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_backfill.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill"} # type: ignore @@ -1031,11 +1202,19 @@ def get_feature( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType["_models.Feature"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "GetFeatureRequest") @@ -1053,15 +1232,25 @@ def get_feature( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("Feature", pipeline_response) @@ -1108,10 +1297,18 @@ def list_features( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.FeatureArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.FeatureArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeatureArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -1150,7 +1347,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("FeatureArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "FeatureArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1159,15 +1358,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -1217,10 +1426,18 @@ def list_materialization_jobs( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.FeaturesetJobArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.FeaturesetJobArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetJobArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -1237,7 +1454,9 @@ def prepare_request(next_link=None): filters=filters, feature_window_start=feature_window_start, feature_window_end=feature_window_end, - template_url=self.list_materialization_jobs.metadata["url"], + template_url=self.list_materialization_jobs.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) @@ -1263,7 +1482,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturesetJobArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "FeaturesetJobArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1272,15 +1493,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_featurestore_entity_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_featurestore_entity_containers_operations.py index f1e8c60c6612..e1a122eb8965 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_featurestore_entity_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_featurestore_entity_containers_operations.py @@ -34,7 +34,12 @@ from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -205,6 +210,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class FeaturestoreEntityContainersOperations(object): """FeaturestoreEntityContainersOperations operations. @@ -262,10 +268,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.FeaturestoreEntityContainerResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturestoreEntityContainerResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -302,7 +316,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturestoreEntityContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "FeaturestoreEntityContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -311,15 +328,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -336,10 +363,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ): # type: (...) -> None cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -352,22 +385,37 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, None, response_headers) @@ -405,11 +453,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -426,7 +482,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -438,7 +498,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore @@ -466,11 +528,19 @@ def get_entity( :rtype: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.FeaturestoreEntityContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturestoreEntityContainer"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_entity_request( subscription_id=self._config.subscription_id, @@ -483,17 +553,29 @@ def get_entity( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("FeaturestoreEntityContainer", pipeline_response) + deserialized = self._deserialize( + "FeaturestoreEntityContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -511,12 +593,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.FeaturestoreEntityContainer" - cls = kwargs.pop("cls", None) # type: ClsType["_models.FeaturestoreEntityContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturestoreEntityContainer"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "FeaturestoreEntityContainer") @@ -533,28 +625,43 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("FeaturestoreEntityContainer", pipeline_response) + deserialized = self._deserialize( + "FeaturestoreEntityContainer", pipeline_response + ) if response.status_code == 201: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) ) response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) - deserialized = self._deserialize("FeaturestoreEntityContainer", pipeline_response) + deserialized = self._deserialize( + "FeaturestoreEntityContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -599,12 +706,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.FeaturestoreEntityContainer"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturestoreEntityContainer"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -620,13 +739,19 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("FeaturestoreEntityContainer", pipeline_response) + deserialized = self._deserialize( + "FeaturestoreEntityContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -638,6 +763,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_featurestore_entity_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_featurestore_entity_versions_operations.py index 04bc583b4bff..4d58ac3f48fa 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_featurestore_entity_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_featurestore_entity_versions_operations.py @@ -34,7 +34,12 @@ from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -213,6 +218,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class FeaturestoreEntityVersionsOperations(object): """FeaturestoreEntityVersionsOperations operations. @@ -273,10 +279,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.FeaturestoreEntityVersionResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturestoreEntityVersionResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -315,7 +329,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturestoreEntityVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "FeaturestoreEntityVersionResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -324,15 +341,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -350,10 +377,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ): # type: (...) -> None cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -367,22 +400,37 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, None, response_headers) @@ -423,11 +471,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -445,7 +501,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -457,7 +517,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore @@ -488,11 +550,19 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.FeaturestoreEntityVersion"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturestoreEntityVersion"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -506,17 +576,29 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("FeaturestoreEntityVersion", pipeline_response) + deserialized = self._deserialize( + "FeaturestoreEntityVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -535,12 +617,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.FeaturestoreEntityVersion" - cls = kwargs.pop("cls", None) # type: ClsType["_models.FeaturestoreEntityVersion"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturestoreEntityVersion"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "FeaturestoreEntityVersion") @@ -558,28 +650,43 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("FeaturestoreEntityVersion", pipeline_response) + deserialized = self._deserialize( + "FeaturestoreEntityVersion", pipeline_response + ) if response.status_code == 201: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) ) response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) - deserialized = self._deserialize("FeaturestoreEntityVersion", pipeline_response) + deserialized = self._deserialize( + "FeaturestoreEntityVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -627,12 +734,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.FeaturestoreEntityVersion"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturestoreEntityVersion"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -649,13 +768,19 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("FeaturestoreEntityVersion", pipeline_response) + deserialized = self._deserialize( + "FeaturestoreEntityVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -667,6 +792,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_jobs_operations.py index fe4d7c9a8a5b..cace579cf5ff 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_jobs_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_jobs_operations.py @@ -34,7 +34,12 @@ from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -256,6 +261,7 @@ def build_cancel_request_initial( **kwargs ) + # fmt: on class JobsOperations(object): """JobsOperations operations. @@ -323,10 +329,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.JobBaseResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -371,7 +385,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("JobBaseResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "JobBaseResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -380,15 +396,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -405,10 +431,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ): # type: (...) -> None cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -421,22 +453,37 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, None, response_headers) @@ -474,11 +521,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -495,7 +550,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -507,7 +566,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @@ -536,10 +597,16 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType["_models.JobBase"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -552,15 +619,25 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("JobBase", pipeline_response) @@ -599,11 +676,19 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType["_models.JobBase"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "JobBase") @@ -620,15 +705,25 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: deserialized = self._deserialize("JobBase", pipeline_response) @@ -652,10 +747,16 @@ def _cancel_initial( # pylint: disable=inconsistent-return-statements ): # type: (...) -> None cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_cancel_request_initial( subscription_id=self._config.subscription_id, @@ -668,19 +769,31 @@ def _cancel_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) @@ -718,11 +831,19 @@ def begin_cancel( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._cancel_initial( resource_group_name=resource_group_name, @@ -739,7 +860,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -751,6 +876,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_labeling_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_labeling_jobs_operations.py index 3fbcd44d231b..a8cec6fc4d54 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_labeling_jobs_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_labeling_jobs_operations.py @@ -34,7 +34,12 @@ from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -328,6 +333,7 @@ def build_resume_request_initial( **kwargs ) + # fmt: on class LabelingJobsOperations(object): """LabelingJobsOperations operations. @@ -380,10 +386,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.LabelingJobResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.LabelingJobResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.LabelingJobResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -418,7 +432,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("LabelingJobResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "LabelingJobResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -427,15 +443,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -468,10 +494,16 @@ def delete( # pylint: disable=inconsistent-return-statements :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request( subscription_id=self._config.subscription_id, @@ -484,15 +516,25 @@ def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -532,10 +574,16 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType["_models.LabelingJob"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -550,15 +598,25 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("LabelingJob", pipeline_response) @@ -579,11 +637,19 @@ def _create_or_update_initial( ): # type: (...) -> "_models.LabelingJob" cls = kwargs.pop("cls", None) # type: ClsType["_models.LabelingJob"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "LabelingJob") @@ -600,22 +666,33 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: deserialized = self._deserialize("LabelingJob", pipeline_response) if response.status_code == 201: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) ) response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") @@ -665,12 +742,22 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.LabelingJob] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType["_models.LabelingJob"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -692,7 +779,11 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -704,7 +795,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore @@ -717,12 +810,22 @@ def _export_labels_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.ExportSummary"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional["_models.ExportSummary"]] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.ExportSummary"]] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "ExportSummary") @@ -739,23 +842,37 @@ def _export_labels_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("ExportSummary", pipeline_response) + deserialized = self._deserialize( + "ExportSummary", pipeline_response + ) if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -799,12 +916,22 @@ def begin_export_labels( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ExportSummary] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType["_models.ExportSummary"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._export_labels_initial( resource_group_name=resource_group_name, @@ -820,13 +947,19 @@ def begin_export_labels( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("ExportSummary", pipeline_response) + deserialized = self._deserialize( + "ExportSummary", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -838,7 +971,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_export_labels.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore @@ -867,10 +1002,16 @@ def pause( # pylint: disable=inconsistent-return-statements :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_pause_request( subscription_id=self._config.subscription_id, @@ -883,15 +1024,25 @@ def pause( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -907,10 +1058,16 @@ def _resume_initial( # pylint: disable=inconsistent-return-statements ): # type: (...) -> None cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_resume_request_initial( subscription_id=self._config.subscription_id, @@ -923,19 +1080,31 @@ def _resume_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) @@ -973,11 +1142,19 @@ def begin_resume( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._resume_initial( resource_group_name=resource_group_name, @@ -994,7 +1171,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -1006,6 +1187,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_resume.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_model_containers_operations.py index 0a010706941c..bc8fe01c1a60 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_model_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_model_containers_operations.py @@ -32,7 +32,12 @@ from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -203,6 +208,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class ModelContainersOperations(object): """ModelContainersOperations operations. @@ -258,10 +264,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -298,7 +312,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -307,15 +323,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -348,10 +374,16 @@ def delete( # pylint: disable=inconsistent-return-statements :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request( subscription_id=self._config.subscription_id, @@ -364,15 +396,25 @@ def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -403,11 +445,19 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -420,15 +470,25 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("ModelContainer", pipeline_response) @@ -466,12 +526,22 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "ModelContainer") @@ -488,21 +558,35 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize("ModelContainer", pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize("ModelContainer", pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_model_versions_operations.py index e2f46f75e7d0..fe8cbc60d1eb 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_model_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_model_versions_operations.py @@ -34,7 +34,12 @@ from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -278,6 +283,7 @@ def build_package_request_initial( **kwargs ) + # fmt: on class ModelVersionsOperations(object): """ModelVersionsOperations operations. @@ -359,10 +365,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -415,7 +429,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -424,15 +440,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -468,10 +494,16 @@ def delete( # pylint: disable=inconsistent-return-statements :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request( subscription_id=self._config.subscription_id, @@ -485,15 +517,25 @@ def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -528,10 +570,16 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -545,15 +593,25 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("ModelVersion", pipeline_response) @@ -595,11 +653,19 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "ModelVersion") @@ -617,15 +683,25 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: deserialized = self._deserialize("ModelVersion", pipeline_response) @@ -650,12 +726,22 @@ def _package_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.PackageResponse"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional["_models.PackageResponse"]] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.PackageResponse"]] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "object") @@ -673,23 +759,37 @@ def _package_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("PackageResponse", pipeline_response) + deserialized = self._deserialize( + "PackageResponse", pipeline_response + ) if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -737,12 +837,24 @@ def begin_package( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.PackageResponse] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.PackageResponse"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PackageResponse"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._package_initial( resource_group_name=resource_group_name, @@ -759,13 +871,19 @@ def begin_package( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("PackageResponse", pipeline_response) + deserialized = self._deserialize( + "PackageResponse", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -777,6 +895,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_package.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_online_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_online_deployments_operations.py index 118cfadee58d..3e143d802066 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_online_deployments_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_online_deployments_operations.py @@ -34,7 +34,12 @@ from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -348,6 +353,7 @@ def build_list_skus_request( **kwargs ) + # fmt: on class OnlineDeploymentsOperations(object): """OnlineDeploymentsOperations operations. @@ -406,10 +412,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.OnlineDeploymentTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -448,7 +462,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineDeploymentTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "OnlineDeploymentTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -457,15 +474,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -483,10 +510,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ): # type: (...) -> None cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -500,22 +533,37 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, None, response_headers) @@ -556,11 +604,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -578,7 +634,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -590,7 +650,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @@ -621,11 +683,19 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.OnlineDeployment :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.OnlineDeployment"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -639,15 +709,25 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("OnlineDeployment", pipeline_response) @@ -668,14 +748,26 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.OnlineDeployment"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional["_models.OnlineDeployment"]] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.OnlineDeployment"]] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, "PartialMinimalTrackedResourceWithSku") + _json = self._serialize.body( + body, "PartialMinimalTrackedResourceWithSku" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -691,26 +783,43 @@ def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("OnlineDeployment", pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -758,12 +867,24 @@ def begin_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.OnlineDeployment"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -780,7 +901,9 @@ def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("OnlineDeployment", pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized @@ -798,7 +921,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @@ -812,12 +937,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.OnlineDeployment" - cls = kwargs.pop("cls", None) # type: ClsType["_models.OnlineDeployment"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "OnlineDeployment") @@ -835,28 +970,43 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("OnlineDeployment", pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if response.status_code == 201: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) ) response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) - deserialized = self._deserialize("OnlineDeployment", pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -904,12 +1054,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.OnlineDeployment"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -926,13 +1088,19 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("OnlineDeployment", pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -944,7 +1112,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @@ -978,12 +1148,22 @@ def get_logs( :rtype: ~azure.mgmt.machinelearningservices.models.DeploymentLogs :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.DeploymentLogs"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DeploymentLogs"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "DeploymentLogsRequest") @@ -1001,15 +1181,25 @@ def get_logs( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("DeploymentLogs", pipeline_response) @@ -1055,10 +1245,18 @@ def list_skus( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.SkuResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.SkuResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.SkuResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -1097,7 +1295,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("SkuResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "SkuResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1106,15 +1306,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_online_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_online_endpoints_operations.py index 38f1af9b3b7f..258c3fd46954 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_online_endpoints_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_online_endpoints_operations.py @@ -34,7 +34,12 @@ from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -379,6 +384,7 @@ def build_get_token_request( **kwargs ) + # fmt: on class OnlineEndpointsOperations(object): """OnlineEndpointsOperations operations. @@ -449,10 +455,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.OnlineEndpointTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -497,7 +511,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineEndpointTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "OnlineEndpointTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -506,15 +523,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -531,10 +558,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ): # type: (...) -> None cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -547,22 +580,37 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, None, response_headers) @@ -600,11 +648,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -621,7 +677,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -633,7 +693,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @@ -661,11 +723,19 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.OnlineEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.OnlineEndpoint"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -678,15 +748,25 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("OnlineEndpoint", pipeline_response) @@ -706,14 +786,26 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.OnlineEndpoint"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional["_models.OnlineEndpoint"]] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.OnlineEndpoint"]] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, "PartialMinimalTrackedResourceWithIdentity") + _json = self._serialize.body( + body, "PartialMinimalTrackedResourceWithIdentity" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -728,26 +820,43 @@ def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("OnlineEndpoint", pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -793,12 +902,24 @@ def begin_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.OnlineEndpoint"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -814,7 +935,9 @@ def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("OnlineEndpoint", pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized @@ -832,7 +955,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @@ -845,12 +970,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.OnlineEndpoint" - cls = kwargs.pop("cls", None) # type: ClsType["_models.OnlineEndpoint"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "OnlineEndpoint") @@ -867,28 +1002,43 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("OnlineEndpoint", pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if response.status_code == 201: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) ) response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) - deserialized = self._deserialize("OnlineEndpoint", pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -933,12 +1083,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.OnlineEndpoint"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -954,13 +1116,19 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("OnlineEndpoint", pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -972,7 +1140,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @@ -1000,11 +1170,19 @@ def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.EndpointAuthKeys"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthKeys"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_list_keys_request( subscription_id=self._config.subscription_id, @@ -1017,15 +1195,25 @@ def list_keys( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("EndpointAuthKeys", pipeline_response) @@ -1046,11 +1234,19 @@ def _regenerate_keys_initial( # pylint: disable=inconsistent-return-statements ): # type: (...) -> None cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "RegenerateEndpointKeysRequest") @@ -1067,19 +1263,31 @@ def _regenerate_keys_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) @@ -1120,12 +1328,22 @@ def begin_regenerate_keys( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._regenerate_keys_initial( resource_group_name=resource_group_name, @@ -1144,7 +1362,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -1156,7 +1378,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_regenerate_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore @@ -1184,11 +1408,19 @@ def get_token( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthToken :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.EndpointAuthToken"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthToken"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_token_request( subscription_id=self._config.subscription_id, @@ -1201,17 +1433,29 @@ def get_token( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("EndpointAuthToken", pipeline_response) + deserialized = self._deserialize( + "EndpointAuthToken", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_operations.py index ef724f1e74d3..d0c2dd98f64c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_operations.py @@ -32,7 +32,12 @@ from typing import Any, Callable, Dict, Iterable, Optional, TypeVar T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -64,6 +69,7 @@ def build_list_request( **kwargs ) + # fmt: on class Operations(object): """Operations operations. @@ -101,10 +107,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.AmlOperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.AmlOperationListResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.AmlOperationListResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -129,7 +143,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("AmlOperationListResult", pipeline_response) + deserialized = self._deserialize( + "AmlOperationListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -138,15 +154,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_private_endpoint_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_private_endpoint_connections_operations.py index aa6d01273b19..53b9c75af4a8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_private_endpoint_connections_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_private_endpoint_connections_operations.py @@ -32,7 +32,12 @@ from typing import Any, Callable, Dict, Iterable, Optional, TypeVar T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -194,6 +199,7 @@ def build_delete_request( **kwargs ) + # fmt: on class PrivateEndpointConnectionsOperations(object): """PrivateEndpointConnectionsOperations operations. @@ -238,10 +244,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnectionListResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -272,7 +286,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) + deserialized = self._deserialize( + "PrivateEndpointConnectionListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -281,15 +297,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -320,11 +346,19 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.PrivateEndpointConnection"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -337,17 +371,29 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response) + deserialized = self._deserialize( + "PrivateEndpointConnection", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -382,12 +428,22 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.PrivateEndpointConnection"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(properties, "PrivateEndpointConnection") @@ -404,17 +460,29 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response) + deserialized = self._deserialize( + "PrivateEndpointConnection", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -447,10 +515,16 @@ def delete( # pylint: disable=inconsistent-return-statements :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request( subscription_id=self._config.subscription_id, @@ -463,15 +537,25 @@ def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_private_link_resources_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_private_link_resources_operations.py index d18f9a680b6e..3862ff5417fa 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_private_link_resources_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_private_link_resources_operations.py @@ -31,7 +31,12 @@ from typing import Any, Callable, Dict, Optional, TypeVar T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -73,6 +78,7 @@ def build_list_request( **kwargs ) + # fmt: on class PrivateLinkResourcesOperations(object): """PrivateLinkResourcesOperations operations. @@ -115,11 +121,19 @@ def list( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateLinkResourceListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.PrivateLinkResourceListResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateLinkResourceListResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_list_request( subscription_id=self._config.subscription_id, @@ -131,17 +145,29 @@ def list( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("PrivateLinkResourceListResult", pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "PrivateLinkResourceListResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_quotas_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_quotas_operations.py index 891dac1d5f84..18d7b49a5a35 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_quotas_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_quotas_operations.py @@ -32,7 +32,12 @@ from typing import Any, Callable, Dict, Iterable, Optional, TypeVar T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -110,6 +115,7 @@ def build_list_request( **kwargs ) + # fmt: on class QuotasOperations(object): """QuotasOperations operations. @@ -152,12 +158,22 @@ def update( :rtype: ~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotasResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(parameters, "QuotaUpdateParameters") @@ -172,17 +188,29 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("UpdateWorkspaceQuotasResult", pipeline_response) + deserialized = self._deserialize( + "UpdateWorkspaceQuotasResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -208,10 +236,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListWorkspaceQuotas] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.ListWorkspaceQuotas"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListWorkspaceQuotas"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -240,7 +276,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ListWorkspaceQuotas", pipeline_response) + deserialized = self._deserialize( + "ListWorkspaceQuotas", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -249,15 +287,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registries_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registries_operations.py index 31bac636596d..cbac0bea688e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registries_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registries_operations.py @@ -34,7 +34,12 @@ from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -267,6 +272,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class RegistriesOperations(object): """RegistriesOperations operations. @@ -310,10 +316,18 @@ def list_by_subscription( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.RegistryTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -342,7 +356,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("RegistryTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "RegistryTrackedResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -351,15 +367,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -390,10 +416,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.RegistryTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -424,7 +458,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("RegistryTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "RegistryTrackedResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -433,15 +469,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -457,10 +503,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ): # type: (...) -> None cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -472,22 +524,37 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, None, response_headers) @@ -522,11 +589,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -542,7 +617,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -554,7 +633,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @@ -580,10 +661,16 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -595,15 +682,25 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("Registry", pipeline_response) @@ -623,13 +720,23 @@ def _update_initial( ): # type: (...) -> "_models.Registry" cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, "PartialRegistryPartialTrackedResource") + _json = self._serialize.body( + body, "PartialRegistryPartialTrackedResource" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -643,22 +750,34 @@ def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: deserialized = self._deserialize("Registry", pipeline_response) if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) deserialized = self._deserialize("Registry", pipeline_response) @@ -700,12 +819,22 @@ def begin_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Registry] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -726,7 +855,11 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -738,7 +871,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @@ -750,12 +885,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.Registry"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional["_models.Registry"]] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.Registry"]] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "Registry") @@ -771,14 +916,22 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: @@ -825,12 +978,22 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Registry] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -851,7 +1014,11 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -863,6 +1030,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_code_containers_operations.py index 1aea2a730943..93e405c30d52 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_code_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_code_containers_operations.py @@ -34,7 +34,12 @@ from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -199,6 +204,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class RegistryCodeContainersOperations(object): """RegistryCodeContainersOperations operations. @@ -248,10 +254,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -284,7 +298,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -293,15 +309,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -318,10 +344,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ): # type: (...) -> None cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -334,22 +366,37 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, None, response_headers) @@ -387,11 +434,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -408,7 +463,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -420,7 +479,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore @@ -449,10 +510,16 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -465,15 +532,25 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("CodeContainer", pipeline_response) @@ -494,11 +571,19 @@ def _create_or_update_initial( ): # type: (...) -> "_models.CodeContainer" cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "CodeContainer") @@ -515,28 +600,43 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("CodeContainer", pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if response.status_code == 201: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) ) response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) - deserialized = self._deserialize("CodeContainer", pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -580,12 +680,22 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.CodeContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -601,13 +711,19 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("CodeContainer", pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -619,6 +735,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_code_versions_operations.py index 6336acf43fa4..146e022466a9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_code_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_code_versions_operations.py @@ -34,7 +34,12 @@ from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -213,6 +218,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class RegistryCodeVersionsOperations(object): """RegistryCodeVersionsOperations operations. @@ -271,10 +277,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -313,7 +327,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -322,15 +338,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -348,10 +374,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ): # type: (...) -> None cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -365,22 +397,37 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, None, response_headers) @@ -421,11 +468,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -443,7 +498,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -455,7 +514,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore @@ -487,10 +548,16 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -504,15 +571,25 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("CodeVersion", pipeline_response) @@ -534,11 +611,19 @@ def _create_or_update_initial( ): # type: (...) -> "_models.CodeVersion" cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "CodeVersion") @@ -556,22 +641,33 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: deserialized = self._deserialize("CodeVersion", pipeline_response) if response.status_code == 201: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) ) response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") @@ -624,12 +720,22 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.CodeVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -652,7 +758,11 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -664,6 +774,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_component_containers_operations.py index 771095a26614..b0a1746875b7 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_component_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_component_containers_operations.py @@ -34,7 +34,12 @@ from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -199,6 +204,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class RegistryComponentContainersOperations(object): """RegistryComponentContainersOperations operations. @@ -248,10 +254,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -284,7 +298,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -293,15 +310,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -318,10 +345,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ): # type: (...) -> None cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -334,22 +367,37 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, None, response_headers) @@ -387,11 +435,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -408,7 +464,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -420,7 +480,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore @@ -448,11 +510,19 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComponentContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -465,17 +535,29 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("ComponentContainer", pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -493,12 +575,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.ComponentContainer" - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComponentContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "ComponentContainer") @@ -515,28 +607,43 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("ComponentContainer", pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if response.status_code == 201: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) ) response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) - deserialized = self._deserialize("ComponentContainer", pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -581,12 +688,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComponentContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComponentContainer"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -602,13 +721,19 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("ComponentContainer", pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -620,6 +745,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_component_versions_operations.py index ca55b40a4296..4d6e3680cdf4 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_component_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_component_versions_operations.py @@ -34,7 +34,12 @@ from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -213,6 +218,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class RegistryComponentVersionsOperations(object): """RegistryComponentVersionsOperations operations. @@ -271,10 +277,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -313,7 +327,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -322,15 +338,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -348,10 +374,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ): # type: (...) -> None cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -365,22 +397,37 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, None, response_headers) @@ -421,11 +468,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -443,7 +498,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -455,7 +514,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore @@ -486,11 +547,19 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComponentVersion"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -504,15 +573,25 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("ComponentVersion", pipeline_response) @@ -533,12 +612,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.ComponentVersion" - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComponentVersion"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "ComponentVersion") @@ -556,28 +645,43 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("ComponentVersion", pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if response.status_code == 201: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) ) response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) - deserialized = self._deserialize("ComponentVersion", pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -625,12 +729,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComponentVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.ComponentVersion"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -647,13 +763,19 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("ComponentVersion", pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -665,6 +787,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_data_containers_operations.py index e3010671e22b..dcbdc8efaaf3 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_data_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_data_containers_operations.py @@ -34,7 +34,12 @@ from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -202,6 +207,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class RegistryDataContainersOperations(object): """RegistryDataContainersOperations operations. @@ -254,10 +260,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -292,7 +306,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -301,15 +317,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -326,10 +352,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ): # type: (...) -> None cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -342,22 +374,37 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, None, response_headers) @@ -395,11 +442,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -416,7 +471,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -428,7 +487,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore @@ -457,10 +518,16 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -473,15 +540,25 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("DataContainer", pipeline_response) @@ -502,11 +579,19 @@ def _create_or_update_initial( ): # type: (...) -> "_models.DataContainer" cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "DataContainer") @@ -523,28 +608,43 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("DataContainer", pipeline_response) + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if response.status_code == 201: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) ) response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) - deserialized = self._deserialize("DataContainer", pipeline_response) + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -588,12 +688,22 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.DataContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -609,13 +719,19 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("DataContainer", pipeline_response) + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -627,6 +743,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_data_versions_operations.py index 8fc22eca1bb1..7e1ad2a55b75 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_data_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_data_versions_operations.py @@ -34,7 +34,12 @@ from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -219,6 +224,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class RegistryDataVersionsOperations(object): """RegistryDataVersionsOperations operations. @@ -287,10 +293,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -333,7 +347,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataVersionBaseResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -342,15 +358,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -368,10 +394,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ): # type: (...) -> None cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -385,22 +417,37 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, None, response_headers) @@ -441,11 +488,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -463,7 +518,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -475,7 +534,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore @@ -506,11 +567,19 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.DataVersionBase"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -524,15 +593,25 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("DataVersionBase", pipeline_response) @@ -553,12 +632,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.DataVersionBase" - cls = kwargs.pop("cls", None) # type: ClsType["_models.DataVersionBase"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "DataVersionBase") @@ -576,28 +665,43 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("DataVersionBase", pipeline_response) + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if response.status_code == 201: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) ) response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) - deserialized = self._deserialize("DataVersionBase", pipeline_response) + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -645,12 +749,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.DataVersionBase] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.DataVersionBase"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -667,13 +783,19 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("DataVersionBase", pipeline_response) + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -685,6 +807,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_environment_containers_operations.py index 0d1541eebb57..b89643f60d5d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_environment_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_environment_containers_operations.py @@ -34,7 +34,12 @@ from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -202,6 +207,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class RegistryEnvironmentContainersOperations(object): """RegistryEnvironmentContainersOperations operations. @@ -254,10 +260,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -292,7 +306,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -301,15 +318,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -326,10 +353,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ): # type: (...) -> None cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -342,22 +375,37 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, None, response_headers) @@ -395,11 +443,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -416,7 +472,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -428,7 +488,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore @@ -456,11 +518,19 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.EnvironmentContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -473,17 +543,29 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("EnvironmentContainer", pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -501,12 +583,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.EnvironmentContainer" - cls = kwargs.pop("cls", None) # type: ClsType["_models.EnvironmentContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "EnvironmentContainer") @@ -523,28 +615,43 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("EnvironmentContainer", pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if response.status_code == 201: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) ) response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) - deserialized = self._deserialize("EnvironmentContainer", pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -589,12 +696,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.EnvironmentContainer"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -610,13 +729,19 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("EnvironmentContainer", pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -628,6 +753,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_environment_versions_operations.py index f52e2620d0b2..cf7c53f88382 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_environment_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_environment_versions_operations.py @@ -34,7 +34,12 @@ from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -216,6 +221,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class RegistryEnvironmentVersionsOperations(object): """RegistryEnvironmentVersionsOperations operations. @@ -277,10 +283,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -321,7 +335,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersionResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -330,15 +347,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -356,10 +383,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ): # type: (...) -> None cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -373,22 +406,37 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, None, response_headers) @@ -429,11 +477,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -451,7 +507,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -463,7 +523,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore @@ -494,11 +556,19 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.EnvironmentVersion"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -512,17 +582,29 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("EnvironmentVersion", pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -541,12 +623,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.EnvironmentVersion" - cls = kwargs.pop("cls", None) # type: ClsType["_models.EnvironmentVersion"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "EnvironmentVersion") @@ -564,28 +656,43 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("EnvironmentVersion", pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if response.status_code == 201: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) ) response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) - deserialized = self._deserialize("EnvironmentVersion", pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -633,12 +740,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.EnvironmentVersion"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -655,13 +774,19 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("EnvironmentVersion", pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -673,6 +798,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_model_containers_operations.py index a834b186b8b1..f7985ca10554 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_model_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_model_containers_operations.py @@ -34,7 +34,12 @@ from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -202,6 +207,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class RegistryModelContainersOperations(object): """RegistryModelContainersOperations operations. @@ -254,10 +260,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -292,7 +306,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -301,15 +317,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -326,10 +352,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ): # type: (...) -> None cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -342,22 +374,37 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, None, response_headers) @@ -395,11 +442,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -416,7 +471,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -428,7 +487,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore @@ -456,11 +517,19 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -473,15 +542,25 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("ModelContainer", pipeline_response) @@ -501,12 +580,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.ModelContainer" - cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelContainer"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "ModelContainer") @@ -523,28 +612,43 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("ModelContainer", pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if response.status_code == 201: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) ) response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) - deserialized = self._deserialize("ModelContainer", pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -589,12 +693,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ModelContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelContainer"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -610,13 +726,19 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("ModelContainer", pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -628,6 +750,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_model_versions_operations.py index a56c00290bde..c8dd340e1b81 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_model_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_registry_model_versions_operations.py @@ -34,7 +34,12 @@ from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -228,6 +233,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class RegistryModelVersionsOperations(object): """RegistryModelVersionsOperations operations. @@ -303,10 +309,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -355,7 +369,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -364,15 +380,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -390,10 +416,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ): # type: (...) -> None cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -407,22 +439,37 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, None, response_headers) @@ -463,11 +510,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -485,7 +540,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -497,7 +556,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore @@ -529,10 +590,16 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -546,15 +613,25 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("ModelVersion", pipeline_response) @@ -576,11 +653,19 @@ def _create_or_update_initial( ): # type: (...) -> "_models.ModelVersion" cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "ModelVersion") @@ -598,22 +683,33 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: deserialized = self._deserialize("ModelVersion", pipeline_response) if response.status_code == 201: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) ) response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") @@ -666,12 +762,22 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ModelVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -694,7 +800,11 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -706,6 +816,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_schedules_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_schedules_operations.py index 1dc69f67c467..16342b7286f2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_schedules_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_schedules_operations.py @@ -34,7 +34,12 @@ from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -202,6 +207,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class SchedulesOperations(object): """SchedulesOperations operations. @@ -254,10 +260,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ScheduleResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.ScheduleResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ScheduleResourceArmPaginatedResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -292,7 +306,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ScheduleResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ScheduleResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -301,15 +317,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -326,10 +352,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ): # type: (...) -> None cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -342,22 +374,37 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) if cls: return cls(pipeline_response, None, response_headers) @@ -395,11 +442,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -416,7 +471,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -428,7 +487,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @@ -457,10 +518,16 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType["_models.Schedule"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -473,15 +540,25 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("Schedule", pipeline_response) @@ -502,11 +579,19 @@ def _create_or_update_initial( ): # type: (...) -> "_models.Schedule" cls = kwargs.pop("cls", None) # type: ClsType["_models.Schedule"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(body, "Schedule") @@ -523,22 +608,33 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: deserialized = self._deserialize("Schedule", pipeline_response) if response.status_code == 201: - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "duration", response.headers.get("x-ms-async-operation-timeout") + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) ) response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") @@ -587,12 +683,22 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Schedule] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType["_models.Schedule"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -614,7 +720,11 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -626,6 +736,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_usages_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_usages_operations.py index b0b04198e12a..8b3d4efb7780 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_usages_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_usages_operations.py @@ -32,7 +32,12 @@ from typing import Any, Callable, Dict, Iterable, Optional, TypeVar T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -72,6 +77,7 @@ def build_list_request( **kwargs ) + # fmt: on class UsagesOperations(object): """UsagesOperations operations. @@ -113,10 +119,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListUsagesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.ListUsagesResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListUsagesResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -145,7 +159,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ListUsagesResult", pipeline_response) + deserialized = self._deserialize( + "ListUsagesResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -154,15 +170,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_virtual_machine_sizes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_virtual_machine_sizes_operations.py index bf145df182ef..5fd274405013 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_virtual_machine_sizes_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_virtual_machine_sizes_operations.py @@ -31,7 +31,12 @@ from typing import Any, Callable, Dict, Optional, TypeVar T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -71,6 +76,7 @@ def build_list_request( **kwargs ) + # fmt: on class VirtualMachineSizesOperations(object): """VirtualMachineSizesOperations operations. @@ -110,11 +116,19 @@ def list( :rtype: ~azure.mgmt.machinelearningservices.models.VirtualMachineSizeListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.VirtualMachineSizeListResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.VirtualMachineSizeListResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_list_request( location=location, @@ -125,17 +139,29 @@ def list( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("VirtualMachineSizeListResult", pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "VirtualMachineSizeListResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_workspace_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_workspace_connections_operations.py index a05e78dbaf89..8b3a4a897ee3 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_workspace_connections_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_workspace_connections_operations.py @@ -32,7 +32,12 @@ from typing import Any, Callable, Dict, Iterable, Optional, TypeVar T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -200,6 +205,7 @@ def build_list_request( **kwargs ) + # fmt: on class WorkspaceConnectionsOperations(object): """WorkspaceConnectionsOperations operations. @@ -249,14 +255,26 @@ def create( :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, "WorkspaceConnectionPropertiesV2BasicResource") + _json = self._serialize.body( + parameters, "WorkspaceConnectionPropertiesV2BasicResource" + ) request = build_create_request( subscription_id=self._config.subscription_id, @@ -271,17 +289,29 @@ def create( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("WorkspaceConnectionPropertiesV2BasicResource", pipeline_response) + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -312,11 +342,19 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -329,17 +367,29 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("WorkspaceConnectionPropertiesV2BasicResource", pipeline_response) + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -371,10 +421,16 @@ def delete( # pylint: disable=inconsistent-return-statements :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request( subscription_id=self._config.subscription_id, @@ -387,15 +443,25 @@ def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -429,12 +495,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str cls = kwargs.pop( "cls", None ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -470,7 +542,8 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = self._deserialize( - "WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", pipeline_response + "WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", + pipeline_response, ) list_of_elem = deserialized.value if cls: @@ -480,15 +553,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_workspace_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_workspace_features_operations.py index e274c9cf39c0..dc1f2f9790b2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_workspace_features_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_workspace_features_operations.py @@ -32,7 +32,12 @@ from typing import Any, Callable, Dict, Iterable, Optional, TypeVar T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -74,6 +79,7 @@ def build_list_request( **kwargs ) + # fmt: on class WorkspaceFeaturesOperations(object): """WorkspaceFeaturesOperations operations. @@ -118,10 +124,18 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListAmlUserFeatureResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.ListAmlUserFeatureResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListAmlUserFeatureResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -152,7 +166,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ListAmlUserFeatureResult", pipeline_response) + deserialized = self._deserialize( + "ListAmlUserFeatureResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -161,15 +177,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_workspaces_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_workspaces_operations.py index 12598b54d570..971f3877e790 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_workspaces_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_02_01_preview/operations/_workspaces_operations.py @@ -34,7 +34,12 @@ from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -566,6 +571,7 @@ def build_list_outbound_network_dependencies_endpoints_request( **kwargs ) + # fmt: on class WorkspacesOperations(object): """WorkspacesOperations operations. @@ -609,10 +615,16 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_get_request( subscription_id=self._config.subscription_id, @@ -624,15 +636,25 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) deserialized = self._deserialize("Workspace", pipeline_response) @@ -651,12 +673,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.Workspace"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional["_models.Workspace"]] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.Workspace"]] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(parameters, "Workspace") @@ -672,14 +704,22 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: @@ -721,12 +761,22 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Workspace] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -759,7 +809,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @@ -771,10 +823,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ): # type: (...) -> None cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -786,14 +844,22 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -826,11 +892,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -858,7 +932,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @@ -870,12 +946,22 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.Workspace"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional["_models.Workspace"]] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.Workspace"]] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] _json = self._serialize.body(parameters, "WorkspaceUpdateParameters") @@ -891,14 +977,22 @@ def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: @@ -940,12 +1034,22 @@ def begin_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Workspace] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -978,7 +1082,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @@ -1002,10 +1108,18 @@ def list_by_resource_group( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.WorkspaceListResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceListResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -1036,7 +1150,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1045,15 +1161,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -1069,15 +1195,27 @@ def _diagnose_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.DiagnoseResponseResult"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if parameters is not None: - _json = self._serialize.body(parameters, "DiagnoseWorkspaceParameters") + _json = self._serialize.body( + parameters, "DiagnoseWorkspaceParameters" + ) else: _json = None @@ -1093,23 +1231,37 @@ def _diagnose_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("DiagnoseResponseResult", pipeline_response) + deserialized = self._deserialize( + "DiagnoseResponseResult", pipeline_response + ) if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) @@ -1151,12 +1303,24 @@ def begin_diagnose( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.DiagnoseResponseResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - content_type = kwargs.pop("content_type", "application/json") # type: Optional[str] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.DiagnoseResponseResult"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DiagnoseResponseResult"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._diagnose_initial( resource_group_name=resource_group_name, @@ -1171,13 +1335,19 @@ def begin_diagnose( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("DiagnoseResponseResult", pipeline_response) + deserialized = self._deserialize( + "DiagnoseResponseResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -1189,7 +1359,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_diagnose.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore @@ -1213,11 +1385,19 @@ def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListWorkspaceKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.ListWorkspaceKeysResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListWorkspaceKeysResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_list_keys_request( subscription_id=self._config.subscription_id, @@ -1229,17 +1409,29 @@ def list_keys( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("ListWorkspaceKeysResult", pipeline_response) + deserialized = self._deserialize( + "ListWorkspaceKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -1256,10 +1448,16 @@ def _resync_keys_initial( # pylint: disable=inconsistent-return-statements ): # type: (...) -> None cls = kwargs.pop("cls", None) # type: ClsType[None] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_resync_keys_request_initial( subscription_id=self._config.subscription_id, @@ -1271,14 +1469,22 @@ def _resync_keys_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) @@ -1312,11 +1518,19 @@ def begin_resync_keys( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] cls = kwargs.pop("cls", None) # type: ClsType[None] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._resync_keys_initial( resource_group_name=resource_group_name, @@ -1344,7 +1558,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_resync_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore @@ -1365,10 +1581,18 @@ def list_by_subscription( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - - cls = kwargs.pop("cls", None) # type: ClsType["_models.WorkspaceListResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceListResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) def prepare_request(next_link=None): @@ -1397,7 +1621,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1406,15 +1632,25 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response @@ -1441,11 +1677,19 @@ def list_notebook_access_token( :rtype: ~azure.mgmt.machinelearningservices.models.NotebookAccessTokenResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.NotebookAccessTokenResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.NotebookAccessTokenResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_list_notebook_access_token_request( subscription_id=self._config.subscription_id, @@ -1457,17 +1701,29 @@ def list_notebook_access_token( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("NotebookAccessTokenResult", pipeline_response) + deserialized = self._deserialize( + "NotebookAccessTokenResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -1483,11 +1739,19 @@ def _prepare_notebook_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.NotebookResourceInfo"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional["_models.NotebookResourceInfo"]] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.NotebookResourceInfo"]] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_prepare_notebook_request_initial( subscription_id=self._config.subscription_id, @@ -1499,18 +1763,28 @@ def _prepare_notebook_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize("NotebookResourceInfo", pipeline_response) + deserialized = self._deserialize( + "NotebookResourceInfo", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -1547,11 +1821,21 @@ def begin_prepare_notebook( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.NotebookResourceInfo] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - cls = kwargs.pop("cls", None) # type: ClsType["_models.NotebookResourceInfo"] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.NotebookResourceInfo"] + lro_delay = kwargs.pop( + "polling_interval", self._config.polling_interval + ) + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._prepare_notebook_initial( resource_group_name=resource_group_name, @@ -1564,13 +1848,19 @@ def begin_prepare_notebook( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize("NotebookResourceInfo", pipeline_response) + deserialized = self._deserialize( + "NotebookResourceInfo", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized if polling is True: - polling_method = ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) elif polling is False: polling_method = NoPolling() else: @@ -1582,7 +1872,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) begin_prepare_notebook.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore @@ -1605,11 +1897,19 @@ def list_storage_account_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListStorageAccountKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.ListStorageAccountKeysResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListStorageAccountKeysResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_list_storage_account_keys_request( subscription_id=self._config.subscription_id, @@ -1621,17 +1921,29 @@ def list_storage_account_keys( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("ListStorageAccountKeysResult", pipeline_response) + deserialized = self._deserialize( + "ListStorageAccountKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -1659,11 +1971,19 @@ def list_notebook_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.ListNotebookKeysResult"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListNotebookKeysResult"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_list_notebook_keys_request( subscription_id=self._config.subscription_id, @@ -1675,17 +1995,29 @@ def list_notebook_keys( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("ListNotebookKeysResult", pipeline_response) + deserialized = self._deserialize( + "ListNotebookKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) @@ -1717,33 +2049,55 @@ def list_outbound_network_dependencies_endpoints( :rtype: ~azure.mgmt.machinelearningservices.models.ExternalFQDNResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop("cls", None) # type: ClsType["_models.ExternalFQDNResponse"] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ExternalFQDNResponse"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + } error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop("api_version", "2023-02-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-02-01-preview" + ) # type: str request = build_list_outbound_network_dependencies_endpoints_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_outbound_network_dependencies_endpoints.metadata["url"], + template_url=self.list_outbound_network_dependencies_endpoints.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize("ExternalFQDNResponse", pipeline_response) + deserialized = self._deserialize( + "ExternalFQDNResponse", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/__init__.py index da46614477a9..71cf8fdc020d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/__init__.py @@ -10,9 +10,10 @@ from ._version import VERSION __version__ = VERSION -__all__ = ['AzureMachineLearningWorkspaces'] +__all__ = ["AzureMachineLearningWorkspaces"] # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk + patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/_azure_machine_learning_workspaces.py index 5741d940173c..e8867dba9fef 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/_azure_machine_learning_workspaces.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/_azure_machine_learning_workspaces.py @@ -15,7 +15,46 @@ from . import models from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import BatchDeploymentsOperations, BatchEndpointsOperations, CodeContainersOperations, CodeVersionsOperations, ComponentContainersOperations, ComponentVersionsOperations, ComputeOperations, DataContainersOperations, DataVersionsOperations, DatastoresOperations, EnvironmentContainersOperations, EnvironmentVersionsOperations, JobsOperations, ModelContainersOperations, ModelVersionsOperations, OnlineDeploymentsOperations, OnlineEndpointsOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, QuotasOperations, RegistriesOperations, RegistryCodeContainersOperations, RegistryCodeVersionsOperations, RegistryComponentContainersOperations, RegistryComponentVersionsOperations, RegistryDataContainersOperations, RegistryDataVersionsOperations, RegistryEnvironmentContainersOperations, RegistryEnvironmentVersionsOperations, RegistryModelContainersOperations, RegistryModelVersionsOperations, SchedulesOperations, UsagesOperations, VirtualMachineSizesOperations, WorkspaceConnectionsOperations, WorkspaceFeaturesOperations, WorkspacesOperations +from .operations import ( + BatchDeploymentsOperations, + BatchEndpointsOperations, + CodeContainersOperations, + CodeVersionsOperations, + ComponentContainersOperations, + ComponentVersionsOperations, + ComputeOperations, + DataContainersOperations, + DataVersionsOperations, + DatastoresOperations, + EnvironmentContainersOperations, + EnvironmentVersionsOperations, + JobsOperations, + ModelContainersOperations, + ModelVersionsOperations, + OnlineDeploymentsOperations, + OnlineEndpointsOperations, + Operations, + PrivateEndpointConnectionsOperations, + PrivateLinkResourcesOperations, + QuotasOperations, + RegistriesOperations, + RegistryCodeContainersOperations, + RegistryCodeVersionsOperations, + RegistryComponentContainersOperations, + RegistryComponentVersionsOperations, + RegistryDataContainersOperations, + RegistryDataVersionsOperations, + RegistryEnvironmentContainersOperations, + RegistryEnvironmentVersionsOperations, + RegistryModelContainersOperations, + RegistryModelVersionsOperations, + SchedulesOperations, + UsagesOperations, + VirtualMachineSizesOperations, + WorkspaceConnectionsOperations, + WorkspaceFeaturesOperations, + WorkspacesOperations, +) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -24,7 +63,10 @@ from azure.core.credentials import TokenCredential from azure.core.rest import HttpRequest, HttpResponse -class AzureMachineLearningWorkspaces(object): # pylint: disable=too-many-instance-attributes + +class AzureMachineLearningWorkspaces( + object +): # pylint: disable=too-many-instance-attributes """These APIs allow end users to operate on Azure Machine Learning Workspace resources. :ivar operations: Operations operations @@ -150,52 +192,141 @@ def __init__( **kwargs # type: Any ): # type: (...) -> None - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._config = AzureMachineLearningWorkspacesConfiguration( + credential=credential, subscription_id=subscription_id, **kwargs + ) + self._client = ARMPipelineClient( + base_url=base_url, config=self._config, **kwargs + ) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = { + k: v for k, v in models.__dict__.items() if isinstance(v, type) + } self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.workspaces = WorkspacesOperations(self._client, self._config, self._serialize, self._deserialize) - self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) - self.virtual_machine_sizes = VirtualMachineSizesOperations(self._client, self._config, self._serialize, self._deserialize) - self.quotas = QuotasOperations(self._client, self._config, self._serialize, self._deserialize) - self.compute = ComputeOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_connections = WorkspaceConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registries = RegistriesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_features = WorkspaceFeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_code_containers = RegistryCodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_code_versions = RegistryCodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_component_containers = RegistryComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_component_versions = RegistryComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_data_containers = RegistryDataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_data_versions = RegistryDataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_environment_containers = RegistryEnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_environment_versions = RegistryEnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_model_containers = RegistryModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_model_versions = RegistryModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_endpoints = BatchEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_deployments = BatchDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_containers = CodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_versions = CodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_containers = ComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_versions = ComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_containers = DataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_versions = DataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.datastores = DatastoresOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_containers = EnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_versions = EnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_containers = ModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_versions = ModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_endpoints = OnlineEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_deployments = OnlineDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.schedules = SchedulesOperations(self._client, self._config, self._serialize, self._deserialize) - + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspaces = WorkspacesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.usages = UsagesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.virtual_machine_sizes = VirtualMachineSizesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.quotas = QuotasOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.compute = ComputeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.private_endpoint_connections = ( + PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspace_connections = WorkspaceConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registries = RegistriesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspace_features = WorkspaceFeaturesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_code_containers = RegistryCodeContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_code_versions = RegistryCodeVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_component_containers = ( + RegistryComponentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.registry_component_versions = RegistryComponentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_data_containers = RegistryDataContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_data_versions = RegistryDataVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_environment_containers = ( + RegistryEnvironmentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.registry_environment_versions = ( + RegistryEnvironmentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.registry_model_containers = RegistryModelContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_model_versions = RegistryModelVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.batch_endpoints = BatchEndpointsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.batch_deployments = BatchDeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.code_containers = CodeContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.code_versions = CodeVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.component_containers = ComponentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.component_versions = ComponentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_containers = DataContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_versions = DataVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.datastores = DatastoresOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.environment_containers = EnvironmentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.environment_versions = EnvironmentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.jobs = JobsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.model_containers = ModelContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.model_versions = ModelVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.online_endpoints = OnlineEndpointsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.online_deployments = OnlineDeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.schedules = SchedulesOperations( + self._client, self._config, self._serialize, self._deserialize + ) def _send_request( self, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/_configuration.py index c128eb169938..41416a2ccc77 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/_configuration.py @@ -10,7 +10,10 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ( + ARMChallengeAuthenticationPolicy, + ARMHttpLoggingPolicy, +) from ._version import VERSION @@ -21,7 +24,9 @@ from azure.core.credentials import TokenCredential -class AzureMachineLearningWorkspacesConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AzureMachineLearningWorkspacesConfiguration( + Configuration +): # pylint: disable=too-many-instance-attributes """Configuration for AzureMachineLearningWorkspaces. Note that all parameters used to create this instance are saved as instance @@ -43,8 +48,10 @@ def __init__( **kwargs # type: Any ): # type: (...) -> None - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + super(AzureMachineLearningWorkspacesConfiguration, self).__init__( + **kwargs + ) + api_version = kwargs.pop("api_version", "2023-04-01") # type: str if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -54,23 +61,44 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = api_version - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) + self.credential_scopes = kwargs.pop( + "credential_scopes", ["https://management.azure.com/.default"] + ) + kwargs.setdefault( + "sdk_moniker", "mgmt-machinelearningservices/{}".format(VERSION) + ) self._configure(**kwargs) def _configure( - self, - **kwargs # type: Any + self, **kwargs # type: Any ): # type: (...) -> None - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') + self.user_agent_policy = kwargs.get( + "user_agent_policy" + ) or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get( + "headers_policy" + ) or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy( + **kwargs + ) + self.logging_policy = kwargs.get( + "logging_policy" + ) or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get( + "http_logging_policy" + ) or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy( + **kwargs + ) + self.custom_hook_policy = kwargs.get( + "custom_hook_policy" + ) or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get( + "redirect_policy" + ) or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = ARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/_patch.py index 74e48ecd07cf..17dbc073e01b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/_patch.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/_patch.py @@ -25,7 +25,8 @@ # # -------------------------------------------------------------------------- + # This file is used for handwritten extensions to the generated code. Example: # https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md def patch_sdk(): - pass \ No newline at end of file + pass diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/_vendor.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/_vendor.py index 138f663c53a4..ed3373e9699d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/_vendor.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/_vendor.py @@ -7,13 +7,20 @@ from azure.core.pipeline.transport import HttpRequest + def _convert_request(request, files=None): data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + request = HttpRequest( + method=request.method, + url=request.url, + headers=request.headers, + data=data, + ) if files: request.set_formdata_body(files) return request + def _format_url_section(template, **kwargs): components = template.split("/") while components: @@ -22,6 +29,8 @@ def _format_url_section(template, **kwargs): except KeyError as key: formatted_components = template.split("/") components = [ - c for c in formatted_components if "{}".format(key.args[0]) not in c + c + for c in formatted_components + if "{}".format(key.args[0]) not in c ] template = "/".join(components) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/__init__.py index f67ccda966f1..b90ec7485f14 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/__init__.py @@ -7,9 +7,11 @@ # -------------------------------------------------------------------------- from ._azure_machine_learning_workspaces import AzureMachineLearningWorkspaces -__all__ = ['AzureMachineLearningWorkspaces'] + +__all__ = ["AzureMachineLearningWorkspaces"] # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk + patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/_azure_machine_learning_workspaces.py index 51ff58607f49..07de58840c62 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/_azure_machine_learning_workspaces.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/_azure_machine_learning_workspaces.py @@ -16,13 +16,53 @@ from .. import models from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import BatchDeploymentsOperations, BatchEndpointsOperations, CodeContainersOperations, CodeVersionsOperations, ComponentContainersOperations, ComponentVersionsOperations, ComputeOperations, DataContainersOperations, DataVersionsOperations, DatastoresOperations, EnvironmentContainersOperations, EnvironmentVersionsOperations, JobsOperations, ModelContainersOperations, ModelVersionsOperations, OnlineDeploymentsOperations, OnlineEndpointsOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, QuotasOperations, RegistriesOperations, RegistryCodeContainersOperations, RegistryCodeVersionsOperations, RegistryComponentContainersOperations, RegistryComponentVersionsOperations, RegistryDataContainersOperations, RegistryDataVersionsOperations, RegistryEnvironmentContainersOperations, RegistryEnvironmentVersionsOperations, RegistryModelContainersOperations, RegistryModelVersionsOperations, SchedulesOperations, UsagesOperations, VirtualMachineSizesOperations, WorkspaceConnectionsOperations, WorkspaceFeaturesOperations, WorkspacesOperations +from .operations import ( + BatchDeploymentsOperations, + BatchEndpointsOperations, + CodeContainersOperations, + CodeVersionsOperations, + ComponentContainersOperations, + ComponentVersionsOperations, + ComputeOperations, + DataContainersOperations, + DataVersionsOperations, + DatastoresOperations, + EnvironmentContainersOperations, + EnvironmentVersionsOperations, + JobsOperations, + ModelContainersOperations, + ModelVersionsOperations, + OnlineDeploymentsOperations, + OnlineEndpointsOperations, + Operations, + PrivateEndpointConnectionsOperations, + PrivateLinkResourcesOperations, + QuotasOperations, + RegistriesOperations, + RegistryCodeContainersOperations, + RegistryCodeVersionsOperations, + RegistryComponentContainersOperations, + RegistryComponentVersionsOperations, + RegistryDataContainersOperations, + RegistryDataVersionsOperations, + RegistryEnvironmentContainersOperations, + RegistryEnvironmentVersionsOperations, + RegistryModelContainersOperations, + RegistryModelVersionsOperations, + SchedulesOperations, + UsagesOperations, + VirtualMachineSizesOperations, + WorkspaceConnectionsOperations, + WorkspaceFeaturesOperations, + WorkspacesOperations, +) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class AzureMachineLearningWorkspaces: # pylint: disable=too-many-instance-attributes + +class AzureMachineLearningWorkspaces: # pylint: disable=too-many-instance-attributes """These APIs allow end users to operate on Azure Machine Learning Workspace resources. :ivar operations: Operations operations @@ -150,57 +190,144 @@ def __init__( base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._config = AzureMachineLearningWorkspacesConfiguration( + credential=credential, subscription_id=subscription_id, **kwargs + ) + self._client = AsyncARMPipelineClient( + base_url=base_url, config=self._config, **kwargs + ) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = { + k: v for k, v in models.__dict__.items() if isinstance(v, type) + } self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.workspaces = WorkspacesOperations(self._client, self._config, self._serialize, self._deserialize) - self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) - self.virtual_machine_sizes = VirtualMachineSizesOperations(self._client, self._config, self._serialize, self._deserialize) - self.quotas = QuotasOperations(self._client, self._config, self._serialize, self._deserialize) - self.compute = ComputeOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_connections = WorkspaceConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registries = RegistriesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_features = WorkspaceFeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_code_containers = RegistryCodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_code_versions = RegistryCodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_component_containers = RegistryComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_component_versions = RegistryComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_data_containers = RegistryDataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_data_versions = RegistryDataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_environment_containers = RegistryEnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_environment_versions = RegistryEnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_model_containers = RegistryModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_model_versions = RegistryModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_endpoints = BatchEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_deployments = BatchDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_containers = CodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_versions = CodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_containers = ComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_versions = ComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_containers = DataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_versions = DataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.datastores = DatastoresOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_containers = EnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_versions = EnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_containers = ModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_versions = ModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_endpoints = OnlineEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_deployments = OnlineDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.schedules = SchedulesOperations(self._client, self._config, self._serialize, self._deserialize) - + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspaces = WorkspacesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.usages = UsagesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.virtual_machine_sizes = VirtualMachineSizesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.quotas = QuotasOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.compute = ComputeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.private_endpoint_connections = ( + PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspace_connections = WorkspaceConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registries = RegistriesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspace_features = WorkspaceFeaturesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_code_containers = RegistryCodeContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_code_versions = RegistryCodeVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_component_containers = ( + RegistryComponentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.registry_component_versions = RegistryComponentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_data_containers = RegistryDataContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_data_versions = RegistryDataVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_environment_containers = ( + RegistryEnvironmentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.registry_environment_versions = ( + RegistryEnvironmentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.registry_model_containers = RegistryModelContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_model_versions = RegistryModelVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.batch_endpoints = BatchEndpointsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.batch_deployments = BatchDeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.code_containers = CodeContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.code_versions = CodeVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.component_containers = ComponentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.component_versions = ComponentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_containers = DataContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_versions = DataVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.datastores = DatastoresOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.environment_containers = EnvironmentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.environment_versions = EnvironmentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.jobs = JobsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.model_containers = ModelContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.model_versions = ModelVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.online_endpoints = OnlineEndpointsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.online_deployments = OnlineDeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.schedules = SchedulesOperations( + self._client, self._config, self._serialize, self._deserialize + ) def _send_request( - self, - request: HttpRequest, - **kwargs: Any + self, request: HttpRequest, **kwargs: Any ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/_configuration.py index 1af1f642ebfa..df58ae536824 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/_configuration.py @@ -10,7 +10,10 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy +from azure.mgmt.core.policies import ( + ARMHttpLoggingPolicy, + AsyncARMChallengeAuthenticationPolicy, +) from .._version import VERSION @@ -19,7 +22,9 @@ from azure.core.credentials_async import AsyncTokenCredential -class AzureMachineLearningWorkspacesConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AzureMachineLearningWorkspacesConfiguration( + Configuration +): # pylint: disable=too-many-instance-attributes """Configuration for AzureMachineLearningWorkspaces. Note that all parameters used to create this instance are saved as instance @@ -40,8 +45,10 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + super(AzureMachineLearningWorkspacesConfiguration, self).__init__( + **kwargs + ) + api_version = kwargs.pop("api_version", "2023-04-01") # type: str if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -51,22 +58,41 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = api_version - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) + self.credential_scopes = kwargs.pop( + "credential_scopes", ["https://management.azure.com/.default"] + ) + kwargs.setdefault( + "sdk_moniker", "mgmt-machinelearningservices/{}".format(VERSION) + ) self._configure(**kwargs) - def _configure( - self, - **kwargs: Any - ) -> None: - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get( + "user_agent_policy" + ) or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get( + "headers_policy" + ) or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy( + **kwargs + ) + self.logging_policy = kwargs.get( + "logging_policy" + ) or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get( + "http_logging_policy" + ) or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get( + "retry_policy" + ) or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get( + "custom_hook_policy" + ) or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get( + "redirect_policy" + ) or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/_patch.py index 74e48ecd07cf..17dbc073e01b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/_patch.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/_patch.py @@ -25,7 +25,8 @@ # # -------------------------------------------------------------------------- + # This file is used for handwritten extensions to the generated code. Example: # https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md def patch_sdk(): - pass \ No newline at end of file + pass diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/__init__.py index 3e962fe91039..15d5f7dffd74 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/__init__.py @@ -12,21 +12,39 @@ from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations from ._quotas_operations import QuotasOperations from ._compute_operations import ComputeOperations -from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_endpoint_connections_operations import ( + PrivateEndpointConnectionsOperations, +) from ._private_link_resources_operations import PrivateLinkResourcesOperations from ._workspace_connections_operations import WorkspaceConnectionsOperations from ._registries_operations import RegistriesOperations from ._workspace_features_operations import WorkspaceFeaturesOperations -from ._registry_code_containers_operations import RegistryCodeContainersOperations +from ._registry_code_containers_operations import ( + RegistryCodeContainersOperations, +) from ._registry_code_versions_operations import RegistryCodeVersionsOperations -from ._registry_component_containers_operations import RegistryComponentContainersOperations -from ._registry_component_versions_operations import RegistryComponentVersionsOperations -from ._registry_data_containers_operations import RegistryDataContainersOperations +from ._registry_component_containers_operations import ( + RegistryComponentContainersOperations, +) +from ._registry_component_versions_operations import ( + RegistryComponentVersionsOperations, +) +from ._registry_data_containers_operations import ( + RegistryDataContainersOperations, +) from ._registry_data_versions_operations import RegistryDataVersionsOperations -from ._registry_environment_containers_operations import RegistryEnvironmentContainersOperations -from ._registry_environment_versions_operations import RegistryEnvironmentVersionsOperations -from ._registry_model_containers_operations import RegistryModelContainersOperations -from ._registry_model_versions_operations import RegistryModelVersionsOperations +from ._registry_environment_containers_operations import ( + RegistryEnvironmentContainersOperations, +) +from ._registry_environment_versions_operations import ( + RegistryEnvironmentVersionsOperations, +) +from ._registry_model_containers_operations import ( + RegistryModelContainersOperations, +) +from ._registry_model_versions_operations import ( + RegistryModelVersionsOperations, +) from ._batch_endpoints_operations import BatchEndpointsOperations from ._batch_deployments_operations import BatchDeploymentsOperations from ._code_containers_operations import CodeContainersOperations @@ -46,42 +64,42 @@ from ._schedules_operations import SchedulesOperations __all__ = [ - 'Operations', - 'WorkspacesOperations', - 'UsagesOperations', - 'VirtualMachineSizesOperations', - 'QuotasOperations', - 'ComputeOperations', - 'PrivateEndpointConnectionsOperations', - 'PrivateLinkResourcesOperations', - 'WorkspaceConnectionsOperations', - 'RegistriesOperations', - 'WorkspaceFeaturesOperations', - 'RegistryCodeContainersOperations', - 'RegistryCodeVersionsOperations', - 'RegistryComponentContainersOperations', - 'RegistryComponentVersionsOperations', - 'RegistryDataContainersOperations', - 'RegistryDataVersionsOperations', - 'RegistryEnvironmentContainersOperations', - 'RegistryEnvironmentVersionsOperations', - 'RegistryModelContainersOperations', - 'RegistryModelVersionsOperations', - 'BatchEndpointsOperations', - 'BatchDeploymentsOperations', - 'CodeContainersOperations', - 'CodeVersionsOperations', - 'ComponentContainersOperations', - 'ComponentVersionsOperations', - 'DataContainersOperations', - 'DataVersionsOperations', - 'DatastoresOperations', - 'EnvironmentContainersOperations', - 'EnvironmentVersionsOperations', - 'JobsOperations', - 'ModelContainersOperations', - 'ModelVersionsOperations', - 'OnlineEndpointsOperations', - 'OnlineDeploymentsOperations', - 'SchedulesOperations', + "Operations", + "WorkspacesOperations", + "UsagesOperations", + "VirtualMachineSizesOperations", + "QuotasOperations", + "ComputeOperations", + "PrivateEndpointConnectionsOperations", + "PrivateLinkResourcesOperations", + "WorkspaceConnectionsOperations", + "RegistriesOperations", + "WorkspaceFeaturesOperations", + "RegistryCodeContainersOperations", + "RegistryCodeVersionsOperations", + "RegistryComponentContainersOperations", + "RegistryComponentVersionsOperations", + "RegistryDataContainersOperations", + "RegistryDataVersionsOperations", + "RegistryEnvironmentContainersOperations", + "RegistryEnvironmentVersionsOperations", + "RegistryModelContainersOperations", + "RegistryModelVersionsOperations", + "BatchEndpointsOperations", + "BatchDeploymentsOperations", + "CodeContainersOperations", + "CodeVersionsOperations", + "ComponentContainersOperations", + "ComponentVersionsOperations", + "DataContainersOperations", + "DataVersionsOperations", + "DatastoresOperations", + "EnvironmentContainersOperations", + "EnvironmentVersionsOperations", + "JobsOperations", + "ModelContainersOperations", + "ModelVersionsOperations", + "OnlineEndpointsOperations", + "OnlineDeploymentsOperations", + "SchedulesOperations", ] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_batch_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_batch_deployments_operations.py index c108dff07fa1..033ca72b6d45 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_batch_deployments_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_batch_deployments_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,22 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._batch_deployments_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._batch_deployments_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class BatchDeploymentsOperations: """BatchDeploymentsOperations async operations. @@ -57,7 +80,9 @@ def list( top: Optional[int] = None, skip: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.BatchDeploymentTrackedResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.BatchDeploymentTrackedResourceArmPaginatedResult" + ]: """Lists Batch inference deployments in the workspace. Lists Batch inference deployments in the workspace. @@ -81,16 +106,21 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.BatchDeploymentTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -100,13 +130,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -124,7 +154,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("BatchDeploymentTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "BatchDeploymentTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -134,24 +167,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -161,15 +198,16 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements deployment_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -177,34 +215,45 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -239,14 +288,17 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -254,29 +306,37 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def get( @@ -304,15 +364,18 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.BatchDeployment :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -320,32 +383,37 @@ async def get( endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize("BatchDeployment", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore async def _update_initial( self, @@ -356,16 +424,25 @@ async def _update_initial( body: "_models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties", **kwargs: Any ) -> Optional["_models.BatchDeployment"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchDeployment"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.BatchDeployment"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties') + _json = self._serialize.body( + body, + "PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties", + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -376,40 +453,53 @@ async def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -450,15 +540,22 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -468,32 +565,38 @@ async def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore async def _create_or_update_initial( self, @@ -504,16 +607,22 @@ async def _create_or_update_initial( body: "_models.BatchDeployment", **kwargs: Any ) -> "_models.BatchDeployment": - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'BatchDeployment') + _json = self._serialize.body(body, "BatchDeployment") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -524,39 +633,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchDeployment', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -596,15 +719,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -614,29 +744,39 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_batch_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_batch_endpoints_operations.py index 0d501996d8c4..67e5f2b72fb2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_batch_endpoints_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_batch_endpoints_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,23 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._batch_endpoints_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_keys_request, build_list_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._batch_endpoints_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_keys_request, + build_list_request, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class BatchEndpointsOperations: """BatchEndpointsOperations async operations. @@ -55,7 +79,9 @@ def list( count: Optional[int] = None, skip: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.BatchEndpointTrackedResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.BatchEndpointTrackedResourceArmPaginatedResult" + ]: """Lists Batch inference endpoint in the workspace. Lists Batch inference endpoint in the workspace. @@ -75,16 +101,21 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.BatchEndpointTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -92,13 +123,13 @@ def prepare_request(next_link=None): api_version=api_version, count=count, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -114,7 +145,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("BatchEndpointTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "BatchEndpointTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -124,24 +158,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -150,49 +188,61 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements endpoint_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -224,43 +274,54 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def get( @@ -285,47 +346,53 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.BatchEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize("BatchEndpoint", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore async def _update_initial( self, @@ -335,16 +402,24 @@ async def _update_initial( body: "_models.PartialMinimalTrackedResourceWithIdentity", **kwargs: Any ) -> Optional["_models.BatchEndpoint"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchEndpoint"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.BatchEndpoint"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') + _json = self._serialize.body( + body, "PartialMinimalTrackedResourceWithIdentity" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -354,40 +429,53 @@ async def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -425,15 +513,20 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -442,32 +535,38 @@ async def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore async def _create_or_update_initial( self, @@ -477,16 +576,20 @@ async def _create_or_update_initial( body: "_models.BatchEndpoint", **kwargs: Any ) -> "_models.BatchEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'BatchEndpoint') + _json = self._serialize.body(body, "BatchEndpoint") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -496,39 +599,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -565,15 +682,20 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -582,32 +704,42 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def list_keys( @@ -632,44 +764,52 @@ async def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthKeys"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) + deserialized = self._deserialize("EndpointAuthKeys", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys"} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_code_containers_operations.py index ed43a288a208..dc4ca308e3e0 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_code_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_code_containers_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._code_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._code_containers_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class CodeContainersOperations: """CodeContainersOperations async operations. @@ -70,29 +88,34 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -107,7 +130,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -117,24 +142,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -159,43 +188,49 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore @distributed_trace_async async def get( @@ -220,47 +255,53 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize("CodeContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -288,16 +329,20 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeContainer') + _json = self._serialize.body(body, "CodeContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -307,33 +352,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_code_versions_operations.py index 083e6487cf60..dd83ff5a71cf 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_code_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_code_versions_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,22 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._code_versions_operations import build_create_or_get_start_pending_upload_request, build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._code_versions_operations import ( + build_create_or_get_start_pending_upload_request, + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class CodeVersionsOperations: """CodeVersionsOperations async operations. @@ -86,16 +105,21 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -107,13 +131,13 @@ def prepare_request(next_link=None): skip=skip, hash=hash, hash_version=hash_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -133,7 +157,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -143,24 +169,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -188,15 +218,16 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -204,28 +235,33 @@ async def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -253,15 +289,16 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -269,32 +306,37 @@ async def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -325,16 +367,20 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeVersion') + _json = self._serialize.body(body, "CodeVersion") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -345,36 +391,41 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_get_start_pending_upload( @@ -405,16 +456,22 @@ async def create_or_get_start_pending_upload( :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PendingUploadResponseDto"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PendingUploadRequestDto') + _json = self._serialize.body(body, "PendingUploadRequestDto") request = build_create_or_get_start_pending_upload_request( subscription_id=self._config.subscription_id, @@ -425,29 +482,38 @@ async def create_or_get_start_pending_upload( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], + template_url=self.create_or_get_start_pending_upload.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) + deserialized = self._deserialize( + "PendingUploadResponseDto", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/startPendingUpload"} # type: ignore - + create_or_get_start_pending_upload.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/startPendingUpload"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_component_containers_operations.py index f0da517b1558..f8542d3daef7 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_component_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_component_containers_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._component_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._component_containers_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ComponentContainersOperations: """ComponentContainersOperations async operations. @@ -73,16 +91,21 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -90,13 +113,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -112,7 +135,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -122,24 +148,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -164,43 +194,49 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore @distributed_trace_async async def get( @@ -225,47 +261,57 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -293,16 +339,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentContainer') + _json = self._serialize.body(body, "ComponentContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -312,33 +364,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_component_versions_operations.py index 27f6c663bb25..ac004e788f4d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_component_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_component_versions_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._component_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._component_versions_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ComponentVersionsOperations: """ComponentVersionsOperations async operations. @@ -82,16 +100,21 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -102,13 +125,13 @@ def prepare_request(next_link=None): top=top, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -127,7 +150,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -137,24 +162,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -182,15 +211,16 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -198,28 +228,33 @@ async def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -247,15 +282,18 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -263,32 +301,37 @@ async def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize("ComponentVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -319,16 +362,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentVersion') + _json = self._serialize.body(body, "ComponentVersion") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -339,33 +388,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_compute_operations.py index 4e37792407a3..7885b0ddd7a2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_compute_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_compute_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,27 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._compute_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_keys_request, build_list_nodes_request, build_list_request, build_restart_request_initial, build_start_request_initial, build_stop_request_initial, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._compute_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_keys_request, + build_list_nodes_request, + build_list_request, + build_restart_request_initial, + build_start_request_initial, + build_stop_request_initial, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ComputeOperations: """ComputeOperations async operations. @@ -70,29 +98,34 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedComputeResourcesList] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedComputeResourcesList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedComputeResourcesList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -107,7 +140,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedComputeResourcesList", pipeline_response) + deserialized = self._deserialize( + "PaginatedComputeResourcesList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -117,24 +152,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes"} # type: ignore @distributed_trace_async async def get( @@ -158,47 +197,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComputeResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize("ComputeResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore async def _create_or_update_initial( self, @@ -208,16 +255,22 @@ async def _create_or_update_initial( parameters: "_models.ComputeResource", **kwargs: Any ) -> "_models.ComputeResource": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'ComputeResource') + _json = self._serialize.body(parameters, "ComputeResource") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -227,38 +280,47 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if response.status_code == 201: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComputeResource', pipeline_response) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -295,15 +357,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -312,32 +381,38 @@ async def begin_create_or_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore async def _update_initial( self, @@ -347,16 +422,22 @@ async def _update_initial( parameters: "_models.ClusterUpdateParameters", **kwargs: Any ) -> "_models.ComputeResource": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'ClusterUpdateParameters') + _json = self._serialize.body(parameters, "ClusterUpdateParameters") request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -366,31 +447,34 @@ async def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize("ComputeResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -426,15 +510,22 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -443,50 +534,59 @@ async def begin_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, compute_name: str, - underlying_resource_action: Union[str, "_models.UnderlyingResourceAction"], + underlying_resource_action: Union[ + str, "_models.UnderlyingResourceAction" + ], **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -494,33 +594,39 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements compute_name=compute_name, api_version=api_version, underlying_resource_action=underlying_resource_action, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -528,7 +634,9 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements resource_group_name: str, workspace_name: str, compute_name: str, - underlying_resource_action: Union[str, "_models.UnderlyingResourceAction"], + underlying_resource_action: Union[ + str, "_models.UnderlyingResourceAction" + ], **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes specified Machine Learning compute. @@ -555,14 +663,17 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -570,29 +681,33 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements compute_name=compute_name, underlying_resource_action=underlying_resource_action, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace def list_nodes( @@ -617,29 +732,34 @@ def list_nodes( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.AmlComputeNodesInformation] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlComputeNodesInformation"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.AmlComputeNodesInformation"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_nodes_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self.list_nodes.metadata['url'], + template_url=self.list_nodes.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_nodes_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -654,7 +774,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("AmlComputeNodesInformation", pipeline_response) + deserialized = self._deserialize( + "AmlComputeNodesInformation", pipeline_response + ) list_of_elem = deserialized.nodes if cls: list_of_elem = cls(list_of_elem) @@ -664,24 +786,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_nodes.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes"} # type: ignore + list_nodes.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes"} # type: ignore @distributed_trace_async async def list_keys( @@ -704,47 +830,55 @@ async def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ComputeSecrets :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeSecrets"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeSecrets"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComputeSecrets', pipeline_response) + deserialized = self._deserialize("ComputeSecrets", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys"} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys"} # type: ignore async def _start_initial( # pylint: disable=inconsistent-return-statements self, @@ -753,42 +887,46 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements compute_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_start_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self._start_initial.metadata['url'], + template_url=self._start_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _start_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore - + _start_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore @distributed_trace_async async def begin_start( # pylint: disable=inconsistent-return-statements @@ -818,43 +956,50 @@ async def begin_start( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._start_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_start.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore + begin_start.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore async def _stop_initial( # pylint: disable=inconsistent-return-statements self, @@ -863,42 +1008,46 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements compute_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_stop_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self._stop_initial.metadata['url'], + template_url=self._stop_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _stop_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore - + _stop_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore @distributed_trace_async async def begin_stop( # pylint: disable=inconsistent-return-statements @@ -928,43 +1077,50 @@ async def begin_stop( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._stop_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_stop.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore + begin_stop.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore async def _restart_initial( # pylint: disable=inconsistent-return-statements self, @@ -973,42 +1129,46 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements compute_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_restart_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self._restart_initial.metadata['url'], + template_url=self._restart_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _restart_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore - + _restart_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore @distributed_trace_async async def begin_restart( # pylint: disable=inconsistent-return-statements @@ -1038,40 +1198,47 @@ async def begin_restart( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._restart_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_restart.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore + begin_restart.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_data_containers_operations.py index 6e5e29f4f4c1..f4119b622194 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_data_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_data_containers_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._data_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._data_containers_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class DataContainersOperations: """DataContainersOperations async operations. @@ -73,16 +91,21 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -90,13 +113,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -112,7 +135,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -122,24 +147,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -164,43 +193,49 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore @distributed_trace_async async def get( @@ -225,47 +260,53 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize("DataContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -293,16 +334,20 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DataContainer') + _json = self._serialize.body(body, "DataContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -312,33 +357,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_data_versions_operations.py index 5894ce7f4ba1..64888729eb95 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_data_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_data_versions_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._data_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._data_versions_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class DataVersionsOperations: """DataVersionsOperations async operations. @@ -89,16 +107,21 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -110,13 +133,13 @@ def prepare_request(next_link=None): skip=skip, tags=tags, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -136,7 +159,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataVersionBaseResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -146,24 +171,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -191,15 +220,16 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -207,28 +237,33 @@ async def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -256,15 +291,18 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -272,32 +310,37 @@ async def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize("DataVersionBase", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -328,16 +371,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DataVersionBase') + _json = self._serialize.body(body, "DataVersionBase") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -348,33 +397,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_datastores_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_datastores_operations.py index 0e948f1b44ae..b7b2c64314a2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_datastores_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_datastores_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, List, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,22 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._datastores_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request, build_list_secrets_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._datastores_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, + build_list_secrets_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class DatastoresOperations: """DatastoresOperations async operations. @@ -88,16 +107,21 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DatastoreResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -110,13 +134,13 @@ def prepare_request(next_link=None): search_text=search_text, order_by=order_by, order_by_asc=order_by_asc, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -137,7 +161,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("DatastoreResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DatastoreResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -147,24 +173,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -189,43 +219,49 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace_async async def get( @@ -250,47 +286,53 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.Datastore :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Datastore"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Datastore"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Datastore', pipeline_response) + deserialized = self._deserialize("Datastore", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -321,16 +363,20 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.Datastore :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Datastore"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Datastore"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'Datastore') + _json = self._serialize.body(body, "Datastore") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -341,36 +387,41 @@ async def create_or_update( content_type=content_type, json=_json, skip_validation=skip_validation, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('Datastore', pipeline_response) + deserialized = self._deserialize("Datastore", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('Datastore', pipeline_response) + deserialized = self._deserialize("Datastore", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace_async async def list_secrets( @@ -395,44 +446,52 @@ async def list_secrets( :rtype: ~azure.mgmt.machinelearningservices.models.DatastoreSecrets :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreSecrets"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DatastoreSecrets"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_list_secrets_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.list_secrets.metadata['url'], + template_url=self.list_secrets.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DatastoreSecrets', pipeline_response) + deserialized = self._deserialize("DatastoreSecrets", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_secrets.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets"} # type: ignore - + list_secrets.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_environment_containers_operations.py index 01e25b2450f2..e36ace569dba 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_environment_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_environment_containers_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._environment_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._environment_containers_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class EnvironmentContainersOperations: """EnvironmentContainersOperations async operations. @@ -53,7 +71,9 @@ def list( skip: Optional[str] = None, list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, **kwargs: Any - ) -> AsyncIterable["_models.EnvironmentContainerResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.EnvironmentContainerResourceArmPaginatedResult" + ]: """List environment containers. List environment containers. @@ -73,16 +93,21 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -90,13 +115,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -112,7 +137,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -122,24 +150,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -164,43 +196,49 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore @distributed_trace_async async def get( @@ -225,47 +263,57 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -293,16 +341,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentContainer') + _json = self._serialize.body(body, "EnvironmentContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -312,33 +366,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_environment_versions_operations.py index d9ffe8415095..9841ae1b24b5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_environment_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_environment_versions_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._environment_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._environment_versions_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class EnvironmentVersionsOperations: """EnvironmentVersionsOperations async operations. @@ -82,16 +100,21 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -102,13 +125,13 @@ def prepare_request(next_link=None): top=top, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -127,7 +150,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersionResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -137,24 +163,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -182,15 +212,16 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -198,28 +229,33 @@ async def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -247,15 +283,18 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -263,32 +302,39 @@ async def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -319,16 +365,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentVersion') + _json = self._serialize.body(body, "EnvironmentVersion") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -339,33 +391,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_jobs_operations.py index f5dce12942a0..5eab46f4151c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_jobs_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_jobs_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,22 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._jobs_operations import build_cancel_request_initial, build_create_or_update_request, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._jobs_operations import ( + build_cancel_request_initial, + build_create_or_update_request, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class JobsOperations: """JobsOperations async operations. @@ -81,16 +104,21 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.JobBaseResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -100,13 +128,13 @@ def prepare_request(next_link=None): job_type=job_type, tag=tag, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -124,7 +152,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("JobBaseResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "JobBaseResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -134,24 +164,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -160,49 +194,61 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements id: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -234,43 +280,54 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace_async async def get( @@ -295,47 +352,53 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.JobBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.JobBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('JobBase', pipeline_response) + deserialized = self._deserialize("JobBase", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -363,16 +426,20 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.JobBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.JobBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'JobBase') + _json = self._serialize.body(body, "JobBase") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -382,36 +449,41 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('JobBase', pipeline_response) + deserialized = self._deserialize("JobBase", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('JobBase', pipeline_response) + deserialized = self._deserialize("JobBase", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore async def _cancel_initial( # pylint: disable=inconsistent-return-statements self, @@ -420,48 +492,55 @@ async def _cancel_initial( # pylint: disable=inconsistent-return-statements id: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_cancel_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self._cancel_initial.metadata['url'], + template_url=self._cancel_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _cancel_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore - + _cancel_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore @distributed_trace_async async def begin_cancel( # pylint: disable=inconsistent-return-statements @@ -493,40 +572,51 @@ async def begin_cancel( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._cancel_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_cancel.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore + begin_cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_model_containers_operations.py index e49a2c10bcf8..e0ccc0594ac9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_model_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_model_containers_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._model_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._model_containers_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ModelContainersOperations: """ModelContainersOperations async operations. @@ -76,16 +94,21 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -94,13 +117,13 @@ def prepare_request(next_link=None): skip=skip, count=count, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -117,7 +140,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -127,24 +152,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -169,43 +198,49 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore @distributed_trace_async async def get( @@ -230,47 +265,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize("ModelContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -298,16 +341,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelContainer') + _json = self._serialize.body(body, "ModelContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -317,33 +366,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_model_versions_operations.py index fe77fa7a8fbf..c84f9984ea72 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_model_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_model_versions_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._model_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._model_versions_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ModelVersionsOperations: """ModelVersionsOperations async operations. @@ -102,16 +120,21 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -128,13 +151,13 @@ def prepare_request(next_link=None): properties=properties, feed=feed, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -159,7 +182,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -169,24 +194,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -214,15 +243,16 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -230,28 +260,33 @@ async def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -279,15 +314,16 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -295,32 +331,37 @@ async def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -351,16 +392,20 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelVersion') + _json = self._serialize.body(body, "ModelVersion") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -371,33 +416,38 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_online_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_online_deployments_operations.py index 7b00484305f5..ed1d4485fce0 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_online_deployments_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_online_deployments_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,24 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._online_deployments_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_logs_request, build_get_request, build_list_request, build_list_skus_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._online_deployments_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_logs_request, + build_get_request, + build_list_request, + build_list_skus_request, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class OnlineDeploymentsOperations: """OnlineDeploymentsOperations async operations. @@ -57,7 +82,9 @@ def list( top: Optional[int] = None, skip: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.OnlineDeploymentTrackedResourceArmPaginatedResult" + ]: """List Inference Endpoint Deployments. List Inference Endpoint Deployments. @@ -81,16 +108,21 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OnlineDeploymentTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -100,13 +132,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -124,7 +156,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineDeploymentTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "OnlineDeploymentTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -134,24 +169,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -161,15 +200,16 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements deployment_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -177,34 +217,45 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -239,14 +290,17 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -254,29 +308,37 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def get( @@ -304,15 +366,18 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.OnlineDeployment :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -320,32 +385,37 @@ async def get( endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize("OnlineDeployment", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore async def _update_initial( self, @@ -356,16 +426,24 @@ async def _update_initial( body: "_models.PartialMinimalTrackedResourceWithSku", **kwargs: Any ) -> Optional["_models.OnlineDeployment"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineDeployment"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.OnlineDeployment"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSku') + _json = self._serialize.body( + body, "PartialMinimalTrackedResourceWithSku" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -376,40 +454,53 @@ async def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -449,15 +540,22 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -467,32 +565,38 @@ async def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore async def _create_or_update_initial( self, @@ -503,16 +607,22 @@ async def _create_or_update_initial( body: "_models.OnlineDeployment", **kwargs: Any ) -> "_models.OnlineDeployment": - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'OnlineDeployment') + _json = self._serialize.body(body, "OnlineDeployment") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -523,39 +633,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -595,15 +719,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -613,32 +744,42 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def get_logs( @@ -669,16 +810,22 @@ async def get_logs( :rtype: ~azure.mgmt.machinelearningservices.models.DeploymentLogs :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentLogs"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DeploymentLogs"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DeploymentLogsRequest') + _json = self._serialize.body(body, "DeploymentLogsRequest") request = build_get_logs_request( subscription_id=self._config.subscription_id, @@ -689,32 +836,37 @@ async def get_logs( api_version=api_version, content_type=content_type, json=_json, - template_url=self.get_logs.metadata['url'], + template_url=self.get_logs.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DeploymentLogs', pipeline_response) + deserialized = self._deserialize("DeploymentLogs", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_logs.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs"} # type: ignore - + get_logs.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs"} # type: ignore @distributed_trace def list_skus( @@ -750,16 +902,21 @@ def list_skus( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.SkuResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.SkuResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_skus_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -769,13 +926,13 @@ def prepare_request(next_link=None): api_version=api_version, count=count, skip=skip, - template_url=self.list_skus.metadata['url'], + template_url=self.list_skus.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_skus_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -793,7 +950,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("SkuResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "SkuResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -803,21 +962,25 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_skus.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus"} # type: ignore + list_skus.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_online_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_online_endpoints_operations.py index b5b91f2c2cf3..3ce0f6db1c89 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_online_endpoints_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_online_endpoints_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,25 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._online_endpoints_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_get_token_request, build_list_keys_request, build_list_request, build_regenerate_keys_request_initial, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._online_endpoints_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_get_token_request, + build_list_keys_request, + build_list_request, + build_regenerate_keys_request_initial, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class OnlineEndpointsOperations: """OnlineEndpointsOperations async operations. @@ -54,13 +80,17 @@ def list( workspace_name: str, name: Optional[str] = None, count: Optional[int] = None, - compute_type: Optional[Union[str, "_models.EndpointComputeType"]] = None, + compute_type: Optional[ + Union[str, "_models.EndpointComputeType"] + ] = None, skip: Optional[str] = None, tags: Optional[str] = None, properties: Optional[str] = None, order_by: Optional[Union[str, "_models.OrderString"]] = None, **kwargs: Any - ) -> AsyncIterable["_models.OnlineEndpointTrackedResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.OnlineEndpointTrackedResourceArmPaginatedResult" + ]: """List Online Endpoints. List Online Endpoints. @@ -93,16 +123,21 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OnlineEndpointTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -115,13 +150,13 @@ def prepare_request(next_link=None): tags=tags, properties=properties, order_by=order_by, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -142,7 +177,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineEndpointTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "OnlineEndpointTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -152,24 +190,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -178,49 +220,61 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements endpoint_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -252,43 +306,54 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def get( @@ -313,47 +378,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.OnlineEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize("OnlineEndpoint", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore async def _update_initial( self, @@ -363,16 +436,24 @@ async def _update_initial( body: "_models.PartialMinimalTrackedResourceWithIdentity", **kwargs: Any ) -> Optional["_models.OnlineEndpoint"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineEndpoint"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.OnlineEndpoint"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') + _json = self._serialize.body( + body, "PartialMinimalTrackedResourceWithIdentity" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -382,40 +463,53 @@ async def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -453,15 +547,22 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -470,32 +571,38 @@ async def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore async def _create_or_update_initial( self, @@ -505,16 +612,22 @@ async def _create_or_update_initial( body: "_models.OnlineEndpoint", **kwargs: Any ) -> "_models.OnlineEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'OnlineEndpoint') + _json = self._serialize.body(body, "OnlineEndpoint") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -524,39 +637,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -593,15 +720,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -610,32 +744,42 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def list_keys( @@ -660,47 +804,55 @@ async def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthKeys"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) + deserialized = self._deserialize("EndpointAuthKeys", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys"} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys"} # type: ignore async def _regenerate_keys_initial( # pylint: disable=inconsistent-return-statements self, @@ -710,16 +862,20 @@ async def _regenerate_keys_initial( # pylint: disable=inconsistent-return-state body: "_models.RegenerateEndpointKeysRequest", **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'RegenerateEndpointKeysRequest') + _json = self._serialize.body(body, "RegenerateEndpointKeysRequest") request = build_regenerate_keys_request_initial( subscription_id=self._config.subscription_id, @@ -729,33 +885,39 @@ async def _regenerate_keys_initial( # pylint: disable=inconsistent-return-state api_version=api_version, content_type=content_type, json=_json, - template_url=self._regenerate_keys_initial.metadata['url'], + template_url=self._regenerate_keys_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _regenerate_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore - + _regenerate_keys_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore @distributed_trace_async async def begin_regenerate_keys( # pylint: disable=inconsistent-return-statements @@ -790,15 +952,20 @@ async def begin_regenerate_keys( # pylint: disable=inconsistent-return-statemen :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._regenerate_keys_initial( resource_group_name=resource_group_name, @@ -807,29 +974,37 @@ async def begin_regenerate_keys( # pylint: disable=inconsistent-return-statemen body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_regenerate_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore + begin_regenerate_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore @distributed_trace_async async def get_token( @@ -854,44 +1029,54 @@ async def get_token( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthToken :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthToken"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthToken"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_token_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.get_token.metadata['url'], + template_url=self.get_token.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EndpointAuthToken', pipeline_response) + deserialized = self._deserialize( + "EndpointAuthToken", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token"} # type: ignore - + get_token.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_operations.py index 336f3b5eaf1c..bdaeed2a9177 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,8 +25,15 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class Operations: """Operations async operations. @@ -46,8 +59,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list( - self, - **kwargs: Any + self, **kwargs: Any ) -> AsyncIterable["_models.AmlOperationListResult"]: """Lists all of the available Azure Machine Learning Workspaces REST API operations. @@ -58,25 +70,30 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.AmlOperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlOperationListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.AmlOperationListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( api_version=api_version, template_url=next_link, @@ -87,7 +104,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("AmlOperationListResult", pipeline_response) + deserialized = self._deserialize( + "AmlOperationListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -97,21 +116,25 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/providers/Microsoft.MachineLearningServices/operations"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.MachineLearningServices/operations"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_private_endpoint_connections_operations.py index fff73568292e..4ca6d690c8fc 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_private_endpoint_connections_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._private_endpoint_connections_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._private_endpoint_connections_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class PrivateEndpointConnectionsOperations: """PrivateEndpointConnectionsOperations async operations. @@ -47,10 +65,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> AsyncIterable["_models.PrivateEndpointConnectionListResult"]: """List all the private endpoint connections associated with the workspace. @@ -65,28 +80,33 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnectionListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( resource_group_name=resource_group_name, workspace_name=workspace_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( resource_group_name=resource_group_name, workspace_name=workspace_name, @@ -100,7 +120,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) + deserialized = self._deserialize( + "PrivateEndpointConnectionListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -110,24 +132,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections"} # type: ignore @distributed_trace_async async def get( @@ -151,47 +177,57 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, private_endpoint_connection_name=private_endpoint_connection_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + deserialized = self._deserialize( + "PrivateEndpointConnection", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -218,16 +254,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(properties, 'PrivateEndpointConnection') + _json = self._serialize.body(properties, "PrivateEndpointConnection") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -237,32 +279,39 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + deserialized = self._deserialize( + "PrivateEndpointConnection", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -286,40 +335,46 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, private_endpoint_connection_name=private_endpoint_connection_name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_private_link_resources_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_private_link_resources_operations.py index 332f1510ce8a..a76f602ea0e4 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_private_link_resources_operations.py @@ -8,7 +8,13 @@ # -------------------------------------------------------------------------- from typing import Any, Callable, Dict, Optional, TypeVar -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -18,8 +24,15 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class PrivateLinkResourcesOperations: """PrivateLinkResourcesOperations async operations. @@ -45,10 +58,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace_async async def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.PrivateLinkResourceListResult": """Gets the private link resources that need to be created for a workspace. @@ -61,43 +71,53 @@ async def list( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateLinkResourceListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateLinkResourceListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateLinkResourceListResult', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "PrivateLinkResourceListResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources"} # type: ignore - + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_quotas_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_quotas_operations.py index 152481b48c60..13c71f1d4519 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_quotas_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_quotas_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,19 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._quotas_operations import build_list_request, build_update_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._quotas_operations import ( + build_list_request, + build_update_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class QuotasOperations: """QuotasOperations async operations. @@ -63,16 +79,22 @@ async def update( :rtype: ~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotasResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'QuotaUpdateParameters') + _json = self._serialize.body(parameters, "QuotaUpdateParameters") request = build_update_request( location=location, @@ -80,38 +102,43 @@ async def update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.update.metadata['url'], + template_url=self.update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('UpdateWorkspaceQuotasResult', pipeline_response) + deserialized = self._deserialize( + "UpdateWorkspaceQuotasResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas"} # type: ignore - + update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas"} # type: ignore @distributed_trace def list( - self, - location: str, - **kwargs: Any + self, location: str, **kwargs: Any ) -> AsyncIterable["_models.ListWorkspaceQuotas"]: """Gets the currently assigned Workspace Quotas based on VMFamily. @@ -123,27 +150,32 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListWorkspaceQuotas] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceQuotas"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListWorkspaceQuotas"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, @@ -156,7 +188,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ListWorkspaceQuotas", pipeline_response) + deserialized = self._deserialize( + "ListWorkspaceQuotas", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -166,21 +200,25 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_registries_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_registries_operations.py index 8b60d7170df9..6bb70cee767e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_registries_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_registries_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,24 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registries_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_subscription_request, build_list_request, build_remove_regions_request_initial, build_update_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registries_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_by_subscription_request, + build_list_request, + build_remove_regions_request_initial, + build_update_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistriesOperations: """RegistriesOperations async operations. @@ -49,8 +74,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list_by_subscription( - self, - **kwargs: Any + self, **kwargs: Any ) -> AsyncIterable["_models.RegistryTrackedResourceArmPaginatedResult"]: """List registries by subscription. @@ -63,26 +87,31 @@ def list_by_subscription( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.RegistryTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_subscription.metadata['url'], + template_url=self.list_by_subscription.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, @@ -94,7 +123,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("RegistryTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "RegistryTrackedResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -104,30 +135,32 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore + list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore @distributed_trace def list( - self, - resource_group_name: str, - **kwargs: Any + self, resource_group_name: str, **kwargs: Any ) -> AsyncIterable["_models.RegistryTrackedResourceArmPaginatedResult"]: """List registries. @@ -142,27 +175,32 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.RegistryTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -175,7 +213,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("RegistryTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "RegistryTrackedResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -185,80 +225,90 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - **kwargs: Any + self, resource_group_name: str, registry_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - **kwargs: Any + self, resource_group_name: str, registry_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: """Delete registry. @@ -280,49 +330,57 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace_async async def get( - self, - resource_group_name: str, - registry_name: str, - **kwargs: Any + self, resource_group_name: str, registry_name: str, **kwargs: Any ) -> "_models.Registry": """Get registry. @@ -337,46 +395,52 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.Registry :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace_async async def update( @@ -401,16 +465,22 @@ async def update( :rtype: ~azure.mgmt.machinelearningservices.models.Registry :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialRegistryPartialTrackedResource') + _json = self._serialize.body( + body, "PartialRegistryPartialTrackedResource" + ) request = build_update_request( subscription_id=self._config.subscription_id, @@ -419,32 +489,37 @@ async def update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.update.metadata['url'], + template_url=self.update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - + update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore async def _create_or_update_initial( self, @@ -453,16 +528,20 @@ async def _create_or_update_initial( body: "_models.Registry", **kwargs: Any ) -> "_models.Registry": - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'Registry') + _json = self._serialize.body(body, "Registry") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -471,35 +550,38 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -532,15 +614,20 @@ async def begin_create_or_update( :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Registry] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -548,32 +635,40 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore async def _remove_regions_initial( self, @@ -582,16 +677,22 @@ async def _remove_regions_initial( body: "_models.Registry", **kwargs: Any ) -> Optional["_models.Registry"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Registry"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.Registry"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'Registry') + _json = self._serialize.body(body, "Registry") request = build_remove_regions_request_initial( subscription_id=self._config.subscription_id, @@ -600,40 +701,51 @@ async def _remove_regions_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._remove_regions_initial.metadata['url'], + template_url=self._remove_regions_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _remove_regions_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions"} # type: ignore - + _remove_regions_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions"} # type: ignore @distributed_trace_async async def begin_remove_regions( @@ -666,15 +778,20 @@ async def begin_remove_regions( :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Registry] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._remove_regions_initial( resource_group_name=resource_group_name, @@ -682,29 +799,37 @@ async def begin_remove_regions( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_remove_regions.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions"} # type: ignore + begin_remove_regions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_registry_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_registry_code_containers_operations.py index 88f9d6b20543..b20376aa6084 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_registry_code_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_registry_code_containers_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_code_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_code_containers_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryCodeContainersOperations: """RegistryCodeContainersOperations async operations. @@ -72,29 +94,34 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, api_version=api_version, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -109,7 +136,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -119,24 +148,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -145,49 +178,61 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements code_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, code_name=code_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -219,43 +264,54 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, code_name=code_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore @distributed_trace_async async def get( @@ -280,47 +336,53 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, code_name=code_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize("CodeContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore async def _create_or_update_initial( self, @@ -330,16 +392,20 @@ async def _create_or_update_initial( body: "_models.CodeContainer", **kwargs: Any ) -> "_models.CodeContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeContainer') + _json = self._serialize.body(body, "CodeContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -349,39 +415,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('CodeContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -418,15 +498,20 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.CodeContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -435,29 +520,39 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_registry_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_registry_code_versions_operations.py index 423447104fca..f9e2b61dc7da 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_registry_code_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_registry_code_versions_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,22 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_code_versions_operations import build_create_or_get_start_pending_upload_request, build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_code_versions_operations import ( + build_create_or_get_start_pending_upload_request, + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryCodeVersionsOperations: """RegistryCodeVersionsOperations async operations. @@ -81,16 +104,21 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -100,13 +128,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -124,7 +152,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -134,24 +164,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -161,15 +195,16 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements version: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -177,34 +212,45 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements code_name=code_name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -239,14 +285,17 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -254,29 +303,37 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements code_name=code_name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -304,15 +361,16 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -320,32 +378,37 @@ async def get( code_name=code_name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore async def _create_or_update_initial( self, @@ -356,16 +419,20 @@ async def _create_or_update_initial( body: "_models.CodeVersion", **kwargs: Any ) -> "_models.CodeVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeVersion') + _json = self._serialize.body(body, "CodeVersion") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -376,39 +443,49 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('CodeVersion', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -448,15 +525,20 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.CodeVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -466,32 +548,40 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_get_start_pending_upload( @@ -522,16 +612,22 @@ async def create_or_get_start_pending_upload( :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PendingUploadResponseDto"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PendingUploadRequestDto') + _json = self._serialize.body(body, "PendingUploadRequestDto") request = build_create_or_get_start_pending_upload_request( subscription_id=self._config.subscription_id, @@ -542,29 +638,38 @@ async def create_or_get_start_pending_upload( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], + template_url=self.create_or_get_start_pending_upload.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) + deserialized = self._deserialize( + "PendingUploadResponseDto", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}/startPendingUpload"} # type: ignore - + create_or_get_start_pending_upload.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}/startPendingUpload"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_registry_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_registry_component_containers_operations.py index 1f2f593f2a3f..8ef48479a332 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_registry_component_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_registry_component_containers_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_component_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_component_containers_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryComponentContainersOperations: """RegistryComponentContainersOperations async operations. @@ -72,29 +94,34 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, api_version=api_version, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -109,7 +136,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -119,24 +149,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -145,49 +179,61 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements component_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, component_name=component_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -219,43 +265,54 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, component_name=component_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore @distributed_trace_async async def get( @@ -280,47 +337,57 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, component_name=component_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore async def _create_or_update_initial( self, @@ -330,16 +397,22 @@ async def _create_or_update_initial( body: "_models.ComponentContainer", **kwargs: Any ) -> "_models.ComponentContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentContainer') + _json = self._serialize.body(body, "ComponentContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -349,39 +422,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComponentContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -418,15 +505,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComponentContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -435,29 +529,39 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_registry_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_registry_component_versions_operations.py index 7ca212ed8626..3c46143b081e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_registry_component_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_registry_component_versions_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_component_versions_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_component_versions_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryComponentVersionsOperations: """RegistryComponentVersionsOperations async operations. @@ -81,16 +103,21 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -100,13 +127,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -124,7 +151,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -134,24 +163,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -161,15 +194,16 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements version: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -177,34 +211,45 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements component_name=component_name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -239,14 +284,17 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -254,29 +302,37 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements component_name=component_name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -304,15 +360,18 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -320,32 +379,37 @@ async def get( component_name=component_name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize("ComponentVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore async def _create_or_update_initial( self, @@ -356,16 +420,22 @@ async def _create_or_update_initial( body: "_models.ComponentVersion", **kwargs: Any ) -> "_models.ComponentVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentVersion') + _json = self._serialize.body(body, "ComponentVersion") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -376,39 +446,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComponentVersion', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -448,15 +532,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComponentVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -466,29 +557,39 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_registry_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_registry_data_containers_operations.py index f864952e7b86..398e30c483a4 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_registry_data_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_registry_data_containers_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_data_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_data_containers_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryDataContainersOperations: """RegistryDataContainersOperations async operations. @@ -75,16 +97,21 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -92,13 +119,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -114,7 +141,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -124,24 +153,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -150,49 +183,61 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, name=name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -224,43 +269,54 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, name=name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore @distributed_trace_async async def get( @@ -285,47 +341,53 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize("DataContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore async def _create_or_update_initial( self, @@ -335,16 +397,20 @@ async def _create_or_update_initial( body: "_models.DataContainer", **kwargs: Any ) -> "_models.DataContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DataContainer') + _json = self._serialize.body(body, "DataContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -354,39 +420,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('DataContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -423,15 +503,20 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.DataContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -440,29 +525,39 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_registry_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_registry_data_versions_operations.py index ef2e1c67b6c9..c648e21366db 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_registry_data_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_registry_data_versions_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,22 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_data_versions_operations import build_create_or_get_start_pending_upload_request, build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_data_versions_operations import ( + build_create_or_get_start_pending_upload_request, + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryDataVersionsOperations: """RegistryDataVersionsOperations async operations. @@ -91,16 +114,21 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -112,13 +140,13 @@ def prepare_request(next_link=None): skip=skip, tags=tags, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -138,7 +166,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataVersionBaseResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -148,24 +178,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -175,15 +209,16 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements version: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -191,34 +226,45 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -253,14 +299,17 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -268,29 +317,37 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -318,15 +375,18 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -334,32 +394,37 @@ async def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize("DataVersionBase", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore async def _create_or_update_initial( self, @@ -370,16 +435,22 @@ async def _create_or_update_initial( body: "_models.DataVersionBase", **kwargs: Any ) -> "_models.DataVersionBase": - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DataVersionBase') + _json = self._serialize.body(body, "DataVersionBase") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -390,39 +461,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('DataVersionBase', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -462,15 +547,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.DataVersionBase] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -480,32 +572,42 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_get_start_pending_upload( @@ -536,16 +638,22 @@ async def create_or_get_start_pending_upload( :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PendingUploadResponseDto"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PendingUploadRequestDto') + _json = self._serialize.body(body, "PendingUploadRequestDto") request = build_create_or_get_start_pending_upload_request( subscription_id=self._config.subscription_id, @@ -556,29 +664,38 @@ async def create_or_get_start_pending_upload( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], + template_url=self.create_or_get_start_pending_upload.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) + deserialized = self._deserialize( + "PendingUploadResponseDto", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}/startPendingUpload"} # type: ignore - + create_or_get_start_pending_upload.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}/startPendingUpload"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_registry_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_registry_environment_containers_operations.py index afde29026544..be429ddc8955 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_registry_environment_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_registry_environment_containers_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_environment_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_environment_containers_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryEnvironmentContainersOperations: """RegistryEnvironmentContainersOperations async operations. @@ -55,7 +77,9 @@ def list( skip: Optional[str] = None, list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, **kwargs: Any - ) -> AsyncIterable["_models.EnvironmentContainerResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.EnvironmentContainerResourceArmPaginatedResult" + ]: """List environment containers. List environment containers. @@ -75,16 +99,21 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -92,13 +121,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -114,7 +143,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -124,24 +156,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -150,49 +186,61 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements environment_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, environment_name=environment_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -224,43 +272,54 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, environment_name=environment_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore @distributed_trace_async async def get( @@ -285,47 +344,57 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, environment_name=environment_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore async def _create_or_update_initial( self, @@ -335,16 +404,22 @@ async def _create_or_update_initial( body: "_models.EnvironmentContainer", **kwargs: Any ) -> "_models.EnvironmentContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentContainer') + _json = self._serialize.body(body, "EnvironmentContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -354,39 +429,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -423,15 +512,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -440,29 +536,39 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_registry_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_registry_environment_versions_operations.py index fe5f1662d7cd..701bb73a3ef3 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_registry_environment_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_registry_environment_versions_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_environment_versions_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_environment_versions_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryEnvironmentVersionsOperations: """RegistryEnvironmentVersionsOperations async operations. @@ -84,16 +106,21 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -104,13 +131,13 @@ def prepare_request(next_link=None): top=top, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -129,7 +156,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersionResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -139,24 +169,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -166,15 +200,16 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements version: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -182,34 +217,45 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements environment_name=environment_name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -244,14 +290,17 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -259,29 +308,37 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements environment_name=environment_name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -309,15 +366,18 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -325,32 +385,39 @@ async def get( environment_name=environment_name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore async def _create_or_update_initial( self, @@ -361,16 +428,22 @@ async def _create_or_update_initial( body: "_models.EnvironmentVersion", **kwargs: Any ) -> "_models.EnvironmentVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentVersion') + _json = self._serialize.body(body, "EnvironmentVersion") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -381,39 +454,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -453,15 +540,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -471,29 +565,39 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_registry_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_registry_model_containers_operations.py index c0b7c7c85646..364038b3542b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_registry_model_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_registry_model_containers_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_model_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_model_containers_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryModelContainersOperations: """RegistryModelContainersOperations async operations. @@ -75,16 +97,21 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -92,13 +119,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -114,7 +141,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -124,24 +153,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -150,49 +183,61 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements model_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, model_name=model_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -224,43 +269,54 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, model_name=model_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore @distributed_trace_async async def get( @@ -285,47 +341,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, model_name=model_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize("ModelContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore async def _create_or_update_initial( self, @@ -335,16 +399,22 @@ async def _create_or_update_initial( body: "_models.ModelContainer", **kwargs: Any ) -> "_models.ModelContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelContainer') + _json = self._serialize.body(body, "ModelContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -354,39 +424,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ModelContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -423,15 +507,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ModelContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -440,29 +531,39 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_registry_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_registry_model_versions_operations.py index 4ecf3f741330..36029223053f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_registry_model_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_registry_model_versions_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,22 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_model_versions_operations import build_create_or_get_start_pending_upload_request, build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_model_versions_operations import ( + build_create_or_get_start_pending_upload_request, + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryModelVersionsOperations: """RegistryModelVersionsOperations async operations. @@ -98,16 +121,21 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -122,13 +150,13 @@ def prepare_request(next_link=None): tags=tags, properties=properties, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -151,7 +179,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -161,24 +191,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -188,15 +222,16 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements version: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -204,34 +239,45 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements model_name=model_name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -266,14 +312,17 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -281,29 +330,37 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements model_name=model_name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -331,15 +388,16 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -347,32 +405,37 @@ async def get( model_name=model_name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore async def _create_or_update_initial( self, @@ -383,16 +446,20 @@ async def _create_or_update_initial( body: "_models.ModelVersion", **kwargs: Any ) -> "_models.ModelVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelVersion') + _json = self._serialize.body(body, "ModelVersion") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -403,39 +470,49 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ModelVersion', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -475,15 +552,20 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ModelVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -493,32 +575,40 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_get_start_pending_upload( @@ -549,16 +639,22 @@ async def create_or_get_start_pending_upload( :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PendingUploadResponseDto"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PendingUploadRequestDto') + _json = self._serialize.body(body, "PendingUploadRequestDto") request = build_create_or_get_start_pending_upload_request( subscription_id=self._config.subscription_id, @@ -569,29 +665,38 @@ async def create_or_get_start_pending_upload( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], + template_url=self.create_or_get_start_pending_upload.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) + deserialized = self._deserialize( + "PendingUploadResponseDto", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/startPendingUpload"} # type: ignore - + create_or_get_start_pending_upload.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/startPendingUpload"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_schedules_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_schedules_operations.py index c3f5b043edb9..2d1339a3bdd2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_schedules_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_schedules_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._schedules_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._schedules_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class SchedulesOperations: """SchedulesOperations async operations. @@ -53,7 +75,9 @@ def list( resource_group_name: str, workspace_name: str, skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ScheduleListViewType"]] = None, + list_view_type: Optional[ + Union[str, "_models.ScheduleListViewType"] + ] = None, **kwargs: Any ) -> AsyncIterable["_models.ScheduleResourceArmPaginatedResult"]: """List schedules in specified workspace. @@ -75,16 +99,21 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ScheduleResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduleResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ScheduleResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -92,13 +121,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -114,7 +143,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ScheduleResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ScheduleResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -124,24 +155,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -150,49 +185,61 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -224,43 +271,54 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @distributed_trace_async async def get( @@ -285,47 +343,53 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.Schedule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Schedule"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Schedule', pipeline_response) + deserialized = self._deserialize("Schedule", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore async def _create_or_update_initial( self, @@ -335,16 +399,20 @@ async def _create_or_update_initial( body: "_models.Schedule", **kwargs: Any ) -> "_models.Schedule": - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Schedule"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'Schedule') + _json = self._serialize.body(body, "Schedule") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -354,39 +422,49 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('Schedule', pipeline_response) + deserialized = self._deserialize("Schedule", pipeline_response) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('Schedule', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("Schedule", pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -422,15 +500,20 @@ async def begin_create_or_update( :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Schedule] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Schedule"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -439,29 +522,37 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Schedule', pipeline_response) + deserialized = self._deserialize("Schedule", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_usages_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_usages_operations.py index c5a56175200e..b8087aa47b76 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_usages_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_usages_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,8 +25,15 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._usages_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class UsagesOperations: """UsagesOperations async operations. @@ -46,9 +59,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list( - self, - location: str, - **kwargs: Any + self, location: str, **kwargs: Any ) -> AsyncIterable["_models.ListUsagesResult"]: """Gets the current usage information as well as limits for AML resources for given subscription and location. @@ -61,27 +72,32 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListUsagesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListUsagesResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, @@ -94,7 +110,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ListUsagesResult", pipeline_response) + deserialized = self._deserialize( + "ListUsagesResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -104,21 +122,25 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_virtual_machine_sizes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_virtual_machine_sizes_operations.py index fed00e931bfe..af2e22f2f4e6 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_virtual_machine_sizes_operations.py @@ -8,7 +8,13 @@ # -------------------------------------------------------------------------- from typing import Any, Callable, Dict, Optional, TypeVar -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -18,8 +24,15 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._virtual_machine_sizes_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class VirtualMachineSizesOperations: """VirtualMachineSizesOperations async operations. @@ -45,9 +58,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace_async async def list( - self, - location: str, - **kwargs: Any + self, location: str, **kwargs: Any ) -> "_models.VirtualMachineSizeListResult": """Returns supported VM Sizes in a location. @@ -58,42 +69,52 @@ async def list( :rtype: ~azure.mgmt.machinelearningservices.models.VirtualMachineSizeListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_list_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualMachineSizeListResult', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "VirtualMachineSizeListResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes"} # type: ignore - + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_workspace_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_workspace_connections_operations.py index a42b205065db..700e8d09f2e6 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_workspace_connections_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_workspace_connections_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._workspace_connections_operations import build_create_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._workspace_connections_operations import ( + build_create_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class WorkspaceConnectionsOperations: """WorkspaceConnectionsOperations async operations. @@ -70,16 +88,24 @@ async def create( :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'WorkspaceConnectionPropertiesV2BasicResource') + _json = self._serialize.body( + parameters, "WorkspaceConnectionPropertiesV2BasicResource" + ) request = build_create_request( subscription_id=self._config.subscription_id, @@ -89,32 +115,39 @@ async def create( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create.metadata['url'], + template_url=self.create.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - + create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace_async async def get( @@ -137,47 +170,57 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, connection_name=connection_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -200,43 +243,49 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, connection_name=connection_name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace def list( @@ -246,7 +295,9 @@ def list( target: Optional[str] = None, category: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult" + ]: """list. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -264,16 +315,21 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -281,13 +337,13 @@ def prepare_request(next_link=None): api_version=api_version, target=target, category=category, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -303,7 +359,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -313,21 +372,25 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_workspace_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_workspace_features_operations.py index 8e0188d0420e..7b412cb356d4 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_workspace_features_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_workspace_features_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,8 +25,15 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._workspace_features_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class WorkspaceFeaturesOperations: """WorkspaceFeaturesOperations async operations. @@ -46,10 +59,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> AsyncIterable["_models.ListAmlUserFeatureResult"]: """Lists all enabled features for a workspace. @@ -64,28 +74,33 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListAmlUserFeatureResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAmlUserFeatureResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListAmlUserFeatureResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -99,7 +114,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ListAmlUserFeatureResult", pipeline_response) + deserialized = self._deserialize( + "ListAmlUserFeatureResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -109,21 +126,25 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_workspaces_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_workspaces_operations.py index 7277e9e5fb62..ad95606b5545 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_workspaces_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/aio/operations/_workspaces_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,31 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._workspaces_operations import build_create_or_update_request_initial, build_delete_request_initial, build_diagnose_request_initial, build_get_request, build_list_by_resource_group_request, build_list_by_subscription_request, build_list_keys_request, build_list_notebook_access_token_request, build_list_notebook_keys_request, build_list_outbound_network_dependencies_endpoints_request, build_list_storage_account_keys_request, build_prepare_notebook_request_initial, build_resync_keys_request_initial, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._workspaces_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_diagnose_request_initial, + build_get_request, + build_list_by_resource_group_request, + build_list_by_subscription_request, + build_list_keys_request, + build_list_notebook_access_token_request, + build_list_notebook_keys_request, + build_list_outbound_network_dependencies_endpoints_request, + build_list_storage_account_keys_request, + build_prepare_notebook_request_initial, + build_resync_keys_request_initial, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class WorkspacesOperations: """WorkspacesOperations async operations. @@ -49,10 +81,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace_async async def get( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.Workspace": """Gets the properties of the specified machine learning workspace. @@ -65,46 +94,52 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.Workspace :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore async def _create_or_update_initial( self, @@ -113,16 +148,22 @@ async def _create_or_update_initial( parameters: "_models.Workspace", **kwargs: Any ) -> Optional["_models.Workspace"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.Workspace"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'Workspace') + _json = self._serialize.body(parameters, "Workspace") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -131,33 +172,36 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -189,15 +233,20 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Workspace] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -205,81 +254,83 @@ async def begin_create_or_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes a machine learning workspace. @@ -299,42 +350,49 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore async def _update_initial( self, @@ -343,16 +401,22 @@ async def _update_initial( parameters: "_models.WorkspaceUpdateParameters", **kwargs: Any ) -> Optional["_models.Workspace"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.Workspace"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'WorkspaceUpdateParameters') + _json = self._serialize.body(parameters, "WorkspaceUpdateParameters") request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -361,33 +425,36 @@ async def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -419,15 +486,20 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Workspace] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -435,32 +507,36 @@ async def begin_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace def list_by_resource_group( @@ -481,28 +557,33 @@ def list_by_resource_group( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_by_resource_group_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, api_version=api_version, skip=skip, - template_url=self.list_by_resource_group.metadata['url'], + template_url=self.list_by_resource_group.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_by_resource_group_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -516,7 +597,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -526,24 +609,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore + list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore async def _diagnose_initial( self, @@ -552,17 +639,25 @@ async def _diagnose_initial( parameters: Optional["_models.DiagnoseWorkspaceParameters"] = None, **kwargs: Any ) -> Optional["_models.DiagnoseResponseResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if parameters is not None: - _json = self._serialize.body(parameters, 'DiagnoseWorkspaceParameters') + _json = self._serialize.body( + parameters, "DiagnoseWorkspaceParameters" + ) else: _json = None @@ -573,39 +668,47 @@ async def _diagnose_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._diagnose_initial.metadata['url'], + template_url=self._diagnose_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) + deserialized = self._deserialize( + "DiagnoseResponseResult", pipeline_response + ) if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _diagnose_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore - + _diagnose_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore @distributed_trace_async async def begin_diagnose( @@ -639,15 +742,22 @@ async def begin_diagnose( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.DiagnoseResponseResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnoseResponseResult"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DiagnoseResponseResult"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._diagnose_initial( resource_group_name=resource_group_name, @@ -655,39 +765,46 @@ async def begin_diagnose( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) + deserialized = self._deserialize( + "DiagnoseResponseResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_diagnose.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore + begin_diagnose.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore @distributed_trace_async async def list_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.ListWorkspaceKeysResult": """Lists all the keys associated with this workspace. This includes keys for the storage account, app insights and password for container registry. @@ -701,95 +818,103 @@ async def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListWorkspaceKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceKeysResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListWorkspaceKeysResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ListWorkspaceKeysResult', pipeline_response) + deserialized = self._deserialize( + "ListWorkspaceKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys"} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys"} # type: ignore async def _resync_keys_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_resync_keys_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self._resync_keys_initial.metadata['url'], + template_url=self._resync_keys_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _resync_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore - + _resync_keys_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore @distributed_trace_async async def begin_resync_keys( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: """Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and password for container registry. @@ -810,48 +935,53 @@ async def begin_resync_keys( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._resync_keys_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_resync_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore + begin_resync_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore @distributed_trace def list_by_subscription( - self, - skip: Optional[str] = None, - **kwargs: Any + self, skip: Optional[str] = None, **kwargs: Any ) -> AsyncIterable["_models.WorkspaceListResult"]: """Lists all the available machine learning workspaces under the specified subscription. @@ -863,27 +993,32 @@ def list_by_subscription( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, skip=skip, - template_url=self.list_by_subscription.metadata['url'], + template_url=self.list_by_subscription.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, @@ -896,7 +1031,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -906,31 +1043,32 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore + list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore @distributed_trace_async async def list_notebook_access_token( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.NotebookAccessTokenResult": """return notebook access token and refresh token. @@ -943,101 +1081,113 @@ async def list_notebook_access_token( :rtype: ~azure.mgmt.machinelearningservices.models.NotebookAccessTokenResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookAccessTokenResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.NotebookAccessTokenResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_list_notebook_access_token_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_notebook_access_token.metadata['url'], + template_url=self.list_notebook_access_token.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('NotebookAccessTokenResult', pipeline_response) + deserialized = self._deserialize( + "NotebookAccessTokenResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_notebook_access_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken"} # type: ignore - + list_notebook_access_token.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken"} # type: ignore async def _prepare_notebook_initial( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> Optional["_models.NotebookResourceInfo"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NotebookResourceInfo"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.NotebookResourceInfo"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_prepare_notebook_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self._prepare_notebook_initial.metadata['url'], + template_url=self._prepare_notebook_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) + deserialized = self._deserialize( + "NotebookResourceInfo", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _prepare_notebook_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore - + _prepare_notebook_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore @distributed_trace_async async def begin_prepare_notebook( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> AsyncLROPoller["_models.NotebookResourceInfo"]: """Prepare a notebook. @@ -1059,52 +1209,64 @@ async def begin_prepare_notebook( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.NotebookResourceInfo] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookResourceInfo"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.NotebookResourceInfo"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._prepare_notebook_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) + deserialized = self._deserialize( + "NotebookResourceInfo", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_prepare_notebook.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore + begin_prepare_notebook.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore @distributed_trace_async async def list_storage_account_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.ListStorageAccountKeysResult": """List storage account keys of a workspace. @@ -1117,53 +1279,60 @@ async def list_storage_account_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListStorageAccountKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListStorageAccountKeysResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListStorageAccountKeysResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_list_storage_account_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_storage_account_keys.metadata['url'], + template_url=self.list_storage_account_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ListStorageAccountKeysResult', pipeline_response) + deserialized = self._deserialize( + "ListStorageAccountKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_storage_account_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys"} # type: ignore - + list_storage_account_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys"} # type: ignore @distributed_trace_async async def list_notebook_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.ListNotebookKeysResult": """List keys of a notebook. @@ -1176,53 +1345,60 @@ async def list_notebook_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListNotebookKeysResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListNotebookKeysResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_list_notebook_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_notebook_keys.metadata['url'], + template_url=self.list_notebook_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ListNotebookKeysResult', pipeline_response) + deserialized = self._deserialize( + "ListNotebookKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_notebook_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys"} # type: ignore - + list_notebook_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys"} # type: ignore @distributed_trace_async async def list_outbound_network_dependencies_endpoints( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.ExternalFQDNResponse": """Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) programmatically. @@ -1239,43 +1415,55 @@ async def list_outbound_network_dependencies_endpoints( :rtype: ~azure.mgmt.machinelearningservices.models.ExternalFQDNResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExternalFQDNResponse"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ExternalFQDNResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_list_outbound_network_dependencies_endpoints_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], + template_url=self.list_outbound_network_dependencies_endpoints.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ExternalFQDNResponse', pipeline_response) + deserialized = self._deserialize( + "ExternalFQDNResponse", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_outbound_network_dependencies_endpoints.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints"} # type: ignore - + list_outbound_network_dependencies_endpoints.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/models/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/models/__init__.py index 5693b6552996..b19becc16bda 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/models/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/models/__init__.py @@ -231,7 +231,9 @@ from ._models_py3 import MLTableJobInput from ._models_py3 import MLTableJobOutput from ._models_py3 import ManagedIdentity - from ._models_py3 import ManagedIdentityAuthTypeWorkspaceConnectionProperties + from ._models_py3 import ( + ManagedIdentityAuthTypeWorkspaceConnectionProperties, + ) from ._models_py3 import ManagedOnlineDeployment from ._models_py3 import ManagedServiceIdentity from ._models_py3 import ManagedServiceIdentityAutoGenerated @@ -267,7 +269,9 @@ from ._models_py3 import PATAuthTypeWorkspaceConnectionProperties from ._models_py3 import PaginatedComputeResourcesList from ._models_py3 import PartialBatchDeployment - from ._models_py3 import PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties + from ._models_py3 import ( + PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, + ) from ._models_py3 import PartialManagedServiceIdentity from ._models_py3 import PartialManagedServiceIdentityAutoGenerated from ._models_py3 import PartialMinimalTrackedResource @@ -382,7 +386,9 @@ from ._models_py3 import UserCreatedAcrAccount from ._models_py3 import UserCreatedStorageAccount from ._models_py3 import UserIdentity - from ._models_py3 import UsernamePasswordAuthTypeWorkspaceConnectionProperties + from ._models_py3 import ( + UsernamePasswordAuthTypeWorkspaceConnectionProperties, + ) from ._models_py3 import VirtualMachine from ._models_py3 import VirtualMachineImage from ._models_py3 import VirtualMachineSchema @@ -399,7 +405,9 @@ from ._models_py3 import WorkspaceConnectionPersonalAccessToken from ._models_py3 import WorkspaceConnectionPropertiesV2 from ._models_py3 import WorkspaceConnectionPropertiesV2BasicResource - from ._models_py3 import WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult + from ._models_py3 import ( + WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, + ) from ._models_py3 import WorkspaceConnectionSharedAccessSignature from ._models_py3 import WorkspaceConnectionUsernamePassword from ._models_py3 import WorkspaceListResult @@ -932,526 +940,526 @@ ) __all__ = [ - 'AKS', - 'AKSSchema', - 'AKSSchemaProperties', - 'AccountKeyDatastoreCredentials', - 'AccountKeyDatastoreSecrets', - 'AcrDetails', - 'AksComputeSecrets', - 'AksComputeSecretsProperties', - 'AksNetworkingConfiguration', - 'AllNodes', - 'AmlCompute', - 'AmlComputeNodeInformation', - 'AmlComputeNodesInformation', - 'AmlComputeProperties', - 'AmlComputeSchema', - 'AmlOperation', - 'AmlOperationDisplay', - 'AmlOperationListResult', - 'AmlToken', - 'AmlUserFeature', - 'ArmResourceId', - 'AssetBase', - 'AssetContainer', - 'AssetJobInput', - 'AssetJobOutput', - 'AssetReferenceBase', - 'AssignedUser', - 'AutoForecastHorizon', - 'AutoMLJob', - 'AutoMLVertical', - 'AutoNCrossValidations', - 'AutoPauseProperties', - 'AutoScaleProperties', - 'AutoSeasonality', - 'AutoTargetLags', - 'AutoTargetRollingWindowSize', - 'AzureBlobDatastore', - 'AzureDataLakeGen1Datastore', - 'AzureDataLakeGen2Datastore', - 'AzureFileDatastore', - 'BanditPolicy', - 'BatchDeployment', - 'BatchDeploymentProperties', - 'BatchDeploymentTrackedResourceArmPaginatedResult', - 'BatchEndpoint', - 'BatchEndpointDefaults', - 'BatchEndpointProperties', - 'BatchEndpointTrackedResourceArmPaginatedResult', - 'BatchRetrySettings', - 'BayesianSamplingAlgorithm', - 'BindOptions', - 'BlobReferenceForConsumptionDto', - 'BuildContext', - 'CertificateDatastoreCredentials', - 'CertificateDatastoreSecrets', - 'Classification', - 'ClassificationTrainingSettings', - 'ClusterUpdateParameters', - 'CodeConfiguration', - 'CodeContainer', - 'CodeContainerProperties', - 'CodeContainerResourceArmPaginatedResult', - 'CodeVersion', - 'CodeVersionProperties', - 'CodeVersionResourceArmPaginatedResult', - 'ColumnTransformer', - 'CommandJob', - 'CommandJobLimits', - 'ComponentContainer', - 'ComponentContainerProperties', - 'ComponentContainerResourceArmPaginatedResult', - 'ComponentVersion', - 'ComponentVersionProperties', - 'ComponentVersionResourceArmPaginatedResult', - 'Compute', - 'ComputeInstance', - 'ComputeInstanceApplication', - 'ComputeInstanceConnectivityEndpoints', - 'ComputeInstanceContainer', - 'ComputeInstanceCreatedBy', - 'ComputeInstanceDataDisk', - 'ComputeInstanceDataMount', - 'ComputeInstanceEnvironmentInfo', - 'ComputeInstanceLastOperation', - 'ComputeInstanceProperties', - 'ComputeInstanceSchema', - 'ComputeInstanceSshSettings', - 'ComputeInstanceVersion', - 'ComputeResource', - 'ComputeResourceSchema', - 'ComputeSchedules', - 'ComputeSecrets', - 'ComputeStartStopSchedule', - 'ContainerResourceRequirements', - 'ContainerResourceSettings', - 'CosmosDbSettings', - 'Cron', - 'CronTrigger', - 'CustomForecastHorizon', - 'CustomModelJobInput', - 'CustomModelJobOutput', - 'CustomNCrossValidations', - 'CustomSeasonality', - 'CustomService', - 'CustomTargetLags', - 'CustomTargetRollingWindowSize', - 'DataContainer', - 'DataContainerProperties', - 'DataContainerResourceArmPaginatedResult', - 'DataFactory', - 'DataLakeAnalytics', - 'DataLakeAnalyticsSchema', - 'DataLakeAnalyticsSchemaProperties', - 'DataPathAssetReference', - 'DataVersionBase', - 'DataVersionBaseProperties', - 'DataVersionBaseResourceArmPaginatedResult', - 'Databricks', - 'DatabricksComputeSecrets', - 'DatabricksComputeSecretsProperties', - 'DatabricksProperties', - 'DatabricksSchema', - 'Datastore', - 'DatastoreCredentials', - 'DatastoreProperties', - 'DatastoreResourceArmPaginatedResult', - 'DatastoreSecrets', - 'DefaultScaleSettings', - 'DeploymentLogs', - 'DeploymentLogsRequest', - 'DeploymentResourceConfiguration', - 'DiagnoseRequestProperties', - 'DiagnoseResponseResult', - 'DiagnoseResponseResultValue', - 'DiagnoseResult', - 'DiagnoseWorkspaceParameters', - 'DistributionConfiguration', - 'Docker', - 'EarlyTerminationPolicy', - 'EncryptionKeyVaultProperties', - 'EncryptionProperty', - 'Endpoint', - 'EndpointAuthKeys', - 'EndpointAuthToken', - 'EndpointDeploymentPropertiesBase', - 'EndpointPropertiesBase', - 'EndpointScheduleAction', - 'EnvironmentContainer', - 'EnvironmentContainerProperties', - 'EnvironmentContainerResourceArmPaginatedResult', - 'EnvironmentVariable', - 'EnvironmentVersion', - 'EnvironmentVersionProperties', - 'EnvironmentVersionResourceArmPaginatedResult', - 'ErrorAdditionalInfo', - 'ErrorDetail', - 'ErrorResponse', - 'EstimatedVMPrice', - 'EstimatedVMPrices', - 'ExternalFQDNResponse', - 'FQDNEndpoint', - 'FQDNEndpointDetail', - 'FQDNEndpoints', - 'FQDNEndpointsProperties', - 'FeaturizationSettings', - 'FlavorData', - 'ForecastHorizon', - 'Forecasting', - 'ForecastingSettings', - 'ForecastingTrainingSettings', - 'GridSamplingAlgorithm', - 'HDInsight', - 'HDInsightProperties', - 'HDInsightSchema', - 'IdAssetReference', - 'IdentityConfiguration', - 'IdentityForCmk', - 'IdleShutdownSetting', - 'Image', - 'ImageClassification', - 'ImageClassificationBase', - 'ImageClassificationMultilabel', - 'ImageInstanceSegmentation', - 'ImageLimitSettings', - 'ImageMetadata', - 'ImageModelDistributionSettings', - 'ImageModelDistributionSettingsClassification', - 'ImageModelDistributionSettingsObjectDetection', - 'ImageModelSettings', - 'ImageModelSettingsClassification', - 'ImageModelSettingsObjectDetection', - 'ImageObjectDetection', - 'ImageObjectDetectionBase', - 'ImageSweepSettings', - 'ImageVertical', - 'InferenceContainerProperties', - 'InstanceTypeSchema', - 'InstanceTypeSchemaResources', - 'JobBase', - 'JobBaseProperties', - 'JobBaseResourceArmPaginatedResult', - 'JobInput', - 'JobLimits', - 'JobOutput', - 'JobResourceConfiguration', - 'JobScheduleAction', - 'JobService', - 'Kubernetes', - 'KubernetesOnlineDeployment', - 'KubernetesProperties', - 'KubernetesSchema', - 'ListAmlUserFeatureResult', - 'ListNotebookKeysResult', - 'ListStorageAccountKeysResult', - 'ListUsagesResult', - 'ListWorkspaceKeysResult', - 'ListWorkspaceQuotas', - 'LiteralJobInput', - 'MLFlowModelJobInput', - 'MLFlowModelJobOutput', - 'MLTableData', - 'MLTableJobInput', - 'MLTableJobOutput', - 'ManagedIdentity', - 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', - 'ManagedOnlineDeployment', - 'ManagedServiceIdentity', - 'ManagedServiceIdentityAutoGenerated', - 'MedianStoppingPolicy', - 'ModelContainer', - 'ModelContainerProperties', - 'ModelContainerResourceArmPaginatedResult', - 'ModelVersion', - 'ModelVersionProperties', - 'ModelVersionResourceArmPaginatedResult', - 'Mpi', - 'NCrossValidations', - 'NlpVertical', - 'NlpVerticalFeaturizationSettings', - 'NlpVerticalLimitSettings', - 'NodeStateCounts', - 'Nodes', - 'NoneAuthTypeWorkspaceConnectionProperties', - 'NoneDatastoreCredentials', - 'NotebookAccessTokenResult', - 'NotebookPreparationError', - 'NotebookResourceInfo', - 'Objective', - 'OnlineDeployment', - 'OnlineDeploymentProperties', - 'OnlineDeploymentTrackedResourceArmPaginatedResult', - 'OnlineEndpoint', - 'OnlineEndpointProperties', - 'OnlineEndpointTrackedResourceArmPaginatedResult', - 'OnlineRequestSettings', - 'OnlineScaleSettings', - 'OutputPathAssetReference', - 'PATAuthTypeWorkspaceConnectionProperties', - 'PaginatedComputeResourcesList', - 'PartialBatchDeployment', - 'PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties', - 'PartialManagedServiceIdentity', - 'PartialManagedServiceIdentityAutoGenerated', - 'PartialMinimalTrackedResource', - 'PartialMinimalTrackedResourceWithIdentity', - 'PartialMinimalTrackedResourceWithSku', - 'PartialRegistryPartialTrackedResource', - 'PartialSku', - 'Password', - 'PendingUploadCredentialDto', - 'PendingUploadRequestDto', - 'PendingUploadResponseDto', - 'PersonalComputeInstanceSettings', - 'PipelineJob', - 'PrivateEndpoint', - 'PrivateEndpointAutoGenerated', - 'PrivateEndpointConnection', - 'PrivateEndpointConnectionAutoGenerated', - 'PrivateEndpointConnectionListResult', - 'PrivateEndpointResource', - 'PrivateLinkResource', - 'PrivateLinkResourceListResult', - 'PrivateLinkServiceConnectionState', - 'PrivateLinkServiceConnectionStateAutoGenerated', - 'ProbeSettings', - 'PyTorch', - 'QuotaBaseProperties', - 'QuotaUpdateParameters', - 'RandomSamplingAlgorithm', - 'Recurrence', - 'RecurrenceSchedule', - 'RecurrenceTrigger', - 'RegenerateEndpointKeysRequest', - 'Registry', - 'RegistryListCredentialsResult', - 'RegistryRegionArmDetails', - 'RegistryTrackedResourceArmPaginatedResult', - 'Regression', - 'RegressionTrainingSettings', - 'Resource', - 'ResourceBase', - 'ResourceConfiguration', - 'ResourceId', - 'ResourceName', - 'ResourceQuota', - 'Route', - 'SASAuthTypeWorkspaceConnectionProperties', - 'SASCredentialDto', - 'SamplingAlgorithm', - 'SasDatastoreCredentials', - 'SasDatastoreSecrets', - 'ScaleSettings', - 'ScaleSettingsInformation', - 'Schedule', - 'ScheduleActionBase', - 'ScheduleBase', - 'ScheduleProperties', - 'ScheduleResourceArmPaginatedResult', - 'ScriptReference', - 'ScriptsToExecute', - 'Seasonality', - 'ServiceManagedResourcesSettings', - 'ServicePrincipalDatastoreCredentials', - 'ServicePrincipalDatastoreSecrets', - 'SetupScripts', - 'SharedPrivateLinkResource', - 'Sku', - 'SkuCapacity', - 'SkuResource', - 'SkuResourceArmPaginatedResult', - 'SkuSetting', - 'SslConfiguration', - 'StackEnsembleSettings', - 'StorageAccountDetails', - 'SweepJob', - 'SweepJobLimits', - 'SynapseSpark', - 'SynapseSparkProperties', - 'SystemCreatedAcrAccount', - 'SystemCreatedStorageAccount', - 'SystemData', - 'SystemService', - 'TableVertical', - 'TableVerticalFeaturizationSettings', - 'TableVerticalLimitSettings', - 'TargetLags', - 'TargetRollingWindowSize', - 'TargetUtilizationScaleSettings', - 'TensorFlow', - 'TextClassification', - 'TextClassificationMultilabel', - 'TextNer', - 'TmpfsOptions', - 'TrackedResource', - 'TrainingSettings', - 'TrialComponent', - 'TriggerBase', - 'TritonModelJobInput', - 'TritonModelJobOutput', - 'TruncationSelectionPolicy', - 'UpdateWorkspaceQuotas', - 'UpdateWorkspaceQuotasResult', - 'UriFileDataVersion', - 'UriFileJobInput', - 'UriFileJobOutput', - 'UriFolderDataVersion', - 'UriFolderJobInput', - 'UriFolderJobOutput', - 'Usage', - 'UsageName', - 'UserAccountCredentials', - 'UserAssignedIdentity', - 'UserCreatedAcrAccount', - 'UserCreatedStorageAccount', - 'UserIdentity', - 'UsernamePasswordAuthTypeWorkspaceConnectionProperties', - 'VirtualMachine', - 'VirtualMachineImage', - 'VirtualMachineSchema', - 'VirtualMachineSchemaProperties', - 'VirtualMachineSecrets', - 'VirtualMachineSecretsSchema', - 'VirtualMachineSize', - 'VirtualMachineSizeListResult', - 'VirtualMachineSshCredentials', - 'VolumeDefinition', - 'VolumeOptions', - 'Workspace', - 'WorkspaceConnectionManagedIdentity', - 'WorkspaceConnectionPersonalAccessToken', - 'WorkspaceConnectionPropertiesV2', - 'WorkspaceConnectionPropertiesV2BasicResource', - 'WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult', - 'WorkspaceConnectionSharedAccessSignature', - 'WorkspaceConnectionUsernamePassword', - 'WorkspaceListResult', - 'WorkspaceUpdateParameters', - 'AllocationState', - 'ApplicationSharingPolicy', - 'AssetProvisioningState', - 'AutoRebuildSetting', - 'Autosave', - 'BatchLoggingLevel', - 'BatchOutputAction', - 'BillingCurrency', - 'BlockedTransformers', - 'Caching', - 'ClassificationModels', - 'ClassificationMultilabelPrimaryMetrics', - 'ClassificationPrimaryMetrics', - 'ClusterPurpose', - 'ComputeInstanceAuthorizationType', - 'ComputeInstanceState', - 'ComputePowerAction', - 'ComputeType', - 'ConnectionAuthType', - 'ConnectionCategory', - 'ContainerType', - 'CreatedByType', - 'CredentialsType', - 'DataType', - 'DatastoreType', - 'DeploymentProvisioningState', - 'DiagnoseResultLevel', - 'DistributionType', - 'EarlyTerminationPolicyType', - 'EgressPublicNetworkAccessType', - 'EncryptionStatus', - 'EndpointAuthMode', - 'EndpointComputeType', - 'EndpointProvisioningState', - 'EndpointServiceConnectionStatus', - 'EnvironmentType', - 'EnvironmentVariableType', - 'FeatureLags', - 'FeaturizationMode', - 'ForecastHorizonMode', - 'ForecastingModels', - 'ForecastingPrimaryMetrics', - 'Goal', - 'IdentityConfigurationType', - 'ImageType', - 'InputDeliveryMode', - 'InstanceSegmentationPrimaryMetrics', - 'JobInputType', - 'JobLimitsType', - 'JobOutputType', - 'JobStatus', - 'JobType', - 'KeyType', - 'LearningRateScheduler', - 'ListViewType', - 'LoadBalancerType', - 'LogVerbosity', - 'ManagedServiceIdentityType', - 'ModelSize', - 'MountAction', - 'MountState', - 'NCrossValidationsMode', - 'Network', - 'NodeState', - 'NodesValueType', - 'ObjectDetectionPrimaryMetrics', - 'OperatingSystemType', - 'OperationName', - 'OperationStatus', - 'OperationTrigger', - 'OrderString', - 'OsType', - 'OutputDeliveryMode', - 'PendingUploadCredentialType', - 'PendingUploadType', - 'PrivateEndpointConnectionProvisioningState', - 'PrivateEndpointServiceConnectionStatus', - 'Protocol', - 'ProvisioningState', - 'ProvisioningStatus', - 'PublicNetworkAccess', - 'PublicNetworkAccessType', - 'QuotaUnit', - 'RandomSamplingAlgorithmRule', - 'RecurrenceFrequency', - 'ReferenceType', - 'RegressionModels', - 'RegressionPrimaryMetrics', - 'RemoteLoginPortPublicAccess', - 'SamplingAlgorithmType', - 'ScaleType', - 'ScheduleActionType', - 'ScheduleListViewType', - 'ScheduleProvisioningState', - 'ScheduleProvisioningStatus', - 'ScheduleStatus', - 'SeasonalityMode', - 'SecretsType', - 'ServiceDataAccessAuthIdentity', - 'ShortSeriesHandlingConfiguration', - 'SkuScaleType', - 'SkuTier', - 'SourceType', - 'SshPublicAccess', - 'SslConfigStatus', - 'StackMetaLearnerType', - 'Status', - 'StochasticOptimizer', - 'StorageAccountType', - 'TargetAggregationFunction', - 'TargetLagsMode', - 'TargetRollingWindowSizeMode', - 'TaskType', - 'TriggerType', - 'UnderlyingResourceAction', - 'UnitOfMeasure', - 'UsageUnit', - 'UseStl', - 'VMPriceOSType', - 'VMTier', - 'ValidationMetricType', - 'ValueFormat', - 'VmPriority', - 'VolumeDefinitionType', - 'WeekDay', + "AKS", + "AKSSchema", + "AKSSchemaProperties", + "AccountKeyDatastoreCredentials", + "AccountKeyDatastoreSecrets", + "AcrDetails", + "AksComputeSecrets", + "AksComputeSecretsProperties", + "AksNetworkingConfiguration", + "AllNodes", + "AmlCompute", + "AmlComputeNodeInformation", + "AmlComputeNodesInformation", + "AmlComputeProperties", + "AmlComputeSchema", + "AmlOperation", + "AmlOperationDisplay", + "AmlOperationListResult", + "AmlToken", + "AmlUserFeature", + "ArmResourceId", + "AssetBase", + "AssetContainer", + "AssetJobInput", + "AssetJobOutput", + "AssetReferenceBase", + "AssignedUser", + "AutoForecastHorizon", + "AutoMLJob", + "AutoMLVertical", + "AutoNCrossValidations", + "AutoPauseProperties", + "AutoScaleProperties", + "AutoSeasonality", + "AutoTargetLags", + "AutoTargetRollingWindowSize", + "AzureBlobDatastore", + "AzureDataLakeGen1Datastore", + "AzureDataLakeGen2Datastore", + "AzureFileDatastore", + "BanditPolicy", + "BatchDeployment", + "BatchDeploymentProperties", + "BatchDeploymentTrackedResourceArmPaginatedResult", + "BatchEndpoint", + "BatchEndpointDefaults", + "BatchEndpointProperties", + "BatchEndpointTrackedResourceArmPaginatedResult", + "BatchRetrySettings", + "BayesianSamplingAlgorithm", + "BindOptions", + "BlobReferenceForConsumptionDto", + "BuildContext", + "CertificateDatastoreCredentials", + "CertificateDatastoreSecrets", + "Classification", + "ClassificationTrainingSettings", + "ClusterUpdateParameters", + "CodeConfiguration", + "CodeContainer", + "CodeContainerProperties", + "CodeContainerResourceArmPaginatedResult", + "CodeVersion", + "CodeVersionProperties", + "CodeVersionResourceArmPaginatedResult", + "ColumnTransformer", + "CommandJob", + "CommandJobLimits", + "ComponentContainer", + "ComponentContainerProperties", + "ComponentContainerResourceArmPaginatedResult", + "ComponentVersion", + "ComponentVersionProperties", + "ComponentVersionResourceArmPaginatedResult", + "Compute", + "ComputeInstance", + "ComputeInstanceApplication", + "ComputeInstanceConnectivityEndpoints", + "ComputeInstanceContainer", + "ComputeInstanceCreatedBy", + "ComputeInstanceDataDisk", + "ComputeInstanceDataMount", + "ComputeInstanceEnvironmentInfo", + "ComputeInstanceLastOperation", + "ComputeInstanceProperties", + "ComputeInstanceSchema", + "ComputeInstanceSshSettings", + "ComputeInstanceVersion", + "ComputeResource", + "ComputeResourceSchema", + "ComputeSchedules", + "ComputeSecrets", + "ComputeStartStopSchedule", + "ContainerResourceRequirements", + "ContainerResourceSettings", + "CosmosDbSettings", + "Cron", + "CronTrigger", + "CustomForecastHorizon", + "CustomModelJobInput", + "CustomModelJobOutput", + "CustomNCrossValidations", + "CustomSeasonality", + "CustomService", + "CustomTargetLags", + "CustomTargetRollingWindowSize", + "DataContainer", + "DataContainerProperties", + "DataContainerResourceArmPaginatedResult", + "DataFactory", + "DataLakeAnalytics", + "DataLakeAnalyticsSchema", + "DataLakeAnalyticsSchemaProperties", + "DataPathAssetReference", + "DataVersionBase", + "DataVersionBaseProperties", + "DataVersionBaseResourceArmPaginatedResult", + "Databricks", + "DatabricksComputeSecrets", + "DatabricksComputeSecretsProperties", + "DatabricksProperties", + "DatabricksSchema", + "Datastore", + "DatastoreCredentials", + "DatastoreProperties", + "DatastoreResourceArmPaginatedResult", + "DatastoreSecrets", + "DefaultScaleSettings", + "DeploymentLogs", + "DeploymentLogsRequest", + "DeploymentResourceConfiguration", + "DiagnoseRequestProperties", + "DiagnoseResponseResult", + "DiagnoseResponseResultValue", + "DiagnoseResult", + "DiagnoseWorkspaceParameters", + "DistributionConfiguration", + "Docker", + "EarlyTerminationPolicy", + "EncryptionKeyVaultProperties", + "EncryptionProperty", + "Endpoint", + "EndpointAuthKeys", + "EndpointAuthToken", + "EndpointDeploymentPropertiesBase", + "EndpointPropertiesBase", + "EndpointScheduleAction", + "EnvironmentContainer", + "EnvironmentContainerProperties", + "EnvironmentContainerResourceArmPaginatedResult", + "EnvironmentVariable", + "EnvironmentVersion", + "EnvironmentVersionProperties", + "EnvironmentVersionResourceArmPaginatedResult", + "ErrorAdditionalInfo", + "ErrorDetail", + "ErrorResponse", + "EstimatedVMPrice", + "EstimatedVMPrices", + "ExternalFQDNResponse", + "FQDNEndpoint", + "FQDNEndpointDetail", + "FQDNEndpoints", + "FQDNEndpointsProperties", + "FeaturizationSettings", + "FlavorData", + "ForecastHorizon", + "Forecasting", + "ForecastingSettings", + "ForecastingTrainingSettings", + "GridSamplingAlgorithm", + "HDInsight", + "HDInsightProperties", + "HDInsightSchema", + "IdAssetReference", + "IdentityConfiguration", + "IdentityForCmk", + "IdleShutdownSetting", + "Image", + "ImageClassification", + "ImageClassificationBase", + "ImageClassificationMultilabel", + "ImageInstanceSegmentation", + "ImageLimitSettings", + "ImageMetadata", + "ImageModelDistributionSettings", + "ImageModelDistributionSettingsClassification", + "ImageModelDistributionSettingsObjectDetection", + "ImageModelSettings", + "ImageModelSettingsClassification", + "ImageModelSettingsObjectDetection", + "ImageObjectDetection", + "ImageObjectDetectionBase", + "ImageSweepSettings", + "ImageVertical", + "InferenceContainerProperties", + "InstanceTypeSchema", + "InstanceTypeSchemaResources", + "JobBase", + "JobBaseProperties", + "JobBaseResourceArmPaginatedResult", + "JobInput", + "JobLimits", + "JobOutput", + "JobResourceConfiguration", + "JobScheduleAction", + "JobService", + "Kubernetes", + "KubernetesOnlineDeployment", + "KubernetesProperties", + "KubernetesSchema", + "ListAmlUserFeatureResult", + "ListNotebookKeysResult", + "ListStorageAccountKeysResult", + "ListUsagesResult", + "ListWorkspaceKeysResult", + "ListWorkspaceQuotas", + "LiteralJobInput", + "MLFlowModelJobInput", + "MLFlowModelJobOutput", + "MLTableData", + "MLTableJobInput", + "MLTableJobOutput", + "ManagedIdentity", + "ManagedIdentityAuthTypeWorkspaceConnectionProperties", + "ManagedOnlineDeployment", + "ManagedServiceIdentity", + "ManagedServiceIdentityAutoGenerated", + "MedianStoppingPolicy", + "ModelContainer", + "ModelContainerProperties", + "ModelContainerResourceArmPaginatedResult", + "ModelVersion", + "ModelVersionProperties", + "ModelVersionResourceArmPaginatedResult", + "Mpi", + "NCrossValidations", + "NlpVertical", + "NlpVerticalFeaturizationSettings", + "NlpVerticalLimitSettings", + "NodeStateCounts", + "Nodes", + "NoneAuthTypeWorkspaceConnectionProperties", + "NoneDatastoreCredentials", + "NotebookAccessTokenResult", + "NotebookPreparationError", + "NotebookResourceInfo", + "Objective", + "OnlineDeployment", + "OnlineDeploymentProperties", + "OnlineDeploymentTrackedResourceArmPaginatedResult", + "OnlineEndpoint", + "OnlineEndpointProperties", + "OnlineEndpointTrackedResourceArmPaginatedResult", + "OnlineRequestSettings", + "OnlineScaleSettings", + "OutputPathAssetReference", + "PATAuthTypeWorkspaceConnectionProperties", + "PaginatedComputeResourcesList", + "PartialBatchDeployment", + "PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties", + "PartialManagedServiceIdentity", + "PartialManagedServiceIdentityAutoGenerated", + "PartialMinimalTrackedResource", + "PartialMinimalTrackedResourceWithIdentity", + "PartialMinimalTrackedResourceWithSku", + "PartialRegistryPartialTrackedResource", + "PartialSku", + "Password", + "PendingUploadCredentialDto", + "PendingUploadRequestDto", + "PendingUploadResponseDto", + "PersonalComputeInstanceSettings", + "PipelineJob", + "PrivateEndpoint", + "PrivateEndpointAutoGenerated", + "PrivateEndpointConnection", + "PrivateEndpointConnectionAutoGenerated", + "PrivateEndpointConnectionListResult", + "PrivateEndpointResource", + "PrivateLinkResource", + "PrivateLinkResourceListResult", + "PrivateLinkServiceConnectionState", + "PrivateLinkServiceConnectionStateAutoGenerated", + "ProbeSettings", + "PyTorch", + "QuotaBaseProperties", + "QuotaUpdateParameters", + "RandomSamplingAlgorithm", + "Recurrence", + "RecurrenceSchedule", + "RecurrenceTrigger", + "RegenerateEndpointKeysRequest", + "Registry", + "RegistryListCredentialsResult", + "RegistryRegionArmDetails", + "RegistryTrackedResourceArmPaginatedResult", + "Regression", + "RegressionTrainingSettings", + "Resource", + "ResourceBase", + "ResourceConfiguration", + "ResourceId", + "ResourceName", + "ResourceQuota", + "Route", + "SASAuthTypeWorkspaceConnectionProperties", + "SASCredentialDto", + "SamplingAlgorithm", + "SasDatastoreCredentials", + "SasDatastoreSecrets", + "ScaleSettings", + "ScaleSettingsInformation", + "Schedule", + "ScheduleActionBase", + "ScheduleBase", + "ScheduleProperties", + "ScheduleResourceArmPaginatedResult", + "ScriptReference", + "ScriptsToExecute", + "Seasonality", + "ServiceManagedResourcesSettings", + "ServicePrincipalDatastoreCredentials", + "ServicePrincipalDatastoreSecrets", + "SetupScripts", + "SharedPrivateLinkResource", + "Sku", + "SkuCapacity", + "SkuResource", + "SkuResourceArmPaginatedResult", + "SkuSetting", + "SslConfiguration", + "StackEnsembleSettings", + "StorageAccountDetails", + "SweepJob", + "SweepJobLimits", + "SynapseSpark", + "SynapseSparkProperties", + "SystemCreatedAcrAccount", + "SystemCreatedStorageAccount", + "SystemData", + "SystemService", + "TableVertical", + "TableVerticalFeaturizationSettings", + "TableVerticalLimitSettings", + "TargetLags", + "TargetRollingWindowSize", + "TargetUtilizationScaleSettings", + "TensorFlow", + "TextClassification", + "TextClassificationMultilabel", + "TextNer", + "TmpfsOptions", + "TrackedResource", + "TrainingSettings", + "TrialComponent", + "TriggerBase", + "TritonModelJobInput", + "TritonModelJobOutput", + "TruncationSelectionPolicy", + "UpdateWorkspaceQuotas", + "UpdateWorkspaceQuotasResult", + "UriFileDataVersion", + "UriFileJobInput", + "UriFileJobOutput", + "UriFolderDataVersion", + "UriFolderJobInput", + "UriFolderJobOutput", + "Usage", + "UsageName", + "UserAccountCredentials", + "UserAssignedIdentity", + "UserCreatedAcrAccount", + "UserCreatedStorageAccount", + "UserIdentity", + "UsernamePasswordAuthTypeWorkspaceConnectionProperties", + "VirtualMachine", + "VirtualMachineImage", + "VirtualMachineSchema", + "VirtualMachineSchemaProperties", + "VirtualMachineSecrets", + "VirtualMachineSecretsSchema", + "VirtualMachineSize", + "VirtualMachineSizeListResult", + "VirtualMachineSshCredentials", + "VolumeDefinition", + "VolumeOptions", + "Workspace", + "WorkspaceConnectionManagedIdentity", + "WorkspaceConnectionPersonalAccessToken", + "WorkspaceConnectionPropertiesV2", + "WorkspaceConnectionPropertiesV2BasicResource", + "WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", + "WorkspaceConnectionSharedAccessSignature", + "WorkspaceConnectionUsernamePassword", + "WorkspaceListResult", + "WorkspaceUpdateParameters", + "AllocationState", + "ApplicationSharingPolicy", + "AssetProvisioningState", + "AutoRebuildSetting", + "Autosave", + "BatchLoggingLevel", + "BatchOutputAction", + "BillingCurrency", + "BlockedTransformers", + "Caching", + "ClassificationModels", + "ClassificationMultilabelPrimaryMetrics", + "ClassificationPrimaryMetrics", + "ClusterPurpose", + "ComputeInstanceAuthorizationType", + "ComputeInstanceState", + "ComputePowerAction", + "ComputeType", + "ConnectionAuthType", + "ConnectionCategory", + "ContainerType", + "CreatedByType", + "CredentialsType", + "DataType", + "DatastoreType", + "DeploymentProvisioningState", + "DiagnoseResultLevel", + "DistributionType", + "EarlyTerminationPolicyType", + "EgressPublicNetworkAccessType", + "EncryptionStatus", + "EndpointAuthMode", + "EndpointComputeType", + "EndpointProvisioningState", + "EndpointServiceConnectionStatus", + "EnvironmentType", + "EnvironmentVariableType", + "FeatureLags", + "FeaturizationMode", + "ForecastHorizonMode", + "ForecastingModels", + "ForecastingPrimaryMetrics", + "Goal", + "IdentityConfigurationType", + "ImageType", + "InputDeliveryMode", + "InstanceSegmentationPrimaryMetrics", + "JobInputType", + "JobLimitsType", + "JobOutputType", + "JobStatus", + "JobType", + "KeyType", + "LearningRateScheduler", + "ListViewType", + "LoadBalancerType", + "LogVerbosity", + "ManagedServiceIdentityType", + "ModelSize", + "MountAction", + "MountState", + "NCrossValidationsMode", + "Network", + "NodeState", + "NodesValueType", + "ObjectDetectionPrimaryMetrics", + "OperatingSystemType", + "OperationName", + "OperationStatus", + "OperationTrigger", + "OrderString", + "OsType", + "OutputDeliveryMode", + "PendingUploadCredentialType", + "PendingUploadType", + "PrivateEndpointConnectionProvisioningState", + "PrivateEndpointServiceConnectionStatus", + "Protocol", + "ProvisioningState", + "ProvisioningStatus", + "PublicNetworkAccess", + "PublicNetworkAccessType", + "QuotaUnit", + "RandomSamplingAlgorithmRule", + "RecurrenceFrequency", + "ReferenceType", + "RegressionModels", + "RegressionPrimaryMetrics", + "RemoteLoginPortPublicAccess", + "SamplingAlgorithmType", + "ScaleType", + "ScheduleActionType", + "ScheduleListViewType", + "ScheduleProvisioningState", + "ScheduleProvisioningStatus", + "ScheduleStatus", + "SeasonalityMode", + "SecretsType", + "ServiceDataAccessAuthIdentity", + "ShortSeriesHandlingConfiguration", + "SkuScaleType", + "SkuTier", + "SourceType", + "SshPublicAccess", + "SslConfigStatus", + "StackMetaLearnerType", + "Status", + "StochasticOptimizer", + "StorageAccountType", + "TargetAggregationFunction", + "TargetLagsMode", + "TargetRollingWindowSizeMode", + "TaskType", + "TriggerType", + "UnderlyingResourceAction", + "UnitOfMeasure", + "UsageUnit", + "UseStl", + "VMPriceOSType", + "VMTier", + "ValidationMetricType", + "ValueFormat", + "VmPriority", + "VolumeDefinitionType", + "WeekDay", ] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/models/_azure_machine_learning_workspaces_enums.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/models/_azure_machine_learning_workspaces_enums.py index 2e5ba84277d8..23983f771bf4 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/models/_azure_machine_learning_workspaces_enums.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/models/_azure_machine_learning_workspaces_enums.py @@ -21,6 +21,7 @@ class AllocationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): STEADY = "Steady" RESIZING = "Resizing" + class ApplicationSharingPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Policy for sharing applications on this compute instance among users of parent workspace. If Personal, only the creator can access applications on this compute instance. When Shared, any @@ -30,9 +31,9 @@ class ApplicationSharingPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): PERSONAL = "Personal" SHARED = "Shared" + class AssetProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Provisioning state of registry asset. - """ + """Provisioning state of registry asset.""" SUCCEEDED = "Succeeded" FAILED = "Failed" @@ -41,21 +42,22 @@ class AssetProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): UPDATING = "Updating" DELETING = "Deleting" + class AutoRebuildSetting(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """AutoRebuild setting for the derived image - """ + """AutoRebuild setting for the derived image""" DISABLED = "Disabled" ON_BASE_IMAGE_UPDATE = "OnBaseImageUpdate" + class Autosave(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Auto save settings. - """ + """Auto save settings.""" NONE = "None" LOCAL = "Local" REMOTE = "Remote" + class BatchLoggingLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Log verbosity for batch inferencing. Increasing verbosity order for logging is : Warning, Info and Debug. @@ -66,22 +68,22 @@ class BatchLoggingLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): WARNING = "Warning" DEBUG = "Debug" + class BatchOutputAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine how batch inferencing will handle output - """ + """Enum to determine how batch inferencing will handle output""" SUMMARY_ONLY = "SummaryOnly" APPEND_ROW = "AppendRow" + class BillingCurrency(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Three lettered code specifying the currency of the VM price. Example: USD - """ + """Three lettered code specifying the currency of the VM price. Example: USD""" USD = "USD" + class BlockedTransformers(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum for all classification models supported by AutoML. - """ + """Enum for all classification models supported by AutoML.""" #: Target encoding for text data. TEXT_TARGET_ENCODER = "TextTargetEncoder" @@ -108,17 +110,17 @@ class BlockedTransformers(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: This is often used for high-cardinality categorical features. HASH_ONE_HOT_ENCODER = "HashOneHotEncoder" + class Caching(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Caching type of Data Disk. - """ + """Caching type of Data Disk.""" NONE = "None" READ_ONLY = "ReadOnly" READ_WRITE = "ReadWrite" + class ClassificationModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum for all classification models supported by AutoML. - """ + """Enum for all classification models supported by AutoML.""" #: Logistic regression is a fundamental classification technique. #: It belongs to the group of linear classifiers and is somewhat similar to polynomial and linear @@ -180,9 +182,11 @@ class ClassificationModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: target column values can be divided into distinct class values. XG_BOOST_CLASSIFIER = "XGBoostClassifier" -class ClassificationMultilabelPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for classification multilabel tasks. - """ + +class ClassificationMultilabelPrimaryMetrics( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """Primary metrics for classification multilabel tasks.""" #: AUC is the Area under the curve. #: This metric represents arithmetic mean of the score for each class, @@ -202,9 +206,11 @@ class ClassificationMultilabelPrimaryMetrics(str, Enum, metaclass=CaseInsensitiv #: Intersection Over Union. Intersection of predictions divided by union of predictions. IOU = "IOU" -class ClassificationPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for classification tasks. - """ + +class ClassificationPrimaryMetrics( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """Primary metrics for classification tasks.""" #: AUC is the Area under the curve. #: This metric represents arithmetic mean of the score for each class, @@ -222,23 +228,25 @@ class ClassificationPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta) #: class. PRECISION_SCORE_WEIGHTED = "PrecisionScoreWeighted" + class ClusterPurpose(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Intended usage of the cluster - """ + """Intended usage of the cluster""" FAST_PROD = "FastProd" DENSE_PROD = "DenseProd" DEV_TEST = "DevTest" -class ComputeInstanceAuthorizationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The Compute Instance Authorization type. Available values are personal (default). - """ + +class ComputeInstanceAuthorizationType( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """The Compute Instance Authorization type. Available values are personal (default).""" PERSONAL = "personal" + class ComputeInstanceState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Current state of an ComputeInstance. - """ + """Current state of an ComputeInstance.""" CREATING = "Creating" CREATE_FAILED = "CreateFailed" @@ -256,16 +264,16 @@ class ComputeInstanceState(str, Enum, metaclass=CaseInsensitiveEnumMeta): UNKNOWN = "Unknown" UNUSABLE = "Unusable" + class ComputePowerAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The compute power action. - """ + """The compute power action.""" START = "Start" STOP = "Stop" + class ComputeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of compute - """ + """The type of compute""" AKS = "AKS" KUBERNETES = "Kubernetes" @@ -278,9 +286,9 @@ class ComputeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): DATA_LAKE_ANALYTICS = "DataLakeAnalytics" SYNAPSE_SPARK = "SynapseSpark" + class ConnectionAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Authentication type of the connection target - """ + """Authentication type of the connection target""" PAT = "PAT" MANAGED_IDENTITY = "ManagedIdentity" @@ -288,31 +296,32 @@ class ConnectionAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): NONE = "None" SAS = "SAS" + class ConnectionCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Category of the connection - """ + """Category of the connection""" PYTHON_FEED = "PythonFeed" CONTAINER_REGISTRY = "ContainerRegistry" GIT = "Git" + class ContainerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): STORAGE_INITIALIZER = "StorageInitializer" INFERENCE_SERVER = "InferenceServer" + class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of identity that created the resource. - """ + """The type of identity that created the resource.""" USER = "User" APPLICATION = "Application" MANAGED_IDENTITY = "ManagedIdentity" KEY = "Key" + class CredentialsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the datastore credentials type. - """ + """Enum to determine the datastore credentials type.""" ACCOUNT_KEY = "AccountKey" CERTIFICATE = "Certificate" @@ -320,26 +329,28 @@ class CredentialsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): SAS = "Sas" SERVICE_PRINCIPAL = "ServicePrincipal" + class DatastoreType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the datastore contents type. - """ + """Enum to determine the datastore contents type.""" AZURE_BLOB = "AzureBlob" AZURE_DATA_LAKE_GEN1 = "AzureDataLakeGen1" AZURE_DATA_LAKE_GEN2 = "AzureDataLakeGen2" AZURE_FILE = "AzureFile" + class DataType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the type of data. - """ + """Enum to determine the type of data.""" URI_FILE = "uri_file" URI_FOLDER = "uri_folder" MLTABLE = "mltable" -class DeploymentProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Possible values for DeploymentProvisioningState. - """ + +class DeploymentProvisioningState( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """Possible values for DeploymentProvisioningState.""" CREATING = "Creating" DELETING = "Deleting" @@ -349,29 +360,33 @@ class DeploymentProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): FAILED = "Failed" CANCELED = "Canceled" + class DiagnoseResultLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Level of workspace setup error - """ + """Level of workspace setup error""" WARNING = "Warning" ERROR = "Error" INFORMATION = "Information" + class DistributionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the job distribution type. - """ + """Enum to determine the job distribution type.""" PY_TORCH = "PyTorch" TENSOR_FLOW = "TensorFlow" MPI = "Mpi" + class EarlyTerminationPolicyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): BANDIT = "Bandit" MEDIAN_STOPPING = "MedianStopping" TRUNCATION_SELECTION = "TruncationSelection" -class EgressPublicNetworkAccessType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + +class EgressPublicNetworkAccessType( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): """Enum to determine whether PublicNetworkAccess is Enabled or Disabled for egress of a deployment. """ @@ -379,32 +394,32 @@ class EgressPublicNetworkAccessType(str, Enum, metaclass=CaseInsensitiveEnumMeta ENABLED = "Enabled" DISABLED = "Disabled" + class EncryptionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates whether or not the encryption is enabled for the workspace. - """ + """Indicates whether or not the encryption is enabled for the workspace.""" ENABLED = "Enabled" DISABLED = "Disabled" + class EndpointAuthMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine endpoint authentication mode. - """ + """Enum to determine endpoint authentication mode.""" AML_TOKEN = "AMLToken" KEY = "Key" AAD_TOKEN = "AADToken" + class EndpointComputeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine endpoint compute type. - """ + """Enum to determine endpoint compute type.""" MANAGED = "Managed" KUBERNETES = "Kubernetes" AZURE_ML_COMPUTE = "AzureMLCompute" + class EndpointProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """State of endpoint provisioning. - """ + """State of endpoint provisioning.""" CREATING = "Creating" DELETING = "Deleting" @@ -413,40 +428,42 @@ class EndpointProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): UPDATING = "Updating" CANCELED = "Canceled" -class EndpointServiceConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Connection status of the service consumer with the service provider - """ + +class EndpointServiceConnectionStatus( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """Connection status of the service consumer with the service provider""" APPROVED = "Approved" PENDING = "Pending" REJECTED = "Rejected" DISCONNECTED = "Disconnected" + class EnvironmentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Environment type is either user created or curated by Azure ML service - """ + """Environment type is either user created or curated by Azure ML service""" CURATED = "Curated" USER_CREATED = "UserCreated" + class EnvironmentVariableType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the Environment Variable. Possible values are: local - For local variable - """ + """Type of the Environment Variable. Possible values are: local - For local variable""" LOCAL = "local" + class FeatureLags(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Flag for generating lags for the numeric features. - """ + """Flag for generating lags for the numeric features.""" #: No feature lags generated. NONE = "None" #: System auto-generates feature lags. AUTO = "Auto" + class FeaturizationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Featurization mode - determines data featurization mode. - """ + """Featurization mode - determines data featurization mode.""" #: Auto mode, system performs featurization without any custom featurization inputs. AUTO = "Auto" @@ -455,18 +472,18 @@ class FeaturizationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Featurization off. 'Forecasting' task cannot use this value. OFF = "Off" + class ForecastHorizonMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine forecast horizon selection mode. - """ + """Enum to determine forecast horizon selection mode.""" #: Forecast horizon to be determined automatically. AUTO = "Auto" #: Use the custom forecast horizon. CUSTOM = "Custom" + class ForecastingModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum for all forecasting models supported by AutoML. - """ + """Enum for all forecasting models supported by AutoML.""" #: Auto-Autoregressive Integrated Moving Average (ARIMA) model uses time-series data and #: statistical analysis to interpret the data and make future predictions. @@ -543,9 +560,9 @@ class ForecastingModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: using ensemble of base learners. XG_BOOST_REGRESSOR = "XGBoostRegressor" + class ForecastingPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for Forecasting task. - """ + """Primary metrics for Forecasting task.""" #: The Spearman's rank coefficient of correlation is a non-parametric measure of rank correlation. SPEARMAN_CORRELATION = "SpearmanCorrelation" @@ -559,21 +576,22 @@ class ForecastingPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Error (MAE) of (time) series with different scales. NORMALIZED_MEAN_ABSOLUTE_ERROR = "NormalizedMeanAbsoluteError" + class Goal(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Defines supported metric goals for hyperparameter tuning - """ + """Defines supported metric goals for hyperparameter tuning""" MINIMIZE = "Minimize" MAXIMIZE = "Maximize" + class IdentityConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine identity framework. - """ + """Enum to determine identity framework.""" MANAGED = "Managed" AML_TOKEN = "AMLToken" USER_IDENTITY = "UserIdentity" + class ImageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of the image. Possible values are: docker - For docker images. azureml - For AzureML images @@ -582,9 +600,9 @@ class ImageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): DOCKER = "docker" AZUREML = "azureml" + class InputDeliveryMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the input data delivery mode. - """ + """Enum to determine the input data delivery mode.""" READ_ONLY_MOUNT = "ReadOnlyMount" READ_WRITE_MOUNT = "ReadWriteMount" @@ -593,17 +611,19 @@ class InputDeliveryMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): EVAL_MOUNT = "EvalMount" EVAL_DOWNLOAD = "EvalDownload" -class InstanceSegmentationPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for InstanceSegmentation tasks. - """ + +class InstanceSegmentationPrimaryMetrics( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """Primary metrics for InstanceSegmentation tasks.""" #: Mean Average Precision (MAP) is the average of AP (Average Precision). #: AP is calculated for each class and averaged to get the MAP. MEAN_AVERAGE_PRECISION = "MeanAveragePrecision" + class JobInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the Job Input Type. - """ + """Enum to determine the Job Input Type.""" LITERAL = "literal" URI_FILE = "uri_file" @@ -613,14 +633,15 @@ class JobInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): MLFLOW_MODEL = "mlflow_model" TRITON_MODEL = "triton_model" + class JobLimitsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): COMMAND = "Command" SWEEP = "Sweep" + class JobOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the Job Output Type. - """ + """Enum to determine the Job Output Type.""" URI_FILE = "uri_file" URI_FOLDER = "uri_folder" @@ -629,9 +650,9 @@ class JobOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): MLFLOW_MODEL = "mlflow_model" TRITON_MODEL = "triton_model" + class JobStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The status of a job. - """ + """The status of a job.""" #: Run hasn't started yet. NOT_STARTED = "NotStarted" @@ -667,23 +688,24 @@ class JobStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Default job status if not mapped to all other statuses. UNKNOWN = "Unknown" + class JobType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the type of job. - """ + """Enum to determine the type of job.""" AUTO_ML = "AutoML" COMMAND = "Command" SWEEP = "Sweep" PIPELINE = "Pipeline" + class KeyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): PRIMARY = "Primary" SECONDARY = "Secondary" + class LearningRateScheduler(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Learning rate scheduler enum. - """ + """Learning rate scheduler enum.""" #: No learning rate scheduler selected. NONE = "None" @@ -692,22 +714,23 @@ class LearningRateScheduler(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Step learning rate scheduler. STEP = "Step" + class ListViewType(str, Enum, metaclass=CaseInsensitiveEnumMeta): ACTIVE_ONLY = "ActiveOnly" ARCHIVED_ONLY = "ArchivedOnly" ALL = "All" + class LoadBalancerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Load Balancer Type - """ + """Load Balancer Type""" PUBLIC_IP = "PublicIp" INTERNAL_LOAD_BALANCER = "InternalLoadBalancer" + class LogVerbosity(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum for setting log verbosity. - """ + """Enum for setting log verbosity.""" #: No logs emitted. NOT_SET = "NotSet" @@ -722,6 +745,7 @@ class LogVerbosity(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Only critical statements logged. CRITICAL = "Critical" + class ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). @@ -732,9 +756,9 @@ class ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): USER_ASSIGNED = "UserAssigned" SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" + class ModelSize(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Image model size. - """ + """Image model size.""" #: No value selected. NONE = "None" @@ -747,16 +771,16 @@ class ModelSize(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Extra large size. EXTRA_LARGE = "ExtraLarge" + class MountAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Mount Action. - """ + """Mount Action.""" MOUNT = "Mount" UNMOUNT = "Unmount" + class MountState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Mount state. - """ + """Mount state.""" MOUNT_REQUESTED = "MountRequested" MOUNTED = "Mounted" @@ -765,9 +789,9 @@ class MountState(str, Enum, metaclass=CaseInsensitiveEnumMeta): UNMOUNT_FAILED = "UnmountFailed" UNMOUNTED = "Unmounted" + class NCrossValidationsMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Determines how N-Cross validations value is determined. - """ + """Determines how N-Cross validations value is determined.""" #: Determine N-Cross validations value automatically. Supported only for 'Forecasting' AutoML #: task. @@ -775,13 +799,14 @@ class NCrossValidationsMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Use custom N-Cross validations value. CUSTOM = "Custom" + class Network(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """network of this container. - """ + """network of this container.""" BRIDGE = "Bridge" HOST = "Host" + class NodeState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """State of the compute node. Values are idle, running, preparing, unusable, leaving and preempted. @@ -794,30 +819,32 @@ class NodeState(str, Enum, metaclass=CaseInsensitiveEnumMeta): LEAVING = "leaving" PREEMPTED = "preempted" + class NodesValueType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The enumerated types for the nodes value - """ + """The enumerated types for the nodes value""" ALL = "All" -class ObjectDetectionPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for Image ObjectDetection task. - """ + +class ObjectDetectionPrimaryMetrics( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """Primary metrics for Image ObjectDetection task.""" #: Mean Average Precision (MAP) is the average of AP (Average Precision). #: AP is calculated for each class and averaged to get the MAP. MEAN_AVERAGE_PRECISION = "MeanAveragePrecision" + class OperatingSystemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of operating system. - """ + """The type of operating system.""" LINUX = "Linux" WINDOWS = "Windows" + class OperationName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Name of the last operation. - """ + """Name of the last operation.""" CREATE = "Create" START = "Start" @@ -826,9 +853,9 @@ class OperationName(str, Enum, metaclass=CaseInsensitiveEnumMeta): REIMAGE = "Reimage" DELETE = "Delete" + class OperationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Operation status. - """ + """Operation status.""" IN_PROGRESS = "InProgress" SUCCEEDED = "Succeeded" @@ -839,14 +866,15 @@ class OperationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): REIMAGE_FAILED = "ReimageFailed" DELETE_FAILED = "DeleteFailed" + class OperationTrigger(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Trigger of operation. - """ + """Trigger of operation.""" USER = "User" SCHEDULE = "Schedule" IDLE_SHUTDOWN = "IdleShutdown" + class OrderString(str, Enum, metaclass=CaseInsensitiveEnumMeta): CREATED_AT_DESC = "CreatedAtDesc" @@ -854,45 +882,51 @@ class OrderString(str, Enum, metaclass=CaseInsensitiveEnumMeta): UPDATED_AT_DESC = "UpdatedAtDesc" UPDATED_AT_ASC = "UpdatedAtAsc" + class OsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Compute OS Type - """ + """Compute OS Type""" LINUX = "Linux" WINDOWS = "Windows" + class OutputDeliveryMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Output data delivery mode enums. - """ + """Output data delivery mode enums.""" READ_WRITE_MOUNT = "ReadWriteMount" UPLOAD = "Upload" -class PendingUploadCredentialType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the PendingUpload credentials type. - """ + +class PendingUploadCredentialType( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """Enum to determine the PendingUpload credentials type.""" SAS = "SAS" + class PendingUploadType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of storage to use for the pending upload location - """ + """Type of storage to use for the pending upload location""" NONE = "None" TEMPORARY_BLOB_REFERENCE = "TemporaryBlobReference" -class PrivateEndpointConnectionProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The current provisioning state. - """ + +class PrivateEndpointConnectionProvisioningState( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """The current provisioning state.""" SUCCEEDED = "Succeeded" CREATING = "Creating" DELETING = "Deleting" FAILED = "Failed" -class PrivateEndpointServiceConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The private endpoint connection status. - """ + +class PrivateEndpointServiceConnectionStatus( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """The private endpoint connection status.""" PENDING = "Pending" APPROVED = "Approved" @@ -900,14 +934,15 @@ class PrivateEndpointServiceConnectionStatus(str, Enum, metaclass=CaseInsensitiv DISCONNECTED = "Disconnected" TIMEOUT = "Timeout" + class Protocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Protocol over which communication will happen over this endpoint - """ + """Protocol over which communication will happen over this endpoint""" TCP = "tcp" UDP = "udp" HTTP = "http" + class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The current deployment state of workspace resource. The provisioningState is to indicate states for resource provisioning. @@ -921,44 +956,46 @@ class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): FAILED = "Failed" CANCELED = "Canceled" + class ProvisioningStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The current deployment state of schedule. - """ + """The current deployment state of schedule.""" COMPLETED = "Completed" PROVISIONING = "Provisioning" FAILED = "Failed" + class PublicNetworkAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Whether requests from Public Network are allowed. - """ + """Whether requests from Public Network are allowed.""" ENABLED = "Enabled" DISABLED = "Disabled" + class PublicNetworkAccessType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine whether PublicNetworkAccess is Enabled or Disabled. - """ + """Enum to determine whether PublicNetworkAccess is Enabled or Disabled.""" ENABLED = "Enabled" DISABLED = "Disabled" + class QuotaUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """An enum describing the unit of quota measurement. - """ + """An enum describing the unit of quota measurement.""" COUNT = "Count" -class RandomSamplingAlgorithmRule(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The specific type of random algorithm - """ + +class RandomSamplingAlgorithmRule( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """The specific type of random algorithm""" RANDOM = "Random" SOBOL = "Sobol" + class RecurrenceFrequency(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to describe the frequency of a recurrence schedule - """ + """Enum to describe the frequency of a recurrence schedule""" #: Minute frequency. MINUTE = "Minute" @@ -971,17 +1008,17 @@ class RecurrenceFrequency(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Month frequency. MONTH = "Month" + class ReferenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine which reference method to use for an asset. - """ + """Enum to determine which reference method to use for an asset.""" ID = "Id" DATA_PATH = "DataPath" OUTPUT_PATH = "OutputPath" + class RegressionModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum for all Regression models supported by AutoML. - """ + """Enum for all Regression models supported by AutoML.""" #: Elastic net is a popular type of regularized linear regression that combines two popular #: penalties, specifically the L1 and L2 penalty functions. @@ -1023,9 +1060,9 @@ class RegressionModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: using ensemble of base learners. XG_BOOST_REGRESSOR = "XGBoostRegressor" + class RegressionPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for Regression task. - """ + """Primary metrics for Regression task.""" #: The Spearman's rank coefficient of correlation is a nonparametric measure of rank correlation. SPEARMAN_CORRELATION = "SpearmanCorrelation" @@ -1039,7 +1076,10 @@ class RegressionPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Error (MAE) of (time) series with different scales. NORMALIZED_MEAN_ABSOLUTE_ERROR = "NormalizedMeanAbsoluteError" -class RemoteLoginPortPublicAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): + +class RemoteLoginPortPublicAccess( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): """State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - Indicates that the public ssh port is closed @@ -1052,36 +1092,41 @@ class RemoteLoginPortPublicAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): DISABLED = "Disabled" NOT_SPECIFIED = "NotSpecified" + class SamplingAlgorithmType(str, Enum, metaclass=CaseInsensitiveEnumMeta): GRID = "Grid" RANDOM = "Random" BAYESIAN = "Bayesian" + class ScaleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): DEFAULT = "Default" TARGET_UTILIZATION = "TargetUtilization" + class ScheduleActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): CREATE_JOB = "CreateJob" INVOKE_BATCH_ENDPOINT = "InvokeBatchEndpoint" + class ScheduleListViewType(str, Enum, metaclass=CaseInsensitiveEnumMeta): ENABLED_ONLY = "EnabledOnly" DISABLED_ONLY = "DisabledOnly" ALL = "All" + class ScheduleProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The current deployment state of schedule. - """ + """The current deployment state of schedule.""" COMPLETED = "Completed" PROVISIONING = "Provisioning" FAILED = "Failed" + class ScheduleProvisioningStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): CREATING = "Creating" @@ -1091,32 +1136,35 @@ class ScheduleProvisioningStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): FAILED = "Failed" CANCELED = "Canceled" + class ScheduleStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Is the schedule enabled or disabled? - """ + """Is the schedule enabled or disabled?""" ENABLED = "Enabled" DISABLED = "Disabled" + class SeasonalityMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Forecasting seasonality mode. - """ + """Forecasting seasonality mode.""" #: Seasonality to be determined automatically. AUTO = "Auto" #: Use the custom seasonality value. CUSTOM = "Custom" + class SecretsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the datastore secrets type. - """ + """Enum to determine the datastore secrets type.""" ACCOUNT_KEY = "AccountKey" CERTIFICATE = "Certificate" SAS = "Sas" SERVICE_PRINCIPAL = "ServicePrincipal" -class ServiceDataAccessAuthIdentity(str, Enum, metaclass=CaseInsensitiveEnumMeta): + +class ServiceDataAccessAuthIdentity( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): #: Do not use any identity for service data access. NONE = "None" @@ -1125,9 +1173,11 @@ class ServiceDataAccessAuthIdentity(str, Enum, metaclass=CaseInsensitiveEnumMeta #: Use the user assigned managed identity of the Workspace to authenticate service data access. WORKSPACE_USER_ASSIGNED_IDENTITY = "WorkspaceUserAssignedIdentity" -class ShortSeriesHandlingConfiguration(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The parameter defining how if AutoML should handle short time series. - """ + +class ShortSeriesHandlingConfiguration( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """The parameter defining how if AutoML should handle short time series.""" #: Represents no/null value. NONE = "None" @@ -1139,9 +1189,9 @@ class ShortSeriesHandlingConfiguration(str, Enum, metaclass=CaseInsensitiveEnumM #: All the short series will be dropped. DROP = "Drop" + class SkuScaleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Node scaling setting for the compute sku. - """ + """Node scaling setting for the compute sku.""" #: Automatically scales node count. AUTOMATIC = "Automatic" @@ -1150,6 +1200,7 @@ class SkuScaleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Fixed set of nodes. NONE = "None" + class SkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): """This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT. @@ -1160,14 +1211,15 @@ class SkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): STANDARD = "Standard" PREMIUM = "Premium" + class SourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Data source type. - """ + """Data source type.""" DATASET = "Dataset" DATASTORE = "Datastore" URI = "URI" + class SshPublicAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): """State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the public ssh port is open and @@ -1177,14 +1229,15 @@ class SshPublicAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): ENABLED = "Enabled" DISABLED = "Disabled" + class SslConfigStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enable or disable ssl for scoring - """ + """Enable or disable ssl for scoring""" DISABLED = "Disabled" ENABLED = "Enabled" AUTO = "Auto" + class StackMetaLearnerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The meta-learner is a model trained on the output of the individual heterogeneous models. Default meta-learners are LogisticRegression for classification tasks (or LogisticRegressionCV @@ -1207,22 +1260,24 @@ class StackMetaLearnerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): LIGHT_GBM_REGRESSOR = "LightGBMRegressor" LINEAR_REGRESSION = "LinearRegression" + class Status(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Status of update workspace quota. - """ + """Status of update workspace quota.""" UNDEFINED = "Undefined" SUCCESS = "Success" FAILURE = "Failure" INVALID_QUOTA_BELOW_CLUSTER_MINIMUM = "InvalidQuotaBelowClusterMinimum" - INVALID_QUOTA_EXCEEDS_SUBSCRIPTION_LIMIT = "InvalidQuotaExceedsSubscriptionLimit" + INVALID_QUOTA_EXCEEDS_SUBSCRIPTION_LIMIT = ( + "InvalidQuotaExceedsSubscriptionLimit" + ) INVALID_VM_FAMILY_NAME = "InvalidVMFamilyName" OPERATION_NOT_SUPPORTED_FOR_SKU = "OperationNotSupportedForSku" OPERATION_NOT_ENABLED_FOR_REGION = "OperationNotEnabledForRegion" + class StochasticOptimizer(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Stochastic optimizer for image models. - """ + """Stochastic optimizer for image models.""" #: No optimizer selected. NONE = "None" @@ -1234,16 +1289,16 @@ class StochasticOptimizer(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: AdamW is a variant of the optimizer Adam that has an improved implementation of weight decay. ADAMW = "Adamw" + class StorageAccountType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """type of this storage account. - """ + """type of this storage account.""" STANDARD_LRS = "Standard_LRS" PREMIUM_LRS = "Premium_LRS" + class TargetAggregationFunction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Target aggregate function. - """ + """Target aggregate function.""" #: Represent no value set. NONE = "None" @@ -1252,27 +1307,29 @@ class TargetAggregationFunction(str, Enum, metaclass=CaseInsensitiveEnumMeta): MIN = "Min" MEAN = "Mean" + class TargetLagsMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Target lags selection modes. - """ + """Target lags selection modes.""" #: Target lags to be determined automatically. AUTO = "Auto" #: Use the custom target lags. CUSTOM = "Custom" -class TargetRollingWindowSizeMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Target rolling windows size mode. - """ + +class TargetRollingWindowSizeMode( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """Target rolling windows size mode.""" #: Determine rolling windows size automatically. AUTO = "Auto" #: Use the specified rolling window size. CUSTOM = "Custom" + class TaskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """AutoMLJob Task type. - """ + """AutoMLJob Task type.""" #: Classification in machine learning and statistics is a supervised learning approach in which #: the computer program learns from the data given to it and make new observations or @@ -1313,40 +1370,42 @@ class TaskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: occurrences of entities such as people, locations, organizations, and more. TEXT_NER = "TextNER" + class TriggerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): RECURRENCE = "Recurrence" CRON = "Cron" + class UnderlyingResourceAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): DELETE = "Delete" DETACH = "Detach" + class UnitOfMeasure(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The unit of time measurement for the specified VM price. Example: OneHour - """ + """The unit of time measurement for the specified VM price. Example: OneHour""" ONE_HOUR = "OneHour" + class UsageUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """An enum describing the unit of usage measurement. - """ + """An enum describing the unit of usage measurement.""" COUNT = "Count" + class UseStl(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Configure STL Decomposition of the time-series target column. - """ + """Configure STL Decomposition of the time-series target column.""" #: No stl decomposition. NONE = "None" SEASON = "Season" SEASON_TREND = "SeasonTrend" + class ValidationMetricType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Metric computation method to use for validation metrics in image tasks. - """ + """Metric computation method to use for validation metrics in image tasks.""" #: No metric. NONE = "None" @@ -1357,46 +1416,46 @@ class ValidationMetricType(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: CocoVoc metric. COCO_VOC = "CocoVoc" + class ValueFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """format for the workspace connection value - """ + """format for the workspace connection value""" JSON = "JSON" + class VMPriceOSType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Operating system type used by the VM. - """ + """Operating system type used by the VM.""" LINUX = "Linux" WINDOWS = "Windows" + class VmPriority(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Virtual Machine priority - """ + """Virtual Machine priority""" DEDICATED = "Dedicated" LOW_PRIORITY = "LowPriority" + class VMTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of the VM. - """ + """The type of the VM.""" STANDARD = "Standard" LOW_PRIORITY = "LowPriority" SPOT = "Spot" + class VolumeDefinitionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe - """ + """Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe""" BIND = "bind" VOLUME = "volume" TMPFS = "tmpfs" NPIPE = "npipe" + class WeekDay(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum of weekday - """ + """Enum of weekday""" #: Monday weekday. MONDAY = "Monday" diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/models/_models.py index 99ab08757dd7..38de0a56e91d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/models/_models.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/models/_models.py @@ -25,23 +25,25 @@ class DatastoreCredentials(msrest.serialization.Model): """ _validation = { - 'credentials_type': {'required': True}, + "credentials_type": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, } _subtype_map = { - 'credentials_type': {'AccountKey': 'AccountKeyDatastoreCredentials', 'Certificate': 'CertificateDatastoreCredentials', 'None': 'NoneDatastoreCredentials', 'Sas': 'SasDatastoreCredentials', 'ServicePrincipal': 'ServicePrincipalDatastoreCredentials'} + "credentials_type": { + "AccountKey": "AccountKeyDatastoreCredentials", + "Certificate": "CertificateDatastoreCredentials", + "None": "NoneDatastoreCredentials", + "Sas": "SasDatastoreCredentials", + "ServicePrincipal": "ServicePrincipalDatastoreCredentials", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DatastoreCredentials, self).__init__(**kwargs) self.credentials_type = None # type: Optional[str] @@ -60,26 +62,23 @@ class AccountKeyDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, + "credentials_type": {"required": True}, + "secrets": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'AccountKeyDatastoreSecrets'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "secrets": {"key": "secrets", "type": "AccountKeyDatastoreSecrets"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword secrets: Required. [Required] Storage account secrets. :paramtype secrets: ~azure.mgmt.machinelearningservices.models.AccountKeyDatastoreSecrets """ super(AccountKeyDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'AccountKey' # type: str - self.secrets = kwargs['secrets'] + self.credentials_type = "AccountKey" # type: str + self.secrets = kwargs["secrets"] class DatastoreSecrets(msrest.serialization.Model): @@ -97,23 +96,24 @@ class DatastoreSecrets(msrest.serialization.Model): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, } _subtype_map = { - 'secrets_type': {'AccountKey': 'AccountKeyDatastoreSecrets', 'Certificate': 'CertificateDatastoreSecrets', 'Sas': 'SasDatastoreSecrets', 'ServicePrincipal': 'ServicePrincipalDatastoreSecrets'} + "secrets_type": { + "AccountKey": "AccountKeyDatastoreSecrets", + "Certificate": "CertificateDatastoreSecrets", + "Sas": "SasDatastoreSecrets", + "ServicePrincipal": "ServicePrincipalDatastoreSecrets", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DatastoreSecrets, self).__init__(**kwargs) self.secrets_type = None # type: Optional[str] @@ -132,25 +132,22 @@ class AccountKeyDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "key": {"key": "key", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword key: Storage account key. :paramtype key: str """ super(AccountKeyDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'AccountKey' # type: str - self.key = kwargs.get('key', None) + self.secrets_type = "AccountKey" # type: str + self.key = kwargs.get("key", None) class AcrDetails(msrest.serialization.Model): @@ -167,14 +164,17 @@ class AcrDetails(msrest.serialization.Model): """ _attribute_map = { - 'system_created_acr_account': {'key': 'systemCreatedAcrAccount', 'type': 'SystemCreatedAcrAccount'}, - 'user_created_acr_account': {'key': 'userCreatedAcrAccount', 'type': 'UserCreatedAcrAccount'}, + "system_created_acr_account": { + "key": "systemCreatedAcrAccount", + "type": "SystemCreatedAcrAccount", + }, + "user_created_acr_account": { + "key": "userCreatedAcrAccount", + "type": "UserCreatedAcrAccount", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword system_created_acr_account: Details of system created ACR account to be used for the Registry. @@ -186,8 +186,12 @@ def __init__( ~azure.mgmt.machinelearningservices.models.UserCreatedAcrAccount """ super(AcrDetails, self).__init__(**kwargs) - self.system_created_acr_account = kwargs.get('system_created_acr_account', None) - self.user_created_acr_account = kwargs.get('user_created_acr_account', None) + self.system_created_acr_account = kwargs.get( + "system_created_acr_account", None + ) + self.user_created_acr_account = kwargs.get( + "user_created_acr_account", None + ) class AKSSchema(msrest.serialization.Model): @@ -198,19 +202,16 @@ class AKSSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, + "properties": {"key": "properties", "type": "AKSSchemaProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: AKS properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties """ super(AKSSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class Compute(msrest.serialization.Model): @@ -253,35 +254,46 @@ class Compute(msrest.serialization.Model): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + } + + _attribute_map = { + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } _subtype_map = { - 'compute_type': {'AKS': 'AKS', 'AmlCompute': 'AmlCompute', 'ComputeInstance': 'ComputeInstance', 'DataFactory': 'DataFactory', 'DataLakeAnalytics': 'DataLakeAnalytics', 'Databricks': 'Databricks', 'HDInsight': 'HDInsight', 'Kubernetes': 'Kubernetes', 'SynapseSpark': 'SynapseSpark', 'VirtualMachine': 'VirtualMachine'} - } - - def __init__( - self, - **kwargs - ): + "compute_type": { + "AKS": "AKS", + "AmlCompute": "AmlCompute", + "ComputeInstance": "ComputeInstance", + "DataFactory": "DataFactory", + "DataLakeAnalytics": "DataLakeAnalytics", + "Databricks": "Databricks", + "HDInsight": "HDInsight", + "Kubernetes": "Kubernetes", + "SynapseSpark": "SynapseSpark", + "VirtualMachine": "VirtualMachine", + } + } + + def __init__(self, **kwargs): """ :keyword compute_location: Location for the underlying compute. :paramtype compute_location: str @@ -295,15 +307,15 @@ def __init__( """ super(Compute, self).__init__(**kwargs) self.compute_type = None # type: Optional[str] - self.compute_location = kwargs.get('compute_location', None) + self.compute_location = kwargs.get("compute_location", None) self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) + self.disable_local_auth = kwargs.get("disable_local_auth", None) class AKS(Compute, AKSSchema): @@ -345,32 +357,32 @@ class AKS(Compute, AKSSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "AKSSchemaProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: AKS properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties @@ -385,17 +397,17 @@ def __init__( :paramtype disable_local_auth: bool """ super(AKS, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'AKS' # type: str - self.compute_location = kwargs.get('compute_location', None) + self.properties = kwargs.get("properties", None) + self.compute_type = "AKS" # type: str + self.compute_location = kwargs.get("compute_location", None) self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) + self.disable_local_auth = kwargs.get("disable_local_auth", None) class AksComputeSecretsProperties(msrest.serialization.Model): @@ -412,15 +424,15 @@ class AksComputeSecretsProperties(msrest.serialization.Model): """ _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, + "user_kube_config": {"key": "userKubeConfig", "type": "str"}, + "admin_kube_config": {"key": "adminKubeConfig", "type": "str"}, + "image_pull_secret_name": { + "key": "imagePullSecretName", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword user_kube_config: Content of kubeconfig file that can be used to connect to the Kubernetes cluster. @@ -432,9 +444,11 @@ def __init__( :paramtype image_pull_secret_name: str """ super(AksComputeSecretsProperties, self).__init__(**kwargs) - self.user_kube_config = kwargs.get('user_kube_config', None) - self.admin_kube_config = kwargs.get('admin_kube_config', None) - self.image_pull_secret_name = kwargs.get('image_pull_secret_name', None) + self.user_kube_config = kwargs.get("user_kube_config", None) + self.admin_kube_config = kwargs.get("admin_kube_config", None) + self.image_pull_secret_name = kwargs.get( + "image_pull_secret_name", None + ) class ComputeSecrets(msrest.serialization.Model): @@ -452,23 +466,23 @@ class ComputeSecrets(msrest.serialization.Model): """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "compute_type": {"key": "computeType", "type": "str"}, } _subtype_map = { - 'compute_type': {'AKS': 'AksComputeSecrets', 'Databricks': 'DatabricksComputeSecrets', 'VirtualMachine': 'VirtualMachineSecrets'} + "compute_type": { + "AKS": "AksComputeSecrets", + "Databricks": "DatabricksComputeSecrets", + "VirtualMachine": "VirtualMachineSecrets", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ComputeSecrets, self).__init__(**kwargs) self.compute_type = None # type: Optional[str] @@ -493,20 +507,20 @@ class AksComputeSecrets(ComputeSecrets, AksComputeSecretsProperties): """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "user_kube_config": {"key": "userKubeConfig", "type": "str"}, + "admin_kube_config": {"key": "adminKubeConfig", "type": "str"}, + "image_pull_secret_name": { + "key": "imagePullSecretName", + "type": "str", + }, + "compute_type": {"key": "computeType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword user_kube_config: Content of kubeconfig file that can be used to connect to the Kubernetes cluster. @@ -518,10 +532,12 @@ def __init__( :paramtype image_pull_secret_name: str """ super(AksComputeSecrets, self).__init__(**kwargs) - self.user_kube_config = kwargs.get('user_kube_config', None) - self.admin_kube_config = kwargs.get('admin_kube_config', None) - self.image_pull_secret_name = kwargs.get('image_pull_secret_name', None) - self.compute_type = 'AKS' # type: str + self.user_kube_config = kwargs.get("user_kube_config", None) + self.admin_kube_config = kwargs.get("admin_kube_config", None) + self.image_pull_secret_name = kwargs.get( + "image_pull_secret_name", None + ) + self.compute_type = "AKS" # type: str class AksNetworkingConfiguration(msrest.serialization.Model): @@ -541,22 +557,25 @@ class AksNetworkingConfiguration(msrest.serialization.Model): """ _validation = { - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, + "service_cidr": { + "pattern": r"^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$" + }, + "dns_service_ip": { + "pattern": r"^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" + }, + "docker_bridge_cidr": { + "pattern": r"^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$" + }, } _attribute_map = { - 'subnet_id': {'key': 'subnetId', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, + "subnet_id": {"key": "subnetId", "type": "str"}, + "service_cidr": {"key": "serviceCidr", "type": "str"}, + "dns_service_ip": {"key": "dnsServiceIP", "type": "str"}, + "docker_bridge_cidr": {"key": "dockerBridgeCidr", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword subnet_id: Virtual network subnet resource ID the compute nodes belong to. :paramtype subnet_id: str @@ -571,10 +590,10 @@ def __init__( :paramtype docker_bridge_cidr: str """ super(AksNetworkingConfiguration, self).__init__(**kwargs) - self.subnet_id = kwargs.get('subnet_id', None) - self.service_cidr = kwargs.get('service_cidr', None) - self.dns_service_ip = kwargs.get('dns_service_ip', None) - self.docker_bridge_cidr = kwargs.get('docker_bridge_cidr', None) + self.subnet_id = kwargs.get("subnet_id", None) + self.service_cidr = kwargs.get("service_cidr", None) + self.dns_service_ip = kwargs.get("dns_service_ip", None) + self.docker_bridge_cidr = kwargs.get("docker_bridge_cidr", None) class AKSSchemaProperties(msrest.serialization.Model): @@ -606,26 +625,32 @@ class AKSSchemaProperties(msrest.serialization.Model): """ _validation = { - 'system_services': {'readonly': True}, - 'agent_count': {'minimum': 0}, + "system_services": {"readonly": True}, + "agent_count": {"minimum": 0}, } _attribute_map = { - 'cluster_fqdn': {'key': 'clusterFqdn', 'type': 'str'}, - 'system_services': {'key': 'systemServices', 'type': '[SystemService]'}, - 'agent_count': {'key': 'agentCount', 'type': 'int'}, - 'agent_vm_size': {'key': 'agentVmSize', 'type': 'str'}, - 'cluster_purpose': {'key': 'clusterPurpose', 'type': 'str'}, - 'ssl_configuration': {'key': 'sslConfiguration', 'type': 'SslConfiguration'}, - 'aks_networking_configuration': {'key': 'aksNetworkingConfiguration', 'type': 'AksNetworkingConfiguration'}, - 'load_balancer_type': {'key': 'loadBalancerType', 'type': 'str'}, - 'load_balancer_subnet': {'key': 'loadBalancerSubnet', 'type': 'str'}, + "cluster_fqdn": {"key": "clusterFqdn", "type": "str"}, + "system_services": { + "key": "systemServices", + "type": "[SystemService]", + }, + "agent_count": {"key": "agentCount", "type": "int"}, + "agent_vm_size": {"key": "agentVmSize", "type": "str"}, + "cluster_purpose": {"key": "clusterPurpose", "type": "str"}, + "ssl_configuration": { + "key": "sslConfiguration", + "type": "SslConfiguration", + }, + "aks_networking_configuration": { + "key": "aksNetworkingConfiguration", + "type": "AksNetworkingConfiguration", + }, + "load_balancer_type": {"key": "loadBalancerType", "type": "str"}, + "load_balancer_subnet": {"key": "loadBalancerSubnet", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword cluster_fqdn: Cluster full qualified domain name. :paramtype cluster_fqdn: str @@ -649,15 +674,17 @@ def __init__( :paramtype load_balancer_subnet: str """ super(AKSSchemaProperties, self).__init__(**kwargs) - self.cluster_fqdn = kwargs.get('cluster_fqdn', None) + self.cluster_fqdn = kwargs.get("cluster_fqdn", None) self.system_services = None - self.agent_count = kwargs.get('agent_count', None) - self.agent_vm_size = kwargs.get('agent_vm_size', None) - self.cluster_purpose = kwargs.get('cluster_purpose', "FastProd") - self.ssl_configuration = kwargs.get('ssl_configuration', None) - self.aks_networking_configuration = kwargs.get('aks_networking_configuration', None) - self.load_balancer_type = kwargs.get('load_balancer_type', "PublicIp") - self.load_balancer_subnet = kwargs.get('load_balancer_subnet', None) + self.agent_count = kwargs.get("agent_count", None) + self.agent_vm_size = kwargs.get("agent_vm_size", None) + self.cluster_purpose = kwargs.get("cluster_purpose", "FastProd") + self.ssl_configuration = kwargs.get("ssl_configuration", None) + self.aks_networking_configuration = kwargs.get( + "aks_networking_configuration", None + ) + self.load_balancer_type = kwargs.get("load_balancer_type", "PublicIp") + self.load_balancer_subnet = kwargs.get("load_balancer_subnet", None) class Nodes(msrest.serialization.Model): @@ -674,23 +701,17 @@ class Nodes(msrest.serialization.Model): """ _validation = { - 'nodes_value_type': {'required': True}, + "nodes_value_type": {"required": True}, } _attribute_map = { - 'nodes_value_type': {'key': 'nodesValueType', 'type': 'str'}, + "nodes_value_type": {"key": "nodesValueType", "type": "str"}, } - _subtype_map = { - 'nodes_value_type': {'All': 'AllNodes'} - } + _subtype_map = {"nodes_value_type": {"All": "AllNodes"}} - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Nodes, self).__init__(**kwargs) self.nodes_value_type = None # type: Optional[str] @@ -706,21 +727,17 @@ class AllNodes(Nodes): """ _validation = { - 'nodes_value_type': {'required': True}, + "nodes_value_type": {"required": True}, } _attribute_map = { - 'nodes_value_type': {'key': 'nodesValueType', 'type': 'str'}, + "nodes_value_type": {"key": "nodesValueType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AllNodes, self).__init__(**kwargs) - self.nodes_value_type = 'All' # type: str + self.nodes_value_type = "All" # type: str class AmlComputeSchema(msrest.serialization.Model): @@ -731,19 +748,16 @@ class AmlComputeSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, + "properties": {"key": "properties", "type": "AmlComputeProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of AmlCompute. :paramtype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties """ super(AmlComputeSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class AmlCompute(Compute, AmlComputeSchema): @@ -785,32 +799,32 @@ class AmlCompute(Compute, AmlComputeSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "AmlComputeProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of AmlCompute. :paramtype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties @@ -825,17 +839,17 @@ def __init__( :paramtype disable_local_auth: bool """ super(AmlCompute, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'AmlCompute' # type: str - self.compute_location = kwargs.get('compute_location', None) + self.properties = kwargs.get("properties", None) + self.compute_type = "AmlCompute" # type: str + self.compute_location = kwargs.get("compute_location", None) self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) + self.disable_local_auth = kwargs.get("disable_local_auth", None) class AmlComputeNodeInformation(msrest.serialization.Model): @@ -860,29 +874,25 @@ class AmlComputeNodeInformation(msrest.serialization.Model): """ _validation = { - 'node_id': {'readonly': True}, - 'private_ip_address': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'port': {'readonly': True}, - 'node_state': {'readonly': True}, - 'run_id': {'readonly': True}, + "node_id": {"readonly": True}, + "private_ip_address": {"readonly": True}, + "public_ip_address": {"readonly": True}, + "port": {"readonly": True}, + "node_state": {"readonly": True}, + "run_id": {"readonly": True}, } _attribute_map = { - 'node_id': {'key': 'nodeId', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'node_state': {'key': 'nodeState', 'type': 'str'}, - 'run_id': {'key': 'runId', 'type': 'str'}, + "node_id": {"key": "nodeId", "type": "str"}, + "private_ip_address": {"key": "privateIpAddress", "type": "str"}, + "public_ip_address": {"key": "publicIpAddress", "type": "str"}, + "port": {"key": "port", "type": "int"}, + "node_state": {"key": "nodeState", "type": "str"}, + "run_id": {"key": "runId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AmlComputeNodeInformation, self).__init__(**kwargs) self.node_id = None self.private_ip_address = None @@ -904,21 +914,17 @@ class AmlComputeNodesInformation(msrest.serialization.Model): """ _validation = { - 'nodes': {'readonly': True}, - 'next_link': {'readonly': True}, + "nodes": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'nodes': {'key': 'nodes', 'type': '[AmlComputeNodeInformation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "nodes": {"key": "nodes", "type": "[AmlComputeNodeInformation]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AmlComputeNodesInformation, self).__init__(**kwargs) self.nodes = None self.next_link = None @@ -989,38 +995,50 @@ class AmlComputeProperties(msrest.serialization.Model): """ _validation = { - 'allocation_state': {'readonly': True}, - 'allocation_state_transition_time': {'readonly': True}, - 'errors': {'readonly': True}, - 'current_node_count': {'readonly': True}, - 'target_node_count': {'readonly': True}, - 'node_state_counts': {'readonly': True}, - } - - _attribute_map = { - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'vm_priority': {'key': 'vmPriority', 'type': 'str'}, - 'virtual_machine_image': {'key': 'virtualMachineImage', 'type': 'VirtualMachineImage'}, - 'isolated_network': {'key': 'isolatedNetwork', 'type': 'bool'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, - 'user_account_credentials': {'key': 'userAccountCredentials', 'type': 'UserAccountCredentials'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'remote_login_port_public_access': {'key': 'remoteLoginPortPublicAccess', 'type': 'str'}, - 'allocation_state': {'key': 'allocationState', 'type': 'str'}, - 'allocation_state_transition_time': {'key': 'allocationStateTransitionTime', 'type': 'iso-8601'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'current_node_count': {'key': 'currentNodeCount', 'type': 'int'}, - 'target_node_count': {'key': 'targetNodeCount', 'type': 'int'}, - 'node_state_counts': {'key': 'nodeStateCounts', 'type': 'NodeStateCounts'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'property_bag': {'key': 'propertyBag', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): + "allocation_state": {"readonly": True}, + "allocation_state_transition_time": {"readonly": True}, + "errors": {"readonly": True}, + "current_node_count": {"readonly": True}, + "target_node_count": {"readonly": True}, + "node_state_counts": {"readonly": True}, + } + + _attribute_map = { + "os_type": {"key": "osType", "type": "str"}, + "vm_size": {"key": "vmSize", "type": "str"}, + "vm_priority": {"key": "vmPriority", "type": "str"}, + "virtual_machine_image": { + "key": "virtualMachineImage", + "type": "VirtualMachineImage", + }, + "isolated_network": {"key": "isolatedNetwork", "type": "bool"}, + "scale_settings": {"key": "scaleSettings", "type": "ScaleSettings"}, + "user_account_credentials": { + "key": "userAccountCredentials", + "type": "UserAccountCredentials", + }, + "subnet": {"key": "subnet", "type": "ResourceId"}, + "remote_login_port_public_access": { + "key": "remoteLoginPortPublicAccess", + "type": "str", + }, + "allocation_state": {"key": "allocationState", "type": "str"}, + "allocation_state_transition_time": { + "key": "allocationStateTransitionTime", + "type": "iso-8601", + }, + "errors": {"key": "errors", "type": "[ErrorResponse]"}, + "current_node_count": {"key": "currentNodeCount", "type": "int"}, + "target_node_count": {"key": "targetNodeCount", "type": "int"}, + "node_state_counts": { + "key": "nodeStateCounts", + "type": "NodeStateCounts", + }, + "enable_node_public_ip": {"key": "enableNodePublicIp", "type": "bool"}, + "property_bag": {"key": "propertyBag", "type": "object"}, + } + + def __init__(self, **kwargs): """ :keyword os_type: Compute OS Type. Possible values include: "Linux", "Windows". Default value: "Linux". @@ -1061,23 +1079,27 @@ def __init__( :paramtype property_bag: any """ super(AmlComputeProperties, self).__init__(**kwargs) - self.os_type = kwargs.get('os_type', "Linux") - self.vm_size = kwargs.get('vm_size', None) - self.vm_priority = kwargs.get('vm_priority', None) - self.virtual_machine_image = kwargs.get('virtual_machine_image', None) - self.isolated_network = kwargs.get('isolated_network', None) - self.scale_settings = kwargs.get('scale_settings', None) - self.user_account_credentials = kwargs.get('user_account_credentials', None) - self.subnet = kwargs.get('subnet', None) - self.remote_login_port_public_access = kwargs.get('remote_login_port_public_access', "NotSpecified") + self.os_type = kwargs.get("os_type", "Linux") + self.vm_size = kwargs.get("vm_size", None) + self.vm_priority = kwargs.get("vm_priority", None) + self.virtual_machine_image = kwargs.get("virtual_machine_image", None) + self.isolated_network = kwargs.get("isolated_network", None) + self.scale_settings = kwargs.get("scale_settings", None) + self.user_account_credentials = kwargs.get( + "user_account_credentials", None + ) + self.subnet = kwargs.get("subnet", None) + self.remote_login_port_public_access = kwargs.get( + "remote_login_port_public_access", "NotSpecified" + ) self.allocation_state = None self.allocation_state_transition_time = None self.errors = None self.current_node_count = None self.target_node_count = None self.node_state_counts = None - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', True) - self.property_bag = kwargs.get('property_bag', None) + self.enable_node_public_ip = kwargs.get("enable_node_public_ip", True) + self.property_bag = kwargs.get("property_bag", None) class AmlOperation(msrest.serialization.Model): @@ -1092,15 +1114,12 @@ class AmlOperation(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'AmlOperationDisplay'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + "name": {"key": "name", "type": "str"}, + "display": {"key": "display", "type": "AmlOperationDisplay"}, + "is_data_action": {"key": "isDataAction", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: Operation name: {provider}/{resource}/{operation}. :paramtype name: str @@ -1110,9 +1129,9 @@ def __init__( :paramtype is_data_action: bool """ super(AmlOperation, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display = kwargs.get('display', None) - self.is_data_action = kwargs.get('is_data_action', None) + self.name = kwargs.get("name", None) + self.display = kwargs.get("display", None) + self.is_data_action = kwargs.get("is_data_action", None) class AmlOperationDisplay(msrest.serialization.Model): @@ -1129,16 +1148,13 @@ class AmlOperationDisplay(msrest.serialization.Model): """ _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, + "provider": {"key": "provider", "type": "str"}, + "resource": {"key": "resource", "type": "str"}, + "operation": {"key": "operation", "type": "str"}, + "description": {"key": "description", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword provider: The resource provider name: Microsoft.MachineLearningExperimentation. :paramtype provider: str @@ -1150,10 +1166,10 @@ def __init__( :paramtype description: str """ super(AmlOperationDisplay, self).__init__(**kwargs) - self.provider = kwargs.get('provider', None) - self.resource = kwargs.get('resource', None) - self.operation = kwargs.get('operation', None) - self.description = kwargs.get('description', None) + self.provider = kwargs.get("provider", None) + self.resource = kwargs.get("resource", None) + self.operation = kwargs.get("operation", None) + self.description = kwargs.get("description", None) class AmlOperationListResult(msrest.serialization.Model): @@ -1164,20 +1180,17 @@ class AmlOperationListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlOperation]'}, + "value": {"key": "value", "type": "[AmlOperation]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: List of AML workspace operations supported by the AML workspace resource provider. :paramtype value: list[~azure.mgmt.machinelearningservices.models.AmlOperation] """ super(AmlOperationListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class IdentityConfiguration(msrest.serialization.Model): @@ -1195,23 +1208,23 @@ class IdentityConfiguration(msrest.serialization.Model): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, } _subtype_map = { - 'identity_type': {'AMLToken': 'AmlToken', 'Managed': 'ManagedIdentity', 'UserIdentity': 'UserIdentity'} + "identity_type": { + "AMLToken": "AmlToken", + "Managed": "ManagedIdentity", + "UserIdentity": "UserIdentity", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(IdentityConfiguration, self).__init__(**kwargs) self.identity_type = None # type: Optional[str] @@ -1228,21 +1241,17 @@ class AmlToken(IdentityConfiguration): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AmlToken, self).__init__(**kwargs) - self.identity_type = 'AMLToken' # type: str + self.identity_type = "AMLToken" # type: str class AmlUserFeature(msrest.serialization.Model): @@ -1257,15 +1266,12 @@ class AmlUserFeature(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "description": {"key": "description", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword id: Specifies the feature ID. :paramtype id: str @@ -1275,9 +1281,9 @@ def __init__( :paramtype description: str """ super(AmlUserFeature, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.display_name = kwargs.get('display_name', None) - self.description = kwargs.get('description', None) + self.id = kwargs.get("id", None) + self.display_name = kwargs.get("display_name", None) + self.description = kwargs.get("description", None) class ArmResourceId(msrest.serialization.Model): @@ -1291,13 +1297,10 @@ class ArmResourceId(msrest.serialization.Model): """ _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, + "resource_id": {"key": "resourceId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword resource_id: Arm ResourceId is in the format "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName}" @@ -1306,7 +1309,7 @@ def __init__( :paramtype resource_id: str """ super(ArmResourceId, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) class ResourceBase(msrest.serialization.Model): @@ -1321,15 +1324,12 @@ class ResourceBase(msrest.serialization.Model): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -1339,9 +1339,9 @@ def __init__( :paramtype tags: dict[str, str] """ super(ResourceBase, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) + self.description = kwargs.get("description", None) + self.properties = kwargs.get("properties", None) + self.tags = kwargs.get("tags", None) class AssetBase(ResourceBase): @@ -1360,17 +1360,14 @@ class AssetBase(ResourceBase): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -1384,8 +1381,8 @@ def __init__( :paramtype is_archived: bool """ super(AssetBase, self).__init__(**kwargs) - self.is_anonymous = kwargs.get('is_anonymous', False) - self.is_archived = kwargs.get('is_archived', False) + self.is_anonymous = kwargs.get("is_anonymous", False) + self.is_archived = kwargs.get("is_archived", False) class AssetContainer(ResourceBase): @@ -1408,23 +1405,20 @@ class AssetContainer(ResourceBase): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -1436,7 +1430,7 @@ def __init__( :paramtype is_archived: bool """ super(AssetContainer, self).__init__(**kwargs) - self.is_archived = kwargs.get('is_archived', False) + self.is_archived = kwargs.get("is_archived", False) self.latest_version = None self.next_version = None @@ -1454,18 +1448,15 @@ class AssetJobInput(msrest.serialization.Model): """ _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "uri": {"required": True, "min_length": 1, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -1474,8 +1465,8 @@ def __init__( :paramtype uri: str """ super(AssetJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] class AssetJobOutput(msrest.serialization.Model): @@ -1488,14 +1479,11 @@ class AssetJobOutput(msrest.serialization.Model): """ _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -1503,8 +1491,8 @@ def __init__( :paramtype uri: str """ super(AssetJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) class AssetReferenceBase(msrest.serialization.Model): @@ -1521,23 +1509,23 @@ class AssetReferenceBase(msrest.serialization.Model): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, } _subtype_map = { - 'reference_type': {'DataPath': 'DataPathAssetReference', 'Id': 'IdAssetReference', 'OutputPath': 'OutputPathAssetReference'} + "reference_type": { + "DataPath": "DataPathAssetReference", + "Id": "IdAssetReference", + "OutputPath": "OutputPathAssetReference", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AssetReferenceBase, self).__init__(**kwargs) self.reference_type = None # type: Optional[str] @@ -1554,19 +1542,16 @@ class AssignedUser(msrest.serialization.Model): """ _validation = { - 'object_id': {'required': True}, - 'tenant_id': {'required': True}, + "object_id": {"required": True}, + "tenant_id": {"required": True}, } _attribute_map = { - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + "object_id": {"key": "objectId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword object_id: Required. User’s AAD Object Id. :paramtype object_id: str @@ -1574,8 +1559,8 @@ def __init__( :paramtype tenant_id: str """ super(AssignedUser, self).__init__(**kwargs) - self.object_id = kwargs['object_id'] - self.tenant_id = kwargs['tenant_id'] + self.object_id = kwargs["object_id"] + self.tenant_id = kwargs["tenant_id"] class ForecastHorizon(msrest.serialization.Model): @@ -1592,23 +1577,22 @@ class ForecastHorizon(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoForecastHorizon', 'Custom': 'CustomForecastHorizon'} + "mode": { + "Auto": "AutoForecastHorizon", + "Custom": "CustomForecastHorizon", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ForecastHorizon, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -1624,21 +1608,17 @@ class AutoForecastHorizon(ForecastHorizon): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoForecastHorizon, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class JobBaseProperties(ResourceBase): @@ -1685,33 +1665,35 @@ class JobBaseProperties(ResourceBase): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, + "job_type": {"required": True}, + "status": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, } _subtype_map = { - 'job_type': {'AutoML': 'AutoMLJob', 'Command': 'CommandJob', 'Pipeline': 'PipelineJob', 'Sweep': 'SweepJob'} + "job_type": { + "AutoML": "AutoMLJob", + "Command": "CommandJob", + "Pipeline": "PipelineJob", + "Sweep": "SweepJob", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -1739,102 +1721,102 @@ def __init__( :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] """ super(JobBaseProperties, self).__init__(**kwargs) - self.component_id = kwargs.get('component_id', None) - self.compute_id = kwargs.get('compute_id', None) - self.display_name = kwargs.get('display_name', None) - self.experiment_name = kwargs.get('experiment_name', "Default") - self.identity = kwargs.get('identity', None) - self.is_archived = kwargs.get('is_archived', False) - self.job_type = 'JobBaseProperties' # type: str - self.services = kwargs.get('services', None) + self.component_id = kwargs.get("component_id", None) + self.compute_id = kwargs.get("compute_id", None) + self.display_name = kwargs.get("display_name", None) + self.experiment_name = kwargs.get("experiment_name", "Default") + self.identity = kwargs.get("identity", None) + self.is_archived = kwargs.get("is_archived", False) + self.job_type = "JobBaseProperties" # type: str + self.services = kwargs.get("services", None) self.status = None class AutoMLJob(JobBaseProperties): """AutoMLJob class. -Use this class for executing AutoML tasks like Classification/Regression etc. -See TaskType enum for all the tasks supported. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Sweep", "Pipeline". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar environment_id: The ARM resource ID of the Environment specification for the job. - This is optional value to provide, if not provided, AutoML will default this to Production - AutoML curated environment version when running the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - :ivar task_details: Required. [Required] This represents scenario which can be one of - Tables/NLP/Image. - :vartype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical + Use this class for executing AutoML tasks like Classification/Regression etc. + See TaskType enum for all the tasks supported. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar description: The asset description text. + :vartype description: str + :ivar properties: The asset property dictionary. + :vartype properties: dict[str, str] + :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + :ivar component_id: ARM resource ID of the component resource. + :vartype component_id: str + :ivar compute_id: ARM resource ID of the compute resource. + :vartype compute_id: str + :ivar display_name: Display name of job. + :vartype display_name: str + :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is + placed in the "Default" experiment. + :vartype experiment_name: str + :ivar identity: Identity configuration. If set, this should be one of AmlToken, + ManagedIdentity, UserIdentity or null. + Defaults to AmlToken if null. + :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration + :ivar is_archived: Is the asset archived?. + :vartype is_archived: bool + :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. + Possible values include: "AutoML", "Command", "Sweep", "Pipeline". + :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType + :ivar services: List of JobEndpoints. + For local jobs, a job endpoint will have an endpoint value of FileStreamObject. + :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] + :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", + "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", + "Failed", "Canceled", "NotResponding", "Paused", "Unknown". + :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus + :ivar environment_id: The ARM resource ID of the Environment specification for the job. + This is optional value to provide, if not provided, AutoML will default this to Production + AutoML curated environment version when running the job. + :vartype environment_id: str + :ivar environment_variables: Environment variables included in the job. + :vartype environment_variables: dict[str, str] + :ivar outputs: Mapping of output data bindings used in the job. + :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] + :ivar resources: Compute Resource configuration for the job. + :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration + :ivar task_details: Required. [Required] This represents scenario which can be one of + Tables/NLP/Image. + :vartype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'task_details': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - 'task_details': {'key': 'taskDetails', 'type': 'AutoMLVertical'}, - } - - def __init__( - self, - **kwargs - ): + "job_type": {"required": True}, + "status": {"readonly": True}, + "task_details": {"required": True}, + } + + _attribute_map = { + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "resources": {"key": "resources", "type": "JobResourceConfiguration"}, + "task_details": {"key": "taskDetails", "type": "AutoMLVertical"}, + } + + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -1875,58 +1857,66 @@ def __init__( :paramtype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical """ super(AutoMLJob, self).__init__(**kwargs) - self.job_type = 'AutoML' # type: str - self.environment_id = kwargs.get('environment_id', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.outputs = kwargs.get('outputs', None) - self.resources = kwargs.get('resources', None) - self.task_details = kwargs['task_details'] + self.job_type = "AutoML" # type: str + self.environment_id = kwargs.get("environment_id", None) + self.environment_variables = kwargs.get("environment_variables", None) + self.outputs = kwargs.get("outputs", None) + self.resources = kwargs.get("resources", None) + self.task_details = kwargs["task_details"] class AutoMLVertical(msrest.serialization.Model): """AutoML vertical class. -Base class for AutoML verticals - TableVertical/ImageVertical/NLPVertical. + Base class for AutoML verticals - TableVertical/ImageVertical/NLPVertical. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Classification, Forecasting, ImageClassification, ImageClassificationMultilabel, ImageInstanceSegmentation, ImageObjectDetection, Regression, TextClassification, TextClassificationMultilabel, TextNer. + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Classification, Forecasting, ImageClassification, ImageClassificationMultilabel, ImageInstanceSegmentation, ImageObjectDetection, Regression, TextClassification, TextClassificationMultilabel, TextNer. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, + "task_type": {"required": True}, + "training_data": {"required": True}, } _attribute_map = { - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, } _subtype_map = { - 'task_type': {'Classification': 'Classification', 'Forecasting': 'Forecasting', 'ImageClassification': 'ImageClassification', 'ImageClassificationMultilabel': 'ImageClassificationMultilabel', 'ImageInstanceSegmentation': 'ImageInstanceSegmentation', 'ImageObjectDetection': 'ImageObjectDetection', 'Regression': 'Regression', 'TextClassification': 'TextClassification', 'TextClassificationMultilabel': 'TextClassificationMultilabel', 'TextNER': 'TextNer'} - } - - def __init__( - self, - **kwargs - ): + "task_type": { + "Classification": "Classification", + "Forecasting": "Forecasting", + "ImageClassification": "ImageClassification", + "ImageClassificationMultilabel": "ImageClassificationMultilabel", + "ImageInstanceSegmentation": "ImageInstanceSegmentation", + "ImageObjectDetection": "ImageObjectDetection", + "Regression": "Regression", + "TextClassification": "TextClassification", + "TextClassificationMultilabel": "TextClassificationMultilabel", + "TextNER": "TextNer", + } + } + + def __init__(self, **kwargs): """ :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", "Info", "Warning", "Error", "Critical". @@ -1938,10 +1928,10 @@ def __init__( :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ super(AutoMLVertical, self).__init__(**kwargs) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) self.task_type = None # type: Optional[str] - self.training_data = kwargs['training_data'] + self.training_data = kwargs["training_data"] class NCrossValidations(msrest.serialization.Model): @@ -1958,23 +1948,22 @@ class NCrossValidations(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoNCrossValidations', 'Custom': 'CustomNCrossValidations'} + "mode": { + "Auto": "AutoNCrossValidations", + "Custom": "CustomNCrossValidations", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NCrossValidations, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -1990,21 +1979,17 @@ class AutoNCrossValidations(NCrossValidations): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoNCrossValidations, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class AutoPauseProperties(msrest.serialization.Model): @@ -2017,14 +2002,11 @@ class AutoPauseProperties(msrest.serialization.Model): """ _attribute_map = { - 'delay_in_minutes': {'key': 'delayInMinutes', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, + "delay_in_minutes": {"key": "delayInMinutes", "type": "int"}, + "enabled": {"key": "enabled", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword delay_in_minutes: :paramtype delay_in_minutes: int @@ -2032,8 +2014,8 @@ def __init__( :paramtype enabled: bool """ super(AutoPauseProperties, self).__init__(**kwargs) - self.delay_in_minutes = kwargs.get('delay_in_minutes', None) - self.enabled = kwargs.get('enabled', None) + self.delay_in_minutes = kwargs.get("delay_in_minutes", None) + self.enabled = kwargs.get("enabled", None) class AutoScaleProperties(msrest.serialization.Model): @@ -2048,15 +2030,12 @@ class AutoScaleProperties(msrest.serialization.Model): """ _attribute_map = { - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, + "min_node_count": {"key": "minNodeCount", "type": "int"}, + "enabled": {"key": "enabled", "type": "bool"}, + "max_node_count": {"key": "maxNodeCount", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword min_node_count: :paramtype min_node_count: int @@ -2066,9 +2045,9 @@ def __init__( :paramtype max_node_count: int """ super(AutoScaleProperties, self).__init__(**kwargs) - self.min_node_count = kwargs.get('min_node_count', None) - self.enabled = kwargs.get('enabled', None) - self.max_node_count = kwargs.get('max_node_count', None) + self.min_node_count = kwargs.get("min_node_count", None) + self.enabled = kwargs.get("enabled", None) + self.max_node_count = kwargs.get("max_node_count", None) class Seasonality(msrest.serialization.Model): @@ -2085,23 +2064,19 @@ class Seasonality(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoSeasonality', 'Custom': 'CustomSeasonality'} + "mode": {"Auto": "AutoSeasonality", "Custom": "CustomSeasonality"} } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Seasonality, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -2117,21 +2092,17 @@ class AutoSeasonality(Seasonality): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoSeasonality, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class TargetLags(msrest.serialization.Model): @@ -2148,23 +2119,19 @@ class TargetLags(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoTargetLags', 'Custom': 'CustomTargetLags'} + "mode": {"Auto": "AutoTargetLags", "Custom": "CustomTargetLags"} } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(TargetLags, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -2180,21 +2147,17 @@ class AutoTargetLags(TargetLags): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoTargetLags, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class TargetRollingWindowSize(msrest.serialization.Model): @@ -2211,23 +2174,22 @@ class TargetRollingWindowSize(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoTargetRollingWindowSize', 'Custom': 'CustomTargetRollingWindowSize'} + "mode": { + "Auto": "AutoTargetRollingWindowSize", + "Custom": "CustomTargetRollingWindowSize", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(TargetRollingWindowSize, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -2243,21 +2205,17 @@ class AutoTargetRollingWindowSize(TargetRollingWindowSize): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class DatastoreProperties(ResourceBase): @@ -2288,28 +2246,30 @@ class DatastoreProperties(ResourceBase): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, } _subtype_map = { - 'datastore_type': {'AzureBlob': 'AzureBlobDatastore', 'AzureDataLakeGen1': 'AzureDataLakeGen1Datastore', 'AzureDataLakeGen2': 'AzureDataLakeGen2Datastore', 'AzureFile': 'AzureFileDatastore'} + "datastore_type": { + "AzureBlob": "AzureBlobDatastore", + "AzureDataLakeGen1": "AzureDataLakeGen1Datastore", + "AzureDataLakeGen2": "AzureDataLakeGen2Datastore", + "AzureFile": "AzureFileDatastore", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -2321,8 +2281,8 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials """ super(DatastoreProperties, self).__init__(**kwargs) - self.credentials = kwargs['credentials'] - self.datastore_type = 'DatastoreProperties' # type: str + self.credentials = kwargs["credentials"] + self.datastore_type = "DatastoreProperties" # type: str self.is_default = None @@ -2364,29 +2324,29 @@ class AzureBlobDatastore(DatastoreProperties): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "account_name": {"key": "accountName", "type": "str"}, + "container_name": {"key": "containerName", "type": "str"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -2411,12 +2371,14 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ super(AzureBlobDatastore, self).__init__(**kwargs) - self.datastore_type = 'AzureBlob' # type: str - self.account_name = kwargs.get('account_name', None) - self.container_name = kwargs.get('container_name', None) - self.endpoint = kwargs.get('endpoint', None) - self.protocol = kwargs.get('protocol', None) - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) + self.datastore_type = "AzureBlob" # type: str + self.account_name = kwargs.get("account_name", None) + self.container_name = kwargs.get("container_name", None) + self.endpoint = kwargs.get("endpoint", None) + self.protocol = kwargs.get("protocol", None) + self.service_data_access_auth_identity = kwargs.get( + "service_data_access_auth_identity", None + ) class AzureDataLakeGen1Datastore(DatastoreProperties): @@ -2451,27 +2413,31 @@ class AzureDataLakeGen1Datastore(DatastoreProperties): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'store_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "store_name": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - 'store_name': {'key': 'storeName', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, + "store_name": {"key": "storeName", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -2490,9 +2456,11 @@ def __init__( :paramtype store_name: str """ super(AzureDataLakeGen1Datastore, self).__init__(**kwargs) - self.datastore_type = 'AzureDataLakeGen1' # type: str - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) - self.store_name = kwargs['store_name'] + self.datastore_type = "AzureDataLakeGen1" # type: str + self.service_data_access_auth_identity = kwargs.get( + "service_data_access_auth_identity", None + ) + self.store_name = kwargs["store_name"] class AzureDataLakeGen2Datastore(DatastoreProperties): @@ -2533,31 +2501,39 @@ class AzureDataLakeGen2Datastore(DatastoreProperties): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'filesystem': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'filesystem': {'key': 'filesystem', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "account_name": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "filesystem": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + } + + _attribute_map = { + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "account_name": {"key": "accountName", "type": "str"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "filesystem": {"key": "filesystem", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, + } + + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -2582,12 +2558,14 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ super(AzureDataLakeGen2Datastore, self).__init__(**kwargs) - self.datastore_type = 'AzureDataLakeGen2' # type: str - self.account_name = kwargs['account_name'] - self.endpoint = kwargs.get('endpoint', None) - self.filesystem = kwargs['filesystem'] - self.protocol = kwargs.get('protocol', None) - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) + self.datastore_type = "AzureDataLakeGen2" # type: str + self.account_name = kwargs["account_name"] + self.endpoint = kwargs.get("endpoint", None) + self.filesystem = kwargs["filesystem"] + self.protocol = kwargs.get("protocol", None) + self.service_data_access_auth_identity = kwargs.get( + "service_data_access_auth_identity", None + ) class AzureFileDatastore(DatastoreProperties): @@ -2629,31 +2607,39 @@ class AzureFileDatastore(DatastoreProperties): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'file_share_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'file_share_name': {'key': 'fileShareName', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "account_name": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "file_share_name": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + } + + _attribute_map = { + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "account_name": {"key": "accountName", "type": "str"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "file_share_name": {"key": "fileShareName", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, + } + + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -2679,12 +2665,14 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ super(AzureFileDatastore, self).__init__(**kwargs) - self.datastore_type = 'AzureFile' # type: str - self.account_name = kwargs['account_name'] - self.endpoint = kwargs.get('endpoint', None) - self.file_share_name = kwargs['file_share_name'] - self.protocol = kwargs.get('protocol', None) - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) + self.datastore_type = "AzureFile" # type: str + self.account_name = kwargs["account_name"] + self.endpoint = kwargs.get("endpoint", None) + self.file_share_name = kwargs["file_share_name"] + self.protocol = kwargs.get("protocol", None) + self.service_data_access_auth_identity = kwargs.get( + "service_data_access_auth_identity", None + ) class EarlyTerminationPolicy(msrest.serialization.Model): @@ -2706,23 +2694,24 @@ class EarlyTerminationPolicy(msrest.serialization.Model): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, } _subtype_map = { - 'policy_type': {'Bandit': 'BanditPolicy', 'MedianStopping': 'MedianStoppingPolicy', 'TruncationSelection': 'TruncationSelectionPolicy'} + "policy_type": { + "Bandit": "BanditPolicy", + "MedianStopping": "MedianStoppingPolicy", + "TruncationSelection": "TruncationSelectionPolicy", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. :paramtype delay_evaluation: int @@ -2730,8 +2719,8 @@ def __init__( :paramtype evaluation_interval: int """ super(EarlyTerminationPolicy, self).__init__(**kwargs) - self.delay_evaluation = kwargs.get('delay_evaluation', 0) - self.evaluation_interval = kwargs.get('evaluation_interval', 0) + self.delay_evaluation = kwargs.get("delay_evaluation", 0) + self.evaluation_interval = kwargs.get("evaluation_interval", 0) self.policy_type = None # type: Optional[str] @@ -2755,21 +2744,18 @@ class BanditPolicy(EarlyTerminationPolicy): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'slack_amount': {'key': 'slackAmount', 'type': 'float'}, - 'slack_factor': {'key': 'slackFactor', 'type': 'float'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, + "slack_amount": {"key": "slackAmount", "type": "float"}, + "slack_factor": {"key": "slackFactor", "type": "float"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. :paramtype delay_evaluation: int @@ -2781,9 +2767,9 @@ def __init__( :paramtype slack_factor: float """ super(BanditPolicy, self).__init__(**kwargs) - self.policy_type = 'Bandit' # type: str - self.slack_amount = kwargs.get('slack_amount', 0) - self.slack_factor = kwargs.get('slack_factor', 0) + self.policy_type = "Bandit" # type: str + self.slack_amount = kwargs.get("slack_amount", 0) + self.slack_factor = kwargs.get("slack_factor", 0) class Resource(msrest.serialization.Model): @@ -2805,25 +2791,21 @@ class Resource(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -2856,26 +2838,23 @@ class TrackedResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -2883,8 +2862,8 @@ def __init__( :paramtype location: str """ super(TrackedResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.location = kwargs['location'] + self.tags = kwargs.get("tags", None) + self.location = kwargs["location"] class BatchDeployment(TrackedResource): @@ -2921,31 +2900,31 @@ class BatchDeployment(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchDeploymentProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": { + "key": "properties", + "type": "BatchDeploymentProperties", + }, + "sku": {"key": "sku", "type": "Sku"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -2962,10 +2941,10 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ super(BatchDeployment, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) + self.identity = kwargs.get("identity", None) + self.kind = kwargs.get("kind", None) + self.properties = kwargs["properties"] + self.sku = kwargs.get("sku", None) class EndpointDeploymentPropertiesBase(msrest.serialization.Model): @@ -2985,17 +2964,20 @@ class EndpointDeploymentPropertiesBase(msrest.serialization.Model): """ _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword code_configuration: Code configuration for the endpoint deployment. :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration @@ -3010,11 +2992,11 @@ def __init__( :paramtype properties: dict[str, str] """ super(EndpointDeploymentPropertiesBase, self).__init__(**kwargs) - self.code_configuration = kwargs.get('code_configuration', None) - self.description = kwargs.get('description', None) - self.environment_id = kwargs.get('environment_id', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.properties = kwargs.get('properties', None) + self.code_configuration = kwargs.get("code_configuration", None) + self.description = kwargs.get("description", None) + self.environment_id = kwargs.get("environment_id", None) + self.environment_variables = kwargs.get("environment_variables", None) + self.properties = kwargs.get("properties", None) class BatchDeploymentProperties(EndpointDeploymentPropertiesBase): @@ -3071,32 +3053,44 @@ class BatchDeploymentProperties(EndpointDeploymentPropertiesBase): """ _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'error_threshold': {'key': 'errorThreshold', 'type': 'int'}, - 'logging_level': {'key': 'loggingLevel', 'type': 'str'}, - 'max_concurrency_per_instance': {'key': 'maxConcurrencyPerInstance', 'type': 'int'}, - 'mini_batch_size': {'key': 'miniBatchSize', 'type': 'long'}, - 'model': {'key': 'model', 'type': 'AssetReferenceBase'}, - 'output_action': {'key': 'outputAction', 'type': 'str'}, - 'output_file_name': {'key': 'outputFileName', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'resources': {'key': 'resources', 'type': 'DeploymentResourceConfiguration'}, - 'retry_settings': {'key': 'retrySettings', 'type': 'BatchRetrySettings'}, - } - - def __init__( - self, - **kwargs - ): + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "compute": {"key": "compute", "type": "str"}, + "error_threshold": {"key": "errorThreshold", "type": "int"}, + "logging_level": {"key": "loggingLevel", "type": "str"}, + "max_concurrency_per_instance": { + "key": "maxConcurrencyPerInstance", + "type": "int", + }, + "mini_batch_size": {"key": "miniBatchSize", "type": "long"}, + "model": {"key": "model", "type": "AssetReferenceBase"}, + "output_action": {"key": "outputAction", "type": "str"}, + "output_file_name": {"key": "outputFileName", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "resources": { + "key": "resources", + "type": "DeploymentResourceConfiguration", + }, + "retry_settings": { + "key": "retrySettings", + "type": "BatchRetrySettings", + }, + } + + def __init__(self, **kwargs): """ :keyword code_configuration: Code configuration for the endpoint deployment. :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration @@ -3143,20 +3137,26 @@ def __init__( :paramtype retry_settings: ~azure.mgmt.machinelearningservices.models.BatchRetrySettings """ super(BatchDeploymentProperties, self).__init__(**kwargs) - self.compute = kwargs.get('compute', None) - self.error_threshold = kwargs.get('error_threshold', -1) - self.logging_level = kwargs.get('logging_level', None) - self.max_concurrency_per_instance = kwargs.get('max_concurrency_per_instance', 1) - self.mini_batch_size = kwargs.get('mini_batch_size', 10) - self.model = kwargs.get('model', None) - self.output_action = kwargs.get('output_action', None) - self.output_file_name = kwargs.get('output_file_name', "predictions.csv") + self.compute = kwargs.get("compute", None) + self.error_threshold = kwargs.get("error_threshold", -1) + self.logging_level = kwargs.get("logging_level", None) + self.max_concurrency_per_instance = kwargs.get( + "max_concurrency_per_instance", 1 + ) + self.mini_batch_size = kwargs.get("mini_batch_size", 10) + self.model = kwargs.get("model", None) + self.output_action = kwargs.get("output_action", None) + self.output_file_name = kwargs.get( + "output_file_name", "predictions.csv" + ) self.provisioning_state = None - self.resources = kwargs.get('resources', None) - self.retry_settings = kwargs.get('retry_settings', None) + self.resources = kwargs.get("resources", None) + self.retry_settings = kwargs.get("retry_settings", None) -class BatchDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class BatchDeploymentTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of BatchDeployment entities. :ivar next_link: The link to the next page of BatchDeployment objects. If null, there are no @@ -3167,14 +3167,11 @@ class BatchDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Mode """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchDeployment]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[BatchDeployment]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of BatchDeployment objects. If null, there are no additional pages. @@ -3182,9 +3179,11 @@ def __init__( :keyword value: An array of objects of type BatchDeployment. :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchDeployment] """ - super(BatchDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(BatchDeploymentTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class BatchEndpoint(TrackedResource): @@ -3221,31 +3220,28 @@ class BatchEndpoint(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": {"key": "properties", "type": "BatchEndpointProperties"}, + "sku": {"key": "sku", "type": "Sku"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -3262,10 +3258,10 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ super(BatchEndpoint, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) + self.identity = kwargs.get("identity", None) + self.kind = kwargs.get("kind", None) + self.properties = kwargs["properties"] + self.sku = kwargs.get("sku", None) class BatchEndpointDefaults(msrest.serialization.Model): @@ -3277,20 +3273,17 @@ class BatchEndpointDefaults(msrest.serialization.Model): """ _attribute_map = { - 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, + "deployment_name": {"key": "deploymentName", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword deployment_name: Name of the deployment that will be default for the endpoint. This deployment will end up getting 100% traffic when the endpoint scoring URL is invoked. :paramtype deployment_name: str """ super(BatchEndpointDefaults, self).__init__(**kwargs) - self.deployment_name = kwargs.get('deployment_name', None) + self.deployment_name = kwargs.get("deployment_name", None) class EndpointPropertiesBase(msrest.serialization.Model): @@ -3319,24 +3312,21 @@ class EndpointPropertiesBase(msrest.serialization.Model): """ _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, + "auth_mode": {"required": True}, + "scoring_uri": {"readonly": True}, + "swagger_uri": {"readonly": True}, } _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, + "auth_mode": {"key": "authMode", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "keys": {"key": "keys", "type": "EndpointAuthKeys"}, + "properties": {"key": "properties", "type": "{str}"}, + "scoring_uri": {"key": "scoringUri", "type": "str"}, + "swagger_uri": {"key": "swaggerUri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' @@ -3352,10 +3342,10 @@ def __init__( :paramtype properties: dict[str, str] """ super(EndpointPropertiesBase, self).__init__(**kwargs) - self.auth_mode = kwargs['auth_mode'] - self.description = kwargs.get('description', None) - self.keys = kwargs.get('keys', None) - self.properties = kwargs.get('properties', None) + self.auth_mode = kwargs["auth_mode"] + self.description = kwargs.get("description", None) + self.keys = kwargs.get("keys", None) + self.properties = kwargs.get("properties", None) self.scoring_uri = None self.swagger_uri = None @@ -3392,27 +3382,24 @@ class BatchEndpointProperties(EndpointPropertiesBase): """ _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "auth_mode": {"required": True}, + "scoring_uri": {"readonly": True}, + "swagger_uri": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'defaults': {'key': 'defaults', 'type': 'BatchEndpointDefaults'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "auth_mode": {"key": "authMode", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "keys": {"key": "keys", "type": "EndpointAuthKeys"}, + "properties": {"key": "properties", "type": "{str}"}, + "scoring_uri": {"key": "scoringUri", "type": "str"}, + "swagger_uri": {"key": "swaggerUri", "type": "str"}, + "defaults": {"key": "defaults", "type": "BatchEndpointDefaults"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' @@ -3430,11 +3417,13 @@ def __init__( :paramtype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults """ super(BatchEndpointProperties, self).__init__(**kwargs) - self.defaults = kwargs.get('defaults', None) + self.defaults = kwargs.get("defaults", None) self.provisioning_state = None -class BatchEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class BatchEndpointTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of BatchEndpoint entities. :ivar next_link: The link to the next page of BatchEndpoint objects. If null, there are no @@ -3445,14 +3434,11 @@ class BatchEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model) """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchEndpoint]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[BatchEndpoint]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of BatchEndpoint objects. If null, there are no additional pages. @@ -3460,9 +3446,11 @@ def __init__( :keyword value: An array of objects of type BatchEndpoint. :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchEndpoint] """ - super(BatchEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(BatchEndpointTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class BatchRetrySettings(msrest.serialization.Model): @@ -3475,14 +3463,11 @@ class BatchRetrySettings(msrest.serialization.Model): """ _attribute_map = { - 'max_retries': {'key': 'maxRetries', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "max_retries": {"key": "maxRetries", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword max_retries: Maximum retry count for a mini-batch. :paramtype max_retries: int @@ -3490,44 +3475,47 @@ def __init__( :paramtype timeout: ~datetime.timedelta """ super(BatchRetrySettings, self).__init__(**kwargs) - self.max_retries = kwargs.get('max_retries', 3) - self.timeout = kwargs.get('timeout', "PT30S") + self.max_retries = kwargs.get("max_retries", 3) + self.timeout = kwargs.get("timeout", "PT30S") class SamplingAlgorithm(msrest.serialization.Model): """The Sampling Algorithm used to generate hyperparameter values, along with properties to -configure the algorithm. + configure the algorithm. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BayesianSamplingAlgorithm, GridSamplingAlgorithm, RandomSamplingAlgorithm. + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: BayesianSamplingAlgorithm, GridSamplingAlgorithm, RandomSamplingAlgorithm. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType + :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating + hyperparameter values, along with configuration properties.Constant filled by server. Possible + values include: "Grid", "Random", "Bayesian". + :vartype sampling_algorithm_type: str or + ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } _subtype_map = { - 'sampling_algorithm_type': {'Bayesian': 'BayesianSamplingAlgorithm', 'Grid': 'GridSamplingAlgorithm', 'Random': 'RandomSamplingAlgorithm'} + "sampling_algorithm_type": { + "Bayesian": "BayesianSamplingAlgorithm", + "Grid": "GridSamplingAlgorithm", + "Random": "RandomSamplingAlgorithm", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(SamplingAlgorithm, self).__init__(**kwargs) self.sampling_algorithm_type = None # type: Optional[str] @@ -3545,21 +3533,20 @@ class BayesianSamplingAlgorithm(SamplingAlgorithm): """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(BayesianSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Bayesian' # type: str + self.sampling_algorithm_type = "Bayesian" # type: str class BindOptions(msrest.serialization.Model): @@ -3574,15 +3561,12 @@ class BindOptions(msrest.serialization.Model): """ _attribute_map = { - 'propagation': {'key': 'propagation', 'type': 'str'}, - 'create_host_path': {'key': 'createHostPath', 'type': 'bool'}, - 'selinux': {'key': 'selinux', 'type': 'str'}, + "propagation": {"key": "propagation", "type": "str"}, + "create_host_path": {"key": "createHostPath", "type": "bool"}, + "selinux": {"key": "selinux", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword propagation: Type of Bind Option. :paramtype propagation: str @@ -3592,9 +3576,9 @@ def __init__( :paramtype selinux: str """ super(BindOptions, self).__init__(**kwargs) - self.propagation = kwargs.get('propagation', None) - self.create_host_path = kwargs.get('create_host_path', None) - self.selinux = kwargs.get('selinux', None) + self.propagation = kwargs.get("propagation", None) + self.create_host_path = kwargs.get("create_host_path", None) + self.selinux = kwargs.get("selinux", None) class BlobReferenceForConsumptionDto(msrest.serialization.Model): @@ -3610,15 +3594,18 @@ class BlobReferenceForConsumptionDto(msrest.serialization.Model): """ _attribute_map = { - 'blob_uri': {'key': 'blobUri', 'type': 'str'}, - 'credential': {'key': 'credential', 'type': 'PendingUploadCredentialDto'}, - 'storage_account_arm_id': {'key': 'storageAccountArmId', 'type': 'str'}, + "blob_uri": {"key": "blobUri", "type": "str"}, + "credential": { + "key": "credential", + "type": "PendingUploadCredentialDto", + }, + "storage_account_arm_id": { + "key": "storageAccountArmId", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword blob_uri: Blob URI path for client to upload data. Example: https://blob.windows.core.net/Container/Path. @@ -3629,9 +3616,11 @@ def __init__( :paramtype storage_account_arm_id: str """ super(BlobReferenceForConsumptionDto, self).__init__(**kwargs) - self.blob_uri = kwargs.get('blob_uri', None) - self.credential = kwargs.get('credential', None) - self.storage_account_arm_id = kwargs.get('storage_account_arm_id', None) + self.blob_uri = kwargs.get("blob_uri", None) + self.credential = kwargs.get("credential", None) + self.storage_account_arm_id = kwargs.get( + "storage_account_arm_id", None + ) class BuildContext(msrest.serialization.Model): @@ -3641,56 +3630,57 @@ class BuildContext(msrest.serialization.Model): :ivar context_uri: Required. [Required] URI of the Docker build context used to build the image. Supports blob URIs on environment creation and may return blob or Git URIs. - - + + .. raw:: html - + . :vartype context_uri: str :ivar dockerfile_path: Path to the Dockerfile in the build context. - - + + .. raw:: html - + . :vartype dockerfile_path: str """ _validation = { - 'context_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "context_uri": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'context_uri': {'key': 'contextUri', 'type': 'str'}, - 'dockerfile_path': {'key': 'dockerfilePath', 'type': 'str'}, + "context_uri": {"key": "contextUri", "type": "str"}, + "dockerfile_path": {"key": "dockerfilePath", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword context_uri: Required. [Required] URI of the Docker build context used to build the image. Supports blob URIs on environment creation and may return blob or Git URIs. - - + + .. raw:: html - + . :paramtype context_uri: str :keyword dockerfile_path: Path to the Dockerfile in the build context. - - + + .. raw:: html - + . :paramtype dockerfile_path: str """ super(BuildContext, self).__init__(**kwargs) - self.context_uri = kwargs['context_uri'] - self.dockerfile_path = kwargs.get('dockerfile_path', "Dockerfile") + self.context_uri = kwargs["context_uri"] + self.dockerfile_path = kwargs.get("dockerfile_path", "Dockerfile") class CertificateDatastoreCredentials(DatastoreCredentials): @@ -3717,27 +3707,28 @@ class CertificateDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, - 'thumbprint': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials_type": {"required": True}, + "client_id": {"required": True}, + "secrets": {"required": True}, + "tenant_id": {"required": True}, + "thumbprint": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'CertificateDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "authority_url": {"key": "authorityUrl", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + "resource_url": {"key": "resourceUrl", "type": "str"}, + "secrets": {"key": "secrets", "type": "CertificateDatastoreSecrets"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "thumbprint": {"key": "thumbprint", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword authority_url: Authority URL used for authentication. :paramtype authority_url: str @@ -3755,13 +3746,13 @@ def __init__( :paramtype thumbprint: str """ super(CertificateDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Certificate' # type: str - self.authority_url = kwargs.get('authority_url', None) - self.client_id = kwargs['client_id'] - self.resource_url = kwargs.get('resource_url', None) - self.secrets = kwargs['secrets'] - self.tenant_id = kwargs['tenant_id'] - self.thumbprint = kwargs['thumbprint'] + self.credentials_type = "Certificate" # type: str + self.authority_url = kwargs.get("authority_url", None) + self.client_id = kwargs["client_id"] + self.resource_url = kwargs.get("resource_url", None) + self.secrets = kwargs["secrets"] + self.tenant_id = kwargs["tenant_id"] + self.thumbprint = kwargs["thumbprint"] class CertificateDatastoreSecrets(DatastoreSecrets): @@ -3778,25 +3769,22 @@ class CertificateDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'certificate': {'key': 'certificate', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "certificate": {"key": "certificate", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword certificate: Service principal certificate. :paramtype certificate: str """ super(CertificateDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Certificate' # type: str - self.certificate = kwargs.get('certificate', None) + self.secrets_type = "Certificate" # type: str + self.certificate = kwargs.get("certificate", None) class TableVertical(msrest.serialization.Model): @@ -3832,21 +3820,33 @@ class TableVertical(msrest.serialization.Model): """ _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "test_data": {"key": "testData", "type": "MLTableJobInput"}, + "test_data_size": {"key": "testDataSize", "type": "float"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "weight_column_name": {"key": "weightColumnName", "type": "str"}, + } + + def __init__(self, **kwargs): """ :keyword cv_split_column_names: Columns to use for CVSplit data. :paramtype cv_split_column_names: list[str] @@ -3879,15 +3879,17 @@ def __init__( :paramtype weight_column_name: str """ super(TableVertical, self).__init__(**kwargs) - self.cv_split_column_names = kwargs.get('cv_split_column_names', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.test_data = kwargs.get('test_data', None) - self.test_data_size = kwargs.get('test_data_size', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.weight_column_name = kwargs.get('weight_column_name', None) + self.cv_split_column_names = kwargs.get("cv_split_column_names", None) + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.limit_settings = kwargs.get("limit_settings", None) + self.n_cross_validations = kwargs.get("n_cross_validations", None) + self.test_data = kwargs.get("test_data", None) + self.test_data_size = kwargs.get("test_data_size", None) + self.validation_data = kwargs.get("validation_data", None) + self.validation_data_size = kwargs.get("validation_data_size", None) + self.weight_column_name = kwargs.get("weight_column_name", None) class Classification(AutoMLVertical, TableVertical): @@ -3947,33 +3949,48 @@ class Classification(AutoMLVertical, TableVertical): """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'positive_label': {'key': 'positiveLabel', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'ClassificationTrainingSettings'}, - } - - def __init__( - self, - **kwargs - ): + "task_type": {"required": True}, + "training_data": {"required": True}, + } + + _attribute_map = { + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "test_data": {"key": "testData", "type": "MLTableJobInput"}, + "test_data_size": {"key": "testDataSize", "type": "float"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "weight_column_name": {"key": "weightColumnName", "type": "str"}, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "positive_label": {"key": "positiveLabel", "type": "str"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, + "training_settings": { + "key": "trainingSettings", + "type": "ClassificationTrainingSettings", + }, + } + + def __init__(self, **kwargs): """ :keyword cv_split_column_names: Columns to use for CVSplit data. :paramtype cv_split_column_names: list[str] @@ -4023,22 +4040,24 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ClassificationTrainingSettings """ super(Classification, self).__init__(**kwargs) - self.cv_split_column_names = kwargs.get('cv_split_column_names', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.test_data = kwargs.get('test_data', None) - self.test_data_size = kwargs.get('test_data_size', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.weight_column_name = kwargs.get('weight_column_name', None) - self.task_type = 'Classification' # type: str - self.positive_label = kwargs.get('positive_label', None) - self.primary_metric = kwargs.get('primary_metric', None) - self.training_settings = kwargs.get('training_settings', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.cv_split_column_names = kwargs.get("cv_split_column_names", None) + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.limit_settings = kwargs.get("limit_settings", None) + self.n_cross_validations = kwargs.get("n_cross_validations", None) + self.test_data = kwargs.get("test_data", None) + self.test_data_size = kwargs.get("test_data_size", None) + self.validation_data = kwargs.get("validation_data", None) + self.validation_data_size = kwargs.get("validation_data_size", None) + self.weight_column_name = kwargs.get("weight_column_name", None) + self.task_type = "Classification" # type: str + self.positive_label = kwargs.get("positive_label", None) + self.primary_metric = kwargs.get("primary_metric", None) + self.training_settings = kwargs.get("training_settings", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class TrainingSettings(msrest.serialization.Model): @@ -4064,19 +4083,31 @@ class TrainingSettings(msrest.serialization.Model): """ _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - } - - def __init__( - self, - **kwargs - ): + "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, + "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, + } + + def __init__(self, **kwargs): """ :keyword enable_dnn_training: Enable recommendation of DNN models. :paramtype enable_dnn_training: bool @@ -4097,13 +4128,21 @@ def __init__( ~azure.mgmt.machinelearningservices.models.StackEnsembleSettings """ super(TrainingSettings, self).__init__(**kwargs) - self.enable_dnn_training = kwargs.get('enable_dnn_training', False) - self.enable_model_explainability = kwargs.get('enable_model_explainability', True) - self.enable_onnx_compatible_models = kwargs.get('enable_onnx_compatible_models', False) - self.enable_stack_ensemble = kwargs.get('enable_stack_ensemble', True) - self.enable_vote_ensemble = kwargs.get('enable_vote_ensemble', True) - self.ensemble_model_download_timeout = kwargs.get('ensemble_model_download_timeout', "PT5M") - self.stack_ensemble_settings = kwargs.get('stack_ensemble_settings', None) + self.enable_dnn_training = kwargs.get("enable_dnn_training", False) + self.enable_model_explainability = kwargs.get( + "enable_model_explainability", True + ) + self.enable_onnx_compatible_models = kwargs.get( + "enable_onnx_compatible_models", False + ) + self.enable_stack_ensemble = kwargs.get("enable_stack_ensemble", True) + self.enable_vote_ensemble = kwargs.get("enable_vote_ensemble", True) + self.ensemble_model_download_timeout = kwargs.get( + "ensemble_model_download_timeout", "PT5M" + ) + self.stack_ensemble_settings = kwargs.get( + "stack_ensemble_settings", None + ) class ClassificationTrainingSettings(TrainingSettings): @@ -4135,21 +4174,39 @@ class ClassificationTrainingSettings(TrainingSettings): """ _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): + "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, + "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, + "allowed_training_algorithms": { + "key": "allowedTrainingAlgorithms", + "type": "[str]", + }, + "blocked_training_algorithms": { + "key": "blockedTrainingAlgorithms", + "type": "[str]", + }, + } + + def __init__(self, **kwargs): """ :keyword enable_dnn_training: Enable recommendation of DNN models. :paramtype enable_dnn_training: bool @@ -4176,8 +4233,12 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ClassificationModels] """ super(ClassificationTrainingSettings, self).__init__(**kwargs) - self.allowed_training_algorithms = kwargs.get('allowed_training_algorithms', None) - self.blocked_training_algorithms = kwargs.get('blocked_training_algorithms', None) + self.allowed_training_algorithms = kwargs.get( + "allowed_training_algorithms", None + ) + self.blocked_training_algorithms = kwargs.get( + "blocked_training_algorithms", None + ) class ClusterUpdateParameters(msrest.serialization.Model): @@ -4188,19 +4249,19 @@ class ClusterUpdateParameters(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties.properties', 'type': 'ScaleSettingsInformation'}, + "properties": { + "key": "properties.properties", + "type": "ScaleSettingsInformation", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of ClusterUpdate. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ScaleSettingsInformation """ super(ClusterUpdateParameters, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class CodeConfiguration(msrest.serialization.Model): @@ -4215,18 +4276,19 @@ class CodeConfiguration(msrest.serialization.Model): """ _validation = { - 'scoring_script': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "scoring_script": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'scoring_script': {'key': 'scoringScript', 'type': 'str'}, + "code_id": {"key": "codeId", "type": "str"}, + "scoring_script": {"key": "scoringScript", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword code_id: ARM resource ID of the code asset. :paramtype code_id: str @@ -4234,8 +4296,8 @@ def __init__( :paramtype scoring_script: str """ super(CodeConfiguration, self).__init__(**kwargs) - self.code_id = kwargs.get('code_id', None) - self.scoring_script = kwargs['scoring_script'] + self.code_id = kwargs.get("code_id", None) + self.scoring_script = kwargs["scoring_script"] class CodeContainer(Resource): @@ -4261,31 +4323,28 @@ class CodeContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "CodeContainerProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeContainerProperties """ super(CodeContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class CodeContainerProperties(AssetContainer): @@ -4312,25 +4371,22 @@ class CodeContainerProperties(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -4356,14 +4412,11 @@ class CodeContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[CodeContainer]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of CodeContainer objects. If null, there are no additional pages. @@ -4372,8 +4425,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.CodeContainer] """ super(CodeContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class CodeVersion(Resource): @@ -4399,31 +4452,28 @@ class CodeVersion(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeVersionProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "CodeVersionProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeVersionProperties """ super(CodeVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class CodeVersionProperties(AssetBase): @@ -4450,23 +4500,20 @@ class CodeVersionProperties(AssetBase): """ _validation = { - 'provisioning_state': {'readonly': True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'code_uri': {'key': 'codeUri', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "code_uri": {"key": "codeUri", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -4482,7 +4529,7 @@ def __init__( :paramtype code_uri: str """ super(CodeVersionProperties, self).__init__(**kwargs) - self.code_uri = kwargs.get('code_uri', None) + self.code_uri = kwargs.get("code_uri", None) self.provisioning_state = None @@ -4497,14 +4544,11 @@ class CodeVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeVersion]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[CodeVersion]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of CodeVersion objects. If null, there are no additional pages. @@ -4513,8 +4557,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.CodeVersion] """ super(CodeVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class ColumnTransformer(msrest.serialization.Model): @@ -4528,14 +4572,11 @@ class ColumnTransformer(msrest.serialization.Model): """ _attribute_map = { - 'fields': {'key': 'fields', 'type': '[str]'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, + "fields": {"key": "fields", "type": "[str]"}, + "parameters": {"key": "parameters", "type": "object"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword fields: Fields to apply transformer logic on. :paramtype fields: list[str] @@ -4544,8 +4585,8 @@ def __init__( :paramtype parameters: any """ super(ColumnTransformer, self).__init__(**kwargs) - self.fields = kwargs.get('fields', None) - self.parameters = kwargs.get('parameters', None) + self.fields = kwargs.get("fields", None) + self.parameters = kwargs.get("parameters", None) class CommandJob(JobBaseProperties): @@ -4612,42 +4653,53 @@ class CommandJob(JobBaseProperties): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'parameters': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'CommandJobLimits'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - } - - def __init__( - self, - **kwargs - ): + "job_type": {"required": True}, + "status": {"readonly": True}, + "command": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "environment_id": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "parameters": {"readonly": True}, + } + + _attribute_map = { + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "code_id": {"key": "codeId", "type": "str"}, + "command": {"key": "command", "type": "str"}, + "distribution": { + "key": "distribution", + "type": "DistributionConfiguration", + }, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "limits": {"key": "limits", "type": "CommandJobLimits"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "parameters": {"key": "parameters", "type": "object"}, + "resources": {"key": "resources", "type": "JobResourceConfiguration"}, + } + + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -4696,17 +4748,17 @@ def __init__( :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration """ super(CommandJob, self).__init__(**kwargs) - self.job_type = 'Command' # type: str - self.code_id = kwargs.get('code_id', None) - self.command = kwargs['command'] - self.distribution = kwargs.get('distribution', None) - self.environment_id = kwargs['environment_id'] - self.environment_variables = kwargs.get('environment_variables', None) - self.inputs = kwargs.get('inputs', None) - self.limits = kwargs.get('limits', None) - self.outputs = kwargs.get('outputs', None) + self.job_type = "Command" # type: str + self.code_id = kwargs.get("code_id", None) + self.command = kwargs["command"] + self.distribution = kwargs.get("distribution", None) + self.environment_id = kwargs["environment_id"] + self.environment_variables = kwargs.get("environment_variables", None) + self.inputs = kwargs.get("inputs", None) + self.limits = kwargs.get("limits", None) + self.outputs = kwargs.get("outputs", None) self.parameters = None - self.resources = kwargs.get('resources', None) + self.resources = kwargs.get("resources", None) class JobLimits(msrest.serialization.Model): @@ -4726,22 +4778,22 @@ class JobLimits(msrest.serialization.Model): """ _validation = { - 'job_limits_type': {'required': True}, + "job_limits_type": {"required": True}, } _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "job_limits_type": {"key": "jobLimitsType", "type": "str"}, + "timeout": {"key": "timeout", "type": "duration"}, } _subtype_map = { - 'job_limits_type': {'Command': 'CommandJobLimits', 'Sweep': 'SweepJobLimits'} + "job_limits_type": { + "Command": "CommandJobLimits", + "Sweep": "SweepJobLimits", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. Only supports duration with precision as low as Seconds. @@ -4749,7 +4801,7 @@ def __init__( """ super(JobLimits, self).__init__(**kwargs) self.job_limits_type = None # type: Optional[str] - self.timeout = kwargs.get('timeout', None) + self.timeout = kwargs.get("timeout", None) class CommandJobLimits(JobLimits): @@ -4766,25 +4818,22 @@ class CommandJobLimits(JobLimits): """ _validation = { - 'job_limits_type': {'required': True}, + "job_limits_type": {"required": True}, } _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "job_limits_type": {"key": "jobLimitsType", "type": "str"}, + "timeout": {"key": "timeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. Only supports duration with precision as low as Seconds. :paramtype timeout: ~datetime.timedelta """ super(CommandJobLimits, self).__init__(**kwargs) - self.job_limits_type = 'Command' # type: str + self.job_limits_type = "Command" # type: str class ComponentContainer(Resource): @@ -4810,81 +4859,78 @@ class ComponentContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "ComponentContainerProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentContainerProperties """ super(ComponentContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class ComponentContainerProperties(AssetContainer): """Component container definition. -.. raw:: html + .. raw:: html - . + . - Variables are only populated by the server, and will be ignored when sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the component container. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState + :ivar description: The asset description text. + :vartype description: str + :ivar properties: The asset property dictionary. + :vartype properties: dict[str, str] + :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + :ivar is_archived: Is the asset archived?. + :vartype is_archived: bool + :ivar latest_version: The latest version inside this container. + :vartype latest_version: str + :ivar next_version: The next auto incremental version. + :vartype next_version: str + :ivar provisioning_state: Provisioning state for the component container. Possible values + include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.machinelearningservices.models.AssetProvisioningState """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -4910,14 +4956,11 @@ class ComponentContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ComponentContainer]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of ComponentContainer objects. If null, there are no additional pages. @@ -4925,9 +4968,11 @@ def __init__( :keyword value: An array of objects of type ComponentContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainer] """ - super(ComponentContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(ComponentContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class ComponentVersion(Resource): @@ -4953,31 +4998,31 @@ class ComponentVersion(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentVersionProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "ComponentVersionProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentVersionProperties """ super(ComponentVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class ComponentVersionProperties(AssetBase): @@ -4996,10 +5041,10 @@ class ComponentVersionProperties(AssetBase): :ivar is_archived: Is the asset archived?. :vartype is_archived: bool :ivar component_spec: Defines Component definition details. - - + + .. raw:: html - + . @@ -5011,23 +5056,20 @@ class ComponentVersionProperties(AssetBase): """ _validation = { - 'provisioning_state': {'readonly': True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'component_spec': {'key': 'componentSpec', 'type': 'object'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "component_spec": {"key": "componentSpec", "type": "object"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -5040,17 +5082,17 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool :keyword component_spec: Defines Component definition details. - - + + .. raw:: html - + . :paramtype component_spec: any """ super(ComponentVersionProperties, self).__init__(**kwargs) - self.component_spec = kwargs.get('component_spec', None) + self.component_spec = kwargs.get("component_spec", None) self.provisioning_state = None @@ -5065,14 +5107,11 @@ class ComponentVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentVersion]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ComponentVersion]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of ComponentVersion objects. If null, there are no additional pages. @@ -5080,9 +5119,11 @@ def __init__( :keyword value: An array of objects of type ComponentVersion. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersion] """ - super(ComponentVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(ComponentVersionResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class ComputeInstanceSchema(msrest.serialization.Model): @@ -5093,19 +5134,19 @@ class ComputeInstanceSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, + "properties": { + "key": "properties", + "type": "ComputeInstanceProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of ComputeInstance. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties """ super(ComputeInstanceSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class ComputeInstance(Compute, ComputeInstanceSchema): @@ -5147,32 +5188,35 @@ class ComputeInstance(Compute, ComputeInstanceSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + } + + _attribute_map = { + "properties": { + "key": "properties", + "type": "ComputeInstanceProperties", + }, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, + } + + def __init__(self, **kwargs): """ :keyword properties: Properties of ComputeInstance. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties @@ -5187,17 +5231,17 @@ def __init__( :paramtype disable_local_auth: bool """ super(ComputeInstance, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'ComputeInstance' # type: str - self.compute_location = kwargs.get('compute_location', None) + self.properties = kwargs.get("properties", None) + self.compute_type = "ComputeInstance" # type: str + self.compute_location = kwargs.get("compute_location", None) self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) + self.disable_local_auth = kwargs.get("disable_local_auth", None) class ComputeInstanceApplication(msrest.serialization.Model): @@ -5210,14 +5254,11 @@ class ComputeInstanceApplication(msrest.serialization.Model): """ _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, + "display_name": {"key": "displayName", "type": "str"}, + "endpoint_uri": {"key": "endpointUri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword display_name: Name of the ComputeInstance application. :paramtype display_name: str @@ -5225,8 +5266,8 @@ def __init__( :paramtype endpoint_uri: str """ super(ComputeInstanceApplication, self).__init__(**kwargs) - self.display_name = kwargs.get('display_name', None) - self.endpoint_uri = kwargs.get('endpoint_uri', None) + self.display_name = kwargs.get("display_name", None) + self.endpoint_uri = kwargs.get("endpoint_uri", None) class ComputeInstanceConnectivityEndpoints(msrest.serialization.Model): @@ -5242,21 +5283,17 @@ class ComputeInstanceConnectivityEndpoints(msrest.serialization.Model): """ _validation = { - 'public_ip_address': {'readonly': True}, - 'private_ip_address': {'readonly': True}, + "public_ip_address": {"readonly": True}, + "private_ip_address": {"readonly": True}, } _attribute_map = { - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + "public_ip_address": {"key": "publicIpAddress", "type": "str"}, + "private_ip_address": {"key": "privateIpAddress", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ComputeInstanceConnectivityEndpoints, self).__init__(**kwargs) self.public_ip_address = None self.private_ip_address = None @@ -5282,22 +5319,22 @@ class ComputeInstanceContainer(msrest.serialization.Model): """ _validation = { - 'services': {'readonly': True}, + "services": {"readonly": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'autosave': {'key': 'autosave', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'network': {'key': 'network', 'type': 'str'}, - 'environment': {'key': 'environment', 'type': 'ComputeInstanceEnvironmentInfo'}, - 'services': {'key': 'services', 'type': '[object]'}, + "name": {"key": "name", "type": "str"}, + "autosave": {"key": "autosave", "type": "str"}, + "gpu": {"key": "gpu", "type": "str"}, + "network": {"key": "network", "type": "str"}, + "environment": { + "key": "environment", + "type": "ComputeInstanceEnvironmentInfo", + }, + "services": {"key": "services", "type": "[object]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: Name of the ComputeInstance container. :paramtype name: str @@ -5312,11 +5349,11 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ComputeInstanceEnvironmentInfo """ super(ComputeInstanceContainer, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.autosave = kwargs.get('autosave', None) - self.gpu = kwargs.get('gpu', None) - self.network = kwargs.get('network', None) - self.environment = kwargs.get('environment', None) + self.name = kwargs.get("name", None) + self.autosave = kwargs.get("autosave", None) + self.gpu = kwargs.get("gpu", None) + self.network = kwargs.get("network", None) + self.environment = kwargs.get("environment", None) self.services = None @@ -5334,23 +5371,19 @@ class ComputeInstanceCreatedBy(msrest.serialization.Model): """ _validation = { - 'user_name': {'readonly': True}, - 'user_org_id': {'readonly': True}, - 'user_id': {'readonly': True}, + "user_name": {"readonly": True}, + "user_org_id": {"readonly": True}, + "user_id": {"readonly": True}, } _attribute_map = { - 'user_name': {'key': 'userName', 'type': 'str'}, - 'user_org_id': {'key': 'userOrgId', 'type': 'str'}, - 'user_id': {'key': 'userId', 'type': 'str'}, + "user_name": {"key": "userName", "type": "str"}, + "user_org_id": {"key": "userOrgId", "type": "str"}, + "user_id": {"key": "userId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ComputeInstanceCreatedBy, self).__init__(**kwargs) self.user_name = None self.user_org_id = None @@ -5375,16 +5408,13 @@ class ComputeInstanceDataDisk(msrest.serialization.Model): """ _attribute_map = { - 'caching': {'key': 'caching', 'type': 'str'}, - 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, - 'lun': {'key': 'lun', 'type': 'int'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + "caching": {"key": "caching", "type": "str"}, + "disk_size_gb": {"key": "diskSizeGB", "type": "int"}, + "lun": {"key": "lun", "type": "int"}, + "storage_account_type": {"key": "storageAccountType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword caching: Caching type of Data Disk. Possible values include: "None", "ReadOnly", "ReadWrite". @@ -5400,10 +5430,12 @@ def __init__( ~azure.mgmt.machinelearningservices.models.StorageAccountType """ super(ComputeInstanceDataDisk, self).__init__(**kwargs) - self.caching = kwargs.get('caching', None) - self.disk_size_gb = kwargs.get('disk_size_gb', None) - self.lun = kwargs.get('lun', None) - self.storage_account_type = kwargs.get('storage_account_type', "Standard_LRS") + self.caching = kwargs.get("caching", None) + self.disk_size_gb = kwargs.get("disk_size_gb", None) + self.lun = kwargs.get("lun", None) + self.storage_account_type = kwargs.get( + "storage_account_type", "Standard_LRS" + ) class ComputeInstanceDataMount(msrest.serialization.Model): @@ -5431,21 +5463,18 @@ class ComputeInstanceDataMount(msrest.serialization.Model): """ _attribute_map = { - 'source': {'key': 'source', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'mount_name': {'key': 'mountName', 'type': 'str'}, - 'mount_action': {'key': 'mountAction', 'type': 'str'}, - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - 'mount_state': {'key': 'mountState', 'type': 'str'}, - 'mounted_on': {'key': 'mountedOn', 'type': 'iso-8601'}, - 'error': {'key': 'error', 'type': 'str'}, + "source": {"key": "source", "type": "str"}, + "source_type": {"key": "sourceType", "type": "str"}, + "mount_name": {"key": "mountName", "type": "str"}, + "mount_action": {"key": "mountAction", "type": "str"}, + "created_by": {"key": "createdBy", "type": "str"}, + "mount_path": {"key": "mountPath", "type": "str"}, + "mount_state": {"key": "mountState", "type": "str"}, + "mounted_on": {"key": "mountedOn", "type": "iso-8601"}, + "error": {"key": "error", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword source: Source of the ComputeInstance data mount. :paramtype source: str @@ -5468,15 +5497,15 @@ def __init__( :paramtype error: str """ super(ComputeInstanceDataMount, self).__init__(**kwargs) - self.source = kwargs.get('source', None) - self.source_type = kwargs.get('source_type', None) - self.mount_name = kwargs.get('mount_name', None) - self.mount_action = kwargs.get('mount_action', None) - self.created_by = kwargs.get('created_by', None) - self.mount_path = kwargs.get('mount_path', None) - self.mount_state = kwargs.get('mount_state', None) - self.mounted_on = kwargs.get('mounted_on', None) - self.error = kwargs.get('error', None) + self.source = kwargs.get("source", None) + self.source_type = kwargs.get("source_type", None) + self.mount_name = kwargs.get("mount_name", None) + self.mount_action = kwargs.get("mount_action", None) + self.created_by = kwargs.get("created_by", None) + self.mount_path = kwargs.get("mount_path", None) + self.mount_state = kwargs.get("mount_state", None) + self.mounted_on = kwargs.get("mounted_on", None) + self.error = kwargs.get("error", None) class ComputeInstanceEnvironmentInfo(msrest.serialization.Model): @@ -5489,14 +5518,11 @@ class ComputeInstanceEnvironmentInfo(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "version": {"key": "version", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: name of environment. :paramtype name: str @@ -5504,8 +5530,8 @@ def __init__( :paramtype version: str """ super(ComputeInstanceEnvironmentInfo, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.version = kwargs.get('version', None) + self.name = kwargs.get("name", None) + self.version = kwargs.get("version", None) class ComputeInstanceLastOperation(msrest.serialization.Model): @@ -5525,16 +5551,13 @@ class ComputeInstanceLastOperation(msrest.serialization.Model): """ _attribute_map = { - 'operation_name': {'key': 'operationName', 'type': 'str'}, - 'operation_time': {'key': 'operationTime', 'type': 'iso-8601'}, - 'operation_status': {'key': 'operationStatus', 'type': 'str'}, - 'operation_trigger': {'key': 'operationTrigger', 'type': 'str'}, + "operation_name": {"key": "operationName", "type": "str"}, + "operation_time": {"key": "operationTime", "type": "iso-8601"}, + "operation_status": {"key": "operationStatus", "type": "str"}, + "operation_trigger": {"key": "operationTrigger", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword operation_name: Name of the last operation. Possible values include: "Create", "Start", "Stop", "Restart", "Reimage", "Delete". @@ -5551,10 +5574,10 @@ def __init__( ~azure.mgmt.machinelearningservices.models.OperationTrigger """ super(ComputeInstanceLastOperation, self).__init__(**kwargs) - self.operation_name = kwargs.get('operation_name', None) - self.operation_time = kwargs.get('operation_time', None) - self.operation_status = kwargs.get('operation_status', None) - self.operation_trigger = kwargs.get('operation_trigger', None) + self.operation_name = kwargs.get("operation_name", None) + self.operation_time = kwargs.get("operation_time", None) + self.operation_status = kwargs.get("operation_status", None) + self.operation_trigger = kwargs.get("operation_trigger", None) class ComputeInstanceProperties(msrest.serialization.Model): @@ -5626,47 +5649,80 @@ class ComputeInstanceProperties(msrest.serialization.Model): """ _validation = { - 'os_image_metadata': {'readonly': True}, - 'connectivity_endpoints': {'readonly': True}, - 'applications': {'readonly': True}, - 'created_by': {'readonly': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'last_operation': {'readonly': True}, - 'containers': {'readonly': True}, - 'data_disks': {'readonly': True}, - 'data_mounts': {'readonly': True}, - 'versions': {'readonly': True}, - } - - _attribute_map = { - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'application_sharing_policy': {'key': 'applicationSharingPolicy', 'type': 'str'}, - 'ssh_settings': {'key': 'sshSettings', 'type': 'ComputeInstanceSshSettings'}, - 'custom_services': {'key': 'customServices', 'type': '[CustomService]'}, - 'os_image_metadata': {'key': 'osImageMetadata', 'type': 'ImageMetadata'}, - 'connectivity_endpoints': {'key': 'connectivityEndpoints', 'type': 'ComputeInstanceConnectivityEndpoints'}, - 'applications': {'key': 'applications', 'type': '[ComputeInstanceApplication]'}, - 'created_by': {'key': 'createdBy', 'type': 'ComputeInstanceCreatedBy'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'compute_instance_authorization_type': {'key': 'computeInstanceAuthorizationType', 'type': 'str'}, - 'personal_compute_instance_settings': {'key': 'personalComputeInstanceSettings', 'type': 'PersonalComputeInstanceSettings'}, - 'setup_scripts': {'key': 'setupScripts', 'type': 'SetupScripts'}, - 'last_operation': {'key': 'lastOperation', 'type': 'ComputeInstanceLastOperation'}, - 'schedules': {'key': 'schedules', 'type': 'ComputeSchedules'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'containers': {'key': 'containers', 'type': '[ComputeInstanceContainer]'}, - 'data_disks': {'key': 'dataDisks', 'type': '[ComputeInstanceDataDisk]'}, - 'data_mounts': {'key': 'dataMounts', 'type': '[ComputeInstanceDataMount]'}, - 'versions': {'key': 'versions', 'type': 'ComputeInstanceVersion'}, - } - - def __init__( - self, - **kwargs - ): + "os_image_metadata": {"readonly": True}, + "connectivity_endpoints": {"readonly": True}, + "applications": {"readonly": True}, + "created_by": {"readonly": True}, + "errors": {"readonly": True}, + "state": {"readonly": True}, + "last_operation": {"readonly": True}, + "containers": {"readonly": True}, + "data_disks": {"readonly": True}, + "data_mounts": {"readonly": True}, + "versions": {"readonly": True}, + } + + _attribute_map = { + "vm_size": {"key": "vmSize", "type": "str"}, + "subnet": {"key": "subnet", "type": "ResourceId"}, + "application_sharing_policy": { + "key": "applicationSharingPolicy", + "type": "str", + }, + "ssh_settings": { + "key": "sshSettings", + "type": "ComputeInstanceSshSettings", + }, + "custom_services": { + "key": "customServices", + "type": "[CustomService]", + }, + "os_image_metadata": { + "key": "osImageMetadata", + "type": "ImageMetadata", + }, + "connectivity_endpoints": { + "key": "connectivityEndpoints", + "type": "ComputeInstanceConnectivityEndpoints", + }, + "applications": { + "key": "applications", + "type": "[ComputeInstanceApplication]", + }, + "created_by": {"key": "createdBy", "type": "ComputeInstanceCreatedBy"}, + "errors": {"key": "errors", "type": "[ErrorResponse]"}, + "state": {"key": "state", "type": "str"}, + "compute_instance_authorization_type": { + "key": "computeInstanceAuthorizationType", + "type": "str", + }, + "personal_compute_instance_settings": { + "key": "personalComputeInstanceSettings", + "type": "PersonalComputeInstanceSettings", + }, + "setup_scripts": {"key": "setupScripts", "type": "SetupScripts"}, + "last_operation": { + "key": "lastOperation", + "type": "ComputeInstanceLastOperation", + }, + "schedules": {"key": "schedules", "type": "ComputeSchedules"}, + "enable_node_public_ip": {"key": "enableNodePublicIp", "type": "bool"}, + "containers": { + "key": "containers", + "type": "[ComputeInstanceContainer]", + }, + "data_disks": { + "key": "dataDisks", + "type": "[ComputeInstanceDataDisk]", + }, + "data_mounts": { + "key": "dataMounts", + "type": "[ComputeInstanceDataMount]", + }, + "versions": {"key": "versions", "type": "ComputeInstanceVersion"}, + } + + def __init__(self, **kwargs): """ :keyword vm_size: Virtual Machine Size. :paramtype vm_size: str @@ -5702,23 +5758,29 @@ def __init__( :paramtype enable_node_public_ip: bool """ super(ComputeInstanceProperties, self).__init__(**kwargs) - self.vm_size = kwargs.get('vm_size', None) - self.subnet = kwargs.get('subnet', None) - self.application_sharing_policy = kwargs.get('application_sharing_policy', "Shared") - self.ssh_settings = kwargs.get('ssh_settings', None) - self.custom_services = kwargs.get('custom_services', None) + self.vm_size = kwargs.get("vm_size", None) + self.subnet = kwargs.get("subnet", None) + self.application_sharing_policy = kwargs.get( + "application_sharing_policy", "Shared" + ) + self.ssh_settings = kwargs.get("ssh_settings", None) + self.custom_services = kwargs.get("custom_services", None) self.os_image_metadata = None self.connectivity_endpoints = None self.applications = None self.created_by = None self.errors = None self.state = None - self.compute_instance_authorization_type = kwargs.get('compute_instance_authorization_type', "personal") - self.personal_compute_instance_settings = kwargs.get('personal_compute_instance_settings', None) - self.setup_scripts = kwargs.get('setup_scripts', None) + self.compute_instance_authorization_type = kwargs.get( + "compute_instance_authorization_type", "personal" + ) + self.personal_compute_instance_settings = kwargs.get( + "personal_compute_instance_settings", None + ) + self.setup_scripts = kwargs.get("setup_scripts", None) self.last_operation = None - self.schedules = kwargs.get('schedules', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) + self.schedules = kwargs.get("schedules", None) + self.enable_node_public_ip = kwargs.get("enable_node_public_ip", None) self.containers = None self.data_disks = None self.data_mounts = None @@ -5745,21 +5807,18 @@ class ComputeInstanceSshSettings(msrest.serialization.Model): """ _validation = { - 'admin_user_name': {'readonly': True}, - 'ssh_port': {'readonly': True}, + "admin_user_name": {"readonly": True}, + "ssh_port": {"readonly": True}, } _attribute_map = { - 'ssh_public_access': {'key': 'sshPublicAccess', 'type': 'str'}, - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'admin_public_key': {'key': 'adminPublicKey', 'type': 'str'}, + "ssh_public_access": {"key": "sshPublicAccess", "type": "str"}, + "admin_user_name": {"key": "adminUserName", "type": "str"}, + "ssh_port": {"key": "sshPort", "type": "int"}, + "admin_public_key": {"key": "adminPublicKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword ssh_public_access: State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the @@ -5771,10 +5830,10 @@ def __init__( :paramtype admin_public_key: str """ super(ComputeInstanceSshSettings, self).__init__(**kwargs) - self.ssh_public_access = kwargs.get('ssh_public_access', "Disabled") + self.ssh_public_access = kwargs.get("ssh_public_access", "Disabled") self.admin_user_name = None self.ssh_port = None - self.admin_public_key = kwargs.get('admin_public_key', None) + self.admin_public_key = kwargs.get("admin_public_key", None) class ComputeInstanceVersion(msrest.serialization.Model): @@ -5785,19 +5844,16 @@ class ComputeInstanceVersion(msrest.serialization.Model): """ _attribute_map = { - 'runtime': {'key': 'runtime', 'type': 'str'}, + "runtime": {"key": "runtime", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword runtime: Runtime of compute instance. :paramtype runtime: str """ super(ComputeInstanceVersion, self).__init__(**kwargs) - self.runtime = kwargs.get('runtime', None) + self.runtime = kwargs.get("runtime", None) class ComputeResourceSchema(msrest.serialization.Model): @@ -5808,19 +5864,16 @@ class ComputeResourceSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, + "properties": {"key": "properties", "type": "Compute"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Compute properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute """ super(ComputeResourceSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class ComputeResource(Resource, ComputeResourceSchema): @@ -5852,28 +5905,25 @@ class ComputeResource(Resource, ComputeResourceSchema): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "properties": {"key": "properties", "type": "Compute"}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Compute properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute @@ -5887,11 +5937,11 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ super(ComputeResource, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) + self.properties = kwargs.get("properties", None) + self.identity = kwargs.get("identity", None) + self.location = kwargs.get("location", None) + self.tags = kwargs.get("tags", None) + self.sku = kwargs.get("sku", None) self.id = None self.name = None self.type = None @@ -5907,20 +5957,20 @@ class ComputeSchedules(msrest.serialization.Model): """ _attribute_map = { - 'compute_start_stop': {'key': 'computeStartStop', 'type': '[ComputeStartStopSchedule]'}, + "compute_start_stop": { + "key": "computeStartStop", + "type": "[ComputeStartStopSchedule]", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword compute_start_stop: The list of compute start stop schedules to be applied. :paramtype compute_start_stop: list[~azure.mgmt.machinelearningservices.models.ComputeStartStopSchedule] """ super(ComputeSchedules, self).__init__(**kwargs) - self.compute_start_stop = kwargs.get('compute_start_stop', None) + self.compute_start_stop = kwargs.get("compute_start_stop", None) class ComputeStartStopSchedule(msrest.serialization.Model): @@ -5951,25 +6001,22 @@ class ComputeStartStopSchedule(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'provisioning_status': {'readonly': True}, + "id": {"readonly": True}, + "provisioning_status": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'recurrence': {'key': 'recurrence', 'type': 'Recurrence'}, - 'cron': {'key': 'cron', 'type': 'Cron'}, - 'schedule': {'key': 'schedule', 'type': 'ScheduleBase'}, + "id": {"key": "id", "type": "str"}, + "provisioning_status": {"key": "provisioningStatus", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "action": {"key": "action", "type": "str"}, + "trigger_type": {"key": "triggerType", "type": "str"}, + "recurrence": {"key": "recurrence", "type": "Recurrence"}, + "cron": {"key": "cron", "type": "Cron"}, + "schedule": {"key": "schedule", "type": "ScheduleBase"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword status: Is the schedule enabled or disabled?. Possible values include: "Enabled", "Disabled". @@ -5989,12 +6036,12 @@ def __init__( super(ComputeStartStopSchedule, self).__init__(**kwargs) self.id = None self.provisioning_status = None - self.status = kwargs.get('status', None) - self.action = kwargs.get('action', None) - self.trigger_type = kwargs.get('trigger_type', None) - self.recurrence = kwargs.get('recurrence', None) - self.cron = kwargs.get('cron', None) - self.schedule = kwargs.get('schedule', None) + self.status = kwargs.get("status", None) + self.action = kwargs.get("action", None) + self.trigger_type = kwargs.get("trigger_type", None) + self.recurrence = kwargs.get("recurrence", None) + self.cron = kwargs.get("cron", None) + self.schedule = kwargs.get("schedule", None) class ContainerResourceRequirements(msrest.serialization.Model): @@ -6009,14 +6056,17 @@ class ContainerResourceRequirements(msrest.serialization.Model): """ _attribute_map = { - 'container_resource_limits': {'key': 'containerResourceLimits', 'type': 'ContainerResourceSettings'}, - 'container_resource_requests': {'key': 'containerResourceRequests', 'type': 'ContainerResourceSettings'}, + "container_resource_limits": { + "key": "containerResourceLimits", + "type": "ContainerResourceSettings", + }, + "container_resource_requests": { + "key": "containerResourceRequests", + "type": "ContainerResourceSettings", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword container_resource_limits: Container resource limit info:. :paramtype container_resource_limits: @@ -6026,8 +6076,12 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings """ super(ContainerResourceRequirements, self).__init__(**kwargs) - self.container_resource_limits = kwargs.get('container_resource_limits', None) - self.container_resource_requests = kwargs.get('container_resource_requests', None) + self.container_resource_limits = kwargs.get( + "container_resource_limits", None + ) + self.container_resource_requests = kwargs.get( + "container_resource_requests", None + ) class ContainerResourceSettings(msrest.serialization.Model): @@ -6045,15 +6099,12 @@ class ContainerResourceSettings(msrest.serialization.Model): """ _attribute_map = { - 'cpu': {'key': 'cpu', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'memory': {'key': 'memory', 'type': 'str'}, + "cpu": {"key": "cpu", "type": "str"}, + "gpu": {"key": "gpu", "type": "str"}, + "memory": {"key": "memory", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword cpu: Number of vCPUs request/limit for container. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. @@ -6066,9 +6117,9 @@ def __init__( :paramtype memory: str """ super(ContainerResourceSettings, self).__init__(**kwargs) - self.cpu = kwargs.get('cpu', None) - self.gpu = kwargs.get('gpu', None) - self.memory = kwargs.get('memory', None) + self.cpu = kwargs.get("cpu", None) + self.gpu = kwargs.get("gpu", None) + self.memory = kwargs.get("memory", None) class CosmosDbSettings(msrest.serialization.Model): @@ -6079,19 +6130,21 @@ class CosmosDbSettings(msrest.serialization.Model): """ _attribute_map = { - 'collections_throughput': {'key': 'collectionsThroughput', 'type': 'int'}, + "collections_throughput": { + "key": "collectionsThroughput", + "type": "int", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword collections_throughput: The throughput of the collections in cosmosdb database. :paramtype collections_throughput: int """ super(CosmosDbSettings, self).__init__(**kwargs) - self.collections_throughput = kwargs.get('collections_throughput', None) + self.collections_throughput = kwargs.get( + "collections_throughput", None + ) class Cron(msrest.serialization.Model): @@ -6109,15 +6162,12 @@ class Cron(msrest.serialization.Model): """ _attribute_map = { - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, + "start_time": {"key": "startTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "expression": {"key": "expression", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword start_time: The start time in yyyy-MM-ddTHH:mm:ss format. :paramtype start_time: str @@ -6130,9 +6180,9 @@ def __init__( :paramtype expression: str """ super(Cron, self).__init__(**kwargs) - self.start_time = kwargs.get('start_time', None) - self.time_zone = kwargs.get('time_zone', "UTC") - self.expression = kwargs.get('expression', None) + self.start_time = kwargs.get("start_time", None) + self.time_zone = kwargs.get("time_zone", "UTC") + self.expression = kwargs.get("expression", None) class TriggerBase(msrest.serialization.Model): @@ -6161,24 +6211,24 @@ class TriggerBase(msrest.serialization.Model): """ _validation = { - 'trigger_type': {'required': True}, + "trigger_type": {"required": True}, } _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, + "end_time": {"key": "endTime", "type": "str"}, + "start_time": {"key": "startTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "trigger_type": {"key": "triggerType", "type": "str"}, } _subtype_map = { - 'trigger_type': {'Cron': 'CronTrigger', 'Recurrence': 'RecurrenceTrigger'} + "trigger_type": { + "Cron": "CronTrigger", + "Recurrence": "RecurrenceTrigger", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer https://en.wikipedia.org/wiki/ISO_8601. @@ -6194,9 +6244,9 @@ def __init__( :paramtype time_zone: str """ super(TriggerBase, self).__init__(**kwargs) - self.end_time = kwargs.get('end_time', None) - self.start_time = kwargs.get('start_time', None) - self.time_zone = kwargs.get('time_zone', "UTC") + self.end_time = kwargs.get("end_time", None) + self.start_time = kwargs.get("start_time", None) + self.time_zone = kwargs.get("time_zone", "UTC") self.trigger_type = None # type: Optional[str] @@ -6226,22 +6276,23 @@ class CronTrigger(TriggerBase): """ _validation = { - 'trigger_type': {'required': True}, - 'expression': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "trigger_type": {"required": True}, + "expression": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, + "end_time": {"key": "endTime", "type": "str"}, + "start_time": {"key": "startTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "trigger_type": {"key": "triggerType", "type": "str"}, + "expression": {"key": "expression", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer https://en.wikipedia.org/wiki/ISO_8601. @@ -6260,8 +6311,8 @@ def __init__( :paramtype expression: str """ super(CronTrigger, self).__init__(**kwargs) - self.trigger_type = 'Cron' # type: str - self.expression = kwargs['expression'] + self.trigger_type = "Cron" # type: str + self.expression = kwargs["expression"] class CustomForecastHorizon(ForecastHorizon): @@ -6277,26 +6328,23 @@ class CustomForecastHorizon(ForecastHorizon): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Required. [Required] Forecast horizon value. :paramtype value: int """ super(CustomForecastHorizon, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] + self.mode = "Custom" # type: str + self.value = kwargs["value"] class JobInput(msrest.serialization.Model): @@ -6316,28 +6364,33 @@ class JobInput(msrest.serialization.Model): """ _validation = { - 'job_input_type': {'required': True}, + "job_input_type": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } _subtype_map = { - 'job_input_type': {'custom_model': 'CustomModelJobInput', 'literal': 'LiteralJobInput', 'mlflow_model': 'MLFlowModelJobInput', 'mltable': 'MLTableJobInput', 'triton_model': 'TritonModelJobInput', 'uri_file': 'UriFileJobInput', 'uri_folder': 'UriFolderJobInput'} + "job_input_type": { + "custom_model": "CustomModelJobInput", + "literal": "LiteralJobInput", + "mlflow_model": "MLFlowModelJobInput", + "mltable": "MLTableJobInput", + "triton_model": "TritonModelJobInput", + "uri_file": "UriFileJobInput", + "uri_folder": "UriFolderJobInput", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: Description for the input. :paramtype description: str """ super(JobInput, self).__init__(**kwargs) - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.job_input_type = None # type: Optional[str] @@ -6360,21 +6413,18 @@ class CustomModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "min_length": 1, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -6385,10 +6435,10 @@ def __init__( :paramtype description: str """ super(CustomModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'custom_model' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "custom_model" # type: str + self.description = kwargs.get("description", None) class JobOutput(msrest.serialization.Model): @@ -6408,28 +6458,32 @@ class JobOutput(msrest.serialization.Model): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } _subtype_map = { - 'job_output_type': {'custom_model': 'CustomModelJobOutput', 'mlflow_model': 'MLFlowModelJobOutput', 'mltable': 'MLTableJobOutput', 'triton_model': 'TritonModelJobOutput', 'uri_file': 'UriFileJobOutput', 'uri_folder': 'UriFolderJobOutput'} + "job_output_type": { + "custom_model": "CustomModelJobOutput", + "mlflow_model": "MLFlowModelJobOutput", + "mltable": "MLTableJobOutput", + "triton_model": "TritonModelJobOutput", + "uri_file": "UriFileJobOutput", + "uri_folder": "UriFolderJobOutput", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: Description for the output. :paramtype description: str """ super(JobOutput, self).__init__(**kwargs) - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.job_output_type = None # type: Optional[str] @@ -6451,20 +6505,17 @@ class CustomModelJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -6474,10 +6525,10 @@ def __init__( :paramtype description: str """ super(CustomModelJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'custom_model' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "custom_model" # type: str + self.description = kwargs.get("description", None) class CustomNCrossValidations(NCrossValidations): @@ -6493,26 +6544,23 @@ class CustomNCrossValidations(NCrossValidations): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Required. [Required] N-Cross validations value. :paramtype value: int """ super(CustomNCrossValidations, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] + self.mode = "Custom" # type: str + self.value = kwargs["value"] class CustomSeasonality(Seasonality): @@ -6528,26 +6576,23 @@ class CustomSeasonality(Seasonality): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Required. [Required] Seasonality value. :paramtype value: int """ super(CustomSeasonality, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] + self.mode = "Custom" # type: str + self.value = kwargs["value"] class CustomService(msrest.serialization.Model): @@ -6572,19 +6617,19 @@ class CustomService(msrest.serialization.Model): """ _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'name': {'key': 'name', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'Image'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{EnvironmentVariable}'}, - 'docker': {'key': 'docker', 'type': 'Docker'}, - 'endpoints': {'key': 'endpoints', 'type': '[Endpoint]'}, - 'volumes': {'key': 'volumes', 'type': '[VolumeDefinition]'}, + "additional_properties": {"key": "", "type": "{object}"}, + "name": {"key": "name", "type": "str"}, + "image": {"key": "image", "type": "Image"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{EnvironmentVariable}", + }, + "docker": {"key": "docker", "type": "Docker"}, + "endpoints": {"key": "endpoints", "type": "[Endpoint]"}, + "volumes": {"key": "volumes", "type": "[VolumeDefinition]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword additional_properties: Unmatched properties from the message are deserialized to this collection. @@ -6604,13 +6649,13 @@ def __init__( :paramtype volumes: list[~azure.mgmt.machinelearningservices.models.VolumeDefinition] """ super(CustomService, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.name = kwargs.get('name', None) - self.image = kwargs.get('image', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.docker = kwargs.get('docker', None) - self.endpoints = kwargs.get('endpoints', None) - self.volumes = kwargs.get('volumes', None) + self.additional_properties = kwargs.get("additional_properties", None) + self.name = kwargs.get("name", None) + self.image = kwargs.get("image", None) + self.environment_variables = kwargs.get("environment_variables", None) + self.docker = kwargs.get("docker", None) + self.endpoints = kwargs.get("endpoints", None) + self.volumes = kwargs.get("volumes", None) class CustomTargetLags(TargetLags): @@ -6626,26 +6671,23 @@ class CustomTargetLags(TargetLags): """ _validation = { - 'mode': {'required': True}, - 'values': {'required': True}, + "mode": {"required": True}, + "values": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[int]'}, + "mode": {"key": "mode", "type": "str"}, + "values": {"key": "values", "type": "[int]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword values: Required. [Required] Set target lags values. :paramtype values: list[int] """ super(CustomTargetLags, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.values = kwargs['values'] + self.mode = "Custom" # type: str + self.values = kwargs["values"] class CustomTargetRollingWindowSize(TargetRollingWindowSize): @@ -6661,26 +6703,23 @@ class CustomTargetRollingWindowSize(TargetRollingWindowSize): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Required. [Required] TargetRollingWindowSize value. :paramtype value: int """ super(CustomTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] + self.mode = "Custom" # type: str + self.value = kwargs["value"] class DatabricksSchema(msrest.serialization.Model): @@ -6691,19 +6730,16 @@ class DatabricksSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, + "properties": {"key": "properties", "type": "DatabricksProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of Databricks. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties """ super(DatabricksSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class Databricks(Compute, DatabricksSchema): @@ -6745,32 +6781,32 @@ class Databricks(Compute, DatabricksSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "DatabricksProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of Databricks. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties @@ -6785,17 +6821,17 @@ def __init__( :paramtype disable_local_auth: bool """ super(Databricks, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'Databricks' # type: str - self.compute_location = kwargs.get('compute_location', None) + self.properties = kwargs.get("properties", None) + self.compute_type = "Databricks" # type: str + self.compute_location = kwargs.get("compute_location", None) self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) + self.disable_local_auth = kwargs.get("disable_local_auth", None) class DatabricksComputeSecretsProperties(msrest.serialization.Model): @@ -6806,22 +6842,26 @@ class DatabricksComputeSecretsProperties(msrest.serialization.Model): """ _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword databricks_access_token: access token for databricks account. :paramtype databricks_access_token: str """ super(DatabricksComputeSecretsProperties, self).__init__(**kwargs) - self.databricks_access_token = kwargs.get('databricks_access_token', None) + self.databricks_access_token = kwargs.get( + "databricks_access_token", None + ) -class DatabricksComputeSecrets(ComputeSecrets, DatabricksComputeSecretsProperties): +class DatabricksComputeSecrets( + ComputeSecrets, DatabricksComputeSecretsProperties +): """Secrets related to a Machine Learning compute based on Databricks. All required parameters must be populated in order to send to Azure. @@ -6835,25 +6875,27 @@ class DatabricksComputeSecrets(ComputeSecrets, DatabricksComputeSecretsPropertie """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, + "compute_type": {"key": "computeType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword databricks_access_token: access token for databricks account. :paramtype databricks_access_token: str """ super(DatabricksComputeSecrets, self).__init__(**kwargs) - self.databricks_access_token = kwargs.get('databricks_access_token', None) - self.compute_type = 'Databricks' # type: str + self.databricks_access_token = kwargs.get( + "databricks_access_token", None + ) + self.compute_type = "Databricks" # type: str class DatabricksProperties(msrest.serialization.Model): @@ -6866,14 +6908,14 @@ class DatabricksProperties(msrest.serialization.Model): """ _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'workspace_url': {'key': 'workspaceUrl', 'type': 'str'}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, + "workspace_url": {"key": "workspaceUrl", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword databricks_access_token: Databricks access token. :paramtype databricks_access_token: str @@ -6881,8 +6923,10 @@ def __init__( :paramtype workspace_url: str """ super(DatabricksProperties, self).__init__(**kwargs) - self.databricks_access_token = kwargs.get('databricks_access_token', None) - self.workspace_url = kwargs.get('workspace_url', None) + self.databricks_access_token = kwargs.get( + "databricks_access_token", None + ) + self.workspace_url = kwargs.get("workspace_url", None) class DataContainer(Resource): @@ -6908,31 +6952,28 @@ class DataContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "DataContainerProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataContainerProperties """ super(DataContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class DataContainerProperties(AssetContainer): @@ -6960,25 +7001,22 @@ class DataContainerProperties(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'data_type': {'required': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "data_type": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "data_type": {"key": "dataType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -6993,7 +7031,7 @@ def __init__( :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType """ super(DataContainerProperties, self).__init__(**kwargs) - self.data_type = kwargs['data_type'] + self.data_type = kwargs["data_type"] class DataContainerResourceArmPaginatedResult(msrest.serialization.Model): @@ -7007,14 +7045,11 @@ class DataContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[DataContainer]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of DataContainer objects. If null, there are no additional pages. @@ -7023,8 +7058,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataContainer] """ super(DataContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class DataFactory(Compute): @@ -7064,31 +7099,31 @@ class DataFactory(Compute): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword compute_location: Location for the underlying compute. :paramtype compute_location: str @@ -7101,7 +7136,7 @@ def __init__( :paramtype disable_local_auth: bool """ super(DataFactory, self).__init__(**kwargs) - self.compute_type = 'DataFactory' # type: str + self.compute_type = "DataFactory" # type: str class DataLakeAnalyticsSchema(msrest.serialization.Model): @@ -7113,20 +7148,20 @@ class DataLakeAnalyticsSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, + "properties": { + "key": "properties", + "type": "DataLakeAnalyticsSchemaProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties """ super(DataLakeAnalyticsSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class DataLakeAnalytics(Compute, DataLakeAnalyticsSchema): @@ -7169,32 +7204,35 @@ class DataLakeAnalytics(Compute, DataLakeAnalyticsSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + } + + _attribute_map = { + "properties": { + "key": "properties", + "type": "DataLakeAnalyticsSchemaProperties", + }, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, + } + + def __init__(self, **kwargs): """ :keyword properties: :paramtype properties: @@ -7210,17 +7248,17 @@ def __init__( :paramtype disable_local_auth: bool """ super(DataLakeAnalytics, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'DataLakeAnalytics' # type: str - self.compute_location = kwargs.get('compute_location', None) + self.properties = kwargs.get("properties", None) + self.compute_type = "DataLakeAnalytics" # type: str + self.compute_location = kwargs.get("compute_location", None) self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) + self.disable_local_auth = kwargs.get("disable_local_auth", None) class DataLakeAnalyticsSchemaProperties(msrest.serialization.Model): @@ -7231,19 +7269,21 @@ class DataLakeAnalyticsSchemaProperties(msrest.serialization.Model): """ _attribute_map = { - 'data_lake_store_account_name': {'key': 'dataLakeStoreAccountName', 'type': 'str'}, + "data_lake_store_account_name": { + "key": "dataLakeStoreAccountName", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data_lake_store_account_name: DataLake Store Account Name. :paramtype data_lake_store_account_name: str """ super(DataLakeAnalyticsSchemaProperties, self).__init__(**kwargs) - self.data_lake_store_account_name = kwargs.get('data_lake_store_account_name', None) + self.data_lake_store_account_name = kwargs.get( + "data_lake_store_account_name", None + ) class DataPathAssetReference(AssetReferenceBase): @@ -7261,19 +7301,16 @@ class DataPathAssetReference(AssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'datastore_id': {'key': 'datastoreId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "datastore_id": {"key": "datastoreId", "type": "str"}, + "path": {"key": "path", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword datastore_id: ARM resource ID of the datastore where the asset is located. :paramtype datastore_id: str @@ -7281,9 +7318,9 @@ def __init__( :paramtype path: str """ super(DataPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'DataPath' # type: str - self.datastore_id = kwargs.get('datastore_id', None) - self.path = kwargs.get('path', None) + self.reference_type = "DataPath" # type: str + self.datastore_id = kwargs.get("datastore_id", None) + self.path = kwargs.get("path", None) class Datastore(Resource): @@ -7309,31 +7346,28 @@ class Datastore(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DatastoreProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "DatastoreProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatastoreProperties """ super(Datastore, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class DatastoreResourceArmPaginatedResult(msrest.serialization.Model): @@ -7347,14 +7381,11 @@ class DatastoreResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Datastore]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[Datastore]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of Datastore objects. If null, there are no additional pages. @@ -7363,8 +7394,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.Datastore] """ super(DatastoreResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class DataVersionBase(Resource): @@ -7390,31 +7421,31 @@ class DataVersionBase(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataVersionBaseProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "DataVersionBaseProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataVersionBaseProperties """ super(DataVersionBase, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class DataVersionBaseProperties(AssetBase): @@ -7444,28 +7475,33 @@ class DataVersionBaseProperties(AssetBase): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, } _subtype_map = { - 'data_type': {'mltable': 'MLTableData', 'uri_file': 'UriFileDataVersion', 'uri_folder': 'UriFolderDataVersion'} + "data_type": { + "mltable": "MLTableData", + "uri_file": "UriFileDataVersion", + "uri_folder": "UriFolderDataVersion", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -7482,8 +7518,8 @@ def __init__( :paramtype data_uri: str """ super(DataVersionBaseProperties, self).__init__(**kwargs) - self.data_type = 'DataVersionBaseProperties' # type: str - self.data_uri = kwargs['data_uri'] + self.data_type = "DataVersionBaseProperties" # type: str + self.data_uri = kwargs["data_uri"] class DataVersionBaseResourceArmPaginatedResult(msrest.serialization.Model): @@ -7497,14 +7533,11 @@ class DataVersionBaseResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataVersionBase]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[DataVersionBase]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of DataVersionBase objects. If null, there are no additional pages. @@ -7512,9 +7545,11 @@ def __init__( :keyword value: An array of objects of type DataVersionBase. :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBase] """ - super(DataVersionBaseResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(DataVersionBaseResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class OnlineScaleSettings(msrest.serialization.Model): @@ -7531,23 +7566,22 @@ class OnlineScaleSettings(msrest.serialization.Model): """ _validation = { - 'scale_type': {'required': True}, + "scale_type": {"required": True}, } _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, + "scale_type": {"key": "scaleType", "type": "str"}, } _subtype_map = { - 'scale_type': {'Default': 'DefaultScaleSettings', 'TargetUtilization': 'TargetUtilizationScaleSettings'} + "scale_type": { + "Default": "DefaultScaleSettings", + "TargetUtilization": "TargetUtilizationScaleSettings", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(OnlineScaleSettings, self).__init__(**kwargs) self.scale_type = None # type: Optional[str] @@ -7563,21 +7597,17 @@ class DefaultScaleSettings(OnlineScaleSettings): """ _validation = { - 'scale_type': {'required': True}, + "scale_type": {"required": True}, } _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, + "scale_type": {"key": "scaleType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DefaultScaleSettings, self).__init__(**kwargs) - self.scale_type = 'Default' # type: str + self.scale_type = "Default" # type: str class DeploymentLogs(msrest.serialization.Model): @@ -7588,19 +7618,16 @@ class DeploymentLogs(msrest.serialization.Model): """ _attribute_map = { - 'content': {'key': 'content', 'type': 'str'}, + "content": {"key": "content", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword content: The retrieved online deployment logs. :paramtype content: str """ super(DeploymentLogs, self).__init__(**kwargs) - self.content = kwargs.get('content', None) + self.content = kwargs.get("content", None) class DeploymentLogsRequest(msrest.serialization.Model): @@ -7614,14 +7641,11 @@ class DeploymentLogsRequest(msrest.serialization.Model): """ _attribute_map = { - 'container_type': {'key': 'containerType', 'type': 'str'}, - 'tail': {'key': 'tail', 'type': 'int'}, + "container_type": {"key": "containerType", "type": "str"}, + "tail": {"key": "tail", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword container_type: The type of container to retrieve logs from. Possible values include: "StorageInitializer", "InferenceServer". @@ -7630,8 +7654,8 @@ def __init__( :paramtype tail: int """ super(DeploymentLogsRequest, self).__init__(**kwargs) - self.container_type = kwargs.get('container_type', None) - self.tail = kwargs.get('tail', None) + self.container_type = kwargs.get("container_type", None) + self.tail = kwargs.get("tail", None) class ResourceConfiguration(msrest.serialization.Model): @@ -7646,15 +7670,12 @@ class ResourceConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "properties": {"key": "properties", "type": "{object}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword instance_count: Optional number of instances or nodes used by the compute target. :paramtype instance_count: int @@ -7664,9 +7685,9 @@ def __init__( :paramtype properties: dict[str, any] """ super(ResourceConfiguration, self).__init__(**kwargs) - self.instance_count = kwargs.get('instance_count', 1) - self.instance_type = kwargs.get('instance_type', None) - self.properties = kwargs.get('properties', None) + self.instance_count = kwargs.get("instance_count", 1) + self.instance_type = kwargs.get("instance_type", None) + self.properties = kwargs.get("properties", None) class DeploymentResourceConfiguration(ResourceConfiguration): @@ -7681,15 +7702,12 @@ class DeploymentResourceConfiguration(ResourceConfiguration): """ _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "properties": {"key": "properties", "type": "{object}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword instance_count: Optional number of instances or nodes used by the compute target. :paramtype instance_count: int @@ -7725,21 +7743,21 @@ class DiagnoseRequestProperties(msrest.serialization.Model): """ _attribute_map = { - 'udr': {'key': 'udr', 'type': '{object}'}, - 'nsg': {'key': 'nsg', 'type': '{object}'}, - 'resource_lock': {'key': 'resourceLock', 'type': '{object}'}, - 'dns_resolution': {'key': 'dnsResolution', 'type': '{object}'}, - 'storage_account': {'key': 'storageAccount', 'type': '{object}'}, - 'key_vault': {'key': 'keyVault', 'type': '{object}'}, - 'container_registry': {'key': 'containerRegistry', 'type': '{object}'}, - 'application_insights': {'key': 'applicationInsights', 'type': '{object}'}, - 'others': {'key': 'others', 'type': '{object}'}, + "udr": {"key": "udr", "type": "{object}"}, + "nsg": {"key": "nsg", "type": "{object}"}, + "resource_lock": {"key": "resourceLock", "type": "{object}"}, + "dns_resolution": {"key": "dnsResolution", "type": "{object}"}, + "storage_account": {"key": "storageAccount", "type": "{object}"}, + "key_vault": {"key": "keyVault", "type": "{object}"}, + "container_registry": {"key": "containerRegistry", "type": "{object}"}, + "application_insights": { + "key": "applicationInsights", + "type": "{object}", + }, + "others": {"key": "others", "type": "{object}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword udr: Setting for diagnosing user defined routing. :paramtype udr: dict[str, any] @@ -7761,15 +7779,15 @@ def __init__( :paramtype others: dict[str, any] """ super(DiagnoseRequestProperties, self).__init__(**kwargs) - self.udr = kwargs.get('udr', None) - self.nsg = kwargs.get('nsg', None) - self.resource_lock = kwargs.get('resource_lock', None) - self.dns_resolution = kwargs.get('dns_resolution', None) - self.storage_account = kwargs.get('storage_account', None) - self.key_vault = kwargs.get('key_vault', None) - self.container_registry = kwargs.get('container_registry', None) - self.application_insights = kwargs.get('application_insights', None) - self.others = kwargs.get('others', None) + self.udr = kwargs.get("udr", None) + self.nsg = kwargs.get("nsg", None) + self.resource_lock = kwargs.get("resource_lock", None) + self.dns_resolution = kwargs.get("dns_resolution", None) + self.storage_account = kwargs.get("storage_account", None) + self.key_vault = kwargs.get("key_vault", None) + self.container_registry = kwargs.get("container_registry", None) + self.application_insights = kwargs.get("application_insights", None) + self.others = kwargs.get("others", None) class DiagnoseResponseResult(msrest.serialization.Model): @@ -7780,19 +7798,16 @@ class DiagnoseResponseResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseResponseResultValue'}, + "value": {"key": "value", "type": "DiagnoseResponseResultValue"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: :paramtype value: ~azure.mgmt.machinelearningservices.models.DiagnoseResponseResultValue """ super(DiagnoseResponseResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class DiagnoseResponseResultValue(msrest.serialization.Model): @@ -7825,21 +7840,42 @@ class DiagnoseResponseResultValue(msrest.serialization.Model): """ _attribute_map = { - 'user_defined_route_results': {'key': 'userDefinedRouteResults', 'type': '[DiagnoseResult]'}, - 'network_security_rule_results': {'key': 'networkSecurityRuleResults', 'type': '[DiagnoseResult]'}, - 'resource_lock_results': {'key': 'resourceLockResults', 'type': '[DiagnoseResult]'}, - 'dns_resolution_results': {'key': 'dnsResolutionResults', 'type': '[DiagnoseResult]'}, - 'storage_account_results': {'key': 'storageAccountResults', 'type': '[DiagnoseResult]'}, - 'key_vault_results': {'key': 'keyVaultResults', 'type': '[DiagnoseResult]'}, - 'container_registry_results': {'key': 'containerRegistryResults', 'type': '[DiagnoseResult]'}, - 'application_insights_results': {'key': 'applicationInsightsResults', 'type': '[DiagnoseResult]'}, - 'other_results': {'key': 'otherResults', 'type': '[DiagnoseResult]'}, - } - - def __init__( - self, - **kwargs - ): + "user_defined_route_results": { + "key": "userDefinedRouteResults", + "type": "[DiagnoseResult]", + }, + "network_security_rule_results": { + "key": "networkSecurityRuleResults", + "type": "[DiagnoseResult]", + }, + "resource_lock_results": { + "key": "resourceLockResults", + "type": "[DiagnoseResult]", + }, + "dns_resolution_results": { + "key": "dnsResolutionResults", + "type": "[DiagnoseResult]", + }, + "storage_account_results": { + "key": "storageAccountResults", + "type": "[DiagnoseResult]", + }, + "key_vault_results": { + "key": "keyVaultResults", + "type": "[DiagnoseResult]", + }, + "container_registry_results": { + "key": "containerRegistryResults", + "type": "[DiagnoseResult]", + }, + "application_insights_results": { + "key": "applicationInsightsResults", + "type": "[DiagnoseResult]", + }, + "other_results": {"key": "otherResults", "type": "[DiagnoseResult]"}, + } + + def __init__(self, **kwargs): """ :keyword user_defined_route_results: :paramtype user_defined_route_results: @@ -7868,15 +7904,27 @@ def __init__( :paramtype other_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] """ super(DiagnoseResponseResultValue, self).__init__(**kwargs) - self.user_defined_route_results = kwargs.get('user_defined_route_results', None) - self.network_security_rule_results = kwargs.get('network_security_rule_results', None) - self.resource_lock_results = kwargs.get('resource_lock_results', None) - self.dns_resolution_results = kwargs.get('dns_resolution_results', None) - self.storage_account_results = kwargs.get('storage_account_results', None) - self.key_vault_results = kwargs.get('key_vault_results', None) - self.container_registry_results = kwargs.get('container_registry_results', None) - self.application_insights_results = kwargs.get('application_insights_results', None) - self.other_results = kwargs.get('other_results', None) + self.user_defined_route_results = kwargs.get( + "user_defined_route_results", None + ) + self.network_security_rule_results = kwargs.get( + "network_security_rule_results", None + ) + self.resource_lock_results = kwargs.get("resource_lock_results", None) + self.dns_resolution_results = kwargs.get( + "dns_resolution_results", None + ) + self.storage_account_results = kwargs.get( + "storage_account_results", None + ) + self.key_vault_results = kwargs.get("key_vault_results", None) + self.container_registry_results = kwargs.get( + "container_registry_results", None + ) + self.application_insights_results = kwargs.get( + "application_insights_results", None + ) + self.other_results = kwargs.get("other_results", None) class DiagnoseResult(msrest.serialization.Model): @@ -7894,23 +7942,19 @@ class DiagnoseResult(msrest.serialization.Model): """ _validation = { - 'code': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, + "code": {"readonly": True}, + "level": {"readonly": True}, + "message": {"readonly": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, + "code": {"key": "code", "type": "str"}, + "level": {"key": "level", "type": "str"}, + "message": {"key": "message", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DiagnoseResult, self).__init__(**kwargs) self.code = None self.level = None @@ -7925,19 +7969,16 @@ class DiagnoseWorkspaceParameters(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseRequestProperties'}, + "value": {"key": "value", "type": "DiagnoseRequestProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Value of Parameters. :paramtype value: ~azure.mgmt.machinelearningservices.models.DiagnoseRequestProperties """ super(DiagnoseWorkspaceParameters, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class DistributionConfiguration(msrest.serialization.Model): @@ -7954,23 +7995,23 @@ class DistributionConfiguration(msrest.serialization.Model): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, + "distribution_type": {"key": "distributionType", "type": "str"}, } _subtype_map = { - 'distribution_type': {'Mpi': 'Mpi', 'PyTorch': 'PyTorch', 'TensorFlow': 'TensorFlow'} + "distribution_type": { + "Mpi": "Mpi", + "PyTorch": "PyTorch", + "TensorFlow": "TensorFlow", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DistributionConfiguration, self).__init__(**kwargs) self.distribution_type = None # type: Optional[str] @@ -7986,14 +8027,11 @@ class Docker(msrest.serialization.Model): """ _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'privileged': {'key': 'privileged', 'type': 'bool'}, + "additional_properties": {"key": "", "type": "{object}"}, + "privileged": {"key": "privileged", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword additional_properties: Unmatched properties from the message are deserialized to this collection. @@ -8002,8 +8040,8 @@ def __init__( :paramtype privileged: bool """ super(Docker, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.privileged = kwargs.get('privileged', None) + self.additional_properties = kwargs.get("additional_properties", None) + self.privileged = kwargs.get("privileged", None) class EncryptionKeyVaultProperties(msrest.serialization.Model): @@ -8022,20 +8060,17 @@ class EncryptionKeyVaultProperties(msrest.serialization.Model): """ _validation = { - 'key_vault_arm_id': {'required': True}, - 'key_identifier': {'required': True}, + "key_vault_arm_id": {"required": True}, + "key_identifier": {"required": True}, } _attribute_map = { - 'key_vault_arm_id': {'key': 'keyVaultArmId', 'type': 'str'}, - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - 'identity_client_id': {'key': 'identityClientId', 'type': 'str'}, + "key_vault_arm_id": {"key": "keyVaultArmId", "type": "str"}, + "key_identifier": {"key": "keyIdentifier", "type": "str"}, + "identity_client_id": {"key": "identityClientId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword key_vault_arm_id: Required. The ArmId of the keyVault where the customer owned encryption key is present. @@ -8047,9 +8082,9 @@ def __init__( :paramtype identity_client_id: str """ super(EncryptionKeyVaultProperties, self).__init__(**kwargs) - self.key_vault_arm_id = kwargs['key_vault_arm_id'] - self.key_identifier = kwargs['key_identifier'] - self.identity_client_id = kwargs.get('identity_client_id', None) + self.key_vault_arm_id = kwargs["key_vault_arm_id"] + self.key_identifier = kwargs["key_identifier"] + self.identity_client_id = kwargs.get("identity_client_id", None) class EncryptionProperty(msrest.serialization.Model): @@ -8068,20 +8103,20 @@ class EncryptionProperty(msrest.serialization.Model): """ _validation = { - 'status': {'required': True}, - 'key_vault_properties': {'required': True}, + "status": {"required": True}, + "key_vault_properties": {"required": True}, } _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityForCmk'}, - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'EncryptionKeyVaultProperties'}, + "status": {"key": "status", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityForCmk"}, + "key_vault_properties": { + "key": "keyVaultProperties", + "type": "EncryptionKeyVaultProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword status: Required. Indicates whether or not the encryption is enabled for the workspace. Possible values include: "Enabled", "Disabled". @@ -8094,9 +8129,9 @@ def __init__( ~azure.mgmt.machinelearningservices.models.EncryptionKeyVaultProperties """ super(EncryptionProperty, self).__init__(**kwargs) - self.status = kwargs['status'] - self.identity = kwargs.get('identity', None) - self.key_vault_properties = kwargs['key_vault_properties'] + self.status = kwargs["status"] + self.identity = kwargs.get("identity", None) + self.key_vault_properties = kwargs["key_vault_properties"] class Endpoint(msrest.serialization.Model): @@ -8116,17 +8151,14 @@ class Endpoint(msrest.serialization.Model): """ _attribute_map = { - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'int'}, - 'published': {'key': 'published', 'type': 'int'}, - 'host_ip': {'key': 'hostIp', 'type': 'str'}, + "protocol": {"key": "protocol", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "target": {"key": "target", "type": "int"}, + "published": {"key": "published", "type": "int"}, + "host_ip": {"key": "hostIp", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword protocol: Protocol over which communication will happen over this endpoint. Possible values include: "tcp", "udp", "http". Default value: "tcp". @@ -8141,11 +8173,11 @@ def __init__( :paramtype host_ip: str """ super(Endpoint, self).__init__(**kwargs) - self.protocol = kwargs.get('protocol', "tcp") - self.name = kwargs.get('name', None) - self.target = kwargs.get('target', None) - self.published = kwargs.get('published', None) - self.host_ip = kwargs.get('host_ip', None) + self.protocol = kwargs.get("protocol", "tcp") + self.name = kwargs.get("name", None) + self.target = kwargs.get("target", None) + self.published = kwargs.get("published", None) + self.host_ip = kwargs.get("host_ip", None) class EndpointAuthKeys(msrest.serialization.Model): @@ -8158,14 +8190,11 @@ class EndpointAuthKeys(msrest.serialization.Model): """ _attribute_map = { - 'primary_key': {'key': 'primaryKey', 'type': 'str'}, - 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, + "primary_key": {"key": "primaryKey", "type": "str"}, + "secondary_key": {"key": "secondaryKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword primary_key: The primary key. :paramtype primary_key: str @@ -8173,8 +8202,8 @@ def __init__( :paramtype secondary_key: str """ super(EndpointAuthKeys, self).__init__(**kwargs) - self.primary_key = kwargs.get('primary_key', None) - self.secondary_key = kwargs.get('secondary_key', None) + self.primary_key = kwargs.get("primary_key", None) + self.secondary_key = kwargs.get("secondary_key", None) class EndpointAuthToken(msrest.serialization.Model): @@ -8191,16 +8220,16 @@ class EndpointAuthToken(msrest.serialization.Model): """ _attribute_map = { - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'expiry_time_utc': {'key': 'expiryTimeUtc', 'type': 'long'}, - 'refresh_after_time_utc': {'key': 'refreshAfterTimeUtc', 'type': 'long'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, + "access_token": {"key": "accessToken", "type": "str"}, + "expiry_time_utc": {"key": "expiryTimeUtc", "type": "long"}, + "refresh_after_time_utc": { + "key": "refreshAfterTimeUtc", + "type": "long", + }, + "token_type": {"key": "tokenType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword access_token: Access token for endpoint authentication. :paramtype access_token: str @@ -8212,10 +8241,10 @@ def __init__( :paramtype token_type: str """ super(EndpointAuthToken, self).__init__(**kwargs) - self.access_token = kwargs.get('access_token', None) - self.expiry_time_utc = kwargs.get('expiry_time_utc', 0) - self.refresh_after_time_utc = kwargs.get('refresh_after_time_utc', 0) - self.token_type = kwargs.get('token_type', None) + self.access_token = kwargs.get("access_token", None) + self.expiry_time_utc = kwargs.get("expiry_time_utc", 0) + self.refresh_after_time_utc = kwargs.get("refresh_after_time_utc", 0) + self.token_type = kwargs.get("token_type", None) class ScheduleActionBase(msrest.serialization.Model): @@ -8232,23 +8261,22 @@ class ScheduleActionBase(msrest.serialization.Model): """ _validation = { - 'action_type': {'required': True}, + "action_type": {"required": True}, } _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, + "action_type": {"key": "actionType", "type": "str"}, } _subtype_map = { - 'action_type': {'CreateJob': 'JobScheduleAction', 'InvokeBatchEndpoint': 'EndpointScheduleAction'} + "action_type": { + "CreateJob": "JobScheduleAction", + "InvokeBatchEndpoint": "EndpointScheduleAction", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ScheduleActionBase, self).__init__(**kwargs) self.action_type = None # type: Optional[str] @@ -8263,41 +8291,43 @@ class EndpointScheduleAction(ScheduleActionBase): :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType :ivar endpoint_invocation_definition: Required. [Required] Defines Schedule action definition details. - - + + .. raw:: html - + . :vartype endpoint_invocation_definition: any """ _validation = { - 'action_type': {'required': True}, - 'endpoint_invocation_definition': {'required': True}, + "action_type": {"required": True}, + "endpoint_invocation_definition": {"required": True}, } _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'endpoint_invocation_definition': {'key': 'endpointInvocationDefinition', 'type': 'object'}, + "action_type": {"key": "actionType", "type": "str"}, + "endpoint_invocation_definition": { + "key": "endpointInvocationDefinition", + "type": "object", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword endpoint_invocation_definition: Required. [Required] Defines Schedule action definition details. - - + + .. raw:: html - + . :paramtype endpoint_invocation_definition: any """ super(EndpointScheduleAction, self).__init__(**kwargs) - self.action_type = 'InvokeBatchEndpoint' # type: str - self.endpoint_invocation_definition = kwargs['endpoint_invocation_definition'] + self.action_type = "InvokeBatchEndpoint" # type: str + self.endpoint_invocation_definition = kwargs[ + "endpoint_invocation_definition" + ] class EnvironmentContainer(Resource): @@ -8323,32 +8353,32 @@ class EnvironmentContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "EnvironmentContainerProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerProperties """ super(EnvironmentContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class EnvironmentContainerProperties(AssetContainer): @@ -8375,25 +8405,22 @@ class EnvironmentContainerProperties(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -8408,7 +8435,9 @@ def __init__( self.provisioning_state = None -class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model): +class EnvironmentContainerResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of EnvironmentContainer entities. :ivar next_link: The link to the next page of EnvironmentContainer objects. If null, there are @@ -8419,14 +8448,11 @@ class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model) """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[EnvironmentContainer]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of EnvironmentContainer objects. If null, there are no additional pages. @@ -8434,9 +8460,11 @@ def __init__( :keyword value: An array of objects of type EnvironmentContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] """ - super(EnvironmentContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(EnvironmentContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class EnvironmentVariable(msrest.serialization.Model): @@ -8453,15 +8481,12 @@ class EnvironmentVariable(msrest.serialization.Model): """ _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "additional_properties": {"key": "", "type": "{object}"}, + "type": {"key": "type", "type": "str"}, + "value": {"key": "value", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword additional_properties: Unmatched properties from the message are deserialized to this collection. @@ -8473,9 +8498,9 @@ def __init__( :paramtype value: str """ super(EnvironmentVariable, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.type = kwargs.get('type', "local") - self.value = kwargs.get('value', None) + self.additional_properties = kwargs.get("additional_properties", None) + self.type = kwargs.get("type", "local") + self.value = kwargs.get("value", None) class EnvironmentVersion(Resource): @@ -8501,31 +8526,31 @@ class EnvironmentVersion(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentVersionProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "EnvironmentVersionProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionProperties """ super(EnvironmentVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class EnvironmentVersionProperties(AssetBase): @@ -8550,29 +8575,29 @@ class EnvironmentVersionProperties(AssetBase): :vartype build: ~azure.mgmt.machinelearningservices.models.BuildContext :ivar conda_file: Standard configuration file used by Conda that lets you install any kind of package, including Python, R, and C/C++ packages. - - + + .. raw:: html - + . :vartype conda_file: str :ivar environment_type: Environment type is either user managed or curated by the Azure ML service - - + + .. raw:: html - + . Possible values include: "Curated", "UserCreated". :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType :ivar image: Name of the image that will be used for the environment. - - + + .. raw:: html - + . @@ -8591,31 +8616,31 @@ class EnvironmentVersionProperties(AssetBase): """ _validation = { - 'environment_type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "environment_type": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'auto_rebuild': {'key': 'autoRebuild', 'type': 'str'}, - 'build': {'key': 'build', 'type': 'BuildContext'}, - 'conda_file': {'key': 'condaFile', 'type': 'str'}, - 'environment_type': {'key': 'environmentType', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'str'}, - 'inference_config': {'key': 'inferenceConfig', 'type': 'InferenceContainerProperties'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "auto_rebuild": {"key": "autoRebuild", "type": "str"}, + "build": {"key": "build", "type": "BuildContext"}, + "conda_file": {"key": "condaFile", "type": "str"}, + "environment_type": {"key": "environmentType", "type": "str"}, + "image": {"key": "image", "type": "str"}, + "inference_config": { + "key": "inferenceConfig", + "type": "InferenceContainerProperties", + }, + "os_type": {"key": "osType", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "stage": {"key": "stage", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -8634,19 +8659,19 @@ def __init__( :paramtype build: ~azure.mgmt.machinelearningservices.models.BuildContext :keyword conda_file: Standard configuration file used by Conda that lets you install any kind of package, including Python, R, and C/C++ packages. - - + + .. raw:: html - + . :paramtype conda_file: str :keyword image: Name of the image that will be used for the environment. - - + + .. raw:: html - + . @@ -8660,15 +8685,15 @@ def __init__( :paramtype stage: str """ super(EnvironmentVersionProperties, self).__init__(**kwargs) - self.auto_rebuild = kwargs.get('auto_rebuild', None) - self.build = kwargs.get('build', None) - self.conda_file = kwargs.get('conda_file', None) + self.auto_rebuild = kwargs.get("auto_rebuild", None) + self.build = kwargs.get("build", None) + self.conda_file = kwargs.get("conda_file", None) self.environment_type = None - self.image = kwargs.get('image', None) - self.inference_config = kwargs.get('inference_config', None) - self.os_type = kwargs.get('os_type', None) + self.image = kwargs.get("image", None) + self.inference_config = kwargs.get("inference_config", None) + self.os_type = kwargs.get("os_type", None) self.provisioning_state = None - self.stage = kwargs.get('stage', None) + self.stage = kwargs.get("stage", None) class EnvironmentVersionResourceArmPaginatedResult(msrest.serialization.Model): @@ -8682,14 +8707,11 @@ class EnvironmentVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentVersion]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[EnvironmentVersion]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of EnvironmentVersion objects. If null, there are no additional pages. @@ -8697,9 +8719,11 @@ def __init__( :keyword value: An array of objects of type EnvironmentVersion. :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] """ - super(EnvironmentVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(EnvironmentVersionResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class ErrorAdditionalInfo(msrest.serialization.Model): @@ -8714,21 +8738,17 @@ class ErrorAdditionalInfo(msrest.serialization.Model): """ _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, + "type": {"readonly": True}, + "info": {"readonly": True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, + "type": {"key": "type", "type": "str"}, + "info": {"key": "info", "type": "object"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ErrorAdditionalInfo, self).__init__(**kwargs) self.type = None self.info = None @@ -8752,27 +8772,26 @@ class ErrorDetail(msrest.serialization.Model): """ _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, + "code": {"readonly": True}, + "message": {"readonly": True}, + "target": {"readonly": True}, + "details": {"readonly": True}, + "additional_info": {"readonly": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[ErrorDetail]"}, + "additional_info": { + "key": "additionalInfo", + "type": "[ErrorAdditionalInfo]", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ErrorDetail, self).__init__(**kwargs) self.code = None self.message = None @@ -8789,19 +8808,16 @@ class ErrorResponse(msrest.serialization.Model): """ _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, + "error": {"key": "error", "type": "ErrorDetail"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword error: The error object. :paramtype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail """ super(ErrorResponse, self).__init__(**kwargs) - self.error = kwargs.get('error', None) + self.error = kwargs.get("error", None) class EstimatedVMPrice(msrest.serialization.Model): @@ -8820,21 +8836,18 @@ class EstimatedVMPrice(msrest.serialization.Model): """ _validation = { - 'retail_price': {'required': True}, - 'os_type': {'required': True}, - 'vm_tier': {'required': True}, + "retail_price": {"required": True}, + "os_type": {"required": True}, + "vm_tier": {"required": True}, } _attribute_map = { - 'retail_price': {'key': 'retailPrice', 'type': 'float'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_tier': {'key': 'vmTier', 'type': 'str'}, + "retail_price": {"key": "retailPrice", "type": "float"}, + "os_type": {"key": "osType", "type": "str"}, + "vm_tier": {"key": "vmTier", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword retail_price: Required. The price charged for using the VM. :paramtype retail_price: float @@ -8846,9 +8859,9 @@ def __init__( :paramtype vm_tier: str or ~azure.mgmt.machinelearningservices.models.VMTier """ super(EstimatedVMPrice, self).__init__(**kwargs) - self.retail_price = kwargs['retail_price'] - self.os_type = kwargs['os_type'] - self.vm_tier = kwargs['vm_tier'] + self.retail_price = kwargs["retail_price"] + self.os_type = kwargs["os_type"] + self.vm_tier = kwargs["vm_tier"] class EstimatedVMPrices(msrest.serialization.Model): @@ -8868,21 +8881,18 @@ class EstimatedVMPrices(msrest.serialization.Model): """ _validation = { - 'billing_currency': {'required': True}, - 'unit_of_measure': {'required': True}, - 'values': {'required': True}, + "billing_currency": {"required": True}, + "unit_of_measure": {"required": True}, + "values": {"required": True}, } _attribute_map = { - 'billing_currency': {'key': 'billingCurrency', 'type': 'str'}, - 'unit_of_measure': {'key': 'unitOfMeasure', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[EstimatedVMPrice]'}, + "billing_currency": {"key": "billingCurrency", "type": "str"}, + "unit_of_measure": {"key": "unitOfMeasure", "type": "str"}, + "values": {"key": "values", "type": "[EstimatedVMPrice]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword billing_currency: Required. Three lettered code specifying the currency of the VM price. Example: USD. Possible values include: "USD". @@ -8895,9 +8905,9 @@ def __init__( :paramtype values: list[~azure.mgmt.machinelearningservices.models.EstimatedVMPrice] """ super(EstimatedVMPrices, self).__init__(**kwargs) - self.billing_currency = kwargs['billing_currency'] - self.unit_of_measure = kwargs['unit_of_measure'] - self.values = kwargs['values'] + self.billing_currency = kwargs["billing_currency"] + self.unit_of_measure = kwargs["unit_of_measure"] + self.values = kwargs["values"] class ExternalFQDNResponse(msrest.serialization.Model): @@ -8908,19 +8918,16 @@ class ExternalFQDNResponse(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[FQDNEndpoints]'}, + "value": {"key": "value", "type": "[FQDNEndpoints]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: :paramtype value: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoints] """ super(ExternalFQDNResponse, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class FeaturizationSettings(msrest.serialization.Model): @@ -8931,19 +8938,16 @@ class FeaturizationSettings(msrest.serialization.Model): """ _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, + "dataset_language": {"key": "datasetLanguage", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword dataset_language: Dataset language, useful for the text data. :paramtype dataset_language: str """ super(FeaturizationSettings, self).__init__(**kwargs) - self.dataset_language = kwargs.get('dataset_language', None) + self.dataset_language = kwargs.get("dataset_language", None) class FlavorData(msrest.serialization.Model): @@ -8954,19 +8958,16 @@ class FlavorData(msrest.serialization.Model): """ _attribute_map = { - 'data': {'key': 'data', 'type': '{str}'}, + "data": {"key": "data", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data: Model flavor-specific data. :paramtype data: dict[str, str] """ super(FlavorData, self).__init__(**kwargs) - self.data = kwargs.get('data', None) + self.data = kwargs.get("data", None) class Forecasting(AutoMLVertical, TableVertical): @@ -9027,33 +9028,51 @@ class Forecasting(AutoMLVertical, TableVertical): """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'forecasting_settings': {'key': 'forecastingSettings', 'type': 'ForecastingSettings'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'ForecastingTrainingSettings'}, - } - - def __init__( - self, - **kwargs - ): + "task_type": {"required": True}, + "training_data": {"required": True}, + } + + _attribute_map = { + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "test_data": {"key": "testData", "type": "MLTableJobInput"}, + "test_data_size": {"key": "testDataSize", "type": "float"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "weight_column_name": {"key": "weightColumnName", "type": "str"}, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "forecasting_settings": { + "key": "forecastingSettings", + "type": "ForecastingSettings", + }, + "primary_metric": {"key": "primaryMetric", "type": "str"}, + "training_settings": { + "key": "trainingSettings", + "type": "ForecastingTrainingSettings", + }, + } + + def __init__(self, **kwargs): """ :keyword cv_split_column_names: Columns to use for CVSplit data. :paramtype cv_split_column_names: list[str] @@ -9104,22 +9123,24 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ForecastingTrainingSettings """ super(Forecasting, self).__init__(**kwargs) - self.cv_split_column_names = kwargs.get('cv_split_column_names', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.test_data = kwargs.get('test_data', None) - self.test_data_size = kwargs.get('test_data_size', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.weight_column_name = kwargs.get('weight_column_name', None) - self.task_type = 'Forecasting' # type: str - self.forecasting_settings = kwargs.get('forecasting_settings', None) - self.primary_metric = kwargs.get('primary_metric', None) - self.training_settings = kwargs.get('training_settings', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.cv_split_column_names = kwargs.get("cv_split_column_names", None) + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.limit_settings = kwargs.get("limit_settings", None) + self.n_cross_validations = kwargs.get("n_cross_validations", None) + self.test_data = kwargs.get("test_data", None) + self.test_data_size = kwargs.get("test_data_size", None) + self.validation_data = kwargs.get("validation_data", None) + self.validation_data_size = kwargs.get("validation_data_size", None) + self.weight_column_name = kwargs.get("weight_column_name", None) + self.task_type = "Forecasting" # type: str + self.forecasting_settings = kwargs.get("forecasting_settings", None) + self.primary_metric = kwargs.get("primary_metric", None) + self.training_settings = kwargs.get("training_settings", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class ForecastingSettings(msrest.serialization.Model): @@ -9177,25 +9198,40 @@ class ForecastingSettings(msrest.serialization.Model): """ _attribute_map = { - 'country_or_region_for_holidays': {'key': 'countryOrRegionForHolidays', 'type': 'str'}, - 'cv_step_size': {'key': 'cvStepSize', 'type': 'int'}, - 'feature_lags': {'key': 'featureLags', 'type': 'str'}, - 'forecast_horizon': {'key': 'forecastHorizon', 'type': 'ForecastHorizon'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'seasonality': {'key': 'seasonality', 'type': 'Seasonality'}, - 'short_series_handling_config': {'key': 'shortSeriesHandlingConfig', 'type': 'str'}, - 'target_aggregate_function': {'key': 'targetAggregateFunction', 'type': 'str'}, - 'target_lags': {'key': 'targetLags', 'type': 'TargetLags'}, - 'target_rolling_window_size': {'key': 'targetRollingWindowSize', 'type': 'TargetRollingWindowSize'}, - 'time_column_name': {'key': 'timeColumnName', 'type': 'str'}, - 'time_series_id_column_names': {'key': 'timeSeriesIdColumnNames', 'type': '[str]'}, - 'use_stl': {'key': 'useStl', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + "country_or_region_for_holidays": { + "key": "countryOrRegionForHolidays", + "type": "str", + }, + "cv_step_size": {"key": "cvStepSize", "type": "int"}, + "feature_lags": {"key": "featureLags", "type": "str"}, + "forecast_horizon": { + "key": "forecastHorizon", + "type": "ForecastHorizon", + }, + "frequency": {"key": "frequency", "type": "str"}, + "seasonality": {"key": "seasonality", "type": "Seasonality"}, + "short_series_handling_config": { + "key": "shortSeriesHandlingConfig", + "type": "str", + }, + "target_aggregate_function": { + "key": "targetAggregateFunction", + "type": "str", + }, + "target_lags": {"key": "targetLags", "type": "TargetLags"}, + "target_rolling_window_size": { + "key": "targetRollingWindowSize", + "type": "TargetRollingWindowSize", + }, + "time_column_name": {"key": "timeColumnName", "type": "str"}, + "time_series_id_column_names": { + "key": "timeSeriesIdColumnNames", + "type": "[str]", + }, + "use_stl": {"key": "useStl", "type": "str"}, + } + + def __init__(self, **kwargs): """ :keyword country_or_region_for_holidays: Country or region for holidays for forecasting tasks. These should be ISO 3166 two-letter country/region codes, for example 'US' or 'GB'. @@ -9250,19 +9286,29 @@ def __init__( :paramtype use_stl: str or ~azure.mgmt.machinelearningservices.models.UseStl """ super(ForecastingSettings, self).__init__(**kwargs) - self.country_or_region_for_holidays = kwargs.get('country_or_region_for_holidays', None) - self.cv_step_size = kwargs.get('cv_step_size', None) - self.feature_lags = kwargs.get('feature_lags', None) - self.forecast_horizon = kwargs.get('forecast_horizon', None) - self.frequency = kwargs.get('frequency', None) - self.seasonality = kwargs.get('seasonality', None) - self.short_series_handling_config = kwargs.get('short_series_handling_config', None) - self.target_aggregate_function = kwargs.get('target_aggregate_function', None) - self.target_lags = kwargs.get('target_lags', None) - self.target_rolling_window_size = kwargs.get('target_rolling_window_size', None) - self.time_column_name = kwargs.get('time_column_name', None) - self.time_series_id_column_names = kwargs.get('time_series_id_column_names', None) - self.use_stl = kwargs.get('use_stl', None) + self.country_or_region_for_holidays = kwargs.get( + "country_or_region_for_holidays", None + ) + self.cv_step_size = kwargs.get("cv_step_size", None) + self.feature_lags = kwargs.get("feature_lags", None) + self.forecast_horizon = kwargs.get("forecast_horizon", None) + self.frequency = kwargs.get("frequency", None) + self.seasonality = kwargs.get("seasonality", None) + self.short_series_handling_config = kwargs.get( + "short_series_handling_config", None + ) + self.target_aggregate_function = kwargs.get( + "target_aggregate_function", None + ) + self.target_lags = kwargs.get("target_lags", None) + self.target_rolling_window_size = kwargs.get( + "target_rolling_window_size", None + ) + self.time_column_name = kwargs.get("time_column_name", None) + self.time_series_id_column_names = kwargs.get( + "time_series_id_column_names", None + ) + self.use_stl = kwargs.get("use_stl", None) class ForecastingTrainingSettings(TrainingSettings): @@ -9294,21 +9340,39 @@ class ForecastingTrainingSettings(TrainingSettings): """ _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): + "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, + "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, + "allowed_training_algorithms": { + "key": "allowedTrainingAlgorithms", + "type": "[str]", + }, + "blocked_training_algorithms": { + "key": "blockedTrainingAlgorithms", + "type": "[str]", + }, + } + + def __init__(self, **kwargs): """ :keyword enable_dnn_training: Enable recommendation of DNN models. :paramtype enable_dnn_training: bool @@ -9335,8 +9399,12 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ForecastingModels] """ super(ForecastingTrainingSettings, self).__init__(**kwargs) - self.allowed_training_algorithms = kwargs.get('allowed_training_algorithms', None) - self.blocked_training_algorithms = kwargs.get('blocked_training_algorithms', None) + self.allowed_training_algorithms = kwargs.get( + "allowed_training_algorithms", None + ) + self.blocked_training_algorithms = kwargs.get( + "blocked_training_algorithms", None + ) class FQDNEndpoint(msrest.serialization.Model): @@ -9349,14 +9417,14 @@ class FQDNEndpoint(msrest.serialization.Model): """ _attribute_map = { - 'domain_name': {'key': 'domainName', 'type': 'str'}, - 'endpoint_details': {'key': 'endpointDetails', 'type': '[FQDNEndpointDetail]'}, + "domain_name": {"key": "domainName", "type": "str"}, + "endpoint_details": { + "key": "endpointDetails", + "type": "[FQDNEndpointDetail]", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword domain_name: :paramtype domain_name: str @@ -9365,8 +9433,8 @@ def __init__( list[~azure.mgmt.machinelearningservices.models.FQDNEndpointDetail] """ super(FQDNEndpoint, self).__init__(**kwargs) - self.domain_name = kwargs.get('domain_name', None) - self.endpoint_details = kwargs.get('endpoint_details', None) + self.domain_name = kwargs.get("domain_name", None) + self.endpoint_details = kwargs.get("endpoint_details", None) class FQDNEndpointDetail(msrest.serialization.Model): @@ -9377,19 +9445,16 @@ class FQDNEndpointDetail(msrest.serialization.Model): """ _attribute_map = { - 'port': {'key': 'port', 'type': 'int'}, + "port": {"key": "port", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword port: :paramtype port: int """ super(FQDNEndpointDetail, self).__init__(**kwargs) - self.port = kwargs.get('port', None) + self.port = kwargs.get("port", None) class FQDNEndpoints(msrest.serialization.Model): @@ -9400,19 +9465,16 @@ class FQDNEndpoints(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'FQDNEndpointsProperties'}, + "properties": {"key": "properties", "type": "FQDNEndpointsProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: :paramtype properties: ~azure.mgmt.machinelearningservices.models.FQDNEndpointsProperties """ super(FQDNEndpoints, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class FQDNEndpointsProperties(msrest.serialization.Model): @@ -9425,14 +9487,11 @@ class FQDNEndpointsProperties(msrest.serialization.Model): """ _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'endpoints': {'key': 'endpoints', 'type': '[FQDNEndpoint]'}, + "category": {"key": "category", "type": "str"}, + "endpoints": {"key": "endpoints", "type": "[FQDNEndpoint]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: :paramtype category: str @@ -9440,8 +9499,8 @@ def __init__( :paramtype endpoints: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoint] """ super(FQDNEndpointsProperties, self).__init__(**kwargs) - self.category = kwargs.get('category', None) - self.endpoints = kwargs.get('endpoints', None) + self.category = kwargs.get("category", None) + self.endpoints = kwargs.get("endpoints", None) class GridSamplingAlgorithm(SamplingAlgorithm): @@ -9457,21 +9516,20 @@ class GridSamplingAlgorithm(SamplingAlgorithm): """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(GridSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Grid' # type: str + self.sampling_algorithm_type = "Grid" # type: str class HDInsightSchema(msrest.serialization.Model): @@ -9482,19 +9540,16 @@ class HDInsightSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, + "properties": {"key": "properties", "type": "HDInsightProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: HDInsight compute properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties """ super(HDInsightSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class HDInsight(Compute, HDInsightSchema): @@ -9536,32 +9591,32 @@ class HDInsight(Compute, HDInsightSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "HDInsightProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: HDInsight compute properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties @@ -9576,17 +9631,17 @@ def __init__( :paramtype disable_local_auth: bool """ super(HDInsight, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'HDInsight' # type: str - self.compute_location = kwargs.get('compute_location', None) + self.properties = kwargs.get("properties", None) + self.compute_type = "HDInsight" # type: str + self.compute_location = kwargs.get("compute_location", None) self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) + self.disable_local_auth = kwargs.get("disable_local_auth", None) class HDInsightProperties(msrest.serialization.Model): @@ -9602,15 +9657,15 @@ class HDInsightProperties(msrest.serialization.Model): """ _attribute_map = { - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, + "ssh_port": {"key": "sshPort", "type": "int"}, + "address": {"key": "address", "type": "str"}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword ssh_port: Port open for ssh connections on the master node of the cluster. :paramtype ssh_port: int @@ -9621,9 +9676,9 @@ def __init__( ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials """ super(HDInsightProperties, self).__init__(**kwargs) - self.ssh_port = kwargs.get('ssh_port', None) - self.address = kwargs.get('address', None) - self.administrator_account = kwargs.get('administrator_account', None) + self.ssh_port = kwargs.get("ssh_port", None) + self.address = kwargs.get("address", None) + self.administrator_account = kwargs.get("administrator_account", None) class IdAssetReference(AssetReferenceBase): @@ -9639,26 +9694,27 @@ class IdAssetReference(AssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, - 'asset_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "reference_type": {"required": True}, + "asset_id": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'asset_id': {'key': 'assetId', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "asset_id": {"key": "assetId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword asset_id: Required. [Required] ARM resource ID of the asset. :paramtype asset_id: str """ super(IdAssetReference, self).__init__(**kwargs) - self.reference_type = 'Id' # type: str - self.asset_id = kwargs['asset_id'] + self.reference_type = "Id" # type: str + self.asset_id = kwargs["asset_id"] class IdentityForCmk(msrest.serialization.Model): @@ -9670,20 +9726,22 @@ class IdentityForCmk(msrest.serialization.Model): """ _attribute_map = { - 'user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, + "user_assigned_identity": { + "key": "userAssignedIdentity", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword user_assigned_identity: The ArmId of the user assigned identity that will be used to access the customer managed key vault. :paramtype user_assigned_identity: str """ super(IdentityForCmk, self).__init__(**kwargs) - self.user_assigned_identity = kwargs.get('user_assigned_identity', None) + self.user_assigned_identity = kwargs.get( + "user_assigned_identity", None + ) class IdleShutdownSetting(msrest.serialization.Model): @@ -9695,20 +9753,22 @@ class IdleShutdownSetting(msrest.serialization.Model): """ _attribute_map = { - 'idle_time_before_shutdown': {'key': 'idleTimeBeforeShutdown', 'type': 'str'}, + "idle_time_before_shutdown": { + "key": "idleTimeBeforeShutdown", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword idle_time_before_shutdown: Time is defined in ISO8601 format. Minimum is 15 min, maximum is 3 days. :paramtype idle_time_before_shutdown: str """ super(IdleShutdownSetting, self).__init__(**kwargs) - self.idle_time_before_shutdown = kwargs.get('idle_time_before_shutdown', None) + self.idle_time_before_shutdown = kwargs.get( + "idle_time_before_shutdown", None + ) class Image(msrest.serialization.Model): @@ -9725,15 +9785,12 @@ class Image(msrest.serialization.Model): """ _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'reference': {'key': 'reference', 'type': 'str'}, + "additional_properties": {"key": "", "type": "{object}"}, + "type": {"key": "type", "type": "str"}, + "reference": {"key": "reference", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword additional_properties: Unmatched properties from the message are deserialized to this collection. @@ -9745,45 +9802,51 @@ def __init__( :paramtype reference: str """ super(Image, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.type = kwargs.get('type', "docker") - self.reference = kwargs.get('reference', None) + self.additional_properties = kwargs.get("additional_properties", None) + self.type = kwargs.get("type", "docker") + self.reference = kwargs.get("reference", None) class ImageVertical(msrest.serialization.Model): """Abstract class for AutoML tasks that train image (computer vision) models - -such as Image Classification / Image Classification Multilabel / Image Object Detection / Image Instance Segmentation. - - All required parameters must be populated in order to send to Azure. + such as Image Classification / Image Classification Multilabel / Image Object Detection / Image Instance Segmentation. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - """ + All required parameters must be populated in order to send to Azure. + + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float + """ _validation = { - 'limit_settings': {'required': True}, + "limit_settings": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings @@ -9798,10 +9861,10 @@ def __init__( :paramtype validation_data_size: float """ super(ImageVertical, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) + self.limit_settings = kwargs["limit_settings"] + self.sweep_settings = kwargs.get("sweep_settings", None) + self.validation_data = kwargs.get("validation_data", None) + self.validation_data_size = kwargs.get("validation_data_size", None) class ImageClassificationBase(ImageVertical): @@ -9830,22 +9893,34 @@ class ImageClassificationBase(ImageVertical): """ _validation = { - 'limit_settings': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - } - - def __init__( - self, - **kwargs - ): + "limit_settings": {"required": True}, + } + + _attribute_map = { + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsClassification", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsClassification]", + }, + } + + def __init__(self, **kwargs): """ :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings @@ -9867,78 +9942,90 @@ def __init__( list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] """ super(ImageClassificationBase, self).__init__(**kwargs) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) + self.model_settings = kwargs.get("model_settings", None) + self.search_space = kwargs.get("search_space", None) class ImageClassification(AutoMLVertical, ImageClassificationBase): """Image Classification. Multi-class image classification is used when an image is classified with only a single label -from a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' or a 'duck'. + from a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' or a 'duck'. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + "limit_settings": {"required": True}, + "task_type": {"required": True}, + "training_data": {"required": True}, + } + + _attribute_map = { + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsClassification", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsClassification]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, + } + + def __init__(self, **kwargs): """ :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings @@ -9973,87 +10060,99 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ super(ImageClassification, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageClassification' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.limit_settings = kwargs["limit_settings"] + self.sweep_settings = kwargs.get("sweep_settings", None) + self.validation_data = kwargs.get("validation_data", None) + self.validation_data_size = kwargs.get("validation_data_size", None) + self.model_settings = kwargs.get("model_settings", None) + self.search_space = kwargs.get("search_space", None) + self.task_type = "ImageClassification" # type: str + self.primary_metric = kwargs.get("primary_metric", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class ImageClassificationMultilabel(AutoMLVertical, ImageClassificationBase): """Image Classification Multilabel. Multi-label image classification is used when an image could have one or more labels -from a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'. + from a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted", "IOU". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics """ _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + "limit_settings": {"required": True}, + "task_type": {"required": True}, + "training_data": {"required": True}, + } + + _attribute_map = { + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsClassification", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsClassification]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, + } + + def __init__(self, **kwargs): """ :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings @@ -10088,17 +10187,17 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics """ super(ImageClassificationMultilabel, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageClassificationMultilabel' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.limit_settings = kwargs["limit_settings"] + self.sweep_settings = kwargs.get("sweep_settings", None) + self.validation_data = kwargs.get("validation_data", None) + self.validation_data_size = kwargs.get("validation_data_size", None) + self.model_settings = kwargs.get("model_settings", None) + self.search_space = kwargs.get("search_space", None) + self.task_type = "ImageClassificationMultilabel" # type: str + self.primary_metric = kwargs.get("primary_metric", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class ImageObjectDetectionBase(ImageVertical): @@ -10127,22 +10226,34 @@ class ImageObjectDetectionBase(ImageVertical): """ _validation = { - 'limit_settings': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - } - - def __init__( - self, - **kwargs - ): + "limit_settings": {"required": True}, + } + + _attribute_map = { + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsObjectDetection", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsObjectDetection]", + }, + } + + def __init__(self, **kwargs): """ :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings @@ -10164,77 +10275,89 @@ def __init__( list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] """ super(ImageObjectDetectionBase, self).__init__(**kwargs) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) + self.model_settings = kwargs.get("model_settings", None) + self.search_space = kwargs.get("search_space", None) class ImageInstanceSegmentation(AutoMLVertical, ImageObjectDetectionBase): """Image Instance Segmentation. Instance segmentation is used to identify objects in an image at the pixel level, -drawing a polygon around each object in the image. + drawing a polygon around each object in the image. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "MeanAveragePrecision". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics """ _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + "limit_settings": {"required": True}, + "task_type": {"required": True}, + "training_data": {"required": True}, + } + + _attribute_map = { + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsObjectDetection", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsObjectDetection]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, + } + + def __init__(self, **kwargs): """ :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings @@ -10268,17 +10391,17 @@ def __init__( ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics """ super(ImageInstanceSegmentation, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageInstanceSegmentation' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.limit_settings = kwargs["limit_settings"] + self.sweep_settings = kwargs.get("sweep_settings", None) + self.validation_data = kwargs.get("validation_data", None) + self.validation_data_size = kwargs.get("validation_data_size", None) + self.model_settings = kwargs.get("model_settings", None) + self.search_space = kwargs.get("search_space", None) + self.task_type = "ImageInstanceSegmentation" # type: str + self.primary_metric = kwargs.get("primary_metric", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class ImageLimitSettings(msrest.serialization.Model): @@ -10293,15 +10416,12 @@ class ImageLimitSettings(msrest.serialization.Model): """ _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_trials": {"key": "maxTrials", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword max_concurrent_trials: Maximum number of concurrent AutoML iterations. :paramtype max_concurrent_trials: int @@ -10311,9 +10431,9 @@ def __init__( :paramtype timeout: ~datetime.timedelta """ super(ImageLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', 1) - self.max_trials = kwargs.get('max_trials', 1) - self.timeout = kwargs.get('timeout', "P7D") + self.max_concurrent_trials = kwargs.get("max_concurrent_trials", 1) + self.max_trials = kwargs.get("max_trials", 1) + self.timeout = kwargs.get("timeout", "P7D") class ImageMetadata(msrest.serialization.Model): @@ -10330,15 +10450,15 @@ class ImageMetadata(msrest.serialization.Model): """ _attribute_map = { - 'current_image_version': {'key': 'currentImageVersion', 'type': 'str'}, - 'latest_image_version': {'key': 'latestImageVersion', 'type': 'str'}, - 'is_latest_os_image_version': {'key': 'isLatestOsImageVersion', 'type': 'bool'}, + "current_image_version": {"key": "currentImageVersion", "type": "str"}, + "latest_image_version": {"key": "latestImageVersion", "type": "str"}, + "is_latest_os_image_version": { + "key": "isLatestOsImageVersion", + "type": "bool", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword current_image_version: Specifies the current operating system image version this compute instance is running on. @@ -10350,143 +10470,160 @@ def __init__( :paramtype is_latest_os_image_version: bool """ super(ImageMetadata, self).__init__(**kwargs) - self.current_image_version = kwargs.get('current_image_version', None) - self.latest_image_version = kwargs.get('latest_image_version', None) - self.is_latest_os_image_version = kwargs.get('is_latest_os_image_version', None) + self.current_image_version = kwargs.get("current_image_version", None) + self.latest_image_version = kwargs.get("latest_image_version", None) + self.is_latest_os_image_version = kwargs.get( + "is_latest_os_image_version", None + ) class ImageModelDistributionSettings(msrest.serialization.Model): """Distribution expressions to sweep over values of model settings. -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) -where distribution name can be: uniform, quniform, loguniform, etc -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + :code:` + Some examples are: + ``` + ModelName = "choice('seresnext', 'resnest50')"; + LearningRate = "uniform(0.001, 0.01)"; + LayersToFreeze = "choice(0, 2)"; + ```` + All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) + where distribution name can be: uniform, quniform, loguniform, etc + For more details on how to compose distribution expressions please check the documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: str + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: str + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: str + :ivar distributed: Whether to use distributer training. + :vartype distributed: str + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: str + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: str + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: str + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: str + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: str + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: str + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: str + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: str + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. + :vartype learning_rate_scheduler: str + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: str + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: str + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: str + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: str + :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. + :vartype optimizer: str + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: str + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: str + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: str + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: str + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: str + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: str + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: str + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: str + """ + + _attribute_map = { + "ams_gradient": {"key": "amsGradient", "type": "str"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "str"}, + "beta2": {"key": "beta2", "type": "str"}, + "distributed": {"key": "distributed", "type": "str"}, + "early_stopping": {"key": "earlyStopping", "type": "str"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "str"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "str", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "str", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "str"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "str", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "str"}, + "nesterov": {"key": "nesterov", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "str"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "str"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "str"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "str"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "str"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "str", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "str", + }, + "weight_decay": {"key": "weightDecay", "type": "str"}, + } + + def __init__(self, **kwargs): """ :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :paramtype ams_gradient: str @@ -10570,183 +10707,215 @@ def __init__( :paramtype weight_decay: str """ super(ImageModelDistributionSettings, self).__init__(**kwargs) - self.ams_gradient = kwargs.get('ams_gradient', None) - self.augmentations = kwargs.get('augmentations', None) - self.beta1 = kwargs.get('beta1', None) - self.beta2 = kwargs.get('beta2', None) - self.distributed = kwargs.get('distributed', None) - self.early_stopping = kwargs.get('early_stopping', None) - self.early_stopping_delay = kwargs.get('early_stopping_delay', None) - self.early_stopping_patience = kwargs.get('early_stopping_patience', None) - self.enable_onnx_normalization = kwargs.get('enable_onnx_normalization', None) - self.evaluation_frequency = kwargs.get('evaluation_frequency', None) - self.gradient_accumulation_step = kwargs.get('gradient_accumulation_step', None) - self.layers_to_freeze = kwargs.get('layers_to_freeze', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.learning_rate_scheduler = kwargs.get('learning_rate_scheduler', None) - self.model_name = kwargs.get('model_name', None) - self.momentum = kwargs.get('momentum', None) - self.nesterov = kwargs.get('nesterov', None) - self.number_of_epochs = kwargs.get('number_of_epochs', None) - self.number_of_workers = kwargs.get('number_of_workers', None) - self.optimizer = kwargs.get('optimizer', None) - self.random_seed = kwargs.get('random_seed', None) - self.step_lr_gamma = kwargs.get('step_lr_gamma', None) - self.step_lr_step_size = kwargs.get('step_lr_step_size', None) - self.training_batch_size = kwargs.get('training_batch_size', None) - self.validation_batch_size = kwargs.get('validation_batch_size', None) - self.warmup_cosine_lr_cycles = kwargs.get('warmup_cosine_lr_cycles', None) - self.warmup_cosine_lr_warmup_epochs = kwargs.get('warmup_cosine_lr_warmup_epochs', None) - self.weight_decay = kwargs.get('weight_decay', None) - - -class ImageModelDistributionSettingsClassification(ImageModelDistributionSettings): + self.ams_gradient = kwargs.get("ams_gradient", None) + self.augmentations = kwargs.get("augmentations", None) + self.beta1 = kwargs.get("beta1", None) + self.beta2 = kwargs.get("beta2", None) + self.distributed = kwargs.get("distributed", None) + self.early_stopping = kwargs.get("early_stopping", None) + self.early_stopping_delay = kwargs.get("early_stopping_delay", None) + self.early_stopping_patience = kwargs.get( + "early_stopping_patience", None + ) + self.enable_onnx_normalization = kwargs.get( + "enable_onnx_normalization", None + ) + self.evaluation_frequency = kwargs.get("evaluation_frequency", None) + self.gradient_accumulation_step = kwargs.get( + "gradient_accumulation_step", None + ) + self.layers_to_freeze = kwargs.get("layers_to_freeze", None) + self.learning_rate = kwargs.get("learning_rate", None) + self.learning_rate_scheduler = kwargs.get( + "learning_rate_scheduler", None + ) + self.model_name = kwargs.get("model_name", None) + self.momentum = kwargs.get("momentum", None) + self.nesterov = kwargs.get("nesterov", None) + self.number_of_epochs = kwargs.get("number_of_epochs", None) + self.number_of_workers = kwargs.get("number_of_workers", None) + self.optimizer = kwargs.get("optimizer", None) + self.random_seed = kwargs.get("random_seed", None) + self.step_lr_gamma = kwargs.get("step_lr_gamma", None) + self.step_lr_step_size = kwargs.get("step_lr_step_size", None) + self.training_batch_size = kwargs.get("training_batch_size", None) + self.validation_batch_size = kwargs.get("validation_batch_size", None) + self.warmup_cosine_lr_cycles = kwargs.get( + "warmup_cosine_lr_cycles", None + ) + self.warmup_cosine_lr_warmup_epochs = kwargs.get( + "warmup_cosine_lr_warmup_epochs", None + ) + self.weight_decay = kwargs.get("weight_decay", None) + + +class ImageModelDistributionSettingsClassification( + ImageModelDistributionSettings +): """Distribution expressions to sweep over values of model settings. -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: str - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: str - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: str - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'str'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'str'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'str'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + :code:` + Some examples are: + ``` + ModelName = "choice('seresnext', 'resnest50')"; + LearningRate = "uniform(0.001, 0.01)"; + LayersToFreeze = "choice(0, 2)"; + ```` + For more details on how to compose distribution expressions please check the documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: str + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: str + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: str + :ivar distributed: Whether to use distributer training. + :vartype distributed: str + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: str + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: str + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: str + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: str + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: str + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: str + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: str + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: str + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. + :vartype learning_rate_scheduler: str + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: str + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: str + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: str + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: str + :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. + :vartype optimizer: str + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: str + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: str + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: str + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: str + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: str + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: str + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: str + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: str + :ivar training_crop_size: Image crop size that is input to the neural network for the training + dataset. Must be a positive integer. + :vartype training_crop_size: str + :ivar validation_crop_size: Image crop size that is input to the neural network for the + validation dataset. Must be a positive integer. + :vartype validation_crop_size: str + :ivar validation_resize_size: Image size to which to resize before cropping for validation + dataset. Must be a positive integer. + :vartype validation_resize_size: str + :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. + 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be + 0 or 1 or 2. + :vartype weighted_loss: str + """ + + _attribute_map = { + "ams_gradient": {"key": "amsGradient", "type": "str"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "str"}, + "beta2": {"key": "beta2", "type": "str"}, + "distributed": {"key": "distributed", "type": "str"}, + "early_stopping": {"key": "earlyStopping", "type": "str"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "str"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "str", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "str", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "str"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "str", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "str"}, + "nesterov": {"key": "nesterov", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "str"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "str"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "str"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "str"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "str"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "str", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "str", + }, + "weight_decay": {"key": "weightDecay", "type": "str"}, + "training_crop_size": {"key": "trainingCropSize", "type": "str"}, + "validation_crop_size": {"key": "validationCropSize", "type": "str"}, + "validation_resize_size": { + "key": "validationResizeSize", + "type": "str", + }, + "weighted_loss": {"key": "weightedLoss", "type": "str"}, + } + + def __init__(self, **kwargs): """ :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :paramtype ams_gradient: str @@ -10842,208 +11011,241 @@ def __init__( 0 or 1 or 2. :paramtype weighted_loss: str """ - super(ImageModelDistributionSettingsClassification, self).__init__(**kwargs) - self.training_crop_size = kwargs.get('training_crop_size', None) - self.validation_crop_size = kwargs.get('validation_crop_size', None) - self.validation_resize_size = kwargs.get('validation_resize_size', None) - self.weighted_loss = kwargs.get('weighted_loss', None) + super(ImageModelDistributionSettingsClassification, self).__init__( + **kwargs + ) + self.training_crop_size = kwargs.get("training_crop_size", None) + self.validation_crop_size = kwargs.get("validation_crop_size", None) + self.validation_resize_size = kwargs.get( + "validation_resize_size", None + ) + self.weighted_loss = kwargs.get("weighted_loss", None) -class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettings): +class ImageModelDistributionSettingsObjectDetection( + ImageModelDistributionSettings +): """Distribution expressions to sweep over values of model settings. -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: str - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: str - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: str - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: str - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: str - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype model_size: str - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: str - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - float in the range [0, 1]. - :vartype nms_iou_threshold: str - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: str - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - NMS: Non-maximum suppression. - :vartype tile_predictions_nms_threshold: str - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: str - :ivar validation_metric_type: Metric computation method to use for validation metrics. Must be - 'none', 'coco', 'voc', or 'coco_voc'. - :vartype validation_metric_type: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'str'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'str'}, - 'image_size': {'key': 'imageSize', 'type': 'str'}, - 'max_size': {'key': 'maxSize', 'type': 'str'}, - 'min_size': {'key': 'minSize', 'type': 'str'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'str'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'str'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'str'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'str'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'str'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + :code:` + Some examples are: + ``` + ModelName = "choice('seresnext', 'resnest50')"; + LearningRate = "uniform(0.001, 0.01)"; + LayersToFreeze = "choice(0, 2)"; + ```` + For more details on how to compose distribution expressions please check the documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: str + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: str + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: str + :ivar distributed: Whether to use distributer training. + :vartype distributed: str + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: str + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: str + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: str + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: str + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: str + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: str + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: str + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: str + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. + :vartype learning_rate_scheduler: str + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: str + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: str + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: str + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: str + :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. + :vartype optimizer: str + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: str + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: str + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: str + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: str + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: str + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: str + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: str + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: str + :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must + be a positive integer. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype box_detections_per_image: str + :ivar box_score_threshold: During inference, only return proposals with a classification score + greater than + BoxScoreThreshold. Must be a float in the range[0, 1]. + :vartype box_score_threshold: str + :ivar image_size: Image size for train and validation. Must be a positive integer. + Note: The training run may get into CUDA OOM if the size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype image_size: str + :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype max_size: str + :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype min_size: str + :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. + Note: training run may get into CUDA OOM if the model size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype model_size: str + :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. + Note: training run may get into CUDA OOM if no sufficient GPU memory. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype multi_scale: str + :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be + float in the range [0, 1]. + :vartype nms_iou_threshold: str + :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not + be + None to enable small object detection logic. A string containing two integers in mxn format. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_grid_size: str + :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float + in the range [0, 1). + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_overlap_ratio: str + :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging + predictions from tiles and image. + Used in validation/ inference. Must be float in the range [0, 1]. + Note: This settings is not supported for the 'yolov5' algorithm. + NMS: Non-maximum suppression. + :vartype tile_predictions_nms_threshold: str + :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be + float in the range [0, 1]. + :vartype validation_iou_threshold: str + :ivar validation_metric_type: Metric computation method to use for validation metrics. Must be + 'none', 'coco', 'voc', or 'coco_voc'. + :vartype validation_metric_type: str + """ + + _attribute_map = { + "ams_gradient": {"key": "amsGradient", "type": "str"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "str"}, + "beta2": {"key": "beta2", "type": "str"}, + "distributed": {"key": "distributed", "type": "str"}, + "early_stopping": {"key": "earlyStopping", "type": "str"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "str"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "str", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "str", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "str"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "str", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "str"}, + "nesterov": {"key": "nesterov", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "str"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "str"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "str"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "str"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "str"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "str", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "str", + }, + "weight_decay": {"key": "weightDecay", "type": "str"}, + "box_detections_per_image": { + "key": "boxDetectionsPerImage", + "type": "str", + }, + "box_score_threshold": {"key": "boxScoreThreshold", "type": "str"}, + "image_size": {"key": "imageSize", "type": "str"}, + "max_size": {"key": "maxSize", "type": "str"}, + "min_size": {"key": "minSize", "type": "str"}, + "model_size": {"key": "modelSize", "type": "str"}, + "multi_scale": {"key": "multiScale", "type": "str"}, + "nms_iou_threshold": {"key": "nmsIouThreshold", "type": "str"}, + "tile_grid_size": {"key": "tileGridSize", "type": "str"}, + "tile_overlap_ratio": {"key": "tileOverlapRatio", "type": "str"}, + "tile_predictions_nms_threshold": { + "key": "tilePredictionsNmsThreshold", + "type": "str", + }, + "validation_iou_threshold": { + "key": "validationIouThreshold", + "type": "str", + }, + "validation_metric_type": { + "key": "validationMetricType", + "type": "str", + }, + } + + def __init__(self, **kwargs): """ :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :paramtype ams_gradient: str @@ -11178,156 +11380,184 @@ def __init__( be 'none', 'coco', 'voc', or 'coco_voc'. :paramtype validation_metric_type: str """ - super(ImageModelDistributionSettingsObjectDetection, self).__init__(**kwargs) - self.box_detections_per_image = kwargs.get('box_detections_per_image', None) - self.box_score_threshold = kwargs.get('box_score_threshold', None) - self.image_size = kwargs.get('image_size', None) - self.max_size = kwargs.get('max_size', None) - self.min_size = kwargs.get('min_size', None) - self.model_size = kwargs.get('model_size', None) - self.multi_scale = kwargs.get('multi_scale', None) - self.nms_iou_threshold = kwargs.get('nms_iou_threshold', None) - self.tile_grid_size = kwargs.get('tile_grid_size', None) - self.tile_overlap_ratio = kwargs.get('tile_overlap_ratio', None) - self.tile_predictions_nms_threshold = kwargs.get('tile_predictions_nms_threshold', None) - self.validation_iou_threshold = kwargs.get('validation_iou_threshold', None) - self.validation_metric_type = kwargs.get('validation_metric_type', None) + super(ImageModelDistributionSettingsObjectDetection, self).__init__( + **kwargs + ) + self.box_detections_per_image = kwargs.get( + "box_detections_per_image", None + ) + self.box_score_threshold = kwargs.get("box_score_threshold", None) + self.image_size = kwargs.get("image_size", None) + self.max_size = kwargs.get("max_size", None) + self.min_size = kwargs.get("min_size", None) + self.model_size = kwargs.get("model_size", None) + self.multi_scale = kwargs.get("multi_scale", None) + self.nms_iou_threshold = kwargs.get("nms_iou_threshold", None) + self.tile_grid_size = kwargs.get("tile_grid_size", None) + self.tile_overlap_ratio = kwargs.get("tile_overlap_ratio", None) + self.tile_predictions_nms_threshold = kwargs.get( + "tile_predictions_nms_threshold", None + ) + self.validation_iou_threshold = kwargs.get( + "validation_iou_threshold", None + ) + self.validation_metric_type = kwargs.get( + "validation_metric_type", None + ) class ImageModelSettings(msrest.serialization.Model): """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar advanced_settings: Settings for advanced scenarios. + :vartype advanced_settings: str + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: bool + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: float + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: float + :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. + :vartype checkpoint_frequency: int + :ivar checkpoint_model: The pretrained checkpoint model for incremental training. + :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput + :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for + incremental training. + :vartype checkpoint_run_id: str + :ivar distributed: Whether to use distributed training. + :vartype distributed: bool + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: bool + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: int + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: int + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: bool + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: int + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: int + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: int + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: float + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. Possible values include: "None", "WarmupCosine", "Step". + :vartype learning_rate_scheduler: str or + ~azure.mgmt.machinelearningservices.models.LearningRateScheduler + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: float + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: bool + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: int + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: int + :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". + :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: int + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: float + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: int + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: int + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: int + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: float + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: int + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: float + """ + + _attribute_map = { + "advanced_settings": {"key": "advancedSettings", "type": "str"}, + "ams_gradient": {"key": "amsGradient", "type": "bool"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "float"}, + "beta2": {"key": "beta2", "type": "float"}, + "checkpoint_frequency": {"key": "checkpointFrequency", "type": "int"}, + "checkpoint_model": { + "key": "checkpointModel", + "type": "MLFlowModelJobInput", + }, + "checkpoint_run_id": {"key": "checkpointRunId", "type": "str"}, + "distributed": {"key": "distributed", "type": "bool"}, + "early_stopping": {"key": "earlyStopping", "type": "bool"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "int"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "int", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "bool", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "int"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "int", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "int"}, + "learning_rate": {"key": "learningRate", "type": "float"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "float"}, + "nesterov": {"key": "nesterov", "type": "bool"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "int"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "int"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "int"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "float"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "int"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "float", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "int", + }, + "weight_decay": {"key": "weightDecay", "type": "float"}, + } + + def __init__(self, **kwargs): """ :keyword advanced_settings: Settings for advanced scenarios. :paramtype advanced_settings: str @@ -11422,191 +11652,224 @@ def __init__( :paramtype weight_decay: float """ super(ImageModelSettings, self).__init__(**kwargs) - self.advanced_settings = kwargs.get('advanced_settings', None) - self.ams_gradient = kwargs.get('ams_gradient', None) - self.augmentations = kwargs.get('augmentations', None) - self.beta1 = kwargs.get('beta1', None) - self.beta2 = kwargs.get('beta2', None) - self.checkpoint_frequency = kwargs.get('checkpoint_frequency', None) - self.checkpoint_model = kwargs.get('checkpoint_model', None) - self.checkpoint_run_id = kwargs.get('checkpoint_run_id', None) - self.distributed = kwargs.get('distributed', None) - self.early_stopping = kwargs.get('early_stopping', None) - self.early_stopping_delay = kwargs.get('early_stopping_delay', None) - self.early_stopping_patience = kwargs.get('early_stopping_patience', None) - self.enable_onnx_normalization = kwargs.get('enable_onnx_normalization', None) - self.evaluation_frequency = kwargs.get('evaluation_frequency', None) - self.gradient_accumulation_step = kwargs.get('gradient_accumulation_step', None) - self.layers_to_freeze = kwargs.get('layers_to_freeze', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.learning_rate_scheduler = kwargs.get('learning_rate_scheduler', None) - self.model_name = kwargs.get('model_name', None) - self.momentum = kwargs.get('momentum', None) - self.nesterov = kwargs.get('nesterov', None) - self.number_of_epochs = kwargs.get('number_of_epochs', None) - self.number_of_workers = kwargs.get('number_of_workers', None) - self.optimizer = kwargs.get('optimizer', None) - self.random_seed = kwargs.get('random_seed', None) - self.step_lr_gamma = kwargs.get('step_lr_gamma', None) - self.step_lr_step_size = kwargs.get('step_lr_step_size', None) - self.training_batch_size = kwargs.get('training_batch_size', None) - self.validation_batch_size = kwargs.get('validation_batch_size', None) - self.warmup_cosine_lr_cycles = kwargs.get('warmup_cosine_lr_cycles', None) - self.warmup_cosine_lr_warmup_epochs = kwargs.get('warmup_cosine_lr_warmup_epochs', None) - self.weight_decay = kwargs.get('weight_decay', None) + self.advanced_settings = kwargs.get("advanced_settings", None) + self.ams_gradient = kwargs.get("ams_gradient", None) + self.augmentations = kwargs.get("augmentations", None) + self.beta1 = kwargs.get("beta1", None) + self.beta2 = kwargs.get("beta2", None) + self.checkpoint_frequency = kwargs.get("checkpoint_frequency", None) + self.checkpoint_model = kwargs.get("checkpoint_model", None) + self.checkpoint_run_id = kwargs.get("checkpoint_run_id", None) + self.distributed = kwargs.get("distributed", None) + self.early_stopping = kwargs.get("early_stopping", None) + self.early_stopping_delay = kwargs.get("early_stopping_delay", None) + self.early_stopping_patience = kwargs.get( + "early_stopping_patience", None + ) + self.enable_onnx_normalization = kwargs.get( + "enable_onnx_normalization", None + ) + self.evaluation_frequency = kwargs.get("evaluation_frequency", None) + self.gradient_accumulation_step = kwargs.get( + "gradient_accumulation_step", None + ) + self.layers_to_freeze = kwargs.get("layers_to_freeze", None) + self.learning_rate = kwargs.get("learning_rate", None) + self.learning_rate_scheduler = kwargs.get( + "learning_rate_scheduler", None + ) + self.model_name = kwargs.get("model_name", None) + self.momentum = kwargs.get("momentum", None) + self.nesterov = kwargs.get("nesterov", None) + self.number_of_epochs = kwargs.get("number_of_epochs", None) + self.number_of_workers = kwargs.get("number_of_workers", None) + self.optimizer = kwargs.get("optimizer", None) + self.random_seed = kwargs.get("random_seed", None) + self.step_lr_gamma = kwargs.get("step_lr_gamma", None) + self.step_lr_step_size = kwargs.get("step_lr_step_size", None) + self.training_batch_size = kwargs.get("training_batch_size", None) + self.validation_batch_size = kwargs.get("validation_batch_size", None) + self.warmup_cosine_lr_cycles = kwargs.get( + "warmup_cosine_lr_cycles", None + ) + self.warmup_cosine_lr_warmup_epochs = kwargs.get( + "warmup_cosine_lr_warmup_epochs", None + ) + self.weight_decay = kwargs.get("weight_decay", None) class ImageModelSettingsClassification(ImageModelSettings): """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: int - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: int - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: int - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: int - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'int'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'int'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'int'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar advanced_settings: Settings for advanced scenarios. + :vartype advanced_settings: str + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: bool + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: float + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: float + :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. + :vartype checkpoint_frequency: int + :ivar checkpoint_model: The pretrained checkpoint model for incremental training. + :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput + :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for + incremental training. + :vartype checkpoint_run_id: str + :ivar distributed: Whether to use distributed training. + :vartype distributed: bool + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: bool + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: int + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: int + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: bool + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: int + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: int + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: int + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: float + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. Possible values include: "None", "WarmupCosine", "Step". + :vartype learning_rate_scheduler: str or + ~azure.mgmt.machinelearningservices.models.LearningRateScheduler + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: float + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: bool + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: int + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: int + :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". + :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: int + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: float + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: int + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: int + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: int + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: float + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: int + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: float + :ivar training_crop_size: Image crop size that is input to the neural network for the training + dataset. Must be a positive integer. + :vartype training_crop_size: int + :ivar validation_crop_size: Image crop size that is input to the neural network for the + validation dataset. Must be a positive integer. + :vartype validation_crop_size: int + :ivar validation_resize_size: Image size to which to resize before cropping for validation + dataset. Must be a positive integer. + :vartype validation_resize_size: int + :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. + 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be + 0 or 1 or 2. + :vartype weighted_loss: int + """ + + _attribute_map = { + "advanced_settings": {"key": "advancedSettings", "type": "str"}, + "ams_gradient": {"key": "amsGradient", "type": "bool"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "float"}, + "beta2": {"key": "beta2", "type": "float"}, + "checkpoint_frequency": {"key": "checkpointFrequency", "type": "int"}, + "checkpoint_model": { + "key": "checkpointModel", + "type": "MLFlowModelJobInput", + }, + "checkpoint_run_id": {"key": "checkpointRunId", "type": "str"}, + "distributed": {"key": "distributed", "type": "bool"}, + "early_stopping": {"key": "earlyStopping", "type": "bool"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "int"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "int", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "bool", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "int"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "int", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "int"}, + "learning_rate": {"key": "learningRate", "type": "float"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "float"}, + "nesterov": {"key": "nesterov", "type": "bool"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "int"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "int"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "int"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "float"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "int"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "float", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "int", + }, + "weight_decay": {"key": "weightDecay", "type": "float"}, + "training_crop_size": {"key": "trainingCropSize", "type": "int"}, + "validation_crop_size": {"key": "validationCropSize", "type": "int"}, + "validation_resize_size": { + "key": "validationResizeSize", + "type": "int", + }, + "weighted_loss": {"key": "weightedLoss", "type": "int"}, + } + + def __init__(self, **kwargs): """ :keyword advanced_settings: Settings for advanced scenarios. :paramtype advanced_settings: str @@ -11714,212 +11977,244 @@ def __init__( :paramtype weighted_loss: int """ super(ImageModelSettingsClassification, self).__init__(**kwargs) - self.training_crop_size = kwargs.get('training_crop_size', None) - self.validation_crop_size = kwargs.get('validation_crop_size', None) - self.validation_resize_size = kwargs.get('validation_resize_size', None) - self.weighted_loss = kwargs.get('weighted_loss', None) + self.training_crop_size = kwargs.get("training_crop_size", None) + self.validation_crop_size = kwargs.get("validation_crop_size", None) + self.validation_resize_size = kwargs.get( + "validation_resize_size", None + ) + self.weighted_loss = kwargs.get("weighted_loss", None) + +class ImageModelSettingsObjectDetection(ImageModelSettings): + """Settings used for training the model. + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar advanced_settings: Settings for advanced scenarios. + :vartype advanced_settings: str + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: bool + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: float + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: float + :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. + :vartype checkpoint_frequency: int + :ivar checkpoint_model: The pretrained checkpoint model for incremental training. + :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput + :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for + incremental training. + :vartype checkpoint_run_id: str + :ivar distributed: Whether to use distributed training. + :vartype distributed: bool + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: bool + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: int + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: int + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: bool + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: int + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: int + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: int + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: float + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. Possible values include: "None", "WarmupCosine", "Step". + :vartype learning_rate_scheduler: str or + ~azure.mgmt.machinelearningservices.models.LearningRateScheduler + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: float + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: bool + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: int + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: int + :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". + :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: int + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: float + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: int + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: int + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: int + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: float + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: int + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: float + :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must + be a positive integer. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype box_detections_per_image: int + :ivar box_score_threshold: During inference, only return proposals with a classification score + greater than + BoxScoreThreshold. Must be a float in the range[0, 1]. + :vartype box_score_threshold: float + :ivar image_size: Image size for train and validation. Must be a positive integer. + Note: The training run may get into CUDA OOM if the size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype image_size: int + :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype max_size: int + :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype min_size: int + :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. + Note: training run may get into CUDA OOM if the model size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: + "None", "Small", "Medium", "Large", "ExtraLarge". + :vartype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize + :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. + Note: training run may get into CUDA OOM if no sufficient GPU memory. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype multi_scale: bool + :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be a + float in the range [0, 1]. + :vartype nms_iou_threshold: float + :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not + be + None to enable small object detection logic. A string containing two integers in mxn format. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_grid_size: str + :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float + in the range [0, 1). + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_overlap_ratio: float + :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging + predictions from tiles and image. + Used in validation/ inference. Must be float in the range [0, 1]. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_predictions_nms_threshold: float + :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be + float in the range [0, 1]. + :vartype validation_iou_threshold: float + :ivar validation_metric_type: Metric computation method to use for validation metrics. Possible + values include: "None", "Coco", "Voc", "CocoVoc". + :vartype validation_metric_type: str or + ~azure.mgmt.machinelearningservices.models.ValidationMetricType + """ -class ImageModelSettingsObjectDetection(ImageModelSettings): - """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: int - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: float - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: int - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: int - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: int - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: - "None", "Small", "Medium", "Large", "ExtraLarge". - :vartype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: bool - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be a - float in the range [0, 1]. - :vartype nms_iou_threshold: float - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: float - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_predictions_nms_threshold: float - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: float - :ivar validation_metric_type: Metric computation method to use for validation metrics. Possible - values include: "None", "Coco", "Voc", "CocoVoc". - :vartype validation_metric_type: str or - ~azure.mgmt.machinelearningservices.models.ValidationMetricType - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'int'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'float'}, - 'image_size': {'key': 'imageSize', 'type': 'int'}, - 'max_size': {'key': 'maxSize', 'type': 'int'}, - 'min_size': {'key': 'minSize', 'type': 'int'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'bool'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'float'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'float'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'float'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'float'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + _attribute_map = { + "advanced_settings": {"key": "advancedSettings", "type": "str"}, + "ams_gradient": {"key": "amsGradient", "type": "bool"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "float"}, + "beta2": {"key": "beta2", "type": "float"}, + "checkpoint_frequency": {"key": "checkpointFrequency", "type": "int"}, + "checkpoint_model": { + "key": "checkpointModel", + "type": "MLFlowModelJobInput", + }, + "checkpoint_run_id": {"key": "checkpointRunId", "type": "str"}, + "distributed": {"key": "distributed", "type": "bool"}, + "early_stopping": {"key": "earlyStopping", "type": "bool"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "int"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "int", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "bool", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "int"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "int", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "int"}, + "learning_rate": {"key": "learningRate", "type": "float"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "float"}, + "nesterov": {"key": "nesterov", "type": "bool"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "int"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "int"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "int"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "float"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "int"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "float", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "int", + }, + "weight_decay": {"key": "weightDecay", "type": "float"}, + "box_detections_per_image": { + "key": "boxDetectionsPerImage", + "type": "int", + }, + "box_score_threshold": {"key": "boxScoreThreshold", "type": "float"}, + "image_size": {"key": "imageSize", "type": "int"}, + "max_size": {"key": "maxSize", "type": "int"}, + "min_size": {"key": "minSize", "type": "int"}, + "model_size": {"key": "modelSize", "type": "str"}, + "multi_scale": {"key": "multiScale", "type": "bool"}, + "nms_iou_threshold": {"key": "nmsIouThreshold", "type": "float"}, + "tile_grid_size": {"key": "tileGridSize", "type": "str"}, + "tile_overlap_ratio": {"key": "tileOverlapRatio", "type": "float"}, + "tile_predictions_nms_threshold": { + "key": "tilePredictionsNmsThreshold", + "type": "float", + }, + "validation_iou_threshold": { + "key": "validationIouThreshold", + "type": "float", + }, + "validation_metric_type": { + "key": "validationMetricType", + "type": "str", + }, + } + + def __init__(self, **kwargs): """ :keyword advanced_settings: Settings for advanced scenarios. :paramtype advanced_settings: str @@ -12067,88 +12362,108 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ValidationMetricType """ super(ImageModelSettingsObjectDetection, self).__init__(**kwargs) - self.box_detections_per_image = kwargs.get('box_detections_per_image', None) - self.box_score_threshold = kwargs.get('box_score_threshold', None) - self.image_size = kwargs.get('image_size', None) - self.max_size = kwargs.get('max_size', None) - self.min_size = kwargs.get('min_size', None) - self.model_size = kwargs.get('model_size', None) - self.multi_scale = kwargs.get('multi_scale', None) - self.nms_iou_threshold = kwargs.get('nms_iou_threshold', None) - self.tile_grid_size = kwargs.get('tile_grid_size', None) - self.tile_overlap_ratio = kwargs.get('tile_overlap_ratio', None) - self.tile_predictions_nms_threshold = kwargs.get('tile_predictions_nms_threshold', None) - self.validation_iou_threshold = kwargs.get('validation_iou_threshold', None) - self.validation_metric_type = kwargs.get('validation_metric_type', None) + self.box_detections_per_image = kwargs.get( + "box_detections_per_image", None + ) + self.box_score_threshold = kwargs.get("box_score_threshold", None) + self.image_size = kwargs.get("image_size", None) + self.max_size = kwargs.get("max_size", None) + self.min_size = kwargs.get("min_size", None) + self.model_size = kwargs.get("model_size", None) + self.multi_scale = kwargs.get("multi_scale", None) + self.nms_iou_threshold = kwargs.get("nms_iou_threshold", None) + self.tile_grid_size = kwargs.get("tile_grid_size", None) + self.tile_overlap_ratio = kwargs.get("tile_overlap_ratio", None) + self.tile_predictions_nms_threshold = kwargs.get( + "tile_predictions_nms_threshold", None + ) + self.validation_iou_threshold = kwargs.get( + "validation_iou_threshold", None + ) + self.validation_metric_type = kwargs.get( + "validation_metric_type", None + ) class ImageObjectDetection(AutoMLVertical, ImageObjectDetectionBase): """Image Object Detection. Object detection is used to identify objects in an image and locate each object with a -bounding box e.g. locate all dogs and cats in an image and draw a bounding box around each. + bounding box e.g. locate all dogs and cats in an image and draw a bounding box around each. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "MeanAveragePrecision". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics """ _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + "limit_settings": {"required": True}, + "task_type": {"required": True}, + "training_data": {"required": True}, + } + + _attribute_map = { + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsObjectDetection", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsObjectDetection]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, + } + + def __init__(self, **kwargs): """ :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings @@ -12182,17 +12497,17 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics """ super(ImageObjectDetection, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageObjectDetection' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.limit_settings = kwargs["limit_settings"] + self.sweep_settings = kwargs.get("sweep_settings", None) + self.validation_data = kwargs.get("validation_data", None) + self.validation_data_size = kwargs.get("validation_data_size", None) + self.model_settings = kwargs.get("model_settings", None) + self.search_space = kwargs.get("search_space", None) + self.task_type = "ImageObjectDetection" # type: str + self.primary_metric = kwargs.get("primary_metric", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class ImageSweepSettings(msrest.serialization.Model): @@ -12209,18 +12524,18 @@ class ImageSweepSettings(msrest.serialization.Model): """ _validation = { - 'sampling_algorithm': {'required': True}, + "sampling_algorithm": {"required": True}, } _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, + "sampling_algorithm": {"key": "samplingAlgorithm", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword early_termination: Type of early termination policy. :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy @@ -12230,8 +12545,8 @@ def __init__( ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType """ super(ImageSweepSettings, self).__init__(**kwargs) - self.early_termination = kwargs.get('early_termination', None) - self.sampling_algorithm = kwargs['sampling_algorithm'] + self.early_termination = kwargs.get("early_termination", None) + self.sampling_algorithm = kwargs["sampling_algorithm"] class InferenceContainerProperties(msrest.serialization.Model): @@ -12247,15 +12562,12 @@ class InferenceContainerProperties(msrest.serialization.Model): """ _attribute_map = { - 'liveness_route': {'key': 'livenessRoute', 'type': 'Route'}, - 'readiness_route': {'key': 'readinessRoute', 'type': 'Route'}, - 'scoring_route': {'key': 'scoringRoute', 'type': 'Route'}, + "liveness_route": {"key": "livenessRoute", "type": "Route"}, + "readiness_route": {"key": "readinessRoute", "type": "Route"}, + "scoring_route": {"key": "scoringRoute", "type": "Route"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword liveness_route: The route to check the liveness of the inference server container. :paramtype liveness_route: ~azure.mgmt.machinelearningservices.models.Route @@ -12266,9 +12578,9 @@ def __init__( :paramtype scoring_route: ~azure.mgmt.machinelearningservices.models.Route """ super(InferenceContainerProperties, self).__init__(**kwargs) - self.liveness_route = kwargs.get('liveness_route', None) - self.readiness_route = kwargs.get('readiness_route', None) - self.scoring_route = kwargs.get('scoring_route', None) + self.liveness_route = kwargs.get("liveness_route", None) + self.readiness_route = kwargs.get("readiness_route", None) + self.scoring_route = kwargs.get("scoring_route", None) class InstanceTypeSchema(msrest.serialization.Model): @@ -12281,14 +12593,14 @@ class InstanceTypeSchema(msrest.serialization.Model): """ _attribute_map = { - 'node_selector': {'key': 'nodeSelector', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'InstanceTypeSchemaResources'}, + "node_selector": {"key": "nodeSelector", "type": "{str}"}, + "resources": { + "key": "resources", + "type": "InstanceTypeSchemaResources", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword node_selector: Node Selector. :paramtype node_selector: dict[str, str] @@ -12296,8 +12608,8 @@ def __init__( :paramtype resources: ~azure.mgmt.machinelearningservices.models.InstanceTypeSchemaResources """ super(InstanceTypeSchema, self).__init__(**kwargs) - self.node_selector = kwargs.get('node_selector', None) - self.resources = kwargs.get('resources', None) + self.node_selector = kwargs.get("node_selector", None) + self.resources = kwargs.get("resources", None) class InstanceTypeSchemaResources(msrest.serialization.Model): @@ -12310,14 +12622,11 @@ class InstanceTypeSchemaResources(msrest.serialization.Model): """ _attribute_map = { - 'requests': {'key': 'requests', 'type': '{str}'}, - 'limits': {'key': 'limits', 'type': '{str}'}, + "requests": {"key": "requests", "type": "{str}"}, + "limits": {"key": "limits", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword requests: Resource requests for this instance type. :paramtype requests: dict[str, str] @@ -12325,8 +12634,8 @@ def __init__( :paramtype limits: dict[str, str] """ super(InstanceTypeSchemaResources, self).__init__(**kwargs) - self.requests = kwargs.get('requests', None) - self.limits = kwargs.get('limits', None) + self.requests = kwargs.get("requests", None) + self.limits = kwargs.get("limits", None) class JobBase(Resource): @@ -12352,31 +12661,28 @@ class JobBase(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'JobBaseProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "JobBaseProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.JobBaseProperties """ super(JobBase, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class JobBaseResourceArmPaginatedResult(msrest.serialization.Model): @@ -12390,14 +12696,11 @@ class JobBaseResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[JobBase]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[JobBase]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of JobBase objects. If null, there are no additional pages. @@ -12406,8 +12709,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.JobBase] """ super(JobBaseResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class JobResourceConfiguration(ResourceConfiguration): @@ -12430,21 +12733,18 @@ class JobResourceConfiguration(ResourceConfiguration): """ _validation = { - 'shm_size': {'pattern': r'\d+[bBkKmMgG]'}, + "shm_size": {"pattern": r"\d+[bBkKmMgG]"}, } _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - 'docker_args': {'key': 'dockerArgs', 'type': 'str'}, - 'shm_size': {'key': 'shmSize', 'type': 'str'}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "properties": {"key": "properties", "type": "{object}"}, + "docker_args": {"key": "dockerArgs", "type": "str"}, + "shm_size": {"key": "shmSize", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword instance_count: Optional number of instances or nodes used by the compute target. :paramtype instance_count: int @@ -12462,8 +12762,8 @@ def __init__( :paramtype shm_size: str """ super(JobResourceConfiguration, self).__init__(**kwargs) - self.docker_args = kwargs.get('docker_args', None) - self.shm_size = kwargs.get('shm_size', "2g") + self.docker_args = kwargs.get("docker_args", None) + self.shm_size = kwargs.get("shm_size", "2g") class JobScheduleAction(ScheduleActionBase): @@ -12479,26 +12779,26 @@ class JobScheduleAction(ScheduleActionBase): """ _validation = { - 'action_type': {'required': True}, - 'job_definition': {'required': True}, + "action_type": {"required": True}, + "job_definition": {"required": True}, } _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'job_definition': {'key': 'jobDefinition', 'type': 'JobBaseProperties'}, + "action_type": {"key": "actionType", "type": "str"}, + "job_definition": { + "key": "jobDefinition", + "type": "JobBaseProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword job_definition: Required. [Required] Defines Schedule action definition details. :paramtype job_definition: ~azure.mgmt.machinelearningservices.models.JobBaseProperties """ super(JobScheduleAction, self).__init__(**kwargs) - self.action_type = 'CreateJob' # type: str - self.job_definition = kwargs['job_definition'] + self.action_type = "CreateJob" # type: str + self.job_definition = kwargs["job_definition"] class JobService(msrest.serialization.Model): @@ -12524,24 +12824,21 @@ class JobService(msrest.serialization.Model): """ _validation = { - 'error_message': {'readonly': True}, - 'status': {'readonly': True}, + "error_message": {"readonly": True}, + "status": {"readonly": True}, } _attribute_map = { - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'job_service_type': {'key': 'jobServiceType', 'type': 'str'}, - 'nodes': {'key': 'nodes', 'type': 'Nodes'}, - 'port': {'key': 'port', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'status': {'key': 'status', 'type': 'str'}, + "endpoint": {"key": "endpoint", "type": "str"}, + "error_message": {"key": "errorMessage", "type": "str"}, + "job_service_type": {"key": "jobServiceType", "type": "str"}, + "nodes": {"key": "nodes", "type": "Nodes"}, + "port": {"key": "port", "type": "int"}, + "properties": {"key": "properties", "type": "{str}"}, + "status": {"key": "status", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword endpoint: Url for endpoint. :paramtype endpoint: str @@ -12556,12 +12853,12 @@ def __init__( :paramtype properties: dict[str, str] """ super(JobService, self).__init__(**kwargs) - self.endpoint = kwargs.get('endpoint', None) + self.endpoint = kwargs.get("endpoint", None) self.error_message = None - self.job_service_type = kwargs.get('job_service_type', None) - self.nodes = kwargs.get('nodes', None) - self.port = kwargs.get('port', None) - self.properties = kwargs.get('properties', None) + self.job_service_type = kwargs.get("job_service_type", None) + self.nodes = kwargs.get("nodes", None) + self.port = kwargs.get("port", None) + self.properties = kwargs.get("properties", None) self.status = None @@ -12573,19 +12870,16 @@ class KubernetesSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, + "properties": {"key": "properties", "type": "KubernetesProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of Kubernetes. :paramtype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties """ super(KubernetesSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class Kubernetes(Compute, KubernetesSchema): @@ -12627,32 +12921,32 @@ class Kubernetes(Compute, KubernetesSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "KubernetesProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of Kubernetes. :paramtype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties @@ -12667,17 +12961,17 @@ def __init__( :paramtype disable_local_auth: bool """ super(Kubernetes, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'Kubernetes' # type: str - self.compute_location = kwargs.get('compute_location', None) + self.properties = kwargs.get("properties", None) + self.compute_type = "Kubernetes" # type: str + self.compute_location = kwargs.get("compute_location", None) self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) + self.disable_local_auth = kwargs.get("disable_local_auth", None) class OnlineDeploymentProperties(EndpointDeploymentPropertiesBase): @@ -12737,37 +13031,52 @@ class OnlineDeploymentProperties(EndpointDeploymentPropertiesBase): """ _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, + "endpoint_compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, + "egress_public_network_access": { + "key": "egressPublicNetworkAccess", + "type": "str", + }, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, + "model": {"key": "model", "type": "str"}, + "model_mount_path": {"key": "modelMountPath", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, } _subtype_map = { - 'endpoint_compute_type': {'Kubernetes': 'KubernetesOnlineDeployment', 'Managed': 'ManagedOnlineDeployment'} + "endpoint_compute_type": { + "Kubernetes": "KubernetesOnlineDeployment", + "Managed": "ManagedOnlineDeployment", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword code_configuration: Code configuration for the endpoint deployment. :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration @@ -12807,17 +13116,19 @@ def __init__( :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings """ super(OnlineDeploymentProperties, self).__init__(**kwargs) - self.app_insights_enabled = kwargs.get('app_insights_enabled', False) - self.egress_public_network_access = kwargs.get('egress_public_network_access', None) - self.endpoint_compute_type = 'OnlineDeploymentProperties' # type: str - self.instance_type = kwargs.get('instance_type', None) - self.liveness_probe = kwargs.get('liveness_probe', None) - self.model = kwargs.get('model', None) - self.model_mount_path = kwargs.get('model_mount_path', None) + self.app_insights_enabled = kwargs.get("app_insights_enabled", False) + self.egress_public_network_access = kwargs.get( + "egress_public_network_access", None + ) + self.endpoint_compute_type = "OnlineDeploymentProperties" # type: str + self.instance_type = kwargs.get("instance_type", None) + self.liveness_probe = kwargs.get("liveness_probe", None) + self.model = kwargs.get("model", None) + self.model_mount_path = kwargs.get("model_mount_path", None) self.provisioning_state = None - self.readiness_probe = kwargs.get('readiness_probe', None) - self.request_settings = kwargs.get('request_settings', None) - self.scale_settings = kwargs.get('scale_settings', None) + self.readiness_probe = kwargs.get("readiness_probe", None) + self.request_settings = kwargs.get("request_settings", None) + self.scale_settings = kwargs.get("scale_settings", None) class KubernetesOnlineDeployment(OnlineDeploymentProperties): @@ -12878,34 +13189,49 @@ class KubernetesOnlineDeployment(OnlineDeploymentProperties): """ _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - 'container_resource_requirements': {'key': 'containerResourceRequirements', 'type': 'ContainerResourceRequirements'}, - } - - def __init__( - self, - **kwargs - ): + "endpoint_compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, + "egress_public_network_access": { + "key": "egressPublicNetworkAccess", + "type": "str", + }, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, + "model": {"key": "model", "type": "str"}, + "model_mount_path": {"key": "modelMountPath", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, + "container_resource_requirements": { + "key": "containerResourceRequirements", + "type": "ContainerResourceRequirements", + }, + } + + def __init__(self, **kwargs): """ :keyword code_configuration: Code configuration for the endpoint deployment. :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration @@ -12949,8 +13275,10 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ContainerResourceRequirements """ super(KubernetesOnlineDeployment, self).__init__(**kwargs) - self.endpoint_compute_type = 'Kubernetes' # type: str - self.container_resource_requirements = kwargs.get('container_resource_requirements', None) + self.endpoint_compute_type = "Kubernetes" # type: str + self.container_resource_requirements = kwargs.get( + "container_resource_requirements", None + ) class KubernetesProperties(msrest.serialization.Model): @@ -12976,20 +13304,32 @@ class KubernetesProperties(msrest.serialization.Model): """ _attribute_map = { - 'relay_connection_string': {'key': 'relayConnectionString', 'type': 'str'}, - 'service_bus_connection_string': {'key': 'serviceBusConnectionString', 'type': 'str'}, - 'extension_principal_id': {'key': 'extensionPrincipalId', 'type': 'str'}, - 'extension_instance_release_train': {'key': 'extensionInstanceReleaseTrain', 'type': 'str'}, - 'vc_name': {'key': 'vcName', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'default_instance_type': {'key': 'defaultInstanceType', 'type': 'str'}, - 'instance_types': {'key': 'instanceTypes', 'type': '{InstanceTypeSchema}'}, - } - - def __init__( - self, - **kwargs - ): + "relay_connection_string": { + "key": "relayConnectionString", + "type": "str", + }, + "service_bus_connection_string": { + "key": "serviceBusConnectionString", + "type": "str", + }, + "extension_principal_id": { + "key": "extensionPrincipalId", + "type": "str", + }, + "extension_instance_release_train": { + "key": "extensionInstanceReleaseTrain", + "type": "str", + }, + "vc_name": {"key": "vcName", "type": "str"}, + "namespace": {"key": "namespace", "type": "str"}, + "default_instance_type": {"key": "defaultInstanceType", "type": "str"}, + "instance_types": { + "key": "instanceTypes", + "type": "{InstanceTypeSchema}", + }, + } + + def __init__(self, **kwargs): """ :keyword relay_connection_string: Relay connection string. :paramtype relay_connection_string: str @@ -13010,14 +13350,22 @@ def __init__( ~azure.mgmt.machinelearningservices.models.InstanceTypeSchema] """ super(KubernetesProperties, self).__init__(**kwargs) - self.relay_connection_string = kwargs.get('relay_connection_string', None) - self.service_bus_connection_string = kwargs.get('service_bus_connection_string', None) - self.extension_principal_id = kwargs.get('extension_principal_id', None) - self.extension_instance_release_train = kwargs.get('extension_instance_release_train', None) - self.vc_name = kwargs.get('vc_name', None) - self.namespace = kwargs.get('namespace', "default") - self.default_instance_type = kwargs.get('default_instance_type', None) - self.instance_types = kwargs.get('instance_types', None) + self.relay_connection_string = kwargs.get( + "relay_connection_string", None + ) + self.service_bus_connection_string = kwargs.get( + "service_bus_connection_string", None + ) + self.extension_principal_id = kwargs.get( + "extension_principal_id", None + ) + self.extension_instance_release_train = kwargs.get( + "extension_instance_release_train", None + ) + self.vc_name = kwargs.get("vc_name", None) + self.namespace = kwargs.get("namespace", "default") + self.default_instance_type = kwargs.get("default_instance_type", None) + self.instance_types = kwargs.get("instance_types", None) class ListAmlUserFeatureResult(msrest.serialization.Model): @@ -13033,21 +13381,17 @@ class ListAmlUserFeatureResult(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlUserFeature]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[AmlUserFeature]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListAmlUserFeatureResult, self).__init__(**kwargs) self.value = None self.next_link = None @@ -13065,21 +13409,17 @@ class ListNotebookKeysResult(msrest.serialization.Model): """ _validation = { - 'primary_access_key': {'readonly': True}, - 'secondary_access_key': {'readonly': True}, + "primary_access_key": {"readonly": True}, + "secondary_access_key": {"readonly": True}, } _attribute_map = { - 'primary_access_key': {'key': 'primaryAccessKey', 'type': 'str'}, - 'secondary_access_key': {'key': 'secondaryAccessKey', 'type': 'str'}, + "primary_access_key": {"key": "primaryAccessKey", "type": "str"}, + "secondary_access_key": {"key": "secondaryAccessKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListNotebookKeysResult, self).__init__(**kwargs) self.primary_access_key = None self.secondary_access_key = None @@ -13095,19 +13435,15 @@ class ListStorageAccountKeysResult(msrest.serialization.Model): """ _validation = { - 'user_storage_key': {'readonly': True}, + "user_storage_key": {"readonly": True}, } _attribute_map = { - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, + "user_storage_key": {"key": "userStorageKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListStorageAccountKeysResult, self).__init__(**kwargs) self.user_storage_key = None @@ -13125,21 +13461,17 @@ class ListUsagesResult(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[Usage]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Usage]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListUsagesResult, self).__init__(**kwargs) self.value = None self.next_link = None @@ -13165,27 +13497,35 @@ class ListWorkspaceKeysResult(msrest.serialization.Model): """ _validation = { - 'user_storage_key': {'readonly': True}, - 'user_storage_resource_id': {'readonly': True}, - 'app_insights_instrumentation_key': {'readonly': True}, - 'container_registry_credentials': {'readonly': True}, - 'notebook_access_keys': {'readonly': True}, - } - - _attribute_map = { - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, - 'user_storage_resource_id': {'key': 'userStorageResourceId', 'type': 'str'}, - 'app_insights_instrumentation_key': {'key': 'appInsightsInstrumentationKey', 'type': 'str'}, - 'container_registry_credentials': {'key': 'containerRegistryCredentials', 'type': 'RegistryListCredentialsResult'}, - 'notebook_access_keys': {'key': 'notebookAccessKeys', 'type': 'ListNotebookKeysResult'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ + "user_storage_key": {"readonly": True}, + "user_storage_resource_id": {"readonly": True}, + "app_insights_instrumentation_key": {"readonly": True}, + "container_registry_credentials": {"readonly": True}, + "notebook_access_keys": {"readonly": True}, + } + + _attribute_map = { + "user_storage_key": {"key": "userStorageKey", "type": "str"}, + "user_storage_resource_id": { + "key": "userStorageResourceId", + "type": "str", + }, + "app_insights_instrumentation_key": { + "key": "appInsightsInstrumentationKey", + "type": "str", + }, + "container_registry_credentials": { + "key": "containerRegistryCredentials", + "type": "RegistryListCredentialsResult", + }, + "notebook_access_keys": { + "key": "notebookAccessKeys", + "type": "ListNotebookKeysResult", + }, + } + + def __init__(self, **kwargs): + """ """ super(ListWorkspaceKeysResult, self).__init__(**kwargs) self.user_storage_key = None self.user_storage_resource_id = None @@ -13207,21 +13547,17 @@ class ListWorkspaceQuotas(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[ResourceQuota]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[ResourceQuota]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListWorkspaceQuotas, self).__init__(**kwargs) self.value = None self.next_link = None @@ -13243,20 +13579,21 @@ class LiteralJobInput(JobInput): """ _validation = { - 'job_input_type': {'required': True}, - 'value': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "job_input_type": {"required": True}, + "value": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, + "value": {"key": "value", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: Description for the input. :paramtype description: str @@ -13264,8 +13601,8 @@ def __init__( :paramtype value: str """ super(LiteralJobInput, self).__init__(**kwargs) - self.job_input_type = 'literal' # type: str - self.value = kwargs['value'] + self.job_input_type = "literal" # type: str + self.value = kwargs["value"] class ManagedIdentity(IdentityConfiguration): @@ -13289,20 +13626,17 @@ class ManagedIdentity(IdentityConfiguration): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + "object_id": {"key": "objectId", "type": "str"}, + "resource_id": {"key": "resourceId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword client_id: Specifies a user-assigned identity by client ID. For system-assigned, do not set this field. @@ -13315,10 +13649,10 @@ def __init__( :paramtype resource_id: str """ super(ManagedIdentity, self).__init__(**kwargs) - self.identity_type = 'Managed' # type: str - self.client_id = kwargs.get('client_id', None) - self.object_id = kwargs.get('object_id', None) - self.resource_id = kwargs.get('resource_id', None) + self.identity_type = "Managed" # type: str + self.client_id = kwargs.get("client_id", None) + self.object_id = kwargs.get("object_id", None) + self.resource_id = kwargs.get("resource_id", None) class WorkspaceConnectionPropertiesV2(msrest.serialization.Model): @@ -13344,25 +13678,28 @@ class WorkspaceConnectionPropertiesV2(msrest.serialization.Model): """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, } _subtype_map = { - 'auth_type': {'ManagedIdentity': 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', 'None': 'NoneAuthTypeWorkspaceConnectionProperties', 'PAT': 'PATAuthTypeWorkspaceConnectionProperties', 'SAS': 'SASAuthTypeWorkspaceConnectionProperties', 'UsernamePassword': 'UsernamePasswordAuthTypeWorkspaceConnectionProperties'} + "auth_type": { + "ManagedIdentity": "ManagedIdentityAuthTypeWorkspaceConnectionProperties", + "None": "NoneAuthTypeWorkspaceConnectionProperties", + "PAT": "PATAuthTypeWorkspaceConnectionProperties", + "SAS": "SASAuthTypeWorkspaceConnectionProperties", + "UsernamePassword": "UsernamePasswordAuthTypeWorkspaceConnectionProperties", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: Category of the connection. Possible values include: "PythonFeed", "ContainerRegistry", "Git". @@ -13377,13 +13714,15 @@ def __init__( """ super(WorkspaceConnectionPropertiesV2, self).__init__(**kwargs) self.auth_type = None # type: Optional[str] - self.category = kwargs.get('category', None) - self.target = kwargs.get('target', None) - self.value = kwargs.get('value', None) - self.value_format = kwargs.get('value_format', None) + self.category = kwargs.get("category", None) + self.target = kwargs.get("target", None) + self.value = kwargs.get("value", None) + self.value_format = kwargs.get("value_format", None) -class ManagedIdentityAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class ManagedIdentityAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """ManagedIdentityAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -13406,22 +13745,22 @@ class ManagedIdentityAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPr """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionManagedIdentity'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionManagedIdentity", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: Category of the connection. Possible values include: "PythonFeed", "ContainerRegistry", "Git". @@ -13437,9 +13776,11 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity """ - super(ManagedIdentityAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'ManagedIdentity' # type: str - self.credentials = kwargs.get('credentials', None) + super( + ManagedIdentityAuthTypeWorkspaceConnectionProperties, self + ).__init__(**kwargs) + self.auth_type = "ManagedIdentity" # type: str + self.credentials = kwargs.get("credentials", None) class ManagedOnlineDeployment(OnlineDeploymentProperties): @@ -13496,33 +13837,45 @@ class ManagedOnlineDeployment(OnlineDeploymentProperties): """ _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - } - - def __init__( - self, - **kwargs - ): + "endpoint_compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, + "egress_public_network_access": { + "key": "egressPublicNetworkAccess", + "type": "str", + }, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, + "model": {"key": "model", "type": "str"}, + "model_mount_path": {"key": "modelMountPath", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, + } + + def __init__(self, **kwargs): """ :keyword code_configuration: Code configuration for the endpoint deployment. :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration @@ -13562,7 +13915,7 @@ def __init__( :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings """ super(ManagedOnlineDeployment, self).__init__(**kwargs) - self.endpoint_compute_type = 'Managed' # type: str + self.endpoint_compute_type = "Managed" # type: str class ManagedServiceIdentity(msrest.serialization.Model): @@ -13591,22 +13944,22 @@ class ManagedServiceIdentity(msrest.serialization.Model): """ _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, + "principal_id": {"readonly": True}, + "tenant_id": {"readonly": True}, + "type": {"required": True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{UserAssignedIdentity}", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword type: Required. Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", @@ -13622,8 +13975,10 @@ def __init__( super(ManagedServiceIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None - self.type = kwargs['type'] - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + self.type = kwargs["type"] + self.user_assigned_identities = kwargs.get( + "user_assigned_identities", None + ) class ManagedServiceIdentityAutoGenerated(msrest.serialization.Model): @@ -13652,22 +14007,22 @@ class ManagedServiceIdentityAutoGenerated(msrest.serialization.Model): """ _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, + "principal_id": {"readonly": True}, + "tenant_id": {"readonly": True}, + "type": {"required": True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{UserAssignedIdentity}", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword type: Required. Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", @@ -13683,8 +14038,10 @@ def __init__( super(ManagedServiceIdentityAutoGenerated, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None - self.type = kwargs['type'] - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + self.type = kwargs["type"] + self.user_assigned_identities = kwargs.get( + "user_assigned_identities", None + ) class MedianStoppingPolicy(EarlyTerminationPolicy): @@ -13703,19 +14060,16 @@ class MedianStoppingPolicy(EarlyTerminationPolicy): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. :paramtype delay_evaluation: int @@ -13723,7 +14077,7 @@ def __init__( :paramtype evaluation_interval: int """ super(MedianStoppingPolicy, self).__init__(**kwargs) - self.policy_type = 'MedianStopping' # type: str + self.policy_type = "MedianStopping" # type: str class MLFlowModelJobInput(JobInput, AssetJobInput): @@ -13745,21 +14099,18 @@ class MLFlowModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "min_length": 1, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -13770,10 +14121,10 @@ def __init__( :paramtype description: str """ super(MLFlowModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'mlflow_model' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "mlflow_model" # type: str + self.description = kwargs.get("description", None) class MLFlowModelJobOutput(JobOutput, AssetJobOutput): @@ -13794,20 +14145,17 @@ class MLFlowModelJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -13817,10 +14165,10 @@ def __init__( :paramtype description: str """ super(MLFlowModelJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'mlflow_model' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "mlflow_model" # type: str + self.description = kwargs.get("description", None) class MLTableData(DataVersionBaseProperties): @@ -13849,25 +14197,26 @@ class MLTableData(DataVersionBaseProperties): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'referenced_uris': {'key': 'referencedUris', 'type': '[str]'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, + "referenced_uris": {"key": "referencedUris", "type": "[str]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -13886,8 +14235,8 @@ def __init__( :paramtype referenced_uris: list[str] """ super(MLTableData, self).__init__(**kwargs) - self.data_type = 'mltable' # type: str - self.referenced_uris = kwargs.get('referenced_uris', None) + self.data_type = "mltable" # type: str + self.referenced_uris = kwargs.get("referenced_uris", None) class MLTableJobInput(JobInput, AssetJobInput): @@ -13909,21 +14258,18 @@ class MLTableJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "min_length": 1, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -13934,10 +14280,10 @@ def __init__( :paramtype description: str """ super(MLTableJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'mltable' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "mltable" # type: str + self.description = kwargs.get("description", None) class MLTableJobOutput(JobOutput, AssetJobOutput): @@ -13958,20 +14304,17 @@ class MLTableJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -13981,10 +14324,10 @@ def __init__( :paramtype description: str """ super(MLTableJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'mltable' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "mltable" # type: str + self.description = kwargs.get("description", None) class ModelContainer(Resource): @@ -14010,31 +14353,31 @@ class ModelContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "ModelContainerProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelContainerProperties """ super(ModelContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class ModelContainerProperties(AssetContainer): @@ -14061,25 +14404,22 @@ class ModelContainerProperties(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -14105,14 +14445,11 @@ class ModelContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ModelContainer]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of ModelContainer objects. If null, there are no additional pages. @@ -14120,9 +14457,11 @@ def __init__( :keyword value: An array of objects of type ModelContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelContainer] """ - super(ModelContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(ModelContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class ModelVersion(Resource): @@ -14148,31 +14487,28 @@ class ModelVersion(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelVersionProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "ModelVersionProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelVersionProperties """ super(ModelVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class ModelVersionProperties(AssetBase): @@ -14207,27 +14543,24 @@ class ModelVersionProperties(AssetBase): """ _validation = { - 'provisioning_state': {'readonly': True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'flavors': {'key': 'flavors', 'type': '{FlavorData}'}, - 'job_name': {'key': 'jobName', 'type': 'str'}, - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'model_uri': {'key': 'modelUri', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "flavors": {"key": "flavors", "type": "{FlavorData}"}, + "job_name": {"key": "jobName", "type": "str"}, + "model_type": {"key": "modelType", "type": "str"}, + "model_uri": {"key": "modelUri", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "stage": {"key": "stage", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -14251,12 +14584,12 @@ def __init__( :paramtype stage: str """ super(ModelVersionProperties, self).__init__(**kwargs) - self.flavors = kwargs.get('flavors', None) - self.job_name = kwargs.get('job_name', None) - self.model_type = kwargs.get('model_type', None) - self.model_uri = kwargs.get('model_uri', None) + self.flavors = kwargs.get("flavors", None) + self.job_name = kwargs.get("job_name", None) + self.model_type = kwargs.get("model_type", None) + self.model_uri = kwargs.get("model_uri", None) self.provisioning_state = None - self.stage = kwargs.get('stage', None) + self.stage = kwargs.get("stage", None) class ModelVersionResourceArmPaginatedResult(msrest.serialization.Model): @@ -14270,14 +14603,11 @@ class ModelVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelVersion]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ModelVersion]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of ModelVersion objects. If null, there are no additional pages. @@ -14286,8 +14616,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelVersion] """ super(ModelVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class Mpi(DistributionConfiguration): @@ -14303,50 +14633,58 @@ class Mpi(DistributionConfiguration): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, + "distribution_type": {"key": "distributionType", "type": "str"}, + "process_count_per_instance": { + "key": "processCountPerInstance", + "type": "int", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword process_count_per_instance: Number of processes per MPI node. :paramtype process_count_per_instance: int """ super(Mpi, self).__init__(**kwargs) - self.distribution_type = 'Mpi' # type: str - self.process_count_per_instance = kwargs.get('process_count_per_instance', None) + self.distribution_type = "Mpi" # type: str + self.process_count_per_instance = kwargs.get( + "process_count_per_instance", None + ) class NlpVertical(msrest.serialization.Model): """Abstract class for NLP related AutoML tasks. -NLP - Natural Language Processing. + NLP - Natural Language Processing. - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword featurization_settings: Featurization inputs needed for AutoML job. :paramtype featurization_settings: @@ -14357,9 +14695,11 @@ def __init__( :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ super(NlpVertical, self).__init__(**kwargs) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.validation_data = kwargs.get('validation_data', None) + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.limit_settings = kwargs.get("limit_settings", None) + self.validation_data = kwargs.get("validation_data", None) class NlpVerticalFeaturizationSettings(FeaturizationSettings): @@ -14370,13 +14710,10 @@ class NlpVerticalFeaturizationSettings(FeaturizationSettings): """ _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, + "dataset_language": {"key": "datasetLanguage", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword dataset_language: Dataset language, useful for the text data. :paramtype dataset_language: str @@ -14396,15 +14733,12 @@ class NlpVerticalLimitSettings(msrest.serialization.Model): """ _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_trials": {"key": "maxTrials", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword max_concurrent_trials: Maximum Concurrent AutoML iterations. :paramtype max_concurrent_trials: int @@ -14414,9 +14748,9 @@ def __init__( :paramtype timeout: ~datetime.timedelta """ super(NlpVerticalLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', 1) - self.max_trials = kwargs.get('max_trials', 1) - self.timeout = kwargs.get('timeout', "P7D") + self.max_concurrent_trials = kwargs.get("max_concurrent_trials", 1) + self.max_trials = kwargs.get("max_trials", 1) + self.timeout = kwargs.get("timeout", "P7D") class NodeStateCounts(msrest.serialization.Model): @@ -14439,29 +14773,25 @@ class NodeStateCounts(msrest.serialization.Model): """ _validation = { - 'idle_node_count': {'readonly': True}, - 'running_node_count': {'readonly': True}, - 'preparing_node_count': {'readonly': True}, - 'unusable_node_count': {'readonly': True}, - 'leaving_node_count': {'readonly': True}, - 'preempted_node_count': {'readonly': True}, + "idle_node_count": {"readonly": True}, + "running_node_count": {"readonly": True}, + "preparing_node_count": {"readonly": True}, + "unusable_node_count": {"readonly": True}, + "leaving_node_count": {"readonly": True}, + "preempted_node_count": {"readonly": True}, } _attribute_map = { - 'idle_node_count': {'key': 'idleNodeCount', 'type': 'int'}, - 'running_node_count': {'key': 'runningNodeCount', 'type': 'int'}, - 'preparing_node_count': {'key': 'preparingNodeCount', 'type': 'int'}, - 'unusable_node_count': {'key': 'unusableNodeCount', 'type': 'int'}, - 'leaving_node_count': {'key': 'leavingNodeCount', 'type': 'int'}, - 'preempted_node_count': {'key': 'preemptedNodeCount', 'type': 'int'}, + "idle_node_count": {"key": "idleNodeCount", "type": "int"}, + "running_node_count": {"key": "runningNodeCount", "type": "int"}, + "preparing_node_count": {"key": "preparingNodeCount", "type": "int"}, + "unusable_node_count": {"key": "unusableNodeCount", "type": "int"}, + "leaving_node_count": {"key": "leavingNodeCount", "type": "int"}, + "preempted_node_count": {"key": "preemptedNodeCount", "type": "int"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NodeStateCounts, self).__init__(**kwargs) self.idle_node_count = None self.running_node_count = None @@ -14471,7 +14801,9 @@ def __init__( self.preempted_node_count = None -class NoneAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class NoneAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """NoneAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -14491,21 +14823,18 @@ class NoneAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2) """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: Category of the connection. Possible values include: "PythonFeed", "ContainerRegistry", "Git". @@ -14518,8 +14847,10 @@ def __init__( "JSON". :paramtype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat """ - super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'None' # type: str + super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__( + **kwargs + ) + self.auth_type = "None" # type: str class NoneDatastoreCredentials(DatastoreCredentials): @@ -14534,21 +14865,17 @@ class NoneDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, + "credentials_type": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NoneDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'None' # type: str + self.credentials_type = "None" # type: str class NotebookAccessTokenResult(msrest.serialization.Model): @@ -14575,33 +14902,29 @@ class NotebookAccessTokenResult(msrest.serialization.Model): """ _validation = { - 'notebook_resource_id': {'readonly': True}, - 'host_name': {'readonly': True}, - 'public_dns': {'readonly': True}, - 'access_token': {'readonly': True}, - 'token_type': {'readonly': True}, - 'expires_in': {'readonly': True}, - 'refresh_token': {'readonly': True}, - 'scope': {'readonly': True}, + "notebook_resource_id": {"readonly": True}, + "host_name": {"readonly": True}, + "public_dns": {"readonly": True}, + "access_token": {"readonly": True}, + "token_type": {"readonly": True}, + "expires_in": {"readonly": True}, + "refresh_token": {"readonly": True}, + "scope": {"readonly": True}, } _attribute_map = { - 'notebook_resource_id': {'key': 'notebookResourceId', 'type': 'str'}, - 'host_name': {'key': 'hostName', 'type': 'str'}, - 'public_dns': {'key': 'publicDns', 'type': 'str'}, - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, - 'expires_in': {'key': 'expiresIn', 'type': 'int'}, - 'refresh_token': {'key': 'refreshToken', 'type': 'str'}, - 'scope': {'key': 'scope', 'type': 'str'}, + "notebook_resource_id": {"key": "notebookResourceId", "type": "str"}, + "host_name": {"key": "hostName", "type": "str"}, + "public_dns": {"key": "publicDns", "type": "str"}, + "access_token": {"key": "accessToken", "type": "str"}, + "token_type": {"key": "tokenType", "type": "str"}, + "expires_in": {"key": "expiresIn", "type": "int"}, + "refresh_token": {"key": "refreshToken", "type": "str"}, + "scope": {"key": "scope", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NotebookAccessTokenResult, self).__init__(**kwargs) self.notebook_resource_id = None self.host_name = None @@ -14623,14 +14946,11 @@ class NotebookPreparationError(msrest.serialization.Model): """ _attribute_map = { - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'status_code': {'key': 'statusCode', 'type': 'int'}, + "error_message": {"key": "errorMessage", "type": "str"}, + "status_code": {"key": "statusCode", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword error_message: :paramtype error_message: str @@ -14638,8 +14958,8 @@ def __init__( :paramtype status_code: int """ super(NotebookPreparationError, self).__init__(**kwargs) - self.error_message = kwargs.get('error_message', None) - self.status_code = kwargs.get('status_code', None) + self.error_message = kwargs.get("error_message", None) + self.status_code = kwargs.get("status_code", None) class NotebookResourceInfo(msrest.serialization.Model): @@ -14655,15 +14975,15 @@ class NotebookResourceInfo(msrest.serialization.Model): """ _attribute_map = { - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'notebook_preparation_error': {'key': 'notebookPreparationError', 'type': 'NotebookPreparationError'}, + "fqdn": {"key": "fqdn", "type": "str"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "notebook_preparation_error": { + "key": "notebookPreparationError", + "type": "NotebookPreparationError", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword fqdn: :paramtype fqdn: str @@ -14674,9 +14994,11 @@ def __init__( ~azure.mgmt.machinelearningservices.models.NotebookPreparationError """ super(NotebookResourceInfo, self).__init__(**kwargs) - self.fqdn = kwargs.get('fqdn', None) - self.resource_id = kwargs.get('resource_id', None) - self.notebook_preparation_error = kwargs.get('notebook_preparation_error', None) + self.fqdn = kwargs.get("fqdn", None) + self.resource_id = kwargs.get("resource_id", None) + self.notebook_preparation_error = kwargs.get( + "notebook_preparation_error", None + ) class Objective(msrest.serialization.Model): @@ -14692,19 +15014,20 @@ class Objective(msrest.serialization.Model): """ _validation = { - 'goal': {'required': True}, - 'primary_metric': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "goal": {"required": True}, + "primary_metric": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'goal': {'key': 'goal', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "goal": {"key": "goal", "type": "str"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword goal: Required. [Required] Defines supported metric goals for hyperparameter tuning. Possible values include: "Minimize", "Maximize". @@ -14713,8 +15036,8 @@ def __init__( :paramtype primary_metric: str """ super(Objective, self).__init__(**kwargs) - self.goal = kwargs['goal'] - self.primary_metric = kwargs['primary_metric'] + self.goal = kwargs["goal"] + self.primary_metric = kwargs["primary_metric"] class OnlineDeployment(TrackedResource): @@ -14751,31 +15074,31 @@ class OnlineDeployment(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineDeploymentProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": { + "key": "properties", + "type": "OnlineDeploymentProperties", + }, + "sku": {"key": "sku", "type": "Sku"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -14792,13 +15115,15 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ super(OnlineDeployment, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) + self.identity = kwargs.get("identity", None) + self.kind = kwargs.get("kind", None) + self.properties = kwargs["properties"] + self.sku = kwargs.get("sku", None) -class OnlineDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class OnlineDeploymentTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of OnlineDeployment entities. :ivar next_link: The link to the next page of OnlineDeployment objects. If null, there are no @@ -14809,14 +15134,11 @@ class OnlineDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Mod """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineDeployment]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[OnlineDeployment]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of OnlineDeployment objects. If null, there are no additional pages. @@ -14824,9 +15146,11 @@ def __init__( :keyword value: An array of objects of type OnlineDeployment. :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineDeployment] """ - super(OnlineDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super( + OnlineDeploymentTrackedResourceArmPaginatedResult, self + ).__init__(**kwargs) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class OnlineEndpoint(TrackedResource): @@ -14863,31 +15187,31 @@ class OnlineEndpoint(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": { + "key": "properties", + "type": "OnlineEndpointProperties", + }, + "sku": {"key": "sku", "type": "Sku"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -14904,10 +15228,10 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ super(OnlineEndpoint, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) + self.identity = kwargs.get("identity", None) + self.kind = kwargs.get("kind", None) + self.properties = kwargs["properties"] + self.sku = kwargs.get("sku", None) class OnlineEndpointProperties(EndpointPropertiesBase): @@ -14953,30 +15277,27 @@ class OnlineEndpointProperties(EndpointPropertiesBase): """ _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "auth_mode": {"required": True}, + "scoring_uri": {"readonly": True}, + "swagger_uri": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'mirror_traffic': {'key': 'mirrorTraffic', 'type': '{int}'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, - 'traffic': {'key': 'traffic', 'type': '{int}'}, + "auth_mode": {"key": "authMode", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "keys": {"key": "keys", "type": "EndpointAuthKeys"}, + "properties": {"key": "properties", "type": "{str}"}, + "scoring_uri": {"key": "scoringUri", "type": "str"}, + "swagger_uri": {"key": "swaggerUri", "type": "str"}, + "compute": {"key": "compute", "type": "str"}, + "mirror_traffic": {"key": "mirrorTraffic", "type": "{int}"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "public_network_access": {"key": "publicNetworkAccess", "type": "str"}, + "traffic": {"key": "traffic", "type": "{int}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' @@ -15005,14 +15326,16 @@ def __init__( :paramtype traffic: dict[str, int] """ super(OnlineEndpointProperties, self).__init__(**kwargs) - self.compute = kwargs.get('compute', None) - self.mirror_traffic = kwargs.get('mirror_traffic', None) + self.compute = kwargs.get("compute", None) + self.mirror_traffic = kwargs.get("mirror_traffic", None) self.provisioning_state = None - self.public_network_access = kwargs.get('public_network_access', None) - self.traffic = kwargs.get('traffic', None) + self.public_network_access = kwargs.get("public_network_access", None) + self.traffic = kwargs.get("traffic", None) -class OnlineEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class OnlineEndpointTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of OnlineEndpoint entities. :ivar next_link: The link to the next page of OnlineEndpoint objects. If null, there are no @@ -15023,14 +15346,11 @@ class OnlineEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineEndpoint]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[OnlineEndpoint]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of OnlineEndpoint objects. If null, there are no additional pages. @@ -15038,9 +15358,11 @@ def __init__( :keyword value: An array of objects of type OnlineEndpoint. :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] """ - super(OnlineEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(OnlineEndpointTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class OnlineRequestSettings(msrest.serialization.Model): @@ -15059,15 +15381,15 @@ class OnlineRequestSettings(msrest.serialization.Model): """ _attribute_map = { - 'max_concurrent_requests_per_instance': {'key': 'maxConcurrentRequestsPerInstance', 'type': 'int'}, - 'max_queue_wait': {'key': 'maxQueueWait', 'type': 'duration'}, - 'request_timeout': {'key': 'requestTimeout', 'type': 'duration'}, + "max_concurrent_requests_per_instance": { + "key": "maxConcurrentRequestsPerInstance", + "type": "int", + }, + "max_queue_wait": {"key": "maxQueueWait", "type": "duration"}, + "request_timeout": {"key": "requestTimeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword max_concurrent_requests_per_instance: The number of maximum concurrent requests per node allowed per deployment. Defaults to 1. @@ -15081,9 +15403,11 @@ def __init__( :paramtype request_timeout: ~datetime.timedelta """ super(OnlineRequestSettings, self).__init__(**kwargs) - self.max_concurrent_requests_per_instance = kwargs.get('max_concurrent_requests_per_instance', 1) - self.max_queue_wait = kwargs.get('max_queue_wait', "PT0.5S") - self.request_timeout = kwargs.get('request_timeout', "PT5S") + self.max_concurrent_requests_per_instance = kwargs.get( + "max_concurrent_requests_per_instance", 1 + ) + self.max_queue_wait = kwargs.get("max_queue_wait", "PT0.5S") + self.request_timeout = kwargs.get("request_timeout", "PT5S") class OutputPathAssetReference(AssetReferenceBase): @@ -15101,19 +15425,16 @@ class OutputPathAssetReference(AssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "job_id": {"key": "jobId", "type": "str"}, + "path": {"key": "path", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword job_id: ARM resource ID of the job. :paramtype job_id: str @@ -15121,9 +15442,9 @@ def __init__( :paramtype path: str """ super(OutputPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'OutputPath' # type: str - self.job_id = kwargs.get('job_id', None) - self.path = kwargs.get('path', None) + self.reference_type = "OutputPath" # type: str + self.job_id = kwargs.get("job_id", None) + self.path = kwargs.get("path", None) class PaginatedComputeResourcesList(msrest.serialization.Model): @@ -15136,14 +15457,11 @@ class PaginatedComputeResourcesList(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[ComputeResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[ComputeResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: An array of Machine Learning compute objects wrapped in ARM resource envelope. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComputeResource] @@ -15151,8 +15469,8 @@ def __init__( :paramtype next_link: str """ super(PaginatedComputeResourcesList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get("value", None) + self.next_link = kwargs.get("next_link", None) class PartialBatchDeployment(msrest.serialization.Model): @@ -15163,22 +15481,21 @@ class PartialBatchDeployment(msrest.serialization.Model): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: Description of the endpoint deployment. :paramtype description: str """ super(PartialBatchDeployment, self).__init__(**kwargs) - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) -class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties(msrest.serialization.Model): +class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties( + msrest.serialization.Model +): """Strictly used in update requests. :ivar properties: Additional attributes of the entity. @@ -15188,23 +15505,23 @@ class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties(msrest.s """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'PartialBatchDeployment'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "properties": {"key": "properties", "type": "PartialBatchDeployment"}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.PartialBatchDeployment :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] """ - super(PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) + super( + PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, + self, + ).__init__(**kwargs) + self.properties = kwargs.get("properties", None) + self.tags = kwargs.get("tags", None) class PartialManagedServiceIdentity(ManagedServiceIdentityAutoGenerated): @@ -15233,22 +15550,22 @@ class PartialManagedServiceIdentity(ManagedServiceIdentityAutoGenerated): """ _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, + "principal_id": {"readonly": True}, + "tenant_id": {"readonly": True}, + "type": {"required": True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{UserAssignedIdentity}", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword type: Required. Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", @@ -15279,14 +15596,14 @@ class PartialManagedServiceIdentityAutoGenerated(msrest.serialization.Model): """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{object}'}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{object}", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword type: Managed service identity (system assigned and/or user assigned identities). Possible values include: "None", "SystemAssigned", "UserAssigned", @@ -15298,9 +15615,13 @@ def __init__( The dictionary values can be empty objects ({}) in requests. :paramtype user_assigned_identities: dict[str, any] """ - super(PartialManagedServiceIdentityAutoGenerated, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + super(PartialManagedServiceIdentityAutoGenerated, self).__init__( + **kwargs + ) + self.type = kwargs.get("type", None) + self.user_assigned_identities = kwargs.get( + "user_assigned_identities", None + ) class PartialMinimalTrackedResource(msrest.serialization.Model): @@ -15311,19 +15632,16 @@ class PartialMinimalTrackedResource(msrest.serialization.Model): """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] """ super(PartialMinimalTrackedResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) + self.tags = kwargs.get("tags", None) class PartialMinimalTrackedResourceWithIdentity(PartialMinimalTrackedResource): @@ -15337,14 +15655,14 @@ class PartialMinimalTrackedResourceWithIdentity(PartialMinimalTrackedResource): """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentityAutoGenerated'}, + "tags": {"key": "tags", "type": "{str}"}, + "identity": { + "key": "identity", + "type": "PartialManagedServiceIdentityAutoGenerated", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -15352,8 +15670,10 @@ def __init__( :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentityAutoGenerated """ - super(PartialMinimalTrackedResourceWithIdentity, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) + super(PartialMinimalTrackedResourceWithIdentity, self).__init__( + **kwargs + ) + self.identity = kwargs.get("identity", None) class PartialMinimalTrackedResourceWithSku(PartialMinimalTrackedResource): @@ -15366,14 +15686,11 @@ class PartialMinimalTrackedResourceWithSku(PartialMinimalTrackedResource): """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "PartialSku"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -15381,7 +15698,7 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku """ super(PartialMinimalTrackedResourceWithSku, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) + self.sku = kwargs.get("sku", None) class PartialRegistryPartialTrackedResource(msrest.serialization.Model): @@ -15396,15 +15713,15 @@ class PartialRegistryPartialTrackedResource(msrest.serialization.Model): """ _attribute_map = { - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "identity": { + "key": "identity", + "type": "PartialManagedServiceIdentity", + }, + "sku": {"key": "sku", "type": "PartialSku"}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword identity: Managed service identity (system assigned and/or user assigned identities). :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity @@ -15414,9 +15731,9 @@ def __init__( :paramtype tags: dict[str, str] """ super(PartialRegistryPartialTrackedResource, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) + self.identity = kwargs.get("identity", None) + self.sku = kwargs.get("sku", None) + self.tags = kwargs.get("tags", None) class PartialSku(msrest.serialization.Model): @@ -15440,17 +15757,14 @@ class PartialSku(msrest.serialization.Model): """ _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'int'}, - 'family': {'key': 'family', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, + "capacity": {"key": "capacity", "type": "int"}, + "family": {"key": "family", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "size": {"key": "size", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword capacity: If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted. @@ -15469,11 +15783,11 @@ def __init__( :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier """ super(PartialSku, self).__init__(**kwargs) - self.capacity = kwargs.get('capacity', None) - self.family = kwargs.get('family', None) - self.name = kwargs.get('name', None) - self.size = kwargs.get('size', None) - self.tier = kwargs.get('tier', None) + self.capacity = kwargs.get("capacity", None) + self.family = kwargs.get("family", None) + self.name = kwargs.get("name", None) + self.size = kwargs.get("size", None) + self.tier = kwargs.get("tier", None) class Password(msrest.serialization.Model): @@ -15488,27 +15802,25 @@ class Password(msrest.serialization.Model): """ _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, + "name": {"readonly": True}, + "value": {"readonly": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "value": {"key": "value", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Password, self).__init__(**kwargs) self.name = None self.value = None -class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class PATAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """PATAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -15531,22 +15843,22 @@ class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionPersonalAccessToken'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionPersonalAccessToken", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: Category of the connection. Possible values include: "PythonFeed", "ContainerRegistry", "Git". @@ -15562,9 +15874,11 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken """ - super(PATAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'PAT' # type: str - self.credentials = kwargs.get('credentials', None) + super(PATAuthTypeWorkspaceConnectionProperties, self).__init__( + **kwargs + ) + self.auth_type = "PAT" # type: str + self.credentials = kwargs.get("credentials", None) class PendingUploadCredentialDto(msrest.serialization.Model): @@ -15582,23 +15896,17 @@ class PendingUploadCredentialDto(msrest.serialization.Model): """ _validation = { - 'credential_type': {'required': True}, + "credential_type": {"required": True}, } _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, + "credential_type": {"key": "credentialType", "type": "str"}, } - _subtype_map = { - 'credential_type': {'SAS': 'SASCredentialDto'} - } + _subtype_map = {"credential_type": {"SAS": "SASCredentialDto"}} - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(PendingUploadCredentialDto, self).__init__(**kwargs) self.credential_type = None # type: Optional[str] @@ -15615,14 +15923,11 @@ class PendingUploadRequestDto(msrest.serialization.Model): """ _attribute_map = { - 'pending_upload_id': {'key': 'pendingUploadId', 'type': 'str'}, - 'pending_upload_type': {'key': 'pendingUploadType', 'type': 'str'}, + "pending_upload_id": {"key": "pendingUploadId", "type": "str"}, + "pending_upload_type": {"key": "pendingUploadType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword pending_upload_id: If PendingUploadId = null then random guid will be used. :paramtype pending_upload_id: str @@ -15632,8 +15937,8 @@ def __init__( ~azure.mgmt.machinelearningservices.models.PendingUploadType """ super(PendingUploadRequestDto, self).__init__(**kwargs) - self.pending_upload_id = kwargs.get('pending_upload_id', None) - self.pending_upload_type = kwargs.get('pending_upload_type', None) + self.pending_upload_id = kwargs.get("pending_upload_id", None) + self.pending_upload_type = kwargs.get("pending_upload_type", None) class PendingUploadResponseDto(msrest.serialization.Model): @@ -15651,15 +15956,15 @@ class PendingUploadResponseDto(msrest.serialization.Model): """ _attribute_map = { - 'blob_reference_for_consumption': {'key': 'blobReferenceForConsumption', 'type': 'BlobReferenceForConsumptionDto'}, - 'pending_upload_id': {'key': 'pendingUploadId', 'type': 'str'}, - 'pending_upload_type': {'key': 'pendingUploadType', 'type': 'str'}, + "blob_reference_for_consumption": { + "key": "blobReferenceForConsumption", + "type": "BlobReferenceForConsumptionDto", + }, + "pending_upload_id": {"key": "pendingUploadId", "type": "str"}, + "pending_upload_type": {"key": "pendingUploadType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword blob_reference_for_consumption: Container level read, write, list SAS. :paramtype blob_reference_for_consumption: @@ -15672,9 +15977,11 @@ def __init__( ~azure.mgmt.machinelearningservices.models.PendingUploadType """ super(PendingUploadResponseDto, self).__init__(**kwargs) - self.blob_reference_for_consumption = kwargs.get('blob_reference_for_consumption', None) - self.pending_upload_id = kwargs.get('pending_upload_id', None) - self.pending_upload_type = kwargs.get('pending_upload_type', None) + self.blob_reference_for_consumption = kwargs.get( + "blob_reference_for_consumption", None + ) + self.pending_upload_id = kwargs.get("pending_upload_id", None) + self.pending_upload_type = kwargs.get("pending_upload_type", None) class PersonalComputeInstanceSettings(msrest.serialization.Model): @@ -15685,19 +15992,16 @@ class PersonalComputeInstanceSettings(msrest.serialization.Model): """ _attribute_map = { - 'assigned_user': {'key': 'assignedUser', 'type': 'AssignedUser'}, + "assigned_user": {"key": "assignedUser", "type": "AssignedUser"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword assigned_user: A user explicitly assigned to a personal compute instance. :paramtype assigned_user: ~azure.mgmt.machinelearningservices.models.AssignedUser """ super(PersonalComputeInstanceSettings, self).__init__(**kwargs) - self.assigned_user = kwargs.get('assigned_user', None) + self.assigned_user = kwargs.get("assigned_user", None) class PipelineJob(JobBaseProperties): @@ -15751,34 +16055,31 @@ class PipelineJob(JobBaseProperties): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'jobs': {'key': 'jobs', 'type': '{object}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'settings': {'key': 'settings', 'type': 'object'}, - 'source_job_id': {'key': 'sourceJobId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + "job_type": {"required": True}, + "status": {"readonly": True}, + } + + _attribute_map = { + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "jobs": {"key": "jobs", "type": "{object}"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "settings": {"key": "settings", "type": "object"}, + "source_job_id": {"key": "sourceJobId", "type": "str"}, + } + + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -15816,12 +16117,12 @@ def __init__( :paramtype source_job_id: str """ super(PipelineJob, self).__init__(**kwargs) - self.job_type = 'Pipeline' # type: str - self.inputs = kwargs.get('inputs', None) - self.jobs = kwargs.get('jobs', None) - self.outputs = kwargs.get('outputs', None) - self.settings = kwargs.get('settings', None) - self.source_job_id = kwargs.get('source_job_id', None) + self.job_type = "Pipeline" # type: str + self.inputs = kwargs.get("inputs", None) + self.jobs = kwargs.get("jobs", None) + self.outputs = kwargs.get("outputs", None) + self.settings = kwargs.get("settings", None) + self.source_job_id = kwargs.get("source_job_id", None) class PrivateEndpoint(msrest.serialization.Model): @@ -15836,21 +16137,17 @@ class PrivateEndpoint(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'subnet_arm_id': {'readonly': True}, + "id": {"readonly": True}, + "subnet_arm_id": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'subnet_arm_id': {'key': 'subnetArmId', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "subnet_arm_id": {"key": "subnetArmId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(PrivateEndpoint, self).__init__(**kwargs) self.id = None self.subnet_arm_id = None @@ -15866,19 +16163,15 @@ class PrivateEndpointAutoGenerated(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, + "id": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(PrivateEndpointAutoGenerated, self).__init__(**kwargs) self.id = None @@ -15920,31 +16213,37 @@ class PrivateEndpointConnection(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "private_endpoint": { + "key": "properties.privateEndpoint", + "type": "PrivateEndpoint", + }, + "private_link_service_connection_state": { + "key": "properties.privateLinkServiceConnectionState", + "type": "PrivateLinkServiceConnectionState", + }, + "provisioning_state": { + "key": "properties.provisioningState", + "type": "str", + }, + } + + def __init__(self, **kwargs): """ :keyword identity: The identity of the resource. :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity @@ -15962,12 +16261,14 @@ def __init__( ~azure.mgmt.machinelearningservices.models.PrivateLinkServiceConnectionState """ super(PrivateEndpointConnection, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) - self.private_endpoint = kwargs.get('private_endpoint', None) - self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + self.identity = kwargs.get("identity", None) + self.location = kwargs.get("location", None) + self.tags = kwargs.get("tags", None) + self.sku = kwargs.get("sku", None) + self.private_endpoint = kwargs.get("private_endpoint", None) + self.private_link_service_connection_state = kwargs.get( + "private_link_service_connection_state", None + ) self.provisioning_state = None @@ -15993,18 +16294,24 @@ class PrivateEndpointConnectionAutoGenerated(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'group_ids': {'key': 'properties.groupIds', 'type': '[str]'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpointResource'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionStateAutoGenerated'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "group_ids": {"key": "properties.groupIds", "type": "[str]"}, + "private_endpoint": { + "key": "properties.privateEndpoint", + "type": "PrivateEndpointResource", + }, + "private_link_service_connection_state": { + "key": "properties.privateLinkServiceConnectionState", + "type": "PrivateLinkServiceConnectionStateAutoGenerated", + }, + "provisioning_state": { + "key": "properties.provisioningState", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword id: This is the private endpoint connection name created on SRP Full resource id: @@ -16024,12 +16331,14 @@ def __init__( :paramtype provisioning_state: str """ super(PrivateEndpointConnectionAutoGenerated, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.location = kwargs.get('location', None) - self.group_ids = kwargs.get('group_ids', None) - self.private_endpoint = kwargs.get('private_endpoint', None) - self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) - self.provisioning_state = kwargs.get('provisioning_state', None) + self.id = kwargs.get("id", None) + self.location = kwargs.get("location", None) + self.group_ids = kwargs.get("group_ids", None) + self.private_endpoint = kwargs.get("private_endpoint", None) + self.private_link_service_connection_state = kwargs.get( + "private_link_service_connection_state", None + ) + self.provisioning_state = kwargs.get("provisioning_state", None) class PrivateEndpointConnectionListResult(msrest.serialization.Model): @@ -16040,19 +16349,16 @@ class PrivateEndpointConnectionListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + "value": {"key": "value", "type": "[PrivateEndpointConnection]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Array of private endpoint connections. :paramtype value: list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] """ super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class PrivateEndpointResource(PrivateEndpointAutoGenerated): @@ -16067,24 +16373,21 @@ class PrivateEndpointResource(PrivateEndpointAutoGenerated): """ _validation = { - 'id': {'readonly': True}, + "id": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'subnet_arm_id': {'key': 'subnetArmId', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "subnet_arm_id": {"key": "subnetArmId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword subnet_arm_id: The subnetId that the private endpoint is connected to. :paramtype subnet_arm_id: str """ super(PrivateEndpointResource, self).__init__(**kwargs) - self.subnet_arm_id = kwargs.get('subnet_arm_id', None) + self.subnet_arm_id = kwargs.get("subnet_arm_id", None) class PrivateLinkResource(Resource): @@ -16120,32 +16423,35 @@ class PrivateLinkResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'group_id': {'readonly': True}, - 'required_members': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, - 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "group_id": {"readonly": True}, + "required_members": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "group_id": {"key": "properties.groupId", "type": "str"}, + "required_members": { + "key": "properties.requiredMembers", + "type": "[str]", + }, + "required_zone_names": { + "key": "properties.requiredZoneNames", + "type": "[str]", + }, + } + + def __init__(self, **kwargs): """ :keyword identity: The identity of the resource. :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity @@ -16159,13 +16465,13 @@ def __init__( :paramtype required_zone_names: list[str] """ super(PrivateLinkResource, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) + self.identity = kwargs.get("identity", None) + self.location = kwargs.get("location", None) + self.tags = kwargs.get("tags", None) + self.sku = kwargs.get("sku", None) self.group_id = None self.required_members = None - self.required_zone_names = kwargs.get('required_zone_names', None) + self.required_zone_names = kwargs.get("required_zone_names", None) class PrivateLinkResourceListResult(msrest.serialization.Model): @@ -16176,19 +16482,16 @@ class PrivateLinkResourceListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + "value": {"key": "value", "type": "[PrivateLinkResource]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Array of private link resources. :paramtype value: list[~azure.mgmt.machinelearningservices.models.PrivateLinkResource] """ super(PrivateLinkResourceListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class PrivateLinkServiceConnectionState(msrest.serialization.Model): @@ -16207,15 +16510,12 @@ class PrivateLinkServiceConnectionState(msrest.serialization.Model): """ _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + "status": {"key": "status", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "actions_required": {"key": "actionsRequired", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword status: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Possible values include: "Pending", "Approved", "Rejected", @@ -16229,12 +16529,14 @@ def __init__( :paramtype actions_required: str """ super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.description = kwargs.get('description', None) - self.actions_required = kwargs.get('actions_required', None) + self.status = kwargs.get("status", None) + self.description = kwargs.get("description", None) + self.actions_required = kwargs.get("actions_required", None) -class PrivateLinkServiceConnectionStateAutoGenerated(msrest.serialization.Model): +class PrivateLinkServiceConnectionStateAutoGenerated( + msrest.serialization.Model +): """The connection state. :ivar actions_required: Some RP chose "None". Other RPs use this for region expansion. @@ -16249,15 +16551,12 @@ class PrivateLinkServiceConnectionStateAutoGenerated(msrest.serialization.Model) """ _attribute_map = { - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, + "actions_required": {"key": "actionsRequired", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "status": {"key": "status", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword actions_required: Some RP chose "None". Other RPs use this for region expansion. :paramtype actions_required: str @@ -16269,10 +16568,12 @@ def __init__( :paramtype status: str or ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus """ - super(PrivateLinkServiceConnectionStateAutoGenerated, self).__init__(**kwargs) - self.actions_required = kwargs.get('actions_required', None) - self.description = kwargs.get('description', None) - self.status = kwargs.get('status', None) + super(PrivateLinkServiceConnectionStateAutoGenerated, self).__init__( + **kwargs + ) + self.actions_required = kwargs.get("actions_required", None) + self.description = kwargs.get("description", None) + self.status = kwargs.get("status", None) class ProbeSettings(msrest.serialization.Model): @@ -16291,17 +16592,14 @@ class ProbeSettings(msrest.serialization.Model): """ _attribute_map = { - 'failure_threshold': {'key': 'failureThreshold', 'type': 'int'}, - 'initial_delay': {'key': 'initialDelay', 'type': 'duration'}, - 'period': {'key': 'period', 'type': 'duration'}, - 'success_threshold': {'key': 'successThreshold', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "failure_threshold": {"key": "failureThreshold", "type": "int"}, + "initial_delay": {"key": "initialDelay", "type": "duration"}, + "period": {"key": "period", "type": "duration"}, + "success_threshold": {"key": "successThreshold", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword failure_threshold: The number of failures to allow before returning an unhealthy status. @@ -16316,11 +16614,11 @@ def __init__( :paramtype timeout: ~datetime.timedelta """ super(ProbeSettings, self).__init__(**kwargs) - self.failure_threshold = kwargs.get('failure_threshold', 30) - self.initial_delay = kwargs.get('initial_delay', None) - self.period = kwargs.get('period', "PT10S") - self.success_threshold = kwargs.get('success_threshold', 1) - self.timeout = kwargs.get('timeout', "PT2S") + self.failure_threshold = kwargs.get("failure_threshold", 30) + self.initial_delay = kwargs.get("initial_delay", None) + self.period = kwargs.get("period", "PT10S") + self.success_threshold = kwargs.get("success_threshold", 1) + self.timeout = kwargs.get("timeout", "PT2S") class PyTorch(DistributionConfiguration): @@ -16336,25 +16634,27 @@ class PyTorch(DistributionConfiguration): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, + "distribution_type": {"key": "distributionType", "type": "str"}, + "process_count_per_instance": { + "key": "processCountPerInstance", + "type": "int", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword process_count_per_instance: Number of processes per node. :paramtype process_count_per_instance: int """ super(PyTorch, self).__init__(**kwargs) - self.distribution_type = 'PyTorch' # type: str - self.process_count_per_instance = kwargs.get('process_count_per_instance', None) + self.distribution_type = "PyTorch" # type: str + self.process_count_per_instance = kwargs.get( + "process_count_per_instance", None + ) class QuotaBaseProperties(msrest.serialization.Model): @@ -16371,16 +16671,13 @@ class QuotaBaseProperties(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "limit": {"key": "limit", "type": "long"}, + "unit": {"key": "unit", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword id: Specifies the resource ID. :paramtype id: str @@ -16393,10 +16690,10 @@ def __init__( :paramtype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit """ super(QuotaBaseProperties, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.type = kwargs.get('type', None) - self.limit = kwargs.get('limit', None) - self.unit = kwargs.get('unit', None) + self.id = kwargs.get("id", None) + self.type = kwargs.get("type", None) + self.limit = kwargs.get("limit", None) + self.unit = kwargs.get("unit", None) class QuotaUpdateParameters(msrest.serialization.Model): @@ -16409,14 +16706,11 @@ class QuotaUpdateParameters(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[QuotaBaseProperties]'}, - 'location': {'key': 'location', 'type': 'str'}, + "value": {"key": "value", "type": "[QuotaBaseProperties]"}, + "location": {"key": "location", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: The list for update quota. :paramtype value: list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] @@ -16424,8 +16718,8 @@ def __init__( :paramtype location: str """ super(QuotaUpdateParameters, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.location = kwargs.get('location', None) + self.value = kwargs.get("value", None) + self.location = kwargs.get("location", None) class RandomSamplingAlgorithm(SamplingAlgorithm): @@ -16445,19 +16739,19 @@ class RandomSamplingAlgorithm(SamplingAlgorithm): """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - 'rule': {'key': 'rule', 'type': 'str'}, - 'seed': {'key': 'seed', 'type': 'int'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, + "rule": {"key": "rule", "type": "str"}, + "seed": {"key": "seed", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword rule: The specific type of random algorithm. Possible values include: "Random", "Sobol". @@ -16466,9 +16760,9 @@ def __init__( :paramtype seed: int """ super(RandomSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Random' # type: str - self.rule = kwargs.get('rule', None) - self.seed = kwargs.get('seed', None) + self.sampling_algorithm_type = "Random" # type: str + self.rule = kwargs.get("rule", None) + self.seed = kwargs.get("seed", None) class Recurrence(msrest.serialization.Model): @@ -16490,17 +16784,14 @@ class Recurrence(msrest.serialization.Model): """ _attribute_map = { - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceSchedule'}, + "frequency": {"key": "frequency", "type": "str"}, + "interval": {"key": "interval", "type": "int"}, + "start_time": {"key": "startTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "schedule": {"key": "schedule", "type": "RecurrenceSchedule"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword frequency: [Required] The frequency to trigger schedule. Possible values include: "Minute", "Hour", "Day", "Week", "Month". @@ -16517,11 +16808,11 @@ def __init__( :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule """ super(Recurrence, self).__init__(**kwargs) - self.frequency = kwargs.get('frequency', None) - self.interval = kwargs.get('interval', None) - self.start_time = kwargs.get('start_time', None) - self.time_zone = kwargs.get('time_zone', "UTC") - self.schedule = kwargs.get('schedule', None) + self.frequency = kwargs.get("frequency", None) + self.interval = kwargs.get("interval", None) + self.start_time = kwargs.get("start_time", None) + self.time_zone = kwargs.get("time_zone", "UTC") + self.schedule = kwargs.get("schedule", None) class RecurrenceSchedule(msrest.serialization.Model): @@ -16540,21 +16831,18 @@ class RecurrenceSchedule(msrest.serialization.Model): """ _validation = { - 'hours': {'required': True}, - 'minutes': {'required': True}, + "hours": {"required": True}, + "minutes": {"required": True}, } _attribute_map = { - 'hours': {'key': 'hours', 'type': '[int]'}, - 'minutes': {'key': 'minutes', 'type': '[int]'}, - 'month_days': {'key': 'monthDays', 'type': '[int]'}, - 'week_days': {'key': 'weekDays', 'type': '[str]'}, + "hours": {"key": "hours", "type": "[int]"}, + "minutes": {"key": "minutes", "type": "[int]"}, + "month_days": {"key": "monthDays", "type": "[int]"}, + "week_days": {"key": "weekDays", "type": "[str]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword hours: Required. [Required] List of hours for the schedule. :paramtype hours: list[int] @@ -16566,10 +16854,10 @@ def __init__( :paramtype week_days: list[str or ~azure.mgmt.machinelearningservices.models.WeekDay] """ super(RecurrenceSchedule, self).__init__(**kwargs) - self.hours = kwargs['hours'] - self.minutes = kwargs['minutes'] - self.month_days = kwargs.get('month_days', None) - self.week_days = kwargs.get('week_days', None) + self.hours = kwargs["hours"] + self.minutes = kwargs["minutes"] + self.month_days = kwargs.get("month_days", None) + self.week_days = kwargs.get("week_days", None) class RecurrenceTrigger(TriggerBase): @@ -16602,25 +16890,22 @@ class RecurrenceTrigger(TriggerBase): """ _validation = { - 'trigger_type': {'required': True}, - 'frequency': {'required': True}, - 'interval': {'required': True}, + "trigger_type": {"required": True}, + "frequency": {"required": True}, + "interval": {"required": True}, } _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceSchedule'}, + "end_time": {"key": "endTime", "type": "str"}, + "start_time": {"key": "startTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "trigger_type": {"key": "triggerType", "type": "str"}, + "frequency": {"key": "frequency", "type": "str"}, + "interval": {"key": "interval", "type": "int"}, + "schedule": {"key": "schedule", "type": "RecurrenceSchedule"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer https://en.wikipedia.org/wiki/ISO_8601. @@ -16644,10 +16929,10 @@ def __init__( :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule """ super(RecurrenceTrigger, self).__init__(**kwargs) - self.trigger_type = 'Recurrence' # type: str - self.frequency = kwargs['frequency'] - self.interval = kwargs['interval'] - self.schedule = kwargs.get('schedule', None) + self.trigger_type = "Recurrence" # type: str + self.frequency = kwargs["frequency"] + self.interval = kwargs["interval"] + self.schedule = kwargs.get("schedule", None) class RegenerateEndpointKeysRequest(msrest.serialization.Model): @@ -16663,18 +16948,15 @@ class RegenerateEndpointKeysRequest(msrest.serialization.Model): """ _validation = { - 'key_type': {'required': True}, + "key_type": {"required": True}, } _attribute_map = { - 'key_type': {'key': 'keyType', 'type': 'str'}, - 'key_value': {'key': 'keyValue', 'type': 'str'}, + "key_type": {"key": "keyType", "type": "str"}, + "key_value": {"key": "keyValue", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword key_type: Required. [Required] Specification for which type of key to generate. Primary or Secondary. Possible values include: "Primary", "Secondary". @@ -16683,8 +16965,8 @@ def __init__( :paramtype key_value: str """ super(RegenerateEndpointKeysRequest, self).__init__(**kwargs) - self.key_type = kwargs['key_type'] - self.key_value = kwargs.get('key_value', None) + self.key_type = kwargs["key_type"] + self.key_value = kwargs.get("key_value", None) class Registry(TrackedResource): @@ -16738,36 +17020,51 @@ class Registry(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, - 'intellectual_property_publisher': {'key': 'properties.intellectualPropertyPublisher', 'type': 'str'}, - 'managed_resource_group': {'key': 'properties.managedResourceGroup', 'type': 'ArmResourceId'}, - 'ml_flow_registry_uri': {'key': 'properties.mlFlowRegistryUri', 'type': 'str'}, - 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnectionAutoGenerated]'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'region_details': {'key': 'properties.regionDetails', 'type': '[RegistryRegionArmDetails]'}, - } - - def __init__( - self, - **kwargs - ): + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "sku": {"key": "sku", "type": "Sku"}, + "discovery_url": {"key": "properties.discoveryUrl", "type": "str"}, + "intellectual_property_publisher": { + "key": "properties.intellectualPropertyPublisher", + "type": "str", + }, + "managed_resource_group": { + "key": "properties.managedResourceGroup", + "type": "ArmResourceId", + }, + "ml_flow_registry_uri": { + "key": "properties.mlFlowRegistryUri", + "type": "str", + }, + "private_endpoint_connections": { + "key": "properties.privateEndpointConnections", + "type": "[PrivateEndpointConnectionAutoGenerated]", + }, + "public_network_access": { + "key": "properties.publicNetworkAccess", + "type": "str", + }, + "region_details": { + "key": "properties.regionDetails", + "type": "[RegistryRegionArmDetails]", + }, + } + + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -16801,16 +17098,22 @@ def __init__( list[~azure.mgmt.machinelearningservices.models.RegistryRegionArmDetails] """ super(Registry, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.sku = kwargs.get('sku', None) - self.discovery_url = kwargs.get('discovery_url', None) - self.intellectual_property_publisher = kwargs.get('intellectual_property_publisher', None) - self.managed_resource_group = kwargs.get('managed_resource_group', None) - self.ml_flow_registry_uri = kwargs.get('ml_flow_registry_uri', None) - self.private_endpoint_connections = kwargs.get('private_endpoint_connections', None) - self.public_network_access = kwargs.get('public_network_access', None) - self.region_details = kwargs.get('region_details', None) + self.identity = kwargs.get("identity", None) + self.kind = kwargs.get("kind", None) + self.sku = kwargs.get("sku", None) + self.discovery_url = kwargs.get("discovery_url", None) + self.intellectual_property_publisher = kwargs.get( + "intellectual_property_publisher", None + ) + self.managed_resource_group = kwargs.get( + "managed_resource_group", None + ) + self.ml_flow_registry_uri = kwargs.get("ml_flow_registry_uri", None) + self.private_endpoint_connections = kwargs.get( + "private_endpoint_connections", None + ) + self.public_network_access = kwargs.get("public_network_access", None) + self.region_details = kwargs.get("region_details", None) class RegistryListCredentialsResult(msrest.serialization.Model): @@ -16827,20 +17130,17 @@ class RegistryListCredentialsResult(msrest.serialization.Model): """ _validation = { - 'location': {'readonly': True}, - 'username': {'readonly': True}, + "location": {"readonly": True}, + "username": {"readonly": True}, } _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'username': {'key': 'username', 'type': 'str'}, - 'passwords': {'key': 'passwords', 'type': '[Password]'}, + "location": {"key": "location", "type": "str"}, + "username": {"key": "username", "type": "str"}, + "passwords": {"key": "passwords", "type": "[Password]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword passwords: :paramtype passwords: list[~azure.mgmt.machinelearningservices.models.Password] @@ -16848,7 +17148,7 @@ def __init__( super(RegistryListCredentialsResult, self).__init__(**kwargs) self.location = None self.username = None - self.passwords = kwargs.get('passwords', None) + self.passwords = kwargs.get("passwords", None) class RegistryRegionArmDetails(msrest.serialization.Model): @@ -16864,15 +17164,15 @@ class RegistryRegionArmDetails(msrest.serialization.Model): """ _attribute_map = { - 'acr_details': {'key': 'acrDetails', 'type': '[AcrDetails]'}, - 'location': {'key': 'location', 'type': 'str'}, - 'storage_account_details': {'key': 'storageAccountDetails', 'type': '[StorageAccountDetails]'}, + "acr_details": {"key": "acrDetails", "type": "[AcrDetails]"}, + "location": {"key": "location", "type": "str"}, + "storage_account_details": { + "key": "storageAccountDetails", + "type": "[StorageAccountDetails]", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword acr_details: List of ACR accounts. :paramtype acr_details: list[~azure.mgmt.machinelearningservices.models.AcrDetails] @@ -16883,9 +17183,11 @@ def __init__( list[~azure.mgmt.machinelearningservices.models.StorageAccountDetails] """ super(RegistryRegionArmDetails, self).__init__(**kwargs) - self.acr_details = kwargs.get('acr_details', None) - self.location = kwargs.get('location', None) - self.storage_account_details = kwargs.get('storage_account_details', None) + self.acr_details = kwargs.get("acr_details", None) + self.location = kwargs.get("location", None) + self.storage_account_details = kwargs.get( + "storage_account_details", None + ) class RegistryTrackedResourceArmPaginatedResult(msrest.serialization.Model): @@ -16899,14 +17201,11 @@ class RegistryTrackedResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Registry]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[Registry]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of Registry objects. If null, there are no additional pages. @@ -16914,9 +17213,11 @@ def __init__( :keyword value: An array of objects of type Registry. :paramtype value: list[~azure.mgmt.machinelearningservices.models.Registry] """ - super(RegistryTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(RegistryTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class Regression(AutoMLVertical, TableVertical): @@ -16975,32 +17276,47 @@ class Regression(AutoMLVertical, TableVertical): """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'RegressionTrainingSettings'}, - } - - def __init__( - self, - **kwargs - ): + "task_type": {"required": True}, + "training_data": {"required": True}, + } + + _attribute_map = { + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "test_data": {"key": "testData", "type": "MLTableJobInput"}, + "test_data_size": {"key": "testDataSize", "type": "float"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "weight_column_name": {"key": "weightColumnName", "type": "str"}, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, + "training_settings": { + "key": "trainingSettings", + "type": "RegressionTrainingSettings", + }, + } + + def __init__(self, **kwargs): """ :keyword cv_split_column_names: Columns to use for CVSplit data. :paramtype cv_split_column_names: list[str] @@ -17049,21 +17365,23 @@ def __init__( ~azure.mgmt.machinelearningservices.models.RegressionTrainingSettings """ super(Regression, self).__init__(**kwargs) - self.cv_split_column_names = kwargs.get('cv_split_column_names', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.test_data = kwargs.get('test_data', None) - self.test_data_size = kwargs.get('test_data_size', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.weight_column_name = kwargs.get('weight_column_name', None) - self.task_type = 'Regression' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.training_settings = kwargs.get('training_settings', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.cv_split_column_names = kwargs.get("cv_split_column_names", None) + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.limit_settings = kwargs.get("limit_settings", None) + self.n_cross_validations = kwargs.get("n_cross_validations", None) + self.test_data = kwargs.get("test_data", None) + self.test_data_size = kwargs.get("test_data_size", None) + self.validation_data = kwargs.get("validation_data", None) + self.validation_data_size = kwargs.get("validation_data_size", None) + self.weight_column_name = kwargs.get("weight_column_name", None) + self.task_type = "Regression" # type: str + self.primary_metric = kwargs.get("primary_metric", None) + self.training_settings = kwargs.get("training_settings", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class RegressionTrainingSettings(TrainingSettings): @@ -17095,21 +17413,39 @@ class RegressionTrainingSettings(TrainingSettings): """ _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): + "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, + "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, + "allowed_training_algorithms": { + "key": "allowedTrainingAlgorithms", + "type": "[str]", + }, + "blocked_training_algorithms": { + "key": "blockedTrainingAlgorithms", + "type": "[str]", + }, + } + + def __init__(self, **kwargs): """ :keyword enable_dnn_training: Enable recommendation of DNN models. :paramtype enable_dnn_training: bool @@ -17136,8 +17472,12 @@ def __init__( ~azure.mgmt.machinelearningservices.models.RegressionModels] """ super(RegressionTrainingSettings, self).__init__(**kwargs) - self.allowed_training_algorithms = kwargs.get('allowed_training_algorithms', None) - self.blocked_training_algorithms = kwargs.get('blocked_training_algorithms', None) + self.allowed_training_algorithms = kwargs.get( + "allowed_training_algorithms", None + ) + self.blocked_training_algorithms = kwargs.get( + "blocked_training_algorithms", None + ) class ResourceId(msrest.serialization.Model): @@ -17150,23 +17490,20 @@ class ResourceId(msrest.serialization.Model): """ _validation = { - 'id': {'required': True}, + "id": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword id: Required. The ID of the resource. :paramtype id: str """ super(ResourceId, self).__init__(**kwargs) - self.id = kwargs['id'] + self.id = kwargs["id"] class ResourceName(msrest.serialization.Model): @@ -17181,21 +17518,17 @@ class ResourceName(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, + "value": {"readonly": True}, + "localized_value": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + "value": {"key": "value", "type": "str"}, + "localized_value": {"key": "localizedValue", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ResourceName, self).__init__(**kwargs) self.value = None self.localized_value = None @@ -17221,29 +17554,28 @@ class ResourceQuota(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'name': {'readonly': True}, - 'limit': {'readonly': True}, - 'unit': {'readonly': True}, + "id": {"readonly": True}, + "aml_workspace_location": {"readonly": True}, + "type": {"readonly": True}, + "name": {"readonly": True}, + "limit": {"readonly": True}, + "unit": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'ResourceName'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "aml_workspace_location": { + "key": "amlWorkspaceLocation", + "type": "str", + }, + "type": {"key": "type", "type": "str"}, + "name": {"key": "name", "type": "ResourceName"}, + "limit": {"key": "limit", "type": "long"}, + "unit": {"key": "unit", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ResourceQuota, self).__init__(**kwargs) self.id = None self.aml_workspace_location = None @@ -17265,19 +17597,20 @@ class Route(msrest.serialization.Model): """ _validation = { - 'path': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'port': {'required': True}, + "path": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "port": {"required": True}, } _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, + "path": {"key": "path", "type": "str"}, + "port": {"key": "port", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword path: Required. [Required] The path for the route. :paramtype path: str @@ -17285,11 +17618,13 @@ def __init__( :paramtype port: int """ super(Route, self).__init__(**kwargs) - self.path = kwargs['path'] - self.port = kwargs['port'] + self.path = kwargs["path"] + self.port = kwargs["port"] -class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class SASAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """SASAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -17312,22 +17647,22 @@ class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionSharedAccessSignature'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionSharedAccessSignature", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: Category of the connection. Possible values include: "PythonFeed", "ContainerRegistry", "Git". @@ -17343,9 +17678,11 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature """ - super(SASAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'SAS' # type: str - self.credentials = kwargs.get('credentials', None) + super(SASAuthTypeWorkspaceConnectionProperties, self).__init__( + **kwargs + ) + self.auth_type = "SAS" # type: str + self.credentials = kwargs.get("credentials", None) class SASCredentialDto(PendingUploadCredentialDto): @@ -17362,25 +17699,22 @@ class SASCredentialDto(PendingUploadCredentialDto): """ _validation = { - 'credential_type': {'required': True}, + "credential_type": {"required": True}, } _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - 'sas_uri': {'key': 'sasUri', 'type': 'str'}, + "credential_type": {"key": "credentialType", "type": "str"}, + "sas_uri": {"key": "sasUri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. :paramtype sas_uri: str """ super(SASCredentialDto, self).__init__(**kwargs) - self.credential_type = 'SAS' # type: str - self.sas_uri = kwargs.get('sas_uri', None) + self.credential_type = "SAS" # type: str + self.sas_uri = kwargs.get("sas_uri", None) class SasDatastoreCredentials(DatastoreCredentials): @@ -17397,26 +17731,23 @@ class SasDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, + "credentials_type": {"required": True}, + "secrets": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'SasDatastoreSecrets'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "secrets": {"key": "secrets", "type": "SasDatastoreSecrets"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword secrets: Required. [Required] Storage container secrets. :paramtype secrets: ~azure.mgmt.machinelearningservices.models.SasDatastoreSecrets """ super(SasDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Sas' # type: str - self.secrets = kwargs['secrets'] + self.credentials_type = "Sas" # type: str + self.secrets = kwargs["secrets"] class SasDatastoreSecrets(DatastoreSecrets): @@ -17433,25 +17764,22 @@ class SasDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'sas_token': {'key': 'sasToken', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "sas_token": {"key": "sasToken", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword sas_token: Storage container SAS token. :paramtype sas_token: str """ super(SasDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Sas' # type: str - self.sas_token = kwargs.get('sas_token', None) + self.secrets_type = "Sas" # type: str + self.sas_token = kwargs.get("sas_token", None) class ScaleSettings(msrest.serialization.Model): @@ -17469,19 +17797,19 @@ class ScaleSettings(msrest.serialization.Model): """ _validation = { - 'max_node_count': {'required': True}, + "max_node_count": {"required": True}, } _attribute_map = { - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'node_idle_time_before_scale_down': {'key': 'nodeIdleTimeBeforeScaleDown', 'type': 'duration'}, + "max_node_count": {"key": "maxNodeCount", "type": "int"}, + "min_node_count": {"key": "minNodeCount", "type": "int"}, + "node_idle_time_before_scale_down": { + "key": "nodeIdleTimeBeforeScaleDown", + "type": "duration", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword max_node_count: Required. Max number of nodes to use. :paramtype max_node_count: int @@ -17492,9 +17820,11 @@ def __init__( :paramtype node_idle_time_before_scale_down: ~datetime.timedelta """ super(ScaleSettings, self).__init__(**kwargs) - self.max_node_count = kwargs['max_node_count'] - self.min_node_count = kwargs.get('min_node_count', 0) - self.node_idle_time_before_scale_down = kwargs.get('node_idle_time_before_scale_down', None) + self.max_node_count = kwargs["max_node_count"] + self.min_node_count = kwargs.get("min_node_count", 0) + self.node_idle_time_before_scale_down = kwargs.get( + "node_idle_time_before_scale_down", None + ) class ScaleSettingsInformation(msrest.serialization.Model): @@ -17505,19 +17835,16 @@ class ScaleSettingsInformation(msrest.serialization.Model): """ _attribute_map = { - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, + "scale_settings": {"key": "scaleSettings", "type": "ScaleSettings"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword scale_settings: scale settings for AML Compute. :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings """ super(ScaleSettingsInformation, self).__init__(**kwargs) - self.scale_settings = kwargs.get('scale_settings', None) + self.scale_settings = kwargs.get("scale_settings", None) class Schedule(Resource): @@ -17543,31 +17870,28 @@ class Schedule(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ScheduleProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "ScheduleProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ScheduleProperties """ super(Schedule, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class ScheduleBase(msrest.serialization.Model): @@ -17585,15 +17909,12 @@ class ScheduleBase(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "provisioning_status": {"key": "provisioningStatus", "type": "str"}, + "status": {"key": "status", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword id: A system assigned id for the schedule. :paramtype id: str @@ -17606,9 +17927,9 @@ def __init__( :paramtype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus """ super(ScheduleBase, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.provisioning_status = kwargs.get('provisioning_status', None) - self.status = kwargs.get('status', None) + self.id = kwargs.get("id", None) + self.provisioning_status = kwargs.get("provisioning_status", None) + self.status = kwargs.get("status", None) class ScheduleProperties(ResourceBase): @@ -17639,26 +17960,23 @@ class ScheduleProperties(ResourceBase): """ _validation = { - 'action': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'trigger': {'required': True}, + "action": {"required": True}, + "provisioning_state": {"readonly": True}, + "trigger": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'action': {'key': 'action', 'type': 'ScheduleActionBase'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'trigger': {'key': 'trigger', 'type': 'TriggerBase'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "action": {"key": "action", "type": "ScheduleActionBase"}, + "display_name": {"key": "displayName", "type": "str"}, + "is_enabled": {"key": "isEnabled", "type": "bool"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "trigger": {"key": "trigger", "type": "TriggerBase"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -17676,11 +17994,11 @@ def __init__( :paramtype trigger: ~azure.mgmt.machinelearningservices.models.TriggerBase """ super(ScheduleProperties, self).__init__(**kwargs) - self.action = kwargs['action'] - self.display_name = kwargs.get('display_name', None) - self.is_enabled = kwargs.get('is_enabled', True) + self.action = kwargs["action"] + self.display_name = kwargs.get("display_name", None) + self.is_enabled = kwargs.get("is_enabled", True) self.provisioning_state = None - self.trigger = kwargs['trigger'] + self.trigger = kwargs["trigger"] class ScheduleResourceArmPaginatedResult(msrest.serialization.Model): @@ -17694,14 +18012,11 @@ class ScheduleResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Schedule]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[Schedule]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of Schedule objects. If null, there are no additional pages. @@ -17710,8 +18025,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.Schedule] """ super(ScheduleResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class ScriptReference(msrest.serialization.Model): @@ -17728,16 +18043,13 @@ class ScriptReference(msrest.serialization.Model): """ _attribute_map = { - 'script_source': {'key': 'scriptSource', 'type': 'str'}, - 'script_data': {'key': 'scriptData', 'type': 'str'}, - 'script_arguments': {'key': 'scriptArguments', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'str'}, + "script_source": {"key": "scriptSource", "type": "str"}, + "script_data": {"key": "scriptData", "type": "str"}, + "script_arguments": {"key": "scriptArguments", "type": "str"}, + "timeout": {"key": "timeout", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword script_source: The storage source of the script: workspace. :paramtype script_source: str @@ -17749,10 +18061,10 @@ def __init__( :paramtype timeout: str """ super(ScriptReference, self).__init__(**kwargs) - self.script_source = kwargs.get('script_source', None) - self.script_data = kwargs.get('script_data', None) - self.script_arguments = kwargs.get('script_arguments', None) - self.timeout = kwargs.get('timeout', None) + self.script_source = kwargs.get("script_source", None) + self.script_data = kwargs.get("script_data", None) + self.script_arguments = kwargs.get("script_arguments", None) + self.timeout = kwargs.get("timeout", None) class ScriptsToExecute(msrest.serialization.Model): @@ -17765,14 +18077,14 @@ class ScriptsToExecute(msrest.serialization.Model): """ _attribute_map = { - 'startup_script': {'key': 'startupScript', 'type': 'ScriptReference'}, - 'creation_script': {'key': 'creationScript', 'type': 'ScriptReference'}, + "startup_script": {"key": "startupScript", "type": "ScriptReference"}, + "creation_script": { + "key": "creationScript", + "type": "ScriptReference", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword startup_script: Script that's run every time the machine starts. :paramtype startup_script: ~azure.mgmt.machinelearningservices.models.ScriptReference @@ -17780,8 +18092,8 @@ def __init__( :paramtype creation_script: ~azure.mgmt.machinelearningservices.models.ScriptReference """ super(ScriptsToExecute, self).__init__(**kwargs) - self.startup_script = kwargs.get('startup_script', None) - self.creation_script = kwargs.get('creation_script', None) + self.startup_script = kwargs.get("startup_script", None) + self.creation_script = kwargs.get("creation_script", None) class ServiceManagedResourcesSettings(msrest.serialization.Model): @@ -17792,19 +18104,16 @@ class ServiceManagedResourcesSettings(msrest.serialization.Model): """ _attribute_map = { - 'cosmos_db': {'key': 'cosmosDb', 'type': 'CosmosDbSettings'}, + "cosmos_db": {"key": "cosmosDb", "type": "CosmosDbSettings"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword cosmos_db: The settings for the service managed cosmosdb account. :paramtype cosmos_db: ~azure.mgmt.machinelearningservices.models.CosmosDbSettings """ super(ServiceManagedResourcesSettings, self).__init__(**kwargs) - self.cosmos_db = kwargs.get('cosmos_db', None) + self.cosmos_db = kwargs.get("cosmos_db", None) class ServicePrincipalDatastoreCredentials(DatastoreCredentials): @@ -17829,25 +18138,25 @@ class ServicePrincipalDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, + "credentials_type": {"required": True}, + "client_id": {"required": True}, + "secrets": {"required": True}, + "tenant_id": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'ServicePrincipalDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "authority_url": {"key": "authorityUrl", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + "resource_url": {"key": "resourceUrl", "type": "str"}, + "secrets": { + "key": "secrets", + "type": "ServicePrincipalDatastoreSecrets", + }, + "tenant_id": {"key": "tenantId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword authority_url: Authority URL used for authentication. :paramtype authority_url: str @@ -17862,12 +18171,12 @@ def __init__( :paramtype tenant_id: str """ super(ServicePrincipalDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'ServicePrincipal' # type: str - self.authority_url = kwargs.get('authority_url', None) - self.client_id = kwargs['client_id'] - self.resource_url = kwargs.get('resource_url', None) - self.secrets = kwargs['secrets'] - self.tenant_id = kwargs['tenant_id'] + self.credentials_type = "ServicePrincipal" # type: str + self.authority_url = kwargs.get("authority_url", None) + self.client_id = kwargs["client_id"] + self.resource_url = kwargs.get("resource_url", None) + self.secrets = kwargs["secrets"] + self.tenant_id = kwargs["tenant_id"] class ServicePrincipalDatastoreSecrets(DatastoreSecrets): @@ -17884,25 +18193,22 @@ class ServicePrincipalDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "client_secret": {"key": "clientSecret", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword client_secret: Service principal secret. :paramtype client_secret: str """ super(ServicePrincipalDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'ServicePrincipal' # type: str - self.client_secret = kwargs.get('client_secret', None) + self.secrets_type = "ServicePrincipal" # type: str + self.client_secret = kwargs.get("client_secret", None) class SetupScripts(msrest.serialization.Model): @@ -17913,19 +18219,16 @@ class SetupScripts(msrest.serialization.Model): """ _attribute_map = { - 'scripts': {'key': 'scripts', 'type': 'ScriptsToExecute'}, + "scripts": {"key": "scripts", "type": "ScriptsToExecute"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword scripts: Customized setup scripts. :paramtype scripts: ~azure.mgmt.machinelearningservices.models.ScriptsToExecute """ super(SetupScripts, self).__init__(**kwargs) - self.scripts = kwargs.get('scripts', None) + self.scripts = kwargs.get("scripts", None) class SharedPrivateLinkResource(msrest.serialization.Model): @@ -17947,17 +18250,17 @@ class SharedPrivateLinkResource(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'private_link_resource_id': {'key': 'properties.privateLinkResourceId', 'type': 'str'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'request_message': {'key': 'properties.requestMessage', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "private_link_resource_id": { + "key": "properties.privateLinkResourceId", + "type": "str", + }, + "group_id": {"key": "properties.groupId", "type": "str"}, + "request_message": {"key": "properties.requestMessage", "type": "str"}, + "status": {"key": "properties.status", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: Unique name of the private link. :paramtype name: str @@ -17974,11 +18277,13 @@ def __init__( ~azure.mgmt.machinelearningservices.models.PrivateEndpointServiceConnectionStatus """ super(SharedPrivateLinkResource, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.private_link_resource_id = kwargs.get('private_link_resource_id', None) - self.group_id = kwargs.get('group_id', None) - self.request_message = kwargs.get('request_message', None) - self.status = kwargs.get('status', None) + self.name = kwargs.get("name", None) + self.private_link_resource_id = kwargs.get( + "private_link_resource_id", None + ) + self.group_id = kwargs.get("group_id", None) + self.request_message = kwargs.get("request_message", None) + self.status = kwargs.get("status", None) class Sku(msrest.serialization.Model): @@ -18004,21 +18309,18 @@ class Sku(msrest.serialization.Model): """ _validation = { - 'name': {'required': True}, + "name": {"required": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'int'}, + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, + "size": {"key": "size", "type": "str"}, + "family": {"key": "family", "type": "str"}, + "capacity": {"key": "capacity", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code. :paramtype name: str @@ -18037,11 +18339,11 @@ def __init__( :paramtype capacity: int """ super(Sku, self).__init__(**kwargs) - self.name = kwargs['name'] - self.tier = kwargs.get('tier', None) - self.size = kwargs.get('size', None) - self.family = kwargs.get('family', None) - self.capacity = kwargs.get('capacity', None) + self.name = kwargs["name"] + self.tier = kwargs.get("tier", None) + self.size = kwargs.get("size", None) + self.family = kwargs.get("family", None) + self.capacity = kwargs.get("capacity", None) class SkuCapacity(msrest.serialization.Model): @@ -18059,16 +18361,13 @@ class SkuCapacity(msrest.serialization.Model): """ _attribute_map = { - 'default': {'key': 'default', 'type': 'int'}, - 'maximum': {'key': 'maximum', 'type': 'int'}, - 'minimum': {'key': 'minimum', 'type': 'int'}, - 'scale_type': {'key': 'scaleType', 'type': 'str'}, + "default": {"key": "default", "type": "int"}, + "maximum": {"key": "maximum", "type": "int"}, + "minimum": {"key": "minimum", "type": "int"}, + "scale_type": {"key": "scaleType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword default: Gets or sets the default capacity. :paramtype default: int @@ -18081,10 +18380,10 @@ def __init__( :paramtype scale_type: str or ~azure.mgmt.machinelearningservices.models.SkuScaleType """ super(SkuCapacity, self).__init__(**kwargs) - self.default = kwargs.get('default', 0) - self.maximum = kwargs.get('maximum', 0) - self.minimum = kwargs.get('minimum', 0) - self.scale_type = kwargs.get('scale_type', None) + self.default = kwargs.get("default", 0) + self.maximum = kwargs.get("maximum", 0) + self.minimum = kwargs.get("minimum", 0) + self.scale_type = kwargs.get("scale_type", None) class SkuResource(msrest.serialization.Model): @@ -18101,19 +18400,16 @@ class SkuResource(msrest.serialization.Model): """ _validation = { - 'resource_type': {'readonly': True}, + "resource_type": {"readonly": True}, } _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'SkuSetting'}, + "capacity": {"key": "capacity", "type": "SkuCapacity"}, + "resource_type": {"key": "resourceType", "type": "str"}, + "sku": {"key": "sku", "type": "SkuSetting"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword capacity: Gets or sets the Sku Capacity. :paramtype capacity: ~azure.mgmt.machinelearningservices.models.SkuCapacity @@ -18121,9 +18417,9 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.SkuSetting """ super(SkuResource, self).__init__(**kwargs) - self.capacity = kwargs.get('capacity', None) + self.capacity = kwargs.get("capacity", None) self.resource_type = None - self.sku = kwargs.get('sku', None) + self.sku = kwargs.get("sku", None) class SkuResourceArmPaginatedResult(msrest.serialization.Model): @@ -18137,14 +18433,11 @@ class SkuResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[SkuResource]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[SkuResource]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of SkuResource objects. If null, there are no additional pages. @@ -18153,8 +18446,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.SkuResource] """ super(SkuResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class SkuSetting(msrest.serialization.Model): @@ -18172,18 +18465,19 @@ class SkuSetting(msrest.serialization.Model): """ _validation = { - 'name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "name": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: Required. [Required] The name of the SKU. Ex - P3. It is typically a letter+number code. @@ -18194,8 +18488,8 @@ def __init__( :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier """ super(SkuSetting, self).__init__(**kwargs) - self.name = kwargs['name'] - self.tier = kwargs.get('tier', None) + self.name = kwargs["name"] + self.tier = kwargs.get("tier", None) class SslConfiguration(msrest.serialization.Model): @@ -18217,18 +18511,18 @@ class SslConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'cert': {'key': 'cert', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - 'cname': {'key': 'cname', 'type': 'str'}, - 'leaf_domain_label': {'key': 'leafDomainLabel', 'type': 'str'}, - 'overwrite_existing_domain': {'key': 'overwriteExistingDomain', 'type': 'bool'}, + "status": {"key": "status", "type": "str"}, + "cert": {"key": "cert", "type": "str"}, + "key": {"key": "key", "type": "str"}, + "cname": {"key": "cname", "type": "str"}, + "leaf_domain_label": {"key": "leafDomainLabel", "type": "str"}, + "overwrite_existing_domain": { + "key": "overwriteExistingDomain", + "type": "bool", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword status: Enable or disable ssl for scoring. Possible values include: "Disabled", "Enabled", "Auto". @@ -18245,12 +18539,14 @@ def __init__( :paramtype overwrite_existing_domain: bool """ super(SslConfiguration, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.cert = kwargs.get('cert', None) - self.key = kwargs.get('key', None) - self.cname = kwargs.get('cname', None) - self.leaf_domain_label = kwargs.get('leaf_domain_label', None) - self.overwrite_existing_domain = kwargs.get('overwrite_existing_domain', None) + self.status = kwargs.get("status", None) + self.cert = kwargs.get("cert", None) + self.key = kwargs.get("key", None) + self.cname = kwargs.get("cname", None) + self.leaf_domain_label = kwargs.get("leaf_domain_label", None) + self.overwrite_existing_domain = kwargs.get( + "overwrite_existing_domain", None + ) class StackEnsembleSettings(msrest.serialization.Model): @@ -18272,15 +18568,21 @@ class StackEnsembleSettings(msrest.serialization.Model): """ _attribute_map = { - 'stack_meta_learner_k_wargs': {'key': 'stackMetaLearnerKWargs', 'type': 'object'}, - 'stack_meta_learner_train_percentage': {'key': 'stackMetaLearnerTrainPercentage', 'type': 'float'}, - 'stack_meta_learner_type': {'key': 'stackMetaLearnerType', 'type': 'str'}, + "stack_meta_learner_k_wargs": { + "key": "stackMetaLearnerKWargs", + "type": "object", + }, + "stack_meta_learner_train_percentage": { + "key": "stackMetaLearnerTrainPercentage", + "type": "float", + }, + "stack_meta_learner_type": { + "key": "stackMetaLearnerType", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword stack_meta_learner_k_wargs: Optional parameters to pass to the initializer of the meta-learner. @@ -18297,9 +18599,15 @@ def __init__( ~azure.mgmt.machinelearningservices.models.StackMetaLearnerType """ super(StackEnsembleSettings, self).__init__(**kwargs) - self.stack_meta_learner_k_wargs = kwargs.get('stack_meta_learner_k_wargs', None) - self.stack_meta_learner_train_percentage = kwargs.get('stack_meta_learner_train_percentage', 0.2) - self.stack_meta_learner_type = kwargs.get('stack_meta_learner_type', None) + self.stack_meta_learner_k_wargs = kwargs.get( + "stack_meta_learner_k_wargs", None + ) + self.stack_meta_learner_train_percentage = kwargs.get( + "stack_meta_learner_train_percentage", 0.2 + ) + self.stack_meta_learner_type = kwargs.get( + "stack_meta_learner_type", None + ) class StorageAccountDetails(msrest.serialization.Model): @@ -18316,14 +18624,17 @@ class StorageAccountDetails(msrest.serialization.Model): """ _attribute_map = { - 'system_created_storage_account': {'key': 'systemCreatedStorageAccount', 'type': 'SystemCreatedStorageAccount'}, - 'user_created_storage_account': {'key': 'userCreatedStorageAccount', 'type': 'UserCreatedStorageAccount'}, + "system_created_storage_account": { + "key": "systemCreatedStorageAccount", + "type": "SystemCreatedStorageAccount", + }, + "user_created_storage_account": { + "key": "userCreatedStorageAccount", + "type": "UserCreatedStorageAccount", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword system_created_storage_account: Details of system created storage account to be used for the registry. @@ -18335,8 +18646,12 @@ def __init__( ~azure.mgmt.machinelearningservices.models.UserCreatedStorageAccount """ super(StorageAccountDetails, self).__init__(**kwargs) - self.system_created_storage_account = kwargs.get('system_created_storage_account', None) - self.user_created_storage_account = kwargs.get('user_created_storage_account', None) + self.system_created_storage_account = kwargs.get( + "system_created_storage_account", None + ) + self.user_created_storage_account = kwargs.get( + "user_created_storage_account", None + ) class SweepJob(JobBaseProperties): @@ -18398,41 +18713,44 @@ class SweepJob(JobBaseProperties): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'objective': {'required': True}, - 'sampling_algorithm': {'required': True}, - 'search_space': {'required': True}, - 'trial': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'SweepJobLimits'}, - 'objective': {'key': 'objective', 'type': 'Objective'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'SamplingAlgorithm'}, - 'search_space': {'key': 'searchSpace', 'type': 'object'}, - 'trial': {'key': 'trial', 'type': 'TrialComponent'}, - } - - def __init__( - self, - **kwargs - ): + "job_type": {"required": True}, + "status": {"readonly": True}, + "objective": {"required": True}, + "sampling_algorithm": {"required": True}, + "search_space": {"required": True}, + "trial": {"required": True}, + } + + _attribute_map = { + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "limits": {"key": "limits", "type": "SweepJobLimits"}, + "objective": {"key": "objective", "type": "Objective"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "sampling_algorithm": { + "key": "samplingAlgorithm", + "type": "SamplingAlgorithm", + }, + "search_space": {"key": "searchSpace", "type": "object"}, + "trial": {"key": "trial", "type": "TrialComponent"}, + } + + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -18478,15 +18796,15 @@ def __init__( :paramtype trial: ~azure.mgmt.machinelearningservices.models.TrialComponent """ super(SweepJob, self).__init__(**kwargs) - self.job_type = 'Sweep' # type: str - self.early_termination = kwargs.get('early_termination', None) - self.inputs = kwargs.get('inputs', None) - self.limits = kwargs.get('limits', None) - self.objective = kwargs['objective'] - self.outputs = kwargs.get('outputs', None) - self.sampling_algorithm = kwargs['sampling_algorithm'] - self.search_space = kwargs['search_space'] - self.trial = kwargs['trial'] + self.job_type = "Sweep" # type: str + self.early_termination = kwargs.get("early_termination", None) + self.inputs = kwargs.get("inputs", None) + self.limits = kwargs.get("limits", None) + self.objective = kwargs["objective"] + self.outputs = kwargs.get("outputs", None) + self.sampling_algorithm = kwargs["sampling_algorithm"] + self.search_space = kwargs["search_space"] + self.trial = kwargs["trial"] class SweepJobLimits(JobLimits): @@ -18509,21 +18827,18 @@ class SweepJobLimits(JobLimits): """ _validation = { - 'job_limits_type': {'required': True}, + "job_limits_type": {"required": True}, } _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_total_trials': {'key': 'maxTotalTrials', 'type': 'int'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, + "job_limits_type": {"key": "jobLimitsType", "type": "str"}, + "timeout": {"key": "timeout", "type": "duration"}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_total_trials": {"key": "maxTotalTrials", "type": "int"}, + "trial_timeout": {"key": "trialTimeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. Only supports duration with precision as low as Seconds. @@ -18536,10 +18851,10 @@ def __init__( :paramtype trial_timeout: ~datetime.timedelta """ super(SweepJobLimits, self).__init__(**kwargs) - self.job_limits_type = 'Sweep' # type: str - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', None) - self.max_total_trials = kwargs.get('max_total_trials', None) - self.trial_timeout = kwargs.get('trial_timeout', None) + self.job_limits_type = "Sweep" # type: str + self.max_concurrent_trials = kwargs.get("max_concurrent_trials", None) + self.max_total_trials = kwargs.get("max_total_trials", None) + self.trial_timeout = kwargs.get("trial_timeout", None) class SynapseSpark(Compute): @@ -18581,32 +18896,32 @@ class SynapseSpark(Compute): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'SynapseSparkProperties'}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, + "properties": {"key": "properties", "type": "SynapseSparkProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword compute_location: Location for the underlying compute. :paramtype compute_location: str @@ -18621,8 +18936,8 @@ def __init__( :paramtype properties: ~azure.mgmt.machinelearningservices.models.SynapseSparkProperties """ super(SynapseSpark, self).__init__(**kwargs) - self.compute_type = 'SynapseSpark' # type: str - self.properties = kwargs.get('properties', None) + self.compute_type = "SynapseSpark" # type: str + self.properties = kwargs.get("properties", None) class SynapseSparkProperties(msrest.serialization.Model): @@ -18651,22 +18966,25 @@ class SynapseSparkProperties(msrest.serialization.Model): """ _attribute_map = { - 'auto_scale_properties': {'key': 'autoScaleProperties', 'type': 'AutoScaleProperties'}, - 'auto_pause_properties': {'key': 'autoPauseProperties', 'type': 'AutoPauseProperties'}, - 'spark_version': {'key': 'sparkVersion', 'type': 'str'}, - 'node_count': {'key': 'nodeCount', 'type': 'int'}, - 'node_size': {'key': 'nodeSize', 'type': 'str'}, - 'node_size_family': {'key': 'nodeSizeFamily', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'workspace_name': {'key': 'workspaceName', 'type': 'str'}, - 'pool_name': {'key': 'poolName', 'type': 'str'}, + "auto_scale_properties": { + "key": "autoScaleProperties", + "type": "AutoScaleProperties", + }, + "auto_pause_properties": { + "key": "autoPauseProperties", + "type": "AutoPauseProperties", + }, + "spark_version": {"key": "sparkVersion", "type": "str"}, + "node_count": {"key": "nodeCount", "type": "int"}, + "node_size": {"key": "nodeSize", "type": "str"}, + "node_size_family": {"key": "nodeSizeFamily", "type": "str"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, + "resource_group": {"key": "resourceGroup", "type": "str"}, + "workspace_name": {"key": "workspaceName", "type": "str"}, + "pool_name": {"key": "poolName", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword auto_scale_properties: Auto scale properties. :paramtype auto_scale_properties: @@ -18692,16 +19010,16 @@ def __init__( :paramtype pool_name: str """ super(SynapseSparkProperties, self).__init__(**kwargs) - self.auto_scale_properties = kwargs.get('auto_scale_properties', None) - self.auto_pause_properties = kwargs.get('auto_pause_properties', None) - self.spark_version = kwargs.get('spark_version', None) - self.node_count = kwargs.get('node_count', None) - self.node_size = kwargs.get('node_size', None) - self.node_size_family = kwargs.get('node_size_family', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.resource_group = kwargs.get('resource_group', None) - self.workspace_name = kwargs.get('workspace_name', None) - self.pool_name = kwargs.get('pool_name', None) + self.auto_scale_properties = kwargs.get("auto_scale_properties", None) + self.auto_pause_properties = kwargs.get("auto_pause_properties", None) + self.spark_version = kwargs.get("spark_version", None) + self.node_count = kwargs.get("node_count", None) + self.node_size = kwargs.get("node_size", None) + self.node_size_family = kwargs.get("node_size_family", None) + self.subscription_id = kwargs.get("subscription_id", None) + self.resource_group = kwargs.get("resource_group", None) + self.workspace_name = kwargs.get("workspace_name", None) + self.pool_name = kwargs.get("pool_name", None) class SystemCreatedAcrAccount(msrest.serialization.Model): @@ -18716,15 +19034,12 @@ class SystemCreatedAcrAccount(msrest.serialization.Model): """ _attribute_map = { - 'acr_account_name': {'key': 'acrAccountName', 'type': 'str'}, - 'acr_account_sku': {'key': 'acrAccountSku', 'type': 'str'}, - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, + "acr_account_name": {"key": "acrAccountName", "type": "str"}, + "acr_account_sku": {"key": "acrAccountSku", "type": "str"}, + "arm_resource_id": {"key": "armResourceId", "type": "ArmResourceId"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword acr_account_name: Name of the ACR account. :paramtype acr_account_name: str @@ -18734,9 +19049,9 @@ def __init__( :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId """ super(SystemCreatedAcrAccount, self).__init__(**kwargs) - self.acr_account_name = kwargs.get('acr_account_name', None) - self.acr_account_sku = kwargs.get('acr_account_sku', None) - self.arm_resource_id = kwargs.get('arm_resource_id', None) + self.acr_account_name = kwargs.get("acr_account_name", None) + self.acr_account_sku = kwargs.get("acr_account_sku", None) + self.arm_resource_id = kwargs.get("arm_resource_id", None) class SystemCreatedStorageAccount(msrest.serialization.Model): @@ -18763,17 +19078,20 @@ class SystemCreatedStorageAccount(msrest.serialization.Model): """ _attribute_map = { - 'allow_blob_public_access': {'key': 'allowBlobPublicAccess', 'type': 'bool'}, - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - 'storage_account_hns_enabled': {'key': 'storageAccountHnsEnabled', 'type': 'bool'}, - 'storage_account_name': {'key': 'storageAccountName', 'type': 'str'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + "allow_blob_public_access": { + "key": "allowBlobPublicAccess", + "type": "bool", + }, + "arm_resource_id": {"key": "armResourceId", "type": "ArmResourceId"}, + "storage_account_hns_enabled": { + "key": "storageAccountHnsEnabled", + "type": "bool", + }, + "storage_account_name": {"key": "storageAccountName", "type": "str"}, + "storage_account_type": {"key": "storageAccountType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword allow_blob_public_access: Public blob access allowed. :paramtype allow_blob_public_access: bool @@ -18795,11 +19113,15 @@ def __init__( :paramtype storage_account_type: str """ super(SystemCreatedStorageAccount, self).__init__(**kwargs) - self.allow_blob_public_access = kwargs.get('allow_blob_public_access', None) - self.arm_resource_id = kwargs.get('arm_resource_id', None) - self.storage_account_hns_enabled = kwargs.get('storage_account_hns_enabled', None) - self.storage_account_name = kwargs.get('storage_account_name', None) - self.storage_account_type = kwargs.get('storage_account_type', None) + self.allow_blob_public_access = kwargs.get( + "allow_blob_public_access", None + ) + self.arm_resource_id = kwargs.get("arm_resource_id", None) + self.storage_account_hns_enabled = kwargs.get( + "storage_account_hns_enabled", None + ) + self.storage_account_name = kwargs.get("storage_account_name", None) + self.storage_account_type = kwargs.get("storage_account_type", None) class SystemData(msrest.serialization.Model): @@ -18822,18 +19144,15 @@ class SystemData(msrest.serialization.Model): """ _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + "created_by": {"key": "createdBy", "type": "str"}, + "created_by_type": {"key": "createdByType", "type": "str"}, + "created_at": {"key": "createdAt", "type": "iso-8601"}, + "last_modified_by": {"key": "lastModifiedBy", "type": "str"}, + "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"}, + "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword created_by: The identity that created the resource. :paramtype created_by: str @@ -18852,12 +19171,12 @@ def __init__( :paramtype last_modified_at: ~datetime.datetime """ super(SystemData, self).__init__(**kwargs) - self.created_by = kwargs.get('created_by', None) - self.created_by_type = kwargs.get('created_by_type', None) - self.created_at = kwargs.get('created_at', None) - self.last_modified_by = kwargs.get('last_modified_by', None) - self.last_modified_by_type = kwargs.get('last_modified_by_type', None) - self.last_modified_at = kwargs.get('last_modified_at', None) + self.created_by = kwargs.get("created_by", None) + self.created_by_type = kwargs.get("created_by_type", None) + self.created_at = kwargs.get("created_at", None) + self.last_modified_by = kwargs.get("last_modified_by", None) + self.last_modified_by_type = kwargs.get("last_modified_by_type", None) + self.last_modified_at = kwargs.get("last_modified_at", None) class SystemService(msrest.serialization.Model): @@ -18874,23 +19193,19 @@ class SystemService(msrest.serialization.Model): """ _validation = { - 'system_service_type': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'version': {'readonly': True}, + "system_service_type": {"readonly": True}, + "public_ip_address": {"readonly": True}, + "version": {"readonly": True}, } _attribute_map = { - 'system_service_type': {'key': 'systemServiceType', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, + "system_service_type": {"key": "systemServiceType", "type": "str"}, + "public_ip_address": {"key": "publicIpAddress", "type": "str"}, + "version": {"key": "version", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(SystemService, self).__init__(**kwargs) self.system_service_type = None self.public_ip_address = None @@ -18924,18 +19239,27 @@ class TableVerticalFeaturizationSettings(FeaturizationSettings): """ _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - 'blocked_transformers': {'key': 'blockedTransformers', 'type': '[str]'}, - 'column_name_and_types': {'key': 'columnNameAndTypes', 'type': '{str}'}, - 'enable_dnn_featurization': {'key': 'enableDnnFeaturization', 'type': 'bool'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'transformer_params': {'key': 'transformerParams', 'type': '{[ColumnTransformer]}'}, + "dataset_language": {"key": "datasetLanguage", "type": "str"}, + "blocked_transformers": { + "key": "blockedTransformers", + "type": "[str]", + }, + "column_name_and_types": { + "key": "columnNameAndTypes", + "type": "{str}", + }, + "enable_dnn_featurization": { + "key": "enableDnnFeaturization", + "type": "bool", + }, + "mode": {"key": "mode", "type": "str"}, + "transformer_params": { + "key": "transformerParams", + "type": "{[ColumnTransformer]}", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword dataset_language: Dataset language, useful for the text data. :paramtype dataset_language: str @@ -18960,11 +19284,13 @@ def __init__( list[~azure.mgmt.machinelearningservices.models.ColumnTransformer]] """ super(TableVerticalFeaturizationSettings, self).__init__(**kwargs) - self.blocked_transformers = kwargs.get('blocked_transformers', None) - self.column_name_and_types = kwargs.get('column_name_and_types', None) - self.enable_dnn_featurization = kwargs.get('enable_dnn_featurization', False) - self.mode = kwargs.get('mode', None) - self.transformer_params = kwargs.get('transformer_params', None) + self.blocked_transformers = kwargs.get("blocked_transformers", None) + self.column_name_and_types = kwargs.get("column_name_and_types", None) + self.enable_dnn_featurization = kwargs.get( + "enable_dnn_featurization", False + ) + self.mode = kwargs.get("mode", None) + self.transformer_params = kwargs.get("transformer_params", None) class TableVerticalLimitSettings(msrest.serialization.Model): @@ -18988,19 +19314,19 @@ class TableVerticalLimitSettings(msrest.serialization.Model): """ _attribute_map = { - 'enable_early_termination': {'key': 'enableEarlyTermination', 'type': 'bool'}, - 'exit_score': {'key': 'exitScore', 'type': 'float'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_cores_per_trial': {'key': 'maxCoresPerTrial', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, + "enable_early_termination": { + "key": "enableEarlyTermination", + "type": "bool", + }, + "exit_score": {"key": "exitScore", "type": "float"}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_cores_per_trial": {"key": "maxCoresPerTrial", "type": "int"}, + "max_trials": {"key": "maxTrials", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, + "trial_timeout": {"key": "trialTimeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword enable_early_termination: Enable early termination, determines whether or not if AutoMLJob will terminate early if there is no score improvement in last 20 iterations. @@ -19019,13 +19345,15 @@ def __init__( :paramtype trial_timeout: ~datetime.timedelta """ super(TableVerticalLimitSettings, self).__init__(**kwargs) - self.enable_early_termination = kwargs.get('enable_early_termination', True) - self.exit_score = kwargs.get('exit_score', None) - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', 1) - self.max_cores_per_trial = kwargs.get('max_cores_per_trial', -1) - self.max_trials = kwargs.get('max_trials', 1000) - self.timeout = kwargs.get('timeout', "PT6H") - self.trial_timeout = kwargs.get('trial_timeout', "PT30M") + self.enable_early_termination = kwargs.get( + "enable_early_termination", True + ) + self.exit_score = kwargs.get("exit_score", None) + self.max_concurrent_trials = kwargs.get("max_concurrent_trials", 1) + self.max_cores_per_trial = kwargs.get("max_cores_per_trial", -1) + self.max_trials = kwargs.get("max_trials", 1000) + self.timeout = kwargs.get("timeout", "PT6H") + self.trial_timeout = kwargs.get("trial_timeout", "PT30M") class TargetUtilizationScaleSettings(OnlineScaleSettings): @@ -19049,21 +19377,21 @@ class TargetUtilizationScaleSettings(OnlineScaleSettings): """ _validation = { - 'scale_type': {'required': True}, + "scale_type": {"required": True}, } _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - 'max_instances': {'key': 'maxInstances', 'type': 'int'}, - 'min_instances': {'key': 'minInstances', 'type': 'int'}, - 'polling_interval': {'key': 'pollingInterval', 'type': 'duration'}, - 'target_utilization_percentage': {'key': 'targetUtilizationPercentage', 'type': 'int'}, + "scale_type": {"key": "scaleType", "type": "str"}, + "max_instances": {"key": "maxInstances", "type": "int"}, + "min_instances": {"key": "minInstances", "type": "int"}, + "polling_interval": {"key": "pollingInterval", "type": "duration"}, + "target_utilization_percentage": { + "key": "targetUtilizationPercentage", + "type": "int", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword max_instances: The maximum number of instances that the deployment can scale to. The quota will be reserved for max_instances. @@ -19077,11 +19405,13 @@ def __init__( :paramtype target_utilization_percentage: int """ super(TargetUtilizationScaleSettings, self).__init__(**kwargs) - self.scale_type = 'TargetUtilization' # type: str - self.max_instances = kwargs.get('max_instances', 1) - self.min_instances = kwargs.get('min_instances', 1) - self.polling_interval = kwargs.get('polling_interval', "PT1S") - self.target_utilization_percentage = kwargs.get('target_utilization_percentage', 70) + self.scale_type = "TargetUtilization" # type: str + self.max_instances = kwargs.get("max_instances", 1) + self.min_instances = kwargs.get("min_instances", 1) + self.polling_interval = kwargs.get("polling_interval", "PT1S") + self.target_utilization_percentage = kwargs.get( + "target_utilization_percentage", 70 + ) class TensorFlow(DistributionConfiguration): @@ -19099,19 +19429,19 @@ class TensorFlow(DistributionConfiguration): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'parameter_server_count': {'key': 'parameterServerCount', 'type': 'int'}, - 'worker_count': {'key': 'workerCount', 'type': 'int'}, + "distribution_type": {"key": "distributionType", "type": "str"}, + "parameter_server_count": { + "key": "parameterServerCount", + "type": "int", + }, + "worker_count": {"key": "workerCount", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword parameter_server_count: Number of parameter server tasks. :paramtype parameter_server_count: int @@ -19119,64 +19449,70 @@ def __init__( :paramtype worker_count: int """ super(TensorFlow, self).__init__(**kwargs) - self.distribution_type = 'TensorFlow' # type: str - self.parameter_server_count = kwargs.get('parameter_server_count', 0) - self.worker_count = kwargs.get('worker_count', None) + self.distribution_type = "TensorFlow" # type: str + self.parameter_server_count = kwargs.get("parameter_server_count", 0) + self.worker_count = kwargs.get("worker_count", None) class TextClassification(AutoMLVertical, NlpVertical): """Text Classification task in AutoML NLP vertical. -NLP - Natural Language Processing. + NLP - Natural Language Processing. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-Classification task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric for Text-Classification task. Possible values include: + "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, + "task_type": {"required": True}, + "training_data": {"required": True}, } _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword featurization_settings: Featurization inputs needed for AutoML job. :paramtype featurization_settings: @@ -19200,73 +19536,81 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ super(TextClassification, self).__init__(**kwargs) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.task_type = 'TextClassification' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.limit_settings = kwargs.get("limit_settings", None) + self.validation_data = kwargs.get("validation_data", None) + self.task_type = "TextClassification" # type: str + self.primary_metric = kwargs.get("primary_metric", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class TextClassificationMultilabel(AutoMLVertical, NlpVertical): """Text Classification Multilabel task in AutoML NLP vertical. -NLP - Natural Language Processing. + NLP - Natural Language Processing. - Variables are only populated by the server, and will be ignored when sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-Classification-Multilabel task. - Currently only Accuracy is supported as primary metric, hence user need not set it explicitly. - Possible values include: "AUCWeighted", "Accuracy", "NormMacroRecall", - "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric for Text-Classification-Multilabel task. + Currently only Accuracy is supported as primary metric, hence user need not set it explicitly. + Possible values include: "AUCWeighted", "Accuracy", "NormMacroRecall", + "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted", "IOU". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - 'primary_metric': {'readonly': True}, + "task_type": {"required": True}, + "training_data": {"required": True}, + "primary_metric": {"readonly": True}, } _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword featurization_settings: Featurization inputs needed for AutoML job. :paramtype featurization_settings: @@ -19285,74 +19629,82 @@ def __init__( :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ super(TextClassificationMultilabel, self).__init__(**kwargs) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.task_type = 'TextClassificationMultilabel' # type: str + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.limit_settings = kwargs.get("limit_settings", None) + self.validation_data = kwargs.get("validation_data", None) + self.task_type = "TextClassificationMultilabel" # type: str self.primary_metric = None - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class TextNer(AutoMLVertical, NlpVertical): """Text-NER task in AutoML NLP vertical. -NER - Named Entity Recognition. -NLP - Natural Language Processing. + NER - Named Entity Recognition. + NLP - Natural Language Processing. - Variables are only populated by the server, and will be ignored when sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-NER task. - Only 'Accuracy' is supported for Text-NER, so user need not set this explicitly. Possible - values include: "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric for Text-NER task. + Only 'Accuracy' is supported for Text-NER, so user need not set this explicitly. Possible + values include: "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - 'primary_metric': {'readonly': True}, + "task_type": {"required": True}, + "training_data": {"required": True}, + "primary_metric": {"readonly": True}, } _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword featurization_settings: Featurization inputs needed for AutoML job. :paramtype featurization_settings: @@ -19371,14 +19723,16 @@ def __init__( :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ super(TextNer, self).__init__(**kwargs) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.task_type = 'TextNER' # type: str + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.limit_settings = kwargs.get("limit_settings", None) + self.validation_data = kwargs.get("validation_data", None) + self.task_type = "TextNER" # type: str self.primary_metric = None - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class TmpfsOptions(msrest.serialization.Model): @@ -19389,19 +19743,16 @@ class TmpfsOptions(msrest.serialization.Model): """ _attribute_map = { - 'size': {'key': 'size', 'type': 'int'}, + "size": {"key": "size", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword size: Mention the Tmpfs size. :paramtype size: int """ super(TmpfsOptions, self).__init__(**kwargs) - self.size = kwargs.get('size', None) + self.size = kwargs.get("size", None) class TrialComponent(msrest.serialization.Model): @@ -19427,23 +19778,34 @@ class TrialComponent(msrest.serialization.Model): """ _validation = { - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - } - - def __init__( - self, - **kwargs - ): + "command": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "environment_id": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + } + + _attribute_map = { + "code_id": {"key": "codeId", "type": "str"}, + "command": {"key": "command", "type": "str"}, + "distribution": { + "key": "distribution", + "type": "DistributionConfiguration", + }, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "resources": {"key": "resources", "type": "JobResourceConfiguration"}, + } + + def __init__(self, **kwargs): """ :keyword code_id: ARM resource ID of the code asset. :paramtype code_id: str @@ -19462,12 +19824,12 @@ def __init__( :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration """ super(TrialComponent, self).__init__(**kwargs) - self.code_id = kwargs.get('code_id', None) - self.command = kwargs['command'] - self.distribution = kwargs.get('distribution', None) - self.environment_id = kwargs['environment_id'] - self.environment_variables = kwargs.get('environment_variables', None) - self.resources = kwargs.get('resources', None) + self.code_id = kwargs.get("code_id", None) + self.command = kwargs["command"] + self.distribution = kwargs.get("distribution", None) + self.environment_id = kwargs["environment_id"] + self.environment_variables = kwargs.get("environment_variables", None) + self.resources = kwargs.get("resources", None) class TritonModelJobInput(JobInput, AssetJobInput): @@ -19489,21 +19851,18 @@ class TritonModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "min_length": 1, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -19514,10 +19873,10 @@ def __init__( :paramtype description: str """ super(TritonModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'triton_model' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "triton_model" # type: str + self.description = kwargs.get("description", None) class TritonModelJobOutput(JobOutput, AssetJobOutput): @@ -19538,20 +19897,17 @@ class TritonModelJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -19561,10 +19917,10 @@ def __init__( :paramtype description: str """ super(TritonModelJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'triton_model' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "triton_model" # type: str + self.description = kwargs.get("description", None) class TruncationSelectionPolicy(EarlyTerminationPolicy): @@ -19585,20 +19941,20 @@ class TruncationSelectionPolicy(EarlyTerminationPolicy): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'truncation_percentage': {'key': 'truncationPercentage', 'type': 'int'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, + "truncation_percentage": { + "key": "truncationPercentage", + "type": "int", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. :paramtype delay_evaluation: int @@ -19608,8 +19964,8 @@ def __init__( :paramtype truncation_percentage: int """ super(TruncationSelectionPolicy, self).__init__(**kwargs) - self.policy_type = 'TruncationSelection' # type: str - self.truncation_percentage = kwargs.get('truncation_percentage', 0) + self.policy_type = "TruncationSelection" # type: str + self.truncation_percentage = kwargs.get("truncation_percentage", 0) class UpdateWorkspaceQuotas(msrest.serialization.Model): @@ -19633,23 +19989,20 @@ class UpdateWorkspaceQuotas(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, + "id": {"readonly": True}, + "type": {"readonly": True}, + "unit": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "limit": {"key": "limit", "type": "long"}, + "unit": {"key": "unit", "type": "str"}, + "status": {"key": "status", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword limit: The maximum permitted quota of the resource. :paramtype limit: long @@ -19662,9 +20015,9 @@ def __init__( super(UpdateWorkspaceQuotas, self).__init__(**kwargs) self.id = None self.type = None - self.limit = kwargs.get('limit', None) + self.limit = kwargs.get("limit", None) self.unit = None - self.status = kwargs.get('status', None) + self.status = kwargs.get("status", None) class UpdateWorkspaceQuotasResult(msrest.serialization.Model): @@ -19680,21 +20033,17 @@ class UpdateWorkspaceQuotasResult(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[UpdateWorkspaceQuotas]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[UpdateWorkspaceQuotas]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UpdateWorkspaceQuotasResult, self).__init__(**kwargs) self.value = None self.next_link = None @@ -19724,24 +20073,25 @@ class UriFileDataVersion(DataVersionBaseProperties): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -19758,7 +20108,7 @@ def __init__( :paramtype data_uri: str """ super(UriFileDataVersion, self).__init__(**kwargs) - self.data_type = 'uri_file' # type: str + self.data_type = "uri_file" # type: str class UriFileJobInput(JobInput, AssetJobInput): @@ -19780,21 +20130,18 @@ class UriFileJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "min_length": 1, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -19805,10 +20152,10 @@ def __init__( :paramtype description: str """ super(UriFileJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'uri_file' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "uri_file" # type: str + self.description = kwargs.get("description", None) class UriFileJobOutput(JobOutput, AssetJobOutput): @@ -19829,20 +20176,17 @@ class UriFileJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -19852,10 +20196,10 @@ def __init__( :paramtype description: str """ super(UriFileJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'uri_file' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "uri_file" # type: str + self.description = kwargs.get("description", None) class UriFolderDataVersion(DataVersionBaseProperties): @@ -19882,24 +20226,25 @@ class UriFolderDataVersion(DataVersionBaseProperties): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -19916,7 +20261,7 @@ def __init__( :paramtype data_uri: str """ super(UriFolderDataVersion, self).__init__(**kwargs) - self.data_type = 'uri_folder' # type: str + self.data_type = "uri_folder" # type: str class UriFolderJobInput(JobInput, AssetJobInput): @@ -19938,21 +20283,18 @@ class UriFolderJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "min_length": 1, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -19963,10 +20305,10 @@ def __init__( :paramtype description: str """ super(UriFolderJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'uri_folder' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "uri_folder" # type: str + self.description = kwargs.get("description", None) class UriFolderJobOutput(JobOutput, AssetJobOutput): @@ -19987,20 +20329,17 @@ class UriFolderJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -20010,10 +20349,10 @@ def __init__( :paramtype description: str """ super(UriFolderJobOutput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'uri_folder' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "uri_folder" # type: str + self.description = kwargs.get("description", None) class Usage(msrest.serialization.Model): @@ -20038,31 +20377,30 @@ class Usage(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'current_value': {'key': 'currentValue', 'type': 'long'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'name': {'key': 'name', 'type': 'UsageName'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ + "id": {"readonly": True}, + "aml_workspace_location": {"readonly": True}, + "type": {"readonly": True}, + "unit": {"readonly": True}, + "current_value": {"readonly": True}, + "limit": {"readonly": True}, + "name": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "aml_workspace_location": { + "key": "amlWorkspaceLocation", + "type": "str", + }, + "type": {"key": "type", "type": "str"}, + "unit": {"key": "unit", "type": "str"}, + "current_value": {"key": "currentValue", "type": "long"}, + "limit": {"key": "limit", "type": "long"}, + "name": {"key": "name", "type": "UsageName"}, + } + + def __init__(self, **kwargs): + """ """ super(Usage, self).__init__(**kwargs) self.id = None self.aml_workspace_location = None @@ -20085,21 +20423,17 @@ class UsageName(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, + "value": {"readonly": True}, + "localized_value": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + "value": {"key": "value", "type": "str"}, + "localized_value": {"key": "localizedValue", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UsageName, self).__init__(**kwargs) self.value = None self.localized_value = None @@ -20120,19 +20454,19 @@ class UserAccountCredentials(msrest.serialization.Model): """ _validation = { - 'admin_user_name': {'required': True}, + "admin_user_name": {"required": True}, } _attribute_map = { - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'admin_user_ssh_public_key': {'key': 'adminUserSshPublicKey', 'type': 'str'}, - 'admin_user_password': {'key': 'adminUserPassword', 'type': 'str'}, + "admin_user_name": {"key": "adminUserName", "type": "str"}, + "admin_user_ssh_public_key": { + "key": "adminUserSshPublicKey", + "type": "str", + }, + "admin_user_password": {"key": "adminUserPassword", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword admin_user_name: Required. Name of the administrator user account which can be used to SSH to nodes. @@ -20143,9 +20477,11 @@ def __init__( :paramtype admin_user_password: str """ super(UserAccountCredentials, self).__init__(**kwargs) - self.admin_user_name = kwargs['admin_user_name'] - self.admin_user_ssh_public_key = kwargs.get('admin_user_ssh_public_key', None) - self.admin_user_password = kwargs.get('admin_user_password', None) + self.admin_user_name = kwargs["admin_user_name"] + self.admin_user_ssh_public_key = kwargs.get( + "admin_user_ssh_public_key", None + ) + self.admin_user_password = kwargs.get("admin_user_password", None) class UserAssignedIdentity(msrest.serialization.Model): @@ -20160,21 +20496,17 @@ class UserAssignedIdentity(msrest.serialization.Model): """ _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, + "principal_id": {"readonly": True}, + "client_id": {"readonly": True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, + "principal_id": {"key": "principalId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UserAssignedIdentity, self).__init__(**kwargs) self.principal_id = None self.client_id = None @@ -20188,19 +20520,16 @@ class UserCreatedAcrAccount(msrest.serialization.Model): """ _attribute_map = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, + "arm_resource_id": {"key": "armResourceId", "type": "ArmResourceId"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword arm_resource_id: ARM ResourceId of a resource. :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId """ super(UserCreatedAcrAccount, self).__init__(**kwargs) - self.arm_resource_id = kwargs.get('arm_resource_id', None) + self.arm_resource_id = kwargs.get("arm_resource_id", None) class UserCreatedStorageAccount(msrest.serialization.Model): @@ -20211,19 +20540,16 @@ class UserCreatedStorageAccount(msrest.serialization.Model): """ _attribute_map = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, + "arm_resource_id": {"key": "armResourceId", "type": "ArmResourceId"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword arm_resource_id: ARM ResourceId of a resource. :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId """ super(UserCreatedStorageAccount, self).__init__(**kwargs) - self.arm_resource_id = kwargs.get('arm_resource_id', None) + self.arm_resource_id = kwargs.get("arm_resource_id", None) class UserIdentity(IdentityConfiguration): @@ -20238,24 +20564,22 @@ class UserIdentity(IdentityConfiguration): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UserIdentity, self).__init__(**kwargs) - self.identity_type = 'UserIdentity' # type: str + self.identity_type = "UserIdentity" # type: str -class UsernamePasswordAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class UsernamePasswordAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """UsernamePasswordAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -20278,22 +20602,22 @@ class UsernamePasswordAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionP """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionUsernamePassword'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionUsernamePassword", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: Category of the connection. Possible values include: "PythonFeed", "ContainerRegistry", "Git". @@ -20309,9 +20633,11 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword """ - super(UsernamePasswordAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'UsernamePassword' # type: str - self.credentials = kwargs.get('credentials', None) + super( + UsernamePasswordAuthTypeWorkspaceConnectionProperties, self + ).__init__(**kwargs) + self.auth_type = "UsernamePassword" # type: str + self.credentials = kwargs.get("credentials", None) class VirtualMachineSchema(msrest.serialization.Model): @@ -20322,20 +20648,20 @@ class VirtualMachineSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, + "properties": { + "key": "properties", + "type": "VirtualMachineSchemaProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: :paramtype properties: ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties """ super(VirtualMachineSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class VirtualMachine(Compute, VirtualMachineSchema): @@ -20377,32 +20703,35 @@ class VirtualMachine(Compute, VirtualMachineSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + } + + _attribute_map = { + "properties": { + "key": "properties", + "type": "VirtualMachineSchemaProperties", + }, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, + } + + def __init__(self, **kwargs): """ :keyword properties: :paramtype properties: @@ -20418,17 +20747,17 @@ def __init__( :paramtype disable_local_auth: bool """ super(VirtualMachine, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'VirtualMachine' # type: str - self.compute_location = kwargs.get('compute_location', None) + self.properties = kwargs.get("properties", None) + self.compute_type = "VirtualMachine" # type: str + self.compute_location = kwargs.get("compute_location", None) self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) + self.disable_local_auth = kwargs.get("disable_local_auth", None) class VirtualMachineImage(msrest.serialization.Model): @@ -20441,23 +20770,20 @@ class VirtualMachineImage(msrest.serialization.Model): """ _validation = { - 'id': {'required': True}, + "id": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword id: Required. Virtual Machine image path. :paramtype id: str """ super(VirtualMachineImage, self).__init__(**kwargs) - self.id = kwargs['id'] + self.id = kwargs["id"] class VirtualMachineSchemaProperties(msrest.serialization.Model): @@ -20480,18 +20806,21 @@ class VirtualMachineSchemaProperties(msrest.serialization.Model): """ _attribute_map = { - 'virtual_machine_size': {'key': 'virtualMachineSize', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'notebook_server_port': {'key': 'notebookServerPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'is_notebook_instance_compute': {'key': 'isNotebookInstanceCompute', 'type': 'bool'}, + "virtual_machine_size": {"key": "virtualMachineSize", "type": "str"}, + "ssh_port": {"key": "sshPort", "type": "int"}, + "notebook_server_port": {"key": "notebookServerPort", "type": "int"}, + "address": {"key": "address", "type": "str"}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, + "is_notebook_instance_compute": { + "key": "isNotebookInstanceCompute", + "type": "bool", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword virtual_machine_size: Virtual Machine size. :paramtype virtual_machine_size: str @@ -20509,12 +20838,14 @@ def __init__( :paramtype is_notebook_instance_compute: bool """ super(VirtualMachineSchemaProperties, self).__init__(**kwargs) - self.virtual_machine_size = kwargs.get('virtual_machine_size', None) - self.ssh_port = kwargs.get('ssh_port', None) - self.notebook_server_port = kwargs.get('notebook_server_port', None) - self.address = kwargs.get('address', None) - self.administrator_account = kwargs.get('administrator_account', None) - self.is_notebook_instance_compute = kwargs.get('is_notebook_instance_compute', None) + self.virtual_machine_size = kwargs.get("virtual_machine_size", None) + self.ssh_port = kwargs.get("ssh_port", None) + self.notebook_server_port = kwargs.get("notebook_server_port", None) + self.address = kwargs.get("address", None) + self.administrator_account = kwargs.get("administrator_account", None) + self.is_notebook_instance_compute = kwargs.get( + "is_notebook_instance_compute", None + ) class VirtualMachineSecretsSchema(msrest.serialization.Model): @@ -20526,20 +20857,20 @@ class VirtualMachineSecretsSchema(msrest.serialization.Model): """ _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword administrator_account: Admin credentials for virtual machine. :paramtype administrator_account: ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials """ super(VirtualMachineSecretsSchema, self).__init__(**kwargs) - self.administrator_account = kwargs.get('administrator_account', None) + self.administrator_account = kwargs.get("administrator_account", None) class VirtualMachineSecrets(ComputeSecrets, VirtualMachineSecretsSchema): @@ -20557,26 +20888,26 @@ class VirtualMachineSecrets(ComputeSecrets, VirtualMachineSecretsSchema): """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, + "compute_type": {"key": "computeType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword administrator_account: Admin credentials for virtual machine. :paramtype administrator_account: ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials """ super(VirtualMachineSecrets, self).__init__(**kwargs) - self.administrator_account = kwargs.get('administrator_account', None) - self.compute_type = 'VirtualMachine' # type: str + self.administrator_account = kwargs.get("administrator_account", None) + self.compute_type = "VirtualMachine" # type: str class VirtualMachineSize(msrest.serialization.Model): @@ -20611,35 +20942,41 @@ class VirtualMachineSize(msrest.serialization.Model): """ _validation = { - 'name': {'readonly': True}, - 'family': {'readonly': True}, - 'v_cp_us': {'readonly': True}, - 'gpus': {'readonly': True}, - 'os_vhd_size_mb': {'readonly': True}, - 'max_resource_volume_mb': {'readonly': True}, - 'memory_gb': {'readonly': True}, - 'low_priority_capable': {'readonly': True}, - 'premium_io': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'v_cp_us': {'key': 'vCPUs', 'type': 'int'}, - 'gpus': {'key': 'gpus', 'type': 'int'}, - 'os_vhd_size_mb': {'key': 'osVhdSizeMB', 'type': 'int'}, - 'max_resource_volume_mb': {'key': 'maxResourceVolumeMB', 'type': 'int'}, - 'memory_gb': {'key': 'memoryGB', 'type': 'float'}, - 'low_priority_capable': {'key': 'lowPriorityCapable', 'type': 'bool'}, - 'premium_io': {'key': 'premiumIO', 'type': 'bool'}, - 'estimated_vm_prices': {'key': 'estimatedVMPrices', 'type': 'EstimatedVMPrices'}, - 'supported_compute_types': {'key': 'supportedComputeTypes', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): + "name": {"readonly": True}, + "family": {"readonly": True}, + "v_cp_us": {"readonly": True}, + "gpus": {"readonly": True}, + "os_vhd_size_mb": {"readonly": True}, + "max_resource_volume_mb": {"readonly": True}, + "memory_gb": {"readonly": True}, + "low_priority_capable": {"readonly": True}, + "premium_io": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "family": {"key": "family", "type": "str"}, + "v_cp_us": {"key": "vCPUs", "type": "int"}, + "gpus": {"key": "gpus", "type": "int"}, + "os_vhd_size_mb": {"key": "osVhdSizeMB", "type": "int"}, + "max_resource_volume_mb": { + "key": "maxResourceVolumeMB", + "type": "int", + }, + "memory_gb": {"key": "memoryGB", "type": "float"}, + "low_priority_capable": {"key": "lowPriorityCapable", "type": "bool"}, + "premium_io": {"key": "premiumIO", "type": "bool"}, + "estimated_vm_prices": { + "key": "estimatedVMPrices", + "type": "EstimatedVMPrices", + }, + "supported_compute_types": { + "key": "supportedComputeTypes", + "type": "[str]", + }, + } + + def __init__(self, **kwargs): """ :keyword estimated_vm_prices: The estimated price information for using a VM. :paramtype estimated_vm_prices: ~azure.mgmt.machinelearningservices.models.EstimatedVMPrices @@ -20657,8 +20994,10 @@ def __init__( self.memory_gb = None self.low_priority_capable = None self.premium_io = None - self.estimated_vm_prices = kwargs.get('estimated_vm_prices', None) - self.supported_compute_types = kwargs.get('supported_compute_types', None) + self.estimated_vm_prices = kwargs.get("estimated_vm_prices", None) + self.supported_compute_types = kwargs.get( + "supported_compute_types", None + ) class VirtualMachineSizeListResult(msrest.serialization.Model): @@ -20669,19 +21008,16 @@ class VirtualMachineSizeListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[VirtualMachineSize]'}, + "value": {"key": "value", "type": "[VirtualMachineSize]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: The list of virtual machine sizes supported by AmlCompute. :paramtype value: list[~azure.mgmt.machinelearningservices.models.VirtualMachineSize] """ super(VirtualMachineSizeListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class VirtualMachineSshCredentials(msrest.serialization.Model): @@ -20698,16 +21034,13 @@ class VirtualMachineSshCredentials(msrest.serialization.Model): """ _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'public_key_data': {'key': 'publicKeyData', 'type': 'str'}, - 'private_key_data': {'key': 'privateKeyData', 'type': 'str'}, + "username": {"key": "username", "type": "str"}, + "password": {"key": "password", "type": "str"}, + "public_key_data": {"key": "publicKeyData", "type": "str"}, + "private_key_data": {"key": "privateKeyData", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword username: Username of admin account. :paramtype username: str @@ -20719,10 +21052,10 @@ def __init__( :paramtype private_key_data: str """ super(VirtualMachineSshCredentials, self).__init__(**kwargs) - self.username = kwargs.get('username', None) - self.password = kwargs.get('password', None) - self.public_key_data = kwargs.get('public_key_data', None) - self.private_key_data = kwargs.get('private_key_data', None) + self.username = kwargs.get("username", None) + self.password = kwargs.get("password", None) + self.public_key_data = kwargs.get("public_key_data", None) + self.private_key_data = kwargs.get("private_key_data", None) class VolumeDefinition(msrest.serialization.Model): @@ -20748,20 +21081,17 @@ class VolumeDefinition(msrest.serialization.Model): """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'read_only': {'key': 'readOnly', 'type': 'bool'}, - 'source': {'key': 'source', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'consistency': {'key': 'consistency', 'type': 'str'}, - 'bind': {'key': 'bind', 'type': 'BindOptions'}, - 'volume': {'key': 'volume', 'type': 'VolumeOptions'}, - 'tmpfs': {'key': 'tmpfs', 'type': 'TmpfsOptions'}, + "type": {"key": "type", "type": "str"}, + "read_only": {"key": "readOnly", "type": "bool"}, + "source": {"key": "source", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "consistency": {"key": "consistency", "type": "str"}, + "bind": {"key": "bind", "type": "BindOptions"}, + "volume": {"key": "volume", "type": "VolumeOptions"}, + "tmpfs": {"key": "tmpfs", "type": "TmpfsOptions"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword type: Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe. Possible values include: "bind", "volume", "tmpfs", "npipe". Default value: "bind". @@ -20783,14 +21113,14 @@ def __init__( :paramtype tmpfs: ~azure.mgmt.machinelearningservices.models.TmpfsOptions """ super(VolumeDefinition, self).__init__(**kwargs) - self.type = kwargs.get('type', "bind") - self.read_only = kwargs.get('read_only', None) - self.source = kwargs.get('source', None) - self.target = kwargs.get('target', None) - self.consistency = kwargs.get('consistency', None) - self.bind = kwargs.get('bind', None) - self.volume = kwargs.get('volume', None) - self.tmpfs = kwargs.get('tmpfs', None) + self.type = kwargs.get("type", "bind") + self.read_only = kwargs.get("read_only", None) + self.source = kwargs.get("source", None) + self.target = kwargs.get("target", None) + self.consistency = kwargs.get("consistency", None) + self.bind = kwargs.get("bind", None) + self.volume = kwargs.get("volume", None) + self.tmpfs = kwargs.get("tmpfs", None) class VolumeOptions(msrest.serialization.Model): @@ -20801,19 +21131,16 @@ class VolumeOptions(msrest.serialization.Model): """ _attribute_map = { - 'nocopy': {'key': 'nocopy', 'type': 'bool'}, + "nocopy": {"key": "nocopy", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword nocopy: Indicate whether volume is nocopy. :paramtype nocopy: bool """ super(VolumeOptions, self).__init__(**kwargs) - self.nocopy = kwargs.get('nocopy', None) + self.nocopy = kwargs.get("nocopy", None) class Workspace(Resource): @@ -20912,61 +21239,106 @@ class Workspace(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'workspace_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'service_provisioned_resource_group': {'readonly': True}, - 'private_link_count': {'readonly': True}, - 'private_endpoint_connections': {'readonly': True}, - 'notebook_info': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'storage_hns_enabled': {'readonly': True}, - 'ml_flow_tracking_uri': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'key_vault': {'key': 'properties.keyVault', 'type': 'str'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'storage_account': {'key': 'properties.storageAccount', 'type': 'str'}, - 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionProperty'}, - 'hbi_workspace': {'key': 'properties.hbiWorkspace', 'type': 'bool'}, - 'service_provisioned_resource_group': {'key': 'properties.serviceProvisionedResourceGroup', 'type': 'str'}, - 'private_link_count': {'key': 'properties.privateLinkCount', 'type': 'int'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'allow_public_access_when_behind_vnet': {'key': 'properties.allowPublicAccessWhenBehindVnet', 'type': 'bool'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, - 'shared_private_link_resources': {'key': 'properties.sharedPrivateLinkResources', 'type': '[SharedPrivateLinkResource]'}, - 'notebook_info': {'key': 'properties.notebookInfo', 'type': 'NotebookResourceInfo'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, - 'storage_hns_enabled': {'key': 'properties.storageHnsEnabled', 'type': 'bool'}, - 'ml_flow_tracking_uri': {'key': 'properties.mlFlowTrackingUri', 'type': 'str'}, - 'v1_legacy_mode': {'key': 'properties.v1LegacyMode', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "workspace_id": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "service_provisioned_resource_group": {"readonly": True}, + "private_link_count": {"readonly": True}, + "private_endpoint_connections": {"readonly": True}, + "notebook_info": {"readonly": True}, + "tenant_id": {"readonly": True}, + "storage_hns_enabled": {"readonly": True}, + "ml_flow_tracking_uri": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "workspace_id": {"key": "properties.workspaceId", "type": "str"}, + "description": {"key": "properties.description", "type": "str"}, + "friendly_name": {"key": "properties.friendlyName", "type": "str"}, + "key_vault": {"key": "properties.keyVault", "type": "str"}, + "application_insights": { + "key": "properties.applicationInsights", + "type": "str", + }, + "container_registry": { + "key": "properties.containerRegistry", + "type": "str", + }, + "storage_account": {"key": "properties.storageAccount", "type": "str"}, + "discovery_url": {"key": "properties.discoveryUrl", "type": "str"}, + "provisioning_state": { + "key": "properties.provisioningState", + "type": "str", + }, + "encryption": { + "key": "properties.encryption", + "type": "EncryptionProperty", + }, + "hbi_workspace": {"key": "properties.hbiWorkspace", "type": "bool"}, + "service_provisioned_resource_group": { + "key": "properties.serviceProvisionedResourceGroup", + "type": "str", + }, + "private_link_count": { + "key": "properties.privateLinkCount", + "type": "int", + }, + "image_build_compute": { + "key": "properties.imageBuildCompute", + "type": "str", + }, + "allow_public_access_when_behind_vnet": { + "key": "properties.allowPublicAccessWhenBehindVnet", + "type": "bool", + }, + "public_network_access": { + "key": "properties.publicNetworkAccess", + "type": "str", + }, + "private_endpoint_connections": { + "key": "properties.privateEndpointConnections", + "type": "[PrivateEndpointConnection]", + }, + "shared_private_link_resources": { + "key": "properties.sharedPrivateLinkResources", + "type": "[SharedPrivateLinkResource]", + }, + "notebook_info": { + "key": "properties.notebookInfo", + "type": "NotebookResourceInfo", + }, + "service_managed_resources_settings": { + "key": "properties.serviceManagedResourcesSettings", + "type": "ServiceManagedResourcesSettings", + }, + "primary_user_assigned_identity": { + "key": "properties.primaryUserAssignedIdentity", + "type": "str", + }, + "tenant_id": {"key": "properties.tenantId", "type": "str"}, + "storage_hns_enabled": { + "key": "properties.storageHnsEnabled", + "type": "bool", + }, + "ml_flow_tracking_uri": { + "key": "properties.mlFlowTrackingUri", + "type": "str", + }, + "v1_legacy_mode": {"key": "properties.v1LegacyMode", "type": "bool"}, + } + + def __init__(self, **kwargs): """ :keyword identity: The identity of the resource. :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity @@ -21023,35 +21395,43 @@ def __init__( :paramtype v1_legacy_mode: bool """ super(Workspace, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) + self.identity = kwargs.get("identity", None) + self.location = kwargs.get("location", None) + self.tags = kwargs.get("tags", None) + self.sku = kwargs.get("sku", None) self.workspace_id = None - self.description = kwargs.get('description', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.key_vault = kwargs.get('key_vault', None) - self.application_insights = kwargs.get('application_insights', None) - self.container_registry = kwargs.get('container_registry', None) - self.storage_account = kwargs.get('storage_account', None) - self.discovery_url = kwargs.get('discovery_url', None) + self.description = kwargs.get("description", None) + self.friendly_name = kwargs.get("friendly_name", None) + self.key_vault = kwargs.get("key_vault", None) + self.application_insights = kwargs.get("application_insights", None) + self.container_registry = kwargs.get("container_registry", None) + self.storage_account = kwargs.get("storage_account", None) + self.discovery_url = kwargs.get("discovery_url", None) self.provisioning_state = None - self.encryption = kwargs.get('encryption', None) - self.hbi_workspace = kwargs.get('hbi_workspace', False) + self.encryption = kwargs.get("encryption", None) + self.hbi_workspace = kwargs.get("hbi_workspace", False) self.service_provisioned_resource_group = None self.private_link_count = None - self.image_build_compute = kwargs.get('image_build_compute', None) - self.allow_public_access_when_behind_vnet = kwargs.get('allow_public_access_when_behind_vnet', False) - self.public_network_access = kwargs.get('public_network_access', None) + self.image_build_compute = kwargs.get("image_build_compute", None) + self.allow_public_access_when_behind_vnet = kwargs.get( + "allow_public_access_when_behind_vnet", False + ) + self.public_network_access = kwargs.get("public_network_access", None) self.private_endpoint_connections = None - self.shared_private_link_resources = kwargs.get('shared_private_link_resources', None) + self.shared_private_link_resources = kwargs.get( + "shared_private_link_resources", None + ) self.notebook_info = None - self.service_managed_resources_settings = kwargs.get('service_managed_resources_settings', None) - self.primary_user_assigned_identity = kwargs.get('primary_user_assigned_identity', None) + self.service_managed_resources_settings = kwargs.get( + "service_managed_resources_settings", None + ) + self.primary_user_assigned_identity = kwargs.get( + "primary_user_assigned_identity", None + ) self.tenant_id = None self.storage_hns_enabled = None self.ml_flow_tracking_uri = None - self.v1_legacy_mode = kwargs.get('v1_legacy_mode', False) + self.v1_legacy_mode = kwargs.get("v1_legacy_mode", False) class WorkspaceConnectionManagedIdentity(msrest.serialization.Model): @@ -21064,14 +21444,11 @@ class WorkspaceConnectionManagedIdentity(msrest.serialization.Model): """ _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, + "resource_id": {"key": "resourceId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword resource_id: :paramtype resource_id: str @@ -21079,8 +21456,8 @@ def __init__( :paramtype client_id: str """ super(WorkspaceConnectionManagedIdentity, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.client_id = kwargs.get('client_id', None) + self.resource_id = kwargs.get("resource_id", None) + self.client_id = kwargs.get("client_id", None) class WorkspaceConnectionPersonalAccessToken(msrest.serialization.Model): @@ -21091,19 +21468,16 @@ class WorkspaceConnectionPersonalAccessToken(msrest.serialization.Model): """ _attribute_map = { - 'pat': {'key': 'pat', 'type': 'str'}, + "pat": {"key": "pat", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword pat: :paramtype pat: str """ super(WorkspaceConnectionPersonalAccessToken, self).__init__(**kwargs) - self.pat = kwargs.get('pat', None) + self.pat = kwargs.get("pat", None) class WorkspaceConnectionPropertiesV2BasicResource(Resource): @@ -21129,35 +21503,39 @@ class WorkspaceConnectionPropertiesV2BasicResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'WorkspaceConnectionPropertiesV2'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "WorkspaceConnectionPropertiesV2", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. :paramtype properties: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 """ - super(WorkspaceConnectionPropertiesV2BasicResource, self).__init__(**kwargs) - self.properties = kwargs['properties'] + super(WorkspaceConnectionPropertiesV2BasicResource, self).__init__( + **kwargs + ) + self.properties = kwargs["properties"] -class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(msrest.serialization.Model): +class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult( + msrest.serialization.Model +): """WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult. Variables are only populated by the server, and will be ignored when sending a request. @@ -21170,25 +21548,28 @@ class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(msrest.seri """ _validation = { - 'next_link': {'readonly': True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[WorkspaceConnectionPropertiesV2BasicResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": { + "key": "value", + "type": "[WorkspaceConnectionPropertiesV2BasicResource]", + }, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: :paramtype value: list[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource] """ - super(WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + super( + WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, + self, + ).__init__(**kwargs) + self.value = kwargs.get("value", None) self.next_link = None @@ -21200,19 +21581,18 @@ class WorkspaceConnectionSharedAccessSignature(msrest.serialization.Model): """ _attribute_map = { - 'sas': {'key': 'sas', 'type': 'str'}, + "sas": {"key": "sas", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword sas: :paramtype sas: str """ - super(WorkspaceConnectionSharedAccessSignature, self).__init__(**kwargs) - self.sas = kwargs.get('sas', None) + super(WorkspaceConnectionSharedAccessSignature, self).__init__( + **kwargs + ) + self.sas = kwargs.get("sas", None) class WorkspaceConnectionUsernamePassword(msrest.serialization.Model): @@ -21225,14 +21605,11 @@ class WorkspaceConnectionUsernamePassword(msrest.serialization.Model): """ _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, + "username": {"key": "username", "type": "str"}, + "password": {"key": "password", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword username: :paramtype username: str @@ -21240,8 +21617,8 @@ def __init__( :paramtype password: str """ super(WorkspaceConnectionUsernamePassword, self).__init__(**kwargs) - self.username = kwargs.get('username', None) - self.password = kwargs.get('password', None) + self.username = kwargs.get("username", None) + self.password = kwargs.get("password", None) class WorkspaceListResult(msrest.serialization.Model): @@ -21256,14 +21633,11 @@ class WorkspaceListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[Workspace]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Workspace]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: The list of machine learning workspaces. Since this list may be incomplete, the nextLink field should be used to request the next list of machine learning workspaces. @@ -21273,8 +21647,8 @@ def __init__( :paramtype next_link: str """ super(WorkspaceListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get("value", None) + self.next_link = kwargs.get("next_link", None) class WorkspaceUpdateParameters(msrest.serialization.Model): @@ -21309,23 +21683,38 @@ class WorkspaceUpdateParameters(msrest.serialization.Model): """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "description": {"key": "properties.description", "type": "str"}, + "friendly_name": {"key": "properties.friendlyName", "type": "str"}, + "image_build_compute": { + "key": "properties.imageBuildCompute", + "type": "str", + }, + "service_managed_resources_settings": { + "key": "properties.serviceManagedResourcesSettings", + "type": "ServiceManagedResourcesSettings", + }, + "primary_user_assigned_identity": { + "key": "properties.primaryUserAssignedIdentity", + "type": "str", + }, + "public_network_access": { + "key": "properties.publicNetworkAccess", + "type": "str", + }, + "application_insights": { + "key": "properties.applicationInsights", + "type": "str", + }, + "container_registry": { + "key": "properties.containerRegistry", + "type": "str", + }, + } + + def __init__(self, **kwargs): """ :keyword tags: A set of tags. The resource tags for the machine learning workspace. :paramtype tags: dict[str, str] @@ -21356,14 +21745,18 @@ def __init__( :paramtype container_registry: str """ super(WorkspaceUpdateParameters, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) - self.identity = kwargs.get('identity', None) - self.description = kwargs.get('description', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.image_build_compute = kwargs.get('image_build_compute', None) - self.service_managed_resources_settings = kwargs.get('service_managed_resources_settings', None) - self.primary_user_assigned_identity = kwargs.get('primary_user_assigned_identity', None) - self.public_network_access = kwargs.get('public_network_access', None) - self.application_insights = kwargs.get('application_insights', None) - self.container_registry = kwargs.get('container_registry', None) + self.tags = kwargs.get("tags", None) + self.sku = kwargs.get("sku", None) + self.identity = kwargs.get("identity", None) + self.description = kwargs.get("description", None) + self.friendly_name = kwargs.get("friendly_name", None) + self.image_build_compute = kwargs.get("image_build_compute", None) + self.service_managed_resources_settings = kwargs.get( + "service_managed_resources_settings", None + ) + self.primary_user_assigned_identity = kwargs.get( + "primary_user_assigned_identity", None + ) + self.public_network_access = kwargs.get("public_network_access", None) + self.application_insights = kwargs.get("application_insights", None) + self.container_registry = kwargs.get("container_registry", None) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/models/_models_py3.py index 54ca7c66aead..8420199e33bf 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/models/_models_py3.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/models/_models_py3.py @@ -30,23 +30,25 @@ class DatastoreCredentials(msrest.serialization.Model): """ _validation = { - 'credentials_type': {'required': True}, + "credentials_type": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, } _subtype_map = { - 'credentials_type': {'AccountKey': 'AccountKeyDatastoreCredentials', 'Certificate': 'CertificateDatastoreCredentials', 'None': 'NoneDatastoreCredentials', 'Sas': 'SasDatastoreCredentials', 'ServicePrincipal': 'ServicePrincipalDatastoreCredentials'} + "credentials_type": { + "AccountKey": "AccountKeyDatastoreCredentials", + "Certificate": "CertificateDatastoreCredentials", + "None": "NoneDatastoreCredentials", + "Sas": "SasDatastoreCredentials", + "ServicePrincipal": "ServicePrincipalDatastoreCredentials", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DatastoreCredentials, self).__init__(**kwargs) self.credentials_type = None # type: Optional[str] @@ -65,27 +67,22 @@ class AccountKeyDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, + "credentials_type": {"required": True}, + "secrets": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'AccountKeyDatastoreSecrets'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "secrets": {"key": "secrets", "type": "AccountKeyDatastoreSecrets"}, } - def __init__( - self, - *, - secrets: "AccountKeyDatastoreSecrets", - **kwargs - ): + def __init__(self, *, secrets: "AccountKeyDatastoreSecrets", **kwargs): """ :keyword secrets: Required. [Required] Storage account secrets. :paramtype secrets: ~azure.mgmt.machinelearningservices.models.AccountKeyDatastoreSecrets """ super(AccountKeyDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'AccountKey' # type: str + self.credentials_type = "AccountKey" # type: str self.secrets = secrets @@ -104,23 +101,24 @@ class DatastoreSecrets(msrest.serialization.Model): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, } _subtype_map = { - 'secrets_type': {'AccountKey': 'AccountKeyDatastoreSecrets', 'Certificate': 'CertificateDatastoreSecrets', 'Sas': 'SasDatastoreSecrets', 'ServicePrincipal': 'ServicePrincipalDatastoreSecrets'} + "secrets_type": { + "AccountKey": "AccountKeyDatastoreSecrets", + "Certificate": "CertificateDatastoreSecrets", + "Sas": "SasDatastoreSecrets", + "ServicePrincipal": "ServicePrincipalDatastoreSecrets", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DatastoreSecrets, self).__init__(**kwargs) self.secrets_type = None # type: Optional[str] @@ -139,26 +137,21 @@ class AccountKeyDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "key": {"key": "key", "type": "str"}, } - def __init__( - self, - *, - key: Optional[str] = None, - **kwargs - ): + def __init__(self, *, key: Optional[str] = None, **kwargs): """ :keyword key: Storage account key. :paramtype key: str """ super(AccountKeyDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'AccountKey' # type: str + self.secrets_type = "AccountKey" # type: str self.key = key @@ -176,8 +169,14 @@ class AcrDetails(msrest.serialization.Model): """ _attribute_map = { - 'system_created_acr_account': {'key': 'systemCreatedAcrAccount', 'type': 'SystemCreatedAcrAccount'}, - 'user_created_acr_account': {'key': 'userCreatedAcrAccount', 'type': 'UserCreatedAcrAccount'}, + "system_created_acr_account": { + "key": "systemCreatedAcrAccount", + "type": "SystemCreatedAcrAccount", + }, + "user_created_acr_account": { + "key": "userCreatedAcrAccount", + "type": "UserCreatedAcrAccount", + }, } def __init__( @@ -210,14 +209,11 @@ class AKSSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, + "properties": {"key": "properties", "type": "AKSSchemaProperties"}, } def __init__( - self, - *, - properties: Optional["AKSSchemaProperties"] = None, - **kwargs + self, *, properties: Optional["AKSSchemaProperties"] = None, **kwargs ): """ :keyword properties: AKS properties. @@ -267,29 +263,43 @@ class Compute(msrest.serialization.Model): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, - } - - _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, + } + + _attribute_map = { + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } _subtype_map = { - 'compute_type': {'AKS': 'AKS', 'AmlCompute': 'AmlCompute', 'ComputeInstance': 'ComputeInstance', 'DataFactory': 'DataFactory', 'DataLakeAnalytics': 'DataLakeAnalytics', 'Databricks': 'Databricks', 'HDInsight': 'HDInsight', 'Kubernetes': 'Kubernetes', 'SynapseSpark': 'SynapseSpark', 'VirtualMachine': 'VirtualMachine'} + "compute_type": { + "AKS": "AKS", + "AmlCompute": "AmlCompute", + "ComputeInstance": "ComputeInstance", + "DataFactory": "DataFactory", + "DataLakeAnalytics": "DataLakeAnalytics", + "Databricks": "Databricks", + "HDInsight": "HDInsight", + "Kubernetes": "Kubernetes", + "SynapseSpark": "SynapseSpark", + "VirtualMachine": "VirtualMachine", + } } def __init__( @@ -364,26 +374,29 @@ class AKS(Compute, AKSSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "AKSSchemaProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -409,9 +422,16 @@ def __init__( MSI and AAD exclusively for authentication. :paramtype disable_local_auth: bool """ - super(AKS, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) + super(AKS, self).__init__( + compute_location=compute_location, + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'AKS' # type: str + self.compute_type = "AKS" # type: str self.compute_location = compute_location self.provisioning_state = None self.description = description @@ -437,9 +457,12 @@ class AksComputeSecretsProperties(msrest.serialization.Model): """ _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, + "user_kube_config": {"key": "userKubeConfig", "type": "str"}, + "admin_kube_config": {"key": "adminKubeConfig", "type": "str"}, + "image_pull_secret_name": { + "key": "imagePullSecretName", + "type": "str", + }, } def __init__( @@ -481,23 +504,23 @@ class ComputeSecrets(msrest.serialization.Model): """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "compute_type": {"key": "computeType", "type": "str"}, } _subtype_map = { - 'compute_type': {'AKS': 'AksComputeSecrets', 'Databricks': 'DatabricksComputeSecrets', 'VirtualMachine': 'VirtualMachineSecrets'} + "compute_type": { + "AKS": "AksComputeSecrets", + "Databricks": "DatabricksComputeSecrets", + "VirtualMachine": "VirtualMachineSecrets", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ComputeSecrets, self).__init__(**kwargs) self.compute_type = None # type: Optional[str] @@ -522,14 +545,17 @@ class AksComputeSecrets(ComputeSecrets, AksComputeSecretsProperties): """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "user_kube_config": {"key": "userKubeConfig", "type": "str"}, + "admin_kube_config": {"key": "adminKubeConfig", "type": "str"}, + "image_pull_secret_name": { + "key": "imagePullSecretName", + "type": "str", + }, + "compute_type": {"key": "computeType", "type": "str"}, } def __init__( @@ -550,11 +576,16 @@ def __init__( :keyword image_pull_secret_name: Image registry pull secret. :paramtype image_pull_secret_name: str """ - super(AksComputeSecrets, self).__init__(user_kube_config=user_kube_config, admin_kube_config=admin_kube_config, image_pull_secret_name=image_pull_secret_name, **kwargs) + super(AksComputeSecrets, self).__init__( + user_kube_config=user_kube_config, + admin_kube_config=admin_kube_config, + image_pull_secret_name=image_pull_secret_name, + **kwargs + ) self.user_kube_config = user_kube_config self.admin_kube_config = admin_kube_config self.image_pull_secret_name = image_pull_secret_name - self.compute_type = 'AKS' # type: str + self.compute_type = "AKS" # type: str class AksNetworkingConfiguration(msrest.serialization.Model): @@ -574,16 +605,22 @@ class AksNetworkingConfiguration(msrest.serialization.Model): """ _validation = { - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, + "service_cidr": { + "pattern": r"^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$" + }, + "dns_service_ip": { + "pattern": r"^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" + }, + "docker_bridge_cidr": { + "pattern": r"^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$" + }, } _attribute_map = { - 'subnet_id': {'key': 'subnetId', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, + "subnet_id": {"key": "subnetId", "type": "str"}, + "service_cidr": {"key": "serviceCidr", "type": "str"}, + "dns_service_ip": {"key": "dnsServiceIP", "type": "str"}, + "docker_bridge_cidr": {"key": "dockerBridgeCidr", "type": "str"}, } def __init__( @@ -644,20 +681,29 @@ class AKSSchemaProperties(msrest.serialization.Model): """ _validation = { - 'system_services': {'readonly': True}, - 'agent_count': {'minimum': 0}, + "system_services": {"readonly": True}, + "agent_count": {"minimum": 0}, } _attribute_map = { - 'cluster_fqdn': {'key': 'clusterFqdn', 'type': 'str'}, - 'system_services': {'key': 'systemServices', 'type': '[SystemService]'}, - 'agent_count': {'key': 'agentCount', 'type': 'int'}, - 'agent_vm_size': {'key': 'agentVmSize', 'type': 'str'}, - 'cluster_purpose': {'key': 'clusterPurpose', 'type': 'str'}, - 'ssl_configuration': {'key': 'sslConfiguration', 'type': 'SslConfiguration'}, - 'aks_networking_configuration': {'key': 'aksNetworkingConfiguration', 'type': 'AksNetworkingConfiguration'}, - 'load_balancer_type': {'key': 'loadBalancerType', 'type': 'str'}, - 'load_balancer_subnet': {'key': 'loadBalancerSubnet', 'type': 'str'}, + "cluster_fqdn": {"key": "clusterFqdn", "type": "str"}, + "system_services": { + "key": "systemServices", + "type": "[SystemService]", + }, + "agent_count": {"key": "agentCount", "type": "int"}, + "agent_vm_size": {"key": "agentVmSize", "type": "str"}, + "cluster_purpose": {"key": "clusterPurpose", "type": "str"}, + "ssl_configuration": { + "key": "sslConfiguration", + "type": "SslConfiguration", + }, + "aks_networking_configuration": { + "key": "aksNetworkingConfiguration", + "type": "AksNetworkingConfiguration", + }, + "load_balancer_type": {"key": "loadBalancerType", "type": "str"}, + "load_balancer_subnet": {"key": "loadBalancerSubnet", "type": "str"}, } def __init__( @@ -668,8 +714,12 @@ def __init__( agent_vm_size: Optional[str] = None, cluster_purpose: Optional[Union[str, "ClusterPurpose"]] = "FastProd", ssl_configuration: Optional["SslConfiguration"] = None, - aks_networking_configuration: Optional["AksNetworkingConfiguration"] = None, - load_balancer_type: Optional[Union[str, "LoadBalancerType"]] = "PublicIp", + aks_networking_configuration: Optional[ + "AksNetworkingConfiguration" + ] = None, + load_balancer_type: Optional[ + Union[str, "LoadBalancerType"] + ] = "PublicIp", load_balancer_subnet: Optional[str] = None, **kwargs ): @@ -721,23 +771,17 @@ class Nodes(msrest.serialization.Model): """ _validation = { - 'nodes_value_type': {'required': True}, + "nodes_value_type": {"required": True}, } _attribute_map = { - 'nodes_value_type': {'key': 'nodesValueType', 'type': 'str'}, + "nodes_value_type": {"key": "nodesValueType", "type": "str"}, } - _subtype_map = { - 'nodes_value_type': {'All': 'AllNodes'} - } + _subtype_map = {"nodes_value_type": {"All": "AllNodes"}} - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Nodes, self).__init__(**kwargs) self.nodes_value_type = None # type: Optional[str] @@ -753,21 +797,17 @@ class AllNodes(Nodes): """ _validation = { - 'nodes_value_type': {'required': True}, + "nodes_value_type": {"required": True}, } _attribute_map = { - 'nodes_value_type': {'key': 'nodesValueType', 'type': 'str'}, + "nodes_value_type": {"key": "nodesValueType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AllNodes, self).__init__(**kwargs) - self.nodes_value_type = 'All' # type: str + self.nodes_value_type = "All" # type: str class AmlComputeSchema(msrest.serialization.Model): @@ -778,14 +818,11 @@ class AmlComputeSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, + "properties": {"key": "properties", "type": "AmlComputeProperties"}, } def __init__( - self, - *, - properties: Optional["AmlComputeProperties"] = None, - **kwargs + self, *, properties: Optional["AmlComputeProperties"] = None, **kwargs ): """ :keyword properties: Properties of AmlCompute. @@ -834,26 +871,29 @@ class AmlCompute(Compute, AmlComputeSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "AmlComputeProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -879,9 +919,16 @@ def __init__( MSI and AAD exclusively for authentication. :paramtype disable_local_auth: bool """ - super(AmlCompute, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) + super(AmlCompute, self).__init__( + compute_location=compute_location, + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'AmlCompute' # type: str + self.compute_type = "AmlCompute" # type: str self.compute_location = compute_location self.provisioning_state = None self.description = description @@ -915,29 +962,25 @@ class AmlComputeNodeInformation(msrest.serialization.Model): """ _validation = { - 'node_id': {'readonly': True}, - 'private_ip_address': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'port': {'readonly': True}, - 'node_state': {'readonly': True}, - 'run_id': {'readonly': True}, + "node_id": {"readonly": True}, + "private_ip_address": {"readonly": True}, + "public_ip_address": {"readonly": True}, + "port": {"readonly": True}, + "node_state": {"readonly": True}, + "run_id": {"readonly": True}, } _attribute_map = { - 'node_id': {'key': 'nodeId', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'node_state': {'key': 'nodeState', 'type': 'str'}, - 'run_id': {'key': 'runId', 'type': 'str'}, + "node_id": {"key": "nodeId", "type": "str"}, + "private_ip_address": {"key": "privateIpAddress", "type": "str"}, + "public_ip_address": {"key": "publicIpAddress", "type": "str"}, + "port": {"key": "port", "type": "int"}, + "node_state": {"key": "nodeState", "type": "str"}, + "run_id": {"key": "runId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AmlComputeNodeInformation, self).__init__(**kwargs) self.node_id = None self.private_ip_address = None @@ -959,21 +1002,17 @@ class AmlComputeNodesInformation(msrest.serialization.Model): """ _validation = { - 'nodes': {'readonly': True}, - 'next_link': {'readonly': True}, + "nodes": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'nodes': {'key': 'nodes', 'type': '[AmlComputeNodeInformation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "nodes": {"key": "nodes", "type": "[AmlComputeNodeInformation]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AmlComputeNodesInformation, self).__init__(**kwargs) self.nodes = None self.next_link = None @@ -1044,32 +1083,47 @@ class AmlComputeProperties(msrest.serialization.Model): """ _validation = { - 'allocation_state': {'readonly': True}, - 'allocation_state_transition_time': {'readonly': True}, - 'errors': {'readonly': True}, - 'current_node_count': {'readonly': True}, - 'target_node_count': {'readonly': True}, - 'node_state_counts': {'readonly': True}, - } - - _attribute_map = { - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'vm_priority': {'key': 'vmPriority', 'type': 'str'}, - 'virtual_machine_image': {'key': 'virtualMachineImage', 'type': 'VirtualMachineImage'}, - 'isolated_network': {'key': 'isolatedNetwork', 'type': 'bool'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, - 'user_account_credentials': {'key': 'userAccountCredentials', 'type': 'UserAccountCredentials'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'remote_login_port_public_access': {'key': 'remoteLoginPortPublicAccess', 'type': 'str'}, - 'allocation_state': {'key': 'allocationState', 'type': 'str'}, - 'allocation_state_transition_time': {'key': 'allocationStateTransitionTime', 'type': 'iso-8601'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'current_node_count': {'key': 'currentNodeCount', 'type': 'int'}, - 'target_node_count': {'key': 'targetNodeCount', 'type': 'int'}, - 'node_state_counts': {'key': 'nodeStateCounts', 'type': 'NodeStateCounts'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'property_bag': {'key': 'propertyBag', 'type': 'object'}, + "allocation_state": {"readonly": True}, + "allocation_state_transition_time": {"readonly": True}, + "errors": {"readonly": True}, + "current_node_count": {"readonly": True}, + "target_node_count": {"readonly": True}, + "node_state_counts": {"readonly": True}, + } + + _attribute_map = { + "os_type": {"key": "osType", "type": "str"}, + "vm_size": {"key": "vmSize", "type": "str"}, + "vm_priority": {"key": "vmPriority", "type": "str"}, + "virtual_machine_image": { + "key": "virtualMachineImage", + "type": "VirtualMachineImage", + }, + "isolated_network": {"key": "isolatedNetwork", "type": "bool"}, + "scale_settings": {"key": "scaleSettings", "type": "ScaleSettings"}, + "user_account_credentials": { + "key": "userAccountCredentials", + "type": "UserAccountCredentials", + }, + "subnet": {"key": "subnet", "type": "ResourceId"}, + "remote_login_port_public_access": { + "key": "remoteLoginPortPublicAccess", + "type": "str", + }, + "allocation_state": {"key": "allocationState", "type": "str"}, + "allocation_state_transition_time": { + "key": "allocationStateTransitionTime", + "type": "iso-8601", + }, + "errors": {"key": "errors", "type": "[ErrorResponse]"}, + "current_node_count": {"key": "currentNodeCount", "type": "int"}, + "target_node_count": {"key": "targetNodeCount", "type": "int"}, + "node_state_counts": { + "key": "nodeStateCounts", + "type": "NodeStateCounts", + }, + "enable_node_public_ip": {"key": "enableNodePublicIp", "type": "bool"}, + "property_bag": {"key": "propertyBag", "type": "object"}, } def __init__( @@ -1083,7 +1137,9 @@ def __init__( scale_settings: Optional["ScaleSettings"] = None, user_account_credentials: Optional["UserAccountCredentials"] = None, subnet: Optional["ResourceId"] = None, - remote_login_port_public_access: Optional[Union[str, "RemoteLoginPortPublicAccess"]] = "NotSpecified", + remote_login_port_public_access: Optional[ + Union[str, "RemoteLoginPortPublicAccess"] + ] = "NotSpecified", enable_node_public_ip: Optional[bool] = True, property_bag: Optional[Any] = None, **kwargs @@ -1159,9 +1215,9 @@ class AmlOperation(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'AmlOperationDisplay'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + "name": {"key": "name", "type": "str"}, + "display": {"key": "display", "type": "AmlOperationDisplay"}, + "is_data_action": {"key": "isDataAction", "type": "bool"}, } def __init__( @@ -1200,10 +1256,10 @@ class AmlOperationDisplay(msrest.serialization.Model): """ _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, + "provider": {"key": "provider", "type": "str"}, + "resource": {"key": "resource", "type": "str"}, + "operation": {"key": "operation", "type": "str"}, + "description": {"key": "description", "type": "str"}, } def __init__( @@ -1240,14 +1296,11 @@ class AmlOperationListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlOperation]'}, + "value": {"key": "value", "type": "[AmlOperation]"}, } def __init__( - self, - *, - value: Optional[List["AmlOperation"]] = None, - **kwargs + self, *, value: Optional[List["AmlOperation"]] = None, **kwargs ): """ :keyword value: List of AML workspace operations supported by the AML workspace resource @@ -1273,23 +1326,23 @@ class IdentityConfiguration(msrest.serialization.Model): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, } _subtype_map = { - 'identity_type': {'AMLToken': 'AmlToken', 'Managed': 'ManagedIdentity', 'UserIdentity': 'UserIdentity'} + "identity_type": { + "AMLToken": "AmlToken", + "Managed": "ManagedIdentity", + "UserIdentity": "UserIdentity", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(IdentityConfiguration, self).__init__(**kwargs) self.identity_type = None # type: Optional[str] @@ -1306,21 +1359,17 @@ class AmlToken(IdentityConfiguration): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AmlToken, self).__init__(**kwargs) - self.identity_type = 'AMLToken' # type: str + self.identity_type = "AMLToken" # type: str class AmlUserFeature(msrest.serialization.Model): @@ -1335,9 +1384,9 @@ class AmlUserFeature(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "description": {"key": "description", "type": "str"}, } def __init__( @@ -1373,15 +1422,10 @@ class ArmResourceId(msrest.serialization.Model): """ _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, + "resource_id": {"key": "resourceId", "type": "str"}, } - def __init__( - self, - *, - resource_id: Optional[str] = None, - **kwargs - ): + def __init__(self, *, resource_id: Optional[str] = None, **kwargs): """ :keyword resource_id: Arm ResourceId is in the format "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName}" @@ -1405,9 +1449,9 @@ class ResourceBase(msrest.serialization.Model): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, } def __init__( @@ -1448,11 +1492,11 @@ class AssetBase(ResourceBase): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, } def __init__( @@ -1477,7 +1521,9 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(AssetBase, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + super(AssetBase, self).__init__( + description=description, properties=properties, tags=tags, **kwargs + ) self.is_anonymous = is_anonymous self.is_archived = is_archived @@ -1502,17 +1548,17 @@ class AssetContainer(ResourceBase): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, } def __init__( @@ -1534,7 +1580,9 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(AssetContainer, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + super(AssetContainer, self).__init__( + description=description, properties=properties, tags=tags, **kwargs + ) self.is_archived = is_archived self.latest_version = None self.next_version = None @@ -1553,12 +1601,12 @@ class AssetJobInput(msrest.serialization.Model): """ _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "uri": {"required": True, "min_length": 1, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, } def __init__( @@ -1590,8 +1638,8 @@ class AssetJobOutput(msrest.serialization.Model): """ _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, } def __init__( @@ -1626,23 +1674,23 @@ class AssetReferenceBase(msrest.serialization.Model): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, } _subtype_map = { - 'reference_type': {'DataPath': 'DataPathAssetReference', 'Id': 'IdAssetReference', 'OutputPath': 'OutputPathAssetReference'} + "reference_type": { + "DataPath": "DataPathAssetReference", + "Id": "IdAssetReference", + "OutputPath": "OutputPathAssetReference", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AssetReferenceBase, self).__init__(**kwargs) self.reference_type = None # type: Optional[str] @@ -1659,22 +1707,16 @@ class AssignedUser(msrest.serialization.Model): """ _validation = { - 'object_id': {'required': True}, - 'tenant_id': {'required': True}, + "object_id": {"required": True}, + "tenant_id": {"required": True}, } _attribute_map = { - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + "object_id": {"key": "objectId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, } - def __init__( - self, - *, - object_id: str, - tenant_id: str, - **kwargs - ): + def __init__(self, *, object_id: str, tenant_id: str, **kwargs): """ :keyword object_id: Required. User’s AAD Object Id. :paramtype object_id: str @@ -1700,23 +1742,22 @@ class ForecastHorizon(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoForecastHorizon', 'Custom': 'CustomForecastHorizon'} + "mode": { + "Auto": "AutoForecastHorizon", + "Custom": "CustomForecastHorizon", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ForecastHorizon, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -1732,21 +1773,17 @@ class AutoForecastHorizon(ForecastHorizon): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoForecastHorizon, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class JobBaseProperties(ResourceBase): @@ -1793,27 +1830,32 @@ class JobBaseProperties(ResourceBase): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, + "job_type": {"required": True}, + "status": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, } _subtype_map = { - 'job_type': {'AutoML': 'AutoMLJob', 'Command': 'CommandJob', 'Pipeline': 'PipelineJob', 'Sweep': 'SweepJob'} + "job_type": { + "AutoML": "AutoMLJob", + "Command": "CommandJob", + "Pipeline": "PipelineJob", + "Sweep": "SweepJob", + } } def __init__( @@ -1857,97 +1899,102 @@ def __init__( For local jobs, a job endpoint will have an endpoint value of FileStreamObject. :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] """ - super(JobBaseProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + super(JobBaseProperties, self).__init__( + description=description, properties=properties, tags=tags, **kwargs + ) self.component_id = component_id self.compute_id = compute_id self.display_name = display_name self.experiment_name = experiment_name self.identity = identity self.is_archived = is_archived - self.job_type = 'JobBaseProperties' # type: str + self.job_type = "JobBaseProperties" # type: str self.services = services self.status = None class AutoMLJob(JobBaseProperties): """AutoMLJob class. -Use this class for executing AutoML tasks like Classification/Regression etc. -See TaskType enum for all the tasks supported. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Sweep", "Pipeline". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar environment_id: The ARM resource ID of the Environment specification for the job. - This is optional value to provide, if not provided, AutoML will default this to Production - AutoML curated environment version when running the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - :ivar task_details: Required. [Required] This represents scenario which can be one of - Tables/NLP/Image. - :vartype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical + Use this class for executing AutoML tasks like Classification/Regression etc. + See TaskType enum for all the tasks supported. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar description: The asset description text. + :vartype description: str + :ivar properties: The asset property dictionary. + :vartype properties: dict[str, str] + :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + :ivar component_id: ARM resource ID of the component resource. + :vartype component_id: str + :ivar compute_id: ARM resource ID of the compute resource. + :vartype compute_id: str + :ivar display_name: Display name of job. + :vartype display_name: str + :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is + placed in the "Default" experiment. + :vartype experiment_name: str + :ivar identity: Identity configuration. If set, this should be one of AmlToken, + ManagedIdentity, UserIdentity or null. + Defaults to AmlToken if null. + :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration + :ivar is_archived: Is the asset archived?. + :vartype is_archived: bool + :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. + Possible values include: "AutoML", "Command", "Sweep", "Pipeline". + :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType + :ivar services: List of JobEndpoints. + For local jobs, a job endpoint will have an endpoint value of FileStreamObject. + :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] + :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", + "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", + "Failed", "Canceled", "NotResponding", "Paused", "Unknown". + :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus + :ivar environment_id: The ARM resource ID of the Environment specification for the job. + This is optional value to provide, if not provided, AutoML will default this to Production + AutoML curated environment version when running the job. + :vartype environment_id: str + :ivar environment_variables: Environment variables included in the job. + :vartype environment_variables: dict[str, str] + :ivar outputs: Mapping of output data bindings used in the job. + :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] + :ivar resources: Compute Resource configuration for the job. + :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration + :ivar task_details: Required. [Required] This represents scenario which can be one of + Tables/NLP/Image. + :vartype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'task_details': {'required': True}, + "job_type": {"required": True}, + "status": {"readonly": True}, + "task_details": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - 'task_details': {'key': 'taskDetails', 'type': 'AutoMLVertical'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "resources": {"key": "resources", "type": "JobResourceConfiguration"}, + "task_details": {"key": "taskDetails", "type": "AutoMLVertical"}, } def __init__( @@ -2009,8 +2056,20 @@ def __init__( Tables/NLP/Image. :paramtype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical """ - super(AutoMLJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, services=services, **kwargs) - self.job_type = 'AutoML' # type: str + super(AutoMLJob, self).__init__( + description=description, + properties=properties, + tags=tags, + component_id=component_id, + compute_id=compute_id, + display_name=display_name, + experiment_name=experiment_name, + identity=identity, + is_archived=is_archived, + services=services, + **kwargs + ) + self.job_type = "AutoML" # type: str self.environment_id = environment_id self.environment_variables = environment_variables self.outputs = outputs @@ -2020,42 +2079,53 @@ def __init__( class AutoMLVertical(msrest.serialization.Model): """AutoML vertical class. -Base class for AutoML verticals - TableVertical/ImageVertical/NLPVertical. + Base class for AutoML verticals - TableVertical/ImageVertical/NLPVertical. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Classification, Forecasting, ImageClassification, ImageClassificationMultilabel, ImageInstanceSegmentation, ImageObjectDetection, Regression, TextClassification, TextClassificationMultilabel, TextNer. + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Classification, Forecasting, ImageClassification, ImageClassificationMultilabel, ImageInstanceSegmentation, ImageObjectDetection, Regression, TextClassification, TextClassificationMultilabel, TextNer. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, + "task_type": {"required": True}, + "training_data": {"required": True}, } _attribute_map = { - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, } _subtype_map = { - 'task_type': {'Classification': 'Classification', 'Forecasting': 'Forecasting', 'ImageClassification': 'ImageClassification', 'ImageClassificationMultilabel': 'ImageClassificationMultilabel', 'ImageInstanceSegmentation': 'ImageInstanceSegmentation', 'ImageObjectDetection': 'ImageObjectDetection', 'Regression': 'Regression', 'TextClassification': 'TextClassification', 'TextClassificationMultilabel': 'TextClassificationMultilabel', 'TextNER': 'TextNer'} + "task_type": { + "Classification": "Classification", + "Forecasting": "Forecasting", + "ImageClassification": "ImageClassification", + "ImageClassificationMultilabel": "ImageClassificationMultilabel", + "ImageInstanceSegmentation": "ImageInstanceSegmentation", + "ImageObjectDetection": "ImageObjectDetection", + "Regression": "Regression", + "TextClassification": "TextClassification", + "TextClassificationMultilabel": "TextClassificationMultilabel", + "TextNER": "TextNer", + } } def __init__( @@ -2097,23 +2167,22 @@ class NCrossValidations(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoNCrossValidations', 'Custom': 'CustomNCrossValidations'} + "mode": { + "Auto": "AutoNCrossValidations", + "Custom": "CustomNCrossValidations", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NCrossValidations, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -2129,21 +2198,17 @@ class AutoNCrossValidations(NCrossValidations): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoNCrossValidations, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class AutoPauseProperties(msrest.serialization.Model): @@ -2156,8 +2221,8 @@ class AutoPauseProperties(msrest.serialization.Model): """ _attribute_map = { - 'delay_in_minutes': {'key': 'delayInMinutes', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, + "delay_in_minutes": {"key": "delayInMinutes", "type": "int"}, + "enabled": {"key": "enabled", "type": "bool"}, } def __init__( @@ -2190,9 +2255,9 @@ class AutoScaleProperties(msrest.serialization.Model): """ _attribute_map = { - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, + "min_node_count": {"key": "minNodeCount", "type": "int"}, + "enabled": {"key": "enabled", "type": "bool"}, + "max_node_count": {"key": "maxNodeCount", "type": "int"}, } def __init__( @@ -2231,23 +2296,19 @@ class Seasonality(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoSeasonality', 'Custom': 'CustomSeasonality'} + "mode": {"Auto": "AutoSeasonality", "Custom": "CustomSeasonality"} } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Seasonality, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -2263,21 +2324,17 @@ class AutoSeasonality(Seasonality): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoSeasonality, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class TargetLags(msrest.serialization.Model): @@ -2294,23 +2351,19 @@ class TargetLags(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoTargetLags', 'Custom': 'CustomTargetLags'} + "mode": {"Auto": "AutoTargetLags", "Custom": "CustomTargetLags"} } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(TargetLags, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -2326,21 +2379,17 @@ class AutoTargetLags(TargetLags): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoTargetLags, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class TargetRollingWindowSize(msrest.serialization.Model): @@ -2357,23 +2406,22 @@ class TargetRollingWindowSize(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoTargetRollingWindowSize', 'Custom': 'CustomTargetRollingWindowSize'} + "mode": { + "Auto": "AutoTargetRollingWindowSize", + "Custom": "CustomTargetRollingWindowSize", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(TargetRollingWindowSize, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -2389,21 +2437,17 @@ class AutoTargetRollingWindowSize(TargetRollingWindowSize): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class DatastoreProperties(ResourceBase): @@ -2434,22 +2478,27 @@ class DatastoreProperties(ResourceBase): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, } _subtype_map = { - 'datastore_type': {'AzureBlob': 'AzureBlobDatastore', 'AzureDataLakeGen1': 'AzureDataLakeGen1Datastore', 'AzureDataLakeGen2': 'AzureDataLakeGen2Datastore', 'AzureFile': 'AzureFileDatastore'} + "datastore_type": { + "AzureBlob": "AzureBlobDatastore", + "AzureDataLakeGen1": "AzureDataLakeGen1Datastore", + "AzureDataLakeGen2": "AzureDataLakeGen2Datastore", + "AzureFile": "AzureFileDatastore", + } } def __init__( @@ -2471,9 +2520,11 @@ def __init__( :keyword credentials: Required. [Required] Account credentials. :paramtype credentials: ~azure.mgmt.machinelearningservices.models.DatastoreCredentials """ - super(DatastoreProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + super(DatastoreProperties, self).__init__( + description=description, properties=properties, tags=tags, **kwargs + ) self.credentials = credentials - self.datastore_type = 'DatastoreProperties' # type: str + self.datastore_type = "DatastoreProperties" # type: str self.is_default = None @@ -2515,23 +2566,26 @@ class AzureBlobDatastore(DatastoreProperties): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "account_name": {"key": "accountName", "type": "str"}, + "container_name": {"key": "containerName", "type": "str"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } def __init__( @@ -2545,7 +2599,9 @@ def __init__( container_name: Optional[str] = None, endpoint: Optional[str] = None, protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, + service_data_access_auth_identity: Optional[ + Union[str, "ServiceDataAccessAuthIdentity"] + ] = None, **kwargs ): """ @@ -2571,13 +2627,21 @@ def __init__( :paramtype service_data_access_auth_identity: str or ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ - super(AzureBlobDatastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, **kwargs) - self.datastore_type = 'AzureBlob' # type: str + super(AzureBlobDatastore, self).__init__( + description=description, + properties=properties, + tags=tags, + credentials=credentials, + **kwargs + ) + self.datastore_type = "AzureBlob" # type: str self.account_name = account_name self.container_name = container_name self.endpoint = endpoint self.protocol = protocol - self.service_data_access_auth_identity = service_data_access_auth_identity + self.service_data_access_auth_identity = ( + service_data_access_auth_identity + ) class AzureDataLakeGen1Datastore(DatastoreProperties): @@ -2612,21 +2676,28 @@ class AzureDataLakeGen1Datastore(DatastoreProperties): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'store_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "store_name": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - 'store_name': {'key': 'storeName', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, + "store_name": {"key": "storeName", "type": "str"}, } def __init__( @@ -2637,7 +2708,9 @@ def __init__( description: Optional[str] = None, properties: Optional[Dict[str, str]] = None, tags: Optional[Dict[str, str]] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, + service_data_access_auth_identity: Optional[ + Union[str, "ServiceDataAccessAuthIdentity"] + ] = None, **kwargs ): """ @@ -2657,9 +2730,17 @@ def __init__( :keyword store_name: Required. [Required] Azure Data Lake store name. :paramtype store_name: str """ - super(AzureDataLakeGen1Datastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, **kwargs) - self.datastore_type = 'AzureDataLakeGen1' # type: str - self.service_data_access_auth_identity = service_data_access_auth_identity + super(AzureDataLakeGen1Datastore, self).__init__( + description=description, + properties=properties, + tags=tags, + credentials=credentials, + **kwargs + ) + self.datastore_type = "AzureDataLakeGen1" # type: str + self.service_data_access_auth_identity = ( + service_data_access_auth_identity + ) self.store_name = store_name @@ -2701,25 +2782,36 @@ class AzureDataLakeGen2Datastore(DatastoreProperties): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'filesystem': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "account_name": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "filesystem": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'filesystem': {'key': 'filesystem', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "account_name": {"key": "accountName", "type": "str"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "filesystem": {"key": "filesystem", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } def __init__( @@ -2733,7 +2825,9 @@ def __init__( tags: Optional[Dict[str, str]] = None, endpoint: Optional[str] = None, protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, + service_data_access_auth_identity: Optional[ + Union[str, "ServiceDataAccessAuthIdentity"] + ] = None, **kwargs ): """ @@ -2759,13 +2853,21 @@ def __init__( :paramtype service_data_access_auth_identity: str or ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ - super(AzureDataLakeGen2Datastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, **kwargs) - self.datastore_type = 'AzureDataLakeGen2' # type: str + super(AzureDataLakeGen2Datastore, self).__init__( + description=description, + properties=properties, + tags=tags, + credentials=credentials, + **kwargs + ) + self.datastore_type = "AzureDataLakeGen2" # type: str self.account_name = account_name self.endpoint = endpoint self.filesystem = filesystem self.protocol = protocol - self.service_data_access_auth_identity = service_data_access_auth_identity + self.service_data_access_auth_identity = ( + service_data_access_auth_identity + ) class AzureFileDatastore(DatastoreProperties): @@ -2807,25 +2909,36 @@ class AzureFileDatastore(DatastoreProperties): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'file_share_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "account_name": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "file_share_name": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'file_share_name': {'key': 'fileShareName', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "account_name": {"key": "accountName", "type": "str"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "file_share_name": {"key": "fileShareName", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } def __init__( @@ -2839,7 +2952,9 @@ def __init__( tags: Optional[Dict[str, str]] = None, endpoint: Optional[str] = None, protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, + service_data_access_auth_identity: Optional[ + Union[str, "ServiceDataAccessAuthIdentity"] + ] = None, **kwargs ): """ @@ -2866,13 +2981,21 @@ def __init__( :paramtype service_data_access_auth_identity: str or ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ - super(AzureFileDatastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, **kwargs) - self.datastore_type = 'AzureFile' # type: str + super(AzureFileDatastore, self).__init__( + description=description, + properties=properties, + tags=tags, + credentials=credentials, + **kwargs + ) + self.datastore_type = "AzureFile" # type: str self.account_name = account_name self.endpoint = endpoint self.file_share_name = file_share_name self.protocol = protocol - self.service_data_access_auth_identity = service_data_access_auth_identity + self.service_data_access_auth_identity = ( + service_data_access_auth_identity + ) class EarlyTerminationPolicy(msrest.serialization.Model): @@ -2894,17 +3017,21 @@ class EarlyTerminationPolicy(msrest.serialization.Model): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, } _subtype_map = { - 'policy_type': {'Bandit': 'BanditPolicy', 'MedianStopping': 'MedianStoppingPolicy', 'TruncationSelection': 'TruncationSelectionPolicy'} + "policy_type": { + "Bandit": "BanditPolicy", + "MedianStopping": "MedianStoppingPolicy", + "TruncationSelection": "TruncationSelectionPolicy", + } } def __init__( @@ -2946,15 +3073,15 @@ class BanditPolicy(EarlyTerminationPolicy): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'slack_amount': {'key': 'slackAmount', 'type': 'float'}, - 'slack_factor': {'key': 'slackFactor', 'type': 'float'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, + "slack_amount": {"key": "slackAmount", "type": "float"}, + "slack_factor": {"key": "slackFactor", "type": "float"}, } def __init__( @@ -2976,8 +3103,12 @@ def __init__( :keyword slack_factor: Ratio of the allowed distance from the best performing run. :paramtype slack_factor: float """ - super(BanditPolicy, self).__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs) - self.policy_type = 'Bandit' # type: str + super(BanditPolicy, self).__init__( + delay_evaluation=delay_evaluation, + evaluation_interval=evaluation_interval, + **kwargs + ) + self.policy_type = "Bandit" # type: str self.slack_amount = slack_amount self.slack_factor = slack_factor @@ -3001,25 +3132,21 @@ class Resource(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -3052,28 +3179,24 @@ class TrackedResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, } def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - **kwargs + self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs ): """ :keyword tags: A set of tags. Resource tags. @@ -3120,25 +3243,28 @@ class BatchDeployment(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchDeploymentProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": { + "key": "properties", + "type": "BatchDeploymentProperties", + }, + "sku": {"key": "sku", "type": "Sku"}, } def __init__( @@ -3167,7 +3293,9 @@ def __init__( :keyword sku: Sku details required for ARM contract for Autoscaling. :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ - super(BatchDeployment, self).__init__(tags=tags, location=location, **kwargs) + super(BatchDeployment, self).__init__( + tags=tags, location=location, **kwargs + ) self.identity = identity self.kind = kind self.properties = properties @@ -3191,11 +3319,17 @@ class EndpointDeploymentPropertiesBase(msrest.serialization.Model): """ _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, } def __init__( @@ -3283,26 +3417,41 @@ class BatchDeploymentProperties(EndpointDeploymentPropertiesBase): """ _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'error_threshold': {'key': 'errorThreshold', 'type': 'int'}, - 'logging_level': {'key': 'loggingLevel', 'type': 'str'}, - 'max_concurrency_per_instance': {'key': 'maxConcurrencyPerInstance', 'type': 'int'}, - 'mini_batch_size': {'key': 'miniBatchSize', 'type': 'long'}, - 'model': {'key': 'model', 'type': 'AssetReferenceBase'}, - 'output_action': {'key': 'outputAction', 'type': 'str'}, - 'output_file_name': {'key': 'outputFileName', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'resources': {'key': 'resources', 'type': 'DeploymentResourceConfiguration'}, - 'retry_settings': {'key': 'retrySettings', 'type': 'BatchRetrySettings'}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "compute": {"key": "compute", "type": "str"}, + "error_threshold": {"key": "errorThreshold", "type": "int"}, + "logging_level": {"key": "loggingLevel", "type": "str"}, + "max_concurrency_per_instance": { + "key": "maxConcurrencyPerInstance", + "type": "int", + }, + "mini_batch_size": {"key": "miniBatchSize", "type": "long"}, + "model": {"key": "model", "type": "AssetReferenceBase"}, + "output_action": {"key": "outputAction", "type": "str"}, + "output_file_name": {"key": "outputFileName", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "resources": { + "key": "resources", + "type": "DeploymentResourceConfiguration", + }, + "retry_settings": { + "key": "retrySettings", + "type": "BatchRetrySettings", + }, } def __init__( @@ -3370,7 +3519,14 @@ def __init__( If not provided, will default to the defaults defined in BatchRetrySettings. :paramtype retry_settings: ~azure.mgmt.machinelearningservices.models.BatchRetrySettings """ - super(BatchDeploymentProperties, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, **kwargs) + super(BatchDeploymentProperties, self).__init__( + code_configuration=code_configuration, + description=description, + environment_id=environment_id, + environment_variables=environment_variables, + properties=properties, + **kwargs + ) self.compute = compute self.error_threshold = error_threshold self.logging_level = logging_level @@ -3384,7 +3540,9 @@ def __init__( self.retry_settings = retry_settings -class BatchDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class BatchDeploymentTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of BatchDeployment entities. :ivar next_link: The link to the next page of BatchDeployment objects. If null, there are no @@ -3395,8 +3553,8 @@ class BatchDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Mode """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchDeployment]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[BatchDeployment]"}, } def __init__( @@ -3413,7 +3571,9 @@ def __init__( :keyword value: An array of objects of type BatchDeployment. :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchDeployment] """ - super(BatchDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) + super(BatchDeploymentTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -3452,25 +3612,25 @@ class BatchEndpoint(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": {"key": "properties", "type": "BatchEndpointProperties"}, + "sku": {"key": "sku", "type": "Sku"}, } def __init__( @@ -3499,7 +3659,9 @@ def __init__( :keyword sku: Sku details required for ARM contract for Autoscaling. :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ - super(BatchEndpoint, self).__init__(tags=tags, location=location, **kwargs) + super(BatchEndpoint, self).__init__( + tags=tags, location=location, **kwargs + ) self.identity = identity self.kind = kind self.properties = properties @@ -3515,15 +3677,10 @@ class BatchEndpointDefaults(msrest.serialization.Model): """ _attribute_map = { - 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, + "deployment_name": {"key": "deploymentName", "type": "str"}, } - def __init__( - self, - *, - deployment_name: Optional[str] = None, - **kwargs - ): + def __init__(self, *, deployment_name: Optional[str] = None, **kwargs): """ :keyword deployment_name: Name of the deployment that will be default for the endpoint. This deployment will end up getting 100% traffic when the endpoint scoring URL is invoked. @@ -3559,18 +3716,18 @@ class EndpointPropertiesBase(msrest.serialization.Model): """ _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, + "auth_mode": {"required": True}, + "scoring_uri": {"readonly": True}, + "swagger_uri": {"readonly": True}, } _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, + "auth_mode": {"key": "authMode", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "keys": {"key": "keys", "type": "EndpointAuthKeys"}, + "properties": {"key": "properties", "type": "{str}"}, + "scoring_uri": {"key": "scoringUri", "type": "str"}, + "swagger_uri": {"key": "swaggerUri", "type": "str"}, } def __init__( @@ -3637,21 +3794,21 @@ class BatchEndpointProperties(EndpointPropertiesBase): """ _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "auth_mode": {"required": True}, + "scoring_uri": {"readonly": True}, + "swagger_uri": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'defaults': {'key': 'defaults', 'type': 'BatchEndpointDefaults'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "auth_mode": {"key": "authMode", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "keys": {"key": "keys", "type": "EndpointAuthKeys"}, + "properties": {"key": "properties", "type": "{str}"}, + "scoring_uri": {"key": "scoringUri", "type": "str"}, + "swagger_uri": {"key": "swaggerUri", "type": "str"}, + "defaults": {"key": "defaults", "type": "BatchEndpointDefaults"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } def __init__( @@ -3680,12 +3837,20 @@ def __init__( :keyword defaults: Default values for Batch Endpoint. :paramtype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults """ - super(BatchEndpointProperties, self).__init__(auth_mode=auth_mode, description=description, keys=keys, properties=properties, **kwargs) + super(BatchEndpointProperties, self).__init__( + auth_mode=auth_mode, + description=description, + keys=keys, + properties=properties, + **kwargs + ) self.defaults = defaults self.provisioning_state = None -class BatchEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class BatchEndpointTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of BatchEndpoint entities. :ivar next_link: The link to the next page of BatchEndpoint objects. If null, there are no @@ -3696,8 +3861,8 @@ class BatchEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model) """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchEndpoint]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[BatchEndpoint]"}, } def __init__( @@ -3714,7 +3879,9 @@ def __init__( :keyword value: An array of objects of type BatchEndpoint. :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchEndpoint] """ - super(BatchEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) + super(BatchEndpointTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -3729,8 +3896,8 @@ class BatchRetrySettings(msrest.serialization.Model): """ _attribute_map = { - 'max_retries': {'key': 'maxRetries', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "max_retries": {"key": "maxRetries", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } def __init__( @@ -3753,38 +3920,41 @@ def __init__( class SamplingAlgorithm(msrest.serialization.Model): """The Sampling Algorithm used to generate hyperparameter values, along with properties to -configure the algorithm. + configure the algorithm. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BayesianSamplingAlgorithm, GridSamplingAlgorithm, RandomSamplingAlgorithm. + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: BayesianSamplingAlgorithm, GridSamplingAlgorithm, RandomSamplingAlgorithm. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType + :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating + hyperparameter values, along with configuration properties.Constant filled by server. Possible + values include: "Grid", "Random", "Bayesian". + :vartype sampling_algorithm_type: str or + ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } _subtype_map = { - 'sampling_algorithm_type': {'Bayesian': 'BayesianSamplingAlgorithm', 'Grid': 'GridSamplingAlgorithm', 'Random': 'RandomSamplingAlgorithm'} + "sampling_algorithm_type": { + "Bayesian": "BayesianSamplingAlgorithm", + "Grid": "GridSamplingAlgorithm", + "Random": "RandomSamplingAlgorithm", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(SamplingAlgorithm, self).__init__(**kwargs) self.sampling_algorithm_type = None # type: Optional[str] @@ -3802,21 +3972,20 @@ class BayesianSamplingAlgorithm(SamplingAlgorithm): """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(BayesianSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Bayesian' # type: str + self.sampling_algorithm_type = "Bayesian" # type: str class BindOptions(msrest.serialization.Model): @@ -3831,9 +4000,9 @@ class BindOptions(msrest.serialization.Model): """ _attribute_map = { - 'propagation': {'key': 'propagation', 'type': 'str'}, - 'create_host_path': {'key': 'createHostPath', 'type': 'bool'}, - 'selinux': {'key': 'selinux', 'type': 'str'}, + "propagation": {"key": "propagation", "type": "str"}, + "create_host_path": {"key": "createHostPath", "type": "bool"}, + "selinux": {"key": "selinux", "type": "str"}, } def __init__( @@ -3871,9 +4040,15 @@ class BlobReferenceForConsumptionDto(msrest.serialization.Model): """ _attribute_map = { - 'blob_uri': {'key': 'blobUri', 'type': 'str'}, - 'credential': {'key': 'credential', 'type': 'PendingUploadCredentialDto'}, - 'storage_account_arm_id': {'key': 'storageAccountArmId', 'type': 'str'}, + "blob_uri": {"key": "blobUri", "type": "str"}, + "credential": { + "key": "credential", + "type": "PendingUploadCredentialDto", + }, + "storage_account_arm_id": { + "key": "storageAccountArmId", + "type": "str", + }, } def __init__( @@ -3906,29 +4081,33 @@ class BuildContext(msrest.serialization.Model): :ivar context_uri: Required. [Required] URI of the Docker build context used to build the image. Supports blob URIs on environment creation and may return blob or Git URIs. - - + + .. raw:: html - + . :vartype context_uri: str :ivar dockerfile_path: Path to the Dockerfile in the build context. - - + + .. raw:: html - + . :vartype dockerfile_path: str """ _validation = { - 'context_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "context_uri": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'context_uri': {'key': 'contextUri', 'type': 'str'}, - 'dockerfile_path': {'key': 'dockerfilePath', 'type': 'str'}, + "context_uri": {"key": "contextUri", "type": "str"}, + "dockerfile_path": {"key": "dockerfilePath", "type": "str"}, } def __init__( @@ -3941,18 +4120,18 @@ def __init__( """ :keyword context_uri: Required. [Required] URI of the Docker build context used to build the image. Supports blob URIs on environment creation and may return blob or Git URIs. - - + + .. raw:: html - + . :paramtype context_uri: str :keyword dockerfile_path: Path to the Dockerfile in the build context. - - + + .. raw:: html - + . :paramtype dockerfile_path: str """ @@ -3985,21 +4164,25 @@ class CertificateDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, - 'thumbprint': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials_type": {"required": True}, + "client_id": {"required": True}, + "secrets": {"required": True}, + "tenant_id": {"required": True}, + "thumbprint": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'CertificateDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "authority_url": {"key": "authorityUrl", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + "resource_url": {"key": "resourceUrl", "type": "str"}, + "secrets": {"key": "secrets", "type": "CertificateDatastoreSecrets"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "thumbprint": {"key": "thumbprint", "type": "str"}, } def __init__( @@ -4030,7 +4213,7 @@ def __init__( :paramtype thumbprint: str """ super(CertificateDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Certificate' # type: str + self.credentials_type = "Certificate" # type: str self.authority_url = authority_url self.client_id = client_id self.resource_url = resource_url @@ -4053,26 +4236,21 @@ class CertificateDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'certificate': {'key': 'certificate', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "certificate": {"key": "certificate", "type": "str"}, } - def __init__( - self, - *, - certificate: Optional[str] = None, - **kwargs - ): + def __init__(self, *, certificate: Optional[str] = None, **kwargs): """ :keyword certificate: Service principal certificate. :paramtype certificate: str """ super(CertificateDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Certificate' # type: str + self.secrets_type = "Certificate" # type: str self.certificate = certificate @@ -4109,22 +4287,39 @@ class TableVertical(msrest.serialization.Model): """ _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "test_data": {"key": "testData", "type": "MLTableJobInput"}, + "test_data_size": {"key": "testDataSize", "type": "float"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "weight_column_name": {"key": "weightColumnName", "type": "str"}, } def __init__( self, *, cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "TableVerticalFeaturizationSettings" + ] = None, limit_settings: Optional["TableVerticalLimitSettings"] = None, n_cross_validations: Optional["NCrossValidations"] = None, test_data: Optional["MLTableJobInput"] = None, @@ -4234,27 +4429,45 @@ class Classification(AutoMLVertical, TableVertical): """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'positive_label': {'key': 'positiveLabel', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'ClassificationTrainingSettings'}, + "task_type": {"required": True}, + "training_data": {"required": True}, + } + + _attribute_map = { + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "test_data": {"key": "testData", "type": "MLTableJobInput"}, + "test_data_size": {"key": "testDataSize", "type": "float"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "weight_column_name": {"key": "weightColumnName", "type": "str"}, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "positive_label": {"key": "positiveLabel", "type": "str"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, + "training_settings": { + "key": "trainingSettings", + "type": "ClassificationTrainingSettings", + }, } def __init__( @@ -4262,7 +4475,9 @@ def __init__( *, training_data: "MLTableJobInput", cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "TableVerticalFeaturizationSettings" + ] = None, limit_settings: Optional["TableVerticalLimitSettings"] = None, n_cross_validations: Optional["NCrossValidations"] = None, test_data: Optional["MLTableJobInput"] = None, @@ -4273,7 +4488,9 @@ def __init__( log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, positive_label: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "ClassificationPrimaryMetrics"] + ] = None, training_settings: Optional["ClassificationTrainingSettings"] = None, **kwargs ): @@ -4325,7 +4542,21 @@ def __init__( :paramtype training_settings: ~azure.mgmt.machinelearningservices.models.ClassificationTrainingSettings """ - super(Classification, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, cv_split_column_names=cv_split_column_names, featurization_settings=featurization_settings, limit_settings=limit_settings, n_cross_validations=n_cross_validations, test_data=test_data, test_data_size=test_data_size, validation_data=validation_data, validation_data_size=validation_data_size, weight_column_name=weight_column_name, **kwargs) + super(Classification, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + cv_split_column_names=cv_split_column_names, + featurization_settings=featurization_settings, + limit_settings=limit_settings, + n_cross_validations=n_cross_validations, + test_data=test_data, + test_data_size=test_data_size, + validation_data=validation_data, + validation_data_size=validation_data_size, + weight_column_name=weight_column_name, + **kwargs + ) self.cv_split_column_names = cv_split_column_names self.featurization_settings = featurization_settings self.limit_settings = limit_settings @@ -4335,7 +4566,7 @@ def __init__( self.validation_data = validation_data self.validation_data_size = validation_data_size self.weight_column_name = weight_column_name - self.task_type = 'Classification' # type: str + self.task_type = "Classification" # type: str self.positive_label = positive_label self.primary_metric = primary_metric self.training_settings = training_settings @@ -4367,13 +4598,28 @@ class TrainingSettings(msrest.serialization.Model): """ _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, + "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, + "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, } def __init__( @@ -4446,15 +4692,36 @@ class ClassificationTrainingSettings(TrainingSettings): """ _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, + "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, + "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, + "allowed_training_algorithms": { + "key": "allowedTrainingAlgorithms", + "type": "[str]", + }, + "blocked_training_algorithms": { + "key": "blockedTrainingAlgorithms", + "type": "[str]", + }, } def __init__( @@ -4467,8 +4734,12 @@ def __init__( enable_vote_ensemble: Optional[bool] = True, ensemble_model_download_timeout: Optional[datetime.timedelta] = "PT5M", stack_ensemble_settings: Optional["StackEnsembleSettings"] = None, - allowed_training_algorithms: Optional[List[Union[str, "ClassificationModels"]]] = None, - blocked_training_algorithms: Optional[List[Union[str, "ClassificationModels"]]] = None, + allowed_training_algorithms: Optional[ + List[Union[str, "ClassificationModels"]] + ] = None, + blocked_training_algorithms: Optional[ + List[Union[str, "ClassificationModels"]] + ] = None, **kwargs ): """ @@ -4496,7 +4767,16 @@ def __init__( :paramtype blocked_training_algorithms: list[str or ~azure.mgmt.machinelearningservices.models.ClassificationModels] """ - super(ClassificationTrainingSettings, self).__init__(enable_dnn_training=enable_dnn_training, enable_model_explainability=enable_model_explainability, enable_onnx_compatible_models=enable_onnx_compatible_models, enable_stack_ensemble=enable_stack_ensemble, enable_vote_ensemble=enable_vote_ensemble, ensemble_model_download_timeout=ensemble_model_download_timeout, stack_ensemble_settings=stack_ensemble_settings, **kwargs) + super(ClassificationTrainingSettings, self).__init__( + enable_dnn_training=enable_dnn_training, + enable_model_explainability=enable_model_explainability, + enable_onnx_compatible_models=enable_onnx_compatible_models, + enable_stack_ensemble=enable_stack_ensemble, + enable_vote_ensemble=enable_vote_ensemble, + ensemble_model_download_timeout=ensemble_model_download_timeout, + stack_ensemble_settings=stack_ensemble_settings, + **kwargs + ) self.allowed_training_algorithms = allowed_training_algorithms self.blocked_training_algorithms = blocked_training_algorithms @@ -4509,7 +4789,10 @@ class ClusterUpdateParameters(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties.properties', 'type': 'ScaleSettingsInformation'}, + "properties": { + "key": "properties.properties", + "type": "ScaleSettingsInformation", + }, } def __init__( @@ -4538,20 +4821,20 @@ class CodeConfiguration(msrest.serialization.Model): """ _validation = { - 'scoring_script': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "scoring_script": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'scoring_script': {'key': 'scoringScript', 'type': 'str'}, + "code_id": {"key": "codeId", "type": "str"}, + "scoring_script": {"key": "scoringScript", "type": "str"}, } def __init__( - self, - *, - scoring_script: str, - code_id: Optional[str] = None, - **kwargs + self, *, scoring_script: str, code_id: Optional[str] = None, **kwargs ): """ :keyword code_id: ARM resource ID of the code asset. @@ -4587,27 +4870,22 @@ class CodeContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "CodeContainerProperties"}, } - def __init__( - self, - *, - properties: "CodeContainerProperties", - **kwargs - ): + def __init__(self, *, properties: "CodeContainerProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeContainerProperties @@ -4640,19 +4918,19 @@ class CodeContainerProperties(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } def __init__( @@ -4674,7 +4952,13 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(CodeContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) + super(CodeContainerProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs + ) self.provisioning_state = None @@ -4689,8 +4973,8 @@ class CodeContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[CodeContainer]"}, } def __init__( @@ -4735,27 +5019,22 @@ class CodeVersion(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeVersionProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "CodeVersionProperties"}, } - def __init__( - self, - *, - properties: "CodeVersionProperties", - **kwargs - ): + def __init__(self, *, properties: "CodeVersionProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeVersionProperties @@ -4788,17 +5067,17 @@ class CodeVersionProperties(AssetBase): """ _validation = { - 'provisioning_state': {'readonly': True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'code_uri': {'key': 'codeUri', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "code_uri": {"key": "codeUri", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } def __init__( @@ -4826,7 +5105,14 @@ def __init__( :keyword code_uri: Uri where code is located. :paramtype code_uri: str """ - super(CodeVersionProperties, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) + super(CodeVersionProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + **kwargs + ) self.code_uri = code_uri self.provisioning_state = None @@ -4842,8 +5128,8 @@ class CodeVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeVersion]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[CodeVersion]"}, } def __init__( @@ -4876,8 +5162,8 @@ class ColumnTransformer(msrest.serialization.Model): """ _attribute_map = { - 'fields': {'key': 'fields', 'type': '[str]'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, + "fields": {"key": "fields", "type": "[str]"}, + "parameters": {"key": "parameters", "type": "object"}, } def __init__( @@ -4963,36 +5249,50 @@ class CommandJob(JobBaseProperties): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'parameters': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'CommandJobLimits'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, + "job_type": {"required": True}, + "status": {"readonly": True}, + "command": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "environment_id": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "parameters": {"readonly": True}, + } + + _attribute_map = { + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "code_id": {"key": "codeId", "type": "str"}, + "command": {"key": "command", "type": "str"}, + "distribution": { + "key": "distribution", + "type": "DistributionConfiguration", + }, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "limits": {"key": "limits", "type": "CommandJobLimits"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "parameters": {"key": "parameters", "type": "object"}, + "resources": {"key": "resources", "type": "JobResourceConfiguration"}, } def __init__( @@ -5066,8 +5366,20 @@ def __init__( :keyword resources: Compute Resource configuration for the job. :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration """ - super(CommandJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, services=services, **kwargs) - self.job_type = 'Command' # type: str + super(CommandJob, self).__init__( + description=description, + properties=properties, + tags=tags, + component_id=component_id, + compute_id=compute_id, + display_name=display_name, + experiment_name=experiment_name, + identity=identity, + is_archived=is_archived, + services=services, + **kwargs + ) + self.job_type = "Command" # type: str self.code_id = code_id self.command = command self.distribution = distribution @@ -5097,23 +5409,23 @@ class JobLimits(msrest.serialization.Model): """ _validation = { - 'job_limits_type': {'required': True}, + "job_limits_type": {"required": True}, } _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "job_limits_type": {"key": "jobLimitsType", "type": "str"}, + "timeout": {"key": "timeout", "type": "duration"}, } _subtype_map = { - 'job_limits_type': {'Command': 'CommandJobLimits', 'Sweep': 'SweepJobLimits'} + "job_limits_type": { + "Command": "CommandJobLimits", + "Sweep": "SweepJobLimits", + } } def __init__( - self, - *, - timeout: Optional[datetime.timedelta] = None, - **kwargs + self, *, timeout: Optional[datetime.timedelta] = None, **kwargs ): """ :keyword timeout: The max run duration in ISO 8601 format, after which the job will be @@ -5139,19 +5451,16 @@ class CommandJobLimits(JobLimits): """ _validation = { - 'job_limits_type': {'required': True}, + "job_limits_type": {"required": True}, } _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "job_limits_type": {"key": "jobLimitsType", "type": "str"}, + "timeout": {"key": "timeout", "type": "duration"}, } def __init__( - self, - *, - timeout: Optional[datetime.timedelta] = None, - **kwargs + self, *, timeout: Optional[datetime.timedelta] = None, **kwargs ): """ :keyword timeout: The max run duration in ISO 8601 format, after which the job will be @@ -5159,7 +5468,7 @@ def __init__( :paramtype timeout: ~datetime.timedelta """ super(CommandJobLimits, self).__init__(timeout=timeout, **kwargs) - self.job_limits_type = 'Command' # type: str + self.job_limits_type = "Command" # type: str class ComponentContainer(Resource): @@ -5185,26 +5494,26 @@ class ComponentContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "ComponentContainerProperties", + }, } def __init__( - self, - *, - properties: "ComponentContainerProperties", - **kwargs + self, *, properties: "ComponentContainerProperties", **kwargs ): """ :keyword properties: Required. [Required] Additional attributes of the entity. @@ -5218,44 +5527,44 @@ class ComponentContainerProperties(AssetContainer): """Component container definition. -.. raw:: html + .. raw:: html - . + . - Variables are only populated by the server, and will be ignored when sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the component container. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState + :ivar description: The asset description text. + :vartype description: str + :ivar properties: The asset property dictionary. + :vartype properties: dict[str, str] + :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + :ivar is_archived: Is the asset archived?. + :vartype is_archived: bool + :ivar latest_version: The latest version inside this container. + :vartype latest_version: str + :ivar next_version: The next auto incremental version. + :vartype next_version: str + :ivar provisioning_state: Provisioning state for the component container. Possible values + include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.machinelearningservices.models.AssetProvisioningState """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } def __init__( @@ -5277,7 +5586,13 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(ComponentContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) + super(ComponentContainerProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs + ) self.provisioning_state = None @@ -5292,8 +5607,8 @@ class ComponentContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ComponentContainer]"}, } def __init__( @@ -5310,7 +5625,9 @@ def __init__( :keyword value: An array of objects of type ComponentContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainer] """ - super(ComponentContainerResourceArmPaginatedResult, self).__init__(**kwargs) + super(ComponentContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -5338,27 +5655,25 @@ class ComponentVersion(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentVersionProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "ComponentVersionProperties", + }, } - def __init__( - self, - *, - properties: "ComponentVersionProperties", - **kwargs - ): + def __init__(self, *, properties: "ComponentVersionProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentVersionProperties @@ -5383,10 +5698,10 @@ class ComponentVersionProperties(AssetBase): :ivar is_archived: Is the asset archived?. :vartype is_archived: bool :ivar component_spec: Defines Component definition details. - - + + .. raw:: html - + . @@ -5398,17 +5713,17 @@ class ComponentVersionProperties(AssetBase): """ _validation = { - 'provisioning_state': {'readonly': True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'component_spec': {'key': 'componentSpec', 'type': 'object'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "component_spec": {"key": "componentSpec", "type": "object"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } def __init__( @@ -5434,16 +5749,23 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool :keyword component_spec: Defines Component definition details. - - + + .. raw:: html - + . :paramtype component_spec: any """ - super(ComponentVersionProperties, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) + super(ComponentVersionProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + **kwargs + ) self.component_spec = component_spec self.provisioning_state = None @@ -5459,8 +5781,8 @@ class ComponentVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentVersion]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ComponentVersion]"}, } def __init__( @@ -5477,7 +5799,9 @@ def __init__( :keyword value: An array of objects of type ComponentVersion. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersion] """ - super(ComponentVersionResourceArmPaginatedResult, self).__init__(**kwargs) + super(ComponentVersionResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -5490,7 +5814,10 @@ class ComputeInstanceSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, + "properties": { + "key": "properties", + "type": "ComputeInstanceProperties", + }, } def __init__( @@ -5546,26 +5873,32 @@ class ComputeInstance(Compute, ComputeInstanceSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": { + "key": "properties", + "type": "ComputeInstanceProperties", + }, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -5591,9 +5924,16 @@ def __init__( MSI and AAD exclusively for authentication. :paramtype disable_local_auth: bool """ - super(ComputeInstance, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) + super(ComputeInstance, self).__init__( + compute_location=compute_location, + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'ComputeInstance' # type: str + self.compute_type = "ComputeInstance" # type: str self.compute_location = compute_location self.provisioning_state = None self.description = description @@ -5615,8 +5955,8 @@ class ComputeInstanceApplication(msrest.serialization.Model): """ _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, + "display_name": {"key": "displayName", "type": "str"}, + "endpoint_uri": {"key": "endpointUri", "type": "str"}, } def __init__( @@ -5650,21 +5990,17 @@ class ComputeInstanceConnectivityEndpoints(msrest.serialization.Model): """ _validation = { - 'public_ip_address': {'readonly': True}, - 'private_ip_address': {'readonly': True}, + "public_ip_address": {"readonly": True}, + "private_ip_address": {"readonly": True}, } _attribute_map = { - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + "public_ip_address": {"key": "publicIpAddress", "type": "str"}, + "private_ip_address": {"key": "privateIpAddress", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ComputeInstanceConnectivityEndpoints, self).__init__(**kwargs) self.public_ip_address = None self.private_ip_address = None @@ -5690,16 +6026,19 @@ class ComputeInstanceContainer(msrest.serialization.Model): """ _validation = { - 'services': {'readonly': True}, + "services": {"readonly": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'autosave': {'key': 'autosave', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'network': {'key': 'network', 'type': 'str'}, - 'environment': {'key': 'environment', 'type': 'ComputeInstanceEnvironmentInfo'}, - 'services': {'key': 'services', 'type': '[object]'}, + "name": {"key": "name", "type": "str"}, + "autosave": {"key": "autosave", "type": "str"}, + "gpu": {"key": "gpu", "type": "str"}, + "network": {"key": "network", "type": "str"}, + "environment": { + "key": "environment", + "type": "ComputeInstanceEnvironmentInfo", + }, + "services": {"key": "services", "type": "[object]"}, } def __init__( @@ -5748,23 +6087,19 @@ class ComputeInstanceCreatedBy(msrest.serialization.Model): """ _validation = { - 'user_name': {'readonly': True}, - 'user_org_id': {'readonly': True}, - 'user_id': {'readonly': True}, + "user_name": {"readonly": True}, + "user_org_id": {"readonly": True}, + "user_id": {"readonly": True}, } _attribute_map = { - 'user_name': {'key': 'userName', 'type': 'str'}, - 'user_org_id': {'key': 'userOrgId', 'type': 'str'}, - 'user_id': {'key': 'userId', 'type': 'str'}, + "user_name": {"key": "userName", "type": "str"}, + "user_org_id": {"key": "userOrgId", "type": "str"}, + "user_id": {"key": "userId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ComputeInstanceCreatedBy, self).__init__(**kwargs) self.user_name = None self.user_org_id = None @@ -5789,10 +6124,10 @@ class ComputeInstanceDataDisk(msrest.serialization.Model): """ _attribute_map = { - 'caching': {'key': 'caching', 'type': 'str'}, - 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, - 'lun': {'key': 'lun', 'type': 'int'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + "caching": {"key": "caching", "type": "str"}, + "disk_size_gb": {"key": "diskSizeGB", "type": "int"}, + "lun": {"key": "lun", "type": "int"}, + "storage_account_type": {"key": "storageAccountType", "type": "str"}, } def __init__( @@ -5801,7 +6136,9 @@ def __init__( caching: Optional[Union[str, "Caching"]] = None, disk_size_gb: Optional[int] = None, lun: Optional[int] = None, - storage_account_type: Optional[Union[str, "StorageAccountType"]] = "Standard_LRS", + storage_account_type: Optional[ + Union[str, "StorageAccountType"] + ] = "Standard_LRS", **kwargs ): """ @@ -5850,15 +6187,15 @@ class ComputeInstanceDataMount(msrest.serialization.Model): """ _attribute_map = { - 'source': {'key': 'source', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'mount_name': {'key': 'mountName', 'type': 'str'}, - 'mount_action': {'key': 'mountAction', 'type': 'str'}, - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - 'mount_state': {'key': 'mountState', 'type': 'str'}, - 'mounted_on': {'key': 'mountedOn', 'type': 'iso-8601'}, - 'error': {'key': 'error', 'type': 'str'}, + "source": {"key": "source", "type": "str"}, + "source_type": {"key": "sourceType", "type": "str"}, + "mount_name": {"key": "mountName", "type": "str"}, + "mount_action": {"key": "mountAction", "type": "str"}, + "created_by": {"key": "createdBy", "type": "str"}, + "mount_path": {"key": "mountPath", "type": "str"}, + "mount_state": {"key": "mountState", "type": "str"}, + "mounted_on": {"key": "mountedOn", "type": "iso-8601"}, + "error": {"key": "error", "type": "str"}, } def __init__( @@ -5918,8 +6255,8 @@ class ComputeInstanceEnvironmentInfo(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "version": {"key": "version", "type": "str"}, } def __init__( @@ -5957,10 +6294,10 @@ class ComputeInstanceLastOperation(msrest.serialization.Model): """ _attribute_map = { - 'operation_name': {'key': 'operationName', 'type': 'str'}, - 'operation_time': {'key': 'operationTime', 'type': 'iso-8601'}, - 'operation_status': {'key': 'operationStatus', 'type': 'str'}, - 'operation_trigger': {'key': 'operationTrigger', 'type': 'str'}, + "operation_name": {"key": "operationName", "type": "str"}, + "operation_time": {"key": "operationTime", "type": "iso-8601"}, + "operation_status": {"key": "operationStatus", "type": "str"}, + "operation_trigger": {"key": "operationTrigger", "type": "str"}, } def __init__( @@ -6063,41 +6400,77 @@ class ComputeInstanceProperties(msrest.serialization.Model): """ _validation = { - 'os_image_metadata': {'readonly': True}, - 'connectivity_endpoints': {'readonly': True}, - 'applications': {'readonly': True}, - 'created_by': {'readonly': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'last_operation': {'readonly': True}, - 'containers': {'readonly': True}, - 'data_disks': {'readonly': True}, - 'data_mounts': {'readonly': True}, - 'versions': {'readonly': True}, - } - - _attribute_map = { - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'application_sharing_policy': {'key': 'applicationSharingPolicy', 'type': 'str'}, - 'ssh_settings': {'key': 'sshSettings', 'type': 'ComputeInstanceSshSettings'}, - 'custom_services': {'key': 'customServices', 'type': '[CustomService]'}, - 'os_image_metadata': {'key': 'osImageMetadata', 'type': 'ImageMetadata'}, - 'connectivity_endpoints': {'key': 'connectivityEndpoints', 'type': 'ComputeInstanceConnectivityEndpoints'}, - 'applications': {'key': 'applications', 'type': '[ComputeInstanceApplication]'}, - 'created_by': {'key': 'createdBy', 'type': 'ComputeInstanceCreatedBy'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'compute_instance_authorization_type': {'key': 'computeInstanceAuthorizationType', 'type': 'str'}, - 'personal_compute_instance_settings': {'key': 'personalComputeInstanceSettings', 'type': 'PersonalComputeInstanceSettings'}, - 'setup_scripts': {'key': 'setupScripts', 'type': 'SetupScripts'}, - 'last_operation': {'key': 'lastOperation', 'type': 'ComputeInstanceLastOperation'}, - 'schedules': {'key': 'schedules', 'type': 'ComputeSchedules'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'containers': {'key': 'containers', 'type': '[ComputeInstanceContainer]'}, - 'data_disks': {'key': 'dataDisks', 'type': '[ComputeInstanceDataDisk]'}, - 'data_mounts': {'key': 'dataMounts', 'type': '[ComputeInstanceDataMount]'}, - 'versions': {'key': 'versions', 'type': 'ComputeInstanceVersion'}, + "os_image_metadata": {"readonly": True}, + "connectivity_endpoints": {"readonly": True}, + "applications": {"readonly": True}, + "created_by": {"readonly": True}, + "errors": {"readonly": True}, + "state": {"readonly": True}, + "last_operation": {"readonly": True}, + "containers": {"readonly": True}, + "data_disks": {"readonly": True}, + "data_mounts": {"readonly": True}, + "versions": {"readonly": True}, + } + + _attribute_map = { + "vm_size": {"key": "vmSize", "type": "str"}, + "subnet": {"key": "subnet", "type": "ResourceId"}, + "application_sharing_policy": { + "key": "applicationSharingPolicy", + "type": "str", + }, + "ssh_settings": { + "key": "sshSettings", + "type": "ComputeInstanceSshSettings", + }, + "custom_services": { + "key": "customServices", + "type": "[CustomService]", + }, + "os_image_metadata": { + "key": "osImageMetadata", + "type": "ImageMetadata", + }, + "connectivity_endpoints": { + "key": "connectivityEndpoints", + "type": "ComputeInstanceConnectivityEndpoints", + }, + "applications": { + "key": "applications", + "type": "[ComputeInstanceApplication]", + }, + "created_by": {"key": "createdBy", "type": "ComputeInstanceCreatedBy"}, + "errors": {"key": "errors", "type": "[ErrorResponse]"}, + "state": {"key": "state", "type": "str"}, + "compute_instance_authorization_type": { + "key": "computeInstanceAuthorizationType", + "type": "str", + }, + "personal_compute_instance_settings": { + "key": "personalComputeInstanceSettings", + "type": "PersonalComputeInstanceSettings", + }, + "setup_scripts": {"key": "setupScripts", "type": "SetupScripts"}, + "last_operation": { + "key": "lastOperation", + "type": "ComputeInstanceLastOperation", + }, + "schedules": {"key": "schedules", "type": "ComputeSchedules"}, + "enable_node_public_ip": {"key": "enableNodePublicIp", "type": "bool"}, + "containers": { + "key": "containers", + "type": "[ComputeInstanceContainer]", + }, + "data_disks": { + "key": "dataDisks", + "type": "[ComputeInstanceDataDisk]", + }, + "data_mounts": { + "key": "dataMounts", + "type": "[ComputeInstanceDataMount]", + }, + "versions": {"key": "versions", "type": "ComputeInstanceVersion"}, } def __init__( @@ -6105,11 +6478,17 @@ def __init__( *, vm_size: Optional[str] = None, subnet: Optional["ResourceId"] = None, - application_sharing_policy: Optional[Union[str, "ApplicationSharingPolicy"]] = "Shared", + application_sharing_policy: Optional[ + Union[str, "ApplicationSharingPolicy"] + ] = "Shared", ssh_settings: Optional["ComputeInstanceSshSettings"] = None, custom_services: Optional[List["CustomService"]] = None, - compute_instance_authorization_type: Optional[Union[str, "ComputeInstanceAuthorizationType"]] = "personal", - personal_compute_instance_settings: Optional["PersonalComputeInstanceSettings"] = None, + compute_instance_authorization_type: Optional[ + Union[str, "ComputeInstanceAuthorizationType"] + ] = "personal", + personal_compute_instance_settings: Optional[ + "PersonalComputeInstanceSettings" + ] = None, setup_scripts: Optional["SetupScripts"] = None, schedules: Optional["ComputeSchedules"] = None, enable_node_public_ip: Optional[bool] = None, @@ -6161,8 +6540,12 @@ def __init__( self.created_by = None self.errors = None self.state = None - self.compute_instance_authorization_type = compute_instance_authorization_type - self.personal_compute_instance_settings = personal_compute_instance_settings + self.compute_instance_authorization_type = ( + compute_instance_authorization_type + ) + self.personal_compute_instance_settings = ( + personal_compute_instance_settings + ) self.setup_scripts = setup_scripts self.last_operation = None self.schedules = schedules @@ -6193,21 +6576,23 @@ class ComputeInstanceSshSettings(msrest.serialization.Model): """ _validation = { - 'admin_user_name': {'readonly': True}, - 'ssh_port': {'readonly': True}, + "admin_user_name": {"readonly": True}, + "ssh_port": {"readonly": True}, } _attribute_map = { - 'ssh_public_access': {'key': 'sshPublicAccess', 'type': 'str'}, - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'admin_public_key': {'key': 'adminPublicKey', 'type': 'str'}, + "ssh_public_access": {"key": "sshPublicAccess", "type": "str"}, + "admin_user_name": {"key": "adminUserName", "type": "str"}, + "ssh_port": {"key": "sshPort", "type": "int"}, + "admin_public_key": {"key": "adminPublicKey", "type": "str"}, } def __init__( self, *, - ssh_public_access: Optional[Union[str, "SshPublicAccess"]] = "Disabled", + ssh_public_access: Optional[ + Union[str, "SshPublicAccess"] + ] = "Disabled", admin_public_key: Optional[str] = None, **kwargs ): @@ -6236,15 +6621,10 @@ class ComputeInstanceVersion(msrest.serialization.Model): """ _attribute_map = { - 'runtime': {'key': 'runtime', 'type': 'str'}, + "runtime": {"key": "runtime", "type": "str"}, } - def __init__( - self, - *, - runtime: Optional[str] = None, - **kwargs - ): + def __init__(self, *, runtime: Optional[str] = None, **kwargs): """ :keyword runtime: Runtime of compute instance. :paramtype runtime: str @@ -6261,15 +6641,10 @@ class ComputeResourceSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, + "properties": {"key": "properties", "type": "Compute"}, } - def __init__( - self, - *, - properties: Optional["Compute"] = None, - **kwargs - ): + def __init__(self, *, properties: Optional["Compute"] = None, **kwargs): """ :keyword properties: Compute properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute @@ -6307,22 +6682,22 @@ class ComputeResource(Resource, ComputeResourceSchema): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "properties": {"key": "properties", "type": "Compute"}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, } def __init__( @@ -6368,7 +6743,10 @@ class ComputeSchedules(msrest.serialization.Model): """ _attribute_map = { - 'compute_start_stop': {'key': 'computeStartStop', 'type': '[ComputeStartStopSchedule]'}, + "compute_start_stop": { + "key": "computeStartStop", + "type": "[ComputeStartStopSchedule]", + }, } def __init__( @@ -6414,19 +6792,19 @@ class ComputeStartStopSchedule(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'provisioning_status': {'readonly': True}, + "id": {"readonly": True}, + "provisioning_status": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'recurrence': {'key': 'recurrence', 'type': 'Recurrence'}, - 'cron': {'key': 'cron', 'type': 'Cron'}, - 'schedule': {'key': 'schedule', 'type': 'ScheduleBase'}, + "id": {"key": "id", "type": "str"}, + "provisioning_status": {"key": "provisioningStatus", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "action": {"key": "action", "type": "str"}, + "trigger_type": {"key": "triggerType", "type": "str"}, + "recurrence": {"key": "recurrence", "type": "Recurrence"}, + "cron": {"key": "cron", "type": "Cron"}, + "schedule": {"key": "schedule", "type": "ScheduleBase"}, } def __init__( @@ -6479,15 +6857,25 @@ class ContainerResourceRequirements(msrest.serialization.Model): """ _attribute_map = { - 'container_resource_limits': {'key': 'containerResourceLimits', 'type': 'ContainerResourceSettings'}, - 'container_resource_requests': {'key': 'containerResourceRequests', 'type': 'ContainerResourceSettings'}, + "container_resource_limits": { + "key": "containerResourceLimits", + "type": "ContainerResourceSettings", + }, + "container_resource_requests": { + "key": "containerResourceRequests", + "type": "ContainerResourceSettings", + }, } def __init__( self, *, - container_resource_limits: Optional["ContainerResourceSettings"] = None, - container_resource_requests: Optional["ContainerResourceSettings"] = None, + container_resource_limits: Optional[ + "ContainerResourceSettings" + ] = None, + container_resource_requests: Optional[ + "ContainerResourceSettings" + ] = None, **kwargs ): """ @@ -6518,9 +6906,9 @@ class ContainerResourceSettings(msrest.serialization.Model): """ _attribute_map = { - 'cpu': {'key': 'cpu', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'memory': {'key': 'memory', 'type': 'str'}, + "cpu": {"key": "cpu", "type": "str"}, + "gpu": {"key": "gpu", "type": "str"}, + "memory": {"key": "memory", "type": "str"}, } def __init__( @@ -6556,14 +6944,14 @@ class CosmosDbSettings(msrest.serialization.Model): """ _attribute_map = { - 'collections_throughput': {'key': 'collectionsThroughput', 'type': 'int'}, + "collections_throughput": { + "key": "collectionsThroughput", + "type": "int", + }, } def __init__( - self, - *, - collections_throughput: Optional[int] = None, - **kwargs + self, *, collections_throughput: Optional[int] = None, **kwargs ): """ :keyword collections_throughput: The throughput of the collections in cosmosdb database. @@ -6588,9 +6976,9 @@ class Cron(msrest.serialization.Model): """ _attribute_map = { - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, + "start_time": {"key": "startTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "expression": {"key": "expression", "type": "str"}, } def __init__( @@ -6644,18 +7032,21 @@ class TriggerBase(msrest.serialization.Model): """ _validation = { - 'trigger_type': {'required': True}, + "trigger_type": {"required": True}, } _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, + "end_time": {"key": "endTime", "type": "str"}, + "start_time": {"key": "startTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "trigger_type": {"key": "triggerType", "type": "str"}, } _subtype_map = { - 'trigger_type': {'Cron': 'CronTrigger', 'Recurrence': 'RecurrenceTrigger'} + "trigger_type": { + "Cron": "CronTrigger", + "Recurrence": "RecurrenceTrigger", + } } def __init__( @@ -6713,16 +7104,20 @@ class CronTrigger(TriggerBase): """ _validation = { - 'trigger_type': {'required': True}, - 'expression': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "trigger_type": {"required": True}, + "expression": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, + "end_time": {"key": "endTime", "type": "str"}, + "start_time": {"key": "startTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "trigger_type": {"key": "triggerType", "type": "str"}, + "expression": {"key": "expression", "type": "str"}, } def __init__( @@ -6751,8 +7146,13 @@ def __init__( The expression should follow NCronTab format. :paramtype expression: str """ - super(CronTrigger, self).__init__(end_time=end_time, start_time=start_time, time_zone=time_zone, **kwargs) - self.trigger_type = 'Cron' # type: str + super(CronTrigger, self).__init__( + end_time=end_time, + start_time=start_time, + time_zone=time_zone, + **kwargs + ) + self.trigger_type = "Cron" # type: str self.expression = expression @@ -6769,27 +7169,22 @@ class CustomForecastHorizon(ForecastHorizon): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - *, - value: int, - **kwargs - ): + def __init__(self, *, value: int, **kwargs): """ :keyword value: Required. [Required] Forecast horizon value. :paramtype value: int """ super(CustomForecastHorizon, self).__init__(**kwargs) - self.mode = 'Custom' # type: str + self.mode = "Custom" # type: str self.value = value @@ -6810,24 +7205,27 @@ class JobInput(msrest.serialization.Model): """ _validation = { - 'job_input_type': {'required': True}, + "job_input_type": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } _subtype_map = { - 'job_input_type': {'custom_model': 'CustomModelJobInput', 'literal': 'LiteralJobInput', 'mlflow_model': 'MLFlowModelJobInput', 'mltable': 'MLTableJobInput', 'triton_model': 'TritonModelJobInput', 'uri_file': 'UriFileJobInput', 'uri_folder': 'UriFolderJobInput'} + "job_input_type": { + "custom_model": "CustomModelJobInput", + "literal": "LiteralJobInput", + "mlflow_model": "MLFlowModelJobInput", + "mltable": "MLTableJobInput", + "triton_model": "TritonModelJobInput", + "uri_file": "UriFileJobInput", + "uri_folder": "UriFolderJobInput", + } } - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): + def __init__(self, *, description: Optional[str] = None, **kwargs): """ :keyword description: Description for the input. :paramtype description: str @@ -6856,15 +7254,15 @@ class CustomModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "min_length": 1, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -6884,10 +7282,12 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(CustomModelJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(CustomModelJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'custom_model' # type: str + self.job_input_type = "custom_model" # type: str self.description = description @@ -6908,24 +7308,26 @@ class JobOutput(msrest.serialization.Model): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } _subtype_map = { - 'job_output_type': {'custom_model': 'CustomModelJobOutput', 'mlflow_model': 'MLFlowModelJobOutput', 'mltable': 'MLTableJobOutput', 'triton_model': 'TritonModelJobOutput', 'uri_file': 'UriFileJobOutput', 'uri_folder': 'UriFolderJobOutput'} + "job_output_type": { + "custom_model": "CustomModelJobOutput", + "mlflow_model": "MLFlowModelJobOutput", + "mltable": "MLTableJobOutput", + "triton_model": "TritonModelJobOutput", + "uri_file": "UriFileJobOutput", + "uri_folder": "UriFolderJobOutput", + } } - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): + def __init__(self, *, description: Optional[str] = None, **kwargs): """ :keyword description: Description for the output. :paramtype description: str @@ -6953,14 +7355,14 @@ class CustomModelJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -6979,10 +7381,12 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(CustomModelJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(CustomModelJobOutput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_output_type = 'custom_model' # type: str + self.job_output_type = "custom_model" # type: str self.description = description @@ -6999,27 +7403,22 @@ class CustomNCrossValidations(NCrossValidations): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - *, - value: int, - **kwargs - ): + def __init__(self, *, value: int, **kwargs): """ :keyword value: Required. [Required] N-Cross validations value. :paramtype value: int """ super(CustomNCrossValidations, self).__init__(**kwargs) - self.mode = 'Custom' # type: str + self.mode = "Custom" # type: str self.value = value @@ -7036,27 +7435,22 @@ class CustomSeasonality(Seasonality): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - *, - value: int, - **kwargs - ): + def __init__(self, *, value: int, **kwargs): """ :keyword value: Required. [Required] Seasonality value. :paramtype value: int """ super(CustomSeasonality, self).__init__(**kwargs) - self.mode = 'Custom' # type: str + self.mode = "Custom" # type: str self.value = value @@ -7082,13 +7476,16 @@ class CustomService(msrest.serialization.Model): """ _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'name': {'key': 'name', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'Image'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{EnvironmentVariable}'}, - 'docker': {'key': 'docker', 'type': 'Docker'}, - 'endpoints': {'key': 'endpoints', 'type': '[Endpoint]'}, - 'volumes': {'key': 'volumes', 'type': '[VolumeDefinition]'}, + "additional_properties": {"key": "", "type": "{object}"}, + "name": {"key": "name", "type": "str"}, + "image": {"key": "image", "type": "Image"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{EnvironmentVariable}", + }, + "docker": {"key": "docker", "type": "Docker"}, + "endpoints": {"key": "endpoints", "type": "[Endpoint]"}, + "volumes": {"key": "volumes", "type": "[VolumeDefinition]"}, } def __init__( @@ -7097,7 +7494,9 @@ def __init__( additional_properties: Optional[Dict[str, Any]] = None, name: Optional[str] = None, image: Optional["Image"] = None, - environment_variables: Optional[Dict[str, "EnvironmentVariable"]] = None, + environment_variables: Optional[ + Dict[str, "EnvironmentVariable"] + ] = None, docker: Optional["Docker"] = None, endpoints: Optional[List["Endpoint"]] = None, volumes: Optional[List["VolumeDefinition"]] = None, @@ -7144,27 +7543,22 @@ class CustomTargetLags(TargetLags): """ _validation = { - 'mode': {'required': True}, - 'values': {'required': True}, + "mode": {"required": True}, + "values": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[int]'}, + "mode": {"key": "mode", "type": "str"}, + "values": {"key": "values", "type": "[int]"}, } - def __init__( - self, - *, - values: List[int], - **kwargs - ): + def __init__(self, *, values: List[int], **kwargs): """ :keyword values: Required. [Required] Set target lags values. :paramtype values: list[int] """ super(CustomTargetLags, self).__init__(**kwargs) - self.mode = 'Custom' # type: str + self.mode = "Custom" # type: str self.values = values @@ -7181,27 +7575,22 @@ class CustomTargetRollingWindowSize(TargetRollingWindowSize): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - *, - value: int, - **kwargs - ): + def __init__(self, *, value: int, **kwargs): """ :keyword value: Required. [Required] TargetRollingWindowSize value. :paramtype value: int """ super(CustomTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Custom' # type: str + self.mode = "Custom" # type: str self.value = value @@ -7213,14 +7602,11 @@ class DatabricksSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, + "properties": {"key": "properties", "type": "DatabricksProperties"}, } def __init__( - self, - *, - properties: Optional["DatabricksProperties"] = None, - **kwargs + self, *, properties: Optional["DatabricksProperties"] = None, **kwargs ): """ :keyword properties: Properties of Databricks. @@ -7269,26 +7655,29 @@ class Databricks(Compute, DatabricksSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "DatabricksProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -7314,9 +7703,16 @@ def __init__( MSI and AAD exclusively for authentication. :paramtype disable_local_auth: bool """ - super(Databricks, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) + super(Databricks, self).__init__( + compute_location=compute_location, + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'Databricks' # type: str + self.compute_type = "Databricks" # type: str self.compute_location = compute_location self.provisioning_state = None self.description = description @@ -7336,14 +7732,14 @@ class DatabricksComputeSecretsProperties(msrest.serialization.Model): """ _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, } def __init__( - self, - *, - databricks_access_token: Optional[str] = None, - **kwargs + self, *, databricks_access_token: Optional[str] = None, **kwargs ): """ :keyword databricks_access_token: access token for databricks account. @@ -7353,7 +7749,9 @@ def __init__( self.databricks_access_token = databricks_access_token -class DatabricksComputeSecrets(ComputeSecrets, DatabricksComputeSecretsProperties): +class DatabricksComputeSecrets( + ComputeSecrets, DatabricksComputeSecretsProperties +): """Secrets related to a Machine Learning compute based on Databricks. All required parameters must be populated in order to send to Azure. @@ -7367,27 +7765,29 @@ class DatabricksComputeSecrets(ComputeSecrets, DatabricksComputeSecretsPropertie """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, + "compute_type": {"key": "computeType", "type": "str"}, } def __init__( - self, - *, - databricks_access_token: Optional[str] = None, - **kwargs + self, *, databricks_access_token: Optional[str] = None, **kwargs ): """ :keyword databricks_access_token: access token for databricks account. :paramtype databricks_access_token: str """ - super(DatabricksComputeSecrets, self).__init__(databricks_access_token=databricks_access_token, **kwargs) + super(DatabricksComputeSecrets, self).__init__( + databricks_access_token=databricks_access_token, **kwargs + ) self.databricks_access_token = databricks_access_token - self.compute_type = 'Databricks' # type: str + self.compute_type = "Databricks" # type: str class DatabricksProperties(msrest.serialization.Model): @@ -7400,8 +7800,11 @@ class DatabricksProperties(msrest.serialization.Model): """ _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'workspace_url': {'key': 'workspaceUrl', 'type': 'str'}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, + "workspace_url": {"key": "workspaceUrl", "type": "str"}, } def __init__( @@ -7445,27 +7848,22 @@ class DataContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "DataContainerProperties"}, } - def __init__( - self, - *, - properties: "DataContainerProperties", - **kwargs - ): + def __init__(self, *, properties: "DataContainerProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataContainerProperties @@ -7499,19 +7897,19 @@ class DataContainerProperties(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'data_type': {'required': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "data_type": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "data_type": {"key": "dataType", "type": "str"}, } def __init__( @@ -7537,7 +7935,13 @@ def __init__( "uri_file", "uri_folder", "mltable". :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType """ - super(DataContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) + super(DataContainerProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs + ) self.data_type = data_type @@ -7552,8 +7956,8 @@ class DataContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[DataContainer]"}, } def __init__( @@ -7612,25 +8016,28 @@ class DataFactory(Compute): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -7653,8 +8060,14 @@ def __init__( MSI and AAD exclusively for authentication. :paramtype disable_local_auth: bool """ - super(DataFactory, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, **kwargs) - self.compute_type = 'DataFactory' # type: str + super(DataFactory, self).__init__( + compute_location=compute_location, + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + **kwargs + ) + self.compute_type = "DataFactory" # type: str class DataLakeAnalyticsSchema(msrest.serialization.Model): @@ -7666,7 +8079,10 @@ class DataLakeAnalyticsSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, + "properties": { + "key": "properties", + "type": "DataLakeAnalyticsSchemaProperties", + }, } def __init__( @@ -7724,26 +8140,32 @@ class DataLakeAnalytics(Compute, DataLakeAnalyticsSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": { + "key": "properties", + "type": "DataLakeAnalyticsSchemaProperties", + }, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -7770,9 +8192,16 @@ def __init__( MSI and AAD exclusively for authentication. :paramtype disable_local_auth: bool """ - super(DataLakeAnalytics, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) + super(DataLakeAnalytics, self).__init__( + compute_location=compute_location, + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'DataLakeAnalytics' # type: str + self.compute_type = "DataLakeAnalytics" # type: str self.compute_location = compute_location self.provisioning_state = None self.description = description @@ -7792,14 +8221,14 @@ class DataLakeAnalyticsSchemaProperties(msrest.serialization.Model): """ _attribute_map = { - 'data_lake_store_account_name': {'key': 'dataLakeStoreAccountName', 'type': 'str'}, + "data_lake_store_account_name": { + "key": "dataLakeStoreAccountName", + "type": "str", + }, } def __init__( - self, - *, - data_lake_store_account_name: Optional[str] = None, - **kwargs + self, *, data_lake_store_account_name: Optional[str] = None, **kwargs ): """ :keyword data_lake_store_account_name: DataLake Store Account Name. @@ -7824,13 +8253,13 @@ class DataPathAssetReference(AssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'datastore_id': {'key': 'datastoreId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "datastore_id": {"key": "datastoreId", "type": "str"}, + "path": {"key": "path", "type": "str"}, } def __init__( @@ -7847,7 +8276,7 @@ def __init__( :paramtype path: str """ super(DataPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'DataPath' # type: str + self.reference_type = "DataPath" # type: str self.datastore_id = datastore_id self.path = path @@ -7875,27 +8304,22 @@ class Datastore(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DatastoreProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "DatastoreProperties"}, } - def __init__( - self, - *, - properties: "DatastoreProperties", - **kwargs - ): + def __init__(self, *, properties: "DatastoreProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatastoreProperties @@ -7915,8 +8339,8 @@ class DatastoreResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Datastore]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[Datastore]"}, } def __init__( @@ -7961,27 +8385,25 @@ class DataVersionBase(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataVersionBaseProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "DataVersionBaseProperties", + }, } - def __init__( - self, - *, - properties: "DataVersionBaseProperties", - **kwargs - ): + def __init__(self, *, properties: "DataVersionBaseProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataVersionBaseProperties @@ -8017,22 +8439,30 @@ class DataVersionBaseProperties(AssetBase): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, } _subtype_map = { - 'data_type': {'mltable': 'MLTableData', 'uri_file': 'UriFileDataVersion', 'uri_folder': 'UriFolderDataVersion'} + "data_type": { + "mltable": "MLTableData", + "uri_file": "UriFileDataVersion", + "uri_folder": "UriFolderDataVersion", + } } def __init__( @@ -8061,8 +8491,15 @@ def __init__( https://go.microsoft.com/fwlink/?linkid=2202330. :paramtype data_uri: str """ - super(DataVersionBaseProperties, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.data_type = 'DataVersionBaseProperties' # type: str + super(DataVersionBaseProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + **kwargs + ) + self.data_type = "DataVersionBaseProperties" # type: str self.data_uri = data_uri @@ -8077,8 +8514,8 @@ class DataVersionBaseResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataVersionBase]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[DataVersionBase]"}, } def __init__( @@ -8095,7 +8532,9 @@ def __init__( :keyword value: An array of objects of type DataVersionBase. :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBase] """ - super(DataVersionBaseResourceArmPaginatedResult, self).__init__(**kwargs) + super(DataVersionBaseResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -8114,23 +8553,22 @@ class OnlineScaleSettings(msrest.serialization.Model): """ _validation = { - 'scale_type': {'required': True}, + "scale_type": {"required": True}, } _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, + "scale_type": {"key": "scaleType", "type": "str"}, } _subtype_map = { - 'scale_type': {'Default': 'DefaultScaleSettings', 'TargetUtilization': 'TargetUtilizationScaleSettings'} + "scale_type": { + "Default": "DefaultScaleSettings", + "TargetUtilization": "TargetUtilizationScaleSettings", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(OnlineScaleSettings, self).__init__(**kwargs) self.scale_type = None # type: Optional[str] @@ -8146,21 +8584,17 @@ class DefaultScaleSettings(OnlineScaleSettings): """ _validation = { - 'scale_type': {'required': True}, + "scale_type": {"required": True}, } _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, + "scale_type": {"key": "scaleType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DefaultScaleSettings, self).__init__(**kwargs) - self.scale_type = 'Default' # type: str + self.scale_type = "Default" # type: str class DeploymentLogs(msrest.serialization.Model): @@ -8171,15 +8605,10 @@ class DeploymentLogs(msrest.serialization.Model): """ _attribute_map = { - 'content': {'key': 'content', 'type': 'str'}, + "content": {"key": "content", "type": "str"}, } - def __init__( - self, - *, - content: Optional[str] = None, - **kwargs - ): + def __init__(self, *, content: Optional[str] = None, **kwargs): """ :keyword content: The retrieved online deployment logs. :paramtype content: str @@ -8199,8 +8628,8 @@ class DeploymentLogsRequest(msrest.serialization.Model): """ _attribute_map = { - 'container_type': {'key': 'containerType', 'type': 'str'}, - 'tail': {'key': 'tail', 'type': 'int'}, + "container_type": {"key": "containerType", "type": "str"}, + "tail": {"key": "tail", "type": "int"}, } def __init__( @@ -8234,9 +8663,9 @@ class ResourceConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "properties": {"key": "properties", "type": "{object}"}, } def __init__( @@ -8273,9 +8702,9 @@ class DeploymentResourceConfiguration(ResourceConfiguration): """ _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "properties": {"key": "properties", "type": "{object}"}, } def __init__( @@ -8294,7 +8723,12 @@ def __init__( :keyword properties: Additional properties bag. :paramtype properties: dict[str, any] """ - super(DeploymentResourceConfiguration, self).__init__(instance_count=instance_count, instance_type=instance_type, properties=properties, **kwargs) + super(DeploymentResourceConfiguration, self).__init__( + instance_count=instance_count, + instance_type=instance_type, + properties=properties, + **kwargs + ) class DiagnoseRequestProperties(msrest.serialization.Model): @@ -8321,15 +8755,18 @@ class DiagnoseRequestProperties(msrest.serialization.Model): """ _attribute_map = { - 'udr': {'key': 'udr', 'type': '{object}'}, - 'nsg': {'key': 'nsg', 'type': '{object}'}, - 'resource_lock': {'key': 'resourceLock', 'type': '{object}'}, - 'dns_resolution': {'key': 'dnsResolution', 'type': '{object}'}, - 'storage_account': {'key': 'storageAccount', 'type': '{object}'}, - 'key_vault': {'key': 'keyVault', 'type': '{object}'}, - 'container_registry': {'key': 'containerRegistry', 'type': '{object}'}, - 'application_insights': {'key': 'applicationInsights', 'type': '{object}'}, - 'others': {'key': 'others', 'type': '{object}'}, + "udr": {"key": "udr", "type": "{object}"}, + "nsg": {"key": "nsg", "type": "{object}"}, + "resource_lock": {"key": "resourceLock", "type": "{object}"}, + "dns_resolution": {"key": "dnsResolution", "type": "{object}"}, + "storage_account": {"key": "storageAccount", "type": "{object}"}, + "key_vault": {"key": "keyVault", "type": "{object}"}, + "container_registry": {"key": "containerRegistry", "type": "{object}"}, + "application_insights": { + "key": "applicationInsights", + "type": "{object}", + }, + "others": {"key": "others", "type": "{object}"}, } def __init__( @@ -8386,7 +8823,7 @@ class DiagnoseResponseResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseResponseResultValue'}, + "value": {"key": "value", "type": "DiagnoseResponseResultValue"}, } def __init__( @@ -8433,15 +8870,39 @@ class DiagnoseResponseResultValue(msrest.serialization.Model): """ _attribute_map = { - 'user_defined_route_results': {'key': 'userDefinedRouteResults', 'type': '[DiagnoseResult]'}, - 'network_security_rule_results': {'key': 'networkSecurityRuleResults', 'type': '[DiagnoseResult]'}, - 'resource_lock_results': {'key': 'resourceLockResults', 'type': '[DiagnoseResult]'}, - 'dns_resolution_results': {'key': 'dnsResolutionResults', 'type': '[DiagnoseResult]'}, - 'storage_account_results': {'key': 'storageAccountResults', 'type': '[DiagnoseResult]'}, - 'key_vault_results': {'key': 'keyVaultResults', 'type': '[DiagnoseResult]'}, - 'container_registry_results': {'key': 'containerRegistryResults', 'type': '[DiagnoseResult]'}, - 'application_insights_results': {'key': 'applicationInsightsResults', 'type': '[DiagnoseResult]'}, - 'other_results': {'key': 'otherResults', 'type': '[DiagnoseResult]'}, + "user_defined_route_results": { + "key": "userDefinedRouteResults", + "type": "[DiagnoseResult]", + }, + "network_security_rule_results": { + "key": "networkSecurityRuleResults", + "type": "[DiagnoseResult]", + }, + "resource_lock_results": { + "key": "resourceLockResults", + "type": "[DiagnoseResult]", + }, + "dns_resolution_results": { + "key": "dnsResolutionResults", + "type": "[DiagnoseResult]", + }, + "storage_account_results": { + "key": "storageAccountResults", + "type": "[DiagnoseResult]", + }, + "key_vault_results": { + "key": "keyVaultResults", + "type": "[DiagnoseResult]", + }, + "container_registry_results": { + "key": "containerRegistryResults", + "type": "[DiagnoseResult]", + }, + "application_insights_results": { + "key": "applicationInsightsResults", + "type": "[DiagnoseResult]", + }, + "other_results": {"key": "otherResults", "type": "[DiagnoseResult]"}, } def __init__( @@ -8512,23 +8973,19 @@ class DiagnoseResult(msrest.serialization.Model): """ _validation = { - 'code': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, + "code": {"readonly": True}, + "level": {"readonly": True}, + "message": {"readonly": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, + "code": {"key": "code", "type": "str"}, + "level": {"key": "level", "type": "str"}, + "message": {"key": "message", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DiagnoseResult, self).__init__(**kwargs) self.code = None self.level = None @@ -8543,14 +9000,11 @@ class DiagnoseWorkspaceParameters(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseRequestProperties'}, + "value": {"key": "value", "type": "DiagnoseRequestProperties"}, } def __init__( - self, - *, - value: Optional["DiagnoseRequestProperties"] = None, - **kwargs + self, *, value: Optional["DiagnoseRequestProperties"] = None, **kwargs ): """ :keyword value: Value of Parameters. @@ -8574,23 +9028,23 @@ class DistributionConfiguration(msrest.serialization.Model): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, + "distribution_type": {"key": "distributionType", "type": "str"}, } _subtype_map = { - 'distribution_type': {'Mpi': 'Mpi', 'PyTorch': 'PyTorch', 'TensorFlow': 'TensorFlow'} + "distribution_type": { + "Mpi": "Mpi", + "PyTorch": "PyTorch", + "TensorFlow": "TensorFlow", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DistributionConfiguration, self).__init__(**kwargs) self.distribution_type = None # type: Optional[str] @@ -8606,8 +9060,8 @@ class Docker(msrest.serialization.Model): """ _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'privileged': {'key': 'privileged', 'type': 'bool'}, + "additional_properties": {"key": "", "type": "{object}"}, + "privileged": {"key": "privileged", "type": "bool"}, } def __init__( @@ -8645,14 +9099,14 @@ class EncryptionKeyVaultProperties(msrest.serialization.Model): """ _validation = { - 'key_vault_arm_id': {'required': True}, - 'key_identifier': {'required': True}, + "key_vault_arm_id": {"required": True}, + "key_identifier": {"required": True}, } _attribute_map = { - 'key_vault_arm_id': {'key': 'keyVaultArmId', 'type': 'str'}, - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - 'identity_client_id': {'key': 'identityClientId', 'type': 'str'}, + "key_vault_arm_id": {"key": "keyVaultArmId", "type": "str"}, + "key_identifier": {"key": "keyIdentifier", "type": "str"}, + "identity_client_id": {"key": "identityClientId", "type": "str"}, } def __init__( @@ -8695,14 +9149,17 @@ class EncryptionProperty(msrest.serialization.Model): """ _validation = { - 'status': {'required': True}, - 'key_vault_properties': {'required': True}, + "status": {"required": True}, + "key_vault_properties": {"required": True}, } _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityForCmk'}, - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'EncryptionKeyVaultProperties'}, + "status": {"key": "status", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityForCmk"}, + "key_vault_properties": { + "key": "keyVaultProperties", + "type": "EncryptionKeyVaultProperties", + }, } def __init__( @@ -8747,11 +9204,11 @@ class Endpoint(msrest.serialization.Model): """ _attribute_map = { - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'int'}, - 'published': {'key': 'published', 'type': 'int'}, - 'host_ip': {'key': 'hostIp', 'type': 'str'}, + "protocol": {"key": "protocol", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "target": {"key": "target", "type": "int"}, + "published": {"key": "published", "type": "int"}, + "host_ip": {"key": "hostIp", "type": "str"}, } def __init__( @@ -8795,8 +9252,8 @@ class EndpointAuthKeys(msrest.serialization.Model): """ _attribute_map = { - 'primary_key': {'key': 'primaryKey', 'type': 'str'}, - 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, + "primary_key": {"key": "primaryKey", "type": "str"}, + "secondary_key": {"key": "secondaryKey", "type": "str"}, } def __init__( @@ -8831,10 +9288,13 @@ class EndpointAuthToken(msrest.serialization.Model): """ _attribute_map = { - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'expiry_time_utc': {'key': 'expiryTimeUtc', 'type': 'long'}, - 'refresh_after_time_utc': {'key': 'refreshAfterTimeUtc', 'type': 'long'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, + "access_token": {"key": "accessToken", "type": "str"}, + "expiry_time_utc": {"key": "expiryTimeUtc", "type": "long"}, + "refresh_after_time_utc": { + "key": "refreshAfterTimeUtc", + "type": "long", + }, + "token_type": {"key": "tokenType", "type": "str"}, } def __init__( @@ -8877,23 +9337,22 @@ class ScheduleActionBase(msrest.serialization.Model): """ _validation = { - 'action_type': {'required': True}, + "action_type": {"required": True}, } _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, + "action_type": {"key": "actionType", "type": "str"}, } _subtype_map = { - 'action_type': {'CreateJob': 'JobScheduleAction', 'InvokeBatchEndpoint': 'EndpointScheduleAction'} + "action_type": { + "CreateJob": "JobScheduleAction", + "InvokeBatchEndpoint": "EndpointScheduleAction", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ScheduleActionBase, self).__init__(**kwargs) self.action_type = None # type: Optional[str] @@ -8908,42 +9367,40 @@ class EndpointScheduleAction(ScheduleActionBase): :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType :ivar endpoint_invocation_definition: Required. [Required] Defines Schedule action definition details. - - + + .. raw:: html - + . :vartype endpoint_invocation_definition: any """ _validation = { - 'action_type': {'required': True}, - 'endpoint_invocation_definition': {'required': True}, + "action_type": {"required": True}, + "endpoint_invocation_definition": {"required": True}, } _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'endpoint_invocation_definition': {'key': 'endpointInvocationDefinition', 'type': 'object'}, + "action_type": {"key": "actionType", "type": "str"}, + "endpoint_invocation_definition": { + "key": "endpointInvocationDefinition", + "type": "object", + }, } - def __init__( - self, - *, - endpoint_invocation_definition: Any, - **kwargs - ): + def __init__(self, *, endpoint_invocation_definition: Any, **kwargs): """ :keyword endpoint_invocation_definition: Required. [Required] Defines Schedule action definition details. - - + + .. raw:: html - + . :paramtype endpoint_invocation_definition: any """ super(EndpointScheduleAction, self).__init__(**kwargs) - self.action_type = 'InvokeBatchEndpoint' # type: str + self.action_type = "InvokeBatchEndpoint" # type: str self.endpoint_invocation_definition = endpoint_invocation_definition @@ -8970,26 +9427,26 @@ class EnvironmentContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "EnvironmentContainerProperties", + }, } def __init__( - self, - *, - properties: "EnvironmentContainerProperties", - **kwargs + self, *, properties: "EnvironmentContainerProperties", **kwargs ): """ :keyword properties: Required. [Required] Additional attributes of the entity. @@ -9024,19 +9481,19 @@ class EnvironmentContainerProperties(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } def __init__( @@ -9058,11 +9515,19 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(EnvironmentContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) + super(EnvironmentContainerProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs + ) self.provisioning_state = None -class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model): +class EnvironmentContainerResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of EnvironmentContainer entities. :ivar next_link: The link to the next page of EnvironmentContainer objects. If null, there are @@ -9073,8 +9538,8 @@ class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model) """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[EnvironmentContainer]"}, } def __init__( @@ -9091,7 +9556,9 @@ def __init__( :keyword value: An array of objects of type EnvironmentContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] """ - super(EnvironmentContainerResourceArmPaginatedResult, self).__init__(**kwargs) + super(EnvironmentContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -9110,9 +9577,9 @@ class EnvironmentVariable(msrest.serialization.Model): """ _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "additional_properties": {"key": "", "type": "{object}"}, + "type": {"key": "type", "type": "str"}, + "value": {"key": "value", "type": "str"}, } def __init__( @@ -9162,26 +9629,26 @@ class EnvironmentVersion(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentVersionProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "EnvironmentVersionProperties", + }, } def __init__( - self, - *, - properties: "EnvironmentVersionProperties", - **kwargs + self, *, properties: "EnvironmentVersionProperties", **kwargs ): """ :keyword properties: Required. [Required] Additional attributes of the entity. @@ -9213,29 +9680,29 @@ class EnvironmentVersionProperties(AssetBase): :vartype build: ~azure.mgmt.machinelearningservices.models.BuildContext :ivar conda_file: Standard configuration file used by Conda that lets you install any kind of package, including Python, R, and C/C++ packages. - - + + .. raw:: html - + . :vartype conda_file: str :ivar environment_type: Environment type is either user managed or curated by the Azure ML service - - + + .. raw:: html - + . Possible values include: "Curated", "UserCreated". :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType :ivar image: Name of the image that will be used for the environment. - - + + .. raw:: html - + . @@ -9254,25 +9721,28 @@ class EnvironmentVersionProperties(AssetBase): """ _validation = { - 'environment_type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "environment_type": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'auto_rebuild': {'key': 'autoRebuild', 'type': 'str'}, - 'build': {'key': 'build', 'type': 'BuildContext'}, - 'conda_file': {'key': 'condaFile', 'type': 'str'}, - 'environment_type': {'key': 'environmentType', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'str'}, - 'inference_config': {'key': 'inferenceConfig', 'type': 'InferenceContainerProperties'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "auto_rebuild": {"key": "autoRebuild", "type": "str"}, + "build": {"key": "build", "type": "BuildContext"}, + "conda_file": {"key": "condaFile", "type": "str"}, + "environment_type": {"key": "environmentType", "type": "str"}, + "image": {"key": "image", "type": "str"}, + "inference_config": { + "key": "inferenceConfig", + "type": "InferenceContainerProperties", + }, + "os_type": {"key": "osType", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "stage": {"key": "stage", "type": "str"}, } def __init__( @@ -9310,19 +9780,19 @@ def __init__( :paramtype build: ~azure.mgmt.machinelearningservices.models.BuildContext :keyword conda_file: Standard configuration file used by Conda that lets you install any kind of package, including Python, R, and C/C++ packages. - - + + .. raw:: html - + . :paramtype conda_file: str :keyword image: Name of the image that will be used for the environment. - - + + .. raw:: html - + . @@ -9335,7 +9805,14 @@ def __init__( :keyword stage: Stage in the environment lifecycle assigned to this environment. :paramtype stage: str """ - super(EnvironmentVersionProperties, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) + super(EnvironmentVersionProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + **kwargs + ) self.auto_rebuild = auto_rebuild self.build = build self.conda_file = conda_file @@ -9358,8 +9835,8 @@ class EnvironmentVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentVersion]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[EnvironmentVersion]"}, } def __init__( @@ -9376,7 +9853,9 @@ def __init__( :keyword value: An array of objects of type EnvironmentVersion. :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] """ - super(EnvironmentVersionResourceArmPaginatedResult, self).__init__(**kwargs) + super(EnvironmentVersionResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -9393,21 +9872,17 @@ class ErrorAdditionalInfo(msrest.serialization.Model): """ _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, + "type": {"readonly": True}, + "info": {"readonly": True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, + "type": {"key": "type", "type": "str"}, + "info": {"key": "info", "type": "object"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ErrorAdditionalInfo, self).__init__(**kwargs) self.type = None self.info = None @@ -9431,27 +9906,26 @@ class ErrorDetail(msrest.serialization.Model): """ _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, + "code": {"readonly": True}, + "message": {"readonly": True}, + "target": {"readonly": True}, + "details": {"readonly": True}, + "additional_info": {"readonly": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[ErrorDetail]"}, + "additional_info": { + "key": "additionalInfo", + "type": "[ErrorAdditionalInfo]", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ErrorDetail, self).__init__(**kwargs) self.code = None self.message = None @@ -9468,15 +9942,10 @@ class ErrorResponse(msrest.serialization.Model): """ _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, + "error": {"key": "error", "type": "ErrorDetail"}, } - def __init__( - self, - *, - error: Optional["ErrorDetail"] = None, - **kwargs - ): + def __init__(self, *, error: Optional["ErrorDetail"] = None, **kwargs): """ :keyword error: The error object. :paramtype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail @@ -9501,15 +9970,15 @@ class EstimatedVMPrice(msrest.serialization.Model): """ _validation = { - 'retail_price': {'required': True}, - 'os_type': {'required': True}, - 'vm_tier': {'required': True}, + "retail_price": {"required": True}, + "os_type": {"required": True}, + "vm_tier": {"required": True}, } _attribute_map = { - 'retail_price': {'key': 'retailPrice', 'type': 'float'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_tier': {'key': 'vmTier', 'type': 'str'}, + "retail_price": {"key": "retailPrice", "type": "float"}, + "os_type": {"key": "osType", "type": "str"}, + "vm_tier": {"key": "vmTier", "type": "str"}, } def __init__( @@ -9553,15 +10022,15 @@ class EstimatedVMPrices(msrest.serialization.Model): """ _validation = { - 'billing_currency': {'required': True}, - 'unit_of_measure': {'required': True}, - 'values': {'required': True}, + "billing_currency": {"required": True}, + "unit_of_measure": {"required": True}, + "values": {"required": True}, } _attribute_map = { - 'billing_currency': {'key': 'billingCurrency', 'type': 'str'}, - 'unit_of_measure': {'key': 'unitOfMeasure', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[EstimatedVMPrice]'}, + "billing_currency": {"key": "billingCurrency", "type": "str"}, + "unit_of_measure": {"key": "unitOfMeasure", "type": "str"}, + "values": {"key": "values", "type": "[EstimatedVMPrice]"}, } def __init__( @@ -9597,14 +10066,11 @@ class ExternalFQDNResponse(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[FQDNEndpoints]'}, + "value": {"key": "value", "type": "[FQDNEndpoints]"}, } def __init__( - self, - *, - value: Optional[List["FQDNEndpoints"]] = None, - **kwargs + self, *, value: Optional[List["FQDNEndpoints"]] = None, **kwargs ): """ :keyword value: @@ -9622,15 +10088,10 @@ class FeaturizationSettings(msrest.serialization.Model): """ _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, + "dataset_language": {"key": "datasetLanguage", "type": "str"}, } - def __init__( - self, - *, - dataset_language: Optional[str] = None, - **kwargs - ): + def __init__(self, *, dataset_language: Optional[str] = None, **kwargs): """ :keyword dataset_language: Dataset language, useful for the text data. :paramtype dataset_language: str @@ -9647,15 +10108,10 @@ class FlavorData(msrest.serialization.Model): """ _attribute_map = { - 'data': {'key': 'data', 'type': '{str}'}, + "data": {"key": "data", "type": "{str}"}, } - def __init__( - self, - *, - data: Optional[Dict[str, str]] = None, - **kwargs - ): + def __init__(self, *, data: Optional[Dict[str, str]] = None, **kwargs): """ :keyword data: Model flavor-specific data. :paramtype data: dict[str, str] @@ -9722,27 +10178,48 @@ class Forecasting(AutoMLVertical, TableVertical): """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'forecasting_settings': {'key': 'forecastingSettings', 'type': 'ForecastingSettings'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'ForecastingTrainingSettings'}, + "task_type": {"required": True}, + "training_data": {"required": True}, + } + + _attribute_map = { + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "test_data": {"key": "testData", "type": "MLTableJobInput"}, + "test_data_size": {"key": "testDataSize", "type": "float"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "weight_column_name": {"key": "weightColumnName", "type": "str"}, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "forecasting_settings": { + "key": "forecastingSettings", + "type": "ForecastingSettings", + }, + "primary_metric": {"key": "primaryMetric", "type": "str"}, + "training_settings": { + "key": "trainingSettings", + "type": "ForecastingTrainingSettings", + }, } def __init__( @@ -9750,7 +10227,9 @@ def __init__( *, training_data: "MLTableJobInput", cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "TableVerticalFeaturizationSettings" + ] = None, limit_settings: Optional["TableVerticalLimitSettings"] = None, n_cross_validations: Optional["NCrossValidations"] = None, test_data: Optional["MLTableJobInput"] = None, @@ -9761,7 +10240,9 @@ def __init__( log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, forecasting_settings: Optional["ForecastingSettings"] = None, - primary_metric: Optional[Union[str, "ForecastingPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "ForecastingPrimaryMetrics"] + ] = None, training_settings: Optional["ForecastingTrainingSettings"] = None, **kwargs ): @@ -9814,7 +10295,21 @@ def __init__( :paramtype training_settings: ~azure.mgmt.machinelearningservices.models.ForecastingTrainingSettings """ - super(Forecasting, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, cv_split_column_names=cv_split_column_names, featurization_settings=featurization_settings, limit_settings=limit_settings, n_cross_validations=n_cross_validations, test_data=test_data, test_data_size=test_data_size, validation_data=validation_data, validation_data_size=validation_data_size, weight_column_name=weight_column_name, **kwargs) + super(Forecasting, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + cv_split_column_names=cv_split_column_names, + featurization_settings=featurization_settings, + limit_settings=limit_settings, + n_cross_validations=n_cross_validations, + test_data=test_data, + test_data_size=test_data_size, + validation_data=validation_data, + validation_data_size=validation_data_size, + weight_column_name=weight_column_name, + **kwargs + ) self.cv_split_column_names = cv_split_column_names self.featurization_settings = featurization_settings self.limit_settings = limit_settings @@ -9824,7 +10319,7 @@ def __init__( self.validation_data = validation_data self.validation_data_size = validation_data_size self.weight_column_name = weight_column_name - self.task_type = 'Forecasting' # type: str + self.task_type = "Forecasting" # type: str self.forecasting_settings = forecasting_settings self.primary_metric = primary_metric self.training_settings = training_settings @@ -9888,19 +10383,37 @@ class ForecastingSettings(msrest.serialization.Model): """ _attribute_map = { - 'country_or_region_for_holidays': {'key': 'countryOrRegionForHolidays', 'type': 'str'}, - 'cv_step_size': {'key': 'cvStepSize', 'type': 'int'}, - 'feature_lags': {'key': 'featureLags', 'type': 'str'}, - 'forecast_horizon': {'key': 'forecastHorizon', 'type': 'ForecastHorizon'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'seasonality': {'key': 'seasonality', 'type': 'Seasonality'}, - 'short_series_handling_config': {'key': 'shortSeriesHandlingConfig', 'type': 'str'}, - 'target_aggregate_function': {'key': 'targetAggregateFunction', 'type': 'str'}, - 'target_lags': {'key': 'targetLags', 'type': 'TargetLags'}, - 'target_rolling_window_size': {'key': 'targetRollingWindowSize', 'type': 'TargetRollingWindowSize'}, - 'time_column_name': {'key': 'timeColumnName', 'type': 'str'}, - 'time_series_id_column_names': {'key': 'timeSeriesIdColumnNames', 'type': '[str]'}, - 'use_stl': {'key': 'useStl', 'type': 'str'}, + "country_or_region_for_holidays": { + "key": "countryOrRegionForHolidays", + "type": "str", + }, + "cv_step_size": {"key": "cvStepSize", "type": "int"}, + "feature_lags": {"key": "featureLags", "type": "str"}, + "forecast_horizon": { + "key": "forecastHorizon", + "type": "ForecastHorizon", + }, + "frequency": {"key": "frequency", "type": "str"}, + "seasonality": {"key": "seasonality", "type": "Seasonality"}, + "short_series_handling_config": { + "key": "shortSeriesHandlingConfig", + "type": "str", + }, + "target_aggregate_function": { + "key": "targetAggregateFunction", + "type": "str", + }, + "target_lags": {"key": "targetLags", "type": "TargetLags"}, + "target_rolling_window_size": { + "key": "targetRollingWindowSize", + "type": "TargetRollingWindowSize", + }, + "time_column_name": {"key": "timeColumnName", "type": "str"}, + "time_series_id_column_names": { + "key": "timeSeriesIdColumnNames", + "type": "[str]", + }, + "use_stl": {"key": "useStl", "type": "str"}, } def __init__( @@ -9912,8 +10425,12 @@ def __init__( forecast_horizon: Optional["ForecastHorizon"] = None, frequency: Optional[str] = None, seasonality: Optional["Seasonality"] = None, - short_series_handling_config: Optional[Union[str, "ShortSeriesHandlingConfiguration"]] = None, - target_aggregate_function: Optional[Union[str, "TargetAggregationFunction"]] = None, + short_series_handling_config: Optional[ + Union[str, "ShortSeriesHandlingConfiguration"] + ] = None, + target_aggregate_function: Optional[ + Union[str, "TargetAggregationFunction"] + ] = None, target_lags: Optional["TargetLags"] = None, target_rolling_window_size: Optional["TargetRollingWindowSize"] = None, time_column_name: Optional[str] = None, @@ -10019,15 +10536,36 @@ class ForecastingTrainingSettings(TrainingSettings): """ _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, + "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, + "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, + "allowed_training_algorithms": { + "key": "allowedTrainingAlgorithms", + "type": "[str]", + }, + "blocked_training_algorithms": { + "key": "blockedTrainingAlgorithms", + "type": "[str]", + }, } def __init__( @@ -10040,8 +10578,12 @@ def __init__( enable_vote_ensemble: Optional[bool] = True, ensemble_model_download_timeout: Optional[datetime.timedelta] = "PT5M", stack_ensemble_settings: Optional["StackEnsembleSettings"] = None, - allowed_training_algorithms: Optional[List[Union[str, "ForecastingModels"]]] = None, - blocked_training_algorithms: Optional[List[Union[str, "ForecastingModels"]]] = None, + allowed_training_algorithms: Optional[ + List[Union[str, "ForecastingModels"]] + ] = None, + blocked_training_algorithms: Optional[ + List[Union[str, "ForecastingModels"]] + ] = None, **kwargs ): """ @@ -10069,7 +10611,16 @@ def __init__( :paramtype blocked_training_algorithms: list[str or ~azure.mgmt.machinelearningservices.models.ForecastingModels] """ - super(ForecastingTrainingSettings, self).__init__(enable_dnn_training=enable_dnn_training, enable_model_explainability=enable_model_explainability, enable_onnx_compatible_models=enable_onnx_compatible_models, enable_stack_ensemble=enable_stack_ensemble, enable_vote_ensemble=enable_vote_ensemble, ensemble_model_download_timeout=ensemble_model_download_timeout, stack_ensemble_settings=stack_ensemble_settings, **kwargs) + super(ForecastingTrainingSettings, self).__init__( + enable_dnn_training=enable_dnn_training, + enable_model_explainability=enable_model_explainability, + enable_onnx_compatible_models=enable_onnx_compatible_models, + enable_stack_ensemble=enable_stack_ensemble, + enable_vote_ensemble=enable_vote_ensemble, + ensemble_model_download_timeout=ensemble_model_download_timeout, + stack_ensemble_settings=stack_ensemble_settings, + **kwargs + ) self.allowed_training_algorithms = allowed_training_algorithms self.blocked_training_algorithms = blocked_training_algorithms @@ -10084,8 +10635,11 @@ class FQDNEndpoint(msrest.serialization.Model): """ _attribute_map = { - 'domain_name': {'key': 'domainName', 'type': 'str'}, - 'endpoint_details': {'key': 'endpointDetails', 'type': '[FQDNEndpointDetail]'}, + "domain_name": {"key": "domainName", "type": "str"}, + "endpoint_details": { + "key": "endpointDetails", + "type": "[FQDNEndpointDetail]", + }, } def __init__( @@ -10115,15 +10669,10 @@ class FQDNEndpointDetail(msrest.serialization.Model): """ _attribute_map = { - 'port': {'key': 'port', 'type': 'int'}, + "port": {"key": "port", "type": "int"}, } - def __init__( - self, - *, - port: Optional[int] = None, - **kwargs - ): + def __init__(self, *, port: Optional[int] = None, **kwargs): """ :keyword port: :paramtype port: int @@ -10140,7 +10689,7 @@ class FQDNEndpoints(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'FQDNEndpointsProperties'}, + "properties": {"key": "properties", "type": "FQDNEndpointsProperties"}, } def __init__( @@ -10167,8 +10716,8 @@ class FQDNEndpointsProperties(msrest.serialization.Model): """ _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'endpoints': {'key': 'endpoints', 'type': '[FQDNEndpoint]'}, + "category": {"key": "category", "type": "str"}, + "endpoints": {"key": "endpoints", "type": "[FQDNEndpoint]"}, } def __init__( @@ -10202,21 +10751,20 @@ class GridSamplingAlgorithm(SamplingAlgorithm): """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(GridSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Grid' # type: str + self.sampling_algorithm_type = "Grid" # type: str class HDInsightSchema(msrest.serialization.Model): @@ -10227,14 +10775,11 @@ class HDInsightSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, + "properties": {"key": "properties", "type": "HDInsightProperties"}, } def __init__( - self, - *, - properties: Optional["HDInsightProperties"] = None, - **kwargs + self, *, properties: Optional["HDInsightProperties"] = None, **kwargs ): """ :keyword properties: HDInsight compute properties. @@ -10283,26 +10828,29 @@ class HDInsight(Compute, HDInsightSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "HDInsightProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -10328,9 +10876,16 @@ def __init__( MSI and AAD exclusively for authentication. :paramtype disable_local_auth: bool """ - super(HDInsight, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) + super(HDInsight, self).__init__( + compute_location=compute_location, + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'HDInsight' # type: str + self.compute_type = "HDInsight" # type: str self.compute_location = compute_location self.provisioning_state = None self.description = description @@ -10355,9 +10910,12 @@ class HDInsightProperties(msrest.serialization.Model): """ _attribute_map = { - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, + "ssh_port": {"key": "sshPort", "type": "int"}, + "address": {"key": "address", "type": "str"}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, } def __init__( @@ -10396,27 +10954,26 @@ class IdAssetReference(AssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, - 'asset_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "reference_type": {"required": True}, + "asset_id": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'asset_id': {'key': 'assetId', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "asset_id": {"key": "assetId", "type": "str"}, } - def __init__( - self, - *, - asset_id: str, - **kwargs - ): + def __init__(self, *, asset_id: str, **kwargs): """ :keyword asset_id: Required. [Required] ARM resource ID of the asset. :paramtype asset_id: str """ super(IdAssetReference, self).__init__(**kwargs) - self.reference_type = 'Id' # type: str + self.reference_type = "Id" # type: str self.asset_id = asset_id @@ -10429,14 +10986,14 @@ class IdentityForCmk(msrest.serialization.Model): """ _attribute_map = { - 'user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, + "user_assigned_identity": { + "key": "userAssignedIdentity", + "type": "str", + }, } def __init__( - self, - *, - user_assigned_identity: Optional[str] = None, - **kwargs + self, *, user_assigned_identity: Optional[str] = None, **kwargs ): """ :keyword user_assigned_identity: The ArmId of the user assigned identity that will be used to @@ -10456,14 +11013,14 @@ class IdleShutdownSetting(msrest.serialization.Model): """ _attribute_map = { - 'idle_time_before_shutdown': {'key': 'idleTimeBeforeShutdown', 'type': 'str'}, + "idle_time_before_shutdown": { + "key": "idleTimeBeforeShutdown", + "type": "str", + }, } def __init__( - self, - *, - idle_time_before_shutdown: Optional[str] = None, - **kwargs + self, *, idle_time_before_shutdown: Optional[str] = None, **kwargs ): """ :keyword idle_time_before_shutdown: Time is defined in ISO8601 format. Minimum is 15 min, @@ -10488,9 +11045,9 @@ class Image(msrest.serialization.Model): """ _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'reference': {'key': 'reference', 'type': 'str'}, + "additional_properties": {"key": "", "type": "{object}"}, + "type": {"key": "type", "type": "str"}, + "reference": {"key": "reference", "type": "str"}, } def __init__( @@ -10519,32 +11076,41 @@ def __init__( class ImageVertical(msrest.serialization.Model): """Abstract class for AutoML tasks that train image (computer vision) models - -such as Image Classification / Image Classification Multilabel / Image Object Detection / Image Instance Segmentation. + such as Image Classification / Image Classification Multilabel / Image Object Detection / Image Instance Segmentation. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float """ _validation = { - 'limit_settings': {'required': True}, + "limit_settings": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, } def __init__( @@ -10602,16 +11168,31 @@ class ImageClassificationBase(ImageVertical): """ _validation = { - 'limit_settings': {'required': True}, + "limit_settings": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsClassification", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsClassification]", + }, } def __init__( @@ -10622,7 +11203,9 @@ def __init__( validation_data: Optional["MLTableJobInput"] = None, validation_data_size: Optional[float] = None, model_settings: Optional["ImageModelSettingsClassification"] = None, - search_space: Optional[List["ImageModelDistributionSettingsClassification"]] = None, + search_space: Optional[ + List["ImageModelDistributionSettingsClassification"] + ] = None, **kwargs ): """ @@ -10645,73 +11228,94 @@ def __init__( :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] """ - super(ImageClassificationBase, self).__init__(limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, **kwargs) + super(ImageClassificationBase, self).__init__( + limit_settings=limit_settings, + sweep_settings=sweep_settings, + validation_data=validation_data, + validation_data_size=validation_data_size, + **kwargs + ) self.model_settings = model_settings self.search_space = search_space class ImageClassification(AutoMLVertical, ImageClassificationBase): """Image Classification. Multi-class image classification is used when an image is classified with only a single label -from a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' or a 'duck'. + from a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' or a 'duck'. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "limit_settings": {"required": True}, + "task_type": {"required": True}, + "training_data": {"required": True}, + } + + _attribute_map = { + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsClassification", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsClassification]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( @@ -10723,10 +11327,14 @@ def __init__( validation_data: Optional["MLTableJobInput"] = None, validation_data_size: Optional[float] = None, model_settings: Optional["ImageModelSettingsClassification"] = None, - search_space: Optional[List["ImageModelDistributionSettingsClassification"]] = None, + search_space: Optional[ + List["ImageModelDistributionSettingsClassification"] + ] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "ClassificationPrimaryMetrics"] + ] = None, **kwargs ): """ @@ -10762,14 +11370,25 @@ def __init__( :paramtype primary_metric: str or ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ - super(ImageClassification, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, model_settings=model_settings, search_space=search_space, **kwargs) + super(ImageClassification, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + limit_settings=limit_settings, + sweep_settings=sweep_settings, + validation_data=validation_data, + validation_data_size=validation_data_size, + model_settings=model_settings, + search_space=search_space, + **kwargs + ) self.limit_settings = limit_settings self.sweep_settings = sweep_settings self.validation_data = validation_data self.validation_data_size = validation_data_size self.model_settings = model_settings self.search_space = search_space - self.task_type = 'ImageClassification' # type: str + self.task_type = "ImageClassification" # type: str self.primary_metric = primary_metric self.log_verbosity = log_verbosity self.target_column_name = target_column_name @@ -10778,66 +11397,81 @@ def __init__( class ImageClassificationMultilabel(AutoMLVertical, ImageClassificationBase): """Image Classification Multilabel. Multi-label image classification is used when an image could have one or more labels -from a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'. + from a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted", "IOU". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics """ _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "limit_settings": {"required": True}, + "task_type": {"required": True}, + "training_data": {"required": True}, + } + + _attribute_map = { + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsClassification", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsClassification]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( @@ -10849,10 +11483,14 @@ def __init__( validation_data: Optional["MLTableJobInput"] = None, validation_data_size: Optional[float] = None, model_settings: Optional["ImageModelSettingsClassification"] = None, - search_space: Optional[List["ImageModelDistributionSettingsClassification"]] = None, + search_space: Optional[ + List["ImageModelDistributionSettingsClassification"] + ] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationMultilabelPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "ClassificationMultilabelPrimaryMetrics"] + ] = None, **kwargs ): """ @@ -10888,14 +11526,25 @@ def __init__( :paramtype primary_metric: str or ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics """ - super(ImageClassificationMultilabel, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, model_settings=model_settings, search_space=search_space, **kwargs) + super(ImageClassificationMultilabel, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + limit_settings=limit_settings, + sweep_settings=sweep_settings, + validation_data=validation_data, + validation_data_size=validation_data_size, + model_settings=model_settings, + search_space=search_space, + **kwargs + ) self.limit_settings = limit_settings self.sweep_settings = sweep_settings self.validation_data = validation_data self.validation_data_size = validation_data_size self.model_settings = model_settings self.search_space = search_space - self.task_type = 'ImageClassificationMultilabel' # type: str + self.task_type = "ImageClassificationMultilabel" # type: str self.primary_metric = primary_metric self.log_verbosity = log_verbosity self.target_column_name = target_column_name @@ -10928,16 +11577,31 @@ class ImageObjectDetectionBase(ImageVertical): """ _validation = { - 'limit_settings': {'required': True}, + "limit_settings": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsObjectDetection", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsObjectDetection]", + }, } def __init__( @@ -10948,7 +11612,9 @@ def __init__( validation_data: Optional["MLTableJobInput"] = None, validation_data_size: Optional[float] = None, model_settings: Optional["ImageModelSettingsObjectDetection"] = None, - search_space: Optional[List["ImageModelDistributionSettingsObjectDetection"]] = None, + search_space: Optional[ + List["ImageModelDistributionSettingsObjectDetection"] + ] = None, **kwargs ): """ @@ -10971,72 +11637,93 @@ def __init__( :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] """ - super(ImageObjectDetectionBase, self).__init__(limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, **kwargs) + super(ImageObjectDetectionBase, self).__init__( + limit_settings=limit_settings, + sweep_settings=sweep_settings, + validation_data=validation_data, + validation_data_size=validation_data_size, + **kwargs + ) self.model_settings = model_settings self.search_space = search_space class ImageInstanceSegmentation(AutoMLVertical, ImageObjectDetectionBase): """Image Instance Segmentation. Instance segmentation is used to identify objects in an image at the pixel level, -drawing a polygon around each object in the image. + drawing a polygon around each object in the image. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "MeanAveragePrecision". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics """ _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "limit_settings": {"required": True}, + "task_type": {"required": True}, + "training_data": {"required": True}, + } + + _attribute_map = { + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsObjectDetection", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsObjectDetection]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( @@ -11048,10 +11735,14 @@ def __init__( validation_data: Optional["MLTableJobInput"] = None, validation_data_size: Optional[float] = None, model_settings: Optional["ImageModelSettingsObjectDetection"] = None, - search_space: Optional[List["ImageModelDistributionSettingsObjectDetection"]] = None, + search_space: Optional[ + List["ImageModelDistributionSettingsObjectDetection"] + ] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "InstanceSegmentationPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "InstanceSegmentationPrimaryMetrics"] + ] = None, **kwargs ): """ @@ -11086,14 +11777,25 @@ def __init__( :paramtype primary_metric: str or ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics """ - super(ImageInstanceSegmentation, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, model_settings=model_settings, search_space=search_space, **kwargs) + super(ImageInstanceSegmentation, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + limit_settings=limit_settings, + sweep_settings=sweep_settings, + validation_data=validation_data, + validation_data_size=validation_data_size, + model_settings=model_settings, + search_space=search_space, + **kwargs + ) self.limit_settings = limit_settings self.sweep_settings = sweep_settings self.validation_data = validation_data self.validation_data_size = validation_data_size self.model_settings = model_settings self.search_space = search_space - self.task_type = 'ImageInstanceSegmentation' # type: str + self.task_type = "ImageInstanceSegmentation" # type: str self.primary_metric = primary_metric self.log_verbosity = log_verbosity self.target_column_name = target_column_name @@ -11112,9 +11814,9 @@ class ImageLimitSettings(msrest.serialization.Model): """ _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_trials": {"key": "maxTrials", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } def __init__( @@ -11153,9 +11855,12 @@ class ImageMetadata(msrest.serialization.Model): """ _attribute_map = { - 'current_image_version': {'key': 'currentImageVersion', 'type': 'str'}, - 'latest_image_version': {'key': 'latestImageVersion', 'type': 'str'}, - 'is_latest_os_image_version': {'key': 'isLatestOsImageVersion', 'type': 'bool'}, + "current_image_version": {"key": "currentImageVersion", "type": "str"}, + "latest_image_version": {"key": "latestImageVersion", "type": "str"}, + "is_latest_os_image_version": { + "key": "isLatestOsImageVersion", + "type": "bool", + }, } def __init__( @@ -11185,129 +11890,147 @@ def __init__( class ImageModelDistributionSettings(msrest.serialization.Model): """Distribution expressions to sweep over values of model settings. -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) -where distribution name can be: uniform, quniform, loguniform, etc -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, + :code:` + Some examples are: + ``` + ModelName = "choice('seresnext', 'resnest50')"; + LearningRate = "uniform(0.001, 0.01)"; + LayersToFreeze = "choice(0, 2)"; + ```` + All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) + where distribution name can be: uniform, quniform, loguniform, etc + For more details on how to compose distribution expressions please check the documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: str + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: str + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: str + :ivar distributed: Whether to use distributer training. + :vartype distributed: str + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: str + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: str + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: str + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: str + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: str + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: str + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: str + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: str + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. + :vartype learning_rate_scheduler: str + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: str + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: str + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: str + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: str + :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. + :vartype optimizer: str + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: str + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: str + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: str + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: str + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: str + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: str + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: str + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: str + """ + + _attribute_map = { + "ams_gradient": {"key": "amsGradient", "type": "str"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "str"}, + "beta2": {"key": "beta2", "type": "str"}, + "distributed": {"key": "distributed", "type": "str"}, + "early_stopping": {"key": "earlyStopping", "type": "str"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "str"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "str", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "str", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "str"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "str", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "str"}, + "nesterov": {"key": "nesterov", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "str"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "str"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "str"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "str"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "str"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "str", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "str", + }, + "weight_decay": {"key": "weightDecay", "type": "str"}, } def __init__( @@ -11456,147 +12179,170 @@ def __init__( self.weight_decay = weight_decay -class ImageModelDistributionSettingsClassification(ImageModelDistributionSettings): +class ImageModelDistributionSettingsClassification( + ImageModelDistributionSettings +): """Distribution expressions to sweep over values of model settings. -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: str - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: str - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: str - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'str'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'str'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'str'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'str'}, + :code:` + Some examples are: + ``` + ModelName = "choice('seresnext', 'resnest50')"; + LearningRate = "uniform(0.001, 0.01)"; + LayersToFreeze = "choice(0, 2)"; + ```` + For more details on how to compose distribution expressions please check the documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: str + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: str + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: str + :ivar distributed: Whether to use distributer training. + :vartype distributed: str + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: str + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: str + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: str + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: str + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: str + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: str + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: str + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: str + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. + :vartype learning_rate_scheduler: str + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: str + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: str + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: str + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: str + :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. + :vartype optimizer: str + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: str + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: str + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: str + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: str + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: str + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: str + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: str + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: str + :ivar training_crop_size: Image crop size that is input to the neural network for the training + dataset. Must be a positive integer. + :vartype training_crop_size: str + :ivar validation_crop_size: Image crop size that is input to the neural network for the + validation dataset. Must be a positive integer. + :vartype validation_crop_size: str + :ivar validation_resize_size: Image size to which to resize before cropping for validation + dataset. Must be a positive integer. + :vartype validation_resize_size: str + :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. + 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be + 0 or 1 or 2. + :vartype weighted_loss: str + """ + + _attribute_map = { + "ams_gradient": {"key": "amsGradient", "type": "str"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "str"}, + "beta2": {"key": "beta2", "type": "str"}, + "distributed": {"key": "distributed", "type": "str"}, + "early_stopping": {"key": "earlyStopping", "type": "str"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "str"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "str", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "str", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "str"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "str", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "str"}, + "nesterov": {"key": "nesterov", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "str"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "str"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "str"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "str"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "str"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "str", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "str", + }, + "weight_decay": {"key": "weightDecay", "type": "str"}, + "training_crop_size": {"key": "trainingCropSize", "type": "str"}, + "validation_crop_size": {"key": "validationCropSize", "type": "str"}, + "validation_resize_size": { + "key": "validationResizeSize", + "type": "str", + }, + "weighted_loss": {"key": "weightedLoss", "type": "str"}, } def __init__( @@ -11731,202 +12477,264 @@ def __init__( 0 or 1 or 2. :paramtype weighted_loss: str """ - super(ImageModelDistributionSettingsClassification, self).__init__(ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) + super(ImageModelDistributionSettingsClassification, self).__init__( + ams_gradient=ams_gradient, + augmentations=augmentations, + beta1=beta1, + beta2=beta2, + distributed=distributed, + early_stopping=early_stopping, + early_stopping_delay=early_stopping_delay, + early_stopping_patience=early_stopping_patience, + enable_onnx_normalization=enable_onnx_normalization, + evaluation_frequency=evaluation_frequency, + gradient_accumulation_step=gradient_accumulation_step, + layers_to_freeze=layers_to_freeze, + learning_rate=learning_rate, + learning_rate_scheduler=learning_rate_scheduler, + model_name=model_name, + momentum=momentum, + nesterov=nesterov, + number_of_epochs=number_of_epochs, + number_of_workers=number_of_workers, + optimizer=optimizer, + random_seed=random_seed, + step_lr_gamma=step_lr_gamma, + step_lr_step_size=step_lr_step_size, + training_batch_size=training_batch_size, + validation_batch_size=validation_batch_size, + warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, + warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, + weight_decay=weight_decay, + **kwargs + ) self.training_crop_size = training_crop_size self.validation_crop_size = validation_crop_size self.validation_resize_size = validation_resize_size self.weighted_loss = weighted_loss -class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettings): +class ImageModelDistributionSettingsObjectDetection( + ImageModelDistributionSettings +): """Distribution expressions to sweep over values of model settings. -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: str - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: str - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: str - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: str - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: str - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype model_size: str - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: str - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - float in the range [0, 1]. - :vartype nms_iou_threshold: str - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: str - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - NMS: Non-maximum suppression. - :vartype tile_predictions_nms_threshold: str - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: str - :ivar validation_metric_type: Metric computation method to use for validation metrics. Must be - 'none', 'coco', 'voc', or 'coco_voc'. - :vartype validation_metric_type: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'str'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'str'}, - 'image_size': {'key': 'imageSize', 'type': 'str'}, - 'max_size': {'key': 'maxSize', 'type': 'str'}, - 'min_size': {'key': 'minSize', 'type': 'str'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'str'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'str'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'str'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'str'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'str'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, + :code:` + Some examples are: + ``` + ModelName = "choice('seresnext', 'resnest50')"; + LearningRate = "uniform(0.001, 0.01)"; + LayersToFreeze = "choice(0, 2)"; + ```` + For more details on how to compose distribution expressions please check the documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: str + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: str + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: str + :ivar distributed: Whether to use distributer training. + :vartype distributed: str + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: str + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: str + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: str + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: str + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: str + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: str + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: str + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: str + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. + :vartype learning_rate_scheduler: str + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: str + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: str + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: str + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: str + :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. + :vartype optimizer: str + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: str + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: str + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: str + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: str + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: str + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: str + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: str + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: str + :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must + be a positive integer. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype box_detections_per_image: str + :ivar box_score_threshold: During inference, only return proposals with a classification score + greater than + BoxScoreThreshold. Must be a float in the range[0, 1]. + :vartype box_score_threshold: str + :ivar image_size: Image size for train and validation. Must be a positive integer. + Note: The training run may get into CUDA OOM if the size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype image_size: str + :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype max_size: str + :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype min_size: str + :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. + Note: training run may get into CUDA OOM if the model size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype model_size: str + :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. + Note: training run may get into CUDA OOM if no sufficient GPU memory. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype multi_scale: str + :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be + float in the range [0, 1]. + :vartype nms_iou_threshold: str + :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not + be + None to enable small object detection logic. A string containing two integers in mxn format. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_grid_size: str + :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float + in the range [0, 1). + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_overlap_ratio: str + :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging + predictions from tiles and image. + Used in validation/ inference. Must be float in the range [0, 1]. + Note: This settings is not supported for the 'yolov5' algorithm. + NMS: Non-maximum suppression. + :vartype tile_predictions_nms_threshold: str + :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be + float in the range [0, 1]. + :vartype validation_iou_threshold: str + :ivar validation_metric_type: Metric computation method to use for validation metrics. Must be + 'none', 'coco', 'voc', or 'coco_voc'. + :vartype validation_metric_type: str + """ + + _attribute_map = { + "ams_gradient": {"key": "amsGradient", "type": "str"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "str"}, + "beta2": {"key": "beta2", "type": "str"}, + "distributed": {"key": "distributed", "type": "str"}, + "early_stopping": {"key": "earlyStopping", "type": "str"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "str"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "str", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "str", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "str"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "str", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "str"}, + "nesterov": {"key": "nesterov", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "str"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "str"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "str"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "str"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "str"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "str", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "str", + }, + "weight_decay": {"key": "weightDecay", "type": "str"}, + "box_detections_per_image": { + "key": "boxDetectionsPerImage", + "type": "str", + }, + "box_score_threshold": {"key": "boxScoreThreshold", "type": "str"}, + "image_size": {"key": "imageSize", "type": "str"}, + "max_size": {"key": "maxSize", "type": "str"}, + "min_size": {"key": "minSize", "type": "str"}, + "model_size": {"key": "modelSize", "type": "str"}, + "multi_scale": {"key": "multiScale", "type": "str"}, + "nms_iou_threshold": {"key": "nmsIouThreshold", "type": "str"}, + "tile_grid_size": {"key": "tileGridSize", "type": "str"}, + "tile_overlap_ratio": {"key": "tileOverlapRatio", "type": "str"}, + "tile_predictions_nms_threshold": { + "key": "tilePredictionsNmsThreshold", + "type": "str", + }, + "validation_iou_threshold": { + "key": "validationIouThreshold", + "type": "str", + }, + "validation_metric_type": { + "key": "validationMetricType", + "type": "str", + }, } def __init__( @@ -12109,7 +12917,37 @@ def __init__( be 'none', 'coco', 'voc', or 'coco_voc'. :paramtype validation_metric_type: str """ - super(ImageModelDistributionSettingsObjectDetection, self).__init__(ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) + super(ImageModelDistributionSettingsObjectDetection, self).__init__( + ams_gradient=ams_gradient, + augmentations=augmentations, + beta1=beta1, + beta2=beta2, + distributed=distributed, + early_stopping=early_stopping, + early_stopping_delay=early_stopping_delay, + early_stopping_patience=early_stopping_patience, + enable_onnx_normalization=enable_onnx_normalization, + evaluation_frequency=evaluation_frequency, + gradient_accumulation_step=gradient_accumulation_step, + layers_to_freeze=layers_to_freeze, + learning_rate=learning_rate, + learning_rate_scheduler=learning_rate_scheduler, + model_name=model_name, + momentum=momentum, + nesterov=nesterov, + number_of_epochs=number_of_epochs, + number_of_workers=number_of_workers, + optimizer=optimizer, + random_seed=random_seed, + step_lr_gamma=step_lr_gamma, + step_lr_step_size=step_lr_step_size, + training_batch_size=training_batch_size, + validation_batch_size=validation_batch_size, + warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, + warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, + weight_decay=weight_decay, + **kwargs + ) self.box_detections_per_image = box_detections_per_image self.box_score_threshold = box_score_threshold self.image_size = image_size @@ -12127,132 +12965,153 @@ def __init__( class ImageModelSettings(msrest.serialization.Model): """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar advanced_settings: Settings for advanced scenarios. + :vartype advanced_settings: str + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: bool + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: float + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: float + :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. + :vartype checkpoint_frequency: int + :ivar checkpoint_model: The pretrained checkpoint model for incremental training. + :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput + :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for + incremental training. + :vartype checkpoint_run_id: str + :ivar distributed: Whether to use distributed training. + :vartype distributed: bool + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: bool + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: int + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: int + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: bool + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: int + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: int + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: int + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: float + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. Possible values include: "None", "WarmupCosine", "Step". + :vartype learning_rate_scheduler: str or + ~azure.mgmt.machinelearningservices.models.LearningRateScheduler + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: float + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: bool + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: int + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: int + :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". + :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: int + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: float + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: int + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: int + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: int + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: float + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: int + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: float + """ + + _attribute_map = { + "advanced_settings": {"key": "advancedSettings", "type": "str"}, + "ams_gradient": {"key": "amsGradient", "type": "bool"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "float"}, + "beta2": {"key": "beta2", "type": "float"}, + "checkpoint_frequency": {"key": "checkpointFrequency", "type": "int"}, + "checkpoint_model": { + "key": "checkpointModel", + "type": "MLFlowModelJobInput", + }, + "checkpoint_run_id": {"key": "checkpointRunId", "type": "str"}, + "distributed": {"key": "distributed", "type": "bool"}, + "early_stopping": {"key": "earlyStopping", "type": "bool"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "int"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "int", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "bool", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "int"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "int", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "int"}, + "learning_rate": {"key": "learningRate", "type": "float"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "float"}, + "nesterov": {"key": "nesterov", "type": "bool"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "int"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "int"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "int"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "float"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "int"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "float", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "int", + }, + "weight_decay": {"key": "weightDecay", "type": "float"}, } def __init__( @@ -12275,7 +13134,9 @@ def __init__( gradient_accumulation_step: Optional[int] = None, layers_to_freeze: Optional[int] = None, learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "LearningRateScheduler"]] = None, + learning_rate_scheduler: Optional[ + Union[str, "LearningRateScheduler"] + ] = None, model_name: Optional[str] = None, momentum: Optional[float] = None, nesterov: Optional[bool] = None, @@ -12422,149 +13283,173 @@ def __init__( class ImageModelSettingsClassification(ImageModelSettings): """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: int - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: int - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: int - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: int - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'int'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'int'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'int'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'int'}, + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar advanced_settings: Settings for advanced scenarios. + :vartype advanced_settings: str + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: bool + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: float + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: float + :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. + :vartype checkpoint_frequency: int + :ivar checkpoint_model: The pretrained checkpoint model for incremental training. + :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput + :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for + incremental training. + :vartype checkpoint_run_id: str + :ivar distributed: Whether to use distributed training. + :vartype distributed: bool + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: bool + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: int + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: int + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: bool + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: int + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: int + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: int + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: float + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. Possible values include: "None", "WarmupCosine", "Step". + :vartype learning_rate_scheduler: str or + ~azure.mgmt.machinelearningservices.models.LearningRateScheduler + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: float + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: bool + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: int + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: int + :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". + :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: int + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: float + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: int + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: int + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: int + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: float + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: int + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: float + :ivar training_crop_size: Image crop size that is input to the neural network for the training + dataset. Must be a positive integer. + :vartype training_crop_size: int + :ivar validation_crop_size: Image crop size that is input to the neural network for the + validation dataset. Must be a positive integer. + :vartype validation_crop_size: int + :ivar validation_resize_size: Image size to which to resize before cropping for validation + dataset. Must be a positive integer. + :vartype validation_resize_size: int + :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. + 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be + 0 or 1 or 2. + :vartype weighted_loss: int + """ + + _attribute_map = { + "advanced_settings": {"key": "advancedSettings", "type": "str"}, + "ams_gradient": {"key": "amsGradient", "type": "bool"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "float"}, + "beta2": {"key": "beta2", "type": "float"}, + "checkpoint_frequency": {"key": "checkpointFrequency", "type": "int"}, + "checkpoint_model": { + "key": "checkpointModel", + "type": "MLFlowModelJobInput", + }, + "checkpoint_run_id": {"key": "checkpointRunId", "type": "str"}, + "distributed": {"key": "distributed", "type": "bool"}, + "early_stopping": {"key": "earlyStopping", "type": "bool"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "int"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "int", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "bool", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "int"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "int", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "int"}, + "learning_rate": {"key": "learningRate", "type": "float"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "float"}, + "nesterov": {"key": "nesterov", "type": "bool"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "int"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "int"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "int"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "float"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "int"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "float", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "int", + }, + "weight_decay": {"key": "weightDecay", "type": "float"}, + "training_crop_size": {"key": "trainingCropSize", "type": "int"}, + "validation_crop_size": {"key": "validationCropSize", "type": "int"}, + "validation_resize_size": { + "key": "validationResizeSize", + "type": "int", + }, + "weighted_loss": {"key": "weightedLoss", "type": "int"}, } def __init__( @@ -12587,7 +13472,9 @@ def __init__( gradient_accumulation_step: Optional[int] = None, layers_to_freeze: Optional[int] = None, learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "LearningRateScheduler"]] = None, + learning_rate_scheduler: Optional[ + Union[str, "LearningRateScheduler"] + ] = None, model_name: Optional[str] = None, momentum: Optional[float] = None, nesterov: Optional[bool] = None, @@ -12714,7 +13601,41 @@ def __init__( 0 or 1 or 2. :paramtype weighted_loss: int """ - super(ImageModelSettingsClassification, self).__init__(advanced_settings=advanced_settings, ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, checkpoint_frequency=checkpoint_frequency, checkpoint_model=checkpoint_model, checkpoint_run_id=checkpoint_run_id, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) + super(ImageModelSettingsClassification, self).__init__( + advanced_settings=advanced_settings, + ams_gradient=ams_gradient, + augmentations=augmentations, + beta1=beta1, + beta2=beta2, + checkpoint_frequency=checkpoint_frequency, + checkpoint_model=checkpoint_model, + checkpoint_run_id=checkpoint_run_id, + distributed=distributed, + early_stopping=early_stopping, + early_stopping_delay=early_stopping_delay, + early_stopping_patience=early_stopping_patience, + enable_onnx_normalization=enable_onnx_normalization, + evaluation_frequency=evaluation_frequency, + gradient_accumulation_step=gradient_accumulation_step, + layers_to_freeze=layers_to_freeze, + learning_rate=learning_rate, + learning_rate_scheduler=learning_rate_scheduler, + model_name=model_name, + momentum=momentum, + nesterov=nesterov, + number_of_epochs=number_of_epochs, + number_of_workers=number_of_workers, + optimizer=optimizer, + random_seed=random_seed, + step_lr_gamma=step_lr_gamma, + step_lr_step_size=step_lr_step_size, + training_batch_size=training_batch_size, + validation_batch_size=validation_batch_size, + warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, + warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, + weight_decay=weight_decay, + **kwargs + ) self.training_crop_size = training_crop_size self.validation_crop_size = validation_crop_size self.validation_resize_size = validation_resize_size @@ -12723,198 +13644,231 @@ def __init__( class ImageModelSettingsObjectDetection(ImageModelSettings): """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: int - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: float - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: int - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: int - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: int - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: - "None", "Small", "Medium", "Large", "ExtraLarge". - :vartype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: bool - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be a - float in the range [0, 1]. - :vartype nms_iou_threshold: float - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: float - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_predictions_nms_threshold: float - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: float - :ivar validation_metric_type: Metric computation method to use for validation metrics. Possible - values include: "None", "Coco", "Voc", "CocoVoc". - :vartype validation_metric_type: str or - ~azure.mgmt.machinelearningservices.models.ValidationMetricType - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'int'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'float'}, - 'image_size': {'key': 'imageSize', 'type': 'int'}, - 'max_size': {'key': 'maxSize', 'type': 'int'}, - 'min_size': {'key': 'minSize', 'type': 'int'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'bool'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'float'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'float'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'float'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'float'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar advanced_settings: Settings for advanced scenarios. + :vartype advanced_settings: str + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: bool + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: float + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: float + :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. + :vartype checkpoint_frequency: int + :ivar checkpoint_model: The pretrained checkpoint model for incremental training. + :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput + :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for + incremental training. + :vartype checkpoint_run_id: str + :ivar distributed: Whether to use distributed training. + :vartype distributed: bool + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: bool + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: int + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: int + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: bool + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: int + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: int + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: int + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: float + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. Possible values include: "None", "WarmupCosine", "Step". + :vartype learning_rate_scheduler: str or + ~azure.mgmt.machinelearningservices.models.LearningRateScheduler + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: float + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: bool + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: int + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: int + :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". + :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: int + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: float + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: int + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: int + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: int + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: float + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: int + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: float + :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must + be a positive integer. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype box_detections_per_image: int + :ivar box_score_threshold: During inference, only return proposals with a classification score + greater than + BoxScoreThreshold. Must be a float in the range[0, 1]. + :vartype box_score_threshold: float + :ivar image_size: Image size for train and validation. Must be a positive integer. + Note: The training run may get into CUDA OOM if the size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype image_size: int + :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype max_size: int + :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype min_size: int + :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. + Note: training run may get into CUDA OOM if the model size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: + "None", "Small", "Medium", "Large", "ExtraLarge". + :vartype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize + :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. + Note: training run may get into CUDA OOM if no sufficient GPU memory. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype multi_scale: bool + :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be a + float in the range [0, 1]. + :vartype nms_iou_threshold: float + :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not + be + None to enable small object detection logic. A string containing two integers in mxn format. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_grid_size: str + :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float + in the range [0, 1). + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_overlap_ratio: float + :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging + predictions from tiles and image. + Used in validation/ inference. Must be float in the range [0, 1]. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_predictions_nms_threshold: float + :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be + float in the range [0, 1]. + :vartype validation_iou_threshold: float + :ivar validation_metric_type: Metric computation method to use for validation metrics. Possible + values include: "None", "Coco", "Voc", "CocoVoc". + :vartype validation_metric_type: str or + ~azure.mgmt.machinelearningservices.models.ValidationMetricType + """ + + _attribute_map = { + "advanced_settings": {"key": "advancedSettings", "type": "str"}, + "ams_gradient": {"key": "amsGradient", "type": "bool"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "float"}, + "beta2": {"key": "beta2", "type": "float"}, + "checkpoint_frequency": {"key": "checkpointFrequency", "type": "int"}, + "checkpoint_model": { + "key": "checkpointModel", + "type": "MLFlowModelJobInput", + }, + "checkpoint_run_id": {"key": "checkpointRunId", "type": "str"}, + "distributed": {"key": "distributed", "type": "bool"}, + "early_stopping": {"key": "earlyStopping", "type": "bool"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "int"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "int", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "bool", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "int"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "int", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "int"}, + "learning_rate": {"key": "learningRate", "type": "float"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "float"}, + "nesterov": {"key": "nesterov", "type": "bool"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "int"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "int"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "int"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "float"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "int"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "float", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "int", + }, + "weight_decay": {"key": "weightDecay", "type": "float"}, + "box_detections_per_image": { + "key": "boxDetectionsPerImage", + "type": "int", + }, + "box_score_threshold": {"key": "boxScoreThreshold", "type": "float"}, + "image_size": {"key": "imageSize", "type": "int"}, + "max_size": {"key": "maxSize", "type": "int"}, + "min_size": {"key": "minSize", "type": "int"}, + "model_size": {"key": "modelSize", "type": "str"}, + "multi_scale": {"key": "multiScale", "type": "bool"}, + "nms_iou_threshold": {"key": "nmsIouThreshold", "type": "float"}, + "tile_grid_size": {"key": "tileGridSize", "type": "str"}, + "tile_overlap_ratio": {"key": "tileOverlapRatio", "type": "float"}, + "tile_predictions_nms_threshold": { + "key": "tilePredictionsNmsThreshold", + "type": "float", + }, + "validation_iou_threshold": { + "key": "validationIouThreshold", + "type": "float", + }, + "validation_metric_type": { + "key": "validationMetricType", + "type": "str", + }, } def __init__( @@ -12937,7 +13891,9 @@ def __init__( gradient_accumulation_step: Optional[int] = None, layers_to_freeze: Optional[int] = None, learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "LearningRateScheduler"]] = None, + learning_rate_scheduler: Optional[ + Union[str, "LearningRateScheduler"] + ] = None, model_name: Optional[str] = None, momentum: Optional[float] = None, nesterov: Optional[bool] = None, @@ -12964,7 +13920,9 @@ def __init__( tile_overlap_ratio: Optional[float] = None, tile_predictions_nms_threshold: Optional[float] = None, validation_iou_threshold: Optional[float] = None, - validation_metric_type: Optional[Union[str, "ValidationMetricType"]] = None, + validation_metric_type: Optional[ + Union[str, "ValidationMetricType"] + ] = None, **kwargs ): """ @@ -13113,7 +14071,41 @@ def __init__( :paramtype validation_metric_type: str or ~azure.mgmt.machinelearningservices.models.ValidationMetricType """ - super(ImageModelSettingsObjectDetection, self).__init__(advanced_settings=advanced_settings, ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, checkpoint_frequency=checkpoint_frequency, checkpoint_model=checkpoint_model, checkpoint_run_id=checkpoint_run_id, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) + super(ImageModelSettingsObjectDetection, self).__init__( + advanced_settings=advanced_settings, + ams_gradient=ams_gradient, + augmentations=augmentations, + beta1=beta1, + beta2=beta2, + checkpoint_frequency=checkpoint_frequency, + checkpoint_model=checkpoint_model, + checkpoint_run_id=checkpoint_run_id, + distributed=distributed, + early_stopping=early_stopping, + early_stopping_delay=early_stopping_delay, + early_stopping_patience=early_stopping_patience, + enable_onnx_normalization=enable_onnx_normalization, + evaluation_frequency=evaluation_frequency, + gradient_accumulation_step=gradient_accumulation_step, + layers_to_freeze=layers_to_freeze, + learning_rate=learning_rate, + learning_rate_scheduler=learning_rate_scheduler, + model_name=model_name, + momentum=momentum, + nesterov=nesterov, + number_of_epochs=number_of_epochs, + number_of_workers=number_of_workers, + optimizer=optimizer, + random_seed=random_seed, + step_lr_gamma=step_lr_gamma, + step_lr_step_size=step_lr_step_size, + training_batch_size=training_batch_size, + validation_batch_size=validation_batch_size, + warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, + warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, + weight_decay=weight_decay, + **kwargs + ) self.box_detections_per_image = box_detections_per_image self.box_score_threshold = box_score_threshold self.image_size = image_size @@ -13131,65 +14123,80 @@ def __init__( class ImageObjectDetection(AutoMLVertical, ImageObjectDetectionBase): """Image Object Detection. Object detection is used to identify objects in an image and locate each object with a -bounding box e.g. locate all dogs and cats in an image and draw a bounding box around each. + bounding box e.g. locate all dogs and cats in an image and draw a bounding box around each. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "MeanAveragePrecision". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics """ _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "limit_settings": {"required": True}, + "task_type": {"required": True}, + "training_data": {"required": True}, + } + + _attribute_map = { + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsObjectDetection", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsObjectDetection]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( @@ -13201,10 +14208,14 @@ def __init__( validation_data: Optional["MLTableJobInput"] = None, validation_data_size: Optional[float] = None, model_settings: Optional["ImageModelSettingsObjectDetection"] = None, - search_space: Optional[List["ImageModelDistributionSettingsObjectDetection"]] = None, + search_space: Optional[ + List["ImageModelDistributionSettingsObjectDetection"] + ] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ObjectDetectionPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "ObjectDetectionPrimaryMetrics"] + ] = None, **kwargs ): """ @@ -13239,14 +14250,25 @@ def __init__( :paramtype primary_metric: str or ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics """ - super(ImageObjectDetection, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, model_settings=model_settings, search_space=search_space, **kwargs) + super(ImageObjectDetection, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + limit_settings=limit_settings, + sweep_settings=sweep_settings, + validation_data=validation_data, + validation_data_size=validation_data_size, + model_settings=model_settings, + search_space=search_space, + **kwargs + ) self.limit_settings = limit_settings self.sweep_settings = sweep_settings self.validation_data = validation_data self.validation_data_size = validation_data_size self.model_settings = model_settings self.search_space = search_space - self.task_type = 'ImageObjectDetection' # type: str + self.task_type = "ImageObjectDetection" # type: str self.primary_metric = primary_metric self.log_verbosity = log_verbosity self.target_column_name = target_column_name @@ -13267,12 +14289,15 @@ class ImageSweepSettings(msrest.serialization.Model): """ _validation = { - 'sampling_algorithm': {'required': True}, + "sampling_algorithm": {"required": True}, } _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, + "sampling_algorithm": {"key": "samplingAlgorithm", "type": "str"}, } def __init__( @@ -13308,9 +14333,9 @@ class InferenceContainerProperties(msrest.serialization.Model): """ _attribute_map = { - 'liveness_route': {'key': 'livenessRoute', 'type': 'Route'}, - 'readiness_route': {'key': 'readinessRoute', 'type': 'Route'}, - 'scoring_route': {'key': 'scoringRoute', 'type': 'Route'}, + "liveness_route": {"key": "livenessRoute", "type": "Route"}, + "readiness_route": {"key": "readinessRoute", "type": "Route"}, + "scoring_route": {"key": "scoringRoute", "type": "Route"}, } def __init__( @@ -13346,8 +14371,11 @@ class InstanceTypeSchema(msrest.serialization.Model): """ _attribute_map = { - 'node_selector': {'key': 'nodeSelector', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'InstanceTypeSchemaResources'}, + "node_selector": {"key": "nodeSelector", "type": "{str}"}, + "resources": { + "key": "resources", + "type": "InstanceTypeSchemaResources", + }, } def __init__( @@ -13378,8 +14406,8 @@ class InstanceTypeSchemaResources(msrest.serialization.Model): """ _attribute_map = { - 'requests': {'key': 'requests', 'type': '{str}'}, - 'limits': {'key': 'limits', 'type': '{str}'}, + "requests": {"key": "requests", "type": "{str}"}, + "limits": {"key": "limits", "type": "{str}"}, } def __init__( @@ -13423,27 +14451,22 @@ class JobBase(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'JobBaseProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "JobBaseProperties"}, } - def __init__( - self, - *, - properties: "JobBaseProperties", - **kwargs - ): + def __init__(self, *, properties: "JobBaseProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.JobBaseProperties @@ -13463,8 +14486,8 @@ class JobBaseResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[JobBase]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[JobBase]"}, } def __init__( @@ -13506,15 +14529,15 @@ class JobResourceConfiguration(ResourceConfiguration): """ _validation = { - 'shm_size': {'pattern': r'\d+[bBkKmMgG]'}, + "shm_size": {"pattern": r"\d+[bBkKmMgG]"}, } _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - 'docker_args': {'key': 'dockerArgs', 'type': 'str'}, - 'shm_size': {'key': 'shmSize', 'type': 'str'}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "properties": {"key": "properties", "type": "{object}"}, + "docker_args": {"key": "dockerArgs", "type": "str"}, + "shm_size": {"key": "shmSize", "type": "str"}, } def __init__( @@ -13543,7 +14566,12 @@ def __init__( b(bytes), k(kilobytes), m(megabytes), or g(gigabytes). :paramtype shm_size: str """ - super(JobResourceConfiguration, self).__init__(instance_count=instance_count, instance_type=instance_type, properties=properties, **kwargs) + super(JobResourceConfiguration, self).__init__( + instance_count=instance_count, + instance_type=instance_type, + properties=properties, + **kwargs + ) self.docker_args = docker_args self.shm_size = shm_size @@ -13561,27 +14589,25 @@ class JobScheduleAction(ScheduleActionBase): """ _validation = { - 'action_type': {'required': True}, - 'job_definition': {'required': True}, + "action_type": {"required": True}, + "job_definition": {"required": True}, } _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'job_definition': {'key': 'jobDefinition', 'type': 'JobBaseProperties'}, + "action_type": {"key": "actionType", "type": "str"}, + "job_definition": { + "key": "jobDefinition", + "type": "JobBaseProperties", + }, } - def __init__( - self, - *, - job_definition: "JobBaseProperties", - **kwargs - ): + def __init__(self, *, job_definition: "JobBaseProperties", **kwargs): """ :keyword job_definition: Required. [Required] Defines Schedule action definition details. :paramtype job_definition: ~azure.mgmt.machinelearningservices.models.JobBaseProperties """ super(JobScheduleAction, self).__init__(**kwargs) - self.action_type = 'CreateJob' # type: str + self.action_type = "CreateJob" # type: str self.job_definition = job_definition @@ -13608,18 +14634,18 @@ class JobService(msrest.serialization.Model): """ _validation = { - 'error_message': {'readonly': True}, - 'status': {'readonly': True}, + "error_message": {"readonly": True}, + "status": {"readonly": True}, } _attribute_map = { - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'job_service_type': {'key': 'jobServiceType', 'type': 'str'}, - 'nodes': {'key': 'nodes', 'type': 'Nodes'}, - 'port': {'key': 'port', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'status': {'key': 'status', 'type': 'str'}, + "endpoint": {"key": "endpoint", "type": "str"}, + "error_message": {"key": "errorMessage", "type": "str"}, + "job_service_type": {"key": "jobServiceType", "type": "str"}, + "nodes": {"key": "nodes", "type": "Nodes"}, + "port": {"key": "port", "type": "int"}, + "properties": {"key": "properties", "type": "{str}"}, + "status": {"key": "status", "type": "str"}, } def __init__( @@ -13663,14 +14689,11 @@ class KubernetesSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, + "properties": {"key": "properties", "type": "KubernetesProperties"}, } def __init__( - self, - *, - properties: Optional["KubernetesProperties"] = None, - **kwargs + self, *, properties: Optional["KubernetesProperties"] = None, **kwargs ): """ :keyword properties: Properties of Kubernetes. @@ -13719,26 +14742,29 @@ class Kubernetes(Compute, KubernetesSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "KubernetesProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -13764,9 +14790,16 @@ def __init__( MSI and AAD exclusively for authentication. :paramtype disable_local_auth: bool """ - super(Kubernetes, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) + super(Kubernetes, self).__init__( + compute_location=compute_location, + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'Kubernetes' # type: str + self.compute_type = "Kubernetes" # type: str self.compute_location = compute_location self.provisioning_state = None self.description = description @@ -13835,31 +14868,49 @@ class OnlineDeploymentProperties(EndpointDeploymentPropertiesBase): """ _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, + "endpoint_compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, + "egress_public_network_access": { + "key": "egressPublicNetworkAccess", + "type": "str", + }, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, + "model": {"key": "model", "type": "str"}, + "model_mount_path": {"key": "modelMountPath", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, } _subtype_map = { - 'endpoint_compute_type': {'Kubernetes': 'KubernetesOnlineDeployment', 'Managed': 'ManagedOnlineDeployment'} + "endpoint_compute_type": { + "Kubernetes": "KubernetesOnlineDeployment", + "Managed": "ManagedOnlineDeployment", + } } def __init__( @@ -13871,7 +14922,9 @@ def __init__( environment_variables: Optional[Dict[str, str]] = None, properties: Optional[Dict[str, str]] = None, app_insights_enabled: Optional[bool] = False, - egress_public_network_access: Optional[Union[str, "EgressPublicNetworkAccessType"]] = None, + egress_public_network_access: Optional[ + Union[str, "EgressPublicNetworkAccessType"] + ] = None, instance_type: Optional[str] = None, liveness_probe: Optional["ProbeSettings"] = None, model: Optional[str] = None, @@ -13919,10 +14972,17 @@ def __init__( and to DefaultScaleSettings for ManagedOnlineDeployment. :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings """ - super(OnlineDeploymentProperties, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, **kwargs) + super(OnlineDeploymentProperties, self).__init__( + code_configuration=code_configuration, + description=description, + environment_id=environment_id, + environment_variables=environment_variables, + properties=properties, + **kwargs + ) self.app_insights_enabled = app_insights_enabled self.egress_public_network_access = egress_public_network_access - self.endpoint_compute_type = 'OnlineDeploymentProperties' # type: str + self.endpoint_compute_type = "OnlineDeploymentProperties" # type: str self.instance_type = instance_type self.liveness_probe = liveness_probe self.model = model @@ -13991,28 +15051,46 @@ class KubernetesOnlineDeployment(OnlineDeploymentProperties): """ _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - 'container_resource_requirements': {'key': 'containerResourceRequirements', 'type': 'ContainerResourceRequirements'}, + "endpoint_compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, + "egress_public_network_access": { + "key": "egressPublicNetworkAccess", + "type": "str", + }, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, + "model": {"key": "model", "type": "str"}, + "model_mount_path": {"key": "modelMountPath", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, + "container_resource_requirements": { + "key": "containerResourceRequirements", + "type": "ContainerResourceRequirements", + }, } def __init__( @@ -14024,7 +15102,9 @@ def __init__( environment_variables: Optional[Dict[str, str]] = None, properties: Optional[Dict[str, str]] = None, app_insights_enabled: Optional[bool] = False, - egress_public_network_access: Optional[Union[str, "EgressPublicNetworkAccessType"]] = None, + egress_public_network_access: Optional[ + Union[str, "EgressPublicNetworkAccessType"] + ] = None, instance_type: Optional[str] = None, liveness_probe: Optional["ProbeSettings"] = None, model: Optional[str] = None, @@ -14032,7 +15112,9 @@ def __init__( readiness_probe: Optional["ProbeSettings"] = None, request_settings: Optional["OnlineRequestSettings"] = None, scale_settings: Optional["OnlineScaleSettings"] = None, - container_resource_requirements: Optional["ContainerResourceRequirements"] = None, + container_resource_requirements: Optional[ + "ContainerResourceRequirements" + ] = None, **kwargs ): """ @@ -14077,8 +15159,24 @@ def __init__( :paramtype container_resource_requirements: ~azure.mgmt.machinelearningservices.models.ContainerResourceRequirements """ - super(KubernetesOnlineDeployment, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, app_insights_enabled=app_insights_enabled, egress_public_network_access=egress_public_network_access, instance_type=instance_type, liveness_probe=liveness_probe, model=model, model_mount_path=model_mount_path, readiness_probe=readiness_probe, request_settings=request_settings, scale_settings=scale_settings, **kwargs) - self.endpoint_compute_type = 'Kubernetes' # type: str + super(KubernetesOnlineDeployment, self).__init__( + code_configuration=code_configuration, + description=description, + environment_id=environment_id, + environment_variables=environment_variables, + properties=properties, + app_insights_enabled=app_insights_enabled, + egress_public_network_access=egress_public_network_access, + instance_type=instance_type, + liveness_probe=liveness_probe, + model=model, + model_mount_path=model_mount_path, + readiness_probe=readiness_probe, + request_settings=request_settings, + scale_settings=scale_settings, + **kwargs + ) + self.endpoint_compute_type = "Kubernetes" # type: str self.container_resource_requirements = container_resource_requirements @@ -14105,14 +15203,29 @@ class KubernetesProperties(msrest.serialization.Model): """ _attribute_map = { - 'relay_connection_string': {'key': 'relayConnectionString', 'type': 'str'}, - 'service_bus_connection_string': {'key': 'serviceBusConnectionString', 'type': 'str'}, - 'extension_principal_id': {'key': 'extensionPrincipalId', 'type': 'str'}, - 'extension_instance_release_train': {'key': 'extensionInstanceReleaseTrain', 'type': 'str'}, - 'vc_name': {'key': 'vcName', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'default_instance_type': {'key': 'defaultInstanceType', 'type': 'str'}, - 'instance_types': {'key': 'instanceTypes', 'type': '{InstanceTypeSchema}'}, + "relay_connection_string": { + "key": "relayConnectionString", + "type": "str", + }, + "service_bus_connection_string": { + "key": "serviceBusConnectionString", + "type": "str", + }, + "extension_principal_id": { + "key": "extensionPrincipalId", + "type": "str", + }, + "extension_instance_release_train": { + "key": "extensionInstanceReleaseTrain", + "type": "str", + }, + "vc_name": {"key": "vcName", "type": "str"}, + "namespace": {"key": "namespace", "type": "str"}, + "default_instance_type": {"key": "defaultInstanceType", "type": "str"}, + "instance_types": { + "key": "instanceTypes", + "type": "{InstanceTypeSchema}", + }, } def __init__( @@ -14151,7 +15264,9 @@ def __init__( self.relay_connection_string = relay_connection_string self.service_bus_connection_string = service_bus_connection_string self.extension_principal_id = extension_principal_id - self.extension_instance_release_train = extension_instance_release_train + self.extension_instance_release_train = ( + extension_instance_release_train + ) self.vc_name = vc_name self.namespace = namespace self.default_instance_type = default_instance_type @@ -14171,21 +15286,17 @@ class ListAmlUserFeatureResult(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlUserFeature]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[AmlUserFeature]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListAmlUserFeatureResult, self).__init__(**kwargs) self.value = None self.next_link = None @@ -14203,21 +15314,17 @@ class ListNotebookKeysResult(msrest.serialization.Model): """ _validation = { - 'primary_access_key': {'readonly': True}, - 'secondary_access_key': {'readonly': True}, + "primary_access_key": {"readonly": True}, + "secondary_access_key": {"readonly": True}, } _attribute_map = { - 'primary_access_key': {'key': 'primaryAccessKey', 'type': 'str'}, - 'secondary_access_key': {'key': 'secondaryAccessKey', 'type': 'str'}, + "primary_access_key": {"key": "primaryAccessKey", "type": "str"}, + "secondary_access_key": {"key": "secondaryAccessKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListNotebookKeysResult, self).__init__(**kwargs) self.primary_access_key = None self.secondary_access_key = None @@ -14233,19 +15340,15 @@ class ListStorageAccountKeysResult(msrest.serialization.Model): """ _validation = { - 'user_storage_key': {'readonly': True}, + "user_storage_key": {"readonly": True}, } _attribute_map = { - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, + "user_storage_key": {"key": "userStorageKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListStorageAccountKeysResult, self).__init__(**kwargs) self.user_storage_key = None @@ -14263,21 +15366,17 @@ class ListUsagesResult(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[Usage]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Usage]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListUsagesResult, self).__init__(**kwargs) self.value = None self.next_link = None @@ -14303,27 +15402,35 @@ class ListWorkspaceKeysResult(msrest.serialization.Model): """ _validation = { - 'user_storage_key': {'readonly': True}, - 'user_storage_resource_id': {'readonly': True}, - 'app_insights_instrumentation_key': {'readonly': True}, - 'container_registry_credentials': {'readonly': True}, - 'notebook_access_keys': {'readonly': True}, - } - - _attribute_map = { - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, - 'user_storage_resource_id': {'key': 'userStorageResourceId', 'type': 'str'}, - 'app_insights_instrumentation_key': {'key': 'appInsightsInstrumentationKey', 'type': 'str'}, - 'container_registry_credentials': {'key': 'containerRegistryCredentials', 'type': 'RegistryListCredentialsResult'}, - 'notebook_access_keys': {'key': 'notebookAccessKeys', 'type': 'ListNotebookKeysResult'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ + "user_storage_key": {"readonly": True}, + "user_storage_resource_id": {"readonly": True}, + "app_insights_instrumentation_key": {"readonly": True}, + "container_registry_credentials": {"readonly": True}, + "notebook_access_keys": {"readonly": True}, + } + + _attribute_map = { + "user_storage_key": {"key": "userStorageKey", "type": "str"}, + "user_storage_resource_id": { + "key": "userStorageResourceId", + "type": "str", + }, + "app_insights_instrumentation_key": { + "key": "appInsightsInstrumentationKey", + "type": "str", + }, + "container_registry_credentials": { + "key": "containerRegistryCredentials", + "type": "RegistryListCredentialsResult", + }, + "notebook_access_keys": { + "key": "notebookAccessKeys", + "type": "ListNotebookKeysResult", + }, + } + + def __init__(self, **kwargs): + """ """ super(ListWorkspaceKeysResult, self).__init__(**kwargs) self.user_storage_key = None self.user_storage_resource_id = None @@ -14345,21 +15452,17 @@ class ListWorkspaceQuotas(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[ResourceQuota]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[ResourceQuota]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListWorkspaceQuotas, self).__init__(**kwargs) self.value = None self.next_link = None @@ -14381,22 +15484,22 @@ class LiteralJobInput(JobInput): """ _validation = { - 'job_input_type': {'required': True}, - 'value': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "job_input_type": {"required": True}, + "value": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, + "value": {"key": "value", "type": "str"}, } def __init__( - self, - *, - value: str, - description: Optional[str] = None, - **kwargs + self, *, value: str, description: Optional[str] = None, **kwargs ): """ :keyword description: Description for the input. @@ -14404,8 +15507,10 @@ def __init__( :keyword value: Required. [Required] Literal value for the input. :paramtype value: str """ - super(LiteralJobInput, self).__init__(description=description, **kwargs) - self.job_input_type = 'literal' # type: str + super(LiteralJobInput, self).__init__( + description=description, **kwargs + ) + self.job_input_type = "literal" # type: str self.value = value @@ -14430,14 +15535,14 @@ class ManagedIdentity(IdentityConfiguration): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + "object_id": {"key": "objectId", "type": "str"}, + "resource_id": {"key": "resourceId", "type": "str"}, } def __init__( @@ -14460,7 +15565,7 @@ def __init__( :paramtype resource_id: str """ super(ManagedIdentity, self).__init__(**kwargs) - self.identity_type = 'Managed' # type: str + self.identity_type = "Managed" # type: str self.client_id = client_id self.object_id = object_id self.resource_id = resource_id @@ -14489,19 +15594,25 @@ class WorkspaceConnectionPropertiesV2(msrest.serialization.Model): """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, } _subtype_map = { - 'auth_type': {'ManagedIdentity': 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', 'None': 'NoneAuthTypeWorkspaceConnectionProperties', 'PAT': 'PATAuthTypeWorkspaceConnectionProperties', 'SAS': 'SASAuthTypeWorkspaceConnectionProperties', 'UsernamePassword': 'UsernamePasswordAuthTypeWorkspaceConnectionProperties'} + "auth_type": { + "ManagedIdentity": "ManagedIdentityAuthTypeWorkspaceConnectionProperties", + "None": "NoneAuthTypeWorkspaceConnectionProperties", + "PAT": "PATAuthTypeWorkspaceConnectionProperties", + "SAS": "SASAuthTypeWorkspaceConnectionProperties", + "UsernamePassword": "UsernamePasswordAuthTypeWorkspaceConnectionProperties", + } } def __init__( @@ -14533,7 +15644,9 @@ def __init__( self.value_format = value_format -class ManagedIdentityAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class ManagedIdentityAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """ManagedIdentityAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -14556,16 +15669,19 @@ class ManagedIdentityAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPr """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionManagedIdentity'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionManagedIdentity", + }, } def __init__( @@ -14593,8 +15709,16 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity """ - super(ManagedIdentityAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'ManagedIdentity' # type: str + super( + ManagedIdentityAuthTypeWorkspaceConnectionProperties, self + ).__init__( + category=category, + target=target, + value=value, + value_format=value_format, + **kwargs + ) + self.auth_type = "ManagedIdentity" # type: str self.credentials = credentials @@ -14652,27 +15776,42 @@ class ManagedOnlineDeployment(OnlineDeploymentProperties): """ _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, + "endpoint_compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, + "egress_public_network_access": { + "key": "egressPublicNetworkAccess", + "type": "str", + }, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, + "model": {"key": "model", "type": "str"}, + "model_mount_path": {"key": "modelMountPath", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, } def __init__( @@ -14684,7 +15823,9 @@ def __init__( environment_variables: Optional[Dict[str, str]] = None, properties: Optional[Dict[str, str]] = None, app_insights_enabled: Optional[bool] = False, - egress_public_network_access: Optional[Union[str, "EgressPublicNetworkAccessType"]] = None, + egress_public_network_access: Optional[ + Union[str, "EgressPublicNetworkAccessType"] + ] = None, instance_type: Optional[str] = None, liveness_probe: Optional["ProbeSettings"] = None, model: Optional[str] = None, @@ -14732,8 +15873,24 @@ def __init__( and to DefaultScaleSettings for ManagedOnlineDeployment. :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings """ - super(ManagedOnlineDeployment, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, app_insights_enabled=app_insights_enabled, egress_public_network_access=egress_public_network_access, instance_type=instance_type, liveness_probe=liveness_probe, model=model, model_mount_path=model_mount_path, readiness_probe=readiness_probe, request_settings=request_settings, scale_settings=scale_settings, **kwargs) - self.endpoint_compute_type = 'Managed' # type: str + super(ManagedOnlineDeployment, self).__init__( + code_configuration=code_configuration, + description=description, + environment_id=environment_id, + environment_variables=environment_variables, + properties=properties, + app_insights_enabled=app_insights_enabled, + egress_public_network_access=egress_public_network_access, + instance_type=instance_type, + liveness_probe=liveness_probe, + model=model, + model_mount_path=model_mount_path, + readiness_probe=readiness_probe, + request_settings=request_settings, + scale_settings=scale_settings, + **kwargs + ) + self.endpoint_compute_type = "Managed" # type: str class ManagedServiceIdentity(msrest.serialization.Model): @@ -14762,23 +15919,28 @@ class ManagedServiceIdentity(msrest.serialization.Model): """ _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, + "principal_id": {"readonly": True}, + "tenant_id": {"readonly": True}, + "type": {"required": True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{UserAssignedIdentity}", + }, } def __init__( self, *, type: Union[str, "ManagedServiceIdentityType"], - user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, + user_assigned_identities: Optional[ + Dict[str, "UserAssignedIdentity"] + ] = None, **kwargs ): """ @@ -14826,23 +15988,28 @@ class ManagedServiceIdentityAutoGenerated(msrest.serialization.Model): """ _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, + "principal_id": {"readonly": True}, + "tenant_id": {"readonly": True}, + "type": {"required": True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{UserAssignedIdentity}", + }, } def __init__( self, *, type: Union[str, "ManagedServiceIdentityType"], - user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, + user_assigned_identities: Optional[ + Dict[str, "UserAssignedIdentity"] + ] = None, **kwargs ): """ @@ -14880,13 +16047,13 @@ class MedianStoppingPolicy(EarlyTerminationPolicy): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, } def __init__( @@ -14902,8 +16069,12 @@ def __init__( :keyword evaluation_interval: Interval (number of runs) between policy evaluations. :paramtype evaluation_interval: int """ - super(MedianStoppingPolicy, self).__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs) - self.policy_type = 'MedianStopping' # type: str + super(MedianStoppingPolicy, self).__init__( + delay_evaluation=delay_evaluation, + evaluation_interval=evaluation_interval, + **kwargs + ) + self.policy_type = "MedianStopping" # type: str class MLFlowModelJobInput(JobInput, AssetJobInput): @@ -14925,15 +16096,15 @@ class MLFlowModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "min_length": 1, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -14953,10 +16124,12 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(MLFlowModelJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(MLFlowModelJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'mlflow_model' # type: str + self.job_input_type = "mlflow_model" # type: str self.description = description @@ -14978,14 +16151,14 @@ class MLFlowModelJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -15004,10 +16177,12 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(MLFlowModelJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(MLFlowModelJobOutput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_output_type = 'mlflow_model' # type: str + self.job_output_type = "mlflow_model" # type: str self.description = description @@ -15037,19 +16212,23 @@ class MLTableData(DataVersionBaseProperties): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'referenced_uris': {'key': 'referencedUris', 'type': '[str]'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, + "referenced_uris": {"key": "referencedUris", "type": "[str]"}, } def __init__( @@ -15081,8 +16260,16 @@ def __init__( :keyword referenced_uris: Uris referenced in the MLTable definition (required for lineage). :paramtype referenced_uris: list[str] """ - super(MLTableData, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, **kwargs) - self.data_type = 'mltable' # type: str + super(MLTableData, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + data_uri=data_uri, + **kwargs + ) + self.data_type = "mltable" # type: str self.referenced_uris = referenced_uris @@ -15105,15 +16292,15 @@ class MLTableJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "min_length": 1, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -15133,10 +16320,12 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(MLTableJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(MLTableJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'mltable' # type: str + self.job_input_type = "mltable" # type: str self.description = description @@ -15158,14 +16347,14 @@ class MLTableJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -15184,10 +16373,12 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(MLTableJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(MLTableJobOutput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_output_type = 'mltable' # type: str + self.job_output_type = "mltable" # type: str self.description = description @@ -15214,27 +16405,25 @@ class ModelContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "ModelContainerProperties", + }, } - def __init__( - self, - *, - properties: "ModelContainerProperties", - **kwargs - ): + def __init__(self, *, properties: "ModelContainerProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelContainerProperties @@ -15267,19 +16456,19 @@ class ModelContainerProperties(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } def __init__( @@ -15301,7 +16490,13 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(ModelContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) + super(ModelContainerProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs + ) self.provisioning_state = None @@ -15316,8 +16511,8 @@ class ModelContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ModelContainer]"}, } def __init__( @@ -15334,7 +16529,9 @@ def __init__( :keyword value: An array of objects of type ModelContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelContainer] """ - super(ModelContainerResourceArmPaginatedResult, self).__init__(**kwargs) + super(ModelContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -15362,27 +16559,22 @@ class ModelVersion(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelVersionProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "ModelVersionProperties"}, } - def __init__( - self, - *, - properties: "ModelVersionProperties", - **kwargs - ): + def __init__(self, *, properties: "ModelVersionProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelVersionProperties @@ -15423,21 +16615,21 @@ class ModelVersionProperties(AssetBase): """ _validation = { - 'provisioning_state': {'readonly': True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'flavors': {'key': 'flavors', 'type': '{FlavorData}'}, - 'job_name': {'key': 'jobName', 'type': 'str'}, - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'model_uri': {'key': 'modelUri', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "flavors": {"key": "flavors", "type": "{FlavorData}"}, + "job_name": {"key": "jobName", "type": "str"}, + "model_type": {"key": "modelType", "type": "str"}, + "model_uri": {"key": "modelUri", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "stage": {"key": "stage", "type": "str"}, } def __init__( @@ -15477,7 +16669,14 @@ def __init__( :keyword stage: Stage in the model lifecycle assigned to this model. :paramtype stage: str """ - super(ModelVersionProperties, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) + super(ModelVersionProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + **kwargs + ) self.flavors = flavors self.job_name = job_name self.model_type = model_type @@ -15497,8 +16696,8 @@ class ModelVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelVersion]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ModelVersion]"}, } def __init__( @@ -15533,52 +16732,63 @@ class Mpi(DistributionConfiguration): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, + "distribution_type": {"key": "distributionType", "type": "str"}, + "process_count_per_instance": { + "key": "processCountPerInstance", + "type": "int", + }, } def __init__( - self, - *, - process_count_per_instance: Optional[int] = None, - **kwargs + self, *, process_count_per_instance: Optional[int] = None, **kwargs ): """ :keyword process_count_per_instance: Number of processes per MPI node. :paramtype process_count_per_instance: int """ super(Mpi, self).__init__(**kwargs) - self.distribution_type = 'Mpi' # type: str + self.distribution_type = "Mpi" # type: str self.process_count_per_instance = process_count_per_instance class NlpVertical(msrest.serialization.Model): """Abstract class for NLP related AutoML tasks. -NLP - Natural Language Processing. + NLP - Natural Language Processing. - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, } def __init__( self, *, - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "NlpVerticalFeaturizationSettings" + ] = None, limit_settings: Optional["NlpVerticalLimitSettings"] = None, validation_data: Optional["MLTableJobInput"] = None, **kwargs @@ -15606,20 +16816,17 @@ class NlpVerticalFeaturizationSettings(FeaturizationSettings): """ _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, + "dataset_language": {"key": "datasetLanguage", "type": "str"}, } - def __init__( - self, - *, - dataset_language: Optional[str] = None, - **kwargs - ): + def __init__(self, *, dataset_language: Optional[str] = None, **kwargs): """ :keyword dataset_language: Dataset language, useful for the text data. :paramtype dataset_language: str """ - super(NlpVerticalFeaturizationSettings, self).__init__(dataset_language=dataset_language, **kwargs) + super(NlpVerticalFeaturizationSettings, self).__init__( + dataset_language=dataset_language, **kwargs + ) class NlpVerticalLimitSettings(msrest.serialization.Model): @@ -15634,9 +16841,9 @@ class NlpVerticalLimitSettings(msrest.serialization.Model): """ _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_trials": {"key": "maxTrials", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } def __init__( @@ -15681,29 +16888,25 @@ class NodeStateCounts(msrest.serialization.Model): """ _validation = { - 'idle_node_count': {'readonly': True}, - 'running_node_count': {'readonly': True}, - 'preparing_node_count': {'readonly': True}, - 'unusable_node_count': {'readonly': True}, - 'leaving_node_count': {'readonly': True}, - 'preempted_node_count': {'readonly': True}, + "idle_node_count": {"readonly": True}, + "running_node_count": {"readonly": True}, + "preparing_node_count": {"readonly": True}, + "unusable_node_count": {"readonly": True}, + "leaving_node_count": {"readonly": True}, + "preempted_node_count": {"readonly": True}, } _attribute_map = { - 'idle_node_count': {'key': 'idleNodeCount', 'type': 'int'}, - 'running_node_count': {'key': 'runningNodeCount', 'type': 'int'}, - 'preparing_node_count': {'key': 'preparingNodeCount', 'type': 'int'}, - 'unusable_node_count': {'key': 'unusableNodeCount', 'type': 'int'}, - 'leaving_node_count': {'key': 'leavingNodeCount', 'type': 'int'}, - 'preempted_node_count': {'key': 'preemptedNodeCount', 'type': 'int'}, + "idle_node_count": {"key": "idleNodeCount", "type": "int"}, + "running_node_count": {"key": "runningNodeCount", "type": "int"}, + "preparing_node_count": {"key": "preparingNodeCount", "type": "int"}, + "unusable_node_count": {"key": "unusableNodeCount", "type": "int"}, + "leaving_node_count": {"key": "leavingNodeCount", "type": "int"}, + "preempted_node_count": {"key": "preemptedNodeCount", "type": "int"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NodeStateCounts, self).__init__(**kwargs) self.idle_node_count = None self.running_node_count = None @@ -15713,7 +16916,9 @@ def __init__( self.preempted_node_count = None -class NoneAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class NoneAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """NoneAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -15733,15 +16938,15 @@ class NoneAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2) """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, } def __init__( @@ -15765,8 +16970,14 @@ def __init__( "JSON". :paramtype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat """ - super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'None' # type: str + super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__( + category=category, + target=target, + value=value, + value_format=value_format, + **kwargs + ) + self.auth_type = "None" # type: str class NoneDatastoreCredentials(DatastoreCredentials): @@ -15781,21 +16992,17 @@ class NoneDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, + "credentials_type": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NoneDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'None' # type: str + self.credentials_type = "None" # type: str class NotebookAccessTokenResult(msrest.serialization.Model): @@ -15822,33 +17029,29 @@ class NotebookAccessTokenResult(msrest.serialization.Model): """ _validation = { - 'notebook_resource_id': {'readonly': True}, - 'host_name': {'readonly': True}, - 'public_dns': {'readonly': True}, - 'access_token': {'readonly': True}, - 'token_type': {'readonly': True}, - 'expires_in': {'readonly': True}, - 'refresh_token': {'readonly': True}, - 'scope': {'readonly': True}, + "notebook_resource_id": {"readonly": True}, + "host_name": {"readonly": True}, + "public_dns": {"readonly": True}, + "access_token": {"readonly": True}, + "token_type": {"readonly": True}, + "expires_in": {"readonly": True}, + "refresh_token": {"readonly": True}, + "scope": {"readonly": True}, } _attribute_map = { - 'notebook_resource_id': {'key': 'notebookResourceId', 'type': 'str'}, - 'host_name': {'key': 'hostName', 'type': 'str'}, - 'public_dns': {'key': 'publicDns', 'type': 'str'}, - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, - 'expires_in': {'key': 'expiresIn', 'type': 'int'}, - 'refresh_token': {'key': 'refreshToken', 'type': 'str'}, - 'scope': {'key': 'scope', 'type': 'str'}, + "notebook_resource_id": {"key": "notebookResourceId", "type": "str"}, + "host_name": {"key": "hostName", "type": "str"}, + "public_dns": {"key": "publicDns", "type": "str"}, + "access_token": {"key": "accessToken", "type": "str"}, + "token_type": {"key": "tokenType", "type": "str"}, + "expires_in": {"key": "expiresIn", "type": "int"}, + "refresh_token": {"key": "refreshToken", "type": "str"}, + "scope": {"key": "scope", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NotebookAccessTokenResult, self).__init__(**kwargs) self.notebook_resource_id = None self.host_name = None @@ -15870,8 +17073,8 @@ class NotebookPreparationError(msrest.serialization.Model): """ _attribute_map = { - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'status_code': {'key': 'statusCode', 'type': 'int'}, + "error_message": {"key": "errorMessage", "type": "str"}, + "status_code": {"key": "statusCode", "type": "int"}, } def __init__( @@ -15905,9 +17108,12 @@ class NotebookResourceInfo(msrest.serialization.Model): """ _attribute_map = { - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'notebook_preparation_error': {'key': 'notebookPreparationError', 'type': 'NotebookPreparationError'}, + "fqdn": {"key": "fqdn", "type": "str"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "notebook_preparation_error": { + "key": "notebookPreparationError", + "type": "NotebookPreparationError", + }, } def __init__( @@ -15915,7 +17121,9 @@ def __init__( *, fqdn: Optional[str] = None, resource_id: Optional[str] = None, - notebook_preparation_error: Optional["NotebookPreparationError"] = None, + notebook_preparation_error: Optional[ + "NotebookPreparationError" + ] = None, **kwargs ): """ @@ -15946,21 +17154,21 @@ class Objective(msrest.serialization.Model): """ _validation = { - 'goal': {'required': True}, - 'primary_metric': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "goal": {"required": True}, + "primary_metric": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'goal': {'key': 'goal', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "goal": {"key": "goal", "type": "str"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( - self, - *, - goal: Union[str, "Goal"], - primary_metric: str, - **kwargs + self, *, goal: Union[str, "Goal"], primary_metric: str, **kwargs ): """ :keyword goal: Required. [Required] Defines supported metric goals for hyperparameter tuning. @@ -16008,25 +17216,28 @@ class OnlineDeployment(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineDeploymentProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": { + "key": "properties", + "type": "OnlineDeploymentProperties", + }, + "sku": {"key": "sku", "type": "Sku"}, } def __init__( @@ -16055,14 +17266,18 @@ def __init__( :keyword sku: Sku details required for ARM contract for Autoscaling. :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ - super(OnlineDeployment, self).__init__(tags=tags, location=location, **kwargs) + super(OnlineDeployment, self).__init__( + tags=tags, location=location, **kwargs + ) self.identity = identity self.kind = kind self.properties = properties self.sku = sku -class OnlineDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class OnlineDeploymentTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of OnlineDeployment entities. :ivar next_link: The link to the next page of OnlineDeployment objects. If null, there are no @@ -16073,8 +17288,8 @@ class OnlineDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Mod """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineDeployment]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[OnlineDeployment]"}, } def __init__( @@ -16091,7 +17306,9 @@ def __init__( :keyword value: An array of objects of type OnlineDeployment. :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineDeployment] """ - super(OnlineDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) + super( + OnlineDeploymentTrackedResourceArmPaginatedResult, self + ).__init__(**kwargs) self.next_link = next_link self.value = value @@ -16130,25 +17347,28 @@ class OnlineEndpoint(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": { + "key": "properties", + "type": "OnlineEndpointProperties", + }, + "sku": {"key": "sku", "type": "Sku"}, } def __init__( @@ -16177,7 +17397,9 @@ def __init__( :keyword sku: Sku details required for ARM contract for Autoscaling. :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ - super(OnlineEndpoint, self).__init__(tags=tags, location=location, **kwargs) + super(OnlineEndpoint, self).__init__( + tags=tags, location=location, **kwargs + ) self.identity = identity self.kind = kind self.properties = properties @@ -16227,24 +17449,24 @@ class OnlineEndpointProperties(EndpointPropertiesBase): """ _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "auth_mode": {"required": True}, + "scoring_uri": {"readonly": True}, + "swagger_uri": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'mirror_traffic': {'key': 'mirrorTraffic', 'type': '{int}'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, - 'traffic': {'key': 'traffic', 'type': '{int}'}, + "auth_mode": {"key": "authMode", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "keys": {"key": "keys", "type": "EndpointAuthKeys"}, + "properties": {"key": "properties", "type": "{str}"}, + "scoring_uri": {"key": "scoringUri", "type": "str"}, + "swagger_uri": {"key": "swaggerUri", "type": "str"}, + "compute": {"key": "compute", "type": "str"}, + "mirror_traffic": {"key": "mirrorTraffic", "type": "{int}"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "public_network_access": {"key": "publicNetworkAccess", "type": "str"}, + "traffic": {"key": "traffic", "type": "{int}"}, } def __init__( @@ -16256,7 +17478,9 @@ def __init__( properties: Optional[Dict[str, str]] = None, compute: Optional[str] = None, mirror_traffic: Optional[Dict[str, int]] = None, - public_network_access: Optional[Union[str, "PublicNetworkAccessType"]] = None, + public_network_access: Optional[ + Union[str, "PublicNetworkAccessType"] + ] = None, traffic: Optional[Dict[str, int]] = None, **kwargs ): @@ -16287,7 +17511,13 @@ def __init__( values need to sum to 100. :paramtype traffic: dict[str, int] """ - super(OnlineEndpointProperties, self).__init__(auth_mode=auth_mode, description=description, keys=keys, properties=properties, **kwargs) + super(OnlineEndpointProperties, self).__init__( + auth_mode=auth_mode, + description=description, + keys=keys, + properties=properties, + **kwargs + ) self.compute = compute self.mirror_traffic = mirror_traffic self.provisioning_state = None @@ -16295,7 +17525,9 @@ def __init__( self.traffic = traffic -class OnlineEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class OnlineEndpointTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of OnlineEndpoint entities. :ivar next_link: The link to the next page of OnlineEndpoint objects. If null, there are no @@ -16306,8 +17538,8 @@ class OnlineEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineEndpoint]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[OnlineEndpoint]"}, } def __init__( @@ -16324,7 +17556,9 @@ def __init__( :keyword value: An array of objects of type OnlineEndpoint. :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] """ - super(OnlineEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) + super(OnlineEndpointTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -16345,9 +17579,12 @@ class OnlineRequestSettings(msrest.serialization.Model): """ _attribute_map = { - 'max_concurrent_requests_per_instance': {'key': 'maxConcurrentRequestsPerInstance', 'type': 'int'}, - 'max_queue_wait': {'key': 'maxQueueWait', 'type': 'duration'}, - 'request_timeout': {'key': 'requestTimeout', 'type': 'duration'}, + "max_concurrent_requests_per_instance": { + "key": "maxConcurrentRequestsPerInstance", + "type": "int", + }, + "max_queue_wait": {"key": "maxQueueWait", "type": "duration"}, + "request_timeout": {"key": "requestTimeout", "type": "duration"}, } def __init__( @@ -16371,7 +17608,9 @@ def __init__( :paramtype request_timeout: ~datetime.timedelta """ super(OnlineRequestSettings, self).__init__(**kwargs) - self.max_concurrent_requests_per_instance = max_concurrent_requests_per_instance + self.max_concurrent_requests_per_instance = ( + max_concurrent_requests_per_instance + ) self.max_queue_wait = max_queue_wait self.request_timeout = request_timeout @@ -16391,13 +17630,13 @@ class OutputPathAssetReference(AssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "job_id": {"key": "jobId", "type": "str"}, + "path": {"key": "path", "type": "str"}, } def __init__( @@ -16414,7 +17653,7 @@ def __init__( :paramtype path: str """ super(OutputPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'OutputPath' # type: str + self.reference_type = "OutputPath" # type: str self.job_id = job_id self.path = path @@ -16429,8 +17668,8 @@ class PaginatedComputeResourcesList(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[ComputeResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[ComputeResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( @@ -16459,15 +17698,10 @@ class PartialBatchDeployment(msrest.serialization.Model): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, } - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): + def __init__(self, *, description: Optional[str] = None, **kwargs): """ :keyword description: Description of the endpoint deployment. :paramtype description: str @@ -16476,7 +17710,9 @@ def __init__( self.description = description -class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties(msrest.serialization.Model): +class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties( + msrest.serialization.Model +): """Strictly used in update requests. :ivar properties: Additional attributes of the entity. @@ -16486,8 +17722,8 @@ class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties(msrest.s """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'PartialBatchDeployment'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "properties": {"key": "properties", "type": "PartialBatchDeployment"}, + "tags": {"key": "tags", "type": "{str}"}, } def __init__( @@ -16503,7 +17739,10 @@ def __init__( :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] """ - super(PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, self).__init__(**kwargs) + super( + PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, + self, + ).__init__(**kwargs) self.properties = properties self.tags = tags @@ -16534,23 +17773,28 @@ class PartialManagedServiceIdentity(ManagedServiceIdentityAutoGenerated): """ _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, + "principal_id": {"readonly": True}, + "tenant_id": {"readonly": True}, + "type": {"required": True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{UserAssignedIdentity}", + }, } def __init__( self, *, type: Union[str, "ManagedServiceIdentityType"], - user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, + user_assigned_identities: Optional[ + Dict[str, "UserAssignedIdentity"] + ] = None, **kwargs ): """ @@ -16565,7 +17809,11 @@ def __init__( :paramtype user_assigned_identities: dict[str, ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] """ - super(PartialManagedServiceIdentity, self).__init__(type=type, user_assigned_identities=user_assigned_identities, **kwargs) + super(PartialManagedServiceIdentity, self).__init__( + type=type, + user_assigned_identities=user_assigned_identities, + **kwargs + ) class PartialManagedServiceIdentityAutoGenerated(msrest.serialization.Model): @@ -16583,8 +17831,11 @@ class PartialManagedServiceIdentityAutoGenerated(msrest.serialization.Model): """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{object}'}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{object}", + }, } def __init__( @@ -16605,7 +17856,9 @@ def __init__( The dictionary values can be empty objects ({}) in requests. :paramtype user_assigned_identities: dict[str, any] """ - super(PartialManagedServiceIdentityAutoGenerated, self).__init__(**kwargs) + super(PartialManagedServiceIdentityAutoGenerated, self).__init__( + **kwargs + ) self.type = type self.user_assigned_identities = user_assigned_identities @@ -16618,15 +17871,10 @@ class PartialMinimalTrackedResource(msrest.serialization.Model): """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): + def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -16646,15 +17894,20 @@ class PartialMinimalTrackedResourceWithIdentity(PartialMinimalTrackedResource): """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentityAutoGenerated'}, + "tags": {"key": "tags", "type": "{str}"}, + "identity": { + "key": "identity", + "type": "PartialManagedServiceIdentityAutoGenerated", + }, } def __init__( self, *, tags: Optional[Dict[str, str]] = None, - identity: Optional["PartialManagedServiceIdentityAutoGenerated"] = None, + identity: Optional[ + "PartialManagedServiceIdentityAutoGenerated" + ] = None, **kwargs ): """ @@ -16664,7 +17917,9 @@ def __init__( :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentityAutoGenerated """ - super(PartialMinimalTrackedResourceWithIdentity, self).__init__(tags=tags, **kwargs) + super(PartialMinimalTrackedResourceWithIdentity, self).__init__( + tags=tags, **kwargs + ) self.identity = identity @@ -16678,8 +17933,8 @@ class PartialMinimalTrackedResourceWithSku(PartialMinimalTrackedResource): """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "PartialSku"}, } def __init__( @@ -16695,7 +17950,9 @@ def __init__( :keyword sku: Sku details required for ARM contract for Autoscaling. :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku """ - super(PartialMinimalTrackedResourceWithSku, self).__init__(tags=tags, **kwargs) + super(PartialMinimalTrackedResourceWithSku, self).__init__( + tags=tags, **kwargs + ) self.sku = sku @@ -16711,9 +17968,12 @@ class PartialRegistryPartialTrackedResource(msrest.serialization.Model): """ _attribute_map = { - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "identity": { + "key": "identity", + "type": "PartialManagedServiceIdentity", + }, + "sku": {"key": "sku", "type": "PartialSku"}, + "tags": {"key": "tags", "type": "{str}"}, } def __init__( @@ -16759,11 +18019,11 @@ class PartialSku(msrest.serialization.Model): """ _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'int'}, - 'family': {'key': 'family', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, + "capacity": {"key": "capacity", "type": "int"}, + "family": {"key": "family", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "size": {"key": "size", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, } def __init__( @@ -16813,27 +18073,25 @@ class Password(msrest.serialization.Model): """ _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, + "name": {"readonly": True}, + "value": {"readonly": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "value": {"key": "value", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Password, self).__init__(**kwargs) self.name = None self.value = None -class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class PATAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """PATAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -16856,16 +18114,19 @@ class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionPersonalAccessToken'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionPersonalAccessToken", + }, } def __init__( @@ -16893,8 +18154,14 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken """ - super(PATAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'PAT' # type: str + super(PATAuthTypeWorkspaceConnectionProperties, self).__init__( + category=category, + target=target, + value=value, + value_format=value_format, + **kwargs + ) + self.auth_type = "PAT" # type: str self.credentials = credentials @@ -16913,23 +18180,17 @@ class PendingUploadCredentialDto(msrest.serialization.Model): """ _validation = { - 'credential_type': {'required': True}, + "credential_type": {"required": True}, } _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, + "credential_type": {"key": "credentialType", "type": "str"}, } - _subtype_map = { - 'credential_type': {'SAS': 'SASCredentialDto'} - } + _subtype_map = {"credential_type": {"SAS": "SASCredentialDto"}} - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(PendingUploadCredentialDto, self).__init__(**kwargs) self.credential_type = None # type: Optional[str] @@ -16946,8 +18207,8 @@ class PendingUploadRequestDto(msrest.serialization.Model): """ _attribute_map = { - 'pending_upload_id': {'key': 'pendingUploadId', 'type': 'str'}, - 'pending_upload_type': {'key': 'pendingUploadType', 'type': 'str'}, + "pending_upload_id": {"key": "pendingUploadId", "type": "str"}, + "pending_upload_type": {"key": "pendingUploadType", "type": "str"}, } def __init__( @@ -16985,15 +18246,20 @@ class PendingUploadResponseDto(msrest.serialization.Model): """ _attribute_map = { - 'blob_reference_for_consumption': {'key': 'blobReferenceForConsumption', 'type': 'BlobReferenceForConsumptionDto'}, - 'pending_upload_id': {'key': 'pendingUploadId', 'type': 'str'}, - 'pending_upload_type': {'key': 'pendingUploadType', 'type': 'str'}, + "blob_reference_for_consumption": { + "key": "blobReferenceForConsumption", + "type": "BlobReferenceForConsumptionDto", + }, + "pending_upload_id": {"key": "pendingUploadId", "type": "str"}, + "pending_upload_type": {"key": "pendingUploadType", "type": "str"}, } def __init__( self, *, - blob_reference_for_consumption: Optional["BlobReferenceForConsumptionDto"] = None, + blob_reference_for_consumption: Optional[ + "BlobReferenceForConsumptionDto" + ] = None, pending_upload_id: Optional[str] = None, pending_upload_type: Optional[Union[str, "PendingUploadType"]] = None, **kwargs @@ -17023,14 +18289,11 @@ class PersonalComputeInstanceSettings(msrest.serialization.Model): """ _attribute_map = { - 'assigned_user': {'key': 'assignedUser', 'type': 'AssignedUser'}, + "assigned_user": {"key": "assignedUser", "type": "AssignedUser"}, } - - def __init__( - self, - *, - assigned_user: Optional["AssignedUser"] = None, - **kwargs + + def __init__( + self, *, assigned_user: Optional["AssignedUser"] = None, **kwargs ): """ :keyword assigned_user: A user explicitly assigned to a personal compute instance. @@ -17091,28 +18354,28 @@ class PipelineJob(JobBaseProperties): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, + "job_type": {"required": True}, + "status": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'jobs': {'key': 'jobs', 'type': '{object}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'settings': {'key': 'settings', 'type': 'object'}, - 'source_job_id': {'key': 'sourceJobId', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "jobs": {"key": "jobs", "type": "{object}"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "settings": {"key": "settings", "type": "object"}, + "source_job_id": {"key": "sourceJobId", "type": "str"}, } def __init__( @@ -17171,8 +18434,20 @@ def __init__( :keyword source_job_id: ARM resource ID of source job. :paramtype source_job_id: str """ - super(PipelineJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, services=services, **kwargs) - self.job_type = 'Pipeline' # type: str + super(PipelineJob, self).__init__( + description=description, + properties=properties, + tags=tags, + component_id=component_id, + compute_id=compute_id, + display_name=display_name, + experiment_name=experiment_name, + identity=identity, + is_archived=is_archived, + services=services, + **kwargs + ) + self.job_type = "Pipeline" # type: str self.inputs = inputs self.jobs = jobs self.outputs = outputs @@ -17192,21 +18467,17 @@ class PrivateEndpoint(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'subnet_arm_id': {'readonly': True}, + "id": {"readonly": True}, + "subnet_arm_id": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'subnet_arm_id': {'key': 'subnetArmId', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "subnet_arm_id": {"key": "subnetArmId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(PrivateEndpoint, self).__init__(**kwargs) self.id = None self.subnet_arm_id = None @@ -17222,19 +18493,15 @@ class PrivateEndpointAutoGenerated(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, + "id": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(PrivateEndpointAutoGenerated, self).__init__(**kwargs) self.id = None @@ -17276,25 +18543,34 @@ class PrivateEndpointConnection(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "private_endpoint": { + "key": "properties.privateEndpoint", + "type": "PrivateEndpoint", + }, + "private_link_service_connection_state": { + "key": "properties.privateLinkServiceConnectionState", + "type": "PrivateLinkServiceConnectionState", + }, + "provisioning_state": { + "key": "properties.provisioningState", + "type": "str", + }, } def __init__( @@ -17305,7 +18581,9 @@ def __init__( tags: Optional[Dict[str, str]] = None, sku: Optional["Sku"] = None, private_endpoint: Optional["PrivateEndpoint"] = None, - private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, + private_link_service_connection_state: Optional[ + "PrivateLinkServiceConnectionState" + ] = None, **kwargs ): """ @@ -17330,7 +18608,9 @@ def __init__( self.tags = tags self.sku = sku self.private_endpoint = private_endpoint - self.private_link_service_connection_state = private_link_service_connection_state + self.private_link_service_connection_state = ( + private_link_service_connection_state + ) self.provisioning_state = None @@ -17356,12 +18636,21 @@ class PrivateEndpointConnectionAutoGenerated(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'group_ids': {'key': 'properties.groupIds', 'type': '[str]'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpointResource'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionStateAutoGenerated'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "group_ids": {"key": "properties.groupIds", "type": "[str]"}, + "private_endpoint": { + "key": "properties.privateEndpoint", + "type": "PrivateEndpointResource", + }, + "private_link_service_connection_state": { + "key": "properties.privateLinkServiceConnectionState", + "type": "PrivateLinkServiceConnectionStateAutoGenerated", + }, + "provisioning_state": { + "key": "properties.provisioningState", + "type": "str", + }, } def __init__( @@ -17371,7 +18660,9 @@ def __init__( location: Optional[str] = None, group_ids: Optional[List[str]] = None, private_endpoint: Optional["PrivateEndpointResource"] = None, - private_link_service_connection_state: Optional["PrivateLinkServiceConnectionStateAutoGenerated"] = None, + private_link_service_connection_state: Optional[ + "PrivateLinkServiceConnectionStateAutoGenerated" + ] = None, provisioning_state: Optional[str] = None, **kwargs ): @@ -17398,7 +18689,9 @@ def __init__( self.location = location self.group_ids = group_ids self.private_endpoint = private_endpoint - self.private_link_service_connection_state = private_link_service_connection_state + self.private_link_service_connection_state = ( + private_link_service_connection_state + ) self.provisioning_state = provisioning_state @@ -17410,7 +18703,7 @@ class PrivateEndpointConnectionListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + "value": {"key": "value", "type": "[PrivateEndpointConnection]"}, } def __init__( @@ -17439,20 +18732,15 @@ class PrivateEndpointResource(PrivateEndpointAutoGenerated): """ _validation = { - 'id': {'readonly': True}, + "id": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'subnet_arm_id': {'key': 'subnetArmId', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "subnet_arm_id": {"key": "subnetArmId", "type": "str"}, } - def __init__( - self, - *, - subnet_arm_id: Optional[str] = None, - **kwargs - ): + def __init__(self, *, subnet_arm_id: Optional[str] = None, **kwargs): """ :keyword subnet_arm_id: The subnetId that the private endpoint is connected to. :paramtype subnet_arm_id: str @@ -17494,26 +18782,32 @@ class PrivateLinkResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'group_id': {'readonly': True}, - 'required_members': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "group_id": {"readonly": True}, + "required_members": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, - 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "group_id": {"key": "properties.groupId", "type": "str"}, + "required_members": { + "key": "properties.requiredMembers", + "type": "[str]", + }, + "required_zone_names": { + "key": "properties.requiredZoneNames", + "type": "[str]", + }, } def __init__( @@ -17556,14 +18850,11 @@ class PrivateLinkResourceListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + "value": {"key": "value", "type": "[PrivateLinkResource]"}, } def __init__( - self, - *, - value: Optional[List["PrivateLinkResource"]] = None, - **kwargs + self, *, value: Optional[List["PrivateLinkResource"]] = None, **kwargs ): """ :keyword value: Array of private link resources. @@ -17589,15 +18880,17 @@ class PrivateLinkServiceConnectionState(msrest.serialization.Model): """ _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + "status": {"key": "status", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "actions_required": {"key": "actionsRequired", "type": "str"}, } def __init__( self, *, - status: Optional[Union[str, "PrivateEndpointServiceConnectionStatus"]] = None, + status: Optional[ + Union[str, "PrivateEndpointServiceConnectionStatus"] + ] = None, description: Optional[str] = None, actions_required: Optional[str] = None, **kwargs @@ -17620,7 +18913,9 @@ def __init__( self.actions_required = actions_required -class PrivateLinkServiceConnectionStateAutoGenerated(msrest.serialization.Model): +class PrivateLinkServiceConnectionStateAutoGenerated( + msrest.serialization.Model +): """The connection state. :ivar actions_required: Some RP chose "None". Other RPs use this for region expansion. @@ -17635,9 +18930,9 @@ class PrivateLinkServiceConnectionStateAutoGenerated(msrest.serialization.Model) """ _attribute_map = { - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, + "actions_required": {"key": "actionsRequired", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "status": {"key": "status", "type": "str"}, } def __init__( @@ -17659,7 +18954,9 @@ def __init__( :paramtype status: str or ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus """ - super(PrivateLinkServiceConnectionStateAutoGenerated, self).__init__(**kwargs) + super(PrivateLinkServiceConnectionStateAutoGenerated, self).__init__( + **kwargs + ) self.actions_required = actions_required self.description = description self.status = status @@ -17681,11 +18978,11 @@ class ProbeSettings(msrest.serialization.Model): """ _attribute_map = { - 'failure_threshold': {'key': 'failureThreshold', 'type': 'int'}, - 'initial_delay': {'key': 'initialDelay', 'type': 'duration'}, - 'period': {'key': 'period', 'type': 'duration'}, - 'success_threshold': {'key': 'successThreshold', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "failure_threshold": {"key": "failureThreshold", "type": "int"}, + "initial_delay": {"key": "initialDelay", "type": "duration"}, + "period": {"key": "period", "type": "duration"}, + "success_threshold": {"key": "successThreshold", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } def __init__( @@ -17732,26 +19029,26 @@ class PyTorch(DistributionConfiguration): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, + "distribution_type": {"key": "distributionType", "type": "str"}, + "process_count_per_instance": { + "key": "processCountPerInstance", + "type": "int", + }, } def __init__( - self, - *, - process_count_per_instance: Optional[int] = None, - **kwargs + self, *, process_count_per_instance: Optional[int] = None, **kwargs ): """ :keyword process_count_per_instance: Number of processes per node. :paramtype process_count_per_instance: int """ super(PyTorch, self).__init__(**kwargs) - self.distribution_type = 'PyTorch' # type: str + self.distribution_type = "PyTorch" # type: str self.process_count_per_instance = process_count_per_instance @@ -17769,10 +19066,10 @@ class QuotaBaseProperties(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "limit": {"key": "limit", "type": "long"}, + "unit": {"key": "unit", "type": "str"}, } def __init__( @@ -17812,8 +19109,8 @@ class QuotaUpdateParameters(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[QuotaBaseProperties]'}, - 'location': {'key': 'location', 'type': 'str'}, + "value": {"key": "value", "type": "[QuotaBaseProperties]"}, + "location": {"key": "location", "type": "str"}, } def __init__( @@ -17851,13 +19148,16 @@ class RandomSamplingAlgorithm(SamplingAlgorithm): """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - 'rule': {'key': 'rule', 'type': 'str'}, - 'seed': {'key': 'seed', 'type': 'int'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, + "rule": {"key": "rule", "type": "str"}, + "seed": {"key": "seed", "type": "int"}, } def __init__( @@ -17875,7 +19175,7 @@ def __init__( :paramtype seed: int """ super(RandomSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Random' # type: str + self.sampling_algorithm_type = "Random" # type: str self.rule = rule self.seed = seed @@ -17899,11 +19199,11 @@ class Recurrence(msrest.serialization.Model): """ _attribute_map = { - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceSchedule'}, + "frequency": {"key": "frequency", "type": "str"}, + "interval": {"key": "interval", "type": "int"}, + "start_time": {"key": "startTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "schedule": {"key": "schedule", "type": "RecurrenceSchedule"}, } def __init__( @@ -17955,15 +19255,15 @@ class RecurrenceSchedule(msrest.serialization.Model): """ _validation = { - 'hours': {'required': True}, - 'minutes': {'required': True}, + "hours": {"required": True}, + "minutes": {"required": True}, } _attribute_map = { - 'hours': {'key': 'hours', 'type': '[int]'}, - 'minutes': {'key': 'minutes', 'type': '[int]'}, - 'month_days': {'key': 'monthDays', 'type': '[int]'}, - 'week_days': {'key': 'weekDays', 'type': '[str]'}, + "hours": {"key": "hours", "type": "[int]"}, + "minutes": {"key": "minutes", "type": "[int]"}, + "month_days": {"key": "monthDays", "type": "[int]"}, + "week_days": {"key": "weekDays", "type": "[str]"}, } def __init__( @@ -18022,19 +19322,19 @@ class RecurrenceTrigger(TriggerBase): """ _validation = { - 'trigger_type': {'required': True}, - 'frequency': {'required': True}, - 'interval': {'required': True}, + "trigger_type": {"required": True}, + "frequency": {"required": True}, + "interval": {"required": True}, } _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceSchedule'}, + "end_time": {"key": "endTime", "type": "str"}, + "start_time": {"key": "startTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "trigger_type": {"key": "triggerType", "type": "str"}, + "frequency": {"key": "frequency", "type": "str"}, + "interval": {"key": "interval", "type": "int"}, + "schedule": {"key": "schedule", "type": "RecurrenceSchedule"}, } def __init__( @@ -18070,8 +19370,13 @@ def __init__( :keyword schedule: The recurrence schedule. :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule """ - super(RecurrenceTrigger, self).__init__(end_time=end_time, start_time=start_time, time_zone=time_zone, **kwargs) - self.trigger_type = 'Recurrence' # type: str + super(RecurrenceTrigger, self).__init__( + end_time=end_time, + start_time=start_time, + time_zone=time_zone, + **kwargs + ) + self.trigger_type = "Recurrence" # type: str self.frequency = frequency self.interval = interval self.schedule = schedule @@ -18090,12 +19395,12 @@ class RegenerateEndpointKeysRequest(msrest.serialization.Model): """ _validation = { - 'key_type': {'required': True}, + "key_type": {"required": True}, } _attribute_map = { - 'key_type': {'key': 'keyType', 'type': 'str'}, - 'key_value': {'key': 'keyValue', 'type': 'str'}, + "key_type": {"key": "keyType", "type": "str"}, + "key_value": {"key": "keyValue", "type": "str"}, } def __init__( @@ -18168,30 +19473,48 @@ class Registry(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, - 'intellectual_property_publisher': {'key': 'properties.intellectualPropertyPublisher', 'type': 'str'}, - 'managed_resource_group': {'key': 'properties.managedResourceGroup', 'type': 'ArmResourceId'}, - 'ml_flow_registry_uri': {'key': 'properties.mlFlowRegistryUri', 'type': 'str'}, - 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnectionAutoGenerated]'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'region_details': {'key': 'properties.regionDetails', 'type': '[RegistryRegionArmDetails]'}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "sku": {"key": "sku", "type": "Sku"}, + "discovery_url": {"key": "properties.discoveryUrl", "type": "str"}, + "intellectual_property_publisher": { + "key": "properties.intellectualPropertyPublisher", + "type": "str", + }, + "managed_resource_group": { + "key": "properties.managedResourceGroup", + "type": "ArmResourceId", + }, + "ml_flow_registry_uri": { + "key": "properties.mlFlowRegistryUri", + "type": "str", + }, + "private_endpoint_connections": { + "key": "properties.privateEndpointConnections", + "type": "[PrivateEndpointConnectionAutoGenerated]", + }, + "public_network_access": { + "key": "properties.publicNetworkAccess", + "type": "str", + }, + "region_details": { + "key": "properties.regionDetails", + "type": "[RegistryRegionArmDetails]", + }, } def __init__( @@ -18206,7 +19529,9 @@ def __init__( intellectual_property_publisher: Optional[str] = None, managed_resource_group: Optional["ArmResourceId"] = None, ml_flow_registry_uri: Optional[str] = None, - private_endpoint_connections: Optional[List["PrivateEndpointConnectionAutoGenerated"]] = None, + private_endpoint_connections: Optional[ + List["PrivateEndpointConnectionAutoGenerated"] + ] = None, public_network_access: Optional[str] = None, region_details: Optional[List["RegistryRegionArmDetails"]] = None, **kwargs @@ -18270,21 +19595,18 @@ class RegistryListCredentialsResult(msrest.serialization.Model): """ _validation = { - 'location': {'readonly': True}, - 'username': {'readonly': True}, + "location": {"readonly": True}, + "username": {"readonly": True}, } _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'username': {'key': 'username', 'type': 'str'}, - 'passwords': {'key': 'passwords', 'type': '[Password]'}, + "location": {"key": "location", "type": "str"}, + "username": {"key": "username", "type": "str"}, + "passwords": {"key": "passwords", "type": "[Password]"}, } def __init__( - self, - *, - passwords: Optional[List["Password"]] = None, - **kwargs + self, *, passwords: Optional[List["Password"]] = None, **kwargs ): """ :keyword passwords: @@ -18309,9 +19631,12 @@ class RegistryRegionArmDetails(msrest.serialization.Model): """ _attribute_map = { - 'acr_details': {'key': 'acrDetails', 'type': '[AcrDetails]'}, - 'location': {'key': 'location', 'type': 'str'}, - 'storage_account_details': {'key': 'storageAccountDetails', 'type': '[StorageAccountDetails]'}, + "acr_details": {"key": "acrDetails", "type": "[AcrDetails]"}, + "location": {"key": "location", "type": "str"}, + "storage_account_details": { + "key": "storageAccountDetails", + "type": "[StorageAccountDetails]", + }, } def __init__( @@ -18319,7 +19644,9 @@ def __init__( *, acr_details: Optional[List["AcrDetails"]] = None, location: Optional[str] = None, - storage_account_details: Optional[List["StorageAccountDetails"]] = None, + storage_account_details: Optional[ + List["StorageAccountDetails"] + ] = None, **kwargs ): """ @@ -18348,8 +19675,8 @@ class RegistryTrackedResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Registry]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[Registry]"}, } def __init__( @@ -18366,7 +19693,9 @@ def __init__( :keyword value: An array of objects of type Registry. :paramtype value: list[~azure.mgmt.machinelearningservices.models.Registry] """ - super(RegistryTrackedResourceArmPaginatedResult, self).__init__(**kwargs) + super(RegistryTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -18427,26 +19756,44 @@ class Regression(AutoMLVertical, TableVertical): """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'RegressionTrainingSettings'}, + "task_type": {"required": True}, + "training_data": {"required": True}, + } + + _attribute_map = { + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "test_data": {"key": "testData", "type": "MLTableJobInput"}, + "test_data_size": {"key": "testDataSize", "type": "float"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "weight_column_name": {"key": "weightColumnName", "type": "str"}, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, + "training_settings": { + "key": "trainingSettings", + "type": "RegressionTrainingSettings", + }, } def __init__( @@ -18454,7 +19801,9 @@ def __init__( *, training_data: "MLTableJobInput", cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "TableVerticalFeaturizationSettings" + ] = None, limit_settings: Optional["TableVerticalLimitSettings"] = None, n_cross_validations: Optional["NCrossValidations"] = None, test_data: Optional["MLTableJobInput"] = None, @@ -18464,7 +19813,9 @@ def __init__( weight_column_name: Optional[str] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "RegressionPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "RegressionPrimaryMetrics"] + ] = None, training_settings: Optional["RegressionTrainingSettings"] = None, **kwargs ): @@ -18515,7 +19866,21 @@ def __init__( :paramtype training_settings: ~azure.mgmt.machinelearningservices.models.RegressionTrainingSettings """ - super(Regression, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, cv_split_column_names=cv_split_column_names, featurization_settings=featurization_settings, limit_settings=limit_settings, n_cross_validations=n_cross_validations, test_data=test_data, test_data_size=test_data_size, validation_data=validation_data, validation_data_size=validation_data_size, weight_column_name=weight_column_name, **kwargs) + super(Regression, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + cv_split_column_names=cv_split_column_names, + featurization_settings=featurization_settings, + limit_settings=limit_settings, + n_cross_validations=n_cross_validations, + test_data=test_data, + test_data_size=test_data_size, + validation_data=validation_data, + validation_data_size=validation_data_size, + weight_column_name=weight_column_name, + **kwargs + ) self.cv_split_column_names = cv_split_column_names self.featurization_settings = featurization_settings self.limit_settings = limit_settings @@ -18525,7 +19890,7 @@ def __init__( self.validation_data = validation_data self.validation_data_size = validation_data_size self.weight_column_name = weight_column_name - self.task_type = 'Regression' # type: str + self.task_type = "Regression" # type: str self.primary_metric = primary_metric self.training_settings = training_settings self.log_verbosity = log_verbosity @@ -18562,15 +19927,36 @@ class RegressionTrainingSettings(TrainingSettings): """ _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, + "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, + "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, + "allowed_training_algorithms": { + "key": "allowedTrainingAlgorithms", + "type": "[str]", + }, + "blocked_training_algorithms": { + "key": "blockedTrainingAlgorithms", + "type": "[str]", + }, } def __init__( @@ -18583,8 +19969,12 @@ def __init__( enable_vote_ensemble: Optional[bool] = True, ensemble_model_download_timeout: Optional[datetime.timedelta] = "PT5M", stack_ensemble_settings: Optional["StackEnsembleSettings"] = None, - allowed_training_algorithms: Optional[List[Union[str, "RegressionModels"]]] = None, - blocked_training_algorithms: Optional[List[Union[str, "RegressionModels"]]] = None, + allowed_training_algorithms: Optional[ + List[Union[str, "RegressionModels"]] + ] = None, + blocked_training_algorithms: Optional[ + List[Union[str, "RegressionModels"]] + ] = None, **kwargs ): """ @@ -18612,7 +20002,16 @@ def __init__( :paramtype blocked_training_algorithms: list[str or ~azure.mgmt.machinelearningservices.models.RegressionModels] """ - super(RegressionTrainingSettings, self).__init__(enable_dnn_training=enable_dnn_training, enable_model_explainability=enable_model_explainability, enable_onnx_compatible_models=enable_onnx_compatible_models, enable_stack_ensemble=enable_stack_ensemble, enable_vote_ensemble=enable_vote_ensemble, ensemble_model_download_timeout=ensemble_model_download_timeout, stack_ensemble_settings=stack_ensemble_settings, **kwargs) + super(RegressionTrainingSettings, self).__init__( + enable_dnn_training=enable_dnn_training, + enable_model_explainability=enable_model_explainability, + enable_onnx_compatible_models=enable_onnx_compatible_models, + enable_stack_ensemble=enable_stack_ensemble, + enable_vote_ensemble=enable_vote_ensemble, + ensemble_model_download_timeout=ensemble_model_download_timeout, + stack_ensemble_settings=stack_ensemble_settings, + **kwargs + ) self.allowed_training_algorithms = allowed_training_algorithms self.blocked_training_algorithms = blocked_training_algorithms @@ -18627,19 +20026,14 @@ class ResourceId(msrest.serialization.Model): """ _validation = { - 'id': {'required': True}, + "id": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, } - def __init__( - self, - *, - id: str, - **kwargs - ): + def __init__(self, *, id: str, **kwargs): """ :keyword id: Required. The ID of the resource. :paramtype id: str @@ -18660,21 +20054,17 @@ class ResourceName(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, + "value": {"readonly": True}, + "localized_value": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + "value": {"key": "value", "type": "str"}, + "localized_value": {"key": "localizedValue", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ResourceName, self).__init__(**kwargs) self.value = None self.localized_value = None @@ -18700,29 +20090,28 @@ class ResourceQuota(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'name': {'readonly': True}, - 'limit': {'readonly': True}, - 'unit': {'readonly': True}, + "id": {"readonly": True}, + "aml_workspace_location": {"readonly": True}, + "type": {"readonly": True}, + "name": {"readonly": True}, + "limit": {"readonly": True}, + "unit": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'ResourceName'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "aml_workspace_location": { + "key": "amlWorkspaceLocation", + "type": "str", + }, + "type": {"key": "type", "type": "str"}, + "name": {"key": "name", "type": "ResourceName"}, + "limit": {"key": "limit", "type": "long"}, + "unit": {"key": "unit", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ResourceQuota, self).__init__(**kwargs) self.id = None self.aml_workspace_location = None @@ -18744,22 +20133,20 @@ class Route(msrest.serialization.Model): """ _validation = { - 'path': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'port': {'required': True}, + "path": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "port": {"required": True}, } _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, + "path": {"key": "path", "type": "str"}, + "port": {"key": "port", "type": "int"}, } - def __init__( - self, - *, - path: str, - port: int, - **kwargs - ): + def __init__(self, *, path: str, port: int, **kwargs): """ :keyword path: Required. [Required] The path for the route. :paramtype path: str @@ -18771,7 +20158,9 @@ def __init__( self.port = port -class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class SASAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """SASAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -18794,16 +20183,19 @@ class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionSharedAccessSignature'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionSharedAccessSignature", + }, } def __init__( @@ -18813,7 +20205,9 @@ def __init__( target: Optional[str] = None, value: Optional[str] = None, value_format: Optional[Union[str, "ValueFormat"]] = None, - credentials: Optional["WorkspaceConnectionSharedAccessSignature"] = None, + credentials: Optional[ + "WorkspaceConnectionSharedAccessSignature" + ] = None, **kwargs ): """ @@ -18831,8 +20225,14 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature """ - super(SASAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'SAS' # type: str + super(SASAuthTypeWorkspaceConnectionProperties, self).__init__( + category=category, + target=target, + value=value, + value_format=value_format, + **kwargs + ) + self.auth_type = "SAS" # type: str self.credentials = credentials @@ -18850,26 +20250,21 @@ class SASCredentialDto(PendingUploadCredentialDto): """ _validation = { - 'credential_type': {'required': True}, + "credential_type": {"required": True}, } _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - 'sas_uri': {'key': 'sasUri', 'type': 'str'}, + "credential_type": {"key": "credentialType", "type": "str"}, + "sas_uri": {"key": "sasUri", "type": "str"}, } - def __init__( - self, - *, - sas_uri: Optional[str] = None, - **kwargs - ): + def __init__(self, *, sas_uri: Optional[str] = None, **kwargs): """ :keyword sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. :paramtype sas_uri: str """ super(SASCredentialDto, self).__init__(**kwargs) - self.credential_type = 'SAS' # type: str + self.credential_type = "SAS" # type: str self.sas_uri = sas_uri @@ -18887,27 +20282,22 @@ class SasDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, + "credentials_type": {"required": True}, + "secrets": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'SasDatastoreSecrets'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "secrets": {"key": "secrets", "type": "SasDatastoreSecrets"}, } - def __init__( - self, - *, - secrets: "SasDatastoreSecrets", - **kwargs - ): + def __init__(self, *, secrets: "SasDatastoreSecrets", **kwargs): """ :keyword secrets: Required. [Required] Storage container secrets. :paramtype secrets: ~azure.mgmt.machinelearningservices.models.SasDatastoreSecrets """ super(SasDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Sas' # type: str + self.credentials_type = "Sas" # type: str self.secrets = secrets @@ -18925,26 +20315,21 @@ class SasDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'sas_token': {'key': 'sasToken', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "sas_token": {"key": "sasToken", "type": "str"}, } - def __init__( - self, - *, - sas_token: Optional[str] = None, - **kwargs - ): + def __init__(self, *, sas_token: Optional[str] = None, **kwargs): """ :keyword sas_token: Storage container SAS token. :paramtype sas_token: str """ super(SasDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Sas' # type: str + self.secrets_type = "Sas" # type: str self.sas_token = sas_token @@ -18963,13 +20348,16 @@ class ScaleSettings(msrest.serialization.Model): """ _validation = { - 'max_node_count': {'required': True}, + "max_node_count": {"required": True}, } _attribute_map = { - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'node_idle_time_before_scale_down': {'key': 'nodeIdleTimeBeforeScaleDown', 'type': 'duration'}, + "max_node_count": {"key": "maxNodeCount", "type": "int"}, + "min_node_count": {"key": "minNodeCount", "type": "int"}, + "node_idle_time_before_scale_down": { + "key": "nodeIdleTimeBeforeScaleDown", + "type": "duration", + }, } def __init__( @@ -18992,7 +20380,9 @@ def __init__( super(ScaleSettings, self).__init__(**kwargs) self.max_node_count = max_node_count self.min_node_count = min_node_count - self.node_idle_time_before_scale_down = node_idle_time_before_scale_down + self.node_idle_time_before_scale_down = ( + node_idle_time_before_scale_down + ) class ScaleSettingsInformation(msrest.serialization.Model): @@ -19003,14 +20393,11 @@ class ScaleSettingsInformation(msrest.serialization.Model): """ _attribute_map = { - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, + "scale_settings": {"key": "scaleSettings", "type": "ScaleSettings"}, } def __init__( - self, - *, - scale_settings: Optional["ScaleSettings"] = None, - **kwargs + self, *, scale_settings: Optional["ScaleSettings"] = None, **kwargs ): """ :keyword scale_settings: scale settings for AML Compute. @@ -19043,27 +20430,22 @@ class Schedule(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ScheduleProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "ScheduleProperties"}, } - def __init__( - self, - *, - properties: "ScheduleProperties", - **kwargs - ): + def __init__(self, *, properties: "ScheduleProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ScheduleProperties @@ -19087,16 +20469,18 @@ class ScheduleBase(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "provisioning_status": {"key": "provisioningStatus", "type": "str"}, + "status": {"key": "status", "type": "str"}, } def __init__( self, *, id: Optional[str] = None, - provisioning_status: Optional[Union[str, "ScheduleProvisioningState"]] = None, + provisioning_status: Optional[ + Union[str, "ScheduleProvisioningState"] + ] = None, status: Optional[Union[str, "ScheduleStatus"]] = None, **kwargs ): @@ -19145,20 +20529,20 @@ class ScheduleProperties(ResourceBase): """ _validation = { - 'action': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'trigger': {'required': True}, + "action": {"required": True}, + "provisioning_state": {"readonly": True}, + "trigger": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'action': {'key': 'action', 'type': 'ScheduleActionBase'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'trigger': {'key': 'trigger', 'type': 'TriggerBase'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "action": {"key": "action", "type": "ScheduleActionBase"}, + "display_name": {"key": "displayName", "type": "str"}, + "is_enabled": {"key": "isEnabled", "type": "bool"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "trigger": {"key": "trigger", "type": "TriggerBase"}, } def __init__( @@ -19189,7 +20573,9 @@ def __init__( :keyword trigger: Required. [Required] Specifies the trigger details. :paramtype trigger: ~azure.mgmt.machinelearningservices.models.TriggerBase """ - super(ScheduleProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + super(ScheduleProperties, self).__init__( + description=description, properties=properties, tags=tags, **kwargs + ) self.action = action self.display_name = display_name self.is_enabled = is_enabled @@ -19208,8 +20594,8 @@ class ScheduleResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Schedule]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[Schedule]"}, } def __init__( @@ -19245,10 +20631,10 @@ class ScriptReference(msrest.serialization.Model): """ _attribute_map = { - 'script_source': {'key': 'scriptSource', 'type': 'str'}, - 'script_data': {'key': 'scriptData', 'type': 'str'}, - 'script_arguments': {'key': 'scriptArguments', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'str'}, + "script_source": {"key": "scriptSource", "type": "str"}, + "script_data": {"key": "scriptData", "type": "str"}, + "script_arguments": {"key": "scriptArguments", "type": "str"}, + "timeout": {"key": "timeout", "type": "str"}, } def __init__( @@ -19287,8 +20673,11 @@ class ScriptsToExecute(msrest.serialization.Model): """ _attribute_map = { - 'startup_script': {'key': 'startupScript', 'type': 'ScriptReference'}, - 'creation_script': {'key': 'creationScript', 'type': 'ScriptReference'}, + "startup_script": {"key": "startupScript", "type": "ScriptReference"}, + "creation_script": { + "key": "creationScript", + "type": "ScriptReference", + }, } def __init__( @@ -19317,14 +20706,11 @@ class ServiceManagedResourcesSettings(msrest.serialization.Model): """ _attribute_map = { - 'cosmos_db': {'key': 'cosmosDb', 'type': 'CosmosDbSettings'}, + "cosmos_db": {"key": "cosmosDb", "type": "CosmosDbSettings"}, } def __init__( - self, - *, - cosmos_db: Optional["CosmosDbSettings"] = None, - **kwargs + self, *, cosmos_db: Optional["CosmosDbSettings"] = None, **kwargs ): """ :keyword cosmos_db: The settings for the service managed cosmosdb account. @@ -19356,19 +20742,22 @@ class ServicePrincipalDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, + "credentials_type": {"required": True}, + "client_id": {"required": True}, + "secrets": {"required": True}, + "tenant_id": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'ServicePrincipalDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "authority_url": {"key": "authorityUrl", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + "resource_url": {"key": "resourceUrl", "type": "str"}, + "secrets": { + "key": "secrets", + "type": "ServicePrincipalDatastoreSecrets", + }, + "tenant_id": {"key": "tenantId", "type": "str"}, } def __init__( @@ -19395,7 +20784,7 @@ def __init__( :paramtype tenant_id: str """ super(ServicePrincipalDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'ServicePrincipal' # type: str + self.credentials_type = "ServicePrincipal" # type: str self.authority_url = authority_url self.client_id = client_id self.resource_url = resource_url @@ -19417,26 +20806,21 @@ class ServicePrincipalDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "client_secret": {"key": "clientSecret", "type": "str"}, } - def __init__( - self, - *, - client_secret: Optional[str] = None, - **kwargs - ): + def __init__(self, *, client_secret: Optional[str] = None, **kwargs): """ :keyword client_secret: Service principal secret. :paramtype client_secret: str """ super(ServicePrincipalDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'ServicePrincipal' # type: str + self.secrets_type = "ServicePrincipal" # type: str self.client_secret = client_secret @@ -19448,14 +20832,11 @@ class SetupScripts(msrest.serialization.Model): """ _attribute_map = { - 'scripts': {'key': 'scripts', 'type': 'ScriptsToExecute'}, + "scripts": {"key": "scripts", "type": "ScriptsToExecute"}, } def __init__( - self, - *, - scripts: Optional["ScriptsToExecute"] = None, - **kwargs + self, *, scripts: Optional["ScriptsToExecute"] = None, **kwargs ): """ :keyword scripts: Customized setup scripts. @@ -19484,11 +20865,14 @@ class SharedPrivateLinkResource(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'private_link_resource_id': {'key': 'properties.privateLinkResourceId', 'type': 'str'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'request_message': {'key': 'properties.requestMessage', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "private_link_resource_id": { + "key": "properties.privateLinkResourceId", + "type": "str", + }, + "group_id": {"key": "properties.groupId", "type": "str"}, + "request_message": {"key": "properties.requestMessage", "type": "str"}, + "status": {"key": "properties.status", "type": "str"}, } def __init__( @@ -19498,7 +20882,9 @@ def __init__( private_link_resource_id: Optional[str] = None, group_id: Optional[str] = None, request_message: Optional[str] = None, - status: Optional[Union[str, "PrivateEndpointServiceConnectionStatus"]] = None, + status: Optional[ + Union[str, "PrivateEndpointServiceConnectionStatus"] + ] = None, **kwargs ): """ @@ -19547,15 +20933,15 @@ class Sku(msrest.serialization.Model): """ _validation = { - 'name': {'required': True}, + "name": {"required": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'int'}, + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, + "size": {"key": "size", "type": "str"}, + "family": {"key": "family", "type": "str"}, + "capacity": {"key": "capacity", "type": "int"}, } def __init__( @@ -19608,10 +20994,10 @@ class SkuCapacity(msrest.serialization.Model): """ _attribute_map = { - 'default': {'key': 'default', 'type': 'int'}, - 'maximum': {'key': 'maximum', 'type': 'int'}, - 'minimum': {'key': 'minimum', 'type': 'int'}, - 'scale_type': {'key': 'scaleType', 'type': 'str'}, + "default": {"key": "default", "type": "int"}, + "maximum": {"key": "maximum", "type": "int"}, + "minimum": {"key": "minimum", "type": "int"}, + "scale_type": {"key": "scaleType", "type": "str"}, } def __init__( @@ -19655,13 +21041,13 @@ class SkuResource(msrest.serialization.Model): """ _validation = { - 'resource_type': {'readonly': True}, + "resource_type": {"readonly": True}, } _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'SkuSetting'}, + "capacity": {"key": "capacity", "type": "SkuCapacity"}, + "resource_type": {"key": "resourceType", "type": "str"}, + "sku": {"key": "sku", "type": "SkuSetting"}, } def __init__( @@ -19694,8 +21080,8 @@ class SkuResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[SkuResource]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[SkuResource]"}, } def __init__( @@ -19732,12 +21118,16 @@ class SkuSetting(msrest.serialization.Model): """ _validation = { - 'name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "name": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, } def __init__( @@ -19780,12 +21170,15 @@ class SslConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'cert': {'key': 'cert', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - 'cname': {'key': 'cname', 'type': 'str'}, - 'leaf_domain_label': {'key': 'leafDomainLabel', 'type': 'str'}, - 'overwrite_existing_domain': {'key': 'overwriteExistingDomain', 'type': 'bool'}, + "status": {"key": "status", "type": "str"}, + "cert": {"key": "cert", "type": "str"}, + "key": {"key": "key", "type": "str"}, + "cname": {"key": "cname", "type": "str"}, + "leaf_domain_label": {"key": "leafDomainLabel", "type": "str"}, + "overwrite_existing_domain": { + "key": "overwriteExistingDomain", + "type": "bool", + }, } def __init__( @@ -19842,9 +21235,18 @@ class StackEnsembleSettings(msrest.serialization.Model): """ _attribute_map = { - 'stack_meta_learner_k_wargs': {'key': 'stackMetaLearnerKWargs', 'type': 'object'}, - 'stack_meta_learner_train_percentage': {'key': 'stackMetaLearnerTrainPercentage', 'type': 'float'}, - 'stack_meta_learner_type': {'key': 'stackMetaLearnerType', 'type': 'str'}, + "stack_meta_learner_k_wargs": { + "key": "stackMetaLearnerKWargs", + "type": "object", + }, + "stack_meta_learner_train_percentage": { + "key": "stackMetaLearnerTrainPercentage", + "type": "float", + }, + "stack_meta_learner_type": { + "key": "stackMetaLearnerType", + "type": "str", + }, } def __init__( @@ -19852,7 +21254,9 @@ def __init__( *, stack_meta_learner_k_wargs: Optional[Any] = None, stack_meta_learner_train_percentage: Optional[float] = 0.2, - stack_meta_learner_type: Optional[Union[str, "StackMetaLearnerType"]] = None, + stack_meta_learner_type: Optional[ + Union[str, "StackMetaLearnerType"] + ] = None, **kwargs ): """ @@ -19872,7 +21276,9 @@ def __init__( """ super(StackEnsembleSettings, self).__init__(**kwargs) self.stack_meta_learner_k_wargs = stack_meta_learner_k_wargs - self.stack_meta_learner_train_percentage = stack_meta_learner_train_percentage + self.stack_meta_learner_train_percentage = ( + stack_meta_learner_train_percentage + ) self.stack_meta_learner_type = stack_meta_learner_type @@ -19890,15 +21296,25 @@ class StorageAccountDetails(msrest.serialization.Model): """ _attribute_map = { - 'system_created_storage_account': {'key': 'systemCreatedStorageAccount', 'type': 'SystemCreatedStorageAccount'}, - 'user_created_storage_account': {'key': 'userCreatedStorageAccount', 'type': 'UserCreatedStorageAccount'}, + "system_created_storage_account": { + "key": "systemCreatedStorageAccount", + "type": "SystemCreatedStorageAccount", + }, + "user_created_storage_account": { + "key": "userCreatedStorageAccount", + "type": "UserCreatedStorageAccount", + }, } def __init__( self, *, - system_created_storage_account: Optional["SystemCreatedStorageAccount"] = None, - user_created_storage_account: Optional["UserCreatedStorageAccount"] = None, + system_created_storage_account: Optional[ + "SystemCreatedStorageAccount" + ] = None, + user_created_storage_account: Optional[ + "UserCreatedStorageAccount" + ] = None, **kwargs ): """ @@ -19975,35 +21391,41 @@ class SweepJob(JobBaseProperties): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'objective': {'required': True}, - 'sampling_algorithm': {'required': True}, - 'search_space': {'required': True}, - 'trial': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'SweepJobLimits'}, - 'objective': {'key': 'objective', 'type': 'Objective'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'SamplingAlgorithm'}, - 'search_space': {'key': 'searchSpace', 'type': 'object'}, - 'trial': {'key': 'trial', 'type': 'TrialComponent'}, + "job_type": {"required": True}, + "status": {"readonly": True}, + "objective": {"required": True}, + "sampling_algorithm": {"required": True}, + "search_space": {"required": True}, + "trial": {"required": True}, + } + + _attribute_map = { + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "limits": {"key": "limits", "type": "SweepJobLimits"}, + "objective": {"key": "objective", "type": "Objective"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "sampling_algorithm": { + "key": "samplingAlgorithm", + "type": "SamplingAlgorithm", + }, + "search_space": {"key": "searchSpace", "type": "object"}, + "trial": {"key": "trial", "type": "TrialComponent"}, } def __init__( @@ -20073,8 +21495,20 @@ def __init__( :keyword trial: Required. [Required] Trial component definition. :paramtype trial: ~azure.mgmt.machinelearningservices.models.TrialComponent """ - super(SweepJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, services=services, **kwargs) - self.job_type = 'Sweep' # type: str + super(SweepJob, self).__init__( + description=description, + properties=properties, + tags=tags, + component_id=component_id, + compute_id=compute_id, + display_name=display_name, + experiment_name=experiment_name, + identity=identity, + is_archived=is_archived, + services=services, + **kwargs + ) + self.job_type = "Sweep" # type: str self.early_termination = early_termination self.inputs = inputs self.limits = limits @@ -20105,15 +21539,15 @@ class SweepJobLimits(JobLimits): """ _validation = { - 'job_limits_type': {'required': True}, + "job_limits_type": {"required": True}, } _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_total_trials': {'key': 'maxTotalTrials', 'type': 'int'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, + "job_limits_type": {"key": "jobLimitsType", "type": "str"}, + "timeout": {"key": "timeout", "type": "duration"}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_total_trials": {"key": "maxTotalTrials", "type": "int"}, + "trial_timeout": {"key": "trialTimeout", "type": "duration"}, } def __init__( @@ -20137,7 +21571,7 @@ def __init__( :paramtype trial_timeout: ~datetime.timedelta """ super(SweepJobLimits, self).__init__(timeout=timeout, **kwargs) - self.job_limits_type = 'Sweep' # type: str + self.job_limits_type = "Sweep" # type: str self.max_concurrent_trials = max_concurrent_trials self.max_total_trials = max_total_trials self.trial_timeout = trial_timeout @@ -20182,26 +21616,29 @@ class SynapseSpark(Compute): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'SynapseSparkProperties'}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, + "properties": {"key": "properties", "type": "SynapseSparkProperties"}, } def __init__( @@ -20227,8 +21664,14 @@ def __init__( :keyword properties: :paramtype properties: ~azure.mgmt.machinelearningservices.models.SynapseSparkProperties """ - super(SynapseSpark, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, **kwargs) - self.compute_type = 'SynapseSpark' # type: str + super(SynapseSpark, self).__init__( + compute_location=compute_location, + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + **kwargs + ) + self.compute_type = "SynapseSpark" # type: str self.properties = properties @@ -20258,16 +21701,22 @@ class SynapseSparkProperties(msrest.serialization.Model): """ _attribute_map = { - 'auto_scale_properties': {'key': 'autoScaleProperties', 'type': 'AutoScaleProperties'}, - 'auto_pause_properties': {'key': 'autoPauseProperties', 'type': 'AutoPauseProperties'}, - 'spark_version': {'key': 'sparkVersion', 'type': 'str'}, - 'node_count': {'key': 'nodeCount', 'type': 'int'}, - 'node_size': {'key': 'nodeSize', 'type': 'str'}, - 'node_size_family': {'key': 'nodeSizeFamily', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'workspace_name': {'key': 'workspaceName', 'type': 'str'}, - 'pool_name': {'key': 'poolName', 'type': 'str'}, + "auto_scale_properties": { + "key": "autoScaleProperties", + "type": "AutoScaleProperties", + }, + "auto_pause_properties": { + "key": "autoPauseProperties", + "type": "AutoPauseProperties", + }, + "spark_version": {"key": "sparkVersion", "type": "str"}, + "node_count": {"key": "nodeCount", "type": "int"}, + "node_size": {"key": "nodeSize", "type": "str"}, + "node_size_family": {"key": "nodeSizeFamily", "type": "str"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, + "resource_group": {"key": "resourceGroup", "type": "str"}, + "workspace_name": {"key": "workspaceName", "type": "str"}, + "pool_name": {"key": "poolName", "type": "str"}, } def __init__( @@ -20334,9 +21783,9 @@ class SystemCreatedAcrAccount(msrest.serialization.Model): """ _attribute_map = { - 'acr_account_name': {'key': 'acrAccountName', 'type': 'str'}, - 'acr_account_sku': {'key': 'acrAccountSku', 'type': 'str'}, - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, + "acr_account_name": {"key": "acrAccountName", "type": "str"}, + "acr_account_sku": {"key": "acrAccountSku", "type": "str"}, + "arm_resource_id": {"key": "armResourceId", "type": "ArmResourceId"}, } def __init__( @@ -20385,11 +21834,17 @@ class SystemCreatedStorageAccount(msrest.serialization.Model): """ _attribute_map = { - 'allow_blob_public_access': {'key': 'allowBlobPublicAccess', 'type': 'bool'}, - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - 'storage_account_hns_enabled': {'key': 'storageAccountHnsEnabled', 'type': 'bool'}, - 'storage_account_name': {'key': 'storageAccountName', 'type': 'str'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + "allow_blob_public_access": { + "key": "allowBlobPublicAccess", + "type": "bool", + }, + "arm_resource_id": {"key": "armResourceId", "type": "ArmResourceId"}, + "storage_account_hns_enabled": { + "key": "storageAccountHnsEnabled", + "type": "bool", + }, + "storage_account_name": {"key": "storageAccountName", "type": "str"}, + "storage_account_type": {"key": "storageAccountType", "type": "str"}, } def __init__( @@ -20450,12 +21905,12 @@ class SystemData(msrest.serialization.Model): """ _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + "created_by": {"key": "createdBy", "type": "str"}, + "created_by_type": {"key": "createdByType", "type": "str"}, + "created_at": {"key": "createdAt", "type": "iso-8601"}, + "last_modified_by": {"key": "lastModifiedBy", "type": "str"}, + "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"}, + "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, } def __init__( @@ -20509,23 +21964,19 @@ class SystemService(msrest.serialization.Model): """ _validation = { - 'system_service_type': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'version': {'readonly': True}, + "system_service_type": {"readonly": True}, + "public_ip_address": {"readonly": True}, + "version": {"readonly": True}, } _attribute_map = { - 'system_service_type': {'key': 'systemServiceType', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, + "system_service_type": {"key": "systemServiceType", "type": "str"}, + "public_ip_address": {"key": "publicIpAddress", "type": "str"}, + "version": {"key": "version", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(SystemService, self).__init__(**kwargs) self.system_service_type = None self.public_ip_address = None @@ -20559,23 +22010,39 @@ class TableVerticalFeaturizationSettings(FeaturizationSettings): """ _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - 'blocked_transformers': {'key': 'blockedTransformers', 'type': '[str]'}, - 'column_name_and_types': {'key': 'columnNameAndTypes', 'type': '{str}'}, - 'enable_dnn_featurization': {'key': 'enableDnnFeaturization', 'type': 'bool'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'transformer_params': {'key': 'transformerParams', 'type': '{[ColumnTransformer]}'}, + "dataset_language": {"key": "datasetLanguage", "type": "str"}, + "blocked_transformers": { + "key": "blockedTransformers", + "type": "[str]", + }, + "column_name_and_types": { + "key": "columnNameAndTypes", + "type": "{str}", + }, + "enable_dnn_featurization": { + "key": "enableDnnFeaturization", + "type": "bool", + }, + "mode": {"key": "mode", "type": "str"}, + "transformer_params": { + "key": "transformerParams", + "type": "{[ColumnTransformer]}", + }, } def __init__( self, *, dataset_language: Optional[str] = None, - blocked_transformers: Optional[List[Union[str, "BlockedTransformers"]]] = None, + blocked_transformers: Optional[ + List[Union[str, "BlockedTransformers"]] + ] = None, column_name_and_types: Optional[Dict[str, str]] = None, enable_dnn_featurization: Optional[bool] = False, mode: Optional[Union[str, "FeaturizationMode"]] = None, - transformer_params: Optional[Dict[str, List["ColumnTransformer"]]] = None, + transformer_params: Optional[ + Dict[str, List["ColumnTransformer"]] + ] = None, **kwargs ): """ @@ -20601,7 +22068,9 @@ def __init__( :paramtype transformer_params: dict[str, list[~azure.mgmt.machinelearningservices.models.ColumnTransformer]] """ - super(TableVerticalFeaturizationSettings, self).__init__(dataset_language=dataset_language, **kwargs) + super(TableVerticalFeaturizationSettings, self).__init__( + dataset_language=dataset_language, **kwargs + ) self.blocked_transformers = blocked_transformers self.column_name_and_types = column_name_and_types self.enable_dnn_featurization = enable_dnn_featurization @@ -20630,13 +22099,16 @@ class TableVerticalLimitSettings(msrest.serialization.Model): """ _attribute_map = { - 'enable_early_termination': {'key': 'enableEarlyTermination', 'type': 'bool'}, - 'exit_score': {'key': 'exitScore', 'type': 'float'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_cores_per_trial': {'key': 'maxCoresPerTrial', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, + "enable_early_termination": { + "key": "enableEarlyTermination", + "type": "bool", + }, + "exit_score": {"key": "exitScore", "type": "float"}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_cores_per_trial": {"key": "maxCoresPerTrial", "type": "int"}, + "max_trials": {"key": "maxTrials", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, + "trial_timeout": {"key": "trialTimeout", "type": "duration"}, } def __init__( @@ -20699,15 +22171,18 @@ class TargetUtilizationScaleSettings(OnlineScaleSettings): """ _validation = { - 'scale_type': {'required': True}, + "scale_type": {"required": True}, } _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - 'max_instances': {'key': 'maxInstances', 'type': 'int'}, - 'min_instances': {'key': 'minInstances', 'type': 'int'}, - 'polling_interval': {'key': 'pollingInterval', 'type': 'duration'}, - 'target_utilization_percentage': {'key': 'targetUtilizationPercentage', 'type': 'int'}, + "scale_type": {"key": "scaleType", "type": "str"}, + "max_instances": {"key": "maxInstances", "type": "int"}, + "min_instances": {"key": "minInstances", "type": "int"}, + "polling_interval": {"key": "pollingInterval", "type": "duration"}, + "target_utilization_percentage": { + "key": "targetUtilizationPercentage", + "type": "int", + }, } def __init__( @@ -20732,7 +22207,7 @@ def __init__( :paramtype target_utilization_percentage: int """ super(TargetUtilizationScaleSettings, self).__init__(**kwargs) - self.scale_type = 'TargetUtilization' # type: str + self.scale_type = "TargetUtilization" # type: str self.max_instances = max_instances self.min_instances = min_instances self.polling_interval = polling_interval @@ -20754,13 +22229,16 @@ class TensorFlow(DistributionConfiguration): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'parameter_server_count': {'key': 'parameterServerCount', 'type': 'int'}, - 'worker_count': {'key': 'workerCount', 'type': 'int'}, + "distribution_type": {"key": "distributionType", "type": "str"}, + "parameter_server_count": { + "key": "parameterServerCount", + "type": "int", + }, + "worker_count": {"key": "workerCount", "type": "int"}, } def __init__( @@ -20777,70 +22255,83 @@ def __init__( :paramtype worker_count: int """ super(TensorFlow, self).__init__(**kwargs) - self.distribution_type = 'TensorFlow' # type: str + self.distribution_type = "TensorFlow" # type: str self.parameter_server_count = parameter_server_count self.worker_count = worker_count class TextClassification(AutoMLVertical, NlpVertical): """Text Classification task in AutoML NLP vertical. -NLP - Natural Language Processing. + NLP - Natural Language Processing. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-Classification task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric for Text-Classification task. Possible values include: + "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, + "task_type": {"required": True}, + "training_data": {"required": True}, } _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( self, *, training_data: "MLTableJobInput", - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "NlpVerticalFeaturizationSettings" + ] = None, limit_settings: Optional["NlpVerticalLimitSettings"] = None, validation_data: Optional["MLTableJobInput"] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "ClassificationPrimaryMetrics"] + ] = None, **kwargs ): """ @@ -20865,11 +22356,19 @@ def __init__( :paramtype primary_metric: str or ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ - super(TextClassification, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, featurization_settings=featurization_settings, limit_settings=limit_settings, validation_data=validation_data, **kwargs) + super(TextClassification, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + featurization_settings=featurization_settings, + limit_settings=limit_settings, + validation_data=validation_data, + **kwargs + ) self.featurization_settings = featurization_settings self.limit_settings = limit_settings self.validation_data = validation_data - self.task_type = 'TextClassification' # type: str + self.task_type = "TextClassification" # type: str self.primary_metric = primary_metric self.log_verbosity = log_verbosity self.target_column_name = target_column_name @@ -20878,62 +22377,73 @@ def __init__( class TextClassificationMultilabel(AutoMLVertical, NlpVertical): """Text Classification Multilabel task in AutoML NLP vertical. -NLP - Natural Language Processing. + NLP - Natural Language Processing. - Variables are only populated by the server, and will be ignored when sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-Classification-Multilabel task. - Currently only Accuracy is supported as primary metric, hence user need not set it explicitly. - Possible values include: "AUCWeighted", "Accuracy", "NormMacroRecall", - "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric for Text-Classification-Multilabel task. + Currently only Accuracy is supported as primary metric, hence user need not set it explicitly. + Possible values include: "AUCWeighted", "Accuracy", "NormMacroRecall", + "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted", "IOU". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - 'primary_metric': {'readonly': True}, + "task_type": {"required": True}, + "training_data": {"required": True}, + "primary_metric": {"readonly": True}, } _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( self, *, training_data: "MLTableJobInput", - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "NlpVerticalFeaturizationSettings" + ] = None, limit_settings: Optional["NlpVerticalLimitSettings"] = None, validation_data: Optional["MLTableJobInput"] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, @@ -20957,11 +22467,19 @@ def __init__( :keyword training_data: Required. [Required] Training data input. :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ - super(TextClassificationMultilabel, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, featurization_settings=featurization_settings, limit_settings=limit_settings, validation_data=validation_data, **kwargs) + super(TextClassificationMultilabel, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + featurization_settings=featurization_settings, + limit_settings=limit_settings, + validation_data=validation_data, + **kwargs + ) self.featurization_settings = featurization_settings self.limit_settings = limit_settings self.validation_data = validation_data - self.task_type = 'TextClassificationMultilabel' # type: str + self.task_type = "TextClassificationMultilabel" # type: str self.primary_metric = None self.log_verbosity = log_verbosity self.target_column_name = target_column_name @@ -20970,63 +22488,74 @@ def __init__( class TextNer(AutoMLVertical, NlpVertical): """Text-NER task in AutoML NLP vertical. -NER - Named Entity Recognition. -NLP - Natural Language Processing. + NER - Named Entity Recognition. + NLP - Natural Language Processing. - Variables are only populated by the server, and will be ignored when sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-NER task. - Only 'Accuracy' is supported for Text-NER, so user need not set this explicitly. Possible - values include: "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric for Text-NER task. + Only 'Accuracy' is supported for Text-NER, so user need not set this explicitly. Possible + values include: "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - 'primary_metric': {'readonly': True}, + "task_type": {"required": True}, + "training_data": {"required": True}, + "primary_metric": {"readonly": True}, } _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( self, *, training_data: "MLTableJobInput", - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "NlpVerticalFeaturizationSettings" + ] = None, limit_settings: Optional["NlpVerticalLimitSettings"] = None, validation_data: Optional["MLTableJobInput"] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, @@ -21050,11 +22579,19 @@ def __init__( :keyword training_data: Required. [Required] Training data input. :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ - super(TextNer, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, featurization_settings=featurization_settings, limit_settings=limit_settings, validation_data=validation_data, **kwargs) + super(TextNer, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + featurization_settings=featurization_settings, + limit_settings=limit_settings, + validation_data=validation_data, + **kwargs + ) self.featurization_settings = featurization_settings self.limit_settings = limit_settings self.validation_data = validation_data - self.task_type = 'TextNER' # type: str + self.task_type = "TextNER" # type: str self.primary_metric = None self.log_verbosity = log_verbosity self.target_column_name = target_column_name @@ -21069,15 +22606,10 @@ class TmpfsOptions(msrest.serialization.Model): """ _attribute_map = { - 'size': {'key': 'size', 'type': 'int'}, + "size": {"key": "size", "type": "int"}, } - def __init__( - self, - *, - size: Optional[int] = None, - **kwargs - ): + def __init__(self, *, size: Optional[int] = None, **kwargs): """ :keyword size: Mention the Tmpfs size. :paramtype size: int @@ -21109,17 +22641,31 @@ class TrialComponent(msrest.serialization.Model): """ _validation = { - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "command": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "environment_id": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, + "code_id": {"key": "codeId", "type": "str"}, + "command": {"key": "command", "type": "str"}, + "distribution": { + "key": "distribution", + "type": "DistributionConfiguration", + }, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "resources": {"key": "resources", "type": "JobResourceConfiguration"}, } def __init__( @@ -21178,15 +22724,15 @@ class TritonModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "min_length": 1, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -21206,10 +22752,12 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(TritonModelJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(TritonModelJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'triton_model' # type: str + self.job_input_type = "triton_model" # type: str self.description = description @@ -21231,14 +22779,14 @@ class TritonModelJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -21257,10 +22805,12 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(TritonModelJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(TritonModelJobOutput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_output_type = 'triton_model' # type: str + self.job_output_type = "triton_model" # type: str self.description = description @@ -21282,14 +22832,17 @@ class TruncationSelectionPolicy(EarlyTerminationPolicy): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'truncation_percentage': {'key': 'truncationPercentage', 'type': 'int'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, + "truncation_percentage": { + "key": "truncationPercentage", + "type": "int", + }, } def __init__( @@ -21308,8 +22861,12 @@ def __init__( :keyword truncation_percentage: The percentage of runs to cancel at each evaluation interval. :paramtype truncation_percentage: int """ - super(TruncationSelectionPolicy, self).__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs) - self.policy_type = 'TruncationSelection' # type: str + super(TruncationSelectionPolicy, self).__init__( + delay_evaluation=delay_evaluation, + evaluation_interval=evaluation_interval, + **kwargs + ) + self.policy_type = "TruncationSelection" # type: str self.truncation_percentage = truncation_percentage @@ -21334,17 +22891,17 @@ class UpdateWorkspaceQuotas(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, + "id": {"readonly": True}, + "type": {"readonly": True}, + "unit": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "limit": {"key": "limit", "type": "long"}, + "unit": {"key": "unit", "type": "str"}, + "status": {"key": "status", "type": "str"}, } def __init__( @@ -21384,21 +22941,17 @@ class UpdateWorkspaceQuotasResult(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[UpdateWorkspaceQuotas]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[UpdateWorkspaceQuotas]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UpdateWorkspaceQuotasResult, self).__init__(**kwargs) self.value = None self.next_link = None @@ -21428,18 +22981,22 @@ class UriFileDataVersion(DataVersionBaseProperties): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, } def __init__( @@ -21468,8 +23025,16 @@ def __init__( https://go.microsoft.com/fwlink/?linkid=2202330. :paramtype data_uri: str """ - super(UriFileDataVersion, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, **kwargs) - self.data_type = 'uri_file' # type: str + super(UriFileDataVersion, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + data_uri=data_uri, + **kwargs + ) + self.data_type = "uri_file" # type: str class UriFileJobInput(JobInput, AssetJobInput): @@ -21491,15 +23056,15 @@ class UriFileJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "min_length": 1, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -21519,10 +23084,12 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(UriFileJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(UriFileJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'uri_file' # type: str + self.job_input_type = "uri_file" # type: str self.description = description @@ -21544,14 +23111,14 @@ class UriFileJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -21570,10 +23137,12 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(UriFileJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(UriFileJobOutput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_output_type = 'uri_file' # type: str + self.job_output_type = "uri_file" # type: str self.description = description @@ -21601,18 +23170,22 @@ class UriFolderDataVersion(DataVersionBaseProperties): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, } def __init__( @@ -21641,8 +23214,16 @@ def __init__( https://go.microsoft.com/fwlink/?linkid=2202330. :paramtype data_uri: str """ - super(UriFolderDataVersion, self).__init__(description=description, properties=properties, tags=tags, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, **kwargs) - self.data_type = 'uri_folder' # type: str + super(UriFolderDataVersion, self).__init__( + description=description, + properties=properties, + tags=tags, + is_anonymous=is_anonymous, + is_archived=is_archived, + data_uri=data_uri, + **kwargs + ) + self.data_type = "uri_folder" # type: str class UriFolderJobInput(JobInput, AssetJobInput): @@ -21664,15 +23245,15 @@ class UriFolderJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "min_length": 1, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -21692,10 +23273,12 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(UriFolderJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(UriFolderJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'uri_folder' # type: str + self.job_input_type = "uri_folder" # type: str self.description = description @@ -21717,14 +23300,14 @@ class UriFolderJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -21743,10 +23326,12 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(UriFolderJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(UriFolderJobOutput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_output_type = 'uri_folder' # type: str + self.job_output_type = "uri_folder" # type: str self.description = description @@ -21772,31 +23357,30 @@ class Usage(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'current_value': {'key': 'currentValue', 'type': 'long'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'name': {'key': 'name', 'type': 'UsageName'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ + "id": {"readonly": True}, + "aml_workspace_location": {"readonly": True}, + "type": {"readonly": True}, + "unit": {"readonly": True}, + "current_value": {"readonly": True}, + "limit": {"readonly": True}, + "name": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "aml_workspace_location": { + "key": "amlWorkspaceLocation", + "type": "str", + }, + "type": {"key": "type", "type": "str"}, + "unit": {"key": "unit", "type": "str"}, + "current_value": {"key": "currentValue", "type": "long"}, + "limit": {"key": "limit", "type": "long"}, + "name": {"key": "name", "type": "UsageName"}, + } + + def __init__(self, **kwargs): + """ """ super(Usage, self).__init__(**kwargs) self.id = None self.aml_workspace_location = None @@ -21819,21 +23403,17 @@ class UsageName(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, + "value": {"readonly": True}, + "localized_value": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + "value": {"key": "value", "type": "str"}, + "localized_value": {"key": "localizedValue", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UsageName, self).__init__(**kwargs) self.value = None self.localized_value = None @@ -21854,13 +23434,16 @@ class UserAccountCredentials(msrest.serialization.Model): """ _validation = { - 'admin_user_name': {'required': True}, + "admin_user_name": {"required": True}, } _attribute_map = { - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'admin_user_ssh_public_key': {'key': 'adminUserSshPublicKey', 'type': 'str'}, - 'admin_user_password': {'key': 'adminUserPassword', 'type': 'str'}, + "admin_user_name": {"key": "adminUserName", "type": "str"}, + "admin_user_ssh_public_key": { + "key": "adminUserSshPublicKey", + "type": "str", + }, + "admin_user_password": {"key": "adminUserPassword", "type": "str"}, } def __init__( @@ -21898,21 +23481,17 @@ class UserAssignedIdentity(msrest.serialization.Model): """ _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, + "principal_id": {"readonly": True}, + "client_id": {"readonly": True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, + "principal_id": {"key": "principalId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UserAssignedIdentity, self).__init__(**kwargs) self.principal_id = None self.client_id = None @@ -21926,14 +23505,11 @@ class UserCreatedAcrAccount(msrest.serialization.Model): """ _attribute_map = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, + "arm_resource_id": {"key": "armResourceId", "type": "ArmResourceId"}, } def __init__( - self, - *, - arm_resource_id: Optional["ArmResourceId"] = None, - **kwargs + self, *, arm_resource_id: Optional["ArmResourceId"] = None, **kwargs ): """ :keyword arm_resource_id: ARM ResourceId of a resource. @@ -21951,14 +23527,11 @@ class UserCreatedStorageAccount(msrest.serialization.Model): """ _attribute_map = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, + "arm_resource_id": {"key": "armResourceId", "type": "ArmResourceId"}, } def __init__( - self, - *, - arm_resource_id: Optional["ArmResourceId"] = None, - **kwargs + self, *, arm_resource_id: Optional["ArmResourceId"] = None, **kwargs ): """ :keyword arm_resource_id: ARM ResourceId of a resource. @@ -21980,24 +23553,22 @@ class UserIdentity(IdentityConfiguration): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UserIdentity, self).__init__(**kwargs) - self.identity_type = 'UserIdentity' # type: str + self.identity_type = "UserIdentity" # type: str -class UsernamePasswordAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class UsernamePasswordAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """UsernamePasswordAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -22020,16 +23591,19 @@ class UsernamePasswordAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionP """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionUsernamePassword'}, + "auth_type": {"key": "authType", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionUsernamePassword", + }, } def __init__( @@ -22057,8 +23631,16 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword """ - super(UsernamePasswordAuthTypeWorkspaceConnectionProperties, self).__init__(category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'UsernamePassword' # type: str + super( + UsernamePasswordAuthTypeWorkspaceConnectionProperties, self + ).__init__( + category=category, + target=target, + value=value, + value_format=value_format, + **kwargs + ) + self.auth_type = "UsernamePassword" # type: str self.credentials = credentials @@ -22070,7 +23652,10 @@ class VirtualMachineSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, + "properties": { + "key": "properties", + "type": "VirtualMachineSchemaProperties", + }, } def __init__( @@ -22127,26 +23712,32 @@ class VirtualMachine(Compute, VirtualMachineSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": { + "key": "properties", + "type": "VirtualMachineSchemaProperties", + }, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -22173,9 +23764,16 @@ def __init__( MSI and AAD exclusively for authentication. :paramtype disable_local_auth: bool """ - super(VirtualMachine, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) + super(VirtualMachine, self).__init__( + compute_location=compute_location, + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'VirtualMachine' # type: str + self.compute_type = "VirtualMachine" # type: str self.compute_location = compute_location self.provisioning_state = None self.description = description @@ -22197,19 +23795,14 @@ class VirtualMachineImage(msrest.serialization.Model): """ _validation = { - 'id': {'required': True}, + "id": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, } - def __init__( - self, - *, - id: str, - **kwargs - ): + def __init__(self, *, id: str, **kwargs): """ :keyword id: Required. Virtual Machine image path. :paramtype id: str @@ -22238,12 +23831,18 @@ class VirtualMachineSchemaProperties(msrest.serialization.Model): """ _attribute_map = { - 'virtual_machine_size': {'key': 'virtualMachineSize', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'notebook_server_port': {'key': 'notebookServerPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'is_notebook_instance_compute': {'key': 'isNotebookInstanceCompute', 'type': 'bool'}, + "virtual_machine_size": {"key": "virtualMachineSize", "type": "str"}, + "ssh_port": {"key": "sshPort", "type": "int"}, + "notebook_server_port": {"key": "notebookServerPort", "type": "int"}, + "address": {"key": "address", "type": "str"}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, + "is_notebook_instance_compute": { + "key": "isNotebookInstanceCompute", + "type": "bool", + }, } def __init__( @@ -22291,7 +23890,10 @@ class VirtualMachineSecretsSchema(msrest.serialization.Model): """ _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, } def __init__( @@ -22324,12 +23926,15 @@ class VirtualMachineSecrets(ComputeSecrets, VirtualMachineSecretsSchema): """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, + "compute_type": {"key": "computeType", "type": "str"}, } def __init__( @@ -22343,9 +23948,11 @@ def __init__( :paramtype administrator_account: ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials """ - super(VirtualMachineSecrets, self).__init__(administrator_account=administrator_account, **kwargs) + super(VirtualMachineSecrets, self).__init__( + administrator_account=administrator_account, **kwargs + ) self.administrator_account = administrator_account - self.compute_type = 'VirtualMachine' # type: str + self.compute_type = "VirtualMachine" # type: str class VirtualMachineSize(msrest.serialization.Model): @@ -22380,29 +23987,38 @@ class VirtualMachineSize(msrest.serialization.Model): """ _validation = { - 'name': {'readonly': True}, - 'family': {'readonly': True}, - 'v_cp_us': {'readonly': True}, - 'gpus': {'readonly': True}, - 'os_vhd_size_mb': {'readonly': True}, - 'max_resource_volume_mb': {'readonly': True}, - 'memory_gb': {'readonly': True}, - 'low_priority_capable': {'readonly': True}, - 'premium_io': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'v_cp_us': {'key': 'vCPUs', 'type': 'int'}, - 'gpus': {'key': 'gpus', 'type': 'int'}, - 'os_vhd_size_mb': {'key': 'osVhdSizeMB', 'type': 'int'}, - 'max_resource_volume_mb': {'key': 'maxResourceVolumeMB', 'type': 'int'}, - 'memory_gb': {'key': 'memoryGB', 'type': 'float'}, - 'low_priority_capable': {'key': 'lowPriorityCapable', 'type': 'bool'}, - 'premium_io': {'key': 'premiumIO', 'type': 'bool'}, - 'estimated_vm_prices': {'key': 'estimatedVMPrices', 'type': 'EstimatedVMPrices'}, - 'supported_compute_types': {'key': 'supportedComputeTypes', 'type': '[str]'}, + "name": {"readonly": True}, + "family": {"readonly": True}, + "v_cp_us": {"readonly": True}, + "gpus": {"readonly": True}, + "os_vhd_size_mb": {"readonly": True}, + "max_resource_volume_mb": {"readonly": True}, + "memory_gb": {"readonly": True}, + "low_priority_capable": {"readonly": True}, + "premium_io": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "family": {"key": "family", "type": "str"}, + "v_cp_us": {"key": "vCPUs", "type": "int"}, + "gpus": {"key": "gpus", "type": "int"}, + "os_vhd_size_mb": {"key": "osVhdSizeMB", "type": "int"}, + "max_resource_volume_mb": { + "key": "maxResourceVolumeMB", + "type": "int", + }, + "memory_gb": {"key": "memoryGB", "type": "float"}, + "low_priority_capable": {"key": "lowPriorityCapable", "type": "bool"}, + "premium_io": {"key": "premiumIO", "type": "bool"}, + "estimated_vm_prices": { + "key": "estimatedVMPrices", + "type": "EstimatedVMPrices", + }, + "supported_compute_types": { + "key": "supportedComputeTypes", + "type": "[str]", + }, } def __init__( @@ -22441,14 +24057,11 @@ class VirtualMachineSizeListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[VirtualMachineSize]'}, + "value": {"key": "value", "type": "[VirtualMachineSize]"}, } def __init__( - self, - *, - value: Optional[List["VirtualMachineSize"]] = None, - **kwargs + self, *, value: Optional[List["VirtualMachineSize"]] = None, **kwargs ): """ :keyword value: The list of virtual machine sizes supported by AmlCompute. @@ -22472,10 +24085,10 @@ class VirtualMachineSshCredentials(msrest.serialization.Model): """ _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'public_key_data': {'key': 'publicKeyData', 'type': 'str'}, - 'private_key_data': {'key': 'privateKeyData', 'type': 'str'}, + "username": {"key": "username", "type": "str"}, + "password": {"key": "password", "type": "str"}, + "public_key_data": {"key": "publicKeyData", "type": "str"}, + "private_key_data": {"key": "privateKeyData", "type": "str"}, } def __init__( @@ -22527,14 +24140,14 @@ class VolumeDefinition(msrest.serialization.Model): """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'read_only': {'key': 'readOnly', 'type': 'bool'}, - 'source': {'key': 'source', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'consistency': {'key': 'consistency', 'type': 'str'}, - 'bind': {'key': 'bind', 'type': 'BindOptions'}, - 'volume': {'key': 'volume', 'type': 'VolumeOptions'}, - 'tmpfs': {'key': 'tmpfs', 'type': 'TmpfsOptions'}, + "type": {"key": "type", "type": "str"}, + "read_only": {"key": "readOnly", "type": "bool"}, + "source": {"key": "source", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "consistency": {"key": "consistency", "type": "str"}, + "bind": {"key": "bind", "type": "BindOptions"}, + "volume": {"key": "volume", "type": "VolumeOptions"}, + "tmpfs": {"key": "tmpfs", "type": "TmpfsOptions"}, } def __init__( @@ -22589,15 +24202,10 @@ class VolumeOptions(msrest.serialization.Model): """ _attribute_map = { - 'nocopy': {'key': 'nocopy', 'type': 'bool'}, + "nocopy": {"key": "nocopy", "type": "bool"}, } - def __init__( - self, - *, - nocopy: Optional[bool] = None, - **kwargs - ): + def __init__(self, *, nocopy: Optional[bool] = None, **kwargs): """ :keyword nocopy: Indicate whether volume is nocopy. :paramtype nocopy: bool @@ -22702,55 +24310,103 @@ class Workspace(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'workspace_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'service_provisioned_resource_group': {'readonly': True}, - 'private_link_count': {'readonly': True}, - 'private_endpoint_connections': {'readonly': True}, - 'notebook_info': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'storage_hns_enabled': {'readonly': True}, - 'ml_flow_tracking_uri': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'key_vault': {'key': 'properties.keyVault', 'type': 'str'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'storage_account': {'key': 'properties.storageAccount', 'type': 'str'}, - 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionProperty'}, - 'hbi_workspace': {'key': 'properties.hbiWorkspace', 'type': 'bool'}, - 'service_provisioned_resource_group': {'key': 'properties.serviceProvisionedResourceGroup', 'type': 'str'}, - 'private_link_count': {'key': 'properties.privateLinkCount', 'type': 'int'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'allow_public_access_when_behind_vnet': {'key': 'properties.allowPublicAccessWhenBehindVnet', 'type': 'bool'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, - 'shared_private_link_resources': {'key': 'properties.sharedPrivateLinkResources', 'type': '[SharedPrivateLinkResource]'}, - 'notebook_info': {'key': 'properties.notebookInfo', 'type': 'NotebookResourceInfo'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, - 'storage_hns_enabled': {'key': 'properties.storageHnsEnabled', 'type': 'bool'}, - 'ml_flow_tracking_uri': {'key': 'properties.mlFlowTrackingUri', 'type': 'str'}, - 'v1_legacy_mode': {'key': 'properties.v1LegacyMode', 'type': 'bool'}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "workspace_id": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "service_provisioned_resource_group": {"readonly": True}, + "private_link_count": {"readonly": True}, + "private_endpoint_connections": {"readonly": True}, + "notebook_info": {"readonly": True}, + "tenant_id": {"readonly": True}, + "storage_hns_enabled": {"readonly": True}, + "ml_flow_tracking_uri": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "workspace_id": {"key": "properties.workspaceId", "type": "str"}, + "description": {"key": "properties.description", "type": "str"}, + "friendly_name": {"key": "properties.friendlyName", "type": "str"}, + "key_vault": {"key": "properties.keyVault", "type": "str"}, + "application_insights": { + "key": "properties.applicationInsights", + "type": "str", + }, + "container_registry": { + "key": "properties.containerRegistry", + "type": "str", + }, + "storage_account": {"key": "properties.storageAccount", "type": "str"}, + "discovery_url": {"key": "properties.discoveryUrl", "type": "str"}, + "provisioning_state": { + "key": "properties.provisioningState", + "type": "str", + }, + "encryption": { + "key": "properties.encryption", + "type": "EncryptionProperty", + }, + "hbi_workspace": {"key": "properties.hbiWorkspace", "type": "bool"}, + "service_provisioned_resource_group": { + "key": "properties.serviceProvisionedResourceGroup", + "type": "str", + }, + "private_link_count": { + "key": "properties.privateLinkCount", + "type": "int", + }, + "image_build_compute": { + "key": "properties.imageBuildCompute", + "type": "str", + }, + "allow_public_access_when_behind_vnet": { + "key": "properties.allowPublicAccessWhenBehindVnet", + "type": "bool", + }, + "public_network_access": { + "key": "properties.publicNetworkAccess", + "type": "str", + }, + "private_endpoint_connections": { + "key": "properties.privateEndpointConnections", + "type": "[PrivateEndpointConnection]", + }, + "shared_private_link_resources": { + "key": "properties.sharedPrivateLinkResources", + "type": "[SharedPrivateLinkResource]", + }, + "notebook_info": { + "key": "properties.notebookInfo", + "type": "NotebookResourceInfo", + }, + "service_managed_resources_settings": { + "key": "properties.serviceManagedResourcesSettings", + "type": "ServiceManagedResourcesSettings", + }, + "primary_user_assigned_identity": { + "key": "properties.primaryUserAssignedIdentity", + "type": "str", + }, + "tenant_id": {"key": "properties.tenantId", "type": "str"}, + "storage_hns_enabled": { + "key": "properties.storageHnsEnabled", + "type": "bool", + }, + "ml_flow_tracking_uri": { + "key": "properties.mlFlowTrackingUri", + "type": "str", + }, + "v1_legacy_mode": {"key": "properties.v1LegacyMode", "type": "bool"}, } def __init__( @@ -22771,9 +24427,15 @@ def __init__( hbi_workspace: Optional[bool] = False, image_build_compute: Optional[str] = None, allow_public_access_when_behind_vnet: Optional[bool] = False, - public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, - shared_private_link_resources: Optional[List["SharedPrivateLinkResource"]] = None, - service_managed_resources_settings: Optional["ServiceManagedResourcesSettings"] = None, + public_network_access: Optional[ + Union[str, "PublicNetworkAccess"] + ] = None, + shared_private_link_resources: Optional[ + List["SharedPrivateLinkResource"] + ] = None, + service_managed_resources_settings: Optional[ + "ServiceManagedResourcesSettings" + ] = None, primary_user_assigned_identity: Optional[str] = None, v1_legacy_mode: Optional[bool] = False, **kwargs @@ -22852,12 +24514,16 @@ def __init__( self.service_provisioned_resource_group = None self.private_link_count = None self.image_build_compute = image_build_compute - self.allow_public_access_when_behind_vnet = allow_public_access_when_behind_vnet + self.allow_public_access_when_behind_vnet = ( + allow_public_access_when_behind_vnet + ) self.public_network_access = public_network_access self.private_endpoint_connections = None self.shared_private_link_resources = shared_private_link_resources self.notebook_info = None - self.service_managed_resources_settings = service_managed_resources_settings + self.service_managed_resources_settings = ( + service_managed_resources_settings + ) self.primary_user_assigned_identity = primary_user_assigned_identity self.tenant_id = None self.storage_hns_enabled = None @@ -22875,8 +24541,8 @@ class WorkspaceConnectionManagedIdentity(msrest.serialization.Model): """ _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, + "resource_id": {"key": "resourceId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, } def __init__( @@ -22905,15 +24571,10 @@ class WorkspaceConnectionPersonalAccessToken(msrest.serialization.Model): """ _attribute_map = { - 'pat': {'key': 'pat', 'type': 'str'}, + "pat": {"key": "pat", "type": "str"}, } - def __init__( - self, - *, - pat: Optional[str] = None, - **kwargs - ): + def __init__(self, *, pat: Optional[str] = None, **kwargs): """ :keyword pat: :paramtype pat: str @@ -22945,37 +24606,41 @@ class WorkspaceConnectionPropertiesV2BasicResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'WorkspaceConnectionPropertiesV2'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "WorkspaceConnectionPropertiesV2", + }, } def __init__( - self, - *, - properties: "WorkspaceConnectionPropertiesV2", - **kwargs + self, *, properties: "WorkspaceConnectionPropertiesV2", **kwargs ): """ :keyword properties: Required. :paramtype properties: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 """ - super(WorkspaceConnectionPropertiesV2BasicResource, self).__init__(**kwargs) + super(WorkspaceConnectionPropertiesV2BasicResource, self).__init__( + **kwargs + ) self.properties = properties -class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(msrest.serialization.Model): +class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult( + msrest.serialization.Model +): """WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult. Variables are only populated by the server, and will be ignored when sending a request. @@ -22988,18 +24653,23 @@ class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(msrest.seri """ _validation = { - 'next_link': {'readonly': True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[WorkspaceConnectionPropertiesV2BasicResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": { + "key": "value", + "type": "[WorkspaceConnectionPropertiesV2BasicResource]", + }, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( self, *, - value: Optional[List["WorkspaceConnectionPropertiesV2BasicResource"]] = None, + value: Optional[ + List["WorkspaceConnectionPropertiesV2BasicResource"] + ] = None, **kwargs ): """ @@ -23007,7 +24677,10 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource] """ - super(WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, self).__init__(**kwargs) + super( + WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, + self, + ).__init__(**kwargs) self.value = value self.next_link = None @@ -23020,20 +24693,17 @@ class WorkspaceConnectionSharedAccessSignature(msrest.serialization.Model): """ _attribute_map = { - 'sas': {'key': 'sas', 'type': 'str'}, + "sas": {"key": "sas", "type": "str"}, } - def __init__( - self, - *, - sas: Optional[str] = None, - **kwargs - ): + def __init__(self, *, sas: Optional[str] = None, **kwargs): """ :keyword sas: :paramtype sas: str """ - super(WorkspaceConnectionSharedAccessSignature, self).__init__(**kwargs) + super(WorkspaceConnectionSharedAccessSignature, self).__init__( + **kwargs + ) self.sas = sas @@ -23047,8 +24717,8 @@ class WorkspaceConnectionUsernamePassword(msrest.serialization.Model): """ _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, + "username": {"key": "username", "type": "str"}, + "password": {"key": "password", "type": "str"}, } def __init__( @@ -23081,8 +24751,8 @@ class WorkspaceListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[Workspace]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Workspace]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( @@ -23137,17 +24807,35 @@ class WorkspaceUpdateParameters(msrest.serialization.Model): """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "description": {"key": "properties.description", "type": "str"}, + "friendly_name": {"key": "properties.friendlyName", "type": "str"}, + "image_build_compute": { + "key": "properties.imageBuildCompute", + "type": "str", + }, + "service_managed_resources_settings": { + "key": "properties.serviceManagedResourcesSettings", + "type": "ServiceManagedResourcesSettings", + }, + "primary_user_assigned_identity": { + "key": "properties.primaryUserAssignedIdentity", + "type": "str", + }, + "public_network_access": { + "key": "properties.publicNetworkAccess", + "type": "str", + }, + "application_insights": { + "key": "properties.applicationInsights", + "type": "str", + }, + "container_registry": { + "key": "properties.containerRegistry", + "type": "str", + }, } def __init__( @@ -23159,9 +24847,13 @@ def __init__( description: Optional[str] = None, friendly_name: Optional[str] = None, image_build_compute: Optional[str] = None, - service_managed_resources_settings: Optional["ServiceManagedResourcesSettings"] = None, + service_managed_resources_settings: Optional[ + "ServiceManagedResourcesSettings" + ] = None, primary_user_assigned_identity: Optional[str] = None, - public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, + public_network_access: Optional[ + Union[str, "PublicNetworkAccess"] + ] = None, application_insights: Optional[str] = None, container_registry: Optional[str] = None, **kwargs @@ -23202,7 +24894,9 @@ def __init__( self.description = description self.friendly_name = friendly_name self.image_build_compute = image_build_compute - self.service_managed_resources_settings = service_managed_resources_settings + self.service_managed_resources_settings = ( + service_managed_resources_settings + ) self.primary_user_assigned_identity = primary_user_assigned_identity self.public_network_access = public_network_access self.application_insights = application_insights diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/__init__.py index 3e962fe91039..15d5f7dffd74 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/__init__.py @@ -12,21 +12,39 @@ from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations from ._quotas_operations import QuotasOperations from ._compute_operations import ComputeOperations -from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_endpoint_connections_operations import ( + PrivateEndpointConnectionsOperations, +) from ._private_link_resources_operations import PrivateLinkResourcesOperations from ._workspace_connections_operations import WorkspaceConnectionsOperations from ._registries_operations import RegistriesOperations from ._workspace_features_operations import WorkspaceFeaturesOperations -from ._registry_code_containers_operations import RegistryCodeContainersOperations +from ._registry_code_containers_operations import ( + RegistryCodeContainersOperations, +) from ._registry_code_versions_operations import RegistryCodeVersionsOperations -from ._registry_component_containers_operations import RegistryComponentContainersOperations -from ._registry_component_versions_operations import RegistryComponentVersionsOperations -from ._registry_data_containers_operations import RegistryDataContainersOperations +from ._registry_component_containers_operations import ( + RegistryComponentContainersOperations, +) +from ._registry_component_versions_operations import ( + RegistryComponentVersionsOperations, +) +from ._registry_data_containers_operations import ( + RegistryDataContainersOperations, +) from ._registry_data_versions_operations import RegistryDataVersionsOperations -from ._registry_environment_containers_operations import RegistryEnvironmentContainersOperations -from ._registry_environment_versions_operations import RegistryEnvironmentVersionsOperations -from ._registry_model_containers_operations import RegistryModelContainersOperations -from ._registry_model_versions_operations import RegistryModelVersionsOperations +from ._registry_environment_containers_operations import ( + RegistryEnvironmentContainersOperations, +) +from ._registry_environment_versions_operations import ( + RegistryEnvironmentVersionsOperations, +) +from ._registry_model_containers_operations import ( + RegistryModelContainersOperations, +) +from ._registry_model_versions_operations import ( + RegistryModelVersionsOperations, +) from ._batch_endpoints_operations import BatchEndpointsOperations from ._batch_deployments_operations import BatchDeploymentsOperations from ._code_containers_operations import CodeContainersOperations @@ -46,42 +64,42 @@ from ._schedules_operations import SchedulesOperations __all__ = [ - 'Operations', - 'WorkspacesOperations', - 'UsagesOperations', - 'VirtualMachineSizesOperations', - 'QuotasOperations', - 'ComputeOperations', - 'PrivateEndpointConnectionsOperations', - 'PrivateLinkResourcesOperations', - 'WorkspaceConnectionsOperations', - 'RegistriesOperations', - 'WorkspaceFeaturesOperations', - 'RegistryCodeContainersOperations', - 'RegistryCodeVersionsOperations', - 'RegistryComponentContainersOperations', - 'RegistryComponentVersionsOperations', - 'RegistryDataContainersOperations', - 'RegistryDataVersionsOperations', - 'RegistryEnvironmentContainersOperations', - 'RegistryEnvironmentVersionsOperations', - 'RegistryModelContainersOperations', - 'RegistryModelVersionsOperations', - 'BatchEndpointsOperations', - 'BatchDeploymentsOperations', - 'CodeContainersOperations', - 'CodeVersionsOperations', - 'ComponentContainersOperations', - 'ComponentVersionsOperations', - 'DataContainersOperations', - 'DataVersionsOperations', - 'DatastoresOperations', - 'EnvironmentContainersOperations', - 'EnvironmentVersionsOperations', - 'JobsOperations', - 'ModelContainersOperations', - 'ModelVersionsOperations', - 'OnlineEndpointsOperations', - 'OnlineDeploymentsOperations', - 'SchedulesOperations', + "Operations", + "WorkspacesOperations", + "UsagesOperations", + "VirtualMachineSizesOperations", + "QuotasOperations", + "ComputeOperations", + "PrivateEndpointConnectionsOperations", + "PrivateLinkResourcesOperations", + "WorkspaceConnectionsOperations", + "RegistriesOperations", + "WorkspaceFeaturesOperations", + "RegistryCodeContainersOperations", + "RegistryCodeVersionsOperations", + "RegistryComponentContainersOperations", + "RegistryComponentVersionsOperations", + "RegistryDataContainersOperations", + "RegistryDataVersionsOperations", + "RegistryEnvironmentContainersOperations", + "RegistryEnvironmentVersionsOperations", + "RegistryModelContainersOperations", + "RegistryModelVersionsOperations", + "BatchEndpointsOperations", + "BatchDeploymentsOperations", + "CodeContainersOperations", + "CodeVersionsOperations", + "ComponentContainersOperations", + "ComponentVersionsOperations", + "DataContainersOperations", + "DataVersionsOperations", + "DatastoresOperations", + "EnvironmentContainersOperations", + "EnvironmentVersionsOperations", + "JobsOperations", + "ModelContainersOperations", + "ModelVersionsOperations", + "OnlineEndpointsOperations", + "OnlineDeploymentsOperations", + "SchedulesOperations", ] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_batch_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_batch_deployments_operations.py index e0e49b5fe048..0d8bc34ee56e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_batch_deployments_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_batch_deployments_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -250,6 +262,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class BatchDeploymentsOperations(object): """BatchDeploymentsOperations operations. @@ -308,16 +321,21 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.BatchDeploymentTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -327,13 +345,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -351,7 +369,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("BatchDeploymentTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "BatchDeploymentTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -360,25 +381,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -389,15 +416,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -405,34 +433,47 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -468,14 +509,17 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -483,29 +527,37 @@ def begin_delete( # pylint: disable=inconsistent-return-statements endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def get( @@ -534,15 +586,18 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.BatchDeployment :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -550,32 +605,39 @@ def get( endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize("BatchDeployment", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore def _update_initial( self, @@ -587,16 +649,25 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.BatchDeployment"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchDeployment"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.BatchDeployment"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties') + _json = self._serialize.body( + body, + "PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties", + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -607,40 +678,55 @@ def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def begin_update( @@ -682,15 +768,22 @@ def begin_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -700,32 +793,38 @@ def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore def _create_or_update_initial( self, @@ -737,16 +836,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.BatchDeployment" - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'BatchDeployment') + _json = self._serialize.body(body, "BatchDeployment") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -757,39 +862,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchDeployment', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -830,15 +951,22 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -848,29 +976,39 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_batch_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_batch_endpoints_operations.py index b9e440d68b32..b23b09a894f5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_batch_endpoints_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_batch_endpoints_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -276,6 +288,7 @@ def build_list_keys_request( **kwargs ) + # fmt: on class BatchEndpointsOperations(object): """BatchEndpointsOperations operations. @@ -328,16 +341,21 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.BatchEndpointTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -345,13 +363,13 @@ def prepare_request(next_link=None): api_version=api_version, count=count, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -367,7 +385,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("BatchEndpointTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "BatchEndpointTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -376,25 +397,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -404,49 +431,63 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -479,43 +520,54 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace def get( @@ -541,47 +593,55 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.BatchEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize("BatchEndpoint", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore def _update_initial( self, @@ -592,16 +652,24 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.BatchEndpoint"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchEndpoint"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.BatchEndpoint"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') + _json = self._serialize.body( + body, "PartialMinimalTrackedResourceWithIdentity" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -611,40 +679,55 @@ def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace def begin_update( @@ -682,15 +765,20 @@ def begin_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -699,32 +787,38 @@ def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore def _create_or_update_initial( self, @@ -735,16 +829,20 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.BatchEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'BatchEndpoint') + _json = self._serialize.body(body, "BatchEndpoint") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -754,39 +852,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -823,15 +937,20 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -840,32 +959,42 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace def list_keys( @@ -891,44 +1020,54 @@ def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthKeys"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) + deserialized = self._deserialize("EndpointAuthKeys", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys"} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_code_containers_operations.py index 871f82479620..0cc4a40818c8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_code_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_code_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -190,6 +202,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class CodeContainersOperations(object): """CodeContainersOperations operations. @@ -239,29 +252,34 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -276,7 +294,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -285,25 +305,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -329,43 +355,51 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore @distributed_trace def get( @@ -391,47 +425,55 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize("CodeContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore @distributed_trace def create_or_update( @@ -460,16 +502,20 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeContainer') + _json = self._serialize.body(body, "CodeContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -479,33 +525,44 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_code_versions_operations.py index 58e57a522653..e56ee6d10dcc 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_code_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_code_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -254,6 +266,7 @@ def build_create_or_get_start_pending_upload_request( **kwargs ) + # fmt: on class CodeVersionsOperations(object): """CodeVersionsOperations operations. @@ -319,16 +332,21 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -340,13 +358,13 @@ def prepare_request(next_link=None): skip=skip, hash=hash, hash_version=hash_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -366,7 +384,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -375,25 +395,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -422,15 +448,16 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -438,28 +465,35 @@ def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -488,15 +522,16 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -504,32 +539,39 @@ def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace def create_or_update( @@ -561,16 +603,20 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeVersion') + _json = self._serialize.body(body, "CodeVersion") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -581,36 +627,43 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace def create_or_get_start_pending_upload( @@ -642,16 +695,22 @@ def create_or_get_start_pending_upload( :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PendingUploadResponseDto"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PendingUploadRequestDto') + _json = self._serialize.body(body, "PendingUploadRequestDto") request = build_create_or_get_start_pending_upload_request( subscription_id=self._config.subscription_id, @@ -662,29 +721,40 @@ def create_or_get_start_pending_upload( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], + template_url=self.create_or_get_start_pending_upload.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) + deserialized = self._deserialize( + "PendingUploadResponseDto", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/startPendingUpload"} # type: ignore - + create_or_get_start_pending_upload.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/startPendingUpload"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_component_containers_operations.py index 90194a192d39..e9c8948c8c39 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_component_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_component_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -193,6 +205,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class ComponentContainersOperations(object): """ComponentContainersOperations operations. @@ -245,16 +258,21 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -262,13 +280,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -284,7 +302,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -293,25 +314,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -337,43 +364,51 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore @distributed_trace def get( @@ -399,47 +434,59 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore @distributed_trace def create_or_update( @@ -468,16 +515,22 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentContainer') + _json = self._serialize.body(body, "ComponentContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -487,33 +540,44 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_component_versions_operations.py index ad6cee31eebf..4567f4b0f32e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_component_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_component_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -207,6 +219,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class ComponentVersionsOperations(object): """ComponentVersionsOperations operations. @@ -268,16 +281,21 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -288,13 +306,13 @@ def prepare_request(next_link=None): top=top, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -313,7 +331,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -322,25 +342,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -369,15 +395,16 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -385,28 +412,35 @@ def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -435,15 +469,18 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -451,32 +488,39 @@ def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize("ComponentVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace def create_or_update( @@ -508,16 +552,22 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentVersion') + _json = self._serialize.body(body, "ComponentVersion") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -528,33 +578,44 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_compute_operations.py index 30abe3af9ac4..f4a11276cee4 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_compute_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_compute_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -431,6 +443,7 @@ def build_restart_request_initial( **kwargs ) + # fmt: on class ComputeOperations(object): """ComputeOperations operations. @@ -478,29 +491,34 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedComputeResourcesList] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedComputeResourcesList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedComputeResourcesList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -515,7 +533,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedComputeResourcesList", pipeline_response) + deserialized = self._deserialize( + "PaginatedComputeResourcesList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -524,25 +544,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes"} # type: ignore @distributed_trace def get( @@ -567,47 +593,57 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComputeResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize("ComputeResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore def _create_or_update_initial( self, @@ -618,16 +654,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.ComputeResource" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'ComputeResource') + _json = self._serialize.body(parameters, "ComputeResource") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -637,38 +679,49 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if response.status_code == 201: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComputeResource', pipeline_response) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -706,15 +759,22 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -723,32 +783,38 @@ def begin_create_or_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore def _update_initial( self, @@ -759,16 +825,22 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> "_models.ComputeResource" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'ClusterUpdateParameters') + _json = self._serialize.body(parameters, "ClusterUpdateParameters") request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -778,31 +850,36 @@ def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize("ComputeResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace def begin_update( @@ -839,15 +916,22 @@ def begin_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -856,32 +940,38 @@ def begin_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -892,15 +982,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -908,33 +999,41 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements compute_name=compute_name, api_version=api_version, underlying_resource_action=underlying_resource_action, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -970,14 +1069,17 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -985,29 +1087,33 @@ def begin_delete( # pylint: disable=inconsistent-return-statements compute_name=compute_name, underlying_resource_action=underlying_resource_action, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace def list_nodes( @@ -1033,29 +1139,34 @@ def list_nodes( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.AmlComputeNodesInformation] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlComputeNodesInformation"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.AmlComputeNodesInformation"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_nodes_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self.list_nodes.metadata['url'], + template_url=self.list_nodes.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_nodes_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -1070,7 +1181,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("AmlComputeNodesInformation", pipeline_response) + deserialized = self._deserialize( + "AmlComputeNodesInformation", pipeline_response + ) list_of_elem = deserialized.nodes if cls: list_of_elem = cls(list_of_elem) @@ -1079,25 +1192,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_nodes.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes"} # type: ignore + list_nodes.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes"} # type: ignore @distributed_trace def list_keys( @@ -1121,47 +1240,57 @@ def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ComputeSecrets :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeSecrets"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeSecrets"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComputeSecrets', pipeline_response) + deserialized = self._deserialize("ComputeSecrets", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys"} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys"} # type: ignore def _start_initial( # pylint: disable=inconsistent-return-statements self, @@ -1171,42 +1300,48 @@ def _start_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_start_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self._start_initial.metadata['url'], + template_url=self._start_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _start_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore - + _start_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore @distributed_trace def begin_start( # pylint: disable=inconsistent-return-statements @@ -1237,43 +1372,50 @@ def begin_start( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._start_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_start.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore + begin_start.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore def _stop_initial( # pylint: disable=inconsistent-return-statements self, @@ -1283,42 +1425,48 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_stop_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self._stop_initial.metadata['url'], + template_url=self._stop_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _stop_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore - + _stop_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore @distributed_trace def begin_stop( # pylint: disable=inconsistent-return-statements @@ -1349,43 +1497,50 @@ def begin_stop( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._stop_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_stop.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore + begin_stop.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore def _restart_initial( # pylint: disable=inconsistent-return-statements self, @@ -1395,42 +1550,48 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_restart_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self._restart_initial.metadata['url'], + template_url=self._restart_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _restart_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore - + _restart_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore @distributed_trace def begin_restart( # pylint: disable=inconsistent-return-statements @@ -1461,40 +1622,47 @@ def begin_restart( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._restart_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_restart.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore + begin_restart.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_data_containers_operations.py index b8d05a1c7f83..8f677d30984a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_data_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_data_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -193,6 +205,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class DataContainersOperations(object): """DataContainersOperations operations. @@ -245,16 +258,21 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -262,13 +280,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -284,7 +302,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -293,25 +313,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -337,43 +363,51 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore @distributed_trace def get( @@ -399,47 +433,55 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize("DataContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore @distributed_trace def create_or_update( @@ -468,16 +510,20 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DataContainer') + _json = self._serialize.body(body, "DataContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -487,33 +533,44 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_data_versions_operations.py index 7797eaf00b11..bb7c3710df84 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_data_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_data_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -210,6 +222,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class DataVersionsOperations(object): """DataVersionsOperations operations. @@ -278,16 +291,21 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -299,13 +317,13 @@ def prepare_request(next_link=None): skip=skip, tags=tags, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -325,7 +343,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataVersionBaseResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -334,25 +354,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -381,15 +407,16 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -397,28 +424,35 @@ def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -447,15 +481,18 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -463,32 +500,39 @@ def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize("DataVersionBase", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace def create_or_update( @@ -520,16 +564,22 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DataVersionBase') + _json = self._serialize.body(body, "DataVersionBase") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -540,33 +590,44 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_datastores_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_datastores_operations.py index 4a1689ca884e..28009a729cf9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_datastores_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_datastores_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, List, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -250,6 +262,7 @@ def build_list_secrets_request( **kwargs ) + # fmt: on class DatastoresOperations(object): """DatastoresOperations operations. @@ -317,16 +330,21 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DatastoreResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -339,13 +357,13 @@ def prepare_request(next_link=None): search_text=search_text, order_by=order_by, order_by_asc=order_by_asc, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -366,7 +384,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("DatastoreResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DatastoreResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -375,25 +395,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -419,43 +445,51 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace def get( @@ -481,47 +515,55 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.Datastore :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Datastore"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Datastore"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Datastore', pipeline_response) + deserialized = self._deserialize("Datastore", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace def create_or_update( @@ -553,16 +595,20 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.Datastore :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Datastore"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Datastore"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'Datastore') + _json = self._serialize.body(body, "Datastore") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -573,36 +619,43 @@ def create_or_update( content_type=content_type, json=_json, skip_validation=skip_validation, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('Datastore', pipeline_response) + deserialized = self._deserialize("Datastore", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('Datastore', pipeline_response) + deserialized = self._deserialize("Datastore", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace def list_secrets( @@ -628,44 +681,54 @@ def list_secrets( :rtype: ~azure.mgmt.machinelearningservices.models.DatastoreSecrets :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreSecrets"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DatastoreSecrets"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_list_secrets_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.list_secrets.metadata['url'], + template_url=self.list_secrets.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DatastoreSecrets', pipeline_response) + deserialized = self._deserialize("DatastoreSecrets", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_secrets.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets"} # type: ignore - + list_secrets.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_environment_containers_operations.py index 26bc1583e3ad..5f94faddedc9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_environment_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_environment_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -193,6 +205,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class EnvironmentContainersOperations(object): """EnvironmentContainersOperations operations. @@ -245,16 +258,21 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -262,13 +280,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -284,7 +302,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -293,25 +314,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -337,43 +364,51 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore @distributed_trace def get( @@ -399,47 +434,59 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore @distributed_trace def create_or_update( @@ -468,16 +515,22 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentContainer') + _json = self._serialize.body(body, "EnvironmentContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -487,33 +540,44 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_environment_versions_operations.py index 13e0ea646c31..043576efeebf 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_environment_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_environment_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -207,6 +219,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class EnvironmentVersionsOperations(object): """EnvironmentVersionsOperations operations. @@ -268,16 +281,21 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -288,13 +306,13 @@ def prepare_request(next_link=None): top=top, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -313,7 +331,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersionResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -322,25 +343,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -369,15 +396,16 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -385,28 +413,35 @@ def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -435,15 +470,18 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -451,32 +489,41 @@ def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace def create_or_update( @@ -508,16 +555,22 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentVersion') + _json = self._serialize.body(body, "EnvironmentVersion") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -528,33 +581,44 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_jobs_operations.py index 0fa88628e1c3..01ebe2701c9f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_jobs_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_jobs_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -240,6 +252,7 @@ def build_cancel_request_initial( **kwargs ) + # fmt: on class JobsOperations(object): """JobsOperations operations. @@ -298,16 +311,21 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.JobBaseResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -317,13 +335,13 @@ def prepare_request(next_link=None): job_type=job_type, tag=tag, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -341,7 +359,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("JobBaseResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "JobBaseResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -350,25 +370,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -378,49 +404,63 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -453,43 +493,54 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace def get( @@ -515,47 +566,55 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.JobBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.JobBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('JobBase', pipeline_response) + deserialized = self._deserialize("JobBase", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace def create_or_update( @@ -584,16 +643,20 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.JobBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.JobBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'JobBase') + _json = self._serialize.body(body, "JobBase") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -603,36 +666,43 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('JobBase', pipeline_response) + deserialized = self._deserialize("JobBase", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('JobBase', pipeline_response) + deserialized = self._deserialize("JobBase", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore def _cancel_initial( # pylint: disable=inconsistent-return-statements self, @@ -642,48 +712,57 @@ def _cancel_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_cancel_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self._cancel_initial.metadata['url'], + template_url=self._cancel_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _cancel_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore - + _cancel_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore @distributed_trace def begin_cancel( # pylint: disable=inconsistent-return-statements @@ -716,40 +795,51 @@ def begin_cancel( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._cancel_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_cancel.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore + begin_cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_model_containers_operations.py index 7b736b681d88..f4e053c580f9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_model_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_model_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -196,6 +208,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class ModelContainersOperations(object): """ModelContainersOperations operations. @@ -251,16 +264,21 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -269,13 +287,13 @@ def prepare_request(next_link=None): skip=skip, count=count, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -292,7 +310,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -301,25 +321,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -345,43 +371,51 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore @distributed_trace def get( @@ -407,47 +441,57 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize("ModelContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore @distributed_trace def create_or_update( @@ -476,16 +520,22 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelContainer') + _json = self._serialize.body(body, "ModelContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -495,33 +545,44 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_model_versions_operations.py index a39525c00c29..b2a85f41ad41 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_model_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_model_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -225,6 +237,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class ModelVersionsOperations(object): """ModelVersionsOperations operations. @@ -306,16 +319,21 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -332,13 +350,13 @@ def prepare_request(next_link=None): properties=properties, feed=feed, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -363,7 +381,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -372,25 +392,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -419,15 +445,16 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -435,28 +462,35 @@ def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -485,15 +519,16 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -501,32 +536,39 @@ def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace def create_or_update( @@ -558,16 +600,20 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelVersion') + _json = self._serialize.body(body, "ModelVersion") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -578,33 +624,40 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_online_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_online_deployments_operations.py index 97782539c7ac..6ad918daf780 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_online_deployments_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_online_deployments_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -341,6 +353,7 @@ def build_list_skus_request( **kwargs ) + # fmt: on class OnlineDeploymentsOperations(object): """OnlineDeploymentsOperations operations. @@ -399,16 +412,21 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.OnlineDeploymentTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -418,13 +436,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -442,7 +460,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineDeploymentTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "OnlineDeploymentTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -451,25 +472,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -480,15 +507,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -496,34 +524,47 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -559,14 +600,17 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -574,29 +618,37 @@ def begin_delete( # pylint: disable=inconsistent-return-statements endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def get( @@ -625,15 +677,18 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.OnlineDeployment :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -641,32 +696,39 @@ def get( endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize("OnlineDeployment", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore def _update_initial( self, @@ -678,16 +740,24 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.OnlineDeployment"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineDeployment"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.OnlineDeployment"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSku') + _json = self._serialize.body( + body, "PartialMinimalTrackedResourceWithSku" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -698,40 +768,55 @@ def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def begin_update( @@ -772,15 +857,22 @@ def begin_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -790,32 +882,38 @@ def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore def _create_or_update_initial( self, @@ -827,16 +925,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.OnlineDeployment" - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'OnlineDeployment') + _json = self._serialize.body(body, "OnlineDeployment") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -847,39 +951,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -920,15 +1040,22 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -938,32 +1065,42 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def get_logs( @@ -995,16 +1132,22 @@ def get_logs( :rtype: ~azure.mgmt.machinelearningservices.models.DeploymentLogs :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentLogs"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DeploymentLogs"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DeploymentLogsRequest') + _json = self._serialize.body(body, "DeploymentLogsRequest") request = build_get_logs_request( subscription_id=self._config.subscription_id, @@ -1015,32 +1158,39 @@ def get_logs( api_version=api_version, content_type=content_type, json=_json, - template_url=self.get_logs.metadata['url'], + template_url=self.get_logs.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DeploymentLogs', pipeline_response) + deserialized = self._deserialize("DeploymentLogs", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_logs.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs"} # type: ignore - + get_logs.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs"} # type: ignore @distributed_trace def list_skus( @@ -1077,16 +1227,21 @@ def list_skus( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.SkuResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.SkuResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_skus_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -1096,13 +1251,13 @@ def prepare_request(next_link=None): api_version=api_version, count=count, skip=skip, - template_url=self.list_skus.metadata['url'], + template_url=self.list_skus.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_skus_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -1120,7 +1275,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("SkuResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "SkuResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1129,22 +1286,28 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_skus.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus"} # type: ignore + list_skus.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_online_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_online_endpoints_operations.py index 0df1e55dce4b..9247f766a3a8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_online_endpoints_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_online_endpoints_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -372,6 +384,7 @@ def build_get_token_request( **kwargs ) + # fmt: on class OnlineEndpointsOperations(object): """OnlineEndpointsOperations operations. @@ -442,16 +455,21 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.OnlineEndpointTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -464,13 +482,13 @@ def prepare_request(next_link=None): tags=tags, properties=properties, order_by=order_by, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -491,7 +509,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineEndpointTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "OnlineEndpointTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -500,25 +521,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -528,49 +555,63 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -603,43 +644,54 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace def get( @@ -665,47 +717,57 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.OnlineEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize("OnlineEndpoint", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore def _update_initial( self, @@ -716,16 +778,24 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.OnlineEndpoint"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineEndpoint"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.OnlineEndpoint"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') + _json = self._serialize.body( + body, "PartialMinimalTrackedResourceWithIdentity" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -735,40 +805,55 @@ def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace def begin_update( @@ -807,15 +892,22 @@ def begin_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -824,32 +916,38 @@ def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore def _create_or_update_initial( self, @@ -860,16 +958,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.OnlineEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'OnlineEndpoint') + _json = self._serialize.body(body, "OnlineEndpoint") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -879,39 +983,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -949,15 +1069,22 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -966,32 +1093,42 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace def list_keys( @@ -1017,47 +1154,57 @@ def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthKeys"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) + deserialized = self._deserialize("EndpointAuthKeys", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys"} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys"} # type: ignore def _regenerate_keys_initial( # pylint: disable=inconsistent-return-statements self, @@ -1068,16 +1215,20 @@ def _regenerate_keys_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'RegenerateEndpointKeysRequest') + _json = self._serialize.body(body, "RegenerateEndpointKeysRequest") request = build_regenerate_keys_request_initial( subscription_id=self._config.subscription_id, @@ -1087,33 +1238,41 @@ def _regenerate_keys_initial( # pylint: disable=inconsistent-return-statements api_version=api_version, content_type=content_type, json=_json, - template_url=self._regenerate_keys_initial.metadata['url'], + template_url=self._regenerate_keys_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _regenerate_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore - + _regenerate_keys_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore @distributed_trace def begin_regenerate_keys( # pylint: disable=inconsistent-return-statements @@ -1149,15 +1308,20 @@ def begin_regenerate_keys( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._regenerate_keys_initial( resource_group_name=resource_group_name, @@ -1166,29 +1330,37 @@ def begin_regenerate_keys( # pylint: disable=inconsistent-return-statements body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_regenerate_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore + begin_regenerate_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore @distributed_trace def get_token( @@ -1214,44 +1386,56 @@ def get_token( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthToken :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthToken"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthToken"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_token_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.get_token.metadata['url'], + template_url=self.get_token.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EndpointAuthToken', pipeline_response) + deserialized = self._deserialize( + "EndpointAuthToken", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token"} # type: ignore - + get_token.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_operations.py index 47389c149f2f..f30023d7196d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -57,6 +69,7 @@ def build_list_request( **kwargs ) + # fmt: on class Operations(object): """Operations operations. @@ -82,8 +95,7 @@ def __init__(self, client, config, serializer, deserializer): @distributed_trace def list( - self, - **kwargs # type: Any + self, **kwargs # type: Any ): # type: (...) -> Iterable["_models.AmlOperationListResult"] """Lists all of the available Azure Machine Learning Workspaces REST API operations. @@ -95,25 +107,30 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.AmlOperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlOperationListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.AmlOperationListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( api_version=api_version, template_url=next_link, @@ -124,7 +141,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("AmlOperationListResult", pipeline_response) + deserialized = self._deserialize( + "AmlOperationListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -133,22 +152,28 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/providers/Microsoft.MachineLearningServices/operations"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.MachineLearningServices/operations"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_private_endpoint_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_private_endpoint_connections_operations.py index ff88a4b46ce3..5adde218a4fd 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_private_endpoint_connections_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -187,6 +199,7 @@ def build_delete_request( **kwargs ) + # fmt: on class PrivateEndpointConnectionsOperations(object): """PrivateEndpointConnectionsOperations operations. @@ -231,28 +244,33 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnectionListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( resource_group_name=resource_group_name, workspace_name=workspace_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( resource_group_name=resource_group_name, workspace_name=workspace_name, @@ -266,7 +284,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) + deserialized = self._deserialize( + "PrivateEndpointConnectionListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -275,25 +295,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections"} # type: ignore @distributed_trace def get( @@ -318,47 +344,59 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, private_endpoint_connection_name=private_endpoint_connection_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + deserialized = self._deserialize( + "PrivateEndpointConnection", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace def create_or_update( @@ -386,16 +424,22 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(properties, 'PrivateEndpointConnection') + _json = self._serialize.body(properties, "PrivateEndpointConnection") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -405,32 +449,41 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + deserialized = self._deserialize( + "PrivateEndpointConnection", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -455,40 +508,48 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, private_endpoint_connection_name=private_endpoint_connection_name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_private_link_resources_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_private_link_resources_operations.py index 922c9cb818bf..8900303d0355 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_private_link_resources_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_private_link_resources_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest @@ -23,8 +29,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -66,6 +78,7 @@ def build_list_request( **kwargs ) + # fmt: on class PrivateLinkResourcesOperations(object): """PrivateLinkResourcesOperations operations. @@ -108,43 +121,55 @@ def list( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateLinkResourceListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateLinkResourceListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateLinkResourceListResult', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "PrivateLinkResourceListResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources"} # type: ignore - + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_quotas_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_quotas_operations.py index 3747dee72af3..8282f3e41e1b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_quotas_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_quotas_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -103,6 +115,7 @@ def build_list_request( **kwargs ) + # fmt: on class QuotasOperations(object): """QuotasOperations operations. @@ -145,16 +158,22 @@ def update( :rtype: ~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotasResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'QuotaUpdateParameters') + _json = self._serialize.body(parameters, "QuotaUpdateParameters") request = build_update_request( location=location, @@ -162,32 +181,41 @@ def update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.update.metadata['url'], + template_url=self.update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('UpdateWorkspaceQuotasResult', pipeline_response) + deserialized = self._deserialize( + "UpdateWorkspaceQuotasResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas"} # type: ignore - + update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas"} # type: ignore @distributed_trace def list( @@ -206,27 +234,32 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListWorkspaceQuotas] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceQuotas"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListWorkspaceQuotas"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, @@ -239,7 +272,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ListWorkspaceQuotas", pipeline_response) + deserialized = self._deserialize( + "ListWorkspaceQuotas", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -248,22 +283,28 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_registries_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_registries_operations.py index 69c1e0d7eef7..1ac753d50654 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_registries_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_registries_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -294,6 +306,7 @@ def build_remove_regions_request_initial( **kwargs ) + # fmt: on class RegistriesOperations(object): """RegistriesOperations operations. @@ -319,8 +332,7 @@ def __init__(self, client, config, serializer, deserializer): @distributed_trace def list_by_subscription( - self, - **kwargs # type: Any + self, **kwargs # type: Any ): # type: (...) -> Iterable["_models.RegistryTrackedResourceArmPaginatedResult"] """List registries by subscription. @@ -334,26 +346,31 @@ def list_by_subscription( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.RegistryTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_subscription.metadata['url'], + template_url=self.list_by_subscription.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, @@ -365,7 +382,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("RegistryTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "RegistryTrackedResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -374,25 +393,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore + list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore @distributed_trace def list( @@ -414,27 +439,32 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.RegistryTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -447,7 +477,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("RegistryTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "RegistryTrackedResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -456,25 +488,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -483,48 +521,62 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -554,42 +606,53 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace def get( @@ -612,46 +675,54 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.Registry :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace def update( @@ -677,16 +748,22 @@ def update( :rtype: ~azure.mgmt.machinelearningservices.models.Registry :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialRegistryPartialTrackedResource') + _json = self._serialize.body( + body, "PartialRegistryPartialTrackedResource" + ) request = build_update_request( subscription_id=self._config.subscription_id, @@ -695,32 +772,39 @@ def update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.update.metadata['url'], + template_url=self.update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - + update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore def _create_or_update_initial( self, @@ -730,16 +814,20 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.Registry" - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'Registry') + _json = self._serialize.body(body, "Registry") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -748,35 +836,40 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -809,15 +902,20 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Registry] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -825,32 +923,40 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore def _remove_regions_initial( self, @@ -860,16 +966,22 @@ def _remove_regions_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.Registry"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Registry"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.Registry"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'Registry') + _json = self._serialize.body(body, "Registry") request = build_remove_regions_request_initial( subscription_id=self._config.subscription_id, @@ -878,40 +990,53 @@ def _remove_regions_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._remove_regions_initial.metadata['url'], + template_url=self._remove_regions_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _remove_regions_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions"} # type: ignore - + _remove_regions_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions"} # type: ignore @distributed_trace def begin_remove_regions( @@ -944,15 +1069,20 @@ def begin_remove_regions( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Registry] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._remove_regions_initial( resource_group_name=resource_group_name, @@ -960,29 +1090,37 @@ def begin_remove_regions( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_remove_regions.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions"} # type: ignore + begin_remove_regions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_registry_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_registry_code_containers_operations.py index 88e8f628b13f..7983ea5756fd 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_registry_code_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_registry_code_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -192,6 +204,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class RegistryCodeContainersOperations(object): """RegistryCodeContainersOperations operations. @@ -241,29 +254,34 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, api_version=api_version, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -278,7 +296,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -287,25 +307,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -315,49 +341,63 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, code_name=code_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -390,43 +430,54 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, code_name=code_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore @distributed_trace def get( @@ -452,47 +503,55 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, code_name=code_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize("CodeContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore def _create_or_update_initial( self, @@ -503,16 +562,20 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.CodeContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeContainer') + _json = self._serialize.body(body, "CodeContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -522,39 +585,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('CodeContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -591,15 +670,20 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.CodeContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -608,29 +692,39 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_registry_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_registry_code_versions_operations.py index 618dcd5f74f2..26d61639f79c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_registry_code_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_registry_code_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -250,6 +262,7 @@ def build_create_or_get_start_pending_upload_request( **kwargs ) + # fmt: on class RegistryCodeVersionsOperations(object): """RegistryCodeVersionsOperations operations. @@ -308,16 +321,21 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -327,13 +345,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -351,7 +369,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -360,25 +380,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -389,15 +415,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -405,34 +432,47 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements code_name=code_name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -468,14 +508,17 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -483,29 +526,37 @@ def begin_delete( # pylint: disable=inconsistent-return-statements code_name=code_name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -534,15 +585,16 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -550,32 +602,39 @@ def get( code_name=code_name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore def _create_or_update_initial( self, @@ -587,16 +646,20 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.CodeVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeVersion') + _json = self._serialize.body(body, "CodeVersion") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -607,39 +670,51 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('CodeVersion', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -679,15 +754,20 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.CodeVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -697,32 +777,40 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore @distributed_trace def create_or_get_start_pending_upload( @@ -754,16 +842,22 @@ def create_or_get_start_pending_upload( :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PendingUploadResponseDto"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PendingUploadRequestDto') + _json = self._serialize.body(body, "PendingUploadRequestDto") request = build_create_or_get_start_pending_upload_request( subscription_id=self._config.subscription_id, @@ -774,29 +868,40 @@ def create_or_get_start_pending_upload( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], + template_url=self.create_or_get_start_pending_upload.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) + deserialized = self._deserialize( + "PendingUploadResponseDto", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}/startPendingUpload"} # type: ignore - + create_or_get_start_pending_upload.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}/startPendingUpload"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_registry_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_registry_component_containers_operations.py index bea092868bff..f2fdc6d69788 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_registry_component_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_registry_component_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -192,6 +204,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class RegistryComponentContainersOperations(object): """RegistryComponentContainersOperations operations. @@ -241,29 +254,34 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, api_version=api_version, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -278,7 +296,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -287,25 +308,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -315,49 +342,63 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, component_name=component_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -390,43 +431,54 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, component_name=component_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore @distributed_trace def get( @@ -452,47 +504,59 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, component_name=component_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore def _create_or_update_initial( self, @@ -503,16 +567,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.ComponentContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentContainer') + _json = self._serialize.body(body, "ComponentContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -522,39 +592,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComponentContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -592,15 +678,22 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComponentContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -609,29 +702,39 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_registry_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_registry_component_versions_operations.py index 04e096bf808f..03db3424546a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_registry_component_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_registry_component_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -206,6 +218,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class RegistryComponentVersionsOperations(object): """RegistryComponentVersionsOperations operations. @@ -264,16 +277,21 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -283,13 +301,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -307,7 +325,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -316,25 +336,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -345,15 +371,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -361,34 +388,47 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements component_name=component_name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -424,14 +464,17 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -439,29 +482,37 @@ def begin_delete( # pylint: disable=inconsistent-return-statements component_name=component_name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -490,15 +541,18 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -506,32 +560,39 @@ def get( component_name=component_name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize("ComponentVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore def _create_or_update_initial( self, @@ -543,16 +604,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.ComponentVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentVersion') + _json = self._serialize.body(body, "ComponentVersion") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -563,39 +630,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComponentVersion', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -636,15 +719,22 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComponentVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -654,29 +744,39 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_registry_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_registry_data_containers_operations.py index a2cd71e10b67..62bfc104cd87 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_registry_data_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_registry_data_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -195,6 +207,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class RegistryDataContainersOperations(object): """RegistryDataContainersOperations operations. @@ -247,16 +260,21 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -264,13 +282,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -286,7 +304,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -295,25 +315,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -323,49 +349,63 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, name=name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -398,43 +438,54 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, name=name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore @distributed_trace def get( @@ -460,47 +511,55 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize("DataContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore def _create_or_update_initial( self, @@ -511,16 +570,20 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.DataContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DataContainer') + _json = self._serialize.body(body, "DataContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -530,39 +593,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('DataContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -599,15 +678,20 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.DataContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -616,29 +700,39 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_registry_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_registry_data_versions_operations.py index 2b84745ced8c..24b257b03154 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_registry_data_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_registry_data_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -256,6 +268,7 @@ def build_create_or_get_start_pending_upload_request( **kwargs ) + # fmt: on class RegistryDataVersionsOperations(object): """RegistryDataVersionsOperations operations. @@ -324,16 +337,21 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -345,13 +363,13 @@ def prepare_request(next_link=None): skip=skip, tags=tags, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -371,7 +389,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataVersionBaseResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -380,25 +400,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -409,15 +435,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -425,34 +452,47 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -488,14 +528,17 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -503,29 +546,37 @@ def begin_delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -554,15 +605,18 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -570,32 +624,39 @@ def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize("DataVersionBase", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore def _create_or_update_initial( self, @@ -607,16 +668,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.DataVersionBase" - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DataVersionBase') + _json = self._serialize.body(body, "DataVersionBase") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -627,39 +694,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('DataVersionBase', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -700,15 +783,22 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.DataVersionBase] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -718,32 +808,42 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace def create_or_get_start_pending_upload( @@ -775,16 +875,22 @@ def create_or_get_start_pending_upload( :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PendingUploadResponseDto"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PendingUploadRequestDto') + _json = self._serialize.body(body, "PendingUploadRequestDto") request = build_create_or_get_start_pending_upload_request( subscription_id=self._config.subscription_id, @@ -795,29 +901,40 @@ def create_or_get_start_pending_upload( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], + template_url=self.create_or_get_start_pending_upload.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) + deserialized = self._deserialize( + "PendingUploadResponseDto", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}/startPendingUpload"} # type: ignore - + create_or_get_start_pending_upload.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}/startPendingUpload"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_registry_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_registry_environment_containers_operations.py index 0a68c1abdb5f..891273dcf3a7 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_registry_environment_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_registry_environment_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -195,6 +207,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class RegistryEnvironmentContainersOperations(object): """RegistryEnvironmentContainersOperations operations. @@ -247,16 +260,21 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -264,13 +282,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -286,7 +304,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -295,25 +316,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -323,49 +350,63 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, environment_name=environment_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -398,43 +439,54 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, environment_name=environment_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore @distributed_trace def get( @@ -460,47 +512,59 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, environment_name=environment_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore def _create_or_update_initial( self, @@ -511,16 +575,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.EnvironmentContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentContainer') + _json = self._serialize.body(body, "EnvironmentContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -530,39 +600,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -600,15 +686,22 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -617,29 +710,39 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_registry_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_registry_environment_versions_operations.py index 032aa25865a3..f1aba64f10a8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_registry_environment_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_registry_environment_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -209,6 +221,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class RegistryEnvironmentVersionsOperations(object): """RegistryEnvironmentVersionsOperations operations. @@ -270,16 +283,21 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -290,13 +308,13 @@ def prepare_request(next_link=None): top=top, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -315,7 +333,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersionResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -324,25 +345,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -353,15 +380,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -369,34 +397,47 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements environment_name=environment_name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -432,14 +473,17 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -447,29 +491,37 @@ def begin_delete( # pylint: disable=inconsistent-return-statements environment_name=environment_name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -498,15 +550,18 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -514,32 +569,41 @@ def get( environment_name=environment_name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore def _create_or_update_initial( self, @@ -551,16 +615,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.EnvironmentVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentVersion') + _json = self._serialize.body(body, "EnvironmentVersion") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -571,39 +641,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -644,15 +730,22 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -662,29 +755,39 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_registry_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_registry_model_containers_operations.py index 5d11fbf38be0..a37830466595 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_registry_model_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_registry_model_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -195,6 +207,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class RegistryModelContainersOperations(object): """RegistryModelContainersOperations operations. @@ -247,16 +260,21 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -264,13 +282,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -286,7 +304,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -295,25 +315,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -323,49 +349,63 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, model_name=model_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -398,43 +438,54 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, model_name=model_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore @distributed_trace def get( @@ -460,47 +511,57 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, model_name=model_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize("ModelContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore def _create_or_update_initial( self, @@ -511,16 +572,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.ModelContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelContainer') + _json = self._serialize.body(body, "ModelContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -530,39 +597,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ModelContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -600,15 +683,22 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ModelContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -617,29 +707,39 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_registry_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_registry_model_versions_operations.py index cb57c7d6db9a..f7ce42fa3f20 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_registry_model_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_registry_model_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -265,6 +277,7 @@ def build_create_or_get_start_pending_upload_request( **kwargs ) + # fmt: on class RegistryModelVersionsOperations(object): """RegistryModelVersionsOperations operations. @@ -340,16 +353,21 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -364,13 +382,13 @@ def prepare_request(next_link=None): tags=tags, properties=properties, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -393,7 +411,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -402,25 +422,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -431,15 +457,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -447,34 +474,47 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements model_name=model_name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -510,14 +550,17 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -525,29 +568,37 @@ def begin_delete( # pylint: disable=inconsistent-return-statements model_name=model_name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -576,15 +627,16 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -592,32 +644,39 @@ def get( model_name=model_name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore def _create_or_update_initial( self, @@ -629,16 +688,20 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.ModelVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelVersion') + _json = self._serialize.body(body, "ModelVersion") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -649,39 +712,51 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ModelVersion', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -721,15 +796,20 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ModelVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -739,32 +819,40 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore @distributed_trace def create_or_get_start_pending_upload( @@ -796,16 +884,22 @@ def create_or_get_start_pending_upload( :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PendingUploadResponseDto"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PendingUploadRequestDto') + _json = self._serialize.body(body, "PendingUploadRequestDto") request = build_create_or_get_start_pending_upload_request( subscription_id=self._config.subscription_id, @@ -816,29 +910,40 @@ def create_or_get_start_pending_upload( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], + template_url=self.create_or_get_start_pending_upload.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) + deserialized = self._deserialize( + "PendingUploadResponseDto", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/startPendingUpload"} # type: ignore - + create_or_get_start_pending_upload.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/startPendingUpload"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_schedules_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_schedules_operations.py index 0e3e4fc4c874..981ed806469a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_schedules_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_schedules_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -195,6 +207,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class SchedulesOperations(object): """SchedulesOperations operations. @@ -247,16 +260,21 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ScheduleResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduleResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ScheduleResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -264,13 +282,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -286,7 +304,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ScheduleResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ScheduleResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -295,25 +315,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -323,49 +349,63 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -398,43 +438,54 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @distributed_trace def get( @@ -460,47 +511,55 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.Schedule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Schedule"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Schedule', pipeline_response) + deserialized = self._deserialize("Schedule", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore def _create_or_update_initial( self, @@ -511,16 +570,20 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.Schedule" - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Schedule"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'Schedule') + _json = self._serialize.body(body, "Schedule") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -530,39 +593,51 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('Schedule', pipeline_response) + deserialized = self._deserialize("Schedule", pipeline_response) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('Schedule', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("Schedule", pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -598,15 +673,20 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Schedule] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Schedule"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -615,29 +695,37 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Schedule', pipeline_response) + deserialized = self._deserialize("Schedule", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_usages_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_usages_operations.py index f57551eea27a..07954127dd97 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_usages_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_usages_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -65,6 +77,7 @@ def build_list_request( **kwargs ) + # fmt: on class UsagesOperations(object): """UsagesOperations operations. @@ -106,27 +119,32 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListUsagesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListUsagesResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, @@ -139,7 +157,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ListUsagesResult", pipeline_response) + deserialized = self._deserialize( + "ListUsagesResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -148,22 +168,28 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_virtual_machine_sizes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_virtual_machine_sizes_operations.py index c016f6227902..743dc8b762d7 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_virtual_machine_sizes_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest @@ -23,8 +29,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -64,6 +76,7 @@ def build_list_request( **kwargs ) + # fmt: on class VirtualMachineSizesOperations(object): """VirtualMachineSizesOperations operations. @@ -103,42 +116,54 @@ def list( :rtype: ~azure.mgmt.machinelearningservices.models.VirtualMachineSizeListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_list_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualMachineSizeListResult', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "VirtualMachineSizeListResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes"} # type: ignore - + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_workspace_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_workspace_connections_operations.py index 716f648294bc..35b9b169b74c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_workspace_connections_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_workspace_connections_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -193,6 +205,7 @@ def build_list_request( **kwargs ) + # fmt: on class WorkspaceConnectionsOperations(object): """WorkspaceConnectionsOperations operations. @@ -242,16 +255,24 @@ def create( :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'WorkspaceConnectionPropertiesV2BasicResource') + _json = self._serialize.body( + parameters, "WorkspaceConnectionPropertiesV2BasicResource" + ) request = build_create_request( subscription_id=self._config.subscription_id, @@ -261,32 +282,41 @@ def create( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create.metadata['url'], + template_url=self.create.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - + create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace def get( @@ -310,47 +340,59 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, connection_name=connection_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -374,43 +416,51 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, connection_name=connection_name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace def list( @@ -439,16 +489,21 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -456,13 +511,13 @@ def prepare_request(next_link=None): api_version=api_version, target=target, category=category, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -478,7 +533,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -487,22 +545,28 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_workspace_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_workspace_features_operations.py index 1750369c93a6..30a30132b0a5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_workspace_features_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_workspace_features_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -67,6 +79,7 @@ def build_list_request( **kwargs ) + # fmt: on class WorkspaceFeaturesOperations(object): """WorkspaceFeaturesOperations operations. @@ -111,28 +124,33 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListAmlUserFeatureResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAmlUserFeatureResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListAmlUserFeatureResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -146,7 +164,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ListAmlUserFeatureResult", pipeline_response) + deserialized = self._deserialize( + "ListAmlUserFeatureResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -155,22 +175,28 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_workspaces_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_workspaces_operations.py index 4faea9452345..2864a35a50e8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_workspaces_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01/operations/_workspaces_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -559,6 +571,7 @@ def build_list_outbound_network_dependencies_endpoints_request( **kwargs ) + # fmt: on class WorkspacesOperations(object): """WorkspacesOperations operations. @@ -601,46 +614,54 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.Workspace :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore def _create_or_update_initial( self, @@ -650,16 +671,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.Workspace"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.Workspace"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'Workspace') + _json = self._serialize.body(parameters, "Workspace") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -668,33 +695,38 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -725,15 +757,20 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Workspace] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -741,32 +778,36 @@ def begin_create_or_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -775,41 +816,47 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -837,42 +884,49 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore def _update_initial( self, @@ -882,16 +936,22 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.Workspace"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.Workspace"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'WorkspaceUpdateParameters') + _json = self._serialize.body(parameters, "WorkspaceUpdateParameters") request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -900,33 +960,38 @@ def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace def begin_update( @@ -957,15 +1022,20 @@ def begin_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Workspace] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -973,32 +1043,36 @@ def begin_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace def list_by_resource_group( @@ -1020,28 +1094,33 @@ def list_by_resource_group( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_by_resource_group_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, api_version=api_version, skip=skip, - template_url=self.list_by_resource_group.metadata['url'], + template_url=self.list_by_resource_group.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_by_resource_group_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -1055,7 +1134,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1064,25 +1145,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore + list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore def _diagnose_initial( self, @@ -1092,17 +1179,25 @@ def _diagnose_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.DiagnoseResponseResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if parameters is not None: - _json = self._serialize.body(parameters, 'DiagnoseWorkspaceParameters') + _json = self._serialize.body( + parameters, "DiagnoseWorkspaceParameters" + ) else: _json = None @@ -1113,39 +1208,49 @@ def _diagnose_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._diagnose_initial.metadata['url'], + template_url=self._diagnose_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) + deserialized = self._deserialize( + "DiagnoseResponseResult", pipeline_response + ) if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _diagnose_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore - + _diagnose_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore @distributed_trace def begin_diagnose( @@ -1180,15 +1285,22 @@ def begin_diagnose( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.DiagnoseResponseResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnoseResponseResult"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DiagnoseResponseResult"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._diagnose_initial( resource_group_name=resource_group_name, @@ -1196,32 +1308,42 @@ def begin_diagnose( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) + deserialized = self._deserialize( + "DiagnoseResponseResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_diagnose.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore + begin_diagnose.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore @distributed_trace def list_keys( @@ -1243,46 +1365,58 @@ def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListWorkspaceKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceKeysResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListWorkspaceKeysResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ListWorkspaceKeysResult', pipeline_response) + deserialized = self._deserialize( + "ListWorkspaceKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys"} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys"} # type: ignore def _resync_keys_initial( # pylint: disable=inconsistent-return-statements self, @@ -1291,41 +1425,47 @@ def _resync_keys_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_resync_keys_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self._resync_keys_initial.metadata['url'], + template_url=self._resync_keys_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _resync_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore - + _resync_keys_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore @distributed_trace def begin_resync_keys( # pylint: disable=inconsistent-return-statements @@ -1354,42 +1494,49 @@ def begin_resync_keys( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._resync_keys_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_resync_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore + begin_resync_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore @distributed_trace def list_by_subscription( @@ -1408,27 +1555,32 @@ def list_by_subscription( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, skip=skip, - template_url=self.list_by_subscription.metadata['url'], + template_url=self.list_by_subscription.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, @@ -1441,7 +1593,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1450,25 +1604,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore + list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore @distributed_trace def list_notebook_access_token( @@ -1489,46 +1649,58 @@ def list_notebook_access_token( :rtype: ~azure.mgmt.machinelearningservices.models.NotebookAccessTokenResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookAccessTokenResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.NotebookAccessTokenResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_list_notebook_access_token_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_notebook_access_token.metadata['url'], + template_url=self.list_notebook_access_token.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('NotebookAccessTokenResult', pipeline_response) + deserialized = self._deserialize( + "NotebookAccessTokenResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_notebook_access_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken"} # type: ignore - + list_notebook_access_token.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken"} # type: ignore def _prepare_notebook_initial( self, @@ -1537,47 +1709,57 @@ def _prepare_notebook_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.NotebookResourceInfo"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NotebookResourceInfo"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.NotebookResourceInfo"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_prepare_notebook_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self._prepare_notebook_initial.metadata['url'], + template_url=self._prepare_notebook_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) + deserialized = self._deserialize( + "NotebookResourceInfo", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _prepare_notebook_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore - + _prepare_notebook_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore @distributed_trace def begin_prepare_notebook( @@ -1607,45 +1789,60 @@ def begin_prepare_notebook( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.NotebookResourceInfo] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookResourceInfo"] + api_version = kwargs.pop("api_version", "2023-04-01") # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.NotebookResourceInfo"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._prepare_notebook_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) + deserialized = self._deserialize( + "NotebookResourceInfo", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_prepare_notebook.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore + begin_prepare_notebook.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore @distributed_trace def list_storage_account_keys( @@ -1666,46 +1863,58 @@ def list_storage_account_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListStorageAccountKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListStorageAccountKeysResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListStorageAccountKeysResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_list_storage_account_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_storage_account_keys.metadata['url'], + template_url=self.list_storage_account_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ListStorageAccountKeysResult', pipeline_response) + deserialized = self._deserialize( + "ListStorageAccountKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_storage_account_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys"} # type: ignore - + list_storage_account_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys"} # type: ignore @distributed_trace def list_notebook_keys( @@ -1726,46 +1935,58 @@ def list_notebook_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListNotebookKeysResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListNotebookKeysResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_list_notebook_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_notebook_keys.metadata['url'], + template_url=self.list_notebook_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ListNotebookKeysResult', pipeline_response) + deserialized = self._deserialize( + "ListNotebookKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_notebook_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys"} # type: ignore - + list_notebook_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys"} # type: ignore @distributed_trace def list_outbound_network_dependencies_endpoints( @@ -1790,43 +2011,57 @@ def list_outbound_network_dependencies_endpoints( :rtype: ~azure.mgmt.machinelearningservices.models.ExternalFQDNResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExternalFQDNResponse"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ExternalFQDNResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01") # type: str + api_version = kwargs.pop("api_version", "2023-04-01") # type: str - request = build_list_outbound_network_dependencies_endpoints_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], + template_url=self.list_outbound_network_dependencies_endpoints.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ExternalFQDNResponse', pipeline_response) + deserialized = self._deserialize( + "ExternalFQDNResponse", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_outbound_network_dependencies_endpoints.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints"} # type: ignore - + list_outbound_network_dependencies_endpoints.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/__init__.py index da46614477a9..71cf8fdc020d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/__init__.py @@ -10,9 +10,10 @@ from ._version import VERSION __version__ = VERSION -__all__ = ['AzureMachineLearningWorkspaces'] +__all__ = ["AzureMachineLearningWorkspaces"] # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk + patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/_azure_machine_learning_workspaces.py index 962ddf1bb8e1..51a1dd840f5d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/_azure_machine_learning_workspaces.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/_azure_machine_learning_workspaces.py @@ -15,7 +15,54 @@ from . import models from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import BatchDeploymentsOperations, BatchEndpointsOperations, CodeContainersOperations, CodeVersionsOperations, ComponentContainersOperations, ComponentVersionsOperations, ComputeOperations, DataContainersOperations, DataVersionsOperations, DatastoresOperations, EnvironmentContainersOperations, EnvironmentVersionsOperations, FeaturesOperations, FeaturesetContainersOperations, FeaturesetVersionsOperations, FeaturestoreEntityContainersOperations, FeaturestoreEntityVersionsOperations, JobsOperations, LabelingJobsOperations, ManagedNetworkProvisionsOperations, ManagedNetworkSettingsRuleOperations, ModelContainersOperations, ModelVersionsOperations, OnlineDeploymentsOperations, OnlineEndpointsOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, QuotasOperations, RegistriesOperations, RegistryCodeContainersOperations, RegistryCodeVersionsOperations, RegistryComponentContainersOperations, RegistryComponentVersionsOperations, RegistryDataContainersOperations, RegistryDataVersionsOperations, RegistryEnvironmentContainersOperations, RegistryEnvironmentVersionsOperations, RegistryModelContainersOperations, RegistryModelVersionsOperations, SchedulesOperations, UsagesOperations, VirtualMachineSizesOperations, WorkspaceConnectionsOperations, WorkspaceFeaturesOperations, WorkspacesOperations +from .operations import ( + BatchDeploymentsOperations, + BatchEndpointsOperations, + CodeContainersOperations, + CodeVersionsOperations, + ComponentContainersOperations, + ComponentVersionsOperations, + ComputeOperations, + DataContainersOperations, + DataVersionsOperations, + DatastoresOperations, + EnvironmentContainersOperations, + EnvironmentVersionsOperations, + FeaturesOperations, + FeaturesetContainersOperations, + FeaturesetVersionsOperations, + FeaturestoreEntityContainersOperations, + FeaturestoreEntityVersionsOperations, + JobsOperations, + LabelingJobsOperations, + ManagedNetworkProvisionsOperations, + ManagedNetworkSettingsRuleOperations, + ModelContainersOperations, + ModelVersionsOperations, + OnlineDeploymentsOperations, + OnlineEndpointsOperations, + Operations, + PrivateEndpointConnectionsOperations, + PrivateLinkResourcesOperations, + QuotasOperations, + RegistriesOperations, + RegistryCodeContainersOperations, + RegistryCodeVersionsOperations, + RegistryComponentContainersOperations, + RegistryComponentVersionsOperations, + RegistryDataContainersOperations, + RegistryDataVersionsOperations, + RegistryEnvironmentContainersOperations, + RegistryEnvironmentVersionsOperations, + RegistryModelContainersOperations, + RegistryModelVersionsOperations, + SchedulesOperations, + UsagesOperations, + VirtualMachineSizesOperations, + WorkspaceConnectionsOperations, + WorkspaceFeaturesOperations, + WorkspacesOperations, +) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -24,7 +71,10 @@ from azure.core.credentials import TokenCredential from azure.core.rest import HttpRequest, HttpResponse -class AzureMachineLearningWorkspaces(object): # pylint: disable=too-many-instance-attributes + +class AzureMachineLearningWorkspaces( + object +): # pylint: disable=too-many-instance-attributes """These APIs allow end users to operate on Azure Machine Learning Workspace resources. :ivar operations: Operations operations @@ -172,60 +222,171 @@ def __init__( **kwargs # type: Any ): # type: (...) -> None - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._config = AzureMachineLearningWorkspacesConfiguration( + credential=credential, subscription_id=subscription_id, **kwargs + ) + self._client = ARMPipelineClient( + base_url=base_url, config=self._config, **kwargs + ) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = { + k: v for k, v in models.__dict__.items() if isinstance(v, type) + } self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.workspaces = WorkspacesOperations(self._client, self._config, self._serialize, self._deserialize) - self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) - self.virtual_machine_sizes = VirtualMachineSizesOperations(self._client, self._config, self._serialize, self._deserialize) - self.quotas = QuotasOperations(self._client, self._config, self._serialize, self._deserialize) - self.compute = ComputeOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_connections = WorkspaceConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.managed_network_settings_rule = ManagedNetworkSettingsRuleOperations(self._client, self._config, self._serialize, self._deserialize) - self.managed_network_provisions = ManagedNetworkProvisionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registries = RegistriesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_features = WorkspaceFeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_code_containers = RegistryCodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_code_versions = RegistryCodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_component_containers = RegistryComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_component_versions = RegistryComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_data_containers = RegistryDataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_data_versions = RegistryDataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_environment_containers = RegistryEnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_environment_versions = RegistryEnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_model_containers = RegistryModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_model_versions = RegistryModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_endpoints = BatchEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_deployments = BatchDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_containers = CodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_versions = CodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_containers = ComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_versions = ComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_containers = DataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_versions = DataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.datastores = DatastoresOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_containers = EnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_versions = EnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.featureset_containers = FeaturesetContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.features = FeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - self.featureset_versions = FeaturesetVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.featurestore_entity_containers = FeaturestoreEntityContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.featurestore_entity_versions = FeaturestoreEntityVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.labeling_jobs = LabelingJobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_containers = ModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_versions = ModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_endpoints = OnlineEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_deployments = OnlineDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.schedules = SchedulesOperations(self._client, self._config, self._serialize, self._deserialize) - + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspaces = WorkspacesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.usages = UsagesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.virtual_machine_sizes = VirtualMachineSizesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.quotas = QuotasOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.compute = ComputeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.private_endpoint_connections = ( + PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspace_connections = WorkspaceConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.managed_network_settings_rule = ( + ManagedNetworkSettingsRuleOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.managed_network_provisions = ManagedNetworkProvisionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registries = RegistriesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspace_features = WorkspaceFeaturesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_code_containers = RegistryCodeContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_code_versions = RegistryCodeVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_component_containers = ( + RegistryComponentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.registry_component_versions = RegistryComponentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_data_containers = RegistryDataContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_data_versions = RegistryDataVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_environment_containers = ( + RegistryEnvironmentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.registry_environment_versions = ( + RegistryEnvironmentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.registry_model_containers = RegistryModelContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_model_versions = RegistryModelVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.batch_endpoints = BatchEndpointsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.batch_deployments = BatchDeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.code_containers = CodeContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.code_versions = CodeVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.component_containers = ComponentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.component_versions = ComponentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_containers = DataContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_versions = DataVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.datastores = DatastoresOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.environment_containers = EnvironmentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.environment_versions = EnvironmentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.featureset_containers = FeaturesetContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.features = FeaturesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.featureset_versions = FeaturesetVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.featurestore_entity_containers = ( + FeaturestoreEntityContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.featurestore_entity_versions = ( + FeaturestoreEntityVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.jobs = JobsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.labeling_jobs = LabelingJobsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.model_containers = ModelContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.model_versions = ModelVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.online_endpoints = OnlineEndpointsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.online_deployments = OnlineDeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.schedules = SchedulesOperations( + self._client, self._config, self._serialize, self._deserialize + ) def _send_request( self, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/_configuration.py index a079a3deb43e..b434799ff3be 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/_configuration.py @@ -10,7 +10,10 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ( + ARMChallengeAuthenticationPolicy, + ARMHttpLoggingPolicy, +) from ._version import VERSION @@ -21,7 +24,9 @@ from azure.core.credentials import TokenCredential -class AzureMachineLearningWorkspacesConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AzureMachineLearningWorkspacesConfiguration( + Configuration +): # pylint: disable=too-many-instance-attributes """Configuration for AzureMachineLearningWorkspaces. Note that all parameters used to create this instance are saved as instance @@ -43,8 +48,12 @@ def __init__( **kwargs # type: Any ): # type: (...) -> None - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + super(AzureMachineLearningWorkspacesConfiguration, self).__init__( + **kwargs + ) + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -54,23 +63,44 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = api_version - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) + self.credential_scopes = kwargs.pop( + "credential_scopes", ["https://management.azure.com/.default"] + ) + kwargs.setdefault( + "sdk_moniker", "mgmt-machinelearningservices/{}".format(VERSION) + ) self._configure(**kwargs) def _configure( - self, - **kwargs # type: Any + self, **kwargs # type: Any ): # type: (...) -> None - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') + self.user_agent_policy = kwargs.get( + "user_agent_policy" + ) or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get( + "headers_policy" + ) or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy( + **kwargs + ) + self.logging_policy = kwargs.get( + "logging_policy" + ) or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get( + "http_logging_policy" + ) or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy( + **kwargs + ) + self.custom_hook_policy = kwargs.get( + "custom_hook_policy" + ) or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get( + "redirect_policy" + ) or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = ARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/_patch.py index 74e48ecd07cf..17dbc073e01b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/_patch.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/_patch.py @@ -25,7 +25,8 @@ # # -------------------------------------------------------------------------- + # This file is used for handwritten extensions to the generated code. Example: # https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md def patch_sdk(): - pass \ No newline at end of file + pass diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/_vendor.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/_vendor.py index 138f663c53a4..ed3373e9699d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/_vendor.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/_vendor.py @@ -7,13 +7,20 @@ from azure.core.pipeline.transport import HttpRequest + def _convert_request(request, files=None): data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + request = HttpRequest( + method=request.method, + url=request.url, + headers=request.headers, + data=data, + ) if files: request.set_formdata_body(files) return request + def _format_url_section(template, **kwargs): components = template.split("/") while components: @@ -22,6 +29,8 @@ def _format_url_section(template, **kwargs): except KeyError as key: formatted_components = template.split("/") components = [ - c for c in formatted_components if "{}".format(key.args[0]) not in c + c + for c in formatted_components + if "{}".format(key.args[0]) not in c ] template = "/".join(components) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/__init__.py index f67ccda966f1..b90ec7485f14 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/__init__.py @@ -7,9 +7,11 @@ # -------------------------------------------------------------------------- from ._azure_machine_learning_workspaces import AzureMachineLearningWorkspaces -__all__ = ['AzureMachineLearningWorkspaces'] + +__all__ = ["AzureMachineLearningWorkspaces"] # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk + patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/_azure_machine_learning_workspaces.py index 2ac25137133e..200f8c911906 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/_azure_machine_learning_workspaces.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/_azure_machine_learning_workspaces.py @@ -16,13 +16,61 @@ from .. import models from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import BatchDeploymentsOperations, BatchEndpointsOperations, CodeContainersOperations, CodeVersionsOperations, ComponentContainersOperations, ComponentVersionsOperations, ComputeOperations, DataContainersOperations, DataVersionsOperations, DatastoresOperations, EnvironmentContainersOperations, EnvironmentVersionsOperations, FeaturesOperations, FeaturesetContainersOperations, FeaturesetVersionsOperations, FeaturestoreEntityContainersOperations, FeaturestoreEntityVersionsOperations, JobsOperations, LabelingJobsOperations, ManagedNetworkProvisionsOperations, ManagedNetworkSettingsRuleOperations, ModelContainersOperations, ModelVersionsOperations, OnlineDeploymentsOperations, OnlineEndpointsOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, QuotasOperations, RegistriesOperations, RegistryCodeContainersOperations, RegistryCodeVersionsOperations, RegistryComponentContainersOperations, RegistryComponentVersionsOperations, RegistryDataContainersOperations, RegistryDataVersionsOperations, RegistryEnvironmentContainersOperations, RegistryEnvironmentVersionsOperations, RegistryModelContainersOperations, RegistryModelVersionsOperations, SchedulesOperations, UsagesOperations, VirtualMachineSizesOperations, WorkspaceConnectionsOperations, WorkspaceFeaturesOperations, WorkspacesOperations +from .operations import ( + BatchDeploymentsOperations, + BatchEndpointsOperations, + CodeContainersOperations, + CodeVersionsOperations, + ComponentContainersOperations, + ComponentVersionsOperations, + ComputeOperations, + DataContainersOperations, + DataVersionsOperations, + DatastoresOperations, + EnvironmentContainersOperations, + EnvironmentVersionsOperations, + FeaturesOperations, + FeaturesetContainersOperations, + FeaturesetVersionsOperations, + FeaturestoreEntityContainersOperations, + FeaturestoreEntityVersionsOperations, + JobsOperations, + LabelingJobsOperations, + ManagedNetworkProvisionsOperations, + ManagedNetworkSettingsRuleOperations, + ModelContainersOperations, + ModelVersionsOperations, + OnlineDeploymentsOperations, + OnlineEndpointsOperations, + Operations, + PrivateEndpointConnectionsOperations, + PrivateLinkResourcesOperations, + QuotasOperations, + RegistriesOperations, + RegistryCodeContainersOperations, + RegistryCodeVersionsOperations, + RegistryComponentContainersOperations, + RegistryComponentVersionsOperations, + RegistryDataContainersOperations, + RegistryDataVersionsOperations, + RegistryEnvironmentContainersOperations, + RegistryEnvironmentVersionsOperations, + RegistryModelContainersOperations, + RegistryModelVersionsOperations, + SchedulesOperations, + UsagesOperations, + VirtualMachineSizesOperations, + WorkspaceConnectionsOperations, + WorkspaceFeaturesOperations, + WorkspacesOperations, +) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class AzureMachineLearningWorkspaces: # pylint: disable=too-many-instance-attributes + +class AzureMachineLearningWorkspaces: # pylint: disable=too-many-instance-attributes """These APIs allow end users to operate on Azure Machine Learning Workspace resources. :ivar operations: Operations operations @@ -173,65 +221,174 @@ def __init__( base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._config = AzureMachineLearningWorkspacesConfiguration( + credential=credential, subscription_id=subscription_id, **kwargs + ) + self._client = AsyncARMPipelineClient( + base_url=base_url, config=self._config, **kwargs + ) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = { + k: v for k, v in models.__dict__.items() if isinstance(v, type) + } self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.workspaces = WorkspacesOperations(self._client, self._config, self._serialize, self._deserialize) - self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) - self.virtual_machine_sizes = VirtualMachineSizesOperations(self._client, self._config, self._serialize, self._deserialize) - self.quotas = QuotasOperations(self._client, self._config, self._serialize, self._deserialize) - self.compute = ComputeOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_connections = WorkspaceConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.managed_network_settings_rule = ManagedNetworkSettingsRuleOperations(self._client, self._config, self._serialize, self._deserialize) - self.managed_network_provisions = ManagedNetworkProvisionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registries = RegistriesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_features = WorkspaceFeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_code_containers = RegistryCodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_code_versions = RegistryCodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_component_containers = RegistryComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_component_versions = RegistryComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_data_containers = RegistryDataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_data_versions = RegistryDataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_environment_containers = RegistryEnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_environment_versions = RegistryEnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_model_containers = RegistryModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_model_versions = RegistryModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_endpoints = BatchEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_deployments = BatchDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_containers = CodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_versions = CodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_containers = ComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_versions = ComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_containers = DataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_versions = DataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.datastores = DatastoresOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_containers = EnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_versions = EnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.featureset_containers = FeaturesetContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.features = FeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - self.featureset_versions = FeaturesetVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.featurestore_entity_containers = FeaturestoreEntityContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.featurestore_entity_versions = FeaturestoreEntityVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.labeling_jobs = LabelingJobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_containers = ModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_versions = ModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_endpoints = OnlineEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_deployments = OnlineDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.schedules = SchedulesOperations(self._client, self._config, self._serialize, self._deserialize) - + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspaces = WorkspacesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.usages = UsagesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.virtual_machine_sizes = VirtualMachineSizesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.quotas = QuotasOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.compute = ComputeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.private_endpoint_connections = ( + PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspace_connections = WorkspaceConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.managed_network_settings_rule = ( + ManagedNetworkSettingsRuleOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.managed_network_provisions = ManagedNetworkProvisionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registries = RegistriesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspace_features = WorkspaceFeaturesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_code_containers = RegistryCodeContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_code_versions = RegistryCodeVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_component_containers = ( + RegistryComponentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.registry_component_versions = RegistryComponentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_data_containers = RegistryDataContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_data_versions = RegistryDataVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_environment_containers = ( + RegistryEnvironmentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.registry_environment_versions = ( + RegistryEnvironmentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.registry_model_containers = RegistryModelContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_model_versions = RegistryModelVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.batch_endpoints = BatchEndpointsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.batch_deployments = BatchDeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.code_containers = CodeContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.code_versions = CodeVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.component_containers = ComponentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.component_versions = ComponentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_containers = DataContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_versions = DataVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.datastores = DatastoresOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.environment_containers = EnvironmentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.environment_versions = EnvironmentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.featureset_containers = FeaturesetContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.features = FeaturesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.featureset_versions = FeaturesetVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.featurestore_entity_containers = ( + FeaturestoreEntityContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.featurestore_entity_versions = ( + FeaturestoreEntityVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.jobs = JobsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.labeling_jobs = LabelingJobsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.model_containers = ModelContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.model_versions = ModelVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.online_endpoints = OnlineEndpointsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.online_deployments = OnlineDeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.schedules = SchedulesOperations( + self._client, self._config, self._serialize, self._deserialize + ) def _send_request( - self, - request: HttpRequest, - **kwargs: Any + self, request: HttpRequest, **kwargs: Any ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/_configuration.py index ee4be37e13e3..5c4c59fee0e8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/_configuration.py @@ -10,7 +10,10 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy +from azure.mgmt.core.policies import ( + ARMHttpLoggingPolicy, + AsyncARMChallengeAuthenticationPolicy, +) from .._version import VERSION @@ -19,7 +22,9 @@ from azure.core.credentials_async import AsyncTokenCredential -class AzureMachineLearningWorkspacesConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AzureMachineLearningWorkspacesConfiguration( + Configuration +): # pylint: disable=too-many-instance-attributes """Configuration for AzureMachineLearningWorkspaces. Note that all parameters used to create this instance are saved as instance @@ -40,8 +45,12 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + super(AzureMachineLearningWorkspacesConfiguration, self).__init__( + **kwargs + ) + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -51,22 +60,41 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = api_version - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) + self.credential_scopes = kwargs.pop( + "credential_scopes", ["https://management.azure.com/.default"] + ) + kwargs.setdefault( + "sdk_moniker", "mgmt-machinelearningservices/{}".format(VERSION) + ) self._configure(**kwargs) - def _configure( - self, - **kwargs: Any - ) -> None: - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get( + "user_agent_policy" + ) or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get( + "headers_policy" + ) or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy( + **kwargs + ) + self.logging_policy = kwargs.get( + "logging_policy" + ) or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get( + "http_logging_policy" + ) or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get( + "retry_policy" + ) or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get( + "custom_hook_policy" + ) or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get( + "redirect_policy" + ) or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/_patch.py index 74e48ecd07cf..17dbc073e01b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/_patch.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/_patch.py @@ -25,7 +25,8 @@ # # -------------------------------------------------------------------------- + # This file is used for handwritten extensions to the generated code. Example: # https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md def patch_sdk(): - pass \ No newline at end of file + pass diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/__init__.py index da26b6af19e9..897f7b955e8d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/__init__.py @@ -12,23 +12,45 @@ from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations from ._quotas_operations import QuotasOperations from ._compute_operations import ComputeOperations -from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_endpoint_connections_operations import ( + PrivateEndpointConnectionsOperations, +) from ._private_link_resources_operations import PrivateLinkResourcesOperations from ._workspace_connections_operations import WorkspaceConnectionsOperations -from ._managed_network_settings_rule_operations import ManagedNetworkSettingsRuleOperations -from ._managed_network_provisions_operations import ManagedNetworkProvisionsOperations +from ._managed_network_settings_rule_operations import ( + ManagedNetworkSettingsRuleOperations, +) +from ._managed_network_provisions_operations import ( + ManagedNetworkProvisionsOperations, +) from ._registries_operations import RegistriesOperations from ._workspace_features_operations import WorkspaceFeaturesOperations -from ._registry_code_containers_operations import RegistryCodeContainersOperations +from ._registry_code_containers_operations import ( + RegistryCodeContainersOperations, +) from ._registry_code_versions_operations import RegistryCodeVersionsOperations -from ._registry_component_containers_operations import RegistryComponentContainersOperations -from ._registry_component_versions_operations import RegistryComponentVersionsOperations -from ._registry_data_containers_operations import RegistryDataContainersOperations +from ._registry_component_containers_operations import ( + RegistryComponentContainersOperations, +) +from ._registry_component_versions_operations import ( + RegistryComponentVersionsOperations, +) +from ._registry_data_containers_operations import ( + RegistryDataContainersOperations, +) from ._registry_data_versions_operations import RegistryDataVersionsOperations -from ._registry_environment_containers_operations import RegistryEnvironmentContainersOperations -from ._registry_environment_versions_operations import RegistryEnvironmentVersionsOperations -from ._registry_model_containers_operations import RegistryModelContainersOperations -from ._registry_model_versions_operations import RegistryModelVersionsOperations +from ._registry_environment_containers_operations import ( + RegistryEnvironmentContainersOperations, +) +from ._registry_environment_versions_operations import ( + RegistryEnvironmentVersionsOperations, +) +from ._registry_model_containers_operations import ( + RegistryModelContainersOperations, +) +from ._registry_model_versions_operations import ( + RegistryModelVersionsOperations, +) from ._batch_endpoints_operations import BatchEndpointsOperations from ._batch_deployments_operations import BatchDeploymentsOperations from ._code_containers_operations import CodeContainersOperations @@ -43,8 +65,12 @@ from ._featureset_containers_operations import FeaturesetContainersOperations from ._features_operations import FeaturesOperations from ._featureset_versions_operations import FeaturesetVersionsOperations -from ._featurestore_entity_containers_operations import FeaturestoreEntityContainersOperations -from ._featurestore_entity_versions_operations import FeaturestoreEntityVersionsOperations +from ._featurestore_entity_containers_operations import ( + FeaturestoreEntityContainersOperations, +) +from ._featurestore_entity_versions_operations import ( + FeaturestoreEntityVersionsOperations, +) from ._jobs_operations import JobsOperations from ._labeling_jobs_operations import LabelingJobsOperations from ._model_containers_operations import ModelContainersOperations @@ -54,50 +80,50 @@ from ._schedules_operations import SchedulesOperations __all__ = [ - 'Operations', - 'WorkspacesOperations', - 'UsagesOperations', - 'VirtualMachineSizesOperations', - 'QuotasOperations', - 'ComputeOperations', - 'PrivateEndpointConnectionsOperations', - 'PrivateLinkResourcesOperations', - 'WorkspaceConnectionsOperations', - 'ManagedNetworkSettingsRuleOperations', - 'ManagedNetworkProvisionsOperations', - 'RegistriesOperations', - 'WorkspaceFeaturesOperations', - 'RegistryCodeContainersOperations', - 'RegistryCodeVersionsOperations', - 'RegistryComponentContainersOperations', - 'RegistryComponentVersionsOperations', - 'RegistryDataContainersOperations', - 'RegistryDataVersionsOperations', - 'RegistryEnvironmentContainersOperations', - 'RegistryEnvironmentVersionsOperations', - 'RegistryModelContainersOperations', - 'RegistryModelVersionsOperations', - 'BatchEndpointsOperations', - 'BatchDeploymentsOperations', - 'CodeContainersOperations', - 'CodeVersionsOperations', - 'ComponentContainersOperations', - 'ComponentVersionsOperations', - 'DataContainersOperations', - 'DataVersionsOperations', - 'DatastoresOperations', - 'EnvironmentContainersOperations', - 'EnvironmentVersionsOperations', - 'FeaturesetContainersOperations', - 'FeaturesOperations', - 'FeaturesetVersionsOperations', - 'FeaturestoreEntityContainersOperations', - 'FeaturestoreEntityVersionsOperations', - 'JobsOperations', - 'LabelingJobsOperations', - 'ModelContainersOperations', - 'ModelVersionsOperations', - 'OnlineEndpointsOperations', - 'OnlineDeploymentsOperations', - 'SchedulesOperations', + "Operations", + "WorkspacesOperations", + "UsagesOperations", + "VirtualMachineSizesOperations", + "QuotasOperations", + "ComputeOperations", + "PrivateEndpointConnectionsOperations", + "PrivateLinkResourcesOperations", + "WorkspaceConnectionsOperations", + "ManagedNetworkSettingsRuleOperations", + "ManagedNetworkProvisionsOperations", + "RegistriesOperations", + "WorkspaceFeaturesOperations", + "RegistryCodeContainersOperations", + "RegistryCodeVersionsOperations", + "RegistryComponentContainersOperations", + "RegistryComponentVersionsOperations", + "RegistryDataContainersOperations", + "RegistryDataVersionsOperations", + "RegistryEnvironmentContainersOperations", + "RegistryEnvironmentVersionsOperations", + "RegistryModelContainersOperations", + "RegistryModelVersionsOperations", + "BatchEndpointsOperations", + "BatchDeploymentsOperations", + "CodeContainersOperations", + "CodeVersionsOperations", + "ComponentContainersOperations", + "ComponentVersionsOperations", + "DataContainersOperations", + "DataVersionsOperations", + "DatastoresOperations", + "EnvironmentContainersOperations", + "EnvironmentVersionsOperations", + "FeaturesetContainersOperations", + "FeaturesOperations", + "FeaturesetVersionsOperations", + "FeaturestoreEntityContainersOperations", + "FeaturestoreEntityVersionsOperations", + "JobsOperations", + "LabelingJobsOperations", + "ModelContainersOperations", + "ModelVersionsOperations", + "OnlineEndpointsOperations", + "OnlineDeploymentsOperations", + "SchedulesOperations", ] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_batch_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_batch_deployments_operations.py index 12cdb7e2d1ba..b20c93955e15 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_batch_deployments_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_batch_deployments_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,22 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._batch_deployments_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._batch_deployments_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class BatchDeploymentsOperations: """BatchDeploymentsOperations async operations. @@ -57,7 +80,9 @@ def list( top: Optional[int] = None, skip: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.BatchDeploymentTrackedResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.BatchDeploymentTrackedResourceArmPaginatedResult" + ]: """Lists Batch inference deployments in the workspace. Lists Batch inference deployments in the workspace. @@ -81,16 +106,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.BatchDeploymentTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -100,13 +132,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -124,7 +156,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("BatchDeploymentTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "BatchDeploymentTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -134,24 +169,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -161,15 +200,18 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements deployment_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -177,34 +219,45 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -239,14 +292,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -254,29 +312,37 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def get( @@ -304,15 +370,20 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.BatchDeployment :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -320,32 +391,37 @@ async def get( endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize("BatchDeployment", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore async def _update_initial( self, @@ -356,16 +432,27 @@ async def _update_initial( body: "_models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties", **kwargs: Any ) -> Optional["_models.BatchDeployment"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchDeployment"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.BatchDeployment"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties') + error_map.update(kwargs.pop("error_map", {})) + + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + + _json = self._serialize.body( + body, + "PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties", + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -376,40 +463,53 @@ async def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -450,15 +550,24 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -468,32 +577,38 @@ async def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore async def _create_or_update_initial( self, @@ -504,16 +619,24 @@ async def _create_or_update_initial( body: "_models.BatchDeployment", **kwargs: Any ) -> "_models.BatchDeployment": - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'BatchDeployment') + _json = self._serialize.body(body, "BatchDeployment") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -524,39 +647,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchDeployment', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -596,15 +733,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -614,29 +760,39 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_batch_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_batch_endpoints_operations.py index d2bc553369e4..49711d086b06 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_batch_endpoints_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_batch_endpoints_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,23 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._batch_endpoints_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_keys_request, build_list_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._batch_endpoints_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_keys_request, + build_list_request, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class BatchEndpointsOperations: """BatchEndpointsOperations async operations. @@ -55,7 +79,9 @@ def list( count: Optional[int] = None, skip: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.BatchEndpointTrackedResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.BatchEndpointTrackedResourceArmPaginatedResult" + ]: """Lists Batch inference endpoint in the workspace. Lists Batch inference endpoint in the workspace. @@ -75,16 +101,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.BatchEndpointTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -92,13 +125,13 @@ def prepare_request(next_link=None): api_version=api_version, count=count, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -114,7 +147,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("BatchEndpointTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "BatchEndpointTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -124,24 +160,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -150,49 +190,63 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements endpoint_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -224,43 +278,56 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def get( @@ -285,47 +352,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.BatchEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize("BatchEndpoint", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore async def _update_initial( self, @@ -335,16 +410,26 @@ async def _update_initial( body: "_models.PartialMinimalTrackedResourceWithIdentity", **kwargs: Any ) -> Optional["_models.BatchEndpoint"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchEndpoint"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.BatchEndpoint"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') + _json = self._serialize.body( + body, "PartialMinimalTrackedResourceWithIdentity" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -354,40 +439,53 @@ async def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -425,15 +523,22 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -442,32 +547,38 @@ async def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore async def _create_or_update_initial( self, @@ -477,16 +588,22 @@ async def _create_or_update_initial( body: "_models.BatchEndpoint", **kwargs: Any ) -> "_models.BatchEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'BatchEndpoint') + _json = self._serialize.body(body, "BatchEndpoint") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -496,39 +613,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -565,15 +696,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -582,32 +720,42 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def list_keys( @@ -632,44 +780,54 @@ async def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthKeys"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) + deserialized = self._deserialize("EndpointAuthKeys", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys"} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_code_containers_operations.py index 7d3322d7dac0..6c16a291e0ed 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_code_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_code_containers_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._code_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._code_containers_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class CodeContainersOperations: """CodeContainersOperations async operations. @@ -70,29 +88,36 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -107,7 +132,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -117,24 +144,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -159,43 +190,51 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore @distributed_trace_async async def get( @@ -220,47 +259,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize("CodeContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -288,16 +335,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeContainer') + _json = self._serialize.body(body, "CodeContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -307,33 +360,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_code_versions_operations.py index f033248949c1..6d3d83b5103a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_code_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_code_versions_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,22 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._code_versions_operations import build_create_or_get_start_pending_upload_request, build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._code_versions_operations import ( + build_create_or_get_start_pending_upload_request, + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class CodeVersionsOperations: """CodeVersionsOperations async operations. @@ -86,16 +105,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -107,13 +133,13 @@ def prepare_request(next_link=None): skip=skip, hash=hash, hash_version=hash_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -133,7 +159,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -143,24 +171,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -188,15 +220,18 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -204,28 +239,33 @@ async def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -253,15 +293,18 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -269,32 +312,37 @@ async def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -325,16 +373,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeVersion') + _json = self._serialize.body(body, "CodeVersion") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -345,36 +399,41 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_get_start_pending_upload( @@ -405,16 +464,24 @@ async def create_or_get_start_pending_upload( :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PendingUploadResponseDto"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PendingUploadRequestDto') + _json = self._serialize.body(body, "PendingUploadRequestDto") request = build_create_or_get_start_pending_upload_request( subscription_id=self._config.subscription_id, @@ -425,29 +492,38 @@ async def create_or_get_start_pending_upload( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], + template_url=self.create_or_get_start_pending_upload.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) + deserialized = self._deserialize( + "PendingUploadResponseDto", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/startPendingUpload"} # type: ignore - + create_or_get_start_pending_upload.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/startPendingUpload"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_component_containers_operations.py index 8f5bb449a38b..5c4b4575017c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_component_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_component_containers_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._component_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._component_containers_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ComponentContainersOperations: """ComponentContainersOperations async operations. @@ -73,16 +91,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -90,13 +115,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -112,7 +137,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -122,24 +150,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -164,43 +196,51 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore @distributed_trace_async async def get( @@ -225,47 +265,59 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -293,16 +345,24 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentContainer') + _json = self._serialize.body(body, "ComponentContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -312,33 +372,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_component_versions_operations.py index b1e49bfdca00..d9d96f4bcd6f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_component_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_component_versions_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._component_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._component_versions_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ComponentVersionsOperations: """ComponentVersionsOperations async operations. @@ -85,16 +103,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -106,13 +131,13 @@ def prepare_request(next_link=None): skip=skip, stage=stage, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -132,7 +157,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -142,24 +169,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -187,15 +218,18 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -203,28 +237,33 @@ async def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -252,15 +291,20 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -268,32 +312,37 @@ async def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize("ComponentVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -324,16 +373,24 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentVersion') + _json = self._serialize.body(body, "ComponentVersion") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -344,33 +401,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_compute_operations.py index e614e85228c6..661a1e432263 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_compute_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_compute_operations.py @@ -6,13 +6,32 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, List, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + List, + Optional, + TypeVar, + Union, +) from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +40,29 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._compute_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_keys_request, build_list_nodes_request, build_list_request, build_restart_request_initial, build_start_request_initial, build_stop_request_initial, build_update_custom_services_request, build_update_idle_shutdown_setting_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._compute_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_keys_request, + build_list_nodes_request, + build_list_request, + build_restart_request_initial, + build_start_request_initial, + build_stop_request_initial, + build_update_custom_services_request, + build_update_idle_shutdown_setting_request, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ComputeOperations: """ComputeOperations async operations. @@ -70,29 +109,36 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedComputeResourcesList] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedComputeResourcesList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedComputeResourcesList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -107,7 +153,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedComputeResourcesList", pipeline_response) + deserialized = self._deserialize( + "PaginatedComputeResourcesList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -117,24 +165,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes"} # type: ignore @distributed_trace_async async def get( @@ -158,47 +210,57 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComputeResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize("ComputeResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore async def _create_or_update_initial( self, @@ -208,16 +270,24 @@ async def _create_or_update_initial( parameters: "_models.ComputeResource", **kwargs: Any ) -> "_models.ComputeResource": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'ComputeResource') + _json = self._serialize.body(parameters, "ComputeResource") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -227,38 +297,47 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if response.status_code == 201: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComputeResource', pipeline_response) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -295,15 +374,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -312,32 +400,38 @@ async def begin_create_or_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore async def _update_initial( self, @@ -347,16 +441,24 @@ async def _update_initial( parameters: "_models.ClusterUpdateParameters", **kwargs: Any ) -> "_models.ComputeResource": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'ClusterUpdateParameters') + _json = self._serialize.body(parameters, "ClusterUpdateParameters") request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -366,31 +468,34 @@ async def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize("ComputeResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -426,15 +531,24 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -443,50 +557,61 @@ async def begin_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, compute_name: str, - underlying_resource_action: Union[str, "_models.UnderlyingResourceAction"], + underlying_resource_action: Union[ + str, "_models.UnderlyingResourceAction" + ], **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -494,33 +619,39 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements compute_name=compute_name, api_version=api_version, underlying_resource_action=underlying_resource_action, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -528,7 +659,9 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements resource_group_name: str, workspace_name: str, compute_name: str, - underlying_resource_action: Union[str, "_models.UnderlyingResourceAction"], + underlying_resource_action: Union[ + str, "_models.UnderlyingResourceAction" + ], **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes specified Machine Learning compute. @@ -555,14 +688,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -570,29 +708,33 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements compute_name=compute_name, underlying_resource_action=underlying_resource_action, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace_async async def update_custom_services( # pylint: disable=inconsistent-return-statements @@ -618,16 +760,22 @@ async def update_custom_services( # pylint: disable=inconsistent-return-stateme :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(custom_services, '[CustomService]') + _json = self._serialize.body(custom_services, "[CustomService]") request = build_update_custom_services_request( subscription_id=self._config.subscription_id, @@ -637,28 +785,33 @@ async def update_custom_services( # pylint: disable=inconsistent-return-stateme api_version=api_version, content_type=content_type, json=_json, - template_url=self.update_custom_services.metadata['url'], + template_url=self.update_custom_services.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - update_custom_services.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/customServices"} # type: ignore - + update_custom_services.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/customServices"} # type: ignore @distributed_trace def list_nodes( @@ -683,29 +836,36 @@ def list_nodes( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.AmlComputeNodesInformation] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlComputeNodesInformation"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.AmlComputeNodesInformation"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_nodes_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self.list_nodes.metadata['url'], + template_url=self.list_nodes.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_nodes_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -720,7 +880,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("AmlComputeNodesInformation", pipeline_response) + deserialized = self._deserialize( + "AmlComputeNodesInformation", pipeline_response + ) list_of_elem = deserialized.nodes if cls: list_of_elem = cls(list_of_elem) @@ -730,24 +892,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_nodes.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes"} # type: ignore + list_nodes.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes"} # type: ignore @distributed_trace_async async def list_keys( @@ -770,47 +936,57 @@ async def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ComputeSecrets :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeSecrets"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeSecrets"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComputeSecrets', pipeline_response) + deserialized = self._deserialize("ComputeSecrets", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys"} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys"} # type: ignore async def _start_initial( # pylint: disable=inconsistent-return-statements self, @@ -819,42 +995,48 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements compute_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_start_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self._start_initial.metadata['url'], + template_url=self._start_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _start_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore - + _start_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore @distributed_trace_async async def begin_start( # pylint: disable=inconsistent-return-statements @@ -884,43 +1066,52 @@ async def begin_start( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._start_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_start.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore + begin_start.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore async def _stop_initial( # pylint: disable=inconsistent-return-statements self, @@ -929,42 +1120,48 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements compute_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_stop_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self._stop_initial.metadata['url'], + template_url=self._stop_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _stop_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore - + _stop_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore @distributed_trace_async async def begin_stop( # pylint: disable=inconsistent-return-statements @@ -994,43 +1191,52 @@ async def begin_stop( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._stop_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_stop.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore + begin_stop.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore async def _restart_initial( # pylint: disable=inconsistent-return-statements self, @@ -1039,42 +1245,48 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements compute_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_restart_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self._restart_initial.metadata['url'], + template_url=self._restart_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _restart_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore - + _restart_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore @distributed_trace_async async def begin_restart( # pylint: disable=inconsistent-return-statements @@ -1104,43 +1316,52 @@ async def begin_restart( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._restart_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_restart.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore + begin_restart.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore @distributed_trace_async async def update_idle_shutdown_setting( # pylint: disable=inconsistent-return-statements @@ -1166,16 +1387,22 @@ async def update_idle_shutdown_setting( # pylint: disable=inconsistent-return-s :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'IdleShutdownSetting') + _json = self._serialize.body(parameters, "IdleShutdownSetting") request = build_update_idle_shutdown_setting_request( subscription_id=self._config.subscription_id, @@ -1185,25 +1412,30 @@ async def update_idle_shutdown_setting( # pylint: disable=inconsistent-return-s api_version=api_version, content_type=content_type, json=_json, - template_url=self.update_idle_shutdown_setting.metadata['url'], + template_url=self.update_idle_shutdown_setting.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - update_idle_shutdown_setting.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateIdleShutdownSetting"} # type: ignore - + update_idle_shutdown_setting.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateIdleShutdownSetting"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_data_containers_operations.py index 59990c0ebc3d..452e41c1df32 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_data_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_data_containers_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._data_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._data_containers_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class DataContainersOperations: """DataContainersOperations async operations. @@ -73,16 +91,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -90,13 +115,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -112,7 +137,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -122,24 +149,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -164,43 +195,51 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore @distributed_trace_async async def get( @@ -225,47 +264,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize("DataContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -293,16 +340,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DataContainer') + _json = self._serialize.body(body, "DataContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -312,33 +365,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_data_versions_operations.py index f8f3819f2163..7241c53c3e0a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_data_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_data_versions_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._data_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._data_versions_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class DataVersionsOperations: """DataVersionsOperations async operations. @@ -92,16 +110,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -114,13 +139,13 @@ def prepare_request(next_link=None): tags=tags, stage=stage, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -141,7 +166,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataVersionBaseResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -151,24 +178,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -196,15 +227,18 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -212,28 +246,33 @@ async def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -261,15 +300,20 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -277,32 +321,37 @@ async def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize("DataVersionBase", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -333,16 +382,24 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DataVersionBase') + _json = self._serialize.body(body, "DataVersionBase") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -353,33 +410,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_datastores_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_datastores_operations.py index 9bbaea57a9bb..b98fcf279b19 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_datastores_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_datastores_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, List, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,22 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._datastores_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request, build_list_secrets_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._datastores_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, + build_list_secrets_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class DatastoresOperations: """DatastoresOperations async operations. @@ -88,16 +107,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DatastoreResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -110,13 +136,13 @@ def prepare_request(next_link=None): search_text=search_text, order_by=order_by, order_by_asc=order_by_asc, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -137,7 +163,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("DatastoreResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DatastoreResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -147,24 +175,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -189,43 +221,51 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace_async async def get( @@ -250,47 +290,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.Datastore :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Datastore"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Datastore"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Datastore', pipeline_response) + deserialized = self._deserialize("Datastore", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -321,16 +369,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.Datastore :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Datastore"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Datastore"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'Datastore') + _json = self._serialize.body(body, "Datastore") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -341,36 +395,41 @@ async def create_or_update( content_type=content_type, json=_json, skip_validation=skip_validation, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('Datastore', pipeline_response) + deserialized = self._deserialize("Datastore", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('Datastore', pipeline_response) + deserialized = self._deserialize("Datastore", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace_async async def list_secrets( @@ -395,44 +454,54 @@ async def list_secrets( :rtype: ~azure.mgmt.machinelearningservices.models.DatastoreSecrets :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreSecrets"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DatastoreSecrets"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_list_secrets_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.list_secrets.metadata['url'], + template_url=self.list_secrets.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DatastoreSecrets', pipeline_response) + deserialized = self._deserialize("DatastoreSecrets", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_secrets.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets"} # type: ignore - + list_secrets.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_environment_containers_operations.py index c244e3087b21..a383eb35829b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_environment_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_environment_containers_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._environment_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._environment_containers_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class EnvironmentContainersOperations: """EnvironmentContainersOperations async operations. @@ -53,7 +71,9 @@ def list( skip: Optional[str] = None, list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, **kwargs: Any - ) -> AsyncIterable["_models.EnvironmentContainerResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.EnvironmentContainerResourceArmPaginatedResult" + ]: """List environment containers. List environment containers. @@ -73,16 +93,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -90,13 +117,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -112,7 +139,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -122,24 +152,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -164,43 +198,51 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore @distributed_trace_async async def get( @@ -225,47 +267,59 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -293,16 +347,24 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentContainer') + _json = self._serialize.body(body, "EnvironmentContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -312,33 +374,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_environment_versions_operations.py index 40f5206cd973..1bd64c9bbd2e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_environment_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_environment_versions_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._environment_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._environment_versions_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class EnvironmentVersionsOperations: """EnvironmentVersionsOperations async operations. @@ -82,16 +100,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -102,13 +127,13 @@ def prepare_request(next_link=None): top=top, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -127,7 +152,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersionResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -137,24 +165,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -182,15 +214,18 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -198,28 +233,33 @@ async def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -247,15 +287,20 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -263,32 +308,39 @@ async def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -319,16 +371,24 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentVersion') + _json = self._serialize.body(body, "EnvironmentVersion") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -339,33 +399,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_features_operations.py index 9bd96985a399..c2cfade289aa 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_features_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_features_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,19 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._features_operations import build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._features_operations import ( + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class FeaturesOperations: """FeaturesOperations async operations. @@ -86,16 +102,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeatureResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeatureResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeatureResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -107,13 +130,13 @@ def prepare_request(next_link=None): tags=tags, feature_name=feature_name, description=description, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -133,7 +156,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("FeatureResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "FeatureResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -143,24 +168,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features"} # type: ignore @distributed_trace_async async def get( @@ -191,15 +220,18 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.Feature :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Feature"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Feature"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -208,29 +240,34 @@ async def get( featureset_version=featureset_version, feature_name=feature_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Feature', pipeline_response) + deserialized = self._deserialize("Feature", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features/{featureName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features/{featureName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_featureset_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_featureset_containers_operations.py index b5853edefbce..e9116aee1d77 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_featureset_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_featureset_containers_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._featureset_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_entity_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._featureset_containers_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_entity_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class FeaturesetContainersOperations: """FeaturesetContainersOperations async operations. @@ -60,7 +82,9 @@ def list( description: Optional[str] = None, created_by: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.FeaturesetContainerResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.FeaturesetContainerResourceArmPaginatedResult" + ]: """List featurestore entity containers. List featurestore entity containers. @@ -92,16 +116,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeaturesetContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -114,13 +145,13 @@ def prepare_request(next_link=None): name=name, description=description, created_by=created_by, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -141,7 +172,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturesetContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "FeaturesetContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -151,24 +185,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -177,49 +215,63 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -251,43 +303,56 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore @distributed_trace_async async def get_entity( @@ -312,47 +377,59 @@ async def get_entity( :rtype: ~azure.mgmt.machinelearningservices.models.FeaturesetContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_entity_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get_entity.metadata['url'], + template_url=self.get_entity.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) + deserialized = self._deserialize( + "FeaturesetContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_entity.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - + get_entity.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore async def _create_or_update_initial( self, @@ -362,16 +439,24 @@ async def _create_or_update_initial( body: "_models.FeaturesetContainer", **kwargs: Any ) -> "_models.FeaturesetContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'FeaturesetContainer') + _json = self._serialize.body(body, "FeaturesetContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -381,39 +466,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) + deserialized = self._deserialize( + "FeaturesetContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "FeaturesetContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -450,15 +549,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainer"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -467,29 +575,39 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) + deserialized = self._deserialize( + "FeaturesetContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_featureset_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_featureset_versions_operations.py index 6c4eaa695d98..5367f0d61550 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_featureset_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_featureset_versions_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,23 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._featureset_versions_operations import build_backfill_request_initial, build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_materialization_jobs_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._featureset_versions_operations import ( + build_backfill_request_initial, + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_materialization_jobs_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class FeaturesetVersionsOperations: """FeaturesetVersionsOperations async operations. @@ -101,16 +125,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeaturesetVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -126,13 +157,13 @@ def prepare_request(next_link=None): description=description, created_by=created_by, stage=stage, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -156,7 +187,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturesetVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "FeaturesetVersionResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -166,24 +200,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -193,15 +231,18 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements version: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -209,34 +250,45 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -271,14 +323,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -286,29 +343,37 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -336,15 +401,20 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.FeaturesetVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -352,32 +422,39 @@ async def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) + deserialized = self._deserialize( + "FeaturesetVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore async def _create_or_update_initial( self, @@ -388,16 +465,24 @@ async def _create_or_update_initial( body: "_models.FeaturesetVersion", **kwargs: Any ) -> "_models.FeaturesetVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'FeaturesetVersion') + _json = self._serialize.body(body, "FeaturesetVersion") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -408,39 +493,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) + deserialized = self._deserialize( + "FeaturesetVersion", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "FeaturesetVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -480,15 +579,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersion"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetVersion"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -498,32 +606,42 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) + deserialized = self._deserialize( + "FeaturesetVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore async def _backfill_initial( self, @@ -534,16 +652,24 @@ async def _backfill_initial( body: "_models.FeaturesetVersionBackfillRequest", **kwargs: Any ) -> Optional["_models.FeaturesetJob"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.FeaturesetJob"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.FeaturesetJob"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'FeaturesetVersionBackfillRequest') + _json = self._serialize.body(body, "FeaturesetVersionBackfillRequest") request = build_backfill_request_initial( subscription_id=self._config.subscription_id, @@ -554,39 +680,47 @@ async def _backfill_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._backfill_initial.metadata['url'], + template_url=self._backfill_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('FeaturesetJob', pipeline_response) + deserialized = self._deserialize( + "FeaturesetJob", pipeline_response + ) if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _backfill_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill"} # type: ignore - + _backfill_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill"} # type: ignore @distributed_trace_async async def begin_backfill( @@ -626,15 +760,22 @@ async def begin_backfill( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetJob] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetJob"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.FeaturesetJob"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._backfill_initial( resource_group_name=resource_group_name, @@ -644,32 +785,42 @@ async def begin_backfill( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('FeaturesetJob', pipeline_response) + deserialized = self._deserialize( + "FeaturesetJob", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_backfill.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill"} # type: ignore + begin_backfill.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill"} # type: ignore @distributed_trace def list_materialization_jobs( @@ -712,16 +863,23 @@ def list_materialization_jobs( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeaturesetJobArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetJobArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetJobArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_materialization_jobs_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -733,13 +891,15 @@ def prepare_request(next_link=None): filters=filters, feature_window_start=feature_window_start, feature_window_end=feature_window_end, - template_url=self.list_materialization_jobs.metadata['url'], + template_url=self.list_materialization_jobs.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_materialization_jobs_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -759,7 +919,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturesetJobArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "FeaturesetJobArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -769,21 +931,25 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_materialization_jobs.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/listMaterializationJobs"} # type: ignore + list_materialization_jobs.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/listMaterializationJobs"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_featurestore_entity_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_featurestore_entity_containers_operations.py index 21826e66f900..cf9b40b0282b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_featurestore_entity_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_featurestore_entity_containers_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._featurestore_entity_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_entity_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._featurestore_entity_containers_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_entity_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class FeaturestoreEntityContainersOperations: """FeaturestoreEntityContainersOperations async operations. @@ -60,7 +82,9 @@ def list( description: Optional[str] = None, created_by: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.FeaturestoreEntityContainerResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.FeaturestoreEntityContainerResourceArmPaginatedResult" + ]: """List featurestore entity containers. List featurestore entity containers. @@ -92,16 +116,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturestoreEntityContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -114,13 +145,13 @@ def prepare_request(next_link=None): name=name, description=description, created_by=created_by, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -141,7 +172,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturestoreEntityContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "FeaturestoreEntityContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -151,24 +185,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -177,49 +215,63 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -251,43 +303,56 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore @distributed_trace_async async def get_entity( @@ -312,47 +377,59 @@ async def get_entity( :rtype: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturestoreEntityContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_entity_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get_entity.metadata['url'], + template_url=self.get_entity.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) + deserialized = self._deserialize( + "FeaturestoreEntityContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_entity.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - + get_entity.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore async def _create_or_update_initial( self, @@ -362,16 +439,24 @@ async def _create_or_update_initial( body: "_models.FeaturestoreEntityContainer", **kwargs: Any ) -> "_models.FeaturestoreEntityContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturestoreEntityContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'FeaturestoreEntityContainer') + _json = self._serialize.body(body, "FeaturestoreEntityContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -381,39 +466,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) + deserialized = self._deserialize( + "FeaturestoreEntityContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "FeaturestoreEntityContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -450,15 +549,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainer"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturestoreEntityContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -467,29 +575,39 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) + deserialized = self._deserialize( + "FeaturestoreEntityContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_featurestore_entity_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_featurestore_entity_versions_operations.py index f5d397448969..cb794728f6e3 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_featurestore_entity_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_featurestore_entity_versions_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._featurestore_entity_versions_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._featurestore_entity_versions_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class FeaturestoreEntityVersionsOperations: """FeaturestoreEntityVersionsOperations async operations. @@ -63,7 +85,9 @@ def list( created_by: Optional[str] = None, stage: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.FeaturestoreEntityVersionResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.FeaturestoreEntityVersionResourceArmPaginatedResult" + ]: """List versions. List versions. @@ -101,16 +125,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturestoreEntityVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -126,13 +157,13 @@ def prepare_request(next_link=None): description=description, created_by=created_by, stage=stage, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -156,7 +187,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturestoreEntityVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "FeaturestoreEntityVersionResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -166,24 +200,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -193,15 +231,18 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements version: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -209,34 +250,45 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -271,14 +323,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -286,29 +343,37 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -336,15 +401,20 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturestoreEntityVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -352,32 +422,39 @@ async def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) + deserialized = self._deserialize( + "FeaturestoreEntityVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore async def _create_or_update_initial( self, @@ -388,16 +465,24 @@ async def _create_or_update_initial( body: "_models.FeaturestoreEntityVersion", **kwargs: Any ) -> "_models.FeaturestoreEntityVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturestoreEntityVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'FeaturestoreEntityVersion') + _json = self._serialize.body(body, "FeaturestoreEntityVersion") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -408,39 +493,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) + deserialized = self._deserialize( + "FeaturestoreEntityVersion", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "FeaturestoreEntityVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -480,15 +579,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersion"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturestoreEntityVersion"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -498,29 +606,39 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) + deserialized = self._deserialize( + "FeaturestoreEntityVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_jobs_operations.py index 0d202f357c9e..cbb6a59e4344 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_jobs_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_jobs_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,23 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._jobs_operations import build_cancel_request_initial, build_create_or_update_request, build_delete_request_initial, build_get_request, build_list_request, build_update_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._jobs_operations import ( + build_cancel_request_initial, + build_create_or_update_request, + build_delete_request_initial, + build_get_request, + build_list_request, + build_update_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class JobsOperations: """JobsOperations async operations. @@ -90,16 +114,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.JobBaseResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -112,13 +143,13 @@ def prepare_request(next_link=None): asset_name=asset_name, scheduled=scheduled, schedule_id=schedule_id, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -139,7 +170,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("JobBaseResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "JobBaseResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -149,24 +182,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -175,49 +212,63 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements id: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -249,43 +300,56 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace_async async def get( @@ -310,47 +374,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.JobBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.JobBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('JobBase', pipeline_response) + deserialized = self._deserialize("JobBase", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace_async async def update( @@ -378,16 +450,22 @@ async def update( :rtype: ~azure.mgmt.machinelearningservices.models.JobBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.JobBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialJobBasePartialResource') + _json = self._serialize.body(body, "PartialJobBasePartialResource") request = build_update_request( subscription_id=self._config.subscription_id, @@ -397,32 +475,37 @@ async def update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.update.metadata['url'], + template_url=self.update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('JobBase', pipeline_response) + deserialized = self._deserialize("JobBase", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - + update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -450,16 +533,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.JobBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.JobBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'JobBase') + _json = self._serialize.body(body, "JobBase") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -469,36 +558,41 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('JobBase', pipeline_response) + deserialized = self._deserialize("JobBase", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('JobBase', pipeline_response) + deserialized = self._deserialize("JobBase", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore async def _cancel_initial( # pylint: disable=inconsistent-return-statements self, @@ -507,48 +601,57 @@ async def _cancel_initial( # pylint: disable=inconsistent-return-statements id: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_cancel_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self._cancel_initial.metadata['url'], + template_url=self._cancel_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _cancel_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore - + _cancel_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore @distributed_trace_async async def begin_cancel( # pylint: disable=inconsistent-return-statements @@ -580,40 +683,53 @@ async def begin_cancel( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._cancel_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_cancel.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore + begin_cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_labeling_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_labeling_jobs_operations.py index c3edd50216be..49a79892bef1 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_labeling_jobs_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_labeling_jobs_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,24 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._labeling_jobs_operations import build_create_or_update_request_initial, build_delete_request, build_export_labels_request_initial, build_get_request, build_list_request, build_pause_request, build_resume_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._labeling_jobs_operations import ( + build_create_or_update_request_initial, + build_delete_request, + build_export_labels_request_initial, + build_get_request, + build_list_request, + build_pause_request, + build_resume_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class LabelingJobsOperations: """LabelingJobsOperations async operations. @@ -75,16 +100,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.LabelingJobResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJobResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.LabelingJobResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -92,13 +124,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, top=top, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -114,7 +146,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("LabelingJobResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "LabelingJobResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -124,24 +158,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -166,43 +204,51 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore @distributed_trace_async async def get( @@ -235,15 +281,18 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.LabelingJob :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.LabelingJob"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -252,32 +301,37 @@ async def get( api_version=api_version, include_job_instructions=include_job_instructions, include_label_categories=include_label_categories, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('LabelingJob', pipeline_response) + deserialized = self._deserialize("LabelingJob", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore async def _create_or_update_initial( self, @@ -287,16 +341,22 @@ async def _create_or_update_initial( body: "_models.LabelingJob", **kwargs: Any ) -> "_models.LabelingJob": - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.LabelingJob"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'LabelingJob') + _json = self._serialize.body(body, "LabelingJob") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -306,39 +366,49 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('LabelingJob', pipeline_response) + deserialized = self._deserialize("LabelingJob", pipeline_response) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('LabelingJob', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("LabelingJob", pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -375,15 +445,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.LabelingJob] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.LabelingJob"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -392,32 +469,40 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('LabelingJob', pipeline_response) + deserialized = self._deserialize("LabelingJob", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore async def _export_labels_initial( self, @@ -427,16 +512,24 @@ async def _export_labels_initial( body: "_models.ExportSummary", **kwargs: Any ) -> Optional["_models.ExportSummary"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExportSummary"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.ExportSummary"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ExportSummary') + _json = self._serialize.body(body, "ExportSummary") request = build_export_labels_request_initial( subscription_id=self._config.subscription_id, @@ -446,39 +539,47 @@ async def _export_labels_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._export_labels_initial.metadata['url'], + template_url=self._export_labels_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ExportSummary', pipeline_response) + deserialized = self._deserialize( + "ExportSummary", pipeline_response + ) if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _export_labels_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore - + _export_labels_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore @distributed_trace_async async def begin_export_labels( @@ -515,15 +616,22 @@ async def begin_export_labels( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ExportSummary] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExportSummary"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ExportSummary"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._export_labels_initial( resource_group_name=resource_group_name, @@ -532,32 +640,42 @@ async def begin_export_labels( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ExportSummary', pipeline_response) + deserialized = self._deserialize( + "ExportSummary", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_export_labels.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore + begin_export_labels.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore @distributed_trace_async async def pause( # pylint: disable=inconsistent-return-statements @@ -582,43 +700,51 @@ async def pause( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_pause_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self.pause.metadata['url'], + template_url=self.pause.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - pause.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause"} # type: ignore - + pause.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause"} # type: ignore async def _resume_initial( # pylint: disable=inconsistent-return-statements self, @@ -627,48 +753,57 @@ async def _resume_initial( # pylint: disable=inconsistent-return-statements id: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_resume_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self._resume_initial.metadata['url'], + template_url=self._resume_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _resume_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore - + _resume_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore @distributed_trace_async async def begin_resume( # pylint: disable=inconsistent-return-statements @@ -700,40 +835,53 @@ async def begin_resume( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._resume_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_resume.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore + begin_resume.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_managed_network_provisions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_managed_network_provisions_operations.py index f24fcceff300..5ec1cbc9218d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_managed_network_provisions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_managed_network_provisions_operations.py @@ -8,10 +8,20 @@ # -------------------------------------------------------------------------- from typing import Any, Callable, Dict, Optional, TypeVar, Union -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat @@ -19,9 +29,18 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._managed_network_provisions_operations import build_provision_managed_network_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._managed_network_provisions_operations import ( + build_provision_managed_network_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ManagedNetworkProvisionsOperations: """ManagedNetworkProvisionsOperations async operations. @@ -52,17 +71,27 @@ async def _provision_managed_network_initial( parameters: Optional["_models.ManagedNetworkProvisionOptions"] = None, **kwargs: Any ) -> Optional["_models.ManagedNetworkProvisionStatus"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ManagedNetworkProvisionStatus"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.ManagedNetworkProvisionStatus"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if parameters is not None: - _json = self._serialize.body(parameters, 'ManagedNetworkProvisionOptions') + _json = self._serialize.body( + parameters, "ManagedNetworkProvisionOptions" + ) else: _json = None @@ -73,38 +102,46 @@ async def _provision_managed_network_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._provision_managed_network_initial.metadata['url'], + template_url=self._provision_managed_network_initial.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ManagedNetworkProvisionStatus', pipeline_response) + deserialized = self._deserialize( + "ManagedNetworkProvisionStatus", pipeline_response + ) if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _provision_managed_network_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork"} # type: ignore - + _provision_managed_network_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork"} # type: ignore @distributed_trace_async async def begin_provision_managed_network( @@ -136,15 +173,24 @@ async def begin_provision_managed_network( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionStatus] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedNetworkProvisionStatus"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ManagedNetworkProvisionStatus"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._provision_managed_network_initial( resource_group_name=resource_group_name, @@ -152,29 +198,39 @@ async def begin_provision_managed_network( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ManagedNetworkProvisionStatus', pipeline_response) + deserialized = self._deserialize( + "ManagedNetworkProvisionStatus", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_provision_managed_network.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork"} # type: ignore + begin_provision_managed_network.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_managed_network_settings_rule_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_managed_network_settings_rule_operations.py index 7066bd7516aa..5199bafd05ee 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_managed_network_settings_rule_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_managed_network_settings_rule_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._managed_network_settings_rule_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._managed_network_settings_rule_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ManagedNetworkSettingsRuleOperations: """ManagedNetworkSettingsRuleOperations async operations. @@ -49,10 +71,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> AsyncIterable["_models.OutboundRuleListResult"]: """Lists the managed network outbound rules for a machine learning workspace. @@ -67,28 +86,35 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OutboundRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OutboundRuleListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -102,7 +128,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("OutboundRuleListResult", pipeline_response) + deserialized = self._deserialize( + "OutboundRuleListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -112,24 +140,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -138,47 +170,54 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements rule_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, rule_name=rule_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -208,43 +247,56 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, rule_name=rule_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore @distributed_trace_async async def get( @@ -267,47 +319,59 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleBasicResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OutboundRuleBasicResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, rule_name=rule_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) + deserialized = self._deserialize( + "OutboundRuleBasicResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore async def _create_or_update_initial( self, @@ -317,16 +381,24 @@ async def _create_or_update_initial( parameters: "_models.OutboundRuleBasicResource", **kwargs: Any ) -> Optional["_models.OutboundRuleBasicResource"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OutboundRuleBasicResource"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.OutboundRuleBasicResource"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'OutboundRuleBasicResource') + _json = self._serialize.body(parameters, "OutboundRuleBasicResource") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -336,38 +408,44 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) + deserialized = self._deserialize( + "OutboundRuleBasicResource", pipeline_response + ) if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -403,15 +481,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleBasicResource"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OutboundRuleBasicResource"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -420,29 +507,39 @@ async def begin_create_or_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) + deserialized = self._deserialize( + "OutboundRuleBasicResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_model_containers_operations.py index 193f428668b2..bd3ef3fcbcea 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_model_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_model_containers_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._model_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._model_containers_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ModelContainersOperations: """ModelContainersOperations async operations. @@ -76,16 +94,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -94,13 +119,13 @@ def prepare_request(next_link=None): skip=skip, count=count, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -117,7 +142,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -127,24 +154,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -169,43 +200,51 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore @distributed_trace_async async def get( @@ -230,47 +269,57 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize("ModelContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -298,16 +347,24 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelContainer') + _json = self._serialize.body(body, "ModelContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -317,33 +374,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_model_versions_operations.py index f877bd06931c..e3501d16beae 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_model_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_model_versions_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,22 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._model_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request, build_package_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._model_versions_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, + build_package_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ModelVersionsOperations: """ModelVersionsOperations async operations. @@ -107,16 +130,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -134,13 +164,13 @@ def prepare_request(next_link=None): feed=feed, stage=stage, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -166,7 +196,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -176,24 +208,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -221,15 +257,18 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -237,28 +276,33 @@ async def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -286,15 +330,18 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -302,32 +349,37 @@ async def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -358,16 +410,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelVersion') + _json = self._serialize.body(body, "ModelVersion") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -378,36 +436,41 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore async def _package_initial( self, @@ -418,16 +481,24 @@ async def _package_initial( body: "_models.PackageRequest", **kwargs: Any ) -> Optional["_models.PackageResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PackageResponse"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.PackageResponse"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PackageRequest') + _json = self._serialize.body(body, "PackageRequest") request = build_package_request_initial( subscription_id=self._config.subscription_id, @@ -438,39 +509,47 @@ async def _package_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._package_initial.metadata['url'], + template_url=self._package_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('PackageResponse', pipeline_response) + deserialized = self._deserialize( + "PackageResponse", pipeline_response + ) if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _package_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package"} # type: ignore - + _package_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package"} # type: ignore @distributed_trace_async async def begin_package( @@ -510,15 +589,24 @@ async def begin_package( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.PackageResponse] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.PackageResponse"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PackageResponse"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._package_initial( resource_group_name=resource_group_name, @@ -528,29 +616,39 @@ async def begin_package( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('PackageResponse', pipeline_response) + deserialized = self._deserialize( + "PackageResponse", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_package.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package"} # type: ignore + begin_package.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_online_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_online_deployments_operations.py index a6cd6641de74..41ad8c87c2bb 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_online_deployments_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_online_deployments_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,24 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._online_deployments_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_logs_request, build_get_request, build_list_request, build_list_skus_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._online_deployments_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_logs_request, + build_get_request, + build_list_request, + build_list_skus_request, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class OnlineDeploymentsOperations: """OnlineDeploymentsOperations async operations. @@ -57,7 +82,9 @@ def list( top: Optional[int] = None, skip: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.OnlineDeploymentTrackedResourceArmPaginatedResult" + ]: """List Inference Endpoint Deployments. List Inference Endpoint Deployments. @@ -81,16 +108,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OnlineDeploymentTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -100,13 +134,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -124,7 +158,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineDeploymentTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "OnlineDeploymentTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -134,24 +171,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -161,15 +202,18 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements deployment_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -177,34 +221,45 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -239,14 +294,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -254,29 +314,37 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def get( @@ -304,15 +372,20 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.OnlineDeployment :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -320,32 +393,37 @@ async def get( endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize("OnlineDeployment", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore async def _update_initial( self, @@ -356,16 +434,26 @@ async def _update_initial( body: "_models.PartialMinimalTrackedResourceWithSku", **kwargs: Any ) -> Optional["_models.OnlineDeployment"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineDeployment"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.OnlineDeployment"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSku') + _json = self._serialize.body( + body, "PartialMinimalTrackedResourceWithSku" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -376,40 +464,53 @@ async def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -449,15 +550,24 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -467,32 +577,38 @@ async def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore async def _create_or_update_initial( self, @@ -503,16 +619,24 @@ async def _create_or_update_initial( body: "_models.OnlineDeployment", **kwargs: Any ) -> "_models.OnlineDeployment": - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'OnlineDeployment') + _json = self._serialize.body(body, "OnlineDeployment") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -523,39 +647,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -595,15 +733,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -613,32 +760,42 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def get_logs( @@ -669,16 +826,24 @@ async def get_logs( :rtype: ~azure.mgmt.machinelearningservices.models.DeploymentLogs :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentLogs"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DeploymentLogs"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DeploymentLogsRequest') + _json = self._serialize.body(body, "DeploymentLogsRequest") request = build_get_logs_request( subscription_id=self._config.subscription_id, @@ -689,32 +854,37 @@ async def get_logs( api_version=api_version, content_type=content_type, json=_json, - template_url=self.get_logs.metadata['url'], + template_url=self.get_logs.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DeploymentLogs', pipeline_response) + deserialized = self._deserialize("DeploymentLogs", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_logs.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs"} # type: ignore - + get_logs.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs"} # type: ignore @distributed_trace def list_skus( @@ -750,16 +920,23 @@ def list_skus( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.SkuResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.SkuResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_skus_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -769,13 +946,13 @@ def prepare_request(next_link=None): api_version=api_version, count=count, skip=skip, - template_url=self.list_skus.metadata['url'], + template_url=self.list_skus.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_skus_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -793,7 +970,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("SkuResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "SkuResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -803,21 +982,25 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_skus.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus"} # type: ignore + list_skus.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_online_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_online_endpoints_operations.py index 4847cf6bce68..42f8912d6a6b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_online_endpoints_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_online_endpoints_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,25 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._online_endpoints_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_get_token_request, build_list_keys_request, build_list_request, build_regenerate_keys_request_initial, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._online_endpoints_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_get_token_request, + build_list_keys_request, + build_list_request, + build_regenerate_keys_request_initial, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class OnlineEndpointsOperations: """OnlineEndpointsOperations async operations. @@ -54,13 +80,17 @@ def list( workspace_name: str, name: Optional[str] = None, count: Optional[int] = None, - compute_type: Optional[Union[str, "_models.EndpointComputeType"]] = None, + compute_type: Optional[ + Union[str, "_models.EndpointComputeType"] + ] = None, skip: Optional[str] = None, tags: Optional[str] = None, properties: Optional[str] = None, order_by: Optional[Union[str, "_models.OrderString"]] = None, **kwargs: Any - ) -> AsyncIterable["_models.OnlineEndpointTrackedResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.OnlineEndpointTrackedResourceArmPaginatedResult" + ]: """List Online Endpoints. List Online Endpoints. @@ -93,16 +123,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OnlineEndpointTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -115,13 +152,13 @@ def prepare_request(next_link=None): tags=tags, properties=properties, order_by=order_by, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -142,7 +179,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineEndpointTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "OnlineEndpointTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -152,24 +192,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -178,49 +222,63 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements endpoint_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -252,43 +310,56 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def get( @@ -313,47 +384,57 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.OnlineEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize("OnlineEndpoint", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore async def _update_initial( self, @@ -363,16 +444,26 @@ async def _update_initial( body: "_models.PartialMinimalTrackedResourceWithIdentity", **kwargs: Any ) -> Optional["_models.OnlineEndpoint"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineEndpoint"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.OnlineEndpoint"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') + _json = self._serialize.body( + body, "PartialMinimalTrackedResourceWithIdentity" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -382,40 +473,53 @@ async def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -453,15 +557,24 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -470,32 +583,38 @@ async def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore async def _create_or_update_initial( self, @@ -505,16 +624,24 @@ async def _create_or_update_initial( body: "_models.OnlineEndpoint", **kwargs: Any ) -> "_models.OnlineEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'OnlineEndpoint') + _json = self._serialize.body(body, "OnlineEndpoint") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -524,39 +651,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -593,15 +734,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -610,32 +760,42 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def list_keys( @@ -660,47 +820,57 @@ async def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthKeys"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) + deserialized = self._deserialize("EndpointAuthKeys", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys"} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys"} # type: ignore async def _regenerate_keys_initial( # pylint: disable=inconsistent-return-statements self, @@ -710,16 +880,22 @@ async def _regenerate_keys_initial( # pylint: disable=inconsistent-return-state body: "_models.RegenerateEndpointKeysRequest", **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'RegenerateEndpointKeysRequest') + _json = self._serialize.body(body, "RegenerateEndpointKeysRequest") request = build_regenerate_keys_request_initial( subscription_id=self._config.subscription_id, @@ -729,33 +905,39 @@ async def _regenerate_keys_initial( # pylint: disable=inconsistent-return-state api_version=api_version, content_type=content_type, json=_json, - template_url=self._regenerate_keys_initial.metadata['url'], + template_url=self._regenerate_keys_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _regenerate_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore - + _regenerate_keys_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore @distributed_trace_async async def begin_regenerate_keys( # pylint: disable=inconsistent-return-statements @@ -790,15 +972,22 @@ async def begin_regenerate_keys( # pylint: disable=inconsistent-return-statemen :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._regenerate_keys_initial( resource_group_name=resource_group_name, @@ -807,29 +996,37 @@ async def begin_regenerate_keys( # pylint: disable=inconsistent-return-statemen body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_regenerate_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore + begin_regenerate_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore @distributed_trace_async async def get_token( @@ -854,44 +1051,56 @@ async def get_token( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthToken :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthToken"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthToken"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_token_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.get_token.metadata['url'], + template_url=self.get_token.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EndpointAuthToken', pipeline_response) + deserialized = self._deserialize( + "EndpointAuthToken", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token"} # type: ignore - + get_token.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_operations.py index b48461bf5c2f..2fed4f72cb7e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,8 +25,15 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class Operations: """Operations async operations. @@ -46,8 +59,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list( - self, - **kwargs: Any + self, **kwargs: Any ) -> AsyncIterable["_models.AmlOperationListResult"]: """Lists all of the available Azure Machine Learning Services REST API operations. @@ -58,25 +70,32 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.AmlOperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlOperationListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.AmlOperationListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( api_version=api_version, template_url=next_link, @@ -87,7 +106,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("AmlOperationListResult", pipeline_response) + deserialized = self._deserialize( + "AmlOperationListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -97,21 +118,25 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/providers/Microsoft.MachineLearningServices/operations"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.MachineLearningServices/operations"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_private_endpoint_connections_operations.py index 3730a0d1b924..1290950785af 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_private_endpoint_connections_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._private_endpoint_connections_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._private_endpoint_connections_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class PrivateEndpointConnectionsOperations: """PrivateEndpointConnectionsOperations async operations. @@ -47,10 +65,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> AsyncIterable["_models.PrivateEndpointConnectionListResult"]: """List all the private endpoint connections associated with the workspace. @@ -65,28 +80,35 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnectionListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( resource_group_name=resource_group_name, workspace_name=workspace_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( resource_group_name=resource_group_name, workspace_name=workspace_name, @@ -100,7 +122,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) + deserialized = self._deserialize( + "PrivateEndpointConnectionListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -110,24 +134,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections"} # type: ignore @distributed_trace_async async def get( @@ -151,47 +179,59 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, private_endpoint_connection_name=private_endpoint_connection_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + deserialized = self._deserialize( + "PrivateEndpointConnection", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -218,16 +258,24 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(properties, 'PrivateEndpointConnection') + _json = self._serialize.body(properties, "PrivateEndpointConnection") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -237,32 +285,39 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + deserialized = self._deserialize( + "PrivateEndpointConnection", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -286,40 +341,48 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, private_endpoint_connection_name=private_endpoint_connection_name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_private_link_resources_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_private_link_resources_operations.py index 52fe9efbc64a..2e4dd7fe85b1 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_private_link_resources_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_private_link_resources_operations.py @@ -8,7 +8,13 @@ # -------------------------------------------------------------------------- from typing import Any, Callable, Dict, Optional, TypeVar -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -18,8 +24,15 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class PrivateLinkResourcesOperations: """PrivateLinkResourcesOperations async operations. @@ -45,10 +58,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace_async async def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.PrivateLinkResourceListResult": """Gets the private link resources that need to be created for a workspace. @@ -61,43 +71,55 @@ async def list( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateLinkResourceListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateLinkResourceListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateLinkResourceListResult', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "PrivateLinkResourceListResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources"} # type: ignore - + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_quotas_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_quotas_operations.py index cb70f3fadf49..7a31de28a684 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_quotas_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_quotas_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,19 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._quotas_operations import build_list_request, build_update_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._quotas_operations import ( + build_list_request, + build_update_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class QuotasOperations: """QuotasOperations async operations. @@ -63,16 +79,24 @@ async def update( :rtype: ~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotasResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'QuotaUpdateParameters') + _json = self._serialize.body(parameters, "QuotaUpdateParameters") request = build_update_request( location=location, @@ -80,38 +104,43 @@ async def update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.update.metadata['url'], + template_url=self.update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('UpdateWorkspaceQuotasResult', pipeline_response) + deserialized = self._deserialize( + "UpdateWorkspaceQuotasResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas"} # type: ignore - + update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas"} # type: ignore @distributed_trace def list( - self, - location: str, - **kwargs: Any + self, location: str, **kwargs: Any ) -> AsyncIterable["_models.ListWorkspaceQuotas"]: """Gets the currently assigned Workspace Quotas based on VMFamily. @@ -123,27 +152,34 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListWorkspaceQuotas] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceQuotas"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListWorkspaceQuotas"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, @@ -156,7 +192,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ListWorkspaceQuotas", pipeline_response) + deserialized = self._deserialize( + "ListWorkspaceQuotas", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -166,21 +204,25 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registries_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registries_operations.py index c3a59cd6dadd..0826aa40c40b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registries_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registries_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,24 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registries_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_subscription_request, build_list_request, build_remove_regions_request_initial, build_update_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registries_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_by_subscription_request, + build_list_request, + build_remove_regions_request_initial, + build_update_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistriesOperations: """RegistriesOperations async operations. @@ -49,8 +74,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list_by_subscription( - self, - **kwargs: Any + self, **kwargs: Any ) -> AsyncIterable["_models.RegistryTrackedResourceArmPaginatedResult"]: """List registries by subscription. @@ -63,26 +87,33 @@ def list_by_subscription( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.RegistryTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_subscription.metadata['url'], + template_url=self.list_by_subscription.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, @@ -94,7 +125,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("RegistryTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "RegistryTrackedResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -104,30 +137,32 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore + list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore @distributed_trace def list( - self, - resource_group_name: str, - **kwargs: Any + self, resource_group_name: str, **kwargs: Any ) -> AsyncIterable["_models.RegistryTrackedResourceArmPaginatedResult"]: """List registries. @@ -142,27 +177,34 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.RegistryTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -175,7 +217,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("RegistryTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "RegistryTrackedResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -185,80 +229,92 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - **kwargs: Any + self, resource_group_name: str, registry_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - **kwargs: Any + self, resource_group_name: str, registry_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: """Delete registry. @@ -280,49 +336,59 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace_async async def get( - self, - resource_group_name: str, - registry_name: str, - **kwargs: Any + self, resource_group_name: str, registry_name: str, **kwargs: Any ) -> "_models.Registry": """Get registry. @@ -337,46 +403,54 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.Registry :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace_async async def update( @@ -401,16 +475,24 @@ async def update( :rtype: ~azure.mgmt.machinelearningservices.models.Registry :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialRegistryPartialTrackedResource') + _json = self._serialize.body( + body, "PartialRegistryPartialTrackedResource" + ) request = build_update_request( subscription_id=self._config.subscription_id, @@ -419,32 +501,37 @@ async def update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.update.metadata['url'], + template_url=self.update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - + update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore async def _create_or_update_initial( self, @@ -453,16 +540,22 @@ async def _create_or_update_initial( body: "_models.Registry", **kwargs: Any ) -> "_models.Registry": - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'Registry') + _json = self._serialize.body(body, "Registry") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -471,35 +564,38 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -532,15 +628,22 @@ async def begin_create_or_update( :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Registry] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -548,32 +651,40 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore async def _remove_regions_initial( self, @@ -582,16 +693,24 @@ async def _remove_regions_initial( body: "_models.Registry", **kwargs: Any ) -> Optional["_models.Registry"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Registry"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.Registry"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'Registry') + _json = self._serialize.body(body, "Registry") request = build_remove_regions_request_initial( subscription_id=self._config.subscription_id, @@ -600,40 +719,51 @@ async def _remove_regions_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._remove_regions_initial.metadata['url'], + template_url=self._remove_regions_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _remove_regions_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions"} # type: ignore - + _remove_regions_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions"} # type: ignore @distributed_trace_async async def begin_remove_regions( @@ -666,15 +796,22 @@ async def begin_remove_regions( :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Registry] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._remove_regions_initial( resource_group_name=resource_group_name, @@ -682,29 +819,37 @@ async def begin_remove_regions( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_remove_regions.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions"} # type: ignore + begin_remove_regions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_code_containers_operations.py index 199569921c04..c809d266ac71 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_code_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_code_containers_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_code_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_code_containers_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryCodeContainersOperations: """RegistryCodeContainersOperations async operations. @@ -72,29 +94,36 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, api_version=api_version, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -109,7 +138,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -119,24 +150,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -145,49 +180,63 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements code_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, code_name=code_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -219,43 +268,56 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, code_name=code_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore @distributed_trace_async async def get( @@ -280,47 +342,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, code_name=code_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize("CodeContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore async def _create_or_update_initial( self, @@ -330,16 +400,22 @@ async def _create_or_update_initial( body: "_models.CodeContainer", **kwargs: Any ) -> "_models.CodeContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeContainer') + _json = self._serialize.body(body, "CodeContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -349,39 +425,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('CodeContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -418,15 +508,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.CodeContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -435,29 +532,39 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_code_versions_operations.py index 3c09a56ae86c..e8ba99d2872f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_code_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_code_versions_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,22 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_code_versions_operations import build_create_or_get_start_pending_upload_request, build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_code_versions_operations import ( + build_create_or_get_start_pending_upload_request, + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryCodeVersionsOperations: """RegistryCodeVersionsOperations async operations. @@ -81,16 +104,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -100,13 +130,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -124,7 +154,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -134,24 +166,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -161,15 +197,18 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements version: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -177,34 +216,45 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements code_name=code_name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -239,14 +289,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -254,29 +309,37 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements code_name=code_name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -304,15 +367,18 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -320,32 +386,37 @@ async def get( code_name=code_name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore async def _create_or_update_initial( self, @@ -356,16 +427,22 @@ async def _create_or_update_initial( body: "_models.CodeVersion", **kwargs: Any ) -> "_models.CodeVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeVersion') + _json = self._serialize.body(body, "CodeVersion") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -376,39 +453,49 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('CodeVersion', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -448,15 +535,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.CodeVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -466,32 +560,40 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_get_start_pending_upload( @@ -522,16 +624,24 @@ async def create_or_get_start_pending_upload( :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PendingUploadResponseDto"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PendingUploadRequestDto') + _json = self._serialize.body(body, "PendingUploadRequestDto") request = build_create_or_get_start_pending_upload_request( subscription_id=self._config.subscription_id, @@ -542,29 +652,38 @@ async def create_or_get_start_pending_upload( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], + template_url=self.create_or_get_start_pending_upload.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) + deserialized = self._deserialize( + "PendingUploadResponseDto", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}/startPendingUpload"} # type: ignore - + create_or_get_start_pending_upload.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}/startPendingUpload"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_component_containers_operations.py index 5080cdec0083..dc613cb089b9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_component_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_component_containers_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_component_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_component_containers_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryComponentContainersOperations: """RegistryComponentContainersOperations async operations. @@ -72,29 +94,36 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, api_version=api_version, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -109,7 +138,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -119,24 +151,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -145,49 +181,63 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements component_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, component_name=component_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -219,43 +269,56 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, component_name=component_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore @distributed_trace_async async def get( @@ -280,47 +343,59 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, component_name=component_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore async def _create_or_update_initial( self, @@ -330,16 +405,24 @@ async def _create_or_update_initial( body: "_models.ComponentContainer", **kwargs: Any ) -> "_models.ComponentContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentContainer') + _json = self._serialize.body(body, "ComponentContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -349,39 +432,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComponentContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -418,15 +515,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComponentContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -435,29 +541,39 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_component_versions_operations.py index 56c7237ef6b3..8daa6c6bc35f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_component_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_component_versions_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_component_versions_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_component_versions_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryComponentVersionsOperations: """RegistryComponentVersionsOperations async operations. @@ -84,16 +106,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -104,13 +133,13 @@ def prepare_request(next_link=None): top=top, skip=skip, stage=stage, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -129,7 +158,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -139,24 +170,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -166,15 +201,18 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements version: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -182,34 +220,45 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements component_name=component_name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -244,14 +293,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -259,29 +313,37 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements component_name=component_name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -309,15 +371,20 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -325,32 +392,37 @@ async def get( component_name=component_name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize("ComponentVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore async def _create_or_update_initial( self, @@ -361,16 +433,24 @@ async def _create_or_update_initial( body: "_models.ComponentVersion", **kwargs: Any ) -> "_models.ComponentVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentVersion') + _json = self._serialize.body(body, "ComponentVersion") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -381,39 +461,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComponentVersion', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -453,15 +547,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComponentVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -471,29 +574,39 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_data_containers_operations.py index 20a5fcf023a4..2f08e1eac8c0 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_data_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_data_containers_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_data_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_data_containers_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryDataContainersOperations: """RegistryDataContainersOperations async operations. @@ -75,16 +97,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -92,13 +121,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -114,7 +143,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -124,24 +155,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -150,49 +185,63 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, name=name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -224,43 +273,56 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, name=name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore @distributed_trace_async async def get( @@ -285,47 +347,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize("DataContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore async def _create_or_update_initial( self, @@ -335,16 +405,22 @@ async def _create_or_update_initial( body: "_models.DataContainer", **kwargs: Any ) -> "_models.DataContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DataContainer') + _json = self._serialize.body(body, "DataContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -354,39 +430,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('DataContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -423,15 +513,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.DataContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -440,29 +537,39 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_data_versions_operations.py index 651b0eb178ad..c42cede72541 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_data_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_data_versions_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,22 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_data_versions_operations import build_create_or_get_start_pending_upload_request, build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_data_versions_operations import ( + build_create_or_get_start_pending_upload_request, + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryDataVersionsOperations: """RegistryDataVersionsOperations async operations. @@ -91,16 +114,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -112,13 +142,13 @@ def prepare_request(next_link=None): skip=skip, tags=tags, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -138,7 +168,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataVersionBaseResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -148,24 +180,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -175,15 +211,18 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements version: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -191,34 +230,45 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -253,14 +303,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -268,29 +323,37 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -318,15 +381,20 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -334,32 +402,37 @@ async def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize("DataVersionBase", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore async def _create_or_update_initial( self, @@ -370,16 +443,24 @@ async def _create_or_update_initial( body: "_models.DataVersionBase", **kwargs: Any ) -> "_models.DataVersionBase": - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DataVersionBase') + _json = self._serialize.body(body, "DataVersionBase") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -390,39 +471,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('DataVersionBase', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -462,15 +557,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.DataVersionBase] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -480,32 +584,42 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_get_start_pending_upload( @@ -536,16 +650,24 @@ async def create_or_get_start_pending_upload( :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PendingUploadResponseDto"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PendingUploadRequestDto') + _json = self._serialize.body(body, "PendingUploadRequestDto") request = build_create_or_get_start_pending_upload_request( subscription_id=self._config.subscription_id, @@ -556,29 +678,38 @@ async def create_or_get_start_pending_upload( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], + template_url=self.create_or_get_start_pending_upload.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) + deserialized = self._deserialize( + "PendingUploadResponseDto", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}/startPendingUpload"} # type: ignore - + create_or_get_start_pending_upload.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}/startPendingUpload"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_environment_containers_operations.py index 6ef88a9053c1..b93bfb401832 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_environment_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_environment_containers_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_environment_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_environment_containers_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryEnvironmentContainersOperations: """RegistryEnvironmentContainersOperations async operations. @@ -55,7 +77,9 @@ def list( skip: Optional[str] = None, list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, **kwargs: Any - ) -> AsyncIterable["_models.EnvironmentContainerResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.EnvironmentContainerResourceArmPaginatedResult" + ]: """List environment containers. List environment containers. @@ -75,16 +99,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -92,13 +123,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -114,7 +145,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -124,24 +158,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -150,49 +188,63 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements environment_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, environment_name=environment_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -224,43 +276,56 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, environment_name=environment_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore @distributed_trace_async async def get( @@ -285,47 +350,59 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, environment_name=environment_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore async def _create_or_update_initial( self, @@ -335,16 +412,24 @@ async def _create_or_update_initial( body: "_models.EnvironmentContainer", **kwargs: Any ) -> "_models.EnvironmentContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentContainer') + _json = self._serialize.body(body, "EnvironmentContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -354,39 +439,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -423,15 +522,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -440,29 +548,39 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_environment_versions_operations.py index 667cc5ae4d8d..b986a00ec75d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_environment_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_environment_versions_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_environment_versions_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_environment_versions_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryEnvironmentVersionsOperations: """RegistryEnvironmentVersionsOperations async operations. @@ -84,16 +106,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -104,13 +133,13 @@ def prepare_request(next_link=None): top=top, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -129,7 +158,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersionResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -139,24 +171,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -166,15 +202,18 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements version: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -182,34 +221,45 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements environment_name=environment_name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -244,14 +294,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -259,29 +314,37 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements environment_name=environment_name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -309,15 +372,20 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -325,32 +393,39 @@ async def get( environment_name=environment_name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore async def _create_or_update_initial( self, @@ -361,16 +436,24 @@ async def _create_or_update_initial( body: "_models.EnvironmentVersion", **kwargs: Any ) -> "_models.EnvironmentVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentVersion') + _json = self._serialize.body(body, "EnvironmentVersion") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -381,39 +464,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -453,15 +550,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -471,29 +577,39 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_model_containers_operations.py index 8a066465ac90..94d438d1056e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_model_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_model_containers_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_model_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_model_containers_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryModelContainersOperations: """RegistryModelContainersOperations async operations. @@ -75,16 +97,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -92,13 +121,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -114,7 +143,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -124,24 +155,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -150,49 +185,63 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements model_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, model_name=model_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -224,43 +273,56 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, model_name=model_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore @distributed_trace_async async def get( @@ -285,47 +347,57 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, model_name=model_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize("ModelContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore async def _create_or_update_initial( self, @@ -335,16 +407,24 @@ async def _create_or_update_initial( body: "_models.ModelContainer", **kwargs: Any ) -> "_models.ModelContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelContainer') + _json = self._serialize.body(body, "ModelContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -354,39 +434,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ModelContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -423,15 +517,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ModelContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -440,29 +543,39 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_model_versions_operations.py index 00da8f659375..5bb06cf32ac9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_model_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_registry_model_versions_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,22 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_model_versions_operations import build_create_or_get_start_pending_upload_request, build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_model_versions_operations import ( + build_create_or_get_start_pending_upload_request, + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryModelVersionsOperations: """RegistryModelVersionsOperations async operations. @@ -98,16 +121,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -122,13 +152,13 @@ def prepare_request(next_link=None): tags=tags, properties=properties, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -151,7 +181,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -161,24 +193,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -188,15 +224,18 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements version: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -204,34 +243,45 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements model_name=model_name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -266,14 +316,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -281,29 +336,37 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements model_name=model_name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -331,15 +394,18 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -347,32 +413,37 @@ async def get( model_name=model_name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore async def _create_or_update_initial( self, @@ -383,16 +454,22 @@ async def _create_or_update_initial( body: "_models.ModelVersion", **kwargs: Any ) -> "_models.ModelVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelVersion') + _json = self._serialize.body(body, "ModelVersion") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -403,39 +480,49 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ModelVersion', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -475,15 +562,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ModelVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -493,32 +587,40 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_get_start_pending_upload( @@ -549,16 +651,24 @@ async def create_or_get_start_pending_upload( :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PendingUploadResponseDto"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PendingUploadRequestDto') + _json = self._serialize.body(body, "PendingUploadRequestDto") request = build_create_or_get_start_pending_upload_request( subscription_id=self._config.subscription_id, @@ -569,29 +679,38 @@ async def create_or_get_start_pending_upload( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], + template_url=self.create_or_get_start_pending_upload.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) + deserialized = self._deserialize( + "PendingUploadResponseDto", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/startPendingUpload"} # type: ignore - + create_or_get_start_pending_upload.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/startPendingUpload"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_schedules_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_schedules_operations.py index 5624f5ed5caa..522b327afe71 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_schedules_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_schedules_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._schedules_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._schedules_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class SchedulesOperations: """SchedulesOperations async operations. @@ -53,7 +75,9 @@ def list( resource_group_name: str, workspace_name: str, skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ScheduleListViewType"]] = None, + list_view_type: Optional[ + Union[str, "_models.ScheduleListViewType"] + ] = None, **kwargs: Any ) -> AsyncIterable["_models.ScheduleResourceArmPaginatedResult"]: """List schedules in specified workspace. @@ -75,16 +99,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ScheduleResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduleResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ScheduleResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -92,13 +123,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -114,7 +145,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ScheduleResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ScheduleResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -124,24 +157,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -150,49 +187,63 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -224,43 +275,56 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @distributed_trace_async async def get( @@ -285,47 +349,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.Schedule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Schedule"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Schedule', pipeline_response) + deserialized = self._deserialize("Schedule", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore async def _create_or_update_initial( self, @@ -335,16 +407,22 @@ async def _create_or_update_initial( body: "_models.Schedule", **kwargs: Any ) -> "_models.Schedule": - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Schedule"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'Schedule') + _json = self._serialize.body(body, "Schedule") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -354,39 +432,49 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('Schedule', pipeline_response) + deserialized = self._deserialize("Schedule", pipeline_response) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('Schedule', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("Schedule", pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -422,15 +510,22 @@ async def begin_create_or_update( :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Schedule] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Schedule"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -439,29 +534,37 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Schedule', pipeline_response) + deserialized = self._deserialize("Schedule", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_usages_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_usages_operations.py index 943840cc5c12..f54d55cf1412 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_usages_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_usages_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,8 +25,15 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._usages_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class UsagesOperations: """UsagesOperations async operations. @@ -46,9 +59,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list( - self, - location: str, - **kwargs: Any + self, location: str, **kwargs: Any ) -> AsyncIterable["_models.ListUsagesResult"]: """Gets the current usage information as well as limits for AML resources for given subscription and location. @@ -61,27 +72,34 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListUsagesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListUsagesResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, @@ -94,7 +112,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ListUsagesResult", pipeline_response) + deserialized = self._deserialize( + "ListUsagesResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -104,21 +124,25 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_virtual_machine_sizes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_virtual_machine_sizes_operations.py index bbc43fbebca5..84c558ce9ec5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_virtual_machine_sizes_operations.py @@ -8,7 +8,13 @@ # -------------------------------------------------------------------------- from typing import Any, Callable, Dict, Optional, TypeVar -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -18,8 +24,15 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._virtual_machine_sizes_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class VirtualMachineSizesOperations: """VirtualMachineSizesOperations async operations. @@ -45,9 +58,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace_async async def list( - self, - location: str, - **kwargs: Any + self, location: str, **kwargs: Any ) -> "_models.VirtualMachineSizeListResult": """Returns supported VM Sizes in a location. @@ -58,42 +69,54 @@ async def list( :rtype: ~azure.mgmt.machinelearningservices.models.VirtualMachineSizeListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_list_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualMachineSizeListResult', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "VirtualMachineSizeListResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes"} # type: ignore - + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_workspace_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_workspace_connections_operations.py index 851e40ff8fb1..61c5c48c2819 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_workspace_connections_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_workspace_connections_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._workspace_connections_operations import build_create_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._workspace_connections_operations import ( + build_create_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class WorkspaceConnectionsOperations: """WorkspaceConnectionsOperations async operations. @@ -70,16 +88,26 @@ async def create( :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'WorkspaceConnectionPropertiesV2BasicResource') + _json = self._serialize.body( + parameters, "WorkspaceConnectionPropertiesV2BasicResource" + ) request = build_create_request( subscription_id=self._config.subscription_id, @@ -89,32 +117,39 @@ async def create( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create.metadata['url'], + template_url=self.create.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - + create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace_async async def get( @@ -137,47 +172,59 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, connection_name=connection_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -200,43 +247,51 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, connection_name=connection_name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace def list( @@ -246,7 +301,9 @@ def list( target: Optional[str] = None, category: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult" + ]: """list. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -264,16 +321,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -281,13 +345,13 @@ def prepare_request(next_link=None): api_version=api_version, target=target, category=category, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -303,7 +367,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -313,21 +380,25 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_workspace_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_workspace_features_operations.py index 91ec315c06f2..f11d3a65f07a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_workspace_features_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_workspace_features_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,8 +25,15 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._workspace_features_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class WorkspaceFeaturesOperations: """WorkspaceFeaturesOperations async operations. @@ -46,10 +59,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> AsyncIterable["_models.ListAmlUserFeatureResult"]: """Lists all enabled features for a workspace. @@ -64,28 +74,35 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListAmlUserFeatureResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAmlUserFeatureResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListAmlUserFeatureResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -99,7 +116,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ListAmlUserFeatureResult", pipeline_response) + deserialized = self._deserialize( + "ListAmlUserFeatureResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -109,21 +128,25 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_workspaces_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_workspaces_operations.py index 8bc2340f7af8..5a0d7fca71d7 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_workspaces_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/aio/operations/_workspaces_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,31 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._workspaces_operations import build_create_or_update_request_initial, build_delete_request_initial, build_diagnose_request_initial, build_get_request, build_list_by_resource_group_request, build_list_by_subscription_request, build_list_keys_request, build_list_notebook_access_token_request, build_list_notebook_keys_request, build_list_outbound_network_dependencies_endpoints_request, build_list_storage_account_keys_request, build_prepare_notebook_request_initial, build_resync_keys_request_initial, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._workspaces_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_diagnose_request_initial, + build_get_request, + build_list_by_resource_group_request, + build_list_by_subscription_request, + build_list_keys_request, + build_list_notebook_access_token_request, + build_list_notebook_keys_request, + build_list_outbound_network_dependencies_endpoints_request, + build_list_storage_account_keys_request, + build_prepare_notebook_request_initial, + build_resync_keys_request_initial, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class WorkspacesOperations: """WorkspacesOperations async operations. @@ -49,10 +81,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace_async async def get( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.Workspace": """Gets the properties of the specified machine learning workspace. @@ -65,46 +94,54 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.Workspace :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore async def _create_or_update_initial( self, @@ -113,16 +150,24 @@ async def _create_or_update_initial( parameters: "_models.Workspace", **kwargs: Any ) -> Optional["_models.Workspace"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.Workspace"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'Workspace') + _json = self._serialize.body(parameters, "Workspace") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -131,33 +176,36 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -189,15 +237,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Workspace] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -205,32 +260,36 @@ async def begin_create_or_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -239,42 +298,48 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements force_to_purge: Optional[bool] = None, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, force_to_purge=force_to_purge, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -304,43 +369,52 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, force_to_purge=force_to_purge, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore async def _update_initial( self, @@ -349,16 +423,24 @@ async def _update_initial( parameters: "_models.WorkspaceUpdateParameters", **kwargs: Any ) -> Optional["_models.Workspace"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.Workspace"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'WorkspaceUpdateParameters') + _json = self._serialize.body(parameters, "WorkspaceUpdateParameters") request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -367,33 +449,36 @@ async def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -425,15 +510,22 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Workspace] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -441,32 +533,36 @@ async def begin_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace def list_by_resource_group( @@ -490,29 +586,36 @@ def list_by_resource_group( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_by_resource_group_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, api_version=api_version, skip=skip, kind=kind, - template_url=self.list_by_resource_group.metadata['url'], + template_url=self.list_by_resource_group.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_by_resource_group_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -527,7 +630,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -537,24 +642,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore + list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore async def _diagnose_initial( self, @@ -563,17 +672,27 @@ async def _diagnose_initial( parameters: Optional["_models.DiagnoseWorkspaceParameters"] = None, **kwargs: Any ) -> Optional["_models.DiagnoseResponseResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if parameters is not None: - _json = self._serialize.body(parameters, 'DiagnoseWorkspaceParameters') + _json = self._serialize.body( + parameters, "DiagnoseWorkspaceParameters" + ) else: _json = None @@ -584,39 +703,47 @@ async def _diagnose_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._diagnose_initial.metadata['url'], + template_url=self._diagnose_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) + deserialized = self._deserialize( + "DiagnoseResponseResult", pipeline_response + ) if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _diagnose_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore - + _diagnose_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore @distributed_trace_async async def begin_diagnose( @@ -650,15 +777,24 @@ async def begin_diagnose( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.DiagnoseResponseResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnoseResponseResult"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DiagnoseResponseResult"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._diagnose_initial( resource_group_name=resource_group_name, @@ -666,39 +802,46 @@ async def begin_diagnose( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) + deserialized = self._deserialize( + "DiagnoseResponseResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_diagnose.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore + begin_diagnose.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore @distributed_trace_async async def list_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.ListWorkspaceKeysResult": """Lists all the keys associated with this workspace. This includes keys for the storage account, app insights and password for container registry. @@ -712,95 +855,107 @@ async def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListWorkspaceKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceKeysResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListWorkspaceKeysResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ListWorkspaceKeysResult', pipeline_response) + deserialized = self._deserialize( + "ListWorkspaceKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys"} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys"} # type: ignore async def _resync_keys_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_resync_keys_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self._resync_keys_initial.metadata['url'], + template_url=self._resync_keys_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _resync_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore - + _resync_keys_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore @distributed_trace_async async def begin_resync_keys( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: """Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and password for container registry. @@ -821,42 +976,51 @@ async def begin_resync_keys( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._resync_keys_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_resync_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore + begin_resync_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore @distributed_trace def list_by_subscription( @@ -877,28 +1041,35 @@ def list_by_subscription( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, skip=skip, kind=kind, - template_url=self.list_by_subscription.metadata['url'], + template_url=self.list_by_subscription.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, @@ -912,7 +1083,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -922,31 +1095,32 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore + list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore @distributed_trace_async async def list_notebook_access_token( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.NotebookAccessTokenResult": """return notebook access token and refresh token. @@ -959,101 +1133,117 @@ async def list_notebook_access_token( :rtype: ~azure.mgmt.machinelearningservices.models.NotebookAccessTokenResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookAccessTokenResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.NotebookAccessTokenResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_list_notebook_access_token_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_notebook_access_token.metadata['url'], + template_url=self.list_notebook_access_token.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('NotebookAccessTokenResult', pipeline_response) + deserialized = self._deserialize( + "NotebookAccessTokenResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_notebook_access_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken"} # type: ignore - + list_notebook_access_token.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken"} # type: ignore async def _prepare_notebook_initial( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> Optional["_models.NotebookResourceInfo"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NotebookResourceInfo"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.NotebookResourceInfo"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_prepare_notebook_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self._prepare_notebook_initial.metadata['url'], + template_url=self._prepare_notebook_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) + deserialized = self._deserialize( + "NotebookResourceInfo", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _prepare_notebook_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore - + _prepare_notebook_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore @distributed_trace_async async def begin_prepare_notebook( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> AsyncLROPoller["_models.NotebookResourceInfo"]: """Prepare a notebook. @@ -1075,52 +1265,66 @@ async def begin_prepare_notebook( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.NotebookResourceInfo] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookResourceInfo"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.NotebookResourceInfo"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._prepare_notebook_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) + deserialized = self._deserialize( + "NotebookResourceInfo", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_prepare_notebook.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore + begin_prepare_notebook.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore @distributed_trace_async async def list_storage_account_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.ListStorageAccountKeysResult": """List storage account keys of a workspace. @@ -1133,53 +1337,62 @@ async def list_storage_account_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListStorageAccountKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListStorageAccountKeysResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListStorageAccountKeysResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_list_storage_account_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_storage_account_keys.metadata['url'], + template_url=self.list_storage_account_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ListStorageAccountKeysResult', pipeline_response) + deserialized = self._deserialize( + "ListStorageAccountKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_storage_account_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys"} # type: ignore - + list_storage_account_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys"} # type: ignore @distributed_trace_async async def list_notebook_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.ListNotebookKeysResult": """List keys of a notebook. @@ -1192,53 +1405,62 @@ async def list_notebook_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListNotebookKeysResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListNotebookKeysResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_list_notebook_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_notebook_keys.metadata['url'], + template_url=self.list_notebook_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ListNotebookKeysResult', pipeline_response) + deserialized = self._deserialize( + "ListNotebookKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_notebook_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys"} # type: ignore - + list_notebook_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys"} # type: ignore @distributed_trace_async async def list_outbound_network_dependencies_endpoints( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.ExternalFQDNResponse": """Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) programmatically. @@ -1255,43 +1477,57 @@ async def list_outbound_network_dependencies_endpoints( :rtype: ~azure.mgmt.machinelearningservices.models.ExternalFQDNResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExternalFQDNResponse"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ExternalFQDNResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_list_outbound_network_dependencies_endpoints_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], + template_url=self.list_outbound_network_dependencies_endpoints.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ExternalFQDNResponse', pipeline_response) + deserialized = self._deserialize( + "ExternalFQDNResponse", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_outbound_network_dependencies_endpoints.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints"} # type: ignore - + list_outbound_network_dependencies_endpoints.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/models/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/models/__init__.py index 9f7df901b153..3fb6a290fc9f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/models/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/models/__init__.py @@ -230,10 +230,14 @@ from ._models_py3 import FeaturesetVersionResourceArmPaginatedResult from ._models_py3 import FeaturestoreEntityContainer from ._models_py3 import FeaturestoreEntityContainerProperties - from ._models_py3 import FeaturestoreEntityContainerResourceArmPaginatedResult + from ._models_py3 import ( + FeaturestoreEntityContainerResourceArmPaginatedResult, + ) from ._models_py3 import FeaturestoreEntityVersion from ._models_py3 import FeaturestoreEntityVersionProperties - from ._models_py3 import FeaturestoreEntityVersionResourceArmPaginatedResult + from ._models_py3 import ( + FeaturestoreEntityVersionResourceArmPaginatedResult, + ) from ._models_py3 import FeaturizationSettings from ._models_py3 import FileSystemSource from ._models_py3 import FlavorData @@ -320,7 +324,9 @@ from ._models_py3 import MLTableJobInput from ._models_py3 import MLTableJobOutput from ._models_py3 import ManagedIdentity - from ._models_py3 import ManagedIdentityAuthTypeWorkspaceConnectionProperties + from ._models_py3 import ( + ManagedIdentityAuthTypeWorkspaceConnectionProperties, + ) from ._models_py3 import ManagedNetworkProvisionOptions from ._models_py3 import ManagedNetworkProvisionStatus from ._models_py3 import ManagedNetworkSettings @@ -391,7 +397,9 @@ from ._models_py3 import PackageResponse from ._models_py3 import PaginatedComputeResourcesList from ._models_py3 import PartialBatchDeployment - from ._models_py3 import PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties + from ._models_py3 import ( + PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, + ) from ._models_py3 import PartialJobBase from ._models_py3 import PartialJobBasePartialResource from ._models_py3 import PartialManagedServiceIdentity @@ -466,7 +474,9 @@ from ._models_py3 import Seasonality from ._models_py3 import SecretConfiguration from ._models_py3 import ServiceManagedResourcesSettings - from ._models_py3 import ServicePrincipalAuthTypeWorkspaceConnectionProperties + from ._models_py3 import ( + ServicePrincipalAuthTypeWorkspaceConnectionProperties, + ) from ._models_py3 import ServicePrincipalDatastoreCredentials from ._models_py3 import ServicePrincipalDatastoreSecrets from ._models_py3 import ServiceTagDestination @@ -533,7 +543,9 @@ from ._models_py3 import UserCreatedAcrAccount from ._models_py3 import UserCreatedStorageAccount from ._models_py3 import UserIdentity - from ._models_py3 import UsernamePasswordAuthTypeWorkspaceConnectionProperties + from ._models_py3 import ( + UsernamePasswordAuthTypeWorkspaceConnectionProperties, + ) from ._models_py3 import VirtualMachine from ._models_py3 import VirtualMachineImage from ._models_py3 import VirtualMachineSchema @@ -552,7 +564,9 @@ from ._models_py3 import WorkspaceConnectionPersonalAccessToken from ._models_py3 import WorkspaceConnectionPropertiesV2 from ._models_py3 import WorkspaceConnectionPropertiesV2BasicResource - from ._models_py3 import WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult + from ._models_py3 import ( + WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, + ) from ._models_py3 import WorkspaceConnectionServicePrincipal from ._models_py3 import WorkspaceConnectionSharedAccessSignature from ._models_py3 import WorkspaceConnectionUsernamePassword @@ -1296,736 +1310,736 @@ ) __all__ = [ - 'AKS', - 'AKSSchema', - 'AKSSchemaProperties', - 'AccessKeyAuthTypeWorkspaceConnectionProperties', - 'AccountKeyDatastoreCredentials', - 'AccountKeyDatastoreSecrets', - 'AcrDetails', - 'AksComputeSecrets', - 'AksComputeSecretsProperties', - 'AksNetworkingConfiguration', - 'AllFeatures', - 'AllNodes', - 'AmlCompute', - 'AmlComputeNodeInformation', - 'AmlComputeNodesInformation', - 'AmlComputeProperties', - 'AmlComputeSchema', - 'AmlOperation', - 'AmlOperationDisplay', - 'AmlOperationListResult', - 'AmlToken', - 'AmlUserFeature', - 'ArmResourceId', - 'AssetBase', - 'AssetContainer', - 'AssetJobInput', - 'AssetJobOutput', - 'AssetReferenceBase', - 'AssignedUser', - 'AutoDeleteSetting', - 'AutoForecastHorizon', - 'AutoMLJob', - 'AutoMLVertical', - 'AutoNCrossValidations', - 'AutoPauseProperties', - 'AutoScaleProperties', - 'AutoSeasonality', - 'AutoTargetLags', - 'AutoTargetRollingWindowSize', - 'AutologgerSettings', - 'AzMonMonitoringAlertNotificationSettings', - 'AzureBlobDatastore', - 'AzureDataLakeGen1Datastore', - 'AzureDataLakeGen2Datastore', - 'AzureDatastore', - 'AzureDevOpsWebhook', - 'AzureFileDatastore', - 'AzureMLBatchInferencingServer', - 'AzureMLOnlineInferencingServer', - 'BanditPolicy', - 'BaseEnvironmentId', - 'BaseEnvironmentSource', - 'BatchDeployment', - 'BatchDeploymentConfiguration', - 'BatchDeploymentProperties', - 'BatchDeploymentTrackedResourceArmPaginatedResult', - 'BatchEndpoint', - 'BatchEndpointDefaults', - 'BatchEndpointProperties', - 'BatchEndpointTrackedResourceArmPaginatedResult', - 'BatchPipelineComponentDeploymentConfiguration', - 'BatchRetrySettings', - 'BayesianSamplingAlgorithm', - 'BindOptions', - 'BlobReferenceForConsumptionDto', - 'BuildContext', - 'CategoricalDataDriftMetricThreshold', - 'CategoricalDataQualityMetricThreshold', - 'CategoricalPredictionDriftMetricThreshold', - 'CertificateDatastoreCredentials', - 'CertificateDatastoreSecrets', - 'Classification', - 'ClassificationModelPerformanceMetricThreshold', - 'ClassificationTrainingSettings', - 'ClusterUpdateParameters', - 'CocoExportSummary', - 'CodeConfiguration', - 'CodeContainer', - 'CodeContainerProperties', - 'CodeContainerResourceArmPaginatedResult', - 'CodeVersion', - 'CodeVersionProperties', - 'CodeVersionResourceArmPaginatedResult', - 'Collection', - 'ColumnTransformer', - 'CommandJob', - 'CommandJobLimits', - 'ComponentContainer', - 'ComponentContainerProperties', - 'ComponentContainerResourceArmPaginatedResult', - 'ComponentVersion', - 'ComponentVersionProperties', - 'ComponentVersionResourceArmPaginatedResult', - 'Compute', - 'ComputeInstance', - 'ComputeInstanceApplication', - 'ComputeInstanceAutologgerSettings', - 'ComputeInstanceConnectivityEndpoints', - 'ComputeInstanceContainer', - 'ComputeInstanceCreatedBy', - 'ComputeInstanceDataDisk', - 'ComputeInstanceDataMount', - 'ComputeInstanceEnvironmentInfo', - 'ComputeInstanceLastOperation', - 'ComputeInstanceProperties', - 'ComputeInstanceSchema', - 'ComputeInstanceSshSettings', - 'ComputeInstanceVersion', - 'ComputeResource', - 'ComputeResourceSchema', - 'ComputeRuntimeDto', - 'ComputeSchedules', - 'ComputeSecrets', - 'ComputeStartStopSchedule', - 'ContainerResourceRequirements', - 'ContainerResourceSettings', - 'CosmosDbSettings', - 'CreateMonitorAction', - 'Cron', - 'CronTrigger', - 'CsvExportSummary', - 'CustomForecastHorizon', - 'CustomInferencingServer', - 'CustomMetricThreshold', - 'CustomModelJobInput', - 'CustomModelJobOutput', - 'CustomMonitoringSignal', - 'CustomNCrossValidations', - 'CustomSeasonality', - 'CustomService', - 'CustomTargetLags', - 'CustomTargetRollingWindowSize', - 'DataCollector', - 'DataContainer', - 'DataContainerProperties', - 'DataContainerResourceArmPaginatedResult', - 'DataDriftMetricThresholdBase', - 'DataDriftMonitoringSignal', - 'DataFactory', - 'DataImport', - 'DataImportSource', - 'DataLakeAnalytics', - 'DataLakeAnalyticsSchema', - 'DataLakeAnalyticsSchemaProperties', - 'DataPathAssetReference', - 'DataQualityMetricThresholdBase', - 'DataQualityMonitoringSignal', - 'DataVersionBase', - 'DataVersionBaseProperties', - 'DataVersionBaseResourceArmPaginatedResult', - 'DatabaseSource', - 'Databricks', - 'DatabricksComputeSecrets', - 'DatabricksComputeSecretsProperties', - 'DatabricksProperties', - 'DatabricksSchema', - 'DatasetExportSummary', - 'Datastore', - 'DatastoreCredentials', - 'DatastoreProperties', - 'DatastoreResourceArmPaginatedResult', - 'DatastoreSecrets', - 'DefaultScaleSettings', - 'DeploymentLogs', - 'DeploymentLogsRequest', - 'DeploymentResourceConfiguration', - 'DiagnoseRequestProperties', - 'DiagnoseResponseResult', - 'DiagnoseResponseResultValue', - 'DiagnoseResult', - 'DiagnoseWorkspaceParameters', - 'DistributionConfiguration', - 'Docker', - 'EarlyTerminationPolicy', - 'EmailMonitoringAlertNotificationSettings', - 'EncryptionKeyVaultProperties', - 'EncryptionKeyVaultUpdateProperties', - 'EncryptionProperty', - 'EncryptionUpdateProperties', - 'Endpoint', - 'EndpointAuthKeys', - 'EndpointAuthToken', - 'EndpointDeploymentPropertiesBase', - 'EndpointPropertiesBase', - 'EndpointScheduleAction', - 'EnvironmentContainer', - 'EnvironmentContainerProperties', - 'EnvironmentContainerResourceArmPaginatedResult', - 'EnvironmentVariable', - 'EnvironmentVersion', - 'EnvironmentVersionProperties', - 'EnvironmentVersionResourceArmPaginatedResult', - 'ErrorAdditionalInfo', - 'ErrorDetail', - 'ErrorResponse', - 'EstimatedVMPrice', - 'EstimatedVMPrices', - 'ExportSummary', - 'ExternalFQDNResponse', - 'FQDNEndpoint', - 'FQDNEndpointDetail', - 'FQDNEndpoints', - 'FQDNEndpointsProperties', - 'Feature', - 'FeatureAttributionDriftMonitoringSignal', - 'FeatureAttributionMetricThreshold', - 'FeatureProperties', - 'FeatureResourceArmPaginatedResult', - 'FeatureStoreSettings', - 'FeatureSubset', - 'FeatureWindow', - 'FeaturesetContainer', - 'FeaturesetContainerProperties', - 'FeaturesetContainerResourceArmPaginatedResult', - 'FeaturesetJob', - 'FeaturesetJobArmPaginatedResult', - 'FeaturesetSpecification', - 'FeaturesetVersion', - 'FeaturesetVersionBackfillRequest', - 'FeaturesetVersionProperties', - 'FeaturesetVersionResourceArmPaginatedResult', - 'FeaturestoreEntityContainer', - 'FeaturestoreEntityContainerProperties', - 'FeaturestoreEntityContainerResourceArmPaginatedResult', - 'FeaturestoreEntityVersion', - 'FeaturestoreEntityVersionProperties', - 'FeaturestoreEntityVersionResourceArmPaginatedResult', - 'FeaturizationSettings', - 'FileSystemSource', - 'FlavorData', - 'ForecastHorizon', - 'Forecasting', - 'ForecastingSettings', - 'ForecastingTrainingSettings', - 'FqdnOutboundRule', - 'GridSamplingAlgorithm', - 'HDInsight', - 'HDInsightProperties', - 'HDInsightSchema', - 'HdfsDatastore', - 'IdAssetReference', - 'IdentityConfiguration', - 'IdentityForCmk', - 'IdleShutdownSetting', - 'Image', - 'ImageClassification', - 'ImageClassificationBase', - 'ImageClassificationMultilabel', - 'ImageInstanceSegmentation', - 'ImageLimitSettings', - 'ImageMetadata', - 'ImageModelDistributionSettings', - 'ImageModelDistributionSettingsClassification', - 'ImageModelDistributionSettingsObjectDetection', - 'ImageModelSettings', - 'ImageModelSettingsClassification', - 'ImageModelSettingsObjectDetection', - 'ImageObjectDetection', - 'ImageObjectDetectionBase', - 'ImageSweepSettings', - 'ImageVertical', - 'ImportDataAction', - 'IndexColumn', - 'InferenceContainerProperties', - 'InferencingServer', - 'InstanceTypeSchema', - 'InstanceTypeSchemaResources', - 'IntellectualProperty', - 'JobBase', - 'JobBaseProperties', - 'JobBaseResourceArmPaginatedResult', - 'JobInput', - 'JobLimits', - 'JobOutput', - 'JobResourceConfiguration', - 'JobScheduleAction', - 'JobService', - 'KerberosCredentials', - 'KerberosKeytabCredentials', - 'KerberosKeytabSecrets', - 'KerberosPasswordCredentials', - 'KerberosPasswordSecrets', - 'Kubernetes', - 'KubernetesOnlineDeployment', - 'KubernetesProperties', - 'KubernetesSchema', - 'LabelCategory', - 'LabelClass', - 'LabelingDataConfiguration', - 'LabelingJob', - 'LabelingJobImageProperties', - 'LabelingJobInstructions', - 'LabelingJobMediaProperties', - 'LabelingJobProperties', - 'LabelingJobResourceArmPaginatedResult', - 'LabelingJobTextProperties', - 'LakeHouseArtifact', - 'ListAmlUserFeatureResult', - 'ListNotebookKeysResult', - 'ListStorageAccountKeysResult', - 'ListUsagesResult', - 'ListWorkspaceKeysResult', - 'ListWorkspaceQuotas', - 'LiteralJobInput', - 'MLAssistConfiguration', - 'MLAssistConfigurationDisabled', - 'MLAssistConfigurationEnabled', - 'MLFlowModelJobInput', - 'MLFlowModelJobOutput', - 'MLTableData', - 'MLTableJobInput', - 'MLTableJobOutput', - 'ManagedIdentity', - 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', - 'ManagedNetworkProvisionOptions', - 'ManagedNetworkProvisionStatus', - 'ManagedNetworkSettings', - 'ManagedOnlineDeployment', - 'ManagedServiceIdentity', - 'ManagedServiceIdentityAutoGenerated', - 'MaterializationComputeResource', - 'MaterializationSettings', - 'MedianStoppingPolicy', - 'ModelConfiguration', - 'ModelContainer', - 'ModelContainerProperties', - 'ModelContainerResourceArmPaginatedResult', - 'ModelPackageInput', - 'ModelPerformanceMetricThresholdBase', - 'ModelPerformanceSignalBase', - 'ModelVersion', - 'ModelVersionProperties', - 'ModelVersionResourceArmPaginatedResult', - 'MonitorDefinition', - 'MonitoringAlertNotificationSettingsBase', - 'MonitoringDataSegment', - 'MonitoringFeatureFilterBase', - 'MonitoringInputData', - 'MonitoringSignalBase', - 'MonitoringThreshold', - 'Mpi', - 'NCrossValidations', - 'NlpFixedParameters', - 'NlpParameterSubspace', - 'NlpSweepSettings', - 'NlpVertical', - 'NlpVerticalFeaturizationSettings', - 'NlpVerticalLimitSettings', - 'NodeStateCounts', - 'Nodes', - 'NoneAuthTypeWorkspaceConnectionProperties', - 'NoneDatastoreCredentials', - 'NotebookAccessTokenResult', - 'NotebookPreparationError', - 'NotebookResourceInfo', - 'NotificationSetting', - 'NumericalDataDriftMetricThreshold', - 'NumericalDataQualityMetricThreshold', - 'NumericalPredictionDriftMetricThreshold', - 'Objective', - 'OneLakeArtifact', - 'OneLakeDatastore', - 'OnlineDeployment', - 'OnlineDeploymentProperties', - 'OnlineDeploymentTrackedResourceArmPaginatedResult', - 'OnlineEndpoint', - 'OnlineEndpointProperties', - 'OnlineEndpointTrackedResourceArmPaginatedResult', - 'OnlineInferenceConfiguration', - 'OnlineRequestSettings', - 'OnlineScaleSettings', - 'OutboundRule', - 'OutboundRuleBasicResource', - 'OutboundRuleListResult', - 'OutputPathAssetReference', - 'PATAuthTypeWorkspaceConnectionProperties', - 'PackageInputPathBase', - 'PackageInputPathId', - 'PackageInputPathUrl', - 'PackageInputPathVersion', - 'PackageRequest', - 'PackageResponse', - 'PaginatedComputeResourcesList', - 'PartialBatchDeployment', - 'PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties', - 'PartialJobBase', - 'PartialJobBasePartialResource', - 'PartialManagedServiceIdentity', - 'PartialManagedServiceIdentityAutoGenerated', - 'PartialMinimalTrackedResource', - 'PartialMinimalTrackedResourceWithIdentity', - 'PartialMinimalTrackedResourceWithSku', - 'PartialNotificationSetting', - 'PartialRegistryPartialTrackedResource', - 'PartialSku', - 'Password', - 'PendingUploadCredentialDto', - 'PendingUploadRequestDto', - 'PendingUploadResponseDto', - 'PersonalComputeInstanceSettings', - 'PipelineJob', - 'PredictionDriftMetricThresholdBase', - 'PredictionDriftMonitoringSignal', - 'PrivateEndpoint', - 'PrivateEndpointAutoGenerated', - 'PrivateEndpointConnection', - 'PrivateEndpointConnectionAutoGenerated', - 'PrivateEndpointConnectionListResult', - 'PrivateEndpointDestination', - 'PrivateEndpointOutboundRule', - 'PrivateEndpointResource', - 'PrivateLinkResource', - 'PrivateLinkResourceListResult', - 'PrivateLinkServiceConnectionState', - 'PrivateLinkServiceConnectionStateAutoGenerated', - 'ProbeSettings', - 'ProgressMetrics', - 'PyTorch', - 'QueueSettings', - 'QuotaBaseProperties', - 'QuotaUpdateParameters', - 'RandomSamplingAlgorithm', - 'Ray', - 'Recurrence', - 'RecurrenceSchedule', - 'RecurrenceTrigger', - 'RegenerateEndpointKeysRequest', - 'Registry', - 'RegistryListCredentialsResult', - 'RegistryRegionArmDetails', - 'RegistryTrackedResourceArmPaginatedResult', - 'Regression', - 'RegressionModelPerformanceMetricThreshold', - 'RegressionTrainingSettings', - 'RequestLogging', - 'Resource', - 'ResourceBase', - 'ResourceConfiguration', - 'ResourceId', - 'ResourceName', - 'ResourceQuota', - 'Route', - 'SASAuthTypeWorkspaceConnectionProperties', - 'SASCredentialDto', - 'SamplingAlgorithm', - 'SasDatastoreCredentials', - 'SasDatastoreSecrets', - 'ScaleSettings', - 'ScaleSettingsInformation', - 'Schedule', - 'ScheduleActionBase', - 'ScheduleBase', - 'ScheduleProperties', - 'ScheduleResourceArmPaginatedResult', - 'ScriptReference', - 'ScriptsToExecute', - 'Seasonality', - 'SecretConfiguration', - 'ServiceManagedResourcesSettings', - 'ServicePrincipalAuthTypeWorkspaceConnectionProperties', - 'ServicePrincipalDatastoreCredentials', - 'ServicePrincipalDatastoreSecrets', - 'ServiceTagDestination', - 'ServiceTagOutboundRule', - 'SetupScripts', - 'SharedPrivateLinkResource', - 'Sku', - 'SkuCapacity', - 'SkuResource', - 'SkuResourceArmPaginatedResult', - 'SkuSetting', - 'SparkJob', - 'SparkJobEntry', - 'SparkJobPythonEntry', - 'SparkJobScalaEntry', - 'SparkResourceConfiguration', - 'SslConfiguration', - 'StackEnsembleSettings', - 'StatusMessage', - 'StorageAccountDetails', - 'SweepJob', - 'SweepJobLimits', - 'SynapseSpark', - 'SynapseSparkProperties', - 'SystemCreatedAcrAccount', - 'SystemCreatedStorageAccount', - 'SystemData', - 'SystemService', - 'TableFixedParameters', - 'TableParameterSubspace', - 'TableSweepSettings', - 'TableVertical', - 'TableVerticalFeaturizationSettings', - 'TableVerticalLimitSettings', - 'TargetLags', - 'TargetRollingWindowSize', - 'TargetUtilizationScaleSettings', - 'TensorFlow', - 'TextClassification', - 'TextClassificationMultilabel', - 'TextNer', - 'TmpfsOptions', - 'TopNFeaturesByAttribution', - 'TrackedResource', - 'TrainingSettings', - 'TrialComponent', - 'TriggerBase', - 'TritonInferencingServer', - 'TritonModelJobInput', - 'TritonModelJobOutput', - 'TruncationSelectionPolicy', - 'UpdateWorkspaceQuotas', - 'UpdateWorkspaceQuotasResult', - 'UriFileDataVersion', - 'UriFileJobInput', - 'UriFileJobOutput', - 'UriFolderDataVersion', - 'UriFolderJobInput', - 'UriFolderJobOutput', - 'Usage', - 'UsageName', - 'UserAccountCredentials', - 'UserAssignedIdentity', - 'UserCreatedAcrAccount', - 'UserCreatedStorageAccount', - 'UserIdentity', - 'UsernamePasswordAuthTypeWorkspaceConnectionProperties', - 'VirtualMachine', - 'VirtualMachineImage', - 'VirtualMachineSchema', - 'VirtualMachineSchemaProperties', - 'VirtualMachineSecrets', - 'VirtualMachineSecretsSchema', - 'VirtualMachineSize', - 'VirtualMachineSizeListResult', - 'VirtualMachineSshCredentials', - 'VolumeDefinition', - 'VolumeOptions', - 'Webhook', - 'Workspace', - 'WorkspaceConnectionAccessKey', - 'WorkspaceConnectionManagedIdentity', - 'WorkspaceConnectionPersonalAccessToken', - 'WorkspaceConnectionPropertiesV2', - 'WorkspaceConnectionPropertiesV2BasicResource', - 'WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult', - 'WorkspaceConnectionServicePrincipal', - 'WorkspaceConnectionSharedAccessSignature', - 'WorkspaceConnectionUsernamePassword', - 'WorkspaceListResult', - 'WorkspaceUpdateParameters', - 'AllocationState', - 'ApplicationSharingPolicy', - 'AssetProvisioningState', - 'AutoDeleteCondition', - 'AutoRebuildSetting', - 'Autosave', - 'BaseEnvironmentSourceType', - 'BatchDeploymentConfigurationType', - 'BatchLoggingLevel', - 'BatchOutputAction', - 'BillingCurrency', - 'BlockedTransformers', - 'Caching', - 'CategoricalDataDriftMetric', - 'CategoricalDataQualityMetric', - 'CategoricalPredictionDriftMetric', - 'ClassificationModelPerformanceMetric', - 'ClassificationModels', - 'ClassificationMultilabelPrimaryMetrics', - 'ClassificationPrimaryMetrics', - 'ClusterPurpose', - 'ComputeInstanceAuthorizationType', - 'ComputeInstanceState', - 'ComputePowerAction', - 'ComputeType', - 'ConnectionAuthType', - 'ConnectionCategory', - 'ContainerType', - 'CreatedByType', - 'CredentialsType', - 'DataCollectionMode', - 'DataImportSourceType', - 'DataType', - 'DatastoreType', - 'DeploymentProvisioningState', - 'DiagnoseResultLevel', - 'DistributionType', - 'EarlyTerminationPolicyType', - 'EgressPublicNetworkAccessType', - 'EmailNotificationEnableType', - 'EncryptionStatus', - 'EndpointAuthMode', - 'EndpointComputeType', - 'EndpointProvisioningState', - 'EndpointServiceConnectionStatus', - 'EnvironmentType', - 'EnvironmentVariableType', - 'ExportFormatType', - 'FeatureAttributionMetric', - 'FeatureDataType', - 'FeatureLags', - 'FeaturestoreJobType', - 'FeaturizationMode', - 'ForecastHorizonMode', - 'ForecastingModels', - 'ForecastingPrimaryMetrics', - 'Goal', - 'IdentityConfigurationType', - 'ImageAnnotationType', - 'ImageType', - 'IncrementalDataRefresh', - 'InferencingServerType', - 'InputDeliveryMode', - 'InputPathType', - 'InstanceSegmentationPrimaryMetrics', - 'IsolationMode', - 'JobInputType', - 'JobLimitsType', - 'JobOutputType', - 'JobProvisioningState', - 'JobStatus', - 'JobTier', - 'JobType', - 'KeyType', - 'LearningRateScheduler', - 'ListViewType', - 'LoadBalancerType', - 'LogTrainingMetrics', - 'LogValidationLoss', - 'LogVerbosity', - 'MLAssistConfigurationType', - 'MLFlowAutologgerState', - 'ManagedNetworkStatus', - 'ManagedServiceIdentityType', - 'MaterializationStoreType', - 'MediaType', - 'MlflowAutologger', - 'ModelSize', - 'MonitoringAlertNotificationType', - 'MonitoringFeatureDataType', - 'MonitoringFeatureFilterType', - 'MonitoringInputDataContext', - 'MonitoringModelType', - 'MonitoringNotificationMode', - 'MonitoringSignalType', - 'MountAction', - 'MountState', - 'MultiSelect', - 'NCrossValidationsMode', - 'Network', - 'NlpLearningRateScheduler', - 'NodeState', - 'NodesValueType', - 'NumericalDataDriftMetric', - 'NumericalDataQualityMetric', - 'NumericalPredictionDriftMetric', - 'ObjectDetectionPrimaryMetrics', - 'OneLakeArtifactType', - 'OperatingSystemType', - 'OperationName', - 'OperationStatus', - 'OperationTrigger', - 'OrderString', - 'OsType', - 'OutputDeliveryMode', - 'PackageBuildState', - 'PackageInputDeliveryMode', - 'PackageInputType', - 'PendingUploadCredentialType', - 'PendingUploadType', - 'PrivateEndpointConnectionProvisioningState', - 'PrivateEndpointServiceConnectionStatus', - 'ProtectionLevel', - 'Protocol', - 'ProvisioningState', - 'ProvisioningStatus', - 'PublicNetworkAccess', - 'PublicNetworkAccessType', - 'QuotaUnit', - 'RandomSamplingAlgorithmRule', - 'RecurrenceFrequency', - 'ReferenceType', - 'RegressionModelPerformanceMetric', - 'RegressionModels', - 'RegressionPrimaryMetrics', - 'RemoteLoginPortPublicAccess', - 'RollingRateType', - 'RuleCategory', - 'RuleStatus', - 'RuleType', - 'SamplingAlgorithmType', - 'ScaleType', - 'ScheduleActionType', - 'ScheduleListViewType', - 'ScheduleProvisioningState', - 'ScheduleProvisioningStatus', - 'ScheduleStatus', - 'SeasonalityMode', - 'SecretsType', - 'ServiceDataAccessAuthIdentity', - 'ShortSeriesHandlingConfiguration', - 'SkuScaleType', - 'SkuTier', - 'SourceType', - 'SparkJobEntryType', - 'SshPublicAccess', - 'SslConfigStatus', - 'StackMetaLearnerType', - 'Status', - 'StatusMessageLevel', - 'StochasticOptimizer', - 'StorageAccountType', - 'TargetAggregationFunction', - 'TargetLagsMode', - 'TargetRollingWindowSizeMode', - 'TaskType', - 'TextAnnotationType', - 'TrainingMode', - 'TriggerType', - 'UnderlyingResourceAction', - 'UnitOfMeasure', - 'UsageUnit', - 'UseStl', - 'VMPriceOSType', - 'VMTier', - 'ValidationMetricType', - 'ValueFormat', - 'VmPriority', - 'VolumeDefinitionType', - 'WebhookType', - 'WeekDay', + "AKS", + "AKSSchema", + "AKSSchemaProperties", + "AccessKeyAuthTypeWorkspaceConnectionProperties", + "AccountKeyDatastoreCredentials", + "AccountKeyDatastoreSecrets", + "AcrDetails", + "AksComputeSecrets", + "AksComputeSecretsProperties", + "AksNetworkingConfiguration", + "AllFeatures", + "AllNodes", + "AmlCompute", + "AmlComputeNodeInformation", + "AmlComputeNodesInformation", + "AmlComputeProperties", + "AmlComputeSchema", + "AmlOperation", + "AmlOperationDisplay", + "AmlOperationListResult", + "AmlToken", + "AmlUserFeature", + "ArmResourceId", + "AssetBase", + "AssetContainer", + "AssetJobInput", + "AssetJobOutput", + "AssetReferenceBase", + "AssignedUser", + "AutoDeleteSetting", + "AutoForecastHorizon", + "AutoMLJob", + "AutoMLVertical", + "AutoNCrossValidations", + "AutoPauseProperties", + "AutoScaleProperties", + "AutoSeasonality", + "AutoTargetLags", + "AutoTargetRollingWindowSize", + "AutologgerSettings", + "AzMonMonitoringAlertNotificationSettings", + "AzureBlobDatastore", + "AzureDataLakeGen1Datastore", + "AzureDataLakeGen2Datastore", + "AzureDatastore", + "AzureDevOpsWebhook", + "AzureFileDatastore", + "AzureMLBatchInferencingServer", + "AzureMLOnlineInferencingServer", + "BanditPolicy", + "BaseEnvironmentId", + "BaseEnvironmentSource", + "BatchDeployment", + "BatchDeploymentConfiguration", + "BatchDeploymentProperties", + "BatchDeploymentTrackedResourceArmPaginatedResult", + "BatchEndpoint", + "BatchEndpointDefaults", + "BatchEndpointProperties", + "BatchEndpointTrackedResourceArmPaginatedResult", + "BatchPipelineComponentDeploymentConfiguration", + "BatchRetrySettings", + "BayesianSamplingAlgorithm", + "BindOptions", + "BlobReferenceForConsumptionDto", + "BuildContext", + "CategoricalDataDriftMetricThreshold", + "CategoricalDataQualityMetricThreshold", + "CategoricalPredictionDriftMetricThreshold", + "CertificateDatastoreCredentials", + "CertificateDatastoreSecrets", + "Classification", + "ClassificationModelPerformanceMetricThreshold", + "ClassificationTrainingSettings", + "ClusterUpdateParameters", + "CocoExportSummary", + "CodeConfiguration", + "CodeContainer", + "CodeContainerProperties", + "CodeContainerResourceArmPaginatedResult", + "CodeVersion", + "CodeVersionProperties", + "CodeVersionResourceArmPaginatedResult", + "Collection", + "ColumnTransformer", + "CommandJob", + "CommandJobLimits", + "ComponentContainer", + "ComponentContainerProperties", + "ComponentContainerResourceArmPaginatedResult", + "ComponentVersion", + "ComponentVersionProperties", + "ComponentVersionResourceArmPaginatedResult", + "Compute", + "ComputeInstance", + "ComputeInstanceApplication", + "ComputeInstanceAutologgerSettings", + "ComputeInstanceConnectivityEndpoints", + "ComputeInstanceContainer", + "ComputeInstanceCreatedBy", + "ComputeInstanceDataDisk", + "ComputeInstanceDataMount", + "ComputeInstanceEnvironmentInfo", + "ComputeInstanceLastOperation", + "ComputeInstanceProperties", + "ComputeInstanceSchema", + "ComputeInstanceSshSettings", + "ComputeInstanceVersion", + "ComputeResource", + "ComputeResourceSchema", + "ComputeRuntimeDto", + "ComputeSchedules", + "ComputeSecrets", + "ComputeStartStopSchedule", + "ContainerResourceRequirements", + "ContainerResourceSettings", + "CosmosDbSettings", + "CreateMonitorAction", + "Cron", + "CronTrigger", + "CsvExportSummary", + "CustomForecastHorizon", + "CustomInferencingServer", + "CustomMetricThreshold", + "CustomModelJobInput", + "CustomModelJobOutput", + "CustomMonitoringSignal", + "CustomNCrossValidations", + "CustomSeasonality", + "CustomService", + "CustomTargetLags", + "CustomTargetRollingWindowSize", + "DataCollector", + "DataContainer", + "DataContainerProperties", + "DataContainerResourceArmPaginatedResult", + "DataDriftMetricThresholdBase", + "DataDriftMonitoringSignal", + "DataFactory", + "DataImport", + "DataImportSource", + "DataLakeAnalytics", + "DataLakeAnalyticsSchema", + "DataLakeAnalyticsSchemaProperties", + "DataPathAssetReference", + "DataQualityMetricThresholdBase", + "DataQualityMonitoringSignal", + "DataVersionBase", + "DataVersionBaseProperties", + "DataVersionBaseResourceArmPaginatedResult", + "DatabaseSource", + "Databricks", + "DatabricksComputeSecrets", + "DatabricksComputeSecretsProperties", + "DatabricksProperties", + "DatabricksSchema", + "DatasetExportSummary", + "Datastore", + "DatastoreCredentials", + "DatastoreProperties", + "DatastoreResourceArmPaginatedResult", + "DatastoreSecrets", + "DefaultScaleSettings", + "DeploymentLogs", + "DeploymentLogsRequest", + "DeploymentResourceConfiguration", + "DiagnoseRequestProperties", + "DiagnoseResponseResult", + "DiagnoseResponseResultValue", + "DiagnoseResult", + "DiagnoseWorkspaceParameters", + "DistributionConfiguration", + "Docker", + "EarlyTerminationPolicy", + "EmailMonitoringAlertNotificationSettings", + "EncryptionKeyVaultProperties", + "EncryptionKeyVaultUpdateProperties", + "EncryptionProperty", + "EncryptionUpdateProperties", + "Endpoint", + "EndpointAuthKeys", + "EndpointAuthToken", + "EndpointDeploymentPropertiesBase", + "EndpointPropertiesBase", + "EndpointScheduleAction", + "EnvironmentContainer", + "EnvironmentContainerProperties", + "EnvironmentContainerResourceArmPaginatedResult", + "EnvironmentVariable", + "EnvironmentVersion", + "EnvironmentVersionProperties", + "EnvironmentVersionResourceArmPaginatedResult", + "ErrorAdditionalInfo", + "ErrorDetail", + "ErrorResponse", + "EstimatedVMPrice", + "EstimatedVMPrices", + "ExportSummary", + "ExternalFQDNResponse", + "FQDNEndpoint", + "FQDNEndpointDetail", + "FQDNEndpoints", + "FQDNEndpointsProperties", + "Feature", + "FeatureAttributionDriftMonitoringSignal", + "FeatureAttributionMetricThreshold", + "FeatureProperties", + "FeatureResourceArmPaginatedResult", + "FeatureStoreSettings", + "FeatureSubset", + "FeatureWindow", + "FeaturesetContainer", + "FeaturesetContainerProperties", + "FeaturesetContainerResourceArmPaginatedResult", + "FeaturesetJob", + "FeaturesetJobArmPaginatedResult", + "FeaturesetSpecification", + "FeaturesetVersion", + "FeaturesetVersionBackfillRequest", + "FeaturesetVersionProperties", + "FeaturesetVersionResourceArmPaginatedResult", + "FeaturestoreEntityContainer", + "FeaturestoreEntityContainerProperties", + "FeaturestoreEntityContainerResourceArmPaginatedResult", + "FeaturestoreEntityVersion", + "FeaturestoreEntityVersionProperties", + "FeaturestoreEntityVersionResourceArmPaginatedResult", + "FeaturizationSettings", + "FileSystemSource", + "FlavorData", + "ForecastHorizon", + "Forecasting", + "ForecastingSettings", + "ForecastingTrainingSettings", + "FqdnOutboundRule", + "GridSamplingAlgorithm", + "HDInsight", + "HDInsightProperties", + "HDInsightSchema", + "HdfsDatastore", + "IdAssetReference", + "IdentityConfiguration", + "IdentityForCmk", + "IdleShutdownSetting", + "Image", + "ImageClassification", + "ImageClassificationBase", + "ImageClassificationMultilabel", + "ImageInstanceSegmentation", + "ImageLimitSettings", + "ImageMetadata", + "ImageModelDistributionSettings", + "ImageModelDistributionSettingsClassification", + "ImageModelDistributionSettingsObjectDetection", + "ImageModelSettings", + "ImageModelSettingsClassification", + "ImageModelSettingsObjectDetection", + "ImageObjectDetection", + "ImageObjectDetectionBase", + "ImageSweepSettings", + "ImageVertical", + "ImportDataAction", + "IndexColumn", + "InferenceContainerProperties", + "InferencingServer", + "InstanceTypeSchema", + "InstanceTypeSchemaResources", + "IntellectualProperty", + "JobBase", + "JobBaseProperties", + "JobBaseResourceArmPaginatedResult", + "JobInput", + "JobLimits", + "JobOutput", + "JobResourceConfiguration", + "JobScheduleAction", + "JobService", + "KerberosCredentials", + "KerberosKeytabCredentials", + "KerberosKeytabSecrets", + "KerberosPasswordCredentials", + "KerberosPasswordSecrets", + "Kubernetes", + "KubernetesOnlineDeployment", + "KubernetesProperties", + "KubernetesSchema", + "LabelCategory", + "LabelClass", + "LabelingDataConfiguration", + "LabelingJob", + "LabelingJobImageProperties", + "LabelingJobInstructions", + "LabelingJobMediaProperties", + "LabelingJobProperties", + "LabelingJobResourceArmPaginatedResult", + "LabelingJobTextProperties", + "LakeHouseArtifact", + "ListAmlUserFeatureResult", + "ListNotebookKeysResult", + "ListStorageAccountKeysResult", + "ListUsagesResult", + "ListWorkspaceKeysResult", + "ListWorkspaceQuotas", + "LiteralJobInput", + "MLAssistConfiguration", + "MLAssistConfigurationDisabled", + "MLAssistConfigurationEnabled", + "MLFlowModelJobInput", + "MLFlowModelJobOutput", + "MLTableData", + "MLTableJobInput", + "MLTableJobOutput", + "ManagedIdentity", + "ManagedIdentityAuthTypeWorkspaceConnectionProperties", + "ManagedNetworkProvisionOptions", + "ManagedNetworkProvisionStatus", + "ManagedNetworkSettings", + "ManagedOnlineDeployment", + "ManagedServiceIdentity", + "ManagedServiceIdentityAutoGenerated", + "MaterializationComputeResource", + "MaterializationSettings", + "MedianStoppingPolicy", + "ModelConfiguration", + "ModelContainer", + "ModelContainerProperties", + "ModelContainerResourceArmPaginatedResult", + "ModelPackageInput", + "ModelPerformanceMetricThresholdBase", + "ModelPerformanceSignalBase", + "ModelVersion", + "ModelVersionProperties", + "ModelVersionResourceArmPaginatedResult", + "MonitorDefinition", + "MonitoringAlertNotificationSettingsBase", + "MonitoringDataSegment", + "MonitoringFeatureFilterBase", + "MonitoringInputData", + "MonitoringSignalBase", + "MonitoringThreshold", + "Mpi", + "NCrossValidations", + "NlpFixedParameters", + "NlpParameterSubspace", + "NlpSweepSettings", + "NlpVertical", + "NlpVerticalFeaturizationSettings", + "NlpVerticalLimitSettings", + "NodeStateCounts", + "Nodes", + "NoneAuthTypeWorkspaceConnectionProperties", + "NoneDatastoreCredentials", + "NotebookAccessTokenResult", + "NotebookPreparationError", + "NotebookResourceInfo", + "NotificationSetting", + "NumericalDataDriftMetricThreshold", + "NumericalDataQualityMetricThreshold", + "NumericalPredictionDriftMetricThreshold", + "Objective", + "OneLakeArtifact", + "OneLakeDatastore", + "OnlineDeployment", + "OnlineDeploymentProperties", + "OnlineDeploymentTrackedResourceArmPaginatedResult", + "OnlineEndpoint", + "OnlineEndpointProperties", + "OnlineEndpointTrackedResourceArmPaginatedResult", + "OnlineInferenceConfiguration", + "OnlineRequestSettings", + "OnlineScaleSettings", + "OutboundRule", + "OutboundRuleBasicResource", + "OutboundRuleListResult", + "OutputPathAssetReference", + "PATAuthTypeWorkspaceConnectionProperties", + "PackageInputPathBase", + "PackageInputPathId", + "PackageInputPathUrl", + "PackageInputPathVersion", + "PackageRequest", + "PackageResponse", + "PaginatedComputeResourcesList", + "PartialBatchDeployment", + "PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties", + "PartialJobBase", + "PartialJobBasePartialResource", + "PartialManagedServiceIdentity", + "PartialManagedServiceIdentityAutoGenerated", + "PartialMinimalTrackedResource", + "PartialMinimalTrackedResourceWithIdentity", + "PartialMinimalTrackedResourceWithSku", + "PartialNotificationSetting", + "PartialRegistryPartialTrackedResource", + "PartialSku", + "Password", + "PendingUploadCredentialDto", + "PendingUploadRequestDto", + "PendingUploadResponseDto", + "PersonalComputeInstanceSettings", + "PipelineJob", + "PredictionDriftMetricThresholdBase", + "PredictionDriftMonitoringSignal", + "PrivateEndpoint", + "PrivateEndpointAutoGenerated", + "PrivateEndpointConnection", + "PrivateEndpointConnectionAutoGenerated", + "PrivateEndpointConnectionListResult", + "PrivateEndpointDestination", + "PrivateEndpointOutboundRule", + "PrivateEndpointResource", + "PrivateLinkResource", + "PrivateLinkResourceListResult", + "PrivateLinkServiceConnectionState", + "PrivateLinkServiceConnectionStateAutoGenerated", + "ProbeSettings", + "ProgressMetrics", + "PyTorch", + "QueueSettings", + "QuotaBaseProperties", + "QuotaUpdateParameters", + "RandomSamplingAlgorithm", + "Ray", + "Recurrence", + "RecurrenceSchedule", + "RecurrenceTrigger", + "RegenerateEndpointKeysRequest", + "Registry", + "RegistryListCredentialsResult", + "RegistryRegionArmDetails", + "RegistryTrackedResourceArmPaginatedResult", + "Regression", + "RegressionModelPerformanceMetricThreshold", + "RegressionTrainingSettings", + "RequestLogging", + "Resource", + "ResourceBase", + "ResourceConfiguration", + "ResourceId", + "ResourceName", + "ResourceQuota", + "Route", + "SASAuthTypeWorkspaceConnectionProperties", + "SASCredentialDto", + "SamplingAlgorithm", + "SasDatastoreCredentials", + "SasDatastoreSecrets", + "ScaleSettings", + "ScaleSettingsInformation", + "Schedule", + "ScheduleActionBase", + "ScheduleBase", + "ScheduleProperties", + "ScheduleResourceArmPaginatedResult", + "ScriptReference", + "ScriptsToExecute", + "Seasonality", + "SecretConfiguration", + "ServiceManagedResourcesSettings", + "ServicePrincipalAuthTypeWorkspaceConnectionProperties", + "ServicePrincipalDatastoreCredentials", + "ServicePrincipalDatastoreSecrets", + "ServiceTagDestination", + "ServiceTagOutboundRule", + "SetupScripts", + "SharedPrivateLinkResource", + "Sku", + "SkuCapacity", + "SkuResource", + "SkuResourceArmPaginatedResult", + "SkuSetting", + "SparkJob", + "SparkJobEntry", + "SparkJobPythonEntry", + "SparkJobScalaEntry", + "SparkResourceConfiguration", + "SslConfiguration", + "StackEnsembleSettings", + "StatusMessage", + "StorageAccountDetails", + "SweepJob", + "SweepJobLimits", + "SynapseSpark", + "SynapseSparkProperties", + "SystemCreatedAcrAccount", + "SystemCreatedStorageAccount", + "SystemData", + "SystemService", + "TableFixedParameters", + "TableParameterSubspace", + "TableSweepSettings", + "TableVertical", + "TableVerticalFeaturizationSettings", + "TableVerticalLimitSettings", + "TargetLags", + "TargetRollingWindowSize", + "TargetUtilizationScaleSettings", + "TensorFlow", + "TextClassification", + "TextClassificationMultilabel", + "TextNer", + "TmpfsOptions", + "TopNFeaturesByAttribution", + "TrackedResource", + "TrainingSettings", + "TrialComponent", + "TriggerBase", + "TritonInferencingServer", + "TritonModelJobInput", + "TritonModelJobOutput", + "TruncationSelectionPolicy", + "UpdateWorkspaceQuotas", + "UpdateWorkspaceQuotasResult", + "UriFileDataVersion", + "UriFileJobInput", + "UriFileJobOutput", + "UriFolderDataVersion", + "UriFolderJobInput", + "UriFolderJobOutput", + "Usage", + "UsageName", + "UserAccountCredentials", + "UserAssignedIdentity", + "UserCreatedAcrAccount", + "UserCreatedStorageAccount", + "UserIdentity", + "UsernamePasswordAuthTypeWorkspaceConnectionProperties", + "VirtualMachine", + "VirtualMachineImage", + "VirtualMachineSchema", + "VirtualMachineSchemaProperties", + "VirtualMachineSecrets", + "VirtualMachineSecretsSchema", + "VirtualMachineSize", + "VirtualMachineSizeListResult", + "VirtualMachineSshCredentials", + "VolumeDefinition", + "VolumeOptions", + "Webhook", + "Workspace", + "WorkspaceConnectionAccessKey", + "WorkspaceConnectionManagedIdentity", + "WorkspaceConnectionPersonalAccessToken", + "WorkspaceConnectionPropertiesV2", + "WorkspaceConnectionPropertiesV2BasicResource", + "WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", + "WorkspaceConnectionServicePrincipal", + "WorkspaceConnectionSharedAccessSignature", + "WorkspaceConnectionUsernamePassword", + "WorkspaceListResult", + "WorkspaceUpdateParameters", + "AllocationState", + "ApplicationSharingPolicy", + "AssetProvisioningState", + "AutoDeleteCondition", + "AutoRebuildSetting", + "Autosave", + "BaseEnvironmentSourceType", + "BatchDeploymentConfigurationType", + "BatchLoggingLevel", + "BatchOutputAction", + "BillingCurrency", + "BlockedTransformers", + "Caching", + "CategoricalDataDriftMetric", + "CategoricalDataQualityMetric", + "CategoricalPredictionDriftMetric", + "ClassificationModelPerformanceMetric", + "ClassificationModels", + "ClassificationMultilabelPrimaryMetrics", + "ClassificationPrimaryMetrics", + "ClusterPurpose", + "ComputeInstanceAuthorizationType", + "ComputeInstanceState", + "ComputePowerAction", + "ComputeType", + "ConnectionAuthType", + "ConnectionCategory", + "ContainerType", + "CreatedByType", + "CredentialsType", + "DataCollectionMode", + "DataImportSourceType", + "DataType", + "DatastoreType", + "DeploymentProvisioningState", + "DiagnoseResultLevel", + "DistributionType", + "EarlyTerminationPolicyType", + "EgressPublicNetworkAccessType", + "EmailNotificationEnableType", + "EncryptionStatus", + "EndpointAuthMode", + "EndpointComputeType", + "EndpointProvisioningState", + "EndpointServiceConnectionStatus", + "EnvironmentType", + "EnvironmentVariableType", + "ExportFormatType", + "FeatureAttributionMetric", + "FeatureDataType", + "FeatureLags", + "FeaturestoreJobType", + "FeaturizationMode", + "ForecastHorizonMode", + "ForecastingModels", + "ForecastingPrimaryMetrics", + "Goal", + "IdentityConfigurationType", + "ImageAnnotationType", + "ImageType", + "IncrementalDataRefresh", + "InferencingServerType", + "InputDeliveryMode", + "InputPathType", + "InstanceSegmentationPrimaryMetrics", + "IsolationMode", + "JobInputType", + "JobLimitsType", + "JobOutputType", + "JobProvisioningState", + "JobStatus", + "JobTier", + "JobType", + "KeyType", + "LearningRateScheduler", + "ListViewType", + "LoadBalancerType", + "LogTrainingMetrics", + "LogValidationLoss", + "LogVerbosity", + "MLAssistConfigurationType", + "MLFlowAutologgerState", + "ManagedNetworkStatus", + "ManagedServiceIdentityType", + "MaterializationStoreType", + "MediaType", + "MlflowAutologger", + "ModelSize", + "MonitoringAlertNotificationType", + "MonitoringFeatureDataType", + "MonitoringFeatureFilterType", + "MonitoringInputDataContext", + "MonitoringModelType", + "MonitoringNotificationMode", + "MonitoringSignalType", + "MountAction", + "MountState", + "MultiSelect", + "NCrossValidationsMode", + "Network", + "NlpLearningRateScheduler", + "NodeState", + "NodesValueType", + "NumericalDataDriftMetric", + "NumericalDataQualityMetric", + "NumericalPredictionDriftMetric", + "ObjectDetectionPrimaryMetrics", + "OneLakeArtifactType", + "OperatingSystemType", + "OperationName", + "OperationStatus", + "OperationTrigger", + "OrderString", + "OsType", + "OutputDeliveryMode", + "PackageBuildState", + "PackageInputDeliveryMode", + "PackageInputType", + "PendingUploadCredentialType", + "PendingUploadType", + "PrivateEndpointConnectionProvisioningState", + "PrivateEndpointServiceConnectionStatus", + "ProtectionLevel", + "Protocol", + "ProvisioningState", + "ProvisioningStatus", + "PublicNetworkAccess", + "PublicNetworkAccessType", + "QuotaUnit", + "RandomSamplingAlgorithmRule", + "RecurrenceFrequency", + "ReferenceType", + "RegressionModelPerformanceMetric", + "RegressionModels", + "RegressionPrimaryMetrics", + "RemoteLoginPortPublicAccess", + "RollingRateType", + "RuleCategory", + "RuleStatus", + "RuleType", + "SamplingAlgorithmType", + "ScaleType", + "ScheduleActionType", + "ScheduleListViewType", + "ScheduleProvisioningState", + "ScheduleProvisioningStatus", + "ScheduleStatus", + "SeasonalityMode", + "SecretsType", + "ServiceDataAccessAuthIdentity", + "ShortSeriesHandlingConfiguration", + "SkuScaleType", + "SkuTier", + "SourceType", + "SparkJobEntryType", + "SshPublicAccess", + "SslConfigStatus", + "StackMetaLearnerType", + "Status", + "StatusMessageLevel", + "StochasticOptimizer", + "StorageAccountType", + "TargetAggregationFunction", + "TargetLagsMode", + "TargetRollingWindowSizeMode", + "TaskType", + "TextAnnotationType", + "TrainingMode", + "TriggerType", + "UnderlyingResourceAction", + "UnitOfMeasure", + "UsageUnit", + "UseStl", + "VMPriceOSType", + "VMTier", + "ValidationMetricType", + "ValueFormat", + "VmPriority", + "VolumeDefinitionType", + "WebhookType", + "WeekDay", ] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/models/_azure_machine_learning_workspaces_enums.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/models/_azure_machine_learning_workspaces_enums.py index c59c16e2e62f..ef6a46b1cc4b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/models/_azure_machine_learning_workspaces_enums.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/models/_azure_machine_learning_workspaces_enums.py @@ -21,6 +21,7 @@ class AllocationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): STEADY = "Steady" RESIZING = "Resizing" + class ApplicationSharingPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Policy for sharing applications on this compute instance among users of parent workspace. If Personal, only the creator can access applications on this compute instance. When Shared, any @@ -30,9 +31,9 @@ class ApplicationSharingPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): PERSONAL = "Personal" SHARED = "Shared" + class AssetProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Provisioning state of registry asset. - """ + """Provisioning state of registry asset.""" SUCCEEDED = "Succeeded" FAILED = "Failed" @@ -41,39 +42,43 @@ class AssetProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): UPDATING = "Updating" DELETING = "Deleting" + class AutoDeleteCondition(str, Enum, metaclass=CaseInsensitiveEnumMeta): CREATED_GREATER_THAN = "CreatedGreaterThan" LAST_ACCESSED_GREATER_THAN = "LastAccessedGreaterThan" + class AutoRebuildSetting(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """AutoRebuild setting for the derived image - """ + """AutoRebuild setting for the derived image""" DISABLED = "Disabled" ON_BASE_IMAGE_UPDATE = "OnBaseImageUpdate" + class Autosave(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Auto save settings. - """ + """Auto save settings.""" NONE = "None" LOCAL = "Local" REMOTE = "Remote" + class BaseEnvironmentSourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Base environment type. - """ + """Base environment type.""" ENVIRONMENT_ASSET = "EnvironmentAsset" -class BatchDeploymentConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The enumerated property types for batch deployments. - """ + +class BatchDeploymentConfigurationType( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """The enumerated property types for batch deployments.""" MODEL = "Model" PIPELINE_COMPONENT = "PipelineComponent" + class BatchLoggingLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Log verbosity for batch inferencing. Increasing verbosity order for logging is : Warning, Info and Debug. @@ -84,22 +89,22 @@ class BatchLoggingLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): WARNING = "Warning" DEBUG = "Debug" + class BatchOutputAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine how batch inferencing will handle output - """ + """Enum to determine how batch inferencing will handle output""" SUMMARY_ONLY = "SummaryOnly" APPEND_ROW = "AppendRow" + class BillingCurrency(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Three lettered code specifying the currency of the VM price. Example: USD - """ + """Three lettered code specifying the currency of the VM price. Example: USD""" USD = "USD" + class BlockedTransformers(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum for all classification models supported by AutoML. - """ + """Enum for all classification models supported by AutoML.""" #: Target encoding for text data. TEXT_TARGET_ENCODER = "TextTargetEncoder" @@ -126,14 +131,15 @@ class BlockedTransformers(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: This is often used for high-cardinality categorical features. HASH_ONE_HOT_ENCODER = "HashOneHotEncoder" + class Caching(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Caching type of Data Disk. - """ + """Caching type of Data Disk.""" NONE = "None" READ_ONLY = "ReadOnly" READ_WRITE = "ReadWrite" + class CategoricalDataDriftMetric(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: The Jensen Shannon Distance (JSD) metric. @@ -143,7 +149,10 @@ class CategoricalDataDriftMetric(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: The Pearsons Chi Squared Test metric. PEARSONS_CHI_SQUARED_TEST = "PearsonsChiSquaredTest" -class CategoricalDataQualityMetric(str, Enum, metaclass=CaseInsensitiveEnumMeta): + +class CategoricalDataQualityMetric( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): #: Calculates the rate of null values. NULL_VALUE_RATE = "NullValueRate" @@ -152,7 +161,10 @@ class CategoricalDataQualityMetric(str, Enum, metaclass=CaseInsensitiveEnumMeta) #: Calculates the rate values are out of bounds. OUT_OF_BOUNDS_RATE = "OutOfBoundsRate" -class CategoricalPredictionDriftMetric(str, Enum, metaclass=CaseInsensitiveEnumMeta): + +class CategoricalPredictionDriftMetric( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): #: The Jensen Shannon Distance (JSD) metric. JENSEN_SHANNON_DISTANCE = "JensenShannonDistance" @@ -161,7 +173,10 @@ class CategoricalPredictionDriftMetric(str, Enum, metaclass=CaseInsensitiveEnumM #: The Pearsons Chi Squared Test metric. PEARSONS_CHI_SQUARED_TEST = "PearsonsChiSquaredTest" -class ClassificationModelPerformanceMetric(str, Enum, metaclass=CaseInsensitiveEnumMeta): + +class ClassificationModelPerformanceMetric( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): #: Calculates the accuracy of the model predictions. ACCURACY = "Accuracy" @@ -172,9 +187,9 @@ class ClassificationModelPerformanceMetric(str, Enum, metaclass=CaseInsensitiveE #: Calculates the F1 score of the model predictions. F1_SCORE = "F1Score" + class ClassificationModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum for all classification models supported by AutoML. - """ + """Enum for all classification models supported by AutoML.""" #: Logistic regression is a fundamental classification technique. #: It belongs to the group of linear classifiers and is somewhat similar to polynomial and linear @@ -236,9 +251,11 @@ class ClassificationModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: target column values can be divided into distinct class values. XG_BOOST_CLASSIFIER = "XGBoostClassifier" -class ClassificationMultilabelPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for classification multilabel tasks. - """ + +class ClassificationMultilabelPrimaryMetrics( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """Primary metrics for classification multilabel tasks.""" #: AUC is the Area under the curve. #: This metric represents arithmetic mean of the score for each class, @@ -258,9 +275,11 @@ class ClassificationMultilabelPrimaryMetrics(str, Enum, metaclass=CaseInsensitiv #: Intersection Over Union. Intersection of predictions divided by union of predictions. IOU = "IOU" -class ClassificationPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for classification tasks. - """ + +class ClassificationPrimaryMetrics( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """Primary metrics for classification tasks.""" #: AUC is the Area under the curve. #: This metric represents arithmetic mean of the score for each class, @@ -278,23 +297,25 @@ class ClassificationPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta) #: class. PRECISION_SCORE_WEIGHTED = "PrecisionScoreWeighted" + class ClusterPurpose(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Intended usage of the cluster - """ + """Intended usage of the cluster""" FAST_PROD = "FastProd" DENSE_PROD = "DenseProd" DEV_TEST = "DevTest" -class ComputeInstanceAuthorizationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The Compute Instance Authorization type. Available values are personal (default). - """ + +class ComputeInstanceAuthorizationType( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """The Compute Instance Authorization type. Available values are personal (default).""" PERSONAL = "personal" + class ComputeInstanceState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Current state of an ComputeInstance. - """ + """Current state of an ComputeInstance.""" CREATING = "Creating" CREATE_FAILED = "CreateFailed" @@ -312,16 +333,16 @@ class ComputeInstanceState(str, Enum, metaclass=CaseInsensitiveEnumMeta): UNKNOWN = "Unknown" UNUSABLE = "Unusable" + class ComputePowerAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """[Required] The compute power action. - """ + """[Required] The compute power action.""" START = "Start" STOP = "Stop" + class ComputeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of compute - """ + """The type of compute""" AKS = "AKS" KUBERNETES = "Kubernetes" @@ -334,9 +355,9 @@ class ComputeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): DATA_LAKE_ANALYTICS = "DataLakeAnalytics" SYNAPSE_SPARK = "SynapseSpark" + class ConnectionAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Authentication type of the connection target - """ + """Authentication type of the connection target""" PAT = "PAT" MANAGED_IDENTITY = "ManagedIdentity" @@ -346,9 +367,9 @@ class ConnectionAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): SERVICE_PRINCIPAL = "ServicePrincipal" ACCESS_KEY = "AccessKey" + class ConnectionCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Category of the connection - """ + """Category of the connection""" PYTHON_FEED = "PythonFeed" CONTAINER_REGISTRY = "ContainerRegistry" @@ -363,9 +384,9 @@ class ConnectionCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): AZURE_DATA_LAKE_GEN2 = "AzureDataLakeGen2" REDIS = "Redis" + class ContainerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of container to retrieve logs from. - """ + """The type of container to retrieve logs from.""" #: The container used to download models and score script. STORAGE_INITIALIZER = "StorageInitializer" @@ -374,18 +395,18 @@ class ContainerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: The container used to collect payload and custom logging when mdc is enabled. MODEL_DATA_COLLECTOR = "ModelDataCollector" + class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of identity that created the resource. - """ + """The type of identity that created the resource.""" USER = "User" APPLICATION = "Application" MANAGED_IDENTITY = "ManagedIdentity" KEY = "Key" + class CredentialsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the datastore credentials type. - """ + """Enum to determine the datastore credentials type.""" ACCOUNT_KEY = "AccountKey" CERTIFICATE = "Certificate" @@ -395,21 +416,22 @@ class CredentialsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): KERBEROS_KEYTAB = "KerberosKeytab" KERBEROS_PASSWORD = "KerberosPassword" + class DataCollectionMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): ENABLED = "Enabled" DISABLED = "Disabled" + class DataImportSourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the type of data. - """ + """Enum to determine the type of data.""" DATABASE = "database" FILE_SYSTEM = "file_system" + class DatastoreType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the datastore contents type. - """ + """Enum to determine the datastore contents type.""" AZURE_BLOB = "AzureBlob" AZURE_DATA_LAKE_GEN1 = "AzureDataLakeGen1" @@ -418,17 +440,19 @@ class DatastoreType(str, Enum, metaclass=CaseInsensitiveEnumMeta): HDFS = "Hdfs" ONE_LAKE = "OneLake" + class DataType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the type of data. - """ + """Enum to determine the type of data.""" URI_FILE = "uri_file" URI_FOLDER = "uri_folder" MLTABLE = "mltable" -class DeploymentProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Possible values for DeploymentProvisioningState. - """ + +class DeploymentProvisioningState( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """Possible values for DeploymentProvisioningState.""" CREATING = "Creating" DELETING = "Deleting" @@ -438,30 +462,34 @@ class DeploymentProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): FAILED = "Failed" CANCELED = "Canceled" + class DiagnoseResultLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Level of workspace setup error - """ + """Level of workspace setup error""" WARNING = "Warning" ERROR = "Error" INFORMATION = "Information" + class DistributionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the job distribution type. - """ + """Enum to determine the job distribution type.""" PY_TORCH = "PyTorch" TENSOR_FLOW = "TensorFlow" MPI = "Mpi" RAY = "Ray" + class EarlyTerminationPolicyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): BANDIT = "Bandit" MEDIAN_STOPPING = "MedianStopping" TRUNCATION_SELECTION = "TruncationSelection" -class EgressPublicNetworkAccessType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + +class EgressPublicNetworkAccessType( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): """Enum to determine whether PublicNetworkAccess is Enabled or Disabled for egress of a deployment. """ @@ -469,40 +497,42 @@ class EgressPublicNetworkAccessType(str, Enum, metaclass=CaseInsensitiveEnumMeta ENABLED = "Enabled" DISABLED = "Disabled" -class EmailNotificationEnableType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the email notification type. - """ + +class EmailNotificationEnableType( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """Enum to determine the email notification type.""" JOB_COMPLETED = "JobCompleted" JOB_FAILED = "JobFailed" JOB_CANCELLED = "JobCancelled" + class EncryptionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates whether or not the encryption is enabled for the workspace. - """ + """Indicates whether or not the encryption is enabled for the workspace.""" ENABLED = "Enabled" DISABLED = "Disabled" + class EndpointAuthMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine endpoint authentication mode. - """ + """Enum to determine endpoint authentication mode.""" AML_TOKEN = "AMLToken" KEY = "Key" AAD_TOKEN = "AADToken" + class EndpointComputeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine endpoint compute type. - """ + """Enum to determine endpoint compute type.""" MANAGED = "Managed" KUBERNETES = "Kubernetes" AZURE_ML_COMPUTE = "AzureMLCompute" + class EndpointProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """State of endpoint provisioning. - """ + """State of endpoint provisioning.""" CREATING = "Creating" DELETING = "Deleting" @@ -511,40 +541,46 @@ class EndpointProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): UPDATING = "Updating" CANCELED = "Canceled" -class EndpointServiceConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Connection status of the service consumer with the service provider - """ + +class EndpointServiceConnectionStatus( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """Connection status of the service consumer with the service provider""" APPROVED = "Approved" PENDING = "Pending" REJECTED = "Rejected" DISCONNECTED = "Disconnected" + class EnvironmentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Environment type is either user created or curated by Azure ML service - """ + """Environment type is either user created or curated by Azure ML service""" CURATED = "Curated" USER_CREATED = "UserCreated" + class EnvironmentVariableType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the Environment Variable. Possible values are: local - For local variable - """ + """Type of the Environment Variable. Possible values are: local - For local variable""" LOCAL = "local" + class ExportFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The format of exported labels. - """ + """The format of exported labels.""" DATASET = "Dataset" COCO = "Coco" CSV = "CSV" + class FeatureAttributionMetric(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: The Normalized Discounted Cumulative Gain metric. - NORMALIZED_DISCOUNTED_CUMULATIVE_GAIN = "NormalizedDiscountedCumulativeGain" + NORMALIZED_DISCOUNTED_CUMULATIVE_GAIN = ( + "NormalizedDiscountedCumulativeGain" + ) + class FeatureDataType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -557,23 +593,24 @@ class FeatureDataType(str, Enum, metaclass=CaseInsensitiveEnumMeta): DATETIME = "Datetime" BOOLEAN = "Boolean" + class FeatureLags(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Flag for generating lags for the numeric features. - """ + """Flag for generating lags for the numeric features.""" #: No feature lags generated. NONE = "None" #: System auto-generates feature lags. AUTO = "Auto" + class FeaturestoreJobType(str, Enum, metaclass=CaseInsensitiveEnumMeta): RECURRENT_MATERIALIZATION = "RecurrentMaterialization" BACKFILL_MATERIALIZATION = "BackfillMaterialization" + class FeaturizationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Featurization mode - determines data featurization mode. - """ + """Featurization mode - determines data featurization mode.""" #: Auto mode, system performs featurization without any custom featurization inputs. AUTO = "Auto" @@ -582,18 +619,18 @@ class FeaturizationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Featurization off. 'Forecasting' task cannot use this value. OFF = "Off" + class ForecastHorizonMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine forecast horizon selection mode. - """ + """Enum to determine forecast horizon selection mode.""" #: Forecast horizon to be determined automatically. AUTO = "Auto" #: Use the custom forecast horizon. CUSTOM = "Custom" + class ForecastingModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum for all forecasting models supported by AutoML. - """ + """Enum for all forecasting models supported by AutoML.""" #: Auto-Autoregressive Integrated Moving Average (ARIMA) model uses time-series data and #: statistical analysis to interpret the data and make future predictions. @@ -670,9 +707,9 @@ class ForecastingModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: using ensemble of base learners. XG_BOOST_REGRESSOR = "XGBoostRegressor" + class ForecastingPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for Forecasting task. - """ + """Primary metrics for Forecasting task.""" #: The Spearman's rank coefficient of correlation is a non-parametric measure of rank correlation. SPEARMAN_CORRELATION = "SpearmanCorrelation" @@ -686,29 +723,30 @@ class ForecastingPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Error (MAE) of (time) series with different scales. NORMALIZED_MEAN_ABSOLUTE_ERROR = "NormalizedMeanAbsoluteError" + class Goal(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Defines supported metric goals for hyperparameter tuning - """ + """Defines supported metric goals for hyperparameter tuning""" MINIMIZE = "Minimize" MAXIMIZE = "Maximize" + class IdentityConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine identity framework. - """ + """Enum to determine identity framework.""" MANAGED = "Managed" AML_TOKEN = "AMLToken" USER_IDENTITY = "UserIdentity" + class ImageAnnotationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Annotation type of image data. - """ + """Annotation type of image data.""" CLASSIFICATION = "Classification" BOUNDING_BOX = "BoundingBox" INSTANCE_SEGMENTATION = "InstanceSegmentation" + class ImageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of the image. Possible values are: docker - For docker images. azureml - For AzureML images @@ -717,25 +755,25 @@ class ImageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): DOCKER = "docker" AZUREML = "azureml" + class IncrementalDataRefresh(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Whether IncrementalDataRefresh is enabled - """ + """Whether IncrementalDataRefresh is enabled""" ENABLED = "Enabled" DISABLED = "Disabled" + class InferencingServerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Inferencing server type for various targets. - """ + """Inferencing server type for various targets.""" AZURE_ML_ONLINE = "AzureMLOnline" AZURE_ML_BATCH = "AzureMLBatch" TRITON = "Triton" CUSTOM = "Custom" + class InputDeliveryMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the input data delivery mode. - """ + """Enum to determine the input data delivery mode.""" READ_ONLY_MOUNT = "ReadOnlyMount" READ_WRITE_MOUNT = "ReadWriteMount" @@ -744,33 +782,35 @@ class InputDeliveryMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): EVAL_MOUNT = "EvalMount" EVAL_DOWNLOAD = "EvalDownload" + class InputPathType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Input path type for package inputs. - """ + """Input path type for package inputs.""" URL = "Url" PATH_ID = "PathId" PATH_VERSION = "PathVersion" -class InstanceSegmentationPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for InstanceSegmentation tasks. - """ + +class InstanceSegmentationPrimaryMetrics( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """Primary metrics for InstanceSegmentation tasks.""" #: Mean Average Precision (MAP) is the average of AP (Average Precision). #: AP is calculated for each class and averaged to get the MAP. MEAN_AVERAGE_PRECISION = "MeanAveragePrecision" + class IsolationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Isolation mode for the managed network of a machine learning workspace. - """ + """Isolation mode for the managed network of a machine learning workspace.""" DISABLED = "Disabled" ALLOW_INTERNET_OUTBOUND = "AllowInternetOutbound" ALLOW_ONLY_APPROVED_OUTBOUND = "AllowOnlyApprovedOutbound" + class JobInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the Job Input Type. - """ + """Enum to determine the Job Input Type.""" LITERAL = "literal" URI_FILE = "uri_file" @@ -780,14 +820,15 @@ class JobInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): MLFLOW_MODEL = "mlflow_model" TRITON_MODEL = "triton_model" + class JobLimitsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): COMMAND = "Command" SWEEP = "Sweep" + class JobOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the Job Output Type. - """ + """Enum to determine the Job Output Type.""" URI_FILE = "uri_file" URI_FOLDER = "uri_folder" @@ -796,18 +837,18 @@ class JobOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): MLFLOW_MODEL = "mlflow_model" TRITON_MODEL = "triton_model" + class JobProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the job provisioning state. - """ + """Enum to determine the job provisioning state.""" SUCCEEDED = "Succeeded" FAILED = "Failed" CANCELED = "Canceled" IN_PROGRESS = "InProgress" + class JobStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The status of a job. - """ + """The status of a job.""" #: Run hasn't started yet. NOT_STARTED = "NotStarted" @@ -845,18 +886,18 @@ class JobStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: The job is in a scheduled state. Job is not in any active state. SCHEDULED = "Scheduled" + class JobTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the job tier. - """ + """Enum to determine the job tier.""" SPOT = "Spot" BASIC = "Basic" STANDARD = "Standard" PREMIUM = "Premium" + class JobType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the type of job. - """ + """Enum to determine the type of job.""" AUTO_ML = "AutoML" COMMAND = "Command" @@ -865,14 +906,15 @@ class JobType(str, Enum, metaclass=CaseInsensitiveEnumMeta): PIPELINE = "Pipeline" SPARK = "Spark" + class KeyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): PRIMARY = "Primary" SECONDARY = "Secondary" + class LearningRateScheduler(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Learning rate scheduler enum. - """ + """Learning rate scheduler enum.""" #: No learning rate scheduler selected. NONE = "None" @@ -881,19 +923,21 @@ class LearningRateScheduler(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Step learning rate scheduler. STEP = "Step" + class ListViewType(str, Enum, metaclass=CaseInsensitiveEnumMeta): ACTIVE_ONLY = "ActiveOnly" ARCHIVED_ONLY = "ArchivedOnly" ALL = "All" + class LoadBalancerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Load Balancer Type - """ + """Load Balancer Type""" PUBLIC_IP = "PublicIp" INTERNAL_LOAD_BALANCER = "InternalLoadBalancer" + class LogTrainingMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Enable compute and log training metrics. @@ -901,6 +945,7 @@ class LogTrainingMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Disable compute and log training metrics. DISABLE = "Disable" + class LogValidationLoss(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Enable compute and log validation metrics. @@ -908,9 +953,9 @@ class LogValidationLoss(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Disable compute and log validation metrics. DISABLE = "Disable" + class LogVerbosity(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum for setting log verbosity. - """ + """Enum for setting log verbosity.""" #: No logs emitted. NOT_SET = "NotSet" @@ -925,13 +970,14 @@ class LogVerbosity(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Only critical statements logged. CRITICAL = "Critical" + class ManagedNetworkStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Status for the managed network of a machine learning workspace. - """ + """Status for the managed network of a machine learning workspace.""" INACTIVE = "Inactive" ACTIVE = "Active" + class ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). @@ -942,6 +988,7 @@ class ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): USER_ASSIGNED = "UserAssigned" SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" + class MaterializationStoreType(str, Enum, metaclass=CaseInsensitiveEnumMeta): NONE = "None" @@ -949,35 +996,36 @@ class MaterializationStoreType(str, Enum, metaclass=CaseInsensitiveEnumMeta): OFFLINE = "Offline" ONLINE_AND_OFFLINE = "OnlineAndOffline" + class MediaType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Media type of data asset. - """ + """Media type of data asset.""" IMAGE = "Image" TEXT = "Text" + class MLAssistConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): ENABLED = "Enabled" DISABLED = "Disabled" + class MlflowAutologger(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates whether mlflow autologger is enabled for notebooks. - """ + """Indicates whether mlflow autologger is enabled for notebooks.""" ENABLED = "Enabled" DISABLED = "Disabled" + class MLFlowAutologgerState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the state of mlflow autologger. - """ + """Enum to determine the state of mlflow autologger.""" ENABLED = "Enabled" DISABLED = "Disabled" + class ModelSize(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Image model size. - """ + """Image model size.""" #: No value selected. NONE = "None" @@ -990,13 +1038,17 @@ class ModelSize(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Extra large size. EXTRA_LARGE = "ExtraLarge" -class MonitoringAlertNotificationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + +class MonitoringAlertNotificationType( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): #: Settings for Azure Monitor based alerting. AZURE_MONITOR = "AzureMonitor" #: Settings for AML email notifications. EMAIL = "Email" + class MonitoringFeatureDataType(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Used for features of numerical data type. @@ -1004,7 +1056,10 @@ class MonitoringFeatureDataType(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Used for features of categorical data type. CATEGORICAL = "Categorical" -class MonitoringFeatureFilterType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + +class MonitoringFeatureFilterType( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): #: Includes all features. ALL_FEATURES = "AllFeatures" @@ -1013,6 +1068,7 @@ class MonitoringFeatureFilterType(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Includes a user-defined subset of features. FEATURE_SUBSET = "FeatureSubset" + class MonitoringInputDataContext(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: A dataset containing the feature input to the model. @@ -1028,6 +1084,7 @@ class MonitoringInputDataContext(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: A dataset containing the ground truth data. GROUND_TRUTH = "GroundTruth" + class MonitoringModelType(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: A model trained for classification tasks. @@ -1035,6 +1092,7 @@ class MonitoringModelType(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: A model trained for regressions tasks. REGRESSION = "Regression" + class MonitoringNotificationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Disabled notifications will not produce emails/metrics leveraged for alerting. @@ -1042,6 +1100,7 @@ class MonitoringNotificationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Enabled notification will produce emails/metrics leveraged for alerting. ENABLED = "Enabled" + class MonitoringSignalType(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Tracks model input data distribution change, comparing against training data or past production @@ -1060,16 +1119,16 @@ class MonitoringSignalType(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Tracks model performance based on ground truth data. MODEL_PERFORMANCE = "ModelPerformance" + class MountAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Mount Action. - """ + """Mount Action.""" MOUNT = "Mount" UNMOUNT = "Unmount" + class MountState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Mount state. - """ + """Mount state.""" MOUNT_REQUESTED = "MountRequested" MOUNTED = "Mounted" @@ -1078,16 +1137,16 @@ class MountState(str, Enum, metaclass=CaseInsensitiveEnumMeta): UNMOUNT_FAILED = "UnmountFailed" UNMOUNTED = "Unmounted" + class MultiSelect(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Whether multiSelect is enabled - """ + """Whether multiSelect is enabled""" ENABLED = "Enabled" DISABLED = "Disabled" + class NCrossValidationsMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Determines how N-Cross validations value is determined. - """ + """Determines how N-Cross validations value is determined.""" #: Determine N-Cross validations value automatically. Supported only for 'Forecasting' AutoML #: task. @@ -1095,16 +1154,16 @@ class NCrossValidationsMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Use custom N-Cross validations value. CUSTOM = "Custom" + class Network(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """network of this container. - """ + """network of this container.""" BRIDGE = "Bridge" HOST = "Host" + class NlpLearningRateScheduler(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum of learning rate schedulers that aligns with those supported by HF - """ + """Enum of learning rate schedulers that aligns with those supported by HF""" #: No learning rate schedule. NONE = "None" @@ -1121,6 +1180,7 @@ class NlpLearningRateScheduler(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Linear warmup followed by constant value. CONSTANT_WITH_WARMUP = "ConstantWithWarmup" + class NodeState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """State of the compute node. Values are idle, running, preparing, unusable, leaving and preempted. @@ -1133,13 +1193,14 @@ class NodeState(str, Enum, metaclass=CaseInsensitiveEnumMeta): LEAVING = "leaving" PREEMPTED = "preempted" + class NodesValueType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The enumerated types for the nodes value - """ + """The enumerated types for the nodes value""" ALL = "All" CUSTOM = "Custom" + class NumericalDataDriftMetric(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: The Jensen Shannon Distance (JSD) metric. @@ -1151,6 +1212,7 @@ class NumericalDataDriftMetric(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: The Two Sample Kolmogorov-Smirnov Test (two-sample K–S) metric. TWO_SAMPLE_KOLMOGOROV_SMIRNOV_TEST = "TwoSampleKolmogorovSmirnovTest" + class NumericalDataQualityMetric(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Calculates the rate of null values. @@ -1160,7 +1222,10 @@ class NumericalDataQualityMetric(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Calculates the rate values are out of bounds. OUT_OF_BOUNDS_RATE = "OutOfBoundsRate" -class NumericalPredictionDriftMetric(str, Enum, metaclass=CaseInsensitiveEnumMeta): + +class NumericalPredictionDriftMetric( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): #: The Jensen Shannon Distance (JSD) metric. JENSEN_SHANNON_DISTANCE = "JensenShannonDistance" @@ -1171,30 +1236,32 @@ class NumericalPredictionDriftMetric(str, Enum, metaclass=CaseInsensitiveEnumMet #: The Two Sample Kolmogorov-Smirnov Test (two-sample K–S) metric. TWO_SAMPLE_KOLMOGOROV_SMIRNOV_TEST = "TwoSampleKolmogorovSmirnovTest" -class ObjectDetectionPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for Image ObjectDetection task. - """ + +class ObjectDetectionPrimaryMetrics( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """Primary metrics for Image ObjectDetection task.""" #: Mean Average Precision (MAP) is the average of AP (Average Precision). #: AP is calculated for each class and averaged to get the MAP. MEAN_AVERAGE_PRECISION = "MeanAveragePrecision" + class OneLakeArtifactType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine OneLake artifact type. - """ + """Enum to determine OneLake artifact type.""" LAKE_HOUSE = "LakeHouse" + class OperatingSystemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of operating system. - """ + """The type of operating system.""" LINUX = "Linux" WINDOWS = "Windows" + class OperationName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Name of the last operation. - """ + """Name of the last operation.""" CREATE = "Create" START = "Start" @@ -1203,9 +1270,9 @@ class OperationName(str, Enum, metaclass=CaseInsensitiveEnumMeta): REIMAGE = "Reimage" DELETE = "Delete" + class OperationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Operation status. - """ + """Operation status.""" IN_PROGRESS = "InProgress" SUCCEEDED = "Succeeded" @@ -1216,14 +1283,15 @@ class OperationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): REIMAGE_FAILED = "ReimageFailed" DELETE_FAILED = "DeleteFailed" + class OperationTrigger(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Trigger of operation. - """ + """Trigger of operation.""" USER = "User" SCHEDULE = "Schedule" IDLE_SHUTDOWN = "IdleShutdown" + class OrderString(str, Enum, metaclass=CaseInsensitiveEnumMeta): CREATED_AT_DESC = "CreatedAtDesc" @@ -1231,69 +1299,75 @@ class OrderString(str, Enum, metaclass=CaseInsensitiveEnumMeta): UPDATED_AT_DESC = "UpdatedAtDesc" UPDATED_AT_ASC = "UpdatedAtAsc" + class OsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Compute OS Type - """ + """Compute OS Type""" LINUX = "Linux" WINDOWS = "Windows" + class OutputDeliveryMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Output data delivery mode enums. - """ + """Output data delivery mode enums.""" READ_WRITE_MOUNT = "ReadWriteMount" UPLOAD = "Upload" DIRECT = "Direct" + class PackageBuildState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Package build state returned in package response. - """ + """Package build state returned in package response.""" NOT_STARTED = "NotStarted" RUNNING = "Running" SUCCEEDED = "Succeeded" FAILED = "Failed" + class PackageInputDeliveryMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Mounting type of the model or the inputs - """ + """Mounting type of the model or the inputs""" READ_ONLY_MOUNT = "ReadOnlyMount" DOWNLOAD = "Download" + class PackageInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the inputs. - """ + """Type of the inputs.""" URI_FILE = "UriFile" URI_FOLDER = "UriFolder" -class PendingUploadCredentialType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the PendingUpload credentials type. - """ + +class PendingUploadCredentialType( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """Enum to determine the PendingUpload credentials type.""" SAS = "SAS" + class PendingUploadType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of storage to use for the pending upload location - """ + """Type of storage to use for the pending upload location""" NONE = "None" TEMPORARY_BLOB_REFERENCE = "TemporaryBlobReference" -class PrivateEndpointConnectionProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The current provisioning state. - """ + +class PrivateEndpointConnectionProvisioningState( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """The current provisioning state.""" SUCCEEDED = "Succeeded" CREATING = "Creating" DELETING = "Deleting" FAILED = "Failed" -class PrivateEndpointServiceConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The private endpoint connection status. - """ + +class PrivateEndpointServiceConnectionStatus( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """The private endpoint connection status.""" PENDING = "Pending" APPROVED = "Approved" @@ -1301,23 +1375,24 @@ class PrivateEndpointServiceConnectionStatus(str, Enum, metaclass=CaseInsensitiv DISCONNECTED = "Disconnected" TIMEOUT = "Timeout" + class ProtectionLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Protection level associated with the Intellectual Property. - """ + """Protection level associated with the Intellectual Property.""" #: All means Intellectual Property is fully protected. ALL = "All" #: None means it is not an Intellectual Property. NONE = "None" + class Protocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Protocol over which communication will happen over this endpoint - """ + """Protocol over which communication will happen over this endpoint""" TCP = "tcp" UDP = "udp" HTTP = "http" + class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The current deployment state of workspace resource. The provisioningState is to indicate states for resource provisioning. @@ -1332,44 +1407,46 @@ class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): CANCELED = "Canceled" SOFT_DELETED = "SoftDeleted" + class ProvisioningStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The current deployment state of schedule. - """ + """The current deployment state of schedule.""" COMPLETED = "Completed" PROVISIONING = "Provisioning" FAILED = "Failed" + class PublicNetworkAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Whether requests from Public Network are allowed. - """ + """Whether requests from Public Network are allowed.""" ENABLED = "Enabled" DISABLED = "Disabled" + class PublicNetworkAccessType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine whether PublicNetworkAccess is Enabled or Disabled. - """ + """Enum to determine whether PublicNetworkAccess is Enabled or Disabled.""" ENABLED = "Enabled" DISABLED = "Disabled" + class QuotaUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """An enum describing the unit of quota measurement. - """ + """An enum describing the unit of quota measurement.""" COUNT = "Count" -class RandomSamplingAlgorithmRule(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The specific type of random algorithm - """ + +class RandomSamplingAlgorithmRule( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """The specific type of random algorithm""" RANDOM = "Random" SOBOL = "Sobol" + class RecurrenceFrequency(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to describe the frequency of a recurrence schedule - """ + """Enum to describe the frequency of a recurrence schedule""" #: Minute frequency. MINUTE = "Minute" @@ -1382,15 +1459,18 @@ class RecurrenceFrequency(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Month frequency. MONTH = "Month" + class ReferenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine which reference method to use for an asset. - """ + """Enum to determine which reference method to use for an asset.""" ID = "Id" DATA_PATH = "DataPath" OUTPUT_PATH = "OutputPath" -class RegressionModelPerformanceMetric(str, Enum, metaclass=CaseInsensitiveEnumMeta): + +class RegressionModelPerformanceMetric( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): #: The Mean Absolute Error (MAE) metric. MEAN_ABSOLUTE_ERROR = "MeanAbsoluteError" @@ -1399,9 +1479,9 @@ class RegressionModelPerformanceMetric(str, Enum, metaclass=CaseInsensitiveEnumM #: The Mean Squared Error (MSE) metric. MEAN_SQUARED_ERROR = "MeanSquaredError" + class RegressionModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum for all Regression models supported by AutoML. - """ + """Enum for all Regression models supported by AutoML.""" #: Elastic net is a popular type of regularized linear regression that combines two popular #: penalties, specifically the L1 and L2 penalty functions. @@ -1443,9 +1523,9 @@ class RegressionModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: using ensemble of base learners. XG_BOOST_REGRESSOR = "XGBoostRegressor" + class RegressionPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Primary metrics for Regression task. - """ + """Primary metrics for Regression task.""" #: The Spearman's rank coefficient of correlation is a nonparametric measure of rank correlation. SPEARMAN_CORRELATION = "SpearmanCorrelation" @@ -1459,7 +1539,10 @@ class RegressionPrimaryMetrics(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Error (MAE) of (time) series with different scales. NORMALIZED_MEAN_ABSOLUTE_ERROR = "NormalizedMeanAbsoluteError" -class RemoteLoginPortPublicAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): + +class RemoteLoginPortPublicAccess( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): """State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - Indicates that the public ssh port is closed @@ -1472,6 +1555,7 @@ class RemoteLoginPortPublicAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): DISABLED = "Disabled" NOT_SPECIFIED = "NotSpecified" + class RollingRateType(str, Enum, metaclass=CaseInsensitiveEnumMeta): YEAR = "Year" @@ -1480,40 +1564,43 @@ class RollingRateType(str, Enum, metaclass=CaseInsensitiveEnumMeta): HOUR = "Hour" MINUTE = "Minute" + class RuleCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Category of a managed network Outbound Rule of a machine learning workspace. - """ + """Category of a managed network Outbound Rule of a machine learning workspace.""" REQUIRED = "Required" RECOMMENDED = "Recommended" USER_DEFINED = "UserDefined" + class RuleStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Status of a managed network Outbound Rule of a machine learning workspace. - """ + """Status of a managed network Outbound Rule of a machine learning workspace.""" INACTIVE = "Inactive" ACTIVE = "Active" + class RuleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of a managed network Outbound Rule of a machine learning workspace. - """ + """Type of a managed network Outbound Rule of a machine learning workspace.""" FQDN = "FQDN" PRIVATE_ENDPOINT = "PrivateEndpoint" SERVICE_TAG = "ServiceTag" + class SamplingAlgorithmType(str, Enum, metaclass=CaseInsensitiveEnumMeta): GRID = "Grid" RANDOM = "Random" BAYESIAN = "Bayesian" + class ScaleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): DEFAULT = "Default" TARGET_UTILIZATION = "TargetUtilization" + class ScheduleActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): CREATE_JOB = "CreateJob" @@ -1521,20 +1608,22 @@ class ScheduleActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): IMPORT_DATA = "ImportData" CREATE_MONITOR = "CreateMonitor" + class ScheduleListViewType(str, Enum, metaclass=CaseInsensitiveEnumMeta): ENABLED_ONLY = "EnabledOnly" DISABLED_ONLY = "DisabledOnly" ALL = "All" + class ScheduleProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The current deployment state of schedule. - """ + """The current deployment state of schedule.""" COMPLETED = "Completed" PROVISIONING = "Provisioning" FAILED = "Failed" + class ScheduleProvisioningStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): CREATING = "Creating" @@ -1544,25 +1633,25 @@ class ScheduleProvisioningStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): FAILED = "Failed" CANCELED = "Canceled" + class ScheduleStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Is the schedule enabled or disabled? - """ + """Is the schedule enabled or disabled?""" ENABLED = "Enabled" DISABLED = "Disabled" + class SeasonalityMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Forecasting seasonality mode. - """ + """Forecasting seasonality mode.""" #: Seasonality to be determined automatically. AUTO = "Auto" #: Use the custom seasonality value. CUSTOM = "Custom" + class SecretsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the datastore secrets type. - """ + """Enum to determine the datastore secrets type.""" ACCOUNT_KEY = "AccountKey" CERTIFICATE = "Certificate" @@ -1571,7 +1660,10 @@ class SecretsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): KERBEROS_PASSWORD = "KerberosPassword" KERBEROS_KEYTAB = "KerberosKeytab" -class ServiceDataAccessAuthIdentity(str, Enum, metaclass=CaseInsensitiveEnumMeta): + +class ServiceDataAccessAuthIdentity( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): #: Do not use any identity for service data access. NONE = "None" @@ -1580,9 +1672,11 @@ class ServiceDataAccessAuthIdentity(str, Enum, metaclass=CaseInsensitiveEnumMeta #: Use the user assigned managed identity of the Workspace to authenticate service data access. WORKSPACE_USER_ASSIGNED_IDENTITY = "WorkspaceUserAssignedIdentity" -class ShortSeriesHandlingConfiguration(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The parameter defining how if AutoML should handle short time series. - """ + +class ShortSeriesHandlingConfiguration( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """The parameter defining how if AutoML should handle short time series.""" #: Represents no/null value. NONE = "None" @@ -1594,9 +1688,9 @@ class ShortSeriesHandlingConfiguration(str, Enum, metaclass=CaseInsensitiveEnumM #: All the short series will be dropped. DROP = "Drop" + class SkuScaleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Node scaling setting for the compute sku. - """ + """Node scaling setting for the compute sku.""" #: Automatically scales node count. AUTOMATIC = "Automatic" @@ -1605,6 +1699,7 @@ class SkuScaleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Fixed set of nodes. NONE = "None" + class SkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): """This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT. @@ -1615,19 +1710,21 @@ class SkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): STANDARD = "Standard" PREMIUM = "Premium" + class SourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Data source type. - """ + """Data source type.""" DATASET = "Dataset" DATASTORE = "Datastore" URI = "URI" + class SparkJobEntryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): SPARK_JOB_PYTHON_ENTRY = "SparkJobPythonEntry" SPARK_JOB_SCALA_ENTRY = "SparkJobScalaEntry" + class SshPublicAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): """State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the public ssh port is open and @@ -1637,14 +1734,15 @@ class SshPublicAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): ENABLED = "Enabled" DISABLED = "Disabled" + class SslConfigStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enable or disable ssl for scoring - """ + """Enable or disable ssl for scoring""" DISABLED = "Disabled" ENABLED = "Enabled" AUTO = "Auto" + class StackMetaLearnerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The meta-learner is a model trained on the output of the individual heterogeneous models. Default meta-learners are LogisticRegression for classification tasks (or LogisticRegressionCV @@ -1667,28 +1765,31 @@ class StackMetaLearnerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): LIGHT_GBM_REGRESSOR = "LightGBMRegressor" LINEAR_REGRESSION = "LinearRegression" + class Status(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Status of update workspace quota. - """ + """Status of update workspace quota.""" UNDEFINED = "Undefined" SUCCESS = "Success" FAILURE = "Failure" INVALID_QUOTA_BELOW_CLUSTER_MINIMUM = "InvalidQuotaBelowClusterMinimum" - INVALID_QUOTA_EXCEEDS_SUBSCRIPTION_LIMIT = "InvalidQuotaExceedsSubscriptionLimit" + INVALID_QUOTA_EXCEEDS_SUBSCRIPTION_LIMIT = ( + "InvalidQuotaExceedsSubscriptionLimit" + ) INVALID_VM_FAMILY_NAME = "InvalidVMFamilyName" OPERATION_NOT_SUPPORTED_FOR_SKU = "OperationNotSupportedForSku" OPERATION_NOT_ENABLED_FOR_REGION = "OperationNotEnabledForRegion" + class StatusMessageLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): ERROR = "Error" INFORMATION = "Information" WARNING = "Warning" + class StochasticOptimizer(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Stochastic optimizer for image models. - """ + """Stochastic optimizer for image models.""" #: No optimizer selected. NONE = "None" @@ -1700,16 +1801,16 @@ class StochasticOptimizer(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: AdamW is a variant of the optimizer Adam that has an improved implementation of weight decay. ADAMW = "Adamw" + class StorageAccountType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """type of this storage account. - """ + """type of this storage account.""" STANDARD_LRS = "Standard_LRS" PREMIUM_LRS = "Premium_LRS" + class TargetAggregationFunction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Target aggregate function. - """ + """Target aggregate function.""" #: Represent no value set. NONE = "None" @@ -1718,27 +1819,29 @@ class TargetAggregationFunction(str, Enum, metaclass=CaseInsensitiveEnumMeta): MIN = "Min" MEAN = "Mean" + class TargetLagsMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Target lags selection modes. - """ + """Target lags selection modes.""" #: Target lags to be determined automatically. AUTO = "Auto" #: Use the custom target lags. CUSTOM = "Custom" -class TargetRollingWindowSizeMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Target rolling windows size mode. - """ + +class TargetRollingWindowSizeMode( + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """Target rolling windows size mode.""" #: Determine rolling windows size automatically. AUTO = "Auto" #: Use the specified rolling window size. CUSTOM = "Custom" + class TaskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """AutoMLJob Task type. - """ + """AutoMLJob Task type.""" #: Classification in machine learning and statistics is a supervised learning approach in which #: the computer program learns from the data given to it and make new observations or @@ -1779,16 +1882,16 @@ class TaskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: occurrences of entities such as people, locations, organizations, and more. TEXT_NER = "TextNER" + class TextAnnotationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Annotation type of text data. - """ + """Annotation type of text data.""" CLASSIFICATION = "Classification" NAMED_ENTITY_RECOGNITION = "NamedEntityRecognition" + class TrainingMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Training mode dictates whether to use distributed training or not - """ + """Training mode dictates whether to use distributed training or not""" #: Auto mode. AUTO = "Auto" @@ -1797,40 +1900,42 @@ class TrainingMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Non distributed training mode. NON_DISTRIBUTED = "NonDistributed" + class TriggerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): RECURRENCE = "Recurrence" CRON = "Cron" + class UnderlyingResourceAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): DELETE = "Delete" DETACH = "Detach" + class UnitOfMeasure(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The unit of time measurement for the specified VM price. Example: OneHour - """ + """The unit of time measurement for the specified VM price. Example: OneHour""" ONE_HOUR = "OneHour" + class UsageUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """An enum describing the unit of usage measurement. - """ + """An enum describing the unit of usage measurement.""" COUNT = "Count" + class UseStl(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Configure STL Decomposition of the time-series target column. - """ + """Configure STL Decomposition of the time-series target column.""" #: No stl decomposition. NONE = "None" SEASON = "Season" SEASON_TREND = "SeasonTrend" + class ValidationMetricType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Metric computation method to use for validation metrics in image tasks. - """ + """Metric computation method to use for validation metrics in image tasks.""" #: No metric. NONE = "None" @@ -1841,52 +1946,52 @@ class ValidationMetricType(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: CocoVoc metric. COCO_VOC = "CocoVoc" + class ValueFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """format for the workspace connection value - """ + """format for the workspace connection value""" JSON = "JSON" + class VMPriceOSType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Operating system type used by the VM. - """ + """Operating system type used by the VM.""" LINUX = "Linux" WINDOWS = "Windows" + class VmPriority(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Virtual Machine priority - """ + """Virtual Machine priority""" DEDICATED = "Dedicated" LOW_PRIORITY = "LowPriority" + class VMTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of the VM. - """ + """The type of the VM.""" STANDARD = "Standard" LOW_PRIORITY = "LowPriority" SPOT = "Spot" + class VolumeDefinitionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe - """ + """Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe""" BIND = "bind" VOLUME = "volume" TMPFS = "tmpfs" NPIPE = "npipe" + class WebhookType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to determine the webhook callback service type. - """ + """Enum to determine the webhook callback service type.""" AZURE_DEV_OPS = "AzureDevOps" + class WeekDay(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum of weekday - """ + """Enum of weekday""" #: Monday weekday. MONDAY = "Monday" diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/models/_models.py index 1165d3eb8142..7bf4e7668083 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/models/_models.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/models/_models.py @@ -37,26 +37,31 @@ class WorkspaceConnectionPropertiesV2(msrest.serialization.Model): """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, + "auth_type": {"key": "authType", "type": "str"}, + "expiry_time": {"key": "expiryTime", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, } _subtype_map = { - 'auth_type': {'AccessKey': 'AccessKeyAuthTypeWorkspaceConnectionProperties', 'ManagedIdentity': 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', 'None': 'NoneAuthTypeWorkspaceConnectionProperties', 'PAT': 'PATAuthTypeWorkspaceConnectionProperties', 'SAS': 'SASAuthTypeWorkspaceConnectionProperties', 'ServicePrincipal': 'ServicePrincipalAuthTypeWorkspaceConnectionProperties', 'UsernamePassword': 'UsernamePasswordAuthTypeWorkspaceConnectionProperties'} + "auth_type": { + "AccessKey": "AccessKeyAuthTypeWorkspaceConnectionProperties", + "ManagedIdentity": "ManagedIdentityAuthTypeWorkspaceConnectionProperties", + "None": "NoneAuthTypeWorkspaceConnectionProperties", + "PAT": "PATAuthTypeWorkspaceConnectionProperties", + "SAS": "SASAuthTypeWorkspaceConnectionProperties", + "ServicePrincipal": "ServicePrincipalAuthTypeWorkspaceConnectionProperties", + "UsernamePassword": "UsernamePasswordAuthTypeWorkspaceConnectionProperties", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword expiry_time: :paramtype expiry_time: str @@ -74,14 +79,16 @@ def __init__( """ super(WorkspaceConnectionPropertiesV2, self).__init__(**kwargs) self.auth_type = None # type: Optional[str] - self.expiry_time = kwargs.get('expiry_time', None) - self.category = kwargs.get('category', None) - self.target = kwargs.get('target', None) - self.value = kwargs.get('value', None) - self.value_format = kwargs.get('value_format', None) + self.expiry_time = kwargs.get("expiry_time", None) + self.category = kwargs.get("category", None) + self.target = kwargs.get("target", None) + self.value = kwargs.get("value", None) + self.value_format = kwargs.get("value_format", None) -class AccessKeyAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class AccessKeyAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """AccessKeyAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -107,23 +114,23 @@ class AccessKeyAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionProperti """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionAccessKey'}, + "auth_type": {"key": "authType", "type": "str"}, + "expiry_time": {"key": "expiryTime", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionAccessKey", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword expiry_time: :paramtype expiry_time: str @@ -141,9 +148,11 @@ def __init__( :keyword credentials: :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccessKey """ - super(AccessKeyAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'AccessKey' # type: str - self.credentials = kwargs.get('credentials', None) + super(AccessKeyAuthTypeWorkspaceConnectionProperties, self).__init__( + **kwargs + ) + self.auth_type = "AccessKey" # type: str + self.credentials = kwargs.get("credentials", None) class DatastoreCredentials(msrest.serialization.Model): @@ -161,23 +170,27 @@ class DatastoreCredentials(msrest.serialization.Model): """ _validation = { - 'credentials_type': {'required': True}, + "credentials_type": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, } _subtype_map = { - 'credentials_type': {'AccountKey': 'AccountKeyDatastoreCredentials', 'Certificate': 'CertificateDatastoreCredentials', 'KerberosKeytab': 'KerberosKeytabCredentials', 'KerberosPassword': 'KerberosPasswordCredentials', 'None': 'NoneDatastoreCredentials', 'Sas': 'SasDatastoreCredentials', 'ServicePrincipal': 'ServicePrincipalDatastoreCredentials'} - } - - def __init__( - self, - **kwargs - ): - """ - """ + "credentials_type": { + "AccountKey": "AccountKeyDatastoreCredentials", + "Certificate": "CertificateDatastoreCredentials", + "KerberosKeytab": "KerberosKeytabCredentials", + "KerberosPassword": "KerberosPasswordCredentials", + "None": "NoneDatastoreCredentials", + "Sas": "SasDatastoreCredentials", + "ServicePrincipal": "ServicePrincipalDatastoreCredentials", + } + } + + def __init__(self, **kwargs): + """ """ super(DatastoreCredentials, self).__init__(**kwargs) self.credentials_type = None # type: Optional[str] @@ -196,26 +209,23 @@ class AccountKeyDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, + "credentials_type": {"required": True}, + "secrets": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'AccountKeyDatastoreSecrets'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "secrets": {"key": "secrets", "type": "AccountKeyDatastoreSecrets"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword secrets: Required. [Required] Storage account secrets. :paramtype secrets: ~azure.mgmt.machinelearningservices.models.AccountKeyDatastoreSecrets """ super(AccountKeyDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'AccountKey' # type: str - self.secrets = kwargs['secrets'] + self.credentials_type = "AccountKey" # type: str + self.secrets = kwargs["secrets"] class DatastoreSecrets(msrest.serialization.Model): @@ -233,23 +243,26 @@ class DatastoreSecrets(msrest.serialization.Model): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, } _subtype_map = { - 'secrets_type': {'AccountKey': 'AccountKeyDatastoreSecrets', 'Certificate': 'CertificateDatastoreSecrets', 'KerberosKeytab': 'KerberosKeytabSecrets', 'KerberosPassword': 'KerberosPasswordSecrets', 'Sas': 'SasDatastoreSecrets', 'ServicePrincipal': 'ServicePrincipalDatastoreSecrets'} - } - - def __init__( - self, - **kwargs - ): - """ - """ + "secrets_type": { + "AccountKey": "AccountKeyDatastoreSecrets", + "Certificate": "CertificateDatastoreSecrets", + "KerberosKeytab": "KerberosKeytabSecrets", + "KerberosPassword": "KerberosPasswordSecrets", + "Sas": "SasDatastoreSecrets", + "ServicePrincipal": "ServicePrincipalDatastoreSecrets", + } + } + + def __init__(self, **kwargs): + """ """ super(DatastoreSecrets, self).__init__(**kwargs) self.secrets_type = None # type: Optional[str] @@ -268,25 +281,22 @@ class AccountKeyDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "key": {"key": "key", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword key: Storage account key. :paramtype key: str """ super(AccountKeyDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'AccountKey' # type: str - self.key = kwargs.get('key', None) + self.secrets_type = "AccountKey" # type: str + self.key = kwargs.get("key", None) class AcrDetails(msrest.serialization.Model): @@ -303,14 +313,17 @@ class AcrDetails(msrest.serialization.Model): """ _attribute_map = { - 'system_created_acr_account': {'key': 'systemCreatedAcrAccount', 'type': 'SystemCreatedAcrAccount'}, - 'user_created_acr_account': {'key': 'userCreatedAcrAccount', 'type': 'UserCreatedAcrAccount'}, + "system_created_acr_account": { + "key": "systemCreatedAcrAccount", + "type": "SystemCreatedAcrAccount", + }, + "user_created_acr_account": { + "key": "userCreatedAcrAccount", + "type": "UserCreatedAcrAccount", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword system_created_acr_account: Details of system created ACR account to be used for the Registry. @@ -322,8 +335,12 @@ def __init__( ~azure.mgmt.machinelearningservices.models.UserCreatedAcrAccount """ super(AcrDetails, self).__init__(**kwargs) - self.system_created_acr_account = kwargs.get('system_created_acr_account', None) - self.user_created_acr_account = kwargs.get('user_created_acr_account', None) + self.system_created_acr_account = kwargs.get( + "system_created_acr_account", None + ) + self.user_created_acr_account = kwargs.get( + "user_created_acr_account", None + ) class AKSSchema(msrest.serialization.Model): @@ -334,19 +351,16 @@ class AKSSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, + "properties": {"key": "properties", "type": "AKSSchemaProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: AKS properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties """ super(AKSSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class Compute(msrest.serialization.Model): @@ -389,35 +403,46 @@ class Compute(msrest.serialization.Model): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } _subtype_map = { - 'compute_type': {'AKS': 'AKS', 'AmlCompute': 'AmlCompute', 'ComputeInstance': 'ComputeInstance', 'DataFactory': 'DataFactory', 'DataLakeAnalytics': 'DataLakeAnalytics', 'Databricks': 'Databricks', 'HDInsight': 'HDInsight', 'Kubernetes': 'Kubernetes', 'SynapseSpark': 'SynapseSpark', 'VirtualMachine': 'VirtualMachine'} - } - - def __init__( - self, - **kwargs - ): + "compute_type": { + "AKS": "AKS", + "AmlCompute": "AmlCompute", + "ComputeInstance": "ComputeInstance", + "DataFactory": "DataFactory", + "DataLakeAnalytics": "DataLakeAnalytics", + "Databricks": "Databricks", + "HDInsight": "HDInsight", + "Kubernetes": "Kubernetes", + "SynapseSpark": "SynapseSpark", + "VirtualMachine": "VirtualMachine", + } + } + + def __init__(self, **kwargs): """ :keyword compute_location: Location for the underlying compute. :paramtype compute_location: str @@ -431,15 +456,15 @@ def __init__( """ super(Compute, self).__init__(**kwargs) self.compute_type = None # type: Optional[str] - self.compute_location = kwargs.get('compute_location', None) + self.compute_location = kwargs.get("compute_location", None) self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) + self.disable_local_auth = kwargs.get("disable_local_auth", None) class AKS(Compute, AKSSchema): @@ -481,32 +506,32 @@ class AKS(Compute, AKSSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "AKSSchemaProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: AKS properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.AKSSchemaProperties @@ -521,17 +546,17 @@ def __init__( :paramtype disable_local_auth: bool """ super(AKS, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'AKS' # type: str - self.compute_location = kwargs.get('compute_location', None) + self.properties = kwargs.get("properties", None) + self.compute_type = "AKS" # type: str + self.compute_location = kwargs.get("compute_location", None) self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) + self.disable_local_auth = kwargs.get("disable_local_auth", None) class AksComputeSecretsProperties(msrest.serialization.Model): @@ -548,15 +573,15 @@ class AksComputeSecretsProperties(msrest.serialization.Model): """ _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, + "user_kube_config": {"key": "userKubeConfig", "type": "str"}, + "admin_kube_config": {"key": "adminKubeConfig", "type": "str"}, + "image_pull_secret_name": { + "key": "imagePullSecretName", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword user_kube_config: Content of kubeconfig file that can be used to connect to the Kubernetes cluster. @@ -568,9 +593,11 @@ def __init__( :paramtype image_pull_secret_name: str """ super(AksComputeSecretsProperties, self).__init__(**kwargs) - self.user_kube_config = kwargs.get('user_kube_config', None) - self.admin_kube_config = kwargs.get('admin_kube_config', None) - self.image_pull_secret_name = kwargs.get('image_pull_secret_name', None) + self.user_kube_config = kwargs.get("user_kube_config", None) + self.admin_kube_config = kwargs.get("admin_kube_config", None) + self.image_pull_secret_name = kwargs.get( + "image_pull_secret_name", None + ) class ComputeSecrets(msrest.serialization.Model): @@ -588,23 +615,23 @@ class ComputeSecrets(msrest.serialization.Model): """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "compute_type": {"key": "computeType", "type": "str"}, } _subtype_map = { - 'compute_type': {'AKS': 'AksComputeSecrets', 'Databricks': 'DatabricksComputeSecrets', 'VirtualMachine': 'VirtualMachineSecrets'} + "compute_type": { + "AKS": "AksComputeSecrets", + "Databricks": "DatabricksComputeSecrets", + "VirtualMachine": "VirtualMachineSecrets", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ComputeSecrets, self).__init__(**kwargs) self.compute_type = None # type: Optional[str] @@ -629,20 +656,20 @@ class AksComputeSecrets(ComputeSecrets, AksComputeSecretsProperties): """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "user_kube_config": {"key": "userKubeConfig", "type": "str"}, + "admin_kube_config": {"key": "adminKubeConfig", "type": "str"}, + "image_pull_secret_name": { + "key": "imagePullSecretName", + "type": "str", + }, + "compute_type": {"key": "computeType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword user_kube_config: Content of kubeconfig file that can be used to connect to the Kubernetes cluster. @@ -654,10 +681,12 @@ def __init__( :paramtype image_pull_secret_name: str """ super(AksComputeSecrets, self).__init__(**kwargs) - self.user_kube_config = kwargs.get('user_kube_config', None) - self.admin_kube_config = kwargs.get('admin_kube_config', None) - self.image_pull_secret_name = kwargs.get('image_pull_secret_name', None) - self.compute_type = 'AKS' # type: str + self.user_kube_config = kwargs.get("user_kube_config", None) + self.admin_kube_config = kwargs.get("admin_kube_config", None) + self.image_pull_secret_name = kwargs.get( + "image_pull_secret_name", None + ) + self.compute_type = "AKS" # type: str class AksNetworkingConfiguration(msrest.serialization.Model): @@ -677,22 +706,25 @@ class AksNetworkingConfiguration(msrest.serialization.Model): """ _validation = { - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, + "service_cidr": { + "pattern": r"^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$" + }, + "dns_service_ip": { + "pattern": r"^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" + }, + "docker_bridge_cidr": { + "pattern": r"^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$" + }, } _attribute_map = { - 'subnet_id': {'key': 'subnetId', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, + "subnet_id": {"key": "subnetId", "type": "str"}, + "service_cidr": {"key": "serviceCidr", "type": "str"}, + "dns_service_ip": {"key": "dnsServiceIP", "type": "str"}, + "docker_bridge_cidr": {"key": "dockerBridgeCidr", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword subnet_id: Virtual network subnet resource ID the compute nodes belong to. :paramtype subnet_id: str @@ -707,10 +739,10 @@ def __init__( :paramtype docker_bridge_cidr: str """ super(AksNetworkingConfiguration, self).__init__(**kwargs) - self.subnet_id = kwargs.get('subnet_id', None) - self.service_cidr = kwargs.get('service_cidr', None) - self.dns_service_ip = kwargs.get('dns_service_ip', None) - self.docker_bridge_cidr = kwargs.get('docker_bridge_cidr', None) + self.subnet_id = kwargs.get("subnet_id", None) + self.service_cidr = kwargs.get("service_cidr", None) + self.dns_service_ip = kwargs.get("dns_service_ip", None) + self.docker_bridge_cidr = kwargs.get("docker_bridge_cidr", None) class AKSSchemaProperties(msrest.serialization.Model): @@ -742,26 +774,32 @@ class AKSSchemaProperties(msrest.serialization.Model): """ _validation = { - 'system_services': {'readonly': True}, - 'agent_count': {'minimum': 0}, + "system_services": {"readonly": True}, + "agent_count": {"minimum": 0}, } _attribute_map = { - 'cluster_fqdn': {'key': 'clusterFqdn', 'type': 'str'}, - 'system_services': {'key': 'systemServices', 'type': '[SystemService]'}, - 'agent_count': {'key': 'agentCount', 'type': 'int'}, - 'agent_vm_size': {'key': 'agentVmSize', 'type': 'str'}, - 'cluster_purpose': {'key': 'clusterPurpose', 'type': 'str'}, - 'ssl_configuration': {'key': 'sslConfiguration', 'type': 'SslConfiguration'}, - 'aks_networking_configuration': {'key': 'aksNetworkingConfiguration', 'type': 'AksNetworkingConfiguration'}, - 'load_balancer_type': {'key': 'loadBalancerType', 'type': 'str'}, - 'load_balancer_subnet': {'key': 'loadBalancerSubnet', 'type': 'str'}, + "cluster_fqdn": {"key": "clusterFqdn", "type": "str"}, + "system_services": { + "key": "systemServices", + "type": "[SystemService]", + }, + "agent_count": {"key": "agentCount", "type": "int"}, + "agent_vm_size": {"key": "agentVmSize", "type": "str"}, + "cluster_purpose": {"key": "clusterPurpose", "type": "str"}, + "ssl_configuration": { + "key": "sslConfiguration", + "type": "SslConfiguration", + }, + "aks_networking_configuration": { + "key": "aksNetworkingConfiguration", + "type": "AksNetworkingConfiguration", + }, + "load_balancer_type": {"key": "loadBalancerType", "type": "str"}, + "load_balancer_subnet": {"key": "loadBalancerSubnet", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword cluster_fqdn: Cluster full qualified domain name. :paramtype cluster_fqdn: str @@ -785,15 +823,17 @@ def __init__( :paramtype load_balancer_subnet: str """ super(AKSSchemaProperties, self).__init__(**kwargs) - self.cluster_fqdn = kwargs.get('cluster_fqdn', None) + self.cluster_fqdn = kwargs.get("cluster_fqdn", None) self.system_services = None - self.agent_count = kwargs.get('agent_count', None) - self.agent_vm_size = kwargs.get('agent_vm_size', None) - self.cluster_purpose = kwargs.get('cluster_purpose', "FastProd") - self.ssl_configuration = kwargs.get('ssl_configuration', None) - self.aks_networking_configuration = kwargs.get('aks_networking_configuration', None) - self.load_balancer_type = kwargs.get('load_balancer_type', "PublicIp") - self.load_balancer_subnet = kwargs.get('load_balancer_subnet', None) + self.agent_count = kwargs.get("agent_count", None) + self.agent_vm_size = kwargs.get("agent_vm_size", None) + self.cluster_purpose = kwargs.get("cluster_purpose", "FastProd") + self.ssl_configuration = kwargs.get("ssl_configuration", None) + self.aks_networking_configuration = kwargs.get( + "aks_networking_configuration", None + ) + self.load_balancer_type = kwargs.get("load_balancer_type", "PublicIp") + self.load_balancer_subnet = kwargs.get("load_balancer_subnet", None) class MonitoringFeatureFilterBase(msrest.serialization.Model): @@ -812,23 +852,23 @@ class MonitoringFeatureFilterBase(msrest.serialization.Model): """ _validation = { - 'filter_type': {'required': True}, + "filter_type": {"required": True}, } _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, + "filter_type": {"key": "filterType", "type": "str"}, } _subtype_map = { - 'filter_type': {'AllFeatures': 'AllFeatures', 'FeatureSubset': 'FeatureSubset', 'TopNByAttribution': 'TopNFeaturesByAttribution'} + "filter_type": { + "AllFeatures": "AllFeatures", + "FeatureSubset": "FeatureSubset", + "TopNByAttribution": "TopNFeaturesByAttribution", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(MonitoringFeatureFilterBase, self).__init__(**kwargs) self.filter_type = None # type: Optional[str] @@ -846,21 +886,17 @@ class AllFeatures(MonitoringFeatureFilterBase): """ _validation = { - 'filter_type': {'required': True}, + "filter_type": {"required": True}, } _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, + "filter_type": {"key": "filterType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AllFeatures, self).__init__(**kwargs) - self.filter_type = 'AllFeatures' # type: str + self.filter_type = "AllFeatures" # type: str class Nodes(msrest.serialization.Model): @@ -877,23 +913,17 @@ class Nodes(msrest.serialization.Model): """ _validation = { - 'nodes_value_type': {'required': True}, + "nodes_value_type": {"required": True}, } _attribute_map = { - 'nodes_value_type': {'key': 'nodesValueType', 'type': 'str'}, + "nodes_value_type": {"key": "nodesValueType", "type": "str"}, } - _subtype_map = { - 'nodes_value_type': {'All': 'AllNodes'} - } + _subtype_map = {"nodes_value_type": {"All": "AllNodes"}} - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Nodes, self).__init__(**kwargs) self.nodes_value_type = None # type: Optional[str] @@ -909,21 +939,17 @@ class AllNodes(Nodes): """ _validation = { - 'nodes_value_type': {'required': True}, + "nodes_value_type": {"required": True}, } _attribute_map = { - 'nodes_value_type': {'key': 'nodesValueType', 'type': 'str'}, + "nodes_value_type": {"key": "nodesValueType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AllNodes, self).__init__(**kwargs) - self.nodes_value_type = 'All' # type: str + self.nodes_value_type = "All" # type: str class AmlComputeSchema(msrest.serialization.Model): @@ -934,19 +960,16 @@ class AmlComputeSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, + "properties": {"key": "properties", "type": "AmlComputeProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of AmlCompute. :paramtype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties """ super(AmlComputeSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class AmlCompute(Compute, AmlComputeSchema): @@ -988,32 +1011,32 @@ class AmlCompute(Compute, AmlComputeSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "AmlComputeProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of AmlCompute. :paramtype properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties @@ -1028,17 +1051,17 @@ def __init__( :paramtype disable_local_auth: bool """ super(AmlCompute, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'AmlCompute' # type: str - self.compute_location = kwargs.get('compute_location', None) + self.properties = kwargs.get("properties", None) + self.compute_type = "AmlCompute" # type: str + self.compute_location = kwargs.get("compute_location", None) self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) + self.disable_local_auth = kwargs.get("disable_local_auth", None) class AmlComputeNodeInformation(msrest.serialization.Model): @@ -1063,29 +1086,25 @@ class AmlComputeNodeInformation(msrest.serialization.Model): """ _validation = { - 'node_id': {'readonly': True}, - 'private_ip_address': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'port': {'readonly': True}, - 'node_state': {'readonly': True}, - 'run_id': {'readonly': True}, + "node_id": {"readonly": True}, + "private_ip_address": {"readonly": True}, + "public_ip_address": {"readonly": True}, + "port": {"readonly": True}, + "node_state": {"readonly": True}, + "run_id": {"readonly": True}, } _attribute_map = { - 'node_id': {'key': 'nodeId', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'node_state': {'key': 'nodeState', 'type': 'str'}, - 'run_id': {'key': 'runId', 'type': 'str'}, + "node_id": {"key": "nodeId", "type": "str"}, + "private_ip_address": {"key": "privateIpAddress", "type": "str"}, + "public_ip_address": {"key": "publicIpAddress", "type": "str"}, + "port": {"key": "port", "type": "int"}, + "node_state": {"key": "nodeState", "type": "str"}, + "run_id": {"key": "runId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AmlComputeNodeInformation, self).__init__(**kwargs) self.node_id = None self.private_ip_address = None @@ -1107,21 +1126,17 @@ class AmlComputeNodesInformation(msrest.serialization.Model): """ _validation = { - 'nodes': {'readonly': True}, - 'next_link': {'readonly': True}, + "nodes": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'nodes': {'key': 'nodes', 'type': '[AmlComputeNodeInformation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "nodes": {"key": "nodes", "type": "[AmlComputeNodeInformation]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AmlComputeNodesInformation, self).__init__(**kwargs) self.nodes = None self.next_link = None @@ -1192,38 +1207,50 @@ class AmlComputeProperties(msrest.serialization.Model): """ _validation = { - 'allocation_state': {'readonly': True}, - 'allocation_state_transition_time': {'readonly': True}, - 'errors': {'readonly': True}, - 'current_node_count': {'readonly': True}, - 'target_node_count': {'readonly': True}, - 'node_state_counts': {'readonly': True}, - } - - _attribute_map = { - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'vm_priority': {'key': 'vmPriority', 'type': 'str'}, - 'virtual_machine_image': {'key': 'virtualMachineImage', 'type': 'VirtualMachineImage'}, - 'isolated_network': {'key': 'isolatedNetwork', 'type': 'bool'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, - 'user_account_credentials': {'key': 'userAccountCredentials', 'type': 'UserAccountCredentials'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'remote_login_port_public_access': {'key': 'remoteLoginPortPublicAccess', 'type': 'str'}, - 'allocation_state': {'key': 'allocationState', 'type': 'str'}, - 'allocation_state_transition_time': {'key': 'allocationStateTransitionTime', 'type': 'iso-8601'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'current_node_count': {'key': 'currentNodeCount', 'type': 'int'}, - 'target_node_count': {'key': 'targetNodeCount', 'type': 'int'}, - 'node_state_counts': {'key': 'nodeStateCounts', 'type': 'NodeStateCounts'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'property_bag': {'key': 'propertyBag', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): + "allocation_state": {"readonly": True}, + "allocation_state_transition_time": {"readonly": True}, + "errors": {"readonly": True}, + "current_node_count": {"readonly": True}, + "target_node_count": {"readonly": True}, + "node_state_counts": {"readonly": True}, + } + + _attribute_map = { + "os_type": {"key": "osType", "type": "str"}, + "vm_size": {"key": "vmSize", "type": "str"}, + "vm_priority": {"key": "vmPriority", "type": "str"}, + "virtual_machine_image": { + "key": "virtualMachineImage", + "type": "VirtualMachineImage", + }, + "isolated_network": {"key": "isolatedNetwork", "type": "bool"}, + "scale_settings": {"key": "scaleSettings", "type": "ScaleSettings"}, + "user_account_credentials": { + "key": "userAccountCredentials", + "type": "UserAccountCredentials", + }, + "subnet": {"key": "subnet", "type": "ResourceId"}, + "remote_login_port_public_access": { + "key": "remoteLoginPortPublicAccess", + "type": "str", + }, + "allocation_state": {"key": "allocationState", "type": "str"}, + "allocation_state_transition_time": { + "key": "allocationStateTransitionTime", + "type": "iso-8601", + }, + "errors": {"key": "errors", "type": "[ErrorResponse]"}, + "current_node_count": {"key": "currentNodeCount", "type": "int"}, + "target_node_count": {"key": "targetNodeCount", "type": "int"}, + "node_state_counts": { + "key": "nodeStateCounts", + "type": "NodeStateCounts", + }, + "enable_node_public_ip": {"key": "enableNodePublicIp", "type": "bool"}, + "property_bag": {"key": "propertyBag", "type": "object"}, + } + + def __init__(self, **kwargs): """ :keyword os_type: Compute OS Type. Possible values include: "Linux", "Windows". Default value: "Linux". @@ -1264,23 +1291,27 @@ def __init__( :paramtype property_bag: any """ super(AmlComputeProperties, self).__init__(**kwargs) - self.os_type = kwargs.get('os_type', "Linux") - self.vm_size = kwargs.get('vm_size', None) - self.vm_priority = kwargs.get('vm_priority', None) - self.virtual_machine_image = kwargs.get('virtual_machine_image', None) - self.isolated_network = kwargs.get('isolated_network', None) - self.scale_settings = kwargs.get('scale_settings', None) - self.user_account_credentials = kwargs.get('user_account_credentials', None) - self.subnet = kwargs.get('subnet', None) - self.remote_login_port_public_access = kwargs.get('remote_login_port_public_access', "NotSpecified") + self.os_type = kwargs.get("os_type", "Linux") + self.vm_size = kwargs.get("vm_size", None) + self.vm_priority = kwargs.get("vm_priority", None) + self.virtual_machine_image = kwargs.get("virtual_machine_image", None) + self.isolated_network = kwargs.get("isolated_network", None) + self.scale_settings = kwargs.get("scale_settings", None) + self.user_account_credentials = kwargs.get( + "user_account_credentials", None + ) + self.subnet = kwargs.get("subnet", None) + self.remote_login_port_public_access = kwargs.get( + "remote_login_port_public_access", "NotSpecified" + ) self.allocation_state = None self.allocation_state_transition_time = None self.errors = None self.current_node_count = None self.target_node_count = None self.node_state_counts = None - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', True) - self.property_bag = kwargs.get('property_bag', None) + self.enable_node_public_ip = kwargs.get("enable_node_public_ip", True) + self.property_bag = kwargs.get("property_bag", None) class AmlOperation(msrest.serialization.Model): @@ -1295,15 +1326,12 @@ class AmlOperation(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'AmlOperationDisplay'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + "name": {"key": "name", "type": "str"}, + "display": {"key": "display", "type": "AmlOperationDisplay"}, + "is_data_action": {"key": "isDataAction", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: Operation name: {provider}/{resource}/{operation}. :paramtype name: str @@ -1313,9 +1341,9 @@ def __init__( :paramtype is_data_action: bool """ super(AmlOperation, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display = kwargs.get('display', None) - self.is_data_action = kwargs.get('is_data_action', None) + self.name = kwargs.get("name", None) + self.display = kwargs.get("display", None) + self.is_data_action = kwargs.get("is_data_action", None) class AmlOperationDisplay(msrest.serialization.Model): @@ -1332,16 +1360,13 @@ class AmlOperationDisplay(msrest.serialization.Model): """ _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, + "provider": {"key": "provider", "type": "str"}, + "resource": {"key": "resource", "type": "str"}, + "operation": {"key": "operation", "type": "str"}, + "description": {"key": "description", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword provider: The resource provider name: Microsoft.MachineLearningExperimentation. :paramtype provider: str @@ -1353,10 +1378,10 @@ def __init__( :paramtype description: str """ super(AmlOperationDisplay, self).__init__(**kwargs) - self.provider = kwargs.get('provider', None) - self.resource = kwargs.get('resource', None) - self.operation = kwargs.get('operation', None) - self.description = kwargs.get('description', None) + self.provider = kwargs.get("provider", None) + self.resource = kwargs.get("resource", None) + self.operation = kwargs.get("operation", None) + self.description = kwargs.get("description", None) class AmlOperationListResult(msrest.serialization.Model): @@ -1367,19 +1392,16 @@ class AmlOperationListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlOperation]'}, + "value": {"key": "value", "type": "[AmlOperation]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: List of AML operations supported by the AML resource provider. :paramtype value: list[~azure.mgmt.machinelearningservices.models.AmlOperation] """ super(AmlOperationListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class IdentityConfiguration(msrest.serialization.Model): @@ -1397,23 +1419,23 @@ class IdentityConfiguration(msrest.serialization.Model): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, } _subtype_map = { - 'identity_type': {'AMLToken': 'AmlToken', 'Managed': 'ManagedIdentity', 'UserIdentity': 'UserIdentity'} + "identity_type": { + "AMLToken": "AmlToken", + "Managed": "ManagedIdentity", + "UserIdentity": "UserIdentity", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(IdentityConfiguration, self).__init__(**kwargs) self.identity_type = None # type: Optional[str] @@ -1430,21 +1452,17 @@ class AmlToken(IdentityConfiguration): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AmlToken, self).__init__(**kwargs) - self.identity_type = 'AMLToken' # type: str + self.identity_type = "AMLToken" # type: str class AmlUserFeature(msrest.serialization.Model): @@ -1459,15 +1477,12 @@ class AmlUserFeature(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "description": {"key": "description", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword id: Specifies the feature ID. :paramtype id: str @@ -1477,9 +1492,9 @@ def __init__( :paramtype description: str """ super(AmlUserFeature, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.display_name = kwargs.get('display_name', None) - self.description = kwargs.get('description', None) + self.id = kwargs.get("id", None) + self.display_name = kwargs.get("display_name", None) + self.description = kwargs.get("description", None) class ArmResourceId(msrest.serialization.Model): @@ -1493,13 +1508,10 @@ class ArmResourceId(msrest.serialization.Model): """ _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, + "resource_id": {"key": "resourceId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword resource_id: Arm ResourceId is in the format "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName}" @@ -1508,7 +1520,7 @@ def __init__( :paramtype resource_id: str """ super(ArmResourceId, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) class ResourceBase(msrest.serialization.Model): @@ -1523,15 +1535,12 @@ class ResourceBase(msrest.serialization.Model): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -1541,9 +1550,9 @@ def __init__( :paramtype tags: dict[str, str] """ super(ResourceBase, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) + self.description = kwargs.get("description", None) + self.properties = kwargs.get("properties", None) + self.tags = kwargs.get("tags", None) class AssetBase(ResourceBase): @@ -1566,18 +1575,18 @@ class AssetBase(ResourceBase): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "auto_delete_setting": { + "key": "autoDeleteSetting", + "type": "AutoDeleteSetting", + }, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -1595,9 +1604,9 @@ def __init__( :paramtype is_archived: bool """ super(AssetBase, self).__init__(**kwargs) - self.auto_delete_setting = kwargs.get('auto_delete_setting', None) - self.is_anonymous = kwargs.get('is_anonymous', False) - self.is_archived = kwargs.get('is_archived', False) + self.auto_delete_setting = kwargs.get("auto_delete_setting", None) + self.is_anonymous = kwargs.get("is_anonymous", False) + self.is_archived = kwargs.get("is_archived", False) class AssetContainer(ResourceBase): @@ -1620,23 +1629,20 @@ class AssetContainer(ResourceBase): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -1648,7 +1654,7 @@ def __init__( :paramtype is_archived: bool """ super(AssetContainer, self).__init__(**kwargs) - self.is_archived = kwargs.get('is_archived', False) + self.is_archived = kwargs.get("is_archived", False) self.latest_version = None self.next_version = None @@ -1666,18 +1672,15 @@ class AssetJobInput(msrest.serialization.Model): """ _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "uri": {"required": True, "min_length": 1, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -1686,8 +1689,8 @@ def __init__( :paramtype uri: str """ super(AssetJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] class AssetJobOutput(msrest.serialization.Model): @@ -1707,17 +1710,17 @@ class AssetJobOutput(msrest.serialization.Model): """ _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, + "asset_name": {"key": "assetName", "type": "str"}, + "asset_version": {"key": "assetVersion", "type": "str"}, + "auto_delete_setting": { + "key": "autoDeleteSetting", + "type": "AutoDeleteSetting", + }, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword asset_name: Output Asset Name. :paramtype asset_name: str @@ -1732,11 +1735,11 @@ def __init__( :paramtype uri: str """ super(AssetJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.asset_version = kwargs.get('asset_version', None) - self.auto_delete_setting = kwargs.get('auto_delete_setting', None) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) + self.asset_name = kwargs.get("asset_name", None) + self.asset_version = kwargs.get("asset_version", None) + self.auto_delete_setting = kwargs.get("auto_delete_setting", None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) class AssetReferenceBase(msrest.serialization.Model): @@ -1753,23 +1756,23 @@ class AssetReferenceBase(msrest.serialization.Model): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, } _subtype_map = { - 'reference_type': {'DataPath': 'DataPathAssetReference', 'Id': 'IdAssetReference', 'OutputPath': 'OutputPathAssetReference'} + "reference_type": { + "DataPath": "DataPathAssetReference", + "Id": "IdAssetReference", + "OutputPath": "OutputPathAssetReference", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AssetReferenceBase, self).__init__(**kwargs) self.reference_type = None # type: Optional[str] @@ -1786,19 +1789,16 @@ class AssignedUser(msrest.serialization.Model): """ _validation = { - 'object_id': {'required': True}, - 'tenant_id': {'required': True}, + "object_id": {"required": True}, + "tenant_id": {"required": True}, } _attribute_map = { - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + "object_id": {"key": "objectId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword object_id: Required. User’s AAD Object Id. :paramtype object_id: str @@ -1806,8 +1806,8 @@ def __init__( :paramtype tenant_id: str """ super(AssignedUser, self).__init__(**kwargs) - self.object_id = kwargs['object_id'] - self.tenant_id = kwargs['tenant_id'] + self.object_id = kwargs["object_id"] + self.tenant_id = kwargs["tenant_id"] class AutoDeleteSetting(msrest.serialization.Model): @@ -1821,14 +1821,11 @@ class AutoDeleteSetting(msrest.serialization.Model): """ _attribute_map = { - 'condition': {'key': 'condition', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "condition": {"key": "condition", "type": "str"}, + "value": {"key": "value", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword condition: When to check if an asset is expired. Possible values include: "CreatedGreaterThan", "LastAccessedGreaterThan". @@ -1837,8 +1834,8 @@ def __init__( :paramtype value: str """ super(AutoDeleteSetting, self).__init__(**kwargs) - self.condition = kwargs.get('condition', None) - self.value = kwargs.get('value', None) + self.condition = kwargs.get("condition", None) + self.value = kwargs.get("value", None) class ForecastHorizon(msrest.serialization.Model): @@ -1855,23 +1852,22 @@ class ForecastHorizon(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoForecastHorizon', 'Custom': 'CustomForecastHorizon'} + "mode": { + "Auto": "AutoForecastHorizon", + "Custom": "CustomForecastHorizon", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ForecastHorizon, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -1887,21 +1883,17 @@ class AutoForecastHorizon(ForecastHorizon): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoForecastHorizon, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class AutologgerSettings(msrest.serialization.Model): @@ -1916,17 +1908,14 @@ class AutologgerSettings(msrest.serialization.Model): """ _validation = { - 'mlflow_autologger': {'required': True}, + "mlflow_autologger": {"required": True}, } _attribute_map = { - 'mlflow_autologger': {'key': 'mlflowAutologger', 'type': 'str'}, + "mlflow_autologger": {"key": "mlflowAutologger", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mlflow_autologger: Required. [Required] Indicates whether mlflow autologger is enabled. Possible values include: "Enabled", "Disabled". @@ -1934,7 +1923,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.MLFlowAutologgerState """ super(AutologgerSettings, self).__init__(**kwargs) - self.mlflow_autologger = kwargs['mlflow_autologger'] + self.mlflow_autologger = kwargs["mlflow_autologger"] class JobBaseProperties(ResourceBase): @@ -1986,35 +1975,45 @@ class JobBaseProperties(ResourceBase): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, + "job_type": {"required": True}, + "status": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "notification_setting": { + "key": "notificationSetting", + "type": "NotificationSetting", + }, + "secrets_configuration": { + "key": "secretsConfiguration", + "type": "{SecretConfiguration}", + }, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, } _subtype_map = { - 'job_type': {'AutoML': 'AutoMLJob', 'Command': 'CommandJob', 'Labeling': 'LabelingJobProperties', 'Pipeline': 'PipelineJob', 'Spark': 'SparkJob', 'Sweep': 'SweepJob'} + "job_type": { + "AutoML": "AutoMLJob", + "Command": "CommandJob", + "Labeling": "LabelingJobProperties", + "Pipeline": "PipelineJob", + "Spark": "SparkJob", + "Sweep": "SweepJob", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -2047,114 +2046,120 @@ def __init__( :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] """ super(JobBaseProperties, self).__init__(**kwargs) - self.component_id = kwargs.get('component_id', None) - self.compute_id = kwargs.get('compute_id', None) - self.display_name = kwargs.get('display_name', None) - self.experiment_name = kwargs.get('experiment_name', "Default") - self.identity = kwargs.get('identity', None) - self.is_archived = kwargs.get('is_archived', False) - self.job_type = 'JobBaseProperties' # type: str - self.notification_setting = kwargs.get('notification_setting', None) - self.secrets_configuration = kwargs.get('secrets_configuration', None) - self.services = kwargs.get('services', None) + self.component_id = kwargs.get("component_id", None) + self.compute_id = kwargs.get("compute_id", None) + self.display_name = kwargs.get("display_name", None) + self.experiment_name = kwargs.get("experiment_name", "Default") + self.identity = kwargs.get("identity", None) + self.is_archived = kwargs.get("is_archived", False) + self.job_type = "JobBaseProperties" # type: str + self.notification_setting = kwargs.get("notification_setting", None) + self.secrets_configuration = kwargs.get("secrets_configuration", None) + self.services = kwargs.get("services", None) self.status = None class AutoMLJob(JobBaseProperties): """AutoMLJob class. -Use this class for executing AutoML tasks like Classification/Regression etc. -See TaskType enum for all the tasks supported. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar environment_id: The ARM resource ID of the Environment specification for the job. - This is optional value to provide, if not provided, AutoML will default this to Production - AutoML curated environment version when running the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - :ivar task_details: Required. [Required] This represents scenario which can be one of - Tables/NLP/Image. - :vartype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical - """ - - _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'task_details': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - 'task_details': {'key': 'taskDetails', 'type': 'AutoMLVertical'}, - } - - def __init__( - self, - **kwargs - ): + Use this class for executing AutoML tasks like Classification/Regression etc. + See TaskType enum for all the tasks supported. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar description: The asset description text. + :vartype description: str + :ivar properties: The asset property dictionary. + :vartype properties: dict[str, str] + :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + :ivar component_id: ARM resource ID of the component resource. + :vartype component_id: str + :ivar compute_id: ARM resource ID of the compute resource. + :vartype compute_id: str + :ivar display_name: Display name of job. + :vartype display_name: str + :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is + placed in the "Default" experiment. + :vartype experiment_name: str + :ivar identity: Identity configuration. If set, this should be one of AmlToken, + ManagedIdentity, UserIdentity or null. + Defaults to AmlToken if null. + :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration + :ivar is_archived: Is the asset archived?. + :vartype is_archived: bool + :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. + Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark". + :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType + :ivar notification_setting: Notification setting for the job. + :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting + :ivar secrets_configuration: Configuration for secrets to be made available during runtime. + :vartype secrets_configuration: dict[str, + ~azure.mgmt.machinelearningservices.models.SecretConfiguration] + :ivar services: List of JobEndpoints. + For local jobs, a job endpoint will have an endpoint value of FileStreamObject. + :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] + :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", + "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", + "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". + :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus + :ivar environment_id: The ARM resource ID of the Environment specification for the job. + This is optional value to provide, if not provided, AutoML will default this to Production + AutoML curated environment version when running the job. + :vartype environment_id: str + :ivar environment_variables: Environment variables included in the job. + :vartype environment_variables: dict[str, str] + :ivar outputs: Mapping of output data bindings used in the job. + :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] + :ivar queue_settings: Queue settings for the job. + :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings + :ivar resources: Compute Resource configuration for the job. + :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration + :ivar task_details: Required. [Required] This represents scenario which can be one of + Tables/NLP/Image. + :vartype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical + """ + + _validation = { + "job_type": {"required": True}, + "status": {"readonly": True}, + "task_details": {"required": True}, + } + + _attribute_map = { + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "notification_setting": { + "key": "notificationSetting", + "type": "NotificationSetting", + }, + "secrets_configuration": { + "key": "secretsConfiguration", + "type": "{SecretConfiguration}", + }, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "queue_settings": {"key": "queueSettings", "type": "QueueSettings"}, + "resources": {"key": "resources", "type": "JobResourceConfiguration"}, + "task_details": {"key": "taskDetails", "type": "AutoMLVertical"}, + } + + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -2202,59 +2207,67 @@ def __init__( :paramtype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical """ super(AutoMLJob, self).__init__(**kwargs) - self.job_type = 'AutoML' # type: str - self.environment_id = kwargs.get('environment_id', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.outputs = kwargs.get('outputs', None) - self.queue_settings = kwargs.get('queue_settings', None) - self.resources = kwargs.get('resources', None) - self.task_details = kwargs['task_details'] + self.job_type = "AutoML" # type: str + self.environment_id = kwargs.get("environment_id", None) + self.environment_variables = kwargs.get("environment_variables", None) + self.outputs = kwargs.get("outputs", None) + self.queue_settings = kwargs.get("queue_settings", None) + self.resources = kwargs.get("resources", None) + self.task_details = kwargs["task_details"] class AutoMLVertical(msrest.serialization.Model): """AutoML vertical class. -Base class for AutoML verticals - TableVertical/ImageVertical/NLPVertical. + Base class for AutoML verticals - TableVertical/ImageVertical/NLPVertical. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Classification, Forecasting, ImageClassification, ImageClassificationMultilabel, ImageInstanceSegmentation, ImageObjectDetection, Regression, TextClassification, TextClassificationMultilabel, TextNer. + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Classification, Forecasting, ImageClassification, ImageClassificationMultilabel, ImageInstanceSegmentation, ImageObjectDetection, Regression, TextClassification, TextClassificationMultilabel, TextNer. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, + "task_type": {"required": True}, + "training_data": {"required": True}, } _attribute_map = { - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, } _subtype_map = { - 'task_type': {'Classification': 'Classification', 'Forecasting': 'Forecasting', 'ImageClassification': 'ImageClassification', 'ImageClassificationMultilabel': 'ImageClassificationMultilabel', 'ImageInstanceSegmentation': 'ImageInstanceSegmentation', 'ImageObjectDetection': 'ImageObjectDetection', 'Regression': 'Regression', 'TextClassification': 'TextClassification', 'TextClassificationMultilabel': 'TextClassificationMultilabel', 'TextNER': 'TextNer'} - } - - def __init__( - self, - **kwargs - ): + "task_type": { + "Classification": "Classification", + "Forecasting": "Forecasting", + "ImageClassification": "ImageClassification", + "ImageClassificationMultilabel": "ImageClassificationMultilabel", + "ImageInstanceSegmentation": "ImageInstanceSegmentation", + "ImageObjectDetection": "ImageObjectDetection", + "Regression": "Regression", + "TextClassification": "TextClassification", + "TextClassificationMultilabel": "TextClassificationMultilabel", + "TextNER": "TextNer", + } + } + + def __init__(self, **kwargs): """ :keyword log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", "Info", "Warning", "Error", "Critical". @@ -2266,10 +2279,10 @@ def __init__( :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ super(AutoMLVertical, self).__init__(**kwargs) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) self.task_type = None # type: Optional[str] - self.training_data = kwargs['training_data'] + self.training_data = kwargs["training_data"] class NCrossValidations(msrest.serialization.Model): @@ -2286,23 +2299,22 @@ class NCrossValidations(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoNCrossValidations', 'Custom': 'CustomNCrossValidations'} + "mode": { + "Auto": "AutoNCrossValidations", + "Custom": "CustomNCrossValidations", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NCrossValidations, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -2318,21 +2330,17 @@ class AutoNCrossValidations(NCrossValidations): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoNCrossValidations, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class AutoPauseProperties(msrest.serialization.Model): @@ -2345,14 +2353,11 @@ class AutoPauseProperties(msrest.serialization.Model): """ _attribute_map = { - 'delay_in_minutes': {'key': 'delayInMinutes', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, + "delay_in_minutes": {"key": "delayInMinutes", "type": "int"}, + "enabled": {"key": "enabled", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword delay_in_minutes: :paramtype delay_in_minutes: int @@ -2360,8 +2365,8 @@ def __init__( :paramtype enabled: bool """ super(AutoPauseProperties, self).__init__(**kwargs) - self.delay_in_minutes = kwargs.get('delay_in_minutes', None) - self.enabled = kwargs.get('enabled', None) + self.delay_in_minutes = kwargs.get("delay_in_minutes", None) + self.enabled = kwargs.get("enabled", None) class AutoScaleProperties(msrest.serialization.Model): @@ -2376,15 +2381,12 @@ class AutoScaleProperties(msrest.serialization.Model): """ _attribute_map = { - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, + "min_node_count": {"key": "minNodeCount", "type": "int"}, + "enabled": {"key": "enabled", "type": "bool"}, + "max_node_count": {"key": "maxNodeCount", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword min_node_count: :paramtype min_node_count: int @@ -2394,9 +2396,9 @@ def __init__( :paramtype max_node_count: int """ super(AutoScaleProperties, self).__init__(**kwargs) - self.min_node_count = kwargs.get('min_node_count', None) - self.enabled = kwargs.get('enabled', None) - self.max_node_count = kwargs.get('max_node_count', None) + self.min_node_count = kwargs.get("min_node_count", None) + self.enabled = kwargs.get("enabled", None) + self.max_node_count = kwargs.get("max_node_count", None) class Seasonality(msrest.serialization.Model): @@ -2413,23 +2415,19 @@ class Seasonality(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoSeasonality', 'Custom': 'CustomSeasonality'} + "mode": {"Auto": "AutoSeasonality", "Custom": "CustomSeasonality"} } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Seasonality, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -2445,21 +2443,17 @@ class AutoSeasonality(Seasonality): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoSeasonality, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class TargetLags(msrest.serialization.Model): @@ -2476,23 +2470,19 @@ class TargetLags(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoTargetLags', 'Custom': 'CustomTargetLags'} + "mode": {"Auto": "AutoTargetLags", "Custom": "CustomTargetLags"} } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(TargetLags, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -2508,21 +2498,17 @@ class AutoTargetLags(TargetLags): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoTargetLags, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class TargetRollingWindowSize(msrest.serialization.Model): @@ -2539,23 +2525,22 @@ class TargetRollingWindowSize(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoTargetRollingWindowSize', 'Custom': 'CustomTargetRollingWindowSize'} + "mode": { + "Auto": "AutoTargetRollingWindowSize", + "Custom": "CustomTargetRollingWindowSize", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(TargetRollingWindowSize, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -2571,21 +2556,17 @@ class AutoTargetRollingWindowSize(TargetRollingWindowSize): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class MonitoringAlertNotificationSettingsBase(msrest.serialization.Model): @@ -2603,28 +2584,32 @@ class MonitoringAlertNotificationSettingsBase(msrest.serialization.Model): """ _validation = { - 'alert_notification_type': {'required': True}, + "alert_notification_type": {"required": True}, } _attribute_map = { - 'alert_notification_type': {'key': 'alertNotificationType', 'type': 'str'}, + "alert_notification_type": { + "key": "alertNotificationType", + "type": "str", + }, } _subtype_map = { - 'alert_notification_type': {'AzureMonitor': 'AzMonMonitoringAlertNotificationSettings', 'Email': 'EmailMonitoringAlertNotificationSettings'} + "alert_notification_type": { + "AzureMonitor": "AzMonMonitoringAlertNotificationSettings", + "Email": "EmailMonitoringAlertNotificationSettings", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(MonitoringAlertNotificationSettingsBase, self).__init__(**kwargs) self.alert_notification_type = None # type: Optional[str] -class AzMonMonitoringAlertNotificationSettings(MonitoringAlertNotificationSettingsBase): +class AzMonMonitoringAlertNotificationSettings( + MonitoringAlertNotificationSettingsBase +): """AzMonMonitoringAlertNotificationSettings. All required parameters must be populated in order to send to Azure. @@ -2636,21 +2621,22 @@ class AzMonMonitoringAlertNotificationSettings(MonitoringAlertNotificationSettin """ _validation = { - 'alert_notification_type': {'required': True}, + "alert_notification_type": {"required": True}, } _attribute_map = { - 'alert_notification_type': {'key': 'alertNotificationType', 'type': 'str'}, + "alert_notification_type": { + "key": "alertNotificationType", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): - """ - """ - super(AzMonMonitoringAlertNotificationSettings, self).__init__(**kwargs) - self.alert_notification_type = 'AzureMonitor' # type: str + def __init__(self, **kwargs): + """ """ + super(AzMonMonitoringAlertNotificationSettings, self).__init__( + **kwargs + ) + self.alert_notification_type = "AzureMonitor" # type: str class AzureDatastore(msrest.serialization.Model): @@ -2663,14 +2649,11 @@ class AzureDatastore(msrest.serialization.Model): """ _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + "resource_group": {"key": "resourceGroup", "type": "str"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword resource_group: Azure Resource Group name. :paramtype resource_group: str @@ -2678,8 +2661,8 @@ def __init__( :paramtype subscription_id: str """ super(AzureDatastore, self).__init__(**kwargs) - self.resource_group = kwargs.get('resource_group', None) - self.subscription_id = kwargs.get('subscription_id', None) + self.resource_group = kwargs.get("resource_group", None) + self.subscription_id = kwargs.get("subscription_id", None) class DatastoreProperties(ResourceBase): @@ -2712,29 +2695,36 @@ class DatastoreProperties(ResourceBase): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "intellectual_property": { + "key": "intellectualProperty", + "type": "IntellectualProperty", + }, + "is_default": {"key": "isDefault", "type": "bool"}, } _subtype_map = { - 'datastore_type': {'AzureBlob': 'AzureBlobDatastore', 'AzureDataLakeGen1': 'AzureDataLakeGen1Datastore', 'AzureDataLakeGen2': 'AzureDataLakeGen2Datastore', 'AzureFile': 'AzureFileDatastore', 'Hdfs': 'HdfsDatastore', 'OneLake': 'OneLakeDatastore'} + "datastore_type": { + "AzureBlob": "AzureBlobDatastore", + "AzureDataLakeGen1": "AzureDataLakeGen1Datastore", + "AzureDataLakeGen2": "AzureDataLakeGen2Datastore", + "AzureFile": "AzureFileDatastore", + "Hdfs": "HdfsDatastore", + "OneLake": "OneLakeDatastore", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -2749,9 +2739,9 @@ def __init__( ~azure.mgmt.machinelearningservices.models.IntellectualProperty """ super(DatastoreProperties, self).__init__(**kwargs) - self.credentials = kwargs['credentials'] - self.datastore_type = 'DatastoreProperties' # type: str - self.intellectual_property = kwargs.get('intellectual_property', None) + self.credentials = kwargs["credentials"] + self.datastore_type = "DatastoreProperties" # type: str + self.intellectual_property = kwargs.get("intellectual_property", None) self.is_default = None @@ -2799,32 +2789,35 @@ class AzureBlobDatastore(DatastoreProperties, AzureDatastore): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, } _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, + "resource_group": {"key": "resourceGroup", "type": "str"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "intellectual_property": { + "key": "intellectualProperty", + "type": "IntellectualProperty", + }, + "is_default": {"key": "isDefault", "type": "bool"}, + "account_name": {"key": "accountName", "type": "str"}, + "container_name": {"key": "containerName", "type": "str"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword resource_group: Azure Resource Group name. :paramtype resource_group: str @@ -2856,19 +2849,21 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ super(AzureBlobDatastore, self).__init__(**kwargs) - self.resource_group = kwargs.get('resource_group', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.datastore_type = 'AzureBlob' # type: str - self.account_name = kwargs.get('account_name', None) - self.container_name = kwargs.get('container_name', None) - self.endpoint = kwargs.get('endpoint', None) - self.protocol = kwargs.get('protocol', None) - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - self.credentials = kwargs['credentials'] - self.intellectual_property = kwargs.get('intellectual_property', None) + self.resource_group = kwargs.get("resource_group", None) + self.subscription_id = kwargs.get("subscription_id", None) + self.datastore_type = "AzureBlob" # type: str + self.account_name = kwargs.get("account_name", None) + self.container_name = kwargs.get("container_name", None) + self.endpoint = kwargs.get("endpoint", None) + self.protocol = kwargs.get("protocol", None) + self.service_data_access_auth_identity = kwargs.get( + "service_data_access_auth_identity", None + ) + self.description = kwargs.get("description", None) + self.properties = kwargs.get("properties", None) + self.tags = kwargs.get("tags", None) + self.credentials = kwargs["credentials"] + self.intellectual_property = kwargs.get("intellectual_property", None) self.is_default = None @@ -2910,30 +2905,37 @@ class AzureDataLakeGen1Datastore(DatastoreProperties, AzureDatastore): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'store_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "store_name": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - 'store_name': {'key': 'storeName', 'type': 'str'}, + "resource_group": {"key": "resourceGroup", "type": "str"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "intellectual_property": { + "key": "intellectualProperty", + "type": "IntellectualProperty", + }, + "is_default": {"key": "isDefault", "type": "bool"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, + "store_name": {"key": "storeName", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword resource_group: Azure Resource Group name. :paramtype resource_group: str @@ -2959,16 +2961,18 @@ def __init__( :paramtype store_name: str """ super(AzureDataLakeGen1Datastore, self).__init__(**kwargs) - self.resource_group = kwargs.get('resource_group', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.datastore_type = 'AzureDataLakeGen1' # type: str - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) - self.store_name = kwargs['store_name'] - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - self.credentials = kwargs['credentials'] - self.intellectual_property = kwargs.get('intellectual_property', None) + self.resource_group = kwargs.get("resource_group", None) + self.subscription_id = kwargs.get("subscription_id", None) + self.datastore_type = "AzureDataLakeGen1" # type: str + self.service_data_access_auth_identity = kwargs.get( + "service_data_access_auth_identity", None + ) + self.store_name = kwargs["store_name"] + self.description = kwargs.get("description", None) + self.properties = kwargs.get("properties", None) + self.tags = kwargs.get("tags", None) + self.credentials = kwargs["credentials"] + self.intellectual_property = kwargs.get("intellectual_property", None) self.is_default = None @@ -3016,34 +3020,45 @@ class AzureDataLakeGen2Datastore(DatastoreProperties, AzureDatastore): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'filesystem': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'filesystem': {'key': 'filesystem', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "account_name": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "filesystem": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + } + + _attribute_map = { + "resource_group": {"key": "resourceGroup", "type": "str"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "intellectual_property": { + "key": "intellectualProperty", + "type": "IntellectualProperty", + }, + "is_default": {"key": "isDefault", "type": "bool"}, + "account_name": {"key": "accountName", "type": "str"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "filesystem": {"key": "filesystem", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, + } + + def __init__(self, **kwargs): """ :keyword resource_group: Azure Resource Group name. :paramtype resource_group: str @@ -3075,19 +3090,21 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ super(AzureDataLakeGen2Datastore, self).__init__(**kwargs) - self.resource_group = kwargs.get('resource_group', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.datastore_type = 'AzureDataLakeGen2' # type: str - self.account_name = kwargs['account_name'] - self.endpoint = kwargs.get('endpoint', None) - self.filesystem = kwargs['filesystem'] - self.protocol = kwargs.get('protocol', None) - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - self.credentials = kwargs['credentials'] - self.intellectual_property = kwargs.get('intellectual_property', None) + self.resource_group = kwargs.get("resource_group", None) + self.subscription_id = kwargs.get("subscription_id", None) + self.datastore_type = "AzureDataLakeGen2" # type: str + self.account_name = kwargs["account_name"] + self.endpoint = kwargs.get("endpoint", None) + self.filesystem = kwargs["filesystem"] + self.protocol = kwargs.get("protocol", None) + self.service_data_access_auth_identity = kwargs.get( + "service_data_access_auth_identity", None + ) + self.description = kwargs.get("description", None) + self.properties = kwargs.get("properties", None) + self.tags = kwargs.get("tags", None) + self.credentials = kwargs["credentials"] + self.intellectual_property = kwargs.get("intellectual_property", None) self.is_default = None @@ -3107,28 +3124,23 @@ class Webhook(msrest.serialization.Model): """ _validation = { - 'webhook_type': {'required': True}, + "webhook_type": {"required": True}, } _attribute_map = { - 'event_type': {'key': 'eventType', 'type': 'str'}, - 'webhook_type': {'key': 'webhookType', 'type': 'str'}, + "event_type": {"key": "eventType", "type": "str"}, + "webhook_type": {"key": "webhookType", "type": "str"}, } - _subtype_map = { - 'webhook_type': {'AzureDevOps': 'AzureDevOpsWebhook'} - } + _subtype_map = {"webhook_type": {"AzureDevOps": "AzureDevOpsWebhook"}} - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword event_type: Send callback on a specified notification event. :paramtype event_type: str """ super(Webhook, self).__init__(**kwargs) - self.event_type = kwargs.get('event_type', None) + self.event_type = kwargs.get("event_type", None) self.webhook_type = None # type: Optional[str] @@ -3145,24 +3157,21 @@ class AzureDevOpsWebhook(Webhook): """ _validation = { - 'webhook_type': {'required': True}, + "webhook_type": {"required": True}, } _attribute_map = { - 'event_type': {'key': 'eventType', 'type': 'str'}, - 'webhook_type': {'key': 'webhookType', 'type': 'str'}, + "event_type": {"key": "eventType", "type": "str"}, + "webhook_type": {"key": "webhookType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword event_type: Send callback on a specified notification event. :paramtype event_type: str """ super(AzureDevOpsWebhook, self).__init__(**kwargs) - self.webhook_type = 'AzureDevOps' # type: str + self.webhook_type = "AzureDevOps" # type: str class AzureFileDatastore(DatastoreProperties, AzureDatastore): @@ -3210,34 +3219,45 @@ class AzureFileDatastore(DatastoreProperties, AzureDatastore): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'file_share_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'file_share_name': {'key': 'fileShareName', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "account_name": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "file_share_name": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + } + + _attribute_map = { + "resource_group": {"key": "resourceGroup", "type": "str"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "intellectual_property": { + "key": "intellectualProperty", + "type": "IntellectualProperty", + }, + "is_default": {"key": "isDefault", "type": "bool"}, + "account_name": {"key": "accountName", "type": "str"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "file_share_name": {"key": "fileShareName", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, + } + + def __init__(self, **kwargs): """ :keyword resource_group: Azure Resource Group name. :paramtype resource_group: str @@ -3270,19 +3290,21 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ super(AzureFileDatastore, self).__init__(**kwargs) - self.resource_group = kwargs.get('resource_group', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.datastore_type = 'AzureFile' # type: str - self.account_name = kwargs['account_name'] - self.endpoint = kwargs.get('endpoint', None) - self.file_share_name = kwargs['file_share_name'] - self.protocol = kwargs.get('protocol', None) - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) - self.description = kwargs.get('description', None) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) - self.credentials = kwargs['credentials'] - self.intellectual_property = kwargs.get('intellectual_property', None) + self.resource_group = kwargs.get("resource_group", None) + self.subscription_id = kwargs.get("subscription_id", None) + self.datastore_type = "AzureFile" # type: str + self.account_name = kwargs["account_name"] + self.endpoint = kwargs.get("endpoint", None) + self.file_share_name = kwargs["file_share_name"] + self.protocol = kwargs.get("protocol", None) + self.service_data_access_auth_identity = kwargs.get( + "service_data_access_auth_identity", None + ) + self.description = kwargs.get("description", None) + self.properties = kwargs.get("properties", None) + self.tags = kwargs.get("tags", None) + self.credentials = kwargs["credentials"] + self.intellectual_property = kwargs.get("intellectual_property", None) self.is_default = None @@ -3300,23 +3322,24 @@ class InferencingServer(msrest.serialization.Model): """ _validation = { - 'server_type': {'required': True}, + "server_type": {"required": True}, } _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, + "server_type": {"key": "serverType", "type": "str"}, } _subtype_map = { - 'server_type': {'AzureMLBatch': 'AzureMLBatchInferencingServer', 'AzureMLOnline': 'AzureMLOnlineInferencingServer', 'Custom': 'CustomInferencingServer', 'Triton': 'TritonInferencingServer'} + "server_type": { + "AzureMLBatch": "AzureMLBatchInferencingServer", + "AzureMLOnline": "AzureMLOnlineInferencingServer", + "Custom": "CustomInferencingServer", + "Triton": "TritonInferencingServer", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(InferencingServer, self).__init__(**kwargs) self.server_type = None # type: Optional[str] @@ -3334,25 +3357,25 @@ class AzureMLBatchInferencingServer(InferencingServer): """ _validation = { - 'server_type': {'required': True}, + "server_type": {"required": True}, } _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, + "server_type": {"key": "serverType", "type": "str"}, + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword code_configuration: Code configuration for AML batch inferencing server. :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration """ super(AzureMLBatchInferencingServer, self).__init__(**kwargs) - self.server_type = 'AzureMLBatch' # type: str - self.code_configuration = kwargs.get('code_configuration', None) + self.server_type = "AzureMLBatch" # type: str + self.code_configuration = kwargs.get("code_configuration", None) class AzureMLOnlineInferencingServer(InferencingServer): @@ -3368,25 +3391,25 @@ class AzureMLOnlineInferencingServer(InferencingServer): """ _validation = { - 'server_type': {'required': True}, + "server_type": {"required": True}, } _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, + "server_type": {"key": "serverType", "type": "str"}, + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword code_configuration: Code configuration for AML inferencing server. :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration """ super(AzureMLOnlineInferencingServer, self).__init__(**kwargs) - self.server_type = 'AzureMLOnline' # type: str - self.code_configuration = kwargs.get('code_configuration', None) + self.server_type = "AzureMLOnline" # type: str + self.code_configuration = kwargs.get("code_configuration", None) class EarlyTerminationPolicy(msrest.serialization.Model): @@ -3408,23 +3431,24 @@ class EarlyTerminationPolicy(msrest.serialization.Model): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, } _subtype_map = { - 'policy_type': {'Bandit': 'BanditPolicy', 'MedianStopping': 'MedianStoppingPolicy', 'TruncationSelection': 'TruncationSelectionPolicy'} + "policy_type": { + "Bandit": "BanditPolicy", + "MedianStopping": "MedianStoppingPolicy", + "TruncationSelection": "TruncationSelectionPolicy", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. :paramtype delay_evaluation: int @@ -3432,8 +3456,8 @@ def __init__( :paramtype evaluation_interval: int """ super(EarlyTerminationPolicy, self).__init__(**kwargs) - self.delay_evaluation = kwargs.get('delay_evaluation', 0) - self.evaluation_interval = kwargs.get('evaluation_interval', 0) + self.delay_evaluation = kwargs.get("delay_evaluation", 0) + self.evaluation_interval = kwargs.get("evaluation_interval", 0) self.policy_type = None # type: Optional[str] @@ -3457,21 +3481,18 @@ class BanditPolicy(EarlyTerminationPolicy): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'slack_amount': {'key': 'slackAmount', 'type': 'float'}, - 'slack_factor': {'key': 'slackFactor', 'type': 'float'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, + "slack_amount": {"key": "slackAmount", "type": "float"}, + "slack_factor": {"key": "slackFactor", "type": "float"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. :paramtype delay_evaluation: int @@ -3483,9 +3504,9 @@ def __init__( :paramtype slack_factor: float """ super(BanditPolicy, self).__init__(**kwargs) - self.policy_type = 'Bandit' # type: str - self.slack_amount = kwargs.get('slack_amount', 0) - self.slack_factor = kwargs.get('slack_factor', 0) + self.policy_type = "Bandit" # type: str + self.slack_amount = kwargs.get("slack_amount", 0) + self.slack_factor = kwargs.get("slack_factor", 0) class BaseEnvironmentSource(msrest.serialization.Model): @@ -3503,23 +3524,24 @@ class BaseEnvironmentSource(msrest.serialization.Model): """ _validation = { - 'base_environment_source_type': {'required': True}, + "base_environment_source_type": {"required": True}, } _attribute_map = { - 'base_environment_source_type': {'key': 'baseEnvironmentSourceType', 'type': 'str'}, + "base_environment_source_type": { + "key": "baseEnvironmentSourceType", + "type": "str", + }, } _subtype_map = { - 'base_environment_source_type': {'EnvironmentAsset': 'BaseEnvironmentId'} + "base_environment_source_type": { + "EnvironmentAsset": "BaseEnvironmentId" + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(BaseEnvironmentSource, self).__init__(**kwargs) self.base_environment_source_type = None # type: Optional[str] @@ -3538,26 +3560,30 @@ class BaseEnvironmentId(BaseEnvironmentSource): """ _validation = { - 'base_environment_source_type': {'required': True}, - 'resource_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "base_environment_source_type": {"required": True}, + "resource_id": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'base_environment_source_type': {'key': 'baseEnvironmentSourceType', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, + "base_environment_source_type": { + "key": "baseEnvironmentSourceType", + "type": "str", + }, + "resource_id": {"key": "resourceId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword resource_id: Required. [Required] Resource id accepting ArmId or AzureMlId. :paramtype resource_id: str """ super(BaseEnvironmentId, self).__init__(**kwargs) - self.base_environment_source_type = 'EnvironmentAsset' # type: str - self.resource_id = kwargs['resource_id'] + self.base_environment_source_type = "EnvironmentAsset" # type: str + self.resource_id = kwargs["resource_id"] class Resource(msrest.serialization.Model): @@ -3579,25 +3605,21 @@ class Resource(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -3630,26 +3652,23 @@ class TrackedResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -3657,8 +3676,8 @@ def __init__( :paramtype location: str """ super(TrackedResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.location = kwargs['location'] + self.tags = kwargs.get("tags", None) + self.location = kwargs["location"] class BatchDeployment(TrackedResource): @@ -3695,31 +3714,31 @@ class BatchDeployment(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchDeploymentProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": { + "key": "properties", + "type": "BatchDeploymentProperties", + }, + "sku": {"key": "sku", "type": "Sku"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -3736,10 +3755,10 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ super(BatchDeployment, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) + self.identity = kwargs.get("identity", None) + self.kind = kwargs.get("kind", None) + self.properties = kwargs["properties"] + self.sku = kwargs.get("sku", None) class BatchDeploymentConfiguration(msrest.serialization.Model): @@ -3757,23 +3776,24 @@ class BatchDeploymentConfiguration(msrest.serialization.Model): """ _validation = { - 'deployment_configuration_type': {'required': True}, + "deployment_configuration_type": {"required": True}, } _attribute_map = { - 'deployment_configuration_type': {'key': 'deploymentConfigurationType', 'type': 'str'}, + "deployment_configuration_type": { + "key": "deploymentConfigurationType", + "type": "str", + }, } _subtype_map = { - 'deployment_configuration_type': {'PipelineComponent': 'BatchPipelineComponentDeploymentConfiguration'} + "deployment_configuration_type": { + "PipelineComponent": "BatchPipelineComponentDeploymentConfiguration" + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(BatchDeploymentConfiguration, self).__init__(**kwargs) self.deployment_configuration_type = None # type: Optional[str] @@ -3795,17 +3815,20 @@ class EndpointDeploymentPropertiesBase(msrest.serialization.Model): """ _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword code_configuration: Code configuration for the endpoint deployment. :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration @@ -3820,11 +3843,11 @@ def __init__( :paramtype properties: dict[str, str] """ super(EndpointDeploymentPropertiesBase, self).__init__(**kwargs) - self.code_configuration = kwargs.get('code_configuration', None) - self.description = kwargs.get('description', None) - self.environment_id = kwargs.get('environment_id', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.properties = kwargs.get('properties', None) + self.code_configuration = kwargs.get("code_configuration", None) + self.description = kwargs.get("description", None) + self.environment_id = kwargs.get("environment_id", None) + self.environment_variables = kwargs.get("environment_variables", None) + self.properties = kwargs.get("properties", None) class BatchDeploymentProperties(EndpointDeploymentPropertiesBase): @@ -3884,33 +3907,48 @@ class BatchDeploymentProperties(EndpointDeploymentPropertiesBase): """ _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'deployment_configuration': {'key': 'deploymentConfiguration', 'type': 'BatchDeploymentConfiguration'}, - 'error_threshold': {'key': 'errorThreshold', 'type': 'int'}, - 'logging_level': {'key': 'loggingLevel', 'type': 'str'}, - 'max_concurrency_per_instance': {'key': 'maxConcurrencyPerInstance', 'type': 'int'}, - 'mini_batch_size': {'key': 'miniBatchSize', 'type': 'long'}, - 'model': {'key': 'model', 'type': 'AssetReferenceBase'}, - 'output_action': {'key': 'outputAction', 'type': 'str'}, - 'output_file_name': {'key': 'outputFileName', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'resources': {'key': 'resources', 'type': 'DeploymentResourceConfiguration'}, - 'retry_settings': {'key': 'retrySettings', 'type': 'BatchRetrySettings'}, - } - - def __init__( - self, - **kwargs - ): + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "compute": {"key": "compute", "type": "str"}, + "deployment_configuration": { + "key": "deploymentConfiguration", + "type": "BatchDeploymentConfiguration", + }, + "error_threshold": {"key": "errorThreshold", "type": "int"}, + "logging_level": {"key": "loggingLevel", "type": "str"}, + "max_concurrency_per_instance": { + "key": "maxConcurrencyPerInstance", + "type": "int", + }, + "mini_batch_size": {"key": "miniBatchSize", "type": "long"}, + "model": {"key": "model", "type": "AssetReferenceBase"}, + "output_action": {"key": "outputAction", "type": "str"}, + "output_file_name": {"key": "outputFileName", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "resources": { + "key": "resources", + "type": "DeploymentResourceConfiguration", + }, + "retry_settings": { + "key": "retrySettings", + "type": "BatchRetrySettings", + }, + } + + def __init__(self, **kwargs): """ :keyword code_configuration: Code configuration for the endpoint deployment. :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration @@ -3960,21 +3998,29 @@ def __init__( :paramtype retry_settings: ~azure.mgmt.machinelearningservices.models.BatchRetrySettings """ super(BatchDeploymentProperties, self).__init__(**kwargs) - self.compute = kwargs.get('compute', None) - self.deployment_configuration = kwargs.get('deployment_configuration', None) - self.error_threshold = kwargs.get('error_threshold', -1) - self.logging_level = kwargs.get('logging_level', None) - self.max_concurrency_per_instance = kwargs.get('max_concurrency_per_instance', 1) - self.mini_batch_size = kwargs.get('mini_batch_size', 10) - self.model = kwargs.get('model', None) - self.output_action = kwargs.get('output_action', None) - self.output_file_name = kwargs.get('output_file_name', "predictions.csv") + self.compute = kwargs.get("compute", None) + self.deployment_configuration = kwargs.get( + "deployment_configuration", None + ) + self.error_threshold = kwargs.get("error_threshold", -1) + self.logging_level = kwargs.get("logging_level", None) + self.max_concurrency_per_instance = kwargs.get( + "max_concurrency_per_instance", 1 + ) + self.mini_batch_size = kwargs.get("mini_batch_size", 10) + self.model = kwargs.get("model", None) + self.output_action = kwargs.get("output_action", None) + self.output_file_name = kwargs.get( + "output_file_name", "predictions.csv" + ) self.provisioning_state = None - self.resources = kwargs.get('resources', None) - self.retry_settings = kwargs.get('retry_settings', None) + self.resources = kwargs.get("resources", None) + self.retry_settings = kwargs.get("retry_settings", None) -class BatchDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class BatchDeploymentTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of BatchDeployment entities. :ivar next_link: The link to the next page of BatchDeployment objects. If null, there are no @@ -3985,14 +4031,11 @@ class BatchDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Mode """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchDeployment]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[BatchDeployment]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of BatchDeployment objects. If null, there are no additional pages. @@ -4000,9 +4043,11 @@ def __init__( :keyword value: An array of objects of type BatchDeployment. :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchDeployment] """ - super(BatchDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(BatchDeploymentTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class BatchEndpoint(TrackedResource): @@ -4039,31 +4084,28 @@ class BatchEndpoint(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": {"key": "properties", "type": "BatchEndpointProperties"}, + "sku": {"key": "sku", "type": "Sku"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -4080,10 +4122,10 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ super(BatchEndpoint, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) + self.identity = kwargs.get("identity", None) + self.kind = kwargs.get("kind", None) + self.properties = kwargs["properties"] + self.sku = kwargs.get("sku", None) class BatchEndpointDefaults(msrest.serialization.Model): @@ -4095,20 +4137,17 @@ class BatchEndpointDefaults(msrest.serialization.Model): """ _attribute_map = { - 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, + "deployment_name": {"key": "deploymentName", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword deployment_name: Name of the deployment that will be default for the endpoint. This deployment will end up getting 100% traffic when the endpoint scoring URL is invoked. :paramtype deployment_name: str """ super(BatchEndpointDefaults, self).__init__(**kwargs) - self.deployment_name = kwargs.get('deployment_name', None) + self.deployment_name = kwargs.get("deployment_name", None) class EndpointPropertiesBase(msrest.serialization.Model): @@ -4137,24 +4176,21 @@ class EndpointPropertiesBase(msrest.serialization.Model): """ _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, + "auth_mode": {"required": True}, + "scoring_uri": {"readonly": True}, + "swagger_uri": {"readonly": True}, } _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, + "auth_mode": {"key": "authMode", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "keys": {"key": "keys", "type": "EndpointAuthKeys"}, + "properties": {"key": "properties", "type": "{str}"}, + "scoring_uri": {"key": "scoringUri", "type": "str"}, + "swagger_uri": {"key": "swaggerUri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' @@ -4170,10 +4206,10 @@ def __init__( :paramtype properties: dict[str, str] """ super(EndpointPropertiesBase, self).__init__(**kwargs) - self.auth_mode = kwargs['auth_mode'] - self.description = kwargs.get('description', None) - self.keys = kwargs.get('keys', None) - self.properties = kwargs.get('properties', None) + self.auth_mode = kwargs["auth_mode"] + self.description = kwargs.get("description", None) + self.keys = kwargs.get("keys", None) + self.properties = kwargs.get("properties", None) self.scoring_uri = None self.swagger_uri = None @@ -4210,27 +4246,24 @@ class BatchEndpointProperties(EndpointPropertiesBase): """ _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "auth_mode": {"required": True}, + "scoring_uri": {"readonly": True}, + "swagger_uri": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'defaults': {'key': 'defaults', 'type': 'BatchEndpointDefaults'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "auth_mode": {"key": "authMode", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "keys": {"key": "keys", "type": "EndpointAuthKeys"}, + "properties": {"key": "properties", "type": "{str}"}, + "scoring_uri": {"key": "scoringUri", "type": "str"}, + "swagger_uri": {"key": "swaggerUri", "type": "str"}, + "defaults": {"key": "defaults", "type": "BatchEndpointDefaults"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' @@ -4248,11 +4281,13 @@ def __init__( :paramtype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults """ super(BatchEndpointProperties, self).__init__(**kwargs) - self.defaults = kwargs.get('defaults', None) + self.defaults = kwargs.get("defaults", None) self.provisioning_state = None -class BatchEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class BatchEndpointTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of BatchEndpoint entities. :ivar next_link: The link to the next page of BatchEndpoint objects. If null, there are no @@ -4263,14 +4298,11 @@ class BatchEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model) """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchEndpoint]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[BatchEndpoint]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of BatchEndpoint objects. If null, there are no additional pages. @@ -4278,12 +4310,16 @@ def __init__( :keyword value: An array of objects of type BatchEndpoint. :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchEndpoint] """ - super(BatchEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(BatchEndpointTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) -class BatchPipelineComponentDeploymentConfiguration(BatchDeploymentConfiguration): +class BatchPipelineComponentDeploymentConfiguration( + BatchDeploymentConfiguration +): """Properties for a Batch Pipeline Component Deployment. All required parameters must be populated in order to send to Azure. @@ -4303,21 +4339,21 @@ class BatchPipelineComponentDeploymentConfiguration(BatchDeploymentConfiguration """ _validation = { - 'deployment_configuration_type': {'required': True}, + "deployment_configuration_type": {"required": True}, } _attribute_map = { - 'deployment_configuration_type': {'key': 'deploymentConfigurationType', 'type': 'str'}, - 'component_id': {'key': 'componentId', 'type': 'IdAssetReference'}, - 'description': {'key': 'description', 'type': 'str'}, - 'settings': {'key': 'settings', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "deployment_configuration_type": { + "key": "deploymentConfigurationType", + "type": "str", + }, + "component_id": {"key": "componentId", "type": "IdAssetReference"}, + "description": {"key": "description", "type": "str"}, + "settings": {"key": "settings", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword component_id: The ARM id of the component to be run. :paramtype component_id: ~azure.mgmt.machinelearningservices.models.IdAssetReference @@ -4328,12 +4364,14 @@ def __init__( :keyword tags: A set of tags. The tags which will be applied to the job. :paramtype tags: dict[str, str] """ - super(BatchPipelineComponentDeploymentConfiguration, self).__init__(**kwargs) - self.deployment_configuration_type = 'PipelineComponent' # type: str - self.component_id = kwargs.get('component_id', None) - self.description = kwargs.get('description', None) - self.settings = kwargs.get('settings', None) - self.tags = kwargs.get('tags', None) + super(BatchPipelineComponentDeploymentConfiguration, self).__init__( + **kwargs + ) + self.deployment_configuration_type = "PipelineComponent" # type: str + self.component_id = kwargs.get("component_id", None) + self.description = kwargs.get("description", None) + self.settings = kwargs.get("settings", None) + self.tags = kwargs.get("tags", None) class BatchRetrySettings(msrest.serialization.Model): @@ -4346,14 +4384,11 @@ class BatchRetrySettings(msrest.serialization.Model): """ _attribute_map = { - 'max_retries': {'key': 'maxRetries', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "max_retries": {"key": "maxRetries", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword max_retries: Maximum retry count for a mini-batch. :paramtype max_retries: int @@ -4361,44 +4396,47 @@ def __init__( :paramtype timeout: ~datetime.timedelta """ super(BatchRetrySettings, self).__init__(**kwargs) - self.max_retries = kwargs.get('max_retries', 3) - self.timeout = kwargs.get('timeout', "PT30S") + self.max_retries = kwargs.get("max_retries", 3) + self.timeout = kwargs.get("timeout", "PT30S") class SamplingAlgorithm(msrest.serialization.Model): """The Sampling Algorithm used to generate hyperparameter values, along with properties to -configure the algorithm. + configure the algorithm. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BayesianSamplingAlgorithm, GridSamplingAlgorithm, RandomSamplingAlgorithm. + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: BayesianSamplingAlgorithm, GridSamplingAlgorithm, RandomSamplingAlgorithm. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType + :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating + hyperparameter values, along with configuration properties.Constant filled by server. Possible + values include: "Grid", "Random", "Bayesian". + :vartype sampling_algorithm_type: str or + ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } _subtype_map = { - 'sampling_algorithm_type': {'Bayesian': 'BayesianSamplingAlgorithm', 'Grid': 'GridSamplingAlgorithm', 'Random': 'RandomSamplingAlgorithm'} + "sampling_algorithm_type": { + "Bayesian": "BayesianSamplingAlgorithm", + "Grid": "GridSamplingAlgorithm", + "Random": "RandomSamplingAlgorithm", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(SamplingAlgorithm, self).__init__(**kwargs) self.sampling_algorithm_type = None # type: Optional[str] @@ -4416,21 +4454,20 @@ class BayesianSamplingAlgorithm(SamplingAlgorithm): """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(BayesianSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Bayesian' # type: str + self.sampling_algorithm_type = "Bayesian" # type: str class BindOptions(msrest.serialization.Model): @@ -4445,15 +4482,12 @@ class BindOptions(msrest.serialization.Model): """ _attribute_map = { - 'propagation': {'key': 'propagation', 'type': 'str'}, - 'create_host_path': {'key': 'createHostPath', 'type': 'bool'}, - 'selinux': {'key': 'selinux', 'type': 'str'}, + "propagation": {"key": "propagation", "type": "str"}, + "create_host_path": {"key": "createHostPath", "type": "bool"}, + "selinux": {"key": "selinux", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword propagation: Type of Bind Option. :paramtype propagation: str @@ -4463,9 +4497,9 @@ def __init__( :paramtype selinux: str """ super(BindOptions, self).__init__(**kwargs) - self.propagation = kwargs.get('propagation', None) - self.create_host_path = kwargs.get('create_host_path', None) - self.selinux = kwargs.get('selinux', None) + self.propagation = kwargs.get("propagation", None) + self.create_host_path = kwargs.get("create_host_path", None) + self.selinux = kwargs.get("selinux", None) class BlobReferenceForConsumptionDto(msrest.serialization.Model): @@ -4481,15 +4515,18 @@ class BlobReferenceForConsumptionDto(msrest.serialization.Model): """ _attribute_map = { - 'blob_uri': {'key': 'blobUri', 'type': 'str'}, - 'credential': {'key': 'credential', 'type': 'PendingUploadCredentialDto'}, - 'storage_account_arm_id': {'key': 'storageAccountArmId', 'type': 'str'}, + "blob_uri": {"key": "blobUri", "type": "str"}, + "credential": { + "key": "credential", + "type": "PendingUploadCredentialDto", + }, + "storage_account_arm_id": { + "key": "storageAccountArmId", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword blob_uri: Blob URI path for client to upload data. Example: https://blob.windows.core.net/Container/Path. @@ -4500,9 +4537,11 @@ def __init__( :paramtype storage_account_arm_id: str """ super(BlobReferenceForConsumptionDto, self).__init__(**kwargs) - self.blob_uri = kwargs.get('blob_uri', None) - self.credential = kwargs.get('credential', None) - self.storage_account_arm_id = kwargs.get('storage_account_arm_id', None) + self.blob_uri = kwargs.get("blob_uri", None) + self.credential = kwargs.get("credential", None) + self.storage_account_arm_id = kwargs.get( + "storage_account_arm_id", None + ) class BuildContext(msrest.serialization.Model): @@ -4512,56 +4551,57 @@ class BuildContext(msrest.serialization.Model): :ivar context_uri: Required. [Required] URI of the Docker build context used to build the image. Supports blob URIs on environment creation and may return blob or Git URIs. - - + + .. raw:: html - + . :vartype context_uri: str :ivar dockerfile_path: Path to the Dockerfile in the build context. - - + + .. raw:: html - + . :vartype dockerfile_path: str """ _validation = { - 'context_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "context_uri": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'context_uri': {'key': 'contextUri', 'type': 'str'}, - 'dockerfile_path': {'key': 'dockerfilePath', 'type': 'str'}, + "context_uri": {"key": "contextUri", "type": "str"}, + "dockerfile_path": {"key": "dockerfilePath", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword context_uri: Required. [Required] URI of the Docker build context used to build the image. Supports blob URIs on environment creation and may return blob or Git URIs. - - + + .. raw:: html - + . :paramtype context_uri: str :keyword dockerfile_path: Path to the Dockerfile in the build context. - - + + .. raw:: html - + . :paramtype dockerfile_path: str """ super(BuildContext, self).__init__(**kwargs) - self.context_uri = kwargs['context_uri'] - self.dockerfile_path = kwargs.get('dockerfile_path', "Dockerfile") + self.context_uri = kwargs["context_uri"] + self.dockerfile_path = kwargs.get("dockerfile_path", "Dockerfile") class DataDriftMetricThresholdBase(msrest.serialization.Model): @@ -4581,22 +4621,22 @@ class DataDriftMetricThresholdBase(msrest.serialization.Model): """ _validation = { - 'data_type': {'required': True}, + "data_type": {"required": True}, } _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, + "data_type": {"key": "dataType", "type": "str"}, + "threshold": {"key": "threshold", "type": "MonitoringThreshold"}, } _subtype_map = { - 'data_type': {'Categorical': 'CategoricalDataDriftMetricThreshold', 'Numerical': 'NumericalDataDriftMetricThreshold'} + "data_type": { + "Categorical": "CategoricalDataDriftMetricThreshold", + "Numerical": "NumericalDataDriftMetricThreshold", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword threshold: The threshold value. If null, a default value will be set depending on the selected metric. @@ -4604,7 +4644,7 @@ def __init__( """ super(DataDriftMetricThresholdBase, self).__init__(**kwargs) self.data_type = None # type: Optional[str] - self.threshold = kwargs.get('threshold', None) + self.threshold = kwargs.get("threshold", None) class CategoricalDataDriftMetricThreshold(DataDriftMetricThresholdBase): @@ -4624,20 +4664,17 @@ class CategoricalDataDriftMetricThreshold(DataDriftMetricThresholdBase): """ _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, + "data_type": {"required": True}, + "metric": {"required": True}, } _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, + "data_type": {"key": "dataType", "type": "str"}, + "threshold": {"key": "threshold", "type": "MonitoringThreshold"}, + "metric": {"key": "metric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword threshold: The threshold value. If null, a default value will be set depending on the selected metric. @@ -4647,8 +4684,8 @@ def __init__( :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.CategoricalDataDriftMetric """ super(CategoricalDataDriftMetricThreshold, self).__init__(**kwargs) - self.data_type = 'Categorical' # type: str - self.metric = kwargs['metric'] + self.data_type = "Categorical" # type: str + self.metric = kwargs["metric"] class DataQualityMetricThresholdBase(msrest.serialization.Model): @@ -4668,22 +4705,22 @@ class DataQualityMetricThresholdBase(msrest.serialization.Model): """ _validation = { - 'data_type': {'required': True}, + "data_type": {"required": True}, } _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, + "data_type": {"key": "dataType", "type": "str"}, + "threshold": {"key": "threshold", "type": "MonitoringThreshold"}, } _subtype_map = { - 'data_type': {'Categorical': 'CategoricalDataQualityMetricThreshold', 'Numerical': 'NumericalDataQualityMetricThreshold'} + "data_type": { + "Categorical": "CategoricalDataQualityMetricThreshold", + "Numerical": "NumericalDataQualityMetricThreshold", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword threshold: The threshold value. If null, a default value will be set depending on the selected metric. @@ -4691,7 +4728,7 @@ def __init__( """ super(DataQualityMetricThresholdBase, self).__init__(**kwargs) self.data_type = None # type: Optional[str] - self.threshold = kwargs.get('threshold', None) + self.threshold = kwargs.get("threshold", None) class CategoricalDataQualityMetricThreshold(DataQualityMetricThresholdBase): @@ -4711,20 +4748,17 @@ class CategoricalDataQualityMetricThreshold(DataQualityMetricThresholdBase): """ _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, + "data_type": {"required": True}, + "metric": {"required": True}, } _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, + "data_type": {"key": "dataType", "type": "str"}, + "threshold": {"key": "threshold", "type": "MonitoringThreshold"}, + "metric": {"key": "metric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword threshold: The threshold value. If null, a default value will be set depending on the selected metric. @@ -4735,8 +4769,8 @@ def __init__( ~azure.mgmt.machinelearningservices.models.CategoricalDataQualityMetric """ super(CategoricalDataQualityMetricThreshold, self).__init__(**kwargs) - self.data_type = 'Categorical' # type: str - self.metric = kwargs['metric'] + self.data_type = "Categorical" # type: str + self.metric = kwargs["metric"] class PredictionDriftMetricThresholdBase(msrest.serialization.Model): @@ -4756,22 +4790,22 @@ class PredictionDriftMetricThresholdBase(msrest.serialization.Model): """ _validation = { - 'data_type': {'required': True}, + "data_type": {"required": True}, } _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, + "data_type": {"key": "dataType", "type": "str"}, + "threshold": {"key": "threshold", "type": "MonitoringThreshold"}, } _subtype_map = { - 'data_type': {'Categorical': 'CategoricalPredictionDriftMetricThreshold', 'Numerical': 'NumericalPredictionDriftMetricThreshold'} + "data_type": { + "Categorical": "CategoricalPredictionDriftMetricThreshold", + "Numerical": "NumericalPredictionDriftMetricThreshold", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword threshold: The threshold value. If null, a default value will be set depending on the selected metric. @@ -4779,10 +4813,12 @@ def __init__( """ super(PredictionDriftMetricThresholdBase, self).__init__(**kwargs) self.data_type = None # type: Optional[str] - self.threshold = kwargs.get('threshold', None) + self.threshold = kwargs.get("threshold", None) -class CategoricalPredictionDriftMetricThreshold(PredictionDriftMetricThresholdBase): +class CategoricalPredictionDriftMetricThreshold( + PredictionDriftMetricThresholdBase +): """CategoricalPredictionDriftMetricThreshold. All required parameters must be populated in order to send to Azure. @@ -4801,20 +4837,17 @@ class CategoricalPredictionDriftMetricThreshold(PredictionDriftMetricThresholdBa """ _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, + "data_type": {"required": True}, + "metric": {"required": True}, } _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, + "data_type": {"key": "dataType", "type": "str"}, + "threshold": {"key": "threshold", "type": "MonitoringThreshold"}, + "metric": {"key": "metric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword threshold: The threshold value. If null, a default value will be set depending on the selected metric. @@ -4825,9 +4858,11 @@ def __init__( :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.CategoricalPredictionDriftMetric """ - super(CategoricalPredictionDriftMetricThreshold, self).__init__(**kwargs) - self.data_type = 'Categorical' # type: str - self.metric = kwargs['metric'] + super(CategoricalPredictionDriftMetricThreshold, self).__init__( + **kwargs + ) + self.data_type = "Categorical" # type: str + self.metric = kwargs["metric"] class CertificateDatastoreCredentials(DatastoreCredentials): @@ -4854,27 +4889,28 @@ class CertificateDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, - 'thumbprint': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials_type": {"required": True}, + "client_id": {"required": True}, + "secrets": {"required": True}, + "tenant_id": {"required": True}, + "thumbprint": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'CertificateDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "authority_url": {"key": "authorityUrl", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + "resource_url": {"key": "resourceUrl", "type": "str"}, + "secrets": {"key": "secrets", "type": "CertificateDatastoreSecrets"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "thumbprint": {"key": "thumbprint", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword authority_url: Authority URL used for authentication. :paramtype authority_url: str @@ -4892,13 +4928,13 @@ def __init__( :paramtype thumbprint: str """ super(CertificateDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Certificate' # type: str - self.authority_url = kwargs.get('authority_url', None) - self.client_id = kwargs['client_id'] - self.resource_url = kwargs.get('resource_url', None) - self.secrets = kwargs['secrets'] - self.tenant_id = kwargs['tenant_id'] - self.thumbprint = kwargs['thumbprint'] + self.credentials_type = "Certificate" # type: str + self.authority_url = kwargs.get("authority_url", None) + self.client_id = kwargs["client_id"] + self.resource_url = kwargs.get("resource_url", None) + self.secrets = kwargs["secrets"] + self.tenant_id = kwargs["tenant_id"] + self.thumbprint = kwargs["thumbprint"] class CertificateDatastoreSecrets(DatastoreSecrets): @@ -4915,25 +4951,22 @@ class CertificateDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'certificate': {'key': 'certificate', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "certificate": {"key": "certificate", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword certificate: Service principal certificate. :paramtype certificate: str """ super(CertificateDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Certificate' # type: str - self.certificate = kwargs.get('certificate', None) + self.secrets_type = "Certificate" # type: str + self.certificate = kwargs.get("certificate", None) class TableVertical(msrest.serialization.Model): @@ -4977,24 +5010,45 @@ class TableVertical(msrest.serialization.Model): """ _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "TableFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "search_space": { + "key": "searchSpace", + "type": "[TableParameterSubspace]", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "TableSweepSettings", + }, + "test_data": {"key": "testData", "type": "MLTableJobInput"}, + "test_data_size": {"key": "testDataSize", "type": "float"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "weight_column_name": {"key": "weightColumnName", "type": "str"}, + } + + def __init__(self, **kwargs): """ :keyword cv_split_column_names: Columns to use for CVSplit data. :paramtype cv_split_column_names: list[str] @@ -5036,18 +5090,20 @@ def __init__( :paramtype weight_column_name: str """ super(TableVertical, self).__init__(**kwargs) - self.cv_split_column_names = kwargs.get('cv_split_column_names', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.test_data = kwargs.get('test_data', None) - self.test_data_size = kwargs.get('test_data_size', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.weight_column_name = kwargs.get('weight_column_name', None) + self.cv_split_column_names = kwargs.get("cv_split_column_names", None) + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.fixed_parameters = kwargs.get("fixed_parameters", None) + self.limit_settings = kwargs.get("limit_settings", None) + self.n_cross_validations = kwargs.get("n_cross_validations", None) + self.search_space = kwargs.get("search_space", None) + self.sweep_settings = kwargs.get("sweep_settings", None) + self.test_data = kwargs.get("test_data", None) + self.test_data_size = kwargs.get("test_data_size", None) + self.validation_data = kwargs.get("validation_data", None) + self.validation_data_size = kwargs.get("validation_data_size", None) + self.weight_column_name = kwargs.get("weight_column_name", None) class Classification(AutoMLVertical, TableVertical): @@ -5115,36 +5171,60 @@ class Classification(AutoMLVertical, TableVertical): """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'positive_label': {'key': 'positiveLabel', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'ClassificationTrainingSettings'}, - } - - def __init__( - self, - **kwargs - ): + "task_type": {"required": True}, + "training_data": {"required": True}, + } + + _attribute_map = { + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "TableFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "search_space": { + "key": "searchSpace", + "type": "[TableParameterSubspace]", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "TableSweepSettings", + }, + "test_data": {"key": "testData", "type": "MLTableJobInput"}, + "test_data_size": {"key": "testDataSize", "type": "float"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "weight_column_name": {"key": "weightColumnName", "type": "str"}, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "positive_label": {"key": "positiveLabel", "type": "str"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, + "training_settings": { + "key": "trainingSettings", + "type": "ClassificationTrainingSettings", + }, + } + + def __init__(self, **kwargs): """ :keyword cv_split_column_names: Columns to use for CVSplit data. :paramtype cv_split_column_names: list[str] @@ -5203,25 +5283,27 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ClassificationTrainingSettings """ super(Classification, self).__init__(**kwargs) - self.cv_split_column_names = kwargs.get('cv_split_column_names', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.test_data = kwargs.get('test_data', None) - self.test_data_size = kwargs.get('test_data_size', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.weight_column_name = kwargs.get('weight_column_name', None) - self.task_type = 'Classification' # type: str - self.positive_label = kwargs.get('positive_label', None) - self.primary_metric = kwargs.get('primary_metric', None) - self.training_settings = kwargs.get('training_settings', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.cv_split_column_names = kwargs.get("cv_split_column_names", None) + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.fixed_parameters = kwargs.get("fixed_parameters", None) + self.limit_settings = kwargs.get("limit_settings", None) + self.n_cross_validations = kwargs.get("n_cross_validations", None) + self.search_space = kwargs.get("search_space", None) + self.sweep_settings = kwargs.get("sweep_settings", None) + self.test_data = kwargs.get("test_data", None) + self.test_data_size = kwargs.get("test_data_size", None) + self.validation_data = kwargs.get("validation_data", None) + self.validation_data_size = kwargs.get("validation_data_size", None) + self.weight_column_name = kwargs.get("weight_column_name", None) + self.task_type = "Classification" # type: str + self.positive_label = kwargs.get("positive_label", None) + self.primary_metric = kwargs.get("primary_metric", None) + self.training_settings = kwargs.get("training_settings", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class ModelPerformanceMetricThresholdBase(msrest.serialization.Model): @@ -5241,22 +5323,22 @@ class ModelPerformanceMetricThresholdBase(msrest.serialization.Model): """ _validation = { - 'model_type': {'required': True}, + "model_type": {"required": True}, } _attribute_map = { - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, + "model_type": {"key": "modelType", "type": "str"}, + "threshold": {"key": "threshold", "type": "MonitoringThreshold"}, } _subtype_map = { - 'model_type': {'Classification': 'ClassificationModelPerformanceMetricThreshold', 'Regression': 'RegressionModelPerformanceMetricThreshold'} + "model_type": { + "Classification": "ClassificationModelPerformanceMetricThreshold", + "Regression": "RegressionModelPerformanceMetricThreshold", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword threshold: The threshold value. If null, a default value will be set depending on the selected metric. @@ -5264,10 +5346,12 @@ def __init__( """ super(ModelPerformanceMetricThresholdBase, self).__init__(**kwargs) self.model_type = None # type: Optional[str] - self.threshold = kwargs.get('threshold', None) + self.threshold = kwargs.get("threshold", None) -class ClassificationModelPerformanceMetricThreshold(ModelPerformanceMetricThresholdBase): +class ClassificationModelPerformanceMetricThreshold( + ModelPerformanceMetricThresholdBase +): """ClassificationModelPerformanceMetricThreshold. All required parameters must be populated in order to send to Azure. @@ -5285,20 +5369,17 @@ class ClassificationModelPerformanceMetricThreshold(ModelPerformanceMetricThresh """ _validation = { - 'model_type': {'required': True}, - 'metric': {'required': True}, + "model_type": {"required": True}, + "metric": {"required": True}, } _attribute_map = { - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, + "model_type": {"key": "modelType", "type": "str"}, + "threshold": {"key": "threshold", "type": "MonitoringThreshold"}, + "metric": {"key": "metric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword threshold: The threshold value. If null, a default value will be set depending on the selected metric. @@ -5308,9 +5389,11 @@ def __init__( :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.ClassificationModelPerformanceMetric """ - super(ClassificationModelPerformanceMetricThreshold, self).__init__(**kwargs) - self.model_type = 'Classification' # type: str - self.metric = kwargs['metric'] + super(ClassificationModelPerformanceMetricThreshold, self).__init__( + **kwargs + ) + self.model_type = "Classification" # type: str + self.metric = kwargs["metric"] class TrainingSettings(msrest.serialization.Model): @@ -5344,20 +5427,32 @@ class TrainingSettings(msrest.serialization.Model): """ _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, + "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, + "training_mode": {"key": "trainingMode", "type": "str"}, + } + + def __init__(self, **kwargs): """ :keyword enable_dnn_training: Enable recommendation of DNN models. :paramtype enable_dnn_training: bool @@ -5386,14 +5481,22 @@ def __init__( :paramtype training_mode: str or ~azure.mgmt.machinelearningservices.models.TrainingMode """ super(TrainingSettings, self).__init__(**kwargs) - self.enable_dnn_training = kwargs.get('enable_dnn_training', False) - self.enable_model_explainability = kwargs.get('enable_model_explainability', True) - self.enable_onnx_compatible_models = kwargs.get('enable_onnx_compatible_models', False) - self.enable_stack_ensemble = kwargs.get('enable_stack_ensemble', True) - self.enable_vote_ensemble = kwargs.get('enable_vote_ensemble', True) - self.ensemble_model_download_timeout = kwargs.get('ensemble_model_download_timeout', "PT5M") - self.stack_ensemble_settings = kwargs.get('stack_ensemble_settings', None) - self.training_mode = kwargs.get('training_mode', None) + self.enable_dnn_training = kwargs.get("enable_dnn_training", False) + self.enable_model_explainability = kwargs.get( + "enable_model_explainability", True + ) + self.enable_onnx_compatible_models = kwargs.get( + "enable_onnx_compatible_models", False + ) + self.enable_stack_ensemble = kwargs.get("enable_stack_ensemble", True) + self.enable_vote_ensemble = kwargs.get("enable_vote_ensemble", True) + self.ensemble_model_download_timeout = kwargs.get( + "ensemble_model_download_timeout", "PT5M" + ) + self.stack_ensemble_settings = kwargs.get( + "stack_ensemble_settings", None + ) + self.training_mode = kwargs.get("training_mode", None) class ClassificationTrainingSettings(TrainingSettings): @@ -5433,22 +5536,40 @@ class ClassificationTrainingSettings(TrainingSettings): """ _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): + "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, + "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, + "training_mode": {"key": "trainingMode", "type": "str"}, + "allowed_training_algorithms": { + "key": "allowedTrainingAlgorithms", + "type": "[str]", + }, + "blocked_training_algorithms": { + "key": "blockedTrainingAlgorithms", + "type": "[str]", + }, + } + + def __init__(self, **kwargs): """ :keyword enable_dnn_training: Enable recommendation of DNN models. :paramtype enable_dnn_training: bool @@ -5483,8 +5604,12 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ClassificationModels] """ super(ClassificationTrainingSettings, self).__init__(**kwargs) - self.allowed_training_algorithms = kwargs.get('allowed_training_algorithms', None) - self.blocked_training_algorithms = kwargs.get('blocked_training_algorithms', None) + self.allowed_training_algorithms = kwargs.get( + "allowed_training_algorithms", None + ) + self.blocked_training_algorithms = kwargs.get( + "blocked_training_algorithms", None + ) class ClusterUpdateParameters(msrest.serialization.Model): @@ -5495,19 +5620,19 @@ class ClusterUpdateParameters(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties.properties', 'type': 'ScaleSettingsInformation'}, + "properties": { + "key": "properties.properties", + "type": "ScaleSettingsInformation", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of ClusterUpdate. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ScaleSettingsInformation """ super(ClusterUpdateParameters, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class ExportSummary(msrest.serialization.Model): @@ -5534,31 +5659,31 @@ class ExportSummary(msrest.serialization.Model): """ _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, + "end_date_time": {"readonly": True}, + "exported_row_count": {"readonly": True}, + "format": {"required": True}, + "labeling_job_id": {"readonly": True}, + "start_date_time": {"readonly": True}, } _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, + "end_date_time": {"key": "endDateTime", "type": "iso-8601"}, + "exported_row_count": {"key": "exportedRowCount", "type": "long"}, + "format": {"key": "format", "type": "str"}, + "labeling_job_id": {"key": "labelingJobId", "type": "str"}, + "start_date_time": {"key": "startDateTime", "type": "iso-8601"}, } _subtype_map = { - 'format': {'CSV': 'CsvExportSummary', 'Coco': 'CocoExportSummary', 'Dataset': 'DatasetExportSummary'} + "format": { + "CSV": "CsvExportSummary", + "Coco": "CocoExportSummary", + "Dataset": "DatasetExportSummary", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ExportSummary, self).__init__(**kwargs) self.end_date_time = None self.exported_row_count = None @@ -5592,33 +5717,29 @@ class CocoExportSummary(ExportSummary): """ _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'container_name': {'readonly': True}, - 'snapshot_path': {'readonly': True}, + "end_date_time": {"readonly": True}, + "exported_row_count": {"readonly": True}, + "format": {"required": True}, + "labeling_job_id": {"readonly": True}, + "start_date_time": {"readonly": True}, + "container_name": {"readonly": True}, + "snapshot_path": {"readonly": True}, } _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'snapshot_path': {'key': 'snapshotPath', 'type': 'str'}, + "end_date_time": {"key": "endDateTime", "type": "iso-8601"}, + "exported_row_count": {"key": "exportedRowCount", "type": "long"}, + "format": {"key": "format", "type": "str"}, + "labeling_job_id": {"key": "labelingJobId", "type": "str"}, + "start_date_time": {"key": "startDateTime", "type": "iso-8601"}, + "container_name": {"key": "containerName", "type": "str"}, + "snapshot_path": {"key": "snapshotPath", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(CocoExportSummary, self).__init__(**kwargs) - self.format = 'Coco' # type: str + self.format = "Coco" # type: str self.container_name = None self.snapshot_path = None @@ -5635,18 +5756,19 @@ class CodeConfiguration(msrest.serialization.Model): """ _validation = { - 'scoring_script': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "scoring_script": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'scoring_script': {'key': 'scoringScript', 'type': 'str'}, + "code_id": {"key": "codeId", "type": "str"}, + "scoring_script": {"key": "scoringScript", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword code_id: ARM resource ID of the code asset. :paramtype code_id: str @@ -5654,8 +5776,8 @@ def __init__( :paramtype scoring_script: str """ super(CodeConfiguration, self).__init__(**kwargs) - self.code_id = kwargs.get('code_id', None) - self.scoring_script = kwargs['scoring_script'] + self.code_id = kwargs.get("code_id", None) + self.scoring_script = kwargs["scoring_script"] class CodeContainer(Resource): @@ -5681,31 +5803,28 @@ class CodeContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "CodeContainerProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeContainerProperties """ super(CodeContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class CodeContainerProperties(AssetContainer): @@ -5732,25 +5851,22 @@ class CodeContainerProperties(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -5776,14 +5892,11 @@ class CodeContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[CodeContainer]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of CodeContainer objects. If null, there are no additional pages. @@ -5792,8 +5905,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.CodeContainer] """ super(CodeContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class CodeVersion(Resource): @@ -5819,31 +5932,28 @@ class CodeVersion(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeVersionProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "CodeVersionProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeVersionProperties """ super(CodeVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class CodeVersionProperties(AssetBase): @@ -5874,24 +5984,24 @@ class CodeVersionProperties(AssetBase): """ _validation = { - 'provisioning_state': {'readonly': True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'code_uri': {'key': 'codeUri', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "auto_delete_setting": { + "key": "autoDeleteSetting", + "type": "AutoDeleteSetting", + }, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "code_uri": {"key": "codeUri", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -5911,7 +6021,7 @@ def __init__( :paramtype code_uri: str """ super(CodeVersionProperties, self).__init__(**kwargs) - self.code_uri = kwargs.get('code_uri', None) + self.code_uri = kwargs.get("code_uri", None) self.provisioning_state = None @@ -5926,14 +6036,11 @@ class CodeVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeVersion]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[CodeVersion]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of CodeVersion objects. If null, there are no additional pages. @@ -5942,8 +6049,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.CodeVersion] """ super(CodeVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class Collection(msrest.serialization.Model): @@ -5965,16 +6072,13 @@ class Collection(msrest.serialization.Model): """ _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'data_collection_mode': {'key': 'dataCollectionMode', 'type': 'str'}, - 'data_id': {'key': 'dataId', 'type': 'str'}, - 'sampling_rate': {'key': 'samplingRate', 'type': 'float'}, + "client_id": {"key": "clientId", "type": "str"}, + "data_collection_mode": {"key": "dataCollectionMode", "type": "str"}, + "data_id": {"key": "dataId", "type": "str"}, + "sampling_rate": {"key": "samplingRate", "type": "float"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword client_id: The msi client id used to collect logging to blob storage. If it's null,backend will pick a registered endpoint identity to auth. @@ -5991,10 +6095,10 @@ def __init__( :paramtype sampling_rate: float """ super(Collection, self).__init__(**kwargs) - self.client_id = kwargs.get('client_id', None) - self.data_collection_mode = kwargs.get('data_collection_mode', None) - self.data_id = kwargs.get('data_id', None) - self.sampling_rate = kwargs.get('sampling_rate', 1) + self.client_id = kwargs.get("client_id", None) + self.data_collection_mode = kwargs.get("data_collection_mode", None) + self.data_id = kwargs.get("data_id", None) + self.sampling_rate = kwargs.get("sampling_rate", 1) class ColumnTransformer(msrest.serialization.Model): @@ -6008,14 +6112,11 @@ class ColumnTransformer(msrest.serialization.Model): """ _attribute_map = { - 'fields': {'key': 'fields', 'type': '[str]'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, + "fields": {"key": "fields", "type": "[str]"}, + "parameters": {"key": "parameters", "type": "object"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword fields: Fields to apply transformer logic on. :paramtype fields: list[str] @@ -6024,8 +6125,8 @@ def __init__( :paramtype parameters: any """ super(ColumnTransformer, self).__init__(**kwargs) - self.fields = kwargs.get('fields', None) - self.parameters = kwargs.get('parameters', None) + self.fields = kwargs.get("fields", None) + self.parameters = kwargs.get("parameters", None) class CommandJob(JobBaseProperties): @@ -6102,46 +6203,66 @@ class CommandJob(JobBaseProperties): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'parameters': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'autologger_settings': {'key': 'autologgerSettings', 'type': 'AutologgerSettings'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'CommandJobLimits'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - } - - def __init__( - self, - **kwargs - ): + "job_type": {"required": True}, + "status": {"readonly": True}, + "command": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "environment_id": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "parameters": {"readonly": True}, + } + + _attribute_map = { + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "notification_setting": { + "key": "notificationSetting", + "type": "NotificationSetting", + }, + "secrets_configuration": { + "key": "secretsConfiguration", + "type": "{SecretConfiguration}", + }, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "autologger_settings": { + "key": "autologgerSettings", + "type": "AutologgerSettings", + }, + "code_id": {"key": "codeId", "type": "str"}, + "command": {"key": "command", "type": "str"}, + "distribution": { + "key": "distribution", + "type": "DistributionConfiguration", + }, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "limits": {"key": "limits", "type": "CommandJobLimits"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "parameters": {"key": "parameters", "type": "object"}, + "queue_settings": {"key": "queueSettings", "type": "QueueSettings"}, + "resources": {"key": "resources", "type": "JobResourceConfiguration"}, + } + + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -6200,19 +6321,19 @@ def __init__( :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration """ super(CommandJob, self).__init__(**kwargs) - self.job_type = 'Command' # type: str - self.autologger_settings = kwargs.get('autologger_settings', None) - self.code_id = kwargs.get('code_id', None) - self.command = kwargs['command'] - self.distribution = kwargs.get('distribution', None) - self.environment_id = kwargs['environment_id'] - self.environment_variables = kwargs.get('environment_variables', None) - self.inputs = kwargs.get('inputs', None) - self.limits = kwargs.get('limits', None) - self.outputs = kwargs.get('outputs', None) + self.job_type = "Command" # type: str + self.autologger_settings = kwargs.get("autologger_settings", None) + self.code_id = kwargs.get("code_id", None) + self.command = kwargs["command"] + self.distribution = kwargs.get("distribution", None) + self.environment_id = kwargs["environment_id"] + self.environment_variables = kwargs.get("environment_variables", None) + self.inputs = kwargs.get("inputs", None) + self.limits = kwargs.get("limits", None) + self.outputs = kwargs.get("outputs", None) self.parameters = None - self.queue_settings = kwargs.get('queue_settings', None) - self.resources = kwargs.get('resources', None) + self.queue_settings = kwargs.get("queue_settings", None) + self.resources = kwargs.get("resources", None) class JobLimits(msrest.serialization.Model): @@ -6232,22 +6353,22 @@ class JobLimits(msrest.serialization.Model): """ _validation = { - 'job_limits_type': {'required': True}, + "job_limits_type": {"required": True}, } _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "job_limits_type": {"key": "jobLimitsType", "type": "str"}, + "timeout": {"key": "timeout", "type": "duration"}, } _subtype_map = { - 'job_limits_type': {'Command': 'CommandJobLimits', 'Sweep': 'SweepJobLimits'} + "job_limits_type": { + "Command": "CommandJobLimits", + "Sweep": "SweepJobLimits", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. Only supports duration with precision as low as Seconds. @@ -6255,7 +6376,7 @@ def __init__( """ super(JobLimits, self).__init__(**kwargs) self.job_limits_type = None # type: Optional[str] - self.timeout = kwargs.get('timeout', None) + self.timeout = kwargs.get("timeout", None) class CommandJobLimits(JobLimits): @@ -6272,25 +6393,22 @@ class CommandJobLimits(JobLimits): """ _validation = { - 'job_limits_type': {'required': True}, + "job_limits_type": {"required": True}, } _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "job_limits_type": {"key": "jobLimitsType", "type": "str"}, + "timeout": {"key": "timeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. Only supports duration with precision as low as Seconds. :paramtype timeout: ~datetime.timedelta """ super(CommandJobLimits, self).__init__(**kwargs) - self.job_limits_type = 'Command' # type: str + self.job_limits_type = "Command" # type: str class ComponentContainer(Resource): @@ -6316,81 +6434,78 @@ class ComponentContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "ComponentContainerProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentContainerProperties """ super(ComponentContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class ComponentContainerProperties(AssetContainer): """Component container definition. -.. raw:: html + .. raw:: html - . + . - Variables are only populated by the server, and will be ignored when sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the component container. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState + :ivar description: The asset description text. + :vartype description: str + :ivar properties: The asset property dictionary. + :vartype properties: dict[str, str] + :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + :ivar is_archived: Is the asset archived?. + :vartype is_archived: bool + :ivar latest_version: The latest version inside this container. + :vartype latest_version: str + :ivar next_version: The next auto incremental version. + :vartype next_version: str + :ivar provisioning_state: Provisioning state for the component container. Possible values + include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.machinelearningservices.models.AssetProvisioningState """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -6416,14 +6531,11 @@ class ComponentContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ComponentContainer]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of ComponentContainer objects. If null, there are no additional pages. @@ -6431,9 +6543,11 @@ def __init__( :keyword value: An array of objects of type ComponentContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainer] """ - super(ComponentContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(ComponentContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class ComponentVersion(Resource): @@ -6459,31 +6573,31 @@ class ComponentVersion(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentVersionProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "ComponentVersionProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentVersionProperties """ super(ComponentVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class ComponentVersionProperties(AssetBase): @@ -6506,10 +6620,10 @@ class ComponentVersionProperties(AssetBase): provided it will be used to populate IsArchived. :vartype is_archived: bool :ivar component_spec: Defines Component definition details. - - + + .. raw:: html - + . @@ -6523,25 +6637,25 @@ class ComponentVersionProperties(AssetBase): """ _validation = { - 'provisioning_state': {'readonly': True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'component_spec': {'key': 'componentSpec', 'type': 'object'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "auto_delete_setting": { + "key": "autoDeleteSetting", + "type": "AutoDeleteSetting", + }, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "component_spec": {"key": "componentSpec", "type": "object"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "stage": {"key": "stage", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -6558,10 +6672,10 @@ def __init__( provided it will be used to populate IsArchived. :paramtype is_archived: bool :keyword component_spec: Defines Component definition details. - - + + .. raw:: html - + . @@ -6570,9 +6684,9 @@ def __init__( :paramtype stage: str """ super(ComponentVersionProperties, self).__init__(**kwargs) - self.component_spec = kwargs.get('component_spec', None) + self.component_spec = kwargs.get("component_spec", None) self.provisioning_state = None - self.stage = kwargs.get('stage', None) + self.stage = kwargs.get("stage", None) class ComponentVersionResourceArmPaginatedResult(msrest.serialization.Model): @@ -6586,14 +6700,11 @@ class ComponentVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentVersion]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ComponentVersion]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of ComponentVersion objects. If null, there are no additional pages. @@ -6601,9 +6712,11 @@ def __init__( :keyword value: An array of objects of type ComponentVersion. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersion] """ - super(ComponentVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(ComponentVersionResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class ComputeInstanceSchema(msrest.serialization.Model): @@ -6614,19 +6727,19 @@ class ComputeInstanceSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, + "properties": { + "key": "properties", + "type": "ComputeInstanceProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of ComputeInstance. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties """ super(ComputeInstanceSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class ComputeInstance(Compute, ComputeInstanceSchema): @@ -6668,32 +6781,35 @@ class ComputeInstance(Compute, ComputeInstanceSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": { + "key": "properties", + "type": "ComputeInstanceProperties", + }, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of ComputeInstance. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties @@ -6708,17 +6824,17 @@ def __init__( :paramtype disable_local_auth: bool """ super(ComputeInstance, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'ComputeInstance' # type: str - self.compute_location = kwargs.get('compute_location', None) + self.properties = kwargs.get("properties", None) + self.compute_type = "ComputeInstance" # type: str + self.compute_location = kwargs.get("compute_location", None) self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) + self.disable_local_auth = kwargs.get("disable_local_auth", None) class ComputeInstanceApplication(msrest.serialization.Model): @@ -6731,14 +6847,11 @@ class ComputeInstanceApplication(msrest.serialization.Model): """ _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, + "display_name": {"key": "displayName", "type": "str"}, + "endpoint_uri": {"key": "endpointUri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword display_name: Name of the ComputeInstance application. :paramtype display_name: str @@ -6746,8 +6859,8 @@ def __init__( :paramtype endpoint_uri: str """ super(ComputeInstanceApplication, self).__init__(**kwargs) - self.display_name = kwargs.get('display_name', None) - self.endpoint_uri = kwargs.get('endpoint_uri', None) + self.display_name = kwargs.get("display_name", None) + self.endpoint_uri = kwargs.get("endpoint_uri", None) class ComputeInstanceAutologgerSettings(msrest.serialization.Model): @@ -6759,13 +6872,10 @@ class ComputeInstanceAutologgerSettings(msrest.serialization.Model): """ _attribute_map = { - 'mlflow_autologger': {'key': 'mlflowAutologger', 'type': 'str'}, + "mlflow_autologger": {"key": "mlflowAutologger", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mlflow_autologger: Indicates whether mlflow autologger is enabled for notebooks. Possible values include: "Enabled", "Disabled". @@ -6773,7 +6883,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.MlflowAutologger """ super(ComputeInstanceAutologgerSettings, self).__init__(**kwargs) - self.mlflow_autologger = kwargs.get('mlflow_autologger', None) + self.mlflow_autologger = kwargs.get("mlflow_autologger", None) class ComputeInstanceConnectivityEndpoints(msrest.serialization.Model): @@ -6789,21 +6899,17 @@ class ComputeInstanceConnectivityEndpoints(msrest.serialization.Model): """ _validation = { - 'public_ip_address': {'readonly': True}, - 'private_ip_address': {'readonly': True}, + "public_ip_address": {"readonly": True}, + "private_ip_address": {"readonly": True}, } _attribute_map = { - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + "public_ip_address": {"key": "publicIpAddress", "type": "str"}, + "private_ip_address": {"key": "privateIpAddress", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ComputeInstanceConnectivityEndpoints, self).__init__(**kwargs) self.public_ip_address = None self.private_ip_address = None @@ -6829,22 +6935,22 @@ class ComputeInstanceContainer(msrest.serialization.Model): """ _validation = { - 'services': {'readonly': True}, + "services": {"readonly": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'autosave': {'key': 'autosave', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'network': {'key': 'network', 'type': 'str'}, - 'environment': {'key': 'environment', 'type': 'ComputeInstanceEnvironmentInfo'}, - 'services': {'key': 'services', 'type': '[object]'}, + "name": {"key": "name", "type": "str"}, + "autosave": {"key": "autosave", "type": "str"}, + "gpu": {"key": "gpu", "type": "str"}, + "network": {"key": "network", "type": "str"}, + "environment": { + "key": "environment", + "type": "ComputeInstanceEnvironmentInfo", + }, + "services": {"key": "services", "type": "[object]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: Name of the ComputeInstance container. :paramtype name: str @@ -6859,11 +6965,11 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ComputeInstanceEnvironmentInfo """ super(ComputeInstanceContainer, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.autosave = kwargs.get('autosave', None) - self.gpu = kwargs.get('gpu', None) - self.network = kwargs.get('network', None) - self.environment = kwargs.get('environment', None) + self.name = kwargs.get("name", None) + self.autosave = kwargs.get("autosave", None) + self.gpu = kwargs.get("gpu", None) + self.network = kwargs.get("network", None) + self.environment = kwargs.get("environment", None) self.services = None @@ -6881,23 +6987,19 @@ class ComputeInstanceCreatedBy(msrest.serialization.Model): """ _validation = { - 'user_name': {'readonly': True}, - 'user_org_id': {'readonly': True}, - 'user_id': {'readonly': True}, + "user_name": {"readonly": True}, + "user_org_id": {"readonly": True}, + "user_id": {"readonly": True}, } _attribute_map = { - 'user_name': {'key': 'userName', 'type': 'str'}, - 'user_org_id': {'key': 'userOrgId', 'type': 'str'}, - 'user_id': {'key': 'userId', 'type': 'str'}, + "user_name": {"key": "userName", "type": "str"}, + "user_org_id": {"key": "userOrgId", "type": "str"}, + "user_id": {"key": "userId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ComputeInstanceCreatedBy, self).__init__(**kwargs) self.user_name = None self.user_org_id = None @@ -6922,16 +7024,13 @@ class ComputeInstanceDataDisk(msrest.serialization.Model): """ _attribute_map = { - 'caching': {'key': 'caching', 'type': 'str'}, - 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, - 'lun': {'key': 'lun', 'type': 'int'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + "caching": {"key": "caching", "type": "str"}, + "disk_size_gb": {"key": "diskSizeGB", "type": "int"}, + "lun": {"key": "lun", "type": "int"}, + "storage_account_type": {"key": "storageAccountType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword caching: Caching type of Data Disk. Possible values include: "None", "ReadOnly", "ReadWrite". @@ -6947,10 +7046,12 @@ def __init__( ~azure.mgmt.machinelearningservices.models.StorageAccountType """ super(ComputeInstanceDataDisk, self).__init__(**kwargs) - self.caching = kwargs.get('caching', None) - self.disk_size_gb = kwargs.get('disk_size_gb', None) - self.lun = kwargs.get('lun', None) - self.storage_account_type = kwargs.get('storage_account_type', "Standard_LRS") + self.caching = kwargs.get("caching", None) + self.disk_size_gb = kwargs.get("disk_size_gb", None) + self.lun = kwargs.get("lun", None) + self.storage_account_type = kwargs.get( + "storage_account_type", "Standard_LRS" + ) class ComputeInstanceDataMount(msrest.serialization.Model): @@ -6978,21 +7079,18 @@ class ComputeInstanceDataMount(msrest.serialization.Model): """ _attribute_map = { - 'source': {'key': 'source', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'mount_name': {'key': 'mountName', 'type': 'str'}, - 'mount_action': {'key': 'mountAction', 'type': 'str'}, - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - 'mount_state': {'key': 'mountState', 'type': 'str'}, - 'mounted_on': {'key': 'mountedOn', 'type': 'iso-8601'}, - 'error': {'key': 'error', 'type': 'str'}, + "source": {"key": "source", "type": "str"}, + "source_type": {"key": "sourceType", "type": "str"}, + "mount_name": {"key": "mountName", "type": "str"}, + "mount_action": {"key": "mountAction", "type": "str"}, + "created_by": {"key": "createdBy", "type": "str"}, + "mount_path": {"key": "mountPath", "type": "str"}, + "mount_state": {"key": "mountState", "type": "str"}, + "mounted_on": {"key": "mountedOn", "type": "iso-8601"}, + "error": {"key": "error", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword source: Source of the ComputeInstance data mount. :paramtype source: str @@ -7015,15 +7113,15 @@ def __init__( :paramtype error: str """ super(ComputeInstanceDataMount, self).__init__(**kwargs) - self.source = kwargs.get('source', None) - self.source_type = kwargs.get('source_type', None) - self.mount_name = kwargs.get('mount_name', None) - self.mount_action = kwargs.get('mount_action', None) - self.created_by = kwargs.get('created_by', None) - self.mount_path = kwargs.get('mount_path', None) - self.mount_state = kwargs.get('mount_state', None) - self.mounted_on = kwargs.get('mounted_on', None) - self.error = kwargs.get('error', None) + self.source = kwargs.get("source", None) + self.source_type = kwargs.get("source_type", None) + self.mount_name = kwargs.get("mount_name", None) + self.mount_action = kwargs.get("mount_action", None) + self.created_by = kwargs.get("created_by", None) + self.mount_path = kwargs.get("mount_path", None) + self.mount_state = kwargs.get("mount_state", None) + self.mounted_on = kwargs.get("mounted_on", None) + self.error = kwargs.get("error", None) class ComputeInstanceEnvironmentInfo(msrest.serialization.Model): @@ -7036,14 +7134,11 @@ class ComputeInstanceEnvironmentInfo(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "version": {"key": "version", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: name of environment. :paramtype name: str @@ -7051,8 +7146,8 @@ def __init__( :paramtype version: str """ super(ComputeInstanceEnvironmentInfo, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.version = kwargs.get('version', None) + self.name = kwargs.get("name", None) + self.version = kwargs.get("version", None) class ComputeInstanceLastOperation(msrest.serialization.Model): @@ -7072,16 +7167,13 @@ class ComputeInstanceLastOperation(msrest.serialization.Model): """ _attribute_map = { - 'operation_name': {'key': 'operationName', 'type': 'str'}, - 'operation_time': {'key': 'operationTime', 'type': 'iso-8601'}, - 'operation_status': {'key': 'operationStatus', 'type': 'str'}, - 'operation_trigger': {'key': 'operationTrigger', 'type': 'str'}, + "operation_name": {"key": "operationName", "type": "str"}, + "operation_time": {"key": "operationTime", "type": "iso-8601"}, + "operation_status": {"key": "operationStatus", "type": "str"}, + "operation_trigger": {"key": "operationTrigger", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword operation_name: Name of the last operation. Possible values include: "Create", "Start", "Stop", "Restart", "Reimage", "Delete". @@ -7098,10 +7190,10 @@ def __init__( ~azure.mgmt.machinelearningservices.models.OperationTrigger """ super(ComputeInstanceLastOperation, self).__init__(**kwargs) - self.operation_name = kwargs.get('operation_name', None) - self.operation_time = kwargs.get('operation_time', None) - self.operation_status = kwargs.get('operation_status', None) - self.operation_trigger = kwargs.get('operation_trigger', None) + self.operation_name = kwargs.get("operation_name", None) + self.operation_time = kwargs.get("operation_time", None) + self.operation_status = kwargs.get("operation_status", None) + self.operation_trigger = kwargs.get("operation_trigger", None) class ComputeInstanceProperties(msrest.serialization.Model): @@ -7179,49 +7271,88 @@ class ComputeInstanceProperties(msrest.serialization.Model): """ _validation = { - 'os_image_metadata': {'readonly': True}, - 'connectivity_endpoints': {'readonly': True}, - 'applications': {'readonly': True}, - 'created_by': {'readonly': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'last_operation': {'readonly': True}, - 'containers': {'readonly': True}, - 'data_disks': {'readonly': True}, - 'data_mounts': {'readonly': True}, - 'versions': {'readonly': True}, - } - - _attribute_map = { - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'application_sharing_policy': {'key': 'applicationSharingPolicy', 'type': 'str'}, - 'autologger_settings': {'key': 'autologgerSettings', 'type': 'ComputeInstanceAutologgerSettings'}, - 'ssh_settings': {'key': 'sshSettings', 'type': 'ComputeInstanceSshSettings'}, - 'custom_services': {'key': 'customServices', 'type': '[CustomService]'}, - 'os_image_metadata': {'key': 'osImageMetadata', 'type': 'ImageMetadata'}, - 'connectivity_endpoints': {'key': 'connectivityEndpoints', 'type': 'ComputeInstanceConnectivityEndpoints'}, - 'applications': {'key': 'applications', 'type': '[ComputeInstanceApplication]'}, - 'created_by': {'key': 'createdBy', 'type': 'ComputeInstanceCreatedBy'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'compute_instance_authorization_type': {'key': 'computeInstanceAuthorizationType', 'type': 'str'}, - 'personal_compute_instance_settings': {'key': 'personalComputeInstanceSettings', 'type': 'PersonalComputeInstanceSettings'}, - 'setup_scripts': {'key': 'setupScripts', 'type': 'SetupScripts'}, - 'last_operation': {'key': 'lastOperation', 'type': 'ComputeInstanceLastOperation'}, - 'schedules': {'key': 'schedules', 'type': 'ComputeSchedules'}, - 'idle_time_before_shutdown': {'key': 'idleTimeBeforeShutdown', 'type': 'str'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'containers': {'key': 'containers', 'type': '[ComputeInstanceContainer]'}, - 'data_disks': {'key': 'dataDisks', 'type': '[ComputeInstanceDataDisk]'}, - 'data_mounts': {'key': 'dataMounts', 'type': '[ComputeInstanceDataMount]'}, - 'versions': {'key': 'versions', 'type': 'ComputeInstanceVersion'}, - } - - def __init__( - self, - **kwargs - ): + "os_image_metadata": {"readonly": True}, + "connectivity_endpoints": {"readonly": True}, + "applications": {"readonly": True}, + "created_by": {"readonly": True}, + "errors": {"readonly": True}, + "state": {"readonly": True}, + "last_operation": {"readonly": True}, + "containers": {"readonly": True}, + "data_disks": {"readonly": True}, + "data_mounts": {"readonly": True}, + "versions": {"readonly": True}, + } + + _attribute_map = { + "vm_size": {"key": "vmSize", "type": "str"}, + "subnet": {"key": "subnet", "type": "ResourceId"}, + "application_sharing_policy": { + "key": "applicationSharingPolicy", + "type": "str", + }, + "autologger_settings": { + "key": "autologgerSettings", + "type": "ComputeInstanceAutologgerSettings", + }, + "ssh_settings": { + "key": "sshSettings", + "type": "ComputeInstanceSshSettings", + }, + "custom_services": { + "key": "customServices", + "type": "[CustomService]", + }, + "os_image_metadata": { + "key": "osImageMetadata", + "type": "ImageMetadata", + }, + "connectivity_endpoints": { + "key": "connectivityEndpoints", + "type": "ComputeInstanceConnectivityEndpoints", + }, + "applications": { + "key": "applications", + "type": "[ComputeInstanceApplication]", + }, + "created_by": {"key": "createdBy", "type": "ComputeInstanceCreatedBy"}, + "errors": {"key": "errors", "type": "[ErrorResponse]"}, + "state": {"key": "state", "type": "str"}, + "compute_instance_authorization_type": { + "key": "computeInstanceAuthorizationType", + "type": "str", + }, + "personal_compute_instance_settings": { + "key": "personalComputeInstanceSettings", + "type": "PersonalComputeInstanceSettings", + }, + "setup_scripts": {"key": "setupScripts", "type": "SetupScripts"}, + "last_operation": { + "key": "lastOperation", + "type": "ComputeInstanceLastOperation", + }, + "schedules": {"key": "schedules", "type": "ComputeSchedules"}, + "idle_time_before_shutdown": { + "key": "idleTimeBeforeShutdown", + "type": "str", + }, + "enable_node_public_ip": {"key": "enableNodePublicIp", "type": "bool"}, + "containers": { + "key": "containers", + "type": "[ComputeInstanceContainer]", + }, + "data_disks": { + "key": "dataDisks", + "type": "[ComputeInstanceDataDisk]", + }, + "data_mounts": { + "key": "dataMounts", + "type": "[ComputeInstanceDataMount]", + }, + "versions": {"key": "versions", "type": "ComputeInstanceVersion"}, + } + + def __init__(self, **kwargs): """ :keyword vm_size: Virtual Machine Size. :paramtype vm_size: str @@ -7263,25 +7394,33 @@ def __init__( :paramtype enable_node_public_ip: bool """ super(ComputeInstanceProperties, self).__init__(**kwargs) - self.vm_size = kwargs.get('vm_size', None) - self.subnet = kwargs.get('subnet', None) - self.application_sharing_policy = kwargs.get('application_sharing_policy', "Shared") - self.autologger_settings = kwargs.get('autologger_settings', None) - self.ssh_settings = kwargs.get('ssh_settings', None) - self.custom_services = kwargs.get('custom_services', None) + self.vm_size = kwargs.get("vm_size", None) + self.subnet = kwargs.get("subnet", None) + self.application_sharing_policy = kwargs.get( + "application_sharing_policy", "Shared" + ) + self.autologger_settings = kwargs.get("autologger_settings", None) + self.ssh_settings = kwargs.get("ssh_settings", None) + self.custom_services = kwargs.get("custom_services", None) self.os_image_metadata = None self.connectivity_endpoints = None self.applications = None self.created_by = None self.errors = None self.state = None - self.compute_instance_authorization_type = kwargs.get('compute_instance_authorization_type', "personal") - self.personal_compute_instance_settings = kwargs.get('personal_compute_instance_settings', None) - self.setup_scripts = kwargs.get('setup_scripts', None) + self.compute_instance_authorization_type = kwargs.get( + "compute_instance_authorization_type", "personal" + ) + self.personal_compute_instance_settings = kwargs.get( + "personal_compute_instance_settings", None + ) + self.setup_scripts = kwargs.get("setup_scripts", None) self.last_operation = None - self.schedules = kwargs.get('schedules', None) - self.idle_time_before_shutdown = kwargs.get('idle_time_before_shutdown', None) - self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) + self.schedules = kwargs.get("schedules", None) + self.idle_time_before_shutdown = kwargs.get( + "idle_time_before_shutdown", None + ) + self.enable_node_public_ip = kwargs.get("enable_node_public_ip", None) self.containers = None self.data_disks = None self.data_mounts = None @@ -7308,21 +7447,18 @@ class ComputeInstanceSshSettings(msrest.serialization.Model): """ _validation = { - 'admin_user_name': {'readonly': True}, - 'ssh_port': {'readonly': True}, + "admin_user_name": {"readonly": True}, + "ssh_port": {"readonly": True}, } _attribute_map = { - 'ssh_public_access': {'key': 'sshPublicAccess', 'type': 'str'}, - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'admin_public_key': {'key': 'adminPublicKey', 'type': 'str'}, + "ssh_public_access": {"key": "sshPublicAccess", "type": "str"}, + "admin_user_name": {"key": "adminUserName", "type": "str"}, + "ssh_port": {"key": "sshPort", "type": "int"}, + "admin_public_key": {"key": "adminPublicKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword ssh_public_access: State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the @@ -7334,10 +7470,10 @@ def __init__( :paramtype admin_public_key: str """ super(ComputeInstanceSshSettings, self).__init__(**kwargs) - self.ssh_public_access = kwargs.get('ssh_public_access', "Disabled") + self.ssh_public_access = kwargs.get("ssh_public_access", "Disabled") self.admin_user_name = None self.ssh_port = None - self.admin_public_key = kwargs.get('admin_public_key', None) + self.admin_public_key = kwargs.get("admin_public_key", None) class ComputeInstanceVersion(msrest.serialization.Model): @@ -7348,19 +7484,16 @@ class ComputeInstanceVersion(msrest.serialization.Model): """ _attribute_map = { - 'runtime': {'key': 'runtime', 'type': 'str'}, + "runtime": {"key": "runtime", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword runtime: Runtime of compute instance. :paramtype runtime: str """ super(ComputeInstanceVersion, self).__init__(**kwargs) - self.runtime = kwargs.get('runtime', None) + self.runtime = kwargs.get("runtime", None) class ComputeResourceSchema(msrest.serialization.Model): @@ -7371,19 +7504,16 @@ class ComputeResourceSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, + "properties": {"key": "properties", "type": "Compute"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Compute properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute """ super(ComputeResourceSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class ComputeResource(Resource, ComputeResourceSchema): @@ -7415,28 +7545,25 @@ class ComputeResource(Resource, ComputeResourceSchema): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "properties": {"key": "properties", "type": "Compute"}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Compute properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute @@ -7450,11 +7577,11 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ super(ComputeResource, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) + self.properties = kwargs.get("properties", None) + self.identity = kwargs.get("identity", None) + self.location = kwargs.get("location", None) + self.tags = kwargs.get("tags", None) + self.sku = kwargs.get("sku", None) self.id = None self.name = None self.type = None @@ -7469,19 +7596,16 @@ class ComputeRuntimeDto(msrest.serialization.Model): """ _attribute_map = { - 'spark_runtime_version': {'key': 'sparkRuntimeVersion', 'type': 'str'}, + "spark_runtime_version": {"key": "sparkRuntimeVersion", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword spark_runtime_version: :paramtype spark_runtime_version: str """ super(ComputeRuntimeDto, self).__init__(**kwargs) - self.spark_runtime_version = kwargs.get('spark_runtime_version', None) + self.spark_runtime_version = kwargs.get("spark_runtime_version", None) class ComputeSchedules(msrest.serialization.Model): @@ -7493,20 +7617,20 @@ class ComputeSchedules(msrest.serialization.Model): """ _attribute_map = { - 'compute_start_stop': {'key': 'computeStartStop', 'type': '[ComputeStartStopSchedule]'}, + "compute_start_stop": { + "key": "computeStartStop", + "type": "[ComputeStartStopSchedule]", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword compute_start_stop: The list of compute start stop schedules to be applied. :paramtype compute_start_stop: list[~azure.mgmt.machinelearningservices.models.ComputeStartStopSchedule] """ super(ComputeSchedules, self).__init__(**kwargs) - self.compute_start_stop = kwargs.get('compute_start_stop', None) + self.compute_start_stop = kwargs.get("compute_start_stop", None) class ComputeStartStopSchedule(msrest.serialization.Model): @@ -7537,25 +7661,22 @@ class ComputeStartStopSchedule(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'provisioning_status': {'readonly': True}, + "id": {"readonly": True}, + "provisioning_status": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'recurrence': {'key': 'recurrence', 'type': 'Recurrence'}, - 'cron': {'key': 'cron', 'type': 'Cron'}, - 'schedule': {'key': 'schedule', 'type': 'ScheduleBase'}, + "id": {"key": "id", "type": "str"}, + "provisioning_status": {"key": "provisioningStatus", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "action": {"key": "action", "type": "str"}, + "trigger_type": {"key": "triggerType", "type": "str"}, + "recurrence": {"key": "recurrence", "type": "Recurrence"}, + "cron": {"key": "cron", "type": "Cron"}, + "schedule": {"key": "schedule", "type": "ScheduleBase"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword status: Is the schedule enabled or disabled?. Possible values include: "Enabled", "Disabled". @@ -7575,12 +7696,12 @@ def __init__( super(ComputeStartStopSchedule, self).__init__(**kwargs) self.id = None self.provisioning_status = None - self.status = kwargs.get('status', None) - self.action = kwargs.get('action', None) - self.trigger_type = kwargs.get('trigger_type', None) - self.recurrence = kwargs.get('recurrence', None) - self.cron = kwargs.get('cron', None) - self.schedule = kwargs.get('schedule', None) + self.status = kwargs.get("status", None) + self.action = kwargs.get("action", None) + self.trigger_type = kwargs.get("trigger_type", None) + self.recurrence = kwargs.get("recurrence", None) + self.cron = kwargs.get("cron", None) + self.schedule = kwargs.get("schedule", None) class ContainerResourceRequirements(msrest.serialization.Model): @@ -7595,14 +7716,17 @@ class ContainerResourceRequirements(msrest.serialization.Model): """ _attribute_map = { - 'container_resource_limits': {'key': 'containerResourceLimits', 'type': 'ContainerResourceSettings'}, - 'container_resource_requests': {'key': 'containerResourceRequests', 'type': 'ContainerResourceSettings'}, + "container_resource_limits": { + "key": "containerResourceLimits", + "type": "ContainerResourceSettings", + }, + "container_resource_requests": { + "key": "containerResourceRequests", + "type": "ContainerResourceSettings", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword container_resource_limits: Container resource limit info:. :paramtype container_resource_limits: @@ -7612,8 +7736,12 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ContainerResourceSettings """ super(ContainerResourceRequirements, self).__init__(**kwargs) - self.container_resource_limits = kwargs.get('container_resource_limits', None) - self.container_resource_requests = kwargs.get('container_resource_requests', None) + self.container_resource_limits = kwargs.get( + "container_resource_limits", None + ) + self.container_resource_requests = kwargs.get( + "container_resource_requests", None + ) class ContainerResourceSettings(msrest.serialization.Model): @@ -7631,15 +7759,12 @@ class ContainerResourceSettings(msrest.serialization.Model): """ _attribute_map = { - 'cpu': {'key': 'cpu', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'memory': {'key': 'memory', 'type': 'str'}, + "cpu": {"key": "cpu", "type": "str"}, + "gpu": {"key": "gpu", "type": "str"}, + "memory": {"key": "memory", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword cpu: Number of vCPUs request/limit for container. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. @@ -7652,9 +7777,9 @@ def __init__( :paramtype memory: str """ super(ContainerResourceSettings, self).__init__(**kwargs) - self.cpu = kwargs.get('cpu', None) - self.gpu = kwargs.get('gpu', None) - self.memory = kwargs.get('memory', None) + self.cpu = kwargs.get("cpu", None) + self.gpu = kwargs.get("gpu", None) + self.memory = kwargs.get("memory", None) class CosmosDbSettings(msrest.serialization.Model): @@ -7665,19 +7790,21 @@ class CosmosDbSettings(msrest.serialization.Model): """ _attribute_map = { - 'collections_throughput': {'key': 'collectionsThroughput', 'type': 'int'}, + "collections_throughput": { + "key": "collectionsThroughput", + "type": "int", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword collections_throughput: The throughput of the collections in cosmosdb database. :paramtype collections_throughput: int """ super(CosmosDbSettings, self).__init__(**kwargs) - self.collections_throughput = kwargs.get('collections_throughput', None) + self.collections_throughput = kwargs.get( + "collections_throughput", None + ) class ScheduleActionBase(msrest.serialization.Model): @@ -7695,23 +7822,24 @@ class ScheduleActionBase(msrest.serialization.Model): """ _validation = { - 'action_type': {'required': True}, + "action_type": {"required": True}, } _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, + "action_type": {"key": "actionType", "type": "str"}, } _subtype_map = { - 'action_type': {'CreateJob': 'JobScheduleAction', 'CreateMonitor': 'CreateMonitorAction', 'ImportData': 'ImportDataAction', 'InvokeBatchEndpoint': 'EndpointScheduleAction'} + "action_type": { + "CreateJob": "JobScheduleAction", + "CreateMonitor": "CreateMonitorAction", + "ImportData": "ImportDataAction", + "InvokeBatchEndpoint": "EndpointScheduleAction", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ScheduleActionBase, self).__init__(**kwargs) self.action_type = None # type: Optional[str] @@ -7730,26 +7858,26 @@ class CreateMonitorAction(ScheduleActionBase): """ _validation = { - 'action_type': {'required': True}, - 'monitor_definition': {'required': True}, + "action_type": {"required": True}, + "monitor_definition": {"required": True}, } _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'monitor_definition': {'key': 'monitorDefinition', 'type': 'MonitorDefinition'}, + "action_type": {"key": "actionType", "type": "str"}, + "monitor_definition": { + "key": "monitorDefinition", + "type": "MonitorDefinition", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword monitor_definition: Required. [Required] Defines the monitor. :paramtype monitor_definition: ~azure.mgmt.machinelearningservices.models.MonitorDefinition """ super(CreateMonitorAction, self).__init__(**kwargs) - self.action_type = 'CreateMonitor' # type: str - self.monitor_definition = kwargs['monitor_definition'] + self.action_type = "CreateMonitor" # type: str + self.monitor_definition = kwargs["monitor_definition"] class Cron(msrest.serialization.Model): @@ -7767,15 +7895,12 @@ class Cron(msrest.serialization.Model): """ _attribute_map = { - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, + "start_time": {"key": "startTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "expression": {"key": "expression", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword start_time: The start time in yyyy-MM-ddTHH:mm:ss format. :paramtype start_time: str @@ -7788,9 +7913,9 @@ def __init__( :paramtype expression: str """ super(Cron, self).__init__(**kwargs) - self.start_time = kwargs.get('start_time', None) - self.time_zone = kwargs.get('time_zone', "UTC") - self.expression = kwargs.get('expression', None) + self.start_time = kwargs.get("start_time", None) + self.time_zone = kwargs.get("time_zone", "UTC") + self.expression = kwargs.get("expression", None) class TriggerBase(msrest.serialization.Model): @@ -7819,24 +7944,24 @@ class TriggerBase(msrest.serialization.Model): """ _validation = { - 'trigger_type': {'required': True}, + "trigger_type": {"required": True}, } _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, + "end_time": {"key": "endTime", "type": "str"}, + "start_time": {"key": "startTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "trigger_type": {"key": "triggerType", "type": "str"}, } _subtype_map = { - 'trigger_type': {'Cron': 'CronTrigger', 'Recurrence': 'RecurrenceTrigger'} + "trigger_type": { + "Cron": "CronTrigger", + "Recurrence": "RecurrenceTrigger", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer https://en.wikipedia.org/wiki/ISO_8601. @@ -7852,9 +7977,9 @@ def __init__( :paramtype time_zone: str """ super(TriggerBase, self).__init__(**kwargs) - self.end_time = kwargs.get('end_time', None) - self.start_time = kwargs.get('start_time', None) - self.time_zone = kwargs.get('time_zone', "UTC") + self.end_time = kwargs.get("end_time", None) + self.start_time = kwargs.get("start_time", None) + self.time_zone = kwargs.get("time_zone", "UTC") self.trigger_type = None # type: Optional[str] @@ -7884,22 +8009,23 @@ class CronTrigger(TriggerBase): """ _validation = { - 'trigger_type': {'required': True}, - 'expression': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "trigger_type": {"required": True}, + "expression": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, + "end_time": {"key": "endTime", "type": "str"}, + "start_time": {"key": "startTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "trigger_type": {"key": "triggerType", "type": "str"}, + "expression": {"key": "expression", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer https://en.wikipedia.org/wiki/ISO_8601. @@ -7918,8 +8044,8 @@ def __init__( :paramtype expression: str """ super(CronTrigger, self).__init__(**kwargs) - self.trigger_type = 'Cron' # type: str - self.expression = kwargs['expression'] + self.trigger_type = "Cron" # type: str + self.expression = kwargs["expression"] class CsvExportSummary(ExportSummary): @@ -7947,33 +8073,29 @@ class CsvExportSummary(ExportSummary): """ _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'container_name': {'readonly': True}, - 'snapshot_path': {'readonly': True}, + "end_date_time": {"readonly": True}, + "exported_row_count": {"readonly": True}, + "format": {"required": True}, + "labeling_job_id": {"readonly": True}, + "start_date_time": {"readonly": True}, + "container_name": {"readonly": True}, + "snapshot_path": {"readonly": True}, } _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'snapshot_path': {'key': 'snapshotPath', 'type': 'str'}, + "end_date_time": {"key": "endDateTime", "type": "iso-8601"}, + "exported_row_count": {"key": "exportedRowCount", "type": "long"}, + "format": {"key": "format", "type": "str"}, + "labeling_job_id": {"key": "labelingJobId", "type": "str"}, + "start_date_time": {"key": "startDateTime", "type": "iso-8601"}, + "container_name": {"key": "containerName", "type": "str"}, + "snapshot_path": {"key": "snapshotPath", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(CsvExportSummary, self).__init__(**kwargs) - self.format = 'CSV' # type: str + self.format = "CSV" # type: str self.container_name = None self.snapshot_path = None @@ -7991,26 +8113,23 @@ class CustomForecastHorizon(ForecastHorizon): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Required. [Required] Forecast horizon value. :paramtype value: int """ super(CustomForecastHorizon, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] + self.mode = "Custom" # type: str + self.value = kwargs["value"] class CustomInferencingServer(InferencingServer): @@ -8027,26 +8146,28 @@ class CustomInferencingServer(InferencingServer): """ _validation = { - 'server_type': {'required': True}, + "server_type": {"required": True}, } _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'inference_configuration': {'key': 'inferenceConfiguration', 'type': 'OnlineInferenceConfiguration'}, + "server_type": {"key": "serverType", "type": "str"}, + "inference_configuration": { + "key": "inferenceConfiguration", + "type": "OnlineInferenceConfiguration", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword inference_configuration: Inference configuration for custom inferencing. :paramtype inference_configuration: ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration """ super(CustomInferencingServer, self).__init__(**kwargs) - self.server_type = 'Custom' # type: str - self.inference_configuration = kwargs.get('inference_configuration', None) + self.server_type = "Custom" # type: str + self.inference_configuration = kwargs.get( + "inference_configuration", None + ) class CustomMetricThreshold(msrest.serialization.Model): @@ -8062,18 +8183,19 @@ class CustomMetricThreshold(msrest.serialization.Model): """ _validation = { - 'metric': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "metric": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'metric': {'key': 'metric', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, + "metric": {"key": "metric", "type": "str"}, + "threshold": {"key": "threshold", "type": "MonitoringThreshold"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword metric: Required. [Required] The user-defined metric to calculate. :paramtype metric: str @@ -8082,8 +8204,8 @@ def __init__( :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold """ super(CustomMetricThreshold, self).__init__(**kwargs) - self.metric = kwargs['metric'] - self.threshold = kwargs.get('threshold', None) + self.metric = kwargs["metric"] + self.threshold = kwargs.get("threshold", None) class JobInput(msrest.serialization.Model): @@ -8103,28 +8225,33 @@ class JobInput(msrest.serialization.Model): """ _validation = { - 'job_input_type': {'required': True}, + "job_input_type": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } _subtype_map = { - 'job_input_type': {'custom_model': 'CustomModelJobInput', 'literal': 'LiteralJobInput', 'mlflow_model': 'MLFlowModelJobInput', 'mltable': 'MLTableJobInput', 'triton_model': 'TritonModelJobInput', 'uri_file': 'UriFileJobInput', 'uri_folder': 'UriFolderJobInput'} + "job_input_type": { + "custom_model": "CustomModelJobInput", + "literal": "LiteralJobInput", + "mlflow_model": "MLFlowModelJobInput", + "mltable": "MLTableJobInput", + "triton_model": "TritonModelJobInput", + "uri_file": "UriFileJobInput", + "uri_folder": "UriFolderJobInput", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: Description for the input. :paramtype description: str """ super(JobInput, self).__init__(**kwargs) - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.job_input_type = None # type: Optional[str] @@ -8147,21 +8274,18 @@ class CustomModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "min_length": 1, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -8172,10 +8296,10 @@ def __init__( :paramtype description: str """ super(CustomModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'custom_model' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "custom_model" # type: str + self.description = kwargs.get("description", None) class JobOutput(msrest.serialization.Model): @@ -8195,28 +8319,32 @@ class JobOutput(msrest.serialization.Model): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } _subtype_map = { - 'job_output_type': {'custom_model': 'CustomModelJobOutput', 'mlflow_model': 'MLFlowModelJobOutput', 'mltable': 'MLTableJobOutput', 'triton_model': 'TritonModelJobOutput', 'uri_file': 'UriFileJobOutput', 'uri_folder': 'UriFolderJobOutput'} + "job_output_type": { + "custom_model": "CustomModelJobOutput", + "mlflow_model": "MLFlowModelJobOutput", + "mltable": "MLTableJobOutput", + "triton_model": "TritonModelJobOutput", + "uri_file": "UriFileJobOutput", + "uri_folder": "UriFolderJobOutput", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: Description for the output. :paramtype description: str """ super(JobOutput, self).__init__(**kwargs) - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.job_output_type = None # type: Optional[str] @@ -8245,23 +8373,23 @@ class CustomModelJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "asset_name": {"key": "assetName", "type": "str"}, + "asset_version": {"key": "assetVersion", "type": "str"}, + "auto_delete_setting": { + "key": "autoDeleteSetting", + "type": "AutoDeleteSetting", + }, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword asset_name: Output Asset Name. :paramtype asset_name: str @@ -8278,13 +8406,13 @@ def __init__( :paramtype description: str """ super(CustomModelJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.asset_version = kwargs.get('asset_version', None) - self.auto_delete_setting = kwargs.get('auto_delete_setting', None) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'custom_model' # type: str - self.description = kwargs.get('description', None) + self.asset_name = kwargs.get("asset_name", None) + self.asset_version = kwargs.get("asset_version", None) + self.auto_delete_setting = kwargs.get("auto_delete_setting", None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "custom_model" # type: str + self.description = kwargs.get("description", None) class MonitoringSignalBase(msrest.serialization.Model): @@ -8308,23 +8436,27 @@ class MonitoringSignalBase(msrest.serialization.Model): """ _validation = { - 'signal_type': {'required': True}, + "signal_type": {"required": True}, } _attribute_map = { - 'lookback_period': {'key': 'lookbackPeriod', 'type': 'duration'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, + "lookback_period": {"key": "lookbackPeriod", "type": "duration"}, + "mode": {"key": "mode", "type": "str"}, + "signal_type": {"key": "signalType", "type": "str"}, } _subtype_map = { - 'signal_type': {'Custom': 'CustomMonitoringSignal', 'DataDrift': 'DataDriftMonitoringSignal', 'DataQuality': 'DataQualityMonitoringSignal', 'FeatureAttributionDrift': 'FeatureAttributionDriftMonitoringSignal', 'ModelPerformanceSignalBase': 'ModelPerformanceSignalBase', 'PredictionDrift': 'PredictionDriftMonitoringSignal'} + "signal_type": { + "Custom": "CustomMonitoringSignal", + "DataDrift": "DataDriftMonitoringSignal", + "DataQuality": "DataQualityMonitoringSignal", + "FeatureAttributionDrift": "FeatureAttributionDriftMonitoringSignal", + "ModelPerformanceSignalBase": "ModelPerformanceSignalBase", + "PredictionDrift": "PredictionDriftMonitoringSignal", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword lookback_period: The amount of time a single monitor should look back over the target data on a given run. @@ -8334,8 +8466,8 @@ def __init__( :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.MonitoringNotificationMode """ super(MonitoringSignalBase, self).__init__(**kwargs) - self.lookback_period = kwargs.get('lookback_period', None) - self.mode = kwargs.get('mode', None) + self.lookback_period = kwargs.get("lookback_period", None) + self.mode = kwargs.get("mode", None) self.signal_type = None # type: Optional[str] @@ -8368,24 +8500,31 @@ class CustomMonitoringSignal(MonitoringSignalBase): """ _validation = { - 'signal_type': {'required': True}, - 'component_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'metric_thresholds': {'required': True}, + "signal_type": {"required": True}, + "component_id": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "metric_thresholds": {"required": True}, } _attribute_map = { - 'lookback_period': {'key': 'lookbackPeriod', 'type': 'duration'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'input_assets': {'key': 'inputAssets', 'type': '{MonitoringInputData}'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[CustomMetricThreshold]'}, + "lookback_period": {"key": "lookbackPeriod", "type": "duration"}, + "mode": {"key": "mode", "type": "str"}, + "signal_type": {"key": "signalType", "type": "str"}, + "component_id": {"key": "componentId", "type": "str"}, + "input_assets": { + "key": "inputAssets", + "type": "{MonitoringInputData}", + }, + "metric_thresholds": { + "key": "metricThresholds", + "type": "[CustomMetricThreshold]", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword lookback_period: The amount of time a single monitor should look back over the target data on a given run. @@ -8406,10 +8545,10 @@ def __init__( list[~azure.mgmt.machinelearningservices.models.CustomMetricThreshold] """ super(CustomMonitoringSignal, self).__init__(**kwargs) - self.signal_type = 'Custom' # type: str - self.component_id = kwargs['component_id'] - self.input_assets = kwargs.get('input_assets', None) - self.metric_thresholds = kwargs['metric_thresholds'] + self.signal_type = "Custom" # type: str + self.component_id = kwargs["component_id"] + self.input_assets = kwargs.get("input_assets", None) + self.metric_thresholds = kwargs["metric_thresholds"] class CustomNCrossValidations(NCrossValidations): @@ -8425,26 +8564,23 @@ class CustomNCrossValidations(NCrossValidations): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Required. [Required] N-Cross validations value. :paramtype value: int """ super(CustomNCrossValidations, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] + self.mode = "Custom" # type: str + self.value = kwargs["value"] class CustomSeasonality(Seasonality): @@ -8460,26 +8596,23 @@ class CustomSeasonality(Seasonality): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Required. [Required] Seasonality value. :paramtype value: int """ super(CustomSeasonality, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] + self.mode = "Custom" # type: str + self.value = kwargs["value"] class CustomService(msrest.serialization.Model): @@ -8504,19 +8637,19 @@ class CustomService(msrest.serialization.Model): """ _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'name': {'key': 'name', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'Image'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{EnvironmentVariable}'}, - 'docker': {'key': 'docker', 'type': 'Docker'}, - 'endpoints': {'key': 'endpoints', 'type': '[Endpoint]'}, - 'volumes': {'key': 'volumes', 'type': '[VolumeDefinition]'}, + "additional_properties": {"key": "", "type": "{object}"}, + "name": {"key": "name", "type": "str"}, + "image": {"key": "image", "type": "Image"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{EnvironmentVariable}", + }, + "docker": {"key": "docker", "type": "Docker"}, + "endpoints": {"key": "endpoints", "type": "[Endpoint]"}, + "volumes": {"key": "volumes", "type": "[VolumeDefinition]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword additional_properties: Unmatched properties from the message are deserialized to this collection. @@ -8536,13 +8669,13 @@ def __init__( :paramtype volumes: list[~azure.mgmt.machinelearningservices.models.VolumeDefinition] """ super(CustomService, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.name = kwargs.get('name', None) - self.image = kwargs.get('image', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.docker = kwargs.get('docker', None) - self.endpoints = kwargs.get('endpoints', None) - self.volumes = kwargs.get('volumes', None) + self.additional_properties = kwargs.get("additional_properties", None) + self.name = kwargs.get("name", None) + self.image = kwargs.get("image", None) + self.environment_variables = kwargs.get("environment_variables", None) + self.docker = kwargs.get("docker", None) + self.endpoints = kwargs.get("endpoints", None) + self.volumes = kwargs.get("volumes", None) class CustomTargetLags(TargetLags): @@ -8558,26 +8691,23 @@ class CustomTargetLags(TargetLags): """ _validation = { - 'mode': {'required': True}, - 'values': {'required': True}, + "mode": {"required": True}, + "values": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[int]'}, + "mode": {"key": "mode", "type": "str"}, + "values": {"key": "values", "type": "[int]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword values: Required. [Required] Set target lags values. :paramtype values: list[int] """ super(CustomTargetLags, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.values = kwargs['values'] + self.mode = "Custom" # type: str + self.values = kwargs["values"] class CustomTargetRollingWindowSize(TargetRollingWindowSize): @@ -8593,26 +8723,23 @@ class CustomTargetRollingWindowSize(TargetRollingWindowSize): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Required. [Required] TargetRollingWindowSize value. :paramtype value: int """ super(CustomTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Custom' # type: str - self.value = kwargs['value'] + self.mode = "Custom" # type: str + self.value = kwargs["value"] class DataImportSource(msrest.serialization.Model): @@ -8631,28 +8758,28 @@ class DataImportSource(msrest.serialization.Model): """ _validation = { - 'source_type': {'required': True}, + "source_type": {"required": True}, } _attribute_map = { - 'connection': {'key': 'connection', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, + "connection": {"key": "connection", "type": "str"}, + "source_type": {"key": "sourceType", "type": "str"}, } _subtype_map = { - 'source_type': {'database': 'DatabaseSource', 'file_system': 'FileSystemSource'} + "source_type": { + "database": "DatabaseSource", + "file_system": "FileSystemSource", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword connection: Workspace connection for data import source storage. :paramtype connection: str """ super(DataImportSource, self).__init__(**kwargs) - self.connection = kwargs.get('connection', None) + self.connection = kwargs.get("connection", None) self.source_type = None # type: Optional[str] @@ -8677,22 +8804,22 @@ class DatabaseSource(DataImportSource): """ _validation = { - 'source_type': {'required': True}, + "source_type": {"required": True}, } _attribute_map = { - 'connection': {'key': 'connection', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'query': {'key': 'query', 'type': 'str'}, - 'stored_procedure': {'key': 'storedProcedure', 'type': 'str'}, - 'stored_procedure_params': {'key': 'storedProcedureParams', 'type': '[{str}]'}, - 'table_name': {'key': 'tableName', 'type': 'str'}, + "connection": {"key": "connection", "type": "str"}, + "source_type": {"key": "sourceType", "type": "str"}, + "query": {"key": "query", "type": "str"}, + "stored_procedure": {"key": "storedProcedure", "type": "str"}, + "stored_procedure_params": { + "key": "storedProcedureParams", + "type": "[{str}]", + }, + "table_name": {"key": "tableName", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword connection: Workspace connection for data import source storage. :paramtype connection: str @@ -8706,11 +8833,13 @@ def __init__( :paramtype table_name: str """ super(DatabaseSource, self).__init__(**kwargs) - self.source_type = 'database' # type: str - self.query = kwargs.get('query', None) - self.stored_procedure = kwargs.get('stored_procedure', None) - self.stored_procedure_params = kwargs.get('stored_procedure_params', None) - self.table_name = kwargs.get('table_name', None) + self.source_type = "database" # type: str + self.query = kwargs.get("query", None) + self.stored_procedure = kwargs.get("stored_procedure", None) + self.stored_procedure_params = kwargs.get( + "stored_procedure_params", None + ) + self.table_name = kwargs.get("table_name", None) class DatabricksSchema(msrest.serialization.Model): @@ -8721,19 +8850,16 @@ class DatabricksSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, + "properties": {"key": "properties", "type": "DatabricksProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of Databricks. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties """ super(DatabricksSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class Databricks(Compute, DatabricksSchema): @@ -8775,32 +8901,32 @@ class Databricks(Compute, DatabricksSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "DatabricksProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of Databricks. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties @@ -8815,17 +8941,17 @@ def __init__( :paramtype disable_local_auth: bool """ super(Databricks, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'Databricks' # type: str - self.compute_location = kwargs.get('compute_location', None) + self.properties = kwargs.get("properties", None) + self.compute_type = "Databricks" # type: str + self.compute_location = kwargs.get("compute_location", None) self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) + self.disable_local_auth = kwargs.get("disable_local_auth", None) class DatabricksComputeSecretsProperties(msrest.serialization.Model): @@ -8836,22 +8962,26 @@ class DatabricksComputeSecretsProperties(msrest.serialization.Model): """ _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword databricks_access_token: access token for databricks account. :paramtype databricks_access_token: str """ super(DatabricksComputeSecretsProperties, self).__init__(**kwargs) - self.databricks_access_token = kwargs.get('databricks_access_token', None) + self.databricks_access_token = kwargs.get( + "databricks_access_token", None + ) -class DatabricksComputeSecrets(ComputeSecrets, DatabricksComputeSecretsProperties): +class DatabricksComputeSecrets( + ComputeSecrets, DatabricksComputeSecretsProperties +): """Secrets related to a Machine Learning compute based on Databricks. All required parameters must be populated in order to send to Azure. @@ -8865,25 +8995,27 @@ class DatabricksComputeSecrets(ComputeSecrets, DatabricksComputeSecretsPropertie """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, + "compute_type": {"key": "computeType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword databricks_access_token: access token for databricks account. :paramtype databricks_access_token: str """ super(DatabricksComputeSecrets, self).__init__(**kwargs) - self.databricks_access_token = kwargs.get('databricks_access_token', None) - self.compute_type = 'Databricks' # type: str + self.databricks_access_token = kwargs.get( + "databricks_access_token", None + ) + self.compute_type = "Databricks" # type: str class DatabricksProperties(msrest.serialization.Model): @@ -8896,14 +9028,14 @@ class DatabricksProperties(msrest.serialization.Model): """ _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'workspace_url': {'key': 'workspaceUrl', 'type': 'str'}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, + "workspace_url": {"key": "workspaceUrl", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword databricks_access_token: Databricks access token. :paramtype databricks_access_token: str @@ -8911,8 +9043,10 @@ def __init__( :paramtype workspace_url: str """ super(DatabricksProperties, self).__init__(**kwargs) - self.databricks_access_token = kwargs.get('databricks_access_token', None) - self.workspace_url = kwargs.get('workspace_url', None) + self.databricks_access_token = kwargs.get( + "databricks_access_token", None + ) + self.workspace_url = kwargs.get("workspace_url", None) class DataCollector(msrest.serialization.Model): @@ -8939,19 +9073,16 @@ class DataCollector(msrest.serialization.Model): """ _validation = { - 'collections': {'required': True}, + "collections": {"required": True}, } _attribute_map = { - 'collections': {'key': 'collections', 'type': '{Collection}'}, - 'request_logging': {'key': 'requestLogging', 'type': 'RequestLogging'}, - 'rolling_rate': {'key': 'rollingRate', 'type': 'str'}, + "collections": {"key": "collections", "type": "{Collection}"}, + "request_logging": {"key": "requestLogging", "type": "RequestLogging"}, + "rolling_rate": {"key": "rollingRate", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword collections: Required. [Required] The collection configuration. Each collection has it own configuration to collect model data and the name of collection can be arbitrary string. @@ -8971,9 +9102,9 @@ def __init__( :paramtype rolling_rate: str or ~azure.mgmt.machinelearningservices.models.RollingRateType """ super(DataCollector, self).__init__(**kwargs) - self.collections = kwargs['collections'] - self.request_logging = kwargs.get('request_logging', None) - self.rolling_rate = kwargs.get('rolling_rate', None) + self.collections = kwargs["collections"] + self.request_logging = kwargs.get("request_logging", None) + self.rolling_rate = kwargs.get("rolling_rate", None) class DataContainer(Resource): @@ -8999,31 +9130,28 @@ class DataContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "DataContainerProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataContainerProperties """ super(DataContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class DataContainerProperties(AssetContainer): @@ -9051,25 +9179,22 @@ class DataContainerProperties(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'data_type': {'required': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "data_type": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "data_type": {"key": "dataType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -9084,7 +9209,7 @@ def __init__( :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType """ super(DataContainerProperties, self).__init__(**kwargs) - self.data_type = kwargs['data_type'] + self.data_type = kwargs["data_type"] class DataContainerResourceArmPaginatedResult(msrest.serialization.Model): @@ -9098,14 +9223,11 @@ class DataContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[DataContainer]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of DataContainer objects. If null, there are no additional pages. @@ -9114,8 +9236,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataContainer] """ super(DataContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class DataDriftMonitoringSignal(MonitoringSignalBase): @@ -9148,27 +9270,33 @@ class DataDriftMonitoringSignal(MonitoringSignalBase): """ _validation = { - 'signal_type': {'required': True}, - 'baseline_data': {'required': True}, - 'metric_thresholds': {'required': True}, - 'target_data': {'required': True}, + "signal_type": {"required": True}, + "baseline_data": {"required": True}, + "metric_thresholds": {"required": True}, + "target_data": {"required": True}, } _attribute_map = { - 'lookback_period': {'key': 'lookbackPeriod', 'type': 'duration'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'baseline_data': {'key': 'baselineData', 'type': 'MonitoringInputData'}, - 'data_segment': {'key': 'dataSegment', 'type': 'MonitoringDataSegment'}, - 'features': {'key': 'features', 'type': 'MonitoringFeatureFilterBase'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[DataDriftMetricThresholdBase]'}, - 'target_data': {'key': 'targetData', 'type': 'MonitoringInputData'}, + "lookback_period": {"key": "lookbackPeriod", "type": "duration"}, + "mode": {"key": "mode", "type": "str"}, + "signal_type": {"key": "signalType", "type": "str"}, + "baseline_data": { + "key": "baselineData", + "type": "MonitoringInputData", + }, + "data_segment": { + "key": "dataSegment", + "type": "MonitoringDataSegment", + }, + "features": {"key": "features", "type": "MonitoringFeatureFilterBase"}, + "metric_thresholds": { + "key": "metricThresholds", + "type": "[DataDriftMetricThresholdBase]", + }, + "target_data": {"key": "targetData", "type": "MonitoringInputData"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword lookback_period: The amount of time a single monitor should look back over the target data on a given run. @@ -9190,12 +9318,12 @@ def __init__( :paramtype target_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData """ super(DataDriftMonitoringSignal, self).__init__(**kwargs) - self.signal_type = 'DataDrift' # type: str - self.baseline_data = kwargs['baseline_data'] - self.data_segment = kwargs.get('data_segment', None) - self.features = kwargs.get('features', None) - self.metric_thresholds = kwargs['metric_thresholds'] - self.target_data = kwargs['target_data'] + self.signal_type = "DataDrift" # type: str + self.baseline_data = kwargs["baseline_data"] + self.data_segment = kwargs.get("data_segment", None) + self.features = kwargs.get("features", None) + self.metric_thresholds = kwargs["metric_thresholds"] + self.target_data = kwargs["target_data"] class DataFactory(Compute): @@ -9235,31 +9363,31 @@ class DataFactory(Compute): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword compute_location: Location for the underlying compute. :paramtype compute_location: str @@ -9272,7 +9400,7 @@ def __init__( :paramtype disable_local_auth: bool """ super(DataFactory, self).__init__(**kwargs) - self.compute_type = 'DataFactory' # type: str + self.compute_type = "DataFactory" # type: str class DataVersionBaseProperties(AssetBase): @@ -9311,31 +9439,42 @@ class DataVersionBaseProperties(AssetBase): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "auto_delete_setting": { + "key": "autoDeleteSetting", + "type": "AutoDeleteSetting", + }, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, + "intellectual_property": { + "key": "intellectualProperty", + "type": "IntellectualProperty", + }, + "stage": {"key": "stage", "type": "str"}, } _subtype_map = { - 'data_type': {'mltable': 'MLTableData', 'uri_file': 'UriFileDataVersion', 'uri_folder': 'UriFolderDataVersion'} + "data_type": { + "mltable": "MLTableData", + "uri_file": "UriFileDataVersion", + "uri_folder": "UriFolderDataVersion", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -9362,10 +9501,10 @@ def __init__( :paramtype stage: str """ super(DataVersionBaseProperties, self).__init__(**kwargs) - self.data_type = 'DataVersionBaseProperties' # type: str - self.data_uri = kwargs['data_uri'] - self.intellectual_property = kwargs.get('intellectual_property', None) - self.stage = kwargs.get('stage', None) + self.data_type = "DataVersionBaseProperties" # type: str + self.data_uri = kwargs["data_uri"] + self.intellectual_property = kwargs.get("intellectual_property", None) + self.stage = kwargs.get("stage", None) class DataImport(DataVersionBaseProperties): @@ -9405,29 +9544,36 @@ class DataImport(DataVersionBaseProperties): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'DataImportSource'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "auto_delete_setting": { + "key": "autoDeleteSetting", + "type": "AutoDeleteSetting", + }, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, + "intellectual_property": { + "key": "intellectualProperty", + "type": "IntellectualProperty", + }, + "stage": {"key": "stage", "type": "str"}, + "asset_name": {"key": "assetName", "type": "str"}, + "source": {"key": "source", "type": "DataImportSource"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -9458,9 +9604,9 @@ def __init__( :paramtype source: ~azure.mgmt.machinelearningservices.models.DataImportSource """ super(DataImport, self).__init__(**kwargs) - self.data_type = 'uri_folder' # type: str - self.asset_name = kwargs.get('asset_name', None) - self.source = kwargs.get('source', None) + self.data_type = "uri_folder" # type: str + self.asset_name = kwargs.get("asset_name", None) + self.source = kwargs.get("source", None) class DataLakeAnalyticsSchema(msrest.serialization.Model): @@ -9472,20 +9618,20 @@ class DataLakeAnalyticsSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, + "properties": { + "key": "properties", + "type": "DataLakeAnalyticsSchemaProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsSchemaProperties """ super(DataLakeAnalyticsSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class DataLakeAnalytics(Compute, DataLakeAnalyticsSchema): @@ -9528,32 +9674,35 @@ class DataLakeAnalytics(Compute, DataLakeAnalyticsSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": { + "key": "properties", + "type": "DataLakeAnalyticsSchemaProperties", + }, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: :paramtype properties: @@ -9569,17 +9718,17 @@ def __init__( :paramtype disable_local_auth: bool """ super(DataLakeAnalytics, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'DataLakeAnalytics' # type: str - self.compute_location = kwargs.get('compute_location', None) + self.properties = kwargs.get("properties", None) + self.compute_type = "DataLakeAnalytics" # type: str + self.compute_location = kwargs.get("compute_location", None) self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) + self.disable_local_auth = kwargs.get("disable_local_auth", None) class DataLakeAnalyticsSchemaProperties(msrest.serialization.Model): @@ -9590,19 +9739,21 @@ class DataLakeAnalyticsSchemaProperties(msrest.serialization.Model): """ _attribute_map = { - 'data_lake_store_account_name': {'key': 'dataLakeStoreAccountName', 'type': 'str'}, + "data_lake_store_account_name": { + "key": "dataLakeStoreAccountName", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data_lake_store_account_name: DataLake Store Account Name. :paramtype data_lake_store_account_name: str """ super(DataLakeAnalyticsSchemaProperties, self).__init__(**kwargs) - self.data_lake_store_account_name = kwargs.get('data_lake_store_account_name', None) + self.data_lake_store_account_name = kwargs.get( + "data_lake_store_account_name", None + ) class DataPathAssetReference(AssetReferenceBase): @@ -9620,19 +9771,16 @@ class DataPathAssetReference(AssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'datastore_id': {'key': 'datastoreId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "datastore_id": {"key": "datastoreId", "type": "str"}, + "path": {"key": "path", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword datastore_id: ARM resource ID of the datastore where the asset is located. :paramtype datastore_id: str @@ -9640,9 +9788,9 @@ def __init__( :paramtype path: str """ super(DataPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'DataPath' # type: str - self.datastore_id = kwargs.get('datastore_id', None) - self.path = kwargs.get('path', None) + self.reference_type = "DataPath" # type: str + self.datastore_id = kwargs.get("datastore_id", None) + self.path = kwargs.get("path", None) class DataQualityMonitoringSignal(MonitoringSignalBase): @@ -9674,26 +9822,29 @@ class DataQualityMonitoringSignal(MonitoringSignalBase): """ _validation = { - 'signal_type': {'required': True}, - 'baseline_data': {'required': True}, - 'metric_thresholds': {'required': True}, - 'target_data': {'required': True}, + "signal_type": {"required": True}, + "baseline_data": {"required": True}, + "metric_thresholds": {"required": True}, + "target_data": {"required": True}, } _attribute_map = { - 'lookback_period': {'key': 'lookbackPeriod', 'type': 'duration'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'baseline_data': {'key': 'baselineData', 'type': 'MonitoringInputData'}, - 'features': {'key': 'features', 'type': 'MonitoringFeatureFilterBase'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[DataQualityMetricThresholdBase]'}, - 'target_data': {'key': 'targetData', 'type': 'MonitoringInputData'}, + "lookback_period": {"key": "lookbackPeriod", "type": "duration"}, + "mode": {"key": "mode", "type": "str"}, + "signal_type": {"key": "signalType", "type": "str"}, + "baseline_data": { + "key": "baselineData", + "type": "MonitoringInputData", + }, + "features": {"key": "features", "type": "MonitoringFeatureFilterBase"}, + "metric_thresholds": { + "key": "metricThresholds", + "type": "[DataQualityMetricThresholdBase]", + }, + "target_data": {"key": "targetData", "type": "MonitoringInputData"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword lookback_period: The amount of time a single monitor should look back over the target data on a given run. @@ -9714,11 +9865,11 @@ def __init__( :paramtype target_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData """ super(DataQualityMonitoringSignal, self).__init__(**kwargs) - self.signal_type = 'DataQuality' # type: str - self.baseline_data = kwargs['baseline_data'] - self.features = kwargs.get('features', None) - self.metric_thresholds = kwargs['metric_thresholds'] - self.target_data = kwargs['target_data'] + self.signal_type = "DataQuality" # type: str + self.baseline_data = kwargs["baseline_data"] + self.features = kwargs.get("features", None) + self.metric_thresholds = kwargs["metric_thresholds"] + self.target_data = kwargs["target_data"] class DatasetExportSummary(ExportSummary): @@ -9744,31 +9895,27 @@ class DatasetExportSummary(ExportSummary): """ _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'labeled_asset_name': {'readonly': True}, + "end_date_time": {"readonly": True}, + "exported_row_count": {"readonly": True}, + "format": {"required": True}, + "labeling_job_id": {"readonly": True}, + "start_date_time": {"readonly": True}, + "labeled_asset_name": {"readonly": True}, } _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'labeled_asset_name': {'key': 'labeledAssetName', 'type': 'str'}, + "end_date_time": {"key": "endDateTime", "type": "iso-8601"}, + "exported_row_count": {"key": "exportedRowCount", "type": "long"}, + "format": {"key": "format", "type": "str"}, + "labeling_job_id": {"key": "labelingJobId", "type": "str"}, + "start_date_time": {"key": "startDateTime", "type": "iso-8601"}, + "labeled_asset_name": {"key": "labeledAssetName", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DatasetExportSummary, self).__init__(**kwargs) - self.format = 'Dataset' # type: str + self.format = "Dataset" # type: str self.labeled_asset_name = None @@ -9795,31 +9942,28 @@ class Datastore(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DatastoreProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "DatastoreProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatastoreProperties """ super(Datastore, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class DatastoreResourceArmPaginatedResult(msrest.serialization.Model): @@ -9833,14 +9977,11 @@ class DatastoreResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Datastore]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[Datastore]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of Datastore objects. If null, there are no additional pages. @@ -9849,8 +9990,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.Datastore] """ super(DatastoreResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class DataVersionBase(Resource): @@ -9876,31 +10017,31 @@ class DataVersionBase(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataVersionBaseProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "DataVersionBaseProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataVersionBaseProperties """ super(DataVersionBase, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class DataVersionBaseResourceArmPaginatedResult(msrest.serialization.Model): @@ -9914,14 +10055,11 @@ class DataVersionBaseResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataVersionBase]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[DataVersionBase]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of DataVersionBase objects. If null, there are no additional pages. @@ -9929,9 +10067,11 @@ def __init__( :keyword value: An array of objects of type DataVersionBase. :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBase] """ - super(DataVersionBaseResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(DataVersionBaseResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class OnlineScaleSettings(msrest.serialization.Model): @@ -9948,23 +10088,22 @@ class OnlineScaleSettings(msrest.serialization.Model): """ _validation = { - 'scale_type': {'required': True}, + "scale_type": {"required": True}, } _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, + "scale_type": {"key": "scaleType", "type": "str"}, } _subtype_map = { - 'scale_type': {'Default': 'DefaultScaleSettings', 'TargetUtilization': 'TargetUtilizationScaleSettings'} + "scale_type": { + "Default": "DefaultScaleSettings", + "TargetUtilization": "TargetUtilizationScaleSettings", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(OnlineScaleSettings, self).__init__(**kwargs) self.scale_type = None # type: Optional[str] @@ -9980,21 +10119,17 @@ class DefaultScaleSettings(OnlineScaleSettings): """ _validation = { - 'scale_type': {'required': True}, + "scale_type": {"required": True}, } _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, + "scale_type": {"key": "scaleType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DefaultScaleSettings, self).__init__(**kwargs) - self.scale_type = 'Default' # type: str + self.scale_type = "Default" # type: str class DeploymentLogs(msrest.serialization.Model): @@ -10005,19 +10140,16 @@ class DeploymentLogs(msrest.serialization.Model): """ _attribute_map = { - 'content': {'key': 'content', 'type': 'str'}, + "content": {"key": "content", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword content: The retrieved online deployment logs. :paramtype content: str """ super(DeploymentLogs, self).__init__(**kwargs) - self.content = kwargs.get('content', None) + self.content = kwargs.get("content", None) class DeploymentLogsRequest(msrest.serialization.Model): @@ -10031,14 +10163,11 @@ class DeploymentLogsRequest(msrest.serialization.Model): """ _attribute_map = { - 'container_type': {'key': 'containerType', 'type': 'str'}, - 'tail': {'key': 'tail', 'type': 'int'}, + "container_type": {"key": "containerType", "type": "str"}, + "tail": {"key": "tail", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword container_type: The type of container to retrieve logs from. Possible values include: "StorageInitializer", "InferenceServer", "ModelDataCollector". @@ -10047,8 +10176,8 @@ def __init__( :paramtype tail: int """ super(DeploymentLogsRequest, self).__init__(**kwargs) - self.container_type = kwargs.get('container_type', None) - self.tail = kwargs.get('tail', None) + self.container_type = kwargs.get("container_type", None) + self.tail = kwargs.get("tail", None) class ResourceConfiguration(msrest.serialization.Model): @@ -10069,17 +10198,14 @@ class ResourceConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'max_instance_count': {'key': 'maxInstanceCount', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{object}'}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "locations": {"key": "locations", "type": "[str]"}, + "max_instance_count": {"key": "maxInstanceCount", "type": "int"}, + "properties": {"key": "properties", "type": "{object}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword instance_count: Optional number of instances or nodes used by the compute target. :paramtype instance_count: int @@ -10095,11 +10221,11 @@ def __init__( :paramtype properties: dict[str, any] """ super(ResourceConfiguration, self).__init__(**kwargs) - self.instance_count = kwargs.get('instance_count', 1) - self.instance_type = kwargs.get('instance_type', None) - self.locations = kwargs.get('locations', None) - self.max_instance_count = kwargs.get('max_instance_count', None) - self.properties = kwargs.get('properties', None) + self.instance_count = kwargs.get("instance_count", 1) + self.instance_type = kwargs.get("instance_type", None) + self.locations = kwargs.get("locations", None) + self.max_instance_count = kwargs.get("max_instance_count", None) + self.properties = kwargs.get("properties", None) class DeploymentResourceConfiguration(ResourceConfiguration): @@ -10120,17 +10246,14 @@ class DeploymentResourceConfiguration(ResourceConfiguration): """ _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'max_instance_count': {'key': 'maxInstanceCount', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{object}'}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "locations": {"key": "locations", "type": "[str]"}, + "max_instance_count": {"key": "maxInstanceCount", "type": "int"}, + "properties": {"key": "properties", "type": "{object}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword instance_count: Optional number of instances or nodes used by the compute target. :paramtype instance_count: int @@ -10172,21 +10295,21 @@ class DiagnoseRequestProperties(msrest.serialization.Model): """ _attribute_map = { - 'udr': {'key': 'udr', 'type': '{object}'}, - 'nsg': {'key': 'nsg', 'type': '{object}'}, - 'resource_lock': {'key': 'resourceLock', 'type': '{object}'}, - 'dns_resolution': {'key': 'dnsResolution', 'type': '{object}'}, - 'storage_account': {'key': 'storageAccount', 'type': '{object}'}, - 'key_vault': {'key': 'keyVault', 'type': '{object}'}, - 'container_registry': {'key': 'containerRegistry', 'type': '{object}'}, - 'application_insights': {'key': 'applicationInsights', 'type': '{object}'}, - 'others': {'key': 'others', 'type': '{object}'}, + "udr": {"key": "udr", "type": "{object}"}, + "nsg": {"key": "nsg", "type": "{object}"}, + "resource_lock": {"key": "resourceLock", "type": "{object}"}, + "dns_resolution": {"key": "dnsResolution", "type": "{object}"}, + "storage_account": {"key": "storageAccount", "type": "{object}"}, + "key_vault": {"key": "keyVault", "type": "{object}"}, + "container_registry": {"key": "containerRegistry", "type": "{object}"}, + "application_insights": { + "key": "applicationInsights", + "type": "{object}", + }, + "others": {"key": "others", "type": "{object}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword udr: Setting for diagnosing user defined routing. :paramtype udr: dict[str, any] @@ -10208,15 +10331,15 @@ def __init__( :paramtype others: dict[str, any] """ super(DiagnoseRequestProperties, self).__init__(**kwargs) - self.udr = kwargs.get('udr', None) - self.nsg = kwargs.get('nsg', None) - self.resource_lock = kwargs.get('resource_lock', None) - self.dns_resolution = kwargs.get('dns_resolution', None) - self.storage_account = kwargs.get('storage_account', None) - self.key_vault = kwargs.get('key_vault', None) - self.container_registry = kwargs.get('container_registry', None) - self.application_insights = kwargs.get('application_insights', None) - self.others = kwargs.get('others', None) + self.udr = kwargs.get("udr", None) + self.nsg = kwargs.get("nsg", None) + self.resource_lock = kwargs.get("resource_lock", None) + self.dns_resolution = kwargs.get("dns_resolution", None) + self.storage_account = kwargs.get("storage_account", None) + self.key_vault = kwargs.get("key_vault", None) + self.container_registry = kwargs.get("container_registry", None) + self.application_insights = kwargs.get("application_insights", None) + self.others = kwargs.get("others", None) class DiagnoseResponseResult(msrest.serialization.Model): @@ -10227,19 +10350,16 @@ class DiagnoseResponseResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseResponseResultValue'}, + "value": {"key": "value", "type": "DiagnoseResponseResultValue"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: :paramtype value: ~azure.mgmt.machinelearningservices.models.DiagnoseResponseResultValue """ super(DiagnoseResponseResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class DiagnoseResponseResultValue(msrest.serialization.Model): @@ -10272,21 +10392,42 @@ class DiagnoseResponseResultValue(msrest.serialization.Model): """ _attribute_map = { - 'user_defined_route_results': {'key': 'userDefinedRouteResults', 'type': '[DiagnoseResult]'}, - 'network_security_rule_results': {'key': 'networkSecurityRuleResults', 'type': '[DiagnoseResult]'}, - 'resource_lock_results': {'key': 'resourceLockResults', 'type': '[DiagnoseResult]'}, - 'dns_resolution_results': {'key': 'dnsResolutionResults', 'type': '[DiagnoseResult]'}, - 'storage_account_results': {'key': 'storageAccountResults', 'type': '[DiagnoseResult]'}, - 'key_vault_results': {'key': 'keyVaultResults', 'type': '[DiagnoseResult]'}, - 'container_registry_results': {'key': 'containerRegistryResults', 'type': '[DiagnoseResult]'}, - 'application_insights_results': {'key': 'applicationInsightsResults', 'type': '[DiagnoseResult]'}, - 'other_results': {'key': 'otherResults', 'type': '[DiagnoseResult]'}, - } - - def __init__( - self, - **kwargs - ): + "user_defined_route_results": { + "key": "userDefinedRouteResults", + "type": "[DiagnoseResult]", + }, + "network_security_rule_results": { + "key": "networkSecurityRuleResults", + "type": "[DiagnoseResult]", + }, + "resource_lock_results": { + "key": "resourceLockResults", + "type": "[DiagnoseResult]", + }, + "dns_resolution_results": { + "key": "dnsResolutionResults", + "type": "[DiagnoseResult]", + }, + "storage_account_results": { + "key": "storageAccountResults", + "type": "[DiagnoseResult]", + }, + "key_vault_results": { + "key": "keyVaultResults", + "type": "[DiagnoseResult]", + }, + "container_registry_results": { + "key": "containerRegistryResults", + "type": "[DiagnoseResult]", + }, + "application_insights_results": { + "key": "applicationInsightsResults", + "type": "[DiagnoseResult]", + }, + "other_results": {"key": "otherResults", "type": "[DiagnoseResult]"}, + } + + def __init__(self, **kwargs): """ :keyword user_defined_route_results: :paramtype user_defined_route_results: @@ -10315,15 +10456,27 @@ def __init__( :paramtype other_results: list[~azure.mgmt.machinelearningservices.models.DiagnoseResult] """ super(DiagnoseResponseResultValue, self).__init__(**kwargs) - self.user_defined_route_results = kwargs.get('user_defined_route_results', None) - self.network_security_rule_results = kwargs.get('network_security_rule_results', None) - self.resource_lock_results = kwargs.get('resource_lock_results', None) - self.dns_resolution_results = kwargs.get('dns_resolution_results', None) - self.storage_account_results = kwargs.get('storage_account_results', None) - self.key_vault_results = kwargs.get('key_vault_results', None) - self.container_registry_results = kwargs.get('container_registry_results', None) - self.application_insights_results = kwargs.get('application_insights_results', None) - self.other_results = kwargs.get('other_results', None) + self.user_defined_route_results = kwargs.get( + "user_defined_route_results", None + ) + self.network_security_rule_results = kwargs.get( + "network_security_rule_results", None + ) + self.resource_lock_results = kwargs.get("resource_lock_results", None) + self.dns_resolution_results = kwargs.get( + "dns_resolution_results", None + ) + self.storage_account_results = kwargs.get( + "storage_account_results", None + ) + self.key_vault_results = kwargs.get("key_vault_results", None) + self.container_registry_results = kwargs.get( + "container_registry_results", None + ) + self.application_insights_results = kwargs.get( + "application_insights_results", None + ) + self.other_results = kwargs.get("other_results", None) class DiagnoseResult(msrest.serialization.Model): @@ -10341,23 +10494,19 @@ class DiagnoseResult(msrest.serialization.Model): """ _validation = { - 'code': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, + "code": {"readonly": True}, + "level": {"readonly": True}, + "message": {"readonly": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, + "code": {"key": "code", "type": "str"}, + "level": {"key": "level", "type": "str"}, + "message": {"key": "message", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DiagnoseResult, self).__init__(**kwargs) self.code = None self.level = None @@ -10372,19 +10521,16 @@ class DiagnoseWorkspaceParameters(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseRequestProperties'}, + "value": {"key": "value", "type": "DiagnoseRequestProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Value of Parameters. :paramtype value: ~azure.mgmt.machinelearningservices.models.DiagnoseRequestProperties """ super(DiagnoseWorkspaceParameters, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class DistributionConfiguration(msrest.serialization.Model): @@ -10402,23 +10548,24 @@ class DistributionConfiguration(msrest.serialization.Model): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, + "distribution_type": {"key": "distributionType", "type": "str"}, } _subtype_map = { - 'distribution_type': {'Mpi': 'Mpi', 'PyTorch': 'PyTorch', 'Ray': 'Ray', 'TensorFlow': 'TensorFlow'} + "distribution_type": { + "Mpi": "Mpi", + "PyTorch": "PyTorch", + "Ray": "Ray", + "TensorFlow": "TensorFlow", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DistributionConfiguration, self).__init__(**kwargs) self.distribution_type = None # type: Optional[str] @@ -10434,14 +10581,11 @@ class Docker(msrest.serialization.Model): """ _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'privileged': {'key': 'privileged', 'type': 'bool'}, + "additional_properties": {"key": "", "type": "{object}"}, + "privileged": {"key": "privileged", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword additional_properties: Unmatched properties from the message are deserialized to this collection. @@ -10450,11 +10594,13 @@ def __init__( :paramtype privileged: bool """ super(Docker, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.privileged = kwargs.get('privileged', None) + self.additional_properties = kwargs.get("additional_properties", None) + self.privileged = kwargs.get("privileged", None) -class EmailMonitoringAlertNotificationSettings(MonitoringAlertNotificationSettingsBase): +class EmailMonitoringAlertNotificationSettings( + MonitoringAlertNotificationSettingsBase +): """EmailMonitoringAlertNotificationSettings. All required parameters must be populated in order to send to Azure. @@ -10469,26 +10615,33 @@ class EmailMonitoringAlertNotificationSettings(MonitoringAlertNotificationSettin """ _validation = { - 'alert_notification_type': {'required': True}, + "alert_notification_type": {"required": True}, } _attribute_map = { - 'alert_notification_type': {'key': 'alertNotificationType', 'type': 'str'}, - 'email_notification_setting': {'key': 'emailNotificationSetting', 'type': 'NotificationSetting'}, + "alert_notification_type": { + "key": "alertNotificationType", + "type": "str", + }, + "email_notification_setting": { + "key": "emailNotificationSetting", + "type": "NotificationSetting", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword email_notification_setting: Configuration for notification. :paramtype email_notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting """ - super(EmailMonitoringAlertNotificationSettings, self).__init__(**kwargs) - self.alert_notification_type = 'Email' # type: str - self.email_notification_setting = kwargs.get('email_notification_setting', None) + super(EmailMonitoringAlertNotificationSettings, self).__init__( + **kwargs + ) + self.alert_notification_type = "Email" # type: str + self.email_notification_setting = kwargs.get( + "email_notification_setting", None + ) class EncryptionKeyVaultProperties(msrest.serialization.Model): @@ -10507,20 +10660,17 @@ class EncryptionKeyVaultProperties(msrest.serialization.Model): """ _validation = { - 'key_vault_arm_id': {'required': True}, - 'key_identifier': {'required': True}, + "key_vault_arm_id": {"required": True}, + "key_identifier": {"required": True}, } _attribute_map = { - 'key_vault_arm_id': {'key': 'keyVaultArmId', 'type': 'str'}, - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - 'identity_client_id': {'key': 'identityClientId', 'type': 'str'}, + "key_vault_arm_id": {"key": "keyVaultArmId", "type": "str"}, + "key_identifier": {"key": "keyIdentifier", "type": "str"}, + "identity_client_id": {"key": "identityClientId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword key_vault_arm_id: Required. The ArmId of the keyVault where the customer owned encryption key is present. @@ -10532,9 +10682,9 @@ def __init__( :paramtype identity_client_id: str """ super(EncryptionKeyVaultProperties, self).__init__(**kwargs) - self.key_vault_arm_id = kwargs['key_vault_arm_id'] - self.key_identifier = kwargs['key_identifier'] - self.identity_client_id = kwargs.get('identity_client_id', None) + self.key_vault_arm_id = kwargs["key_vault_arm_id"] + self.key_identifier = kwargs["key_identifier"] + self.identity_client_id = kwargs.get("identity_client_id", None) class EncryptionKeyVaultUpdateProperties(msrest.serialization.Model): @@ -10547,23 +10697,20 @@ class EncryptionKeyVaultUpdateProperties(msrest.serialization.Model): """ _validation = { - 'key_identifier': {'required': True}, + "key_identifier": {"required": True}, } _attribute_map = { - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, + "key_identifier": {"key": "keyIdentifier", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword key_identifier: Required. Key Vault uri to access the encryption key. :paramtype key_identifier: str """ super(EncryptionKeyVaultUpdateProperties, self).__init__(**kwargs) - self.key_identifier = kwargs['key_identifier'] + self.key_identifier = kwargs["key_identifier"] class EncryptionProperty(msrest.serialization.Model): @@ -10582,20 +10729,20 @@ class EncryptionProperty(msrest.serialization.Model): """ _validation = { - 'status': {'required': True}, - 'key_vault_properties': {'required': True}, + "status": {"required": True}, + "key_vault_properties": {"required": True}, } _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityForCmk'}, - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'EncryptionKeyVaultProperties'}, + "status": {"key": "status", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityForCmk"}, + "key_vault_properties": { + "key": "keyVaultProperties", + "type": "EncryptionKeyVaultProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword status: Required. Indicates whether or not the encryption is enabled for the workspace. Possible values include: "Enabled", "Disabled". @@ -10608,9 +10755,9 @@ def __init__( ~azure.mgmt.machinelearningservices.models.EncryptionKeyVaultProperties """ super(EncryptionProperty, self).__init__(**kwargs) - self.status = kwargs['status'] - self.identity = kwargs.get('identity', None) - self.key_vault_properties = kwargs['key_vault_properties'] + self.status = kwargs["status"] + self.identity = kwargs.get("identity", None) + self.key_vault_properties = kwargs["key_vault_properties"] class EncryptionUpdateProperties(msrest.serialization.Model): @@ -10624,24 +10771,24 @@ class EncryptionUpdateProperties(msrest.serialization.Model): """ _validation = { - 'key_vault_properties': {'required': True}, + "key_vault_properties": {"required": True}, } _attribute_map = { - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'EncryptionKeyVaultUpdateProperties'}, + "key_vault_properties": { + "key": "keyVaultProperties", + "type": "EncryptionKeyVaultUpdateProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword key_vault_properties: Required. Customer Key vault properties. :paramtype key_vault_properties: ~azure.mgmt.machinelearningservices.models.EncryptionKeyVaultUpdateProperties """ super(EncryptionUpdateProperties, self).__init__(**kwargs) - self.key_vault_properties = kwargs['key_vault_properties'] + self.key_vault_properties = kwargs["key_vault_properties"] class Endpoint(msrest.serialization.Model): @@ -10661,17 +10808,14 @@ class Endpoint(msrest.serialization.Model): """ _attribute_map = { - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'int'}, - 'published': {'key': 'published', 'type': 'int'}, - 'host_ip': {'key': 'hostIp', 'type': 'str'}, + "protocol": {"key": "protocol", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "target": {"key": "target", "type": "int"}, + "published": {"key": "published", "type": "int"}, + "host_ip": {"key": "hostIp", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword protocol: Protocol over which communication will happen over this endpoint. Possible values include: "tcp", "udp", "http". Default value: "tcp". @@ -10686,11 +10830,11 @@ def __init__( :paramtype host_ip: str """ super(Endpoint, self).__init__(**kwargs) - self.protocol = kwargs.get('protocol', "tcp") - self.name = kwargs.get('name', None) - self.target = kwargs.get('target', None) - self.published = kwargs.get('published', None) - self.host_ip = kwargs.get('host_ip', None) + self.protocol = kwargs.get("protocol", "tcp") + self.name = kwargs.get("name", None) + self.target = kwargs.get("target", None) + self.published = kwargs.get("published", None) + self.host_ip = kwargs.get("host_ip", None) class EndpointAuthKeys(msrest.serialization.Model): @@ -10703,14 +10847,11 @@ class EndpointAuthKeys(msrest.serialization.Model): """ _attribute_map = { - 'primary_key': {'key': 'primaryKey', 'type': 'str'}, - 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, + "primary_key": {"key": "primaryKey", "type": "str"}, + "secondary_key": {"key": "secondaryKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword primary_key: The primary key. :paramtype primary_key: str @@ -10718,8 +10859,8 @@ def __init__( :paramtype secondary_key: str """ super(EndpointAuthKeys, self).__init__(**kwargs) - self.primary_key = kwargs.get('primary_key', None) - self.secondary_key = kwargs.get('secondary_key', None) + self.primary_key = kwargs.get("primary_key", None) + self.secondary_key = kwargs.get("secondary_key", None) class EndpointAuthToken(msrest.serialization.Model): @@ -10736,16 +10877,16 @@ class EndpointAuthToken(msrest.serialization.Model): """ _attribute_map = { - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'expiry_time_utc': {'key': 'expiryTimeUtc', 'type': 'long'}, - 'refresh_after_time_utc': {'key': 'refreshAfterTimeUtc', 'type': 'long'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, + "access_token": {"key": "accessToken", "type": "str"}, + "expiry_time_utc": {"key": "expiryTimeUtc", "type": "long"}, + "refresh_after_time_utc": { + "key": "refreshAfterTimeUtc", + "type": "long", + }, + "token_type": {"key": "tokenType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword access_token: Access token for endpoint authentication. :paramtype access_token: str @@ -10757,10 +10898,10 @@ def __init__( :paramtype token_type: str """ super(EndpointAuthToken, self).__init__(**kwargs) - self.access_token = kwargs.get('access_token', None) - self.expiry_time_utc = kwargs.get('expiry_time_utc', 0) - self.refresh_after_time_utc = kwargs.get('refresh_after_time_utc', 0) - self.token_type = kwargs.get('token_type', None) + self.access_token = kwargs.get("access_token", None) + self.expiry_time_utc = kwargs.get("expiry_time_utc", 0) + self.refresh_after_time_utc = kwargs.get("refresh_after_time_utc", 0) + self.token_type = kwargs.get("token_type", None) class EndpointScheduleAction(ScheduleActionBase): @@ -10774,41 +10915,43 @@ class EndpointScheduleAction(ScheduleActionBase): :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType :ivar endpoint_invocation_definition: Required. [Required] Defines Schedule action definition details. - - - .. raw:: html - + + + .. raw:: html + . :vartype endpoint_invocation_definition: any """ _validation = { - 'action_type': {'required': True}, - 'endpoint_invocation_definition': {'required': True}, + "action_type": {"required": True}, + "endpoint_invocation_definition": {"required": True}, } _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'endpoint_invocation_definition': {'key': 'endpointInvocationDefinition', 'type': 'object'}, + "action_type": {"key": "actionType", "type": "str"}, + "endpoint_invocation_definition": { + "key": "endpointInvocationDefinition", + "type": "object", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword endpoint_invocation_definition: Required. [Required] Defines Schedule action definition details. - - + + .. raw:: html - + . :paramtype endpoint_invocation_definition: any """ super(EndpointScheduleAction, self).__init__(**kwargs) - self.action_type = 'InvokeBatchEndpoint' # type: str - self.endpoint_invocation_definition = kwargs['endpoint_invocation_definition'] + self.action_type = "InvokeBatchEndpoint" # type: str + self.endpoint_invocation_definition = kwargs[ + "endpoint_invocation_definition" + ] class EnvironmentContainer(Resource): @@ -10834,32 +10977,32 @@ class EnvironmentContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "EnvironmentContainerProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentContainerProperties """ super(EnvironmentContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class EnvironmentContainerProperties(AssetContainer): @@ -10886,25 +11029,22 @@ class EnvironmentContainerProperties(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -10919,7 +11059,9 @@ def __init__( self.provisioning_state = None -class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model): +class EnvironmentContainerResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of EnvironmentContainer entities. :ivar next_link: The link to the next page of EnvironmentContainer objects. If null, there are @@ -10930,14 +11072,11 @@ class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model) """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[EnvironmentContainer]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of EnvironmentContainer objects. If null, there are no additional pages. @@ -10945,9 +11084,11 @@ def __init__( :keyword value: An array of objects of type EnvironmentContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] """ - super(EnvironmentContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(EnvironmentContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class EnvironmentVariable(msrest.serialization.Model): @@ -10964,15 +11105,12 @@ class EnvironmentVariable(msrest.serialization.Model): """ _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "additional_properties": {"key": "", "type": "{object}"}, + "type": {"key": "type", "type": "str"}, + "value": {"key": "value", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword additional_properties: Unmatched properties from the message are deserialized to this collection. @@ -10984,9 +11122,9 @@ def __init__( :paramtype value: str """ super(EnvironmentVariable, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.type = kwargs.get('type', "local") - self.value = kwargs.get('value', None) + self.additional_properties = kwargs.get("additional_properties", None) + self.type = kwargs.get("type", "local") + self.value = kwargs.get("value", None) class EnvironmentVersion(Resource): @@ -11012,31 +11150,31 @@ class EnvironmentVersion(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentVersionProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "EnvironmentVersionProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.EnvironmentVersionProperties """ super(EnvironmentVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class EnvironmentVersionProperties(AssetBase): @@ -11065,29 +11203,29 @@ class EnvironmentVersionProperties(AssetBase): :vartype build: ~azure.mgmt.machinelearningservices.models.BuildContext :ivar conda_file: Standard configuration file used by Conda that lets you install any kind of package, including Python, R, and C/C++ packages. - - + + .. raw:: html - + . :vartype conda_file: str :ivar environment_type: Environment type is either user managed or curated by the Azure ML service - - + + .. raw:: html - + . Possible values include: "Curated", "UserCreated". :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType :ivar image: Name of the image that will be used for the environment. - - + + .. raw:: html - + . @@ -11109,33 +11247,39 @@ class EnvironmentVersionProperties(AssetBase): """ _validation = { - 'environment_type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "environment_type": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'auto_rebuild': {'key': 'autoRebuild', 'type': 'str'}, - 'build': {'key': 'build', 'type': 'BuildContext'}, - 'conda_file': {'key': 'condaFile', 'type': 'str'}, - 'environment_type': {'key': 'environmentType', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'str'}, - 'inference_config': {'key': 'inferenceConfig', 'type': 'InferenceContainerProperties'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "auto_delete_setting": { + "key": "autoDeleteSetting", + "type": "AutoDeleteSetting", + }, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "auto_rebuild": {"key": "autoRebuild", "type": "str"}, + "build": {"key": "build", "type": "BuildContext"}, + "conda_file": {"key": "condaFile", "type": "str"}, + "environment_type": {"key": "environmentType", "type": "str"}, + "image": {"key": "image", "type": "str"}, + "inference_config": { + "key": "inferenceConfig", + "type": "InferenceContainerProperties", + }, + "intellectual_property": { + "key": "intellectualProperty", + "type": "IntellectualProperty", + }, + "os_type": {"key": "osType", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "stage": {"key": "stage", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -11158,19 +11302,19 @@ def __init__( :paramtype build: ~azure.mgmt.machinelearningservices.models.BuildContext :keyword conda_file: Standard configuration file used by Conda that lets you install any kind of package, including Python, R, and C/C++ packages. - - + + .. raw:: html - + . :paramtype conda_file: str :keyword image: Name of the image that will be used for the environment. - - + + .. raw:: html - + . @@ -11188,16 +11332,16 @@ def __init__( :paramtype stage: str """ super(EnvironmentVersionProperties, self).__init__(**kwargs) - self.auto_rebuild = kwargs.get('auto_rebuild', None) - self.build = kwargs.get('build', None) - self.conda_file = kwargs.get('conda_file', None) + self.auto_rebuild = kwargs.get("auto_rebuild", None) + self.build = kwargs.get("build", None) + self.conda_file = kwargs.get("conda_file", None) self.environment_type = None - self.image = kwargs.get('image', None) - self.inference_config = kwargs.get('inference_config', None) - self.intellectual_property = kwargs.get('intellectual_property', None) - self.os_type = kwargs.get('os_type', None) + self.image = kwargs.get("image", None) + self.inference_config = kwargs.get("inference_config", None) + self.intellectual_property = kwargs.get("intellectual_property", None) + self.os_type = kwargs.get("os_type", None) self.provisioning_state = None - self.stage = kwargs.get('stage', None) + self.stage = kwargs.get("stage", None) class EnvironmentVersionResourceArmPaginatedResult(msrest.serialization.Model): @@ -11211,14 +11355,11 @@ class EnvironmentVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentVersion]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[EnvironmentVersion]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of EnvironmentVersion objects. If null, there are no additional pages. @@ -11226,9 +11367,11 @@ def __init__( :keyword value: An array of objects of type EnvironmentVersion. :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] """ - super(EnvironmentVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(EnvironmentVersionResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class ErrorAdditionalInfo(msrest.serialization.Model): @@ -11243,21 +11386,17 @@ class ErrorAdditionalInfo(msrest.serialization.Model): """ _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, + "type": {"readonly": True}, + "info": {"readonly": True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, + "type": {"key": "type", "type": "str"}, + "info": {"key": "info", "type": "object"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ErrorAdditionalInfo, self).__init__(**kwargs) self.type = None self.info = None @@ -11281,27 +11420,26 @@ class ErrorDetail(msrest.serialization.Model): """ _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, + "code": {"readonly": True}, + "message": {"readonly": True}, + "target": {"readonly": True}, + "details": {"readonly": True}, + "additional_info": {"readonly": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[ErrorDetail]"}, + "additional_info": { + "key": "additionalInfo", + "type": "[ErrorAdditionalInfo]", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ErrorDetail, self).__init__(**kwargs) self.code = None self.message = None @@ -11318,19 +11456,16 @@ class ErrorResponse(msrest.serialization.Model): """ _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, + "error": {"key": "error", "type": "ErrorDetail"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword error: The error object. :paramtype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail """ super(ErrorResponse, self).__init__(**kwargs) - self.error = kwargs.get('error', None) + self.error = kwargs.get("error", None) class EstimatedVMPrice(msrest.serialization.Model): @@ -11349,21 +11484,18 @@ class EstimatedVMPrice(msrest.serialization.Model): """ _validation = { - 'retail_price': {'required': True}, - 'os_type': {'required': True}, - 'vm_tier': {'required': True}, + "retail_price": {"required": True}, + "os_type": {"required": True}, + "vm_tier": {"required": True}, } _attribute_map = { - 'retail_price': {'key': 'retailPrice', 'type': 'float'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_tier': {'key': 'vmTier', 'type': 'str'}, + "retail_price": {"key": "retailPrice", "type": "float"}, + "os_type": {"key": "osType", "type": "str"}, + "vm_tier": {"key": "vmTier", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword retail_price: Required. The price charged for using the VM. :paramtype retail_price: float @@ -11375,9 +11507,9 @@ def __init__( :paramtype vm_tier: str or ~azure.mgmt.machinelearningservices.models.VMTier """ super(EstimatedVMPrice, self).__init__(**kwargs) - self.retail_price = kwargs['retail_price'] - self.os_type = kwargs['os_type'] - self.vm_tier = kwargs['vm_tier'] + self.retail_price = kwargs["retail_price"] + self.os_type = kwargs["os_type"] + self.vm_tier = kwargs["vm_tier"] class EstimatedVMPrices(msrest.serialization.Model): @@ -11397,21 +11529,18 @@ class EstimatedVMPrices(msrest.serialization.Model): """ _validation = { - 'billing_currency': {'required': True}, - 'unit_of_measure': {'required': True}, - 'values': {'required': True}, + "billing_currency": {"required": True}, + "unit_of_measure": {"required": True}, + "values": {"required": True}, } _attribute_map = { - 'billing_currency': {'key': 'billingCurrency', 'type': 'str'}, - 'unit_of_measure': {'key': 'unitOfMeasure', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[EstimatedVMPrice]'}, + "billing_currency": {"key": "billingCurrency", "type": "str"}, + "unit_of_measure": {"key": "unitOfMeasure", "type": "str"}, + "values": {"key": "values", "type": "[EstimatedVMPrice]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword billing_currency: Required. Three lettered code specifying the currency of the VM price. Example: USD. Possible values include: "USD". @@ -11424,9 +11553,9 @@ def __init__( :paramtype values: list[~azure.mgmt.machinelearningservices.models.EstimatedVMPrice] """ super(EstimatedVMPrices, self).__init__(**kwargs) - self.billing_currency = kwargs['billing_currency'] - self.unit_of_measure = kwargs['unit_of_measure'] - self.values = kwargs['values'] + self.billing_currency = kwargs["billing_currency"] + self.unit_of_measure = kwargs["unit_of_measure"] + self.values = kwargs["values"] class ExternalFQDNResponse(msrest.serialization.Model): @@ -11437,19 +11566,16 @@ class ExternalFQDNResponse(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[FQDNEndpoints]'}, + "value": {"key": "value", "type": "[FQDNEndpoints]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: :paramtype value: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoints] """ super(ExternalFQDNResponse, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class Feature(Resource): @@ -11475,31 +11601,28 @@ class Feature(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeatureProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "FeatureProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.FeatureProperties """ super(Feature, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class FeatureAttributionDriftMonitoringSignal(MonitoringSignalBase): @@ -11531,27 +11654,30 @@ class FeatureAttributionDriftMonitoringSignal(MonitoringSignalBase): """ _validation = { - 'signal_type': {'required': True}, - 'baseline_data': {'required': True}, - 'metric_threshold': {'required': True}, - 'model_type': {'required': True}, - 'target_data': {'required': True}, + "signal_type": {"required": True}, + "baseline_data": {"required": True}, + "metric_threshold": {"required": True}, + "model_type": {"required": True}, + "target_data": {"required": True}, } _attribute_map = { - 'lookback_period': {'key': 'lookbackPeriod', 'type': 'duration'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'baseline_data': {'key': 'baselineData', 'type': 'MonitoringInputData'}, - 'metric_threshold': {'key': 'metricThreshold', 'type': 'FeatureAttributionMetricThreshold'}, - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'target_data': {'key': 'targetData', 'type': 'MonitoringInputData'}, + "lookback_period": {"key": "lookbackPeriod", "type": "duration"}, + "mode": {"key": "mode", "type": "str"}, + "signal_type": {"key": "signalType", "type": "str"}, + "baseline_data": { + "key": "baselineData", + "type": "MonitoringInputData", + }, + "metric_threshold": { + "key": "metricThreshold", + "type": "FeatureAttributionMetricThreshold", + }, + "model_type": {"key": "modelType", "type": "str"}, + "target_data": {"key": "targetData", "type": "MonitoringInputData"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword lookback_period: The amount of time a single monitor should look back over the target data on a given run. @@ -11572,11 +11698,11 @@ def __init__( :paramtype target_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData """ super(FeatureAttributionDriftMonitoringSignal, self).__init__(**kwargs) - self.signal_type = 'FeatureAttributionDrift' # type: str - self.baseline_data = kwargs['baseline_data'] - self.metric_threshold = kwargs['metric_threshold'] - self.model_type = kwargs['model_type'] - self.target_data = kwargs['target_data'] + self.signal_type = "FeatureAttributionDrift" # type: str + self.baseline_data = kwargs["baseline_data"] + self.metric_threshold = kwargs["metric_threshold"] + self.model_type = kwargs["model_type"] + self.target_data = kwargs["target_data"] class FeatureAttributionMetricThreshold(msrest.serialization.Model): @@ -11593,18 +11719,15 @@ class FeatureAttributionMetricThreshold(msrest.serialization.Model): """ _validation = { - 'metric': {'required': True}, + "metric": {"required": True}, } _attribute_map = { - 'metric': {'key': 'metric', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, + "metric": {"key": "metric", "type": "str"}, + "threshold": {"key": "threshold", "type": "MonitoringThreshold"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword metric: Required. [Required] The feature attribution metric to calculate. Possible values include: "NormalizedDiscountedCumulativeGain". @@ -11614,8 +11737,8 @@ def __init__( :paramtype threshold: ~azure.mgmt.machinelearningservices.models.MonitoringThreshold """ super(FeatureAttributionMetricThreshold, self).__init__(**kwargs) - self.metric = kwargs['metric'] - self.threshold = kwargs.get('threshold', None) + self.metric = kwargs["metric"] + self.threshold = kwargs.get("threshold", None) class FeatureProperties(ResourceBase): @@ -11635,17 +11758,14 @@ class FeatureProperties(ResourceBase): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'feature_name': {'key': 'featureName', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "data_type": {"key": "dataType", "type": "str"}, + "feature_name": {"key": "featureName", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -11660,8 +11780,8 @@ def __init__( :paramtype feature_name: str """ super(FeatureProperties, self).__init__(**kwargs) - self.data_type = kwargs.get('data_type', None) - self.feature_name = kwargs.get('feature_name', None) + self.data_type = kwargs.get("data_type", None) + self.feature_name = kwargs.get("feature_name", None) class FeatureResourceArmPaginatedResult(msrest.serialization.Model): @@ -11675,14 +11795,11 @@ class FeatureResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Feature]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[Feature]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of Feature objects. If null, there are no additional pages. @@ -11691,8 +11808,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.Feature] """ super(FeatureResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class FeaturesetContainer(Resource): @@ -11718,31 +11835,31 @@ class FeaturesetContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturesetContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "FeaturesetContainerProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetContainerProperties """ super(FeaturesetContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class FeaturesetContainerProperties(AssetContainer): @@ -11769,25 +11886,22 @@ class FeaturesetContainerProperties(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -11802,7 +11916,9 @@ def __init__( self.provisioning_state = None -class FeaturesetContainerResourceArmPaginatedResult(msrest.serialization.Model): +class FeaturesetContainerResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of FeaturesetContainer entities. :ivar next_link: The link to the next page of FeaturesetContainer objects. If null, there are @@ -11813,14 +11929,11 @@ class FeaturesetContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturesetContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[FeaturesetContainer]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of FeaturesetContainer objects. If null, there are no additional pages. @@ -11828,9 +11941,11 @@ def __init__( :keyword value: An array of objects of type FeaturesetContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetContainer] """ - super(FeaturesetContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(FeaturesetContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class FeaturesetJob(msrest.serialization.Model): @@ -11860,21 +11975,18 @@ class FeaturesetJob(msrest.serialization.Model): """ _attribute_map = { - 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'duration': {'key': 'duration', 'type': 'duration'}, - 'experiment_id': {'key': 'experimentId', 'type': 'str'}, - 'feature_window': {'key': 'featureWindow', 'type': 'FeatureWindow'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'type': {'key': 'type', 'type': 'str'}, + "created_date": {"key": "createdDate", "type": "iso-8601"}, + "display_name": {"key": "displayName", "type": "str"}, + "duration": {"key": "duration", "type": "duration"}, + "experiment_id": {"key": "experimentId", "type": "str"}, + "feature_window": {"key": "featureWindow", "type": "FeatureWindow"}, + "job_id": {"key": "jobId", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "type": {"key": "type", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword created_date: Specifies the created date. :paramtype created_date: ~datetime.datetime @@ -11899,15 +12011,15 @@ def __init__( :paramtype type: str or ~azure.mgmt.machinelearningservices.models.FeaturestoreJobType """ super(FeaturesetJob, self).__init__(**kwargs) - self.created_date = kwargs.get('created_date', None) - self.display_name = kwargs.get('display_name', None) - self.duration = kwargs.get('duration', None) - self.experiment_id = kwargs.get('experiment_id', None) - self.feature_window = kwargs.get('feature_window', None) - self.job_id = kwargs.get('job_id', None) - self.status = kwargs.get('status', None) - self.tags = kwargs.get('tags', None) - self.type = kwargs.get('type', None) + self.created_date = kwargs.get("created_date", None) + self.display_name = kwargs.get("display_name", None) + self.duration = kwargs.get("duration", None) + self.experiment_id = kwargs.get("experiment_id", None) + self.feature_window = kwargs.get("feature_window", None) + self.job_id = kwargs.get("job_id", None) + self.status = kwargs.get("status", None) + self.tags = kwargs.get("tags", None) + self.type = kwargs.get("type", None) class FeaturesetJobArmPaginatedResult(msrest.serialization.Model): @@ -11921,14 +12033,11 @@ class FeaturesetJobArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturesetJob]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[FeaturesetJob]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of FeaturesetJob objects. If null, there are no additional pages. @@ -11937,8 +12046,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetJob] """ super(FeaturesetJobArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class FeaturesetSpecification(msrest.serialization.Model): @@ -11949,19 +12058,16 @@ class FeaturesetSpecification(msrest.serialization.Model): """ _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, + "path": {"key": "path", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword path: Specifies the spec path. :paramtype path: str """ super(FeaturesetSpecification, self).__init__(**kwargs) - self.path = kwargs.get('path', None) + self.path = kwargs.get("path", None) class FeaturesetVersion(Resource): @@ -11987,31 +12093,31 @@ class FeaturesetVersion(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturesetVersionProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "FeaturesetVersionProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetVersionProperties """ super(FeaturesetVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class FeaturesetVersionBackfillRequest(msrest.serialization.Model): @@ -12032,18 +12138,18 @@ class FeaturesetVersionBackfillRequest(msrest.serialization.Model): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'feature_window': {'key': 'featureWindow', 'type': 'FeatureWindow'}, - 'resource': {'key': 'resource', 'type': 'MaterializationComputeResource'}, - 'spark_configuration': {'key': 'sparkConfiguration', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "description": {"key": "description", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "feature_window": {"key": "featureWindow", "type": "FeatureWindow"}, + "resource": { + "key": "resource", + "type": "MaterializationComputeResource", + }, + "spark_configuration": {"key": "sparkConfiguration", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: Specifies description. :paramtype description: str @@ -12059,12 +12165,12 @@ def __init__( :paramtype tags: dict[str, str] """ super(FeaturesetVersionBackfillRequest, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.display_name = kwargs.get('display_name', None) - self.feature_window = kwargs.get('feature_window', None) - self.resource = kwargs.get('resource', None) - self.spark_configuration = kwargs.get('spark_configuration', None) - self.tags = kwargs.get('tags', None) + self.description = kwargs.get("description", None) + self.display_name = kwargs.get("display_name", None) + self.feature_window = kwargs.get("feature_window", None) + self.resource = kwargs.get("resource", None) + self.spark_configuration = kwargs.get("spark_configuration", None) + self.tags = kwargs.get("tags", None) class FeaturesetVersionProperties(AssetBase): @@ -12102,27 +12208,33 @@ class FeaturesetVersionProperties(AssetBase): """ _validation = { - 'provisioning_state': {'readonly': True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'entities': {'key': 'entities', 'type': '[str]'}, - 'materialization_settings': {'key': 'materializationSettings', 'type': 'MaterializationSettings'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'specification': {'key': 'specification', 'type': 'FeaturesetSpecification'}, - 'stage': {'key': 'stage', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "auto_delete_setting": { + "key": "autoDeleteSetting", + "type": "AutoDeleteSetting", + }, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "entities": {"key": "entities", "type": "[str]"}, + "materialization_settings": { + "key": "materializationSettings", + "type": "MaterializationSettings", + }, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "specification": { + "key": "specification", + "type": "FeaturesetSpecification", + }, + "stage": {"key": "stage", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -12149,11 +12261,13 @@ def __init__( :paramtype stage: str """ super(FeaturesetVersionProperties, self).__init__(**kwargs) - self.entities = kwargs.get('entities', None) - self.materialization_settings = kwargs.get('materialization_settings', None) + self.entities = kwargs.get("entities", None) + self.materialization_settings = kwargs.get( + "materialization_settings", None + ) self.provisioning_state = None - self.specification = kwargs.get('specification', None) - self.stage = kwargs.get('stage', None) + self.specification = kwargs.get("specification", None) + self.stage = kwargs.get("stage", None) class FeaturesetVersionResourceArmPaginatedResult(msrest.serialization.Model): @@ -12167,14 +12281,11 @@ class FeaturesetVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturesetVersion]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[FeaturesetVersion]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of FeaturesetVersion objects. If null, there are no additional pages. @@ -12182,9 +12293,11 @@ def __init__( :keyword value: An array of objects of type FeaturesetVersion. :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetVersion] """ - super(FeaturesetVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(FeaturesetVersionResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class FeaturestoreEntityContainer(Resource): @@ -12211,32 +12324,32 @@ class FeaturestoreEntityContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturestoreEntityContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "FeaturestoreEntityContainerProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainerProperties """ super(FeaturestoreEntityContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class FeaturestoreEntityContainerProperties(AssetContainer): @@ -12263,25 +12376,22 @@ class FeaturestoreEntityContainerProperties(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -12296,7 +12406,9 @@ def __init__( self.provisioning_state = None -class FeaturestoreEntityContainerResourceArmPaginatedResult(msrest.serialization.Model): +class FeaturestoreEntityContainerResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of FeaturestoreEntityContainer entities. :ivar next_link: The link to the next page of FeaturestoreEntityContainer objects. If null, @@ -12307,14 +12419,11 @@ class FeaturestoreEntityContainerResourceArmPaginatedResult(msrest.serialization """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturestoreEntityContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[FeaturestoreEntityContainer]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of FeaturestoreEntityContainer objects. If null, there are no additional pages. @@ -12322,9 +12431,11 @@ def __init__( :keyword value: An array of objects of type FeaturestoreEntityContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer] """ - super(FeaturestoreEntityContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super( + FeaturestoreEntityContainerResourceArmPaginatedResult, self + ).__init__(**kwargs) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class FeaturestoreEntityVersion(Resource): @@ -12351,32 +12462,32 @@ class FeaturestoreEntityVersion(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturestoreEntityVersionProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "FeaturestoreEntityVersionProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersionProperties """ super(FeaturestoreEntityVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class FeaturestoreEntityVersionProperties(AssetBase): @@ -12409,25 +12520,25 @@ class FeaturestoreEntityVersionProperties(AssetBase): """ _validation = { - 'provisioning_state': {'readonly': True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'index_columns': {'key': 'indexColumns', 'type': '[IndexColumn]'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "auto_delete_setting": { + "key": "autoDeleteSetting", + "type": "AutoDeleteSetting", + }, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "index_columns": {"key": "indexColumns", "type": "[IndexColumn]"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "stage": {"key": "stage", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -12449,12 +12560,14 @@ def __init__( :paramtype stage: str """ super(FeaturestoreEntityVersionProperties, self).__init__(**kwargs) - self.index_columns = kwargs.get('index_columns', None) + self.index_columns = kwargs.get("index_columns", None) self.provisioning_state = None - self.stage = kwargs.get('stage', None) + self.stage = kwargs.get("stage", None) -class FeaturestoreEntityVersionResourceArmPaginatedResult(msrest.serialization.Model): +class FeaturestoreEntityVersionResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of FeaturestoreEntityVersion entities. :ivar next_link: The link to the next page of FeaturestoreEntityVersion objects. If null, there @@ -12465,14 +12578,11 @@ class FeaturestoreEntityVersionResourceArmPaginatedResult(msrest.serialization.M """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturestoreEntityVersion]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[FeaturestoreEntityVersion]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of FeaturestoreEntityVersion objects. If null, there are no additional pages. @@ -12480,9 +12590,11 @@ def __init__( :keyword value: An array of objects of type FeaturestoreEntityVersion. :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion] """ - super(FeaturestoreEntityVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super( + FeaturestoreEntityVersionResourceArmPaginatedResult, self + ).__init__(**kwargs) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class FeatureStoreSettings(msrest.serialization.Model): @@ -12497,15 +12609,21 @@ class FeatureStoreSettings(msrest.serialization.Model): """ _attribute_map = { - 'compute_runtime': {'key': 'computeRuntime', 'type': 'ComputeRuntimeDto'}, - 'offline_store_connection_name': {'key': 'offlineStoreConnectionName', 'type': 'str'}, - 'online_store_connection_name': {'key': 'onlineStoreConnectionName', 'type': 'str'}, + "compute_runtime": { + "key": "computeRuntime", + "type": "ComputeRuntimeDto", + }, + "offline_store_connection_name": { + "key": "offlineStoreConnectionName", + "type": "str", + }, + "online_store_connection_name": { + "key": "onlineStoreConnectionName", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword compute_runtime: :paramtype compute_runtime: ~azure.mgmt.machinelearningservices.models.ComputeRuntimeDto @@ -12515,9 +12633,13 @@ def __init__( :paramtype online_store_connection_name: str """ super(FeatureStoreSettings, self).__init__(**kwargs) - self.compute_runtime = kwargs.get('compute_runtime', None) - self.offline_store_connection_name = kwargs.get('offline_store_connection_name', None) - self.online_store_connection_name = kwargs.get('online_store_connection_name', None) + self.compute_runtime = kwargs.get("compute_runtime", None) + self.offline_store_connection_name = kwargs.get( + "offline_store_connection_name", None + ) + self.online_store_connection_name = kwargs.get( + "online_store_connection_name", None + ) class FeatureSubset(MonitoringFeatureFilterBase): @@ -12535,26 +12657,23 @@ class FeatureSubset(MonitoringFeatureFilterBase): """ _validation = { - 'filter_type': {'required': True}, - 'features': {'required': True}, + "filter_type": {"required": True}, + "features": {"required": True}, } _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - 'features': {'key': 'features', 'type': '[str]'}, + "filter_type": {"key": "filterType", "type": "str"}, + "features": {"key": "features", "type": "[str]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword features: Required. [Required] The list of features to include. :paramtype features: list[str] """ super(FeatureSubset, self).__init__(**kwargs) - self.filter_type = 'FeatureSubset' # type: str - self.features = kwargs['features'] + self.filter_type = "FeatureSubset" # type: str + self.features = kwargs["features"] class FeatureWindow(msrest.serialization.Model): @@ -12567,14 +12686,14 @@ class FeatureWindow(msrest.serialization.Model): """ _attribute_map = { - 'feature_window_end': {'key': 'featureWindowEnd', 'type': 'iso-8601'}, - 'feature_window_start': {'key': 'featureWindowStart', 'type': 'iso-8601'}, + "feature_window_end": {"key": "featureWindowEnd", "type": "iso-8601"}, + "feature_window_start": { + "key": "featureWindowStart", + "type": "iso-8601", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword feature_window_end: Specifies the feature window end time. :paramtype feature_window_end: ~datetime.datetime @@ -12582,8 +12701,8 @@ def __init__( :paramtype feature_window_start: ~datetime.datetime """ super(FeatureWindow, self).__init__(**kwargs) - self.feature_window_end = kwargs.get('feature_window_end', None) - self.feature_window_start = kwargs.get('feature_window_start', None) + self.feature_window_end = kwargs.get("feature_window_end", None) + self.feature_window_start = kwargs.get("feature_window_start", None) class FeaturizationSettings(msrest.serialization.Model): @@ -12594,19 +12713,16 @@ class FeaturizationSettings(msrest.serialization.Model): """ _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, + "dataset_language": {"key": "datasetLanguage", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword dataset_language: Dataset language, useful for the text data. :paramtype dataset_language: str """ super(FeaturizationSettings, self).__init__(**kwargs) - self.dataset_language = kwargs.get('dataset_language', None) + self.dataset_language = kwargs.get("dataset_language", None) class FileSystemSource(DataImportSource): @@ -12624,19 +12740,16 @@ class FileSystemSource(DataImportSource): """ _validation = { - 'source_type': {'required': True}, + "source_type": {"required": True}, } _attribute_map = { - 'connection': {'key': 'connection', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, + "connection": {"key": "connection", "type": "str"}, + "source_type": {"key": "sourceType", "type": "str"}, + "path": {"key": "path", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword connection: Workspace connection for data import source storage. :paramtype connection: str @@ -12644,8 +12757,8 @@ def __init__( :paramtype path: str """ super(FileSystemSource, self).__init__(**kwargs) - self.source_type = 'file_system' # type: str - self.path = kwargs.get('path', None) + self.source_type = "file_system" # type: str + self.path = kwargs.get("path", None) class FlavorData(msrest.serialization.Model): @@ -12656,19 +12769,16 @@ class FlavorData(msrest.serialization.Model): """ _attribute_map = { - 'data': {'key': 'data', 'type': '{str}'}, + "data": {"key": "data", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data: Model flavor-specific data. :paramtype data: dict[str, str] """ super(FlavorData, self).__init__(**kwargs) - self.data = kwargs.get('data', None) + self.data = kwargs.get("data", None) class Forecasting(AutoMLVertical, TableVertical): @@ -12737,36 +12847,63 @@ class Forecasting(AutoMLVertical, TableVertical): """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'forecasting_settings': {'key': 'forecastingSettings', 'type': 'ForecastingSettings'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'ForecastingTrainingSettings'}, - } - - def __init__( - self, - **kwargs - ): + "task_type": {"required": True}, + "training_data": {"required": True}, + } + + _attribute_map = { + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "TableFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "search_space": { + "key": "searchSpace", + "type": "[TableParameterSubspace]", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "TableSweepSettings", + }, + "test_data": {"key": "testData", "type": "MLTableJobInput"}, + "test_data_size": {"key": "testDataSize", "type": "float"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "weight_column_name": {"key": "weightColumnName", "type": "str"}, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "forecasting_settings": { + "key": "forecastingSettings", + "type": "ForecastingSettings", + }, + "primary_metric": {"key": "primaryMetric", "type": "str"}, + "training_settings": { + "key": "trainingSettings", + "type": "ForecastingTrainingSettings", + }, + } + + def __init__(self, **kwargs): """ :keyword cv_split_column_names: Columns to use for CVSplit data. :paramtype cv_split_column_names: list[str] @@ -12826,25 +12963,27 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ForecastingTrainingSettings """ super(Forecasting, self).__init__(**kwargs) - self.cv_split_column_names = kwargs.get('cv_split_column_names', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.test_data = kwargs.get('test_data', None) - self.test_data_size = kwargs.get('test_data_size', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.weight_column_name = kwargs.get('weight_column_name', None) - self.task_type = 'Forecasting' # type: str - self.forecasting_settings = kwargs.get('forecasting_settings', None) - self.primary_metric = kwargs.get('primary_metric', None) - self.training_settings = kwargs.get('training_settings', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.cv_split_column_names = kwargs.get("cv_split_column_names", None) + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.fixed_parameters = kwargs.get("fixed_parameters", None) + self.limit_settings = kwargs.get("limit_settings", None) + self.n_cross_validations = kwargs.get("n_cross_validations", None) + self.search_space = kwargs.get("search_space", None) + self.sweep_settings = kwargs.get("sweep_settings", None) + self.test_data = kwargs.get("test_data", None) + self.test_data_size = kwargs.get("test_data_size", None) + self.validation_data = kwargs.get("validation_data", None) + self.validation_data_size = kwargs.get("validation_data_size", None) + self.weight_column_name = kwargs.get("weight_column_name", None) + self.task_type = "Forecasting" # type: str + self.forecasting_settings = kwargs.get("forecasting_settings", None) + self.primary_metric = kwargs.get("primary_metric", None) + self.training_settings = kwargs.get("training_settings", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class ForecastingSettings(msrest.serialization.Model): @@ -12907,26 +13046,44 @@ class ForecastingSettings(msrest.serialization.Model): """ _attribute_map = { - 'country_or_region_for_holidays': {'key': 'countryOrRegionForHolidays', 'type': 'str'}, - 'cv_step_size': {'key': 'cvStepSize', 'type': 'int'}, - 'feature_lags': {'key': 'featureLags', 'type': 'str'}, - 'features_unknown_at_forecast_time': {'key': 'featuresUnknownAtForecastTime', 'type': '[str]'}, - 'forecast_horizon': {'key': 'forecastHorizon', 'type': 'ForecastHorizon'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'seasonality': {'key': 'seasonality', 'type': 'Seasonality'}, - 'short_series_handling_config': {'key': 'shortSeriesHandlingConfig', 'type': 'str'}, - 'target_aggregate_function': {'key': 'targetAggregateFunction', 'type': 'str'}, - 'target_lags': {'key': 'targetLags', 'type': 'TargetLags'}, - 'target_rolling_window_size': {'key': 'targetRollingWindowSize', 'type': 'TargetRollingWindowSize'}, - 'time_column_name': {'key': 'timeColumnName', 'type': 'str'}, - 'time_series_id_column_names': {'key': 'timeSeriesIdColumnNames', 'type': '[str]'}, - 'use_stl': {'key': 'useStl', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + "country_or_region_for_holidays": { + "key": "countryOrRegionForHolidays", + "type": "str", + }, + "cv_step_size": {"key": "cvStepSize", "type": "int"}, + "feature_lags": {"key": "featureLags", "type": "str"}, + "features_unknown_at_forecast_time": { + "key": "featuresUnknownAtForecastTime", + "type": "[str]", + }, + "forecast_horizon": { + "key": "forecastHorizon", + "type": "ForecastHorizon", + }, + "frequency": {"key": "frequency", "type": "str"}, + "seasonality": {"key": "seasonality", "type": "Seasonality"}, + "short_series_handling_config": { + "key": "shortSeriesHandlingConfig", + "type": "str", + }, + "target_aggregate_function": { + "key": "targetAggregateFunction", + "type": "str", + }, + "target_lags": {"key": "targetLags", "type": "TargetLags"}, + "target_rolling_window_size": { + "key": "targetRollingWindowSize", + "type": "TargetRollingWindowSize", + }, + "time_column_name": {"key": "timeColumnName", "type": "str"}, + "time_series_id_column_names": { + "key": "timeSeriesIdColumnNames", + "type": "[str]", + }, + "use_stl": {"key": "useStl", "type": "str"}, + } + + def __init__(self, **kwargs): """ :keyword country_or_region_for_holidays: Country or region for holidays for forecasting tasks. These should be ISO 3166 two-letter country/region codes, for example 'US' or 'GB'. @@ -12986,20 +13143,32 @@ def __init__( :paramtype use_stl: str or ~azure.mgmt.machinelearningservices.models.UseStl """ super(ForecastingSettings, self).__init__(**kwargs) - self.country_or_region_for_holidays = kwargs.get('country_or_region_for_holidays', None) - self.cv_step_size = kwargs.get('cv_step_size', None) - self.feature_lags = kwargs.get('feature_lags', None) - self.features_unknown_at_forecast_time = kwargs.get('features_unknown_at_forecast_time', None) - self.forecast_horizon = kwargs.get('forecast_horizon', None) - self.frequency = kwargs.get('frequency', None) - self.seasonality = kwargs.get('seasonality', None) - self.short_series_handling_config = kwargs.get('short_series_handling_config', None) - self.target_aggregate_function = kwargs.get('target_aggregate_function', None) - self.target_lags = kwargs.get('target_lags', None) - self.target_rolling_window_size = kwargs.get('target_rolling_window_size', None) - self.time_column_name = kwargs.get('time_column_name', None) - self.time_series_id_column_names = kwargs.get('time_series_id_column_names', None) - self.use_stl = kwargs.get('use_stl', None) + self.country_or_region_for_holidays = kwargs.get( + "country_or_region_for_holidays", None + ) + self.cv_step_size = kwargs.get("cv_step_size", None) + self.feature_lags = kwargs.get("feature_lags", None) + self.features_unknown_at_forecast_time = kwargs.get( + "features_unknown_at_forecast_time", None + ) + self.forecast_horizon = kwargs.get("forecast_horizon", None) + self.frequency = kwargs.get("frequency", None) + self.seasonality = kwargs.get("seasonality", None) + self.short_series_handling_config = kwargs.get( + "short_series_handling_config", None + ) + self.target_aggregate_function = kwargs.get( + "target_aggregate_function", None + ) + self.target_lags = kwargs.get("target_lags", None) + self.target_rolling_window_size = kwargs.get( + "target_rolling_window_size", None + ) + self.time_column_name = kwargs.get("time_column_name", None) + self.time_series_id_column_names = kwargs.get( + "time_series_id_column_names", None + ) + self.use_stl = kwargs.get("use_stl", None) class ForecastingTrainingSettings(TrainingSettings): @@ -13039,22 +13208,40 @@ class ForecastingTrainingSettings(TrainingSettings): """ _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): + "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, + "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, + "training_mode": {"key": "trainingMode", "type": "str"}, + "allowed_training_algorithms": { + "key": "allowedTrainingAlgorithms", + "type": "[str]", + }, + "blocked_training_algorithms": { + "key": "blockedTrainingAlgorithms", + "type": "[str]", + }, + } + + def __init__(self, **kwargs): """ :keyword enable_dnn_training: Enable recommendation of DNN models. :paramtype enable_dnn_training: bool @@ -13089,8 +13276,12 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ForecastingModels] """ super(ForecastingTrainingSettings, self).__init__(**kwargs) - self.allowed_training_algorithms = kwargs.get('allowed_training_algorithms', None) - self.blocked_training_algorithms = kwargs.get('blocked_training_algorithms', None) + self.allowed_training_algorithms = kwargs.get( + "allowed_training_algorithms", None + ) + self.blocked_training_algorithms = kwargs.get( + "blocked_training_algorithms", None + ) class FQDNEndpoint(msrest.serialization.Model): @@ -13103,14 +13294,14 @@ class FQDNEndpoint(msrest.serialization.Model): """ _attribute_map = { - 'domain_name': {'key': 'domainName', 'type': 'str'}, - 'endpoint_details': {'key': 'endpointDetails', 'type': '[FQDNEndpointDetail]'}, + "domain_name": {"key": "domainName", "type": "str"}, + "endpoint_details": { + "key": "endpointDetails", + "type": "[FQDNEndpointDetail]", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword domain_name: :paramtype domain_name: str @@ -13119,8 +13310,8 @@ def __init__( list[~azure.mgmt.machinelearningservices.models.FQDNEndpointDetail] """ super(FQDNEndpoint, self).__init__(**kwargs) - self.domain_name = kwargs.get('domain_name', None) - self.endpoint_details = kwargs.get('endpoint_details', None) + self.domain_name = kwargs.get("domain_name", None) + self.endpoint_details = kwargs.get("endpoint_details", None) class FQDNEndpointDetail(msrest.serialization.Model): @@ -13131,19 +13322,16 @@ class FQDNEndpointDetail(msrest.serialization.Model): """ _attribute_map = { - 'port': {'key': 'port', 'type': 'int'}, + "port": {"key": "port", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword port: :paramtype port: int """ super(FQDNEndpointDetail, self).__init__(**kwargs) - self.port = kwargs.get('port', None) + self.port = kwargs.get("port", None) class FQDNEndpoints(msrest.serialization.Model): @@ -13154,19 +13342,16 @@ class FQDNEndpoints(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'FQDNEndpointsProperties'}, + "properties": {"key": "properties", "type": "FQDNEndpointsProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: :paramtype properties: ~azure.mgmt.machinelearningservices.models.FQDNEndpointsProperties """ super(FQDNEndpoints, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class FQDNEndpointsProperties(msrest.serialization.Model): @@ -13179,14 +13364,11 @@ class FQDNEndpointsProperties(msrest.serialization.Model): """ _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'endpoints': {'key': 'endpoints', 'type': '[FQDNEndpoint]'}, + "category": {"key": "category", "type": "str"}, + "endpoints": {"key": "endpoints", "type": "[FQDNEndpoint]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword category: :paramtype category: str @@ -13194,8 +13376,8 @@ def __init__( :paramtype endpoints: list[~azure.mgmt.machinelearningservices.models.FQDNEndpoint] """ super(FQDNEndpointsProperties, self).__init__(**kwargs) - self.category = kwargs.get('category', None) - self.endpoints = kwargs.get('endpoints', None) + self.category = kwargs.get("category", None) + self.endpoints = kwargs.get("endpoints", None) class OutboundRule(msrest.serialization.Model): @@ -13219,23 +13401,24 @@ class OutboundRule(msrest.serialization.Model): """ _validation = { - 'type': {'required': True}, + "type": {"required": True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, + "type": {"key": "type", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "category": {"key": "category", "type": "str"}, } _subtype_map = { - 'type': {'FQDN': 'FqdnOutboundRule', 'PrivateEndpoint': 'PrivateEndpointOutboundRule', 'ServiceTag': 'ServiceTagOutboundRule'} + "type": { + "FQDN": "FqdnOutboundRule", + "PrivateEndpoint": "PrivateEndpointOutboundRule", + "ServiceTag": "ServiceTagOutboundRule", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword status: Status of a managed network Outbound Rule of a machine learning workspace. Possible values include: "Inactive", "Active". @@ -13246,8 +13429,8 @@ def __init__( """ super(OutboundRule, self).__init__(**kwargs) self.type = None # type: Optional[str] - self.status = kwargs.get('status', None) - self.category = kwargs.get('category', None) + self.status = kwargs.get("status", None) + self.category = kwargs.get("category", None) class FqdnOutboundRule(OutboundRule): @@ -13270,20 +13453,17 @@ class FqdnOutboundRule(OutboundRule): """ _validation = { - 'type': {'required': True}, + "type": {"required": True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'str'}, + "type": {"key": "type", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "destination": {"key": "destination", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword status: Status of a managed network Outbound Rule of a machine learning workspace. Possible values include: "Inactive", "Active". @@ -13295,8 +13475,8 @@ def __init__( :paramtype destination: str """ super(FqdnOutboundRule, self).__init__(**kwargs) - self.type = 'FQDN' # type: str - self.destination = kwargs.get('destination', None) + self.type = "FQDN" # type: str + self.destination = kwargs.get("destination", None) class GridSamplingAlgorithm(SamplingAlgorithm): @@ -13312,21 +13492,20 @@ class GridSamplingAlgorithm(SamplingAlgorithm): """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(GridSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Grid' # type: str + self.sampling_algorithm_type = "Grid" # type: str class HdfsDatastore(DatastoreProperties): @@ -13363,29 +13542,36 @@ class HdfsDatastore(DatastoreProperties): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'name_node_address': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "name_node_address": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'hdfs_server_certificate': {'key': 'hdfsServerCertificate', 'type': 'str'}, - 'name_node_address': {'key': 'nameNodeAddress', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "intellectual_property": { + "key": "intellectualProperty", + "type": "IntellectualProperty", + }, + "is_default": {"key": "isDefault", "type": "bool"}, + "hdfs_server_certificate": { + "key": "hdfsServerCertificate", + "type": "str", + }, + "name_node_address": {"key": "nameNodeAddress", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -13407,10 +13593,12 @@ def __init__( :paramtype protocol: str """ super(HdfsDatastore, self).__init__(**kwargs) - self.datastore_type = 'Hdfs' # type: str - self.hdfs_server_certificate = kwargs.get('hdfs_server_certificate', None) - self.name_node_address = kwargs['name_node_address'] - self.protocol = kwargs.get('protocol', "http") + self.datastore_type = "Hdfs" # type: str + self.hdfs_server_certificate = kwargs.get( + "hdfs_server_certificate", None + ) + self.name_node_address = kwargs["name_node_address"] + self.protocol = kwargs.get("protocol", "http") class HDInsightSchema(msrest.serialization.Model): @@ -13421,19 +13609,16 @@ class HDInsightSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, + "properties": {"key": "properties", "type": "HDInsightProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: HDInsight compute properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties """ super(HDInsightSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class HDInsight(Compute, HDInsightSchema): @@ -13475,32 +13660,32 @@ class HDInsight(Compute, HDInsightSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "HDInsightProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: HDInsight compute properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.HDInsightProperties @@ -13515,17 +13700,17 @@ def __init__( :paramtype disable_local_auth: bool """ super(HDInsight, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'HDInsight' # type: str - self.compute_location = kwargs.get('compute_location', None) + self.properties = kwargs.get("properties", None) + self.compute_type = "HDInsight" # type: str + self.compute_location = kwargs.get("compute_location", None) self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) + self.disable_local_auth = kwargs.get("disable_local_auth", None) class HDInsightProperties(msrest.serialization.Model): @@ -13541,15 +13726,15 @@ class HDInsightProperties(msrest.serialization.Model): """ _attribute_map = { - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, + "ssh_port": {"key": "sshPort", "type": "int"}, + "address": {"key": "address", "type": "str"}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword ssh_port: Port open for ssh connections on the master node of the cluster. :paramtype ssh_port: int @@ -13560,9 +13745,9 @@ def __init__( ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials """ super(HDInsightProperties, self).__init__(**kwargs) - self.ssh_port = kwargs.get('ssh_port', None) - self.address = kwargs.get('address', None) - self.administrator_account = kwargs.get('administrator_account', None) + self.ssh_port = kwargs.get("ssh_port", None) + self.address = kwargs.get("address", None) + self.administrator_account = kwargs.get("administrator_account", None) class IdAssetReference(AssetReferenceBase): @@ -13578,26 +13763,27 @@ class IdAssetReference(AssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, - 'asset_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "reference_type": {"required": True}, + "asset_id": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'asset_id': {'key': 'assetId', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "asset_id": {"key": "assetId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword asset_id: Required. [Required] ARM resource ID of the asset. :paramtype asset_id: str """ super(IdAssetReference, self).__init__(**kwargs) - self.reference_type = 'Id' # type: str - self.asset_id = kwargs['asset_id'] + self.reference_type = "Id" # type: str + self.asset_id = kwargs["asset_id"] class IdentityForCmk(msrest.serialization.Model): @@ -13609,20 +13795,22 @@ class IdentityForCmk(msrest.serialization.Model): """ _attribute_map = { - 'user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, + "user_assigned_identity": { + "key": "userAssignedIdentity", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword user_assigned_identity: The ArmId of the user assigned identity that will be used to access the customer managed key vault. :paramtype user_assigned_identity: str """ super(IdentityForCmk, self).__init__(**kwargs) - self.user_assigned_identity = kwargs.get('user_assigned_identity', None) + self.user_assigned_identity = kwargs.get( + "user_assigned_identity", None + ) class IdleShutdownSetting(msrest.serialization.Model): @@ -13634,20 +13822,22 @@ class IdleShutdownSetting(msrest.serialization.Model): """ _attribute_map = { - 'idle_time_before_shutdown': {'key': 'idleTimeBeforeShutdown', 'type': 'str'}, + "idle_time_before_shutdown": { + "key": "idleTimeBeforeShutdown", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword idle_time_before_shutdown: Time is defined in ISO8601 format. Minimum is 15 min, maximum is 3 days. :paramtype idle_time_before_shutdown: str """ super(IdleShutdownSetting, self).__init__(**kwargs) - self.idle_time_before_shutdown = kwargs.get('idle_time_before_shutdown', None) + self.idle_time_before_shutdown = kwargs.get( + "idle_time_before_shutdown", None + ) class Image(msrest.serialization.Model): @@ -13664,15 +13854,12 @@ class Image(msrest.serialization.Model): """ _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'reference': {'key': 'reference', 'type': 'str'}, + "additional_properties": {"key": "", "type": "{object}"}, + "type": {"key": "type", "type": "str"}, + "reference": {"key": "reference", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword additional_properties: Unmatched properties from the message are deserialized to this collection. @@ -13684,45 +13871,51 @@ def __init__( :paramtype reference: str """ super(Image, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.type = kwargs.get('type', "docker") - self.reference = kwargs.get('reference', None) + self.additional_properties = kwargs.get("additional_properties", None) + self.type = kwargs.get("type", "docker") + self.reference = kwargs.get("reference", None) class ImageVertical(msrest.serialization.Model): """Abstract class for AutoML tasks that train image (computer vision) models - -such as Image Classification / Image Classification Multilabel / Image Object Detection / Image Instance Segmentation. + such as Image Classification / Image Classification Multilabel / Image Object Detection / Image Instance Segmentation. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float """ _validation = { - 'limit_settings': {'required': True}, + "limit_settings": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings @@ -13737,10 +13930,10 @@ def __init__( :paramtype validation_data_size: float """ super(ImageVertical, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) + self.limit_settings = kwargs["limit_settings"] + self.sweep_settings = kwargs.get("sweep_settings", None) + self.validation_data = kwargs.get("validation_data", None) + self.validation_data_size = kwargs.get("validation_data_size", None) class ImageClassificationBase(ImageVertical): @@ -13769,22 +13962,34 @@ class ImageClassificationBase(ImageVertical): """ _validation = { - 'limit_settings': {'required': True}, + "limit_settings": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsClassification", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsClassification]", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings @@ -13806,78 +14011,90 @@ def __init__( list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] """ super(ImageClassificationBase, self).__init__(**kwargs) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) + self.model_settings = kwargs.get("model_settings", None) + self.search_space = kwargs.get("search_space", None) class ImageClassification(AutoMLVertical, ImageClassificationBase): """Image Classification. Multi-class image classification is used when an image is classified with only a single label -from a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' or a 'duck'. + from a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' or a 'duck'. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, + "limit_settings": {"required": True}, + "task_type": {"required": True}, + "training_data": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsClassification", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsClassification]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings @@ -13912,87 +14129,99 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ super(ImageClassification, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageClassification' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.limit_settings = kwargs["limit_settings"] + self.sweep_settings = kwargs.get("sweep_settings", None) + self.validation_data = kwargs.get("validation_data", None) + self.validation_data_size = kwargs.get("validation_data_size", None) + self.model_settings = kwargs.get("model_settings", None) + self.search_space = kwargs.get("search_space", None) + self.task_type = "ImageClassification" # type: str + self.primary_metric = kwargs.get("primary_metric", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class ImageClassificationMultilabel(AutoMLVertical, ImageClassificationBase): """Image Classification Multilabel. Multi-label image classification is used when an image could have one or more labels -from a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'. + from a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted", "IOU". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics """ _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, + "limit_settings": {"required": True}, + "task_type": {"required": True}, + "training_data": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsClassification", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsClassification]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings @@ -14027,17 +14256,17 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics """ super(ImageClassificationMultilabel, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageClassificationMultilabel' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.limit_settings = kwargs["limit_settings"] + self.sweep_settings = kwargs.get("sweep_settings", None) + self.validation_data = kwargs.get("validation_data", None) + self.validation_data_size = kwargs.get("validation_data_size", None) + self.model_settings = kwargs.get("model_settings", None) + self.search_space = kwargs.get("search_space", None) + self.task_type = "ImageClassificationMultilabel" # type: str + self.primary_metric = kwargs.get("primary_metric", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class ImageObjectDetectionBase(ImageVertical): @@ -14066,22 +14295,34 @@ class ImageObjectDetectionBase(ImageVertical): """ _validation = { - 'limit_settings': {'required': True}, + "limit_settings": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsObjectDetection", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsObjectDetection]", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings @@ -14103,77 +14344,89 @@ def __init__( list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] """ super(ImageObjectDetectionBase, self).__init__(**kwargs) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) + self.model_settings = kwargs.get("model_settings", None) + self.search_space = kwargs.get("search_space", None) class ImageInstanceSegmentation(AutoMLVertical, ImageObjectDetectionBase): """Image Instance Segmentation. Instance segmentation is used to identify objects in an image at the pixel level, -drawing a polygon around each object in the image. + drawing a polygon around each object in the image. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "MeanAveragePrecision". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics """ _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, + "limit_settings": {"required": True}, + "task_type": {"required": True}, + "training_data": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsObjectDetection", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsObjectDetection]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings @@ -14207,17 +14460,17 @@ def __init__( ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics """ super(ImageInstanceSegmentation, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageInstanceSegmentation' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.limit_settings = kwargs["limit_settings"] + self.sweep_settings = kwargs.get("sweep_settings", None) + self.validation_data = kwargs.get("validation_data", None) + self.validation_data_size = kwargs.get("validation_data_size", None) + self.model_settings = kwargs.get("model_settings", None) + self.search_space = kwargs.get("search_space", None) + self.task_type = "ImageInstanceSegmentation" # type: str + self.primary_metric = kwargs.get("primary_metric", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class ImageLimitSettings(msrest.serialization.Model): @@ -14232,15 +14485,12 @@ class ImageLimitSettings(msrest.serialization.Model): """ _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_trials": {"key": "maxTrials", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword max_concurrent_trials: Maximum number of concurrent AutoML iterations. :paramtype max_concurrent_trials: int @@ -14250,9 +14500,9 @@ def __init__( :paramtype timeout: ~datetime.timedelta """ super(ImageLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', 1) - self.max_trials = kwargs.get('max_trials', 1) - self.timeout = kwargs.get('timeout', "P7D") + self.max_concurrent_trials = kwargs.get("max_concurrent_trials", 1) + self.max_trials = kwargs.get("max_trials", 1) + self.timeout = kwargs.get("timeout", "P7D") class ImageMetadata(msrest.serialization.Model): @@ -14269,15 +14519,15 @@ class ImageMetadata(msrest.serialization.Model): """ _attribute_map = { - 'current_image_version': {'key': 'currentImageVersion', 'type': 'str'}, - 'latest_image_version': {'key': 'latestImageVersion', 'type': 'str'}, - 'is_latest_os_image_version': {'key': 'isLatestOsImageVersion', 'type': 'bool'}, + "current_image_version": {"key": "currentImageVersion", "type": "str"}, + "latest_image_version": {"key": "latestImageVersion", "type": "str"}, + "is_latest_os_image_version": { + "key": "isLatestOsImageVersion", + "type": "bool", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword current_image_version: Specifies the current operating system image version this compute instance is running on. @@ -14289,143 +14539,160 @@ def __init__( :paramtype is_latest_os_image_version: bool """ super(ImageMetadata, self).__init__(**kwargs) - self.current_image_version = kwargs.get('current_image_version', None) - self.latest_image_version = kwargs.get('latest_image_version', None) - self.is_latest_os_image_version = kwargs.get('is_latest_os_image_version', None) + self.current_image_version = kwargs.get("current_image_version", None) + self.latest_image_version = kwargs.get("latest_image_version", None) + self.is_latest_os_image_version = kwargs.get( + "is_latest_os_image_version", None + ) class ImageModelDistributionSettings(msrest.serialization.Model): """Distribution expressions to sweep over values of model settings. -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) -where distribution name can be: uniform, quniform, loguniform, etc -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + :code:` + Some examples are: + ``` + ModelName = "choice('seresnext', 'resnest50')"; + LearningRate = "uniform(0.001, 0.01)"; + LayersToFreeze = "choice(0, 2)"; + ```` + All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) + where distribution name can be: uniform, quniform, loguniform, etc + For more details on how to compose distribution expressions please check the documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: str + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: str + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: str + :ivar distributed: Whether to use distributer training. + :vartype distributed: str + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: str + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: str + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: str + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: str + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: str + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: str + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: str + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: str + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. + :vartype learning_rate_scheduler: str + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: str + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: str + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: str + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: str + :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. + :vartype optimizer: str + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: str + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: str + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: str + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: str + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: str + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: str + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: str + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: str + """ + + _attribute_map = { + "ams_gradient": {"key": "amsGradient", "type": "str"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "str"}, + "beta2": {"key": "beta2", "type": "str"}, + "distributed": {"key": "distributed", "type": "str"}, + "early_stopping": {"key": "earlyStopping", "type": "str"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "str"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "str", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "str", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "str"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "str", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "str"}, + "nesterov": {"key": "nesterov", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "str"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "str"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "str"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "str"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "str"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "str", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "str", + }, + "weight_decay": {"key": "weightDecay", "type": "str"}, + } + + def __init__(self, **kwargs): """ :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :paramtype ams_gradient: str @@ -14509,183 +14776,215 @@ def __init__( :paramtype weight_decay: str """ super(ImageModelDistributionSettings, self).__init__(**kwargs) - self.ams_gradient = kwargs.get('ams_gradient', None) - self.augmentations = kwargs.get('augmentations', None) - self.beta1 = kwargs.get('beta1', None) - self.beta2 = kwargs.get('beta2', None) - self.distributed = kwargs.get('distributed', None) - self.early_stopping = kwargs.get('early_stopping', None) - self.early_stopping_delay = kwargs.get('early_stopping_delay', None) - self.early_stopping_patience = kwargs.get('early_stopping_patience', None) - self.enable_onnx_normalization = kwargs.get('enable_onnx_normalization', None) - self.evaluation_frequency = kwargs.get('evaluation_frequency', None) - self.gradient_accumulation_step = kwargs.get('gradient_accumulation_step', None) - self.layers_to_freeze = kwargs.get('layers_to_freeze', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.learning_rate_scheduler = kwargs.get('learning_rate_scheduler', None) - self.model_name = kwargs.get('model_name', None) - self.momentum = kwargs.get('momentum', None) - self.nesterov = kwargs.get('nesterov', None) - self.number_of_epochs = kwargs.get('number_of_epochs', None) - self.number_of_workers = kwargs.get('number_of_workers', None) - self.optimizer = kwargs.get('optimizer', None) - self.random_seed = kwargs.get('random_seed', None) - self.step_lr_gamma = kwargs.get('step_lr_gamma', None) - self.step_lr_step_size = kwargs.get('step_lr_step_size', None) - self.training_batch_size = kwargs.get('training_batch_size', None) - self.validation_batch_size = kwargs.get('validation_batch_size', None) - self.warmup_cosine_lr_cycles = kwargs.get('warmup_cosine_lr_cycles', None) - self.warmup_cosine_lr_warmup_epochs = kwargs.get('warmup_cosine_lr_warmup_epochs', None) - self.weight_decay = kwargs.get('weight_decay', None) - - -class ImageModelDistributionSettingsClassification(ImageModelDistributionSettings): + self.ams_gradient = kwargs.get("ams_gradient", None) + self.augmentations = kwargs.get("augmentations", None) + self.beta1 = kwargs.get("beta1", None) + self.beta2 = kwargs.get("beta2", None) + self.distributed = kwargs.get("distributed", None) + self.early_stopping = kwargs.get("early_stopping", None) + self.early_stopping_delay = kwargs.get("early_stopping_delay", None) + self.early_stopping_patience = kwargs.get( + "early_stopping_patience", None + ) + self.enable_onnx_normalization = kwargs.get( + "enable_onnx_normalization", None + ) + self.evaluation_frequency = kwargs.get("evaluation_frequency", None) + self.gradient_accumulation_step = kwargs.get( + "gradient_accumulation_step", None + ) + self.layers_to_freeze = kwargs.get("layers_to_freeze", None) + self.learning_rate = kwargs.get("learning_rate", None) + self.learning_rate_scheduler = kwargs.get( + "learning_rate_scheduler", None + ) + self.model_name = kwargs.get("model_name", None) + self.momentum = kwargs.get("momentum", None) + self.nesterov = kwargs.get("nesterov", None) + self.number_of_epochs = kwargs.get("number_of_epochs", None) + self.number_of_workers = kwargs.get("number_of_workers", None) + self.optimizer = kwargs.get("optimizer", None) + self.random_seed = kwargs.get("random_seed", None) + self.step_lr_gamma = kwargs.get("step_lr_gamma", None) + self.step_lr_step_size = kwargs.get("step_lr_step_size", None) + self.training_batch_size = kwargs.get("training_batch_size", None) + self.validation_batch_size = kwargs.get("validation_batch_size", None) + self.warmup_cosine_lr_cycles = kwargs.get( + "warmup_cosine_lr_cycles", None + ) + self.warmup_cosine_lr_warmup_epochs = kwargs.get( + "warmup_cosine_lr_warmup_epochs", None + ) + self.weight_decay = kwargs.get("weight_decay", None) + + +class ImageModelDistributionSettingsClassification( + ImageModelDistributionSettings +): """Distribution expressions to sweep over values of model settings. -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: str - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: str - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: str - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'str'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'str'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'str'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + :code:` + Some examples are: + ``` + ModelName = "choice('seresnext', 'resnest50')"; + LearningRate = "uniform(0.001, 0.01)"; + LayersToFreeze = "choice(0, 2)"; + ```` + For more details on how to compose distribution expressions please check the documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: str + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: str + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: str + :ivar distributed: Whether to use distributer training. + :vartype distributed: str + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: str + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: str + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: str + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: str + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: str + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: str + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: str + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: str + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. + :vartype learning_rate_scheduler: str + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: str + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: str + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: str + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: str + :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. + :vartype optimizer: str + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: str + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: str + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: str + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: str + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: str + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: str + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: str + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: str + :ivar training_crop_size: Image crop size that is input to the neural network for the training + dataset. Must be a positive integer. + :vartype training_crop_size: str + :ivar validation_crop_size: Image crop size that is input to the neural network for the + validation dataset. Must be a positive integer. + :vartype validation_crop_size: str + :ivar validation_resize_size: Image size to which to resize before cropping for validation + dataset. Must be a positive integer. + :vartype validation_resize_size: str + :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. + 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be + 0 or 1 or 2. + :vartype weighted_loss: str + """ + + _attribute_map = { + "ams_gradient": {"key": "amsGradient", "type": "str"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "str"}, + "beta2": {"key": "beta2", "type": "str"}, + "distributed": {"key": "distributed", "type": "str"}, + "early_stopping": {"key": "earlyStopping", "type": "str"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "str"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "str", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "str", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "str"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "str", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "str"}, + "nesterov": {"key": "nesterov", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "str"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "str"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "str"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "str"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "str"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "str", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "str", + }, + "weight_decay": {"key": "weightDecay", "type": "str"}, + "training_crop_size": {"key": "trainingCropSize", "type": "str"}, + "validation_crop_size": {"key": "validationCropSize", "type": "str"}, + "validation_resize_size": { + "key": "validationResizeSize", + "type": "str", + }, + "weighted_loss": {"key": "weightedLoss", "type": "str"}, + } + + def __init__(self, **kwargs): """ :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :paramtype ams_gradient: str @@ -14781,208 +15080,241 @@ def __init__( 0 or 1 or 2. :paramtype weighted_loss: str """ - super(ImageModelDistributionSettingsClassification, self).__init__(**kwargs) - self.training_crop_size = kwargs.get('training_crop_size', None) - self.validation_crop_size = kwargs.get('validation_crop_size', None) - self.validation_resize_size = kwargs.get('validation_resize_size', None) - self.weighted_loss = kwargs.get('weighted_loss', None) + super(ImageModelDistributionSettingsClassification, self).__init__( + **kwargs + ) + self.training_crop_size = kwargs.get("training_crop_size", None) + self.validation_crop_size = kwargs.get("validation_crop_size", None) + self.validation_resize_size = kwargs.get( + "validation_resize_size", None + ) + self.weighted_loss = kwargs.get("weighted_loss", None) -class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettings): +class ImageModelDistributionSettingsObjectDetection( + ImageModelDistributionSettings +): """Distribution expressions to sweep over values of model settings. -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: str - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: str - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: str - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: str - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: str - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype model_size: str - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: str - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - float in the range [0, 1]. - :vartype nms_iou_threshold: str - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: str - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - NMS: Non-maximum suppression. - :vartype tile_predictions_nms_threshold: str - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: str - :ivar validation_metric_type: Metric computation method to use for validation metrics. Must be - 'none', 'coco', 'voc', or 'coco_voc'. - :vartype validation_metric_type: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'str'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'str'}, - 'image_size': {'key': 'imageSize', 'type': 'str'}, - 'max_size': {'key': 'maxSize', 'type': 'str'}, - 'min_size': {'key': 'minSize', 'type': 'str'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'str'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'str'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'str'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'str'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'str'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + :code:` + Some examples are: + ``` + ModelName = "choice('seresnext', 'resnest50')"; + LearningRate = "uniform(0.001, 0.01)"; + LayersToFreeze = "choice(0, 2)"; + ```` + For more details on how to compose distribution expressions please check the documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: str + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: str + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: str + :ivar distributed: Whether to use distributer training. + :vartype distributed: str + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: str + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: str + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: str + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: str + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: str + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: str + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: str + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: str + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. + :vartype learning_rate_scheduler: str + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: str + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: str + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: str + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: str + :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. + :vartype optimizer: str + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: str + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: str + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: str + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: str + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: str + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: str + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: str + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: str + :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must + be a positive integer. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype box_detections_per_image: str + :ivar box_score_threshold: During inference, only return proposals with a classification score + greater than + BoxScoreThreshold. Must be a float in the range[0, 1]. + :vartype box_score_threshold: str + :ivar image_size: Image size for train and validation. Must be a positive integer. + Note: The training run may get into CUDA OOM if the size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype image_size: str + :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype max_size: str + :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype min_size: str + :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. + Note: training run may get into CUDA OOM if the model size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype model_size: str + :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. + Note: training run may get into CUDA OOM if no sufficient GPU memory. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype multi_scale: str + :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be + float in the range [0, 1]. + :vartype nms_iou_threshold: str + :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not + be + None to enable small object detection logic. A string containing two integers in mxn format. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_grid_size: str + :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float + in the range [0, 1). + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_overlap_ratio: str + :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging + predictions from tiles and image. + Used in validation/ inference. Must be float in the range [0, 1]. + Note: This settings is not supported for the 'yolov5' algorithm. + NMS: Non-maximum suppression. + :vartype tile_predictions_nms_threshold: str + :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be + float in the range [0, 1]. + :vartype validation_iou_threshold: str + :ivar validation_metric_type: Metric computation method to use for validation metrics. Must be + 'none', 'coco', 'voc', or 'coco_voc'. + :vartype validation_metric_type: str + """ + + _attribute_map = { + "ams_gradient": {"key": "amsGradient", "type": "str"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "str"}, + "beta2": {"key": "beta2", "type": "str"}, + "distributed": {"key": "distributed", "type": "str"}, + "early_stopping": {"key": "earlyStopping", "type": "str"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "str"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "str", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "str", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "str"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "str", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "str"}, + "nesterov": {"key": "nesterov", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "str"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "str"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "str"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "str"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "str"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "str", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "str", + }, + "weight_decay": {"key": "weightDecay", "type": "str"}, + "box_detections_per_image": { + "key": "boxDetectionsPerImage", + "type": "str", + }, + "box_score_threshold": {"key": "boxScoreThreshold", "type": "str"}, + "image_size": {"key": "imageSize", "type": "str"}, + "max_size": {"key": "maxSize", "type": "str"}, + "min_size": {"key": "minSize", "type": "str"}, + "model_size": {"key": "modelSize", "type": "str"}, + "multi_scale": {"key": "multiScale", "type": "str"}, + "nms_iou_threshold": {"key": "nmsIouThreshold", "type": "str"}, + "tile_grid_size": {"key": "tileGridSize", "type": "str"}, + "tile_overlap_ratio": {"key": "tileOverlapRatio", "type": "str"}, + "tile_predictions_nms_threshold": { + "key": "tilePredictionsNmsThreshold", + "type": "str", + }, + "validation_iou_threshold": { + "key": "validationIouThreshold", + "type": "str", + }, + "validation_metric_type": { + "key": "validationMetricType", + "type": "str", + }, + } + + def __init__(self, **kwargs): """ :keyword ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. :paramtype ams_gradient: str @@ -15117,156 +15449,184 @@ def __init__( be 'none', 'coco', 'voc', or 'coco_voc'. :paramtype validation_metric_type: str """ - super(ImageModelDistributionSettingsObjectDetection, self).__init__(**kwargs) - self.box_detections_per_image = kwargs.get('box_detections_per_image', None) - self.box_score_threshold = kwargs.get('box_score_threshold', None) - self.image_size = kwargs.get('image_size', None) - self.max_size = kwargs.get('max_size', None) - self.min_size = kwargs.get('min_size', None) - self.model_size = kwargs.get('model_size', None) - self.multi_scale = kwargs.get('multi_scale', None) - self.nms_iou_threshold = kwargs.get('nms_iou_threshold', None) - self.tile_grid_size = kwargs.get('tile_grid_size', None) - self.tile_overlap_ratio = kwargs.get('tile_overlap_ratio', None) - self.tile_predictions_nms_threshold = kwargs.get('tile_predictions_nms_threshold', None) - self.validation_iou_threshold = kwargs.get('validation_iou_threshold', None) - self.validation_metric_type = kwargs.get('validation_metric_type', None) + super(ImageModelDistributionSettingsObjectDetection, self).__init__( + **kwargs + ) + self.box_detections_per_image = kwargs.get( + "box_detections_per_image", None + ) + self.box_score_threshold = kwargs.get("box_score_threshold", None) + self.image_size = kwargs.get("image_size", None) + self.max_size = kwargs.get("max_size", None) + self.min_size = kwargs.get("min_size", None) + self.model_size = kwargs.get("model_size", None) + self.multi_scale = kwargs.get("multi_scale", None) + self.nms_iou_threshold = kwargs.get("nms_iou_threshold", None) + self.tile_grid_size = kwargs.get("tile_grid_size", None) + self.tile_overlap_ratio = kwargs.get("tile_overlap_ratio", None) + self.tile_predictions_nms_threshold = kwargs.get( + "tile_predictions_nms_threshold", None + ) + self.validation_iou_threshold = kwargs.get( + "validation_iou_threshold", None + ) + self.validation_metric_type = kwargs.get( + "validation_metric_type", None + ) class ImageModelSettings(msrest.serialization.Model): """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar advanced_settings: Settings for advanced scenarios. + :vartype advanced_settings: str + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: bool + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: float + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: float + :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. + :vartype checkpoint_frequency: int + :ivar checkpoint_model: The pretrained checkpoint model for incremental training. + :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput + :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for + incremental training. + :vartype checkpoint_run_id: str + :ivar distributed: Whether to use distributed training. + :vartype distributed: bool + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: bool + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: int + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: int + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: bool + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: int + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: int + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: int + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: float + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. Possible values include: "None", "WarmupCosine", "Step". + :vartype learning_rate_scheduler: str or + ~azure.mgmt.machinelearningservices.models.LearningRateScheduler + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: float + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: bool + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: int + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: int + :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". + :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: int + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: float + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: int + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: int + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: int + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: float + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: int + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: float + """ + + _attribute_map = { + "advanced_settings": {"key": "advancedSettings", "type": "str"}, + "ams_gradient": {"key": "amsGradient", "type": "bool"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "float"}, + "beta2": {"key": "beta2", "type": "float"}, + "checkpoint_frequency": {"key": "checkpointFrequency", "type": "int"}, + "checkpoint_model": { + "key": "checkpointModel", + "type": "MLFlowModelJobInput", + }, + "checkpoint_run_id": {"key": "checkpointRunId", "type": "str"}, + "distributed": {"key": "distributed", "type": "bool"}, + "early_stopping": {"key": "earlyStopping", "type": "bool"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "int"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "int", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "bool", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "int"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "int", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "int"}, + "learning_rate": {"key": "learningRate", "type": "float"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "float"}, + "nesterov": {"key": "nesterov", "type": "bool"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "int"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "int"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "int"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "float"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "int"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "float", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "int", + }, + "weight_decay": {"key": "weightDecay", "type": "float"}, + } + + def __init__(self, **kwargs): """ :keyword advanced_settings: Settings for advanced scenarios. :paramtype advanced_settings: str @@ -15361,191 +15721,224 @@ def __init__( :paramtype weight_decay: float """ super(ImageModelSettings, self).__init__(**kwargs) - self.advanced_settings = kwargs.get('advanced_settings', None) - self.ams_gradient = kwargs.get('ams_gradient', None) - self.augmentations = kwargs.get('augmentations', None) - self.beta1 = kwargs.get('beta1', None) - self.beta2 = kwargs.get('beta2', None) - self.checkpoint_frequency = kwargs.get('checkpoint_frequency', None) - self.checkpoint_model = kwargs.get('checkpoint_model', None) - self.checkpoint_run_id = kwargs.get('checkpoint_run_id', None) - self.distributed = kwargs.get('distributed', None) - self.early_stopping = kwargs.get('early_stopping', None) - self.early_stopping_delay = kwargs.get('early_stopping_delay', None) - self.early_stopping_patience = kwargs.get('early_stopping_patience', None) - self.enable_onnx_normalization = kwargs.get('enable_onnx_normalization', None) - self.evaluation_frequency = kwargs.get('evaluation_frequency', None) - self.gradient_accumulation_step = kwargs.get('gradient_accumulation_step', None) - self.layers_to_freeze = kwargs.get('layers_to_freeze', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.learning_rate_scheduler = kwargs.get('learning_rate_scheduler', None) - self.model_name = kwargs.get('model_name', None) - self.momentum = kwargs.get('momentum', None) - self.nesterov = kwargs.get('nesterov', None) - self.number_of_epochs = kwargs.get('number_of_epochs', None) - self.number_of_workers = kwargs.get('number_of_workers', None) - self.optimizer = kwargs.get('optimizer', None) - self.random_seed = kwargs.get('random_seed', None) - self.step_lr_gamma = kwargs.get('step_lr_gamma', None) - self.step_lr_step_size = kwargs.get('step_lr_step_size', None) - self.training_batch_size = kwargs.get('training_batch_size', None) - self.validation_batch_size = kwargs.get('validation_batch_size', None) - self.warmup_cosine_lr_cycles = kwargs.get('warmup_cosine_lr_cycles', None) - self.warmup_cosine_lr_warmup_epochs = kwargs.get('warmup_cosine_lr_warmup_epochs', None) - self.weight_decay = kwargs.get('weight_decay', None) + self.advanced_settings = kwargs.get("advanced_settings", None) + self.ams_gradient = kwargs.get("ams_gradient", None) + self.augmentations = kwargs.get("augmentations", None) + self.beta1 = kwargs.get("beta1", None) + self.beta2 = kwargs.get("beta2", None) + self.checkpoint_frequency = kwargs.get("checkpoint_frequency", None) + self.checkpoint_model = kwargs.get("checkpoint_model", None) + self.checkpoint_run_id = kwargs.get("checkpoint_run_id", None) + self.distributed = kwargs.get("distributed", None) + self.early_stopping = kwargs.get("early_stopping", None) + self.early_stopping_delay = kwargs.get("early_stopping_delay", None) + self.early_stopping_patience = kwargs.get( + "early_stopping_patience", None + ) + self.enable_onnx_normalization = kwargs.get( + "enable_onnx_normalization", None + ) + self.evaluation_frequency = kwargs.get("evaluation_frequency", None) + self.gradient_accumulation_step = kwargs.get( + "gradient_accumulation_step", None + ) + self.layers_to_freeze = kwargs.get("layers_to_freeze", None) + self.learning_rate = kwargs.get("learning_rate", None) + self.learning_rate_scheduler = kwargs.get( + "learning_rate_scheduler", None + ) + self.model_name = kwargs.get("model_name", None) + self.momentum = kwargs.get("momentum", None) + self.nesterov = kwargs.get("nesterov", None) + self.number_of_epochs = kwargs.get("number_of_epochs", None) + self.number_of_workers = kwargs.get("number_of_workers", None) + self.optimizer = kwargs.get("optimizer", None) + self.random_seed = kwargs.get("random_seed", None) + self.step_lr_gamma = kwargs.get("step_lr_gamma", None) + self.step_lr_step_size = kwargs.get("step_lr_step_size", None) + self.training_batch_size = kwargs.get("training_batch_size", None) + self.validation_batch_size = kwargs.get("validation_batch_size", None) + self.warmup_cosine_lr_cycles = kwargs.get( + "warmup_cosine_lr_cycles", None + ) + self.warmup_cosine_lr_warmup_epochs = kwargs.get( + "warmup_cosine_lr_warmup_epochs", None + ) + self.weight_decay = kwargs.get("weight_decay", None) class ImageModelSettingsClassification(ImageModelSettings): """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: int - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: int - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: int - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: int - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'int'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'int'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'int'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar advanced_settings: Settings for advanced scenarios. + :vartype advanced_settings: str + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: bool + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: float + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: float + :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. + :vartype checkpoint_frequency: int + :ivar checkpoint_model: The pretrained checkpoint model for incremental training. + :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput + :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for + incremental training. + :vartype checkpoint_run_id: str + :ivar distributed: Whether to use distributed training. + :vartype distributed: bool + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: bool + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: int + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: int + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: bool + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: int + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: int + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: int + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: float + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. Possible values include: "None", "WarmupCosine", "Step". + :vartype learning_rate_scheduler: str or + ~azure.mgmt.machinelearningservices.models.LearningRateScheduler + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: float + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: bool + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: int + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: int + :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". + :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: int + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: float + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: int + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: int + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: int + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: float + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: int + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: float + :ivar training_crop_size: Image crop size that is input to the neural network for the training + dataset. Must be a positive integer. + :vartype training_crop_size: int + :ivar validation_crop_size: Image crop size that is input to the neural network for the + validation dataset. Must be a positive integer. + :vartype validation_crop_size: int + :ivar validation_resize_size: Image size to which to resize before cropping for validation + dataset. Must be a positive integer. + :vartype validation_resize_size: int + :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. + 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be + 0 or 1 or 2. + :vartype weighted_loss: int + """ + + _attribute_map = { + "advanced_settings": {"key": "advancedSettings", "type": "str"}, + "ams_gradient": {"key": "amsGradient", "type": "bool"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "float"}, + "beta2": {"key": "beta2", "type": "float"}, + "checkpoint_frequency": {"key": "checkpointFrequency", "type": "int"}, + "checkpoint_model": { + "key": "checkpointModel", + "type": "MLFlowModelJobInput", + }, + "checkpoint_run_id": {"key": "checkpointRunId", "type": "str"}, + "distributed": {"key": "distributed", "type": "bool"}, + "early_stopping": {"key": "earlyStopping", "type": "bool"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "int"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "int", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "bool", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "int"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "int", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "int"}, + "learning_rate": {"key": "learningRate", "type": "float"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "float"}, + "nesterov": {"key": "nesterov", "type": "bool"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "int"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "int"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "int"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "float"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "int"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "float", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "int", + }, + "weight_decay": {"key": "weightDecay", "type": "float"}, + "training_crop_size": {"key": "trainingCropSize", "type": "int"}, + "validation_crop_size": {"key": "validationCropSize", "type": "int"}, + "validation_resize_size": { + "key": "validationResizeSize", + "type": "int", + }, + "weighted_loss": {"key": "weightedLoss", "type": "int"}, + } + + def __init__(self, **kwargs): """ :keyword advanced_settings: Settings for advanced scenarios. :paramtype advanced_settings: str @@ -15653,222 +16046,254 @@ def __init__( :paramtype weighted_loss: int """ super(ImageModelSettingsClassification, self).__init__(**kwargs) - self.training_crop_size = kwargs.get('training_crop_size', None) - self.validation_crop_size = kwargs.get('validation_crop_size', None) - self.validation_resize_size = kwargs.get('validation_resize_size', None) - self.weighted_loss = kwargs.get('weighted_loss', None) + self.training_crop_size = kwargs.get("training_crop_size", None) + self.validation_crop_size = kwargs.get("validation_crop_size", None) + self.validation_resize_size = kwargs.get( + "validation_resize_size", None + ) + self.weighted_loss = kwargs.get("weighted_loss", None) class ImageModelSettingsObjectDetection(ImageModelSettings): """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: int - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: float - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: int - :ivar log_training_metrics: Enable computing and logging training metrics. Possible values - include: "Enable", "Disable". - :vartype log_training_metrics: str or - ~azure.mgmt.machinelearningservices.models.LogTrainingMetrics - :ivar log_validation_loss: Enable computing and logging validation loss. Possible values - include: "Enable", "Disable". - :vartype log_validation_loss: str or - ~azure.mgmt.machinelearningservices.models.LogValidationLoss - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: int - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: int - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: - "None", "Small", "Medium", "Large", "ExtraLarge". - :vartype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: bool - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be a - float in the range [0, 1]. - :vartype nms_iou_threshold: float - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: float - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_predictions_nms_threshold: float - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: float - :ivar validation_metric_type: Metric computation method to use for validation metrics. Possible - values include: "None", "Coco", "Voc", "CocoVoc". - :vartype validation_metric_type: str or - ~azure.mgmt.machinelearningservices.models.ValidationMetricType - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'int'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'float'}, - 'image_size': {'key': 'imageSize', 'type': 'int'}, - 'log_training_metrics': {'key': 'logTrainingMetrics', 'type': 'str'}, - 'log_validation_loss': {'key': 'logValidationLoss', 'type': 'str'}, - 'max_size': {'key': 'maxSize', 'type': 'int'}, - 'min_size': {'key': 'minSize', 'type': 'int'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'bool'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'float'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'float'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'float'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'float'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar advanced_settings: Settings for advanced scenarios. + :vartype advanced_settings: str + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: bool + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: float + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: float + :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. + :vartype checkpoint_frequency: int + :ivar checkpoint_model: The pretrained checkpoint model for incremental training. + :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput + :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for + incremental training. + :vartype checkpoint_run_id: str + :ivar distributed: Whether to use distributed training. + :vartype distributed: bool + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: bool + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: int + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: int + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: bool + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: int + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: int + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: int + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: float + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. Possible values include: "None", "WarmupCosine", "Step". + :vartype learning_rate_scheduler: str or + ~azure.mgmt.machinelearningservices.models.LearningRateScheduler + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: float + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: bool + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: int + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: int + :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". + :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: int + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: float + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: int + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: int + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: int + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: float + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: int + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: float + :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must + be a positive integer. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype box_detections_per_image: int + :ivar box_score_threshold: During inference, only return proposals with a classification score + greater than + BoxScoreThreshold. Must be a float in the range[0, 1]. + :vartype box_score_threshold: float + :ivar image_size: Image size for train and validation. Must be a positive integer. + Note: The training run may get into CUDA OOM if the size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype image_size: int + :ivar log_training_metrics: Enable computing and logging training metrics. Possible values + include: "Enable", "Disable". + :vartype log_training_metrics: str or + ~azure.mgmt.machinelearningservices.models.LogTrainingMetrics + :ivar log_validation_loss: Enable computing and logging validation loss. Possible values + include: "Enable", "Disable". + :vartype log_validation_loss: str or + ~azure.mgmt.machinelearningservices.models.LogValidationLoss + :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype max_size: int + :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype min_size: int + :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. + Note: training run may get into CUDA OOM if the model size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: + "None", "Small", "Medium", "Large", "ExtraLarge". + :vartype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize + :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. + Note: training run may get into CUDA OOM if no sufficient GPU memory. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype multi_scale: bool + :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be a + float in the range [0, 1]. + :vartype nms_iou_threshold: float + :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not + be + None to enable small object detection logic. A string containing two integers in mxn format. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_grid_size: str + :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float + in the range [0, 1). + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_overlap_ratio: float + :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging + predictions from tiles and image. + Used in validation/ inference. Must be float in the range [0, 1]. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_predictions_nms_threshold: float + :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be + float in the range [0, 1]. + :vartype validation_iou_threshold: float + :ivar validation_metric_type: Metric computation method to use for validation metrics. Possible + values include: "None", "Coco", "Voc", "CocoVoc". + :vartype validation_metric_type: str or + ~azure.mgmt.machinelearningservices.models.ValidationMetricType + """ + + _attribute_map = { + "advanced_settings": {"key": "advancedSettings", "type": "str"}, + "ams_gradient": {"key": "amsGradient", "type": "bool"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "float"}, + "beta2": {"key": "beta2", "type": "float"}, + "checkpoint_frequency": {"key": "checkpointFrequency", "type": "int"}, + "checkpoint_model": { + "key": "checkpointModel", + "type": "MLFlowModelJobInput", + }, + "checkpoint_run_id": {"key": "checkpointRunId", "type": "str"}, + "distributed": {"key": "distributed", "type": "bool"}, + "early_stopping": {"key": "earlyStopping", "type": "bool"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "int"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "int", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "bool", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "int"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "int", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "int"}, + "learning_rate": {"key": "learningRate", "type": "float"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "float"}, + "nesterov": {"key": "nesterov", "type": "bool"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "int"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "int"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "int"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "float"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "int"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "float", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "int", + }, + "weight_decay": {"key": "weightDecay", "type": "float"}, + "box_detections_per_image": { + "key": "boxDetectionsPerImage", + "type": "int", + }, + "box_score_threshold": {"key": "boxScoreThreshold", "type": "float"}, + "image_size": {"key": "imageSize", "type": "int"}, + "log_training_metrics": {"key": "logTrainingMetrics", "type": "str"}, + "log_validation_loss": {"key": "logValidationLoss", "type": "str"}, + "max_size": {"key": "maxSize", "type": "int"}, + "min_size": {"key": "minSize", "type": "int"}, + "model_size": {"key": "modelSize", "type": "str"}, + "multi_scale": {"key": "multiScale", "type": "bool"}, + "nms_iou_threshold": {"key": "nmsIouThreshold", "type": "float"}, + "tile_grid_size": {"key": "tileGridSize", "type": "str"}, + "tile_overlap_ratio": {"key": "tileOverlapRatio", "type": "float"}, + "tile_predictions_nms_threshold": { + "key": "tilePredictionsNmsThreshold", + "type": "float", + }, + "validation_iou_threshold": { + "key": "validationIouThreshold", + "type": "float", + }, + "validation_metric_type": { + "key": "validationMetricType", + "type": "str", + }, + } + + def __init__(self, **kwargs): """ :keyword advanced_settings: Settings for advanced scenarios. :paramtype advanced_settings: str @@ -16007,107 +16432,127 @@ def __init__( Note: This settings is not supported for the 'yolov5' algorithm. :paramtype tile_grid_size: str :keyword tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be - float in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_overlap_ratio: float - :keyword tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - :paramtype tile_predictions_nms_threshold: float - :keyword validation_iou_threshold: IOU threshold to use when computing validation metric. Must - be float in the range [0, 1]. - :paramtype validation_iou_threshold: float - :keyword validation_metric_type: Metric computation method to use for validation metrics. - Possible values include: "None", "Coco", "Voc", "CocoVoc". - :paramtype validation_metric_type: str or - ~azure.mgmt.machinelearningservices.models.ValidationMetricType - """ - super(ImageModelSettingsObjectDetection, self).__init__(**kwargs) - self.box_detections_per_image = kwargs.get('box_detections_per_image', None) - self.box_score_threshold = kwargs.get('box_score_threshold', None) - self.image_size = kwargs.get('image_size', None) - self.log_training_metrics = kwargs.get('log_training_metrics', None) - self.log_validation_loss = kwargs.get('log_validation_loss', None) - self.max_size = kwargs.get('max_size', None) - self.min_size = kwargs.get('min_size', None) - self.model_size = kwargs.get('model_size', None) - self.multi_scale = kwargs.get('multi_scale', None) - self.nms_iou_threshold = kwargs.get('nms_iou_threshold', None) - self.tile_grid_size = kwargs.get('tile_grid_size', None) - self.tile_overlap_ratio = kwargs.get('tile_overlap_ratio', None) - self.tile_predictions_nms_threshold = kwargs.get('tile_predictions_nms_threshold', None) - self.validation_iou_threshold = kwargs.get('validation_iou_threshold', None) - self.validation_metric_type = kwargs.get('validation_metric_type', None) - - -class ImageObjectDetection(AutoMLVertical, ImageObjectDetectionBase): - """Image Object Detection. Object detection is used to identify objects in an image and locate each object with a -bounding box e.g. locate all dogs and cats in an image and draw a bounding box around each. - - All required parameters must be populated in order to send to Azure. - - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics + float in the range [0, 1). + Note: This settings is not supported for the 'yolov5' algorithm. + :paramtype tile_overlap_ratio: float + :keyword tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging + predictions from tiles and image. + Used in validation/ inference. Must be float in the range [0, 1]. + Note: This settings is not supported for the 'yolov5' algorithm. + :paramtype tile_predictions_nms_threshold: float + :keyword validation_iou_threshold: IOU threshold to use when computing validation metric. Must + be float in the range [0, 1]. + :paramtype validation_iou_threshold: float + :keyword validation_metric_type: Metric computation method to use for validation metrics. + Possible values include: "None", "Coco", "Voc", "CocoVoc". + :paramtype validation_metric_type: str or + ~azure.mgmt.machinelearningservices.models.ValidationMetricType + """ + super(ImageModelSettingsObjectDetection, self).__init__(**kwargs) + self.box_detections_per_image = kwargs.get( + "box_detections_per_image", None + ) + self.box_score_threshold = kwargs.get("box_score_threshold", None) + self.image_size = kwargs.get("image_size", None) + self.log_training_metrics = kwargs.get("log_training_metrics", None) + self.log_validation_loss = kwargs.get("log_validation_loss", None) + self.max_size = kwargs.get("max_size", None) + self.min_size = kwargs.get("min_size", None) + self.model_size = kwargs.get("model_size", None) + self.multi_scale = kwargs.get("multi_scale", None) + self.nms_iou_threshold = kwargs.get("nms_iou_threshold", None) + self.tile_grid_size = kwargs.get("tile_grid_size", None) + self.tile_overlap_ratio = kwargs.get("tile_overlap_ratio", None) + self.tile_predictions_nms_threshold = kwargs.get( + "tile_predictions_nms_threshold", None + ) + self.validation_iou_threshold = kwargs.get( + "validation_iou_threshold", None + ) + self.validation_metric_type = kwargs.get( + "validation_metric_type", None + ) + + +class ImageObjectDetection(AutoMLVertical, ImageObjectDetectionBase): + """Image Object Detection. Object detection is used to identify objects in an image and locate each object with a + bounding box e.g. locate all dogs and cats in an image and draw a bounding box around each. + + All required parameters must be populated in order to send to Azure. + + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "MeanAveragePrecision". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics """ _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, + "limit_settings": {"required": True}, + "task_type": {"required": True}, + "training_data": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsObjectDetection", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsObjectDetection]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword limit_settings: Required. [Required] Limit settings for the AutoML job. :paramtype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings @@ -16141,17 +16586,17 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics """ super(ImageObjectDetection, self).__init__(**kwargs) - self.limit_settings = kwargs['limit_settings'] - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.model_settings = kwargs.get('model_settings', None) - self.search_space = kwargs.get('search_space', None) - self.task_type = 'ImageObjectDetection' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.limit_settings = kwargs["limit_settings"] + self.sweep_settings = kwargs.get("sweep_settings", None) + self.validation_data = kwargs.get("validation_data", None) + self.validation_data_size = kwargs.get("validation_data_size", None) + self.model_settings = kwargs.get("model_settings", None) + self.search_space = kwargs.get("search_space", None) + self.task_type = "ImageObjectDetection" # type: str + self.primary_metric = kwargs.get("primary_metric", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class ImageSweepSettings(msrest.serialization.Model): @@ -16168,18 +16613,18 @@ class ImageSweepSettings(msrest.serialization.Model): """ _validation = { - 'sampling_algorithm': {'required': True}, + "sampling_algorithm": {"required": True}, } _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, + "sampling_algorithm": {"key": "samplingAlgorithm", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword early_termination: Type of early termination policy. :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy @@ -16189,8 +16634,8 @@ def __init__( ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType """ super(ImageSweepSettings, self).__init__(**kwargs) - self.early_termination = kwargs.get('early_termination', None) - self.sampling_algorithm = kwargs['sampling_algorithm'] + self.early_termination = kwargs.get("early_termination", None) + self.sampling_algorithm = kwargs["sampling_algorithm"] class ImportDataAction(ScheduleActionBase): @@ -16207,27 +16652,27 @@ class ImportDataAction(ScheduleActionBase): """ _validation = { - 'action_type': {'required': True}, - 'data_import_definition': {'required': True}, + "action_type": {"required": True}, + "data_import_definition": {"required": True}, } _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'data_import_definition': {'key': 'dataImportDefinition', 'type': 'DataImport'}, + "action_type": {"key": "actionType", "type": "str"}, + "data_import_definition": { + "key": "dataImportDefinition", + "type": "DataImport", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data_import_definition: Required. [Required] Defines Schedule action definition details. :paramtype data_import_definition: ~azure.mgmt.machinelearningservices.models.DataImport """ super(ImportDataAction, self).__init__(**kwargs) - self.action_type = 'ImportData' # type: str - self.data_import_definition = kwargs['data_import_definition'] + self.action_type = "ImportData" # type: str + self.data_import_definition = kwargs["data_import_definition"] class IndexColumn(msrest.serialization.Model): @@ -16241,14 +16686,11 @@ class IndexColumn(msrest.serialization.Model): """ _attribute_map = { - 'column_name': {'key': 'columnName', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, + "column_name": {"key": "columnName", "type": "str"}, + "data_type": {"key": "dataType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword column_name: Specifies the column name. :paramtype column_name: str @@ -16257,8 +16699,8 @@ def __init__( :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.FeatureDataType """ super(IndexColumn, self).__init__(**kwargs) - self.column_name = kwargs.get('column_name', None) - self.data_type = kwargs.get('data_type', None) + self.column_name = kwargs.get("column_name", None) + self.data_type = kwargs.get("data_type", None) class InferenceContainerProperties(msrest.serialization.Model): @@ -16274,15 +16716,12 @@ class InferenceContainerProperties(msrest.serialization.Model): """ _attribute_map = { - 'liveness_route': {'key': 'livenessRoute', 'type': 'Route'}, - 'readiness_route': {'key': 'readinessRoute', 'type': 'Route'}, - 'scoring_route': {'key': 'scoringRoute', 'type': 'Route'}, + "liveness_route": {"key": "livenessRoute", "type": "Route"}, + "readiness_route": {"key": "readinessRoute", "type": "Route"}, + "scoring_route": {"key": "scoringRoute", "type": "Route"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword liveness_route: The route to check the liveness of the inference server container. :paramtype liveness_route: ~azure.mgmt.machinelearningservices.models.Route @@ -16293,9 +16732,9 @@ def __init__( :paramtype scoring_route: ~azure.mgmt.machinelearningservices.models.Route """ super(InferenceContainerProperties, self).__init__(**kwargs) - self.liveness_route = kwargs.get('liveness_route', None) - self.readiness_route = kwargs.get('readiness_route', None) - self.scoring_route = kwargs.get('scoring_route', None) + self.liveness_route = kwargs.get("liveness_route", None) + self.readiness_route = kwargs.get("readiness_route", None) + self.scoring_route = kwargs.get("scoring_route", None) class InstanceTypeSchema(msrest.serialization.Model): @@ -16308,14 +16747,14 @@ class InstanceTypeSchema(msrest.serialization.Model): """ _attribute_map = { - 'node_selector': {'key': 'nodeSelector', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'InstanceTypeSchemaResources'}, + "node_selector": {"key": "nodeSelector", "type": "{str}"}, + "resources": { + "key": "resources", + "type": "InstanceTypeSchemaResources", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword node_selector: Node Selector. :paramtype node_selector: dict[str, str] @@ -16323,8 +16762,8 @@ def __init__( :paramtype resources: ~azure.mgmt.machinelearningservices.models.InstanceTypeSchemaResources """ super(InstanceTypeSchema, self).__init__(**kwargs) - self.node_selector = kwargs.get('node_selector', None) - self.resources = kwargs.get('resources', None) + self.node_selector = kwargs.get("node_selector", None) + self.resources = kwargs.get("resources", None) class InstanceTypeSchemaResources(msrest.serialization.Model): @@ -16337,14 +16776,11 @@ class InstanceTypeSchemaResources(msrest.serialization.Model): """ _attribute_map = { - 'requests': {'key': 'requests', 'type': '{str}'}, - 'limits': {'key': 'limits', 'type': '{str}'}, + "requests": {"key": "requests", "type": "{str}"}, + "limits": {"key": "limits", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword requests: Resource requests for this instance type. :paramtype requests: dict[str, str] @@ -16352,8 +16788,8 @@ def __init__( :paramtype limits: dict[str, str] """ super(InstanceTypeSchemaResources, self).__init__(**kwargs) - self.requests = kwargs.get('requests', None) - self.limits = kwargs.get('limits', None) + self.requests = kwargs.get("requests", None) + self.limits = kwargs.get("limits", None) class IntellectualProperty(msrest.serialization.Model): @@ -16370,18 +16806,19 @@ class IntellectualProperty(msrest.serialization.Model): """ _validation = { - 'publisher': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "publisher": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'protection_level': {'key': 'protectionLevel', 'type': 'str'}, - 'publisher': {'key': 'publisher', 'type': 'str'}, + "protection_level": {"key": "protectionLevel", "type": "str"}, + "publisher": {"key": "publisher", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword protection_level: Protection level of the Intellectual Property. Possible values include: "All", "None". @@ -16391,8 +16828,8 @@ def __init__( :paramtype publisher: str """ super(IntellectualProperty, self).__init__(**kwargs) - self.protection_level = kwargs.get('protection_level', None) - self.publisher = kwargs['publisher'] + self.protection_level = kwargs.get("protection_level", None) + self.publisher = kwargs["publisher"] class JobBase(Resource): @@ -16418,31 +16855,28 @@ class JobBase(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'JobBaseProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "JobBaseProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.JobBaseProperties """ super(JobBase, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class JobBaseResourceArmPaginatedResult(msrest.serialization.Model): @@ -16456,14 +16890,11 @@ class JobBaseResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[JobBase]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[JobBase]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of JobBase objects. If null, there are no additional pages. @@ -16472,8 +16903,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.JobBase] """ super(JobBaseResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class JobResourceConfiguration(ResourceConfiguration): @@ -16502,23 +16933,20 @@ class JobResourceConfiguration(ResourceConfiguration): """ _validation = { - 'shm_size': {'pattern': r'\d+[bBkKmMgG]'}, + "shm_size": {"pattern": r"\d+[bBkKmMgG]"}, } _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'max_instance_count': {'key': 'maxInstanceCount', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - 'docker_args': {'key': 'dockerArgs', 'type': 'str'}, - 'shm_size': {'key': 'shmSize', 'type': 'str'}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "locations": {"key": "locations", "type": "[str]"}, + "max_instance_count": {"key": "maxInstanceCount", "type": "int"}, + "properties": {"key": "properties", "type": "{object}"}, + "docker_args": {"key": "dockerArgs", "type": "str"}, + "shm_size": {"key": "shmSize", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword instance_count: Optional number of instances or nodes used by the compute target. :paramtype instance_count: int @@ -16542,8 +16970,8 @@ def __init__( :paramtype shm_size: str """ super(JobResourceConfiguration, self).__init__(**kwargs) - self.docker_args = kwargs.get('docker_args', None) - self.shm_size = kwargs.get('shm_size', "2g") + self.docker_args = kwargs.get("docker_args", None) + self.shm_size = kwargs.get("shm_size", "2g") class JobScheduleAction(ScheduleActionBase): @@ -16560,26 +16988,26 @@ class JobScheduleAction(ScheduleActionBase): """ _validation = { - 'action_type': {'required': True}, - 'job_definition': {'required': True}, + "action_type": {"required": True}, + "job_definition": {"required": True}, } _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'job_definition': {'key': 'jobDefinition', 'type': 'JobBaseProperties'}, + "action_type": {"key": "actionType", "type": "str"}, + "job_definition": { + "key": "jobDefinition", + "type": "JobBaseProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword job_definition: Required. [Required] Defines Schedule action definition details. :paramtype job_definition: ~azure.mgmt.machinelearningservices.models.JobBaseProperties """ super(JobScheduleAction, self).__init__(**kwargs) - self.action_type = 'CreateJob' # type: str - self.job_definition = kwargs['job_definition'] + self.action_type = "CreateJob" # type: str + self.job_definition = kwargs["job_definition"] class JobService(msrest.serialization.Model): @@ -16605,24 +17033,21 @@ class JobService(msrest.serialization.Model): """ _validation = { - 'error_message': {'readonly': True}, - 'status': {'readonly': True}, + "error_message": {"readonly": True}, + "status": {"readonly": True}, } _attribute_map = { - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'job_service_type': {'key': 'jobServiceType', 'type': 'str'}, - 'nodes': {'key': 'nodes', 'type': 'Nodes'}, - 'port': {'key': 'port', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'status': {'key': 'status', 'type': 'str'}, + "endpoint": {"key": "endpoint", "type": "str"}, + "error_message": {"key": "errorMessage", "type": "str"}, + "job_service_type": {"key": "jobServiceType", "type": "str"}, + "nodes": {"key": "nodes", "type": "Nodes"}, + "port": {"key": "port", "type": "int"}, + "properties": {"key": "properties", "type": "{str}"}, + "status": {"key": "status", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword endpoint: Url for endpoint. :paramtype endpoint: str @@ -16637,12 +17062,12 @@ def __init__( :paramtype properties: dict[str, str] """ super(JobService, self).__init__(**kwargs) - self.endpoint = kwargs.get('endpoint', None) + self.endpoint = kwargs.get("endpoint", None) self.error_message = None - self.job_service_type = kwargs.get('job_service_type', None) - self.nodes = kwargs.get('nodes', None) - self.port = kwargs.get('port', None) - self.properties = kwargs.get('properties', None) + self.job_service_type = kwargs.get("job_service_type", None) + self.nodes = kwargs.get("nodes", None) + self.port = kwargs.get("port", None) + self.properties = kwargs.get("properties", None) self.status = None @@ -16661,21 +17086,30 @@ class KerberosCredentials(msrest.serialization.Model): """ _validation = { - 'kerberos_kdc_address': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "kerberos_kdc_address": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "kerberos_principal": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "kerberos_realm": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, + "kerberos_kdc_address": {"key": "kerberosKdcAddress", "type": "str"}, + "kerberos_principal": {"key": "kerberosPrincipal", "type": "str"}, + "kerberos_realm": {"key": "kerberosRealm", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. :paramtype kerberos_kdc_address: str @@ -16686,9 +17120,9 @@ def __init__( :paramtype kerberos_realm: str """ super(KerberosCredentials, self).__init__(**kwargs) - self.kerberos_kdc_address = kwargs['kerberos_kdc_address'] - self.kerberos_principal = kwargs['kerberos_principal'] - self.kerberos_realm = kwargs['kerberos_realm'] + self.kerberos_kdc_address = kwargs["kerberos_kdc_address"] + self.kerberos_principal = kwargs["kerberos_principal"] + self.kerberos_realm = kwargs["kerberos_realm"] class KerberosKeytabCredentials(DatastoreCredentials, KerberosCredentials): @@ -16712,25 +17146,34 @@ class KerberosKeytabCredentials(DatastoreCredentials, KerberosCredentials): """ _validation = { - 'kerberos_kdc_address': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, + "kerberos_kdc_address": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "kerberos_principal": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "kerberos_realm": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "credentials_type": {"required": True}, + "secrets": {"required": True}, } _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'KerberosKeytabSecrets'}, + "kerberos_kdc_address": {"key": "kerberosKdcAddress", "type": "str"}, + "kerberos_principal": {"key": "kerberosPrincipal", "type": "str"}, + "kerberos_realm": {"key": "kerberosRealm", "type": "str"}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "secrets": {"key": "secrets", "type": "KerberosKeytabSecrets"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. :paramtype kerberos_kdc_address: str @@ -16743,11 +17186,11 @@ def __init__( :paramtype secrets: ~azure.mgmt.machinelearningservices.models.KerberosKeytabSecrets """ super(KerberosKeytabCredentials, self).__init__(**kwargs) - self.kerberos_kdc_address = kwargs['kerberos_kdc_address'] - self.kerberos_principal = kwargs['kerberos_principal'] - self.kerberos_realm = kwargs['kerberos_realm'] - self.credentials_type = 'KerberosKeytab' # type: str - self.secrets = kwargs['secrets'] + self.kerberos_kdc_address = kwargs["kerberos_kdc_address"] + self.kerberos_principal = kwargs["kerberos_principal"] + self.kerberos_realm = kwargs["kerberos_realm"] + self.credentials_type = "KerberosKeytab" # type: str + self.secrets = kwargs["secrets"] class KerberosKeytabSecrets(DatastoreSecrets): @@ -16764,25 +17207,22 @@ class KerberosKeytabSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'kerberos_keytab': {'key': 'kerberosKeytab', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "kerberos_keytab": {"key": "kerberosKeytab", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword kerberos_keytab: Kerberos keytab secret. :paramtype kerberos_keytab: str """ super(KerberosKeytabSecrets, self).__init__(**kwargs) - self.secrets_type = 'KerberosKeytab' # type: str - self.kerberos_keytab = kwargs.get('kerberos_keytab', None) + self.secrets_type = "KerberosKeytab" # type: str + self.kerberos_keytab = kwargs.get("kerberos_keytab", None) class KerberosPasswordCredentials(DatastoreCredentials, KerberosCredentials): @@ -16806,25 +17246,34 @@ class KerberosPasswordCredentials(DatastoreCredentials, KerberosCredentials): """ _validation = { - 'kerberos_kdc_address': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, + "kerberos_kdc_address": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "kerberos_principal": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "kerberos_realm": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "credentials_type": {"required": True}, + "secrets": {"required": True}, } _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'KerberosPasswordSecrets'}, + "kerberos_kdc_address": {"key": "kerberosKdcAddress", "type": "str"}, + "kerberos_principal": {"key": "kerberosPrincipal", "type": "str"}, + "kerberos_realm": {"key": "kerberosRealm", "type": "str"}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "secrets": {"key": "secrets", "type": "KerberosPasswordSecrets"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword kerberos_kdc_address: Required. [Required] IP Address or DNS HostName. :paramtype kerberos_kdc_address: str @@ -16837,11 +17286,11 @@ def __init__( :paramtype secrets: ~azure.mgmt.machinelearningservices.models.KerberosPasswordSecrets """ super(KerberosPasswordCredentials, self).__init__(**kwargs) - self.kerberos_kdc_address = kwargs['kerberos_kdc_address'] - self.kerberos_principal = kwargs['kerberos_principal'] - self.kerberos_realm = kwargs['kerberos_realm'] - self.credentials_type = 'KerberosPassword' # type: str - self.secrets = kwargs['secrets'] + self.kerberos_kdc_address = kwargs["kerberos_kdc_address"] + self.kerberos_principal = kwargs["kerberos_principal"] + self.kerberos_realm = kwargs["kerberos_realm"] + self.credentials_type = "KerberosPassword" # type: str + self.secrets = kwargs["secrets"] class KerberosPasswordSecrets(DatastoreSecrets): @@ -16858,25 +17307,22 @@ class KerberosPasswordSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'kerberos_password': {'key': 'kerberosPassword', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "kerberos_password": {"key": "kerberosPassword", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword kerberos_password: Kerberos password secret. :paramtype kerberos_password: str """ super(KerberosPasswordSecrets, self).__init__(**kwargs) - self.secrets_type = 'KerberosPassword' # type: str - self.kerberos_password = kwargs.get('kerberos_password', None) + self.secrets_type = "KerberosPassword" # type: str + self.kerberos_password = kwargs.get("kerberos_password", None) class KubernetesSchema(msrest.serialization.Model): @@ -16887,19 +17333,16 @@ class KubernetesSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, + "properties": {"key": "properties", "type": "KubernetesProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of Kubernetes. :paramtype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties """ super(KubernetesSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class Kubernetes(Compute, KubernetesSchema): @@ -16941,32 +17384,32 @@ class Kubernetes(Compute, KubernetesSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "KubernetesProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Properties of Kubernetes. :paramtype properties: ~azure.mgmt.machinelearningservices.models.KubernetesProperties @@ -16981,17 +17424,17 @@ def __init__( :paramtype disable_local_auth: bool """ super(Kubernetes, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'Kubernetes' # type: str - self.compute_location = kwargs.get('compute_location', None) + self.properties = kwargs.get("properties", None) + self.compute_type = "Kubernetes" # type: str + self.compute_location = kwargs.get("compute_location", None) self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) + self.disable_local_auth = kwargs.get("disable_local_auth", None) class OnlineDeploymentProperties(EndpointDeploymentPropertiesBase): @@ -17053,38 +17496,53 @@ class OnlineDeploymentProperties(EndpointDeploymentPropertiesBase): """ _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'data_collector': {'key': 'dataCollector', 'type': 'DataCollector'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, + "endpoint_compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, + "data_collector": {"key": "dataCollector", "type": "DataCollector"}, + "egress_public_network_access": { + "key": "egressPublicNetworkAccess", + "type": "str", + }, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, + "model": {"key": "model", "type": "str"}, + "model_mount_path": {"key": "modelMountPath", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, } _subtype_map = { - 'endpoint_compute_type': {'Kubernetes': 'KubernetesOnlineDeployment', 'Managed': 'ManagedOnlineDeployment'} + "endpoint_compute_type": { + "Kubernetes": "KubernetesOnlineDeployment", + "Managed": "ManagedOnlineDeployment", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword code_configuration: Code configuration for the endpoint deployment. :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration @@ -17126,18 +17584,20 @@ def __init__( :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings """ super(OnlineDeploymentProperties, self).__init__(**kwargs) - self.app_insights_enabled = kwargs.get('app_insights_enabled', False) - self.data_collector = kwargs.get('data_collector', None) - self.egress_public_network_access = kwargs.get('egress_public_network_access', None) - self.endpoint_compute_type = 'OnlineDeploymentProperties' # type: str - self.instance_type = kwargs.get('instance_type', None) - self.liveness_probe = kwargs.get('liveness_probe', None) - self.model = kwargs.get('model', None) - self.model_mount_path = kwargs.get('model_mount_path', None) + self.app_insights_enabled = kwargs.get("app_insights_enabled", False) + self.data_collector = kwargs.get("data_collector", None) + self.egress_public_network_access = kwargs.get( + "egress_public_network_access", None + ) + self.endpoint_compute_type = "OnlineDeploymentProperties" # type: str + self.instance_type = kwargs.get("instance_type", None) + self.liveness_probe = kwargs.get("liveness_probe", None) + self.model = kwargs.get("model", None) + self.model_mount_path = kwargs.get("model_mount_path", None) self.provisioning_state = None - self.readiness_probe = kwargs.get('readiness_probe', None) - self.request_settings = kwargs.get('request_settings', None) - self.scale_settings = kwargs.get('scale_settings', None) + self.readiness_probe = kwargs.get("readiness_probe", None) + self.request_settings = kwargs.get("request_settings", None) + self.scale_settings = kwargs.get("scale_settings", None) class KubernetesOnlineDeployment(OnlineDeploymentProperties): @@ -17200,35 +17660,50 @@ class KubernetesOnlineDeployment(OnlineDeploymentProperties): """ _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'data_collector': {'key': 'dataCollector', 'type': 'DataCollector'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - 'container_resource_requirements': {'key': 'containerResourceRequirements', 'type': 'ContainerResourceRequirements'}, - } - - def __init__( - self, - **kwargs - ): + "endpoint_compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, + "data_collector": {"key": "dataCollector", "type": "DataCollector"}, + "egress_public_network_access": { + "key": "egressPublicNetworkAccess", + "type": "str", + }, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, + "model": {"key": "model", "type": "str"}, + "model_mount_path": {"key": "modelMountPath", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, + "container_resource_requirements": { + "key": "containerResourceRequirements", + "type": "ContainerResourceRequirements", + }, + } + + def __init__(self, **kwargs): """ :keyword code_configuration: Code configuration for the endpoint deployment. :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration @@ -17274,8 +17749,10 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ContainerResourceRequirements """ super(KubernetesOnlineDeployment, self).__init__(**kwargs) - self.endpoint_compute_type = 'Kubernetes' # type: str - self.container_resource_requirements = kwargs.get('container_resource_requirements', None) + self.endpoint_compute_type = "Kubernetes" # type: str + self.container_resource_requirements = kwargs.get( + "container_resource_requirements", None + ) class KubernetesProperties(msrest.serialization.Model): @@ -17301,20 +17778,32 @@ class KubernetesProperties(msrest.serialization.Model): """ _attribute_map = { - 'relay_connection_string': {'key': 'relayConnectionString', 'type': 'str'}, - 'service_bus_connection_string': {'key': 'serviceBusConnectionString', 'type': 'str'}, - 'extension_principal_id': {'key': 'extensionPrincipalId', 'type': 'str'}, - 'extension_instance_release_train': {'key': 'extensionInstanceReleaseTrain', 'type': 'str'}, - 'vc_name': {'key': 'vcName', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'default_instance_type': {'key': 'defaultInstanceType', 'type': 'str'}, - 'instance_types': {'key': 'instanceTypes', 'type': '{InstanceTypeSchema}'}, - } - - def __init__( - self, - **kwargs - ): + "relay_connection_string": { + "key": "relayConnectionString", + "type": "str", + }, + "service_bus_connection_string": { + "key": "serviceBusConnectionString", + "type": "str", + }, + "extension_principal_id": { + "key": "extensionPrincipalId", + "type": "str", + }, + "extension_instance_release_train": { + "key": "extensionInstanceReleaseTrain", + "type": "str", + }, + "vc_name": {"key": "vcName", "type": "str"}, + "namespace": {"key": "namespace", "type": "str"}, + "default_instance_type": {"key": "defaultInstanceType", "type": "str"}, + "instance_types": { + "key": "instanceTypes", + "type": "{InstanceTypeSchema}", + }, + } + + def __init__(self, **kwargs): """ :keyword relay_connection_string: Relay connection string. :paramtype relay_connection_string: str @@ -17335,14 +17824,22 @@ def __init__( ~azure.mgmt.machinelearningservices.models.InstanceTypeSchema] """ super(KubernetesProperties, self).__init__(**kwargs) - self.relay_connection_string = kwargs.get('relay_connection_string', None) - self.service_bus_connection_string = kwargs.get('service_bus_connection_string', None) - self.extension_principal_id = kwargs.get('extension_principal_id', None) - self.extension_instance_release_train = kwargs.get('extension_instance_release_train', None) - self.vc_name = kwargs.get('vc_name', None) - self.namespace = kwargs.get('namespace', "default") - self.default_instance_type = kwargs.get('default_instance_type', None) - self.instance_types = kwargs.get('instance_types', None) + self.relay_connection_string = kwargs.get( + "relay_connection_string", None + ) + self.service_bus_connection_string = kwargs.get( + "service_bus_connection_string", None + ) + self.extension_principal_id = kwargs.get( + "extension_principal_id", None + ) + self.extension_instance_release_train = kwargs.get( + "extension_instance_release_train", None + ) + self.vc_name = kwargs.get("vc_name", None) + self.namespace = kwargs.get("namespace", "default") + self.default_instance_type = kwargs.get("default_instance_type", None) + self.instance_types = kwargs.get("instance_types", None) class LabelCategory(msrest.serialization.Model): @@ -17358,15 +17855,12 @@ class LabelCategory(msrest.serialization.Model): """ _attribute_map = { - 'classes': {'key': 'classes', 'type': '{LabelClass}'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'multi_select': {'key': 'multiSelect', 'type': 'str'}, + "classes": {"key": "classes", "type": "{LabelClass}"}, + "display_name": {"key": "displayName", "type": "str"}, + "multi_select": {"key": "multiSelect", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword classes: Dictionary of label classes in this category. :paramtype classes: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] @@ -17377,9 +17871,9 @@ def __init__( :paramtype multi_select: str or ~azure.mgmt.machinelearningservices.models.MultiSelect """ super(LabelCategory, self).__init__(**kwargs) - self.classes = kwargs.get('classes', None) - self.display_name = kwargs.get('display_name', None) - self.multi_select = kwargs.get('multi_select', None) + self.classes = kwargs.get("classes", None) + self.display_name = kwargs.get("display_name", None) + self.multi_select = kwargs.get("multi_select", None) class LabelClass(msrest.serialization.Model): @@ -17392,14 +17886,11 @@ class LabelClass(msrest.serialization.Model): """ _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'subclasses': {'key': 'subclasses', 'type': '{LabelClass}'}, + "display_name": {"key": "displayName", "type": "str"}, + "subclasses": {"key": "subclasses", "type": "{LabelClass}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword display_name: Display name of the label class. :paramtype display_name: str @@ -17407,8 +17898,8 @@ def __init__( :paramtype subclasses: dict[str, ~azure.mgmt.machinelearningservices.models.LabelClass] """ super(LabelClass, self).__init__(**kwargs) - self.display_name = kwargs.get('display_name', None) - self.subclasses = kwargs.get('subclasses', None) + self.display_name = kwargs.get("display_name", None) + self.subclasses = kwargs.get("subclasses", None) class LabelingDataConfiguration(msrest.serialization.Model): @@ -17423,14 +17914,14 @@ class LabelingDataConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'data_id': {'key': 'dataId', 'type': 'str'}, - 'incremental_data_refresh': {'key': 'incrementalDataRefresh', 'type': 'str'}, + "data_id": {"key": "dataId", "type": "str"}, + "incremental_data_refresh": { + "key": "incrementalDataRefresh", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword data_id: Resource Id of the data asset to perform labeling. :paramtype data_id: str @@ -17440,8 +17931,10 @@ def __init__( ~azure.mgmt.machinelearningservices.models.IncrementalDataRefresh """ super(LabelingDataConfiguration, self).__init__(**kwargs) - self.data_id = kwargs.get('data_id', None) - self.incremental_data_refresh = kwargs.get('incremental_data_refresh', None) + self.data_id = kwargs.get("data_id", None) + self.incremental_data_refresh = kwargs.get( + "incremental_data_refresh", None + ) class LabelingJob(Resource): @@ -17467,31 +17960,28 @@ class LabelingJob(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'LabelingJobProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "LabelingJobProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.LabelingJobProperties """ super(LabelingJob, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class LabelingJobMediaProperties(msrest.serialization.Model): @@ -17508,23 +17998,22 @@ class LabelingJobMediaProperties(msrest.serialization.Model): """ _validation = { - 'media_type': {'required': True}, + "media_type": {"required": True}, } _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, + "media_type": {"key": "mediaType", "type": "str"}, } _subtype_map = { - 'media_type': {'Image': 'LabelingJobImageProperties', 'Text': 'LabelingJobTextProperties'} + "media_type": { + "Image": "LabelingJobImageProperties", + "Text": "LabelingJobTextProperties", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(LabelingJobMediaProperties, self).__init__(**kwargs) self.media_type = None # type: Optional[str] @@ -17543,18 +18032,15 @@ class LabelingJobImageProperties(LabelingJobMediaProperties): """ _validation = { - 'media_type': {'required': True}, + "media_type": {"required": True}, } _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - 'annotation_type': {'key': 'annotationType', 'type': 'str'}, + "media_type": {"key": "mediaType", "type": "str"}, + "annotation_type": {"key": "annotationType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword annotation_type: Annotation type of image labeling job. Possible values include: "Classification", "BoundingBox", "InstanceSegmentation". @@ -17562,8 +18048,8 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ImageAnnotationType """ super(LabelingJobImageProperties, self).__init__(**kwargs) - self.media_type = 'Image' # type: str - self.annotation_type = kwargs.get('annotation_type', None) + self.media_type = "Image" # type: str + self.annotation_type = kwargs.get("annotation_type", None) class LabelingJobInstructions(msrest.serialization.Model): @@ -17574,19 +18060,16 @@ class LabelingJobInstructions(msrest.serialization.Model): """ _attribute_map = { - 'uri': {'key': 'uri', 'type': 'str'}, + "uri": {"key": "uri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword uri: The link to a page with detailed labeling instructions for labelers. :paramtype uri: str """ super(LabelingJobInstructions, self).__init__(**kwargs) - self.uri = kwargs.get('uri', None) + self.uri = kwargs.get("uri", None) class LabelingJobProperties(JobBaseProperties): @@ -17660,46 +18143,70 @@ class LabelingJobProperties(JobBaseProperties): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'created_date_time': {'readonly': True}, - 'progress_metrics': {'readonly': True}, - 'project_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'status_messages': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'data_configuration': {'key': 'dataConfiguration', 'type': 'LabelingDataConfiguration'}, - 'job_instructions': {'key': 'jobInstructions', 'type': 'LabelingJobInstructions'}, - 'label_categories': {'key': 'labelCategories', 'type': '{LabelCategory}'}, - 'labeling_job_media_properties': {'key': 'labelingJobMediaProperties', 'type': 'LabelingJobMediaProperties'}, - 'ml_assist_configuration': {'key': 'mlAssistConfiguration', 'type': 'MLAssistConfiguration'}, - 'progress_metrics': {'key': 'progressMetrics', 'type': 'ProgressMetrics'}, - 'project_id': {'key': 'projectId', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'status_messages': {'key': 'statusMessages', 'type': '[StatusMessage]'}, - } - - def __init__( - self, - **kwargs - ): + "job_type": {"required": True}, + "status": {"readonly": True}, + "created_date_time": {"readonly": True}, + "progress_metrics": {"readonly": True}, + "project_id": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "status_messages": {"readonly": True}, + } + + _attribute_map = { + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "notification_setting": { + "key": "notificationSetting", + "type": "NotificationSetting", + }, + "secrets_configuration": { + "key": "secretsConfiguration", + "type": "{SecretConfiguration}", + }, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "created_date_time": {"key": "createdDateTime", "type": "iso-8601"}, + "data_configuration": { + "key": "dataConfiguration", + "type": "LabelingDataConfiguration", + }, + "job_instructions": { + "key": "jobInstructions", + "type": "LabelingJobInstructions", + }, + "label_categories": { + "key": "labelCategories", + "type": "{LabelCategory}", + }, + "labeling_job_media_properties": { + "key": "labelingJobMediaProperties", + "type": "LabelingJobMediaProperties", + }, + "ml_assist_configuration": { + "key": "mlAssistConfiguration", + "type": "MLAssistConfiguration", + }, + "progress_metrics": { + "key": "progressMetrics", + "type": "ProgressMetrics", + }, + "project_id": {"key": "projectId", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "status_messages": { + "key": "statusMessages", + "type": "[StatusMessage]", + }, + } + + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -17746,13 +18253,17 @@ def __init__( ~azure.mgmt.machinelearningservices.models.MLAssistConfiguration """ super(LabelingJobProperties, self).__init__(**kwargs) - self.job_type = 'Labeling' # type: str + self.job_type = "Labeling" # type: str self.created_date_time = None - self.data_configuration = kwargs.get('data_configuration', None) - self.job_instructions = kwargs.get('job_instructions', None) - self.label_categories = kwargs.get('label_categories', None) - self.labeling_job_media_properties = kwargs.get('labeling_job_media_properties', None) - self.ml_assist_configuration = kwargs.get('ml_assist_configuration', None) + self.data_configuration = kwargs.get("data_configuration", None) + self.job_instructions = kwargs.get("job_instructions", None) + self.label_categories = kwargs.get("label_categories", None) + self.labeling_job_media_properties = kwargs.get( + "labeling_job_media_properties", None + ) + self.ml_assist_configuration = kwargs.get( + "ml_assist_configuration", None + ) self.progress_metrics = None self.project_id = None self.provisioning_state = None @@ -17770,14 +18281,11 @@ class LabelingJobResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[LabelingJob]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[LabelingJob]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of LabelingJob objects. If null, there are no additional pages. @@ -17786,8 +18294,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.LabelingJob] """ super(LabelingJobResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class LabelingJobTextProperties(LabelingJobMediaProperties): @@ -17804,18 +18312,15 @@ class LabelingJobTextProperties(LabelingJobMediaProperties): """ _validation = { - 'media_type': {'required': True}, + "media_type": {"required": True}, } _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - 'annotation_type': {'key': 'annotationType', 'type': 'str'}, + "media_type": {"key": "mediaType", "type": "str"}, + "annotation_type": {"key": "annotationType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword annotation_type: Annotation type of text labeling job. Possible values include: "Classification", "NamedEntityRecognition". @@ -17823,8 +18328,8 @@ def __init__( ~azure.mgmt.machinelearningservices.models.TextAnnotationType """ super(LabelingJobTextProperties, self).__init__(**kwargs) - self.media_type = 'Text' # type: str - self.annotation_type = kwargs.get('annotation_type', None) + self.media_type = "Text" # type: str + self.annotation_type = kwargs.get("annotation_type", None) class OneLakeArtifact(msrest.serialization.Model): @@ -17843,29 +18348,28 @@ class OneLakeArtifact(msrest.serialization.Model): """ _validation = { - 'artifact_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'artifact_type': {'required': True}, + "artifact_name": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "artifact_type": {"required": True}, } _attribute_map = { - 'artifact_name': {'key': 'artifactName', 'type': 'str'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, + "artifact_name": {"key": "artifactName", "type": "str"}, + "artifact_type": {"key": "artifactType", "type": "str"}, } - _subtype_map = { - 'artifact_type': {'LakeHouse': 'LakeHouseArtifact'} - } + _subtype_map = {"artifact_type": {"LakeHouse": "LakeHouseArtifact"}} - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword artifact_name: Required. [Required] OneLake artifact name. :paramtype artifact_name: str """ super(OneLakeArtifact, self).__init__(**kwargs) - self.artifact_name = kwargs['artifact_name'] + self.artifact_name = kwargs["artifact_name"] self.artifact_type = None # type: Optional[str] @@ -17882,25 +18386,26 @@ class LakeHouseArtifact(OneLakeArtifact): """ _validation = { - 'artifact_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'artifact_type': {'required': True}, + "artifact_name": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "artifact_type": {"required": True}, } _attribute_map = { - 'artifact_name': {'key': 'artifactName', 'type': 'str'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, + "artifact_name": {"key": "artifactName", "type": "str"}, + "artifact_type": {"key": "artifactType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword artifact_name: Required. [Required] OneLake artifact name. :paramtype artifact_name: str """ super(LakeHouseArtifact, self).__init__(**kwargs) - self.artifact_type = 'LakeHouse' # type: str + self.artifact_type = "LakeHouse" # type: str class ListAmlUserFeatureResult(msrest.serialization.Model): @@ -17916,21 +18421,17 @@ class ListAmlUserFeatureResult(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlUserFeature]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[AmlUserFeature]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListAmlUserFeatureResult, self).__init__(**kwargs) self.value = None self.next_link = None @@ -17948,21 +18449,17 @@ class ListNotebookKeysResult(msrest.serialization.Model): """ _validation = { - 'primary_access_key': {'readonly': True}, - 'secondary_access_key': {'readonly': True}, + "primary_access_key": {"readonly": True}, + "secondary_access_key": {"readonly": True}, } _attribute_map = { - 'primary_access_key': {'key': 'primaryAccessKey', 'type': 'str'}, - 'secondary_access_key': {'key': 'secondaryAccessKey', 'type': 'str'}, + "primary_access_key": {"key": "primaryAccessKey", "type": "str"}, + "secondary_access_key": {"key": "secondaryAccessKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListNotebookKeysResult, self).__init__(**kwargs) self.primary_access_key = None self.secondary_access_key = None @@ -17978,19 +18475,15 @@ class ListStorageAccountKeysResult(msrest.serialization.Model): """ _validation = { - 'user_storage_key': {'readonly': True}, + "user_storage_key": {"readonly": True}, } _attribute_map = { - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, + "user_storage_key": {"key": "userStorageKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListStorageAccountKeysResult, self).__init__(**kwargs) self.user_storage_key = None @@ -18008,21 +18501,17 @@ class ListUsagesResult(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[Usage]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Usage]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListUsagesResult, self).__init__(**kwargs) self.value = None self.next_link = None @@ -18048,27 +18537,35 @@ class ListWorkspaceKeysResult(msrest.serialization.Model): """ _validation = { - 'user_storage_key': {'readonly': True}, - 'user_storage_resource_id': {'readonly': True}, - 'app_insights_instrumentation_key': {'readonly': True}, - 'container_registry_credentials': {'readonly': True}, - 'notebook_access_keys': {'readonly': True}, + "user_storage_key": {"readonly": True}, + "user_storage_resource_id": {"readonly": True}, + "app_insights_instrumentation_key": {"readonly": True}, + "container_registry_credentials": {"readonly": True}, + "notebook_access_keys": {"readonly": True}, } _attribute_map = { - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, - 'user_storage_resource_id': {'key': 'userStorageResourceId', 'type': 'str'}, - 'app_insights_instrumentation_key': {'key': 'appInsightsInstrumentationKey', 'type': 'str'}, - 'container_registry_credentials': {'key': 'containerRegistryCredentials', 'type': 'RegistryListCredentialsResult'}, - 'notebook_access_keys': {'key': 'notebookAccessKeys', 'type': 'ListNotebookKeysResult'}, + "user_storage_key": {"key": "userStorageKey", "type": "str"}, + "user_storage_resource_id": { + "key": "userStorageResourceId", + "type": "str", + }, + "app_insights_instrumentation_key": { + "key": "appInsightsInstrumentationKey", + "type": "str", + }, + "container_registry_credentials": { + "key": "containerRegistryCredentials", + "type": "RegistryListCredentialsResult", + }, + "notebook_access_keys": { + "key": "notebookAccessKeys", + "type": "ListNotebookKeysResult", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListWorkspaceKeysResult, self).__init__(**kwargs) self.user_storage_key = None self.user_storage_resource_id = None @@ -18090,21 +18587,17 @@ class ListWorkspaceQuotas(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[ResourceQuota]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[ResourceQuota]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListWorkspaceQuotas, self).__init__(**kwargs) self.value = None self.next_link = None @@ -18126,20 +18619,21 @@ class LiteralJobInput(JobInput): """ _validation = { - 'job_input_type': {'required': True}, - 'value': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "job_input_type": {"required": True}, + "value": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, + "value": {"key": "value", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: Description for the input. :paramtype description: str @@ -18147,8 +18641,8 @@ def __init__( :paramtype value: str """ super(LiteralJobInput, self).__init__(**kwargs) - self.job_input_type = 'literal' # type: str - self.value = kwargs['value'] + self.job_input_type = "literal" # type: str + self.value = kwargs["value"] class ManagedIdentity(IdentityConfiguration): @@ -18172,20 +18666,17 @@ class ManagedIdentity(IdentityConfiguration): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + "object_id": {"key": "objectId", "type": "str"}, + "resource_id": {"key": "resourceId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword client_id: Specifies a user-assigned identity by client ID. For system-assigned, do not set this field. @@ -18198,13 +18689,15 @@ def __init__( :paramtype resource_id: str """ super(ManagedIdentity, self).__init__(**kwargs) - self.identity_type = 'Managed' # type: str - self.client_id = kwargs.get('client_id', None) - self.object_id = kwargs.get('object_id', None) - self.resource_id = kwargs.get('resource_id', None) + self.identity_type = "Managed" # type: str + self.client_id = kwargs.get("client_id", None) + self.object_id = kwargs.get("object_id", None) + self.resource_id = kwargs.get("resource_id", None) -class ManagedIdentityAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class ManagedIdentityAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """ManagedIdentityAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -18231,23 +18724,23 @@ class ManagedIdentityAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPr """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionManagedIdentity'}, + "auth_type": {"key": "authType", "type": "str"}, + "expiry_time": {"key": "expiryTime", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionManagedIdentity", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword expiry_time: :paramtype expiry_time: str @@ -18266,9 +18759,11 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity """ - super(ManagedIdentityAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'ManagedIdentity' # type: str - self.credentials = kwargs.get('credentials', None) + super( + ManagedIdentityAuthTypeWorkspaceConnectionProperties, self + ).__init__(**kwargs) + self.auth_type = "ManagedIdentity" # type: str + self.credentials = kwargs.get("credentials", None) class ManagedNetworkProvisionOptions(msrest.serialization.Model): @@ -18279,19 +18774,16 @@ class ManagedNetworkProvisionOptions(msrest.serialization.Model): """ _attribute_map = { - 'include_spark': {'key': 'includeSpark', 'type': 'bool'}, + "include_spark": {"key": "includeSpark", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword include_spark: :paramtype include_spark: bool """ super(ManagedNetworkProvisionOptions, self).__init__(**kwargs) - self.include_spark = kwargs.get('include_spark', None) + self.include_spark = kwargs.get("include_spark", None) class ManagedNetworkProvisionStatus(msrest.serialization.Model): @@ -18305,14 +18797,11 @@ class ManagedNetworkProvisionStatus(msrest.serialization.Model): """ _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'spark_ready': {'key': 'sparkReady', 'type': 'bool'}, + "status": {"key": "status", "type": "str"}, + "spark_ready": {"key": "sparkReady", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword status: Status for the managed network of a machine learning workspace. Possible values include: "Inactive", "Active". @@ -18321,8 +18810,8 @@ def __init__( :paramtype spark_ready: bool """ super(ManagedNetworkProvisionStatus, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.spark_ready = kwargs.get('spark_ready', None) + self.status = kwargs.get("status", None) + self.spark_ready = kwargs.get("spark_ready", None) class ManagedNetworkSettings(msrest.serialization.Model): @@ -18343,20 +18832,17 @@ class ManagedNetworkSettings(msrest.serialization.Model): """ _validation = { - 'network_id': {'readonly': True}, + "network_id": {"readonly": True}, } _attribute_map = { - 'isolation_mode': {'key': 'isolationMode', 'type': 'str'}, - 'network_id': {'key': 'networkId', 'type': 'str'}, - 'outbound_rules': {'key': 'outboundRules', 'type': '{OutboundRule}'}, - 'status': {'key': 'status', 'type': 'ManagedNetworkProvisionStatus'}, + "isolation_mode": {"key": "isolationMode", "type": "str"}, + "network_id": {"key": "networkId", "type": "str"}, + "outbound_rules": {"key": "outboundRules", "type": "{OutboundRule}"}, + "status": {"key": "status", "type": "ManagedNetworkProvisionStatus"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword isolation_mode: Isolation mode for the managed network of a machine learning workspace. Possible values include: "Disabled", "AllowInternetOutbound", @@ -18369,10 +18855,10 @@ def __init__( :paramtype status: ~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionStatus """ super(ManagedNetworkSettings, self).__init__(**kwargs) - self.isolation_mode = kwargs.get('isolation_mode', None) + self.isolation_mode = kwargs.get("isolation_mode", None) self.network_id = None - self.outbound_rules = kwargs.get('outbound_rules', None) - self.status = kwargs.get('status', None) + self.outbound_rules = kwargs.get("outbound_rules", None) + self.status = kwargs.get("status", None) class ManagedOnlineDeployment(OnlineDeploymentProperties): @@ -18431,34 +18917,46 @@ class ManagedOnlineDeployment(OnlineDeploymentProperties): """ _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'data_collector': {'key': 'dataCollector', 'type': 'DataCollector'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - } - - def __init__( - self, - **kwargs - ): + "endpoint_compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, + "data_collector": {"key": "dataCollector", "type": "DataCollector"}, + "egress_public_network_access": { + "key": "egressPublicNetworkAccess", + "type": "str", + }, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, + "model": {"key": "model", "type": "str"}, + "model_mount_path": {"key": "modelMountPath", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, + } + + def __init__(self, **kwargs): """ :keyword code_configuration: Code configuration for the endpoint deployment. :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration @@ -18500,7 +18998,7 @@ def __init__( :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings """ super(ManagedOnlineDeployment, self).__init__(**kwargs) - self.endpoint_compute_type = 'Managed' # type: str + self.endpoint_compute_type = "Managed" # type: str class ManagedServiceIdentity(msrest.serialization.Model): @@ -18529,22 +19027,22 @@ class ManagedServiceIdentity(msrest.serialization.Model): """ _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, + "principal_id": {"readonly": True}, + "tenant_id": {"readonly": True}, + "type": {"required": True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{UserAssignedIdentity}", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword type: Required. Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", @@ -18560,8 +19058,10 @@ def __init__( super(ManagedServiceIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None - self.type = kwargs['type'] - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + self.type = kwargs["type"] + self.user_assigned_identities = kwargs.get( + "user_assigned_identities", None + ) class ManagedServiceIdentityAutoGenerated(msrest.serialization.Model): @@ -18590,22 +19090,22 @@ class ManagedServiceIdentityAutoGenerated(msrest.serialization.Model): """ _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, + "principal_id": {"readonly": True}, + "tenant_id": {"readonly": True}, + "type": {"required": True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{UserAssignedIdentity}", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword type: Required. Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", @@ -18621,8 +19121,10 @@ def __init__( super(ManagedServiceIdentityAutoGenerated, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None - self.type = kwargs['type'] - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + self.type = kwargs["type"] + self.user_assigned_identities = kwargs.get( + "user_assigned_identities", None + ) class MaterializationComputeResource(msrest.serialization.Model): @@ -18633,19 +19135,16 @@ class MaterializationComputeResource(msrest.serialization.Model): """ _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, + "instance_type": {"key": "instanceType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword instance_type: Specifies the instance type. :paramtype instance_type: str """ super(MaterializationComputeResource, self).__init__(**kwargs) - self.instance_type = kwargs.get('instance_type', None) + self.instance_type = kwargs.get("instance_type", None) class MaterializationSettings(msrest.serialization.Model): @@ -18665,17 +19164,17 @@ class MaterializationSettings(msrest.serialization.Model): """ _attribute_map = { - 'notification': {'key': 'notification', 'type': 'NotificationSetting'}, - 'resource': {'key': 'resource', 'type': 'MaterializationComputeResource'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceTrigger'}, - 'spark_configuration': {'key': 'sparkConfiguration', 'type': '{str}'}, - 'store_type': {'key': 'storeType', 'type': 'str'}, + "notification": {"key": "notification", "type": "NotificationSetting"}, + "resource": { + "key": "resource", + "type": "MaterializationComputeResource", + }, + "schedule": {"key": "schedule", "type": "RecurrenceTrigger"}, + "spark_configuration": {"key": "sparkConfiguration", "type": "{str}"}, + "store_type": {"key": "storeType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword notification: Specifies the notification details. :paramtype notification: ~azure.mgmt.machinelearningservices.models.NotificationSetting @@ -18691,11 +19190,11 @@ def __init__( ~azure.mgmt.machinelearningservices.models.MaterializationStoreType """ super(MaterializationSettings, self).__init__(**kwargs) - self.notification = kwargs.get('notification', None) - self.resource = kwargs.get('resource', None) - self.schedule = kwargs.get('schedule', None) - self.spark_configuration = kwargs.get('spark_configuration', None) - self.store_type = kwargs.get('store_type', None) + self.notification = kwargs.get("notification", None) + self.resource = kwargs.get("resource", None) + self.schedule = kwargs.get("schedule", None) + self.spark_configuration = kwargs.get("spark_configuration", None) + self.store_type = kwargs.get("store_type", None) class MedianStoppingPolicy(EarlyTerminationPolicy): @@ -18714,19 +19213,16 @@ class MedianStoppingPolicy(EarlyTerminationPolicy): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. :paramtype delay_evaluation: int @@ -18734,7 +19230,7 @@ def __init__( :paramtype evaluation_interval: int """ super(MedianStoppingPolicy, self).__init__(**kwargs) - self.policy_type = 'MedianStopping' # type: str + self.policy_type = "MedianStopping" # type: str class MLAssistConfiguration(msrest.serialization.Model): @@ -18751,23 +19247,22 @@ class MLAssistConfiguration(msrest.serialization.Model): """ _validation = { - 'ml_assist': {'required': True}, + "ml_assist": {"required": True}, } _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, + "ml_assist": {"key": "mlAssist", "type": "str"}, } _subtype_map = { - 'ml_assist': {'Disabled': 'MLAssistConfigurationDisabled', 'Enabled': 'MLAssistConfigurationEnabled'} + "ml_assist": { + "Disabled": "MLAssistConfigurationDisabled", + "Enabled": "MLAssistConfigurationEnabled", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(MLAssistConfiguration, self).__init__(**kwargs) self.ml_assist = None # type: Optional[str] @@ -18783,21 +19278,17 @@ class MLAssistConfigurationDisabled(MLAssistConfiguration): """ _validation = { - 'ml_assist': {'required': True}, + "ml_assist": {"required": True}, } _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, + "ml_assist": {"key": "mlAssist", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(MLAssistConfigurationDisabled, self).__init__(**kwargs) - self.ml_assist = 'Disabled' # type: str + self.ml_assist = "Disabled" # type: str class MLAssistConfigurationEnabled(MLAssistConfiguration): @@ -18816,21 +19307,32 @@ class MLAssistConfigurationEnabled(MLAssistConfiguration): """ _validation = { - 'ml_assist': {'required': True}, - 'inferencing_compute_binding': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'training_compute_binding': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "ml_assist": {"required": True}, + "inferencing_compute_binding": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "training_compute_binding": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - 'inferencing_compute_binding': {'key': 'inferencingComputeBinding', 'type': 'str'}, - 'training_compute_binding': {'key': 'trainingComputeBinding', 'type': 'str'}, + "ml_assist": {"key": "mlAssist", "type": "str"}, + "inferencing_compute_binding": { + "key": "inferencingComputeBinding", + "type": "str", + }, + "training_compute_binding": { + "key": "trainingComputeBinding", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword inferencing_compute_binding: Required. [Required] AML compute binding used in inferencing. @@ -18839,9 +19341,11 @@ def __init__( :paramtype training_compute_binding: str """ super(MLAssistConfigurationEnabled, self).__init__(**kwargs) - self.ml_assist = 'Enabled' # type: str - self.inferencing_compute_binding = kwargs['inferencing_compute_binding'] - self.training_compute_binding = kwargs['training_compute_binding'] + self.ml_assist = "Enabled" # type: str + self.inferencing_compute_binding = kwargs[ + "inferencing_compute_binding" + ] + self.training_compute_binding = kwargs["training_compute_binding"] class MLFlowModelJobInput(JobInput, AssetJobInput): @@ -18863,21 +19367,18 @@ class MLFlowModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "min_length": 1, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -18888,10 +19389,10 @@ def __init__( :paramtype description: str """ super(MLFlowModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'mlflow_model' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "mlflow_model" # type: str + self.description = kwargs.get("description", None) class MLFlowModelJobOutput(JobOutput, AssetJobOutput): @@ -18919,23 +19420,23 @@ class MLFlowModelJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "asset_name": {"key": "assetName", "type": "str"}, + "asset_version": {"key": "assetVersion", "type": "str"}, + "auto_delete_setting": { + "key": "autoDeleteSetting", + "type": "AutoDeleteSetting", + }, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword asset_name: Output Asset Name. :paramtype asset_name: str @@ -18952,13 +19453,13 @@ def __init__( :paramtype description: str """ super(MLFlowModelJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.asset_version = kwargs.get('asset_version', None) - self.auto_delete_setting = kwargs.get('auto_delete_setting', None) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'mlflow_model' # type: str - self.description = kwargs.get('description', None) + self.asset_name = kwargs.get("asset_name", None) + self.asset_version = kwargs.get("asset_version", None) + self.auto_delete_setting = kwargs.get("auto_delete_setting", None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "mlflow_model" # type: str + self.description = kwargs.get("description", None) class MLTableData(DataVersionBaseProperties): @@ -18996,28 +19497,35 @@ class MLTableData(DataVersionBaseProperties): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - 'referenced_uris': {'key': 'referencedUris', 'type': '[str]'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "auto_delete_setting": { + "key": "autoDeleteSetting", + "type": "AutoDeleteSetting", + }, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, + "intellectual_property": { + "key": "intellectualProperty", + "type": "IntellectualProperty", + }, + "stage": {"key": "stage", "type": "str"}, + "referenced_uris": {"key": "referencedUris", "type": "[str]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -19046,8 +19554,8 @@ def __init__( :paramtype referenced_uris: list[str] """ super(MLTableData, self).__init__(**kwargs) - self.data_type = 'mltable' # type: str - self.referenced_uris = kwargs.get('referenced_uris', None) + self.data_type = "mltable" # type: str + self.referenced_uris = kwargs.get("referenced_uris", None) class MLTableJobInput(JobInput, AssetJobInput): @@ -19069,21 +19577,18 @@ class MLTableJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "min_length": 1, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -19094,10 +19599,10 @@ def __init__( :paramtype description: str """ super(MLTableJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'mltable' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "mltable" # type: str + self.description = kwargs.get("description", None) class MLTableJobOutput(JobOutput, AssetJobOutput): @@ -19125,23 +19630,23 @@ class MLTableJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "asset_name": {"key": "assetName", "type": "str"}, + "asset_version": {"key": "assetVersion", "type": "str"}, + "auto_delete_setting": { + "key": "autoDeleteSetting", + "type": "AutoDeleteSetting", + }, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword asset_name: Output Asset Name. :paramtype asset_name: str @@ -19158,13 +19663,13 @@ def __init__( :paramtype description: str """ super(MLTableJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.asset_version = kwargs.get('asset_version', None) - self.auto_delete_setting = kwargs.get('auto_delete_setting', None) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'mltable' # type: str - self.description = kwargs.get('description', None) + self.asset_name = kwargs.get("asset_name", None) + self.asset_version = kwargs.get("asset_version", None) + self.auto_delete_setting = kwargs.get("auto_delete_setting", None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "mltable" # type: str + self.description = kwargs.get("description", None) class ModelConfiguration(msrest.serialization.Model): @@ -19178,14 +19683,11 @@ class ModelConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "mount_path": {"key": "mountPath", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input delivery mode for the model. Possible values include: "ReadOnlyMount", "Download". @@ -19194,8 +19696,8 @@ def __init__( :paramtype mount_path: str """ super(ModelConfiguration, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.mount_path = kwargs.get('mount_path', None) + self.mode = kwargs.get("mode", None) + self.mount_path = kwargs.get("mount_path", None) class ModelContainer(Resource): @@ -19221,31 +19723,31 @@ class ModelContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "ModelContainerProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelContainerProperties """ super(ModelContainer, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class ModelContainerProperties(AssetContainer): @@ -19272,25 +19774,22 @@ class ModelContainerProperties(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -19316,14 +19815,11 @@ class ModelContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ModelContainer]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of ModelContainer objects. If null, there are no additional pages. @@ -19331,9 +19827,11 @@ def __init__( :keyword value: An array of objects of type ModelContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelContainer] """ - super(ModelContainerResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(ModelContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class ModelPackageInput(msrest.serialization.Model): @@ -19354,21 +19852,18 @@ class ModelPackageInput(msrest.serialization.Model): """ _validation = { - 'input_type': {'required': True}, - 'path': {'required': True}, + "input_type": {"required": True}, + "path": {"required": True}, } _attribute_map = { - 'input_type': {'key': 'inputType', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'PackageInputPathBase'}, + "input_type": {"key": "inputType", "type": "str"}, + "mode": {"key": "mode", "type": "str"}, + "mount_path": {"key": "mountPath", "type": "str"}, + "path": {"key": "path", "type": "PackageInputPathBase"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword input_type: Required. [Required] Type of the input included in the target image. Possible values include: "UriFile", "UriFolder". @@ -19382,10 +19877,10 @@ def __init__( :paramtype path: ~azure.mgmt.machinelearningservices.models.PackageInputPathBase """ super(ModelPackageInput, self).__init__(**kwargs) - self.input_type = kwargs['input_type'] - self.mode = kwargs.get('mode', None) - self.mount_path = kwargs.get('mount_path', None) - self.path = kwargs['path'] + self.input_type = kwargs["input_type"] + self.mode = kwargs.get("mode", None) + self.mount_path = kwargs.get("mount_path", None) + self.path = kwargs["path"] class ModelPerformanceSignalBase(MonitoringSignalBase): @@ -19417,26 +19912,32 @@ class ModelPerformanceSignalBase(MonitoringSignalBase): """ _validation = { - 'signal_type': {'required': True}, - 'baseline_data': {'required': True}, - 'metric_threshold': {'required': True}, - 'target_data': {'required': True}, + "signal_type": {"required": True}, + "baseline_data": {"required": True}, + "metric_threshold": {"required": True}, + "target_data": {"required": True}, } _attribute_map = { - 'lookback_period': {'key': 'lookbackPeriod', 'type': 'duration'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'baseline_data': {'key': 'baselineData', 'type': 'MonitoringInputData'}, - 'data_segment': {'key': 'dataSegment', 'type': 'MonitoringDataSegment'}, - 'metric_threshold': {'key': 'metricThreshold', 'type': 'ModelPerformanceMetricThresholdBase'}, - 'target_data': {'key': 'targetData', 'type': 'MonitoringInputData'}, + "lookback_period": {"key": "lookbackPeriod", "type": "duration"}, + "mode": {"key": "mode", "type": "str"}, + "signal_type": {"key": "signalType", "type": "str"}, + "baseline_data": { + "key": "baselineData", + "type": "MonitoringInputData", + }, + "data_segment": { + "key": "dataSegment", + "type": "MonitoringDataSegment", + }, + "metric_threshold": { + "key": "metricThreshold", + "type": "ModelPerformanceMetricThresholdBase", + }, + "target_data": {"key": "targetData", "type": "MonitoringInputData"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword lookback_period: The amount of time a single monitor should look back over the target data on a given run. @@ -19457,11 +19958,11 @@ def __init__( :paramtype target_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData """ super(ModelPerformanceSignalBase, self).__init__(**kwargs) - self.signal_type = 'ModelPerformanceSignalBase' # type: str - self.baseline_data = kwargs['baseline_data'] - self.data_segment = kwargs.get('data_segment', None) - self.metric_threshold = kwargs['metric_threshold'] - self.target_data = kwargs['target_data'] + self.signal_type = "ModelPerformanceSignalBase" # type: str + self.baseline_data = kwargs["baseline_data"] + self.data_segment = kwargs.get("data_segment", None) + self.metric_threshold = kwargs["metric_threshold"] + self.target_data = kwargs["target_data"] class ModelVersion(Resource): @@ -19487,31 +19988,28 @@ class ModelVersion(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelVersionProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "ModelVersionProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelVersionProperties """ super(ModelVersion, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class ModelVersionProperties(AssetBase): @@ -19553,29 +20051,32 @@ class ModelVersionProperties(AssetBase): """ _validation = { - 'provisioning_state': {'readonly': True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'flavors': {'key': 'flavors', 'type': '{FlavorData}'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'job_name': {'key': 'jobName', 'type': 'str'}, - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'model_uri': {'key': 'modelUri', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "auto_delete_setting": { + "key": "autoDeleteSetting", + "type": "AutoDeleteSetting", + }, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "flavors": {"key": "flavors", "type": "{FlavorData}"}, + "intellectual_property": { + "key": "intellectualProperty", + "type": "IntellectualProperty", + }, + "job_name": {"key": "jobName", "type": "str"}, + "model_type": {"key": "modelType", "type": "str"}, + "model_uri": {"key": "modelUri", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "stage": {"key": "stage", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -19607,13 +20108,13 @@ def __init__( :paramtype stage: str """ super(ModelVersionProperties, self).__init__(**kwargs) - self.flavors = kwargs.get('flavors', None) - self.intellectual_property = kwargs.get('intellectual_property', None) - self.job_name = kwargs.get('job_name', None) - self.model_type = kwargs.get('model_type', None) - self.model_uri = kwargs.get('model_uri', None) + self.flavors = kwargs.get("flavors", None) + self.intellectual_property = kwargs.get("intellectual_property", None) + self.job_name = kwargs.get("job_name", None) + self.model_type = kwargs.get("model_type", None) + self.model_uri = kwargs.get("model_uri", None) self.provisioning_state = None - self.stage = kwargs.get('stage', None) + self.stage = kwargs.get("stage", None) class ModelVersionResourceArmPaginatedResult(msrest.serialization.Model): @@ -19627,14 +20128,11 @@ class ModelVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelVersion]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ModelVersion]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of ModelVersion objects. If null, there are no additional pages. @@ -19643,8 +20141,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelVersion] """ super(ModelVersionResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class MonitorDefinition(msrest.serialization.Model): @@ -19666,21 +20164,25 @@ class MonitorDefinition(msrest.serialization.Model): """ _validation = { - 'compute_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'signals': {'required': True}, + "compute_id": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "signals": {"required": True}, } _attribute_map = { - 'alert_notification_setting': {'key': 'alertNotificationSetting', 'type': 'MonitoringAlertNotificationSettingsBase'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'monitoring_target': {'key': 'monitoringTarget', 'type': 'str'}, - 'signals': {'key': 'signals', 'type': '{MonitoringSignalBase}'}, + "alert_notification_setting": { + "key": "alertNotificationSetting", + "type": "MonitoringAlertNotificationSettingsBase", + }, + "compute_id": {"key": "computeId", "type": "str"}, + "monitoring_target": {"key": "monitoringTarget", "type": "str"}, + "signals": {"key": "signals", "type": "{MonitoringSignalBase}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword alert_notification_setting: The monitor's notification settings. :paramtype alert_notification_setting: @@ -19695,10 +20197,12 @@ def __init__( :paramtype signals: dict[str, ~azure.mgmt.machinelearningservices.models.MonitoringSignalBase] """ super(MonitorDefinition, self).__init__(**kwargs) - self.alert_notification_setting = kwargs.get('alert_notification_setting', None) - self.compute_id = kwargs['compute_id'] - self.monitoring_target = kwargs.get('monitoring_target', None) - self.signals = kwargs['signals'] + self.alert_notification_setting = kwargs.get( + "alert_notification_setting", None + ) + self.compute_id = kwargs["compute_id"] + self.monitoring_target = kwargs.get("monitoring_target", None) + self.signals = kwargs["signals"] class MonitoringDataSegment(msrest.serialization.Model): @@ -19711,14 +20215,11 @@ class MonitoringDataSegment(msrest.serialization.Model): """ _attribute_map = { - 'feature': {'key': 'feature', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[str]'}, + "feature": {"key": "feature", "type": "str"}, + "values": {"key": "values", "type": "[str]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword feature: The feature to segment the data on. :paramtype feature: str @@ -19726,8 +20227,8 @@ def __init__( :paramtype values: list[str] """ super(MonitoringDataSegment, self).__init__(**kwargs) - self.feature = kwargs.get('feature', None) - self.values = kwargs.get('values', None) + self.feature = kwargs.get("feature", None) + self.values = kwargs.get("values", None) class MonitoringInputData(msrest.serialization.Model): @@ -19749,20 +20250,20 @@ class MonitoringInputData(msrest.serialization.Model): """ _validation = { - 'data_context': {'required': True}, + "data_context": {"required": True}, } _attribute_map = { - 'asset': {'key': 'asset', 'type': 'object'}, - 'data_context': {'key': 'dataContext', 'type': 'str'}, - 'preprocessing_component_id': {'key': 'preprocessingComponentId', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, + "asset": {"key": "asset", "type": "object"}, + "data_context": {"key": "dataContext", "type": "str"}, + "preprocessing_component_id": { + "key": "preprocessingComponentId", + "type": "str", + }, + "target_column_name": {"key": "targetColumnName", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword asset: The data asset input to be leveraged by the monitoring job.. :paramtype asset: any @@ -19777,10 +20278,12 @@ def __init__( :paramtype target_column_name: str """ super(MonitoringInputData, self).__init__(**kwargs) - self.asset = kwargs.get('asset', None) - self.data_context = kwargs['data_context'] - self.preprocessing_component_id = kwargs.get('preprocessing_component_id', None) - self.target_column_name = kwargs.get('target_column_name', None) + self.asset = kwargs.get("asset", None) + self.data_context = kwargs["data_context"] + self.preprocessing_component_id = kwargs.get( + "preprocessing_component_id", None + ) + self.target_column_name = kwargs.get("target_column_name", None) class MonitoringThreshold(msrest.serialization.Model): @@ -19791,19 +20294,16 @@ class MonitoringThreshold(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': 'float'}, + "value": {"key": "value", "type": "float"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: The threshold value. If null, the set default is dependent on the metric type. :paramtype value: float """ super(MonitoringThreshold, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class Mpi(DistributionConfiguration): @@ -19820,25 +20320,27 @@ class Mpi(DistributionConfiguration): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, + "distribution_type": {"key": "distributionType", "type": "str"}, + "process_count_per_instance": { + "key": "processCountPerInstance", + "type": "int", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword process_count_per_instance: Number of processes per MPI node. :paramtype process_count_per_instance: int """ super(Mpi, self).__init__(**kwargs) - self.distribution_type = 'Mpi' # type: str - self.process_count_per_instance = kwargs.get('process_count_per_instance', None) + self.distribution_type = "Mpi" # type: str + self.process_count_per_instance = kwargs.get( + "process_count_per_instance", None + ) class NlpFixedParameters(msrest.serialization.Model): @@ -19869,21 +20371,24 @@ class NlpFixedParameters(msrest.serialization.Model): """ _attribute_map = { - 'gradient_accumulation_steps': {'key': 'gradientAccumulationSteps', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_ratio': {'key': 'warmupRatio', 'type': 'float'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, + "gradient_accumulation_steps": { + "key": "gradientAccumulationSteps", + "type": "int", + }, + "learning_rate": {"key": "learningRate", "type": "float"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "int"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, + "warmup_ratio": {"key": "warmupRatio", "type": "float"}, + "weight_decay": {"key": "weightDecay", "type": "float"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword gradient_accumulation_steps: Number of steps to accumulate gradients over before running a backward pass. @@ -19909,15 +20414,19 @@ def __init__( :paramtype weight_decay: float """ super(NlpFixedParameters, self).__init__(**kwargs) - self.gradient_accumulation_steps = kwargs.get('gradient_accumulation_steps', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.learning_rate_scheduler = kwargs.get('learning_rate_scheduler', None) - self.model_name = kwargs.get('model_name', None) - self.number_of_epochs = kwargs.get('number_of_epochs', None) - self.training_batch_size = kwargs.get('training_batch_size', None) - self.validation_batch_size = kwargs.get('validation_batch_size', None) - self.warmup_ratio = kwargs.get('warmup_ratio', None) - self.weight_decay = kwargs.get('weight_decay', None) + self.gradient_accumulation_steps = kwargs.get( + "gradient_accumulation_steps", None + ) + self.learning_rate = kwargs.get("learning_rate", None) + self.learning_rate_scheduler = kwargs.get( + "learning_rate_scheduler", None + ) + self.model_name = kwargs.get("model_name", None) + self.number_of_epochs = kwargs.get("number_of_epochs", None) + self.training_batch_size = kwargs.get("training_batch_size", None) + self.validation_batch_size = kwargs.get("validation_batch_size", None) + self.warmup_ratio = kwargs.get("warmup_ratio", None) + self.weight_decay = kwargs.get("weight_decay", None) class NlpParameterSubspace(msrest.serialization.Model): @@ -19946,21 +20455,24 @@ class NlpParameterSubspace(msrest.serialization.Model): """ _attribute_map = { - 'gradient_accumulation_steps': {'key': 'gradientAccumulationSteps', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_ratio': {'key': 'warmupRatio', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, + "gradient_accumulation_steps": { + "key": "gradientAccumulationSteps", + "type": "str", + }, + "learning_rate": {"key": "learningRate", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "str"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, + "warmup_ratio": {"key": "warmupRatio", "type": "str"}, + "weight_decay": {"key": "weightDecay", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword gradient_accumulation_steps: Number of steps to accumulate gradients over before running a backward pass. @@ -19984,15 +20496,19 @@ def __init__( :paramtype weight_decay: str """ super(NlpParameterSubspace, self).__init__(**kwargs) - self.gradient_accumulation_steps = kwargs.get('gradient_accumulation_steps', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.learning_rate_scheduler = kwargs.get('learning_rate_scheduler', None) - self.model_name = kwargs.get('model_name', None) - self.number_of_epochs = kwargs.get('number_of_epochs', None) - self.training_batch_size = kwargs.get('training_batch_size', None) - self.validation_batch_size = kwargs.get('validation_batch_size', None) - self.warmup_ratio = kwargs.get('warmup_ratio', None) - self.weight_decay = kwargs.get('weight_decay', None) + self.gradient_accumulation_steps = kwargs.get( + "gradient_accumulation_steps", None + ) + self.learning_rate = kwargs.get("learning_rate", None) + self.learning_rate_scheduler = kwargs.get( + "learning_rate_scheduler", None + ) + self.model_name = kwargs.get("model_name", None) + self.number_of_epochs = kwargs.get("number_of_epochs", None) + self.training_batch_size = kwargs.get("training_batch_size", None) + self.validation_batch_size = kwargs.get("validation_batch_size", None) + self.warmup_ratio = kwargs.get("warmup_ratio", None) + self.weight_decay = kwargs.get("weight_decay", None) class NlpSweepSettings(msrest.serialization.Model): @@ -20009,18 +20525,18 @@ class NlpSweepSettings(msrest.serialization.Model): """ _validation = { - 'sampling_algorithm': {'required': True}, + "sampling_algorithm": {"required": True}, } _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, + "sampling_algorithm": {"key": "samplingAlgorithm", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword early_termination: Type of early termination policy for the sweeping job. :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy @@ -20030,44 +20546,56 @@ def __init__( ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType """ super(NlpSweepSettings, self).__init__(**kwargs) - self.early_termination = kwargs.get('early_termination', None) - self.sampling_algorithm = kwargs['sampling_algorithm'] + self.early_termination = kwargs.get("early_termination", None) + self.sampling_algorithm = kwargs["sampling_algorithm"] class NlpVertical(msrest.serialization.Model): """Abstract class for NLP related AutoML tasks. -NLP - Natural Language Processing. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ + NLP - Natural Language Processing. - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - } - - def __init__( - self, - **kwargs - ): + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar fixed_parameters: Model/training parameters that will remain constant throughout + training. + :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] + :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + """ + + _attribute_map = { + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "NlpFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "search_space": { + "key": "searchSpace", + "type": "[NlpParameterSubspace]", + }, + "sweep_settings": {"key": "sweepSettings", "type": "NlpSweepSettings"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + } + + def __init__(self, **kwargs): """ :keyword featurization_settings: Featurization inputs needed for AutoML job. :paramtype featurization_settings: @@ -20086,12 +20614,14 @@ def __init__( :paramtype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ super(NlpVertical, self).__init__(**kwargs) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.fixed_parameters = kwargs.get("fixed_parameters", None) + self.limit_settings = kwargs.get("limit_settings", None) + self.search_space = kwargs.get("search_space", None) + self.sweep_settings = kwargs.get("sweep_settings", None) + self.validation_data = kwargs.get("validation_data", None) class NlpVerticalFeaturizationSettings(FeaturizationSettings): @@ -20102,13 +20632,10 @@ class NlpVerticalFeaturizationSettings(FeaturizationSettings): """ _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, + "dataset_language": {"key": "datasetLanguage", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword dataset_language: Dataset language, useful for the text data. :paramtype dataset_language: str @@ -20132,17 +20659,14 @@ class NlpVerticalLimitSettings(msrest.serialization.Model): """ _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_nodes': {'key': 'maxNodes', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_nodes": {"key": "maxNodes", "type": "int"}, + "max_trials": {"key": "maxTrials", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, + "trial_timeout": {"key": "trialTimeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword max_concurrent_trials: Maximum Concurrent AutoML iterations. :paramtype max_concurrent_trials: int @@ -20156,11 +20680,11 @@ def __init__( :paramtype trial_timeout: ~datetime.timedelta """ super(NlpVerticalLimitSettings, self).__init__(**kwargs) - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', 1) - self.max_nodes = kwargs.get('max_nodes', 1) - self.max_trials = kwargs.get('max_trials', 1) - self.timeout = kwargs.get('timeout', "P7D") - self.trial_timeout = kwargs.get('trial_timeout', None) + self.max_concurrent_trials = kwargs.get("max_concurrent_trials", 1) + self.max_nodes = kwargs.get("max_nodes", 1) + self.max_trials = kwargs.get("max_trials", 1) + self.timeout = kwargs.get("timeout", "P7D") + self.trial_timeout = kwargs.get("trial_timeout", None) class NodeStateCounts(msrest.serialization.Model): @@ -20183,29 +20707,25 @@ class NodeStateCounts(msrest.serialization.Model): """ _validation = { - 'idle_node_count': {'readonly': True}, - 'running_node_count': {'readonly': True}, - 'preparing_node_count': {'readonly': True}, - 'unusable_node_count': {'readonly': True}, - 'leaving_node_count': {'readonly': True}, - 'preempted_node_count': {'readonly': True}, + "idle_node_count": {"readonly": True}, + "running_node_count": {"readonly": True}, + "preparing_node_count": {"readonly": True}, + "unusable_node_count": {"readonly": True}, + "leaving_node_count": {"readonly": True}, + "preempted_node_count": {"readonly": True}, } _attribute_map = { - 'idle_node_count': {'key': 'idleNodeCount', 'type': 'int'}, - 'running_node_count': {'key': 'runningNodeCount', 'type': 'int'}, - 'preparing_node_count': {'key': 'preparingNodeCount', 'type': 'int'}, - 'unusable_node_count': {'key': 'unusableNodeCount', 'type': 'int'}, - 'leaving_node_count': {'key': 'leavingNodeCount', 'type': 'int'}, - 'preempted_node_count': {'key': 'preemptedNodeCount', 'type': 'int'}, + "idle_node_count": {"key": "idleNodeCount", "type": "int"}, + "running_node_count": {"key": "runningNodeCount", "type": "int"}, + "preparing_node_count": {"key": "preparingNodeCount", "type": "int"}, + "unusable_node_count": {"key": "unusableNodeCount", "type": "int"}, + "leaving_node_count": {"key": "leavingNodeCount", "type": "int"}, + "preempted_node_count": {"key": "preemptedNodeCount", "type": "int"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NodeStateCounts, self).__init__(**kwargs) self.idle_node_count = None self.running_node_count = None @@ -20215,7 +20735,9 @@ def __init__( self.preempted_node_count = None -class NoneAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class NoneAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """NoneAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -20239,22 +20761,19 @@ class NoneAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2) """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, + "auth_type": {"key": "authType", "type": "str"}, + "expiry_time": {"key": "expiryTime", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword expiry_time: :paramtype expiry_time: str @@ -20270,8 +20789,10 @@ def __init__( "JSON". :paramtype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat """ - super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'None' # type: str + super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__( + **kwargs + ) + self.auth_type = "None" # type: str class NoneDatastoreCredentials(DatastoreCredentials): @@ -20286,21 +20807,17 @@ class NoneDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, + "credentials_type": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NoneDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'None' # type: str + self.credentials_type = "None" # type: str class NotebookAccessTokenResult(msrest.serialization.Model): @@ -20327,33 +20844,29 @@ class NotebookAccessTokenResult(msrest.serialization.Model): """ _validation = { - 'notebook_resource_id': {'readonly': True}, - 'host_name': {'readonly': True}, - 'public_dns': {'readonly': True}, - 'access_token': {'readonly': True}, - 'token_type': {'readonly': True}, - 'expires_in': {'readonly': True}, - 'refresh_token': {'readonly': True}, - 'scope': {'readonly': True}, + "notebook_resource_id": {"readonly": True}, + "host_name": {"readonly": True}, + "public_dns": {"readonly": True}, + "access_token": {"readonly": True}, + "token_type": {"readonly": True}, + "expires_in": {"readonly": True}, + "refresh_token": {"readonly": True}, + "scope": {"readonly": True}, } _attribute_map = { - 'notebook_resource_id': {'key': 'notebookResourceId', 'type': 'str'}, - 'host_name': {'key': 'hostName', 'type': 'str'}, - 'public_dns': {'key': 'publicDns', 'type': 'str'}, - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, - 'expires_in': {'key': 'expiresIn', 'type': 'int'}, - 'refresh_token': {'key': 'refreshToken', 'type': 'str'}, - 'scope': {'key': 'scope', 'type': 'str'}, + "notebook_resource_id": {"key": "notebookResourceId", "type": "str"}, + "host_name": {"key": "hostName", "type": "str"}, + "public_dns": {"key": "publicDns", "type": "str"}, + "access_token": {"key": "accessToken", "type": "str"}, + "token_type": {"key": "tokenType", "type": "str"}, + "expires_in": {"key": "expiresIn", "type": "int"}, + "refresh_token": {"key": "refreshToken", "type": "str"}, + "scope": {"key": "scope", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NotebookAccessTokenResult, self).__init__(**kwargs) self.notebook_resource_id = None self.host_name = None @@ -20375,14 +20888,11 @@ class NotebookPreparationError(msrest.serialization.Model): """ _attribute_map = { - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'status_code': {'key': 'statusCode', 'type': 'int'}, + "error_message": {"key": "errorMessage", "type": "str"}, + "status_code": {"key": "statusCode", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword error_message: :paramtype error_message: str @@ -20390,8 +20900,8 @@ def __init__( :paramtype status_code: int """ super(NotebookPreparationError, self).__init__(**kwargs) - self.error_message = kwargs.get('error_message', None) - self.status_code = kwargs.get('status_code', None) + self.error_message = kwargs.get("error_message", None) + self.status_code = kwargs.get("status_code", None) class NotebookResourceInfo(msrest.serialization.Model): @@ -20407,15 +20917,15 @@ class NotebookResourceInfo(msrest.serialization.Model): """ _attribute_map = { - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'notebook_preparation_error': {'key': 'notebookPreparationError', 'type': 'NotebookPreparationError'}, + "fqdn": {"key": "fqdn", "type": "str"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "notebook_preparation_error": { + "key": "notebookPreparationError", + "type": "NotebookPreparationError", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword fqdn: :paramtype fqdn: str @@ -20426,9 +20936,11 @@ def __init__( ~azure.mgmt.machinelearningservices.models.NotebookPreparationError """ super(NotebookResourceInfo, self).__init__(**kwargs) - self.fqdn = kwargs.get('fqdn', None) - self.resource_id = kwargs.get('resource_id', None) - self.notebook_preparation_error = kwargs.get('notebook_preparation_error', None) + self.fqdn = kwargs.get("fqdn", None) + self.resource_id = kwargs.get("resource_id", None) + self.notebook_preparation_error = kwargs.get( + "notebook_preparation_error", None + ) class NotificationSetting(msrest.serialization.Model): @@ -20446,15 +20958,12 @@ class NotificationSetting(msrest.serialization.Model): """ _attribute_map = { - 'email_on': {'key': 'emailOn', 'type': '[str]'}, - 'emails': {'key': 'emails', 'type': '[str]'}, - 'webhooks': {'key': 'webhooks', 'type': '{Webhook}'}, + "email_on": {"key": "emailOn", "type": "[str]"}, + "emails": {"key": "emails", "type": "[str]"}, + "webhooks": {"key": "webhooks", "type": "{Webhook}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword email_on: Send email notification to user on specified notification type. :paramtype email_on: list[str or @@ -20467,9 +20976,9 @@ def __init__( :paramtype webhooks: dict[str, ~azure.mgmt.machinelearningservices.models.Webhook] """ super(NotificationSetting, self).__init__(**kwargs) - self.email_on = kwargs.get('email_on', None) - self.emails = kwargs.get('emails', None) - self.webhooks = kwargs.get('webhooks', None) + self.email_on = kwargs.get("email_on", None) + self.emails = kwargs.get("emails", None) + self.webhooks = kwargs.get("webhooks", None) class NumericalDataDriftMetricThreshold(DataDriftMetricThresholdBase): @@ -20490,20 +20999,17 @@ class NumericalDataDriftMetricThreshold(DataDriftMetricThresholdBase): """ _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, + "data_type": {"required": True}, + "metric": {"required": True}, } _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, + "data_type": {"key": "dataType", "type": "str"}, + "threshold": {"key": "threshold", "type": "MonitoringThreshold"}, + "metric": {"key": "metric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword threshold: The threshold value. If null, a default value will be set depending on the selected metric. @@ -20514,8 +21020,8 @@ def __init__( :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataDriftMetric """ super(NumericalDataDriftMetricThreshold, self).__init__(**kwargs) - self.data_type = 'Numerical' # type: str - self.metric = kwargs['metric'] + self.data_type = "Numerical" # type: str + self.metric = kwargs["metric"] class NumericalDataQualityMetricThreshold(DataQualityMetricThresholdBase): @@ -20535,20 +21041,17 @@ class NumericalDataQualityMetricThreshold(DataQualityMetricThresholdBase): """ _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, + "data_type": {"required": True}, + "metric": {"required": True}, } _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, + "data_type": {"key": "dataType", "type": "str"}, + "threshold": {"key": "threshold", "type": "MonitoringThreshold"}, + "metric": {"key": "metric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword threshold: The threshold value. If null, a default value will be set depending on the selected metric. @@ -20558,11 +21061,13 @@ def __init__( :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataQualityMetric """ super(NumericalDataQualityMetricThreshold, self).__init__(**kwargs) - self.data_type = 'Numerical' # type: str - self.metric = kwargs['metric'] + self.data_type = "Numerical" # type: str + self.metric = kwargs["metric"] -class NumericalPredictionDriftMetricThreshold(PredictionDriftMetricThresholdBase): +class NumericalPredictionDriftMetricThreshold( + PredictionDriftMetricThresholdBase +): """NumericalPredictionDriftMetricThreshold. All required parameters must be populated in order to send to Azure. @@ -20581,20 +21086,17 @@ class NumericalPredictionDriftMetricThreshold(PredictionDriftMetricThresholdBase """ _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, + "data_type": {"required": True}, + "metric": {"required": True}, } _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, + "data_type": {"key": "dataType", "type": "str"}, + "threshold": {"key": "threshold", "type": "MonitoringThreshold"}, + "metric": {"key": "metric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword threshold: The threshold value. If null, a default value will be set depending on the selected metric. @@ -20606,8 +21108,8 @@ def __init__( ~azure.mgmt.machinelearningservices.models.NumericalPredictionDriftMetric """ super(NumericalPredictionDriftMetricThreshold, self).__init__(**kwargs) - self.data_type = 'Numerical' # type: str - self.metric = kwargs['metric'] + self.data_type = "Numerical" # type: str + self.metric = kwargs["metric"] class Objective(msrest.serialization.Model): @@ -20623,19 +21125,20 @@ class Objective(msrest.serialization.Model): """ _validation = { - 'goal': {'required': True}, - 'primary_metric': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "goal": {"required": True}, + "primary_metric": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'goal': {'key': 'goal', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "goal": {"key": "goal", "type": "str"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword goal: Required. [Required] Defines supported metric goals for hyperparameter tuning. Possible values include: "Minimize", "Maximize". @@ -20644,8 +21147,8 @@ def __init__( :paramtype primary_metric: str """ super(Objective, self).__init__(**kwargs) - self.goal = kwargs['goal'] - self.primary_metric = kwargs['primary_metric'] + self.goal = kwargs["goal"] + self.primary_metric = kwargs["primary_metric"] class OneLakeDatastore(DatastoreProperties): @@ -20686,31 +21189,41 @@ class OneLakeDatastore(DatastoreProperties): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'artifact': {'required': True}, - 'one_lake_workspace_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "artifact": {"required": True}, + "one_lake_workspace_name": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'artifact': {'key': 'artifact', 'type': 'OneLakeArtifact'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'one_lake_workspace_name': {'key': 'oneLakeWorkspaceName', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "intellectual_property": { + "key": "intellectualProperty", + "type": "IntellectualProperty", + }, + "is_default": {"key": "isDefault", "type": "bool"}, + "artifact": {"key": "artifact", "type": "OneLakeArtifact"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "one_lake_workspace_name": { + "key": "oneLakeWorkspaceName", + "type": "str", + }, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -20736,11 +21249,13 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ super(OneLakeDatastore, self).__init__(**kwargs) - self.datastore_type = 'OneLake' # type: str - self.artifact = kwargs['artifact'] - self.endpoint = kwargs.get('endpoint', None) - self.one_lake_workspace_name = kwargs['one_lake_workspace_name'] - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) + self.datastore_type = "OneLake" # type: str + self.artifact = kwargs["artifact"] + self.endpoint = kwargs.get("endpoint", None) + self.one_lake_workspace_name = kwargs["one_lake_workspace_name"] + self.service_data_access_auth_identity = kwargs.get( + "service_data_access_auth_identity", None + ) class OnlineDeployment(TrackedResource): @@ -20777,31 +21292,31 @@ class OnlineDeployment(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineDeploymentProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": { + "key": "properties", + "type": "OnlineDeploymentProperties", + }, + "sku": {"key": "sku", "type": "Sku"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -20818,13 +21333,15 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ super(OnlineDeployment, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) + self.identity = kwargs.get("identity", None) + self.kind = kwargs.get("kind", None) + self.properties = kwargs["properties"] + self.sku = kwargs.get("sku", None) -class OnlineDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class OnlineDeploymentTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of OnlineDeployment entities. :ivar next_link: The link to the next page of OnlineDeployment objects. If null, there are no @@ -20835,14 +21352,11 @@ class OnlineDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Mod """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineDeployment]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[OnlineDeployment]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of OnlineDeployment objects. If null, there are no additional pages. @@ -20850,9 +21364,11 @@ def __init__( :keyword value: An array of objects of type OnlineDeployment. :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineDeployment] """ - super(OnlineDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super( + OnlineDeploymentTrackedResourceArmPaginatedResult, self + ).__init__(**kwargs) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class OnlineEndpoint(TrackedResource): @@ -20889,31 +21405,31 @@ class OnlineEndpoint(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": { + "key": "properties", + "type": "OnlineEndpointProperties", + }, + "sku": {"key": "sku", "type": "Sku"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -20930,10 +21446,10 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ super(OnlineEndpoint, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.properties = kwargs['properties'] - self.sku = kwargs.get('sku', None) + self.identity = kwargs.get("identity", None) + self.kind = kwargs.get("kind", None) + self.properties = kwargs["properties"] + self.sku = kwargs.get("sku", None) class OnlineEndpointProperties(EndpointPropertiesBase): @@ -20979,30 +21495,27 @@ class OnlineEndpointProperties(EndpointPropertiesBase): """ _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "auth_mode": {"required": True}, + "scoring_uri": {"readonly": True}, + "swagger_uri": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'mirror_traffic': {'key': 'mirrorTraffic', 'type': '{int}'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, - 'traffic': {'key': 'traffic', 'type': '{int}'}, + "auth_mode": {"key": "authMode", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "keys": {"key": "keys", "type": "EndpointAuthKeys"}, + "properties": {"key": "properties", "type": "{str}"}, + "scoring_uri": {"key": "scoringUri", "type": "str"}, + "swagger_uri": {"key": "swaggerUri", "type": "str"}, + "compute": {"key": "compute", "type": "str"}, + "mirror_traffic": {"key": "mirrorTraffic", "type": "{int}"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "public_network_access": {"key": "publicNetworkAccess", "type": "str"}, + "traffic": {"key": "traffic", "type": "{int}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword auth_mode: Required. [Required] Use 'Key' for key based authentication and 'AMLToken' for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' @@ -21031,14 +21544,16 @@ def __init__( :paramtype traffic: dict[str, int] """ super(OnlineEndpointProperties, self).__init__(**kwargs) - self.compute = kwargs.get('compute', None) - self.mirror_traffic = kwargs.get('mirror_traffic', None) + self.compute = kwargs.get("compute", None) + self.mirror_traffic = kwargs.get("mirror_traffic", None) self.provisioning_state = None - self.public_network_access = kwargs.get('public_network_access', None) - self.traffic = kwargs.get('traffic', None) + self.public_network_access = kwargs.get("public_network_access", None) + self.traffic = kwargs.get("traffic", None) -class OnlineEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class OnlineEndpointTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of OnlineEndpoint entities. :ivar next_link: The link to the next page of OnlineEndpoint objects. If null, there are no @@ -21049,14 +21564,11 @@ class OnlineEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineEndpoint]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[OnlineEndpoint]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of OnlineEndpoint objects. If null, there are no additional pages. @@ -21064,9 +21576,11 @@ def __init__( :keyword value: An array of objects of type OnlineEndpoint. :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] """ - super(OnlineEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(OnlineEndpointTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class OnlineInferenceConfiguration(msrest.serialization.Model): @@ -21086,17 +21600,14 @@ class OnlineInferenceConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'configurations': {'key': 'configurations', 'type': '{str}'}, - 'entry_script': {'key': 'entryScript', 'type': 'str'}, - 'liveness_route': {'key': 'livenessRoute', 'type': 'Route'}, - 'readiness_route': {'key': 'readinessRoute', 'type': 'Route'}, - 'scoring_route': {'key': 'scoringRoute', 'type': 'Route'}, + "configurations": {"key": "configurations", "type": "{str}"}, + "entry_script": {"key": "entryScript", "type": "str"}, + "liveness_route": {"key": "livenessRoute", "type": "Route"}, + "readiness_route": {"key": "readinessRoute", "type": "Route"}, + "scoring_route": {"key": "scoringRoute", "type": "Route"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword configurations: Additional configurations. :paramtype configurations: dict[str, str] @@ -21111,11 +21622,11 @@ def __init__( :paramtype scoring_route: ~azure.mgmt.machinelearningservices.models.Route """ super(OnlineInferenceConfiguration, self).__init__(**kwargs) - self.configurations = kwargs.get('configurations', None) - self.entry_script = kwargs.get('entry_script', None) - self.liveness_route = kwargs.get('liveness_route', None) - self.readiness_route = kwargs.get('readiness_route', None) - self.scoring_route = kwargs.get('scoring_route', None) + self.configurations = kwargs.get("configurations", None) + self.entry_script = kwargs.get("entry_script", None) + self.liveness_route = kwargs.get("liveness_route", None) + self.readiness_route = kwargs.get("readiness_route", None) + self.scoring_route = kwargs.get("scoring_route", None) class OnlineRequestSettings(msrest.serialization.Model): @@ -21134,15 +21645,15 @@ class OnlineRequestSettings(msrest.serialization.Model): """ _attribute_map = { - 'max_concurrent_requests_per_instance': {'key': 'maxConcurrentRequestsPerInstance', 'type': 'int'}, - 'max_queue_wait': {'key': 'maxQueueWait', 'type': 'duration'}, - 'request_timeout': {'key': 'requestTimeout', 'type': 'duration'}, + "max_concurrent_requests_per_instance": { + "key": "maxConcurrentRequestsPerInstance", + "type": "int", + }, + "max_queue_wait": {"key": "maxQueueWait", "type": "duration"}, + "request_timeout": {"key": "requestTimeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword max_concurrent_requests_per_instance: The number of maximum concurrent requests per node allowed per deployment. Defaults to 1. @@ -21156,9 +21667,11 @@ def __init__( :paramtype request_timeout: ~datetime.timedelta """ super(OnlineRequestSettings, self).__init__(**kwargs) - self.max_concurrent_requests_per_instance = kwargs.get('max_concurrent_requests_per_instance', 1) - self.max_queue_wait = kwargs.get('max_queue_wait', "PT0.5S") - self.request_timeout = kwargs.get('request_timeout', "PT5S") + self.max_concurrent_requests_per_instance = kwargs.get( + "max_concurrent_requests_per_instance", 1 + ) + self.max_queue_wait = kwargs.get("max_queue_wait", "PT0.5S") + self.request_timeout = kwargs.get("request_timeout", "PT5S") class OutboundRuleBasicResource(Resource): @@ -21185,32 +21698,29 @@ class OutboundRuleBasicResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'OutboundRule'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "OutboundRule"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. Outbound Rule for the managed network of a machine learning workspace. :paramtype properties: ~azure.mgmt.machinelearningservices.models.OutboundRule """ super(OutboundRuleBasicResource, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class OutboundRuleListResult(msrest.serialization.Model): @@ -21225,14 +21735,11 @@ class OutboundRuleListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[OutboundRuleBasicResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[OutboundRuleBasicResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: The list of machine learning workspaces. Since this list may be incomplete, the nextLink field should be used to request the next list of machine learning workspaces. @@ -21242,8 +21749,8 @@ def __init__( :paramtype next_link: str """ super(OutboundRuleListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get("value", None) + self.next_link = kwargs.get("next_link", None) class OutputPathAssetReference(AssetReferenceBase): @@ -21261,19 +21768,16 @@ class OutputPathAssetReference(AssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "job_id": {"key": "jobId", "type": "str"}, + "path": {"key": "path", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword job_id: ARM resource ID of the job. :paramtype job_id: str @@ -21281,9 +21785,9 @@ def __init__( :paramtype path: str """ super(OutputPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'OutputPath' # type: str - self.job_id = kwargs.get('job_id', None) - self.path = kwargs.get('path', None) + self.reference_type = "OutputPath" # type: str + self.job_id = kwargs.get("job_id", None) + self.path = kwargs.get("path", None) class PackageInputPathBase(msrest.serialization.Model): @@ -21300,23 +21804,23 @@ class PackageInputPathBase(msrest.serialization.Model): """ _validation = { - 'input_path_type': {'required': True}, + "input_path_type": {"required": True}, } _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, + "input_path_type": {"key": "inputPathType", "type": "str"}, } _subtype_map = { - 'input_path_type': {'PathId': 'PackageInputPathId', 'PathVersion': 'PackageInputPathVersion', 'Url': 'PackageInputPathUrl'} + "input_path_type": { + "PathId": "PackageInputPathId", + "PathVersion": "PackageInputPathVersion", + "Url": "PackageInputPathUrl", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(PackageInputPathBase, self).__init__(**kwargs) self.input_path_type = None # type: Optional[str] @@ -21334,25 +21838,22 @@ class PackageInputPathId(PackageInputPathBase): """ _validation = { - 'input_path_type': {'required': True}, + "input_path_type": {"required": True}, } _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, + "input_path_type": {"key": "inputPathType", "type": "str"}, + "resource_id": {"key": "resourceId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword resource_id: Input resource id. :paramtype resource_id: str """ super(PackageInputPathId, self).__init__(**kwargs) - self.input_path_type = 'PathId' # type: str - self.resource_id = kwargs.get('resource_id', None) + self.input_path_type = "PathId" # type: str + self.resource_id = kwargs.get("resource_id", None) class PackageInputPathUrl(PackageInputPathBase): @@ -21368,25 +21869,22 @@ class PackageInputPathUrl(PackageInputPathBase): """ _validation = { - 'input_path_type': {'required': True}, + "input_path_type": {"required": True}, } _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'}, + "input_path_type": {"key": "inputPathType", "type": "str"}, + "url": {"key": "url", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword url: Input path url. :paramtype url: str """ super(PackageInputPathUrl, self).__init__(**kwargs) - self.input_path_type = 'Url' # type: str - self.url = kwargs.get('url', None) + self.input_path_type = "Url" # type: str + self.url = kwargs.get("url", None) class PackageInputPathVersion(PackageInputPathBase): @@ -21404,19 +21902,16 @@ class PackageInputPathVersion(PackageInputPathBase): """ _validation = { - 'input_path_type': {'required': True}, + "input_path_type": {"required": True}, } _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - 'resource_name': {'key': 'resourceName', 'type': 'str'}, - 'resource_version': {'key': 'resourceVersion', 'type': 'str'}, + "input_path_type": {"key": "inputPathType", "type": "str"}, + "resource_name": {"key": "resourceName", "type": "str"}, + "resource_version": {"key": "resourceVersion", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword resource_name: Input resource name. :paramtype resource_name: str @@ -21424,9 +21919,9 @@ def __init__( :paramtype resource_version: str """ super(PackageInputPathVersion, self).__init__(**kwargs) - self.input_path_type = 'PathVersion' # type: str - self.resource_name = kwargs.get('resource_name', None) - self.resource_version = kwargs.get('resource_version', None) + self.input_path_type = "PathVersion" # type: str + self.resource_name = kwargs.get("resource_name", None) + self.resource_version = kwargs.get("resource_version", None) class PackageRequest(msrest.serialization.Model): @@ -21455,25 +21950,44 @@ class PackageRequest(msrest.serialization.Model): """ _validation = { - 'inferencing_server': {'required': True}, - 'target_environment_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - } - - _attribute_map = { - 'base_environment_source': {'key': 'baseEnvironmentSource', 'type': 'BaseEnvironmentSource'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inferencing_server': {'key': 'inferencingServer', 'type': 'InferencingServer'}, - 'inputs': {'key': 'inputs', 'type': '[ModelPackageInput]'}, - 'model_configuration': {'key': 'modelConfiguration', 'type': 'ModelConfiguration'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'target_environment_name': {'key': 'targetEnvironmentName', 'type': 'str'}, - 'target_environment_version': {'key': 'targetEnvironmentVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + "inferencing_server": {"required": True}, + "target_environment_name": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + } + + _attribute_map = { + "base_environment_source": { + "key": "baseEnvironmentSource", + "type": "BaseEnvironmentSource", + }, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "inferencing_server": { + "key": "inferencingServer", + "type": "InferencingServer", + }, + "inputs": {"key": "inputs", "type": "[ModelPackageInput]"}, + "model_configuration": { + "key": "modelConfiguration", + "type": "ModelConfiguration", + }, + "tags": {"key": "tags", "type": "{str}"}, + "target_environment_name": { + "key": "targetEnvironmentName", + "type": "str", + }, + "target_environment_version": { + "key": "targetEnvironmentVersion", + "type": "str", + }, + } + + def __init__(self, **kwargs): """ :keyword base_environment_source: Base environment to start with. :paramtype base_environment_source: @@ -21495,14 +22009,18 @@ def __init__( :paramtype target_environment_version: str """ super(PackageRequest, self).__init__(**kwargs) - self.base_environment_source = kwargs.get('base_environment_source', None) - self.environment_variables = kwargs.get('environment_variables', None) - self.inferencing_server = kwargs['inferencing_server'] - self.inputs = kwargs.get('inputs', None) - self.model_configuration = kwargs.get('model_configuration', None) - self.tags = kwargs.get('tags', None) - self.target_environment_name = kwargs['target_environment_name'] - self.target_environment_version = kwargs.get('target_environment_version', None) + self.base_environment_source = kwargs.get( + "base_environment_source", None + ) + self.environment_variables = kwargs.get("environment_variables", None) + self.inferencing_server = kwargs["inferencing_server"] + self.inputs = kwargs.get("inputs", None) + self.model_configuration = kwargs.get("model_configuration", None) + self.tags = kwargs.get("tags", None) + self.target_environment_name = kwargs["target_environment_name"] + self.target_environment_version = kwargs.get( + "target_environment_version", None + ) class PackageResponse(msrest.serialization.Model): @@ -21539,41 +22057,55 @@ class PackageResponse(msrest.serialization.Model): """ _validation = { - 'base_environment_source': {'readonly': True}, - 'build_id': {'readonly': True}, - 'build_state': {'readonly': True}, - 'environment_variables': {'readonly': True}, - 'inferencing_server': {'readonly': True}, - 'inputs': {'readonly': True}, - 'log_url': {'readonly': True}, - 'model_configuration': {'readonly': True}, - 'tags': {'readonly': True}, - 'target_environment_id': {'readonly': True}, - 'target_environment_name': {'readonly': True}, - 'target_environment_version': {'readonly': True}, - } - - _attribute_map = { - 'base_environment_source': {'key': 'baseEnvironmentSource', 'type': 'BaseEnvironmentSource'}, - 'build_id': {'key': 'buildId', 'type': 'str'}, - 'build_state': {'key': 'buildState', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inferencing_server': {'key': 'inferencingServer', 'type': 'InferencingServer'}, - 'inputs': {'key': 'inputs', 'type': '[ModelPackageInput]'}, - 'log_url': {'key': 'logUrl', 'type': 'str'}, - 'model_configuration': {'key': 'modelConfiguration', 'type': 'ModelConfiguration'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'target_environment_id': {'key': 'targetEnvironmentId', 'type': 'str'}, - 'target_environment_name': {'key': 'targetEnvironmentName', 'type': 'str'}, - 'target_environment_version': {'key': 'targetEnvironmentVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ + "base_environment_source": {"readonly": True}, + "build_id": {"readonly": True}, + "build_state": {"readonly": True}, + "environment_variables": {"readonly": True}, + "inferencing_server": {"readonly": True}, + "inputs": {"readonly": True}, + "log_url": {"readonly": True}, + "model_configuration": {"readonly": True}, + "tags": {"readonly": True}, + "target_environment_id": {"readonly": True}, + "target_environment_name": {"readonly": True}, + "target_environment_version": {"readonly": True}, + } + + _attribute_map = { + "base_environment_source": { + "key": "baseEnvironmentSource", + "type": "BaseEnvironmentSource", + }, + "build_id": {"key": "buildId", "type": "str"}, + "build_state": {"key": "buildState", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "inferencing_server": { + "key": "inferencingServer", + "type": "InferencingServer", + }, + "inputs": {"key": "inputs", "type": "[ModelPackageInput]"}, + "log_url": {"key": "logUrl", "type": "str"}, + "model_configuration": { + "key": "modelConfiguration", + "type": "ModelConfiguration", + }, + "tags": {"key": "tags", "type": "{str}"}, + "target_environment_id": {"key": "targetEnvironmentId", "type": "str"}, + "target_environment_name": { + "key": "targetEnvironmentName", + "type": "str", + }, + "target_environment_version": { + "key": "targetEnvironmentVersion", + "type": "str", + }, + } + + def __init__(self, **kwargs): + """ """ super(PackageResponse, self).__init__(**kwargs) self.base_environment_source = None self.build_id = None @@ -21599,14 +22131,11 @@ class PaginatedComputeResourcesList(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[ComputeResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[ComputeResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: An array of Machine Learning compute objects wrapped in ARM resource envelope. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComputeResource] @@ -21614,8 +22143,8 @@ def __init__( :paramtype next_link: str """ super(PaginatedComputeResourcesList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get("value", None) + self.next_link = kwargs.get("next_link", None) class PartialBatchDeployment(msrest.serialization.Model): @@ -21626,22 +22155,21 @@ class PartialBatchDeployment(msrest.serialization.Model): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: Description of the endpoint deployment. :paramtype description: str """ super(PartialBatchDeployment, self).__init__(**kwargs) - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) -class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties(msrest.serialization.Model): +class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties( + msrest.serialization.Model +): """Strictly used in update requests. :ivar properties: Additional attributes of the entity. @@ -21651,23 +22179,23 @@ class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties(msrest.s """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'PartialBatchDeployment'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "properties": {"key": "properties", "type": "PartialBatchDeployment"}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.PartialBatchDeployment :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] """ - super(PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.tags = kwargs.get('tags', None) + super( + PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, + self, + ).__init__(**kwargs) + self.properties = kwargs.get("properties", None) + self.tags = kwargs.get("tags", None) class PartialJobBase(msrest.serialization.Model): @@ -21679,20 +22207,20 @@ class PartialJobBase(msrest.serialization.Model): """ _attribute_map = { - 'notification_setting': {'key': 'notificationSetting', 'type': 'PartialNotificationSetting'}, + "notification_setting": { + "key": "notificationSetting", + "type": "PartialNotificationSetting", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword notification_setting: Mutable notification setting for the job. :paramtype notification_setting: ~azure.mgmt.machinelearningservices.models.PartialNotificationSetting """ super(PartialJobBase, self).__init__(**kwargs) - self.notification_setting = kwargs.get('notification_setting', None) + self.notification_setting = kwargs.get("notification_setting", None) class PartialJobBasePartialResource(msrest.serialization.Model): @@ -21703,19 +22231,16 @@ class PartialJobBasePartialResource(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'PartialJobBase'}, + "properties": {"key": "properties", "type": "PartialJobBase"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.PartialJobBase """ super(PartialJobBasePartialResource, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class PartialManagedServiceIdentity(ManagedServiceIdentityAutoGenerated): @@ -21744,22 +22269,22 @@ class PartialManagedServiceIdentity(ManagedServiceIdentityAutoGenerated): """ _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, + "principal_id": {"readonly": True}, + "tenant_id": {"readonly": True}, + "type": {"required": True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{UserAssignedIdentity}", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword type: Required. Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", @@ -21790,14 +22315,14 @@ class PartialManagedServiceIdentityAutoGenerated(msrest.serialization.Model): """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{object}'}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{object}", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword type: Managed service identity (system assigned and/or user assigned identities). Possible values include: "None", "SystemAssigned", "UserAssigned", @@ -21809,9 +22334,13 @@ def __init__( The dictionary values can be empty objects ({}) in requests. :paramtype user_assigned_identities: dict[str, any] """ - super(PartialManagedServiceIdentityAutoGenerated, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + super(PartialManagedServiceIdentityAutoGenerated, self).__init__( + **kwargs + ) + self.type = kwargs.get("type", None) + self.user_assigned_identities = kwargs.get( + "user_assigned_identities", None + ) class PartialMinimalTrackedResource(msrest.serialization.Model): @@ -21822,19 +22351,16 @@ class PartialMinimalTrackedResource(msrest.serialization.Model): """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] """ super(PartialMinimalTrackedResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) + self.tags = kwargs.get("tags", None) class PartialMinimalTrackedResourceWithIdentity(PartialMinimalTrackedResource): @@ -21848,14 +22374,14 @@ class PartialMinimalTrackedResourceWithIdentity(PartialMinimalTrackedResource): """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentityAutoGenerated'}, + "tags": {"key": "tags", "type": "{str}"}, + "identity": { + "key": "identity", + "type": "PartialManagedServiceIdentityAutoGenerated", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -21863,8 +22389,10 @@ def __init__( :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentityAutoGenerated """ - super(PartialMinimalTrackedResourceWithIdentity, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) + super(PartialMinimalTrackedResourceWithIdentity, self).__init__( + **kwargs + ) + self.identity = kwargs.get("identity", None) class PartialMinimalTrackedResourceWithSku(PartialMinimalTrackedResource): @@ -21877,14 +22405,11 @@ class PartialMinimalTrackedResourceWithSku(PartialMinimalTrackedResource): """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "PartialSku"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -21892,7 +22417,7 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku """ super(PartialMinimalTrackedResourceWithSku, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) + self.sku = kwargs.get("sku", None) class PartialNotificationSetting(msrest.serialization.Model): @@ -21904,20 +22429,17 @@ class PartialNotificationSetting(msrest.serialization.Model): """ _attribute_map = { - 'webhooks': {'key': 'webhooks', 'type': '{Webhook}'}, + "webhooks": {"key": "webhooks", "type": "{Webhook}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword webhooks: Send webhook callback to a service. Key is a user-provided name for the webhook. :paramtype webhooks: dict[str, ~azure.mgmt.machinelearningservices.models.Webhook] """ super(PartialNotificationSetting, self).__init__(**kwargs) - self.webhooks = kwargs.get('webhooks', None) + self.webhooks = kwargs.get("webhooks", None) class PartialRegistryPartialTrackedResource(msrest.serialization.Model): @@ -21932,15 +22454,15 @@ class PartialRegistryPartialTrackedResource(msrest.serialization.Model): """ _attribute_map = { - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "identity": { + "key": "identity", + "type": "PartialManagedServiceIdentity", + }, + "sku": {"key": "sku", "type": "PartialSku"}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword identity: Managed service identity (system assigned and/or user assigned identities). :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentity @@ -21950,9 +22472,9 @@ def __init__( :paramtype tags: dict[str, str] """ super(PartialRegistryPartialTrackedResource, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) + self.identity = kwargs.get("identity", None) + self.sku = kwargs.get("sku", None) + self.tags = kwargs.get("tags", None) class PartialSku(msrest.serialization.Model): @@ -21976,17 +22498,14 @@ class PartialSku(msrest.serialization.Model): """ _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'int'}, - 'family': {'key': 'family', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, + "capacity": {"key": "capacity", "type": "int"}, + "family": {"key": "family", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "size": {"key": "size", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword capacity: If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted. @@ -22005,11 +22524,11 @@ def __init__( :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier """ super(PartialSku, self).__init__(**kwargs) - self.capacity = kwargs.get('capacity', None) - self.family = kwargs.get('family', None) - self.name = kwargs.get('name', None) - self.size = kwargs.get('size', None) - self.tier = kwargs.get('tier', None) + self.capacity = kwargs.get("capacity", None) + self.family = kwargs.get("family", None) + self.name = kwargs.get("name", None) + self.size = kwargs.get("size", None) + self.tier = kwargs.get("tier", None) class Password(msrest.serialization.Model): @@ -22024,27 +22543,25 @@ class Password(msrest.serialization.Model): """ _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, + "name": {"readonly": True}, + "value": {"readonly": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "value": {"key": "value", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Password, self).__init__(**kwargs) self.name = None self.value = None -class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class PATAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """PATAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -22071,23 +22588,23 @@ class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionPersonalAccessToken'}, + "auth_type": {"key": "authType", "type": "str"}, + "expiry_time": {"key": "expiryTime", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionPersonalAccessToken", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword expiry_time: :paramtype expiry_time: str @@ -22106,9 +22623,11 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken """ - super(PATAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'PAT' # type: str - self.credentials = kwargs.get('credentials', None) + super(PATAuthTypeWorkspaceConnectionProperties, self).__init__( + **kwargs + ) + self.auth_type = "PAT" # type: str + self.credentials = kwargs.get("credentials", None) class PendingUploadCredentialDto(msrest.serialization.Model): @@ -22126,23 +22645,17 @@ class PendingUploadCredentialDto(msrest.serialization.Model): """ _validation = { - 'credential_type': {'required': True}, + "credential_type": {"required": True}, } _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, + "credential_type": {"key": "credentialType", "type": "str"}, } - _subtype_map = { - 'credential_type': {'SAS': 'SASCredentialDto'} - } + _subtype_map = {"credential_type": {"SAS": "SASCredentialDto"}} - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(PendingUploadCredentialDto, self).__init__(**kwargs) self.credential_type = None # type: Optional[str] @@ -22159,14 +22672,11 @@ class PendingUploadRequestDto(msrest.serialization.Model): """ _attribute_map = { - 'pending_upload_id': {'key': 'pendingUploadId', 'type': 'str'}, - 'pending_upload_type': {'key': 'pendingUploadType', 'type': 'str'}, + "pending_upload_id": {"key": "pendingUploadId", "type": "str"}, + "pending_upload_type": {"key": "pendingUploadType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword pending_upload_id: If PendingUploadId = null then random guid will be used. :paramtype pending_upload_id: str @@ -22176,8 +22686,8 @@ def __init__( ~azure.mgmt.machinelearningservices.models.PendingUploadType """ super(PendingUploadRequestDto, self).__init__(**kwargs) - self.pending_upload_id = kwargs.get('pending_upload_id', None) - self.pending_upload_type = kwargs.get('pending_upload_type', None) + self.pending_upload_id = kwargs.get("pending_upload_id", None) + self.pending_upload_type = kwargs.get("pending_upload_type", None) class PendingUploadResponseDto(msrest.serialization.Model): @@ -22195,15 +22705,15 @@ class PendingUploadResponseDto(msrest.serialization.Model): """ _attribute_map = { - 'blob_reference_for_consumption': {'key': 'blobReferenceForConsumption', 'type': 'BlobReferenceForConsumptionDto'}, - 'pending_upload_id': {'key': 'pendingUploadId', 'type': 'str'}, - 'pending_upload_type': {'key': 'pendingUploadType', 'type': 'str'}, + "blob_reference_for_consumption": { + "key": "blobReferenceForConsumption", + "type": "BlobReferenceForConsumptionDto", + }, + "pending_upload_id": {"key": "pendingUploadId", "type": "str"}, + "pending_upload_type": {"key": "pendingUploadType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword blob_reference_for_consumption: Container level read, write, list SAS. :paramtype blob_reference_for_consumption: @@ -22216,9 +22726,11 @@ def __init__( ~azure.mgmt.machinelearningservices.models.PendingUploadType """ super(PendingUploadResponseDto, self).__init__(**kwargs) - self.blob_reference_for_consumption = kwargs.get('blob_reference_for_consumption', None) - self.pending_upload_id = kwargs.get('pending_upload_id', None) - self.pending_upload_type = kwargs.get('pending_upload_type', None) + self.blob_reference_for_consumption = kwargs.get( + "blob_reference_for_consumption", None + ) + self.pending_upload_id = kwargs.get("pending_upload_id", None) + self.pending_upload_type = kwargs.get("pending_upload_type", None) class PersonalComputeInstanceSettings(msrest.serialization.Model): @@ -22229,19 +22741,16 @@ class PersonalComputeInstanceSettings(msrest.serialization.Model): """ _attribute_map = { - 'assigned_user': {'key': 'assignedUser', 'type': 'AssignedUser'}, + "assigned_user": {"key": "assignedUser", "type": "AssignedUser"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword assigned_user: A user explicitly assigned to a personal compute instance. :paramtype assigned_user: ~azure.mgmt.machinelearningservices.models.AssignedUser """ super(PersonalComputeInstanceSettings, self).__init__(**kwargs) - self.assigned_user = kwargs.get('assigned_user', None) + self.assigned_user = kwargs.get("assigned_user", None) class PipelineJob(JobBaseProperties): @@ -22300,36 +22809,39 @@ class PipelineJob(JobBaseProperties): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, + "job_type": {"required": True}, + "status": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'jobs': {'key': 'jobs', 'type': '{object}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'settings': {'key': 'settings', 'type': 'object'}, - 'source_job_id': {'key': 'sourceJobId', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "notification_setting": { + "key": "notificationSetting", + "type": "NotificationSetting", + }, + "secrets_configuration": { + "key": "secretsConfiguration", + "type": "{SecretConfiguration}", + }, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "jobs": {"key": "jobs", "type": "{object}"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "settings": {"key": "settings", "type": "object"}, + "source_job_id": {"key": "sourceJobId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -22372,12 +22884,12 @@ def __init__( :paramtype source_job_id: str """ super(PipelineJob, self).__init__(**kwargs) - self.job_type = 'Pipeline' # type: str - self.inputs = kwargs.get('inputs', None) - self.jobs = kwargs.get('jobs', None) - self.outputs = kwargs.get('outputs', None) - self.settings = kwargs.get('settings', None) - self.source_job_id = kwargs.get('source_job_id', None) + self.job_type = "Pipeline" # type: str + self.inputs = kwargs.get("inputs", None) + self.jobs = kwargs.get("jobs", None) + self.outputs = kwargs.get("outputs", None) + self.settings = kwargs.get("settings", None) + self.source_job_id = kwargs.get("source_job_id", None) class PredictionDriftMonitoringSignal(MonitoringSignalBase): @@ -22409,27 +22921,30 @@ class PredictionDriftMonitoringSignal(MonitoringSignalBase): """ _validation = { - 'signal_type': {'required': True}, - 'baseline_data': {'required': True}, - 'metric_thresholds': {'required': True}, - 'model_type': {'required': True}, - 'target_data': {'required': True}, + "signal_type": {"required": True}, + "baseline_data": {"required": True}, + "metric_thresholds": {"required": True}, + "model_type": {"required": True}, + "target_data": {"required": True}, } _attribute_map = { - 'lookback_period': {'key': 'lookbackPeriod', 'type': 'duration'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'baseline_data': {'key': 'baselineData', 'type': 'MonitoringInputData'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[PredictionDriftMetricThresholdBase]'}, - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'target_data': {'key': 'targetData', 'type': 'MonitoringInputData'}, + "lookback_period": {"key": "lookbackPeriod", "type": "duration"}, + "mode": {"key": "mode", "type": "str"}, + "signal_type": {"key": "signalType", "type": "str"}, + "baseline_data": { + "key": "baselineData", + "type": "MonitoringInputData", + }, + "metric_thresholds": { + "key": "metricThresholds", + "type": "[PredictionDriftMetricThresholdBase]", + }, + "model_type": {"key": "modelType", "type": "str"}, + "target_data": {"key": "targetData", "type": "MonitoringInputData"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword lookback_period: The amount of time a single monitor should look back over the target data on a given run. @@ -22450,11 +22965,11 @@ def __init__( :paramtype target_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData """ super(PredictionDriftMonitoringSignal, self).__init__(**kwargs) - self.signal_type = 'PredictionDrift' # type: str - self.baseline_data = kwargs['baseline_data'] - self.metric_thresholds = kwargs['metric_thresholds'] - self.model_type = kwargs['model_type'] - self.target_data = kwargs['target_data'] + self.signal_type = "PredictionDrift" # type: str + self.baseline_data = kwargs["baseline_data"] + self.metric_thresholds = kwargs["metric_thresholds"] + self.model_type = kwargs["model_type"] + self.target_data = kwargs["target_data"] class PrivateEndpoint(msrest.serialization.Model): @@ -22469,21 +22984,17 @@ class PrivateEndpoint(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'subnet_arm_id': {'readonly': True}, + "id": {"readonly": True}, + "subnet_arm_id": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'subnet_arm_id': {'key': 'subnetArmId', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "subnet_arm_id": {"key": "subnetArmId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(PrivateEndpoint, self).__init__(**kwargs) self.id = None self.subnet_arm_id = None @@ -22499,19 +23010,15 @@ class PrivateEndpointAutoGenerated(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, + "id": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(PrivateEndpointAutoGenerated, self).__init__(**kwargs) self.id = None @@ -22553,31 +23060,37 @@ class PrivateEndpointConnection(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "private_endpoint": { + "key": "properties.privateEndpoint", + "type": "PrivateEndpoint", + }, + "private_link_service_connection_state": { + "key": "properties.privateLinkServiceConnectionState", + "type": "PrivateLinkServiceConnectionState", + }, + "provisioning_state": { + "key": "properties.provisioningState", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword identity: The identity of the resource. :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity @@ -22595,12 +23108,14 @@ def __init__( ~azure.mgmt.machinelearningservices.models.PrivateLinkServiceConnectionState """ super(PrivateEndpointConnection, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) - self.private_endpoint = kwargs.get('private_endpoint', None) - self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + self.identity = kwargs.get("identity", None) + self.location = kwargs.get("location", None) + self.tags = kwargs.get("tags", None) + self.sku = kwargs.get("sku", None) + self.private_endpoint = kwargs.get("private_endpoint", None) + self.private_link_service_connection_state = kwargs.get( + "private_link_service_connection_state", None + ) self.provisioning_state = None @@ -22626,18 +23141,24 @@ class PrivateEndpointConnectionAutoGenerated(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'group_ids': {'key': 'properties.groupIds', 'type': '[str]'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpointResource'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionStateAutoGenerated'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "group_ids": {"key": "properties.groupIds", "type": "[str]"}, + "private_endpoint": { + "key": "properties.privateEndpoint", + "type": "PrivateEndpointResource", + }, + "private_link_service_connection_state": { + "key": "properties.privateLinkServiceConnectionState", + "type": "PrivateLinkServiceConnectionStateAutoGenerated", + }, + "provisioning_state": { + "key": "properties.provisioningState", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword id: This is the private endpoint connection name created on SRP Full resource id: @@ -22657,12 +23178,14 @@ def __init__( :paramtype provisioning_state: str """ super(PrivateEndpointConnectionAutoGenerated, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.location = kwargs.get('location', None) - self.group_ids = kwargs.get('group_ids', None) - self.private_endpoint = kwargs.get('private_endpoint', None) - self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) - self.provisioning_state = kwargs.get('provisioning_state', None) + self.id = kwargs.get("id", None) + self.location = kwargs.get("location", None) + self.group_ids = kwargs.get("group_ids", None) + self.private_endpoint = kwargs.get("private_endpoint", None) + self.private_link_service_connection_state = kwargs.get( + "private_link_service_connection_state", None + ) + self.provisioning_state = kwargs.get("provisioning_state", None) class PrivateEndpointConnectionListResult(msrest.serialization.Model): @@ -22673,19 +23196,16 @@ class PrivateEndpointConnectionListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + "value": {"key": "value", "type": "[PrivateEndpointConnection]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Array of private endpoint connections. :paramtype value: list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] """ super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class PrivateEndpointDestination(msrest.serialization.Model): @@ -22703,16 +23223,13 @@ class PrivateEndpointDestination(msrest.serialization.Model): """ _attribute_map = { - 'service_resource_id': {'key': 'serviceResourceId', 'type': 'str'}, - 'subresource_target': {'key': 'subresourceTarget', 'type': 'str'}, - 'spark_enabled': {'key': 'sparkEnabled', 'type': 'bool'}, - 'spark_status': {'key': 'sparkStatus', 'type': 'str'}, + "service_resource_id": {"key": "serviceResourceId", "type": "str"}, + "subresource_target": {"key": "subresourceTarget", "type": "str"}, + "spark_enabled": {"key": "sparkEnabled", "type": "bool"}, + "spark_status": {"key": "sparkStatus", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword service_resource_id: :paramtype service_resource_id: str @@ -22725,10 +23242,10 @@ def __init__( :paramtype spark_status: str or ~azure.mgmt.machinelearningservices.models.RuleStatus """ super(PrivateEndpointDestination, self).__init__(**kwargs) - self.service_resource_id = kwargs.get('service_resource_id', None) - self.subresource_target = kwargs.get('subresource_target', None) - self.spark_enabled = kwargs.get('spark_enabled', None) - self.spark_status = kwargs.get('spark_status', None) + self.service_resource_id = kwargs.get("service_resource_id", None) + self.subresource_target = kwargs.get("subresource_target", None) + self.spark_enabled = kwargs.get("spark_enabled", None) + self.spark_status = kwargs.get("spark_status", None) class PrivateEndpointOutboundRule(OutboundRule): @@ -22752,20 +23269,20 @@ class PrivateEndpointOutboundRule(OutboundRule): """ _validation = { - 'type': {'required': True}, + "type": {"required": True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'PrivateEndpointDestination'}, + "type": {"key": "type", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "destination": { + "key": "destination", + "type": "PrivateEndpointDestination", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword status: Status of a managed network Outbound Rule of a machine learning workspace. Possible values include: "Inactive", "Active". @@ -22778,8 +23295,8 @@ def __init__( :paramtype destination: ~azure.mgmt.machinelearningservices.models.PrivateEndpointDestination """ super(PrivateEndpointOutboundRule, self).__init__(**kwargs) - self.type = 'PrivateEndpoint' # type: str - self.destination = kwargs.get('destination', None) + self.type = "PrivateEndpoint" # type: str + self.destination = kwargs.get("destination", None) class PrivateEndpointResource(PrivateEndpointAutoGenerated): @@ -22794,24 +23311,21 @@ class PrivateEndpointResource(PrivateEndpointAutoGenerated): """ _validation = { - 'id': {'readonly': True}, + "id": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'subnet_arm_id': {'key': 'subnetArmId', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "subnet_arm_id": {"key": "subnetArmId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword subnet_arm_id: The subnetId that the private endpoint is connected to. :paramtype subnet_arm_id: str """ super(PrivateEndpointResource, self).__init__(**kwargs) - self.subnet_arm_id = kwargs.get('subnet_arm_id', None) + self.subnet_arm_id = kwargs.get("subnet_arm_id", None) class PrivateLinkResource(Resource): @@ -22847,32 +23361,35 @@ class PrivateLinkResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'group_id': {'readonly': True}, - 'required_members': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "group_id": {"readonly": True}, + "required_members": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, - 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "group_id": {"key": "properties.groupId", "type": "str"}, + "required_members": { + "key": "properties.requiredMembers", + "type": "[str]", + }, + "required_zone_names": { + "key": "properties.requiredZoneNames", + "type": "[str]", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword identity: The identity of the resource. :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity @@ -22886,13 +23403,13 @@ def __init__( :paramtype required_zone_names: list[str] """ super(PrivateLinkResource, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) + self.identity = kwargs.get("identity", None) + self.location = kwargs.get("location", None) + self.tags = kwargs.get("tags", None) + self.sku = kwargs.get("sku", None) self.group_id = None self.required_members = None - self.required_zone_names = kwargs.get('required_zone_names', None) + self.required_zone_names = kwargs.get("required_zone_names", None) class PrivateLinkResourceListResult(msrest.serialization.Model): @@ -22903,19 +23420,16 @@ class PrivateLinkResourceListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + "value": {"key": "value", "type": "[PrivateLinkResource]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: Array of private link resources. :paramtype value: list[~azure.mgmt.machinelearningservices.models.PrivateLinkResource] """ super(PrivateLinkResourceListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class PrivateLinkServiceConnectionState(msrest.serialization.Model): @@ -22934,15 +23448,12 @@ class PrivateLinkServiceConnectionState(msrest.serialization.Model): """ _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + "status": {"key": "status", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "actions_required": {"key": "actionsRequired", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword status: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Possible values include: "Pending", "Approved", "Rejected", @@ -22956,12 +23467,14 @@ def __init__( :paramtype actions_required: str """ super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.description = kwargs.get('description', None) - self.actions_required = kwargs.get('actions_required', None) + self.status = kwargs.get("status", None) + self.description = kwargs.get("description", None) + self.actions_required = kwargs.get("actions_required", None) -class PrivateLinkServiceConnectionStateAutoGenerated(msrest.serialization.Model): +class PrivateLinkServiceConnectionStateAutoGenerated( + msrest.serialization.Model +): """The connection state. :ivar actions_required: Some RP chose "None". Other RPs use this for region expansion. @@ -22976,15 +23489,12 @@ class PrivateLinkServiceConnectionStateAutoGenerated(msrest.serialization.Model) """ _attribute_map = { - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, + "actions_required": {"key": "actionsRequired", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "status": {"key": "status", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword actions_required: Some RP chose "None". Other RPs use this for region expansion. :paramtype actions_required: str @@ -22996,10 +23506,12 @@ def __init__( :paramtype status: str or ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus """ - super(PrivateLinkServiceConnectionStateAutoGenerated, self).__init__(**kwargs) - self.actions_required = kwargs.get('actions_required', None) - self.description = kwargs.get('description', None) - self.status = kwargs.get('status', None) + super(PrivateLinkServiceConnectionStateAutoGenerated, self).__init__( + **kwargs + ) + self.actions_required = kwargs.get("actions_required", None) + self.description = kwargs.get("description", None) + self.status = kwargs.get("status", None) class ProbeSettings(msrest.serialization.Model): @@ -23018,17 +23530,14 @@ class ProbeSettings(msrest.serialization.Model): """ _attribute_map = { - 'failure_threshold': {'key': 'failureThreshold', 'type': 'int'}, - 'initial_delay': {'key': 'initialDelay', 'type': 'duration'}, - 'period': {'key': 'period', 'type': 'duration'}, - 'success_threshold': {'key': 'successThreshold', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "failure_threshold": {"key": "failureThreshold", "type": "int"}, + "initial_delay": {"key": "initialDelay", "type": "duration"}, + "period": {"key": "period", "type": "duration"}, + "success_threshold": {"key": "successThreshold", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword failure_threshold: The number of failures to allow before returning an unhealthy status. @@ -23043,11 +23552,11 @@ def __init__( :paramtype timeout: ~datetime.timedelta """ super(ProbeSettings, self).__init__(**kwargs) - self.failure_threshold = kwargs.get('failure_threshold', 30) - self.initial_delay = kwargs.get('initial_delay', None) - self.period = kwargs.get('period', "PT10S") - self.success_threshold = kwargs.get('success_threshold', 1) - self.timeout = kwargs.get('timeout', "PT2S") + self.failure_threshold = kwargs.get("failure_threshold", 30) + self.initial_delay = kwargs.get("initial_delay", None) + self.period = kwargs.get("period", "PT10S") + self.success_threshold = kwargs.get("success_threshold", 1) + self.timeout = kwargs.get("timeout", "PT2S") class ProgressMetrics(msrest.serialization.Model): @@ -23067,25 +23576,33 @@ class ProgressMetrics(msrest.serialization.Model): """ _validation = { - 'completed_datapoint_count': {'readonly': True}, - 'incremental_data_last_refresh_date_time': {'readonly': True}, - 'skipped_datapoint_count': {'readonly': True}, - 'total_datapoint_count': {'readonly': True}, + "completed_datapoint_count": {"readonly": True}, + "incremental_data_last_refresh_date_time": {"readonly": True}, + "skipped_datapoint_count": {"readonly": True}, + "total_datapoint_count": {"readonly": True}, } _attribute_map = { - 'completed_datapoint_count': {'key': 'completedDatapointCount', 'type': 'long'}, - 'incremental_data_last_refresh_date_time': {'key': 'incrementalDataLastRefreshDateTime', 'type': 'iso-8601'}, - 'skipped_datapoint_count': {'key': 'skippedDatapointCount', 'type': 'long'}, - 'total_datapoint_count': {'key': 'totalDatapointCount', 'type': 'long'}, + "completed_datapoint_count": { + "key": "completedDatapointCount", + "type": "long", + }, + "incremental_data_last_refresh_date_time": { + "key": "incrementalDataLastRefreshDateTime", + "type": "iso-8601", + }, + "skipped_datapoint_count": { + "key": "skippedDatapointCount", + "type": "long", + }, + "total_datapoint_count": { + "key": "totalDatapointCount", + "type": "long", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ProgressMetrics, self).__init__(**kwargs) self.completed_datapoint_count = None self.incremental_data_last_refresh_date_time = None @@ -23107,25 +23624,27 @@ class PyTorch(DistributionConfiguration): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, + "distribution_type": {"key": "distributionType", "type": "str"}, + "process_count_per_instance": { + "key": "processCountPerInstance", + "type": "int", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword process_count_per_instance: Number of processes per node. :paramtype process_count_per_instance: int """ super(PyTorch, self).__init__(**kwargs) - self.distribution_type = 'PyTorch' # type: str - self.process_count_per_instance = kwargs.get('process_count_per_instance', None) + self.distribution_type = "PyTorch" # type: str + self.process_count_per_instance = kwargs.get( + "process_count_per_instance", None + ) class QueueSettings(msrest.serialization.Model): @@ -23139,14 +23658,11 @@ class QueueSettings(msrest.serialization.Model): """ _attribute_map = { - 'job_tier': {'key': 'jobTier', 'type': 'str'}, - 'priority': {'key': 'priority', 'type': 'int'}, + "job_tier": {"key": "jobTier", "type": "str"}, + "priority": {"key": "priority", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword job_tier: Enum to determine the job tier. Possible values include: "Spot", "Basic", "Standard", "Premium". @@ -23155,8 +23671,8 @@ def __init__( :paramtype priority: int """ super(QueueSettings, self).__init__(**kwargs) - self.job_tier = kwargs.get('job_tier', None) - self.priority = kwargs.get('priority', None) + self.job_tier = kwargs.get("job_tier", None) + self.priority = kwargs.get("priority", None) class QuotaBaseProperties(msrest.serialization.Model): @@ -23173,16 +23689,13 @@ class QuotaBaseProperties(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "limit": {"key": "limit", "type": "long"}, + "unit": {"key": "unit", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword id: Specifies the resource ID. :paramtype id: str @@ -23195,10 +23708,10 @@ def __init__( :paramtype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit """ super(QuotaBaseProperties, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.type = kwargs.get('type', None) - self.limit = kwargs.get('limit', None) - self.unit = kwargs.get('unit', None) + self.id = kwargs.get("id", None) + self.type = kwargs.get("type", None) + self.limit = kwargs.get("limit", None) + self.unit = kwargs.get("unit", None) class QuotaUpdateParameters(msrest.serialization.Model): @@ -23211,14 +23724,11 @@ class QuotaUpdateParameters(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[QuotaBaseProperties]'}, - 'location': {'key': 'location', 'type': 'str'}, + "value": {"key": "value", "type": "[QuotaBaseProperties]"}, + "location": {"key": "location", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: The list for update quota. :paramtype value: list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] @@ -23226,8 +23736,8 @@ def __init__( :paramtype location: str """ super(QuotaUpdateParameters, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.location = kwargs.get('location', None) + self.value = kwargs.get("value", None) + self.location = kwargs.get("location", None) class RandomSamplingAlgorithm(SamplingAlgorithm): @@ -23250,20 +23760,20 @@ class RandomSamplingAlgorithm(SamplingAlgorithm): """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - 'logbase': {'key': 'logbase', 'type': 'str'}, - 'rule': {'key': 'rule', 'type': 'str'}, - 'seed': {'key': 'seed', 'type': 'int'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, + "logbase": {"key": "logbase", "type": "str"}, + "rule": {"key": "rule", "type": "str"}, + "seed": {"key": "seed", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword logbase: An optional positive number or e in string format to be used as base for log based random sampling. @@ -23275,10 +23785,10 @@ def __init__( :paramtype seed: int """ super(RandomSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Random' # type: str - self.logbase = kwargs.get('logbase', None) - self.rule = kwargs.get('rule', None) - self.seed = kwargs.get('seed', None) + self.sampling_algorithm_type = "Random" # type: str + self.logbase = kwargs.get("logbase", None) + self.rule = kwargs.get("rule", None) + self.seed = kwargs.get("seed", None) class Ray(DistributionConfiguration): @@ -23305,23 +23815,26 @@ class Ray(DistributionConfiguration): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'address': {'key': 'address', 'type': 'str'}, - 'dashboard_port': {'key': 'dashboardPort', 'type': 'int'}, - 'head_node_additional_args': {'key': 'headNodeAdditionalArgs', 'type': 'str'}, - 'include_dashboard': {'key': 'includeDashboard', 'type': 'bool'}, - 'port': {'key': 'port', 'type': 'int'}, - 'worker_node_additional_args': {'key': 'workerNodeAdditionalArgs', 'type': 'str'}, + "distribution_type": {"key": "distributionType", "type": "str"}, + "address": {"key": "address", "type": "str"}, + "dashboard_port": {"key": "dashboardPort", "type": "int"}, + "head_node_additional_args": { + "key": "headNodeAdditionalArgs", + "type": "str", + }, + "include_dashboard": {"key": "includeDashboard", "type": "bool"}, + "port": {"key": "port", "type": "int"}, + "worker_node_additional_args": { + "key": "workerNodeAdditionalArgs", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword address: The address of Ray head node. :paramtype address: str @@ -23337,13 +23850,17 @@ def __init__( :paramtype worker_node_additional_args: str """ super(Ray, self).__init__(**kwargs) - self.distribution_type = 'Ray' # type: str - self.address = kwargs.get('address', None) - self.dashboard_port = kwargs.get('dashboard_port', None) - self.head_node_additional_args = kwargs.get('head_node_additional_args', None) - self.include_dashboard = kwargs.get('include_dashboard', None) - self.port = kwargs.get('port', None) - self.worker_node_additional_args = kwargs.get('worker_node_additional_args', None) + self.distribution_type = "Ray" # type: str + self.address = kwargs.get("address", None) + self.dashboard_port = kwargs.get("dashboard_port", None) + self.head_node_additional_args = kwargs.get( + "head_node_additional_args", None + ) + self.include_dashboard = kwargs.get("include_dashboard", None) + self.port = kwargs.get("port", None) + self.worker_node_additional_args = kwargs.get( + "worker_node_additional_args", None + ) class Recurrence(msrest.serialization.Model): @@ -23365,17 +23882,14 @@ class Recurrence(msrest.serialization.Model): """ _attribute_map = { - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceSchedule'}, + "frequency": {"key": "frequency", "type": "str"}, + "interval": {"key": "interval", "type": "int"}, + "start_time": {"key": "startTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "schedule": {"key": "schedule", "type": "RecurrenceSchedule"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword frequency: [Required] The frequency to trigger schedule. Possible values include: "Minute", "Hour", "Day", "Week", "Month". @@ -23392,11 +23906,11 @@ def __init__( :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule """ super(Recurrence, self).__init__(**kwargs) - self.frequency = kwargs.get('frequency', None) - self.interval = kwargs.get('interval', None) - self.start_time = kwargs.get('start_time', None) - self.time_zone = kwargs.get('time_zone', "UTC") - self.schedule = kwargs.get('schedule', None) + self.frequency = kwargs.get("frequency", None) + self.interval = kwargs.get("interval", None) + self.start_time = kwargs.get("start_time", None) + self.time_zone = kwargs.get("time_zone", "UTC") + self.schedule = kwargs.get("schedule", None) class RecurrenceSchedule(msrest.serialization.Model): @@ -23415,21 +23929,18 @@ class RecurrenceSchedule(msrest.serialization.Model): """ _validation = { - 'hours': {'required': True}, - 'minutes': {'required': True}, + "hours": {"required": True}, + "minutes": {"required": True}, } _attribute_map = { - 'hours': {'key': 'hours', 'type': '[int]'}, - 'minutes': {'key': 'minutes', 'type': '[int]'}, - 'month_days': {'key': 'monthDays', 'type': '[int]'}, - 'week_days': {'key': 'weekDays', 'type': '[str]'}, + "hours": {"key": "hours", "type": "[int]"}, + "minutes": {"key": "minutes", "type": "[int]"}, + "month_days": {"key": "monthDays", "type": "[int]"}, + "week_days": {"key": "weekDays", "type": "[str]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword hours: Required. [Required] List of hours for the schedule. :paramtype hours: list[int] @@ -23441,10 +23952,10 @@ def __init__( :paramtype week_days: list[str or ~azure.mgmt.machinelearningservices.models.WeekDay] """ super(RecurrenceSchedule, self).__init__(**kwargs) - self.hours = kwargs['hours'] - self.minutes = kwargs['minutes'] - self.month_days = kwargs.get('month_days', None) - self.week_days = kwargs.get('week_days', None) + self.hours = kwargs["hours"] + self.minutes = kwargs["minutes"] + self.month_days = kwargs.get("month_days", None) + self.week_days = kwargs.get("week_days", None) class RecurrenceTrigger(TriggerBase): @@ -23477,25 +23988,22 @@ class RecurrenceTrigger(TriggerBase): """ _validation = { - 'trigger_type': {'required': True}, - 'frequency': {'required': True}, - 'interval': {'required': True}, + "trigger_type": {"required": True}, + "frequency": {"required": True}, + "interval": {"required": True}, } _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceSchedule'}, + "end_time": {"key": "endTime", "type": "str"}, + "start_time": {"key": "startTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "trigger_type": {"key": "triggerType", "type": "str"}, + "frequency": {"key": "frequency", "type": "str"}, + "interval": {"key": "interval", "type": "int"}, + "schedule": {"key": "schedule", "type": "RecurrenceSchedule"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword end_time: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer https://en.wikipedia.org/wiki/ISO_8601. @@ -23519,10 +24027,10 @@ def __init__( :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule """ super(RecurrenceTrigger, self).__init__(**kwargs) - self.trigger_type = 'Recurrence' # type: str - self.frequency = kwargs['frequency'] - self.interval = kwargs['interval'] - self.schedule = kwargs.get('schedule', None) + self.trigger_type = "Recurrence" # type: str + self.frequency = kwargs["frequency"] + self.interval = kwargs["interval"] + self.schedule = kwargs.get("schedule", None) class RegenerateEndpointKeysRequest(msrest.serialization.Model): @@ -23538,18 +24046,15 @@ class RegenerateEndpointKeysRequest(msrest.serialization.Model): """ _validation = { - 'key_type': {'required': True}, + "key_type": {"required": True}, } _attribute_map = { - 'key_type': {'key': 'keyType', 'type': 'str'}, - 'key_value': {'key': 'keyValue', 'type': 'str'}, + "key_type": {"key": "keyType", "type": "str"}, + "key_value": {"key": "keyValue", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword key_type: Required. [Required] Specification for which type of key to generate. Primary or Secondary. Possible values include: "Primary", "Secondary". @@ -23558,8 +24063,8 @@ def __init__( :paramtype key_value: str """ super(RegenerateEndpointKeysRequest, self).__init__(**kwargs) - self.key_type = kwargs['key_type'] - self.key_value = kwargs.get('key_value', None) + self.key_type = kwargs["key_type"] + self.key_value = kwargs.get("key_value", None) class Registry(TrackedResource): @@ -23613,36 +24118,51 @@ class Registry(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, - 'intellectual_property_publisher': {'key': 'properties.intellectualPropertyPublisher', 'type': 'str'}, - 'managed_resource_group': {'key': 'properties.managedResourceGroup', 'type': 'ArmResourceId'}, - 'ml_flow_registry_uri': {'key': 'properties.mlFlowRegistryUri', 'type': 'str'}, - 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnectionAutoGenerated]'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'region_details': {'key': 'properties.regionDetails', 'type': '[RegistryRegionArmDetails]'}, - } - - def __init__( - self, - **kwargs - ): + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "sku": {"key": "sku", "type": "Sku"}, + "discovery_url": {"key": "properties.discoveryUrl", "type": "str"}, + "intellectual_property_publisher": { + "key": "properties.intellectualPropertyPublisher", + "type": "str", + }, + "managed_resource_group": { + "key": "properties.managedResourceGroup", + "type": "ArmResourceId", + }, + "ml_flow_registry_uri": { + "key": "properties.mlFlowRegistryUri", + "type": "str", + }, + "private_endpoint_connections": { + "key": "properties.privateEndpointConnections", + "type": "[PrivateEndpointConnectionAutoGenerated]", + }, + "public_network_access": { + "key": "properties.publicNetworkAccess", + "type": "str", + }, + "region_details": { + "key": "properties.regionDetails", + "type": "[RegistryRegionArmDetails]", + }, + } + + def __init__(self, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -23676,16 +24196,22 @@ def __init__( list[~azure.mgmt.machinelearningservices.models.RegistryRegionArmDetails] """ super(Registry, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.kind = kwargs.get('kind', None) - self.sku = kwargs.get('sku', None) - self.discovery_url = kwargs.get('discovery_url', None) - self.intellectual_property_publisher = kwargs.get('intellectual_property_publisher', None) - self.managed_resource_group = kwargs.get('managed_resource_group', None) - self.ml_flow_registry_uri = kwargs.get('ml_flow_registry_uri', None) - self.private_endpoint_connections = kwargs.get('private_endpoint_connections', None) - self.public_network_access = kwargs.get('public_network_access', None) - self.region_details = kwargs.get('region_details', None) + self.identity = kwargs.get("identity", None) + self.kind = kwargs.get("kind", None) + self.sku = kwargs.get("sku", None) + self.discovery_url = kwargs.get("discovery_url", None) + self.intellectual_property_publisher = kwargs.get( + "intellectual_property_publisher", None + ) + self.managed_resource_group = kwargs.get( + "managed_resource_group", None + ) + self.ml_flow_registry_uri = kwargs.get("ml_flow_registry_uri", None) + self.private_endpoint_connections = kwargs.get( + "private_endpoint_connections", None + ) + self.public_network_access = kwargs.get("public_network_access", None) + self.region_details = kwargs.get("region_details", None) class RegistryListCredentialsResult(msrest.serialization.Model): @@ -23702,20 +24228,17 @@ class RegistryListCredentialsResult(msrest.serialization.Model): """ _validation = { - 'location': {'readonly': True}, - 'username': {'readonly': True}, + "location": {"readonly": True}, + "username": {"readonly": True}, } _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'username': {'key': 'username', 'type': 'str'}, - 'passwords': {'key': 'passwords', 'type': '[Password]'}, + "location": {"key": "location", "type": "str"}, + "username": {"key": "username", "type": "str"}, + "passwords": {"key": "passwords", "type": "[Password]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword passwords: :paramtype passwords: list[~azure.mgmt.machinelearningservices.models.Password] @@ -23723,7 +24246,7 @@ def __init__( super(RegistryListCredentialsResult, self).__init__(**kwargs) self.location = None self.username = None - self.passwords = kwargs.get('passwords', None) + self.passwords = kwargs.get("passwords", None) class RegistryRegionArmDetails(msrest.serialization.Model): @@ -23739,15 +24262,15 @@ class RegistryRegionArmDetails(msrest.serialization.Model): """ _attribute_map = { - 'acr_details': {'key': 'acrDetails', 'type': '[AcrDetails]'}, - 'location': {'key': 'location', 'type': 'str'}, - 'storage_account_details': {'key': 'storageAccountDetails', 'type': '[StorageAccountDetails]'}, + "acr_details": {"key": "acrDetails", "type": "[AcrDetails]"}, + "location": {"key": "location", "type": "str"}, + "storage_account_details": { + "key": "storageAccountDetails", + "type": "[StorageAccountDetails]", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword acr_details: List of ACR accounts. :paramtype acr_details: list[~azure.mgmt.machinelearningservices.models.AcrDetails] @@ -23758,9 +24281,11 @@ def __init__( list[~azure.mgmt.machinelearningservices.models.StorageAccountDetails] """ super(RegistryRegionArmDetails, self).__init__(**kwargs) - self.acr_details = kwargs.get('acr_details', None) - self.location = kwargs.get('location', None) - self.storage_account_details = kwargs.get('storage_account_details', None) + self.acr_details = kwargs.get("acr_details", None) + self.location = kwargs.get("location", None) + self.storage_account_details = kwargs.get( + "storage_account_details", None + ) class RegistryTrackedResourceArmPaginatedResult(msrest.serialization.Model): @@ -23774,14 +24299,11 @@ class RegistryTrackedResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Registry]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[Registry]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of Registry objects. If null, there are no additional pages. @@ -23789,9 +24311,11 @@ def __init__( :keyword value: An array of objects of type Registry. :paramtype value: list[~azure.mgmt.machinelearningservices.models.Registry] """ - super(RegistryTrackedResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + super(RegistryTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class Regression(AutoMLVertical, TableVertical): @@ -23858,35 +24382,59 @@ class Regression(AutoMLVertical, TableVertical): """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'RegressionTrainingSettings'}, - } - - def __init__( - self, - **kwargs - ): + "task_type": {"required": True}, + "training_data": {"required": True}, + } + + _attribute_map = { + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "TableFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "search_space": { + "key": "searchSpace", + "type": "[TableParameterSubspace]", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "TableSweepSettings", + }, + "test_data": {"key": "testData", "type": "MLTableJobInput"}, + "test_data_size": {"key": "testDataSize", "type": "float"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "weight_column_name": {"key": "weightColumnName", "type": "str"}, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, + "training_settings": { + "key": "trainingSettings", + "type": "RegressionTrainingSettings", + }, + } + + def __init__(self, **kwargs): """ :keyword cv_split_column_names: Columns to use for CVSplit data. :paramtype cv_split_column_names: list[str] @@ -23944,27 +24492,31 @@ def __init__( ~azure.mgmt.machinelearningservices.models.RegressionTrainingSettings """ super(Regression, self).__init__(**kwargs) - self.cv_split_column_names = kwargs.get('cv_split_column_names', None) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.n_cross_validations = kwargs.get('n_cross_validations', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.test_data = kwargs.get('test_data', None) - self.test_data_size = kwargs.get('test_data_size', None) - self.validation_data = kwargs.get('validation_data', None) - self.validation_data_size = kwargs.get('validation_data_size', None) - self.weight_column_name = kwargs.get('weight_column_name', None) - self.task_type = 'Regression' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.training_settings = kwargs.get('training_settings', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] - - -class RegressionModelPerformanceMetricThreshold(ModelPerformanceMetricThresholdBase): + self.cv_split_column_names = kwargs.get("cv_split_column_names", None) + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.fixed_parameters = kwargs.get("fixed_parameters", None) + self.limit_settings = kwargs.get("limit_settings", None) + self.n_cross_validations = kwargs.get("n_cross_validations", None) + self.search_space = kwargs.get("search_space", None) + self.sweep_settings = kwargs.get("sweep_settings", None) + self.test_data = kwargs.get("test_data", None) + self.test_data_size = kwargs.get("test_data_size", None) + self.validation_data = kwargs.get("validation_data", None) + self.validation_data_size = kwargs.get("validation_data_size", None) + self.weight_column_name = kwargs.get("weight_column_name", None) + self.task_type = "Regression" # type: str + self.primary_metric = kwargs.get("primary_metric", None) + self.training_settings = kwargs.get("training_settings", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] + + +class RegressionModelPerformanceMetricThreshold( + ModelPerformanceMetricThresholdBase +): """RegressionModelPerformanceMetricThreshold. All required parameters must be populated in order to send to Azure. @@ -23982,20 +24534,17 @@ class RegressionModelPerformanceMetricThreshold(ModelPerformanceMetricThresholdB """ _validation = { - 'model_type': {'required': True}, - 'metric': {'required': True}, + "model_type": {"required": True}, + "metric": {"required": True}, } _attribute_map = { - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, + "model_type": {"key": "modelType", "type": "str"}, + "threshold": {"key": "threshold", "type": "MonitoringThreshold"}, + "metric": {"key": "metric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword threshold: The threshold value. If null, a default value will be set depending on the selected metric. @@ -24005,9 +24554,11 @@ def __init__( :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.RegressionModelPerformanceMetric """ - super(RegressionModelPerformanceMetricThreshold, self).__init__(**kwargs) - self.model_type = 'Regression' # type: str - self.metric = kwargs['metric'] + super(RegressionModelPerformanceMetricThreshold, self).__init__( + **kwargs + ) + self.model_type = "Regression" # type: str + self.metric = kwargs["metric"] class RegressionTrainingSettings(TrainingSettings): @@ -24047,22 +24598,40 @@ class RegressionTrainingSettings(TrainingSettings): """ _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): + "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, + "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, + "training_mode": {"key": "trainingMode", "type": "str"}, + "allowed_training_algorithms": { + "key": "allowedTrainingAlgorithms", + "type": "[str]", + }, + "blocked_training_algorithms": { + "key": "blockedTrainingAlgorithms", + "type": "[str]", + }, + } + + def __init__(self, **kwargs): """ :keyword enable_dnn_training: Enable recommendation of DNN models. :paramtype enable_dnn_training: bool @@ -24097,8 +24666,12 @@ def __init__( ~azure.mgmt.machinelearningservices.models.RegressionModels] """ super(RegressionTrainingSettings, self).__init__(**kwargs) - self.allowed_training_algorithms = kwargs.get('allowed_training_algorithms', None) - self.blocked_training_algorithms = kwargs.get('blocked_training_algorithms', None) + self.allowed_training_algorithms = kwargs.get( + "allowed_training_algorithms", None + ) + self.blocked_training_algorithms = kwargs.get( + "blocked_training_algorithms", None + ) class RequestLogging(msrest.serialization.Model): @@ -24111,13 +24684,10 @@ class RequestLogging(msrest.serialization.Model): """ _attribute_map = { - 'capture_headers': {'key': 'captureHeaders', 'type': '[str]'}, + "capture_headers": {"key": "captureHeaders", "type": "[str]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword capture_headers: For payload logging, we only collect payload by default. If customers also want to collect the specified headers, they can set them in captureHeaders so that backend @@ -24125,7 +24695,7 @@ def __init__( :paramtype capture_headers: list[str] """ super(RequestLogging, self).__init__(**kwargs) - self.capture_headers = kwargs.get('capture_headers', None) + self.capture_headers = kwargs.get("capture_headers", None) class ResourceId(msrest.serialization.Model): @@ -24138,23 +24708,20 @@ class ResourceId(msrest.serialization.Model): """ _validation = { - 'id': {'required': True}, + "id": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword id: Required. The ID of the resource. :paramtype id: str """ super(ResourceId, self).__init__(**kwargs) - self.id = kwargs['id'] + self.id = kwargs["id"] class ResourceName(msrest.serialization.Model): @@ -24169,21 +24736,17 @@ class ResourceName(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, + "value": {"readonly": True}, + "localized_value": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + "value": {"key": "value", "type": "str"}, + "localized_value": {"key": "localizedValue", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ResourceName, self).__init__(**kwargs) self.value = None self.localized_value = None @@ -24209,29 +24772,28 @@ class ResourceQuota(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'name': {'readonly': True}, - 'limit': {'readonly': True}, - 'unit': {'readonly': True}, + "id": {"readonly": True}, + "aml_workspace_location": {"readonly": True}, + "type": {"readonly": True}, + "name": {"readonly": True}, + "limit": {"readonly": True}, + "unit": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'ResourceName'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "aml_workspace_location": { + "key": "amlWorkspaceLocation", + "type": "str", + }, + "type": {"key": "type", "type": "str"}, + "name": {"key": "name", "type": "ResourceName"}, + "limit": {"key": "limit", "type": "long"}, + "unit": {"key": "unit", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ResourceQuota, self).__init__(**kwargs) self.id = None self.aml_workspace_location = None @@ -24253,19 +24815,20 @@ class Route(msrest.serialization.Model): """ _validation = { - 'path': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'port': {'required': True}, + "path": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "port": {"required": True}, } _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, + "path": {"key": "path", "type": "str"}, + "port": {"key": "port", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword path: Required. [Required] The path for the route. :paramtype path: str @@ -24273,11 +24836,13 @@ def __init__( :paramtype port: int """ super(Route, self).__init__(**kwargs) - self.path = kwargs['path'] - self.port = kwargs['port'] + self.path = kwargs["path"] + self.port = kwargs["port"] -class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class SASAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """SASAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -24304,23 +24869,23 @@ class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionSharedAccessSignature'}, + "auth_type": {"key": "authType", "type": "str"}, + "expiry_time": {"key": "expiryTime", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionSharedAccessSignature", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword expiry_time: :paramtype expiry_time: str @@ -24339,9 +24904,11 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature """ - super(SASAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'SAS' # type: str - self.credentials = kwargs.get('credentials', None) + super(SASAuthTypeWorkspaceConnectionProperties, self).__init__( + **kwargs + ) + self.auth_type = "SAS" # type: str + self.credentials = kwargs.get("credentials", None) class SASCredentialDto(PendingUploadCredentialDto): @@ -24358,25 +24925,22 @@ class SASCredentialDto(PendingUploadCredentialDto): """ _validation = { - 'credential_type': {'required': True}, + "credential_type": {"required": True}, } _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - 'sas_uri': {'key': 'sasUri', 'type': 'str'}, + "credential_type": {"key": "credentialType", "type": "str"}, + "sas_uri": {"key": "sasUri", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. :paramtype sas_uri: str """ super(SASCredentialDto, self).__init__(**kwargs) - self.credential_type = 'SAS' # type: str - self.sas_uri = kwargs.get('sas_uri', None) + self.credential_type = "SAS" # type: str + self.sas_uri = kwargs.get("sas_uri", None) class SasDatastoreCredentials(DatastoreCredentials): @@ -24393,26 +24957,23 @@ class SasDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, + "credentials_type": {"required": True}, + "secrets": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'SasDatastoreSecrets'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "secrets": {"key": "secrets", "type": "SasDatastoreSecrets"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword secrets: Required. [Required] Storage container secrets. :paramtype secrets: ~azure.mgmt.machinelearningservices.models.SasDatastoreSecrets """ super(SasDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Sas' # type: str - self.secrets = kwargs['secrets'] + self.credentials_type = "Sas" # type: str + self.secrets = kwargs["secrets"] class SasDatastoreSecrets(DatastoreSecrets): @@ -24429,25 +24990,22 @@ class SasDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'sas_token': {'key': 'sasToken', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "sas_token": {"key": "sasToken", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword sas_token: Storage container SAS token. :paramtype sas_token: str """ super(SasDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Sas' # type: str - self.sas_token = kwargs.get('sas_token', None) + self.secrets_type = "Sas" # type: str + self.sas_token = kwargs.get("sas_token", None) class ScaleSettings(msrest.serialization.Model): @@ -24465,19 +25023,19 @@ class ScaleSettings(msrest.serialization.Model): """ _validation = { - 'max_node_count': {'required': True}, + "max_node_count": {"required": True}, } _attribute_map = { - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'node_idle_time_before_scale_down': {'key': 'nodeIdleTimeBeforeScaleDown', 'type': 'duration'}, + "max_node_count": {"key": "maxNodeCount", "type": "int"}, + "min_node_count": {"key": "minNodeCount", "type": "int"}, + "node_idle_time_before_scale_down": { + "key": "nodeIdleTimeBeforeScaleDown", + "type": "duration", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword max_node_count: Required. Max number of nodes to use. :paramtype max_node_count: int @@ -24488,9 +25046,11 @@ def __init__( :paramtype node_idle_time_before_scale_down: ~datetime.timedelta """ super(ScaleSettings, self).__init__(**kwargs) - self.max_node_count = kwargs['max_node_count'] - self.min_node_count = kwargs.get('min_node_count', 0) - self.node_idle_time_before_scale_down = kwargs.get('node_idle_time_before_scale_down', None) + self.max_node_count = kwargs["max_node_count"] + self.min_node_count = kwargs.get("min_node_count", 0) + self.node_idle_time_before_scale_down = kwargs.get( + "node_idle_time_before_scale_down", None + ) class ScaleSettingsInformation(msrest.serialization.Model): @@ -24501,19 +25061,16 @@ class ScaleSettingsInformation(msrest.serialization.Model): """ _attribute_map = { - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, + "scale_settings": {"key": "scaleSettings", "type": "ScaleSettings"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword scale_settings: scale settings for AML Compute. :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings """ super(ScaleSettingsInformation, self).__init__(**kwargs) - self.scale_settings = kwargs.get('scale_settings', None) + self.scale_settings = kwargs.get("scale_settings", None) class Schedule(Resource): @@ -24539,31 +25096,28 @@ class Schedule(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ScheduleProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "ScheduleProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ScheduleProperties """ super(Schedule, self).__init__(**kwargs) - self.properties = kwargs['properties'] + self.properties = kwargs["properties"] class ScheduleBase(msrest.serialization.Model): @@ -24581,15 +25135,12 @@ class ScheduleBase(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "provisioning_status": {"key": "provisioningStatus", "type": "str"}, + "status": {"key": "status", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword id: A system assigned id for the schedule. :paramtype id: str @@ -24602,9 +25153,9 @@ def __init__( :paramtype status: str or ~azure.mgmt.machinelearningservices.models.ScheduleStatus """ super(ScheduleBase, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.provisioning_status = kwargs.get('provisioning_status', None) - self.status = kwargs.get('status', None) + self.id = kwargs.get("id", None) + self.provisioning_status = kwargs.get("provisioning_status", None) + self.status = kwargs.get("status", None) class ScheduleProperties(ResourceBase): @@ -24635,26 +25186,23 @@ class ScheduleProperties(ResourceBase): """ _validation = { - 'action': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'trigger': {'required': True}, + "action": {"required": True}, + "provisioning_state": {"readonly": True}, + "trigger": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'action': {'key': 'action', 'type': 'ScheduleActionBase'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'trigger': {'key': 'trigger', 'type': 'TriggerBase'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "action": {"key": "action", "type": "ScheduleActionBase"}, + "display_name": {"key": "displayName", "type": "str"}, + "is_enabled": {"key": "isEnabled", "type": "bool"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "trigger": {"key": "trigger", "type": "TriggerBase"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -24672,11 +25220,11 @@ def __init__( :paramtype trigger: ~azure.mgmt.machinelearningservices.models.TriggerBase """ super(ScheduleProperties, self).__init__(**kwargs) - self.action = kwargs['action'] - self.display_name = kwargs.get('display_name', None) - self.is_enabled = kwargs.get('is_enabled', True) + self.action = kwargs["action"] + self.display_name = kwargs.get("display_name", None) + self.is_enabled = kwargs.get("is_enabled", True) self.provisioning_state = None - self.trigger = kwargs['trigger'] + self.trigger = kwargs["trigger"] class ScheduleResourceArmPaginatedResult(msrest.serialization.Model): @@ -24690,14 +25238,11 @@ class ScheduleResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Schedule]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[Schedule]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of Schedule objects. If null, there are no additional pages. @@ -24706,8 +25251,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.Schedule] """ super(ScheduleResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class ScriptReference(msrest.serialization.Model): @@ -24724,16 +25269,13 @@ class ScriptReference(msrest.serialization.Model): """ _attribute_map = { - 'script_source': {'key': 'scriptSource', 'type': 'str'}, - 'script_data': {'key': 'scriptData', 'type': 'str'}, - 'script_arguments': {'key': 'scriptArguments', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'str'}, + "script_source": {"key": "scriptSource", "type": "str"}, + "script_data": {"key": "scriptData", "type": "str"}, + "script_arguments": {"key": "scriptArguments", "type": "str"}, + "timeout": {"key": "timeout", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword script_source: The storage source of the script: inline, workspace. :paramtype script_source: str @@ -24745,10 +25287,10 @@ def __init__( :paramtype timeout: str """ super(ScriptReference, self).__init__(**kwargs) - self.script_source = kwargs.get('script_source', None) - self.script_data = kwargs.get('script_data', None) - self.script_arguments = kwargs.get('script_arguments', None) - self.timeout = kwargs.get('timeout', None) + self.script_source = kwargs.get("script_source", None) + self.script_data = kwargs.get("script_data", None) + self.script_arguments = kwargs.get("script_arguments", None) + self.timeout = kwargs.get("timeout", None) class ScriptsToExecute(msrest.serialization.Model): @@ -24761,14 +25303,14 @@ class ScriptsToExecute(msrest.serialization.Model): """ _attribute_map = { - 'startup_script': {'key': 'startupScript', 'type': 'ScriptReference'}, - 'creation_script': {'key': 'creationScript', 'type': 'ScriptReference'}, + "startup_script": {"key": "startupScript", "type": "ScriptReference"}, + "creation_script": { + "key": "creationScript", + "type": "ScriptReference", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword startup_script: Script that's run every time the machine starts. :paramtype startup_script: ~azure.mgmt.machinelearningservices.models.ScriptReference @@ -24776,8 +25318,8 @@ def __init__( :paramtype creation_script: ~azure.mgmt.machinelearningservices.models.ScriptReference """ super(ScriptsToExecute, self).__init__(**kwargs) - self.startup_script = kwargs.get('startup_script', None) - self.creation_script = kwargs.get('creation_script', None) + self.startup_script = kwargs.get("startup_script", None) + self.creation_script = kwargs.get("creation_script", None) class SecretConfiguration(msrest.serialization.Model): @@ -24791,14 +25333,11 @@ class SecretConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'uri': {'key': 'uri', 'type': 'str'}, - 'workspace_secret_name': {'key': 'workspaceSecretName', 'type': 'str'}, + "uri": {"key": "uri", "type": "str"}, + "workspace_secret_name": {"key": "workspaceSecretName", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword uri: Secret Uri. Sample Uri : https://myvault.vault.azure.net/secrets/mysecretname/secretversion. @@ -24807,8 +25346,8 @@ def __init__( :paramtype workspace_secret_name: str """ super(SecretConfiguration, self).__init__(**kwargs) - self.uri = kwargs.get('uri', None) - self.workspace_secret_name = kwargs.get('workspace_secret_name', None) + self.uri = kwargs.get("uri", None) + self.workspace_secret_name = kwargs.get("workspace_secret_name", None) class ServiceManagedResourcesSettings(msrest.serialization.Model): @@ -24819,22 +25358,21 @@ class ServiceManagedResourcesSettings(msrest.serialization.Model): """ _attribute_map = { - 'cosmos_db': {'key': 'cosmosDb', 'type': 'CosmosDbSettings'}, + "cosmos_db": {"key": "cosmosDb", "type": "CosmosDbSettings"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword cosmos_db: The settings for the service managed cosmosdb account. :paramtype cosmos_db: ~azure.mgmt.machinelearningservices.models.CosmosDbSettings """ super(ServiceManagedResourcesSettings, self).__init__(**kwargs) - self.cosmos_db = kwargs.get('cosmos_db', None) + self.cosmos_db = kwargs.get("cosmos_db", None) -class ServicePrincipalAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class ServicePrincipalAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """ServicePrincipalAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -24861,23 +25399,23 @@ class ServicePrincipalAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionP """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionServicePrincipal'}, + "auth_type": {"key": "authType", "type": "str"}, + "expiry_time": {"key": "expiryTime", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionServicePrincipal", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword expiry_time: :paramtype expiry_time: str @@ -24896,9 +25434,11 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionServicePrincipal """ - super(ServicePrincipalAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'ServicePrincipal' # type: str - self.credentials = kwargs.get('credentials', None) + super( + ServicePrincipalAuthTypeWorkspaceConnectionProperties, self + ).__init__(**kwargs) + self.auth_type = "ServicePrincipal" # type: str + self.credentials = kwargs.get("credentials", None) class ServicePrincipalDatastoreCredentials(DatastoreCredentials): @@ -24923,25 +25463,25 @@ class ServicePrincipalDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, + "credentials_type": {"required": True}, + "client_id": {"required": True}, + "secrets": {"required": True}, + "tenant_id": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'ServicePrincipalDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "authority_url": {"key": "authorityUrl", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + "resource_url": {"key": "resourceUrl", "type": "str"}, + "secrets": { + "key": "secrets", + "type": "ServicePrincipalDatastoreSecrets", + }, + "tenant_id": {"key": "tenantId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword authority_url: Authority URL used for authentication. :paramtype authority_url: str @@ -24956,12 +25496,12 @@ def __init__( :paramtype tenant_id: str """ super(ServicePrincipalDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'ServicePrincipal' # type: str - self.authority_url = kwargs.get('authority_url', None) - self.client_id = kwargs['client_id'] - self.resource_url = kwargs.get('resource_url', None) - self.secrets = kwargs['secrets'] - self.tenant_id = kwargs['tenant_id'] + self.credentials_type = "ServicePrincipal" # type: str + self.authority_url = kwargs.get("authority_url", None) + self.client_id = kwargs["client_id"] + self.resource_url = kwargs.get("resource_url", None) + self.secrets = kwargs["secrets"] + self.tenant_id = kwargs["tenant_id"] class ServicePrincipalDatastoreSecrets(DatastoreSecrets): @@ -24978,25 +25518,22 @@ class ServicePrincipalDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "client_secret": {"key": "clientSecret", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword client_secret: Service principal secret. :paramtype client_secret: str """ super(ServicePrincipalDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'ServicePrincipal' # type: str - self.client_secret = kwargs.get('client_secret', None) + self.secrets_type = "ServicePrincipal" # type: str + self.client_secret = kwargs.get("client_secret", None) class ServiceTagDestination(msrest.serialization.Model): @@ -25011,15 +25548,12 @@ class ServiceTagDestination(msrest.serialization.Model): """ _attribute_map = { - 'service_tag': {'key': 'serviceTag', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'port_ranges': {'key': 'portRanges', 'type': 'str'}, + "service_tag": {"key": "serviceTag", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "port_ranges": {"key": "portRanges", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword service_tag: :paramtype service_tag: str @@ -25029,9 +25563,9 @@ def __init__( :paramtype port_ranges: str """ super(ServiceTagDestination, self).__init__(**kwargs) - self.service_tag = kwargs.get('service_tag', None) - self.protocol = kwargs.get('protocol', None) - self.port_ranges = kwargs.get('port_ranges', None) + self.service_tag = kwargs.get("service_tag", None) + self.protocol = kwargs.get("protocol", None) + self.port_ranges = kwargs.get("port_ranges", None) class ServiceTagOutboundRule(OutboundRule): @@ -25055,20 +25589,17 @@ class ServiceTagOutboundRule(OutboundRule): """ _validation = { - 'type': {'required': True}, + "type": {"required": True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'ServiceTagDestination'}, + "type": {"key": "type", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "destination": {"key": "destination", "type": "ServiceTagDestination"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword status: Status of a managed network Outbound Rule of a machine learning workspace. Possible values include: "Inactive", "Active". @@ -25081,8 +25612,8 @@ def __init__( :paramtype destination: ~azure.mgmt.machinelearningservices.models.ServiceTagDestination """ super(ServiceTagOutboundRule, self).__init__(**kwargs) - self.type = 'ServiceTag' # type: str - self.destination = kwargs.get('destination', None) + self.type = "ServiceTag" # type: str + self.destination = kwargs.get("destination", None) class SetupScripts(msrest.serialization.Model): @@ -25093,19 +25624,16 @@ class SetupScripts(msrest.serialization.Model): """ _attribute_map = { - 'scripts': {'key': 'scripts', 'type': 'ScriptsToExecute'}, + "scripts": {"key": "scripts", "type": "ScriptsToExecute"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword scripts: Customized setup scripts. :paramtype scripts: ~azure.mgmt.machinelearningservices.models.ScriptsToExecute """ super(SetupScripts, self).__init__(**kwargs) - self.scripts = kwargs.get('scripts', None) + self.scripts = kwargs.get("scripts", None) class SharedPrivateLinkResource(msrest.serialization.Model): @@ -25127,17 +25655,17 @@ class SharedPrivateLinkResource(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'private_link_resource_id': {'key': 'properties.privateLinkResourceId', 'type': 'str'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'request_message': {'key': 'properties.requestMessage', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "private_link_resource_id": { + "key": "properties.privateLinkResourceId", + "type": "str", + }, + "group_id": {"key": "properties.groupId", "type": "str"}, + "request_message": {"key": "properties.requestMessage", "type": "str"}, + "status": {"key": "properties.status", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: Unique name of the private link. :paramtype name: str @@ -25154,11 +25682,13 @@ def __init__( ~azure.mgmt.machinelearningservices.models.PrivateEndpointServiceConnectionStatus """ super(SharedPrivateLinkResource, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.private_link_resource_id = kwargs.get('private_link_resource_id', None) - self.group_id = kwargs.get('group_id', None) - self.request_message = kwargs.get('request_message', None) - self.status = kwargs.get('status', None) + self.name = kwargs.get("name", None) + self.private_link_resource_id = kwargs.get( + "private_link_resource_id", None + ) + self.group_id = kwargs.get("group_id", None) + self.request_message = kwargs.get("request_message", None) + self.status = kwargs.get("status", None) class Sku(msrest.serialization.Model): @@ -25184,21 +25714,18 @@ class Sku(msrest.serialization.Model): """ _validation = { - 'name': {'required': True}, + "name": {"required": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'int'}, + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, + "size": {"key": "size", "type": "str"}, + "family": {"key": "family", "type": "str"}, + "capacity": {"key": "capacity", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: Required. The name of the SKU. Ex - P3. It is typically a letter+number code. :paramtype name: str @@ -25217,11 +25744,11 @@ def __init__( :paramtype capacity: int """ super(Sku, self).__init__(**kwargs) - self.name = kwargs['name'] - self.tier = kwargs.get('tier', None) - self.size = kwargs.get('size', None) - self.family = kwargs.get('family', None) - self.capacity = kwargs.get('capacity', None) + self.name = kwargs["name"] + self.tier = kwargs.get("tier", None) + self.size = kwargs.get("size", None) + self.family = kwargs.get("family", None) + self.capacity = kwargs.get("capacity", None) class SkuCapacity(msrest.serialization.Model): @@ -25239,16 +25766,13 @@ class SkuCapacity(msrest.serialization.Model): """ _attribute_map = { - 'default': {'key': 'default', 'type': 'int'}, - 'maximum': {'key': 'maximum', 'type': 'int'}, - 'minimum': {'key': 'minimum', 'type': 'int'}, - 'scale_type': {'key': 'scaleType', 'type': 'str'}, + "default": {"key": "default", "type": "int"}, + "maximum": {"key": "maximum", "type": "int"}, + "minimum": {"key": "minimum", "type": "int"}, + "scale_type": {"key": "scaleType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword default: Gets or sets the default capacity. :paramtype default: int @@ -25261,10 +25785,10 @@ def __init__( :paramtype scale_type: str or ~azure.mgmt.machinelearningservices.models.SkuScaleType """ super(SkuCapacity, self).__init__(**kwargs) - self.default = kwargs.get('default', 0) - self.maximum = kwargs.get('maximum', 0) - self.minimum = kwargs.get('minimum', 0) - self.scale_type = kwargs.get('scale_type', None) + self.default = kwargs.get("default", 0) + self.maximum = kwargs.get("maximum", 0) + self.minimum = kwargs.get("minimum", 0) + self.scale_type = kwargs.get("scale_type", None) class SkuResource(msrest.serialization.Model): @@ -25281,19 +25805,16 @@ class SkuResource(msrest.serialization.Model): """ _validation = { - 'resource_type': {'readonly': True}, + "resource_type": {"readonly": True}, } _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'SkuSetting'}, + "capacity": {"key": "capacity", "type": "SkuCapacity"}, + "resource_type": {"key": "resourceType", "type": "str"}, + "sku": {"key": "sku", "type": "SkuSetting"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword capacity: Gets or sets the Sku Capacity. :paramtype capacity: ~azure.mgmt.machinelearningservices.models.SkuCapacity @@ -25301,9 +25822,9 @@ def __init__( :paramtype sku: ~azure.mgmt.machinelearningservices.models.SkuSetting """ super(SkuResource, self).__init__(**kwargs) - self.capacity = kwargs.get('capacity', None) + self.capacity = kwargs.get("capacity", None) self.resource_type = None - self.sku = kwargs.get('sku', None) + self.sku = kwargs.get("sku", None) class SkuResourceArmPaginatedResult(msrest.serialization.Model): @@ -25317,14 +25838,11 @@ class SkuResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[SkuResource]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[SkuResource]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword next_link: The link to the next page of SkuResource objects. If null, there are no additional pages. @@ -25333,8 +25851,8 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.SkuResource] """ super(SkuResourceArmPaginatedResult, self).__init__(**kwargs) - self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.next_link = kwargs.get("next_link", None) + self.value = kwargs.get("value", None) class SkuSetting(msrest.serialization.Model): @@ -25352,18 +25870,19 @@ class SkuSetting(msrest.serialization.Model): """ _validation = { - 'name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "name": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword name: Required. [Required] The name of the SKU. Ex - P3. It is typically a letter+number code. @@ -25374,8 +25893,8 @@ def __init__( :paramtype tier: str or ~azure.mgmt.machinelearningservices.models.SkuTier """ super(SkuSetting, self).__init__(**kwargs) - self.name = kwargs['name'] - self.tier = kwargs.get('tier', None) + self.name = kwargs["name"] + self.tier = kwargs.get("tier", None) class SparkJob(JobBaseProperties): @@ -25450,46 +25969,56 @@ class SparkJob(JobBaseProperties): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'code_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'entry': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'archives': {'key': 'archives', 'type': '[str]'}, - 'args': {'key': 'args', 'type': 'str'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'conf': {'key': 'conf', 'type': '{str}'}, - 'entry': {'key': 'entry', 'type': 'SparkJobEntry'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'files': {'key': 'files', 'type': '[str]'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'jars': {'key': 'jars', 'type': '[str]'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'py_files': {'key': 'pyFiles', 'type': '[str]'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'SparkResourceConfiguration'}, - } - - def __init__( - self, - **kwargs - ): + "job_type": {"required": True}, + "status": {"readonly": True}, + "code_id": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "entry": {"required": True}, + } + + _attribute_map = { + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "notification_setting": { + "key": "notificationSetting", + "type": "NotificationSetting", + }, + "secrets_configuration": { + "key": "secretsConfiguration", + "type": "{SecretConfiguration}", + }, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "archives": {"key": "archives", "type": "[str]"}, + "args": {"key": "args", "type": "str"}, + "code_id": {"key": "codeId", "type": "str"}, + "conf": {"key": "conf", "type": "{str}"}, + "entry": {"key": "entry", "type": "SparkJobEntry"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "files": {"key": "files", "type": "[str]"}, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "jars": {"key": "jars", "type": "[str]"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "py_files": {"key": "pyFiles", "type": "[str]"}, + "queue_settings": {"key": "queueSettings", "type": "QueueSettings"}, + "resources": { + "key": "resources", + "type": "SparkResourceConfiguration", + }, + } + + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -25548,20 +26077,20 @@ def __init__( :paramtype resources: ~azure.mgmt.machinelearningservices.models.SparkResourceConfiguration """ super(SparkJob, self).__init__(**kwargs) - self.job_type = 'Spark' # type: str - self.archives = kwargs.get('archives', None) - self.args = kwargs.get('args', None) - self.code_id = kwargs['code_id'] - self.conf = kwargs.get('conf', None) - self.entry = kwargs['entry'] - self.environment_id = kwargs.get('environment_id', None) - self.files = kwargs.get('files', None) - self.inputs = kwargs.get('inputs', None) - self.jars = kwargs.get('jars', None) - self.outputs = kwargs.get('outputs', None) - self.py_files = kwargs.get('py_files', None) - self.queue_settings = kwargs.get('queue_settings', None) - self.resources = kwargs.get('resources', None) + self.job_type = "Spark" # type: str + self.archives = kwargs.get("archives", None) + self.args = kwargs.get("args", None) + self.code_id = kwargs["code_id"] + self.conf = kwargs.get("conf", None) + self.entry = kwargs["entry"] + self.environment_id = kwargs.get("environment_id", None) + self.files = kwargs.get("files", None) + self.inputs = kwargs.get("inputs", None) + self.jars = kwargs.get("jars", None) + self.outputs = kwargs.get("outputs", None) + self.py_files = kwargs.get("py_files", None) + self.queue_settings = kwargs.get("queue_settings", None) + self.resources = kwargs.get("resources", None) class SparkJobEntry(msrest.serialization.Model): @@ -25579,23 +26108,22 @@ class SparkJobEntry(msrest.serialization.Model): """ _validation = { - 'spark_job_entry_type': {'required': True}, + "spark_job_entry_type": {"required": True}, } _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, + "spark_job_entry_type": {"key": "sparkJobEntryType", "type": "str"}, } _subtype_map = { - 'spark_job_entry_type': {'SparkJobPythonEntry': 'SparkJobPythonEntry', 'SparkJobScalaEntry': 'SparkJobScalaEntry'} + "spark_job_entry_type": { + "SparkJobPythonEntry": "SparkJobPythonEntry", + "SparkJobScalaEntry": "SparkJobScalaEntry", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(SparkJobEntry, self).__init__(**kwargs) self.spark_job_entry_type = None # type: Optional[str] @@ -25614,26 +26142,27 @@ class SparkJobPythonEntry(SparkJobEntry): """ _validation = { - 'spark_job_entry_type': {'required': True}, - 'file': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "spark_job_entry_type": {"required": True}, + "file": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - 'file': {'key': 'file', 'type': 'str'}, + "spark_job_entry_type": {"key": "sparkJobEntryType", "type": "str"}, + "file": {"key": "file", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword file: Required. [Required] Relative python file path for job entry point. :paramtype file: str """ super(SparkJobPythonEntry, self).__init__(**kwargs) - self.spark_job_entry_type = 'SparkJobPythonEntry' # type: str - self.file = kwargs['file'] + self.spark_job_entry_type = "SparkJobPythonEntry" # type: str + self.file = kwargs["file"] class SparkJobScalaEntry(SparkJobEntry): @@ -25650,26 +26179,27 @@ class SparkJobScalaEntry(SparkJobEntry): """ _validation = { - 'spark_job_entry_type': {'required': True}, - 'class_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "spark_job_entry_type": {"required": True}, + "class_name": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - 'class_name': {'key': 'className', 'type': 'str'}, + "spark_job_entry_type": {"key": "sparkJobEntryType", "type": "str"}, + "class_name": {"key": "className", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword class_name: Required. [Required] Scala class name used as entry point. :paramtype class_name: str """ super(SparkJobScalaEntry, self).__init__(**kwargs) - self.spark_job_entry_type = 'SparkJobScalaEntry' # type: str - self.class_name = kwargs['class_name'] + self.spark_job_entry_type = "SparkJobScalaEntry" # type: str + self.class_name = kwargs["class_name"] class SparkResourceConfiguration(msrest.serialization.Model): @@ -25682,14 +26212,11 @@ class SparkResourceConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, + "instance_type": {"key": "instanceType", "type": "str"}, + "runtime_version": {"key": "runtimeVersion", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword instance_type: Optional type of VM used as supported by the compute target. :paramtype instance_type: str @@ -25697,8 +26224,8 @@ def __init__( :paramtype runtime_version: str """ super(SparkResourceConfiguration, self).__init__(**kwargs) - self.instance_type = kwargs.get('instance_type', None) - self.runtime_version = kwargs.get('runtime_version', "3.1") + self.instance_type = kwargs.get("instance_type", None) + self.runtime_version = kwargs.get("runtime_version", "3.1") class SslConfiguration(msrest.serialization.Model): @@ -25720,18 +26247,18 @@ class SslConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'cert': {'key': 'cert', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - 'cname': {'key': 'cname', 'type': 'str'}, - 'leaf_domain_label': {'key': 'leafDomainLabel', 'type': 'str'}, - 'overwrite_existing_domain': {'key': 'overwriteExistingDomain', 'type': 'bool'}, + "status": {"key": "status", "type": "str"}, + "cert": {"key": "cert", "type": "str"}, + "key": {"key": "key", "type": "str"}, + "cname": {"key": "cname", "type": "str"}, + "leaf_domain_label": {"key": "leafDomainLabel", "type": "str"}, + "overwrite_existing_domain": { + "key": "overwriteExistingDomain", + "type": "bool", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword status: Enable or disable ssl for scoring. Possible values include: "Disabled", "Enabled", "Auto". @@ -25748,12 +26275,14 @@ def __init__( :paramtype overwrite_existing_domain: bool """ super(SslConfiguration, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.cert = kwargs.get('cert', None) - self.key = kwargs.get('key', None) - self.cname = kwargs.get('cname', None) - self.leaf_domain_label = kwargs.get('leaf_domain_label', None) - self.overwrite_existing_domain = kwargs.get('overwrite_existing_domain', None) + self.status = kwargs.get("status", None) + self.cert = kwargs.get("cert", None) + self.key = kwargs.get("key", None) + self.cname = kwargs.get("cname", None) + self.leaf_domain_label = kwargs.get("leaf_domain_label", None) + self.overwrite_existing_domain = kwargs.get( + "overwrite_existing_domain", None + ) class StackEnsembleSettings(msrest.serialization.Model): @@ -25775,15 +26304,21 @@ class StackEnsembleSettings(msrest.serialization.Model): """ _attribute_map = { - 'stack_meta_learner_k_wargs': {'key': 'stackMetaLearnerKWargs', 'type': 'object'}, - 'stack_meta_learner_train_percentage': {'key': 'stackMetaLearnerTrainPercentage', 'type': 'float'}, - 'stack_meta_learner_type': {'key': 'stackMetaLearnerType', 'type': 'str'}, + "stack_meta_learner_k_wargs": { + "key": "stackMetaLearnerKWargs", + "type": "object", + }, + "stack_meta_learner_train_percentage": { + "key": "stackMetaLearnerTrainPercentage", + "type": "float", + }, + "stack_meta_learner_type": { + "key": "stackMetaLearnerType", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword stack_meta_learner_k_wargs: Optional parameters to pass to the initializer of the meta-learner. @@ -25800,9 +26335,15 @@ def __init__( ~azure.mgmt.machinelearningservices.models.StackMetaLearnerType """ super(StackEnsembleSettings, self).__init__(**kwargs) - self.stack_meta_learner_k_wargs = kwargs.get('stack_meta_learner_k_wargs', None) - self.stack_meta_learner_train_percentage = kwargs.get('stack_meta_learner_train_percentage', 0.2) - self.stack_meta_learner_type = kwargs.get('stack_meta_learner_type', None) + self.stack_meta_learner_k_wargs = kwargs.get( + "stack_meta_learner_k_wargs", None + ) + self.stack_meta_learner_train_percentage = kwargs.get( + "stack_meta_learner_train_percentage", 0.2 + ) + self.stack_meta_learner_type = kwargs.get( + "stack_meta_learner_type", None + ) class StatusMessage(msrest.serialization.Model): @@ -25822,25 +26363,21 @@ class StatusMessage(msrest.serialization.Model): """ _validation = { - 'code': {'readonly': True}, - 'created_date_time': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, + "code": {"readonly": True}, + "created_date_time": {"readonly": True}, + "level": {"readonly": True}, + "message": {"readonly": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, + "code": {"key": "code", "type": "str"}, + "created_date_time": {"key": "createdDateTime", "type": "iso-8601"}, + "level": {"key": "level", "type": "str"}, + "message": {"key": "message", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(StatusMessage, self).__init__(**kwargs) self.code = None self.created_date_time = None @@ -25862,14 +26399,17 @@ class StorageAccountDetails(msrest.serialization.Model): """ _attribute_map = { - 'system_created_storage_account': {'key': 'systemCreatedStorageAccount', 'type': 'SystemCreatedStorageAccount'}, - 'user_created_storage_account': {'key': 'userCreatedStorageAccount', 'type': 'UserCreatedStorageAccount'}, + "system_created_storage_account": { + "key": "systemCreatedStorageAccount", + "type": "SystemCreatedStorageAccount", + }, + "user_created_storage_account": { + "key": "userCreatedStorageAccount", + "type": "UserCreatedStorageAccount", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword system_created_storage_account: Details of system created storage account to be used for the registry. @@ -25881,8 +26421,12 @@ def __init__( ~azure.mgmt.machinelearningservices.models.UserCreatedStorageAccount """ super(StorageAccountDetails, self).__init__(**kwargs) - self.system_created_storage_account = kwargs.get('system_created_storage_account', None) - self.user_created_storage_account = kwargs.get('user_created_storage_account', None) + self.system_created_storage_account = kwargs.get( + "system_created_storage_account", None + ) + self.user_created_storage_account = kwargs.get( + "user_created_storage_account", None + ) class SweepJob(JobBaseProperties): @@ -25951,44 +26495,53 @@ class SweepJob(JobBaseProperties): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'objective': {'required': True}, - 'sampling_algorithm': {'required': True}, - 'search_space': {'required': True}, - 'trial': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'SweepJobLimits'}, - 'objective': {'key': 'objective', 'type': 'Objective'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'SamplingAlgorithm'}, - 'search_space': {'key': 'searchSpace', 'type': 'object'}, - 'trial': {'key': 'trial', 'type': 'TrialComponent'}, - } - - def __init__( - self, - **kwargs - ): + "job_type": {"required": True}, + "status": {"readonly": True}, + "objective": {"required": True}, + "sampling_algorithm": {"required": True}, + "search_space": {"required": True}, + "trial": {"required": True}, + } + + _attribute_map = { + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "notification_setting": { + "key": "notificationSetting", + "type": "NotificationSetting", + }, + "secrets_configuration": { + "key": "secretsConfiguration", + "type": "{SecretConfiguration}", + }, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "limits": {"key": "limits", "type": "SweepJobLimits"}, + "objective": {"key": "objective", "type": "Objective"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "queue_settings": {"key": "queueSettings", "type": "QueueSettings"}, + "sampling_algorithm": { + "key": "samplingAlgorithm", + "type": "SamplingAlgorithm", + }, + "search_space": {"key": "searchSpace", "type": "object"}, + "trial": {"key": "trial", "type": "TrialComponent"}, + } + + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -26041,16 +26594,16 @@ def __init__( :paramtype trial: ~azure.mgmt.machinelearningservices.models.TrialComponent """ super(SweepJob, self).__init__(**kwargs) - self.job_type = 'Sweep' # type: str - self.early_termination = kwargs.get('early_termination', None) - self.inputs = kwargs.get('inputs', None) - self.limits = kwargs.get('limits', None) - self.objective = kwargs['objective'] - self.outputs = kwargs.get('outputs', None) - self.queue_settings = kwargs.get('queue_settings', None) - self.sampling_algorithm = kwargs['sampling_algorithm'] - self.search_space = kwargs['search_space'] - self.trial = kwargs['trial'] + self.job_type = "Sweep" # type: str + self.early_termination = kwargs.get("early_termination", None) + self.inputs = kwargs.get("inputs", None) + self.limits = kwargs.get("limits", None) + self.objective = kwargs["objective"] + self.outputs = kwargs.get("outputs", None) + self.queue_settings = kwargs.get("queue_settings", None) + self.sampling_algorithm = kwargs["sampling_algorithm"] + self.search_space = kwargs["search_space"] + self.trial = kwargs["trial"] class SweepJobLimits(JobLimits): @@ -26073,21 +26626,18 @@ class SweepJobLimits(JobLimits): """ _validation = { - 'job_limits_type': {'required': True}, + "job_limits_type": {"required": True}, } _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_total_trials': {'key': 'maxTotalTrials', 'type': 'int'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, + "job_limits_type": {"key": "jobLimitsType", "type": "str"}, + "timeout": {"key": "timeout", "type": "duration"}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_total_trials": {"key": "maxTotalTrials", "type": "int"}, + "trial_timeout": {"key": "trialTimeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword timeout: The max run duration in ISO 8601 format, after which the job will be cancelled. Only supports duration with precision as low as Seconds. @@ -26100,10 +26650,10 @@ def __init__( :paramtype trial_timeout: ~datetime.timedelta """ super(SweepJobLimits, self).__init__(**kwargs) - self.job_limits_type = 'Sweep' # type: str - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', None) - self.max_total_trials = kwargs.get('max_total_trials', None) - self.trial_timeout = kwargs.get('trial_timeout', None) + self.job_limits_type = "Sweep" # type: str + self.max_concurrent_trials = kwargs.get("max_concurrent_trials", None) + self.max_total_trials = kwargs.get("max_total_trials", None) + self.trial_timeout = kwargs.get("trial_timeout", None) class SynapseSpark(Compute): @@ -26145,32 +26695,32 @@ class SynapseSpark(Compute): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'SynapseSparkProperties'}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, + "properties": {"key": "properties", "type": "SynapseSparkProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword compute_location: Location for the underlying compute. :paramtype compute_location: str @@ -26185,8 +26735,8 @@ def __init__( :paramtype properties: ~azure.mgmt.machinelearningservices.models.SynapseSparkProperties """ super(SynapseSpark, self).__init__(**kwargs) - self.compute_type = 'SynapseSpark' # type: str - self.properties = kwargs.get('properties', None) + self.compute_type = "SynapseSpark" # type: str + self.properties = kwargs.get("properties", None) class SynapseSparkProperties(msrest.serialization.Model): @@ -26215,22 +26765,25 @@ class SynapseSparkProperties(msrest.serialization.Model): """ _attribute_map = { - 'auto_scale_properties': {'key': 'autoScaleProperties', 'type': 'AutoScaleProperties'}, - 'auto_pause_properties': {'key': 'autoPauseProperties', 'type': 'AutoPauseProperties'}, - 'spark_version': {'key': 'sparkVersion', 'type': 'str'}, - 'node_count': {'key': 'nodeCount', 'type': 'int'}, - 'node_size': {'key': 'nodeSize', 'type': 'str'}, - 'node_size_family': {'key': 'nodeSizeFamily', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'workspace_name': {'key': 'workspaceName', 'type': 'str'}, - 'pool_name': {'key': 'poolName', 'type': 'str'}, + "auto_scale_properties": { + "key": "autoScaleProperties", + "type": "AutoScaleProperties", + }, + "auto_pause_properties": { + "key": "autoPauseProperties", + "type": "AutoPauseProperties", + }, + "spark_version": {"key": "sparkVersion", "type": "str"}, + "node_count": {"key": "nodeCount", "type": "int"}, + "node_size": {"key": "nodeSize", "type": "str"}, + "node_size_family": {"key": "nodeSizeFamily", "type": "str"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, + "resource_group": {"key": "resourceGroup", "type": "str"}, + "workspace_name": {"key": "workspaceName", "type": "str"}, + "pool_name": {"key": "poolName", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword auto_scale_properties: Auto scale properties. :paramtype auto_scale_properties: @@ -26256,16 +26809,16 @@ def __init__( :paramtype pool_name: str """ super(SynapseSparkProperties, self).__init__(**kwargs) - self.auto_scale_properties = kwargs.get('auto_scale_properties', None) - self.auto_pause_properties = kwargs.get('auto_pause_properties', None) - self.spark_version = kwargs.get('spark_version', None) - self.node_count = kwargs.get('node_count', None) - self.node_size = kwargs.get('node_size', None) - self.node_size_family = kwargs.get('node_size_family', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.resource_group = kwargs.get('resource_group', None) - self.workspace_name = kwargs.get('workspace_name', None) - self.pool_name = kwargs.get('pool_name', None) + self.auto_scale_properties = kwargs.get("auto_scale_properties", None) + self.auto_pause_properties = kwargs.get("auto_pause_properties", None) + self.spark_version = kwargs.get("spark_version", None) + self.node_count = kwargs.get("node_count", None) + self.node_size = kwargs.get("node_size", None) + self.node_size_family = kwargs.get("node_size_family", None) + self.subscription_id = kwargs.get("subscription_id", None) + self.resource_group = kwargs.get("resource_group", None) + self.workspace_name = kwargs.get("workspace_name", None) + self.pool_name = kwargs.get("pool_name", None) class SystemCreatedAcrAccount(msrest.serialization.Model): @@ -26280,15 +26833,12 @@ class SystemCreatedAcrAccount(msrest.serialization.Model): """ _attribute_map = { - 'acr_account_name': {'key': 'acrAccountName', 'type': 'str'}, - 'acr_account_sku': {'key': 'acrAccountSku', 'type': 'str'}, - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, + "acr_account_name": {"key": "acrAccountName", "type": "str"}, + "acr_account_sku": {"key": "acrAccountSku", "type": "str"}, + "arm_resource_id": {"key": "armResourceId", "type": "ArmResourceId"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword acr_account_name: Name of the ACR account. :paramtype acr_account_name: str @@ -26298,9 +26848,9 @@ def __init__( :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId """ super(SystemCreatedAcrAccount, self).__init__(**kwargs) - self.acr_account_name = kwargs.get('acr_account_name', None) - self.acr_account_sku = kwargs.get('acr_account_sku', None) - self.arm_resource_id = kwargs.get('arm_resource_id', None) + self.acr_account_name = kwargs.get("acr_account_name", None) + self.acr_account_sku = kwargs.get("acr_account_sku", None) + self.arm_resource_id = kwargs.get("arm_resource_id", None) class SystemCreatedStorageAccount(msrest.serialization.Model): @@ -26327,17 +26877,20 @@ class SystemCreatedStorageAccount(msrest.serialization.Model): """ _attribute_map = { - 'allow_blob_public_access': {'key': 'allowBlobPublicAccess', 'type': 'bool'}, - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - 'storage_account_hns_enabled': {'key': 'storageAccountHnsEnabled', 'type': 'bool'}, - 'storage_account_name': {'key': 'storageAccountName', 'type': 'str'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + "allow_blob_public_access": { + "key": "allowBlobPublicAccess", + "type": "bool", + }, + "arm_resource_id": {"key": "armResourceId", "type": "ArmResourceId"}, + "storage_account_hns_enabled": { + "key": "storageAccountHnsEnabled", + "type": "bool", + }, + "storage_account_name": {"key": "storageAccountName", "type": "str"}, + "storage_account_type": {"key": "storageAccountType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword allow_blob_public_access: Public blob access allowed. :paramtype allow_blob_public_access: bool @@ -26359,11 +26912,15 @@ def __init__( :paramtype storage_account_type: str """ super(SystemCreatedStorageAccount, self).__init__(**kwargs) - self.allow_blob_public_access = kwargs.get('allow_blob_public_access', None) - self.arm_resource_id = kwargs.get('arm_resource_id', None) - self.storage_account_hns_enabled = kwargs.get('storage_account_hns_enabled', None) - self.storage_account_name = kwargs.get('storage_account_name', None) - self.storage_account_type = kwargs.get('storage_account_type', None) + self.allow_blob_public_access = kwargs.get( + "allow_blob_public_access", None + ) + self.arm_resource_id = kwargs.get("arm_resource_id", None) + self.storage_account_hns_enabled = kwargs.get( + "storage_account_hns_enabled", None + ) + self.storage_account_name = kwargs.get("storage_account_name", None) + self.storage_account_type = kwargs.get("storage_account_type", None) class SystemData(msrest.serialization.Model): @@ -26386,18 +26943,15 @@ class SystemData(msrest.serialization.Model): """ _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + "created_by": {"key": "createdBy", "type": "str"}, + "created_by_type": {"key": "createdByType", "type": "str"}, + "created_at": {"key": "createdAt", "type": "iso-8601"}, + "last_modified_by": {"key": "lastModifiedBy", "type": "str"}, + "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"}, + "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword created_by: The identity that created the resource. :paramtype created_by: str @@ -26416,12 +26970,12 @@ def __init__( :paramtype last_modified_at: ~datetime.datetime """ super(SystemData, self).__init__(**kwargs) - self.created_by = kwargs.get('created_by', None) - self.created_by_type = kwargs.get('created_by_type', None) - self.created_at = kwargs.get('created_at', None) - self.last_modified_by = kwargs.get('last_modified_by', None) - self.last_modified_by_type = kwargs.get('last_modified_by_type', None) - self.last_modified_at = kwargs.get('last_modified_at', None) + self.created_by = kwargs.get("created_by", None) + self.created_by_type = kwargs.get("created_by_type", None) + self.created_at = kwargs.get("created_at", None) + self.last_modified_by = kwargs.get("last_modified_by", None) + self.last_modified_by_type = kwargs.get("last_modified_by_type", None) + self.last_modified_at = kwargs.get("last_modified_at", None) class SystemService(msrest.serialization.Model): @@ -26438,23 +26992,19 @@ class SystemService(msrest.serialization.Model): """ _validation = { - 'system_service_type': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'version': {'readonly': True}, + "system_service_type": {"readonly": True}, + "public_ip_address": {"readonly": True}, + "version": {"readonly": True}, } _attribute_map = { - 'system_service_type': {'key': 'systemServiceType', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, + "system_service_type": {"key": "systemServiceType", "type": "str"}, + "public_ip_address": {"key": "publicIpAddress", "type": "str"}, + "version": {"key": "version", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(SystemService, self).__init__(**kwargs) self.system_service_type = None self.public_ip_address = None @@ -26509,32 +27059,29 @@ class TableFixedParameters(msrest.serialization.Model): """ _attribute_map = { - 'booster': {'key': 'booster', 'type': 'str'}, - 'boosting_type': {'key': 'boostingType', 'type': 'str'}, - 'grow_policy': {'key': 'growPolicy', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'max_bin': {'key': 'maxBin', 'type': 'int'}, - 'max_depth': {'key': 'maxDepth', 'type': 'int'}, - 'max_leaves': {'key': 'maxLeaves', 'type': 'int'}, - 'min_data_in_leaf': {'key': 'minDataInLeaf', 'type': 'int'}, - 'min_split_gain': {'key': 'minSplitGain', 'type': 'float'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'n_estimators': {'key': 'nEstimators', 'type': 'int'}, - 'num_leaves': {'key': 'numLeaves', 'type': 'int'}, - 'preprocessor_name': {'key': 'preprocessorName', 'type': 'str'}, - 'reg_alpha': {'key': 'regAlpha', 'type': 'float'}, - 'reg_lambda': {'key': 'regLambda', 'type': 'float'}, - 'subsample': {'key': 'subsample', 'type': 'float'}, - 'subsample_freq': {'key': 'subsampleFreq', 'type': 'float'}, - 'tree_method': {'key': 'treeMethod', 'type': 'str'}, - 'with_mean': {'key': 'withMean', 'type': 'bool'}, - 'with_std': {'key': 'withStd', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): + "booster": {"key": "booster", "type": "str"}, + "boosting_type": {"key": "boostingType", "type": "str"}, + "grow_policy": {"key": "growPolicy", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "float"}, + "max_bin": {"key": "maxBin", "type": "int"}, + "max_depth": {"key": "maxDepth", "type": "int"}, + "max_leaves": {"key": "maxLeaves", "type": "int"}, + "min_data_in_leaf": {"key": "minDataInLeaf", "type": "int"}, + "min_split_gain": {"key": "minSplitGain", "type": "float"}, + "model_name": {"key": "modelName", "type": "str"}, + "n_estimators": {"key": "nEstimators", "type": "int"}, + "num_leaves": {"key": "numLeaves", "type": "int"}, + "preprocessor_name": {"key": "preprocessorName", "type": "str"}, + "reg_alpha": {"key": "regAlpha", "type": "float"}, + "reg_lambda": {"key": "regLambda", "type": "float"}, + "subsample": {"key": "subsample", "type": "float"}, + "subsample_freq": {"key": "subsampleFreq", "type": "float"}, + "tree_method": {"key": "treeMethod", "type": "str"}, + "with_mean": {"key": "withMean", "type": "bool"}, + "with_std": {"key": "withStd", "type": "bool"}, + } + + def __init__(self, **kwargs): """ :keyword booster: Specify the boosting type, e.g gbdt for XGBoost. :paramtype booster: str @@ -26580,26 +27127,26 @@ def __init__( :paramtype with_std: bool """ super(TableFixedParameters, self).__init__(**kwargs) - self.booster = kwargs.get('booster', None) - self.boosting_type = kwargs.get('boosting_type', None) - self.grow_policy = kwargs.get('grow_policy', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.max_bin = kwargs.get('max_bin', None) - self.max_depth = kwargs.get('max_depth', None) - self.max_leaves = kwargs.get('max_leaves', None) - self.min_data_in_leaf = kwargs.get('min_data_in_leaf', None) - self.min_split_gain = kwargs.get('min_split_gain', None) - self.model_name = kwargs.get('model_name', None) - self.n_estimators = kwargs.get('n_estimators', None) - self.num_leaves = kwargs.get('num_leaves', None) - self.preprocessor_name = kwargs.get('preprocessor_name', None) - self.reg_alpha = kwargs.get('reg_alpha', None) - self.reg_lambda = kwargs.get('reg_lambda', None) - self.subsample = kwargs.get('subsample', None) - self.subsample_freq = kwargs.get('subsample_freq', None) - self.tree_method = kwargs.get('tree_method', None) - self.with_mean = kwargs.get('with_mean', False) - self.with_std = kwargs.get('with_std', False) + self.booster = kwargs.get("booster", None) + self.boosting_type = kwargs.get("boosting_type", None) + self.grow_policy = kwargs.get("grow_policy", None) + self.learning_rate = kwargs.get("learning_rate", None) + self.max_bin = kwargs.get("max_bin", None) + self.max_depth = kwargs.get("max_depth", None) + self.max_leaves = kwargs.get("max_leaves", None) + self.min_data_in_leaf = kwargs.get("min_data_in_leaf", None) + self.min_split_gain = kwargs.get("min_split_gain", None) + self.model_name = kwargs.get("model_name", None) + self.n_estimators = kwargs.get("n_estimators", None) + self.num_leaves = kwargs.get("num_leaves", None) + self.preprocessor_name = kwargs.get("preprocessor_name", None) + self.reg_alpha = kwargs.get("reg_alpha", None) + self.reg_lambda = kwargs.get("reg_lambda", None) + self.subsample = kwargs.get("subsample", None) + self.subsample_freq = kwargs.get("subsample_freq", None) + self.tree_method = kwargs.get("tree_method", None) + self.with_mean = kwargs.get("with_mean", False) + self.with_std = kwargs.get("with_std", False) class TableParameterSubspace(msrest.serialization.Model): @@ -26650,32 +27197,29 @@ class TableParameterSubspace(msrest.serialization.Model): """ _attribute_map = { - 'booster': {'key': 'booster', 'type': 'str'}, - 'boosting_type': {'key': 'boostingType', 'type': 'str'}, - 'grow_policy': {'key': 'growPolicy', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'max_bin': {'key': 'maxBin', 'type': 'str'}, - 'max_depth': {'key': 'maxDepth', 'type': 'str'}, - 'max_leaves': {'key': 'maxLeaves', 'type': 'str'}, - 'min_data_in_leaf': {'key': 'minDataInLeaf', 'type': 'str'}, - 'min_split_gain': {'key': 'minSplitGain', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'n_estimators': {'key': 'nEstimators', 'type': 'str'}, - 'num_leaves': {'key': 'numLeaves', 'type': 'str'}, - 'preprocessor_name': {'key': 'preprocessorName', 'type': 'str'}, - 'reg_alpha': {'key': 'regAlpha', 'type': 'str'}, - 'reg_lambda': {'key': 'regLambda', 'type': 'str'}, - 'subsample': {'key': 'subsample', 'type': 'str'}, - 'subsample_freq': {'key': 'subsampleFreq', 'type': 'str'}, - 'tree_method': {'key': 'treeMethod', 'type': 'str'}, - 'with_mean': {'key': 'withMean', 'type': 'str'}, - 'with_std': {'key': 'withStd', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): + "booster": {"key": "booster", "type": "str"}, + "boosting_type": {"key": "boostingType", "type": "str"}, + "grow_policy": {"key": "growPolicy", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "str"}, + "max_bin": {"key": "maxBin", "type": "str"}, + "max_depth": {"key": "maxDepth", "type": "str"}, + "max_leaves": {"key": "maxLeaves", "type": "str"}, + "min_data_in_leaf": {"key": "minDataInLeaf", "type": "str"}, + "min_split_gain": {"key": "minSplitGain", "type": "str"}, + "model_name": {"key": "modelName", "type": "str"}, + "n_estimators": {"key": "nEstimators", "type": "str"}, + "num_leaves": {"key": "numLeaves", "type": "str"}, + "preprocessor_name": {"key": "preprocessorName", "type": "str"}, + "reg_alpha": {"key": "regAlpha", "type": "str"}, + "reg_lambda": {"key": "regLambda", "type": "str"}, + "subsample": {"key": "subsample", "type": "str"}, + "subsample_freq": {"key": "subsampleFreq", "type": "str"}, + "tree_method": {"key": "treeMethod", "type": "str"}, + "with_mean": {"key": "withMean", "type": "str"}, + "with_std": {"key": "withStd", "type": "str"}, + } + + def __init__(self, **kwargs): """ :keyword booster: Specify the boosting type, e.g gbdt for XGBoost. :paramtype booster: str @@ -26721,26 +27265,26 @@ def __init__( :paramtype with_std: str """ super(TableParameterSubspace, self).__init__(**kwargs) - self.booster = kwargs.get('booster', None) - self.boosting_type = kwargs.get('boosting_type', None) - self.grow_policy = kwargs.get('grow_policy', None) - self.learning_rate = kwargs.get('learning_rate', None) - self.max_bin = kwargs.get('max_bin', None) - self.max_depth = kwargs.get('max_depth', None) - self.max_leaves = kwargs.get('max_leaves', None) - self.min_data_in_leaf = kwargs.get('min_data_in_leaf', None) - self.min_split_gain = kwargs.get('min_split_gain', None) - self.model_name = kwargs.get('model_name', None) - self.n_estimators = kwargs.get('n_estimators', None) - self.num_leaves = kwargs.get('num_leaves', None) - self.preprocessor_name = kwargs.get('preprocessor_name', None) - self.reg_alpha = kwargs.get('reg_alpha', None) - self.reg_lambda = kwargs.get('reg_lambda', None) - self.subsample = kwargs.get('subsample', None) - self.subsample_freq = kwargs.get('subsample_freq', None) - self.tree_method = kwargs.get('tree_method', None) - self.with_mean = kwargs.get('with_mean', None) - self.with_std = kwargs.get('with_std', None) + self.booster = kwargs.get("booster", None) + self.boosting_type = kwargs.get("boosting_type", None) + self.grow_policy = kwargs.get("grow_policy", None) + self.learning_rate = kwargs.get("learning_rate", None) + self.max_bin = kwargs.get("max_bin", None) + self.max_depth = kwargs.get("max_depth", None) + self.max_leaves = kwargs.get("max_leaves", None) + self.min_data_in_leaf = kwargs.get("min_data_in_leaf", None) + self.min_split_gain = kwargs.get("min_split_gain", None) + self.model_name = kwargs.get("model_name", None) + self.n_estimators = kwargs.get("n_estimators", None) + self.num_leaves = kwargs.get("num_leaves", None) + self.preprocessor_name = kwargs.get("preprocessor_name", None) + self.reg_alpha = kwargs.get("reg_alpha", None) + self.reg_lambda = kwargs.get("reg_lambda", None) + self.subsample = kwargs.get("subsample", None) + self.subsample_freq = kwargs.get("subsample_freq", None) + self.tree_method = kwargs.get("tree_method", None) + self.with_mean = kwargs.get("with_mean", None) + self.with_std = kwargs.get("with_std", None) class TableSweepSettings(msrest.serialization.Model): @@ -26757,18 +27301,18 @@ class TableSweepSettings(msrest.serialization.Model): """ _validation = { - 'sampling_algorithm': {'required': True}, + "sampling_algorithm": {"required": True}, } _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, + "sampling_algorithm": {"key": "samplingAlgorithm", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword early_termination: Type of early termination policy for the sweeping job. :paramtype early_termination: ~azure.mgmt.machinelearningservices.models.EarlyTerminationPolicy @@ -26778,8 +27322,8 @@ def __init__( ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType """ super(TableSweepSettings, self).__init__(**kwargs) - self.early_termination = kwargs.get('early_termination', None) - self.sampling_algorithm = kwargs['sampling_algorithm'] + self.early_termination = kwargs.get("early_termination", None) + self.sampling_algorithm = kwargs["sampling_algorithm"] class TableVerticalFeaturizationSettings(FeaturizationSettings): @@ -26809,18 +27353,27 @@ class TableVerticalFeaturizationSettings(FeaturizationSettings): """ _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - 'blocked_transformers': {'key': 'blockedTransformers', 'type': '[str]'}, - 'column_name_and_types': {'key': 'columnNameAndTypes', 'type': '{str}'}, - 'enable_dnn_featurization': {'key': 'enableDnnFeaturization', 'type': 'bool'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'transformer_params': {'key': 'transformerParams', 'type': '{[ColumnTransformer]}'}, + "dataset_language": {"key": "datasetLanguage", "type": "str"}, + "blocked_transformers": { + "key": "blockedTransformers", + "type": "[str]", + }, + "column_name_and_types": { + "key": "columnNameAndTypes", + "type": "{str}", + }, + "enable_dnn_featurization": { + "key": "enableDnnFeaturization", + "type": "bool", + }, + "mode": {"key": "mode", "type": "str"}, + "transformer_params": { + "key": "transformerParams", + "type": "{[ColumnTransformer]}", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword dataset_language: Dataset language, useful for the text data. :paramtype dataset_language: str @@ -26845,11 +27398,13 @@ def __init__( list[~azure.mgmt.machinelearningservices.models.ColumnTransformer]] """ super(TableVerticalFeaturizationSettings, self).__init__(**kwargs) - self.blocked_transformers = kwargs.get('blocked_transformers', None) - self.column_name_and_types = kwargs.get('column_name_and_types', None) - self.enable_dnn_featurization = kwargs.get('enable_dnn_featurization', False) - self.mode = kwargs.get('mode', None) - self.transformer_params = kwargs.get('transformer_params', None) + self.blocked_transformers = kwargs.get("blocked_transformers", None) + self.column_name_and_types = kwargs.get("column_name_and_types", None) + self.enable_dnn_featurization = kwargs.get( + "enable_dnn_featurization", False + ) + self.mode = kwargs.get("mode", None) + self.transformer_params = kwargs.get("transformer_params", None) class TableVerticalLimitSettings(msrest.serialization.Model): @@ -26879,22 +27434,25 @@ class TableVerticalLimitSettings(msrest.serialization.Model): """ _attribute_map = { - 'enable_early_termination': {'key': 'enableEarlyTermination', 'type': 'bool'}, - 'exit_score': {'key': 'exitScore', 'type': 'float'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_cores_per_trial': {'key': 'maxCoresPerTrial', 'type': 'int'}, - 'max_nodes': {'key': 'maxNodes', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'sweep_concurrent_trials': {'key': 'sweepConcurrentTrials', 'type': 'int'}, - 'sweep_trials': {'key': 'sweepTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, + "enable_early_termination": { + "key": "enableEarlyTermination", + "type": "bool", + }, + "exit_score": {"key": "exitScore", "type": "float"}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_cores_per_trial": {"key": "maxCoresPerTrial", "type": "int"}, + "max_nodes": {"key": "maxNodes", "type": "int"}, + "max_trials": {"key": "maxTrials", "type": "int"}, + "sweep_concurrent_trials": { + "key": "sweepConcurrentTrials", + "type": "int", + }, + "sweep_trials": {"key": "sweepTrials", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, + "trial_timeout": {"key": "trialTimeout", "type": "duration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword enable_early_termination: Enable early termination, determines whether or not if AutoMLJob will terminate early if there is no score improvement in last 20 iterations. @@ -26920,16 +27478,18 @@ def __init__( :paramtype trial_timeout: ~datetime.timedelta """ super(TableVerticalLimitSettings, self).__init__(**kwargs) - self.enable_early_termination = kwargs.get('enable_early_termination', True) - self.exit_score = kwargs.get('exit_score', None) - self.max_concurrent_trials = kwargs.get('max_concurrent_trials', 1) - self.max_cores_per_trial = kwargs.get('max_cores_per_trial', -1) - self.max_nodes = kwargs.get('max_nodes', 1) - self.max_trials = kwargs.get('max_trials', 1000) - self.sweep_concurrent_trials = kwargs.get('sweep_concurrent_trials', 0) - self.sweep_trials = kwargs.get('sweep_trials', 0) - self.timeout = kwargs.get('timeout', "PT6H") - self.trial_timeout = kwargs.get('trial_timeout', "PT30M") + self.enable_early_termination = kwargs.get( + "enable_early_termination", True + ) + self.exit_score = kwargs.get("exit_score", None) + self.max_concurrent_trials = kwargs.get("max_concurrent_trials", 1) + self.max_cores_per_trial = kwargs.get("max_cores_per_trial", -1) + self.max_nodes = kwargs.get("max_nodes", 1) + self.max_trials = kwargs.get("max_trials", 1000) + self.sweep_concurrent_trials = kwargs.get("sweep_concurrent_trials", 0) + self.sweep_trials = kwargs.get("sweep_trials", 0) + self.timeout = kwargs.get("timeout", "PT6H") + self.trial_timeout = kwargs.get("trial_timeout", "PT30M") class TargetUtilizationScaleSettings(OnlineScaleSettings): @@ -26953,21 +27513,21 @@ class TargetUtilizationScaleSettings(OnlineScaleSettings): """ _validation = { - 'scale_type': {'required': True}, + "scale_type": {"required": True}, } _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - 'max_instances': {'key': 'maxInstances', 'type': 'int'}, - 'min_instances': {'key': 'minInstances', 'type': 'int'}, - 'polling_interval': {'key': 'pollingInterval', 'type': 'duration'}, - 'target_utilization_percentage': {'key': 'targetUtilizationPercentage', 'type': 'int'}, + "scale_type": {"key": "scaleType", "type": "str"}, + "max_instances": {"key": "maxInstances", "type": "int"}, + "min_instances": {"key": "minInstances", "type": "int"}, + "polling_interval": {"key": "pollingInterval", "type": "duration"}, + "target_utilization_percentage": { + "key": "targetUtilizationPercentage", + "type": "int", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword max_instances: The maximum number of instances that the deployment can scale to. The quota will be reserved for max_instances. @@ -26981,11 +27541,13 @@ def __init__( :paramtype target_utilization_percentage: int """ super(TargetUtilizationScaleSettings, self).__init__(**kwargs) - self.scale_type = 'TargetUtilization' # type: str - self.max_instances = kwargs.get('max_instances', 1) - self.min_instances = kwargs.get('min_instances', 1) - self.polling_interval = kwargs.get('polling_interval', "PT1S") - self.target_utilization_percentage = kwargs.get('target_utilization_percentage', 70) + self.scale_type = "TargetUtilization" # type: str + self.max_instances = kwargs.get("max_instances", 1) + self.min_instances = kwargs.get("min_instances", 1) + self.polling_interval = kwargs.get("polling_interval", "PT1S") + self.target_utilization_percentage = kwargs.get( + "target_utilization_percentage", 70 + ) class TensorFlow(DistributionConfiguration): @@ -27004,19 +27566,19 @@ class TensorFlow(DistributionConfiguration): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'parameter_server_count': {'key': 'parameterServerCount', 'type': 'int'}, - 'worker_count': {'key': 'workerCount', 'type': 'int'}, + "distribution_type": {"key": "distributionType", "type": "str"}, + "parameter_server_count": { + "key": "parameterServerCount", + "type": "int", + }, + "worker_count": {"key": "workerCount", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword parameter_server_count: Number of parameter server tasks. :paramtype parameter_server_count: int @@ -27024,75 +27586,87 @@ def __init__( :paramtype worker_count: int """ super(TensorFlow, self).__init__(**kwargs) - self.distribution_type = 'TensorFlow' # type: str - self.parameter_server_count = kwargs.get('parameter_server_count', 0) - self.worker_count = kwargs.get('worker_count', None) + self.distribution_type = "TensorFlow" # type: str + self.parameter_server_count = kwargs.get("parameter_server_count", 0) + self.worker_count = kwargs.get("worker_count", None) class TextClassification(AutoMLVertical, NlpVertical): """Text Classification task in AutoML NLP vertical. -NLP - Natural Language Processing. + NLP - Natural Language Processing. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-Classification task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar fixed_parameters: Model/training parameters that will remain constant throughout + training. + :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] + :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric for Text-Classification task. Possible values include: + "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, + "task_type": {"required": True}, + "training_data": {"required": True}, } _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "NlpFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "search_space": { + "key": "searchSpace", + "type": "[NlpParameterSubspace]", + }, + "sweep_settings": {"key": "sweepSettings", "type": "NlpSweepSettings"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword featurization_settings: Featurization inputs needed for AutoML job. :paramtype featurization_settings: @@ -27124,87 +27698,101 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ super(TextClassification, self).__init__(**kwargs) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.task_type = 'TextClassification' # type: str - self.primary_metric = kwargs.get('primary_metric', None) - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.fixed_parameters = kwargs.get("fixed_parameters", None) + self.limit_settings = kwargs.get("limit_settings", None) + self.search_space = kwargs.get("search_space", None) + self.sweep_settings = kwargs.get("sweep_settings", None) + self.validation_data = kwargs.get("validation_data", None) + self.task_type = "TextClassification" # type: str + self.primary_metric = kwargs.get("primary_metric", None) + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class TextClassificationMultilabel(AutoMLVertical, NlpVertical): """Text Classification Multilabel task in AutoML NLP vertical. -NLP - Natural Language Processing. + NLP - Natural Language Processing. - Variables are only populated by the server, and will be ignored when sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-Classification-Multilabel task. - Currently only Accuracy is supported as primary metric, hence user need not set it explicitly. - Possible values include: "AUCWeighted", "Accuracy", "NormMacroRecall", - "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar fixed_parameters: Model/training parameters that will remain constant throughout + training. + :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] + :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric for Text-Classification-Multilabel task. + Currently only Accuracy is supported as primary metric, hence user need not set it explicitly. + Possible values include: "AUCWeighted", "Accuracy", "NormMacroRecall", + "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted", "IOU". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - 'primary_metric': {'readonly': True}, + "task_type": {"required": True}, + "training_data": {"required": True}, + "primary_metric": {"readonly": True}, } _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "NlpFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "search_space": { + "key": "searchSpace", + "type": "[NlpParameterSubspace]", + }, + "sweep_settings": {"key": "sweepSettings", "type": "NlpSweepSettings"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword featurization_settings: Featurization inputs needed for AutoML job. :paramtype featurization_settings: @@ -27231,88 +27819,102 @@ def __init__( :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ super(TextClassificationMultilabel, self).__init__(**kwargs) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.task_type = 'TextClassificationMultilabel' # type: str + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.fixed_parameters = kwargs.get("fixed_parameters", None) + self.limit_settings = kwargs.get("limit_settings", None) + self.search_space = kwargs.get("search_space", None) + self.sweep_settings = kwargs.get("sweep_settings", None) + self.validation_data = kwargs.get("validation_data", None) + self.task_type = "TextClassificationMultilabel" # type: str self.primary_metric = None - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class TextNer(AutoMLVertical, NlpVertical): """Text-NER task in AutoML NLP vertical. -NER - Named Entity Recognition. -NLP - Natural Language Processing. + NER - Named Entity Recognition. + NLP - Natural Language Processing. - Variables are only populated by the server, and will be ignored when sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-NER task. - Only 'Accuracy' is supported for Text-NER, so user need not set this explicitly. Possible - values include: "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar fixed_parameters: Model/training parameters that will remain constant throughout + training. + :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] + :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric for Text-NER task. + Only 'Accuracy' is supported for Text-NER, so user need not set this explicitly. Possible + values include: "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - 'primary_metric': {'readonly': True}, + "task_type": {"required": True}, + "training_data": {"required": True}, + "primary_metric": {"readonly": True}, } _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "NlpFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "search_space": { + "key": "searchSpace", + "type": "[NlpParameterSubspace]", + }, + "sweep_settings": {"key": "sweepSettings", "type": "NlpSweepSettings"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword featurization_settings: Featurization inputs needed for AutoML job. :paramtype featurization_settings: @@ -27339,17 +27941,19 @@ def __init__( :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ super(TextNer, self).__init__(**kwargs) - self.featurization_settings = kwargs.get('featurization_settings', None) - self.fixed_parameters = kwargs.get('fixed_parameters', None) - self.limit_settings = kwargs.get('limit_settings', None) - self.search_space = kwargs.get('search_space', None) - self.sweep_settings = kwargs.get('sweep_settings', None) - self.validation_data = kwargs.get('validation_data', None) - self.task_type = 'TextNER' # type: str + self.featurization_settings = kwargs.get( + "featurization_settings", None + ) + self.fixed_parameters = kwargs.get("fixed_parameters", None) + self.limit_settings = kwargs.get("limit_settings", None) + self.search_space = kwargs.get("search_space", None) + self.sweep_settings = kwargs.get("sweep_settings", None) + self.validation_data = kwargs.get("validation_data", None) + self.task_type = "TextNER" # type: str self.primary_metric = None - self.log_verbosity = kwargs.get('log_verbosity', None) - self.target_column_name = kwargs.get('target_column_name', None) - self.training_data = kwargs['training_data'] + self.log_verbosity = kwargs.get("log_verbosity", None) + self.target_column_name = kwargs.get("target_column_name", None) + self.training_data = kwargs["training_data"] class TmpfsOptions(msrest.serialization.Model): @@ -27360,19 +27964,16 @@ class TmpfsOptions(msrest.serialization.Model): """ _attribute_map = { - 'size': {'key': 'size', 'type': 'int'}, + "size": {"key": "size", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword size: Mention the Tmpfs size. :paramtype size: int """ super(TmpfsOptions, self).__init__(**kwargs) - self.size = kwargs.get('size', None) + self.size = kwargs.get("size", None) class TopNFeaturesByAttribution(MonitoringFeatureFilterBase): @@ -27390,25 +27991,22 @@ class TopNFeaturesByAttribution(MonitoringFeatureFilterBase): """ _validation = { - 'filter_type': {'required': True}, + "filter_type": {"required": True}, } _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - 'top': {'key': 'top', 'type': 'int'}, + "filter_type": {"key": "filterType", "type": "str"}, + "top": {"key": "top", "type": "int"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword top: The number of top features to include. :paramtype top: int """ super(TopNFeaturesByAttribution, self).__init__(**kwargs) - self.filter_type = 'TopNByAttribution' # type: str - self.top = kwargs.get('top', 10) + self.filter_type = "TopNByAttribution" # type: str + self.top = kwargs.get("top", 10) class TrialComponent(msrest.serialization.Model): @@ -27434,23 +28032,34 @@ class TrialComponent(msrest.serialization.Model): """ _validation = { - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "command": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "environment_id": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, + "code_id": {"key": "codeId", "type": "str"}, + "command": {"key": "command", "type": "str"}, + "distribution": { + "key": "distribution", + "type": "DistributionConfiguration", + }, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "resources": {"key": "resources", "type": "JobResourceConfiguration"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword code_id: ARM resource ID of the code asset. :paramtype code_id: str @@ -27469,12 +28078,12 @@ def __init__( :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration """ super(TrialComponent, self).__init__(**kwargs) - self.code_id = kwargs.get('code_id', None) - self.command = kwargs['command'] - self.distribution = kwargs.get('distribution', None) - self.environment_id = kwargs['environment_id'] - self.environment_variables = kwargs.get('environment_variables', None) - self.resources = kwargs.get('resources', None) + self.code_id = kwargs.get("code_id", None) + self.command = kwargs["command"] + self.distribution = kwargs.get("distribution", None) + self.environment_id = kwargs["environment_id"] + self.environment_variables = kwargs.get("environment_variables", None) + self.resources = kwargs.get("resources", None) class TritonInferencingServer(InferencingServer): @@ -27491,26 +28100,28 @@ class TritonInferencingServer(InferencingServer): """ _validation = { - 'server_type': {'required': True}, + "server_type": {"required": True}, } _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'inference_configuration': {'key': 'inferenceConfiguration', 'type': 'OnlineInferenceConfiguration'}, + "server_type": {"key": "serverType", "type": "str"}, + "inference_configuration": { + "key": "inferenceConfiguration", + "type": "OnlineInferenceConfiguration", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword inference_configuration: Inference configuration for Triton. :paramtype inference_configuration: ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration """ super(TritonInferencingServer, self).__init__(**kwargs) - self.server_type = 'Triton' # type: str - self.inference_configuration = kwargs.get('inference_configuration', None) + self.server_type = "Triton" # type: str + self.inference_configuration = kwargs.get( + "inference_configuration", None + ) class TritonModelJobInput(JobInput, AssetJobInput): @@ -27532,21 +28143,18 @@ class TritonModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "min_length": 1, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -27557,10 +28165,10 @@ def __init__( :paramtype description: str """ super(TritonModelJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'triton_model' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "triton_model" # type: str + self.description = kwargs.get("description", None) class TritonModelJobOutput(JobOutput, AssetJobOutput): @@ -27588,23 +28196,23 @@ class TritonModelJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "asset_name": {"key": "assetName", "type": "str"}, + "asset_version": {"key": "assetVersion", "type": "str"}, + "auto_delete_setting": { + "key": "autoDeleteSetting", + "type": "AutoDeleteSetting", + }, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword asset_name: Output Asset Name. :paramtype asset_name: str @@ -27621,13 +28229,13 @@ def __init__( :paramtype description: str """ super(TritonModelJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.asset_version = kwargs.get('asset_version', None) - self.auto_delete_setting = kwargs.get('auto_delete_setting', None) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'triton_model' # type: str - self.description = kwargs.get('description', None) + self.asset_name = kwargs.get("asset_name", None) + self.asset_version = kwargs.get("asset_version", None) + self.auto_delete_setting = kwargs.get("auto_delete_setting", None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "triton_model" # type: str + self.description = kwargs.get("description", None) class TruncationSelectionPolicy(EarlyTerminationPolicy): @@ -27648,20 +28256,20 @@ class TruncationSelectionPolicy(EarlyTerminationPolicy): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'truncation_percentage': {'key': 'truncationPercentage', 'type': 'int'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, + "truncation_percentage": { + "key": "truncationPercentage", + "type": "int", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword delay_evaluation: Number of intervals by which to delay the first evaluation. :paramtype delay_evaluation: int @@ -27671,8 +28279,8 @@ def __init__( :paramtype truncation_percentage: int """ super(TruncationSelectionPolicy, self).__init__(**kwargs) - self.policy_type = 'TruncationSelection' # type: str - self.truncation_percentage = kwargs.get('truncation_percentage', 0) + self.policy_type = "TruncationSelection" # type: str + self.truncation_percentage = kwargs.get("truncation_percentage", 0) class UpdateWorkspaceQuotas(msrest.serialization.Model): @@ -27696,23 +28304,20 @@ class UpdateWorkspaceQuotas(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, + "id": {"readonly": True}, + "type": {"readonly": True}, + "unit": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "limit": {"key": "limit", "type": "long"}, + "unit": {"key": "unit", "type": "str"}, + "status": {"key": "status", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword limit: The maximum permitted quota of the resource. :paramtype limit: long @@ -27725,9 +28330,9 @@ def __init__( super(UpdateWorkspaceQuotas, self).__init__(**kwargs) self.id = None self.type = None - self.limit = kwargs.get('limit', None) + self.limit = kwargs.get("limit", None) self.unit = None - self.status = kwargs.get('status', None) + self.status = kwargs.get("status", None) class UpdateWorkspaceQuotasResult(msrest.serialization.Model): @@ -27743,21 +28348,17 @@ class UpdateWorkspaceQuotasResult(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[UpdateWorkspaceQuotas]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[UpdateWorkspaceQuotas]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UpdateWorkspaceQuotasResult, self).__init__(**kwargs) self.value = None self.next_link = None @@ -27796,27 +28397,34 @@ class UriFileDataVersion(DataVersionBaseProperties): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "auto_delete_setting": { + "key": "autoDeleteSetting", + "type": "AutoDeleteSetting", + }, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, + "intellectual_property": { + "key": "intellectualProperty", + "type": "IntellectualProperty", + }, + "stage": {"key": "stage", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -27843,7 +28451,7 @@ def __init__( :paramtype stage: str """ super(UriFileDataVersion, self).__init__(**kwargs) - self.data_type = 'uri_file' # type: str + self.data_type = "uri_file" # type: str class UriFileJobInput(JobInput, AssetJobInput): @@ -27865,21 +28473,18 @@ class UriFileJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "min_length": 1, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -27890,10 +28495,10 @@ def __init__( :paramtype description: str """ super(UriFileJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'uri_file' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "uri_file" # type: str + self.description = kwargs.get("description", None) class UriFileJobOutput(JobOutput, AssetJobOutput): @@ -27921,23 +28526,23 @@ class UriFileJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "asset_name": {"key": "assetName", "type": "str"}, + "asset_version": {"key": "assetVersion", "type": "str"}, + "auto_delete_setting": { + "key": "autoDeleteSetting", + "type": "AutoDeleteSetting", + }, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword asset_name: Output Asset Name. :paramtype asset_name: str @@ -27954,13 +28559,13 @@ def __init__( :paramtype description: str """ super(UriFileJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.asset_version = kwargs.get('asset_version', None) - self.auto_delete_setting = kwargs.get('auto_delete_setting', None) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'uri_file' # type: str - self.description = kwargs.get('description', None) + self.asset_name = kwargs.get("asset_name", None) + self.asset_version = kwargs.get("asset_version", None) + self.auto_delete_setting = kwargs.get("auto_delete_setting", None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "uri_file" # type: str + self.description = kwargs.get("description", None) class UriFolderDataVersion(DataVersionBaseProperties): @@ -27996,27 +28601,34 @@ class UriFolderDataVersion(DataVersionBaseProperties): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "auto_delete_setting": { + "key": "autoDeleteSetting", + "type": "AutoDeleteSetting", + }, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, + "intellectual_property": { + "key": "intellectualProperty", + "type": "IntellectualProperty", + }, + "stage": {"key": "stage", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword description: The asset description text. :paramtype description: str @@ -28043,7 +28655,7 @@ def __init__( :paramtype stage: str """ super(UriFolderDataVersion, self).__init__(**kwargs) - self.data_type = 'uri_folder' # type: str + self.data_type = "uri_folder" # type: str class UriFolderJobInput(JobInput, AssetJobInput): @@ -28065,21 +28677,18 @@ class UriFolderJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "min_length": 1, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword mode: Input Asset Delivery Mode. Possible values include: "ReadOnlyMount", "ReadWriteMount", "Download", "Direct", "EvalMount", "EvalDownload". @@ -28090,10 +28699,10 @@ def __init__( :paramtype description: str """ super(UriFolderJobInput, self).__init__(**kwargs) - self.mode = kwargs.get('mode', None) - self.uri = kwargs['uri'] - self.job_input_type = 'uri_folder' # type: str - self.description = kwargs.get('description', None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs["uri"] + self.job_input_type = "uri_folder" # type: str + self.description = kwargs.get("description", None) class UriFolderJobOutput(JobOutput, AssetJobOutput): @@ -28121,23 +28730,23 @@ class UriFolderJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "asset_name": {"key": "assetName", "type": "str"}, + "asset_version": {"key": "assetVersion", "type": "str"}, + "auto_delete_setting": { + "key": "autoDeleteSetting", + "type": "AutoDeleteSetting", + }, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword asset_name: Output Asset Name. :paramtype asset_name: str @@ -28154,13 +28763,13 @@ def __init__( :paramtype description: str """ super(UriFolderJobOutput, self).__init__(**kwargs) - self.asset_name = kwargs.get('asset_name', None) - self.asset_version = kwargs.get('asset_version', None) - self.auto_delete_setting = kwargs.get('auto_delete_setting', None) - self.mode = kwargs.get('mode', None) - self.uri = kwargs.get('uri', None) - self.job_output_type = 'uri_folder' # type: str - self.description = kwargs.get('description', None) + self.asset_name = kwargs.get("asset_name", None) + self.asset_version = kwargs.get("asset_version", None) + self.auto_delete_setting = kwargs.get("auto_delete_setting", None) + self.mode = kwargs.get("mode", None) + self.uri = kwargs.get("uri", None) + self.job_output_type = "uri_folder" # type: str + self.description = kwargs.get("description", None) class Usage(msrest.serialization.Model): @@ -28185,31 +28794,30 @@ class Usage(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, + "id": {"readonly": True}, + "aml_workspace_location": {"readonly": True}, + "type": {"readonly": True}, + "unit": {"readonly": True}, + "current_value": {"readonly": True}, + "limit": {"readonly": True}, + "name": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'current_value': {'key': 'currentValue', 'type': 'long'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'name': {'key': 'name', 'type': 'UsageName'}, + "id": {"key": "id", "type": "str"}, + "aml_workspace_location": { + "key": "amlWorkspaceLocation", + "type": "str", + }, + "type": {"key": "type", "type": "str"}, + "unit": {"key": "unit", "type": "str"}, + "current_value": {"key": "currentValue", "type": "long"}, + "limit": {"key": "limit", "type": "long"}, + "name": {"key": "name", "type": "UsageName"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Usage, self).__init__(**kwargs) self.id = None self.aml_workspace_location = None @@ -28232,21 +28840,17 @@ class UsageName(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, + "value": {"readonly": True}, + "localized_value": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + "value": {"key": "value", "type": "str"}, + "localized_value": {"key": "localizedValue", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UsageName, self).__init__(**kwargs) self.value = None self.localized_value = None @@ -28267,19 +28871,19 @@ class UserAccountCredentials(msrest.serialization.Model): """ _validation = { - 'admin_user_name': {'required': True}, + "admin_user_name": {"required": True}, } _attribute_map = { - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'admin_user_ssh_public_key': {'key': 'adminUserSshPublicKey', 'type': 'str'}, - 'admin_user_password': {'key': 'adminUserPassword', 'type': 'str'}, + "admin_user_name": {"key": "adminUserName", "type": "str"}, + "admin_user_ssh_public_key": { + "key": "adminUserSshPublicKey", + "type": "str", + }, + "admin_user_password": {"key": "adminUserPassword", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword admin_user_name: Required. Name of the administrator user account which can be used to SSH to nodes. @@ -28290,9 +28894,11 @@ def __init__( :paramtype admin_user_password: str """ super(UserAccountCredentials, self).__init__(**kwargs) - self.admin_user_name = kwargs['admin_user_name'] - self.admin_user_ssh_public_key = kwargs.get('admin_user_ssh_public_key', None) - self.admin_user_password = kwargs.get('admin_user_password', None) + self.admin_user_name = kwargs["admin_user_name"] + self.admin_user_ssh_public_key = kwargs.get( + "admin_user_ssh_public_key", None + ) + self.admin_user_password = kwargs.get("admin_user_password", None) class UserAssignedIdentity(msrest.serialization.Model): @@ -28307,21 +28913,17 @@ class UserAssignedIdentity(msrest.serialization.Model): """ _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, + "principal_id": {"readonly": True}, + "client_id": {"readonly": True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, + "principal_id": {"key": "principalId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UserAssignedIdentity, self).__init__(**kwargs) self.principal_id = None self.client_id = None @@ -28335,19 +28937,16 @@ class UserCreatedAcrAccount(msrest.serialization.Model): """ _attribute_map = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, + "arm_resource_id": {"key": "armResourceId", "type": "ArmResourceId"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword arm_resource_id: ARM ResourceId of a resource. :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId """ super(UserCreatedAcrAccount, self).__init__(**kwargs) - self.arm_resource_id = kwargs.get('arm_resource_id', None) + self.arm_resource_id = kwargs.get("arm_resource_id", None) class UserCreatedStorageAccount(msrest.serialization.Model): @@ -28358,19 +28957,16 @@ class UserCreatedStorageAccount(msrest.serialization.Model): """ _attribute_map = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, + "arm_resource_id": {"key": "armResourceId", "type": "ArmResourceId"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword arm_resource_id: ARM ResourceId of a resource. :paramtype arm_resource_id: ~azure.mgmt.machinelearningservices.models.ArmResourceId """ super(UserCreatedStorageAccount, self).__init__(**kwargs) - self.arm_resource_id = kwargs.get('arm_resource_id', None) + self.arm_resource_id = kwargs.get("arm_resource_id", None) class UserIdentity(IdentityConfiguration): @@ -28385,24 +28981,22 @@ class UserIdentity(IdentityConfiguration): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UserIdentity, self).__init__(**kwargs) - self.identity_type = 'UserIdentity' # type: str + self.identity_type = "UserIdentity" # type: str -class UsernamePasswordAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class UsernamePasswordAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """UsernamePasswordAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -28429,23 +29023,23 @@ class UsernamePasswordAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionP """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionUsernamePassword'}, + "auth_type": {"key": "authType", "type": "str"}, + "expiry_time": {"key": "expiryTime", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionUsernamePassword", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword expiry_time: :paramtype expiry_time: str @@ -28464,9 +29058,11 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword """ - super(UsernamePasswordAuthTypeWorkspaceConnectionProperties, self).__init__(**kwargs) - self.auth_type = 'UsernamePassword' # type: str - self.credentials = kwargs.get('credentials', None) + super( + UsernamePasswordAuthTypeWorkspaceConnectionProperties, self + ).__init__(**kwargs) + self.auth_type = "UsernamePassword" # type: str + self.credentials = kwargs.get("credentials", None) class VirtualMachineSchema(msrest.serialization.Model): @@ -28477,20 +29073,20 @@ class VirtualMachineSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, + "properties": { + "key": "properties", + "type": "VirtualMachineSchemaProperties", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: :paramtype properties: ~azure.mgmt.machinelearningservices.models.VirtualMachineSchemaProperties """ super(VirtualMachineSchema, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.properties = kwargs.get("properties", None) class VirtualMachine(Compute, VirtualMachineSchema): @@ -28532,32 +29128,35 @@ class VirtualMachine(Compute, VirtualMachineSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": { + "key": "properties", + "type": "VirtualMachineSchemaProperties", + }, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: :paramtype properties: @@ -28573,17 +29172,17 @@ def __init__( :paramtype disable_local_auth: bool """ super(VirtualMachine, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.compute_type = 'VirtualMachine' # type: str - self.compute_location = kwargs.get('compute_location', None) + self.properties = kwargs.get("properties", None) + self.compute_type = "VirtualMachine" # type: str + self.compute_location = kwargs.get("compute_location", None) self.provisioning_state = None - self.description = kwargs.get('description', None) + self.description = kwargs.get("description", None) self.created_on = None self.modified_on = None - self.resource_id = kwargs.get('resource_id', None) + self.resource_id = kwargs.get("resource_id", None) self.provisioning_errors = None self.is_attached_compute = None - self.disable_local_auth = kwargs.get('disable_local_auth', None) + self.disable_local_auth = kwargs.get("disable_local_auth", None) class VirtualMachineImage(msrest.serialization.Model): @@ -28596,23 +29195,20 @@ class VirtualMachineImage(msrest.serialization.Model): """ _validation = { - 'id': {'required': True}, + "id": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword id: Required. Virtual Machine image path. :paramtype id: str """ super(VirtualMachineImage, self).__init__(**kwargs) - self.id = kwargs['id'] + self.id = kwargs["id"] class VirtualMachineSchemaProperties(msrest.serialization.Model): @@ -28635,18 +29231,21 @@ class VirtualMachineSchemaProperties(msrest.serialization.Model): """ _attribute_map = { - 'virtual_machine_size': {'key': 'virtualMachineSize', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'notebook_server_port': {'key': 'notebookServerPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'is_notebook_instance_compute': {'key': 'isNotebookInstanceCompute', 'type': 'bool'}, + "virtual_machine_size": {"key": "virtualMachineSize", "type": "str"}, + "ssh_port": {"key": "sshPort", "type": "int"}, + "notebook_server_port": {"key": "notebookServerPort", "type": "int"}, + "address": {"key": "address", "type": "str"}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, + "is_notebook_instance_compute": { + "key": "isNotebookInstanceCompute", + "type": "bool", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword virtual_machine_size: Virtual Machine size. :paramtype virtual_machine_size: str @@ -28664,12 +29263,14 @@ def __init__( :paramtype is_notebook_instance_compute: bool """ super(VirtualMachineSchemaProperties, self).__init__(**kwargs) - self.virtual_machine_size = kwargs.get('virtual_machine_size', None) - self.ssh_port = kwargs.get('ssh_port', None) - self.notebook_server_port = kwargs.get('notebook_server_port', None) - self.address = kwargs.get('address', None) - self.administrator_account = kwargs.get('administrator_account', None) - self.is_notebook_instance_compute = kwargs.get('is_notebook_instance_compute', None) + self.virtual_machine_size = kwargs.get("virtual_machine_size", None) + self.ssh_port = kwargs.get("ssh_port", None) + self.notebook_server_port = kwargs.get("notebook_server_port", None) + self.address = kwargs.get("address", None) + self.administrator_account = kwargs.get("administrator_account", None) + self.is_notebook_instance_compute = kwargs.get( + "is_notebook_instance_compute", None + ) class VirtualMachineSecretsSchema(msrest.serialization.Model): @@ -28681,20 +29282,20 @@ class VirtualMachineSecretsSchema(msrest.serialization.Model): """ _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword administrator_account: Admin credentials for virtual machine. :paramtype administrator_account: ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials """ super(VirtualMachineSecretsSchema, self).__init__(**kwargs) - self.administrator_account = kwargs.get('administrator_account', None) + self.administrator_account = kwargs.get("administrator_account", None) class VirtualMachineSecrets(ComputeSecrets, VirtualMachineSecretsSchema): @@ -28712,26 +29313,26 @@ class VirtualMachineSecrets(ComputeSecrets, VirtualMachineSecretsSchema): """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, + "compute_type": {"key": "computeType", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword administrator_account: Admin credentials for virtual machine. :paramtype administrator_account: ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials """ super(VirtualMachineSecrets, self).__init__(**kwargs) - self.administrator_account = kwargs.get('administrator_account', None) - self.compute_type = 'VirtualMachine' # type: str + self.administrator_account = kwargs.get("administrator_account", None) + self.compute_type = "VirtualMachine" # type: str class VirtualMachineSize(msrest.serialization.Model): @@ -28766,35 +29367,41 @@ class VirtualMachineSize(msrest.serialization.Model): """ _validation = { - 'name': {'readonly': True}, - 'family': {'readonly': True}, - 'v_cp_us': {'readonly': True}, - 'gpus': {'readonly': True}, - 'os_vhd_size_mb': {'readonly': True}, - 'max_resource_volume_mb': {'readonly': True}, - 'memory_gb': {'readonly': True}, - 'low_priority_capable': {'readonly': True}, - 'premium_io': {'readonly': True}, + "name": {"readonly": True}, + "family": {"readonly": True}, + "v_cp_us": {"readonly": True}, + "gpus": {"readonly": True}, + "os_vhd_size_mb": {"readonly": True}, + "max_resource_volume_mb": {"readonly": True}, + "memory_gb": {"readonly": True}, + "low_priority_capable": {"readonly": True}, + "premium_io": {"readonly": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'v_cp_us': {'key': 'vCPUs', 'type': 'int'}, - 'gpus': {'key': 'gpus', 'type': 'int'}, - 'os_vhd_size_mb': {'key': 'osVhdSizeMB', 'type': 'int'}, - 'max_resource_volume_mb': {'key': 'maxResourceVolumeMB', 'type': 'int'}, - 'memory_gb': {'key': 'memoryGB', 'type': 'float'}, - 'low_priority_capable': {'key': 'lowPriorityCapable', 'type': 'bool'}, - 'premium_io': {'key': 'premiumIO', 'type': 'bool'}, - 'estimated_vm_prices': {'key': 'estimatedVMPrices', 'type': 'EstimatedVMPrices'}, - 'supported_compute_types': {'key': 'supportedComputeTypes', 'type': '[str]'}, + "name": {"key": "name", "type": "str"}, + "family": {"key": "family", "type": "str"}, + "v_cp_us": {"key": "vCPUs", "type": "int"}, + "gpus": {"key": "gpus", "type": "int"}, + "os_vhd_size_mb": {"key": "osVhdSizeMB", "type": "int"}, + "max_resource_volume_mb": { + "key": "maxResourceVolumeMB", + "type": "int", + }, + "memory_gb": {"key": "memoryGB", "type": "float"}, + "low_priority_capable": {"key": "lowPriorityCapable", "type": "bool"}, + "premium_io": {"key": "premiumIO", "type": "bool"}, + "estimated_vm_prices": { + "key": "estimatedVMPrices", + "type": "EstimatedVMPrices", + }, + "supported_compute_types": { + "key": "supportedComputeTypes", + "type": "[str]", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword estimated_vm_prices: The estimated price information for using a VM. :paramtype estimated_vm_prices: ~azure.mgmt.machinelearningservices.models.EstimatedVMPrices @@ -28812,8 +29419,10 @@ def __init__( self.memory_gb = None self.low_priority_capable = None self.premium_io = None - self.estimated_vm_prices = kwargs.get('estimated_vm_prices', None) - self.supported_compute_types = kwargs.get('supported_compute_types', None) + self.estimated_vm_prices = kwargs.get("estimated_vm_prices", None) + self.supported_compute_types = kwargs.get( + "supported_compute_types", None + ) class VirtualMachineSizeListResult(msrest.serialization.Model): @@ -28824,19 +29433,16 @@ class VirtualMachineSizeListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[VirtualMachineSize]'}, + "value": {"key": "value", "type": "[VirtualMachineSize]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: The list of virtual machine sizes supported by AmlCompute. :paramtype value: list[~azure.mgmt.machinelearningservices.models.VirtualMachineSize] """ super(VirtualMachineSizeListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.value = kwargs.get("value", None) class VirtualMachineSshCredentials(msrest.serialization.Model): @@ -28853,16 +29459,13 @@ class VirtualMachineSshCredentials(msrest.serialization.Model): """ _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'public_key_data': {'key': 'publicKeyData', 'type': 'str'}, - 'private_key_data': {'key': 'privateKeyData', 'type': 'str'}, + "username": {"key": "username", "type": "str"}, + "password": {"key": "password", "type": "str"}, + "public_key_data": {"key": "publicKeyData", "type": "str"}, + "private_key_data": {"key": "privateKeyData", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword username: Username of admin account. :paramtype username: str @@ -28874,10 +29477,10 @@ def __init__( :paramtype private_key_data: str """ super(VirtualMachineSshCredentials, self).__init__(**kwargs) - self.username = kwargs.get('username', None) - self.password = kwargs.get('password', None) - self.public_key_data = kwargs.get('public_key_data', None) - self.private_key_data = kwargs.get('private_key_data', None) + self.username = kwargs.get("username", None) + self.password = kwargs.get("password", None) + self.public_key_data = kwargs.get("public_key_data", None) + self.private_key_data = kwargs.get("private_key_data", None) class VolumeDefinition(msrest.serialization.Model): @@ -28903,20 +29506,17 @@ class VolumeDefinition(msrest.serialization.Model): """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'read_only': {'key': 'readOnly', 'type': 'bool'}, - 'source': {'key': 'source', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'consistency': {'key': 'consistency', 'type': 'str'}, - 'bind': {'key': 'bind', 'type': 'BindOptions'}, - 'volume': {'key': 'volume', 'type': 'VolumeOptions'}, - 'tmpfs': {'key': 'tmpfs', 'type': 'TmpfsOptions'}, + "type": {"key": "type", "type": "str"}, + "read_only": {"key": "readOnly", "type": "bool"}, + "source": {"key": "source", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "consistency": {"key": "consistency", "type": "str"}, + "bind": {"key": "bind", "type": "BindOptions"}, + "volume": {"key": "volume", "type": "VolumeOptions"}, + "tmpfs": {"key": "tmpfs", "type": "TmpfsOptions"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword type: Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe. Possible values include: "bind", "volume", "tmpfs", "npipe". Default value: "bind". @@ -28938,14 +29538,14 @@ def __init__( :paramtype tmpfs: ~azure.mgmt.machinelearningservices.models.TmpfsOptions """ super(VolumeDefinition, self).__init__(**kwargs) - self.type = kwargs.get('type', "bind") - self.read_only = kwargs.get('read_only', None) - self.source = kwargs.get('source', None) - self.target = kwargs.get('target', None) - self.consistency = kwargs.get('consistency', None) - self.bind = kwargs.get('bind', None) - self.volume = kwargs.get('volume', None) - self.tmpfs = kwargs.get('tmpfs', None) + self.type = kwargs.get("type", "bind") + self.read_only = kwargs.get("read_only", None) + self.source = kwargs.get("source", None) + self.target = kwargs.get("target", None) + self.consistency = kwargs.get("consistency", None) + self.bind = kwargs.get("bind", None) + self.volume = kwargs.get("volume", None) + self.tmpfs = kwargs.get("tmpfs", None) class VolumeOptions(msrest.serialization.Model): @@ -28956,19 +29556,16 @@ class VolumeOptions(msrest.serialization.Model): """ _attribute_map = { - 'nocopy': {'key': 'nocopy', 'type': 'bool'}, + "nocopy": {"key": "nocopy", "type": "bool"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword nocopy: Indicate whether volume is nocopy. :paramtype nocopy: bool """ super(VolumeOptions, self).__init__(**kwargs) - self.nocopy = kwargs.get('nocopy', None) + self.nocopy = kwargs.get("nocopy", None) class Workspace(Resource): @@ -29100,78 +29697,153 @@ class Workspace(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'workspace_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'service_provisioned_resource_group': {'readonly': True}, - 'private_link_count': {'readonly': True}, - 'private_endpoint_connections': {'readonly': True}, - 'notebook_info': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'storage_hns_enabled': {'readonly': True}, - 'ml_flow_tracking_uri': {'readonly': True}, - 'soft_deleted_at': {'readonly': True}, - 'scheduled_purge_date': {'readonly': True}, - 'associated_workspaces': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'key_vault': {'key': 'properties.keyVault', 'type': 'str'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'storage_account': {'key': 'properties.storageAccount', 'type': 'str'}, - 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionProperty'}, - 'hbi_workspace': {'key': 'properties.hbiWorkspace', 'type': 'bool'}, - 'service_provisioned_resource_group': {'key': 'properties.serviceProvisionedResourceGroup', 'type': 'str'}, - 'private_link_count': {'key': 'properties.privateLinkCount', 'type': 'int'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'allow_public_access_when_behind_vnet': {'key': 'properties.allowPublicAccessWhenBehindVnet', 'type': 'bool'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, - 'shared_private_link_resources': {'key': 'properties.sharedPrivateLinkResources', 'type': '[SharedPrivateLinkResource]'}, - 'notebook_info': {'key': 'properties.notebookInfo', 'type': 'NotebookResourceInfo'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, - 'storage_hns_enabled': {'key': 'properties.storageHnsEnabled', 'type': 'bool'}, - 'ml_flow_tracking_uri': {'key': 'properties.mlFlowTrackingUri', 'type': 'str'}, - 'v1_legacy_mode': {'key': 'properties.v1LegacyMode', 'type': 'bool'}, - 'soft_deleted_at': {'key': 'properties.softDeletedAt', 'type': 'str'}, - 'scheduled_purge_date': {'key': 'properties.scheduledPurgeDate', 'type': 'str'}, - 'system_datastores_auth_mode': {'key': 'properties.systemDatastoresAuthMode', 'type': 'str'}, - 'feature_store_settings': {'key': 'properties.featureStoreSettings', 'type': 'FeatureStoreSettings'}, - 'soft_delete_retention_in_days': {'key': 'properties.softDeleteRetentionInDays', 'type': 'int'}, - 'enable_data_isolation': {'key': 'properties.enableDataIsolation', 'type': 'bool'}, - 'storage_accounts': {'key': 'properties.storageAccounts', 'type': '[str]'}, - 'key_vaults': {'key': 'properties.keyVaults', 'type': '[str]'}, - 'container_registries': {'key': 'properties.containerRegistries', 'type': '[str]'}, - 'existing_workspaces': {'key': 'properties.existingWorkspaces', 'type': '[str]'}, - 'hub_resource_id': {'key': 'properties.hubResourceId', 'type': 'str'}, - 'associated_workspaces': {'key': 'properties.associatedWorkspaces', 'type': '[str]'}, - 'managed_network': {'key': 'properties.managedNetwork', 'type': 'ManagedNetworkSettings'}, - } - - def __init__( - self, - **kwargs - ): + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "workspace_id": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "service_provisioned_resource_group": {"readonly": True}, + "private_link_count": {"readonly": True}, + "private_endpoint_connections": {"readonly": True}, + "notebook_info": {"readonly": True}, + "tenant_id": {"readonly": True}, + "storage_hns_enabled": {"readonly": True}, + "ml_flow_tracking_uri": {"readonly": True}, + "soft_deleted_at": {"readonly": True}, + "scheduled_purge_date": {"readonly": True}, + "associated_workspaces": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "kind": {"key": "kind", "type": "str"}, + "workspace_id": {"key": "properties.workspaceId", "type": "str"}, + "description": {"key": "properties.description", "type": "str"}, + "friendly_name": {"key": "properties.friendlyName", "type": "str"}, + "key_vault": {"key": "properties.keyVault", "type": "str"}, + "application_insights": { + "key": "properties.applicationInsights", + "type": "str", + }, + "container_registry": { + "key": "properties.containerRegistry", + "type": "str", + }, + "storage_account": {"key": "properties.storageAccount", "type": "str"}, + "discovery_url": {"key": "properties.discoveryUrl", "type": "str"}, + "provisioning_state": { + "key": "properties.provisioningState", + "type": "str", + }, + "encryption": { + "key": "properties.encryption", + "type": "EncryptionProperty", + }, + "hbi_workspace": {"key": "properties.hbiWorkspace", "type": "bool"}, + "service_provisioned_resource_group": { + "key": "properties.serviceProvisionedResourceGroup", + "type": "str", + }, + "private_link_count": { + "key": "properties.privateLinkCount", + "type": "int", + }, + "image_build_compute": { + "key": "properties.imageBuildCompute", + "type": "str", + }, + "allow_public_access_when_behind_vnet": { + "key": "properties.allowPublicAccessWhenBehindVnet", + "type": "bool", + }, + "public_network_access": { + "key": "properties.publicNetworkAccess", + "type": "str", + }, + "private_endpoint_connections": { + "key": "properties.privateEndpointConnections", + "type": "[PrivateEndpointConnection]", + }, + "shared_private_link_resources": { + "key": "properties.sharedPrivateLinkResources", + "type": "[SharedPrivateLinkResource]", + }, + "notebook_info": { + "key": "properties.notebookInfo", + "type": "NotebookResourceInfo", + }, + "service_managed_resources_settings": { + "key": "properties.serviceManagedResourcesSettings", + "type": "ServiceManagedResourcesSettings", + }, + "primary_user_assigned_identity": { + "key": "properties.primaryUserAssignedIdentity", + "type": "str", + }, + "tenant_id": {"key": "properties.tenantId", "type": "str"}, + "storage_hns_enabled": { + "key": "properties.storageHnsEnabled", + "type": "bool", + }, + "ml_flow_tracking_uri": { + "key": "properties.mlFlowTrackingUri", + "type": "str", + }, + "v1_legacy_mode": {"key": "properties.v1LegacyMode", "type": "bool"}, + "soft_deleted_at": {"key": "properties.softDeletedAt", "type": "str"}, + "scheduled_purge_date": { + "key": "properties.scheduledPurgeDate", + "type": "str", + }, + "system_datastores_auth_mode": { + "key": "properties.systemDatastoresAuthMode", + "type": "str", + }, + "feature_store_settings": { + "key": "properties.featureStoreSettings", + "type": "FeatureStoreSettings", + }, + "soft_delete_retention_in_days": { + "key": "properties.softDeleteRetentionInDays", + "type": "int", + }, + "enable_data_isolation": { + "key": "properties.enableDataIsolation", + "type": "bool", + }, + "storage_accounts": { + "key": "properties.storageAccounts", + "type": "[str]", + }, + "key_vaults": {"key": "properties.keyVaults", "type": "[str]"}, + "container_registries": { + "key": "properties.containerRegistries", + "type": "[str]", + }, + "existing_workspaces": { + "key": "properties.existingWorkspaces", + "type": "[str]", + }, + "hub_resource_id": {"key": "properties.hubResourceId", "type": "str"}, + "associated_workspaces": { + "key": "properties.associatedWorkspaces", + "type": "[str]", + }, + "managed_network": { + "key": "properties.managedNetwork", + "type": "ManagedNetworkSettings", + }, + } + + def __init__(self, **kwargs): """ :keyword identity: The identity of the resource. :paramtype identity: ~azure.mgmt.machinelearningservices.models.ManagedServiceIdentity @@ -29254,49 +29926,63 @@ def __init__( :paramtype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings """ super(Workspace, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) - self.kind = kwargs.get('kind', None) + self.identity = kwargs.get("identity", None) + self.location = kwargs.get("location", None) + self.tags = kwargs.get("tags", None) + self.sku = kwargs.get("sku", None) + self.kind = kwargs.get("kind", None) self.workspace_id = None - self.description = kwargs.get('description', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.key_vault = kwargs.get('key_vault', None) - self.application_insights = kwargs.get('application_insights', None) - self.container_registry = kwargs.get('container_registry', None) - self.storage_account = kwargs.get('storage_account', None) - self.discovery_url = kwargs.get('discovery_url', None) + self.description = kwargs.get("description", None) + self.friendly_name = kwargs.get("friendly_name", None) + self.key_vault = kwargs.get("key_vault", None) + self.application_insights = kwargs.get("application_insights", None) + self.container_registry = kwargs.get("container_registry", None) + self.storage_account = kwargs.get("storage_account", None) + self.discovery_url = kwargs.get("discovery_url", None) self.provisioning_state = None - self.encryption = kwargs.get('encryption', None) - self.hbi_workspace = kwargs.get('hbi_workspace', False) + self.encryption = kwargs.get("encryption", None) + self.hbi_workspace = kwargs.get("hbi_workspace", False) self.service_provisioned_resource_group = None self.private_link_count = None - self.image_build_compute = kwargs.get('image_build_compute', None) - self.allow_public_access_when_behind_vnet = kwargs.get('allow_public_access_when_behind_vnet', False) - self.public_network_access = kwargs.get('public_network_access', None) + self.image_build_compute = kwargs.get("image_build_compute", None) + self.allow_public_access_when_behind_vnet = kwargs.get( + "allow_public_access_when_behind_vnet", False + ) + self.public_network_access = kwargs.get("public_network_access", None) self.private_endpoint_connections = None - self.shared_private_link_resources = kwargs.get('shared_private_link_resources', None) + self.shared_private_link_resources = kwargs.get( + "shared_private_link_resources", None + ) self.notebook_info = None - self.service_managed_resources_settings = kwargs.get('service_managed_resources_settings', None) - self.primary_user_assigned_identity = kwargs.get('primary_user_assigned_identity', None) + self.service_managed_resources_settings = kwargs.get( + "service_managed_resources_settings", None + ) + self.primary_user_assigned_identity = kwargs.get( + "primary_user_assigned_identity", None + ) self.tenant_id = None self.storage_hns_enabled = None self.ml_flow_tracking_uri = None - self.v1_legacy_mode = kwargs.get('v1_legacy_mode', False) + self.v1_legacy_mode = kwargs.get("v1_legacy_mode", False) self.soft_deleted_at = None self.scheduled_purge_date = None - self.system_datastores_auth_mode = kwargs.get('system_datastores_auth_mode', None) - self.feature_store_settings = kwargs.get('feature_store_settings', None) - self.soft_delete_retention_in_days = kwargs.get('soft_delete_retention_in_days', None) - self.enable_data_isolation = kwargs.get('enable_data_isolation', False) - self.storage_accounts = kwargs.get('storage_accounts', None) - self.key_vaults = kwargs.get('key_vaults', None) - self.container_registries = kwargs.get('container_registries', None) - self.existing_workspaces = kwargs.get('existing_workspaces', None) - self.hub_resource_id = kwargs.get('hub_resource_id', None) + self.system_datastores_auth_mode = kwargs.get( + "system_datastores_auth_mode", None + ) + self.feature_store_settings = kwargs.get( + "feature_store_settings", None + ) + self.soft_delete_retention_in_days = kwargs.get( + "soft_delete_retention_in_days", None + ) + self.enable_data_isolation = kwargs.get("enable_data_isolation", False) + self.storage_accounts = kwargs.get("storage_accounts", None) + self.key_vaults = kwargs.get("key_vaults", None) + self.container_registries = kwargs.get("container_registries", None) + self.existing_workspaces = kwargs.get("existing_workspaces", None) + self.hub_resource_id = kwargs.get("hub_resource_id", None) self.associated_workspaces = None - self.managed_network = kwargs.get('managed_network', None) + self.managed_network = kwargs.get("managed_network", None) class WorkspaceConnectionAccessKey(msrest.serialization.Model): @@ -29309,14 +29995,11 @@ class WorkspaceConnectionAccessKey(msrest.serialization.Model): """ _attribute_map = { - 'access_key_id': {'key': 'accessKeyId', 'type': 'str'}, - 'secret_access_key': {'key': 'secretAccessKey', 'type': 'str'}, + "access_key_id": {"key": "accessKeyId", "type": "str"}, + "secret_access_key": {"key": "secretAccessKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword access_key_id: :paramtype access_key_id: str @@ -29324,8 +30007,8 @@ def __init__( :paramtype secret_access_key: str """ super(WorkspaceConnectionAccessKey, self).__init__(**kwargs) - self.access_key_id = kwargs.get('access_key_id', None) - self.secret_access_key = kwargs.get('secret_access_key', None) + self.access_key_id = kwargs.get("access_key_id", None) + self.secret_access_key = kwargs.get("secret_access_key", None) class WorkspaceConnectionManagedIdentity(msrest.serialization.Model): @@ -29338,14 +30021,11 @@ class WorkspaceConnectionManagedIdentity(msrest.serialization.Model): """ _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, + "resource_id": {"key": "resourceId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword resource_id: :paramtype resource_id: str @@ -29353,8 +30033,8 @@ def __init__( :paramtype client_id: str """ super(WorkspaceConnectionManagedIdentity, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.client_id = kwargs.get('client_id', None) + self.resource_id = kwargs.get("resource_id", None) + self.client_id = kwargs.get("client_id", None) class WorkspaceConnectionPersonalAccessToken(msrest.serialization.Model): @@ -29365,19 +30045,16 @@ class WorkspaceConnectionPersonalAccessToken(msrest.serialization.Model): """ _attribute_map = { - 'pat': {'key': 'pat', 'type': 'str'}, + "pat": {"key": "pat", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword pat: :paramtype pat: str """ super(WorkspaceConnectionPersonalAccessToken, self).__init__(**kwargs) - self.pat = kwargs.get('pat', None) + self.pat = kwargs.get("pat", None) class WorkspaceConnectionPropertiesV2BasicResource(Resource): @@ -29403,35 +30080,39 @@ class WorkspaceConnectionPropertiesV2BasicResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'WorkspaceConnectionPropertiesV2'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "WorkspaceConnectionPropertiesV2", + }, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword properties: Required. :paramtype properties: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 """ - super(WorkspaceConnectionPropertiesV2BasicResource, self).__init__(**kwargs) - self.properties = kwargs['properties'] + super(WorkspaceConnectionPropertiesV2BasicResource, self).__init__( + **kwargs + ) + self.properties = kwargs["properties"] -class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(msrest.serialization.Model): +class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult( + msrest.serialization.Model +): """WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult. Variables are only populated by the server, and will be ignored when sending a request. @@ -29444,25 +30125,28 @@ class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(msrest.seri """ _validation = { - 'next_link': {'readonly': True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[WorkspaceConnectionPropertiesV2BasicResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": { + "key": "value", + "type": "[WorkspaceConnectionPropertiesV2BasicResource]", + }, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: :paramtype value: list[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource] """ - super(WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + super( + WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, + self, + ).__init__(**kwargs) + self.value = kwargs.get("value", None) self.next_link = None @@ -29478,15 +30162,12 @@ class WorkspaceConnectionServicePrincipal(msrest.serialization.Model): """ _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + "client_id": {"key": "clientId", "type": "str"}, + "client_secret": {"key": "clientSecret", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword client_id: :paramtype client_id: str @@ -29496,9 +30177,9 @@ def __init__( :paramtype tenant_id: str """ super(WorkspaceConnectionServicePrincipal, self).__init__(**kwargs) - self.client_id = kwargs.get('client_id', None) - self.client_secret = kwargs.get('client_secret', None) - self.tenant_id = kwargs.get('tenant_id', None) + self.client_id = kwargs.get("client_id", None) + self.client_secret = kwargs.get("client_secret", None) + self.tenant_id = kwargs.get("tenant_id", None) class WorkspaceConnectionSharedAccessSignature(msrest.serialization.Model): @@ -29509,19 +30190,18 @@ class WorkspaceConnectionSharedAccessSignature(msrest.serialization.Model): """ _attribute_map = { - 'sas': {'key': 'sas', 'type': 'str'}, + "sas": {"key": "sas", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword sas: :paramtype sas: str """ - super(WorkspaceConnectionSharedAccessSignature, self).__init__(**kwargs) - self.sas = kwargs.get('sas', None) + super(WorkspaceConnectionSharedAccessSignature, self).__init__( + **kwargs + ) + self.sas = kwargs.get("sas", None) class WorkspaceConnectionUsernamePassword(msrest.serialization.Model): @@ -29534,14 +30214,11 @@ class WorkspaceConnectionUsernamePassword(msrest.serialization.Model): """ _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, + "username": {"key": "username", "type": "str"}, + "password": {"key": "password", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword username: :paramtype username: str @@ -29549,8 +30226,8 @@ def __init__( :paramtype password: str """ super(WorkspaceConnectionUsernamePassword, self).__init__(**kwargs) - self.username = kwargs.get('username', None) - self.password = kwargs.get('password', None) + self.username = kwargs.get("username", None) + self.password = kwargs.get("password", None) class WorkspaceListResult(msrest.serialization.Model): @@ -29565,14 +30242,11 @@ class WorkspaceListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[Workspace]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Workspace]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, **kwargs): """ :keyword value: The list of machine learning workspaces. Since this list may be incomplete, the nextLink field should be used to request the next list of machine learning workspaces. @@ -29582,8 +30256,8 @@ def __init__( :paramtype next_link: str """ super(WorkspaceListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get("value", None) + self.next_link = kwargs.get("next_link", None) class WorkspaceUpdateParameters(msrest.serialization.Model): @@ -29625,26 +30299,50 @@ class WorkspaceUpdateParameters(msrest.serialization.Model): """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionUpdateProperties'}, - 'feature_store_settings': {'key': 'properties.featureStoreSettings', 'type': 'FeatureStoreSettings'}, - 'managed_network': {'key': 'properties.managedNetwork', 'type': 'ManagedNetworkSettings'}, - } - - def __init__( - self, - **kwargs - ): + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "description": {"key": "properties.description", "type": "str"}, + "friendly_name": {"key": "properties.friendlyName", "type": "str"}, + "image_build_compute": { + "key": "properties.imageBuildCompute", + "type": "str", + }, + "service_managed_resources_settings": { + "key": "properties.serviceManagedResourcesSettings", + "type": "ServiceManagedResourcesSettings", + }, + "primary_user_assigned_identity": { + "key": "properties.primaryUserAssignedIdentity", + "type": "str", + }, + "public_network_access": { + "key": "properties.publicNetworkAccess", + "type": "str", + }, + "application_insights": { + "key": "properties.applicationInsights", + "type": "str", + }, + "container_registry": { + "key": "properties.containerRegistry", + "type": "str", + }, + "encryption": { + "key": "properties.encryption", + "type": "EncryptionUpdateProperties", + }, + "feature_store_settings": { + "key": "properties.featureStoreSettings", + "type": "FeatureStoreSettings", + }, + "managed_network": { + "key": "properties.managedNetwork", + "type": "ManagedNetworkSettings", + }, + } + + def __init__(self, **kwargs): """ :keyword tags: A set of tags. The resource tags for the machine learning workspace. :paramtype tags: dict[str, str] @@ -29682,17 +30380,23 @@ def __init__( :paramtype managed_network: ~azure.mgmt.machinelearningservices.models.ManagedNetworkSettings """ super(WorkspaceUpdateParameters, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) - self.identity = kwargs.get('identity', None) - self.description = kwargs.get('description', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.image_build_compute = kwargs.get('image_build_compute', None) - self.service_managed_resources_settings = kwargs.get('service_managed_resources_settings', None) - self.primary_user_assigned_identity = kwargs.get('primary_user_assigned_identity', None) - self.public_network_access = kwargs.get('public_network_access', None) - self.application_insights = kwargs.get('application_insights', None) - self.container_registry = kwargs.get('container_registry', None) - self.encryption = kwargs.get('encryption', None) - self.feature_store_settings = kwargs.get('feature_store_settings', None) - self.managed_network = kwargs.get('managed_network', None) + self.tags = kwargs.get("tags", None) + self.sku = kwargs.get("sku", None) + self.identity = kwargs.get("identity", None) + self.description = kwargs.get("description", None) + self.friendly_name = kwargs.get("friendly_name", None) + self.image_build_compute = kwargs.get("image_build_compute", None) + self.service_managed_resources_settings = kwargs.get( + "service_managed_resources_settings", None + ) + self.primary_user_assigned_identity = kwargs.get( + "primary_user_assigned_identity", None + ) + self.public_network_access = kwargs.get("public_network_access", None) + self.application_insights = kwargs.get("application_insights", None) + self.container_registry = kwargs.get("container_registry", None) + self.encryption = kwargs.get("encryption", None) + self.feature_store_settings = kwargs.get( + "feature_store_settings", None + ) + self.managed_network = kwargs.get("managed_network", None) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/models/_models_py3.py index b8e2b7bcd701..8d46804a93ce 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/models/_models_py3.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/models/_models_py3.py @@ -42,20 +42,28 @@ class WorkspaceConnectionPropertiesV2(msrest.serialization.Model): """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, + "auth_type": {"key": "authType", "type": "str"}, + "expiry_time": {"key": "expiryTime", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, } _subtype_map = { - 'auth_type': {'AccessKey': 'AccessKeyAuthTypeWorkspaceConnectionProperties', 'ManagedIdentity': 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', 'None': 'NoneAuthTypeWorkspaceConnectionProperties', 'PAT': 'PATAuthTypeWorkspaceConnectionProperties', 'SAS': 'SASAuthTypeWorkspaceConnectionProperties', 'ServicePrincipal': 'ServicePrincipalAuthTypeWorkspaceConnectionProperties', 'UsernamePassword': 'UsernamePasswordAuthTypeWorkspaceConnectionProperties'} + "auth_type": { + "AccessKey": "AccessKeyAuthTypeWorkspaceConnectionProperties", + "ManagedIdentity": "ManagedIdentityAuthTypeWorkspaceConnectionProperties", + "None": "NoneAuthTypeWorkspaceConnectionProperties", + "PAT": "PATAuthTypeWorkspaceConnectionProperties", + "SAS": "SASAuthTypeWorkspaceConnectionProperties", + "ServicePrincipal": "ServicePrincipalAuthTypeWorkspaceConnectionProperties", + "UsernamePassword": "UsernamePasswordAuthTypeWorkspaceConnectionProperties", + } } def __init__( @@ -92,7 +100,9 @@ def __init__( self.value_format = value_format -class AccessKeyAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class AccessKeyAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """AccessKeyAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -118,17 +128,20 @@ class AccessKeyAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionProperti """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionAccessKey'}, + "auth_type": {"key": "authType", "type": "str"}, + "expiry_time": {"key": "expiryTime", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionAccessKey", + }, } def __init__( @@ -159,8 +172,15 @@ def __init__( :keyword credentials: :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionAccessKey """ - super(AccessKeyAuthTypeWorkspaceConnectionProperties, self).__init__(expiry_time=expiry_time, category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'AccessKey' # type: str + super(AccessKeyAuthTypeWorkspaceConnectionProperties, self).__init__( + expiry_time=expiry_time, + category=category, + target=target, + value=value, + value_format=value_format, + **kwargs + ) + self.auth_type = "AccessKey" # type: str self.credentials = credentials @@ -179,23 +199,27 @@ class DatastoreCredentials(msrest.serialization.Model): """ _validation = { - 'credentials_type': {'required': True}, + "credentials_type": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, } _subtype_map = { - 'credentials_type': {'AccountKey': 'AccountKeyDatastoreCredentials', 'Certificate': 'CertificateDatastoreCredentials', 'KerberosKeytab': 'KerberosKeytabCredentials', 'KerberosPassword': 'KerberosPasswordCredentials', 'None': 'NoneDatastoreCredentials', 'Sas': 'SasDatastoreCredentials', 'ServicePrincipal': 'ServicePrincipalDatastoreCredentials'} - } - - def __init__( - self, - **kwargs - ): - """ - """ + "credentials_type": { + "AccountKey": "AccountKeyDatastoreCredentials", + "Certificate": "CertificateDatastoreCredentials", + "KerberosKeytab": "KerberosKeytabCredentials", + "KerberosPassword": "KerberosPasswordCredentials", + "None": "NoneDatastoreCredentials", + "Sas": "SasDatastoreCredentials", + "ServicePrincipal": "ServicePrincipalDatastoreCredentials", + } + } + + def __init__(self, **kwargs): + """ """ super(DatastoreCredentials, self).__init__(**kwargs) self.credentials_type = None # type: Optional[str] @@ -214,27 +238,22 @@ class AccountKeyDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, + "credentials_type": {"required": True}, + "secrets": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'AccountKeyDatastoreSecrets'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "secrets": {"key": "secrets", "type": "AccountKeyDatastoreSecrets"}, } - def __init__( - self, - *, - secrets: "AccountKeyDatastoreSecrets", - **kwargs - ): + def __init__(self, *, secrets: "AccountKeyDatastoreSecrets", **kwargs): """ :keyword secrets: Required. [Required] Storage account secrets. :paramtype secrets: ~azure.mgmt.machinelearningservices.models.AccountKeyDatastoreSecrets """ super(AccountKeyDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'AccountKey' # type: str + self.credentials_type = "AccountKey" # type: str self.secrets = secrets @@ -253,23 +272,26 @@ class DatastoreSecrets(msrest.serialization.Model): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, } _subtype_map = { - 'secrets_type': {'AccountKey': 'AccountKeyDatastoreSecrets', 'Certificate': 'CertificateDatastoreSecrets', 'KerberosKeytab': 'KerberosKeytabSecrets', 'KerberosPassword': 'KerberosPasswordSecrets', 'Sas': 'SasDatastoreSecrets', 'ServicePrincipal': 'ServicePrincipalDatastoreSecrets'} - } - - def __init__( - self, - **kwargs - ): - """ - """ + "secrets_type": { + "AccountKey": "AccountKeyDatastoreSecrets", + "Certificate": "CertificateDatastoreSecrets", + "KerberosKeytab": "KerberosKeytabSecrets", + "KerberosPassword": "KerberosPasswordSecrets", + "Sas": "SasDatastoreSecrets", + "ServicePrincipal": "ServicePrincipalDatastoreSecrets", + } + } + + def __init__(self, **kwargs): + """ """ super(DatastoreSecrets, self).__init__(**kwargs) self.secrets_type = None # type: Optional[str] @@ -288,26 +310,21 @@ class AccountKeyDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "key": {"key": "key", "type": "str"}, } - def __init__( - self, - *, - key: Optional[str] = None, - **kwargs - ): + def __init__(self, *, key: Optional[str] = None, **kwargs): """ :keyword key: Storage account key. :paramtype key: str """ super(AccountKeyDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'AccountKey' # type: str + self.secrets_type = "AccountKey" # type: str self.key = key @@ -325,8 +342,14 @@ class AcrDetails(msrest.serialization.Model): """ _attribute_map = { - 'system_created_acr_account': {'key': 'systemCreatedAcrAccount', 'type': 'SystemCreatedAcrAccount'}, - 'user_created_acr_account': {'key': 'userCreatedAcrAccount', 'type': 'UserCreatedAcrAccount'}, + "system_created_acr_account": { + "key": "systemCreatedAcrAccount", + "type": "SystemCreatedAcrAccount", + }, + "user_created_acr_account": { + "key": "userCreatedAcrAccount", + "type": "UserCreatedAcrAccount", + }, } def __init__( @@ -359,14 +382,11 @@ class AKSSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, + "properties": {"key": "properties", "type": "AKSSchemaProperties"}, } def __init__( - self, - *, - properties: Optional["AKSSchemaProperties"] = None, - **kwargs + self, *, properties: Optional["AKSSchemaProperties"] = None, **kwargs ): """ :keyword properties: AKS properties. @@ -416,29 +436,43 @@ class Compute(msrest.serialization.Model): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } _subtype_map = { - 'compute_type': {'AKS': 'AKS', 'AmlCompute': 'AmlCompute', 'ComputeInstance': 'ComputeInstance', 'DataFactory': 'DataFactory', 'DataLakeAnalytics': 'DataLakeAnalytics', 'Databricks': 'Databricks', 'HDInsight': 'HDInsight', 'Kubernetes': 'Kubernetes', 'SynapseSpark': 'SynapseSpark', 'VirtualMachine': 'VirtualMachine'} + "compute_type": { + "AKS": "AKS", + "AmlCompute": "AmlCompute", + "ComputeInstance": "ComputeInstance", + "DataFactory": "DataFactory", + "DataLakeAnalytics": "DataLakeAnalytics", + "Databricks": "Databricks", + "HDInsight": "HDInsight", + "Kubernetes": "Kubernetes", + "SynapseSpark": "SynapseSpark", + "VirtualMachine": "VirtualMachine", + } } def __init__( @@ -513,26 +547,29 @@ class AKS(Compute, AKSSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AKSSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "AKSSchemaProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -558,9 +595,16 @@ def __init__( MSI and AAD exclusively for authentication. :paramtype disable_local_auth: bool """ - super(AKS, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) + super(AKS, self).__init__( + compute_location=compute_location, + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'AKS' # type: str + self.compute_type = "AKS" # type: str self.compute_location = compute_location self.provisioning_state = None self.description = description @@ -586,9 +630,12 @@ class AksComputeSecretsProperties(msrest.serialization.Model): """ _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, + "user_kube_config": {"key": "userKubeConfig", "type": "str"}, + "admin_kube_config": {"key": "adminKubeConfig", "type": "str"}, + "image_pull_secret_name": { + "key": "imagePullSecretName", + "type": "str", + }, } def __init__( @@ -630,23 +677,23 @@ class ComputeSecrets(msrest.serialization.Model): """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "compute_type": {"key": "computeType", "type": "str"}, } _subtype_map = { - 'compute_type': {'AKS': 'AksComputeSecrets', 'Databricks': 'DatabricksComputeSecrets', 'VirtualMachine': 'VirtualMachineSecrets'} + "compute_type": { + "AKS": "AksComputeSecrets", + "Databricks": "DatabricksComputeSecrets", + "VirtualMachine": "VirtualMachineSecrets", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ComputeSecrets, self).__init__(**kwargs) self.compute_type = None # type: Optional[str] @@ -671,14 +718,17 @@ class AksComputeSecrets(ComputeSecrets, AksComputeSecretsProperties): """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'user_kube_config': {'key': 'userKubeConfig', 'type': 'str'}, - 'admin_kube_config': {'key': 'adminKubeConfig', 'type': 'str'}, - 'image_pull_secret_name': {'key': 'imagePullSecretName', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "user_kube_config": {"key": "userKubeConfig", "type": "str"}, + "admin_kube_config": {"key": "adminKubeConfig", "type": "str"}, + "image_pull_secret_name": { + "key": "imagePullSecretName", + "type": "str", + }, + "compute_type": {"key": "computeType", "type": "str"}, } def __init__( @@ -699,11 +749,16 @@ def __init__( :keyword image_pull_secret_name: Image registry pull secret. :paramtype image_pull_secret_name: str """ - super(AksComputeSecrets, self).__init__(user_kube_config=user_kube_config, admin_kube_config=admin_kube_config, image_pull_secret_name=image_pull_secret_name, **kwargs) + super(AksComputeSecrets, self).__init__( + user_kube_config=user_kube_config, + admin_kube_config=admin_kube_config, + image_pull_secret_name=image_pull_secret_name, + **kwargs + ) self.user_kube_config = user_kube_config self.admin_kube_config = admin_kube_config self.image_pull_secret_name = image_pull_secret_name - self.compute_type = 'AKS' # type: str + self.compute_type = "AKS" # type: str class AksNetworkingConfiguration(msrest.serialization.Model): @@ -723,16 +778,22 @@ class AksNetworkingConfiguration(msrest.serialization.Model): """ _validation = { - 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, - 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, + "service_cidr": { + "pattern": r"^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$" + }, + "dns_service_ip": { + "pattern": r"^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" + }, + "docker_bridge_cidr": { + "pattern": r"^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$" + }, } _attribute_map = { - 'subnet_id': {'key': 'subnetId', 'type': 'str'}, - 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, - 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, - 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, + "subnet_id": {"key": "subnetId", "type": "str"}, + "service_cidr": {"key": "serviceCidr", "type": "str"}, + "dns_service_ip": {"key": "dnsServiceIP", "type": "str"}, + "docker_bridge_cidr": {"key": "dockerBridgeCidr", "type": "str"}, } def __init__( @@ -793,20 +854,29 @@ class AKSSchemaProperties(msrest.serialization.Model): """ _validation = { - 'system_services': {'readonly': True}, - 'agent_count': {'minimum': 0}, + "system_services": {"readonly": True}, + "agent_count": {"minimum": 0}, } _attribute_map = { - 'cluster_fqdn': {'key': 'clusterFqdn', 'type': 'str'}, - 'system_services': {'key': 'systemServices', 'type': '[SystemService]'}, - 'agent_count': {'key': 'agentCount', 'type': 'int'}, - 'agent_vm_size': {'key': 'agentVmSize', 'type': 'str'}, - 'cluster_purpose': {'key': 'clusterPurpose', 'type': 'str'}, - 'ssl_configuration': {'key': 'sslConfiguration', 'type': 'SslConfiguration'}, - 'aks_networking_configuration': {'key': 'aksNetworkingConfiguration', 'type': 'AksNetworkingConfiguration'}, - 'load_balancer_type': {'key': 'loadBalancerType', 'type': 'str'}, - 'load_balancer_subnet': {'key': 'loadBalancerSubnet', 'type': 'str'}, + "cluster_fqdn": {"key": "clusterFqdn", "type": "str"}, + "system_services": { + "key": "systemServices", + "type": "[SystemService]", + }, + "agent_count": {"key": "agentCount", "type": "int"}, + "agent_vm_size": {"key": "agentVmSize", "type": "str"}, + "cluster_purpose": {"key": "clusterPurpose", "type": "str"}, + "ssl_configuration": { + "key": "sslConfiguration", + "type": "SslConfiguration", + }, + "aks_networking_configuration": { + "key": "aksNetworkingConfiguration", + "type": "AksNetworkingConfiguration", + }, + "load_balancer_type": {"key": "loadBalancerType", "type": "str"}, + "load_balancer_subnet": {"key": "loadBalancerSubnet", "type": "str"}, } def __init__( @@ -817,8 +887,12 @@ def __init__( agent_vm_size: Optional[str] = None, cluster_purpose: Optional[Union[str, "ClusterPurpose"]] = "FastProd", ssl_configuration: Optional["SslConfiguration"] = None, - aks_networking_configuration: Optional["AksNetworkingConfiguration"] = None, - load_balancer_type: Optional[Union[str, "LoadBalancerType"]] = "PublicIp", + aks_networking_configuration: Optional[ + "AksNetworkingConfiguration" + ] = None, + load_balancer_type: Optional[ + Union[str, "LoadBalancerType"] + ] = "PublicIp", load_balancer_subnet: Optional[str] = None, **kwargs ): @@ -872,23 +946,23 @@ class MonitoringFeatureFilterBase(msrest.serialization.Model): """ _validation = { - 'filter_type': {'required': True}, + "filter_type": {"required": True}, } _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, + "filter_type": {"key": "filterType", "type": "str"}, } _subtype_map = { - 'filter_type': {'AllFeatures': 'AllFeatures', 'FeatureSubset': 'FeatureSubset', 'TopNByAttribution': 'TopNFeaturesByAttribution'} + "filter_type": { + "AllFeatures": "AllFeatures", + "FeatureSubset": "FeatureSubset", + "TopNByAttribution": "TopNFeaturesByAttribution", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(MonitoringFeatureFilterBase, self).__init__(**kwargs) self.filter_type = None # type: Optional[str] @@ -906,21 +980,17 @@ class AllFeatures(MonitoringFeatureFilterBase): """ _validation = { - 'filter_type': {'required': True}, + "filter_type": {"required": True}, } _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, + "filter_type": {"key": "filterType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AllFeatures, self).__init__(**kwargs) - self.filter_type = 'AllFeatures' # type: str + self.filter_type = "AllFeatures" # type: str class Nodes(msrest.serialization.Model): @@ -937,23 +1007,17 @@ class Nodes(msrest.serialization.Model): """ _validation = { - 'nodes_value_type': {'required': True}, + "nodes_value_type": {"required": True}, } _attribute_map = { - 'nodes_value_type': {'key': 'nodesValueType', 'type': 'str'}, + "nodes_value_type": {"key": "nodesValueType", "type": "str"}, } - _subtype_map = { - 'nodes_value_type': {'All': 'AllNodes'} - } + _subtype_map = {"nodes_value_type": {"All": "AllNodes"}} - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Nodes, self).__init__(**kwargs) self.nodes_value_type = None # type: Optional[str] @@ -969,21 +1033,17 @@ class AllNodes(Nodes): """ _validation = { - 'nodes_value_type': {'required': True}, + "nodes_value_type": {"required": True}, } _attribute_map = { - 'nodes_value_type': {'key': 'nodesValueType', 'type': 'str'}, + "nodes_value_type": {"key": "nodesValueType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AllNodes, self).__init__(**kwargs) - self.nodes_value_type = 'All' # type: str + self.nodes_value_type = "All" # type: str class AmlComputeSchema(msrest.serialization.Model): @@ -994,14 +1054,11 @@ class AmlComputeSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, + "properties": {"key": "properties", "type": "AmlComputeProperties"}, } def __init__( - self, - *, - properties: Optional["AmlComputeProperties"] = None, - **kwargs + self, *, properties: Optional["AmlComputeProperties"] = None, **kwargs ): """ :keyword properties: Properties of AmlCompute. @@ -1050,26 +1107,29 @@ class AmlCompute(Compute, AmlComputeSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "AmlComputeProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -1095,9 +1155,16 @@ def __init__( MSI and AAD exclusively for authentication. :paramtype disable_local_auth: bool """ - super(AmlCompute, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) + super(AmlCompute, self).__init__( + compute_location=compute_location, + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'AmlCompute' # type: str + self.compute_type = "AmlCompute" # type: str self.compute_location = compute_location self.provisioning_state = None self.description = description @@ -1131,29 +1198,25 @@ class AmlComputeNodeInformation(msrest.serialization.Model): """ _validation = { - 'node_id': {'readonly': True}, - 'private_ip_address': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'port': {'readonly': True}, - 'node_state': {'readonly': True}, - 'run_id': {'readonly': True}, + "node_id": {"readonly": True}, + "private_ip_address": {"readonly": True}, + "public_ip_address": {"readonly": True}, + "port": {"readonly": True}, + "node_state": {"readonly": True}, + "run_id": {"readonly": True}, } _attribute_map = { - 'node_id': {'key': 'nodeId', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - 'node_state': {'key': 'nodeState', 'type': 'str'}, - 'run_id': {'key': 'runId', 'type': 'str'}, + "node_id": {"key": "nodeId", "type": "str"}, + "private_ip_address": {"key": "privateIpAddress", "type": "str"}, + "public_ip_address": {"key": "publicIpAddress", "type": "str"}, + "port": {"key": "port", "type": "int"}, + "node_state": {"key": "nodeState", "type": "str"}, + "run_id": {"key": "runId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AmlComputeNodeInformation, self).__init__(**kwargs) self.node_id = None self.private_ip_address = None @@ -1175,21 +1238,17 @@ class AmlComputeNodesInformation(msrest.serialization.Model): """ _validation = { - 'nodes': {'readonly': True}, - 'next_link': {'readonly': True}, + "nodes": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'nodes': {'key': 'nodes', 'type': '[AmlComputeNodeInformation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "nodes": {"key": "nodes", "type": "[AmlComputeNodeInformation]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AmlComputeNodesInformation, self).__init__(**kwargs) self.nodes = None self.next_link = None @@ -1260,32 +1319,47 @@ class AmlComputeProperties(msrest.serialization.Model): """ _validation = { - 'allocation_state': {'readonly': True}, - 'allocation_state_transition_time': {'readonly': True}, - 'errors': {'readonly': True}, - 'current_node_count': {'readonly': True}, - 'target_node_count': {'readonly': True}, - 'node_state_counts': {'readonly': True}, - } - - _attribute_map = { - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'vm_priority': {'key': 'vmPriority', 'type': 'str'}, - 'virtual_machine_image': {'key': 'virtualMachineImage', 'type': 'VirtualMachineImage'}, - 'isolated_network': {'key': 'isolatedNetwork', 'type': 'bool'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, - 'user_account_credentials': {'key': 'userAccountCredentials', 'type': 'UserAccountCredentials'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'remote_login_port_public_access': {'key': 'remoteLoginPortPublicAccess', 'type': 'str'}, - 'allocation_state': {'key': 'allocationState', 'type': 'str'}, - 'allocation_state_transition_time': {'key': 'allocationStateTransitionTime', 'type': 'iso-8601'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'current_node_count': {'key': 'currentNodeCount', 'type': 'int'}, - 'target_node_count': {'key': 'targetNodeCount', 'type': 'int'}, - 'node_state_counts': {'key': 'nodeStateCounts', 'type': 'NodeStateCounts'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'property_bag': {'key': 'propertyBag', 'type': 'object'}, + "allocation_state": {"readonly": True}, + "allocation_state_transition_time": {"readonly": True}, + "errors": {"readonly": True}, + "current_node_count": {"readonly": True}, + "target_node_count": {"readonly": True}, + "node_state_counts": {"readonly": True}, + } + + _attribute_map = { + "os_type": {"key": "osType", "type": "str"}, + "vm_size": {"key": "vmSize", "type": "str"}, + "vm_priority": {"key": "vmPriority", "type": "str"}, + "virtual_machine_image": { + "key": "virtualMachineImage", + "type": "VirtualMachineImage", + }, + "isolated_network": {"key": "isolatedNetwork", "type": "bool"}, + "scale_settings": {"key": "scaleSettings", "type": "ScaleSettings"}, + "user_account_credentials": { + "key": "userAccountCredentials", + "type": "UserAccountCredentials", + }, + "subnet": {"key": "subnet", "type": "ResourceId"}, + "remote_login_port_public_access": { + "key": "remoteLoginPortPublicAccess", + "type": "str", + }, + "allocation_state": {"key": "allocationState", "type": "str"}, + "allocation_state_transition_time": { + "key": "allocationStateTransitionTime", + "type": "iso-8601", + }, + "errors": {"key": "errors", "type": "[ErrorResponse]"}, + "current_node_count": {"key": "currentNodeCount", "type": "int"}, + "target_node_count": {"key": "targetNodeCount", "type": "int"}, + "node_state_counts": { + "key": "nodeStateCounts", + "type": "NodeStateCounts", + }, + "enable_node_public_ip": {"key": "enableNodePublicIp", "type": "bool"}, + "property_bag": {"key": "propertyBag", "type": "object"}, } def __init__( @@ -1299,7 +1373,9 @@ def __init__( scale_settings: Optional["ScaleSettings"] = None, user_account_credentials: Optional["UserAccountCredentials"] = None, subnet: Optional["ResourceId"] = None, - remote_login_port_public_access: Optional[Union[str, "RemoteLoginPortPublicAccess"]] = "NotSpecified", + remote_login_port_public_access: Optional[ + Union[str, "RemoteLoginPortPublicAccess"] + ] = "NotSpecified", enable_node_public_ip: Optional[bool] = True, property_bag: Optional[Any] = None, **kwargs @@ -1375,9 +1451,9 @@ class AmlOperation(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'AmlOperationDisplay'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + "name": {"key": "name", "type": "str"}, + "display": {"key": "display", "type": "AmlOperationDisplay"}, + "is_data_action": {"key": "isDataAction", "type": "bool"}, } def __init__( @@ -1416,10 +1492,10 @@ class AmlOperationDisplay(msrest.serialization.Model): """ _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, + "provider": {"key": "provider", "type": "str"}, + "resource": {"key": "resource", "type": "str"}, + "operation": {"key": "operation", "type": "str"}, + "description": {"key": "description", "type": "str"}, } def __init__( @@ -1456,14 +1532,11 @@ class AmlOperationListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlOperation]'}, + "value": {"key": "value", "type": "[AmlOperation]"}, } def __init__( - self, - *, - value: Optional[List["AmlOperation"]] = None, - **kwargs + self, *, value: Optional[List["AmlOperation"]] = None, **kwargs ): """ :keyword value: List of AML operations supported by the AML resource provider. @@ -1488,23 +1561,23 @@ class IdentityConfiguration(msrest.serialization.Model): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, } _subtype_map = { - 'identity_type': {'AMLToken': 'AmlToken', 'Managed': 'ManagedIdentity', 'UserIdentity': 'UserIdentity'} + "identity_type": { + "AMLToken": "AmlToken", + "Managed": "ManagedIdentity", + "UserIdentity": "UserIdentity", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(IdentityConfiguration, self).__init__(**kwargs) self.identity_type = None # type: Optional[str] @@ -1521,21 +1594,17 @@ class AmlToken(IdentityConfiguration): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AmlToken, self).__init__(**kwargs) - self.identity_type = 'AMLToken' # type: str + self.identity_type = "AMLToken" # type: str class AmlUserFeature(msrest.serialization.Model): @@ -1550,9 +1619,9 @@ class AmlUserFeature(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "description": {"key": "description", "type": "str"}, } def __init__( @@ -1588,15 +1657,10 @@ class ArmResourceId(msrest.serialization.Model): """ _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, + "resource_id": {"key": "resourceId", "type": "str"}, } - def __init__( - self, - *, - resource_id: Optional[str] = None, - **kwargs - ): + def __init__(self, *, resource_id: Optional[str] = None, **kwargs): """ :keyword resource_id: Arm ResourceId is in the format "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName}" @@ -1620,9 +1684,9 @@ class ResourceBase(msrest.serialization.Model): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, } def __init__( @@ -1667,12 +1731,15 @@ class AssetBase(ResourceBase): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "auto_delete_setting": { + "key": "autoDeleteSetting", + "type": "AutoDeleteSetting", + }, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, } def __init__( @@ -1702,7 +1769,9 @@ def __init__( provided it will be used to populate IsArchived. :paramtype is_archived: bool """ - super(AssetBase, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + super(AssetBase, self).__init__( + description=description, properties=properties, tags=tags, **kwargs + ) self.auto_delete_setting = auto_delete_setting self.is_anonymous = is_anonymous self.is_archived = is_archived @@ -1728,17 +1797,17 @@ class AssetContainer(ResourceBase): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, } def __init__( @@ -1760,7 +1829,9 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(AssetContainer, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + super(AssetContainer, self).__init__( + description=description, properties=properties, tags=tags, **kwargs + ) self.is_archived = is_archived self.latest_version = None self.next_version = None @@ -1779,12 +1850,12 @@ class AssetJobInput(msrest.serialization.Model): """ _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "uri": {"required": True, "min_length": 1, "pattern": r"[a-zA-Z0-9_]"}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, } def __init__( @@ -1823,11 +1894,14 @@ class AssetJobOutput(msrest.serialization.Model): """ _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, + "asset_name": {"key": "assetName", "type": "str"}, + "asset_version": {"key": "assetVersion", "type": "str"}, + "auto_delete_setting": { + "key": "autoDeleteSetting", + "type": "AutoDeleteSetting", + }, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, } def __init__( @@ -1875,23 +1949,23 @@ class AssetReferenceBase(msrest.serialization.Model): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, } _subtype_map = { - 'reference_type': {'DataPath': 'DataPathAssetReference', 'Id': 'IdAssetReference', 'OutputPath': 'OutputPathAssetReference'} + "reference_type": { + "DataPath": "DataPathAssetReference", + "Id": "IdAssetReference", + "OutputPath": "OutputPathAssetReference", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AssetReferenceBase, self).__init__(**kwargs) self.reference_type = None # type: Optional[str] @@ -1908,22 +1982,16 @@ class AssignedUser(msrest.serialization.Model): """ _validation = { - 'object_id': {'required': True}, - 'tenant_id': {'required': True}, + "object_id": {"required": True}, + "tenant_id": {"required": True}, } _attribute_map = { - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + "object_id": {"key": "objectId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, } - def __init__( - self, - *, - object_id: str, - tenant_id: str, - **kwargs - ): + def __init__(self, *, object_id: str, tenant_id: str, **kwargs): """ :keyword object_id: Required. User’s AAD Object Id. :paramtype object_id: str @@ -1946,8 +2014,8 @@ class AutoDeleteSetting(msrest.serialization.Model): """ _attribute_map = { - 'condition': {'key': 'condition', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "condition": {"key": "condition", "type": "str"}, + "value": {"key": "value", "type": "str"}, } def __init__( @@ -1983,23 +2051,22 @@ class ForecastHorizon(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoForecastHorizon', 'Custom': 'CustomForecastHorizon'} + "mode": { + "Auto": "AutoForecastHorizon", + "Custom": "CustomForecastHorizon", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ForecastHorizon, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -2015,21 +2082,17 @@ class AutoForecastHorizon(ForecastHorizon): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoForecastHorizon, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class AutologgerSettings(msrest.serialization.Model): @@ -2044,11 +2107,11 @@ class AutologgerSettings(msrest.serialization.Model): """ _validation = { - 'mlflow_autologger': {'required': True}, + "mlflow_autologger": {"required": True}, } _attribute_map = { - 'mlflow_autologger': {'key': 'mlflowAutologger', 'type': 'str'}, + "mlflow_autologger": {"key": "mlflowAutologger", "type": "str"}, } def __init__( @@ -2116,29 +2179,42 @@ class JobBaseProperties(ResourceBase): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, + "job_type": {"required": True}, + "status": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "notification_setting": { + "key": "notificationSetting", + "type": "NotificationSetting", + }, + "secrets_configuration": { + "key": "secretsConfiguration", + "type": "{SecretConfiguration}", + }, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, } _subtype_map = { - 'job_type': {'AutoML': 'AutoMLJob', 'Command': 'CommandJob', 'Labeling': 'LabelingJobProperties', 'Pipeline': 'PipelineJob', 'Spark': 'SparkJob', 'Sweep': 'SweepJob'} + "job_type": { + "AutoML": "AutoMLJob", + "Command": "CommandJob", + "Labeling": "LabelingJobProperties", + "Pipeline": "PipelineJob", + "Spark": "SparkJob", + "Sweep": "SweepJob", + } } def __init__( @@ -2154,7 +2230,9 @@ def __init__( identity: Optional["IdentityConfiguration"] = None, is_archived: Optional[bool] = False, notification_setting: Optional["NotificationSetting"] = None, - secrets_configuration: Optional[Dict[str, "SecretConfiguration"]] = None, + secrets_configuration: Optional[ + Dict[str, "SecretConfiguration"] + ] = None, services: Optional[Dict[str, "JobService"]] = None, **kwargs ): @@ -2189,14 +2267,16 @@ def __init__( For local jobs, a job endpoint will have an endpoint value of FileStreamObject. :paramtype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] """ - super(JobBaseProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + super(JobBaseProperties, self).__init__( + description=description, properties=properties, tags=tags, **kwargs + ) self.component_id = component_id self.compute_id = compute_id self.display_name = display_name self.experiment_name = experiment_name self.identity = identity self.is_archived = is_archived - self.job_type = 'JobBaseProperties' # type: str + self.job_type = "JobBaseProperties" # type: str self.notification_setting = notification_setting self.secrets_configuration = secrets_configuration self.services = services @@ -2205,93 +2285,102 @@ def __init__( class AutoMLJob(JobBaseProperties): """AutoMLJob class. -Use this class for executing AutoML tasks like Classification/Regression etc. -See TaskType enum for all the tasks supported. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar component_id: ARM resource ID of the component resource. - :vartype component_id: str - :ivar compute_id: ARM resource ID of the compute resource. - :vartype compute_id: str - :ivar display_name: Display name of job. - :vartype display_name: str - :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is - placed in the "Default" experiment. - :vartype experiment_name: str - :ivar identity: Identity configuration. If set, this should be one of AmlToken, - ManagedIdentity, UserIdentity or null. - Defaults to AmlToken if null. - :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. - Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark". - :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType - :ivar notification_setting: Notification setting for the job. - :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting - :ivar secrets_configuration: Configuration for secrets to be made available during runtime. - :vartype secrets_configuration: dict[str, - ~azure.mgmt.machinelearningservices.models.SecretConfiguration] - :ivar services: List of JobEndpoints. - For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] - :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", - "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", - "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". - :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus - :ivar environment_id: The ARM resource ID of the Environment specification for the job. - This is optional value to provide, if not provided, AutoML will default this to Production - AutoML curated environment version when running the job. - :vartype environment_id: str - :ivar environment_variables: Environment variables included in the job. - :vartype environment_variables: dict[str, str] - :ivar outputs: Mapping of output data bindings used in the job. - :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] - :ivar queue_settings: Queue settings for the job. - :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings - :ivar resources: Compute Resource configuration for the job. - :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration - :ivar task_details: Required. [Required] This represents scenario which can be one of - Tables/NLP/Image. - :vartype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical + Use this class for executing AutoML tasks like Classification/Regression etc. + See TaskType enum for all the tasks supported. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar description: The asset description text. + :vartype description: str + :ivar properties: The asset property dictionary. + :vartype properties: dict[str, str] + :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + :ivar component_id: ARM resource ID of the component resource. + :vartype component_id: str + :ivar compute_id: ARM resource ID of the compute resource. + :vartype compute_id: str + :ivar display_name: Display name of job. + :vartype display_name: str + :ivar experiment_name: The name of the experiment the job belongs to. If not set, the job is + placed in the "Default" experiment. + :vartype experiment_name: str + :ivar identity: Identity configuration. If set, this should be one of AmlToken, + ManagedIdentity, UserIdentity or null. + Defaults to AmlToken if null. + :vartype identity: ~azure.mgmt.machinelearningservices.models.IdentityConfiguration + :ivar is_archived: Is the asset archived?. + :vartype is_archived: bool + :ivar job_type: Required. [Required] Specifies the type of job.Constant filled by server. + Possible values include: "AutoML", "Command", "Labeling", "Sweep", "Pipeline", "Spark". + :vartype job_type: str or ~azure.mgmt.machinelearningservices.models.JobType + :ivar notification_setting: Notification setting for the job. + :vartype notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting + :ivar secrets_configuration: Configuration for secrets to be made available during runtime. + :vartype secrets_configuration: dict[str, + ~azure.mgmt.machinelearningservices.models.SecretConfiguration] + :ivar services: List of JobEndpoints. + For local jobs, a job endpoint will have an endpoint value of FileStreamObject. + :vartype services: dict[str, ~azure.mgmt.machinelearningservices.models.JobService] + :ivar status: Status of the job. Possible values include: "NotStarted", "Starting", + "Provisioning", "Preparing", "Queued", "Running", "Finalizing", "CancelRequested", "Completed", + "Failed", "Canceled", "NotResponding", "Paused", "Unknown", "Scheduled". + :vartype status: str or ~azure.mgmt.machinelearningservices.models.JobStatus + :ivar environment_id: The ARM resource ID of the Environment specification for the job. + This is optional value to provide, if not provided, AutoML will default this to Production + AutoML curated environment version when running the job. + :vartype environment_id: str + :ivar environment_variables: Environment variables included in the job. + :vartype environment_variables: dict[str, str] + :ivar outputs: Mapping of output data bindings used in the job. + :vartype outputs: dict[str, ~azure.mgmt.machinelearningservices.models.JobOutput] + :ivar queue_settings: Queue settings for the job. + :vartype queue_settings: ~azure.mgmt.machinelearningservices.models.QueueSettings + :ivar resources: Compute Resource configuration for the job. + :vartype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration + :ivar task_details: Required. [Required] This represents scenario which can be one of + Tables/NLP/Image. + :vartype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'task_details': {'required': True}, + "job_type": {"required": True}, + "status": {"readonly": True}, + "task_details": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, - 'task_details': {'key': 'taskDetails', 'type': 'AutoMLVertical'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "notification_setting": { + "key": "notificationSetting", + "type": "NotificationSetting", + }, + "secrets_configuration": { + "key": "secretsConfiguration", + "type": "{SecretConfiguration}", + }, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "queue_settings": {"key": "queueSettings", "type": "QueueSettings"}, + "resources": {"key": "resources", "type": "JobResourceConfiguration"}, + "task_details": {"key": "taskDetails", "type": "AutoMLVertical"}, } def __init__( @@ -2308,7 +2397,9 @@ def __init__( identity: Optional["IdentityConfiguration"] = None, is_archived: Optional[bool] = False, notification_setting: Optional["NotificationSetting"] = None, - secrets_configuration: Optional[Dict[str, "SecretConfiguration"]] = None, + secrets_configuration: Optional[ + Dict[str, "SecretConfiguration"] + ] = None, services: Optional[Dict[str, "JobService"]] = None, environment_id: Optional[str] = None, environment_variables: Optional[Dict[str, str]] = None, @@ -2363,8 +2454,22 @@ def __init__( Tables/NLP/Image. :paramtype task_details: ~azure.mgmt.machinelearningservices.models.AutoMLVertical """ - super(AutoMLJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, notification_setting=notification_setting, secrets_configuration=secrets_configuration, services=services, **kwargs) - self.job_type = 'AutoML' # type: str + super(AutoMLJob, self).__init__( + description=description, + properties=properties, + tags=tags, + component_id=component_id, + compute_id=compute_id, + display_name=display_name, + experiment_name=experiment_name, + identity=identity, + is_archived=is_archived, + notification_setting=notification_setting, + secrets_configuration=secrets_configuration, + services=services, + **kwargs + ) + self.job_type = "AutoML" # type: str self.environment_id = environment_id self.environment_variables = environment_variables self.outputs = outputs @@ -2375,42 +2480,53 @@ def __init__( class AutoMLVertical(msrest.serialization.Model): """AutoML vertical class. -Base class for AutoML verticals - TableVertical/ImageVertical/NLPVertical. + Base class for AutoML verticals - TableVertical/ImageVertical/NLPVertical. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Classification, Forecasting, ImageClassification, ImageClassificationMultilabel, ImageInstanceSegmentation, ImageObjectDetection, Regression, TextClassification, TextClassificationMultilabel, TextNer. + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Classification, Forecasting, ImageClassification, ImageClassificationMultilabel, ImageInstanceSegmentation, ImageObjectDetection, Regression, TextClassification, TextClassificationMultilabel, TextNer. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, + "task_type": {"required": True}, + "training_data": {"required": True}, } _attribute_map = { - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, } _subtype_map = { - 'task_type': {'Classification': 'Classification', 'Forecasting': 'Forecasting', 'ImageClassification': 'ImageClassification', 'ImageClassificationMultilabel': 'ImageClassificationMultilabel', 'ImageInstanceSegmentation': 'ImageInstanceSegmentation', 'ImageObjectDetection': 'ImageObjectDetection', 'Regression': 'Regression', 'TextClassification': 'TextClassification', 'TextClassificationMultilabel': 'TextClassificationMultilabel', 'TextNER': 'TextNer'} + "task_type": { + "Classification": "Classification", + "Forecasting": "Forecasting", + "ImageClassification": "ImageClassification", + "ImageClassificationMultilabel": "ImageClassificationMultilabel", + "ImageInstanceSegmentation": "ImageInstanceSegmentation", + "ImageObjectDetection": "ImageObjectDetection", + "Regression": "Regression", + "TextClassification": "TextClassification", + "TextClassificationMultilabel": "TextClassificationMultilabel", + "TextNER": "TextNer", + } } def __init__( @@ -2452,23 +2568,22 @@ class NCrossValidations(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoNCrossValidations', 'Custom': 'CustomNCrossValidations'} + "mode": { + "Auto": "AutoNCrossValidations", + "Custom": "CustomNCrossValidations", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NCrossValidations, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -2484,21 +2599,17 @@ class AutoNCrossValidations(NCrossValidations): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoNCrossValidations, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class AutoPauseProperties(msrest.serialization.Model): @@ -2511,8 +2622,8 @@ class AutoPauseProperties(msrest.serialization.Model): """ _attribute_map = { - 'delay_in_minutes': {'key': 'delayInMinutes', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, + "delay_in_minutes": {"key": "delayInMinutes", "type": "int"}, + "enabled": {"key": "enabled", "type": "bool"}, } def __init__( @@ -2545,9 +2656,9 @@ class AutoScaleProperties(msrest.serialization.Model): """ _attribute_map = { - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, + "min_node_count": {"key": "minNodeCount", "type": "int"}, + "enabled": {"key": "enabled", "type": "bool"}, + "max_node_count": {"key": "maxNodeCount", "type": "int"}, } def __init__( @@ -2586,23 +2697,19 @@ class Seasonality(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoSeasonality', 'Custom': 'CustomSeasonality'} + "mode": {"Auto": "AutoSeasonality", "Custom": "CustomSeasonality"} } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Seasonality, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -2618,21 +2725,17 @@ class AutoSeasonality(Seasonality): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoSeasonality, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class TargetLags(msrest.serialization.Model): @@ -2649,23 +2752,19 @@ class TargetLags(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoTargetLags', 'Custom': 'CustomTargetLags'} + "mode": {"Auto": "AutoTargetLags", "Custom": "CustomTargetLags"} } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(TargetLags, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -2681,21 +2780,17 @@ class AutoTargetLags(TargetLags): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoTargetLags, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class TargetRollingWindowSize(msrest.serialization.Model): @@ -2712,23 +2807,22 @@ class TargetRollingWindowSize(msrest.serialization.Model): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } _subtype_map = { - 'mode': {'Auto': 'AutoTargetRollingWindowSize', 'Custom': 'CustomTargetRollingWindowSize'} + "mode": { + "Auto": "AutoTargetRollingWindowSize", + "Custom": "CustomTargetRollingWindowSize", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(TargetRollingWindowSize, self).__init__(**kwargs) self.mode = None # type: Optional[str] @@ -2744,21 +2838,17 @@ class AutoTargetRollingWindowSize(TargetRollingWindowSize): """ _validation = { - 'mode': {'required': True}, + "mode": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(AutoTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Auto' # type: str + self.mode = "Auto" # type: str class MonitoringAlertNotificationSettingsBase(msrest.serialization.Model): @@ -2776,28 +2866,32 @@ class MonitoringAlertNotificationSettingsBase(msrest.serialization.Model): """ _validation = { - 'alert_notification_type': {'required': True}, + "alert_notification_type": {"required": True}, } _attribute_map = { - 'alert_notification_type': {'key': 'alertNotificationType', 'type': 'str'}, + "alert_notification_type": { + "key": "alertNotificationType", + "type": "str", + }, } _subtype_map = { - 'alert_notification_type': {'AzureMonitor': 'AzMonMonitoringAlertNotificationSettings', 'Email': 'EmailMonitoringAlertNotificationSettings'} + "alert_notification_type": { + "AzureMonitor": "AzMonMonitoringAlertNotificationSettings", + "Email": "EmailMonitoringAlertNotificationSettings", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(MonitoringAlertNotificationSettingsBase, self).__init__(**kwargs) self.alert_notification_type = None # type: Optional[str] -class AzMonMonitoringAlertNotificationSettings(MonitoringAlertNotificationSettingsBase): +class AzMonMonitoringAlertNotificationSettings( + MonitoringAlertNotificationSettingsBase +): """AzMonMonitoringAlertNotificationSettings. All required parameters must be populated in order to send to Azure. @@ -2809,21 +2903,22 @@ class AzMonMonitoringAlertNotificationSettings(MonitoringAlertNotificationSettin """ _validation = { - 'alert_notification_type': {'required': True}, + "alert_notification_type": {"required": True}, } _attribute_map = { - 'alert_notification_type': {'key': 'alertNotificationType', 'type': 'str'}, + "alert_notification_type": { + "key": "alertNotificationType", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): - """ - """ - super(AzMonMonitoringAlertNotificationSettings, self).__init__(**kwargs) - self.alert_notification_type = 'AzureMonitor' # type: str + def __init__(self, **kwargs): + """ """ + super(AzMonMonitoringAlertNotificationSettings, self).__init__( + **kwargs + ) + self.alert_notification_type = "AzureMonitor" # type: str class AzureDatastore(msrest.serialization.Model): @@ -2836,8 +2931,8 @@ class AzureDatastore(msrest.serialization.Model): """ _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + "resource_group": {"key": "resourceGroup", "type": "str"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, } def __init__( @@ -2888,23 +2983,33 @@ class DatastoreProperties(ResourceBase): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "intellectual_property": { + "key": "intellectualProperty", + "type": "IntellectualProperty", + }, + "is_default": {"key": "isDefault", "type": "bool"}, } _subtype_map = { - 'datastore_type': {'AzureBlob': 'AzureBlobDatastore', 'AzureDataLakeGen1': 'AzureDataLakeGen1Datastore', 'AzureDataLakeGen2': 'AzureDataLakeGen2Datastore', 'AzureFile': 'AzureFileDatastore', 'Hdfs': 'HdfsDatastore', 'OneLake': 'OneLakeDatastore'} + "datastore_type": { + "AzureBlob": "AzureBlobDatastore", + "AzureDataLakeGen1": "AzureDataLakeGen1Datastore", + "AzureDataLakeGen2": "AzureDataLakeGen2Datastore", + "AzureFile": "AzureFileDatastore", + "Hdfs": "HdfsDatastore", + "OneLake": "OneLakeDatastore", + } } def __init__( @@ -2930,9 +3035,11 @@ def __init__( :paramtype intellectual_property: ~azure.mgmt.machinelearningservices.models.IntellectualProperty """ - super(DatastoreProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + super(DatastoreProperties, self).__init__( + description=description, properties=properties, tags=tags, **kwargs + ) self.credentials = credentials - self.datastore_type = 'DatastoreProperties' # type: str + self.datastore_type = "DatastoreProperties" # type: str self.intellectual_property = intellectual_property self.is_default = None @@ -2981,26 +3088,32 @@ class AzureBlobDatastore(DatastoreProperties, AzureDatastore): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, } _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, + "resource_group": {"key": "resourceGroup", "type": "str"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "intellectual_property": { + "key": "intellectualProperty", + "type": "IntellectualProperty", + }, + "is_default": {"key": "isDefault", "type": "bool"}, + "account_name": {"key": "accountName", "type": "str"}, + "container_name": {"key": "containerName", "type": "str"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } def __init__( @@ -3017,7 +3130,9 @@ def __init__( container_name: Optional[str] = None, endpoint: Optional[str] = None, protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, + service_data_access_auth_identity: Optional[ + Union[str, "ServiceDataAccessAuthIdentity"] + ] = None, **kwargs ): """ @@ -3050,15 +3165,26 @@ def __init__( :paramtype service_data_access_auth_identity: str or ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ - super(AzureBlobDatastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, intellectual_property=intellectual_property, resource_group=resource_group, subscription_id=subscription_id, **kwargs) + super(AzureBlobDatastore, self).__init__( + description=description, + properties=properties, + tags=tags, + credentials=credentials, + intellectual_property=intellectual_property, + resource_group=resource_group, + subscription_id=subscription_id, + **kwargs + ) self.resource_group = resource_group self.subscription_id = subscription_id - self.datastore_type = 'AzureBlob' # type: str + self.datastore_type = "AzureBlob" # type: str self.account_name = account_name self.container_name = container_name self.endpoint = endpoint self.protocol = protocol - self.service_data_access_auth_identity = service_data_access_auth_identity + self.service_data_access_auth_identity = ( + service_data_access_auth_identity + ) self.description = description self.properties = properties self.tags = tags @@ -3105,24 +3231,34 @@ class AzureDataLakeGen1Datastore(DatastoreProperties, AzureDatastore): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'store_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "store_name": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, - 'store_name': {'key': 'storeName', 'type': 'str'}, + "resource_group": {"key": "resourceGroup", "type": "str"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "intellectual_property": { + "key": "intellectualProperty", + "type": "IntellectualProperty", + }, + "is_default": {"key": "isDefault", "type": "bool"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, + "store_name": {"key": "storeName", "type": "str"}, } def __init__( @@ -3136,7 +3272,9 @@ def __init__( properties: Optional[Dict[str, str]] = None, tags: Optional[Dict[str, str]] = None, intellectual_property: Optional["IntellectualProperty"] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, + service_data_access_auth_identity: Optional[ + Union[str, "ServiceDataAccessAuthIdentity"] + ] = None, **kwargs ): """ @@ -3163,11 +3301,22 @@ def __init__( :keyword store_name: Required. [Required] Azure Data Lake store name. :paramtype store_name: str """ - super(AzureDataLakeGen1Datastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, intellectual_property=intellectual_property, resource_group=resource_group, subscription_id=subscription_id, **kwargs) + super(AzureDataLakeGen1Datastore, self).__init__( + description=description, + properties=properties, + tags=tags, + credentials=credentials, + intellectual_property=intellectual_property, + resource_group=resource_group, + subscription_id=subscription_id, + **kwargs + ) self.resource_group = resource_group self.subscription_id = subscription_id - self.datastore_type = 'AzureDataLakeGen1' # type: str - self.service_data_access_auth_identity = service_data_access_auth_identity + self.datastore_type = "AzureDataLakeGen1" # type: str + self.service_data_access_auth_identity = ( + service_data_access_auth_identity + ) self.store_name = store_name self.description = description self.properties = properties @@ -3221,28 +3370,42 @@ class AzureDataLakeGen2Datastore(DatastoreProperties, AzureDatastore): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'filesystem': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "account_name": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "filesystem": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'filesystem': {'key': 'filesystem', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, + "resource_group": {"key": "resourceGroup", "type": "str"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "intellectual_property": { + "key": "intellectualProperty", + "type": "IntellectualProperty", + }, + "is_default": {"key": "isDefault", "type": "bool"}, + "account_name": {"key": "accountName", "type": "str"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "filesystem": {"key": "filesystem", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } def __init__( @@ -3259,7 +3422,9 @@ def __init__( intellectual_property: Optional["IntellectualProperty"] = None, endpoint: Optional[str] = None, protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, + service_data_access_auth_identity: Optional[ + Union[str, "ServiceDataAccessAuthIdentity"] + ] = None, **kwargs ): """ @@ -3292,15 +3457,26 @@ def __init__( :paramtype service_data_access_auth_identity: str or ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ - super(AzureDataLakeGen2Datastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, intellectual_property=intellectual_property, resource_group=resource_group, subscription_id=subscription_id, **kwargs) + super(AzureDataLakeGen2Datastore, self).__init__( + description=description, + properties=properties, + tags=tags, + credentials=credentials, + intellectual_property=intellectual_property, + resource_group=resource_group, + subscription_id=subscription_id, + **kwargs + ) self.resource_group = resource_group self.subscription_id = subscription_id - self.datastore_type = 'AzureDataLakeGen2' # type: str + self.datastore_type = "AzureDataLakeGen2" # type: str self.account_name = account_name self.endpoint = endpoint self.filesystem = filesystem self.protocol = protocol - self.service_data_access_auth_identity = service_data_access_auth_identity + self.service_data_access_auth_identity = ( + service_data_access_auth_identity + ) self.description = description self.properties = properties self.tags = tags @@ -3325,24 +3501,17 @@ class Webhook(msrest.serialization.Model): """ _validation = { - 'webhook_type': {'required': True}, + "webhook_type": {"required": True}, } _attribute_map = { - 'event_type': {'key': 'eventType', 'type': 'str'}, - 'webhook_type': {'key': 'webhookType', 'type': 'str'}, + "event_type": {"key": "eventType", "type": "str"}, + "webhook_type": {"key": "webhookType", "type": "str"}, } - _subtype_map = { - 'webhook_type': {'AzureDevOps': 'AzureDevOpsWebhook'} - } + _subtype_map = {"webhook_type": {"AzureDevOps": "AzureDevOpsWebhook"}} - def __init__( - self, - *, - event_type: Optional[str] = None, - **kwargs - ): + def __init__(self, *, event_type: Optional[str] = None, **kwargs): """ :keyword event_type: Send callback on a specified notification event. :paramtype event_type: str @@ -3365,26 +3534,23 @@ class AzureDevOpsWebhook(Webhook): """ _validation = { - 'webhook_type': {'required': True}, + "webhook_type": {"required": True}, } _attribute_map = { - 'event_type': {'key': 'eventType', 'type': 'str'}, - 'webhook_type': {'key': 'webhookType', 'type': 'str'}, + "event_type": {"key": "eventType", "type": "str"}, + "webhook_type": {"key": "webhookType", "type": "str"}, } - def __init__( - self, - *, - event_type: Optional[str] = None, - **kwargs - ): + def __init__(self, *, event_type: Optional[str] = None, **kwargs): """ :keyword event_type: Send callback on a specified notification event. :paramtype event_type: str """ - super(AzureDevOpsWebhook, self).__init__(event_type=event_type, **kwargs) - self.webhook_type = 'AzureDevOps' # type: str + super(AzureDevOpsWebhook, self).__init__( + event_type=event_type, **kwargs + ) + self.webhook_type = "AzureDevOps" # type: str class AzureFileDatastore(DatastoreProperties, AzureDatastore): @@ -3432,28 +3598,42 @@ class AzureFileDatastore(DatastoreProperties, AzureDatastore): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'account_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'file_share_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "account_name": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "file_share_name": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'file_share_name': {'key': 'fileShareName', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, + "resource_group": {"key": "resourceGroup", "type": "str"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "intellectual_property": { + "key": "intellectualProperty", + "type": "IntellectualProperty", + }, + "is_default": {"key": "isDefault", "type": "bool"}, + "account_name": {"key": "accountName", "type": "str"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "file_share_name": {"key": "fileShareName", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } def __init__( @@ -3470,7 +3650,9 @@ def __init__( intellectual_property: Optional["IntellectualProperty"] = None, endpoint: Optional[str] = None, protocol: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, + service_data_access_auth_identity: Optional[ + Union[str, "ServiceDataAccessAuthIdentity"] + ] = None, **kwargs ): """ @@ -3504,15 +3686,26 @@ def __init__( :paramtype service_data_access_auth_identity: str or ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ - super(AzureFileDatastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, intellectual_property=intellectual_property, resource_group=resource_group, subscription_id=subscription_id, **kwargs) + super(AzureFileDatastore, self).__init__( + description=description, + properties=properties, + tags=tags, + credentials=credentials, + intellectual_property=intellectual_property, + resource_group=resource_group, + subscription_id=subscription_id, + **kwargs + ) self.resource_group = resource_group self.subscription_id = subscription_id - self.datastore_type = 'AzureFile' # type: str + self.datastore_type = "AzureFile" # type: str self.account_name = account_name self.endpoint = endpoint self.file_share_name = file_share_name self.protocol = protocol - self.service_data_access_auth_identity = service_data_access_auth_identity + self.service_data_access_auth_identity = ( + service_data_access_auth_identity + ) self.description = description self.properties = properties self.tags = tags @@ -3535,23 +3728,24 @@ class InferencingServer(msrest.serialization.Model): """ _validation = { - 'server_type': {'required': True}, + "server_type": {"required": True}, } _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, + "server_type": {"key": "serverType", "type": "str"}, } _subtype_map = { - 'server_type': {'AzureMLBatch': 'AzureMLBatchInferencingServer', 'AzureMLOnline': 'AzureMLOnlineInferencingServer', 'Custom': 'CustomInferencingServer', 'Triton': 'TritonInferencingServer'} + "server_type": { + "AzureMLBatch": "AzureMLBatchInferencingServer", + "AzureMLOnline": "AzureMLOnlineInferencingServer", + "Custom": "CustomInferencingServer", + "Triton": "TritonInferencingServer", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(InferencingServer, self).__init__(**kwargs) self.server_type = None # type: Optional[str] @@ -3569,12 +3763,15 @@ class AzureMLBatchInferencingServer(InferencingServer): """ _validation = { - 'server_type': {'required': True}, + "server_type": {"required": True}, } _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, + "server_type": {"key": "serverType", "type": "str"}, + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, } def __init__( @@ -3588,7 +3785,7 @@ def __init__( :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration """ super(AzureMLBatchInferencingServer, self).__init__(**kwargs) - self.server_type = 'AzureMLBatch' # type: str + self.server_type = "AzureMLBatch" # type: str self.code_configuration = code_configuration @@ -3605,12 +3802,15 @@ class AzureMLOnlineInferencingServer(InferencingServer): """ _validation = { - 'server_type': {'required': True}, + "server_type": {"required": True}, } _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, + "server_type": {"key": "serverType", "type": "str"}, + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, } def __init__( @@ -3624,7 +3824,7 @@ def __init__( :paramtype code_configuration: ~azure.mgmt.machinelearningservices.models.CodeConfiguration """ super(AzureMLOnlineInferencingServer, self).__init__(**kwargs) - self.server_type = 'AzureMLOnline' # type: str + self.server_type = "AzureMLOnline" # type: str self.code_configuration = code_configuration @@ -3647,17 +3847,21 @@ class EarlyTerminationPolicy(msrest.serialization.Model): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, } _subtype_map = { - 'policy_type': {'Bandit': 'BanditPolicy', 'MedianStopping': 'MedianStoppingPolicy', 'TruncationSelection': 'TruncationSelectionPolicy'} + "policy_type": { + "Bandit": "BanditPolicy", + "MedianStopping": "MedianStoppingPolicy", + "TruncationSelection": "TruncationSelectionPolicy", + } } def __init__( @@ -3699,15 +3903,15 @@ class BanditPolicy(EarlyTerminationPolicy): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'slack_amount': {'key': 'slackAmount', 'type': 'float'}, - 'slack_factor': {'key': 'slackFactor', 'type': 'float'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, + "slack_amount": {"key": "slackAmount", "type": "float"}, + "slack_factor": {"key": "slackFactor", "type": "float"}, } def __init__( @@ -3729,8 +3933,12 @@ def __init__( :keyword slack_factor: Ratio of the allowed distance from the best performing run. :paramtype slack_factor: float """ - super(BanditPolicy, self).__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs) - self.policy_type = 'Bandit' # type: str + super(BanditPolicy, self).__init__( + delay_evaluation=delay_evaluation, + evaluation_interval=evaluation_interval, + **kwargs + ) + self.policy_type = "Bandit" # type: str self.slack_amount = slack_amount self.slack_factor = slack_factor @@ -3750,23 +3958,24 @@ class BaseEnvironmentSource(msrest.serialization.Model): """ _validation = { - 'base_environment_source_type': {'required': True}, + "base_environment_source_type": {"required": True}, } _attribute_map = { - 'base_environment_source_type': {'key': 'baseEnvironmentSourceType', 'type': 'str'}, + "base_environment_source_type": { + "key": "baseEnvironmentSourceType", + "type": "str", + }, } _subtype_map = { - 'base_environment_source_type': {'EnvironmentAsset': 'BaseEnvironmentId'} + "base_environment_source_type": { + "EnvironmentAsset": "BaseEnvironmentId" + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(BaseEnvironmentSource, self).__init__(**kwargs) self.base_environment_source_type = None # type: Optional[str] @@ -3785,27 +3994,29 @@ class BaseEnvironmentId(BaseEnvironmentSource): """ _validation = { - 'base_environment_source_type': {'required': True}, - 'resource_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "base_environment_source_type": {"required": True}, + "resource_id": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'base_environment_source_type': {'key': 'baseEnvironmentSourceType', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, + "base_environment_source_type": { + "key": "baseEnvironmentSourceType", + "type": "str", + }, + "resource_id": {"key": "resourceId", "type": "str"}, } - def __init__( - self, - *, - resource_id: str, - **kwargs - ): + def __init__(self, *, resource_id: str, **kwargs): """ :keyword resource_id: Required. [Required] Resource id accepting ArmId or AzureMlId. :paramtype resource_id: str """ super(BaseEnvironmentId, self).__init__(**kwargs) - self.base_environment_source_type = 'EnvironmentAsset' # type: str + self.base_environment_source_type = "EnvironmentAsset" # type: str self.resource_id = resource_id @@ -3828,25 +4039,21 @@ class Resource(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -3879,28 +4086,24 @@ class TrackedResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, } def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - **kwargs + self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs ): """ :keyword tags: A set of tags. Resource tags. @@ -3947,25 +4150,28 @@ class BatchDeployment(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchDeploymentProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": { + "key": "properties", + "type": "BatchDeploymentProperties", + }, + "sku": {"key": "sku", "type": "Sku"}, } def __init__( @@ -3994,7 +4200,9 @@ def __init__( :keyword sku: Sku details required for ARM contract for Autoscaling. :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ - super(BatchDeployment, self).__init__(tags=tags, location=location, **kwargs) + super(BatchDeployment, self).__init__( + tags=tags, location=location, **kwargs + ) self.identity = identity self.kind = kind self.properties = properties @@ -4016,23 +4224,24 @@ class BatchDeploymentConfiguration(msrest.serialization.Model): """ _validation = { - 'deployment_configuration_type': {'required': True}, + "deployment_configuration_type": {"required": True}, } _attribute_map = { - 'deployment_configuration_type': {'key': 'deploymentConfigurationType', 'type': 'str'}, + "deployment_configuration_type": { + "key": "deploymentConfigurationType", + "type": "str", + }, } _subtype_map = { - 'deployment_configuration_type': {'PipelineComponent': 'BatchPipelineComponentDeploymentConfiguration'} + "deployment_configuration_type": { + "PipelineComponent": "BatchPipelineComponentDeploymentConfiguration" + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(BatchDeploymentConfiguration, self).__init__(**kwargs) self.deployment_configuration_type = None # type: Optional[str] @@ -4054,11 +4263,17 @@ class EndpointDeploymentPropertiesBase(msrest.serialization.Model): """ _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, } def __init__( @@ -4149,27 +4364,45 @@ class BatchDeploymentProperties(EndpointDeploymentPropertiesBase): """ _validation = { - 'provisioning_state': {'readonly': True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'deployment_configuration': {'key': 'deploymentConfiguration', 'type': 'BatchDeploymentConfiguration'}, - 'error_threshold': {'key': 'errorThreshold', 'type': 'int'}, - 'logging_level': {'key': 'loggingLevel', 'type': 'str'}, - 'max_concurrency_per_instance': {'key': 'maxConcurrencyPerInstance', 'type': 'int'}, - 'mini_batch_size': {'key': 'miniBatchSize', 'type': 'long'}, - 'model': {'key': 'model', 'type': 'AssetReferenceBase'}, - 'output_action': {'key': 'outputAction', 'type': 'str'}, - 'output_file_name': {'key': 'outputFileName', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'resources': {'key': 'resources', 'type': 'DeploymentResourceConfiguration'}, - 'retry_settings': {'key': 'retrySettings', 'type': 'BatchRetrySettings'}, + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "compute": {"key": "compute", "type": "str"}, + "deployment_configuration": { + "key": "deploymentConfiguration", + "type": "BatchDeploymentConfiguration", + }, + "error_threshold": {"key": "errorThreshold", "type": "int"}, + "logging_level": {"key": "loggingLevel", "type": "str"}, + "max_concurrency_per_instance": { + "key": "maxConcurrencyPerInstance", + "type": "int", + }, + "mini_batch_size": {"key": "miniBatchSize", "type": "long"}, + "model": {"key": "model", "type": "AssetReferenceBase"}, + "output_action": {"key": "outputAction", "type": "str"}, + "output_file_name": {"key": "outputFileName", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "resources": { + "key": "resources", + "type": "DeploymentResourceConfiguration", + }, + "retry_settings": { + "key": "retrySettings", + "type": "BatchRetrySettings", + }, } def __init__( @@ -4181,7 +4414,9 @@ def __init__( environment_variables: Optional[Dict[str, str]] = None, properties: Optional[Dict[str, str]] = None, compute: Optional[str] = None, - deployment_configuration: Optional["BatchDeploymentConfiguration"] = None, + deployment_configuration: Optional[ + "BatchDeploymentConfiguration" + ] = None, error_threshold: Optional[int] = -1, logging_level: Optional[Union[str, "BatchLoggingLevel"]] = None, max_concurrency_per_instance: Optional[int] = 1, @@ -4241,7 +4476,14 @@ def __init__( If not provided, will default to the defaults defined in BatchRetrySettings. :paramtype retry_settings: ~azure.mgmt.machinelearningservices.models.BatchRetrySettings """ - super(BatchDeploymentProperties, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, **kwargs) + super(BatchDeploymentProperties, self).__init__( + code_configuration=code_configuration, + description=description, + environment_id=environment_id, + environment_variables=environment_variables, + properties=properties, + **kwargs + ) self.compute = compute self.deployment_configuration = deployment_configuration self.error_threshold = error_threshold @@ -4256,7 +4498,9 @@ def __init__( self.retry_settings = retry_settings -class BatchDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class BatchDeploymentTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of BatchDeployment entities. :ivar next_link: The link to the next page of BatchDeployment objects. If null, there are no @@ -4267,8 +4511,8 @@ class BatchDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Mode """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchDeployment]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[BatchDeployment]"}, } def __init__( @@ -4285,7 +4529,9 @@ def __init__( :keyword value: An array of objects of type BatchDeployment. :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchDeployment] """ - super(BatchDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) + super(BatchDeploymentTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -4324,25 +4570,25 @@ class BatchEndpoint(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BatchEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": {"key": "properties", "type": "BatchEndpointProperties"}, + "sku": {"key": "sku", "type": "Sku"}, } def __init__( @@ -4371,7 +4617,9 @@ def __init__( :keyword sku: Sku details required for ARM contract for Autoscaling. :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ - super(BatchEndpoint, self).__init__(tags=tags, location=location, **kwargs) + super(BatchEndpoint, self).__init__( + tags=tags, location=location, **kwargs + ) self.identity = identity self.kind = kind self.properties = properties @@ -4387,15 +4635,10 @@ class BatchEndpointDefaults(msrest.serialization.Model): """ _attribute_map = { - 'deployment_name': {'key': 'deploymentName', 'type': 'str'}, + "deployment_name": {"key": "deploymentName", "type": "str"}, } - def __init__( - self, - *, - deployment_name: Optional[str] = None, - **kwargs - ): + def __init__(self, *, deployment_name: Optional[str] = None, **kwargs): """ :keyword deployment_name: Name of the deployment that will be default for the endpoint. This deployment will end up getting 100% traffic when the endpoint scoring URL is invoked. @@ -4431,18 +4674,18 @@ class EndpointPropertiesBase(msrest.serialization.Model): """ _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, + "auth_mode": {"required": True}, + "scoring_uri": {"readonly": True}, + "swagger_uri": {"readonly": True}, } _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, + "auth_mode": {"key": "authMode", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "keys": {"key": "keys", "type": "EndpointAuthKeys"}, + "properties": {"key": "properties", "type": "{str}"}, + "scoring_uri": {"key": "scoringUri", "type": "str"}, + "swagger_uri": {"key": "swaggerUri", "type": "str"}, } def __init__( @@ -4509,21 +4752,21 @@ class BatchEndpointProperties(EndpointPropertiesBase): """ _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "auth_mode": {"required": True}, + "scoring_uri": {"readonly": True}, + "swagger_uri": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'defaults': {'key': 'defaults', 'type': 'BatchEndpointDefaults'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "auth_mode": {"key": "authMode", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "keys": {"key": "keys", "type": "EndpointAuthKeys"}, + "properties": {"key": "properties", "type": "{str}"}, + "scoring_uri": {"key": "scoringUri", "type": "str"}, + "swagger_uri": {"key": "swaggerUri", "type": "str"}, + "defaults": {"key": "defaults", "type": "BatchEndpointDefaults"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } def __init__( @@ -4552,12 +4795,20 @@ def __init__( :keyword defaults: Default values for Batch Endpoint. :paramtype defaults: ~azure.mgmt.machinelearningservices.models.BatchEndpointDefaults """ - super(BatchEndpointProperties, self).__init__(auth_mode=auth_mode, description=description, keys=keys, properties=properties, **kwargs) + super(BatchEndpointProperties, self).__init__( + auth_mode=auth_mode, + description=description, + keys=keys, + properties=properties, + **kwargs + ) self.defaults = defaults self.provisioning_state = None -class BatchEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class BatchEndpointTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of BatchEndpoint entities. :ivar next_link: The link to the next page of BatchEndpoint objects. If null, there are no @@ -4568,8 +4819,8 @@ class BatchEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model) """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[BatchEndpoint]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[BatchEndpoint]"}, } def __init__( @@ -4586,12 +4837,16 @@ def __init__( :keyword value: An array of objects of type BatchEndpoint. :paramtype value: list[~azure.mgmt.machinelearningservices.models.BatchEndpoint] """ - super(BatchEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) + super(BatchEndpointTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value -class BatchPipelineComponentDeploymentConfiguration(BatchDeploymentConfiguration): +class BatchPipelineComponentDeploymentConfiguration( + BatchDeploymentConfiguration +): """Properties for a Batch Pipeline Component Deployment. All required parameters must be populated in order to send to Azure. @@ -4611,15 +4866,18 @@ class BatchPipelineComponentDeploymentConfiguration(BatchDeploymentConfiguration """ _validation = { - 'deployment_configuration_type': {'required': True}, + "deployment_configuration_type": {"required": True}, } _attribute_map = { - 'deployment_configuration_type': {'key': 'deploymentConfigurationType', 'type': 'str'}, - 'component_id': {'key': 'componentId', 'type': 'IdAssetReference'}, - 'description': {'key': 'description', 'type': 'str'}, - 'settings': {'key': 'settings', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "deployment_configuration_type": { + "key": "deploymentConfigurationType", + "type": "str", + }, + "component_id": {"key": "componentId", "type": "IdAssetReference"}, + "description": {"key": "description", "type": "str"}, + "settings": {"key": "settings", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, } def __init__( @@ -4641,8 +4899,10 @@ def __init__( :keyword tags: A set of tags. The tags which will be applied to the job. :paramtype tags: dict[str, str] """ - super(BatchPipelineComponentDeploymentConfiguration, self).__init__(**kwargs) - self.deployment_configuration_type = 'PipelineComponent' # type: str + super(BatchPipelineComponentDeploymentConfiguration, self).__init__( + **kwargs + ) + self.deployment_configuration_type = "PipelineComponent" # type: str self.component_id = component_id self.description = description self.settings = settings @@ -4659,8 +4919,8 @@ class BatchRetrySettings(msrest.serialization.Model): """ _attribute_map = { - 'max_retries': {'key': 'maxRetries', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "max_retries": {"key": "maxRetries", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } def __init__( @@ -4683,38 +4943,41 @@ def __init__( class SamplingAlgorithm(msrest.serialization.Model): """The Sampling Algorithm used to generate hyperparameter values, along with properties to -configure the algorithm. + configure the algorithm. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BayesianSamplingAlgorithm, GridSamplingAlgorithm, RandomSamplingAlgorithm. + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: BayesianSamplingAlgorithm, GridSamplingAlgorithm, RandomSamplingAlgorithm. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating - hyperparameter values, along with configuration properties.Constant filled by server. Possible - values include: "Grid", "Random", "Bayesian". - :vartype sampling_algorithm_type: str or - ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType + :ivar sampling_algorithm_type: Required. [Required] The algorithm used for generating + hyperparameter values, along with configuration properties.Constant filled by server. Possible + values include: "Grid", "Random", "Bayesian". + :vartype sampling_algorithm_type: str or + ~azure.mgmt.machinelearningservices.models.SamplingAlgorithmType """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } _subtype_map = { - 'sampling_algorithm_type': {'Bayesian': 'BayesianSamplingAlgorithm', 'Grid': 'GridSamplingAlgorithm', 'Random': 'RandomSamplingAlgorithm'} + "sampling_algorithm_type": { + "Bayesian": "BayesianSamplingAlgorithm", + "Grid": "GridSamplingAlgorithm", + "Random": "RandomSamplingAlgorithm", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(SamplingAlgorithm, self).__init__(**kwargs) self.sampling_algorithm_type = None # type: Optional[str] @@ -4732,21 +4995,20 @@ class BayesianSamplingAlgorithm(SamplingAlgorithm): """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(BayesianSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Bayesian' # type: str + self.sampling_algorithm_type = "Bayesian" # type: str class BindOptions(msrest.serialization.Model): @@ -4761,9 +5023,9 @@ class BindOptions(msrest.serialization.Model): """ _attribute_map = { - 'propagation': {'key': 'propagation', 'type': 'str'}, - 'create_host_path': {'key': 'createHostPath', 'type': 'bool'}, - 'selinux': {'key': 'selinux', 'type': 'str'}, + "propagation": {"key": "propagation", "type": "str"}, + "create_host_path": {"key": "createHostPath", "type": "bool"}, + "selinux": {"key": "selinux", "type": "str"}, } def __init__( @@ -4801,9 +5063,15 @@ class BlobReferenceForConsumptionDto(msrest.serialization.Model): """ _attribute_map = { - 'blob_uri': {'key': 'blobUri', 'type': 'str'}, - 'credential': {'key': 'credential', 'type': 'PendingUploadCredentialDto'}, - 'storage_account_arm_id': {'key': 'storageAccountArmId', 'type': 'str'}, + "blob_uri": {"key": "blobUri", "type": "str"}, + "credential": { + "key": "credential", + "type": "PendingUploadCredentialDto", + }, + "storage_account_arm_id": { + "key": "storageAccountArmId", + "type": "str", + }, } def __init__( @@ -4836,29 +5104,33 @@ class BuildContext(msrest.serialization.Model): :ivar context_uri: Required. [Required] URI of the Docker build context used to build the image. Supports blob URIs on environment creation and may return blob or Git URIs. - - + + .. raw:: html - + . :vartype context_uri: str :ivar dockerfile_path: Path to the Dockerfile in the build context. - - + + .. raw:: html - + . :vartype dockerfile_path: str """ _validation = { - 'context_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "context_uri": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'context_uri': {'key': 'contextUri', 'type': 'str'}, - 'dockerfile_path': {'key': 'dockerfilePath', 'type': 'str'}, + "context_uri": {"key": "contextUri", "type": "str"}, + "dockerfile_path": {"key": "dockerfilePath", "type": "str"}, } def __init__( @@ -4871,18 +5143,18 @@ def __init__( """ :keyword context_uri: Required. [Required] URI of the Docker build context used to build the image. Supports blob URIs on environment creation and may return blob or Git URIs. - - + + .. raw:: html - + . :paramtype context_uri: str :keyword dockerfile_path: Path to the Dockerfile in the build context. - - + + .. raw:: html - + . :paramtype dockerfile_path: str """ @@ -4908,23 +5180,23 @@ class DataDriftMetricThresholdBase(msrest.serialization.Model): """ _validation = { - 'data_type': {'required': True}, + "data_type": {"required": True}, } _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, + "data_type": {"key": "dataType", "type": "str"}, + "threshold": {"key": "threshold", "type": "MonitoringThreshold"}, } _subtype_map = { - 'data_type': {'Categorical': 'CategoricalDataDriftMetricThreshold', 'Numerical': 'NumericalDataDriftMetricThreshold'} + "data_type": { + "Categorical": "CategoricalDataDriftMetricThreshold", + "Numerical": "NumericalDataDriftMetricThreshold", + } } def __init__( - self, - *, - threshold: Optional["MonitoringThreshold"] = None, - **kwargs + self, *, threshold: Optional["MonitoringThreshold"] = None, **kwargs ): """ :keyword threshold: The threshold value. If null, a default value will be set depending on the @@ -4953,14 +5225,14 @@ class CategoricalDataDriftMetricThreshold(DataDriftMetricThresholdBase): """ _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, + "data_type": {"required": True}, + "metric": {"required": True}, } _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, + "data_type": {"key": "dataType", "type": "str"}, + "threshold": {"key": "threshold", "type": "MonitoringThreshold"}, + "metric": {"key": "metric", "type": "str"}, } def __init__( @@ -4978,8 +5250,10 @@ def __init__( values include: "JensenShannonDistance", "PopulationStabilityIndex", "PearsonsChiSquaredTest". :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.CategoricalDataDriftMetric """ - super(CategoricalDataDriftMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.data_type = 'Categorical' # type: str + super(CategoricalDataDriftMetricThreshold, self).__init__( + threshold=threshold, **kwargs + ) + self.data_type = "Categorical" # type: str self.metric = metric @@ -5000,23 +5274,23 @@ class DataQualityMetricThresholdBase(msrest.serialization.Model): """ _validation = { - 'data_type': {'required': True}, + "data_type": {"required": True}, } _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, + "data_type": {"key": "dataType", "type": "str"}, + "threshold": {"key": "threshold", "type": "MonitoringThreshold"}, } _subtype_map = { - 'data_type': {'Categorical': 'CategoricalDataQualityMetricThreshold', 'Numerical': 'NumericalDataQualityMetricThreshold'} + "data_type": { + "Categorical": "CategoricalDataQualityMetricThreshold", + "Numerical": "NumericalDataQualityMetricThreshold", + } } def __init__( - self, - *, - threshold: Optional["MonitoringThreshold"] = None, - **kwargs + self, *, threshold: Optional["MonitoringThreshold"] = None, **kwargs ): """ :keyword threshold: The threshold value. If null, a default value will be set depending on the @@ -5045,14 +5319,14 @@ class CategoricalDataQualityMetricThreshold(DataQualityMetricThresholdBase): """ _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, + "data_type": {"required": True}, + "metric": {"required": True}, } _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, + "data_type": {"key": "dataType", "type": "str"}, + "threshold": {"key": "threshold", "type": "MonitoringThreshold"}, + "metric": {"key": "metric", "type": "str"}, } def __init__( @@ -5071,8 +5345,10 @@ def __init__( :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.CategoricalDataQualityMetric """ - super(CategoricalDataQualityMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.data_type = 'Categorical' # type: str + super(CategoricalDataQualityMetricThreshold, self).__init__( + threshold=threshold, **kwargs + ) + self.data_type = "Categorical" # type: str self.metric = metric @@ -5093,23 +5369,23 @@ class PredictionDriftMetricThresholdBase(msrest.serialization.Model): """ _validation = { - 'data_type': {'required': True}, + "data_type": {"required": True}, } _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, + "data_type": {"key": "dataType", "type": "str"}, + "threshold": {"key": "threshold", "type": "MonitoringThreshold"}, } _subtype_map = { - 'data_type': {'Categorical': 'CategoricalPredictionDriftMetricThreshold', 'Numerical': 'NumericalPredictionDriftMetricThreshold'} + "data_type": { + "Categorical": "CategoricalPredictionDriftMetricThreshold", + "Numerical": "NumericalPredictionDriftMetricThreshold", + } } def __init__( - self, - *, - threshold: Optional["MonitoringThreshold"] = None, - **kwargs + self, *, threshold: Optional["MonitoringThreshold"] = None, **kwargs ): """ :keyword threshold: The threshold value. If null, a default value will be set depending on the @@ -5121,7 +5397,9 @@ def __init__( self.threshold = threshold -class CategoricalPredictionDriftMetricThreshold(PredictionDriftMetricThresholdBase): +class CategoricalPredictionDriftMetricThreshold( + PredictionDriftMetricThresholdBase +): """CategoricalPredictionDriftMetricThreshold. All required parameters must be populated in order to send to Azure. @@ -5140,14 +5418,14 @@ class CategoricalPredictionDriftMetricThreshold(PredictionDriftMetricThresholdBa """ _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, + "data_type": {"required": True}, + "metric": {"required": True}, } _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, + "data_type": {"key": "dataType", "type": "str"}, + "threshold": {"key": "threshold", "type": "MonitoringThreshold"}, + "metric": {"key": "metric", "type": "str"}, } def __init__( @@ -5167,8 +5445,10 @@ def __init__( :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.CategoricalPredictionDriftMetric """ - super(CategoricalPredictionDriftMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.data_type = 'Categorical' # type: str + super(CategoricalPredictionDriftMetricThreshold, self).__init__( + threshold=threshold, **kwargs + ) + self.data_type = "Categorical" # type: str self.metric = metric @@ -5196,21 +5476,25 @@ class CertificateDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, - 'thumbprint': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials_type": {"required": True}, + "client_id": {"required": True}, + "secrets": {"required": True}, + "tenant_id": {"required": True}, + "thumbprint": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'CertificateDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "authority_url": {"key": "authorityUrl", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + "resource_url": {"key": "resourceUrl", "type": "str"}, + "secrets": {"key": "secrets", "type": "CertificateDatastoreSecrets"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "thumbprint": {"key": "thumbprint", "type": "str"}, } def __init__( @@ -5241,7 +5525,7 @@ def __init__( :paramtype thumbprint: str """ super(CertificateDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Certificate' # type: str + self.credentials_type = "Certificate" # type: str self.authority_url = authority_url self.client_id = client_id self.resource_url = resource_url @@ -5264,26 +5548,21 @@ class CertificateDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'certificate': {'key': 'certificate', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "certificate": {"key": "certificate", "type": "str"}, } - def __init__( - self, - *, - certificate: Optional[str] = None, - **kwargs - ): + def __init__(self, *, certificate: Optional[str] = None, **kwargs): """ :keyword certificate: Service principal certificate. :paramtype certificate: str """ super(CertificateDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Certificate' # type: str + self.secrets_type = "Certificate" # type: str self.certificate = certificate @@ -5328,25 +5607,51 @@ class TableVertical(msrest.serialization.Model): """ _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "TableFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "search_space": { + "key": "searchSpace", + "type": "[TableParameterSubspace]", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "TableSweepSettings", + }, + "test_data": {"key": "testData", "type": "MLTableJobInput"}, + "test_data_size": {"key": "testDataSize", "type": "float"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "weight_column_name": {"key": "weightColumnName", "type": "str"}, } def __init__( self, *, cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "TableVerticalFeaturizationSettings" + ] = None, fixed_parameters: Optional["TableFixedParameters"] = None, limit_settings: Optional["TableVerticalLimitSettings"] = None, n_cross_validations: Optional["NCrossValidations"] = None, @@ -5479,30 +5784,57 @@ class Classification(AutoMLVertical, TableVertical): """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'positive_label': {'key': 'positiveLabel', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'ClassificationTrainingSettings'}, + "task_type": {"required": True}, + "training_data": {"required": True}, + } + + _attribute_map = { + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "TableFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "search_space": { + "key": "searchSpace", + "type": "[TableParameterSubspace]", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "TableSweepSettings", + }, + "test_data": {"key": "testData", "type": "MLTableJobInput"}, + "test_data_size": {"key": "testDataSize", "type": "float"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "weight_column_name": {"key": "weightColumnName", "type": "str"}, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "positive_label": {"key": "positiveLabel", "type": "str"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, + "training_settings": { + "key": "trainingSettings", + "type": "ClassificationTrainingSettings", + }, } def __init__( @@ -5510,7 +5842,9 @@ def __init__( *, training_data: "MLTableJobInput", cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "TableVerticalFeaturizationSettings" + ] = None, fixed_parameters: Optional["TableFixedParameters"] = None, limit_settings: Optional["TableVerticalLimitSettings"] = None, n_cross_validations: Optional["NCrossValidations"] = None, @@ -5524,7 +5858,9 @@ def __init__( log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, positive_label: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "ClassificationPrimaryMetrics"] + ] = None, training_settings: Optional["ClassificationTrainingSettings"] = None, **kwargs ): @@ -5585,7 +5921,24 @@ def __init__( :paramtype training_settings: ~azure.mgmt.machinelearningservices.models.ClassificationTrainingSettings """ - super(Classification, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, cv_split_column_names=cv_split_column_names, featurization_settings=featurization_settings, fixed_parameters=fixed_parameters, limit_settings=limit_settings, n_cross_validations=n_cross_validations, search_space=search_space, sweep_settings=sweep_settings, test_data=test_data, test_data_size=test_data_size, validation_data=validation_data, validation_data_size=validation_data_size, weight_column_name=weight_column_name, **kwargs) + super(Classification, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + cv_split_column_names=cv_split_column_names, + featurization_settings=featurization_settings, + fixed_parameters=fixed_parameters, + limit_settings=limit_settings, + n_cross_validations=n_cross_validations, + search_space=search_space, + sweep_settings=sweep_settings, + test_data=test_data, + test_data_size=test_data_size, + validation_data=validation_data, + validation_data_size=validation_data_size, + weight_column_name=weight_column_name, + **kwargs + ) self.cv_split_column_names = cv_split_column_names self.featurization_settings = featurization_settings self.fixed_parameters = fixed_parameters @@ -5598,7 +5951,7 @@ def __init__( self.validation_data = validation_data self.validation_data_size = validation_data_size self.weight_column_name = weight_column_name - self.task_type = 'Classification' # type: str + self.task_type = "Classification" # type: str self.positive_label = positive_label self.primary_metric = primary_metric self.training_settings = training_settings @@ -5624,23 +5977,23 @@ class ModelPerformanceMetricThresholdBase(msrest.serialization.Model): """ _validation = { - 'model_type': {'required': True}, + "model_type": {"required": True}, } _attribute_map = { - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, + "model_type": {"key": "modelType", "type": "str"}, + "threshold": {"key": "threshold", "type": "MonitoringThreshold"}, } _subtype_map = { - 'model_type': {'Classification': 'ClassificationModelPerformanceMetricThreshold', 'Regression': 'RegressionModelPerformanceMetricThreshold'} + "model_type": { + "Classification": "ClassificationModelPerformanceMetricThreshold", + "Regression": "RegressionModelPerformanceMetricThreshold", + } } def __init__( - self, - *, - threshold: Optional["MonitoringThreshold"] = None, - **kwargs + self, *, threshold: Optional["MonitoringThreshold"] = None, **kwargs ): """ :keyword threshold: The threshold value. If null, a default value will be set depending on the @@ -5652,7 +6005,9 @@ def __init__( self.threshold = threshold -class ClassificationModelPerformanceMetricThreshold(ModelPerformanceMetricThresholdBase): +class ClassificationModelPerformanceMetricThreshold( + ModelPerformanceMetricThresholdBase +): """ClassificationModelPerformanceMetricThreshold. All required parameters must be populated in order to send to Azure. @@ -5670,14 +6025,14 @@ class ClassificationModelPerformanceMetricThreshold(ModelPerformanceMetricThresh """ _validation = { - 'model_type': {'required': True}, - 'metric': {'required': True}, + "model_type": {"required": True}, + "metric": {"required": True}, } _attribute_map = { - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, + "model_type": {"key": "modelType", "type": "str"}, + "threshold": {"key": "threshold", "type": "MonitoringThreshold"}, + "metric": {"key": "metric", "type": "str"}, } def __init__( @@ -5696,8 +6051,10 @@ def __init__( :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.ClassificationModelPerformanceMetric """ - super(ClassificationModelPerformanceMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.model_type = 'Classification' # type: str + super(ClassificationModelPerformanceMetricThreshold, self).__init__( + threshold=threshold, **kwargs + ) + self.model_type = "Classification" # type: str self.metric = metric @@ -5732,14 +6089,29 @@ class TrainingSettings(msrest.serialization.Model): """ _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, + "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, + "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, + "training_mode": {"key": "trainingMode", "type": "str"}, } def __init__( @@ -5830,16 +6202,37 @@ class ClassificationTrainingSettings(TrainingSettings): """ _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, + "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, + "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, + "training_mode": {"key": "trainingMode", "type": "str"}, + "allowed_training_algorithms": { + "key": "allowedTrainingAlgorithms", + "type": "[str]", + }, + "blocked_training_algorithms": { + "key": "blockedTrainingAlgorithms", + "type": "[str]", + }, } def __init__( @@ -5853,8 +6246,12 @@ def __init__( ensemble_model_download_timeout: Optional[datetime.timedelta] = "PT5M", stack_ensemble_settings: Optional["StackEnsembleSettings"] = None, training_mode: Optional[Union[str, "TrainingMode"]] = None, - allowed_training_algorithms: Optional[List[Union[str, "ClassificationModels"]]] = None, - blocked_training_algorithms: Optional[List[Union[str, "ClassificationModels"]]] = None, + allowed_training_algorithms: Optional[ + List[Union[str, "ClassificationModels"]] + ] = None, + blocked_training_algorithms: Optional[ + List[Union[str, "ClassificationModels"]] + ] = None, **kwargs ): """ @@ -5890,7 +6287,17 @@ def __init__( :paramtype blocked_training_algorithms: list[str or ~azure.mgmt.machinelearningservices.models.ClassificationModels] """ - super(ClassificationTrainingSettings, self).__init__(enable_dnn_training=enable_dnn_training, enable_model_explainability=enable_model_explainability, enable_onnx_compatible_models=enable_onnx_compatible_models, enable_stack_ensemble=enable_stack_ensemble, enable_vote_ensemble=enable_vote_ensemble, ensemble_model_download_timeout=ensemble_model_download_timeout, stack_ensemble_settings=stack_ensemble_settings, training_mode=training_mode, **kwargs) + super(ClassificationTrainingSettings, self).__init__( + enable_dnn_training=enable_dnn_training, + enable_model_explainability=enable_model_explainability, + enable_onnx_compatible_models=enable_onnx_compatible_models, + enable_stack_ensemble=enable_stack_ensemble, + enable_vote_ensemble=enable_vote_ensemble, + ensemble_model_download_timeout=ensemble_model_download_timeout, + stack_ensemble_settings=stack_ensemble_settings, + training_mode=training_mode, + **kwargs + ) self.allowed_training_algorithms = allowed_training_algorithms self.blocked_training_algorithms = blocked_training_algorithms @@ -5903,7 +6310,10 @@ class ClusterUpdateParameters(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties.properties', 'type': 'ScaleSettingsInformation'}, + "properties": { + "key": "properties.properties", + "type": "ScaleSettingsInformation", + }, } def __init__( @@ -5944,31 +6354,31 @@ class ExportSummary(msrest.serialization.Model): """ _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, + "end_date_time": {"readonly": True}, + "exported_row_count": {"readonly": True}, + "format": {"required": True}, + "labeling_job_id": {"readonly": True}, + "start_date_time": {"readonly": True}, } _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, + "end_date_time": {"key": "endDateTime", "type": "iso-8601"}, + "exported_row_count": {"key": "exportedRowCount", "type": "long"}, + "format": {"key": "format", "type": "str"}, + "labeling_job_id": {"key": "labelingJobId", "type": "str"}, + "start_date_time": {"key": "startDateTime", "type": "iso-8601"}, } _subtype_map = { - 'format': {'CSV': 'CsvExportSummary', 'Coco': 'CocoExportSummary', 'Dataset': 'DatasetExportSummary'} + "format": { + "CSV": "CsvExportSummary", + "Coco": "CocoExportSummary", + "Dataset": "DatasetExportSummary", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ExportSummary, self).__init__(**kwargs) self.end_date_time = None self.exported_row_count = None @@ -6002,33 +6412,29 @@ class CocoExportSummary(ExportSummary): """ _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'container_name': {'readonly': True}, - 'snapshot_path': {'readonly': True}, + "end_date_time": {"readonly": True}, + "exported_row_count": {"readonly": True}, + "format": {"required": True}, + "labeling_job_id": {"readonly": True}, + "start_date_time": {"readonly": True}, + "container_name": {"readonly": True}, + "snapshot_path": {"readonly": True}, } _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'snapshot_path': {'key': 'snapshotPath', 'type': 'str'}, + "end_date_time": {"key": "endDateTime", "type": "iso-8601"}, + "exported_row_count": {"key": "exportedRowCount", "type": "long"}, + "format": {"key": "format", "type": "str"}, + "labeling_job_id": {"key": "labelingJobId", "type": "str"}, + "start_date_time": {"key": "startDateTime", "type": "iso-8601"}, + "container_name": {"key": "containerName", "type": "str"}, + "snapshot_path": {"key": "snapshotPath", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(CocoExportSummary, self).__init__(**kwargs) - self.format = 'Coco' # type: str + self.format = "Coco" # type: str self.container_name = None self.snapshot_path = None @@ -6045,20 +6451,20 @@ class CodeConfiguration(msrest.serialization.Model): """ _validation = { - 'scoring_script': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "scoring_script": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'scoring_script': {'key': 'scoringScript', 'type': 'str'}, + "code_id": {"key": "codeId", "type": "str"}, + "scoring_script": {"key": "scoringScript", "type": "str"}, } def __init__( - self, - *, - scoring_script: str, - code_id: Optional[str] = None, - **kwargs + self, *, scoring_script: str, code_id: Optional[str] = None, **kwargs ): """ :keyword code_id: ARM resource ID of the code asset. @@ -6094,27 +6500,22 @@ class CodeContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "CodeContainerProperties"}, } - def __init__( - self, - *, - properties: "CodeContainerProperties", - **kwargs - ): + def __init__(self, *, properties: "CodeContainerProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeContainerProperties @@ -6147,19 +6548,19 @@ class CodeContainerProperties(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } def __init__( @@ -6181,7 +6582,13 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(CodeContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) + super(CodeContainerProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs + ) self.provisioning_state = None @@ -6196,8 +6603,8 @@ class CodeContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[CodeContainer]"}, } def __init__( @@ -6242,27 +6649,22 @@ class CodeVersion(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'CodeVersionProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "CodeVersionProperties"}, } - def __init__( - self, - *, - properties: "CodeVersionProperties", - **kwargs - ): + def __init__(self, *, properties: "CodeVersionProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.CodeVersionProperties @@ -6299,18 +6701,21 @@ class CodeVersionProperties(AssetBase): """ _validation = { - 'provisioning_state': {'readonly': True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'code_uri': {'key': 'codeUri', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "auto_delete_setting": { + "key": "autoDeleteSetting", + "type": "AutoDeleteSetting", + }, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "code_uri": {"key": "codeUri", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } def __init__( @@ -6343,7 +6748,15 @@ def __init__( :keyword code_uri: Uri where code is located. :paramtype code_uri: str """ - super(CodeVersionProperties, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) + super(CodeVersionProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + auto_delete_setting=auto_delete_setting, + is_anonymous=is_anonymous, + is_archived=is_archived, + **kwargs + ) self.code_uri = code_uri self.provisioning_state = None @@ -6359,8 +6772,8 @@ class CodeVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[CodeVersion]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[CodeVersion]"}, } def __init__( @@ -6401,17 +6814,19 @@ class Collection(msrest.serialization.Model): """ _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'data_collection_mode': {'key': 'dataCollectionMode', 'type': 'str'}, - 'data_id': {'key': 'dataId', 'type': 'str'}, - 'sampling_rate': {'key': 'samplingRate', 'type': 'float'}, + "client_id": {"key": "clientId", "type": "str"}, + "data_collection_mode": {"key": "dataCollectionMode", "type": "str"}, + "data_id": {"key": "dataId", "type": "str"}, + "sampling_rate": {"key": "samplingRate", "type": "float"}, } def __init__( self, *, client_id: Optional[str] = None, - data_collection_mode: Optional[Union[str, "DataCollectionMode"]] = None, + data_collection_mode: Optional[ + Union[str, "DataCollectionMode"] + ] = None, data_id: Optional[str] = None, sampling_rate: Optional[float] = 1, **kwargs @@ -6449,8 +6864,8 @@ class ColumnTransformer(msrest.serialization.Model): """ _attribute_map = { - 'fields': {'key': 'fields', 'type': '[str]'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, + "fields": {"key": "fields", "type": "[str]"}, + "parameters": {"key": "parameters", "type": "object"}, } def __init__( @@ -6546,40 +6961,63 @@ class CommandJob(JobBaseProperties): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'parameters': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'autologger_settings': {'key': 'autologgerSettings', 'type': 'AutologgerSettings'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'CommandJobLimits'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'parameters': {'key': 'parameters', 'type': 'object'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, + "job_type": {"required": True}, + "status": {"readonly": True}, + "command": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "environment_id": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "parameters": {"readonly": True}, + } + + _attribute_map = { + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "notification_setting": { + "key": "notificationSetting", + "type": "NotificationSetting", + }, + "secrets_configuration": { + "key": "secretsConfiguration", + "type": "{SecretConfiguration}", + }, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "autologger_settings": { + "key": "autologgerSettings", + "type": "AutologgerSettings", + }, + "code_id": {"key": "codeId", "type": "str"}, + "command": {"key": "command", "type": "str"}, + "distribution": { + "key": "distribution", + "type": "DistributionConfiguration", + }, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "limits": {"key": "limits", "type": "CommandJobLimits"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "parameters": {"key": "parameters", "type": "object"}, + "queue_settings": {"key": "queueSettings", "type": "QueueSettings"}, + "resources": {"key": "resources", "type": "JobResourceConfiguration"}, } def __init__( @@ -6597,7 +7035,9 @@ def __init__( identity: Optional["IdentityConfiguration"] = None, is_archived: Optional[bool] = False, notification_setting: Optional["NotificationSetting"] = None, - secrets_configuration: Optional[Dict[str, "SecretConfiguration"]] = None, + secrets_configuration: Optional[ + Dict[str, "SecretConfiguration"] + ] = None, services: Optional[Dict[str, "JobService"]] = None, autologger_settings: Optional["AutologgerSettings"] = None, code_id: Optional[str] = None, @@ -6667,8 +7107,22 @@ def __init__( :keyword resources: Compute Resource configuration for the job. :paramtype resources: ~azure.mgmt.machinelearningservices.models.JobResourceConfiguration """ - super(CommandJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, notification_setting=notification_setting, secrets_configuration=secrets_configuration, services=services, **kwargs) - self.job_type = 'Command' # type: str + super(CommandJob, self).__init__( + description=description, + properties=properties, + tags=tags, + component_id=component_id, + compute_id=compute_id, + display_name=display_name, + experiment_name=experiment_name, + identity=identity, + is_archived=is_archived, + notification_setting=notification_setting, + secrets_configuration=secrets_configuration, + services=services, + **kwargs + ) + self.job_type = "Command" # type: str self.autologger_settings = autologger_settings self.code_id = code_id self.command = command @@ -6700,23 +7154,23 @@ class JobLimits(msrest.serialization.Model): """ _validation = { - 'job_limits_type': {'required': True}, + "job_limits_type": {"required": True}, } _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "job_limits_type": {"key": "jobLimitsType", "type": "str"}, + "timeout": {"key": "timeout", "type": "duration"}, } _subtype_map = { - 'job_limits_type': {'Command': 'CommandJobLimits', 'Sweep': 'SweepJobLimits'} + "job_limits_type": { + "Command": "CommandJobLimits", + "Sweep": "SweepJobLimits", + } } def __init__( - self, - *, - timeout: Optional[datetime.timedelta] = None, - **kwargs + self, *, timeout: Optional[datetime.timedelta] = None, **kwargs ): """ :keyword timeout: The max run duration in ISO 8601 format, after which the job will be @@ -6742,19 +7196,16 @@ class CommandJobLimits(JobLimits): """ _validation = { - 'job_limits_type': {'required': True}, + "job_limits_type": {"required": True}, } _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "job_limits_type": {"key": "jobLimitsType", "type": "str"}, + "timeout": {"key": "timeout", "type": "duration"}, } def __init__( - self, - *, - timeout: Optional[datetime.timedelta] = None, - **kwargs + self, *, timeout: Optional[datetime.timedelta] = None, **kwargs ): """ :keyword timeout: The max run duration in ISO 8601 format, after which the job will be @@ -6762,7 +7213,7 @@ def __init__( :paramtype timeout: ~datetime.timedelta """ super(CommandJobLimits, self).__init__(timeout=timeout, **kwargs) - self.job_limits_type = 'Command' # type: str + self.job_limits_type = "Command" # type: str class ComponentContainer(Resource): @@ -6788,26 +7239,26 @@ class ComponentContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "ComponentContainerProperties", + }, } def __init__( - self, - *, - properties: "ComponentContainerProperties", - **kwargs + self, *, properties: "ComponentContainerProperties", **kwargs ): """ :keyword properties: Required. [Required] Additional attributes of the entity. @@ -6821,44 +7272,44 @@ class ComponentContainerProperties(AssetContainer): """Component container definition. -.. raw:: html + .. raw:: html - . + . - Variables are only populated by the server, and will be ignored when sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar description: The asset description text. - :vartype description: str - :ivar properties: The asset property dictionary. - :vartype properties: dict[str, str] - :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar is_archived: Is the asset archived?. - :vartype is_archived: bool - :ivar latest_version: The latest version inside this container. - :vartype latest_version: str - :ivar next_version: The next auto incremental version. - :vartype next_version: str - :ivar provisioning_state: Provisioning state for the component container. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.machinelearningservices.models.AssetProvisioningState + :ivar description: The asset description text. + :vartype description: str + :ivar properties: The asset property dictionary. + :vartype properties: dict[str, str] + :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + :ivar is_archived: Is the asset archived?. + :vartype is_archived: bool + :ivar latest_version: The latest version inside this container. + :vartype latest_version: str + :ivar next_version: The next auto incremental version. + :vartype next_version: str + :ivar provisioning_state: Provisioning state for the component container. Possible values + include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.machinelearningservices.models.AssetProvisioningState """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } def __init__( @@ -6880,7 +7331,13 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(ComponentContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) + super(ComponentContainerProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs + ) self.provisioning_state = None @@ -6895,8 +7352,8 @@ class ComponentContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ComponentContainer]"}, } def __init__( @@ -6913,7 +7370,9 @@ def __init__( :keyword value: An array of objects of type ComponentContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentContainer] """ - super(ComponentContainerResourceArmPaginatedResult, self).__init__(**kwargs) + super(ComponentContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -6941,27 +7400,25 @@ class ComponentVersion(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ComponentVersionProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "ComponentVersionProperties", + }, } - def __init__( - self, - *, - properties: "ComponentVersionProperties", - **kwargs - ): + def __init__(self, *, properties: "ComponentVersionProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ComponentVersionProperties @@ -6990,10 +7447,10 @@ class ComponentVersionProperties(AssetBase): provided it will be used to populate IsArchived. :vartype is_archived: bool :ivar component_spec: Defines Component definition details. - - + + .. raw:: html - + . @@ -7007,19 +7464,22 @@ class ComponentVersionProperties(AssetBase): """ _validation = { - 'provisioning_state': {'readonly': True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'component_spec': {'key': 'componentSpec', 'type': 'object'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "auto_delete_setting": { + "key": "autoDeleteSetting", + "type": "AutoDeleteSetting", + }, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "component_spec": {"key": "componentSpec", "type": "object"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "stage": {"key": "stage", "type": "str"}, } def __init__( @@ -7051,10 +7511,10 @@ def __init__( provided it will be used to populate IsArchived. :paramtype is_archived: bool :keyword component_spec: Defines Component definition details. - - + + .. raw:: html - + . @@ -7062,7 +7522,15 @@ def __init__( :keyword stage: Stage in the component lifecycle. :paramtype stage: str """ - super(ComponentVersionProperties, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) + super(ComponentVersionProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + auto_delete_setting=auto_delete_setting, + is_anonymous=is_anonymous, + is_archived=is_archived, + **kwargs + ) self.component_spec = component_spec self.provisioning_state = None self.stage = stage @@ -7079,8 +7547,8 @@ class ComponentVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ComponentVersion]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ComponentVersion]"}, } def __init__( @@ -7097,7 +7565,9 @@ def __init__( :keyword value: An array of objects of type ComponentVersion. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ComponentVersion] """ - super(ComponentVersionResourceArmPaginatedResult, self).__init__(**kwargs) + super(ComponentVersionResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -7110,7 +7580,10 @@ class ComputeInstanceSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, + "properties": { + "key": "properties", + "type": "ComputeInstanceProperties", + }, } def __init__( @@ -7166,26 +7639,32 @@ class ComputeInstance(Compute, ComputeInstanceSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": { + "key": "properties", + "type": "ComputeInstanceProperties", + }, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -7211,9 +7690,16 @@ def __init__( MSI and AAD exclusively for authentication. :paramtype disable_local_auth: bool """ - super(ComputeInstance, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) + super(ComputeInstance, self).__init__( + compute_location=compute_location, + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'ComputeInstance' # type: str + self.compute_type = "ComputeInstance" # type: str self.compute_location = compute_location self.provisioning_state = None self.description = description @@ -7235,8 +7721,8 @@ class ComputeInstanceApplication(msrest.serialization.Model): """ _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, + "display_name": {"key": "displayName", "type": "str"}, + "endpoint_uri": {"key": "endpointUri", "type": "str"}, } def __init__( @@ -7266,7 +7752,7 @@ class ComputeInstanceAutologgerSettings(msrest.serialization.Model): """ _attribute_map = { - 'mlflow_autologger': {'key': 'mlflowAutologger', 'type': 'str'}, + "mlflow_autologger": {"key": "mlflowAutologger", "type": "str"}, } def __init__( @@ -7298,21 +7784,17 @@ class ComputeInstanceConnectivityEndpoints(msrest.serialization.Model): """ _validation = { - 'public_ip_address': {'readonly': True}, - 'private_ip_address': {'readonly': True}, + "public_ip_address": {"readonly": True}, + "private_ip_address": {"readonly": True}, } _attribute_map = { - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + "public_ip_address": {"key": "publicIpAddress", "type": "str"}, + "private_ip_address": {"key": "privateIpAddress", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ComputeInstanceConnectivityEndpoints, self).__init__(**kwargs) self.public_ip_address = None self.private_ip_address = None @@ -7338,16 +7820,19 @@ class ComputeInstanceContainer(msrest.serialization.Model): """ _validation = { - 'services': {'readonly': True}, + "services": {"readonly": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'autosave': {'key': 'autosave', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'network': {'key': 'network', 'type': 'str'}, - 'environment': {'key': 'environment', 'type': 'ComputeInstanceEnvironmentInfo'}, - 'services': {'key': 'services', 'type': '[object]'}, + "name": {"key": "name", "type": "str"}, + "autosave": {"key": "autosave", "type": "str"}, + "gpu": {"key": "gpu", "type": "str"}, + "network": {"key": "network", "type": "str"}, + "environment": { + "key": "environment", + "type": "ComputeInstanceEnvironmentInfo", + }, + "services": {"key": "services", "type": "[object]"}, } def __init__( @@ -7396,23 +7881,19 @@ class ComputeInstanceCreatedBy(msrest.serialization.Model): """ _validation = { - 'user_name': {'readonly': True}, - 'user_org_id': {'readonly': True}, - 'user_id': {'readonly': True}, + "user_name": {"readonly": True}, + "user_org_id": {"readonly": True}, + "user_id": {"readonly": True}, } _attribute_map = { - 'user_name': {'key': 'userName', 'type': 'str'}, - 'user_org_id': {'key': 'userOrgId', 'type': 'str'}, - 'user_id': {'key': 'userId', 'type': 'str'}, + "user_name": {"key": "userName", "type": "str"}, + "user_org_id": {"key": "userOrgId", "type": "str"}, + "user_id": {"key": "userId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ComputeInstanceCreatedBy, self).__init__(**kwargs) self.user_name = None self.user_org_id = None @@ -7437,10 +7918,10 @@ class ComputeInstanceDataDisk(msrest.serialization.Model): """ _attribute_map = { - 'caching': {'key': 'caching', 'type': 'str'}, - 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, - 'lun': {'key': 'lun', 'type': 'int'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + "caching": {"key": "caching", "type": "str"}, + "disk_size_gb": {"key": "diskSizeGB", "type": "int"}, + "lun": {"key": "lun", "type": "int"}, + "storage_account_type": {"key": "storageAccountType", "type": "str"}, } def __init__( @@ -7449,7 +7930,9 @@ def __init__( caching: Optional[Union[str, "Caching"]] = None, disk_size_gb: Optional[int] = None, lun: Optional[int] = None, - storage_account_type: Optional[Union[str, "StorageAccountType"]] = "Standard_LRS", + storage_account_type: Optional[ + Union[str, "StorageAccountType"] + ] = "Standard_LRS", **kwargs ): """ @@ -7498,15 +7981,15 @@ class ComputeInstanceDataMount(msrest.serialization.Model): """ _attribute_map = { - 'source': {'key': 'source', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'mount_name': {'key': 'mountName', 'type': 'str'}, - 'mount_action': {'key': 'mountAction', 'type': 'str'}, - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - 'mount_state': {'key': 'mountState', 'type': 'str'}, - 'mounted_on': {'key': 'mountedOn', 'type': 'iso-8601'}, - 'error': {'key': 'error', 'type': 'str'}, + "source": {"key": "source", "type": "str"}, + "source_type": {"key": "sourceType", "type": "str"}, + "mount_name": {"key": "mountName", "type": "str"}, + "mount_action": {"key": "mountAction", "type": "str"}, + "created_by": {"key": "createdBy", "type": "str"}, + "mount_path": {"key": "mountPath", "type": "str"}, + "mount_state": {"key": "mountState", "type": "str"}, + "mounted_on": {"key": "mountedOn", "type": "iso-8601"}, + "error": {"key": "error", "type": "str"}, } def __init__( @@ -7566,8 +8049,8 @@ class ComputeInstanceEnvironmentInfo(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "version": {"key": "version", "type": "str"}, } def __init__( @@ -7605,10 +8088,10 @@ class ComputeInstanceLastOperation(msrest.serialization.Model): """ _attribute_map = { - 'operation_name': {'key': 'operationName', 'type': 'str'}, - 'operation_time': {'key': 'operationTime', 'type': 'iso-8601'}, - 'operation_status': {'key': 'operationStatus', 'type': 'str'}, - 'operation_trigger': {'key': 'operationTrigger', 'type': 'str'}, + "operation_name": {"key": "operationName", "type": "str"}, + "operation_time": {"key": "operationTime", "type": "iso-8601"}, + "operation_status": {"key": "operationStatus", "type": "str"}, + "operation_trigger": {"key": "operationTrigger", "type": "str"}, } def __init__( @@ -7717,43 +8200,85 @@ class ComputeInstanceProperties(msrest.serialization.Model): """ _validation = { - 'os_image_metadata': {'readonly': True}, - 'connectivity_endpoints': {'readonly': True}, - 'applications': {'readonly': True}, - 'created_by': {'readonly': True}, - 'errors': {'readonly': True}, - 'state': {'readonly': True}, - 'last_operation': {'readonly': True}, - 'containers': {'readonly': True}, - 'data_disks': {'readonly': True}, - 'data_mounts': {'readonly': True}, - 'versions': {'readonly': True}, - } - - _attribute_map = { - 'vm_size': {'key': 'vmSize', 'type': 'str'}, - 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, - 'application_sharing_policy': {'key': 'applicationSharingPolicy', 'type': 'str'}, - 'autologger_settings': {'key': 'autologgerSettings', 'type': 'ComputeInstanceAutologgerSettings'}, - 'ssh_settings': {'key': 'sshSettings', 'type': 'ComputeInstanceSshSettings'}, - 'custom_services': {'key': 'customServices', 'type': '[CustomService]'}, - 'os_image_metadata': {'key': 'osImageMetadata', 'type': 'ImageMetadata'}, - 'connectivity_endpoints': {'key': 'connectivityEndpoints', 'type': 'ComputeInstanceConnectivityEndpoints'}, - 'applications': {'key': 'applications', 'type': '[ComputeInstanceApplication]'}, - 'created_by': {'key': 'createdBy', 'type': 'ComputeInstanceCreatedBy'}, - 'errors': {'key': 'errors', 'type': '[ErrorResponse]'}, - 'state': {'key': 'state', 'type': 'str'}, - 'compute_instance_authorization_type': {'key': 'computeInstanceAuthorizationType', 'type': 'str'}, - 'personal_compute_instance_settings': {'key': 'personalComputeInstanceSettings', 'type': 'PersonalComputeInstanceSettings'}, - 'setup_scripts': {'key': 'setupScripts', 'type': 'SetupScripts'}, - 'last_operation': {'key': 'lastOperation', 'type': 'ComputeInstanceLastOperation'}, - 'schedules': {'key': 'schedules', 'type': 'ComputeSchedules'}, - 'idle_time_before_shutdown': {'key': 'idleTimeBeforeShutdown', 'type': 'str'}, - 'enable_node_public_ip': {'key': 'enableNodePublicIp', 'type': 'bool'}, - 'containers': {'key': 'containers', 'type': '[ComputeInstanceContainer]'}, - 'data_disks': {'key': 'dataDisks', 'type': '[ComputeInstanceDataDisk]'}, - 'data_mounts': {'key': 'dataMounts', 'type': '[ComputeInstanceDataMount]'}, - 'versions': {'key': 'versions', 'type': 'ComputeInstanceVersion'}, + "os_image_metadata": {"readonly": True}, + "connectivity_endpoints": {"readonly": True}, + "applications": {"readonly": True}, + "created_by": {"readonly": True}, + "errors": {"readonly": True}, + "state": {"readonly": True}, + "last_operation": {"readonly": True}, + "containers": {"readonly": True}, + "data_disks": {"readonly": True}, + "data_mounts": {"readonly": True}, + "versions": {"readonly": True}, + } + + _attribute_map = { + "vm_size": {"key": "vmSize", "type": "str"}, + "subnet": {"key": "subnet", "type": "ResourceId"}, + "application_sharing_policy": { + "key": "applicationSharingPolicy", + "type": "str", + }, + "autologger_settings": { + "key": "autologgerSettings", + "type": "ComputeInstanceAutologgerSettings", + }, + "ssh_settings": { + "key": "sshSettings", + "type": "ComputeInstanceSshSettings", + }, + "custom_services": { + "key": "customServices", + "type": "[CustomService]", + }, + "os_image_metadata": { + "key": "osImageMetadata", + "type": "ImageMetadata", + }, + "connectivity_endpoints": { + "key": "connectivityEndpoints", + "type": "ComputeInstanceConnectivityEndpoints", + }, + "applications": { + "key": "applications", + "type": "[ComputeInstanceApplication]", + }, + "created_by": {"key": "createdBy", "type": "ComputeInstanceCreatedBy"}, + "errors": {"key": "errors", "type": "[ErrorResponse]"}, + "state": {"key": "state", "type": "str"}, + "compute_instance_authorization_type": { + "key": "computeInstanceAuthorizationType", + "type": "str", + }, + "personal_compute_instance_settings": { + "key": "personalComputeInstanceSettings", + "type": "PersonalComputeInstanceSettings", + }, + "setup_scripts": {"key": "setupScripts", "type": "SetupScripts"}, + "last_operation": { + "key": "lastOperation", + "type": "ComputeInstanceLastOperation", + }, + "schedules": {"key": "schedules", "type": "ComputeSchedules"}, + "idle_time_before_shutdown": { + "key": "idleTimeBeforeShutdown", + "type": "str", + }, + "enable_node_public_ip": {"key": "enableNodePublicIp", "type": "bool"}, + "containers": { + "key": "containers", + "type": "[ComputeInstanceContainer]", + }, + "data_disks": { + "key": "dataDisks", + "type": "[ComputeInstanceDataDisk]", + }, + "data_mounts": { + "key": "dataMounts", + "type": "[ComputeInstanceDataMount]", + }, + "versions": {"key": "versions", "type": "ComputeInstanceVersion"}, } def __init__( @@ -7761,12 +8286,20 @@ def __init__( *, vm_size: Optional[str] = None, subnet: Optional["ResourceId"] = None, - application_sharing_policy: Optional[Union[str, "ApplicationSharingPolicy"]] = "Shared", - autologger_settings: Optional["ComputeInstanceAutologgerSettings"] = None, + application_sharing_policy: Optional[ + Union[str, "ApplicationSharingPolicy"] + ] = "Shared", + autologger_settings: Optional[ + "ComputeInstanceAutologgerSettings" + ] = None, ssh_settings: Optional["ComputeInstanceSshSettings"] = None, custom_services: Optional[List["CustomService"]] = None, - compute_instance_authorization_type: Optional[Union[str, "ComputeInstanceAuthorizationType"]] = "personal", - personal_compute_instance_settings: Optional["PersonalComputeInstanceSettings"] = None, + compute_instance_authorization_type: Optional[ + Union[str, "ComputeInstanceAuthorizationType"] + ] = "personal", + personal_compute_instance_settings: Optional[ + "PersonalComputeInstanceSettings" + ] = None, setup_scripts: Optional["SetupScripts"] = None, schedules: Optional["ComputeSchedules"] = None, idle_time_before_shutdown: Optional[str] = None, @@ -7826,8 +8359,12 @@ def __init__( self.created_by = None self.errors = None self.state = None - self.compute_instance_authorization_type = compute_instance_authorization_type - self.personal_compute_instance_settings = personal_compute_instance_settings + self.compute_instance_authorization_type = ( + compute_instance_authorization_type + ) + self.personal_compute_instance_settings = ( + personal_compute_instance_settings + ) self.setup_scripts = setup_scripts self.last_operation = None self.schedules = schedules @@ -7859,21 +8396,23 @@ class ComputeInstanceSshSettings(msrest.serialization.Model): """ _validation = { - 'admin_user_name': {'readonly': True}, - 'ssh_port': {'readonly': True}, + "admin_user_name": {"readonly": True}, + "ssh_port": {"readonly": True}, } _attribute_map = { - 'ssh_public_access': {'key': 'sshPublicAccess', 'type': 'str'}, - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'admin_public_key': {'key': 'adminPublicKey', 'type': 'str'}, + "ssh_public_access": {"key": "sshPublicAccess", "type": "str"}, + "admin_user_name": {"key": "adminUserName", "type": "str"}, + "ssh_port": {"key": "sshPort", "type": "int"}, + "admin_public_key": {"key": "adminPublicKey", "type": "str"}, } def __init__( self, *, - ssh_public_access: Optional[Union[str, "SshPublicAccess"]] = "Disabled", + ssh_public_access: Optional[ + Union[str, "SshPublicAccess"] + ] = "Disabled", admin_public_key: Optional[str] = None, **kwargs ): @@ -7902,15 +8441,10 @@ class ComputeInstanceVersion(msrest.serialization.Model): """ _attribute_map = { - 'runtime': {'key': 'runtime', 'type': 'str'}, + "runtime": {"key": "runtime", "type": "str"}, } - def __init__( - self, - *, - runtime: Optional[str] = None, - **kwargs - ): + def __init__(self, *, runtime: Optional[str] = None, **kwargs): """ :keyword runtime: Runtime of compute instance. :paramtype runtime: str @@ -7927,15 +8461,10 @@ class ComputeResourceSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, + "properties": {"key": "properties", "type": "Compute"}, } - def __init__( - self, - *, - properties: Optional["Compute"] = None, - **kwargs - ): + def __init__(self, *, properties: Optional["Compute"] = None, **kwargs): """ :keyword properties: Compute properties. :paramtype properties: ~azure.mgmt.machinelearningservices.models.Compute @@ -7973,22 +8502,22 @@ class ComputeResource(Resource, ComputeResourceSchema): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'Compute'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "properties": {"key": "properties", "type": "Compute"}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, } def __init__( @@ -8033,14 +8562,11 @@ class ComputeRuntimeDto(msrest.serialization.Model): """ _attribute_map = { - 'spark_runtime_version': {'key': 'sparkRuntimeVersion', 'type': 'str'}, + "spark_runtime_version": {"key": "sparkRuntimeVersion", "type": "str"}, } def __init__( - self, - *, - spark_runtime_version: Optional[str] = None, - **kwargs + self, *, spark_runtime_version: Optional[str] = None, **kwargs ): """ :keyword spark_runtime_version: @@ -8059,7 +8585,10 @@ class ComputeSchedules(msrest.serialization.Model): """ _attribute_map = { - 'compute_start_stop': {'key': 'computeStartStop', 'type': '[ComputeStartStopSchedule]'}, + "compute_start_stop": { + "key": "computeStartStop", + "type": "[ComputeStartStopSchedule]", + }, } def __init__( @@ -8105,19 +8634,19 @@ class ComputeStartStopSchedule(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'provisioning_status': {'readonly': True}, + "id": {"readonly": True}, + "provisioning_status": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'recurrence': {'key': 'recurrence', 'type': 'Recurrence'}, - 'cron': {'key': 'cron', 'type': 'Cron'}, - 'schedule': {'key': 'schedule', 'type': 'ScheduleBase'}, + "id": {"key": "id", "type": "str"}, + "provisioning_status": {"key": "provisioningStatus", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "action": {"key": "action", "type": "str"}, + "trigger_type": {"key": "triggerType", "type": "str"}, + "recurrence": {"key": "recurrence", "type": "Recurrence"}, + "cron": {"key": "cron", "type": "Cron"}, + "schedule": {"key": "schedule", "type": "ScheduleBase"}, } def __init__( @@ -8170,15 +8699,25 @@ class ContainerResourceRequirements(msrest.serialization.Model): """ _attribute_map = { - 'container_resource_limits': {'key': 'containerResourceLimits', 'type': 'ContainerResourceSettings'}, - 'container_resource_requests': {'key': 'containerResourceRequests', 'type': 'ContainerResourceSettings'}, + "container_resource_limits": { + "key": "containerResourceLimits", + "type": "ContainerResourceSettings", + }, + "container_resource_requests": { + "key": "containerResourceRequests", + "type": "ContainerResourceSettings", + }, } def __init__( self, *, - container_resource_limits: Optional["ContainerResourceSettings"] = None, - container_resource_requests: Optional["ContainerResourceSettings"] = None, + container_resource_limits: Optional[ + "ContainerResourceSettings" + ] = None, + container_resource_requests: Optional[ + "ContainerResourceSettings" + ] = None, **kwargs ): """ @@ -8209,9 +8748,9 @@ class ContainerResourceSettings(msrest.serialization.Model): """ _attribute_map = { - 'cpu': {'key': 'cpu', 'type': 'str'}, - 'gpu': {'key': 'gpu', 'type': 'str'}, - 'memory': {'key': 'memory', 'type': 'str'}, + "cpu": {"key": "cpu", "type": "str"}, + "gpu": {"key": "gpu", "type": "str"}, + "memory": {"key": "memory", "type": "str"}, } def __init__( @@ -8247,14 +8786,14 @@ class CosmosDbSettings(msrest.serialization.Model): """ _attribute_map = { - 'collections_throughput': {'key': 'collectionsThroughput', 'type': 'int'}, + "collections_throughput": { + "key": "collectionsThroughput", + "type": "int", + }, } def __init__( - self, - *, - collections_throughput: Optional[int] = None, - **kwargs + self, *, collections_throughput: Optional[int] = None, **kwargs ): """ :keyword collections_throughput: The throughput of the collections in cosmosdb database. @@ -8279,23 +8818,24 @@ class ScheduleActionBase(msrest.serialization.Model): """ _validation = { - 'action_type': {'required': True}, + "action_type": {"required": True}, } _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, + "action_type": {"key": "actionType", "type": "str"}, } _subtype_map = { - 'action_type': {'CreateJob': 'JobScheduleAction', 'CreateMonitor': 'CreateMonitorAction', 'ImportData': 'ImportDataAction', 'InvokeBatchEndpoint': 'EndpointScheduleAction'} + "action_type": { + "CreateJob": "JobScheduleAction", + "CreateMonitor": "CreateMonitorAction", + "ImportData": "ImportDataAction", + "InvokeBatchEndpoint": "EndpointScheduleAction", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ScheduleActionBase, self).__init__(**kwargs) self.action_type = None # type: Optional[str] @@ -8314,27 +8854,25 @@ class CreateMonitorAction(ScheduleActionBase): """ _validation = { - 'action_type': {'required': True}, - 'monitor_definition': {'required': True}, + "action_type": {"required": True}, + "monitor_definition": {"required": True}, } _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'monitor_definition': {'key': 'monitorDefinition', 'type': 'MonitorDefinition'}, + "action_type": {"key": "actionType", "type": "str"}, + "monitor_definition": { + "key": "monitorDefinition", + "type": "MonitorDefinition", + }, } - def __init__( - self, - *, - monitor_definition: "MonitorDefinition", - **kwargs - ): + def __init__(self, *, monitor_definition: "MonitorDefinition", **kwargs): """ :keyword monitor_definition: Required. [Required] Defines the monitor. :paramtype monitor_definition: ~azure.mgmt.machinelearningservices.models.MonitorDefinition """ super(CreateMonitorAction, self).__init__(**kwargs) - self.action_type = 'CreateMonitor' # type: str + self.action_type = "CreateMonitor" # type: str self.monitor_definition = monitor_definition @@ -8353,9 +8891,9 @@ class Cron(msrest.serialization.Model): """ _attribute_map = { - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, + "start_time": {"key": "startTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "expression": {"key": "expression", "type": "str"}, } def __init__( @@ -8409,18 +8947,21 @@ class TriggerBase(msrest.serialization.Model): """ _validation = { - 'trigger_type': {'required': True}, + "trigger_type": {"required": True}, } _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, + "end_time": {"key": "endTime", "type": "str"}, + "start_time": {"key": "startTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "trigger_type": {"key": "triggerType", "type": "str"}, } _subtype_map = { - 'trigger_type': {'Cron': 'CronTrigger', 'Recurrence': 'RecurrenceTrigger'} + "trigger_type": { + "Cron": "CronTrigger", + "Recurrence": "RecurrenceTrigger", + } } def __init__( @@ -8478,16 +9019,20 @@ class CronTrigger(TriggerBase): """ _validation = { - 'trigger_type': {'required': True}, - 'expression': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "trigger_type": {"required": True}, + "expression": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'expression': {'key': 'expression', 'type': 'str'}, + "end_time": {"key": "endTime", "type": "str"}, + "start_time": {"key": "startTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "trigger_type": {"key": "triggerType", "type": "str"}, + "expression": {"key": "expression", "type": "str"}, } def __init__( @@ -8516,8 +9061,13 @@ def __init__( The expression should follow NCronTab format. :paramtype expression: str """ - super(CronTrigger, self).__init__(end_time=end_time, start_time=start_time, time_zone=time_zone, **kwargs) - self.trigger_type = 'Cron' # type: str + super(CronTrigger, self).__init__( + end_time=end_time, + start_time=start_time, + time_zone=time_zone, + **kwargs + ) + self.trigger_type = "Cron" # type: str self.expression = expression @@ -8546,33 +9096,29 @@ class CsvExportSummary(ExportSummary): """ _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'container_name': {'readonly': True}, - 'snapshot_path': {'readonly': True}, + "end_date_time": {"readonly": True}, + "exported_row_count": {"readonly": True}, + "format": {"required": True}, + "labeling_job_id": {"readonly": True}, + "start_date_time": {"readonly": True}, + "container_name": {"readonly": True}, + "snapshot_path": {"readonly": True}, } _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'snapshot_path': {'key': 'snapshotPath', 'type': 'str'}, + "end_date_time": {"key": "endDateTime", "type": "iso-8601"}, + "exported_row_count": {"key": "exportedRowCount", "type": "long"}, + "format": {"key": "format", "type": "str"}, + "labeling_job_id": {"key": "labelingJobId", "type": "str"}, + "start_date_time": {"key": "startDateTime", "type": "iso-8601"}, + "container_name": {"key": "containerName", "type": "str"}, + "snapshot_path": {"key": "snapshotPath", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(CsvExportSummary, self).__init__(**kwargs) - self.format = 'CSV' # type: str + self.format = "CSV" # type: str self.container_name = None self.snapshot_path = None @@ -8590,27 +9136,22 @@ class CustomForecastHorizon(ForecastHorizon): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - *, - value: int, - **kwargs - ): + def __init__(self, *, value: int, **kwargs): """ :keyword value: Required. [Required] Forecast horizon value. :paramtype value: int """ super(CustomForecastHorizon, self).__init__(**kwargs) - self.mode = 'Custom' # type: str + self.mode = "Custom" # type: str self.value = value @@ -8628,18 +9169,23 @@ class CustomInferencingServer(InferencingServer): """ _validation = { - 'server_type': {'required': True}, + "server_type": {"required": True}, } _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'inference_configuration': {'key': 'inferenceConfiguration', 'type': 'OnlineInferenceConfiguration'}, + "server_type": {"key": "serverType", "type": "str"}, + "inference_configuration": { + "key": "inferenceConfiguration", + "type": "OnlineInferenceConfiguration", + }, } def __init__( self, *, - inference_configuration: Optional["OnlineInferenceConfiguration"] = None, + inference_configuration: Optional[ + "OnlineInferenceConfiguration" + ] = None, **kwargs ): """ @@ -8648,7 +9194,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration """ super(CustomInferencingServer, self).__init__(**kwargs) - self.server_type = 'Custom' # type: str + self.server_type = "Custom" # type: str self.inference_configuration = inference_configuration @@ -8665,12 +9211,16 @@ class CustomMetricThreshold(msrest.serialization.Model): """ _validation = { - 'metric': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "metric": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'metric': {'key': 'metric', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, + "metric": {"key": "metric", "type": "str"}, + "threshold": {"key": "threshold", "type": "MonitoringThreshold"}, } def __init__( @@ -8709,24 +9259,27 @@ class JobInput(msrest.serialization.Model): """ _validation = { - 'job_input_type': {'required': True}, + "job_input_type": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } _subtype_map = { - 'job_input_type': {'custom_model': 'CustomModelJobInput', 'literal': 'LiteralJobInput', 'mlflow_model': 'MLFlowModelJobInput', 'mltable': 'MLTableJobInput', 'triton_model': 'TritonModelJobInput', 'uri_file': 'UriFileJobInput', 'uri_folder': 'UriFolderJobInput'} + "job_input_type": { + "custom_model": "CustomModelJobInput", + "literal": "LiteralJobInput", + "mlflow_model": "MLFlowModelJobInput", + "mltable": "MLTableJobInput", + "triton_model": "TritonModelJobInput", + "uri_file": "UriFileJobInput", + "uri_folder": "UriFolderJobInput", + } } - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): + def __init__(self, *, description: Optional[str] = None, **kwargs): """ :keyword description: Description for the input. :paramtype description: str @@ -8755,15 +9308,15 @@ class CustomModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "min_length": 1, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -8783,10 +9336,12 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(CustomModelJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(CustomModelJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'custom_model' # type: str + self.job_input_type = "custom_model" # type: str self.description = description @@ -8807,24 +9362,26 @@ class JobOutput(msrest.serialization.Model): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } _subtype_map = { - 'job_output_type': {'custom_model': 'CustomModelJobOutput', 'mlflow_model': 'MLFlowModelJobOutput', 'mltable': 'MLTableJobOutput', 'triton_model': 'TritonModelJobOutput', 'uri_file': 'UriFileJobOutput', 'uri_folder': 'UriFolderJobOutput'} + "job_output_type": { + "custom_model": "CustomModelJobOutput", + "mlflow_model": "MLFlowModelJobOutput", + "mltable": "MLTableJobOutput", + "triton_model": "TritonModelJobOutput", + "uri_file": "UriFileJobOutput", + "uri_folder": "UriFolderJobOutput", + } } - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): + def __init__(self, *, description: Optional[str] = None, **kwargs): """ :keyword description: Description for the output. :paramtype description: str @@ -8859,17 +9416,20 @@ class CustomModelJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "asset_name": {"key": "assetName", "type": "str"}, + "asset_version": {"key": "assetVersion", "type": "str"}, + "auto_delete_setting": { + "key": "autoDeleteSetting", + "type": "AutoDeleteSetting", + }, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -8898,13 +9458,21 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(CustomModelJobOutput, self).__init__(description=description, asset_name=asset_name, asset_version=asset_version, auto_delete_setting=auto_delete_setting, mode=mode, uri=uri, **kwargs) + super(CustomModelJobOutput, self).__init__( + description=description, + asset_name=asset_name, + asset_version=asset_version, + auto_delete_setting=auto_delete_setting, + mode=mode, + uri=uri, + **kwargs + ) self.asset_name = asset_name self.asset_version = asset_version self.auto_delete_setting = auto_delete_setting self.mode = mode self.uri = uri - self.job_output_type = 'custom_model' # type: str + self.job_output_type = "custom_model" # type: str self.description = description @@ -8929,17 +9497,24 @@ class MonitoringSignalBase(msrest.serialization.Model): """ _validation = { - 'signal_type': {'required': True}, + "signal_type": {"required": True}, } _attribute_map = { - 'lookback_period': {'key': 'lookbackPeriod', 'type': 'duration'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, + "lookback_period": {"key": "lookbackPeriod", "type": "duration"}, + "mode": {"key": "mode", "type": "str"}, + "signal_type": {"key": "signalType", "type": "str"}, } _subtype_map = { - 'signal_type': {'Custom': 'CustomMonitoringSignal', 'DataDrift': 'DataDriftMonitoringSignal', 'DataQuality': 'DataQualityMonitoringSignal', 'FeatureAttributionDrift': 'FeatureAttributionDriftMonitoringSignal', 'ModelPerformanceSignalBase': 'ModelPerformanceSignalBase', 'PredictionDrift': 'PredictionDriftMonitoringSignal'} + "signal_type": { + "Custom": "CustomMonitoringSignal", + "DataDrift": "DataDriftMonitoringSignal", + "DataQuality": "DataQualityMonitoringSignal", + "FeatureAttributionDrift": "FeatureAttributionDriftMonitoringSignal", + "ModelPerformanceSignalBase": "ModelPerformanceSignalBase", + "PredictionDrift": "PredictionDriftMonitoringSignal", + } } def __init__( @@ -8992,18 +9567,28 @@ class CustomMonitoringSignal(MonitoringSignalBase): """ _validation = { - 'signal_type': {'required': True}, - 'component_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'metric_thresholds': {'required': True}, + "signal_type": {"required": True}, + "component_id": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "metric_thresholds": {"required": True}, } _attribute_map = { - 'lookback_period': {'key': 'lookbackPeriod', 'type': 'duration'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'input_assets': {'key': 'inputAssets', 'type': '{MonitoringInputData}'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[CustomMetricThreshold]'}, + "lookback_period": {"key": "lookbackPeriod", "type": "duration"}, + "mode": {"key": "mode", "type": "str"}, + "signal_type": {"key": "signalType", "type": "str"}, + "component_id": {"key": "componentId", "type": "str"}, + "input_assets": { + "key": "inputAssets", + "type": "{MonitoringInputData}", + }, + "metric_thresholds": { + "key": "metricThresholds", + "type": "[CustomMetricThreshold]", + }, } def __init__( @@ -9035,8 +9620,10 @@ def __init__( :paramtype metric_thresholds: list[~azure.mgmt.machinelearningservices.models.CustomMetricThreshold] """ - super(CustomMonitoringSignal, self).__init__(lookback_period=lookback_period, mode=mode, **kwargs) - self.signal_type = 'Custom' # type: str + super(CustomMonitoringSignal, self).__init__( + lookback_period=lookback_period, mode=mode, **kwargs + ) + self.signal_type = "Custom" # type: str self.component_id = component_id self.input_assets = input_assets self.metric_thresholds = metric_thresholds @@ -9055,27 +9642,22 @@ class CustomNCrossValidations(NCrossValidations): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - *, - value: int, - **kwargs - ): + def __init__(self, *, value: int, **kwargs): """ :keyword value: Required. [Required] N-Cross validations value. :paramtype value: int """ super(CustomNCrossValidations, self).__init__(**kwargs) - self.mode = 'Custom' # type: str + self.mode = "Custom" # type: str self.value = value @@ -9092,27 +9674,22 @@ class CustomSeasonality(Seasonality): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - *, - value: int, - **kwargs - ): + def __init__(self, *, value: int, **kwargs): """ :keyword value: Required. [Required] Seasonality value. :paramtype value: int """ super(CustomSeasonality, self).__init__(**kwargs) - self.mode = 'Custom' # type: str + self.mode = "Custom" # type: str self.value = value @@ -9138,13 +9715,16 @@ class CustomService(msrest.serialization.Model): """ _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'name': {'key': 'name', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'Image'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{EnvironmentVariable}'}, - 'docker': {'key': 'docker', 'type': 'Docker'}, - 'endpoints': {'key': 'endpoints', 'type': '[Endpoint]'}, - 'volumes': {'key': 'volumes', 'type': '[VolumeDefinition]'}, + "additional_properties": {"key": "", "type": "{object}"}, + "name": {"key": "name", "type": "str"}, + "image": {"key": "image", "type": "Image"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{EnvironmentVariable}", + }, + "docker": {"key": "docker", "type": "Docker"}, + "endpoints": {"key": "endpoints", "type": "[Endpoint]"}, + "volumes": {"key": "volumes", "type": "[VolumeDefinition]"}, } def __init__( @@ -9153,7 +9733,9 @@ def __init__( additional_properties: Optional[Dict[str, Any]] = None, name: Optional[str] = None, image: Optional["Image"] = None, - environment_variables: Optional[Dict[str, "EnvironmentVariable"]] = None, + environment_variables: Optional[ + Dict[str, "EnvironmentVariable"] + ] = None, docker: Optional["Docker"] = None, endpoints: Optional[List["Endpoint"]] = None, volumes: Optional[List["VolumeDefinition"]] = None, @@ -9200,27 +9782,22 @@ class CustomTargetLags(TargetLags): """ _validation = { - 'mode': {'required': True}, - 'values': {'required': True}, + "mode": {"required": True}, + "values": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[int]'}, + "mode": {"key": "mode", "type": "str"}, + "values": {"key": "values", "type": "[int]"}, } - def __init__( - self, - *, - values: List[int], - **kwargs - ): + def __init__(self, *, values: List[int], **kwargs): """ :keyword values: Required. [Required] Set target lags values. :paramtype values: list[int] """ super(CustomTargetLags, self).__init__(**kwargs) - self.mode = 'Custom' # type: str + self.mode = "Custom" # type: str self.values = values @@ -9237,27 +9814,22 @@ class CustomTargetRollingWindowSize(TargetRollingWindowSize): """ _validation = { - 'mode': {'required': True}, - 'value': {'required': True}, + "mode": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'int'}, + "mode": {"key": "mode", "type": "str"}, + "value": {"key": "value", "type": "int"}, } - def __init__( - self, - *, - value: int, - **kwargs - ): + def __init__(self, *, value: int, **kwargs): """ :keyword value: Required. [Required] TargetRollingWindowSize value. :paramtype value: int """ super(CustomTargetRollingWindowSize, self).__init__(**kwargs) - self.mode = 'Custom' # type: str + self.mode = "Custom" # type: str self.value = value @@ -9277,24 +9849,22 @@ class DataImportSource(msrest.serialization.Model): """ _validation = { - 'source_type': {'required': True}, + "source_type": {"required": True}, } _attribute_map = { - 'connection': {'key': 'connection', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, + "connection": {"key": "connection", "type": "str"}, + "source_type": {"key": "sourceType", "type": "str"}, } _subtype_map = { - 'source_type': {'database': 'DatabaseSource', 'file_system': 'FileSystemSource'} + "source_type": { + "database": "DatabaseSource", + "file_system": "FileSystemSource", + } } - def __init__( - self, - *, - connection: Optional[str] = None, - **kwargs - ): + def __init__(self, *, connection: Optional[str] = None, **kwargs): """ :keyword connection: Workspace connection for data import source storage. :paramtype connection: str @@ -9325,16 +9895,19 @@ class DatabaseSource(DataImportSource): """ _validation = { - 'source_type': {'required': True}, + "source_type": {"required": True}, } _attribute_map = { - 'connection': {'key': 'connection', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'query': {'key': 'query', 'type': 'str'}, - 'stored_procedure': {'key': 'storedProcedure', 'type': 'str'}, - 'stored_procedure_params': {'key': 'storedProcedureParams', 'type': '[{str}]'}, - 'table_name': {'key': 'tableName', 'type': 'str'}, + "connection": {"key": "connection", "type": "str"}, + "source_type": {"key": "sourceType", "type": "str"}, + "query": {"key": "query", "type": "str"}, + "stored_procedure": {"key": "storedProcedure", "type": "str"}, + "stored_procedure_params": { + "key": "storedProcedureParams", + "type": "[{str}]", + }, + "table_name": {"key": "tableName", "type": "str"}, } def __init__( @@ -9360,7 +9933,7 @@ def __init__( :paramtype table_name: str """ super(DatabaseSource, self).__init__(connection=connection, **kwargs) - self.source_type = 'database' # type: str + self.source_type = "database" # type: str self.query = query self.stored_procedure = stored_procedure self.stored_procedure_params = stored_procedure_params @@ -9375,14 +9948,11 @@ class DatabricksSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, + "properties": {"key": "properties", "type": "DatabricksProperties"}, } def __init__( - self, - *, - properties: Optional["DatabricksProperties"] = None, - **kwargs + self, *, properties: Optional["DatabricksProperties"] = None, **kwargs ): """ :keyword properties: Properties of Databricks. @@ -9431,26 +10001,29 @@ class Databricks(Compute, DatabricksSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "DatabricksProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -9476,9 +10049,16 @@ def __init__( MSI and AAD exclusively for authentication. :paramtype disable_local_auth: bool """ - super(Databricks, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) + super(Databricks, self).__init__( + compute_location=compute_location, + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'Databricks' # type: str + self.compute_type = "Databricks" # type: str self.compute_location = compute_location self.provisioning_state = None self.description = description @@ -9498,14 +10078,14 @@ class DatabricksComputeSecretsProperties(msrest.serialization.Model): """ _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, } def __init__( - self, - *, - databricks_access_token: Optional[str] = None, - **kwargs + self, *, databricks_access_token: Optional[str] = None, **kwargs ): """ :keyword databricks_access_token: access token for databricks account. @@ -9515,7 +10095,9 @@ def __init__( self.databricks_access_token = databricks_access_token -class DatabricksComputeSecrets(ComputeSecrets, DatabricksComputeSecretsProperties): +class DatabricksComputeSecrets( + ComputeSecrets, DatabricksComputeSecretsProperties +): """Secrets related to a Machine Learning compute based on Databricks. All required parameters must be populated in order to send to Azure. @@ -9529,27 +10111,29 @@ class DatabricksComputeSecrets(ComputeSecrets, DatabricksComputeSecretsPropertie """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, + "compute_type": {"key": "computeType", "type": "str"}, } def __init__( - self, - *, - databricks_access_token: Optional[str] = None, - **kwargs + self, *, databricks_access_token: Optional[str] = None, **kwargs ): """ :keyword databricks_access_token: access token for databricks account. :paramtype databricks_access_token: str """ - super(DatabricksComputeSecrets, self).__init__(databricks_access_token=databricks_access_token, **kwargs) + super(DatabricksComputeSecrets, self).__init__( + databricks_access_token=databricks_access_token, **kwargs + ) self.databricks_access_token = databricks_access_token - self.compute_type = 'Databricks' # type: str + self.compute_type = "Databricks" # type: str class DatabricksProperties(msrest.serialization.Model): @@ -9562,8 +10146,11 @@ class DatabricksProperties(msrest.serialization.Model): """ _attribute_map = { - 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, - 'workspace_url': {'key': 'workspaceUrl', 'type': 'str'}, + "databricks_access_token": { + "key": "databricksAccessToken", + "type": "str", + }, + "workspace_url": {"key": "workspaceUrl", "type": "str"}, } def __init__( @@ -9608,13 +10195,13 @@ class DataCollector(msrest.serialization.Model): """ _validation = { - 'collections': {'required': True}, + "collections": {"required": True}, } _attribute_map = { - 'collections': {'key': 'collections', 'type': '{Collection}'}, - 'request_logging': {'key': 'requestLogging', 'type': 'RequestLogging'}, - 'rolling_rate': {'key': 'rollingRate', 'type': 'str'}, + "collections": {"key": "collections", "type": "{Collection}"}, + "request_logging": {"key": "requestLogging", "type": "RequestLogging"}, + "rolling_rate": {"key": "rollingRate", "type": "str"}, } def __init__( @@ -9672,27 +10259,22 @@ class DataContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "DataContainerProperties"}, } - def __init__( - self, - *, - properties: "DataContainerProperties", - **kwargs - ): + def __init__(self, *, properties: "DataContainerProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataContainerProperties @@ -9726,19 +10308,19 @@ class DataContainerProperties(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'data_type': {'required': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "data_type": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "data_type": {"key": "dataType", "type": "str"}, } def __init__( @@ -9764,7 +10346,13 @@ def __init__( "uri_file", "uri_folder", "mltable". :paramtype data_type: str or ~azure.mgmt.machinelearningservices.models.DataType """ - super(DataContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) + super(DataContainerProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs + ) self.data_type = data_type @@ -9779,8 +10367,8 @@ class DataContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[DataContainer]"}, } def __init__( @@ -9832,21 +10420,30 @@ class DataDriftMonitoringSignal(MonitoringSignalBase): """ _validation = { - 'signal_type': {'required': True}, - 'baseline_data': {'required': True}, - 'metric_thresholds': {'required': True}, - 'target_data': {'required': True}, + "signal_type": {"required": True}, + "baseline_data": {"required": True}, + "metric_thresholds": {"required": True}, + "target_data": {"required": True}, } _attribute_map = { - 'lookback_period': {'key': 'lookbackPeriod', 'type': 'duration'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'baseline_data': {'key': 'baselineData', 'type': 'MonitoringInputData'}, - 'data_segment': {'key': 'dataSegment', 'type': 'MonitoringDataSegment'}, - 'features': {'key': 'features', 'type': 'MonitoringFeatureFilterBase'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[DataDriftMetricThresholdBase]'}, - 'target_data': {'key': 'targetData', 'type': 'MonitoringInputData'}, + "lookback_period": {"key": "lookbackPeriod", "type": "duration"}, + "mode": {"key": "mode", "type": "str"}, + "signal_type": {"key": "signalType", "type": "str"}, + "baseline_data": { + "key": "baselineData", + "type": "MonitoringInputData", + }, + "data_segment": { + "key": "dataSegment", + "type": "MonitoringDataSegment", + }, + "features": {"key": "features", "type": "MonitoringFeatureFilterBase"}, + "metric_thresholds": { + "key": "metricThresholds", + "type": "[DataDriftMetricThresholdBase]", + }, + "target_data": {"key": "targetData", "type": "MonitoringInputData"}, } def __init__( @@ -9881,8 +10478,10 @@ def __init__( :keyword target_data: Required. [Required] The data which drift will be calculated for. :paramtype target_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData """ - super(DataDriftMonitoringSignal, self).__init__(lookback_period=lookback_period, mode=mode, **kwargs) - self.signal_type = 'DataDrift' # type: str + super(DataDriftMonitoringSignal, self).__init__( + lookback_period=lookback_period, mode=mode, **kwargs + ) + self.signal_type = "DataDrift" # type: str self.baseline_data = baseline_data self.data_segment = data_segment self.features = features @@ -9927,25 +10526,28 @@ class DataFactory(Compute): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -9968,8 +10570,14 @@ def __init__( MSI and AAD exclusively for authentication. :paramtype disable_local_auth: bool """ - super(DataFactory, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, **kwargs) - self.compute_type = 'DataFactory' # type: str + super(DataFactory, self).__init__( + compute_location=compute_location, + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + **kwargs + ) + self.compute_type = "DataFactory" # type: str class DataVersionBaseProperties(AssetBase): @@ -10008,25 +10616,39 @@ class DataVersionBaseProperties(AssetBase): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "auto_delete_setting": { + "key": "autoDeleteSetting", + "type": "AutoDeleteSetting", + }, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, + "intellectual_property": { + "key": "intellectualProperty", + "type": "IntellectualProperty", + }, + "stage": {"key": "stage", "type": "str"}, } _subtype_map = { - 'data_type': {'mltable': 'MLTableData', 'uri_file': 'UriFileDataVersion', 'uri_folder': 'UriFolderDataVersion'} + "data_type": { + "mltable": "MLTableData", + "uri_file": "UriFileDataVersion", + "uri_folder": "UriFolderDataVersion", + } } def __init__( @@ -10068,8 +10690,16 @@ def __init__( :keyword stage: Stage in the data lifecycle assigned to this data asset. :paramtype stage: str """ - super(DataVersionBaseProperties, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) - self.data_type = 'DataVersionBaseProperties' # type: str + super(DataVersionBaseProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + auto_delete_setting=auto_delete_setting, + is_anonymous=is_anonymous, + is_archived=is_archived, + **kwargs + ) + self.data_type = "DataVersionBaseProperties" # type: str self.data_uri = data_uri self.intellectual_property = intellectual_property self.stage = stage @@ -10112,23 +10742,33 @@ class DataImport(DataVersionBaseProperties): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'DataImportSource'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "auto_delete_setting": { + "key": "autoDeleteSetting", + "type": "AutoDeleteSetting", + }, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, + "intellectual_property": { + "key": "intellectualProperty", + "type": "IntellectualProperty", + }, + "stage": {"key": "stage", "type": "str"}, + "asset_name": {"key": "assetName", "type": "str"}, + "source": {"key": "source", "type": "DataImportSource"}, } def __init__( @@ -10176,8 +10816,19 @@ def __init__( :keyword source: Source data of the asset to import from. :paramtype source: ~azure.mgmt.machinelearningservices.models.DataImportSource """ - super(DataImport, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, intellectual_property=intellectual_property, stage=stage, **kwargs) - self.data_type = 'uri_folder' # type: str + super(DataImport, self).__init__( + description=description, + properties=properties, + tags=tags, + auto_delete_setting=auto_delete_setting, + is_anonymous=is_anonymous, + is_archived=is_archived, + data_uri=data_uri, + intellectual_property=intellectual_property, + stage=stage, + **kwargs + ) + self.data_type = "uri_folder" # type: str self.asset_name = asset_name self.source = source @@ -10191,7 +10842,10 @@ class DataLakeAnalyticsSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, + "properties": { + "key": "properties", + "type": "DataLakeAnalyticsSchemaProperties", + }, } def __init__( @@ -10249,26 +10903,32 @@ class DataLakeAnalytics(Compute, DataLakeAnalyticsSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": { + "key": "properties", + "type": "DataLakeAnalyticsSchemaProperties", + }, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -10295,9 +10955,16 @@ def __init__( MSI and AAD exclusively for authentication. :paramtype disable_local_auth: bool """ - super(DataLakeAnalytics, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) + super(DataLakeAnalytics, self).__init__( + compute_location=compute_location, + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'DataLakeAnalytics' # type: str + self.compute_type = "DataLakeAnalytics" # type: str self.compute_location = compute_location self.provisioning_state = None self.description = description @@ -10317,14 +10984,14 @@ class DataLakeAnalyticsSchemaProperties(msrest.serialization.Model): """ _attribute_map = { - 'data_lake_store_account_name': {'key': 'dataLakeStoreAccountName', 'type': 'str'}, + "data_lake_store_account_name": { + "key": "dataLakeStoreAccountName", + "type": "str", + }, } def __init__( - self, - *, - data_lake_store_account_name: Optional[str] = None, - **kwargs + self, *, data_lake_store_account_name: Optional[str] = None, **kwargs ): """ :keyword data_lake_store_account_name: DataLake Store Account Name. @@ -10349,13 +11016,13 @@ class DataPathAssetReference(AssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'datastore_id': {'key': 'datastoreId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "datastore_id": {"key": "datastoreId", "type": "str"}, + "path": {"key": "path", "type": "str"}, } def __init__( @@ -10372,7 +11039,7 @@ def __init__( :paramtype path: str """ super(DataPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'DataPath' # type: str + self.reference_type = "DataPath" # type: str self.datastore_id = datastore_id self.path = path @@ -10406,20 +11073,26 @@ class DataQualityMonitoringSignal(MonitoringSignalBase): """ _validation = { - 'signal_type': {'required': True}, - 'baseline_data': {'required': True}, - 'metric_thresholds': {'required': True}, - 'target_data': {'required': True}, + "signal_type": {"required": True}, + "baseline_data": {"required": True}, + "metric_thresholds": {"required": True}, + "target_data": {"required": True}, } _attribute_map = { - 'lookback_period': {'key': 'lookbackPeriod', 'type': 'duration'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'baseline_data': {'key': 'baselineData', 'type': 'MonitoringInputData'}, - 'features': {'key': 'features', 'type': 'MonitoringFeatureFilterBase'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[DataQualityMetricThresholdBase]'}, - 'target_data': {'key': 'targetData', 'type': 'MonitoringInputData'}, + "lookback_period": {"key": "lookbackPeriod", "type": "duration"}, + "mode": {"key": "mode", "type": "str"}, + "signal_type": {"key": "signalType", "type": "str"}, + "baseline_data": { + "key": "baselineData", + "type": "MonitoringInputData", + }, + "features": {"key": "features", "type": "MonitoringFeatureFilterBase"}, + "metric_thresholds": { + "key": "metricThresholds", + "type": "[DataQualityMetricThresholdBase]", + }, + "target_data": {"key": "targetData", "type": "MonitoringInputData"}, } def __init__( @@ -10452,8 +11125,10 @@ def __init__( drift will be calculated for. :paramtype target_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData """ - super(DataQualityMonitoringSignal, self).__init__(lookback_period=lookback_period, mode=mode, **kwargs) - self.signal_type = 'DataQuality' # type: str + super(DataQualityMonitoringSignal, self).__init__( + lookback_period=lookback_period, mode=mode, **kwargs + ) + self.signal_type = "DataQuality" # type: str self.baseline_data = baseline_data self.features = features self.metric_thresholds = metric_thresholds @@ -10483,31 +11158,27 @@ class DatasetExportSummary(ExportSummary): """ _validation = { - 'end_date_time': {'readonly': True}, - 'exported_row_count': {'readonly': True}, - 'format': {'required': True}, - 'labeling_job_id': {'readonly': True}, - 'start_date_time': {'readonly': True}, - 'labeled_asset_name': {'readonly': True}, + "end_date_time": {"readonly": True}, + "exported_row_count": {"readonly": True}, + "format": {"required": True}, + "labeling_job_id": {"readonly": True}, + "start_date_time": {"readonly": True}, + "labeled_asset_name": {"readonly": True}, } _attribute_map = { - 'end_date_time': {'key': 'endDateTime', 'type': 'iso-8601'}, - 'exported_row_count': {'key': 'exportedRowCount', 'type': 'long'}, - 'format': {'key': 'format', 'type': 'str'}, - 'labeling_job_id': {'key': 'labelingJobId', 'type': 'str'}, - 'start_date_time': {'key': 'startDateTime', 'type': 'iso-8601'}, - 'labeled_asset_name': {'key': 'labeledAssetName', 'type': 'str'}, + "end_date_time": {"key": "endDateTime", "type": "iso-8601"}, + "exported_row_count": {"key": "exportedRowCount", "type": "long"}, + "format": {"key": "format", "type": "str"}, + "labeling_job_id": {"key": "labelingJobId", "type": "str"}, + "start_date_time": {"key": "startDateTime", "type": "iso-8601"}, + "labeled_asset_name": {"key": "labeledAssetName", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DatasetExportSummary, self).__init__(**kwargs) - self.format = 'Dataset' # type: str + self.format = "Dataset" # type: str self.labeled_asset_name = None @@ -10534,27 +11205,22 @@ class Datastore(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DatastoreProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "DatastoreProperties"}, } - def __init__( - self, - *, - properties: "DatastoreProperties", - **kwargs - ): + def __init__(self, *, properties: "DatastoreProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DatastoreProperties @@ -10574,8 +11240,8 @@ class DatastoreResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Datastore]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[Datastore]"}, } def __init__( @@ -10620,27 +11286,25 @@ class DataVersionBase(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'DataVersionBaseProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "DataVersionBaseProperties", + }, } - def __init__( - self, - *, - properties: "DataVersionBaseProperties", - **kwargs - ): + def __init__(self, *, properties: "DataVersionBaseProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.DataVersionBaseProperties @@ -10660,8 +11324,8 @@ class DataVersionBaseResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[DataVersionBase]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[DataVersionBase]"}, } def __init__( @@ -10678,7 +11342,9 @@ def __init__( :keyword value: An array of objects of type DataVersionBase. :paramtype value: list[~azure.mgmt.machinelearningservices.models.DataVersionBase] """ - super(DataVersionBaseResourceArmPaginatedResult, self).__init__(**kwargs) + super(DataVersionBaseResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -10697,23 +11363,22 @@ class OnlineScaleSettings(msrest.serialization.Model): """ _validation = { - 'scale_type': {'required': True}, + "scale_type": {"required": True}, } _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, + "scale_type": {"key": "scaleType", "type": "str"}, } _subtype_map = { - 'scale_type': {'Default': 'DefaultScaleSettings', 'TargetUtilization': 'TargetUtilizationScaleSettings'} + "scale_type": { + "Default": "DefaultScaleSettings", + "TargetUtilization": "TargetUtilizationScaleSettings", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(OnlineScaleSettings, self).__init__(**kwargs) self.scale_type = None # type: Optional[str] @@ -10729,21 +11394,17 @@ class DefaultScaleSettings(OnlineScaleSettings): """ _validation = { - 'scale_type': {'required': True}, + "scale_type": {"required": True}, } _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, + "scale_type": {"key": "scaleType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DefaultScaleSettings, self).__init__(**kwargs) - self.scale_type = 'Default' # type: str + self.scale_type = "Default" # type: str class DeploymentLogs(msrest.serialization.Model): @@ -10754,15 +11415,10 @@ class DeploymentLogs(msrest.serialization.Model): """ _attribute_map = { - 'content': {'key': 'content', 'type': 'str'}, + "content": {"key": "content", "type": "str"}, } - def __init__( - self, - *, - content: Optional[str] = None, - **kwargs - ): + def __init__(self, *, content: Optional[str] = None, **kwargs): """ :keyword content: The retrieved online deployment logs. :paramtype content: str @@ -10782,8 +11438,8 @@ class DeploymentLogsRequest(msrest.serialization.Model): """ _attribute_map = { - 'container_type': {'key': 'containerType', 'type': 'str'}, - 'tail': {'key': 'tail', 'type': 'int'}, + "container_type": {"key": "containerType", "type": "str"}, + "tail": {"key": "tail", "type": "int"}, } def __init__( @@ -10823,11 +11479,11 @@ class ResourceConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'max_instance_count': {'key': 'maxInstanceCount', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{object}'}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "locations": {"key": "locations", "type": "[str]"}, + "max_instance_count": {"key": "maxInstanceCount", "type": "int"}, + "properties": {"key": "properties", "type": "{object}"}, } def __init__( @@ -10880,11 +11536,11 @@ class DeploymentResourceConfiguration(ResourceConfiguration): """ _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'max_instance_count': {'key': 'maxInstanceCount', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{object}'}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "locations": {"key": "locations", "type": "[str]"}, + "max_instance_count": {"key": "maxInstanceCount", "type": "int"}, + "properties": {"key": "properties", "type": "{object}"}, } def __init__( @@ -10911,7 +11567,14 @@ def __init__( :keyword properties: Additional properties bag. :paramtype properties: dict[str, any] """ - super(DeploymentResourceConfiguration, self).__init__(instance_count=instance_count, instance_type=instance_type, locations=locations, max_instance_count=max_instance_count, properties=properties, **kwargs) + super(DeploymentResourceConfiguration, self).__init__( + instance_count=instance_count, + instance_type=instance_type, + locations=locations, + max_instance_count=max_instance_count, + properties=properties, + **kwargs + ) class DiagnoseRequestProperties(msrest.serialization.Model): @@ -10938,15 +11601,18 @@ class DiagnoseRequestProperties(msrest.serialization.Model): """ _attribute_map = { - 'udr': {'key': 'udr', 'type': '{object}'}, - 'nsg': {'key': 'nsg', 'type': '{object}'}, - 'resource_lock': {'key': 'resourceLock', 'type': '{object}'}, - 'dns_resolution': {'key': 'dnsResolution', 'type': '{object}'}, - 'storage_account': {'key': 'storageAccount', 'type': '{object}'}, - 'key_vault': {'key': 'keyVault', 'type': '{object}'}, - 'container_registry': {'key': 'containerRegistry', 'type': '{object}'}, - 'application_insights': {'key': 'applicationInsights', 'type': '{object}'}, - 'others': {'key': 'others', 'type': '{object}'}, + "udr": {"key": "udr", "type": "{object}"}, + "nsg": {"key": "nsg", "type": "{object}"}, + "resource_lock": {"key": "resourceLock", "type": "{object}"}, + "dns_resolution": {"key": "dnsResolution", "type": "{object}"}, + "storage_account": {"key": "storageAccount", "type": "{object}"}, + "key_vault": {"key": "keyVault", "type": "{object}"}, + "container_registry": {"key": "containerRegistry", "type": "{object}"}, + "application_insights": { + "key": "applicationInsights", + "type": "{object}", + }, + "others": {"key": "others", "type": "{object}"}, } def __init__( @@ -11003,7 +11669,7 @@ class DiagnoseResponseResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseResponseResultValue'}, + "value": {"key": "value", "type": "DiagnoseResponseResultValue"}, } def __init__( @@ -11050,15 +11716,39 @@ class DiagnoseResponseResultValue(msrest.serialization.Model): """ _attribute_map = { - 'user_defined_route_results': {'key': 'userDefinedRouteResults', 'type': '[DiagnoseResult]'}, - 'network_security_rule_results': {'key': 'networkSecurityRuleResults', 'type': '[DiagnoseResult]'}, - 'resource_lock_results': {'key': 'resourceLockResults', 'type': '[DiagnoseResult]'}, - 'dns_resolution_results': {'key': 'dnsResolutionResults', 'type': '[DiagnoseResult]'}, - 'storage_account_results': {'key': 'storageAccountResults', 'type': '[DiagnoseResult]'}, - 'key_vault_results': {'key': 'keyVaultResults', 'type': '[DiagnoseResult]'}, - 'container_registry_results': {'key': 'containerRegistryResults', 'type': '[DiagnoseResult]'}, - 'application_insights_results': {'key': 'applicationInsightsResults', 'type': '[DiagnoseResult]'}, - 'other_results': {'key': 'otherResults', 'type': '[DiagnoseResult]'}, + "user_defined_route_results": { + "key": "userDefinedRouteResults", + "type": "[DiagnoseResult]", + }, + "network_security_rule_results": { + "key": "networkSecurityRuleResults", + "type": "[DiagnoseResult]", + }, + "resource_lock_results": { + "key": "resourceLockResults", + "type": "[DiagnoseResult]", + }, + "dns_resolution_results": { + "key": "dnsResolutionResults", + "type": "[DiagnoseResult]", + }, + "storage_account_results": { + "key": "storageAccountResults", + "type": "[DiagnoseResult]", + }, + "key_vault_results": { + "key": "keyVaultResults", + "type": "[DiagnoseResult]", + }, + "container_registry_results": { + "key": "containerRegistryResults", + "type": "[DiagnoseResult]", + }, + "application_insights_results": { + "key": "applicationInsightsResults", + "type": "[DiagnoseResult]", + }, + "other_results": {"key": "otherResults", "type": "[DiagnoseResult]"}, } def __init__( @@ -11129,23 +11819,19 @@ class DiagnoseResult(msrest.serialization.Model): """ _validation = { - 'code': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, + "code": {"readonly": True}, + "level": {"readonly": True}, + "message": {"readonly": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, + "code": {"key": "code", "type": "str"}, + "level": {"key": "level", "type": "str"}, + "message": {"key": "message", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DiagnoseResult, self).__init__(**kwargs) self.code = None self.level = None @@ -11160,14 +11846,11 @@ class DiagnoseWorkspaceParameters(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': 'DiagnoseRequestProperties'}, + "value": {"key": "value", "type": "DiagnoseRequestProperties"}, } def __init__( - self, - *, - value: Optional["DiagnoseRequestProperties"] = None, - **kwargs + self, *, value: Optional["DiagnoseRequestProperties"] = None, **kwargs ): """ :keyword value: Value of Parameters. @@ -11192,23 +11875,24 @@ class DistributionConfiguration(msrest.serialization.Model): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, + "distribution_type": {"key": "distributionType", "type": "str"}, } _subtype_map = { - 'distribution_type': {'Mpi': 'Mpi', 'PyTorch': 'PyTorch', 'Ray': 'Ray', 'TensorFlow': 'TensorFlow'} + "distribution_type": { + "Mpi": "Mpi", + "PyTorch": "PyTorch", + "Ray": "Ray", + "TensorFlow": "TensorFlow", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(DistributionConfiguration, self).__init__(**kwargs) self.distribution_type = None # type: Optional[str] @@ -11224,8 +11908,8 @@ class Docker(msrest.serialization.Model): """ _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'privileged': {'key': 'privileged', 'type': 'bool'}, + "additional_properties": {"key": "", "type": "{object}"}, + "privileged": {"key": "privileged", "type": "bool"}, } def __init__( @@ -11247,7 +11931,9 @@ def __init__( self.privileged = privileged -class EmailMonitoringAlertNotificationSettings(MonitoringAlertNotificationSettingsBase): +class EmailMonitoringAlertNotificationSettings( + MonitoringAlertNotificationSettingsBase +): """EmailMonitoringAlertNotificationSettings. All required parameters must be populated in order to send to Azure. @@ -11262,12 +11948,18 @@ class EmailMonitoringAlertNotificationSettings(MonitoringAlertNotificationSettin """ _validation = { - 'alert_notification_type': {'required': True}, + "alert_notification_type": {"required": True}, } _attribute_map = { - 'alert_notification_type': {'key': 'alertNotificationType', 'type': 'str'}, - 'email_notification_setting': {'key': 'emailNotificationSetting', 'type': 'NotificationSetting'}, + "alert_notification_type": { + "key": "alertNotificationType", + "type": "str", + }, + "email_notification_setting": { + "key": "emailNotificationSetting", + "type": "NotificationSetting", + }, } def __init__( @@ -11281,8 +11973,10 @@ def __init__( :paramtype email_notification_setting: ~azure.mgmt.machinelearningservices.models.NotificationSetting """ - super(EmailMonitoringAlertNotificationSettings, self).__init__(**kwargs) - self.alert_notification_type = 'Email' # type: str + super(EmailMonitoringAlertNotificationSettings, self).__init__( + **kwargs + ) + self.alert_notification_type = "Email" # type: str self.email_notification_setting = email_notification_setting @@ -11302,14 +11996,14 @@ class EncryptionKeyVaultProperties(msrest.serialization.Model): """ _validation = { - 'key_vault_arm_id': {'required': True}, - 'key_identifier': {'required': True}, + "key_vault_arm_id": {"required": True}, + "key_identifier": {"required": True}, } _attribute_map = { - 'key_vault_arm_id': {'key': 'keyVaultArmId', 'type': 'str'}, - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - 'identity_client_id': {'key': 'identityClientId', 'type': 'str'}, + "key_vault_arm_id": {"key": "keyVaultArmId", "type": "str"}, + "key_identifier": {"key": "keyIdentifier", "type": "str"}, + "identity_client_id": {"key": "identityClientId", "type": "str"}, } def __init__( @@ -11346,19 +12040,14 @@ class EncryptionKeyVaultUpdateProperties(msrest.serialization.Model): """ _validation = { - 'key_identifier': {'required': True}, + "key_identifier": {"required": True}, } _attribute_map = { - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, + "key_identifier": {"key": "keyIdentifier", "type": "str"}, } - def __init__( - self, - *, - key_identifier: str, - **kwargs - ): + def __init__(self, *, key_identifier: str, **kwargs): """ :keyword key_identifier: Required. Key Vault uri to access the encryption key. :paramtype key_identifier: str @@ -11383,14 +12072,17 @@ class EncryptionProperty(msrest.serialization.Model): """ _validation = { - 'status': {'required': True}, - 'key_vault_properties': {'required': True}, + "status": {"required": True}, + "key_vault_properties": {"required": True}, } _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityForCmk'}, - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'EncryptionKeyVaultProperties'}, + "status": {"key": "status", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityForCmk"}, + "key_vault_properties": { + "key": "keyVaultProperties", + "type": "EncryptionKeyVaultProperties", + }, } def __init__( @@ -11429,11 +12121,14 @@ class EncryptionUpdateProperties(msrest.serialization.Model): """ _validation = { - 'key_vault_properties': {'required': True}, + "key_vault_properties": {"required": True}, } _attribute_map = { - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'EncryptionKeyVaultUpdateProperties'}, + "key_vault_properties": { + "key": "keyVaultProperties", + "type": "EncryptionKeyVaultUpdateProperties", + }, } def __init__( @@ -11468,11 +12163,11 @@ class Endpoint(msrest.serialization.Model): """ _attribute_map = { - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'int'}, - 'published': {'key': 'published', 'type': 'int'}, - 'host_ip': {'key': 'hostIp', 'type': 'str'}, + "protocol": {"key": "protocol", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "target": {"key": "target", "type": "int"}, + "published": {"key": "published", "type": "int"}, + "host_ip": {"key": "hostIp", "type": "str"}, } def __init__( @@ -11516,8 +12211,8 @@ class EndpointAuthKeys(msrest.serialization.Model): """ _attribute_map = { - 'primary_key': {'key': 'primaryKey', 'type': 'str'}, - 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, + "primary_key": {"key": "primaryKey", "type": "str"}, + "secondary_key": {"key": "secondaryKey", "type": "str"}, } def __init__( @@ -11552,10 +12247,13 @@ class EndpointAuthToken(msrest.serialization.Model): """ _attribute_map = { - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'expiry_time_utc': {'key': 'expiryTimeUtc', 'type': 'long'}, - 'refresh_after_time_utc': {'key': 'refreshAfterTimeUtc', 'type': 'long'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, + "access_token": {"key": "accessToken", "type": "str"}, + "expiry_time_utc": {"key": "expiryTimeUtc", "type": "long"}, + "refresh_after_time_utc": { + "key": "refreshAfterTimeUtc", + "type": "long", + }, + "token_type": {"key": "tokenType", "type": "str"}, } def __init__( @@ -11595,42 +12293,40 @@ class EndpointScheduleAction(ScheduleActionBase): :vartype action_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleActionType :ivar endpoint_invocation_definition: Required. [Required] Defines Schedule action definition details. - - + + .. raw:: html - + . :vartype endpoint_invocation_definition: any """ _validation = { - 'action_type': {'required': True}, - 'endpoint_invocation_definition': {'required': True}, + "action_type": {"required": True}, + "endpoint_invocation_definition": {"required": True}, } _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'endpoint_invocation_definition': {'key': 'endpointInvocationDefinition', 'type': 'object'}, + "action_type": {"key": "actionType", "type": "str"}, + "endpoint_invocation_definition": { + "key": "endpointInvocationDefinition", + "type": "object", + }, } - def __init__( - self, - *, - endpoint_invocation_definition: Any, - **kwargs - ): + def __init__(self, *, endpoint_invocation_definition: Any, **kwargs): """ :keyword endpoint_invocation_definition: Required. [Required] Defines Schedule action definition details. - - + + .. raw:: html - + . :paramtype endpoint_invocation_definition: any """ super(EndpointScheduleAction, self).__init__(**kwargs) - self.action_type = 'InvokeBatchEndpoint' # type: str + self.action_type = "InvokeBatchEndpoint" # type: str self.endpoint_invocation_definition = endpoint_invocation_definition @@ -11657,26 +12353,26 @@ class EnvironmentContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "EnvironmentContainerProperties", + }, } def __init__( - self, - *, - properties: "EnvironmentContainerProperties", - **kwargs + self, *, properties: "EnvironmentContainerProperties", **kwargs ): """ :keyword properties: Required. [Required] Additional attributes of the entity. @@ -11711,19 +12407,19 @@ class EnvironmentContainerProperties(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } def __init__( @@ -11745,11 +12441,19 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(EnvironmentContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) + super(EnvironmentContainerProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs + ) self.provisioning_state = None -class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model): +class EnvironmentContainerResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of EnvironmentContainer entities. :ivar next_link: The link to the next page of EnvironmentContainer objects. If null, there are @@ -11760,8 +12464,8 @@ class EnvironmentContainerResourceArmPaginatedResult(msrest.serialization.Model) """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[EnvironmentContainer]"}, } def __init__( @@ -11778,7 +12482,9 @@ def __init__( :keyword value: An array of objects of type EnvironmentContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] """ - super(EnvironmentContainerResourceArmPaginatedResult, self).__init__(**kwargs) + super(EnvironmentContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -11797,9 +12503,9 @@ class EnvironmentVariable(msrest.serialization.Model): """ _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "additional_properties": {"key": "", "type": "{object}"}, + "type": {"key": "type", "type": "str"}, + "value": {"key": "value", "type": "str"}, } def __init__( @@ -11849,26 +12555,26 @@ class EnvironmentVersion(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'EnvironmentVersionProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "EnvironmentVersionProperties", + }, } def __init__( - self, - *, - properties: "EnvironmentVersionProperties", - **kwargs + self, *, properties: "EnvironmentVersionProperties", **kwargs ): """ :keyword properties: Required. [Required] Additional attributes of the entity. @@ -11904,29 +12610,29 @@ class EnvironmentVersionProperties(AssetBase): :vartype build: ~azure.mgmt.machinelearningservices.models.BuildContext :ivar conda_file: Standard configuration file used by Conda that lets you install any kind of package, including Python, R, and C/C++ packages. - - + + .. raw:: html - + . :vartype conda_file: str :ivar environment_type: Environment type is either user managed or curated by the Azure ML service - - + + .. raw:: html - + . Possible values include: "Curated", "UserCreated". :vartype environment_type: str or ~azure.mgmt.machinelearningservices.models.EnvironmentType :ivar image: Name of the image that will be used for the environment. - - + + .. raw:: html - + . @@ -11948,27 +12654,36 @@ class EnvironmentVersionProperties(AssetBase): """ _validation = { - 'environment_type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "environment_type": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'auto_rebuild': {'key': 'autoRebuild', 'type': 'str'}, - 'build': {'key': 'build', 'type': 'BuildContext'}, - 'conda_file': {'key': 'condaFile', 'type': 'str'}, - 'environment_type': {'key': 'environmentType', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'str'}, - 'inference_config': {'key': 'inferenceConfig', 'type': 'InferenceContainerProperties'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "auto_delete_setting": { + "key": "autoDeleteSetting", + "type": "AutoDeleteSetting", + }, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "auto_rebuild": {"key": "autoRebuild", "type": "str"}, + "build": {"key": "build", "type": "BuildContext"}, + "conda_file": {"key": "condaFile", "type": "str"}, + "environment_type": {"key": "environmentType", "type": "str"}, + "image": {"key": "image", "type": "str"}, + "inference_config": { + "key": "inferenceConfig", + "type": "InferenceContainerProperties", + }, + "intellectual_property": { + "key": "intellectualProperty", + "type": "IntellectualProperty", + }, + "os_type": {"key": "osType", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "stage": {"key": "stage", "type": "str"}, } def __init__( @@ -12012,19 +12727,19 @@ def __init__( :paramtype build: ~azure.mgmt.machinelearningservices.models.BuildContext :keyword conda_file: Standard configuration file used by Conda that lets you install any kind of package, including Python, R, and C/C++ packages. - - + + .. raw:: html - + . :paramtype conda_file: str :keyword image: Name of the image that will be used for the environment. - - + + .. raw:: html - + . @@ -12041,7 +12756,15 @@ def __init__( :keyword stage: Stage in the environment lifecycle assigned to this environment. :paramtype stage: str """ - super(EnvironmentVersionProperties, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) + super(EnvironmentVersionProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + auto_delete_setting=auto_delete_setting, + is_anonymous=is_anonymous, + is_archived=is_archived, + **kwargs + ) self.auto_rebuild = auto_rebuild self.build = build self.conda_file = conda_file @@ -12065,8 +12788,8 @@ class EnvironmentVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[EnvironmentVersion]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[EnvironmentVersion]"}, } def __init__( @@ -12083,7 +12806,9 @@ def __init__( :keyword value: An array of objects of type EnvironmentVersion. :paramtype value: list[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] """ - super(EnvironmentVersionResourceArmPaginatedResult, self).__init__(**kwargs) + super(EnvironmentVersionResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -12100,21 +12825,17 @@ class ErrorAdditionalInfo(msrest.serialization.Model): """ _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, + "type": {"readonly": True}, + "info": {"readonly": True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, + "type": {"key": "type", "type": "str"}, + "info": {"key": "info", "type": "object"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ErrorAdditionalInfo, self).__init__(**kwargs) self.type = None self.info = None @@ -12138,27 +12859,26 @@ class ErrorDetail(msrest.serialization.Model): """ _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, + "code": {"readonly": True}, + "message": {"readonly": True}, + "target": {"readonly": True}, + "details": {"readonly": True}, + "additional_info": {"readonly": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[ErrorDetail]"}, + "additional_info": { + "key": "additionalInfo", + "type": "[ErrorAdditionalInfo]", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ErrorDetail, self).__init__(**kwargs) self.code = None self.message = None @@ -12175,15 +12895,10 @@ class ErrorResponse(msrest.serialization.Model): """ _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, + "error": {"key": "error", "type": "ErrorDetail"}, } - def __init__( - self, - *, - error: Optional["ErrorDetail"] = None, - **kwargs - ): + def __init__(self, *, error: Optional["ErrorDetail"] = None, **kwargs): """ :keyword error: The error object. :paramtype error: ~azure.mgmt.machinelearningservices.models.ErrorDetail @@ -12208,15 +12923,15 @@ class EstimatedVMPrice(msrest.serialization.Model): """ _validation = { - 'retail_price': {'required': True}, - 'os_type': {'required': True}, - 'vm_tier': {'required': True}, + "retail_price": {"required": True}, + "os_type": {"required": True}, + "vm_tier": {"required": True}, } _attribute_map = { - 'retail_price': {'key': 'retailPrice', 'type': 'float'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_tier': {'key': 'vmTier', 'type': 'str'}, + "retail_price": {"key": "retailPrice", "type": "float"}, + "os_type": {"key": "osType", "type": "str"}, + "vm_tier": {"key": "vmTier", "type": "str"}, } def __init__( @@ -12260,15 +12975,15 @@ class EstimatedVMPrices(msrest.serialization.Model): """ _validation = { - 'billing_currency': {'required': True}, - 'unit_of_measure': {'required': True}, - 'values': {'required': True}, + "billing_currency": {"required": True}, + "unit_of_measure": {"required": True}, + "values": {"required": True}, } _attribute_map = { - 'billing_currency': {'key': 'billingCurrency', 'type': 'str'}, - 'unit_of_measure': {'key': 'unitOfMeasure', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[EstimatedVMPrice]'}, + "billing_currency": {"key": "billingCurrency", "type": "str"}, + "unit_of_measure": {"key": "unitOfMeasure", "type": "str"}, + "values": {"key": "values", "type": "[EstimatedVMPrice]"}, } def __init__( @@ -12304,14 +13019,11 @@ class ExternalFQDNResponse(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[FQDNEndpoints]'}, + "value": {"key": "value", "type": "[FQDNEndpoints]"}, } def __init__( - self, - *, - value: Optional[List["FQDNEndpoints"]] = None, - **kwargs + self, *, value: Optional[List["FQDNEndpoints"]] = None, **kwargs ): """ :keyword value: @@ -12344,27 +13056,22 @@ class Feature(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeatureProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "FeatureProperties"}, } - def __init__( - self, - *, - properties: "FeatureProperties", - **kwargs - ): + def __init__(self, *, properties: "FeatureProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.FeatureProperties @@ -12402,21 +13109,27 @@ class FeatureAttributionDriftMonitoringSignal(MonitoringSignalBase): """ _validation = { - 'signal_type': {'required': True}, - 'baseline_data': {'required': True}, - 'metric_threshold': {'required': True}, - 'model_type': {'required': True}, - 'target_data': {'required': True}, + "signal_type": {"required": True}, + "baseline_data": {"required": True}, + "metric_threshold": {"required": True}, + "model_type": {"required": True}, + "target_data": {"required": True}, } _attribute_map = { - 'lookback_period': {'key': 'lookbackPeriod', 'type': 'duration'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'baseline_data': {'key': 'baselineData', 'type': 'MonitoringInputData'}, - 'metric_threshold': {'key': 'metricThreshold', 'type': 'FeatureAttributionMetricThreshold'}, - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'target_data': {'key': 'targetData', 'type': 'MonitoringInputData'}, + "lookback_period": {"key": "lookbackPeriod", "type": "duration"}, + "mode": {"key": "mode", "type": "str"}, + "signal_type": {"key": "signalType", "type": "str"}, + "baseline_data": { + "key": "baselineData", + "type": "MonitoringInputData", + }, + "metric_threshold": { + "key": "metricThreshold", + "type": "FeatureAttributionMetricThreshold", + }, + "model_type": {"key": "modelType", "type": "str"}, + "target_data": {"key": "targetData", "type": "MonitoringInputData"}, } def __init__( @@ -12449,8 +13162,10 @@ def __init__( :keyword target_data: Required. [Required] The data which drift will be calculated for. :paramtype target_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData """ - super(FeatureAttributionDriftMonitoringSignal, self).__init__(lookback_period=lookback_period, mode=mode, **kwargs) - self.signal_type = 'FeatureAttributionDrift' # type: str + super(FeatureAttributionDriftMonitoringSignal, self).__init__( + lookback_period=lookback_period, mode=mode, **kwargs + ) + self.signal_type = "FeatureAttributionDrift" # type: str self.baseline_data = baseline_data self.metric_threshold = metric_threshold self.model_type = model_type @@ -12471,12 +13186,12 @@ class FeatureAttributionMetricThreshold(msrest.serialization.Model): """ _validation = { - 'metric': {'required': True}, + "metric": {"required": True}, } _attribute_map = { - 'metric': {'key': 'metric', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, + "metric": {"key": "metric", "type": "str"}, + "threshold": {"key": "threshold", "type": "MonitoringThreshold"}, } def __init__( @@ -12516,11 +13231,11 @@ class FeatureProperties(ResourceBase): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'feature_name': {'key': 'featureName', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "data_type": {"key": "dataType", "type": "str"}, + "feature_name": {"key": "featureName", "type": "str"}, } def __init__( @@ -12546,7 +13261,9 @@ def __init__( :keyword feature_name: Specifies name. :paramtype feature_name: str """ - super(FeatureProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + super(FeatureProperties, self).__init__( + description=description, properties=properties, tags=tags, **kwargs + ) self.data_type = data_type self.feature_name = feature_name @@ -12562,8 +13279,8 @@ class FeatureResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Feature]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[Feature]"}, } def __init__( @@ -12608,26 +13325,26 @@ class FeaturesetContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturesetContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "FeaturesetContainerProperties", + }, } def __init__( - self, - *, - properties: "FeaturesetContainerProperties", - **kwargs + self, *, properties: "FeaturesetContainerProperties", **kwargs ): """ :keyword properties: Required. [Required] Additional attributes of the entity. @@ -12661,19 +13378,19 @@ class FeaturesetContainerProperties(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } def __init__( @@ -12695,11 +13412,19 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(FeaturesetContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) + super(FeaturesetContainerProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs + ) self.provisioning_state = None -class FeaturesetContainerResourceArmPaginatedResult(msrest.serialization.Model): +class FeaturesetContainerResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of FeaturesetContainer entities. :ivar next_link: The link to the next page of FeaturesetContainer objects. If null, there are @@ -12710,8 +13435,8 @@ class FeaturesetContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturesetContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[FeaturesetContainer]"}, } def __init__( @@ -12728,7 +13453,9 @@ def __init__( :keyword value: An array of objects of type FeaturesetContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetContainer] """ - super(FeaturesetContainerResourceArmPaginatedResult, self).__init__(**kwargs) + super(FeaturesetContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -12760,15 +13487,15 @@ class FeaturesetJob(msrest.serialization.Model): """ _attribute_map = { - 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'duration': {'key': 'duration', 'type': 'duration'}, - 'experiment_id': {'key': 'experimentId', 'type': 'str'}, - 'feature_window': {'key': 'featureWindow', 'type': 'FeatureWindow'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'type': {'key': 'type', 'type': 'str'}, + "created_date": {"key": "createdDate", "type": "iso-8601"}, + "display_name": {"key": "displayName", "type": "str"}, + "duration": {"key": "duration", "type": "duration"}, + "experiment_id": {"key": "experimentId", "type": "str"}, + "feature_window": {"key": "featureWindow", "type": "FeatureWindow"}, + "job_id": {"key": "jobId", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "type": {"key": "type", "type": "str"}, } def __init__( @@ -12831,8 +13558,8 @@ class FeaturesetJobArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturesetJob]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[FeaturesetJob]"}, } def __init__( @@ -12862,15 +13589,10 @@ class FeaturesetSpecification(msrest.serialization.Model): """ _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, + "path": {"key": "path", "type": "str"}, } - def __init__( - self, - *, - path: Optional[str] = None, - **kwargs - ): + def __init__(self, *, path: Optional[str] = None, **kwargs): """ :keyword path: Specifies the spec path. :paramtype path: str @@ -12902,27 +13624,25 @@ class FeaturesetVersion(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturesetVersionProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "FeaturesetVersionProperties", + }, } - def __init__( - self, - *, - properties: "FeaturesetVersionProperties", - **kwargs - ): + def __init__(self, *, properties: "FeaturesetVersionProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.FeaturesetVersionProperties @@ -12949,12 +13669,15 @@ class FeaturesetVersionBackfillRequest(msrest.serialization.Model): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'feature_window': {'key': 'featureWindow', 'type': 'FeatureWindow'}, - 'resource': {'key': 'resource', 'type': 'MaterializationComputeResource'}, - 'spark_configuration': {'key': 'sparkConfiguration', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "description": {"key": "description", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "feature_window": {"key": "featureWindow", "type": "FeatureWindow"}, + "resource": { + "key": "resource", + "type": "MaterializationComputeResource", + }, + "spark_configuration": {"key": "sparkConfiguration", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, } def __init__( @@ -13026,21 +13749,30 @@ class FeaturesetVersionProperties(AssetBase): """ _validation = { - 'provisioning_state': {'readonly': True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'entities': {'key': 'entities', 'type': '[str]'}, - 'materialization_settings': {'key': 'materializationSettings', 'type': 'MaterializationSettings'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'specification': {'key': 'specification', 'type': 'FeaturesetSpecification'}, - 'stage': {'key': 'stage', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "auto_delete_setting": { + "key": "autoDeleteSetting", + "type": "AutoDeleteSetting", + }, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "entities": {"key": "entities", "type": "[str]"}, + "materialization_settings": { + "key": "materializationSettings", + "type": "MaterializationSettings", + }, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "specification": { + "key": "specification", + "type": "FeaturesetSpecification", + }, + "stage": {"key": "stage", "type": "str"}, } def __init__( @@ -13083,7 +13815,15 @@ def __init__( :keyword stage: Specifies the asset stage. :paramtype stage: str """ - super(FeaturesetVersionProperties, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) + super(FeaturesetVersionProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + auto_delete_setting=auto_delete_setting, + is_anonymous=is_anonymous, + is_archived=is_archived, + **kwargs + ) self.entities = entities self.materialization_settings = materialization_settings self.provisioning_state = None @@ -13102,8 +13842,8 @@ class FeaturesetVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturesetVersion]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[FeaturesetVersion]"}, } def __init__( @@ -13120,7 +13860,9 @@ def __init__( :keyword value: An array of objects of type FeaturesetVersion. :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturesetVersion] """ - super(FeaturesetVersionResourceArmPaginatedResult, self).__init__(**kwargs) + super(FeaturesetVersionResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -13149,26 +13891,26 @@ class FeaturestoreEntityContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturestoreEntityContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "FeaturestoreEntityContainerProperties", + }, } def __init__( - self, - *, - properties: "FeaturestoreEntityContainerProperties", - **kwargs + self, *, properties: "FeaturestoreEntityContainerProperties", **kwargs ): """ :keyword properties: Required. [Required] Additional attributes of the entity. @@ -13203,19 +13945,19 @@ class FeaturestoreEntityContainerProperties(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } def __init__( @@ -13237,11 +13979,19 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(FeaturestoreEntityContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) + super(FeaturestoreEntityContainerProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs + ) self.provisioning_state = None -class FeaturestoreEntityContainerResourceArmPaginatedResult(msrest.serialization.Model): +class FeaturestoreEntityContainerResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of FeaturestoreEntityContainer entities. :ivar next_link: The link to the next page of FeaturestoreEntityContainer objects. If null, @@ -13252,8 +14002,8 @@ class FeaturestoreEntityContainerResourceArmPaginatedResult(msrest.serialization """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturestoreEntityContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[FeaturestoreEntityContainer]"}, } def __init__( @@ -13270,7 +14020,9 @@ def __init__( :keyword value: An array of objects of type FeaturestoreEntityContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer] """ - super(FeaturestoreEntityContainerResourceArmPaginatedResult, self).__init__(**kwargs) + super( + FeaturestoreEntityContainerResourceArmPaginatedResult, self + ).__init__(**kwargs) self.next_link = next_link self.value = value @@ -13299,26 +14051,26 @@ class FeaturestoreEntityVersion(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'FeaturestoreEntityVersionProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "FeaturestoreEntityVersionProperties", + }, } def __init__( - self, - *, - properties: "FeaturestoreEntityVersionProperties", - **kwargs + self, *, properties: "FeaturestoreEntityVersionProperties", **kwargs ): """ :keyword properties: Required. [Required] Additional attributes of the entity. @@ -13359,19 +14111,22 @@ class FeaturestoreEntityVersionProperties(AssetBase): """ _validation = { - 'provisioning_state': {'readonly': True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'index_columns': {'key': 'indexColumns', 'type': '[IndexColumn]'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "auto_delete_setting": { + "key": "autoDeleteSetting", + "type": "AutoDeleteSetting", + }, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "index_columns": {"key": "indexColumns", "type": "[IndexColumn]"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "stage": {"key": "stage", "type": "str"}, } def __init__( @@ -13407,13 +14162,23 @@ def __init__( :keyword stage: Specifies the asset stage. :paramtype stage: str """ - super(FeaturestoreEntityVersionProperties, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) + super(FeaturestoreEntityVersionProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + auto_delete_setting=auto_delete_setting, + is_anonymous=is_anonymous, + is_archived=is_archived, + **kwargs + ) self.index_columns = index_columns self.provisioning_state = None self.stage = stage -class FeaturestoreEntityVersionResourceArmPaginatedResult(msrest.serialization.Model): +class FeaturestoreEntityVersionResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of FeaturestoreEntityVersion entities. :ivar next_link: The link to the next page of FeaturestoreEntityVersion objects. If null, there @@ -13424,8 +14189,8 @@ class FeaturestoreEntityVersionResourceArmPaginatedResult(msrest.serialization.M """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[FeaturestoreEntityVersion]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[FeaturestoreEntityVersion]"}, } def __init__( @@ -13442,7 +14207,9 @@ def __init__( :keyword value: An array of objects of type FeaturestoreEntityVersion. :paramtype value: list[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion] """ - super(FeaturestoreEntityVersionResourceArmPaginatedResult, self).__init__(**kwargs) + super( + FeaturestoreEntityVersionResourceArmPaginatedResult, self + ).__init__(**kwargs) self.next_link = next_link self.value = value @@ -13459,9 +14226,18 @@ class FeatureStoreSettings(msrest.serialization.Model): """ _attribute_map = { - 'compute_runtime': {'key': 'computeRuntime', 'type': 'ComputeRuntimeDto'}, - 'offline_store_connection_name': {'key': 'offlineStoreConnectionName', 'type': 'str'}, - 'online_store_connection_name': {'key': 'onlineStoreConnectionName', 'type': 'str'}, + "compute_runtime": { + "key": "computeRuntime", + "type": "ComputeRuntimeDto", + }, + "offline_store_connection_name": { + "key": "offlineStoreConnectionName", + "type": "str", + }, + "online_store_connection_name": { + "key": "onlineStoreConnectionName", + "type": "str", + }, } def __init__( @@ -13501,27 +14277,22 @@ class FeatureSubset(MonitoringFeatureFilterBase): """ _validation = { - 'filter_type': {'required': True}, - 'features': {'required': True}, + "filter_type": {"required": True}, + "features": {"required": True}, } _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - 'features': {'key': 'features', 'type': '[str]'}, + "filter_type": {"key": "filterType", "type": "str"}, + "features": {"key": "features", "type": "[str]"}, } - def __init__( - self, - *, - features: List[str], - **kwargs - ): + def __init__(self, *, features: List[str], **kwargs): """ :keyword features: Required. [Required] The list of features to include. :paramtype features: list[str] """ super(FeatureSubset, self).__init__(**kwargs) - self.filter_type = 'FeatureSubset' # type: str + self.filter_type = "FeatureSubset" # type: str self.features = features @@ -13535,8 +14306,11 @@ class FeatureWindow(msrest.serialization.Model): """ _attribute_map = { - 'feature_window_end': {'key': 'featureWindowEnd', 'type': 'iso-8601'}, - 'feature_window_start': {'key': 'featureWindowStart', 'type': 'iso-8601'}, + "feature_window_end": {"key": "featureWindowEnd", "type": "iso-8601"}, + "feature_window_start": { + "key": "featureWindowStart", + "type": "iso-8601", + }, } def __init__( @@ -13565,15 +14339,10 @@ class FeaturizationSettings(msrest.serialization.Model): """ _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, + "dataset_language": {"key": "datasetLanguage", "type": "str"}, } - def __init__( - self, - *, - dataset_language: Optional[str] = None, - **kwargs - ): + def __init__(self, *, dataset_language: Optional[str] = None, **kwargs): """ :keyword dataset_language: Dataset language, useful for the text data. :paramtype dataset_language: str @@ -13597,13 +14366,13 @@ class FileSystemSource(DataImportSource): """ _validation = { - 'source_type': {'required': True}, + "source_type": {"required": True}, } _attribute_map = { - 'connection': {'key': 'connection', 'type': 'str'}, - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, + "connection": {"key": "connection", "type": "str"}, + "source_type": {"key": "sourceType", "type": "str"}, + "path": {"key": "path", "type": "str"}, } def __init__( @@ -13620,7 +14389,7 @@ def __init__( :paramtype path: str """ super(FileSystemSource, self).__init__(connection=connection, **kwargs) - self.source_type = 'file_system' # type: str + self.source_type = "file_system" # type: str self.path = path @@ -13632,15 +14401,10 @@ class FlavorData(msrest.serialization.Model): """ _attribute_map = { - 'data': {'key': 'data', 'type': '{str}'}, + "data": {"key": "data", "type": "{str}"}, } - def __init__( - self, - *, - data: Optional[Dict[str, str]] = None, - **kwargs - ): + def __init__(self, *, data: Optional[Dict[str, str]] = None, **kwargs): """ :keyword data: Model flavor-specific data. :paramtype data: dict[str, str] @@ -13715,30 +14479,60 @@ class Forecasting(AutoMLVertical, TableVertical): """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'forecasting_settings': {'key': 'forecastingSettings', 'type': 'ForecastingSettings'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'ForecastingTrainingSettings'}, + "task_type": {"required": True}, + "training_data": {"required": True}, + } + + _attribute_map = { + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "TableFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "search_space": { + "key": "searchSpace", + "type": "[TableParameterSubspace]", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "TableSweepSettings", + }, + "test_data": {"key": "testData", "type": "MLTableJobInput"}, + "test_data_size": {"key": "testDataSize", "type": "float"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "weight_column_name": {"key": "weightColumnName", "type": "str"}, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "forecasting_settings": { + "key": "forecastingSettings", + "type": "ForecastingSettings", + }, + "primary_metric": {"key": "primaryMetric", "type": "str"}, + "training_settings": { + "key": "trainingSettings", + "type": "ForecastingTrainingSettings", + }, } def __init__( @@ -13746,7 +14540,9 @@ def __init__( *, training_data: "MLTableJobInput", cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "TableVerticalFeaturizationSettings" + ] = None, fixed_parameters: Optional["TableFixedParameters"] = None, limit_settings: Optional["TableVerticalLimitSettings"] = None, n_cross_validations: Optional["NCrossValidations"] = None, @@ -13760,7 +14556,9 @@ def __init__( log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, forecasting_settings: Optional["ForecastingSettings"] = None, - primary_metric: Optional[Union[str, "ForecastingPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "ForecastingPrimaryMetrics"] + ] = None, training_settings: Optional["ForecastingTrainingSettings"] = None, **kwargs ): @@ -13822,7 +14620,24 @@ def __init__( :paramtype training_settings: ~azure.mgmt.machinelearningservices.models.ForecastingTrainingSettings """ - super(Forecasting, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, cv_split_column_names=cv_split_column_names, featurization_settings=featurization_settings, fixed_parameters=fixed_parameters, limit_settings=limit_settings, n_cross_validations=n_cross_validations, search_space=search_space, sweep_settings=sweep_settings, test_data=test_data, test_data_size=test_data_size, validation_data=validation_data, validation_data_size=validation_data_size, weight_column_name=weight_column_name, **kwargs) + super(Forecasting, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + cv_split_column_names=cv_split_column_names, + featurization_settings=featurization_settings, + fixed_parameters=fixed_parameters, + limit_settings=limit_settings, + n_cross_validations=n_cross_validations, + search_space=search_space, + sweep_settings=sweep_settings, + test_data=test_data, + test_data_size=test_data_size, + validation_data=validation_data, + validation_data_size=validation_data_size, + weight_column_name=weight_column_name, + **kwargs + ) self.cv_split_column_names = cv_split_column_names self.featurization_settings = featurization_settings self.fixed_parameters = fixed_parameters @@ -13835,7 +14650,7 @@ def __init__( self.validation_data = validation_data self.validation_data_size = validation_data_size self.weight_column_name = weight_column_name - self.task_type = 'Forecasting' # type: str + self.task_type = "Forecasting" # type: str self.forecasting_settings = forecasting_settings self.primary_metric = primary_metric self.training_settings = training_settings @@ -13904,20 +14719,41 @@ class ForecastingSettings(msrest.serialization.Model): """ _attribute_map = { - 'country_or_region_for_holidays': {'key': 'countryOrRegionForHolidays', 'type': 'str'}, - 'cv_step_size': {'key': 'cvStepSize', 'type': 'int'}, - 'feature_lags': {'key': 'featureLags', 'type': 'str'}, - 'features_unknown_at_forecast_time': {'key': 'featuresUnknownAtForecastTime', 'type': '[str]'}, - 'forecast_horizon': {'key': 'forecastHorizon', 'type': 'ForecastHorizon'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'seasonality': {'key': 'seasonality', 'type': 'Seasonality'}, - 'short_series_handling_config': {'key': 'shortSeriesHandlingConfig', 'type': 'str'}, - 'target_aggregate_function': {'key': 'targetAggregateFunction', 'type': 'str'}, - 'target_lags': {'key': 'targetLags', 'type': 'TargetLags'}, - 'target_rolling_window_size': {'key': 'targetRollingWindowSize', 'type': 'TargetRollingWindowSize'}, - 'time_column_name': {'key': 'timeColumnName', 'type': 'str'}, - 'time_series_id_column_names': {'key': 'timeSeriesIdColumnNames', 'type': '[str]'}, - 'use_stl': {'key': 'useStl', 'type': 'str'}, + "country_or_region_for_holidays": { + "key": "countryOrRegionForHolidays", + "type": "str", + }, + "cv_step_size": {"key": "cvStepSize", "type": "int"}, + "feature_lags": {"key": "featureLags", "type": "str"}, + "features_unknown_at_forecast_time": { + "key": "featuresUnknownAtForecastTime", + "type": "[str]", + }, + "forecast_horizon": { + "key": "forecastHorizon", + "type": "ForecastHorizon", + }, + "frequency": {"key": "frequency", "type": "str"}, + "seasonality": {"key": "seasonality", "type": "Seasonality"}, + "short_series_handling_config": { + "key": "shortSeriesHandlingConfig", + "type": "str", + }, + "target_aggregate_function": { + "key": "targetAggregateFunction", + "type": "str", + }, + "target_lags": {"key": "targetLags", "type": "TargetLags"}, + "target_rolling_window_size": { + "key": "targetRollingWindowSize", + "type": "TargetRollingWindowSize", + }, + "time_column_name": {"key": "timeColumnName", "type": "str"}, + "time_series_id_column_names": { + "key": "timeSeriesIdColumnNames", + "type": "[str]", + }, + "use_stl": {"key": "useStl", "type": "str"}, } def __init__( @@ -13930,8 +14766,12 @@ def __init__( forecast_horizon: Optional["ForecastHorizon"] = None, frequency: Optional[str] = None, seasonality: Optional["Seasonality"] = None, - short_series_handling_config: Optional[Union[str, "ShortSeriesHandlingConfiguration"]] = None, - target_aggregate_function: Optional[Union[str, "TargetAggregationFunction"]] = None, + short_series_handling_config: Optional[ + Union[str, "ShortSeriesHandlingConfiguration"] + ] = None, + target_aggregate_function: Optional[ + Union[str, "TargetAggregationFunction"] + ] = None, target_lags: Optional["TargetLags"] = None, target_rolling_window_size: Optional["TargetRollingWindowSize"] = None, time_column_name: Optional[str] = None, @@ -14001,7 +14841,9 @@ def __init__( self.country_or_region_for_holidays = country_or_region_for_holidays self.cv_step_size = cv_step_size self.feature_lags = feature_lags - self.features_unknown_at_forecast_time = features_unknown_at_forecast_time + self.features_unknown_at_forecast_time = ( + features_unknown_at_forecast_time + ) self.forecast_horizon = forecast_horizon self.frequency = frequency self.seasonality = seasonality @@ -14051,16 +14893,37 @@ class ForecastingTrainingSettings(TrainingSettings): """ _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, + "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, + "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, + "training_mode": {"key": "trainingMode", "type": "str"}, + "allowed_training_algorithms": { + "key": "allowedTrainingAlgorithms", + "type": "[str]", + }, + "blocked_training_algorithms": { + "key": "blockedTrainingAlgorithms", + "type": "[str]", + }, } def __init__( @@ -14074,8 +14937,12 @@ def __init__( ensemble_model_download_timeout: Optional[datetime.timedelta] = "PT5M", stack_ensemble_settings: Optional["StackEnsembleSettings"] = None, training_mode: Optional[Union[str, "TrainingMode"]] = None, - allowed_training_algorithms: Optional[List[Union[str, "ForecastingModels"]]] = None, - blocked_training_algorithms: Optional[List[Union[str, "ForecastingModels"]]] = None, + allowed_training_algorithms: Optional[ + List[Union[str, "ForecastingModels"]] + ] = None, + blocked_training_algorithms: Optional[ + List[Union[str, "ForecastingModels"]] + ] = None, **kwargs ): """ @@ -14111,7 +14978,17 @@ def __init__( :paramtype blocked_training_algorithms: list[str or ~azure.mgmt.machinelearningservices.models.ForecastingModels] """ - super(ForecastingTrainingSettings, self).__init__(enable_dnn_training=enable_dnn_training, enable_model_explainability=enable_model_explainability, enable_onnx_compatible_models=enable_onnx_compatible_models, enable_stack_ensemble=enable_stack_ensemble, enable_vote_ensemble=enable_vote_ensemble, ensemble_model_download_timeout=ensemble_model_download_timeout, stack_ensemble_settings=stack_ensemble_settings, training_mode=training_mode, **kwargs) + super(ForecastingTrainingSettings, self).__init__( + enable_dnn_training=enable_dnn_training, + enable_model_explainability=enable_model_explainability, + enable_onnx_compatible_models=enable_onnx_compatible_models, + enable_stack_ensemble=enable_stack_ensemble, + enable_vote_ensemble=enable_vote_ensemble, + ensemble_model_download_timeout=ensemble_model_download_timeout, + stack_ensemble_settings=stack_ensemble_settings, + training_mode=training_mode, + **kwargs + ) self.allowed_training_algorithms = allowed_training_algorithms self.blocked_training_algorithms = blocked_training_algorithms @@ -14126,8 +15003,11 @@ class FQDNEndpoint(msrest.serialization.Model): """ _attribute_map = { - 'domain_name': {'key': 'domainName', 'type': 'str'}, - 'endpoint_details': {'key': 'endpointDetails', 'type': '[FQDNEndpointDetail]'}, + "domain_name": {"key": "domainName", "type": "str"}, + "endpoint_details": { + "key": "endpointDetails", + "type": "[FQDNEndpointDetail]", + }, } def __init__( @@ -14157,15 +15037,10 @@ class FQDNEndpointDetail(msrest.serialization.Model): """ _attribute_map = { - 'port': {'key': 'port', 'type': 'int'}, + "port": {"key": "port", "type": "int"}, } - def __init__( - self, - *, - port: Optional[int] = None, - **kwargs - ): + def __init__(self, *, port: Optional[int] = None, **kwargs): """ :keyword port: :paramtype port: int @@ -14182,7 +15057,7 @@ class FQDNEndpoints(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'FQDNEndpointsProperties'}, + "properties": {"key": "properties", "type": "FQDNEndpointsProperties"}, } def __init__( @@ -14209,8 +15084,8 @@ class FQDNEndpointsProperties(msrest.serialization.Model): """ _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'endpoints': {'key': 'endpoints', 'type': '[FQDNEndpoint]'}, + "category": {"key": "category", "type": "str"}, + "endpoints": {"key": "endpoints", "type": "[FQDNEndpoint]"}, } def __init__( @@ -14252,17 +15127,21 @@ class OutboundRule(msrest.serialization.Model): """ _validation = { - 'type': {'required': True}, + "type": {"required": True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, + "type": {"key": "type", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "category": {"key": "category", "type": "str"}, } _subtype_map = { - 'type': {'FQDN': 'FqdnOutboundRule', 'PrivateEndpoint': 'PrivateEndpointOutboundRule', 'ServiceTag': 'ServiceTagOutboundRule'} + "type": { + "FQDN": "FqdnOutboundRule", + "PrivateEndpoint": "PrivateEndpointOutboundRule", + "ServiceTag": "ServiceTagOutboundRule", + } } def __init__( @@ -14306,14 +15185,14 @@ class FqdnOutboundRule(OutboundRule): """ _validation = { - 'type': {'required': True}, + "type": {"required": True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'str'}, + "type": {"key": "type", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "destination": {"key": "destination", "type": "str"}, } def __init__( @@ -14334,8 +15213,10 @@ def __init__( :keyword destination: :paramtype destination: str """ - super(FqdnOutboundRule, self).__init__(status=status, category=category, **kwargs) - self.type = 'FQDN' # type: str + super(FqdnOutboundRule, self).__init__( + status=status, category=category, **kwargs + ) + self.type = "FQDN" # type: str self.destination = destination @@ -14352,21 +15233,20 @@ class GridSamplingAlgorithm(SamplingAlgorithm): """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(GridSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Grid' # type: str + self.sampling_algorithm_type = "Grid" # type: str class HdfsDatastore(DatastoreProperties): @@ -14403,23 +15283,33 @@ class HdfsDatastore(DatastoreProperties): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'name_node_address': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "name_node_address": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'hdfs_server_certificate': {'key': 'hdfsServerCertificate', 'type': 'str'}, - 'name_node_address': {'key': 'nameNodeAddress', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "intellectual_property": { + "key": "intellectualProperty", + "type": "IntellectualProperty", + }, + "is_default": {"key": "isDefault", "type": "bool"}, + "hdfs_server_certificate": { + "key": "hdfsServerCertificate", + "type": "str", + }, + "name_node_address": {"key": "nameNodeAddress", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, } def __init__( @@ -14455,8 +15345,15 @@ def __init__( :keyword protocol: Protocol used to communicate with the storage account (Https/Http). :paramtype protocol: str """ - super(HdfsDatastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, intellectual_property=intellectual_property, **kwargs) - self.datastore_type = 'Hdfs' # type: str + super(HdfsDatastore, self).__init__( + description=description, + properties=properties, + tags=tags, + credentials=credentials, + intellectual_property=intellectual_property, + **kwargs + ) + self.datastore_type = "Hdfs" # type: str self.hdfs_server_certificate = hdfs_server_certificate self.name_node_address = name_node_address self.protocol = protocol @@ -14470,14 +15367,11 @@ class HDInsightSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, + "properties": {"key": "properties", "type": "HDInsightProperties"}, } def __init__( - self, - *, - properties: Optional["HDInsightProperties"] = None, - **kwargs + self, *, properties: Optional["HDInsightProperties"] = None, **kwargs ): """ :keyword properties: HDInsight compute properties. @@ -14526,26 +15420,29 @@ class HDInsight(Compute, HDInsightSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'HDInsightProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "HDInsightProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -14571,9 +15468,16 @@ def __init__( MSI and AAD exclusively for authentication. :paramtype disable_local_auth: bool """ - super(HDInsight, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) + super(HDInsight, self).__init__( + compute_location=compute_location, + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'HDInsight' # type: str + self.compute_type = "HDInsight" # type: str self.compute_location = compute_location self.provisioning_state = None self.description = description @@ -14598,9 +15502,12 @@ class HDInsightProperties(msrest.serialization.Model): """ _attribute_map = { - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, + "ssh_port": {"key": "sshPort", "type": "int"}, + "address": {"key": "address", "type": "str"}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, } def __init__( @@ -14639,27 +15546,26 @@ class IdAssetReference(AssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, - 'asset_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "reference_type": {"required": True}, + "asset_id": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'asset_id': {'key': 'assetId', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "asset_id": {"key": "assetId", "type": "str"}, } - def __init__( - self, - *, - asset_id: str, - **kwargs - ): + def __init__(self, *, asset_id: str, **kwargs): """ :keyword asset_id: Required. [Required] ARM resource ID of the asset. :paramtype asset_id: str """ super(IdAssetReference, self).__init__(**kwargs) - self.reference_type = 'Id' # type: str + self.reference_type = "Id" # type: str self.asset_id = asset_id @@ -14672,14 +15578,14 @@ class IdentityForCmk(msrest.serialization.Model): """ _attribute_map = { - 'user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, + "user_assigned_identity": { + "key": "userAssignedIdentity", + "type": "str", + }, } def __init__( - self, - *, - user_assigned_identity: Optional[str] = None, - **kwargs + self, *, user_assigned_identity: Optional[str] = None, **kwargs ): """ :keyword user_assigned_identity: The ArmId of the user assigned identity that will be used to @@ -14699,14 +15605,14 @@ class IdleShutdownSetting(msrest.serialization.Model): """ _attribute_map = { - 'idle_time_before_shutdown': {'key': 'idleTimeBeforeShutdown', 'type': 'str'}, + "idle_time_before_shutdown": { + "key": "idleTimeBeforeShutdown", + "type": "str", + }, } def __init__( - self, - *, - idle_time_before_shutdown: Optional[str] = None, - **kwargs + self, *, idle_time_before_shutdown: Optional[str] = None, **kwargs ): """ :keyword idle_time_before_shutdown: Time is defined in ISO8601 format. Minimum is 15 min, @@ -14731,9 +15637,9 @@ class Image(msrest.serialization.Model): """ _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'type': {'key': 'type', 'type': 'str'}, - 'reference': {'key': 'reference', 'type': 'str'}, + "additional_properties": {"key": "", "type": "{object}"}, + "type": {"key": "type", "type": "str"}, + "reference": {"key": "reference", "type": "str"}, } def __init__( @@ -14762,32 +15668,41 @@ def __init__( class ImageVertical(msrest.serialization.Model): """Abstract class for AutoML tasks that train image (computer vision) models - -such as Image Classification / Image Classification Multilabel / Image Object Detection / Image Instance Segmentation. + such as Image Classification / Image Classification Multilabel / Image Object Detection / Image Instance Segmentation. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float """ _validation = { - 'limit_settings': {'required': True}, + "limit_settings": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, } def __init__( @@ -14845,16 +15760,31 @@ class ImageClassificationBase(ImageVertical): """ _validation = { - 'limit_settings': {'required': True}, + "limit_settings": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsClassification", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsClassification]", + }, } def __init__( @@ -14865,7 +15795,9 @@ def __init__( validation_data: Optional["MLTableJobInput"] = None, validation_data_size: Optional[float] = None, model_settings: Optional["ImageModelSettingsClassification"] = None, - search_space: Optional[List["ImageModelDistributionSettingsClassification"]] = None, + search_space: Optional[ + List["ImageModelDistributionSettingsClassification"] + ] = None, **kwargs ): """ @@ -14888,73 +15820,94 @@ def __init__( :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] """ - super(ImageClassificationBase, self).__init__(limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, **kwargs) + super(ImageClassificationBase, self).__init__( + limit_settings=limit_settings, + sweep_settings=sweep_settings, + validation_data=validation_data, + validation_data_size=validation_data_size, + **kwargs + ) self.model_settings = model_settings self.search_space = search_space class ImageClassification(AutoMLVertical, ImageClassificationBase): """Image Classification. Multi-class image classification is used when an image is classified with only a single label -from a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' or a 'duck'. + from a set of classes - e.g. each image is classified as either an image of a 'cat' or a 'dog' or a 'duck'. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, + "limit_settings": {"required": True}, + "task_type": {"required": True}, + "training_data": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsClassification", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsClassification]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( @@ -14966,10 +15919,14 @@ def __init__( validation_data: Optional["MLTableJobInput"] = None, validation_data_size: Optional[float] = None, model_settings: Optional["ImageModelSettingsClassification"] = None, - search_space: Optional[List["ImageModelDistributionSettingsClassification"]] = None, + search_space: Optional[ + List["ImageModelDistributionSettingsClassification"] + ] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "ClassificationPrimaryMetrics"] + ] = None, **kwargs ): """ @@ -15005,14 +15962,25 @@ def __init__( :paramtype primary_metric: str or ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ - super(ImageClassification, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, model_settings=model_settings, search_space=search_space, **kwargs) + super(ImageClassification, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + limit_settings=limit_settings, + sweep_settings=sweep_settings, + validation_data=validation_data, + validation_data_size=validation_data_size, + model_settings=model_settings, + search_space=search_space, + **kwargs + ) self.limit_settings = limit_settings self.sweep_settings = sweep_settings self.validation_data = validation_data self.validation_data_size = validation_data_size self.model_settings = model_settings self.search_space = search_space - self.task_type = 'ImageClassification' # type: str + self.task_type = "ImageClassification" # type: str self.primary_metric = primary_metric self.log_verbosity = log_verbosity self.target_column_name = target_column_name @@ -15021,66 +15989,81 @@ def __init__( class ImageClassificationMultilabel(AutoMLVertical, ImageClassificationBase): """Image Classification Multilabel. Multi-label image classification is used when an image could have one or more labels -from a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'. + from a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsClassification + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsClassification] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted", "IOU". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics """ _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, + "limit_settings": {"required": True}, + "task_type": {"required": True}, + "training_data": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsClassification'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsClassification]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsClassification", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsClassification]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( @@ -15092,10 +16075,14 @@ def __init__( validation_data: Optional["MLTableJobInput"] = None, validation_data_size: Optional[float] = None, model_settings: Optional["ImageModelSettingsClassification"] = None, - search_space: Optional[List["ImageModelDistributionSettingsClassification"]] = None, + search_space: Optional[ + List["ImageModelDistributionSettingsClassification"] + ] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationMultilabelPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "ClassificationMultilabelPrimaryMetrics"] + ] = None, **kwargs ): """ @@ -15131,14 +16118,25 @@ def __init__( :paramtype primary_metric: str or ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics """ - super(ImageClassificationMultilabel, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, model_settings=model_settings, search_space=search_space, **kwargs) + super(ImageClassificationMultilabel, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + limit_settings=limit_settings, + sweep_settings=sweep_settings, + validation_data=validation_data, + validation_data_size=validation_data_size, + model_settings=model_settings, + search_space=search_space, + **kwargs + ) self.limit_settings = limit_settings self.sweep_settings = sweep_settings self.validation_data = validation_data self.validation_data_size = validation_data_size self.model_settings = model_settings self.search_space = search_space - self.task_type = 'ImageClassificationMultilabel' # type: str + self.task_type = "ImageClassificationMultilabel" # type: str self.primary_metric = primary_metric self.log_verbosity = log_verbosity self.target_column_name = target_column_name @@ -15171,16 +16169,31 @@ class ImageObjectDetectionBase(ImageVertical): """ _validation = { - 'limit_settings': {'required': True}, + "limit_settings": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsObjectDetection", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsObjectDetection]", + }, } def __init__( @@ -15191,7 +16204,9 @@ def __init__( validation_data: Optional["MLTableJobInput"] = None, validation_data_size: Optional[float] = None, model_settings: Optional["ImageModelSettingsObjectDetection"] = None, - search_space: Optional[List["ImageModelDistributionSettingsObjectDetection"]] = None, + search_space: Optional[ + List["ImageModelDistributionSettingsObjectDetection"] + ] = None, **kwargs ): """ @@ -15214,72 +16229,93 @@ def __init__( :paramtype search_space: list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] """ - super(ImageObjectDetectionBase, self).__init__(limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, **kwargs) + super(ImageObjectDetectionBase, self).__init__( + limit_settings=limit_settings, + sweep_settings=sweep_settings, + validation_data=validation_data, + validation_data_size=validation_data_size, + **kwargs + ) self.model_settings = model_settings self.search_space = search_space class ImageInstanceSegmentation(AutoMLVertical, ImageObjectDetectionBase): """Image Instance Segmentation. Instance segmentation is used to identify objects in an image at the pixel level, -drawing a polygon around each object in the image. + drawing a polygon around each object in the image. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "MeanAveragePrecision". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics """ _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, + "limit_settings": {"required": True}, + "task_type": {"required": True}, + "training_data": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsObjectDetection", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsObjectDetection]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( @@ -15291,10 +16327,14 @@ def __init__( validation_data: Optional["MLTableJobInput"] = None, validation_data_size: Optional[float] = None, model_settings: Optional["ImageModelSettingsObjectDetection"] = None, - search_space: Optional[List["ImageModelDistributionSettingsObjectDetection"]] = None, + search_space: Optional[ + List["ImageModelDistributionSettingsObjectDetection"] + ] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "InstanceSegmentationPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "InstanceSegmentationPrimaryMetrics"] + ] = None, **kwargs ): """ @@ -15329,14 +16369,25 @@ def __init__( :paramtype primary_metric: str or ~azure.mgmt.machinelearningservices.models.InstanceSegmentationPrimaryMetrics """ - super(ImageInstanceSegmentation, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, model_settings=model_settings, search_space=search_space, **kwargs) + super(ImageInstanceSegmentation, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + limit_settings=limit_settings, + sweep_settings=sweep_settings, + validation_data=validation_data, + validation_data_size=validation_data_size, + model_settings=model_settings, + search_space=search_space, + **kwargs + ) self.limit_settings = limit_settings self.sweep_settings = sweep_settings self.validation_data = validation_data self.validation_data_size = validation_data_size self.model_settings = model_settings self.search_space = search_space - self.task_type = 'ImageInstanceSegmentation' # type: str + self.task_type = "ImageInstanceSegmentation" # type: str self.primary_metric = primary_metric self.log_verbosity = log_verbosity self.target_column_name = target_column_name @@ -15355,9 +16406,9 @@ class ImageLimitSettings(msrest.serialization.Model): """ _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_trials": {"key": "maxTrials", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } def __init__( @@ -15396,9 +16447,12 @@ class ImageMetadata(msrest.serialization.Model): """ _attribute_map = { - 'current_image_version': {'key': 'currentImageVersion', 'type': 'str'}, - 'latest_image_version': {'key': 'latestImageVersion', 'type': 'str'}, - 'is_latest_os_image_version': {'key': 'isLatestOsImageVersion', 'type': 'bool'}, + "current_image_version": {"key": "currentImageVersion", "type": "str"}, + "latest_image_version": {"key": "latestImageVersion", "type": "str"}, + "is_latest_os_image_version": { + "key": "isLatestOsImageVersion", + "type": "bool", + }, } def __init__( @@ -15428,129 +16482,147 @@ def __init__( class ImageModelDistributionSettings(msrest.serialization.Model): """Distribution expressions to sweep over values of model settings. -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) -where distribution name can be: uniform, quniform, loguniform, etc -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, + :code:` + Some examples are: + ``` + ModelName = "choice('seresnext', 'resnest50')"; + LearningRate = "uniform(0.001, 0.01)"; + LayersToFreeze = "choice(0, 2)"; + ```` + All distributions can be specified as distribution_name(min, max) or choice(val1, val2, ..., valn) + where distribution name can be: uniform, quniform, loguniform, etc + For more details on how to compose distribution expressions please check the documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: str + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: str + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: str + :ivar distributed: Whether to use distributer training. + :vartype distributed: str + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: str + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: str + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: str + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: str + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: str + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: str + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: str + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: str + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. + :vartype learning_rate_scheduler: str + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: str + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: str + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: str + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: str + :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. + :vartype optimizer: str + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: str + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: str + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: str + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: str + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: str + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: str + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: str + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: str + """ + + _attribute_map = { + "ams_gradient": {"key": "amsGradient", "type": "str"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "str"}, + "beta2": {"key": "beta2", "type": "str"}, + "distributed": {"key": "distributed", "type": "str"}, + "early_stopping": {"key": "earlyStopping", "type": "str"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "str"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "str", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "str", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "str"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "str", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "str"}, + "nesterov": {"key": "nesterov", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "str"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "str"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "str"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "str"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "str"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "str", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "str", + }, + "weight_decay": {"key": "weightDecay", "type": "str"}, } def __init__( @@ -15699,147 +16771,170 @@ def __init__( self.weight_decay = weight_decay -class ImageModelDistributionSettingsClassification(ImageModelDistributionSettings): +class ImageModelDistributionSettingsClassification( + ImageModelDistributionSettings +): """Distribution expressions to sweep over values of model settings. -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: str - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: str - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: str - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'str'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'str'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'str'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'str'}, + :code:` + Some examples are: + ``` + ModelName = "choice('seresnext', 'resnest50')"; + LearningRate = "uniform(0.001, 0.01)"; + LayersToFreeze = "choice(0, 2)"; + ```` + For more details on how to compose distribution expressions please check the documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: str + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: str + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: str + :ivar distributed: Whether to use distributer training. + :vartype distributed: str + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: str + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: str + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: str + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: str + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: str + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: str + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: str + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: str + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. + :vartype learning_rate_scheduler: str + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: str + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: str + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: str + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: str + :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. + :vartype optimizer: str + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: str + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: str + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: str + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: str + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: str + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: str + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: str + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: str + :ivar training_crop_size: Image crop size that is input to the neural network for the training + dataset. Must be a positive integer. + :vartype training_crop_size: str + :ivar validation_crop_size: Image crop size that is input to the neural network for the + validation dataset. Must be a positive integer. + :vartype validation_crop_size: str + :ivar validation_resize_size: Image size to which to resize before cropping for validation + dataset. Must be a positive integer. + :vartype validation_resize_size: str + :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. + 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be + 0 or 1 or 2. + :vartype weighted_loss: str + """ + + _attribute_map = { + "ams_gradient": {"key": "amsGradient", "type": "str"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "str"}, + "beta2": {"key": "beta2", "type": "str"}, + "distributed": {"key": "distributed", "type": "str"}, + "early_stopping": {"key": "earlyStopping", "type": "str"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "str"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "str", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "str", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "str"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "str", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "str"}, + "nesterov": {"key": "nesterov", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "str"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "str"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "str"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "str"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "str"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "str", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "str", + }, + "weight_decay": {"key": "weightDecay", "type": "str"}, + "training_crop_size": {"key": "trainingCropSize", "type": "str"}, + "validation_crop_size": {"key": "validationCropSize", "type": "str"}, + "validation_resize_size": { + "key": "validationResizeSize", + "type": "str", + }, + "weighted_loss": {"key": "weightedLoss", "type": "str"}, } def __init__( @@ -15974,202 +17069,264 @@ def __init__( 0 or 1 or 2. :paramtype weighted_loss: str """ - super(ImageModelDistributionSettingsClassification, self).__init__(ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) + super(ImageModelDistributionSettingsClassification, self).__init__( + ams_gradient=ams_gradient, + augmentations=augmentations, + beta1=beta1, + beta2=beta2, + distributed=distributed, + early_stopping=early_stopping, + early_stopping_delay=early_stopping_delay, + early_stopping_patience=early_stopping_patience, + enable_onnx_normalization=enable_onnx_normalization, + evaluation_frequency=evaluation_frequency, + gradient_accumulation_step=gradient_accumulation_step, + layers_to_freeze=layers_to_freeze, + learning_rate=learning_rate, + learning_rate_scheduler=learning_rate_scheduler, + model_name=model_name, + momentum=momentum, + nesterov=nesterov, + number_of_epochs=number_of_epochs, + number_of_workers=number_of_workers, + optimizer=optimizer, + random_seed=random_seed, + step_lr_gamma=step_lr_gamma, + step_lr_step_size=step_lr_step_size, + training_batch_size=training_batch_size, + validation_batch_size=validation_batch_size, + warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, + warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, + weight_decay=weight_decay, + **kwargs + ) self.training_crop_size = training_crop_size self.validation_crop_size = validation_crop_size - self.validation_resize_size = validation_resize_size - self.weighted_loss = weighted_loss - - -class ImageModelDistributionSettingsObjectDetection(ImageModelDistributionSettings): - """Distribution expressions to sweep over values of model settings. - -:code:` -Some examples are: -``` -ModelName = "choice('seresnext', 'resnest50')"; -LearningRate = "uniform(0.001, 0.01)"; -LayersToFreeze = "choice(0, 2)"; -```` -For more details on how to compose distribution expressions please check the documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: str - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: str - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: str - :ivar distributed: Whether to use distributer training. - :vartype distributed: str - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: str - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: str - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: str - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: str - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: str - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: str - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: str - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: str - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. - :vartype learning_rate_scheduler: str - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: str - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: str - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: str - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: str - :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - :vartype optimizer: str - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: str - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: str - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: str - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: str - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: str - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: str - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: str - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: str - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: str - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: str - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: str - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: str - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: str - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype model_size: str - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: str - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be - float in the range [0, 1]. - :vartype nms_iou_threshold: str - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: str - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - NMS: Non-maximum suppression. - :vartype tile_predictions_nms_threshold: str - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: str - :ivar validation_metric_type: Metric computation method to use for validation metrics. Must be - 'none', 'coco', 'voc', or 'coco_voc'. - :vartype validation_metric_type: str - """ - - _attribute_map = { - 'ams_gradient': {'key': 'amsGradient', 'type': 'str'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'str'}, - 'beta2': {'key': 'beta2', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'str'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'str'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'str'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'str'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'str'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'str'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'str'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'str'}, - 'nesterov': {'key': 'nesterov', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'str'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'str'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'str'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'str'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'str'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'str'}, - 'image_size': {'key': 'imageSize', 'type': 'str'}, - 'max_size': {'key': 'maxSize', 'type': 'str'}, - 'min_size': {'key': 'minSize', 'type': 'str'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'str'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'str'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'str'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'str'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'str'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, + self.validation_resize_size = validation_resize_size + self.weighted_loss = weighted_loss + + +class ImageModelDistributionSettingsObjectDetection( + ImageModelDistributionSettings +): + """Distribution expressions to sweep over values of model settings. + + :code:` + Some examples are: + ``` + ModelName = "choice('seresnext', 'resnest50')"; + LearningRate = "uniform(0.001, 0.01)"; + LayersToFreeze = "choice(0, 2)"; + ```` + For more details on how to compose distribution expressions please check the documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-tune-hyperparameters + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: str + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: str + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: str + :ivar distributed: Whether to use distributer training. + :vartype distributed: str + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: str + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: str + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: str + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: str + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: str + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: str + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: str + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: str + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. + :vartype learning_rate_scheduler: str + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: str + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: str + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: str + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: str + :ivar optimizer: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. + :vartype optimizer: str + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: str + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: str + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: str + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: str + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: str + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: str + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: str + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: str + :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must + be a positive integer. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype box_detections_per_image: str + :ivar box_score_threshold: During inference, only return proposals with a classification score + greater than + BoxScoreThreshold. Must be a float in the range[0, 1]. + :vartype box_score_threshold: str + :ivar image_size: Image size for train and validation. Must be a positive integer. + Note: The training run may get into CUDA OOM if the size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype image_size: str + :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype max_size: str + :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype min_size: str + :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. + Note: training run may get into CUDA OOM if the model size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype model_size: str + :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. + Note: training run may get into CUDA OOM if no sufficient GPU memory. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype multi_scale: str + :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be + float in the range [0, 1]. + :vartype nms_iou_threshold: str + :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not + be + None to enable small object detection logic. A string containing two integers in mxn format. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_grid_size: str + :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float + in the range [0, 1). + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_overlap_ratio: str + :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging + predictions from tiles and image. + Used in validation/ inference. Must be float in the range [0, 1]. + Note: This settings is not supported for the 'yolov5' algorithm. + NMS: Non-maximum suppression. + :vartype tile_predictions_nms_threshold: str + :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be + float in the range [0, 1]. + :vartype validation_iou_threshold: str + :ivar validation_metric_type: Metric computation method to use for validation metrics. Must be + 'none', 'coco', 'voc', or 'coco_voc'. + :vartype validation_metric_type: str + """ + + _attribute_map = { + "ams_gradient": {"key": "amsGradient", "type": "str"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "str"}, + "beta2": {"key": "beta2", "type": "str"}, + "distributed": {"key": "distributed", "type": "str"}, + "early_stopping": {"key": "earlyStopping", "type": "str"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "str"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "str", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "str", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "str"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "str", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "str"}, + "nesterov": {"key": "nesterov", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "str"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "str"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "str"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "str"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "str"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "str", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "str", + }, + "weight_decay": {"key": "weightDecay", "type": "str"}, + "box_detections_per_image": { + "key": "boxDetectionsPerImage", + "type": "str", + }, + "box_score_threshold": {"key": "boxScoreThreshold", "type": "str"}, + "image_size": {"key": "imageSize", "type": "str"}, + "max_size": {"key": "maxSize", "type": "str"}, + "min_size": {"key": "minSize", "type": "str"}, + "model_size": {"key": "modelSize", "type": "str"}, + "multi_scale": {"key": "multiScale", "type": "str"}, + "nms_iou_threshold": {"key": "nmsIouThreshold", "type": "str"}, + "tile_grid_size": {"key": "tileGridSize", "type": "str"}, + "tile_overlap_ratio": {"key": "tileOverlapRatio", "type": "str"}, + "tile_predictions_nms_threshold": { + "key": "tilePredictionsNmsThreshold", + "type": "str", + }, + "validation_iou_threshold": { + "key": "validationIouThreshold", + "type": "str", + }, + "validation_metric_type": { + "key": "validationMetricType", + "type": "str", + }, } def __init__( @@ -16352,7 +17509,37 @@ def __init__( be 'none', 'coco', 'voc', or 'coco_voc'. :paramtype validation_metric_type: str """ - super(ImageModelDistributionSettingsObjectDetection, self).__init__(ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) + super(ImageModelDistributionSettingsObjectDetection, self).__init__( + ams_gradient=ams_gradient, + augmentations=augmentations, + beta1=beta1, + beta2=beta2, + distributed=distributed, + early_stopping=early_stopping, + early_stopping_delay=early_stopping_delay, + early_stopping_patience=early_stopping_patience, + enable_onnx_normalization=enable_onnx_normalization, + evaluation_frequency=evaluation_frequency, + gradient_accumulation_step=gradient_accumulation_step, + layers_to_freeze=layers_to_freeze, + learning_rate=learning_rate, + learning_rate_scheduler=learning_rate_scheduler, + model_name=model_name, + momentum=momentum, + nesterov=nesterov, + number_of_epochs=number_of_epochs, + number_of_workers=number_of_workers, + optimizer=optimizer, + random_seed=random_seed, + step_lr_gamma=step_lr_gamma, + step_lr_step_size=step_lr_step_size, + training_batch_size=training_batch_size, + validation_batch_size=validation_batch_size, + warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, + warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, + weight_decay=weight_decay, + **kwargs + ) self.box_detections_per_image = box_detections_per_image self.box_score_threshold = box_score_threshold self.image_size = image_size @@ -16370,132 +17557,153 @@ def __init__( class ImageModelSettings(msrest.serialization.Model): """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar advanced_settings: Settings for advanced scenarios. + :vartype advanced_settings: str + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: bool + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: float + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: float + :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. + :vartype checkpoint_frequency: int + :ivar checkpoint_model: The pretrained checkpoint model for incremental training. + :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput + :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for + incremental training. + :vartype checkpoint_run_id: str + :ivar distributed: Whether to use distributed training. + :vartype distributed: bool + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: bool + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: int + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: int + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: bool + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: int + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: int + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: int + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: float + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. Possible values include: "None", "WarmupCosine", "Step". + :vartype learning_rate_scheduler: str or + ~azure.mgmt.machinelearningservices.models.LearningRateScheduler + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: float + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: bool + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: int + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: int + :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". + :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: int + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: float + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: int + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: int + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: int + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: float + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: int + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: float + """ + + _attribute_map = { + "advanced_settings": {"key": "advancedSettings", "type": "str"}, + "ams_gradient": {"key": "amsGradient", "type": "bool"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "float"}, + "beta2": {"key": "beta2", "type": "float"}, + "checkpoint_frequency": {"key": "checkpointFrequency", "type": "int"}, + "checkpoint_model": { + "key": "checkpointModel", + "type": "MLFlowModelJobInput", + }, + "checkpoint_run_id": {"key": "checkpointRunId", "type": "str"}, + "distributed": {"key": "distributed", "type": "bool"}, + "early_stopping": {"key": "earlyStopping", "type": "bool"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "int"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "int", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "bool", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "int"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "int", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "int"}, + "learning_rate": {"key": "learningRate", "type": "float"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "float"}, + "nesterov": {"key": "nesterov", "type": "bool"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "int"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "int"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "int"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "float"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "int"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "float", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "int", + }, + "weight_decay": {"key": "weightDecay", "type": "float"}, } def __init__( @@ -16518,7 +17726,9 @@ def __init__( gradient_accumulation_step: Optional[int] = None, layers_to_freeze: Optional[int] = None, learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "LearningRateScheduler"]] = None, + learning_rate_scheduler: Optional[ + Union[str, "LearningRateScheduler"] + ] = None, model_name: Optional[str] = None, momentum: Optional[float] = None, nesterov: Optional[bool] = None, @@ -16665,149 +17875,173 @@ def __init__( class ImageModelSettingsClassification(ImageModelSettings): """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar training_crop_size: Image crop size that is input to the neural network for the training - dataset. Must be a positive integer. - :vartype training_crop_size: int - :ivar validation_crop_size: Image crop size that is input to the neural network for the - validation dataset. Must be a positive integer. - :vartype validation_crop_size: int - :ivar validation_resize_size: Image size to which to resize before cropping for validation - dataset. Must be a positive integer. - :vartype validation_resize_size: int - :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. - 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be - 0 or 1 or 2. - :vartype weighted_loss: int - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'training_crop_size': {'key': 'trainingCropSize', 'type': 'int'}, - 'validation_crop_size': {'key': 'validationCropSize', 'type': 'int'}, - 'validation_resize_size': {'key': 'validationResizeSize', 'type': 'int'}, - 'weighted_loss': {'key': 'weightedLoss', 'type': 'int'}, + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar advanced_settings: Settings for advanced scenarios. + :vartype advanced_settings: str + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: bool + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: float + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: float + :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. + :vartype checkpoint_frequency: int + :ivar checkpoint_model: The pretrained checkpoint model for incremental training. + :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput + :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for + incremental training. + :vartype checkpoint_run_id: str + :ivar distributed: Whether to use distributed training. + :vartype distributed: bool + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: bool + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: int + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: int + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: bool + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: int + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: int + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: int + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: float + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. Possible values include: "None", "WarmupCosine", "Step". + :vartype learning_rate_scheduler: str or + ~azure.mgmt.machinelearningservices.models.LearningRateScheduler + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: float + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: bool + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: int + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: int + :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". + :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: int + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: float + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: int + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: int + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: int + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: float + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: int + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: float + :ivar training_crop_size: Image crop size that is input to the neural network for the training + dataset. Must be a positive integer. + :vartype training_crop_size: int + :ivar validation_crop_size: Image crop size that is input to the neural network for the + validation dataset. Must be a positive integer. + :vartype validation_crop_size: int + :ivar validation_resize_size: Image size to which to resize before cropping for validation + dataset. Must be a positive integer. + :vartype validation_resize_size: int + :ivar weighted_loss: Weighted loss. The accepted values are 0 for no weighted loss. + 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be + 0 or 1 or 2. + :vartype weighted_loss: int + """ + + _attribute_map = { + "advanced_settings": {"key": "advancedSettings", "type": "str"}, + "ams_gradient": {"key": "amsGradient", "type": "bool"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "float"}, + "beta2": {"key": "beta2", "type": "float"}, + "checkpoint_frequency": {"key": "checkpointFrequency", "type": "int"}, + "checkpoint_model": { + "key": "checkpointModel", + "type": "MLFlowModelJobInput", + }, + "checkpoint_run_id": {"key": "checkpointRunId", "type": "str"}, + "distributed": {"key": "distributed", "type": "bool"}, + "early_stopping": {"key": "earlyStopping", "type": "bool"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "int"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "int", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "bool", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "int"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "int", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "int"}, + "learning_rate": {"key": "learningRate", "type": "float"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "float"}, + "nesterov": {"key": "nesterov", "type": "bool"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "int"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "int"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "int"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "float"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "int"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "float", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "int", + }, + "weight_decay": {"key": "weightDecay", "type": "float"}, + "training_crop_size": {"key": "trainingCropSize", "type": "int"}, + "validation_crop_size": {"key": "validationCropSize", "type": "int"}, + "validation_resize_size": { + "key": "validationResizeSize", + "type": "int", + }, + "weighted_loss": {"key": "weightedLoss", "type": "int"}, } def __init__( @@ -16830,7 +18064,9 @@ def __init__( gradient_accumulation_step: Optional[int] = None, layers_to_freeze: Optional[int] = None, learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "LearningRateScheduler"]] = None, + learning_rate_scheduler: Optional[ + Union[str, "LearningRateScheduler"] + ] = None, model_name: Optional[str] = None, momentum: Optional[float] = None, nesterov: Optional[bool] = None, @@ -16957,7 +18193,41 @@ def __init__( 0 or 1 or 2. :paramtype weighted_loss: int """ - super(ImageModelSettingsClassification, self).__init__(advanced_settings=advanced_settings, ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, checkpoint_frequency=checkpoint_frequency, checkpoint_model=checkpoint_model, checkpoint_run_id=checkpoint_run_id, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) + super(ImageModelSettingsClassification, self).__init__( + advanced_settings=advanced_settings, + ams_gradient=ams_gradient, + augmentations=augmentations, + beta1=beta1, + beta2=beta2, + checkpoint_frequency=checkpoint_frequency, + checkpoint_model=checkpoint_model, + checkpoint_run_id=checkpoint_run_id, + distributed=distributed, + early_stopping=early_stopping, + early_stopping_delay=early_stopping_delay, + early_stopping_patience=early_stopping_patience, + enable_onnx_normalization=enable_onnx_normalization, + evaluation_frequency=evaluation_frequency, + gradient_accumulation_step=gradient_accumulation_step, + layers_to_freeze=layers_to_freeze, + learning_rate=learning_rate, + learning_rate_scheduler=learning_rate_scheduler, + model_name=model_name, + momentum=momentum, + nesterov=nesterov, + number_of_epochs=number_of_epochs, + number_of_workers=number_of_workers, + optimizer=optimizer, + random_seed=random_seed, + step_lr_gamma=step_lr_gamma, + step_lr_step_size=step_lr_step_size, + training_batch_size=training_batch_size, + validation_batch_size=validation_batch_size, + warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, + warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, + weight_decay=weight_decay, + **kwargs + ) self.training_crop_size = training_crop_size self.validation_crop_size = validation_crop_size self.validation_resize_size = validation_resize_size @@ -16966,208 +18236,241 @@ def __init__( class ImageModelSettingsObjectDetection(ImageModelSettings): """Settings used for training the model. -For more information on the available settings please visit the official documentation: -https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - - :ivar advanced_settings: Settings for advanced scenarios. - :vartype advanced_settings: str - :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - :vartype ams_gradient: bool - :ivar augmentations: Settings for using Augmentations. - :vartype augmentations: str - :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta1: float - :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range - [0, 1]. - :vartype beta2: float - :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. - :vartype checkpoint_frequency: int - :ivar checkpoint_model: The pretrained checkpoint model for incremental training. - :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput - :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for - incremental training. - :vartype checkpoint_run_id: str - :ivar distributed: Whether to use distributed training. - :vartype distributed: bool - :ivar early_stopping: Enable early stopping logic during training. - :vartype early_stopping: bool - :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before - primary metric improvement - is tracked for early stopping. Must be a positive integer. - :vartype early_stopping_delay: int - :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no - primary metric improvement before - the run is stopped. Must be a positive integer. - :vartype early_stopping_patience: int - :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. - :vartype enable_onnx_normalization: bool - :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must - be a positive integer. - :vartype evaluation_frequency: int - :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of - "GradAccumulationStep" steps without - updating the model weights while accumulating the gradients of those steps, and then using - the accumulated gradients to compute the weight updates. Must be a positive integer. - :vartype gradient_accumulation_step: int - :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. - For instance, passing 2 as value for 'seresnext' means - freezing layer0 and layer1. For a full list of models supported and details on layer freeze, - please - see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype layers_to_freeze: int - :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. - :vartype learning_rate: float - :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or - 'step'. Possible values include: "None", "WarmupCosine", "Step". - :vartype learning_rate_scheduler: str or - ~azure.mgmt.machinelearningservices.models.LearningRateScheduler - :ivar model_name: Name of the model to use for training. - For more information on the available models please visit the official documentation: - https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. - :vartype model_name: str - :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - :vartype momentum: float - :ivar nesterov: Enable nesterov when optimizer is 'sgd'. - :vartype nesterov: bool - :ivar number_of_epochs: Number of training epochs. Must be a positive integer. - :vartype number_of_epochs: int - :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. - :vartype number_of_workers: int - :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". - :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer - :ivar random_seed: Random seed to be used when using deterministic training. - :vartype random_seed: int - :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in - the range [0, 1]. - :vartype step_lr_gamma: float - :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a - positive integer. - :vartype step_lr_step_size: int - :ivar training_batch_size: Training batch size. Must be a positive integer. - :vartype training_batch_size: int - :ivar validation_batch_size: Validation batch size. Must be a positive integer. - :vartype validation_batch_size: int - :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is - 'warmup_cosine'. Must be a float in the range [0, 1]. - :vartype warmup_cosine_lr_cycles: float - :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is - 'warmup_cosine'. Must be a positive integer. - :vartype warmup_cosine_lr_warmup_epochs: int - :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be - a float in the range[0, 1]. - :vartype weight_decay: float - :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must - be a positive integer. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype box_detections_per_image: int - :ivar box_score_threshold: During inference, only return proposals with a classification score - greater than - BoxScoreThreshold. Must be a float in the range[0, 1]. - :vartype box_score_threshold: float - :ivar image_size: Image size for train and validation. Must be a positive integer. - Note: The training run may get into CUDA OOM if the size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype image_size: int - :ivar log_training_metrics: Enable computing and logging training metrics. Possible values - include: "Enable", "Disable". - :vartype log_training_metrics: str or - ~azure.mgmt.machinelearningservices.models.LogTrainingMetrics - :ivar log_validation_loss: Enable computing and logging validation loss. Possible values - include: "Enable", "Disable". - :vartype log_validation_loss: str or - ~azure.mgmt.machinelearningservices.models.LogValidationLoss - :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype max_size: int - :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. - Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype min_size: int - :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. - Note: training run may get into CUDA OOM if the model size is too big. - Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: - "None", "Small", "Medium", "Large", "ExtraLarge". - :vartype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize - :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. - Note: training run may get into CUDA OOM if no sufficient GPU memory. - Note: This settings is only supported for the 'yolov5' algorithm. - :vartype multi_scale: bool - :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be a - float in the range [0, 1]. - :vartype nms_iou_threshold: float - :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not - be - None to enable small object detection logic. A string containing two integers in mxn format. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_grid_size: str - :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float - in the range [0, 1). - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_overlap_ratio: float - :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging - predictions from tiles and image. - Used in validation/ inference. Must be float in the range [0, 1]. - Note: This settings is not supported for the 'yolov5' algorithm. - :vartype tile_predictions_nms_threshold: float - :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be - float in the range [0, 1]. - :vartype validation_iou_threshold: float - :ivar validation_metric_type: Metric computation method to use for validation metrics. Possible - values include: "None", "Coco", "Voc", "CocoVoc". - :vartype validation_metric_type: str or - ~azure.mgmt.machinelearningservices.models.ValidationMetricType - """ - - _attribute_map = { - 'advanced_settings': {'key': 'advancedSettings', 'type': 'str'}, - 'ams_gradient': {'key': 'amsGradient', 'type': 'bool'}, - 'augmentations': {'key': 'augmentations', 'type': 'str'}, - 'beta1': {'key': 'beta1', 'type': 'float'}, - 'beta2': {'key': 'beta2', 'type': 'float'}, - 'checkpoint_frequency': {'key': 'checkpointFrequency', 'type': 'int'}, - 'checkpoint_model': {'key': 'checkpointModel', 'type': 'MLFlowModelJobInput'}, - 'checkpoint_run_id': {'key': 'checkpointRunId', 'type': 'str'}, - 'distributed': {'key': 'distributed', 'type': 'bool'}, - 'early_stopping': {'key': 'earlyStopping', 'type': 'bool'}, - 'early_stopping_delay': {'key': 'earlyStoppingDelay', 'type': 'int'}, - 'early_stopping_patience': {'key': 'earlyStoppingPatience', 'type': 'int'}, - 'enable_onnx_normalization': {'key': 'enableOnnxNormalization', 'type': 'bool'}, - 'evaluation_frequency': {'key': 'evaluationFrequency', 'type': 'int'}, - 'gradient_accumulation_step': {'key': 'gradientAccumulationStep', 'type': 'int'}, - 'layers_to_freeze': {'key': 'layersToFreeze', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'momentum': {'key': 'momentum', 'type': 'float'}, - 'nesterov': {'key': 'nesterov', 'type': 'bool'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, - 'optimizer': {'key': 'optimizer', 'type': 'str'}, - 'random_seed': {'key': 'randomSeed', 'type': 'int'}, - 'step_lr_gamma': {'key': 'stepLRGamma', 'type': 'float'}, - 'step_lr_step_size': {'key': 'stepLRStepSize', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_cosine_lr_cycles': {'key': 'warmupCosineLRCycles', 'type': 'float'}, - 'warmup_cosine_lr_warmup_epochs': {'key': 'warmupCosineLRWarmupEpochs', 'type': 'int'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, - 'box_detections_per_image': {'key': 'boxDetectionsPerImage', 'type': 'int'}, - 'box_score_threshold': {'key': 'boxScoreThreshold', 'type': 'float'}, - 'image_size': {'key': 'imageSize', 'type': 'int'}, - 'log_training_metrics': {'key': 'logTrainingMetrics', 'type': 'str'}, - 'log_validation_loss': {'key': 'logValidationLoss', 'type': 'str'}, - 'max_size': {'key': 'maxSize', 'type': 'int'}, - 'min_size': {'key': 'minSize', 'type': 'int'}, - 'model_size': {'key': 'modelSize', 'type': 'str'}, - 'multi_scale': {'key': 'multiScale', 'type': 'bool'}, - 'nms_iou_threshold': {'key': 'nmsIouThreshold', 'type': 'float'}, - 'tile_grid_size': {'key': 'tileGridSize', 'type': 'str'}, - 'tile_overlap_ratio': {'key': 'tileOverlapRatio', 'type': 'float'}, - 'tile_predictions_nms_threshold': {'key': 'tilePredictionsNmsThreshold', 'type': 'float'}, - 'validation_iou_threshold': {'key': 'validationIouThreshold', 'type': 'float'}, - 'validation_metric_type': {'key': 'validationMetricType', 'type': 'str'}, + For more information on the available settings please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + + :ivar advanced_settings: Settings for advanced scenarios. + :vartype advanced_settings: str + :ivar ams_gradient: Enable AMSGrad when optimizer is 'adam' or 'adamw'. + :vartype ams_gradient: bool + :ivar augmentations: Settings for using Augmentations. + :vartype augmentations: str + :ivar beta1: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta1: float + :ivar beta2: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range + [0, 1]. + :vartype beta2: float + :ivar checkpoint_frequency: Frequency to store model checkpoints. Must be a positive integer. + :vartype checkpoint_frequency: int + :ivar checkpoint_model: The pretrained checkpoint model for incremental training. + :vartype checkpoint_model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput + :ivar checkpoint_run_id: The id of a previous run that has a pretrained checkpoint for + incremental training. + :vartype checkpoint_run_id: str + :ivar distributed: Whether to use distributed training. + :vartype distributed: bool + :ivar early_stopping: Enable early stopping logic during training. + :vartype early_stopping: bool + :ivar early_stopping_delay: Minimum number of epochs or validation evaluations to wait before + primary metric improvement + is tracked for early stopping. Must be a positive integer. + :vartype early_stopping_delay: int + :ivar early_stopping_patience: Minimum number of epochs or validation evaluations with no + primary metric improvement before + the run is stopped. Must be a positive integer. + :vartype early_stopping_patience: int + :ivar enable_onnx_normalization: Enable normalization when exporting ONNX model. + :vartype enable_onnx_normalization: bool + :ivar evaluation_frequency: Frequency to evaluate validation dataset to get metric scores. Must + be a positive integer. + :vartype evaluation_frequency: int + :ivar gradient_accumulation_step: Gradient accumulation means running a configured number of + "GradAccumulationStep" steps without + updating the model weights while accumulating the gradients of those steps, and then using + the accumulated gradients to compute the weight updates. Must be a positive integer. + :vartype gradient_accumulation_step: int + :ivar layers_to_freeze: Number of layers to freeze for the model. Must be a positive integer. + For instance, passing 2 as value for 'seresnext' means + freezing layer0 and layer1. For a full list of models supported and details on layer freeze, + please + see: https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype layers_to_freeze: int + :ivar learning_rate: Initial learning rate. Must be a float in the range [0, 1]. + :vartype learning_rate: float + :ivar learning_rate_scheduler: Type of learning rate scheduler. Must be 'warmup_cosine' or + 'step'. Possible values include: "None", "WarmupCosine", "Step". + :vartype learning_rate_scheduler: str or + ~azure.mgmt.machinelearningservices.models.LearningRateScheduler + :ivar model_name: Name of the model to use for training. + For more information on the available models please visit the official documentation: + https://learn.microsoft.com/azure/machine-learning/how-to-auto-train-image-models. + :vartype model_name: str + :ivar momentum: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. + :vartype momentum: float + :ivar nesterov: Enable nesterov when optimizer is 'sgd'. + :vartype nesterov: bool + :ivar number_of_epochs: Number of training epochs. Must be a positive integer. + :vartype number_of_epochs: int + :ivar number_of_workers: Number of data loader workers. Must be a non-negative integer. + :vartype number_of_workers: int + :ivar optimizer: Type of optimizer. Possible values include: "None", "Sgd", "Adam", "Adamw". + :vartype optimizer: str or ~azure.mgmt.machinelearningservices.models.StochasticOptimizer + :ivar random_seed: Random seed to be used when using deterministic training. + :vartype random_seed: int + :ivar step_lr_gamma: Value of gamma when learning rate scheduler is 'step'. Must be a float in + the range [0, 1]. + :vartype step_lr_gamma: float + :ivar step_lr_step_size: Value of step size when learning rate scheduler is 'step'. Must be a + positive integer. + :vartype step_lr_step_size: int + :ivar training_batch_size: Training batch size. Must be a positive integer. + :vartype training_batch_size: int + :ivar validation_batch_size: Validation batch size. Must be a positive integer. + :vartype validation_batch_size: int + :ivar warmup_cosine_lr_cycles: Value of cosine cycle when learning rate scheduler is + 'warmup_cosine'. Must be a float in the range [0, 1]. + :vartype warmup_cosine_lr_cycles: float + :ivar warmup_cosine_lr_warmup_epochs: Value of warmup epochs when learning rate scheduler is + 'warmup_cosine'. Must be a positive integer. + :vartype warmup_cosine_lr_warmup_epochs: int + :ivar weight_decay: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be + a float in the range[0, 1]. + :vartype weight_decay: float + :ivar box_detections_per_image: Maximum number of detections per image, for all classes. Must + be a positive integer. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype box_detections_per_image: int + :ivar box_score_threshold: During inference, only return proposals with a classification score + greater than + BoxScoreThreshold. Must be a float in the range[0, 1]. + :vartype box_score_threshold: float + :ivar image_size: Image size for train and validation. Must be a positive integer. + Note: The training run may get into CUDA OOM if the size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype image_size: int + :ivar log_training_metrics: Enable computing and logging training metrics. Possible values + include: "Enable", "Disable". + :vartype log_training_metrics: str or + ~azure.mgmt.machinelearningservices.models.LogTrainingMetrics + :ivar log_validation_loss: Enable computing and logging validation loss. Possible values + include: "Enable", "Disable". + :vartype log_validation_loss: str or + ~azure.mgmt.machinelearningservices.models.LogValidationLoss + :ivar max_size: Maximum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype max_size: int + :ivar min_size: Minimum size of the image to be rescaled before feeding it to the backbone. + Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype min_size: int + :ivar model_size: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. + Note: training run may get into CUDA OOM if the model size is too big. + Note: This settings is only supported for the 'yolov5' algorithm. Possible values include: + "None", "Small", "Medium", "Large", "ExtraLarge". + :vartype model_size: str or ~azure.mgmt.machinelearningservices.models.ModelSize + :ivar multi_scale: Enable multi-scale image by varying image size by +/- 50%. + Note: training run may get into CUDA OOM if no sufficient GPU memory. + Note: This settings is only supported for the 'yolov5' algorithm. + :vartype multi_scale: bool + :ivar nms_iou_threshold: IOU threshold used during inference in NMS post processing. Must be a + float in the range [0, 1]. + :vartype nms_iou_threshold: float + :ivar tile_grid_size: The grid size to use for tiling each image. Note: TileGridSize must not + be + None to enable small object detection logic. A string containing two integers in mxn format. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_grid_size: str + :ivar tile_overlap_ratio: Overlap ratio between adjacent tiles in each dimension. Must be float + in the range [0, 1). + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_overlap_ratio: float + :ivar tile_predictions_nms_threshold: The IOU threshold to use to perform NMS while merging + predictions from tiles and image. + Used in validation/ inference. Must be float in the range [0, 1]. + Note: This settings is not supported for the 'yolov5' algorithm. + :vartype tile_predictions_nms_threshold: float + :ivar validation_iou_threshold: IOU threshold to use when computing validation metric. Must be + float in the range [0, 1]. + :vartype validation_iou_threshold: float + :ivar validation_metric_type: Metric computation method to use for validation metrics. Possible + values include: "None", "Coco", "Voc", "CocoVoc". + :vartype validation_metric_type: str or + ~azure.mgmt.machinelearningservices.models.ValidationMetricType + """ + + _attribute_map = { + "advanced_settings": {"key": "advancedSettings", "type": "str"}, + "ams_gradient": {"key": "amsGradient", "type": "bool"}, + "augmentations": {"key": "augmentations", "type": "str"}, + "beta1": {"key": "beta1", "type": "float"}, + "beta2": {"key": "beta2", "type": "float"}, + "checkpoint_frequency": {"key": "checkpointFrequency", "type": "int"}, + "checkpoint_model": { + "key": "checkpointModel", + "type": "MLFlowModelJobInput", + }, + "checkpoint_run_id": {"key": "checkpointRunId", "type": "str"}, + "distributed": {"key": "distributed", "type": "bool"}, + "early_stopping": {"key": "earlyStopping", "type": "bool"}, + "early_stopping_delay": {"key": "earlyStoppingDelay", "type": "int"}, + "early_stopping_patience": { + "key": "earlyStoppingPatience", + "type": "int", + }, + "enable_onnx_normalization": { + "key": "enableOnnxNormalization", + "type": "bool", + }, + "evaluation_frequency": {"key": "evaluationFrequency", "type": "int"}, + "gradient_accumulation_step": { + "key": "gradientAccumulationStep", + "type": "int", + }, + "layers_to_freeze": {"key": "layersToFreeze", "type": "int"}, + "learning_rate": {"key": "learningRate", "type": "float"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "momentum": {"key": "momentum", "type": "float"}, + "nesterov": {"key": "nesterov", "type": "bool"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "int"}, + "number_of_workers": {"key": "numberOfWorkers", "type": "int"}, + "optimizer": {"key": "optimizer", "type": "str"}, + "random_seed": {"key": "randomSeed", "type": "int"}, + "step_lr_gamma": {"key": "stepLRGamma", "type": "float"}, + "step_lr_step_size": {"key": "stepLRStepSize", "type": "int"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, + "warmup_cosine_lr_cycles": { + "key": "warmupCosineLRCycles", + "type": "float", + }, + "warmup_cosine_lr_warmup_epochs": { + "key": "warmupCosineLRWarmupEpochs", + "type": "int", + }, + "weight_decay": {"key": "weightDecay", "type": "float"}, + "box_detections_per_image": { + "key": "boxDetectionsPerImage", + "type": "int", + }, + "box_score_threshold": {"key": "boxScoreThreshold", "type": "float"}, + "image_size": {"key": "imageSize", "type": "int"}, + "log_training_metrics": {"key": "logTrainingMetrics", "type": "str"}, + "log_validation_loss": {"key": "logValidationLoss", "type": "str"}, + "max_size": {"key": "maxSize", "type": "int"}, + "min_size": {"key": "minSize", "type": "int"}, + "model_size": {"key": "modelSize", "type": "str"}, + "multi_scale": {"key": "multiScale", "type": "bool"}, + "nms_iou_threshold": {"key": "nmsIouThreshold", "type": "float"}, + "tile_grid_size": {"key": "tileGridSize", "type": "str"}, + "tile_overlap_ratio": {"key": "tileOverlapRatio", "type": "float"}, + "tile_predictions_nms_threshold": { + "key": "tilePredictionsNmsThreshold", + "type": "float", + }, + "validation_iou_threshold": { + "key": "validationIouThreshold", + "type": "float", + }, + "validation_metric_type": { + "key": "validationMetricType", + "type": "str", + }, } def __init__( @@ -17190,7 +18493,9 @@ def __init__( gradient_accumulation_step: Optional[int] = None, layers_to_freeze: Optional[int] = None, learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "LearningRateScheduler"]] = None, + learning_rate_scheduler: Optional[ + Union[str, "LearningRateScheduler"] + ] = None, model_name: Optional[str] = None, momentum: Optional[float] = None, nesterov: Optional[bool] = None, @@ -17208,7 +18513,9 @@ def __init__( box_detections_per_image: Optional[int] = None, box_score_threshold: Optional[float] = None, image_size: Optional[int] = None, - log_training_metrics: Optional[Union[str, "LogTrainingMetrics"]] = None, + log_training_metrics: Optional[ + Union[str, "LogTrainingMetrics"] + ] = None, log_validation_loss: Optional[Union[str, "LogValidationLoss"]] = None, max_size: Optional[int] = None, min_size: Optional[int] = None, @@ -17219,7 +18526,9 @@ def __init__( tile_overlap_ratio: Optional[float] = None, tile_predictions_nms_threshold: Optional[float] = None, validation_iou_threshold: Optional[float] = None, - validation_metric_type: Optional[Union[str, "ValidationMetricType"]] = None, + validation_metric_type: Optional[ + Union[str, "ValidationMetricType"] + ] = None, **kwargs ): """ @@ -17376,7 +18685,41 @@ def __init__( :paramtype validation_metric_type: str or ~azure.mgmt.machinelearningservices.models.ValidationMetricType """ - super(ImageModelSettingsObjectDetection, self).__init__(advanced_settings=advanced_settings, ams_gradient=ams_gradient, augmentations=augmentations, beta1=beta1, beta2=beta2, checkpoint_frequency=checkpoint_frequency, checkpoint_model=checkpoint_model, checkpoint_run_id=checkpoint_run_id, distributed=distributed, early_stopping=early_stopping, early_stopping_delay=early_stopping_delay, early_stopping_patience=early_stopping_patience, enable_onnx_normalization=enable_onnx_normalization, evaluation_frequency=evaluation_frequency, gradient_accumulation_step=gradient_accumulation_step, layers_to_freeze=layers_to_freeze, learning_rate=learning_rate, learning_rate_scheduler=learning_rate_scheduler, model_name=model_name, momentum=momentum, nesterov=nesterov, number_of_epochs=number_of_epochs, number_of_workers=number_of_workers, optimizer=optimizer, random_seed=random_seed, step_lr_gamma=step_lr_gamma, step_lr_step_size=step_lr_step_size, training_batch_size=training_batch_size, validation_batch_size=validation_batch_size, warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, weight_decay=weight_decay, **kwargs) + super(ImageModelSettingsObjectDetection, self).__init__( + advanced_settings=advanced_settings, + ams_gradient=ams_gradient, + augmentations=augmentations, + beta1=beta1, + beta2=beta2, + checkpoint_frequency=checkpoint_frequency, + checkpoint_model=checkpoint_model, + checkpoint_run_id=checkpoint_run_id, + distributed=distributed, + early_stopping=early_stopping, + early_stopping_delay=early_stopping_delay, + early_stopping_patience=early_stopping_patience, + enable_onnx_normalization=enable_onnx_normalization, + evaluation_frequency=evaluation_frequency, + gradient_accumulation_step=gradient_accumulation_step, + layers_to_freeze=layers_to_freeze, + learning_rate=learning_rate, + learning_rate_scheduler=learning_rate_scheduler, + model_name=model_name, + momentum=momentum, + nesterov=nesterov, + number_of_epochs=number_of_epochs, + number_of_workers=number_of_workers, + optimizer=optimizer, + random_seed=random_seed, + step_lr_gamma=step_lr_gamma, + step_lr_step_size=step_lr_step_size, + training_batch_size=training_batch_size, + validation_batch_size=validation_batch_size, + warmup_cosine_lr_cycles=warmup_cosine_lr_cycles, + warmup_cosine_lr_warmup_epochs=warmup_cosine_lr_warmup_epochs, + weight_decay=weight_decay, + **kwargs + ) self.box_detections_per_image = box_detections_per_image self.box_score_threshold = box_score_threshold self.image_size = image_size @@ -17396,65 +18739,80 @@ def __init__( class ImageObjectDetection(AutoMLVertical, ImageObjectDetectionBase): """Image Object Detection. Object detection is used to identify objects in an image and locate each object with a -bounding box e.g. locate all dogs and cats in an image and draw a bounding box around each. + bounding box e.g. locate all dogs and cats in an image and draw a bounding box around each. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings - :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar validation_data_size: The fraction of training dataset that needs to be set aside for - validation purpose. - Values between (0.0 , 1.0) - Applied when validation dataset is not provided. - :vartype validation_data_size: float - :ivar model_settings: Settings used for training the model. - :vartype model_settings: - ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: - list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric to optimize for this task. Possible values include: - "MeanAveragePrecision". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics + :ivar limit_settings: Required. [Required] Limit settings for the AutoML job. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.ImageLimitSettings + :ivar sweep_settings: Model sweeping and hyperparameter sweeping related settings. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.ImageSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar validation_data_size: The fraction of training dataset that needs to be set aside for + validation purpose. + Values between (0.0 , 1.0) + Applied when validation dataset is not provided. + :vartype validation_data_size: float + :ivar model_settings: Settings used for training the model. + :vartype model_settings: + ~azure.mgmt.machinelearningservices.models.ImageModelSettingsObjectDetection + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: + list[~azure.mgmt.machinelearningservices.models.ImageModelDistributionSettingsObjectDetection] + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric to optimize for this task. Possible values include: + "MeanAveragePrecision". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics """ _validation = { - 'limit_settings': {'required': True}, - 'task_type': {'required': True}, - 'training_data': {'required': True}, + "limit_settings": {"required": True}, + "task_type": {"required": True}, + "training_data": {"required": True}, } _attribute_map = { - 'limit_settings': {'key': 'limitSettings', 'type': 'ImageLimitSettings'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'ImageSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'model_settings': {'key': 'modelSettings', 'type': 'ImageModelSettingsObjectDetection'}, - 'search_space': {'key': 'searchSpace', 'type': '[ImageModelDistributionSettingsObjectDetection]'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "limit_settings": { + "key": "limitSettings", + "type": "ImageLimitSettings", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "ImageSweepSettings", + }, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "model_settings": { + "key": "modelSettings", + "type": "ImageModelSettingsObjectDetection", + }, + "search_space": { + "key": "searchSpace", + "type": "[ImageModelDistributionSettingsObjectDetection]", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( @@ -17466,10 +18824,14 @@ def __init__( validation_data: Optional["MLTableJobInput"] = None, validation_data_size: Optional[float] = None, model_settings: Optional["ImageModelSettingsObjectDetection"] = None, - search_space: Optional[List["ImageModelDistributionSettingsObjectDetection"]] = None, + search_space: Optional[ + List["ImageModelDistributionSettingsObjectDetection"] + ] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ObjectDetectionPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "ObjectDetectionPrimaryMetrics"] + ] = None, **kwargs ): """ @@ -17504,14 +18866,25 @@ def __init__( :paramtype primary_metric: str or ~azure.mgmt.machinelearningservices.models.ObjectDetectionPrimaryMetrics """ - super(ImageObjectDetection, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, limit_settings=limit_settings, sweep_settings=sweep_settings, validation_data=validation_data, validation_data_size=validation_data_size, model_settings=model_settings, search_space=search_space, **kwargs) + super(ImageObjectDetection, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + limit_settings=limit_settings, + sweep_settings=sweep_settings, + validation_data=validation_data, + validation_data_size=validation_data_size, + model_settings=model_settings, + search_space=search_space, + **kwargs + ) self.limit_settings = limit_settings self.sweep_settings = sweep_settings self.validation_data = validation_data self.validation_data_size = validation_data_size self.model_settings = model_settings self.search_space = search_space - self.task_type = 'ImageObjectDetection' # type: str + self.task_type = "ImageObjectDetection" # type: str self.primary_metric = primary_metric self.log_verbosity = log_verbosity self.target_column_name = target_column_name @@ -17532,12 +18905,15 @@ class ImageSweepSettings(msrest.serialization.Model): """ _validation = { - 'sampling_algorithm': {'required': True}, + "sampling_algorithm": {"required": True}, } _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, + "sampling_algorithm": {"key": "samplingAlgorithm", "type": "str"}, } def __init__( @@ -17574,28 +18950,26 @@ class ImportDataAction(ScheduleActionBase): """ _validation = { - 'action_type': {'required': True}, - 'data_import_definition': {'required': True}, + "action_type": {"required": True}, + "data_import_definition": {"required": True}, } _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'data_import_definition': {'key': 'dataImportDefinition', 'type': 'DataImport'}, + "action_type": {"key": "actionType", "type": "str"}, + "data_import_definition": { + "key": "dataImportDefinition", + "type": "DataImport", + }, } - def __init__( - self, - *, - data_import_definition: "DataImport", - **kwargs - ): + def __init__(self, *, data_import_definition: "DataImport", **kwargs): """ :keyword data_import_definition: Required. [Required] Defines Schedule action definition details. :paramtype data_import_definition: ~azure.mgmt.machinelearningservices.models.DataImport """ super(ImportDataAction, self).__init__(**kwargs) - self.action_type = 'ImportData' # type: str + self.action_type = "ImportData" # type: str self.data_import_definition = data_import_definition @@ -17610,8 +18984,8 @@ class IndexColumn(msrest.serialization.Model): """ _attribute_map = { - 'column_name': {'key': 'columnName', 'type': 'str'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, + "column_name": {"key": "columnName", "type": "str"}, + "data_type": {"key": "dataType", "type": "str"}, } def __init__( @@ -17646,9 +19020,9 @@ class InferenceContainerProperties(msrest.serialization.Model): """ _attribute_map = { - 'liveness_route': {'key': 'livenessRoute', 'type': 'Route'}, - 'readiness_route': {'key': 'readinessRoute', 'type': 'Route'}, - 'scoring_route': {'key': 'scoringRoute', 'type': 'Route'}, + "liveness_route": {"key": "livenessRoute", "type": "Route"}, + "readiness_route": {"key": "readinessRoute", "type": "Route"}, + "scoring_route": {"key": "scoringRoute", "type": "Route"}, } def __init__( @@ -17684,8 +19058,11 @@ class InstanceTypeSchema(msrest.serialization.Model): """ _attribute_map = { - 'node_selector': {'key': 'nodeSelector', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'InstanceTypeSchemaResources'}, + "node_selector": {"key": "nodeSelector", "type": "{str}"}, + "resources": { + "key": "resources", + "type": "InstanceTypeSchemaResources", + }, } def __init__( @@ -17716,8 +19093,8 @@ class InstanceTypeSchemaResources(msrest.serialization.Model): """ _attribute_map = { - 'requests': {'key': 'requests', 'type': '{str}'}, - 'limits': {'key': 'limits', 'type': '{str}'}, + "requests": {"key": "requests", "type": "{str}"}, + "limits": {"key": "limits", "type": "{str}"}, } def __init__( @@ -17752,12 +19129,16 @@ class IntellectualProperty(msrest.serialization.Model): """ _validation = { - 'publisher': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "publisher": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'protection_level': {'key': 'protectionLevel', 'type': 'str'}, - 'publisher': {'key': 'publisher', 'type': 'str'}, + "protection_level": {"key": "protectionLevel", "type": "str"}, + "publisher": {"key": "publisher", "type": "str"}, } def __init__( @@ -17803,27 +19184,22 @@ class JobBase(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'JobBaseProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "JobBaseProperties"}, } - def __init__( - self, - *, - properties: "JobBaseProperties", - **kwargs - ): + def __init__(self, *, properties: "JobBaseProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.JobBaseProperties @@ -17843,8 +19219,8 @@ class JobBaseResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[JobBase]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[JobBase]"}, } def __init__( @@ -17892,17 +19268,17 @@ class JobResourceConfiguration(ResourceConfiguration): """ _validation = { - 'shm_size': {'pattern': r'\d+[bBkKmMgG]'}, + "shm_size": {"pattern": r"\d+[bBkKmMgG]"}, } _attribute_map = { - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'max_instance_count': {'key': 'maxInstanceCount', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - 'docker_args': {'key': 'dockerArgs', 'type': 'str'}, - 'shm_size': {'key': 'shmSize', 'type': 'str'}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "locations": {"key": "locations", "type": "[str]"}, + "max_instance_count": {"key": "maxInstanceCount", "type": "int"}, + "properties": {"key": "properties", "type": "{object}"}, + "docker_args": {"key": "dockerArgs", "type": "str"}, + "shm_size": {"key": "shmSize", "type": "str"}, } def __init__( @@ -17939,7 +19315,14 @@ def __init__( b(bytes), k(kilobytes), m(megabytes), or g(gigabytes). :paramtype shm_size: str """ - super(JobResourceConfiguration, self).__init__(instance_count=instance_count, instance_type=instance_type, locations=locations, max_instance_count=max_instance_count, properties=properties, **kwargs) + super(JobResourceConfiguration, self).__init__( + instance_count=instance_count, + instance_type=instance_type, + locations=locations, + max_instance_count=max_instance_count, + properties=properties, + **kwargs + ) self.docker_args = docker_args self.shm_size = shm_size @@ -17958,27 +19341,25 @@ class JobScheduleAction(ScheduleActionBase): """ _validation = { - 'action_type': {'required': True}, - 'job_definition': {'required': True}, + "action_type": {"required": True}, + "job_definition": {"required": True}, } _attribute_map = { - 'action_type': {'key': 'actionType', 'type': 'str'}, - 'job_definition': {'key': 'jobDefinition', 'type': 'JobBaseProperties'}, + "action_type": {"key": "actionType", "type": "str"}, + "job_definition": { + "key": "jobDefinition", + "type": "JobBaseProperties", + }, } - def __init__( - self, - *, - job_definition: "JobBaseProperties", - **kwargs - ): + def __init__(self, *, job_definition: "JobBaseProperties", **kwargs): """ :keyword job_definition: Required. [Required] Defines Schedule action definition details. :paramtype job_definition: ~azure.mgmt.machinelearningservices.models.JobBaseProperties """ super(JobScheduleAction, self).__init__(**kwargs) - self.action_type = 'CreateJob' # type: str + self.action_type = "CreateJob" # type: str self.job_definition = job_definition @@ -18005,18 +19386,18 @@ class JobService(msrest.serialization.Model): """ _validation = { - 'error_message': {'readonly': True}, - 'status': {'readonly': True}, + "error_message": {"readonly": True}, + "status": {"readonly": True}, } _attribute_map = { - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'job_service_type': {'key': 'jobServiceType', 'type': 'str'}, - 'nodes': {'key': 'nodes', 'type': 'Nodes'}, - 'port': {'key': 'port', 'type': 'int'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'status': {'key': 'status', 'type': 'str'}, + "endpoint": {"key": "endpoint", "type": "str"}, + "error_message": {"key": "errorMessage", "type": "str"}, + "job_service_type": {"key": "jobServiceType", "type": "str"}, + "nodes": {"key": "nodes", "type": "Nodes"}, + "port": {"key": "port", "type": "int"}, + "properties": {"key": "properties", "type": "{str}"}, + "status": {"key": "status", "type": "str"}, } def __init__( @@ -18067,15 +19448,27 @@ class KerberosCredentials(msrest.serialization.Model): """ _validation = { - 'kerberos_kdc_address': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "kerberos_kdc_address": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "kerberos_principal": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "kerberos_realm": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, + "kerberos_kdc_address": {"key": "kerberosKdcAddress", "type": "str"}, + "kerberos_principal": {"key": "kerberosPrincipal", "type": "str"}, + "kerberos_realm": {"key": "kerberosRealm", "type": "str"}, } def __init__( @@ -18122,19 +19515,31 @@ class KerberosKeytabCredentials(DatastoreCredentials, KerberosCredentials): """ _validation = { - 'kerberos_kdc_address': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, + "kerberos_kdc_address": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "kerberos_principal": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "kerberos_realm": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "credentials_type": {"required": True}, + "secrets": {"required": True}, } _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'KerberosKeytabSecrets'}, + "kerberos_kdc_address": {"key": "kerberosKdcAddress", "type": "str"}, + "kerberos_principal": {"key": "kerberosPrincipal", "type": "str"}, + "kerberos_realm": {"key": "kerberosRealm", "type": "str"}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "secrets": {"key": "secrets", "type": "KerberosKeytabSecrets"}, } def __init__( @@ -18157,11 +19562,16 @@ def __init__( :keyword secrets: Required. [Required] Keytab secrets. :paramtype secrets: ~azure.mgmt.machinelearningservices.models.KerberosKeytabSecrets """ - super(KerberosKeytabCredentials, self).__init__(kerberos_kdc_address=kerberos_kdc_address, kerberos_principal=kerberos_principal, kerberos_realm=kerberos_realm, **kwargs) + super(KerberosKeytabCredentials, self).__init__( + kerberos_kdc_address=kerberos_kdc_address, + kerberos_principal=kerberos_principal, + kerberos_realm=kerberos_realm, + **kwargs + ) self.kerberos_kdc_address = kerberos_kdc_address self.kerberos_principal = kerberos_principal self.kerberos_realm = kerberos_realm - self.credentials_type = 'KerberosKeytab' # type: str + self.credentials_type = "KerberosKeytab" # type: str self.secrets = secrets @@ -18179,26 +19589,21 @@ class KerberosKeytabSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'kerberos_keytab': {'key': 'kerberosKeytab', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "kerberos_keytab": {"key": "kerberosKeytab", "type": "str"}, } - def __init__( - self, - *, - kerberos_keytab: Optional[str] = None, - **kwargs - ): + def __init__(self, *, kerberos_keytab: Optional[str] = None, **kwargs): """ :keyword kerberos_keytab: Kerberos keytab secret. :paramtype kerberos_keytab: str """ super(KerberosKeytabSecrets, self).__init__(**kwargs) - self.secrets_type = 'KerberosKeytab' # type: str + self.secrets_type = "KerberosKeytab" # type: str self.kerberos_keytab = kerberos_keytab @@ -18223,19 +19628,31 @@ class KerberosPasswordCredentials(DatastoreCredentials, KerberosCredentials): """ _validation = { - 'kerberos_kdc_address': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_principal': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'kerberos_realm': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, + "kerberos_kdc_address": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "kerberos_principal": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "kerberos_realm": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "credentials_type": {"required": True}, + "secrets": {"required": True}, } _attribute_map = { - 'kerberos_kdc_address': {'key': 'kerberosKdcAddress', 'type': 'str'}, - 'kerberos_principal': {'key': 'kerberosPrincipal', 'type': 'str'}, - 'kerberos_realm': {'key': 'kerberosRealm', 'type': 'str'}, - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'KerberosPasswordSecrets'}, + "kerberos_kdc_address": {"key": "kerberosKdcAddress", "type": "str"}, + "kerberos_principal": {"key": "kerberosPrincipal", "type": "str"}, + "kerberos_realm": {"key": "kerberosRealm", "type": "str"}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "secrets": {"key": "secrets", "type": "KerberosPasswordSecrets"}, } def __init__( @@ -18258,11 +19675,16 @@ def __init__( :keyword secrets: Required. [Required] Kerberos password secrets. :paramtype secrets: ~azure.mgmt.machinelearningservices.models.KerberosPasswordSecrets """ - super(KerberosPasswordCredentials, self).__init__(kerberos_kdc_address=kerberos_kdc_address, kerberos_principal=kerberos_principal, kerberos_realm=kerberos_realm, **kwargs) + super(KerberosPasswordCredentials, self).__init__( + kerberos_kdc_address=kerberos_kdc_address, + kerberos_principal=kerberos_principal, + kerberos_realm=kerberos_realm, + **kwargs + ) self.kerberos_kdc_address = kerberos_kdc_address self.kerberos_principal = kerberos_principal self.kerberos_realm = kerberos_realm - self.credentials_type = 'KerberosPassword' # type: str + self.credentials_type = "KerberosPassword" # type: str self.secrets = secrets @@ -18280,26 +19702,21 @@ class KerberosPasswordSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'kerberos_password': {'key': 'kerberosPassword', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "kerberos_password": {"key": "kerberosPassword", "type": "str"}, } - def __init__( - self, - *, - kerberos_password: Optional[str] = None, - **kwargs - ): + def __init__(self, *, kerberos_password: Optional[str] = None, **kwargs): """ :keyword kerberos_password: Kerberos password secret. :paramtype kerberos_password: str """ super(KerberosPasswordSecrets, self).__init__(**kwargs) - self.secrets_type = 'KerberosPassword' # type: str + self.secrets_type = "KerberosPassword" # type: str self.kerberos_password = kerberos_password @@ -18311,14 +19728,11 @@ class KubernetesSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, + "properties": {"key": "properties", "type": "KubernetesProperties"}, } def __init__( - self, - *, - properties: Optional["KubernetesProperties"] = None, - **kwargs + self, *, properties: Optional["KubernetesProperties"] = None, **kwargs ): """ :keyword properties: Properties of Kubernetes. @@ -18367,26 +19781,29 @@ class Kubernetes(Compute, KubernetesSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'KubernetesProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": {"key": "properties", "type": "KubernetesProperties"}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -18412,9 +19829,16 @@ def __init__( MSI and AAD exclusively for authentication. :paramtype disable_local_auth: bool """ - super(Kubernetes, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) + super(Kubernetes, self).__init__( + compute_location=compute_location, + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'Kubernetes' # type: str + self.compute_type = "Kubernetes" # type: str self.compute_location = compute_location self.provisioning_state = None self.description = description @@ -18485,32 +19909,50 @@ class OnlineDeploymentProperties(EndpointDeploymentPropertiesBase): """ _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'data_collector': {'key': 'dataCollector', 'type': 'DataCollector'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, + "endpoint_compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, + "data_collector": {"key": "dataCollector", "type": "DataCollector"}, + "egress_public_network_access": { + "key": "egressPublicNetworkAccess", + "type": "str", + }, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, + "model": {"key": "model", "type": "str"}, + "model_mount_path": {"key": "modelMountPath", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, } _subtype_map = { - 'endpoint_compute_type': {'Kubernetes': 'KubernetesOnlineDeployment', 'Managed': 'ManagedOnlineDeployment'} + "endpoint_compute_type": { + "Kubernetes": "KubernetesOnlineDeployment", + "Managed": "ManagedOnlineDeployment", + } } def __init__( @@ -18523,7 +19965,9 @@ def __init__( properties: Optional[Dict[str, str]] = None, app_insights_enabled: Optional[bool] = False, data_collector: Optional["DataCollector"] = None, - egress_public_network_access: Optional[Union[str, "EgressPublicNetworkAccessType"]] = None, + egress_public_network_access: Optional[ + Union[str, "EgressPublicNetworkAccessType"] + ] = None, instance_type: Optional[str] = None, liveness_probe: Optional["ProbeSettings"] = None, model: Optional[str] = None, @@ -18573,11 +20017,18 @@ def __init__( and to DefaultScaleSettings for ManagedOnlineDeployment. :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings """ - super(OnlineDeploymentProperties, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, **kwargs) + super(OnlineDeploymentProperties, self).__init__( + code_configuration=code_configuration, + description=description, + environment_id=environment_id, + environment_variables=environment_variables, + properties=properties, + **kwargs + ) self.app_insights_enabled = app_insights_enabled self.data_collector = data_collector self.egress_public_network_access = egress_public_network_access - self.endpoint_compute_type = 'OnlineDeploymentProperties' # type: str + self.endpoint_compute_type = "OnlineDeploymentProperties" # type: str self.instance_type = instance_type self.liveness_probe = liveness_probe self.model = model @@ -18648,29 +20099,47 @@ class KubernetesOnlineDeployment(OnlineDeploymentProperties): """ _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'data_collector': {'key': 'dataCollector', 'type': 'DataCollector'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, - 'container_resource_requirements': {'key': 'containerResourceRequirements', 'type': 'ContainerResourceRequirements'}, + "endpoint_compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, + "data_collector": {"key": "dataCollector", "type": "DataCollector"}, + "egress_public_network_access": { + "key": "egressPublicNetworkAccess", + "type": "str", + }, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, + "model": {"key": "model", "type": "str"}, + "model_mount_path": {"key": "modelMountPath", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, + "container_resource_requirements": { + "key": "containerResourceRequirements", + "type": "ContainerResourceRequirements", + }, } def __init__( @@ -18683,7 +20152,9 @@ def __init__( properties: Optional[Dict[str, str]] = None, app_insights_enabled: Optional[bool] = False, data_collector: Optional["DataCollector"] = None, - egress_public_network_access: Optional[Union[str, "EgressPublicNetworkAccessType"]] = None, + egress_public_network_access: Optional[ + Union[str, "EgressPublicNetworkAccessType"] + ] = None, instance_type: Optional[str] = None, liveness_probe: Optional["ProbeSettings"] = None, model: Optional[str] = None, @@ -18691,7 +20162,9 @@ def __init__( readiness_probe: Optional["ProbeSettings"] = None, request_settings: Optional["OnlineRequestSettings"] = None, scale_settings: Optional["OnlineScaleSettings"] = None, - container_resource_requirements: Optional["ContainerResourceRequirements"] = None, + container_resource_requirements: Optional[ + "ContainerResourceRequirements" + ] = None, **kwargs ): """ @@ -18738,8 +20211,25 @@ def __init__( :paramtype container_resource_requirements: ~azure.mgmt.machinelearningservices.models.ContainerResourceRequirements """ - super(KubernetesOnlineDeployment, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, app_insights_enabled=app_insights_enabled, data_collector=data_collector, egress_public_network_access=egress_public_network_access, instance_type=instance_type, liveness_probe=liveness_probe, model=model, model_mount_path=model_mount_path, readiness_probe=readiness_probe, request_settings=request_settings, scale_settings=scale_settings, **kwargs) - self.endpoint_compute_type = 'Kubernetes' # type: str + super(KubernetesOnlineDeployment, self).__init__( + code_configuration=code_configuration, + description=description, + environment_id=environment_id, + environment_variables=environment_variables, + properties=properties, + app_insights_enabled=app_insights_enabled, + data_collector=data_collector, + egress_public_network_access=egress_public_network_access, + instance_type=instance_type, + liveness_probe=liveness_probe, + model=model, + model_mount_path=model_mount_path, + readiness_probe=readiness_probe, + request_settings=request_settings, + scale_settings=scale_settings, + **kwargs + ) + self.endpoint_compute_type = "Kubernetes" # type: str self.container_resource_requirements = container_resource_requirements @@ -18766,14 +20256,29 @@ class KubernetesProperties(msrest.serialization.Model): """ _attribute_map = { - 'relay_connection_string': {'key': 'relayConnectionString', 'type': 'str'}, - 'service_bus_connection_string': {'key': 'serviceBusConnectionString', 'type': 'str'}, - 'extension_principal_id': {'key': 'extensionPrincipalId', 'type': 'str'}, - 'extension_instance_release_train': {'key': 'extensionInstanceReleaseTrain', 'type': 'str'}, - 'vc_name': {'key': 'vcName', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'default_instance_type': {'key': 'defaultInstanceType', 'type': 'str'}, - 'instance_types': {'key': 'instanceTypes', 'type': '{InstanceTypeSchema}'}, + "relay_connection_string": { + "key": "relayConnectionString", + "type": "str", + }, + "service_bus_connection_string": { + "key": "serviceBusConnectionString", + "type": "str", + }, + "extension_principal_id": { + "key": "extensionPrincipalId", + "type": "str", + }, + "extension_instance_release_train": { + "key": "extensionInstanceReleaseTrain", + "type": "str", + }, + "vc_name": {"key": "vcName", "type": "str"}, + "namespace": {"key": "namespace", "type": "str"}, + "default_instance_type": {"key": "defaultInstanceType", "type": "str"}, + "instance_types": { + "key": "instanceTypes", + "type": "{InstanceTypeSchema}", + }, } def __init__( @@ -18812,7 +20317,9 @@ def __init__( self.relay_connection_string = relay_connection_string self.service_bus_connection_string = service_bus_connection_string self.extension_principal_id = extension_principal_id - self.extension_instance_release_train = extension_instance_release_train + self.extension_instance_release_train = ( + extension_instance_release_train + ) self.vc_name = vc_name self.namespace = namespace self.default_instance_type = default_instance_type @@ -18832,9 +20339,9 @@ class LabelCategory(msrest.serialization.Model): """ _attribute_map = { - 'classes': {'key': 'classes', 'type': '{LabelClass}'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'multi_select': {'key': 'multiSelect', 'type': 'str'}, + "classes": {"key": "classes", "type": "{LabelClass}"}, + "display_name": {"key": "displayName", "type": "str"}, + "multi_select": {"key": "multiSelect", "type": "str"}, } def __init__( @@ -18870,8 +20377,8 @@ class LabelClass(msrest.serialization.Model): """ _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'subclasses': {'key': 'subclasses', 'type': '{LabelClass}'}, + "display_name": {"key": "displayName", "type": "str"}, + "subclasses": {"key": "subclasses", "type": "{LabelClass}"}, } def __init__( @@ -18904,15 +20411,20 @@ class LabelingDataConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'data_id': {'key': 'dataId', 'type': 'str'}, - 'incremental_data_refresh': {'key': 'incrementalDataRefresh', 'type': 'str'}, + "data_id": {"key": "dataId", "type": "str"}, + "incremental_data_refresh": { + "key": "incrementalDataRefresh", + "type": "str", + }, } def __init__( self, *, data_id: Optional[str] = None, - incremental_data_refresh: Optional[Union[str, "IncrementalDataRefresh"]] = None, + incremental_data_refresh: Optional[ + Union[str, "IncrementalDataRefresh"] + ] = None, **kwargs ): """ @@ -18951,27 +20463,22 @@ class LabelingJob(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'LabelingJobProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "LabelingJobProperties"}, } - def __init__( - self, - *, - properties: "LabelingJobProperties", - **kwargs - ): + def __init__(self, *, properties: "LabelingJobProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.LabelingJobProperties @@ -18994,23 +20501,22 @@ class LabelingJobMediaProperties(msrest.serialization.Model): """ _validation = { - 'media_type': {'required': True}, + "media_type": {"required": True}, } _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, + "media_type": {"key": "mediaType", "type": "str"}, } _subtype_map = { - 'media_type': {'Image': 'LabelingJobImageProperties', 'Text': 'LabelingJobTextProperties'} + "media_type": { + "Image": "LabelingJobImageProperties", + "Text": "LabelingJobTextProperties", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(LabelingJobMediaProperties, self).__init__(**kwargs) self.media_type = None # type: Optional[str] @@ -19029,12 +20535,12 @@ class LabelingJobImageProperties(LabelingJobMediaProperties): """ _validation = { - 'media_type': {'required': True}, + "media_type": {"required": True}, } _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - 'annotation_type': {'key': 'annotationType', 'type': 'str'}, + "media_type": {"key": "mediaType", "type": "str"}, + "annotation_type": {"key": "annotationType", "type": "str"}, } def __init__( @@ -19050,7 +20556,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.ImageAnnotationType """ super(LabelingJobImageProperties, self).__init__(**kwargs) - self.media_type = 'Image' # type: str + self.media_type = "Image" # type: str self.annotation_type = annotation_type @@ -19062,15 +20568,10 @@ class LabelingJobInstructions(msrest.serialization.Model): """ _attribute_map = { - 'uri': {'key': 'uri', 'type': 'str'}, + "uri": {"key": "uri", "type": "str"}, } - def __init__( - self, - *, - uri: Optional[str] = None, - **kwargs - ): + def __init__(self, *, uri: Optional[str] = None, **kwargs): """ :keyword uri: The link to a page with detailed labeling instructions for labelers. :paramtype uri: str @@ -19150,40 +20651,67 @@ class LabelingJobProperties(JobBaseProperties): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'created_date_time': {'readonly': True}, - 'progress_metrics': {'readonly': True}, - 'project_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'status_messages': {'readonly': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'data_configuration': {'key': 'dataConfiguration', 'type': 'LabelingDataConfiguration'}, - 'job_instructions': {'key': 'jobInstructions', 'type': 'LabelingJobInstructions'}, - 'label_categories': {'key': 'labelCategories', 'type': '{LabelCategory}'}, - 'labeling_job_media_properties': {'key': 'labelingJobMediaProperties', 'type': 'LabelingJobMediaProperties'}, - 'ml_assist_configuration': {'key': 'mlAssistConfiguration', 'type': 'MLAssistConfiguration'}, - 'progress_metrics': {'key': 'progressMetrics', 'type': 'ProgressMetrics'}, - 'project_id': {'key': 'projectId', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'status_messages': {'key': 'statusMessages', 'type': '[StatusMessage]'}, + "job_type": {"required": True}, + "status": {"readonly": True}, + "created_date_time": {"readonly": True}, + "progress_metrics": {"readonly": True}, + "project_id": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "status_messages": {"readonly": True}, + } + + _attribute_map = { + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "notification_setting": { + "key": "notificationSetting", + "type": "NotificationSetting", + }, + "secrets_configuration": { + "key": "secretsConfiguration", + "type": "{SecretConfiguration}", + }, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "created_date_time": {"key": "createdDateTime", "type": "iso-8601"}, + "data_configuration": { + "key": "dataConfiguration", + "type": "LabelingDataConfiguration", + }, + "job_instructions": { + "key": "jobInstructions", + "type": "LabelingJobInstructions", + }, + "label_categories": { + "key": "labelCategories", + "type": "{LabelCategory}", + }, + "labeling_job_media_properties": { + "key": "labelingJobMediaProperties", + "type": "LabelingJobMediaProperties", + }, + "ml_assist_configuration": { + "key": "mlAssistConfiguration", + "type": "MLAssistConfiguration", + }, + "progress_metrics": { + "key": "progressMetrics", + "type": "ProgressMetrics", + }, + "project_id": {"key": "projectId", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "status_messages": { + "key": "statusMessages", + "type": "[StatusMessage]", + }, } def __init__( @@ -19199,12 +20727,16 @@ def __init__( identity: Optional["IdentityConfiguration"] = None, is_archived: Optional[bool] = False, notification_setting: Optional["NotificationSetting"] = None, - secrets_configuration: Optional[Dict[str, "SecretConfiguration"]] = None, + secrets_configuration: Optional[ + Dict[str, "SecretConfiguration"] + ] = None, services: Optional[Dict[str, "JobService"]] = None, data_configuration: Optional["LabelingDataConfiguration"] = None, job_instructions: Optional["LabelingJobInstructions"] = None, label_categories: Optional[Dict[str, "LabelCategory"]] = None, - labeling_job_media_properties: Optional["LabelingJobMediaProperties"] = None, + labeling_job_media_properties: Optional[ + "LabelingJobMediaProperties" + ] = None, ml_assist_configuration: Optional["MLAssistConfiguration"] = None, **kwargs ): @@ -19253,8 +20785,22 @@ def __init__( :paramtype ml_assist_configuration: ~azure.mgmt.machinelearningservices.models.MLAssistConfiguration """ - super(LabelingJobProperties, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, notification_setting=notification_setting, secrets_configuration=secrets_configuration, services=services, **kwargs) - self.job_type = 'Labeling' # type: str + super(LabelingJobProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + component_id=component_id, + compute_id=compute_id, + display_name=display_name, + experiment_name=experiment_name, + identity=identity, + is_archived=is_archived, + notification_setting=notification_setting, + secrets_configuration=secrets_configuration, + services=services, + **kwargs + ) + self.job_type = "Labeling" # type: str self.created_date_time = None self.data_configuration = data_configuration self.job_instructions = job_instructions @@ -19278,8 +20824,8 @@ class LabelingJobResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[LabelingJob]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[LabelingJob]"}, } def __init__( @@ -19315,12 +20861,12 @@ class LabelingJobTextProperties(LabelingJobMediaProperties): """ _validation = { - 'media_type': {'required': True}, + "media_type": {"required": True}, } _attribute_map = { - 'media_type': {'key': 'mediaType', 'type': 'str'}, - 'annotation_type': {'key': 'annotationType', 'type': 'str'}, + "media_type": {"key": "mediaType", "type": "str"}, + "annotation_type": {"key": "annotationType", "type": "str"}, } def __init__( @@ -19336,7 +20882,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.TextAnnotationType """ super(LabelingJobTextProperties, self).__init__(**kwargs) - self.media_type = 'Text' # type: str + self.media_type = "Text" # type: str self.annotation_type = annotation_type @@ -19356,25 +20902,22 @@ class OneLakeArtifact(msrest.serialization.Model): """ _validation = { - 'artifact_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'artifact_type': {'required': True}, + "artifact_name": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "artifact_type": {"required": True}, } _attribute_map = { - 'artifact_name': {'key': 'artifactName', 'type': 'str'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, + "artifact_name": {"key": "artifactName", "type": "str"}, + "artifact_type": {"key": "artifactType", "type": "str"}, } - _subtype_map = { - 'artifact_type': {'LakeHouse': 'LakeHouseArtifact'} - } + _subtype_map = {"artifact_type": {"LakeHouse": "LakeHouseArtifact"}} - def __init__( - self, - *, - artifact_name: str, - **kwargs - ): + def __init__(self, *, artifact_name: str, **kwargs): """ :keyword artifact_name: Required. [Required] OneLake artifact name. :paramtype artifact_name: str @@ -19397,27 +20940,28 @@ class LakeHouseArtifact(OneLakeArtifact): """ _validation = { - 'artifact_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'artifact_type': {'required': True}, + "artifact_name": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "artifact_type": {"required": True}, } _attribute_map = { - 'artifact_name': {'key': 'artifactName', 'type': 'str'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, + "artifact_name": {"key": "artifactName", "type": "str"}, + "artifact_type": {"key": "artifactType", "type": "str"}, } - def __init__( - self, - *, - artifact_name: str, - **kwargs - ): + def __init__(self, *, artifact_name: str, **kwargs): """ :keyword artifact_name: Required. [Required] OneLake artifact name. :paramtype artifact_name: str """ - super(LakeHouseArtifact, self).__init__(artifact_name=artifact_name, **kwargs) - self.artifact_type = 'LakeHouse' # type: str + super(LakeHouseArtifact, self).__init__( + artifact_name=artifact_name, **kwargs + ) + self.artifact_type = "LakeHouse" # type: str class ListAmlUserFeatureResult(msrest.serialization.Model): @@ -19433,21 +20977,17 @@ class ListAmlUserFeatureResult(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[AmlUserFeature]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[AmlUserFeature]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListAmlUserFeatureResult, self).__init__(**kwargs) self.value = None self.next_link = None @@ -19465,21 +21005,17 @@ class ListNotebookKeysResult(msrest.serialization.Model): """ _validation = { - 'primary_access_key': {'readonly': True}, - 'secondary_access_key': {'readonly': True}, + "primary_access_key": {"readonly": True}, + "secondary_access_key": {"readonly": True}, } _attribute_map = { - 'primary_access_key': {'key': 'primaryAccessKey', 'type': 'str'}, - 'secondary_access_key': {'key': 'secondaryAccessKey', 'type': 'str'}, + "primary_access_key": {"key": "primaryAccessKey", "type": "str"}, + "secondary_access_key": {"key": "secondaryAccessKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListNotebookKeysResult, self).__init__(**kwargs) self.primary_access_key = None self.secondary_access_key = None @@ -19495,19 +21031,15 @@ class ListStorageAccountKeysResult(msrest.serialization.Model): """ _validation = { - 'user_storage_key': {'readonly': True}, + "user_storage_key": {"readonly": True}, } _attribute_map = { - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, + "user_storage_key": {"key": "userStorageKey", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListStorageAccountKeysResult, self).__init__(**kwargs) self.user_storage_key = None @@ -19525,21 +21057,17 @@ class ListUsagesResult(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[Usage]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Usage]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListUsagesResult, self).__init__(**kwargs) self.value = None self.next_link = None @@ -19565,27 +21093,35 @@ class ListWorkspaceKeysResult(msrest.serialization.Model): """ _validation = { - 'user_storage_key': {'readonly': True}, - 'user_storage_resource_id': {'readonly': True}, - 'app_insights_instrumentation_key': {'readonly': True}, - 'container_registry_credentials': {'readonly': True}, - 'notebook_access_keys': {'readonly': True}, + "user_storage_key": {"readonly": True}, + "user_storage_resource_id": {"readonly": True}, + "app_insights_instrumentation_key": {"readonly": True}, + "container_registry_credentials": {"readonly": True}, + "notebook_access_keys": {"readonly": True}, } _attribute_map = { - 'user_storage_key': {'key': 'userStorageKey', 'type': 'str'}, - 'user_storage_resource_id': {'key': 'userStorageResourceId', 'type': 'str'}, - 'app_insights_instrumentation_key': {'key': 'appInsightsInstrumentationKey', 'type': 'str'}, - 'container_registry_credentials': {'key': 'containerRegistryCredentials', 'type': 'RegistryListCredentialsResult'}, - 'notebook_access_keys': {'key': 'notebookAccessKeys', 'type': 'ListNotebookKeysResult'}, + "user_storage_key": {"key": "userStorageKey", "type": "str"}, + "user_storage_resource_id": { + "key": "userStorageResourceId", + "type": "str", + }, + "app_insights_instrumentation_key": { + "key": "appInsightsInstrumentationKey", + "type": "str", + }, + "container_registry_credentials": { + "key": "containerRegistryCredentials", + "type": "RegistryListCredentialsResult", + }, + "notebook_access_keys": { + "key": "notebookAccessKeys", + "type": "ListNotebookKeysResult", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListWorkspaceKeysResult, self).__init__(**kwargs) self.user_storage_key = None self.user_storage_resource_id = None @@ -19607,21 +21143,17 @@ class ListWorkspaceQuotas(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[ResourceQuota]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[ResourceQuota]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ListWorkspaceQuotas, self).__init__(**kwargs) self.value = None self.next_link = None @@ -19643,22 +21175,22 @@ class LiteralJobInput(JobInput): """ _validation = { - 'job_input_type': {'required': True}, - 'value': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "job_input_type": {"required": True}, + "value": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, + "value": {"key": "value", "type": "str"}, } def __init__( - self, - *, - value: str, - description: Optional[str] = None, - **kwargs + self, *, value: str, description: Optional[str] = None, **kwargs ): """ :keyword description: Description for the input. @@ -19666,8 +21198,10 @@ def __init__( :keyword value: Required. [Required] Literal value for the input. :paramtype value: str """ - super(LiteralJobInput, self).__init__(description=description, **kwargs) - self.job_input_type = 'literal' # type: str + super(LiteralJobInput, self).__init__( + description=description, **kwargs + ) + self.job_input_type = "literal" # type: str self.value = value @@ -19692,14 +21226,14 @@ class ManagedIdentity(IdentityConfiguration): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + "object_id": {"key": "objectId", "type": "str"}, + "resource_id": {"key": "resourceId", "type": "str"}, } def __init__( @@ -19722,13 +21256,15 @@ def __init__( :paramtype resource_id: str """ super(ManagedIdentity, self).__init__(**kwargs) - self.identity_type = 'Managed' # type: str + self.identity_type = "Managed" # type: str self.client_id = client_id self.object_id = object_id self.resource_id = resource_id -class ManagedIdentityAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class ManagedIdentityAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """ManagedIdentityAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -19755,17 +21291,20 @@ class ManagedIdentityAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPr """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionManagedIdentity'}, + "auth_type": {"key": "authType", "type": "str"}, + "expiry_time": {"key": "expiryTime", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionManagedIdentity", + }, } def __init__( @@ -19797,8 +21336,17 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionManagedIdentity """ - super(ManagedIdentityAuthTypeWorkspaceConnectionProperties, self).__init__(expiry_time=expiry_time, category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'ManagedIdentity' # type: str + super( + ManagedIdentityAuthTypeWorkspaceConnectionProperties, self + ).__init__( + expiry_time=expiry_time, + category=category, + target=target, + value=value, + value_format=value_format, + **kwargs + ) + self.auth_type = "ManagedIdentity" # type: str self.credentials = credentials @@ -19810,15 +21358,10 @@ class ManagedNetworkProvisionOptions(msrest.serialization.Model): """ _attribute_map = { - 'include_spark': {'key': 'includeSpark', 'type': 'bool'}, + "include_spark": {"key": "includeSpark", "type": "bool"}, } - def __init__( - self, - *, - include_spark: Optional[bool] = None, - **kwargs - ): + def __init__(self, *, include_spark: Optional[bool] = None, **kwargs): """ :keyword include_spark: :paramtype include_spark: bool @@ -19838,8 +21381,8 @@ class ManagedNetworkProvisionStatus(msrest.serialization.Model): """ _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'spark_ready': {'key': 'sparkReady', 'type': 'bool'}, + "status": {"key": "status", "type": "str"}, + "spark_ready": {"key": "sparkReady", "type": "bool"}, } def __init__( @@ -19879,14 +21422,14 @@ class ManagedNetworkSettings(msrest.serialization.Model): """ _validation = { - 'network_id': {'readonly': True}, + "network_id": {"readonly": True}, } _attribute_map = { - 'isolation_mode': {'key': 'isolationMode', 'type': 'str'}, - 'network_id': {'key': 'networkId', 'type': 'str'}, - 'outbound_rules': {'key': 'outboundRules', 'type': '{OutboundRule}'}, - 'status': {'key': 'status', 'type': 'ManagedNetworkProvisionStatus'}, + "isolation_mode": {"key": "isolationMode", "type": "str"}, + "network_id": {"key": "networkId", "type": "str"}, + "outbound_rules": {"key": "outboundRules", "type": "{OutboundRule}"}, + "status": {"key": "status", "type": "ManagedNetworkProvisionStatus"}, } def __init__( @@ -19971,28 +21514,43 @@ class ManagedOnlineDeployment(OnlineDeploymentProperties): """ _validation = { - 'endpoint_compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, + "endpoint_compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'code_configuration': {'key': 'codeConfiguration', 'type': 'CodeConfiguration'}, - 'description': {'key': 'description', 'type': 'str'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'app_insights_enabled': {'key': 'appInsightsEnabled', 'type': 'bool'}, - 'data_collector': {'key': 'dataCollector', 'type': 'DataCollector'}, - 'egress_public_network_access': {'key': 'egressPublicNetworkAccess', 'type': 'str'}, - 'endpoint_compute_type': {'key': 'endpointComputeType', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, - 'model': {'key': 'model', 'type': 'str'}, - 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, - 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, - 'scale_settings': {'key': 'scaleSettings', 'type': 'OnlineScaleSettings'}, + "code_configuration": { + "key": "codeConfiguration", + "type": "CodeConfiguration", + }, + "description": {"key": "description", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "properties": {"key": "properties", "type": "{str}"}, + "app_insights_enabled": {"key": "appInsightsEnabled", "type": "bool"}, + "data_collector": {"key": "dataCollector", "type": "DataCollector"}, + "egress_public_network_access": { + "key": "egressPublicNetworkAccess", + "type": "str", + }, + "endpoint_compute_type": {"key": "endpointComputeType", "type": "str"}, + "instance_type": {"key": "instanceType", "type": "str"}, + "liveness_probe": {"key": "livenessProbe", "type": "ProbeSettings"}, + "model": {"key": "model", "type": "str"}, + "model_mount_path": {"key": "modelMountPath", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "readiness_probe": {"key": "readinessProbe", "type": "ProbeSettings"}, + "request_settings": { + "key": "requestSettings", + "type": "OnlineRequestSettings", + }, + "scale_settings": { + "key": "scaleSettings", + "type": "OnlineScaleSettings", + }, } def __init__( @@ -20005,7 +21563,9 @@ def __init__( properties: Optional[Dict[str, str]] = None, app_insights_enabled: Optional[bool] = False, data_collector: Optional["DataCollector"] = None, - egress_public_network_access: Optional[Union[str, "EgressPublicNetworkAccessType"]] = None, + egress_public_network_access: Optional[ + Union[str, "EgressPublicNetworkAccessType"] + ] = None, instance_type: Optional[str] = None, liveness_probe: Optional["ProbeSettings"] = None, model: Optional[str] = None, @@ -20055,8 +21615,25 @@ def __init__( and to DefaultScaleSettings for ManagedOnlineDeployment. :paramtype scale_settings: ~azure.mgmt.machinelearningservices.models.OnlineScaleSettings """ - super(ManagedOnlineDeployment, self).__init__(code_configuration=code_configuration, description=description, environment_id=environment_id, environment_variables=environment_variables, properties=properties, app_insights_enabled=app_insights_enabled, data_collector=data_collector, egress_public_network_access=egress_public_network_access, instance_type=instance_type, liveness_probe=liveness_probe, model=model, model_mount_path=model_mount_path, readiness_probe=readiness_probe, request_settings=request_settings, scale_settings=scale_settings, **kwargs) - self.endpoint_compute_type = 'Managed' # type: str + super(ManagedOnlineDeployment, self).__init__( + code_configuration=code_configuration, + description=description, + environment_id=environment_id, + environment_variables=environment_variables, + properties=properties, + app_insights_enabled=app_insights_enabled, + data_collector=data_collector, + egress_public_network_access=egress_public_network_access, + instance_type=instance_type, + liveness_probe=liveness_probe, + model=model, + model_mount_path=model_mount_path, + readiness_probe=readiness_probe, + request_settings=request_settings, + scale_settings=scale_settings, + **kwargs + ) + self.endpoint_compute_type = "Managed" # type: str class ManagedServiceIdentity(msrest.serialization.Model): @@ -20085,23 +21662,28 @@ class ManagedServiceIdentity(msrest.serialization.Model): """ _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, + "principal_id": {"readonly": True}, + "tenant_id": {"readonly": True}, + "type": {"required": True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{UserAssignedIdentity}", + }, } def __init__( self, *, type: Union[str, "ManagedServiceIdentityType"], - user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, + user_assigned_identities: Optional[ + Dict[str, "UserAssignedIdentity"] + ] = None, **kwargs ): """ @@ -20149,23 +21731,28 @@ class ManagedServiceIdentityAutoGenerated(msrest.serialization.Model): """ _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, + "principal_id": {"readonly": True}, + "tenant_id": {"readonly": True}, + "type": {"required": True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{UserAssignedIdentity}", + }, } def __init__( self, *, type: Union[str, "ManagedServiceIdentityType"], - user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, + user_assigned_identities: Optional[ + Dict[str, "UserAssignedIdentity"] + ] = None, **kwargs ): """ @@ -20195,15 +21782,10 @@ class MaterializationComputeResource(msrest.serialization.Model): """ _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, + "instance_type": {"key": "instanceType", "type": "str"}, } - def __init__( - self, - *, - instance_type: Optional[str] = None, - **kwargs - ): + def __init__(self, *, instance_type: Optional[str] = None, **kwargs): """ :keyword instance_type: Specifies the instance type. :paramtype instance_type: str @@ -20229,11 +21811,14 @@ class MaterializationSettings(msrest.serialization.Model): """ _attribute_map = { - 'notification': {'key': 'notification', 'type': 'NotificationSetting'}, - 'resource': {'key': 'resource', 'type': 'MaterializationComputeResource'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceTrigger'}, - 'spark_configuration': {'key': 'sparkConfiguration', 'type': '{str}'}, - 'store_type': {'key': 'storeType', 'type': 'str'}, + "notification": {"key": "notification", "type": "NotificationSetting"}, + "resource": { + "key": "resource", + "type": "MaterializationComputeResource", + }, + "schedule": {"key": "schedule", "type": "RecurrenceTrigger"}, + "spark_configuration": {"key": "sparkConfiguration", "type": "{str}"}, + "store_type": {"key": "storeType", "type": "str"}, } def __init__( @@ -20284,13 +21869,13 @@ class MedianStoppingPolicy(EarlyTerminationPolicy): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, } def __init__( @@ -20306,8 +21891,12 @@ def __init__( :keyword evaluation_interval: Interval (number of runs) between policy evaluations. :paramtype evaluation_interval: int """ - super(MedianStoppingPolicy, self).__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs) - self.policy_type = 'MedianStopping' # type: str + super(MedianStoppingPolicy, self).__init__( + delay_evaluation=delay_evaluation, + evaluation_interval=evaluation_interval, + **kwargs + ) + self.policy_type = "MedianStopping" # type: str class MLAssistConfiguration(msrest.serialization.Model): @@ -20324,23 +21913,22 @@ class MLAssistConfiguration(msrest.serialization.Model): """ _validation = { - 'ml_assist': {'required': True}, + "ml_assist": {"required": True}, } _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, + "ml_assist": {"key": "mlAssist", "type": "str"}, } _subtype_map = { - 'ml_assist': {'Disabled': 'MLAssistConfigurationDisabled', 'Enabled': 'MLAssistConfigurationEnabled'} + "ml_assist": { + "Disabled": "MLAssistConfigurationDisabled", + "Enabled": "MLAssistConfigurationEnabled", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(MLAssistConfiguration, self).__init__(**kwargs) self.ml_assist = None # type: Optional[str] @@ -20356,21 +21944,17 @@ class MLAssistConfigurationDisabled(MLAssistConfiguration): """ _validation = { - 'ml_assist': {'required': True}, + "ml_assist": {"required": True}, } _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, + "ml_assist": {"key": "mlAssist", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(MLAssistConfigurationDisabled, self).__init__(**kwargs) - self.ml_assist = 'Disabled' # type: str + self.ml_assist = "Disabled" # type: str class MLAssistConfigurationEnabled(MLAssistConfiguration): @@ -20389,15 +21973,29 @@ class MLAssistConfigurationEnabled(MLAssistConfiguration): """ _validation = { - 'ml_assist': {'required': True}, - 'inferencing_compute_binding': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'training_compute_binding': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "ml_assist": {"required": True}, + "inferencing_compute_binding": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "training_compute_binding": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'ml_assist': {'key': 'mlAssist', 'type': 'str'}, - 'inferencing_compute_binding': {'key': 'inferencingComputeBinding', 'type': 'str'}, - 'training_compute_binding': {'key': 'trainingComputeBinding', 'type': 'str'}, + "ml_assist": {"key": "mlAssist", "type": "str"}, + "inferencing_compute_binding": { + "key": "inferencingComputeBinding", + "type": "str", + }, + "training_compute_binding": { + "key": "trainingComputeBinding", + "type": "str", + }, } def __init__( @@ -20415,7 +22013,7 @@ def __init__( :paramtype training_compute_binding: str """ super(MLAssistConfigurationEnabled, self).__init__(**kwargs) - self.ml_assist = 'Enabled' # type: str + self.ml_assist = "Enabled" # type: str self.inferencing_compute_binding = inferencing_compute_binding self.training_compute_binding = training_compute_binding @@ -20439,15 +22037,15 @@ class MLFlowModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "min_length": 1, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -20467,10 +22065,12 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(MLFlowModelJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(MLFlowModelJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'mlflow_model' # type: str + self.job_input_type = "mlflow_model" # type: str self.description = description @@ -20499,17 +22099,20 @@ class MLFlowModelJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "asset_name": {"key": "assetName", "type": "str"}, + "asset_version": {"key": "assetVersion", "type": "str"}, + "auto_delete_setting": { + "key": "autoDeleteSetting", + "type": "AutoDeleteSetting", + }, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -20538,13 +22141,21 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(MLFlowModelJobOutput, self).__init__(description=description, asset_name=asset_name, asset_version=asset_version, auto_delete_setting=auto_delete_setting, mode=mode, uri=uri, **kwargs) + super(MLFlowModelJobOutput, self).__init__( + description=description, + asset_name=asset_name, + asset_version=asset_version, + auto_delete_setting=auto_delete_setting, + mode=mode, + uri=uri, + **kwargs + ) self.asset_name = asset_name self.asset_version = asset_version self.auto_delete_setting = auto_delete_setting self.mode = mode self.uri = uri - self.job_output_type = 'mlflow_model' # type: str + self.job_output_type = "mlflow_model" # type: str self.description = description @@ -20583,22 +22194,32 @@ class MLTableData(DataVersionBaseProperties): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, - 'referenced_uris': {'key': 'referencedUris', 'type': '[str]'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "auto_delete_setting": { + "key": "autoDeleteSetting", + "type": "AutoDeleteSetting", + }, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, + "intellectual_property": { + "key": "intellectualProperty", + "type": "IntellectualProperty", + }, + "stage": {"key": "stage", "type": "str"}, + "referenced_uris": {"key": "referencedUris", "type": "[str]"}, } def __init__( @@ -20643,8 +22264,19 @@ def __init__( :keyword referenced_uris: Uris referenced in the MLTable definition (required for lineage). :paramtype referenced_uris: list[str] """ - super(MLTableData, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, intellectual_property=intellectual_property, stage=stage, **kwargs) - self.data_type = 'mltable' # type: str + super(MLTableData, self).__init__( + description=description, + properties=properties, + tags=tags, + auto_delete_setting=auto_delete_setting, + is_anonymous=is_anonymous, + is_archived=is_archived, + data_uri=data_uri, + intellectual_property=intellectual_property, + stage=stage, + **kwargs + ) + self.data_type = "mltable" # type: str self.referenced_uris = referenced_uris @@ -20667,15 +22299,15 @@ class MLTableJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "min_length": 1, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -20695,10 +22327,12 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(MLTableJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(MLTableJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'mltable' # type: str + self.job_input_type = "mltable" # type: str self.description = description @@ -20727,17 +22361,20 @@ class MLTableJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "asset_name": {"key": "assetName", "type": "str"}, + "asset_version": {"key": "assetVersion", "type": "str"}, + "auto_delete_setting": { + "key": "autoDeleteSetting", + "type": "AutoDeleteSetting", + }, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -20766,13 +22403,21 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(MLTableJobOutput, self).__init__(description=description, asset_name=asset_name, asset_version=asset_version, auto_delete_setting=auto_delete_setting, mode=mode, uri=uri, **kwargs) + super(MLTableJobOutput, self).__init__( + description=description, + asset_name=asset_name, + asset_version=asset_version, + auto_delete_setting=auto_delete_setting, + mode=mode, + uri=uri, + **kwargs + ) self.asset_name = asset_name self.asset_version = asset_version self.auto_delete_setting = auto_delete_setting self.mode = mode self.uri = uri - self.job_output_type = 'mltable' # type: str + self.job_output_type = "mltable" # type: str self.description = description @@ -20787,8 +22432,8 @@ class ModelConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "mount_path": {"key": "mountPath", "type": "str"}, } def __init__( @@ -20833,27 +22478,25 @@ class ModelContainer(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelContainerProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "ModelContainerProperties", + }, } - def __init__( - self, - *, - properties: "ModelContainerProperties", - **kwargs - ): + def __init__(self, *, properties: "ModelContainerProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelContainerProperties @@ -20886,19 +22529,19 @@ class ModelContainerProperties(AssetContainer): """ _validation = { - 'latest_version': {'readonly': True}, - 'next_version': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "latest_version": {"readonly": True}, + "next_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'next_version': {'key': 'nextVersion', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "latest_version": {"key": "latestVersion", "type": "str"}, + "next_version": {"key": "nextVersion", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } def __init__( @@ -20920,7 +22563,13 @@ def __init__( :keyword is_archived: Is the asset archived?. :paramtype is_archived: bool """ - super(ModelContainerProperties, self).__init__(description=description, properties=properties, tags=tags, is_archived=is_archived, **kwargs) + super(ModelContainerProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + is_archived=is_archived, + **kwargs + ) self.provisioning_state = None @@ -20935,8 +22584,8 @@ class ModelContainerResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelContainer]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ModelContainer]"}, } def __init__( @@ -20953,7 +22602,9 @@ def __init__( :keyword value: An array of objects of type ModelContainer. :paramtype value: list[~azure.mgmt.machinelearningservices.models.ModelContainer] """ - super(ModelContainerResourceArmPaginatedResult, self).__init__(**kwargs) + super(ModelContainerResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -20976,15 +22627,15 @@ class ModelPackageInput(msrest.serialization.Model): """ _validation = { - 'input_type': {'required': True}, - 'path': {'required': True}, + "input_type": {"required": True}, + "path": {"required": True}, } _attribute_map = { - 'input_type': {'key': 'inputType', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'mount_path': {'key': 'mountPath', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'PackageInputPathBase'}, + "input_type": {"key": "inputType", "type": "str"}, + "mode": {"key": "mode", "type": "str"}, + "mount_path": {"key": "mountPath", "type": "str"}, + "path": {"key": "path", "type": "PackageInputPathBase"}, } def __init__( @@ -21044,20 +22695,29 @@ class ModelPerformanceSignalBase(MonitoringSignalBase): """ _validation = { - 'signal_type': {'required': True}, - 'baseline_data': {'required': True}, - 'metric_threshold': {'required': True}, - 'target_data': {'required': True}, + "signal_type": {"required": True}, + "baseline_data": {"required": True}, + "metric_threshold": {"required": True}, + "target_data": {"required": True}, } _attribute_map = { - 'lookback_period': {'key': 'lookbackPeriod', 'type': 'duration'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'baseline_data': {'key': 'baselineData', 'type': 'MonitoringInputData'}, - 'data_segment': {'key': 'dataSegment', 'type': 'MonitoringDataSegment'}, - 'metric_threshold': {'key': 'metricThreshold', 'type': 'ModelPerformanceMetricThresholdBase'}, - 'target_data': {'key': 'targetData', 'type': 'MonitoringInputData'}, + "lookback_period": {"key": "lookbackPeriod", "type": "duration"}, + "mode": {"key": "mode", "type": "str"}, + "signal_type": {"key": "signalType", "type": "str"}, + "baseline_data": { + "key": "baselineData", + "type": "MonitoringInputData", + }, + "data_segment": { + "key": "dataSegment", + "type": "MonitoringDataSegment", + }, + "metric_threshold": { + "key": "metricThreshold", + "type": "ModelPerformanceMetricThresholdBase", + }, + "target_data": {"key": "targetData", "type": "MonitoringInputData"}, } def __init__( @@ -21090,8 +22750,10 @@ def __init__( drift will be calculated for. :paramtype target_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData """ - super(ModelPerformanceSignalBase, self).__init__(lookback_period=lookback_period, mode=mode, **kwargs) - self.signal_type = 'ModelPerformanceSignalBase' # type: str + super(ModelPerformanceSignalBase, self).__init__( + lookback_period=lookback_period, mode=mode, **kwargs + ) + self.signal_type = "ModelPerformanceSignalBase" # type: str self.baseline_data = baseline_data self.data_segment = data_segment self.metric_threshold = metric_threshold @@ -21121,27 +22783,22 @@ class ModelVersion(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ModelVersionProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "ModelVersionProperties"}, } - def __init__( - self, - *, - properties: "ModelVersionProperties", - **kwargs - ): + def __init__(self, *, properties: "ModelVersionProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ModelVersionProperties @@ -21189,23 +22846,29 @@ class ModelVersionProperties(AssetBase): """ _validation = { - 'provisioning_state': {'readonly': True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'flavors': {'key': 'flavors', 'type': '{FlavorData}'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'job_name': {'key': 'jobName', 'type': 'str'}, - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'model_uri': {'key': 'modelUri', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'stage': {'key': 'stage', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "auto_delete_setting": { + "key": "autoDeleteSetting", + "type": "AutoDeleteSetting", + }, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "flavors": {"key": "flavors", "type": "{FlavorData}"}, + "intellectual_property": { + "key": "intellectualProperty", + "type": "IntellectualProperty", + }, + "job_name": {"key": "jobName", "type": "str"}, + "model_type": {"key": "modelType", "type": "str"}, + "model_uri": {"key": "modelUri", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "stage": {"key": "stage", "type": "str"}, } def __init__( @@ -21255,7 +22918,15 @@ def __init__( :keyword stage: Stage in the model lifecycle assigned to this model. :paramtype stage: str """ - super(ModelVersionProperties, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, **kwargs) + super(ModelVersionProperties, self).__init__( + description=description, + properties=properties, + tags=tags, + auto_delete_setting=auto_delete_setting, + is_anonymous=is_anonymous, + is_archived=is_archived, + **kwargs + ) self.flavors = flavors self.intellectual_property = intellectual_property self.job_name = job_name @@ -21276,8 +22947,8 @@ class ModelVersionResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[ModelVersion]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ModelVersion]"}, } def __init__( @@ -21318,15 +22989,22 @@ class MonitorDefinition(msrest.serialization.Model): """ _validation = { - 'compute_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'signals': {'required': True}, + "compute_id": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "signals": {"required": True}, } _attribute_map = { - 'alert_notification_setting': {'key': 'alertNotificationSetting', 'type': 'MonitoringAlertNotificationSettingsBase'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'monitoring_target': {'key': 'monitoringTarget', 'type': 'str'}, - 'signals': {'key': 'signals', 'type': '{MonitoringSignalBase}'}, + "alert_notification_setting": { + "key": "alertNotificationSetting", + "type": "MonitoringAlertNotificationSettingsBase", + }, + "compute_id": {"key": "computeId", "type": "str"}, + "monitoring_target": {"key": "monitoringTarget", "type": "str"}, + "signals": {"key": "signals", "type": "{MonitoringSignalBase}"}, } def __init__( @@ -21334,7 +23012,9 @@ def __init__( *, compute_id: str, signals: Dict[str, "MonitoringSignalBase"], - alert_notification_setting: Optional["MonitoringAlertNotificationSettingsBase"] = None, + alert_notification_setting: Optional[ + "MonitoringAlertNotificationSettingsBase" + ] = None, monitoring_target: Optional[str] = None, **kwargs ): @@ -21368,8 +23048,8 @@ class MonitoringDataSegment(msrest.serialization.Model): """ _attribute_map = { - 'feature': {'key': 'feature', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[str]'}, + "feature": {"key": "feature", "type": "str"}, + "values": {"key": "values", "type": "[str]"}, } def __init__( @@ -21409,14 +23089,17 @@ class MonitoringInputData(msrest.serialization.Model): """ _validation = { - 'data_context': {'required': True}, + "data_context": {"required": True}, } _attribute_map = { - 'asset': {'key': 'asset', 'type': 'object'}, - 'data_context': {'key': 'dataContext', 'type': 'str'}, - 'preprocessing_component_id': {'key': 'preprocessingComponentId', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, + "asset": {"key": "asset", "type": "object"}, + "data_context": {"key": "dataContext", "type": "str"}, + "preprocessing_component_id": { + "key": "preprocessingComponentId", + "type": "str", + }, + "target_column_name": {"key": "targetColumnName", "type": "str"}, } def __init__( @@ -21456,15 +23139,10 @@ class MonitoringThreshold(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': 'float'}, + "value": {"key": "value", "type": "float"}, } - def __init__( - self, - *, - value: Optional[float] = None, - **kwargs - ): + def __init__(self, *, value: Optional[float] = None, **kwargs): """ :keyword value: The threshold value. If null, the set default is dependent on the metric type. :paramtype value: float @@ -21487,26 +23165,26 @@ class Mpi(DistributionConfiguration): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, + "distribution_type": {"key": "distributionType", "type": "str"}, + "process_count_per_instance": { + "key": "processCountPerInstance", + "type": "int", + }, } def __init__( - self, - *, - process_count_per_instance: Optional[int] = None, - **kwargs + self, *, process_count_per_instance: Optional[int] = None, **kwargs ): """ :keyword process_count_per_instance: Number of processes per MPI node. :paramtype process_count_per_instance: int """ super(Mpi, self).__init__(**kwargs) - self.distribution_type = 'Mpi' # type: str + self.distribution_type = "Mpi" # type: str self.process_count_per_instance = process_count_per_instance @@ -21538,15 +23216,21 @@ class NlpFixedParameters(msrest.serialization.Model): """ _attribute_map = { - 'gradient_accumulation_steps': {'key': 'gradientAccumulationSteps', 'type': 'int'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'int'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'int'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'int'}, - 'warmup_ratio': {'key': 'warmupRatio', 'type': 'float'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'float'}, + "gradient_accumulation_steps": { + "key": "gradientAccumulationSteps", + "type": "int", + }, + "learning_rate": {"key": "learningRate", "type": "float"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "int"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "int"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "int"}, + "warmup_ratio": {"key": "warmupRatio", "type": "float"}, + "weight_decay": {"key": "weightDecay", "type": "float"}, } def __init__( @@ -21554,7 +23238,9 @@ def __init__( *, gradient_accumulation_steps: Optional[int] = None, learning_rate: Optional[float] = None, - learning_rate_scheduler: Optional[Union[str, "NlpLearningRateScheduler"]] = None, + learning_rate_scheduler: Optional[ + Union[str, "NlpLearningRateScheduler"] + ] = None, model_name: Optional[str] = None, number_of_epochs: Optional[int] = None, training_batch_size: Optional[int] = None, @@ -21625,15 +23311,21 @@ class NlpParameterSubspace(msrest.serialization.Model): """ _attribute_map = { - 'gradient_accumulation_steps': {'key': 'gradientAccumulationSteps', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'learning_rate_scheduler': {'key': 'learningRateScheduler', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'number_of_epochs': {'key': 'numberOfEpochs', 'type': 'str'}, - 'training_batch_size': {'key': 'trainingBatchSize', 'type': 'str'}, - 'validation_batch_size': {'key': 'validationBatchSize', 'type': 'str'}, - 'warmup_ratio': {'key': 'warmupRatio', 'type': 'str'}, - 'weight_decay': {'key': 'weightDecay', 'type': 'str'}, + "gradient_accumulation_steps": { + "key": "gradientAccumulationSteps", + "type": "str", + }, + "learning_rate": {"key": "learningRate", "type": "str"}, + "learning_rate_scheduler": { + "key": "learningRateScheduler", + "type": "str", + }, + "model_name": {"key": "modelName", "type": "str"}, + "number_of_epochs": {"key": "numberOfEpochs", "type": "str"}, + "training_batch_size": {"key": "trainingBatchSize", "type": "str"}, + "validation_batch_size": {"key": "validationBatchSize", "type": "str"}, + "warmup_ratio": {"key": "warmupRatio", "type": "str"}, + "weight_decay": {"key": "weightDecay", "type": "str"}, } def __init__( @@ -21698,12 +23390,15 @@ class NlpSweepSettings(msrest.serialization.Model): """ _validation = { - 'sampling_algorithm': {'required': True}, + "sampling_algorithm": {"required": True}, } _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, + "sampling_algorithm": {"key": "samplingAlgorithm", "type": "str"}, } def __init__( @@ -21728,38 +23423,55 @@ def __init__( class NlpVertical(msrest.serialization.Model): """Abstract class for NLP related AutoML tasks. -NLP - Natural Language Processing. - - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - """ - - _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - } + NLP - Natural Language Processing. - def __init__( - self, - *, - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar fixed_parameters: Model/training parameters that will remain constant throughout + training. + :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] + :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + """ + + _attribute_map = { + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "NlpFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "search_space": { + "key": "searchSpace", + "type": "[NlpParameterSubspace]", + }, + "sweep_settings": {"key": "sweepSettings", "type": "NlpSweepSettings"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + } + + def __init__( + self, + *, + featurization_settings: Optional[ + "NlpVerticalFeaturizationSettings" + ] = None, fixed_parameters: Optional["NlpFixedParameters"] = None, limit_settings: Optional["NlpVerticalLimitSettings"] = None, search_space: Optional[List["NlpParameterSubspace"]] = None, @@ -21801,20 +23513,17 @@ class NlpVerticalFeaturizationSettings(FeaturizationSettings): """ _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, + "dataset_language": {"key": "datasetLanguage", "type": "str"}, } - def __init__( - self, - *, - dataset_language: Optional[str] = None, - **kwargs - ): + def __init__(self, *, dataset_language: Optional[str] = None, **kwargs): """ :keyword dataset_language: Dataset language, useful for the text data. :paramtype dataset_language: str """ - super(NlpVerticalFeaturizationSettings, self).__init__(dataset_language=dataset_language, **kwargs) + super(NlpVerticalFeaturizationSettings, self).__init__( + dataset_language=dataset_language, **kwargs + ) class NlpVerticalLimitSettings(msrest.serialization.Model): @@ -21833,11 +23542,11 @@ class NlpVerticalLimitSettings(msrest.serialization.Model): """ _attribute_map = { - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_nodes': {'key': 'maxNodes', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_nodes": {"key": "maxNodes", "type": "int"}, + "max_trials": {"key": "maxTrials", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, + "trial_timeout": {"key": "trialTimeout", "type": "duration"}, } def __init__( @@ -21890,29 +23599,25 @@ class NodeStateCounts(msrest.serialization.Model): """ _validation = { - 'idle_node_count': {'readonly': True}, - 'running_node_count': {'readonly': True}, - 'preparing_node_count': {'readonly': True}, - 'unusable_node_count': {'readonly': True}, - 'leaving_node_count': {'readonly': True}, - 'preempted_node_count': {'readonly': True}, + "idle_node_count": {"readonly": True}, + "running_node_count": {"readonly": True}, + "preparing_node_count": {"readonly": True}, + "unusable_node_count": {"readonly": True}, + "leaving_node_count": {"readonly": True}, + "preempted_node_count": {"readonly": True}, } _attribute_map = { - 'idle_node_count': {'key': 'idleNodeCount', 'type': 'int'}, - 'running_node_count': {'key': 'runningNodeCount', 'type': 'int'}, - 'preparing_node_count': {'key': 'preparingNodeCount', 'type': 'int'}, - 'unusable_node_count': {'key': 'unusableNodeCount', 'type': 'int'}, - 'leaving_node_count': {'key': 'leavingNodeCount', 'type': 'int'}, - 'preempted_node_count': {'key': 'preemptedNodeCount', 'type': 'int'}, + "idle_node_count": {"key": "idleNodeCount", "type": "int"}, + "running_node_count": {"key": "runningNodeCount", "type": "int"}, + "preparing_node_count": {"key": "preparingNodeCount", "type": "int"}, + "unusable_node_count": {"key": "unusableNodeCount", "type": "int"}, + "leaving_node_count": {"key": "leavingNodeCount", "type": "int"}, + "preempted_node_count": {"key": "preemptedNodeCount", "type": "int"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NodeStateCounts, self).__init__(**kwargs) self.idle_node_count = None self.running_node_count = None @@ -21922,7 +23627,9 @@ def __init__( self.preempted_node_count = None -class NoneAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class NoneAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """NoneAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -21946,16 +23653,16 @@ class NoneAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2) """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, + "auth_type": {"key": "authType", "type": "str"}, + "expiry_time": {"key": "expiryTime", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, } def __init__( @@ -21983,8 +23690,15 @@ def __init__( "JSON". :paramtype value_format: str or ~azure.mgmt.machinelearningservices.models.ValueFormat """ - super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__(expiry_time=expiry_time, category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'None' # type: str + super(NoneAuthTypeWorkspaceConnectionProperties, self).__init__( + expiry_time=expiry_time, + category=category, + target=target, + value=value, + value_format=value_format, + **kwargs + ) + self.auth_type = "None" # type: str class NoneDatastoreCredentials(DatastoreCredentials): @@ -21999,21 +23713,17 @@ class NoneDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, + "credentials_type": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NoneDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'None' # type: str + self.credentials_type = "None" # type: str class NotebookAccessTokenResult(msrest.serialization.Model): @@ -22040,33 +23750,29 @@ class NotebookAccessTokenResult(msrest.serialization.Model): """ _validation = { - 'notebook_resource_id': {'readonly': True}, - 'host_name': {'readonly': True}, - 'public_dns': {'readonly': True}, - 'access_token': {'readonly': True}, - 'token_type': {'readonly': True}, - 'expires_in': {'readonly': True}, - 'refresh_token': {'readonly': True}, - 'scope': {'readonly': True}, + "notebook_resource_id": {"readonly": True}, + "host_name": {"readonly": True}, + "public_dns": {"readonly": True}, + "access_token": {"readonly": True}, + "token_type": {"readonly": True}, + "expires_in": {"readonly": True}, + "refresh_token": {"readonly": True}, + "scope": {"readonly": True}, } _attribute_map = { - 'notebook_resource_id': {'key': 'notebookResourceId', 'type': 'str'}, - 'host_name': {'key': 'hostName', 'type': 'str'}, - 'public_dns': {'key': 'publicDns', 'type': 'str'}, - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'token_type': {'key': 'tokenType', 'type': 'str'}, - 'expires_in': {'key': 'expiresIn', 'type': 'int'}, - 'refresh_token': {'key': 'refreshToken', 'type': 'str'}, - 'scope': {'key': 'scope', 'type': 'str'}, + "notebook_resource_id": {"key": "notebookResourceId", "type": "str"}, + "host_name": {"key": "hostName", "type": "str"}, + "public_dns": {"key": "publicDns", "type": "str"}, + "access_token": {"key": "accessToken", "type": "str"}, + "token_type": {"key": "tokenType", "type": "str"}, + "expires_in": {"key": "expiresIn", "type": "int"}, + "refresh_token": {"key": "refreshToken", "type": "str"}, + "scope": {"key": "scope", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(NotebookAccessTokenResult, self).__init__(**kwargs) self.notebook_resource_id = None self.host_name = None @@ -22088,8 +23794,8 @@ class NotebookPreparationError(msrest.serialization.Model): """ _attribute_map = { - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'status_code': {'key': 'statusCode', 'type': 'int'}, + "error_message": {"key": "errorMessage", "type": "str"}, + "status_code": {"key": "statusCode", "type": "int"}, } def __init__( @@ -22123,9 +23829,12 @@ class NotebookResourceInfo(msrest.serialization.Model): """ _attribute_map = { - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'notebook_preparation_error': {'key': 'notebookPreparationError', 'type': 'NotebookPreparationError'}, + "fqdn": {"key": "fqdn", "type": "str"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "notebook_preparation_error": { + "key": "notebookPreparationError", + "type": "NotebookPreparationError", + }, } def __init__( @@ -22133,7 +23842,9 @@ def __init__( *, fqdn: Optional[str] = None, resource_id: Optional[str] = None, - notebook_preparation_error: Optional["NotebookPreparationError"] = None, + notebook_preparation_error: Optional[ + "NotebookPreparationError" + ] = None, **kwargs ): """ @@ -22166,15 +23877,17 @@ class NotificationSetting(msrest.serialization.Model): """ _attribute_map = { - 'email_on': {'key': 'emailOn', 'type': '[str]'}, - 'emails': {'key': 'emails', 'type': '[str]'}, - 'webhooks': {'key': 'webhooks', 'type': '{Webhook}'}, + "email_on": {"key": "emailOn", "type": "[str]"}, + "emails": {"key": "emails", "type": "[str]"}, + "webhooks": {"key": "webhooks", "type": "{Webhook}"}, } def __init__( self, *, - email_on: Optional[List[Union[str, "EmailNotificationEnableType"]]] = None, + email_on: Optional[ + List[Union[str, "EmailNotificationEnableType"]] + ] = None, emails: Optional[List[str]] = None, webhooks: Optional[Dict[str, "Webhook"]] = None, **kwargs @@ -22214,14 +23927,14 @@ class NumericalDataDriftMetricThreshold(DataDriftMetricThresholdBase): """ _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, + "data_type": {"required": True}, + "metric": {"required": True}, } _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, + "data_type": {"key": "dataType", "type": "str"}, + "threshold": {"key": "threshold", "type": "MonitoringThreshold"}, + "metric": {"key": "metric", "type": "str"}, } def __init__( @@ -22240,8 +23953,10 @@ def __init__( "NormalizedWassersteinDistance", "TwoSampleKolmogorovSmirnovTest". :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataDriftMetric """ - super(NumericalDataDriftMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.data_type = 'Numerical' # type: str + super(NumericalDataDriftMetricThreshold, self).__init__( + threshold=threshold, **kwargs + ) + self.data_type = "Numerical" # type: str self.metric = metric @@ -22262,14 +23977,14 @@ class NumericalDataQualityMetricThreshold(DataQualityMetricThresholdBase): """ _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, + "data_type": {"required": True}, + "metric": {"required": True}, } _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, + "data_type": {"key": "dataType", "type": "str"}, + "threshold": {"key": "threshold", "type": "MonitoringThreshold"}, + "metric": {"key": "metric", "type": "str"}, } def __init__( @@ -22287,12 +24002,16 @@ def __init__( values include: "NullValueRate", "DataTypeErrorRate", "OutOfBoundsRate". :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalDataQualityMetric """ - super(NumericalDataQualityMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.data_type = 'Numerical' # type: str + super(NumericalDataQualityMetricThreshold, self).__init__( + threshold=threshold, **kwargs + ) + self.data_type = "Numerical" # type: str self.metric = metric -class NumericalPredictionDriftMetricThreshold(PredictionDriftMetricThresholdBase): +class NumericalPredictionDriftMetricThreshold( + PredictionDriftMetricThresholdBase +): """NumericalPredictionDriftMetricThreshold. All required parameters must be populated in order to send to Azure. @@ -22311,14 +24030,14 @@ class NumericalPredictionDriftMetricThreshold(PredictionDriftMetricThresholdBase """ _validation = { - 'data_type': {'required': True}, - 'metric': {'required': True}, + "data_type": {"required": True}, + "metric": {"required": True}, } _attribute_map = { - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, + "data_type": {"key": "dataType", "type": "str"}, + "threshold": {"key": "threshold", "type": "MonitoringThreshold"}, + "metric": {"key": "metric", "type": "str"}, } def __init__( @@ -22338,8 +24057,10 @@ def __init__( :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.NumericalPredictionDriftMetric """ - super(NumericalPredictionDriftMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.data_type = 'Numerical' # type: str + super(NumericalPredictionDriftMetricThreshold, self).__init__( + threshold=threshold, **kwargs + ) + self.data_type = "Numerical" # type: str self.metric = metric @@ -22356,21 +24077,21 @@ class Objective(msrest.serialization.Model): """ _validation = { - 'goal': {'required': True}, - 'primary_metric': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "goal": {"required": True}, + "primary_metric": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'goal': {'key': 'goal', 'type': 'str'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "goal": {"key": "goal", "type": "str"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( - self, - *, - goal: Union[str, "Goal"], - primary_metric: str, - **kwargs + self, *, goal: Union[str, "Goal"], primary_metric: str, **kwargs ): """ :keyword goal: Required. [Required] Defines supported metric goals for hyperparameter tuning. @@ -22422,25 +24143,38 @@ class OneLakeDatastore(DatastoreProperties): """ _validation = { - 'credentials': {'required': True}, - 'datastore_type': {'required': True}, - 'is_default': {'readonly': True}, - 'artifact': {'required': True}, - 'one_lake_workspace_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "credentials": {"required": True}, + "datastore_type": {"required": True}, + "is_default": {"readonly": True}, + "artifact": {"required": True}, + "one_lake_workspace_name": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'credentials': {'key': 'credentials', 'type': 'DatastoreCredentials'}, - 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'is_default': {'key': 'isDefault', 'type': 'bool'}, - 'artifact': {'key': 'artifact', 'type': 'OneLakeArtifact'}, - 'endpoint': {'key': 'endpoint', 'type': 'str'}, - 'one_lake_workspace_name': {'key': 'oneLakeWorkspaceName', 'type': 'str'}, - 'service_data_access_auth_identity': {'key': 'serviceDataAccessAuthIdentity', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "credentials": {"key": "credentials", "type": "DatastoreCredentials"}, + "datastore_type": {"key": "datastoreType", "type": "str"}, + "intellectual_property": { + "key": "intellectualProperty", + "type": "IntellectualProperty", + }, + "is_default": {"key": "isDefault", "type": "bool"}, + "artifact": {"key": "artifact", "type": "OneLakeArtifact"}, + "endpoint": {"key": "endpoint", "type": "str"}, + "one_lake_workspace_name": { + "key": "oneLakeWorkspaceName", + "type": "str", + }, + "service_data_access_auth_identity": { + "key": "serviceDataAccessAuthIdentity", + "type": "str", + }, } def __init__( @@ -22454,7 +24188,9 @@ def __init__( tags: Optional[Dict[str, str]] = None, intellectual_property: Optional["IntellectualProperty"] = None, endpoint: Optional[str] = None, - service_data_access_auth_identity: Optional[Union[str, "ServiceDataAccessAuthIdentity"]] = None, + service_data_access_auth_identity: Optional[ + Union[str, "ServiceDataAccessAuthIdentity"] + ] = None, **kwargs ): """ @@ -22481,12 +24217,21 @@ def __init__( :paramtype service_data_access_auth_identity: str or ~azure.mgmt.machinelearningservices.models.ServiceDataAccessAuthIdentity """ - super(OneLakeDatastore, self).__init__(description=description, properties=properties, tags=tags, credentials=credentials, intellectual_property=intellectual_property, **kwargs) - self.datastore_type = 'OneLake' # type: str + super(OneLakeDatastore, self).__init__( + description=description, + properties=properties, + tags=tags, + credentials=credentials, + intellectual_property=intellectual_property, + **kwargs + ) + self.datastore_type = "OneLake" # type: str self.artifact = artifact self.endpoint = endpoint self.one_lake_workspace_name = one_lake_workspace_name - self.service_data_access_auth_identity = service_data_access_auth_identity + self.service_data_access_auth_identity = ( + service_data_access_auth_identity + ) class OnlineDeployment(TrackedResource): @@ -22523,25 +24268,28 @@ class OnlineDeployment(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineDeploymentProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": { + "key": "properties", + "type": "OnlineDeploymentProperties", + }, + "sku": {"key": "sku", "type": "Sku"}, } def __init__( @@ -22570,14 +24318,18 @@ def __init__( :keyword sku: Sku details required for ARM contract for Autoscaling. :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ - super(OnlineDeployment, self).__init__(tags=tags, location=location, **kwargs) + super(OnlineDeployment, self).__init__( + tags=tags, location=location, **kwargs + ) self.identity = identity self.kind = kind self.properties = properties self.sku = sku -class OnlineDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class OnlineDeploymentTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of OnlineDeployment entities. :ivar next_link: The link to the next page of OnlineDeployment objects. If null, there are no @@ -22588,8 +24340,8 @@ class OnlineDeploymentTrackedResourceArmPaginatedResult(msrest.serialization.Mod """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineDeployment]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[OnlineDeployment]"}, } def __init__( @@ -22606,7 +24358,9 @@ def __init__( :keyword value: An array of objects of type OnlineDeployment. :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineDeployment] """ - super(OnlineDeploymentTrackedResourceArmPaginatedResult, self).__init__(**kwargs) + super( + OnlineDeploymentTrackedResourceArmPaginatedResult, self + ).__init__(**kwargs) self.next_link = next_link self.value = value @@ -22645,25 +24399,28 @@ class OnlineEndpoint(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'OnlineEndpointProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "properties": { + "key": "properties", + "type": "OnlineEndpointProperties", + }, + "sku": {"key": "sku", "type": "Sku"}, } def __init__( @@ -22692,7 +24449,9 @@ def __init__( :keyword sku: Sku details required for ARM contract for Autoscaling. :paramtype sku: ~azure.mgmt.machinelearningservices.models.Sku """ - super(OnlineEndpoint, self).__init__(tags=tags, location=location, **kwargs) + super(OnlineEndpoint, self).__init__( + tags=tags, location=location, **kwargs + ) self.identity = identity self.kind = kind self.properties = properties @@ -22742,24 +24501,24 @@ class OnlineEndpointProperties(EndpointPropertiesBase): """ _validation = { - 'auth_mode': {'required': True}, - 'scoring_uri': {'readonly': True}, - 'swagger_uri': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "auth_mode": {"required": True}, + "scoring_uri": {"readonly": True}, + "swagger_uri": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'auth_mode': {'key': 'authMode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'keys': {'key': 'keys', 'type': 'EndpointAuthKeys'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'scoring_uri': {'key': 'scoringUri', 'type': 'str'}, - 'swagger_uri': {'key': 'swaggerUri', 'type': 'str'}, - 'compute': {'key': 'compute', 'type': 'str'}, - 'mirror_traffic': {'key': 'mirrorTraffic', 'type': '{int}'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, - 'traffic': {'key': 'traffic', 'type': '{int}'}, + "auth_mode": {"key": "authMode", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "keys": {"key": "keys", "type": "EndpointAuthKeys"}, + "properties": {"key": "properties", "type": "{str}"}, + "scoring_uri": {"key": "scoringUri", "type": "str"}, + "swagger_uri": {"key": "swaggerUri", "type": "str"}, + "compute": {"key": "compute", "type": "str"}, + "mirror_traffic": {"key": "mirrorTraffic", "type": "{int}"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "public_network_access": {"key": "publicNetworkAccess", "type": "str"}, + "traffic": {"key": "traffic", "type": "{int}"}, } def __init__( @@ -22771,7 +24530,9 @@ def __init__( properties: Optional[Dict[str, str]] = None, compute: Optional[str] = None, mirror_traffic: Optional[Dict[str, int]] = None, - public_network_access: Optional[Union[str, "PublicNetworkAccessType"]] = None, + public_network_access: Optional[ + Union[str, "PublicNetworkAccessType"] + ] = None, traffic: Optional[Dict[str, int]] = None, **kwargs ): @@ -22802,7 +24563,13 @@ def __init__( values need to sum to 100. :paramtype traffic: dict[str, int] """ - super(OnlineEndpointProperties, self).__init__(auth_mode=auth_mode, description=description, keys=keys, properties=properties, **kwargs) + super(OnlineEndpointProperties, self).__init__( + auth_mode=auth_mode, + description=description, + keys=keys, + properties=properties, + **kwargs + ) self.compute = compute self.mirror_traffic = mirror_traffic self.provisioning_state = None @@ -22810,7 +24577,9 @@ def __init__( self.traffic = traffic -class OnlineEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model): +class OnlineEndpointTrackedResourceArmPaginatedResult( + msrest.serialization.Model +): """A paginated list of OnlineEndpoint entities. :ivar next_link: The link to the next page of OnlineEndpoint objects. If null, there are no @@ -22821,8 +24590,8 @@ class OnlineEndpointTrackedResourceArmPaginatedResult(msrest.serialization.Model """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[OnlineEndpoint]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[OnlineEndpoint]"}, } def __init__( @@ -22839,7 +24608,9 @@ def __init__( :keyword value: An array of objects of type OnlineEndpoint. :paramtype value: list[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] """ - super(OnlineEndpointTrackedResourceArmPaginatedResult, self).__init__(**kwargs) + super(OnlineEndpointTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -22861,11 +24632,11 @@ class OnlineInferenceConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'configurations': {'key': 'configurations', 'type': '{str}'}, - 'entry_script': {'key': 'entryScript', 'type': 'str'}, - 'liveness_route': {'key': 'livenessRoute', 'type': 'Route'}, - 'readiness_route': {'key': 'readinessRoute', 'type': 'Route'}, - 'scoring_route': {'key': 'scoringRoute', 'type': 'Route'}, + "configurations": {"key": "configurations", "type": "{str}"}, + "entry_script": {"key": "entryScript", "type": "str"}, + "liveness_route": {"key": "livenessRoute", "type": "Route"}, + "readiness_route": {"key": "readinessRoute", "type": "Route"}, + "scoring_route": {"key": "scoringRoute", "type": "Route"}, } def __init__( @@ -22915,9 +24686,12 @@ class OnlineRequestSettings(msrest.serialization.Model): """ _attribute_map = { - 'max_concurrent_requests_per_instance': {'key': 'maxConcurrentRequestsPerInstance', 'type': 'int'}, - 'max_queue_wait': {'key': 'maxQueueWait', 'type': 'duration'}, - 'request_timeout': {'key': 'requestTimeout', 'type': 'duration'}, + "max_concurrent_requests_per_instance": { + "key": "maxConcurrentRequestsPerInstance", + "type": "int", + }, + "max_queue_wait": {"key": "maxQueueWait", "type": "duration"}, + "request_timeout": {"key": "requestTimeout", "type": "duration"}, } def __init__( @@ -22941,7 +24715,9 @@ def __init__( :paramtype request_timeout: ~datetime.timedelta """ super(OnlineRequestSettings, self).__init__(**kwargs) - self.max_concurrent_requests_per_instance = max_concurrent_requests_per_instance + self.max_concurrent_requests_per_instance = ( + max_concurrent_requests_per_instance + ) self.max_queue_wait = max_queue_wait self.request_timeout = request_timeout @@ -22970,27 +24746,22 @@ class OutboundRuleBasicResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'OutboundRule'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "OutboundRule"}, } - def __init__( - self, - *, - properties: "OutboundRule", - **kwargs - ): + def __init__(self, *, properties: "OutboundRule", **kwargs): """ :keyword properties: Required. Outbound Rule for the managed network of a machine learning workspace. @@ -23012,8 +24783,8 @@ class OutboundRuleListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[OutboundRuleBasicResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[OutboundRuleBasicResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( @@ -23051,13 +24822,13 @@ class OutputPathAssetReference(AssetReferenceBase): """ _validation = { - 'reference_type': {'required': True}, + "reference_type": {"required": True}, } _attribute_map = { - 'reference_type': {'key': 'referenceType', 'type': 'str'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, + "reference_type": {"key": "referenceType", "type": "str"}, + "job_id": {"key": "jobId", "type": "str"}, + "path": {"key": "path", "type": "str"}, } def __init__( @@ -23074,7 +24845,7 @@ def __init__( :paramtype path: str """ super(OutputPathAssetReference, self).__init__(**kwargs) - self.reference_type = 'OutputPath' # type: str + self.reference_type = "OutputPath" # type: str self.job_id = job_id self.path = path @@ -23093,23 +24864,23 @@ class PackageInputPathBase(msrest.serialization.Model): """ _validation = { - 'input_path_type': {'required': True}, + "input_path_type": {"required": True}, } _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, + "input_path_type": {"key": "inputPathType", "type": "str"}, } _subtype_map = { - 'input_path_type': {'PathId': 'PackageInputPathId', 'PathVersion': 'PackageInputPathVersion', 'Url': 'PackageInputPathUrl'} + "input_path_type": { + "PathId": "PackageInputPathId", + "PathVersion": "PackageInputPathVersion", + "Url": "PackageInputPathUrl", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(PackageInputPathBase, self).__init__(**kwargs) self.input_path_type = None # type: Optional[str] @@ -23127,26 +24898,21 @@ class PackageInputPathId(PackageInputPathBase): """ _validation = { - 'input_path_type': {'required': True}, + "input_path_type": {"required": True}, } _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, + "input_path_type": {"key": "inputPathType", "type": "str"}, + "resource_id": {"key": "resourceId", "type": "str"}, } - def __init__( - self, - *, - resource_id: Optional[str] = None, - **kwargs - ): + def __init__(self, *, resource_id: Optional[str] = None, **kwargs): """ :keyword resource_id: Input resource id. :paramtype resource_id: str """ super(PackageInputPathId, self).__init__(**kwargs) - self.input_path_type = 'PathId' # type: str + self.input_path_type = "PathId" # type: str self.resource_id = resource_id @@ -23163,26 +24929,21 @@ class PackageInputPathUrl(PackageInputPathBase): """ _validation = { - 'input_path_type': {'required': True}, + "input_path_type": {"required": True}, } _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - 'url': {'key': 'url', 'type': 'str'}, + "input_path_type": {"key": "inputPathType", "type": "str"}, + "url": {"key": "url", "type": "str"}, } - def __init__( - self, - *, - url: Optional[str] = None, - **kwargs - ): + def __init__(self, *, url: Optional[str] = None, **kwargs): """ :keyword url: Input path url. :paramtype url: str """ super(PackageInputPathUrl, self).__init__(**kwargs) - self.input_path_type = 'Url' # type: str + self.input_path_type = "Url" # type: str self.url = url @@ -23201,13 +24962,13 @@ class PackageInputPathVersion(PackageInputPathBase): """ _validation = { - 'input_path_type': {'required': True}, + "input_path_type": {"required": True}, } _attribute_map = { - 'input_path_type': {'key': 'inputPathType', 'type': 'str'}, - 'resource_name': {'key': 'resourceName', 'type': 'str'}, - 'resource_version': {'key': 'resourceVersion', 'type': 'str'}, + "input_path_type": {"key": "inputPathType", "type": "str"}, + "resource_name": {"key": "resourceName", "type": "str"}, + "resource_version": {"key": "resourceVersion", "type": "str"}, } def __init__( @@ -23224,7 +24985,7 @@ def __init__( :paramtype resource_version: str """ super(PackageInputPathVersion, self).__init__(**kwargs) - self.input_path_type = 'PathVersion' # type: str + self.input_path_type = "PathVersion" # type: str self.resource_name = resource_name self.resource_version = resource_version @@ -23255,19 +25016,41 @@ class PackageRequest(msrest.serialization.Model): """ _validation = { - 'inferencing_server': {'required': True}, - 'target_environment_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "inferencing_server": {"required": True}, + "target_environment_name": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'base_environment_source': {'key': 'baseEnvironmentSource', 'type': 'BaseEnvironmentSource'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inferencing_server': {'key': 'inferencingServer', 'type': 'InferencingServer'}, - 'inputs': {'key': 'inputs', 'type': '[ModelPackageInput]'}, - 'model_configuration': {'key': 'modelConfiguration', 'type': 'ModelConfiguration'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'target_environment_name': {'key': 'targetEnvironmentName', 'type': 'str'}, - 'target_environment_version': {'key': 'targetEnvironmentVersion', 'type': 'str'}, + "base_environment_source": { + "key": "baseEnvironmentSource", + "type": "BaseEnvironmentSource", + }, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "inferencing_server": { + "key": "inferencingServer", + "type": "InferencingServer", + }, + "inputs": {"key": "inputs", "type": "[ModelPackageInput]"}, + "model_configuration": { + "key": "modelConfiguration", + "type": "ModelConfiguration", + }, + "tags": {"key": "tags", "type": "{str}"}, + "target_environment_name": { + "key": "targetEnvironmentName", + "type": "str", + }, + "target_environment_version": { + "key": "targetEnvironmentVersion", + "type": "str", + }, } def __init__( @@ -23348,41 +25131,55 @@ class PackageResponse(msrest.serialization.Model): """ _validation = { - 'base_environment_source': {'readonly': True}, - 'build_id': {'readonly': True}, - 'build_state': {'readonly': True}, - 'environment_variables': {'readonly': True}, - 'inferencing_server': {'readonly': True}, - 'inputs': {'readonly': True}, - 'log_url': {'readonly': True}, - 'model_configuration': {'readonly': True}, - 'tags': {'readonly': True}, - 'target_environment_id': {'readonly': True}, - 'target_environment_name': {'readonly': True}, - 'target_environment_version': {'readonly': True}, - } - - _attribute_map = { - 'base_environment_source': {'key': 'baseEnvironmentSource', 'type': 'BaseEnvironmentSource'}, - 'build_id': {'key': 'buildId', 'type': 'str'}, - 'build_state': {'key': 'buildState', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'inferencing_server': {'key': 'inferencingServer', 'type': 'InferencingServer'}, - 'inputs': {'key': 'inputs', 'type': '[ModelPackageInput]'}, - 'log_url': {'key': 'logUrl', 'type': 'str'}, - 'model_configuration': {'key': 'modelConfiguration', 'type': 'ModelConfiguration'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'target_environment_id': {'key': 'targetEnvironmentId', 'type': 'str'}, - 'target_environment_name': {'key': 'targetEnvironmentName', 'type': 'str'}, - 'target_environment_version': {'key': 'targetEnvironmentVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ + "base_environment_source": {"readonly": True}, + "build_id": {"readonly": True}, + "build_state": {"readonly": True}, + "environment_variables": {"readonly": True}, + "inferencing_server": {"readonly": True}, + "inputs": {"readonly": True}, + "log_url": {"readonly": True}, + "model_configuration": {"readonly": True}, + "tags": {"readonly": True}, + "target_environment_id": {"readonly": True}, + "target_environment_name": {"readonly": True}, + "target_environment_version": {"readonly": True}, + } + + _attribute_map = { + "base_environment_source": { + "key": "baseEnvironmentSource", + "type": "BaseEnvironmentSource", + }, + "build_id": {"key": "buildId", "type": "str"}, + "build_state": {"key": "buildState", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "inferencing_server": { + "key": "inferencingServer", + "type": "InferencingServer", + }, + "inputs": {"key": "inputs", "type": "[ModelPackageInput]"}, + "log_url": {"key": "logUrl", "type": "str"}, + "model_configuration": { + "key": "modelConfiguration", + "type": "ModelConfiguration", + }, + "tags": {"key": "tags", "type": "{str}"}, + "target_environment_id": {"key": "targetEnvironmentId", "type": "str"}, + "target_environment_name": { + "key": "targetEnvironmentName", + "type": "str", + }, + "target_environment_version": { + "key": "targetEnvironmentVersion", + "type": "str", + }, + } + + def __init__(self, **kwargs): + """ """ super(PackageResponse, self).__init__(**kwargs) self.base_environment_source = None self.build_id = None @@ -23408,8 +25205,8 @@ class PaginatedComputeResourcesList(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[ComputeResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[ComputeResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( @@ -23438,15 +25235,10 @@ class PartialBatchDeployment(msrest.serialization.Model): """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, } - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): + def __init__(self, *, description: Optional[str] = None, **kwargs): """ :keyword description: Description of the endpoint deployment. :paramtype description: str @@ -23455,7 +25247,9 @@ def __init__( self.description = description -class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties(msrest.serialization.Model): +class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties( + msrest.serialization.Model +): """Strictly used in update requests. :ivar properties: Additional attributes of the entity. @@ -23465,8 +25259,8 @@ class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties(msrest.s """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'PartialBatchDeployment'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "properties": {"key": "properties", "type": "PartialBatchDeployment"}, + "tags": {"key": "tags", "type": "{str}"}, } def __init__( @@ -23482,7 +25276,10 @@ def __init__( :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] """ - super(PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, self).__init__(**kwargs) + super( + PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, + self, + ).__init__(**kwargs) self.properties = properties self.tags = tags @@ -23496,7 +25293,10 @@ class PartialJobBase(msrest.serialization.Model): """ _attribute_map = { - 'notification_setting': {'key': 'notificationSetting', 'type': 'PartialNotificationSetting'}, + "notification_setting": { + "key": "notificationSetting", + "type": "PartialNotificationSetting", + }, } def __init__( @@ -23522,14 +25322,11 @@ class PartialJobBasePartialResource(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'PartialJobBase'}, + "properties": {"key": "properties", "type": "PartialJobBase"}, } def __init__( - self, - *, - properties: Optional["PartialJobBase"] = None, - **kwargs + self, *, properties: Optional["PartialJobBase"] = None, **kwargs ): """ :keyword properties: Additional attributes of the entity. @@ -23565,23 +25362,28 @@ class PartialManagedServiceIdentity(ManagedServiceIdentityAutoGenerated): """ _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, + "principal_id": {"readonly": True}, + "tenant_id": {"readonly": True}, + "type": {"required": True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{UserAssignedIdentity}", + }, } def __init__( self, *, type: Union[str, "ManagedServiceIdentityType"], - user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, + user_assigned_identities: Optional[ + Dict[str, "UserAssignedIdentity"] + ] = None, **kwargs ): """ @@ -23596,7 +25398,11 @@ def __init__( :paramtype user_assigned_identities: dict[str, ~azure.mgmt.machinelearningservices.models.UserAssignedIdentity] """ - super(PartialManagedServiceIdentity, self).__init__(type=type, user_assigned_identities=user_assigned_identities, **kwargs) + super(PartialManagedServiceIdentity, self).__init__( + type=type, + user_assigned_identities=user_assigned_identities, + **kwargs + ) class PartialManagedServiceIdentityAutoGenerated(msrest.serialization.Model): @@ -23614,8 +25420,11 @@ class PartialManagedServiceIdentityAutoGenerated(msrest.serialization.Model): """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{object}'}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{object}", + }, } def __init__( @@ -23636,7 +25445,9 @@ def __init__( The dictionary values can be empty objects ({}) in requests. :paramtype user_assigned_identities: dict[str, any] """ - super(PartialManagedServiceIdentityAutoGenerated, self).__init__(**kwargs) + super(PartialManagedServiceIdentityAutoGenerated, self).__init__( + **kwargs + ) self.type = type self.user_assigned_identities = user_assigned_identities @@ -23649,15 +25460,10 @@ class PartialMinimalTrackedResource(msrest.serialization.Model): """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): + def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs): """ :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] @@ -23677,15 +25483,20 @@ class PartialMinimalTrackedResourceWithIdentity(PartialMinimalTrackedResource): """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentityAutoGenerated'}, + "tags": {"key": "tags", "type": "{str}"}, + "identity": { + "key": "identity", + "type": "PartialManagedServiceIdentityAutoGenerated", + }, } def __init__( self, *, tags: Optional[Dict[str, str]] = None, - identity: Optional["PartialManagedServiceIdentityAutoGenerated"] = None, + identity: Optional[ + "PartialManagedServiceIdentityAutoGenerated" + ] = None, **kwargs ): """ @@ -23695,7 +25506,9 @@ def __init__( :paramtype identity: ~azure.mgmt.machinelearningservices.models.PartialManagedServiceIdentityAutoGenerated """ - super(PartialMinimalTrackedResourceWithIdentity, self).__init__(tags=tags, **kwargs) + super(PartialMinimalTrackedResourceWithIdentity, self).__init__( + tags=tags, **kwargs + ) self.identity = identity @@ -23709,8 +25522,8 @@ class PartialMinimalTrackedResourceWithSku(PartialMinimalTrackedResource): """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "PartialSku"}, } def __init__( @@ -23726,7 +25539,9 @@ def __init__( :keyword sku: Sku details required for ARM contract for Autoscaling. :paramtype sku: ~azure.mgmt.machinelearningservices.models.PartialSku """ - super(PartialMinimalTrackedResourceWithSku, self).__init__(tags=tags, **kwargs) + super(PartialMinimalTrackedResourceWithSku, self).__init__( + tags=tags, **kwargs + ) self.sku = sku @@ -23739,14 +25554,11 @@ class PartialNotificationSetting(msrest.serialization.Model): """ _attribute_map = { - 'webhooks': {'key': 'webhooks', 'type': '{Webhook}'}, + "webhooks": {"key": "webhooks", "type": "{Webhook}"}, } def __init__( - self, - *, - webhooks: Optional[Dict[str, "Webhook"]] = None, - **kwargs + self, *, webhooks: Optional[Dict[str, "Webhook"]] = None, **kwargs ): """ :keyword webhooks: Send webhook callback to a service. Key is a user-provided name for the @@ -23769,9 +25581,12 @@ class PartialRegistryPartialTrackedResource(msrest.serialization.Model): """ _attribute_map = { - 'identity': {'key': 'identity', 'type': 'PartialManagedServiceIdentity'}, - 'sku': {'key': 'sku', 'type': 'PartialSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "identity": { + "key": "identity", + "type": "PartialManagedServiceIdentity", + }, + "sku": {"key": "sku", "type": "PartialSku"}, + "tags": {"key": "tags", "type": "{str}"}, } def __init__( @@ -23817,11 +25632,11 @@ class PartialSku(msrest.serialization.Model): """ _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'int'}, - 'family': {'key': 'family', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, + "capacity": {"key": "capacity", "type": "int"}, + "family": {"key": "family", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "size": {"key": "size", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, } def __init__( @@ -23871,27 +25686,25 @@ class Password(msrest.serialization.Model): """ _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, + "name": {"readonly": True}, + "value": {"readonly": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "value": {"key": "value", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Password, self).__init__(**kwargs) self.name = None self.value = None -class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class PATAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """PATAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -23918,17 +25731,20 @@ class PATAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionPersonalAccessToken'}, + "auth_type": {"key": "authType", "type": "str"}, + "expiry_time": {"key": "expiryTime", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionPersonalAccessToken", + }, } def __init__( @@ -23960,8 +25776,15 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPersonalAccessToken """ - super(PATAuthTypeWorkspaceConnectionProperties, self).__init__(expiry_time=expiry_time, category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'PAT' # type: str + super(PATAuthTypeWorkspaceConnectionProperties, self).__init__( + expiry_time=expiry_time, + category=category, + target=target, + value=value, + value_format=value_format, + **kwargs + ) + self.auth_type = "PAT" # type: str self.credentials = credentials @@ -23980,23 +25803,17 @@ class PendingUploadCredentialDto(msrest.serialization.Model): """ _validation = { - 'credential_type': {'required': True}, + "credential_type": {"required": True}, } _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, + "credential_type": {"key": "credentialType", "type": "str"}, } - _subtype_map = { - 'credential_type': {'SAS': 'SASCredentialDto'} - } + _subtype_map = {"credential_type": {"SAS": "SASCredentialDto"}} - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(PendingUploadCredentialDto, self).__init__(**kwargs) self.credential_type = None # type: Optional[str] @@ -24013,8 +25830,8 @@ class PendingUploadRequestDto(msrest.serialization.Model): """ _attribute_map = { - 'pending_upload_id': {'key': 'pendingUploadId', 'type': 'str'}, - 'pending_upload_type': {'key': 'pendingUploadType', 'type': 'str'}, + "pending_upload_id": {"key": "pendingUploadId", "type": "str"}, + "pending_upload_type": {"key": "pendingUploadType", "type": "str"}, } def __init__( @@ -24052,15 +25869,20 @@ class PendingUploadResponseDto(msrest.serialization.Model): """ _attribute_map = { - 'blob_reference_for_consumption': {'key': 'blobReferenceForConsumption', 'type': 'BlobReferenceForConsumptionDto'}, - 'pending_upload_id': {'key': 'pendingUploadId', 'type': 'str'}, - 'pending_upload_type': {'key': 'pendingUploadType', 'type': 'str'}, + "blob_reference_for_consumption": { + "key": "blobReferenceForConsumption", + "type": "BlobReferenceForConsumptionDto", + }, + "pending_upload_id": {"key": "pendingUploadId", "type": "str"}, + "pending_upload_type": {"key": "pendingUploadType", "type": "str"}, } def __init__( self, *, - blob_reference_for_consumption: Optional["BlobReferenceForConsumptionDto"] = None, + blob_reference_for_consumption: Optional[ + "BlobReferenceForConsumptionDto" + ] = None, pending_upload_id: Optional[str] = None, pending_upload_type: Optional[Union[str, "PendingUploadType"]] = None, **kwargs @@ -24090,14 +25912,11 @@ class PersonalComputeInstanceSettings(msrest.serialization.Model): """ _attribute_map = { - 'assigned_user': {'key': 'assignedUser', 'type': 'AssignedUser'}, + "assigned_user": {"key": "assignedUser", "type": "AssignedUser"}, } def __init__( - self, - *, - assigned_user: Optional["AssignedUser"] = None, - **kwargs + self, *, assigned_user: Optional["AssignedUser"] = None, **kwargs ): """ :keyword assigned_user: A user explicitly assigned to a personal compute instance. @@ -24163,30 +25982,36 @@ class PipelineJob(JobBaseProperties): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, + "job_type": {"required": True}, + "status": {"readonly": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'jobs': {'key': 'jobs', 'type': '{object}'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'settings': {'key': 'settings', 'type': 'object'}, - 'source_job_id': {'key': 'sourceJobId', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "notification_setting": { + "key": "notificationSetting", + "type": "NotificationSetting", + }, + "secrets_configuration": { + "key": "secretsConfiguration", + "type": "{SecretConfiguration}", + }, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "jobs": {"key": "jobs", "type": "{object}"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "settings": {"key": "settings", "type": "object"}, + "source_job_id": {"key": "sourceJobId", "type": "str"}, } def __init__( @@ -24202,7 +26027,9 @@ def __init__( identity: Optional["IdentityConfiguration"] = None, is_archived: Optional[bool] = False, notification_setting: Optional["NotificationSetting"] = None, - secrets_configuration: Optional[Dict[str, "SecretConfiguration"]] = None, + secrets_configuration: Optional[ + Dict[str, "SecretConfiguration"] + ] = None, services: Optional[Dict[str, "JobService"]] = None, inputs: Optional[Dict[str, "JobInput"]] = None, jobs: Optional[Dict[str, Any]] = None, @@ -24252,8 +26079,22 @@ def __init__( :keyword source_job_id: ARM resource ID of source job. :paramtype source_job_id: str """ - super(PipelineJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, notification_setting=notification_setting, secrets_configuration=secrets_configuration, services=services, **kwargs) - self.job_type = 'Pipeline' # type: str + super(PipelineJob, self).__init__( + description=description, + properties=properties, + tags=tags, + component_id=component_id, + compute_id=compute_id, + display_name=display_name, + experiment_name=experiment_name, + identity=identity, + is_archived=is_archived, + notification_setting=notification_setting, + secrets_configuration=secrets_configuration, + services=services, + **kwargs + ) + self.job_type = "Pipeline" # type: str self.inputs = inputs self.jobs = jobs self.outputs = outputs @@ -24290,21 +26131,27 @@ class PredictionDriftMonitoringSignal(MonitoringSignalBase): """ _validation = { - 'signal_type': {'required': True}, - 'baseline_data': {'required': True}, - 'metric_thresholds': {'required': True}, - 'model_type': {'required': True}, - 'target_data': {'required': True}, + "signal_type": {"required": True}, + "baseline_data": {"required": True}, + "metric_thresholds": {"required": True}, + "model_type": {"required": True}, + "target_data": {"required": True}, } _attribute_map = { - 'lookback_period': {'key': 'lookbackPeriod', 'type': 'duration'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'signal_type': {'key': 'signalType', 'type': 'str'}, - 'baseline_data': {'key': 'baselineData', 'type': 'MonitoringInputData'}, - 'metric_thresholds': {'key': 'metricThresholds', 'type': '[PredictionDriftMetricThresholdBase]'}, - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'target_data': {'key': 'targetData', 'type': 'MonitoringInputData'}, + "lookback_period": {"key": "lookbackPeriod", "type": "duration"}, + "mode": {"key": "mode", "type": "str"}, + "signal_type": {"key": "signalType", "type": "str"}, + "baseline_data": { + "key": "baselineData", + "type": "MonitoringInputData", + }, + "metric_thresholds": { + "key": "metricThresholds", + "type": "[PredictionDriftMetricThresholdBase]", + }, + "model_type": {"key": "modelType", "type": "str"}, + "target_data": {"key": "targetData", "type": "MonitoringInputData"}, } def __init__( @@ -24337,8 +26184,10 @@ def __init__( :keyword target_data: Required. [Required] The data which drift will be calculated for. :paramtype target_data: ~azure.mgmt.machinelearningservices.models.MonitoringInputData """ - super(PredictionDriftMonitoringSignal, self).__init__(lookback_period=lookback_period, mode=mode, **kwargs) - self.signal_type = 'PredictionDrift' # type: str + super(PredictionDriftMonitoringSignal, self).__init__( + lookback_period=lookback_period, mode=mode, **kwargs + ) + self.signal_type = "PredictionDrift" # type: str self.baseline_data = baseline_data self.metric_thresholds = metric_thresholds self.model_type = model_type @@ -24357,21 +26206,17 @@ class PrivateEndpoint(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'subnet_arm_id': {'readonly': True}, + "id": {"readonly": True}, + "subnet_arm_id": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'subnet_arm_id': {'key': 'subnetArmId', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "subnet_arm_id": {"key": "subnetArmId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(PrivateEndpoint, self).__init__(**kwargs) self.id = None self.subnet_arm_id = None @@ -24387,19 +26232,15 @@ class PrivateEndpointAutoGenerated(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, + "id": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(PrivateEndpointAutoGenerated, self).__init__(**kwargs) self.id = None @@ -24441,25 +26282,34 @@ class PrivateEndpointConnection(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "private_endpoint": { + "key": "properties.privateEndpoint", + "type": "PrivateEndpoint", + }, + "private_link_service_connection_state": { + "key": "properties.privateLinkServiceConnectionState", + "type": "PrivateLinkServiceConnectionState", + }, + "provisioning_state": { + "key": "properties.provisioningState", + "type": "str", + }, } def __init__( @@ -24470,7 +26320,9 @@ def __init__( tags: Optional[Dict[str, str]] = None, sku: Optional["Sku"] = None, private_endpoint: Optional["PrivateEndpoint"] = None, - private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, + private_link_service_connection_state: Optional[ + "PrivateLinkServiceConnectionState" + ] = None, **kwargs ): """ @@ -24495,7 +26347,9 @@ def __init__( self.tags = tags self.sku = sku self.private_endpoint = private_endpoint - self.private_link_service_connection_state = private_link_service_connection_state + self.private_link_service_connection_state = ( + private_link_service_connection_state + ) self.provisioning_state = None @@ -24521,12 +26375,21 @@ class PrivateEndpointConnectionAutoGenerated(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'group_ids': {'key': 'properties.groupIds', 'type': '[str]'}, - 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpointResource'}, - 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionStateAutoGenerated'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "group_ids": {"key": "properties.groupIds", "type": "[str]"}, + "private_endpoint": { + "key": "properties.privateEndpoint", + "type": "PrivateEndpointResource", + }, + "private_link_service_connection_state": { + "key": "properties.privateLinkServiceConnectionState", + "type": "PrivateLinkServiceConnectionStateAutoGenerated", + }, + "provisioning_state": { + "key": "properties.provisioningState", + "type": "str", + }, } def __init__( @@ -24536,7 +26399,9 @@ def __init__( location: Optional[str] = None, group_ids: Optional[List[str]] = None, private_endpoint: Optional["PrivateEndpointResource"] = None, - private_link_service_connection_state: Optional["PrivateLinkServiceConnectionStateAutoGenerated"] = None, + private_link_service_connection_state: Optional[ + "PrivateLinkServiceConnectionStateAutoGenerated" + ] = None, provisioning_state: Optional[str] = None, **kwargs ): @@ -24563,7 +26428,9 @@ def __init__( self.location = location self.group_ids = group_ids self.private_endpoint = private_endpoint - self.private_link_service_connection_state = private_link_service_connection_state + self.private_link_service_connection_state = ( + private_link_service_connection_state + ) self.provisioning_state = provisioning_state @@ -24575,7 +26442,7 @@ class PrivateEndpointConnectionListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + "value": {"key": "value", "type": "[PrivateEndpointConnection]"}, } def __init__( @@ -24607,10 +26474,10 @@ class PrivateEndpointDestination(msrest.serialization.Model): """ _attribute_map = { - 'service_resource_id': {'key': 'serviceResourceId', 'type': 'str'}, - 'subresource_target': {'key': 'subresourceTarget', 'type': 'str'}, - 'spark_enabled': {'key': 'sparkEnabled', 'type': 'bool'}, - 'spark_status': {'key': 'sparkStatus', 'type': 'str'}, + "service_resource_id": {"key": "serviceResourceId", "type": "str"}, + "subresource_target": {"key": "subresourceTarget", "type": "str"}, + "spark_enabled": {"key": "sparkEnabled", "type": "bool"}, + "spark_status": {"key": "sparkStatus", "type": "str"}, } def __init__( @@ -24661,14 +26528,17 @@ class PrivateEndpointOutboundRule(OutboundRule): """ _validation = { - 'type': {'required': True}, + "type": {"required": True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'PrivateEndpointDestination'}, + "type": {"key": "type", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "destination": { + "key": "destination", + "type": "PrivateEndpointDestination", + }, } def __init__( @@ -24690,8 +26560,10 @@ def __init__( managed network of a machine learning workspace. :paramtype destination: ~azure.mgmt.machinelearningservices.models.PrivateEndpointDestination """ - super(PrivateEndpointOutboundRule, self).__init__(status=status, category=category, **kwargs) - self.type = 'PrivateEndpoint' # type: str + super(PrivateEndpointOutboundRule, self).__init__( + status=status, category=category, **kwargs + ) + self.type = "PrivateEndpoint" # type: str self.destination = destination @@ -24707,20 +26579,15 @@ class PrivateEndpointResource(PrivateEndpointAutoGenerated): """ _validation = { - 'id': {'readonly': True}, + "id": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'subnet_arm_id': {'key': 'subnetArmId', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "subnet_arm_id": {"key": "subnetArmId", "type": "str"}, } - def __init__( - self, - *, - subnet_arm_id: Optional[str] = None, - **kwargs - ): + def __init__(self, *, subnet_arm_id: Optional[str] = None, **kwargs): """ :keyword subnet_arm_id: The subnetId that the private endpoint is connected to. :paramtype subnet_arm_id: str @@ -24762,26 +26629,32 @@ class PrivateLinkResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'group_id': {'readonly': True}, - 'required_members': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "group_id": {"readonly": True}, + "required_members": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, - 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "group_id": {"key": "properties.groupId", "type": "str"}, + "required_members": { + "key": "properties.requiredMembers", + "type": "[str]", + }, + "required_zone_names": { + "key": "properties.requiredZoneNames", + "type": "[str]", + }, } def __init__( @@ -24824,14 +26697,11 @@ class PrivateLinkResourceListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + "value": {"key": "value", "type": "[PrivateLinkResource]"}, } def __init__( - self, - *, - value: Optional[List["PrivateLinkResource"]] = None, - **kwargs + self, *, value: Optional[List["PrivateLinkResource"]] = None, **kwargs ): """ :keyword value: Array of private link resources. @@ -24857,15 +26727,17 @@ class PrivateLinkServiceConnectionState(msrest.serialization.Model): """ _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + "status": {"key": "status", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "actions_required": {"key": "actionsRequired", "type": "str"}, } def __init__( self, *, - status: Optional[Union[str, "PrivateEndpointServiceConnectionStatus"]] = None, + status: Optional[ + Union[str, "PrivateEndpointServiceConnectionStatus"] + ] = None, description: Optional[str] = None, actions_required: Optional[str] = None, **kwargs @@ -24888,7 +26760,9 @@ def __init__( self.actions_required = actions_required -class PrivateLinkServiceConnectionStateAutoGenerated(msrest.serialization.Model): +class PrivateLinkServiceConnectionStateAutoGenerated( + msrest.serialization.Model +): """The connection state. :ivar actions_required: Some RP chose "None". Other RPs use this for region expansion. @@ -24903,9 +26777,9 @@ class PrivateLinkServiceConnectionStateAutoGenerated(msrest.serialization.Model) """ _attribute_map = { - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, + "actions_required": {"key": "actionsRequired", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "status": {"key": "status", "type": "str"}, } def __init__( @@ -24927,7 +26801,9 @@ def __init__( :paramtype status: str or ~azure.mgmt.machinelearningservices.models.EndpointServiceConnectionStatus """ - super(PrivateLinkServiceConnectionStateAutoGenerated, self).__init__(**kwargs) + super(PrivateLinkServiceConnectionStateAutoGenerated, self).__init__( + **kwargs + ) self.actions_required = actions_required self.description = description self.status = status @@ -24949,11 +26825,11 @@ class ProbeSettings(msrest.serialization.Model): """ _attribute_map = { - 'failure_threshold': {'key': 'failureThreshold', 'type': 'int'}, - 'initial_delay': {'key': 'initialDelay', 'type': 'duration'}, - 'period': {'key': 'period', 'type': 'duration'}, - 'success_threshold': {'key': 'successThreshold', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, + "failure_threshold": {"key": "failureThreshold", "type": "int"}, + "initial_delay": {"key": "initialDelay", "type": "duration"}, + "period": {"key": "period", "type": "duration"}, + "success_threshold": {"key": "successThreshold", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, } def __init__( @@ -25004,25 +26880,33 @@ class ProgressMetrics(msrest.serialization.Model): """ _validation = { - 'completed_datapoint_count': {'readonly': True}, - 'incremental_data_last_refresh_date_time': {'readonly': True}, - 'skipped_datapoint_count': {'readonly': True}, - 'total_datapoint_count': {'readonly': True}, + "completed_datapoint_count": {"readonly": True}, + "incremental_data_last_refresh_date_time": {"readonly": True}, + "skipped_datapoint_count": {"readonly": True}, + "total_datapoint_count": {"readonly": True}, } _attribute_map = { - 'completed_datapoint_count': {'key': 'completedDatapointCount', 'type': 'long'}, - 'incremental_data_last_refresh_date_time': {'key': 'incrementalDataLastRefreshDateTime', 'type': 'iso-8601'}, - 'skipped_datapoint_count': {'key': 'skippedDatapointCount', 'type': 'long'}, - 'total_datapoint_count': {'key': 'totalDatapointCount', 'type': 'long'}, + "completed_datapoint_count": { + "key": "completedDatapointCount", + "type": "long", + }, + "incremental_data_last_refresh_date_time": { + "key": "incrementalDataLastRefreshDateTime", + "type": "iso-8601", + }, + "skipped_datapoint_count": { + "key": "skippedDatapointCount", + "type": "long", + }, + "total_datapoint_count": { + "key": "totalDatapointCount", + "type": "long", + }, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ProgressMetrics, self).__init__(**kwargs) self.completed_datapoint_count = None self.incremental_data_last_refresh_date_time = None @@ -25044,26 +26928,26 @@ class PyTorch(DistributionConfiguration): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'process_count_per_instance': {'key': 'processCountPerInstance', 'type': 'int'}, + "distribution_type": {"key": "distributionType", "type": "str"}, + "process_count_per_instance": { + "key": "processCountPerInstance", + "type": "int", + }, } def __init__( - self, - *, - process_count_per_instance: Optional[int] = None, - **kwargs + self, *, process_count_per_instance: Optional[int] = None, **kwargs ): """ :keyword process_count_per_instance: Number of processes per node. :paramtype process_count_per_instance: int """ super(PyTorch, self).__init__(**kwargs) - self.distribution_type = 'PyTorch' # type: str + self.distribution_type = "PyTorch" # type: str self.process_count_per_instance = process_count_per_instance @@ -25078,8 +26962,8 @@ class QueueSettings(msrest.serialization.Model): """ _attribute_map = { - 'job_tier': {'key': 'jobTier', 'type': 'str'}, - 'priority': {'key': 'priority', 'type': 'int'}, + "job_tier": {"key": "jobTier", "type": "str"}, + "priority": {"key": "priority", "type": "int"}, } def __init__( @@ -25115,10 +26999,10 @@ class QuotaBaseProperties(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "limit": {"key": "limit", "type": "long"}, + "unit": {"key": "unit", "type": "str"}, } def __init__( @@ -25158,8 +27042,8 @@ class QuotaUpdateParameters(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[QuotaBaseProperties]'}, - 'location': {'key': 'location', 'type': 'str'}, + "value": {"key": "value", "type": "[QuotaBaseProperties]"}, + "location": {"key": "location", "type": "str"}, } def __init__( @@ -25200,14 +27084,17 @@ class RandomSamplingAlgorithm(SamplingAlgorithm): """ _validation = { - 'sampling_algorithm_type': {'required': True}, + "sampling_algorithm_type": {"required": True}, } _attribute_map = { - 'sampling_algorithm_type': {'key': 'samplingAlgorithmType', 'type': 'str'}, - 'logbase': {'key': 'logbase', 'type': 'str'}, - 'rule': {'key': 'rule', 'type': 'str'}, - 'seed': {'key': 'seed', 'type': 'int'}, + "sampling_algorithm_type": { + "key": "samplingAlgorithmType", + "type": "str", + }, + "logbase": {"key": "logbase", "type": "str"}, + "rule": {"key": "rule", "type": "str"}, + "seed": {"key": "seed", "type": "int"}, } def __init__( @@ -25229,7 +27116,7 @@ def __init__( :paramtype seed: int """ super(RandomSamplingAlgorithm, self).__init__(**kwargs) - self.sampling_algorithm_type = 'Random' # type: str + self.sampling_algorithm_type = "Random" # type: str self.logbase = logbase self.rule = rule self.seed = seed @@ -25259,17 +27146,23 @@ class Ray(DistributionConfiguration): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'address': {'key': 'address', 'type': 'str'}, - 'dashboard_port': {'key': 'dashboardPort', 'type': 'int'}, - 'head_node_additional_args': {'key': 'headNodeAdditionalArgs', 'type': 'str'}, - 'include_dashboard': {'key': 'includeDashboard', 'type': 'bool'}, - 'port': {'key': 'port', 'type': 'int'}, - 'worker_node_additional_args': {'key': 'workerNodeAdditionalArgs', 'type': 'str'}, + "distribution_type": {"key": "distributionType", "type": "str"}, + "address": {"key": "address", "type": "str"}, + "dashboard_port": {"key": "dashboardPort", "type": "int"}, + "head_node_additional_args": { + "key": "headNodeAdditionalArgs", + "type": "str", + }, + "include_dashboard": {"key": "includeDashboard", "type": "bool"}, + "port": {"key": "port", "type": "int"}, + "worker_node_additional_args": { + "key": "workerNodeAdditionalArgs", + "type": "str", + }, } def __init__( @@ -25298,7 +27191,7 @@ def __init__( :paramtype worker_node_additional_args: str """ super(Ray, self).__init__(**kwargs) - self.distribution_type = 'Ray' # type: str + self.distribution_type = "Ray" # type: str self.address = address self.dashboard_port = dashboard_port self.head_node_additional_args = head_node_additional_args @@ -25326,11 +27219,11 @@ class Recurrence(msrest.serialization.Model): """ _attribute_map = { - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceSchedule'}, + "frequency": {"key": "frequency", "type": "str"}, + "interval": {"key": "interval", "type": "int"}, + "start_time": {"key": "startTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "schedule": {"key": "schedule", "type": "RecurrenceSchedule"}, } def __init__( @@ -25382,15 +27275,15 @@ class RecurrenceSchedule(msrest.serialization.Model): """ _validation = { - 'hours': {'required': True}, - 'minutes': {'required': True}, + "hours": {"required": True}, + "minutes": {"required": True}, } _attribute_map = { - 'hours': {'key': 'hours', 'type': '[int]'}, - 'minutes': {'key': 'minutes', 'type': '[int]'}, - 'month_days': {'key': 'monthDays', 'type': '[int]'}, - 'week_days': {'key': 'weekDays', 'type': '[str]'}, + "hours": {"key": "hours", "type": "[int]"}, + "minutes": {"key": "minutes", "type": "[int]"}, + "month_days": {"key": "monthDays", "type": "[int]"}, + "week_days": {"key": "weekDays", "type": "[str]"}, } def __init__( @@ -25449,19 +27342,19 @@ class RecurrenceTrigger(TriggerBase): """ _validation = { - 'trigger_type': {'required': True}, - 'frequency': {'required': True}, - 'interval': {'required': True}, + "trigger_type": {"required": True}, + "frequency": {"required": True}, + "interval": {"required": True}, } _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceSchedule'}, + "end_time": {"key": "endTime", "type": "str"}, + "start_time": {"key": "startTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "trigger_type": {"key": "triggerType", "type": "str"}, + "frequency": {"key": "frequency", "type": "str"}, + "interval": {"key": "interval", "type": "int"}, + "schedule": {"key": "schedule", "type": "RecurrenceSchedule"}, } def __init__( @@ -25497,8 +27390,13 @@ def __init__( :keyword schedule: The recurrence schedule. :paramtype schedule: ~azure.mgmt.machinelearningservices.models.RecurrenceSchedule """ - super(RecurrenceTrigger, self).__init__(end_time=end_time, start_time=start_time, time_zone=time_zone, **kwargs) - self.trigger_type = 'Recurrence' # type: str + super(RecurrenceTrigger, self).__init__( + end_time=end_time, + start_time=start_time, + time_zone=time_zone, + **kwargs + ) + self.trigger_type = "Recurrence" # type: str self.frequency = frequency self.interval = interval self.schedule = schedule @@ -25517,12 +27415,12 @@ class RegenerateEndpointKeysRequest(msrest.serialization.Model): """ _validation = { - 'key_type': {'required': True}, + "key_type": {"required": True}, } _attribute_map = { - 'key_type': {'key': 'keyType', 'type': 'str'}, - 'key_value': {'key': 'keyValue', 'type': 'str'}, + "key_type": {"key": "keyType", "type": "str"}, + "key_value": {"key": "keyValue", "type": "str"}, } def __init__( @@ -25595,30 +27493,48 @@ class Registry(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, - 'intellectual_property_publisher': {'key': 'properties.intellectualPropertyPublisher', 'type': 'str'}, - 'managed_resource_group': {'key': 'properties.managedResourceGroup', 'type': 'ArmResourceId'}, - 'ml_flow_registry_uri': {'key': 'properties.mlFlowRegistryUri', 'type': 'str'}, - 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnectionAutoGenerated]'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'region_details': {'key': 'properties.regionDetails', 'type': '[RegistryRegionArmDetails]'}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "sku": {"key": "sku", "type": "Sku"}, + "discovery_url": {"key": "properties.discoveryUrl", "type": "str"}, + "intellectual_property_publisher": { + "key": "properties.intellectualPropertyPublisher", + "type": "str", + }, + "managed_resource_group": { + "key": "properties.managedResourceGroup", + "type": "ArmResourceId", + }, + "ml_flow_registry_uri": { + "key": "properties.mlFlowRegistryUri", + "type": "str", + }, + "private_endpoint_connections": { + "key": "properties.privateEndpointConnections", + "type": "[PrivateEndpointConnectionAutoGenerated]", + }, + "public_network_access": { + "key": "properties.publicNetworkAccess", + "type": "str", + }, + "region_details": { + "key": "properties.regionDetails", + "type": "[RegistryRegionArmDetails]", + }, } def __init__( @@ -25633,7 +27549,9 @@ def __init__( intellectual_property_publisher: Optional[str] = None, managed_resource_group: Optional["ArmResourceId"] = None, ml_flow_registry_uri: Optional[str] = None, - private_endpoint_connections: Optional[List["PrivateEndpointConnectionAutoGenerated"]] = None, + private_endpoint_connections: Optional[ + List["PrivateEndpointConnectionAutoGenerated"] + ] = None, public_network_access: Optional[str] = None, region_details: Optional[List["RegistryRegionArmDetails"]] = None, **kwargs @@ -25697,21 +27615,18 @@ class RegistryListCredentialsResult(msrest.serialization.Model): """ _validation = { - 'location': {'readonly': True}, - 'username': {'readonly': True}, + "location": {"readonly": True}, + "username": {"readonly": True}, } _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'username': {'key': 'username', 'type': 'str'}, - 'passwords': {'key': 'passwords', 'type': '[Password]'}, + "location": {"key": "location", "type": "str"}, + "username": {"key": "username", "type": "str"}, + "passwords": {"key": "passwords", "type": "[Password]"}, } def __init__( - self, - *, - passwords: Optional[List["Password"]] = None, - **kwargs + self, *, passwords: Optional[List["Password"]] = None, **kwargs ): """ :keyword passwords: @@ -25736,9 +27651,12 @@ class RegistryRegionArmDetails(msrest.serialization.Model): """ _attribute_map = { - 'acr_details': {'key': 'acrDetails', 'type': '[AcrDetails]'}, - 'location': {'key': 'location', 'type': 'str'}, - 'storage_account_details': {'key': 'storageAccountDetails', 'type': '[StorageAccountDetails]'}, + "acr_details": {"key": "acrDetails", "type": "[AcrDetails]"}, + "location": {"key": "location", "type": "str"}, + "storage_account_details": { + "key": "storageAccountDetails", + "type": "[StorageAccountDetails]", + }, } def __init__( @@ -25746,7 +27664,9 @@ def __init__( *, acr_details: Optional[List["AcrDetails"]] = None, location: Optional[str] = None, - storage_account_details: Optional[List["StorageAccountDetails"]] = None, + storage_account_details: Optional[ + List["StorageAccountDetails"] + ] = None, **kwargs ): """ @@ -25775,8 +27695,8 @@ class RegistryTrackedResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Registry]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[Registry]"}, } def __init__( @@ -25793,7 +27713,9 @@ def __init__( :keyword value: An array of objects of type Registry. :paramtype value: list[~azure.mgmt.machinelearningservices.models.Registry] """ - super(RegistryTrackedResourceArmPaginatedResult, self).__init__(**kwargs) + super(RegistryTrackedResourceArmPaginatedResult, self).__init__( + **kwargs + ) self.next_link = next_link self.value = value @@ -25862,29 +27784,56 @@ class Regression(AutoMLVertical, TableVertical): """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - } - - _attribute_map = { - 'cv_split_column_names': {'key': 'cvSplitColumnNames', 'type': '[str]'}, - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'TableVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'TableFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'TableVerticalLimitSettings'}, - 'n_cross_validations': {'key': 'nCrossValidations', 'type': 'NCrossValidations'}, - 'search_space': {'key': 'searchSpace', 'type': '[TableParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'TableSweepSettings'}, - 'test_data': {'key': 'testData', 'type': 'MLTableJobInput'}, - 'test_data_size': {'key': 'testDataSize', 'type': 'float'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'validation_data_size': {'key': 'validationDataSize', 'type': 'float'}, - 'weight_column_name': {'key': 'weightColumnName', 'type': 'str'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, - 'training_settings': {'key': 'trainingSettings', 'type': 'RegressionTrainingSettings'}, + "task_type": {"required": True}, + "training_data": {"required": True}, + } + + _attribute_map = { + "cv_split_column_names": { + "key": "cvSplitColumnNames", + "type": "[str]", + }, + "featurization_settings": { + "key": "featurizationSettings", + "type": "TableVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "TableFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "TableVerticalLimitSettings", + }, + "n_cross_validations": { + "key": "nCrossValidations", + "type": "NCrossValidations", + }, + "search_space": { + "key": "searchSpace", + "type": "[TableParameterSubspace]", + }, + "sweep_settings": { + "key": "sweepSettings", + "type": "TableSweepSettings", + }, + "test_data": {"key": "testData", "type": "MLTableJobInput"}, + "test_data_size": {"key": "testDataSize", "type": "float"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "validation_data_size": {"key": "validationDataSize", "type": "float"}, + "weight_column_name": {"key": "weightColumnName", "type": "str"}, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, + "training_settings": { + "key": "trainingSettings", + "type": "RegressionTrainingSettings", + }, } def __init__( @@ -25892,7 +27841,9 @@ def __init__( *, training_data: "MLTableJobInput", cv_split_column_names: Optional[List[str]] = None, - featurization_settings: Optional["TableVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "TableVerticalFeaturizationSettings" + ] = None, fixed_parameters: Optional["TableFixedParameters"] = None, limit_settings: Optional["TableVerticalLimitSettings"] = None, n_cross_validations: Optional["NCrossValidations"] = None, @@ -25905,7 +27856,9 @@ def __init__( weight_column_name: Optional[str] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "RegressionPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "RegressionPrimaryMetrics"] + ] = None, training_settings: Optional["RegressionTrainingSettings"] = None, **kwargs ): @@ -25965,7 +27918,24 @@ def __init__( :paramtype training_settings: ~azure.mgmt.machinelearningservices.models.RegressionTrainingSettings """ - super(Regression, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, cv_split_column_names=cv_split_column_names, featurization_settings=featurization_settings, fixed_parameters=fixed_parameters, limit_settings=limit_settings, n_cross_validations=n_cross_validations, search_space=search_space, sweep_settings=sweep_settings, test_data=test_data, test_data_size=test_data_size, validation_data=validation_data, validation_data_size=validation_data_size, weight_column_name=weight_column_name, **kwargs) + super(Regression, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + cv_split_column_names=cv_split_column_names, + featurization_settings=featurization_settings, + fixed_parameters=fixed_parameters, + limit_settings=limit_settings, + n_cross_validations=n_cross_validations, + search_space=search_space, + sweep_settings=sweep_settings, + test_data=test_data, + test_data_size=test_data_size, + validation_data=validation_data, + validation_data_size=validation_data_size, + weight_column_name=weight_column_name, + **kwargs + ) self.cv_split_column_names = cv_split_column_names self.featurization_settings = featurization_settings self.fixed_parameters = fixed_parameters @@ -25978,7 +27948,7 @@ def __init__( self.validation_data = validation_data self.validation_data_size = validation_data_size self.weight_column_name = weight_column_name - self.task_type = 'Regression' # type: str + self.task_type = "Regression" # type: str self.primary_metric = primary_metric self.training_settings = training_settings self.log_verbosity = log_verbosity @@ -25986,7 +27956,9 @@ def __init__( self.training_data = training_data -class RegressionModelPerformanceMetricThreshold(ModelPerformanceMetricThresholdBase): +class RegressionModelPerformanceMetricThreshold( + ModelPerformanceMetricThresholdBase +): """RegressionModelPerformanceMetricThreshold. All required parameters must be populated in order to send to Azure. @@ -26004,14 +27976,14 @@ class RegressionModelPerformanceMetricThreshold(ModelPerformanceMetricThresholdB """ _validation = { - 'model_type': {'required': True}, - 'metric': {'required': True}, + "model_type": {"required": True}, + "metric": {"required": True}, } _attribute_map = { - 'model_type': {'key': 'modelType', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'MonitoringThreshold'}, - 'metric': {'key': 'metric', 'type': 'str'}, + "model_type": {"key": "modelType", "type": "str"}, + "threshold": {"key": "threshold", "type": "MonitoringThreshold"}, + "metric": {"key": "metric", "type": "str"}, } def __init__( @@ -26030,8 +28002,10 @@ def __init__( :paramtype metric: str or ~azure.mgmt.machinelearningservices.models.RegressionModelPerformanceMetric """ - super(RegressionModelPerformanceMetricThreshold, self).__init__(threshold=threshold, **kwargs) - self.model_type = 'Regression' # type: str + super(RegressionModelPerformanceMetricThreshold, self).__init__( + threshold=threshold, **kwargs + ) + self.model_type = "Regression" # type: str self.metric = metric @@ -26072,16 +28046,37 @@ class RegressionTrainingSettings(TrainingSettings): """ _attribute_map = { - 'enable_dnn_training': {'key': 'enableDnnTraining', 'type': 'bool'}, - 'enable_model_explainability': {'key': 'enableModelExplainability', 'type': 'bool'}, - 'enable_onnx_compatible_models': {'key': 'enableOnnxCompatibleModels', 'type': 'bool'}, - 'enable_stack_ensemble': {'key': 'enableStackEnsemble', 'type': 'bool'}, - 'enable_vote_ensemble': {'key': 'enableVoteEnsemble', 'type': 'bool'}, - 'ensemble_model_download_timeout': {'key': 'ensembleModelDownloadTimeout', 'type': 'duration'}, - 'stack_ensemble_settings': {'key': 'stackEnsembleSettings', 'type': 'StackEnsembleSettings'}, - 'training_mode': {'key': 'trainingMode', 'type': 'str'}, - 'allowed_training_algorithms': {'key': 'allowedTrainingAlgorithms', 'type': '[str]'}, - 'blocked_training_algorithms': {'key': 'blockedTrainingAlgorithms', 'type': '[str]'}, + "enable_dnn_training": {"key": "enableDnnTraining", "type": "bool"}, + "enable_model_explainability": { + "key": "enableModelExplainability", + "type": "bool", + }, + "enable_onnx_compatible_models": { + "key": "enableOnnxCompatibleModels", + "type": "bool", + }, + "enable_stack_ensemble": { + "key": "enableStackEnsemble", + "type": "bool", + }, + "enable_vote_ensemble": {"key": "enableVoteEnsemble", "type": "bool"}, + "ensemble_model_download_timeout": { + "key": "ensembleModelDownloadTimeout", + "type": "duration", + }, + "stack_ensemble_settings": { + "key": "stackEnsembleSettings", + "type": "StackEnsembleSettings", + }, + "training_mode": {"key": "trainingMode", "type": "str"}, + "allowed_training_algorithms": { + "key": "allowedTrainingAlgorithms", + "type": "[str]", + }, + "blocked_training_algorithms": { + "key": "blockedTrainingAlgorithms", + "type": "[str]", + }, } def __init__( @@ -26095,8 +28090,12 @@ def __init__( ensemble_model_download_timeout: Optional[datetime.timedelta] = "PT5M", stack_ensemble_settings: Optional["StackEnsembleSettings"] = None, training_mode: Optional[Union[str, "TrainingMode"]] = None, - allowed_training_algorithms: Optional[List[Union[str, "RegressionModels"]]] = None, - blocked_training_algorithms: Optional[List[Union[str, "RegressionModels"]]] = None, + allowed_training_algorithms: Optional[ + List[Union[str, "RegressionModels"]] + ] = None, + blocked_training_algorithms: Optional[ + List[Union[str, "RegressionModels"]] + ] = None, **kwargs ): """ @@ -26132,7 +28131,17 @@ def __init__( :paramtype blocked_training_algorithms: list[str or ~azure.mgmt.machinelearningservices.models.RegressionModels] """ - super(RegressionTrainingSettings, self).__init__(enable_dnn_training=enable_dnn_training, enable_model_explainability=enable_model_explainability, enable_onnx_compatible_models=enable_onnx_compatible_models, enable_stack_ensemble=enable_stack_ensemble, enable_vote_ensemble=enable_vote_ensemble, ensemble_model_download_timeout=ensemble_model_download_timeout, stack_ensemble_settings=stack_ensemble_settings, training_mode=training_mode, **kwargs) + super(RegressionTrainingSettings, self).__init__( + enable_dnn_training=enable_dnn_training, + enable_model_explainability=enable_model_explainability, + enable_onnx_compatible_models=enable_onnx_compatible_models, + enable_stack_ensemble=enable_stack_ensemble, + enable_vote_ensemble=enable_vote_ensemble, + ensemble_model_download_timeout=ensemble_model_download_timeout, + stack_ensemble_settings=stack_ensemble_settings, + training_mode=training_mode, + **kwargs + ) self.allowed_training_algorithms = allowed_training_algorithms self.blocked_training_algorithms = blocked_training_algorithms @@ -26147,14 +28156,11 @@ class RequestLogging(msrest.serialization.Model): """ _attribute_map = { - 'capture_headers': {'key': 'captureHeaders', 'type': '[str]'}, + "capture_headers": {"key": "captureHeaders", "type": "[str]"}, } def __init__( - self, - *, - capture_headers: Optional[List[str]] = None, - **kwargs + self, *, capture_headers: Optional[List[str]] = None, **kwargs ): """ :keyword capture_headers: For payload logging, we only collect payload by default. If customers @@ -26176,19 +28182,14 @@ class ResourceId(msrest.serialization.Model): """ _validation = { - 'id': {'required': True}, + "id": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, } - def __init__( - self, - *, - id: str, - **kwargs - ): + def __init__(self, *, id: str, **kwargs): """ :keyword id: Required. The ID of the resource. :paramtype id: str @@ -26209,21 +28210,17 @@ class ResourceName(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, + "value": {"readonly": True}, + "localized_value": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + "value": {"key": "value", "type": "str"}, + "localized_value": {"key": "localizedValue", "type": "str"}, } - - def __init__( - self, - **kwargs - ): - """ - """ + + def __init__(self, **kwargs): + """ """ super(ResourceName, self).__init__(**kwargs) self.value = None self.localized_value = None @@ -26249,29 +28246,28 @@ class ResourceQuota(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'name': {'readonly': True}, - 'limit': {'readonly': True}, - 'unit': {'readonly': True}, + "id": {"readonly": True}, + "aml_workspace_location": {"readonly": True}, + "type": {"readonly": True}, + "name": {"readonly": True}, + "limit": {"readonly": True}, + "unit": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'ResourceName'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "aml_workspace_location": { + "key": "amlWorkspaceLocation", + "type": "str", + }, + "type": {"key": "type", "type": "str"}, + "name": {"key": "name", "type": "ResourceName"}, + "limit": {"key": "limit", "type": "long"}, + "unit": {"key": "unit", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(ResourceQuota, self).__init__(**kwargs) self.id = None self.aml_workspace_location = None @@ -26293,22 +28289,20 @@ class Route(msrest.serialization.Model): """ _validation = { - 'path': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'port': {'required': True}, + "path": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "port": {"required": True}, } _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, + "path": {"key": "path", "type": "str"}, + "port": {"key": "port", "type": "int"}, } - def __init__( - self, - *, - path: str, - port: int, - **kwargs - ): + def __init__(self, *, path: str, port: int, **kwargs): """ :keyword path: Required. [Required] The path for the route. :paramtype path: str @@ -26320,7 +28314,9 @@ def __init__( self.port = port -class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class SASAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """SASAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -26347,17 +28343,20 @@ class SASAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionSharedAccessSignature'}, + "auth_type": {"key": "authType", "type": "str"}, + "expiry_time": {"key": "expiryTime", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionSharedAccessSignature", + }, } def __init__( @@ -26368,7 +28367,9 @@ def __init__( target: Optional[str] = None, value: Optional[str] = None, value_format: Optional[Union[str, "ValueFormat"]] = None, - credentials: Optional["WorkspaceConnectionSharedAccessSignature"] = None, + credentials: Optional[ + "WorkspaceConnectionSharedAccessSignature" + ] = None, **kwargs ): """ @@ -26389,8 +28390,15 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionSharedAccessSignature """ - super(SASAuthTypeWorkspaceConnectionProperties, self).__init__(expiry_time=expiry_time, category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'SAS' # type: str + super(SASAuthTypeWorkspaceConnectionProperties, self).__init__( + expiry_time=expiry_time, + category=category, + target=target, + value=value, + value_format=value_format, + **kwargs + ) + self.auth_type = "SAS" # type: str self.credentials = credentials @@ -26408,26 +28416,21 @@ class SASCredentialDto(PendingUploadCredentialDto): """ _validation = { - 'credential_type': {'required': True}, + "credential_type": {"required": True}, } _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - 'sas_uri': {'key': 'sasUri', 'type': 'str'}, + "credential_type": {"key": "credentialType", "type": "str"}, + "sas_uri": {"key": "sasUri", "type": "str"}, } - def __init__( - self, - *, - sas_uri: Optional[str] = None, - **kwargs - ): + def __init__(self, *, sas_uri: Optional[str] = None, **kwargs): """ :keyword sas_uri: Full SAS Uri, including the storage, container/blob path and SAS token. :paramtype sas_uri: str """ super(SASCredentialDto, self).__init__(**kwargs) - self.credential_type = 'SAS' # type: str + self.credential_type = "SAS" # type: str self.sas_uri = sas_uri @@ -26445,27 +28448,22 @@ class SasDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'secrets': {'required': True}, + "credentials_type": {"required": True}, + "secrets": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'SasDatastoreSecrets'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "secrets": {"key": "secrets", "type": "SasDatastoreSecrets"}, } - def __init__( - self, - *, - secrets: "SasDatastoreSecrets", - **kwargs - ): + def __init__(self, *, secrets: "SasDatastoreSecrets", **kwargs): """ :keyword secrets: Required. [Required] Storage container secrets. :paramtype secrets: ~azure.mgmt.machinelearningservices.models.SasDatastoreSecrets """ super(SasDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'Sas' # type: str + self.credentials_type = "Sas" # type: str self.secrets = secrets @@ -26483,26 +28481,21 @@ class SasDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'sas_token': {'key': 'sasToken', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "sas_token": {"key": "sasToken", "type": "str"}, } - def __init__( - self, - *, - sas_token: Optional[str] = None, - **kwargs - ): + def __init__(self, *, sas_token: Optional[str] = None, **kwargs): """ :keyword sas_token: Storage container SAS token. :paramtype sas_token: str """ super(SasDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'Sas' # type: str + self.secrets_type = "Sas" # type: str self.sas_token = sas_token @@ -26521,13 +28514,16 @@ class ScaleSettings(msrest.serialization.Model): """ _validation = { - 'max_node_count': {'required': True}, + "max_node_count": {"required": True}, } _attribute_map = { - 'max_node_count': {'key': 'maxNodeCount', 'type': 'int'}, - 'min_node_count': {'key': 'minNodeCount', 'type': 'int'}, - 'node_idle_time_before_scale_down': {'key': 'nodeIdleTimeBeforeScaleDown', 'type': 'duration'}, + "max_node_count": {"key": "maxNodeCount", "type": "int"}, + "min_node_count": {"key": "minNodeCount", "type": "int"}, + "node_idle_time_before_scale_down": { + "key": "nodeIdleTimeBeforeScaleDown", + "type": "duration", + }, } def __init__( @@ -26550,7 +28546,9 @@ def __init__( super(ScaleSettings, self).__init__(**kwargs) self.max_node_count = max_node_count self.min_node_count = min_node_count - self.node_idle_time_before_scale_down = node_idle_time_before_scale_down + self.node_idle_time_before_scale_down = ( + node_idle_time_before_scale_down + ) class ScaleSettingsInformation(msrest.serialization.Model): @@ -26561,14 +28559,11 @@ class ScaleSettingsInformation(msrest.serialization.Model): """ _attribute_map = { - 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, + "scale_settings": {"key": "scaleSettings", "type": "ScaleSettings"}, } def __init__( - self, - *, - scale_settings: Optional["ScaleSettings"] = None, - **kwargs + self, *, scale_settings: Optional["ScaleSettings"] = None, **kwargs ): """ :keyword scale_settings: scale settings for AML Compute. @@ -26601,27 +28596,22 @@ class Schedule(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'ScheduleProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "ScheduleProperties"}, } - def __init__( - self, - *, - properties: "ScheduleProperties", - **kwargs - ): + def __init__(self, *, properties: "ScheduleProperties", **kwargs): """ :keyword properties: Required. [Required] Additional attributes of the entity. :paramtype properties: ~azure.mgmt.machinelearningservices.models.ScheduleProperties @@ -26645,16 +28635,18 @@ class ScheduleBase(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'provisioning_status': {'key': 'provisioningStatus', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "provisioning_status": {"key": "provisioningStatus", "type": "str"}, + "status": {"key": "status", "type": "str"}, } def __init__( self, *, id: Optional[str] = None, - provisioning_status: Optional[Union[str, "ScheduleProvisioningState"]] = None, + provisioning_status: Optional[ + Union[str, "ScheduleProvisioningState"] + ] = None, status: Optional[Union[str, "ScheduleStatus"]] = None, **kwargs ): @@ -26703,20 +28695,20 @@ class ScheduleProperties(ResourceBase): """ _validation = { - 'action': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'trigger': {'required': True}, + "action": {"required": True}, + "provisioning_state": {"readonly": True}, + "trigger": {"required": True}, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'action': {'key': 'action', 'type': 'ScheduleActionBase'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'trigger': {'key': 'trigger', 'type': 'TriggerBase'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "action": {"key": "action", "type": "ScheduleActionBase"}, + "display_name": {"key": "displayName", "type": "str"}, + "is_enabled": {"key": "isEnabled", "type": "bool"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "trigger": {"key": "trigger", "type": "TriggerBase"}, } def __init__( @@ -26747,7 +28739,9 @@ def __init__( :keyword trigger: Required. [Required] Specifies the trigger details. :paramtype trigger: ~azure.mgmt.machinelearningservices.models.TriggerBase """ - super(ScheduleProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + super(ScheduleProperties, self).__init__( + description=description, properties=properties, tags=tags, **kwargs + ) self.action = action self.display_name = display_name self.is_enabled = is_enabled @@ -26766,8 +28760,8 @@ class ScheduleResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Schedule]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[Schedule]"}, } def __init__( @@ -26803,10 +28797,10 @@ class ScriptReference(msrest.serialization.Model): """ _attribute_map = { - 'script_source': {'key': 'scriptSource', 'type': 'str'}, - 'script_data': {'key': 'scriptData', 'type': 'str'}, - 'script_arguments': {'key': 'scriptArguments', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'str'}, + "script_source": {"key": "scriptSource", "type": "str"}, + "script_data": {"key": "scriptData", "type": "str"}, + "script_arguments": {"key": "scriptArguments", "type": "str"}, + "timeout": {"key": "timeout", "type": "str"}, } def __init__( @@ -26845,8 +28839,11 @@ class ScriptsToExecute(msrest.serialization.Model): """ _attribute_map = { - 'startup_script': {'key': 'startupScript', 'type': 'ScriptReference'}, - 'creation_script': {'key': 'creationScript', 'type': 'ScriptReference'}, + "startup_script": {"key": "startupScript", "type": "ScriptReference"}, + "creation_script": { + "key": "creationScript", + "type": "ScriptReference", + }, } def __init__( @@ -26878,8 +28875,8 @@ class SecretConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'uri': {'key': 'uri', 'type': 'str'}, - 'workspace_secret_name': {'key': 'workspaceSecretName', 'type': 'str'}, + "uri": {"key": "uri", "type": "str"}, + "workspace_secret_name": {"key": "workspaceSecretName", "type": "str"}, } def __init__( @@ -26909,14 +28906,11 @@ class ServiceManagedResourcesSettings(msrest.serialization.Model): """ _attribute_map = { - 'cosmos_db': {'key': 'cosmosDb', 'type': 'CosmosDbSettings'}, + "cosmos_db": {"key": "cosmosDb", "type": "CosmosDbSettings"}, } def __init__( - self, - *, - cosmos_db: Optional["CosmosDbSettings"] = None, - **kwargs + self, *, cosmos_db: Optional["CosmosDbSettings"] = None, **kwargs ): """ :keyword cosmos_db: The settings for the service managed cosmosdb account. @@ -26926,7 +28920,9 @@ def __init__( self.cosmos_db = cosmos_db -class ServicePrincipalAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class ServicePrincipalAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """ServicePrincipalAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -26953,17 +28949,20 @@ class ServicePrincipalAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionP """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionServicePrincipal'}, + "auth_type": {"key": "authType", "type": "str"}, + "expiry_time": {"key": "expiryTime", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionServicePrincipal", + }, } def __init__( @@ -26995,8 +28994,17 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionServicePrincipal """ - super(ServicePrincipalAuthTypeWorkspaceConnectionProperties, self).__init__(expiry_time=expiry_time, category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'ServicePrincipal' # type: str + super( + ServicePrincipalAuthTypeWorkspaceConnectionProperties, self + ).__init__( + expiry_time=expiry_time, + category=category, + target=target, + value=value, + value_format=value_format, + **kwargs + ) + self.auth_type = "ServicePrincipal" # type: str self.credentials = credentials @@ -27022,19 +29030,22 @@ class ServicePrincipalDatastoreCredentials(DatastoreCredentials): """ _validation = { - 'credentials_type': {'required': True}, - 'client_id': {'required': True}, - 'secrets': {'required': True}, - 'tenant_id': {'required': True}, + "credentials_type": {"required": True}, + "client_id": {"required": True}, + "secrets": {"required": True}, + "tenant_id": {"required": True}, } _attribute_map = { - 'credentials_type': {'key': 'credentialsType', 'type': 'str'}, - 'authority_url': {'key': 'authorityUrl', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, - 'secrets': {'key': 'secrets', 'type': 'ServicePrincipalDatastoreSecrets'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + "credentials_type": {"key": "credentialsType", "type": "str"}, + "authority_url": {"key": "authorityUrl", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + "resource_url": {"key": "resourceUrl", "type": "str"}, + "secrets": { + "key": "secrets", + "type": "ServicePrincipalDatastoreSecrets", + }, + "tenant_id": {"key": "tenantId", "type": "str"}, } def __init__( @@ -27061,7 +29072,7 @@ def __init__( :paramtype tenant_id: str """ super(ServicePrincipalDatastoreCredentials, self).__init__(**kwargs) - self.credentials_type = 'ServicePrincipal' # type: str + self.credentials_type = "ServicePrincipal" # type: str self.authority_url = authority_url self.client_id = client_id self.resource_url = resource_url @@ -27083,26 +29094,21 @@ class ServicePrincipalDatastoreSecrets(DatastoreSecrets): """ _validation = { - 'secrets_type': {'required': True}, + "secrets_type": {"required": True}, } _attribute_map = { - 'secrets_type': {'key': 'secretsType', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, + "secrets_type": {"key": "secretsType", "type": "str"}, + "client_secret": {"key": "clientSecret", "type": "str"}, } - def __init__( - self, - *, - client_secret: Optional[str] = None, - **kwargs - ): + def __init__(self, *, client_secret: Optional[str] = None, **kwargs): """ :keyword client_secret: Service principal secret. :paramtype client_secret: str """ super(ServicePrincipalDatastoreSecrets, self).__init__(**kwargs) - self.secrets_type = 'ServicePrincipal' # type: str + self.secrets_type = "ServicePrincipal" # type: str self.client_secret = client_secret @@ -27118,9 +29124,9 @@ class ServiceTagDestination(msrest.serialization.Model): """ _attribute_map = { - 'service_tag': {'key': 'serviceTag', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'port_ranges': {'key': 'portRanges', 'type': 'str'}, + "service_tag": {"key": "serviceTag", "type": "str"}, + "protocol": {"key": "protocol", "type": "str"}, + "port_ranges": {"key": "portRanges", "type": "str"}, } def __init__( @@ -27166,14 +29172,14 @@ class ServiceTagOutboundRule(OutboundRule): """ _validation = { - 'type': {'required': True}, + "type": {"required": True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'destination': {'key': 'destination', 'type': 'ServiceTagDestination'}, + "type": {"key": "type", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "destination": {"key": "destination", "type": "ServiceTagDestination"}, } def __init__( @@ -27195,8 +29201,10 @@ def __init__( network of a machine learning workspace. :paramtype destination: ~azure.mgmt.machinelearningservices.models.ServiceTagDestination """ - super(ServiceTagOutboundRule, self).__init__(status=status, category=category, **kwargs) - self.type = 'ServiceTag' # type: str + super(ServiceTagOutboundRule, self).__init__( + status=status, category=category, **kwargs + ) + self.type = "ServiceTag" # type: str self.destination = destination @@ -27208,14 +29216,11 @@ class SetupScripts(msrest.serialization.Model): """ _attribute_map = { - 'scripts': {'key': 'scripts', 'type': 'ScriptsToExecute'}, + "scripts": {"key": "scripts", "type": "ScriptsToExecute"}, } def __init__( - self, - *, - scripts: Optional["ScriptsToExecute"] = None, - **kwargs + self, *, scripts: Optional["ScriptsToExecute"] = None, **kwargs ): """ :keyword scripts: Customized setup scripts. @@ -27244,11 +29249,14 @@ class SharedPrivateLinkResource(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'private_link_resource_id': {'key': 'properties.privateLinkResourceId', 'type': 'str'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'request_message': {'key': 'properties.requestMessage', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "private_link_resource_id": { + "key": "properties.privateLinkResourceId", + "type": "str", + }, + "group_id": {"key": "properties.groupId", "type": "str"}, + "request_message": {"key": "properties.requestMessage", "type": "str"}, + "status": {"key": "properties.status", "type": "str"}, } def __init__( @@ -27258,7 +29266,9 @@ def __init__( private_link_resource_id: Optional[str] = None, group_id: Optional[str] = None, request_message: Optional[str] = None, - status: Optional[Union[str, "PrivateEndpointServiceConnectionStatus"]] = None, + status: Optional[ + Union[str, "PrivateEndpointServiceConnectionStatus"] + ] = None, **kwargs ): """ @@ -27307,15 +29317,15 @@ class Sku(msrest.serialization.Model): """ _validation = { - 'name': {'required': True}, + "name": {"required": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'size': {'key': 'size', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'int'}, + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, + "size": {"key": "size", "type": "str"}, + "family": {"key": "family", "type": "str"}, + "capacity": {"key": "capacity", "type": "int"}, } def __init__( @@ -27368,10 +29378,10 @@ class SkuCapacity(msrest.serialization.Model): """ _attribute_map = { - 'default': {'key': 'default', 'type': 'int'}, - 'maximum': {'key': 'maximum', 'type': 'int'}, - 'minimum': {'key': 'minimum', 'type': 'int'}, - 'scale_type': {'key': 'scaleType', 'type': 'str'}, + "default": {"key": "default", "type": "int"}, + "maximum": {"key": "maximum", "type": "int"}, + "minimum": {"key": "minimum", "type": "int"}, + "scale_type": {"key": "scaleType", "type": "str"}, } def __init__( @@ -27415,13 +29425,13 @@ class SkuResource(msrest.serialization.Model): """ _validation = { - 'resource_type': {'readonly': True}, + "resource_type": {"readonly": True}, } _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'SkuSetting'}, + "capacity": {"key": "capacity", "type": "SkuCapacity"}, + "resource_type": {"key": "resourceType", "type": "str"}, + "sku": {"key": "sku", "type": "SkuSetting"}, } def __init__( @@ -27454,8 +29464,8 @@ class SkuResourceArmPaginatedResult(msrest.serialization.Model): """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[SkuResource]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[SkuResource]"}, } def __init__( @@ -27492,12 +29502,16 @@ class SkuSetting(msrest.serialization.Model): """ _validation = { - 'name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "name": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, } def __init__( @@ -27593,40 +29607,53 @@ class SparkJob(JobBaseProperties): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'code_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'entry': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'archives': {'key': 'archives', 'type': '[str]'}, - 'args': {'key': 'args', 'type': 'str'}, - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'conf': {'key': 'conf', 'type': '{str}'}, - 'entry': {'key': 'entry', 'type': 'SparkJobEntry'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'files': {'key': 'files', 'type': '[str]'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'jars': {'key': 'jars', 'type': '[str]'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'py_files': {'key': 'pyFiles', 'type': '[str]'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'resources': {'key': 'resources', 'type': 'SparkResourceConfiguration'}, + "job_type": {"required": True}, + "status": {"readonly": True}, + "code_id": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "entry": {"required": True}, + } + + _attribute_map = { + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "notification_setting": { + "key": "notificationSetting", + "type": "NotificationSetting", + }, + "secrets_configuration": { + "key": "secretsConfiguration", + "type": "{SecretConfiguration}", + }, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "archives": {"key": "archives", "type": "[str]"}, + "args": {"key": "args", "type": "str"}, + "code_id": {"key": "codeId", "type": "str"}, + "conf": {"key": "conf", "type": "{str}"}, + "entry": {"key": "entry", "type": "SparkJobEntry"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "files": {"key": "files", "type": "[str]"}, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "jars": {"key": "jars", "type": "[str]"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "py_files": {"key": "pyFiles", "type": "[str]"}, + "queue_settings": {"key": "queueSettings", "type": "QueueSettings"}, + "resources": { + "key": "resources", + "type": "SparkResourceConfiguration", + }, } def __init__( @@ -27644,7 +29671,9 @@ def __init__( identity: Optional["IdentityConfiguration"] = None, is_archived: Optional[bool] = False, notification_setting: Optional["NotificationSetting"] = None, - secrets_configuration: Optional[Dict[str, "SecretConfiguration"]] = None, + secrets_configuration: Optional[ + Dict[str, "SecretConfiguration"] + ] = None, services: Optional[Dict[str, "JobService"]] = None, archives: Optional[List[str]] = None, args: Optional[str] = None, @@ -27716,8 +29745,22 @@ def __init__( :keyword resources: Compute Resource configuration for the job. :paramtype resources: ~azure.mgmt.machinelearningservices.models.SparkResourceConfiguration """ - super(SparkJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, notification_setting=notification_setting, secrets_configuration=secrets_configuration, services=services, **kwargs) - self.job_type = 'Spark' # type: str + super(SparkJob, self).__init__( + description=description, + properties=properties, + tags=tags, + component_id=component_id, + compute_id=compute_id, + display_name=display_name, + experiment_name=experiment_name, + identity=identity, + is_archived=is_archived, + notification_setting=notification_setting, + secrets_configuration=secrets_configuration, + services=services, + **kwargs + ) + self.job_type = "Spark" # type: str self.archives = archives self.args = args self.code_id = code_id @@ -27748,23 +29791,22 @@ class SparkJobEntry(msrest.serialization.Model): """ _validation = { - 'spark_job_entry_type': {'required': True}, + "spark_job_entry_type": {"required": True}, } _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, + "spark_job_entry_type": {"key": "sparkJobEntryType", "type": "str"}, } _subtype_map = { - 'spark_job_entry_type': {'SparkJobPythonEntry': 'SparkJobPythonEntry', 'SparkJobScalaEntry': 'SparkJobScalaEntry'} + "spark_job_entry_type": { + "SparkJobPythonEntry": "SparkJobPythonEntry", + "SparkJobScalaEntry": "SparkJobScalaEntry", + } } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(SparkJobEntry, self).__init__(**kwargs) self.spark_job_entry_type = None # type: Optional[str] @@ -27783,27 +29825,26 @@ class SparkJobPythonEntry(SparkJobEntry): """ _validation = { - 'spark_job_entry_type': {'required': True}, - 'file': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "spark_job_entry_type": {"required": True}, + "file": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - 'file': {'key': 'file', 'type': 'str'}, + "spark_job_entry_type": {"key": "sparkJobEntryType", "type": "str"}, + "file": {"key": "file", "type": "str"}, } - def __init__( - self, - *, - file: str, - **kwargs - ): + def __init__(self, *, file: str, **kwargs): """ :keyword file: Required. [Required] Relative python file path for job entry point. :paramtype file: str """ super(SparkJobPythonEntry, self).__init__(**kwargs) - self.spark_job_entry_type = 'SparkJobPythonEntry' # type: str + self.spark_job_entry_type = "SparkJobPythonEntry" # type: str self.file = file @@ -27821,27 +29862,26 @@ class SparkJobScalaEntry(SparkJobEntry): """ _validation = { - 'spark_job_entry_type': {'required': True}, - 'class_name': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "spark_job_entry_type": {"required": True}, + "class_name": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'spark_job_entry_type': {'key': 'sparkJobEntryType', 'type': 'str'}, - 'class_name': {'key': 'className', 'type': 'str'}, + "spark_job_entry_type": {"key": "sparkJobEntryType", "type": "str"}, + "class_name": {"key": "className", "type": "str"}, } - def __init__( - self, - *, - class_name: str, - **kwargs - ): + def __init__(self, *, class_name: str, **kwargs): """ :keyword class_name: Required. [Required] Scala class name used as entry point. :paramtype class_name: str """ super(SparkJobScalaEntry, self).__init__(**kwargs) - self.spark_job_entry_type = 'SparkJobScalaEntry' # type: str + self.spark_job_entry_type = "SparkJobScalaEntry" # type: str self.class_name = class_name @@ -27855,8 +29895,8 @@ class SparkResourceConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, + "instance_type": {"key": "instanceType", "type": "str"}, + "runtime_version": {"key": "runtimeVersion", "type": "str"}, } def __init__( @@ -27896,12 +29936,15 @@ class SslConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'cert': {'key': 'cert', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - 'cname': {'key': 'cname', 'type': 'str'}, - 'leaf_domain_label': {'key': 'leafDomainLabel', 'type': 'str'}, - 'overwrite_existing_domain': {'key': 'overwriteExistingDomain', 'type': 'bool'}, + "status": {"key": "status", "type": "str"}, + "cert": {"key": "cert", "type": "str"}, + "key": {"key": "key", "type": "str"}, + "cname": {"key": "cname", "type": "str"}, + "leaf_domain_label": {"key": "leafDomainLabel", "type": "str"}, + "overwrite_existing_domain": { + "key": "overwriteExistingDomain", + "type": "bool", + }, } def __init__( @@ -27958,9 +30001,18 @@ class StackEnsembleSettings(msrest.serialization.Model): """ _attribute_map = { - 'stack_meta_learner_k_wargs': {'key': 'stackMetaLearnerKWargs', 'type': 'object'}, - 'stack_meta_learner_train_percentage': {'key': 'stackMetaLearnerTrainPercentage', 'type': 'float'}, - 'stack_meta_learner_type': {'key': 'stackMetaLearnerType', 'type': 'str'}, + "stack_meta_learner_k_wargs": { + "key": "stackMetaLearnerKWargs", + "type": "object", + }, + "stack_meta_learner_train_percentage": { + "key": "stackMetaLearnerTrainPercentage", + "type": "float", + }, + "stack_meta_learner_type": { + "key": "stackMetaLearnerType", + "type": "str", + }, } def __init__( @@ -27968,7 +30020,9 @@ def __init__( *, stack_meta_learner_k_wargs: Optional[Any] = None, stack_meta_learner_train_percentage: Optional[float] = 0.2, - stack_meta_learner_type: Optional[Union[str, "StackMetaLearnerType"]] = None, + stack_meta_learner_type: Optional[ + Union[str, "StackMetaLearnerType"] + ] = None, **kwargs ): """ @@ -27988,7 +30042,9 @@ def __init__( """ super(StackEnsembleSettings, self).__init__(**kwargs) self.stack_meta_learner_k_wargs = stack_meta_learner_k_wargs - self.stack_meta_learner_train_percentage = stack_meta_learner_train_percentage + self.stack_meta_learner_train_percentage = ( + stack_meta_learner_train_percentage + ) self.stack_meta_learner_type = stack_meta_learner_type @@ -28009,25 +30065,21 @@ class StatusMessage(msrest.serialization.Model): """ _validation = { - 'code': {'readonly': True}, - 'created_date_time': {'readonly': True}, - 'level': {'readonly': True}, - 'message': {'readonly': True}, + "code": {"readonly": True}, + "created_date_time": {"readonly": True}, + "level": {"readonly": True}, + "message": {"readonly": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, + "code": {"key": "code", "type": "str"}, + "created_date_time": {"key": "createdDateTime", "type": "iso-8601"}, + "level": {"key": "level", "type": "str"}, + "message": {"key": "message", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(StatusMessage, self).__init__(**kwargs) self.code = None self.created_date_time = None @@ -28049,15 +30101,25 @@ class StorageAccountDetails(msrest.serialization.Model): """ _attribute_map = { - 'system_created_storage_account': {'key': 'systemCreatedStorageAccount', 'type': 'SystemCreatedStorageAccount'}, - 'user_created_storage_account': {'key': 'userCreatedStorageAccount', 'type': 'UserCreatedStorageAccount'}, + "system_created_storage_account": { + "key": "systemCreatedStorageAccount", + "type": "SystemCreatedStorageAccount", + }, + "user_created_storage_account": { + "key": "userCreatedStorageAccount", + "type": "UserCreatedStorageAccount", + }, } def __init__( self, *, - system_created_storage_account: Optional["SystemCreatedStorageAccount"] = None, - user_created_storage_account: Optional["UserCreatedStorageAccount"] = None, + system_created_storage_account: Optional[ + "SystemCreatedStorageAccount" + ] = None, + user_created_storage_account: Optional[ + "UserCreatedStorageAccount" + ] = None, **kwargs ): """ @@ -28141,38 +30203,50 @@ class SweepJob(JobBaseProperties): """ _validation = { - 'job_type': {'required': True}, - 'status': {'readonly': True}, - 'objective': {'required': True}, - 'sampling_algorithm': {'required': True}, - 'search_space': {'required': True}, - 'trial': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'component_id': {'key': 'componentId', 'type': 'str'}, - 'compute_id': {'key': 'computeId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'experiment_name': {'key': 'experimentName', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'IdentityConfiguration'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'job_type': {'key': 'jobType', 'type': 'str'}, - 'notification_setting': {'key': 'notificationSetting', 'type': 'NotificationSetting'}, - 'secrets_configuration': {'key': 'secretsConfiguration', 'type': '{SecretConfiguration}'}, - 'services': {'key': 'services', 'type': '{JobService}'}, - 'status': {'key': 'status', 'type': 'str'}, - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'inputs': {'key': 'inputs', 'type': '{JobInput}'}, - 'limits': {'key': 'limits', 'type': 'SweepJobLimits'}, - 'objective': {'key': 'objective', 'type': 'Objective'}, - 'outputs': {'key': 'outputs', 'type': '{JobOutput}'}, - 'queue_settings': {'key': 'queueSettings', 'type': 'QueueSettings'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'SamplingAlgorithm'}, - 'search_space': {'key': 'searchSpace', 'type': 'object'}, - 'trial': {'key': 'trial', 'type': 'TrialComponent'}, + "job_type": {"required": True}, + "status": {"readonly": True}, + "objective": {"required": True}, + "sampling_algorithm": {"required": True}, + "search_space": {"required": True}, + "trial": {"required": True}, + } + + _attribute_map = { + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "component_id": {"key": "componentId", "type": "str"}, + "compute_id": {"key": "computeId", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "experiment_name": {"key": "experimentName", "type": "str"}, + "identity": {"key": "identity", "type": "IdentityConfiguration"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "job_type": {"key": "jobType", "type": "str"}, + "notification_setting": { + "key": "notificationSetting", + "type": "NotificationSetting", + }, + "secrets_configuration": { + "key": "secretsConfiguration", + "type": "{SecretConfiguration}", + }, + "services": {"key": "services", "type": "{JobService}"}, + "status": {"key": "status", "type": "str"}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, + "inputs": {"key": "inputs", "type": "{JobInput}"}, + "limits": {"key": "limits", "type": "SweepJobLimits"}, + "objective": {"key": "objective", "type": "Objective"}, + "outputs": {"key": "outputs", "type": "{JobOutput}"}, + "queue_settings": {"key": "queueSettings", "type": "QueueSettings"}, + "sampling_algorithm": { + "key": "samplingAlgorithm", + "type": "SamplingAlgorithm", + }, + "search_space": {"key": "searchSpace", "type": "object"}, + "trial": {"key": "trial", "type": "TrialComponent"}, } def __init__( @@ -28192,7 +30266,9 @@ def __init__( identity: Optional["IdentityConfiguration"] = None, is_archived: Optional[bool] = False, notification_setting: Optional["NotificationSetting"] = None, - secrets_configuration: Optional[Dict[str, "SecretConfiguration"]] = None, + secrets_configuration: Optional[ + Dict[str, "SecretConfiguration"] + ] = None, services: Optional[Dict[str, "JobService"]] = None, early_termination: Optional["EarlyTerminationPolicy"] = None, inputs: Optional[Dict[str, "JobInput"]] = None, @@ -28252,8 +30328,22 @@ def __init__( :keyword trial: Required. [Required] Trial component definition. :paramtype trial: ~azure.mgmt.machinelearningservices.models.TrialComponent """ - super(SweepJob, self).__init__(description=description, properties=properties, tags=tags, component_id=component_id, compute_id=compute_id, display_name=display_name, experiment_name=experiment_name, identity=identity, is_archived=is_archived, notification_setting=notification_setting, secrets_configuration=secrets_configuration, services=services, **kwargs) - self.job_type = 'Sweep' # type: str + super(SweepJob, self).__init__( + description=description, + properties=properties, + tags=tags, + component_id=component_id, + compute_id=compute_id, + display_name=display_name, + experiment_name=experiment_name, + identity=identity, + is_archived=is_archived, + notification_setting=notification_setting, + secrets_configuration=secrets_configuration, + services=services, + **kwargs + ) + self.job_type = "Sweep" # type: str self.early_termination = early_termination self.inputs = inputs self.limits = limits @@ -28285,15 +30375,15 @@ class SweepJobLimits(JobLimits): """ _validation = { - 'job_limits_type': {'required': True}, + "job_limits_type": {"required": True}, } _attribute_map = { - 'job_limits_type': {'key': 'jobLimitsType', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_total_trials': {'key': 'maxTotalTrials', 'type': 'int'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, + "job_limits_type": {"key": "jobLimitsType", "type": "str"}, + "timeout": {"key": "timeout", "type": "duration"}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_total_trials": {"key": "maxTotalTrials", "type": "int"}, + "trial_timeout": {"key": "trialTimeout", "type": "duration"}, } def __init__( @@ -28317,7 +30407,7 @@ def __init__( :paramtype trial_timeout: ~datetime.timedelta """ super(SweepJobLimits, self).__init__(timeout=timeout, **kwargs) - self.job_limits_type = 'Sweep' # type: str + self.job_limits_type = "Sweep" # type: str self.max_concurrent_trials = max_concurrent_trials self.max_total_trials = max_total_trials self.trial_timeout = trial_timeout @@ -28362,26 +30452,29 @@ class SynapseSpark(Compute): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': 'SynapseSparkProperties'}, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, + "properties": {"key": "properties", "type": "SynapseSparkProperties"}, } def __init__( @@ -28407,8 +30500,14 @@ def __init__( :keyword properties: :paramtype properties: ~azure.mgmt.machinelearningservices.models.SynapseSparkProperties """ - super(SynapseSpark, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, **kwargs) - self.compute_type = 'SynapseSpark' # type: str + super(SynapseSpark, self).__init__( + compute_location=compute_location, + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + **kwargs + ) + self.compute_type = "SynapseSpark" # type: str self.properties = properties @@ -28438,16 +30537,22 @@ class SynapseSparkProperties(msrest.serialization.Model): """ _attribute_map = { - 'auto_scale_properties': {'key': 'autoScaleProperties', 'type': 'AutoScaleProperties'}, - 'auto_pause_properties': {'key': 'autoPauseProperties', 'type': 'AutoPauseProperties'}, - 'spark_version': {'key': 'sparkVersion', 'type': 'str'}, - 'node_count': {'key': 'nodeCount', 'type': 'int'}, - 'node_size': {'key': 'nodeSize', 'type': 'str'}, - 'node_size_family': {'key': 'nodeSizeFamily', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'workspace_name': {'key': 'workspaceName', 'type': 'str'}, - 'pool_name': {'key': 'poolName', 'type': 'str'}, + "auto_scale_properties": { + "key": "autoScaleProperties", + "type": "AutoScaleProperties", + }, + "auto_pause_properties": { + "key": "autoPauseProperties", + "type": "AutoPauseProperties", + }, + "spark_version": {"key": "sparkVersion", "type": "str"}, + "node_count": {"key": "nodeCount", "type": "int"}, + "node_size": {"key": "nodeSize", "type": "str"}, + "node_size_family": {"key": "nodeSizeFamily", "type": "str"}, + "subscription_id": {"key": "subscriptionId", "type": "str"}, + "resource_group": {"key": "resourceGroup", "type": "str"}, + "workspace_name": {"key": "workspaceName", "type": "str"}, + "pool_name": {"key": "poolName", "type": "str"}, } def __init__( @@ -28514,9 +30619,9 @@ class SystemCreatedAcrAccount(msrest.serialization.Model): """ _attribute_map = { - 'acr_account_name': {'key': 'acrAccountName', 'type': 'str'}, - 'acr_account_sku': {'key': 'acrAccountSku', 'type': 'str'}, - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, + "acr_account_name": {"key": "acrAccountName", "type": "str"}, + "acr_account_sku": {"key": "acrAccountSku", "type": "str"}, + "arm_resource_id": {"key": "armResourceId", "type": "ArmResourceId"}, } def __init__( @@ -28565,11 +30670,17 @@ class SystemCreatedStorageAccount(msrest.serialization.Model): """ _attribute_map = { - 'allow_blob_public_access': {'key': 'allowBlobPublicAccess', 'type': 'bool'}, - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, - 'storage_account_hns_enabled': {'key': 'storageAccountHnsEnabled', 'type': 'bool'}, - 'storage_account_name': {'key': 'storageAccountName', 'type': 'str'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + "allow_blob_public_access": { + "key": "allowBlobPublicAccess", + "type": "bool", + }, + "arm_resource_id": {"key": "armResourceId", "type": "ArmResourceId"}, + "storage_account_hns_enabled": { + "key": "storageAccountHnsEnabled", + "type": "bool", + }, + "storage_account_name": {"key": "storageAccountName", "type": "str"}, + "storage_account_type": {"key": "storageAccountType", "type": "str"}, } def __init__( @@ -28630,12 +30741,12 @@ class SystemData(msrest.serialization.Model): """ _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + "created_by": {"key": "createdBy", "type": "str"}, + "created_by_type": {"key": "createdByType", "type": "str"}, + "created_at": {"key": "createdAt", "type": "iso-8601"}, + "last_modified_by": {"key": "lastModifiedBy", "type": "str"}, + "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"}, + "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, } def __init__( @@ -28689,23 +30800,19 @@ class SystemService(msrest.serialization.Model): """ _validation = { - 'system_service_type': {'readonly': True}, - 'public_ip_address': {'readonly': True}, - 'version': {'readonly': True}, + "system_service_type": {"readonly": True}, + "public_ip_address": {"readonly": True}, + "version": {"readonly": True}, } _attribute_map = { - 'system_service_type': {'key': 'systemServiceType', 'type': 'str'}, - 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, + "system_service_type": {"key": "systemServiceType", "type": "str"}, + "public_ip_address": {"key": "publicIpAddress", "type": "str"}, + "version": {"key": "version", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(SystemService, self).__init__(**kwargs) self.system_service_type = None self.public_ip_address = None @@ -28760,26 +30867,26 @@ class TableFixedParameters(msrest.serialization.Model): """ _attribute_map = { - 'booster': {'key': 'booster', 'type': 'str'}, - 'boosting_type': {'key': 'boostingType', 'type': 'str'}, - 'grow_policy': {'key': 'growPolicy', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'float'}, - 'max_bin': {'key': 'maxBin', 'type': 'int'}, - 'max_depth': {'key': 'maxDepth', 'type': 'int'}, - 'max_leaves': {'key': 'maxLeaves', 'type': 'int'}, - 'min_data_in_leaf': {'key': 'minDataInLeaf', 'type': 'int'}, - 'min_split_gain': {'key': 'minSplitGain', 'type': 'float'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'n_estimators': {'key': 'nEstimators', 'type': 'int'}, - 'num_leaves': {'key': 'numLeaves', 'type': 'int'}, - 'preprocessor_name': {'key': 'preprocessorName', 'type': 'str'}, - 'reg_alpha': {'key': 'regAlpha', 'type': 'float'}, - 'reg_lambda': {'key': 'regLambda', 'type': 'float'}, - 'subsample': {'key': 'subsample', 'type': 'float'}, - 'subsample_freq': {'key': 'subsampleFreq', 'type': 'float'}, - 'tree_method': {'key': 'treeMethod', 'type': 'str'}, - 'with_mean': {'key': 'withMean', 'type': 'bool'}, - 'with_std': {'key': 'withStd', 'type': 'bool'}, + "booster": {"key": "booster", "type": "str"}, + "boosting_type": {"key": "boostingType", "type": "str"}, + "grow_policy": {"key": "growPolicy", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "float"}, + "max_bin": {"key": "maxBin", "type": "int"}, + "max_depth": {"key": "maxDepth", "type": "int"}, + "max_leaves": {"key": "maxLeaves", "type": "int"}, + "min_data_in_leaf": {"key": "minDataInLeaf", "type": "int"}, + "min_split_gain": {"key": "minSplitGain", "type": "float"}, + "model_name": {"key": "modelName", "type": "str"}, + "n_estimators": {"key": "nEstimators", "type": "int"}, + "num_leaves": {"key": "numLeaves", "type": "int"}, + "preprocessor_name": {"key": "preprocessorName", "type": "str"}, + "reg_alpha": {"key": "regAlpha", "type": "float"}, + "reg_lambda": {"key": "regLambda", "type": "float"}, + "subsample": {"key": "subsample", "type": "float"}, + "subsample_freq": {"key": "subsampleFreq", "type": "float"}, + "tree_method": {"key": "treeMethod", "type": "str"}, + "with_mean": {"key": "withMean", "type": "bool"}, + "with_std": {"key": "withStd", "type": "bool"}, } def __init__( @@ -28922,26 +31029,26 @@ class TableParameterSubspace(msrest.serialization.Model): """ _attribute_map = { - 'booster': {'key': 'booster', 'type': 'str'}, - 'boosting_type': {'key': 'boostingType', 'type': 'str'}, - 'grow_policy': {'key': 'growPolicy', 'type': 'str'}, - 'learning_rate': {'key': 'learningRate', 'type': 'str'}, - 'max_bin': {'key': 'maxBin', 'type': 'str'}, - 'max_depth': {'key': 'maxDepth', 'type': 'str'}, - 'max_leaves': {'key': 'maxLeaves', 'type': 'str'}, - 'min_data_in_leaf': {'key': 'minDataInLeaf', 'type': 'str'}, - 'min_split_gain': {'key': 'minSplitGain', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'n_estimators': {'key': 'nEstimators', 'type': 'str'}, - 'num_leaves': {'key': 'numLeaves', 'type': 'str'}, - 'preprocessor_name': {'key': 'preprocessorName', 'type': 'str'}, - 'reg_alpha': {'key': 'regAlpha', 'type': 'str'}, - 'reg_lambda': {'key': 'regLambda', 'type': 'str'}, - 'subsample': {'key': 'subsample', 'type': 'str'}, - 'subsample_freq': {'key': 'subsampleFreq', 'type': 'str'}, - 'tree_method': {'key': 'treeMethod', 'type': 'str'}, - 'with_mean': {'key': 'withMean', 'type': 'str'}, - 'with_std': {'key': 'withStd', 'type': 'str'}, + "booster": {"key": "booster", "type": "str"}, + "boosting_type": {"key": "boostingType", "type": "str"}, + "grow_policy": {"key": "growPolicy", "type": "str"}, + "learning_rate": {"key": "learningRate", "type": "str"}, + "max_bin": {"key": "maxBin", "type": "str"}, + "max_depth": {"key": "maxDepth", "type": "str"}, + "max_leaves": {"key": "maxLeaves", "type": "str"}, + "min_data_in_leaf": {"key": "minDataInLeaf", "type": "str"}, + "min_split_gain": {"key": "minSplitGain", "type": "str"}, + "model_name": {"key": "modelName", "type": "str"}, + "n_estimators": {"key": "nEstimators", "type": "str"}, + "num_leaves": {"key": "numLeaves", "type": "str"}, + "preprocessor_name": {"key": "preprocessorName", "type": "str"}, + "reg_alpha": {"key": "regAlpha", "type": "str"}, + "reg_lambda": {"key": "regLambda", "type": "str"}, + "subsample": {"key": "subsample", "type": "str"}, + "subsample_freq": {"key": "subsampleFreq", "type": "str"}, + "tree_method": {"key": "treeMethod", "type": "str"}, + "with_mean": {"key": "withMean", "type": "str"}, + "with_std": {"key": "withStd", "type": "str"}, } def __init__( @@ -29050,12 +31157,15 @@ class TableSweepSettings(msrest.serialization.Model): """ _validation = { - 'sampling_algorithm': {'required': True}, + "sampling_algorithm": {"required": True}, } _attribute_map = { - 'early_termination': {'key': 'earlyTermination', 'type': 'EarlyTerminationPolicy'}, - 'sampling_algorithm': {'key': 'samplingAlgorithm', 'type': 'str'}, + "early_termination": { + "key": "earlyTermination", + "type": "EarlyTerminationPolicy", + }, + "sampling_algorithm": {"key": "samplingAlgorithm", "type": "str"}, } def __init__( @@ -29105,23 +31215,39 @@ class TableVerticalFeaturizationSettings(FeaturizationSettings): """ _attribute_map = { - 'dataset_language': {'key': 'datasetLanguage', 'type': 'str'}, - 'blocked_transformers': {'key': 'blockedTransformers', 'type': '[str]'}, - 'column_name_and_types': {'key': 'columnNameAndTypes', 'type': '{str}'}, - 'enable_dnn_featurization': {'key': 'enableDnnFeaturization', 'type': 'bool'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'transformer_params': {'key': 'transformerParams', 'type': '{[ColumnTransformer]}'}, + "dataset_language": {"key": "datasetLanguage", "type": "str"}, + "blocked_transformers": { + "key": "blockedTransformers", + "type": "[str]", + }, + "column_name_and_types": { + "key": "columnNameAndTypes", + "type": "{str}", + }, + "enable_dnn_featurization": { + "key": "enableDnnFeaturization", + "type": "bool", + }, + "mode": {"key": "mode", "type": "str"}, + "transformer_params": { + "key": "transformerParams", + "type": "{[ColumnTransformer]}", + }, } def __init__( self, *, dataset_language: Optional[str] = None, - blocked_transformers: Optional[List[Union[str, "BlockedTransformers"]]] = None, + blocked_transformers: Optional[ + List[Union[str, "BlockedTransformers"]] + ] = None, column_name_and_types: Optional[Dict[str, str]] = None, enable_dnn_featurization: Optional[bool] = False, mode: Optional[Union[str, "FeaturizationMode"]] = None, - transformer_params: Optional[Dict[str, List["ColumnTransformer"]]] = None, + transformer_params: Optional[ + Dict[str, List["ColumnTransformer"]] + ] = None, **kwargs ): """ @@ -29147,7 +31273,9 @@ def __init__( :paramtype transformer_params: dict[str, list[~azure.mgmt.machinelearningservices.models.ColumnTransformer]] """ - super(TableVerticalFeaturizationSettings, self).__init__(dataset_language=dataset_language, **kwargs) + super(TableVerticalFeaturizationSettings, self).__init__( + dataset_language=dataset_language, **kwargs + ) self.blocked_transformers = blocked_transformers self.column_name_and_types = column_name_and_types self.enable_dnn_featurization = enable_dnn_featurization @@ -29182,16 +31310,22 @@ class TableVerticalLimitSettings(msrest.serialization.Model): """ _attribute_map = { - 'enable_early_termination': {'key': 'enableEarlyTermination', 'type': 'bool'}, - 'exit_score': {'key': 'exitScore', 'type': 'float'}, - 'max_concurrent_trials': {'key': 'maxConcurrentTrials', 'type': 'int'}, - 'max_cores_per_trial': {'key': 'maxCoresPerTrial', 'type': 'int'}, - 'max_nodes': {'key': 'maxNodes', 'type': 'int'}, - 'max_trials': {'key': 'maxTrials', 'type': 'int'}, - 'sweep_concurrent_trials': {'key': 'sweepConcurrentTrials', 'type': 'int'}, - 'sweep_trials': {'key': 'sweepTrials', 'type': 'int'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'trial_timeout': {'key': 'trialTimeout', 'type': 'duration'}, + "enable_early_termination": { + "key": "enableEarlyTermination", + "type": "bool", + }, + "exit_score": {"key": "exitScore", "type": "float"}, + "max_concurrent_trials": {"key": "maxConcurrentTrials", "type": "int"}, + "max_cores_per_trial": {"key": "maxCoresPerTrial", "type": "int"}, + "max_nodes": {"key": "maxNodes", "type": "int"}, + "max_trials": {"key": "maxTrials", "type": "int"}, + "sweep_concurrent_trials": { + "key": "sweepConcurrentTrials", + "type": "int", + }, + "sweep_trials": {"key": "sweepTrials", "type": "int"}, + "timeout": {"key": "timeout", "type": "duration"}, + "trial_timeout": {"key": "trialTimeout", "type": "duration"}, } def __init__( @@ -29267,15 +31401,18 @@ class TargetUtilizationScaleSettings(OnlineScaleSettings): """ _validation = { - 'scale_type': {'required': True}, + "scale_type": {"required": True}, } _attribute_map = { - 'scale_type': {'key': 'scaleType', 'type': 'str'}, - 'max_instances': {'key': 'maxInstances', 'type': 'int'}, - 'min_instances': {'key': 'minInstances', 'type': 'int'}, - 'polling_interval': {'key': 'pollingInterval', 'type': 'duration'}, - 'target_utilization_percentage': {'key': 'targetUtilizationPercentage', 'type': 'int'}, + "scale_type": {"key": "scaleType", "type": "str"}, + "max_instances": {"key": "maxInstances", "type": "int"}, + "min_instances": {"key": "minInstances", "type": "int"}, + "polling_interval": {"key": "pollingInterval", "type": "duration"}, + "target_utilization_percentage": { + "key": "targetUtilizationPercentage", + "type": "int", + }, } def __init__( @@ -29300,7 +31437,7 @@ def __init__( :paramtype target_utilization_percentage: int """ super(TargetUtilizationScaleSettings, self).__init__(**kwargs) - self.scale_type = 'TargetUtilization' # type: str + self.scale_type = "TargetUtilization" # type: str self.max_instances = max_instances self.min_instances = min_instances self.polling_interval = polling_interval @@ -29323,13 +31460,16 @@ class TensorFlow(DistributionConfiguration): """ _validation = { - 'distribution_type': {'required': True}, + "distribution_type": {"required": True}, } _attribute_map = { - 'distribution_type': {'key': 'distributionType', 'type': 'str'}, - 'parameter_server_count': {'key': 'parameterServerCount', 'type': 'int'}, - 'worker_count': {'key': 'workerCount', 'type': 'int'}, + "distribution_type": {"key": "distributionType", "type": "str"}, + "parameter_server_count": { + "key": "parameterServerCount", + "type": "int", + }, + "worker_count": {"key": "workerCount", "type": "int"}, } def __init__( @@ -29346,76 +31486,93 @@ def __init__( :paramtype worker_count: int """ super(TensorFlow, self).__init__(**kwargs) - self.distribution_type = 'TensorFlow' # type: str + self.distribution_type = "TensorFlow" # type: str self.parameter_server_count = parameter_server_count self.worker_count = worker_count class TextClassification(AutoMLVertical, NlpVertical): """Text Classification task in AutoML NLP vertical. -NLP - Natural Language Processing. + NLP - Natural Language Processing. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-Classification task. Possible values include: - "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar fixed_parameters: Model/training parameters that will remain constant throughout + training. + :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] + :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric for Text-Classification task. Possible values include: + "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, + "task_type": {"required": True}, + "training_data": {"required": True}, } _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "NlpFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "search_space": { + "key": "searchSpace", + "type": "[NlpParameterSubspace]", + }, + "sweep_settings": {"key": "sweepSettings", "type": "NlpSweepSettings"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( self, *, training_data: "MLTableJobInput", - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "NlpVerticalFeaturizationSettings" + ] = None, fixed_parameters: Optional["NlpFixedParameters"] = None, limit_settings: Optional["NlpVerticalLimitSettings"] = None, search_space: Optional[List["NlpParameterSubspace"]] = None, @@ -29423,7 +31580,9 @@ def __init__( validation_data: Optional["MLTableJobInput"] = None, log_verbosity: Optional[Union[str, "LogVerbosity"]] = None, target_column_name: Optional[str] = None, - primary_metric: Optional[Union[str, "ClassificationPrimaryMetrics"]] = None, + primary_metric: Optional[ + Union[str, "ClassificationPrimaryMetrics"] + ] = None, **kwargs ): """ @@ -29456,14 +31615,25 @@ def __init__( :paramtype primary_metric: str or ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ - super(TextClassification, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, featurization_settings=featurization_settings, fixed_parameters=fixed_parameters, limit_settings=limit_settings, search_space=search_space, sweep_settings=sweep_settings, validation_data=validation_data, **kwargs) + super(TextClassification, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + featurization_settings=featurization_settings, + fixed_parameters=fixed_parameters, + limit_settings=limit_settings, + search_space=search_space, + sweep_settings=sweep_settings, + validation_data=validation_data, + **kwargs + ) self.featurization_settings = featurization_settings self.fixed_parameters = fixed_parameters self.limit_settings = limit_settings self.search_space = search_space self.sweep_settings = sweep_settings self.validation_data = validation_data - self.task_type = 'TextClassification' # type: str + self.task_type = "TextClassification" # type: str self.primary_metric = primary_metric self.log_verbosity = log_verbosity self.target_column_name = target_column_name @@ -29472,73 +31642,90 @@ def __init__( class TextClassificationMultilabel(AutoMLVertical, NlpVertical): """Text Classification Multilabel task in AutoML NLP vertical. -NLP - Natural Language Processing. + NLP - Natural Language Processing. - Variables are only populated by the server, and will be ignored when sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-Classification-Multilabel task. - Currently only Accuracy is supported as primary metric, hence user need not set it explicitly. - Possible values include: "AUCWeighted", "Accuracy", "NormMacroRecall", - "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted", "IOU". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar fixed_parameters: Model/training parameters that will remain constant throughout + training. + :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] + :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric for Text-Classification-Multilabel task. + Currently only Accuracy is supported as primary metric, hence user need not set it explicitly. + Possible values include: "AUCWeighted", "Accuracy", "NormMacroRecall", + "AveragePrecisionScoreWeighted", "PrecisionScoreWeighted", "IOU". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationMultilabelPrimaryMetrics """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - 'primary_metric': {'readonly': True}, + "task_type": {"required": True}, + "training_data": {"required": True}, + "primary_metric": {"readonly": True}, } _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "NlpFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "search_space": { + "key": "searchSpace", + "type": "[NlpParameterSubspace]", + }, + "sweep_settings": {"key": "sweepSettings", "type": "NlpSweepSettings"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( self, *, training_data: "MLTableJobInput", - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "NlpVerticalFeaturizationSettings" + ] = None, fixed_parameters: Optional["NlpFixedParameters"] = None, limit_settings: Optional["NlpVerticalLimitSettings"] = None, search_space: Optional[List["NlpParameterSubspace"]] = None, @@ -29573,14 +31760,25 @@ def __init__( :keyword training_data: Required. [Required] Training data input. :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ - super(TextClassificationMultilabel, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, featurization_settings=featurization_settings, fixed_parameters=fixed_parameters, limit_settings=limit_settings, search_space=search_space, sweep_settings=sweep_settings, validation_data=validation_data, **kwargs) + super(TextClassificationMultilabel, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + featurization_settings=featurization_settings, + fixed_parameters=fixed_parameters, + limit_settings=limit_settings, + search_space=search_space, + sweep_settings=sweep_settings, + validation_data=validation_data, + **kwargs + ) self.featurization_settings = featurization_settings self.fixed_parameters = fixed_parameters self.limit_settings = limit_settings self.search_space = search_space self.sweep_settings = sweep_settings self.validation_data = validation_data - self.task_type = 'TextClassificationMultilabel' # type: str + self.task_type = "TextClassificationMultilabel" # type: str self.primary_metric = None self.log_verbosity = log_verbosity self.target_column_name = target_column_name @@ -29589,74 +31787,91 @@ def __init__( class TextNer(AutoMLVertical, NlpVertical): """Text-NER task in AutoML NLP vertical. -NER - Named Entity Recognition. -NLP - Natural Language Processing. + NER - Named Entity Recognition. + NLP - Natural Language Processing. - Variables are only populated by the server, and will be ignored when sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to Azure. - :ivar featurization_settings: Featurization inputs needed for AutoML job. - :vartype featurization_settings: - ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings - :ivar fixed_parameters: Model/training parameters that will remain constant throughout - training. - :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters - :ivar limit_settings: Execution constraints for AutoMLJob. - :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings - :ivar search_space: Search space for sampling different combinations of models and their - hyperparameters. - :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] - :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. - :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings - :ivar validation_data: Validation data inputs. - :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", - "Info", "Warning", "Error", "Critical". - :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity - :ivar target_column_name: Target column name: This is prediction values column. - Also known as label column name in context of classification tasks. - :vartype target_column_name: str - :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. - Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", - "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", - "TextClassification", "TextClassificationMultilabel", "TextNER". - :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType - :ivar training_data: Required. [Required] Training data input. - :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput - :ivar primary_metric: Primary metric for Text-NER task. - Only 'Accuracy' is supported for Text-NER, so user need not set this explicitly. Possible - values include: "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", - "PrecisionScoreWeighted". - :vartype primary_metric: str or - ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics + :ivar featurization_settings: Featurization inputs needed for AutoML job. + :vartype featurization_settings: + ~azure.mgmt.machinelearningservices.models.NlpVerticalFeaturizationSettings + :ivar fixed_parameters: Model/training parameters that will remain constant throughout + training. + :vartype fixed_parameters: ~azure.mgmt.machinelearningservices.models.NlpFixedParameters + :ivar limit_settings: Execution constraints for AutoMLJob. + :vartype limit_settings: ~azure.mgmt.machinelearningservices.models.NlpVerticalLimitSettings + :ivar search_space: Search space for sampling different combinations of models and their + hyperparameters. + :vartype search_space: list[~azure.mgmt.machinelearningservices.models.NlpParameterSubspace] + :ivar sweep_settings: Settings for model sweeping and hyperparameter tuning. + :vartype sweep_settings: ~azure.mgmt.machinelearningservices.models.NlpSweepSettings + :ivar validation_data: Validation data inputs. + :vartype validation_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar log_verbosity: Log verbosity for the job. Possible values include: "NotSet", "Debug", + "Info", "Warning", "Error", "Critical". + :vartype log_verbosity: str or ~azure.mgmt.machinelearningservices.models.LogVerbosity + :ivar target_column_name: Target column name: This is prediction values column. + Also known as label column name in context of classification tasks. + :vartype target_column_name: str + :ivar task_type: Required. [Required] Task type for AutoMLJob.Constant filled by server. + Possible values include: "Classification", "Regression", "Forecasting", "ImageClassification", + "ImageClassificationMultilabel", "ImageObjectDetection", "ImageInstanceSegmentation", + "TextClassification", "TextClassificationMultilabel", "TextNER". + :vartype task_type: str or ~azure.mgmt.machinelearningservices.models.TaskType + :ivar training_data: Required. [Required] Training data input. + :vartype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput + :ivar primary_metric: Primary metric for Text-NER task. + Only 'Accuracy' is supported for Text-NER, so user need not set this explicitly. Possible + values include: "AUCWeighted", "Accuracy", "NormMacroRecall", "AveragePrecisionScoreWeighted", + "PrecisionScoreWeighted". + :vartype primary_metric: str or + ~azure.mgmt.machinelearningservices.models.ClassificationPrimaryMetrics """ _validation = { - 'task_type': {'required': True}, - 'training_data': {'required': True}, - 'primary_metric': {'readonly': True}, + "task_type": {"required": True}, + "training_data": {"required": True}, + "primary_metric": {"readonly": True}, } _attribute_map = { - 'featurization_settings': {'key': 'featurizationSettings', 'type': 'NlpVerticalFeaturizationSettings'}, - 'fixed_parameters': {'key': 'fixedParameters', 'type': 'NlpFixedParameters'}, - 'limit_settings': {'key': 'limitSettings', 'type': 'NlpVerticalLimitSettings'}, - 'search_space': {'key': 'searchSpace', 'type': '[NlpParameterSubspace]'}, - 'sweep_settings': {'key': 'sweepSettings', 'type': 'NlpSweepSettings'}, - 'validation_data': {'key': 'validationData', 'type': 'MLTableJobInput'}, - 'log_verbosity': {'key': 'logVerbosity', 'type': 'str'}, - 'target_column_name': {'key': 'targetColumnName', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'training_data': {'key': 'trainingData', 'type': 'MLTableJobInput'}, - 'primary_metric': {'key': 'primaryMetric', 'type': 'str'}, + "featurization_settings": { + "key": "featurizationSettings", + "type": "NlpVerticalFeaturizationSettings", + }, + "fixed_parameters": { + "key": "fixedParameters", + "type": "NlpFixedParameters", + }, + "limit_settings": { + "key": "limitSettings", + "type": "NlpVerticalLimitSettings", + }, + "search_space": { + "key": "searchSpace", + "type": "[NlpParameterSubspace]", + }, + "sweep_settings": {"key": "sweepSettings", "type": "NlpSweepSettings"}, + "validation_data": { + "key": "validationData", + "type": "MLTableJobInput", + }, + "log_verbosity": {"key": "logVerbosity", "type": "str"}, + "target_column_name": {"key": "targetColumnName", "type": "str"}, + "task_type": {"key": "taskType", "type": "str"}, + "training_data": {"key": "trainingData", "type": "MLTableJobInput"}, + "primary_metric": {"key": "primaryMetric", "type": "str"}, } def __init__( self, *, training_data: "MLTableJobInput", - featurization_settings: Optional["NlpVerticalFeaturizationSettings"] = None, + featurization_settings: Optional[ + "NlpVerticalFeaturizationSettings" + ] = None, fixed_parameters: Optional["NlpFixedParameters"] = None, limit_settings: Optional["NlpVerticalLimitSettings"] = None, search_space: Optional[List["NlpParameterSubspace"]] = None, @@ -29691,14 +31906,25 @@ def __init__( :keyword training_data: Required. [Required] Training data input. :paramtype training_data: ~azure.mgmt.machinelearningservices.models.MLTableJobInput """ - super(TextNer, self).__init__(log_verbosity=log_verbosity, target_column_name=target_column_name, training_data=training_data, featurization_settings=featurization_settings, fixed_parameters=fixed_parameters, limit_settings=limit_settings, search_space=search_space, sweep_settings=sweep_settings, validation_data=validation_data, **kwargs) + super(TextNer, self).__init__( + log_verbosity=log_verbosity, + target_column_name=target_column_name, + training_data=training_data, + featurization_settings=featurization_settings, + fixed_parameters=fixed_parameters, + limit_settings=limit_settings, + search_space=search_space, + sweep_settings=sweep_settings, + validation_data=validation_data, + **kwargs + ) self.featurization_settings = featurization_settings self.fixed_parameters = fixed_parameters self.limit_settings = limit_settings self.search_space = search_space self.sweep_settings = sweep_settings self.validation_data = validation_data - self.task_type = 'TextNER' # type: str + self.task_type = "TextNER" # type: str self.primary_metric = None self.log_verbosity = log_verbosity self.target_column_name = target_column_name @@ -29713,15 +31939,10 @@ class TmpfsOptions(msrest.serialization.Model): """ _attribute_map = { - 'size': {'key': 'size', 'type': 'int'}, + "size": {"key": "size", "type": "int"}, } - def __init__( - self, - *, - size: Optional[int] = None, - **kwargs - ): + def __init__(self, *, size: Optional[int] = None, **kwargs): """ :keyword size: Mention the Tmpfs size. :paramtype size: int @@ -29745,26 +31966,21 @@ class TopNFeaturesByAttribution(MonitoringFeatureFilterBase): """ _validation = { - 'filter_type': {'required': True}, + "filter_type": {"required": True}, } _attribute_map = { - 'filter_type': {'key': 'filterType', 'type': 'str'}, - 'top': {'key': 'top', 'type': 'int'}, + "filter_type": {"key": "filterType", "type": "str"}, + "top": {"key": "top", "type": "int"}, } - def __init__( - self, - *, - top: Optional[int] = 10, - **kwargs - ): + def __init__(self, *, top: Optional[int] = 10, **kwargs): """ :keyword top: The number of top features to include. :paramtype top: int """ super(TopNFeaturesByAttribution, self).__init__(**kwargs) - self.filter_type = 'TopNByAttribution' # type: str + self.filter_type = "TopNByAttribution" # type: str self.top = top @@ -29791,17 +32007,31 @@ class TrialComponent(msrest.serialization.Model): """ _validation = { - 'command': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'environment_id': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "command": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, + "environment_id": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'code_id': {'key': 'codeId', 'type': 'str'}, - 'command': {'key': 'command', 'type': 'str'}, - 'distribution': {'key': 'distribution', 'type': 'DistributionConfiguration'}, - 'environment_id': {'key': 'environmentId', 'type': 'str'}, - 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, - 'resources': {'key': 'resources', 'type': 'JobResourceConfiguration'}, + "code_id": {"key": "codeId", "type": "str"}, + "command": {"key": "command", "type": "str"}, + "distribution": { + "key": "distribution", + "type": "DistributionConfiguration", + }, + "environment_id": {"key": "environmentId", "type": "str"}, + "environment_variables": { + "key": "environmentVariables", + "type": "{str}", + }, + "resources": {"key": "resources", "type": "JobResourceConfiguration"}, } def __init__( @@ -29855,18 +32085,23 @@ class TritonInferencingServer(InferencingServer): """ _validation = { - 'server_type': {'required': True}, + "server_type": {"required": True}, } _attribute_map = { - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'inference_configuration': {'key': 'inferenceConfiguration', 'type': 'OnlineInferenceConfiguration'}, + "server_type": {"key": "serverType", "type": "str"}, + "inference_configuration": { + "key": "inferenceConfiguration", + "type": "OnlineInferenceConfiguration", + }, } def __init__( self, *, - inference_configuration: Optional["OnlineInferenceConfiguration"] = None, + inference_configuration: Optional[ + "OnlineInferenceConfiguration" + ] = None, **kwargs ): """ @@ -29875,7 +32110,7 @@ def __init__( ~azure.mgmt.machinelearningservices.models.OnlineInferenceConfiguration """ super(TritonInferencingServer, self).__init__(**kwargs) - self.server_type = 'Triton' # type: str + self.server_type = "Triton" # type: str self.inference_configuration = inference_configuration @@ -29898,15 +32133,15 @@ class TritonModelJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "min_length": 1, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -29926,10 +32161,12 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(TritonModelJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(TritonModelJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'triton_model' # type: str + self.job_input_type = "triton_model" # type: str self.description = description @@ -29958,17 +32195,20 @@ class TritonModelJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "asset_name": {"key": "assetName", "type": "str"}, + "asset_version": {"key": "assetVersion", "type": "str"}, + "auto_delete_setting": { + "key": "autoDeleteSetting", + "type": "AutoDeleteSetting", + }, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -29997,13 +32237,21 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(TritonModelJobOutput, self).__init__(description=description, asset_name=asset_name, asset_version=asset_version, auto_delete_setting=auto_delete_setting, mode=mode, uri=uri, **kwargs) + super(TritonModelJobOutput, self).__init__( + description=description, + asset_name=asset_name, + asset_version=asset_version, + auto_delete_setting=auto_delete_setting, + mode=mode, + uri=uri, + **kwargs + ) self.asset_name = asset_name self.asset_version = asset_version self.auto_delete_setting = auto_delete_setting self.mode = mode self.uri = uri - self.job_output_type = 'triton_model' # type: str + self.job_output_type = "triton_model" # type: str self.description = description @@ -30025,14 +32273,17 @@ class TruncationSelectionPolicy(EarlyTerminationPolicy): """ _validation = { - 'policy_type': {'required': True}, + "policy_type": {"required": True}, } _attribute_map = { - 'delay_evaluation': {'key': 'delayEvaluation', 'type': 'int'}, - 'evaluation_interval': {'key': 'evaluationInterval', 'type': 'int'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'truncation_percentage': {'key': 'truncationPercentage', 'type': 'int'}, + "delay_evaluation": {"key": "delayEvaluation", "type": "int"}, + "evaluation_interval": {"key": "evaluationInterval", "type": "int"}, + "policy_type": {"key": "policyType", "type": "str"}, + "truncation_percentage": { + "key": "truncationPercentage", + "type": "int", + }, } def __init__( @@ -30051,8 +32302,12 @@ def __init__( :keyword truncation_percentage: The percentage of runs to cancel at each evaluation interval. :paramtype truncation_percentage: int """ - super(TruncationSelectionPolicy, self).__init__(delay_evaluation=delay_evaluation, evaluation_interval=evaluation_interval, **kwargs) - self.policy_type = 'TruncationSelection' # type: str + super(TruncationSelectionPolicy, self).__init__( + delay_evaluation=delay_evaluation, + evaluation_interval=evaluation_interval, + **kwargs + ) + self.policy_type = "TruncationSelection" # type: str self.truncation_percentage = truncation_percentage @@ -30077,17 +32332,17 @@ class UpdateWorkspaceQuotas(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, + "id": {"readonly": True}, + "type": {"readonly": True}, + "unit": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "limit": {"key": "limit", "type": "long"}, + "unit": {"key": "unit", "type": "str"}, + "status": {"key": "status", "type": "str"}, } def __init__( @@ -30127,21 +32382,17 @@ class UpdateWorkspaceQuotasResult(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[UpdateWorkspaceQuotas]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[UpdateWorkspaceQuotas]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UpdateWorkspaceQuotasResult, self).__init__(**kwargs) self.value = None self.next_link = None @@ -30180,21 +32431,31 @@ class UriFileDataVersion(DataVersionBaseProperties): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "auto_delete_setting": { + "key": "autoDeleteSetting", + "type": "AutoDeleteSetting", + }, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, + "intellectual_property": { + "key": "intellectualProperty", + "type": "IntellectualProperty", + }, + "stage": {"key": "stage", "type": "str"}, } def __init__( @@ -30236,8 +32497,19 @@ def __init__( :keyword stage: Stage in the data lifecycle assigned to this data asset. :paramtype stage: str """ - super(UriFileDataVersion, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, intellectual_property=intellectual_property, stage=stage, **kwargs) - self.data_type = 'uri_file' # type: str + super(UriFileDataVersion, self).__init__( + description=description, + properties=properties, + tags=tags, + auto_delete_setting=auto_delete_setting, + is_anonymous=is_anonymous, + is_archived=is_archived, + data_uri=data_uri, + intellectual_property=intellectual_property, + stage=stage, + **kwargs + ) + self.data_type = "uri_file" # type: str class UriFileJobInput(JobInput, AssetJobInput): @@ -30259,15 +32531,15 @@ class UriFileJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "min_length": 1, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -30287,10 +32559,12 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(UriFileJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(UriFileJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'uri_file' # type: str + self.job_input_type = "uri_file" # type: str self.description = description @@ -30319,17 +32593,20 @@ class UriFileJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "asset_name": {"key": "assetName", "type": "str"}, + "asset_version": {"key": "assetVersion", "type": "str"}, + "auto_delete_setting": { + "key": "autoDeleteSetting", + "type": "AutoDeleteSetting", + }, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -30358,13 +32635,21 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(UriFileJobOutput, self).__init__(description=description, asset_name=asset_name, asset_version=asset_version, auto_delete_setting=auto_delete_setting, mode=mode, uri=uri, **kwargs) + super(UriFileJobOutput, self).__init__( + description=description, + asset_name=asset_name, + asset_version=asset_version, + auto_delete_setting=auto_delete_setting, + mode=mode, + uri=uri, + **kwargs + ) self.asset_name = asset_name self.asset_version = asset_version self.auto_delete_setting = auto_delete_setting self.mode = mode self.uri = uri - self.job_output_type = 'uri_file' # type: str + self.job_output_type = "uri_file" # type: str self.description = description @@ -30401,21 +32686,31 @@ class UriFolderDataVersion(DataVersionBaseProperties): """ _validation = { - 'data_type': {'required': True}, - 'data_uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, + "data_type": {"required": True}, + "data_uri": { + "required": True, + "min_length": 1, + "pattern": r"[a-zA-Z0-9_]", + }, } _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, - 'is_archived': {'key': 'isArchived', 'type': 'bool'}, - 'data_type': {'key': 'dataType', 'type': 'str'}, - 'data_uri': {'key': 'dataUri', 'type': 'str'}, - 'intellectual_property': {'key': 'intellectualProperty', 'type': 'IntellectualProperty'}, - 'stage': {'key': 'stage', 'type': 'str'}, + "description": {"key": "description", "type": "str"}, + "properties": {"key": "properties", "type": "{str}"}, + "tags": {"key": "tags", "type": "{str}"}, + "auto_delete_setting": { + "key": "autoDeleteSetting", + "type": "AutoDeleteSetting", + }, + "is_anonymous": {"key": "isAnonymous", "type": "bool"}, + "is_archived": {"key": "isArchived", "type": "bool"}, + "data_type": {"key": "dataType", "type": "str"}, + "data_uri": {"key": "dataUri", "type": "str"}, + "intellectual_property": { + "key": "intellectualProperty", + "type": "IntellectualProperty", + }, + "stage": {"key": "stage", "type": "str"}, } def __init__( @@ -30457,8 +32752,19 @@ def __init__( :keyword stage: Stage in the data lifecycle assigned to this data asset. :paramtype stage: str """ - super(UriFolderDataVersion, self).__init__(description=description, properties=properties, tags=tags, auto_delete_setting=auto_delete_setting, is_anonymous=is_anonymous, is_archived=is_archived, data_uri=data_uri, intellectual_property=intellectual_property, stage=stage, **kwargs) - self.data_type = 'uri_folder' # type: str + super(UriFolderDataVersion, self).__init__( + description=description, + properties=properties, + tags=tags, + auto_delete_setting=auto_delete_setting, + is_anonymous=is_anonymous, + is_archived=is_archived, + data_uri=data_uri, + intellectual_property=intellectual_property, + stage=stage, + **kwargs + ) + self.data_type = "uri_folder" # type: str class UriFolderJobInput(JobInput, AssetJobInput): @@ -30480,15 +32786,15 @@ class UriFolderJobInput(JobInput, AssetJobInput): """ _validation = { - 'uri': {'required': True, 'min_length': 1, 'pattern': r'[a-zA-Z0-9_]'}, - 'job_input_type': {'required': True}, + "uri": {"required": True, "min_length": 1, "pattern": r"[a-zA-Z0-9_]"}, + "job_input_type": {"required": True}, } _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_input_type': {'key': 'jobInputType', 'type': 'str'}, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_input_type": {"key": "jobInputType", "type": "str"}, } def __init__( @@ -30508,10 +32814,12 @@ def __init__( :keyword description: Description for the input. :paramtype description: str """ - super(UriFolderJobInput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(UriFolderJobInput, self).__init__( + description=description, mode=mode, uri=uri, **kwargs + ) self.mode = mode self.uri = uri - self.job_input_type = 'uri_folder' # type: str + self.job_input_type = "uri_folder" # type: str self.description = description @@ -30540,17 +32848,20 @@ class UriFolderJobOutput(JobOutput, AssetJobOutput): """ _validation = { - 'job_output_type': {'required': True}, + "job_output_type": {"required": True}, } _attribute_map = { - 'asset_name': {'key': 'assetName', 'type': 'str'}, - 'asset_version': {'key': 'assetVersion', 'type': 'str'}, - 'auto_delete_setting': {'key': 'autoDeleteSetting', 'type': 'AutoDeleteSetting'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, + "asset_name": {"key": "assetName", "type": "str"}, + "asset_version": {"key": "assetVersion", "type": "str"}, + "auto_delete_setting": { + "key": "autoDeleteSetting", + "type": "AutoDeleteSetting", + }, + "mode": {"key": "mode", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "job_output_type": {"key": "jobOutputType", "type": "str"}, } def __init__( @@ -30579,13 +32890,21 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(UriFolderJobOutput, self).__init__(description=description, asset_name=asset_name, asset_version=asset_version, auto_delete_setting=auto_delete_setting, mode=mode, uri=uri, **kwargs) + super(UriFolderJobOutput, self).__init__( + description=description, + asset_name=asset_name, + asset_version=asset_version, + auto_delete_setting=auto_delete_setting, + mode=mode, + uri=uri, + **kwargs + ) self.asset_name = asset_name self.asset_version = asset_version self.auto_delete_setting = auto_delete_setting self.mode = mode self.uri = uri - self.job_output_type = 'uri_folder' # type: str + self.job_output_type = "uri_folder" # type: str self.description = description @@ -30611,31 +32930,30 @@ class Usage(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'aml_workspace_location': {'readonly': True}, - 'type': {'readonly': True}, - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, + "id": {"readonly": True}, + "aml_workspace_location": {"readonly": True}, + "type": {"readonly": True}, + "unit": {"readonly": True}, + "current_value": {"readonly": True}, + "limit": {"readonly": True}, + "name": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'aml_workspace_location': {'key': 'amlWorkspaceLocation', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'current_value': {'key': 'currentValue', 'type': 'long'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'name': {'key': 'name', 'type': 'UsageName'}, + "id": {"key": "id", "type": "str"}, + "aml_workspace_location": { + "key": "amlWorkspaceLocation", + "type": "str", + }, + "type": {"key": "type", "type": "str"}, + "unit": {"key": "unit", "type": "str"}, + "current_value": {"key": "currentValue", "type": "long"}, + "limit": {"key": "limit", "type": "long"}, + "name": {"key": "name", "type": "UsageName"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(Usage, self).__init__(**kwargs) self.id = None self.aml_workspace_location = None @@ -30658,21 +32976,17 @@ class UsageName(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, + "value": {"readonly": True}, + "localized_value": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + "value": {"key": "value", "type": "str"}, + "localized_value": {"key": "localizedValue", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UsageName, self).__init__(**kwargs) self.value = None self.localized_value = None @@ -30693,13 +33007,16 @@ class UserAccountCredentials(msrest.serialization.Model): """ _validation = { - 'admin_user_name': {'required': True}, + "admin_user_name": {"required": True}, } _attribute_map = { - 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, - 'admin_user_ssh_public_key': {'key': 'adminUserSshPublicKey', 'type': 'str'}, - 'admin_user_password': {'key': 'adminUserPassword', 'type': 'str'}, + "admin_user_name": {"key": "adminUserName", "type": "str"}, + "admin_user_ssh_public_key": { + "key": "adminUserSshPublicKey", + "type": "str", + }, + "admin_user_password": {"key": "adminUserPassword", "type": "str"}, } def __init__( @@ -30737,21 +33054,17 @@ class UserAssignedIdentity(msrest.serialization.Model): """ _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, + "principal_id": {"readonly": True}, + "client_id": {"readonly": True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, + "principal_id": {"key": "principalId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UserAssignedIdentity, self).__init__(**kwargs) self.principal_id = None self.client_id = None @@ -30765,14 +33078,11 @@ class UserCreatedAcrAccount(msrest.serialization.Model): """ _attribute_map = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, + "arm_resource_id": {"key": "armResourceId", "type": "ArmResourceId"}, } def __init__( - self, - *, - arm_resource_id: Optional["ArmResourceId"] = None, - **kwargs + self, *, arm_resource_id: Optional["ArmResourceId"] = None, **kwargs ): """ :keyword arm_resource_id: ARM ResourceId of a resource. @@ -30790,14 +33100,11 @@ class UserCreatedStorageAccount(msrest.serialization.Model): """ _attribute_map = { - 'arm_resource_id': {'key': 'armResourceId', 'type': 'ArmResourceId'}, + "arm_resource_id": {"key": "armResourceId", "type": "ArmResourceId"}, } def __init__( - self, - *, - arm_resource_id: Optional["ArmResourceId"] = None, - **kwargs + self, *, arm_resource_id: Optional["ArmResourceId"] = None, **kwargs ): """ :keyword arm_resource_id: ARM ResourceId of a resource. @@ -30819,24 +33126,22 @@ class UserIdentity(IdentityConfiguration): """ _validation = { - 'identity_type': {'required': True}, + "identity_type": {"required": True}, } _attribute_map = { - 'identity_type': {'key': 'identityType', 'type': 'str'}, + "identity_type": {"key": "identityType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super(UserIdentity, self).__init__(**kwargs) - self.identity_type = 'UserIdentity' # type: str + self.identity_type = "UserIdentity" # type: str -class UsernamePasswordAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionPropertiesV2): +class UsernamePasswordAuthTypeWorkspaceConnectionProperties( + WorkspaceConnectionPropertiesV2 +): """UsernamePasswordAuthTypeWorkspaceConnectionProperties. All required parameters must be populated in order to send to Azure. @@ -30863,17 +33168,20 @@ class UsernamePasswordAuthTypeWorkspaceConnectionProperties(WorkspaceConnectionP """ _validation = { - 'auth_type': {'required': True}, + "auth_type": {"required": True}, } _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'expiry_time': {'key': 'expiryTime', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'value_format': {'key': 'valueFormat', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'WorkspaceConnectionUsernamePassword'}, + "auth_type": {"key": "authType", "type": "str"}, + "expiry_time": {"key": "expiryTime", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "value_format": {"key": "valueFormat", "type": "str"}, + "credentials": { + "key": "credentials", + "type": "WorkspaceConnectionUsernamePassword", + }, } def __init__( @@ -30905,8 +33213,17 @@ def __init__( :paramtype credentials: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionUsernamePassword """ - super(UsernamePasswordAuthTypeWorkspaceConnectionProperties, self).__init__(expiry_time=expiry_time, category=category, target=target, value=value, value_format=value_format, **kwargs) - self.auth_type = 'UsernamePassword' # type: str + super( + UsernamePasswordAuthTypeWorkspaceConnectionProperties, self + ).__init__( + expiry_time=expiry_time, + category=category, + target=target, + value=value, + value_format=value_format, + **kwargs + ) + self.auth_type = "UsernamePassword" # type: str self.credentials = credentials @@ -30918,7 +33235,10 @@ class VirtualMachineSchema(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, + "properties": { + "key": "properties", + "type": "VirtualMachineSchemaProperties", + }, } def __init__( @@ -30975,26 +33295,32 @@ class VirtualMachine(Compute, VirtualMachineSchema): """ _validation = { - 'compute_type': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'provisioning_errors': {'readonly': True}, - 'is_attached_compute': {'readonly': True}, + "compute_type": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_on": {"readonly": True}, + "modified_on": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "is_attached_compute": {"readonly": True}, } _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VirtualMachineSchemaProperties'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, - 'compute_location': {'key': 'computeLocation', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[ErrorResponse]'}, - 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, - 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + "properties": { + "key": "properties", + "type": "VirtualMachineSchemaProperties", + }, + "compute_type": {"key": "computeType", "type": "str"}, + "compute_location": {"key": "computeLocation", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "modified_on": {"key": "modifiedOn", "type": "iso-8601"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "provisioning_errors": { + "key": "provisioningErrors", + "type": "[ErrorResponse]", + }, + "is_attached_compute": {"key": "isAttachedCompute", "type": "bool"}, + "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, } def __init__( @@ -31021,9 +33347,16 @@ def __init__( MSI and AAD exclusively for authentication. :paramtype disable_local_auth: bool """ - super(VirtualMachine, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) + super(VirtualMachine, self).__init__( + compute_location=compute_location, + description=description, + resource_id=resource_id, + disable_local_auth=disable_local_auth, + properties=properties, + **kwargs + ) self.properties = properties - self.compute_type = 'VirtualMachine' # type: str + self.compute_type = "VirtualMachine" # type: str self.compute_location = compute_location self.provisioning_state = None self.description = description @@ -31045,19 +33378,14 @@ class VirtualMachineImage(msrest.serialization.Model): """ _validation = { - 'id': {'required': True}, + "id": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, } - def __init__( - self, - *, - id: str, - **kwargs - ): + def __init__(self, *, id: str, **kwargs): """ :keyword id: Required. Virtual Machine image path. :paramtype id: str @@ -31086,12 +33414,18 @@ class VirtualMachineSchemaProperties(msrest.serialization.Model): """ _attribute_map = { - 'virtual_machine_size': {'key': 'virtualMachineSize', 'type': 'str'}, - 'ssh_port': {'key': 'sshPort', 'type': 'int'}, - 'notebook_server_port': {'key': 'notebookServerPort', 'type': 'int'}, - 'address': {'key': 'address', 'type': 'str'}, - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'is_notebook_instance_compute': {'key': 'isNotebookInstanceCompute', 'type': 'bool'}, + "virtual_machine_size": {"key": "virtualMachineSize", "type": "str"}, + "ssh_port": {"key": "sshPort", "type": "int"}, + "notebook_server_port": {"key": "notebookServerPort", "type": "int"}, + "address": {"key": "address", "type": "str"}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, + "is_notebook_instance_compute": { + "key": "isNotebookInstanceCompute", + "type": "bool", + }, } def __init__( @@ -31139,7 +33473,10 @@ class VirtualMachineSecretsSchema(msrest.serialization.Model): """ _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, } def __init__( @@ -31172,12 +33509,15 @@ class VirtualMachineSecrets(ComputeSecrets, VirtualMachineSecretsSchema): """ _validation = { - 'compute_type': {'required': True}, + "compute_type": {"required": True}, } _attribute_map = { - 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, - 'compute_type': {'key': 'computeType', 'type': 'str'}, + "administrator_account": { + "key": "administratorAccount", + "type": "VirtualMachineSshCredentials", + }, + "compute_type": {"key": "computeType", "type": "str"}, } def __init__( @@ -31191,9 +33531,11 @@ def __init__( :paramtype administrator_account: ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials """ - super(VirtualMachineSecrets, self).__init__(administrator_account=administrator_account, **kwargs) + super(VirtualMachineSecrets, self).__init__( + administrator_account=administrator_account, **kwargs + ) self.administrator_account = administrator_account - self.compute_type = 'VirtualMachine' # type: str + self.compute_type = "VirtualMachine" # type: str class VirtualMachineSize(msrest.serialization.Model): @@ -31228,29 +33570,38 @@ class VirtualMachineSize(msrest.serialization.Model): """ _validation = { - 'name': {'readonly': True}, - 'family': {'readonly': True}, - 'v_cp_us': {'readonly': True}, - 'gpus': {'readonly': True}, - 'os_vhd_size_mb': {'readonly': True}, - 'max_resource_volume_mb': {'readonly': True}, - 'memory_gb': {'readonly': True}, - 'low_priority_capable': {'readonly': True}, - 'premium_io': {'readonly': True}, + "name": {"readonly": True}, + "family": {"readonly": True}, + "v_cp_us": {"readonly": True}, + "gpus": {"readonly": True}, + "os_vhd_size_mb": {"readonly": True}, + "max_resource_volume_mb": {"readonly": True}, + "memory_gb": {"readonly": True}, + "low_priority_capable": {"readonly": True}, + "premium_io": {"readonly": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'v_cp_us': {'key': 'vCPUs', 'type': 'int'}, - 'gpus': {'key': 'gpus', 'type': 'int'}, - 'os_vhd_size_mb': {'key': 'osVhdSizeMB', 'type': 'int'}, - 'max_resource_volume_mb': {'key': 'maxResourceVolumeMB', 'type': 'int'}, - 'memory_gb': {'key': 'memoryGB', 'type': 'float'}, - 'low_priority_capable': {'key': 'lowPriorityCapable', 'type': 'bool'}, - 'premium_io': {'key': 'premiumIO', 'type': 'bool'}, - 'estimated_vm_prices': {'key': 'estimatedVMPrices', 'type': 'EstimatedVMPrices'}, - 'supported_compute_types': {'key': 'supportedComputeTypes', 'type': '[str]'}, + "name": {"key": "name", "type": "str"}, + "family": {"key": "family", "type": "str"}, + "v_cp_us": {"key": "vCPUs", "type": "int"}, + "gpus": {"key": "gpus", "type": "int"}, + "os_vhd_size_mb": {"key": "osVhdSizeMB", "type": "int"}, + "max_resource_volume_mb": { + "key": "maxResourceVolumeMB", + "type": "int", + }, + "memory_gb": {"key": "memoryGB", "type": "float"}, + "low_priority_capable": {"key": "lowPriorityCapable", "type": "bool"}, + "premium_io": {"key": "premiumIO", "type": "bool"}, + "estimated_vm_prices": { + "key": "estimatedVMPrices", + "type": "EstimatedVMPrices", + }, + "supported_compute_types": { + "key": "supportedComputeTypes", + "type": "[str]", + }, } def __init__( @@ -31289,14 +33640,11 @@ class VirtualMachineSizeListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[VirtualMachineSize]'}, + "value": {"key": "value", "type": "[VirtualMachineSize]"}, } def __init__( - self, - *, - value: Optional[List["VirtualMachineSize"]] = None, - **kwargs + self, *, value: Optional[List["VirtualMachineSize"]] = None, **kwargs ): """ :keyword value: The list of virtual machine sizes supported by AmlCompute. @@ -31320,10 +33668,10 @@ class VirtualMachineSshCredentials(msrest.serialization.Model): """ _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'public_key_data': {'key': 'publicKeyData', 'type': 'str'}, - 'private_key_data': {'key': 'privateKeyData', 'type': 'str'}, + "username": {"key": "username", "type": "str"}, + "password": {"key": "password", "type": "str"}, + "public_key_data": {"key": "publicKeyData", "type": "str"}, + "private_key_data": {"key": "privateKeyData", "type": "str"}, } def __init__( @@ -31375,14 +33723,14 @@ class VolumeDefinition(msrest.serialization.Model): """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'read_only': {'key': 'readOnly', 'type': 'bool'}, - 'source': {'key': 'source', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'consistency': {'key': 'consistency', 'type': 'str'}, - 'bind': {'key': 'bind', 'type': 'BindOptions'}, - 'volume': {'key': 'volume', 'type': 'VolumeOptions'}, - 'tmpfs': {'key': 'tmpfs', 'type': 'TmpfsOptions'}, + "type": {"key": "type", "type": "str"}, + "read_only": {"key": "readOnly", "type": "bool"}, + "source": {"key": "source", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "consistency": {"key": "consistency", "type": "str"}, + "bind": {"key": "bind", "type": "BindOptions"}, + "volume": {"key": "volume", "type": "VolumeOptions"}, + "tmpfs": {"key": "tmpfs", "type": "TmpfsOptions"}, } def __init__( @@ -31437,15 +33785,10 @@ class VolumeOptions(msrest.serialization.Model): """ _attribute_map = { - 'nocopy': {'key': 'nocopy', 'type': 'bool'}, + "nocopy": {"key": "nocopy", "type": "bool"}, } - def __init__( - self, - *, - nocopy: Optional[bool] = None, - **kwargs - ): + def __init__(self, *, nocopy: Optional[bool] = None, **kwargs): """ :keyword nocopy: Indicate whether volume is nocopy. :paramtype nocopy: bool @@ -31583,72 +33926,150 @@ class Workspace(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'workspace_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'service_provisioned_resource_group': {'readonly': True}, - 'private_link_count': {'readonly': True}, - 'private_endpoint_connections': {'readonly': True}, - 'notebook_info': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'storage_hns_enabled': {'readonly': True}, - 'ml_flow_tracking_uri': {'readonly': True}, - 'soft_deleted_at': {'readonly': True}, - 'scheduled_purge_date': {'readonly': True}, - 'associated_workspaces': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'key_vault': {'key': 'properties.keyVault', 'type': 'str'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'storage_account': {'key': 'properties.storageAccount', 'type': 'str'}, - 'discovery_url': {'key': 'properties.discoveryUrl', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionProperty'}, - 'hbi_workspace': {'key': 'properties.hbiWorkspace', 'type': 'bool'}, - 'service_provisioned_resource_group': {'key': 'properties.serviceProvisionedResourceGroup', 'type': 'str'}, - 'private_link_count': {'key': 'properties.privateLinkCount', 'type': 'int'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'allow_public_access_when_behind_vnet': {'key': 'properties.allowPublicAccessWhenBehindVnet', 'type': 'bool'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, - 'shared_private_link_resources': {'key': 'properties.sharedPrivateLinkResources', 'type': '[SharedPrivateLinkResource]'}, - 'notebook_info': {'key': 'properties.notebookInfo', 'type': 'NotebookResourceInfo'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, - 'storage_hns_enabled': {'key': 'properties.storageHnsEnabled', 'type': 'bool'}, - 'ml_flow_tracking_uri': {'key': 'properties.mlFlowTrackingUri', 'type': 'str'}, - 'v1_legacy_mode': {'key': 'properties.v1LegacyMode', 'type': 'bool'}, - 'soft_deleted_at': {'key': 'properties.softDeletedAt', 'type': 'str'}, - 'scheduled_purge_date': {'key': 'properties.scheduledPurgeDate', 'type': 'str'}, - 'system_datastores_auth_mode': {'key': 'properties.systemDatastoresAuthMode', 'type': 'str'}, - 'feature_store_settings': {'key': 'properties.featureStoreSettings', 'type': 'FeatureStoreSettings'}, - 'soft_delete_retention_in_days': {'key': 'properties.softDeleteRetentionInDays', 'type': 'int'}, - 'enable_data_isolation': {'key': 'properties.enableDataIsolation', 'type': 'bool'}, - 'storage_accounts': {'key': 'properties.storageAccounts', 'type': '[str]'}, - 'key_vaults': {'key': 'properties.keyVaults', 'type': '[str]'}, - 'container_registries': {'key': 'properties.containerRegistries', 'type': '[str]'}, - 'existing_workspaces': {'key': 'properties.existingWorkspaces', 'type': '[str]'}, - 'hub_resource_id': {'key': 'properties.hubResourceId', 'type': 'str'}, - 'associated_workspaces': {'key': 'properties.associatedWorkspaces', 'type': '[str]'}, - 'managed_network': {'key': 'properties.managedNetwork', 'type': 'ManagedNetworkSettings'}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "workspace_id": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "service_provisioned_resource_group": {"readonly": True}, + "private_link_count": {"readonly": True}, + "private_endpoint_connections": {"readonly": True}, + "notebook_info": {"readonly": True}, + "tenant_id": {"readonly": True}, + "storage_hns_enabled": {"readonly": True}, + "ml_flow_tracking_uri": {"readonly": True}, + "soft_deleted_at": {"readonly": True}, + "scheduled_purge_date": {"readonly": True}, + "associated_workspaces": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "kind": {"key": "kind", "type": "str"}, + "workspace_id": {"key": "properties.workspaceId", "type": "str"}, + "description": {"key": "properties.description", "type": "str"}, + "friendly_name": {"key": "properties.friendlyName", "type": "str"}, + "key_vault": {"key": "properties.keyVault", "type": "str"}, + "application_insights": { + "key": "properties.applicationInsights", + "type": "str", + }, + "container_registry": { + "key": "properties.containerRegistry", + "type": "str", + }, + "storage_account": {"key": "properties.storageAccount", "type": "str"}, + "discovery_url": {"key": "properties.discoveryUrl", "type": "str"}, + "provisioning_state": { + "key": "properties.provisioningState", + "type": "str", + }, + "encryption": { + "key": "properties.encryption", + "type": "EncryptionProperty", + }, + "hbi_workspace": {"key": "properties.hbiWorkspace", "type": "bool"}, + "service_provisioned_resource_group": { + "key": "properties.serviceProvisionedResourceGroup", + "type": "str", + }, + "private_link_count": { + "key": "properties.privateLinkCount", + "type": "int", + }, + "image_build_compute": { + "key": "properties.imageBuildCompute", + "type": "str", + }, + "allow_public_access_when_behind_vnet": { + "key": "properties.allowPublicAccessWhenBehindVnet", + "type": "bool", + }, + "public_network_access": { + "key": "properties.publicNetworkAccess", + "type": "str", + }, + "private_endpoint_connections": { + "key": "properties.privateEndpointConnections", + "type": "[PrivateEndpointConnection]", + }, + "shared_private_link_resources": { + "key": "properties.sharedPrivateLinkResources", + "type": "[SharedPrivateLinkResource]", + }, + "notebook_info": { + "key": "properties.notebookInfo", + "type": "NotebookResourceInfo", + }, + "service_managed_resources_settings": { + "key": "properties.serviceManagedResourcesSettings", + "type": "ServiceManagedResourcesSettings", + }, + "primary_user_assigned_identity": { + "key": "properties.primaryUserAssignedIdentity", + "type": "str", + }, + "tenant_id": {"key": "properties.tenantId", "type": "str"}, + "storage_hns_enabled": { + "key": "properties.storageHnsEnabled", + "type": "bool", + }, + "ml_flow_tracking_uri": { + "key": "properties.mlFlowTrackingUri", + "type": "str", + }, + "v1_legacy_mode": {"key": "properties.v1LegacyMode", "type": "bool"}, + "soft_deleted_at": {"key": "properties.softDeletedAt", "type": "str"}, + "scheduled_purge_date": { + "key": "properties.scheduledPurgeDate", + "type": "str", + }, + "system_datastores_auth_mode": { + "key": "properties.systemDatastoresAuthMode", + "type": "str", + }, + "feature_store_settings": { + "key": "properties.featureStoreSettings", + "type": "FeatureStoreSettings", + }, + "soft_delete_retention_in_days": { + "key": "properties.softDeleteRetentionInDays", + "type": "int", + }, + "enable_data_isolation": { + "key": "properties.enableDataIsolation", + "type": "bool", + }, + "storage_accounts": { + "key": "properties.storageAccounts", + "type": "[str]", + }, + "key_vaults": {"key": "properties.keyVaults", "type": "[str]"}, + "container_registries": { + "key": "properties.containerRegistries", + "type": "[str]", + }, + "existing_workspaces": { + "key": "properties.existingWorkspaces", + "type": "[str]", + }, + "hub_resource_id": {"key": "properties.hubResourceId", "type": "str"}, + "associated_workspaces": { + "key": "properties.associatedWorkspaces", + "type": "[str]", + }, + "managed_network": { + "key": "properties.managedNetwork", + "type": "ManagedNetworkSettings", + }, } def __init__( @@ -31670,9 +34091,15 @@ def __init__( hbi_workspace: Optional[bool] = False, image_build_compute: Optional[str] = None, allow_public_access_when_behind_vnet: Optional[bool] = False, - public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, - shared_private_link_resources: Optional[List["SharedPrivateLinkResource"]] = None, - service_managed_resources_settings: Optional["ServiceManagedResourcesSettings"] = None, + public_network_access: Optional[ + Union[str, "PublicNetworkAccess"] + ] = None, + shared_private_link_resources: Optional[ + List["SharedPrivateLinkResource"] + ] = None, + service_managed_resources_settings: Optional[ + "ServiceManagedResourcesSettings" + ] = None, primary_user_assigned_identity: Optional[str] = None, v1_legacy_mode: Optional[bool] = False, system_datastores_auth_mode: Optional[str] = None, @@ -31788,12 +34215,16 @@ def __init__( self.service_provisioned_resource_group = None self.private_link_count = None self.image_build_compute = image_build_compute - self.allow_public_access_when_behind_vnet = allow_public_access_when_behind_vnet + self.allow_public_access_when_behind_vnet = ( + allow_public_access_when_behind_vnet + ) self.public_network_access = public_network_access self.private_endpoint_connections = None self.shared_private_link_resources = shared_private_link_resources self.notebook_info = None - self.service_managed_resources_settings = service_managed_resources_settings + self.service_managed_resources_settings = ( + service_managed_resources_settings + ) self.primary_user_assigned_identity = primary_user_assigned_identity self.tenant_id = None self.storage_hns_enabled = None @@ -31824,8 +34255,8 @@ class WorkspaceConnectionAccessKey(msrest.serialization.Model): """ _attribute_map = { - 'access_key_id': {'key': 'accessKeyId', 'type': 'str'}, - 'secret_access_key': {'key': 'secretAccessKey', 'type': 'str'}, + "access_key_id": {"key": "accessKeyId", "type": "str"}, + "secret_access_key": {"key": "secretAccessKey", "type": "str"}, } def __init__( @@ -31856,8 +34287,8 @@ class WorkspaceConnectionManagedIdentity(msrest.serialization.Model): """ _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, + "resource_id": {"key": "resourceId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, } def __init__( @@ -31886,15 +34317,10 @@ class WorkspaceConnectionPersonalAccessToken(msrest.serialization.Model): """ _attribute_map = { - 'pat': {'key': 'pat', 'type': 'str'}, + "pat": {"key": "pat", "type": "str"}, } - def __init__( - self, - *, - pat: Optional[str] = None, - **kwargs - ): + def __init__(self, *, pat: Optional[str] = None, **kwargs): """ :keyword pat: :paramtype pat: str @@ -31926,37 +34352,41 @@ class WorkspaceConnectionPropertiesV2BasicResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'properties': {'key': 'properties', 'type': 'WorkspaceConnectionPropertiesV2'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": { + "key": "properties", + "type": "WorkspaceConnectionPropertiesV2", + }, } def __init__( - self, - *, - properties: "WorkspaceConnectionPropertiesV2", - **kwargs + self, *, properties: "WorkspaceConnectionPropertiesV2", **kwargs ): """ :keyword properties: Required. :paramtype properties: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2 """ - super(WorkspaceConnectionPropertiesV2BasicResource, self).__init__(**kwargs) + super(WorkspaceConnectionPropertiesV2BasicResource, self).__init__( + **kwargs + ) self.properties = properties -class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(msrest.serialization.Model): +class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult( + msrest.serialization.Model +): """WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult. Variables are only populated by the server, and will be ignored when sending a request. @@ -31969,18 +34399,23 @@ class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(msrest.seri """ _validation = { - 'next_link': {'readonly': True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[WorkspaceConnectionPropertiesV2BasicResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": { + "key": "value", + "type": "[WorkspaceConnectionPropertiesV2BasicResource]", + }, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( self, *, - value: Optional[List["WorkspaceConnectionPropertiesV2BasicResource"]] = None, + value: Optional[ + List["WorkspaceConnectionPropertiesV2BasicResource"] + ] = None, **kwargs ): """ @@ -31988,7 +34423,10 @@ def __init__( :paramtype value: list[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource] """ - super(WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, self).__init__(**kwargs) + super( + WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, + self, + ).__init__(**kwargs) self.value = value self.next_link = None @@ -32005,9 +34443,9 @@ class WorkspaceConnectionServicePrincipal(msrest.serialization.Model): """ _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + "client_id": {"key": "clientId", "type": "str"}, + "client_secret": {"key": "clientSecret", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, } def __init__( @@ -32040,20 +34478,17 @@ class WorkspaceConnectionSharedAccessSignature(msrest.serialization.Model): """ _attribute_map = { - 'sas': {'key': 'sas', 'type': 'str'}, + "sas": {"key": "sas", "type": "str"}, } - def __init__( - self, - *, - sas: Optional[str] = None, - **kwargs - ): + def __init__(self, *, sas: Optional[str] = None, **kwargs): """ :keyword sas: :paramtype sas: str """ - super(WorkspaceConnectionSharedAccessSignature, self).__init__(**kwargs) + super(WorkspaceConnectionSharedAccessSignature, self).__init__( + **kwargs + ) self.sas = sas @@ -32067,8 +34502,8 @@ class WorkspaceConnectionUsernamePassword(msrest.serialization.Model): """ _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, + "username": {"key": "username", "type": "str"}, + "password": {"key": "password", "type": "str"}, } def __init__( @@ -32101,8 +34536,8 @@ class WorkspaceListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[Workspace]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Workspace]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( @@ -32164,20 +34599,47 @@ class WorkspaceUpdateParameters(msrest.serialization.Model): """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, - 'image_build_compute': {'key': 'properties.imageBuildCompute', 'type': 'str'}, - 'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'}, - 'primary_user_assigned_identity': {'key': 'properties.primaryUserAssignedIdentity', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'application_insights': {'key': 'properties.applicationInsights', 'type': 'str'}, - 'container_registry': {'key': 'properties.containerRegistry', 'type': 'str'}, - 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionUpdateProperties'}, - 'feature_store_settings': {'key': 'properties.featureStoreSettings', 'type': 'FeatureStoreSettings'}, - 'managed_network': {'key': 'properties.managedNetwork', 'type': 'ManagedNetworkSettings'}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "Sku"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "description": {"key": "properties.description", "type": "str"}, + "friendly_name": {"key": "properties.friendlyName", "type": "str"}, + "image_build_compute": { + "key": "properties.imageBuildCompute", + "type": "str", + }, + "service_managed_resources_settings": { + "key": "properties.serviceManagedResourcesSettings", + "type": "ServiceManagedResourcesSettings", + }, + "primary_user_assigned_identity": { + "key": "properties.primaryUserAssignedIdentity", + "type": "str", + }, + "public_network_access": { + "key": "properties.publicNetworkAccess", + "type": "str", + }, + "application_insights": { + "key": "properties.applicationInsights", + "type": "str", + }, + "container_registry": { + "key": "properties.containerRegistry", + "type": "str", + }, + "encryption": { + "key": "properties.encryption", + "type": "EncryptionUpdateProperties", + }, + "feature_store_settings": { + "key": "properties.featureStoreSettings", + "type": "FeatureStoreSettings", + }, + "managed_network": { + "key": "properties.managedNetwork", + "type": "ManagedNetworkSettings", + }, } def __init__( @@ -32189,9 +34651,13 @@ def __init__( description: Optional[str] = None, friendly_name: Optional[str] = None, image_build_compute: Optional[str] = None, - service_managed_resources_settings: Optional["ServiceManagedResourcesSettings"] = None, + service_managed_resources_settings: Optional[ + "ServiceManagedResourcesSettings" + ] = None, primary_user_assigned_identity: Optional[str] = None, - public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, + public_network_access: Optional[ + Union[str, "PublicNetworkAccess"] + ] = None, application_insights: Optional[str] = None, container_registry: Optional[str] = None, encryption: Optional["EncryptionUpdateProperties"] = None, @@ -32242,7 +34708,9 @@ def __init__( self.description = description self.friendly_name = friendly_name self.image_build_compute = image_build_compute - self.service_managed_resources_settings = service_managed_resources_settings + self.service_managed_resources_settings = ( + service_managed_resources_settings + ) self.primary_user_assigned_identity = primary_user_assigned_identity self.public_network_access = public_network_access self.application_insights = application_insights diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/__init__.py index da26b6af19e9..897f7b955e8d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/__init__.py @@ -12,23 +12,45 @@ from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations from ._quotas_operations import QuotasOperations from ._compute_operations import ComputeOperations -from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_endpoint_connections_operations import ( + PrivateEndpointConnectionsOperations, +) from ._private_link_resources_operations import PrivateLinkResourcesOperations from ._workspace_connections_operations import WorkspaceConnectionsOperations -from ._managed_network_settings_rule_operations import ManagedNetworkSettingsRuleOperations -from ._managed_network_provisions_operations import ManagedNetworkProvisionsOperations +from ._managed_network_settings_rule_operations import ( + ManagedNetworkSettingsRuleOperations, +) +from ._managed_network_provisions_operations import ( + ManagedNetworkProvisionsOperations, +) from ._registries_operations import RegistriesOperations from ._workspace_features_operations import WorkspaceFeaturesOperations -from ._registry_code_containers_operations import RegistryCodeContainersOperations +from ._registry_code_containers_operations import ( + RegistryCodeContainersOperations, +) from ._registry_code_versions_operations import RegistryCodeVersionsOperations -from ._registry_component_containers_operations import RegistryComponentContainersOperations -from ._registry_component_versions_operations import RegistryComponentVersionsOperations -from ._registry_data_containers_operations import RegistryDataContainersOperations +from ._registry_component_containers_operations import ( + RegistryComponentContainersOperations, +) +from ._registry_component_versions_operations import ( + RegistryComponentVersionsOperations, +) +from ._registry_data_containers_operations import ( + RegistryDataContainersOperations, +) from ._registry_data_versions_operations import RegistryDataVersionsOperations -from ._registry_environment_containers_operations import RegistryEnvironmentContainersOperations -from ._registry_environment_versions_operations import RegistryEnvironmentVersionsOperations -from ._registry_model_containers_operations import RegistryModelContainersOperations -from ._registry_model_versions_operations import RegistryModelVersionsOperations +from ._registry_environment_containers_operations import ( + RegistryEnvironmentContainersOperations, +) +from ._registry_environment_versions_operations import ( + RegistryEnvironmentVersionsOperations, +) +from ._registry_model_containers_operations import ( + RegistryModelContainersOperations, +) +from ._registry_model_versions_operations import ( + RegistryModelVersionsOperations, +) from ._batch_endpoints_operations import BatchEndpointsOperations from ._batch_deployments_operations import BatchDeploymentsOperations from ._code_containers_operations import CodeContainersOperations @@ -43,8 +65,12 @@ from ._featureset_containers_operations import FeaturesetContainersOperations from ._features_operations import FeaturesOperations from ._featureset_versions_operations import FeaturesetVersionsOperations -from ._featurestore_entity_containers_operations import FeaturestoreEntityContainersOperations -from ._featurestore_entity_versions_operations import FeaturestoreEntityVersionsOperations +from ._featurestore_entity_containers_operations import ( + FeaturestoreEntityContainersOperations, +) +from ._featurestore_entity_versions_operations import ( + FeaturestoreEntityVersionsOperations, +) from ._jobs_operations import JobsOperations from ._labeling_jobs_operations import LabelingJobsOperations from ._model_containers_operations import ModelContainersOperations @@ -54,50 +80,50 @@ from ._schedules_operations import SchedulesOperations __all__ = [ - 'Operations', - 'WorkspacesOperations', - 'UsagesOperations', - 'VirtualMachineSizesOperations', - 'QuotasOperations', - 'ComputeOperations', - 'PrivateEndpointConnectionsOperations', - 'PrivateLinkResourcesOperations', - 'WorkspaceConnectionsOperations', - 'ManagedNetworkSettingsRuleOperations', - 'ManagedNetworkProvisionsOperations', - 'RegistriesOperations', - 'WorkspaceFeaturesOperations', - 'RegistryCodeContainersOperations', - 'RegistryCodeVersionsOperations', - 'RegistryComponentContainersOperations', - 'RegistryComponentVersionsOperations', - 'RegistryDataContainersOperations', - 'RegistryDataVersionsOperations', - 'RegistryEnvironmentContainersOperations', - 'RegistryEnvironmentVersionsOperations', - 'RegistryModelContainersOperations', - 'RegistryModelVersionsOperations', - 'BatchEndpointsOperations', - 'BatchDeploymentsOperations', - 'CodeContainersOperations', - 'CodeVersionsOperations', - 'ComponentContainersOperations', - 'ComponentVersionsOperations', - 'DataContainersOperations', - 'DataVersionsOperations', - 'DatastoresOperations', - 'EnvironmentContainersOperations', - 'EnvironmentVersionsOperations', - 'FeaturesetContainersOperations', - 'FeaturesOperations', - 'FeaturesetVersionsOperations', - 'FeaturestoreEntityContainersOperations', - 'FeaturestoreEntityVersionsOperations', - 'JobsOperations', - 'LabelingJobsOperations', - 'ModelContainersOperations', - 'ModelVersionsOperations', - 'OnlineEndpointsOperations', - 'OnlineDeploymentsOperations', - 'SchedulesOperations', + "Operations", + "WorkspacesOperations", + "UsagesOperations", + "VirtualMachineSizesOperations", + "QuotasOperations", + "ComputeOperations", + "PrivateEndpointConnectionsOperations", + "PrivateLinkResourcesOperations", + "WorkspaceConnectionsOperations", + "ManagedNetworkSettingsRuleOperations", + "ManagedNetworkProvisionsOperations", + "RegistriesOperations", + "WorkspaceFeaturesOperations", + "RegistryCodeContainersOperations", + "RegistryCodeVersionsOperations", + "RegistryComponentContainersOperations", + "RegistryComponentVersionsOperations", + "RegistryDataContainersOperations", + "RegistryDataVersionsOperations", + "RegistryEnvironmentContainersOperations", + "RegistryEnvironmentVersionsOperations", + "RegistryModelContainersOperations", + "RegistryModelVersionsOperations", + "BatchEndpointsOperations", + "BatchDeploymentsOperations", + "CodeContainersOperations", + "CodeVersionsOperations", + "ComponentContainersOperations", + "ComponentVersionsOperations", + "DataContainersOperations", + "DataVersionsOperations", + "DatastoresOperations", + "EnvironmentContainersOperations", + "EnvironmentVersionsOperations", + "FeaturesetContainersOperations", + "FeaturesOperations", + "FeaturesetVersionsOperations", + "FeaturestoreEntityContainersOperations", + "FeaturestoreEntityVersionsOperations", + "JobsOperations", + "LabelingJobsOperations", + "ModelContainersOperations", + "ModelVersionsOperations", + "OnlineEndpointsOperations", + "OnlineDeploymentsOperations", + "SchedulesOperations", ] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_batch_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_batch_deployments_operations.py index 61809ba1df5b..e5c4bb7c0df5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_batch_deployments_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_batch_deployments_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -250,6 +262,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class BatchDeploymentsOperations(object): """BatchDeploymentsOperations operations. @@ -308,16 +321,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.BatchDeploymentTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -327,13 +347,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -351,7 +371,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("BatchDeploymentTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "BatchDeploymentTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -360,25 +383,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -389,15 +418,18 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -405,34 +437,47 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -468,14 +513,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -483,29 +533,37 @@ def begin_delete( # pylint: disable=inconsistent-return-statements endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def get( @@ -534,15 +592,20 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.BatchDeployment :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -550,32 +613,39 @@ def get( endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize("BatchDeployment", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore def _update_initial( self, @@ -587,16 +657,27 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.BatchDeployment"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchDeployment"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.BatchDeployment"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties') + error_map.update(kwargs.pop("error_map", {})) + + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + + _json = self._serialize.body( + body, + "PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties", + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -607,40 +688,55 @@ def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def begin_update( @@ -682,15 +778,24 @@ def begin_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -700,32 +805,38 @@ def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore def _create_or_update_initial( self, @@ -737,16 +848,24 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.BatchDeployment" - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'BatchDeployment') + _json = self._serialize.body(body, "BatchDeployment") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -757,39 +876,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchDeployment', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -830,15 +965,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -848,29 +992,39 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_batch_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_batch_endpoints_operations.py index 690cef4edfcc..d1f63664a275 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_batch_endpoints_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_batch_endpoints_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -276,6 +288,7 @@ def build_list_keys_request( **kwargs ) + # fmt: on class BatchEndpointsOperations(object): """BatchEndpointsOperations operations. @@ -328,16 +341,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.BatchEndpointTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -345,13 +365,13 @@ def prepare_request(next_link=None): api_version=api_version, count=count, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -367,7 +387,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("BatchEndpointTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "BatchEndpointTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -376,25 +399,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -404,49 +433,65 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -479,43 +524,56 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace def get( @@ -541,47 +599,57 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.BatchEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize("BatchEndpoint", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore def _update_initial( self, @@ -592,16 +660,26 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.BatchEndpoint"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchEndpoint"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.BatchEndpoint"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') + _json = self._serialize.body( + body, "PartialMinimalTrackedResourceWithIdentity" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -611,40 +689,55 @@ def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace def begin_update( @@ -682,15 +775,22 @@ def begin_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -699,32 +799,38 @@ def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore def _create_or_update_initial( self, @@ -735,16 +841,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.BatchEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'BatchEndpoint') + _json = self._serialize.body(body, "BatchEndpoint") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -754,39 +866,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -823,15 +951,22 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -840,32 +975,42 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace def list_keys( @@ -891,44 +1036,56 @@ def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthKeys"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) + deserialized = self._deserialize("EndpointAuthKeys", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys"} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_code_containers_operations.py index c9be77b371a3..55307baae055 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_code_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_code_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -190,6 +202,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class CodeContainersOperations(object): """CodeContainersOperations operations. @@ -239,29 +252,36 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -276,7 +296,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -285,25 +307,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -329,43 +357,53 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore @distributed_trace def get( @@ -391,47 +429,57 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize("CodeContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore @distributed_trace def create_or_update( @@ -460,16 +508,22 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeContainer') + _json = self._serialize.body(body, "CodeContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -479,33 +533,44 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_code_versions_operations.py index dac3b837a4ac..7782ce471863 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_code_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_code_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -254,6 +266,7 @@ def build_create_or_get_start_pending_upload_request( **kwargs ) + # fmt: on class CodeVersionsOperations(object): """CodeVersionsOperations operations. @@ -319,16 +332,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -340,13 +360,13 @@ def prepare_request(next_link=None): skip=skip, hash=hash, hash_version=hash_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -366,7 +386,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -375,25 +397,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -422,15 +450,18 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -438,28 +469,35 @@ def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -488,15 +526,18 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -504,32 +545,39 @@ def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace def create_or_update( @@ -561,16 +609,22 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeVersion') + _json = self._serialize.body(body, "CodeVersion") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -581,36 +635,43 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace def create_or_get_start_pending_upload( @@ -642,16 +703,24 @@ def create_or_get_start_pending_upload( :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PendingUploadResponseDto"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PendingUploadRequestDto') + _json = self._serialize.body(body, "PendingUploadRequestDto") request = build_create_or_get_start_pending_upload_request( subscription_id=self._config.subscription_id, @@ -662,29 +731,40 @@ def create_or_get_start_pending_upload( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], + template_url=self.create_or_get_start_pending_upload.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) + deserialized = self._deserialize( + "PendingUploadResponseDto", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/startPendingUpload"} # type: ignore - + create_or_get_start_pending_upload.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/startPendingUpload"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_component_containers_operations.py index 6d03db42ab21..9d9dafd48b2d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_component_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_component_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -193,6 +205,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class ComponentContainersOperations(object): """ComponentContainersOperations operations. @@ -245,16 +258,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -262,13 +282,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -284,7 +304,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -293,25 +316,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -337,43 +366,53 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore @distributed_trace def get( @@ -399,47 +438,61 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore @distributed_trace def create_or_update( @@ -468,16 +521,24 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentContainer') + _json = self._serialize.body(body, "ComponentContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -487,33 +548,44 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_component_versions_operations.py index 9010e1a9b7ec..4d12e4fc7606 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_component_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_component_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -210,6 +222,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class ComponentVersionsOperations(object): """ComponentVersionsOperations operations. @@ -274,16 +287,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -295,13 +315,13 @@ def prepare_request(next_link=None): skip=skip, stage=stage, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -321,7 +341,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -330,25 +352,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -377,15 +405,18 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -393,28 +424,35 @@ def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -443,15 +481,20 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -459,32 +502,39 @@ def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize("ComponentVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace def create_or_update( @@ -516,16 +566,24 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentVersion') + _json = self._serialize.body(body, "ComponentVersion") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -536,33 +594,44 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_compute_operations.py index 83e86f5f2f16..1251a774af95 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_compute_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_compute_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -25,9 +31,24 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, List, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + from typing import ( + Any, + Callable, + Dict, + Iterable, + List, + Optional, + TypeVar, + Union, + ) + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -515,6 +536,7 @@ def build_update_idle_shutdown_setting_request( **kwargs ) + # fmt: on class ComputeOperations(object): """ComputeOperations operations. @@ -562,29 +584,36 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedComputeResourcesList] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedComputeResourcesList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedComputeResourcesList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -599,7 +628,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedComputeResourcesList", pipeline_response) + deserialized = self._deserialize( + "PaginatedComputeResourcesList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -608,25 +639,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes"} # type: ignore @distributed_trace def get( @@ -651,47 +688,59 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComputeResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize("ComputeResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore def _create_or_update_initial( self, @@ -702,16 +751,24 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.ComputeResource" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'ComputeResource') + _json = self._serialize.body(parameters, "ComputeResource") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -721,38 +778,49 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if response.status_code == 201: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComputeResource', pipeline_response) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -790,15 +858,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -807,32 +884,38 @@ def begin_create_or_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore def _update_initial( self, @@ -843,16 +926,24 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> "_models.ComputeResource" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'ClusterUpdateParameters') + _json = self._serialize.body(parameters, "ClusterUpdateParameters") request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -862,31 +953,36 @@ def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize("ComputeResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace def begin_update( @@ -923,15 +1019,24 @@ def begin_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -940,32 +1045,38 @@ def begin_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -976,15 +1087,18 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -992,33 +1106,41 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements compute_name=compute_name, api_version=api_version, underlying_resource_action=underlying_resource_action, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -1054,14 +1176,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -1069,29 +1196,33 @@ def begin_delete( # pylint: disable=inconsistent-return-statements compute_name=compute_name, underlying_resource_action=underlying_resource_action, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace def update_custom_services( # pylint: disable=inconsistent-return-statements @@ -1118,16 +1249,22 @@ def update_custom_services( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(custom_services, '[CustomService]') + _json = self._serialize.body(custom_services, "[CustomService]") request = build_update_custom_services_request( subscription_id=self._config.subscription_id, @@ -1137,28 +1274,35 @@ def update_custom_services( # pylint: disable=inconsistent-return-statements api_version=api_version, content_type=content_type, json=_json, - template_url=self.update_custom_services.metadata['url'], + template_url=self.update_custom_services.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - update_custom_services.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/customServices"} # type: ignore - + update_custom_services.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/customServices"} # type: ignore @distributed_trace def list_nodes( @@ -1184,29 +1328,36 @@ def list_nodes( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.AmlComputeNodesInformation] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlComputeNodesInformation"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.AmlComputeNodesInformation"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_nodes_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self.list_nodes.metadata['url'], + template_url=self.list_nodes.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_nodes_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -1221,7 +1372,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("AmlComputeNodesInformation", pipeline_response) + deserialized = self._deserialize( + "AmlComputeNodesInformation", pipeline_response + ) list_of_elem = deserialized.nodes if cls: list_of_elem = cls(list_of_elem) @@ -1230,25 +1383,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_nodes.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes"} # type: ignore + list_nodes.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes"} # type: ignore @distributed_trace def list_keys( @@ -1272,47 +1431,59 @@ def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ComputeSecrets :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeSecrets"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeSecrets"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComputeSecrets', pipeline_response) + deserialized = self._deserialize("ComputeSecrets", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys"} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys"} # type: ignore def _start_initial( # pylint: disable=inconsistent-return-statements self, @@ -1322,42 +1493,50 @@ def _start_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_start_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self._start_initial.metadata['url'], + template_url=self._start_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _start_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore - + _start_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore @distributed_trace def begin_start( # pylint: disable=inconsistent-return-statements @@ -1388,43 +1567,52 @@ def begin_start( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._start_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_start.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore + begin_start.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore def _stop_initial( # pylint: disable=inconsistent-return-statements self, @@ -1434,42 +1622,50 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_stop_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self._stop_initial.metadata['url'], + template_url=self._stop_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _stop_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore - + _stop_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore @distributed_trace def begin_stop( # pylint: disable=inconsistent-return-statements @@ -1500,43 +1696,52 @@ def begin_stop( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._stop_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_stop.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore + begin_stop.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore def _restart_initial( # pylint: disable=inconsistent-return-statements self, @@ -1546,42 +1751,50 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_restart_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self._restart_initial.metadata['url'], + template_url=self._restart_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _restart_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore - + _restart_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore @distributed_trace def begin_restart( # pylint: disable=inconsistent-return-statements @@ -1612,43 +1825,52 @@ def begin_restart( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._restart_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_restart.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore + begin_restart.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore @distributed_trace def update_idle_shutdown_setting( # pylint: disable=inconsistent-return-statements @@ -1675,16 +1897,22 @@ def update_idle_shutdown_setting( # pylint: disable=inconsistent-return-stateme :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'IdleShutdownSetting') + _json = self._serialize.body(parameters, "IdleShutdownSetting") request = build_update_idle_shutdown_setting_request( subscription_id=self._config.subscription_id, @@ -1694,25 +1922,32 @@ def update_idle_shutdown_setting( # pylint: disable=inconsistent-return-stateme api_version=api_version, content_type=content_type, json=_json, - template_url=self.update_idle_shutdown_setting.metadata['url'], + template_url=self.update_idle_shutdown_setting.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - update_idle_shutdown_setting.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateIdleShutdownSetting"} # type: ignore - + update_idle_shutdown_setting.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateIdleShutdownSetting"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_data_containers_operations.py index 3be472641815..64149070b2ba 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_data_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_data_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -193,6 +205,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class DataContainersOperations(object): """DataContainersOperations operations. @@ -245,16 +258,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -262,13 +282,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -284,7 +304,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -293,25 +315,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -337,43 +365,53 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore @distributed_trace def get( @@ -399,47 +437,57 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize("DataContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore @distributed_trace def create_or_update( @@ -468,16 +516,22 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DataContainer') + _json = self._serialize.body(body, "DataContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -487,33 +541,44 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_data_versions_operations.py index d10d6de821a0..1d9482ca5384 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_data_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_data_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -213,6 +225,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class DataVersionsOperations(object): """DataVersionsOperations operations. @@ -284,16 +297,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -306,13 +326,13 @@ def prepare_request(next_link=None): tags=tags, stage=stage, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -333,7 +353,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataVersionBaseResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -342,25 +364,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -389,15 +417,18 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -405,28 +436,35 @@ def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -455,15 +493,20 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -471,32 +514,39 @@ def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize("DataVersionBase", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace def create_or_update( @@ -528,16 +578,24 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DataVersionBase') + _json = self._serialize.body(body, "DataVersionBase") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -548,33 +606,44 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_datastores_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_datastores_operations.py index f86652b9db0b..c8b23671951b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_datastores_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_datastores_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, List, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -250,6 +262,7 @@ def build_list_secrets_request( **kwargs ) + # fmt: on class DatastoresOperations(object): """DatastoresOperations operations. @@ -317,16 +330,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DatastoreResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -339,13 +359,13 @@ def prepare_request(next_link=None): search_text=search_text, order_by=order_by, order_by_asc=order_by_asc, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -366,7 +386,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("DatastoreResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DatastoreResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -375,25 +397,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -419,43 +447,53 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace def get( @@ -481,47 +519,57 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.Datastore :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Datastore"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Datastore"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Datastore', pipeline_response) + deserialized = self._deserialize("Datastore", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace def create_or_update( @@ -553,16 +601,22 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.Datastore :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Datastore"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Datastore"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'Datastore') + _json = self._serialize.body(body, "Datastore") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -573,36 +627,43 @@ def create_or_update( content_type=content_type, json=_json, skip_validation=skip_validation, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('Datastore', pipeline_response) + deserialized = self._deserialize("Datastore", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('Datastore', pipeline_response) + deserialized = self._deserialize("Datastore", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace def list_secrets( @@ -628,44 +689,56 @@ def list_secrets( :rtype: ~azure.mgmt.machinelearningservices.models.DatastoreSecrets :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreSecrets"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DatastoreSecrets"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_list_secrets_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.list_secrets.metadata['url'], + template_url=self.list_secrets.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DatastoreSecrets', pipeline_response) + deserialized = self._deserialize("DatastoreSecrets", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_secrets.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets"} # type: ignore - + list_secrets.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_environment_containers_operations.py index c65ab9b7488f..68ec6f75317a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_environment_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_environment_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -193,6 +205,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class EnvironmentContainersOperations(object): """EnvironmentContainersOperations operations. @@ -245,16 +258,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -262,13 +282,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -284,7 +304,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -293,25 +316,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -337,43 +366,53 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore @distributed_trace def get( @@ -399,47 +438,61 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore @distributed_trace def create_or_update( @@ -468,16 +521,24 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentContainer') + _json = self._serialize.body(body, "EnvironmentContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -487,33 +548,44 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_environment_versions_operations.py index 3ece2a07625d..b16fcf6a6836 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_environment_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_environment_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -207,6 +219,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class EnvironmentVersionsOperations(object): """EnvironmentVersionsOperations operations. @@ -268,16 +281,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -288,13 +308,13 @@ def prepare_request(next_link=None): top=top, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -313,7 +333,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersionResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -322,25 +345,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -369,15 +398,18 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -385,28 +417,35 @@ def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -435,15 +474,20 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -451,32 +495,41 @@ def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace def create_or_update( @@ -508,16 +561,24 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentVersion') + _json = self._serialize.body(body, "EnvironmentVersion") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -528,33 +589,44 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_features_operations.py index cb76b26216a9..bfb1f014852b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_features_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_features_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -126,6 +138,7 @@ def build_get_request( **kwargs ) + # fmt: on class FeaturesOperations(object): """FeaturesOperations operations. @@ -191,16 +204,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.FeatureResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeatureResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeatureResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -212,13 +232,13 @@ def prepare_request(next_link=None): tags=tags, feature_name=feature_name, description=description, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -238,7 +258,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("FeatureResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "FeatureResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -247,25 +269,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features"} # type: ignore @distributed_trace def get( @@ -297,15 +325,18 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.Feature :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Feature"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Feature"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -314,29 +345,36 @@ def get( featureset_version=featureset_version, feature_name=feature_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Feature', pipeline_response) + deserialized = self._deserialize("Feature", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features/{featureName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features/{featureName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_featureset_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_featureset_containers_operations.py index ea24d924bdb0..06a4f7363020 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_featureset_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_featureset_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -210,6 +222,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class FeaturesetContainersOperations(object): """FeaturesetContainersOperations operations. @@ -279,16 +292,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.FeaturesetContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -301,13 +321,13 @@ def prepare_request(next_link=None): name=name, description=description, created_by=created_by, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -328,7 +348,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturesetContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "FeaturesetContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -337,25 +360,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -365,49 +394,65 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -440,43 +485,56 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore @distributed_trace def get_entity( @@ -502,47 +560,61 @@ def get_entity( :rtype: ~azure.mgmt.machinelearningservices.models.FeaturesetContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_entity_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get_entity.metadata['url'], + template_url=self.get_entity.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) + deserialized = self._deserialize( + "FeaturesetContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_entity.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - + get_entity.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore def _create_or_update_initial( self, @@ -553,16 +625,24 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.FeaturesetContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'FeaturesetContainer') + _json = self._serialize.body(body, "FeaturesetContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -572,39 +652,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) + deserialized = self._deserialize( + "FeaturesetContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "FeaturesetContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -642,15 +738,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainer"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -659,29 +764,39 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) + deserialized = self._deserialize( + "FeaturesetContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_featureset_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_featureset_versions_operations.py index 06f3a36ed905..945dcc219bc1 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_featureset_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_featureset_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -321,6 +333,7 @@ def build_list_materialization_jobs_request( **kwargs ) + # fmt: on class FeaturesetVersionsOperations(object): """FeaturesetVersionsOperations operations. @@ -399,16 +412,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.FeaturesetVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -424,13 +444,13 @@ def prepare_request(next_link=None): description=description, created_by=created_by, stage=stage, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -454,7 +474,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturesetVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "FeaturesetVersionResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -463,25 +486,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -492,15 +521,18 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -508,34 +540,47 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -571,14 +616,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -586,29 +636,37 @@ def begin_delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -637,15 +695,20 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.FeaturesetVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -653,32 +716,41 @@ def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) + deserialized = self._deserialize( + "FeaturesetVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore def _create_or_update_initial( self, @@ -690,16 +762,24 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.FeaturesetVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'FeaturesetVersion') + _json = self._serialize.body(body, "FeaturesetVersion") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -710,39 +790,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) + deserialized = self._deserialize( + "FeaturesetVersion", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "FeaturesetVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -783,15 +879,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersion"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetVersion"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -801,32 +906,42 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) + deserialized = self._deserialize( + "FeaturesetVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore def _backfill_initial( self, @@ -838,16 +953,24 @@ def _backfill_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.FeaturesetJob"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.FeaturesetJob"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.FeaturesetJob"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'FeaturesetVersionBackfillRequest') + _json = self._serialize.body(body, "FeaturesetVersionBackfillRequest") request = build_backfill_request_initial( subscription_id=self._config.subscription_id, @@ -858,39 +981,49 @@ def _backfill_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._backfill_initial.metadata['url'], + template_url=self._backfill_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('FeaturesetJob', pipeline_response) + deserialized = self._deserialize( + "FeaturesetJob", pipeline_response + ) if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _backfill_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill"} # type: ignore - + _backfill_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill"} # type: ignore @distributed_trace def begin_backfill( @@ -930,15 +1063,22 @@ def begin_backfill( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetJob] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetJob"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.FeaturesetJob"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._backfill_initial( resource_group_name=resource_group_name, @@ -948,32 +1088,42 @@ def begin_backfill( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('FeaturesetJob', pipeline_response) + deserialized = self._deserialize( + "FeaturesetJob", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_backfill.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill"} # type: ignore + begin_backfill.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill"} # type: ignore @distributed_trace def list_materialization_jobs( @@ -1017,16 +1167,23 @@ def list_materialization_jobs( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.FeaturesetJobArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetJobArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetJobArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_materialization_jobs_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -1038,13 +1195,15 @@ def prepare_request(next_link=None): filters=filters, feature_window_start=feature_window_start, feature_window_end=feature_window_end, - template_url=self.list_materialization_jobs.metadata['url'], + template_url=self.list_materialization_jobs.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_materialization_jobs_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -1067,7 +1226,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturesetJobArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "FeaturesetJobArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1076,22 +1237,28 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_materialization_jobs.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/listMaterializationJobs"} # type: ignore + list_materialization_jobs.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/listMaterializationJobs"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_featurestore_entity_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_featurestore_entity_containers_operations.py index 43a5169aa1e6..2ab4fcb4fe1b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_featurestore_entity_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_featurestore_entity_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -210,6 +222,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class FeaturestoreEntityContainersOperations(object): """FeaturestoreEntityContainersOperations operations. @@ -279,16 +292,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturestoreEntityContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -301,13 +321,13 @@ def prepare_request(next_link=None): name=name, description=description, created_by=created_by, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -328,7 +348,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturestoreEntityContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "FeaturestoreEntityContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -337,25 +360,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -365,49 +394,65 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -440,43 +485,56 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore @distributed_trace def get_entity( @@ -502,47 +560,61 @@ def get_entity( :rtype: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturestoreEntityContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_entity_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get_entity.metadata['url'], + template_url=self.get_entity.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) + deserialized = self._deserialize( + "FeaturestoreEntityContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_entity.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - + get_entity.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore def _create_or_update_initial( self, @@ -553,16 +625,24 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.FeaturestoreEntityContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturestoreEntityContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'FeaturestoreEntityContainer') + _json = self._serialize.body(body, "FeaturestoreEntityContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -572,39 +652,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) + deserialized = self._deserialize( + "FeaturestoreEntityContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "FeaturestoreEntityContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -642,15 +738,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainer"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturestoreEntityContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -659,29 +764,39 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) + deserialized = self._deserialize( + "FeaturestoreEntityContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_featurestore_entity_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_featurestore_entity_versions_operations.py index 9cce577474ec..0efac40d228d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_featurestore_entity_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_featurestore_entity_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -224,6 +236,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class FeaturestoreEntityVersionsOperations(object): """FeaturestoreEntityVersionsOperations operations. @@ -302,16 +315,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturestoreEntityVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -327,13 +347,13 @@ def prepare_request(next_link=None): description=description, created_by=created_by, stage=stage, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -357,7 +377,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturestoreEntityVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "FeaturestoreEntityVersionResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -366,25 +389,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -395,15 +424,18 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -411,34 +443,47 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -474,14 +519,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -489,29 +539,37 @@ def begin_delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -540,15 +598,20 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturestoreEntityVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -556,32 +619,41 @@ def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) + deserialized = self._deserialize( + "FeaturestoreEntityVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore def _create_or_update_initial( self, @@ -593,16 +665,24 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.FeaturestoreEntityVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturestoreEntityVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'FeaturestoreEntityVersion') + _json = self._serialize.body(body, "FeaturestoreEntityVersion") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -613,39 +693,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) + deserialized = self._deserialize( + "FeaturestoreEntityVersion", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "FeaturestoreEntityVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -686,15 +782,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersion"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturestoreEntityVersion"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -704,29 +809,39 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) + deserialized = self._deserialize( + "FeaturestoreEntityVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_jobs_operations.py index cd8858df2038..5301ac04c2ec 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_jobs_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_jobs_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -291,6 +303,7 @@ def build_cancel_request_initial( **kwargs ) + # fmt: on class JobsOperations(object): """JobsOperations operations. @@ -358,16 +371,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.JobBaseResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -380,13 +400,13 @@ def prepare_request(next_link=None): asset_name=asset_name, scheduled=scheduled, schedule_id=schedule_id, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -407,7 +427,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("JobBaseResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "JobBaseResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -416,25 +438,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -444,49 +472,65 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -519,43 +563,56 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace def get( @@ -581,47 +638,57 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.JobBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.JobBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('JobBase', pipeline_response) + deserialized = self._deserialize("JobBase", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace def update( @@ -650,16 +717,22 @@ def update( :rtype: ~azure.mgmt.machinelearningservices.models.JobBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.JobBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialJobBasePartialResource') + _json = self._serialize.body(body, "PartialJobBasePartialResource") request = build_update_request( subscription_id=self._config.subscription_id, @@ -669,32 +742,39 @@ def update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.update.metadata['url'], + template_url=self.update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('JobBase', pipeline_response) + deserialized = self._deserialize("JobBase", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - + update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace def create_or_update( @@ -723,16 +803,22 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.JobBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.JobBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'JobBase') + _json = self._serialize.body(body, "JobBase") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -742,36 +828,43 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('JobBase', pipeline_response) + deserialized = self._deserialize("JobBase", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('JobBase', pipeline_response) + deserialized = self._deserialize("JobBase", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore def _cancel_initial( # pylint: disable=inconsistent-return-statements self, @@ -781,48 +874,59 @@ def _cancel_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_cancel_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self._cancel_initial.metadata['url'], + template_url=self._cancel_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _cancel_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore - + _cancel_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore @distributed_trace def begin_cancel( # pylint: disable=inconsistent-return-statements @@ -855,40 +959,53 @@ def begin_cancel( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._cancel_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_cancel.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore + begin_cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_labeling_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_labeling_jobs_operations.py index 006fffb6840d..9405f1df2b22 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_labeling_jobs_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_labeling_jobs_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -321,6 +333,7 @@ def build_resume_request_initial( **kwargs ) + # fmt: on class LabelingJobsOperations(object): """LabelingJobsOperations operations. @@ -373,16 +386,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.LabelingJobResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJobResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.LabelingJobResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -390,13 +410,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, top=top, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -412,7 +432,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("LabelingJobResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "LabelingJobResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -421,25 +443,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -465,43 +493,53 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore @distributed_trace def get( @@ -535,15 +573,18 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.LabelingJob :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.LabelingJob"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -552,32 +593,39 @@ def get( api_version=api_version, include_job_instructions=include_job_instructions, include_label_categories=include_label_categories, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('LabelingJob', pipeline_response) + deserialized = self._deserialize("LabelingJob", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore def _create_or_update_initial( self, @@ -588,16 +636,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.LabelingJob" - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.LabelingJob"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'LabelingJob') + _json = self._serialize.body(body, "LabelingJob") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -607,39 +661,51 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('LabelingJob', pipeline_response) + deserialized = self._deserialize("LabelingJob", pipeline_response) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('LabelingJob', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("LabelingJob", pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -676,15 +742,22 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.LabelingJob] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.LabelingJob"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -693,32 +766,40 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('LabelingJob', pipeline_response) + deserialized = self._deserialize("LabelingJob", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore def _export_labels_initial( self, @@ -729,16 +810,24 @@ def _export_labels_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.ExportSummary"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExportSummary"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.ExportSummary"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ExportSummary') + _json = self._serialize.body(body, "ExportSummary") request = build_export_labels_request_initial( subscription_id=self._config.subscription_id, @@ -748,39 +837,49 @@ def _export_labels_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._export_labels_initial.metadata['url'], + template_url=self._export_labels_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ExportSummary', pipeline_response) + deserialized = self._deserialize( + "ExportSummary", pipeline_response + ) if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _export_labels_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore - + _export_labels_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore @distributed_trace def begin_export_labels( @@ -817,15 +916,22 @@ def begin_export_labels( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ExportSummary] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExportSummary"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ExportSummary"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._export_labels_initial( resource_group_name=resource_group_name, @@ -834,32 +940,42 @@ def begin_export_labels( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ExportSummary', pipeline_response) + deserialized = self._deserialize( + "ExportSummary", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_export_labels.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore + begin_export_labels.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore @distributed_trace def pause( # pylint: disable=inconsistent-return-statements @@ -885,43 +1001,53 @@ def pause( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_pause_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self.pause.metadata['url'], + template_url=self.pause.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - pause.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause"} # type: ignore - + pause.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause"} # type: ignore def _resume_initial( # pylint: disable=inconsistent-return-statements self, @@ -931,48 +1057,59 @@ def _resume_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_resume_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self._resume_initial.metadata['url'], + template_url=self._resume_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _resume_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore - + _resume_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore @distributed_trace def begin_resume( # pylint: disable=inconsistent-return-statements @@ -1005,40 +1142,53 @@ def begin_resume( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._resume_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_resume.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore + begin_resume.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_managed_network_provisions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_managed_network_provisions_operations.py index dbc35f4526fa..b79dbdf92bf2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_managed_network_provisions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_managed_network_provisions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod @@ -25,8 +31,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -71,6 +83,7 @@ def build_provision_managed_network_request_initial( **kwargs ) + # fmt: on class ManagedNetworkProvisionsOperations(object): """ManagedNetworkProvisionsOperations operations. @@ -102,17 +115,27 @@ def _provision_managed_network_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.ManagedNetworkProvisionStatus"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ManagedNetworkProvisionStatus"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.ManagedNetworkProvisionStatus"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if parameters is not None: - _json = self._serialize.body(parameters, 'ManagedNetworkProvisionOptions') + _json = self._serialize.body( + parameters, "ManagedNetworkProvisionOptions" + ) else: _json = None @@ -123,38 +146,48 @@ def _provision_managed_network_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._provision_managed_network_initial.metadata['url'], + template_url=self._provision_managed_network_initial.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ManagedNetworkProvisionStatus', pipeline_response) + deserialized = self._deserialize( + "ManagedNetworkProvisionStatus", pipeline_response + ) if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _provision_managed_network_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork"} # type: ignore - + _provision_managed_network_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork"} # type: ignore @distributed_trace def begin_provision_managed_network( @@ -187,15 +220,24 @@ def begin_provision_managed_network( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionStatus] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedNetworkProvisionStatus"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ManagedNetworkProvisionStatus"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._provision_managed_network_initial( resource_group_name=resource_group_name, @@ -203,29 +245,39 @@ def begin_provision_managed_network( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ManagedNetworkProvisionStatus', pipeline_response) + deserialized = self._deserialize( + "ManagedNetworkProvisionStatus", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_provision_managed_network.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork"} # type: ignore + begin_provision_managed_network.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_managed_network_settings_rule_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_managed_network_settings_rule_operations.py index 5e2d99cd841d..74448269f64b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_managed_network_settings_rule_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_managed_network_settings_rule_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -189,6 +201,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class ManagedNetworkSettingsRuleOperations(object): """ManagedNetworkSettingsRuleOperations operations. @@ -233,28 +246,35 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.OutboundRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OutboundRuleListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -268,7 +288,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("OutboundRuleListResult", pipeline_response) + deserialized = self._deserialize( + "OutboundRuleListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -277,25 +299,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -305,47 +333,56 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, rule_name=rule_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -376,43 +413,56 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, rule_name=rule_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore @distributed_trace def get( @@ -436,47 +486,61 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleBasicResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OutboundRuleBasicResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, rule_name=rule_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) + deserialized = self._deserialize( + "OutboundRuleBasicResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore def _create_or_update_initial( self, @@ -487,16 +551,24 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.OutboundRuleBasicResource"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OutboundRuleBasicResource"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.OutboundRuleBasicResource"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'OutboundRuleBasicResource') + _json = self._serialize.body(parameters, "OutboundRuleBasicResource") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -506,38 +578,46 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) + deserialized = self._deserialize( + "OutboundRuleBasicResource", pipeline_response + ) if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -574,15 +654,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleBasicResource"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OutboundRuleBasicResource"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -591,29 +680,39 @@ def begin_create_or_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) + deserialized = self._deserialize( + "OutboundRuleBasicResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_model_containers_operations.py index 3583fc0e62fe..bce69e91848e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_model_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_model_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -196,6 +208,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class ModelContainersOperations(object): """ModelContainersOperations operations. @@ -251,16 +264,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -269,13 +289,13 @@ def prepare_request(next_link=None): skip=skip, count=count, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -292,7 +312,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -301,25 +323,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -345,43 +373,53 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore @distributed_trace def get( @@ -407,47 +445,59 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize("ModelContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore @distributed_trace def create_or_update( @@ -476,16 +526,24 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelContainer') + _json = self._serialize.body(body, "ModelContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -495,33 +553,44 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_model_versions_operations.py index 47b137841c9e..d7c6de7fa610 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_model_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_model_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -274,6 +286,7 @@ def build_package_request_initial( **kwargs ) + # fmt: on class ModelVersionsOperations(object): """ModelVersionsOperations operations. @@ -358,16 +371,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -385,13 +405,13 @@ def prepare_request(next_link=None): feed=feed, stage=stage, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -417,7 +437,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -426,25 +448,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -473,15 +501,18 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -489,28 +520,35 @@ def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -539,15 +577,18 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -555,32 +596,39 @@ def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace def create_or_update( @@ -612,16 +660,22 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelVersion') + _json = self._serialize.body(body, "ModelVersion") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -632,36 +686,43 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore def _package_initial( self, @@ -673,16 +734,24 @@ def _package_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.PackageResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PackageResponse"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.PackageResponse"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PackageRequest') + _json = self._serialize.body(body, "PackageRequest") request = build_package_request_initial( subscription_id=self._config.subscription_id, @@ -693,39 +762,49 @@ def _package_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._package_initial.metadata['url'], + template_url=self._package_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('PackageResponse', pipeline_response) + deserialized = self._deserialize( + "PackageResponse", pipeline_response + ) if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _package_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package"} # type: ignore - + _package_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package"} # type: ignore @distributed_trace def begin_package( @@ -766,15 +845,24 @@ def begin_package( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.PackageResponse] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.PackageResponse"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PackageResponse"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._package_initial( resource_group_name=resource_group_name, @@ -784,29 +872,39 @@ def begin_package( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('PackageResponse', pipeline_response) + deserialized = self._deserialize( + "PackageResponse", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_package.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package"} # type: ignore + begin_package.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_online_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_online_deployments_operations.py index 84a163032709..67a48ffe553d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_online_deployments_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_online_deployments_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -341,6 +353,7 @@ def build_list_skus_request( **kwargs ) + # fmt: on class OnlineDeploymentsOperations(object): """OnlineDeploymentsOperations operations. @@ -399,16 +412,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.OnlineDeploymentTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -418,13 +438,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -442,7 +462,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineDeploymentTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "OnlineDeploymentTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -451,25 +474,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -480,15 +509,18 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -496,34 +528,47 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -559,14 +604,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -574,29 +624,37 @@ def begin_delete( # pylint: disable=inconsistent-return-statements endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def get( @@ -625,15 +683,20 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.OnlineDeployment :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -641,32 +704,39 @@ def get( endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize("OnlineDeployment", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore def _update_initial( self, @@ -678,16 +748,26 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.OnlineDeployment"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineDeployment"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.OnlineDeployment"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSku') + _json = self._serialize.body( + body, "PartialMinimalTrackedResourceWithSku" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -698,40 +778,55 @@ def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def begin_update( @@ -772,15 +867,24 @@ def begin_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -790,32 +894,38 @@ def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore def _create_or_update_initial( self, @@ -827,16 +937,24 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.OnlineDeployment" - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'OnlineDeployment') + _json = self._serialize.body(body, "OnlineDeployment") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -847,39 +965,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -920,15 +1054,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -938,32 +1081,42 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def get_logs( @@ -995,16 +1148,24 @@ def get_logs( :rtype: ~azure.mgmt.machinelearningservices.models.DeploymentLogs :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentLogs"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DeploymentLogs"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DeploymentLogsRequest') + _json = self._serialize.body(body, "DeploymentLogsRequest") request = build_get_logs_request( subscription_id=self._config.subscription_id, @@ -1015,32 +1176,39 @@ def get_logs( api_version=api_version, content_type=content_type, json=_json, - template_url=self.get_logs.metadata['url'], + template_url=self.get_logs.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DeploymentLogs', pipeline_response) + deserialized = self._deserialize("DeploymentLogs", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_logs.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs"} # type: ignore - + get_logs.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs"} # type: ignore @distributed_trace def list_skus( @@ -1077,16 +1245,23 @@ def list_skus( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.SkuResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.SkuResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_skus_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -1096,13 +1271,13 @@ def prepare_request(next_link=None): api_version=api_version, count=count, skip=skip, - template_url=self.list_skus.metadata['url'], + template_url=self.list_skus.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_skus_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -1120,7 +1295,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("SkuResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "SkuResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1129,22 +1306,28 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_skus.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus"} # type: ignore + list_skus.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_online_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_online_endpoints_operations.py index f3458a04fabd..495d030663bc 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_online_endpoints_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_online_endpoints_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -372,6 +384,7 @@ def build_get_token_request( **kwargs ) + # fmt: on class OnlineEndpointsOperations(object): """OnlineEndpointsOperations operations. @@ -442,16 +455,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.OnlineEndpointTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -464,13 +484,13 @@ def prepare_request(next_link=None): tags=tags, properties=properties, order_by=order_by, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -491,7 +511,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineEndpointTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "OnlineEndpointTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -500,25 +523,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -528,49 +557,65 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -603,43 +648,56 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace def get( @@ -665,47 +723,59 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.OnlineEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize("OnlineEndpoint", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore def _update_initial( self, @@ -716,16 +786,26 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.OnlineEndpoint"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineEndpoint"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.OnlineEndpoint"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') + _json = self._serialize.body( + body, "PartialMinimalTrackedResourceWithIdentity" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -735,40 +815,55 @@ def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace def begin_update( @@ -807,15 +902,24 @@ def begin_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -824,32 +928,38 @@ def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore def _create_or_update_initial( self, @@ -860,16 +970,24 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.OnlineEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'OnlineEndpoint') + _json = self._serialize.body(body, "OnlineEndpoint") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -879,39 +997,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -949,15 +1083,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -966,32 +1109,42 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace def list_keys( @@ -1017,47 +1170,59 @@ def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthKeys"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) + deserialized = self._deserialize("EndpointAuthKeys", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys"} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys"} # type: ignore def _regenerate_keys_initial( # pylint: disable=inconsistent-return-statements self, @@ -1068,16 +1233,22 @@ def _regenerate_keys_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'RegenerateEndpointKeysRequest') + _json = self._serialize.body(body, "RegenerateEndpointKeysRequest") request = build_regenerate_keys_request_initial( subscription_id=self._config.subscription_id, @@ -1087,33 +1258,41 @@ def _regenerate_keys_initial( # pylint: disable=inconsistent-return-statements api_version=api_version, content_type=content_type, json=_json, - template_url=self._regenerate_keys_initial.metadata['url'], + template_url=self._regenerate_keys_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _regenerate_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore - + _regenerate_keys_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore @distributed_trace def begin_regenerate_keys( # pylint: disable=inconsistent-return-statements @@ -1149,15 +1328,22 @@ def begin_regenerate_keys( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._regenerate_keys_initial( resource_group_name=resource_group_name, @@ -1166,29 +1352,37 @@ def begin_regenerate_keys( # pylint: disable=inconsistent-return-statements body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_regenerate_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore + begin_regenerate_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore @distributed_trace def get_token( @@ -1214,44 +1408,58 @@ def get_token( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthToken :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthToken"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthToken"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_token_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.get_token.metadata['url'], + template_url=self.get_token.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EndpointAuthToken', pipeline_response) + deserialized = self._deserialize( + "EndpointAuthToken", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token"} # type: ignore - + get_token.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_operations.py index ef0b65c585cf..e160580fc99f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -57,6 +69,7 @@ def build_list_request( **kwargs ) + # fmt: on class Operations(object): """Operations operations. @@ -82,8 +95,7 @@ def __init__(self, client, config, serializer, deserializer): @distributed_trace def list( - self, - **kwargs # type: Any + self, **kwargs # type: Any ): # type: (...) -> Iterable["_models.AmlOperationListResult"] """Lists all of the available Azure Machine Learning Services REST API operations. @@ -95,25 +107,32 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.AmlOperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlOperationListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.AmlOperationListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( api_version=api_version, template_url=next_link, @@ -124,7 +143,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("AmlOperationListResult", pipeline_response) + deserialized = self._deserialize( + "AmlOperationListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -133,22 +154,28 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/providers/Microsoft.MachineLearningServices/operations"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.MachineLearningServices/operations"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_private_endpoint_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_private_endpoint_connections_operations.py index e4ce46ecb19f..2bf8fd5d3d83 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_private_endpoint_connections_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_private_endpoint_connections_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -187,6 +199,7 @@ def build_delete_request( **kwargs ) + # fmt: on class PrivateEndpointConnectionsOperations(object): """PrivateEndpointConnectionsOperations operations. @@ -231,28 +244,35 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnectionListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( resource_group_name=resource_group_name, workspace_name=workspace_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( resource_group_name=resource_group_name, workspace_name=workspace_name, @@ -266,7 +286,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) + deserialized = self._deserialize( + "PrivateEndpointConnectionListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -275,25 +297,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections"} # type: ignore @distributed_trace def get( @@ -318,47 +346,61 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, private_endpoint_connection_name=private_endpoint_connection_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + deserialized = self._deserialize( + "PrivateEndpointConnection", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace def create_or_update( @@ -386,16 +428,24 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(properties, 'PrivateEndpointConnection') + _json = self._serialize.body(properties, "PrivateEndpointConnection") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -405,32 +455,41 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + deserialized = self._deserialize( + "PrivateEndpointConnection", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -455,40 +514,50 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, private_endpoint_connection_name=private_endpoint_connection_name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_private_link_resources_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_private_link_resources_operations.py index c13425cdef8d..7979aa43b0bb 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_private_link_resources_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_private_link_resources_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest @@ -23,8 +29,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -66,6 +78,7 @@ def build_list_request( **kwargs ) + # fmt: on class PrivateLinkResourcesOperations(object): """PrivateLinkResourcesOperations operations. @@ -108,43 +121,57 @@ def list( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateLinkResourceListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateLinkResourceListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PrivateLinkResourceListResult', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "PrivateLinkResourceListResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources"} # type: ignore - + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_quotas_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_quotas_operations.py index ac8bb99ca560..e104338fcb8e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_quotas_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_quotas_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -103,6 +115,7 @@ def build_list_request( **kwargs ) + # fmt: on class QuotasOperations(object): """QuotasOperations operations. @@ -145,16 +158,24 @@ def update( :rtype: ~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotasResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'QuotaUpdateParameters') + _json = self._serialize.body(parameters, "QuotaUpdateParameters") request = build_update_request( location=location, @@ -162,32 +183,41 @@ def update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.update.metadata['url'], + template_url=self.update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('UpdateWorkspaceQuotasResult', pipeline_response) + deserialized = self._deserialize( + "UpdateWorkspaceQuotasResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas"} # type: ignore - + update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas"} # type: ignore @distributed_trace def list( @@ -206,27 +236,34 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListWorkspaceQuotas] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceQuotas"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListWorkspaceQuotas"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, @@ -239,7 +276,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ListWorkspaceQuotas", pipeline_response) + deserialized = self._deserialize( + "ListWorkspaceQuotas", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -248,22 +287,28 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registries_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registries_operations.py index 33398eca3844..301bc48a0a8f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registries_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registries_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -294,6 +306,7 @@ def build_remove_regions_request_initial( **kwargs ) + # fmt: on class RegistriesOperations(object): """RegistriesOperations operations. @@ -319,8 +332,7 @@ def __init__(self, client, config, serializer, deserializer): @distributed_trace def list_by_subscription( - self, - **kwargs # type: Any + self, **kwargs # type: Any ): # type: (...) -> Iterable["_models.RegistryTrackedResourceArmPaginatedResult"] """List registries by subscription. @@ -334,26 +346,33 @@ def list_by_subscription( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.RegistryTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_subscription.metadata['url'], + template_url=self.list_by_subscription.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, @@ -365,7 +384,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("RegistryTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "RegistryTrackedResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -374,25 +395,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore + list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore @distributed_trace def list( @@ -414,27 +441,34 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.RegistryTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -447,7 +481,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("RegistryTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "RegistryTrackedResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -456,25 +492,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -483,48 +525,64 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -554,42 +612,55 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace def get( @@ -612,46 +683,56 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.Registry :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace def update( @@ -677,16 +758,24 @@ def update( :rtype: ~azure.mgmt.machinelearningservices.models.Registry :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialRegistryPartialTrackedResource') + _json = self._serialize.body( + body, "PartialRegistryPartialTrackedResource" + ) request = build_update_request( subscription_id=self._config.subscription_id, @@ -695,32 +784,39 @@ def update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.update.metadata['url'], + template_url=self.update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - + update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore def _create_or_update_initial( self, @@ -730,16 +826,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.Registry" - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'Registry') + _json = self._serialize.body(body, "Registry") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -748,35 +850,40 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -809,15 +916,22 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Registry] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -825,32 +939,40 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore def _remove_regions_initial( self, @@ -860,16 +982,24 @@ def _remove_regions_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.Registry"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Registry"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.Registry"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'Registry') + _json = self._serialize.body(body, "Registry") request = build_remove_regions_request_initial( subscription_id=self._config.subscription_id, @@ -878,40 +1008,53 @@ def _remove_regions_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._remove_regions_initial.metadata['url'], + template_url=self._remove_regions_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _remove_regions_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions"} # type: ignore - + _remove_regions_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions"} # type: ignore @distributed_trace def begin_remove_regions( @@ -944,15 +1087,22 @@ def begin_remove_regions( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Registry] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._remove_regions_initial( resource_group_name=resource_group_name, @@ -960,29 +1110,37 @@ def begin_remove_regions( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_remove_regions.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions"} # type: ignore + begin_remove_regions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_code_containers_operations.py index 0caee1df1a46..a19ad984d1ce 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_code_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_code_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -192,6 +204,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class RegistryCodeContainersOperations(object): """RegistryCodeContainersOperations operations. @@ -241,29 +254,36 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, api_version=api_version, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -278,7 +298,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -287,25 +309,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -315,49 +343,65 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, code_name=code_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -390,43 +434,56 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, code_name=code_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore @distributed_trace def get( @@ -452,47 +509,57 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, code_name=code_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize("CodeContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore def _create_or_update_initial( self, @@ -503,16 +570,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.CodeContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeContainer') + _json = self._serialize.body(body, "CodeContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -522,39 +595,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('CodeContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -591,15 +680,22 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.CodeContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -608,29 +704,39 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_code_versions_operations.py index 53144ca64e30..9572791c66d3 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_code_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_code_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -250,6 +262,7 @@ def build_create_or_get_start_pending_upload_request( **kwargs ) + # fmt: on class RegistryCodeVersionsOperations(object): """RegistryCodeVersionsOperations operations. @@ -308,16 +321,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -327,13 +347,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -351,7 +371,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -360,25 +382,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -389,15 +417,18 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -405,34 +436,47 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements code_name=code_name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -468,14 +512,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -483,29 +532,37 @@ def begin_delete( # pylint: disable=inconsistent-return-statements code_name=code_name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -534,15 +591,18 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -550,32 +610,39 @@ def get( code_name=code_name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore def _create_or_update_initial( self, @@ -587,16 +654,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.CodeVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeVersion') + _json = self._serialize.body(body, "CodeVersion") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -607,39 +680,51 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('CodeVersion', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -679,15 +764,22 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.CodeVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -697,32 +789,40 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore @distributed_trace def create_or_get_start_pending_upload( @@ -754,16 +854,24 @@ def create_or_get_start_pending_upload( :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PendingUploadResponseDto"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PendingUploadRequestDto') + _json = self._serialize.body(body, "PendingUploadRequestDto") request = build_create_or_get_start_pending_upload_request( subscription_id=self._config.subscription_id, @@ -774,29 +882,40 @@ def create_or_get_start_pending_upload( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], + template_url=self.create_or_get_start_pending_upload.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) + deserialized = self._deserialize( + "PendingUploadResponseDto", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}/startPendingUpload"} # type: ignore - + create_or_get_start_pending_upload.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}/startPendingUpload"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_component_containers_operations.py index d8975ff219a0..2fb4d5fe2074 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_component_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_component_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -192,6 +204,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class RegistryComponentContainersOperations(object): """RegistryComponentContainersOperations operations. @@ -241,29 +254,36 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, api_version=api_version, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -278,7 +298,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -287,25 +310,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -315,49 +344,65 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, component_name=component_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -390,43 +435,56 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, component_name=component_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore @distributed_trace def get( @@ -452,47 +510,61 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, component_name=component_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore def _create_or_update_initial( self, @@ -503,16 +575,24 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.ComponentContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentContainer') + _json = self._serialize.body(body, "ComponentContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -522,39 +602,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComponentContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -592,15 +688,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComponentContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -609,29 +714,39 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_component_versions_operations.py index 8f84ea82e58f..bcd8e56ece9e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_component_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_component_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -209,6 +221,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class RegistryComponentVersionsOperations(object): """RegistryComponentVersionsOperations operations. @@ -270,16 +283,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -290,13 +310,13 @@ def prepare_request(next_link=None): top=top, skip=skip, stage=stage, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -315,7 +335,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -324,25 +346,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -353,15 +381,18 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -369,34 +400,47 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements component_name=component_name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -432,14 +476,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -447,29 +496,37 @@ def begin_delete( # pylint: disable=inconsistent-return-statements component_name=component_name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -498,15 +555,20 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -514,32 +576,39 @@ def get( component_name=component_name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize("ComponentVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore def _create_or_update_initial( self, @@ -551,16 +620,24 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.ComponentVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentVersion') + _json = self._serialize.body(body, "ComponentVersion") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -571,39 +648,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComponentVersion', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -644,15 +737,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComponentVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -662,29 +764,39 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_data_containers_operations.py index 0237381925bd..4ec126fae987 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_data_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_data_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -195,6 +207,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class RegistryDataContainersOperations(object): """RegistryDataContainersOperations operations. @@ -247,16 +260,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -264,13 +284,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -286,7 +306,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -295,25 +317,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -323,49 +351,65 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, name=name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -398,43 +442,56 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, name=name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore @distributed_trace def get( @@ -460,47 +517,57 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize("DataContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore def _create_or_update_initial( self, @@ -511,16 +578,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.DataContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DataContainer') + _json = self._serialize.body(body, "DataContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -530,39 +603,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('DataContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -599,15 +688,22 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.DataContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -616,29 +712,39 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_data_versions_operations.py index 536d6f88e4b4..fa4e9455bedf 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_data_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_data_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -256,6 +268,7 @@ def build_create_or_get_start_pending_upload_request( **kwargs ) + # fmt: on class RegistryDataVersionsOperations(object): """RegistryDataVersionsOperations operations. @@ -324,16 +337,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -345,13 +365,13 @@ def prepare_request(next_link=None): skip=skip, tags=tags, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -371,7 +391,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataVersionBaseResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -380,25 +402,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -409,15 +437,18 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -425,34 +456,47 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -488,14 +532,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -503,29 +552,37 @@ def begin_delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -554,15 +611,20 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -570,32 +632,39 @@ def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize("DataVersionBase", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore def _create_or_update_initial( self, @@ -607,16 +676,24 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.DataVersionBase" - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DataVersionBase') + _json = self._serialize.body(body, "DataVersionBase") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -627,39 +704,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('DataVersionBase', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -700,15 +793,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.DataVersionBase] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -718,32 +820,42 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace def create_or_get_start_pending_upload( @@ -775,16 +887,24 @@ def create_or_get_start_pending_upload( :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PendingUploadResponseDto"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PendingUploadRequestDto') + _json = self._serialize.body(body, "PendingUploadRequestDto") request = build_create_or_get_start_pending_upload_request( subscription_id=self._config.subscription_id, @@ -795,29 +915,40 @@ def create_or_get_start_pending_upload( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], + template_url=self.create_or_get_start_pending_upload.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) + deserialized = self._deserialize( + "PendingUploadResponseDto", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}/startPendingUpload"} # type: ignore - + create_or_get_start_pending_upload.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}/startPendingUpload"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_environment_containers_operations.py index 23e6dba4017d..003173b3cf0b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_environment_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_environment_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -195,6 +207,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class RegistryEnvironmentContainersOperations(object): """RegistryEnvironmentContainersOperations operations. @@ -247,16 +260,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -264,13 +284,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -286,7 +306,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -295,25 +318,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -323,49 +352,65 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, environment_name=environment_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -398,43 +443,56 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, environment_name=environment_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore @distributed_trace def get( @@ -460,47 +518,61 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, environment_name=environment_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore def _create_or_update_initial( self, @@ -511,16 +583,24 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.EnvironmentContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentContainer') + _json = self._serialize.body(body, "EnvironmentContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -530,39 +610,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -600,15 +696,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -617,29 +722,39 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_environment_versions_operations.py index 3ea0d1f3b707..b68e7793a689 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_environment_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_environment_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -209,6 +221,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class RegistryEnvironmentVersionsOperations(object): """RegistryEnvironmentVersionsOperations operations. @@ -270,16 +283,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -290,13 +310,13 @@ def prepare_request(next_link=None): top=top, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -315,7 +335,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersionResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -324,25 +347,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -353,15 +382,18 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -369,34 +401,47 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements environment_name=environment_name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -432,14 +477,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -447,29 +497,37 @@ def begin_delete( # pylint: disable=inconsistent-return-statements environment_name=environment_name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -498,15 +556,20 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -514,32 +577,41 @@ def get( environment_name=environment_name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore def _create_or_update_initial( self, @@ -551,16 +623,24 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.EnvironmentVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentVersion') + _json = self._serialize.body(body, "EnvironmentVersion") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -571,39 +651,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -644,15 +740,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -662,29 +767,39 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_model_containers_operations.py index eb9811f792f1..c0c149251a48 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_model_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_model_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -195,6 +207,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class RegistryModelContainersOperations(object): """RegistryModelContainersOperations operations. @@ -247,16 +260,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -264,13 +284,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -286,7 +306,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -295,25 +317,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -323,49 +351,65 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, model_name=model_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -398,43 +442,56 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, model_name=model_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore @distributed_trace def get( @@ -460,47 +517,59 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, model_name=model_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize("ModelContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore def _create_or_update_initial( self, @@ -511,16 +580,24 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.ModelContainer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelContainer') + _json = self._serialize.body(body, "ModelContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -530,39 +607,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ModelContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -600,15 +693,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ModelContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -617,29 +719,39 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_model_versions_operations.py index 6aba5938e165..aade2192fd67 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_model_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_registry_model_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -265,6 +277,7 @@ def build_create_or_get_start_pending_upload_request( **kwargs ) + # fmt: on class RegistryModelVersionsOperations(object): """RegistryModelVersionsOperations operations. @@ -340,16 +353,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -364,13 +384,13 @@ def prepare_request(next_link=None): tags=tags, properties=properties, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -393,7 +413,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -402,25 +424,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -431,15 +459,18 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -447,34 +478,47 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements model_name=model_name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -510,14 +554,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -525,29 +574,37 @@ def begin_delete( # pylint: disable=inconsistent-return-statements model_name=model_name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -576,15 +633,18 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -592,32 +652,39 @@ def get( model_name=model_name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore def _create_or_update_initial( self, @@ -629,16 +696,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.ModelVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelVersion') + _json = self._serialize.body(body, "ModelVersion") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -649,39 +722,51 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ModelVersion', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -721,15 +806,22 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ModelVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -739,32 +831,40 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore @distributed_trace def create_or_get_start_pending_upload( @@ -796,16 +896,24 @@ def create_or_get_start_pending_upload( :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PendingUploadResponseDto"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PendingUploadRequestDto') + _json = self._serialize.body(body, "PendingUploadRequestDto") request = build_create_or_get_start_pending_upload_request( subscription_id=self._config.subscription_id, @@ -816,29 +924,40 @@ def create_or_get_start_pending_upload( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], + template_url=self.create_or_get_start_pending_upload.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) + deserialized = self._deserialize( + "PendingUploadResponseDto", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/startPendingUpload"} # type: ignore - + create_or_get_start_pending_upload.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/startPendingUpload"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_schedules_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_schedules_operations.py index 7dace1082eff..5062efe083a8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_schedules_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_schedules_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -195,6 +207,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class SchedulesOperations(object): """SchedulesOperations operations. @@ -247,16 +260,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ScheduleResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduleResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ScheduleResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -264,13 +284,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -286,7 +306,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ScheduleResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ScheduleResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -295,25 +317,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -323,49 +351,65 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -398,43 +442,56 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @distributed_trace def get( @@ -460,47 +517,57 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.Schedule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Schedule"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Schedule', pipeline_response) + deserialized = self._deserialize("Schedule", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore def _create_or_update_initial( self, @@ -511,16 +578,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.Schedule" - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Schedule"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'Schedule') + _json = self._serialize.body(body, "Schedule") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -530,39 +603,51 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('Schedule', pipeline_response) + deserialized = self._deserialize("Schedule", pipeline_response) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('Schedule', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("Schedule", pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -598,15 +683,22 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Schedule] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Schedule"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -615,29 +707,37 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Schedule', pipeline_response) + deserialized = self._deserialize("Schedule", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_usages_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_usages_operations.py index 37c8eefe0683..6df841a37bbf 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_usages_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_usages_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -65,6 +77,7 @@ def build_list_request( **kwargs ) + # fmt: on class UsagesOperations(object): """UsagesOperations operations. @@ -106,27 +119,34 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListUsagesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListUsagesResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, @@ -139,7 +159,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ListUsagesResult", pipeline_response) + deserialized = self._deserialize( + "ListUsagesResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -148,22 +170,28 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_virtual_machine_sizes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_virtual_machine_sizes_operations.py index efddf3efc71b..ae680c12183d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_virtual_machine_sizes_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_virtual_machine_sizes_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest @@ -23,8 +29,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -64,6 +76,7 @@ def build_list_request( **kwargs ) + # fmt: on class VirtualMachineSizesOperations(object): """VirtualMachineSizesOperations operations. @@ -103,42 +116,56 @@ def list( :rtype: ~azure.mgmt.machinelearningservices.models.VirtualMachineSizeListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_list_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualMachineSizeListResult', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "VirtualMachineSizeListResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes"} # type: ignore - + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_workspace_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_workspace_connections_operations.py index 0546d4e3efe1..9a564a3f580c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_workspace_connections_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_workspace_connections_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -193,6 +205,7 @@ def build_list_request( **kwargs ) + # fmt: on class WorkspaceConnectionsOperations(object): """WorkspaceConnectionsOperations operations. @@ -242,16 +255,26 @@ def create( :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'WorkspaceConnectionPropertiesV2BasicResource') + _json = self._serialize.body( + parameters, "WorkspaceConnectionPropertiesV2BasicResource" + ) request = build_create_request( subscription_id=self._config.subscription_id, @@ -261,32 +284,41 @@ def create( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create.metadata['url'], + template_url=self.create.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - + create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace def get( @@ -310,47 +342,61 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, connection_name=connection_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -374,43 +420,53 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, connection_name=connection_name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace def list( @@ -439,16 +495,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -456,13 +519,13 @@ def prepare_request(next_link=None): api_version=api_version, target=target, category=category, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -478,7 +541,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -487,22 +553,28 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_workspace_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_workspace_features_operations.py index 20ea19c98489..1c20abddcb1c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_workspace_features_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_workspace_features_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -67,6 +79,7 @@ def build_list_request( **kwargs ) + # fmt: on class WorkspaceFeaturesOperations(object): """WorkspaceFeaturesOperations operations. @@ -111,28 +124,35 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ListAmlUserFeatureResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAmlUserFeatureResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListAmlUserFeatureResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -146,7 +166,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ListAmlUserFeatureResult", pipeline_response) + deserialized = self._deserialize( + "ListAmlUserFeatureResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -155,22 +177,28 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_workspaces_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_workspaces_operations.py index c43747df09c5..12f725c627b4 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_workspaces_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_04_01_preview/operations/_workspaces_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -568,6 +580,7 @@ def build_list_outbound_network_dependencies_endpoints_request( **kwargs ) + # fmt: on class WorkspacesOperations(object): """WorkspacesOperations operations. @@ -610,46 +623,56 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.Workspace :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore def _create_or_update_initial( self, @@ -659,16 +682,24 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.Workspace"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.Workspace"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'Workspace') + _json = self._serialize.body(parameters, "Workspace") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -677,33 +708,38 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -734,15 +770,22 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Workspace] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -750,32 +793,36 @@ def begin_create_or_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -785,42 +832,50 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, force_to_purge=force_to_purge, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -851,43 +906,52 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, force_to_purge=force_to_purge, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore def _update_initial( self, @@ -897,16 +961,24 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.Workspace"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.Workspace"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'WorkspaceUpdateParameters') + _json = self._serialize.body(parameters, "WorkspaceUpdateParameters") request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -915,33 +987,38 @@ def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace def begin_update( @@ -972,15 +1049,22 @@ def begin_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Workspace] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -988,32 +1072,36 @@ def begin_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace def list_by_resource_group( @@ -1038,29 +1126,36 @@ def list_by_resource_group( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_by_resource_group_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, api_version=api_version, skip=skip, kind=kind, - template_url=self.list_by_resource_group.metadata['url'], + template_url=self.list_by_resource_group.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_by_resource_group_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -1075,7 +1170,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1084,25 +1181,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore + list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore def _diagnose_initial( self, @@ -1112,17 +1215,27 @@ def _diagnose_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.DiagnoseResponseResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if parameters is not None: - _json = self._serialize.body(parameters, 'DiagnoseWorkspaceParameters') + _json = self._serialize.body( + parameters, "DiagnoseWorkspaceParameters" + ) else: _json = None @@ -1133,39 +1246,49 @@ def _diagnose_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._diagnose_initial.metadata['url'], + template_url=self._diagnose_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) + deserialized = self._deserialize( + "DiagnoseResponseResult", pipeline_response + ) if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _diagnose_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore - + _diagnose_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore @distributed_trace def begin_diagnose( @@ -1200,15 +1323,24 @@ def begin_diagnose( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.DiagnoseResponseResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnoseResponseResult"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DiagnoseResponseResult"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._diagnose_initial( resource_group_name=resource_group_name, @@ -1216,32 +1348,42 @@ def begin_diagnose( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) + deserialized = self._deserialize( + "DiagnoseResponseResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_diagnose.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore + begin_diagnose.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore @distributed_trace def list_keys( @@ -1263,46 +1405,60 @@ def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListWorkspaceKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceKeysResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListWorkspaceKeysResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ListWorkspaceKeysResult', pipeline_response) + deserialized = self._deserialize( + "ListWorkspaceKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys"} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys"} # type: ignore def _resync_keys_initial( # pylint: disable=inconsistent-return-statements self, @@ -1311,41 +1467,49 @@ def _resync_keys_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_resync_keys_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self._resync_keys_initial.metadata['url'], + template_url=self._resync_keys_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _resync_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore - + _resync_keys_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore @distributed_trace def begin_resync_keys( # pylint: disable=inconsistent-return-statements @@ -1374,42 +1538,51 @@ def begin_resync_keys( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._resync_keys_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_resync_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore + begin_resync_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore @distributed_trace def list_by_subscription( @@ -1431,28 +1604,35 @@ def list_by_subscription( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, skip=skip, kind=kind, - template_url=self.list_by_subscription.metadata['url'], + template_url=self.list_by_subscription.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, @@ -1466,7 +1646,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1475,25 +1657,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore + list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore @distributed_trace def list_notebook_access_token( @@ -1514,46 +1702,60 @@ def list_notebook_access_token( :rtype: ~azure.mgmt.machinelearningservices.models.NotebookAccessTokenResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookAccessTokenResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.NotebookAccessTokenResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_list_notebook_access_token_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_notebook_access_token.metadata['url'], + template_url=self.list_notebook_access_token.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('NotebookAccessTokenResult', pipeline_response) + deserialized = self._deserialize( + "NotebookAccessTokenResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_notebook_access_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken"} # type: ignore - + list_notebook_access_token.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken"} # type: ignore def _prepare_notebook_initial( self, @@ -1562,47 +1764,59 @@ def _prepare_notebook_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.NotebookResourceInfo"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NotebookResourceInfo"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.NotebookResourceInfo"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_prepare_notebook_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self._prepare_notebook_initial.metadata['url'], + template_url=self._prepare_notebook_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) + deserialized = self._deserialize( + "NotebookResourceInfo", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _prepare_notebook_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore - + _prepare_notebook_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore @distributed_trace def begin_prepare_notebook( @@ -1632,45 +1846,62 @@ def begin_prepare_notebook( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.NotebookResourceInfo] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookResourceInfo"] + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.NotebookResourceInfo"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._prepare_notebook_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) + deserialized = self._deserialize( + "NotebookResourceInfo", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_prepare_notebook.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore + begin_prepare_notebook.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore @distributed_trace def list_storage_account_keys( @@ -1691,46 +1922,60 @@ def list_storage_account_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListStorageAccountKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListStorageAccountKeysResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListStorageAccountKeysResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_list_storage_account_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_storage_account_keys.metadata['url'], + template_url=self.list_storage_account_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ListStorageAccountKeysResult', pipeline_response) + deserialized = self._deserialize( + "ListStorageAccountKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_storage_account_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys"} # type: ignore - + list_storage_account_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys"} # type: ignore @distributed_trace def list_notebook_keys( @@ -1751,46 +1996,60 @@ def list_notebook_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListNotebookKeysResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListNotebookKeysResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_list_notebook_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_notebook_keys.metadata['url'], + template_url=self.list_notebook_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ListNotebookKeysResult', pipeline_response) + deserialized = self._deserialize( + "ListNotebookKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_notebook_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys"} # type: ignore - + list_notebook_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys"} # type: ignore @distributed_trace def list_outbound_network_dependencies_endpoints( @@ -1815,43 +2074,59 @@ def list_outbound_network_dependencies_endpoints( :rtype: ~azure.mgmt.machinelearningservices.models.ExternalFQDNResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExternalFQDNResponse"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ExternalFQDNResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-04-01-preview" + ) # type: str - request = build_list_outbound_network_dependencies_endpoints_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], + template_url=self.list_outbound_network_dependencies_endpoints.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ExternalFQDNResponse', pipeline_response) + deserialized = self._deserialize( + "ExternalFQDNResponse", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_outbound_network_dependencies_endpoints.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints"} # type: ignore - + list_outbound_network_dependencies_endpoints.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/__init__.py index da46614477a9..71cf8fdc020d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/__init__.py @@ -10,9 +10,10 @@ from ._version import VERSION __version__ = VERSION -__all__ = ['AzureMachineLearningWorkspaces'] +__all__ = ["AzureMachineLearningWorkspaces"] # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk + patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/_azure_machine_learning_workspaces.py index 739388073038..4ecd12e163bb 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/_azure_machine_learning_workspaces.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/_azure_machine_learning_workspaces.py @@ -15,7 +15,54 @@ from . import models from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import BatchDeploymentsOperations, BatchEndpointsOperations, CodeContainersOperations, CodeVersionsOperations, ComponentContainersOperations, ComponentVersionsOperations, ComputeOperations, DataContainersOperations, DataVersionsOperations, DatastoresOperations, EnvironmentContainersOperations, EnvironmentVersionsOperations, FeaturesOperations, FeaturesetContainersOperations, FeaturesetVersionsOperations, FeaturestoreEntityContainersOperations, FeaturestoreEntityVersionsOperations, JobsOperations, LabelingJobsOperations, ManagedNetworkProvisionsOperations, ManagedNetworkSettingsRuleOperations, ModelContainersOperations, ModelVersionsOperations, OnlineDeploymentsOperations, OnlineEndpointsOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, QuotasOperations, RegistriesOperations, RegistryCodeContainersOperations, RegistryCodeVersionsOperations, RegistryComponentContainersOperations, RegistryComponentVersionsOperations, RegistryDataContainersOperations, RegistryDataVersionsOperations, RegistryEnvironmentContainersOperations, RegistryEnvironmentVersionsOperations, RegistryModelContainersOperations, RegistryModelVersionsOperations, SchedulesOperations, UsagesOperations, VirtualMachineSizesOperations, WorkspaceConnectionsOperations, WorkspaceFeaturesOperations, WorkspacesOperations +from .operations import ( + BatchDeploymentsOperations, + BatchEndpointsOperations, + CodeContainersOperations, + CodeVersionsOperations, + ComponentContainersOperations, + ComponentVersionsOperations, + ComputeOperations, + DataContainersOperations, + DataVersionsOperations, + DatastoresOperations, + EnvironmentContainersOperations, + EnvironmentVersionsOperations, + FeaturesOperations, + FeaturesetContainersOperations, + FeaturesetVersionsOperations, + FeaturestoreEntityContainersOperations, + FeaturestoreEntityVersionsOperations, + JobsOperations, + LabelingJobsOperations, + ManagedNetworkProvisionsOperations, + ManagedNetworkSettingsRuleOperations, + ModelContainersOperations, + ModelVersionsOperations, + OnlineDeploymentsOperations, + OnlineEndpointsOperations, + Operations, + PrivateEndpointConnectionsOperations, + PrivateLinkResourcesOperations, + QuotasOperations, + RegistriesOperations, + RegistryCodeContainersOperations, + RegistryCodeVersionsOperations, + RegistryComponentContainersOperations, + RegistryComponentVersionsOperations, + RegistryDataContainersOperations, + RegistryDataVersionsOperations, + RegistryEnvironmentContainersOperations, + RegistryEnvironmentVersionsOperations, + RegistryModelContainersOperations, + RegistryModelVersionsOperations, + SchedulesOperations, + UsagesOperations, + VirtualMachineSizesOperations, + WorkspaceConnectionsOperations, + WorkspaceFeaturesOperations, + WorkspacesOperations, +) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -24,7 +71,10 @@ from azure.core.credentials import TokenCredential from azure.core.rest import HttpRequest, HttpResponse -class AzureMachineLearningWorkspaces(object): # pylint: disable=too-many-instance-attributes + +class AzureMachineLearningWorkspaces( + object +): # pylint: disable=too-many-instance-attributes """These APIs allow end users to operate on Azure Machine Learning Workspace resources. :ivar usages: UsagesOperations operations @@ -172,60 +222,171 @@ def __init__( **kwargs # type: Any ): # type: (...) -> None - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._config = AzureMachineLearningWorkspacesConfiguration( + credential=credential, subscription_id=subscription_id, **kwargs + ) + self._client = ARMPipelineClient( + base_url=base_url, config=self._config, **kwargs + ) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = { + k: v for k, v in models.__dict__.items() if isinstance(v, type) + } self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) - self.virtual_machine_sizes = VirtualMachineSizesOperations(self._client, self._config, self._serialize, self._deserialize) - self.quotas = QuotasOperations(self._client, self._config, self._serialize, self._deserialize) - self.compute = ComputeOperations(self._client, self._config, self._serialize, self._deserialize) - self.registries = RegistriesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_features = WorkspaceFeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_code_containers = RegistryCodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_code_versions = RegistryCodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_component_containers = RegistryComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_component_versions = RegistryComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_data_containers = RegistryDataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_data_versions = RegistryDataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_environment_containers = RegistryEnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_environment_versions = RegistryEnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_model_containers = RegistryModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_model_versions = RegistryModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_endpoints = BatchEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_deployments = BatchDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_containers = CodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_versions = CodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_containers = ComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_versions = ComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_containers = DataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_versions = DataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.datastores = DatastoresOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_containers = EnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_versions = EnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.featureset_containers = FeaturesetContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.features = FeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - self.featureset_versions = FeaturesetVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.featurestore_entity_containers = FeaturestoreEntityContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.featurestore_entity_versions = FeaturestoreEntityVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.labeling_jobs = LabelingJobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_containers = ModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_versions = ModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_endpoints = OnlineEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_deployments = OnlineDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.schedules = SchedulesOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.workspaces = WorkspacesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_connections = WorkspaceConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.managed_network_settings_rule = ManagedNetworkSettingsRuleOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.managed_network_provisions = ManagedNetworkProvisionsOperations(self._client, self._config, self._serialize, self._deserialize) - + self.usages = UsagesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.virtual_machine_sizes = VirtualMachineSizesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.quotas = QuotasOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.compute = ComputeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registries = RegistriesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspace_features = WorkspaceFeaturesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_code_containers = RegistryCodeContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_code_versions = RegistryCodeVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_component_containers = ( + RegistryComponentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.registry_component_versions = RegistryComponentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_data_containers = RegistryDataContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_data_versions = RegistryDataVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_environment_containers = ( + RegistryEnvironmentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.registry_environment_versions = ( + RegistryEnvironmentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.registry_model_containers = RegistryModelContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_model_versions = RegistryModelVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.batch_endpoints = BatchEndpointsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.batch_deployments = BatchDeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.code_containers = CodeContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.code_versions = CodeVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.component_containers = ComponentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.component_versions = ComponentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_containers = DataContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_versions = DataVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.datastores = DatastoresOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.environment_containers = EnvironmentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.environment_versions = EnvironmentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.featureset_containers = FeaturesetContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.features = FeaturesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.featureset_versions = FeaturesetVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.featurestore_entity_containers = ( + FeaturestoreEntityContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.featurestore_entity_versions = ( + FeaturestoreEntityVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.jobs = JobsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.labeling_jobs = LabelingJobsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.model_containers = ModelContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.model_versions = ModelVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.online_endpoints = OnlineEndpointsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.online_deployments = OnlineDeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.schedules = SchedulesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspaces = WorkspacesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspace_connections = WorkspaceConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.managed_network_settings_rule = ( + ManagedNetworkSettingsRuleOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.private_endpoint_connections = ( + PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.managed_network_provisions = ManagedNetworkProvisionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) def _send_request( self, diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/_configuration.py index d6f47209a96d..e6b04308587a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/_configuration.py @@ -10,7 +10,10 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ( + ARMChallengeAuthenticationPolicy, + ARMHttpLoggingPolicy, +) from ._version import VERSION @@ -21,7 +24,9 @@ from azure.core.credentials import TokenCredential -class AzureMachineLearningWorkspacesConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AzureMachineLearningWorkspacesConfiguration( + Configuration +): # pylint: disable=too-many-instance-attributes """Configuration for AzureMachineLearningWorkspaces. Note that all parameters used to create this instance are saved as instance @@ -43,8 +48,12 @@ def __init__( **kwargs # type: Any ): # type: (...) -> None - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + super(AzureMachineLearningWorkspacesConfiguration, self).__init__( + **kwargs + ) + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -54,23 +63,44 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = api_version - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) + self.credential_scopes = kwargs.pop( + "credential_scopes", ["https://management.azure.com/.default"] + ) + kwargs.setdefault( + "sdk_moniker", "mgmt-machinelearningservices/{}".format(VERSION) + ) self._configure(**kwargs) def _configure( - self, - **kwargs # type: Any + self, **kwargs # type: Any ): # type: (...) -> None - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') + self.user_agent_policy = kwargs.get( + "user_agent_policy" + ) or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get( + "headers_policy" + ) or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy( + **kwargs + ) + self.logging_policy = kwargs.get( + "logging_policy" + ) or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get( + "http_logging_policy" + ) or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy( + **kwargs + ) + self.custom_hook_policy = kwargs.get( + "custom_hook_policy" + ) or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get( + "redirect_policy" + ) or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = ARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/_patch.py index 74e48ecd07cf..17dbc073e01b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/_patch.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/_patch.py @@ -25,7 +25,8 @@ # # -------------------------------------------------------------------------- + # This file is used for handwritten extensions to the generated code. Example: # https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md def patch_sdk(): - pass \ No newline at end of file + pass diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/_vendor.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/_vendor.py index 138f663c53a4..ed3373e9699d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/_vendor.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/_vendor.py @@ -7,13 +7,20 @@ from azure.core.pipeline.transport import HttpRequest + def _convert_request(request, files=None): data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + request = HttpRequest( + method=request.method, + url=request.url, + headers=request.headers, + data=data, + ) if files: request.set_formdata_body(files) return request + def _format_url_section(template, **kwargs): components = template.split("/") while components: @@ -22,6 +29,8 @@ def _format_url_section(template, **kwargs): except KeyError as key: formatted_components = template.split("/") components = [ - c for c in formatted_components if "{}".format(key.args[0]) not in c + c + for c in formatted_components + if "{}".format(key.args[0]) not in c ] template = "/".join(components) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/__init__.py index f67ccda966f1..b90ec7485f14 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/__init__.py @@ -7,9 +7,11 @@ # -------------------------------------------------------------------------- from ._azure_machine_learning_workspaces import AzureMachineLearningWorkspaces -__all__ = ['AzureMachineLearningWorkspaces'] + +__all__ = ["AzureMachineLearningWorkspaces"] # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk + patch_sdk() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/_azure_machine_learning_workspaces.py index 4f5e19df1672..6ddda1f56d2b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/_azure_machine_learning_workspaces.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/_azure_machine_learning_workspaces.py @@ -16,13 +16,61 @@ from .. import models from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import BatchDeploymentsOperations, BatchEndpointsOperations, CodeContainersOperations, CodeVersionsOperations, ComponentContainersOperations, ComponentVersionsOperations, ComputeOperations, DataContainersOperations, DataVersionsOperations, DatastoresOperations, EnvironmentContainersOperations, EnvironmentVersionsOperations, FeaturesOperations, FeaturesetContainersOperations, FeaturesetVersionsOperations, FeaturestoreEntityContainersOperations, FeaturestoreEntityVersionsOperations, JobsOperations, LabelingJobsOperations, ManagedNetworkProvisionsOperations, ManagedNetworkSettingsRuleOperations, ModelContainersOperations, ModelVersionsOperations, OnlineDeploymentsOperations, OnlineEndpointsOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, QuotasOperations, RegistriesOperations, RegistryCodeContainersOperations, RegistryCodeVersionsOperations, RegistryComponentContainersOperations, RegistryComponentVersionsOperations, RegistryDataContainersOperations, RegistryDataVersionsOperations, RegistryEnvironmentContainersOperations, RegistryEnvironmentVersionsOperations, RegistryModelContainersOperations, RegistryModelVersionsOperations, SchedulesOperations, UsagesOperations, VirtualMachineSizesOperations, WorkspaceConnectionsOperations, WorkspaceFeaturesOperations, WorkspacesOperations +from .operations import ( + BatchDeploymentsOperations, + BatchEndpointsOperations, + CodeContainersOperations, + CodeVersionsOperations, + ComponentContainersOperations, + ComponentVersionsOperations, + ComputeOperations, + DataContainersOperations, + DataVersionsOperations, + DatastoresOperations, + EnvironmentContainersOperations, + EnvironmentVersionsOperations, + FeaturesOperations, + FeaturesetContainersOperations, + FeaturesetVersionsOperations, + FeaturestoreEntityContainersOperations, + FeaturestoreEntityVersionsOperations, + JobsOperations, + LabelingJobsOperations, + ManagedNetworkProvisionsOperations, + ManagedNetworkSettingsRuleOperations, + ModelContainersOperations, + ModelVersionsOperations, + OnlineDeploymentsOperations, + OnlineEndpointsOperations, + Operations, + PrivateEndpointConnectionsOperations, + PrivateLinkResourcesOperations, + QuotasOperations, + RegistriesOperations, + RegistryCodeContainersOperations, + RegistryCodeVersionsOperations, + RegistryComponentContainersOperations, + RegistryComponentVersionsOperations, + RegistryDataContainersOperations, + RegistryDataVersionsOperations, + RegistryEnvironmentContainersOperations, + RegistryEnvironmentVersionsOperations, + RegistryModelContainersOperations, + RegistryModelVersionsOperations, + SchedulesOperations, + UsagesOperations, + VirtualMachineSizesOperations, + WorkspaceConnectionsOperations, + WorkspaceFeaturesOperations, + WorkspacesOperations, +) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class AzureMachineLearningWorkspaces: # pylint: disable=too-many-instance-attributes + +class AzureMachineLearningWorkspaces: # pylint: disable=too-many-instance-attributes """These APIs allow end users to operate on Azure Machine Learning Workspace resources. :ivar usages: UsagesOperations operations @@ -173,65 +221,174 @@ def __init__( base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._config = AzureMachineLearningWorkspacesConfiguration( + credential=credential, subscription_id=subscription_id, **kwargs + ) + self._client = AsyncARMPipelineClient( + base_url=base_url, config=self._config, **kwargs + ) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = { + k: v for k, v in models.__dict__.items() if isinstance(v, type) + } self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) - self.virtual_machine_sizes = VirtualMachineSizesOperations(self._client, self._config, self._serialize, self._deserialize) - self.quotas = QuotasOperations(self._client, self._config, self._serialize, self._deserialize) - self.compute = ComputeOperations(self._client, self._config, self._serialize, self._deserialize) - self.registries = RegistriesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_features = WorkspaceFeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_code_containers = RegistryCodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_code_versions = RegistryCodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_component_containers = RegistryComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_component_versions = RegistryComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_data_containers = RegistryDataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_data_versions = RegistryDataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_environment_containers = RegistryEnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_environment_versions = RegistryEnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_model_containers = RegistryModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.registry_model_versions = RegistryModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_endpoints = BatchEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.batch_deployments = BatchDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_containers = CodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.code_versions = CodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_containers = ComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.component_versions = ComponentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_containers = DataContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_versions = DataVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.datastores = DatastoresOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_containers = EnvironmentContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.environment_versions = EnvironmentVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.featureset_containers = FeaturesetContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.features = FeaturesOperations(self._client, self._config, self._serialize, self._deserialize) - self.featureset_versions = FeaturesetVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.featurestore_entity_containers = FeaturestoreEntityContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.featurestore_entity_versions = FeaturestoreEntityVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.labeling_jobs = LabelingJobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_containers = ModelContainersOperations(self._client, self._config, self._serialize, self._deserialize) - self.model_versions = ModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_endpoints = OnlineEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.online_deployments = OnlineDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.schedules = SchedulesOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.workspaces = WorkspacesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workspace_connections = WorkspaceConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.managed_network_settings_rule = ManagedNetworkSettingsRuleOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.managed_network_provisions = ManagedNetworkProvisionsOperations(self._client, self._config, self._serialize, self._deserialize) - + self.usages = UsagesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.virtual_machine_sizes = VirtualMachineSizesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.quotas = QuotasOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.compute = ComputeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registries = RegistriesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspace_features = WorkspaceFeaturesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_code_containers = RegistryCodeContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_code_versions = RegistryCodeVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_component_containers = ( + RegistryComponentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.registry_component_versions = RegistryComponentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_data_containers = RegistryDataContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_data_versions = RegistryDataVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_environment_containers = ( + RegistryEnvironmentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.registry_environment_versions = ( + RegistryEnvironmentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.registry_model_containers = RegistryModelContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_model_versions = RegistryModelVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.batch_endpoints = BatchEndpointsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.batch_deployments = BatchDeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.code_containers = CodeContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.code_versions = CodeVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.component_containers = ComponentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.component_versions = ComponentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_containers = DataContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_versions = DataVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.datastores = DatastoresOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.environment_containers = EnvironmentContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.environment_versions = EnvironmentVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.featureset_containers = FeaturesetContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.features = FeaturesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.featureset_versions = FeaturesetVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.featurestore_entity_containers = ( + FeaturestoreEntityContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.featurestore_entity_versions = ( + FeaturestoreEntityVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.jobs = JobsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.labeling_jobs = LabelingJobsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.model_containers = ModelContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.model_versions = ModelVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.online_endpoints = OnlineEndpointsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.online_deployments = OnlineDeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.schedules = SchedulesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspaces = WorkspacesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workspace_connections = WorkspaceConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.managed_network_settings_rule = ( + ManagedNetworkSettingsRuleOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.private_endpoint_connections = ( + PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.managed_network_provisions = ManagedNetworkProvisionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) def _send_request( - self, - request: HttpRequest, - **kwargs: Any + self, request: HttpRequest, **kwargs: Any ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/_configuration.py index 7c536102af93..82a8ecc0d7a7 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/_configuration.py @@ -10,7 +10,10 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy +from azure.mgmt.core.policies import ( + ARMHttpLoggingPolicy, + AsyncARMChallengeAuthenticationPolicy, +) from .._version import VERSION @@ -19,7 +22,9 @@ from azure.core.credentials_async import AsyncTokenCredential -class AzureMachineLearningWorkspacesConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class AzureMachineLearningWorkspacesConfiguration( + Configuration +): # pylint: disable=too-many-instance-attributes """Configuration for AzureMachineLearningWorkspaces. Note that all parameters used to create this instance are saved as instance @@ -40,8 +45,12 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: - super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + super(AzureMachineLearningWorkspacesConfiguration, self).__init__( + **kwargs + ) + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -51,22 +60,41 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = api_version - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) + self.credential_scopes = kwargs.pop( + "credential_scopes", ["https://management.azure.com/.default"] + ) + kwargs.setdefault( + "sdk_moniker", "mgmt-machinelearningservices/{}".format(VERSION) + ) self._configure(**kwargs) - def _configure( - self, - **kwargs: Any - ) -> None: - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get( + "user_agent_policy" + ) or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get( + "headers_policy" + ) or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy( + **kwargs + ) + self.logging_policy = kwargs.get( + "logging_policy" + ) or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get( + "http_logging_policy" + ) or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get( + "retry_policy" + ) or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get( + "custom_hook_policy" + ) or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get( + "redirect_policy" + ) or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/_patch.py index 74e48ecd07cf..17dbc073e01b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/_patch.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/_patch.py @@ -25,7 +25,8 @@ # # -------------------------------------------------------------------------- + # This file is used for handwritten extensions to the generated code. Example: # https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md def patch_sdk(): - pass \ No newline at end of file + pass diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/__init__.py index 46cd9a8ab550..ad57127a5f0f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/__init__.py @@ -12,16 +12,32 @@ from ._compute_operations import ComputeOperations from ._registries_operations import RegistriesOperations from ._workspace_features_operations import WorkspaceFeaturesOperations -from ._registry_code_containers_operations import RegistryCodeContainersOperations +from ._registry_code_containers_operations import ( + RegistryCodeContainersOperations, +) from ._registry_code_versions_operations import RegistryCodeVersionsOperations -from ._registry_component_containers_operations import RegistryComponentContainersOperations -from ._registry_component_versions_operations import RegistryComponentVersionsOperations -from ._registry_data_containers_operations import RegistryDataContainersOperations +from ._registry_component_containers_operations import ( + RegistryComponentContainersOperations, +) +from ._registry_component_versions_operations import ( + RegistryComponentVersionsOperations, +) +from ._registry_data_containers_operations import ( + RegistryDataContainersOperations, +) from ._registry_data_versions_operations import RegistryDataVersionsOperations -from ._registry_environment_containers_operations import RegistryEnvironmentContainersOperations -from ._registry_environment_versions_operations import RegistryEnvironmentVersionsOperations -from ._registry_model_containers_operations import RegistryModelContainersOperations -from ._registry_model_versions_operations import RegistryModelVersionsOperations +from ._registry_environment_containers_operations import ( + RegistryEnvironmentContainersOperations, +) +from ._registry_environment_versions_operations import ( + RegistryEnvironmentVersionsOperations, +) +from ._registry_model_containers_operations import ( + RegistryModelContainersOperations, +) +from ._registry_model_versions_operations import ( + RegistryModelVersionsOperations, +) from ._batch_endpoints_operations import BatchEndpointsOperations from ._batch_deployments_operations import BatchDeploymentsOperations from ._code_containers_operations import CodeContainersOperations @@ -36,8 +52,12 @@ from ._featureset_containers_operations import FeaturesetContainersOperations from ._features_operations import FeaturesOperations from ._featureset_versions_operations import FeaturesetVersionsOperations -from ._featurestore_entity_containers_operations import FeaturestoreEntityContainersOperations -from ._featurestore_entity_versions_operations import FeaturestoreEntityVersionsOperations +from ._featurestore_entity_containers_operations import ( + FeaturestoreEntityContainersOperations, +) +from ._featurestore_entity_versions_operations import ( + FeaturestoreEntityVersionsOperations, +) from ._jobs_operations import JobsOperations from ._labeling_jobs_operations import LabelingJobsOperations from ._model_containers_operations import ModelContainersOperations @@ -48,56 +68,62 @@ from ._operations import Operations from ._workspaces_operations import WorkspacesOperations from ._workspace_connections_operations import WorkspaceConnectionsOperations -from ._managed_network_settings_rule_operations import ManagedNetworkSettingsRuleOperations -from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._managed_network_settings_rule_operations import ( + ManagedNetworkSettingsRuleOperations, +) +from ._private_endpoint_connections_operations import ( + PrivateEndpointConnectionsOperations, +) from ._private_link_resources_operations import PrivateLinkResourcesOperations -from ._managed_network_provisions_operations import ManagedNetworkProvisionsOperations +from ._managed_network_provisions_operations import ( + ManagedNetworkProvisionsOperations, +) __all__ = [ - 'UsagesOperations', - 'VirtualMachineSizesOperations', - 'QuotasOperations', - 'ComputeOperations', - 'RegistriesOperations', - 'WorkspaceFeaturesOperations', - 'RegistryCodeContainersOperations', - 'RegistryCodeVersionsOperations', - 'RegistryComponentContainersOperations', - 'RegistryComponentVersionsOperations', - 'RegistryDataContainersOperations', - 'RegistryDataVersionsOperations', - 'RegistryEnvironmentContainersOperations', - 'RegistryEnvironmentVersionsOperations', - 'RegistryModelContainersOperations', - 'RegistryModelVersionsOperations', - 'BatchEndpointsOperations', - 'BatchDeploymentsOperations', - 'CodeContainersOperations', - 'CodeVersionsOperations', - 'ComponentContainersOperations', - 'ComponentVersionsOperations', - 'DataContainersOperations', - 'DataVersionsOperations', - 'DatastoresOperations', - 'EnvironmentContainersOperations', - 'EnvironmentVersionsOperations', - 'FeaturesetContainersOperations', - 'FeaturesOperations', - 'FeaturesetVersionsOperations', - 'FeaturestoreEntityContainersOperations', - 'FeaturestoreEntityVersionsOperations', - 'JobsOperations', - 'LabelingJobsOperations', - 'ModelContainersOperations', - 'ModelVersionsOperations', - 'OnlineEndpointsOperations', - 'OnlineDeploymentsOperations', - 'SchedulesOperations', - 'Operations', - 'WorkspacesOperations', - 'WorkspaceConnectionsOperations', - 'ManagedNetworkSettingsRuleOperations', - 'PrivateEndpointConnectionsOperations', - 'PrivateLinkResourcesOperations', - 'ManagedNetworkProvisionsOperations', + "UsagesOperations", + "VirtualMachineSizesOperations", + "QuotasOperations", + "ComputeOperations", + "RegistriesOperations", + "WorkspaceFeaturesOperations", + "RegistryCodeContainersOperations", + "RegistryCodeVersionsOperations", + "RegistryComponentContainersOperations", + "RegistryComponentVersionsOperations", + "RegistryDataContainersOperations", + "RegistryDataVersionsOperations", + "RegistryEnvironmentContainersOperations", + "RegistryEnvironmentVersionsOperations", + "RegistryModelContainersOperations", + "RegistryModelVersionsOperations", + "BatchEndpointsOperations", + "BatchDeploymentsOperations", + "CodeContainersOperations", + "CodeVersionsOperations", + "ComponentContainersOperations", + "ComponentVersionsOperations", + "DataContainersOperations", + "DataVersionsOperations", + "DatastoresOperations", + "EnvironmentContainersOperations", + "EnvironmentVersionsOperations", + "FeaturesetContainersOperations", + "FeaturesOperations", + "FeaturesetVersionsOperations", + "FeaturestoreEntityContainersOperations", + "FeaturestoreEntityVersionsOperations", + "JobsOperations", + "LabelingJobsOperations", + "ModelContainersOperations", + "ModelVersionsOperations", + "OnlineEndpointsOperations", + "OnlineDeploymentsOperations", + "SchedulesOperations", + "Operations", + "WorkspacesOperations", + "WorkspaceConnectionsOperations", + "ManagedNetworkSettingsRuleOperations", + "PrivateEndpointConnectionsOperations", + "PrivateLinkResourcesOperations", + "ManagedNetworkProvisionsOperations", ] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_batch_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_batch_deployments_operations.py index 992ddf8ea311..469adc2a7620 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_batch_deployments_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_batch_deployments_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,22 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._batch_deployments_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._batch_deployments_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class BatchDeploymentsOperations: """BatchDeploymentsOperations async operations. @@ -57,7 +80,9 @@ def list( top: Optional[int] = None, skip: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.BatchDeploymentTrackedResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.BatchDeploymentTrackedResourceArmPaginatedResult" + ]: """Lists Batch inference deployments in the workspace. Lists Batch inference deployments in the workspace. @@ -81,16 +106,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.BatchDeploymentTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -100,13 +132,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -124,7 +156,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("BatchDeploymentTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "BatchDeploymentTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -134,24 +169,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -161,15 +200,18 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements deployment_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -177,34 +219,45 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -239,14 +292,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -254,29 +312,37 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def get( @@ -304,15 +370,20 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.BatchDeployment :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -320,32 +391,37 @@ async def get( endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize("BatchDeployment", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore async def _update_initial( self, @@ -356,16 +432,27 @@ async def _update_initial( body: "_models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties", **kwargs: Any ) -> Optional["_models.BatchDeployment"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchDeployment"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.BatchDeployment"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties') + error_map.update(kwargs.pop("error_map", {})) + + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + + _json = self._serialize.body( + body, + "PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties", + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -376,40 +463,53 @@ async def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -450,15 +550,24 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -468,32 +577,38 @@ async def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore async def _create_or_update_initial( self, @@ -504,16 +619,24 @@ async def _create_or_update_initial( body: "_models.BatchDeployment", **kwargs: Any ) -> "_models.BatchDeployment": - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'BatchDeployment') + _json = self._serialize.body(body, "BatchDeployment") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -524,39 +647,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchDeployment', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -596,15 +733,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -614,29 +760,39 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_batch_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_batch_endpoints_operations.py index 1251e0f5e5e7..8b3a1aaf3fa1 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_batch_endpoints_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_batch_endpoints_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,23 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._batch_endpoints_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_keys_request, build_list_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._batch_endpoints_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_keys_request, + build_list_request, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class BatchEndpointsOperations: """BatchEndpointsOperations async operations. @@ -55,7 +79,9 @@ def list( count: Optional[int] = None, skip: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.BatchEndpointTrackedResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.BatchEndpointTrackedResourceArmPaginatedResult" + ]: """Lists Batch inference endpoint in the workspace. Lists Batch inference endpoint in the workspace. @@ -75,16 +101,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.BatchEndpointTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -92,13 +125,13 @@ def prepare_request(next_link=None): api_version=api_version, count=count, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -114,7 +147,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("BatchEndpointTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "BatchEndpointTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -124,24 +160,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -150,49 +190,63 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements endpoint_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -224,43 +278,56 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def get( @@ -285,47 +352,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.BatchEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize("BatchEndpoint", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore async def _update_initial( self, @@ -335,16 +410,26 @@ async def _update_initial( body: "_models.PartialMinimalTrackedResourceWithIdentity", **kwargs: Any ) -> Optional["_models.BatchEndpoint"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchEndpoint"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.BatchEndpoint"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') + _json = self._serialize.body( + body, "PartialMinimalTrackedResourceWithIdentity" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -354,40 +439,53 @@ async def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -425,15 +523,22 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -442,32 +547,38 @@ async def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore async def _create_or_update_initial( self, @@ -477,16 +588,22 @@ async def _create_or_update_initial( body: "_models.BatchEndpoint", **kwargs: Any ) -> "_models.BatchEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'BatchEndpoint') + _json = self._serialize.body(body, "BatchEndpoint") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -496,39 +613,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -565,15 +696,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -582,32 +720,42 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def list_keys( @@ -632,44 +780,54 @@ async def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthKeys"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) + deserialized = self._deserialize("EndpointAuthKeys", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys"} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_code_containers_operations.py index 748396964f63..e03436deee17 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_code_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_code_containers_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._code_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._code_containers_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class CodeContainersOperations: """CodeContainersOperations async operations. @@ -70,29 +88,36 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -107,7 +132,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -117,24 +144,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -159,43 +190,51 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore @distributed_trace_async async def get( @@ -220,47 +259,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize("CodeContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -288,16 +335,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeContainer') + _json = self._serialize.body(body, "CodeContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -307,33 +360,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_code_versions_operations.py index 104f82cc325d..0dc97b9ebb2e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_code_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_code_versions_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,22 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._code_versions_operations import build_create_or_get_start_pending_upload_request, build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._code_versions_operations import ( + build_create_or_get_start_pending_upload_request, + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class CodeVersionsOperations: """CodeVersionsOperations async operations. @@ -86,16 +105,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -107,13 +133,13 @@ def prepare_request(next_link=None): skip=skip, hash=hash, hash_version=hash_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -133,7 +159,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -143,24 +171,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -188,15 +220,18 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -204,28 +239,33 @@ async def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -253,15 +293,18 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -269,32 +312,37 @@ async def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -325,16 +373,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeVersion') + _json = self._serialize.body(body, "CodeVersion") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -345,36 +399,41 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_get_start_pending_upload( @@ -405,16 +464,24 @@ async def create_or_get_start_pending_upload( :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PendingUploadResponseDto"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PendingUploadRequestDto') + _json = self._serialize.body(body, "PendingUploadRequestDto") request = build_create_or_get_start_pending_upload_request( subscription_id=self._config.subscription_id, @@ -425,29 +492,38 @@ async def create_or_get_start_pending_upload( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], + template_url=self.create_or_get_start_pending_upload.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) + deserialized = self._deserialize( + "PendingUploadResponseDto", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/startPendingUpload"} # type: ignore - + create_or_get_start_pending_upload.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/startPendingUpload"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_component_containers_operations.py index 6d005a89e599..6a67faefe3e2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_component_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_component_containers_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._component_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._component_containers_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ComponentContainersOperations: """ComponentContainersOperations async operations. @@ -73,16 +91,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -90,13 +115,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -112,7 +137,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -122,24 +150,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -164,43 +196,51 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore @distributed_trace_async async def get( @@ -225,47 +265,59 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -293,16 +345,24 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentContainer') + _json = self._serialize.body(body, "ComponentContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -312,33 +372,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_component_versions_operations.py index 941d4b5fcaa2..4d9f300acb74 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_component_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_component_versions_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._component_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._component_versions_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ComponentVersionsOperations: """ComponentVersionsOperations async operations. @@ -85,16 +103,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -106,13 +131,13 @@ def prepare_request(next_link=None): skip=skip, list_view_type=list_view_type, stage=stage, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -132,7 +157,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -142,24 +169,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -187,15 +218,18 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -203,28 +237,33 @@ async def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -252,15 +291,20 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -268,32 +312,37 @@ async def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize("ComponentVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -324,16 +373,24 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentVersion') + _json = self._serialize.body(body, "ComponentVersion") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -344,33 +401,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_compute_operations.py index 04583e288bb0..05846bca4c17 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_compute_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_compute_operations.py @@ -6,13 +6,32 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, List, Optional, TypeVar, Union +from typing import ( + Any, + AsyncIterable, + Callable, + Dict, + List, + Optional, + TypeVar, + Union, +) from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +40,29 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._compute_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_keys_request, build_list_nodes_request, build_list_request, build_restart_request_initial, build_start_request_initial, build_stop_request_initial, build_update_custom_services_request, build_update_idle_shutdown_setting_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._compute_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_keys_request, + build_list_nodes_request, + build_list_request, + build_restart_request_initial, + build_start_request_initial, + build_stop_request_initial, + build_update_custom_services_request, + build_update_idle_shutdown_setting_request, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ComputeOperations: """ComputeOperations async operations. @@ -70,29 +109,36 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedComputeResourcesList] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedComputeResourcesList"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PaginatedComputeResourcesList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -107,7 +153,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PaginatedComputeResourcesList", pipeline_response) + deserialized = self._deserialize( + "PaginatedComputeResourcesList", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -117,24 +165,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes"} # type: ignore @distributed_trace_async async def get( @@ -158,47 +210,57 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComputeResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize("ComputeResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore async def _create_or_update_initial( self, @@ -208,16 +270,24 @@ async def _create_or_update_initial( parameters: "_models.ComputeResource", **kwargs: Any ) -> "_models.ComputeResource": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'ComputeResource') + _json = self._serialize.body(parameters, "ComputeResource") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -227,38 +297,47 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if response.status_code == 201: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComputeResource', pipeline_response) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -295,15 +374,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -312,32 +400,38 @@ async def begin_create_or_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore async def _update_initial( self, @@ -347,16 +441,24 @@ async def _update_initial( parameters: "_models.ClusterUpdateParameters", **kwargs: Any ) -> "_models.ComputeResource": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'ClusterUpdateParameters') + _json = self._serialize.body(parameters, "ClusterUpdateParameters") request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -366,31 +468,34 @@ async def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize("ComputeResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -426,15 +531,24 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeResource"] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeResource"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -443,50 +557,61 @@ async def begin_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComputeResource', pipeline_response) + deserialized = self._deserialize( + "ComputeResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, compute_name: str, - underlying_resource_action: Union[str, "_models.UnderlyingResourceAction"], + underlying_resource_action: Union[ + str, "_models.UnderlyingResourceAction" + ], **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -494,33 +619,39 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements compute_name=compute_name, api_version=api_version, underlying_resource_action=underlying_resource_action, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -528,7 +659,9 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements resource_group_name: str, workspace_name: str, compute_name: str, - underlying_resource_action: Union[str, "_models.UnderlyingResourceAction"], + underlying_resource_action: Union[ + str, "_models.UnderlyingResourceAction" + ], **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes specified Machine Learning compute. @@ -555,14 +688,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -570,29 +708,33 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements compute_name=compute_name, underlying_resource_action=underlying_resource_action, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace_async async def update_custom_services( # pylint: disable=inconsistent-return-statements @@ -618,16 +760,22 @@ async def update_custom_services( # pylint: disable=inconsistent-return-stateme :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(custom_services, '[CustomService]') + _json = self._serialize.body(custom_services, "[CustomService]") request = build_update_custom_services_request( subscription_id=self._config.subscription_id, @@ -637,28 +785,33 @@ async def update_custom_services( # pylint: disable=inconsistent-return-stateme api_version=api_version, content_type=content_type, json=_json, - template_url=self.update_custom_services.metadata['url'], + template_url=self.update_custom_services.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - update_custom_services.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/customServices"} # type: ignore - + update_custom_services.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/customServices"} # type: ignore @distributed_trace def list_nodes( @@ -683,29 +836,36 @@ def list_nodes( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.AmlComputeNodesInformation] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlComputeNodesInformation"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.AmlComputeNodesInformation"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_nodes_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self.list_nodes.metadata['url'], + template_url=self.list_nodes.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_nodes_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -720,7 +880,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("AmlComputeNodesInformation", pipeline_response) + deserialized = self._deserialize( + "AmlComputeNodesInformation", pipeline_response + ) list_of_elem = deserialized.nodes if cls: list_of_elem = cls(list_of_elem) @@ -730,24 +892,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_nodes.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes"} # type: ignore + list_nodes.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes"} # type: ignore @distributed_trace_async async def list_keys( @@ -770,47 +936,57 @@ async def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ComputeSecrets :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeSecrets"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComputeSecrets"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComputeSecrets', pipeline_response) + deserialized = self._deserialize("ComputeSecrets", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys"} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys"} # type: ignore async def _start_initial( # pylint: disable=inconsistent-return-statements self, @@ -819,42 +995,48 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements compute_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_start_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self._start_initial.metadata['url'], + template_url=self._start_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _start_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore - + _start_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore @distributed_trace_async async def begin_start( # pylint: disable=inconsistent-return-statements @@ -884,43 +1066,52 @@ async def begin_start( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._start_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_start.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore + begin_start.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore async def _stop_initial( # pylint: disable=inconsistent-return-statements self, @@ -929,42 +1120,48 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements compute_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_stop_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self._stop_initial.metadata['url'], + template_url=self._stop_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _stop_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore - + _stop_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore @distributed_trace_async async def begin_stop( # pylint: disable=inconsistent-return-statements @@ -994,43 +1191,52 @@ async def begin_stop( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._stop_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_stop.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore + begin_stop.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore async def _restart_initial( # pylint: disable=inconsistent-return-statements self, @@ -1039,42 +1245,48 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements compute_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_restart_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - template_url=self._restart_initial.metadata['url'], + template_url=self._restart_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _restart_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore - + _restart_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore @distributed_trace_async async def begin_restart( # pylint: disable=inconsistent-return-statements @@ -1104,43 +1316,52 @@ async def begin_restart( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._restart_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, compute_name=compute_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_restart.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore + begin_restart.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore @distributed_trace_async async def update_idle_shutdown_setting( # pylint: disable=inconsistent-return-statements @@ -1166,16 +1387,22 @@ async def update_idle_shutdown_setting( # pylint: disable=inconsistent-return-s :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'IdleShutdownSetting') + _json = self._serialize.body(parameters, "IdleShutdownSetting") request = build_update_idle_shutdown_setting_request( subscription_id=self._config.subscription_id, @@ -1185,25 +1412,30 @@ async def update_idle_shutdown_setting( # pylint: disable=inconsistent-return-s api_version=api_version, content_type=content_type, json=_json, - template_url=self.update_idle_shutdown_setting.metadata['url'], + template_url=self.update_idle_shutdown_setting.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - update_idle_shutdown_setting.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateIdleShutdownSetting"} # type: ignore - + update_idle_shutdown_setting.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateIdleShutdownSetting"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_data_containers_operations.py index d1ba46b1d195..09a65e56f422 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_data_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_data_containers_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._data_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._data_containers_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class DataContainersOperations: """DataContainersOperations async operations. @@ -73,16 +91,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -90,13 +115,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -112,7 +137,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -122,24 +149,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -164,43 +195,51 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore @distributed_trace_async async def get( @@ -225,47 +264,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize("DataContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -293,16 +340,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DataContainer') + _json = self._serialize.body(body, "DataContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -312,33 +365,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_data_versions_operations.py index 692a54b29713..ca49842719d8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_data_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_data_versions_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._data_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._data_versions_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class DataVersionsOperations: """DataVersionsOperations async operations. @@ -92,16 +110,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -114,13 +139,13 @@ def prepare_request(next_link=None): tags=tags, list_view_type=list_view_type, stage=stage, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -141,7 +166,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataVersionBaseResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -151,24 +178,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -196,15 +227,18 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -212,28 +246,33 @@ async def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -261,15 +300,20 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -277,32 +321,37 @@ async def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize("DataVersionBase", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -333,16 +382,24 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DataVersionBase') + _json = self._serialize.body(body, "DataVersionBase") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -353,33 +410,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_datastores_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_datastores_operations.py index d3f2fcf1aef8..cc6f85001854 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_datastores_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_datastores_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, List, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,22 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._datastores_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request, build_list_secrets_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._datastores_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, + build_list_secrets_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class DatastoresOperations: """DatastoresOperations async operations. @@ -88,16 +107,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DatastoreResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DatastoreResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -110,13 +136,13 @@ def prepare_request(next_link=None): search_text=search_text, order_by=order_by, order_by_asc=order_by_asc, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -137,7 +163,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("DatastoreResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DatastoreResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -147,24 +175,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -189,43 +221,51 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace_async async def get( @@ -250,47 +290,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.Datastore :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Datastore"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Datastore"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Datastore', pipeline_response) + deserialized = self._deserialize("Datastore", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -321,16 +369,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.Datastore :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Datastore"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Datastore"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'Datastore') + _json = self._serialize.body(body, "Datastore") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -341,36 +395,41 @@ async def create_or_update( content_type=content_type, json=_json, skip_validation=skip_validation, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('Datastore', pipeline_response) + deserialized = self._deserialize("Datastore", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('Datastore', pipeline_response) + deserialized = self._deserialize("Datastore", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace_async async def list_secrets( @@ -395,44 +454,54 @@ async def list_secrets( :rtype: ~azure.mgmt.machinelearningservices.models.DatastoreSecrets :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DatastoreSecrets"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DatastoreSecrets"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_list_secrets_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.list_secrets.metadata['url'], + template_url=self.list_secrets.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DatastoreSecrets', pipeline_response) + deserialized = self._deserialize("DatastoreSecrets", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_secrets.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets"} # type: ignore - + list_secrets.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_environment_containers_operations.py index 879bd838b489..bcc259cf3910 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_environment_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_environment_containers_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._environment_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._environment_containers_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class EnvironmentContainersOperations: """EnvironmentContainersOperations async operations. @@ -53,7 +71,9 @@ def list( skip: Optional[str] = None, list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, **kwargs: Any - ) -> AsyncIterable["_models.EnvironmentContainerResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.EnvironmentContainerResourceArmPaginatedResult" + ]: """List environment containers. List environment containers. @@ -73,16 +93,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -90,13 +117,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -112,7 +139,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -122,24 +152,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -164,43 +198,51 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore @distributed_trace_async async def get( @@ -225,47 +267,59 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -293,16 +347,24 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentContainer') + _json = self._serialize.body(body, "EnvironmentContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -312,33 +374,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_environment_versions_operations.py index ac0a16029ed5..502693224b25 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_environment_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_environment_versions_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._environment_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._environment_versions_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class EnvironmentVersionsOperations: """EnvironmentVersionsOperations async operations. @@ -86,16 +104,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -107,13 +132,13 @@ def prepare_request(next_link=None): skip=skip, list_view_type=list_view_type, stage=stage, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -133,7 +158,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersionResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -143,24 +171,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -188,15 +220,18 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -204,28 +239,33 @@ async def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -253,15 +293,20 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -269,32 +314,39 @@ async def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -325,16 +377,24 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentVersion') + _json = self._serialize.body(body, "EnvironmentVersion") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -345,33 +405,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_features_operations.py index 1f0878f788ee..5403dbdd0da2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_features_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_features_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,19 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._features_operations import build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._features_operations import ( + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class FeaturesOperations: """FeaturesOperations async operations. @@ -86,16 +102,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeatureResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeatureResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeatureResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -107,13 +130,13 @@ def prepare_request(next_link=None): tags=tags, feature_name=feature_name, description=description, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -133,7 +156,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("FeatureResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "FeatureResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -143,24 +168,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features"} # type: ignore @distributed_trace_async async def get( @@ -191,15 +220,18 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.Feature :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Feature"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Feature"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -208,29 +240,34 @@ async def get( featureset_version=featureset_version, feature_name=feature_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Feature', pipeline_response) + deserialized = self._deserialize("Feature", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features/{featureName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features/{featureName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_featureset_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_featureset_containers_operations.py index 89c35dad8d39..a6289e94a662 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_featureset_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_featureset_containers_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._featureset_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_entity_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._featureset_containers_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_entity_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class FeaturesetContainersOperations: """FeaturesetContainersOperations async operations. @@ -60,7 +82,9 @@ def list( description: Optional[str] = None, created_by: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.FeaturesetContainerResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.FeaturesetContainerResourceArmPaginatedResult" + ]: """List featurestore entity containers. List featurestore entity containers. @@ -92,16 +116,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeaturesetContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -114,13 +145,13 @@ def prepare_request(next_link=None): name=name, description=description, created_by=created_by, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -141,7 +172,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturesetContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "FeaturesetContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -151,24 +185,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -177,49 +215,63 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -251,43 +303,56 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore @distributed_trace_async async def get_entity( @@ -312,47 +377,59 @@ async def get_entity( :rtype: ~azure.mgmt.machinelearningservices.models.FeaturesetContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_get_entity_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get_entity.metadata['url'], + template_url=self.get_entity.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) + deserialized = self._deserialize( + "FeaturesetContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_entity.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - + get_entity.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore async def _create_or_update_initial( self, @@ -362,16 +439,24 @@ async def _create_or_update_initial( body: "_models.FeaturesetContainer", **kwargs: Any ) -> "_models.FeaturesetContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'FeaturesetContainer') + _json = self._serialize.body(body, "FeaturesetContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -381,39 +466,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) + deserialized = self._deserialize( + "FeaturesetContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "FeaturesetContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -450,15 +549,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetContainer"] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -467,29 +575,39 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('FeaturesetContainer', pipeline_response) + deserialized = self._deserialize( + "FeaturesetContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_featureset_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_featureset_versions_operations.py index cc21ac7d6473..a580878b792c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_featureset_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_featureset_versions_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,23 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._featureset_versions_operations import build_backfill_request_initial, build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_materialization_jobs_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._featureset_versions_operations import ( + build_backfill_request_initial, + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_materialization_jobs_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class FeaturesetVersionsOperations: """FeaturesetVersionsOperations async operations. @@ -101,16 +125,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeaturesetVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -126,13 +157,13 @@ def prepare_request(next_link=None): description=description, created_by=created_by, stage=stage, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -156,7 +187,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturesetVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "FeaturesetVersionResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -166,24 +200,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -193,15 +231,18 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements version: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -209,34 +250,45 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -271,14 +323,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -286,29 +343,37 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -336,15 +401,20 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.FeaturesetVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -352,32 +422,39 @@ async def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) + deserialized = self._deserialize( + "FeaturesetVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore async def _create_or_update_initial( self, @@ -388,16 +465,24 @@ async def _create_or_update_initial( body: "_models.FeaturesetVersion", **kwargs: Any ) -> "_models.FeaturesetVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'FeaturesetVersion') + _json = self._serialize.body(body, "FeaturesetVersion") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -408,39 +493,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) + deserialized = self._deserialize( + "FeaturesetVersion", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "FeaturesetVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -480,15 +579,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetVersion"] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetVersion"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -498,32 +606,42 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('FeaturesetVersion', pipeline_response) + deserialized = self._deserialize( + "FeaturesetVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}"} # type: ignore async def _backfill_initial( self, @@ -534,16 +652,24 @@ async def _backfill_initial( body: "_models.FeaturesetVersionBackfillRequest", **kwargs: Any ) -> Optional["_models.FeaturesetJob"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.FeaturesetJob"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.FeaturesetJob"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'FeaturesetVersionBackfillRequest') + _json = self._serialize.body(body, "FeaturesetVersionBackfillRequest") request = build_backfill_request_initial( subscription_id=self._config.subscription_id, @@ -554,39 +680,47 @@ async def _backfill_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._backfill_initial.metadata['url'], + template_url=self._backfill_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('FeaturesetJob', pipeline_response) + deserialized = self._deserialize( + "FeaturesetJob", pipeline_response + ) if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _backfill_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill"} # type: ignore - + _backfill_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill"} # type: ignore @distributed_trace_async async def begin_backfill( @@ -626,15 +760,22 @@ async def begin_backfill( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.FeaturesetJob] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetJob"] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.FeaturesetJob"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._backfill_initial( resource_group_name=resource_group_name, @@ -644,32 +785,42 @@ async def begin_backfill( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('FeaturesetJob', pipeline_response) + deserialized = self._deserialize( + "FeaturesetJob", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_backfill.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill"} # type: ignore + begin_backfill.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill"} # type: ignore @distributed_trace def list_materialization_jobs( @@ -712,16 +863,23 @@ def list_materialization_jobs( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeaturesetJobArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturesetJobArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturesetJobArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_materialization_jobs_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -733,13 +891,15 @@ def prepare_request(next_link=None): filters=filters, feature_window_start=feature_window_start, feature_window_end=feature_window_end, - template_url=self.list_materialization_jobs.metadata['url'], + template_url=self.list_materialization_jobs.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_materialization_jobs_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -759,7 +919,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturesetJobArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "FeaturesetJobArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -769,21 +931,25 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_materialization_jobs.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/listMaterializationJobs"} # type: ignore + list_materialization_jobs.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/listMaterializationJobs"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_featurestore_entity_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_featurestore_entity_containers_operations.py index d90c78dd666f..5e562be17cf3 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_featurestore_entity_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_featurestore_entity_containers_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._featurestore_entity_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_entity_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._featurestore_entity_containers_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_entity_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class FeaturestoreEntityContainersOperations: """FeaturestoreEntityContainersOperations async operations. @@ -60,7 +82,9 @@ def list( description: Optional[str] = None, created_by: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.FeaturestoreEntityContainerResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.FeaturestoreEntityContainerResourceArmPaginatedResult" + ]: """List featurestore entity containers. List featurestore entity containers. @@ -92,16 +116,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturestoreEntityContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -114,13 +145,13 @@ def prepare_request(next_link=None): name=name, description=description, created_by=created_by, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -141,7 +172,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturestoreEntityContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "FeaturestoreEntityContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -151,24 +185,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -177,49 +215,63 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -251,43 +303,56 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore @distributed_trace_async async def get_entity( @@ -312,47 +377,59 @@ async def get_entity( :rtype: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturestoreEntityContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_get_entity_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get_entity.metadata['url'], + template_url=self.get_entity.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) + deserialized = self._deserialize( + "FeaturestoreEntityContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_entity.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - + get_entity.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore async def _create_or_update_initial( self, @@ -362,16 +439,24 @@ async def _create_or_update_initial( body: "_models.FeaturestoreEntityContainer", **kwargs: Any ) -> "_models.FeaturestoreEntityContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturestoreEntityContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'FeaturestoreEntityContainer') + _json = self._serialize.body(body, "FeaturestoreEntityContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -381,39 +466,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) + deserialized = self._deserialize( + "FeaturestoreEntityContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "FeaturestoreEntityContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -450,15 +549,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityContainer"] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturestoreEntityContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -467,29 +575,39 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('FeaturestoreEntityContainer', pipeline_response) + deserialized = self._deserialize( + "FeaturestoreEntityContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_featurestore_entity_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_featurestore_entity_versions_operations.py index cd5eaeb47603..df63e3fca28d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_featurestore_entity_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_featurestore_entity_versions_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._featurestore_entity_versions_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._featurestore_entity_versions_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class FeaturestoreEntityVersionsOperations: """FeaturestoreEntityVersionsOperations async operations. @@ -63,7 +85,9 @@ def list( created_by: Optional[str] = None, stage: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.FeaturestoreEntityVersionResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.FeaturestoreEntityVersionResourceArmPaginatedResult" + ]: """List versions. List versions. @@ -101,16 +125,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturestoreEntityVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -126,13 +157,13 @@ def prepare_request(next_link=None): description=description, created_by=created_by, stage=stage, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -156,7 +187,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("FeaturestoreEntityVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "FeaturestoreEntityVersionResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -166,24 +200,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -193,15 +231,18 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements version: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -209,34 +250,45 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -271,14 +323,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -286,29 +343,37 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -336,15 +401,20 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturestoreEntityVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -352,32 +422,39 @@ async def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) + deserialized = self._deserialize( + "FeaturestoreEntityVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore async def _create_or_update_initial( self, @@ -388,16 +465,24 @@ async def _create_or_update_initial( body: "_models.FeaturestoreEntityVersion", **kwargs: Any ) -> "_models.FeaturestoreEntityVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturestoreEntityVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'FeaturestoreEntityVersion') + _json = self._serialize.body(body, "FeaturestoreEntityVersion") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -408,39 +493,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) + deserialized = self._deserialize( + "FeaturestoreEntityVersion", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "FeaturestoreEntityVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -480,15 +579,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.FeaturestoreEntityVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FeaturestoreEntityVersion"] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.FeaturestoreEntityVersion"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -498,29 +606,39 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('FeaturestoreEntityVersion', pipeline_response) + deserialized = self._deserialize( + "FeaturestoreEntityVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_jobs_operations.py index 6ad56289a464..9bd045d8e39f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_jobs_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_jobs_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,23 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._jobs_operations import build_cancel_request_initial, build_create_or_update_request, build_delete_request_initial, build_get_request, build_list_request, build_update_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._jobs_operations import ( + build_cancel_request_initial, + build_create_or_update_request, + build_delete_request_initial, + build_get_request, + build_list_request, + build_update_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class JobsOperations: """JobsOperations async operations. @@ -90,16 +114,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.JobBaseResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.JobBaseResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -112,13 +143,13 @@ def prepare_request(next_link=None): asset_name=asset_name, scheduled=scheduled, schedule_id=schedule_id, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -139,7 +170,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("JobBaseResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "JobBaseResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -149,24 +182,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -175,49 +212,63 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements id: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -249,43 +300,56 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace_async async def get( @@ -310,47 +374,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.JobBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.JobBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('JobBase', pipeline_response) + deserialized = self._deserialize("JobBase", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace_async async def update( @@ -378,16 +450,22 @@ async def update( :rtype: ~azure.mgmt.machinelearningservices.models.JobBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.JobBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialJobBasePartialResource') + _json = self._serialize.body(body, "PartialJobBasePartialResource") request = build_update_request( subscription_id=self._config.subscription_id, @@ -397,32 +475,37 @@ async def update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.update.metadata['url'], + template_url=self.update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('JobBase', pipeline_response) + deserialized = self._deserialize("JobBase", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - + update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -450,16 +533,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.JobBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobBase"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.JobBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'JobBase') + _json = self._serialize.body(body, "JobBase") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -469,36 +558,41 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('JobBase', pipeline_response) + deserialized = self._deserialize("JobBase", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('JobBase', pipeline_response) + deserialized = self._deserialize("JobBase", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore async def _cancel_initial( # pylint: disable=inconsistent-return-statements self, @@ -507,48 +601,57 @@ async def _cancel_initial( # pylint: disable=inconsistent-return-statements id: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_cancel_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self._cancel_initial.metadata['url'], + template_url=self._cancel_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _cancel_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore - + _cancel_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore @distributed_trace_async async def begin_cancel( # pylint: disable=inconsistent-return-statements @@ -580,40 +683,53 @@ async def begin_cancel( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._cancel_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_cancel.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore + begin_cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_labeling_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_labeling_jobs_operations.py index 301ded2e995d..370c26f4ae4e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_labeling_jobs_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_labeling_jobs_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,24 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._labeling_jobs_operations import build_create_or_update_request_initial, build_delete_request, build_export_labels_request_initial, build_get_request, build_list_request, build_pause_request, build_resume_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._labeling_jobs_operations import ( + build_create_or_update_request_initial, + build_delete_request, + build_export_labels_request_initial, + build_get_request, + build_list_request, + build_pause_request, + build_resume_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class LabelingJobsOperations: """LabelingJobsOperations async operations. @@ -75,16 +100,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.LabelingJobResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJobResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.LabelingJobResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -92,13 +124,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, top=top, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -114,7 +146,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("LabelingJobResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "LabelingJobResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -124,24 +158,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -166,43 +204,51 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore @distributed_trace_async async def get( @@ -235,15 +281,18 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.LabelingJob :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.LabelingJob"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -252,32 +301,37 @@ async def get( api_version=api_version, include_job_instructions=include_job_instructions, include_label_categories=include_label_categories, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('LabelingJob', pipeline_response) + deserialized = self._deserialize("LabelingJob", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore async def _create_or_update_initial( self, @@ -287,16 +341,22 @@ async def _create_or_update_initial( body: "_models.LabelingJob", **kwargs: Any ) -> "_models.LabelingJob": - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.LabelingJob"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'LabelingJob') + _json = self._serialize.body(body, "LabelingJob") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -306,39 +366,49 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('LabelingJob', pipeline_response) + deserialized = self._deserialize("LabelingJob", pipeline_response) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('LabelingJob', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("LabelingJob", pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -375,15 +445,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.LabelingJob] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.LabelingJob"] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.LabelingJob"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -392,32 +469,40 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('LabelingJob', pipeline_response) + deserialized = self._deserialize("LabelingJob", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore async def _export_labels_initial( self, @@ -427,16 +512,24 @@ async def _export_labels_initial( body: "_models.ExportSummary", **kwargs: Any ) -> Optional["_models.ExportSummary"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExportSummary"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.ExportSummary"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ExportSummary') + _json = self._serialize.body(body, "ExportSummary") request = build_export_labels_request_initial( subscription_id=self._config.subscription_id, @@ -446,39 +539,47 @@ async def _export_labels_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._export_labels_initial.metadata['url'], + template_url=self._export_labels_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ExportSummary', pipeline_response) + deserialized = self._deserialize( + "ExportSummary", pipeline_response + ) if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _export_labels_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore - + _export_labels_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore @distributed_trace_async async def begin_export_labels( @@ -515,15 +616,22 @@ async def begin_export_labels( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ExportSummary] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExportSummary"] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ExportSummary"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._export_labels_initial( resource_group_name=resource_group_name, @@ -532,32 +640,42 @@ async def begin_export_labels( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ExportSummary', pipeline_response) + deserialized = self._deserialize( + "ExportSummary", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_export_labels.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore + begin_export_labels.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore @distributed_trace_async async def pause( # pylint: disable=inconsistent-return-statements @@ -582,43 +700,51 @@ async def pause( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_pause_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self.pause.metadata['url'], + template_url=self.pause.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - pause.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause"} # type: ignore - + pause.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause"} # type: ignore async def _resume_initial( # pylint: disable=inconsistent-return-statements self, @@ -627,48 +753,57 @@ async def _resume_initial( # pylint: disable=inconsistent-return-statements id: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_resume_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - template_url=self._resume_initial.metadata['url'], + template_url=self._resume_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _resume_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore - + _resume_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore @distributed_trace_async async def begin_resume( # pylint: disable=inconsistent-return-statements @@ -700,40 +835,53 @@ async def begin_resume( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._resume_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, id=id, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_resume.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore + begin_resume.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_managed_network_provisions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_managed_network_provisions_operations.py index 7c72fc0de532..a1b59d88cbc2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_managed_network_provisions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_managed_network_provisions_operations.py @@ -8,10 +8,20 @@ # -------------------------------------------------------------------------- from typing import Any, Callable, Dict, Optional, TypeVar, Union -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat @@ -19,9 +29,18 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._managed_network_provisions_operations import build_provision_managed_network_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._managed_network_provisions_operations import ( + build_provision_managed_network_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ManagedNetworkProvisionsOperations: """ManagedNetworkProvisionsOperations async operations. @@ -52,17 +71,27 @@ async def _provision_managed_network_initial( body: Optional["_models.ManagedNetworkProvisionOptions"] = None, **kwargs: Any ) -> Optional["_models.ManagedNetworkProvisionStatus"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ManagedNetworkProvisionStatus"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.ManagedNetworkProvisionStatus"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'ManagedNetworkProvisionOptions') + _json = self._serialize.body( + body, "ManagedNetworkProvisionOptions" + ) else: _json = None @@ -73,39 +102,49 @@ async def _provision_managed_network_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._provision_managed_network_initial.metadata['url'], + template_url=self._provision_managed_network_initial.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ManagedNetworkProvisionStatus', pipeline_response) + deserialized = self._deserialize( + "ManagedNetworkProvisionStatus", pipeline_response + ) if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _provision_managed_network_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork"} # type: ignore - + _provision_managed_network_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork"} # type: ignore @distributed_trace_async async def begin_provision_managed_network( @@ -139,15 +178,24 @@ async def begin_provision_managed_network( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ManagedNetworkProvisionStatus] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedNetworkProvisionStatus"] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ManagedNetworkProvisionStatus"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._provision_managed_network_initial( resource_group_name=resource_group_name, @@ -155,29 +203,39 @@ async def begin_provision_managed_network( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ManagedNetworkProvisionStatus', pipeline_response) + deserialized = self._deserialize( + "ManagedNetworkProvisionStatus", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_provision_managed_network.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork"} # type: ignore + begin_provision_managed_network.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_managed_network_settings_rule_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_managed_network_settings_rule_operations.py index 7ee222e579cb..ae52afce5567 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_managed_network_settings_rule_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_managed_network_settings_rule_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._managed_network_settings_rule_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._managed_network_settings_rule_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ManagedNetworkSettingsRuleOperations: """ManagedNetworkSettingsRuleOperations async operations. @@ -49,10 +71,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> AsyncIterable["_models.OutboundRuleListResult"]: """Lists the managed network outbound rules for a machine learning workspace. @@ -69,28 +88,35 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OutboundRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OutboundRuleListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -104,7 +130,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("OutboundRuleListResult", pipeline_response) + deserialized = self._deserialize( + "OutboundRuleListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -114,24 +142,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -140,47 +172,54 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements rule_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, rule_name=rule_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -212,43 +251,52 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, rule_name=rule_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore @distributed_trace_async async def get( @@ -273,47 +321,59 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleBasicResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OutboundRuleBasicResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, rule_name=rule_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) + deserialized = self._deserialize( + "OutboundRuleBasicResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore async def _create_or_update_initial( self, @@ -323,16 +383,24 @@ async def _create_or_update_initial( body: "_models.OutboundRuleBasicResource", **kwargs: Any ) -> Optional["_models.OutboundRuleBasicResource"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OutboundRuleBasicResource"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.OutboundRuleBasicResource"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'OutboundRuleBasicResource') + _json = self._serialize.body(body, "OutboundRuleBasicResource") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -342,39 +410,47 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) + deserialized = self._deserialize( + "OutboundRuleBasicResource", pipeline_response + ) if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -412,15 +488,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OutboundRuleBasicResource] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRuleBasicResource"] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OutboundRuleBasicResource"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -429,29 +514,39 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OutboundRuleBasicResource', pipeline_response) + deserialized = self._deserialize( + "OutboundRuleBasicResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_model_containers_operations.py index c5edc972fa3c..96efb049292f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_model_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_model_containers_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._model_containers_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._model_containers_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ModelContainersOperations: """ModelContainersOperations async operations. @@ -76,16 +94,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -94,13 +119,13 @@ def prepare_request(next_link=None): skip=skip, count=count, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -117,7 +142,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -127,24 +154,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -169,43 +200,51 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore @distributed_trace_async async def get( @@ -230,47 +269,57 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize("ModelContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -298,16 +347,24 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelContainer') + _json = self._serialize.body(body, "ModelContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -317,33 +374,42 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_model_versions_operations.py index 7692dc6ab0c6..bdf453f8d258 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_model_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_model_versions_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,22 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._model_versions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request, build_package_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._model_versions_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, + build_package_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class ModelVersionsOperations: """ModelVersionsOperations async operations. @@ -107,16 +130,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -134,13 +164,13 @@ def prepare_request(next_link=None): feed=feed, list_view_type=list_view_type, stage=stage, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -166,7 +196,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -176,24 +208,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -221,15 +257,18 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -237,28 +276,33 @@ async def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -286,15 +330,18 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -302,32 +349,37 @@ async def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -358,16 +410,22 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelVersion') + _json = self._serialize.body(body, "ModelVersion") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -378,36 +436,41 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore async def _package_initial( self, @@ -418,16 +481,24 @@ async def _package_initial( body: "_models.PackageRequest", **kwargs: Any ) -> Optional["_models.PackageResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PackageResponse"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.PackageResponse"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PackageRequest') + _json = self._serialize.body(body, "PackageRequest") request = build_package_request_initial( subscription_id=self._config.subscription_id, @@ -438,39 +509,47 @@ async def _package_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._package_initial.metadata['url'], + template_url=self._package_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('PackageResponse', pipeline_response) + deserialized = self._deserialize( + "PackageResponse", pipeline_response + ) if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _package_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package"} # type: ignore - + _package_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package"} # type: ignore @distributed_trace_async async def begin_package( @@ -510,15 +589,24 @@ async def begin_package( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.PackageResponse] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.PackageResponse"] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PackageResponse"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._package_initial( resource_group_name=resource_group_name, @@ -528,29 +616,39 @@ async def begin_package( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('PackageResponse', pipeline_response) + deserialized = self._deserialize( + "PackageResponse", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_package.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package"} # type: ignore + begin_package.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_online_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_online_deployments_operations.py index 914c2ceb4e92..1caa4f0b056b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_online_deployments_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_online_deployments_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,24 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._online_deployments_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_logs_request, build_get_request, build_list_request, build_list_skus_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._online_deployments_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_logs_request, + build_get_request, + build_list_request, + build_list_skus_request, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class OnlineDeploymentsOperations: """OnlineDeploymentsOperations async operations. @@ -57,7 +82,9 @@ def list( top: Optional[int] = None, skip: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.OnlineDeploymentTrackedResourceArmPaginatedResult" + ]: """List Inference Endpoint Deployments. List Inference Endpoint Deployments. @@ -81,16 +108,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OnlineDeploymentTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeploymentTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -100,13 +134,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -124,7 +158,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineDeploymentTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "OnlineDeploymentTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -134,24 +171,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -161,15 +202,18 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements deployment_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -177,34 +221,45 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -239,14 +294,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -254,29 +314,37 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def get( @@ -304,15 +372,20 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.OnlineDeployment :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -320,32 +393,37 @@ async def get( endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize("OnlineDeployment", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore async def _update_initial( self, @@ -356,16 +434,26 @@ async def _update_initial( body: "_models.PartialMinimalTrackedResourceWithSku", **kwargs: Any ) -> Optional["_models.OnlineDeployment"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineDeployment"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.OnlineDeployment"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithSku') + _json = self._serialize.body( + body, "PartialMinimalTrackedResourceWithSku" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -376,40 +464,53 @@ async def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -449,15 +550,24 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -467,32 +577,38 @@ async def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore async def _create_or_update_initial( self, @@ -503,16 +619,24 @@ async def _create_or_update_initial( body: "_models.OnlineDeployment", **kwargs: Any ) -> "_models.OnlineDeployment": - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'OnlineDeployment') + _json = self._serialize.body(body, "OnlineDeployment") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -523,39 +647,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -595,15 +733,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineDeployment"] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineDeployment"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -613,32 +760,42 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineDeployment', pipeline_response) + deserialized = self._deserialize( + "OnlineDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def get_logs( @@ -669,16 +826,24 @@ async def get_logs( :rtype: ~azure.mgmt.machinelearningservices.models.DeploymentLogs :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentLogs"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DeploymentLogs"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DeploymentLogsRequest') + _json = self._serialize.body(body, "DeploymentLogsRequest") request = build_get_logs_request( subscription_id=self._config.subscription_id, @@ -689,32 +854,37 @@ async def get_logs( api_version=api_version, content_type=content_type, json=_json, - template_url=self.get_logs.metadata['url'], + template_url=self.get_logs.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DeploymentLogs', pipeline_response) + deserialized = self._deserialize("DeploymentLogs", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_logs.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs"} # type: ignore - + get_logs.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs"} # type: ignore @distributed_trace def list_skus( @@ -750,16 +920,23 @@ def list_skus( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.SkuResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.SkuResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_skus_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -769,13 +946,13 @@ def prepare_request(next_link=None): api_version=api_version, count=count, skip=skip, - template_url=self.list_skus.metadata['url'], + template_url=self.list_skus.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_skus_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -793,7 +970,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("SkuResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "SkuResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -803,21 +982,25 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_skus.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus"} # type: ignore + list_skus.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_online_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_online_endpoints_operations.py index 62a0df1d2177..0092a4f61761 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_online_endpoints_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_online_endpoints_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,25 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._online_endpoints_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_get_token_request, build_list_keys_request, build_list_request, build_regenerate_keys_request_initial, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._online_endpoints_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_get_token_request, + build_list_keys_request, + build_list_request, + build_regenerate_keys_request_initial, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class OnlineEndpointsOperations: """OnlineEndpointsOperations async operations. @@ -54,13 +80,17 @@ def list( workspace_name: str, name: Optional[str] = None, count: Optional[int] = None, - compute_type: Optional[Union[str, "_models.EndpointComputeType"]] = None, + compute_type: Optional[ + Union[str, "_models.EndpointComputeType"] + ] = None, skip: Optional[str] = None, tags: Optional[str] = None, properties: Optional[str] = None, order_by: Optional[Union[str, "_models.OrderString"]] = None, **kwargs: Any - ) -> AsyncIterable["_models.OnlineEndpointTrackedResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.OnlineEndpointTrackedResourceArmPaginatedResult" + ]: """List Online Endpoints. List Online Endpoints. @@ -93,16 +123,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.OnlineEndpointTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpointTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -115,13 +152,13 @@ def prepare_request(next_link=None): tags=tags, properties=properties, order_by=order_by, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -142,7 +179,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("OnlineEndpointTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "OnlineEndpointTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -152,24 +192,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -178,49 +222,63 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements endpoint_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -252,43 +310,56 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def get( @@ -313,47 +384,57 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.OnlineEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize("OnlineEndpoint", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore async def _update_initial( self, @@ -363,16 +444,26 @@ async def _update_initial( body: "_models.PartialMinimalTrackedResourceWithIdentity", **kwargs: Any ) -> Optional["_models.OnlineEndpoint"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OnlineEndpoint"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.OnlineEndpoint"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') + _json = self._serialize.body( + body, "PartialMinimalTrackedResourceWithIdentity" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -382,40 +473,53 @@ async def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -453,15 +557,24 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -470,32 +583,38 @@ async def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore async def _create_or_update_initial( self, @@ -505,16 +624,24 @@ async def _create_or_update_initial( body: "_models.OnlineEndpoint", **kwargs: Any ) -> "_models.OnlineEndpoint": - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'OnlineEndpoint') + _json = self._serialize.body(body, "OnlineEndpoint") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -524,39 +651,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -593,15 +734,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.OnlineEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OnlineEndpoint"] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.OnlineEndpoint"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -610,32 +760,42 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('OnlineEndpoint', pipeline_response) + deserialized = self._deserialize( + "OnlineEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def list_keys( @@ -660,47 +820,57 @@ async def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthKeys"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) + deserialized = self._deserialize("EndpointAuthKeys", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys"} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys"} # type: ignore async def _regenerate_keys_initial( # pylint: disable=inconsistent-return-statements self, @@ -710,16 +880,22 @@ async def _regenerate_keys_initial( # pylint: disable=inconsistent-return-state body: "_models.RegenerateEndpointKeysRequest", **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'RegenerateEndpointKeysRequest') + _json = self._serialize.body(body, "RegenerateEndpointKeysRequest") request = build_regenerate_keys_request_initial( subscription_id=self._config.subscription_id, @@ -729,33 +905,39 @@ async def _regenerate_keys_initial( # pylint: disable=inconsistent-return-state api_version=api_version, content_type=content_type, json=_json, - template_url=self._regenerate_keys_initial.metadata['url'], + template_url=self._regenerate_keys_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _regenerate_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore - + _regenerate_keys_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore @distributed_trace_async async def begin_regenerate_keys( # pylint: disable=inconsistent-return-statements @@ -790,15 +972,22 @@ async def begin_regenerate_keys( # pylint: disable=inconsistent-return-statemen :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._regenerate_keys_initial( resource_group_name=resource_group_name, @@ -807,29 +996,37 @@ async def begin_regenerate_keys( # pylint: disable=inconsistent-return-statemen body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_regenerate_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore + begin_regenerate_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore @distributed_trace_async async def get_token( @@ -854,44 +1051,56 @@ async def get_token( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthToken :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthToken"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthToken"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_get_token_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.get_token.metadata['url'], + template_url=self.get_token.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EndpointAuthToken', pipeline_response) + deserialized = self._deserialize( + "EndpointAuthToken", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token"} # type: ignore - + get_token.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_operations.py index 2229c95879ee..272994b1af39 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,8 +25,15 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class Operations: """Operations async operations. @@ -46,8 +59,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list( - self, - **kwargs: Any + self, **kwargs: Any ) -> AsyncIterable["_models.AmlOperationListResult"]: """Lists all of the available Azure Machine Learning Workspaces REST API operations. @@ -60,25 +72,32 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.AmlOperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.AmlOperationListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.AmlOperationListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( api_version=api_version, template_url=next_link, @@ -89,7 +108,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("AmlOperationListResult", pipeline_response) + deserialized = self._deserialize( + "AmlOperationListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -99,21 +120,25 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/providers/Microsoft.MachineLearningServices/operations"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.MachineLearningServices/operations"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_private_endpoint_connections_operations.py index a82bb1905c66..30b8106fccda 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_private_endpoint_connections_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._private_endpoint_connections_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._private_endpoint_connections_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class PrivateEndpointConnectionsOperations: """PrivateEndpointConnectionsOperations async operations. @@ -47,10 +65,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> AsyncIterable["_models.PrivateEndpointConnectionListResult"]: """Called by end-users to get all PE connections. @@ -67,28 +82,35 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnectionListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -102,7 +124,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) + deserialized = self._deserialize( + "PrivateEndpointConnectionListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -112,24 +136,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -154,43 +182,51 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, private_endpoint_connection_name=private_endpoint_connection_name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace_async async def get( @@ -215,47 +251,59 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, private_endpoint_connection_name=private_endpoint_connection_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + deserialized = self._deserialize( + "PrivateEndpointConnection", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace_async async def create_or_update( @@ -285,16 +333,24 @@ async def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PrivateEndpointConnection') + _json = self._serialize.body(body, "PrivateEndpointConnection") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -304,29 +360,36 @@ async def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + deserialized = self._deserialize( + "PrivateEndpointConnection", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_private_link_resources_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_private_link_resources_operations.py index 0e83a068f5db..61678fc4c440 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_private_link_resources_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_private_link_resources_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,8 +25,15 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class PrivateLinkResourcesOperations: """PrivateLinkResourcesOperations async operations. @@ -46,10 +59,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> AsyncIterable["_models.PrivateLinkResourceListResult"]: """Called by Client (Portal, CLI, etc) to get available "private link resources" for the workspace. @@ -78,28 +88,35 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PrivateLinkResourceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PrivateLinkResourceListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -113,7 +130,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateLinkResourceListResult", pipeline_response) + deserialized = self._deserialize( + "PrivateLinkResourceListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -123,21 +142,25 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_quotas_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_quotas_operations.py index 645689b38f53..8fe2c2e3992d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_quotas_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_quotas_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,19 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._quotas_operations import build_list_request, build_update_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._quotas_operations import ( + build_list_request, + build_update_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class QuotasOperations: """QuotasOperations async operations. @@ -63,16 +79,24 @@ async def update( :rtype: ~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotasResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.UpdateWorkspaceQuotasResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(parameters, 'QuotaUpdateParameters') + _json = self._serialize.body(parameters, "QuotaUpdateParameters") request = build_update_request( location=location, @@ -80,38 +104,43 @@ async def update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.update.metadata['url'], + template_url=self.update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('UpdateWorkspaceQuotasResult', pipeline_response) + deserialized = self._deserialize( + "UpdateWorkspaceQuotasResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas"} # type: ignore - + update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas"} # type: ignore @distributed_trace def list( - self, - location: str, - **kwargs: Any + self, location: str, **kwargs: Any ) -> AsyncIterable["_models.ListWorkspaceQuotas"]: """Gets the currently assigned Workspace Quotas based on VMFamily. @@ -123,27 +152,34 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListWorkspaceQuotas] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceQuotas"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListWorkspaceQuotas"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, @@ -156,7 +192,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ListWorkspaceQuotas", pipeline_response) + deserialized = self._deserialize( + "ListWorkspaceQuotas", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -166,21 +204,25 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registries_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registries_operations.py index 23c73e5ba7e3..b7e253557dcf 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registries_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registries_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,24 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registries_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_subscription_request, build_list_request, build_remove_regions_request_initial, build_update_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registries_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_by_subscription_request, + build_list_request, + build_remove_regions_request_initial, + build_update_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistriesOperations: """RegistriesOperations async operations. @@ -49,8 +74,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list_by_subscription( - self, - **kwargs: Any + self, **kwargs: Any ) -> AsyncIterable["_models.RegistryTrackedResourceArmPaginatedResult"]: """List registries by subscription. @@ -63,26 +87,33 @@ def list_by_subscription( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.RegistryTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_subscription.metadata['url'], + template_url=self.list_by_subscription.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, @@ -94,7 +125,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("RegistryTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "RegistryTrackedResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -104,30 +137,32 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore + list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore @distributed_trace def list( - self, - resource_group_name: str, - **kwargs: Any + self, resource_group_name: str, **kwargs: Any ) -> AsyncIterable["_models.RegistryTrackedResourceArmPaginatedResult"]: """List registries. @@ -142,27 +177,34 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.RegistryTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.RegistryTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -175,7 +217,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("RegistryTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "RegistryTrackedResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -185,80 +229,92 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - **kwargs: Any + self, resource_group_name: str, registry_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - registry_name: str, - **kwargs: Any + self, resource_group_name: str, registry_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: """Delete registry. @@ -280,49 +336,59 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace_async async def get( - self, - resource_group_name: str, - registry_name: str, - **kwargs: Any + self, resource_group_name: str, registry_name: str, **kwargs: Any ) -> "_models.Registry": """Get registry. @@ -337,46 +403,54 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.Registry :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace_async async def update( @@ -401,16 +475,24 @@ async def update( :rtype: ~azure.mgmt.machinelearningservices.models.Registry :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialRegistryPartialTrackedResource') + _json = self._serialize.body( + body, "PartialRegistryPartialTrackedResource" + ) request = build_update_request( subscription_id=self._config.subscription_id, @@ -419,32 +501,37 @@ async def update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.update.metadata['url'], + template_url=self.update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - + update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore async def _create_or_update_initial( self, @@ -453,16 +540,22 @@ async def _create_or_update_initial( body: "_models.Registry", **kwargs: Any ) -> "_models.Registry": - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'Registry') + _json = self._serialize.body(body, "Registry") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -471,35 +564,38 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -532,15 +628,22 @@ async def begin_create_or_update( :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Registry] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -548,32 +651,40 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "azure-async-operation"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore async def _remove_regions_initial( self, @@ -582,16 +693,24 @@ async def _remove_regions_initial( body: "_models.Registry", **kwargs: Any ) -> Optional["_models.Registry"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Registry"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.Registry"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'Registry') + _json = self._serialize.body(body, "Registry") request = build_remove_regions_request_initial( subscription_id=self._config.subscription_id, @@ -600,40 +719,51 @@ async def _remove_regions_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._remove_regions_initial.metadata['url'], + template_url=self._remove_regions_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _remove_regions_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions"} # type: ignore - + _remove_regions_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions"} # type: ignore @distributed_trace_async async def begin_remove_regions( @@ -666,15 +796,22 @@ async def begin_remove_regions( :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Registry] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Registry"] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Registry"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._remove_regions_initial( resource_group_name=resource_group_name, @@ -682,29 +819,37 @@ async def begin_remove_regions( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Registry', pipeline_response) + deserialized = self._deserialize("Registry", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_remove_regions.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions"} # type: ignore + begin_remove_regions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_code_containers_operations.py index 402ecf51158e..ee84c81d95b0 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_code_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_code_containers_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_code_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_code_containers_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryCodeContainersOperations: """RegistryCodeContainersOperations async operations. @@ -72,29 +94,36 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, api_version=api_version, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -109,7 +138,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -119,24 +150,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -145,49 +180,63 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements code_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, code_name=code_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -219,43 +268,56 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, code_name=code_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore @distributed_trace_async async def get( @@ -280,47 +342,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, code_name=code_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize("CodeContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore async def _create_or_update_initial( self, @@ -330,16 +400,22 @@ async def _create_or_update_initial( body: "_models.CodeContainer", **kwargs: Any ) -> "_models.CodeContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeContainer') + _json = self._serialize.body(body, "CodeContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -349,39 +425,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('CodeContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -418,15 +508,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.CodeContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -435,29 +532,39 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_code_versions_operations.py index fcd70dc83114..d328f95ba277 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_code_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_code_versions_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,22 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_code_versions_operations import build_create_or_get_start_pending_upload_request, build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_code_versions_operations import ( + build_create_or_get_start_pending_upload_request, + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryCodeVersionsOperations: """RegistryCodeVersionsOperations async operations. @@ -81,16 +104,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -100,13 +130,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -124,7 +154,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -134,24 +166,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -161,15 +197,18 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements version: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -177,34 +216,45 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements code_name=code_name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -239,14 +289,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -254,29 +309,37 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements code_name=code_name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -304,15 +367,18 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -320,32 +386,37 @@ async def get( code_name=code_name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore async def _create_or_update_initial( self, @@ -356,16 +427,22 @@ async def _create_or_update_initial( body: "_models.CodeVersion", **kwargs: Any ) -> "_models.CodeVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeVersion') + _json = self._serialize.body(body, "CodeVersion") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -376,39 +453,49 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('CodeVersion', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -448,15 +535,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.CodeVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -466,32 +560,40 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_get_start_pending_upload( @@ -522,16 +624,24 @@ async def create_or_get_start_pending_upload( :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PendingUploadResponseDto"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PendingUploadRequestDto') + _json = self._serialize.body(body, "PendingUploadRequestDto") request = build_create_or_get_start_pending_upload_request( subscription_id=self._config.subscription_id, @@ -542,29 +652,38 @@ async def create_or_get_start_pending_upload( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], + template_url=self.create_or_get_start_pending_upload.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) + deserialized = self._deserialize( + "PendingUploadResponseDto", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}/startPendingUpload"} # type: ignore - + create_or_get_start_pending_upload.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}/startPendingUpload"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_component_containers_operations.py index 9f67c0850c2a..64f378f1f534 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_component_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_component_containers_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_component_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_component_containers_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryComponentContainersOperations: """RegistryComponentContainersOperations async operations. @@ -72,29 +94,36 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, api_version=api_version, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -109,7 +138,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -119,24 +151,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -145,49 +181,63 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements component_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, component_name=component_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -219,43 +269,56 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, component_name=component_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore @distributed_trace_async async def get( @@ -280,47 +343,59 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, component_name=component_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore async def _create_or_update_initial( self, @@ -330,16 +405,24 @@ async def _create_or_update_initial( body: "_models.ComponentContainer", **kwargs: Any ) -> "_models.ComponentContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentContainer') + _json = self._serialize.body(body, "ComponentContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -349,39 +432,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComponentContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -418,15 +515,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComponentContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -435,29 +541,39 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_component_versions_operations.py index 6ebdfc071448..acb1d8dd74b9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_component_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_component_versions_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_component_versions_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_component_versions_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryComponentVersionsOperations: """RegistryComponentVersionsOperations async operations. @@ -84,16 +106,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -104,13 +133,13 @@ def prepare_request(next_link=None): top=top, skip=skip, stage=stage, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -129,7 +158,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -139,24 +170,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -166,15 +201,18 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements version: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -182,34 +220,45 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements component_name=component_name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -244,14 +293,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -259,29 +313,37 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements component_name=component_name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -309,15 +371,20 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -325,32 +392,37 @@ async def get( component_name=component_name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize("ComponentVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore async def _create_or_update_initial( self, @@ -361,16 +433,24 @@ async def _create_or_update_initial( body: "_models.ComponentVersion", **kwargs: Any ) -> "_models.ComponentVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentVersion') + _json = self._serialize.body(body, "ComponentVersion") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -381,39 +461,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ComponentVersion', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -453,15 +547,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ComponentVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -471,29 +574,39 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_data_containers_operations.py index fd4fdf7feec1..6bcdb42aaefb 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_data_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_data_containers_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_data_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_data_containers_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryDataContainersOperations: """RegistryDataContainersOperations async operations. @@ -75,16 +97,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -92,13 +121,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -114,7 +143,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("DataContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -124,24 +155,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -150,49 +185,63 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, name=name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -224,43 +273,56 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, name=name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore @distributed_trace_async async def get( @@ -285,47 +347,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize("DataContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore async def _create_or_update_initial( self, @@ -335,16 +405,22 @@ async def _create_or_update_initial( body: "_models.DataContainer", **kwargs: Any ) -> "_models.DataContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DataContainer') + _json = self._serialize.body(body, "DataContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -354,39 +430,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('DataContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -423,15 +513,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.DataContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataContainer"] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.DataContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -440,29 +537,39 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('DataContainer', pipeline_response) + deserialized = self._deserialize( + "DataContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_data_versions_operations.py index df96d558c3ac..c7be0401e2e0 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_data_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_data_versions_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,22 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_data_versions_operations import build_create_or_get_start_pending_upload_request, build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_data_versions_operations import ( + build_create_or_get_start_pending_upload_request, + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryDataVersionsOperations: """RegistryDataVersionsOperations async operations. @@ -91,16 +114,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.DataVersionBaseResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBaseResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -112,13 +142,13 @@ def prepare_request(next_link=None): skip=skip, tags=tags, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -138,7 +168,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("DataVersionBaseResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "DataVersionBaseResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -148,24 +180,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -175,15 +211,18 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements version: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -191,34 +230,45 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -253,14 +303,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -268,29 +323,37 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -318,15 +381,20 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -334,32 +402,37 @@ async def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize("DataVersionBase", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore async def _create_or_update_initial( self, @@ -370,16 +443,24 @@ async def _create_or_update_initial( body: "_models.DataVersionBase", **kwargs: Any ) -> "_models.DataVersionBase": - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'DataVersionBase') + _json = self._serialize.body(body, "DataVersionBase") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -390,39 +471,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('DataVersionBase', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -462,15 +557,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.DataVersionBase] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataVersionBase"] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DataVersionBase"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -480,32 +584,42 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('DataVersionBase', pipeline_response) + deserialized = self._deserialize( + "DataVersionBase", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def create_or_get_start_pending_upload( @@ -536,16 +650,24 @@ async def create_or_get_start_pending_upload( :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PendingUploadResponseDto"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PendingUploadRequestDto') + _json = self._serialize.body(body, "PendingUploadRequestDto") request = build_create_or_get_start_pending_upload_request( subscription_id=self._config.subscription_id, @@ -556,29 +678,38 @@ async def create_or_get_start_pending_upload( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], + template_url=self.create_or_get_start_pending_upload.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) + deserialized = self._deserialize( + "PendingUploadResponseDto", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}/startPendingUpload"} # type: ignore - + create_or_get_start_pending_upload.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}/startPendingUpload"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_environment_containers_operations.py index b1fa9c19705b..f4deb7fb39bf 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_environment_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_environment_containers_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_environment_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_environment_containers_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryEnvironmentContainersOperations: """RegistryEnvironmentContainersOperations async operations. @@ -55,7 +77,9 @@ def list( skip: Optional[str] = None, list_view_type: Optional[Union[str, "_models.ListViewType"]] = None, **kwargs: Any - ) -> AsyncIterable["_models.EnvironmentContainerResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.EnvironmentContainerResourceArmPaginatedResult" + ]: """List environment containers. List environment containers. @@ -75,16 +99,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -92,13 +123,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -114,7 +145,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -124,24 +158,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -150,49 +188,63 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements environment_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, environment_name=environment_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -224,43 +276,56 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, environment_name=environment_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore @distributed_trace_async async def get( @@ -285,47 +350,59 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, environment_name=environment_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore async def _create_or_update_initial( self, @@ -335,16 +412,24 @@ async def _create_or_update_initial( body: "_models.EnvironmentContainer", **kwargs: Any ) -> "_models.EnvironmentContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentContainer') + _json = self._serialize.body(body, "EnvironmentContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -354,39 +439,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -423,15 +522,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.EnvironmentContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentContainer"] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -440,29 +548,39 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('EnvironmentContainer', pipeline_response) + deserialized = self._deserialize( + "EnvironmentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_environment_versions_operations.py index 29d408c85033..f0fad28d35f9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_environment_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_environment_versions_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_environment_versions_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_environment_versions_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryEnvironmentVersionsOperations: """RegistryEnvironmentVersionsOperations async operations. @@ -88,16 +110,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.EnvironmentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -109,13 +138,13 @@ def prepare_request(next_link=None): skip=skip, list_view_type=list_view_type, stage=stage, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -135,7 +164,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("EnvironmentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersionResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -145,24 +177,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -172,15 +208,18 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements version: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -188,34 +227,45 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements environment_name=environment_name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -250,14 +300,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -265,29 +320,37 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements environment_name=environment_name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -315,15 +378,20 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -331,32 +399,39 @@ async def get( environment_name=environment_name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore async def _create_or_update_initial( self, @@ -367,16 +442,24 @@ async def _create_or_update_initial( body: "_models.EnvironmentVersion", **kwargs: Any ) -> "_models.EnvironmentVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'EnvironmentVersion') + _json = self._serialize.body(body, "EnvironmentVersion") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -387,39 +470,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -459,15 +556,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.EnvironmentVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentVersion"] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EnvironmentVersion"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -477,29 +583,39 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('EnvironmentVersion', pipeline_response) + deserialized = self._deserialize( + "EnvironmentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_model_containers_operations.py index c73c6f6cad93..bc8606bd95d5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_model_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_model_containers_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_model_containers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_model_containers_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryModelContainersOperations: """RegistryModelContainersOperations async operations. @@ -75,16 +97,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -92,13 +121,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -114,7 +143,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -124,24 +155,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -150,49 +185,63 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements model_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, model_name=model_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -224,43 +273,56 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, registry_name=registry_name, model_name=model_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore @distributed_trace_async async def get( @@ -285,47 +347,57 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, registry_name=registry_name, model_name=model_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize("ModelContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore async def _create_or_update_initial( self, @@ -335,16 +407,24 @@ async def _create_or_update_initial( body: "_models.ModelContainer", **kwargs: Any ) -> "_models.ModelContainer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelContainer') + _json = self._serialize.body(body, "ModelContainer") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -354,39 +434,53 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ModelContainer', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -423,15 +517,24 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ModelContainer] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelContainer"] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelContainer"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -440,29 +543,39 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ModelContainer', pipeline_response) + deserialized = self._deserialize( + "ModelContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_model_versions_operations.py index 7cb5bd534ce5..96a7d9a3564b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_model_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_registry_model_versions_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,23 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._registry_model_versions_operations import build_create_or_get_start_pending_upload_request, build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request, build_package_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._registry_model_versions_operations import ( + build_create_or_get_start_pending_upload_request, + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, + build_package_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class RegistryModelVersionsOperations: """RegistryModelVersionsOperations async operations. @@ -98,16 +122,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ModelVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ModelVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -122,13 +153,13 @@ def prepare_request(next_link=None): tags=tags, properties=properties, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -151,7 +182,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ModelVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ModelVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -161,24 +194,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -188,15 +225,18 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements version: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -204,34 +244,45 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements model_name=model_name, version=version, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -266,14 +317,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, @@ -281,29 +337,37 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements model_name=model_name, version=version, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -331,15 +395,18 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -347,32 +414,37 @@ async def get( model_name=model_name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore async def _create_or_update_initial( self, @@ -383,16 +455,22 @@ async def _create_or_update_initial( body: "_models.ModelVersion", **kwargs: Any ) -> "_models.ModelVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ModelVersion') + _json = self._serialize.body(body, "ModelVersion") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -403,39 +481,49 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('ModelVersion', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -475,15 +563,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.ModelVersion] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelVersion"] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.ModelVersion"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -493,32 +588,40 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('ModelVersion', pipeline_response) + deserialized = self._deserialize("ModelVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}"} # type: ignore async def _package_initial( self, @@ -529,16 +632,24 @@ async def _package_initial( body: "_models.PackageRequest", **kwargs: Any ) -> Optional["_models.PackageResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PackageResponse"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.PackageResponse"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PackageRequest') + _json = self._serialize.body(body, "PackageRequest") request = build_package_request_initial( subscription_id=self._config.subscription_id, @@ -549,39 +660,47 @@ async def _package_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._package_initial.metadata['url'], + template_url=self._package_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('PackageResponse', pipeline_response) + deserialized = self._deserialize( + "PackageResponse", pipeline_response + ) if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _package_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/package"} # type: ignore - + _package_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/package"} # type: ignore @distributed_trace_async async def begin_package( @@ -621,15 +740,24 @@ async def begin_package( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.PackageResponse] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.PackageResponse"] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PackageResponse"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._package_initial( resource_group_name=resource_group_name, @@ -639,32 +767,42 @@ async def begin_package( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('PackageResponse', pipeline_response) + deserialized = self._deserialize( + "PackageResponse", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_package.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/package"} # type: ignore + begin_package.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/package"} # type: ignore @distributed_trace_async async def create_or_get_start_pending_upload( @@ -695,16 +833,24 @@ async def create_or_get_start_pending_upload( :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PendingUploadResponseDto"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PendingUploadRequestDto') + _json = self._serialize.body(body, "PendingUploadRequestDto") request = build_create_or_get_start_pending_upload_request( subscription_id=self._config.subscription_id, @@ -715,29 +861,38 @@ async def create_or_get_start_pending_upload( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], + template_url=self.create_or_get_start_pending_upload.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) + deserialized = self._deserialize( + "PendingUploadResponseDto", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/startPendingUpload"} # type: ignore - + create_or_get_start_pending_upload.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/startPendingUpload"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_schedules_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_schedules_operations.py index ed9b3f139917..897512aeea11 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_schedules_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_schedules_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,21 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._schedules_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._schedules_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_get_request, + build_list_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class SchedulesOperations: """SchedulesOperations async operations. @@ -53,7 +75,9 @@ def list( resource_group_name: str, workspace_name: str, skip: Optional[str] = None, - list_view_type: Optional[Union[str, "_models.ScheduleListViewType"]] = None, + list_view_type: Optional[ + Union[str, "_models.ScheduleListViewType"] + ] = None, **kwargs: Any ) -> AsyncIterable["_models.ScheduleResourceArmPaginatedResult"]: """List schedules in specified workspace. @@ -75,16 +99,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ScheduleResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduleResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ScheduleResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -92,13 +123,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -114,7 +145,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ScheduleResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ScheduleResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -124,24 +157,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -150,49 +187,63 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -224,43 +275,56 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @distributed_trace_async async def get( @@ -285,47 +349,55 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.Schedule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Schedule"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Schedule', pipeline_response) + deserialized = self._deserialize("Schedule", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore async def _create_or_update_initial( self, @@ -335,16 +407,22 @@ async def _create_or_update_initial( body: "_models.Schedule", **kwargs: Any ) -> "_models.Schedule": - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Schedule"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'Schedule') + _json = self._serialize.body(body, "Schedule") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -354,39 +432,49 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('Schedule', pipeline_response) + deserialized = self._deserialize("Schedule", pipeline_response) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('Schedule', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("Schedule", pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -422,15 +510,22 @@ async def begin_create_or_update( :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Schedule] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Schedule"] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Schedule"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -439,29 +534,37 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Schedule', pipeline_response) + deserialized = self._deserialize("Schedule", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_usages_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_usages_operations.py index 69caf580f16c..415d48a9d9a3 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_usages_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_usages_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,8 +25,15 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._usages_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class UsagesOperations: """UsagesOperations async operations. @@ -46,9 +59,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list( - self, - location: str, - **kwargs: Any + self, location: str, **kwargs: Any ) -> AsyncIterable["_models.ListUsagesResult"]: """Gets the current usage information as well as limits for AML resources for given subscription and location. @@ -61,27 +72,34 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListUsagesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListUsagesResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, location=location, @@ -94,7 +112,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ListUsagesResult", pipeline_response) + deserialized = self._deserialize( + "ListUsagesResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -104,21 +124,25 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_virtual_machine_sizes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_virtual_machine_sizes_operations.py index 1b9e4f6fed96..50cadca4fa61 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_virtual_machine_sizes_operations.py @@ -8,7 +8,13 @@ # -------------------------------------------------------------------------- from typing import Any, Callable, Dict, Optional, TypeVar -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -18,8 +24,15 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._virtual_machine_sizes_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class VirtualMachineSizesOperations: """VirtualMachineSizesOperations async operations. @@ -45,9 +58,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace_async async def list( - self, - location: str, - **kwargs: Any + self, location: str, **kwargs: Any ) -> "_models.VirtualMachineSizeListResult": """Returns supported VM Sizes in a location. @@ -58,42 +69,54 @@ async def list( :rtype: ~azure.mgmt.machinelearningservices.models.VirtualMachineSizeListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_list_request( location=location, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualMachineSizeListResult', pipeline_response) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) + + deserialized = self._deserialize( + "VirtualMachineSizeListResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes"} # type: ignore - + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_workspace_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_workspace_connections_operations.py index 0cdd76e702df..f619b29b9636 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_workspace_connections_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_workspace_connections_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,9 +25,23 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._workspace_connections_operations import build_create_request, build_delete_request, build_get_request, build_list_request, build_list_secrets_request, build_update_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._workspace_connections_operations import ( + build_create_request, + build_delete_request, + build_get_request, + build_list_request, + build_list_secrets_request, + build_update_request, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class WorkspaceConnectionsOperations: """WorkspaceConnectionsOperations async operations. @@ -53,7 +73,9 @@ def list( target: Optional[str] = None, category: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"]: + ) -> AsyncIterable[ + "_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult" + ]: """Lists all the available machine learning workspaces connections under the specified workspace. Lists all the available machine learning workspaces connections under the specified workspace. @@ -73,16 +95,23 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -90,13 +119,13 @@ def prepare_request(next_link=None): api_version=api_version, target=target, category=category, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -112,7 +141,10 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -122,24 +154,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -164,43 +200,51 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, connection_name=connection_name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace_async async def get( @@ -225,47 +269,59 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, connection_name=connection_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace_async async def update( @@ -293,17 +349,27 @@ async def update( :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'WorkspaceConnectionUpdateParameter') + _json = self._serialize.body( + body, "WorkspaceConnectionUpdateParameter" + ) else: _json = None @@ -315,32 +381,39 @@ async def update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.update.metadata['url'], + template_url=self.update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - + update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace_async async def create( @@ -348,7 +421,9 @@ async def create( resource_group_name: str, workspace_name: str, connection_name: str, - body: Optional["_models.WorkspaceConnectionPropertiesV2BasicResource"] = None, + body: Optional[ + "_models.WorkspaceConnectionPropertiesV2BasicResource" + ] = None, **kwargs: Any ) -> "_models.WorkspaceConnectionPropertiesV2BasicResource": """Create or update machine learning workspaces connections under the specified workspace. @@ -369,17 +444,27 @@ async def create( :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'WorkspaceConnectionPropertiesV2BasicResource') + _json = self._serialize.body( + body, "WorkspaceConnectionPropertiesV2BasicResource" + ) else: _json = None @@ -391,32 +476,39 @@ async def create( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create.metadata['url'], + template_url=self.create.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore - + create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace_async async def list_secrets( @@ -441,44 +533,56 @@ async def list_secrets( :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceConnectionPropertiesV2BasicResource"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_list_secrets_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, connection_name=connection_name, api_version=api_version, - template_url=self.list_secrets.metadata['url'], + template_url=self.list_secrets.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('WorkspaceConnectionPropertiesV2BasicResource', pipeline_response) + deserialized = self._deserialize( + "WorkspaceConnectionPropertiesV2BasicResource", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_secrets.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/listsecrets"} # type: ignore - + list_secrets.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/listsecrets"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_workspace_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_workspace_features_operations.py index 6d28ba70da34..3d6bf1034ed3 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_workspace_features_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_workspace_features_operations.py @@ -9,7 +9,13 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest @@ -19,8 +25,15 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._workspace_features_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class WorkspaceFeaturesOperations: """WorkspaceFeaturesOperations async operations. @@ -46,10 +59,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> AsyncIterable["_models.ListAmlUserFeatureResult"]: """Lists all enabled features for a workspace. @@ -64,28 +74,35 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.ListAmlUserFeatureResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAmlUserFeatureResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListAmlUserFeatureResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -99,7 +116,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ListAmlUserFeatureResult", pipeline_response) + deserialized = self._deserialize( + "ListAmlUserFeatureResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -109,21 +128,25 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_workspaces_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_workspaces_operations.py index 5e4f7f7cc103..88538e2f9e72 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_workspaces_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/aio/operations/_workspaces_operations.py @@ -9,10 +9,20 @@ from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling import ( + AsyncLROPoller, + AsyncNoPolling, + AsyncPollingMethod, +) from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async @@ -21,9 +31,31 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._workspaces_operations import build_create_or_update_request_initial, build_delete_request_initial, build_diagnose_request_initial, build_get_request, build_list_by_resource_group_request, build_list_by_subscription_request, build_list_keys_request, build_list_notebook_access_token_request, build_list_notebook_keys_request, build_list_outbound_network_dependencies_endpoints_request, build_list_storage_account_keys_request, build_prepare_notebook_request_initial, build_resync_keys_request_initial, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +from ...operations._workspaces_operations import ( + build_create_or_update_request_initial, + build_delete_request_initial, + build_diagnose_request_initial, + build_get_request, + build_list_by_resource_group_request, + build_list_by_subscription_request, + build_list_keys_request, + build_list_notebook_access_token_request, + build_list_notebook_keys_request, + build_list_outbound_network_dependencies_endpoints_request, + build_list_storage_account_keys_request, + build_prepare_notebook_request_initial, + build_resync_keys_request_initial, + build_update_request_initial, +) + +T = TypeVar("T") +ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], + Any, + ] +] + class WorkspacesOperations: """WorkspacesOperations async operations. @@ -68,28 +100,35 @@ def list_by_subscription( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, skip=skip, kind=kind, - template_url=self.list_by_subscription.metadata['url'], + template_url=self.list_by_subscription.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=api_version, @@ -103,7 +142,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -113,24 +154,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore + list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore @distributed_trace def list_by_resource_group( @@ -156,29 +201,36 @@ def list_by_resource_group( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.WorkspaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.WorkspaceListResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_by_resource_group_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, api_version=api_version, skip=skip, kind=kind, - template_url=self.list_by_resource_group.metadata['url'], + template_url=self.list_by_resource_group.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_by_resource_group_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -193,7 +245,9 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListResult", pipeline_response) + deserialized = self._deserialize( + "WorkspaceListResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -203,24 +257,28 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore + list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -229,42 +287,48 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements force_to_purge: Optional[bool] = False, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, force_to_purge=force_to_purge, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace_async async def begin_delete( # pylint: disable=inconsistent-return-statements @@ -296,50 +360,56 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, force_to_purge=force_to_purge, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace_async async def get( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.Workspace": """Gets the properties of the specified machine learning workspace. @@ -354,46 +424,54 @@ async def get( :rtype: ~azure.mgmt.machinelearningservices.models.Workspace :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore async def _update_initial( self, @@ -402,16 +480,24 @@ async def _update_initial( body: "_models.WorkspaceUpdateParameters", **kwargs: Any ) -> Optional["_models.Workspace"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.Workspace"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'WorkspaceUpdateParameters') + _json = self._serialize.body(body, "WorkspaceUpdateParameters") request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -420,33 +506,36 @@ async def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace_async async def begin_update( @@ -480,15 +569,22 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Workspace] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, @@ -496,32 +592,36 @@ async def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore async def _create_or_update_initial( self, @@ -530,16 +630,24 @@ async def _create_or_update_initial( body: "_models.Workspace", **kwargs: Any ) -> Optional["_models.Workspace"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Workspace"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.Workspace"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'Workspace') + _json = self._serialize.body(body, "Workspace") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -548,39 +656,45 @@ async def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace_async async def begin_create_or_update( @@ -614,15 +728,22 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.Workspace] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workspace"] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.Workspace"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, @@ -630,32 +751,40 @@ async def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('Workspace', pipeline_response) + deserialized = self._deserialize("Workspace", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore async def _diagnose_initial( self, @@ -664,17 +793,25 @@ async def _diagnose_initial( body: Optional["_models.DiagnoseWorkspaceParameters"] = None, **kwargs: Any ) -> Optional["_models.DiagnoseResponseResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.DiagnoseResponseResult"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] if body is not None: - _json = self._serialize.body(body, 'DiagnoseWorkspaceParameters') + _json = self._serialize.body(body, "DiagnoseWorkspaceParameters") else: _json = None @@ -685,39 +822,47 @@ async def _diagnose_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._diagnose_initial.metadata['url'], + template_url=self._diagnose_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) + deserialized = self._deserialize( + "DiagnoseResponseResult", pipeline_response + ) if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _diagnose_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore - + _diagnose_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore @distributed_trace_async async def begin_diagnose( @@ -751,15 +896,24 @@ async def begin_diagnose( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.DiagnoseResponseResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnoseResponseResult"] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.DiagnoseResponseResult"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._diagnose_initial( resource_group_name=resource_group_name, @@ -767,39 +921,46 @@ async def begin_diagnose( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('DiagnoseResponseResult', pipeline_response) + deserialized = self._deserialize( + "DiagnoseResponseResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_diagnose.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore + begin_diagnose.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore @distributed_trace_async async def list_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.ListWorkspaceKeysResult": """Lists all the keys associated with this workspace. This includes keys for the storage account, app insights and password for container registry. @@ -816,53 +977,62 @@ async def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListWorkspaceKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListWorkspaceKeysResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListWorkspaceKeysResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ListWorkspaceKeysResult', pipeline_response) + deserialized = self._deserialize( + "ListWorkspaceKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys"} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys"} # type: ignore @distributed_trace_async async def list_notebook_access_token( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.NotebookAccessTokenResult": """Get Azure Machine Learning Workspace notebook access token. @@ -877,53 +1047,62 @@ async def list_notebook_access_token( :rtype: ~azure.mgmt.machinelearningservices.models.NotebookAccessTokenResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookAccessTokenResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.NotebookAccessTokenResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_list_notebook_access_token_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_notebook_access_token.metadata['url'], + template_url=self.list_notebook_access_token.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('NotebookAccessTokenResult', pipeline_response) + deserialized = self._deserialize( + "NotebookAccessTokenResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_notebook_access_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken"} # type: ignore - + list_notebook_access_token.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken"} # type: ignore @distributed_trace_async async def list_notebook_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.ListNotebookKeysResult": """Lists keys of Azure Machine Learning Workspaces notebook. @@ -938,53 +1117,62 @@ async def list_notebook_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListNotebookKeysResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListNotebookKeysResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_list_notebook_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_notebook_keys.metadata['url'], + template_url=self.list_notebook_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ListNotebookKeysResult', pipeline_response) + deserialized = self._deserialize( + "ListNotebookKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_notebook_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys"} # type: ignore - + list_notebook_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys"} # type: ignore @distributed_trace_async async def list_storage_account_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.ListStorageAccountKeysResult": """Lists keys of Azure Machine Learning Workspace's storage account. @@ -999,53 +1187,62 @@ async def list_storage_account_keys( :rtype: ~azure.mgmt.machinelearningservices.models.ListStorageAccountKeysResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListStorageAccountKeysResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ListStorageAccountKeysResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_list_storage_account_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_storage_account_keys.metadata['url'], + template_url=self.list_storage_account_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ListStorageAccountKeysResult', pipeline_response) + deserialized = self._deserialize( + "ListStorageAccountKeysResult", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_storage_account_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys"} # type: ignore - + list_storage_account_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys"} # type: ignore @distributed_trace_async async def list_outbound_network_dependencies_endpoints( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> "_models.ExternalFQDNResponse": """Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) programmatically. @@ -1062,107 +1259,128 @@ async def list_outbound_network_dependencies_endpoints( :rtype: ~azure.mgmt.machinelearningservices.models.ExternalFQDNResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExternalFQDNResponse"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ExternalFQDNResponse"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_list_outbound_network_dependencies_endpoints_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], + template_url=self.list_outbound_network_dependencies_endpoints.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ExternalFQDNResponse', pipeline_response) + deserialized = self._deserialize( + "ExternalFQDNResponse", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_outbound_network_dependencies_endpoints.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints"} # type: ignore - + list_outbound_network_dependencies_endpoints.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints"} # type: ignore async def _prepare_notebook_initial( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> Optional["_models.NotebookResourceInfo"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NotebookResourceInfo"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.NotebookResourceInfo"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_prepare_notebook_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self._prepare_notebook_initial.metadata['url'], + template_url=self._prepare_notebook_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) + deserialized = self._deserialize( + "NotebookResourceInfo", pipeline_response + ) if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _prepare_notebook_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore - + _prepare_notebook_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore @distributed_trace_async async def begin_prepare_notebook( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> AsyncLROPoller["_models.NotebookResourceInfo"]: """Prepare Azure Machine Learning Workspace's notebook resource. @@ -1186,100 +1404,120 @@ async def begin_prepare_notebook( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.NotebookResourceInfo] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NotebookResourceInfo"] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.NotebookResourceInfo"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._prepare_notebook_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('NotebookResourceInfo', pipeline_response) + deserialized = self._deserialize( + "NotebookResourceInfo", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_prepare_notebook.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore + begin_prepare_notebook.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore async def _resync_keys_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_resync_keys_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - template_url=self._resync_keys_initial.metadata['url'], + template_url=self._resync_keys_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _resync_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore - + _resync_keys_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore @distributed_trace_async async def begin_resync_keys( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any + self, resource_group_name: str, workspace_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: """Resync all the keys associated with this workspace.This includes keys for the storage account, app insights and password for container registry. @@ -1303,39 +1541,52 @@ async def begin_resync_keys( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = await self._resync_keys_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + if polling is True: + polling_method = AsyncARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = AsyncNoPolling() + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_resync_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore + begin_resync_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/models/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/models/__init__.py index cbe062f46adb..cceed5772f3f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/models/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/models/__init__.py @@ -232,10 +232,14 @@ from ._models_py3 import FeaturesetVersionResourceArmPaginatedResult from ._models_py3 import FeaturestoreEntityContainer from ._models_py3 import FeaturestoreEntityContainerProperties - from ._models_py3 import FeaturestoreEntityContainerResourceArmPaginatedResult + from ._models_py3 import ( + FeaturestoreEntityContainerResourceArmPaginatedResult, + ) from ._models_py3 import FeaturestoreEntityVersion from ._models_py3 import FeaturestoreEntityVersionProperties - from ._models_py3 import FeaturestoreEntityVersionResourceArmPaginatedResult + from ._models_py3 import ( + FeaturestoreEntityVersionResourceArmPaginatedResult, + ) from ._models_py3 import FeaturizationSettings from ._models_py3 import FileSystemSource from ._models_py3 import FixedInputData @@ -329,7 +333,9 @@ from ._models_py3 import MLTableJobOutput from ._models_py3 import ManagedComputeIdentity from ._models_py3 import ManagedIdentity - from ._models_py3 import ManagedIdentityAuthTypeWorkspaceConnectionProperties + from ._models_py3 import ( + ManagedIdentityAuthTypeWorkspaceConnectionProperties, + ) from ._models_py3 import ManagedNetworkProvisionOptions from ._models_py3 import ManagedNetworkProvisionStatus from ._models_py3 import ManagedNetworkSettings @@ -405,7 +411,9 @@ from ._models_py3 import PackageResponse from ._models_py3 import PaginatedComputeResourcesList from ._models_py3 import PartialBatchDeployment - from ._models_py3 import PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties + from ._models_py3 import ( + PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, + ) from ._models_py3 import PartialJobBase from ._models_py3 import PartialJobBasePartialResource from ._models_py3 import PartialManagedServiceIdentity @@ -479,7 +487,9 @@ from ._models_py3 import Seasonality from ._models_py3 import SecretConfiguration from ._models_py3 import ServiceManagedResourcesSettings - from ._models_py3 import ServicePrincipalAuthTypeWorkspaceConnectionProperties + from ._models_py3 import ( + ServicePrincipalAuthTypeWorkspaceConnectionProperties, + ) from ._models_py3 import ServicePrincipalDatastoreCredentials from ._models_py3 import ServicePrincipalDatastoreSecrets from ._models_py3 import ServiceTagDestination @@ -548,7 +558,9 @@ from ._models_py3 import UserCreatedAcrAccount from ._models_py3 import UserCreatedStorageAccount from ._models_py3 import UserIdentity - from ._models_py3 import UsernamePasswordAuthTypeWorkspaceConnectionProperties + from ._models_py3 import ( + UsernamePasswordAuthTypeWorkspaceConnectionProperties, + ) from ._models_py3 import VirtualMachine from ._models_py3 import VirtualMachineImage from ._models_py3 import VirtualMachineSchema @@ -568,7 +580,9 @@ from ._models_py3 import WorkspaceConnectionPersonalAccessToken from ._models_py3 import WorkspaceConnectionPropertiesV2 from ._models_py3 import WorkspaceConnectionPropertiesV2BasicResource - from ._models_py3 import WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult + from ._models_py3 import ( + WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult, + ) from ._models_py3 import WorkspaceConnectionServicePrincipal from ._models_py3 import WorkspaceConnectionSharedAccessSignature from ._models_py3 import WorkspaceConnectionUpdateParameter @@ -1337,758 +1351,758 @@ ) __all__ = [ - 'AKS', - 'AKSSchema', - 'AKSSchemaProperties', - 'AccessKeyAuthTypeWorkspaceConnectionProperties', - 'AccountKeyDatastoreCredentials', - 'AccountKeyDatastoreSecrets', - 'AcrDetails', - 'AksComputeSecrets', - 'AksComputeSecretsProperties', - 'AksNetworkingConfiguration', - 'AllFeatures', - 'AllNodes', - 'AmlCompute', - 'AmlComputeNodeInformation', - 'AmlComputeNodesInformation', - 'AmlComputeProperties', - 'AmlComputeSchema', - 'AmlOperation', - 'AmlOperationListResult', - 'AmlToken', - 'AmlTokenComputeIdentity', - 'AmlUserFeature', - 'ApiKeyAuthWorkspaceConnectionProperties', - 'ArmResourceId', - 'AssetBase', - 'AssetContainer', - 'AssetJobInput', - 'AssetJobOutput', - 'AssetReferenceBase', - 'AssignedUser', - 'AutoDeleteSetting', - 'AutoForecastHorizon', - 'AutoMLJob', - 'AutoMLVertical', - 'AutoNCrossValidations', - 'AutoPauseProperties', - 'AutoScaleProperties', - 'AutoSeasonality', - 'AutoTargetLags', - 'AutoTargetRollingWindowSize', - 'AutologgerSettings', - 'AzMonMonitoringAlertNotificationSettings', - 'AzureBlobDatastore', - 'AzureDataLakeGen1Datastore', - 'AzureDataLakeGen2Datastore', - 'AzureDatastore', - 'AzureDevOpsWebhook', - 'AzureFileDatastore', - 'AzureMLBatchInferencingServer', - 'AzureMLOnlineInferencingServer', - 'BanditPolicy', - 'BaseEnvironmentId', - 'BaseEnvironmentSource', - 'BatchDeployment', - 'BatchDeploymentConfiguration', - 'BatchDeploymentProperties', - 'BatchDeploymentTrackedResourceArmPaginatedResult', - 'BatchEndpoint', - 'BatchEndpointDefaults', - 'BatchEndpointProperties', - 'BatchEndpointTrackedResourceArmPaginatedResult', - 'BatchPipelineComponentDeploymentConfiguration', - 'BatchRetrySettings', - 'BayesianSamplingAlgorithm', - 'BindOptions', - 'BlobReferenceForConsumptionDto', - 'BuildContext', - 'CategoricalDataDriftMetricThreshold', - 'CategoricalDataQualityMetricThreshold', - 'CategoricalPredictionDriftMetricThreshold', - 'CertificateDatastoreCredentials', - 'CertificateDatastoreSecrets', - 'Classification', - 'ClassificationModelPerformanceMetricThreshold', - 'ClassificationTrainingSettings', - 'ClusterUpdateParameters', - 'CocoExportSummary', - 'CodeConfiguration', - 'CodeContainer', - 'CodeContainerProperties', - 'CodeContainerResourceArmPaginatedResult', - 'CodeVersion', - 'CodeVersionProperties', - 'CodeVersionResourceArmPaginatedResult', - 'Collection', - 'ColumnTransformer', - 'CommandJob', - 'CommandJobLimits', - 'ComponentContainer', - 'ComponentContainerProperties', - 'ComponentContainerResourceArmPaginatedResult', - 'ComponentVersion', - 'ComponentVersionProperties', - 'ComponentVersionResourceArmPaginatedResult', - 'Compute', - 'ComputeInstance', - 'ComputeInstanceApplication', - 'ComputeInstanceAutologgerSettings', - 'ComputeInstanceConnectivityEndpoints', - 'ComputeInstanceContainer', - 'ComputeInstanceCreatedBy', - 'ComputeInstanceDataDisk', - 'ComputeInstanceDataMount', - 'ComputeInstanceEnvironmentInfo', - 'ComputeInstanceLastOperation', - 'ComputeInstanceProperties', - 'ComputeInstanceSchema', - 'ComputeInstanceSshSettings', - 'ComputeInstanceVersion', - 'ComputeResource', - 'ComputeResourceSchema', - 'ComputeRuntimeDto', - 'ComputeSchedules', - 'ComputeSecrets', - 'ComputeStartStopSchedule', - 'ContainerResourceRequirements', - 'ContainerResourceSettings', - 'CosmosDbSettings', - 'CreateMonitorAction', - 'Cron', - 'CronTrigger', - 'CsvExportSummary', - 'CustomForecastHorizon', - 'CustomInferencingServer', - 'CustomKeys', - 'CustomKeysWorkspaceConnectionProperties', - 'CustomMetricThreshold', - 'CustomModelJobInput', - 'CustomModelJobOutput', - 'CustomMonitoringSignal', - 'CustomNCrossValidations', - 'CustomSeasonality', - 'CustomService', - 'CustomTargetLags', - 'CustomTargetRollingWindowSize', - 'DataCollector', - 'DataContainer', - 'DataContainerProperties', - 'DataContainerResourceArmPaginatedResult', - 'DataDriftMetricThresholdBase', - 'DataDriftMonitoringSignal', - 'DataFactory', - 'DataImport', - 'DataImportSource', - 'DataLakeAnalytics', - 'DataLakeAnalyticsSchema', - 'DataLakeAnalyticsSchemaProperties', - 'DataPathAssetReference', - 'DataQualityMetricThresholdBase', - 'DataQualityMonitoringSignal', - 'DataVersionBase', - 'DataVersionBaseProperties', - 'DataVersionBaseResourceArmPaginatedResult', - 'DatabaseSource', - 'Databricks', - 'DatabricksComputeSecrets', - 'DatabricksComputeSecretsProperties', - 'DatabricksProperties', - 'DatabricksSchema', - 'DatasetExportSummary', - 'Datastore', - 'DatastoreCredentials', - 'DatastoreProperties', - 'DatastoreResourceArmPaginatedResult', - 'DatastoreSecrets', - 'DefaultScaleSettings', - 'DeploymentLogs', - 'DeploymentLogsRequest', - 'DeploymentResourceConfiguration', - 'DiagnoseRequestProperties', - 'DiagnoseResponseResult', - 'DiagnoseResponseResultValue', - 'DiagnoseResult', - 'DiagnoseWorkspaceParameters', - 'DistributionConfiguration', - 'Docker', - 'EarlyTerminationPolicy', - 'EmailMonitoringAlertNotificationSettings', - 'EncryptionKeyVaultUpdateProperties', - 'EncryptionProperty', - 'EncryptionUpdateProperties', - 'Endpoint', - 'EndpointAuthKeys', - 'EndpointAuthToken', - 'EndpointDeploymentPropertiesBase', - 'EndpointPropertiesBase', - 'EndpointScheduleAction', - 'EnvironmentContainer', - 'EnvironmentContainerProperties', - 'EnvironmentContainerResourceArmPaginatedResult', - 'EnvironmentVariable', - 'EnvironmentVersion', - 'EnvironmentVersionProperties', - 'EnvironmentVersionResourceArmPaginatedResult', - 'ErrorAdditionalInfo', - 'ErrorDetail', - 'ErrorResponse', - 'EstimatedVMPrice', - 'EstimatedVMPrices', - 'ExportSummary', - 'ExternalFQDNResponse', - 'FQDNEndpoint', - 'FQDNEndpointDetail', - 'FQDNEndpoints', - 'FQDNEndpointsPropertyBag', - 'Feature', - 'FeatureAttributionDriftMonitoringSignal', - 'FeatureAttributionMetricThreshold', - 'FeatureProperties', - 'FeatureResourceArmPaginatedResult', - 'FeatureStoreSettings', - 'FeatureSubset', - 'FeatureWindow', - 'FeaturesetContainer', - 'FeaturesetContainerProperties', - 'FeaturesetContainerResourceArmPaginatedResult', - 'FeaturesetJob', - 'FeaturesetJobArmPaginatedResult', - 'FeaturesetSpecification', - 'FeaturesetVersion', - 'FeaturesetVersionBackfillRequest', - 'FeaturesetVersionProperties', - 'FeaturesetVersionResourceArmPaginatedResult', - 'FeaturestoreEntityContainer', - 'FeaturestoreEntityContainerProperties', - 'FeaturestoreEntityContainerResourceArmPaginatedResult', - 'FeaturestoreEntityVersion', - 'FeaturestoreEntityVersionProperties', - 'FeaturestoreEntityVersionResourceArmPaginatedResult', - 'FeaturizationSettings', - 'FileSystemSource', - 'FixedInputData', - 'FlavorData', - 'ForecastHorizon', - 'Forecasting', - 'ForecastingSettings', - 'ForecastingTrainingSettings', - 'FqdnOutboundRule', - 'GenerationSafetyQualityMetricThreshold', - 'GenerationSafetyQualityMonitoringSignal', - 'GenerationTokenStatisticsMetricThreshold', - 'GenerationTokenStatisticsSignal', - 'GridSamplingAlgorithm', - 'HDInsight', - 'HDInsightProperties', - 'HDInsightSchema', - 'HdfsDatastore', - 'IdAssetReference', - 'IdentityConfiguration', - 'IdentityForCmk', - 'IdleShutdownSetting', - 'Image', - 'ImageClassification', - 'ImageClassificationBase', - 'ImageClassificationMultilabel', - 'ImageInstanceSegmentation', - 'ImageLimitSettings', - 'ImageMetadata', - 'ImageModelDistributionSettings', - 'ImageModelDistributionSettingsClassification', - 'ImageModelDistributionSettingsObjectDetection', - 'ImageModelSettings', - 'ImageModelSettingsClassification', - 'ImageModelSettingsObjectDetection', - 'ImageObjectDetection', - 'ImageObjectDetectionBase', - 'ImageSweepSettings', - 'ImageVertical', - 'ImportDataAction', - 'IndexColumn', - 'InferenceContainerProperties', - 'InferencingServer', - 'InstanceTypeSchema', - 'InstanceTypeSchemaResources', - 'IntellectualProperty', - 'JobBase', - 'JobBaseProperties', - 'JobBaseResourceArmPaginatedResult', - 'JobInput', - 'JobLimits', - 'JobOutput', - 'JobResourceConfiguration', - 'JobScheduleAction', - 'JobService', - 'KerberosCredentials', - 'KerberosKeytabCredentials', - 'KerberosKeytabSecrets', - 'KerberosPasswordCredentials', - 'KerberosPasswordSecrets', - 'KeyVaultProperties', - 'Kubernetes', - 'KubernetesOnlineDeployment', - 'KubernetesProperties', - 'KubernetesSchema', - 'LabelCategory', - 'LabelClass', - 'LabelingDataConfiguration', - 'LabelingJob', - 'LabelingJobImageProperties', - 'LabelingJobInstructions', - 'LabelingJobMediaProperties', - 'LabelingJobProperties', - 'LabelingJobResourceArmPaginatedResult', - 'LabelingJobTextProperties', - 'LakeHouseArtifact', - 'ListAmlUserFeatureResult', - 'ListNotebookKeysResult', - 'ListStorageAccountKeysResult', - 'ListUsagesResult', - 'ListWorkspaceKeysResult', - 'ListWorkspaceQuotas', - 'LiteralJobInput', - 'MLAssistConfiguration', - 'MLAssistConfigurationDisabled', - 'MLAssistConfigurationEnabled', - 'MLFlowModelJobInput', - 'MLFlowModelJobOutput', - 'MLTableData', - 'MLTableJobInput', - 'MLTableJobOutput', - 'ManagedComputeIdentity', - 'ManagedIdentity', - 'ManagedIdentityAuthTypeWorkspaceConnectionProperties', - 'ManagedNetworkProvisionOptions', - 'ManagedNetworkProvisionStatus', - 'ManagedNetworkSettings', - 'ManagedOnlineDeployment', - 'ManagedServiceIdentity', - 'MaterializationComputeResource', - 'MaterializationSettings', - 'MedianStoppingPolicy', - 'ModelConfiguration', - 'ModelContainer', - 'ModelContainerProperties', - 'ModelContainerResourceArmPaginatedResult', - 'ModelPackageInput', - 'ModelPerformanceMetricThresholdBase', - 'ModelPerformanceSignal', - 'ModelVersion', - 'ModelVersionProperties', - 'ModelVersionResourceArmPaginatedResult', - 'MonitorComputeConfigurationBase', - 'MonitorComputeIdentityBase', - 'MonitorDefinition', - 'MonitorServerlessSparkCompute', - 'MonitoringAlertNotificationSettingsBase', - 'MonitoringDataSegment', - 'MonitoringFeatureFilterBase', - 'MonitoringInputDataBase', - 'MonitoringSignalBase', - 'MonitoringTarget', - 'MonitoringThreshold', - 'MonitoringWorkspaceConnection', - 'Mpi', - 'NCrossValidations', - 'NlpFixedParameters', - 'NlpParameterSubspace', - 'NlpSweepSettings', - 'NlpVertical', - 'NlpVerticalFeaturizationSettings', - 'NlpVerticalLimitSettings', - 'NodeStateCounts', - 'Nodes', - 'NoneAuthTypeWorkspaceConnectionProperties', - 'NoneDatastoreCredentials', - 'NotebookAccessTokenResult', - 'NotebookPreparationError', - 'NotebookResourceInfo', - 'NotificationSetting', - 'NumericalDataDriftMetricThreshold', - 'NumericalDataQualityMetricThreshold', - 'NumericalPredictionDriftMetricThreshold', - 'Objective', - 'OneLakeArtifact', - 'OneLakeDatastore', - 'OnlineDeployment', - 'OnlineDeploymentProperties', - 'OnlineDeploymentTrackedResourceArmPaginatedResult', - 'OnlineEndpoint', - 'OnlineEndpointProperties', - 'OnlineEndpointTrackedResourceArmPaginatedResult', - 'OnlineInferenceConfiguration', - 'OnlineRequestSettings', - 'OnlineScaleSettings', - 'OperationDisplay', - 'OutboundRule', - 'OutboundRuleBasicResource', - 'OutboundRuleListResult', - 'OutputPathAssetReference', - 'PATAuthTypeWorkspaceConnectionProperties', - 'PackageInputPathBase', - 'PackageInputPathId', - 'PackageInputPathUrl', - 'PackageInputPathVersion', - 'PackageRequest', - 'PackageResponse', - 'PaginatedComputeResourcesList', - 'PartialBatchDeployment', - 'PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties', - 'PartialJobBase', - 'PartialJobBasePartialResource', - 'PartialManagedServiceIdentity', - 'PartialMinimalTrackedResource', - 'PartialMinimalTrackedResourceWithIdentity', - 'PartialMinimalTrackedResourceWithSku', - 'PartialNotificationSetting', - 'PartialRegistryPartialTrackedResource', - 'PartialSku', - 'Password', - 'PendingUploadCredentialDto', - 'PendingUploadRequestDto', - 'PendingUploadResponseDto', - 'PersonalComputeInstanceSettings', - 'PipelineJob', - 'PredictionDriftMetricThresholdBase', - 'PredictionDriftMonitoringSignal', - 'PrivateEndpoint', - 'PrivateEndpointConnection', - 'PrivateEndpointConnectionListResult', - 'PrivateEndpointDestination', - 'PrivateEndpointOutboundRule', - 'PrivateEndpointResource', - 'PrivateLinkResource', - 'PrivateLinkResourceListResult', - 'PrivateLinkServiceConnectionState', - 'ProbeSettings', - 'ProgressMetrics', - 'PyTorch', - 'QueueSettings', - 'QuotaBaseProperties', - 'QuotaUpdateParameters', - 'RandomSamplingAlgorithm', - 'Ray', - 'Recurrence', - 'RecurrenceSchedule', - 'RecurrenceTrigger', - 'RegenerateEndpointKeysRequest', - 'Registry', - 'RegistryListCredentialsResult', - 'RegistryPartialManagedServiceIdentity', - 'RegistryPrivateEndpointConnection', - 'RegistryPrivateLinkServiceConnectionState', - 'RegistryRegionArmDetails', - 'RegistryTrackedResourceArmPaginatedResult', - 'Regression', - 'RegressionModelPerformanceMetricThreshold', - 'RegressionTrainingSettings', - 'RequestLogging', - 'Resource', - 'ResourceBase', - 'ResourceConfiguration', - 'ResourceId', - 'ResourceName', - 'ResourceQuota', - 'Route', - 'SASAuthTypeWorkspaceConnectionProperties', - 'SASCredentialDto', - 'SamplingAlgorithm', - 'SasDatastoreCredentials', - 'SasDatastoreSecrets', - 'ScaleSettings', - 'ScaleSettingsInformation', - 'Schedule', - 'ScheduleActionBase', - 'ScheduleBase', - 'ScheduleProperties', - 'ScheduleResourceArmPaginatedResult', - 'ScriptReference', - 'ScriptsToExecute', - 'Seasonality', - 'SecretConfiguration', - 'ServiceManagedResourcesSettings', - 'ServicePrincipalAuthTypeWorkspaceConnectionProperties', - 'ServicePrincipalDatastoreCredentials', - 'ServicePrincipalDatastoreSecrets', - 'ServiceTagDestination', - 'ServiceTagOutboundRule', - 'SetupScripts', - 'SharedPrivateLinkResource', - 'Sku', - 'SkuCapacity', - 'SkuResource', - 'SkuResourceArmPaginatedResult', - 'SkuSetting', - 'SparkJob', - 'SparkJobEntry', - 'SparkJobPythonEntry', - 'SparkJobScalaEntry', - 'SparkResourceConfiguration', - 'SslConfiguration', - 'StackEnsembleSettings', - 'StaticInputData', - 'StatusMessage', - 'StorageAccountDetails', - 'SweepJob', - 'SweepJobLimits', - 'SynapseSpark', - 'SynapseSparkProperties', - 'SystemCreatedAcrAccount', - 'SystemCreatedStorageAccount', - 'SystemData', - 'SystemService', - 'TableFixedParameters', - 'TableParameterSubspace', - 'TableSweepSettings', - 'TableVertical', - 'TableVerticalFeaturizationSettings', - 'TableVerticalLimitSettings', - 'TargetLags', - 'TargetRollingWindowSize', - 'TargetUtilizationScaleSettings', - 'TensorFlow', - 'TextClassification', - 'TextClassificationMultilabel', - 'TextNer', - 'TmpfsOptions', - 'TopNFeaturesByAttribution', - 'TrackedResource', - 'TrailingInputData', - 'TrainingSettings', - 'TrialComponent', - 'TriggerBase', - 'TritonInferencingServer', - 'TritonModelJobInput', - 'TritonModelJobOutput', - 'TruncationSelectionPolicy', - 'UpdateWorkspaceQuotas', - 'UpdateWorkspaceQuotasResult', - 'UriFileDataVersion', - 'UriFileJobInput', - 'UriFileJobOutput', - 'UriFolderDataVersion', - 'UriFolderJobInput', - 'UriFolderJobOutput', - 'Usage', - 'UsageName', - 'UserAccountCredentials', - 'UserAssignedIdentity', - 'UserCreatedAcrAccount', - 'UserCreatedStorageAccount', - 'UserIdentity', - 'UsernamePasswordAuthTypeWorkspaceConnectionProperties', - 'VirtualMachine', - 'VirtualMachineImage', - 'VirtualMachineSchema', - 'VirtualMachineSchemaProperties', - 'VirtualMachineSecrets', - 'VirtualMachineSecretsSchema', - 'VirtualMachineSize', - 'VirtualMachineSizeListResult', - 'VirtualMachineSshCredentials', - 'VolumeDefinition', - 'VolumeOptions', - 'Webhook', - 'Workspace', - 'WorkspaceConnectionAccessKey', - 'WorkspaceConnectionApiKey', - 'WorkspaceConnectionManagedIdentity', - 'WorkspaceConnectionPersonalAccessToken', - 'WorkspaceConnectionPropertiesV2', - 'WorkspaceConnectionPropertiesV2BasicResource', - 'WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult', - 'WorkspaceConnectionServicePrincipal', - 'WorkspaceConnectionSharedAccessSignature', - 'WorkspaceConnectionUpdateParameter', - 'WorkspaceConnectionUsernamePassword', - 'WorkspaceHubConfig', - 'WorkspaceListResult', - 'WorkspacePrivateEndpointResource', - 'WorkspaceUpdateParameters', - 'AllocationState', - 'ApplicationSharingPolicy', - 'AssetProvisioningState', - 'AutoDeleteCondition', - 'AutoRebuildSetting', - 'Autosave', - 'BaseEnvironmentSourceType', - 'BatchDeploymentConfigurationType', - 'BatchLoggingLevel', - 'BatchOutputAction', - 'BillingCurrency', - 'BlockedTransformers', - 'Caching', - 'CategoricalDataDriftMetric', - 'CategoricalDataQualityMetric', - 'CategoricalPredictionDriftMetric', - 'ClassificationModelPerformanceMetric', - 'ClassificationModels', - 'ClassificationMultilabelPrimaryMetrics', - 'ClassificationPrimaryMetrics', - 'ClusterPurpose', - 'ComputeInstanceAuthorizationType', - 'ComputeInstanceState', - 'ComputePowerAction', - 'ComputeType', - 'ConnectionAuthType', - 'ConnectionCategory', - 'ContainerType', - 'CreatedByType', - 'CredentialsType', - 'DataCollectionMode', - 'DataImportSourceType', - 'DataType', - 'DatastoreType', - 'DeploymentProvisioningState', - 'DiagnoseResultLevel', - 'DistributionType', - 'EarlyTerminationPolicyType', - 'EgressPublicNetworkAccessType', - 'EmailNotificationEnableType', - 'EncryptionStatus', - 'EndpointAuthMode', - 'EndpointComputeType', - 'EndpointProvisioningState', - 'EndpointServiceConnectionStatus', - 'EnvironmentType', - 'EnvironmentVariableType', - 'ExportFormatType', - 'FeatureAttributionMetric', - 'FeatureDataType', - 'FeatureLags', - 'FeaturestoreJobType', - 'FeaturizationMode', - 'ForecastHorizonMode', - 'ForecastingModels', - 'ForecastingPrimaryMetrics', - 'GenerationSafetyQualityMetric', - 'GenerationTokenStatisticsMetric', - 'Goal', - 'IdentityConfigurationType', - 'ImageAnnotationType', - 'ImageType', - 'IncrementalDataRefresh', - 'InferencingServerType', - 'InputDeliveryMode', - 'InputPathType', - 'InstanceSegmentationPrimaryMetrics', - 'IsolationMode', - 'JobInputType', - 'JobLimitsType', - 'JobOutputType', - 'JobProvisioningState', - 'JobStatus', - 'JobTier', - 'JobType', - 'KeyType', - 'LearningRateScheduler', - 'ListViewType', - 'LoadBalancerType', - 'LogTrainingMetrics', - 'LogValidationLoss', - 'LogVerbosity', - 'MLAssistConfigurationType', - 'MLFlowAutologgerState', - 'ManagedNetworkStatus', - 'ManagedServiceIdentityType', - 'MaterializationStoreType', - 'MediaType', - 'MlflowAutologger', - 'ModelSize', - 'ModelTaskType', - 'MonitorComputeIdentityType', - 'MonitorComputeType', - 'MonitoringAlertNotificationType', - 'MonitoringFeatureDataType', - 'MonitoringFeatureFilterType', - 'MonitoringInputDataType', - 'MonitoringModelType', - 'MonitoringNotificationMode', - 'MonitoringSignalType', - 'MountAction', - 'MountState', - 'MultiSelect', - 'NCrossValidationsMode', - 'Network', - 'NlpLearningRateScheduler', - 'NodeState', - 'NodesValueType', - 'NumericalDataDriftMetric', - 'NumericalDataQualityMetric', - 'NumericalPredictionDriftMetric', - 'ObjectDetectionPrimaryMetrics', - 'OneLakeArtifactType', - 'OperatingSystemType', - 'OperationName', - 'OperationStatus', - 'OperationTrigger', - 'OrderString', - 'OsType', - 'OutputDeliveryMode', - 'PackageBuildState', - 'PackageInputDeliveryMode', - 'PackageInputType', - 'PendingUploadCredentialType', - 'PendingUploadType', - 'PrivateEndpointConnectionProvisioningState', - 'ProtectionLevel', - 'Protocol', - 'ProvisioningState', - 'ProvisioningStatus', - 'PublicNetworkAccessType', - 'QuotaUnit', - 'RandomSamplingAlgorithmRule', - 'RecurrenceFrequency', - 'ReferenceType', - 'RegressionModelPerformanceMetric', - 'RegressionModels', - 'RegressionPrimaryMetrics', - 'RemoteLoginPortPublicAccess', - 'RollingRateType', - 'RuleAction', - 'RuleCategory', - 'RuleStatus', - 'RuleType', - 'SamplingAlgorithmType', - 'ScaleType', - 'ScheduleActionType', - 'ScheduleListViewType', - 'ScheduleProvisioningState', - 'ScheduleProvisioningStatus', - 'ScheduleStatus', - 'SeasonalityMode', - 'SecretsType', - 'ServiceDataAccessAuthIdentity', - 'ShortSeriesHandlingConfiguration', - 'SkuScaleType', - 'SkuTier', - 'SourceType', - 'SparkJobEntryType', - 'SshPublicAccess', - 'SslConfigStatus', - 'StackMetaLearnerType', - 'Status', - 'StatusMessageLevel', - 'StochasticOptimizer', - 'StorageAccountType', - 'TargetAggregationFunction', - 'TargetLagsMode', - 'TargetRollingWindowSizeMode', - 'TaskType', - 'TextAnnotationType', - 'TrainingMode', - 'TriggerType', - 'UnderlyingResourceAction', - 'UnitOfMeasure', - 'UsageUnit', - 'UseStl', - 'VMPriceOSType', - 'VMTier', - 'ValidationMetricType', - 'VmPriority', - 'VolumeDefinitionType', - 'WebhookType', - 'WeekDay', + "AKS", + "AKSSchema", + "AKSSchemaProperties", + "AccessKeyAuthTypeWorkspaceConnectionProperties", + "AccountKeyDatastoreCredentials", + "AccountKeyDatastoreSecrets", + "AcrDetails", + "AksComputeSecrets", + "AksComputeSecretsProperties", + "AksNetworkingConfiguration", + "AllFeatures", + "AllNodes", + "AmlCompute", + "AmlComputeNodeInformation", + "AmlComputeNodesInformation", + "AmlComputeProperties", + "AmlComputeSchema", + "AmlOperation", + "AmlOperationListResult", + "AmlToken", + "AmlTokenComputeIdentity", + "AmlUserFeature", + "ApiKeyAuthWorkspaceConnectionProperties", + "ArmResourceId", + "AssetBase", + "AssetContainer", + "AssetJobInput", + "AssetJobOutput", + "AssetReferenceBase", + "AssignedUser", + "AutoDeleteSetting", + "AutoForecastHorizon", + "AutoMLJob", + "AutoMLVertical", + "AutoNCrossValidations", + "AutoPauseProperties", + "AutoScaleProperties", + "AutoSeasonality", + "AutoTargetLags", + "AutoTargetRollingWindowSize", + "AutologgerSettings", + "AzMonMonitoringAlertNotificationSettings", + "AzureBlobDatastore", + "AzureDataLakeGen1Datastore", + "AzureDataLakeGen2Datastore", + "AzureDatastore", + "AzureDevOpsWebhook", + "AzureFileDatastore", + "AzureMLBatchInferencingServer", + "AzureMLOnlineInferencingServer", + "BanditPolicy", + "BaseEnvironmentId", + "BaseEnvironmentSource", + "BatchDeployment", + "BatchDeploymentConfiguration", + "BatchDeploymentProperties", + "BatchDeploymentTrackedResourceArmPaginatedResult", + "BatchEndpoint", + "BatchEndpointDefaults", + "BatchEndpointProperties", + "BatchEndpointTrackedResourceArmPaginatedResult", + "BatchPipelineComponentDeploymentConfiguration", + "BatchRetrySettings", + "BayesianSamplingAlgorithm", + "BindOptions", + "BlobReferenceForConsumptionDto", + "BuildContext", + "CategoricalDataDriftMetricThreshold", + "CategoricalDataQualityMetricThreshold", + "CategoricalPredictionDriftMetricThreshold", + "CertificateDatastoreCredentials", + "CertificateDatastoreSecrets", + "Classification", + "ClassificationModelPerformanceMetricThreshold", + "ClassificationTrainingSettings", + "ClusterUpdateParameters", + "CocoExportSummary", + "CodeConfiguration", + "CodeContainer", + "CodeContainerProperties", + "CodeContainerResourceArmPaginatedResult", + "CodeVersion", + "CodeVersionProperties", + "CodeVersionResourceArmPaginatedResult", + "Collection", + "ColumnTransformer", + "CommandJob", + "CommandJobLimits", + "ComponentContainer", + "ComponentContainerProperties", + "ComponentContainerResourceArmPaginatedResult", + "ComponentVersion", + "ComponentVersionProperties", + "ComponentVersionResourceArmPaginatedResult", + "Compute", + "ComputeInstance", + "ComputeInstanceApplication", + "ComputeInstanceAutologgerSettings", + "ComputeInstanceConnectivityEndpoints", + "ComputeInstanceContainer", + "ComputeInstanceCreatedBy", + "ComputeInstanceDataDisk", + "ComputeInstanceDataMount", + "ComputeInstanceEnvironmentInfo", + "ComputeInstanceLastOperation", + "ComputeInstanceProperties", + "ComputeInstanceSchema", + "ComputeInstanceSshSettings", + "ComputeInstanceVersion", + "ComputeResource", + "ComputeResourceSchema", + "ComputeRuntimeDto", + "ComputeSchedules", + "ComputeSecrets", + "ComputeStartStopSchedule", + "ContainerResourceRequirements", + "ContainerResourceSettings", + "CosmosDbSettings", + "CreateMonitorAction", + "Cron", + "CronTrigger", + "CsvExportSummary", + "CustomForecastHorizon", + "CustomInferencingServer", + "CustomKeys", + "CustomKeysWorkspaceConnectionProperties", + "CustomMetricThreshold", + "CustomModelJobInput", + "CustomModelJobOutput", + "CustomMonitoringSignal", + "CustomNCrossValidations", + "CustomSeasonality", + "CustomService", + "CustomTargetLags", + "CustomTargetRollingWindowSize", + "DataCollector", + "DataContainer", + "DataContainerProperties", + "DataContainerResourceArmPaginatedResult", + "DataDriftMetricThresholdBase", + "DataDriftMonitoringSignal", + "DataFactory", + "DataImport", + "DataImportSource", + "DataLakeAnalytics", + "DataLakeAnalyticsSchema", + "DataLakeAnalyticsSchemaProperties", + "DataPathAssetReference", + "DataQualityMetricThresholdBase", + "DataQualityMonitoringSignal", + "DataVersionBase", + "DataVersionBaseProperties", + "DataVersionBaseResourceArmPaginatedResult", + "DatabaseSource", + "Databricks", + "DatabricksComputeSecrets", + "DatabricksComputeSecretsProperties", + "DatabricksProperties", + "DatabricksSchema", + "DatasetExportSummary", + "Datastore", + "DatastoreCredentials", + "DatastoreProperties", + "DatastoreResourceArmPaginatedResult", + "DatastoreSecrets", + "DefaultScaleSettings", + "DeploymentLogs", + "DeploymentLogsRequest", + "DeploymentResourceConfiguration", + "DiagnoseRequestProperties", + "DiagnoseResponseResult", + "DiagnoseResponseResultValue", + "DiagnoseResult", + "DiagnoseWorkspaceParameters", + "DistributionConfiguration", + "Docker", + "EarlyTerminationPolicy", + "EmailMonitoringAlertNotificationSettings", + "EncryptionKeyVaultUpdateProperties", + "EncryptionProperty", + "EncryptionUpdateProperties", + "Endpoint", + "EndpointAuthKeys", + "EndpointAuthToken", + "EndpointDeploymentPropertiesBase", + "EndpointPropertiesBase", + "EndpointScheduleAction", + "EnvironmentContainer", + "EnvironmentContainerProperties", + "EnvironmentContainerResourceArmPaginatedResult", + "EnvironmentVariable", + "EnvironmentVersion", + "EnvironmentVersionProperties", + "EnvironmentVersionResourceArmPaginatedResult", + "ErrorAdditionalInfo", + "ErrorDetail", + "ErrorResponse", + "EstimatedVMPrice", + "EstimatedVMPrices", + "ExportSummary", + "ExternalFQDNResponse", + "FQDNEndpoint", + "FQDNEndpointDetail", + "FQDNEndpoints", + "FQDNEndpointsPropertyBag", + "Feature", + "FeatureAttributionDriftMonitoringSignal", + "FeatureAttributionMetricThreshold", + "FeatureProperties", + "FeatureResourceArmPaginatedResult", + "FeatureStoreSettings", + "FeatureSubset", + "FeatureWindow", + "FeaturesetContainer", + "FeaturesetContainerProperties", + "FeaturesetContainerResourceArmPaginatedResult", + "FeaturesetJob", + "FeaturesetJobArmPaginatedResult", + "FeaturesetSpecification", + "FeaturesetVersion", + "FeaturesetVersionBackfillRequest", + "FeaturesetVersionProperties", + "FeaturesetVersionResourceArmPaginatedResult", + "FeaturestoreEntityContainer", + "FeaturestoreEntityContainerProperties", + "FeaturestoreEntityContainerResourceArmPaginatedResult", + "FeaturestoreEntityVersion", + "FeaturestoreEntityVersionProperties", + "FeaturestoreEntityVersionResourceArmPaginatedResult", + "FeaturizationSettings", + "FileSystemSource", + "FixedInputData", + "FlavorData", + "ForecastHorizon", + "Forecasting", + "ForecastingSettings", + "ForecastingTrainingSettings", + "FqdnOutboundRule", + "GenerationSafetyQualityMetricThreshold", + "GenerationSafetyQualityMonitoringSignal", + "GenerationTokenStatisticsMetricThreshold", + "GenerationTokenStatisticsSignal", + "GridSamplingAlgorithm", + "HDInsight", + "HDInsightProperties", + "HDInsightSchema", + "HdfsDatastore", + "IdAssetReference", + "IdentityConfiguration", + "IdentityForCmk", + "IdleShutdownSetting", + "Image", + "ImageClassification", + "ImageClassificationBase", + "ImageClassificationMultilabel", + "ImageInstanceSegmentation", + "ImageLimitSettings", + "ImageMetadata", + "ImageModelDistributionSettings", + "ImageModelDistributionSettingsClassification", + "ImageModelDistributionSettingsObjectDetection", + "ImageModelSettings", + "ImageModelSettingsClassification", + "ImageModelSettingsObjectDetection", + "ImageObjectDetection", + "ImageObjectDetectionBase", + "ImageSweepSettings", + "ImageVertical", + "ImportDataAction", + "IndexColumn", + "InferenceContainerProperties", + "InferencingServer", + "InstanceTypeSchema", + "InstanceTypeSchemaResources", + "IntellectualProperty", + "JobBase", + "JobBaseProperties", + "JobBaseResourceArmPaginatedResult", + "JobInput", + "JobLimits", + "JobOutput", + "JobResourceConfiguration", + "JobScheduleAction", + "JobService", + "KerberosCredentials", + "KerberosKeytabCredentials", + "KerberosKeytabSecrets", + "KerberosPasswordCredentials", + "KerberosPasswordSecrets", + "KeyVaultProperties", + "Kubernetes", + "KubernetesOnlineDeployment", + "KubernetesProperties", + "KubernetesSchema", + "LabelCategory", + "LabelClass", + "LabelingDataConfiguration", + "LabelingJob", + "LabelingJobImageProperties", + "LabelingJobInstructions", + "LabelingJobMediaProperties", + "LabelingJobProperties", + "LabelingJobResourceArmPaginatedResult", + "LabelingJobTextProperties", + "LakeHouseArtifact", + "ListAmlUserFeatureResult", + "ListNotebookKeysResult", + "ListStorageAccountKeysResult", + "ListUsagesResult", + "ListWorkspaceKeysResult", + "ListWorkspaceQuotas", + "LiteralJobInput", + "MLAssistConfiguration", + "MLAssistConfigurationDisabled", + "MLAssistConfigurationEnabled", + "MLFlowModelJobInput", + "MLFlowModelJobOutput", + "MLTableData", + "MLTableJobInput", + "MLTableJobOutput", + "ManagedComputeIdentity", + "ManagedIdentity", + "ManagedIdentityAuthTypeWorkspaceConnectionProperties", + "ManagedNetworkProvisionOptions", + "ManagedNetworkProvisionStatus", + "ManagedNetworkSettings", + "ManagedOnlineDeployment", + "ManagedServiceIdentity", + "MaterializationComputeResource", + "MaterializationSettings", + "MedianStoppingPolicy", + "ModelConfiguration", + "ModelContainer", + "ModelContainerProperties", + "ModelContainerResourceArmPaginatedResult", + "ModelPackageInput", + "ModelPerformanceMetricThresholdBase", + "ModelPerformanceSignal", + "ModelVersion", + "ModelVersionProperties", + "ModelVersionResourceArmPaginatedResult", + "MonitorComputeConfigurationBase", + "MonitorComputeIdentityBase", + "MonitorDefinition", + "MonitorServerlessSparkCompute", + "MonitoringAlertNotificationSettingsBase", + "MonitoringDataSegment", + "MonitoringFeatureFilterBase", + "MonitoringInputDataBase", + "MonitoringSignalBase", + "MonitoringTarget", + "MonitoringThreshold", + "MonitoringWorkspaceConnection", + "Mpi", + "NCrossValidations", + "NlpFixedParameters", + "NlpParameterSubspace", + "NlpSweepSettings", + "NlpVertical", + "NlpVerticalFeaturizationSettings", + "NlpVerticalLimitSettings", + "NodeStateCounts", + "Nodes", + "NoneAuthTypeWorkspaceConnectionProperties", + "NoneDatastoreCredentials", + "NotebookAccessTokenResult", + "NotebookPreparationError", + "NotebookResourceInfo", + "NotificationSetting", + "NumericalDataDriftMetricThreshold", + "NumericalDataQualityMetricThreshold", + "NumericalPredictionDriftMetricThreshold", + "Objective", + "OneLakeArtifact", + "OneLakeDatastore", + "OnlineDeployment", + "OnlineDeploymentProperties", + "OnlineDeploymentTrackedResourceArmPaginatedResult", + "OnlineEndpoint", + "OnlineEndpointProperties", + "OnlineEndpointTrackedResourceArmPaginatedResult", + "OnlineInferenceConfiguration", + "OnlineRequestSettings", + "OnlineScaleSettings", + "OperationDisplay", + "OutboundRule", + "OutboundRuleBasicResource", + "OutboundRuleListResult", + "OutputPathAssetReference", + "PATAuthTypeWorkspaceConnectionProperties", + "PackageInputPathBase", + "PackageInputPathId", + "PackageInputPathUrl", + "PackageInputPathVersion", + "PackageRequest", + "PackageResponse", + "PaginatedComputeResourcesList", + "PartialBatchDeployment", + "PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties", + "PartialJobBase", + "PartialJobBasePartialResource", + "PartialManagedServiceIdentity", + "PartialMinimalTrackedResource", + "PartialMinimalTrackedResourceWithIdentity", + "PartialMinimalTrackedResourceWithSku", + "PartialNotificationSetting", + "PartialRegistryPartialTrackedResource", + "PartialSku", + "Password", + "PendingUploadCredentialDto", + "PendingUploadRequestDto", + "PendingUploadResponseDto", + "PersonalComputeInstanceSettings", + "PipelineJob", + "PredictionDriftMetricThresholdBase", + "PredictionDriftMonitoringSignal", + "PrivateEndpoint", + "PrivateEndpointConnection", + "PrivateEndpointConnectionListResult", + "PrivateEndpointDestination", + "PrivateEndpointOutboundRule", + "PrivateEndpointResource", + "PrivateLinkResource", + "PrivateLinkResourceListResult", + "PrivateLinkServiceConnectionState", + "ProbeSettings", + "ProgressMetrics", + "PyTorch", + "QueueSettings", + "QuotaBaseProperties", + "QuotaUpdateParameters", + "RandomSamplingAlgorithm", + "Ray", + "Recurrence", + "RecurrenceSchedule", + "RecurrenceTrigger", + "RegenerateEndpointKeysRequest", + "Registry", + "RegistryListCredentialsResult", + "RegistryPartialManagedServiceIdentity", + "RegistryPrivateEndpointConnection", + "RegistryPrivateLinkServiceConnectionState", + "RegistryRegionArmDetails", + "RegistryTrackedResourceArmPaginatedResult", + "Regression", + "RegressionModelPerformanceMetricThreshold", + "RegressionTrainingSettings", + "RequestLogging", + "Resource", + "ResourceBase", + "ResourceConfiguration", + "ResourceId", + "ResourceName", + "ResourceQuota", + "Route", + "SASAuthTypeWorkspaceConnectionProperties", + "SASCredentialDto", + "SamplingAlgorithm", + "SasDatastoreCredentials", + "SasDatastoreSecrets", + "ScaleSettings", + "ScaleSettingsInformation", + "Schedule", + "ScheduleActionBase", + "ScheduleBase", + "ScheduleProperties", + "ScheduleResourceArmPaginatedResult", + "ScriptReference", + "ScriptsToExecute", + "Seasonality", + "SecretConfiguration", + "ServiceManagedResourcesSettings", + "ServicePrincipalAuthTypeWorkspaceConnectionProperties", + "ServicePrincipalDatastoreCredentials", + "ServicePrincipalDatastoreSecrets", + "ServiceTagDestination", + "ServiceTagOutboundRule", + "SetupScripts", + "SharedPrivateLinkResource", + "Sku", + "SkuCapacity", + "SkuResource", + "SkuResourceArmPaginatedResult", + "SkuSetting", + "SparkJob", + "SparkJobEntry", + "SparkJobPythonEntry", + "SparkJobScalaEntry", + "SparkResourceConfiguration", + "SslConfiguration", + "StackEnsembleSettings", + "StaticInputData", + "StatusMessage", + "StorageAccountDetails", + "SweepJob", + "SweepJobLimits", + "SynapseSpark", + "SynapseSparkProperties", + "SystemCreatedAcrAccount", + "SystemCreatedStorageAccount", + "SystemData", + "SystemService", + "TableFixedParameters", + "TableParameterSubspace", + "TableSweepSettings", + "TableVertical", + "TableVerticalFeaturizationSettings", + "TableVerticalLimitSettings", + "TargetLags", + "TargetRollingWindowSize", + "TargetUtilizationScaleSettings", + "TensorFlow", + "TextClassification", + "TextClassificationMultilabel", + "TextNer", + "TmpfsOptions", + "TopNFeaturesByAttribution", + "TrackedResource", + "TrailingInputData", + "TrainingSettings", + "TrialComponent", + "TriggerBase", + "TritonInferencingServer", + "TritonModelJobInput", + "TritonModelJobOutput", + "TruncationSelectionPolicy", + "UpdateWorkspaceQuotas", + "UpdateWorkspaceQuotasResult", + "UriFileDataVersion", + "UriFileJobInput", + "UriFileJobOutput", + "UriFolderDataVersion", + "UriFolderJobInput", + "UriFolderJobOutput", + "Usage", + "UsageName", + "UserAccountCredentials", + "UserAssignedIdentity", + "UserCreatedAcrAccount", + "UserCreatedStorageAccount", + "UserIdentity", + "UsernamePasswordAuthTypeWorkspaceConnectionProperties", + "VirtualMachine", + "VirtualMachineImage", + "VirtualMachineSchema", + "VirtualMachineSchemaProperties", + "VirtualMachineSecrets", + "VirtualMachineSecretsSchema", + "VirtualMachineSize", + "VirtualMachineSizeListResult", + "VirtualMachineSshCredentials", + "VolumeDefinition", + "VolumeOptions", + "Webhook", + "Workspace", + "WorkspaceConnectionAccessKey", + "WorkspaceConnectionApiKey", + "WorkspaceConnectionManagedIdentity", + "WorkspaceConnectionPersonalAccessToken", + "WorkspaceConnectionPropertiesV2", + "WorkspaceConnectionPropertiesV2BasicResource", + "WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult", + "WorkspaceConnectionServicePrincipal", + "WorkspaceConnectionSharedAccessSignature", + "WorkspaceConnectionUpdateParameter", + "WorkspaceConnectionUsernamePassword", + "WorkspaceHubConfig", + "WorkspaceListResult", + "WorkspacePrivateEndpointResource", + "WorkspaceUpdateParameters", + "AllocationState", + "ApplicationSharingPolicy", + "AssetProvisioningState", + "AutoDeleteCondition", + "AutoRebuildSetting", + "Autosave", + "BaseEnvironmentSourceType", + "BatchDeploymentConfigurationType", + "BatchLoggingLevel", + "BatchOutputAction", + "BillingCurrency", + "BlockedTransformers", + "Caching", + "CategoricalDataDriftMetric", + "CategoricalDataQualityMetric", + "CategoricalPredictionDriftMetric", + "ClassificationModelPerformanceMetric", + "ClassificationModels", + "ClassificationMultilabelPrimaryMetrics", + "ClassificationPrimaryMetrics", + "ClusterPurpose", + "ComputeInstanceAuthorizationType", + "ComputeInstanceState", + "ComputePowerAction", + "ComputeType", + "ConnectionAuthType", + "ConnectionCategory", + "ContainerType", + "CreatedByType", + "CredentialsType", + "DataCollectionMode", + "DataImportSourceType", + "DataType", + "DatastoreType", + "DeploymentProvisioningState", + "DiagnoseResultLevel", + "DistributionType", + "EarlyTerminationPolicyType", + "EgressPublicNetworkAccessType", + "EmailNotificationEnableType", + "EncryptionStatus", + "EndpointAuthMode", + "EndpointComputeType", + "EndpointProvisioningState", + "EndpointServiceConnectionStatus", + "EnvironmentType", + "EnvironmentVariableType", + "ExportFormatType", + "FeatureAttributionMetric", + "FeatureDataType", + "FeatureLags", + "FeaturestoreJobType", + "FeaturizationMode", + "ForecastHorizonMode", + "ForecastingModels", + "ForecastingPrimaryMetrics", + "GenerationSafetyQualityMetric", + "GenerationTokenStatisticsMetric", + "Goal", + "IdentityConfigurationType", + "ImageAnnotationType", + "ImageType", + "IncrementalDataRefresh", + "InferencingServerType", + "InputDeliveryMode", + "InputPathType", + "InstanceSegmentationPrimaryMetrics", + "IsolationMode", + "JobInputType", + "JobLimitsType", + "JobOutputType", + "JobProvisioningState", + "JobStatus", + "JobTier", + "JobType", + "KeyType", + "LearningRateScheduler", + "ListViewType", + "LoadBalancerType", + "LogTrainingMetrics", + "LogValidationLoss", + "LogVerbosity", + "MLAssistConfigurationType", + "MLFlowAutologgerState", + "ManagedNetworkStatus", + "ManagedServiceIdentityType", + "MaterializationStoreType", + "MediaType", + "MlflowAutologger", + "ModelSize", + "ModelTaskType", + "MonitorComputeIdentityType", + "MonitorComputeType", + "MonitoringAlertNotificationType", + "MonitoringFeatureDataType", + "MonitoringFeatureFilterType", + "MonitoringInputDataType", + "MonitoringModelType", + "MonitoringNotificationMode", + "MonitoringSignalType", + "MountAction", + "MountState", + "MultiSelect", + "NCrossValidationsMode", + "Network", + "NlpLearningRateScheduler", + "NodeState", + "NodesValueType", + "NumericalDataDriftMetric", + "NumericalDataQualityMetric", + "NumericalPredictionDriftMetric", + "ObjectDetectionPrimaryMetrics", + "OneLakeArtifactType", + "OperatingSystemType", + "OperationName", + "OperationStatus", + "OperationTrigger", + "OrderString", + "OsType", + "OutputDeliveryMode", + "PackageBuildState", + "PackageInputDeliveryMode", + "PackageInputType", + "PendingUploadCredentialType", + "PendingUploadType", + "PrivateEndpointConnectionProvisioningState", + "ProtectionLevel", + "Protocol", + "ProvisioningState", + "ProvisioningStatus", + "PublicNetworkAccessType", + "QuotaUnit", + "RandomSamplingAlgorithmRule", + "RecurrenceFrequency", + "ReferenceType", + "RegressionModelPerformanceMetric", + "RegressionModels", + "RegressionPrimaryMetrics", + "RemoteLoginPortPublicAccess", + "RollingRateType", + "RuleAction", + "RuleCategory", + "RuleStatus", + "RuleType", + "SamplingAlgorithmType", + "ScaleType", + "ScheduleActionType", + "ScheduleListViewType", + "ScheduleProvisioningState", + "ScheduleProvisioningStatus", + "ScheduleStatus", + "SeasonalityMode", + "SecretsType", + "ServiceDataAccessAuthIdentity", + "ShortSeriesHandlingConfiguration", + "SkuScaleType", + "SkuTier", + "SourceType", + "SparkJobEntryType", + "SshPublicAccess", + "SslConfigStatus", + "StackMetaLearnerType", + "Status", + "StatusMessageLevel", + "StochasticOptimizer", + "StorageAccountType", + "TargetAggregationFunction", + "TargetLagsMode", + "TargetRollingWindowSizeMode", + "TaskType", + "TextAnnotationType", + "TrainingMode", + "TriggerType", + "UnderlyingResourceAction", + "UnitOfMeasure", + "UsageUnit", + "UseStl", + "VMPriceOSType", + "VMTier", + "ValidationMetricType", + "VmPriority", + "VolumeDefinitionType", + "WebhookType", + "WeekDay", ] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/models/_azure_machine_learning_workspaces_enums.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/models/_azure_machine_learning_workspaces_enums.py index 4b93108750a0..192198339855 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/models/_azure_machine_learning_workspaces_enums.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/models/_azure_machine_learning_workspaces_enums.py @@ -22,7 +22,10 @@ class AllocationState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): STEADY = "Steady" RESIZING = "Resizing" -class ApplicationSharingPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + +class ApplicationSharingPolicy( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): """Policy for sharing applications on this compute instance among users of parent workspace. If Personal, only the creator can access applications on this compute instance. When Shared, any workspace user can access applications on this instance depending on his/her assigned role. @@ -31,9 +34,11 @@ class ApplicationSharingPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum PERSONAL = "Personal" SHARED = "Shared" -class AssetProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Provisioning state of registry asset. - """ + +class AssetProvisioningState( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): + """Provisioning state of registry asset.""" SUCCEEDED = "Succeeded" FAILED = "Failed" @@ -42,39 +47,45 @@ class AssetProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)) UPDATING = "Updating" DELETING = "Deleting" + class AutoDeleteCondition(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): CREATED_GREATER_THAN = "CreatedGreaterThan" LAST_ACCESSED_GREATER_THAN = "LastAccessedGreaterThan" + class AutoRebuildSetting(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """AutoRebuild setting for the derived image - """ + """AutoRebuild setting for the derived image""" DISABLED = "Disabled" ON_BASE_IMAGE_UPDATE = "OnBaseImageUpdate" + class Autosave(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Auto save settings. - """ + """Auto save settings.""" NONE = "None" LOCAL = "Local" REMOTE = "Remote" -class BaseEnvironmentSourceType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Base environment type. - """ + +class BaseEnvironmentSourceType( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): + """Base environment type.""" ENVIRONMENT_ASSET = "EnvironmentAsset" -class BatchDeploymentConfigurationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The enumerated property types for batch deployments. - """ + +class BatchDeploymentConfigurationType( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): + """The enumerated property types for batch deployments.""" MODEL = "Model" PIPELINE_COMPONENT = "PipelineComponent" + class BatchLoggingLevel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Log verbosity for batch inferencing. Increasing verbosity order for logging is : Warning, Info and Debug. @@ -85,22 +96,22 @@ class BatchLoggingLevel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): WARNING = "Warning" DEBUG = "Debug" + class BatchOutputAction(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine how batch inferencing will handle output - """ + """Enum to determine how batch inferencing will handle output""" SUMMARY_ONLY = "SummaryOnly" APPEND_ROW = "AppendRow" + class BillingCurrency(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Three lettered code specifying the currency of the VM price. Example: USD - """ + """Three lettered code specifying the currency of the VM price. Example: USD""" USD = "USD" + class BlockedTransformers(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum for all classification models supported by AutoML. - """ + """Enum for all classification models supported by AutoML.""" #: Target encoding for text data. TEXT_TARGET_ENCODER = "TextTargetEncoder" @@ -127,15 +138,18 @@ class BlockedTransformers(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): #: This is often used for high-cardinality categorical features. HASH_ONE_HOT_ENCODER = "HashOneHotEncoder" + class Caching(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Caching type of Data Disk. - """ + """Caching type of Data Disk.""" NONE = "None" READ_ONLY = "ReadOnly" READ_WRITE = "ReadWrite" -class CategoricalDataDriftMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + +class CategoricalDataDriftMetric( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): #: The Jensen Shannon Distance (JSD) metric. JENSEN_SHANNON_DISTANCE = "JensenShannonDistance" @@ -144,7 +158,10 @@ class CategoricalDataDriftMetric(with_metaclass(CaseInsensitiveEnumMeta, str, En #: The Pearsons Chi Squared Test metric. PEARSONS_CHI_SQUARED_TEST = "PearsonsChiSquaredTest" -class CategoricalDataQualityMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + +class CategoricalDataQualityMetric( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): #: Calculates the rate of null values. NULL_VALUE_RATE = "NullValueRate" @@ -153,7 +170,10 @@ class CategoricalDataQualityMetric(with_metaclass(CaseInsensitiveEnumMeta, str, #: Calculates the rate values are out of bounds. OUT_OF_BOUNDS_RATE = "OutOfBoundsRate" -class CategoricalPredictionDriftMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + +class CategoricalPredictionDriftMetric( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): #: The Jensen Shannon Distance (JSD) metric. JENSEN_SHANNON_DISTANCE = "JensenShannonDistance" @@ -162,7 +182,10 @@ class CategoricalPredictionDriftMetric(with_metaclass(CaseInsensitiveEnumMeta, s #: The Pearsons Chi Squared Test metric. PEARSONS_CHI_SQUARED_TEST = "PearsonsChiSquaredTest" -class ClassificationModelPerformanceMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + +class ClassificationModelPerformanceMetric( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): #: Calculates the accuracy of the model predictions. ACCURACY = "Accuracy" @@ -171,9 +194,9 @@ class ClassificationModelPerformanceMetric(with_metaclass(CaseInsensitiveEnumMet #: Calculates the recall of the model predictions. RECALL = "Recall" + class ClassificationModels(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum for all classification models supported by AutoML. - """ + """Enum for all classification models supported by AutoML.""" #: Logistic regression is a fundamental classification technique. #: It belongs to the group of linear classifiers and is somewhat similar to polynomial and linear @@ -235,9 +258,11 @@ class ClassificationModels(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): #: target column values can be divided into distinct class values. XG_BOOST_CLASSIFIER = "XGBoostClassifier" -class ClassificationMultilabelPrimaryMetrics(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Primary metrics for classification multilabel tasks. - """ + +class ClassificationMultilabelPrimaryMetrics( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): + """Primary metrics for classification multilabel tasks.""" #: AUC is the Area under the curve. #: This metric represents arithmetic mean of the score for each class, @@ -257,9 +282,11 @@ class ClassificationMultilabelPrimaryMetrics(with_metaclass(CaseInsensitiveEnumM #: Intersection Over Union. Intersection of predictions divided by union of predictions. IOU = "IOU" -class ClassificationPrimaryMetrics(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Primary metrics for classification tasks. - """ + +class ClassificationPrimaryMetrics( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): + """Primary metrics for classification tasks.""" #: AUC is the Area under the curve. #: This metric represents arithmetic mean of the score for each class, @@ -277,23 +304,25 @@ class ClassificationPrimaryMetrics(with_metaclass(CaseInsensitiveEnumMeta, str, #: class. PRECISION_SCORE_WEIGHTED = "PrecisionScoreWeighted" + class ClusterPurpose(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Intended usage of the cluster - """ + """Intended usage of the cluster""" FAST_PROD = "FastProd" DENSE_PROD = "DenseProd" DEV_TEST = "DevTest" -class ComputeInstanceAuthorizationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The Compute Instance Authorization type. Available values are personal (default). - """ + +class ComputeInstanceAuthorizationType( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): + """The Compute Instance Authorization type. Available values are personal (default).""" PERSONAL = "personal" + class ComputeInstanceState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Current state of an ComputeInstance. - """ + """Current state of an ComputeInstance.""" CREATING = "Creating" CREATE_FAILED = "CreateFailed" @@ -311,16 +340,16 @@ class ComputeInstanceState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): UNKNOWN = "Unknown" UNUSABLE = "Unusable" + class ComputePowerAction(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """[Required] The compute power action. - """ + """[Required] The compute power action.""" START = "Start" STOP = "Stop" + class ComputeType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The type of compute - """ + """The type of compute""" AKS = "AKS" KUBERNETES = "Kubernetes" @@ -333,9 +362,9 @@ class ComputeType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): DATA_LAKE_ANALYTICS = "DataLakeAnalytics" SYNAPSE_SPARK = "SynapseSpark" + class ConnectionAuthType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Authentication type of the connection target - """ + """Authentication type of the connection target""" PAT = "PAT" MANAGED_IDENTITY = "ManagedIdentity" @@ -347,9 +376,9 @@ class ConnectionAuthType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): API_KEY = "ApiKey" CUSTOM_KEYS = "CustomKeys" + class ConnectionCategory(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Category of the connection - """ + """Category of the connection""" PYTHON_FEED = "PythonFeed" CONTAINER_REGISTRY = "ContainerRegistry" @@ -368,9 +397,9 @@ class ConnectionCategory(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): COGNITIVE_SERVICE = "CognitiveService" CUSTOM_KEYS = "CustomKeys" + class ContainerType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The type of container to retrieve logs from. - """ + """The type of container to retrieve logs from.""" #: The container used to download models and score script. STORAGE_INITIALIZER = "StorageInitializer" @@ -379,18 +408,18 @@ class ContainerType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): #: The container used to collect payload and custom logging when mdc is enabled. MODEL_DATA_COLLECTOR = "ModelDataCollector" + class CreatedByType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The type of identity that created the resource. - """ + """The type of identity that created the resource.""" USER = "User" APPLICATION = "Application" MANAGED_IDENTITY = "ManagedIdentity" KEY = "Key" + class CredentialsType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the datastore credentials type. - """ + """Enum to determine the datastore credentials type.""" ACCOUNT_KEY = "AccountKey" CERTIFICATE = "Certificate" @@ -400,21 +429,22 @@ class CredentialsType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): KERBEROS_KEYTAB = "KerberosKeytab" KERBEROS_PASSWORD = "KerberosPassword" + class DataCollectionMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): ENABLED = "Enabled" DISABLED = "Disabled" + class DataImportSourceType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the type of data. - """ + """Enum to determine the type of data.""" DATABASE = "database" FILE_SYSTEM = "file_system" + class DatastoreType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the datastore contents type. - """ + """Enum to determine the datastore contents type.""" AZURE_BLOB = "AzureBlob" AZURE_DATA_LAKE_GEN1 = "AzureDataLakeGen1" @@ -423,17 +453,19 @@ class DatastoreType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): HDFS = "Hdfs" ONE_LAKE = "OneLake" + class DataType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the type of data. - """ + """Enum to determine the type of data.""" URI_FILE = "uri_file" URI_FOLDER = "uri_folder" MLTABLE = "mltable" -class DeploymentProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Possible values for DeploymentProvisioningState. - """ + +class DeploymentProvisioningState( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): + """Possible values for DeploymentProvisioningState.""" CREATING = "Creating" DELETING = "Deleting" @@ -443,30 +475,36 @@ class DeploymentProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, E FAILED = "Failed" CANCELED = "Canceled" + class DiagnoseResultLevel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Level of workspace setup error - """ + """Level of workspace setup error""" WARNING = "Warning" ERROR = "Error" INFORMATION = "Information" + class DistributionType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the job distribution type. - """ + """Enum to determine the job distribution type.""" PY_TORCH = "PyTorch" TENSOR_FLOW = "TensorFlow" MPI = "Mpi" RAY = "Ray" -class EarlyTerminationPolicyType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + +class EarlyTerminationPolicyType( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): BANDIT = "Bandit" MEDIAN_STOPPING = "MedianStopping" TRUNCATION_SELECTION = "TruncationSelection" -class EgressPublicNetworkAccessType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + +class EgressPublicNetworkAccessType( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): """Enum to determine whether PublicNetworkAccess is Enabled or Disabled for egress of a deployment. """ @@ -474,40 +512,44 @@ class EgressPublicNetworkAccessType(with_metaclass(CaseInsensitiveEnumMeta, str, ENABLED = "Enabled" DISABLED = "Disabled" -class EmailNotificationEnableType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the email notification type. - """ + +class EmailNotificationEnableType( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): + """Enum to determine the email notification type.""" JOB_COMPLETED = "JobCompleted" JOB_FAILED = "JobFailed" JOB_CANCELLED = "JobCancelled" + class EncryptionStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Indicates whether or not the encryption is enabled for the workspace. - """ + """Indicates whether or not the encryption is enabled for the workspace.""" ENABLED = "Enabled" DISABLED = "Disabled" + class EndpointAuthMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine endpoint authentication mode. - """ + """Enum to determine endpoint authentication mode.""" AML_TOKEN = "AMLToken" KEY = "Key" AAD_TOKEN = "AADToken" + class EndpointComputeType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine endpoint compute type. - """ + """Enum to determine endpoint compute type.""" MANAGED = "Managed" KUBERNETES = "Kubernetes" AZURE_ML_COMPUTE = "AzureMLCompute" -class EndpointProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """State of endpoint provisioning. - """ + +class EndpointProvisioningState( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): + """State of endpoint provisioning.""" CREATING = "Creating" DELETING = "Deleting" @@ -516,9 +558,11 @@ class EndpointProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enu UPDATING = "Updating" CANCELED = "Canceled" -class EndpointServiceConnectionStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Connection status of the service consumer with the service provider - """ + +class EndpointServiceConnectionStatus( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): + """Connection status of the service consumer with the service provider""" APPROVED = "Approved" PENDING = "Pending" @@ -526,31 +570,39 @@ class EndpointServiceConnectionStatus(with_metaclass(CaseInsensitiveEnumMeta, st DISCONNECTED = "Disconnected" TIMEOUT = "Timeout" + class EnvironmentType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Environment type is either user created or curated by Azure ML service - """ + """Environment type is either user created or curated by Azure ML service""" CURATED = "Curated" USER_CREATED = "UserCreated" -class EnvironmentVariableType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of the Environment Variable. Possible values are: local - For local variable - """ + +class EnvironmentVariableType( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): + """Type of the Environment Variable. Possible values are: local - For local variable""" LOCAL = "local" + class ExportFormatType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The format of exported labels. - """ + """The format of exported labels.""" DATASET = "Dataset" COCO = "Coco" CSV = "CSV" -class FeatureAttributionMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + +class FeatureAttributionMetric( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): #: The Normalized Discounted Cumulative Gain metric. - NORMALIZED_DISCOUNTED_CUMULATIVE_GAIN = "NormalizedDiscountedCumulativeGain" + NORMALIZED_DISCOUNTED_CUMULATIVE_GAIN = ( + "NormalizedDiscountedCumulativeGain" + ) + class FeatureDataType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): @@ -563,23 +615,24 @@ class FeatureDataType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): DATETIME = "Datetime" BOOLEAN = "Boolean" + class FeatureLags(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Flag for generating lags for the numeric features. - """ + """Flag for generating lags for the numeric features.""" #: No feature lags generated. NONE = "None" #: System auto-generates feature lags. AUTO = "Auto" + class FeaturestoreJobType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): RECURRENT_MATERIALIZATION = "RecurrentMaterialization" BACKFILL_MATERIALIZATION = "BackfillMaterialization" + class FeaturizationMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Featurization mode - determines data featurization mode. - """ + """Featurization mode - determines data featurization mode.""" #: Auto mode, system performs featurization without any custom featurization inputs. AUTO = "Auto" @@ -588,18 +641,18 @@ class FeaturizationMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): #: Featurization off. 'Forecasting' task cannot use this value. OFF = "Off" + class ForecastHorizonMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine forecast horizon selection mode. - """ + """Enum to determine forecast horizon selection mode.""" #: Forecast horizon to be determined automatically. AUTO = "Auto" #: Use the custom forecast horizon. CUSTOM = "Custom" + class ForecastingModels(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum for all forecasting models supported by AutoML. - """ + """Enum for all forecasting models supported by AutoML.""" #: Auto-Autoregressive Integrated Moving Average (ARIMA) model uses time-series data and #: statistical analysis to interpret the data and make future predictions. @@ -676,9 +729,11 @@ class ForecastingModels(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): #: using ensemble of base learners. XG_BOOST_REGRESSOR = "XGBoostRegressor" -class ForecastingPrimaryMetrics(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Primary metrics for Forecasting task. - """ + +class ForecastingPrimaryMetrics( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): + """Primary metrics for Forecasting task.""" #: The Spearman's rank coefficient of correlation is a non-parametric measure of rank correlation. SPEARMAN_CORRELATION = "SpearmanCorrelation" @@ -692,51 +747,66 @@ class ForecastingPrimaryMetrics(with_metaclass(CaseInsensitiveEnumMeta, str, Enu #: Error (MAE) of (time) series with different scales. NORMALIZED_MEAN_ABSOLUTE_ERROR = "NormalizedMeanAbsoluteError" -class GenerationSafetyQualityMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Generation safety quality metric enum. - """ - ACCEPTABLE_GROUNDEDNESS_SCORE_PER_INSTANCE = "AcceptableGroundednessScorePerInstance" +class GenerationSafetyQualityMetric( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): + """Generation safety quality metric enum.""" + + ACCEPTABLE_GROUNDEDNESS_SCORE_PER_INSTANCE = ( + "AcceptableGroundednessScorePerInstance" + ) AGGREGATED_GROUNDEDNESS_PASS_RATE = "AggregatedGroundednessPassRate" - ACCEPTABLE_COHERENCE_SCORE_PER_INSTANCE = "AcceptableCoherenceScorePerInstance" + ACCEPTABLE_COHERENCE_SCORE_PER_INSTANCE = ( + "AcceptableCoherenceScorePerInstance" + ) AGGREGATED_COHERENCE_PASS_RATE = "AggregatedCoherencePassRate" ACCEPTABLE_FLUENCY_SCORE_PER_INSTANCE = "AcceptableFluencyScorePerInstance" AGGREGATED_FLUENCY_PASS_RATE = "AggregatedFluencyPassRate" - ACCEPTABLE_SIMILARITY_SCORE_PER_INSTANCE = "AcceptableSimilarityScorePerInstance" + ACCEPTABLE_SIMILARITY_SCORE_PER_INSTANCE = ( + "AcceptableSimilarityScorePerInstance" + ) AGGREGATED_SIMILARITY_PASS_RATE = "AggregatedSimilarityPassRate" - ACCEPTABLE_RELEVANCE_SCORE_PER_INSTANCE = "AcceptableRelevanceScorePerInstance" + ACCEPTABLE_RELEVANCE_SCORE_PER_INSTANCE = ( + "AcceptableRelevanceScorePerInstance" + ) AGGREGATED_RELEVANCE_PASS_RATE = "AggregatedRelevancePassRate" -class GenerationTokenStatisticsMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Generation token statistics metric enum. - """ + +class GenerationTokenStatisticsMetric( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): + """Generation token statistics metric enum.""" TOTAL_TOKEN_COUNT = "TotalTokenCount" TOTAL_TOKEN_COUNT_PER_GROUP = "TotalTokenCountPerGroup" + class Goal(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Defines supported metric goals for hyperparameter tuning - """ + """Defines supported metric goals for hyperparameter tuning""" MINIMIZE = "Minimize" MAXIMIZE = "Maximize" -class IdentityConfigurationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine identity framework. - """ + +class IdentityConfigurationType( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): + """Enum to determine identity framework.""" MANAGED = "Managed" AML_TOKEN = "AMLToken" USER_IDENTITY = "UserIdentity" + class ImageAnnotationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Annotation type of image data. - """ + """Annotation type of image data.""" CLASSIFICATION = "Classification" BOUNDING_BOX = "BoundingBox" INSTANCE_SEGMENTATION = "InstanceSegmentation" + class ImageType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Type of the image. Possible values are: docker - For docker images. azureml - For AzureML images @@ -745,25 +815,29 @@ class ImageType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): DOCKER = "docker" AZUREML = "azureml" -class IncrementalDataRefresh(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Whether IncrementalDataRefresh is enabled - """ + +class IncrementalDataRefresh( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): + """Whether IncrementalDataRefresh is enabled""" ENABLED = "Enabled" DISABLED = "Disabled" -class InferencingServerType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Inferencing server type for various targets. - """ + +class InferencingServerType( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): + """Inferencing server type for various targets.""" AZURE_ML_ONLINE = "AzureMLOnline" AZURE_ML_BATCH = "AzureMLBatch" TRITON = "Triton" CUSTOM = "Custom" + class InputDeliveryMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the input data delivery mode. - """ + """Enum to determine the input data delivery mode.""" READ_ONLY_MOUNT = "ReadOnlyMount" READ_WRITE_MOUNT = "ReadWriteMount" @@ -772,33 +846,35 @@ class InputDeliveryMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): EVAL_MOUNT = "EvalMount" EVAL_DOWNLOAD = "EvalDownload" + class InputPathType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Input path type for package inputs. - """ + """Input path type for package inputs.""" URL = "Url" PATH_ID = "PathId" PATH_VERSION = "PathVersion" -class InstanceSegmentationPrimaryMetrics(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Primary metrics for InstanceSegmentation tasks. - """ + +class InstanceSegmentationPrimaryMetrics( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): + """Primary metrics for InstanceSegmentation tasks.""" #: Mean Average Precision (MAP) is the average of AP (Average Precision). #: AP is calculated for each class and averaged to get the MAP. MEAN_AVERAGE_PRECISION = "MeanAveragePrecision" + class IsolationMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Isolation mode for the managed network of a machine learning workspace. - """ + """Isolation mode for the managed network of a machine learning workspace.""" DISABLED = "Disabled" ALLOW_INTERNET_OUTBOUND = "AllowInternetOutbound" ALLOW_ONLY_APPROVED_OUTBOUND = "AllowOnlyApprovedOutbound" + class JobInputType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the Job Input Type. - """ + """Enum to determine the Job Input Type.""" LITERAL = "literal" URI_FILE = "uri_file" @@ -808,14 +884,15 @@ class JobInputType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): MLFLOW_MODEL = "mlflow_model" TRITON_MODEL = "triton_model" + class JobLimitsType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): COMMAND = "Command" SWEEP = "Sweep" + class JobOutputType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the Job Output Type. - """ + """Enum to determine the Job Output Type.""" URI_FILE = "uri_file" URI_FOLDER = "uri_folder" @@ -824,18 +901,18 @@ class JobOutputType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): MLFLOW_MODEL = "mlflow_model" TRITON_MODEL = "triton_model" + class JobProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the job provisioning state. - """ + """Enum to determine the job provisioning state.""" SUCCEEDED = "Succeeded" FAILED = "Failed" CANCELED = "Canceled" IN_PROGRESS = "InProgress" + class JobStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The status of a job. - """ + """The status of a job.""" #: Run hasn't started yet. NOT_STARTED = "NotStarted" @@ -873,9 +950,9 @@ class JobStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): #: The job is in a scheduled state. Job is not in any active state. SCHEDULED = "Scheduled" + class JobTier(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the job tier. - """ + """Enum to determine the job tier.""" NULL = "Null" SPOT = "Spot" @@ -883,9 +960,9 @@ class JobTier(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): STANDARD = "Standard" PREMIUM = "Premium" + class JobType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the type of job. - """ + """Enum to determine the type of job.""" AUTO_ML = "AutoML" COMMAND = "Command" @@ -894,14 +971,17 @@ class JobType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): PIPELINE = "Pipeline" SPARK = "Spark" + class KeyType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): PRIMARY = "Primary" SECONDARY = "Secondary" -class LearningRateScheduler(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Learning rate scheduler enum. - """ + +class LearningRateScheduler( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): + """Learning rate scheduler enum.""" #: No learning rate scheduler selected. NONE = "None" @@ -910,19 +990,21 @@ class LearningRateScheduler(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): #: Step learning rate scheduler. STEP = "Step" + class ListViewType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): ACTIVE_ONLY = "ActiveOnly" ARCHIVED_ONLY = "ArchivedOnly" ALL = "All" + class LoadBalancerType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Load Balancer Type - """ + """Load Balancer Type""" PUBLIC_IP = "PublicIp" INTERNAL_LOAD_BALANCER = "InternalLoadBalancer" + class LogTrainingMetrics(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): #: Enable compute and log training metrics. @@ -930,6 +1012,7 @@ class LogTrainingMetrics(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): #: Disable compute and log training metrics. DISABLE = "Disable" + class LogValidationLoss(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): #: Enable compute and log validation metrics. @@ -937,9 +1020,9 @@ class LogValidationLoss(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): #: Disable compute and log validation metrics. DISABLE = "Disable" + class LogVerbosity(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum for setting log verbosity. - """ + """Enum for setting log verbosity.""" #: No logs emitted. NOT_SET = "NotSet" @@ -954,14 +1037,17 @@ class LogVerbosity(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): #: Only critical statements logged. CRITICAL = "Critical" + class ManagedNetworkStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Status for the managed network of a machine learning workspace. - """ + """Status for the managed network of a machine learning workspace.""" INACTIVE = "Inactive" ACTIVE = "Active" -class ManagedServiceIdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + +class ManagedServiceIdentityType( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): """Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). """ @@ -971,42 +1057,50 @@ class ManagedServiceIdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, En USER_ASSIGNED = "UserAssigned" SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" -class MaterializationStoreType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + +class MaterializationStoreType( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): NONE = "None" ONLINE = "Online" OFFLINE = "Offline" ONLINE_AND_OFFLINE = "OnlineAndOffline" + class MediaType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Media type of data asset. - """ + """Media type of data asset.""" IMAGE = "Image" TEXT = "Text" -class MLAssistConfigurationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + +class MLAssistConfigurationType( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): ENABLED = "Enabled" DISABLED = "Disabled" + class MlflowAutologger(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Indicates whether mlflow autologger is enabled for notebooks. - """ + """Indicates whether mlflow autologger is enabled for notebooks.""" ENABLED = "Enabled" DISABLED = "Disabled" -class MLFlowAutologgerState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the state of mlflow autologger. - """ + +class MLFlowAutologgerState( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): + """Enum to determine the state of mlflow autologger.""" ENABLED = "Enabled" DISABLED = "Disabled" + class ModelSize(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Image model size. - """ + """Image model size.""" #: No value selected. NONE = "None" @@ -1019,45 +1113,56 @@ class ModelSize(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): #: Extra large size. EXTRA_LARGE = "ExtraLarge" + class ModelTaskType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Model task type enum. - """ + """Model task type enum.""" CLASSIFICATION = "Classification" REGRESSION = "Regression" QUESTION_ANSWERING = "QuestionAnswering" -class MonitorComputeIdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Monitor compute identity type enum. - """ + +class MonitorComputeIdentityType( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): + """Monitor compute identity type enum.""" #: Authenticates through user's AML token. AML_TOKEN = "AmlToken" #: Authenticates through a user-provided managed identity. MANAGED_IDENTITY = "ManagedIdentity" + class MonitorComputeType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Monitor compute type enum. - """ + """Monitor compute type enum.""" #: Serverless Spark compute. SERVERLESS_SPARK = "ServerlessSpark" -class MonitoringAlertNotificationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + +class MonitoringAlertNotificationType( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): #: Settings for Azure Monitor based alerting. AZURE_MONITOR = "AzureMonitor" #: Settings for AML email notifications. EMAIL = "Email" -class MonitoringFeatureDataType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + +class MonitoringFeatureDataType( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): #: Used for features of numerical data type. NUMERICAL = "Numerical" #: Used for features of categorical data type. CATEGORICAL = "Categorical" -class MonitoringFeatureFilterType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + +class MonitoringFeatureFilterType( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): #: Includes all features. ALL_FEATURES = "AllFeatures" @@ -1066,9 +1171,11 @@ class MonitoringFeatureFilterType(with_metaclass(CaseInsensitiveEnumMeta, str, E #: Includes a user-defined subset of features. FEATURE_SUBSET = "FeatureSubset" -class MonitoringInputDataType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Monitoring input data type enum. - """ + +class MonitoringInputDataType( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): + """Monitoring input data type enum.""" #: An input data with a fixed window size. STATIC = "Static" @@ -1077,6 +1184,7 @@ class MonitoringInputDataType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum) #: An input data with tabular format which doesn't require preprocessing. FIXED = "Fixed" + class MonitoringModelType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): #: A model trained for classification tasks. @@ -1084,13 +1192,17 @@ class MonitoringModelType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): #: A model trained for regressions tasks. REGRESSION = "Regression" -class MonitoringNotificationMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + +class MonitoringNotificationMode( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): #: Disabled notifications will not produce emails/metrics leveraged for alerting. DISABLED = "Disabled" #: Enabled notification will produce emails/metrics leveraged for alerting. ENABLED = "Enabled" + class MonitoringSignalType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): #: Tracks model input data distribution change, comparing against training data or past production @@ -1113,16 +1225,16 @@ class MonitoringSignalType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): #: Tracks the token usage of generative endpoints. GENERATION_TOKEN_STATISTICS = "GenerationTokenStatistics" + class MountAction(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Mount Action. - """ + """Mount Action.""" MOUNT = "Mount" UNMOUNT = "Unmount" + class MountState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Mount state. - """ + """Mount state.""" MOUNT_REQUESTED = "MountRequested" MOUNTED = "Mounted" @@ -1131,16 +1243,18 @@ class MountState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): UNMOUNT_FAILED = "UnmountFailed" UNMOUNTED = "Unmounted" + class MultiSelect(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Whether multiSelect is enabled - """ + """Whether multiSelect is enabled""" ENABLED = "Enabled" DISABLED = "Disabled" -class NCrossValidationsMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Determines how N-Cross validations value is determined. - """ + +class NCrossValidationsMode( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): + """Determines how N-Cross validations value is determined.""" #: Determine N-Cross validations value automatically. Supported only for 'Forecasting' AutoML #: task. @@ -1148,16 +1262,18 @@ class NCrossValidationsMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): #: Use custom N-Cross validations value. CUSTOM = "Custom" + class Network(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """network of this container. - """ + """network of this container.""" BRIDGE = "Bridge" HOST = "Host" -class NlpLearningRateScheduler(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum of learning rate schedulers that aligns with those supported by HF - """ + +class NlpLearningRateScheduler( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): + """Enum of learning rate schedulers that aligns with those supported by HF""" #: No learning rate schedule. NONE = "None" @@ -1174,6 +1290,7 @@ class NlpLearningRateScheduler(with_metaclass(CaseInsensitiveEnumMeta, str, Enum #: Linear warmup followed by constant value. CONSTANT_WITH_WARMUP = "ConstantWithWarmup" + class NodeState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """State of the compute node. Values are idle, running, preparing, unusable, leaving and preempted. @@ -1186,14 +1303,17 @@ class NodeState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): LEAVING = "leaving" PREEMPTED = "preempted" + class NodesValueType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The enumerated types for the nodes value - """ + """The enumerated types for the nodes value""" ALL = "All" CUSTOM = "Custom" -class NumericalDataDriftMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + +class NumericalDataDriftMetric( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): #: The Jensen Shannon Distance (JSD) metric. JENSEN_SHANNON_DISTANCE = "JensenShannonDistance" @@ -1204,7 +1324,10 @@ class NumericalDataDriftMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum #: The Two Sample Kolmogorov-Smirnov Test (two-sample K–S) metric. TWO_SAMPLE_KOLMOGOROV_SMIRNOV_TEST = "TwoSampleKolmogorovSmirnovTest" -class NumericalDataQualityMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + +class NumericalDataQualityMetric( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): #: Calculates the rate of null values. NULL_VALUE_RATE = "NullValueRate" @@ -1213,7 +1336,10 @@ class NumericalDataQualityMetric(with_metaclass(CaseInsensitiveEnumMeta, str, En #: Calculates the rate values are out of bounds. OUT_OF_BOUNDS_RATE = "OutOfBoundsRate" -class NumericalPredictionDriftMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + +class NumericalPredictionDriftMetric( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): #: The Jensen Shannon Distance (JSD) metric. JENSEN_SHANNON_DISTANCE = "JensenShannonDistance" @@ -1224,30 +1350,32 @@ class NumericalPredictionDriftMetric(with_metaclass(CaseInsensitiveEnumMeta, str #: The Two Sample Kolmogorov-Smirnov Test (two-sample K–S) metric. TWO_SAMPLE_KOLMOGOROV_SMIRNOV_TEST = "TwoSampleKolmogorovSmirnovTest" -class ObjectDetectionPrimaryMetrics(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Primary metrics for Image ObjectDetection task. - """ + +class ObjectDetectionPrimaryMetrics( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): + """Primary metrics for Image ObjectDetection task.""" #: Mean Average Precision (MAP) is the average of AP (Average Precision). #: AP is calculated for each class and averaged to get the MAP. MEAN_AVERAGE_PRECISION = "MeanAveragePrecision" + class OneLakeArtifactType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine OneLake artifact type. - """ + """Enum to determine OneLake artifact type.""" LAKE_HOUSE = "LakeHouse" + class OperatingSystemType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The type of operating system. - """ + """The type of operating system.""" LINUX = "Linux" WINDOWS = "Windows" + class OperationName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Name of the last operation. - """ + """Name of the last operation.""" CREATE = "Create" START = "Start" @@ -1256,9 +1384,9 @@ class OperationName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): REIMAGE = "Reimage" DELETE = "Delete" + class OperationStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Operation status. - """ + """Operation status.""" IN_PROGRESS = "InProgress" SUCCEEDED = "Succeeded" @@ -1269,14 +1397,15 @@ class OperationStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): REIMAGE_FAILED = "ReimageFailed" DELETE_FAILED = "DeleteFailed" + class OperationTrigger(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Trigger of operation. - """ + """Trigger of operation.""" USER = "User" SCHEDULE = "Schedule" IDLE_SHUTDOWN = "IdleShutdown" + class OrderString(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): CREATED_AT_DESC = "CreatedAtDesc" @@ -1284,83 +1413,90 @@ class OrderString(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): UPDATED_AT_DESC = "UpdatedAtDesc" UPDATED_AT_ASC = "UpdatedAtAsc" + class OsType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Compute OS Type - """ + """Compute OS Type""" LINUX = "Linux" WINDOWS = "Windows" + class OutputDeliveryMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Output data delivery mode enums. - """ + """Output data delivery mode enums.""" READ_WRITE_MOUNT = "ReadWriteMount" UPLOAD = "Upload" DIRECT = "Direct" + class PackageBuildState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Package build state returned in package response. - """ + """Package build state returned in package response.""" NOT_STARTED = "NotStarted" RUNNING = "Running" SUCCEEDED = "Succeeded" FAILED = "Failed" -class PackageInputDeliveryMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Mounting type of the model or the inputs - """ + +class PackageInputDeliveryMode( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): + """Mounting type of the model or the inputs""" COPY = "Copy" DOWNLOAD = "Download" + class PackageInputType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of the inputs. - """ + """Type of the inputs.""" URI_FILE = "UriFile" URI_FOLDER = "UriFolder" -class PendingUploadCredentialType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the PendingUpload credentials type. - """ + +class PendingUploadCredentialType( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): + """Enum to determine the PendingUpload credentials type.""" SAS = "SAS" + class PendingUploadType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of storage to use for the pending upload location - """ + """Type of storage to use for the pending upload location""" NONE = "None" TEMPORARY_BLOB_REFERENCE = "TemporaryBlobReference" -class PrivateEndpointConnectionProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The current provisioning state. - """ + +class PrivateEndpointConnectionProvisioningState( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): + """The current provisioning state.""" SUCCEEDED = "Succeeded" CREATING = "Creating" DELETING = "Deleting" FAILED = "Failed" + class ProtectionLevel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Protection level associated with the Intellectual Property. - """ + """Protection level associated with the Intellectual Property.""" #: All means Intellectual Property is fully protected. ALL = "All" #: None means it is not an Intellectual Property. NONE = "None" + class Protocol(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Protocol over which communication will happen over this endpoint - """ + """Protocol over which communication will happen over this endpoint""" TCP = "tcp" UDP = "udp" HTTP = "http" + class ProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. @@ -1374,37 +1510,41 @@ class ProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): FAILED = "Failed" CANCELED = "Canceled" + class ProvisioningStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The current deployment state of schedule. - """ + """The current deployment state of schedule.""" COMPLETED = "Completed" PROVISIONING = "Provisioning" FAILED = "Failed" -class PublicNetworkAccessType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine whether PublicNetworkAccess is Enabled or Disabled. - """ + +class PublicNetworkAccessType( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): + """Enum to determine whether PublicNetworkAccess is Enabled or Disabled.""" ENABLED = "Enabled" DISABLED = "Disabled" + class QuotaUnit(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """An enum describing the unit of quota measurement. - """ + """An enum describing the unit of quota measurement.""" COUNT = "Count" -class RandomSamplingAlgorithmRule(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The specific type of random algorithm - """ + +class RandomSamplingAlgorithmRule( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): + """The specific type of random algorithm""" RANDOM = "Random" SOBOL = "Sobol" + class RecurrenceFrequency(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to describe the frequency of a recurrence schedule - """ + """Enum to describe the frequency of a recurrence schedule""" #: Minute frequency. MINUTE = "Minute" @@ -1417,15 +1557,18 @@ class RecurrenceFrequency(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): #: Month frequency. MONTH = "Month" + class ReferenceType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine which reference method to use for an asset. - """ + """Enum to determine which reference method to use for an asset.""" ID = "Id" DATA_PATH = "DataPath" OUTPUT_PATH = "OutputPath" -class RegressionModelPerformanceMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + +class RegressionModelPerformanceMetric( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): #: The Mean Absolute Error (MAE) metric. MEAN_ABSOLUTE_ERROR = "MeanAbsoluteError" @@ -1434,9 +1577,9 @@ class RegressionModelPerformanceMetric(with_metaclass(CaseInsensitiveEnumMeta, s #: The Mean Squared Error (MSE) metric. MEAN_SQUARED_ERROR = "MeanSquaredError" + class RegressionModels(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum for all Regression models supported by AutoML. - """ + """Enum for all Regression models supported by AutoML.""" #: Elastic net is a popular type of regularized linear regression that combines two popular #: penalties, specifically the L1 and L2 penalty functions. @@ -1478,9 +1621,11 @@ class RegressionModels(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): #: using ensemble of base learners. XG_BOOST_REGRESSOR = "XGBoostRegressor" -class RegressionPrimaryMetrics(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Primary metrics for Regression task. - """ + +class RegressionPrimaryMetrics( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): + """Primary metrics for Regression task.""" #: The Spearman's rank coefficient of correlation is a nonparametric measure of rank correlation. SPEARMAN_CORRELATION = "SpearmanCorrelation" @@ -1494,7 +1639,10 @@ class RegressionPrimaryMetrics(with_metaclass(CaseInsensitiveEnumMeta, str, Enum #: Error (MAE) of (time) series with different scales. NORMALIZED_MEAN_ABSOLUTE_ERROR = "NormalizedMeanAbsoluteError" -class RemoteLoginPortPublicAccess(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + +class RemoteLoginPortPublicAccess( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): """State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - Indicates that the public ssh port is closed @@ -1507,6 +1655,7 @@ class RemoteLoginPortPublicAccess(with_metaclass(CaseInsensitiveEnumMeta, str, E DISABLED = "Disabled" NOT_SPECIFIED = "NotSpecified" + class RollingRateType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): YEAR = "Year" @@ -1515,47 +1664,52 @@ class RollingRateType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): HOUR = "Hour" MINUTE = "Minute" + class RuleAction(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The action enum for networking rule. - """ + """The action enum for networking rule.""" ALLOW = "Allow" DENY = "Deny" + class RuleCategory(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Category of a managed network Outbound Rule of a machine learning workspace. - """ + """Category of a managed network Outbound Rule of a machine learning workspace.""" REQUIRED = "Required" RECOMMENDED = "Recommended" USER_DEFINED = "UserDefined" + class RuleStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of a managed network Outbound Rule of a machine learning workspace. - """ + """Type of a managed network Outbound Rule of a machine learning workspace.""" INACTIVE = "Inactive" ACTIVE = "Active" + class RuleType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of a managed network Outbound Rule of a machine learning workspace. - """ + """Type of a managed network Outbound Rule of a machine learning workspace.""" FQDN = "FQDN" PRIVATE_ENDPOINT = "PrivateEndpoint" SERVICE_TAG = "ServiceTag" -class SamplingAlgorithmType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + +class SamplingAlgorithmType( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): GRID = "Grid" RANDOM = "Random" BAYESIAN = "Bayesian" + class ScaleType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): DEFAULT = "Default" TARGET_UTILIZATION = "TargetUtilization" + class ScheduleActionType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): CREATE_JOB = "CreateJob" @@ -1563,21 +1717,27 @@ class ScheduleActionType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): IMPORT_DATA = "ImportData" CREATE_MONITOR = "CreateMonitor" + class ScheduleListViewType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): ENABLED_ONLY = "EnabledOnly" DISABLED_ONLY = "DisabledOnly" ALL = "All" -class ScheduleProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The current deployment state of schedule. - """ + +class ScheduleProvisioningState( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): + """The current deployment state of schedule.""" COMPLETED = "Completed" PROVISIONING = "Provisioning" FAILED = "Failed" -class ScheduleProvisioningStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + +class ScheduleProvisioningStatus( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): CREATING = "Creating" UPDATING = "Updating" @@ -1586,25 +1746,25 @@ class ScheduleProvisioningStatus(with_metaclass(CaseInsensitiveEnumMeta, str, En FAILED = "Failed" CANCELED = "Canceled" + class ScheduleStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Is the schedule enabled or disabled? - """ + """Is the schedule enabled or disabled?""" ENABLED = "Enabled" DISABLED = "Disabled" + class SeasonalityMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Forecasting seasonality mode. - """ + """Forecasting seasonality mode.""" #: Seasonality to be determined automatically. AUTO = "Auto" #: Use the custom seasonality value. CUSTOM = "Custom" + class SecretsType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the datastore secrets type. - """ + """Enum to determine the datastore secrets type.""" ACCOUNT_KEY = "AccountKey" CERTIFICATE = "Certificate" @@ -1613,7 +1773,10 @@ class SecretsType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): KERBEROS_PASSWORD = "KerberosPassword" KERBEROS_KEYTAB = "KerberosKeytab" -class ServiceDataAccessAuthIdentity(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + +class ServiceDataAccessAuthIdentity( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): #: Do not use any identity for service data access. NONE = "None" @@ -1622,9 +1785,11 @@ class ServiceDataAccessAuthIdentity(with_metaclass(CaseInsensitiveEnumMeta, str, #: Use the user assigned managed identity of the Workspace to authenticate service data access. WORKSPACE_USER_ASSIGNED_IDENTITY = "WorkspaceUserAssignedIdentity" -class ShortSeriesHandlingConfiguration(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The parameter defining how if AutoML should handle short time series. - """ + +class ShortSeriesHandlingConfiguration( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): + """The parameter defining how if AutoML should handle short time series.""" #: Represents no/null value. NONE = "None" @@ -1636,9 +1801,9 @@ class ShortSeriesHandlingConfiguration(with_metaclass(CaseInsensitiveEnumMeta, s #: All the short series will be dropped. DROP = "Drop" + class SkuScaleType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Node scaling setting for the compute sku. - """ + """Node scaling setting for the compute sku.""" #: Automatically scales node count. AUTOMATIC = "Automatic" @@ -1647,6 +1812,7 @@ class SkuScaleType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): #: Fixed set of nodes. NONE = "None" + class SkuTier(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT. @@ -1657,19 +1823,21 @@ class SkuTier(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): STANDARD = "Standard" PREMIUM = "Premium" + class SourceType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Data source type. - """ + """Data source type.""" DATASET = "Dataset" DATASTORE = "Datastore" URI = "URI" + class SparkJobEntryType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): SPARK_JOB_PYTHON_ENTRY = "SparkJobPythonEntry" SPARK_JOB_SCALA_ENTRY = "SparkJobScalaEntry" + class SshPublicAccess(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the public ssh port is open and @@ -1679,14 +1847,15 @@ class SshPublicAccess(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): ENABLED = "Enabled" DISABLED = "Disabled" + class SslConfigStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enable or disable ssl for scoring - """ + """Enable or disable ssl for scoring""" DISABLED = "Disabled" ENABLED = "Enabled" AUTO = "Auto" + class StackMetaLearnerType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The meta-learner is a model trained on the output of the individual heterogeneous models. Default meta-learners are LogisticRegression for classification tasks (or LogisticRegressionCV @@ -1709,28 +1878,31 @@ class StackMetaLearnerType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): LIGHT_GBM_REGRESSOR = "LightGBMRegressor" LINEAR_REGRESSION = "LinearRegression" + class Status(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Status of update workspace quota. - """ + """Status of update workspace quota.""" UNDEFINED = "Undefined" SUCCESS = "Success" FAILURE = "Failure" INVALID_QUOTA_BELOW_CLUSTER_MINIMUM = "InvalidQuotaBelowClusterMinimum" - INVALID_QUOTA_EXCEEDS_SUBSCRIPTION_LIMIT = "InvalidQuotaExceedsSubscriptionLimit" + INVALID_QUOTA_EXCEEDS_SUBSCRIPTION_LIMIT = ( + "InvalidQuotaExceedsSubscriptionLimit" + ) INVALID_VM_FAMILY_NAME = "InvalidVMFamilyName" OPERATION_NOT_SUPPORTED_FOR_SKU = "OperationNotSupportedForSku" OPERATION_NOT_ENABLED_FOR_REGION = "OperationNotEnabledForRegion" + class StatusMessageLevel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): ERROR = "Error" INFORMATION = "Information" WARNING = "Warning" + class StochasticOptimizer(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Stochastic optimizer for image models. - """ + """Stochastic optimizer for image models.""" #: No optimizer selected. NONE = "None" @@ -1742,16 +1914,18 @@ class StochasticOptimizer(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): #: AdamW is a variant of the optimizer Adam that has an improved implementation of weight decay. ADAMW = "Adamw" + class StorageAccountType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """type of this storage account. - """ + """type of this storage account.""" STANDARD_LRS = "Standard_LRS" PREMIUM_LRS = "Premium_LRS" -class TargetAggregationFunction(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Target aggregate function. - """ + +class TargetAggregationFunction( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): + """Target aggregate function.""" #: Represent no value set. NONE = "None" @@ -1760,27 +1934,29 @@ class TargetAggregationFunction(with_metaclass(CaseInsensitiveEnumMeta, str, Enu MIN = "Min" MEAN = "Mean" + class TargetLagsMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Target lags selection modes. - """ + """Target lags selection modes.""" #: Target lags to be determined automatically. AUTO = "Auto" #: Use the custom target lags. CUSTOM = "Custom" -class TargetRollingWindowSizeMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Target rolling windows size mode. - """ + +class TargetRollingWindowSizeMode( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): + """Target rolling windows size mode.""" #: Determine rolling windows size automatically. AUTO = "Auto" #: Use the specified rolling window size. CUSTOM = "Custom" + class TaskType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """AutoMLJob Task type. - """ + """AutoMLJob Task type.""" #: Classification in machine learning and statistics is a supervised learning approach in which #: the computer program learns from the data given to it and make new observations or @@ -1821,16 +1997,16 @@ class TaskType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): #: occurrences of entities such as people, locations, organizations, and more. TEXT_NER = "TextNER" + class TextAnnotationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Annotation type of text data. - """ + """Annotation type of text data.""" CLASSIFICATION = "Classification" NAMED_ENTITY_RECOGNITION = "NamedEntityRecognition" + class TrainingMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Training mode dictates whether to use distributed training or not - """ + """Training mode dictates whether to use distributed training or not""" #: Auto mode. AUTO = "Auto" @@ -1839,40 +2015,44 @@ class TrainingMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): #: Non distributed training mode. NON_DISTRIBUTED = "NonDistributed" + class TriggerType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): RECURRENCE = "Recurrence" CRON = "Cron" -class UnderlyingResourceAction(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + +class UnderlyingResourceAction( + with_metaclass(CaseInsensitiveEnumMeta, str, Enum) +): DELETE = "Delete" DETACH = "Detach" + class UnitOfMeasure(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The unit of time measurement for the specified VM price. Example: OneHour - """ + """The unit of time measurement for the specified VM price. Example: OneHour""" ONE_HOUR = "OneHour" + class UsageUnit(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """An enum describing the unit of usage measurement. - """ + """An enum describing the unit of usage measurement.""" COUNT = "Count" + class UseStl(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Configure STL Decomposition of the time-series target column. - """ + """Configure STL Decomposition of the time-series target column.""" #: No stl decomposition. NONE = "None" SEASON = "Season" SEASON_TREND = "SeasonTrend" + class ValidationMetricType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Metric computation method to use for validation metrics in image tasks. - """ + """Metric computation method to use for validation metrics in image tasks.""" #: No metric. NONE = "None" @@ -1883,46 +2063,46 @@ class ValidationMetricType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): #: CocoVoc metric. COCO_VOC = "CocoVoc" + class VMPriceOSType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Operating system type used by the VM. - """ + """Operating system type used by the VM.""" LINUX = "Linux" WINDOWS = "Windows" + class VmPriority(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Virtual Machine priority - """ + """Virtual Machine priority""" DEDICATED = "Dedicated" LOW_PRIORITY = "LowPriority" + class VMTier(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The type of the VM. - """ + """The type of the VM.""" STANDARD = "Standard" LOW_PRIORITY = "LowPriority" SPOT = "Spot" + class VolumeDefinitionType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe - """ + """Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe""" BIND = "bind" VOLUME = "volume" TMPFS = "tmpfs" NPIPE = "npipe" + class WebhookType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum to determine the webhook callback service type. - """ + """Enum to determine the webhook callback service type.""" AZURE_DEV_OPS = "AzureDevOps" + class WeekDay(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Enum of weekday - """ + """Enum of weekday""" #: Monday weekday. MONDAY = "Monday" diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/__init__.py index 46cd9a8ab550..ad57127a5f0f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/__init__.py @@ -12,16 +12,32 @@ from ._compute_operations import ComputeOperations from ._registries_operations import RegistriesOperations from ._workspace_features_operations import WorkspaceFeaturesOperations -from ._registry_code_containers_operations import RegistryCodeContainersOperations +from ._registry_code_containers_operations import ( + RegistryCodeContainersOperations, +) from ._registry_code_versions_operations import RegistryCodeVersionsOperations -from ._registry_component_containers_operations import RegistryComponentContainersOperations -from ._registry_component_versions_operations import RegistryComponentVersionsOperations -from ._registry_data_containers_operations import RegistryDataContainersOperations +from ._registry_component_containers_operations import ( + RegistryComponentContainersOperations, +) +from ._registry_component_versions_operations import ( + RegistryComponentVersionsOperations, +) +from ._registry_data_containers_operations import ( + RegistryDataContainersOperations, +) from ._registry_data_versions_operations import RegistryDataVersionsOperations -from ._registry_environment_containers_operations import RegistryEnvironmentContainersOperations -from ._registry_environment_versions_operations import RegistryEnvironmentVersionsOperations -from ._registry_model_containers_operations import RegistryModelContainersOperations -from ._registry_model_versions_operations import RegistryModelVersionsOperations +from ._registry_environment_containers_operations import ( + RegistryEnvironmentContainersOperations, +) +from ._registry_environment_versions_operations import ( + RegistryEnvironmentVersionsOperations, +) +from ._registry_model_containers_operations import ( + RegistryModelContainersOperations, +) +from ._registry_model_versions_operations import ( + RegistryModelVersionsOperations, +) from ._batch_endpoints_operations import BatchEndpointsOperations from ._batch_deployments_operations import BatchDeploymentsOperations from ._code_containers_operations import CodeContainersOperations @@ -36,8 +52,12 @@ from ._featureset_containers_operations import FeaturesetContainersOperations from ._features_operations import FeaturesOperations from ._featureset_versions_operations import FeaturesetVersionsOperations -from ._featurestore_entity_containers_operations import FeaturestoreEntityContainersOperations -from ._featurestore_entity_versions_operations import FeaturestoreEntityVersionsOperations +from ._featurestore_entity_containers_operations import ( + FeaturestoreEntityContainersOperations, +) +from ._featurestore_entity_versions_operations import ( + FeaturestoreEntityVersionsOperations, +) from ._jobs_operations import JobsOperations from ._labeling_jobs_operations import LabelingJobsOperations from ._model_containers_operations import ModelContainersOperations @@ -48,56 +68,62 @@ from ._operations import Operations from ._workspaces_operations import WorkspacesOperations from ._workspace_connections_operations import WorkspaceConnectionsOperations -from ._managed_network_settings_rule_operations import ManagedNetworkSettingsRuleOperations -from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._managed_network_settings_rule_operations import ( + ManagedNetworkSettingsRuleOperations, +) +from ._private_endpoint_connections_operations import ( + PrivateEndpointConnectionsOperations, +) from ._private_link_resources_operations import PrivateLinkResourcesOperations -from ._managed_network_provisions_operations import ManagedNetworkProvisionsOperations +from ._managed_network_provisions_operations import ( + ManagedNetworkProvisionsOperations, +) __all__ = [ - 'UsagesOperations', - 'VirtualMachineSizesOperations', - 'QuotasOperations', - 'ComputeOperations', - 'RegistriesOperations', - 'WorkspaceFeaturesOperations', - 'RegistryCodeContainersOperations', - 'RegistryCodeVersionsOperations', - 'RegistryComponentContainersOperations', - 'RegistryComponentVersionsOperations', - 'RegistryDataContainersOperations', - 'RegistryDataVersionsOperations', - 'RegistryEnvironmentContainersOperations', - 'RegistryEnvironmentVersionsOperations', - 'RegistryModelContainersOperations', - 'RegistryModelVersionsOperations', - 'BatchEndpointsOperations', - 'BatchDeploymentsOperations', - 'CodeContainersOperations', - 'CodeVersionsOperations', - 'ComponentContainersOperations', - 'ComponentVersionsOperations', - 'DataContainersOperations', - 'DataVersionsOperations', - 'DatastoresOperations', - 'EnvironmentContainersOperations', - 'EnvironmentVersionsOperations', - 'FeaturesetContainersOperations', - 'FeaturesOperations', - 'FeaturesetVersionsOperations', - 'FeaturestoreEntityContainersOperations', - 'FeaturestoreEntityVersionsOperations', - 'JobsOperations', - 'LabelingJobsOperations', - 'ModelContainersOperations', - 'ModelVersionsOperations', - 'OnlineEndpointsOperations', - 'OnlineDeploymentsOperations', - 'SchedulesOperations', - 'Operations', - 'WorkspacesOperations', - 'WorkspaceConnectionsOperations', - 'ManagedNetworkSettingsRuleOperations', - 'PrivateEndpointConnectionsOperations', - 'PrivateLinkResourcesOperations', - 'ManagedNetworkProvisionsOperations', + "UsagesOperations", + "VirtualMachineSizesOperations", + "QuotasOperations", + "ComputeOperations", + "RegistriesOperations", + "WorkspaceFeaturesOperations", + "RegistryCodeContainersOperations", + "RegistryCodeVersionsOperations", + "RegistryComponentContainersOperations", + "RegistryComponentVersionsOperations", + "RegistryDataContainersOperations", + "RegistryDataVersionsOperations", + "RegistryEnvironmentContainersOperations", + "RegistryEnvironmentVersionsOperations", + "RegistryModelContainersOperations", + "RegistryModelVersionsOperations", + "BatchEndpointsOperations", + "BatchDeploymentsOperations", + "CodeContainersOperations", + "CodeVersionsOperations", + "ComponentContainersOperations", + "ComponentVersionsOperations", + "DataContainersOperations", + "DataVersionsOperations", + "DatastoresOperations", + "EnvironmentContainersOperations", + "EnvironmentVersionsOperations", + "FeaturesetContainersOperations", + "FeaturesOperations", + "FeaturesetVersionsOperations", + "FeaturestoreEntityContainersOperations", + "FeaturestoreEntityVersionsOperations", + "JobsOperations", + "LabelingJobsOperations", + "ModelContainersOperations", + "ModelVersionsOperations", + "OnlineEndpointsOperations", + "OnlineDeploymentsOperations", + "SchedulesOperations", + "Operations", + "WorkspacesOperations", + "WorkspaceConnectionsOperations", + "ManagedNetworkSettingsRuleOperations", + "PrivateEndpointConnectionsOperations", + "PrivateLinkResourcesOperations", + "ManagedNetworkProvisionsOperations", ] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_batch_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_batch_deployments_operations.py index 79f792ce46d8..851a345ab817 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_batch_deployments_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_batch_deployments_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -250,6 +262,7 @@ def build_create_or_update_request_initial( **kwargs ) + # fmt: on class BatchDeploymentsOperations(object): """BatchDeploymentsOperations operations. @@ -308,16 +321,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.BatchDeploymentTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeploymentTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -327,13 +347,13 @@ def prepare_request(next_link=None): order_by=order_by, top=top, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -351,7 +371,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("BatchDeploymentTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "BatchDeploymentTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -360,25 +383,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -389,15 +418,18 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -405,34 +437,47 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -468,14 +513,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -483,29 +533,37 @@ def begin_delete( # pylint: disable=inconsistent-return-statements endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def get( @@ -534,15 +592,20 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.BatchDeployment :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -550,32 +613,39 @@ def get( endpoint_name=endpoint_name, deployment_name=deployment_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize("BatchDeployment", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore def _update_initial( self, @@ -587,16 +657,27 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.BatchDeployment"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchDeployment"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.BatchDeployment"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties') + error_map.update(kwargs.pop("error_map", {})) + + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + + _json = self._serialize.body( + body, + "PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties", + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -607,40 +688,55 @@ def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def begin_update( @@ -682,15 +778,24 @@ def begin_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -700,32 +805,38 @@ def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore def _create_or_update_initial( self, @@ -737,16 +848,24 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.BatchDeployment" - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'BatchDeployment') + _json = self._serialize.body(body, "BatchDeployment") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -757,39 +876,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchDeployment', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -830,15 +965,24 @@ def begin_create_or_update( ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchDeployment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchDeployment"] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchDeployment"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -848,29 +992,39 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchDeployment', pipeline_response) + deserialized = self._deserialize( + "BatchDeployment", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_batch_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_batch_endpoints_operations.py index 70dab97e902c..37446c018677 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_batch_endpoints_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_batch_endpoints_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -26,8 +32,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -276,6 +288,7 @@ def build_list_keys_request( **kwargs ) + # fmt: on class BatchEndpointsOperations(object): """BatchEndpointsOperations operations. @@ -328,16 +341,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.BatchEndpointTrackedResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.BatchEndpointTrackedResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -345,13 +365,13 @@ def prepare_request(next_link=None): api_version=api_version, count=count, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -367,7 +387,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("BatchEndpointTrackedResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "BatchEndpointTrackedResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -376,25 +399,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -404,49 +433,65 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs # type: Any ): # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace def begin_delete( # pylint: disable=inconsistent-return-statements @@ -479,43 +524,56 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType[None] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "location"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace def get( @@ -541,47 +599,57 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.BatchEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize("BatchEndpoint", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore def _update_initial( self, @@ -592,16 +660,26 @@ def _update_initial( **kwargs # type: Any ): # type: (...) -> Optional["_models.BatchEndpoint"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BatchEndpoint"]] + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Optional["_models.BatchEndpoint"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PartialMinimalTrackedResourceWithIdentity') + _json = self._serialize.body( + body, "PartialMinimalTrackedResourceWithIdentity" + ) request = build_update_request_initial( subscription_id=self._config.subscription_id, @@ -611,40 +689,55 @@ def _update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + template_url=self._update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if response.status_code == 202: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Location"] = self._deserialize( + "str", response.headers.get("Location") + ) + response_headers["Retry-After"] = self._deserialize( + "int", response.headers.get("Retry-After") + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace def begin_update( @@ -682,15 +775,22 @@ def begin_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -699,32 +799,38 @@ def begin_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore def _create_or_update_initial( self, @@ -735,16 +841,22 @@ def _create_or_update_initial( **kwargs # type: Any ): # type: (...) -> "_models.BatchEndpoint" - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'BatchEndpoint') + _json = self._serialize.body(body, "BatchEndpoint") request = build_create_or_update_request_initial( subscription_id=self._config.subscription_id, @@ -754,39 +866,55 @@ def _create_or_update_initial( api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + raise HttpResponseError( + response=response, error_format=ARMErrorFormat + ) response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if response.status_code == 201: - response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) - response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) - - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + response_headers["x-ms-async-operation-timeout"] = ( + self._deserialize( + "duration", + response.headers.get("x-ms-async-operation-timeout"), + ) + ) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace def begin_create_or_update( @@ -823,15 +951,22 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.BatchEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchEndpoint"] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] + polling = kwargs.pop( + "polling", True + ) # type: Union[bool, PollingMethod] + cls = kwargs.pop("cls", None) # type: ClsType["_models.BatchEndpoint"] lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval + "polling_interval", self._config.polling_interval ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + cont_token = kwargs.pop( + "continuation_token", None + ) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -840,32 +975,42 @@ def begin_create_or_update( body=body, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = self._deserialize('BatchEndpoint', pipeline_response) + deserialized = self._deserialize( + "BatchEndpoint", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + if polling is True: + polling_method = ARMPolling( + lro_delay, + lro_options={"final-state-via": "original-uri"}, + **kwargs + ) + elif polling is False: + polling_method = NoPolling() + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller( + self._client, raw_result, get_long_running_output, polling_method + ) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace def list_keys( @@ -891,44 +1036,56 @@ def list_keys( :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointAuthKeys"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.EndpointAuthKeys"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_list_keys_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, endpoint_name=endpoint_name, api_version=api_version, - template_url=self.list_keys.metadata['url'], + template_url=self.list_keys.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('EndpointAuthKeys', pipeline_response) + deserialized = self._deserialize("EndpointAuthKeys", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys"} # type: ignore - + list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_code_containers_operations.py index c5ff4c33ad4e..ac2007b96b61 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_code_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_code_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -190,6 +202,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class CodeContainersOperations(object): """CodeContainersOperations operations. @@ -239,29 +252,36 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, api_version=api_version, skip=skip, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -276,7 +296,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("CodeContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeContainerResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -285,25 +307,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -329,43 +357,53 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore @distributed_trace def get( @@ -391,47 +429,57 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize("CodeContainer", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore @distributed_trace def create_or_update( @@ -460,16 +508,22 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeContainer"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeContainer') + _json = self._serialize.body(body, "CodeContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -479,33 +533,44 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('CodeContainer', pipeline_response) + deserialized = self._deserialize( + "CodeContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_code_versions_operations.py index f1de7af3ac9e..9b7a57d1dcdd 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_code_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_code_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -254,6 +266,7 @@ def build_create_or_get_start_pending_upload_request( **kwargs ) + # fmt: on class CodeVersionsOperations(object): """CodeVersionsOperations operations. @@ -319,16 +332,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.CodeVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.CodeVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -340,13 +360,13 @@ def prepare_request(next_link=None): skip=skip, hash=hash, hash_version=hash_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -366,7 +386,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("CodeVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "CodeVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -375,25 +397,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -422,15 +450,18 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -438,28 +469,35 @@ def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -488,15 +526,18 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -504,32 +545,39 @@ def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace def create_or_update( @@ -561,16 +609,22 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CodeVersion"] + cls = kwargs.pop("cls", None) # type: ClsType["_models.CodeVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'CodeVersion') + _json = self._serialize.body(body, "CodeVersion") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -581,36 +635,43 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('CodeVersion', pipeline_response) + deserialized = self._deserialize("CodeVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace def create_or_get_start_pending_upload( @@ -642,16 +703,24 @@ def create_or_get_start_pending_upload( :rtype: ~azure.mgmt.machinelearningservices.models.PendingUploadResponseDto :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PendingUploadResponseDto"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.PendingUploadResponseDto"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'PendingUploadRequestDto') + _json = self._serialize.body(body, "PendingUploadRequestDto") request = build_create_or_get_start_pending_upload_request( subscription_id=self._config.subscription_id, @@ -662,29 +731,40 @@ def create_or_get_start_pending_upload( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_get_start_pending_upload.metadata['url'], + template_url=self.create_or_get_start_pending_upload.metadata[ + "url" + ], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('PendingUploadResponseDto', pipeline_response) + deserialized = self._deserialize( + "PendingUploadResponseDto", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_get_start_pending_upload.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/startPendingUpload"} # type: ignore - + create_or_get_start_pending_upload.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/startPendingUpload"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_component_containers_operations.py index 0e50ab30dd63..10d665d99ea3 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_component_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_component_containers_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -193,6 +205,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class ComponentContainersOperations(object): """ComponentContainersOperations operations. @@ -245,16 +258,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentContainerResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainerResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -262,13 +282,13 @@ def prepare_request(next_link=None): api_version=api_version, skip=skip, list_view_type=list_view_type, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -284,7 +304,10 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentContainerResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentContainerResourceArmPaginatedResult", + pipeline_response, + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -293,25 +316,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -337,43 +366,53 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore @distributed_trace def get( @@ -399,47 +438,61 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workspace_name=workspace_name, name=name, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore @distributed_trace def create_or_update( @@ -468,16 +521,24 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentContainer"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentContainer"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentContainer') + _json = self._serialize.body(body, "ComponentContainer") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -487,33 +548,44 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ComponentContainer', pipeline_response) + deserialized = self._deserialize( + "ComponentContainer", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_component_versions_operations.py index 92880f9568d1..cdcd38a0e9f5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_component_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_component_versions_operations.py @@ -10,7 +10,13 @@ from msrest import Serializer -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse @@ -24,8 +30,14 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + T = TypeVar("T") + ClsType = Optional[ + Callable[ + [PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], + Any, + ] + ] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -210,6 +222,7 @@ def build_create_or_update_request( **kwargs ) + # fmt: on class ComponentVersionsOperations(object): """ComponentVersionsOperations operations. @@ -274,16 +287,23 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.ComponentVersionResourceArmPaginatedResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersionResourceArmPaginatedResult"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) + def prepare_request(next_link=None): if not next_link: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -295,13 +315,13 @@ def prepare_request(next_link=None): skip=skip, list_view_type=list_view_type, stage=stage, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: - + request = build_list_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -321,7 +341,9 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentVersionResourceArmPaginatedResult", pipeline_response) + deserialized = self._deserialize( + "ComponentVersionResourceArmPaginatedResult", pipeline_response + ) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -330,25 +352,31 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -377,15 +405,18 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] + cls = kwargs.pop("cls", None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_delete_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -393,28 +424,35 @@ def delete( # pylint: disable=inconsistent-return-statements name=name, version=version, api_version=api_version, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -443,15 +481,20 @@ def get( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str - request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, @@ -459,32 +502,39 @@ def get( name=name, version=version, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize("ComponentVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace def create_or_update( @@ -516,16 +566,24 @@ def create_or_update( :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentVersion"] + cls = kwargs.pop( + "cls", None + ) # type: ClsType["_models.ComponentVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {})) - api_version = kwargs.pop('api_version', "2023-06-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop( + "api_version", "2023-06-01-preview" + ) # type: str + content_type = kwargs.pop( + "content_type", "application/json" + ) # type: Optional[str] - _json = self._serialize.body(body, 'ComponentVersion') + _json = self._serialize.body(body, "ComponentVersion") request = build_create_or_update_request( subscription_id=self._config.subscription_id, @@ -536,33 +594,44 @@ def create_or_update( api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = ( + self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) ) response = pipeline_response.http_response if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + map_error( + status_code=response.status_code, + response=response, + error_map=error_map, + ) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, pipeline_response + ) + raise HttpResponseError( + response=response, model=error, error_format=ARMErrorFormat + ) if response.status_code == 200: - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if response.status_code == 201: - deserialized = self._deserialize('ComponentVersion', pipeline_response) + deserialized = self._deserialize( + "ComponentVersion", pipeline_response + ) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_deployment/batch/pipeline_component_batch_deployment_schema.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_deployment/batch/pipeline_component_batch_deployment_schema.py index f580a1521751..9435ee3e6494 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_deployment/batch/pipeline_component_batch_deployment_schema.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_deployment/batch/pipeline_component_batch_deployment_schema.py @@ -13,8 +13,7 @@ PathAwareSchema, PipelineNodeNameStr, StringTransformedEnum, - TypeSensitiveUnionField, -) + TypeSensitiveUnionField) from azure.ai.ml._schema.pipeline.pipeline_component import PipelineComponentFileRefField from azure.ai.ml.constants._common import AzureMLResourceType from azure.ai.ml.constants._component import NodeType @@ -41,7 +40,7 @@ class PipelineComponentBatchDeploymentSchema(PathAwareSchema): job_definition = UnionField( [ ArmStr(azureml_type=AzureMLResourceType.JOB), - NestedField("PipelineSchema", unknown=INCLUDE), + NestedField("PipelineSchema"), ] ) tags = fields.Dict() @@ -50,8 +49,7 @@ class PipelineComponentBatchDeploymentSchema(PathAwareSchema): @post_load def make(self, data: Any, **kwargs: Any) -> Any: # pylint: disable=unused-argument from azure.ai.ml.entities._deployment.pipeline_component_batch_deployment import ( - PipelineComponentBatchDeployment, - ) + PipelineComponentBatchDeployment) return PipelineComponentBatchDeployment(**data) @@ -62,11 +60,10 @@ def _get_field_name(self) -> str: def PipelineJobsField(): - pipeline_enable_job_type = {NodeType.PIPELINE: [NestedField("PipelineSchema", unknown=INCLUDE)]} + pipeline_enable_job_type = {NodeType.PIPELINE: [NestedField("PipelineSchema")]} pipeline_job_field = fields.Dict( keys=NodeNameStr(), - values=TypeSensitiveUnionField(pipeline_enable_job_type), - ) + values=TypeSensitiveUnionField(pipeline_enable_job_type)) return pipeline_job_field diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_feature_store/feature_store_schema.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_feature_store/feature_store_schema.py index 78fb06424875..88a168fdf07b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_feature_store/feature_store_schema.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_feature_store/feature_store_schema.py @@ -36,8 +36,7 @@ class FeatureStoreSchema(PathAwareSchema): image_build_compute = fields.Str() public_network_access = StringTransformedEnum( allowed_values=[PublicNetworkAccess.DISABLED, PublicNetworkAccess.ENABLED], - casing_transform=snake_to_pascal, - ) + casing_transform=snake_to_pascal) identity = NestedField(IdentitySchema) primary_user_assigned_identity = fields.Str() - managed_network = NestedField(ManagedNetworkSchema, unknown=EXCLUDE) + managed_network = NestedField(ManagedNetworkSchema) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/assets/index.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/assets/index.py index 4a97c0abfda8..039c337a7546 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/assets/index.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/assets/index.py @@ -14,7 +14,7 @@ class IndexAssetSchema(ArtifactSchema): name = fields.Str(required=True, allow_none=False) id = ArmStr(azureml_type=AzureMLResourceType.INDEX, dump_only=True) - stage = fields.Str(default="Development") + stage = fields.Str(load_default="Development") path = fields.Str( required=True, metadata={ diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/component/command_component.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/component/command_component.py index 9d688ee0726a..9d83a6b821de 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/component/command_component.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/component/command_component.py @@ -12,8 +12,7 @@ from azure.ai.ml._schema.component.component import ComponentSchema from azure.ai.ml._schema.component.input_output import ( OutputPortSchema, - PrimitiveOutputSchema, -) + PrimitiveOutputSchema) from azure.ai.ml._schema.component.resource import ComponentResourceSchema from azure.ai.ml._schema.core.schema_meta import PatchedSchemaMeta from azure.ai.ml._schema.core.fields import ( @@ -21,14 +20,12 @@ FileRefField, NestedField, StringTransformedEnum, - UnionField, -) + UnionField) from azure.ai.ml._schema.job.distribution import ( MPIDistributionSchema, PyTorchDistributionSchema, TensorFlowDistributionSchema, - RayDistributionSchema, -) + RayDistributionSchema) from azure.ai.ml._schema.job.parameterized_command import ParameterizedCommandSchema from azure.ai.ml._utils.utils import is_private_preview_enabled from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY, AzureDevopsArtifactsType @@ -50,26 +47,24 @@ class Meta: exclude = ["environment_variables"] # component doesn't have environment variables type = StringTransformedEnum(allowed_values=[NodeType.COMMAND]) - resources = NestedField(ComponentResourceSchema, unknown=INCLUDE) + resources = NestedField(ComponentResourceSchema) distribution = UnionField( [ - NestedField(MPIDistributionSchema, unknown=INCLUDE), - NestedField(TensorFlowDistributionSchema, unknown=INCLUDE), - NestedField(PyTorchDistributionSchema, unknown=INCLUDE), - ExperimentalField(NestedField(RayDistributionSchema, unknown=INCLUDE)), + NestedField(MPIDistributionSchema), + NestedField(TensorFlowDistributionSchema), + NestedField(PyTorchDistributionSchema), + ExperimentalField(NestedField(RayDistributionSchema)), ], - metadata={"description": "Provides the configuration for a distributed run."}, - ) + metadata={"description": "Provides the configuration for a distributed run."}) # primitive output is only supported for command component & pipeline component outputs = fields.Dict( keys=fields.Str(), values=UnionField( [ NestedField(OutputPortSchema), - NestedField(PrimitiveOutputSchema, unknown=INCLUDE), + NestedField(PrimitiveOutputSchema), ] - ), - ) + )) properties = fields.Dict(keys=fields.Str(), values=fields.Raw()) # Note: AzureDevopsArtifactsSchema only available when private preview flag opened before init of command component @@ -115,8 +110,7 @@ def make(self, data, **kwargs): return CommandComponent( base_path=self.context[BASE_PATH_CONTEXT_KEY], _source=ComponentSource.YAML_JOB, - **data, - ) + **data) class ComponentFileRefField(FileRefField): @@ -129,9 +123,9 @@ def _deserialize(self, value, attr, data, **kwargs): # Update base_path to parent path of component file. component_schema_context = deepcopy(self.context) component_schema_context[BASE_PATH_CONTEXT_KEY] = source_path.parent - component = AnonymousCommandComponentSchema(context=component_schema_context).load( - component_dict, unknown=INCLUDE - ) + component = AnonymousCommandComponentSchema().load( + component_dict + , context=component_schema_context) component._source_path = source_path component._source = ComponentSource.YAML_COMPONENT return component diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/component/data_transfer_component.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/component/data_transfer_component.py index 70035d578f7b..c0dc470da1de 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/component/data_transfer_component.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/component/data_transfer_component.py @@ -20,8 +20,7 @@ NodeType, DataTransferTaskType, DataCopyMode, - ExternalDataType, -) + ExternalDataType) class DataTransferComponentSchemaMixin(ComponentSchema): @@ -35,8 +34,7 @@ class DataTransferCopyComponentSchema(DataTransferComponentSchemaMixin): ) inputs = fields.Dict( keys=fields.Str(), - values=NestedField(InputPortSchema), - ) + values=NestedField(InputPortSchema)) @validates("outputs") def outputs_key(self, value): @@ -75,8 +73,7 @@ class DataTransferImportComponentSchema(DataTransferComponentSchemaMixin): source = NestedField(SinkSourceSchema, required=True) outputs = fields.Dict( keys=fields.Str(), - values=NestedField(SinkOutputsSchema), - ) + values=NestedField(SinkOutputsSchema)) @validates("inputs") def inputs_key(self, value): @@ -95,8 +92,7 @@ class DataTransferExportComponentSchema(DataTransferComponentSchemaMixin): task = StringTransformedEnum(allowed_values=[DataTransferTaskType.EXPORT_DATA], required=True) inputs = fields.Dict( keys=fields.Str(), - values=NestedField(SourceInputsSchema), - ) + values=NestedField(SourceInputsSchema)) sink = NestedField(SinkSourceSchema(), required=True) @validates("inputs") @@ -153,8 +149,7 @@ def make(self, data, **kwargs): return DataTransferCopyComponent( base_path=self.context[BASE_PATH_CONTEXT_KEY], _source=kwargs.pop("_source", ComponentSource.YAML_JOB), - **data, - ) + **data) # pylint: disable-next=name-too-long @@ -176,8 +171,7 @@ def make(self, data, **kwargs): return DataTransferImportComponent( base_path=self.context[BASE_PATH_CONTEXT_KEY], _source=kwargs.pop("_source", ComponentSource.YAML_JOB), - **data, - ) + **data) # pylint: disable-next=name-too-long @@ -199,8 +193,7 @@ def make(self, data, **kwargs): return DataTransferExportComponent( base_path=self.context[BASE_PATH_CONTEXT_KEY], _source=kwargs.pop("_source", ComponentSource.YAML_JOB), - **data, - ) + **data) class DataTransferCopyComponentFileRefField(FileRefField): @@ -213,9 +206,9 @@ def _deserialize(self, value, attr, data, **kwargs): # Update base_path to parent path of component file. component_schema_context = deepcopy(self.context) component_schema_context[BASE_PATH_CONTEXT_KEY] = source_path.parent - component = AnonymousDataTransferCopyComponentSchema(context=component_schema_context).load( - component_dict, unknown=INCLUDE - ) + component = AnonymousDataTransferCopyComponentSchema().load( + component_dict + , context=component_schema_context) component._source_path = source_path component._source = ComponentSource.YAML_COMPONENT return component @@ -231,9 +224,9 @@ def _deserialize(self, value, attr, data, **kwargs): # Update base_path to parent path of component file. component_schema_context = deepcopy(self.context) component_schema_context[BASE_PATH_CONTEXT_KEY] = source_path.parent - component = AnonymousDataTransferImportComponentSchema(context=component_schema_context).load( - component_dict, unknown=INCLUDE - ) + component = AnonymousDataTransferImportComponentSchema().load( + component_dict + , context=component_schema_context) component._source_path = source_path component._source = ComponentSource.YAML_COMPONENT return component @@ -249,9 +242,9 @@ def _deserialize(self, value, attr, data, **kwargs): # Update base_path to parent path of component file. component_schema_context = deepcopy(self.context) component_schema_context[BASE_PATH_CONTEXT_KEY] = source_path.parent - component = AnonymousDataTransferExportComponentSchema(context=component_schema_context).load( - component_dict, unknown=INCLUDE - ) + component = AnonymousDataTransferExportComponentSchema().load( + component_dict + , context=component_schema_context) component._source_path = source_path component._source = ComponentSource.YAML_COMPONENT return component diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/component/import_component.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/component/import_component.py index b0ec14ea8aa3..6387568bfb9a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/component/import_component.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/component/import_component.py @@ -23,8 +23,7 @@ class Meta: source = fields.Dict( keys=fields.Str(validate=validate.OneOf(["type", "connection", "query", "path"])), values=NestedField(ParameterSchema), - required=True, - ) + required=True) output = NestedField(OutputPortSchema, required=True) @@ -52,8 +51,7 @@ def make(self, data, **kwargs): # pylint: disable=unused-argument return ImportComponent( base_path=self.context[BASE_PATH_CONTEXT_KEY], _source=ComponentSource.YAML_JOB, - **data, - ) + **data) class ImportComponentFileRefField(FileRefField): @@ -66,9 +64,9 @@ def _deserialize(self, value, attr, data, **kwargs): # Update base_path to parent path of component file. component_schema_context = deepcopy(self.context) component_schema_context[BASE_PATH_CONTEXT_KEY] = source_path.parent - component = AnonymousImportComponentSchema(context=component_schema_context).load( - component_dict, unknown=INCLUDE - ) + component = AnonymousImportComponentSchema().load( + component_dict + , context=component_schema_context) component._source_path = source_path component._source = ComponentSource.YAML_COMPONENT return component diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/component/parallel_component.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/component/parallel_component.py index 70f286a99d62..2cf4973f4c93 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/component/parallel_component.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/component/parallel_component.py @@ -21,29 +21,26 @@ class ParallelComponentSchema(ComponentSchema): type = StringTransformedEnum(allowed_values=[NodeType.PARALLEL], required=True) - resources = NestedField(ComponentResourceSchema, unknown=INCLUDE) + resources = NestedField(ComponentResourceSchema) logging_level = DumpableEnumField( allowed_values=[LoggingLevel.DEBUG, LoggingLevel.INFO, LoggingLevel.WARN], dump_default=LoggingLevel.INFO, metadata={ "description": "A string of the logging level name, which is defined in 'logging'. \ Possible values are 'WARNING', 'INFO', and 'DEBUG'." - }, - ) - task = NestedField(ComponentParallelTaskSchema, unknown=INCLUDE) + }) + task = NestedField(ComponentParallelTaskSchema) mini_batch_size = fields.Str( - metadata={"description": "The The batch size of current job."}, - ) + metadata={"description": "The The batch size of current job."}) partition_keys = fields.List( fields.Str(), metadata={"description": "The keys used to partition input data into mini-batches"} ) input_data = fields.Str() - retry_settings = NestedField(RetrySettingsSchema, unknown=INCLUDE) + retry_settings = NestedField(RetrySettingsSchema) max_concurrency_per_instance = fields.Integer( dump_default=1, - metadata={"description": "The max parallellism that each compute instance has."}, - ) + metadata={"description": "The max parallellism that each compute instance has."}) error_threshold = fields.Integer( dump_default=-1, metadata={ @@ -51,8 +48,7 @@ class ParallelComponentSchema(ComponentSchema): If the error_threshold is reached, the job terminates. \ For a list of files as inputs, one item means one file reference. \ This setting doesn't apply to command parallelization." - }, - ) + }) mini_batch_error_threshold = fields.Integer( dump_default=-1, metadata={ @@ -61,8 +57,7 @@ class ParallelComponentSchema(ComponentSchema): For a list of files as inputs, one item means one file reference. \ This setting can be used by either command or python function parallelization. \ Only one error_threshold setting can be used in one job." - }, - ) + }) class RestParallelComponentSchema(ParallelComponentSchema): @@ -86,8 +81,7 @@ def make(self, data, **kwargs): return ParallelComponent( base_path=self.context[BASE_PATH_CONTEXT_KEY], _source=kwargs.pop("_source", ComponentSource.YAML_JOB), - **data, - ) + **data) class ParallelComponentFileRefField(FileRefField): @@ -100,9 +94,9 @@ def _deserialize(self, value, attr, data, **kwargs): # Update base_path to parent path of component file. component_schema_context = deepcopy(self.context) component_schema_context[BASE_PATH_CONTEXT_KEY] = source_path.parent - component = AnonymousParallelComponentSchema(context=component_schema_context).load( - component_dict, unknown=INCLUDE - ) + component = AnonymousParallelComponentSchema().load( + component_dict + , context=component_schema_context) component._source_path = source_path component._source = ComponentSource.YAML_COMPONENT return component diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/component/spark_component.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/component/spark_component.py index 445481ecb271..9e7e7d3d8195 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/component/spark_component.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/component/spark_component.py @@ -57,8 +57,7 @@ def make(self, data, **kwargs): return SparkComponent( base_path=self.context[BASE_PATH_CONTEXT_KEY], _source=kwargs.pop("_source", ComponentSource.YAML_JOB), - **data, - ) + **data) class SparkComponentFileRefField(FileRefField): @@ -71,9 +70,9 @@ def _deserialize(self, value, attr, data, **kwargs): # Update base_path to parent path of component file. component_schema_context = deepcopy(self.context) component_schema_context[BASE_PATH_CONTEXT_KEY] = source_path.parent - component = AnonymousSparkComponentSchema(context=component_schema_context).load( - component_dict, unknown=INCLUDE - ) + component = AnonymousSparkComponentSchema().load( + component_dict + , context=component_schema_context) component._source_path = source_path component._source = ComponentSource.YAML_COMPONENT return component diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/core/fields.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/core/fields.py index fd7956b85bb0..7c799b2b827d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/core/fields.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/core/fields.py @@ -11,13 +11,14 @@ import traceback import typing from abc import abstractmethod +from datetime import datetime from pathlib import Path from typing import List, Optional, Union from marshmallow import RAISE, fields from marshmallow.exceptions import ValidationError from marshmallow.fields import Field, Nested -from marshmallow.utils import FieldInstanceResolutionError, from_iso_datetime, resolve_field_instance + from ..._utils._arm_id_utils import AMLVersionedArmId, is_ARM_id_for_resource, parse_name_label, parse_name_version from ..._utils._experimental import _is_warning_cached @@ -47,13 +48,50 @@ T = typing.TypeVar("T") +def _resolve_field_instance(cls_or_instance): + """ + Helper function to replace marshmallow.utils.resolve_field_instance + which was removed in marshmallow 4.x. + + Returns a field instance from either a field class or field instance. + """ + if isinstance(cls_or_instance, Field): + # Already a field instance + return cls_or_instance + elif isinstance(cls_or_instance, type) and issubclass(cls_or_instance, Field): + # Field class, instantiate it + return cls_or_instance() + else: + # Not a valid field class or instance + raise ValueError( + f'Expected a field class or instance, got {cls_or_instance!r}' + ) + + +def _filter_field_kwargs(**kwargs): + """ + Helper function to filter kwargs to only include parameters that are + valid for marshmallow 4.x Field constructor. + + Returns a dict containing only valid Field parameters. + """ + valid_field_params = {} + for param in ['load_default', 'dump_default', 'missing', 'allow_none', 'validate', + 'required', 'load_only', 'dump_only', 'error_messages', 'metadata', 'data_key']: + if param in kwargs: + valid_field_params[param] = kwargs[param] + return valid_field_params + + class StringTransformedEnum(Field): def __init__(self, **kwargs): - # pop marshmallow unknown args to avoid warnings + # Extract custom parameters that are not supported by Field in marshmallow 4.x self.allowed_values = kwargs.pop("allowed_values", None) self.casing_transform = kwargs.pop("casing_transform", lambda x: x.lower()) self.pass_original = kwargs.pop("pass_original", False) - super().__init__(**kwargs) + + # Only pass valid Field parameters to parent constructor + super().__init__(**_filter_field_kwargs(**kwargs)) if isinstance(self.allowed_values, str): self.allowed_values = [self.allowed_values] self.allowed_values = [self.casing_transform(x) for x in self.allowed_values] @@ -100,8 +138,8 @@ class LocalPathField(fields.Str): def __init__(self, allow_dir=True, allow_file=True, **kwargs): self._allow_dir = allow_dir self._allow_file = allow_file - self._pattern = kwargs.get("pattern", None) - super().__init__() + self._pattern = kwargs.pop("pattern", None) + super().__init__(**kwargs) def _jsonschema_type_mapping(self): schema = {"type": "string", "arm_type": LOCAL_PATH} @@ -249,7 +287,12 @@ def _serialize(self, value, attr, obj, **kwargs): def _validate(self, value): try: - from_iso_datetime(value) + # Replace marshmallow's from_iso_datetime with Python's built-in datetime parsing + # This supports ISO 8601 format parsing starting from Python 3.7 + if not isinstance(value, str): + raise ValueError("Value must be a string") + # Handle Z suffix by replacing with +00:00 for ISO 8601 compatibility + datetime.fromisoformat(value.replace('Z', '+00:00')) except Exception as e: raise ValidationError(f"Not a valid ISO8601-formatted datetime string: {value}") from e @@ -258,9 +301,12 @@ class ArmStr(Field): """A string represents an ARM ID for some AzureML resource.""" def __init__(self, **kwargs): + # Extract custom parameters that are not supported by Field in marshmallow 4.x self.azureml_type = kwargs.pop("azureml_type", None) self.pattern = kwargs.pop("pattern", r"^azureml:.+") - super().__init__(**kwargs) + + # Only pass valid Field parameters to parent constructor + super().__init__(**_filter_field_kwargs(**kwargs)) def _jsonschema_type_mapping(self): schema = { @@ -312,6 +358,7 @@ class ArmVersionedStr(ArmStr): """A string represents an ARM ID for some AzureML resource with version.""" def __init__(self, **kwargs): + # Extract custom parameters that are not supported by Field in marshmallow 4.x self.allow_default_version = kwargs.pop("allow_default_version", False) super().__init__(**kwargs) @@ -415,11 +462,12 @@ def _serialize(self, value: typing.Any, attr: str, obj: typing.Any, **kwargs): class NestedField(Nested): - """anticipates the default coming in next marshmallow version, unknown=True.""" + """Nested field compatible with marshmallow 4.x - unknown parameter handled at schema level.""" def __init__(self, *args, **kwargs): - if kwargs.get("unknown") is None: - kwargs["unknown"] = RAISE + # In marshmallow 4.x, 'unknown' parameter is not accepted by field constructors + # Remove it from kwargs to avoid TypeError + kwargs.pop("unknown", None) super().__init__(*args, **kwargs) @@ -432,16 +480,20 @@ class UnionField(fields.Field): """A field that can be one of multiple types.""" def __init__(self, union_fields: List[fields.Field], is_strict=False, **kwargs): - super().__init__(**kwargs) + # Store custom parameter separately + self.is_strict = is_strict + + # Only pass valid Field parameters to parent constructor + super().__init__(**_filter_field_kwargs(**kwargs)) try: # add the validation and make sure union_fields must be subclasses or instances of - # marshmallow.base.FieldABC - self._union_fields = [resolve_field_instance(cls_or_instance) for cls_or_instance in union_fields] + # marshmallow.Field + self._union_fields = [_resolve_field_instance(cls_or_instance) for cls_or_instance in union_fields] # TODO: make serialization/de-serialization work in the same way as json schema when is_strict is True - self.is_strict = is_strict # S\When True, combine fields with oneOf instead of anyOf at schema generation - except FieldInstanceResolutionError as error: + # When True, combine fields with oneOf instead of anyOf at schema generation + except ValueError as error: raise ValueError( - 'Elements of "union_fields" must be subclasses or instances of marshmallow.base.FieldABC.' + 'Elements of "union_fields" must be subclasses or instances of marshmallow.Field.' ) from error @property @@ -549,7 +601,7 @@ def __init__( for type_name, type_sensitive_fields in type_sensitive_fields_dict.items(): union_fields.extend(type_sensitive_fields) self._type_sensitive_fields_dict[type_name] = [ - resolve_field_instance(cls_or_instance) for cls_or_instance in type_sensitive_fields + _resolve_field_instance(cls_or_instance) for cls_or_instance in type_sensitive_fields ] super(TypeSensitiveUnionField, self).__init__(union_fields, **kwargs) @@ -874,11 +926,11 @@ class ExperimentalField(fields.Field): def __init__(self, experimental_field: fields.Field, **kwargs): super().__init__(**kwargs) try: - self._experimental_field = resolve_field_instance(experimental_field) + self._experimental_field = _resolve_field_instance(experimental_field) self.required = experimental_field.required - except FieldInstanceResolutionError as error: + except ValueError as error: raise ValueError( - '"experimental_field" must be subclasses or instances of marshmallow.base.FieldABC.' + '"experimental_field" must be subclasses or instances of marshmallow.Field.' ) from error @property @@ -908,8 +960,11 @@ class RegistryStr(Field): """A string represents a registry ID for some AzureML resource.""" def __init__(self, **kwargs): + # Extract custom parameters that are not supported by Field in marshmallow 4.x self.azureml_type = kwargs.pop("azureml_type", None) - super().__init__(**kwargs) + + # Only pass valid Field parameters to parent constructor + super().__init__(**_filter_field_kwargs(**kwargs)) def _jsonschema_type_mapping(self): schema = { diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/core/schema.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/core/schema.py index 062575bced10..a58baf3f26e3 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/core/schema.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/core/schema.py @@ -17,6 +17,7 @@ from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY, FILE_PREFIX, PARAMS_OVERRIDE_KEY from azure.ai.ml.exceptions import MlException + module_logger = logging.getLogger(__name__) @@ -32,7 +33,22 @@ def __init__(self, *args, **kwargs): # set old base path, note it's an Path object and point to the same object with # self.context.get(BASE_PATH_CONTEXT_KEY) self.old_base_path = self.context.get(BASE_PATH_CONTEXT_KEY) - super().__init__(*args, **kwargs) + + # In marshmallow 4.x, filter out unsupported constructor parameters + # Valid parameters for Schema constructor: only, exclude, many, load_only, dump_only, partial + # Note: context is NOT a valid constructor parameter in marshmallow 4.x + valid_schema_params = {'only', 'exclude', 'many', 'load_only', 'dump_only', 'partial'} + filtered_kwargs = {k: v for k, v in kwargs.items() if k in valid_schema_params} + + super().__init__(*args, **filtered_kwargs) + + def load(self, json_data, *, many=None, partial=None, unknown=None): + """Override load to use stored context""" + return super().load(json_data, many=many, partial=partial, unknown=unknown, context=self.context) + + def dump(self, obj, *, many=None): + """Override dump to use stored context""" + return super().dump(obj, many=many, context=self.context) @pre_load def add_param_overrides(self, data, **kwargs): diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/job/parameterized_parallel.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/job/parameterized_parallel.py index bb5cd0638a88..4d313da89ffc 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/job/parameterized_parallel.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/job/parameterized_parallel.py @@ -24,22 +24,19 @@ class ParameterizedParallelSchema(PathAwareSchema): "A string of the logging level name, which is defined in 'logging'. " "Possible values are 'WARNING', 'INFO', and 'DEBUG'." ) - }, - ) - task = NestedField(ComponentParallelTaskSchema, unknown=INCLUDE) + }) + task = NestedField(ComponentParallelTaskSchema) mini_batch_size = fields.Str( - metadata={"description": "The batch size of current job."}, - ) + metadata={"description": "The batch size of current job."}) partition_keys = fields.List( fields.Str(), metadata={"description": "The keys used to partition input data into mini-batches"} ) input_data = fields.Str() resources = NestedField(JobResourceConfigurationSchema) - retry_settings = NestedField(RetrySettingsSchema, unknown=INCLUDE) + retry_settings = NestedField(RetrySettingsSchema) max_concurrency_per_instance = fields.Integer( dump_default=1, - metadata={"description": "The max parallellism that each compute instance has."}, - ) + metadata={"description": "The max parallellism that each compute instance has."}) error_threshold = fields.Integer( dump_default=-1, metadata={ @@ -49,8 +46,7 @@ class ParameterizedParallelSchema(PathAwareSchema): "For a list of files as inputs, one item means one file reference. " "This setting doesn't apply to command parallelization." ) - }, - ) + }) mini_batch_error_threshold = fields.Integer( dump_default=-1, metadata={ @@ -61,8 +57,7 @@ class ParameterizedParallelSchema(PathAwareSchema): "This setting can be used by either command or python function parallelization. " "Only one error_threshold setting can be used in one job." ) - }, - ) + }) environment_variables = UnionField( [ fields.Dict(keys=fields.Str(), values=fields.Str()), diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/monitoring/compute.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/monitoring/compute.py index 483b4ac56e65..71d17738ca07 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/monitoring/compute.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/monitoring/compute.py @@ -6,10 +6,11 @@ from marshmallow import fields, post_load from azure.ai.ml._schema.core.schema import PatchedSchemaMeta +from azure.ai.ml._schema.core.fields import StringTransformedEnum class ComputeConfigurationSchema(metaclass=PatchedSchemaMeta): - compute_type = fields.Str(allowed_values=["ServerlessSpark"]) + compute_type = StringTransformedEnum(allowed_values=["ServerlessSpark"]) class ServerlessSparkComputeSchema(ComputeConfigurationSchema): diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/pipeline/component_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/pipeline/component_job.py index 8f179479d79e..d6302fba014c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/pipeline/component_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/pipeline/component_job.py @@ -19,8 +19,7 @@ DataTransferCopyComponentFileRefField, ImportComponentFileRefField, ParallelComponentFileRefField, - SparkComponentFileRefField, -) + SparkComponentFileRefField) from ..._utils.utils import is_data_binding_expression from ...constants._common import AzureMLResourceType from ...constants._component import DataTransferTaskType, NodeType @@ -38,8 +37,7 @@ RegistryStr, StringTransformedEnum, TypeSensitiveUnionField, - UnionField, -) + UnionField) from ..core.schema import PathAwareSchema from ..job import ParameterizedCommandSchema, ParameterizedParallelSchema, ParameterizedSparkSchema from ..job.identity import AMLTokenIdentitySchema, ManagedIdentitySchema, UserIdentitySchema @@ -52,8 +50,7 @@ JupyterLabJobServiceSchema, SshJobServiceSchema, TensorBoardJobServiceSchema, - VsCodeJobServiceSchema, -) + VsCodeJobServiceSchema) from ..pipeline.pipeline_job_io import OutputBindingStr from ..spark_resource_configuration import SparkResourceConfigurationForNodeSchema @@ -69,8 +66,7 @@ class BaseNodeSchema(PathAwareSchema): inputs = InputsField(support_databinding=True) outputs = fields.Dict( keys=fields.Str(), - values=UnionField([OutputBindingStr, NestedField(OutputSchema)], allow_none=True), - ) + values=UnionField([OutputBindingStr, NestedField(OutputSchema)], allow_none=True)) properties = fields.Dict(keys=fields.Str(), values=fields.Str(allow_none=True)) comment = fields.Str() @@ -143,7 +139,7 @@ class CommandSchema(BaseNodeSchema, ParameterizedCommandSchema): { NodeType.COMMAND: [ # inline component or component file reference starting with FILE prefix - NestedField(AnonymousCommandComponentSchema, unknown=INCLUDE), + NestedField(AnonymousCommandComponentSchema), # component file reference ComponentFileRefField(), ], @@ -154,8 +150,7 @@ class CommandSchema(BaseNodeSchema, ParameterizedCommandSchema): # existing component ArmVersionedStr(azureml_type=AzureMLResourceType.COMPONENT, allow_default_version=True), ], - required=True, - ) + required=True) # code is directly linked to component.code, so no need to validate or dump it code = fields.Str(allow_none=True, load_only=True) type = StringTransformedEnum(allowed_values=[NodeType.COMMAND]) @@ -168,8 +163,7 @@ class CommandSchema(BaseNodeSchema, ParameterizedCommandSchema): "description": "The command run and the parameters passed. \ This string may contain place holders of inputs in {}. " }, - load_only=True, - ) + load_only=True) environment = EnvironmentField() services = fields.Dict( keys=fields.Str(), @@ -183,9 +177,7 @@ class CommandSchema(BaseNodeSchema, ParameterizedCommandSchema): # To support types not set by users like Custom, Tracking, Studio. NestedField(JobServiceSchema), ], - is_strict=True, - ), - ) + is_strict=True)) identity = UnionField( [ NestedField(ManagedIdentitySchema), @@ -224,7 +216,7 @@ class SweepSchema(BaseNodeSchema, ParameterizedSweepSchema): { NodeType.SWEEP: [ # inline component or component file reference starting with FILE prefix - NestedField(AnonymousCommandComponentSchema, unknown=INCLUDE), + NestedField(AnonymousCommandComponentSchema), # component file reference ComponentFileRefField(), ], @@ -233,8 +225,7 @@ class SweepSchema(BaseNodeSchema, ParameterizedSweepSchema): # existing component ArmVersionedStr(azureml_type=AzureMLResourceType.COMPONENT, allow_default_version=True), ], - required=True, - ) + required=True) @post_load def make(self, data, **kwargs) -> "Sweep": @@ -260,12 +251,12 @@ class ParallelSchema(BaseNodeSchema, ParameterizedParallelSchema): { NodeType.PARALLEL: [ # inline component or component file reference starting with FILE prefix - NestedField(AnonymousParallelComponentSchema, unknown=INCLUDE), + NestedField(AnonymousParallelComponentSchema), # component file reference ParallelComponentFileRefField(), ], NodeType.FLOW_PARALLEL: [ - NestedField(FlowComponentSchema, unknown=INCLUDE, dump_only=True), + NestedField(FlowComponentSchema, dump_only=True), ComponentYamlRefField(), ], }, @@ -275,8 +266,7 @@ class ParallelSchema(BaseNodeSchema, ParameterizedParallelSchema): # existing component ArmVersionedStr(azureml_type=AzureMLResourceType.COMPONENT, allow_default_version=True), ], - required=True, - ) + required=True) identity = UnionField( [ NestedField(ManagedIdentitySchema), @@ -310,7 +300,7 @@ class ImportSchema(BaseNodeSchema): { NodeType.IMPORT: [ # inline component or component file reference starting with FILE prefix - NestedField(AnonymousImportComponentSchema, unknown=INCLUDE), + NestedField(AnonymousImportComponentSchema), # component file reference ImportComponentFileRefField(), ], @@ -321,8 +311,7 @@ class ImportSchema(BaseNodeSchema): # existing component ArmVersionedStr(azureml_type=AzureMLResourceType.COMPONENT, allow_default_version=True), ], - required=True, - ) + required=True) type = StringTransformedEnum(allowed_values=[NodeType.IMPORT]) @post_load @@ -350,7 +339,7 @@ class SparkSchema(BaseNodeSchema, ParameterizedSparkSchema): { NodeType.SPARK: [ # inline component or component file reference starting with FILE prefix - NestedField(AnonymousSparkComponentSchema, unknown=INCLUDE), + NestedField(AnonymousSparkComponentSchema), # component file reference SparkComponentFileRefField(), ], @@ -361,15 +350,13 @@ class SparkSchema(BaseNodeSchema, ParameterizedSparkSchema): # existing component ArmVersionedStr(azureml_type=AzureMLResourceType.COMPONENT, allow_default_version=True), ], - required=True, - ) + required=True) type = StringTransformedEnum(allowed_values=[NodeType.SPARK]) compute = ComputeField() resources = NestedField(SparkResourceConfigurationForNodeSchema) entry = UnionField( [NestedField(SparkEntryFileSchema), NestedField(SparkEntryClassSchema)], - metadata={"description": "Entry."}, - ) + metadata={"description": "Entry."}) py_files = fields.List(fields.Str()) jars = fields.List(fields.Str()) files = fields.List(fields.Str()) @@ -415,7 +402,7 @@ class DataTransferCopySchema(BaseNodeSchema): { NodeType.DATA_TRANSFER: [ # inline component or component file reference starting with FILE prefix - NestedField(AnonymousDataTransferCopyComponentSchema, unknown=INCLUDE), + NestedField(AnonymousDataTransferCopyComponentSchema), # component file reference DataTransferCopyComponentFileRefField(), ], @@ -426,8 +413,7 @@ class DataTransferCopySchema(BaseNodeSchema): # existing component ArmVersionedStr(azureml_type=AzureMLResourceType.COMPONENT, allow_default_version=True), ], - required=True, - ) + required=True) task = StringTransformedEnum(allowed_values=[DataTransferTaskType.COPY_DATA], required=True) type = StringTransformedEnum(allowed_values=[NodeType.DATA_TRANSFER], required=True) compute = ComputeField() @@ -461,8 +447,7 @@ class DataTransferImportSchema(BaseNodeSchema): # existing component ArmVersionedStr(azureml_type=AzureMLResourceType.COMPONENT, allow_default_version=True), ], - required=True, - ) + required=True) task = StringTransformedEnum(allowed_values=[DataTransferTaskType.IMPORT_DATA], required=True) type = StringTransformedEnum(allowed_values=[NodeType.DATA_TRANSFER], required=True) compute = ComputeField() @@ -512,8 +497,7 @@ class DataTransferExportSchema(BaseNodeSchema): # existing component ArmVersionedStr(azureml_type=AzureMLResourceType.COMPONENT, allow_default_version=True), ], - required=True, - ) + required=True) task = StringTransformedEnum(allowed_values=[DataTransferTaskType.EXPORT_DATA]) type = StringTransformedEnum(allowed_values=[NodeType.DATA_TRANSFER]) compute = ComputeField() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/pipeline/pipeline_component.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/pipeline/pipeline_component.py index 05096e99b92b..44f3ec7a1df8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/pipeline/pipeline_component.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/pipeline/pipeline_component.py @@ -20,8 +20,7 @@ RegistryStr, StringTransformedEnum, TypeSensitiveUnionField, - UnionField, -) + UnionField) from azure.ai.ml._schema.pipeline.automl_node import AutoMLNodeSchema from azure.ai.ml._schema.pipeline.component_job import ( BaseNodeSchema, @@ -33,16 +32,14 @@ ParallelSchema, SparkSchema, SweepSchema, - _resolve_inputs_outputs, -) + _resolve_inputs_outputs) from azure.ai.ml._schema.pipeline.condition_node import ConditionNodeSchema from azure.ai.ml._schema.pipeline.control_flow_job import DoWhileSchema, ParallelForSchema from azure.ai.ml._schema.pipeline.pipeline_command_job import PipelineCommandJobSchema from azure.ai.ml._schema.pipeline.pipeline_datatransfer_job import ( PipelineDataTransferCopyJobSchema, PipelineDataTransferExportJobSchema, - PipelineDataTransferImportJobSchema, -) + PipelineDataTransferImportJobSchema) from azure.ai.ml._schema.pipeline.pipeline_import_job import PipelineImportJobSchema from azure.ai.ml._schema.pipeline.pipeline_parallel_job import PipelineParallelJobSchema from azure.ai.ml._schema.pipeline.pipeline_spark_job import PipelineSparkJobSchema @@ -53,8 +50,7 @@ ComponentSource, ControlFlowType, DataTransferTaskType, - NodeType, -) + NodeType) class NodeNameStr(PipelineNodeNameStr): @@ -65,23 +61,23 @@ def _get_field_name(self) -> str: def PipelineJobsField(): pipeline_enable_job_type = { NodeType.COMMAND: [ - NestedField(CommandSchema, unknown=INCLUDE), + NestedField(CommandSchema), NestedField(PipelineCommandJobSchema), ], NodeType.IMPORT: [ - NestedField(ImportSchema, unknown=INCLUDE), + NestedField(ImportSchema), NestedField(PipelineImportJobSchema), ], - NodeType.SWEEP: [NestedField(SweepSchema, unknown=INCLUDE)], + NodeType.SWEEP: [NestedField(SweepSchema)], NodeType.PARALLEL: [ # ParallelSchema support parallel pipeline yml with "component" - NestedField(ParallelSchema, unknown=INCLUDE), - NestedField(PipelineParallelJobSchema, unknown=INCLUDE), + NestedField(ParallelSchema), + NestedField(PipelineParallelJobSchema), ], - NodeType.PIPELINE: [NestedField("PipelineSchema", unknown=INCLUDE)], - NodeType.AUTOML: AutoMLNodeSchema(unknown=INCLUDE), + NodeType.PIPELINE: [NestedField("PipelineSchema")], + NodeType.AUTOML: AutoMLNodeSchema(), NodeType.SPARK: [ - NestedField(SparkSchema, unknown=INCLUDE), + NestedField(SparkSchema), NestedField(PipelineSparkJobSchema), ], } @@ -89,9 +85,9 @@ def PipelineJobsField(): # Note: the private node types only available when private preview flag opened before init of pipeline job # schema class. if is_private_preview_enabled(): - pipeline_enable_job_type[ControlFlowType.DO_WHILE] = [NestedField(DoWhileSchema, unknown=INCLUDE)] - pipeline_enable_job_type[ControlFlowType.IF_ELSE] = [NestedField(ConditionNodeSchema, unknown=INCLUDE)] - pipeline_enable_job_type[ControlFlowType.PARALLEL_FOR] = [NestedField(ParallelForSchema, unknown=INCLUDE)] + pipeline_enable_job_type[ControlFlowType.DO_WHILE] = [NestedField(DoWhileSchema)] + pipeline_enable_job_type[ControlFlowType.IF_ELSE] = [NestedField(ConditionNodeSchema)] + pipeline_enable_job_type[ControlFlowType.PARALLEL_FOR] = [NestedField(ParallelForSchema)] # Todo: Put data_transfer logic to the last to avoid error message conflict, open a item to track: # https://msdata.visualstudio.com/Vienna/_workitems/edit/2244262/ @@ -99,27 +95,24 @@ def PipelineJobsField(): TypeSensitiveUnionField( { DataTransferTaskType.COPY_DATA: [ - NestedField(DataTransferCopySchema, unknown=INCLUDE), + NestedField(DataTransferCopySchema), NestedField(PipelineDataTransferCopyJobSchema), ], DataTransferTaskType.IMPORT_DATA: [ - NestedField(DataTransferImportSchema, unknown=INCLUDE), + NestedField(DataTransferImportSchema), NestedField(PipelineDataTransferImportJobSchema), ], DataTransferTaskType.EXPORT_DATA: [ - NestedField(DataTransferExportSchema, unknown=INCLUDE), + NestedField(DataTransferExportSchema), NestedField(PipelineDataTransferExportJobSchema), ], }, - type_field_name="task", - unknown=INCLUDE, - ) + type_field_name="task") ] pipeline_job_field = fields.Dict( keys=NodeNameStr(), - values=TypeSensitiveUnionField(pipeline_enable_job_type), - ) + values=TypeSensitiveUnionField(pipeline_enable_job_type)) return pipeline_job_field @@ -143,8 +136,7 @@ def _post_load_pipeline_jobs(context, data: dict) -> dict: # convert AutoML job dict to instance if job_instance.get("type") == NodeType.AUTOML: job_instance = AutoMLJob._create_instance_from_schema_dict( - loaded_data=job_instance, - ) + loaded_data=job_instance) elif job_instance.get("type") in CONTROL_FLOW_TYPES: # Set source to yaml job for control flow node. job_instance["_source"] = ComponentSource.YAML_JOB @@ -171,8 +163,7 @@ def _post_load_pipeline_jobs(context, data: dict) -> dict: # set source as YAML job_instance = job_instance._to_node( context=context, - pipeline_job_dict=data, - ) + pipeline_job_dict=data) if job_instance.type == NodeType.DATA_TRANSFER and job_instance.task != DataTransferTaskType.COPY_DATA: job_instance._source = ComponentSource.BUILTIN else: @@ -193,11 +184,10 @@ class PipelineComponentSchema(ComponentSchema): keys=fields.Str(), values=UnionField( [ - NestedField(PrimitiveOutputSchema, unknown=INCLUDE), + NestedField(PrimitiveOutputSchema), NestedField(OutputPortSchema), ] - ), - ) + )) @post_load def make(self, data, **kwargs): # pylint: disable=unused-argument @@ -232,8 +222,7 @@ def make(self, data, **kwargs): return PipelineComponent( base_path=self.context[BASE_PATH_CONTEXT_KEY], - **data, - ) + **data) class PipelineComponentFileRefField(FileRefField): @@ -258,9 +247,9 @@ def _deserialize(self, value, attr, data, **kwargs): # Update base_path to parent path of component file. component_schema_context = deepcopy(self.context) component_schema_context[BASE_PATH_CONTEXT_KEY] = source_path.parent - component = _AnonymousPipelineComponentSchema(context=component_schema_context).load( - component_dict, unknown=INCLUDE - ) + component = _AnonymousPipelineComponentSchema().load( + component_dict + , context=component_schema_context) component._source_path = source_path component._source = ComponentSource.YAML_COMPONENT return component @@ -280,8 +269,7 @@ class PipelineSchema(BaseNodeSchema): # component file reference PipelineComponentFileRefField(), ], - required=True, - ) + required=True) type = StringTransformedEnum(allowed_values=[NodeType.PIPELINE]) @post_load diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/pipeline/pipeline_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/pipeline/pipeline_job.py index 46daeb92073f..bb0db384a209 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/pipeline/pipeline_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/pipeline/pipeline_job.py @@ -14,16 +14,14 @@ NestedField, RegistryStr, StringTransformedEnum, - UnionField, -) + UnionField) from azure.ai.ml._schema.job import BaseJobSchema from azure.ai.ml._schema.job.input_output_fields_provider import InputsField, OutputsField from azure.ai.ml._schema.pipeline.component_job import _resolve_inputs_outputs from azure.ai.ml._schema.pipeline.pipeline_component import ( PipelineComponentFileRefField, PipelineJobsField, - _post_load_pipeline_jobs, -) + _post_load_pipeline_jobs) from azure.ai.ml._schema.pipeline.settings import PipelineJobSettingsSchema from azure.ai.ml.constants import JobType from azure.ai.ml.constants._common import AzureMLResourceType @@ -34,7 +32,7 @@ class PipelineJobSchema(BaseJobSchema): type = StringTransformedEnum(allowed_values=[JobType.PIPELINE]) compute = ComputeField() - settings = NestedField(PipelineJobSettingsSchema, unknown=INCLUDE) + settings = NestedField(PipelineJobSettingsSchema) # Support databinding in inputs as we support macro like ${{name}} inputs = InputsField(support_databinding=True) outputs = OutputsField() @@ -47,8 +45,7 @@ class PipelineJobSchema(BaseJobSchema): ArmVersionedStr(azureml_type=AzureMLResourceType.COMPONENT, allow_default_version=True), # component file reference PipelineComponentFileRefField(), - ], - ) + ]) @pre_dump() def backup_jobs_and_remove_component(self, job, **kwargs): diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/schedule/create_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/schedule/create_job.py index 084f8a5b74f2..a68422402aff 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/schedule/create_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/schedule/create_job.py @@ -16,8 +16,7 @@ FileRefField, NestedField, StringTransformedEnum, - UnionField, -) + UnionField) from azure.ai.ml._schema.job import BaseJobSchema from azure.ai.ml._schema.job.input_output_fields_provider import InputsField, OutputsField from azure.ai.ml._schema.pipeline.settings import PipelineJobSettingsSchema @@ -52,8 +51,7 @@ def _deserialize(self, value, attr, data, **kwargs) -> "Job": return Job._load( data=job_dict, yaml_path=self.context[BASE_PATH_CONTEXT_KEY] / value, - **kwargs, - ) + **kwargs) class BaseCreateJobSchema(BaseJobSchema): @@ -63,8 +61,7 @@ class BaseCreateJobSchema(BaseJobSchema): ArmStr(azureml_type=AzureMLResourceType.JOB), CreateJobFileRefField, ], - required=True, - ) + required=True) # pylint: disable-next=docstring-missing-param def _get_job_instance_for_remote_job(self, id: Optional[str], data: Optional[dict], **kwargs) -> "Job": @@ -81,8 +78,7 @@ def _get_job_instance_for_remote_job(self, id: Optional[str], data: Optional[dic # Create a job instance if job is arm id job_instance = Job._load( data=data, - **kwargs, - ) + **kwargs) # Set back the id and base path to created job job_instance._id = id job_instance._base_path = self.context[BASE_PATH_CONTEXT_KEY] @@ -114,8 +110,7 @@ def make(self, data: dict, **kwargs) -> "Job": return Job._load( data=merge_dict(job_dict, raw_data), yaml_path=job._source_path, - **kwargs, - ) + **kwargs) # Create a job instance for remote job return self._get_job_instance_for_remote_job(job, raw_data, **kwargs) @@ -125,7 +120,7 @@ class PipelineCreateJobSchema(BaseCreateJobSchema): type = StringTransformedEnum(allowed_values=[JobType.PIPELINE]) inputs = InputsField() outputs = OutputsField() - settings = NestedField(PipelineJobSettingsSchema, unknown=INCLUDE) + settings = NestedField(PipelineJobSettingsSchema) class CommandCreateJobSchema(BaseCreateJobSchema, CommandJobSchema): diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/workspace/networking.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/workspace/networking.py index f228ee3e8ee3..5ca7147cfda5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/workspace/networking.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/workspace/networking.py @@ -16,8 +16,7 @@ FqdnDestination, ManagedNetwork, PrivateEndpointDestination, - ServiceTagDestination, -) + ServiceTagDestination) class ManagedNetworkStatusSchema(metaclass=PatchedSchemaMeta): @@ -38,8 +37,7 @@ class FqdnOutboundRuleSchema(metaclass=PatchedSchemaMeta): ], casing_transform=camel_to_snake, metadata={"description": "outbound rule category."}, - dump_only=True, - ) + dump_only=True) status = fields.Str(dump_only=True) @post_load @@ -52,8 +50,7 @@ def createdestobject(self, data, **kwargs): name=name, destination=dest, category=_snake_to_camel(category), - status=status, - ) + status=status) class ServiceTagDestinationSchema(metaclass=PatchedSchemaMeta): @@ -76,8 +73,7 @@ class ServiceTagOutboundRuleSchema(metaclass=PatchedSchemaMeta): ], casing_transform=camel_to_snake, metadata={"description": "outbound rule category."}, - dump_only=True, - ) + dump_only=True) status = fields.Str(dump_only=True) @pre_dump @@ -100,8 +96,7 @@ def createdestobject(self, data, **kwargs): port_ranges=dest["port_ranges"], address_prefixes=dest.get("address_prefixes", None), category=_snake_to_camel(category), - status=status, - ) + status=status) def service_tag_dest2dict(self, service_tag, protocol, port_ranges, address_prefixes): service_tag_dest = {} @@ -133,8 +128,7 @@ class PrivateEndpointOutboundRuleSchema(metaclass=PatchedSchemaMeta): ], casing_transform=camel_to_snake, metadata={"description": "outbound rule category."}, - dump_only=True, - ) + dump_only=True) status = fields.Str(dump_only=True) @pre_dump @@ -156,8 +150,7 @@ def createdestobject(self, data, **kwargs): spark_enabled=dest["spark_enabled"], category=_snake_to_camel(category), status=status, - fqdns=fqdns, - ) + fqdns=fqdns) def pe_dest2dict(self, service_resource_id, subresource_target, spark_enabled): pedest = {} @@ -175,22 +168,19 @@ class ManagedNetworkSchema(metaclass=PatchedSchemaMeta): IsolationMode.ALLOW_ONLY_APPROVED_OUTBOUND, ], casing_transform=camel_to_snake, - metadata={"description": "isolation mode for the workspace managed network."}, - ) + metadata={"description": "isolation mode for the workspace managed network."}) outbound_rules = fields.List( UnionField( [ - NestedField(PrivateEndpointOutboundRuleSchema, allow_none=False, unknown=EXCLUDE), - NestedField(ServiceTagOutboundRuleSchema, allow_none=False, unknown=EXCLUDE), + NestedField(PrivateEndpointOutboundRuleSchema, allow_none=False), + NestedField(ServiceTagOutboundRuleSchema, allow_none=False), NestedField( - FqdnOutboundRuleSchema, allow_none=False, unknown=EXCLUDE + FqdnOutboundRuleSchema, allow_none=False ), # this needs to be last since otherwise union field with match destination as a string ], allow_none=False, - is_strict=True, - ), - allow_none=True, - ) + is_strict=True), + allow_none=True) firewall_sku = ExperimentalField( StringTransformedEnum( allowed_values=[ @@ -198,11 +188,10 @@ class ManagedNetworkSchema(metaclass=PatchedSchemaMeta): FirewallSku.BASIC, ], casing_transform=camel_to_snake, - metadata={"description": "Firewall sku for FQDN rules in AllowOnlyApprovedOutbound mode"}, - ) + metadata={"description": "Firewall sku for FQDN rules in AllowOnlyApprovedOutbound mode"}) ) network_id = fields.Str(required=False, dump_only=True) - status = NestedField(ManagedNetworkStatusSchema, allow_none=False, unknown=EXCLUDE) + status = NestedField(ManagedNetworkStatusSchema, allow_none=False) @post_load def make(self, data, **kwargs): @@ -215,10 +204,8 @@ def make(self, data, **kwargs): return ManagedNetwork( isolation_mode=_snake_to_camel(data["isolation_mode"]), outbound_rules=outbound_rules, - firewall_sku=firewall_sku_value, - ) + firewall_sku=firewall_sku_value) else: return ManagedNetwork( isolation_mode=_snake_to_camel(data["isolation_mode"]), - firewall_sku=firewall_sku_value, - ) + firewall_sku=firewall_sku_value) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/workspace/workspace.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/workspace/workspace.py index 1df06f974d1c..9408eb020fc8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/workspace/workspace.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/workspace/workspace.py @@ -35,14 +35,13 @@ class WorkspaceSchema(PathAwareSchema): image_build_compute = fields.Str() public_network_access = StringTransformedEnum( allowed_values=[PublicNetworkAccess.DISABLED, PublicNetworkAccess.ENABLED], - casing_transform=snake_to_pascal, - ) + casing_transform=snake_to_pascal) network_acls = NestedField(NetworkAclsSchema) system_datastores_auth_mode = fields.Str() identity = NestedField(IdentitySchema) primary_user_assigned_identity = fields.Str() workspace_hub = fields.Str(validate=validate_arm_str) - managed_network = NestedField(ManagedNetworkSchema, unknown=EXCLUDE) + managed_network = NestedField(ManagedNetworkSchema) provision_network_now = fields.Bool() enable_data_isolation = fields.Bool() allow_roleassignment_on_rg = fields.Bool() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/_package/base_environment_source.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/_package/base_environment_source.py index 1be671448d26..22bf4712baab 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/_package/base_environment_source.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/_package/base_environment_source.py @@ -42,7 +42,7 @@ def _from_rest_object(cls, rest_obj: RestBaseEnvironmentId) -> "RestBaseEnvironm return BaseEnvironment(type=rest_obj.base_environment_source_type, resource_id=rest_obj.resource_id) def _to_dict(self) -> Dict: - return dict(BaseEnvironmentSourceSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self)) + return dict(BaseEnvironmentSourceSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"})) def _to_rest_object(self) -> RestBaseEnvironmentId: return RestBaseEnvironmentId(base_environment_source_type=self.type, resource_id=self.resource_id) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/_package/model_package.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/_package/model_package.py index c4797c20bec0..a1a0659292be 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/_package/model_package.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/_package/model_package.py @@ -296,7 +296,7 @@ def dump( dump_yaml_to_file(dest, yaml_serialized, default_flow_style=False) def _to_dict(self) -> Dict: - return dict(ModelPackageSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self)) + return dict(ModelPackageSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"})) @classmethod def _from_rest_object(cls, model_package_rest_object: PackageResponse) -> Any: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/code.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/code.py index b08149abe994..4a3f49668a6b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/code.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/code.py @@ -85,7 +85,7 @@ def _load( return res def _to_dict(self) -> Dict: - res: dict = CodeAssetSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = CodeAssetSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res @classmethod diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/data.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/data.py index 710e959a4c26..1c88c14accde 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/data.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/data.py @@ -150,7 +150,7 @@ def _load_from_dict(cls, yaml_data: Dict, context: Dict, **kwargs: Any) -> "Data return Data(**load_from_dict(DataSchema, yaml_data, context, **kwargs)) def _to_dict(self) -> Dict: - res: dict = DataSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = DataSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res def _to_container_rest_object(self) -> DataContainer: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/feature_set.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/feature_set.py index a5bb73fecb1f..9e9514aa8537 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/feature_set.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/feature_set.py @@ -166,7 +166,7 @@ def _load( return feature_set def _to_dict(self) -> Dict: - return dict(FeatureSetSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self)) + return dict(FeatureSetSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"})) def _update_path(self, asset_artifact: ArtifactStorageInfo) -> None: # if datastore_arm_id is null, capture the full_storage_path diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/index.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/index.py index 35f671d35c2a..e56603967c6f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/index.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/index.py @@ -120,7 +120,7 @@ def _load( return cast(Index, load_from_dict(IndexAssetSchema, data, context, **kwargs)) def _to_dict(self) -> Dict: - return cast(dict, IndexAssetSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self)) + return cast(dict, IndexAssetSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"})) def _update_path(self, asset_artifact: ArtifactStorageInfo) -> None: """Updates an an artifact with the remote path of a local upload. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/model.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/model.py index 9f0b04bd568f..eb2eb0c85a17 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/model.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/_artifacts/model.py @@ -123,7 +123,7 @@ def _load( return res def _to_dict(self) -> Dict: - return dict(ModelSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self)) + return dict(ModelSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"})) @classmethod def _from_rest_object(cls, model_rest_object: ModelVersion) -> "Model": diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/environment.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/environment.py index dca35fcf5c01..520cbf2a8c22 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/environment.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/environment.py @@ -299,7 +299,7 @@ def _to_arm_resource_param(self, **kwargs: Any) -> Dict: # pylint: disable=unus } def _to_dict(self) -> Dict: - res: dict = EnvironmentSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = EnvironmentSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res def validate(self) -> None: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/workspace_asset_reference.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/workspace_asset_reference.py index 1e7d1ba2b0a8..ae9aef3da26f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/workspace_asset_reference.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/workspace_asset_reference.py @@ -84,4 +84,4 @@ def _from_rest_object(cls, resource_object: ResourceManagementAssetReferenceData return resource_management def _to_dict(self) -> Dict: - return dict(WorkspaceAssetReferenceSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self)) + return dict(WorkspaceAssetReferenceSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"})) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/command.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/command.py index 0073307c2b99..6b7bbe25b328 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/command.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/command.py @@ -25,8 +25,7 @@ AmlTokenConfiguration, ManagedIdentityConfiguration, UserIdentityConfiguration, - _BaseJobIdentityConfiguration, -) + _BaseJobIdentityConfiguration) from azure.ai.ml.entities._inputs_outputs import Input, Output from azure.ai.ml.entities._job._input_output_helpers import from_rest_data_outputs, from_rest_inputs_to_dataset_literal from azure.ai.ml.entities._job.command_job import CommandJob @@ -35,8 +34,7 @@ MpiDistribution, PyTorchDistribution, RayDistribution, - TensorFlowDistribution, -) + TensorFlowDistribution) from azure.ai.ml.entities._job.job_limits import CommandJobLimits from azure.ai.ml.entities._job.job_resource_configuration import JobResourceConfiguration from azure.ai.ml.entities._job.job_service import ( @@ -45,8 +43,7 @@ JupyterLabJobService, SshJobService, TensorBoardJobService, - VsCodeJobService, -) + VsCodeJobService) from azure.ai.ml.entities._job.queue_settings import QueueSettings from azure.ai.ml.entities._job.sweep.early_termination_policy import EarlyTerminationPolicy from azure.ai.ml.entities._job.sweep.objective import Objective @@ -61,8 +58,7 @@ QUniform, Randint, SweepDistribution, - Uniform, -) + Uniform) from azure.ai.ml.entities._system_data import SystemData from azure.ai.ml.exceptions import ErrorCategory, ErrorTarget, ValidationErrorType, ValidationException @@ -71,16 +67,14 @@ MPIDistributionSchema, PyTorchDistributionSchema, RayDistributionSchema, - TensorFlowDistributionSchema, -) + TensorFlowDistributionSchema) from .._job.pipeline._io import NodeWithGroupInputMixin from .._util import ( convert_ordered_dict_to_dict, from_rest_dict_to_dummy_rest_object, get_rest_dict_for_node_attrs, load_from_dict, - validate_attribute_type, -) + validate_attribute_type) from .base_node import BaseNode from .sweep import Sweep @@ -175,8 +169,7 @@ def __init__( ] = None, queue_settings: Optional[QueueSettings] = None, parent_job_name: Optional[str] = None, - **kwargs: Any, - ) -> None: + **kwargs: Any) -> None: # validate init params are valid type validate_attribute_type(attrs_to_check=locals(), attr_type_map=self._attr_type_map()) @@ -192,8 +185,7 @@ def __init__( component=component, compute=compute, services=services, - **kwargs, - ) + **kwargs) # init mark for _AttrDict self._init = True @@ -220,8 +212,7 @@ def _get_supported_inputs_types(cls) -> Tuple: supported_types = super()._get_supported_inputs_types() or () return ( SweepDistribution, - *supported_types, - ) + *supported_types) @classmethod def _get_supported_outputs_types(cls) -> Tuple: @@ -238,8 +229,7 @@ def parameters(self) -> Dict[str, str]: @property def distribution( - self, - ) -> Optional[ + self) -> Optional[ Union[ Dict, MpiDistribution, @@ -260,8 +250,7 @@ def distribution( @distribution.setter def distribution( self, - value: Union[Dict, PyTorchDistribution, TensorFlowDistribution, MpiDistribution, RayDistribution], - ) -> None: + value: Union[Dict, PyTorchDistribution, TensorFlowDistribution, MpiDistribution, RayDistribution]) -> None: """Sets the configuration for the distributed command component or job. :param value: The configuration for distributed jobs. @@ -271,10 +260,10 @@ def distribution( if isinstance(value, dict): dist_schema = UnionField( [ - NestedField(PyTorchDistributionSchema, unknown=INCLUDE), - NestedField(TensorFlowDistributionSchema, unknown=INCLUDE), - NestedField(MPIDistributionSchema, unknown=INCLUDE), - ExperimentalField(NestedField(RayDistributionSchema, unknown=INCLUDE)), + NestedField(PyTorchDistributionSchema), + NestedField(TensorFlowDistributionSchema), + NestedField(MPIDistributionSchema), + ExperimentalField(NestedField(RayDistributionSchema)), ] ) value = dist_schema._deserialize(value=value, attr=None, data=None) @@ -321,8 +310,7 @@ def queue_settings(self, value: Union[Dict, QueueSettings]) -> None: @property def identity( - self, - ) -> Optional[Union[Dict, ManagedIdentityConfiguration, AmlTokenConfiguration, UserIdentityConfiguration]]: + self) -> Optional[Union[Dict, ManagedIdentityConfiguration, AmlTokenConfiguration, UserIdentityConfiguration]]: """The identity that the job will use while running on compute. :return: The identity that the job will use while running on compute. @@ -334,8 +322,7 @@ def identity( @identity.setter def identity( self, - value: Optional[Union[Dict, ManagedIdentityConfiguration, AmlTokenConfiguration, UserIdentityConfiguration]], - ) -> None: + value: Optional[Union[Dict, ManagedIdentityConfiguration, AmlTokenConfiguration, UserIdentityConfiguration]]) -> None: """Sets the identity that the job will use while running on compute. :param value: The identity that the job will use while running on compute. @@ -345,9 +332,9 @@ def identity( if isinstance(value, dict): identity_schema = UnionField( [ - NestedField(ManagedIdentitySchema, unknown=INCLUDE), - NestedField(AMLTokenIdentitySchema, unknown=INCLUDE), - NestedField(UserIdentitySchema, unknown=INCLUDE), + NestedField(ManagedIdentitySchema), + NestedField(AMLTokenIdentitySchema), + NestedField(UserIdentitySchema), ] ) value = identity_schema._deserialize(value=value, attr=None, data=None) @@ -355,8 +342,7 @@ def identity( @property def services( - self, - ) -> Optional[ + self) -> Optional[ Dict[str, Union[JobService, JupyterLabJobService, SshJobService, TensorBoardJobService, VsCodeJobService]] ]: """The interactive services for the node. @@ -373,8 +359,7 @@ def services( @services.setter def services( self, - value: Dict, - ) -> None: + value: Dict) -> None: """Sets the interactive services for the node. This is an experimental parameter, and may change at any time. @@ -426,8 +411,7 @@ def command(self, value: str) -> None: no_personal_data_message=msg, target=ErrorTarget.COMMAND_JOB, error_category=ErrorCategory.USER_ERROR, - error_type=ValidationErrorType.INVALID_VALUE, - ) + error_type=ValidationErrorType.INVALID_VALUE) @property def code(self) -> Optional[Union[str, PathLike]]: @@ -467,8 +451,7 @@ def code(self, value: str) -> None: no_personal_data_message=msg, target=ErrorTarget.COMMAND_JOB, error_category=ErrorCategory.USER_ERROR, - error_type=ValidationErrorType.INVALID_VALUE, - ) + error_type=ValidationErrorType.INVALID_VALUE) def set_resources( self, @@ -480,8 +463,7 @@ def set_resources( docker_args: Optional[Union[str, List[str]]] = None, shm_size: Optional[str] = None, # pylint: disable=unused-argument - **kwargs: Any, - ) -> None: + **kwargs: Any) -> None: """Set resources for Command. :keyword instance_type: The type of compute instance to run the job on. If not specified, the job will run on @@ -599,8 +581,7 @@ def sweep( ] = None, queue_settings: Optional[QueueSettings] = None, job_tier: Optional[str] = None, - priority: Optional[str] = None, - ) -> Sweep: + priority: Optional[str] = None) -> Sweep: """Turns the command into a sweep node with extra sweep run setting. The command component in the current command node will be used as its trial component. A command node can sweep multiple times, and the generated sweep node will share the same trial component. @@ -702,14 +683,12 @@ def sweep( experiment_name=self.experiment_name, identity=self.identity if not identity else identity, _from_component_func=True, - queue_settings=queue_settings, - ) + queue_settings=queue_settings) sweep_node.set_limits( max_total_trials=max_total_trials, max_concurrent_trials=max_concurrent_trials, timeout=timeout, - trial_timeout=trial_timeout, - ) + trial_timeout=trial_timeout) return sweep_node @classmethod @@ -749,8 +728,7 @@ def _to_job(self) -> CommandJob: creation_context=self.creation_context, parameters=self.parameters, queue_settings=self.queue_settings, - parent_job_name=self.parent_job_name, - ) + parent_job_name=self.parent_job_name) return CommandJob( id=self.id, @@ -776,8 +754,7 @@ def _to_job(self) -> CommandJob: creation_context=self.creation_context, parameters=self.parameters, queue_settings=self.queue_settings, - parent_job_name=self.parent_job_name, - ) + parent_job_name=self.parent_job_name) @classmethod def _picked_fields_from_dict_to_rest_object(cls) -> List[str]: @@ -874,8 +851,7 @@ def _load_from_rest_job(cls, obj: JobBase) -> "Command": ), environment_variables=rest_command_job.environment_variables, inputs=from_rest_inputs_to_dataset_literal(rest_command_job.inputs), - outputs=from_rest_data_outputs(rest_command_job.outputs), - ) + outputs=from_rest_data_outputs(rest_command_job.outputs)) command_job._id = obj.id command_job.resources = cast( JobResourceConfiguration, JobResourceConfiguration._from_rest_object(rest_command_job.resources) @@ -959,8 +935,7 @@ def __call__(self, *args: Any, **kwargs: Any) -> "Command": message=msg.format(type(CommandComponent), self._component), no_personal_data_message=msg.format(type(CommandComponent), "self._component"), target=ErrorTarget.COMMAND_JOB, - error_type=ValidationErrorType.INVALID_VALUE, - ) + error_type=ValidationErrorType.INVALID_VALUE) @overload @@ -969,13 +944,11 @@ def _resolve_job_services(services: Optional[Dict]): ... @overload def _resolve_job_services( - services: Dict[str, Union[JobServiceBase, Dict]], -) -> Dict[str, Union[JobService, JupyterLabJobService, SshJobService, TensorBoardJobService, VsCodeJobService]]: ... + services: Dict[str, Union[JobServiceBase, Dict]]) -> Dict[str, Union[JobService, JupyterLabJobService, SshJobService, TensorBoardJobService, VsCodeJobService]]: ... def _resolve_job_services( - services: Optional[Dict[str, Union[JobServiceBase, Dict]]], -) -> Optional[Dict]: + services: Optional[Dict[str, Union[JobServiceBase, Dict]]]) -> Optional[Dict]: """Resolve normal dict to dict[str, JobService] :param services: A dict that maps service names to either a JobServiceBase object, or a Dict used to build one @@ -996,8 +969,7 @@ def _resolve_job_services( message=msg, no_personal_data_message=msg, target=ErrorTarget.COMMAND_JOB, - error_category=ErrorCategory.USER_ERROR, - ) + error_category=ErrorCategory.USER_ERROR) result = {} for name, service in services.items(): @@ -1011,7 +983,6 @@ def _resolve_job_services( message=msg, no_personal_data_message=msg, target=ErrorTarget.COMMAND_JOB, - error_category=ErrorCategory.USER_ERROR, - ) + error_category=ErrorCategory.USER_ERROR) result[name] = service return result diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/parallel.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/parallel.py index db1de79730c0..93aefa36f201 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/parallel.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/parallel.py @@ -20,8 +20,7 @@ AmlTokenConfiguration, ManagedIdentityConfiguration, UserIdentityConfiguration, - _BaseJobIdentityConfiguration, -) + _BaseJobIdentityConfiguration) from azure.ai.ml.entities._job.job import Job from azure.ai.ml.entities._job.parallel.run_function import RunFunction from azure.ai.ml.entities._job.pipeline._io import NodeOutput @@ -127,8 +126,7 @@ def __init__( identity: Optional[ Union[ManagedIdentityConfiguration, AmlTokenConfiguration, UserIdentityConfiguration, Dict] ] = None, - **kwargs: Any, - ) -> None: + **kwargs: Any) -> None: # validate init params are valid type validate_attribute_type(attrs_to_check=locals(), attr_type_map=self._attr_type_map()) kwargs.pop("type", None) @@ -143,8 +141,7 @@ def __init__( inputs=inputs, outputs=outputs, compute=compute, - **kwargs, - ) + **kwargs) else: BaseNode.__init__( self, @@ -153,8 +150,7 @@ def __init__( inputs=inputs, outputs=outputs, compute=compute, - **kwargs, - ) + **kwargs) # init mark for _AttrDict self._init = True @@ -264,8 +260,7 @@ def resources(self, value: Union[JobResourceConfiguration, Dict]) -> None: @property def identity( - self, - ) -> Optional[Union[ManagedIdentityConfiguration, AmlTokenConfiguration, UserIdentityConfiguration, Dict]]: + self) -> Optional[Union[ManagedIdentityConfiguration, AmlTokenConfiguration, UserIdentityConfiguration, Dict]]: """The identity that the job will use while running on compute. :return: The identity that the job will use while running on compute. @@ -277,8 +272,7 @@ def identity( @identity.setter def identity( self, - value: Union[Dict, ManagedIdentityConfiguration, AmlTokenConfiguration, UserIdentityConfiguration, None], - ) -> None: + value: Union[Dict, ManagedIdentityConfiguration, AmlTokenConfiguration, UserIdentityConfiguration, None]) -> None: """Sets the identity that the job will use while running on compute. :param value: The identity that the job will use while running on compute. @@ -288,9 +282,9 @@ def identity( if isinstance(value, dict): identity_schema = UnionField( [ - NestedField(ManagedIdentitySchema, unknown=INCLUDE), - NestedField(AMLTokenIdentitySchema, unknown=INCLUDE), - NestedField(UserIdentitySchema, unknown=INCLUDE), + NestedField(ManagedIdentitySchema), + NestedField(AMLTokenIdentitySchema), + NestedField(UserIdentitySchema), ] ) value = identity_schema._deserialize(value=value, attr=None, data=None) @@ -342,8 +336,7 @@ def set_resources( docker_args: Optional[str] = None, shm_size: Optional[str] = None, # pylint: disable=unused-argument - **kwargs: Any, - ) -> None: + **kwargs: Any) -> None: """Set the resources for the parallel job. :keyword instance_type: The instance type or a list of instance types used as supported by the compute target. @@ -410,8 +403,7 @@ def _to_job(self) -> ParallelJob: mini_batch_error_threshold=self.mini_batch_error_threshold, environment_variables=self.environment_variables, inputs=self._job_inputs, - outputs=self._job_outputs, - ) + outputs=self._job_outputs) def _parallel_attr_to_dict(self, attr: str, base_type: Type) -> dict: # Convert parallel attribute to dict diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/spark.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/spark.py index e72f1334a937..a186c026ce7e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/spark.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/spark.py @@ -24,8 +24,7 @@ ARM_ID_PREFIX, BASE_PATH_CONTEXT_KEY, REGISTRY_URI_FORMAT, - SPARK_ENVIRONMENT_WARNING_MESSAGE, -) + SPARK_ENVIRONMENT_WARNING_MESSAGE) from ...constants._component import NodeType from ...constants._job.job import SparkConfKey from ...entities._assets import Environment @@ -35,14 +34,12 @@ AmlTokenConfiguration, ManagedIdentityConfiguration, UserIdentityConfiguration, - _BaseJobIdentityConfiguration, -) + _BaseJobIdentityConfiguration) from ...entities._inputs_outputs import Input, Output from ...entities._job._input_output_helpers import ( from_rest_data_outputs, from_rest_inputs_to_dataset_literal, - validate_inputs_for_args, -) + validate_inputs_for_args) from ...entities._job.spark_job import SparkJob from ...entities._job.spark_job_entry import SparkJobEntryType from ...entities._job.spark_resource_configuration import SparkResourceConfiguration @@ -52,8 +49,7 @@ from .._job.spark_helpers import ( _validate_compute_or_resources, _validate_input_output_mode, - _validate_spark_configurations, -) + _validate_spark_configurations) from .._job.spark_job_entry_mixin import SparkJobEntry, SparkJobEntryMixin from .._util import convert_ordered_dict_to_dict, get_rest_dict_for_node_attrs, load_from_dict, validate_attribute_type from .base_node import BaseNode @@ -172,8 +168,7 @@ def __init__( files: Optional[List[str]] = None, archives: Optional[List[str]] = None, args: Optional[str] = None, - **kwargs: Any, - ) -> None: + **kwargs: Any) -> None: # validate init params are valid type validate_attribute_type(attrs_to_check=locals(), attr_type_map=self._attr_type_map()) kwargs.pop("type", None) @@ -272,8 +267,7 @@ def resources(self, value: Optional[Union[Dict, SparkResourceConfiguration]]) -> @property def identity( - self, - ) -> Optional[Union[Dict, ManagedIdentityConfiguration, AmlTokenConfiguration, UserIdentityConfiguration]]: + self) -> Optional[Union[Dict, ManagedIdentityConfiguration, AmlTokenConfiguration, UserIdentityConfiguration]]: """The identity that the Spark job will use while running on compute. :rtype: Union[~azure.ai.ml.entities.ManagedIdentityConfiguration, ~azure.ai.ml.entities.AmlTokenConfiguration, @@ -292,8 +286,7 @@ def identity( @identity.setter def identity( self, - value: Union[Dict[str, str], ManagedIdentityConfiguration, AmlTokenConfiguration, UserIdentityConfiguration], - ) -> None: + value: Union[Dict[str, str], ManagedIdentityConfiguration, AmlTokenConfiguration, UserIdentityConfiguration]) -> None: """Sets the identity that the Spark job will use while running on compute. :param value: The identity that the Spark job will use while running on compute. @@ -303,9 +296,9 @@ def identity( if isinstance(value, dict): identify_schema = UnionField( [ - NestedField(ManagedIdentitySchema, unknown=INCLUDE), - NestedField(AMLTokenIdentitySchema, unknown=INCLUDE), - NestedField(UserIdentitySchema, unknown=INCLUDE), + NestedField(ManagedIdentitySchema), + NestedField(AMLTokenIdentitySchema), + NestedField(UserIdentitySchema), ] ) value = identify_schema._deserialize(value=value, attr=None, data=None) @@ -337,8 +330,7 @@ def code(self, value: str) -> None: message=msg.format(self.component), no_personal_data_message=msg.format(self.component), target=ErrorTarget.SPARK_JOB, - error_category=ErrorCategory.USER_ERROR, - ) + error_category=ErrorCategory.USER_ERROR) @classmethod def _from_rest_object_to_init_params(cls, obj: dict) -> Dict: @@ -411,8 +403,7 @@ def _load_from_rest_job(cls, obj: JobBaseData) -> "Spark": dynamic_allocation_max_executors=rest_spark_conf.get(SparkConfKey.DYNAMIC_ALLOCATION_MAX_EXECUTORS, None), resources=SparkResourceConfiguration._from_rest_object(rest_spark_job.resources), inputs=from_rest_inputs_to_dataset_literal(rest_spark_job.inputs), - outputs=from_rest_data_outputs(rest_spark_job.outputs), - ) + outputs=from_rest_data_outputs(rest_spark_job.outputs)) return spark_job @classmethod @@ -460,8 +451,7 @@ def _to_job(self) -> SparkJob: services=self.services, args=self.args, compute=self.compute, - resources=self.resources, - ) + resources=self.resources) return SparkJob( experiment_name=self.experiment_name, @@ -492,8 +482,7 @@ def _to_job(self) -> SparkJob: services=self.services, args=self.args, compute=self.compute, - resources=self.resources, - ) + resources=self.resources) @classmethod def _create_schema_for_validation(cls, context: Any) -> Union[PathAwareSchema, Schema]: @@ -547,8 +536,7 @@ def _customized_validate(self) -> MutableValidationResult: ): result.append_warning( yaml_path="environment.image", - message=SPARK_ENVIRONMENT_WARNING_MESSAGE, - ) + message=SPARK_ENVIRONMENT_WARNING_MESSAGE) result.merge_with(self._validate_entry_exist()) result.merge_with(self._validate_fields()) return result @@ -659,5 +647,4 @@ def __call__(self, *args: Any, **kwargs: Any) -> "Spark": raise ValidationException( message=msg.format(type(Component), self._component), no_personal_data_message=msg.format(type(Component), "self._component"), - target=ErrorTarget.SPARK_JOB, - ) + target=ErrorTarget.SPARK_JOB) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/sweep.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/sweep.py index 603babbe215c..fe0d7f434391 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/sweep.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_builders/sweep.py @@ -17,8 +17,7 @@ from azure.ai.ml.entities._credentials import ( AmlTokenConfiguration, ManagedIdentityConfiguration, - UserIdentityConfiguration, -) + UserIdentityConfiguration) from azure.ai.ml.entities._inputs_outputs import Input, Output from azure.ai.ml.entities._job.job_limits import SweepJobLimits from azure.ai.ml.entities._job.job_resource_configuration import JobResourceConfiguration @@ -28,8 +27,7 @@ BanditPolicy, EarlyTerminationPolicy, MedianStoppingPolicy, - TruncationSelectionPolicy, -) + TruncationSelectionPolicy) from azure.ai.ml.entities._job.sweep.objective import Objective from azure.ai.ml.entities._job.sweep.parameterized_sweep import ParameterizedSweep from azure.ai.ml.entities._job.sweep.sampling_algorithm import SamplingAlgorithm @@ -44,8 +42,7 @@ QUniform, Randint, SweepDistribution, - Uniform, -) + Uniform) from azure.ai.ml.exceptions import ErrorTarget, UserErrorException, ValidationErrorType, ValidationException from azure.ai.ml.sweep import SweepJob @@ -155,8 +152,7 @@ def __init__( ] = None, queue_settings: Optional[QueueSettings] = None, resources: Optional[Union[dict, JobResourceConfiguration]] = None, - **kwargs: Any, - ) -> None: + **kwargs: Any) -> None: # TODO: get rid of self._job_inputs, self._job_outputs once we have general Input self._job_inputs, self._job_outputs = inputs, outputs @@ -168,8 +164,7 @@ def __init__( inputs=inputs, outputs=outputs, compute=compute, - **kwargs, - ) + **kwargs) # init mark for _AttrDict self._init = True ParameterizedSweep.__init__( @@ -180,8 +175,7 @@ def __init__( early_termination=early_termination, search_space=search_space, queue_settings=queue_settings, - resources=resources, - ) + resources=resources) self.identity: Any = identity self._init = False @@ -197,8 +191,7 @@ def trial(self) -> CommandComponent: @property def search_space( - self, - ) -> Optional[ + self) -> Optional[ Dict[ str, Union[Choice, LogNormal, LogUniform, Normal, QLogNormal, QLogUniform, QNormal, QUniform, Randint, Uniform], @@ -252,8 +245,7 @@ def _get_supported_inputs_types(cls) -> Tuple: supported_types = super()._get_supported_inputs_types() or () return ( SweepDistribution, - *supported_types, - ) + *supported_types) @classmethod def _load_from_dict(cls, data: Dict, context: Dict, additional_message: str, **kwargs: Any) -> "Sweep": @@ -308,7 +300,7 @@ def _from_rest_object_to_init_params(cls, obj: dict) -> Dict: schema = ParameterizedSweepSchema(context={BASE_PATH_CONTEXT_KEY: "./"}) support_data_binding_expression_for_fields(schema, ["type", "component", "trial"]) - base_sweep = schema.load(obj, unknown=EXCLUDE, partial=True) + base_sweep = schema.load(obj, partial=True) for key, value in base_sweep.items(): obj[key] = value @@ -359,8 +351,7 @@ def _to_job(self) -> SweepJob: outputs=self._job_outputs, identity=self.identity, queue_settings=self.queue_settings, - resources=self.resources, - ) + resources=self.resources) @classmethod def _get_component_attr_name(cls) -> str: @@ -412,8 +403,7 @@ def _get_origin_inputs_and_search_space(cls, built_inputs: Optional[Dict[str, No message=msg.format(input_name, type(input_obj)), no_personal_data_message=msg.format("[input_name]", type(input_obj)), target=ErrorTarget.SWEEP_JOB, - error_type=ValidationErrorType.INVALID_VALUE, - ) + error_type=ValidationErrorType.INVALID_VALUE) return inputs, search_space def _is_input_set(self, input_name: str) -> bool: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_component/component.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_component/component.py index c02a3a33794a..ed0d21050739 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_component/component.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_component/component.py @@ -13,8 +13,7 @@ ComponentContainer, ComponentContainerProperties, ComponentVersion, - ComponentVersionProperties, -) + ComponentVersionProperties) from ..._schema import PathAwareSchema from ..._schema.component import ComponentSchema from ..._utils.utils import dump_yaml_to_file, hash_dict @@ -25,8 +24,7 @@ REGISTRY_URI_FORMAT, SOURCE_PATH_CONTEXT_KEY, CommonYamlFields, - SchemaUrl, -) + SchemaUrl) from ...constants._component import ComponentSource, IOConstants, NodeType from ...entities._assets.asset import Asset from ...entities._inputs_outputs import Input, Output @@ -52,8 +50,7 @@ class Component( TelemetryMixin, YamlTranslatableMixin, PathAwareSchemaValidatableMixin, - LocalizableMixin, -): + LocalizableMixin): """Base class for component version, used to define a component. Can't be instantiated directly. :param name: Name of the resource. @@ -107,8 +104,7 @@ def __init__( yaml_str: Optional[str] = None, _schema: Optional[str] = None, creation_context: Optional[SystemData] = None, - **kwargs: Any, - ) -> None: + **kwargs: Any) -> None: self.latest_version = None self._intellectual_property = kwargs.pop("intellectual_property", None) # Setting this before super init because when asset init version, _auto_increment_version's value may change @@ -134,8 +130,7 @@ def __init__( creation_context=creation_context, is_anonymous=is_anonymous, base_path=kwargs.pop(BASE_PATH_CONTEXT_KEY, None), - source_path=kwargs.pop(SOURCE_PATH_CONTEXT_KEY, None), - ) + source_path=kwargs.pop(SOURCE_PATH_CONTEXT_KEY, None)) # store kwargs to self._other_parameter instead of pop to super class to allow component have extra # fields not defined in current schema. @@ -243,8 +238,7 @@ def version(self, value: str) -> None: message=msg, target=ErrorTarget.COMPONENT, no_personal_data_message=msg, - error_category=ErrorCategory.USER_ERROR, - ) + error_category=ErrorCategory.USER_ERROR) self._version = value self._auto_increment_version = self.name and not self._version @@ -265,8 +259,7 @@ def dump(self, dest: Union[str, PathLike, IO[AnyStr]], **kwargs: Any) -> None: @staticmethod def _resolve_component_source_from_id( # pylint: disable=docstring-type-do-not-use-class - id: Optional[Union["Component", str]], - ) -> Any: + id: Optional[Union["Component", str]]) -> Any: """Resolve the component source from id. :param id: The component ID @@ -342,8 +335,7 @@ def _create_validation_error(cls, message: str, no_personal_data_message: str) - return ValidationException( message=message, no_personal_data_message=no_personal_data_message, - target=ErrorTarget.COMPONENT, - ) + target=ErrorTarget.COMPONENT) @classmethod def _is_flow(cls, data: Any) -> bool: @@ -359,8 +351,7 @@ def _load( data: Optional[Dict] = None, yaml_path: Optional[Union[PathLike, str]] = None, params_override: Optional[list] = None, - **kwargs: Any, - ) -> "Component": + **kwargs: Any) -> "Component": data = data or {} params_override = params_override or [] base_path = Path(yaml_path).parent if yaml_path else Path("./") @@ -380,8 +371,7 @@ def _load( create_instance_func, _ = component_factory.get_create_funcs( data, - for_load=True, - ) + for_load=True) new_instance: Component = create_instance_func() # specific keys must be popped before loading with schema using kwargs init_kwargs = { @@ -396,10 +386,8 @@ def _load( SOURCE_PATH_CONTEXT_KEY: yaml_path, PARAMS_OVERRIDE_KEY: params_override, }, - unknown=INCLUDE, raise_original_exception=True, - **kwargs, - ) + **kwargs) ) # Set base path separately to avoid doing this in post load, as return types of post load are not unified, # could be object or dict. @@ -409,8 +397,7 @@ def _load( init_kwargs[SOURCE_PATH_CONTEXT_KEY] = Path(yaml_path).absolute().as_posix() # TODO: Bug Item number: 2883415 new_instance.__init__( # type: ignore - **init_kwargs, - ) + **init_kwargs) return new_instance @classmethod @@ -470,7 +457,7 @@ def _from_rest_object_to_init_params(cls, obj: ComponentVersion) -> Dict: origin_name = rest_component_version.component_spec[CommonYamlFields.NAME] rest_component_version.component_spec[CommonYamlFields.NAME] = ANONYMOUS_COMPONENT_NAME init_kwargs = cls._load_with_schema( - rest_component_version.component_spec, context={BASE_PATH_CONTEXT_KEY: Path.cwd()}, unknown=INCLUDE + rest_component_version.component_spec, context={BASE_PATH_CONTEXT_KEY: Path.cwd()} ) init_kwargs.update( { @@ -576,8 +563,7 @@ def _to_rest_object(self) -> ComponentVersion: description=self.description, is_anonymous=self._is_anonymous, properties=dict(self.properties) if self.properties else {}, - tags=self.tags, - ) + tags=self.tags) result = ComponentVersion(properties=properties) if self._is_anonymous: result.name = ANONYMOUS_COMPONENT_NAME @@ -636,6 +622,5 @@ def __call__(self, *args: Any, **kwargs: Any) -> "BaseNode": message=msg, target=ErrorTarget.COMPONENT, no_personal_data_message=msg, - error_category=ErrorCategory.USER_ERROR, - ) + error_category=ErrorCategory.USER_ERROR) return self._func(*args, **kwargs) # pylint: disable=not-callable diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_component/flow.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_component/flow.py index e4ff06cc5319..9d4519f51684 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_component/flow.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_component/flow.py @@ -495,9 +495,9 @@ def _load_with_schema( # unlike other component, we should ignore unknown fields in flow to keep init_params clean and avoid # too much understanding of flow.dag.yaml & run.yaml - kwargs["unknown"] = EXCLUDE + # In marshmallow 4.x, use unknown parameter during schema.load() call try: - loaded_dict = schema.load(data, **kwargs) + loaded_dict = schema.load(data, unknown=EXCLUDE, **kwargs) except ValidationError as e: if raise_original_exception: raise e diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/_aml_compute_node_info.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/_aml_compute_node_info.py index 823a89ca685a..a3d6a3bb769e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/_aml_compute_node_info.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/_aml_compute_node_info.py @@ -46,5 +46,5 @@ def _from_rest_object(cls, rest_obj: AmlComputeNodeInformation) -> "AmlComputeNo def _to_dict(self) -> Dict: # pylint: disable=no-member - res: dict = AmlComputeNodeInfoSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = AmlComputeNodeInfoSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/_usage.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/_usage.py index 6702382eb624..3e890e9803ee 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/_usage.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/_usage.py @@ -86,7 +86,7 @@ def dump(self, dest: Union[str, PathLike, IO[AnyStr]], **kwargs: Any) -> None: def _to_dict(self) -> Dict: # pylint: disable=no-member - res: dict = UsageSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = UsageSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res @classmethod diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/_vm_size.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/_vm_size.py index 2f0049f0ca47..bbedae89b0ac 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/_vm_size.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/_vm_size.py @@ -90,7 +90,7 @@ def dump(self, dest: Union[str, PathLike, IO[AnyStr]], **kwargs: Any) -> None: def _to_dict(self) -> Dict: # pylint: disable=no-member - res: dict = VmSizeSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = VmSizeSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res @classmethod diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/aml_compute.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/aml_compute.py index 141b61878bef..f3eafab1d484 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/aml_compute.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/aml_compute.py @@ -220,7 +220,7 @@ def _set_full_subnet_name(self, subscription_id: str, rg: str) -> None: ) def _to_dict(self) -> Dict: - res: dict = AmlComputeSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = AmlComputeSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res @classmethod diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/compute.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/compute.py index aa2cbedda5b5..ab1e32dfd91f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/compute.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/compute.py @@ -154,7 +154,7 @@ def dump(self, dest: Union[str, PathLike, IO[AnyStr]], **kwargs: Any) -> None: dump_yaml_to_file(dest, yaml_serialized, default_flow_style=False, path=path, **kwargs) def _to_dict(self) -> Dict: - res: dict = ComputeSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = ComputeSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res @classmethod diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/compute_instance.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/compute_instance.py index 5117a9d4a8bf..17d0af0334dc 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/compute_instance.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/compute_instance.py @@ -342,7 +342,7 @@ def _to_rest_object(self) -> ComputeResource: ) def _to_dict(self) -> Dict: - res: dict = ComputeInstanceSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = ComputeInstanceSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res def _set_full_subnet_name(self, subscription_id: str, rg: str) -> None: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/kubernetes_compute.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/kubernetes_compute.py index bc8c2c28f055..bc257b8bc34c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/kubernetes_compute.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/kubernetes_compute.py @@ -74,7 +74,7 @@ def _load_from_rest(cls, rest_obj: ComputeResource) -> "KubernetesCompute": ) def _to_dict(self) -> Dict: - res: dict = KubernetesComputeSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = KubernetesComputeSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res @classmethod diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/synapsespark_compute.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/synapsespark_compute.py index 99b366cb9224..ea3f362e2a77 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/synapsespark_compute.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/synapsespark_compute.py @@ -205,7 +205,7 @@ def _load_from_rest(cls, rest_obj: ComputeResource) -> "SynapseSparkCompute": ) def _to_dict(self) -> Dict: - res: dict = SynapseSparkComputeSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = SynapseSparkComputeSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res @classmethod diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/virtual_machine_compute.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/virtual_machine_compute.py index 90c3ec6302f7..7e817bca2783 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/virtual_machine_compute.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/virtual_machine_compute.py @@ -141,7 +141,7 @@ def _load_from_rest(cls, rest_obj: ComputeResource) -> "VirtualMachineCompute": return response def _to_dict(self) -> Dict: - res: dict = VirtualMachineComputeSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = VirtualMachineComputeSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res @classmethod diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_data/mltable_metadata.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_data/mltable_metadata.py index 452b2e53f029..77dd13c70873 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_data/mltable_metadata.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_data/mltable_metadata.py @@ -47,8 +47,7 @@ def __init__( paths: List[MLTableMetadataPath], transformations: Optional[List[Any]] = None, base_path: str, - **_kwargs: Any, - ): + **_kwargs: Any): self.base_path = base_path self.paths = paths self.transformations = transformations @@ -57,8 +56,7 @@ def __init__( def load( cls, yaml_path: Union[PathLike, str], - **kwargs: Any, - ) -> "MLTableMetadata": + **kwargs: Any) -> "MLTableMetadata": """Construct an MLTable object from yaml file. :param yaml_path: Path to a local file as the source. @@ -75,17 +73,16 @@ def _load( cls, yaml_data: Optional[Dict], yaml_path: Optional[Union[PathLike, str]], - **kwargs: Any, - ) -> "MLTableMetadata": + **kwargs: Any) -> "MLTableMetadata": yaml_data = yaml_data or {} context = { BASE_PATH_CONTEXT_KEY: Path(yaml_path).parent if yaml_path else Path("./"), } - res: MLTableMetadata = load_from_dict(MLTableMetadataSchema, yaml_data, context, "", unknown=INCLUDE, **kwargs) + res: MLTableMetadata = load_from_dict(MLTableMetadataSchema, yaml_data, context, "", **kwargs) return res def _to_dict(self) -> Dict: - res: dict = MLTableMetadataSchema(context={BASE_PATH_CONTEXT_KEY: "./"}, unknown=INCLUDE).dump(self) + res: dict = MLTableMetadataSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res def referenced_uris(self) -> List[Optional[str]]: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/_on_prem.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/_on_prem.py index e6c0dc3f43e7..418ed5b874d4 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/_on_prem.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/_on_prem.py @@ -117,5 +117,5 @@ def __ne__(self, other: Any) -> bool: def _to_dict(self) -> Dict: context = {BASE_PATH_CONTEXT_KEY: Path(".").parent} - res: dict = HdfsSchema(context=context).dump(self) + res: dict = HdfsSchema().dump(self, context=context) return res diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/adls_gen1.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/adls_gen1.py index c26107034bd3..da8d01be2b8a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/adls_gen1.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/adls_gen1.py @@ -102,5 +102,5 @@ def __ne__(self, other: Any) -> bool: def _to_dict(self) -> Dict: context = {BASE_PATH_CONTEXT_KEY: Path(".").parent} - res: dict = AzureDataLakeGen1Schema(context=context).dump(self) + res: dict = AzureDataLakeGen1Schema().dump(self, context=context) return res diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/azure_storage.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/azure_storage.py index 0fff1925177a..c2c91a5cdd66 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/azure_storage.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/azure_storage.py @@ -126,7 +126,7 @@ def __ne__(self, other: Any) -> bool: def _to_dict(self) -> Dict: context = {BASE_PATH_CONTEXT_KEY: Path(".").parent} - res: dict = AzureFileSchema(context=context).dump(self) + res: dict = AzureFileSchema().dump(self, context=context) return res @@ -227,7 +227,7 @@ def __ne__(self, other: Any) -> bool: def _to_dict(self) -> Dict: context = {BASE_PATH_CONTEXT_KEY: Path(".").parent} - res: dict = AzureBlobSchema(context=context).dump(self) + res: dict = AzureBlobSchema().dump(self, context=context) return res @@ -333,5 +333,5 @@ def __ne__(self, other: Any) -> bool: def _to_dict(self) -> Dict: context = {BASE_PATH_CONTEXT_KEY: Path(".").parent} - res: dict = AzureDataLakeGen2Schema(context=context).dump(self) + res: dict = AzureDataLakeGen2Schema().dump(self, context=context) return res diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/one_lake.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/one_lake.py index 9bc06d927255..26940cdd2bcc 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/one_lake.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_datastore/one_lake.py @@ -149,5 +149,5 @@ def __ne__(self, other: Any) -> bool: def _to_dict(self) -> Dict: context = {BASE_PATH_CONTEXT_KEY: Path(".").parent} - res: dict = OneLakeSchema(context=context).dump(self) + res: dict = OneLakeSchema().dump(self, context=context) return res diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/batch_deployment.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/batch_deployment.py index dc2852c6cccf..fe9f54261635 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/batch_deployment.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/batch_deployment.py @@ -235,7 +235,7 @@ def provisioning_state(self) -> Optional[str]: return self._provisioning_state def _to_dict(self) -> Dict: - res: dict = BatchDeploymentSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = BatchDeploymentSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res @classmethod diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/data_asset.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/data_asset.py index 72d241311864..5bad7900f0d7 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/data_asset.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/data_asset.py @@ -34,5 +34,5 @@ def __init__( def _to_dict(self) -> Dict: # pylint: disable=no-member - res: dict = DataAssetSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = DataAssetSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/data_collector.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/data_collector.py index 74277c61879c..68fab2d5fd96 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/data_collector.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/data_collector.py @@ -47,7 +47,7 @@ def __init__( def _to_dict(self) -> Dict: # pylint: disable=no-member - res: dict = DataCollectorSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = DataCollectorSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res @classmethod diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/deployment_collection.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/deployment_collection.py index c1b1c7507826..b58d403facba 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/deployment_collection.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/deployment_collection.py @@ -41,7 +41,7 @@ def __init__( def _to_dict(self) -> Dict: # pylint: disable=no-member - res: dict = DeploymentCollectionSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = DeploymentCollectionSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res @classmethod diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/event_hub.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/event_hub.py index 2729fa50ffd2..218973732291 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/event_hub.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/event_hub.py @@ -28,5 +28,5 @@ def __init__( def _to_dict(self) -> Dict: # pylint: disable=no-member - res: dict = EventHubSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = EventHubSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/job_definition.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/job_definition.py index 56bebebc6ffa..b2e7760ff34f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/job_definition.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/job_definition.py @@ -54,5 +54,5 @@ def __init__( def _to_dict(self) -> Dict: # pylint: disable=no-member - res: dict = JobDefinitionSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = JobDefinitionSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/model_batch_deployment.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/model_batch_deployment.py index 66e345c5acaf..278bc67efdc8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/model_batch_deployment.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/model_batch_deployment.py @@ -161,5 +161,5 @@ def _load( return res def _to_dict(self) -> Dict: - res: dict = ModelBatchDeploymentSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = ModelBatchDeploymentSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/model_batch_deployment_settings.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/model_batch_deployment_settings.py index 0d004a1ed8e6..2f38158fc9e7 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/model_batch_deployment_settings.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/model_batch_deployment_settings.py @@ -75,5 +75,5 @@ def __init__( def _to_dict(self) -> Dict: # pylint: disable=no-member - res: dict = ModelBatchDeploymentSettingsSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = ModelBatchDeploymentSettingsSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/online_deployment.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/online_deployment.py index 131d3293a8b8..0116689e4465 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/online_deployment.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/online_deployment.py @@ -419,7 +419,7 @@ def __init__( self.resources = resources def _to_dict(self) -> Dict: - res: dict = KubernetesOnlineDeploymentSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = KubernetesOnlineDeploymentSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res # pylint: disable=arguments-differ @@ -625,7 +625,7 @@ def __init__( self.egress_public_network_access = egress_public_network_access def _to_dict(self) -> Dict: - res: dict = ManagedOnlineDeploymentSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = ManagedOnlineDeploymentSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res # pylint: disable=arguments-differ diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/oversize_data_config.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/oversize_data_config.py index 80338c397a9d..c3d6fd623234 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/oversize_data_config.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/oversize_data_config.py @@ -21,5 +21,5 @@ def __init__(self, path: Optional[str] = None, **kwargs: Any): def _to_dict(self) -> Dict: # pylint: disable=no-member - res: dict = OversizeDataConfigSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = OversizeDataConfigSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/payload_response.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/payload_response.py index b67d46c73a3c..daa3a6926de8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/payload_response.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/payload_response.py @@ -22,5 +22,5 @@ def __init__(self, enabled: Optional[str] = None, **kwargs: Any): def _to_dict(self) -> Dict: # pylint: disable=no-member - res: dict = PayloadResponseSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = PayloadResponseSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/pipeline_component_batch_deployment.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/pipeline_component_batch_deployment.py index faad8d7c3286..935b25bf6a68 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/pipeline_component_batch_deployment.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/pipeline_component_batch_deployment.py @@ -139,6 +139,6 @@ def dump(self, dest: Union[str, PathLike, IO[AnyStr]], **kwargs: Any) -> None: dump_yaml_to_file(dest, yaml_serialized, default_flow_style=False, path=path, **kwargs) def _to_dict(self) -> Dict: - res: dict = PipelineComponentBatchDeploymentSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = PipelineComponentBatchDeploymentSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/request_logging.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/request_logging.py index 20cc83fe2a46..e2ed9c02b4e6 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/request_logging.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/request_logging.py @@ -32,7 +32,7 @@ def _from_rest_object(cls, rest_obj: RestRequestLogging) -> "RequestLogging": def _to_dict(self) -> Dict: # pylint: disable=no-member - res: dict = RequestLoggingSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = RequestLoggingSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res def _to_rest_object(self) -> RestRequestLogging: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/run_settings.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/run_settings.py index f1deac83996a..71d8239b762e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/run_settings.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/run_settings.py @@ -46,5 +46,5 @@ def __init__( def _to_dict(self) -> Dict: # pylint: disable=no-member - res: dict = RunSettingsSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = RunSettingsSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_endpoint/batch_endpoint.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_endpoint/batch_endpoint.py index 4883c828b982..f3ce58a734fe 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_endpoint/batch_endpoint.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_endpoint/batch_endpoint.py @@ -110,7 +110,7 @@ def dump( **kwargs: Any, ) -> Dict[str, Any]: context = {BASE_PATH_CONTEXT_KEY: Path(".").parent} - return BatchEndpointSchema(context=context).dump(self) # type: ignore + return BatchEndpointSchema().dump(self, context=context) # type: ignore @classmethod def _load( @@ -130,5 +130,5 @@ def _load( return res def _to_dict(self) -> Dict: - res: dict = BatchEndpointSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = BatchEndpointSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_endpoint/online_endpoint.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_endpoint/online_endpoint.py index cdd725364f84..652489704861 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_endpoint/online_endpoint.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_endpoint/online_endpoint.py @@ -418,7 +418,7 @@ def dump( **kwargs: Any, ) -> Dict[str, Any]: context = {BASE_PATH_CONTEXT_KEY: Path(".").parent} - res: dict = KubernetesOnlineEndpointSchema(context=context).dump(self) + res: dict = KubernetesOnlineEndpointSchema().dump(self, context=context) return res def _to_rest_online_endpoint(self, location: str) -> OnlineEndpointData: @@ -446,7 +446,7 @@ def _merge_with(self, other: "KubernetesOnlineEndpoint") -> None: self.compute = other.compute or self.compute def _to_dict(self) -> Dict: - res: dict = KubernetesOnlineEndpointSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = KubernetesOnlineEndpointSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res @@ -544,11 +544,11 @@ def dump( **kwargs: Any, ) -> Dict[str, Any]: context = {BASE_PATH_CONTEXT_KEY: Path(".").parent} - res: dict = ManagedOnlineEndpointSchema(context=context).dump(self) + res: dict = ManagedOnlineEndpointSchema().dump(self, context=context) return res def _to_dict(self) -> Dict: - res: dict = ManagedOnlineEndpointSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = ManagedOnlineEndpointSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_feature_set/featureset_spec_metadata.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_feature_set/featureset_spec_metadata.py index 4178b0743c1d..849b3b1de30f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_feature_set/featureset_spec_metadata.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_feature_set/featureset_spec_metadata.py @@ -35,8 +35,7 @@ def __init__( index_columns: Optional[List[DataColumn]] = None, source_lookback: Optional[DelayMetadata] = None, temporal_join_lookback: Optional[DelayMetadata] = None, - **_kwargs: Any, - ): + **_kwargs: Any): if source.type == "featureset" and index_columns: msg = f"You cannot provide index_columns for {source.type} feature source." raise ValidationException( @@ -44,8 +43,7 @@ def __init__( no_personal_data_message=msg, error_type=ValidationErrorType.INVALID_VALUE, target=ErrorTarget.FEATURE_SET, - error_category=ErrorCategory.USER_ERROR, - ) + error_category=ErrorCategory.USER_ERROR) if not index_columns and source.type != "featureset": msg = f"You need to provide index_columns for {source.type} feature source." raise ValidationException( @@ -53,8 +51,7 @@ def __init__( no_personal_data_message=msg, error_type=ValidationErrorType.INVALID_VALUE, target=ErrorTarget.FEATURE_SET, - error_category=ErrorCategory.USER_ERROR, - ) + error_category=ErrorCategory.USER_ERROR) self.source = source self.feature_transformation_code = feature_transformation_code self.features = features @@ -66,8 +63,7 @@ def __init__( def load( cls, yaml_path: Union[PathLike, str], - **kwargs: Any, - ) -> "FeaturesetSpecMetadata": + **kwargs: Any) -> "FeaturesetSpecMetadata": """Construct an FeaturesetSpecMetadata object from yaml file. :param yaml_path: Path to a local file as the source. @@ -84,18 +80,17 @@ def _load( cls, yaml_data: Optional[Dict], yaml_path: Optional[Union[PathLike, str]], - **kwargs: Any, - ) -> "FeaturesetSpecMetadata": + **kwargs: Any) -> "FeaturesetSpecMetadata": yaml_data = yaml_data or {} context = { BASE_PATH_CONTEXT_KEY: Path(yaml_path).parent if yaml_path else Path("./"), } res: FeaturesetSpecMetadata = load_from_dict( - FeaturesetSpecMetadataSchema, yaml_data, context, "", unknown=INCLUDE, **kwargs + FeaturesetSpecMetadataSchema, yaml_data, context, "", **kwargs ) return res def _to_dict(self) -> Dict: - res: dict = FeaturesetSpecPropertiesSchema(context={BASE_PATH_CONTEXT_KEY: "./"}, unknown=INCLUDE).dump(self) + res: dict = FeaturesetSpecPropertiesSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_feature_store/feature_store.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_feature_store/feature_store.py index 0c41f1a3e6ad..2685e6da9d40 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_feature_store/feature_store.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_feature_store/feature_store.py @@ -222,5 +222,5 @@ def _load( return FeatureStore(**loaded_schema) def _to_dict(self) -> Dict: - res: dict = FeatureStoreSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = FeatureStoreSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_feature_store_entity/feature_store_entity.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_feature_store_entity/feature_store_entity.py index 6a04bc13dd1d..35ea5006e17e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_feature_store_entity/feature_store_entity.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_feature_store_entity/feature_store_entity.py @@ -142,5 +142,5 @@ def _load( return FeatureStoreEntity(**loaded_schema) def _to_dict(self) -> Dict: - res: dict = FeatureStoreEntitySchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = FeatureStoreEntitySchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_classification_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_classification_job.py index a1b9dbc337dd..dbc04d6c4b20 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_classification_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_classification_job.py @@ -227,7 +227,7 @@ def _to_dict(self, inside_pipeline: bool = False) -> Dict: context={BASE_PATH_CONTEXT_KEY: "./", "inside_pipeline": True} ).dump(self) else: - schema_dict = ImageClassificationSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + schema_dict = ImageClassificationSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return schema_dict diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_classification_multilabel_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_classification_multilabel_job.py index 541f41c7757c..3a74e3717fd5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_classification_multilabel_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_classification_multilabel_job.py @@ -235,7 +235,7 @@ def _to_dict(self, inside_pipeline: bool = False) -> Dict: context={BASE_PATH_CONTEXT_KEY: "./", "inside_pipeline": True} ).dump(self) else: - schema_dict = ImageClassificationMultilabelSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + schema_dict = ImageClassificationMultilabelSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return schema_dict diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_instance_segmentation_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_instance_segmentation_job.py index c97d3c115ccb..9a1dc5a8bebf 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_instance_segmentation_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_instance_segmentation_job.py @@ -232,7 +232,7 @@ def _to_dict(self, inside_pipeline: bool = False) -> Dict: context={BASE_PATH_CONTEXT_KEY: "./", "inside_pipeline": True} ).dump(self) else: - schema_dict = ImageInstanceSegmentationSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + schema_dict = ImageInstanceSegmentationSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return schema_dict diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_object_detection_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_object_detection_job.py index f8d070d226d0..7b0b20927265 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_object_detection_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/image/image_object_detection_job.py @@ -223,7 +223,7 @@ def _to_dict(self, inside_pipeline: bool = False) -> Dict: context={BASE_PATH_CONTEXT_KEY: "./", "inside_pipeline": True} ).dump(self) else: - schema_dict = ImageObjectDetectionSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + schema_dict = ImageObjectDetectionSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return schema_dict diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/text_classification_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/text_classification_job.py index 290f4f70b382..ed4346f95162 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/text_classification_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/text_classification_job.py @@ -232,7 +232,7 @@ def _to_dict(self, inside_pipeline: bool = False) -> Dict: res_autoML: dict = AutoMLTextClassificationNode(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) return res_autoML - res: dict = TextClassificationSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = TextClassificationSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res def __eq__(self, other: object) -> bool: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/text_classification_multilabel_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/text_classification_multilabel_job.py index ac19b4515caa..894d5d7f9efb 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/text_classification_multilabel_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/text_classification_multilabel_job.py @@ -236,7 +236,7 @@ def _to_dict(self, inside_pipeline: bool = False) -> Dict: res_autoML: dict = AutoMLTextClassificationMultilabelNode(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) return res_autoML - res: dict = TextClassificationMultilabelSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = TextClassificationMultilabelSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res def __eq__(self, other: object) -> bool: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/text_ner_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/text_ner_job.py index a87965f1b7ed..ebcb730f1bc8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/text_ner_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/nlp/text_ner_job.py @@ -215,7 +215,7 @@ def _to_dict(self, inside_pipeline: bool = False) -> Dict: res_autoML: dict = AutoMLTextNerNode(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) return res_autoML - res: dict = TextNerSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = TextNerSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res def __eq__(self, other: object) -> bool: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/classification_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/classification_job.py index 6f5ab2719cb3..c9c516547d0b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/classification_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/classification_job.py @@ -316,9 +316,9 @@ def _to_dict(self, inside_pipeline: bool = False) -> Dict: schema_dict: dict = {} if inside_pipeline: - schema_dict = AutoMLClassificationNodeSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + schema_dict = AutoMLClassificationNodeSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) else: - schema_dict = AutoMLClassificationSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + schema_dict = AutoMLClassificationSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return schema_dict diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/forecasting_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/forecasting_job.py index 9bd10b19875d..8d5aaca0688a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/forecasting_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/forecasting_job.py @@ -668,9 +668,9 @@ def _to_dict(self, inside_pipeline: bool = False) -> Dict: schema_dict: dict = {} if inside_pipeline: - schema_dict = AutoMLForecastingNodeSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + schema_dict = AutoMLForecastingNodeSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) else: - schema_dict = AutoMLForecastingSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + schema_dict = AutoMLForecastingSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return schema_dict def __eq__(self, other: object) -> bool: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/regression_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/regression_job.py index 3531e52c16f3..494d16705dfd 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/regression_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/automl/tabular/regression_job.py @@ -220,9 +220,9 @@ def _to_dict(self, inside_pipeline: bool = False) -> Dict: schema_dict: dict = {} if inside_pipeline: - schema_dict = AutoMLRegressionNodeSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + schema_dict = AutoMLRegressionNodeSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) else: - schema_dict = AutoMLRegressionSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + schema_dict = AutoMLRegressionSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return schema_dict diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/base_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/base_job.py index 72b464e5b689..58c0f37b24cc 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/base_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/base_job.py @@ -52,7 +52,7 @@ def __init__(self, **kwargs: Any): super().__init__(**kwargs) def _to_dict(self) -> Dict: - res: dict = BaseJobSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = BaseJobSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res @classmethod diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/command_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/command_job.py index 0a0c7e82a7ac..e6119271357c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/command_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/command_job.py @@ -130,7 +130,7 @@ def parameters(self) -> Dict[str, str]: return self._parameters def _to_dict(self) -> Dict: - res: dict = CommandJobSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = CommandJobSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res def _to_rest_object(self) -> JobBase: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/data_transfer/data_transfer_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/data_transfer/data_transfer_job.py index b510da809e69..cbcb6e78dcbc 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/data_transfer/data_transfer_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/data_transfer/data_transfer_job.py @@ -164,7 +164,7 @@ def __init__( self.data_copy_mode = data_copy_mode def _to_dict(self) -> Dict: - res: dict = DataTransferCopyJobSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = DataTransferCopyJobSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res @classmethod @@ -237,7 +237,7 @@ def __init__( self.source = self._build_source_sink(source) def _to_dict(self) -> Dict: - res: dict = DataTransferImportJobSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = DataTransferImportJobSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res @classmethod @@ -303,7 +303,7 @@ def __init__( self.sink = self._build_source_sink(sink) def _to_dict(self) -> Dict: - res: dict = DataTransferExportJobSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = DataTransferExportJobSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res @classmethod diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/distillation/distillation_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/distillation/distillation_job.py index 469fde98a8c0..0b99b74f8318 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/distillation/distillation_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/distillation/distillation_job.py @@ -271,7 +271,7 @@ def _to_dict(self) -> Dict: from azure.ai.ml._schema._distillation.distillation_job import DistillationJobSchema schema_dict: dict = {} - schema_dict = DistillationJobSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + schema_dict = DistillationJobSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return schema_dict diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/finetuning/azure_openai_finetuning_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/finetuning/azure_openai_finetuning_job.py index e659c6345dcc..d4c9b95dc8a8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/finetuning/azure_openai_finetuning_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/finetuning/azure_openai_finetuning_job.py @@ -119,9 +119,9 @@ def _to_dict(self) -> Dict: schema_dict: dict = {} # TODO: Combeback to this later for FineTuningJob in Pipelines # if inside_pipeline: - # schema_dict = AutoMLClassificationNodeSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + # schema_dict = AutoMLClassificationNodeSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) # else: - schema_dict = AzureOpenAIFineTuningSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + schema_dict = AzureOpenAIFineTuningSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return schema_dict diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/finetuning/custom_model_finetuning_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/finetuning/custom_model_finetuning_job.py index e6ddd86d4249..3dd2b19d336a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/finetuning/custom_model_finetuning_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/finetuning/custom_model_finetuning_job.py @@ -119,9 +119,9 @@ def _to_dict(self) -> Dict: schema_dict: dict = {} # TODO: Combeback to this later for FineTuningJob in pipeline # if inside_pipeline: - # schema_dict = AutoMLClassificationNodeSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + # schema_dict = AutoMLClassificationNodeSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) # else: - schema_dict = CustomModelFineTuningSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + schema_dict = CustomModelFineTuningSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return schema_dict diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/import_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/import_job.py index 24d4ec90724c..857a968429c3 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/import_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/import_job.py @@ -174,7 +174,7 @@ def __init__( self.output = output def _to_dict(self) -> Dict: - res: dict = ImportJobSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = ImportJobSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res def _to_rest_object(self) -> JobBaseData: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/parallel/parallel_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/parallel/parallel_job.py index 49b2c992d5d4..d381d0ad076f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/parallel/parallel_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/parallel/parallel_job.py @@ -97,7 +97,7 @@ def __init__( self.identity = identity def _to_dict(self) -> Dict: - res: dict = ParallelJobSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = ParallelJobSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res def _to_rest_object(self) -> None: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/parallel/parallel_task.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/parallel/parallel_task.py index 7325aed34be4..5597206ee54e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/parallel/parallel_task.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/parallel/parallel_task.py @@ -73,7 +73,7 @@ def __init__( def _to_dict(self) -> Dict: # pylint: disable=no-member - res: dict = ComponentParallelTaskSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = ComponentParallelTaskSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res @classmethod diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/parallel/retry_settings.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/parallel/retry_settings.py index 2fb19ba18c86..ffab5909bcf8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/parallel/retry_settings.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/parallel/retry_settings.py @@ -35,7 +35,7 @@ def __init__( self.max_retries = max_retries def _to_dict(self) -> Dict: - res: dict = RetrySettingsSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) # pylint: disable=no-member + res: dict = RetrySettingsSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) # pylint: disable=no-member return res @classmethod diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/parameterized_command.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/parameterized_command.py index 57604b382e44..6e25b8cb1eb7 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/parameterized_command.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/parameterized_command.py @@ -19,15 +19,13 @@ MPIDistributionSchema, PyTorchDistributionSchema, RayDistributionSchema, - TensorFlowDistributionSchema, -) + TensorFlowDistributionSchema) from .distribution import ( DistributionConfiguration, MpiDistribution, PyTorchDistribution, RayDistribution, - TensorFlowDistribution, -) + TensorFlowDistribution) from .job_resource_configuration import JobResourceConfiguration from .queue_settings import QueueSettings @@ -84,8 +82,7 @@ def __init__( ] = None, environment: Optional[Union[Environment, str]] = None, queue_settings: Optional[QueueSettings] = None, - **kwargs: Dict, - ) -> None: + **kwargs: Dict) -> None: super().__init__(**kwargs) self.command = command self.code = code @@ -97,8 +94,7 @@ def __init__( @property def distribution( - self, - ) -> Optional[ + self) -> Optional[ Union[ dict, MpiDistribution, @@ -127,10 +123,10 @@ def distribution(self, value: Union[dict, PyTorchDistribution, MpiDistribution]) if isinstance(value, dict): dist_schema = UnionField( [ - NestedField(PyTorchDistributionSchema, unknown=INCLUDE), - NestedField(TensorFlowDistributionSchema, unknown=INCLUDE), - NestedField(MPIDistributionSchema, unknown=INCLUDE), - ExperimentalField(NestedField(RayDistributionSchema, unknown=INCLUDE)), + NestedField(PyTorchDistributionSchema), + NestedField(TensorFlowDistributionSchema), + NestedField(MPIDistributionSchema), + ExperimentalField(NestedField(RayDistributionSchema)), ] ) value = dist_schema._deserialize(value=value, attr=None, data=None) @@ -165,6 +161,5 @@ def _load_from_sweep_job(cls, sweep_job: SweepJob) -> "ParameterizedCommand": environment=sweep_job.trial.environment_id, distribution=DistributionConfiguration._from_rest_object(sweep_job.trial.distribution), resources=JobResourceConfiguration._from_rest_object(sweep_job.trial.resources), - queue_settings=QueueSettings._from_rest_object(sweep_job.queue_settings), - ) + queue_settings=QueueSettings._from_rest_object(sweep_job.queue_settings)) return parameterized_command diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/_load_component.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/_load_component.py index 60c4cbe7d823..976891e4d622 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/_load_component.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/pipeline/_load_component.py @@ -24,8 +24,7 @@ Import, Parallel, Spark, - Sweep, -) + Sweep) from azure.ai.ml.entities._builders.condition_node import ConditionNode from azure.ai.ml.entities._builders.control_flow_node import ControlFlowNode from azure.ai.ml.entities._builders.do_while import DoWhile @@ -48,86 +47,72 @@ def __init__(self) -> None: _type=NodeType.COMMAND, create_instance_func=lambda: Command.__new__(Command), load_from_rest_object_func=Command._from_rest_object, - nested_schema=None, - ) + nested_schema=None) self.register_type( _type=NodeType.IMPORT, create_instance_func=lambda: Import.__new__(Import), load_from_rest_object_func=Import._from_rest_object, - nested_schema=None, - ) + nested_schema=None) self.register_type( _type=NodeType.PARALLEL, create_instance_func=lambda: Parallel.__new__(Parallel), load_from_rest_object_func=Parallel._from_rest_object, - nested_schema=None, - ) + nested_schema=None) self.register_type( _type=NodeType.PIPELINE, create_instance_func=lambda: Pipeline.__new__(Pipeline), load_from_rest_object_func=Pipeline._from_rest_object, - nested_schema=None, - ) + nested_schema=None) self.register_type( _type=NodeType.SWEEP, create_instance_func=lambda: Sweep.__new__(Sweep), load_from_rest_object_func=Sweep._from_rest_object, - nested_schema=NestedField(SweepSchema, unknown=INCLUDE), - ) + nested_schema=NestedField(SweepSchema)) self.register_type( _type=NodeType.AUTOML, create_instance_func=None, load_from_rest_object_func=self._automl_from_rest_object, - nested_schema=None, - ) + nested_schema=None) self.register_type( _type=NodeType.SPARK, create_instance_func=lambda: Spark.__new__(Spark), load_from_rest_object_func=Spark._from_rest_object, - nested_schema=None, - ) + nested_schema=None) self.register_type( _type=ControlFlowType.DO_WHILE, create_instance_func=None, load_from_rest_object_func=DoWhile._from_rest_object, - nested_schema=None, - ) + nested_schema=None) self.register_type( _type=ControlFlowType.IF_ELSE, create_instance_func=None, load_from_rest_object_func=ConditionNode._from_rest_object, - nested_schema=None, - ) + nested_schema=None) self.register_type( _type=ControlFlowType.PARALLEL_FOR, create_instance_func=None, load_from_rest_object_func=ParallelFor._from_rest_object, - nested_schema=None, - ) + nested_schema=None) self.register_type( _type="_".join([NodeType.DATA_TRANSFER, DataTransferTaskType.COPY_DATA]), create_instance_func=lambda: DataTransferCopy.__new__(DataTransferCopy), load_from_rest_object_func=DataTransferCopy._from_rest_object, - nested_schema=None, - ) + nested_schema=None) self.register_type( _type="_".join([NodeType.DATA_TRANSFER, DataTransferTaskType.IMPORT_DATA]), create_instance_func=lambda: DataTransferImport.__new__(DataTransferImport), load_from_rest_object_func=DataTransferImport._from_rest_object, - nested_schema=None, - ) + nested_schema=None) self.register_type( _type="_".join([NodeType.DATA_TRANSFER, DataTransferTaskType.EXPORT_DATA]), create_instance_func=lambda: DataTransferExport.__new__(DataTransferExport), load_from_rest_object_func=DataTransferExport._from_rest_object, - nested_schema=None, - ) + nested_schema=None) self.register_type( _type=NodeType.FLOW_PARALLEL, create_instance_func=lambda: Parallel.__new__(Parallel), load_from_rest_object_func=None, - nested_schema=None, - ) + nested_schema=None) @classmethod def _get_func(cls, _type: str, funcs: Dict[str, Callable]) -> Callable: @@ -140,8 +125,7 @@ def _get_func(cls, _type: str, funcs: Dict[str, Callable]) -> Callable: message=msg, no_personal_data_message=msg, target=ErrorTarget.COMPONENT, - error_category=ErrorCategory.USER_ERROR, - ) + error_category=ErrorCategory.USER_ERROR) _type = get_type_from_spec({CommonYamlFields.TYPE: _type}, valid_keys=funcs) return funcs[_type] @@ -171,8 +155,7 @@ def register_type( *, create_instance_func: Optional[Callable[..., Union[BaseNode, AutoMLJob]]] = None, load_from_rest_object_func: Optional[Callable] = None, - nested_schema: Optional[Union[NestedField, List[NestedField]]] = None, - ) -> None: + nested_schema: Optional[Union[NestedField, List[NestedField]]] = None) -> None: """Register a type of node. :param _type: The type of the node. @@ -231,8 +214,7 @@ def load_from_dict(self, *, data: dict, _type: Optional[str] = None) -> Union[Ba if component_key in data and isinstance(data[component_key], dict): data[component_key] = Component._load( data=data[component_key], - yaml_path=data[component_key].pop(SOURCE_PATH_CONTEXT_KEY, None), - ) + yaml_path=data[component_key].pop(SOURCE_PATH_CONTEXT_KEY, None)) # TODO: Bug Item number: 2883415 new_instance.__init__(**data) # type: ignore return new_instance @@ -281,8 +263,7 @@ def _automl_from_rest_object(cls, node: Dict) -> AutoMLJob: node, context={BASE_PATH_CONTEXT_KEY: "./"}, additional_message="Failed to load automl task from backend.", - inside_pipeline=True, - ) + inside_pipeline=True) def _generate_component_function( @@ -299,12 +280,10 @@ def create_component_func(**kwargs: Any) -> Union[BaseNode, AutoMLJob]: if component_entity.task == DataTransferTaskType.IMPORT_DATA: # type: ignore return pipeline_node_factory.load_from_dict( data={"component": component_entity, "_from_component_func": True, **kwargs}, - _type=_type, - ) + _type=_type) return pipeline_node_factory.load_from_dict( data={"component": component_entity, "inputs": kwargs, "_from_component_func": True}, - _type=_type, - ) + _type=_type) res: Callable = to_component_func(component_entity, create_component_func) return res diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_job.py index 10930fb4cbd3..40c6963ddae2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/spark_job.py @@ -22,16 +22,14 @@ AmlTokenConfiguration, ManagedIdentityConfiguration, UserIdentityConfiguration, - _BaseJobIdentityConfiguration, -) + _BaseJobIdentityConfiguration) from azure.ai.ml.entities._inputs_outputs import Input, Output from azure.ai.ml.entities._job._input_output_helpers import ( from_rest_data_outputs, from_rest_inputs_to_dataset_literal, to_rest_data_outputs, to_rest_dataset_literal_inputs, - validate_inputs_for_args, -) + validate_inputs_for_args) from azure.ai.ml.entities._job.parameterized_spark import ParameterizedSpark from azure.ai.ml.entities._util import load_from_dict @@ -113,8 +111,7 @@ def __init__( Union[Dict[str, str], ManagedIdentityConfiguration, AmlTokenConfiguration, UserIdentityConfiguration] ] = None, resources: Optional[Union[Dict, SparkResourceConfiguration]] = None, - **kwargs: Any, - ) -> None: + **kwargs: Any) -> None: kwargs[TYPE] = JobType.SPARK super().__init__(**kwargs) @@ -158,8 +155,7 @@ def resources(self, value: Optional[Union[Dict[str, str], SparkResourceConfigura @property def identity( - self, - ) -> Optional[Union[Dict, ManagedIdentityConfiguration, AmlTokenConfiguration, UserIdentityConfiguration]]: + self) -> Optional[Union[Dict, ManagedIdentityConfiguration, AmlTokenConfiguration, UserIdentityConfiguration]]: """The identity that the Spark job will use while running on compute. :return: The identity that the Spark job will use while running on compute. @@ -173,8 +169,7 @@ def identity( self, value: Optional[ Union[Dict[str, str], ManagedIdentityConfiguration, AmlTokenConfiguration, UserIdentityConfiguration] - ], - ) -> None: + ]) -> None: """Sets the identity that the Spark job will use while running on compute. :param value: The identity that the Spark job will use while running on compute. @@ -184,16 +179,16 @@ def identity( if isinstance(value, dict): identify_schema = UnionField( [ - NestedField(ManagedIdentitySchema, unknown=INCLUDE), - NestedField(AMLTokenIdentitySchema, unknown=INCLUDE), - NestedField(UserIdentitySchema, unknown=INCLUDE), + NestedField(ManagedIdentitySchema), + NestedField(AMLTokenIdentitySchema), + NestedField(UserIdentitySchema), ] ) value = identify_schema._deserialize(value=value, attr=None, data=None) self._identity = value def _to_dict(self) -> Dict: - res: dict = SparkJobSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = SparkJobSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res def filter_conf_fields(self) -> Dict[str, str]: @@ -250,8 +245,7 @@ def _to_rest_object(self) -> JobBase: compute_id=self.compute, resources=( self.resources._to_rest_object() if self.resources and not isinstance(self.resources, Dict) else None - ), - ) + )) result = JobBase(properties=properties) result.name = self.name return result @@ -299,8 +293,7 @@ def _load_from_rest(cls, obj: JobBase) -> "SparkJob": dynamic_allocation_max_executors=rest_spark_conf.get(SparkConfKey.DYNAMIC_ALLOCATION_MAX_EXECUTORS, None), resources=SparkResourceConfiguration._from_rest_object(rest_spark_job.resources), inputs=from_rest_inputs_to_dataset_literal(rest_spark_job.inputs), - outputs=from_rest_data_outputs(rest_spark_job.outputs), - ) + outputs=from_rest_data_outputs(rest_spark_job.outputs)) return spark_job def _to_component(self, context: Optional[Dict] = None, **kwargs: Any) -> "SparkComponent": @@ -341,8 +334,7 @@ def _to_component(self, context: Optional[Dict] = None, **kwargs: Any) -> "Spark environment=self.environment, inputs=self._to_inputs(inputs=self.inputs, pipeline_job_dict=pipeline_job_dict), outputs=self._to_outputs(outputs=self.outputs, pipeline_job_dict=pipeline_job_dict), - args=self.args, - ) + args=self.args) def _to_node(self, context: Optional[Dict] = None, **kwargs: Any) -> "Spark": """Translate a spark job to a pipeline node. @@ -377,8 +369,7 @@ def _to_node(self, context: Optional[Dict] = None, **kwargs: Any) -> "Spark": outputs=self.outputs, # type: ignore[arg-type] compute=self.compute, resources=self.resources, - properties=self.properties_sparkJob, - ) + properties=self.properties_sparkJob) def _validate(self) -> None: # TODO: make spark job schema validatable? diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/sweep_job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/sweep_job.py index 0a99bb3917d6..b471e7a532ef 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/sweep_job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/sweep/sweep_job.py @@ -214,7 +214,7 @@ def __init__( ) def _to_dict(self) -> Dict: - res: dict = SweepJobSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = SweepJobSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res def _to_rest_object(self) -> JobBase: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/schedule.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/schedule.py index f23c4e3eba03..3ccf4b606cbf 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/schedule.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/schedule.py @@ -144,7 +144,7 @@ def dump(self, dest: Union[str, PathLike, IO[AnyStr]], **kwargs: Any) -> None: dump_yaml_to_file(dest, yaml_serialized, default_flow_style=False, path=path, **kwargs) def _to_dict(self) -> Dict: - res: dict = MonitorScheduleSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + res: dict = MonitorScheduleSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) return res @classmethod diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_util.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_util.py index 0199d8a40dc2..6dea4907a943 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_util.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_util.py @@ -189,7 +189,21 @@ def load_from_dict(schema: Any, data: Dict, context: Dict, additional_message: s :rtype: Any """ try: - return schema(context=context).load(data, **kwargs) + # In marshmallow 4.x, context should not be passed to schema constructor + # Instead, it should be passed to the load() method + # Some schemas (like PathAwareSchema) handle context in constructor but filter it properly + + # Try to create schema with context (for PathAwareSchema compatibility) + try: + schema_instance = schema(context=context) + except TypeError: + # If schema doesn't accept context parameter, create without it + schema_instance = schema() + # Pass context to load method instead + return schema_instance.load(data, context=context, **kwargs) + + # If schema creation succeeded, use it (PathAwareSchema case) + return schema_instance.load(data, **kwargs) except ValidationError as e: pretty_error = json.dumps(e.normalized_messages(), indent=2) raise ValidationError(decorate_validation_error(schema, pretty_error, additional_message)) from e diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/_ai_workspaces/capability_host.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/_ai_workspaces/capability_host.py index 4790ddc63676..0cddde7eb894 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/_ai_workspaces/capability_host.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/_ai_workspaces/capability_host.py @@ -99,7 +99,7 @@ def _to_dict(self) -> Dict: :rtype: Dict """ - return CapabilityHostSchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + return CapabilityHostSchema().dump(self, context={BASE_PATH_CONTEXT_KEY: "./"}) @classmethod def _load( diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_batch_endpoint_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_batch_endpoint_operations.py index 650185b3966b..267c78620934 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_batch_endpoint_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_batch_endpoint_operations.py @@ -349,7 +349,7 @@ def invoke( # pylint: disable=too-many-statements PARAMS_OVERRIDE_KEY: params_override, } - batch_job = BatchJobSchema(context=context).load(data={}) + batch_job = BatchJobSchema().load(data={}, context=context) # update output datastore to arm id if needed # TODO: Unify datastore name -> arm id logic, TASK: 1104172 request = {} diff --git a/sdk/ml/azure-ai-ml/dev_requirements.txt b/sdk/ml/azure-ai-ml/dev_requirements.txt index f02f4d437c79..a3d0dfa7626a 100644 --- a/sdk/ml/azure-ai-ml/dev_requirements.txt +++ b/sdk/ml/azure-ai-ml/dev_requirements.txt @@ -1,7 +1,7 @@ -e ../../../tools/azure-sdk-tools ../../core/azure-core ../../identity/azure-identity -marshmallow>=3.5,<4.0.0 +marshmallow>=4.0.0,<5.0.0 marshmallow-jsonschema==0.10.0 mock pytest-cov diff --git a/sdk/ml/azure-ai-ml/setup.py b/sdk/ml/azure-ai-ml/setup.py index f5ec547e827d..17e23923f388 100644 --- a/sdk/ml/azure-ai-ml/setup.py +++ b/sdk/ml/azure-ai-ml/setup.py @@ -72,7 +72,7 @@ "msrest>=0.6.18,<1.0.0", "azure-core>=1.23.0", "azure-mgmt-core>=1.3.0", - "marshmallow>=3.5,<4.0.0", + "marshmallow>=4.0.0,<5.0.0", "jsonschema>=4.0.0,<5.0.0", "tqdm<5.0.0", # Used for PR 825138 diff --git a/sdk/ml/azure-ai-ml/tests/component/unittests/test_command_component_entity.py b/sdk/ml/azure-ai-ml/tests/component/unittests/test_command_component_entity.py index b8fa4efc94cf..290567a87cda 100644 --- a/sdk/ml/azure-ai-ml/tests/component/unittests/test_command_component_entity.py +++ b/sdk/ml/azure-ai-ml/tests/component/unittests/test_command_component_entity.py @@ -12,8 +12,7 @@ from test_utilities.utils import ( build_temp_folder, mock_artifact_download_to_temp_directory, - verify_entity_load_and_dump, -) + verify_entity_load_and_dump) from azure.ai.ml import Input, MpiDistribution, Output, TensorFlowDistribution, command, load_component from azure.ai.ml._utils.utils import load_yaml @@ -54,8 +53,7 @@ def simple_component_validation(command_component): command_component = verify_entity_load_and_dump(load_component, simple_component_validation, component_yaml)[0] component_yaml = "./tests/test_configs/components/basic_component_code_arm_id.yml" command_component = load_component( - source=component_yaml, - ) + source=component_yaml) expected_code = ( "/subscriptions/4faaaf21-663f-4391-96fd-47197c630979/resourceGroups/" "test-rg-centraluseuap-v2-2021W10/providers/Microsoft.MachineLearningServices/" @@ -91,8 +89,7 @@ def test_command_component_entity(self): outputs={"component_out_path": {"type": "uri_folder"}}, command="echo Hello World", code=code, - environment="AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", - ) + environment="AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33") component_dict = component._to_rest_object().as_dict() omits = [ "properties.component_spec.$schema", @@ -123,8 +120,7 @@ def test_command_component_with_additional_includes(self): str(samples_dir / "additional_includes/assets/LICENSE"), str(samples_dir / "additional_includes/library.zip"), str(samples_dir / "additional_includes/library1"), - ], - ) + ]) component.additional_includes.append( { "type": "artifact", @@ -173,8 +169,7 @@ def test_command_component_entity_with_io_class(self): # TODO: reorganize code to minimize the code context code=".", command="""echo Hello World""", - environment="AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", - ) + environment="AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33") component_dict = component._to_rest_object().as_dict() inputs = component_dict["properties"]["component_spec"]["inputs"] outputs = component_dict["properties"]["component_spec"]["outputs"] @@ -210,10 +205,8 @@ def test_command_component_instance_count(self): parameter_server_count=1, worker_count=2, # No affect because TensorFlow object does not allow extra fields - added_property=7, - ), - instance_count=2, - ) + added_property=7), + instance_count=2) component_dict = component._to_rest_object().as_dict() yaml_path = "./tests/test_configs/components/helloworld_component_tensorflow.yml" @@ -226,16 +219,14 @@ def test_command_component_instance_count(self): "properties.component_spec.distribution.added_property", "properties.component_spec.resources.properties", "properties.component_spec._source", - "properties.properties.client_component_hash", - ) + "properties.properties.client_component_hash") yaml_component_dict = pydash.omit( yaml_component_dict, "properties.component_spec.$schema", "properties.component_spec.distribution.added_property", "properties.component_spec.resources.properties", "properties.component_spec._source", - "properties.properties.client_component_hash", - ) + "properties.properties.client_component_hash") assert component_dict == yaml_component_dict def test_command_component_code(self): @@ -248,8 +239,7 @@ def test_command_component_code(self): outputs={"component_out_path": {"type": "path"}}, command="echo Hello World", environment="AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", - code="./helloworld_components_with_env", - ) + code="./helloworld_components_with_env") yaml_path = "./tests/test_configs/components/basic_component_code_local_path.yml" yaml_component = load_component(source=yaml_path) @@ -282,8 +272,7 @@ def mock_get_arm_id_and_fill_back(asset: Code, azureml_type: str) -> None: @pytest.mark.skipif( sys.version_info[1] == 11, - reason=f"This test is not compatible with Python 3.11, skip in CI.", - ) + reason=f"This test is not compatible with Python 3.11, skip in CI.") def test_command_component_version_as_a_function(self): expected_rest_component = { "componentId": "fake_component", @@ -350,8 +339,7 @@ def test_command_component_help_function(self): "extracted_data": {"type": "path"} }, # we're using a curated environment - environment="AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", - ) + environment="AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33") basic_component = load_component(source="./tests/test_configs/components/basic_component_code_local_path.yml") sweep_component = load_component(source="./tests/test_configs/components/helloworld_component_for_sweep.yml") @@ -400,8 +388,7 @@ def test_command_help_function(self): "uri_folder": Input(type="uri_folder", path="https://my-blob/path/to/data", mode="ro_mount"), "uri_file": dict(type="uri_file", path="https://my-blob/path/to/data", mode="download"), }, - outputs={"my_model": Output(type="mlflow_model", mode="rw_mount")}, - ) + outputs={"my_model": Output(type="mlflow_model", mode="rw_mount")}) with patch("sys.stdout", new=StringIO()) as std_out: print(test_command) @@ -425,8 +412,7 @@ def test_sweep_help_function(self): sweep_job1: Sweep = cmd_node1.sweep( primary_metric="AUC", # primary_metric, goal="maximize", - sampling_algorithm="random", - ) + sampling_algorithm="random") sweep_job1.set_limits(max_total_trials=10) # max_total_trials with patch("sys.stdout", new=StringIO()) as std_out: print(sweep_job1) @@ -446,8 +432,7 @@ def test_sweep_early_termination_setter(self): sweep_job1: Sweep = cmd_node1.sweep( primary_metric="AUC", # primary_metric, goal="maximize", - sampling_algorithm="random", - ) + sampling_algorithm="random") sweep_job1.early_termination = { "type": "bandit", "evaluation_interval": 100, @@ -473,8 +458,7 @@ def test_invalid_component_inputs(self) -> None: yaml_path, params_override=[ {"inputs": {"component_in_number": {"description": "1", "type": "number"}}}, - ], - ) + ]) validation_result = component._validate() assert validation_result.passed @@ -538,8 +522,7 @@ def test_primitive_output(self): }, command="echo Hello World", environment="AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33", - code="./helloworld_components_with_env", - ) + code="./helloworld_components_with_env") actual_component_dict2 = pydash.omit( component2._to_rest_object().as_dict()["properties"]["component_spec"], *omits ) @@ -570,8 +553,7 @@ def test_component_code_asset_ignoring_pycache(self) -> None: with build_temp_folder( source_base_dir="./tests/test_configs/components", relative_files_to_copy=["helloworld_component.yml"], - extra_files_to_create={"__pycache__/a.pyc": None}, - ) as temp_dir: + extra_files_to_create={"__pycache__/a.pyc": None}) as temp_dir: # resolve and test for ignore_file's is_file_excluded component.code = temp_dir with component._build_code() as code: @@ -605,8 +587,7 @@ def test_component_with_ipp_fields(self): component_yaml = "./tests/test_configs/components/component_ipp.yml" command_component = load_component( - source=component_yaml, - ) + source=component_yaml) expected_output_dict = { "model_output_not_ipp": { @@ -679,101 +660,83 @@ def test_additional_includes(self) -> None: ( "component_with_additional_includes/.amlignore", "test_ignore/*\nlibrary1/ignore.py", - AdditionalIncludesCheckFunc.SELF_IS_FILE, - ), + AdditionalIncludesCheckFunc.SELF_IS_FILE), ( "component_with_additional_includes/test_ignore/a.py", None, - AdditionalIncludesCheckFunc.NO_PARENT, - ), + AdditionalIncludesCheckFunc.NO_PARENT), # will be saved to library1/ignore.py, should be ignored ("additional_includes/library1/ignore.py", None, AdditionalIncludesCheckFunc.NOT_EXISTS), # will be saved to library1/test_ignore, should be kept ("additional_includes/library1/test_ignore/a.py", None, AdditionalIncludesCheckFunc.SELF_IS_FILE), ], - id="amlignore", - ), + id="amlignore"), pytest.param( [ ("component_with_additional_includes/hello.py", None, AdditionalIncludesCheckFunc.SELF_IS_FILE), ( "component_with_additional_includes/test_code/.amlignore", "hello.py", - AdditionalIncludesCheckFunc.SELF_IS_FILE, - ), + AdditionalIncludesCheckFunc.SELF_IS_FILE), ( "component_with_additional_includes/test_code/hello.py", None, - AdditionalIncludesCheckFunc.NOT_EXISTS, - ), + AdditionalIncludesCheckFunc.NOT_EXISTS), # shall we keep the empty folder? ( "component_with_additional_includes/test_code/a/hello.py", None, - AdditionalIncludesCheckFunc.NO_PARENT, - ), + AdditionalIncludesCheckFunc.NO_PARENT), ], - id="amlignore_subfolder", - ), + id="amlignore_subfolder"), pytest.param( [ ( "additional_includes/library1/.amlignore", "test_ignore\nignore.py", - AdditionalIncludesCheckFunc.SELF_IS_FILE, - ), + AdditionalIncludesCheckFunc.SELF_IS_FILE), # will be saved to library1/ignore.py, should be ignored ("additional_includes/library1/ignore.py", None, AdditionalIncludesCheckFunc.NOT_EXISTS), # will be saved to library1/test_ignore, should be kept ("additional_includes/library1/test_ignore/a.py", None, AdditionalIncludesCheckFunc.NOT_EXISTS), ], - id="amlignore_in_additional_includes_folder", - ), + id="amlignore_in_additional_includes_folder"), pytest.param( [ ( "additional_includes/library1/test_ignore/.amlignore", "ignore.py", - AdditionalIncludesCheckFunc.SELF_IS_FILE, - ), + AdditionalIncludesCheckFunc.SELF_IS_FILE), # will be saved to library1/ignore.py, should be ignored ( "additional_includes/library1/test_ignore/ignore.py", None, - AdditionalIncludesCheckFunc.NOT_EXISTS, - ), + AdditionalIncludesCheckFunc.NOT_EXISTS), ], - id="amlignore_in_additional_includes_subfolder", - ), + id="amlignore_in_additional_includes_subfolder"), pytest.param( [ ( "component_with_additional_includes/__pycache__/a.pyc", None, - AdditionalIncludesCheckFunc.NO_PARENT, - ), + AdditionalIncludesCheckFunc.NO_PARENT), ( "component_with_additional_includes/test/__pycache__/a.pyc", None, - AdditionalIncludesCheckFunc.NO_PARENT, - ), + AdditionalIncludesCheckFunc.NO_PARENT), ("additional_includes/library1/__pycache__/a.pyc", None, AdditionalIncludesCheckFunc.NO_PARENT), ( "additional_includes/library1/test/__pycache__/a.pyc", None, - AdditionalIncludesCheckFunc.NO_PARENT, - ), + AdditionalIncludesCheckFunc.NO_PARENT), ], - id="pycache", - ), - ], - ) + id="pycache"), + ]) def test_additional_includes_with_ignore_file(self, test_files) -> None: with build_temp_folder( source_base_dir="./tests/test_configs/components/", relative_dirs_to_copy=["component_with_additional_includes", "additional_includes"], - extra_files_to_create={file: content for file, content, _ in test_files}, - ) as test_configs_dir: + extra_files_to_create={file: content for file, content, _ in test_files}) as test_configs_dir: yaml_path = ( Path(test_configs_dir) / "component_with_additional_includes" @@ -825,8 +788,7 @@ def test_additional_includes_merge_folder(self) -> None: [ # ("code_only/component_spec.yml", False), ("code_and_additional_includes/component_spec.yml", True), - ], - ) + ]) def test_additional_includes_with_code_specified(self, yaml_path: str, has_additional_includes: bool) -> None: yaml_path = os.path.join("./tests/test_configs/components/component_with_additional_includes/", yaml_path) component = load_component(source=yaml_path) @@ -883,8 +845,7 @@ def test_artifacts_in_additional_includes(self): RuntimeError, match="There are conflict files in additional include" ".*test_additional_include:version_1 in component-sdk-test-feed" - ".*test_additional_include:version_3 in component-sdk-test-feed", - ): + ".*test_additional_include:version_3 in component-sdk-test-feed"): with component._build_code(): pass @@ -894,20 +855,16 @@ def test_artifacts_in_additional_includes(self): pytest.param( "helloworld_invalid_additional_includes_root_directory.yml", "Root directory is not supported for additional includes", - id="root_as_additional_includes", - ), + id="root_as_additional_includes"), pytest.param( "helloworld_invalid_additional_includes_existing_file.yml", "A file already exists for additional include", - id="file_already_exists", - ), + id="file_already_exists"), pytest.param( "helloworld_invalid_additional_includes_zip_file_not_found.yml", "Unable to find additional include ../additional_includes/assets/LICENSE.zip", - id="zip_file_not_found", - ), - ], - ) + id="zip_file_not_found"), + ]) def test_invalid_additional_includes(self, yaml_path: str, expected_error_msg_prefix: str) -> None: component = load_component( os.path.join("./tests/test_configs/components/component_with_additional_includes", yaml_path) diff --git a/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_entity.py b/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_entity.py index add49479dfc7..ac8be3714f3a 100644 --- a/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_entity.py +++ b/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_entity.py @@ -94,7 +94,7 @@ def simple_job_validation(job): # same regression node won't load as AutoMLRegressionSchema since there's data binding with pytest.raises(ValidationError) as e: - AutoMLRegressionSchema(context={"base_path": "./"}).load(expected_dict) + AutoMLRegressionSchema().load(expected_dict, context={"base_path": "./"}) assert "Value '${{parent.inputs.primary_metric}}' passed is not in set" in str(e.value) def test_automl_node_in_pipeline_classification(self, mock_machinelearning_client: MLClient, mocker: MockFixture): diff --git a/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_schema.py b/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_schema.py index 4550434a959c..bc1c1ffca5c9 100644 --- a/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_schema.py +++ b/sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_schema.py @@ -1163,13 +1163,13 @@ def test_dump_distribution(self): with pytest.raises( ValidationError, match=r"Cannot dump non-PyTorchDistribution object into PyTorchDistributionSchema" ): - _ = PyTorchDistributionSchema(context={"base_path": "./"}).dump(distribution_dict) + _ = PyTorchDistributionSchema().dump(distribution_dict, context={"base_path": "./"}) with pytest.raises( ValidationError, match=r"Cannot dump non-PyTorchDistribution object into PyTorchDistributionSchema" ): - _ = PyTorchDistributionSchema(context={"base_path": "./"}).dump(distribution_obj) + _ = PyTorchDistributionSchema().dump(distribution_obj, context={"base_path": "./"}) - after_dump_correct = TensorFlowDistributionSchema(context={"base_path": "./"}).dump(distribution_obj) + after_dump_correct = TensorFlowDistributionSchema().dump(distribution_obj, context={"base_path": "./"}) assert after_dump_correct == distribution_dict def test_job_defaults(self, mocker: MockFixture):